@bkm016/basalt 0.1.0 → 0.1.2

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 (214) hide show
  1. package/README.md +16 -22
  2. package/chunk-06hdzq5n.js +2 -0
  3. package/chunk-09rj27b2.js +2 -0
  4. package/{chunk-qnr1f5pj.js → chunk-0y7ne3d0.js} +2 -2
  5. package/{chunk-8wjgbd9k.js → chunk-10xzzn07.js} +2 -2
  6. package/{chunk-bj14jshr.js → chunk-1qpces5a.js} +2 -2
  7. package/chunk-1zdwrgd4.js +2 -0
  8. package/chunk-27gntzs5.js +5 -0
  9. package/chunk-2esbgxps.js +25 -0
  10. package/{chunk-913tfr9c.js → chunk-362g64pd.js} +1 -1
  11. package/{chunk-rjdhaasf.js → chunk-3cjsd292.js} +2 -2
  12. package/chunk-5c9j8qe4.js +478 -0
  13. package/chunk-5j1krv9v.js +2 -0
  14. package/{chunk-vkkj4awb.js → chunk-6hssbcgj.js} +1 -1
  15. package/chunk-75m78j7x.js +10 -0
  16. package/{chunk-zt1wvkyf.js → chunk-8296hw9m.js} +1 -1
  17. package/{chunk-9y69ywyg.js → chunk-8d46jtbj.js} +2 -2
  18. package/{chunk-sf13azm4.js → chunk-8tjad3r0.js} +4 -4
  19. package/{chunk-agntrqs9.js → chunk-97rzj7f6.js} +1 -1
  20. package/{chunk-k7w7ac9q.js → chunk-981f9dw8.js} +8 -8
  21. package/chunk-9mmz6wt3.js +2 -0
  22. package/chunk-aefadsy6.js +3 -0
  23. package/chunk-bannb9xm.js +3 -0
  24. package/chunk-bpw6q7g0.js +3 -0
  25. package/{chunk-3jz9g8ab.js → chunk-c7x1zq39.js} +3 -3
  26. package/{chunk-rv06x0kn.js → chunk-cjc90f84.js} +1 -1
  27. package/{chunk-6gyhajhx.js → chunk-d2j735sd.js} +2 -2
  28. package/{chunk-qcwnkr5y.js → chunk-d8gtbw9g.js} +1 -1
  29. package/{chunk-rm3kcxq9.js → chunk-fjtvjrkg.js} +13 -13
  30. package/{chunk-qbf8x2ft.js → chunk-fm0k0qtz.js} +1 -1
  31. package/{chunk-1yzt0qm0.js → chunk-fw2bpqmw.js} +1 -1
  32. package/{chunk-kgdrjqsy.js → chunk-g2t6t8fk.js} +2 -2
  33. package/{chunk-wc5j0hfw.js → chunk-gp7y0fja.js} +13 -13
  34. package/{chunk-5fdgy0q2.js → chunk-gzxnene8.js} +10 -10
  35. package/{chunk-y9xe9ct2.js → chunk-hwr56pfj.js} +1 -1
  36. package/{chunk-0hbjv3y6.js → chunk-jwdb0ccj.js} +3 -3
  37. package/{chunk-x9982ek7.js → chunk-k23t7vhs.js} +5 -5
  38. package/{chunk-qffb7een.js → chunk-k506w58v.js} +2 -2
  39. package/{chunk-0tdv0t5q.js → chunk-k6w6y71k.js} +2 -2
  40. package/chunk-m40gxwq4.js +5 -0
  41. package/chunk-m8vkwdgr.js +5 -0
  42. package/{chunk-7yw8aa5j.js → chunk-mvfsxdx6.js} +13 -13
  43. package/{chunk-3p7q2pyp.js → chunk-nbb9trwz.js} +1 -1
  44. package/{chunk-0szjy61m.js → chunk-pbcy6zdt.js} +1 -1
  45. package/chunk-pmqtkqsf.js +2 -0
  46. package/{chunk-hat3s3pr.js → chunk-pxsrqrd0.js} +1 -1
  47. package/{chunk-xsbxykr4.js → chunk-qe0teyn1.js} +1 -1
  48. package/{chunk-2zqny2sy.js → chunk-r7fpkb49.js} +1 -1
  49. package/{chunk-xhk54h2q.js → chunk-rtzqqngy.js} +4 -4
  50. package/chunk-ry0z4ev6.js +2 -0
  51. package/{chunk-0rya8cxe.js → chunk-shadcb9z.js} +2 -2
  52. package/chunk-shhrr741.js +3753 -0
  53. package/{chunk-tnrqkc7b.js → chunk-t6zs4kw0.js} +2 -2
  54. package/chunk-tvm4zmgj.js +3 -0
  55. package/{chunk-hcn9cf6v.js → chunk-v258nxcz.js} +1 -1
  56. package/{chunk-a6r4z44b.js → chunk-vk1gxk1t.js} +1 -1
  57. package/{chunk-d913kpyw.js → chunk-vv7fp27r.js} +2 -2
  58. package/{chunk-g2k3yhgh.js → chunk-x1xss1d7.js} +3 -3
  59. package/{chunk-dakrpbe6.js → chunk-x4874m8e.js} +2 -2
  60. package/{chunk-wx7kdf0b.js → chunk-xfvvh1s5.js} +1 -1
  61. package/{chunk-1egbcp85.js → chunk-y0m980k3.js} +7 -7
  62. package/{chunk-5wp4egky.js → chunk-y58ygzn9.js} +4 -4
  63. package/{chunk-kjr81mrd.js → chunk-y648fzx0.js} +5 -5
  64. package/{chunk-32at88hc.js → chunk-y7nma9rk.js} +1 -1
  65. package/{chunk-wd9zxhza.js → chunk-ykens1hy.js} +1 -1
  66. package/chunk-z55bmysw.js +2 -0
  67. package/chunk-zmsgwr3s.js +2 -0
  68. package/{chunk-501zkf9b.js → chunk-ztsjgssj.js} +1 -1
  69. package/cli.js +89 -0
  70. package/compiled.js +12 -3762
  71. package/package.json +4 -3
  72. package/ui-test-worker.js +67 -67
  73. package/web/chunk-0sewdyz1.js +1 -0
  74. package/web/{chunk-g9qv15hq.js → chunk-1z5p7a1h.js} +1 -1
  75. package/web/chunk-21ke27j6.js +1 -0
  76. package/web/{chunk-svmhj9hd.js → chunk-24k0r5aq.js} +1 -1
  77. package/web/{chunk-vqjs551t.js → chunk-284a17k8.js} +1 -1
  78. package/web/{chunk-3cfabjey.js → chunk-2pjdtesn.js} +14 -14
  79. package/web/{chunk-ngpq43vn.js → chunk-3mvr2gwh.js} +1 -1
  80. package/web/chunk-3t3zwx9j.js +1 -0
  81. package/web/{chunk-ezyvv4ab.js → chunk-3z93efr4.js} +1 -1
  82. package/web/{chunk-rkesqprv.js → chunk-43jqvsrg.js} +1 -1
  83. package/web/{chunk-4y2td14d.js → chunk-4bry4xds.js} +2 -2
  84. package/web/{chunk-ea9swkkt.js → chunk-5e7ygjdn.js} +1 -1
  85. package/web/{chunk-3ahpr030.js → chunk-5jbf7n5q.js} +1 -1
  86. package/web/{chunk-bhe4jzha.js → chunk-5rx8rtsa.js} +1 -1
  87. package/web/chunk-5xc9d5ft.js +1 -0
  88. package/web/{chunk-fdkp6tzq.js → chunk-693m9kt7.js} +3 -3
  89. package/web/{chunk-mq92vqb1.js → chunk-6qejm5s2.js} +1 -1
  90. package/web/{chunk-z1jtv4c0.js → chunk-8ah6ce1b.js} +2 -2
  91. package/web/{chunk-zk2f7x5e.js → chunk-8e43yaq3.js} +3 -3
  92. package/web/{chunk-hejz98gw.js → chunk-8wye0wbb.js} +1 -1
  93. package/web/{chunk-pz934t6t.js → chunk-986z0p48.js} +5 -5
  94. package/web/{chunk-jtwhjp20.js → chunk-9dd1c37b.js} +77 -77
  95. package/web/{chunk-sc63gh9d.js → chunk-9re6yttj.js} +2 -2
  96. package/web/{chunk-1t760bg0.js → chunk-abbvjt4e.js} +1 -1
  97. package/web/{chunk-1v3d60pp.js → chunk-agmkx996.js} +3 -3
  98. package/web/{chunk-kbtbbarw.js → chunk-anbn2ttv.js} +2 -2
  99. package/web/chunk-aqm3spxt.js +1139 -0
  100. package/web/{chunk-jvhmna7z.js → chunk-avwpjsxw.js} +5 -5
  101. package/web/chunk-b470hvpk.js +1 -0
  102. package/web/{chunk-29e1trsq.js → chunk-bt1m87ck.js} +2 -2
  103. package/web/chunk-cqp1d4p0.js +1 -0
  104. package/web/{chunk-b5brnfv9.js → chunk-ctcrk3qn.js} +2 -2
  105. package/web/{chunk-zakv2xdf.js → chunk-ctd8bfg2.js} +1 -1
  106. package/web/{chunk-5hex8g0y.js → chunk-cwvtraca.js} +1 -1
  107. package/web/{chunk-1x8fn8w9.js → chunk-dk90px7g.js} +1 -1
  108. package/web/{chunk-0mrkjnte.js → chunk-ds7srg4p.js} +1 -1
  109. package/web/{chunk-6r912gfj.js → chunk-dt8ss97f.js} +5 -5
  110. package/web/{chunk-ykxpb3wv.js → chunk-ezkqa7we.js} +1 -1
  111. package/web/{chunk-svdzmaxb.js → chunk-f078k1ej.js} +1 -1
  112. package/web/chunk-fekjj24p.css +1 -0
  113. package/web/{chunk-v6v831tc.js → chunk-fqj9kry9.js} +5 -5
  114. package/web/chunk-frjfamx7.js +8 -0
  115. package/web/{chunk-rz6wwdd5.js → chunk-fy8ey195.js} +1 -1
  116. package/web/{chunk-p8y0hjx9.js → chunk-g8ee1csm.js} +1 -1
  117. package/web/{chunk-ktqt87qw.js → chunk-h31p43qa.js} +1 -1
  118. package/web/chunk-h5p5jsrw.js +1 -0
  119. package/web/chunk-h9fmr6ch.js +1 -0
  120. package/web/{chunk-x9q4kh67.js → chunk-jf2ehmvp.js} +2 -2
  121. package/web/{chunk-canbct9d.js → chunk-jmnaq7c1.js} +1 -1
  122. package/web/chunk-jq0pw0k2.js +1 -0
  123. package/web/{chunk-ghxe4gam.js → chunk-jvj66qhs.js} +2 -2
  124. package/web/{chunk-7f0m2yrd.js → chunk-jzmzhj8z.js} +4 -4
  125. package/web/chunk-k4cfnvyq.js +1 -0
  126. package/web/{chunk-942prjb6.js → chunk-kgerjbn4.js} +1 -1
  127. package/web/{chunk-3bqh2dkw.js → chunk-kww4azv5.js} +5 -5
  128. package/web/chunk-m29dhjkh.js +1 -0
  129. package/web/chunk-mj6tee5h.js +1 -0
  130. package/web/{chunk-a3xt6840.js → chunk-mjpjkyd1.js} +1 -1
  131. package/web/{chunk-20q90epj.js → chunk-n8sky2q6.js} +1 -1
  132. package/web/{chunk-3pf33xsm.js → chunk-pk3ap3wh.js} +4 -4
  133. package/web/{chunk-tfyxp2qs.js → chunk-q1pkntc6.js} +4 -4
  134. package/web/{chunk-gxn0bey7.js → chunk-qryrg2pq.js} +2 -2
  135. package/web/{chunk-0xck277j.js → chunk-r92sbgwv.js} +5 -5
  136. package/web/{chunk-ev1g5cqw.js → chunk-raqqscwa.js} +2 -2
  137. package/web/{chunk-c85wxnpw.js → chunk-rc2vq9wz.js} +3 -3
  138. package/web/{chunk-rsn8j7xv.js → chunk-rkj743fg.js} +3 -3
  139. package/web/{chunk-v47rhg7b.js → chunk-rrws61wf.js} +1 -1
  140. package/web/{chunk-ytpwz01r.js → chunk-s3hwejnr.js} +2 -2
  141. package/web/{chunk-bwyw10wx.js → chunk-s3rdx28k.js} +2 -2
  142. package/web/{chunk-hryhthxr.js → chunk-shbw6wg8.js} +1 -1
  143. package/web/chunk-szcy5z56.js +1 -0
  144. package/web/{chunk-ejd43q75.js → chunk-t1xk6hca.js} +4 -4
  145. package/web/chunk-t2hhdg9r.js +1 -0
  146. package/web/chunk-tj4cmkwe.js +1 -0
  147. package/web/{chunk-mdsgekpk.js → chunk-tn1xzmgx.js} +1 -1
  148. package/web/{chunk-0k0hvh59.js → chunk-tnv7z83q.js} +1 -1
  149. package/web/chunk-v2b5q0n5.js +1 -0
  150. package/web/{chunk-haphmhz8.js → chunk-vj6kstpp.js} +5 -5
  151. package/web/{chunk-e5rmr47n.js → chunk-vjqmnkh2.js} +1 -1
  152. package/web/{chunk-vfqe8298.js → chunk-vkc149rb.js} +1 -1
  153. package/web/{chunk-n5fn9khr.js → chunk-vny496ba.js} +1 -1
  154. package/web/{chunk-s8vapqgr.js → chunk-vz5ck6x9.js} +1 -1
  155. package/web/{chunk-6atq9qtt.js → chunk-xa88zgkr.js} +1 -1
  156. package/web/{chunk-d4d3mnak.js → chunk-xdcs8qz3.js} +4 -4
  157. package/web/chunk-y5x74t89.js +1 -0
  158. package/web/{chunk-x3zwjkwg.js → chunk-yen2kkn2.js} +1 -1
  159. package/web/{chunk-vadqkz3x.js → chunk-yjv2c45j.js} +4 -4
  160. package/web/chunk-yx3dh5hg.js +1 -0
  161. package/web/chunk-yz4fmtk2.js +1 -0
  162. package/web/{chunk-4b5mt5pd.js → chunk-z24vs8q9.js} +3 -3
  163. package/web/chunk-z5j6x6j8.js +2 -0
  164. package/web/chunk-z5stjrhc.js +1 -0
  165. package/web/{chunk-3pm4645m.js → chunk-z760wagr.js} +1 -1
  166. package/web/{chunk-nerx2q12.js → chunk-znvnb9dh.js} +1 -1
  167. package/web/{chunk-55kw67nv.js → chunk-zrzq29e6.js} +1 -1
  168. package/web/{icon-yx2p2pye.svg → icon-1wgy7kzy.svg} +13 -13
  169. package/web/icon.svg +13 -13
  170. package/web/index.html +2 -2
  171. package/web/install.sh +0 -0
  172. package/web/sw.js +9 -0
  173. package/worker.js +1 -1
  174. package/chunk-1fv27j4b.js +0 -3
  175. package/chunk-356q8e0y.js +0 -10
  176. package/chunk-58vz2qsq.js +0 -2
  177. package/chunk-665jzf2w.js +0 -25
  178. package/chunk-97kjn55j.js +0 -2
  179. package/chunk-b9bg5fhd.js +0 -2
  180. package/chunk-c25s4w6a.js +0 -5
  181. package/chunk-j2x0g1vg.js +0 -2
  182. package/chunk-k0t23cmx.js +0 -2
  183. package/chunk-m38ber71.js +0 -2
  184. package/chunk-rad3dm0q.js +0 -2
  185. package/chunk-sytpmbfp.js +0 -471
  186. package/chunk-t057xfrt.js +0 -5
  187. package/chunk-tjpvayr1.js +0 -2
  188. package/chunk-ve7qx8wm.js +0 -3
  189. package/chunk-y8ced1jm.js +0 -5
  190. package/chunk-yb1jxgnk.js +0 -2
  191. package/web/chunk-00mq7bhx.js +0 -1
  192. package/web/chunk-0atfn8jf.js +0 -1
  193. package/web/chunk-310yey4q.js +0 -1
  194. package/web/chunk-32ezm0ry.js +0 -1136
  195. package/web/chunk-3hvgs5aw.js +0 -1
  196. package/web/chunk-3kh6zefg.js +0 -1
  197. package/web/chunk-401v5ht6.js +0 -8
  198. package/web/chunk-5r5kv4gh.js +0 -1
  199. package/web/chunk-95q1bwxn.js +0 -1
  200. package/web/chunk-9s7c178f.js +0 -1
  201. package/web/chunk-benmmqt2.js +0 -1
  202. package/web/chunk-bgqdcnke.js +0 -1
  203. package/web/chunk-eqegxtdt.js +0 -1
  204. package/web/chunk-gmfp7fg4.js +0 -1
  205. package/web/chunk-gxay64d5.js +0 -1
  206. package/web/chunk-jg6nzn6q.js +0 -1
  207. package/web/chunk-kx2xk3bb.js +0 -1
  208. package/web/chunk-ry9256r7.js +0 -1
  209. package/web/chunk-vfqdy860.js +0 -1
  210. package/web/chunk-wtawdeej.css +0 -1
  211. package/web/chunk-x59p8sg2.js +0 -1
  212. package/web/chunk-y7z144e3.js +0 -1
  213. package/web/chunk-ydgqrfvw.js +0 -2
  214. package/web/chunk-yj1a2d37.js +0 -1
@@ -1,9 +1,9 @@
1
- import{e,Yt,r,se,y,C,S,E,T,A,I,L,s,p,N,Fe,Xr,le,ae,ie,ft,he,ge}from"./chunk-jtwhjp20.js";import{Pt}from"./chunk-ydgqrfvw.js";import{fe}from"./chunk-b5brnfv9.js";import{oe}from"./chunk-kbtbbarw.js";var Ue=function(){var i=e(function(q,l,h,f){for(h=h||{},f=q.length;f--;h[q[f]]=l);return h},"o"),c=[6,9,21,23,25,27,34,37,38,39,40,41,43,46,47,51,53,54,55],b=[2,2],o=[1,7],u=[1,9],g=[1,10],R=[1,11],_=[1,12],v=[1,30],k=[1,23],m=[1,24],B=[1,25],W=[1,26],X=[1,27],D=[1,19],Y=[1,28],te=[1,29],G=[1,20],P=[1,18],z=[1,21],U=[1,22],Ke=[2,6],d=[6,9,21,23,25,27,33,34,37,38,39,40,41,43,46,47,51,53,54,55],Re=[1,36],ve=[1,37],De=[1,38],Le=[1,39],we=[1,40],re=[6,9,12,14,16,19,20,21,23,25,27,33,34,37,38,39,40,41,43,46,47,50,51,53,54,55,69,70,71,72,73],K=[1,46],Z=[1,47],ne=[1,57],ce=[43,51,53,54,55,74,75],ue=[1,70],de=[1,68],j=[1,65],be=[1,69],pe=[1,71],_e=[6,9,12,16,21,23,25,27,33,34,37,38,39,40,41,43,44,45,46,47,51,52,53,54,55,69,70,71,72,73],me=[1,78],Ee=[1,77],Se=[1,76],Ze=[69,70,71,72,73],je=[1,91],qe=[6,9,45,50],J=[6,9,12,44,45,50,51,52],Te=[1,101],Ce=[1,100],Oe=[1,99],ke=[18,61],We=[1,110],He=[1,109],Qe=[20,43,51,53,54,55],Ve=[18,61,64,66],Me={trace:e(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,statement:8,NEWLINE:9,entityName:10,relSpec:11,COLON:12,role:13,STYLE_SEPARATOR:14,idList:15,BLOCK_START:16,attributes:17,BLOCK_STOP:18,SQS:19,SQE:20,title:21,title_value:22,acc_title:23,acc_title_value:24,acc_descr:25,acc_descr_value:26,acc_descr_multiline_value:27,direction:28,classDefStatement:29,classStatement:30,styleStatement:31,subgraphHeader:32,END:33,SUBGRAPH:34,separator:35,subgraphTitle:36,direction_tb:37,direction_bt:38,direction_rl:39,direction_lr:40,CLASSDEF:41,stylesOpt:42,UNICODE_TEXT:43,STYLE_TEXT:44,COMMA:45,CLASS:46,STYLE:47,style:48,styleComponent:49,SEMI:50,NUM:51,BRKT:52,ENTITY_NAME:53,DECIMAL_NUM:54,ENTITY_ONE:55,attribute:56,attributeType:57,attributeName:58,attributeKeyTypeList:59,attributeComment:60,ATTRIBUTE_WORD:61,"?":62,attributeKeyType:63,",":64,ATTRIBUTE_KEY:65,COMMENT:66,cardinality:67,relType:68,ZERO_OR_ONE:69,ZERO_OR_MORE:70,ONE_OR_MORE:71,ONLY_ONE:72,MD_PARENT:73,NON_IDENTIFYING:74,IDENTIFYING:75,WORD:76,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",9:"NEWLINE",12:"COLON",14:"STYLE_SEPARATOR",16:"BLOCK_START",18:"BLOCK_STOP",19:"SQS",20:"SQE",21:"title",22:"title_value",23:"acc_title",24:"acc_title_value",25:"acc_descr",26:"acc_descr_value",27:"acc_descr_multiline_value",33:"END",34:"SUBGRAPH",37:"direction_tb",38:"direction_bt",39:"direction_rl",40:"direction_lr",41:"CLASSDEF",43:"UNICODE_TEXT",44:"STYLE_TEXT",45:"COMMA",46:"CLASS",47:"STYLE",50:"SEMI",51:"NUM",52:"BRKT",53:"ENTITY_NAME",54:"DECIMAL_NUM",55:"ENTITY_ONE",61:"ATTRIBUTE_WORD",62:"?",64:",",65:"ATTRIBUTE_KEY",66:"COMMENT",69:"ZERO_OR_ONE",70:"ZERO_OR_MORE",71:"ONE_OR_MORE",72:"ONLY_ONE",73:"MD_PARENT",74:"NON_IDENTIFYING",75:"IDENTIFYING",76:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,1],[7,1],[7,1],[8,5],[8,9],[8,7],[8,7],[8,4],[8,6],[8,3],[8,5],[8,1],[8,3],[8,7],[8,9],[8,6],[8,8],[8,4],[8,6],[8,2],[8,2],[8,2],[8,1],[8,1],[8,1],[8,1],[8,1],[8,3],[32,3],[32,6],[36,1],[36,2],[28,1],[28,1],[28,1],[28,1],[29,4],[15,1],[15,1],[15,3],[15,3],[30,3],[31,4],[42,1],[42,3],[48,1],[48,2],[35,1],[35,1],[35,1],[49,1],[49,1],[49,1],[49,1],[10,1],[10,1],[10,1],[10,1],[10,1],[17,1],[17,2],[56,2],[56,3],[56,3],[56,4],[57,1],[57,2],[58,1],[59,1],[59,3],[63,1],[60,1],[11,3],[67,1],[67,1],[67,1],[67,1],[67,1],[68,1],[68,1],[13,1],[13,1],[13,1]],performAction:e(function(l,h,f,n,O,t,ye){var a=t.length-1;switch(O){case 1:break;case 2:this.$=[];break;case 3:this.$=t[a-1].concat(t[a]);break;case 4:this.$=t[a];break;case 5:case 6:this.$=[];break;case 7:n.addEntity(t[a-4]),n.addEntity(t[a-2]),n.addRelationship(t[a-4],t[a],t[a-2],t[a-3]),this.$=[t[a-4],t[a-2]];break;case 8:n.addEntity(t[a-8]),n.addEntity(t[a-4]),n.addRelationship(t[a-8],t[a],t[a-4],t[a-5]),n.setClass([t[a-8]],t[a-6]),n.setClass([t[a-4]],t[a-2]),this.$=[t[a-8],t[a-4]];break;case 9:n.addEntity(t[a-6]),n.addEntity(t[a-2]),n.addRelationship(t[a-6],t[a],t[a-2],t[a-3]),n.setClass([t[a-6]],t[a-4]),this.$=[t[a-6],t[a-2]];break;case 10:n.addEntity(t[a-6]),n.addEntity(t[a-4]),n.addRelationship(t[a-6],t[a],t[a-4],t[a-5]),n.setClass([t[a-4]],t[a-2]),this.$=[t[a-6],t[a-4]];break;case 11:n.addEntity(t[a-3]),n.addAttributes(t[a-3],t[a-1]),this.$=[t[a-3]];break;case 12:n.addEntity(t[a-5]),n.addAttributes(t[a-5],t[a-1]),n.setClass([t[a-5]],t[a-3]),this.$=[t[a-5]];break;case 13:n.addEntity(t[a-2]),this.$=[t[a-2]];break;case 14:n.addEntity(t[a-4]),n.setClass([t[a-4]],t[a-2]),this.$=[t[a-4]];break;case 15:n.addEntity(t[a]),this.$=[t[a]];break;case 16:n.addEntity(t[a-2]),n.setClass([t[a-2]],t[a]),this.$=[t[a-2]];break;case 17:n.addEntity(t[a-6],t[a-4]),n.addAttributes(t[a-6],t[a-1]),this.$=[t[a-6]];break;case 18:n.addEntity(t[a-8],t[a-6]),n.addAttributes(t[a-8],t[a-1]),n.setClass([t[a-8]],t[a-3]),this.$=[t[a-8]];break;case 19:n.addEntity(t[a-5],t[a-3]),this.$=[t[a-5]];break;case 20:n.addEntity(t[a-7],t[a-5]),n.setClass([t[a-7]],t[a-2]),this.$=[t[a-7]];break;case 21:n.addEntity(t[a-3],t[a-1]);break;case 22:n.addEntity(t[a-5],t[a-3]),n.setClass([t[a-5]],t[a]);break;case 23:case 24:this.$=t[a].trim(),n.setAccTitle(this.$);break;case 25:case 26:this.$=t[a].trim(),n.setAccDescription(this.$);break;case 27:if(!n.subgraphDepth)n.setDirection(t[a].value),this.$=[];else this.$=t[a];break;case 31:n.subgraphDepth=(n.subgraphDepth||1)-1,this.$=n.addSubGraph({text:t[a-2].id},t[a-1],{text:t[a-2].text});break;case 32:n.subgraphDepth=(n.subgraphDepth||0)+1,this.$={id:t[a-1],text:t[a-1]};break;case 33:n.subgraphDepth=(n.subgraphDepth||0)+1,this.$={id:t[a-4],text:t[a-2]};break;case 34:case 59:case 60:case 61:case 62:case 86:this.$=t[a];break;case 35:this.$=t[a-1]+" "+t[a];break;case 36:this.$={stmt:"dir",value:"TB"};break;case 37:this.$={stmt:"dir",value:"BT"};break;case 38:this.$={stmt:"dir",value:"RL"};break;case 39:this.$={stmt:"dir",value:"LR"};break;case 40:this.$=t[a-3],n.addClass(t[a-2],t[a-1]);break;case 41:case 42:case 63:case 72:this.$=[t[a]];break;case 43:case 44:this.$=t[a-2].concat([t[a]]);break;case 45:this.$=t[a-2],n.setClass(t[a-1],t[a]);break;case 46:this.$=t[a-3],n.addCssStyles(t[a-2],t[a-1]);break;case 47:this.$=[t[a]];break;case 48:t[a-2].push(t[a]),this.$=t[a-2];break;case 50:this.$=t[a-1]+t[a];break;case 58:case 84:case 85:this.$=t[a].replace(/"/g,"");break;case 64:t[a].push(t[a-1]),this.$=t[a];break;case 65:this.$={type:t[a-1],name:t[a]};break;case 66:this.$={type:t[a-2],name:t[a-1],keys:t[a]};break;case 67:this.$={type:t[a-2],name:t[a-1],comment:t[a]};break;case 68:this.$={type:t[a-3],name:t[a-2],keys:t[a-1],comment:t[a]};break;case 69:case 71:case 74:this.$=t[a];break;case 70:this.$=t[a-1]+t[a];break;case 73:t[a-2].push(t[a]),this.$=t[a-2];break;case 75:this.$=t[a].replace(/"/g,"");break;case 76:this.$={cardA:t[a],relType:t[a-1],cardB:t[a-2]};break;case 77:this.$=n.Cardinality.ZERO_OR_ONE;break;case 78:this.$=n.Cardinality.ZERO_OR_MORE;break;case 79:this.$=n.Cardinality.ONE_OR_MORE;break;case 80:this.$=n.Cardinality.ONLY_ONE;break;case 81:this.$=n.Cardinality.MD_PARENT;break;case 82:this.$=n.Identification.NON_IDENTIFYING;break;case 83:this.$=n.Identification.IDENTIFYING;break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},i(c,b,{5:3}),{6:[1,4],7:5,8:6,9:o,10:8,21:u,23:g,25:R,27:_,28:13,29:14,30:15,31:16,32:17,34:v,37:k,38:m,39:B,40:W,41:X,43:D,46:Y,47:te,51:G,53:P,54:z,55:U},i(c,Ke,{1:[2,1]}),i(d,[2,3]),i(d,[2,4]),i(d,[2,5]),i(d,[2,15],{11:31,67:35,14:[1,32],16:[1,33],19:[1,34],69:Re,70:ve,71:De,72:Le,73:we}),{22:[1,41]},{24:[1,42]},{26:[1,43]},i(d,[2,26]),i(d,[2,27]),i(d,[2,28]),i(d,[2,29]),i(d,[2,30]),i(d,b,{5:44}),i(re,[2,58]),i(re,[2,59]),i(re,[2,60]),i(re,[2,61]),i(re,[2,62]),i(d,[2,36]),i(d,[2,37]),i(d,[2,38]),i(d,[2,39]),{15:45,43:K,44:Z},{15:48,43:K,44:Z},{15:49,43:K,44:Z},{10:50,43:D,51:G,53:P,54:z,55:U},{10:51,43:D,51:G,53:P,54:z,55:U},{15:52,43:K,44:Z},{17:53,18:[1,54],56:55,57:56,61:ne},{10:58,43:D,51:G,53:P,54:z,55:U},{68:59,74:[1,60],75:[1,61]},i(ce,[2,77]),i(ce,[2,78]),i(ce,[2,79]),i(ce,[2,80]),i(ce,[2,81]),i(d,[2,23]),i(d,[2,24]),i(d,[2,25]),{6:[1,63],7:5,8:6,9:o,10:8,21:u,23:g,25:R,27:_,28:13,29:14,30:15,31:16,32:17,33:[1,62],34:v,37:k,38:m,39:B,40:W,41:X,43:D,46:Y,47:te,51:G,53:P,54:z,55:U},{12:ue,42:64,44:de,45:j,48:66,49:67,51:be,52:pe},i(_e,[2,41]),i(_e,[2,42]),{15:72,43:K,44:Z,45:j},{12:ue,42:73,44:de,45:j,48:66,49:67,51:be,52:pe},{6:me,9:Ee,19:[1,75],35:74,50:Se},{12:[1,79],14:[1,80]},i(d,[2,16],{67:35,11:81,16:[1,82],45:j,69:Re,70:ve,71:De,72:Le,73:we}),{18:[1,83]},i(d,[2,13]),{17:84,18:[2,63],56:55,57:56,61:ne},{58:85,61:[1,86]},{61:[2,69],62:[1,87]},{20:[1,88]},{67:89,69:Re,70:ve,71:De,72:Le,73:we},i(Ze,[2,82]),i(Ze,[2,83]),i(d,[2,31]),i(d,Ke),{6:me,9:Ee,35:90,45:je,50:Se},{43:[1,92],44:[1,93]},i(qe,[2,47],{49:94,12:ue,44:de,51:be,52:pe}),i(J,[2,49]),i(J,[2,54]),i(J,[2,55]),i(J,[2,56]),i(J,[2,57]),i(d,[2,45],{45:j}),{6:me,9:Ee,35:95,45:je,50:Se},i(d,[2,32]),{10:97,36:96,43:D,51:G,53:P,54:z,55:U},i(d,[2,51]),i(d,[2,52]),i(d,[2,53]),{13:98,43:Te,53:Ce,76:Oe},{15:102,43:K,44:Z},{10:103,43:D,51:G,53:P,54:z,55:U},{17:104,18:[1,105],56:55,57:56,61:ne},i(d,[2,11]),{18:[2,64]},i(ke,[2,65],{59:106,60:107,63:108,65:We,66:He}),i([18,61,65,66],[2,71]),{61:[2,70]},i(d,[2,21],{14:[1,112],16:[1,111]}),i([43,51,53,54,55],[2,76]),i(d,[2,40]),{12:ue,44:de,48:113,49:67,51:be,52:pe},i(_e,[2,43]),i(_e,[2,44]),i(J,[2,50]),i(d,[2,46]),{10:115,20:[1,114],43:D,51:G,53:P,54:z,55:U},i(Qe,[2,34]),i(d,[2,7]),i(d,[2,84]),i(d,[2,85]),i(d,[2,86]),{12:[1,116],45:j},{12:[1,118],14:[1,117]},{18:[1,119]},i(d,[2,14]),i(ke,[2,66],{60:120,64:[1,121],66:He}),i(ke,[2,67]),i(Ve,[2,72]),i(ke,[2,75]),i(Ve,[2,74]),{17:122,18:[1,123],56:55,57:56,61:ne},{15:124,43:K,44:Z},i(qe,[2,48],{49:94,12:ue,44:de,51:be,52:pe}),{6:me,9:Ee,35:125,50:Se},i(Qe,[2,35]),{13:126,43:Te,53:Ce,76:Oe},{15:127,43:K,44:Z},{13:128,43:Te,53:Ce,76:Oe},i(d,[2,12]),i(ke,[2,68]),{63:129,65:We},{18:[1,130]},i(d,[2,19]),i(d,[2,22],{16:[1,131],45:j}),i(d,[2,33]),i(d,[2,10]),{12:[1,132],45:j},i(d,[2,9]),i(Ve,[2,73]),i(d,[2,17]),{17:133,18:[1,134],56:55,57:56,61:ne},{13:135,43:Te,53:Ce,76:Oe},{18:[1,136]},i(d,[2,20]),i(d,[2,8]),i(d,[2,18])],defaultActions:{84:[2,64],87:[2,70]},parseError:e(function(l,h){if(h.recoverable)this.trace(l);else{var f=Error(l);throw f.hash=h,f}},"parseError"),parse:e(function(l){var h=this,f=[0],n=[],O=[null],t=[],ye=this.table,a="",xe=0,Xe=0,Je=0,at=2,$e=1,nt=t.slice.call(arguments,1),x=Object.create(this.lexer),H={yy:{}};for(var Be in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,Be))H.yy[Be]=this.yy[Be];if(x.setInput(l,H.yy),H.yy.lexer=x,H.yy.parser=this,typeof x.yylloc>"u")x.yylloc={};var Ge=x.yylloc;t.push(Ge);var ot=x.options&&x.options.ranges;if(typeof H.yy.parseError==="function")this.parseError=H.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function lt(M){f.length=f.length-2*M,O.length=O.length-M,t.length=t.length-M}e(lt,"popStack");function et(){var M=n.pop()||x.lex()||$e;if(typeof M!=="number"){if(M instanceof Array)n=M,M=n.pop();M=h.symbols_[M]||M}return M}e(et,"lex");var w,Ye,Q,V,kt,Pe,ee={},Ae,F,tt,Ie;while(!0){if(Q=f[f.length-1],this.defaultActions[Q])V=this.defaultActions[Q];else{if(w===null||typeof w>"u")w=et();V=ye[Q]&&ye[Q][w]}if(typeof V>"u"||!V.length||!V[0]){var ze="";Ie=[];for(Ae in ye[Q])if(this.terminals_[Ae]&&Ae>at)Ie.push("'"+this.terminals_[Ae]+"'");if(x.showPosition)ze="Parse error on line "+(xe+1)+`:
1
+ import{e,Zt,r,le,y,C,S,E,T,A,I,L,s,p,N,Fe,Xr,ce,ae,ie,ft,ge,ye}from"./chunk-9dd1c37b.js";import{Ot}from"./chunk-z5j6x6j8.js";import{he}from"./chunk-ctcrk3qn.js";import{se}from"./chunk-anbn2ttv.js";var Ue=function(){var i=e(function(q,l,h,f){for(h=h||{},f=q.length;f--;h[q[f]]=l);return h},"o"),c=[6,9,21,23,25,27,34,37,38,39,40,41,43,46,47,51,53,54,55],b=[2,2],o=[1,7],u=[1,9],g=[1,10],R=[1,11],_=[1,12],v=[1,30],k=[1,23],m=[1,24],B=[1,25],W=[1,26],X=[1,27],D=[1,19],Y=[1,28],te=[1,29],G=[1,20],P=[1,18],z=[1,21],U=[1,22],Ke=[2,6],d=[6,9,21,23,25,27,33,34,37,38,39,40,41,43,46,47,51,53,54,55],Re=[1,36],ve=[1,37],De=[1,38],Le=[1,39],we=[1,40],re=[6,9,12,14,16,19,20,21,23,25,27,33,34,37,38,39,40,41,43,46,47,50,51,53,54,55,69,70,71,72,73],K=[1,46],Z=[1,47],ne=[1,57],oe=[43,51,53,54,55,74,75],ue=[1,70],de=[1,68],j=[1,65],be=[1,69],pe=[1,71],_e=[6,9,12,16,21,23,25,27,33,34,37,38,39,40,41,43,44,45,46,47,51,52,53,54,55,69,70,71,72,73],me=[1,78],Ee=[1,77],Se=[1,76],Ze=[69,70,71,72,73],je=[1,91],qe=[6,9,45,50],J=[6,9,12,44,45,50,51,52],Te=[1,101],Ce=[1,100],Oe=[1,99],fe=[18,61],We=[1,110],He=[1,109],Qe=[20,43,51,53,54,55],Ve=[18,61,64,66],Me={trace:e(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,statement:8,NEWLINE:9,entityName:10,relSpec:11,COLON:12,role:13,STYLE_SEPARATOR:14,idList:15,BLOCK_START:16,attributes:17,BLOCK_STOP:18,SQS:19,SQE:20,title:21,title_value:22,acc_title:23,acc_title_value:24,acc_descr:25,acc_descr_value:26,acc_descr_multiline_value:27,direction:28,classDefStatement:29,classStatement:30,styleStatement:31,subgraphHeader:32,END:33,SUBGRAPH:34,separator:35,subgraphTitle:36,direction_tb:37,direction_bt:38,direction_rl:39,direction_lr:40,CLASSDEF:41,stylesOpt:42,UNICODE_TEXT:43,STYLE_TEXT:44,COMMA:45,CLASS:46,STYLE:47,style:48,styleComponent:49,SEMI:50,NUM:51,BRKT:52,ENTITY_NAME:53,DECIMAL_NUM:54,ENTITY_ONE:55,attribute:56,attributeType:57,attributeName:58,attributeKeyTypeList:59,attributeComment:60,ATTRIBUTE_WORD:61,"?":62,attributeKeyType:63,",":64,ATTRIBUTE_KEY:65,COMMENT:66,cardinality:67,relType:68,ZERO_OR_ONE:69,ZERO_OR_MORE:70,ONE_OR_MORE:71,ONLY_ONE:72,MD_PARENT:73,NON_IDENTIFYING:74,IDENTIFYING:75,WORD:76,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",9:"NEWLINE",12:"COLON",14:"STYLE_SEPARATOR",16:"BLOCK_START",18:"BLOCK_STOP",19:"SQS",20:"SQE",21:"title",22:"title_value",23:"acc_title",24:"acc_title_value",25:"acc_descr",26:"acc_descr_value",27:"acc_descr_multiline_value",33:"END",34:"SUBGRAPH",37:"direction_tb",38:"direction_bt",39:"direction_rl",40:"direction_lr",41:"CLASSDEF",43:"UNICODE_TEXT",44:"STYLE_TEXT",45:"COMMA",46:"CLASS",47:"STYLE",50:"SEMI",51:"NUM",52:"BRKT",53:"ENTITY_NAME",54:"DECIMAL_NUM",55:"ENTITY_ONE",61:"ATTRIBUTE_WORD",62:"?",64:",",65:"ATTRIBUTE_KEY",66:"COMMENT",69:"ZERO_OR_ONE",70:"ZERO_OR_MORE",71:"ONE_OR_MORE",72:"ONLY_ONE",73:"MD_PARENT",74:"NON_IDENTIFYING",75:"IDENTIFYING",76:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,1],[7,1],[7,1],[8,5],[8,9],[8,7],[8,7],[8,4],[8,6],[8,3],[8,5],[8,1],[8,3],[8,7],[8,9],[8,6],[8,8],[8,4],[8,6],[8,2],[8,2],[8,2],[8,1],[8,1],[8,1],[8,1],[8,1],[8,3],[32,3],[32,6],[36,1],[36,2],[28,1],[28,1],[28,1],[28,1],[29,4],[15,1],[15,1],[15,3],[15,3],[30,3],[31,4],[42,1],[42,3],[48,1],[48,2],[35,1],[35,1],[35,1],[49,1],[49,1],[49,1],[49,1],[10,1],[10,1],[10,1],[10,1],[10,1],[17,1],[17,2],[56,2],[56,3],[56,3],[56,4],[57,1],[57,2],[58,1],[59,1],[59,3],[63,1],[60,1],[11,3],[67,1],[67,1],[67,1],[67,1],[67,1],[68,1],[68,1],[13,1],[13,1],[13,1]],performAction:e(function(l,h,f,n,O,t,ke){var a=t.length-1;switch(O){case 1:break;case 2:this.$=[];break;case 3:this.$=t[a-1].concat(t[a]);break;case 4:this.$=t[a];break;case 5:case 6:this.$=[];break;case 7:n.addEntity(t[a-4]),n.addEntity(t[a-2]),n.addRelationship(t[a-4],t[a],t[a-2],t[a-3]),this.$=[t[a-4],t[a-2]];break;case 8:n.addEntity(t[a-8]),n.addEntity(t[a-4]),n.addRelationship(t[a-8],t[a],t[a-4],t[a-5]),n.setClass([t[a-8]],t[a-6]),n.setClass([t[a-4]],t[a-2]),this.$=[t[a-8],t[a-4]];break;case 9:n.addEntity(t[a-6]),n.addEntity(t[a-2]),n.addRelationship(t[a-6],t[a],t[a-2],t[a-3]),n.setClass([t[a-6]],t[a-4]),this.$=[t[a-6],t[a-2]];break;case 10:n.addEntity(t[a-6]),n.addEntity(t[a-4]),n.addRelationship(t[a-6],t[a],t[a-4],t[a-5]),n.setClass([t[a-4]],t[a-2]),this.$=[t[a-6],t[a-4]];break;case 11:n.addEntity(t[a-3]),n.addAttributes(t[a-3],t[a-1]),this.$=[t[a-3]];break;case 12:n.addEntity(t[a-5]),n.addAttributes(t[a-5],t[a-1]),n.setClass([t[a-5]],t[a-3]),this.$=[t[a-5]];break;case 13:n.addEntity(t[a-2]),this.$=[t[a-2]];break;case 14:n.addEntity(t[a-4]),n.setClass([t[a-4]],t[a-2]),this.$=[t[a-4]];break;case 15:n.addEntity(t[a]),this.$=[t[a]];break;case 16:n.addEntity(t[a-2]),n.setClass([t[a-2]],t[a]),this.$=[t[a-2]];break;case 17:n.addEntity(t[a-6],t[a-4]),n.addAttributes(t[a-6],t[a-1]),this.$=[t[a-6]];break;case 18:n.addEntity(t[a-8],t[a-6]),n.addAttributes(t[a-8],t[a-1]),n.setClass([t[a-8]],t[a-3]),this.$=[t[a-8]];break;case 19:n.addEntity(t[a-5],t[a-3]),this.$=[t[a-5]];break;case 20:n.addEntity(t[a-7],t[a-5]),n.setClass([t[a-7]],t[a-2]),this.$=[t[a-7]];break;case 21:n.addEntity(t[a-3],t[a-1]);break;case 22:n.addEntity(t[a-5],t[a-3]),n.setClass([t[a-5]],t[a]);break;case 23:case 24:this.$=t[a].trim(),n.setAccTitle(this.$);break;case 25:case 26:this.$=t[a].trim(),n.setAccDescription(this.$);break;case 27:if(!n.subgraphDepth)n.setDirection(t[a].value),this.$=[];else this.$=t[a];break;case 31:n.subgraphDepth=(n.subgraphDepth||1)-1,this.$=n.addSubGraph({text:t[a-2].id},t[a-1],{text:t[a-2].text});break;case 32:n.subgraphDepth=(n.subgraphDepth||0)+1,this.$={id:t[a-1],text:t[a-1]};break;case 33:n.subgraphDepth=(n.subgraphDepth||0)+1,this.$={id:t[a-4],text:t[a-2]};break;case 34:case 59:case 60:case 61:case 62:case 86:this.$=t[a];break;case 35:this.$=t[a-1]+" "+t[a];break;case 36:this.$={stmt:"dir",value:"TB"};break;case 37:this.$={stmt:"dir",value:"BT"};break;case 38:this.$={stmt:"dir",value:"RL"};break;case 39:this.$={stmt:"dir",value:"LR"};break;case 40:this.$=t[a-3],n.addClass(t[a-2],t[a-1]);break;case 41:case 42:case 63:case 72:this.$=[t[a]];break;case 43:case 44:this.$=t[a-2].concat([t[a]]);break;case 45:this.$=t[a-2],n.setClass(t[a-1],t[a]);break;case 46:this.$=t[a-3],n.addCssStyles(t[a-2],t[a-1]);break;case 47:this.$=[t[a]];break;case 48:t[a-2].push(t[a]),this.$=t[a-2];break;case 50:this.$=t[a-1]+t[a];break;case 58:case 84:case 85:this.$=t[a].replace(/"/g,"");break;case 64:t[a].push(t[a-1]),this.$=t[a];break;case 65:this.$={type:t[a-1],name:t[a]};break;case 66:this.$={type:t[a-2],name:t[a-1],keys:t[a]};break;case 67:this.$={type:t[a-2],name:t[a-1],comment:t[a]};break;case 68:this.$={type:t[a-3],name:t[a-2],keys:t[a-1],comment:t[a]};break;case 69:case 71:case 74:this.$=t[a];break;case 70:this.$=t[a-1]+t[a];break;case 73:t[a-2].push(t[a]),this.$=t[a-2];break;case 75:this.$=t[a].replace(/"/g,"");break;case 76:this.$={cardA:t[a],relType:t[a-1],cardB:t[a-2]};break;case 77:this.$=n.Cardinality.ZERO_OR_ONE;break;case 78:this.$=n.Cardinality.ZERO_OR_MORE;break;case 79:this.$=n.Cardinality.ONE_OR_MORE;break;case 80:this.$=n.Cardinality.ONLY_ONE;break;case 81:this.$=n.Cardinality.MD_PARENT;break;case 82:this.$=n.Identification.NON_IDENTIFYING;break;case 83:this.$=n.Identification.IDENTIFYING;break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},i(c,b,{5:3}),{6:[1,4],7:5,8:6,9:o,10:8,21:u,23:g,25:R,27:_,28:13,29:14,30:15,31:16,32:17,34:v,37:k,38:m,39:B,40:W,41:X,43:D,46:Y,47:te,51:G,53:P,54:z,55:U},i(c,Ke,{1:[2,1]}),i(d,[2,3]),i(d,[2,4]),i(d,[2,5]),i(d,[2,15],{11:31,67:35,14:[1,32],16:[1,33],19:[1,34],69:Re,70:ve,71:De,72:Le,73:we}),{22:[1,41]},{24:[1,42]},{26:[1,43]},i(d,[2,26]),i(d,[2,27]),i(d,[2,28]),i(d,[2,29]),i(d,[2,30]),i(d,b,{5:44}),i(re,[2,58]),i(re,[2,59]),i(re,[2,60]),i(re,[2,61]),i(re,[2,62]),i(d,[2,36]),i(d,[2,37]),i(d,[2,38]),i(d,[2,39]),{15:45,43:K,44:Z},{15:48,43:K,44:Z},{15:49,43:K,44:Z},{10:50,43:D,51:G,53:P,54:z,55:U},{10:51,43:D,51:G,53:P,54:z,55:U},{15:52,43:K,44:Z},{17:53,18:[1,54],56:55,57:56,61:ne},{10:58,43:D,51:G,53:P,54:z,55:U},{68:59,74:[1,60],75:[1,61]},i(oe,[2,77]),i(oe,[2,78]),i(oe,[2,79]),i(oe,[2,80]),i(oe,[2,81]),i(d,[2,23]),i(d,[2,24]),i(d,[2,25]),{6:[1,63],7:5,8:6,9:o,10:8,21:u,23:g,25:R,27:_,28:13,29:14,30:15,31:16,32:17,33:[1,62],34:v,37:k,38:m,39:B,40:W,41:X,43:D,46:Y,47:te,51:G,53:P,54:z,55:U},{12:ue,42:64,44:de,45:j,48:66,49:67,51:be,52:pe},i(_e,[2,41]),i(_e,[2,42]),{15:72,43:K,44:Z,45:j},{12:ue,42:73,44:de,45:j,48:66,49:67,51:be,52:pe},{6:me,9:Ee,19:[1,75],35:74,50:Se},{12:[1,79],14:[1,80]},i(d,[2,16],{67:35,11:81,16:[1,82],45:j,69:Re,70:ve,71:De,72:Le,73:we}),{18:[1,83]},i(d,[2,13]),{17:84,18:[2,63],56:55,57:56,61:ne},{58:85,61:[1,86]},{61:[2,69],62:[1,87]},{20:[1,88]},{67:89,69:Re,70:ve,71:De,72:Le,73:we},i(Ze,[2,82]),i(Ze,[2,83]),i(d,[2,31]),i(d,Ke),{6:me,9:Ee,35:90,45:je,50:Se},{43:[1,92],44:[1,93]},i(qe,[2,47],{49:94,12:ue,44:de,51:be,52:pe}),i(J,[2,49]),i(J,[2,54]),i(J,[2,55]),i(J,[2,56]),i(J,[2,57]),i(d,[2,45],{45:j}),{6:me,9:Ee,35:95,45:je,50:Se},i(d,[2,32]),{10:97,36:96,43:D,51:G,53:P,54:z,55:U},i(d,[2,51]),i(d,[2,52]),i(d,[2,53]),{13:98,43:Te,53:Ce,76:Oe},{15:102,43:K,44:Z},{10:103,43:D,51:G,53:P,54:z,55:U},{17:104,18:[1,105],56:55,57:56,61:ne},i(d,[2,11]),{18:[2,64]},i(fe,[2,65],{59:106,60:107,63:108,65:We,66:He}),i([18,61,65,66],[2,71]),{61:[2,70]},i(d,[2,21],{14:[1,112],16:[1,111]}),i([43,51,53,54,55],[2,76]),i(d,[2,40]),{12:ue,44:de,48:113,49:67,51:be,52:pe},i(_e,[2,43]),i(_e,[2,44]),i(J,[2,50]),i(d,[2,46]),{10:115,20:[1,114],43:D,51:G,53:P,54:z,55:U},i(Qe,[2,34]),i(d,[2,7]),i(d,[2,84]),i(d,[2,85]),i(d,[2,86]),{12:[1,116],45:j},{12:[1,118],14:[1,117]},{18:[1,119]},i(d,[2,14]),i(fe,[2,66],{60:120,64:[1,121],66:He}),i(fe,[2,67]),i(Ve,[2,72]),i(fe,[2,75]),i(Ve,[2,74]),{17:122,18:[1,123],56:55,57:56,61:ne},{15:124,43:K,44:Z},i(qe,[2,48],{49:94,12:ue,44:de,51:be,52:pe}),{6:me,9:Ee,35:125,50:Se},i(Qe,[2,35]),{13:126,43:Te,53:Ce,76:Oe},{15:127,43:K,44:Z},{13:128,43:Te,53:Ce,76:Oe},i(d,[2,12]),i(fe,[2,68]),{63:129,65:We},{18:[1,130]},i(d,[2,19]),i(d,[2,22],{16:[1,131],45:j}),i(d,[2,33]),i(d,[2,10]),{12:[1,132],45:j},i(d,[2,9]),i(Ve,[2,73]),i(d,[2,17]),{17:133,18:[1,134],56:55,57:56,61:ne},{13:135,43:Te,53:Ce,76:Oe},{18:[1,136]},i(d,[2,20]),i(d,[2,8]),i(d,[2,18])],defaultActions:{84:[2,64],87:[2,70]},parseError:e(function(l,h){if(h.recoverable)this.trace(l);else{var f=Error(l);throw f.hash=h,f}},"parseError"),parse:e(function(l){var h=this,f=[0],n=[],O=[null],t=[],ke=this.table,a="",xe=0,Xe=0,Je=0,at=2,$e=1,nt=t.slice.call(arguments,1),x=Object.create(this.lexer),H={yy:{}};for(var Be in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,Be))H.yy[Be]=this.yy[Be];if(x.setInput(l,H.yy),H.yy.lexer=x,H.yy.parser=this,typeof x.yylloc>"u")x.yylloc={};var Ge=x.yylloc;t.push(Ge);var ot=x.options&&x.options.ranges;if(typeof H.yy.parseError==="function")this.parseError=H.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function lt(M){f.length=f.length-2*M,O.length=O.length-M,t.length=t.length-M}e(lt,"popStack");function et(){var M=n.pop()||x.lex()||$e;if(typeof M!=="number"){if(M instanceof Array)n=M,M=n.pop();M=h.symbols_[M]||M}return M}e(et,"lex");var w,Ye,Q,V,kt,Pe,ee={},Ae,F,tt,Ie;while(!0){if(Q=f[f.length-1],this.defaultActions[Q])V=this.defaultActions[Q];else{if(w===null||typeof w>"u")w=et();V=ke[Q]&&ke[Q][w]}if(typeof V>"u"||!V.length||!V[0]){var ze="";Ie=[];for(Ae in ke[Q])if(this.terminals_[Ae]&&Ae>at)Ie.push("'"+this.terminals_[Ae]+"'");if(x.showPosition)ze="Parse error on line "+(xe+1)+`:
2
2
  `+x.showPosition()+`
3
- Expecting `+Ie.join(", ")+", got '"+(this.terminals_[w]||w)+"'";else ze="Parse error on line "+(xe+1)+": Unexpected "+(w==$e?"end of input":"'"+(this.terminals_[w]||w)+"'");this.parseError(ze,{text:x.match,token:this.terminals_[w]||w,line:x.yylineno,loc:Ge,expected:Ie})}if(V[0]instanceof Array&&V.length>1)throw Error("Parse Error: multiple actions possible at state: "+Q+", token: "+w);switch(V[0]){case 1:if(f.push(w),O.push(x.yytext),t.push(x.yylloc),f.push(V[1]),w=null,!Ye){if(Xe=x.yyleng,a=x.yytext,xe=x.yylineno,Ge=x.yylloc,Je>0)Je--}else w=Ye,Ye=null;break;case 2:if(F=this.productions_[V[1]][1],ee.$=O[O.length-F],ee._$={first_line:t[t.length-(F||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(F||1)].first_column,last_column:t[t.length-1].last_column},ot)ee._$.range=[t[t.length-(F||1)].range[0],t[t.length-1].range[1]];if(Pe=this.performAction.apply(ee,[a,Xe,xe,H.yy,V[1],O,t].concat(nt)),typeof Pe<"u")return Pe;if(F)f=f.slice(0,-1*F*2),O=O.slice(0,-1*F),t=t.slice(0,-1*F);f.push(this.productions_[V[1]][0]),O.push(ee.$),t.push(ee._$),tt=ye[f[f.length-2]][f[f.length-1]],f.push(tt);break;case 3:return!0}}return!0},"parse")},rt=function(){var q={EOF:1,parseError:e(function(h,f){if(this.yy.parser)this.yy.parser.parseError(h,f);else throw Error(h)},"parseError"),setInput:e(function(l,h){if(this.yy=h||this.yy||{},this._input=l,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];return this.offset=0,this},"setInput"),input:e(function(){var l=this._input[0];this.yytext+=l,this.yyleng++,this.offset++,this.match+=l,this.matched+=l;var h=l.match(/(?:\r\n?|\n).*/g);if(h)this.yylineno++,this.yylloc.last_line++;else this.yylloc.last_column++;if(this.options.ranges)this.yylloc.range[1]++;return this._input=this._input.slice(1),l},"input"),unput:e(function(l){var h=l.length,f=l.split(/(?:\r\n?|\n)/g);this._input=l+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-h),this.offset-=h;var n=this.match.split(/(?:\r\n?|\n)/g);if(this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),f.length-1)this.yylineno-=f.length-1;var O=this.yylloc.range;if(this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:f?(f.length===n.length?this.yylloc.first_column:0)+n[n.length-f.length].length-f[0].length:this.yylloc.first_column-h},this.options.ranges)this.yylloc.range=[O[0],O[0]+this.yyleng-h];return this.yyleng=this.yytext.length,this},"unput"),more:e(function(){return this._more=!0,this},"more"),reject:e(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
3
+ Expecting `+Ie.join(", ")+", got '"+(this.terminals_[w]||w)+"'";else ze="Parse error on line "+(xe+1)+": Unexpected "+(w==$e?"end of input":"'"+(this.terminals_[w]||w)+"'");this.parseError(ze,{text:x.match,token:this.terminals_[w]||w,line:x.yylineno,loc:Ge,expected:Ie})}if(V[0]instanceof Array&&V.length>1)throw Error("Parse Error: multiple actions possible at state: "+Q+", token: "+w);switch(V[0]){case 1:if(f.push(w),O.push(x.yytext),t.push(x.yylloc),f.push(V[1]),w=null,!Ye){if(Xe=x.yyleng,a=x.yytext,xe=x.yylineno,Ge=x.yylloc,Je>0)Je--}else w=Ye,Ye=null;break;case 2:if(F=this.productions_[V[1]][1],ee.$=O[O.length-F],ee._$={first_line:t[t.length-(F||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(F||1)].first_column,last_column:t[t.length-1].last_column},ot)ee._$.range=[t[t.length-(F||1)].range[0],t[t.length-1].range[1]];if(Pe=this.performAction.apply(ee,[a,Xe,xe,H.yy,V[1],O,t].concat(nt)),typeof Pe<"u")return Pe;if(F)f=f.slice(0,-1*F*2),O=O.slice(0,-1*F),t=t.slice(0,-1*F);f.push(this.productions_[V[1]][0]),O.push(ee.$),t.push(ee._$),tt=ke[f[f.length-2]][f[f.length-1]],f.push(tt);break;case 3:return!0}}return!0},"parse")},rt=function(){var q={EOF:1,parseError:e(function(h,f){if(this.yy.parser)this.yy.parser.parseError(h,f);else throw Error(h)},"parseError"),setInput:e(function(l,h){if(this.yy=h||this.yy||{},this._input=l,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];return this.offset=0,this},"setInput"),input:e(function(){var l=this._input[0];this.yytext+=l,this.yyleng++,this.offset++,this.match+=l,this.matched+=l;var h=l.match(/(?:\r\n?|\n).*/g);if(h)this.yylineno++,this.yylloc.last_line++;else this.yylloc.last_column++;if(this.options.ranges)this.yylloc.range[1]++;return this._input=this._input.slice(1),l},"input"),unput:e(function(l){var h=l.length,f=l.split(/(?:\r\n?|\n)/g);this._input=l+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-h),this.offset-=h;var n=this.match.split(/(?:\r\n?|\n)/g);if(this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),f.length-1)this.yylineno-=f.length-1;var O=this.yylloc.range;if(this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:f?(f.length===n.length?this.yylloc.first_column:0)+n[n.length-f.length].length-f[0].length:this.yylloc.first_column-h},this.options.ranges)this.yylloc.range=[O[0],O[0]+this.yyleng-h];return this.yyleng=this.yytext.length,this},"unput"),more:e(function(){return this._more=!0,this},"more"),reject:e(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:e(function(l){this.unput(this.match.slice(l))},"less"),pastInput:e(function(){var l=this.matched.substr(0,this.matched.length-this.match.length);return(l.length>20?"...":"")+l.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:e(function(){var l=this.match;if(l.length<20)l+=this._input.substr(0,20-l.length);return(l.substr(0,20)+(l.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:e(function(){var l=this.pastInput(),h=Array(l.length+1).join("-");return l+this.upcomingInput()+`
5
5
  `+h+"^"},"showPosition"),test_match:e(function(l,h){var f,n,O;if(this.options.backtrack_lexer){if(O={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)O.yylloc.range=this.yylloc.range.slice(0)}if(n=l[0].match(/(?:\r\n?|\n).*/g),n)this.yylineno+=n.length;if(this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+l[0].length},this.yytext+=l[0],this.match+=l[0],this.matches=l,this.yyleng=this.yytext.length,this.options.ranges)this.yylloc.range=[this.offset,this.offset+=this.yyleng];if(this._more=!1,this._backtrack=!1,this._input=this._input.slice(l[0].length),this.matched+=l[0],f=this.performAction.call(this,this.yy,this,h,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input)this.done=!1;if(f)return f;else if(this._backtrack){for(var t in O)this[t]=O[t];return!1}return!1},"test_match"),next:e(function(){if(this.done)return this.EOF;if(!this._input)this.done=!0;var l,h,f,n;if(!this._more)this.yytext="",this.match="";var O=this._currentRules();for(var t=0;t<O.length;t++)if(f=this._input.match(this.rules[O[t]]),f&&(!h||f[0].length>h[0].length)){if(h=f,n=t,this.options.backtrack_lexer)if(l=this.test_match(f,O[t]),l!==!1)return l;else if(this._backtrack){h=!1;continue}else return!1;else if(!this.options.flex)break}if(h){if(l=this.test_match(h,O[n]),l!==!1)return l;return!1}if(this._input==="")return this.EOF;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
6
- `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:e(function(){var h=this.next();if(h)return h;else return this.lex()},"lex"),begin:e(function(h){this.conditionStack.push(h)},"begin"),popState:e(function(){var h=this.conditionStack.length-1;if(h>0)return this.conditionStack.pop();else return this.conditionStack[0]},"popState"),_currentRules:e(function(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1])return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules;else return this.conditions.INITIAL.rules},"_currentRules"),topState:e(function(h){if(h=this.conditionStack.length-1-Math.abs(h||0),h>=0)return this.conditionStack[h];else return"INITIAL"},"topState"),pushState:e(function(h){this.begin(h)},"pushState"),stateStackSize:e(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:e(function(h,f,n,O){var t=O;switch(n){case 0:return this.begin("acc_title"),23;break;case 1:return this.popState(),"acc_title_value";break;case 2:return this.begin("acc_descr"),25;break;case 3:return this.popState(),"acc_descr_value";break;case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return 37;case 8:return 38;case 9:return 39;case 10:return 40;case 11:break;case 12:return 9;case 13:return 53;case 14:return 76;case 15:return 4;case 16:return this.begin("block"),16;break;case 17:return 52;case 18:return 52;case 19:return 45;case 20:return 14;case 21:return 12;case 22:break;case 23:return 65;case 24:return 61;case 25:return 61;case 26:this.begin("block_bq");break;case 27:return 61;case 28:this.popState();break;case 29:return 66;case 30:break;case 31:return this.popState(),18;break;case 32:return f.yytext[0];case 33:return 19;case 34:return 20;case 35:return this.begin("style"),47;break;case 36:return this.popState(),9;break;case 37:break;case 38:return 12;case 39:return 45;case 40:return 52;case 41:return this.begin("style"),41;break;case 42:return 46;case 43:return 34;case 44:return 33;case 45:return 69;case 46:return 71;case 47:return 71;case 48:return 71;case 49:return 69;case 50:return 69;case 51:return 70;case 52:return 70;case 53:return 70;case 54:return 70;case 55:return 70;case 56:return 71;case 57:return 70;case 58:return 71;case 59:return 72;case 60:return 72;case 61:return 54;case 62:return 72;case 63:return 72;case 64:return 72;case 65:return 55;case 66:return 51;case 67:return 72;case 68:return 69;case 69:return 70;case 70:return 71;case 71:return 73;case 72:return 74;case 73:return 75;case 74:return 75;case 75:return 74;case 76:return 74;case 77:return 74;case 78:return 44;case 79:return 50;case 80:return 43;case 81:return f.yytext[0];case 82:return 6}},"anonymous"),rules:[/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[ \t\r]+)/i,/^(?:[\n]+)/i,/^(?:"[^"%\r\n\v\b\\]+")/i,/^(?:"[^"]*")/i,/^(?:erDiagram\b)/i,/^(?:\{)/i,/^(?:#)/i,/^(?:#)/i,/^(?:,)/i,/^(?::::)/i,/^(?::)/i,/^(?:\s+)/i,/^(?:\b((?:PK)|(?:FK)|(?:UK))\b)/i,/^(?:([^\s]*)[~].*[~]([^\s]*))/i,/^(?:([\*A-Za-z_\u00C0-\uFFFF][A-Za-z0-9\-\_\[\]\(\)\.,\u00C0-\uFFFF\*]*))/i,/^(?:[`])/i,/^(?:[^`]+)/i,/^(?:[`])/i,/^(?:"[^"]*")/i,/^(?:[\n]+)/i,/^(?:\})/i,/^(?:.)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:style\b)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?::)/i,/^(?:,)/i,/^(?:#)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:subgraph\b)/i,/^(?:end\b\s*)/i,/^(?:one or zero\b)/i,/^(?:one or more\b)/i,/^(?:one or many\b)/i,/^(?:1\+)/i,/^(?:\|o\b)/i,/^(?:zero or one\b)/i,/^(?:zero or more\b)/i,/^(?:zero or many\b)/i,/^(?:0\+)/i,/^(?:\}o\b)/i,/^(?:many\(0\))/i,/^(?:many\(1\))/i,/^(?:many\b)/i,/^(?:\}\|)/i,/^(?:one\b)/i,/^(?:only one\b)/i,/^(?:[0-9]+\.[0-9]+)/i,/^(?:1(?=\s+[A-Za-z_"']))/i,/^(?:1(?=\s+[0-9]))/i,/^(?:1(?=(--|\.\.|\.-|-\.)))/i,/^(?:1\b)/i,/^(?:[0-9]+)/i,/^(?:\|\|)/i,/^(?:o\|)/i,/^(?:o\{)/i,/^(?:\|\{)/i,/^(?:u(?=[\.\-\|]))/i,/^(?:\.\.)/i,/^(?:--)/i,/^(?:to\b)/i,/^(?:optionally to\b)/i,/^(?:\.-)/i,/^(?:-\.)/i,/^(?:([^\x00-\x7F]|\w|-|\*)+)/i,/^(?:;)/i,/^(?:([^\x00-\x7F]|\w|-|\*|\.)+)/i,/^(?:.)/i,/^(?:$)/i],conditions:{style:{rules:[36,37,38,39,40,78,79],inclusive:!1},acc_descr_multiline:{rules:[5,6],inclusive:!1},acc_descr:{rules:[3],inclusive:!1},acc_title:{rules:[1],inclusive:!1},block_bq:{rules:[27,28],inclusive:!1},block:{rules:[22,23,24,25,26,29,30,31,32],inclusive:!1},INITIAL:{rules:[0,2,4,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,33,34,35,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,80,81,82],inclusive:!0}}};return q}();Me.lexer=rt;function Ne(){this.yy={}}return e(Ne,"Parser"),Ne.prototype=Me,Me.Parser=Ne,new Ne}();Ue.parser=Ue;var ct=Ue,ht=class{constructor(){this.entities=new Map,this.relationships=[],this.classes=new Map,this.subgraphDepth=0,this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.direction="TB",this.Cardinality={ZERO_OR_ONE:"ZERO_OR_ONE",ZERO_OR_MORE:"ZERO_OR_MORE",ONE_OR_MORE:"ONE_OR_MORE",ONLY_ONE:"ONLY_ONE",MD_PARENT:"MD_PARENT"},this.Identification={NON_IDENTIFYING:"NON_IDENTIFYING",IDENTIFYING:"IDENTIFYING"},this.setAccTitle=S,this.getAccTitle=E,this.setAccDescription=T,this.getAccDescription=A,this.setDiagramTitle=I,this.getDiagramTitle=L,this.getConfig=e(()=>s().er,"getConfig"),this.clear(),this.addEntity=this.addEntity.bind(this),this.addAttributes=this.addAttributes.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setDirection=this.setDirection.bind(this),this.addCssStyles=this.addCssStyles.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this),this.addSubGraph=this.addSubGraph.bind(this)}static{e(this,"ErDB")}addEntity(i,c=""){if(!this.entities.has(i))this.entities.set(i,{id:`entity-${i}-${this.entities.size}`,label:i,attributes:[],alias:c,shape:"erBox",look:s().look??"default",cssClasses:"default",cssStyles:[],labelType:"markdown"}),r.info("Added new entity :",i);else if(!this.entities.get(i)?.alias&&c)this.entities.get(i).alias=c,r.info(`Add alias '${c}' to entity '${i}'`);return this.entities.get(i)}getEntity(i){return this.entities.get(i)}getEntities(){return this.entities}getClasses(){return this.classes}addAttributes(i,c){let b=this.addEntity(i),o;for(o=c.length-1;o>=0;o--){if(!c[o].keys)c[o].keys=[];if(!c[o].comment)c[o].comment="";b.attributes.push(c[o]),r.debug("Added attribute ",c[o].name)}}addRelationship(i,c,b,o){let u;if(this.subGraphLookup.has(i))u=i;else{let _=this.addEntity(i);if(!_)return;u=_.id}let g;if(this.subGraphLookup.has(b))g=b;else{let _=this.addEntity(b);if(!_)return;g=_.id}let R={entityA:u,roleA:c,entityB:g,relSpec:o};this.relationships.push(R),r.debug("Added new relationship :",R)}getRelationships(){return this.relationships}getDirection(){return this.direction}setDirection(i){this.direction=i}getCompiledStyles(i){let c=[];for(let b of i){let o=this.classes.get(b);if(o?.styles)c=[...c,...o.styles??[]].map((u)=>u.trim());if(o?.textStyles)c=[...c,...o.textStyles??[]].map((u)=>u.trim())}return c}addCssStyles(i,c){for(let b of i){let o=this.entities.get(b),u=this.subGraphLookup.get(b);if(!c)continue;if(o)for(let g of c)o.cssStyles.push(g);if(u){if(!u.cssStyles)u.cssStyles=[];for(let g of c)u.cssStyles.push(g)}}}addClass(i,c){i.forEach((b)=>{let o=this.classes.get(b);if(o===void 0)o={id:b,styles:[],textStyles:[]},this.classes.set(b,o);if(c)c.forEach(function(u){if(/color/.exec(u)){let g=u.replace("fill","bgFill");o.textStyles.push(g)}o.styles.push(u)})})}addSubGraph(i,c,b){let o=i.text.trim(),u=b.text,R=e((m)=>{let B=new Set,W;return{nodeList:m.filter((D)=>{if(D?.stmt){if(D.stmt==="dir")W=D.value;return!1}if(typeof D!=="string")return!1;let Y=D.trim();if(!Y)return!1;if(B.has(Y))return!1;return B.add(Y),!0}),dir:W}},"uniq")(c.flat()),{nodeList:_,dir:v}=R;o=o??"subGraph"+this.subCount,u=u||"",u=this.sanitizeText(u),this.subCount=this.subCount+1;let k={id:o,nodes:_,title:u.trim(),classes:[],cssStyles:[],dir:v,labelType:this.sanitizeNodeLabelType(b?.type)};return r.info("Adding",k.id,k.nodes,k.dir),k.nodes=this.makeUniq(k,this.subGraphs).nodes,this.subGraphs.push(k),this.subGraphLookup.set(o,k),o}getSubGraphs(){return this.subGraphs}setClass(i,c){for(let b of i){let o=this.entities.get(b);if(o)for(let g of c)o.cssClasses+=" "+g;let u=this.subGraphLookup.get(b);if(u)for(let g of c)u.classes.push(g)}}subgraphNodeCache(i){let c=new Set;for(let b of i)for(let o of b.nodes)c.add(o);return c}makeUniq(i,c){let b=this.subgraphNodeCache(c),o=[];return i.nodes.forEach((u,g)=>{if(b.has(u))r.warn(`Entity '${u}' already belongs to another subgraph and will be ignored`);else o.push(i.nodes[g])}),{nodes:o}}sanitizeText(i){return y.sanitizeText(i,s())}sanitizeNodeLabelType(i){switch(i){case"markdown":case"string":case"text":return i;default:return"markdown"}}clear(){this.entities=new Map,this.classes=new Map,this.relationships=[],this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.subgraphDepth=0,C()}getData(){let i=[],c=[],b=s(),o=this.getSubGraphs(),u=new Map,g=new Map;for(let k=o.length-1;k>=0;k--){let m=o[k];if(m.nodes.length>0)g.set(m.id,!0);for(let B of m.nodes)u.set(B,m.id)}for(let k=o.length-1;k>=0;k--){let m=o[k];i.push({id:m.id,label:m.title,labelStyle:"",labelType:m.labelType,parentId:u.get(m.id),padding:8,cssCompiledStyles:this.getCompiledStyles(m.classes),cssStyles:m.cssStyles,cssClasses:m.classes.join(" "),shape:"rect",dir:m.dir,isGroup:!0,look:b.look})}let R=new Set(o.map((k)=>k.id)),_=0;for(let k of this.entities.keys()){if(R.has(k))continue;let m=this.entities.get(k);if(m)m.cssCompiledStyles=this.getCompiledStyles(m.cssClasses.split(" ")),m.colorIndex=_++,i.push({...m,parentId:u.get(k),isGroup:!1})}let v=0;for(let k of this.relationships){let m={id:Fe(k.entityA,k.entityB,{prefix:"id",counter:v++}),type:"normal",curve:"basis",start:k.entityA,end:k.entityB,label:k.roleA,labelpos:"c",thickness:"normal",classes:"relationshipLine",arrowTypeStart:k.relSpec.cardB.toLowerCase(),arrowTypeEnd:k.relSpec.cardA.toLowerCase(),pattern:k.relSpec.relType=="IDENTIFYING"?"solid":"dashed",look:b.look,labelType:"markdown"};c.push(m)}return{nodes:i,edges:c,other:{},config:b,direction:this.direction}}},it={};Yt(it,{draw:()=>ut});var ut=e(async function(i,c,b,o){r.info("REF0:"),r.info("Drawing er diagram (unified)",c);let{securityLevel:u,er:g,layout:R}=s(),_=o.db.getData(),v=fe(c,u);_.type=o.type,_.layoutAlgorithm=ge(R),_.config.flowchart.nodeSpacing=g?.nodeSpacing||140,_.config.flowchart.rankSpacing=g?.rankSpacing||80,_.direction=o.db.getDirection();let{config:k}=_,{look:m}=k;if(m==="neo")_.markers=["only_one_neo","zero_or_one_neo","one_or_more_neo","zero_or_more_neo"];else _.markers=["only_one","zero_or_one","one_or_more","zero_or_more"];_.diagramId=c,await he(_,v);let B=v.selectAll('[id*="-background"]');if(Array.from(B).length>0)B.each(function(){let X=p(this),Y=X.attr("id").replace("-background",""),te=v.select(`#${CSS.escape(Y)}`);if(!te.empty()){let G=te.attr("transform");X.attr("transform",G)}});let W=8;N.insertTitle(v,"erDiagramTitleText",g?.titleTopMargin??25,o.db.getDiagramTitle()),oe(v,W,"erDiagram",g?.useMaxWidth??!0)},"draw"),st=e((i,c)=>{let b=Pt,o=b(i,"r"),u=b(i,"g"),g=b(i,"b");return se(o,u,g,c)},"fade"),dt=e((i)=>{let{theme:c,bkgColorArray:b,borderColorArray:o}=i;if(!ae(c,o))return"";let u=ie(i.look),g=le(b),R="";for(let _=0;_<ft(o);_++){let v=o[_],k=g?`fill: ${b[_%b.length]};`:"";R+=`
6
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:e(function(){var h=this.next();if(h)return h;else return this.lex()},"lex"),begin:e(function(h){this.conditionStack.push(h)},"begin"),popState:e(function(){var h=this.conditionStack.length-1;if(h>0)return this.conditionStack.pop();else return this.conditionStack[0]},"popState"),_currentRules:e(function(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1])return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules;else return this.conditions.INITIAL.rules},"_currentRules"),topState:e(function(h){if(h=this.conditionStack.length-1-Math.abs(h||0),h>=0)return this.conditionStack[h];else return"INITIAL"},"topState"),pushState:e(function(h){this.begin(h)},"pushState"),stateStackSize:e(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:e(function(h,f,n,O){var t=O;switch(n){case 0:return this.begin("acc_title"),23;break;case 1:return this.popState(),"acc_title_value";break;case 2:return this.begin("acc_descr"),25;break;case 3:return this.popState(),"acc_descr_value";break;case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return 37;case 8:return 38;case 9:return 39;case 10:return 40;case 11:break;case 12:return 9;case 13:return 53;case 14:return 76;case 15:return 4;case 16:return this.begin("block"),16;break;case 17:return 52;case 18:return 52;case 19:return 45;case 20:return 14;case 21:return 12;case 22:break;case 23:return 65;case 24:return 61;case 25:return 61;case 26:this.begin("block_bq");break;case 27:return 61;case 28:this.popState();break;case 29:return 66;case 30:break;case 31:return this.popState(),18;break;case 32:return f.yytext[0];case 33:return 19;case 34:return 20;case 35:return this.begin("style"),47;break;case 36:return this.popState(),9;break;case 37:break;case 38:return 12;case 39:return 45;case 40:return 52;case 41:return this.begin("style"),41;break;case 42:return 46;case 43:return 34;case 44:return 33;case 45:return 69;case 46:return 71;case 47:return 71;case 48:return 71;case 49:return 69;case 50:return 69;case 51:return 70;case 52:return 70;case 53:return 70;case 54:return 70;case 55:return 70;case 56:return 71;case 57:return 70;case 58:return 71;case 59:return 72;case 60:return 72;case 61:return 54;case 62:return 72;case 63:return 72;case 64:return 72;case 65:return 55;case 66:return 51;case 67:return 72;case 68:return 69;case 69:return 70;case 70:return 71;case 71:return 73;case 72:return 74;case 73:return 75;case 74:return 75;case 75:return 74;case 76:return 74;case 77:return 74;case 78:return 44;case 79:return 50;case 80:return 43;case 81:return f.yytext[0];case 82:return 6}},"anonymous"),rules:[/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[ \t\r]+)/i,/^(?:[\n]+)/i,/^(?:"[^"%\r\n\v\b\\]+")/i,/^(?:"[^"]*")/i,/^(?:erDiagram\b)/i,/^(?:\{)/i,/^(?:#)/i,/^(?:#)/i,/^(?:,)/i,/^(?::::)/i,/^(?::)/i,/^(?:\s+)/i,/^(?:\b((?:PK)|(?:FK)|(?:UK))\b)/i,/^(?:([^\s]*)[~].*[~]([^\s]*))/i,/^(?:([\*A-Za-z_\u00C0-\uFFFF][A-Za-z0-9\-\_\[\]\(\)\.,\u00C0-\uFFFF\*]*))/i,/^(?:[`])/i,/^(?:[^`]+)/i,/^(?:[`])/i,/^(?:"[^"]*")/i,/^(?:[\n]+)/i,/^(?:\})/i,/^(?:.)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:style\b)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?::)/i,/^(?:,)/i,/^(?:#)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:subgraph\b)/i,/^(?:end\b\s*)/i,/^(?:one or zero\b)/i,/^(?:one or more\b)/i,/^(?:one or many\b)/i,/^(?:1\+)/i,/^(?:\|o\b)/i,/^(?:zero or one\b)/i,/^(?:zero or more\b)/i,/^(?:zero or many\b)/i,/^(?:0\+)/i,/^(?:\}o\b)/i,/^(?:many\(0\))/i,/^(?:many\(1\))/i,/^(?:many\b)/i,/^(?:\}\|)/i,/^(?:one\b)/i,/^(?:only one\b)/i,/^(?:[0-9]+\.[0-9]+)/i,/^(?:1(?=\s+[A-Za-z_"']))/i,/^(?:1(?=\s+[0-9]))/i,/^(?:1(?=(--|\.\.|\.-|-\.)))/i,/^(?:1\b)/i,/^(?:[0-9]+)/i,/^(?:\|\|)/i,/^(?:o\|)/i,/^(?:o\{)/i,/^(?:\|\{)/i,/^(?:u(?=[\.\-\|]))/i,/^(?:\.\.)/i,/^(?:--)/i,/^(?:to\b)/i,/^(?:optionally to\b)/i,/^(?:\.-)/i,/^(?:-\.)/i,/^(?:([^\x00-\x7F]|\w|-|\*)+)/i,/^(?:;)/i,/^(?:([^\x00-\x7F]|\w|-|\*|\.)+)/i,/^(?:.)/i,/^(?:$)/i],conditions:{style:{rules:[36,37,38,39,40,78,79],inclusive:!1},acc_descr_multiline:{rules:[5,6],inclusive:!1},acc_descr:{rules:[3],inclusive:!1},acc_title:{rules:[1],inclusive:!1},block_bq:{rules:[27,28],inclusive:!1},block:{rules:[22,23,24,25,26,29,30,31,32],inclusive:!1},INITIAL:{rules:[0,2,4,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,33,34,35,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,80,81,82],inclusive:!0}}};return q}();Me.lexer=rt;function Ne(){this.yy={}}return e(Ne,"Parser"),Ne.prototype=Me,Me.Parser=Ne,new Ne}();Ue.parser=Ue;var ct=Ue,ht=class{constructor(){this.entities=new Map,this.relationships=[],this.classes=new Map,this.subgraphDepth=0,this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.direction="TB",this.Cardinality={ZERO_OR_ONE:"ZERO_OR_ONE",ZERO_OR_MORE:"ZERO_OR_MORE",ONE_OR_MORE:"ONE_OR_MORE",ONLY_ONE:"ONLY_ONE",MD_PARENT:"MD_PARENT"},this.Identification={NON_IDENTIFYING:"NON_IDENTIFYING",IDENTIFYING:"IDENTIFYING"},this.setAccTitle=S,this.getAccTitle=E,this.setAccDescription=T,this.getAccDescription=A,this.setDiagramTitle=I,this.getDiagramTitle=L,this.getConfig=e(()=>s().er,"getConfig"),this.clear(),this.addEntity=this.addEntity.bind(this),this.addAttributes=this.addAttributes.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setDirection=this.setDirection.bind(this),this.addCssStyles=this.addCssStyles.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this),this.addSubGraph=this.addSubGraph.bind(this)}static{e(this,"ErDB")}addEntity(i,c=""){if(!this.entities.has(i))this.entities.set(i,{id:`entity-${i}-${this.entities.size}`,label:i,attributes:[],alias:c,shape:"erBox",look:s().look??"default",cssClasses:"default",cssStyles:[],labelType:"markdown"}),r.info("Added new entity :",i);else if(!this.entities.get(i)?.alias&&c)this.entities.get(i).alias=c,r.info(`Add alias '${c}' to entity '${i}'`);return this.entities.get(i)}getEntity(i){return this.entities.get(i)}getEntities(){return this.entities}getClasses(){return this.classes}addAttributes(i,c){let b=this.addEntity(i),o;for(o=c.length-1;o>=0;o--){if(!c[o].keys)c[o].keys=[];if(!c[o].comment)c[o].comment="";b.attributes.push(c[o]),r.debug("Added attribute ",c[o].name)}}addRelationship(i,c,b,o){let u;if(this.subGraphLookup.has(i))u=i;else{let _=this.addEntity(i);if(!_)return;u=_.id}let g;if(this.subGraphLookup.has(b))g=b;else{let _=this.addEntity(b);if(!_)return;g=_.id}let R={entityA:u,roleA:c,entityB:g,relSpec:o};this.relationships.push(R),r.debug("Added new relationship :",R)}getRelationships(){return this.relationships}getDirection(){return this.direction}setDirection(i){this.direction=i}getCompiledStyles(i){let c=[];for(let b of i){let o=this.classes.get(b);if(o?.styles)c=[...c,...o.styles??[]].map((u)=>u.trim());if(o?.textStyles)c=[...c,...o.textStyles??[]].map((u)=>u.trim())}return c}addCssStyles(i,c){for(let b of i){let o=this.entities.get(b),u=this.subGraphLookup.get(b);if(!c)continue;if(o)for(let g of c)o.cssStyles.push(g);if(u){if(!u.cssStyles)u.cssStyles=[];for(let g of c)u.cssStyles.push(g)}}}addClass(i,c){i.forEach((b)=>{let o=this.classes.get(b);if(o===void 0)o={id:b,styles:[],textStyles:[]},this.classes.set(b,o);if(c)c.forEach(function(u){if(/color/.exec(u)){let g=u.replace("fill","bgFill");o.textStyles.push(g)}o.styles.push(u)})})}addSubGraph(i,c,b){let o=i.text.trim(),u=b.text,R=e((m)=>{let B=new Set,W;return{nodeList:m.filter((D)=>{if(D?.stmt){if(D.stmt==="dir")W=D.value;return!1}if(typeof D!=="string")return!1;let Y=D.trim();if(!Y)return!1;if(B.has(Y))return!1;return B.add(Y),!0}),dir:W}},"uniq")(c.flat()),{nodeList:_,dir:v}=R;o=o??"subGraph"+this.subCount,u=u||"",u=this.sanitizeText(u),this.subCount=this.subCount+1;let k={id:o,nodes:_,title:u.trim(),classes:[],cssStyles:[],dir:v,labelType:this.sanitizeNodeLabelType(b?.type)};return r.info("Adding",k.id,k.nodes,k.dir),k.nodes=this.makeUniq(k,this.subGraphs).nodes,this.subGraphs.push(k),this.subGraphLookup.set(o,k),o}getSubGraphs(){return this.subGraphs}setClass(i,c){for(let b of i){let o=this.entities.get(b);if(o)for(let g of c)o.cssClasses+=" "+g;let u=this.subGraphLookup.get(b);if(u)for(let g of c)u.classes.push(g)}}subgraphNodeCache(i){let c=new Set;for(let b of i)for(let o of b.nodes)c.add(o);return c}makeUniq(i,c){let b=this.subgraphNodeCache(c),o=[];return i.nodes.forEach((u,g)=>{if(b.has(u))r.warn(`Entity '${u}' already belongs to another subgraph and will be ignored`);else o.push(i.nodes[g])}),{nodes:o}}sanitizeText(i){return y.sanitizeText(i,s())}sanitizeNodeLabelType(i){switch(i){case"markdown":case"string":case"text":return i;default:return"markdown"}}clear(){this.entities=new Map,this.classes=new Map,this.relationships=[],this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.subgraphDepth=0,C()}getData(){let i=[],c=[],b=s(),o=this.getSubGraphs(),u=new Map,g=new Map;for(let k=o.length-1;k>=0;k--){let m=o[k];if(m.nodes.length>0)g.set(m.id,!0);for(let B of m.nodes)u.set(B,m.id)}for(let k=o.length-1;k>=0;k--){let m=o[k];i.push({id:m.id,label:m.title,labelStyle:"",labelType:m.labelType,parentId:u.get(m.id),padding:8,cssCompiledStyles:this.getCompiledStyles(m.classes),cssStyles:m.cssStyles,cssClasses:m.classes.join(" "),shape:"rect",dir:m.dir,isGroup:!0,look:b.look})}let R=new Set(o.map((k)=>k.id)),_=0;for(let k of this.entities.keys()){if(R.has(k))continue;let m=this.entities.get(k);if(m)m.cssCompiledStyles=this.getCompiledStyles(m.cssClasses.split(" ")),m.colorIndex=_++,i.push({...m,parentId:u.get(k),isGroup:!1})}let v=0;for(let k of this.relationships){let m={id:Fe(k.entityA,k.entityB,{prefix:"id",counter:v++}),type:"normal",curve:"basis",start:k.entityA,end:k.entityB,label:k.roleA,labelpos:"c",thickness:"normal",classes:"relationshipLine",arrowTypeStart:k.relSpec.cardB.toLowerCase(),arrowTypeEnd:k.relSpec.cardA.toLowerCase(),pattern:k.relSpec.relType=="IDENTIFYING"?"solid":"dashed",look:b.look,labelType:"markdown"};c.push(m)}return{nodes:i,edges:c,other:{},config:b,direction:this.direction}}},it={};Zt(it,{draw:()=>ut});var ut=e(async function(i,c,b,o){r.info("REF0:"),r.info("Drawing er diagram (unified)",c);let{securityLevel:u,er:g,layout:R}=s(),_=o.db.getData(),v=he(c,u);_.type=o.type,_.layoutAlgorithm=ye(R),_.config.flowchart.nodeSpacing=g?.nodeSpacing||140,_.config.flowchart.rankSpacing=g?.rankSpacing||80,_.direction=o.db.getDirection();let{config:k}=_,{look:m}=k;if(m==="neo")_.markers=["only_one_neo","zero_or_one_neo","one_or_more_neo","zero_or_more_neo"];else _.markers=["only_one","zero_or_one","one_or_more","zero_or_more"];_.diagramId=c,await ge(_,v);let B=v.selectAll('[id*="-background"]');if(Array.from(B).length>0)B.each(function(){let X=p(this),Y=X.attr("id").replace("-background",""),te=v.select(`#${CSS.escape(Y)}`);if(!te.empty()){let G=te.attr("transform");X.attr("transform",G)}});let W=8;N.insertTitle(v,"erDiagramTitleText",g?.titleTopMargin??25,o.db.getDiagramTitle()),se(v,W,"erDiagram",g?.useMaxWidth??!0)},"draw"),st=e((i,c)=>{let b=Ot,o=b(i,"r"),u=b(i,"g"),g=b(i,"b");return le(o,u,g,c)},"fade"),dt=e((i)=>{let{theme:c,bkgColorArray:b,borderColorArray:o}=i;if(!ae(c,o))return"";let u=ie(i.look),g=ce(b),R="";for(let _=0;_<ft(o);_++){let v=o[_],k=g?`fill: ${b[_%b.length]};`:"";R+=`
7
7
 
8
8
  [data-look="${u}"][data-color-id="color-${_}"].node path {
9
9
  stroke: ${v};
@@ -96,4 +96,4 @@ Expecting `+Ie.join(", ")+", got '"+(this.terminals_[w]||w)+"'";else ze="Parse e
96
96
  .cluster-label text {
97
97
  fill: ${i.titleColor??i.textColor};
98
98
  }
99
- `},"getStyles"),pt=bt,Vt={parser:ct,get db(){return new ht},renderer:it,styles:pt};export{Vt as diagram};
99
+ `},"getStyles"),pt=bt,Mt={parser:ct,get db(){return new ht},renderer:it,styles:pt};export{Mt as diagram};
@@ -0,0 +1 @@
1
+ import{yi}from"./chunk-qryrg2pq.js";export{yi as createWardleyServices};
@@ -0,0 +1 @@
1
+ import{bi}from"./chunk-qryrg2pq.js";export{bi as createCynefinServices};
@@ -1,9 +1,9 @@
1
- import{e,y,B,C,S,E,T,A,I,L,s,q,Ge,m}from"./chunk-jtwhjp20.js";var dt=function(){var t=e(function(z,i,a,n){for(a=a||{},n=z.length;n--;a[z[n]]=i);return a},"o"),f=[1,4],l=[1,14],o=[1,12],h=[1,13],p=[6,7,8],k=[1,20],d=[1,18],x=[1,19],u=[6,7,11],_=[1,6,13,14],b=[1,23],M=[1,24],P=[1,6,7,11,13,14],U={trace:e(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ishikawa:4,spaceLines:5,SPACELINE:6,NL:7,ISHIKAWA:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,TEXT:14,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"ISHIKAWA",11:"EOF",13:"SPACELIST",14:"TEXT"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,1],[12,1],[12,1]],performAction:e(function(i,a,n,c,g,r,N){var v=r.length-1;switch(g){case 6:case 7:return c;case 15:c.addNode(r[v-1].length,r[v].trim());break;case 16:c.addNode(0,r[v].trim());break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:f},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:f},{6:l,7:[1,10],9:9,12:11,13:o,14:h},t(p,[2,3]),{1:[2,2]},t(p,[2,4]),t(p,[2,5]),{1:[2,6],6:l,12:15,13:o,14:h},{6:l,9:16,12:11,13:o,14:h},{6:k,7:d,10:17,11:x},t(u,[2,18],{14:[1,21]}),t(u,[2,16]),t(u,[2,17]),{6:k,7:d,10:22,11:x},{1:[2,7],6:l,12:15,13:o,14:h},t(_,[2,14],{7:b,11:M}),t(P,[2,8]),t(P,[2,9]),t(P,[2,10]),t(u,[2,15]),t(_,[2,13],{7:b,11:M}),t(P,[2,11]),t(P,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:e(function(i,a){if(a.recoverable)this.trace(i);else{var n=Error(i);throw n.hash=a,n}},"parseError"),parse:e(function(i){var a=this,n=[0],c=[],g=[null],r=[],N=this.table,v="",W=0,D=0,R=0,F=2,X=1,rt=r.slice.call(arguments,1),w=Object.create(this.lexer),O={yy:{}};for(var K in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,K))O.yy[K]=this.yy[K];if(w.setInput(i,O.yy),O.yy.lexer=w,O.yy.parser=this,typeof w.yylloc>"u")w.yylloc={};var Q=w.yylloc;r.push(Q);var lt=w.options&&w.options.ranges;if(typeof O.yy.parseError==="function")this.parseError=O.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function xt(G){n.length=n.length-2*G,g.length=g.length-G,r.length=r.length-G}e(xt,"popStack");function yt(){var G=c.pop()||w.lex()||X;if(typeof G!=="number"){if(G instanceof Array)c=G,G=c.pop();G=a.symbols_[G]||G}return G}e(yt,"lex");var j,ot,J,H,Vt,ht,tt={},st,Y,ft,nt;while(!0){if(J=n[n.length-1],this.defaultActions[J])H=this.defaultActions[J];else{if(j===null||typeof j>"u")j=yt();H=N[J]&&N[J][j]}if(typeof H>"u"||!H.length||!H[0]){var ct="";nt=[];for(st in N[J])if(this.terminals_[st]&&st>F)nt.push("'"+this.terminals_[st]+"'");if(w.showPosition)ct="Parse error on line "+(W+1)+`:
1
+ import{e,y,B,C,S,E,T,A,I,L,s,V,Ge,m}from"./chunk-9dd1c37b.js";var dt=function(){var t=e(function(H,i,a,n){for(a=a||{},n=H.length;n--;a[H[n]]=i);return a},"o"),f=[1,4],l=[1,14],o=[1,12],h=[1,13],p=[6,7,8],k=[1,20],d=[1,18],x=[1,19],u=[6,7,11],_=[1,6,13,14],b=[1,23],M=[1,24],P=[1,6,7,11,13,14],Z={trace:e(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ishikawa:4,spaceLines:5,SPACELINE:6,NL:7,ISHIKAWA:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,TEXT:14,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"ISHIKAWA",11:"EOF",13:"SPACELIST",14:"TEXT"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,1],[12,1],[12,1]],performAction:e(function(i,a,n,c,g,r,N){var v=r.length-1;switch(g){case 6:case 7:return c;case 15:c.addNode(r[v-1].length,r[v].trim());break;case 16:c.addNode(0,r[v].trim());break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:f},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:f},{6:l,7:[1,10],9:9,12:11,13:o,14:h},t(p,[2,3]),{1:[2,2]},t(p,[2,4]),t(p,[2,5]),{1:[2,6],6:l,12:15,13:o,14:h},{6:l,9:16,12:11,13:o,14:h},{6:k,7:d,10:17,11:x},t(u,[2,18],{14:[1,21]}),t(u,[2,16]),t(u,[2,17]),{6:k,7:d,10:22,11:x},{1:[2,7],6:l,12:15,13:o,14:h},t(_,[2,14],{7:b,11:M}),t(P,[2,8]),t(P,[2,9]),t(P,[2,10]),t(u,[2,15]),t(_,[2,13],{7:b,11:M}),t(P,[2,11]),t(P,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:e(function(i,a){if(a.recoverable)this.trace(i);else{var n=Error(i);throw n.hash=a,n}},"parseError"),parse:e(function(i){var a=this,n=[0],c=[],g=[null],r=[],N=this.table,v="",F=0,D=0,W=0,j=2,Y=1,rt=r.slice.call(arguments,1),w=Object.create(this.lexer),O={yy:{}};for(var q in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,q))O.yy[q]=this.yy[q];if(w.setInput(i,O.yy),O.yy.lexer=w,O.yy.parser=this,typeof w.yylloc>"u")w.yylloc={};var Q=w.yylloc;r.push(Q);var lt=w.options&&w.options.ranges;if(typeof O.yy.parseError==="function")this.parseError=O.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function xt(U){n.length=n.length-2*U,g.length=g.length-U,r.length=r.length-U}e(xt,"popStack");function yt(){var U=c.pop()||w.lex()||Y;if(typeof U!=="number"){if(U instanceof Array)c=U,U=c.pop();U=a.symbols_[U]||U}return U}e(yt,"lex");var z,ot,J,G,Vt,ht,tt={},st,K,ft,nt;while(!0){if(J=n[n.length-1],this.defaultActions[J])G=this.defaultActions[J];else{if(z===null||typeof z>"u")z=yt();G=N[J]&&N[J][z]}if(typeof G>"u"||!G.length||!G[0]){var ct="";nt=[];for(st in N[J])if(this.terminals_[st]&&st>j)nt.push("'"+this.terminals_[st]+"'");if(w.showPosition)ct="Parse error on line "+(F+1)+`:
2
2
  `+w.showPosition()+`
3
- Expecting `+nt.join(", ")+", got '"+(this.terminals_[j]||j)+"'";else ct="Parse error on line "+(W+1)+": Unexpected "+(j==X?"end of input":"'"+(this.terminals_[j]||j)+"'");this.parseError(ct,{text:w.match,token:this.terminals_[j]||j,line:w.yylineno,loc:Q,expected:nt})}if(H[0]instanceof Array&&H.length>1)throw Error("Parse Error: multiple actions possible at state: "+J+", token: "+j);switch(H[0]){case 1:if(n.push(j),g.push(w.yytext),r.push(w.yylloc),n.push(H[1]),j=null,!ot){if(D=w.yyleng,v=w.yytext,W=w.yylineno,Q=w.yylloc,R>0)R--}else j=ot,ot=null;break;case 2:if(Y=this.productions_[H[1]][1],tt.$=g[g.length-Y],tt._$={first_line:r[r.length-(Y||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(Y||1)].first_column,last_column:r[r.length-1].last_column},lt)tt._$.range=[r[r.length-(Y||1)].range[0],r[r.length-1].range[1]];if(ht=this.performAction.apply(tt,[v,D,W,O.yy,H[1],g,r].concat(rt)),typeof ht<"u")return ht;if(Y)n=n.slice(0,-1*Y*2),g=g.slice(0,-1*Y),r=r.slice(0,-1*Y);n.push(this.productions_[H[1]][0]),g.push(tt.$),r.push(tt._$),ft=N[n[n.length-2]][n[n.length-1]],n.push(ft);break;case 3:return!0}}return!0},"parse")},Z=function(){var z={EOF:1,parseError:e(function(a,n){if(this.yy.parser)this.yy.parser.parseError(a,n);else throw Error(a)},"parseError"),setInput:e(function(i,a){if(this.yy=a||this.yy||{},this._input=i,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];return this.offset=0,this},"setInput"),input:e(function(){var i=this._input[0];this.yytext+=i,this.yyleng++,this.offset++,this.match+=i,this.matched+=i;var a=i.match(/(?:\r\n?|\n).*/g);if(a)this.yylineno++,this.yylloc.last_line++;else this.yylloc.last_column++;if(this.options.ranges)this.yylloc.range[1]++;return this._input=this._input.slice(1),i},"input"),unput:e(function(i){var a=i.length,n=i.split(/(?:\r\n?|\n)/g);this._input=i+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-a),this.offset-=a;var c=this.match.split(/(?:\r\n?|\n)/g);if(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 g=this.yylloc.range;if(this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===c.length?this.yylloc.first_column:0)+c[c.length-n.length].length-n[0].length:this.yylloc.first_column-a},this.options.ranges)this.yylloc.range=[g[0],g[0]+this.yyleng-a];return this.yyleng=this.yytext.length,this},"unput"),more:e(function(){return this._more=!0,this},"more"),reject:e(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
3
+ Expecting `+nt.join(", ")+", got '"+(this.terminals_[z]||z)+"'";else ct="Parse error on line "+(F+1)+": Unexpected "+(z==Y?"end of input":"'"+(this.terminals_[z]||z)+"'");this.parseError(ct,{text:w.match,token:this.terminals_[z]||z,line:w.yylineno,loc:Q,expected:nt})}if(G[0]instanceof Array&&G.length>1)throw Error("Parse Error: multiple actions possible at state: "+J+", token: "+z);switch(G[0]){case 1:if(n.push(z),g.push(w.yytext),r.push(w.yylloc),n.push(G[1]),z=null,!ot){if(D=w.yyleng,v=w.yytext,F=w.yylineno,Q=w.yylloc,W>0)W--}else z=ot,ot=null;break;case 2:if(K=this.productions_[G[1]][1],tt.$=g[g.length-K],tt._$={first_line:r[r.length-(K||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(K||1)].first_column,last_column:r[r.length-1].last_column},lt)tt._$.range=[r[r.length-(K||1)].range[0],r[r.length-1].range[1]];if(ht=this.performAction.apply(tt,[v,D,F,O.yy,G[1],g,r].concat(rt)),typeof ht<"u")return ht;if(K)n=n.slice(0,-1*K*2),g=g.slice(0,-1*K),r=r.slice(0,-1*K);n.push(this.productions_[G[1]][0]),g.push(tt.$),r.push(tt._$),ft=N[n[n.length-2]][n[n.length-1]],n.push(ft);break;case 3:return!0}}return!0},"parse")},X=function(){var H={EOF:1,parseError:e(function(a,n){if(this.yy.parser)this.yy.parser.parseError(a,n);else throw Error(a)},"parseError"),setInput:e(function(i,a){if(this.yy=a||this.yy||{},this._input=i,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];return this.offset=0,this},"setInput"),input:e(function(){var i=this._input[0];this.yytext+=i,this.yyleng++,this.offset++,this.match+=i,this.matched+=i;var a=i.match(/(?:\r\n?|\n).*/g);if(a)this.yylineno++,this.yylloc.last_line++;else this.yylloc.last_column++;if(this.options.ranges)this.yylloc.range[1]++;return this._input=this._input.slice(1),i},"input"),unput:e(function(i){var a=i.length,n=i.split(/(?:\r\n?|\n)/g);this._input=i+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-a),this.offset-=a;var c=this.match.split(/(?:\r\n?|\n)/g);if(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 g=this.yylloc.range;if(this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===c.length?this.yylloc.first_column:0)+c[c.length-n.length].length-n[0].length:this.yylloc.first_column-a},this.options.ranges)this.yylloc.range=[g[0],g[0]+this.yyleng-a];return this.yyleng=this.yytext.length,this},"unput"),more:e(function(){return this._more=!0,this},"more"),reject:e(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:e(function(i){this.unput(this.match.slice(i))},"less"),pastInput:e(function(){var i=this.matched.substr(0,this.matched.length-this.match.length);return(i.length>20?"...":"")+i.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:e(function(){var i=this.match;if(i.length<20)i+=this._input.substr(0,20-i.length);return(i.substr(0,20)+(i.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:e(function(){var i=this.pastInput(),a=Array(i.length+1).join("-");return i+this.upcomingInput()+`
5
5
  `+a+"^"},"showPosition"),test_match:e(function(i,a){var n,c,g;if(this.options.backtrack_lexer){if(g={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)g.yylloc.range=this.yylloc.range.slice(0)}if(c=i[0].match(/(?:\r\n?|\n).*/g),c)this.yylineno+=c.length;if(this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:c?c[c.length-1].length-c[c.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+i[0].length},this.yytext+=i[0],this.match+=i[0],this.matches=i,this.yyleng=this.yytext.length,this.options.ranges)this.yylloc.range=[this.offset,this.offset+=this.yyleng];if(this._more=!1,this._backtrack=!1,this._input=this._input.slice(i[0].length),this.matched+=i[0],n=this.performAction.call(this,this.yy,this,a,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input)this.done=!1;if(n)return n;else if(this._backtrack){for(var r in g)this[r]=g[r];return!1}return!1},"test_match"),next:e(function(){if(this.done)return this.EOF;if(!this._input)this.done=!0;var i,a,n,c;if(!this._more)this.yytext="",this.match="";var g=this._currentRules();for(var r=0;r<g.length;r++)if(n=this._input.match(this.rules[g[r]]),n&&(!a||n[0].length>a[0].length)){if(a=n,c=r,this.options.backtrack_lexer)if(i=this.test_match(n,g[r]),i!==!1)return i;else if(this._backtrack){a=!1;continue}else return!1;else if(!this.options.flex)break}if(a){if(i=this.test_match(a,g[c]),i!==!1)return i;return!1}if(this._input==="")return this.EOF;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
6
- `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:e(function(){var a=this.next();if(a)return a;else return this.lex()},"lex"),begin:e(function(a){this.conditionStack.push(a)},"begin"),popState:e(function(){var a=this.conditionStack.length-1;if(a>0)return this.conditionStack.pop();else return this.conditionStack[0]},"popState"),_currentRules:e(function(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1])return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules;else return this.conditions.INITIAL.rules},"_currentRules"),topState:e(function(a){if(a=this.conditionStack.length-1-Math.abs(a||0),a>=0)return this.conditionStack[a];else return"INITIAL"},"topState"),pushState:e(function(a){this.begin(a)},"pushState"),stateStackSize:e(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:e(function(a,n,c,g){var r=g;switch(c){case 0:return 6;case 1:return 8;case 2:return 8;case 3:return 6;case 4:return 7;case 5:return 13;case 6:return 14;case 7:return 11}},"anonymous"),rules:[/^(?:\s*%%.*)/i,/^(?:ishikawa-beta\b)/i,/^(?:ishikawa\b)/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:[^\n]+)/i,/^(?:$)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7],inclusive:!0}}};return z}();U.lexer=Z;function V(){this.yy={}}return e(V,"Parser"),V.prototype=U,U.Parser=V,new V}();dt.parser=dt;var vt=dt,St=class{constructor(){this.stack=[],this.clear=this.clear.bind(this),this.addNode=this.addNode.bind(this),this.getRoot=this.getRoot.bind(this)}static{e(this,"IshikawaDB")}clear(){this.root=void 0,this.stack=[],this.baseLevel=void 0,C()}getRoot(){return this.root}addNode(t,f){let l=y.sanitizeText(f,s());if(!this.root){this.root={text:l,children:[]},this.stack=[{level:0,node:this.root}],I(l);return}this.baseLevel??=t;let o=t-this.baseLevel+1;if(o<=0)o=1;while(this.stack.length>1&&this.stack[this.stack.length-1].level>=o)this.stack.pop();let h=this.stack[this.stack.length-1].node,p={text:l,children:[]};h.children.push(p),this.stack.push({level:o,node:p})}getAccTitle(){return E()}setAccTitle(t){S(t)}getAccDescription(){return A()}setAccDescription(t){T(t)}getDiagramTitle(){return L()}setDiagramTitle(t){I(t)}},Et=14,et=250,$t=30,At=60,It=5,bt=82*Math.PI/180,pt=Math.cos(bt),gt=Math.sin(bt),kt=e((t,f,l)=>{let o=t.node().getBBox(),h=o.width+f*2,p=o.height+f*2;B(t,p,h,l),t.attr("viewBox",`${o.x-f} ${o.y-f} ${h} ${p}`)},"applyPaddedViewBox"),Lt=e((t,f,l,o)=>{let p=o.db.getRoot();if(!p)return;let k=s(),{look:d,handDrawnSeed:x,themeVariables:u}=k,_=Ge(k.fontSize)[0]??Et,b=d==="handDrawn",M=p.children??[],P=k.ishikawa?.diagramPadding??20,U=k.ishikawa?.useMaxWidth??!1,Z=q(f),V=Z.append("g").attr("class","ishikawa"),z=b?m.svg(Z.node()):void 0,i=z?{roughSvg:z,seed:x??0,lineColor:u?.lineColor??"#333",fillColor:u?.mainBkg??"#fff"}:void 0,a=`ishikawa-arrow-${f}`;if(!b)V.append("defs").append("marker").attr("id",a).attr("viewBox","0 0 10 10").attr("refX",0).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 Z").attr("class","ishikawa-arrow");let n=0,c=et,g=b?void 0:it(V,n,c,n,c,"ishikawa-spine");if(Tt(V,n,c,p.text,_,i),!M.length){if(b)it(V,n,c,n,c,"ishikawa-spine",i);kt(Z,P,U);return}n-=20;let r=M.filter((w,O)=>O%2===0),N=M.filter((w,O)=>O%2===1),v=mt(r),W=mt(N),D=v.total+W.total,R=et,F=et;if(D>0){let w=et*2,O=et*0.3;R=Math.max(O,w*(v.total/D)),F=Math.max(O,w*(W.total/D))}let X=_*2;if(R=Math.max(R,v.max*X),F=Math.max(F,W.max*X),c=Math.max(R,et),g)g.attr("y1",c).attr("y2",c);V.select(".ishikawa-head-group").attr("transform",`translate(0,${c})`);let rt=Math.ceil(M.length/2);for(let w=0;w<rt;w++){let O=V.append("g").attr("class","ishikawa-pair");for(let[K,Q,lt]of[[M[w*2],-1,R],[M[w*2+1],1,F]])if(K)Bt(O,K,n,c,Q,lt,_,i);n=O.selectAll("text").nodes().reduce((K,Q)=>Math.min(K,Q.getBBox().x),1/0)}if(b)it(V,n,c,0,c,"ishikawa-spine",i);else{g.attr("x1",n);let w=`url(#${a})`;V.selectAll("line.ishikawa-branch, line.ishikawa-sub-branch").attr("marker-start",w)}kt(Z,P,U)},"draw"),mt=e((t)=>{let f=e((l)=>l.children.reduce((o,h)=>o+1+f(h),0),"countDescendants");return t.reduce((l,o)=>{let h=f(o);return l.total+=h,l.max=Math.max(l.max,h),l},{total:0,max:0})},"sideStats"),Tt=e((t,f,l,o,h,p)=>{let k=Math.max(6,Math.floor(110/(h*0.6))),d=t.append("g").attr("class","ishikawa-head-group").attr("transform",`translate(${f},${l})`),x=at(d,_t(o,k),0,0,"ishikawa-head-label","start",h),u=x.node().getBBox(),_=Math.max(60,u.width+6),b=Math.max(40,u.height*2+40),M=`M 0 ${-b/2} L 0 ${b/2} Q ${_*2.4} 0 0 ${-b/2} Z`;if(p){let P=p.roughSvg.path(M,{roughness:1.5,seed:p.seed,fill:p.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:p.lineColor,strokeWidth:2});d.insert(()=>P,":first-child").attr("class","ishikawa-head")}else d.insert("path",":first-child").attr("class","ishikawa-head").attr("d",M);x.attr("transform",`translate(${(_-u.width)/2-u.x+3},${-u.y-u.height/2})`)},"drawHead"),Mt=e((t,f)=>{let l=[],o=[],h=e((p,k,d)=>{let x=f===-1?[...p].reverse():p;for(let u of x){let _=l.length,b=u.children??[];if(l.push({depth:d,text:_t(u.text,15),parentIndex:k,childCount:b.length}),d%2===0){if(o.push(_),b.length)h(b,_,d+1)}else{if(b.length)h(b,_,d+1);o.push(_)}}},"walk");return h(t,-1,2),{entries:l,yOrder:o}},"flattenTree"),Pt=e((t,f,l,o,h,p,k)=>{let d=t.append("g").attr("class","ishikawa-label-group"),u=at(d,f,l,o+11*h,"ishikawa-label cause","middle",p).node().getBBox();if(k){let _=k.roughSvg.rectangle(u.x-20,u.y-2,u.width+40,u.height+4,{roughness:1.5,seed:k.seed,fill:k.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:k.lineColor,strokeWidth:2});d.insert(()=>_,":first-child").attr("class","ishikawa-label-box")}else d.insert("rect",":first-child").attr("class","ishikawa-label-box").attr("x",u.x-20).attr("y",u.y-2).attr("width",u.width+40).attr("height",u.height+4)},"drawCauseLabel"),ut=e((t,f,l,o,h,p)=>{let k=Math.sqrt(o*o+h*h);if(k===0)return;let d=o/k,x=h/k,u=6,_=-x*u,b=d*u,M=f,P=l,U=`M ${M} ${P} L ${M-d*u*2+_} ${P-x*u*2+b} L ${M-d*u*2-_} ${P-x*u*2-b} Z`,Z=p.roughSvg.path(U,{roughness:1,seed:p.seed,fill:p.lineColor,fillStyle:"solid",stroke:p.lineColor,strokeWidth:1});t.append(()=>Z)},"drawArrowMarker"),Bt=e((t,f,l,o,h,p,k,d)=>{let x=f.children??[],u=p*(x.length?1:0.2),_=-pt*u,b=gt*u*h,M=l+_,P=o+b;if(it(t,l,o,M,P,"ishikawa-branch",d),d)ut(t,l,o,l-M,o-P,d);if(Pt(t,f.text,M,P,h,k,d),!x.length)return;let{entries:U,yOrder:Z}=Mt(x,h),V=U.length,z=Array(V);for(let[g,r]of Z.entries())z[r]=o+b*((g+1)/(V+1));let i=new Map;i.set(-1,{x0:l,y0:o,x1:M,y1:P,childCount:x.length,childrenDrawn:0});let a=-pt,n=gt*h,c=h<0?"ishikawa-label up":"ishikawa-label down";for(let[g,r]of U.entries()){let N=z[g],v=i.get(r.parentIndex),W=t.append("g").attr("class","ishikawa-sub-group"),D=0,R=0,F=0;if(r.depth%2===0){let X=v.y1-v.y0;if(D=wt(v.x0,v.x1,X?(N-v.y0)/X:0.5),R=N,F=D-(r.childCount>0?At+r.childCount*It:$t),it(W,D,N,F,N,"ishikawa-sub-branch",d),d)ut(W,D,N,1,0,d);at(W,r.text,F,N,"ishikawa-label align","end",k)}else{let X=v.childrenDrawn++;if(D=wt(v.x0,v.x1,(v.childCount-X)/(v.childCount+1)),R=v.y0,F=D+a*((N-R)/n),it(W,D,R,F,N,"ishikawa-sub-branch",d),d)ut(W,D,R,D-F,R-N,d);at(W,r.text,F,N,c,"end",k)}if(r.childCount>0)i.set(g,{x0:D,y0:R,x1:F,y1:N,childCount:r.childCount,childrenDrawn:0})}},"drawBranch"),Nt=e((t)=>t.split(/<br\s*\/?>|\n/),"splitLines"),_t=e((t,f)=>{if(t.length<=f)return t;let l=[];for(let o of t.split(/\s+/)){let h=l.length-1;if(h>=0&&l[h].length+1+o.length<=f)l[h]+=" "+o;else l.push(o)}return l.join(`
6
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:e(function(){var a=this.next();if(a)return a;else return this.lex()},"lex"),begin:e(function(a){this.conditionStack.push(a)},"begin"),popState:e(function(){var a=this.conditionStack.length-1;if(a>0)return this.conditionStack.pop();else return this.conditionStack[0]},"popState"),_currentRules:e(function(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1])return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules;else return this.conditions.INITIAL.rules},"_currentRules"),topState:e(function(a){if(a=this.conditionStack.length-1-Math.abs(a||0),a>=0)return this.conditionStack[a];else return"INITIAL"},"topState"),pushState:e(function(a){this.begin(a)},"pushState"),stateStackSize:e(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:e(function(a,n,c,g){var r=g;switch(c){case 0:return 6;case 1:return 8;case 2:return 8;case 3:return 6;case 4:return 7;case 5:return 13;case 6:return 14;case 7:return 11}},"anonymous"),rules:[/^(?:\s*%%.*)/i,/^(?:ishikawa-beta\b)/i,/^(?:ishikawa\b)/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:[^\n]+)/i,/^(?:$)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7],inclusive:!0}}};return H}();Z.lexer=X;function R(){this.yy={}}return e(R,"Parser"),R.prototype=Z,Z.Parser=R,new R}();dt.parser=dt;var vt=dt,St=class{constructor(){this.stack=[],this.clear=this.clear.bind(this),this.addNode=this.addNode.bind(this),this.getRoot=this.getRoot.bind(this)}static{e(this,"IshikawaDB")}clear(){this.root=void 0,this.stack=[],this.baseLevel=void 0,C()}getRoot(){return this.root}addNode(t,f){let l=y.sanitizeText(f,s());if(!this.root){this.root={text:l,children:[]},this.stack=[{level:0,node:this.root}],I(l);return}this.baseLevel??=t;let o=t-this.baseLevel+1;if(o<=0)o=1;while(this.stack.length>1&&this.stack[this.stack.length-1].level>=o)this.stack.pop();let h=this.stack[this.stack.length-1].node,p={text:l,children:[]};h.children.push(p),this.stack.push({level:o,node:p})}getAccTitle(){return E()}setAccTitle(t){S(t)}getAccDescription(){return A()}setAccDescription(t){T(t)}getDiagramTitle(){return L()}setDiagramTitle(t){I(t)}},Et=14,et=250,$t=30,At=60,It=5,bt=82*Math.PI/180,pt=Math.cos(bt),gt=Math.sin(bt),kt=e((t,f,l)=>{let o=t.node().getBBox(),h=o.width+f*2,p=o.height+f*2;B(t,p,h,l),t.attr("viewBox",`${o.x-f} ${o.y-f} ${h} ${p}`)},"applyPaddedViewBox"),Lt=e((t,f,l,o)=>{let p=o.db.getRoot();if(!p)return;let k=s(),{look:d,handDrawnSeed:x,themeVariables:u}=k,_=Ge(k.fontSize)[0]??Et,b=d==="handDrawn",M=p.children??[],P=k.ishikawa?.diagramPadding??20,Z=k.ishikawa?.useMaxWidth??!1,X=V(f),R=X.append("g").attr("class","ishikawa"),H=b?m.svg(X.node()):void 0,i=H?{roughSvg:H,seed:x??0,lineColor:u?.lineColor??"#333",fillColor:u?.mainBkg??"#fff"}:void 0,a=`ishikawa-arrow-${f}`;if(!b)R.append("defs").append("marker").attr("id",a).attr("viewBox","0 0 10 10").attr("refX",0).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 Z").attr("class","ishikawa-arrow");let n=0,c=et,g=b?void 0:it(R,n,c,n,c,"ishikawa-spine");if(Tt(R,n,c,p.text,_,i),!M.length){if(b)it(R,n,c,n,c,"ishikawa-spine",i);kt(X,P,Z);return}n-=20;let r=M.filter((w,O)=>O%2===0),N=M.filter((w,O)=>O%2===1),v=mt(r),F=mt(N),D=v.total+F.total,W=et,j=et;if(D>0){let w=et*2,O=et*0.3;W=Math.max(O,w*(v.total/D)),j=Math.max(O,w*(F.total/D))}let Y=_*2;if(W=Math.max(W,v.max*Y),j=Math.max(j,F.max*Y),c=Math.max(W,et),g)g.attr("y1",c).attr("y2",c);R.select(".ishikawa-head-group").attr("transform",`translate(0,${c})`);let rt=Math.ceil(M.length/2);for(let w=0;w<rt;w++){let O=R.append("g").attr("class","ishikawa-pair");for(let[q,Q,lt]of[[M[w*2],-1,W],[M[w*2+1],1,j]])if(q)Bt(O,q,n,c,Q,lt,_,i);n=O.selectAll("text").nodes().reduce((q,Q)=>Math.min(q,Q.getBBox().x),1/0)}if(b)it(R,n,c,0,c,"ishikawa-spine",i);else{g.attr("x1",n);let w=`url(#${a})`;R.selectAll("line.ishikawa-branch, line.ishikawa-sub-branch").attr("marker-start",w)}kt(X,P,Z)},"draw"),mt=e((t)=>{let f=e((l)=>l.children.reduce((o,h)=>o+1+f(h),0),"countDescendants");return t.reduce((l,o)=>{let h=f(o);return l.total+=h,l.max=Math.max(l.max,h),l},{total:0,max:0})},"sideStats"),Tt=e((t,f,l,o,h,p)=>{let k=Math.max(6,Math.floor(110/(h*0.6))),d=t.append("g").attr("class","ishikawa-head-group").attr("transform",`translate(${f},${l})`),x=at(d,_t(o,k),0,0,"ishikawa-head-label","start",h),u=x.node().getBBox(),_=Math.max(60,u.width+6),b=Math.max(40,u.height*2+40),M=`M 0 ${-b/2} L 0 ${b/2} Q ${_*2.4} 0 0 ${-b/2} Z`;if(p){let P=p.roughSvg.path(M,{roughness:1.5,seed:p.seed,fill:p.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:p.lineColor,strokeWidth:2});d.insert(()=>P,":first-child").attr("class","ishikawa-head")}else d.insert("path",":first-child").attr("class","ishikawa-head").attr("d",M);x.attr("transform",`translate(${(_-u.width)/2-u.x+3},${-u.y-u.height/2})`)},"drawHead"),Mt=e((t,f)=>{let l=[],o=[],h=e((p,k,d)=>{let x=f===-1?[...p].reverse():p;for(let u of x){let _=l.length,b=u.children??[];if(l.push({depth:d,text:_t(u.text,15),parentIndex:k,childCount:b.length}),d%2===0){if(o.push(_),b.length)h(b,_,d+1)}else{if(b.length)h(b,_,d+1);o.push(_)}}},"walk");return h(t,-1,2),{entries:l,yOrder:o}},"flattenTree"),Pt=e((t,f,l,o,h,p,k)=>{let d=t.append("g").attr("class","ishikawa-label-group"),u=at(d,f,l,o+11*h,"ishikawa-label cause","middle",p).node().getBBox();if(k){let _=k.roughSvg.rectangle(u.x-20,u.y-2,u.width+40,u.height+4,{roughness:1.5,seed:k.seed,fill:k.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:k.lineColor,strokeWidth:2});d.insert(()=>_,":first-child").attr("class","ishikawa-label-box")}else d.insert("rect",":first-child").attr("class","ishikawa-label-box").attr("x",u.x-20).attr("y",u.y-2).attr("width",u.width+40).attr("height",u.height+4)},"drawCauseLabel"),ut=e((t,f,l,o,h,p)=>{let k=Math.sqrt(o*o+h*h);if(k===0)return;let d=o/k,x=h/k,u=6,_=-x*u,b=d*u,M=f,P=l,Z=`M ${M} ${P} L ${M-d*u*2+_} ${P-x*u*2+b} L ${M-d*u*2-_} ${P-x*u*2-b} Z`,X=p.roughSvg.path(Z,{roughness:1,seed:p.seed,fill:p.lineColor,fillStyle:"solid",stroke:p.lineColor,strokeWidth:1});t.append(()=>X)},"drawArrowMarker"),Bt=e((t,f,l,o,h,p,k,d)=>{let x=f.children??[],u=p*(x.length?1:0.2),_=-pt*u,b=gt*u*h,M=l+_,P=o+b;if(it(t,l,o,M,P,"ishikawa-branch",d),d)ut(t,l,o,l-M,o-P,d);if(Pt(t,f.text,M,P,h,k,d),!x.length)return;let{entries:Z,yOrder:X}=Mt(x,h),R=Z.length,H=Array(R);for(let[g,r]of X.entries())H[r]=o+b*((g+1)/(R+1));let i=new Map;i.set(-1,{x0:l,y0:o,x1:M,y1:P,childCount:x.length,childrenDrawn:0});let a=-pt,n=gt*h,c=h<0?"ishikawa-label up":"ishikawa-label down";for(let[g,r]of Z.entries()){let N=H[g],v=i.get(r.parentIndex),F=t.append("g").attr("class","ishikawa-sub-group"),D=0,W=0,j=0;if(r.depth%2===0){let Y=v.y1-v.y0;if(D=wt(v.x0,v.x1,Y?(N-v.y0)/Y:0.5),W=N,j=D-(r.childCount>0?At+r.childCount*It:$t),it(F,D,N,j,N,"ishikawa-sub-branch",d),d)ut(F,D,N,1,0,d);at(F,r.text,j,N,"ishikawa-label align","end",k)}else{let Y=v.childrenDrawn++;if(D=wt(v.x0,v.x1,(v.childCount-Y)/(v.childCount+1)),W=v.y0,j=D+a*((N-W)/n),it(F,D,W,j,N,"ishikawa-sub-branch",d),d)ut(F,D,W,D-j,W-N,d);at(F,r.text,j,N,c,"end",k)}if(r.childCount>0)i.set(g,{x0:D,y0:W,x1:j,y1:N,childCount:r.childCount,childrenDrawn:0})}},"drawBranch"),Nt=e((t)=>t.split(/<br\s*\/?>|\n/),"splitLines"),_t=e((t,f)=>{if(t.length<=f)return t;let l=[];for(let o of t.split(/\s+/)){let h=l.length-1;if(h>=0&&l[h].length+1+o.length<=f)l[h]+=" "+o;else l.push(o)}return l.join(`
7
7
  `)},"wrapText"),at=e((t,f,l,o,h,p,k)=>{let d=Nt(f),x=k*1.05,u=t.append("text").attr("class",h).attr("text-anchor",p).attr("x",l).attr("y",o-(d.length-1)*x/2);for(let[_,b]of d.entries())u.append("tspan").attr("x",l).attr("dy",_===0?0:x).text(b);return u},"drawMultilineText"),wt=e((t,f,l)=>t+(f-t)*l,"lerp"),it=e((t,f,l,o,h,p,k)=>{if(k){let d=k.roughSvg.line(f,l,o,h,{roughness:1.5,seed:k.seed,stroke:k.lineColor,strokeWidth:2});t.append(()=>d).attr("class",p);return}return t.append("line").attr("class",p).attr("x1",f).attr("y1",l).attr("x2",o).attr("y2",h)},"drawLine"),Dt={draw:Lt},Ot=e((t)=>`
8
8
  .ishikawa .ishikawa-spine,
9
9
  .ishikawa .ishikawa-branch,
@@ -0,0 +1,2 @@
1
+ import{F,De}from"./chunk-9dd1c37b.js";var n=(r,o)=>F.lang.round(De.parse(r)[o]),Ot=n;
2
+ export{Ot};
@@ -0,0 +1 @@
1
+ import{xi}from"./chunk-qryrg2pq.js";export{xi as createGitGraphServices};
@@ -1,2 +1,2 @@
1
- import{Rt,fn,Dt,ra}from"./chunk-0mrkjnte.js";import{Nt}from"./chunk-ry9256r7.js";import{$t,Cr,Fn,$e,Sr}from"./chunk-jtwhjp20.js";function s(r,n){return r==null||n==null?NaN:r<n?-1:r>n?1:r>=n?0:NaN}function x(r,n){return r==null||n==null?NaN:n<r?-1:n>r?1:n>=r?0:NaN}function nr(r){let n,e,t;if(r.length!==2)n=s,e=(f,c)=>s(r(f),c),t=(f,c)=>r(f)-c;else n=r===s||r===x?r:O,e=r,t=r;function o(f,c,i=0,p=f.length){if(i<p){if(n(c,c)!==0)return p;do{let l=i+p>>>1;if(e(f[l],c)<0)i=l+1;else p=l}while(i<p)}return i}function a(f,c,i=0,p=f.length){if(i<p){if(n(c,c)!==0)return p;do{let l=i+p>>>1;if(e(f[l],c)<=0)i=l+1;else p=l}while(i<p)}return i}function u(f,c,i=0,p=f.length){let l=o(f,c,i,p-1);return l>i&&t(f[l-1],c)>-t(f[l],c)?l-1:l}return{left:o,center:u,right:a}}function O(){return 0}function y(r){return r===null?NaN:+r}var V=nr(s),{right:T,left:or}=V,ur=nr(y).center,z=T;var E=Math.sqrt(50),G=Math.sqrt(10),H=Math.sqrt(2);function g(r,n,e){let t=(n-r)/Math.max(0,e),o=Math.floor(Math.log10(t)),a=t/Math.pow(10,o),u=a>=E?10:a>=G?5:a>=H?2:1,f,c,i;if(o<0){if(i=Math.pow(10,-o)/u,f=Math.round(r*i),c=Math.round(n*i),f/i<r)++f;if(c/i>n)--c;i=-i}else{if(i=Math.pow(10,o)*u,f=Math.round(r/i),c=Math.round(n/i),f*i<r)++f;if(c*i>n)--c}if(c<f&&0.5<=e&&e<2)return g(r,n,e*2);return[f,c,i]}function v(r,n,e){if(n=+n,r=+r,e=+e,!(e>0))return[];if(r===n)return[r];let t=n<r,[o,a,u]=t?g(n,r,e):g(r,n,e);if(!(a>=o))return[];let f=a-o+1,c=Array(f);if(t)if(u<0)for(let i=0;i<f;++i)c[i]=(a-i)/-u;else for(let i=0;i<f;++i)c[i]=(a-i)*u;else if(u<0)for(let i=0;i<f;++i)c[i]=(o+i)/-u;else for(let i=0;i<f;++i)c[i]=(o+i)*u;return c}function M(r,n,e){return n=+n,r=+r,e=+e,g(r,n,e)[2]}function Pr(r,n,e){n=+n,r=+r,e=+e;let t=n<r,o=t?M(n,r,e):M(r,n,e);return(t?-1:1)*(o<0?1/-o:o)}function N(r,n){if(!n)n=[];var e=r?Math.min(n.length,r.length):0,t=n.slice(),o;return function(a){for(o=0;o<e;++o)t[o]=r[o]*(1-a)+n[o]*a;return t}}function B(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}function P(r,n){var e=n?n.length:0,t=r?Math.min(e,r.length):0,o=Array(t),a=Array(e),u;for(u=0;u<t;++u)o[u]=h(r[u],n[u]);for(;u<e;++u)a[u]=n[u];return function(f){for(u=0;u<t;++u)a[u]=o[u](f);return a}}function w(r,n){var e=new Date;return r=+r,n=+n,function(t){return e.setTime(r*(1-t)+n*t),e}}function k(r,n){var e={},t={},o;if(r===null||typeof r!=="object")r={};if(n===null||typeof n!=="object")n={};for(o in n)if(o in r)e[o]=h(r[o],n[o]);else t[o]=n[o];return function(a){for(o in e)t[o]=e[o](a);return t}}function h(r,n){var e=typeof n,t;return n==null||e==="boolean"?Cr(n):(e==="number"?$e:e==="string"?(t=$t(n))?(n=t,Fn):Sr:n instanceof $t?Fn:n instanceof Date?w:B(n)?N:Array.isArray(n)?P:typeof n.valueOf!=="function"&&typeof n.toString!=="function"||isNaN(n)?k:$e)(r,n)}function A(r,n){return r=+r,n=+n,function(e){return Math.round(r*(1-e)+n*e)}}function R(r){return Math.max(0,-Rt(Math.abs(r)))}function S(r,n){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Rt(n)/3)))*3-Rt(Math.abs(r)))}function j(r,n){return r=Math.abs(r),n=Math.abs(n)-r,Math.max(0,Rt(n)-Rt(r))+1}function F(r){return function(){return r}}function q(r){return+r}var C=[0,1];function d(r){return r}function D(r,n){return(n-=r=+r)?function(e){return(e-r)/n}:F(isNaN(n)?NaN:0.5)}function J(r,n){var e;if(r>n)e=r,r=n,n=e;return function(t){return Math.max(r,Math.min(n,t))}}function K(r,n,e){var t=r[0],o=r[1],a=n[0],u=n[1];if(o<t)t=D(o,t),a=e(u,a);else t=D(t,o),a=e(a,u);return function(f){return a(t(f))}}function Q(r,n,e){var t=Math.min(r.length,n.length)-1,o=Array(t),a=Array(t),u=-1;if(r[t]<r[0])r=r.slice().reverse(),n=n.slice().reverse();while(++u<t)o[u]=D(r[u],r[u+1]),a[u]=e(n[u],n[u+1]);return function(f){var c=z(r,f,1,t)-1;return a[c](o[c](f))}}function na(r,n){return n.domain(r.domain()).range(r.range()).interpolate(r.interpolate()).clamp(r.clamp()).unknown(r.unknown())}function U(){var r=C,n=C,e=h,t,o,a,u=d,f,c,i;function p(){var m=Math.min(r.length,n.length);if(u!==d)u=J(r[0],r[m-1]);return f=m>2?Q:K,c=i=null,l}function l(m){return m==null||isNaN(m=+m)?a:(c||(c=f(r.map(t),n,e)))(t(u(m)))}return l.invert=function(m){return u(o((i||(i=f(n,r.map(t),$e)))(m)))},l.domain=function(m){return arguments.length?(r=Array.from(m,q),p()):r.slice()},l.range=function(m){return arguments.length?(n=Array.from(m),p()):n.slice()},l.rangeRound=function(m){return n=Array.from(m),e=A,p()},l.clamp=function(m){return arguments.length?(u=m?!0:d,p()):u!==d},l.interpolate=function(m){return arguments.length?(e=m,p()):e},l.unknown=function(m){return arguments.length?(a=m,l):a},function(m,L){return t=m,o=L,p()}}function Or(){return U()(d,d)}function I(r,n,e,t){var o=Pr(r,n,e),a;switch(t=fn(t==null?",f":t),t.type){case"s":{var u=Math.max(Math.abs(r),Math.abs(n));if(t.precision==null&&!isNaN(a=S(o,u)))t.precision=a;return ra(t,u)}case"":case"e":case"g":case"p":case"r":{if(t.precision==null&&!isNaN(a=j(o,Math.max(Math.abs(r),Math.abs(n)))))t.precision=a-(t.type==="e");break}case"f":case"%":{if(t.precision==null&&!isNaN(a=R(o)))t.precision=a-(t.type==="%")*2;break}}return Dt(t)}function W(r){var n=r.domain;return r.ticks=function(e){var t=n();return v(t[0],t[t.length-1],e==null?10:e)},r.tickFormat=function(e,t){var o=n();return I(o[0],o[o.length-1],e==null?10:e,t)},r.nice=function(e){if(e==null)e=10;var t=n(),o=0,a=t.length-1,u=t[o],f=t[a],c,i,p=10;if(f<u)i=u,u=f,f=i,i=o,o=a,a=i;while(p-- >0){if(i=M(u,f,e),i===c)return t[o]=u,t[a]=f,n(t);else if(i>0)u=Math.floor(u/i)*i,f=Math.ceil(f/i)*i;else if(i<0)u=Math.ceil(u*i)/i,f=Math.floor(f*i)/i;else break;c=i}return r},r}function xt(){var r=Or();return r.copy=function(){return na(r,xt())},Nt.apply(r,arguments),W(r)}
1
+ import{Dt,fn,Nt,ra}from"./chunk-ds7srg4p.js";import{Mt}from"./chunk-cqp1d4p0.js";import{Bt,Cr,Fn,$e,Sr}from"./chunk-9dd1c37b.js";function s(r,n){return r==null||n==null?NaN:r<n?-1:r>n?1:r>=n?0:NaN}function x(r,n){return r==null||n==null?NaN:n<r?-1:n>r?1:n>=r?0:NaN}function nr(r){let n,e,t;if(r.length!==2)n=s,e=(f,c)=>s(r(f),c),t=(f,c)=>r(f)-c;else n=r===s||r===x?r:O,e=r,t=r;function o(f,c,i=0,p=f.length){if(i<p){if(n(c,c)!==0)return p;do{let l=i+p>>>1;if(e(f[l],c)<0)i=l+1;else p=l}while(i<p)}return i}function a(f,c,i=0,p=f.length){if(i<p){if(n(c,c)!==0)return p;do{let l=i+p>>>1;if(e(f[l],c)<=0)i=l+1;else p=l}while(i<p)}return i}function u(f,c,i=0,p=f.length){let l=o(f,c,i,p-1);return l>i&&t(f[l-1],c)>-t(f[l],c)?l-1:l}return{left:o,center:u,right:a}}function O(){return 0}function y(r){return r===null?NaN:+r}var V=nr(s),{right:T,left:or}=V,ur=nr(y).center,z=T;var E=Math.sqrt(50),G=Math.sqrt(10),H=Math.sqrt(2);function g(r,n,e){let t=(n-r)/Math.max(0,e),o=Math.floor(Math.log10(t)),a=t/Math.pow(10,o),u=a>=E?10:a>=G?5:a>=H?2:1,f,c,i;if(o<0){if(i=Math.pow(10,-o)/u,f=Math.round(r*i),c=Math.round(n*i),f/i<r)++f;if(c/i>n)--c;i=-i}else{if(i=Math.pow(10,o)*u,f=Math.round(r/i),c=Math.round(n/i),f*i<r)++f;if(c*i>n)--c}if(c<f&&0.5<=e&&e<2)return g(r,n,e*2);return[f,c,i]}function v(r,n,e){if(n=+n,r=+r,e=+e,!(e>0))return[];if(r===n)return[r];let t=n<r,[o,a,u]=t?g(n,r,e):g(r,n,e);if(!(a>=o))return[];let f=a-o+1,c=Array(f);if(t)if(u<0)for(let i=0;i<f;++i)c[i]=(a-i)/-u;else for(let i=0;i<f;++i)c[i]=(a-i)*u;else if(u<0)for(let i=0;i<f;++i)c[i]=(o+i)/-u;else for(let i=0;i<f;++i)c[i]=(o+i)*u;return c}function M(r,n,e){return n=+n,r=+r,e=+e,g(r,n,e)[2]}function Pr(r,n,e){n=+n,r=+r,e=+e;let t=n<r,o=t?M(n,r,e):M(r,n,e);return(t?-1:1)*(o<0?1/-o:o)}function N(r,n){if(!n)n=[];var e=r?Math.min(n.length,r.length):0,t=n.slice(),o;return function(a){for(o=0;o<e;++o)t[o]=r[o]*(1-a)+n[o]*a;return t}}function B(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}function P(r,n){var e=n?n.length:0,t=r?Math.min(e,r.length):0,o=Array(t),a=Array(e),u;for(u=0;u<t;++u)o[u]=h(r[u],n[u]);for(;u<e;++u)a[u]=n[u];return function(f){for(u=0;u<t;++u)a[u]=o[u](f);return a}}function w(r,n){var e=new Date;return r=+r,n=+n,function(t){return e.setTime(r*(1-t)+n*t),e}}function k(r,n){var e={},t={},o;if(r===null||typeof r!=="object")r={};if(n===null||typeof n!=="object")n={};for(o in n)if(o in r)e[o]=h(r[o],n[o]);else t[o]=n[o];return function(a){for(o in e)t[o]=e[o](a);return t}}function h(r,n){var e=typeof n,t;return n==null||e==="boolean"?Cr(n):(e==="number"?$e:e==="string"?(t=Bt(n))?(n=t,Fn):Sr:n instanceof Bt?Fn:n instanceof Date?w:B(n)?N:Array.isArray(n)?P:typeof n.valueOf!=="function"&&typeof n.toString!=="function"||isNaN(n)?k:$e)(r,n)}function A(r,n){return r=+r,n=+n,function(e){return Math.round(r*(1-e)+n*e)}}function R(r){return Math.max(0,-Dt(Math.abs(r)))}function S(r,n){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Dt(n)/3)))*3-Dt(Math.abs(r)))}function j(r,n){return r=Math.abs(r),n=Math.abs(n)-r,Math.max(0,Dt(n)-Dt(r))+1}function F(r){return function(){return r}}function q(r){return+r}var C=[0,1];function d(r){return r}function D(r,n){return(n-=r=+r)?function(e){return(e-r)/n}:F(isNaN(n)?NaN:0.5)}function J(r,n){var e;if(r>n)e=r,r=n,n=e;return function(t){return Math.max(r,Math.min(n,t))}}function K(r,n,e){var t=r[0],o=r[1],a=n[0],u=n[1];if(o<t)t=D(o,t),a=e(u,a);else t=D(t,o),a=e(a,u);return function(f){return a(t(f))}}function Q(r,n,e){var t=Math.min(r.length,n.length)-1,o=Array(t),a=Array(t),u=-1;if(r[t]<r[0])r=r.slice().reverse(),n=n.slice().reverse();while(++u<t)o[u]=D(r[u],r[u+1]),a[u]=e(n[u],n[u+1]);return function(f){var c=z(r,f,1,t)-1;return a[c](o[c](f))}}function na(r,n){return n.domain(r.domain()).range(r.range()).interpolate(r.interpolate()).clamp(r.clamp()).unknown(r.unknown())}function U(){var r=C,n=C,e=h,t,o,a,u=d,f,c,i;function p(){var m=Math.min(r.length,n.length);if(u!==d)u=J(r[0],r[m-1]);return f=m>2?Q:K,c=i=null,l}function l(m){return m==null||isNaN(m=+m)?a:(c||(c=f(r.map(t),n,e)))(t(u(m)))}return l.invert=function(m){return u(o((i||(i=f(n,r.map(t),$e)))(m)))},l.domain=function(m){return arguments.length?(r=Array.from(m,q),p()):r.slice()},l.range=function(m){return arguments.length?(n=Array.from(m),p()):n.slice()},l.rangeRound=function(m){return n=Array.from(m),e=A,p()},l.clamp=function(m){return arguments.length?(u=m?!0:d,p()):u!==d},l.interpolate=function(m){return arguments.length?(e=m,p()):e},l.unknown=function(m){return arguments.length?(a=m,l):a},function(m,L){return t=m,o=L,p()}}function Or(){return U()(d,d)}function I(r,n,e,t){var o=Pr(r,n,e),a;switch(t=fn(t==null?",f":t),t.type){case"s":{var u=Math.max(Math.abs(r),Math.abs(n));if(t.precision==null&&!isNaN(a=S(o,u)))t.precision=a;return ra(t,u)}case"":case"e":case"g":case"p":case"r":{if(t.precision==null&&!isNaN(a=j(o,Math.max(Math.abs(r),Math.abs(n)))))t.precision=a-(t.type==="e");break}case"f":case"%":{if(t.precision==null&&!isNaN(a=R(o)))t.precision=a-(t.type==="%")*2;break}}return Nt(t)}function W(r){var n=r.domain;return r.ticks=function(e){var t=n();return v(t[0],t[t.length-1],e==null?10:e)},r.tickFormat=function(e,t){var o=n();return I(o[0],o[o.length-1],e==null?10:e,t)},r.nice=function(e){if(e==null)e=10;var t=n(),o=0,a=t.length-1,u=t[o],f=t[a],c,i,p=10;if(f<u)i=u,u=f,f=i,i=o,o=a,a=i;while(p-- >0){if(i=M(u,f,e),i===c)return t[o]=u,t[a]=f,n(t);else if(i>0)u=Math.floor(u/i)*i,f=Math.ceil(f/i)*i;else if(i<0)u=Math.ceil(u*i)/i,f=Math.floor(f*i)/i;else break;c=i}return r},r}function xt(){var r=Or();return r.copy=function(){return na(r,xt())},Mt.apply(r,arguments),W(r)}
2
2
  export{nr,Pr,na,Or,xt};
@@ -1,4 +1,4 @@
1
- import{e,B,C,S,E,T,A,I,L,s,p}from"./chunk-jtwhjp20.js";import{nn,Br,Xi,Ke}from"./chunk-ghxe4gam.js";import{bt}from"./chunk-3ahpr030.js";import{je}from"./chunk-hryhthxr.js";var nt=function(){var t=e(function(u,n,a,o){for(a=a||{},o=u.length;o--;a[u[o]]=n);return a},"o"),r=[6,8,10,11,12,14,16,17,18],l=[1,9],g=[1,10],i=[1,11],y=[1,12],m=[1,13],c=[1,14],x={trace:e(function(){},"trace"),yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:"error",4:"journey",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",18:"taskName",19:"taskData"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:e(function(n,a,o,d,f,h,w){var _=h.length-1;switch(f){case 1:return h[_-1];case 2:this.$=[];break;case 3:h[_-1].push(h[_]),this.$=h[_-1];break;case 4:case 5:this.$=h[_];break;case 6:case 7:this.$=[];break;case 8:d.setDiagramTitle(h[_].substr(6)),this.$=h[_].substr(6);break;case 9:this.$=h[_].trim(),d.setAccTitle(this.$);break;case 10:case 11:this.$=h[_].trim(),d.setAccDescription(this.$);break;case 12:d.addSection(h[_].substr(8)),this.$=h[_].substr(8);break;case 13:d.addTask(h[_-1],h[_]),this.$="task";break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(r,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:l,12:g,14:i,16:y,17:m,18:c},t(r,[2,7],{1:[2,1]}),t(r,[2,3]),{9:15,11:l,12:g,14:i,16:y,17:m,18:c},t(r,[2,5]),t(r,[2,6]),t(r,[2,8]),{13:[1,16]},{15:[1,17]},t(r,[2,11]),t(r,[2,12]),{19:[1,18]},t(r,[2,4]),t(r,[2,9]),t(r,[2,10]),t(r,[2,13])],defaultActions:{},parseError:e(function(n,a){if(a.recoverable)this.trace(n);else{var o=Error(n);throw o.hash=a,o}},"parseError"),parse:e(function(n){var a=this,o=[0],d=[],f=[null],h=[],w=this.table,_="",z=0,ot=0,ct=0,vt=2,ht=1,wt=h.slice.call(arguments,1),v=Object.create(this.lexer),O={yy:{}};for(var Q in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,Q))O.yy[Q]=this.yy[Q];if(v.setInput(n,O.yy),O.yy.lexer=v,O.yy.parser=this,typeof v.yylloc>"u")v.yylloc={};var D=v.yylloc;h.push(D);var Tt=v.options&&v.options.ranges;if(typeof O.yy.parseError==="function")this.parseError=O.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function St(F){o.length=o.length-2*F,f.length=f.length-F,h.length=h.length-F}e(St,"popStack");function ut(){var F=d.pop()||v.lex()||ht;if(typeof F!=="number"){if(F instanceof Array)d=F,F=d.pop();F=a.symbols_[F]||F}return F}e(ut,"lex");var M,tt,Y,P,Gt,et,q={},Z,j,yt,J;while(!0){if(Y=o[o.length-1],this.defaultActions[Y])P=this.defaultActions[Y];else{if(M===null||typeof M>"u")M=ut();P=w[Y]&&w[Y][M]}if(typeof P>"u"||!P.length||!P[0]){var rt="";J=[];for(Z in w[Y])if(this.terminals_[Z]&&Z>vt)J.push("'"+this.terminals_[Z]+"'");if(v.showPosition)rt="Parse error on line "+(z+1)+`:
1
+ import{e,B,C,S,E,T,A,I,L,s,p}from"./chunk-9dd1c37b.js";import{nn,Br,Xi,Ke}from"./chunk-jvj66qhs.js";import{bt}from"./chunk-5jbf7n5q.js";import{je}from"./chunk-shbw6wg8.js";var nt=function(){var t=e(function(u,n,a,o){for(a=a||{},o=u.length;o--;a[u[o]]=n);return a},"o"),r=[6,8,10,11,12,14,16,17,18],l=[1,9],g=[1,10],i=[1,11],y=[1,12],m=[1,13],c=[1,14],x={trace:e(function(){},"trace"),yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:"error",4:"journey",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",18:"taskName",19:"taskData"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:e(function(n,a,o,d,f,h,w){var _=h.length-1;switch(f){case 1:return h[_-1];case 2:this.$=[];break;case 3:h[_-1].push(h[_]),this.$=h[_-1];break;case 4:case 5:this.$=h[_];break;case 6:case 7:this.$=[];break;case 8:d.setDiagramTitle(h[_].substr(6)),this.$=h[_].substr(6);break;case 9:this.$=h[_].trim(),d.setAccTitle(this.$);break;case 10:case 11:this.$=h[_].trim(),d.setAccDescription(this.$);break;case 12:d.addSection(h[_].substr(8)),this.$=h[_].substr(8);break;case 13:d.addTask(h[_-1],h[_]),this.$="task";break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(r,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:l,12:g,14:i,16:y,17:m,18:c},t(r,[2,7],{1:[2,1]}),t(r,[2,3]),{9:15,11:l,12:g,14:i,16:y,17:m,18:c},t(r,[2,5]),t(r,[2,6]),t(r,[2,8]),{13:[1,16]},{15:[1,17]},t(r,[2,11]),t(r,[2,12]),{19:[1,18]},t(r,[2,4]),t(r,[2,9]),t(r,[2,10]),t(r,[2,13])],defaultActions:{},parseError:e(function(n,a){if(a.recoverable)this.trace(n);else{var o=Error(n);throw o.hash=a,o}},"parseError"),parse:e(function(n){var a=this,o=[0],d=[],f=[null],h=[],w=this.table,_="",z=0,ot=0,ct=0,vt=2,ht=1,wt=h.slice.call(arguments,1),v=Object.create(this.lexer),O={yy:{}};for(var Q in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,Q))O.yy[Q]=this.yy[Q];if(v.setInput(n,O.yy),O.yy.lexer=v,O.yy.parser=this,typeof v.yylloc>"u")v.yylloc={};var D=v.yylloc;h.push(D);var Tt=v.options&&v.options.ranges;if(typeof O.yy.parseError==="function")this.parseError=O.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function St(F){o.length=o.length-2*F,f.length=f.length-F,h.length=h.length-F}e(St,"popStack");function ut(){var F=d.pop()||v.lex()||ht;if(typeof F!=="number"){if(F instanceof Array)d=F,F=d.pop();F=a.symbols_[F]||F}return F}e(ut,"lex");var M,tt,Y,P,Gt,et,q={},Z,j,yt,J;while(!0){if(Y=o[o.length-1],this.defaultActions[Y])P=this.defaultActions[Y];else{if(M===null||typeof M>"u")M=ut();P=w[Y]&&w[Y][M]}if(typeof P>"u"||!P.length||!P[0]){var rt="";J=[];for(Z in w[Y])if(this.terminals_[Z]&&Z>vt)J.push("'"+this.terminals_[Z]+"'");if(v.showPosition)rt="Parse error on line "+(z+1)+`:
2
2
  `+v.showPosition()+`
3
3
  Expecting `+J.join(", ")+", got '"+(this.terminals_[M]||M)+"'";else rt="Parse error on line "+(z+1)+": Unexpected "+(M==ht?"end of input":"'"+(this.terminals_[M]||M)+"'");this.parseError(rt,{text:v.match,token:this.terminals_[M]||M,line:v.yylineno,loc:D,expected:J})}if(P[0]instanceof Array&&P.length>1)throw Error("Parse Error: multiple actions possible at state: "+Y+", token: "+M);switch(P[0]){case 1:if(o.push(M),f.push(v.yytext),h.push(v.yylloc),o.push(P[1]),M=null,!tt){if(ot=v.yyleng,_=v.yytext,z=v.yylineno,D=v.yylloc,ct>0)ct--}else M=tt,tt=null;break;case 2:if(j=this.productions_[P[1]][1],q.$=f[f.length-j],q._$={first_line:h[h.length-(j||1)].first_line,last_line:h[h.length-1].last_line,first_column:h[h.length-(j||1)].first_column,last_column:h[h.length-1].last_column},Tt)q._$.range=[h[h.length-(j||1)].range[0],h[h.length-1].range[1]];if(et=this.performAction.apply(q,[_,ot,z,O.yy,P[1],f,h].concat(wt)),typeof et<"u")return et;if(j)o=o.slice(0,-1*j*2),f=f.slice(0,-1*j),h=h.slice(0,-1*j);o.push(this.productions_[P[1]][0]),f.push(q.$),h.push(q._$),yt=w[o[o.length-2]][o[o.length-1]],o.push(yt);break;case 3:return!0}}return!0},"parse")},k=function(){var u={EOF:1,parseError:e(function(a,o){if(this.yy.parser)this.yy.parser.parseError(a,o);else throw Error(a)},"parseError"),setInput:e(function(n,a){if(this.yy=a||this.yy||{},this._input=n,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];return this.offset=0,this},"setInput"),input:e(function(){var n=this._input[0];this.yytext+=n,this.yyleng++,this.offset++,this.match+=n,this.matched+=n;var a=n.match(/(?:\r\n?|\n).*/g);if(a)this.yylineno++,this.yylloc.last_line++;else this.yylloc.last_column++;if(this.options.ranges)this.yylloc.range[1]++;return this._input=this._input.slice(1),n},"input"),unput:e(function(n){var a=n.length,o=n.split(/(?:\r\n?|\n)/g);this._input=n+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-a),this.offset-=a;var d=this.match.split(/(?:\r\n?|\n)/g);if(this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),o.length-1)this.yylineno-=o.length-1;var f=this.yylloc.range;if(this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:o?(o.length===d.length?this.yylloc.first_column:0)+d[d.length-o.length].length-o[0].length:this.yylloc.first_column-a},this.options.ranges)this.yylloc.range=[f[0],f[0]+this.yyleng-a];return this.yyleng=this.yytext.length,this},"unput"),more:e(function(){return this._more=!0,this},"more"),reject:e(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:e(function(n){this.unput(this.match.slice(n))},"less"),pastInput:e(function(){var n=this.matched.substr(0,this.matched.length-this.match.length);return(n.length>20?"...":"")+n.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:e(function(){var n=this.match;if(n.length<20)n+=this._input.substr(0,20-n.length);return(n.substr(0,20)+(n.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:e(function(){var n=this.pastInput(),a=Array(n.length+1).join("-");return n+this.upcomingInput()+`
@@ -1 +1 @@
1
- import{e}from"./chunk-jtwhjp20.js";var c=1;function i(){if(typeof globalThis>"u")return;return globalThis}e(i,"getCaptureGlobal");function p(){return Boolean(i()?.mermaidCaptureSizes)}e(p,"shouldCaptureSizes");function u(){if(typeof location>"u")return"browser-dev";return`${location.pathname}${location.search}`}e(u,"capturedFromLocation");function d(n,r){let o=i();if(!o)return;let t=r.node(),s=((t&&"ownerSVGElement"in t?t.ownerSVGElement:null)??t)?.id??"(unknown)";o.mermaidCapturedSizes??=[];let a={svgId:s,sizes:n};o.mermaidCapturedSizes.push(a),o.mermaidLastCapturedSizes=a}e(d,"emitCapturedSizes");function m(n,r){let o=[];for(let t of r.nodes){if(t.isGroup)continue;o.push({id:t.id,width:t.width??0,height:t.height??0})}if(o.length===0)return;d({metadata:{captureVersion:c,capturedAt:new Date().toISOString(),capturedFrom:u()},nodes:o},n)}e(m,"captureNodeSizes");export{m as captureNodeSizes};
1
+ import{e}from"./chunk-9dd1c37b.js";var c=1;function i(){if(typeof globalThis>"u")return;return globalThis}e(i,"getCaptureGlobal");function p(){return Boolean(i()?.mermaidCaptureSizes)}e(p,"shouldCaptureSizes");function u(){if(typeof location>"u")return"browser-dev";return`${location.pathname}${location.search}`}e(u,"capturedFromLocation");function d(n,r){let o=i();if(!o)return;let t=r.node(),s=((t&&"ownerSVGElement"in t?t.ownerSVGElement:null)??t)?.id??"(unknown)";o.mermaidCapturedSizes??=[];let a={svgId:s,sizes:n};o.mermaidCapturedSizes.push(a),o.mermaidLastCapturedSizes=a}e(d,"emitCapturedSizes");function m(n,r){let o=[];for(let t of r.nodes){if(t.isGroup)continue;o.push({id:t.id,width:t.width??0,height:t.height??0})}if(o.length===0)return;d({metadata:{captureVersion:c,capturedAt:new Date().toISOString(),capturedFrom:u()},nodes:o},n)}e(m,"captureNodeSizes");export{m as captureNodeSizes};
@@ -1,13 +1,13 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="none">
2
- <title>Basalt</title>
3
- <style>
4
- .a { fill: #2D343A } .b { fill: #4C525A } .c { fill: #22272A }
5
- @media (prefers-color-scheme: dark) { .a { fill: #AAB2B9 } .b { fill: #DFE3E6 } .c { fill: #858E96 } }
6
- </style>
7
- <g transform="translate(-566 -72)">
8
- <path class="a" d="M608 369 641 220Q644 201 661 192L802 124Q819 115 836 124L949 181Q956 184 952 192L897 302Q895 307 890 312L806 387Q802 391 797 394L677 463Q672 467 668 462L618 400Q605 386 608 369Z"/>
9
- <path class="b" d="M967 198Q969 192 975 195L1015 217Q1028 224 1029 239L1031 300Q1031 306 1025 306H922Q914 306 918 298Z"/>
10
- <path class="c" d="M908 321H1028Q1034 321 1034 327L1035 394Q1036 405 1029 414L927 530Q922 536 917 530L822 404Q818 398 824 393L901 324Q904 321 908 321Z"/>
11
- <path class="c" d="M800 410Q805 406 809 411L899 529Q903 536 896 537H748Q729 537 718 524L686 486Q681 479 689 475Z"/>
12
- </g>
13
- </svg>
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="none">
2
+ <title>Basalt</title>
3
+ <style>
4
+ .a { fill: #2D343A } .b { fill: #4C525A } .c { fill: #22272A }
5
+ @media (prefers-color-scheme: dark) { .a { fill: #AAB2B9 } .b { fill: #DFE3E6 } .c { fill: #858E96 } }
6
+ </style>
7
+ <g transform="translate(-566 -72)">
8
+ <path class="a" d="M608 369 641 220Q644 201 661 192L802 124Q819 115 836 124L949 181Q956 184 952 192L897 302Q895 307 890 312L806 387Q802 391 797 394L677 463Q672 467 668 462L618 400Q605 386 608 369Z"/>
9
+ <path class="b" d="M967 198Q969 192 975 195L1015 217Q1028 224 1029 239L1031 300Q1031 306 1025 306H922Q914 306 918 298Z"/>
10
+ <path class="c" d="M908 321H1028Q1034 321 1034 327L1035 394Q1036 405 1029 414L927 530Q922 536 917 530L822 404Q818 398 824 393L901 324Q904 321 908 321Z"/>
11
+ <path class="c" d="M800 410Q805 406 809 411L899 529Q903 536 896 537H748Q729 537 718 524L686 486Q681 479 689 475Z"/>
12
+ </g>
13
+ </svg>
package/web/icon.svg CHANGED
@@ -1,13 +1,13 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="none">
2
- <title>Basalt</title>
3
- <style>
4
- .a { fill: #2D343A } .b { fill: #4C525A } .c { fill: #22272A }
5
- @media (prefers-color-scheme: dark) { .a { fill: #AAB2B9 } .b { fill: #DFE3E6 } .c { fill: #858E96 } }
6
- </style>
7
- <g transform="translate(-566 -72)">
8
- <path class="a" d="M608 369 641 220Q644 201 661 192L802 124Q819 115 836 124L949 181Q956 184 952 192L897 302Q895 307 890 312L806 387Q802 391 797 394L677 463Q672 467 668 462L618 400Q605 386 608 369Z"/>
9
- <path class="b" d="M967 198Q969 192 975 195L1015 217Q1028 224 1029 239L1031 300Q1031 306 1025 306H922Q914 306 918 298Z"/>
10
- <path class="c" d="M908 321H1028Q1034 321 1034 327L1035 394Q1036 405 1029 414L927 530Q922 536 917 530L822 404Q818 398 824 393L901 324Q904 321 908 321Z"/>
11
- <path class="c" d="M800 410Q805 406 809 411L899 529Q903 536 896 537H748Q729 537 718 524L686 486Q681 479 689 475Z"/>
12
- </g>
13
- </svg>
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="none">
2
+ <title>Basalt</title>
3
+ <style>
4
+ .a { fill: #2D343A } .b { fill: #4C525A } .c { fill: #22272A }
5
+ @media (prefers-color-scheme: dark) { .a { fill: #AAB2B9 } .b { fill: #DFE3E6 } .c { fill: #858E96 } }
6
+ </style>
7
+ <g transform="translate(-566 -72)">
8
+ <path class="a" d="M608 369 641 220Q644 201 661 192L802 124Q819 115 836 124L949 181Q956 184 952 192L897 302Q895 307 890 312L806 387Q802 391 797 394L677 463Q672 467 668 462L618 400Q605 386 608 369Z"/>
9
+ <path class="b" d="M967 198Q969 192 975 195L1015 217Q1028 224 1029 239L1031 300Q1031 306 1025 306H922Q914 306 918 298Z"/>
10
+ <path class="c" d="M908 321H1028Q1034 321 1034 327L1035 394Q1036 405 1029 414L927 530Q922 536 917 530L822 404Q818 398 824 393L901 324Q904 321 908 321Z"/>
11
+ <path class="c" d="M800 410Q805 406 809 411L899 529Q903 536 896 537H748Q729 537 718 524L686 486Q681 479 689 475Z"/>
12
+ </g>
13
+ </svg>
package/web/index.html CHANGED
@@ -12,10 +12,10 @@
12
12
  <base href="/" />
13
13
  <title>Basalt</title>
14
14
  <link rel="manifest" href="/manifest.webmanifest" />
15
- <link rel="icon" href="./icon-yx2p2pye.svg" type="image/svg+xml" />
15
+ <link rel="icon" href="./icon-1wgy7kzy.svg" type="image/svg+xml" />
16
16
  <link rel="apple-touch-icon" href="./apple-touch-icon-7dkm33qp.png" />
17
17
 
18
- <link rel="stylesheet" crossorigin href="./chunk-wtawdeej.css"><script type="module" crossorigin src="./chunk-32ezm0ry.js"></script></head>
18
+ <link rel="stylesheet" crossorigin href="./chunk-fekjj24p.css"><script type="module" crossorigin src="./chunk-aqm3spxt.js"></script></head>
19
19
  <body>
20
20
  <div id="root"></div>
21
21
 
package/web/install.sh CHANGED
File without changes
package/web/sw.js CHANGED
@@ -41,6 +41,15 @@ self.addEventListener("fetch", (event) => {
41
41
  try {
42
42
  const response = await fetch(request)
43
43
  if (response.ok) {
44
+ const copy = response.clone()
45
+ const html = await copy.text().catch(() => "")
46
+ // 检测到服务端处于 Bun 开发态(含 HMR 脚本标记)时,清理缓存并自卸载,交还给开发服务器直出
47
+ if (html.includes("data-bun-dev-server-script")) {
48
+ const keys = await caches.keys()
49
+ await Promise.all(keys.map((key) => caches.delete(key)))
50
+ await self.registration.unregister()
51
+ return response
52
+ }
44
53
  const cache = await caches.open(CACHE_NAME)
45
54
  void cache.put("/", response.clone())
46
55
  }
package/worker.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{$e,Tt,Kr,Ht,Si,Ho,Go}from"./chunk-x9982ek7.js";var S="backfill";function c(t){return t.query("SELECT sum((SELECT max(seq) FROM store.entries WHERE session_id = sessions.id)) AS n FROM store.sessions").get()?.n??0}function k(t){let e=Kr(t,S);return e?JSON.parse(e):void 0}function y(t,e){Ht(t,S,JSON.stringify(e))}class b{db;indexer;batch;todo;page;state;constructor(t,e,s=500){this.db=t;this.indexer=e;this.batch=s;this.todo=t.query("SELECT session_id FROM main.backfill_todo WHERE ord = ?"),this.page=t.query("SELECT seq, time, body FROM store.entries WHERE session_id = ? AND seq > ? ORDER BY seq LIMIT ?"),this.state=k(t)}get running(){return this.state?.state==="running"}begin(t){this.db.transaction(()=>{let e=this.db.query("SELECT max(id) AS id FROM store.search_queue").get()?.id??0;Ht(this.db,"queue_done",e),this.db.run("DELETE FROM main.backfill_todo"),this.db.run("INSERT INTO main.backfill_todo (ord, session_id) SELECT row_number() OVER (ORDER BY updated DESC, id), id FROM store.sessions");let s=this.db.query("SELECT count(*) AS n FROM main.backfill_todo").get()?.n??0,r=c(this.db);this.state={state:s?"running":"done",reason:t,ord:1,seq:-1,total:r,sessionsTotal:s,done:0,sessionsDone:0,startedAt:Date.now()},y(this.db,this.state)})()}step(t){let e=this.state;if(e?.state!=="running")return!1;let s={...e};return this.db.transaction(()=>{let r=this.batch;while(r>0&&s.state==="running"){let n=this.todo.get(s.ord)?.session_id;if(n===void 0){s.state="done",this.db.run("DELETE FROM main.backfill_todo");break}if(s.seq<0)this.indexer.reindex(n,0),s.seq=0;let a=this.page.all(n,s.seq,r);for(let i of a)if(this.indexer.indexRow(n,i.seq,i.time,i.body),s.seq=i.seq,s.done++,r--,performance.now()>t){r=0;break}if(r>0)s.ord++,s.seq=-1,s.sessionsDone++;if(performance.now()>t)break}y(this.db,s)})(),this.state=s,!0}}var T=2000,M=30000;class E{options;db;layout;reset;indexer;backfill;terms;queueRows;queueMax;sliceMs;backfillSliceMs;queueBatch;termRefreshMs;queueDone;termCursor;termStale;lastTermRefresh=Number.NEGATIVE_INFINITY;rateStart;estimate;closed=!1;constructor(t){this.options=t;let e=Si(t.indexPath,t.storePath,t.features);if(this.db=e.db,this.layout=e.layout,this.reset=e.reset,this.sliceMs=t.sliceMs??20,this.backfillSliceMs=t.backfillSliceMs??200,this.queueBatch=t.queueBatch??200,this.termRefreshMs=t.termRefreshMs??60000,this.indexer=new Ho(this.db,this.layout),this.terms=new Go(this.db),this.backfill=new b(this.db,this.indexer,t.batch??500),this.queueRows=this.db.query("SELECT id, session_id, seq FROM store.search_queue WHERE id > ? ORDER BY id LIMIT ?"),this.queueMax=this.db.query("SELECT max(id) AS id FROM store.search_queue"),!this.backfill.state)this.backfill.begin(this.reset?"rebuild":"initial");this.queueDone=Number(Kr(this.db,"queue_done")??0),this.termStale=Number(Kr(this.db,"term_stale")??0)===1}step(t){if(this.closed)return!1;if(this.drainQueue(t??performance.now()+this.sliceMs))return!0;if(this.backfill.running){this.rateStart??={time:performance.now(),done:this.backfill.state?.done??0};let e=this.indexer.outChanges;if(this.backfill.step(t??performance.now()+this.backfillSliceMs),this.markTerms(e),!this.backfill.running)this.lastTermRefresh=Number.NEGATIVE_INFINITY;return!0}return this.refreshTerms(t??performance.now()+this.sliceMs)}drain(){while(this.step());}drainQueue(t){let e=!1;return this.db.transaction(()=>{let s=this.queueRows.all(this.queueDone,this.queueBatch);if(!s.length)return;e=!0;let r=this.indexer.outChanges,n=new Set,a=this.queueDone;for(let i of s){let h=`${i.seq}\x00${i.session_id}`;if(!n.has(h))n.add(h),this.indexer.reindex(i.session_id,i.seq);if(a=i.id,performance.now()>t)break}Ht(this.db,"queue_done",a),this.markTerms(r),this.queueDone=a})(),e}markTerms(t){if(this.indexer.outChanges===t||this.termStale)return;this.termStale=!0,Ht(this.db,"term_stale",1)}refreshTerms(t){if(this.termCursor===void 0){if(!this.termStale||performance.now()-this.lastTermRefresh<this.termRefreshMs)return!1;this.termCursor="",this.termStale=!1,this.indexer.outChanges=0,Ht(this.db,"term_stale",0)}while(this.termCursor!==void 0&&performance.now()<=t){let e=this.termCursor;this.db.transaction(()=>{this.termCursor=this.terms.step(e,T)})()}if(this.termCursor===void 0)this.lastTermRefresh=performance.now();return!0}status(){let t=this.queueMax.get()?.id??this.queueDone,e=this.backfill.state,s;if(e?.state==="running"&&this.rateStart){let n=(performance.now()-this.rateStart.time)/1000,a=(e.done-this.rateStart.done)/n;if(n>0.5&&a>0)s=Math.max(0,Math.round(Math.max(0,e.total-e.done)/a))}let r=e?{state:e.state,reason:e.reason,total:e.total,done:e.done,sessionsTotal:e.sessionsTotal,sessionsDone:e.sessionsDone,startedAt:e.startedAt}:void 0;if(!this.estimate||performance.now()-this.estimate.time>M)this.estimate={time:performance.now(),entries:c(this.db)};return{queueDone:this.queueDone,lag:Math.max(0,t-this.queueDone),entries:this.estimate.entries,...r?{backfill:r}:{},...s!==void 0?{etaSec:s}:{},layout:this.layout,reset:this.reset}}withIndex(t){return t(this.db)}close(){if(this.closed)return;this.closed=!0,this.db.close()}}var g=1000,x=100;function R(t){let e,s,r,n=!1,a=!1,i=0,h=[],l=(u)=>t.postMessage(u),d=(u)=>{if(a)return;if(r)clearTimeout(r);r=setTimeout(q,u)},p=()=>{if(!s||Atomics.load(s,$e)!==1)return;Atomics.store(s,Tt,1),Atomics.notify(s,Tt);while(Atomics.load(s,$e)===1)Atomics.wait(s,$e,1,1e4);Atomics.store(s,Tt,0)};function q(){if(r=void 0,a||!e)return;p();let u=!1;try{u=e.step()}catch(f){l({type:"error",message:f instanceof Error?f.message:String(f),fatal:!1}),n=!1,d(g);return}let o=performance.now();if(u){if(n=!0,o-i>=x)i=o,l({type:"status",status:e.status()});d(0);return}n=!1,i=o;let m=e.status();l({type:"status",status:m});for(let f of h.splice(0))l({type:"flushed",id:f,status:m});d(g)}t.onmessage=(u)=>{let o=u.data;if(o.type==="init"){s=new Int32Array(o.flags);try{e=new E(o.options)}catch(m){l({type:"error",message:m instanceof Error?m.message:String(m),fatal:!0});return}l({type:"status",status:e.status()}),d(0)}else if(o.type==="dirty"){if(!n)d(0)}else if(o.type==="pause")p();else if(o.type==="flush"){if(h.push(o.id),!n)d(0)}else if(o.type==="stop"){if(a=!0,r)clearTimeout(r);e?.close(),l({type:"stopped"})}}}if(!Bun.isMainThread)R(globalThis);export{E as SearchEngine};
2
+ import{$e,Tt,Kr,Ht,vi,Go,zo}from"./chunk-k23t7vhs.js";var S="backfill";function c(t){return t.query("SELECT sum((SELECT max(seq) FROM store.entries WHERE session_id = sessions.id)) AS n FROM store.sessions").get()?.n??0}function k(t){let e=Kr(t,S);return e?JSON.parse(e):void 0}function y(t,e){Ht(t,S,JSON.stringify(e))}class b{db;indexer;batch;todo;page;state;constructor(t,e,s=500){this.db=t;this.indexer=e;this.batch=s;this.todo=t.query("SELECT session_id FROM main.backfill_todo WHERE ord = ?"),this.page=t.query("SELECT seq, time, body FROM store.entries WHERE session_id = ? AND seq > ? ORDER BY seq LIMIT ?"),this.state=k(t)}get running(){return this.state?.state==="running"}begin(t){this.db.transaction(()=>{let e=this.db.query("SELECT max(id) AS id FROM store.search_queue").get()?.id??0;Ht(this.db,"queue_done",e),this.db.run("DELETE FROM main.backfill_todo"),this.db.run("INSERT INTO main.backfill_todo (ord, session_id) SELECT row_number() OVER (ORDER BY updated DESC, id), id FROM store.sessions");let s=this.db.query("SELECT count(*) AS n FROM main.backfill_todo").get()?.n??0,r=c(this.db);this.state={state:s?"running":"done",reason:t,ord:1,seq:-1,total:r,sessionsTotal:s,done:0,sessionsDone:0,startedAt:Date.now()},y(this.db,this.state)})()}step(t){let e=this.state;if(e?.state!=="running")return!1;let s={...e};return this.db.transaction(()=>{let r=this.batch;while(r>0&&s.state==="running"){let n=this.todo.get(s.ord)?.session_id;if(n===void 0){s.state="done",this.db.run("DELETE FROM main.backfill_todo");break}if(s.seq<0)this.indexer.reindex(n,0),s.seq=0;let a=this.page.all(n,s.seq,r);for(let i of a)if(this.indexer.indexRow(n,i.seq,i.time,i.body),s.seq=i.seq,s.done++,r--,performance.now()>t){r=0;break}if(r>0)s.ord++,s.seq=-1,s.sessionsDone++;if(performance.now()>t)break}y(this.db,s)})(),this.state=s,!0}}var T=2000,M=30000;class E{options;db;layout;reset;indexer;backfill;terms;queueRows;queueMax;sliceMs;backfillSliceMs;queueBatch;termRefreshMs;queueDone;termCursor;termStale;lastTermRefresh=Number.NEGATIVE_INFINITY;rateStart;estimate;closed=!1;constructor(t){this.options=t;let e=vi(t.indexPath,t.storePath,t.features);if(this.db=e.db,this.layout=e.layout,this.reset=e.reset,this.sliceMs=t.sliceMs??20,this.backfillSliceMs=t.backfillSliceMs??200,this.queueBatch=t.queueBatch??200,this.termRefreshMs=t.termRefreshMs??60000,this.indexer=new Go(this.db,this.layout),this.terms=new zo(this.db),this.backfill=new b(this.db,this.indexer,t.batch??500),this.queueRows=this.db.query("SELECT id, session_id, seq FROM store.search_queue WHERE id > ? ORDER BY id LIMIT ?"),this.queueMax=this.db.query("SELECT max(id) AS id FROM store.search_queue"),!this.backfill.state)this.backfill.begin(this.reset?"rebuild":"initial");this.queueDone=Number(Kr(this.db,"queue_done")??0),this.termStale=Number(Kr(this.db,"term_stale")??0)===1}step(t){if(this.closed)return!1;if(this.drainQueue(t??performance.now()+this.sliceMs))return!0;if(this.backfill.running){this.rateStart??={time:performance.now(),done:this.backfill.state?.done??0};let e=this.indexer.outChanges;if(this.backfill.step(t??performance.now()+this.backfillSliceMs),this.markTerms(e),!this.backfill.running)this.lastTermRefresh=Number.NEGATIVE_INFINITY;return!0}return this.refreshTerms(t??performance.now()+this.sliceMs)}drain(){while(this.step());}drainQueue(t){let e=!1;return this.db.transaction(()=>{let s=this.queueRows.all(this.queueDone,this.queueBatch);if(!s.length)return;e=!0;let r=this.indexer.outChanges,n=new Set,a=this.queueDone;for(let i of s){let h=`${i.seq}\x00${i.session_id}`;if(!n.has(h))n.add(h),this.indexer.reindex(i.session_id,i.seq);if(a=i.id,performance.now()>t)break}Ht(this.db,"queue_done",a),this.markTerms(r),this.queueDone=a})(),e}markTerms(t){if(this.indexer.outChanges===t||this.termStale)return;this.termStale=!0,Ht(this.db,"term_stale",1)}refreshTerms(t){if(this.termCursor===void 0){if(!this.termStale||performance.now()-this.lastTermRefresh<this.termRefreshMs)return!1;this.termCursor="",this.termStale=!1,this.indexer.outChanges=0,Ht(this.db,"term_stale",0)}while(this.termCursor!==void 0&&performance.now()<=t){let e=this.termCursor;this.db.transaction(()=>{this.termCursor=this.terms.step(e,T)})()}if(this.termCursor===void 0)this.lastTermRefresh=performance.now();return!0}status(){let t=this.queueMax.get()?.id??this.queueDone,e=this.backfill.state,s;if(e?.state==="running"&&this.rateStart){let n=(performance.now()-this.rateStart.time)/1000,a=(e.done-this.rateStart.done)/n;if(n>0.5&&a>0)s=Math.max(0,Math.round(Math.max(0,e.total-e.done)/a))}let r=e?{state:e.state,reason:e.reason,total:e.total,done:e.done,sessionsTotal:e.sessionsTotal,sessionsDone:e.sessionsDone,startedAt:e.startedAt}:void 0;if(!this.estimate||performance.now()-this.estimate.time>M)this.estimate={time:performance.now(),entries:c(this.db)};return{queueDone:this.queueDone,lag:Math.max(0,t-this.queueDone),entries:this.estimate.entries,...r?{backfill:r}:{},...s!==void 0?{etaSec:s}:{},layout:this.layout,reset:this.reset}}withIndex(t){return t(this.db)}close(){if(this.closed)return;this.closed=!0,this.db.close()}}var g=1000,x=100;function R(t){let e,s,r,n=!1,a=!1,i=0,h=[],l=(u)=>t.postMessage(u),d=(u)=>{if(a)return;if(r)clearTimeout(r);r=setTimeout(q,u)},p=()=>{if(!s||Atomics.load(s,$e)!==1)return;Atomics.store(s,Tt,1),Atomics.notify(s,Tt);while(Atomics.load(s,$e)===1)Atomics.wait(s,$e,1,1e4);Atomics.store(s,Tt,0)};function q(){if(r=void 0,a||!e)return;p();let u=!1;try{u=e.step()}catch(f){l({type:"error",message:f instanceof Error?f.message:String(f),fatal:!1}),n=!1,d(g);return}let o=performance.now();if(u){if(n=!0,o-i>=x)i=o,l({type:"status",status:e.status()});d(0);return}n=!1,i=o;let m=e.status();l({type:"status",status:m});for(let f of h.splice(0))l({type:"flushed",id:f,status:m});d(g)}t.onmessage=(u)=>{let o=u.data;if(o.type==="init"){s=new Int32Array(o.flags);try{e=new E(o.options)}catch(m){l({type:"error",message:m instanceof Error?m.message:String(m),fatal:!0});return}l({type:"status",status:e.status()}),d(0)}else if(o.type==="dirty"){if(!n)d(0)}else if(o.type==="pause")p();else if(o.type==="flush"){if(h.push(o.id),!n)d(0)}else if(o.type==="stop"){if(a=!0,r)clearTimeout(r);e?.close(),l({type:"stopped"})}}}if(!Bun.isMainThread)R(globalThis);export{E as SearchEngine};
package/chunk-1fv27j4b.js DELETED
@@ -1,3 +0,0 @@
1
- // @bun
2
- import{f}from"./chunk-7yw8aa5j.js";import{_}from"./chunk-hat3s3pr.js";import"./chunk-c25s4w6a.js";import{st,Xe,at}from"./chunk-g2k3yhgh.js";import{He}from"./chunk-ve7qx8wm.js";import{At,Et}from"./chunk-r9aatvwm.js";import{q,j}from"./chunk-y69ewdn2.js";import{Ee,ct,V,ee}from"./chunk-rjdhaasf.js";import{ie}from"./chunk-d48bfd2e.js";import{z}from"./chunk-dakrpbe6.js";import{te,ge,ye,H}from"./chunk-sf13azm4.js";import{M}from"./chunk-0rya8cxe.js";var P=new Set(["openai","openai-codex","opencode"]),O=16,E="https://chatgpt.com/settings/usage";function I(e,s){return e.provider==="openai"&&e.baseUrl==="https://api.openai.com/v1"&&s!==void 0&&!s.startsWith("sk-")}function T(e,s){if(!e)return!1;let r=s.toLowerCase();for(let[t,i]of Object.entries(e))if(t.toLowerCase()===r&&i!==null&&i.trim().length>0)return!0;return!1}function v(e,s,r){if(s)return s;if(T(r,"authorization")||T(r,"cf-aig-authorization"))return"unused";throw Error(`No API key for provider: ${e}`)}function w(e){return e.provider==="openrouter"||e.baseUrl.includes("openrouter.ai")?"openrouter":"openai"}function R(e,s){if(e)return e;if(_("PI_CACHE_RETENTION",s)==="long")return"long";return"short"}function m(e){return{supportsDeveloperRole:e.compat?.supportsDeveloperRole??!0,supportsMidConvoSystemMessages:e.compat?.supportsMidConvoSystemMessages??!1,sessionAffinityFormat:e.compat?.sessionAffinityFormat??w(e),supportsLongCacheRetention:e.compat?.supportsLongCacheRetention??!0,supportsStrictMode:e.compat?.supportsStrictMode??!1,supportsOpenAIGrammarTools:e.compat?.supportsOpenAIGrammarTools??!1,supportsAdditionalTools:e.compat?.supportsAdditionalTools??!1,supportsToolSearch:e.compat?.supportsToolSearch??!1,supportsExplicitPromptCacheMode:e.compat?.supportsExplicitPromptCacheMode??!1,supportsMaxOutputTokens:e.compat?.supportsMaxOutputTokens??!0}}function x(e,s){return s==="long"&&e.supportsLongCacheRetention&&!e.supportsExplicitPromptCacheMode?"24h":void 0}function b(e,s){if(!e.supportsExplicitPromptCacheMode)return;if(s==="none")return{mode:"explicit"};if(s==="long"&&e.supportsLongCacheRetention)return{ttl:"30m"};return}var k=(e,s,r)=>{let t=new M,i=te(s,m(e).supportsMidConvoSystemMessages);return(async()=>{let o={role:"assistant",content:[],api:e.api,provider:e.provider,model:e.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:"pending",timestamp:Date.now()};try{let c=v(e.provider,r?.apiKey,r?.headers),p=R(r?.cacheRetention,r?.env)==="none"?void 0:r?.sessionId,n=m(e),u=Ee(ge(i.messages),n.supportsOpenAIGrammarTools),d=L(e,i,c,r?.headers,r?.fetch,p),l=G(e,i,r,n,u),g=await r?.onPayload?.(l,e);if(g!==void 0)l=g;let y={...r?.signal?{signal:r.signal}:{},...r?.timeoutMs!==void 0?{timeout:r.timeoutMs}:{},maxRetries:0},{data:S,response:h}=await ie(()=>d.responses.create(l,y).withResponse(),{maxRetries:r?.maxRetries,maxRetryDelayMs:r?.maxRetryDelayMs,signal:r?.signal});if(await r?.onResponse?.({status:h.status,headers:z(h.headers)},e),t.push({type:"start",partial:o}),await at(S,o,t,e,{onProviderStreamEvent:r?.onProviderStreamEvent,serviceTier:r?.serviceTier,grammarToolInputProperties:u,applyServiceTierPricing:(C,A)=>D(C,A,e)}),r?.signal?.aborted)throw Error("Request was aborted");if(o.stopReason==="pending")throw Error("OpenAI Responses stream ended without a stop reason");if(o.stopReason==="aborted"||o.stopReason==="error")throw Error(o.errorMessage||"An unknown error occurred");t.push({type:"done",reason:o.stopReason,message:o}),t.end()}catch(c){for(let p of o.content)delete p.index,delete p.partialJson,delete p.customInput;o.stopReason=r?.signal?.aborted?"aborted":"error";let a=j(q(c),`${e.provider==="openai"?"OpenAI":e.provider} API error`);o.errorMessage=a.includes("subscription_sharing_usage_limit_exceeded")?`${a}
3
- Check your ChatGPT usage: ${E}`:a,t.push({type:"error",reason:o.stopReason,error:o}),t.end()}})(),t},ae=(e,s,r)=>{v(e.provider,r?.apiKey,r?.headers);let t={...V(e,s,r,r?.apiKey),toolChoice:r?.toolChoice},i=r?.reasoning?H(e,r.reasoning):void 0;return k(e,s,{...t,reasoningEffort:i==="off"?void 0:i})};function L(e,s,r,t,i,o){let c=m(e),a={"User-Agent":ee(),...e.headers};if(e.provider==="github-copilot"){let p=At(s.messages),n=Et({messages:s.messages,hasImages:p});Object.assign(a,n)}if(o)if(c.sessionAffinityFormat==="openrouter")a["x-session-id"]=o;else{if(c.sessionAffinityFormat==="openai")a.session_id=o;a["x-client-request-id"]=o}if(t)Object.assign(a,t);return new f({apiKey:r,baseURL:e.baseUrl,dangerouslyAllowBrowser:!0,fetch:i,defaultHeaders:a})}function G(e,s,r,t=m(e),i=Ee(ge(s.messages),t.supportsOpenAIGrammarTools)){let o=ye(s.messages,t.supportsAdditionalTools||t.supportsToolSearch),c=st(e,s,P,{grammarToolInputProperties:i,supportsMidConvoSystemMessages:t.supportsMidConvoSystemMessages,supportsAdditionalTools:t.supportsAdditionalTools,supportsToolSearch:t.supportsToolSearch,toolOptions:{supportsStrictMode:t.supportsStrictMode,supportsOpenAIGrammarTools:t.supportsOpenAIGrammarTools}}),a=R(r?.cacheRetention,r?.env),p=I(e,r?.apiKey),n={model:e.id,input:c,stream:!0,prompt_cache_key:a==="none"?void 0:He(r?.sessionId),prompt_cache_retention:p?void 0:x(t,a),prompt_cache_options:p?void 0:b(t,a),store:!1};if(r?.maxTokens&&t.supportsMaxOutputTokens&&!p)n.max_output_tokens=Math.max(r.maxTokens,O);if(r?.temperature!==void 0&&!p)n.temperature=r?.temperature;if(r?.serviceTier!==void 0)n.service_tier=r.serviceTier;if(o.requestTools.length>0)n.tools=Xe(o.requestTools,{supportsStrictMode:t.supportsStrictMode,supportsOpenAIGrammarTools:t.supportsOpenAIGrammarTools});if(r?.toolChoice!==void 0)n.tool_choice=r.toolChoice;let u=r?.reasoningEffort??(r?.reasoningSummary?"medium":void 0);if(e.reasoning){if(u){let l=r?.reasoningEffort?e.thinkingLevelMap?.[r.reasoningEffort]??r.reasoningEffort:u;n.reasoning={effort:l,summary:r?.reasoningSummary||"auto"},n.include=["reasoning.encrypted_content"]}else if(e.provider!=="github-copilot"&&e.thinkingLevelMap?.off!==null)n.reasoning={effort:e.thinkingLevelMap?.off??"none"};if(e.provider==="xai")n.include=["reasoning.encrypted_content"]}let d=ct(e,u??"off",r?.samplingParams);if(d)Object.assign(n,d);return n}function U(e,s){switch(s){case"flex":return 0.5;case"priority":case"fast":return e.id==="gpt-5.5"?2.5:2;default:return 1}}function D(e,s,r){let t=U(r,s);if(t===1)return;e.cost.input*=t,e.cost.output*=t,e.cost.cacheRead*=t,e.cost.cacheWrite*=t,e.cost.total=e.cost.input+e.cost.output+e.cost.cacheRead+e.cost.cacheWrite}export{k as stream,ae as streamSimple};
package/chunk-356q8e0y.js DELETED
@@ -1,10 +0,0 @@
1
- // @bun
2
- import"./chunk-hat3s3pr.js";import"./chunk-c25s4w6a.js";import{xr}from"./chunk-v9fea96h.js";import{st,Xe,at}from"./chunk-g2k3yhgh.js";import{He}from"./chunk-ve7qx8wm.js";import{Er}from"./chunk-bj14jshr.js";import{q,j}from"./chunk-y69ewdn2.js";import{Ee,V,ee}from"./chunk-rjdhaasf.js";import{z}from"./chunk-dakrpbe6.js";import{$n,Gr}from"./chunk-9y69ywyg.js";import{N,ht,ue,te,ge,ye,H}from"./chunk-sf13azm4.js";import{M,Ve,qt,Te}from"./chunk-0rya8cxe.js";var ve="https://chatgpt.com/backend-api",Re="https://api.openai.com/auth",Ce=0,re=1000,xe=60000,Oe=15000,Ae=3,fe=new Set(["openai","openai-codex","opencode"]),Me=1009,We="websocket_connection_limit_reached",Le="previous_response_not_found",De=new Set(["completed","incomplete","failed","cancelled","queued","in_progress"]);function ne(e){if(e.stopReason==="pending")throw Error("Codex stream ended without a stop reason");if(e.stopReason==="error"||e.stopReason==="aborted")throw Error(e.errorMessage||"An unknown error occurred")}function Ne(e){return/GoUsageLimitError|FreeUsageLimitError|Monthly usage limit reached|available balance|insufficient_quota|out of budget|quota exceeded|billing/i.test(e)}function qe(e,r){if(e===429&&Ne(r))return!1;if(e===429||e===500||e===502||e===503||e===504)return!0;return/rate.?limit|overloaded|service.?unavailable|upstream.?connect|connection.?refused/i.test(r)}function Be(e){let r=e.get("retry-after-ms");if(r!==null){let s=Number(r);if(Number.isFinite(s))return Math.max(0,s)}let t=e.get("retry-after");if(!t)return;let n=Number(t);if(Number.isFinite(n))return Math.max(0,n*1000);let o=Date.parse(t);if(!Number.isNaN(o))return Math.max(0,o-Date.now());return}class Y extends Error{}function Pe(e,r){let t=r?.maxRetryDelayMs??xe;if(t>0&&e>t)throw new Y(`Server requested ${Math.ceil(e/1000)}s retry delay (max: ${Math.ceil(t/1000)}s)`);return e}function se(e,r){return new Promise((t,n)=>{if(r?.aborted){n(Error("Request was aborted"));return}let o=setTimeout(t,e);r?.addEventListener("abort",()=>{clearTimeout(o),n(Error("Request was aborted"))})})}function oe(e){if(e===void 0)return;if(!Number.isFinite(e)||e<0)throw Error(`Invalid timeoutMs: ${String(e)}`);return Math.floor(e)}function Ie(){if(typeof process>"u"||!(process.versions?.node||process.versions?.bun))return null;return process.getBuiltinModule?.("node:zlib")??null}function Fe(e){let r=Ie();if(!r||typeof r.zstdCompressSync!=="function")return null;try{let t=r.zstdCompressSync(e,{params:{[r.constants.ZSTD_c_compressionLevel]:Ae}});return new Uint8Array(t)}catch{return null}}var Ue=(e,r,t)=>{let n=new M,o=te(r,e.compat?.supportsMidConvoSystemMessages);return(async()=>{let s={role:"assistant",content:[],api:"openai-codex-responses",provider:e.provider,model:e.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:"pending",timestamp:Date.now()};try{let i=t?.apiKey;if(!i)throw Error(`No API key for provider: ${e.provider}`);let u=_t(i),a=Ee(ge(o.messages),e.compat?.supportsOpenAIGrammarTools??!1),d=t?.cacheRetention==="none"?void 0:t?.sessionId,p=He(d),c=$e(e,o,t,p,a),l=await t?.onPayload?.(c,e);if(l!==void 0)c=l;let f=p||Gr(),m=kt(e.headers,t?.headers,u,i,p),b=Tt(e.headers,t?.headers,u,i,f),h=JSON.stringify(c),E=oe(t?.timeoutMs),w=oe(t?.websocketConnectTimeoutMs),v=t?.transport||"auto",T=!1,y=v!=="sse"&&be(d);if(y)ie(d);if(v!=="sse"&&!y){let S=!1,k=!1,O=!1;while(!0){S=!1;try{if(await St(Je(e.baseUrl),c,b,s,n,e,()=>{if(S=!0,!T)T=!0,n.push({type:"start",partial:s})},E,w,d,u,a,t),t?.signal?.aborted)throw Error("Request was aborted");ne(s),n.push({type:"done",reason:s.stopReason,message:s}),n.end();return}catch(R){let B=t?.signal?.aborted,P=!S&&je(R),W=Ye(R);if(!B&&W&&!O){O=!0;continue}if(!B&&P&&!k){k=!0;continue}if(B||Ge(R)&&!P)throw R;if(Te(s,qt("provider_transport_failure",R,{configuredTransport:v,...S?{}:{fallbackTransport:"sse"},eventsEmitted:S,phase:S?"after_message_stream_start":"before_message_stream_start",requestBytes:new TextEncoder().encode(h).byteLength})),it(d,R),S)throw R;ie(d);break}}}let x=Fe(h);if(x)m.set("content-encoding","zstd");let A=x??h,_,D,K=t?.maxRetries??Ce;for(let S=0;S<=K;S++){if(t?.signal?.aborted)throw Error("Request was aborted");try{let k=E!==void 0&&E>0?AbortSignal.timeout(E):void 0,O=xr([t?.signal,k]);try{_=await(t?.fetch??globalThis.fetch)(pe(e.baseUrl),{method:"POST",headers:m,body:A,signal:O.signal})}catch(W){if(k?.aborted&&!t?.signal?.aborted)throw Error(`Codex SSE response headers timed out after ${E}ms`);throw W}finally{O.cleanup()}if(await t?.onResponse?.({status:_.status,headers:z(_.headers)},e),_.ok)break;let R=await _.text();if(S<K&&qe(_.status,R)){let W=Be(_.headers),ke=W===void 0?re*2**S:Pe(W,t);await se(ke,t?.signal);continue}let B=new Response(R,{status:_.status,statusText:_.statusText}),P=await Et(B);throw Error(P.friendlyMessage||P.message)}catch(k){if(k instanceof Error){if(k.name==="AbortError"||k.message==="Request was aborted")throw Error("Request was aborted")}if(D=k instanceof Error?k:Error(String(k)),S<K&&!(D instanceof Y)&&!D.message.includes("usage limit")){let O=re*2**S;await se(O,t?.signal);continue}throw D}}if(!_?.ok)throw D??Error("Failed after retries");if(!_.body)throw Error("No response body");if(!T)T=!0,n.push({type:"start",partial:s});if(await Ke(_,s,n,e,a,t),t?.signal?.aborted)throw Error("Request was aborted");ne(s),n.push({type:"done",reason:s.stopReason,message:s}),n.end()}catch(i){for(let u of s.content)delete u.partialJson,delete u.customInput;s.stopReason=t?.signal?.aborted?"aborted":"error",s.errorMessage=j(q(i)),n.push({type:"error",reason:s.stopReason,error:s}),n.end()}})(),n},$t=(e,r,t)=>{let n=t?.apiKey;if(!n)throw Error(`No API key for provider: ${e.provider}`);let o={...V(e,r,t,n),toolChoice:t?.toolChoice},s=t?.reasoning?H(e,t.reasoning):void 0;return Ue(e,r,{...o,reasoningEffort:s==="off"?void 0:s})};function $e(e,r,t,n,o=Ee(ge(r.messages),e.compat?.supportsOpenAIGrammarTools??!1)){let s=e.compat?.supportsStrictMode??!0,i=e.compat?.supportsOpenAIGrammarTools??!1,u=e.compat?.supportsAdditionalTools??!1,a=e.compat?.supportsToolSearch??!1,d=ye(r.messages,u||a),p=st(e,r,fe,{includeSystemPrompt:!1,grammarToolInputProperties:o,supportsMidConvoSystemMessages:e.compat?.supportsMidConvoSystemMessages??!1,supportsAdditionalTools:u,supportsToolSearch:a,toolOptions:{strict:null,supportsStrictMode:s,supportsOpenAIGrammarTools:i}}),c=ue(r.messages),l=c?N(c):"",f={model:e.id,store:!1,stream:!0,instructions:l||"You are a helpful assistant.",input:p,text:{verbosity:t?.textVerbosity||"low"},include:["reasoning.encrypted_content"],prompt_cache_key:n,tool_choice:t?.toolChoice??"auto",parallel_tool_calls:!0};if(t?.temperature!==void 0)f.temperature=t.temperature;if(t?.serviceTier!==void 0)f.service_tier=t.serviceTier;if(d.requestTools.length>0)f.tools=Xe(d.requestTools,{strict:null,supportsStrictMode:s,supportsOpenAIGrammarTools:i});if(t?.reasoningEffort!==void 0){let m=t.reasoningEffort==="none"?e.thinkingLevelMap?.off===void 0?"none":e.thinkingLevelMap.off:e.thinkingLevelMap?.[t.reasoningEffort]??t.reasoningEffort;if(m!==null)f.reasoning={effort:m,summary:t.reasoningSummary??"auto"}}else if(e.reasoning&&e.thinkingLevelMap?.off!==null)f.reasoning={effort:e.thinkingLevelMap?.off??"none"};return f}function ze(e,r){switch(r){case"flex":return 0.5;case"priority":return e.id==="gpt-5.5"?2.5:2;default:return 1}}function le(e,r,t){let n=ze(t,r);if(n===1)return;e.cost.input*=n,e.cost.output*=n,e.cost.cacheRead*=n,e.cost.cacheWrite*=n,e.cost.total=e.cost.input+e.cost.output+e.cost.cacheRead+e.cost.cacheWrite}function de(e,r){if(e==="default"&&(r==="flex"||r==="priority"))return r;return e??r}function pe(e){let t=(e&&e.trim().length>0?e:ve).replace(/\/+$/,"");if(t.endsWith("/codex/responses"))return t;if(t.endsWith("/codex"))return`${t}/responses`;return`${t}/codex/responses`}function Je(e){let r=new URL(pe(e));if(r.protocol==="https:")r.protocol="wss:";if(r.protocol==="http:")r.protocol="ws:";return r.toString()}async function Ke(e,r,t,n,o,s){await at(me(et(e,s?.signal),r,n,s?.onProviderStreamEvent),r,t,n,{serviceTier:s?.serviceTier,grammarToolInputProperties:o,resolveServiceTier:de,applyServiceTierPricing:(i,u)=>le(i,u,n)})}class L extends Error{code;payload;constructor(e,r){super(e);this.name="CodexApiError",this.code=r?.code,this.payload=r?.payload,this.cause=r?.cause}}class J extends Error{payload;constructor(e,r){super(e);this.name="CodexProtocolError",this.payload=r?.payload,this.cause=r?.cause}}class Z extends Error{constructor(e){super(Ve(e));this.name="ProviderStreamEventCallbackError",this.cause=e}}function Ge(e){return e instanceof L||e instanceof J||e instanceof Z}function je(e){return e instanceof L&&e.code===We}function Ye(e){return e instanceof L&&e.code===Le}function Ze(e){let r=e.error&&typeof e.error==="object"?e.error:void 0;return{code:typeof e.code==="string"?e.code:typeof r?.code==="string"?r.code:void 0,message:typeof e.message==="string"?e.message:typeof r?.message==="string"?r.message:void 0}}async function*me(e,r,t,n){for await(let o of e){try{await n?.(o,t)}catch(i){throw new Z(i)}let s=typeof o.type==="string"?o.type:void 0;if(!s)continue;if(s==="error"){let{code:i,message:u}=Ze(o);throw new L(`Codex error: ${u||i||JSON.stringify(o)}`,{code:i,payload:o})}if(s==="response.failed"){let i=o.response,u=i?.error?.code,a=i?.error?.message;throw new L(a||"Codex response failed",{code:u,payload:o})}if(s==="response.done"||s==="response.completed"||s==="response.incomplete"){let i=o.response;if(typeof i?.end_turn==="boolean")r.endTurn=i.end_turn;let u=i?{...i,status:Qe(i.status)}:i;yield{...o,type:"response.completed",response:u};return}yield o}}function Qe(e){if(typeof e!=="string")return;return De.has(e)?e:void 0}async function*et(e,r){if(!e.body)return;let t=e.body.getReader(),n=new TextDecoder,o="",s=()=>{t.cancel().catch(()=>{})};r?.addEventListener("abort",s,{once:!0});try{while(!0){if(r?.aborted)throw Error("Request was aborted");let{done:i,value:u}=await t.read();if(r?.aborted)throw Error("Request was aborted");if(o+=i?n.decode():n.decode(u,{stream:!0}),i&&o.trim())o+=`
3
-
4
- `;let a=o.indexOf(`
5
-
6
- `);while(a!==-1){let d=o.slice(0,a);o=o.slice(a+2);let p=d.split(`
7
- `).filter((c)=>c.startsWith("data:")).map((c)=>c.slice(5).trim());if(p.length>0){let c=p.join(`
8
- `).trim();if(c&&c!=="[DONE]")try{yield JSON.parse(c)}catch(l){throw new J(`Invalid Codex SSE JSON: ${Ve(l)}`,{cause:l,payload:c})}}a=o.indexOf(`
9
-
10
- `)}if(i)break}}finally{r?.removeEventListener("abort",s);try{await t.cancel()}catch{}try{t.releaseLock()}catch{}}}var tt="responses_websockets=2026-02-06",rt=300000,nt=3300000,g=new Map,I=new Map,U=new Set;function Q(e){let r=I.get(e);if(!r)r={requests:0,connectionsCreated:0,connectionsReused:0,cachedContextRequests:0,storeTrueRequests:0,fullContextRequests:0,deltaRequests:0,lastInputItems:0,websocketFailures:0,sseFallbacks:0},I.set(e,r);return r}function zt(e){let r=I.get(e);return r?{...r}:void 0}function Jt(e){if(e){I.delete(e),U.delete(e);return}I.clear(),U.clear()}function ot(e){let r=(t)=>{if(t.idleTimer)clearTimeout(t.idleTimer);C(t.socket,1000,"debug_close")};if(e){for(let t of g.get(e)?.values()??[])r(t);g.delete(e);return}for(let t of g.values())for(let n of t.values())r(n);g.clear()}$n(ot);function be(e){return e?U.has(e):!1}function ie(e){if(!e)return;let r=Q(e);r.sseFallbacks++,r.websocketFallbackActive=be(e)}function it(e,r){if(!e)return;U.add(e);let t=Q(e);t.websocketFailures++,t.lastWebSocketError=Ve(r),t.websocketFallbackActive=!0}var G=null;async function ct(e){if(!e&&G)return G;if(typeof process<"u"&&process.versions?.bun){let t=class extends WebSocket{constructor(n,o){let s={};if(Array.isArray(o)||typeof o==="string")s={protocols:o};else s={...o};let i=Er(n.toString().replace(/^wss:/,"https:").replace(/^ws:/,"http:"),e);super(n,{...s,...i?{proxy:i.toString()}:{}})}};if(!e)G=t;return t}let r=globalThis.WebSocket;if(typeof r!=="function")return null;return r}class he extends Error{code;reason;wasClean;constructor(e,r){super(e);this.name="WebSocketCloseError",this.code=r?.code,this.reason=r?.reason,this.wasClean=r?.wasClean}}function ut(e){let r=e.readyState;return typeof r==="number"?r:void 0}function F(e){let r=ut(e);return r===void 0||r===1}function ft(e){return Date.now()-e.createdAt>=nt}function C(e,r=1000,t="done"){try{e.close(r,t)}catch{}}function ae(e,r,t){if(t.idleTimer)clearTimeout(t.idleTimer);t.idleTimer=setTimeout(()=>{if(t.busy)return;C(t.socket,1000,"idle_timeout");let n=g.get(e);if(n?.get(r)===t)n.delete(r);if(n?.size===0)g.delete(e)},rt)}async function X(e,r,t,n=Oe,o){let s=await ct(o);if(!s)throw Error("WebSocket transport is not available in this runtime");let i=z(r);return delete i["OpenAI-Beta"],new Promise((u,a)=>{let d=!1,p,c;try{c=new s(e,{headers:i})}catch(w){a(w instanceof Error?w:Error(String(w)));return}let l=()=>{if(p)clearTimeout(p),p=void 0;c.removeEventListener("open",m),c.removeEventListener("error",b),c.removeEventListener("close",h),t?.removeEventListener("abort",E)},f=(w,v)=>{if(d)return;if(d=!0,l(),v)C(c,1000,v);a(w)},m=()=>{if(d)return;d=!0,l(),u(c)},b=(w)=>{f(we(w))},h=(w)=>{f(Se(w))},E=()=>{f(Error("Request was aborted"),"aborted")};if(c.addEventListener("open",m),c.addEventListener("error",b),c.addEventListener("close",h),t?.addEventListener("abort",E),n>0)p=setTimeout(()=>{f(Error(`WebSocket connect timeout after ${n}ms`),"connect_timeout")},n);if(t?.aborted)E()})}async function lt(e,r,t,n,o,s,i){if(!t){let c=await X(e,r,o,s,i);return{socket:c,reused:!1,release:()=>C(c)}}let u=g.get(t),a=u?.get(n);if(a){if(a.idleTimer)clearTimeout(a.idleTimer),a.idleTimer=void 0;if(!a.busy&&ft(a)){if(C(a.socket,1000,"connection_age_limit"),u?.delete(n),u?.size===0)g.delete(t)}else if(!a.busy&&F(a.socket))return a.busy=!0,{socket:a.socket,entry:a,reused:!0,release:({keep:c}={})=>{if(!c||!F(a.socket)){C(a.socket);let l=g.get(t);if(l?.get(n)===a)l.delete(n);if(l?.size===0)g.delete(t);return}a.busy=!1,ae(t,n,a)}};if(a.busy){let c=await X(e,r,o,s,i);return{socket:c,reused:!1,release:()=>{C(c)}}}if(!F(a.socket)){if(C(a.socket),u?.delete(n),u?.size===0)g.delete(t)}}let d=await X(e,r,o,s,i),p={socket:d,busy:!0,createdAt:Date.now()};if(u=g.get(t),!u)u=new Map,g.set(t,u);return u.set(n,p),{socket:d,entry:p,reused:!1,release:({keep:c}={})=>{if(!c||!F(p.socket)){if(C(p.socket),p.idleTimer)clearTimeout(p.idleTimer);let l=g.get(t);if(l?.get(n)===p)l.delete(n);if(l?.size===0)g.delete(t);return}p.busy=!1,ae(t,n,p)}}}function we(e){if(e&&typeof e==="object"){let r="message"in e?e.message:void 0;if(typeof r==="string"&&r.length>0)return Error(r);let t="error"in e?e.error:void 0;if(t instanceof Error&&t.message.length>0)return t;if(t&&typeof t==="object"&&"message"in t){let n=t.message;if(typeof n==="string"&&n.length>0)return Error(n)}}return Error("WebSocket error")}function Se(e){if(e&&typeof e==="object"){let r="code"in e?e.code:void 0,t="reason"in e?e.reason:void 0,n="wasClean"in e?e.wasClean:void 0,o=typeof r==="number"?` ${r}`:"",s=typeof t==="string"&&t.length>0?` ${t}`:"";if(!s&&r===Me)s=" message too big";return new he(`WebSocket closed${o}${s}`.trim(),{code:typeof r==="number"?r:void 0,reason:typeof t==="string"&&t.length>0?t:void 0,wasClean:typeof n==="boolean"?n:void 0})}return Error("WebSocket closed")}async function dt(e){if(typeof e==="string")return e;if(e instanceof ArrayBuffer)return new TextDecoder().decode(new Uint8Array(e));if(ArrayBuffer.isView(e)){let r=e;return new TextDecoder().decode(new Uint8Array(r.buffer,r.byteOffset,r.byteLength))}if(e&&typeof e==="object"&&"arrayBuffer"in e){let t=await e.arrayBuffer();return new TextDecoder().decode(new Uint8Array(t))}return null}async function*pt(e,r,t){let n=[],o=null,s=!1,i=null,u=!1,a=()=>{if(!o)return;let f=o;o=null,f()},d=(f)=>{(async()=>{let m=null;try{if(!f||typeof f!=="object"||!("data"in f))return;if(m=await dt(f.data),!m)return;let b=JSON.parse(m),h=typeof b.type==="string"?b.type:"";if(h==="response.completed"||h==="response.done"||h==="response.incomplete")u=!0,s=!0;n.push(b),a()}catch(b){i=new J(`Invalid Codex WebSocket JSON: ${Ve(b)}`,{cause:b,payload:m}),s=!0,a()}})()},p=(f)=>{i=we(f),s=!0,a()},c=(f)=>{if(u){s=!0,a();return}if(!i)i=Se(f);s=!0,a()},l=()=>{i=Error("Request was aborted"),s=!0,a()};e.addEventListener("message",d),e.addEventListener("error",p),e.addEventListener("close",c),r?.addEventListener("abort",l);try{while(!0){if(r?.aborted)throw Error("Request was aborted");if(n.length>0){yield n.shift();continue}if(s)break;let f;await new Promise((m,b)=>{if(o=m,t!==void 0&&t>0)f=setTimeout(()=>{let h=Error(`WebSocket idle timeout after ${t}ms`);i=h,s=!0,o=null,C(e,1000,"idle_timeout"),b(h)},t)}).finally(()=>{if(f)clearTimeout(f)})}if(i)throw i;if(!u)throw Error("WebSocket stream closed before response.completed")}finally{e.removeEventListener("message",d),e.removeEventListener("error",p),e.removeEventListener("close",c),r?.removeEventListener("abort",l)}}function ce(e){let{input:r,previous_response_id:t,...n}=e;return n}function mt(e,r){return JSON.stringify(e??[])===JSON.stringify(r??[])}function yt(e,r){return JSON.stringify(ce(e))===JSON.stringify(ce(r))}function bt(e,r){if(!yt(e,r.lastRequestBody))return;let t=e.input??[],n=[...r.lastRequestBody.input??[],...r.lastResponseItems];if(t.length<n.length)return;let o=t.slice(0,n.length);if(!mt(o,n))return;return t.slice(n.length)}function wt(e,r){let t=e.continuation;if(!t)return r;let n=bt(r,t);if(!n||!t.lastResponseId)return e.continuation=void 0,r;return{...r,previous_response_id:t.lastResponseId,input:n}}async function*gt(e,r){let t=!1;for await(let n of e){if(!t)t=!0,r();yield n}}async function St(e,r,t,n,o,s,i,u,a,d,p,c,l){let{socket:f,entry:m,reused:b,release:h}=await lt(e,t,d,p,l?.signal,a,l?.env),E=!0,w=l?.transport==="websocket-cached"||l?.transport==="auto",v=r,T=w&&m?wt(m,v):v,y=d?Q(d):void 0;if(y){if(y.requests++,b)y.connectionsReused++;else y.connectionsCreated++;if(w)y.cachedContextRequests++;if(T.store===!0)y.storeTrueRequests++;if(y.lastInputItems=T.input?.length??0,T.previous_response_id)y.deltaRequests++,y.lastDeltaInputItems=T.input?.length??0,y.lastPreviousResponseId=T.previous_response_id;else y.fullContextRequests++,y.lastDeltaInputItems=void 0,y.lastPreviousResponseId=void 0}try{if(f.send(JSON.stringify({type:"response.create",...T})),await at(gt(me(pt(f,l?.signal,u),n,s,l?.onProviderStreamEvent),i),n,o,s,{serviceTier:l?.serviceTier,grammarToolInputProperties:c,resolveServiceTier:de,applyServiceTierPricing:(x,A)=>le(x,A,s)}),l?.signal?.aborted)E=!1;else if(w&&m&&n.responseId){let x=st(s,ht({messages:[n]}),fe,{includeSystemPrompt:!1,grammarToolInputProperties:c}).filter((A)=>A.type!=="function_call_output"&&A.type!=="custom_tool_call_output");m.continuation={lastRequestBody:v,lastResponseId:n.responseId,lastResponseItems:x}}}catch(x){if(m)m.continuation=void 0;throw E=!1,x}finally{h({keep:E})}}async function Et(e){let r=await e.text(),t=r||e.statusText||"Request failed",n;try{let s=JSON.parse(r)?.error;if(s){let i=s.code||s.type||"";if(/usage_limit_reached|usage_not_included|rate_limit_exceeded/i.test(i)||e.status===429){let u=s.plan_type?` (${s.plan_type.toLowerCase()} plan)`:"",a=s.resets_at?Math.max(0,Math.round((s.resets_at*1000-Date.now())/60000)):void 0,d=a!==void 0?` Try again in ~${a} min.`:"";n=`You have hit your ChatGPT usage limit${u}.${d}`.trim()}t=s.message||n||t}}catch{}return{message:t,friendlyMessage:n}}function _t(e){try{let r=e.split(".");if(r.length!==3)throw Error("Invalid token");let n=JSON.parse(atob(r[1]))?.[Re]?.chatgpt_account_id;if(!n)throw Error("No account ID in token");return n}catch{throw Error("Failed to extract accountId from token")}}function _e(e,r,t,n){let o=new Headers({originator:"pi","User-Agent":ee()});for(let[s,i]of Object.entries(e||{}))o.set(s,i);for(let[s,i]of Object.entries(r||{}))if(i===null)o.delete(s);else o.set(s,i);return o.set("Authorization",`Bearer ${n}`),o.set("chatgpt-account-id",t),o}function kt(e,r,t,n,o){let s=_e(e,r,t,n);if(s.set("OpenAI-Beta","responses=experimental"),s.set("accept","text/event-stream"),s.set("content-type","application/json"),o)s.set("session-id",o),s.set("x-client-request-id",o);return s}function Tt(e,r,t,n,o){let s=_e(e,r,t,n);return s.delete("accept"),s.delete("content-type"),s.delete("OpenAI-Beta"),s.delete("openai-beta"),s.set("OpenAI-Beta",tt),s.set("x-client-request-id",o),s.set("session-id",o),s}export{ot as closeOpenAICodexWebSocketSessions,zt as getOpenAICodexWebSocketDebugStats,Jt as resetOpenAICodexWebSocketDebugStats,Ue as stream,$t as streamSimple};
package/chunk-58vz2qsq.js DELETED
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Nr,Dr,Rn}from"./chunk-hcn9cf6v.js";export{Nr as ENV_KEY,Dr as ENV_SECRET,Rn as fromEnv};