@antv/infographic 0.2.11 → 0.2.12

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 (300) hide show
  1. package/dist/infographic.min.js +1 -1
  2. package/dist/infographic.min.js.map +1 -1
  3. package/esm/designs/components/Btn.js +15 -4
  4. package/esm/designs/components/BtnsGroup.js +1 -1
  5. package/esm/designs/components/Illus.js +15 -3
  6. package/esm/designs/components/ItemDesc.js +17 -11
  7. package/esm/designs/components/ItemIcon.js +17 -18
  8. package/esm/designs/components/ItemLabel.js +17 -11
  9. package/esm/designs/components/ItemValue.js +17 -12
  10. package/esm/designs/components/ItemsGroup.js +1 -1
  11. package/esm/designs/components/ShapesGroup.js +1 -1
  12. package/esm/designs/components/Title.js +2 -2
  13. package/esm/designs/decorations/simple-arrow.js +14 -2
  14. package/esm/designs/decorations/triangle.js +14 -2
  15. package/esm/designs/defs/DropShadow.js +13 -2
  16. package/esm/designs/defs/LinearGradient.js +1 -1
  17. package/esm/designs/items/BadgeCard.js +2 -2
  18. package/esm/designs/items/CandyCardLite.js +1 -1
  19. package/esm/designs/items/CapsuleItem.js +3 -3
  20. package/esm/designs/items/CircleNode.js +1 -1
  21. package/esm/designs/items/CircularProgress.js +3 -2
  22. package/esm/designs/items/CompactCard.js +1 -1
  23. package/esm/designs/items/DoneList.js +1 -1
  24. package/esm/designs/items/HorizontalIconArrow.js +2 -2
  25. package/esm/designs/items/HorizontalIconLine.js +2 -2
  26. package/esm/designs/items/IconBadge.js +4 -3
  27. package/esm/designs/items/IndexedCard.js +1 -1
  28. package/esm/designs/items/LCornerCard.js +1 -1
  29. package/esm/designs/items/LetterCard.js +4 -3
  30. package/esm/designs/items/LinedText.js +6 -5
  31. package/esm/designs/items/PillBadge.js +2 -2
  32. package/esm/designs/items/PlainText.js +4 -4
  33. package/esm/designs/items/ProgressCard.js +4 -4
  34. package/esm/designs/items/QuarterCircular.js +1 -1
  35. package/esm/designs/items/QuarterSimpleCard.js +1 -1
  36. package/esm/designs/items/RibbonCard.js +2 -2
  37. package/esm/designs/items/RoundedRectNode.js +2 -2
  38. package/esm/designs/items/SimpleCircleNode.js +1 -1
  39. package/esm/designs/items/SimpleHorizontalArrow.js +2 -2
  40. package/esm/designs/items/SimpleIllusItem.js +1 -1
  41. package/esm/designs/items/SimpleItem.js +3 -3
  42. package/esm/designs/items/SimpleVerticalArrow.js +2 -2
  43. package/esm/designs/items/UnderlineText.js +1 -1
  44. package/esm/designs/items/VerticalIconArrow.js +2 -2
  45. package/esm/designs/layouts/Align.js +22 -15
  46. package/esm/designs/layouts/Flex.js +23 -16
  47. package/esm/designs/structures/chart-bar.js +7 -5
  48. package/esm/designs/structures/chart-column.js +3 -2
  49. package/esm/designs/structures/chart-line.js +7 -5
  50. package/esm/designs/structures/chart-pie.js +4 -3
  51. package/esm/designs/structures/chart-wordcloud.js +5 -14
  52. package/esm/designs/structures/compare-binary-horizontal/dividers/pros-cons-arrow.js +1 -1
  53. package/esm/designs/structures/compare-binary-horizontal/dividers/pros-cons-fold.js +1 -1
  54. package/esm/designs/structures/compare-binary-horizontal/dividers/types.js +2 -1
  55. package/esm/designs/structures/compare-hierarchy-left-right.js +6 -5
  56. package/esm/designs/structures/compare-hierarchy-row.js +3 -2
  57. package/esm/designs/structures/compare-quadrant.js +2 -3
  58. package/esm/designs/structures/hierarchy-mindmap.js +19 -19
  59. package/esm/designs/structures/hierarchy-structure.js +1 -1
  60. package/esm/designs/structures/hierarchy-tree.js +15 -24
  61. package/esm/designs/structures/list-sector.js +5 -6
  62. package/esm/designs/structures/list-zigzag.js +2 -1
  63. package/esm/designs/structures/relation-dagre-flow.js +30 -35
  64. package/esm/designs/structures/relation-network.js +2 -2
  65. package/esm/designs/structures/sequence-funnel.js +1 -1
  66. package/esm/designs/structures/sequence-mountain.js +4 -4
  67. package/esm/designs/structures/sequence-pyramid.js +1 -1
  68. package/esm/designs/structures/sequence-zigzag-steps.js +2 -1
  69. package/esm/designs/utils/color.js +8 -4
  70. package/esm/designs/utils/item.js +3 -2
  71. package/esm/editor/commands/Batch.js +21 -8
  72. package/esm/editor/commands/UpdateElement.js +25 -22
  73. package/esm/editor/commands/UpdateOptions.js +23 -10
  74. package/esm/editor/commands/UpdateText.js +24 -11
  75. package/esm/editor/interactions/brush-select.js +27 -13
  76. package/esm/editor/interactions/click-select.js +13 -3
  77. package/esm/editor/interactions/dblclick-edit-text.js +36 -20
  78. package/esm/editor/interactions/drag-element.js +23 -9
  79. package/esm/editor/interactions/hotkey-history.js +17 -7
  80. package/esm/editor/interactions/select-highlight.js +5 -9
  81. package/esm/editor/interactions/zoom-wheel.js +2 -1
  82. package/esm/editor/managers/command.js +45 -27
  83. package/esm/editor/managers/interaction.js +46 -33
  84. package/esm/editor/managers/state.js +1 -1
  85. package/esm/editor/plugins/edit-bar/components/color-picker.js +9 -6
  86. package/esm/editor/plugins/edit-bar/components/popover.js +15 -12
  87. package/esm/editor/plugins/edit-bar/components/select.js +10 -8
  88. package/esm/editor/plugins/edit-bar/edit-bar.js +7 -25
  89. package/esm/editor/plugins/edit-bar/edit-items/align-elements.js +5 -3
  90. package/esm/editor/plugins/edit-bar/edit-items/font-align.js +1 -1
  91. package/esm/editor/plugins/edit-bar/edit-items/font-color.js +2 -2
  92. package/esm/editor/plugins/edit-bar/edit-items/icon-color.js +2 -2
  93. package/esm/editor/plugins/resize-element.js +6 -4
  94. package/esm/editor/utils/click-handler.js +6 -3
  95. package/esm/editor/utils/coordinate.js +2 -1
  96. package/esm/editor/utils/element.js +2 -1
  97. package/esm/editor/utils/event.js +2 -1
  98. package/esm/editor/utils/extension.js +1 -1
  99. package/esm/editor/utils/hotkey.js +2 -1
  100. package/esm/exporter/font.js +106 -90
  101. package/esm/exporter/png.js +49 -37
  102. package/esm/exporter/svg.js +55 -38
  103. package/esm/jsx/components/Ellipse.js +5 -4
  104. package/esm/jsx/components/Path.js +2 -4
  105. package/esm/jsx/components/Polygon.js +15 -6
  106. package/esm/jsx/components/Text.js +21 -41
  107. package/esm/jsx/renderer.js +15 -7
  108. package/esm/jsx/utils/bounds.js +18 -16
  109. package/esm/jsx/utils/children.js +2 -1
  110. package/esm/jsx/utils/clone.js +13 -2
  111. package/esm/jsx/utils/element.js +2 -1
  112. package/esm/options/parser.js +45 -46
  113. package/esm/renderer/composites/background.js +3 -2
  114. package/esm/renderer/composites/icon.js +14 -19
  115. package/esm/renderer/composites/illus.js +17 -22
  116. package/esm/renderer/composites/shape.js +4 -2
  117. package/esm/renderer/composites/svg.js +2 -1
  118. package/esm/renderer/composites/text.js +5 -3
  119. package/esm/renderer/fonts/loader.js +4 -3
  120. package/esm/renderer/fonts/registry.js +1 -1
  121. package/esm/renderer/palettes/utils.js +3 -2
  122. package/esm/renderer/renderer.js +7 -5
  123. package/esm/renderer/stylize/gradient.js +3 -2
  124. package/esm/renderer/stylize/pattern.js +15 -8
  125. package/esm/renderer/stylize/rough.js +1 -1
  126. package/esm/resource/load-tracker.js +22 -10
  127. package/esm/resource/loader.js +80 -67
  128. package/esm/resource/loaders/image.js +71 -59
  129. package/esm/resource/loaders/remote.js +26 -15
  130. package/esm/resource/loaders/search.js +38 -25
  131. package/esm/resource/utils/parser.js +2 -1
  132. package/esm/runtime/Infographic.js +26 -13
  133. package/esm/runtime/utils.js +5 -8
  134. package/esm/ssr/renderer.js +42 -35
  135. package/esm/syntax/index.js +19 -6
  136. package/esm/syntax/mapper.js +2 -2
  137. package/esm/templates/built-in.js +96 -200
  138. package/esm/templates/hierarchy-mindmap.js +1 -5
  139. package/esm/templates/hierarchy-tree.js +1 -5
  140. package/esm/templates/relation-dagre-flow.js +4 -28
  141. package/esm/themes/generator.js +8 -14
  142. package/esm/utils/fetch.js +48 -35
  143. package/esm/utils/icon.js +1 -4
  144. package/esm/utils/is-browser.js +2 -2
  145. package/esm/utils/measure-text.js +2 -1
  146. package/esm/utils/padding.js +1 -1
  147. package/esm/utils/recognizer.js +2 -1
  148. package/esm/utils/text.js +14 -3
  149. package/esm/version.d.ts +1 -1
  150. package/esm/version.js +1 -1
  151. package/lib/designs/components/Btn.js +15 -4
  152. package/lib/designs/components/BtnsGroup.js +1 -1
  153. package/lib/designs/components/Illus.js +15 -3
  154. package/lib/designs/components/ItemDesc.js +17 -11
  155. package/lib/designs/components/ItemIcon.js +17 -18
  156. package/lib/designs/components/ItemLabel.js +17 -11
  157. package/lib/designs/components/ItemValue.js +17 -12
  158. package/lib/designs/components/ItemsGroup.js +1 -1
  159. package/lib/designs/components/ShapesGroup.js +1 -1
  160. package/lib/designs/components/Title.js +2 -2
  161. package/lib/designs/decorations/simple-arrow.js +14 -2
  162. package/lib/designs/decorations/triangle.js +14 -2
  163. package/lib/designs/defs/DropShadow.js +13 -2
  164. package/lib/designs/defs/LinearGradient.js +1 -1
  165. package/lib/designs/items/BadgeCard.js +2 -2
  166. package/lib/designs/items/CandyCardLite.js +1 -1
  167. package/lib/designs/items/CapsuleItem.js +3 -3
  168. package/lib/designs/items/CircleNode.js +1 -1
  169. package/lib/designs/items/CircularProgress.js +3 -2
  170. package/lib/designs/items/CompactCard.js +1 -1
  171. package/lib/designs/items/DoneList.js +1 -1
  172. package/lib/designs/items/HorizontalIconArrow.js +2 -2
  173. package/lib/designs/items/HorizontalIconLine.js +2 -2
  174. package/lib/designs/items/IconBadge.js +4 -3
  175. package/lib/designs/items/IndexedCard.js +1 -1
  176. package/lib/designs/items/LCornerCard.js +1 -1
  177. package/lib/designs/items/LetterCard.js +4 -3
  178. package/lib/designs/items/LinedText.js +6 -5
  179. package/lib/designs/items/PillBadge.js +2 -2
  180. package/lib/designs/items/PlainText.js +4 -4
  181. package/lib/designs/items/ProgressCard.js +4 -4
  182. package/lib/designs/items/QuarterCircular.js +1 -1
  183. package/lib/designs/items/QuarterSimpleCard.js +1 -1
  184. package/lib/designs/items/RibbonCard.js +2 -2
  185. package/lib/designs/items/RoundedRectNode.js +2 -2
  186. package/lib/designs/items/SimpleCircleNode.js +1 -1
  187. package/lib/designs/items/SimpleHorizontalArrow.js +2 -2
  188. package/lib/designs/items/SimpleIllusItem.js +1 -1
  189. package/lib/designs/items/SimpleItem.js +3 -3
  190. package/lib/designs/items/SimpleVerticalArrow.js +2 -2
  191. package/lib/designs/items/UnderlineText.js +1 -1
  192. package/lib/designs/items/VerticalIconArrow.js +2 -2
  193. package/lib/designs/layouts/Align.js +22 -15
  194. package/lib/designs/layouts/Flex.js +23 -16
  195. package/lib/designs/structures/chart-bar.js +7 -5
  196. package/lib/designs/structures/chart-column.js +3 -2
  197. package/lib/designs/structures/chart-line.js +7 -5
  198. package/lib/designs/structures/chart-pie.js +4 -3
  199. package/lib/designs/structures/chart-wordcloud.js +5 -14
  200. package/lib/designs/structures/compare-binary-horizontal/dividers/pros-cons-arrow.js +1 -1
  201. package/lib/designs/structures/compare-binary-horizontal/dividers/pros-cons-fold.js +1 -1
  202. package/lib/designs/structures/compare-binary-horizontal/dividers/types.js +2 -1
  203. package/lib/designs/structures/compare-hierarchy-left-right.js +6 -5
  204. package/lib/designs/structures/compare-hierarchy-row.js +3 -2
  205. package/lib/designs/structures/compare-quadrant.js +2 -3
  206. package/lib/designs/structures/hierarchy-mindmap.js +19 -19
  207. package/lib/designs/structures/hierarchy-structure.js +1 -1
  208. package/lib/designs/structures/hierarchy-tree.js +15 -24
  209. package/lib/designs/structures/list-sector.js +5 -6
  210. package/lib/designs/structures/list-zigzag.js +2 -1
  211. package/lib/designs/structures/relation-dagre-flow.js +30 -35
  212. package/lib/designs/structures/relation-network.js +2 -2
  213. package/lib/designs/structures/sequence-funnel.js +1 -1
  214. package/lib/designs/structures/sequence-mountain.js +4 -4
  215. package/lib/designs/structures/sequence-pyramid.js +1 -1
  216. package/lib/designs/structures/sequence-zigzag-steps.js +2 -1
  217. package/lib/designs/utils/color.js +8 -4
  218. package/lib/designs/utils/item.js +3 -2
  219. package/lib/editor/commands/Batch.js +21 -8
  220. package/lib/editor/commands/UpdateElement.js +25 -22
  221. package/lib/editor/commands/UpdateOptions.js +23 -10
  222. package/lib/editor/commands/UpdateText.js +24 -11
  223. package/lib/editor/interactions/brush-select.js +27 -13
  224. package/lib/editor/interactions/click-select.js +13 -3
  225. package/lib/editor/interactions/dblclick-edit-text.js +36 -20
  226. package/lib/editor/interactions/drag-element.js +23 -9
  227. package/lib/editor/interactions/hotkey-history.js +17 -7
  228. package/lib/editor/interactions/select-highlight.js +5 -9
  229. package/lib/editor/interactions/zoom-wheel.js +2 -1
  230. package/lib/editor/managers/command.js +43 -25
  231. package/lib/editor/managers/interaction.js +46 -33
  232. package/lib/editor/managers/state.js +1 -1
  233. package/lib/editor/plugins/edit-bar/components/color-picker.js +9 -6
  234. package/lib/editor/plugins/edit-bar/components/popover.js +15 -12
  235. package/lib/editor/plugins/edit-bar/components/select.js +10 -8
  236. package/lib/editor/plugins/edit-bar/edit-bar.js +7 -25
  237. package/lib/editor/plugins/edit-bar/edit-items/align-elements.js +5 -3
  238. package/lib/editor/plugins/edit-bar/edit-items/font-align.js +1 -1
  239. package/lib/editor/plugins/edit-bar/edit-items/font-color.js +2 -2
  240. package/lib/editor/plugins/edit-bar/edit-items/icon-color.js +2 -2
  241. package/lib/editor/plugins/resize-element.js +6 -4
  242. package/lib/editor/utils/click-handler.js +6 -3
  243. package/lib/editor/utils/coordinate.js +2 -1
  244. package/lib/editor/utils/element.js +2 -1
  245. package/lib/editor/utils/event.js +2 -1
  246. package/lib/editor/utils/extension.js +1 -1
  247. package/lib/editor/utils/hotkey.js +2 -1
  248. package/lib/exporter/font.js +106 -90
  249. package/lib/exporter/png.js +49 -37
  250. package/lib/exporter/svg.js +55 -38
  251. package/lib/jsx/components/Ellipse.js +5 -4
  252. package/lib/jsx/components/Path.js +2 -4
  253. package/lib/jsx/components/Polygon.js +15 -6
  254. package/lib/jsx/components/Text.js +21 -41
  255. package/lib/jsx/renderer.js +15 -7
  256. package/lib/jsx/utils/bounds.js +18 -16
  257. package/lib/jsx/utils/children.js +2 -1
  258. package/lib/jsx/utils/clone.js +13 -2
  259. package/lib/jsx/utils/element.js +2 -1
  260. package/lib/options/parser.js +45 -46
  261. package/lib/renderer/composites/background.js +3 -2
  262. package/lib/renderer/composites/icon.js +14 -19
  263. package/lib/renderer/composites/illus.js +17 -22
  264. package/lib/renderer/composites/shape.js +4 -2
  265. package/lib/renderer/composites/svg.js +2 -1
  266. package/lib/renderer/composites/text.js +5 -3
  267. package/lib/renderer/fonts/loader.js +4 -3
  268. package/lib/renderer/fonts/registry.js +1 -1
  269. package/lib/renderer/palettes/utils.js +3 -2
  270. package/lib/renderer/renderer.js +7 -5
  271. package/lib/renderer/stylize/gradient.js +3 -2
  272. package/lib/renderer/stylize/pattern.js +15 -8
  273. package/lib/renderer/stylize/rough.js +1 -1
  274. package/lib/resource/load-tracker.js +22 -10
  275. package/lib/resource/loader.js +80 -67
  276. package/lib/resource/loaders/image.js +71 -59
  277. package/lib/resource/loaders/remote.js +26 -15
  278. package/lib/resource/loaders/search.js +38 -25
  279. package/lib/resource/utils/parser.js +2 -1
  280. package/lib/runtime/Infographic.js +26 -13
  281. package/lib/runtime/utils.js +5 -8
  282. package/lib/ssr/renderer.js +42 -35
  283. package/lib/syntax/index.js +19 -6
  284. package/lib/syntax/mapper.js +2 -2
  285. package/lib/templates/built-in.js +96 -200
  286. package/lib/templates/hierarchy-mindmap.js +1 -5
  287. package/lib/templates/hierarchy-tree.js +1 -5
  288. package/lib/templates/relation-dagre-flow.js +4 -28
  289. package/lib/themes/generator.js +8 -14
  290. package/lib/utils/fetch.js +48 -35
  291. package/lib/utils/icon.js +1 -4
  292. package/lib/utils/is-browser.js +2 -2
  293. package/lib/utils/measure-text.js +2 -1
  294. package/lib/utils/padding.js +1 -1
  295. package/lib/utils/recognizer.js +2 -1
  296. package/lib/utils/text.js +14 -3
  297. package/lib/version.d.ts +1 -1
  298. package/lib/version.js +1 -1
  299. package/package.json +1 -1
  300. package/src/version.ts +1 -1
@@ -585,5 +585,5 @@ https://www.w3ctech.com/topic/2226`));let S=w(...$);return S.postcssPlugin=x,S.p
585
585
  unicode-range: ${s["unicode-range"]};
586
586
  }
587
587
  `.trim()).join(`
588
- `);const o=e.querySelector("defs");o&&o.parentNode?o.parentNode.insertBefore(i,o.nextSibling):e.insertBefore(i,e.firstChild)}function Pse(e){return Fi(this,null,function*(){const t=yield ga(e);if(!t.ok)throw new Error(`Failed to load font: ${e}`);const n=yield t.blob();return yield new Promise((i,o)=>{const s=new FileReader;s.onloadend=()=>{i(s.result)},s.onerror=o,s.readAsDataURL(n)})})}var ny=(e,t,n)=>new Promise((r,i)=>{var o=l=>{try{a(n.next(l))}catch(c){i(c)}},s=l=>{try{a(n.throw(l))}catch(c){i(c)}},a=l=>l.done?r(l.value):Promise.resolve(l.value).then(o,s);a((n=n.apply(e,t)).next())});function Ose(e){return ny(this,arguments,function*(t,n={}){const r=yield ry(t,n),i=new XMLSerializer().serializeToString(r);return"data:image/svg+xml;charset=utf-8,"+encodeURIComponent(i)})}function ry(e){return ny(this,arguments,function*(t,n={}){const{embedResources:r=!0,removeIds:i=!1}=n,o=t.cloneNode(!0),{width:s,height:a}=fh(t);return ut(o,{width:s,height:a}),i?(Ese(o),Dse(o)):yield Sse(o),yield vse(o,r),Bse(o),o})}function Sse(e){return ny(this,null,function*(){const t=e.querySelectorAll("use"),n=$se(e);t.forEach(r=>{const i=r.getAttribute("href");if(!i)return;if(!e.querySelector(i)){const s=document.querySelector(i);s&&n.appendChild(s.cloneNode(!0))}})})}const dE="icon-defs";function $se(e){const t=xi(e,dE);if(t)return t;const n=Me("defs");return xo(n,dE),e.prepend(n),n}function Ese(e){const t=Array.from(e.querySelectorAll("use"));t.length&&t.forEach(n=>{const r=Mse(n);if(!r||!r.startsWith("#"))return;const i=Ise(e,r);if(!i||i===n)return;const o=Ase(n,i);o&&n.replaceWith(o)})}function Mse(e){var t;return(t=e.getAttribute("href"))!=null?t:e.getAttribute("xlink:href")}function Ise(e,t){const n=e.querySelector(t);return n||document.querySelector(t)}function Ase(e,t){const n=t.tagName.toLowerCase();return n==="symbol"?Tse(e,t):n==="svg"?Rse(e,t):kse(e,t)}function Tse(e,t){const n=t.cloneNode(!0),r=Me("svg");for(hc(r,n,new Set(["id"])),hc(r,e,new Set(["href","xlink:href"]));n.firstChild;)r.appendChild(n.firstChild);return r}function Rse(e,t){const n=t.cloneNode(!0);return n.removeAttribute("id"),hc(n,e,new Set(["href","xlink:href"])),n}function kse(e,t){const n=t.cloneNode(!0);n.removeAttribute("id");const r=Me("g");hc(r,e,new Set(["href","xlink:href","x","y","width","height","transform"]));const i=Lse(e);return i&&r.setAttribute("transform",i),r.appendChild(n),r}function Lse(e){var t;const n=e.getAttribute("x"),r=e.getAttribute("y"),i=n||r?`translate(${n!=null?n:0} ${r!=null?r:0})`:"",o=(t=e.getAttribute("transform"))!=null?t:"";return i&&o?`${i} ${o}`:i||o||null}function hc(e,t,n=new Set){Array.from(t.attributes).forEach(r=>{if(!n.has(r.name)){if(r.name==="style"){Nse(e,r.value);return}if(r.name==="class"){zse(e,r.value);return}e.setAttribute(r.name,r.value)}})}function Nse(e,t){const n=e.getAttribute("style");if(!n){e.setAttribute("style",t);return}const r=n.trim().endsWith(";")?"":";";e.setAttribute("style",`${n}${r}${t}`)}function zse(e,t){const n=e.getAttribute("class");if(!n){e.setAttribute("class",t);return}e.setAttribute("class",`${n} ${t}`.trim())}const pE=/url\(\s*['"]?#([^'")\s]+)['"]?\s*\)/g;function Dse(e){const t=qse(e);if(t.size===0){mE(e);return}const n=Hse(e,t);n&&(wi(e,r=>{if(r.tagName.toLowerCase()==="defs")return!1;Array.from(r.attributes).forEach(o=>{const s=o.value;if(!s.includes("url("))return;const a=s.replace(pE,(l,c)=>{const u=encodeURIComponent(c);return`url("${n}#${u}")`});a!==s&&r.setAttribute(o.name,a)})}),mE(e))}function qse(e){const t=new Set;return wi(e,n=>{if(n.tagName.toLowerCase()==="defs")return!1;gE(n,r=>t.add(r))}),t}function gE(e,t){for(const n of Array.from(e.attributes)){const r=n.value;if(r.includes("url("))for(const i of r.matchAll(pE))i[1]&&t(i[1]);(n.name==="href"||n.name==="xlink:href")&&r[0]==="#"&&t(r.slice(1))}}function Hse(e,t){if(t.size===0)return null;const n=jse(e,t);if(n.size===0)return null;const r=Me("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"}),i=Me("defs");if(n.forEach(s=>{i.appendChild(s.cloneNode(!0))}),!i.children.length)return null;r.appendChild(i);const o=new XMLSerializer().serializeToString(r);return"data:image/svg+xml;charset=utf-8,"+encodeURIComponent(o)}function jse(e,t){const n=new Map,r=Array.from(t),i=new Set(r),o=new Set,s=a=>{o.has(a)||i.has(a)||(r.push(a),i.add(a))};for(;r.length;){const a=r.shift();if(o.has(a))continue;o.add(a);const l=`#${Fse(a)}`,c=e.querySelector(l);c&&(n.set(a,c),wi(c,u=>{gE(u,s)}))}return n}function Fse(e){return globalThis.CSS&&typeof globalThis.CSS.escape=="function"?globalThis.CSS.escape(e):e.replace(/([!"#$%&'()*+,./:;<=>?@[\]^`{|}~])/g,"\\$1")}function mE(e){Array.from(e.querySelectorAll("defs")).forEach(n=>n.remove())}function Bse(e){Wse(e),Vse(e),Gse(e),Yse(e)}function Wse(e){const t=xi(e,Ge.BtnsGroup);t==null||t.remove();const n=xi(e,"btn-icon-defs");n==null||n.remove()}function Vse(e){const t=e.querySelector("[data-element-type=transient-container]");t==null||t.remove()}function Gse(e){e.querySelectorAll("g").forEach(n=>{n.removeAttribute("x"),n.removeAttribute("y"),n.removeAttribute("width"),n.removeAttribute("height")})}function Yse(e){wi(e,t=>{for(const n in t.dataset)delete t.dataset[n]})}var Xse=(e,t,n)=>new Promise((r,i)=>{var o=l=>{try{a(n.next(l))}catch(c){i(c)}},s=l=>{try{a(n.throw(l))}catch(c){i(c)}},a=l=>l.done?r(l.value):Promise.resolve(l.value).then(o,s);a((n=n.apply(e,t)).next())});function Use(e){return Xse(this,arguments,function*(t,n={}){var r;const{dpr:i=(r=globalThis.devicePixelRatio)!=null?r:2}=n,o=yield ry(t),{width:s,height:a}=fh(o);return new Promise((l,c)=>{try{const u=document.createElement("canvas");u.width=s*i,u.height=a*i;const h=u.getContext("2d");if(!h){c(new Error("Failed to get canvas context"));return}h.scale(i,i),h.imageSmoothingEnabled=!0,h.imageSmoothingQuality="high",o.setAttribute("width",String(s)),o.setAttribute("height",String(a));const f=new XMLSerializer().serializeToString(o),d="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(f),p=new Image;p.onload=function(){h.clearRect(0,0,s,a),h.drawImage(p,0,0,s,a);const g=u.toDataURL("image/png");l(g)},p.onerror=function(g){c(new Error("Image load failed: "+g))},p.src=d}catch(u){c(u)}})})}var iy={exports:{}},yE;function Kse(){return yE||(yE=1,(function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function i(l,c,u){this.fn=l,this.context=c,this.once=u||!1}function o(l,c,u,h,f){if(typeof u!="function")throw new TypeError("The listener must be a function");var d=new i(u,h||l,f),p=n?n+c:c;return l._events[p]?l._events[p].fn?l._events[p]=[l._events[p],d]:l._events[p].push(d):(l._events[p]=d,l._eventsCount++),l}function s(l,c){--l._eventsCount===0?l._events=new r:delete l._events[c]}function a(){this._events=new r,this._eventsCount=0}a.prototype.eventNames=function(){var c=[],u,h;if(this._eventsCount===0)return c;for(h in u=this._events)t.call(u,h)&&c.push(n?h.slice(1):h);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(u)):c},a.prototype.listeners=function(c){var u=n?n+c:c,h=this._events[u];if(!h)return[];if(h.fn)return[h.fn];for(var f=0,d=h.length,p=new Array(d);f<d;f++)p[f]=h[f].fn;return p},a.prototype.listenerCount=function(c){var u=n?n+c:c,h=this._events[u];return h?h.fn?1:h.length:0},a.prototype.emit=function(c,u,h,f,d,p){var g=n?n+c:c;if(!this._events[g])return!1;var m=this._events[g],v=arguments.length,b,_;if(m.fn){switch(m.once&&this.removeListener(c,m.fn,void 0,!0),v){case 1:return m.fn.call(m.context),!0;case 2:return m.fn.call(m.context,u),!0;case 3:return m.fn.call(m.context,u,h),!0;case 4:return m.fn.call(m.context,u,h,f),!0;case 5:return m.fn.call(m.context,u,h,f,d),!0;case 6:return m.fn.call(m.context,u,h,f,d,p),!0}for(_=1,b=new Array(v-1);_<v;_++)b[_-1]=arguments[_];m.fn.apply(m.context,b)}else{var x=m.length,w;for(_=0;_<x;_++)switch(m[_].once&&this.removeListener(c,m[_].fn,void 0,!0),v){case 1:m[_].fn.call(m[_].context);break;case 2:m[_].fn.call(m[_].context,u);break;case 3:m[_].fn.call(m[_].context,u,h);break;case 4:m[_].fn.call(m[_].context,u,h,f);break;default:if(!b)for(w=1,b=new Array(v-1);w<v;w++)b[w-1]=arguments[w];m[_].fn.apply(m[_].context,b)}}return!0},a.prototype.on=function(c,u,h){return o(this,c,u,h,!1)},a.prototype.once=function(c,u,h){return o(this,c,u,h,!0)},a.prototype.removeListener=function(c,u,h,f){var d=n?n+c:c;if(!this._events[d])return this;if(!u)return s(this,d),this;var p=this._events[d];if(p.fn)p.fn===u&&(!f||p.once)&&(!h||p.context===h)&&s(this,d);else{for(var g=0,m=[],v=p.length;g<v;g++)(p[g].fn!==u||f&&!p[g].once||h&&p[g].context!==h)&&m.push(p[g]);m.length?this._events[d]=m.length===1?m[0]:m:s(this,d)}return this},a.prototype.removeAllListeners=function(c){var u;return c?(u=n?n+c:c,this._events[u]&&s(this,u)):(this._events=new r,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=n,a.EventEmitter=a,e.exports=a})(iy)),iy.exports}var Zse=Kse();const Qse=I$(Zse);var fc=(e,t,n)=>new Promise((r,i)=>{var o=l=>{try{a(n.next(l))}catch(c){i(c)}},s=l=>{try{a(n.throw(l))}catch(c){i(c)}},a=l=>l.done?r(l.value):Promise.resolve(l.value).then(o,s);a((n=n.apply(e,t)).next())});class Jse{constructor(){this.undoStack=[],this.redoStack=[]}init(t){Object.assign(this,t)}execute(t){return fc(this,null,function*(){yield t.apply(this.state),this.undoStack.push(t),this.redoStack=[],this.emitHistoryChange("execute")})}executeBatch(t){return fc(this,null,function*(){if(t.length===0)return;const n=new Aie(t);yield this.execute(n)})}undo(){return fc(this,null,function*(){const t=this.undoStack.pop();t&&(yield t.undo(this.state),this.redoStack.push(t),this.emitHistoryChange("undo"))})}redo(){return fc(this,null,function*(){const t=this.redoStack.pop();t&&(yield t.apply(this.state),this.undoStack.push(t),this.emitHistoryChange("redo"))})}serialize(){return this.undoStack.map(t=>t.serialize())}clear(){this.undoStack=[],this.redoStack=[]}canUndo(){return this.undoStack.length>0}canRedo(){return this.redoStack.length>0}getHistorySize(){return this.undoStack.length}destroy(){this.clear()}emitHistoryChange(t){var n;(n=this.emitter)==null||n.emit("history:change",{type:"history:change",action:t})}}var vE=(e,t,n)=>new Promise((r,i)=>{var o=l=>{try{a(n.next(l))}catch(c){i(c)}},s=l=>{try{a(n.throw(l))}catch(c){i(c)}},a=l=>l.done?r(l.value):Promise.resolve(l.value).then(o,s);a((n=n.apply(e,t)).next())});class eae{constructor(){this.extensions=new IS,this.interactions=[],this.active=!1,this.running=null,this.concurrentInteractions=new Set,this.selection=new Set,this.handleClick=t=>{const n=this.editor.getDocument(),r=t.target;if(!r){this.deactivate();return}n.contains(r)||cH(r)?this.activate():this.deactivate()}}init(t){Object.assign(this,t),document.addEventListener("click",this.handleClick),this.interactions.forEach(n=>{this.extensions.register(n.name,n),n.init({emitter:this.emitter,editor:this.editor,commander:this.commander,state:this.state,interaction:this}),this.emitter.emit("interaction:registered",n)})}isActive(){return this.active}select(t,n){const r=this.getSelection(),i=[],o=[];if(n==="replace"){const l=new Set(t);r.forEach(c=>{l.has(c)||o.push(c)}),t.forEach(c=>{this.selection.has(c)||i.push(c)}),this.selection=l}else n==="add"?t.forEach(l=>{this.selection.has(l)||(this.selection.add(l),i.push(l))}):n==="remove"?t.forEach(l=>{this.selection.delete(l)&&o.push(l)}):n==="toggle"&&t.forEach(l=>{this.selection.has(l)?(this.selection.delete(l),o.push(l)):(this.selection.add(l),i.push(l))});const s=this.getSelection(),a={type:"selection:change",previous:r,next:s,added:i,removed:o,mode:n};this.emitter.emit("selection:change",a)}getSelection(){return[...this.selection]}isSelected(t){return this.selection.has(t)}clearSelection(){const t=this.getSelection();this.selection.clear();const n={type:"selection:change",previous:t,next:[],added:[],removed:t,mode:"replace"};this.emitter.emit("selection:change",n)}activate(){this.active=!0,this.emitter.emit("activated")}deactivate(){this.active=!1,this.running=null,this.clearSelection(),this.emitter.emit("deactivated")}executeExclusiveInteraction(t,n){return vE(this,null,function*(){if(!(!this.active||this.running)){this.running=t;try{this.emitter.emit("interaction:started",t),yield n(),this.emitter.emit("interaction:ended",t)}catch(r){console.error(`Error occurred during exclusive interaction "${t.name}":`,r),this.emitter.emit("interaction:error",t,r)}finally{this.running=null}}})}executeConcurrentInteraction(t,n){return vE(this,null,function*(){if(this.active){this.concurrentInteractions.add(t);try{this.emitter.emit("interaction:started",t),yield n(),this.emitter.emit("interaction:ended",t)}catch(r){console.error(`Error occurred during concurrent interaction "${t.name}":`,r),this.emitter.emit("interaction:error",t,r)}finally{this.concurrentInteractions.delete(t)}}})}getOrCreateTransientContainer(){const t="transient-container",n=this.editor.getDocument(),r=xi(n,t);if(r&&r.isConnected)return r;const i=Me("g");return xo(i,t),n.appendChild(i),i}appendTransientElement(t){return this.getOrCreateTransientContainer().appendChild(t),t}destroy(){this.extensions.forEach(t=>{t.destroy(),this.emitter.emit("interaction:destroyed",t)}),this.extensions.destroy(),this.active=!1,this.running=null,this.clearSelection(),document.removeEventListener("click",this.handleClick),this.getOrCreateTransientContainer().remove()}}class tae{constructor(){this.extensions=new IS}init(t,n=[]){Object.assign(this,t),n.forEach(r=>{this.registerPlugin(r)})}getPlugin(t){return this.extensions.get(t)}getPlugins(){return this.extensions.getAll()}registerPlugin(t){this.extensions.register(t.name,t);const n={emitter:this.emitter,editor:this.editor,commander:this.commander,plugin:this,state:this.state};t.init(n),this.emitter.emit("plugin:registered",t)}unregisterPlugin(t){const n=this.extensions.get(t);n&&(n.destroy(),this.extensions.unregister(t),this.emitter.emit("plugin:unregistered",n))}destroy(){this.extensions.getAll().forEach(t=>{this.unregisterPlugin(t.name),this.emitter.emit("plugin:destroyed",t)}),this.extensions.destroy()}}var nae=Object.defineProperty,bE=Object.getOwnPropertySymbols,rae=Object.prototype.hasOwnProperty,iae=Object.prototype.propertyIsEnumerable,_E=(e,t,n)=>t in e?nae(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,wE=(e,t)=>{for(var n in t||(t={}))rae.call(t,n)&&_E(e,n,t[n]);if(bE)for(var n of bE(t))iae.call(t,n)&&_E(e,n,t[n]);return e};class oae{init(t){Object.assign(this,t)}addItemDatum(t,n){const r=t.slice(0,-1),i=t[t.length-1],o=Array.isArray(n)?n:[n];$S(this.options.data,r).splice(i,0,...o),this.emitter.emit("options:data:item:add",{indexes:t,datum:n}),this.emitter.emit("options:change",{type:"options:change",changes:[{op:"add",path:"data.items",indexes:t,value:o}]})}updateItemDatum(t,n){const r=uo(this.options.data,t);Object.assign(r,n),this.emitter.emit("options:data:item:update",{indexes:t,datum:n}),this.emitter.emit("options:change",{type:"options:change",changes:[{op:"update",path:"data.items",indexes:t,value:n}]})}removeItemDatum(t,n=1){const r=t.slice(0,-1),i=t[t.length-1],s=$S(this.options.data,r).splice(i,n);this.emitter.emit("options:data:item:remove",{indexes:t,datum:s}),this.emitter.emit("options:change",{type:"options:change",changes:[{op:"remove",path:"data.items",indexes:t,value:s}]})}updateData(t,n){this.options.data[t]=n,this.emitter.emit("options:data:update",{key:t,value:n}),this.emitter.emit("options:change",{type:"options:change",changes:[{op:"update",path:`data.${t}`,value:n}]})}updateElement(t,n){this.updateBuiltInElement(t,n)}updateOptions(t){this.options=wE(wE({},this.options),t),this.options.padding!==void 0&&z_(this.editor.getDocument(),Lr(this.options.padding)),this.emitter.emit("options:change",{type:"options:change",changes:[{op:"update",path:"",value:t}]})}getOptions(){return this.options}updateBuiltInElement(t,n){var r,i;const{data:o}=this.options,{attributes:s={}}=n,a=sh(t),l=fr(t)||Ge.ItemLabel===a||Ge.ItemDesc===a||Ge.ItemValue===a||Ge.ItemIllus===a,c=l?ES(t):void 0;if(l){const u=uo(o,c),h=a.replace("item-","");u.attributes||(u.attributes={}),(r=u.attributes)[h]||(r[h]={}),Object.assign(u.attributes[h],s)}else(Ge.Title===a||Ge.Desc===a||Ge.Illus===a)&&(o.attributes||(o.attributes={}),(i=o.attributes)[a]||(i[a]={}),Object.assign(o.attributes[a],s));this.emitter.emit("options:element:update",{element:t,props:n}),this.emitter.emit("options:change",{type:"options:change",changes:[{op:"update",role:a,indexes:c,path:l?`${_ie(c)}.attributes.${a.replace("item-","")}`:`data.attributes.${a}`,value:n}]})}destroy(){}}class sae{constructor(t,n,r){if(this.emitter=t,this.document=n,this.options=r,!n.isConnected)throw new Error("The provided document is not connected to the DOM.");n.style.userSelect="none";const i=new Jse,o=new oae,s=new tae,a=new eae;i.init({state:o,emitter:t}),o.init({emitter:t,editor:this,commander:i,options:r}),s.init({emitter:t,editor:this,commander:i,state:o},r.plugins),a.init({emitter:t,editor:this,commander:i,state:o,interactions:r.interactions}),this.commander=i,this.state=o,this.plugin=s,this.interaction=a}getDocument(){return this.document}destroy(){this.document.style.userSelect="",this.interaction.destroy(),this.plugin.destroy(),this.commander.destroy(),this.state.destroy()}}var aae=Object.defineProperty,lae=Object.defineProperties,cae=Object.getOwnPropertyDescriptors,dc=Object.getOwnPropertySymbols,xE=Object.prototype.hasOwnProperty,CE=Object.prototype.propertyIsEnumerable,PE=(e,t,n)=>t in e?aae(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,un=(e,t)=>{for(var n in t||(t={}))xE.call(t,n)&&PE(e,n,t[n]);if(dc)for(var n of dc(t))CE.call(t,n)&&PE(e,n,t[n]);return e},Bi=(e,t)=>lae(e,cae(t)),Wi=(e,t)=>{var n={};for(var r in e)xE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&dc)for(var r of dc(e))t.indexOf(r)<0&&CE.call(e,r)&&(n[r]=e[r]);return n};function uae(e){const t=e,{container:n="#container",padding:r=0,template:i,design:o,theme:s,themeConfig:a,data:l}=t,c=Wi(t,["container","padding","template","design","theme","themeConfig","data"]),u=typeof n=="string"?document.querySelector(n)||document.createElement("div"):n,h=i?Xi(i):void 0,f=cb({},h==null?void 0:h.themeConfig,a),d=s||a||h!=null&&h.themeConfig?gae(s,f):void 0,p={container:u,padding:Lr(r)};if(h){const m=h,{design:v}=m,b=Wi(m,["design"]);Object.assign(p,b)}Object.assign(p,c);const g=hae(l,e.template);if(g&&(p.data=g),i&&(p.template=i),h!=null&&h.design||o){const m=Bi(un({},d?Bi(un({},e),{themeConfig:d}):e),{data:g||l}),v=fae(un(un({},h==null?void 0:h.design),o),m);ub(v)&&(p.design=v)}return s&&(p.theme=s),d&&(p.themeConfig=d),p}function hae(e,t){if(!e)return;if(Array.isArray(e.items)&&e.items.length)return e;const{lists:n,sequences:r,compares:i,nodes:o,values:s,root:a}=e,l=()=>{if(!t)return null;const h={list:n,sequence:r,compare:i,relation:o,chart:s,hierarchy:a?[a]:[]},f=t.split("-")[0],d=h[f];return d!=null&&d.length?d:null},c=()=>{var h;return n!=null&&n.length?n:r!=null&&r.length?r:i!=null&&i.length?i:o!=null&&o.length?o:s!=null&&s.length?s:a?[a]:(h=e.items)!=null&&h.length?e.items:[]};let u=l()||c();return u===r&&e.order==="desc"&&(u=[...u].reverse()),Bi(un({},e),{items:u})}function oy(e){if(typeof e=="string")return{type:e};if(!("type"in e))throw new Error("Type is required");return e}function fae(e,t){const{structure:n,title:r,item:i,items:o}=e||{},s=OE(i||(o==null?void 0:o[0]),t);return{structure:dae(n),title:pae(r,t),item:s,items:o?o.map(a=>OE(a,t)):[s]}}function dae(e){if(!e)return null;const t=oy(e),{type:n}=t,r=Wi(t,["type"]),i=F4(n);if(!i)return null;const{component:o}=i;return Bi(un({},i),{component:s=>o(un(un({},s),r))})}function pae(e,t){if(!e)return{component:null};const n=oy(e),{type:r}=n,i=Wi(n,["type"]),{themeConfig:o}=t,s=(o==null?void 0:o.colorBg)||"#fff",a=SE(s,s);return{component:l=>Ww(un(Bi(un({},l),{themeColors:a}),i))}}function OE(e,t){if(!e)return null;const n=oy(e),{type:r}=n,i=Wi(n,["type"]),o=Jw(r);if(!o)return null;const{component:s,options:a}=o;return Bi(un({},o),{component:l=>{var c;const{indexes:u}=l,{data:h,themeConfig:f}=t,d=(f==null?void 0:f.colorBg)||"#fff",p=l,{themeColors:g=SE(Vs(f==null?void 0:f.palette,u,(c=h==null?void 0:h.items)==null?void 0:c.length)||(f==null?void 0:f.colorPrimary)||"#FF356A",d)}=p,m=Wi(p,["themeColors"]);return s(un(un({themeColors:g},m),i))},options:a})}function gae(e,t={}){var n;const r=e?Vw(e)||{}:{},i=cb({},r,t);return i.palette=t.palette||r.palette,i.stylize=(n=t.stylize)!=null?n:r.stylize,i.colorPrimary||(i.colorPrimary="#FF356A"),i.palette||(i.palette=[i.colorPrimary]),i}function SE(e,t="#fff"){return Xw({colorPrimary:e,isDarkMode:H2(t),colorBg:t})}function mae(e){return e===" "||e===" "}function yae(e){let t=0,n=0;for(;n<e.length;){const r=e[n];if(r===" "){t+=1,n+=1;continue}if(r===" "){t+=2,n+=1;continue}break}return{indent:t,content:e.slice(n)}}function vae(e){return e.trimEnd()}function bae(e){return/[<>=o.x-]{2,}/.test(e)}function $E(e){const t=e.trim();if(!t)return null;const n=t.match(/^([^:\s=]+)\s*[:=]\s*(.*)$/);if(n)return{key:n[1],value:n[2].trim()};const r=t.match(/^([^\s]+)\s+(.*)$/);return r?{key:r[1],value:r[2].trim()}:{key:t,value:void 0}}function pc(e,t){return{kind:"object",line:e,value:t,entries:{}}}function EE(e){return{kind:"array",line:e,items:[]}}function _ae(e){const t=[],n=pc(0),r=[{indent:-1,node:n,parent:null,key:null}];return e.split(/\r?\n/).forEach((o,s)=>{const a=s+1;if(!o.trim())return;const{indent:l,content:c}=yae(o),u=vae(c);if(!u.trim())return;for(;r.length>1&&l<=r[r.length-1].indent;)r.pop();const h=r[r.length-1];let f=h.node;const d=u.trim();if(d.startsWith("-")&&(d.length===1||mae(d[1]))){if(f.kind!=="array")if(f.kind==="object"&&Object.keys(f.entries).length===0&&f.value===void 0&&h.parent&&h.key){const b=EE(f.line);if(h.parent.kind==="object")h.parent.entries[h.key]=b;else if(h.parent.kind==="array"){const _=h.parent.items.indexOf(f);_>=0&&(h.parent.items[_]=b)}h.node=b,f=b}else{t.push({path:"",line:a,code:"bad_list",message:"List item is not under an array container.",raw:d});return}const m=d.slice(1).trim(),v=pc(a,m||void 0);f.items.push(v),r.push({indent:l,node:v,parent:f});return}if(h.key==="relations"&&!d.startsWith("-")&&bae(d)){if(f.kind!=="array")if(f.kind==="object"&&Object.keys(f.entries).length===0&&f.value===void 0&&h.parent&&h.key){const v=EE(f.line);if(h.parent.kind==="object")h.parent.entries[h.key]=v;else if(h.parent.kind==="array"){const b=h.parent.items.indexOf(f);b>=0&&(h.parent.items[b]=v)}h.node=v,f=v}else{t.push({path:"",line:a,code:"bad_list",message:"List item is not under an array container.",raw:d});return}const m=pc(a,d);f.items.push(m),r.push({indent:l,node:m,parent:f});return}const p=$E(d);if(!p){t.push({path:"",line:a,code:"bad_syntax",message:"Invalid syntax line.",raw:d});return}if(f.kind!=="object"){t.push({path:"",line:a,code:"bad_syntax",message:"Key-value pair is not under an object container.",raw:d});return}const g=pc(a,p.value);f.entries[p.key]=g,r.push({indent:l,node:g,parent:f,key:p.key})}),{ast:n,errors:t}}function ME(e){return $E(e)}function gc(e,t){return{kind:"value",line:t,value:e}}const wae=/^(#[0-9a-f]{8}|#[0-9a-f]{6}|#[0-9a-f]{4}|#[0-9a-f]{3})/i,xae=/^((?:rgb|rgba|hsl|hsla)\([^)]*\))/i;function ni(e){const t=e.trim();return t==="true"?!0:t==="false"?!1:/^-?\d+(\.\d+)?$/.test(t)?parseFloat(t):t}function ri(e){if(e.kind==="value"||e.kind==="object")return e.value}function Ht(e,t,n,r,i,o){e.push({path:n,line:t.line,code:r,message:i,raw:o})}function IE(e,t="any"){let n=e.trim();if(n.startsWith("[")&&n.endsWith("]")&&(n=n.slice(1,-1).trim()),!n)return[];let r;t==="comma"?r=n.split(","):t==="space"?r=n.split(/\s+/):r=n.split(/[,\s]+/);const i=[];for(const o of r){const s=o.trim();if(s){if(s==="#"||s==="//")break;i.push(s)}}return i}function Cae(e){let t=e.trim();const n=t.search(/\s+#(?![0-9a-f])/i);n>=0&&(t=t.slice(0,n).trimEnd());const r=t.indexOf("//");return r>=0&&(t=t.slice(0,r).trimEnd()),t}function sy(e){const t=Cae(e);if(!t)return;const n=t.match(wae);if(n&&n[0].length===t.length)return t;const r=t.match(xae);if(r&&r[1].length===t.length||be(t).isValid())return t}function AE(e,t,n,r={}){const i=ri(e);if(i===void 0){Ht(n,e,t,"schema_mismatch","Expected color value.");return}const o=sy(i);if(!o){r.soft||Ht(n,e,t,"invalid_value","Invalid color value.",i);return}return o}function Pae(e,t){return t.length>1||e.startsWith("[")&&e.endsWith("]")?!0:sy(e)!==void 0}function ay(e){if(e.kind==="array")return e.items.map(r=>ay(r));if(e.kind==="value"||!(Object.keys(e.entries).length>0)&&e.value!==void 0)return ni(e.value);const n={};return e.value!==void 0&&(n.value=ni(e.value)),Object.entries(e.entries).forEach(([r,i])=>{n[r]=ay(i)}),n}function Oae(e,t,n,r){let i,o=null;for(const s of t.variants){const a=[],l=sn(e,s,n,a);(o===null||a.length<o.length)&&(o=a,i=l)}return o&&r.push(...o),i}function sn(e,t,n,r){switch(t.kind){case"union":return Oae(e,t,n,r);case"string":{const i=ri(e);if(i===void 0){Ht(r,e,n,"schema_mismatch","Expected string value.");return}return i}case"number":{const i=ri(e);if(i===void 0){Ht(r,e,n,"schema_mismatch","Expected number value.");return}const s=i.trim().match(/^(-?\d+(\.\d+)?)(?:\s*(#|\/\/).*)?$/);if(!s){Ht(r,e,n,"invalid_value","Invalid number value.",i);return}return parseFloat(s[1])}case"boolean":{const i=ri(e);if(i===void 0){Ht(r,e,n,"schema_mismatch","Expected boolean value.");return}if(i!=="true"&&i!=="false"){Ht(r,e,n,"invalid_value","Invalid boolean value.",i);return}return i==="true"}case"enum":{const i=ri(e);if(i===void 0){Ht(r,e,n,"schema_mismatch","Expected enum value.");return}if(!t.values.includes(i)){Ht(r,e,n,"invalid_value","Invalid enum value.",i);return}return i}case"array":{if(e.kind==="array")return e.items.map((a,l)=>sn(a,t.item,`${n}[${l}]`,r)).filter(a=>a!==void 0);if(e.kind==="object"&&Object.keys(e.entries).length>0){Ht(r,e,n,"schema_mismatch","Expected array value.");return}const i=ri(e);if(i===void 0){Ht(r,e,n,"schema_mismatch","Expected array value.");return}const o=i.trim();return o.startsWith("[")&&!o.endsWith("]")?void 0:IE(i,t.split).map((a,l)=>sn(gc(a,e.line),t.item,`${n}[${l}]`,r)).filter(a=>a!==void 0)}case"palette":{if(e.kind==="array"){const l=sn(e,{kind:"array",item:{kind:"color"},split:"any"},n,r);return Array.isArray(l)&&l.length>0?l:void 0}if(e.kind==="object"&&Object.keys(e.entries).length>0){Ht(r,e,n,"schema_mismatch","Expected palette value.");return}const i=ri(e);if(i===void 0){Ht(r,e,n,"schema_mismatch","Expected palette value.");return}const o=i.trim();if(o.startsWith("[")&&!o.endsWith("]"))return;const s=sy(o);if(s)return[s];const a=IE(i,"any");if(Pae(o,a)){const l=a.map((c,u)=>AE(gc(c,e.line),`${n}[${u}]`,r)).filter(c=>c!==void 0);return l.length>0?l:void 0}return i}case"color":return AE(e,n,r,{soft:t.soft});case"object":{if(e.kind==="array"){Ht(r,e,n,"schema_mismatch","Expected object value.");return}const i={};if(e.kind==="value"){if(t.shorthandKey)return i[t.shorthandKey]=e.value,i;const o=ME(e.value);if((o==null?void 0:o.value)!==void 0){if(t.fields[o.key]){const s=sn(gc(o.value,e.line),t.fields[o.key],`${n}.${o.key}`,r);return s!==void 0&&(i[o.key]=s),i}return t.allowUnknown?(i[o.key]=ni(o.value),i):(Ht(r,e,`${n}.${o.key}`,"unknown_key","Unknown key in object.",o.key),i)}if(t.allowUnknown)return i.value=ni(e.value),i;Ht(r,e,n,"invalid_value","Expected object value.");return}if(e.value!==void 0)if(t.shorthandKey&&i[t.shorthandKey]===void 0)i[t.shorthandKey]=e.value;else{const o=ME(e.value);if((o==null?void 0:o.value)!==void 0)if(t.fields[o.key]){const s=sn(gc(o.value,e.line),t.fields[o.key],`${n}.${o.key}`,r);s!==void 0&&i[o.key]===void 0&&(i[o.key]=s)}else t.allowUnknown?i[o.key]=ni(o.value):Ht(r,e,`${n}.${o.key}`,"unknown_key","Unknown key in object.",o.key);else t.allowUnknown&&(i.value=ni(e.value))}return Object.entries(e.entries).forEach(([o,s])=>{const a=t.fields[o];if(!a){if(t.allowUnknown){i[o]=ay(s);return}Ht(r,s,`${n}.${o}`,"unknown_key","Unknown key in object.",o);return}const l=sn(s,a,`${n}.${o}`,r);l!==void 0&&(i[o]=l)}),i}default:return}}const Lt=()=>({kind:"string"}),br=()=>({kind:"number"}),cs=e=>({kind:"enum",values:e}),Vi=(e={})=>({kind:"color",soft:e.soft}),er=(e,t="any")=>({kind:"array",item:e,split:t}),Bt=(e,t={})=>({kind:"object",fields:e,allowUnknown:t.allowUnknown,shorthandKey:t.shorthandKey}),us=(...e)=>({kind:"union",variants:e}),Sae=()=>({kind:"palette"}),hs=()=>Bt({},{allowUnknown:!0}),TE={fill:Vi({soft:!0}),stroke:Vi({soft:!0})},Gi=Bt(TE,{allowUnknown:!0}),ly=Bt(TE,{allowUnknown:!0}),tr=Bt({},{allowUnknown:!0});tr.fields={id:Lt(),label:Lt(),value:us(br(),Lt()),desc:Lt(),icon:us(Lt(),hs()),illus:us(Lt(),hs()),attributes:hs(),group:Lt(),category:Lt(),children:er(tr)};const RE=Bt({id:Lt(),from:Lt(),to:Lt(),label:Lt(),direction:cs(["forward","both","none"]),showArrow:cs(["true","false"]),arrowType:cs(["arrow","triangle","diamond"])},{allowUnknown:!0}),kE=Bt({type:Lt(),colorBg:Vi(),colorPrimary:Vi(),palette:Sae(),title:Gi,desc:Gi,shape:ly,base:Bt({global:Bt({},{allowUnknown:!0}),shape:ly,text:Gi}),item:Bt({icon:Bt({},{allowUnknown:!0}),label:Gi,desc:Gi,value:Gi,shape:ly}),stylize:Bt({type:cs(["rough","pattern"]),roughness:br(),bowing:br(),fillWeight:br(),hachureGap:br(),pattern:Lt(),backgroundColor:Vi(),foregroundColor:Vi(),scale:br()},{shorthandKey:"type"}),elements:Bt({},{allowUnknown:!0})},{shorthandKey:"type"}),mc=Bt({},{allowUnknown:!0,shorthandKey:"type"}),LE=Bt({structure:mc,item:mc,items:er(mc),title:mc}),NE=Bt({title:Lt(),desc:Lt(),items:er(tr),lists:er(tr),sequences:er(tr),root:tr,compares:er(tr),nodes:er(tr),relations:er(RE),values:er(tr),order:cs(["asc","desc"]),illus:hs(),attributes:hs()}),zE=Bt({type:Lt()},{shorthandKey:"type"}),DE=Bt({template:zE,design:LE,data:NE,theme:kE,width:us(br(),Lt()),height:us(br(),Lt())}),qE=/[<>=o.x-]{2,}/,yc=/[<>=o.x-]{2,}/g;function vc(e){let t=e.trim();if(!t)return"";const n=t[0],r=t[t.length-1];return(n==='"'&&r==='"'||n==="'"&&r==="'")&&(t=t.slice(1,-1)),t=t.replace(/\\(["'])/g,"$1").replace(/(&quot;|&#quot;|#quot;)/g,'"').replace(/(&apos;|&#39;|#apos;)/g,"'"),t.trim()}function $ae(e){const t=e.trim().replace(/^[-=.ox]+/,"").trim();return vc(t)}function bc(e,t){let n=t;for(;n<e.length&&/\s/.test(e[n]);)n+=1;return n}function HE(e,t){let n=bc(e,t);if(n>=e.length)return null;const r=n;for(;n<e.length;){const s=e[n];if(/\s/.test(s)||s==="["||s==="("||s==="@"||s==="|"||s==="<"||s===">"||s==="-"&&(e[n+1]==="-"||e[n+1]===">"||e[n+1]==="<"))break;n+=1}if(n===r)return null;const i=e.slice(r,n).trim();if(!i)return null;if(e.startsWith("@{",n)){const s=e.indexOf("}",n+2);s!==-1&&(n=s+1)}n=bc(e,n);let o;if(e[n]==="["){const s=e.indexOf("]",n+1);s!==-1&&(o=vc(e.slice(n+1,s)),n=s+1)}else if(e[n]==="("){const s=e.indexOf(")",n+1);if(s!==-1){let a=e.slice(n+1,s).trim();a.startsWith("[")&&a.endsWith("]")&&(a=a.slice(1,-1).trim()),o=vc(a),n=s+1}}return{node:{id:i,label:o},nextIndex:n}}function Eae(e,t){yc.lastIndex=t;const n=yc.exec(e);if(!n)return null;const r=n[0],i=n.index,o=i+r.length;let a=$ae(e.slice(t,i))||void 0,l=r,c=o;if(c=bc(e,c),e[c]==="|"){const v=e.indexOf("|",c+1);if(v!==-1){a=vc(e.slice(c+1,v))||a,c=v+1;const _=bc(e,c);yc.lastIndex=_;const x=yc.exec(e);x&&x.index===_?(l+=x[0],c=x.index+x[0].length):c=_}}const u=l.includes("<"),h=l.includes(">"),f=l.match(/[xo]/gi)||[],d=/^[xo]/i.test(l),p=/[xo]$/i.test(l);let g="none",m=!1;return u&&h||u&&p||h&&d||d&&p?g="both":(u||h||f.length>0)&&(g="forward",m=u&&!h),{label:a,direction:g,reverse:m,nextIndex:c}}function Mae(e){const t=[],n=[],r=new Map;let i=0;const o=HE(e,i);if(!o)return{relations:t,nodes:n};let s=o.node;for(r.has(s.id)||(r.set(s.id,s),n.push(s)),i=o.nextIndex;i<e.length;){const a=Eae(e,i);if(!a)break;i=a.nextIndex;const l=HE(e,i);if(!l)break;i=l.nextIndex;let c=s.id,u=l.node.id;const h=a.direction;a.reverse&&(c=l.node.id,u=s.id);const f={from:c,to:u};a.label&&(f.label=a.label),h==="both"&&(f.direction="both"),h==="none"&&(f.direction="none"),t.push(f),r.has(s.id)||(r.set(s.id,s),n.push(s)),r.has(l.node.id)||(r.set(l.node.id,l.node),n.push(l.node)),s=l.node}return{relations:t,nodes:n}}function Iae(e,t,n,r){if(!n)return;const i=e.get(n);if(i){!i.label&&r&&(i.label=r);return}const o={id:n,label:r||n};e.set(n,o),t.push(o)}function Aae(e,t,n){const r=sn(e,RE,t,n);return!r||typeof r!="object"||typeof r.from!="string"||typeof r.to!="string"?null:r}function Tae(e,t,n){const r=[],i=[],o=new Map,s=a=>{if(!qE.test(a))return;const l=Mae(a);l.nodes.forEach(c=>{Iae(o,i,c.id,c.label)}),r.push(...l.relations)};return e.kind==="array"?e.items.forEach((a,l)=>{if(a.kind==="object"&&a.value&&Object.keys(a.entries).length===0&&qE.test(a.value)){s(a.value);return}const c=Aae(a,`${n}[${l}]`,t);c&&r.push(c)}):e.kind==="object"&&e.value&&s(e.value),{relations:r,items:i}}var Rae=Object.defineProperty,kae=Object.defineProperties,Lae=Object.getOwnPropertyDescriptors,_c=Object.getOwnPropertySymbols,jE=Object.prototype.hasOwnProperty,FE=Object.prototype.propertyIsEnumerable,BE=(e,t,n)=>t in e?Rae(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,WE=(e,t)=>{for(var n in t||(t={}))jE.call(t,n)&&BE(e,n,t[n]);if(_c)for(var n of _c(t))FE.call(t,n)&&BE(e,n,t[n]);return e},Nae=(e,t)=>kae(e,Lae(t)),VE=(e,t)=>{var n={};for(var r in e)jE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&_c)for(var r of _c(e))t.indexOf(r)<0&&FE.call(e,r)&&(n[r]=e[r]);return n};function zae(e){var t;const n=new Set,r=[];for(let i=e.length-1;i>=0;i-=1){const o=e[i],s=(t=o.id)!=null?t:o.label;if(!s){r.push(o);continue}n.has(s)||(n.add(s),o.id||(o.id=s),r.push(o))}return r.reverse()}function Dae(e,t){if(!e)return;const n=sn(e,zE,"template",t);if(n){if(typeof n=="string")return n;if(typeof n=="object"&&typeof n.type=="string")return n.type}}function GE(e){var t;const{ast:n,errors:r}=_ae(e),i=[],o={},s=WE({},n.entries),a=n.entries.infographic;let l;a&&a.kind==="object"&&(a.value&&(l=a.value),Object.entries(a.entries).forEach(([v,b])=>{v in s||(s[v]=b)}));const c=new Set(["infographic","template","design","data","theme","width","height"]);Object.keys(s).forEach(v=>{c.has(v)||r.push({path:v,line:s[v].line,code:"unknown_key",message:"Unknown top-level key.",raw:v})});const u=s.template,h=Dae(u,r);h&&(o.template=h),!o.template&&l&&(o.template=l);const f=s.design;if(f){const v=sn(f,LE,"design",r);v&&(o.design=v)}const d=s.data;if(d){let v,b=d;if(d.kind==="object"){const x=d.entries,{relations:w}=x,C=VE(x,["relations"]);v=w,b=Nae(WE({},d),{entries:C})}const _=sn(b,NE,"data",r);if(_&&(o.data=_),v){const x=Tae(v,r,"data.relations");if(x.relations.length>0||x.items.length>0){const w=(t=o.data)!=null?t:{},C=Array.isArray(w.items)?w.items:[],P=zae(C),O=new Map;P.forEach($=>{$.id&&O.set($.id,$)}),x.items.forEach($=>{const S=O.get($.id);S?!S.label&&$.label&&(S.label=$.label):(P.push($),O.set($.id,$))}),w.items=P,w.relations=x.relations,o.data=w}}}const p=s.theme;if(p){const v=sn(p,kE,"theme",r);if(v&&typeof v=="object"){const b=v,{type:_}=b,x=VE(b,["type"]);typeof _=="string"&&_&&(o.theme=_),Object.keys(x).length>0&&(o.themeConfig=x)}}const g=s.width;if(g){const v=sn(g,DE.fields.width,"width",r);v!==void 0&&(o.width=v)}const m=s.height;if(m){const v=sn(m,DE.fields.height,"height",r);v!==void 0&&(o.height=v)}return{options:o,errors:r,warnings:i,ast:n}}const qae=()=>[new O$,new M$],Hae=()=>[new VS,new AS,new TS,new GS,new XS,new JS,new ZS],jae={padding:20,theme:"light",themeConfig:{palette:"antv"},get plugins(){return qae()},get interactions(){return Hae()}};var Fae=Object.defineProperty,YE=Object.getOwnPropertySymbols,Bae=Object.prototype.hasOwnProperty,Wae=Object.prototype.propertyIsEnumerable,XE=(e,t,n)=>t in e?Fae(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,nr=(e,t)=>{for(var n in t||(t={}))Bae.call(t,n)&&XE(e,n,t[n]);if(YE)for(var n of YE(t))Wae.call(t,n)&&XE(e,n,t[n]);return e};function cy(e,t){const n=nr(nr({},e),t);return(e.design||t.design)&&(n.design=nr(nr({},e.design),t.design)),(e.themeConfig||t.themeConfig)&&(n.themeConfig=nr(nr({},e.themeConfig),t.themeConfig)),(e.svg||t.svg)&&(n.svg=nr(nr({},e.svg),t.svg)),n}function uy(e){const t=nr({},e);return t.data&&(t.data=ab(t.data)),t.elements&&(t.elements=ab(t.elements)),t}function UE(e){const{design:t,data:n}=e;return!(!t||!ub(t)||!n||!Array.isArray(n.items)||n.items.length<1)}var Vae=Object.defineProperty,KE=Object.getOwnPropertySymbols,Gae=Object.prototype.hasOwnProperty,Yae=Object.prototype.propertyIsEnumerable,ZE=(e,t,n)=>t in e?Vae(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Xae=(e,t)=>{for(var n in t||(t={}))Gae.call(t,n)&&ZE(e,n,t[n]);if(KE)for(var n of KE(t))Yae.call(t,n)&&ZE(e,n,t[n]);return e},Uae=(e,t,n)=>new Promise((r,i)=>{var o=l=>{try{a(n.next(l))}catch(c){i(c)}},s=l=>{try{a(n.throw(l))}catch(c){i(c)}},a=l=>l.done?r(l.value):Promise.resolve(l.value).then(o,s);a((n=n.apply(e,t)).next())});class Kae{constructor(t){this.rendered=!1,this.emitter=new Qse,this.node=null,this.initialOptions={},this.setOptions(t,"replace",!0)}getOptions(){return this.options}setOptions(t,n="replace",r=!1){const{options:i,errors:o,warnings:s}=Zae(t);r&&(this.initialOptions=i);const a=cy(n==="replace"?uy(this.initialOptions||{}):this.options||uy(this.initialOptions||{}),i);this.options=a,this.parsedOptions=uae(cy(jae,this.options)),s.length&&this.emitter.emit("warning",s),o.length&&this.emitter.emit("error",o)}render(t){t?this.setOptions(t,"replace"):!this.options&&this.initialOptions&&this.setOptions(this.initialOptions,"replace"),this.performRender()}update(t){this.setOptions(t,"merge"),this.performRender()}performRender(){var t;const n=this.parsedOptions;if(!UE(n)){this.emitter.emit("error",new Error("Incomplete options"));return}const{container:r}=this.parsedOptions,i=this.compose(n),o=new $q(n,i);this.node=o.render(),r==null||r.replaceChildren(this.node),(t=this.editor)==null||t.destroy(),this.editor=void 0,this.options.editable&&(this.editor=new sae(this.emitter,this.node,n)),this.rendered=!0,this.emitter.emit("rendered",{node:this.node,options:this.options});const s=this.node;return s&&gz(s).then(()=>{this.node===s&&this.emitter.emit("loaded",{node:s,options:this.options})}),!0}compose(t){const{design:n,data:r}=t,{title:i,item:o,items:s,structure:a}=n,{component:l,props:c}=a,u=i.component,h=o.component,f=s.map(g=>g.component),d=tw(y(l,Xae({data:r,Title:u,Item:h,Items:f,options:t},c))),p=_i(d);if(!p)throw new Error("Failed to parse SVG template");return p}getTypes(){const t=this.parsedOptions;if(!UE(t)){this.emitter.emit("error",new Error("Incomplete options"));return}const n=t.design,r=n.structure.composites||[],i=n.items.map(o=>o.composites||[]);return pH({structure:r,items:i})}toDataURL(t){return Uae(this,null,function*(){if(!this.node)throw new Error("Infographic is not rendered yet.");return(t==null?void 0:t.type)==="svg"?yield Ose(this.node,t):yield Use(this.node,t)})}on(t,n){this.emitter.on(t,n)}off(t,n){this.emitter.off(t,n)}destroy(){var t,n;(t=this.editor)==null||t.destroy(),(n=this.node)==null||n.remove(),this.node=null,this.rendered=!1,this.emitter.emit("destroyed"),this.emitter.removeAllListeners()}}function Zae(e){if(typeof e=="string"){const{options:t,errors:n,warnings:r}=GE(e);return{options:t,errors:n,warnings:r}}return{options:uy(e),errors:[],warnings:[]}}const Qae="0.2.11";W.AlignLayout=Pi,W.BadgeCard=n3,W.BrushSelect=AS,W.BtnAdd=Q,W.BtnRemove=nt,W.BtnsGroup=qe,W.CandyCardLite=o3,W.CapsuleItem=d3,W.ChartBar=B4,W.ChartColumn=W4,W.ChartLine=X4,W.ChartPie=U4,W.ChartWordCloud=t5,W.CircleNode=m3,W.CircularProgress=b3,W.ClickSelect=TS,W.CompactCard=C3,W.CompareBinaryHorizontal=h5,W.CompareHierarchyLeftRight=g5,W.CompareHierarchyRow=m5,W.DblClickEditText=VS,W.Defs=Ke,W.DoneList=S3,W.DragElement=GS,W.EditBar=O$,W.Ellipse=Ze,W.FlexLayout=ve,W.Fragment=Co,W.Gap=yt,W.Group=Y,W.HierarchyMindmap=$5,W.HierarchyStructure=M5,W.HierarchyTree=R5,W.HorizontalIconArrow=M3,W.HorizontalIconLine=k3,W.HotkeyHistory=XS,W.IconBadge=z3,W.Illus=fw,W.IndexedCard=H3,W.Infographic=Kae,W.Interaction=yr,W.ItemDesc=ft,W.ItemIcon=Ft,W.ItemIconCircle=zr,W.ItemLabel=Ve,W.ItemValue=Mo,W.ItemsGroup=ze,W.LCornerCard=B3,W.LabelText=tx,W.LetterCard=G3,W.LinedText=U3,W.ListColumn=k5,W.ListGrid=L5,W.ListPyramid=N5,W.ListRow=z5,W.ListSector=H5,W.ListWaterfall=j5,W.ListZigzagDown=G5,W.ListZigzagUp=Y5,W.Path=Ce,W.PillBadge=Q3,W.Plugin=pm,W.Polygon=Yt,W.ProgressCard=l4,W.Quadrant=y5,W.QuarterCircular=h4,W.QuarterSimpleCard=p4,W.Rect=ke,W.RelationCircle=X5,W.RelationDagreFlow=NO,W.RelationNetwork=zO,W.ResizeElement=M$,W.RibbonCard=y4,W.RoundedRectNode=_4,W.SelectHighlight=ZS,W.SequenceAscendingStairs3d=YO,W.SequenceAscendingSteps=XO,W.SequenceCircleArrows=KO,W.SequenceCircular=ZO,W.SequenceColorSnakeSteps=QO,W.SequenceFilterMesh=nS,W.SequenceFunnel=sS,W.SequenceHorizontalZigzag=aS,W.SequenceMountain=uS,W.SequencePyramid=hS,W.SequenceRoadmapVertical=dS,W.SequenceSnakeSteps=pS,W.SequenceStairsFront=gS,W.SequenceSteps=mS,W.SequenceTimeline=yS,W.SequenceZigzagPucks3d=bS,W.SequenceZigzagSteps=OS,W.ShapesGroup=Pt,W.SimpleCircleNode=C4,W.SimpleHorizontalArrow=S4,W.SimpleIllusItem=M4,W.SimpleItem=T4,W.SimpleVerticalArrow=L4,W.Text=Ne,W.Title=Ww,W.UnderlineText=D4,W.VERSION=Qae,W.VerticalIconArrow=j4,W.ZoomWheel=JS,W.cloneElement=dr,W.createFragment=RH,W.createLayout=vh,W.exportToSVG=ry,W.getCombinedBounds=Ci,W.getElementBounds=ae,W.getElementsBounds=Nr,W.getFont=Lu,W.getFonts=Nu,W.getItem=Jw,W.getItemProps=lt,W.getItems=oF,W.getPalette=Cb,W.getPaletteColor=Vs,W.getPalettes=Sz,W.getStructure=F4,W.getStructures=pZ,W.getTemplate=Xi,W.getTemplates=Cc,W.getTheme=Vw,W.getThemeColors=Et,W.getThemes=Fj,W.jsx=va,W.jsxDEV=LH,W.jsxs=kH,W.loadSVGResource=vi,W.parseSVG=_i,W.parseSyntax=GE,W.registerFont=_b,W.registerItem=ct,W.registerPalette=qu,W.registerPattern=r_,W.registerResourceLoader=Wz,W.registerStructure=We,W.registerTemplate=Jt,W.registerTheme=xh,W.renderSVG=tw,W.sequenceCylinders3d=JO,W.setDefaultFont=_z,W.setFontExtendFactor=Rq,Object.defineProperty(W,Symbol.toStringTag,{value:"Module"})}));
588
+ `);const o=e.querySelector("defs");o&&o.parentNode?o.parentNode.insertBefore(i,o.nextSibling):e.insertBefore(i,e.firstChild)}function Pse(e){return Fi(this,null,function*(){const t=yield ga(e);if(!t.ok)throw new Error(`Failed to load font: ${e}`);const n=yield t.blob();return yield new Promise((i,o)=>{const s=new FileReader;s.onloadend=()=>{i(s.result)},s.onerror=o,s.readAsDataURL(n)})})}var ny=(e,t,n)=>new Promise((r,i)=>{var o=l=>{try{a(n.next(l))}catch(c){i(c)}},s=l=>{try{a(n.throw(l))}catch(c){i(c)}},a=l=>l.done?r(l.value):Promise.resolve(l.value).then(o,s);a((n=n.apply(e,t)).next())});function Ose(e){return ny(this,arguments,function*(t,n={}){const r=yield ry(t,n),i=new XMLSerializer().serializeToString(r);return"data:image/svg+xml;charset=utf-8,"+encodeURIComponent(i)})}function ry(e){return ny(this,arguments,function*(t,n={}){const{embedResources:r=!0,removeIds:i=!1}=n,o=t.cloneNode(!0),{width:s,height:a}=fh(t);return ut(o,{width:s,height:a}),i?(Ese(o),Dse(o)):yield Sse(o),yield vse(o,r),Bse(o),o})}function Sse(e){return ny(this,null,function*(){const t=e.querySelectorAll("use"),n=$se(e);t.forEach(r=>{const i=r.getAttribute("href");if(!i)return;if(!e.querySelector(i)){const s=document.querySelector(i);s&&n.appendChild(s.cloneNode(!0))}})})}const dE="icon-defs";function $se(e){const t=xi(e,dE);if(t)return t;const n=Me("defs");return xo(n,dE),e.prepend(n),n}function Ese(e){const t=Array.from(e.querySelectorAll("use"));t.length&&t.forEach(n=>{const r=Mse(n);if(!r||!r.startsWith("#"))return;const i=Ise(e,r);if(!i||i===n)return;const o=Ase(n,i);o&&n.replaceWith(o)})}function Mse(e){var t;return(t=e.getAttribute("href"))!=null?t:e.getAttribute("xlink:href")}function Ise(e,t){const n=e.querySelector(t);return n||document.querySelector(t)}function Ase(e,t){const n=t.tagName.toLowerCase();return n==="symbol"?Tse(e,t):n==="svg"?Rse(e,t):kse(e,t)}function Tse(e,t){const n=t.cloneNode(!0),r=Me("svg");for(hc(r,n,new Set(["id"])),hc(r,e,new Set(["href","xlink:href"]));n.firstChild;)r.appendChild(n.firstChild);return r}function Rse(e,t){const n=t.cloneNode(!0);return n.removeAttribute("id"),hc(n,e,new Set(["href","xlink:href"])),n}function kse(e,t){const n=t.cloneNode(!0);n.removeAttribute("id");const r=Me("g");hc(r,e,new Set(["href","xlink:href","x","y","width","height","transform"]));const i=Lse(e);return i&&r.setAttribute("transform",i),r.appendChild(n),r}function Lse(e){var t;const n=e.getAttribute("x"),r=e.getAttribute("y"),i=n||r?`translate(${n!=null?n:0} ${r!=null?r:0})`:"",o=(t=e.getAttribute("transform"))!=null?t:"";return i&&o?`${i} ${o}`:i||o||null}function hc(e,t,n=new Set){Array.from(t.attributes).forEach(r=>{if(!n.has(r.name)){if(r.name==="style"){Nse(e,r.value);return}if(r.name==="class"){zse(e,r.value);return}e.setAttribute(r.name,r.value)}})}function Nse(e,t){const n=e.getAttribute("style");if(!n){e.setAttribute("style",t);return}const r=n.trim().endsWith(";")?"":";";e.setAttribute("style",`${n}${r}${t}`)}function zse(e,t){const n=e.getAttribute("class");if(!n){e.setAttribute("class",t);return}e.setAttribute("class",`${n} ${t}`.trim())}const pE=/url\(\s*['"]?#([^'")\s]+)['"]?\s*\)/g;function Dse(e){const t=qse(e);if(t.size===0){mE(e);return}const n=Hse(e,t);n&&(wi(e,r=>{if(r.tagName.toLowerCase()==="defs")return!1;Array.from(r.attributes).forEach(o=>{const s=o.value;if(!s.includes("url("))return;const a=s.replace(pE,(l,c)=>{const u=encodeURIComponent(c);return`url("${n}#${u}")`});a!==s&&r.setAttribute(o.name,a)})}),mE(e))}function qse(e){const t=new Set;return wi(e,n=>{if(n.tagName.toLowerCase()==="defs")return!1;gE(n,r=>t.add(r))}),t}function gE(e,t){for(const n of Array.from(e.attributes)){const r=n.value;if(r.includes("url("))for(const i of r.matchAll(pE))i[1]&&t(i[1]);(n.name==="href"||n.name==="xlink:href")&&r[0]==="#"&&t(r.slice(1))}}function Hse(e,t){if(t.size===0)return null;const n=jse(e,t);if(n.size===0)return null;const r=Me("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"}),i=Me("defs");if(n.forEach(s=>{i.appendChild(s.cloneNode(!0))}),!i.children.length)return null;r.appendChild(i);const o=new XMLSerializer().serializeToString(r);return"data:image/svg+xml;charset=utf-8,"+encodeURIComponent(o)}function jse(e,t){const n=new Map,r=Array.from(t),i=new Set(r),o=new Set,s=a=>{o.has(a)||i.has(a)||(r.push(a),i.add(a))};for(;r.length;){const a=r.shift();if(o.has(a))continue;o.add(a);const l=`#${Fse(a)}`,c=e.querySelector(l);c&&(n.set(a,c),wi(c,u=>{gE(u,s)}))}return n}function Fse(e){return globalThis.CSS&&typeof globalThis.CSS.escape=="function"?globalThis.CSS.escape(e):e.replace(/([!"#$%&'()*+,./:;<=>?@[\]^`{|}~])/g,"\\$1")}function mE(e){Array.from(e.querySelectorAll("defs")).forEach(n=>n.remove())}function Bse(e){Wse(e),Vse(e),Gse(e),Yse(e)}function Wse(e){const t=xi(e,Ge.BtnsGroup);t==null||t.remove();const n=xi(e,"btn-icon-defs");n==null||n.remove()}function Vse(e){const t=e.querySelector("[data-element-type=transient-container]");t==null||t.remove()}function Gse(e){e.querySelectorAll("g").forEach(n=>{n.removeAttribute("x"),n.removeAttribute("y"),n.removeAttribute("width"),n.removeAttribute("height")})}function Yse(e){wi(e,t=>{for(const n in t.dataset)delete t.dataset[n]})}var Xse=(e,t,n)=>new Promise((r,i)=>{var o=l=>{try{a(n.next(l))}catch(c){i(c)}},s=l=>{try{a(n.throw(l))}catch(c){i(c)}},a=l=>l.done?r(l.value):Promise.resolve(l.value).then(o,s);a((n=n.apply(e,t)).next())});function Use(e){return Xse(this,arguments,function*(t,n={}){var r;const{dpr:i=(r=globalThis.devicePixelRatio)!=null?r:2}=n,o=yield ry(t),{width:s,height:a}=fh(o);return new Promise((l,c)=>{try{const u=document.createElement("canvas");u.width=s*i,u.height=a*i;const h=u.getContext("2d");if(!h){c(new Error("Failed to get canvas context"));return}h.scale(i,i),h.imageSmoothingEnabled=!0,h.imageSmoothingQuality="high",o.setAttribute("width",String(s)),o.setAttribute("height",String(a));const f=new XMLSerializer().serializeToString(o),d="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(f),p=new Image;p.onload=function(){h.clearRect(0,0,s,a),h.drawImage(p,0,0,s,a);const g=u.toDataURL("image/png");l(g)},p.onerror=function(g){c(new Error("Image load failed: "+g))},p.src=d}catch(u){c(u)}})})}var iy={exports:{}},yE;function Kse(){return yE||(yE=1,(function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function i(l,c,u){this.fn=l,this.context=c,this.once=u||!1}function o(l,c,u,h,f){if(typeof u!="function")throw new TypeError("The listener must be a function");var d=new i(u,h||l,f),p=n?n+c:c;return l._events[p]?l._events[p].fn?l._events[p]=[l._events[p],d]:l._events[p].push(d):(l._events[p]=d,l._eventsCount++),l}function s(l,c){--l._eventsCount===0?l._events=new r:delete l._events[c]}function a(){this._events=new r,this._eventsCount=0}a.prototype.eventNames=function(){var c=[],u,h;if(this._eventsCount===0)return c;for(h in u=this._events)t.call(u,h)&&c.push(n?h.slice(1):h);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(u)):c},a.prototype.listeners=function(c){var u=n?n+c:c,h=this._events[u];if(!h)return[];if(h.fn)return[h.fn];for(var f=0,d=h.length,p=new Array(d);f<d;f++)p[f]=h[f].fn;return p},a.prototype.listenerCount=function(c){var u=n?n+c:c,h=this._events[u];return h?h.fn?1:h.length:0},a.prototype.emit=function(c,u,h,f,d,p){var g=n?n+c:c;if(!this._events[g])return!1;var m=this._events[g],v=arguments.length,b,_;if(m.fn){switch(m.once&&this.removeListener(c,m.fn,void 0,!0),v){case 1:return m.fn.call(m.context),!0;case 2:return m.fn.call(m.context,u),!0;case 3:return m.fn.call(m.context,u,h),!0;case 4:return m.fn.call(m.context,u,h,f),!0;case 5:return m.fn.call(m.context,u,h,f,d),!0;case 6:return m.fn.call(m.context,u,h,f,d,p),!0}for(_=1,b=new Array(v-1);_<v;_++)b[_-1]=arguments[_];m.fn.apply(m.context,b)}else{var x=m.length,w;for(_=0;_<x;_++)switch(m[_].once&&this.removeListener(c,m[_].fn,void 0,!0),v){case 1:m[_].fn.call(m[_].context);break;case 2:m[_].fn.call(m[_].context,u);break;case 3:m[_].fn.call(m[_].context,u,h);break;case 4:m[_].fn.call(m[_].context,u,h,f);break;default:if(!b)for(w=1,b=new Array(v-1);w<v;w++)b[w-1]=arguments[w];m[_].fn.apply(m[_].context,b)}}return!0},a.prototype.on=function(c,u,h){return o(this,c,u,h,!1)},a.prototype.once=function(c,u,h){return o(this,c,u,h,!0)},a.prototype.removeListener=function(c,u,h,f){var d=n?n+c:c;if(!this._events[d])return this;if(!u)return s(this,d),this;var p=this._events[d];if(p.fn)p.fn===u&&(!f||p.once)&&(!h||p.context===h)&&s(this,d);else{for(var g=0,m=[],v=p.length;g<v;g++)(p[g].fn!==u||f&&!p[g].once||h&&p[g].context!==h)&&m.push(p[g]);m.length?this._events[d]=m.length===1?m[0]:m:s(this,d)}return this},a.prototype.removeAllListeners=function(c){var u;return c?(u=n?n+c:c,this._events[u]&&s(this,u)):(this._events=new r,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=n,a.EventEmitter=a,e.exports=a})(iy)),iy.exports}var Zse=Kse();const Qse=I$(Zse);var fc=(e,t,n)=>new Promise((r,i)=>{var o=l=>{try{a(n.next(l))}catch(c){i(c)}},s=l=>{try{a(n.throw(l))}catch(c){i(c)}},a=l=>l.done?r(l.value):Promise.resolve(l.value).then(o,s);a((n=n.apply(e,t)).next())});class Jse{constructor(){this.undoStack=[],this.redoStack=[]}init(t){Object.assign(this,t)}execute(t){return fc(this,null,function*(){yield t.apply(this.state),this.undoStack.push(t),this.redoStack=[],this.emitHistoryChange("execute")})}executeBatch(t){return fc(this,null,function*(){if(t.length===0)return;const n=new Aie(t);yield this.execute(n)})}undo(){return fc(this,null,function*(){const t=this.undoStack.pop();t&&(yield t.undo(this.state),this.redoStack.push(t),this.emitHistoryChange("undo"))})}redo(){return fc(this,null,function*(){const t=this.redoStack.pop();t&&(yield t.apply(this.state),this.undoStack.push(t),this.emitHistoryChange("redo"))})}serialize(){return this.undoStack.map(t=>t.serialize())}clear(){this.undoStack=[],this.redoStack=[]}canUndo(){return this.undoStack.length>0}canRedo(){return this.redoStack.length>0}getHistorySize(){return this.undoStack.length}destroy(){this.clear()}emitHistoryChange(t){var n;(n=this.emitter)==null||n.emit("history:change",{type:"history:change",action:t})}}var vE=(e,t,n)=>new Promise((r,i)=>{var o=l=>{try{a(n.next(l))}catch(c){i(c)}},s=l=>{try{a(n.throw(l))}catch(c){i(c)}},a=l=>l.done?r(l.value):Promise.resolve(l.value).then(o,s);a((n=n.apply(e,t)).next())});class eae{constructor(){this.extensions=new IS,this.interactions=[],this.active=!1,this.running=null,this.concurrentInteractions=new Set,this.selection=new Set,this.handleClick=t=>{const n=this.editor.getDocument(),r=t.target;if(!r){this.deactivate();return}n.contains(r)||cH(r)?this.activate():this.deactivate()}}init(t){Object.assign(this,t),document.addEventListener("click",this.handleClick),this.interactions.forEach(n=>{this.extensions.register(n.name,n),n.init({emitter:this.emitter,editor:this.editor,commander:this.commander,state:this.state,interaction:this}),this.emitter.emit("interaction:registered",n)})}isActive(){return this.active}select(t,n){const r=this.getSelection(),i=[],o=[];if(n==="replace"){const l=new Set(t);r.forEach(c=>{l.has(c)||o.push(c)}),t.forEach(c=>{this.selection.has(c)||i.push(c)}),this.selection=l}else n==="add"?t.forEach(l=>{this.selection.has(l)||(this.selection.add(l),i.push(l))}):n==="remove"?t.forEach(l=>{this.selection.delete(l)&&o.push(l)}):n==="toggle"&&t.forEach(l=>{this.selection.has(l)?(this.selection.delete(l),o.push(l)):(this.selection.add(l),i.push(l))});const s=this.getSelection(),a={type:"selection:change",previous:r,next:s,added:i,removed:o,mode:n};this.emitter.emit("selection:change",a)}getSelection(){return[...this.selection]}isSelected(t){return this.selection.has(t)}clearSelection(){const t=this.getSelection();this.selection.clear();const n={type:"selection:change",previous:t,next:[],added:[],removed:t,mode:"replace"};this.emitter.emit("selection:change",n)}activate(){this.active=!0,this.emitter.emit("activated")}deactivate(){this.active=!1,this.running=null,this.clearSelection(),this.emitter.emit("deactivated")}executeExclusiveInteraction(t,n){return vE(this,null,function*(){if(!(!this.active||this.running)){this.running=t;try{this.emitter.emit("interaction:started",t),yield n(),this.emitter.emit("interaction:ended",t)}catch(r){console.error(`Error occurred during exclusive interaction "${t.name}":`,r),this.emitter.emit("interaction:error",t,r)}finally{this.running=null}}})}executeConcurrentInteraction(t,n){return vE(this,null,function*(){if(this.active){this.concurrentInteractions.add(t);try{this.emitter.emit("interaction:started",t),yield n(),this.emitter.emit("interaction:ended",t)}catch(r){console.error(`Error occurred during concurrent interaction "${t.name}":`,r),this.emitter.emit("interaction:error",t,r)}finally{this.concurrentInteractions.delete(t)}}})}getOrCreateTransientContainer(){const t="transient-container",n=this.editor.getDocument(),r=xi(n,t);if(r&&r.isConnected)return r;const i=Me("g");return xo(i,t),n.appendChild(i),i}appendTransientElement(t){return this.getOrCreateTransientContainer().appendChild(t),t}destroy(){this.extensions.forEach(t=>{t.destroy(),this.emitter.emit("interaction:destroyed",t)}),this.extensions.destroy(),this.active=!1,this.running=null,this.clearSelection(),document.removeEventListener("click",this.handleClick),this.getOrCreateTransientContainer().remove()}}class tae{constructor(){this.extensions=new IS}init(t,n=[]){Object.assign(this,t),n.forEach(r=>{this.registerPlugin(r)})}getPlugin(t){return this.extensions.get(t)}getPlugins(){return this.extensions.getAll()}registerPlugin(t){this.extensions.register(t.name,t);const n={emitter:this.emitter,editor:this.editor,commander:this.commander,plugin:this,state:this.state};t.init(n),this.emitter.emit("plugin:registered",t)}unregisterPlugin(t){const n=this.extensions.get(t);n&&(n.destroy(),this.extensions.unregister(t),this.emitter.emit("plugin:unregistered",n))}destroy(){this.extensions.getAll().forEach(t=>{this.unregisterPlugin(t.name),this.emitter.emit("plugin:destroyed",t)}),this.extensions.destroy()}}var nae=Object.defineProperty,bE=Object.getOwnPropertySymbols,rae=Object.prototype.hasOwnProperty,iae=Object.prototype.propertyIsEnumerable,_E=(e,t,n)=>t in e?nae(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,wE=(e,t)=>{for(var n in t||(t={}))rae.call(t,n)&&_E(e,n,t[n]);if(bE)for(var n of bE(t))iae.call(t,n)&&_E(e,n,t[n]);return e};class oae{init(t){Object.assign(this,t)}addItemDatum(t,n){const r=t.slice(0,-1),i=t[t.length-1],o=Array.isArray(n)?n:[n];$S(this.options.data,r).splice(i,0,...o),this.emitter.emit("options:data:item:add",{indexes:t,datum:n}),this.emitter.emit("options:change",{type:"options:change",changes:[{op:"add",path:"data.items",indexes:t,value:o}]})}updateItemDatum(t,n){const r=uo(this.options.data,t);Object.assign(r,n),this.emitter.emit("options:data:item:update",{indexes:t,datum:n}),this.emitter.emit("options:change",{type:"options:change",changes:[{op:"update",path:"data.items",indexes:t,value:n}]})}removeItemDatum(t,n=1){const r=t.slice(0,-1),i=t[t.length-1],s=$S(this.options.data,r).splice(i,n);this.emitter.emit("options:data:item:remove",{indexes:t,datum:s}),this.emitter.emit("options:change",{type:"options:change",changes:[{op:"remove",path:"data.items",indexes:t,value:s}]})}updateData(t,n){this.options.data[t]=n,this.emitter.emit("options:data:update",{key:t,value:n}),this.emitter.emit("options:change",{type:"options:change",changes:[{op:"update",path:`data.${t}`,value:n}]})}updateElement(t,n){this.updateBuiltInElement(t,n)}updateOptions(t){this.options=wE(wE({},this.options),t),this.options.padding!==void 0&&z_(this.editor.getDocument(),Lr(this.options.padding)),this.emitter.emit("options:change",{type:"options:change",changes:[{op:"update",path:"",value:t}]})}getOptions(){return this.options}updateBuiltInElement(t,n){var r,i;const{data:o}=this.options,{attributes:s={}}=n,a=sh(t),l=fr(t)||Ge.ItemLabel===a||Ge.ItemDesc===a||Ge.ItemValue===a||Ge.ItemIllus===a,c=l?ES(t):void 0;if(l){const u=uo(o,c),h=a.replace("item-","");u.attributes||(u.attributes={}),(r=u.attributes)[h]||(r[h]={}),Object.assign(u.attributes[h],s)}else(Ge.Title===a||Ge.Desc===a||Ge.Illus===a)&&(o.attributes||(o.attributes={}),(i=o.attributes)[a]||(i[a]={}),Object.assign(o.attributes[a],s));this.emitter.emit("options:element:update",{element:t,props:n}),this.emitter.emit("options:change",{type:"options:change",changes:[{op:"update",role:a,indexes:c,path:l?`${_ie(c)}.attributes.${a.replace("item-","")}`:`data.attributes.${a}`,value:n}]})}destroy(){}}class sae{constructor(t,n,r){if(this.emitter=t,this.document=n,this.options=r,!n.isConnected)throw new Error("The provided document is not connected to the DOM.");n.style.userSelect="none";const i=new Jse,o=new oae,s=new tae,a=new eae;i.init({state:o,emitter:t}),o.init({emitter:t,editor:this,commander:i,options:r}),s.init({emitter:t,editor:this,commander:i,state:o},r.plugins),a.init({emitter:t,editor:this,commander:i,state:o,interactions:r.interactions}),this.commander=i,this.state=o,this.plugin=s,this.interaction=a}getDocument(){return this.document}destroy(){this.document.style.userSelect="",this.interaction.destroy(),this.plugin.destroy(),this.commander.destroy(),this.state.destroy()}}var aae=Object.defineProperty,lae=Object.defineProperties,cae=Object.getOwnPropertyDescriptors,dc=Object.getOwnPropertySymbols,xE=Object.prototype.hasOwnProperty,CE=Object.prototype.propertyIsEnumerable,PE=(e,t,n)=>t in e?aae(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,un=(e,t)=>{for(var n in t||(t={}))xE.call(t,n)&&PE(e,n,t[n]);if(dc)for(var n of dc(t))CE.call(t,n)&&PE(e,n,t[n]);return e},Bi=(e,t)=>lae(e,cae(t)),Wi=(e,t)=>{var n={};for(var r in e)xE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&dc)for(var r of dc(e))t.indexOf(r)<0&&CE.call(e,r)&&(n[r]=e[r]);return n};function uae(e){const t=e,{container:n="#container",padding:r=0,template:i,design:o,theme:s,themeConfig:a,data:l}=t,c=Wi(t,["container","padding","template","design","theme","themeConfig","data"]),u=typeof n=="string"?document.querySelector(n)||document.createElement("div"):n,h=i?Xi(i):void 0,f=cb({},h==null?void 0:h.themeConfig,a),d=s||a||h!=null&&h.themeConfig?gae(s,f):void 0,p={container:u,padding:Lr(r)};if(h){const m=h,{design:v}=m,b=Wi(m,["design"]);Object.assign(p,b)}Object.assign(p,c);const g=hae(l,e.template);if(g&&(p.data=g),i&&(p.template=i),h!=null&&h.design||o){const m=Bi(un({},d?Bi(un({},e),{themeConfig:d}):e),{data:g||l}),v=fae(un(un({},h==null?void 0:h.design),o),m);ub(v)&&(p.design=v)}return s&&(p.theme=s),d&&(p.themeConfig=d),p}function hae(e,t){if(!e)return;if(Array.isArray(e.items)&&e.items.length)return e;const{lists:n,sequences:r,compares:i,nodes:o,values:s,root:a}=e,l=()=>{if(!t)return null;const h={list:n,sequence:r,compare:i,relation:o,chart:s,hierarchy:a?[a]:[]},f=t.split("-")[0],d=h[f];return d!=null&&d.length?d:null},c=()=>{var h;return n!=null&&n.length?n:r!=null&&r.length?r:i!=null&&i.length?i:o!=null&&o.length?o:s!=null&&s.length?s:a?[a]:(h=e.items)!=null&&h.length?e.items:[]};let u=l()||c();return u===r&&e.order==="desc"&&(u=[...u].reverse()),Bi(un({},e),{items:u})}function oy(e){if(typeof e=="string")return{type:e};if(!("type"in e))throw new Error("Type is required");return e}function fae(e,t){const{structure:n,title:r,item:i,items:o}=e||{},s=OE(i||(o==null?void 0:o[0]),t);return{structure:dae(n),title:pae(r,t),item:s,items:o?o.map(a=>OE(a,t)):[s]}}function dae(e){if(!e)return null;const t=oy(e),{type:n}=t,r=Wi(t,["type"]),i=F4(n);if(!i)return null;const{component:o}=i;return Bi(un({},i),{component:s=>o(un(un({},s),r))})}function pae(e,t){if(!e)return{component:null};const n=oy(e),{type:r}=n,i=Wi(n,["type"]),{themeConfig:o}=t,s=(o==null?void 0:o.colorBg)||"#fff",a=SE(s,s);return{component:l=>Ww(un(Bi(un({},l),{themeColors:a}),i))}}function OE(e,t){if(!e)return null;const n=oy(e),{type:r}=n,i=Wi(n,["type"]),o=Jw(r);if(!o)return null;const{component:s,options:a}=o;return Bi(un({},o),{component:l=>{var c;const{indexes:u}=l,{data:h,themeConfig:f}=t,d=(f==null?void 0:f.colorBg)||"#fff",p=l,{themeColors:g=SE(Vs(f==null?void 0:f.palette,u,(c=h==null?void 0:h.items)==null?void 0:c.length)||(f==null?void 0:f.colorPrimary)||"#FF356A",d)}=p,m=Wi(p,["themeColors"]);return s(un(un({themeColors:g},m),i))},options:a})}function gae(e,t={}){var n;const r=e?Vw(e)||{}:{},i=cb({},r,t);return i.palette=t.palette||r.palette,i.stylize=(n=t.stylize)!=null?n:r.stylize,i.colorPrimary||(i.colorPrimary="#FF356A"),i.palette||(i.palette=[i.colorPrimary]),i}function SE(e,t="#fff"){return Xw({colorPrimary:e,isDarkMode:H2(t),colorBg:t})}function mae(e){return e===" "||e===" "}function yae(e){let t=0,n=0;for(;n<e.length;){const r=e[n];if(r===" "){t+=1,n+=1;continue}if(r===" "){t+=2,n+=1;continue}break}return{indent:t,content:e.slice(n)}}function vae(e){return e.trimEnd()}function bae(e){return/[<>=o.x-]{2,}/.test(e)}function $E(e){const t=e.trim();if(!t)return null;const n=t.match(/^([^:\s=]+)\s*[:=]\s*(.*)$/);if(n)return{key:n[1],value:n[2].trim()};const r=t.match(/^([^\s]+)\s+(.*)$/);return r?{key:r[1],value:r[2].trim()}:{key:t,value:void 0}}function pc(e,t){return{kind:"object",line:e,value:t,entries:{}}}function EE(e){return{kind:"array",line:e,items:[]}}function _ae(e){const t=[],n=pc(0),r=[{indent:-1,node:n,parent:null,key:null}];return e.split(/\r?\n/).forEach((o,s)=>{const a=s+1;if(!o.trim())return;const{indent:l,content:c}=yae(o),u=vae(c);if(!u.trim())return;for(;r.length>1&&l<=r[r.length-1].indent;)r.pop();const h=r[r.length-1];let f=h.node;const d=u.trim();if(d.startsWith("-")&&(d.length===1||mae(d[1]))){if(f.kind!=="array")if(f.kind==="object"&&Object.keys(f.entries).length===0&&f.value===void 0&&h.parent&&h.key){const b=EE(f.line);if(h.parent.kind==="object")h.parent.entries[h.key]=b;else if(h.parent.kind==="array"){const _=h.parent.items.indexOf(f);_>=0&&(h.parent.items[_]=b)}h.node=b,f=b}else{t.push({path:"",line:a,code:"bad_list",message:"List item is not under an array container.",raw:d});return}const m=d.slice(1).trim(),v=pc(a,m||void 0);f.items.push(v),r.push({indent:l,node:v,parent:f});return}if(h.key==="relations"&&!d.startsWith("-")&&bae(d)){if(f.kind!=="array")if(f.kind==="object"&&Object.keys(f.entries).length===0&&f.value===void 0&&h.parent&&h.key){const v=EE(f.line);if(h.parent.kind==="object")h.parent.entries[h.key]=v;else if(h.parent.kind==="array"){const b=h.parent.items.indexOf(f);b>=0&&(h.parent.items[b]=v)}h.node=v,f=v}else{t.push({path:"",line:a,code:"bad_list",message:"List item is not under an array container.",raw:d});return}const m=pc(a,d);f.items.push(m),r.push({indent:l,node:m,parent:f});return}const p=$E(d);if(!p){t.push({path:"",line:a,code:"bad_syntax",message:"Invalid syntax line.",raw:d});return}if(f.kind!=="object"){t.push({path:"",line:a,code:"bad_syntax",message:"Key-value pair is not under an object container.",raw:d});return}const g=pc(a,p.value);f.entries[p.key]=g,r.push({indent:l,node:g,parent:f,key:p.key})}),{ast:n,errors:t}}function ME(e){return $E(e)}function gc(e,t){return{kind:"value",line:t,value:e}}const wae=/^(#[0-9a-f]{8}|#[0-9a-f]{6}|#[0-9a-f]{4}|#[0-9a-f]{3})/i,xae=/^((?:rgb|rgba|hsl|hsla)\([^)]*\))/i;function ni(e){const t=e.trim();return t==="true"?!0:t==="false"?!1:/^-?\d+(\.\d+)?$/.test(t)?parseFloat(t):t}function ri(e){if(e.kind==="value"||e.kind==="object")return e.value}function Ht(e,t,n,r,i,o){e.push({path:n,line:t.line,code:r,message:i,raw:o})}function IE(e,t="any"){let n=e.trim();if(n.startsWith("[")&&n.endsWith("]")&&(n=n.slice(1,-1).trim()),!n)return[];let r;t==="comma"?r=n.split(","):t==="space"?r=n.split(/\s+/):r=n.split(/[,\s]+/);const i=[];for(const o of r){const s=o.trim();if(s){if(s==="#"||s==="//")break;i.push(s)}}return i}function Cae(e){let t=e.trim();const n=t.search(/\s+#(?![0-9a-f])/i);n>=0&&(t=t.slice(0,n).trimEnd());const r=t.indexOf("//");return r>=0&&(t=t.slice(0,r).trimEnd()),t}function sy(e){const t=Cae(e);if(!t)return;const n=t.match(wae);if(n&&n[0].length===t.length)return t;const r=t.match(xae);if(r&&r[1].length===t.length||be(t).isValid())return t}function AE(e,t,n,r={}){const i=ri(e);if(i===void 0){Ht(n,e,t,"schema_mismatch","Expected color value.");return}const o=sy(i);if(!o){r.soft||Ht(n,e,t,"invalid_value","Invalid color value.",i);return}return o}function Pae(e,t){return t.length>1||e.startsWith("[")&&e.endsWith("]")?!0:sy(e)!==void 0}function ay(e){if(e.kind==="array")return e.items.map(r=>ay(r));if(e.kind==="value"||!(Object.keys(e.entries).length>0)&&e.value!==void 0)return ni(e.value);const n={};return e.value!==void 0&&(n.value=ni(e.value)),Object.entries(e.entries).forEach(([r,i])=>{n[r]=ay(i)}),n}function Oae(e,t,n,r){let i,o=null;for(const s of t.variants){const a=[],l=sn(e,s,n,a);(o===null||a.length<o.length)&&(o=a,i=l)}return o&&r.push(...o),i}function sn(e,t,n,r){switch(t.kind){case"union":return Oae(e,t,n,r);case"string":{const i=ri(e);if(i===void 0){Ht(r,e,n,"schema_mismatch","Expected string value.");return}return i}case"number":{const i=ri(e);if(i===void 0){Ht(r,e,n,"schema_mismatch","Expected number value.");return}const s=i.trim().match(/^(-?\d+(\.\d+)?)(?:\s*(#|\/\/).*)?$/);if(!s){Ht(r,e,n,"invalid_value","Invalid number value.",i);return}return parseFloat(s[1])}case"boolean":{const i=ri(e);if(i===void 0){Ht(r,e,n,"schema_mismatch","Expected boolean value.");return}if(i!=="true"&&i!=="false"){Ht(r,e,n,"invalid_value","Invalid boolean value.",i);return}return i==="true"}case"enum":{const i=ri(e);if(i===void 0){Ht(r,e,n,"schema_mismatch","Expected enum value.");return}if(!t.values.includes(i)){Ht(r,e,n,"invalid_value","Invalid enum value.",i);return}return i}case"array":{if(e.kind==="array")return e.items.map((a,l)=>sn(a,t.item,`${n}[${l}]`,r)).filter(a=>a!==void 0);if(e.kind==="object"&&Object.keys(e.entries).length>0){Ht(r,e,n,"schema_mismatch","Expected array value.");return}const i=ri(e);if(i===void 0){Ht(r,e,n,"schema_mismatch","Expected array value.");return}const o=i.trim();return o.startsWith("[")&&!o.endsWith("]")?void 0:IE(i,t.split).map((a,l)=>sn(gc(a,e.line),t.item,`${n}[${l}]`,r)).filter(a=>a!==void 0)}case"palette":{if(e.kind==="array"){const l=sn(e,{kind:"array",item:{kind:"color"},split:"any"},n,r);return Array.isArray(l)&&l.length>0?l:void 0}if(e.kind==="object"&&Object.keys(e.entries).length>0){Ht(r,e,n,"schema_mismatch","Expected palette value.");return}const i=ri(e);if(i===void 0){Ht(r,e,n,"schema_mismatch","Expected palette value.");return}const o=i.trim();if(o.startsWith("[")&&!o.endsWith("]"))return;const s=sy(o);if(s)return[s];const a=IE(i,"any");if(Pae(o,a)){const l=a.map((c,u)=>AE(gc(c,e.line),`${n}[${u}]`,r)).filter(c=>c!==void 0);return l.length>0?l:void 0}return i}case"color":return AE(e,n,r,{soft:t.soft});case"object":{if(e.kind==="array"){Ht(r,e,n,"schema_mismatch","Expected object value.");return}const i={};if(e.kind==="value"){if(t.shorthandKey)return i[t.shorthandKey]=e.value,i;const o=ME(e.value);if((o==null?void 0:o.value)!==void 0){if(t.fields[o.key]){const s=sn(gc(o.value,e.line),t.fields[o.key],`${n}.${o.key}`,r);return s!==void 0&&(i[o.key]=s),i}return t.allowUnknown?(i[o.key]=ni(o.value),i):(Ht(r,e,`${n}.${o.key}`,"unknown_key","Unknown key in object.",o.key),i)}if(t.allowUnknown)return i.value=ni(e.value),i;Ht(r,e,n,"invalid_value","Expected object value.");return}if(e.value!==void 0)if(t.shorthandKey&&i[t.shorthandKey]===void 0)i[t.shorthandKey]=e.value;else{const o=ME(e.value);if((o==null?void 0:o.value)!==void 0)if(t.fields[o.key]){const s=sn(gc(o.value,e.line),t.fields[o.key],`${n}.${o.key}`,r);s!==void 0&&i[o.key]===void 0&&(i[o.key]=s)}else t.allowUnknown?i[o.key]=ni(o.value):Ht(r,e,`${n}.${o.key}`,"unknown_key","Unknown key in object.",o.key);else t.allowUnknown&&(i.value=ni(e.value))}return Object.entries(e.entries).forEach(([o,s])=>{const a=t.fields[o];if(!a){if(t.allowUnknown){i[o]=ay(s);return}Ht(r,s,`${n}.${o}`,"unknown_key","Unknown key in object.",o);return}const l=sn(s,a,`${n}.${o}`,r);l!==void 0&&(i[o]=l)}),i}default:return}}const Lt=()=>({kind:"string"}),br=()=>({kind:"number"}),cs=e=>({kind:"enum",values:e}),Vi=(e={})=>({kind:"color",soft:e.soft}),er=(e,t="any")=>({kind:"array",item:e,split:t}),Bt=(e,t={})=>({kind:"object",fields:e,allowUnknown:t.allowUnknown,shorthandKey:t.shorthandKey}),us=(...e)=>({kind:"union",variants:e}),Sae=()=>({kind:"palette"}),hs=()=>Bt({},{allowUnknown:!0}),TE={fill:Vi({soft:!0}),stroke:Vi({soft:!0})},Gi=Bt(TE,{allowUnknown:!0}),ly=Bt(TE,{allowUnknown:!0}),tr=Bt({},{allowUnknown:!0});tr.fields={id:Lt(),label:Lt(),value:us(br(),Lt()),desc:Lt(),icon:us(Lt(),hs()),illus:us(Lt(),hs()),attributes:hs(),group:Lt(),category:Lt(),children:er(tr)};const RE=Bt({id:Lt(),from:Lt(),to:Lt(),label:Lt(),direction:cs(["forward","both","none"]),showArrow:cs(["true","false"]),arrowType:cs(["arrow","triangle","diamond"])},{allowUnknown:!0}),kE=Bt({type:Lt(),colorBg:Vi(),colorPrimary:Vi(),palette:Sae(),title:Gi,desc:Gi,shape:ly,base:Bt({global:Bt({},{allowUnknown:!0}),shape:ly,text:Gi}),item:Bt({icon:Bt({},{allowUnknown:!0}),label:Gi,desc:Gi,value:Gi,shape:ly}),stylize:Bt({type:cs(["rough","pattern"]),roughness:br(),bowing:br(),fillWeight:br(),hachureGap:br(),pattern:Lt(),backgroundColor:Vi(),foregroundColor:Vi(),scale:br()},{shorthandKey:"type"}),elements:Bt({},{allowUnknown:!0})},{shorthandKey:"type"}),mc=Bt({},{allowUnknown:!0,shorthandKey:"type"}),LE=Bt({structure:mc,item:mc,items:er(mc),title:mc}),NE=Bt({title:Lt(),desc:Lt(),items:er(tr),lists:er(tr),sequences:er(tr),root:tr,compares:er(tr),nodes:er(tr),relations:er(RE),values:er(tr),order:cs(["asc","desc"]),illus:hs(),attributes:hs()}),zE=Bt({type:Lt()},{shorthandKey:"type"}),DE=Bt({template:zE,design:LE,data:NE,theme:kE,width:us(br(),Lt()),height:us(br(),Lt())}),qE=/[<>=o.x-]{2,}/,yc=/[<>=o.x-]{2,}/g;function vc(e){let t=e.trim();if(!t)return"";const n=t[0],r=t[t.length-1];return(n==='"'&&r==='"'||n==="'"&&r==="'")&&(t=t.slice(1,-1)),t=t.replace(/\\(["'])/g,"$1").replace(/(&quot;|&#quot;|#quot;)/g,'"').replace(/(&apos;|&#39;|#apos;)/g,"'"),t.trim()}function $ae(e){const t=e.trim().replace(/^[-=.ox]+/,"").trim();return vc(t)}function bc(e,t){let n=t;for(;n<e.length&&/\s/.test(e[n]);)n+=1;return n}function HE(e,t){let n=bc(e,t);if(n>=e.length)return null;const r=n;for(;n<e.length;){const s=e[n];if(/\s/.test(s)||s==="["||s==="("||s==="@"||s==="|"||s==="<"||s===">"||s==="-"&&(e[n+1]==="-"||e[n+1]===">"||e[n+1]==="<"))break;n+=1}if(n===r)return null;const i=e.slice(r,n).trim();if(!i)return null;if(e.startsWith("@{",n)){const s=e.indexOf("}",n+2);s!==-1&&(n=s+1)}n=bc(e,n);let o;if(e[n]==="["){const s=e.indexOf("]",n+1);s!==-1&&(o=vc(e.slice(n+1,s)),n=s+1)}else if(e[n]==="("){const s=e.indexOf(")",n+1);if(s!==-1){let a=e.slice(n+1,s).trim();a.startsWith("[")&&a.endsWith("]")&&(a=a.slice(1,-1).trim()),o=vc(a),n=s+1}}return{node:{id:i,label:o},nextIndex:n}}function Eae(e,t){yc.lastIndex=t;const n=yc.exec(e);if(!n)return null;const r=n[0],i=n.index,o=i+r.length;let a=$ae(e.slice(t,i))||void 0,l=r,c=o;if(c=bc(e,c),e[c]==="|"){const v=e.indexOf("|",c+1);if(v!==-1){a=vc(e.slice(c+1,v))||a,c=v+1;const _=bc(e,c);yc.lastIndex=_;const x=yc.exec(e);x&&x.index===_?(l+=x[0],c=x.index+x[0].length):c=_}}const u=l.includes("<"),h=l.includes(">"),f=l.match(/[xo]/gi)||[],d=/^[xo]/i.test(l),p=/[xo]$/i.test(l);let g="none",m=!1;return u&&h||u&&p||h&&d||d&&p?g="both":(u||h||f.length>0)&&(g="forward",m=u&&!h),{label:a,direction:g,reverse:m,nextIndex:c}}function Mae(e){const t=[],n=[],r=new Map;let i=0;const o=HE(e,i);if(!o)return{relations:t,nodes:n};let s=o.node;for(r.has(s.id)||(r.set(s.id,s),n.push(s)),i=o.nextIndex;i<e.length;){const a=Eae(e,i);if(!a)break;i=a.nextIndex;const l=HE(e,i);if(!l)break;i=l.nextIndex;let c=s.id,u=l.node.id;const h=a.direction;a.reverse&&(c=l.node.id,u=s.id);const f={from:c,to:u};a.label&&(f.label=a.label),h==="both"&&(f.direction="both"),h==="none"&&(f.direction="none"),t.push(f),r.has(s.id)||(r.set(s.id,s),n.push(s)),r.has(l.node.id)||(r.set(l.node.id,l.node),n.push(l.node)),s=l.node}return{relations:t,nodes:n}}function Iae(e,t,n,r){if(!n)return;const i=e.get(n);if(i){!i.label&&r&&(i.label=r);return}const o={id:n,label:r||n};e.set(n,o),t.push(o)}function Aae(e,t,n){const r=sn(e,RE,t,n);return!r||typeof r!="object"||typeof r.from!="string"||typeof r.to!="string"?null:r}function Tae(e,t,n){const r=[],i=[],o=new Map,s=a=>{if(!qE.test(a))return;const l=Mae(a);l.nodes.forEach(c=>{Iae(o,i,c.id,c.label)}),r.push(...l.relations)};return e.kind==="array"?e.items.forEach((a,l)=>{if(a.kind==="object"&&a.value&&Object.keys(a.entries).length===0&&qE.test(a.value)){s(a.value);return}const c=Aae(a,`${n}[${l}]`,t);c&&r.push(c)}):e.kind==="object"&&e.value&&s(e.value),{relations:r,items:i}}var Rae=Object.defineProperty,kae=Object.defineProperties,Lae=Object.getOwnPropertyDescriptors,_c=Object.getOwnPropertySymbols,jE=Object.prototype.hasOwnProperty,FE=Object.prototype.propertyIsEnumerable,BE=(e,t,n)=>t in e?Rae(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,WE=(e,t)=>{for(var n in t||(t={}))jE.call(t,n)&&BE(e,n,t[n]);if(_c)for(var n of _c(t))FE.call(t,n)&&BE(e,n,t[n]);return e},Nae=(e,t)=>kae(e,Lae(t)),VE=(e,t)=>{var n={};for(var r in e)jE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&_c)for(var r of _c(e))t.indexOf(r)<0&&FE.call(e,r)&&(n[r]=e[r]);return n};function zae(e){var t;const n=new Set,r=[];for(let i=e.length-1;i>=0;i-=1){const o=e[i],s=(t=o.id)!=null?t:o.label;if(!s){r.push(o);continue}n.has(s)||(n.add(s),o.id||(o.id=s),r.push(o))}return r.reverse()}function Dae(e,t){if(!e)return;const n=sn(e,zE,"template",t);if(n){if(typeof n=="string")return n;if(typeof n=="object"&&typeof n.type=="string")return n.type}}function GE(e){var t;const{ast:n,errors:r}=_ae(e),i=[],o={},s=WE({},n.entries),a=n.entries.infographic;let l;a&&a.kind==="object"&&(a.value&&(l=a.value),Object.entries(a.entries).forEach(([v,b])=>{v in s||(s[v]=b)}));const c=new Set(["infographic","template","design","data","theme","width","height"]);Object.keys(s).forEach(v=>{c.has(v)||r.push({path:v,line:s[v].line,code:"unknown_key",message:"Unknown top-level key.",raw:v})});const u=s.template,h=Dae(u,r);h&&(o.template=h),!o.template&&l&&(o.template=l);const f=s.design;if(f){const v=sn(f,LE,"design",r);v&&(o.design=v)}const d=s.data;if(d){let v,b=d;if(d.kind==="object"){const x=d.entries,{relations:w}=x,C=VE(x,["relations"]);v=w,b=Nae(WE({},d),{entries:C})}const _=sn(b,NE,"data",r);if(_&&(o.data=_),v){const x=Tae(v,r,"data.relations");if(x.relations.length>0||x.items.length>0){const w=(t=o.data)!=null?t:{},C=Array.isArray(w.items)?w.items:[],P=zae(C),O=new Map;P.forEach($=>{$.id&&O.set($.id,$)}),x.items.forEach($=>{const S=O.get($.id);S?!S.label&&$.label&&(S.label=$.label):(P.push($),O.set($.id,$))}),w.items=P,w.relations=x.relations,o.data=w}}}const p=s.theme;if(p){const v=sn(p,kE,"theme",r);if(v&&typeof v=="object"){const b=v,{type:_}=b,x=VE(b,["type"]);typeof _=="string"&&_&&(o.theme=_),Object.keys(x).length>0&&(o.themeConfig=x)}}const g=s.width;if(g){const v=sn(g,DE.fields.width,"width",r);v!==void 0&&(o.width=v)}const m=s.height;if(m){const v=sn(m,DE.fields.height,"height",r);v!==void 0&&(o.height=v)}return{options:o,errors:r,warnings:i,ast:n}}const qae=()=>[new O$,new M$],Hae=()=>[new VS,new AS,new TS,new GS,new XS,new JS,new ZS],jae={padding:20,theme:"light",themeConfig:{palette:"antv"},get plugins(){return qae()},get interactions(){return Hae()}};var Fae=Object.defineProperty,YE=Object.getOwnPropertySymbols,Bae=Object.prototype.hasOwnProperty,Wae=Object.prototype.propertyIsEnumerable,XE=(e,t,n)=>t in e?Fae(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,nr=(e,t)=>{for(var n in t||(t={}))Bae.call(t,n)&&XE(e,n,t[n]);if(YE)for(var n of YE(t))Wae.call(t,n)&&XE(e,n,t[n]);return e};function cy(e,t){const n=nr(nr({},e),t);return(e.design||t.design)&&(n.design=nr(nr({},e.design),t.design)),(e.themeConfig||t.themeConfig)&&(n.themeConfig=nr(nr({},e.themeConfig),t.themeConfig)),(e.svg||t.svg)&&(n.svg=nr(nr({},e.svg),t.svg)),n}function uy(e){const t=nr({},e);return t.data&&(t.data=ab(t.data)),t.elements&&(t.elements=ab(t.elements)),t}function UE(e){const{design:t,data:n}=e;return!(!t||!ub(t)||!n||!Array.isArray(n.items)||n.items.length<1)}var Vae=Object.defineProperty,KE=Object.getOwnPropertySymbols,Gae=Object.prototype.hasOwnProperty,Yae=Object.prototype.propertyIsEnumerable,ZE=(e,t,n)=>t in e?Vae(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Xae=(e,t)=>{for(var n in t||(t={}))Gae.call(t,n)&&ZE(e,n,t[n]);if(KE)for(var n of KE(t))Yae.call(t,n)&&ZE(e,n,t[n]);return e},Uae=(e,t,n)=>new Promise((r,i)=>{var o=l=>{try{a(n.next(l))}catch(c){i(c)}},s=l=>{try{a(n.throw(l))}catch(c){i(c)}},a=l=>l.done?r(l.value):Promise.resolve(l.value).then(o,s);a((n=n.apply(e,t)).next())});class Kae{constructor(t){this.rendered=!1,this.emitter=new Qse,this.node=null,this.initialOptions={},this.setOptions(t,"replace",!0)}getOptions(){return this.options}setOptions(t,n="replace",r=!1){const{options:i,errors:o,warnings:s}=Zae(t);r&&(this.initialOptions=i);const a=cy(n==="replace"?uy(this.initialOptions||{}):this.options||uy(this.initialOptions||{}),i);this.options=a,this.parsedOptions=uae(cy(jae,this.options)),s.length&&this.emitter.emit("warning",s),o.length&&this.emitter.emit("error",o)}render(t){t?this.setOptions(t,"replace"):!this.options&&this.initialOptions&&this.setOptions(this.initialOptions,"replace"),this.performRender()}update(t){this.setOptions(t,"merge"),this.performRender()}performRender(){var t;const n=this.parsedOptions;if(!UE(n)){this.emitter.emit("error",new Error("Incomplete options"));return}const{container:r}=this.parsedOptions,i=this.compose(n),o=new $q(n,i);this.node=o.render(),r==null||r.replaceChildren(this.node),(t=this.editor)==null||t.destroy(),this.editor=void 0,this.options.editable&&(this.editor=new sae(this.emitter,this.node,n)),this.rendered=!0,this.emitter.emit("rendered",{node:this.node,options:this.options});const s=this.node;return s&&gz(s).then(()=>{this.node===s&&this.emitter.emit("loaded",{node:s,options:this.options})}),!0}compose(t){const{design:n,data:r}=t,{title:i,item:o,items:s,structure:a}=n,{component:l,props:c}=a,u=i.component,h=o.component,f=s.map(g=>g.component),d=tw(y(l,Xae({data:r,Title:u,Item:h,Items:f,options:t},c))),p=_i(d);if(!p)throw new Error("Failed to parse SVG template");return p}getTypes(){const t=this.parsedOptions;if(!UE(t)){this.emitter.emit("error",new Error("Incomplete options"));return}const n=t.design,r=n.structure.composites||[],i=n.items.map(o=>o.composites||[]);return pH({structure:r,items:i})}toDataURL(t){return Uae(this,null,function*(){if(!this.node)throw new Error("Infographic is not rendered yet.");return(t==null?void 0:t.type)==="svg"?yield Ose(this.node,t):yield Use(this.node,t)})}on(t,n){this.emitter.on(t,n)}off(t,n){this.emitter.off(t,n)}destroy(){var t,n;(t=this.editor)==null||t.destroy(),(n=this.node)==null||n.remove(),this.node=null,this.rendered=!1,this.emitter.emit("destroyed"),this.emitter.removeAllListeners()}}function Zae(e){if(typeof e=="string"){const{options:t,errors:n,warnings:r}=GE(e);return{options:t,errors:n,warnings:r}}return{options:uy(e),errors:[],warnings:[]}}const Qae="0.2.12";W.AlignLayout=Pi,W.BadgeCard=n3,W.BrushSelect=AS,W.BtnAdd=Q,W.BtnRemove=nt,W.BtnsGroup=qe,W.CandyCardLite=o3,W.CapsuleItem=d3,W.ChartBar=B4,W.ChartColumn=W4,W.ChartLine=X4,W.ChartPie=U4,W.ChartWordCloud=t5,W.CircleNode=m3,W.CircularProgress=b3,W.ClickSelect=TS,W.CompactCard=C3,W.CompareBinaryHorizontal=h5,W.CompareHierarchyLeftRight=g5,W.CompareHierarchyRow=m5,W.DblClickEditText=VS,W.Defs=Ke,W.DoneList=S3,W.DragElement=GS,W.EditBar=O$,W.Ellipse=Ze,W.FlexLayout=ve,W.Fragment=Co,W.Gap=yt,W.Group=Y,W.HierarchyMindmap=$5,W.HierarchyStructure=M5,W.HierarchyTree=R5,W.HorizontalIconArrow=M3,W.HorizontalIconLine=k3,W.HotkeyHistory=XS,W.IconBadge=z3,W.Illus=fw,W.IndexedCard=H3,W.Infographic=Kae,W.Interaction=yr,W.ItemDesc=ft,W.ItemIcon=Ft,W.ItemIconCircle=zr,W.ItemLabel=Ve,W.ItemValue=Mo,W.ItemsGroup=ze,W.LCornerCard=B3,W.LabelText=tx,W.LetterCard=G3,W.LinedText=U3,W.ListColumn=k5,W.ListGrid=L5,W.ListPyramid=N5,W.ListRow=z5,W.ListSector=H5,W.ListWaterfall=j5,W.ListZigzagDown=G5,W.ListZigzagUp=Y5,W.Path=Ce,W.PillBadge=Q3,W.Plugin=pm,W.Polygon=Yt,W.ProgressCard=l4,W.Quadrant=y5,W.QuarterCircular=h4,W.QuarterSimpleCard=p4,W.Rect=ke,W.RelationCircle=X5,W.RelationDagreFlow=NO,W.RelationNetwork=zO,W.ResizeElement=M$,W.RibbonCard=y4,W.RoundedRectNode=_4,W.SelectHighlight=ZS,W.SequenceAscendingStairs3d=YO,W.SequenceAscendingSteps=XO,W.SequenceCircleArrows=KO,W.SequenceCircular=ZO,W.SequenceColorSnakeSteps=QO,W.SequenceFilterMesh=nS,W.SequenceFunnel=sS,W.SequenceHorizontalZigzag=aS,W.SequenceMountain=uS,W.SequencePyramid=hS,W.SequenceRoadmapVertical=dS,W.SequenceSnakeSteps=pS,W.SequenceStairsFront=gS,W.SequenceSteps=mS,W.SequenceTimeline=yS,W.SequenceZigzagPucks3d=bS,W.SequenceZigzagSteps=OS,W.ShapesGroup=Pt,W.SimpleCircleNode=C4,W.SimpleHorizontalArrow=S4,W.SimpleIllusItem=M4,W.SimpleItem=T4,W.SimpleVerticalArrow=L4,W.Text=Ne,W.Title=Ww,W.UnderlineText=D4,W.VERSION=Qae,W.VerticalIconArrow=j4,W.ZoomWheel=JS,W.cloneElement=dr,W.createFragment=RH,W.createLayout=vh,W.exportToSVG=ry,W.getCombinedBounds=Ci,W.getElementBounds=ae,W.getElementsBounds=Nr,W.getFont=Lu,W.getFonts=Nu,W.getItem=Jw,W.getItemProps=lt,W.getItems=oF,W.getPalette=Cb,W.getPaletteColor=Vs,W.getPalettes=Sz,W.getStructure=F4,W.getStructures=pZ,W.getTemplate=Xi,W.getTemplates=Cc,W.getTheme=Vw,W.getThemeColors=Et,W.getThemes=Fj,W.jsx=va,W.jsxDEV=LH,W.jsxs=kH,W.loadSVGResource=vi,W.parseSVG=_i,W.parseSyntax=GE,W.registerFont=_b,W.registerItem=ct,W.registerPalette=qu,W.registerPattern=r_,W.registerResourceLoader=Wz,W.registerStructure=We,W.registerTemplate=Jt,W.registerTheme=xh,W.renderSVG=tw,W.sequenceCylinders3d=JO,W.setDefaultFont=_z,W.setFontExtendFactor=Rq,Object.defineProperty(W,Symbol.toStringTag,{value:"Module"})}));
589
589
  //# sourceMappingURL=infographic.min.js.map