@copilotkitnext/react 0.0.22-alpha.7 → 0.0.22-alpha.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (236) hide show
  1. package/package.json +4 -4
  2. package/dist/KaTeX_AMS-Regular-CYEKBG2K.woff +0 -0
  3. package/dist/KaTeX_AMS-Regular-JKX5W2C4.ttf +0 -0
  4. package/dist/KaTeX_AMS-Regular-U6PRYMIZ.woff2 +0 -0
  5. package/dist/KaTeX_Caligraphic-Bold-5QL5CMTE.woff2 +0 -0
  6. package/dist/KaTeX_Caligraphic-Bold-WZ3QSGD3.woff +0 -0
  7. package/dist/KaTeX_Caligraphic-Bold-ZTS3R3HK.ttf +0 -0
  8. package/dist/KaTeX_Caligraphic-Regular-3LKEU76G.woff +0 -0
  9. package/dist/KaTeX_Caligraphic-Regular-A7XRTZ5Q.ttf +0 -0
  10. package/dist/KaTeX_Caligraphic-Regular-KX5MEWCF.woff2 +0 -0
  11. package/dist/KaTeX_Fraktur-Bold-2QVFK6NQ.woff2 +0 -0
  12. package/dist/KaTeX_Fraktur-Bold-T4SWXBMT.woff +0 -0
  13. package/dist/KaTeX_Fraktur-Bold-WGHVTYOR.ttf +0 -0
  14. package/dist/KaTeX_Fraktur-Regular-2PEIFJSJ.woff2 +0 -0
  15. package/dist/KaTeX_Fraktur-Regular-5U4OPH2X.ttf +0 -0
  16. package/dist/KaTeX_Fraktur-Regular-PQMHCIK6.woff +0 -0
  17. package/dist/KaTeX_Main-Bold-2GA4IZIN.woff +0 -0
  18. package/dist/KaTeX_Main-Bold-W5FBVCZM.ttf +0 -0
  19. package/dist/KaTeX_Main-Bold-YP5VVQRP.woff2 +0 -0
  20. package/dist/KaTeX_Main-BoldItalic-4P4C7HJH.woff +0 -0
  21. package/dist/KaTeX_Main-BoldItalic-N4V3DX7S.woff2 +0 -0
  22. package/dist/KaTeX_Main-BoldItalic-ODMLBJJQ.ttf +0 -0
  23. package/dist/KaTeX_Main-Italic-I43T2HSR.ttf +0 -0
  24. package/dist/KaTeX_Main-Italic-RELBIK7M.woff2 +0 -0
  25. package/dist/KaTeX_Main-Italic-SASNQFN2.woff +0 -0
  26. package/dist/KaTeX_Main-Regular-ARRPAO67.woff2 +0 -0
  27. package/dist/KaTeX_Main-Regular-P5I74A2A.woff +0 -0
  28. package/dist/KaTeX_Main-Regular-W74P5G27.ttf +0 -0
  29. package/dist/KaTeX_Math-BoldItalic-6EBV3DK5.woff +0 -0
  30. package/dist/KaTeX_Math-BoldItalic-K4WTGH3J.woff2 +0 -0
  31. package/dist/KaTeX_Math-BoldItalic-VB447A4D.ttf +0 -0
  32. package/dist/KaTeX_Math-Italic-6KGCHLFN.woff2 +0 -0
  33. package/dist/KaTeX_Math-Italic-KKK3USB2.woff +0 -0
  34. package/dist/KaTeX_Math-Italic-SON4MRCA.ttf +0 -0
  35. package/dist/KaTeX_SansSerif-Bold-RRNVJFFW.woff2 +0 -0
  36. package/dist/KaTeX_SansSerif-Bold-STQ6RXC7.ttf +0 -0
  37. package/dist/KaTeX_SansSerif-Bold-X5M5EMOD.woff +0 -0
  38. package/dist/KaTeX_SansSerif-Italic-HMPFTM52.woff2 +0 -0
  39. package/dist/KaTeX_SansSerif-Italic-PSN4QKYX.woff +0 -0
  40. package/dist/KaTeX_SansSerif-Italic-WTBAZBGY.ttf +0 -0
  41. package/dist/KaTeX_SansSerif-Regular-2TL3USAE.ttf +0 -0
  42. package/dist/KaTeX_SansSerif-Regular-OQCII6EP.woff +0 -0
  43. package/dist/KaTeX_SansSerif-Regular-XIQ62X4E.woff2 +0 -0
  44. package/dist/KaTeX_Script-Regular-72OLXYNA.ttf +0 -0
  45. package/dist/KaTeX_Script-Regular-A5IFOEBS.woff +0 -0
  46. package/dist/KaTeX_Script-Regular-APUWIHLP.woff2 +0 -0
  47. package/dist/KaTeX_Size1-Regular-4HRHTS65.woff +0 -0
  48. package/dist/KaTeX_Size1-Regular-5LRUTBFT.woff2 +0 -0
  49. package/dist/KaTeX_Size1-Regular-7K6AASVL.ttf +0 -0
  50. package/dist/KaTeX_Size2-Regular-222HN3GT.ttf +0 -0
  51. package/dist/KaTeX_Size2-Regular-K5ZHAIS6.woff +0 -0
  52. package/dist/KaTeX_Size2-Regular-LELKET5D.woff2 +0 -0
  53. package/dist/KaTeX_Size3-Regular-TLFPAHDE.woff +0 -0
  54. package/dist/KaTeX_Size3-Regular-UFCO6WCA.ttf +0 -0
  55. package/dist/KaTeX_Size3-Regular-WQRQ47UD.woff2 +0 -0
  56. package/dist/KaTeX_Size4-Regular-7PGNVPQK.ttf +0 -0
  57. package/dist/KaTeX_Size4-Regular-CDMV7U5C.woff2 +0 -0
  58. package/dist/KaTeX_Size4-Regular-PKMWZHNC.woff +0 -0
  59. package/dist/KaTeX_Typewriter-Regular-3F5K6SQ6.ttf +0 -0
  60. package/dist/KaTeX_Typewriter-Regular-MJMFSK64.woff +0 -0
  61. package/dist/KaTeX_Typewriter-Regular-VBYJ4NRC.woff2 +0 -0
  62. package/dist/angular-html-LD6QEAZE.mjs +0 -7
  63. package/dist/angular-html-LD6QEAZE.mjs.map +0 -1
  64. package/dist/angular-ts-FGK7I2F5.mjs +0 -37
  65. package/dist/angular-ts-FGK7I2F5.mjs.map +0 -1
  66. package/dist/angular-ts-XZTE5LQS.mjs +0 -37
  67. package/dist/angular-ts-XZTE5LQS.mjs.map +0 -1
  68. package/dist/apl-VB2EG5RZ.mjs +0 -22
  69. package/dist/apl-VB2EG5RZ.mjs.map +0 -1
  70. package/dist/architectureDiagram-VXUJARFQ-PPLKSFYC.mjs +0 -8712
  71. package/dist/architectureDiagram-VXUJARFQ-PPLKSFYC.mjs.map +0 -1
  72. package/dist/blade-EZDWULER.mjs +0 -26
  73. package/dist/blade-EZDWULER.mjs.map +0 -1
  74. package/dist/blade-HS4Z7O3Y.mjs +0 -26
  75. package/dist/blade-HS4Z7O3Y.mjs.map +0 -1
  76. package/dist/blockDiagram-VD42YOAC-7SIEWHYD.mjs +0 -3618
  77. package/dist/blockDiagram-VD42YOAC-7SIEWHYD.mjs.map +0 -1
  78. package/dist/c4Diagram-YG6GDRKO-G2UUBRHQ.mjs +0 -2495
  79. package/dist/c4Diagram-YG6GDRKO-G2UUBRHQ.mjs.map +0 -1
  80. package/dist/chunk-2BAFECUC.mjs +0 -28
  81. package/dist/chunk-2BAFECUC.mjs.map +0 -1
  82. package/dist/chunk-BF5LDW2L.mjs +0 -65
  83. package/dist/chunk-BF5LDW2L.mjs.map +0 -1
  84. package/dist/chunk-BUEC2HNL.mjs +0 -762
  85. package/dist/chunk-BUEC2HNL.mjs.map +0 -1
  86. package/dist/chunk-CRGJ2YCV.mjs +0 -109
  87. package/dist/chunk-CRGJ2YCV.mjs.map +0 -1
  88. package/dist/chunk-DKZXT4VQ.mjs +0 -19
  89. package/dist/chunk-DKZXT4VQ.mjs.map +0 -1
  90. package/dist/chunk-DYQXFOGA.mjs +0 -34
  91. package/dist/chunk-DYQXFOGA.mjs.map +0 -1
  92. package/dist/chunk-ENI667QL.mjs +0 -806
  93. package/dist/chunk-ENI667QL.mjs.map +0 -1
  94. package/dist/chunk-GEUZOPED.mjs +0 -1834
  95. package/dist/chunk-GEUZOPED.mjs.map +0 -1
  96. package/dist/chunk-GU7334FJ.mjs +0 -538
  97. package/dist/chunk-GU7334FJ.mjs.map +0 -1
  98. package/dist/chunk-HNKEYT4A.mjs +0 -4693
  99. package/dist/chunk-HNKEYT4A.mjs.map +0 -1
  100. package/dist/chunk-HTMHAYGC.mjs +0 -14
  101. package/dist/chunk-HTMHAYGC.mjs.map +0 -1
  102. package/dist/chunk-JRLFMJ6U.mjs +0 -1923
  103. package/dist/chunk-JRLFMJ6U.mjs.map +0 -1
  104. package/dist/chunk-JYRND4DC.mjs +0 -22
  105. package/dist/chunk-JYRND4DC.mjs.map +0 -1
  106. package/dist/chunk-KFEPUFID.mjs +0 -52
  107. package/dist/chunk-KFEPUFID.mjs.map +0 -1
  108. package/dist/chunk-M3UH7XZX.mjs +0 -6222
  109. package/dist/chunk-M3UH7XZX.mjs.map +0 -1
  110. package/dist/chunk-ND4RYWG7.mjs +0 -12
  111. package/dist/chunk-ND4RYWG7.mjs.map +0 -1
  112. package/dist/chunk-VLSLBZME.mjs +0 -51
  113. package/dist/chunk-VLSLBZME.mjs.map +0 -1
  114. package/dist/chunk-WJBV3P3K.mjs +0 -55
  115. package/dist/chunk-WJBV3P3K.mjs.map +0 -1
  116. package/dist/chunk-X2TQ2HDS.mjs +0 -44
  117. package/dist/chunk-X2TQ2HDS.mjs.map +0 -1
  118. package/dist/chunk-YIDZOZG3.mjs +0 -103
  119. package/dist/chunk-YIDZOZG3.mjs.map +0 -1
  120. package/dist/chunk-YLW7IP7V.mjs +0 -14525
  121. package/dist/chunk-YLW7IP7V.mjs.map +0 -1
  122. package/dist/classDiagram-2ON5EDUG-WUV4PTK5.mjs +0 -38
  123. package/dist/classDiagram-2ON5EDUG-WUV4PTK5.mjs.map +0 -1
  124. package/dist/classDiagram-v2-WZHVMYZB-J4QNVYPE.mjs +0 -38
  125. package/dist/classDiagram-v2-WZHVMYZB-J4QNVYPE.mjs.map +0 -1
  126. package/dist/cobol-PNTKRG5I.mjs +0 -17
  127. package/dist/cobol-PNTKRG5I.mjs.map +0 -1
  128. package/dist/crystal-BSMHK65A.mjs +0 -23
  129. package/dist/crystal-BSMHK65A.mjs.map +0 -1
  130. package/dist/dagre-6UL2VRFP-XN667C7N.mjs +0 -710
  131. package/dist/dagre-6UL2VRFP-XN667C7N.mjs.map +0 -1
  132. package/dist/diagram-PSM6KHXK-VA2CF5LZ.mjs +0 -538
  133. package/dist/diagram-PSM6KHXK-VA2CF5LZ.mjs.map +0 -1
  134. package/dist/diagram-QEK2KX5R-H3EHES33.mjs +0 -319
  135. package/dist/diagram-QEK2KX5R-H3EHES33.mjs.map +0 -1
  136. package/dist/diagram-S2PKOQOG-FOQYPB22.mjs +0 -231
  137. package/dist/diagram-S2PKOQOG-FOQYPB22.mjs.map +0 -1
  138. package/dist/edge-JOI74UJM.mjs +0 -19
  139. package/dist/edge-JOI74UJM.mjs.map +0 -1
  140. package/dist/elixir-FEL6DDPJ.mjs +0 -15
  141. package/dist/elixir-FEL6DDPJ.mjs.map +0 -1
  142. package/dist/erDiagram-Q2GNP2WA-IXNJSD2A.mjs +0 -1175
  143. package/dist/erDiagram-Q2GNP2WA-IXNJSD2A.mjs.map +0 -1
  144. package/dist/erb-Q2D6FWX3.mjs +0 -32
  145. package/dist/erb-Q2D6FWX3.mjs.map +0 -1
  146. package/dist/flowDiagram-NV44I4VS-ISKGEBMD.mjs +0 -2349
  147. package/dist/flowDiagram-NV44I4VS-ISKGEBMD.mjs.map +0 -1
  148. package/dist/ganttDiagram-LVOFAZNH-OAL7V7IR.mjs +0 -2344
  149. package/dist/ganttDiagram-LVOFAZNH-OAL7V7IR.mjs.map +0 -1
  150. package/dist/gitGraphDiagram-NY62KEGX-RKN2CCAZ.mjs +0 -1221
  151. package/dist/gitGraphDiagram-NY62KEGX-RKN2CCAZ.mjs.map +0 -1
  152. package/dist/glimmer-js-B32LCGFA.mjs +0 -19
  153. package/dist/glimmer-js-B32LCGFA.mjs.map +0 -1
  154. package/dist/glimmer-ts-4PHFAQCG.mjs +0 -19
  155. package/dist/glimmer-ts-4PHFAQCG.mjs.map +0 -1
  156. package/dist/hack-3ZNSL4KD.mjs +0 -17
  157. package/dist/hack-3ZNSL4KD.mjs.map +0 -1
  158. package/dist/handlebars-ICBC3AZK.mjs +0 -19
  159. package/dist/handlebars-ICBC3AZK.mjs.map +0 -1
  160. package/dist/html-BGY5P773.mjs +0 -6
  161. package/dist/html-BGY5P773.mjs.map +0 -1
  162. package/dist/html-derivative-3HGXHHFE.mjs +0 -7
  163. package/dist/html-derivative-3HGXHHFE.mjs.map +0 -1
  164. package/dist/index.css +0 -2385
  165. package/dist/index.css.map +0 -1
  166. package/dist/infoDiagram-F6ZHWCRC-Z7KMJJ45.mjs +0 -49
  167. package/dist/infoDiagram-F6ZHWCRC-Z7KMJJ45.mjs.map +0 -1
  168. package/dist/jinja-WL6HNMB5.mjs +0 -22
  169. package/dist/jinja-WL6HNMB5.mjs.map +0 -1
  170. package/dist/journeyDiagram-XKPGCS4Q-BMTOBHZ4.mjs +0 -1259
  171. package/dist/journeyDiagram-XKPGCS4Q-BMTOBHZ4.mjs.map +0 -1
  172. package/dist/kanban-definition-3W4ZIXB7-MVFRARF4.mjs +0 -1062
  173. package/dist/kanban-definition-3W4ZIXB7-MVFRARF4.mjs.map +0 -1
  174. package/dist/katex-4R42CMCB.mjs +0 -4
  175. package/dist/katex-4R42CMCB.mjs.map +0 -1
  176. package/dist/liquid-YS3YPW54.mjs +0 -19
  177. package/dist/liquid-YS3YPW54.mjs.map +0 -1
  178. package/dist/logo-mark-OHF64HAY.svg +0 -8
  179. package/dist/mdc-A66KLOT4.mjs +0 -20
  180. package/dist/mdc-A66KLOT4.mjs.map +0 -1
  181. package/dist/mermaid.core-4OWTNZSL.mjs +0 -1587
  182. package/dist/mermaid.core-4OWTNZSL.mjs.map +0 -1
  183. package/dist/mermaid.core-7AUE4M6E.mjs +0 -1587
  184. package/dist/mermaid.core-7AUE4M6E.mjs.map +0 -1
  185. package/dist/mindmap-definition-VGOIOE7T-7FMA2CPY.mjs +0 -1112
  186. package/dist/mindmap-definition-VGOIOE7T-7FMA2CPY.mjs.map +0 -1
  187. package/dist/mindmap-definition-VGOIOE7T-VNF7JZOY.mjs +0 -1112
  188. package/dist/mindmap-definition-VGOIOE7T-VNF7JZOY.mjs.map +0 -1
  189. package/dist/nim-HUBKBJHZ.mjs +0 -26
  190. package/dist/nim-HUBKBJHZ.mjs.map +0 -1
  191. package/dist/perl-QHAMWWQ5.mjs +0 -22
  192. package/dist/perl-QHAMWWQ5.mjs.map +0 -1
  193. package/dist/php-FS5GKSPN.mjs +0 -11
  194. package/dist/php-FS5GKSPN.mjs.map +0 -1
  195. package/dist/pieDiagram-ADFJNKIX-EER3WTCU.mjs +0 -200
  196. package/dist/pieDiagram-ADFJNKIX-EER3WTCU.mjs.map +0 -1
  197. package/dist/pug-WTY5FMEA.mjs +0 -17
  198. package/dist/pug-WTY5FMEA.mjs.map +0 -1
  199. package/dist/quadrantDiagram-AYHSOK5B-WQCIRJOK.mjs +0 -1344
  200. package/dist/quadrantDiagram-AYHSOK5B-WQCIRJOK.mjs.map +0 -1
  201. package/dist/razor-BAB7LFWZ.mjs +0 -17
  202. package/dist/razor-BAB7LFWZ.mjs.map +0 -1
  203. package/dist/requirementDiagram-UZGBJVZJ-RVM6Q2TT.mjs +0 -1179
  204. package/dist/requirementDiagram-UZGBJVZJ-RVM6Q2TT.mjs.map +0 -1
  205. package/dist/rst-AY7U27YM.mjs +0 -41
  206. package/dist/rst-AY7U27YM.mjs.map +0 -1
  207. package/dist/rst-Y2VLYMJI.mjs +0 -41
  208. package/dist/rst-Y2VLYMJI.mjs.map +0 -1
  209. package/dist/ruby-K4BNEYWG.mjs +0 -22
  210. package/dist/ruby-K4BNEYWG.mjs.map +0 -1
  211. package/dist/sankeyDiagram-TZEHDZUN-H7BVEXGO.mjs +0 -1230
  212. package/dist/sankeyDiagram-TZEHDZUN-H7BVEXGO.mjs.map +0 -1
  213. package/dist/sequenceDiagram-WL72ISMW-XBGZSOYI.mjs +0 -3885
  214. package/dist/sequenceDiagram-WL72ISMW-XBGZSOYI.mjs.map +0 -1
  215. package/dist/soy-5QMQV2KL.mjs +0 -15
  216. package/dist/soy-5QMQV2KL.mjs.map +0 -1
  217. package/dist/stateDiagram-FKZM4ZOC-WRIBVFSJ.mjs +0 -467
  218. package/dist/stateDiagram-FKZM4ZOC-WRIBVFSJ.mjs.map +0 -1
  219. package/dist/stateDiagram-v2-4FDKWEC3-SPDO7R6D.mjs +0 -37
  220. package/dist/stateDiagram-v2-4FDKWEC3-SPDO7R6D.mjs.map +0 -1
  221. package/dist/templ-VSARRSO2.mjs +0 -17
  222. package/dist/templ-VSARRSO2.mjs.map +0 -1
  223. package/dist/timeline-definition-IT6M3QCI-PX4A2RIH.mjs +0 -1226
  224. package/dist/timeline-definition-IT6M3QCI-PX4A2RIH.mjs.map +0 -1
  225. package/dist/ts-tags-YK3Q2LIW.mjs +0 -68
  226. package/dist/ts-tags-YK3Q2LIW.mjs.map +0 -1
  227. package/dist/twig-HNMWLN6H.mjs +0 -40
  228. package/dist/twig-HNMWLN6H.mjs.map +0 -1
  229. package/dist/vue-7OSX6ZY5.mjs +0 -10
  230. package/dist/vue-7OSX6ZY5.mjs.map +0 -1
  231. package/dist/vue-html-AQH2V2EU.mjs +0 -20
  232. package/dist/vue-html-AQH2V2EU.mjs.map +0 -1
  233. package/dist/vue-vine-GCYT2IGV.mjs +0 -29
  234. package/dist/vue-vine-GCYT2IGV.mjs.map +0 -1
  235. package/dist/xychartDiagram-PRI3JC2R-65KZQZDU.mjs +0 -1865
  236. package/dist/xychartDiagram-PRI3JC2R-65KZQZDU.mjs.map +0 -1
@@ -1,762 +0,0 @@
1
- import { decodeEntities } from './chunk-GU7334FJ.mjs';
2
- import { getConfig, hasKatex, renderKatexSanitized, common_default, sanitizeText } from './chunk-HNKEYT4A.mjs';
3
- import { __name, log, select_default } from './chunk-WHXHCOFP.mjs';
4
- import { k } from './chunk-RAC6KEKF.mjs';
5
-
6
- // ../../node_modules/.pnpm/ts-dedent@2.2.0/node_modules/ts-dedent/esm/index.js
7
- function dedent(templ) {
8
- var values = [];
9
- for (var _i = 1; _i < arguments.length; _i++) {
10
- values[_i - 1] = arguments[_i];
11
- }
12
- var strings = Array.from(typeof templ === "string" ? [templ] : templ);
13
- strings[strings.length - 1] = strings[strings.length - 1].replace(/\r?\n([\t ]*)$/, "");
14
- var indentLengths = strings.reduce(function(arr, str) {
15
- var matches = str.match(/\n([\t ]+|(?!\s).)/g);
16
- if (matches) {
17
- return arr.concat(matches.map(function(match) {
18
- var _a, _b;
19
- return (_b = (_a = match.match(/[\t ]/g)) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0;
20
- }));
21
- }
22
- return arr;
23
- }, []);
24
- if (indentLengths.length) {
25
- var pattern_1 = new RegExp("\n[ ]{" + Math.min.apply(Math, indentLengths) + "}", "g");
26
- strings = strings.map(function(str) {
27
- return str.replace(pattern_1, "\n");
28
- });
29
- }
30
- strings[0] = strings[0].replace(/^\r?\n/, "");
31
- var string = strings[0];
32
- values.forEach(function(value, i) {
33
- var endentations = string.match(/(?:^|\n)( *)$/);
34
- var endentation = endentations ? endentations[1] : "";
35
- var indentedValue = value;
36
- if (typeof value === "string" && value.includes("\n")) {
37
- indentedValue = String(value).split("\n").map(function(str, i2) {
38
- return i2 === 0 ? str : "" + endentation + str;
39
- }).join("\n");
40
- }
41
- string += indentedValue + strings[i + 1];
42
- });
43
- return string;
44
- }
45
-
46
- // ../../node_modules/.pnpm/@iconify+utils@3.0.2/node_modules/@iconify/utils/lib/icon/defaults.js
47
- var defaultIconDimensions = Object.freeze({
48
- left: 0,
49
- top: 0,
50
- width: 16,
51
- height: 16
52
- });
53
- var defaultIconTransformations = Object.freeze({
54
- rotate: 0,
55
- vFlip: false,
56
- hFlip: false
57
- });
58
- var defaultIconProps = Object.freeze({
59
- ...defaultIconDimensions,
60
- ...defaultIconTransformations
61
- });
62
- var defaultExtendedIconProps = Object.freeze({
63
- ...defaultIconProps,
64
- body: "",
65
- hidden: false
66
- });
67
-
68
- // ../../node_modules/.pnpm/@iconify+utils@3.0.2/node_modules/@iconify/utils/lib/customisations/defaults.js
69
- var defaultIconSizeCustomisations = Object.freeze({
70
- width: null,
71
- height: null
72
- });
73
- var defaultIconCustomisations = Object.freeze({
74
- ...defaultIconSizeCustomisations,
75
- ...defaultIconTransformations
76
- });
77
-
78
- // ../../node_modules/.pnpm/@iconify+utils@3.0.2/node_modules/@iconify/utils/lib/icon/name.js
79
- var stringToIcon = (value, validate, allowSimpleName, provider = "") => {
80
- const colonSeparated = value.split(":");
81
- if (value.slice(0, 1) === "@") {
82
- if (colonSeparated.length < 2 || colonSeparated.length > 3) return null;
83
- provider = colonSeparated.shift().slice(1);
84
- }
85
- if (colonSeparated.length > 3 || !colonSeparated.length) return null;
86
- if (colonSeparated.length > 1) {
87
- const name$1 = colonSeparated.pop();
88
- const prefix = colonSeparated.pop();
89
- const result = {
90
- provider: colonSeparated.length > 0 ? colonSeparated[0] : provider,
91
- prefix,
92
- name: name$1
93
- };
94
- return !validateIconName(result) ? null : result;
95
- }
96
- const name = colonSeparated[0];
97
- const dashSeparated = name.split("-");
98
- if (dashSeparated.length > 1) {
99
- const result = {
100
- provider,
101
- prefix: dashSeparated.shift(),
102
- name: dashSeparated.join("-")
103
- };
104
- return !validateIconName(result) ? null : result;
105
- }
106
- if (allowSimpleName && provider === "") {
107
- const result = {
108
- provider,
109
- prefix: "",
110
- name
111
- };
112
- return !validateIconName(result, allowSimpleName) ? null : result;
113
- }
114
- return null;
115
- };
116
- var validateIconName = (icon, allowSimpleName) => {
117
- if (!icon) return false;
118
- return !!((allowSimpleName && icon.prefix === "" || !!icon.prefix) && !!icon.name);
119
- };
120
-
121
- // ../../node_modules/.pnpm/@iconify+utils@3.0.2/node_modules/@iconify/utils/lib/icon/transformations.js
122
- function mergeIconTransformations(obj1, obj2) {
123
- const result = {};
124
- if (!obj1.hFlip !== !obj2.hFlip) result.hFlip = true;
125
- if (!obj1.vFlip !== !obj2.vFlip) result.vFlip = true;
126
- const rotate = ((obj1.rotate || 0) + (obj2.rotate || 0)) % 4;
127
- if (rotate) result.rotate = rotate;
128
- return result;
129
- }
130
-
131
- // ../../node_modules/.pnpm/@iconify+utils@3.0.2/node_modules/@iconify/utils/lib/icon/merge.js
132
- function mergeIconData(parent, child) {
133
- const result = mergeIconTransformations(parent, child);
134
- for (const key in defaultExtendedIconProps) if (key in defaultIconTransformations) {
135
- if (key in parent && !(key in result)) result[key] = defaultIconTransformations[key];
136
- } else if (key in child) result[key] = child[key];
137
- else if (key in parent) result[key] = parent[key];
138
- return result;
139
- }
140
-
141
- // ../../node_modules/.pnpm/@iconify+utils@3.0.2/node_modules/@iconify/utils/lib/icon-set/tree.js
142
- function getIconsTree(data, names) {
143
- const icons = data.icons;
144
- const aliases = data.aliases || /* @__PURE__ */ Object.create(null);
145
- const resolved = /* @__PURE__ */ Object.create(null);
146
- function resolve(name) {
147
- if (icons[name]) return resolved[name] = [];
148
- if (!(name in resolved)) {
149
- resolved[name] = null;
150
- const parent = aliases[name] && aliases[name].parent;
151
- const value = parent && resolve(parent);
152
- if (value) resolved[name] = [parent].concat(value);
153
- }
154
- return resolved[name];
155
- }
156
- (names || Object.keys(icons).concat(Object.keys(aliases))).forEach(resolve);
157
- return resolved;
158
- }
159
-
160
- // ../../node_modules/.pnpm/@iconify+utils@3.0.2/node_modules/@iconify/utils/lib/icon-set/get-icon.js
161
- function internalGetIconData(data, name, tree) {
162
- const icons = data.icons;
163
- const aliases = data.aliases || /* @__PURE__ */ Object.create(null);
164
- let currentProps = {};
165
- function parse(name$1) {
166
- currentProps = mergeIconData(icons[name$1] || aliases[name$1], currentProps);
167
- }
168
- parse(name);
169
- tree.forEach(parse);
170
- return mergeIconData(data, currentProps);
171
- }
172
- function getIconData(data, name) {
173
- if (data.icons[name]) return internalGetIconData(data, name, []);
174
- const tree = getIconsTree(data, [name])[name];
175
- return tree ? internalGetIconData(data, name, tree) : null;
176
- }
177
-
178
- // ../../node_modules/.pnpm/@iconify+utils@3.0.2/node_modules/@iconify/utils/lib/svg/size.js
179
- var unitsSplit = /(-?[0-9.]*[0-9]+[0-9.]*)/g;
180
- var unitsTest = /^-?[0-9.]*[0-9]+[0-9.]*$/g;
181
- function calculateSize(size, ratio, precision) {
182
- if (ratio === 1) return size;
183
- precision = precision || 100;
184
- if (typeof size === "number") return Math.ceil(size * ratio * precision) / precision;
185
- if (typeof size !== "string") return size;
186
- const oldParts = size.split(unitsSplit);
187
- if (oldParts === null || !oldParts.length) return size;
188
- const newParts = [];
189
- let code = oldParts.shift();
190
- let isNumber = unitsTest.test(code);
191
- while (true) {
192
- if (isNumber) {
193
- const num = parseFloat(code);
194
- if (isNaN(num)) newParts.push(code);
195
- else newParts.push(Math.ceil(num * ratio * precision) / precision);
196
- } else newParts.push(code);
197
- code = oldParts.shift();
198
- if (code === void 0) return newParts.join("");
199
- isNumber = !isNumber;
200
- }
201
- }
202
-
203
- // ../../node_modules/.pnpm/@iconify+utils@3.0.2/node_modules/@iconify/utils/lib/svg/defs.js
204
- function splitSVGDefs(content, tag = "defs") {
205
- let defs = "";
206
- const index = content.indexOf("<" + tag);
207
- while (index >= 0) {
208
- const start = content.indexOf(">", index);
209
- const end = content.indexOf("</" + tag);
210
- if (start === -1 || end === -1) break;
211
- const endEnd = content.indexOf(">", end);
212
- if (endEnd === -1) break;
213
- defs += content.slice(start + 1, end).trim();
214
- content = content.slice(0, index).trim() + content.slice(endEnd + 1);
215
- }
216
- return {
217
- defs,
218
- content
219
- };
220
- }
221
- function mergeDefsAndContent(defs, content) {
222
- return defs ? "<defs>" + defs + "</defs>" + content : content;
223
- }
224
- function wrapSVGContent(body, start, end) {
225
- const split = splitSVGDefs(body);
226
- return mergeDefsAndContent(split.defs, start + split.content + end);
227
- }
228
-
229
- // ../../node_modules/.pnpm/@iconify+utils@3.0.2/node_modules/@iconify/utils/lib/svg/build.js
230
- var isUnsetKeyword = (value) => value === "unset" || value === "undefined" || value === "none";
231
- function iconToSVG(icon, customisations) {
232
- const fullIcon = {
233
- ...defaultIconProps,
234
- ...icon
235
- };
236
- const fullCustomisations = {
237
- ...defaultIconCustomisations,
238
- ...customisations
239
- };
240
- const box = {
241
- left: fullIcon.left,
242
- top: fullIcon.top,
243
- width: fullIcon.width,
244
- height: fullIcon.height
245
- };
246
- let body = fullIcon.body;
247
- [fullIcon, fullCustomisations].forEach((props) => {
248
- const transformations = [];
249
- const hFlip = props.hFlip;
250
- const vFlip = props.vFlip;
251
- let rotation = props.rotate;
252
- if (hFlip) if (vFlip) rotation += 2;
253
- else {
254
- transformations.push("translate(" + (box.width + box.left).toString() + " " + (0 - box.top).toString() + ")");
255
- transformations.push("scale(-1 1)");
256
- box.top = box.left = 0;
257
- }
258
- else if (vFlip) {
259
- transformations.push("translate(" + (0 - box.left).toString() + " " + (box.height + box.top).toString() + ")");
260
- transformations.push("scale(1 -1)");
261
- box.top = box.left = 0;
262
- }
263
- let tempValue;
264
- if (rotation < 0) rotation -= Math.floor(rotation / 4) * 4;
265
- rotation = rotation % 4;
266
- switch (rotation) {
267
- case 1:
268
- tempValue = box.height / 2 + box.top;
269
- transformations.unshift("rotate(90 " + tempValue.toString() + " " + tempValue.toString() + ")");
270
- break;
271
- case 2:
272
- transformations.unshift("rotate(180 " + (box.width / 2 + box.left).toString() + " " + (box.height / 2 + box.top).toString() + ")");
273
- break;
274
- case 3:
275
- tempValue = box.width / 2 + box.left;
276
- transformations.unshift("rotate(-90 " + tempValue.toString() + " " + tempValue.toString() + ")");
277
- break;
278
- }
279
- if (rotation % 2 === 1) {
280
- if (box.left !== box.top) {
281
- tempValue = box.left;
282
- box.left = box.top;
283
- box.top = tempValue;
284
- }
285
- if (box.width !== box.height) {
286
- tempValue = box.width;
287
- box.width = box.height;
288
- box.height = tempValue;
289
- }
290
- }
291
- if (transformations.length) body = wrapSVGContent(body, '<g transform="' + transformations.join(" ") + '">', "</g>");
292
- });
293
- const customisationsWidth = fullCustomisations.width;
294
- const customisationsHeight = fullCustomisations.height;
295
- const boxWidth = box.width;
296
- const boxHeight = box.height;
297
- let width;
298
- let height;
299
- if (customisationsWidth === null) {
300
- height = customisationsHeight === null ? "1em" : customisationsHeight === "auto" ? boxHeight : customisationsHeight;
301
- width = calculateSize(height, boxWidth / boxHeight);
302
- } else {
303
- width = customisationsWidth === "auto" ? boxWidth : customisationsWidth;
304
- height = customisationsHeight === null ? calculateSize(width, boxHeight / boxWidth) : customisationsHeight === "auto" ? boxHeight : customisationsHeight;
305
- }
306
- const attributes = {};
307
- const setAttr = (prop, value) => {
308
- if (!isUnsetKeyword(value)) attributes[prop] = value.toString();
309
- };
310
- setAttr("width", width);
311
- setAttr("height", height);
312
- const viewBox = [
313
- box.left,
314
- box.top,
315
- boxWidth,
316
- boxHeight
317
- ];
318
- attributes.viewBox = viewBox.join(" ");
319
- return {
320
- attributes,
321
- viewBox,
322
- body
323
- };
324
- }
325
-
326
- // ../../node_modules/.pnpm/@iconify+utils@3.0.2/node_modules/@iconify/utils/lib/svg/id.js
327
- var regex = /\sid="(\S+)"/g;
328
- var randomPrefix = "IconifyId" + Date.now().toString(16) + (Math.random() * 16777216 | 0).toString(16);
329
- var counter = 0;
330
- function replaceIDs(body, prefix = randomPrefix) {
331
- const ids = [];
332
- let match;
333
- while (match = regex.exec(body)) ids.push(match[1]);
334
- if (!ids.length) return body;
335
- const suffix = "suffix" + (Math.random() * 16777216 | Date.now()).toString(16);
336
- ids.forEach((id) => {
337
- const newID = typeof prefix === "function" ? prefix(id) : prefix + (counter++).toString();
338
- const escapedID = id.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
339
- body = body.replace(new RegExp('([#;"])(' + escapedID + ')([")]|\\.[a-z])', "g"), "$1" + newID + suffix + "$3");
340
- });
341
- body = body.replace(new RegExp(suffix, "g"), "");
342
- return body;
343
- }
344
-
345
- // ../../node_modules/.pnpm/@iconify+utils@3.0.2/node_modules/@iconify/utils/lib/svg/html.js
346
- function iconToHTML(body, attributes) {
347
- let renderAttribsHTML = body.indexOf("xlink:") === -1 ? "" : ' xmlns:xlink="http://www.w3.org/1999/xlink"';
348
- for (const attr in attributes) renderAttribsHTML += " " + attr + '="' + attributes[attr] + '"';
349
- return '<svg xmlns="http://www.w3.org/2000/svg"' + renderAttribsHTML + ">" + body + "</svg>";
350
- }
351
-
352
- // ../../node_modules/.pnpm/mermaid@11.12.0/node_modules/mermaid/dist/chunks/mermaid.core/chunk-JA3XYJ7Z.mjs
353
- var unknownIcon = {
354
- body: '<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/><text transform="translate(21.16 64.67)" style="fill: #fff; font-family: ArialMT, Arial; font-size: 67.75px;"><tspan x="0" y="0">?</tspan></text></g>',
355
- height: 80,
356
- width: 80
357
- };
358
- var iconsStore = /* @__PURE__ */ new Map();
359
- var loaderStore = /* @__PURE__ */ new Map();
360
- var registerIconPacks = /* @__PURE__ */ __name((iconLoaders) => {
361
- for (const iconLoader of iconLoaders) {
362
- if (!iconLoader.name) {
363
- throw new Error(
364
- 'Invalid icon loader. Must have a "name" property with non-empty string value.'
365
- );
366
- }
367
- log.debug("Registering icon pack:", iconLoader.name);
368
- if ("loader" in iconLoader) {
369
- loaderStore.set(iconLoader.name, iconLoader.loader);
370
- } else if ("icons" in iconLoader) {
371
- iconsStore.set(iconLoader.name, iconLoader.icons);
372
- } else {
373
- log.error("Invalid icon loader:", iconLoader);
374
- throw new Error('Invalid icon loader. Must have either "icons" or "loader" property.');
375
- }
376
- }
377
- }, "registerIconPacks");
378
- var getRegisteredIconData = /* @__PURE__ */ __name(async (iconName, fallbackPrefix) => {
379
- const data = stringToIcon(iconName, true, fallbackPrefix !== void 0);
380
- if (!data) {
381
- throw new Error(`Invalid icon name: ${iconName}`);
382
- }
383
- const prefix = data.prefix || fallbackPrefix;
384
- if (!prefix) {
385
- throw new Error(`Icon name must contain a prefix: ${iconName}`);
386
- }
387
- let icons = iconsStore.get(prefix);
388
- if (!icons) {
389
- const loader = loaderStore.get(prefix);
390
- if (!loader) {
391
- throw new Error(`Icon set not found: ${data.prefix}`);
392
- }
393
- try {
394
- const loaded = await loader();
395
- icons = { ...loaded, prefix };
396
- iconsStore.set(prefix, icons);
397
- } catch (e) {
398
- log.error(e);
399
- throw new Error(`Failed to load icon set: ${data.prefix}`);
400
- }
401
- }
402
- const iconData = getIconData(icons, data.name);
403
- if (!iconData) {
404
- throw new Error(`Icon not found: ${iconName}`);
405
- }
406
- return iconData;
407
- }, "getRegisteredIconData");
408
- var isIconAvailable = /* @__PURE__ */ __name(async (iconName) => {
409
- try {
410
- await getRegisteredIconData(iconName);
411
- return true;
412
- } catch {
413
- return false;
414
- }
415
- }, "isIconAvailable");
416
- var getIconSVG = /* @__PURE__ */ __name(async (iconName, customisations, extraAttributes) => {
417
- let iconData;
418
- try {
419
- iconData = await getRegisteredIconData(iconName, customisations?.fallbackPrefix);
420
- } catch (e) {
421
- log.error(e);
422
- iconData = unknownIcon;
423
- }
424
- const renderData = iconToSVG(iconData, customisations);
425
- const svg = iconToHTML(replaceIDs(renderData.body), {
426
- ...renderData.attributes,
427
- ...extraAttributes
428
- });
429
- return sanitizeText(svg, getConfig());
430
- }, "getIconSVG");
431
- function preprocessMarkdown(markdown, { markdownAutoWrap }) {
432
- const withoutBR = markdown.replace(/<br\/>/g, "\n");
433
- const withoutMultipleNewlines = withoutBR.replace(/\n{2,}/g, "\n");
434
- const withoutExtraSpaces = dedent(withoutMultipleNewlines);
435
- if (markdownAutoWrap === false) {
436
- return withoutExtraSpaces.replace(/ /g, "&nbsp;");
437
- }
438
- return withoutExtraSpaces;
439
- }
440
- __name(preprocessMarkdown, "preprocessMarkdown");
441
- function markdownToLines(markdown, config = {}) {
442
- const preprocessedMarkdown = preprocessMarkdown(markdown, config);
443
- const nodes = k.lexer(preprocessedMarkdown);
444
- const lines = [[]];
445
- let currentLine = 0;
446
- function processNode(node, parentType = "normal") {
447
- if (node.type === "text") {
448
- const textLines = node.text.split("\n");
449
- textLines.forEach((textLine, index) => {
450
- if (index !== 0) {
451
- currentLine++;
452
- lines.push([]);
453
- }
454
- textLine.split(" ").forEach((word) => {
455
- word = word.replace(/&#39;/g, `'`);
456
- if (word) {
457
- lines[currentLine].push({ content: word, type: parentType });
458
- }
459
- });
460
- });
461
- } else if (node.type === "strong" || node.type === "em") {
462
- node.tokens.forEach((contentNode) => {
463
- processNode(contentNode, node.type);
464
- });
465
- } else if (node.type === "html") {
466
- lines[currentLine].push({ content: node.text, type: "normal" });
467
- }
468
- }
469
- __name(processNode, "processNode");
470
- nodes.forEach((treeNode) => {
471
- if (treeNode.type === "paragraph") {
472
- treeNode.tokens?.forEach((contentNode) => {
473
- processNode(contentNode);
474
- });
475
- } else if (treeNode.type === "html") {
476
- lines[currentLine].push({ content: treeNode.text, type: "normal" });
477
- } else {
478
- lines[currentLine].push({ content: treeNode.raw, type: "normal" });
479
- }
480
- });
481
- return lines;
482
- }
483
- __name(markdownToLines, "markdownToLines");
484
- function markdownToHTML(markdown, { markdownAutoWrap } = {}) {
485
- const nodes = k.lexer(markdown);
486
- function output(node) {
487
- if (node.type === "text") {
488
- if (markdownAutoWrap === false) {
489
- return node.text.replace(/\n */g, "<br/>").replace(/ /g, "&nbsp;");
490
- }
491
- return node.text.replace(/\n */g, "<br/>");
492
- } else if (node.type === "strong") {
493
- return `<strong>${node.tokens?.map(output).join("")}</strong>`;
494
- } else if (node.type === "em") {
495
- return `<em>${node.tokens?.map(output).join("")}</em>`;
496
- } else if (node.type === "paragraph") {
497
- return `<p>${node.tokens?.map(output).join("")}</p>`;
498
- } else if (node.type === "space") {
499
- return "";
500
- } else if (node.type === "html") {
501
- return `${node.text}`;
502
- } else if (node.type === "escape") {
503
- return node.text;
504
- }
505
- log.warn(`Unsupported markdown: ${node.type}`);
506
- return node.raw;
507
- }
508
- __name(output, "output");
509
- return nodes.map(output).join("");
510
- }
511
- __name(markdownToHTML, "markdownToHTML");
512
- function splitTextToChars(text) {
513
- if (Intl.Segmenter) {
514
- return [...new Intl.Segmenter().segment(text)].map((s) => s.segment);
515
- }
516
- return [...text];
517
- }
518
- __name(splitTextToChars, "splitTextToChars");
519
- function splitWordToFitWidth(checkFit, word) {
520
- const characters = splitTextToChars(word.content);
521
- return splitWordToFitWidthRecursion(checkFit, [], characters, word.type);
522
- }
523
- __name(splitWordToFitWidth, "splitWordToFitWidth");
524
- function splitWordToFitWidthRecursion(checkFit, usedChars, remainingChars, type) {
525
- if (remainingChars.length === 0) {
526
- return [
527
- { content: usedChars.join(""), type },
528
- { content: "", type }
529
- ];
530
- }
531
- const [nextChar, ...rest] = remainingChars;
532
- const newWord = [...usedChars, nextChar];
533
- if (checkFit([{ content: newWord.join(""), type }])) {
534
- return splitWordToFitWidthRecursion(checkFit, newWord, rest, type);
535
- }
536
- if (usedChars.length === 0 && nextChar) {
537
- usedChars.push(nextChar);
538
- remainingChars.shift();
539
- }
540
- return [
541
- { content: usedChars.join(""), type },
542
- { content: remainingChars.join(""), type }
543
- ];
544
- }
545
- __name(splitWordToFitWidthRecursion, "splitWordToFitWidthRecursion");
546
- function splitLineToFitWidth(line, checkFit) {
547
- if (line.some(({ content }) => content.includes("\n"))) {
548
- throw new Error("splitLineToFitWidth does not support newlines in the line");
549
- }
550
- return splitLineToFitWidthRecursion(line, checkFit);
551
- }
552
- __name(splitLineToFitWidth, "splitLineToFitWidth");
553
- function splitLineToFitWidthRecursion(words, checkFit, lines = [], newLine = []) {
554
- if (words.length === 0) {
555
- if (newLine.length > 0) {
556
- lines.push(newLine);
557
- }
558
- return lines.length > 0 ? lines : [];
559
- }
560
- let joiner = "";
561
- if (words[0].content === " ") {
562
- joiner = " ";
563
- words.shift();
564
- }
565
- const nextWord = words.shift() ?? { content: " ", type: "normal" };
566
- const lineWithNextWord = [...newLine];
567
- if (joiner !== "") {
568
- lineWithNextWord.push({ content: joiner, type: "normal" });
569
- }
570
- lineWithNextWord.push(nextWord);
571
- if (checkFit(lineWithNextWord)) {
572
- return splitLineToFitWidthRecursion(words, checkFit, lines, lineWithNextWord);
573
- }
574
- if (newLine.length > 0) {
575
- lines.push(newLine);
576
- words.unshift(nextWord);
577
- } else if (nextWord.content) {
578
- const [line, rest] = splitWordToFitWidth(checkFit, nextWord);
579
- lines.push([line]);
580
- if (rest.content) {
581
- words.unshift(rest);
582
- }
583
- }
584
- return splitLineToFitWidthRecursion(words, checkFit, lines);
585
- }
586
- __name(splitLineToFitWidthRecursion, "splitLineToFitWidthRecursion");
587
- function applyStyle(dom, styleFn) {
588
- if (styleFn) {
589
- dom.attr("style", styleFn);
590
- }
591
- }
592
- __name(applyStyle, "applyStyle");
593
- async function addHtmlSpan(element, node, width, classes, addBackground = false, config = getConfig()) {
594
- const fo = element.append("foreignObject");
595
- fo.attr("width", `${10 * width}px`);
596
- fo.attr("height", `${10 * width}px`);
597
- const div = fo.append("xhtml:div");
598
- const sanitizedLabel = hasKatex(node.label) ? await renderKatexSanitized(node.label.replace(common_default.lineBreakRegex, "\n"), config) : sanitizeText(node.label, config);
599
- const labelClass = node.isNode ? "nodeLabel" : "edgeLabel";
600
- const span = div.append("span");
601
- span.html(sanitizedLabel);
602
- applyStyle(span, node.labelStyle);
603
- span.attr("class", `${labelClass} ${classes}`);
604
- applyStyle(div, node.labelStyle);
605
- div.style("display", "table-cell");
606
- div.style("white-space", "nowrap");
607
- div.style("line-height", "1.5");
608
- div.style("max-width", width + "px");
609
- div.style("text-align", "center");
610
- div.attr("xmlns", "http://www.w3.org/1999/xhtml");
611
- if (addBackground) {
612
- div.attr("class", "labelBkg");
613
- }
614
- let bbox = div.node().getBoundingClientRect();
615
- if (bbox.width === width) {
616
- div.style("display", "table");
617
- div.style("white-space", "break-spaces");
618
- div.style("width", width + "px");
619
- bbox = div.node().getBoundingClientRect();
620
- }
621
- return fo.node();
622
- }
623
- __name(addHtmlSpan, "addHtmlSpan");
624
- function createTspan(textElement, lineIndex, lineHeight) {
625
- return textElement.append("tspan").attr("class", "text-outer-tspan").attr("x", 0).attr("y", lineIndex * lineHeight - 0.1 + "em").attr("dy", lineHeight + "em");
626
- }
627
- __name(createTspan, "createTspan");
628
- function computeWidthOfText(parentNode, lineHeight, line) {
629
- const testElement = parentNode.append("text");
630
- const testSpan = createTspan(testElement, 1, lineHeight);
631
- updateTextContentAndStyles(testSpan, line);
632
- const textLength = testSpan.node().getComputedTextLength();
633
- testElement.remove();
634
- return textLength;
635
- }
636
- __name(computeWidthOfText, "computeWidthOfText");
637
- function computeDimensionOfText(parentNode, lineHeight, text) {
638
- const testElement = parentNode.append("text");
639
- const testSpan = createTspan(testElement, 1, lineHeight);
640
- updateTextContentAndStyles(testSpan, [{ content: text, type: "normal" }]);
641
- const textDimension = testSpan.node()?.getBoundingClientRect();
642
- if (textDimension) {
643
- testElement.remove();
644
- }
645
- return textDimension;
646
- }
647
- __name(computeDimensionOfText, "computeDimensionOfText");
648
- function createFormattedText(width, g, structuredText, addBackground = false) {
649
- const lineHeight = 1.1;
650
- const labelGroup = g.append("g");
651
- const bkg = labelGroup.insert("rect").attr("class", "background").attr("style", "stroke: none");
652
- const textElement = labelGroup.append("text").attr("y", "-10.1");
653
- let lineIndex = 0;
654
- for (const line of structuredText) {
655
- const checkWidth = /* @__PURE__ */ __name((line2) => computeWidthOfText(labelGroup, lineHeight, line2) <= width, "checkWidth");
656
- const linesUnderWidth = checkWidth(line) ? [line] : splitLineToFitWidth(line, checkWidth);
657
- for (const preparedLine of linesUnderWidth) {
658
- const tspan = createTspan(textElement, lineIndex, lineHeight);
659
- updateTextContentAndStyles(tspan, preparedLine);
660
- lineIndex++;
661
- }
662
- }
663
- if (addBackground) {
664
- const bbox = textElement.node().getBBox();
665
- const padding = 2;
666
- bkg.attr("x", bbox.x - padding).attr("y", bbox.y - padding).attr("width", bbox.width + 2 * padding).attr("height", bbox.height + 2 * padding);
667
- return labelGroup.node();
668
- } else {
669
- return textElement.node();
670
- }
671
- }
672
- __name(createFormattedText, "createFormattedText");
673
- function updateTextContentAndStyles(tspan, wrappedLine) {
674
- tspan.text("");
675
- wrappedLine.forEach((word, index) => {
676
- const innerTspan = tspan.append("tspan").attr("font-style", word.type === "em" ? "italic" : "normal").attr("class", "text-inner-tspan").attr("font-weight", word.type === "strong" ? "bold" : "normal");
677
- if (index === 0) {
678
- innerTspan.text(word.content);
679
- } else {
680
- innerTspan.text(" " + word.content);
681
- }
682
- });
683
- }
684
- __name(updateTextContentAndStyles, "updateTextContentAndStyles");
685
- async function replaceIconSubstring(text, config = {}) {
686
- const pendingReplacements = [];
687
- text.replace(/(fa[bklrs]?):fa-([\w-]+)/g, (fullMatch, prefix, iconName) => {
688
- pendingReplacements.push(
689
- (async () => {
690
- const registeredIconName = `${prefix}:${iconName}`;
691
- if (await isIconAvailable(registeredIconName)) {
692
- return await getIconSVG(registeredIconName, void 0, { class: "label-icon" });
693
- } else {
694
- return `<i class='${sanitizeText(fullMatch, config).replace(":", " ")}'></i>`;
695
- }
696
- })()
697
- );
698
- return fullMatch;
699
- });
700
- const replacements = await Promise.all(pendingReplacements);
701
- return text.replace(/(fa[bklrs]?):fa-([\w-]+)/g, () => replacements.shift() ?? "");
702
- }
703
- __name(replaceIconSubstring, "replaceIconSubstring");
704
- var createText = /* @__PURE__ */ __name(async (el, text = "", {
705
- style = "",
706
- isTitle = false,
707
- classes = "",
708
- useHtmlLabels = true,
709
- isNode = true,
710
- width = 200,
711
- addSvgBackground = false
712
- } = {}, config) => {
713
- log.debug(
714
- "XYZ createText",
715
- text,
716
- style,
717
- isTitle,
718
- classes,
719
- useHtmlLabels,
720
- isNode,
721
- "addSvgBackground: ",
722
- addSvgBackground
723
- );
724
- if (useHtmlLabels) {
725
- const htmlText = markdownToHTML(text, config);
726
- const decodedReplacedText = await replaceIconSubstring(decodeEntities(htmlText), config);
727
- const inputForKatex = text.replace(/\\\\/g, "\\");
728
- const node = {
729
- isNode,
730
- label: hasKatex(text) ? inputForKatex : decodedReplacedText,
731
- labelStyle: style.replace("fill:", "color:")
732
- };
733
- const vertexNode = await addHtmlSpan(el, node, width, classes, addSvgBackground, config);
734
- return vertexNode;
735
- } else {
736
- const sanitizeBR = text.replace(/<br\s*\/?>/g, "<br/>");
737
- const structuredText = markdownToLines(sanitizeBR.replace("<br>", "<br/>"), config);
738
- const svgLabel = createFormattedText(
739
- width,
740
- el,
741
- structuredText,
742
- text ? addSvgBackground : false
743
- );
744
- if (isNode) {
745
- if (/stroke:/.exec(style)) {
746
- style = style.replace("stroke:", "lineColor:");
747
- }
748
- const nodeLabelTextStyle = style.replace(/stroke:[^;]+;?/g, "").replace(/stroke-width:[^;]+;?/g, "").replace(/fill:[^;]+;?/g, "").replace(/color:/g, "fill:");
749
- select_default(svgLabel).attr("style", nodeLabelTextStyle);
750
- } else {
751
- const edgeLabelRectStyle = style.replace(/stroke:[^;]+;?/g, "").replace(/stroke-width:[^;]+;?/g, "").replace(/fill:[^;]+;?/g, "").replace(/background:/g, "fill:");
752
- select_default(svgLabel).select("rect").attr("style", edgeLabelRectStyle.replace(/background:/g, "fill:"));
753
- const edgeLabelTextStyle = style.replace(/stroke:[^;]+;?/g, "").replace(/stroke-width:[^;]+;?/g, "").replace(/fill:[^;]+;?/g, "").replace(/color:/g, "fill:");
754
- select_default(svgLabel).select("text").attr("style", edgeLabelTextStyle);
755
- }
756
- return svgLabel;
757
- }
758
- }, "createText");
759
-
760
- export { computeDimensionOfText, createText, dedent, getIconSVG, registerIconPacks, replaceIconSubstring, unknownIcon };
761
- //# sourceMappingURL=chunk-BUEC2HNL.mjs.map
762
- //# sourceMappingURL=chunk-BUEC2HNL.mjs.map