@kabmo-labs/kabmo 0.34.0 → 0.35.0

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 (205) hide show
  1. package/dist/client/index.html +1 -1
  2. package/dist/client/index.js +1 -1
  3. package/dist/client/static/js/{CsvGrid-vze4m5ag.js → CsvGrid-0amzgtd7.js} +2 -2
  4. package/dist/client/static/js/{DocxView-jbf21gmh.js → DocxView-bxjhzxe9.js} +3 -3
  5. package/dist/client/static/js/{DrawioView-b52qybx5.js → DrawioView-7s1yqsf4.js} +2 -2
  6. package/dist/client/static/js/{ImageView-mdgzj8px.js → ImageView-ycfbn66h.js} +1 -1
  7. package/dist/client/static/js/{LayoutWrapper-3c49dvtt.js → LayoutWrapper-tw1q1x0g.js} +2 -2
  8. package/dist/client/static/js/{Modal-sqp864vd.js → Modal-wqjactyd.js} +16 -16
  9. package/dist/client/static/js/{PdfView-g06rxqb1.js → PdfView-x6dmtwvr.js} +1 -1
  10. package/dist/client/static/js/{SessionsView-521adxyr.js → SessionsView-t85wq0me.js} +1 -1
  11. package/dist/client/static/js/{SheetView-h8xmsz7q.js → SheetView-n52nvz8s.js} +13 -13
  12. package/dist/client/static/js/{SvgPreview-1j4jvcvz.js → SvgPreview-59z7syme.js} +1 -1
  13. package/dist/client/static/js/{abnfDiagram-O67JEVCF-pasxh4b6.js → abnfDiagram-O67JEVCF-91gnt049.js} +1 -1
  14. package/dist/client/static/js/architecture-7GRP2DOG-bajpnvy7.js +1 -0
  15. package/dist/client/static/js/{architectureDiagram-NJMV4G6O-ms14g0bm.js → architectureDiagram-NJMV4G6O-5b9qtff2.js} +3 -3
  16. package/dist/client/static/js/{astro-80bs6hvg.js → astro-31cbyw7b.js} +1 -1
  17. package/dist/client/static/js/bash-0h36tk0k.js +1 -0
  18. package/dist/client/static/js/{blockDiagram-BEXU5L5S-ycn78fcq.js → blockDiagram-BEXU5L5S-6f23fjkn.js} +3 -3
  19. package/dist/client/static/js/{c4Diagram-YGBWAQC7-vn2gpjfm.js → c4Diagram-YGBWAQC7-76t6d3am.js} +2 -2
  20. package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-fyrm1pr5.js → classDiagram-v2-NBCMYWYE-f9tb19xm.js} +3 -3
  21. package/dist/client/static/js/{cose-bilkent-JH36ORCC-ea5nwvgq.js → cose-bilkent-JH36ORCC-t6nwrbwj.js} +1 -1
  22. package/dist/client/static/js/cpp-4wp9sy20.js +1 -0
  23. package/dist/client/static/js/css-c9nsbkh6.js +1 -0
  24. package/dist/client/static/js/cynefin-OW5HDTMX-8q9e90m8.js +1 -0
  25. package/dist/client/static/js/{cynefinDiagram-VND7K2PF-j6bsjpre.js → cynefinDiagram-VND7K2PF-69gc244j.js} +1 -1
  26. package/dist/client/static/js/{dagre-6A5THRUB-4smdkwv8.js → dagre-6A5THRUB-54bry3ey.js} +2 -2
  27. package/dist/client/static/js/{diagram-22UHCM2B-9sm4kqwc.js → diagram-22UHCM2B-gfkebye6.js} +5 -5
  28. package/dist/client/static/js/{diagram-3UASUU5V-2h3qxaed.js → diagram-3UASUU5V-a1mr319f.js} +1 -1
  29. package/dist/client/static/js/{diagram-ATOU4E4O-1981bc94.js → diagram-ATOU4E4O-tkyk0qbe.js} +3 -3
  30. package/dist/client/static/js/{diagram-CDSNMT55-3vgsxavc.js → diagram-CDSNMT55-np0hc9m2.js} +2 -2
  31. package/dist/client/static/js/{diagram-MLGK6HIB-c9gf2r3f.js → diagram-MLGK6HIB-nh06fshp.js} +1 -1
  32. package/dist/client/static/js/{diagram-MPIPVDR6-gjqeq92d.js → diagram-MPIPVDR6-27q2veks.js} +1 -1
  33. package/dist/client/static/js/{dockerfile-8v935dkn.js → dockerfile-4rtt6c0f.js} +1 -1
  34. package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-4vbsgh99.js → ebnfDiagram-ZINNZB2B-x9p9jqe8.js} +1 -1
  35. package/dist/client/static/js/{elixir-vcbg60wv.js → elixir-rpa1g4gy.js} +1 -1
  36. package/dist/client/static/js/{elk-276RUBZZ-nca3t891.js → elk-276RUBZZ-fw7waks3.js} +1 -1
  37. package/dist/client/static/js/{erDiagram-OPXOYQCR-5kfkev03.js → erDiagram-OPXOYQCR-fdfgzr5d.js} +5 -5
  38. package/dist/client/static/js/{erlang-qt876zrq.js → erlang-trjm07as.js} +1 -1
  39. package/dist/client/static/js/eventmodeling-NTZA5JFV-kn4hsm3p.js +1 -0
  40. package/dist/client/static/js/flowDiagram-KWPJA3E3-ah8cvps1.js +1 -0
  41. package/dist/client/static/js/{ganttDiagram-FUAMR5RP-mxc73wmq.js → ganttDiagram-FUAMR5RP-2avbqgdr.js} +2 -2
  42. package/dist/client/static/js/gitGraph-4MIJSDKK-hvavh16n.js +1 -0
  43. package/dist/client/static/js/{gitGraphDiagram-X574FWY7-7en3ag0e.js → gitGraphDiagram-X574FWY7-9jmc0a3g.js} +2 -2
  44. package/dist/client/static/js/graphql-hbkmxsty.js +1 -0
  45. package/dist/client/static/js/html-pv88ny12.js +1 -0
  46. package/dist/client/static/js/{index-4g46wbdw.js → index-0v34a7wf.js} +1 -1
  47. package/dist/client/static/js/{index-vtbbfwx0.js → index-1wjp16f0.js} +2 -2
  48. package/dist/client/static/js/{index-7a64yjrm.js → index-2v1nmxwr.js} +5 -5
  49. package/dist/client/static/js/{index-rs80cwsv.js → index-3ecsp1rx.js} +3 -3
  50. package/dist/client/static/js/{index-1y9r4frb.js → index-43qpbxjv.js} +2 -2
  51. package/dist/client/static/js/{index-ag2rmtas.js → index-4vybd9e7.js} +1 -1
  52. package/dist/client/static/js/{index-ahv9y42z.js → index-6f6cmcbq.js} +2 -2
  53. package/dist/client/static/js/{index-vy6termr.js → index-7ct7qrsp.js} +2 -2
  54. package/dist/client/static/js/{index-fvmfge3p.js → index-7q02xnvq.js} +1 -1
  55. package/dist/client/static/js/{index-rytaa8ca.js → index-7smwzkvq.js} +2 -2
  56. package/dist/client/static/js/{index-nccwxv0s.js → index-8f9x7ev8.js} +1 -1
  57. package/dist/client/static/js/{index-7y6rpsrp.js → index-8mwragbj.js} +2 -2
  58. package/dist/client/static/js/{index-52rqxgya.js → index-8x9ecxb0.js} +1 -1
  59. package/dist/client/static/js/{index-ptcrwswj.js → index-9ketbkh6.js} +1 -1
  60. package/dist/client/static/js/{index-s7gkkkyz.js → index-a293pdg7.js} +2 -2
  61. package/dist/client/static/js/{index-vhqe0y82.js → index-a628fg4m.js} +2 -2
  62. package/dist/client/static/js/{index-c3ek61zv.js → index-a8ffattk.js} +2 -2
  63. package/dist/client/static/js/{index-a0fmsv1d.js → index-b8s3xraa.js} +6 -6
  64. package/dist/client/static/js/index-btr2w8cq.js +12 -0
  65. package/dist/client/static/js/index-dfzrpy54.js +2 -0
  66. package/dist/client/static/js/{index-g2dyfze9.js → index-ee2p07eg.js} +1 -1
  67. package/dist/client/static/js/{index-ybm2x4vh.js → index-ek2e773p.js} +1 -1
  68. package/dist/client/static/js/{index-4qwzxj81.js → index-fvc0x6nx.js} +3 -3
  69. package/dist/client/static/js/{index-3zc1b0dv.js → index-jc1yagmk.js} +2 -2
  70. package/dist/client/static/js/{index-p0nz38bm.js → index-jmxqefe3.js} +1 -1
  71. package/dist/client/static/js/{index-1ksg88qf.js → index-k7q01ye4.js} +2 -2
  72. package/dist/client/static/js/{index-r014brzs.js → index-kdkfyrja.js} +2 -2
  73. package/dist/client/static/js/{index-0vm41je9.js → index-mc4nefs7.js} +1 -1
  74. package/dist/client/static/js/{index-j51d5a5m.js → index-nb8tp4mj.js} +30 -30
  75. package/dist/client/static/js/{index-cgzrpvzj.js → index-ncrenheb.js} +172 -172
  76. package/dist/client/static/js/{index-f7jhhqtk.js → index-p16scjt7.js} +2 -2
  77. package/dist/client/static/js/{index-pm6xxwz1.js → index-pc6eg8h2.js} +2 -2
  78. package/dist/client/static/js/{index-zvfvqvn9.js → index-pnt0vc59.js} +2 -2
  79. package/dist/client/static/js/{index-jsyekbx9.js → index-py2k8std.js} +2 -2
  80. package/dist/client/static/js/{index-dbe6afkf.js → index-pzbssnsc.js} +2 -2
  81. package/dist/client/static/js/{index-qckv9nte.js → index-qqz6bcdd.js} +2 -2
  82. package/dist/client/static/js/{index-xx6mqpxm.js → index-rbgemjsp.js} +3 -3
  83. package/dist/client/static/js/{index-rzxcj7cg.js → index-rkn0bxxt.js} +1 -1
  84. package/dist/client/static/js/{index-76zb4m0n.js → index-rv89xpaf.js} +2 -2
  85. package/dist/client/static/js/index-sbd5e816.js +1 -0
  86. package/dist/client/static/js/{index-1b0t1428.js → index-sdby39w4.js} +3 -3
  87. package/dist/client/static/js/{index-ev3yt353.js → index-t6c0pd43.js} +2 -2
  88. package/dist/client/static/js/{index-km2zb6wk.js → index-tp7yb3bv.js} +2 -2
  89. package/dist/client/static/js/{index-fta1y9pc.js → index-vnw3hbeg.js} +27 -27
  90. package/dist/client/static/js/{index-354mqqra.js → index-vq6wts05.js} +2 -2
  91. package/dist/client/static/js/{index-ptcwae2n.js → index-w5373tg1.js} +2 -2
  92. package/dist/client/static/js/{index-cd65zqba.js → index-w7tpgt46.js} +1 -1
  93. package/dist/client/static/js/{index-b29afsjh.js → index-whbtxmwh.js} +2 -2
  94. package/dist/client/static/js/{index-2svnq5gg.js → index-xs1m0bpt.js} +1 -1
  95. package/dist/client/static/js/{index-eyfcm0cy.js → index-xxtsm2rb.js} +2 -2
  96. package/dist/client/static/js/{index-hf52f59k.js → index-y3ms153k.js} +2 -2
  97. package/dist/client/static/js/{index-sd66wv26.js → index-yq39qbs1.js} +2 -2
  98. package/dist/client/static/js/{index-j0r5hj0j.js → index-zh2jj56s.js} +2 -2
  99. package/dist/client/static/js/info-A6RAGUB7-fmjz8qwg.js +1 -0
  100. package/dist/client/static/js/{infoDiagram-VRGFBTTK-sef80132.js → infoDiagram-VRGFBTTK-g2dky5xg.js} +1 -1
  101. package/dist/client/static/js/ini-72yrpvd4.js +1 -0
  102. package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-yhvepp1q.js → ishikawaDiagram-OU5B5YK6-exrcjwp1.js} +2 -2
  103. package/dist/client/static/js/java-ab5tb2ra.js +1 -0
  104. package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-5w77y95w.js → journeyDiagram-ZHPQQLJL-pn752qa5.js} +3 -3
  105. package/dist/client/static/js/jsx-25zj9j3k.js +1 -0
  106. package/dist/client/static/js/{julia-d4j6wgvf.js → julia-evn99h2m.js} +1 -1
  107. package/dist/client/static/js/{kanban-definition-PNTS6WVX-02znqtna.js → kanban-definition-PNTS6WVX-v8nvr373.js} +2 -2
  108. package/dist/client/static/js/lua-j5w0c9wm.js +1 -0
  109. package/dist/client/static/js/markdown-j6hn4377.js +1 -0
  110. package/dist/client/static/js/{mermaid.core-a6e6vck4.js → mermaid.core-egzv89zv.js} +6 -6
  111. package/dist/client/static/js/{mindmap-definition-NLK3R4M7-y4n74q9x.js → mindmap-definition-NLK3R4M7-t9njmv2w.js} +2 -2
  112. package/dist/client/static/js/one-dark-pro-bm3r4js7.js +1 -0
  113. package/dist/client/static/js/one-light-e07dt7sy.js +1 -0
  114. package/dist/client/static/js/packet-AYTQ26CC-cwr6n1cm.js +1 -0
  115. package/dist/client/static/js/{pegDiagram-GJSIUBJH-pr7ehgzb.js → pegDiagram-GJSIUBJH-zhycy2b7.js} +1 -1
  116. package/dist/client/static/js/{perl-srptw5vm.js → perl-506fy8m8.js} +1 -1
  117. package/dist/client/static/js/{php-n89g3fk7.js → php-axtsvxck.js} +1 -1
  118. package/dist/client/static/js/pie-WAS4IAKB-h1ebfzgt.js +1 -0
  119. package/dist/client/static/js/{pieDiagram-5QR66LMP-39wpsk08.js → pieDiagram-5QR66LMP-sgctvma2.js} +2 -2
  120. package/dist/client/static/js/properties-q8njes42.js +1 -0
  121. package/dist/client/static/js/python-vqxc7181.js +1 -0
  122. package/dist/client/static/js/{quadrantDiagram-O4NWA36T-esm913km.js → quadrantDiagram-O4NWA36T-kzzhdcph.js} +1 -1
  123. package/dist/client/static/js/r-0k5eej8m.js +1 -0
  124. package/dist/client/static/js/radar-RG4KPBEZ-k7p1m364.js +1 -0
  125. package/dist/client/static/js/railroad-74A4TZTK-d08dw3t0.js +1 -0
  126. package/dist/client/static/js/railroad-abnf-HS5TGJTU-txnjycgk.js +1 -0
  127. package/dist/client/static/js/railroad-ebnf-LZEXJU2U-p0r3cv6w.js +1 -0
  128. package/dist/client/static/js/railroad-peg-WCYAUIDC-sryk900a.js +1 -0
  129. package/dist/client/static/js/{railroadDiagram-XR7U4H2S-wy2mgya6.js → railroadDiagram-XR7U4H2S-nzjffwxm.js} +1 -1
  130. package/dist/client/static/js/{requirementDiagram-PLB6GJNP-6z9xdgbq.js → requirementDiagram-PLB6GJNP-tz4xxn4d.js} +1 -1
  131. package/dist/client/static/js/{ruby-r81ytgcm.js → ruby-qp7zfk2m.js} +1 -1
  132. package/dist/client/static/js/{rust-frn3szvc.js → rust-fz913fvw.js} +1 -1
  133. package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-rtmxk3ys.js → sankeyDiagram-IPEJSGJF-2wcb0xr6.js} +2 -2
  134. package/dist/client/static/js/{sass-9bxped7y.js → sass-gnk9vsyp.js} +1 -1
  135. package/dist/client/static/js/{sequenceDiagram-PO4LG4MO-awzcrafg.js → sequenceDiagram-PO4LG4MO-vqgebfns.js} +5 -5
  136. package/dist/client/static/js/{sizeCapture-INFHLROL-03gy196j.js → sizeCapture-INFHLROL-xc314tes.js} +1 -1
  137. package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-an8v3q5n.js → stateDiagram-v2-GCMORJYK-8bd9b1h8.js} +2 -2
  138. package/dist/client/static/js/{svelte-mwtx07d9.js → svelte-brpgzrtv.js} +1 -1
  139. package/dist/client/static/js/{swimlanes-2SLR337P-n9yb4wcs.js → swimlanes-2SLR337P-t6hbdzcw.js} +1 -1
  140. package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-c1czc7kv.js +8 -0
  141. package/dist/client/static/js/{timeline-definition-EJHVYXUP-jceb575g.js → timeline-definition-EJHVYXUP-2txxasx5.js} +2 -2
  142. package/dist/client/static/js/treeView-Q6P3EWNA-77kj68p1.js +1 -0
  143. package/dist/client/static/js/treemap-WGGIJYW6-rw94xc82.js +1 -0
  144. package/dist/client/static/js/tsx-yd5wt250.js +1 -0
  145. package/dist/client/static/js/typescript-v7z7crfe.js +1 -0
  146. package/dist/client/static/js/{usecaseDiagram-POWQR4AR-888h3100.js → usecaseDiagram-POWQR4AR-3x353hn4.js} +5 -5
  147. package/dist/client/static/js/{vennDiagram-UO4OBE2U-wbfz0rzv.js → vennDiagram-UO4OBE2U-cerpss8e.js} +1 -1
  148. package/dist/client/static/js/{vue-c0rtg1wf.js → vue-apnkw9qy.js} +1 -1
  149. package/dist/client/static/js/wardley-WFR3VGLG-18xe4fhz.js +1 -0
  150. package/dist/client/static/js/{wardleyDiagram-VNRHLVJA-rn8c5qf9.js → wardleyDiagram-VNRHLVJA-cx6jfsbf.js} +1 -1
  151. package/dist/client/static/js/xml-94fhzrfs.js +1 -0
  152. package/dist/client/static/js/{xychartDiagram-PMCCYNJV-8sn1apt6.js → xychartDiagram-PMCCYNJV-tgn23xj1.js} +2 -2
  153. package/dist/client/static/js/yaml-s8af9rnw.js +1 -0
  154. package/package.json +1 -1
  155. package/src/client/components/settings/categories/connect-settings/PairDialog.test.tsx +159 -0
  156. package/src/client/components/settings/categories/connect-settings/PairDialog.tsx +36 -7
  157. package/src/client/components/settings/categories/connect-settings/QrCode.tsx +2 -19
  158. package/src/client/components/settings/categories/connect-settings/qr-image.ts +76 -0
  159. package/src/client/components/workspace/git-panel/init-state.test.ts +5 -0
  160. package/src/client/hooks/chat/composer/speech-to-text.ts +24 -17
  161. package/src/client/hooks/editor/file-actions.ts +3 -11
  162. package/src/client/hooks/editor/font.test.ts +2 -1
  163. package/src/client/hooks/editor/use-file-transfer.ts +2 -1
  164. package/src/client/lib/browser/download.ts +22 -0
  165. package/src/shared/lib/dictation/capture-failure.test.ts +46 -0
  166. package/src/shared/lib/dictation/capture-failure.ts +36 -0
  167. package/dist/client/static/js/architecture-7GRP2DOG-fc9kmq1w.js +0 -1
  168. package/dist/client/static/js/bash-b3rwyg5p.js +0 -1
  169. package/dist/client/static/js/cpp-y0t6mynx.js +0 -1
  170. package/dist/client/static/js/css-6vj0d308.js +0 -1
  171. package/dist/client/static/js/cynefin-OW5HDTMX-a4t8992q.js +0 -1
  172. package/dist/client/static/js/eventmodeling-NTZA5JFV-18bdrkv5.js +0 -1
  173. package/dist/client/static/js/flowDiagram-KWPJA3E3-fg0yqx0h.js +0 -1
  174. package/dist/client/static/js/gitGraph-4MIJSDKK-8fa6y40p.js +0 -1
  175. package/dist/client/static/js/graphql-n43pd5fs.js +0 -1
  176. package/dist/client/static/js/html-dbrwss36.js +0 -1
  177. package/dist/client/static/js/index-231241f4.js +0 -12
  178. package/dist/client/static/js/index-6sf2vsp2.js +0 -1
  179. package/dist/client/static/js/index-h5bn97p6.js +0 -2
  180. package/dist/client/static/js/info-A6RAGUB7-3hk844f7.js +0 -1
  181. package/dist/client/static/js/ini-j5dyq6gm.js +0 -1
  182. package/dist/client/static/js/java-g4dgwbfd.js +0 -1
  183. package/dist/client/static/js/jsx-7t5ecz9s.js +0 -1
  184. package/dist/client/static/js/lua-1g6w30de.js +0 -1
  185. package/dist/client/static/js/markdown-afx21x8c.js +0 -1
  186. package/dist/client/static/js/one-dark-pro-vwhfpzr8.js +0 -1
  187. package/dist/client/static/js/one-light-y5t9x6zh.js +0 -1
  188. package/dist/client/static/js/packet-AYTQ26CC-4nj2yy10.js +0 -1
  189. package/dist/client/static/js/pie-WAS4IAKB-k7rde3f9.js +0 -1
  190. package/dist/client/static/js/properties-thd83wey.js +0 -1
  191. package/dist/client/static/js/python-264ns4xw.js +0 -1
  192. package/dist/client/static/js/r-qw82kkv9.js +0 -1
  193. package/dist/client/static/js/radar-RG4KPBEZ-513dpw4f.js +0 -1
  194. package/dist/client/static/js/railroad-74A4TZTK-9bqnst9c.js +0 -1
  195. package/dist/client/static/js/railroad-abnf-HS5TGJTU-7367d5bv.js +0 -1
  196. package/dist/client/static/js/railroad-ebnf-LZEXJU2U-b806b1mj.js +0 -1
  197. package/dist/client/static/js/railroad-peg-WCYAUIDC-5a67rwf8.js +0 -1
  198. package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-nx5nfnf0.js +0 -8
  199. package/dist/client/static/js/treeView-Q6P3EWNA-kcy40evb.js +0 -1
  200. package/dist/client/static/js/treemap-WGGIJYW6-fsrvqxf4.js +0 -1
  201. package/dist/client/static/js/tsx-nm94hed6.js +0 -1
  202. package/dist/client/static/js/typescript-0s2t05jj.js +0 -1
  203. package/dist/client/static/js/wardley-WFR3VGLG-36dmxww4.js +0 -1
  204. package/dist/client/static/js/xml-dz51p1m3.js +0 -1
  205. package/dist/client/static/js/yaml-2cfkd30t.js +0 -1
@@ -1,9 +1,9 @@
1
- import{t,ti,l,Ee,A,g,E,Fr,Od,R,p,h,Lr,de,vn,Ye,zn}from"./index-fta1y9pc.js";var lt=function(){var r=t(function(w,a,f,d){for(f=f||{},d=w.length;d--;f[w[d]]=a);return f},"o"),e=[6,11,13,14,15,17,19,20,23,24],s=[1,12],i=[1,13],n=[1,14],u=[1,15],c=[1,16],o=[1,19],b=[1,20],k={trace:t(function(){},"trace"),yy:{},symbols_:{error:2,start:3,timeline_header:4,document:5,EOF:6,timeline:7,timeline_lr:8,timeline_td:9,line:10,SPACE:11,statement:12,NEWLINE:13,title:14,acc_title:15,acc_title_value:16,acc_descr:17,acc_descr_value:18,acc_descr_multiline_value:19,section:20,period_statement:21,event_statement:22,period:23,event:24,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",7:"timeline",8:"timeline_lr",9:"timeline_td",11:"SPACE",13:"NEWLINE",14:"title",15:"acc_title",16:"acc_title_value",17:"acc_descr",18:"acc_descr_value",19:"acc_descr_multiline_value",20:"section",23:"period",24:"event"},productions_:[0,[3,3],[4,1],[4,1],[4,1],[5,0],[5,2],[10,2],[10,1],[10,1],[10,1],[12,1],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[21,1],[22,1]],performAction:t(function(a,f,d,m,v,y,N){var S=y.length-1;switch(v){case 1:return y[S-1];case 3:m.setDirection("LR");break;case 4:m.setDirection("TD");break;case 5:this.$=[];break;case 6:y[S-1].push(y[S]),this.$=y[S-1];break;case 7:case 8:this.$=y[S];break;case 9:case 10:this.$=[];break;case 11:m.getCommonDb().setDiagramTitle(y[S].substr(6)),this.$=y[S].substr(6);break;case 12:this.$=y[S].trim(),m.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=y[S].trim(),m.getCommonDb().setAccDescription(this.$);break;case 15:m.addSection(y[S].substr(8)),this.$=y[S].substr(8);break;case 18:m.addTask(y[S],0,""),this.$=y[S];break;case 19:m.addEvent(y[S].substr(2)),this.$=y[S];break}},"anonymous"),table:[{3:1,4:2,7:[1,3],8:[1,4],9:[1,5]},{1:[3]},r(e,[2,5],{5:6}),r(e,[2,2]),r(e,[2,3]),r(e,[2,4]),{6:[1,7],10:8,11:[1,9],12:10,13:[1,11],14:s,15:i,17:n,19:u,20:c,21:17,22:18,23:o,24:b},r(e,[2,10],{1:[2,1]}),r(e,[2,6]),{12:21,14:s,15:i,17:n,19:u,20:c,21:17,22:18,23:o,24:b},r(e,[2,8]),r(e,[2,9]),r(e,[2,11]),{16:[1,22]},{18:[1,23]},r(e,[2,14]),r(e,[2,15]),r(e,[2,16]),r(e,[2,17]),r(e,[2,18]),r(e,[2,19]),r(e,[2,7]),r(e,[2,12]),r(e,[2,13])],defaultActions:{},parseError:t(function(a,f){if(f.recoverable)this.trace(a);else{var d=Error(a);throw d.hash=f,d}},"parseError"),parse:t(function(a){var f=this,d=[0],m=[],v=[null],y=[],N=this.table,S="",W=0,G=0,D=0,q=2,B=1,O=y.slice.call(arguments,1),H=Object.create(this.lexer),F={yy:{}};for(var U in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,U))F.yy[U]=this.yy[U];if(H.setInput(a,F.yy),F.yy.lexer=H,F.yy.parser=this,typeof H.yylloc>"u")H.yylloc={};var J=H.yylloc;y.push(J);var M=H.options&&H.options.ranges;if(typeof F.yy.parseError==="function")this.parseError=F.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function T(K){d.length=d.length-2*K,v.length=v.length-K,y.length=y.length-K}t(T,"popStack");function L(){var K=m.pop()||H.lex()||B;if(typeof K!=="number"){if(K instanceof Array)m=K,K=m.pop();K=f.symbols_[K]||K}return K}t(L,"lex");var I,P,V,C,at,tt,j={},et,X,ft,rt;while(!0){if(V=d[d.length-1],this.defaultActions[V])C=this.defaultActions[V];else{if(I===null||typeof I>"u")I=L();C=N[V]&&N[V][I]}if(typeof C>"u"||!C.length||!C[0]){var ot="";rt=[];for(et in N[V])if(this.terminals_[et]&&et>q)rt.push("'"+this.terminals_[et]+"'");if(H.showPosition)ot="Parse error on line "+(W+1)+`:
1
+ import{t,ti,l,Ee,A,g,E,Fr,$d,R,p,h,Lr,de,kn,Ye,zn}from"./index-vnw3hbeg.js";var lt=function(){var r=t(function(w,a,f,d){for(f=f||{},d=w.length;d--;f[w[d]]=a);return f},"o"),e=[6,11,13,14,15,17,19,20,23,24],s=[1,12],i=[1,13],n=[1,14],u=[1,15],c=[1,16],o=[1,19],b=[1,20],k={trace:t(function(){},"trace"),yy:{},symbols_:{error:2,start:3,timeline_header:4,document:5,EOF:6,timeline:7,timeline_lr:8,timeline_td:9,line:10,SPACE:11,statement:12,NEWLINE:13,title:14,acc_title:15,acc_title_value:16,acc_descr:17,acc_descr_value:18,acc_descr_multiline_value:19,section:20,period_statement:21,event_statement:22,period:23,event:24,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",7:"timeline",8:"timeline_lr",9:"timeline_td",11:"SPACE",13:"NEWLINE",14:"title",15:"acc_title",16:"acc_title_value",17:"acc_descr",18:"acc_descr_value",19:"acc_descr_multiline_value",20:"section",23:"period",24:"event"},productions_:[0,[3,3],[4,1],[4,1],[4,1],[5,0],[5,2],[10,2],[10,1],[10,1],[10,1],[12,1],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[21,1],[22,1]],performAction:t(function(a,f,d,m,v,y,N){var S=y.length-1;switch(v){case 1:return y[S-1];case 3:m.setDirection("LR");break;case 4:m.setDirection("TD");break;case 5:this.$=[];break;case 6:y[S-1].push(y[S]),this.$=y[S-1];break;case 7:case 8:this.$=y[S];break;case 9:case 10:this.$=[];break;case 11:m.getCommonDb().setDiagramTitle(y[S].substr(6)),this.$=y[S].substr(6);break;case 12:this.$=y[S].trim(),m.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=y[S].trim(),m.getCommonDb().setAccDescription(this.$);break;case 15:m.addSection(y[S].substr(8)),this.$=y[S].substr(8);break;case 18:m.addTask(y[S],0,""),this.$=y[S];break;case 19:m.addEvent(y[S].substr(2)),this.$=y[S];break}},"anonymous"),table:[{3:1,4:2,7:[1,3],8:[1,4],9:[1,5]},{1:[3]},r(e,[2,5],{5:6}),r(e,[2,2]),r(e,[2,3]),r(e,[2,4]),{6:[1,7],10:8,11:[1,9],12:10,13:[1,11],14:s,15:i,17:n,19:u,20:c,21:17,22:18,23:o,24:b},r(e,[2,10],{1:[2,1]}),r(e,[2,6]),{12:21,14:s,15:i,17:n,19:u,20:c,21:17,22:18,23:o,24:b},r(e,[2,8]),r(e,[2,9]),r(e,[2,11]),{16:[1,22]},{18:[1,23]},r(e,[2,14]),r(e,[2,15]),r(e,[2,16]),r(e,[2,17]),r(e,[2,18]),r(e,[2,19]),r(e,[2,7]),r(e,[2,12]),r(e,[2,13])],defaultActions:{},parseError:t(function(a,f){if(f.recoverable)this.trace(a);else{var d=Error(a);throw d.hash=f,d}},"parseError"),parse:t(function(a){var f=this,d=[0],m=[],v=[null],y=[],N=this.table,S="",W=0,G=0,D=0,q=2,B=1,O=y.slice.call(arguments,1),H=Object.create(this.lexer),F={yy:{}};for(var U in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,U))F.yy[U]=this.yy[U];if(H.setInput(a,F.yy),F.yy.lexer=H,F.yy.parser=this,typeof H.yylloc>"u")H.yylloc={};var J=H.yylloc;y.push(J);var M=H.options&&H.options.ranges;if(typeof F.yy.parseError==="function")this.parseError=F.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function T(K){d.length=d.length-2*K,v.length=v.length-K,y.length=y.length-K}t(T,"popStack");function L(){var K=m.pop()||H.lex()||B;if(typeof K!=="number"){if(K instanceof Array)m=K,K=m.pop();K=f.symbols_[K]||K}return K}t(L,"lex");var I,P,V,C,at,tt,j={},et,X,ft,rt;while(!0){if(V=d[d.length-1],this.defaultActions[V])C=this.defaultActions[V];else{if(I===null||typeof I>"u")I=L();C=N[V]&&N[V][I]}if(typeof C>"u"||!C.length||!C[0]){var ot="";rt=[];for(et in N[V])if(this.terminals_[et]&&et>q)rt.push("'"+this.terminals_[et]+"'");if(H.showPosition)ot="Parse error on line "+(W+1)+`:
2
2
  `+H.showPosition()+`
3
3
  Expecting `+rt.join(", ")+", got '"+(this.terminals_[I]||I)+"'";else ot="Parse error on line "+(W+1)+": Unexpected "+(I==B?"end of input":"'"+(this.terminals_[I]||I)+"'");this.parseError(ot,{text:H.match,token:this.terminals_[I]||I,line:H.yylineno,loc:J,expected:rt})}if(C[0]instanceof Array&&C.length>1)throw Error("Parse Error: multiple actions possible at state: "+V+", token: "+I);switch(C[0]){case 1:if(d.push(I),v.push(H.yytext),y.push(H.yylloc),d.push(C[1]),I=null,!P){if(G=H.yyleng,S=H.yytext,W=H.yylineno,J=H.yylloc,D>0)D--}else I=P,P=null;break;case 2:if(X=this.productions_[C[1]][1],j.$=v[v.length-X],j._$={first_line:y[y.length-(X||1)].first_line,last_line:y[y.length-1].last_line,first_column:y[y.length-(X||1)].first_column,last_column:y[y.length-1].last_column},M)j._$.range=[y[y.length-(X||1)].range[0],y[y.length-1].range[1]];if(tt=this.performAction.apply(j,[S,G,W,F.yy,C[1],v,y].concat(O)),typeof tt<"u")return tt;if(X)d=d.slice(0,-1*X*2),v=v.slice(0,-1*X),y=y.slice(0,-1*X);d.push(this.productions_[C[1]][0]),v.push(j.$),y.push(j._$),ft=N[d[d.length-2]][d[d.length-1]],d.push(ft);break;case 3:return!0}}return!0},"parse")},_=function(){var w={EOF:1,parseError:t(function(f,d){if(this.yy.parser)this.yy.parser.parseError(f,d);else throw Error(f)},"parseError"),setInput:t(function(a,f){if(this.yy=f||this.yy||{},this._input=a,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:t(function(){var a=this._input[0];this.yytext+=a,this.yyleng++,this.offset++,this.match+=a,this.matched+=a;var f=a.match(/(?:\r\n?|\n).*/g);if(f)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),a},"input"),unput:t(function(a){var f=a.length,d=a.split(/(?:\r\n?|\n)/g);this._input=a+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-f),this.offset-=f;var m=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),d.length-1)this.yylineno-=d.length-1;var v=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:d?(d.length===m.length?this.yylloc.first_column:0)+m[m.length-d.length].length-d[0].length:this.yylloc.first_column-f},this.options.ranges)this.yylloc.range=[v[0],v[0]+this.yyleng-f];return this.yyleng=this.yytext.length,this},"unput"),more:t(function(){return this._more=!0,this},"more"),reject:t(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:t(function(a){this.unput(this.match.slice(a))},"less"),pastInput:t(function(){var a=this.matched.substr(0,this.matched.length-this.match.length);return(a.length>20?"...":"")+a.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:t(function(){var a=this.match;if(a.length<20)a+=this._input.substr(0,20-a.length);return(a.substr(0,20)+(a.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:t(function(){var a=this.pastInput(),f=Array(a.length+1).join("-");return a+this.upcomingInput()+`
5
5
  `+f+"^"},"showPosition"),test_match:t(function(a,f){var d,m,v;if(this.options.backtrack_lexer){if(v={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)v.yylloc.range=this.yylloc.range.slice(0)}if(m=a[0].match(/(?:\r\n?|\n).*/g),m)this.yylineno+=m.length;if(this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:m?m[m.length-1].length-m[m.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+a[0].length},this.yytext+=a[0],this.match+=a[0],this.matches=a,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(a[0].length),this.matched+=a[0],d=this.performAction.call(this,this.yy,this,f,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input)this.done=!1;if(d)return d;else if(this._backtrack){for(var y in v)this[y]=v[y];return!1}return!1},"test_match"),next:t(function(){if(this.done)return this.EOF;if(!this._input)this.done=!0;var a,f,d,m;if(!this._more)this.yytext="",this.match="";var v=this._currentRules();for(var y=0;y<v.length;y++)if(d=this._input.match(this.rules[v[y]]),d&&(!f||d[0].length>f[0].length)){if(f=d,m=y,this.options.backtrack_lexer)if(a=this.test_match(d,v[y]),a!==!1)return a;else if(this._backtrack){f=!1;continue}else return!1;else if(!this.options.flex)break}if(f){if(a=this.test_match(f,v[m]),a!==!1)return a;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:t(function(){var f=this.next();if(f)return f;else return this.lex()},"lex"),begin:t(function(f){this.conditionStack.push(f)},"begin"),popState:t(function(){var f=this.conditionStack.length-1;if(f>0)return this.conditionStack.pop();else return this.conditionStack[0]},"popState"),_currentRules:t(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:t(function(f){if(f=this.conditionStack.length-1-Math.abs(f||0),f>=0)return this.conditionStack[f];else return"INITIAL"},"topState"),pushState:t(function(f){this.begin(f)},"pushState"),stateStackSize:t(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:t(function(f,d,m,v){var y=v;switch(m){case 0:break;case 1:break;case 2:return 13;case 3:break;case 4:break;case 5:return 8;case 6:return 9;case 7:return 7;case 8:return 14;case 9:return this.begin("acc_title"),15;break;case 10:return this.popState(),"acc_title_value";break;case 11:return this.begin("acc_descr"),17;break;case 12:return this.popState(),"acc_descr_value";break;case 13:this.begin("acc_descr_multiline");break;case 14:this.popState();break;case 15:return"acc_descr_multiline_value";case 16:return 20;case 17:return 24;case 18:return 23;case 19:return 6;case 20:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:timeline[ \t]+LR\b)/i,/^(?:timeline[ \t]+TD\b)/i,/^(?:timeline\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^:\n]+)/i,/^(?::\s(?:[^:\n]|:(?!\s))+)/i,/^(?:[^#:\n]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[14,15],inclusive:!1},acc_descr:{rules:[12],inclusive:!1},acc_title:{rules:[10],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,13,16,17,18,19,20],inclusive:!0}}};return w}();k.lexer=_;function x(){this.yy={}}return t(x,"Parser"),x.prototype=k,k.Parser=x,new x}();lt.parser=lt;var Vt=lt,vt={};ti(vt,{addEvent:()=>Lt,addSection:()=>$t,addTask:()=>Ht,addTaskOrg:()=>Mt,clear:()=>St,default:()=>Ft,getCommonDb:()=>wt,getDirection:()=>Tt,getSections:()=>Nt,getTasks:()=>It,setDirection:()=>Et});var Q="",_t=0,ht="LR",dt=[],nt=[],Y=[],wt=t(()=>Od,"getCommonDb"),St=t(function(){dt.length=0,nt.length=0,Q="",Y.length=0,ht="LR",R()},"clear"),Et=t(function(r){ht=r},"setDirection"),Tt=t(function(){return ht},"getDirection"),$t=t(function(r){Q=r,dt.push(r)},"addSection"),Nt=t(function(){return dt},"getSections"),It=t(function(){let r=yt(),e=100,s=0;while(!r&&s<e)r=yt(),s++;return nt.push(...Y),nt},"getTasks"),Ht=t(function(r,e,s){let i={id:_t++,section:Q,type:Q,task:r,score:e?e:0,events:s?[s]:[]};Y.push(i)},"addTask"),Lt=t(function(r){Y.find((s)=>s.id===_t-1).events.push(r)},"addEvent"),Mt=t(function(r){let e={section:Q,type:Q,description:r,task:r,classes:[]};nt.push(e)},"addTaskOrg"),yt=t(function(){let r=t(function(s){return Y[s].processed},"compileTask"),e=!0;for(let[s,i]of Y.entries())r(s),e=e&&i.processed;return e},"compileTasks"),Ft={clear:St,getCommonDb:wt,getDirection:Tt,setDirection:Et,addSection:$t,getSections:Nt,getTasks:It,addTask:Ht,addTaskOrg:Mt,addEvent:Lt},At=0,it=t(function(r,e){let s=r.append("rect");if(s.attr("x",e.x),s.attr("y",e.y),s.attr("fill",e.fill),s.attr("stroke",e.stroke),s.attr("width",e.width),s.attr("height",e.height),s.attr("rx",e.rx),s.attr("ry",e.ry),e.class!==void 0)s.attr("class",e.class);return s},"drawRect"),zt=t(function(r,e){let i=r.append("circle").attr("cx",e.cx).attr("cy",e.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),n=r.append("g");n.append("circle").attr("cx",e.cx-5).attr("cy",e.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),n.append("circle").attr("cx",e.cx+5).attr("cy",e.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666");function u(b){let k=Lr().startAngle(Math.PI/2).endAngle(3*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);b.append("path").attr("class","mouth").attr("d",k).attr("transform","translate("+e.cx+","+(e.cy+2)+")")}t(u,"smile");function c(b){let k=Lr().startAngle(3*Math.PI/2).endAngle(5*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);b.append("path").attr("class","mouth").attr("d",k).attr("transform","translate("+e.cx+","+(e.cy+7)+")")}t(c,"sad");function o(b){b.append("line").attr("class","mouth").attr("stroke",2).attr("x1",e.cx-5).attr("y1",e.cy+7).attr("x2",e.cx+5).attr("y2",e.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}if(t(o,"ambivalent"),e.score>3)u(n);else if(e.score<3)c(n);else o(n);return i},"drawFace"),Ot=t(function(r,e){let s=r.append("circle");if(s.attr("cx",e.cx),s.attr("cy",e.cy),s.attr("class","actor-"+e.pos),s.attr("fill",e.fill),s.attr("stroke",e.stroke),s.attr("r",e.r),s.class!==void 0)s.attr("class",s.class);if(e.title!==void 0)s.append("title").text(e.title);return s},"drawCircle"),Ct=t(function(r,e){let s=e.text.replace(/<br\s*\/?>/gi," "),i=r.append("text");if(i.attr("x",e.x),i.attr("y",e.y),i.attr("class","legend"),i.style("text-anchor",e.anchor),e.class!==void 0)i.attr("class",e.class);let n=i.append("tspan");return n.attr("x",e.x+e.textMargin*2),n.text(s),i},"drawText"),Gt=t(function(r,e){function s(n,u,c,o,b){return n+","+u+" "+(n+c)+","+u+" "+(n+c)+","+(u+o-b)+" "+(n+c-b*1.2)+","+(u+o)+" "+n+","+(u+o)}t(s,"genPoints");let i=r.append("polygon");i.attr("points",s(e.x,e.y,50,20,7)),i.attr("class","labelBox"),e.y=e.y+e.labelMargin,e.x=e.x+0.5*e.labelMargin,Ct(r,e)},"drawLabel"),Dt=t(function(r,e,s){let i=r.append("g"),n=ut();n.x=e.x,n.y=e.y,n.fill=e.fill,n.width=s.width,n.height=s.height,n.class="journey-section section-type-"+e.num,n.rx=3,n.ry=3,it(i,n),Rt(s)(e.text,i,n.x,n.y,n.width,n.height,{class:"journey-section section-type-"+e.num},s,e.colour)},"drawSection"),ct=-1,Kt=t(function(r,e,s,i){let n=e.x+s.width/2,u=r.append("g");ct++;let c=450;u.append("line").attr("id",i+"-task"+ct).attr("x1",n).attr("y1",e.y).attr("x2",n).attr("y2",c).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),zt(u,{cx:n,cy:300+(5-e.score)*30,score:e.score});let o=ut();o.x=e.x,o.y=e.y,o.fill=e.fill,o.width=s.width,o.height=s.height,o.class="task task-type-"+e.num,o.rx=3,o.ry=3,it(u,o),Rt(s)(e.task,u,o.x,o.y,o.width,o.height,{class:"task"},s,e.colour)},"drawTask"),Ut=t(function(r,e){it(r,{x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,class:"rect"}).lower()},"drawBackgroundRect"),Xt=t(function(){return{x:0,y:0,fill:void 0,"text-anchor":"start",width:100,height:100,textMargin:0,rx:0,ry:0}},"getTextObj"),ut=t(function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),Rt=function(){function r(n,u,c,o,b,k,_,x){let w=u.append("text").attr("x",c+b/2).attr("y",o+k/2+5).style("font-color",x).style("text-anchor","middle").text(n);i(w,_)}t(r,"byText");function e(n,u,c,o,b,k,_,x,w){let{taskFontSize:a,taskFontFamily:f}=x,d=n.split(/<br\s*\/?>/gi);for(let m=0;m<d.length;m++){let v=m*a-a*(d.length-1)/2,y=u.append("text").attr("x",c+b/2).attr("y",o).attr("fill",w).style("text-anchor","middle").style("font-size",a).style("font-family",f);y.append("tspan").attr("x",c+b/2).attr("dy",v).text(d[m]),y.attr("y",o+k/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),i(y,_)}}t(e,"byTspan");function s(n,u,c,o,b,k,_,x){let w=u.append("switch"),f=w.append("foreignObject").attr("x",c).attr("y",o).attr("width",b).attr("height",k).attr("position","fixed").append("xhtml:div").style("display","table").style("height","100%").style("width","100%");f.append("div").attr("class","label").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(n),e(n,w,c,o,b,k,_,x),i(f,_)}t(s,"byFo");function i(n,u){for(let c in u)if(c in u)n.attr(c,u[c])}return t(i,"_setTextAttrs"),function(n){return n.textPlacement==="fo"?s:n.textPlacement==="old"?r:e}}(),Zt=t(function(r,e){At=0,ct=-1,r.append("defs").append("marker").attr("id",e+"-arrowhead").attr("refX",5).attr("refY",2).attr("markerWidth",6).attr("markerHeight",4).attr("orient","auto").append("path").attr("d","M 0,0 V 4 L6,2 Z")},"initGraphics");function pt(r,e){r.each(function(){var s=h(this),i=s.text().split(/(\s+|<br>)/).reverse(),n,u=[],c=1.1,o=s.attr("y"),b=parseFloat(s.attr("dy")),k=s.text(null).append("tspan").attr("x",0).attr("y",o).attr("dy",b+"em");for(let _=0;_<i.length;_++)if(n=i[i.length-1-_],u.push(n),k.text(u.join(" ").trim()),k.node().getComputedTextLength()>e||n==="<br>"){if(u.pop(),k.text(u.join(" ").trim()),n==="<br>")u=[""];else u=[n];k=s.append("tspan").attr("x",0).attr("y",o).attr("dy",c+"em").text(n)}})}t(pt,"wrap");var jt=t(function(r,e,s,i,n,u=!1){let{theme:c,look:o}=i,b=c?.includes("redux"),k=i?.themeVariables?.THEME_COLOR_LIMIT??12,_=s%k-1,x=r.append("g");e.section=_,x.attr("class",(e.class?e.class+" ":"")+"timeline-node "+("section-"+_));let w=x.append("g"),a=x.append("g"),d=a.append("text").text(e.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(pt,e.width).node().getBBox(),m=i.fontSize?.replace?i.fontSize.replace("px",""):i.fontSize;if(e.height=d.height+m*1.1*0.5+e.padding,e.height=Math.max(e.height,e.maxHeight),e.width=e.width+2*e.padding,a.attr("transform","translate("+e.width/2+", "+e.padding/2+")"),b)a.attr("transform",`translate(${e.width/2}, ${u?e.padding/2+3:e.padding})`);if(Jt(w,e,_,n,i),o==="neo"){if(x.attr("data-look","neo"),b){let v=c.includes("dark"),y=r.node()?.ownerSVGElement??r.node(),N=h(y),S=N.attr("id")??"",W=S?`${S}-drop-shadow`:"drop-shadow";if(N.select(`#${W}`).empty()){let G=N.select("defs");(G.empty()?N.append("defs"):G).append("filter").attr("id",W).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity",v?"0.2":"0.06").attr("flood-color",v?"#FFFFFF":"#000000")}}}return e},"drawNode"),qt=t(function(r,e,s){let i=r.append("g"),u=i.append("text").text(e.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(pt,e.width).node().getBBox(),c=s.fontSize?.replace?s.fontSize.replace("px",""):s.fontSize;return i.remove(),u.height+c*1.1*0.5+e.padding},"getVirtualNodeHeight"),Jt=t(function(r,e,s,i,n){let{theme:u}=n,c=u?.includes("redux")?0:5,o=5,b=c>0?`M0 ${e.height-5} v${-e.height+10} q0,-${c},${c},-${c} h${e.width-10} q${c},0,${c},${c} v${e.height-5} H0 Z`:`M0 ${e.height-5} v${-(e.height-5)} h${e.width} v${e.height} H0 Z`;if(r.append("path").attr("id",i+"-node-"+At++).attr("class","node-bkg node-"+e.type).attr("d",b),!u?.includes("redux"))r.append("line").attr("class","node-line-"+s).attr("x1",0).attr("y1",e.height).attr("x2",e.width).attr("y2",e.height)},"defaultBkg"),z={drawRect:it,drawCircle:Ot,drawSection:Dt,drawText:Ct,drawLabel:Gt,drawTask:Kt,drawBackgroundRect:Ut,getTextObj:Xt,getNoteRect:ut,initGraphics:Zt,drawNode:jt,getVirtualNodeHeight:qt},Qt=t(function(r,e,s,i){let n=p(),{look:u,theme:c,themeVariables:o}=n,{useGradient:b,gradientStart:k,gradientStop:_}=o,x=n.timeline?.leftMargin??50;l.debug("timeline",i.db);let w=n.securityLevel,a;if(w==="sandbox")a=h("#i"+e);let d=(w==="sandbox"?h(a.nodes()[0].contentDocument.body):h("body")).select("#"+e);d.append("g");let m=i.db.getTasks(),v=i.db.getCommonDb().getDiagramTitle();l.debug("task",m),z.initGraphics(d,e);let y=i.db.getSections();l.debug("sections",y);let N=0,S=0,W=0,G=0,D=50+x,q=50;G=50;let B=0,O=!0;y.forEach(function(M){let T={number:B,descr:M,section:B,width:150,padding:20,maxHeight:N},L=z.getVirtualNodeHeight(d,T,n);l.debug("sectionHeight before draw",L),N=Math.max(N,L+20)});let H=0,F=0;l.debug("tasks.length",m.length);for(let[M,T]of m.entries()){let L={number:M,descr:T,section:T.section,width:150,padding:20,maxHeight:S},I=z.getVirtualNodeHeight(d,L,n);l.debug("taskHeight before draw",I),S=Math.max(S,I+20),H=Math.max(H,T.events.length);let P=0;for(let V of T.events){let C={descr:V,section:T.section,number:T.section,width:150,padding:20,maxHeight:50};P+=z.getVirtualNodeHeight(d,C,n)}if(T.events.length>0)P+=(T.events.length-1)*10;F=Math.max(F,P)}if(l.debug("maxSectionHeight before draw",N),l.debug("maxTaskHeight before draw",S),y&&y.length>0)y.forEach((M)=>{let T=m.filter((V)=>V.section===M),L={number:B,descr:M,section:B,width:200*Math.max(T.length,1)-50,padding:20,maxHeight:N};l.debug("sectionNode",L);let I=d.append("g"),P=z.drawNode(I,L,B,n,e);if(l.debug("sectionNode output",P),I.attr("transform",`translate(${D}, ${G})`),q+=N+50,T.length>0)mt(d,T,B,D,q,S,n,H,F,N,!1,e);D+=200*Math.max(T.length,1),q=G,B++});else O=!1,mt(d,m,B,D,q,S,n,H,F,N,!0,e);let U=d.node().getBBox();if(l.debug("bounds",U),v)d.append("text").text(v).attr("x",u==="neo"?U.x*2+x:U.width/2-x).attr("font-size","4ex").attr("font-weight","bold").attr("y",20);if(W=O?N+S+150:S+100,d.append("g").attr("class","lineWrapper").append("line").attr("x1",x).attr("y1",W).attr("x2",U.width+3*x).attr("y2",W).attr("stroke-width",4).attr("stroke","black").attr("marker-end",`url(#${e}-arrowhead)`),u==="neo"&&b&&c!=="neutral"){let M=d.select("defs"),L=(M.empty()?d.append("defs"):M).append("linearGradient").attr("id",d.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");L.append("stop").attr("offset","0%").attr("stop-color",k).attr("stop-opacity",1),L.append("stop").attr("offset","100%").attr("stop-color",_).attr("stop-opacity",1)}Fr(void 0,d,n.timeline?.padding??50,n.timeline?.useMaxWidth??!1)},"draw"),mt=t(function(r,e,s,i,n,u,c,o,b,k,_,x){for(let w of e){let a={descr:w.task,section:s,number:s,width:150,padding:20,maxHeight:u};l.debug("taskNode",a);let f=r.append("g").attr("class","taskWrapper"),m=z.drawNode(f,a,s,c,x).height;if(l.debug("taskHeight after draw",m),f.attr("transform",`translate(${i}, ${n})`),u=Math.max(u,m),w.events){let v=r.append("g").attr("class","lineWrapper"),y=u;n+=100,y=y+Yt(r,w.events,s,i,n,c,x),n-=100,v.append("line").attr("x1",i+95).attr("y1",n+u).attr("x2",i+95).attr("y2",n+u+100+b+100).attr("stroke-width",2).attr("stroke","black").attr("marker-end",`url(#${x}-arrowhead)`).attr("stroke-dasharray","5,5")}if(i=i+200,_&&!c.timeline?.disableMulticolor)s++}n=n-10},"drawTasks"),Yt=t(function(r,e,s,i,n,u,c){let o=0,b=n;n=n+100;for(let k of e){let _={descr:k,section:s,number:s,width:150,padding:20,maxHeight:50};l.debug("eventNode",_);let x=r.append("g").attr("class","eventWrapper"),a=z.drawNode(x,_,s,u,c,!0).height;o=o+a,x.attr("transform",`translate(${i}, ${n})`),n=n+10+a}return n=b,o},"drawEvents"),te={setConf:t(()=>{},"setConf"),draw:Qt},st=200,Z=5,ee=st+Z*2,gt=st+100,re=gt+Z*2,Wt=10,ne=0,kt=20,Pt=20,xt=30,Bt=50,ie=t(function(r,e,s,i){let n=p(),u=n.timeline?.leftMargin??50;l.debug("timeline",i.db);let c=de(e);c.append("g");let o=i.db.getTasks(),b=i.db.getCommonDb().getDiagramTitle();l.debug("task",o),z.initGraphics(c);let k=i.db.getSections();l.debug("sections",k);let _=0,x=0,w=50+u,a=50,f=a,d=w,m=ee+Pt,v=re+Bt,y=d+m,N=0,S=k&&k.length>0,W=S?y:w+m,G=Math.max(50,m+v-Z*2);k.forEach(function(M){let T={number:N,descr:M,section:N,width:G,padding:Z,maxHeight:_},L=z.getVirtualNodeHeight(c,T,n);l.debug("sectionHeight before draw",L),_=Math.max(_,L)});let D=0;l.debug("tasks.length",o.length);for(let[M,T]of o.entries()){let L={number:M,descr:T,section:T.section,width:st,padding:Z,maxHeight:x},I=z.getVirtualNodeHeight(c,L,n);l.debug("taskHeight before draw",I),x=Math.max(x,I);let P=0;for(let V of T.events){let C={descr:V,section:T.section,number:T.section,width:gt,padding:Z,maxHeight:50};P+=z.getVirtualNodeHeight(c,C,n)}if(T.events.length>0)P+=(T.events.length-1)*Wt;D=Math.max(D,P)+ne}l.debug("maxSectionHeight before draw",_),l.debug("maxTaskHeight before draw",x);let B=Math.max(x,D)+xt;if(S)k.forEach((M)=>{let T=o.filter((j)=>j.section===M),L={number:N,descr:M,section:N,width:G,padding:Z,maxHeight:_};l.debug("sectionNode",L);let I=c.append("g"),P=z.drawNode(I,L,N,n);l.debug("sectionNode output",P);let V=W-m;I.attr("transform",`translate(${V}, ${a})`);let C=a+P.height+kt;if(T.length>0)bt(c,T,N,W,C,x,n,B,!1);let at=T.length,tt=P.height+kt+B*Math.max(at,1)-(at>0?xt*2:0);a+=tt,N++});else bt(c,o,N,W,a,x,n,B,!0);let O=c.node()?.getBBox();if(!O)throw Error("bbox not found");if(l.debug("bounds",O),b){if(c.append("text").text(b).attr("x",O.width/2-u).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),O=c.node()?.getBBox(),!O)throw Error("bbox not found");l.debug("bounds after title",O)}let[H]=vn(n.fontSize),F=(H??16)*2,U=(H??16)*0.5+20,J=c.append("g").attr("class","lineWrapper");J.append("line").attr("x1",W).attr("y1",f-F).attr("x2",W).attr("y2",O.y+O.height+U).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)"),J.lower(),Fr(void 0,c,n.timeline?.padding??50,n.timeline?.useMaxWidth??!1)},"draw"),bt=t(function(r,e,s,i,n,u,c,o,b){for(let k of e){let _={descr:k.task,section:s,number:s,width:st,padding:Z,maxHeight:u};l.debug("taskNode",_);let x=r.append("g").attr("class","taskWrapper"),w=z.drawNode(x,_,s,c),a=w.height;l.debug("taskHeight after draw",a);let f=i-Pt-w.width;if(x.attr("transform",`translate(${f}, ${n})`),u=Math.max(u,a),k.events&&k.events.length>0){let d=n,m=i+Bt;se(r,k.events,s,i,m,d,c)}if(n=n+o,b&&!c.timeline?.disableMulticolor)s++}},"drawTasks"),se=t(function(r,e,s,i,n,u,c){let o=u;for(let b of e){let k={descr:b,section:s,number:s,width:gt,padding:Z,maxHeight:0};l.debug("eventNode",k);let _=r.append("g").attr("class","eventWrapper"),w=z.drawNode(_,k,s,c).height;_.attr("transform",`translate(${n}, ${o})`);let a=r.append("g").attr("class","lineWrapper"),f=o+w/2;a.append("line").attr("x1",i).attr("y1",f).attr("x2",n).attr("y2",f).attr("stroke-width",2).attr("stroke","black").attr("marker-end","url(#arrowhead)").attr("stroke-dasharray","5,5"),o=o+w+Wt}return o-u},"drawEvents"),ae={setConf:t(()=>{},"setConf"),draw:ie},oe=t((r)=>{let{theme:e}=E(),s=e?.includes("dark"),i=Ye(e,r.borderColorArray),n=r.svgId?.replace(/^#/,"")??"",u=n?`url(#${n}-drop-shadow)`:r.dropShadow??"none",c="";for(let o=0;o<zn(r.THEME_COLOR_LIMIT);o++){let b=`${17-3*o}`,k=i?r.borderColorArray[o%r.borderColorArray.length]:void 0,_=k??r.mainBkg,x=k??r.nodeBorder;c+=`
6
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:t(function(){var f=this.next();if(f)return f;else return this.lex()},"lex"),begin:t(function(f){this.conditionStack.push(f)},"begin"),popState:t(function(){var f=this.conditionStack.length-1;if(f>0)return this.conditionStack.pop();else return this.conditionStack[0]},"popState"),_currentRules:t(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:t(function(f){if(f=this.conditionStack.length-1-Math.abs(f||0),f>=0)return this.conditionStack[f];else return"INITIAL"},"topState"),pushState:t(function(f){this.begin(f)},"pushState"),stateStackSize:t(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:t(function(f,d,m,v){var y=v;switch(m){case 0:break;case 1:break;case 2:return 13;case 3:break;case 4:break;case 5:return 8;case 6:return 9;case 7:return 7;case 8:return 14;case 9:return this.begin("acc_title"),15;break;case 10:return this.popState(),"acc_title_value";break;case 11:return this.begin("acc_descr"),17;break;case 12:return this.popState(),"acc_descr_value";break;case 13:this.begin("acc_descr_multiline");break;case 14:this.popState();break;case 15:return"acc_descr_multiline_value";case 16:return 20;case 17:return 24;case 18:return 23;case 19:return 6;case 20:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:timeline[ \t]+LR\b)/i,/^(?:timeline[ \t]+TD\b)/i,/^(?:timeline\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^:\n]+)/i,/^(?::\s(?:[^:\n]|:(?!\s))+)/i,/^(?:[^#:\n]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[14,15],inclusive:!1},acc_descr:{rules:[12],inclusive:!1},acc_title:{rules:[10],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,13,16,17,18,19,20],inclusive:!0}}};return w}();k.lexer=_;function x(){this.yy={}}return t(x,"Parser"),x.prototype=k,k.Parser=x,new x}();lt.parser=lt;var Vt=lt,vt={};ti(vt,{addEvent:()=>Lt,addSection:()=>$t,addTask:()=>Ht,addTaskOrg:()=>Mt,clear:()=>St,default:()=>Ft,getCommonDb:()=>wt,getDirection:()=>Tt,getSections:()=>Nt,getTasks:()=>It,setDirection:()=>Et});var Q="",_t=0,ht="LR",dt=[],nt=[],Y=[],wt=t(()=>$d,"getCommonDb"),St=t(function(){dt.length=0,nt.length=0,Q="",Y.length=0,ht="LR",R()},"clear"),Et=t(function(r){ht=r},"setDirection"),Tt=t(function(){return ht},"getDirection"),$t=t(function(r){Q=r,dt.push(r)},"addSection"),Nt=t(function(){return dt},"getSections"),It=t(function(){let r=yt(),e=100,s=0;while(!r&&s<e)r=yt(),s++;return nt.push(...Y),nt},"getTasks"),Ht=t(function(r,e,s){let i={id:_t++,section:Q,type:Q,task:r,score:e?e:0,events:s?[s]:[]};Y.push(i)},"addTask"),Lt=t(function(r){Y.find((s)=>s.id===_t-1).events.push(r)},"addEvent"),Mt=t(function(r){let e={section:Q,type:Q,description:r,task:r,classes:[]};nt.push(e)},"addTaskOrg"),yt=t(function(){let r=t(function(s){return Y[s].processed},"compileTask"),e=!0;for(let[s,i]of Y.entries())r(s),e=e&&i.processed;return e},"compileTasks"),Ft={clear:St,getCommonDb:wt,getDirection:Tt,setDirection:Et,addSection:$t,getSections:Nt,getTasks:It,addTask:Ht,addTaskOrg:Mt,addEvent:Lt},At=0,it=t(function(r,e){let s=r.append("rect");if(s.attr("x",e.x),s.attr("y",e.y),s.attr("fill",e.fill),s.attr("stroke",e.stroke),s.attr("width",e.width),s.attr("height",e.height),s.attr("rx",e.rx),s.attr("ry",e.ry),e.class!==void 0)s.attr("class",e.class);return s},"drawRect"),zt=t(function(r,e){let i=r.append("circle").attr("cx",e.cx).attr("cy",e.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),n=r.append("g");n.append("circle").attr("cx",e.cx-5).attr("cy",e.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),n.append("circle").attr("cx",e.cx+5).attr("cy",e.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666");function u(b){let k=Lr().startAngle(Math.PI/2).endAngle(3*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);b.append("path").attr("class","mouth").attr("d",k).attr("transform","translate("+e.cx+","+(e.cy+2)+")")}t(u,"smile");function c(b){let k=Lr().startAngle(3*Math.PI/2).endAngle(5*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);b.append("path").attr("class","mouth").attr("d",k).attr("transform","translate("+e.cx+","+(e.cy+7)+")")}t(c,"sad");function o(b){b.append("line").attr("class","mouth").attr("stroke",2).attr("x1",e.cx-5).attr("y1",e.cy+7).attr("x2",e.cx+5).attr("y2",e.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}if(t(o,"ambivalent"),e.score>3)u(n);else if(e.score<3)c(n);else o(n);return i},"drawFace"),Ot=t(function(r,e){let s=r.append("circle");if(s.attr("cx",e.cx),s.attr("cy",e.cy),s.attr("class","actor-"+e.pos),s.attr("fill",e.fill),s.attr("stroke",e.stroke),s.attr("r",e.r),s.class!==void 0)s.attr("class",s.class);if(e.title!==void 0)s.append("title").text(e.title);return s},"drawCircle"),Ct=t(function(r,e){let s=e.text.replace(/<br\s*\/?>/gi," "),i=r.append("text");if(i.attr("x",e.x),i.attr("y",e.y),i.attr("class","legend"),i.style("text-anchor",e.anchor),e.class!==void 0)i.attr("class",e.class);let n=i.append("tspan");return n.attr("x",e.x+e.textMargin*2),n.text(s),i},"drawText"),Gt=t(function(r,e){function s(n,u,c,o,b){return n+","+u+" "+(n+c)+","+u+" "+(n+c)+","+(u+o-b)+" "+(n+c-b*1.2)+","+(u+o)+" "+n+","+(u+o)}t(s,"genPoints");let i=r.append("polygon");i.attr("points",s(e.x,e.y,50,20,7)),i.attr("class","labelBox"),e.y=e.y+e.labelMargin,e.x=e.x+0.5*e.labelMargin,Ct(r,e)},"drawLabel"),Dt=t(function(r,e,s){let i=r.append("g"),n=ut();n.x=e.x,n.y=e.y,n.fill=e.fill,n.width=s.width,n.height=s.height,n.class="journey-section section-type-"+e.num,n.rx=3,n.ry=3,it(i,n),Rt(s)(e.text,i,n.x,n.y,n.width,n.height,{class:"journey-section section-type-"+e.num},s,e.colour)},"drawSection"),ct=-1,Kt=t(function(r,e,s,i){let n=e.x+s.width/2,u=r.append("g");ct++;let c=450;u.append("line").attr("id",i+"-task"+ct).attr("x1",n).attr("y1",e.y).attr("x2",n).attr("y2",c).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),zt(u,{cx:n,cy:300+(5-e.score)*30,score:e.score});let o=ut();o.x=e.x,o.y=e.y,o.fill=e.fill,o.width=s.width,o.height=s.height,o.class="task task-type-"+e.num,o.rx=3,o.ry=3,it(u,o),Rt(s)(e.task,u,o.x,o.y,o.width,o.height,{class:"task"},s,e.colour)},"drawTask"),Ut=t(function(r,e){it(r,{x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,class:"rect"}).lower()},"drawBackgroundRect"),Xt=t(function(){return{x:0,y:0,fill:void 0,"text-anchor":"start",width:100,height:100,textMargin:0,rx:0,ry:0}},"getTextObj"),ut=t(function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),Rt=function(){function r(n,u,c,o,b,k,_,x){let w=u.append("text").attr("x",c+b/2).attr("y",o+k/2+5).style("font-color",x).style("text-anchor","middle").text(n);i(w,_)}t(r,"byText");function e(n,u,c,o,b,k,_,x,w){let{taskFontSize:a,taskFontFamily:f}=x,d=n.split(/<br\s*\/?>/gi);for(let m=0;m<d.length;m++){let v=m*a-a*(d.length-1)/2,y=u.append("text").attr("x",c+b/2).attr("y",o).attr("fill",w).style("text-anchor","middle").style("font-size",a).style("font-family",f);y.append("tspan").attr("x",c+b/2).attr("dy",v).text(d[m]),y.attr("y",o+k/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),i(y,_)}}t(e,"byTspan");function s(n,u,c,o,b,k,_,x){let w=u.append("switch"),f=w.append("foreignObject").attr("x",c).attr("y",o).attr("width",b).attr("height",k).attr("position","fixed").append("xhtml:div").style("display","table").style("height","100%").style("width","100%");f.append("div").attr("class","label").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(n),e(n,w,c,o,b,k,_,x),i(f,_)}t(s,"byFo");function i(n,u){for(let c in u)if(c in u)n.attr(c,u[c])}return t(i,"_setTextAttrs"),function(n){return n.textPlacement==="fo"?s:n.textPlacement==="old"?r:e}}(),Zt=t(function(r,e){At=0,ct=-1,r.append("defs").append("marker").attr("id",e+"-arrowhead").attr("refX",5).attr("refY",2).attr("markerWidth",6).attr("markerHeight",4).attr("orient","auto").append("path").attr("d","M 0,0 V 4 L6,2 Z")},"initGraphics");function pt(r,e){r.each(function(){var s=h(this),i=s.text().split(/(\s+|<br>)/).reverse(),n,u=[],c=1.1,o=s.attr("y"),b=parseFloat(s.attr("dy")),k=s.text(null).append("tspan").attr("x",0).attr("y",o).attr("dy",b+"em");for(let _=0;_<i.length;_++)if(n=i[i.length-1-_],u.push(n),k.text(u.join(" ").trim()),k.node().getComputedTextLength()>e||n==="<br>"){if(u.pop(),k.text(u.join(" ").trim()),n==="<br>")u=[""];else u=[n];k=s.append("tspan").attr("x",0).attr("y",o).attr("dy",c+"em").text(n)}})}t(pt,"wrap");var jt=t(function(r,e,s,i,n,u=!1){let{theme:c,look:o}=i,b=c?.includes("redux"),k=i?.themeVariables?.THEME_COLOR_LIMIT??12,_=s%k-1,x=r.append("g");e.section=_,x.attr("class",(e.class?e.class+" ":"")+"timeline-node "+("section-"+_));let w=x.append("g"),a=x.append("g"),d=a.append("text").text(e.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(pt,e.width).node().getBBox(),m=i.fontSize?.replace?i.fontSize.replace("px",""):i.fontSize;if(e.height=d.height+m*1.1*0.5+e.padding,e.height=Math.max(e.height,e.maxHeight),e.width=e.width+2*e.padding,a.attr("transform","translate("+e.width/2+", "+e.padding/2+")"),b)a.attr("transform",`translate(${e.width/2}, ${u?e.padding/2+3:e.padding})`);if(Jt(w,e,_,n,i),o==="neo"){if(x.attr("data-look","neo"),b){let v=c.includes("dark"),y=r.node()?.ownerSVGElement??r.node(),N=h(y),S=N.attr("id")??"",W=S?`${S}-drop-shadow`:"drop-shadow";if(N.select(`#${W}`).empty()){let G=N.select("defs");(G.empty()?N.append("defs"):G).append("filter").attr("id",W).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity",v?"0.2":"0.06").attr("flood-color",v?"#FFFFFF":"#000000")}}}return e},"drawNode"),qt=t(function(r,e,s){let i=r.append("g"),u=i.append("text").text(e.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(pt,e.width).node().getBBox(),c=s.fontSize?.replace?s.fontSize.replace("px",""):s.fontSize;return i.remove(),u.height+c*1.1*0.5+e.padding},"getVirtualNodeHeight"),Jt=t(function(r,e,s,i,n){let{theme:u}=n,c=u?.includes("redux")?0:5,o=5,b=c>0?`M0 ${e.height-5} v${-e.height+10} q0,-${c},${c},-${c} h${e.width-10} q${c},0,${c},${c} v${e.height-5} H0 Z`:`M0 ${e.height-5} v${-(e.height-5)} h${e.width} v${e.height} H0 Z`;if(r.append("path").attr("id",i+"-node-"+At++).attr("class","node-bkg node-"+e.type).attr("d",b),!u?.includes("redux"))r.append("line").attr("class","node-line-"+s).attr("x1",0).attr("y1",e.height).attr("x2",e.width).attr("y2",e.height)},"defaultBkg"),z={drawRect:it,drawCircle:Ot,drawSection:Dt,drawText:Ct,drawLabel:Gt,drawTask:Kt,drawBackgroundRect:Ut,getTextObj:Xt,getNoteRect:ut,initGraphics:Zt,drawNode:jt,getVirtualNodeHeight:qt},Qt=t(function(r,e,s,i){let n=p(),{look:u,theme:c,themeVariables:o}=n,{useGradient:b,gradientStart:k,gradientStop:_}=o,x=n.timeline?.leftMargin??50;l.debug("timeline",i.db);let w=n.securityLevel,a;if(w==="sandbox")a=h("#i"+e);let d=(w==="sandbox"?h(a.nodes()[0].contentDocument.body):h("body")).select("#"+e);d.append("g");let m=i.db.getTasks(),v=i.db.getCommonDb().getDiagramTitle();l.debug("task",m),z.initGraphics(d,e);let y=i.db.getSections();l.debug("sections",y);let N=0,S=0,W=0,G=0,D=50+x,q=50;G=50;let B=0,O=!0;y.forEach(function(M){let T={number:B,descr:M,section:B,width:150,padding:20,maxHeight:N},L=z.getVirtualNodeHeight(d,T,n);l.debug("sectionHeight before draw",L),N=Math.max(N,L+20)});let H=0,F=0;l.debug("tasks.length",m.length);for(let[M,T]of m.entries()){let L={number:M,descr:T,section:T.section,width:150,padding:20,maxHeight:S},I=z.getVirtualNodeHeight(d,L,n);l.debug("taskHeight before draw",I),S=Math.max(S,I+20),H=Math.max(H,T.events.length);let P=0;for(let V of T.events){let C={descr:V,section:T.section,number:T.section,width:150,padding:20,maxHeight:50};P+=z.getVirtualNodeHeight(d,C,n)}if(T.events.length>0)P+=(T.events.length-1)*10;F=Math.max(F,P)}if(l.debug("maxSectionHeight before draw",N),l.debug("maxTaskHeight before draw",S),y&&y.length>0)y.forEach((M)=>{let T=m.filter((V)=>V.section===M),L={number:B,descr:M,section:B,width:200*Math.max(T.length,1)-50,padding:20,maxHeight:N};l.debug("sectionNode",L);let I=d.append("g"),P=z.drawNode(I,L,B,n,e);if(l.debug("sectionNode output",P),I.attr("transform",`translate(${D}, ${G})`),q+=N+50,T.length>0)mt(d,T,B,D,q,S,n,H,F,N,!1,e);D+=200*Math.max(T.length,1),q=G,B++});else O=!1,mt(d,m,B,D,q,S,n,H,F,N,!0,e);let U=d.node().getBBox();if(l.debug("bounds",U),v)d.append("text").text(v).attr("x",u==="neo"?U.x*2+x:U.width/2-x).attr("font-size","4ex").attr("font-weight","bold").attr("y",20);if(W=O?N+S+150:S+100,d.append("g").attr("class","lineWrapper").append("line").attr("x1",x).attr("y1",W).attr("x2",U.width+3*x).attr("y2",W).attr("stroke-width",4).attr("stroke","black").attr("marker-end",`url(#${e}-arrowhead)`),u==="neo"&&b&&c!=="neutral"){let M=d.select("defs"),L=(M.empty()?d.append("defs"):M).append("linearGradient").attr("id",d.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");L.append("stop").attr("offset","0%").attr("stop-color",k).attr("stop-opacity",1),L.append("stop").attr("offset","100%").attr("stop-color",_).attr("stop-opacity",1)}Fr(void 0,d,n.timeline?.padding??50,n.timeline?.useMaxWidth??!1)},"draw"),mt=t(function(r,e,s,i,n,u,c,o,b,k,_,x){for(let w of e){let a={descr:w.task,section:s,number:s,width:150,padding:20,maxHeight:u};l.debug("taskNode",a);let f=r.append("g").attr("class","taskWrapper"),m=z.drawNode(f,a,s,c,x).height;if(l.debug("taskHeight after draw",m),f.attr("transform",`translate(${i}, ${n})`),u=Math.max(u,m),w.events){let v=r.append("g").attr("class","lineWrapper"),y=u;n+=100,y=y+Yt(r,w.events,s,i,n,c,x),n-=100,v.append("line").attr("x1",i+95).attr("y1",n+u).attr("x2",i+95).attr("y2",n+u+100+b+100).attr("stroke-width",2).attr("stroke","black").attr("marker-end",`url(#${x}-arrowhead)`).attr("stroke-dasharray","5,5")}if(i=i+200,_&&!c.timeline?.disableMulticolor)s++}n=n-10},"drawTasks"),Yt=t(function(r,e,s,i,n,u,c){let o=0,b=n;n=n+100;for(let k of e){let _={descr:k,section:s,number:s,width:150,padding:20,maxHeight:50};l.debug("eventNode",_);let x=r.append("g").attr("class","eventWrapper"),a=z.drawNode(x,_,s,u,c,!0).height;o=o+a,x.attr("transform",`translate(${i}, ${n})`),n=n+10+a}return n=b,o},"drawEvents"),te={setConf:t(()=>{},"setConf"),draw:Qt},st=200,Z=5,ee=st+Z*2,gt=st+100,re=gt+Z*2,Wt=10,ne=0,kt=20,Pt=20,xt=30,Bt=50,ie=t(function(r,e,s,i){let n=p(),u=n.timeline?.leftMargin??50;l.debug("timeline",i.db);let c=de(e);c.append("g");let o=i.db.getTasks(),b=i.db.getCommonDb().getDiagramTitle();l.debug("task",o),z.initGraphics(c);let k=i.db.getSections();l.debug("sections",k);let _=0,x=0,w=50+u,a=50,f=a,d=w,m=ee+Pt,v=re+Bt,y=d+m,N=0,S=k&&k.length>0,W=S?y:w+m,G=Math.max(50,m+v-Z*2);k.forEach(function(M){let T={number:N,descr:M,section:N,width:G,padding:Z,maxHeight:_},L=z.getVirtualNodeHeight(c,T,n);l.debug("sectionHeight before draw",L),_=Math.max(_,L)});let D=0;l.debug("tasks.length",o.length);for(let[M,T]of o.entries()){let L={number:M,descr:T,section:T.section,width:st,padding:Z,maxHeight:x},I=z.getVirtualNodeHeight(c,L,n);l.debug("taskHeight before draw",I),x=Math.max(x,I);let P=0;for(let V of T.events){let C={descr:V,section:T.section,number:T.section,width:gt,padding:Z,maxHeight:50};P+=z.getVirtualNodeHeight(c,C,n)}if(T.events.length>0)P+=(T.events.length-1)*Wt;D=Math.max(D,P)+ne}l.debug("maxSectionHeight before draw",_),l.debug("maxTaskHeight before draw",x);let B=Math.max(x,D)+xt;if(S)k.forEach((M)=>{let T=o.filter((j)=>j.section===M),L={number:N,descr:M,section:N,width:G,padding:Z,maxHeight:_};l.debug("sectionNode",L);let I=c.append("g"),P=z.drawNode(I,L,N,n);l.debug("sectionNode output",P);let V=W-m;I.attr("transform",`translate(${V}, ${a})`);let C=a+P.height+kt;if(T.length>0)bt(c,T,N,W,C,x,n,B,!1);let at=T.length,tt=P.height+kt+B*Math.max(at,1)-(at>0?xt*2:0);a+=tt,N++});else bt(c,o,N,W,a,x,n,B,!0);let O=c.node()?.getBBox();if(!O)throw Error("bbox not found");if(l.debug("bounds",O),b){if(c.append("text").text(b).attr("x",O.width/2-u).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),O=c.node()?.getBBox(),!O)throw Error("bbox not found");l.debug("bounds after title",O)}let[H]=kn(n.fontSize),F=(H??16)*2,U=(H??16)*0.5+20,J=c.append("g").attr("class","lineWrapper");J.append("line").attr("x1",W).attr("y1",f-F).attr("x2",W).attr("y2",O.y+O.height+U).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)"),J.lower(),Fr(void 0,c,n.timeline?.padding??50,n.timeline?.useMaxWidth??!1)},"draw"),bt=t(function(r,e,s,i,n,u,c,o,b){for(let k of e){let _={descr:k.task,section:s,number:s,width:st,padding:Z,maxHeight:u};l.debug("taskNode",_);let x=r.append("g").attr("class","taskWrapper"),w=z.drawNode(x,_,s,c),a=w.height;l.debug("taskHeight after draw",a);let f=i-Pt-w.width;if(x.attr("transform",`translate(${f}, ${n})`),u=Math.max(u,a),k.events&&k.events.length>0){let d=n,m=i+Bt;se(r,k.events,s,i,m,d,c)}if(n=n+o,b&&!c.timeline?.disableMulticolor)s++}},"drawTasks"),se=t(function(r,e,s,i,n,u,c){let o=u;for(let b of e){let k={descr:b,section:s,number:s,width:gt,padding:Z,maxHeight:0};l.debug("eventNode",k);let _=r.append("g").attr("class","eventWrapper"),w=z.drawNode(_,k,s,c).height;_.attr("transform",`translate(${n}, ${o})`);let a=r.append("g").attr("class","lineWrapper"),f=o+w/2;a.append("line").attr("x1",i).attr("y1",f).attr("x2",n).attr("y2",f).attr("stroke-width",2).attr("stroke","black").attr("marker-end","url(#arrowhead)").attr("stroke-dasharray","5,5"),o=o+w+Wt}return o-u},"drawEvents"),ae={setConf:t(()=>{},"setConf"),draw:ie},oe=t((r)=>{let{theme:e}=E(),s=e?.includes("dark"),i=Ye(e,r.borderColorArray),n=r.svgId?.replace(/^#/,"")??"",u=n?`url(#${n}-drop-shadow)`:r.dropShadow??"none",c="";for(let o=0;o<zn(r.THEME_COLOR_LIMIT);o++){let b=`${17-3*o}`,k=i?r.borderColorArray[o%r.borderColorArray.length]:void 0,_=k??r.mainBkg,x=k??r.nodeBorder;c+=`
7
7
  .section-${o-1} rect,
8
8
  .section-${o-1} path,
9
9
  .section-${o-1} circle {
@@ -0,0 +1 @@
1
+ import{uf}from"./index-nb8tp4mj.js";export{uf as createTreeViewServices};
@@ -0,0 +1 @@
1
+ import{nf}from"./index-nb8tp4mj.js";export{nf as createTreemapServices};
@@ -0,0 +1 @@
1
+ import{xc}from"./index-jc1yagmk.js";export{xc as default};
@@ -0,0 +1 @@
1
+ import{Ea}from"./index-pnt0vc59.js";export{Ea as default};
@@ -1,10 +1,10 @@
1
- import{t,l,K,E,X,R,L,z,O,U,j,G,p,h,W,up,st,Ye,Je,Mr,_t,St,Tt,lt}from"./index-fta1y9pc.js";import{dn}from"./index-pm6xxwz1.js";var ks={};dn(ks,{default:()=>pt});var Ms={};dn(Ms,{default:()=>He});var Bs={};dn(Bs,{default:()=>ri});var df=typeof global=="object"&&global&&global.Object===Object&&global,bs=df;var pf=typeof self=="object"&&self&&self.Object===Object&&self,mf=bs||pf||Function("return this")(),pe=mf;var gf=pe.Symbol,Oe=gf;var to=Object.prototype,{hasOwnProperty:Tf,toString:Ef}=to,es=Oe?Oe.toStringTag:void 0;function yf(e){var r=Tf.call(e,es),s=e[es];try{e[es]=void 0;var n=!0}catch(o){}var i=Ef.call(e);if(n)if(r)e[es]=s;else delete e[es];return i}var ro=yf;var Af=Object.prototype,xf=Af.toString;function Sf(e){return xf.call(e)}var so=Sf;var Rf="[object Null]",Of="[object Undefined]",no=Oe?Oe.toStringTag:void 0;function Lf(e){if(e==null)return e===void 0?Of:Rf;return no&&no in Object(e)?ro(e):so(e)}var Pe=Lf;function If(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}var ne=If;var Nf="[object AsyncFunction]",bf="[object Function]",Cf="[object GeneratorFunction]",vf="[object Proxy]";function kf(e){if(!ne(e))return!1;var r=Pe(e);return r==bf||r==Cf||r==Nf||r==vf}var Ue=kf;var _f=pe["__core-js_shared__"],Cs=_f;var io=function(){var e=/[^.]+$/.exec(Cs&&Cs.keys&&Cs.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Mf(e){return!!io&&io in e}var oo=Mf;var wf=Function.prototype,Pf=wf.toString;function Uf(e){if(e!=null){try{return Pf.call(e)}catch(r){}try{return e+""}catch(r){}}return""}var It=Uf;var Df=/[\\^$.*+?()[\]{}|]/g,Ff=/^\[object .+?Constructor\]$/,Bf=Function.prototype,$f=Object.prototype,Gf=Bf.toString,Wf=$f.hasOwnProperty,jf=RegExp("^"+Gf.call(Wf).replace(Df,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Kf(e){if(!ne(e)||oo(e))return!1;var r=Ue(e)?jf:Ff;return r.test(It(e))}var ao=Kf;function zf(e,r){return e==null?void 0:e[r]}var lo=zf;function Vf(e,r){var s=lo(e,r);return ao(s)?s:void 0}var $e=Vf;var Hf=function(){try{var e=$e(Object,"defineProperty");return e({},"",{}),e}catch(r){}}(),hr=Hf;function Yf(e,r,s){if(r=="__proto__"&&hr)hr(e,r,{configurable:!0,enumerable:!0,value:s,writable:!0});else e[r]=s}var dr=Yf;function Xf(e,r){return e===r||e!==e&&r!==r}var ft=Xf;var qf=Object.prototype,Jf=qf.hasOwnProperty;function Zf(e,r,s){var n=e[r];if(!(Jf.call(e,r)&&ft(n,s))||s===void 0&&!(r in e))dr(e,r,s)}var Ut=Zf;function Qf(e,r,s,n){var i=!s;s||(s={});var o=-1,c=r.length;while(++o<c){var u=r[o],a=n?n(s[u],e[u],u,s,e):void 0;if(a===void 0)a=e[u];if(i)dr(s,u,a);else Ut(s,u,a)}return s}var ht=Qf;function eh(e){return e}var nt=eh;function th(e,r,s){switch(s.length){case 0:return e.call(r);case 1:return e.call(r,s[0]);case 2:return e.call(r,s[0],s[1]);case 3:return e.call(r,s[0],s[1],s[2])}return e.apply(r,s)}var co=th;var uo=Math.max;function rh(e,r,s){return r=uo(r===void 0?e.length-1:r,0),function(){var n=arguments,i=-1,o=uo(n.length-r,0),c=Array(o);while(++i<o)c[i]=n[r+i];i=-1;var u=Array(r+1);while(++i<r)u[i]=n[i];return u[r]=s(c),co(e,this,u)}}var fo=rh;function sh(e){return function(){return e}}var ho=sh;var nh=!hr?nt:function(e,r){return hr(e,"toString",{configurable:!0,enumerable:!1,value:ho(r),writable:!0})},po=nh;var ih=800,oh=16,ah=Date.now;function lh(e){var r=0,s=0;return function(){var n=ah(),i=oh-(n-s);if(s=n,i>0){if(++r>=ih)return arguments[0]}else r=0;return e.apply(void 0,arguments)}}var mo=lh;var ch=mo(po),go=ch;function uh(e,r){return go(fo(e,r,nt),e+"")}var pr=uh;var fh=9007199254740991;function hh(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=fh}var mr=hh;function dh(e){return e!=null&&mr(e.length)&&!Ue(e)}var me=dh;var ph=9007199254740991,mh=/^(?:0|[1-9]\d*)$/;function gh(e,r){var s=typeof e;return r=r==null?ph:r,!!r&&(s=="number"||s!="symbol"&&mh.test(e))&&(e>-1&&e%1==0&&e<r)}var Dt=gh;function Th(e,r,s){if(!ne(s))return!1;var n=typeof r;if(n=="number"?me(s)&&Dt(r,s.length):n=="string"&&(r in s))return ft(s[r],e);return!1}var Ft=Th;function Eh(e){return pr(function(r,s){var n=-1,i=s.length,o=i>1?s[i-1]:void 0,c=i>2?s[2]:void 0;if(o=e.length>3&&typeof o=="function"?(i--,o):void 0,c&&Ft(s[0],s[1],c))o=i<3?void 0:o,i=1;r=Object(r);while(++n<i){var u=s[n];if(u)e(r,u,n,o)}return r})}var To=Eh;var yh=Object.prototype;function Ah(e){var r=e&&e.constructor,s=typeof r=="function"&&r.prototype||yh;return e===s}var dt=Ah;function xh(e,r){var s=-1,n=Array(e);while(++s<e)n[s]=r(s);return n}var Eo=xh;function Sh(e){return e!=null&&typeof e=="object"}var ue=Sh;var Rh="[object Arguments]";function Oh(e){return ue(e)&&Pe(e)==Rh}var Qn=Oh;var yo=Object.prototype,{hasOwnProperty:Lh,propertyIsEnumerable:Ih}=yo,Nh=Qn(function(){return arguments}())?Qn:function(e){return ue(e)&&Lh.call(e,"callee")&&!Ih.call(e,"callee")},Bt=Nh;var bh=Array.isArray,b=bh;function Ch(){return!1}var Ao=Ch;var Ro=typeof ks=="object"&&ks&&!ks.nodeType&&ks,xo=Ro&&typeof vs=="object"&&vs&&!vs.nodeType&&vs,vh=xo&&xo.exports===Ro,So=vh?pe.Buffer:void 0,kh=So?So.isBuffer:void 0,_h=kh||Ao,pt=_h;var Mh="[object Arguments]",wh="[object Array]",Ph="[object Boolean]",Uh="[object Date]",Dh="[object Error]",Fh="[object Function]",Bh="[object Map]",$h="[object Number]",Gh="[object Object]",Wh="[object RegExp]",jh="[object Set]",Kh="[object String]",zh="[object WeakMap]",Vh="[object ArrayBuffer]",Hh="[object DataView]",Yh="[object Float32Array]",Xh="[object Float64Array]",qh="[object Int8Array]",Jh="[object Int16Array]",Zh="[object Int32Array]",Qh="[object Uint8Array]",ed="[object Uint8ClampedArray]",td="[object Uint16Array]",rd="[object Uint32Array]",J={};J[Yh]=J[Xh]=J[qh]=J[Jh]=J[Zh]=J[Qh]=J[ed]=J[td]=J[rd]=!0;J[Mh]=J[wh]=J[Vh]=J[Ph]=J[Hh]=J[Uh]=J[Dh]=J[Fh]=J[Bh]=J[$h]=J[Gh]=J[Wh]=J[jh]=J[Kh]=J[zh]=!1;function sd(e){return ue(e)&&mr(e.length)&&!!J[Pe(e)]}var Oo=sd;function nd(e){return function(r){return e(r)}}var mt=nd;var Lo=typeof Ms=="object"&&Ms&&!Ms.nodeType&&Ms,ts=Lo&&typeof _s=="object"&&_s&&!_s.nodeType&&_s,id=ts&&ts.exports===Lo,ei=id&&bs.process,od=function(){try{var e=ts&&ts.require&&ts.require("util").types;if(e)return e;return ei&&ei.binding&&ei.binding("util")}catch(r){}}(),He=od;var Io=He&&He.isTypedArray,ad=Io?mt(Io):Oo,gr=ad;var ld=Object.prototype,cd=ld.hasOwnProperty;function ud(e,r){var s=b(e),n=!s&&Bt(e),i=!s&&!n&&pt(e),o=!s&&!n&&!i&&gr(e),c=s||n||i||o,u=c?Eo(e.length,String):[],a=u.length;for(var f in e)if((r||cd.call(e,f))&&!(c&&(f=="length"||i&&(f=="offset"||f=="parent")||o&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||Dt(f,a))))u.push(f);return u}var ws=ud;function fd(e,r){return function(s){return e(r(s))}}var Ps=fd;var hd=Ps(Object.keys,Object),No=hd;var dd=Object.prototype,pd=dd.hasOwnProperty;function md(e){if(!dt(e))return No(e);var r=[];for(var s in Object(e))if(pd.call(e,s)&&s!="constructor")r.push(s);return r}var Us=md;function gd(e){return me(e)?ws(e):Us(e)}var H=gd;var Td=Object.prototype,Ed=Td.hasOwnProperty,yd=To(function(e,r){if(dt(r)||me(r)){ht(r,H(r),e);return}for(var s in r)if(Ed.call(r,s))Ut(e,s,r[s])}),Ne=yd;function Ad(){this.__data__=[],this.size=0}var bo=Ad;function xd(e,r){var s=e.length;while(s--)if(ft(e[s][0],r))return s;return-1}var $t=xd;var Sd=Array.prototype,Rd=Sd.splice;function Od(e){var r=this.__data__,s=$t(r,e);if(s<0)return!1;var n=r.length-1;if(s==n)r.pop();else Rd.call(r,s,1);return--this.size,!0}var Co=Od;function Ld(e){var r=this.__data__,s=$t(r,e);return s<0?void 0:r[s][1]}var vo=Ld;function Id(e){return $t(this.__data__,e)>-1}var ko=Id;function Nd(e,r){var s=this.__data__,n=$t(s,e);if(n<0)++this.size,s.push([e,r]);else s[n][1]=r;return this}var _o=Nd;function Tr(e){var r=-1,s=e==null?0:e.length;this.clear();while(++r<s){var n=e[r];this.set(n[0],n[1])}}Tr.prototype.clear=bo;Tr.prototype.delete=Co;Tr.prototype.get=vo;Tr.prototype.has=ko;Tr.prototype.set=_o;var Gt=Tr;function bd(){this.__data__=new Gt,this.size=0}var Mo=bd;function Cd(e){var r=this.__data__,s=r.delete(e);return this.size=r.size,s}var wo=Cd;function vd(e){return this.__data__.get(e)}var Po=vd;function kd(e){return this.__data__.has(e)}var Uo=kd;var _d=$e(pe,"Map"),Wt=_d;var Md=$e(Object,"create"),Nt=Md;function wd(){this.__data__=Nt?Nt(null):{},this.size=0}var Do=wd;function Pd(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}var Fo=Pd;var Ud="__lodash_hash_undefined__",Dd=Object.prototype,Fd=Dd.hasOwnProperty;function Bd(e){var r=this.__data__;if(Nt){var s=r[e];return s===Ud?void 0:s}return Fd.call(r,e)?r[e]:void 0}var Bo=Bd;var $d=Object.prototype,Gd=$d.hasOwnProperty;function Wd(e){var r=this.__data__;return Nt?r[e]!==void 0:Gd.call(r,e)}var $o=Wd;var jd="__lodash_hash_undefined__";function Kd(e,r){var s=this.__data__;return this.size+=this.has(e)?0:1,s[e]=Nt&&r===void 0?jd:r,this}var Go=Kd;function Er(e){var r=-1,s=e==null?0:e.length;this.clear();while(++r<s){var n=e[r];this.set(n[0],n[1])}}Er.prototype.clear=Do;Er.prototype.delete=Fo;Er.prototype.get=Bo;Er.prototype.has=$o;Er.prototype.set=Go;var ti=Er;function zd(){this.size=0,this.__data__={hash:new ti,map:new(Wt||Gt),string:new ti}}var Wo=zd;function Vd(e){var r=typeof e;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?e!=="__proto__":e===null}var jo=Vd;function Hd(e,r){var s=e.__data__;return jo(r)?s[typeof r=="string"?"string":"hash"]:s.map}var jt=Hd;function Yd(e){var r=jt(this,e).delete(e);return this.size-=r?1:0,r}var Ko=Yd;function Xd(e){return jt(this,e).get(e)}var zo=Xd;function qd(e){return jt(this,e).has(e)}var Vo=qd;function Jd(e,r){var s=jt(this,e),n=s.size;return s.set(e,r),this.size+=s.size==n?0:1,this}var Ho=Jd;function yr(e){var r=-1,s=e==null?0:e.length;this.clear();while(++r<s){var n=e[r];this.set(n[0],n[1])}}yr.prototype.clear=Wo;yr.prototype.delete=Ko;yr.prototype.get=zo;yr.prototype.has=Vo;yr.prototype.set=Ho;var er=yr;var Zd=200;function Qd(e,r){var s=this.__data__;if(s instanceof Gt){var n=s.__data__;if(!Wt||n.length<Zd-1)return n.push([e,r]),this.size=++s.size,this;s=this.__data__=new er(n)}return s.set(e,r),this.size=s.size,this}var Yo=Qd;function Ar(e){var r=this.__data__=new Gt(e);this.size=r.size}Ar.prototype.clear=Mo;Ar.prototype.delete=wo;Ar.prototype.get=Po;Ar.prototype.has=Uo;Ar.prototype.set=Yo;var Kt=Ar;function ep(e,r){var s=-1,n=e==null?0:e.length;while(++s<n)if(r(e[s],s,e)===!1)break;return e}var Ds=ep;function tp(e,r){return e&&ht(r,H(r),e)}var Xo=tp;function rp(e){var r=[];if(e!=null)for(var s in Object(e))r.push(s);return r}var qo=rp;var sp=Object.prototype,np=sp.hasOwnProperty;function ip(e){if(!ne(e))return qo(e);var r=dt(e),s=[];for(var n in e)if(!(n=="constructor"&&(r||!np.call(e,n))))s.push(n);return s}var Jo=ip;function op(e){return me(e)?ws(e,!0):Jo(e)}var zt=op;function ap(e,r){return e&&ht(r,zt(r),e)}var Zo=ap;var ra=typeof Bs=="object"&&Bs&&!Bs.nodeType&&Bs,Qo=ra&&typeof Fs=="object"&&Fs&&!Fs.nodeType&&Fs,lp=Qo&&Qo.exports===ra,ea=lp?pe.Buffer:void 0,ta=ea?ea.allocUnsafe:void 0;function cp(e,r){if(r)return e.slice();var s=e.length,n=ta?ta(s):new e.constructor(s);return e.copy(n),n}var ri=cp;function fp(e,r){var s=-1,n=e.length;r||(r=Array(n));while(++s<n)r[s]=e[s];return r}var sa=fp;function hp(e,r){var s=-1,n=e==null?0:e.length,i=0,o=[];while(++s<n){var c=e[s];if(r(c,s,e))o[i++]=c}return o}var xr=hp;function dp(){return[]}var $s=dp;var pp=Object.prototype,mp=pp.propertyIsEnumerable,na=Object.getOwnPropertySymbols,gp=!na?$s:function(e){if(e==null)return[];return e=Object(e),xr(na(e),function(r){return mp.call(e,r)})},Sr=gp;function Tp(e,r){return ht(e,Sr(e),r)}var ia=Tp;function Ep(e,r){var s=-1,n=r.length,i=e.length;while(++s<n)e[i+s]=r[s];return e}var Rr=Ep;var yp=Ps(Object.getPrototypeOf,Object),Gs=yp;var Ap=Object.getOwnPropertySymbols,xp=!Ap?$s:function(e){var r=[];while(e)Rr(r,Sr(e)),e=Gs(e);return r},Ws=xp;function Sp(e,r){return ht(e,Ws(e),r)}var oa=Sp;function Rp(e,r,s){var n=r(e);return b(e)?n:Rr(n,s(e))}var js=Rp;function Op(e){return js(e,H,Sr)}var rs=Op;function Lp(e){return js(e,zt,Ws)}var Ks=Lp;var Ip=$e(pe,"DataView"),zs=Ip;var Np=$e(pe,"Promise"),Vs=Np;var bp=$e(pe,"Set"),Vt=bp;var Cp=$e(pe,"WeakMap"),Hs=Cp;var aa="[object Map]",vp="[object Object]",la="[object Promise]",ca="[object Set]",ua="[object WeakMap]",fa="[object DataView]",kp=It(zs),_p=It(Wt),Mp=It(Vs),wp=It(Vt),Pp=It(Hs),tr=Pe;if(zs&&tr(new zs(new ArrayBuffer(1)))!=fa||Wt&&tr(new Wt)!=aa||Vs&&tr(Vs.resolve())!=la||Vt&&tr(new Vt)!=ca||Hs&&tr(new Hs)!=ua)tr=function(e){var r=Pe(e),s=r==vp?e.constructor:void 0,n=s?It(s):"";if(n)switch(n){case kp:return fa;case _p:return aa;case Mp:return la;case wp:return ca;case Pp:return ua}return r};var it=tr;var Up=Object.prototype,Dp=Up.hasOwnProperty;function Fp(e){var r=e.length,s=new e.constructor(r);if(r&&typeof e[0]=="string"&&Dp.call(e,"index"))s.index=e.index,s.input=e.input;return s}var ha=Fp;var Bp=pe.Uint8Array,Or=Bp;function $p(e){var r=new e.constructor(e.byteLength);return new Or(r).set(new Or(e)),r}var Lr=$p;function Gp(e,r){var s=r?Lr(e.buffer):e.buffer;return new e.constructor(s,e.byteOffset,e.byteLength)}var da=Gp;var Wp=/\w*$/;function jp(e){var r=new e.constructor(e.source,Wp.exec(e));return r.lastIndex=e.lastIndex,r}var pa=jp;var ma=Oe?Oe.prototype:void 0,ga=ma?ma.valueOf:void 0;function Kp(e){return ga?Object(ga.call(e)):{}}var Ta=Kp;function zp(e,r){var s=r?Lr(e.buffer):e.buffer;return new e.constructor(s,e.byteOffset,e.length)}var Ea=zp;var Vp="[object Boolean]",Hp="[object Date]",Yp="[object Map]",Xp="[object Number]",qp="[object RegExp]",Jp="[object Set]",Zp="[object String]",Qp="[object Symbol]",em="[object ArrayBuffer]",tm="[object DataView]",rm="[object Float32Array]",sm="[object Float64Array]",nm="[object Int8Array]",im="[object Int16Array]",om="[object Int32Array]",am="[object Uint8Array]",lm="[object Uint8ClampedArray]",cm="[object Uint16Array]",um="[object Uint32Array]";function fm(e,r,s){var n=e.constructor;switch(r){case em:return Lr(e);case Vp:case Hp:return new n(+e);case tm:return da(e,s);case rm:case sm:case nm:case im:case om:case am:case lm:case cm:case um:return Ea(e,s);case Yp:return new n;case Xp:case Zp:return new n(e);case qp:return pa(e);case Jp:return new n;case Qp:return Ta(e)}}var ya=fm;var Aa=Object.create,hm=function(){function e(){}return function(r){if(!ne(r))return{};if(Aa)return Aa(r);e.prototype=r;var s=new e;return e.prototype=void 0,s}}(),xa=hm;function dm(e){return typeof e.constructor=="function"&&!dt(e)?xa(Gs(e)):{}}var Sa=dm;var pm="[object Map]";function mm(e){return ue(e)&&it(e)==pm}var Ra=mm;var Oa=He&&He.isMap,gm=Oa?mt(Oa):Ra,La=gm;var Tm="[object Set]";function Em(e){return ue(e)&&it(e)==Tm}var Ia=Em;var Na=He&&He.isSet,ym=Na?mt(Na):Ia,ba=ym;var Am=1,xm=2,Sm=4,Ca="[object Arguments]",Rm="[object Array]",Om="[object Boolean]",Lm="[object Date]",Im="[object Error]",va="[object Function]",Nm="[object GeneratorFunction]",bm="[object Map]",Cm="[object Number]",ka="[object Object]",vm="[object RegExp]",km="[object Set]",_m="[object String]",Mm="[object Symbol]",wm="[object WeakMap]",Pm="[object ArrayBuffer]",Um="[object DataView]",Dm="[object Float32Array]",Fm="[object Float64Array]",Bm="[object Int8Array]",$m="[object Int16Array]",Gm="[object Int32Array]",Wm="[object Uint8Array]",jm="[object Uint8ClampedArray]",Km="[object Uint16Array]",zm="[object Uint32Array]",Y={};Y[Ca]=Y[Rm]=Y[Pm]=Y[Um]=Y[Om]=Y[Lm]=Y[Dm]=Y[Fm]=Y[Bm]=Y[$m]=Y[Gm]=Y[bm]=Y[Cm]=Y[ka]=Y[vm]=Y[km]=Y[_m]=Y[Mm]=Y[Wm]=Y[jm]=Y[Km]=Y[zm]=!0;Y[Im]=Y[va]=Y[wm]=!1;function Ys(e,r,s,n,i,o){var c,u=r&Am,a=r&xm,f=r&Sm;if(s)c=i?s(e,n,i,o):s(e);if(c!==void 0)return c;if(!ne(e))return e;var d=b(e);if(d){if(c=ha(e),!u)return sa(e,c)}else{var m=it(e),g=m==va||m==Nm;if(pt(e))return ri(e,u);if(m==ka||m==Ca||g&&!i){if(c=a||g?{}:Sa(e),!u)return a?oa(e,Zo(c,e)):ia(e,Xo(c,e))}else{if(!Y[m])return i?e:{};c=ya(e,m,u)}}o||(o=new Kt);var y=o.get(e);if(y)return y;if(o.set(e,c),ba(e))e.forEach(function(C){c.add(Ys(C,r,s,C,e,o))});else if(La(e))e.forEach(function(C,x){c.set(x,Ys(C,r,s,x,e,o))});var k=f?a?Ks:rs:a?zt:H,_=d?void 0:k(e);return Ds(_||e,function(C,x){if(_)x=C,C=e[x];Ut(c,x,Ys(C,r,s,x,e,o))}),c}var _a=Ys;var Vm=4;function Hm(e){return _a(e,Vm)}var q=Hm;function Ym(e){var r=-1,s=e==null?0:e.length,n=0,i=[];while(++r<s){var o=e[r];if(o)i[n++]=o}return i}var gt=Ym;var Ma=Object.prototype,Xm=Ma.hasOwnProperty,qm=pr(function(e,r){e=Object(e);var s=-1,n=r.length,i=n>2?r[2]:void 0;if(i&&Ft(r[0],r[1],i))n=1;while(++s<n){var o=r[s],c=zt(o),u=-1,a=c.length;while(++u<a){var f=c[u],d=e[f];if(d===void 0||ft(d,Ma[f])&&!Xm.call(e,f))e[f]=o[f]}}return e}),Ir=qm;var Jm="__lodash_hash_undefined__";function Zm(e){return this.__data__.set(e,Jm),this}var wa=Zm;function Qm(e){return this.__data__.has(e)}var Pa=Qm;function Xs(e){var r=-1,s=e==null?0:e.length;this.__data__=new er;while(++r<s)this.add(e[r])}Xs.prototype.add=Xs.prototype.push=wa;Xs.prototype.has=Pa;var Nr=Xs;function eg(e,r,s,n){var i=e.length,o=s+(n?1:-1);while(n?o--:++o<i)if(r(e[o],o,e))return o;return-1}var qs=eg;function tg(e){return e!==e}var Ua=tg;function rg(e,r,s){var n=s-1,i=e.length;while(++n<i)if(e[n]===r)return n;return-1}var Da=rg;function sg(e,r,s){return r===r?Da(e,r,s):qs(e,Ua,s)}var br=sg;function ng(e,r){var s=e==null?0:e.length;return!!s&&br(e,r,0)>-1}var Js=ng;function ig(e,r,s){var n=-1,i=e==null?0:e.length;while(++n<i)if(s(r,e[n]))return!0;return!1}var Zs=ig;function og(e,r){var s=-1,n=e==null?0:e.length,i=Array(n);while(++s<n)i[s]=r(e[s],s,e);return i}var Et=og;function ag(e,r){return e.has(r)}var Cr=ag;var lg=200;function cg(e,r,s,n){var i=-1,o=Js,c=!0,u=e.length,a=[],f=r.length;if(!u)return a;if(s)r=Et(r,mt(s));if(n)o=Zs,c=!1;else if(r.length>=lg)o=Cr,c=!1,r=new Nr(r);e:while(++i<u){var d=e[i],m=s==null?d:s(d);if(d=n||d!==0?d:0,c&&m===m){var g=f;while(g--)if(r[g]===m)continue e;a.push(d)}else if(!o(r,m,n))a.push(d)}return a}var Fa=cg;var Ba=Oe?Oe.isConcatSpreadable:void 0;function ug(e){return b(e)||Bt(e)||!!(Ba&&e&&e[Ba])}var $a=ug;function Ga(e,r,s,n,i){var o=-1,c=e.length;s||(s=$a),i||(i=[]);while(++o<c){var u=e[o];if(r>0&&s(u))if(r>1)Ga(u,r-1,s,n,i);else Rr(i,u);else if(!n)i[i.length]=u}return i}var vr=Ga;function fg(e){return ue(e)&&me(e)}var si=fg;var hg=pr(function(e,r){return si(e)?Fa(e,vr(r,1,si,!0)):[]}),Ht=hg;function dg(e,r,s){var n=-1,i=e.length;if(r<0)r=-r>i?0:i+r;if(s=s>i?i:s,s<0)s+=i;i=r>s?0:s-r>>>0,r>>>=0;var o=Array(i);while(++n<i)o[n]=e[n+r];return o}var Qs=dg;var pg=/\s/;function mg(e){var r=e.length;while(r--&&pg.test(e.charAt(r)));return r}var Wa=mg;var gg=/^\s+/;function Tg(e){return e?e.slice(0,Wa(e)+1).replace(gg,""):e}var ja=Tg;var Eg="[object Symbol]";function yg(e){return typeof e=="symbol"||ue(e)&&Pe(e)==Eg}var Yt=yg;var Ka=NaN,Ag=/^[-+]0x[0-9a-f]+$/i,xg=/^0b[01]+$/i,Sg=/^0o[0-7]+$/i,Rg=parseInt;function Og(e){if(typeof e=="number")return e;if(Yt(e))return Ka;if(ne(e)){var r=typeof e.valueOf=="function"?e.valueOf():e;e=ne(r)?r+"":r}if(typeof e!="string")return e===0?e:+e;e=ja(e);var s=xg.test(e);return s||Sg.test(e)?Rg(e.slice(2),s?2:8):Ag.test(e)?Ka:+e}var za=Og;var Va=1/0,Lg=179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000;function Ig(e){if(!e)return e===0?e:0;if(e=za(e),e===Va||e===-Va){var r=e<0?-1:1;return r*Lg}return e===e?e:0}var Ha=Ig;function Ng(e){var r=Ha(e),s=r%1;return r===r?s?r-s:r:0}var yt=Ng;function bg(e,r,s){var n=e==null?0:e.length;if(!n)return[];return r=s||r===void 0?1:yt(r),Qs(e,r<0?0:r,n)}var fe=bg;function Cg(e,r,s){var n=e==null?0:e.length;if(!n)return[];return r=s||r===void 0?1:yt(r),r=n-r,Qs(e,0,r<0?0:r)}var bt=Cg;function vg(e,r){var s=-1,n=e==null?0:e.length;while(++s<n)if(!r(e[s],s,e))return!1;return!0}var Ya=vg;function kg(e){return function(r,s,n){var i=-1,o=Object(r),c=n(r),u=c.length;while(u--){var a=c[e?u:++i];if(s(o[a],a,o)===!1)break}return r}}var Xa=kg;var _g=Xa(),qa=_g;function Mg(e,r){return e&&qa(e,r,H)}var Ja=Mg;function wg(e,r){return function(s,n){if(s==null)return s;if(!me(s))return e(s,n);var i=s.length,o=r?i:-1,c=Object(s);while(r?o--:++o<i)if(n(c[o],o,c)===!1)break;return s}}var Za=wg;var Pg=Za(Ja),Ge=Pg;function Ug(e,r){var s=!0;return Ge(e,function(n,i,o){return s=!!r(n,i,o),s}),s}var Qa=Ug;function Dg(e,r){var s=-1,n=e==null?0:e.length;while(++s<n)if(r(e[s],s,e))return!0;return!1}var en=Dg;var Fg=1,Bg=2;function $g(e,r,s,n,i,o){var c=s&Fg,u=e.length,a=r.length;if(u!=a&&!(c&&a>u))return!1;var f=o.get(e),d=o.get(r);if(f&&d)return f==r&&d==e;var m=-1,g=!0,y=s&Bg?new Nr:void 0;o.set(e,r),o.set(r,e);while(++m<u){var k=e[m],_=r[m];if(n)var C=c?n(_,k,m,r,e,o):n(k,_,m,e,r,o);if(C!==void 0){if(C)continue;g=!1;break}if(y){if(!en(r,function(x,N){if(!Cr(y,N)&&(k===x||i(k,x,s,n,o)))return y.push(N)})){g=!1;break}}else if(!(k===_||i(k,_,s,n,o))){g=!1;break}}return o.delete(e),o.delete(r),g}var tn=$g;function Gg(e){var r=-1,s=Array(e.size);return e.forEach(function(n,i){s[++r]=[i,n]}),s}var el=Gg;function Wg(e){var r=-1,s=Array(e.size);return e.forEach(function(n){s[++r]=n}),s}var kr=Wg;var jg=1,Kg=2,zg="[object Boolean]",Vg="[object Date]",Hg="[object Error]",Yg="[object Map]",Xg="[object Number]",qg="[object RegExp]",Jg="[object Set]",Zg="[object String]",Qg="[object Symbol]",eT="[object ArrayBuffer]",tT="[object DataView]",tl=Oe?Oe.prototype:void 0,ni=tl?tl.valueOf:void 0;function rT(e,r,s,n,i,o,c){switch(s){case tT:if(e.byteLength!=r.byteLength||e.byteOffset!=r.byteOffset)return!1;e=e.buffer,r=r.buffer;case eT:if(e.byteLength!=r.byteLength||!o(new Or(e),new Or(r)))return!1;return!0;case zg:case Vg:case Xg:return ft(+e,+r);case Hg:return e.name==r.name&&e.message==r.message;case qg:case Zg:return e==r+"";case Yg:var u=el;case Jg:var a=n&jg;if(u||(u=kr),e.size!=r.size&&!a)return!1;var f=c.get(e);if(f)return f==r;n|=Kg,c.set(e,r);var d=tn(u(e),u(r),n,i,o,c);return c.delete(e),d;case Qg:if(ni)return ni.call(e)==ni.call(r)}return!1}var rl=rT;var sT=1,nT=Object.prototype,iT=nT.hasOwnProperty;function oT(e,r,s,n,i,o){var c=s&sT,u=rs(e),a=u.length,f=rs(r),d=f.length;if(a!=d&&!c)return!1;var m=a;while(m--){var g=u[m];if(!(c?g in r:iT.call(r,g)))return!1}var y=o.get(e),k=o.get(r);if(y&&k)return y==r&&k==e;var _=!0;o.set(e,r),o.set(r,e);var C=c;while(++m<a){g=u[m];var x=e[g],N=r[g];if(n)var T=c?n(N,x,g,r,e,o):n(x,N,g,e,r,o);if(!(T===void 0?x===N||i(x,N,s,n,o):T)){_=!1;break}C||(C=g=="constructor")}if(_&&!C){var w=e.constructor,ee=r.constructor;if(w!=ee&&(("constructor"in e)&&("constructor"in r))&&!(typeof w=="function"&&w instanceof w&&typeof ee=="function"&&ee instanceof ee))_=!1}return o.delete(e),o.delete(r),_}var sl=oT;var aT=1,nl="[object Arguments]",il="[object Array]",rn="[object Object]",lT=Object.prototype,ol=lT.hasOwnProperty;function cT(e,r,s,n,i,o){var c=b(e),u=b(r),a=c?il:it(e),f=u?il:it(r);a=a==nl?rn:a,f=f==nl?rn:f;var d=a==rn,m=f==rn,g=a==f;if(g&&pt(e)){if(!pt(r))return!1;c=!0,d=!1}if(g&&!d)return o||(o=new Kt),c||gr(e)?tn(e,r,s,n,i,o):rl(e,r,a,s,n,i,o);if(!(s&aT)){var y=d&&ol.call(e,"__wrapped__"),k=m&&ol.call(r,"__wrapped__");if(y||k){var _=y?e.value():e,C=k?r.value():r;return o||(o=new Kt),i(_,C,s,n,o)}}if(!g)return!1;return o||(o=new Kt),sl(e,r,s,n,i,o)}var al=cT;function ll(e,r,s,n,i){if(e===r)return!0;if(e==null||r==null||!ue(e)&&!ue(r))return e!==e&&r!==r;return al(e,r,s,n,ll,i)}var sn=ll;var uT=1,fT=2;function hT(e,r,s,n){var i=s.length,o=i,c=!n;if(e==null)return!o;e=Object(e);while(i--){var u=s[i];if(c&&u[2]?u[1]!==e[u[0]]:!(u[0]in e))return!1}while(++i<o){u=s[i];var a=u[0],f=e[a],d=u[1];if(c&&u[2]){if(f===void 0&&!(a in e))return!1}else{var m=new Kt;if(n)var g=n(f,d,a,e,r,m);if(!(g===void 0?sn(d,f,uT|fT,n,m):g))return!1}}return!0}var cl=hT;function dT(e){return e===e&&!ne(e)}var nn=dT;function pT(e){var r=H(e),s=r.length;while(s--){var n=r[s],i=e[n];r[s]=[n,i,nn(i)]}return r}var ul=pT;function mT(e,r){return function(s){if(s==null)return!1;return s[e]===r&&(r!==void 0||(e in Object(s)))}}var on=mT;function gT(e){var r=ul(e);if(r.length==1&&r[0][2])return on(r[0][0],r[0][1]);return function(s){return s===e||cl(s,e,r)}}var fl=gT;var TT=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ET=/^\w*$/;function yT(e,r){if(b(e))return!1;var s=typeof e;if(s=="number"||s=="symbol"||s=="boolean"||e==null||Yt(e))return!0;return ET.test(e)||!TT.test(e)||r!=null&&e in Object(r)}var _r=yT;var AT="Expected a function";function ii(e,r){if(typeof e!="function"||r!=null&&typeof r!="function")throw TypeError(AT);var s=function(){var n=arguments,i=r?r.apply(this,n):n[0],o=s.cache;if(o.has(i))return o.get(i);var c=e.apply(this,n);return s.cache=o.set(i,c)||o,c};return s.cache=new(ii.Cache||er),s}ii.Cache=er;var hl=ii;var xT=500;function ST(e){var r=hl(e,function(n){if(s.size===xT)s.clear();return n}),s=r.cache;return r}var dl=ST;var RT=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,OT=/\\(\\)?/g,LT=dl(function(e){var r=[];if(e.charCodeAt(0)===46)r.push("");return e.replace(RT,function(s,n,i,o){r.push(i?o.replace(OT,"$1"):n||s)}),r}),pl=LT;var IT=1/0,ml=Oe?Oe.prototype:void 0,gl=ml?ml.toString:void 0;function Tl(e){if(typeof e=="string")return e;if(b(e))return Et(e,Tl)+"";if(Yt(e))return gl?gl.call(e):"";var r=e+"";return r=="0"&&1/e==-IT?"-0":r}var El=Tl;function NT(e){return e==null?"":El(e)}var yl=NT;function bT(e,r){if(b(e))return e;return _r(e,r)?[e]:pl(yl(e))}var Xt=bT;var CT=1/0;function vT(e){if(typeof e=="string"||Yt(e))return e;var r=e+"";return r=="0"&&1/e==-CT?"-0":r}var At=vT;function kT(e,r){r=Xt(r,e);var s=0,n=r.length;while(e!=null&&s<n)e=e[At(r[s++])];return s&&s==n?e:void 0}var wr=kT;function _T(e,r,s){var n=e==null?void 0:wr(e,r);return n===void 0?s:n}var Al=_T;function MT(e,r){return e!=null&&r in Object(e)}var xl=MT;function wT(e,r,s){r=Xt(r,e);var n=-1,i=r.length,o=!1;while(++n<i){var c=At(r[n]);if(!(o=e!=null&&s(e,c)))break;e=e[c]}if(o||++n!=i)return o;return i=e==null?0:e.length,!!i&&mr(i)&&Dt(c,i)&&(b(e)||Bt(e))}var an=wT;function PT(e,r){return e!=null&&an(e,r,xl)}var Sl=PT;var UT=1,DT=2;function FT(e,r){if(_r(e)&&nn(r))return on(At(e),r);return function(s){var n=Al(s,e);return n===void 0&&n===r?Sl(s,e):sn(r,n,UT|DT)}}var Rl=FT;function BT(e){return function(r){return r==null?void 0:r[e]}}var Ol=BT;function $T(e){return function(r){return wr(r,e)}}var Ll=$T;function GT(e){return _r(e)?Ol(At(e)):Ll(e)}var Il=GT;function WT(e){if(typeof e=="function")return e;if(e==null)return nt;if(typeof e=="object")return b(e)?Rl(e[0],e[1]):fl(e);return Il(e)}var ge=WT;function jT(e,r,s){var n=b(e)?Ya:Qa;if(s&&Ft(e,r,s))r=void 0;return n(e,ge(r,3))}var ve=jT;function KT(e,r){var s=[];return Ge(e,function(n,i,o){if(r(n,i,o))s.push(n)}),s}var ln=KT;function zT(e,r){var s=b(e)?xr:ln;return s(e,ge(r,3))}var ke=zT;function VT(e){return function(r,s,n){var i=Object(r);if(!me(r)){var o=ge(s,3);r=H(r),s=function(u){return o(i[u],u,i)}}var c=e(r,s,n);return c>-1?i[o?r[c]:c]:void 0}}var Nl=VT;var HT=Math.max;function YT(e,r,s){var n=e==null?0:e.length;if(!n)return-1;var i=s==null?0:yt(s);if(i<0)i=HT(n+i,0);return qs(e,ge(r,3),i)}var bl=YT;var XT=Nl(bl),xt=XT;function qT(e){return e&&e.length?e[0]:void 0}var Le=qT;function JT(e,r){var s=-1,n=me(e)?Array(e.length):[];return Ge(e,function(i,o,c){n[++s]=r(i,o,c)}),n}var Cl=JT;function ZT(e,r){var s=b(e)?Et:Cl;return s(e,ge(r,3))}var A=ZT;function QT(e,r){return vr(A(e,r),1)}var De=QT;function eE(e){var r=e==null?0:e.length;return r?vr(e,1):[]}var xe=eE;function tE(e){return typeof e=="function"?e:nt}var vl=tE;function rE(e,r){var s=b(e)?Ds:Ge;return s(e,vl(r))}var S=rE;function sE(e,r,s,n){var i=-1,o=e==null?0:e.length;while(++i<o){var c=e[i];r(n,c,s(c),e)}return n}var kl=sE;function nE(e,r,s,n){return Ge(e,function(i,o,c){r(n,i,s(i),c)}),n}var _l=nE;function iE(e,r){return function(s,n){var i=b(s)?kl:_l,o=r?r():{};return i(s,e,ge(n,2),o)}}var Ml=iE;var oE=Object.prototype,aE=oE.hasOwnProperty,lE=Ml(function(e,r,s){if(aE.call(e,s))e[s].push(r);else dr(e,s,[r])}),oi=lE;var cE=Object.prototype,uE=cE.hasOwnProperty;function fE(e,r){return e!=null&&uE.call(e,r)}var wl=fE;function hE(e,r){return e!=null&&an(e,r,wl)}var I=hE;var dE="[object String]";function pE(e){return typeof e=="string"||!b(e)&&ue(e)&&Pe(e)==dE}var Se=pE;function mE(e,r){return Et(r,function(s){return e[s]})}var Pl=mE;function gE(e){return e==null?[]:Pl(e,H(e))}var V=gE;var TE=Math.max;function EE(e,r,s,n){e=me(e)?e:V(e),s=s&&!n?yt(s):0;var i=e.length;if(s<0)s=TE(i+s,0);return Se(e)?s<=i&&e.indexOf(r,s)>-1:!!i&&br(e,r,s)>-1}var te=EE;var yE=Math.max;function AE(e,r,s){var n=e==null?0:e.length;if(!n)return-1;var i=s==null?0:yt(s);if(i<0)i=yE(n+i,0);return br(e,r,i)}var cn=AE;var xE="[object Map]",SE="[object Set]",RE=Object.prototype,OE=RE.hasOwnProperty;function LE(e){if(e==null)return!0;if(me(e)&&(b(e)||typeof e=="string"||typeof e.splice=="function"||pt(e)||gr(e)||Bt(e)))return!e.length;var r=it(e);if(r==xE||r==SE)return!e.size;if(dt(e))return!Us(e).length;for(var s in e)if(OE.call(e,s))return!1;return!0}var P=LE;var IE="[object RegExp]";function NE(e){return ue(e)&&Pe(e)==IE}var Ul=NE;var Dl=He&&He.isRegExp,bE=Dl?mt(Dl):Ul,Ze=bE;function CE(e){return e===void 0}var _e=CE;function vE(e){var r=e==null?0:e.length;return r?e[r-1]:void 0}var ot=vE;function kE(){}var le=kE;function _E(e,r,s,n){if(!ne(e))return e;r=Xt(r,e);var i=-1,o=r.length,c=o-1,u=e;while(u!=null&&++i<o){var a=At(r[i]),f=s;if(a==="__proto__"||a==="constructor"||a==="prototype")return e;if(i!=c){var d=u[a];if(f=n?n(d,a,u):void 0,f===void 0)f=ne(d)?d:Dt(r[i+1])?[]:{}}Ut(u,a,f),u=u[a]}return e}var Fl=_E;function ME(e,r,s){var n=-1,i=r.length,o={};while(++n<i){var c=r[n],u=wr(e,c);if(s(u,c))Fl(o,Xt(c,e),u)}return o}var Bl=ME;function wE(e,r){if(e==null)return{};var s=Et(Ks(e),function(n){return[n]});return r=ge(r),Bl(e,s,function(n,i){return r(n,i[0])})}var We=wE;function PE(e,r,s,n){var i=-1,o=e==null?0:e.length;if(n&&o)s=e[++i];while(++i<o)s=r(s,e[i],i,e);return s}var $l=PE;function UE(e,r,s,n,i){return i(e,function(o,c,u){s=n?(n=!1,o):r(s,o,c,u)}),s}var Gl=UE;function DE(e,r,s){var n=b(e)?$l:Gl,i=arguments.length<3;return n(e,ge(r,4),s,i,Ge)}var Te=DE;var FE="Expected a function";function BE(e){if(typeof e!="function")throw TypeError(FE);return function(){var r=arguments;switch(r.length){case 0:return!e.call(this);case 1:return!e.call(this,r[0]);case 2:return!e.call(this,r[0],r[1]);case 3:return!e.call(this,r[0],r[1],r[2])}return!e.apply(this,r)}}var Wl=BE;function $E(e,r){var s=b(e)?xr:ln;return s(e,Wl(ge(r,3)))}var qt=$E;function GE(e,r){var s;return Ge(e,function(n,i,o){return s=r(n,i,o),!s}),!!s}var jl=GE;function WE(e,r,s){var n=b(e)?en:jl;if(s&&Ft(e,r,s))r=void 0;return n(e,ge(r,3))}var ss=WE;var jE=1/0,KE=!(Vt&&1/kr(new Vt([,-0]))[1]==jE)?le:function(e){return new Vt(e)},Kl=KE;var zE=200;function VE(e,r,s){var n=-1,i=Js,o=e.length,c=!0,u=[],a=u;if(s)c=!1,i=Zs;else if(o>=zE){var f=r?null:Kl(e);if(f)return kr(f);c=!1,i=Cr,a=new Nr}else a=r?[]:u;e:while(++n<o){var d=e[n],m=r?r(d):d;if(d=s||d!==0?d:0,c&&m===m){var g=a.length;while(g--)if(a[g]===m)continue e;if(r)a.push(m);u.push(d)}else if(!i(a,m,s)){if(a!==u)a.push(m);u.push(d)}}return u}var zl=VE;function HE(e){return e&&e.length?zl(e):[]}var Pr=HE;function Ur(e){if(console&&console.error)console.error(`Error: ${e}`)}function ns(e){if(console&&console.warn)console.warn(`Warning: ${e}`)}function is(e){let r=new Date().getTime(),s=e();return{time:new Date().getTime()-r,value:s}}function os(e){function r(){}r.prototype=e;let s=new r;function n(){return typeof s.bar}return n(),n(),e;(0,eval)(e)}function YE(e){if(XE(e))return e.LABEL;else return e.name}function XE(e){return Se(e.LABEL)&&e.LABEL!==""}class Qe{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),S(this.definition,(r)=>{r.accept(e)})}}class Z extends Qe{constructor(e){super([]);this.idx=1,Ne(this,We(e,(r)=>r!==void 0))}set definition(e){}get definition(){if(this.referencedRule!==void 0)return this.referencedRule.definition;return[]}accept(e){e.visit(this)}}class je extends Qe{constructor(e){super(e.definition);this.orgText="",Ne(this,We(e,(r)=>r!==void 0))}}class Q extends Qe{constructor(e){super(e.definition);this.ignoreAmbiguities=!1,Ne(this,We(e,(r)=>r!==void 0))}}class re extends Qe{constructor(e){super(e.definition);this.idx=1,Ne(this,We(e,(r)=>r!==void 0))}}class Ee extends Qe{constructor(e){super(e.definition);this.idx=1,Ne(this,We(e,(r)=>r!==void 0))}}class ye extends Qe{constructor(e){super(e.definition);this.idx=1,Ne(this,We(e,(r)=>r!==void 0))}}class B extends Qe{constructor(e){super(e.definition);this.idx=1,Ne(this,We(e,(r)=>r!==void 0))}}class he extends Qe{constructor(e){super(e.definition);this.idx=1,Ne(this,We(e,(r)=>r!==void 0))}}class de extends Qe{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition);this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,Ne(this,We(e,(r)=>r!==void 0))}}class D{constructor(e){this.idx=1,Ne(this,We(e,(r)=>r!==void 0))}accept(e){e.visit(this)}}function un(e){return A(e,Dr)}function Dr(e){function r(s){return A(s,Dr)}if(e instanceof Z){let s={type:"NonTerminal",name:e.nonTerminalName,idx:e.idx};if(Se(e.label))s.label=e.label;return s}else if(e instanceof Q)return{type:"Alternative",definition:r(e.definition)};else if(e instanceof re)return{type:"Option",idx:e.idx,definition:r(e.definition)};else if(e instanceof Ee)return{type:"RepetitionMandatory",idx:e.idx,definition:r(e.definition)};else if(e instanceof ye)return{type:"RepetitionMandatoryWithSeparator",idx:e.idx,separator:Dr(new D({terminalType:e.separator})),definition:r(e.definition)};else if(e instanceof he)return{type:"RepetitionWithSeparator",idx:e.idx,separator:Dr(new D({terminalType:e.separator})),definition:r(e.definition)};else if(e instanceof B)return{type:"Repetition",idx:e.idx,definition:r(e.definition)};else if(e instanceof de)return{type:"Alternation",idx:e.idx,definition:r(e.definition)};else if(e instanceof D){let s={type:"Terminal",name:e.terminalType.name,label:YE(e.terminalType),idx:e.idx};if(Se(e.label))s.terminalLabel=e.label;let n=e.terminalType.PATTERN;if(e.terminalType.PATTERN)s.pattern=Ze(n)?n.source:n;return s}else if(e instanceof je)return{type:"Rule",name:e.name,orgText:e.orgText,definition:r(e.definition)};else throw Error("non exhaustive match")}class Ke{visit(e){let r=e;switch(r.constructor){case Z:return this.visitNonTerminal(r);case Q:return this.visitAlternative(r);case re:return this.visitOption(r);case Ee:return this.visitRepetitionMandatory(r);case ye:return this.visitRepetitionMandatoryWithSeparator(r);case he:return this.visitRepetitionWithSeparator(r);case B:return this.visitRepetition(r);case de:return this.visitAlternation(r);case D:return this.visitTerminal(r);case je:return this.visitRule(r);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}}function ai(e){return e instanceof Q||e instanceof re||e instanceof B||e instanceof Ee||e instanceof ye||e instanceof he||e instanceof D||e instanceof je}function rr(e,r=[]){if(e instanceof re||e instanceof B||e instanceof he)return!0;if(e instanceof de)return ss(e.definition,(n)=>rr(n,r));else if(e instanceof Z&&te(r,e))return!1;else if(e instanceof Qe){if(e instanceof Z)r.push(e);return ve(e.definition,(n)=>rr(n,r))}else return!1}function li(e){return e instanceof de}function ze(e){if(e instanceof Z)return"SUBRULE";else if(e instanceof re)return"OPTION";else if(e instanceof de)return"OR";else if(e instanceof Ee)return"AT_LEAST_ONE";else if(e instanceof ye)return"AT_LEAST_ONE_SEP";else if(e instanceof he)return"MANY_SEP";else if(e instanceof B)return"MANY";else if(e instanceof D)return"CONSUME";else throw Error("non exhaustive match")}class Jt{walk(e,r=[]){S(e.definition,(s,n)=>{let i=fe(e.definition,n+1);if(s instanceof Z)this.walkProdRef(s,i,r);else if(s instanceof D)this.walkTerminal(s,i,r);else if(s instanceof Q)this.walkFlat(s,i,r);else if(s instanceof re)this.walkOption(s,i,r);else if(s instanceof Ee)this.walkAtLeastOne(s,i,r);else if(s instanceof ye)this.walkAtLeastOneSep(s,i,r);else if(s instanceof he)this.walkManySep(s,i,r);else if(s instanceof B)this.walkMany(s,i,r);else if(s instanceof de)this.walkOr(s,i,r);else throw Error("non exhaustive match")})}walkTerminal(e,r,s){}walkProdRef(e,r,s){}walkFlat(e,r,s){let n=r.concat(s);this.walk(e,n)}walkOption(e,r,s){let n=r.concat(s);this.walk(e,n)}walkAtLeastOne(e,r,s){let n=[new re({definition:e.definition})].concat(r,s);this.walk(e,n)}walkAtLeastOneSep(e,r,s){let n=Vl(e,r,s);this.walk(e,n)}walkMany(e,r,s){let n=[new re({definition:e.definition})].concat(r,s);this.walk(e,n)}walkManySep(e,r,s){let n=Vl(e,r,s);this.walk(e,n)}walkOr(e,r,s){let n=r.concat(s);S(e.definition,(i)=>{let o=new Q({definition:[i]});this.walk(o,n)})}}function Vl(e,r,s){return[new re({definition:[new D({terminalType:e.separator})].concat(e.definition)})].concat(r,s)}function sr(e){if(e instanceof Z)return sr(e.referencedRule);else if(e instanceof D)return ZE(e);else if(ai(e))return qE(e);else if(li(e))return JE(e);else throw Error("non exhaustive match")}function qE(e){let r=[],s=e.definition,n=0,i=s.length>n,o,c=!0;while(i&&c)o=s[n],c=rr(o),r=r.concat(sr(o)),n=n+1,i=s.length>n;return Pr(r)}function JE(e){let r=A(e.definition,(s)=>sr(s));return Pr(xe(r))}function ZE(e){return[e.terminalType]}var fn="_~IN~_";class Hl extends Jt{constructor(e){super();this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,r,s){}walkProdRef(e,r,s){let n=QE(e.referencedRule,e.idx)+this.topProd.name,i=r.concat(s),o=new Q({definition:i}),c=sr(o);this.follows[n]=c}}function Yl(e){let r={};return S(e,(s)=>{let n=new Hl(s).startWalking();Ne(r,n)}),r}function QE(e,r){return e.name+r+fn}function M(e){return e.charCodeAt(0)}function hn(e,r){if(Array.isArray(e))e.forEach(function(s){r.push(s)});else r.push(e)}function Fr(e,r){if(e[r]===!0)throw"duplicate flag "+r;let s=e[r];e[r]=!0}function nr(e){if(e===void 0)throw Error("Internal Error - Should never get here!");return!0}function as(){throw Error("Internal Error - Should never get here!")}function ci(e){return e.type==="Character"}var ls=[];for(let e=M("0");e<=M("9");e++)ls.push(e);var cs=[M("_")].concat(ls);for(let e=M("a");e<=M("z");e++)cs.push(e);for(let e=M("A");e<=M("Z");e++)cs.push(e);var ui=[M(" "),M("\f"),M(`
2
- `),M("\r"),M("\t"),M("\v"),M("\t"),M(" "),M(" "),M(" "),M(" "),M(" "),M(" "),M(" "),M(" "),M(" "),M(" "),M(" "),M(" "),M(" "),M("\u2028"),M("\u2029"),M(" "),M(" "),M(" "),M("\uFEFF")];var ey=/[0-9a-fA-F]/,pn=/[0-9]/,ty=/[1-9]/;class mn{constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx}pattern(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar("/");let r=this.disjunction();this.consumeChar("/");let s={type:"Flags",loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};while(this.isRegExpFlag())switch(this.popChar()){case"g":Fr(s,"global");break;case"i":Fr(s,"ignoreCase");break;case"m":Fr(s,"multiLine");break;case"u":Fr(s,"unicode");break;case"y":Fr(s,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:s,value:r,loc:this.loc(0)}}disjunction(){let e=[],r=this.idx;e.push(this.alternative());while(this.peekChar()==="|")this.consumeChar("|"),e.push(this.alternative());return{type:"Disjunction",value:e,loc:this.loc(r)}}alternative(){let e=[],r=this.idx;while(this.isTerm())e.push(this.term());return{type:"Alternative",value:e,loc:this.loc(r)}}term(){if(this.isAssertion())return this.assertion();else return this.atom()}assertion(){let e=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(e)};case"$":return{type:"EndAnchor",loc:this.loc(e)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(e)};case"B":return{type:"NonWordBoundary",loc:this.loc(e)}}throw Error("Invalid Assertion Escape");case"(":this.consumeChar("?");let r;switch(this.popChar()){case"=":r="Lookahead";break;case"!":r="NegativeLookahead";break;case"<":{switch(this.popChar()){case"=":r="Lookbehind";break;case"!":r="NegativeLookbehind"}break}}nr(r);let s=this.disjunction();return this.consumeChar(")"),{type:r,value:s,loc:this.loc(e)}}return as()}quantifier(e=!1){let r=void 0,s=this.idx;switch(this.popChar()){case"*":r={atLeast:0,atMost:1/0};break;case"+":r={atLeast:1,atMost:1/0};break;case"?":r={atLeast:0,atMost:1};break;case"{":let n=this.integerIncludingZero();switch(this.popChar()){case"}":r={atLeast:n,atMost:n};break;case",":let i;if(this.isDigit())i=this.integerIncludingZero(),r={atLeast:n,atMost:i};else r={atLeast:n,atMost:1/0};this.consumeChar("}");break}if(e===!0&&r===void 0)return;nr(r);break}if(e===!0&&r===void 0)return;if(nr(r)){if(this.peekChar(0)==="?")this.consumeChar("?"),r.greedy=!1;else r.greedy=!0;return r.type="Quantifier",r.loc=this.loc(s),r}}atom(){let e,r=this.idx;switch(this.peekChar()){case".":e=this.dotAll();break;case"\\":e=this.atomEscape();break;case"[":e=this.characterClass();break;case"(":e=this.group();break}if(e===void 0&&this.isPatternCharacter())e=this.patternCharacter();if(nr(e)){if(e.loc=this.loc(r),this.isQuantifier())e.quantifier=this.quantifier();return e}return as()}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[M(`
1
+ import{t,l,K,E,X,R,L,z,O,U,j,G,p,h,W,dp,st,Ye,Je,Mr,_t,St,Tt,lt}from"./index-vnw3hbeg.js";import{pn}from"./index-pc6eg8h2.js";var ks={};pn(ks,{default:()=>pt});var Ms={};pn(Ms,{default:()=>He});var Bs={};pn(Bs,{default:()=>ri});var df=typeof global=="object"&&global&&global.Object===Object&&global,bs=df;var pf=typeof self=="object"&&self&&self.Object===Object&&self,mf=bs||pf||Function("return this")(),pe=mf;var gf=pe.Symbol,Oe=gf;var to=Object.prototype,{hasOwnProperty:Tf,toString:Ef}=to,es=Oe?Oe.toStringTag:void 0;function yf(e){var r=Tf.call(e,es),s=e[es];try{e[es]=void 0;var n=!0}catch(o){}var i=Ef.call(e);if(n)if(r)e[es]=s;else delete e[es];return i}var ro=yf;var Af=Object.prototype,xf=Af.toString;function Sf(e){return xf.call(e)}var so=Sf;var Rf="[object Null]",Of="[object Undefined]",no=Oe?Oe.toStringTag:void 0;function Lf(e){if(e==null)return e===void 0?Of:Rf;return no&&no in Object(e)?ro(e):so(e)}var Pe=Lf;function If(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}var ne=If;var Nf="[object AsyncFunction]",bf="[object Function]",Cf="[object GeneratorFunction]",vf="[object Proxy]";function kf(e){if(!ne(e))return!1;var r=Pe(e);return r==bf||r==Cf||r==Nf||r==vf}var Ue=kf;var _f=pe["__core-js_shared__"],Cs=_f;var io=function(){var e=/[^.]+$/.exec(Cs&&Cs.keys&&Cs.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Mf(e){return!!io&&io in e}var oo=Mf;var wf=Function.prototype,Pf=wf.toString;function Uf(e){if(e!=null){try{return Pf.call(e)}catch(r){}try{return e+""}catch(r){}}return""}var It=Uf;var Df=/[\\^$.*+?()[\]{}|]/g,Ff=/^\[object .+?Constructor\]$/,Bf=Function.prototype,$f=Object.prototype,Gf=Bf.toString,Wf=$f.hasOwnProperty,jf=RegExp("^"+Gf.call(Wf).replace(Df,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Kf(e){if(!ne(e)||oo(e))return!1;var r=Ue(e)?jf:Ff;return r.test(It(e))}var ao=Kf;function zf(e,r){return e==null?void 0:e[r]}var lo=zf;function Vf(e,r){var s=lo(e,r);return ao(s)?s:void 0}var $e=Vf;var Hf=function(){try{var e=$e(Object,"defineProperty");return e({},"",{}),e}catch(r){}}(),hr=Hf;function Yf(e,r,s){if(r=="__proto__"&&hr)hr(e,r,{configurable:!0,enumerable:!0,value:s,writable:!0});else e[r]=s}var dr=Yf;function Xf(e,r){return e===r||e!==e&&r!==r}var ft=Xf;var qf=Object.prototype,Jf=qf.hasOwnProperty;function Zf(e,r,s){var n=e[r];if(!(Jf.call(e,r)&&ft(n,s))||s===void 0&&!(r in e))dr(e,r,s)}var Ut=Zf;function Qf(e,r,s,n){var i=!s;s||(s={});var o=-1,c=r.length;while(++o<c){var u=r[o],a=n?n(s[u],e[u],u,s,e):void 0;if(a===void 0)a=e[u];if(i)dr(s,u,a);else Ut(s,u,a)}return s}var ht=Qf;function eh(e){return e}var nt=eh;function th(e,r,s){switch(s.length){case 0:return e.call(r);case 1:return e.call(r,s[0]);case 2:return e.call(r,s[0],s[1]);case 3:return e.call(r,s[0],s[1],s[2])}return e.apply(r,s)}var co=th;var uo=Math.max;function rh(e,r,s){return r=uo(r===void 0?e.length-1:r,0),function(){var n=arguments,i=-1,o=uo(n.length-r,0),c=Array(o);while(++i<o)c[i]=n[r+i];i=-1;var u=Array(r+1);while(++i<r)u[i]=n[i];return u[r]=s(c),co(e,this,u)}}var fo=rh;function sh(e){return function(){return e}}var ho=sh;var nh=!hr?nt:function(e,r){return hr(e,"toString",{configurable:!0,enumerable:!1,value:ho(r),writable:!0})},po=nh;var ih=800,oh=16,ah=Date.now;function lh(e){var r=0,s=0;return function(){var n=ah(),i=oh-(n-s);if(s=n,i>0){if(++r>=ih)return arguments[0]}else r=0;return e.apply(void 0,arguments)}}var mo=lh;var ch=mo(po),go=ch;function uh(e,r){return go(fo(e,r,nt),e+"")}var pr=uh;var fh=9007199254740991;function hh(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=fh}var mr=hh;function dh(e){return e!=null&&mr(e.length)&&!Ue(e)}var me=dh;var ph=9007199254740991,mh=/^(?:0|[1-9]\d*)$/;function gh(e,r){var s=typeof e;return r=r==null?ph:r,!!r&&(s=="number"||s!="symbol"&&mh.test(e))&&(e>-1&&e%1==0&&e<r)}var Dt=gh;function Th(e,r,s){if(!ne(s))return!1;var n=typeof r;if(n=="number"?me(s)&&Dt(r,s.length):n=="string"&&(r in s))return ft(s[r],e);return!1}var Ft=Th;function Eh(e){return pr(function(r,s){var n=-1,i=s.length,o=i>1?s[i-1]:void 0,c=i>2?s[2]:void 0;if(o=e.length>3&&typeof o=="function"?(i--,o):void 0,c&&Ft(s[0],s[1],c))o=i<3?void 0:o,i=1;r=Object(r);while(++n<i){var u=s[n];if(u)e(r,u,n,o)}return r})}var To=Eh;var yh=Object.prototype;function Ah(e){var r=e&&e.constructor,s=typeof r=="function"&&r.prototype||yh;return e===s}var dt=Ah;function xh(e,r){var s=-1,n=Array(e);while(++s<e)n[s]=r(s);return n}var Eo=xh;function Sh(e){return e!=null&&typeof e=="object"}var ue=Sh;var Rh="[object Arguments]";function Oh(e){return ue(e)&&Pe(e)==Rh}var Qn=Oh;var yo=Object.prototype,{hasOwnProperty:Lh,propertyIsEnumerable:Ih}=yo,Nh=Qn(function(){return arguments}())?Qn:function(e){return ue(e)&&Lh.call(e,"callee")&&!Ih.call(e,"callee")},Bt=Nh;var bh=Array.isArray,b=bh;function Ch(){return!1}var Ao=Ch;var Ro=typeof ks=="object"&&ks&&!ks.nodeType&&ks,xo=Ro&&typeof vs=="object"&&vs&&!vs.nodeType&&vs,vh=xo&&xo.exports===Ro,So=vh?pe.Buffer:void 0,kh=So?So.isBuffer:void 0,_h=kh||Ao,pt=_h;var Mh="[object Arguments]",wh="[object Array]",Ph="[object Boolean]",Uh="[object Date]",Dh="[object Error]",Fh="[object Function]",Bh="[object Map]",$h="[object Number]",Gh="[object Object]",Wh="[object RegExp]",jh="[object Set]",Kh="[object String]",zh="[object WeakMap]",Vh="[object ArrayBuffer]",Hh="[object DataView]",Yh="[object Float32Array]",Xh="[object Float64Array]",qh="[object Int8Array]",Jh="[object Int16Array]",Zh="[object Int32Array]",Qh="[object Uint8Array]",ed="[object Uint8ClampedArray]",td="[object Uint16Array]",rd="[object Uint32Array]",J={};J[Yh]=J[Xh]=J[qh]=J[Jh]=J[Zh]=J[Qh]=J[ed]=J[td]=J[rd]=!0;J[Mh]=J[wh]=J[Vh]=J[Ph]=J[Hh]=J[Uh]=J[Dh]=J[Fh]=J[Bh]=J[$h]=J[Gh]=J[Wh]=J[jh]=J[Kh]=J[zh]=!1;function sd(e){return ue(e)&&mr(e.length)&&!!J[Pe(e)]}var Oo=sd;function nd(e){return function(r){return e(r)}}var mt=nd;var Lo=typeof Ms=="object"&&Ms&&!Ms.nodeType&&Ms,ts=Lo&&typeof _s=="object"&&_s&&!_s.nodeType&&_s,id=ts&&ts.exports===Lo,ei=id&&bs.process,od=function(){try{var e=ts&&ts.require&&ts.require("util").types;if(e)return e;return ei&&ei.binding&&ei.binding("util")}catch(r){}}(),He=od;var Io=He&&He.isTypedArray,ad=Io?mt(Io):Oo,gr=ad;var ld=Object.prototype,cd=ld.hasOwnProperty;function ud(e,r){var s=b(e),n=!s&&Bt(e),i=!s&&!n&&pt(e),o=!s&&!n&&!i&&gr(e),c=s||n||i||o,u=c?Eo(e.length,String):[],a=u.length;for(var f in e)if((r||cd.call(e,f))&&!(c&&(f=="length"||i&&(f=="offset"||f=="parent")||o&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||Dt(f,a))))u.push(f);return u}var ws=ud;function fd(e,r){return function(s){return e(r(s))}}var Ps=fd;var hd=Ps(Object.keys,Object),No=hd;var dd=Object.prototype,pd=dd.hasOwnProperty;function md(e){if(!dt(e))return No(e);var r=[];for(var s in Object(e))if(pd.call(e,s)&&s!="constructor")r.push(s);return r}var Us=md;function gd(e){return me(e)?ws(e):Us(e)}var H=gd;var Td=Object.prototype,Ed=Td.hasOwnProperty,yd=To(function(e,r){if(dt(r)||me(r)){ht(r,H(r),e);return}for(var s in r)if(Ed.call(r,s))Ut(e,s,r[s])}),Ne=yd;function Ad(){this.__data__=[],this.size=0}var bo=Ad;function xd(e,r){var s=e.length;while(s--)if(ft(e[s][0],r))return s;return-1}var $t=xd;var Sd=Array.prototype,Rd=Sd.splice;function Od(e){var r=this.__data__,s=$t(r,e);if(s<0)return!1;var n=r.length-1;if(s==n)r.pop();else Rd.call(r,s,1);return--this.size,!0}var Co=Od;function Ld(e){var r=this.__data__,s=$t(r,e);return s<0?void 0:r[s][1]}var vo=Ld;function Id(e){return $t(this.__data__,e)>-1}var ko=Id;function Nd(e,r){var s=this.__data__,n=$t(s,e);if(n<0)++this.size,s.push([e,r]);else s[n][1]=r;return this}var _o=Nd;function Tr(e){var r=-1,s=e==null?0:e.length;this.clear();while(++r<s){var n=e[r];this.set(n[0],n[1])}}Tr.prototype.clear=bo;Tr.prototype.delete=Co;Tr.prototype.get=vo;Tr.prototype.has=ko;Tr.prototype.set=_o;var Gt=Tr;function bd(){this.__data__=new Gt,this.size=0}var Mo=bd;function Cd(e){var r=this.__data__,s=r.delete(e);return this.size=r.size,s}var wo=Cd;function vd(e){return this.__data__.get(e)}var Po=vd;function kd(e){return this.__data__.has(e)}var Uo=kd;var _d=$e(pe,"Map"),Wt=_d;var Md=$e(Object,"create"),Nt=Md;function wd(){this.__data__=Nt?Nt(null):{},this.size=0}var Do=wd;function Pd(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}var Fo=Pd;var Ud="__lodash_hash_undefined__",Dd=Object.prototype,Fd=Dd.hasOwnProperty;function Bd(e){var r=this.__data__;if(Nt){var s=r[e];return s===Ud?void 0:s}return Fd.call(r,e)?r[e]:void 0}var Bo=Bd;var $d=Object.prototype,Gd=$d.hasOwnProperty;function Wd(e){var r=this.__data__;return Nt?r[e]!==void 0:Gd.call(r,e)}var $o=Wd;var jd="__lodash_hash_undefined__";function Kd(e,r){var s=this.__data__;return this.size+=this.has(e)?0:1,s[e]=Nt&&r===void 0?jd:r,this}var Go=Kd;function Er(e){var r=-1,s=e==null?0:e.length;this.clear();while(++r<s){var n=e[r];this.set(n[0],n[1])}}Er.prototype.clear=Do;Er.prototype.delete=Fo;Er.prototype.get=Bo;Er.prototype.has=$o;Er.prototype.set=Go;var ti=Er;function zd(){this.size=0,this.__data__={hash:new ti,map:new(Wt||Gt),string:new ti}}var Wo=zd;function Vd(e){var r=typeof e;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?e!=="__proto__":e===null}var jo=Vd;function Hd(e,r){var s=e.__data__;return jo(r)?s[typeof r=="string"?"string":"hash"]:s.map}var jt=Hd;function Yd(e){var r=jt(this,e).delete(e);return this.size-=r?1:0,r}var Ko=Yd;function Xd(e){return jt(this,e).get(e)}var zo=Xd;function qd(e){return jt(this,e).has(e)}var Vo=qd;function Jd(e,r){var s=jt(this,e),n=s.size;return s.set(e,r),this.size+=s.size==n?0:1,this}var Ho=Jd;function yr(e){var r=-1,s=e==null?0:e.length;this.clear();while(++r<s){var n=e[r];this.set(n[0],n[1])}}yr.prototype.clear=Wo;yr.prototype.delete=Ko;yr.prototype.get=zo;yr.prototype.has=Vo;yr.prototype.set=Ho;var er=yr;var Zd=200;function Qd(e,r){var s=this.__data__;if(s instanceof Gt){var n=s.__data__;if(!Wt||n.length<Zd-1)return n.push([e,r]),this.size=++s.size,this;s=this.__data__=new er(n)}return s.set(e,r),this.size=s.size,this}var Yo=Qd;function Ar(e){var r=this.__data__=new Gt(e);this.size=r.size}Ar.prototype.clear=Mo;Ar.prototype.delete=wo;Ar.prototype.get=Po;Ar.prototype.has=Uo;Ar.prototype.set=Yo;var Kt=Ar;function ep(e,r){var s=-1,n=e==null?0:e.length;while(++s<n)if(r(e[s],s,e)===!1)break;return e}var Ds=ep;function tp(e,r){return e&&ht(r,H(r),e)}var Xo=tp;function rp(e){var r=[];if(e!=null)for(var s in Object(e))r.push(s);return r}var qo=rp;var sp=Object.prototype,np=sp.hasOwnProperty;function ip(e){if(!ne(e))return qo(e);var r=dt(e),s=[];for(var n in e)if(!(n=="constructor"&&(r||!np.call(e,n))))s.push(n);return s}var Jo=ip;function op(e){return me(e)?ws(e,!0):Jo(e)}var zt=op;function ap(e,r){return e&&ht(r,zt(r),e)}var Zo=ap;var ra=typeof Bs=="object"&&Bs&&!Bs.nodeType&&Bs,Qo=ra&&typeof Fs=="object"&&Fs&&!Fs.nodeType&&Fs,lp=Qo&&Qo.exports===ra,ea=lp?pe.Buffer:void 0,ta=ea?ea.allocUnsafe:void 0;function cp(e,r){if(r)return e.slice();var s=e.length,n=ta?ta(s):new e.constructor(s);return e.copy(n),n}var ri=cp;function up(e,r){var s=-1,n=e.length;r||(r=Array(n));while(++s<n)r[s]=e[s];return r}var sa=up;function fp(e,r){var s=-1,n=e==null?0:e.length,i=0,o=[];while(++s<n){var c=e[s];if(r(c,s,e))o[i++]=c}return o}var xr=fp;function hp(){return[]}var $s=hp;var pp=Object.prototype,mp=pp.propertyIsEnumerable,na=Object.getOwnPropertySymbols,gp=!na?$s:function(e){if(e==null)return[];return e=Object(e),xr(na(e),function(r){return mp.call(e,r)})},Sr=gp;function Tp(e,r){return ht(e,Sr(e),r)}var ia=Tp;function Ep(e,r){var s=-1,n=r.length,i=e.length;while(++s<n)e[i+s]=r[s];return e}var Rr=Ep;var yp=Ps(Object.getPrototypeOf,Object),Gs=yp;var Ap=Object.getOwnPropertySymbols,xp=!Ap?$s:function(e){var r=[];while(e)Rr(r,Sr(e)),e=Gs(e);return r},Ws=xp;function Sp(e,r){return ht(e,Ws(e),r)}var oa=Sp;function Rp(e,r,s){var n=r(e);return b(e)?n:Rr(n,s(e))}var js=Rp;function Op(e){return js(e,H,Sr)}var rs=Op;function Lp(e){return js(e,zt,Ws)}var Ks=Lp;var Ip=$e(pe,"DataView"),zs=Ip;var Np=$e(pe,"Promise"),Vs=Np;var bp=$e(pe,"Set"),Vt=bp;var Cp=$e(pe,"WeakMap"),Hs=Cp;var aa="[object Map]",vp="[object Object]",la="[object Promise]",ca="[object Set]",ua="[object WeakMap]",fa="[object DataView]",kp=It(zs),_p=It(Wt),Mp=It(Vs),wp=It(Vt),Pp=It(Hs),tr=Pe;if(zs&&tr(new zs(new ArrayBuffer(1)))!=fa||Wt&&tr(new Wt)!=aa||Vs&&tr(Vs.resolve())!=la||Vt&&tr(new Vt)!=ca||Hs&&tr(new Hs)!=ua)tr=function(e){var r=Pe(e),s=r==vp?e.constructor:void 0,n=s?It(s):"";if(n)switch(n){case kp:return fa;case _p:return aa;case Mp:return la;case wp:return ca;case Pp:return ua}return r};var it=tr;var Up=Object.prototype,Dp=Up.hasOwnProperty;function Fp(e){var r=e.length,s=new e.constructor(r);if(r&&typeof e[0]=="string"&&Dp.call(e,"index"))s.index=e.index,s.input=e.input;return s}var ha=Fp;var Bp=pe.Uint8Array,Or=Bp;function $p(e){var r=new e.constructor(e.byteLength);return new Or(r).set(new Or(e)),r}var Lr=$p;function Gp(e,r){var s=r?Lr(e.buffer):e.buffer;return new e.constructor(s,e.byteOffset,e.byteLength)}var da=Gp;var Wp=/\w*$/;function jp(e){var r=new e.constructor(e.source,Wp.exec(e));return r.lastIndex=e.lastIndex,r}var pa=jp;var ma=Oe?Oe.prototype:void 0,ga=ma?ma.valueOf:void 0;function Kp(e){return ga?Object(ga.call(e)):{}}var Ta=Kp;function zp(e,r){var s=r?Lr(e.buffer):e.buffer;return new e.constructor(s,e.byteOffset,e.length)}var Ea=zp;var Vp="[object Boolean]",Hp="[object Date]",Yp="[object Map]",Xp="[object Number]",qp="[object RegExp]",Jp="[object Set]",Zp="[object String]",Qp="[object Symbol]",em="[object ArrayBuffer]",tm="[object DataView]",rm="[object Float32Array]",sm="[object Float64Array]",nm="[object Int8Array]",im="[object Int16Array]",om="[object Int32Array]",am="[object Uint8Array]",lm="[object Uint8ClampedArray]",cm="[object Uint16Array]",um="[object Uint32Array]";function fm(e,r,s){var n=e.constructor;switch(r){case em:return Lr(e);case Vp:case Hp:return new n(+e);case tm:return da(e,s);case rm:case sm:case nm:case im:case om:case am:case lm:case cm:case um:return Ea(e,s);case Yp:return new n;case Xp:case Zp:return new n(e);case qp:return pa(e);case Jp:return new n;case Qp:return Ta(e)}}var ya=fm;var Aa=Object.create,hm=function(){function e(){}return function(r){if(!ne(r))return{};if(Aa)return Aa(r);e.prototype=r;var s=new e;return e.prototype=void 0,s}}(),xa=hm;function dm(e){return typeof e.constructor=="function"&&!dt(e)?xa(Gs(e)):{}}var Sa=dm;var pm="[object Map]";function mm(e){return ue(e)&&it(e)==pm}var Ra=mm;var Oa=He&&He.isMap,gm=Oa?mt(Oa):Ra,La=gm;var Tm="[object Set]";function Em(e){return ue(e)&&it(e)==Tm}var Ia=Em;var Na=He&&He.isSet,ym=Na?mt(Na):Ia,ba=ym;var Am=1,xm=2,Sm=4,Ca="[object Arguments]",Rm="[object Array]",Om="[object Boolean]",Lm="[object Date]",Im="[object Error]",va="[object Function]",Nm="[object GeneratorFunction]",bm="[object Map]",Cm="[object Number]",ka="[object Object]",vm="[object RegExp]",km="[object Set]",_m="[object String]",Mm="[object Symbol]",wm="[object WeakMap]",Pm="[object ArrayBuffer]",Um="[object DataView]",Dm="[object Float32Array]",Fm="[object Float64Array]",Bm="[object Int8Array]",$m="[object Int16Array]",Gm="[object Int32Array]",Wm="[object Uint8Array]",jm="[object Uint8ClampedArray]",Km="[object Uint16Array]",zm="[object Uint32Array]",Y={};Y[Ca]=Y[Rm]=Y[Pm]=Y[Um]=Y[Om]=Y[Lm]=Y[Dm]=Y[Fm]=Y[Bm]=Y[$m]=Y[Gm]=Y[bm]=Y[Cm]=Y[ka]=Y[vm]=Y[km]=Y[_m]=Y[Mm]=Y[Wm]=Y[jm]=Y[Km]=Y[zm]=!0;Y[Im]=Y[va]=Y[wm]=!1;function Ys(e,r,s,n,i,o){var c,u=r&Am,a=r&xm,f=r&Sm;if(s)c=i?s(e,n,i,o):s(e);if(c!==void 0)return c;if(!ne(e))return e;var d=b(e);if(d){if(c=ha(e),!u)return sa(e,c)}else{var m=it(e),g=m==va||m==Nm;if(pt(e))return ri(e,u);if(m==ka||m==Ca||g&&!i){if(c=a||g?{}:Sa(e),!u)return a?oa(e,Zo(c,e)):ia(e,Xo(c,e))}else{if(!Y[m])return i?e:{};c=ya(e,m,u)}}o||(o=new Kt);var y=o.get(e);if(y)return y;if(o.set(e,c),ba(e))e.forEach(function(C){c.add(Ys(C,r,s,C,e,o))});else if(La(e))e.forEach(function(C,x){c.set(x,Ys(C,r,s,x,e,o))});var k=f?a?Ks:rs:a?zt:H,_=d?void 0:k(e);return Ds(_||e,function(C,x){if(_)x=C,C=e[x];Ut(c,x,Ys(C,r,s,x,e,o))}),c}var _a=Ys;var Vm=4;function Hm(e){return _a(e,Vm)}var q=Hm;function Ym(e){var r=-1,s=e==null?0:e.length,n=0,i=[];while(++r<s){var o=e[r];if(o)i[n++]=o}return i}var gt=Ym;var Ma=Object.prototype,Xm=Ma.hasOwnProperty,qm=pr(function(e,r){e=Object(e);var s=-1,n=r.length,i=n>2?r[2]:void 0;if(i&&Ft(r[0],r[1],i))n=1;while(++s<n){var o=r[s],c=zt(o),u=-1,a=c.length;while(++u<a){var f=c[u],d=e[f];if(d===void 0||ft(d,Ma[f])&&!Xm.call(e,f))e[f]=o[f]}}return e}),Ir=qm;var Jm="__lodash_hash_undefined__";function Zm(e){return this.__data__.set(e,Jm),this}var wa=Zm;function Qm(e){return this.__data__.has(e)}var Pa=Qm;function Xs(e){var r=-1,s=e==null?0:e.length;this.__data__=new er;while(++r<s)this.add(e[r])}Xs.prototype.add=Xs.prototype.push=wa;Xs.prototype.has=Pa;var Nr=Xs;function eg(e,r,s,n){var i=e.length,o=s+(n?1:-1);while(n?o--:++o<i)if(r(e[o],o,e))return o;return-1}var qs=eg;function tg(e){return e!==e}var Ua=tg;function rg(e,r,s){var n=s-1,i=e.length;while(++n<i)if(e[n]===r)return n;return-1}var Da=rg;function sg(e,r,s){return r===r?Da(e,r,s):qs(e,Ua,s)}var br=sg;function ng(e,r){var s=e==null?0:e.length;return!!s&&br(e,r,0)>-1}var Js=ng;function ig(e,r,s){var n=-1,i=e==null?0:e.length;while(++n<i)if(s(r,e[n]))return!0;return!1}var Zs=ig;function og(e,r){var s=-1,n=e==null?0:e.length,i=Array(n);while(++s<n)i[s]=r(e[s],s,e);return i}var Et=og;function ag(e,r){return e.has(r)}var Cr=ag;var lg=200;function cg(e,r,s,n){var i=-1,o=Js,c=!0,u=e.length,a=[],f=r.length;if(!u)return a;if(s)r=Et(r,mt(s));if(n)o=Zs,c=!1;else if(r.length>=lg)o=Cr,c=!1,r=new Nr(r);e:while(++i<u){var d=e[i],m=s==null?d:s(d);if(d=n||d!==0?d:0,c&&m===m){var g=f;while(g--)if(r[g]===m)continue e;a.push(d)}else if(!o(r,m,n))a.push(d)}return a}var Fa=cg;var Ba=Oe?Oe.isConcatSpreadable:void 0;function ug(e){return b(e)||Bt(e)||!!(Ba&&e&&e[Ba])}var $a=ug;function Ga(e,r,s,n,i){var o=-1,c=e.length;s||(s=$a),i||(i=[]);while(++o<c){var u=e[o];if(r>0&&s(u))if(r>1)Ga(u,r-1,s,n,i);else Rr(i,u);else if(!n)i[i.length]=u}return i}var vr=Ga;function fg(e){return ue(e)&&me(e)}var si=fg;var hg=pr(function(e,r){return si(e)?Fa(e,vr(r,1,si,!0)):[]}),Ht=hg;function dg(e,r,s){var n=-1,i=e.length;if(r<0)r=-r>i?0:i+r;if(s=s>i?i:s,s<0)s+=i;i=r>s?0:s-r>>>0,r>>>=0;var o=Array(i);while(++n<i)o[n]=e[n+r];return o}var Qs=dg;var pg=/\s/;function mg(e){var r=e.length;while(r--&&pg.test(e.charAt(r)));return r}var Wa=mg;var gg=/^\s+/;function Tg(e){return e?e.slice(0,Wa(e)+1).replace(gg,""):e}var ja=Tg;var Eg="[object Symbol]";function yg(e){return typeof e=="symbol"||ue(e)&&Pe(e)==Eg}var Yt=yg;var Ka=NaN,Ag=/^[-+]0x[0-9a-f]+$/i,xg=/^0b[01]+$/i,Sg=/^0o[0-7]+$/i,Rg=parseInt;function Og(e){if(typeof e=="number")return e;if(Yt(e))return Ka;if(ne(e)){var r=typeof e.valueOf=="function"?e.valueOf():e;e=ne(r)?r+"":r}if(typeof e!="string")return e===0?e:+e;e=ja(e);var s=xg.test(e);return s||Sg.test(e)?Rg(e.slice(2),s?2:8):Ag.test(e)?Ka:+e}var za=Og;var Va=1/0,Lg=179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000;function Ig(e){if(!e)return e===0?e:0;if(e=za(e),e===Va||e===-Va){var r=e<0?-1:1;return r*Lg}return e===e?e:0}var Ha=Ig;function Ng(e){var r=Ha(e),s=r%1;return r===r?s?r-s:r:0}var yt=Ng;function bg(e,r,s){var n=e==null?0:e.length;if(!n)return[];return r=s||r===void 0?1:yt(r),Qs(e,r<0?0:r,n)}var fe=bg;function Cg(e,r,s){var n=e==null?0:e.length;if(!n)return[];return r=s||r===void 0?1:yt(r),r=n-r,Qs(e,0,r<0?0:r)}var bt=Cg;function vg(e,r){var s=-1,n=e==null?0:e.length;while(++s<n)if(!r(e[s],s,e))return!1;return!0}var Ya=vg;function kg(e){return function(r,s,n){var i=-1,o=Object(r),c=n(r),u=c.length;while(u--){var a=c[e?u:++i];if(s(o[a],a,o)===!1)break}return r}}var Xa=kg;var _g=Xa(),qa=_g;function Mg(e,r){return e&&qa(e,r,H)}var Ja=Mg;function wg(e,r){return function(s,n){if(s==null)return s;if(!me(s))return e(s,n);var i=s.length,o=r?i:-1,c=Object(s);while(r?o--:++o<i)if(n(c[o],o,c)===!1)break;return s}}var Za=wg;var Pg=Za(Ja),Ge=Pg;function Ug(e,r){var s=!0;return Ge(e,function(n,i,o){return s=!!r(n,i,o),s}),s}var Qa=Ug;function Dg(e,r){var s=-1,n=e==null?0:e.length;while(++s<n)if(r(e[s],s,e))return!0;return!1}var en=Dg;var Fg=1,Bg=2;function $g(e,r,s,n,i,o){var c=s&Fg,u=e.length,a=r.length;if(u!=a&&!(c&&a>u))return!1;var f=o.get(e),d=o.get(r);if(f&&d)return f==r&&d==e;var m=-1,g=!0,y=s&Bg?new Nr:void 0;o.set(e,r),o.set(r,e);while(++m<u){var k=e[m],_=r[m];if(n)var C=c?n(_,k,m,r,e,o):n(k,_,m,e,r,o);if(C!==void 0){if(C)continue;g=!1;break}if(y){if(!en(r,function(x,N){if(!Cr(y,N)&&(k===x||i(k,x,s,n,o)))return y.push(N)})){g=!1;break}}else if(!(k===_||i(k,_,s,n,o))){g=!1;break}}return o.delete(e),o.delete(r),g}var tn=$g;function Gg(e){var r=-1,s=Array(e.size);return e.forEach(function(n,i){s[++r]=[i,n]}),s}var el=Gg;function Wg(e){var r=-1,s=Array(e.size);return e.forEach(function(n){s[++r]=n}),s}var kr=Wg;var jg=1,Kg=2,zg="[object Boolean]",Vg="[object Date]",Hg="[object Error]",Yg="[object Map]",Xg="[object Number]",qg="[object RegExp]",Jg="[object Set]",Zg="[object String]",Qg="[object Symbol]",eT="[object ArrayBuffer]",tT="[object DataView]",tl=Oe?Oe.prototype:void 0,ni=tl?tl.valueOf:void 0;function rT(e,r,s,n,i,o,c){switch(s){case tT:if(e.byteLength!=r.byteLength||e.byteOffset!=r.byteOffset)return!1;e=e.buffer,r=r.buffer;case eT:if(e.byteLength!=r.byteLength||!o(new Or(e),new Or(r)))return!1;return!0;case zg:case Vg:case Xg:return ft(+e,+r);case Hg:return e.name==r.name&&e.message==r.message;case qg:case Zg:return e==r+"";case Yg:var u=el;case Jg:var a=n&jg;if(u||(u=kr),e.size!=r.size&&!a)return!1;var f=c.get(e);if(f)return f==r;n|=Kg,c.set(e,r);var d=tn(u(e),u(r),n,i,o,c);return c.delete(e),d;case Qg:if(ni)return ni.call(e)==ni.call(r)}return!1}var rl=rT;var sT=1,nT=Object.prototype,iT=nT.hasOwnProperty;function oT(e,r,s,n,i,o){var c=s&sT,u=rs(e),a=u.length,f=rs(r),d=f.length;if(a!=d&&!c)return!1;var m=a;while(m--){var g=u[m];if(!(c?g in r:iT.call(r,g)))return!1}var y=o.get(e),k=o.get(r);if(y&&k)return y==r&&k==e;var _=!0;o.set(e,r),o.set(r,e);var C=c;while(++m<a){g=u[m];var x=e[g],N=r[g];if(n)var T=c?n(N,x,g,r,e,o):n(x,N,g,e,r,o);if(!(T===void 0?x===N||i(x,N,s,n,o):T)){_=!1;break}C||(C=g=="constructor")}if(_&&!C){var w=e.constructor,ee=r.constructor;if(w!=ee&&(("constructor"in e)&&("constructor"in r))&&!(typeof w=="function"&&w instanceof w&&typeof ee=="function"&&ee instanceof ee))_=!1}return o.delete(e),o.delete(r),_}var sl=oT;var aT=1,nl="[object Arguments]",il="[object Array]",rn="[object Object]",lT=Object.prototype,ol=lT.hasOwnProperty;function cT(e,r,s,n,i,o){var c=b(e),u=b(r),a=c?il:it(e),f=u?il:it(r);a=a==nl?rn:a,f=f==nl?rn:f;var d=a==rn,m=f==rn,g=a==f;if(g&&pt(e)){if(!pt(r))return!1;c=!0,d=!1}if(g&&!d)return o||(o=new Kt),c||gr(e)?tn(e,r,s,n,i,o):rl(e,r,a,s,n,i,o);if(!(s&aT)){var y=d&&ol.call(e,"__wrapped__"),k=m&&ol.call(r,"__wrapped__");if(y||k){var _=y?e.value():e,C=k?r.value():r;return o||(o=new Kt),i(_,C,s,n,o)}}if(!g)return!1;return o||(o=new Kt),sl(e,r,s,n,i,o)}var al=cT;function ll(e,r,s,n,i){if(e===r)return!0;if(e==null||r==null||!ue(e)&&!ue(r))return e!==e&&r!==r;return al(e,r,s,n,ll,i)}var sn=ll;var uT=1,fT=2;function hT(e,r,s,n){var i=s.length,o=i,c=!n;if(e==null)return!o;e=Object(e);while(i--){var u=s[i];if(c&&u[2]?u[1]!==e[u[0]]:!(u[0]in e))return!1}while(++i<o){u=s[i];var a=u[0],f=e[a],d=u[1];if(c&&u[2]){if(f===void 0&&!(a in e))return!1}else{var m=new Kt;if(n)var g=n(f,d,a,e,r,m);if(!(g===void 0?sn(d,f,uT|fT,n,m):g))return!1}}return!0}var cl=hT;function dT(e){return e===e&&!ne(e)}var nn=dT;function pT(e){var r=H(e),s=r.length;while(s--){var n=r[s],i=e[n];r[s]=[n,i,nn(i)]}return r}var ul=pT;function mT(e,r){return function(s){if(s==null)return!1;return s[e]===r&&(r!==void 0||(e in Object(s)))}}var on=mT;function gT(e){var r=ul(e);if(r.length==1&&r[0][2])return on(r[0][0],r[0][1]);return function(s){return s===e||cl(s,e,r)}}var fl=gT;var TT=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ET=/^\w*$/;function yT(e,r){if(b(e))return!1;var s=typeof e;if(s=="number"||s=="symbol"||s=="boolean"||e==null||Yt(e))return!0;return ET.test(e)||!TT.test(e)||r!=null&&e in Object(r)}var _r=yT;var AT="Expected a function";function ii(e,r){if(typeof e!="function"||r!=null&&typeof r!="function")throw TypeError(AT);var s=function(){var n=arguments,i=r?r.apply(this,n):n[0],o=s.cache;if(o.has(i))return o.get(i);var c=e.apply(this,n);return s.cache=o.set(i,c)||o,c};return s.cache=new(ii.Cache||er),s}ii.Cache=er;var hl=ii;var xT=500;function ST(e){var r=hl(e,function(n){if(s.size===xT)s.clear();return n}),s=r.cache;return r}var dl=ST;var RT=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,OT=/\\(\\)?/g,LT=dl(function(e){var r=[];if(e.charCodeAt(0)===46)r.push("");return e.replace(RT,function(s,n,i,o){r.push(i?o.replace(OT,"$1"):n||s)}),r}),pl=LT;var IT=1/0,ml=Oe?Oe.prototype:void 0,gl=ml?ml.toString:void 0;function Tl(e){if(typeof e=="string")return e;if(b(e))return Et(e,Tl)+"";if(Yt(e))return gl?gl.call(e):"";var r=e+"";return r=="0"&&1/e==-IT?"-0":r}var El=Tl;function NT(e){return e==null?"":El(e)}var yl=NT;function bT(e,r){if(b(e))return e;return _r(e,r)?[e]:pl(yl(e))}var Xt=bT;var CT=1/0;function vT(e){if(typeof e=="string"||Yt(e))return e;var r=e+"";return r=="0"&&1/e==-CT?"-0":r}var At=vT;function kT(e,r){r=Xt(r,e);var s=0,n=r.length;while(e!=null&&s<n)e=e[At(r[s++])];return s&&s==n?e:void 0}var wr=kT;function _T(e,r,s){var n=e==null?void 0:wr(e,r);return n===void 0?s:n}var Al=_T;function MT(e,r){return e!=null&&r in Object(e)}var xl=MT;function wT(e,r,s){r=Xt(r,e);var n=-1,i=r.length,o=!1;while(++n<i){var c=At(r[n]);if(!(o=e!=null&&s(e,c)))break;e=e[c]}if(o||++n!=i)return o;return i=e==null?0:e.length,!!i&&mr(i)&&Dt(c,i)&&(b(e)||Bt(e))}var an=wT;function PT(e,r){return e!=null&&an(e,r,xl)}var Sl=PT;var UT=1,DT=2;function FT(e,r){if(_r(e)&&nn(r))return on(At(e),r);return function(s){var n=Al(s,e);return n===void 0&&n===r?Sl(s,e):sn(r,n,UT|DT)}}var Rl=FT;function BT(e){return function(r){return r==null?void 0:r[e]}}var Ol=BT;function $T(e){return function(r){return wr(r,e)}}var Ll=$T;function GT(e){return _r(e)?Ol(At(e)):Ll(e)}var Il=GT;function WT(e){if(typeof e=="function")return e;if(e==null)return nt;if(typeof e=="object")return b(e)?Rl(e[0],e[1]):fl(e);return Il(e)}var ge=WT;function jT(e,r,s){var n=b(e)?Ya:Qa;if(s&&Ft(e,r,s))r=void 0;return n(e,ge(r,3))}var ve=jT;function KT(e,r){var s=[];return Ge(e,function(n,i,o){if(r(n,i,o))s.push(n)}),s}var ln=KT;function zT(e,r){var s=b(e)?xr:ln;return s(e,ge(r,3))}var ke=zT;function VT(e){return function(r,s,n){var i=Object(r);if(!me(r)){var o=ge(s,3);r=H(r),s=function(u){return o(i[u],u,i)}}var c=e(r,s,n);return c>-1?i[o?r[c]:c]:void 0}}var Nl=VT;var HT=Math.max;function YT(e,r,s){var n=e==null?0:e.length;if(!n)return-1;var i=s==null?0:yt(s);if(i<0)i=HT(n+i,0);return qs(e,ge(r,3),i)}var bl=YT;var XT=Nl(bl),xt=XT;function qT(e){return e&&e.length?e[0]:void 0}var Le=qT;function JT(e,r){var s=-1,n=me(e)?Array(e.length):[];return Ge(e,function(i,o,c){n[++s]=r(i,o,c)}),n}var Cl=JT;function ZT(e,r){var s=b(e)?Et:Cl;return s(e,ge(r,3))}var A=ZT;function QT(e,r){return vr(A(e,r),1)}var De=QT;function eE(e){var r=e==null?0:e.length;return r?vr(e,1):[]}var xe=eE;function tE(e){return typeof e=="function"?e:nt}var vl=tE;function rE(e,r){var s=b(e)?Ds:Ge;return s(e,vl(r))}var S=rE;function sE(e,r,s,n){var i=-1,o=e==null?0:e.length;while(++i<o){var c=e[i];r(n,c,s(c),e)}return n}var kl=sE;function nE(e,r,s,n){return Ge(e,function(i,o,c){r(n,i,s(i),c)}),n}var _l=nE;function iE(e,r){return function(s,n){var i=b(s)?kl:_l,o=r?r():{};return i(s,e,ge(n,2),o)}}var Ml=iE;var oE=Object.prototype,aE=oE.hasOwnProperty,lE=Ml(function(e,r,s){if(aE.call(e,s))e[s].push(r);else dr(e,s,[r])}),oi=lE;var cE=Object.prototype,uE=cE.hasOwnProperty;function fE(e,r){return e!=null&&uE.call(e,r)}var wl=fE;function hE(e,r){return e!=null&&an(e,r,wl)}var I=hE;var dE="[object String]";function pE(e){return typeof e=="string"||!b(e)&&ue(e)&&Pe(e)==dE}var Se=pE;function mE(e,r){return Et(r,function(s){return e[s]})}var Pl=mE;function gE(e){return e==null?[]:Pl(e,H(e))}var V=gE;var TE=Math.max;function EE(e,r,s,n){e=me(e)?e:V(e),s=s&&!n?yt(s):0;var i=e.length;if(s<0)s=TE(i+s,0);return Se(e)?s<=i&&e.indexOf(r,s)>-1:!!i&&br(e,r,s)>-1}var te=EE;var yE=Math.max;function AE(e,r,s){var n=e==null?0:e.length;if(!n)return-1;var i=s==null?0:yt(s);if(i<0)i=yE(n+i,0);return br(e,r,i)}var cn=AE;var xE="[object Map]",SE="[object Set]",RE=Object.prototype,OE=RE.hasOwnProperty;function LE(e){if(e==null)return!0;if(me(e)&&(b(e)||typeof e=="string"||typeof e.splice=="function"||pt(e)||gr(e)||Bt(e)))return!e.length;var r=it(e);if(r==xE||r==SE)return!e.size;if(dt(e))return!Us(e).length;for(var s in e)if(OE.call(e,s))return!1;return!0}var P=LE;var IE="[object RegExp]";function NE(e){return ue(e)&&Pe(e)==IE}var Ul=NE;var Dl=He&&He.isRegExp,bE=Dl?mt(Dl):Ul,Ze=bE;function CE(e){return e===void 0}var _e=CE;function vE(e){var r=e==null?0:e.length;return r?e[r-1]:void 0}var ot=vE;function kE(){}var le=kE;function _E(e,r,s,n){if(!ne(e))return e;r=Xt(r,e);var i=-1,o=r.length,c=o-1,u=e;while(u!=null&&++i<o){var a=At(r[i]),f=s;if(a==="__proto__"||a==="constructor"||a==="prototype")return e;if(i!=c){var d=u[a];if(f=n?n(d,a,u):void 0,f===void 0)f=ne(d)?d:Dt(r[i+1])?[]:{}}Ut(u,a,f),u=u[a]}return e}var Fl=_E;function ME(e,r,s){var n=-1,i=r.length,o={};while(++n<i){var c=r[n],u=wr(e,c);if(s(u,c))Fl(o,Xt(c,e),u)}return o}var Bl=ME;function wE(e,r){if(e==null)return{};var s=Et(Ks(e),function(n){return[n]});return r=ge(r),Bl(e,s,function(n,i){return r(n,i[0])})}var We=wE;function PE(e,r,s,n){var i=-1,o=e==null?0:e.length;if(n&&o)s=e[++i];while(++i<o)s=r(s,e[i],i,e);return s}var $l=PE;function UE(e,r,s,n,i){return i(e,function(o,c,u){s=n?(n=!1,o):r(s,o,c,u)}),s}var Gl=UE;function DE(e,r,s){var n=b(e)?$l:Gl,i=arguments.length<3;return n(e,ge(r,4),s,i,Ge)}var Te=DE;var FE="Expected a function";function BE(e){if(typeof e!="function")throw TypeError(FE);return function(){var r=arguments;switch(r.length){case 0:return!e.call(this);case 1:return!e.call(this,r[0]);case 2:return!e.call(this,r[0],r[1]);case 3:return!e.call(this,r[0],r[1],r[2])}return!e.apply(this,r)}}var Wl=BE;function $E(e,r){var s=b(e)?xr:ln;return s(e,Wl(ge(r,3)))}var qt=$E;function GE(e,r){var s;return Ge(e,function(n,i,o){return s=r(n,i,o),!s}),!!s}var jl=GE;function WE(e,r,s){var n=b(e)?en:jl;if(s&&Ft(e,r,s))r=void 0;return n(e,ge(r,3))}var ss=WE;var jE=1/0,KE=!(Vt&&1/kr(new Vt([,-0]))[1]==jE)?le:function(e){return new Vt(e)},Kl=KE;var zE=200;function VE(e,r,s){var n=-1,i=Js,o=e.length,c=!0,u=[],a=u;if(s)c=!1,i=Zs;else if(o>=zE){var f=r?null:Kl(e);if(f)return kr(f);c=!1,i=Cr,a=new Nr}else a=r?[]:u;e:while(++n<o){var d=e[n],m=r?r(d):d;if(d=s||d!==0?d:0,c&&m===m){var g=a.length;while(g--)if(a[g]===m)continue e;if(r)a.push(m);u.push(d)}else if(!i(a,m,s)){if(a!==u)a.push(m);u.push(d)}}return u}var zl=VE;function HE(e){return e&&e.length?zl(e):[]}var Pr=HE;function Ur(e){if(console&&console.error)console.error(`Error: ${e}`)}function ns(e){if(console&&console.warn)console.warn(`Warning: ${e}`)}function is(e){let r=new Date().getTime(),s=e();return{time:new Date().getTime()-r,value:s}}function os(e){function r(){}r.prototype=e;let s=new r;function n(){return typeof s.bar}return n(),n(),e;(0,eval)(e)}function YE(e){if(XE(e))return e.LABEL;else return e.name}function XE(e){return Se(e.LABEL)&&e.LABEL!==""}class Qe{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),S(this.definition,(r)=>{r.accept(e)})}}class Z extends Qe{constructor(e){super([]);this.idx=1,Ne(this,We(e,(r)=>r!==void 0))}set definition(e){}get definition(){if(this.referencedRule!==void 0)return this.referencedRule.definition;return[]}accept(e){e.visit(this)}}class je extends Qe{constructor(e){super(e.definition);this.orgText="",Ne(this,We(e,(r)=>r!==void 0))}}class Q extends Qe{constructor(e){super(e.definition);this.ignoreAmbiguities=!1,Ne(this,We(e,(r)=>r!==void 0))}}class re extends Qe{constructor(e){super(e.definition);this.idx=1,Ne(this,We(e,(r)=>r!==void 0))}}class Ee extends Qe{constructor(e){super(e.definition);this.idx=1,Ne(this,We(e,(r)=>r!==void 0))}}class ye extends Qe{constructor(e){super(e.definition);this.idx=1,Ne(this,We(e,(r)=>r!==void 0))}}class B extends Qe{constructor(e){super(e.definition);this.idx=1,Ne(this,We(e,(r)=>r!==void 0))}}class he extends Qe{constructor(e){super(e.definition);this.idx=1,Ne(this,We(e,(r)=>r!==void 0))}}class de extends Qe{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition);this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,Ne(this,We(e,(r)=>r!==void 0))}}class D{constructor(e){this.idx=1,Ne(this,We(e,(r)=>r!==void 0))}accept(e){e.visit(this)}}function un(e){return A(e,Dr)}function Dr(e){function r(s){return A(s,Dr)}if(e instanceof Z){let s={type:"NonTerminal",name:e.nonTerminalName,idx:e.idx};if(Se(e.label))s.label=e.label;return s}else if(e instanceof Q)return{type:"Alternative",definition:r(e.definition)};else if(e instanceof re)return{type:"Option",idx:e.idx,definition:r(e.definition)};else if(e instanceof Ee)return{type:"RepetitionMandatory",idx:e.idx,definition:r(e.definition)};else if(e instanceof ye)return{type:"RepetitionMandatoryWithSeparator",idx:e.idx,separator:Dr(new D({terminalType:e.separator})),definition:r(e.definition)};else if(e instanceof he)return{type:"RepetitionWithSeparator",idx:e.idx,separator:Dr(new D({terminalType:e.separator})),definition:r(e.definition)};else if(e instanceof B)return{type:"Repetition",idx:e.idx,definition:r(e.definition)};else if(e instanceof de)return{type:"Alternation",idx:e.idx,definition:r(e.definition)};else if(e instanceof D){let s={type:"Terminal",name:e.terminalType.name,label:YE(e.terminalType),idx:e.idx};if(Se(e.label))s.terminalLabel=e.label;let n=e.terminalType.PATTERN;if(e.terminalType.PATTERN)s.pattern=Ze(n)?n.source:n;return s}else if(e instanceof je)return{type:"Rule",name:e.name,orgText:e.orgText,definition:r(e.definition)};else throw Error("non exhaustive match")}class Ke{visit(e){let r=e;switch(r.constructor){case Z:return this.visitNonTerminal(r);case Q:return this.visitAlternative(r);case re:return this.visitOption(r);case Ee:return this.visitRepetitionMandatory(r);case ye:return this.visitRepetitionMandatoryWithSeparator(r);case he:return this.visitRepetitionWithSeparator(r);case B:return this.visitRepetition(r);case de:return this.visitAlternation(r);case D:return this.visitTerminal(r);case je:return this.visitRule(r);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}}function ai(e){return e instanceof Q||e instanceof re||e instanceof B||e instanceof Ee||e instanceof ye||e instanceof he||e instanceof D||e instanceof je}function rr(e,r=[]){if(e instanceof re||e instanceof B||e instanceof he)return!0;if(e instanceof de)return ss(e.definition,(n)=>rr(n,r));else if(e instanceof Z&&te(r,e))return!1;else if(e instanceof Qe){if(e instanceof Z)r.push(e);return ve(e.definition,(n)=>rr(n,r))}else return!1}function li(e){return e instanceof de}function ze(e){if(e instanceof Z)return"SUBRULE";else if(e instanceof re)return"OPTION";else if(e instanceof de)return"OR";else if(e instanceof Ee)return"AT_LEAST_ONE";else if(e instanceof ye)return"AT_LEAST_ONE_SEP";else if(e instanceof he)return"MANY_SEP";else if(e instanceof B)return"MANY";else if(e instanceof D)return"CONSUME";else throw Error("non exhaustive match")}class Jt{walk(e,r=[]){S(e.definition,(s,n)=>{let i=fe(e.definition,n+1);if(s instanceof Z)this.walkProdRef(s,i,r);else if(s instanceof D)this.walkTerminal(s,i,r);else if(s instanceof Q)this.walkFlat(s,i,r);else if(s instanceof re)this.walkOption(s,i,r);else if(s instanceof Ee)this.walkAtLeastOne(s,i,r);else if(s instanceof ye)this.walkAtLeastOneSep(s,i,r);else if(s instanceof he)this.walkManySep(s,i,r);else if(s instanceof B)this.walkMany(s,i,r);else if(s instanceof de)this.walkOr(s,i,r);else throw Error("non exhaustive match")})}walkTerminal(e,r,s){}walkProdRef(e,r,s){}walkFlat(e,r,s){let n=r.concat(s);this.walk(e,n)}walkOption(e,r,s){let n=r.concat(s);this.walk(e,n)}walkAtLeastOne(e,r,s){let n=[new re({definition:e.definition})].concat(r,s);this.walk(e,n)}walkAtLeastOneSep(e,r,s){let n=Vl(e,r,s);this.walk(e,n)}walkMany(e,r,s){let n=[new re({definition:e.definition})].concat(r,s);this.walk(e,n)}walkManySep(e,r,s){let n=Vl(e,r,s);this.walk(e,n)}walkOr(e,r,s){let n=r.concat(s);S(e.definition,(i)=>{let o=new Q({definition:[i]});this.walk(o,n)})}}function Vl(e,r,s){return[new re({definition:[new D({terminalType:e.separator})].concat(e.definition)})].concat(r,s)}function sr(e){if(e instanceof Z)return sr(e.referencedRule);else if(e instanceof D)return ZE(e);else if(ai(e))return qE(e);else if(li(e))return JE(e);else throw Error("non exhaustive match")}function qE(e){let r=[],s=e.definition,n=0,i=s.length>n,o,c=!0;while(i&&c)o=s[n],c=rr(o),r=r.concat(sr(o)),n=n+1,i=s.length>n;return Pr(r)}function JE(e){let r=A(e.definition,(s)=>sr(s));return Pr(xe(r))}function ZE(e){return[e.terminalType]}var fn="_~IN~_";class Hl extends Jt{constructor(e){super();this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,r,s){}walkProdRef(e,r,s){let n=QE(e.referencedRule,e.idx)+this.topProd.name,i=r.concat(s),o=new Q({definition:i}),c=sr(o);this.follows[n]=c}}function Yl(e){let r={};return S(e,(s)=>{let n=new Hl(s).startWalking();Ne(r,n)}),r}function QE(e,r){return e.name+r+fn}function M(e){return e.charCodeAt(0)}function hn(e,r){if(Array.isArray(e))e.forEach(function(s){r.push(s)});else r.push(e)}function Fr(e,r){if(e[r]===!0)throw"duplicate flag "+r;let s=e[r];e[r]=!0}function nr(e){if(e===void 0)throw Error("Internal Error - Should never get here!");return!0}function as(){throw Error("Internal Error - Should never get here!")}function ci(e){return e.type==="Character"}var ls=[];for(let e=M("0");e<=M("9");e++)ls.push(e);var cs=[M("_")].concat(ls);for(let e=M("a");e<=M("z");e++)cs.push(e);for(let e=M("A");e<=M("Z");e++)cs.push(e);var ui=[M(" "),M("\f"),M(`
2
+ `),M("\r"),M("\t"),M("\v"),M("\t"),M(" "),M(" "),M(" "),M(" "),M(" "),M(" "),M(" "),M(" "),M(" "),M(" "),M(" "),M(" "),M(" "),M("\u2028"),M("\u2029"),M(" "),M(" "),M(" "),M("\uFEFF")];var ey=/[0-9a-fA-F]/,dn=/[0-9]/,ty=/[1-9]/;class mn{constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx}pattern(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar("/");let r=this.disjunction();this.consumeChar("/");let s={type:"Flags",loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};while(this.isRegExpFlag())switch(this.popChar()){case"g":Fr(s,"global");break;case"i":Fr(s,"ignoreCase");break;case"m":Fr(s,"multiLine");break;case"u":Fr(s,"unicode");break;case"y":Fr(s,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:s,value:r,loc:this.loc(0)}}disjunction(){let e=[],r=this.idx;e.push(this.alternative());while(this.peekChar()==="|")this.consumeChar("|"),e.push(this.alternative());return{type:"Disjunction",value:e,loc:this.loc(r)}}alternative(){let e=[],r=this.idx;while(this.isTerm())e.push(this.term());return{type:"Alternative",value:e,loc:this.loc(r)}}term(){if(this.isAssertion())return this.assertion();else return this.atom()}assertion(){let e=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(e)};case"$":return{type:"EndAnchor",loc:this.loc(e)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(e)};case"B":return{type:"NonWordBoundary",loc:this.loc(e)}}throw Error("Invalid Assertion Escape");case"(":this.consumeChar("?");let r;switch(this.popChar()){case"=":r="Lookahead";break;case"!":r="NegativeLookahead";break;case"<":{switch(this.popChar()){case"=":r="Lookbehind";break;case"!":r="NegativeLookbehind"}break}}nr(r);let s=this.disjunction();return this.consumeChar(")"),{type:r,value:s,loc:this.loc(e)}}return as()}quantifier(e=!1){let r=void 0,s=this.idx;switch(this.popChar()){case"*":r={atLeast:0,atMost:1/0};break;case"+":r={atLeast:1,atMost:1/0};break;case"?":r={atLeast:0,atMost:1};break;case"{":let n=this.integerIncludingZero();switch(this.popChar()){case"}":r={atLeast:n,atMost:n};break;case",":let i;if(this.isDigit())i=this.integerIncludingZero(),r={atLeast:n,atMost:i};else r={atLeast:n,atMost:1/0};this.consumeChar("}");break}if(e===!0&&r===void 0)return;nr(r);break}if(e===!0&&r===void 0)return;if(nr(r)){if(this.peekChar(0)==="?")this.consumeChar("?"),r.greedy=!1;else r.greedy=!0;return r.type="Quantifier",r.loc=this.loc(s),r}}atom(){let e,r=this.idx;switch(this.peekChar()){case".":e=this.dotAll();break;case"\\":e=this.atomEscape();break;case"[":e=this.characterClass();break;case"(":e=this.group();break}if(e===void 0&&this.isPatternCharacter())e=this.patternCharacter();if(nr(e)){if(e.loc=this.loc(r),this.isQuantifier())e.quantifier=this.quantifier();return e}return as()}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[M(`
3
3
  `),M("\r"),M("\u2028"),M("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let e,r=!1;switch(this.popChar()){case"d":e=ls;break;case"D":e=ls,r=!0;break;case"s":e=ui;break;case"S":e=ui,r=!0;break;case"w":e=cs;break;case"W":e=cs,r=!0;break}if(nr(e))return{type:"Set",value:e,complement:r};return as()}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=M("\f");break;case"n":e=M(`
4
4
  `);break;case"r":e=M("\r");break;case"t":e=M("\t");break;case"v":e=M("\v");break}if(nr(e))return{type:"Character",value:e};return as()}controlLetterEscapeAtom(){this.consumeChar("c");let e=this.popChar();if(/[a-zA-Z]/.test(e)===!1)throw Error("Invalid ");return{type:"Character",value:e.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar("0"),{type:"Character",value:M("\x00")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){let e=this.popChar();return{type:"Character",value:M(e)}}classPatternCharacterAtom(){switch(this.peekChar()){case`
5
5
  `:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:let e=this.popChar();return{type:"Character",value:M(e)}}}characterClass(){let e=[],r=!1;if(this.consumeChar("["),this.peekChar(0)==="^")this.consumeChar("^"),r=!0;while(this.isClassAtom()){let s=this.classAtom(),n=s.type==="Character";if(ci(s)&&this.isRangeDash()){this.consumeChar("-");let i=this.classAtom(),o=i.type==="Character";if(ci(i)){if(i.value<s.value)throw Error("Range out of order in character class");e.push({from:s.value,to:i.value})}else hn(s.value,e),e.push(M("-")),hn(i.value,e)}else hn(s.value,e)}return this.consumeChar("]"),{type:"Set",complement:r,value:e}}classAtom(){switch(this.peekChar()){case"]":case`
6
- `:case"\r":case"\u2028":case"\u2029":throw Error("TBD");case"\\":return this.classEscape();default:return this.classPatternCharacterAtom()}}classEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"b":return this.consumeChar("b"),{type:"Character",value:M("\b")};case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}group(){let e=!0;switch(this.consumeChar("("),this.peekChar(0)){case"?":this.consumeChar("?"),this.consumeChar(":"),e=!1;break;default:this.groupIdx++;break}let r=this.disjunction();this.consumeChar(")");let s={type:"Group",capturing:e,value:r};if(e)s.idx=this.groupIdx;return s}positiveInteger(){let e=this.popChar();if(ty.test(e)===!1)throw Error("Expecting a positive integer");while(pn.test(this.peekChar(0)))e+=this.popChar();return parseInt(e,10)}integerIncludingZero(){let e=this.popChar();if(pn.test(e)===!1)throw Error("Expecting an integer");while(pn.test(this.peekChar(0)))e+=this.popChar();return parseInt(e,10)}patternCharacter(){let e=this.popChar();switch(e){case`
7
- `:case"\r":case"\u2028":case"\u2029":case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":throw Error("TBD");default:return{type:"Character",value:M(e)}}}isRegExpFlag(){switch(this.peekChar(0)){case"g":case"i":case"m":case"u":case"y":return!0;default:return!1}}isRangeDash(){return this.peekChar()==="-"&&this.isClassAtom(1)}isDigit(){return pn.test(this.peekChar(0))}isClassAtom(e=0){switch(this.peekChar(e)){case"]":case`
6
+ `:case"\r":case"\u2028":case"\u2029":throw Error("TBD");case"\\":return this.classEscape();default:return this.classPatternCharacterAtom()}}classEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"b":return this.consumeChar("b"),{type:"Character",value:M("\b")};case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}group(){let e=!0;switch(this.consumeChar("("),this.peekChar(0)){case"?":this.consumeChar("?"),this.consumeChar(":"),e=!1;break;default:this.groupIdx++;break}let r=this.disjunction();this.consumeChar(")");let s={type:"Group",capturing:e,value:r};if(e)s.idx=this.groupIdx;return s}positiveInteger(){let e=this.popChar();if(ty.test(e)===!1)throw Error("Expecting a positive integer");while(dn.test(this.peekChar(0)))e+=this.popChar();return parseInt(e,10)}integerIncludingZero(){let e=this.popChar();if(dn.test(e)===!1)throw Error("Expecting an integer");while(dn.test(this.peekChar(0)))e+=this.popChar();return parseInt(e,10)}patternCharacter(){let e=this.popChar();switch(e){case`
7
+ `:case"\r":case"\u2028":case"\u2029":case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":throw Error("TBD");default:return{type:"Character",value:M(e)}}}isRegExpFlag(){switch(this.peekChar(0)){case"g":case"i":case"m":case"u":case"y":return!0;default:return!1}}isRangeDash(){return this.peekChar()==="-"&&this.isClassAtom(1)}isDigit(){return dn.test(this.peekChar(0))}isClassAtom(e=0){switch(this.peekChar(e)){case"]":case`
8
8
  `:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}isTerm(){return this.isAtom()||this.isAssertion()}isAtom(){if(this.isPatternCharacter())return!0;switch(this.peekChar(0)){case".":case"\\":case"[":case"(":return!0;default:return!1}}isAssertion(){switch(this.peekChar(0)){case"^":case"$":return!0;case"\\":switch(this.peekChar(1)){case"b":case"B":return!0;default:return!1}case"(":return this.peekChar(1)==="?"&&(this.peekChar(2)==="="||this.peekChar(2)==="!"||this.peekChar(2)==="<"&&(this.peekChar(3)==="="||this.peekChar(3)==="!"));default:return!1}}isQuantifier(){let e=this.saveState();try{return this.quantifier(!0)!==void 0}catch(r){return!1}finally{this.restoreState(e)}}isPatternCharacter(){switch(this.peekChar()){case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":case"/":case`
9
9
  `:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}parseHexDigits(e){let r="";for(let n=0;n<e;n++){let i=this.popChar();if(ey.test(i)===!1)throw Error("Expecting a HexDecimal digits");r+=i}return{type:"Character",value:parseInt(r,16)}}peekChar(e=0){return this.input[this.idx+e]}popChar(){let e=this.peekChar(0);return this.consumeChar(void 0),e}consumeChar(e){if(e!==void 0&&this.input[this.idx]!==e)throw Error("Expected: '"+e+"' but found: '"+this.input[this.idx]+"' at offset: "+this.idx);if(this.idx>=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(e){return{begin:e,end:this.idx}}}class ir{visitChildren(e){for(let r in e){let s=e[r];if(e.hasOwnProperty(r)){if(s.type!==void 0)this.visit(s);else if(Array.isArray(s))s.forEach((n)=>{this.visit(n)},this)}}}visit(e){switch(e.type){case"Pattern":this.visitPattern(e);break;case"Flags":this.visitFlags(e);break;case"Disjunction":this.visitDisjunction(e);break;case"Alternative":this.visitAlternative(e);break;case"StartAnchor":this.visitStartAnchor(e);break;case"EndAnchor":this.visitEndAnchor(e);break;case"WordBoundary":this.visitWordBoundary(e);break;case"NonWordBoundary":this.visitNonWordBoundary(e);break;case"Lookahead":this.visitLookahead(e);break;case"NegativeLookahead":this.visitNegativeLookahead(e);break;case"Lookbehind":this.visitLookbehind(e);break;case"NegativeLookbehind":this.visitNegativeLookbehind(e);break;case"Character":this.visitCharacter(e);break;case"Set":this.visitSet(e);break;case"Group":this.visitGroup(e);break;case"GroupBackReference":this.visitGroupBackReference(e);break;case"Quantifier":this.visitQuantifier(e);break}this.visitChildren(e)}visitPattern(e){}visitFlags(e){}visitDisjunction(e){}visitAlternative(e){}visitStartAnchor(e){}visitEndAnchor(e){}visitWordBoundary(e){}visitNonWordBoundary(e){}visitLookahead(e){}visitNegativeLookahead(e){}visitLookbehind(e){}visitNegativeLookbehind(e){}visitCharacter(e){}visitSet(e){}visitGroup(e){}visitGroupBackReference(e){}visitQuantifier(e){}}var gn={},ry=new mn;function Br(e){let r=e.toString();if(gn.hasOwnProperty(r))return gn[r];else{let s=ry.pattern(r);return gn[r]=s,s}}function Xl(){gn={}}var Jl="Complement Sets are not supported for first char optimization",us=`Unable to use "first char" lexer optimizations:
10
10
  `;function Zl(e,r=!1){try{let s=Br(e);return fi(s.value,{},s.flags.ignoreCase)}catch(s){if(s.message===Jl){if(r)ns(`${us} Unable to optimize: < ${e.toString()} >
@@ -114,7 +114,7 @@ Make sure that all grammar rule definitions are done before 'performSelfAnalysis
114
114
  `){if(u===0||e[u-1]!=="\r")i++,o=1}else o++}return{line:i,column:o}},"locationAtOffset"),BA=t((e,r,s,n)=>{let i=/\bposition (\d+)\b/u.exec(e);if(i)return zi(r,Number.parseInt(i[1],10),s,n);let o=/\bline (\d+) column (\d+)\b/u.exec(e);if(o){let c=Number.parseInt(o[1],10),u=Number.parseInt(o[2],10);return{line:s+c-1,column:c===1?n+u-1:u}}if(/unexpected end|end of json input/iu.test(e))return zi(r,r.length,s,n);return},"locationFromErrorMessage"),be=class extends Error{constructor(e){super("Invalid JSON token");this.offset=e}static{t(this,"JsonWalkError")}},pu=class{constructor(e){this.text=e,this.offset=0,this.propertyOrder={}}static{t(this,"PropertyOrderCollector")}collect(){if(this.skipWhitespace(),this.collectValue(""),this.skipWhitespace(),this.offset!==this.text.length)throw new be(this.offset);return this.propertyOrder}collectValue(e){this.skipWhitespace();let r=this.text[this.offset];if(r==="{")this.collectObject(e);else if(r==="[")this.collectArray(e);else if(r==='"')this.readString(!1);else if(r==="t")this.consumeLiteral("true");else if(r==="f")this.consumeLiteral("false");else if(r==="n")this.consumeLiteral("null");else if(r==="-"||r>="0"&&r<="9")this.consumeNumber();else throw new be(this.offset)}collectObject(e){this.offset++;let r=[],s=new Set;if(this.propertyOrder[e]=r,this.skipWhitespace(),this.text[this.offset]==="}"){this.offset++;return}while(this.offset<this.text.length){if(this.text[this.offset]!=='"')throw new be(this.offset);let n=this.readString(!0),i=`${e}/${n.replaceAll("~","~0").replaceAll("/","~1")}`;if(s.has(n))this.deletePointerSubtree(i);else s.add(n),r.push(n);if(this.skipWhitespace(),this.text[this.offset]!==":")throw new be(this.offset);if(this.offset++,this.collectValue(i),this.skipWhitespace(),this.text[this.offset]==="}"){this.offset++;return}if(this.text[this.offset]!==",")throw new be(this.offset);this.offset++,this.skipWhitespace()}throw new be(this.offset)}collectArray(e){if(this.offset++,this.skipWhitespace(),this.text[this.offset]==="]"){this.offset++;return}let r=0;while(this.offset<this.text.length){if(this.collectValue(`${e}/${r}`),r++,this.skipWhitespace(),this.text[this.offset]==="]"){this.offset++;return}if(this.text[this.offset]!==",")throw new be(this.offset);this.offset++,this.skipWhitespace()}throw new be(this.offset)}readString(e){this.offset++;let r="";while(this.offset<this.text.length){let s=this.offset,n=this.text[this.offset++];if(n==='"')return r;if(n.charCodeAt(0)<32)throw new be(s);if(n!=="\\"){if(e)r+=n;continue}let i=this.offset,o=this.text[this.offset++];switch(o){case'"':case"\\":case"/":if(e)r+=o;break;case"b":if(e)r+="\b";break;case"f":if(e)r+="\f";break;case"n":if(e)r+=`
115
115
  `;break;case"r":if(e)r+="\r";break;case"t":if(e)r+="\t";break;case"u":{let c=this.text.slice(this.offset,this.offset+4);if(!/^[\dA-Fa-f]{4}$/u.test(c))throw new be(this.offset);if(e)r+=String.fromCharCode(Number.parseInt(c,16));this.offset+=4;break}default:throw new be(i)}}throw new be(this.offset)}consumeLiteral(e){let r=0;for(let s of e){if(this.text[this.offset+r]!==s)throw new be(this.offset+r);r++}this.offset+=e.length}consumeNumber(){if(this.text[this.offset]==="-")this.offset++;if(this.text[this.offset]==="0")this.offset++;else if(this.text[this.offset]>="1"&&this.text[this.offset]<="9")while(this.text[this.offset]>="0"&&this.text[this.offset]<="9")this.offset++;else throw new be(this.offset);if(this.text[this.offset]==="."){if(this.offset++,this.text[this.offset]<"0"||this.text[this.offset]>"9")throw new be(this.offset);while(this.text[this.offset]>="0"&&this.text[this.offset]<="9")this.offset++}if(this.text[this.offset]==="e"||this.text[this.offset]==="E"){if(this.offset++,this.text[this.offset]==="+"||this.text[this.offset]==="-")this.offset++;if(this.text[this.offset]<"0"||this.text[this.offset]>"9")throw new be(this.offset);while(this.text[this.offset]>="0"&&this.text[this.offset]<="9")this.offset++}}skipWhitespace(){while(this.offset<this.text.length){let e=this.text[this.offset];if(e!==" "&&e!=="\t"&&e!==`
116
116
  `&&e!=="\r")return;this.offset++}}deletePointerSubtree(e){let r=`${e}/`;for(let s of Object.keys(this.propertyOrder))if(s===e||s.startsWith(r))delete this.propertyOrder[s]}};function cf(e,r,s){let n;try{n=JSON.parse(e)}catch(i){let o=i instanceof Error?i.message:String(i),c=BA(o,e,r,s);if(!c){let u=0;try{new pu(e).collect()}catch(a){if(a instanceof be)u=a.offset}c=zi(e,u,r,s)}throw new du(`Invalid JSON: ${o}`,c.line,c.column)}if(typeof n!=="object"||n===null||Array.isArray(n))throw new du("JSON value must have an object root",r,s);return{value:n,propertyOrder:new pu(e).collect()}}t(cf,"parseOrderedJsonObject");var $A=t((e)=>({shape:e.type==="normal"?"actor":e.type==="hollow"?"actor-hollow":e.type==="awesome"?"actor-awesome":"actor-icon",...e.label===e.id?{}:{label:e.label},...e.classes.length?{classes:[...e.classes]}:{},...e.styles.length?{styles:[...e.styles]}:{},attrs:{kind:"actor",actorType:e.type,business:e.business,labelType:e.labelType,...e.icon?{icon:e.icon}:{},...e.stereotype?{stereotype:e.stereotype}:{},...e.parentId?{parentId:e.parentId}:{}}}),"actorNode"),GA=t((e)=>({shape:e.shape,...e.label===e.id?{}:{label:e.label},...e.classes.length?{classes:[...e.classes]}:{},...e.styles.length?{styles:[...e.styles]}:{},attrs:{kind:"usecase",useCaseShape:e.shape,business:e.business,labelType:e.labelType,...e.stereotype?{stereotype:e.stereotype}:{},...e.parentId?{parentId:e.parentId}:{}}}),"useCaseNode"),WA=t((e)=>({label:e.label,shape:"note",attrs:{kind:"note",target:e.target,labelType:e.labelType}}),"noteNode"),jA=t((e)=>({label:e.id,shape:"json-table",...e.classes.length?{classes:[...e.classes]}:{},...e.styles.length?{styles:[...e.styles]}:{},attrs:{kind:"json",value:e.value,propertyOrder:e.propertyOrder,labelType:"text"}}),"jsonNode"),KA=t((e)=>({id:e.id,source:e.source,target:e.target,...e.label?{label:e.label}:{},...e.classes.length?{classes:[...e.classes]}:{},...e.styles.length?{styles:[...e.styles]}:{},attrs:{relationshipType:e.type,arrowType:e.arrowType,minlen:e.minlen,explicitId:e.explicitId,animate:e.animate,...e.animation?{animation:e.animation}:{},...e.labelType?{labelType:e.labelType}:{}}}),"relationshipEdge"),zA=t((e)=>({id:`${e.id}-edge`,source:e.id,target:e.target,attrs:{relationshipType:"note",arrowType:ae.LINE_SOLID,pattern:"dotted",minlen:1,explicitId:!1,animate:!1,internal:!0}}),"noteEdge"),VA=t((e,r,s,n)=>{let i={};for(let a of e.getActors().values())i[a.id]=$A(a);for(let a of e.getUseCases().values())i[a.id]=GA(a);for(let a of e.getNotes().values())i[a.id]=WA(a);for(let a of e.getJsonNodes().values())i[a.id]=jA(a);let o={};for(let a of e.getSystemBoundaries().values())o[a.id]={...a.label===a.id?{}:{title:a.label},nodes:[...a.members],...a.classes.length?{classes:[...a.classes]}:{},...a.styles.length?{styles:[...a.styles]}:{},attrs:{kind:"systemBoundary",boundaryType:a.type,labelType:a.labelType}};let c={};for(let a of e.getClassDefs().values())c[a.id]={styles:[...a.styles]};let u=e.getDirection();return{version:1,diagramType:"usecase",source:r,header:{keyword:"usecase",direction:u==="TD"?"TB":u,span:s},...e.getAccTitle()?{accTitle:e.getAccTitle()}:{},...e.getAccDescription()?{accDescr:e.getAccDescription()}:{},nodes:i,edges:[...e.getRelationships().map(KA),...[...e.getNotes().values()].map(zA)],groups:o,classDefs:c,statements:n}},"buildUsecaseGraphAST"),Me=t((e)=>`line ${e.line}, column ${e.column} [${e.span[0]},${e.span[1]})`,"locationText"),mu=t((e)=>e===void 0?"":` (label "${e}")`,"labelSuffix"),ur=t((e)=>e.generated?e.label:void 0,"generatedFrom"),Bi=t((e,r)=>{for(let s of r)if(!e.includes(s))e.push(s)},"pushUnique"),HA=class{constructor(e){this.db=e,this.source="",this.statements=[],this.elements=[],this.boundaries=[],this.jsonDrafts=[],this.relationshipDrafts=[],this.noteDrafts=[],this.metadataAssignments=[],this.classAssignments=[],this.styleAssignments=[],this.classDefinitions=[],this.directions=[],this.model=e.createModel()}static{t(this,"UsecaseModelBuilder")}reset(e){this.model=this.db.createModel(),this.source=e,this.statements=[],this.elements.length=0,this.boundaries.length=0,this.jsonDrafts.length=0,this.relationshipDrafts.length=0,this.noteDrafts.length=0,this.metadataAssignments.length=0,this.classAssignments.length=0,this.styleAssignments.length=0,this.classDefinitions.length=0,this.directions.length=0}addElement(e){this.elements.push(e)}addBoundary(e){this.boundaries.push(e)}addJson(e){this.jsonDrafts.push(e)}addRelationship(e){this.relationshipDrafts.push(e)}addNote(e){this.noteDrafts.push(e)}addMetadataAssignment(e,r,s,n){this.metadataAssignments.push({target:e,targetLocation:r,metadata:s,statement:n})}addClassDef(e,r){this.classDefinitions.push({ids:e,styles:r})}addClassAssignment(e,r){this.classAssignments.push({targets:e,classes:r})}addStyleAssignment(e,r,s){this.styleAssignments.push({target:e,location:r,styles:s})}setDirection(e){this.directions.push(e==="TD"?"TB":e)}setAccTitle(e){this.model.accTitle=e}setAccDescription(e){this.model.accDescription=e}setStatements(e){this.statements=e}getActors(){return this.model.actors}getUseCases(){return this.model.useCases}getSystemBoundaries(){return this.model.systemBoundaries}getRelationships(){return this.model.relationships}getNotes(){return this.model.notes}getJsonNodes(){return this.model.jsonNodes}getClassDefs(){return this.model.classDefs}getDirection(){return this.model.direction}getAccTitle(){return this.model.accTitle}getAccDescription(){return this.model.accDescription}finalize(e){let r=new Map,s=new Map,n=new Map,i=new Map;for(let a of this.relationshipDrafts)this.recordFirst(i,a.source.id,a.source.location.span[0]),this.recordFirst(i,a.target.id,a.target.location.span[0]);for(let a of this.elements)this.recordFirst(i,a.id,a.location.span[0]);for(let a of this.boundaries)this.recordFirst(i,a.id,a.location.span[0]);for(let a of this.jsonDrafts)this.recordFirst(i,a.id,a.location.span[0]);let o=[...this.elements.map((a)=>({offset:a.location.span[0],type:"element",value:a})),...this.boundaries.map((a)=>({offset:a.location.span[0],type:"boundary",value:a})),...this.jsonDrafts.map((a)=>({offset:a.location.span[0],type:"json",value:a})),...this.relationshipDrafts.filter((a)=>a.explicitId).map((a)=>({offset:a.explicitIdLocation.span[0],type:"edge",value:a}))].sort((a,f)=>a.offset-f.offset);for(let a of o)if(a.type==="element")this.collectElement(a.value,r,s);else if(a.type==="boundary")this.collectBoundary(a.value,r,n);else if(a.type==="json")this.registerUnique(r,a.value.id,"json",a.value.location,!1);else this.registerUnique(r,a.value.explicitId,"edge",a.value.explicitIdLocation,!1);this.materializeElements(s,i),this.materializeBoundaries(n,i),this.materializeJson(i);let c=this.materializeRelationships(r,s,i);this.reorderElements(s,i),this.applyMetadataAssignments(r,s,n,c),this.validateAndRefreshElements(s),this.refreshBoundaries(n,s),this.materializeNotes(r),this.applyClassDefinitions(),this.applyClassesAndStyles(r,c),this.model.direction=this.directions.at(-1)??this.model.direction,this.model.symbols=new Map([...r].map(([a,f])=>[a,f.kind]));let u=VA(this,this.source,e,this.statements);return this.model.ast=u,this.db.commit(this.model),u}collectElement(e,r,s){let n=r.get(e.id),i=ur({generated:e.generated,label:e.label.text});if(n&&n.kind!==e.kind)this.conflict(`ID '${e.id}' is declared as both ${n.kind} and ${e.kind}`,e.location,n.location,i,ur(n));if(n&&(n.generated||e.generated))this.conflict(`Generated ID '${e.id}' collides with another declaration`,e.location,n.location,i,ur(n));let o=s.get(e.id);if(!o){let c={kind:e.kind,id:e.id,label:e.label,location:e.location,generated:e.generated,classes:[...e.classes],...e.parentId?{parentId:e.parentId,parentLocation:e.parentLocation}:{},...e.shape?{shape:e.shape}:{},...e.stereotype?{stereotype:e.stereotype,stereotypeLocation:e.location}:{}};this.applyDeclarationMetadata(c,e.metadata),s.set(e.id,c),r.set(e.id,{kind:e.kind,location:e.location,generated:e.generated,label:e.label.text});return}if(o.label.text!==e.label.text||o.label.type!==e.label.type)this.conflict(`ID '${e.id}' has conflicting labels`,e.location,o.location);if(e.shape&&o.shape&&e.shape!==o.shape)this.conflict(`Use case '${e.id}' has conflicting shapes`,e.location,o.location);if(e.parentId&&o.parentId&&e.parentId!==o.parentId)this.conflict(`Element '${e.id}' belongs to more than one system boundary`,e.parentLocation??e.location,o.parentLocation??o.location);if(e.stereotype&&o.stereotype&&e.stereotype!==o.stereotype)this.conflict(`Element '${e.id}' has conflicting stereotypes`,e.location,o.stereotypeLocation??o.location);o.shape??=e.shape,o.parentId??=e.parentId,o.parentLocation??=e.parentLocation,o.stereotype??=e.stereotype,o.stereotypeLocation??=e.stereotype?e.location:void 0,Bi(o.classes,e.classes),this.applyDeclarationMetadata(o,e.metadata)}collectBoundary(e,r,s){let n=r.get(e.id),i=ur({generated:e.generated,label:e.label.text});if(n&&n.kind!=="boundary")this.conflict(`ID '${e.id}' is declared as both ${n.kind} and boundary`,e.location,n.location,i,ur(n));if(n&&(n.generated||e.generated))this.conflict(`Generated ID '${e.id}' collides with another declaration`,e.location,n.location,i,ur(n));let o=s.get(e.id);if(o){if(o.label.text!==e.label.text||o.label.type!==e.label.type)this.conflict(`Boundary '${e.id}' has conflicting titles`,e.location,o.location);Bi(o.classes,e.classes);return}s.set(e.id,{id:e.id,label:e.label,location:e.location,generated:e.generated,classes:[...e.classes],styles:[],members:[]}),r.set(e.id,{kind:"boundary",location:e.location,generated:e.generated,label:e.label.text})}materializeElements(e,r){for(let s of[...e.values()].sort((n,i)=>(r.get(n.id)??0)-(r.get(i.id)??0)))this.setElementModel(s)}materializeBoundaries(e,r){for(let s of[...e.values()].sort((n,i)=>(r.get(n.id)??0)-(r.get(i.id)??0)))this.model.systemBoundaries.set(s.id,{id:s.id,label:s.label.text,labelType:s.label.type,type:s.type??"rect",members:[],classes:[...s.classes],styles:[...s.styles]})}materializeJson(e){for(let r of[...this.jsonDrafts].sort((s,n)=>(e.get(s.id)??0)-(e.get(n.id)??0)))this.model.jsonNodes.set(r.id,{id:r.id,value:r.value,propertyOrder:r.propertyOrder,classes:[...r.classes],styles:[]})}materializeRelationships(e,r,s){let n=new Map,i=0;for(let o of this.relationshipDrafts){let c=this.resolveEndpoint(o.source,e,r,s),u=this.resolveEndpoint(o.target,e,r,s);this.validateRelationship(o,c,u,e);let a=o.explicitId??`edge-${i++}`,f={id:a,explicitId:Boolean(o.explicitId),source:o.source.id,target:o.target.id,type:o.type,arrowType:o.arrowType,...o.label?{label:o.label.text,labelType:o.label.type}:{},minlen:o.minlen,classes:[],styles:[],animate:!1};this.model.relationships.push(f),n.set(a,{draft:o,relationship:f})}return this.model.relationshipCounter=i,n}resolveEndpoint(e,r,s,n){if(e.classesOnReference&&!e.declaration)throw Error(`Relationship endpoint '${e.id}' uses ::: without declaring the node at ${Me(e.location)}`);let i=r.get(e.id);if(i)return i.kind;return s.set(e.id,{kind:"usecase",id:e.id,label:e.label,location:e.location,generated:e.generated,shape:"ellipse",classes:[]}),r.set(e.id,{kind:"usecase",location:e.location,generated:e.generated,label:e.label.text}),this.recordFirst(n,e.id,e.location.span[0]),"usecase"}reorderElements(e,r){let s=new Map(this.model.actors),n=new Map(this.model.useCases);this.model.actors.clear(),this.model.useCases.clear();for(let i of[...e.values()].sort((o,c)=>(r.get(o.id)??0)-(r.get(c.id)??0))){if(!s.has(i.id)&&!n.has(i.id))this.setElementModel(i);let o=s.get(i.id)??this.model.actors.get(i.id),c=n.get(i.id)??this.model.useCases.get(i.id);if(o)this.model.actors.set(i.id,o);else if(c)this.model.useCases.set(i.id,c)}}applyMetadataAssignments(e,r,s,n){for(let i of this.metadataAssignments){let o=e.get(i.target);if(!o){let c=this.inferMetadataKind(i.metadata);throw Error(`Metadata target '${i.target}' is unresolved${c?` (metadata implies ${c})`:""} at ${Me(i.targetLocation)}`)}if(o.kind==="actor"||o.kind==="usecase")this.applyStandaloneElementMetadata(r.get(i.target),i.metadata);else if(o.kind==="boundary"){let c=s.get(i.target);for(let u of i.metadata.properties){if(u.key!=="type"||u.value!=="rect"&&u.value!=="package")this.invalidMetadata(i.target,o.kind,u);c.type=u.value}}else if(o.kind==="edge"){let c=n.get(i.target);if(!c)throw Error(`Metadata target '${i.target}' is not an explicit edge at ${Me(i.targetLocation)}`);i.statement.kind="edgeMetadata",i.statement.edges=[{id:i.target,span:i.statement.span,idSpan:i.targetLocation.span,...i.statement.metadata?{metadata:i.statement.metadata}:{}}],delete i.statement.nodes;for(let u of i.metadata.properties)if(u.key==="animate"&&typeof u.value==="boolean")c.relationship.animate=u.value;else if(u.key==="animation"&&(u.value==="fast"||u.value==="slow"))c.relationship.animation=u.value,c.relationship.animate=!0;else this.invalidMetadata(i.target,o.kind,u)}else for(let c of i.metadata.properties)this.invalidMetadata(i.target,o.kind,c)}for(let{relationship:i}of n.values())if(i.animation)i.animate=!0}applyStandaloneElementMetadata(e,r){for(let s of r.properties)if(e.kind==="actor")this.applyActorProperty(e,s,!0);else if(s.key==="business"&&typeof s.value==="boolean")e.business=s.value;else this.invalidMetadata(e.id,e.kind,s)}applyDeclarationMetadata(e,r){if(!r)return;for(let s of r.properties)if(e.kind==="actor")this.applyActorProperty(e,s,!1);else if(s.key==="business"&&typeof s.value==="boolean"){if(e.business!==void 0&&e.business!==s.value)this.conflict(`Use case '${e.id}' has conflicting business metadata`,s.location,e.location);e.business=s.value}else this.invalidMetadata(e.id,e.kind,s)}applyActorProperty(e,r,s){if(r.key==="type"&&(r.value==="normal"||r.value==="hollow"||r.value==="awesome")){if(!s&&e.actorType!==void 0&&e.actorType!==r.value)this.conflict(`Actor '${e.id}' has conflicting type metadata`,r.location,e.location);e.actorType=r.value}else if(r.key==="icon"&&typeof r.value==="string"){if(!s&&e.icon!==void 0&&e.icon!==r.value)this.conflict(`Actor '${e.id}' has conflicting icon metadata`,r.location,e.location);e.icon=r.value}else if(r.key==="business"&&typeof r.value==="boolean"){if(!s&&e.business!==void 0&&e.business!==r.value)this.conflict(`Actor '${e.id}' has conflicting business metadata`,r.location,e.location);e.business=r.value}else this.invalidMetadata(e.id,e.kind,r)}validateAndRefreshElements(e){for(let r of e.values()){let s=r.icon?"icon":r.actorType??"normal";if(r.kind==="actor"){if(r.icon&&r.actorType&&r.actorType!=="normal")throw Error(`Actor '${r.id}' cannot combine icon with type '${r.actorType}' at ${Me(r.location)}`);if(r.business&&(s==="icon"||s==="awesome"))throw Error(`Business actor '${r.id}' must use normal or hollow geometry at ${Me(r.location)}`)}else if((r.shape??"ellipse")==="rect"&&r.business)throw Error(`Rectangular use case '${r.id}' cannot be a business use case at ${Me(r.location)}`);this.setElementModel(r)}}refreshBoundaries(e,r){for(let s of e.values())s.members.length=0;for(let s of[...this.elements].sort((n,i)=>n.location.span[0]-i.location.span[0])){if(!s.parentId)continue;let n=e.get(s.parentId);if(!n)throw Error(`Parent boundary '${s.parentId}' for '${s.id}' is unresolved at ${Me(s.parentLocation??s.location)}`);if(!n.members.includes(s.id))n.members.push(s.id)}for(let s of r.values())if(s.parentId&&!e.has(s.parentId))throw Error(`Parent boundary '${s.parentId}' for '${s.id}' is unresolved at ${Me(s.parentLocation??s.location)}`);for(let s of e.values()){let n=this.model.systemBoundaries.get(s.id);n.type=s.type??"rect",n.members=[...s.members],n.classes=[...s.classes],n.styles=[...s.styles]}}materializeNotes(e){let r=0;for(let s of this.noteDrafts){let n=e.get(s.target);if(!n)throw Error(`Note target '${s.target}' is unresolved at ${Me(s.targetLocation)}`);if(n.kind!=="actor"&&n.kind!=="usecase")this.conflict(`Note target '${s.target}' must be an actor or use case, not ${n.kind}`,s.targetLocation,n.location);let i=`note-${r++}`;this.model.notes.set(i,{id:i,target:s.target,label:s.label.text,labelType:s.label.type})}this.model.noteCounter=r}applyClassDefinitions(){for(let e of this.classDefinitions)for(let r of e.ids)this.model.classDefs.set(r,{id:r,styles:[...e.styles]})}applyClassesAndStyles(e,r){for(let s of this.classAssignments)for(let n of s.targets)Bi(this.getStylable(n.id,e,r,n.location).classes,s.classes);for(let s of this.styleAssignments)this.getStylable(s.target,e,r,s.location).styles.push(...s.styles)}getStylable(e,r,s,n){let i=r.get(e)?.kind,o=i==="actor"?this.model.actors.get(e):i==="usecase"?this.model.useCases.get(e):i==="boundary"?this.model.systemBoundaries.get(e):i==="json"?this.model.jsonNodes.get(e):i==="edge"?s.get(e)?.relationship:void 0;if(!o)throw Error(`Class/style target '${e}' is unresolved or anonymous at ${Me(n)}`);return o}validateRelationship(e,r,s,n){let i=t((o)=>o==="actor"||o==="usecase"||o==="json","allowed");if(!i(r))this.conflict(`Relationship source '${e.source.id}' cannot be ${r}`,e.source.location,n.get(e.source.id).location);if(!i(s))this.conflict(`Relationship target '${e.target.id}' cannot be ${s}`,e.target.location,n.get(e.target.id).location);if((e.type==="include"||e.type==="extend")&&(r!=="usecase"||s!=="usecase"))throw Error(`${e.type} relationship requires use-case endpoints at ${Me(e.location)}`);if(e.type==="generalization"&&(r!=="actor"&&r!=="usecase"||r!==s))throw Error(`Generalization requires actor-to-actor or use-case-to-use-case endpoints at ${Me(e.location)}`);if(e.type==="association"&&(r==="json"||s==="json")&&![0,1,2].includes(e.arrowType))throw Error(`JSON relationship '${e.source.id}' to '${e.target.id}' permits only point, reversed-point, or markerless solid association at ${Me(e.location)}`)}setElementModel(e){if(e.kind==="actor"){let r=e.icon?"icon":e.actorType??"normal";this.model.useCases.delete(e.id),this.model.actors.set(e.id,{id:e.id,label:e.label.text,labelType:e.label.type,type:r,...e.icon?{icon:e.icon}:{},business:e.business??!1,...e.stereotype?{stereotype:e.stereotype}:{},...e.parentId?{parentId:e.parentId}:{},classes:[...e.classes],styles:this.model.actors.get(e.id)?.styles??[]})}else this.model.actors.delete(e.id),this.model.useCases.set(e.id,{id:e.id,label:e.label.text,labelType:e.label.type,shape:e.shape??"ellipse",business:e.business??!1,...e.stereotype?{stereotype:e.stereotype}:{},...e.parentId?{parentId:e.parentId}:{},classes:[...e.classes],styles:this.model.useCases.get(e.id)?.styles??[]})}inferMetadataKind(e){let r=new Set(["actor","usecase","boundary","edge"]);for(let s of e.properties)if(s.key==="icon")r.clear(),r.add("actor");else if(s.key==="animate"||s.key==="animation")r.clear(),r.add("edge");else if(s.key==="type"){if(r.clear(),s.value==="rect"||s.value==="package")r.add("boundary");else if(s.value==="normal"||s.value==="hollow"||s.value==="awesome")r.add("actor")}else if(s.key==="business")r.delete("boundary"),r.delete("edge");else return;return r.size===1?[...r][0]:void 0}invalidMetadata(e,r,s){throw Error(`Metadata property '${s.key}' is invalid for ${r} '${e}' at ${Me(s.location)}`)}registerUnique(e,r,s,n,i){let o=e.get(r);if(o)this.conflict(`ID '${r}' is declared more than once (${o.kind} and ${s})`,n,o.location,void 0,ur(o));e.set(r,{kind:s,location:n,generated:i})}recordFirst(e,r,s){let n=e.get(r);if(n===void 0||s<n)e.set(r,s)}conflict(e,r,s,n,i){throw Error(`${e} at ${Me(r)}${mu(n)}; previous declaration at ${Me(s)}${mu(i)}`)}},YA=Is.getBaseCstVisitorConstructor(),XA=class extends YA{constructor(){super();this.builder=new HA(Yn),this.source="",this.anonymousEdge=0,this.anonymousNote=0,this.validateVisitor()}static{t(this,"UsecaseVisitor")}build(e,r){this.source=r,this.parentBoundary=void 0,this.anonymousEdge=0,this.anonymousNote=0,this.builder.reset(r),this.visit(e)}start(e){let r=this.tokens(e,"USECASE")[0],s=[];for(let n of this.nodes(e,"line"))s.push(this.visit(n));this.builder.setStatements(s),this.builder.finalize(this.tokenSpan(r))}line(e){let r=this.firstNode(e,"blankLine","commentLine","statement");return this.wrap(r,this.visit(r))}statement(e){return this.visit(this.firstNode(e,"accTitleStatement","accDescrStatement","directionStatement","actorStatement","systemBoundaryStatement","noteStatement","jsonStatement","classDefStatement","classStatement","styleStatement","metadataAssignmentStatement","entityStatement"))}lineEnd(e){return}blankLine(e){return{kind:"blank",span:this.tokenSpan(this.tokens(e,"NEWLINE")[0])}}commentLine(e){return{kind:"comment",span:this.tokenSpan(this.tokens(e,"COMMENT")[0])}}accTitleStatement(e){let r=this.tokens(e,"ACC_TITLE_LINE")[0].image;return this.builder.setAccTitle(r.slice(r.indexOf(":")+1).trim()),{kind:"accTitle",span:[0,0]}}accDescrStatement(e){let r=this.tokens(e,"ACC_DESCR_LINE")[0],s=this.tokens(e,"ACC_DESCR_BLOCK")[0],n=r?r.image.slice(r.image.indexOf(":")+1).trim():s.image.slice(s.image.indexOf("{")+1,s.image.lastIndexOf("}")).trim();return this.builder.setAccDescription(n),{kind:"accDescr",span:[0,0]}}actorStatement(e){let r=this.nodes(e,"actorItem"),s=r.map((a)=>this.visit(a)),n=this.nodes(e,"relationTail")[0],i=s.map((a,f)=>this.actorOccurrence(r[f],a,!0));for(let a of s)this.builder.addElement(this.actorDraft(a));if(!n)return{kind:"node",span:[0,0],nodes:i};let o=this.visit(n);if(o.target.explicitDeclaration)this.builder.addElement(this.entityDraft(o.target));let c=this.relationshipDraft(s[0],o,this.nodeLocation(n));this.builder.addRelationship(c);let u=c.explicitId??`edge-${this.anonymousEdge++}`;return i.push(this.entityOccurrence(this.nodes(n.children,"entityName")[0],o.target,o.target.explicitDeclaration)),{kind:"edge",span:[0,0],nodes:i,edges:[{id:u,span:[0,0],...c.explicitIdLocation?{idSpan:c.explicitIdLocation.span}:{},...c.label?{labelSpan:c.label.span}:{}}]}}actorItem(e){let r=this.visit(this.nodes(e,"actorName")[0]),s=this.nodes(e,"metadata")[0],n=this.nodes(e,"stereotype")[0],i=this.nodes(e,"classSuffix")[0],o=i?this.visit(i):{classes:[],spans:[]};return{...r,...s?{metadata:this.visit(s)}:{},...n?{stereotype:this.visit(n)}:{},classes:o.classes,classSpans:o.spans}}actorName(e){let r=this.tokens(e,"IDENTIFIER")[0],s=this.tokens(e,"PLAIN_STRING")[0]??this.tokens(e,"MARKDOWN_STRING")[0];if(r){let i=this.nodes(e,"nodeLabel")[0],o=i?this.visit(i):this.tokenLabel(r);return{id:r.image,label:o,location:this.tokenLocation(r),generated:!1,classes:[],classSpans:[]}}let n=this.tokenLabel(s);return{id:this.generateId(n.text),label:n,location:this.tokenLocation(s),generated:!0,classes:[],classSpans:[]}}actorDeclarationOnly(e){let r=this.nodes(e,"actorItem"),s=r.map((n)=>this.visit(n));for(let n of s)this.builder.addElement(this.actorDraft(n));return{kind:"node",span:[0,0],nodes:s.map((n,i)=>this.actorOccurrence(r[i],n,!0))}}entityStatement(e){let r=this.nodes(e,"entityName"),s=this.visit(r[0]),n=this.nodes(e,"relationTail")[0];if(!n)return s.explicitDeclaration=!0,s.shape??="ellipse",this.builder.addElement(this.entityDraft(s)),{kind:"node",span:[0,0],nodes:[this.entityOccurrence(r[0],s,!0)]};if(s.explicitDeclaration)this.builder.addElement(this.entityDraft(s));let i=this.visit(n);if(i.target.explicitDeclaration)this.builder.addElement(this.entityDraft(i.target));let o={source:this.endpoint(s),target:this.endpoint(i.target),location:this.nodeLocation(n),...i.explicitId?{explicitId:i.explicitId,explicitIdLocation:i.explicitIdLocation}:{},...i.arrow};this.builder.addRelationship(o);let c=o.explicitId??`edge-${this.anonymousEdge++}`;return{kind:"edge",span:[0,0],nodes:[this.entityOccurrence(r[0],s,s.explicitDeclaration),this.entityOccurrence(this.nodes(n.children,"entityName")[0],i.target,i.target.explicitDeclaration)],edges:[{id:c,span:[0,0],...o.explicitIdLocation?{idSpan:o.explicitIdLocation.span}:{},...o.label?{labelSpan:o.label.span}:{}}]}}entityName(e){let r=this.tokens(e,"IDENTIFIER")[0],s=this.tokens(e,"PLAIN_STRING")[0]??this.tokens(e,"MARKDOWN_STRING")[0],n=this.nodes(e,"nodeLabel")[0],i=this.nodes(e,"useCaseMetadata")[0],o=this.nodes(e,"stereotype")[0],c=this.nodes(e,"classSuffix")[0],u=c?this.visit(c):{classes:[],spans:[]};if(r){let f=n?this.visit(n):this.tokenLabel(r),d=n?this.tokens(e,"LBRACKET").length?"rect":"ellipse":void 0;return{id:r.image,label:f,location:this.tokenLocation(r),generated:!1,...d?{shape:d}:{},...i?{metadata:this.visit(i)}:{},...o?{stereotype:this.visit(o)}:{},classes:u.classes,classSpans:u.spans,explicitDeclaration:Boolean(d||i||o)}}let a=this.tokenLabel(s);return{id:this.generateId(a.text),label:a,location:this.tokenLocation(s),generated:!0,...i?{metadata:this.visit(i)}:{},...o?{stereotype:this.visit(o)}:{},classes:u.classes,classSpans:u.spans,explicitDeclaration:Boolean(i||o)}}nodeLabel(e){let r=this.allTokens(e);if(r.length===1&&(r[0].tokenType.name==="PLAIN_STRING"||r[0].tokenType.name==="MARKDOWN_STRING"))return this.tokenLabel(r[0]);let s=[r[0].startOffset,(r.at(-1).endOffset??r.at(-1).startOffset)+1];return{text:this.source.slice(s[0],s[1]),type:"text",span:s}}useCaseMetadata(e){return this.visit(this.nodes(e,"metadata")[0])}relationTail(e){let r=this.tokens(e,"IDENTIFIER")[0];return{...r?{explicitId:r.image,explicitIdLocation:this.tokenLocation(r)}:{},arrow:this.visit(this.nodes(e,"arrow")[0]),target:this.visit(this.nodes(e,"entityName")[0])}}arrow(e){return this.visit(this.firstNode(e,"semanticRelation","forwardSolidOperator","backwardSolidOperator","markerlessSolidOperator","forwardCircleOperator","backwardCircleOperator","forwardCrossOperator","backwardCrossOperator"))}edgeLabel(e){return this.nodeLabel(e)}semanticRelation(e){if(this.tokens(e,"GENERALIZATION").length)return{type:"generalization",arrowType:ae.SOLID_ARROW,minlen:1};let r=this.tokens(e,"INCLUDE").length?"include":"extend",s=this.tokens(e,r==="include"?"INCLUDE":"EXTEND")[0];return{type:r,arrowType:ae.SOLID_ARROW,label:{text:r,type:"text",span:this.tokenSpan(s)},minlen:1}}metadata(e){return{properties:this.nodes(e,"metadataProperty").map((r)=>this.visit(r)),location:this.ctxLocation(e)}}metadataProperty(e){let r=this.allTokens(e).filter((c)=>c.tokenType.name!=="COLON"),s=r[0],n=r[1],i=n.tokenType.name==="TRUE"?!0:n.tokenType.name==="FALSE"?!1:this.decodePlain(n),o=[s.startOffset,(n.endOffset??n.startOffset)+1];return{key:this.decodePlain(s),value:i,span:o,keySpan:this.contentSpan(s),valueSpan:this.contentSpan(n),location:this.tokenLocation(s)}}metadataSeparator(e){return}systemBoundaryStatement(e){let r=this.visit(this.nodes(e,"systemBoundaryName")[0]),s=this.nodes(e,"classSuffix")[0],n=s?this.visit(s):{classes:[],spans:[]};r.classes=n.classes,this.builder.addBoundary(r);let i=this.parentBoundary;this.parentBoundary={id:r.id,location:r.location};let o=this.nodes(e,"systemBoundaryContent")[0],c=o?this.visit(o):[];this.parentBoundary=i;let u=this.tokens(e,"END")[0],a=this.nodes(e,"metadata")[0],f=a?this.visit(a):void 0,d={kind:"group",span:[0,0],group:r.id,idSpan:r.location.span,titleSpan:r.label.span,endSpan:this.tokenSpan(u),classSpans:n.spans,...f?{metadata:f.properties.map(({key:m,span:g,keySpan:y,valueSpan:k})=>({key:m,span:g,keySpan:y,valueSpan:k}))}:{},...c.length?{children:c}:{}};if(f)this.builder.addMetadataAssignment(r.id,r.location,f,d);return d}systemBoundaryName(e){let r=this.tokens(e,"IDENTIFIER")[0];if(r){let i=this.nodes(e,"nodeLabel")[0];return{id:r.image,label:i?this.visit(i):this.tokenLabel(r),location:this.tokenLocation(r),generated:!1,classes:[]}}let s=this.tokens(e,"PLAIN_STRING")[0]??this.tokens(e,"MARKDOWN_STRING")[0],n=this.tokenLabel(s);return{id:this.generateId(n.text),label:n,location:this.tokenLocation(s),generated:!0,classes:[]}}systemBoundaryContent(e){return[...this.nodes(e,"blankLine"),...this.nodes(e,"commentLine"),...this.nodes(e,"boundaryElement")].sort((s,n)=>(s.location?.startOffset??0)-(n.location?.startOffset??0)).map((s)=>this.wrap(s,this.visit(s)))}boundaryElement(e){let r=this.nodes(e,"actorDeclarationOnly")[0];if(r)return this.visit(r);let s=this.nodes(e,"entityName")[0],n=this.visit(s);return n.explicitDeclaration=!0,n.shape??="ellipse",this.builder.addElement(this.entityDraft(n)),{kind:"node",span:[0,0],nodes:[this.entityOccurrence(s,n,!0)]}}metadataAssignmentStatement(e){let r=this.visit(this.nodes(e,"metadataAssignmentTarget")[0]),s=this.visit(this.nodes(e,"metadata")[0]),n={kind:"metadata",span:[0,0],nodes:[{id:r.id,span:r.location.span,idSpan:r.location.span}],metadata:s.properties.map(({key:i,span:o,keySpan:c,valueSpan:u})=>({key:i,span:o,keySpan:c,valueSpan:u}))};return this.builder.addMetadataAssignment(r.id,r.location,s,n),n}metadataAssignmentTarget(e){let r=this.allTokens(e)[0],s=this.tokenLabel(r);return{id:r.tokenType.name==="IDENTIFIER"?r.image:this.generateId(s.text),location:this.tokenLocation(r)}}noteStatement(e){let r=this.tokens(e,"IDENTIFIER")[0],s=this.visit(this.nodes(e,"nodeLabel")[0]);return this.builder.addNote({target:r.image,targetLocation:this.tokenLocation(r),label:s,location:this.ctxLocation(e)}),{kind:"note",span:[0,0],ref:`note-${this.anonymousNote++}`,refSpan:s.span,nodes:[{id:r.image,span:this.tokenSpan(r),idSpan:this.tokenSpan(r)}]}}stereotype(e){let r=this.tokens(e,"STEREOTYPE_TEXT")[0];return{value:r.image.trim(),span:this.tokenSpan(r)}}classSuffix(e){let r=this.tokens(e,"IDENTIFIER");return{classes:r.map((s)=>s.image),spans:r.map((s)=>this.tokenSpan(s))}}jsonStatement(e){let r=this.tokens(e,"JSON_DECLARATION_START")[0],s=this.tokens(e,"JSON_OBJECT_LITERAL")[0],n=/^json[\t ]+(\w+)/.exec(r.image),i=n[1],o=n[0].length-i.length,c={span:[r.startOffset+o,r.startOffset+o+i.length],line:r.startLine??1,column:(r.startColumn??1)+o},u=cf(s.image,s.startLine??1,s.startColumn??1),a=this.nodes(e,"classSuffix")[0],f=a?this.visit(a):{classes:[],spans:[]},d={id:i,value:u.value,propertyOrder:u.propertyOrder,location:c,classes:f.classes};return this.builder.addJson(d),{kind:"json",span:[0,0],nodes:[{id:i,span:c.span,idSpan:c.span,defines:!0,classSpans:f.spans}],classSpans:f.spans}}directionStatement(e){let r=this.allTokens(e).find((s)=>["TD","TB","BT","RL","LR"].includes(s.tokenType.name));return this.builder.setDirection(r.image),{kind:"direction",span:[0,0]}}classDefStatement(e){let r=this.tokens(e,"IDENTIFIER"),s=this.visit(this.nodes(e,"styles")[0]);return this.builder.addClassDef(r.map((n)=>n.image),s),{kind:"classDef",span:[0,0],ref:r[0].image,refSpan:this.tokenSpan(r[0])}}classStatement(e){let r=this.tokens(e,"IDENTIFIER"),s=1;for(;s<r.length;s++)if(!this.source.slice((r[s-1].endOffset??r[s-1].startOffset)+1,r[s].startOffset).includes(","))break;let n=r.slice(0,s).map((o)=>({id:o.image,location:this.tokenLocation(o)})),i=r.slice(s).map((o)=>o.image);return this.builder.addClassAssignment(n,i),{kind:"classAssign",span:[0,0],ref:i[0],refSpan:this.tokenSpan(r[s]),nodes:n.map(({id:o,location:c})=>({id:o,span:c.span,idSpan:c.span}))}}styleStatement(e){let r=this.tokens(e,"IDENTIFIER")[0],s=this.visit(this.nodes(e,"styles")[0]);return this.builder.addStyleAssignment(r.image,this.tokenLocation(r),s),{kind:"style",span:[0,0],nodes:[{id:r.image,span:this.tokenSpan(r),idSpan:this.tokenSpan(r)}]}}styles(e){return this.nodes(e,"styleValue").map((r)=>this.visit(r))}styleValue(e){let r=this.allTokens(e),s=[r[0].startOffset,(r.at(-1).endOffset??r.at(-1).startOffset)+1];return this.source.slice(s[0],s[1]).replaceAll("\\,",",")}styleComponent(e){return this.allTokens(e).map((r)=>r.image).join("")}forwardSolidOperator(e){let r=this.tokens(e,"FORWARD_SOLID")[0];return{type:"association",arrowType:ae.SOLID_ARROW,minlen:this.solidMinlen(r)}}backwardSolidOperator(e){let r=this.tokens(e,"BACKWARD_SOLID")[0],s=this.nodes(e,"edgeLabel")[0],n=s?this.tokens(e,"MARKERLESS_SOLID").at(-1):r;return{type:"association",arrowType:ae.BACK_ARROW,minlen:this.solidMinlen(n),...s?{label:this.visit(s)}:{}}}markerlessSolidOperator(e){let r=this.nodes(e,"edgeLabel")[0],s=this.allTokens(e);if(!r)return{type:"association",arrowType:ae.LINE_SOLID,minlen:this.solidMinlen(this.tokens(e,"MARKERLESS_SOLID")[0])};let n=s.at(-1),i=n.tokenType.name==="FORWARD_SOLID"?ae.SOLID_ARROW:n.tokenType.name==="FORWARD_CIRCLE"?ae.CIRCLE_ARROW:n.tokenType.name==="FORWARD_CROSS"?ae.CROSS_ARROW:ae.LINE_SOLID;return{type:"association",arrowType:i,label:this.visit(r),minlen:i===ae.SOLID_ARROW||i===ae.LINE_SOLID?this.solidMinlen(n):1}}forwardCircleOperator(e){return{type:"association",arrowType:ae.CIRCLE_ARROW,minlen:1}}backwardCircleOperator(e){let r=this.nodes(e,"edgeLabel")[0];return{type:"association",arrowType:ae.CIRCLE_ARROW_REVERSED,minlen:1,...r?{label:this.visit(r)}:{}}}forwardCrossOperator(e){return{type:"association",arrowType:ae.CROSS_ARROW,minlen:1}}backwardCrossOperator(e){let r=this.nodes(e,"edgeLabel")[0];return{type:"association",arrowType:ae.CROSS_ARROW_REVERSED,minlen:1,...r?{label:this.visit(r)}:{}}}actorDraft(e){return{id:e.id,kind:"actor",label:e.label,location:e.location,generated:e.generated,...this.parentBoundary?{parentId:this.parentBoundary.id,parentLocation:this.parentBoundary.location}:{},...e.metadata?{metadata:e.metadata}:{},...e.stereotype?{stereotype:e.stereotype.value,stereotypeSpan:e.stereotype.span}:{},classes:e.classes}}entityDraft(e){return{id:e.id,kind:"usecase",label:e.label,location:e.location,generated:e.generated,...this.parentBoundary?{parentId:this.parentBoundary.id,parentLocation:this.parentBoundary.location}:{},...e.shape?{shape:e.shape}:{},...e.metadata?{metadata:e.metadata}:{},...e.stereotype?{stereotype:e.stereotype.value,stereotypeSpan:e.stereotype.span}:{},classes:e.classes}}endpoint(e,r=e.explicitDeclaration??!0){return{id:e.id,label:e.label,location:e.location,generated:e.generated,declaration:r,classesOnReference:e.classes.length>0}}relationshipDraft(e,r,s){return{source:this.endpoint(e,!0),target:this.endpoint(r.target),location:s,...r.explicitId?{explicitId:r.explicitId,explicitIdLocation:r.explicitIdLocation}:{},...r.arrow}}actorOccurrence(e,r,s){return{id:r.id,span:this.nodeSpan(e),idSpan:r.location.span,labelSpan:r.label.span,...s?{defines:!0}:{},...r.stereotype?{stereotypeSpan:r.stereotype.span}:{},...r.metadata?{metadata:r.metadata.properties.map(({key:n,span:i,keySpan:o,valueSpan:c})=>({key:n,span:i,keySpan:o,valueSpan:c}))}:{},...r.classSpans.length?{classSpans:r.classSpans}:{}}}entityOccurrence(e,r,s){return this.actorOccurrence(e,r,s)}wrap(e,r){if(r.kind==="blank"||r.kind==="comment")return r;r.span=this.nodeSpan(e);for(let s of r.edges??[])s.span=r.span;return r}tokenLabel(e){let r=e.tokenType.name==="MARKDOWN_STRING"?"markdown":"text",s=r==="markdown"?2:e.tokenType.name==="PLAIN_STRING"?1:0,n=this.tokenSpan(e,s);return{text:this.source.slice(n[0],n[1]),type:r,span:n}}decodePlain(e){return e.tokenType.name==="PLAIN_STRING"?e.image.slice(1,-1):e.image}contentSpan(e){return this.tokenSpan(e,e.tokenType.name==="PLAIN_STRING"?1:e.tokenType.name==="MARKDOWN_STRING"?2:0)}generateId(e){return e.replace(/\W/g,"_")}solidMinlen(e){return Math.max(1,(e.image.match(/-/g)?.length??2)-1)}nodeLocation(e){let r=this.allTokens(e.children)[0];return{span:this.nodeSpan(e),line:r.startLine??1,column:r.startColumn??1}}ctxLocation(e){let r=this.allTokens(e).filter((i)=>i.tokenType.name!=="NEWLINE"&&i.tokenType.name!=="EOF"),s=r[0],n=r.at(-1);return{span:[s.startOffset,Math.min(this.source.length,(n.endOffset??n.startOffset+n.image.length-1)+1)],line:s.startLine??1,column:s.startColumn??1}}tokenLocation(e){let r=e.tokenType.name==="PLAIN_STRING"?1:e.tokenType.name==="MARKDOWN_STRING"?2:0;return{span:this.tokenSpan(e,r),line:e.startLine??1,column:(e.startColumn??1)+r}}nodeSpan(e){let r=this.allTokens(e.children).filter((i)=>i.tokenType.name!=="NEWLINE"&&i.tokenType.name!=="EOF"),s=r[0],n=r.at(-1);if(!s||!n)throw Error("Usecase CST node has no source token");return[s.startOffset,Math.min(this.source.length,(n.endOffset??n.startOffset+n.image.length-1)+1)]}tokenSpan(e,r=0){return[e.startOffset+r,Math.min(this.source.length,(e.endOffset??e.startOffset+e.image.length-1)+1-r)]}nodes(e,r){return(e[r]??[]).filter((s)=>("children"in s))}tokens(e,r){return(e[r]??[]).filter((s)=>("tokenTypeIdx"in s))}firstNode(e,...r){for(let s of r){let n=this.nodes(e,s)[0];if(n)return n}throw Error(`Usecase CST is missing one of: ${r.join(", ")}`)}allTokens(e){let r=[];for(let s of Object.values(e))for(let n of s)if("tokenTypeIdx"in n)r.push(n);else r.push(...this.allTokens(n.children));return r.sort((s,n)=>s.startOffset-n.startOffset)}},qA=new XA,JA={parse:t(async(e)=>{Yn.clear(),Is.input=[];try{yu({diagramType:"usecase",lexer:UA,parser:Is,entry:t(()=>Is.start(),"entry"),visit:t((r)=>qA.build(r,e),"visit")},e)}catch(r){Yn.clear();let s=Is.errors[0];if(s){let{token:n}=s,i=Number.isFinite(n.startOffset)?n.startOffset:e.length,o=typeof n.endOffset==="number"&&Number.isFinite(n.endOffset)?n.endOffset+1:i,c=n.startLine??e.slice(0,i).split(/\r\n|\r|\n/).length,u=Math.max(e.lastIndexOf(`
117
- `,i-1),e.lastIndexOf("\r",i-1)),a=n.startColumn??i-u,f=r instanceof Error?r.message:String(r);throw Error(`${f} at line ${c}, column ${a} [${i},${o})`)}throw r}},"parse")},ZA=["point","circle","cross","extension"],uf={usecaseActor:!0,usecaseActorHollow:!0,usecaseActorAwesome:!0,usecaseActorIcon:!0},gu=t((e,r)=>{let[s,n]=[e,r].map((i)=>i.replace(/[^\w-]+/g,"_").replace(/^_+|_+$/g,"")||"element");return`usecase-${s}-${n}`},"usecaseDomId"),QA=t((e)=>`usecase-${e.replace(/[^\w-]+/g,"_").replace(/^_+|_+$/g,"")||"element"}`,"usecaseNodeDomId"),Xn=t((e,r)=>{if(r!=="markdown")return e;return up(e).map((s)=>s.map((n)=>n.content).join(" ")).join(`
117
+ `,i-1),e.lastIndexOf("\r",i-1)),a=n.startColumn??i-u,f=r instanceof Error?r.message:String(r);throw Error(`${f} at line ${c}, column ${a} [${i},${o})`)}throw r}},"parse")},ZA=["point","circle","cross","extension"],uf={usecaseActor:!0,usecaseActorHollow:!0,usecaseActorAwesome:!0,usecaseActorIcon:!0},gu=t((e,r)=>{let[s,n]=[e,r].map((i)=>i.replace(/[^\w-]+/g,"_").replace(/^_+|_+$/g,"")||"element");return`usecase-${s}-${n}`},"usecaseDomId"),QA=t((e)=>`usecase-${e.replace(/[^\w-]+/g,"_").replace(/^_+|_+$/g,"")||"element"}`,"usecaseNodeDomId"),Xn=t((e,r)=>{if(r!=="markdown")return e;return dp(e).map((s)=>s.map((n)=>n.content).join(" ")).join(`
118
118
  `)},"getAccessibleLabel"),ex=t((e)=>{let r=Xn(e.label??e.id,e.labelType);if(uf[e.shape]){let n=e.actorType&&e.actorType!=="normal"?`${e.actorType} `:"",i=e.business?"business ":"",o=e.stereotype?`, stereotype ${e.stereotype}`:"";return`${i}${n}actor ${r}${o}`}if(e.shape==="note")return`Note for ${e.noteTargetLabel??e.noteTarget??""}: ${r}`;if(e.shape==="usecaseJsonTable"){let n=(e.jsonRows??[]).map((i)=>`${i.accessibleKey}: ${i.value}`).join("; ");return n?`${r}: ${n}`:r}let s=e.stereotype?`, stereotype ${e.stereotype}`:"";return`${e.business?"business ":""}use case ${r}${s}`},"getUsecaseNodeAccessibleName"),tx=t((e)=>`${e.boundaryType} system boundary ${Xn(e.label??e.id,e.labelType)}`,"getUsecaseBoundaryAccessibleName"),rx=t((e)=>{if(e.relationshipType==="note")return"";return`${e.relationshipType==="association"&&e.label?`association ${Xn(e.label,e.labelType)}`:e.relationshipType} from ${e.sourceLabel} to ${e.targetLabel}`},"getUsecaseEdgeAccessibleName"),Hr=t((e)=>e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),"escapePlainLabel"),Tu=t((e)=>e.replace(/([*[\\\]_`])/g,"\\$1"),"escapeMarkdownMarkers"),sx=t((e,r)=>{e.diagramId=r,e.markers=[...ZA];for(let s of e.nodes){let n=s;if(n.domId=QA(s.id),s.label!==void 0&&s.labelType==="text")s.label=Hr(s.label);if(s.stereotype)s.stereotype=Hr(s.stereotype);if(!s.isGroup&&s.shape==="usecaseJsonTable")s.jsonRows=s.jsonRows?.map((i)=>({...i,key:Hr(i.key),value:Hr(i.value)}));if(!s.isGroup&&(s.shape==="usecaseEllipse"||s.shape==="rect")&&s.stereotype){let i=s.label??Hr(s.id);s.label=`«${Tu(s.stereotype)}»<br/>${s.labelType==="text"?Tu(i):i}`,s.labelType="markdown",n.hasFoldedStereotype=!0,delete s.stereotype}}for(let s of e.edges)if(s.label!==void 0&&s.labelType==="text")s.label=Hr(s.label);return e},"prepareUsecaseLayoutData"),nx=t((e,r,s)=>{for(let i of r.nodes){let o=typeof i.domId==="string"?i.domId:gu(r.diagramId,i.id),c=e.select(`#${o}`),u=i.isGroup?"boundary":uf[i.shape]?"actor":i.shape==="note"?"note":i.shape==="usecaseJsonTable"?"json":"usecase",a=s.nodes.get(i.id)??i.id;if(c.attr("data-usecase-id",i.id).attr("data-usecase-kind",u).attr("role","img").attr("aria-label",a),!i.isGroup&&(i.shape==="usecaseEllipse"||i.shape==="rect")&&"hasFoldedStereotype"in i&&i.hasFoldedStereotype===!0){let f=c.node(),d=f?.querySelector(".nodeLabel"),m=d?.querySelector("p")??d,g=m?.firstChild;if(m&&g?.nodeType===3){let y=m.ownerDocument.createElement("span");y.className="usecase-stereotype",m.insertBefore(y,g),y.appendChild(g)}else f?.querySelector(".label tspan tspan, .label tspan")?.classList.add("usecase-stereotype")}}let n=new Map(r.edges.map((i)=>[i.id,i]));e.selectAll('path[data-et="edge"]').each(function(){let i=n.get(this.getAttribute("data-id")??"");if(!i)return;let o=h(this);if(o.attr("id",gu(r.diagramId,i.id)).attr("data-usecase-id",i.id).attr("data-usecase-kind",i.internal?"note-connector":"relationship"),i.internal)o.attr("aria-hidden","true");else o.attr("role","img").attr("aria-label",s.edges.get(i.id)??i.id)})},"annotateUsecaseElements"),Eu=t((e,r)=>{e.style("--mermaid-usecase-actor-font-size",`${r.actorFontSize}px`).style("--mermaid-usecase-actor-font-family",r.actorFontFamily).style("--mermaid-usecase-actor-font-weight",r.actorFontWeight).style("--mermaid-usecase-font-size",`${r.usecaseFontSize}px`).style("--mermaid-usecase-font-family",r.usecaseFontFamily).style("--mermaid-usecase-font-weight",r.usecaseFontWeight)},"applyUsecaseFonts"),ix=t(async(e,r,s,n)=>{l.info("Drawing usecase diagram (unified)",r);let{layout:i}=p(),o=n.db,c=o.getData(),u=new Map(c.nodes.map((m)=>[m.id,Xn(m.label??m.id,m.labelType)])),a={nodes:new Map(c.nodes.map((m)=>[m.id,m.isGroup?tx(m):ex(m.shape==="note"?{...m,noteTargetLabel:u.get(m.noteTarget??"")}:m)])),edges:new Map(c.edges.map((m)=>[m.id,rx({...m,sourceLabel:u.get(m.source)??m.sourceLabel,targetLabel:u.get(m.target)??m.targetLabel})]))},f=Tt(r,c.config.securityLevel);c.layoutAlgorithm=St(i),sx(c,r),Eu(f,c),await _t(c,f),nx(f,c,a);let d=c.diagramPadding;W.insertTitle(f,"usecaseDiagramTitleText",0,o.getDiagramTitle?.()??""),lt(f,d,"usecaseDiagram",c.useMaxWidth),Eu(f,c)},"draw"),ox={draw:ix},ax=t((e)=>({actorBkg:e.usecaseActorBkg??e.actorBkg??e.mainBkg,actorBorder:e.usecaseActorBorder??e.actorBorder??e.primaryColor,bkg:e.usecaseBkg??e.mainBkg,border:e.usecaseBorder??e.nodeBorder??e.primaryColor,boundaryBkg:e.usecaseBoundaryBkg??e.clusterBkg,boundaryBorder:e.usecaseBoundaryBorder??e.clusterBorder,includeLine:e.usecaseIncludeLine??e.lineColor,extendLine:e.usecaseExtendLine??e.lineColor}),"roleColors"),lx=t((e)=>{let{theme:r,bkgColorArray:s,borderColorArray:n}=e;if(!Ye(r,n))return"";let i=E().usecase?.colorScheme==="rotate",o=Je(e.look),c=o==="handDrawn",u=st(s),a="";for(let f=0;f<Mr(n);f++){let d=n[f],m=u?`fill: ${s[f%s.length]};`:"",g=`[data-look="${o}"][data-color-id="color-${f}"]`;if(a+=`
119
119
 
120
120
  & ${g}.system-boundary rect.boundary-body,