@heartlandone/vega 2.75.1 → 2.76.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (725) hide show
  1. package/dist/cjs/{app-globals-35614ce8.js → app-globals-12b7d808.js} +28 -32
  2. package/dist/cjs/breakpoints-751d433a.js +56 -0
  3. package/dist/cjs/{child-nodes-event-prevent-slimmer-aca87dac.js → child-nodes-event-prevent-slimmer-84435957.js} +2 -2
  4. package/dist/cjs/{child-nodes-notify-observer-slimmer-257fedb3.js → child-nodes-notify-observer-slimmer-ed39283b.js} +1 -1
  5. package/dist/cjs/{code-block-c1d2e6a8.js → code-block-f1480ec3.js} +17 -17
  6. package/dist/cjs/{component-global-style-slimmer-adfa2e59.js → component-global-style-slimmer-93c5fb50.js} +2 -1
  7. package/dist/cjs/{component-usage-runtime-metrics-d10ace87.js → component-usage-runtime-metrics-4572c5b7.js} +1 -1
  8. package/dist/cjs/{component-value-history-controller-slimmer.abstract-787c67dc.js → component-value-history-controller-slimmer.abstract-a9264cc8.js} +5 -5
  9. package/dist/cjs/{create-public-api-runtime-metrics-slimmer-e2e274e1.js → create-public-api-runtime-metrics-slimmer-9cb09fb2.js} +3 -41
  10. package/dist/cjs/{dark-mode-style-controller-c21172aa.js → dark-mode-style-controller-3a04af3d.js} +292 -1254
  11. package/dist/cjs/{date-required-rule-30ee62d0.js → date-required-rule-912469e0.js} +1 -1
  12. package/dist/cjs/{design-token-bb39e07e.js → design-token-41baf118.js} +2 -2
  13. package/dist/cjs/dom-node-subject-observer-factory-c62823de.js +141 -0
  14. package/dist/cjs/{dto-renderer-manager-03e1a038.js → dto-renderer-manager-809c947b.js} +33 -33
  15. package/dist/cjs/{element-appender-slimmer-daa8b9f5.js → element-appender-slimmer-34e4eb56.js} +349 -166
  16. package/dist/cjs/{event-emit-slimmer-2dacabbd.js → event-emit-slimmer-062cdcb8.js} +2 -2
  17. package/dist/cjs/{feature-flag-controller-ce2162c8.js → feature-flag-controller-04cb1e69.js} +7 -1
  18. package/dist/cjs/{form-field-controller-slimmer-aef2fb1e.js → form-field-controller-slimmer-102f37c7.js} +13 -14
  19. package/dist/cjs/{internal-icon-manager-32f9ed63.js → icon-manager-c12c6ea9.js} +1 -52
  20. package/dist/cjs/{image-annotation-action-3fa501b7.js → image-annotation-action-8d9fa20c.js} +10 -9
  21. package/dist/cjs/index-592b4052.js +220 -0
  22. package/dist/cjs/{index-4d7bce1a.js → index-f054eb5d.js} +15 -3
  23. package/dist/cjs/index.cjs.js +68 -65
  24. package/dist/cjs/{inject-keyboard-manager-d21b4387.js → inject-keyboard-manager-0f5bd568.js} +1 -1
  25. package/dist/cjs/internal-icon-manager-c989189a.js +55 -0
  26. package/dist/cjs/{translation-5f9f9c0c.js → internal-translation-controller-053eb0f1.js} +0 -93
  27. package/dist/cjs/{internal-vega-event-manager-6befeb34.js → internal-vega-event-manager-f7ecf3d4.js} +81 -81
  28. package/dist/cjs/internal-vega-z-index-manager-f03ddb37.js +180 -0
  29. package/dist/cjs/{keyboard-manager-3dea6b28.js → keyboard-manager-055e9f67.js} +2 -2
  30. package/dist/cjs/{keyboard-manager-slimmer-0d45f944.js → keyboard-manager-slimmer-0cc0c1c7.js} +1 -1
  31. package/dist/cjs/loader.cjs.js +26 -23
  32. package/dist/cjs/misc-3d30df91.js +41 -0
  33. package/dist/cjs/{month-view-generator-49cc5fc2.js → month-view-generator-6a6dd527.js} +1 -1
  34. package/dist/cjs/{page-resize-observer-slimmer-11937d6f.js → page-resize-observer-slimmer-7f065ee1.js} +2 -54
  35. package/dist/cjs/{public-rules-dc2a8d62.js → public-rules-922849f3.js} +12 -13
  36. package/dist/cjs/{range-79b668e7.js → range-8aa49b08.js} +2 -2
  37. package/dist/cjs/{responsive-format-facade-d5dba942.js → responsive-format-facade-ea59bdcd.js} +13 -22
  38. package/dist/cjs/{rich-text-editor-required-rule-ba312af9.js → rich-text-editor-required-rule-22225840.js} +1 -1
  39. package/dist/cjs/{string-format-strategy.abstract-63514c60.js → string-format-strategy.abstract-f2575647.js} +1 -1
  40. package/dist/cjs/{string-input-formatter-slimmer-f3e0bbc7.js → string-input-formatter-slimmer-0a334fc6.js} +5 -5
  41. package/dist/cjs/{string-mask-strategy-d23ac21a.js → string-mask-strategy-dda58395.js} +2 -2
  42. package/dist/cjs/{style-formatter-49693da7.js → style-formatter-0c3ced39.js} +2 -2
  43. package/dist/cjs/{sub-state-notify-slimmer-468e19aa.js → sub-state-notify-slimmer-58121111.js} +1 -1
  44. package/dist/cjs/{sub-state-observer-slimmer-5d0b8ac3.js → sub-state-observer-slimmer-1dfbc4c3.js} +2 -2
  45. package/dist/cjs/{time-required-rule-c96ecdc9.js → time-required-rule-d6fa7aa8.js} +1 -1
  46. package/dist/cjs/{function-extension-cfbbc57e.js → token-extension-07cac85d.js} +501 -387
  47. package/dist/cjs/{translation-slimmer-f0ebe710.js → translation-slimmer-4533bd67.js} +4 -4
  48. package/dist/cjs/{type-guard-a0f026d8.js → type-guard-407ba0b8.js} +3 -3
  49. package/dist/cjs/{ui-9e181079.js → ui-234ea151.js} +12 -0
  50. package/dist/cjs/{valid-credit-card-number-rule-c854bed9.js → valid-credit-card-number-rule-41a8b51b.js} +1 -1
  51. package/dist/cjs/vega-accordion.cjs.entry.js +21 -30
  52. package/dist/cjs/vega-app-footer.cjs.entry.js +3 -3
  53. package/dist/cjs/vega-app-header-button.cjs.entry.js +183 -49
  54. package/dist/cjs/vega-backdrop.cjs.entry.js +2 -2
  55. package/dist/cjs/vega-banner.cjs.entry.js +15 -13
  56. package/dist/cjs/vega-bar-chart.cjs.entry.js +1 -1
  57. package/dist/cjs/vega-box.cjs.entry.js +18 -33
  58. package/dist/cjs/vega-brand-logo.cjs.entry.js +7 -5
  59. package/dist/cjs/vega-breadcrumb.cjs.entry.js +14 -13
  60. package/dist/cjs/vega-button-circle.cjs.entry.js +20 -30
  61. package/dist/cjs/vega-button-group_2.cjs.entry.js +15 -15
  62. package/dist/cjs/vega-button-link.cjs.entry.js +15 -14
  63. package/dist/cjs/vega-button.cjs.entry.js +21 -30
  64. package/dist/cjs/vega-calendar_4.cjs.entry.js +48 -45
  65. package/dist/cjs/vega-card.cjs.entry.js +9 -28
  66. package/dist/cjs/vega-carousel.cjs.entry.js +15 -26
  67. package/dist/cjs/vega-checkbox_2.cjs.entry.js +22 -20
  68. package/dist/cjs/vega-chip.cjs.entry.js +22 -33
  69. package/dist/cjs/vega-code-block.cjs.entry.js +658 -2709
  70. package/dist/cjs/vega-color-picker.cjs.entry.js +15 -12
  71. package/dist/cjs/vega-combo-box.cjs.entry.js +29 -28
  72. package/dist/cjs/vega-counter-badge.cjs.entry.js +1 -1
  73. package/dist/cjs/vega-date-picker_2.cjs.entry.js +53 -56
  74. package/dist/cjs/vega-dialog-controller-03ef4d9a.js +84 -0
  75. package/dist/cjs/vega-dialog_2.cjs.entry.js +37 -44
  76. package/dist/cjs/vega-divider.cjs.entry.js +12 -30
  77. package/dist/cjs/vega-dropdown_5.cjs.entry.js +49 -55
  78. package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
  79. package/dist/cjs/{dom-node-subject-observer-factory-b5e71bf6.js → vega-event-id-ee01d8dd.js} +0 -139
  80. package/dist/cjs/vega-field-error.cjs.entry.js +1 -1
  81. package/dist/cjs/vega-field-label.cjs.entry.js +9 -8
  82. package/dist/cjs/vega-file-uploader.cjs.entry.js +28 -23
  83. package/dist/cjs/vega-flag-icon.cjs.entry.js +13 -27
  84. package/dist/cjs/vega-flex.cjs.entry.js +11 -28
  85. package/dist/cjs/vega-font.cjs.entry.js +12 -29
  86. package/dist/cjs/vega-form.cjs.entry.js +24 -22
  87. package/dist/cjs/vega-grid.cjs.entry.js +9 -28
  88. package/dist/cjs/vega-hint.cjs.entry.js +1 -1
  89. package/dist/cjs/vega-icon.cjs.entry.js +18 -31
  90. package/dist/cjs/vega-image-uploader.cjs.entry.js +34 -37
  91. package/dist/cjs/vega-input-credit-card.cjs.entry.js +31 -27
  92. package/dist/cjs/vega-input-numeric.cjs.entry.js +24 -22
  93. package/dist/cjs/vega-input-passcode.cjs.entry.js +26 -24
  94. package/dist/cjs/vega-input-phone-number.cjs.entry.js +31 -35
  95. package/dist/cjs/vega-input-range.cjs.entry.js +22 -20
  96. package/dist/cjs/vega-input-select.cjs.entry.js +41 -46
  97. package/dist/cjs/vega-input.cjs.entry.js +43 -31
  98. package/dist/cjs/vega-item-toggle.cjs.entry.js +8 -7
  99. package/dist/cjs/vega-left-nav_5.cjs.entry.js +38 -40
  100. package/dist/cjs/vega-line-chart.cjs.entry.js +1 -1
  101. package/dist/cjs/vega-loader-wrapper_2.cjs.entry.js +16 -32
  102. package/dist/cjs/vega-page-notification_2.cjs.entry.js +5 -4
  103. package/dist/cjs/vega-pagination-page-selector-mobile.cjs.entry.js +12 -12
  104. package/dist/cjs/vega-pagination-page-size-selector-mobile.cjs.entry.js +9 -10
  105. package/dist/cjs/vega-pagination.cjs.entry.js +28 -38
  106. package/dist/cjs/vega-pie-chart.cjs.entry.js +1 -1
  107. package/dist/cjs/vega-popover_2.cjs.entry.js +21 -31
  108. package/dist/cjs/vega-progress-tracker_2.cjs.entry.js +66 -39
  109. package/dist/cjs/vega-radio_2.cjs.entry.js +25 -23
  110. package/dist/cjs/vega-rich-text-content.cjs.entry.js +22 -20
  111. package/dist/cjs/vega-rich-text-editor_4.cjs.entry.js +58 -55
  112. package/dist/cjs/vega-section-title.cjs.entry.js +1 -1
  113. package/dist/cjs/vega-segment-control.cjs.entry.js +10 -8
  114. package/dist/cjs/vega-selection-chip_2.cjs.entry.js +25 -32
  115. package/dist/cjs/vega-selection-tile_2.cjs.entry.js +22 -20
  116. package/dist/cjs/vega-sidenav_3.cjs.entry.js +34 -40
  117. package/dist/cjs/vega-signature-capture.cjs.entry.js +27 -31
  118. package/dist/cjs/vega-skeleton.cjs.entry.js +1 -1
  119. package/dist/cjs/vega-slot-container.cjs.entry.js +1 -1
  120. package/dist/cjs/vega-stepper.cjs.entry.js +23 -21
  121. package/dist/cjs/vega-tab-group_2.cjs.entry.js +15 -14
  122. package/dist/cjs/vega-table_11.cjs.entry.js +67 -68
  123. package/dist/cjs/vega-text.cjs.entry.js +4 -3
  124. package/dist/cjs/vega-textarea.cjs.entry.js +22 -20
  125. package/dist/cjs/vega-time-picker_2.cjs.entry.js +35 -41
  126. package/dist/cjs/vega-toggle-switch.cjs.entry.js +15 -12
  127. package/dist/cjs/vega-tooltip_2.cjs.entry.js +17 -28
  128. package/dist/cjs/vega.cjs.js +26 -23
  129. package/dist/cjs/{index-95fca64f.js → wait-for-component-did-render-70a01bf9.js} +1 -12
  130. package/dist/collection/components/vega-app-header-button/vega-app-header-button.js +17 -2
  131. package/dist/collection/components/vega-box/slimmers/controllers/vega-box-responsive-style-controller.js +2 -1
  132. package/dist/collection/components/vega-box/slimmers/controllers/vega-box-state-styles-controller.js +2 -1
  133. package/dist/collection/components/vega-button/vega-button.js +2 -1
  134. package/dist/collection/components/vega-button-circle/vega-button-circle.js +2 -1
  135. package/dist/collection/components/vega-button-link/vega-button-link.css +1 -1
  136. package/dist/collection/components/vega-button-link/vega-button-link.js +2 -1
  137. package/dist/collection/components/vega-calendar/slimmers/common/helpers/repeat-pattern/base-repeat-pattern.js +1 -1
  138. package/dist/collection/components/vega-calendar/slimmers/common/helpers/repeat-pattern/calendar-event-daily-repeat-pattern.js +1 -1
  139. package/dist/collection/components/vega-calendar/slimmers/common/helpers/repeat-pattern/calendar-event-monthly-repeat-pattern.js +1 -1
  140. package/dist/collection/components/vega-calendar/slimmers/common/helpers/repeat-pattern/calendar-event-weekly-repeat-pattern.js +1 -1
  141. package/dist/collection/components/vega-calendar/slimmers/common/helpers/repeat-pattern/calendar-event-yearly-repeat-pattern.js +1 -1
  142. package/dist/collection/components/vega-code-block/slimmers/controllers/prism-code-highlight-parse-controller.js +5 -14
  143. package/dist/collection/components/vega-combo-box/slimmers/renderers/vega-combo-box-dropdown-renderer.js +2 -2
  144. package/dist/collection/components/vega-date-picker/slimmers/controllers/vega-date-picker-calendar-open-state-controller.js +1 -1
  145. package/dist/collection/components/vega-date-picker/slimmers/renderers/vega-date-picker-calendar-renderer.js +1 -1
  146. package/dist/collection/components/vega-dropdown/slimmers/controllers/vega-dropdown-search-controller.js +2 -2
  147. package/dist/collection/components/vega-dropdown/slimmers/renderers/vega-dropdown-list-renderer.js +2 -2
  148. package/dist/collection/components/vega-dropdown/vega-dropdown-group/slimmers/renderers/vega-dropdown-group-renderer.js +3 -3
  149. package/dist/collection/components/vega-dropdown/vega-dropdown-item/slimmers/renderers/vega-dropdown-item-renderer.js +6 -4
  150. package/dist/collection/components/vega-icon/vega-icon.js +2 -1
  151. package/dist/collection/components/vega-input/slimmers/renderers/vega-input-input-container-renderer.js +10 -2
  152. package/dist/collection/components/vega-input-phone-number/slimmers/renderers/country-select-renderer.js +1 -1
  153. package/dist/collection/components/vega-input-select/slimmers/renderers/vega-input-select-dropdown-renderer.js +2 -2
  154. package/dist/collection/components/vega-pagination/vega-pagination.js +1 -1
  155. package/dist/collection/components/vega-progress-tracker/slimmers/controllers/dto/internal-progress-tracker-step.js +30 -6
  156. package/dist/collection/components/vega-progress-tracker/slimmers/controllers/vega-progress-tracker-current-steps-controller.js +1 -1
  157. package/dist/collection/components/vega-progress-tracker/slimmers/renderers/vega-progress-tracker-renderer.js +8 -1
  158. package/dist/collection/components/vega-progress-tracker/vega-progress-tracker-step/vega-progress-tracker-step.js +27 -0
  159. package/dist/collection/components/vega-progress-tracker/vega-progress-tracker.css +12 -0
  160. package/dist/collection/components/vega-progress-tracker/vega-progress-tracker.js +8 -3
  161. package/dist/collection/components/vega-rich-text-content/vega-rich-text-content.js +1 -1
  162. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/value-controller.js +1 -1
  163. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/link-toolbar-button-slimmer.js +1 -1
  164. package/dist/collection/components/vega-signature-capture/slimmers/written-mode/controllers/written-mode-svg-controller.js +2 -1
  165. package/dist/collection/components/vega-table/interface.js +3 -0
  166. package/dist/collection/components/vega-table/vega-table-foot-cell/slimmers/renderers/vega-table-foot-cell-renderer.js +1 -1
  167. package/dist/collection/global/scripts/before-vega-load.js +4 -3
  168. package/dist/collection/helpers/calendar/calendar-date.js +1 -1
  169. package/dist/collection/helpers/calendar/calendar-event.js +1 -1
  170. package/dist/collection/helpers/calendar/calendar-time.js +1 -1
  171. package/dist/collection/helpers/code-format/test/code-formatter.test.js +1 -1
  172. package/dist/collection/helpers/common/index.js +2 -37
  173. package/dist/collection/helpers/common/test/wait-for-vega-handler.test.js +2 -2
  174. package/dist/collection/helpers/common/wait-for-component-did-render.js +27 -0
  175. package/dist/collection/helpers/common/wait-for-vega-handler.js +12 -1
  176. package/dist/collection/helpers/feature-control/feature-flags-map.js +6 -0
  177. package/dist/collection/helpers/formatter/responsive-map-formatter/responsive-border-radius-style-formatter.js +1 -1
  178. package/dist/collection/helpers/public-api.js +0 -2
  179. package/dist/collection/helpers/slimmers/component-global-style-slimmer.js +2 -1
  180. package/dist/collection/helpers/slimmers/field-error-ui-controller-slimmer.js +3 -4
  181. package/dist/collection/helpers/slimmers/form-field-message-translator.js +1 -1
  182. package/dist/collection/helpers/slimmers/global/vega-translate-observer-slimmer.js +1 -1
  183. package/dist/collection/helpers/slimmers/global/vega-watch-method-cancel-slimmer.js +1 -1
  184. package/dist/collection/helpers/slimmers/mutation-observer/aria-attributes-value-mapper.js +128 -0
  185. package/dist/collection/helpers/slimmers/mutation-observer/test/aria-attributes-value-mapper.test.js +196 -0
  186. package/dist/collection/helpers/slimmers/position-calculation/base-position-calculation-strategy.js +162 -151
  187. package/dist/collection/helpers/slimmers/position-calculation/position-calculation-controller.js +9 -0
  188. package/dist/collection/helpers/slimmers/position-calculation/screen-position-calculation-strategy.js +112 -1
  189. package/dist/collection/helpers/slimmers/position-calculation/screen-scroll-position-update.js +53 -0
  190. package/dist/collection/helpers/slimmers/position-calculation/test/screen-position-calculation-strategy.test.js +103 -6
  191. package/dist/collection/helpers/slimmers/string-input-formatter-slimmer.js +1 -1
  192. package/dist/collection/helpers/slimmers/translation/translation-slimmer.js +1 -1
  193. package/dist/collection/helpers/theme/controllers/brand-style-controller.js +3 -1
  194. package/dist/collection/helpers/theme/controllers/color-schema-overriding-controller.js +8 -6
  195. package/dist/collection/helpers/theme/controllers/dark-mode-style-controller.js +3 -1
  196. package/dist/collection/helpers/theme/internal-theme-manager.js +2 -1
  197. package/dist/collection/helpers/theme/tests/theme-manager-controller.test.js +1 -2
  198. package/dist/collection/helpers/ui/element-appender.js +4 -5
  199. package/dist/collection/helpers/ui/test/element-appender.test.js +66 -17
  200. package/dist/collection/index.js +2 -0
  201. package/dist/collection/polyfill/prism/index.js +2 -0
  202. package/dist/collection/polyfill/prism/languages/css.js +86 -0
  203. package/dist/collection/polyfill/prism/languages/javascript.js +96 -0
  204. package/dist/collection/polyfill/prism/languages/jsx.js +46 -0
  205. package/dist/collection/polyfill/prism/languages/language-registry.js +41 -0
  206. package/dist/collection/polyfill/prism/languages/markup.js +71 -0
  207. package/dist/collection/polyfill/prism/languages/tsx.js +10 -0
  208. package/dist/collection/polyfill/prism/languages/typescript.js +64 -0
  209. package/dist/collection/polyfill/prism/test/css.test.js +61 -0
  210. package/dist/collection/polyfill/prism/test/javascript.test.js +113 -0
  211. package/dist/collection/polyfill/prism/test/jsx.test.js +48 -0
  212. package/dist/collection/polyfill/prism/test/language-registry.test.js +77 -0
  213. package/dist/collection/polyfill/prism/test/markup.test.js +57 -0
  214. package/dist/collection/polyfill/prism/test/test-utils.js +22 -0
  215. package/dist/collection/polyfill/prism/test/tokenizer.test.js +180 -0
  216. package/dist/collection/polyfill/prism/test/tsx.test.js +87 -0
  217. package/dist/collection/polyfill/prism/test/typescript.test.js +86 -0
  218. package/dist/collection/polyfill/prism/tokenizer.js +242 -0
  219. package/dist/collection/polyfill/tinycolor/tinycolor-polyfill.js +320 -0
  220. package/dist/collection/polyfill/tinycolor/tinycolor-polyfill.test.js +361 -0
  221. package/dist/collection/types/ui.type.js +12 -0
  222. package/dist/collection/utils/e2e-utils.js +10 -3
  223. package/dist/collection/utils/sanitize/constants/tag-sets.js +5 -0
  224. package/dist/collection/utils/sanitize/core/html-sanitizer.js +39 -0
  225. package/dist/collection/utils/sanitize/core/sanitize-strategy.js +62 -0
  226. package/dist/collection/utils/sanitize/core/types.js +4 -0
  227. package/dist/collection/utils/sanitize/index.js +12 -0
  228. package/dist/collection/utils/sanitize/strategies/empty-sanitize-strategy.js +17 -0
  229. package/dist/collection/utils/sanitize/strategies/index.js +3 -0
  230. package/dist/collection/utils/sanitize/strategies/label-sanitize-strategy.js +13 -0
  231. package/dist/collection/utils/sanitize/strategies/style-sanitize-strategy.js +50 -0
  232. package/dist/collection/utils/sanitize/test/empty-strategy.test.js +12 -0
  233. package/dist/collection/utils/sanitize/test/html-sanitizer.test.js +57 -0
  234. package/dist/collection/utils/sanitize/test/label-strategy.test.js +56 -0
  235. package/dist/collection/utils/sanitize/test/sanitize-strategy.test.js +85 -0
  236. package/dist/collection/utils/sanitize/test/sanitize.test.js +22 -0
  237. package/dist/collection/utils/sanitize/test/serialize-fragment.test.js +25 -0
  238. package/dist/collection/utils/sanitize/test/style-strategy.test.js +45 -0
  239. package/dist/collection/utils/sanitize/utils/serialize-fragment.js +17 -0
  240. package/dist/esm/{app-globals-2ac60ff5.js → app-globals-c0676920.js} +12 -16
  241. package/dist/esm/breakpoints-56e5407b.js +53 -0
  242. package/dist/esm/{child-nodes-event-prevent-slimmer-e662bee2.js → child-nodes-event-prevent-slimmer-649b9d30.js} +2 -2
  243. package/dist/esm/{child-nodes-notify-observer-slimmer-b676cd2b.js → child-nodes-notify-observer-slimmer-541dd6a4.js} +1 -1
  244. package/dist/esm/{code-block-8ee34ab6.js → code-block-b6247a45.js} +7 -7
  245. package/dist/esm/{component-global-style-slimmer-08046b38.js → component-global-style-slimmer-ac703085.js} +2 -1
  246. package/dist/esm/{component-usage-runtime-metrics-a84cc93e.js → component-usage-runtime-metrics-46020a03.js} +1 -1
  247. package/dist/esm/{component-value-history-controller-slimmer.abstract-a61bf821.js → component-value-history-controller-slimmer.abstract-2bb8533d.js} +6 -6
  248. package/dist/esm/{create-public-api-runtime-metrics-slimmer-bedf3a1e.js → create-public-api-runtime-metrics-slimmer-aaadaa08.js} +3 -38
  249. package/dist/esm/{dark-mode-style-controller-de88a117.js → dark-mode-style-controller-82e5c1c6.js} +292 -1254
  250. package/dist/esm/{date-required-rule-47ecc28f.js → date-required-rule-e771e7d9.js} +1 -1
  251. package/dist/esm/{design-token-007efbaa.js → design-token-4aee1c56.js} +2 -2
  252. package/dist/esm/dom-node-subject-observer-factory-82f346e3.js +138 -0
  253. package/dist/esm/{dto-renderer-manager-ee1a5864.js → dto-renderer-manager-6fd22ab7.js} +7 -7
  254. package/dist/esm/{element-appender-slimmer-35e26b5a.js → element-appender-slimmer-e4713a72.js} +348 -165
  255. package/dist/esm/{event-emit-slimmer-09827cec.js → event-emit-slimmer-ffaecb9a.js} +2 -2
  256. package/dist/esm/{feature-flag-controller-51659753.js → feature-flag-controller-09ea7e87.js} +7 -1
  257. package/dist/esm/{form-field-controller-slimmer-5d9dc384.js → form-field-controller-slimmer-5817d14d.js} +10 -11
  258. package/dist/esm/{internal-icon-manager-f0486245.js → icon-manager-539d7cf7.js} +2 -52
  259. package/dist/esm/{image-annotation-action-285d432e.js → image-annotation-action-6701b4c9.js} +6 -5
  260. package/dist/esm/index-3b327f29.js +215 -0
  261. package/dist/esm/{index-e9da316f.js → index-bfc6dfa2.js} +13 -1
  262. package/dist/esm/index.js +32 -29
  263. package/dist/esm/{inject-keyboard-manager-83d76ff5.js → inject-keyboard-manager-78730062.js} +1 -1
  264. package/dist/esm/internal-icon-manager-bd80b3bb.js +53 -0
  265. package/dist/esm/{translation-96e5debd.js → internal-translation-controller-911515f9.js} +1 -93
  266. package/dist/esm/{internal-vega-event-manager-efb6786e.js → internal-vega-event-manager-32a3d848.js} +1 -1
  267. package/dist/esm/internal-vega-z-index-manager-7d2b54c3.js +178 -0
  268. package/dist/esm/{keyboard-manager-c92808d8.js → keyboard-manager-38934f94.js} +2 -2
  269. package/dist/esm/{keyboard-manager-slimmer-79c78ce8.js → keyboard-manager-slimmer-9984d922.js} +1 -1
  270. package/dist/esm/loader.js +27 -24
  271. package/dist/esm/misc-9fdbcfbb.js +37 -0
  272. package/dist/esm/{month-view-generator-16192182.js → month-view-generator-eaf9029c.js} +1 -1
  273. package/dist/esm/{page-resize-observer-slimmer-8744cb44.js → page-resize-observer-slimmer-d6af0d86.js} +2 -52
  274. package/dist/esm/{public-rules-724873f5.js → public-rules-25cc3a39.js} +13 -14
  275. package/dist/esm/{range-5257c062.js → range-663f44dc.js} +2 -2
  276. package/dist/esm/{responsive-format-facade-28ee2dbd.js → responsive-format-facade-7a071174.js} +3 -12
  277. package/dist/esm/{rich-text-editor-required-rule-873e2e67.js → rich-text-editor-required-rule-a238b862.js} +1 -1
  278. package/dist/esm/{string-format-strategy.abstract-fc60db79.js → string-format-strategy.abstract-713fba36.js} +1 -1
  279. package/dist/esm/{string-input-formatter-slimmer-ee32b1fd.js → string-input-formatter-slimmer-5b413ff9.js} +4 -4
  280. package/dist/esm/{string-mask-strategy-0b0accaa.js → string-mask-strategy-6beaf664.js} +2 -2
  281. package/dist/esm/{style-formatter-314b37f3.js → style-formatter-3d06b72d.js} +2 -2
  282. package/dist/esm/{sub-state-notify-slimmer-4453047a.js → sub-state-notify-slimmer-5133f1a8.js} +2 -2
  283. package/dist/esm/{sub-state-observer-slimmer-202ec7dc.js → sub-state-observer-slimmer-478c9f41.js} +3 -3
  284. package/dist/esm/{time-required-rule-5fa43804.js → time-required-rule-e4138a76.js} +1 -1
  285. package/dist/esm/{function-extension-e8c0e43e.js → token-extension-e33fd151.js} +488 -376
  286. package/dist/esm/{translation-slimmer-c936cb1b.js → translation-slimmer-2394b173.js} +1 -1
  287. package/dist/esm/{type-guard-c65a227d.js → type-guard-f50e34d6.js} +1 -1
  288. package/dist/esm/{ui-bb99c0c2.js → ui-ee31416b.js} +12 -0
  289. package/dist/esm/{valid-credit-card-number-rule-666c415d.js → valid-credit-card-number-rule-22ce81db.js} +1 -1
  290. package/dist/esm/vega-accordion.entry.js +19 -28
  291. package/dist/esm/vega-app-footer.entry.js +3 -3
  292. package/dist/esm/vega-app-header-button.entry.js +174 -40
  293. package/dist/esm/vega-backdrop.entry.js +2 -2
  294. package/dist/esm/vega-banner.entry.js +12 -10
  295. package/dist/esm/vega-bar-chart.entry.js +1 -1
  296. package/dist/esm/vega-box.entry.js +14 -29
  297. package/dist/esm/vega-brand-logo.entry.js +7 -5
  298. package/dist/esm/vega-breadcrumb.entry.js +11 -10
  299. package/dist/esm/vega-button-circle.entry.js +19 -29
  300. package/dist/esm/vega-button-group_2.entry.js +12 -12
  301. package/dist/esm/vega-button-link.entry.js +13 -12
  302. package/dist/esm/vega-button.entry.js +19 -28
  303. package/dist/esm/vega-calendar_4.entry.js +23 -20
  304. package/dist/esm/vega-card.entry.js +9 -28
  305. package/dist/esm/vega-carousel.entry.js +14 -25
  306. package/dist/esm/vega-checkbox_2.entry.js +19 -17
  307. package/dist/esm/vega-chip.entry.js +18 -29
  308. package/dist/esm/vega-code-block.entry.js +653 -2704
  309. package/dist/esm/vega-color-picker.entry.js +15 -12
  310. package/dist/esm/vega-combo-box.entry.js +22 -21
  311. package/dist/esm/vega-counter-badge.entry.js +1 -1
  312. package/dist/esm/vega-date-picker_2.entry.js +34 -37
  313. package/dist/esm/vega-dialog-controller-bbb2fc52.js +82 -0
  314. package/dist/esm/vega-dialog_2.entry.js +23 -30
  315. package/dist/esm/vega-divider.entry.js +11 -29
  316. package/dist/esm/vega-dropdown_5.entry.js +39 -45
  317. package/dist/esm/vega-env-manager-8f8dc473.js +2 -2
  318. package/dist/esm/vega-event-id-38aa77a0.js +113 -0
  319. package/dist/esm/vega-field-error.entry.js +1 -1
  320. package/dist/esm/vega-field-label.entry.js +7 -6
  321. package/dist/esm/vega-file-uploader.entry.js +19 -14
  322. package/dist/esm/vega-flag-icon.entry.js +12 -26
  323. package/dist/esm/vega-flex.entry.js +11 -28
  324. package/dist/esm/vega-font.entry.js +11 -28
  325. package/dist/esm/vega-form.entry.js +20 -18
  326. package/dist/esm/vega-grid.entry.js +9 -28
  327. package/dist/esm/vega-hint.entry.js +1 -1
  328. package/dist/esm/vega-icon.entry.js +15 -28
  329. package/dist/esm/vega-image-uploader.entry.js +28 -31
  330. package/dist/esm/vega-input-credit-card.entry.js +25 -21
  331. package/dist/esm/vega-input-numeric.entry.js +21 -19
  332. package/dist/esm/vega-input-passcode.entry.js +20 -18
  333. package/dist/esm/vega-input-phone-number.entry.js +27 -31
  334. package/dist/esm/vega-input-range.entry.js +19 -17
  335. package/dist/esm/vega-input-select.entry.js +27 -32
  336. package/dist/esm/vega-input.entry.js +33 -21
  337. package/dist/esm/{vega-internal-event-id-4a06d705.js → vega-internal-event-id-799d012e.js} +1 -1
  338. package/dist/esm/vega-item-toggle.entry.js +6 -5
  339. package/dist/esm/vega-left-nav_5.entry.js +29 -31
  340. package/dist/esm/vega-line-chart.entry.js +1 -1
  341. package/dist/esm/vega-loader-wrapper_2.entry.js +13 -29
  342. package/dist/esm/vega-page-notification_2.entry.js +4 -3
  343. package/dist/esm/vega-pagination-page-selector-mobile.entry.js +9 -9
  344. package/dist/esm/vega-pagination-page-size-selector-mobile.entry.js +7 -8
  345. package/dist/esm/vega-pagination.entry.js +20 -30
  346. package/dist/esm/vega-pie-chart.entry.js +1 -1
  347. package/dist/esm/vega-popover_2.entry.js +20 -30
  348. package/dist/esm/vega-progress-tracker_2.entry.js +64 -37
  349. package/dist/esm/vega-radio_2.entry.js +21 -19
  350. package/dist/esm/vega-rich-text-content.entry.js +18 -16
  351. package/dist/esm/vega-rich-text-editor_4.entry.js +33 -30
  352. package/dist/esm/vega-section-title.entry.js +1 -1
  353. package/dist/esm/vega-segment-control.entry.js +9 -7
  354. package/dist/esm/vega-selection-chip_2.entry.js +22 -29
  355. package/dist/esm/vega-selection-tile_2.entry.js +19 -17
  356. package/dist/esm/vega-sidenav_3.entry.js +24 -30
  357. package/dist/esm/vega-signature-capture.entry.js +24 -28
  358. package/dist/esm/vega-skeleton.entry.js +1 -1
  359. package/dist/esm/vega-slot-container.entry.js +1 -1
  360. package/dist/esm/vega-stepper.entry.js +18 -16
  361. package/dist/esm/vega-tab-group_2.entry.js +11 -10
  362. package/dist/esm/vega-table_11.entry.js +28 -29
  363. package/dist/esm/vega-text.entry.js +4 -3
  364. package/dist/esm/vega-textarea.entry.js +18 -16
  365. package/dist/esm/vega-time-picker_2.entry.js +26 -32
  366. package/dist/esm/vega-toggle-switch.entry.js +15 -12
  367. package/dist/esm/vega-tooltip_2.entry.js +18 -29
  368. package/dist/esm/vega.js +27 -24
  369. package/dist/esm/{index-51a7da7f.js → wait-for-component-did-render-b08ef07b.js} +3 -13
  370. package/dist/sri/vega-sri-manifest.json +418 -406
  371. package/dist/types/components/vega-app-footer/types.d.ts +18 -0
  372. package/dist/types/components/vega-app-header-button/types.d.ts +31 -0
  373. package/dist/types/components/vega-app-header-button/vega-app-header-button.d.ts +2 -0
  374. package/dist/types/components/vega-banner/types.d.ts +9 -0
  375. package/dist/types/components/vega-box/interface.d.ts +46 -0
  376. package/dist/types/components/vega-breadcrumb/types.d.ts +28 -0
  377. package/dist/types/components/vega-button/types.d.ts +12 -0
  378. package/dist/types/components/vega-button-circle/types.d.ts +9 -0
  379. package/dist/types/components/vega-button-group/types.d.ts +48 -0
  380. package/dist/types/components/vega-button-link/types.d.ts +3 -0
  381. package/dist/types/components/vega-calendar/types.d.ts +189 -0
  382. package/dist/types/components/vega-calendar/vega-calendar-event-preview/types.d.ts +6 -0
  383. package/dist/types/components/vega-chart/vega-bar-chart/types.d.ts +3 -0
  384. package/dist/types/components/vega-chip/types.d.ts +12 -0
  385. package/dist/types/components/vega-code-block/slimmers/controllers/prism-code-highlight-parse-controller.d.ts +2 -10
  386. package/dist/types/components/vega-combo-box/types.d.ts +6 -0
  387. package/dist/types/components/vega-date-picker/types.d.ts +39 -0
  388. package/dist/types/components/vega-dialog/types.d.ts +5 -0
  389. package/dist/types/components/vega-divider/interface.d.ts +18 -0
  390. package/dist/types/components/vega-dropdown/types.d.ts +30 -0
  391. package/dist/types/components/vega-dropdown/vega-dropdown-item/types.d.ts +9 -1
  392. package/dist/types/components/vega-field-error/types.d.ts +12 -0
  393. package/dist/types/components/vega-field-label/types.d.ts +16 -0
  394. package/dist/types/components/vega-file-uploader/types.d.ts +12 -0
  395. package/dist/types/components/vega-font/types.d.ts +3 -0
  396. package/dist/types/components/vega-form/types.d.ts +45 -0
  397. package/dist/types/components/vega-image-uploader/types.d.ts +33 -1
  398. package/dist/types/components/vega-input/types.d.ts +31 -0
  399. package/dist/types/components/vega-input-phone-number/types.d.ts +15 -0
  400. package/dist/types/components/vega-input-range/types.d.ts +9 -0
  401. package/dist/types/components/vega-input-select/types.d.ts +45 -0
  402. package/dist/types/components/vega-item-toggle/types.d.ts +21 -0
  403. package/dist/types/components/vega-loading-indicator/types.d.ts +3 -0
  404. package/dist/types/components/vega-modal/types.d.ts +9 -0
  405. package/dist/types/components/vega-nav/interface.d.ts +108 -0
  406. package/dist/types/components/vega-page-notification/types.d.ts +15 -0
  407. package/dist/types/components/vega-pagination/types.d.ts +11 -0
  408. package/dist/types/components/vega-progress-tracker/slimmers/controllers/dto/internal-progress-tracker-step.d.ts +16 -4
  409. package/dist/types/components/vega-progress-tracker/type.d.ts +8 -0
  410. package/dist/types/components/vega-progress-tracker/vega-progress-tracker-step/vega-progress-tracker-step.d.ts +6 -0
  411. package/dist/types/components/vega-progress-tracker/vega-progress-tracker.d.ts +2 -2
  412. package/dist/types/components/vega-rich-text-editor/interface.d.ts +473 -2
  413. package/dist/types/components/vega-rich-text-editor/vega-rich-text-image-editor/types.d.ts +24 -0
  414. package/dist/types/components/vega-rich-text-editor/vega-rich-text-link-editor/types.d.ts +24 -0
  415. package/dist/types/components/vega-segment-control/types.d.ts +18 -0
  416. package/dist/types/components/vega-selection-chip/interface.d.ts +12 -0
  417. package/dist/types/components/vega-selection-chip/vega-selection-chip-group/interface.d.ts +4 -0
  418. package/dist/types/components/vega-selection-tile/interface.d.ts +9 -0
  419. package/dist/types/components/vega-sidenav/types.d.ts +51 -0
  420. package/dist/types/components/vega-signature-capture/types.d.ts +29 -2
  421. package/dist/types/components/vega-skeleton/interface.d.ts +6 -0
  422. package/dist/types/components/vega-tab-group/types.d.ts +36 -0
  423. package/dist/types/components/vega-table/interface.d.ts +237 -20
  424. package/dist/types/components/vega-table/vega-table-expand-row/types.d.ts +6 -0
  425. package/dist/types/components/vega-table/vega-table-foot/types.d.ts +9 -0
  426. package/dist/types/components/vega-table/vega-table-foot-row/types.d.ts +9 -0
  427. package/dist/types/components/vega-table/vega-table-head/types.d.ts +9 -0
  428. package/dist/types/components/vega-table/vega-table-head-row/types.d.ts +12 -0
  429. package/dist/types/components/vega-table/vega-table-row/types.d.ts +18 -0
  430. package/dist/types/components/vega-text/types.d.ts +6 -0
  431. package/dist/types/components/vega-time-picker/types.d.ts +33 -0
  432. package/dist/types/components/vega-virtual-scroll/types.d.ts +30 -1
  433. package/dist/types/components.d.ts +13 -3
  434. package/dist/types/helpers/common/index.d.ts +2 -15
  435. package/dist/types/helpers/common/wait-for-component-did-render.d.ts +8 -0
  436. package/dist/types/helpers/common/wait-for-vega-handler.d.ts +6 -15
  437. package/dist/types/helpers/feature-control/feature-flag.d.ts +2 -1
  438. package/dist/types/helpers/public-api.d.ts +0 -2
  439. package/dist/types/helpers/slimmers/mutation-observer/aria-attributes-value-mapper.d.ts +44 -0
  440. package/dist/types/helpers/slimmers/mutation-observer/test/aria-attributes-value-mapper.test.d.ts +1 -0
  441. package/dist/types/helpers/slimmers/position-calculation/base-position-calculation-strategy.d.ts +57 -48
  442. package/dist/types/helpers/slimmers/position-calculation/position-calculation-controller.d.ts +5 -0
  443. package/dist/types/helpers/slimmers/position-calculation/screen-position-calculation-strategy.d.ts +41 -1
  444. package/dist/types/helpers/slimmers/position-calculation/screen-scroll-position-update.d.ts +39 -0
  445. package/dist/types/helpers/ui/element-appender.d.ts +0 -1
  446. package/dist/types/index.d.ts +2 -0
  447. package/dist/types/polyfill/prism/index.d.ts +3 -0
  448. package/dist/types/polyfill/prism/languages/css.d.ts +6 -0
  449. package/dist/types/polyfill/prism/languages/javascript.d.ts +7 -0
  450. package/dist/types/polyfill/prism/languages/jsx.d.ts +7 -0
  451. package/dist/types/polyfill/prism/languages/language-registry.d.ts +8 -0
  452. package/dist/types/polyfill/prism/languages/markup.d.ts +6 -0
  453. package/dist/types/polyfill/prism/languages/tsx.d.ts +7 -0
  454. package/dist/types/polyfill/prism/languages/typescript.d.ts +2 -0
  455. package/dist/types/polyfill/prism/test/css.test.d.ts +1 -0
  456. package/dist/types/polyfill/prism/test/javascript.test.d.ts +1 -0
  457. package/dist/types/polyfill/prism/test/jsx.test.d.ts +1 -0
  458. package/dist/types/polyfill/prism/test/language-registry.test.d.ts +1 -0
  459. package/dist/types/polyfill/prism/test/markup.test.d.ts +1 -0
  460. package/dist/types/polyfill/prism/test/test-utils.d.ts +10 -0
  461. package/dist/types/polyfill/prism/test/tokenizer.test.d.ts +1 -0
  462. package/dist/types/polyfill/prism/test/tsx.test.d.ts +1 -0
  463. package/dist/types/polyfill/prism/test/typescript.test.d.ts +1 -0
  464. package/dist/types/polyfill/prism/tokenizer.d.ts +17 -0
  465. package/dist/types/polyfill/prism/types.d.ts +25 -0
  466. package/dist/types/polyfill/tinycolor/tinycolor-polyfill.d.ts +149 -0
  467. package/dist/types/polyfill/tinycolor/tinycolor-polyfill.test.d.ts +1 -0
  468. package/dist/types/types/components.type.d.ts +4 -1
  469. package/dist/types/types/design-token.type.d.ts +36 -0
  470. package/dist/types/types/flag.type.d.ts +3 -0
  471. package/dist/types/types/general.d.ts +12 -0
  472. package/dist/types/types/ui.type.d.ts +372 -0
  473. package/dist/types/types/vega-chart.d.ts +281 -2
  474. package/dist/types/utils/e2e-utils.d.ts +2 -0
  475. package/dist/types/utils/sanitize/constants/tag-sets.d.ts +6 -0
  476. package/dist/types/utils/sanitize/core/html-sanitizer.d.ts +22 -0
  477. package/dist/types/utils/sanitize/core/sanitize-strategy.d.ts +27 -0
  478. package/dist/types/utils/sanitize/core/types.d.ts +13 -0
  479. package/dist/types/utils/sanitize/index.d.ts +12 -0
  480. package/dist/types/utils/sanitize/strategies/empty-sanitize-strategy.d.ts +14 -0
  481. package/dist/types/utils/sanitize/strategies/index.d.ts +3 -0
  482. package/dist/types/utils/sanitize/strategies/label-sanitize-strategy.d.ts +10 -0
  483. package/dist/types/utils/sanitize/strategies/style-sanitize-strategy.d.ts +24 -0
  484. package/dist/types/utils/sanitize/test/empty-strategy.test.d.ts +1 -0
  485. package/dist/types/utils/sanitize/test/html-sanitizer.test.d.ts +1 -0
  486. package/dist/types/utils/sanitize/test/label-strategy.test.d.ts +1 -0
  487. package/dist/types/utils/sanitize/test/sanitize-strategy.test.d.ts +1 -0
  488. package/dist/types/utils/sanitize/test/sanitize.test.d.ts +1 -0
  489. package/dist/types/utils/sanitize/test/serialize-fragment.test.d.ts +1 -0
  490. package/dist/types/utils/sanitize/test/style-strategy.test.d.ts +1 -0
  491. package/dist/types/utils/sanitize/utils/serialize-fragment.d.ts +12 -0
  492. package/dist/vega/index.esm.js +1 -1
  493. package/dist/vega/p-01d58eb8.entry.js +1 -0
  494. package/dist/vega/p-021d4ae4.js +1 -0
  495. package/dist/vega/p-02a7d60c.entry.js +1 -0
  496. package/dist/vega/{p-66fa700b.js → p-02c9796a.js} +1 -1
  497. package/dist/vega/p-033c31d8.entry.js +1 -0
  498. package/dist/vega/{p-e77a83e4.js → p-07cb0243.js} +1 -1
  499. package/dist/vega/p-087ea379.entry.js +1 -0
  500. package/dist/vega/{p-e5af5a4d.entry.js → p-0b4880bd.entry.js} +1 -1
  501. package/dist/vega/{p-920719ad.js → p-0e679d8c.js} +1 -1
  502. package/dist/vega/{p-c9b6b5a9.js → p-10734a00.js} +1 -1
  503. package/dist/vega/p-154f9cf7.entry.js +1 -0
  504. package/dist/vega/p-179aad4f.entry.js +1 -0
  505. package/dist/vega/p-1a3236e7.entry.js +1 -0
  506. package/dist/vega/p-1f3cd061.entry.js +1 -0
  507. package/dist/vega/p-1f5e35dc.entry.js +1 -0
  508. package/dist/vega/p-242fbcad.entry.js +1 -0
  509. package/dist/vega/p-249df6d2.entry.js +1 -0
  510. package/dist/vega/p-28ad1864.entry.js +1 -0
  511. package/dist/vega/p-2a10e2e5.js +1 -0
  512. package/dist/vega/p-2b49686d.entry.js +1 -0
  513. package/dist/vega/p-2ba78982.entry.js +1 -0
  514. package/dist/vega/p-2bb5a232.js +1 -0
  515. package/dist/vega/{p-e9b86dac.entry.js → p-2c1a85dd.entry.js} +1 -1
  516. package/dist/vega/p-2cc9d126.entry.js +1 -0
  517. package/dist/vega/p-2d69632d.js +1 -0
  518. package/dist/vega/p-2e91295d.entry.js +1 -0
  519. package/dist/vega/p-31ac7386.js +1 -0
  520. package/dist/vega/p-32033e7a.js +1 -0
  521. package/dist/vega/p-32183637.entry.js +1 -0
  522. package/dist/vega/p-3244c605.entry.js +1 -0
  523. package/dist/vega/p-32faa460.entry.js +1 -0
  524. package/dist/vega/p-33f9ad94.entry.js +1 -0
  525. package/dist/vega/{p-4897bedd.entry.js → p-358b4a06.entry.js} +1 -1
  526. package/dist/vega/p-3afc025e.entry.js +1 -0
  527. package/dist/vega/p-3d8122ab.entry.js +1 -0
  528. package/dist/vega/{p-ea04a387.entry.js → p-3f3c771a.entry.js} +1 -1
  529. package/dist/vega/{p-1f83cebf.js → p-415ffa35.js} +1 -1
  530. package/dist/vega/{p-d849e0f5.js → p-4415ad28.js} +1 -1
  531. package/dist/vega/{p-0575d22e.js → p-464559e3.js} +1 -1
  532. package/dist/vega/p-49845a91.js +1 -0
  533. package/dist/vega/{p-e16b3adf.js → p-4bffdb28.js} +1 -1
  534. package/dist/vega/p-4e017458.entry.js +1 -0
  535. package/dist/vega/p-4e4a0228.entry.js +1 -0
  536. package/dist/vega/{p-a2aeb646.js → p-4ea30592.js} +1 -1
  537. package/dist/vega/{p-0b38a01f.entry.js → p-51fcb07f.entry.js} +1 -1
  538. package/dist/vega/p-57927b10.entry.js +1 -0
  539. package/dist/vega/p-5831d6d3.entry.js +1 -0
  540. package/dist/vega/p-593e0f80.js +1 -0
  541. package/dist/vega/p-5a25014f.js +1 -0
  542. package/dist/vega/p-5eb7f382.js +1 -0
  543. package/dist/vega/p-5f377954.js +1 -1
  544. package/dist/vega/p-644f701a.js +1 -0
  545. package/dist/vega/p-6a62e476.entry.js +1 -0
  546. package/dist/vega/{p-75f981ce.js → p-6b6f0fb4.js} +1 -1
  547. package/dist/vega/p-6d219c44.entry.js +1 -0
  548. package/dist/vega/p-6d60b66a.entry.js +1 -0
  549. package/dist/vega/{p-ad2055f4.entry.js → p-6dcdb580.entry.js} +1 -1
  550. package/dist/vega/{p-691ba1ae.js → p-7181861a.js} +1 -1
  551. package/dist/vega/p-76181a70.entry.js +1 -0
  552. package/dist/vega/p-781fd6e0.js +1 -0
  553. package/dist/vega/p-7958614a.entry.js +1 -0
  554. package/dist/vega/{p-5b71c85e.js → p-7c39ce96.js} +1 -1
  555. package/dist/vega/p-7d7aaff9.entry.js +1 -0
  556. package/dist/vega/{p-4dd6554e.entry.js → p-7f46cc1e.entry.js} +1 -1
  557. package/dist/vega/{p-badad9ed.js → p-81b044b9.js} +1 -1
  558. package/dist/vega/p-8950987b.entry.js +1 -0
  559. package/dist/vega/p-89f2e16d.entry.js +1 -0
  560. package/dist/vega/p-8ac2d165.js +1 -0
  561. package/dist/vega/p-8b153acd.entry.js +1 -0
  562. package/dist/vega/p-8b5d3a52.js +1 -0
  563. package/dist/vega/{p-fff13ed1.entry.js → p-8b891f36.entry.js} +1 -1
  564. package/dist/vega/p-8dbdd609.entry.js +1 -0
  565. package/dist/vega/{p-dd11f735.js → p-9339c6c4.js} +1 -1
  566. package/dist/vega/p-94a77fbe.entry.js +1 -0
  567. package/dist/vega/p-95528b47.js +1 -0
  568. package/dist/vega/p-9a137bab.entry.js +1 -0
  569. package/dist/vega/{p-6f8be8ea.js → p-a0b66c25.js} +1 -1
  570. package/dist/vega/{p-0bb3be0b.entry.js → p-a13a73fa.entry.js} +1 -1
  571. package/dist/vega/p-a560d8c5.entry.js +1 -0
  572. package/dist/vega/{p-d0e31633.js → p-a786259a.js} +1 -1
  573. package/dist/vega/p-a7a8a4eb.entry.js +1 -0
  574. package/dist/vega/p-a8792e3d.js +1 -0
  575. package/dist/vega/{p-60851f9d.js → p-aa1174dc.js} +1 -1
  576. package/dist/vega/p-ab834f06.js +1 -0
  577. package/dist/vega/p-b136ebba.entry.js +1 -0
  578. package/dist/vega/p-b201f379.js +1 -0
  579. package/dist/vega/p-b256b7a4.js +1 -0
  580. package/dist/vega/p-b366deff.entry.js +1 -0
  581. package/dist/vega/p-b597393b.entry.js +1 -0
  582. package/dist/vega/p-b7f3221f.js +1 -0
  583. package/dist/vega/p-bb5e0192.entry.js +1 -0
  584. package/dist/vega/p-be1a210b.js +1 -0
  585. package/dist/vega/p-bebfbe95.entry.js +1 -0
  586. package/dist/vega/p-bf6fc19f.entry.js +1 -0
  587. package/dist/vega/p-c1d13eec.entry.js +1 -0
  588. package/dist/vega/p-c29068fb.entry.js +1 -0
  589. package/dist/vega/p-c3d2f316.js +1 -0
  590. package/dist/vega/{p-671afda4.entry.js → p-c72e08c6.entry.js} +1 -1
  591. package/dist/vega/p-c801c85d.js +1 -0
  592. package/dist/vega/p-c8feb644.entry.js +1 -0
  593. package/dist/vega/p-ca5898dc.entry.js +1 -0
  594. package/dist/vega/p-d555f677.entry.js +1 -0
  595. package/dist/vega/p-d64fab3d.js +1 -0
  596. package/dist/vega/p-d6dbbe61.entry.js +1 -0
  597. package/dist/vega/p-d7a78c5e.entry.js +1 -0
  598. package/dist/vega/p-d8fadcdc.entry.js +1 -0
  599. package/dist/vega/p-dad3ba5f.js +1 -0
  600. package/dist/vega/p-dd3a94f4.entry.js +1 -0
  601. package/dist/vega/p-e1431c14.entry.js +1 -0
  602. package/dist/vega/p-e1fbfd20.js +1 -0
  603. package/dist/vega/p-e2af0e24.entry.js +1 -0
  604. package/dist/vega/{p-521d1d07.js → p-e52890db.js} +1 -1
  605. package/dist/vega/{p-1298b126.js → p-e632475e.js} +1 -1
  606. package/dist/vega/p-e6adf829.js +1 -0
  607. package/dist/vega/{p-77edf50c.js → p-e827d56d.js} +1 -1
  608. package/dist/vega/p-e8775a56.entry.js +1 -0
  609. package/dist/vega/p-e89e3ede.entry.js +1 -0
  610. package/dist/vega/p-eda988d5.entry.js +1 -0
  611. package/dist/vega/p-f05b8f76.entry.js +1 -0
  612. package/dist/vega/p-f0e828d8.js +1 -0
  613. package/dist/vega/p-f14a5eae.entry.js +1 -0
  614. package/dist/vega/p-f2b0b58a.js +1 -0
  615. package/dist/vega/p-f3d0f2dc.js +1 -0
  616. package/dist/vega/{p-5910be31.entry.js → p-f5bafc45.entry.js} +1 -1
  617. package/dist/vega/p-fc1fa345.js +1 -0
  618. package/dist/vega/p-fd7ddd64.entry.js +1 -0
  619. package/dist/vega/vega.esm.js +1 -1
  620. package/package.json +3 -5
  621. package/dist/cjs/_commonjsHelpers-537d719a.js +0 -20
  622. package/dist/cjs/language-extension-8c4a56ff.js +0 -210
  623. package/dist/cjs/sanitize-fb222510.js +0 -131
  624. package/dist/cjs/wait-for-vega-handler-5469ff80.js +0 -63
  625. package/dist/collection/utils/sanitize.js +0 -126
  626. package/dist/collection/utils/test/sanitize.test.js +0 -65
  627. package/dist/esm/_commonjsHelpers-9943807e.js +0 -17
  628. package/dist/esm/dom-node-subject-observer-factory-064ee2b2.js +0 -250
  629. package/dist/esm/language-extension-29bf8acd.js +0 -207
  630. package/dist/esm/sanitize-fd0cb40d.js +0 -129
  631. package/dist/esm/wait-for-vega-handler-c2c07ac3.js +0 -61
  632. package/dist/types/utils/sanitize.d.ts +0 -71
  633. package/dist/vega/p-011b94b1.entry.js +0 -1
  634. package/dist/vega/p-012753b5.entry.js +0 -1
  635. package/dist/vega/p-024331ce.entry.js +0 -1
  636. package/dist/vega/p-08a90cc6.entry.js +0 -1
  637. package/dist/vega/p-0ede1fea.entry.js +0 -1
  638. package/dist/vega/p-10ac8b57.js +0 -1
  639. package/dist/vega/p-112455b1.js +0 -1
  640. package/dist/vega/p-17c55205.entry.js +0 -1
  641. package/dist/vega/p-1e0d8228.entry.js +0 -1
  642. package/dist/vega/p-3353b3d7.js +0 -1
  643. package/dist/vega/p-365b1b35.entry.js +0 -1
  644. package/dist/vega/p-3ae9ee3d.entry.js +0 -1
  645. package/dist/vega/p-3af92370.entry.js +0 -1
  646. package/dist/vega/p-3bf66be2.js +0 -1
  647. package/dist/vega/p-3c5a28e4.entry.js +0 -1
  648. package/dist/vega/p-3e5f362f.js +0 -1
  649. package/dist/vega/p-430be941.js +0 -1
  650. package/dist/vega/p-43f585f7.entry.js +0 -1
  651. package/dist/vega/p-45296fd4.entry.js +0 -1
  652. package/dist/vega/p-476a173a.js +0 -1
  653. package/dist/vega/p-491618a6.entry.js +0 -1
  654. package/dist/vega/p-4a537391.entry.js +0 -1
  655. package/dist/vega/p-4aa893ef.entry.js +0 -1
  656. package/dist/vega/p-4c47e8bb.entry.js +0 -1
  657. package/dist/vega/p-4da75f2b.js +0 -1
  658. package/dist/vega/p-509eb52e.entry.js +0 -1
  659. package/dist/vega/p-5110ba73.entry.js +0 -1
  660. package/dist/vega/p-556f9a21.entry.js +0 -1
  661. package/dist/vega/p-55b54ba0.entry.js +0 -1
  662. package/dist/vega/p-5d676a94.js +0 -1
  663. package/dist/vega/p-5ea2e43c.entry.js +0 -1
  664. package/dist/vega/p-5efc6fe1.entry.js +0 -1
  665. package/dist/vega/p-64cd1931.entry.js +0 -1
  666. package/dist/vega/p-67fcf6f2.entry.js +0 -9
  667. package/dist/vega/p-68df4288.js +0 -1
  668. package/dist/vega/p-6a2205a1.entry.js +0 -1
  669. package/dist/vega/p-6a4277df.entry.js +0 -1
  670. package/dist/vega/p-6e136980.js +0 -1
  671. package/dist/vega/p-6fa8e231.entry.js +0 -1
  672. package/dist/vega/p-7045e84c.entry.js +0 -1
  673. package/dist/vega/p-7288f8c4.js +0 -1
  674. package/dist/vega/p-749f96a4.js +0 -1
  675. package/dist/vega/p-7aaece55.entry.js +0 -1
  676. package/dist/vega/p-7ec6a104.entry.js +0 -1
  677. package/dist/vega/p-81134e9e.entry.js +0 -1
  678. package/dist/vega/p-89d685a8.js +0 -1
  679. package/dist/vega/p-8c0eb12f.entry.js +0 -1
  680. package/dist/vega/p-8c9ea6f4.js +0 -1
  681. package/dist/vega/p-8d0ca805.js +0 -1
  682. package/dist/vega/p-8d701832.entry.js +0 -1
  683. package/dist/vega/p-8e42a14c.entry.js +0 -1
  684. package/dist/vega/p-8ed0faa2.entry.js +0 -1
  685. package/dist/vega/p-94394df7.entry.js +0 -1
  686. package/dist/vega/p-99aa554b.entry.js +0 -1
  687. package/dist/vega/p-9a2446f1.entry.js +0 -1
  688. package/dist/vega/p-9fd503e9.entry.js +0 -1
  689. package/dist/vega/p-a4670e23.js +0 -1
  690. package/dist/vega/p-a475d525.entry.js +0 -1
  691. package/dist/vega/p-a530797f.entry.js +0 -1
  692. package/dist/vega/p-a85ad369.entry.js +0 -1
  693. package/dist/vega/p-ac5e9955.entry.js +0 -1
  694. package/dist/vega/p-aedf7146.js +0 -1
  695. package/dist/vega/p-b1f869fb.js +0 -1
  696. package/dist/vega/p-b4ea3fad.js +0 -1
  697. package/dist/vega/p-bb4a558d.entry.js +0 -1
  698. package/dist/vega/p-bb8339ed.entry.js +0 -1
  699. package/dist/vega/p-be930e85.entry.js +0 -1
  700. package/dist/vega/p-bf2bd6d0.entry.js +0 -1
  701. package/dist/vega/p-c2488ed6.js +0 -1
  702. package/dist/vega/p-c379a5a5.entry.js +0 -1
  703. package/dist/vega/p-c616c592.js +0 -1
  704. package/dist/vega/p-ca3472c1.entry.js +0 -1
  705. package/dist/vega/p-cc43bffb.js +0 -1
  706. package/dist/vega/p-cf5b80f9.entry.js +0 -1
  707. package/dist/vega/p-db60a38e.entry.js +0 -1
  708. package/dist/vega/p-db8cdba6.js +0 -1
  709. package/dist/vega/p-e93545fd.js +0 -1
  710. package/dist/vega/p-e9c4fd24.entry.js +0 -1
  711. package/dist/vega/p-eb60cfe1.entry.js +0 -1
  712. package/dist/vega/p-ec192283.entry.js +0 -1
  713. package/dist/vega/p-ef9cbad1.js +0 -1
  714. package/dist/vega/p-f2a3a1ec.entry.js +0 -1
  715. package/dist/vega/p-f2cdd212.entry.js +0 -1
  716. package/dist/vega/p-f3c3ff26.entry.js +0 -1
  717. package/dist/vega/p-f4c05b4a.entry.js +0 -1
  718. package/dist/vega/p-f52a0155.entry.js +0 -1
  719. package/dist/vega/p-f69f84a7.js +0 -1
  720. package/dist/vega/p-f8641214.entry.js +0 -1
  721. package/dist/vega/p-f89443aa.entry.js +0 -1
  722. package/dist/vega/p-f8f7cf48.entry.js +0 -1
  723. package/dist/vega/p-fe12eff6.js +0 -1
  724. /package/dist/{types/utils/test/sanitize.test.d.ts → collection/polyfill/prism/types.js} +0 -0
  725. /package/dist/vega/{p-d9671d27.js → p-6c170474.js} +0 -0
@@ -1 +1 @@
1
- import{C as t}from"./p-2d0d575f.js";import{d as e}from"./p-8d0ca805.js";import{b as s,c as n}from"./p-5b71c85e.js";import{c as r}from"./p-02841589.js";import{L as i}from"./p-6e1ab235.js";import{i as o}from"./p-1f83cebf.js";import{g as c}from"./p-a4670e23.js";import{V as a}from"./p-ef9cbad1.js";import{c as l}from"./p-bf19682d.js";import{f as h}from"./p-d9671d27.js";var u,d;!function(t){t.SELECTION_RANGE="SELECTION_RANGE",t.CLEAR_FORMATTING="CLEAR_FORMATTING",t.LINK_GROUP="LINK_GROUP"}(u||(u={}));class p{}!function(t){t.ALIGNMENT="ALIGNMENT",t.TEXT_STYLE="TEXT_STYLE",t.INDENT="INDENT",t.LIST="LIST",t.INTERNAL_WRAPPER="INTERNAL_WRAPPER"}(d||(d={}));class f extends p{}const T=new class{constructor(){this.domToEntity=new WeakMap,this.entityToDOM=new WeakMap,this.contentEntityToRootDom=new Map,this.rootDomToContentEntity=new WeakMap}register(t,e){this.isVegaRTEContent(e)?this.registerRootDomAndContentEntity(t,e):(this.domToEntity.set(t,e),this.entityToDOM.set(e,t))}getEntityByDOM(t){return this.domToEntity.get(t)}getDOMByEntity(t){return this.isVegaRTEContent(t)?this.contentEntityToRootDom.get(t):this.entityToDOM.get(t)}removeDirtyDomRef(t){this.domToEntity.delete(t)}registerRootDomAndContentEntity(t,e){const s=this.rootDomToContentEntity.get(t);s&&s!==e&&this.contentEntityToRootDom.delete(s),this.rootDomToContentEntity.set(t,e),this.contentEntityToRootDom.set(e,t)}isVegaRTEContent(t){return t&&"VegaRTEContent"===t.constructor.name}};var x,E,g,w;!function(t){t.DELETE_CHILDREN="DELETE_CHILDREN",t.DELETE_NEST_LIST="DELETE_NEST_LIST",t.UPDATE_TEXT="UPDATE_TEXT",t.REPLACE_SELECTED_TEXT="REPLACE_SELECTED_TEXT",t.APPEND_CHILDREN="APPEND_CHILDREN",t.INSERT_CHILDREN_AFTER="INSERT_CHILDREN_AFTER",t.INSERT_CHILDREN_BEFORE="INSERT_CHILDREN_BEFORE",t.SPLIT_BLOCK_WITH_NODE="SPLIT_BLOCK_WITH_NODE",t.REPLACE_CHILD_NODES="REPLACE_CHILD_NODES",t.REPLACE_NEST_LIST="REPLACE_NEST_LIST",t.MERGE_TWO_BLOCKS_NODES="MERGE_TWO_BLOCKS_NODES",t.INSERT_NEW_PARAGRAPH="INSERT_NEW_PARAGRAPH",t.LINE_BREAK_SINGLE_BLOCK="LINE_BREAK_SINGLE_BLOCK",t.LINE_BREAK_MULTIPLE_BLOCKS="LINE_BREAK_MULTIPLE_BLOCKS",t.TRANSFORM_LIST_BLOCK="TRANSFORM_LIST_BLOCK",t.TRANSFORM_PARAGRAPH_BLOCK="TRANSFORM_PARAGRAPH_BLOCK",t.DELETE_BLOCK_CONTENT="DELETE_BLOCK_CONTENT",t.INSERT_IMAGE_TO_BLOCK="INSERT_IMAGE_TO_BLOCK",t.UPDATE_IMAGE_NODE_URL="UPDATE_IMAGE_NODE_URL",t.TRANSFORM_TO_CODE_BLOCK="TRANSFORM_TO_CODE_BLOCK",t.UPDATE_CODE_BLOCK="UPDATE_CODE_BLOCK",t.SWITCH_OUT_FROM_CODE_BLOCK="SWITCH_OUT_FROM_CODE_BLOCK",t.DELETE_CODE_BLOCK="DELETE_CODE_BLOCK",t.UNLINK_LINK_GROUP="UNLINK_LINK_GROUP",t.LINK_GROUP_NODE_SPLIT="LINK_GROUP_NODE_SPLIT",t.DELETE_LINK_GROUP="DELETE_LINK_GROUP",t.UPDATE_CURSOR_POSITION="UPDATE_CURSOR_POSITION",t.INSERT_TEXT_TO_DECORATOR_NODE="INSERT_TEXT_TO_DECORATOR_NODE",t.INSERT_NODE_TO_NEAREST_ROOT="INSERT_NODE_TO_NEAREST_ROOT",t.PASTE_CONTENT="PASTE_CONTENT"}(x||(x={}));class m{constructor(){this.isFlushable=!1}}class A extends p{constructor(t){super(),this.type=u.LINK_GROUP,this.linkGroups=new Map,this.linkGroups=new Map([[t,[]]])}clone(){const t=new A("");return this.linkGroups.forEach(((e,s)=>{t.linkGroups.set(s,e.map((t=>t.clone(t.parent))))})),t}toString(t,e){const s=this.toJsx(t,e);return Object.entries(s).map((([t,e])=>{const s="string"==typeof e?e:this.formatStyleToString(e);return`${r(t)}="${s}"`})).join(" ")}toJsx(t,e){const s=this.getStyle(t,e),n=this.getClass(t,e),r=this.getAttribute(t);return n.length>0&&(r.class=n.join(" ")),s&&Object.keys(s).length>0&&(r.style=s),r}getClass(t,e){const s=[];return t.link.customClass&&s.push(...t.link.customClass),!(null==e?void 0:e.standalone)&&t.useInternalStyle&&s.push("v-rte--link"),s}getStyle(t,e){const s={};return t.link.customStyle&&Object.assign(s,t.link.customStyle),(null==e?void 0:e.standalone)&&t.useInternalStyle&&(s.color="rgba(var(--v-text-link, 19, 98, 226, 1))"),s}getAttribute(t){const{href:e,customAttribute:s={}}=t.link,n=t.useInternalStyle,r=s.target||(n?"_blank":"");return Object.assign(Object.assign(Object.assign({},s),e||n?{href:e}:{}),r?{target:r}:{})}formatStyleToString(t){return Object.entries(t).map((([t,e])=>`${r(t)}: ${e};`)).join(" ")}}class O extends f{constructor(t){super(),this.type=d.ALIGNMENT,this.textAlign=t}static from(t){return[d.ALIGNMENT,new O(t)]}toJSON(){return{textAlign:this.textAlign}}renderClass(t){if(null==t?void 0:t.standalone)return null;switch(this.textAlign){case"right":case"center":case"justify":return`v-rte--horizontal-alignment-${this.textAlign}`;case"left":default:return"v-rte--horizontal-alignment-left"}}clone(){return new O(this.textAlign)}renderStyle(t){if(!(null==t?void 0:t.standalone))return null;switch(this.textAlign){case"right":case"center":case"justify":return{textAlign:this.textAlign};case"left":default:return{textAlign:"left"}}}}class N extends f{constructor(t){super(),this.type=d.INDENT,this.indent=Math.max(0,t)}static from(t){return[d.INDENT,new N(t)]}toJSON(){return this.indent>0?{indent:this.indent}:null}clone(){return new N(this.indent)}renderClass(){return null}renderStyle(){return this.indent>0?{marginLeft:16*this.indent+"px"}:null}}class R{static register(t,e,s){this.registry.has(e)||this.registry.set(e,new Map),this.registry.get(e).has(t)||this.registry.get(e).set(t,new Set),this.registry.get(e).get(t).add(s)}static unregister(t,e,s){const n=this.registry.get(e);if(n){const e=n.get(t);e&&e.delete(s)}}static get(t,e){const s=t instanceof m?t.type:t.constructor.name,n=this.registry.get(e.constructor.name);if(n){const r=n.get(s);if(r&&r.size>0)return Array.from(r).find((s=>s.canIntercept(t,e)))}}}R.registry=new Map;class y{static register(t,e,s){this.registry.has(e)||this.registry.set(e,new Map),this.registry.get(e).set(t,s)}static unregister(t,e){const s=this.registry.get(e);s&&s.delete(t)}static get(t,e){const s=this.registry.get(e);if(s)return s.get(t)}static executeTheStrategy(t,e){const s=R.get(t,e),n=()=>{const s=t instanceof m?t.type:t.constructor.name,n=y.get(s,e.constructor.name);if(n)return t.executedFlag=!0,n.execute(t,e);i.warn(`Type ${s} action handle strategy is not registered in class ${e.constructor.name}`)};return s?s.intercept(n,t,e):n()}static canHandle(t,e){return!!y.get(t,e.constructor.name)}}y.registry=new Map,function(t){t.CUSTOM_ATTRIBUTE="CUSTOM_ATTRIBUTE",t.CUSTOM_CLASS="CUSTOM_CLASS",t.CUSTOM_STYLE="CUSTOM_STYLE"}(E||(E={}));class S extends p{}class C extends S{constructor(t){super(),this.type=E.CUSTOM_ATTRIBUTE,this.BOOLEAN_ATTRS=new Set(["controls","disabled","checked","readonly","multiple","required","autoplay","muted"]),this.customAttribute=t}static from(t){return[E.CUSTOM_ATTRIBUTE,new C(t)]}toJSON(){return{customAttribute:this.customAttribute}}clone(){return new C(this.customAttribute)}toString(t=[]){const e=t.map((t=>t.split("=")[0]));return Object.keys(this.customAttribute).map((t=>e.includes(t)?null:`${t}="${this.customAttribute[t]}"`)).filter(o)}render(t={}){var e;const s=Object.assign({},this.customAttribute);return null===(e=t.filterAttributes)||void 0===e||e.forEach((t=>delete s[t])),Object.keys(s).forEach((t=>{this.BOOLEAN_ATTRS.has(t)&&""===s[t]&&(s[t]="true")})),s}}class b extends S{constructor(t){super(),this.type=E.CUSTOM_CLASS,this.customClass=t}static from(t){return[E.CUSTOM_CLASS,new b(t)]}toJSON(){return{customClass:this.customClass}}clone(){return new b(this.customClass)}toString(){return`class="${this.customClass.join(" ")}"`}renderClass(){return this.customClass}}class k extends S{constructor(t){super(),this.type=E.CUSTOM_STYLE,this.customStyle=t}static from(t){return[E.CUSTOM_STYLE,new k(t)]}toJSON(){return{customStyle:this.customStyle}}clone(){return new k(this.customStyle)}renderStyle(){return this.customStyle}removeStyles(t){const e=Object.assign({},this.customStyle);return t.forEach((t=>delete e[t])),e}toString(){return`style="${Object.entries(this.customStyle).map((([t,e])=>`${t}: ${e};`)).join(" ")}"`}}class B extends f{constructor(t){super(),this.type=d.INTERNAL_WRAPPER,this.internalWrapper=t}static from(t){return[d.INTERNAL_WRAPPER,new B(t)]}clone(){return new B(this.internalWrapper)}renderClass(){}renderStyle(){}toJSON(){return this.internalWrapper?{internalWrapper:this.internalWrapper}:void 0}}!function(t){t.BOLD="BOLD",t.ITALIC="ITALIC",t.UNDERLINE="UNDERLINE",t.STRIKETHROUGH="STRIKETHROUGH",t.SELECTION_RANGE="SELECTION_RANGE",t.IMAGE="IMAGE",t.CODE="CODE",t.TEXT_COLOR="TEXT_COLOR",t.LINK="LINK",t.INLINE_HTML="INLINE_HTML",t.PLAIN_TEXT="PLAIN_TEXT"}(g||(g={}));class v extends p{}class _{constructor(t){this.dtoType=t instanceof RTEBlock?"block":"node",this.annotationMap=t.annotationMap}toCssText(t={standalone:!1},e,s){return s=s||this.toJSON(t,e),Object.entries(Object.assign({},s)).map((([t,e])=>`${r(t)}: ${e};`)).join("")}toJSON(t={standalone:!1},e){const s=Array.from(this.annotationMap.values()).filter((t=>this.filterAnnotation(t)||t instanceof k)).map((e=>e.renderStyle(t))).filter(o);return e&&e.length>0?this.mergeAnnotationStyles(s,e):s.reduce(((t,e)=>Object.assign(Object.assign({},t),e)),{})}filterAnnotation(t){return"block"===this.dtoType?t instanceof f:t instanceof v}mergeAnnotationStyles(t,e){const s={};for(const n of t)for(const t in n){const r=n[t],i=s[t];s[t]="string"==typeof i&&"string"==typeof r&&e.includes(t)?Array.from(new Set(`${i} ${r}`.split(/\s+/).filter(Boolean))).join(" "):r}return s}}!function(t){t.TEXT="TEXT",t.IMAGE="IMAGE",t.CODE_BLOCK_NODE="CODE_BLOCK_NODE"}(w||(w={}));class RTENode{constructor(t,e){this.annotationMap=new Map,this.id=t,e&&(this.annotationMap=e)}static from(t,e,s){throw new Error(`[Vega] ${this.constructor.name}.from(${JSON.stringify(t)}, ${e}, ${s}) is not implemented. Please implement this method in the subclass.`)}static createAnnotationEntity(t,e){switch(t){case"customAttribute":return C.from(e);case"customClass":return b.from(e);case"customStyle":return k.from(e)}}getAnnotationByType(t){return this.annotationMap.get(t)}deleteAnnotationByType(t){this.annotationMap.delete(t),this.flushChange()}apply(t){return this.doApply(t),t.isFlushable&&this.flushChange(),this}getStyles(t={standalone:!1}){return new _(this).toJSON(t,["textDecoration"])}getClasses(t={standalone:!1}){return Array.from(this.annotationMap.values()).filter((t=>t instanceof v||t instanceof b)).map((e=>e.renderClass(t))).filter(o).reduce(((t,e)=>[t,e].join(" ").trim()),"")}getCustomAttributesAnnotation(){return this.annotationMap.get(E.CUSTOM_ATTRIBUTE)}isTextNode(){return!1}getElementRef(){return T.getDOMByEntity(this)}generateAttributeString(...t){var e;const s=new _(this).toCssText({standalone:!0},["textDecoration"]),n=this.annotationMap.get(E.CUSTOM_CLASS),r=[...(null===(e=this.getCustomAttributesAnnotation())||void 0===e?void 0:e.toString(t))||[],null==n?void 0:n.toString(),s?`style="${s}"`:null,...t].filter(o);return r.length?` ${r.join(" ")}`:""}doApply(t){t instanceof m?this.doModifyActionApply(t):this.doAnnotationActionApply(t)}flushChange(){const n=T.getDOMByEntity(this);if(n){const r=e.getSubjectFromParentNodeByEventId(n,s);r&&t.notify(r,{})}}cloneAnnotations(){return new Map(Array.from(this.annotationMap.entries()).map((([t,e])=>[t,e.clone()])))}doAnnotationActionApply(t){}doModifyActionApply(t){}}const L=new class{constructor(){this.RTE_BLOCK_DTO_CLASS_MAP=new Map,this.RTE_NODE_DTO_CLASS_MAP=new Map}registerRTEDTOClass(t,e){if(e.prototype instanceof RTEBlock)this.RTE_BLOCK_DTO_CLASS_MAP.set(t,e);else{if(!(e.prototype instanceof RTENode))throw new Error(`Invalid RTE DTO class type: ${t}`);this.RTE_NODE_DTO_CLASS_MAP.set(t,e)}}getRTEBlockClass(t){return this.RTE_BLOCK_DTO_CLASS_MAP.get(t)}getRTENodeClass(t){return this.RTE_NODE_DTO_CLASS_MAP.get(t)}};class RTEBlock{constructor(t){this.annotationMap=new Map,this.id=t}static from(t,e){throw new Error(`[Vega] ${this.constructor.name}.from(${JSON.stringify(t)}, ${e}) is not implemented. Please implement this method in the subclass.`)}static generateBlockChildren(t,e,s){return t.map((t=>{const n=L.getRTEBlockClass(t.type);if(n){const r=n.from(t,e);return r.parent=s,r}})).filter(o)}static createAnnotationEntity(t,e){switch(t){case"textAlign":return O.from(e);case"indent":return N.from(e);case"customAttribute":return C.from(e);case"customClass":return b.from(e);case"customStyle":return k.from(e);case"internalWrapper":return B.from(e)}}static convertAnnotationsToMap(t,e){Object.entries(e).forEach((([e,s])=>{const n=this.createAnnotationEntity(e,s);o(n)&&t.set(...n)}))}shouldRenderAsInternalWrapper(){const t=this.getAnnotationByType(d.INTERNAL_WRAPPER);return!!t&&t.internalWrapper&&0===Array.from(this.annotationMap.values()).filter((t=>!(t instanceof A||t instanceof B))).length}toJSON(){const t=Array.from(this.annotationMap.values()).filter((t=>t instanceof f||t instanceof S)).reduce(((t,e)=>Object.assign(Object.assign({},t),e.toJSON())),{});return Object.assign({id:this.id},Object.keys(t).length>0?{annotations:t}:{})}getAnnotationByType(t){return this.annotationMap.get(t)}apply(n){if(this.doApply(n),n.isFlushable){const n=T.getDOMByEntity(this);if(n){const r=e.getSubjectFromParentNodeByEventId(n,s);r&&t.notify(r,{})}}}isListItemBlock(){return"list-item"===this.type}getStyles(t={standalone:!1}){const e=new _(this).toJSON(t);return Object.assign(Object.assign({},e),this.shouldRenderAsInternalWrapper()?{display:"contents"}:{})}getClasses(t={standalone:!1}){return Array.from(this.annotationMap.values()).filter((t=>t instanceof f||t instanceof b)).map((e=>e.renderClass(t))).filter(o).reduce(((t,e)=>[t,e].join(" ").trim()),"")}getCustomAttributesAnnotation(){return this.annotationMap.get(E.CUSTOM_ATTRIBUTE)}generateAttributeString(...t){var e;const s=new _(this).toCssText({standalone:!0}),n=this.annotationMap.get(E.CUSTOM_CLASS),r=[...(null===(e=this.getCustomAttributesAnnotation())||void 0===e?void 0:e.toString(t))||[],null==n?void 0:n.toString(),s?`style="${s}"`:null,...t].filter(o);return r.length?` ${r.join(" ")}`:""}doApply(t){t instanceof m?y.executeTheStrategy(t,this):this.applyAnnotationAction(t)}applyAnnotationAction(t){const e=t.toAnnotation();e instanceof A||this.annotationMap.set(e.type,e),"function"==typeof this.doAnnotationActionApply&&this.doAnnotationActionApply(t)}cloneAnnotations(){return new Map(Array.from(this.annotationMap.entries()).map((([t,e])=>[t,e.clone()])))}}class j{}class D extends j{constructor(){super(...arguments),this.doSplit=!0}}class I extends p{constructor(t){super(),this.type=u.SELECTION_RANGE,this.range=t}clone(){return new I(this.range)}}class $ extends v{constructor(t){super(),this.type=g.STRIKETHROUGH,this.strikethrough=t}static from(t){return[g.STRIKETHROUGH,new $(t)]}toJSON(){return{strikethrough:this.strikethrough}}clone(){return new $(this.strikethrough)}renderClass(t){return(null==t?void 0:t.standalone)?null:this.strikethrough?"v-rte--strikethrough":null}renderStyle(t){return(null==t?void 0:t.standalone)&&this.strikethrough?{textDecoration:"line-through"}:null}}class M extends v{constructor(t){super(),this.type=g.UNDERLINE,this.underline=t}static from(t){return[g.UNDERLINE,new M(t)]}toJSON(){return{underline:this.underline}}clone(){return new M(this.underline)}renderClass(t){return(null==t?void 0:t.standalone)?null:this.underline?"v-rte--underline":null}renderStyle(t){return(null==t?void 0:t.standalone)&&this.underline?{textDecoration:"underline"}:null}}class H extends v{constructor(t){super(),this.type=g.ITALIC,this.italic=t}static from(t){return[g.ITALIC,new H(t)]}toJSON(){return{italic:this.italic}}clone(){return new H(this.italic)}renderClass(t){return(null==t?void 0:t.standalone)?null:this.italic?"v-rte--italic":null}renderStyle(t){return(null==t?void 0:t.standalone)&&this.italic?{fontStyle:"italic"}:null}}class P extends v{constructor(t){super(),this.type=g.BOLD,this.bold=t}static from(t){return[g.BOLD,new P(t)]}toJSON(){return{bold:this.bold}}clone(){return new P(this.bold)}renderClass(t){return(null==t?void 0:t.standalone)?null:this.bold?"v-rte--bold":null}renderStyle(t){return(null==t?void 0:t.standalone)&&this.bold?{fontWeight:"700"}:null}}class J extends v{constructor(t,e=!0){super(),this.type=g.CODE,this.code=t,this.useInternalStyle=e}static from(t,e){return[g.CODE,new J(t,e)]}toJSON(){return{code:this.code}}clone(){return new J(this.code,this.useInternalStyle)}renderClass(t){return(null==t?void 0:t.standalone)?null:this.code&&this.useInternalStyle?"v-rte--code":null}renderStyle(t){return(null==t?void 0:t.standalone)&&this.code&&this.useInternalStyle?{fontFamily:"Roboto Mono",whiteSpace:"pre-wrap"}:null}}const K={key:"black",light:"#111128",dark:"#E3E3E8"},F=[K,{key:"gray",light:"#5E5E6D",dark:"#B9B9C1"},{key:"green",light:"#01801F",dark:"#59D977"},{key:"red",light:"#BD2947",dark:"#FFB2B5"},{key:"purple",light:"#563D82",dark:"#BEB2FF"},{key:"teal",light:"#17758F",dark:"#4CD8FF"}],U="​",W=[["textStyles"],["bold","italic","underline","strikethrough","code"],["textColor"],["horizontalAlignment","bulletsNumbers"],["moreIndent","lessIndent"],["link"],["image"],["clearStyle"]];class G extends v{constructor(t){super(),this.type=g.TEXT_COLOR,this.textColor=this.formatTextColor(t)}static from(t){return[g.TEXT_COLOR,new G(t)]}toJSON(){return{textColor:this.textColor.key}}clone(){return new G(this.textColor.key)}renderClass(){return null}renderStyle(){return{color:a.isDarkMode()?this.textColor.dark:this.textColor.light}}formatTextColor(t){return F.find((e=>e.key===t))||F[0]}}class z extends v{constructor(t,e=!0){super(),this.type=g.LINK,this.link=t,this.useInternalStyle=e}static from(t,e=!0){return[g.LINK,new z(t,e)]}toJSON(){return{link:this.link}}clone(){return new z(this.link,this.useInternalStyle)}toEqual(t){return this.link.groupKey===t.link.groupKey}renderClass(){return null}renderStyle(){return null}}class V extends j{constructor(t,e,s){super(),this.isFlushable=!1,this.groupKey=t,this.nodes=e,this.type=s}toAnnotation(){return new A(this.groupKey)}}class X extends j{constructor(){super(),this.isFlushable=!1}toAnnotation(){return null}}class q{execute(t,e){return i.log(`Executing action ${t.constructor.name} on ${e.constructor.name} ${e.id}`),this.handleAction(t,e)}updateCustomStyleAnnotation(t,e){const s=t.annotationMap.get(E.CUSTOM_STYLE);s&&this.isCustomStyle(s,e)&&t.annotationMap.set(s.type,new k(s.removeStyles(e)))}createNewParagraph(t){const e=L.getRTEBlockClass("paragraph");if(e)return e.from({id:c(),type:"paragraph",nodes:[{id:c(),type:"text",text:t}]})}getRootContent(t){const e=t.parent;if(e)return"VegaRTEContent"===e.constructor.name?e:this.getRootContent(e)}isCaretPositionAtBlockStart(t,e,s){return e===t.children[0]&&0===s}isCaretPositionAtBlockEnd(t,e,s){return e.isContentEditable()?this.isCaretPositionAtTextBlockEnd(t,e,s):this.isCaretPositionAtDecoratorBlockEnd(t,e,s)}isCaretPositionAtTextBlockEnd(t,e,s){const n=t.children[t.children.length-1];return e===n&&(e.isEmpty()||s===n.text.length)}isCaretPositionAtDecoratorBlockEnd(t,e,s){return e===t.children[t.children.length-1]&&0!==s}isCustomStyle(t,e){return e.some((e=>Object.keys(t.customStyle).includes(e)))}}class Y extends m{constructor(t){super(),this.type=x.LINK_GROUP_NODE_SPLIT,this.splittedTextNodes=t}}class Q extends q{constructor(){super(...arguments),this.applyTargetNode=null}handleAction(t,e){const s=e.getAnnotationByType(u.SELECTION_RANGE);if(this.setApplyTargetNode(null),t instanceof D&&t.doSplit&&s){const{startContainer:t,endContainer:n,startOffset:r,endOffset:i}=s.range,o=t===n&&r===i;e.parent.children=e.parent.children.flatMap((t=>{if(t.id===e.id){if(o)return this.insertNewNode(r,e);if(this.shouldSplitSelection(s.range)&&e.isContentEditable()){const n=this.splitTextNode(s.range,e);return t.annotationMap.has("LINK")&&t.apply(new Y(n)),n}return this.setApplyTargetNode(e),e}return t}))}return this.applyTargetNode}insertNewNode(t,e){const s=e.cloneWithText("");this.setApplyTargetNode(s);const n=e.parent.children.findIndex((t=>t===e));return 0===t||!e.isContentEditable()&&t===n?[s,e]:t===e.text.length||!e.isContentEditable()&&t===n+1?[e,s]:[e.cloneWithText(e.text.substring(0,t)),s,e.cloneWithText(e.text.substring(t))]}shouldSplitSelection(t){const{startContainer:e,endContainer:s,startOffset:n,endOffset:r}=t;return e!==s||n>0||r<(s.textContent?s.textContent.length:0)}splitTextNode(t,e){const{startContainer:s,endContainer:n,startOffset:r}=t,i=s.parentElement,o=n.parentElement,c=(t,s,n)=>{const r=t.substring(0,s),i=t.substring(s,n),o=t.substring(n);return[e.cloneWithText(r),e.cloneWithText(i),e.cloneWithText(o)]},a=i&&T.getEntityByDOM(i),l=o&&T.getEntityByDOM(o);if(a&&a.id===e.id){const i=s===n?t.endOffset:e.text.length,[o,a,l]=c(e.text,r,i);return this.setApplyTargetNode(a),[o,a,l].filter((t=>!!t.text))}if(l&&l.id===e.id){const[s,n,r]=c(e.text,0,t.endOffset);return this.setApplyTargetNode(n),[s,n,r].filter((t=>!!t.text))}return this.setApplyTargetNode(e),e}setApplyTargetNode(t){this.applyTargetNode=t}}class Z extends D{constructor(t){super(),this.isFlushable=!0,this.bold=t}toAnnotation(){return new P(this.bold)}}class tt extends p{constructor(){super(...arguments),this.type=u.CLEAR_FORMATTING,this.items=[g.BOLD,g.ITALIC,g.UNDERLINE,g.STRIKETHROUGH,g.TEXT_COLOR,g.CODE,E.CUSTOM_STYLE]}}class et extends D{constructor(){super(...arguments),this.isFlushable=!0}toAnnotation(){return new tt}}class st extends D{constructor(t){super(),this.isFlushable=!0,this.code=t}toAnnotation(){return new J(this.code)}}class nt extends j{constructor(t){super(),this.isFlushable=!0,this.annotationType=t}toAnnotation(){}}class rt extends D{constructor(t){super(),this.isFlushable=!0,this.italic=t}toAnnotation(){return new H(this.italic)}}class it extends D{constructor({link:t,newText:e,needMergeNode:s,doSplit:n,type:r}){super(),this.isFlushable=!0,this.link=t,this.needMergeNode=s,this.newText=e,this.type=r,o(n)&&(this.doSplit=n)}toAnnotation(){return new z(this.link)}}class ot extends D{constructor(t){super(),this.isFlushable=!0,this.strikethrough=t}toAnnotation(){return new $(this.strikethrough)}}class ct extends D{constructor(t){super(),this.isFlushable=!0,this.underline=t}toAnnotation(){return new M(this.underline)}}class at extends q{handleAction(t,e){const s=t.toAnnotation();if(t instanceof nt)e.annotationMap.delete(t.annotationType);else{if(!(s instanceof tt))return s instanceof v||s instanceof I?(t instanceof it&&(o(t.newText)&&(e.text=t.newText),e.parent.apply(new V(t.link.groupKey,[e],t.type))),t instanceof st&&this.handleAction(new et,e),t instanceof Z&&this.updateCustomStyleAnnotation(e,["fontWeight"]),t instanceof rt&&this.updateCustomStyleAnnotation(e,["fontStyle"]),(t instanceof ct||t instanceof ot)&&this.updateCustomStyleAnnotation(e,["textDecoration"]),void e.annotationMap.set(s.type,s)):void 0;s.items.forEach((t=>{e.deleteAnnotationByType(t)}))}}}class lt extends m{constructor(){super(...arguments),this.type=x.DELETE_LINK_GROUP}}class ht extends q{handleAction(t,e){e.text=t.newTextContent,!e.text&&e.annotationMap.has("LINK")&&e.apply(new lt)}}class ut extends m{constructor(t){super(),this.type=x.UPDATE_TEXT,this.newTextContent="",this.newTextContent=t}}class dt extends q{handleAction(t,e){this.replaceSelectedText(t.textToBeInsert,t.currentRange,e)}replaceSelectedText(t,e,s){if(e&&e.startContainer&&e.endContainer){const{startContainer:n,endContainer:r,startOffset:i,endOffset:o}=e;let c=s.text;if(n===r&&i===o&&t)c=s.text.slice(0,i)+t+s.text.slice(i);else{const e=n.parentElement,a=r.parentElement,l=e&&T.getEntityByDOM(e),h=a&&T.getEntityByDOM(a);let u=0,d=s.text.length;l&&l===s?(u=i,d=n===r?o:d):h&&h===s&&(d=o),c=s.text.slice(0,u)+t+s.text.slice(d)}s.apply(new ut(c))}}}class pt extends p{constructor(t){super(),this.type=g.INLINE_HTML,this.htmlTag=t}static from(t){const{htmlTag:e,child:s,customStyle:n,customClass:r,customAttribute:i}=t,o=new pt(e);return o.child=s?pt.from(s)[1]:void 0,o.customAttribute=i?C.from(i)[1]:void 0,o.customClass=r?b.from(r)[1]:void 0,o.customStyle=n?k.from(n)[1]:void 0,[g.INLINE_HTML,o]}clone(){var t,e,s,n;const r=new pt(this.htmlTag);return r.child=null===(t=this.child)||void 0===t?void 0:t.clone(),r.customAttribute=null===(e=this.customAttribute)||void 0===e?void 0:e.clone(),r.customClass=null===(s=this.customClass)||void 0===s?void 0:s.clone(),r.customStyle=null===(n=this.customStyle)||void 0===n?void 0:n.clone(),r}toJSON(){var t,e,s,n;return{inlineHtml:l({htmlTag:this.htmlTag,child:null===(t=this.child)||void 0===t?void 0:t.toJSON().inlineHtml,customAttribute:null===(e=this.customAttribute)||void 0===e?void 0:e.toJSON().customAttribute,customClass:null===(s=this.customClass)||void 0===s?void 0:s.toJSON().customClass,customStyle:null===(n=this.customStyle)||void 0===n?void 0:n.toJSON().customStyle})}}}class ft extends q{handleAction(t,e){const s=e.parent.getAnnotationByType(u.LINK_GROUP);if(s){const n=e.annotationMap.get("LINK").link.groupKey,r=s.linkGroups.get(n);if(r){const i=r.indexOf(e);-1!==i&&(r.splice(i,1,...Array.isArray(t.splittedTextNodes)?t.splittedTextNodes:[t.splittedTextNodes]),s.linkGroups.set(n,r))}}}}class Tt extends q{handleAction(t,e){const s=e.parent.getAnnotationByType(u.LINK_GROUP);if(s){const t=e.annotationMap.get(g.LINK).link.groupKey,n=s.linkGroups.get(t);if(n){const r=n.indexOf(e);-1!==r&&n.splice(r,1),0===n.length&&s.linkGroups.delete(t),0===s.linkGroups.size&&e.parent.annotationMap.delete(u.LINK_GROUP)}}e.annotationMap.delete(g.LINK)}}class xt extends v{constructor(t){super(),this.type=g.PLAIN_TEXT,this.plainText=!0,this.plainText=t}static from(t){return[g.PLAIN_TEXT,new xt(t)]}clone(){return new xt(this.plainText)}renderClass(){}renderStyle(){}toJSON(){return this.plainText?{plainText:this.plainText}:void 0}}class Et extends D{constructor(t){super(),this.isFlushable=!0,this.textColor=t}toAnnotation(){return new G(this.textColor)}}class RTETextNode extends RTENode{constructor(t,e,s,n){super(t,n),this.type=w.TEXT,this.parent=s,this.text=e,this.registerModifyStrategy()}static supportsHtmlTag(t){return["span","code"].includes(t)}static from(t,e,s={autoMatchFormat:!0}){const n=new RTETextNode(t.id,t.text,e),{annotations:r}=t;return r&&(n.annotationMap=this.generateTextAnnotationMap(r,s,e,n)),n}static generateTextAnnotationMap(t,e,s,n){return new Map(Object.keys(t).map((r=>("link"===r&&t.link&&s&&n&&s.apply(new V(t.link.groupKey,[n],"link")),this.createAnnotationEntity(r,t[r],e)))).filter(o))}static createAnnotationEntity(t,e,s){const n=!(!s||!s.autoMatchFormat);switch(t){case"bold":return P.from(e);case"italic":return H.from(e);case"underline":return M.from(e);case"strikethrough":return $.from(e);case"code":return J.from(e,n);case"textColor":return G.from(e);case"link":return z.from(e,n);case"inlineHtml":return pt.from(e);case"plainText":return xt.from(e)}return RTENode.createAnnotationEntity(t,e)}toJSON(){const t=Array.from(this.annotationMap.values()).filter((t=>t instanceof v||t instanceof S||t instanceof pt)).reduce(((t,e)=>Object.assign(Object.assign({},t),e.toJSON())),{});return Object.assign(Object.assign({id:this.id},Object.keys(t).length>0?{annotations:t}:{}),{type:"text",text:this.text})}toHtml(){const t=this.getAnnotationByType(g.INLINE_HTML);return t?this.renderWithWrapperStr(t):this.renderTextStr()}cloneWithText(t){return new RTETextNode(c(),t,this.parent,super.cloneAnnotations())}clone(t){return new RTETextNode(this.id,this.text,t,super.cloneAnnotations())}isEmpty(){return!this.text||"​"===this.text||"\n"===this.text}isTextNode(){return!0}getRangeEndOffset(){return!this.isContentEditable()&&this.parent?this.parent.children.indexOf(this)+1:"\n"===this.text?0:this.text.length}getRangeContainer(){const t=this.getElementRef();if(t)return this.isContentEditable()?t.firstChild:t.parentElement}isContentEditable(){return!0}registerModifyStrategy(){const t=this.constructor.name;RTETextNode.registerActionStrategyStatus[t]||(this.isContentEditable()&&(y.register(x.UPDATE_TEXT,t,new ht),y.register(x.REPLACE_SELECTED_TEXT,t,new dt),y.register(x.LINK_GROUP_NODE_SPLIT,t,new ft),y.register(it.name,t,new at)),y.register(D.name,t,new Q),y.register(x.DELETE_LINK_GROUP,t,new Tt),y.register(Z.name,t,new at),y.register(et.name,t,new at),y.register(rt.name,t,new at),y.register(ct.name,t,new at),y.register(Et.name,t,new at),y.register(ot.name,t,new at),y.register(st.name,t,new at),y.register(j.name,t,new at),RTETextNode.registerActionStrategyStatus[t]=!0)}doAnnotationActionApply(t){const e=this.getAnnotationByType(u.SELECTION_RANGE);if(t instanceof D&&t.doSplit&&e){const e=y.get(D.name,this.constructor.name);if(e){const s=e.execute(t,this);s&&this.applyActionToNode(s,t)}}else this.applyActionToNode(this,t);"function"==typeof this.parent.mergeNodes&&this.parent.mergeNodes(t)}doModifyActionApply(t){y.executeTheStrategy(t,this)}applyActionToNode(t,e){const s=e.toAnnotation();if(e instanceof X)return void this.syncUpSelectedNodes(t);s instanceof I||this.syncUpSelectedNodes(t);const n=y.get(e.constructor.name,t.constructor.name);if(n)return void n.execute(e,t);const r=y.get(j.name,RTETextNode.name);r&&r.execute(e,t)}syncUpSelectedNodes(s){const r=this.getElementRef();if(r){const i=e.getSubjectFromParentNodeByEventId(r,n);i&&t.notify(i,{node:s})}}renderWithWrapperStr(t){const{htmlTag:e,customAttribute:s,customClass:n,customStyle:r,child:i}=t,c=[...(null==s?void 0:s.toString())||[],null==n?void 0:n.toString(),null==r?void 0:r.toString()].filter(o),a=c.length>0?` ${c.join(" ")}`:"";return i?`<${e}${a}>${this.renderWithWrapperStr(i)}</${e}>`:`<${e}${a}>${this.renderTextStr()}</${e}>`}renderTextStr(){var t;const e=(null===(t=this.getAnnotationByType(g.CODE))||void 0===t?void 0:t.code)?"code":"span",s=super.generateAttributeString();return"\n"===this.text?"<br>":this.shouldRenderAsPlainText()?this.text:`<${e}${s}>${this.text}</${e}>`}shouldRenderAsPlainText(){const t=super.getAnnotationByType(g.PLAIN_TEXT);return!!t&&t.plainText&&0===Array.from(this.annotationMap.values()).filter((t=>t instanceof v&&!(t instanceof z)&&!(t instanceof xt)||t instanceof S)).length}}RTETextNode.registerActionStrategyStatus={},RTETextNode.htmlTag="span";class gt extends m{constructor(t){super(),this.type=x.APPEND_CHILDREN,this.entityToBeAppended=t}}class wt extends f{constructor(t){super(),this.type=d.TEXT_STYLE,this.textStyle=t}static from(t){return[d.TEXT_STYLE,new wt(t)]}toJSON(){return{textStyle:this.textStyle}}clone(){return new wt(this.textStyle)}renderClass(t){return(null==t?void 0:t.standalone)?null:this.textStyle?`v-rte--text-style-${this.textStyle}`:null}renderStyle(t){if(!(null==t?void 0:t.standalone))return null;const e={fontFamily:"Inter",fontSize:"16px",lineHeight:"22px",minHeight:"22px",fontWeight:"500"},s=Object.assign(Object.assign({},e),{marginTop:"0px",marginBottom:"0px"});switch(this.textStyle){case"paragraph":return s;case"title":return Object.assign(Object.assign({},e),{fontSize:"36px",lineHeight:"40px",minHeight:"40px"});case"subtitle":return Object.assign(Object.assign({},e),{fontSize:"28px",lineHeight:"32px",minHeight:"32px"});case"heading-1":return Object.assign(Object.assign({},e),{fontSize:"22px",lineHeight:"24px",minHeight:"24px",marginTop:"0px",marginBottom:"0px"});case"heading-2":return Object.assign(Object.assign({},e),{fontSize:"20px",lineHeight:"24px",minHeight:"24px",marginTop:"0px",marginBottom:"0px"});case"heading-3":return Object.assign(Object.assign({},e),{fontSize:"18px",lineHeight:"22px",minHeight:"22px",marginTop:"0px",marginBottom:"0px"});case"heading-4":return Object.assign(Object.assign({},e),{fontSize:"16px",lineHeight:"22px",minHeight:"22px",marginTop:"0px",marginBottom:"0px"});case"heading-5":return Object.assign(Object.assign({},e),{fontSize:"14px",lineHeight:"22px",minHeight:"22px",marginTop:"0px",marginBottom:"0px"});case"heading-6":return Object.assign(Object.assign({},e),{fontSize:"12px",lineHeight:"22px",minHeight:"22px",marginTop:"0px",marginBottom:"0px"})}}}class mt extends j{constructor(t,e){super(),this.isFlushable=!0,this.textStyle=t,this.bold=e}toAnnotation(){return new wt(this.textStyle)}}class At extends q{handleAction(t,e){"list-item"!==e.type&&(e.type=t.textStyle),e.children.forEach(t.bold?t=>{const e=new Z(!0);e.doSplit=!1,t.apply(e)}:t=>{t.apply(new nt(g.BOLD))}),this.updateCustomStyleAnnotation(e,["fontFamily","lineHeight","fontWeight","fontSize"])}}class Ot extends m{constructor(t,...e){super(),this.type=x.INSERT_CHILDREN_AFTER,this.referChildren=t,this.childrenToBeInserted=e}}class Nt extends m{constructor(t){super(),this.type=x.REPLACE_CHILD_NODES,this.newChildNodes=t}}class Rt extends q{handleAction(t,e){t.newBlock=this.splitTextNodeBlock(t.splitPointNode,t.startOffsetOfNode,e)}splitTextNodeBlock(t,e,s){if(t){const n=t.text.slice(0,e),r=t.text.slice(e),i=s.children.indexOf(t);if(i>-1){const e=s.children.slice(0,i),o=s.children.slice(i+1);n&&e.push(t.cloneWithText(n)),r&&o.unshift(t.cloneWithText(r)),s.apply(new Nt(e));const c=s.cloneWithNodes(o);return s.parent.apply(new Ot(s,c)),c}}}}class yt extends q{handleAction(t,e){e.children=[],e.apply(new gt(t.newChildNodes))}}class St extends m{constructor(t){super(),this.type=x.DELETE_CHILDREN,this.entityToBeRemoved=t}}class Ct extends q{handleAction(t,e){const s=t.blockNeedToBeMerged;if(e.type===s.type||"image"!==e.type&&"image"!==s.type){let t=s.children;"image"!==s.type&&(t=s.children.filter((t=>t.text))),e.apply(new gt(t)),s.parent.apply(new St(s))}}}class bt extends q{handleAction(t,e){t.lineBreakNode=this.lineBreakSingleBlock(t.startContainerNode,t.startOffset,e)}lineBreakSingleBlock(t,e,s){if(t){const n=new RTETextNode(c(),"\n",s),r=t.text.slice(0,e),i=t.text.slice(e),o=s.children.indexOf(t);if(o>-1){const e=s.children.slice(0,o),c=s.children.slice(o+1);r&&e.push(t.cloneWithText(r)),i&&c.unshift(t.cloneWithText(i)),this.mergeLineBreakNodes(e,n,c,s)}return n}}mergeLineBreakNodes(t,e,s,n){(0===s.length||s[0]&&""===s[0].text)&&s.push(new RTETextNode(c(),"\n",n,t[t.length-1]&&t[t.length-1].annotationMap)),n.apply(new Nt([...t,e,...s]))}}class kt extends q{handleAction(t,e){t.lineBreakNode=this.lineBreakMultipleBlocks(t.selectedBlocks,e)}lineBreakMultipleBlocks(t,e){const s=e.children,n=new RTETextNode(c(),"\n",e),r=this.concatBlocksNodes(t.slice(1));return this.mergeLineBreakNodes(s,n,r,e),n}concatBlocksNodes(t){const e=[];return t.map((t=>{"image"!==t.type&&(e.push(...t.children),t.parent.apply(new St(t)))})),e}mergeLineBreakNodes(t,e,s,n){(0===s.length||s[0]&&""===s[0].text)&&s.push(new RTETextNode(c(),"\n",n,t[t.length-1]&&t[t.length-1].annotationMap)),n.apply(new Nt([...t,e,...s]))}}class Bt extends m{constructor(t,...e){super(),this.type=x.INSERT_CHILDREN_BEFORE,this.referChildren=t,this.childrenToBeInserted=e}}class vt extends m{constructor(t,e){super(),this.type=x.SPLIT_BLOCK_WITH_NODE,this.splitPointNode=t,this.startOffsetOfNode=e}}class _t extends j{constructor(t){super(),this.isFlushable=!0,this.textAlign=t}toAnnotation(){return new O(this.textAlign)}}class Lt extends q{handleAction(t,e){this.updateCustomStyleAnnotation(e,["textAlign"])}}class jt extends j{constructor(t){super(),this.isFlushable=!0,this.indent=t}toAnnotation(){return new N(this.indent)}}class RTETextBlock extends RTEBlock{constructor(t,e,s){super(t),this.children=[],this.type=e;const{autoMatchFormat:n}=s||{autoMatchFormat:!0};n&&(this.annotationMap=RTETextBlock.isAcceptableTextStyle(e)?new Map([wt.from(e)]):new Map([wt.from("paragraph")]))}static from(t,e={autoMatchFormat:!0}){var s,n;const r=new RTETextBlock(t.id,t.type,e),i=e.autoMatchFormat?Object.assign(Object.assign({},t.annotations),{textStyle:null!==(n=null===(s=t.annotations)||void 0===s?void 0:s.textStyle)&&void 0!==n?n:r.type}):t.annotations;return r.children=t.nodes.map((t=>{const s=L.getRTENodeClass(t.type);if(s)return s.from(t,r,e)})).filter(o),i&&super.convertAnnotationsToMap(r.annotationMap,i),r}static createAnnotationEntity(t,e){return"textStyle"===t?wt.from(e):super.createAnnotationEntity(t,e)}static isAcceptableTextStyle(t){return["title","subtitle","paragraph","heading-1","heading-2","heading-3","heading-4","heading-5","heading-6"].includes(t)}mergeNodes(t){this.children=this.children.reduce(((e,s)=>{const n=e.at(-1);if(t instanceof it&&t.needMergeNode){const t=null==n?void 0:n.getAnnotationByType(g.LINK),r=s.getAnnotationByType(g.LINK);if(t&&r&&t.toEqual(r))return e}return[...e,s]}),[])}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{type:this.type,nodes:this.children.map((t=>t.toJSON()))})}toHtml(){const t=this.getBlockTag(),e=super.generateAttributeString(),s=this.getChildrenHtml();return super.shouldRenderAsInternalWrapper()?s:[`<${t}${e}>`,s,`</${t}>`].join("")}cloneWithNodes(t){const e=new RTETextBlock(c(),this.type);return e.annotationMap=super.cloneAnnotations(),e.apply(new gt(t)),e}clone(t){const e=new RTETextBlock(this.id,this.type);return e.children=this.children.map((t=>t.clone(e))),e.annotationMap=super.cloneAnnotations(),e.parent=t,e}isNotEmpty(){return this.children.length>0&&this.children.some((t=>!t.isEmpty()))}getLastNode(){return this.children[this.children.length-1]}getBlockTag(){switch(this.type){case"title":case"subtitle":return"div";case"heading-1":return"h1";case"heading-2":return"h2";case"heading-3":return"h3";case"heading-4":return"h4";case"heading-5":return"h5";case"heading-6":return"h6";case"paragraph":default:return"p"}}getChildrenHtml(){const t=this.getAnnotationByType(u.LINK_GROUP);let e=this.children.map((t=>t.toHtml())).join("");return t&&this.children.length>0&&(e=this.generateLinkHtml(t,e)),e}doAnnotationActionApply(t){const e=y.get(t.constructor.name,RTETextBlock.name);e&&e.execute(t,this)}generateLinkHtml(t,e){e="";let s=[];for(let n=0;n<this.children.length;n++){const r=this.children[n].getAnnotationByType(g.LINK),i=this.children[n+1]?this.children[n+1].getAnnotationByType(g.LINK):null;if(r){if(s.push(this.children[n]),!i||r.link.groupKey!==i.link.groupKey){const n=t.toString(r,{standalone:!0});e+=[`<a${n?` ${n}`:""}>`,s.map((t=>t.toHtml())).join(""),"</a>"].join(""),s=[]}}else e+=this.children[n].toHtml()}return e}}y.register(mt.name,RTETextBlock.name,new At),y.register(_t.name,RTETextBlock.name,new Lt),y.register(jt.name,RTETextBlock.name,new class extends q{handleAction(t,e){this.updateCustomStyleAnnotation(e,["marginLeft"])}}),y.register(V.name,RTETextBlock.name,new class extends q{handleAction(t,e){let s=e.getAnnotationByType(u.LINK_GROUP);if("update_link"===t.type){if(s){const e=s.linkGroups.get(t.groupKey);e&&s.linkGroups.set(t.groupKey,[e[0]])}}else{if(s){const e=s.linkGroups.get(t.groupKey)||[];s.linkGroups.set(t.groupKey,[...e,...t.nodes])}else s=t.toAnnotation(),s.linkGroups.set(t.groupKey,[...t.nodes]);e.annotationMap.set(u.LINK_GROUP,s)}}}),y.register(x.UNLINK_LINK_GROUP,RTETextBlock.name,new class extends q{handleAction(t,e){const s=e.getAnnotationByType(u.LINK_GROUP);s&&(s.linkGroups.size>1?s.linkGroups.delete(t.groupKey):e.annotationMap.delete(u.LINK_GROUP))}}),y.register(x.SPLIT_BLOCK_WITH_NODE,RTETextBlock.name,new Rt),y.register(x.REPLACE_CHILD_NODES,RTETextBlock.name,new yt),y.register(x.MERGE_TWO_BLOCKS_NODES,RTETextBlock.name,new Ct),y.register(x.LINE_BREAK_SINGLE_BLOCK,RTETextBlock.name,new bt),y.register(x.LINE_BREAK_MULTIPLE_BLOCKS,RTETextBlock.name,new kt),y.register(x.INSERT_IMAGE_TO_BLOCK,RTETextBlock.name,new class extends q{handleAction(t,e){const s=t.splitPointNode,n=t.startOffsetOfNode,r=t.imageBlockToBeInserted;if(this.isCaretPositionAtBlockEnd(e,s,n))e.parent.apply(new Ot(e,r));else if(this.isCaretPositionAtBlockStart(e,s,n))e.parent.apply(new Bt(e,r));else{const t=new vt(s,n);e.apply(t),e.parent.apply(new Ot(e,r))}}}),y.register(x.TRANSFORM_LIST_BLOCK,RTETextBlock.name,new class extends q{handleAction(t,e){const s=e.parent,n=s.createList(t.listType),r=t.selectedBlocks,i=r.map((t=>s.toListItem(t)));n.apply(new gt(i)),s.apply(new Ot(t.selectedBlocks[0],n)),r.forEach((t=>{t.parent.apply(new St(t))}))}});class Dt extends q{getPreviousNode(t){const e=t.parent,s=e.children.indexOf(t);if(s>0)return e.children[s-1];if(e.parent){const t=this.getPreviousBlock(e);if(t)return this.getBlockLastNode(t)}}getNextNode(t){const e=t.parent,s=e.children.indexOf(t);if(e.children[s+1])return e.children[s+1];if(e.parent){const t=this.getNextBlock(e);if(t)return this.getBlockFirstNode(t)}}isContentFirstNode(t){const e=t.parent,s=e.children.indexOf(t),n=e.parent;if(e.isListItemBlock()){const t=n.parent;return 0===s&&Array.isArray(n.children)&&n.children[0]===e&&"list-item"!==t.type&&Array.isArray(t.children)&&t.children[0]===n}return 0===s&&Array.isArray(n.children)&&n.children[0]===e}getPreviousBlock(t){if(t&&t.parent&&t.parent.children){const e=t.parent.children.indexOf(t);if(e>0)return t.parent.children[e-1];if(this.isRTEBlock(t.parent)&&0===e)return this.getPreviousBlock(t.parent)}}getBlockLastNode(t){return t.getLastNode()}getBlockFirstNode(t){if("number-list"===t.type||"bullet-list"===t.type){if(t.children)return this.getBlockFirstNode(t.children[0])}else if(t.children)return t.children[0]}getNextBlock(t){if(t&&t.parent&&t.parent.children){const e=t.parent.children.indexOf(t);if(t.parent.children[e+1])return t.parent.children[e+1];if("list-item"===t.type&&t.parent.children.length===e+1)return this.getNextBlock(t.parent)}}isRTEBlock(t){return t&&"VegaRTEContent"!==t.constructor.name}}class It extends m{constructor(t,e){super(),this.isFlushable=!0,this.type=x.UPDATE_CODE_BLOCK,this.content=t,this.language=e}}class $t extends j{constructor(t){super(),this.isFlushable=!1,this.range=t}toAnnotation(){return new I(this.range)}}class RTEDecoratorNode extends RTENode{constructor(){super(...arguments),this.type="decorator-node",this.isSelected=!1}static isDecoratorNodeContainerElement(t){return t&&t.classList.contains(RTEDecoratorNode.DECORATOR_CONTAINER_CLASS)}static getDecoratorNodeElement(t){return t.querySelector(`.${RTEDecoratorNode.DECORATOR_NODE_CLASS}`)}getRangeEndOffset(){return 1}getRangeContainer(){const t=this.getElementRef();if(t)return h(t,`.${RTEDecoratorNode.DECORATOR_CONTAINER_CLASS}`)}isContentEditable(){return!1}}RTEDecoratorNode.DECORATOR_CONTAINER_CLASS="v-internal-decorator-container",RTEDecoratorNode.DECORATOR_NODE_CLASS="v-internal-decorator-node";class RTECodeBlockNode extends RTEDecoratorNode{constructor(t,e,s,n){super(t),this.type=w.CODE_BLOCK_NODE,this.text="",this.annotationMap=new Map,this.text=e,this.parent=n,this.language=s}toJSON(){return{id:this.id,type:"text",text:this.text,language:this.language}}toHtml(){return`<code style='box-sizing: border-box;color: rgba(var(--v-text-primary, 32, 54, 69, 1));text-align: left;font-family: "Roboto Mono";font-weight: 400;line-height: 22px;font-size: 16px;white-space: pre-wrap;min-height: 22px;tab-size: 2px;'>${this.text}</code>`}clone(t){return new RTECodeBlockNode(this.id,this.text,this.language,t)}doAnnotationActionApply(t){y.executeTheStrategy(t,this)}doModifyActionApply(t){y.executeTheStrategy(t,this)}}y.register(x.UPDATE_CODE_BLOCK,RTECodeBlockNode.name,new class extends q{handleAction(t,e){const{content:s,language:n}=t;e.language=n,e.text=s}}),y.register($t.name,RTECodeBlockNode.name,new class extends q{handleAction(t,e){e.annotationMap.set(u.SELECTION_RANGE,t.toAnnotation())}});var Mt;!function(t){t.CSS="css",t.HTML="html",t.JavaScript="js",t.JSX="jsx",t["Plain Text"]="plainText",t.TypeScript="ts",t.TSX="tsx"}(Mt||(Mt={}));class Ht extends q{handleAction(t,e){e.children=e.children.filter((e=>e!==t.entityToBeRemoved)),0===e.children.length&&"parent"in e&&e.parent&&(e.isListItemBlock()&&e.nestList&&e.nestList.length||e.parent.apply(new St(e)))}}class RTECodeBlock extends RTEBlock{constructor(t,e,s){super(t),this.type="code-block",this.children=[new RTECodeBlockNode(`${t}-1`,e,s,this)]}static from(t){return new RTECodeBlock(t.id,t.content,t.language)}toJSON(){const{language:t,text:e}=this.children[0];return{id:this.id,type:"code-block",content:e,language:t}}toHtml(){const{language:t=Mt["Plain Text"]}=this.children[0];return`<pre data-language="${t}" style="background-color: rgba(var(--v-bg-secondary, 245, 247, 247, 1)); padding: 12px">${this.children.map((t=>t.toHtml()))}</pre>`}clone(t){const e=RTECodeBlock.from(this.toJSON());return e.parent=t,e}apply(n){if(n instanceof m&&y.executeTheStrategy(n,this),n.isFlushable){const n=T.getDOMByEntity(this);if(n){const r=e.getSubjectFromParentNodeByEventId(n,s);r&&t.notify(r,{})}}}isNotEmpty(){return!!this.children.length}getLastNode(){return this.children[0]}isSelected(){return this.children[0].annotationMap.has(u.SELECTION_RANGE)}}y.register(x.DELETE_CODE_BLOCK,RTECodeBlock.name,new class extends Dt{handleAction(t,e){const s=e.children[0],n=e.parent;if(n){let t=this.getPreviousNode(s),r=this.getRTENodeEndOffset(t);t||(t=this.getNextNode(s),r=0),n.apply(new St(e));const i=t?T.getDOMByEntity(t):null;if(0===n.children.length){const s=RTETextBlock.from({id:c(),type:"paragraph",nodes:[{id:c(),type:"text",text:""}]});e.parent.apply(new gt([s])),t=s.children[0],r=0}this.notifyUpdateSelection(t,i,r,e)}}notifyUpdateSelection(s,r,i,o){const c=T.getDOMByEntity(o);if(c){const o=e.getSubjectFromParentNodeByEventId(c,n);o&&t.notify(o,{node:s,updateDirectly:!!r,offset:i})}}getRTENodeEndOffset(t){return t?t.getRangeEndOffset():0}}),y.register(x.DELETE_CHILDREN,RTECodeBlock.name,new Ht),y.register(x.SWITCH_OUT_FROM_CODE_BLOCK,RTECodeBlock.name,new class extends q{handleAction(s,r){const{content:i,language:o}=s,a=i.split("\n"),l=new It(a.slice(0,a.length-2).join("\n"),o);l.isFlushable=!1,r.children[0].apply(l);const h=RTETextBlock.from({id:c(),type:"paragraph",nodes:[{id:c(),text:"",type:"text"}]});r.parent.apply(new Ot(r,h));const u=T.getDOMByEntity(r);if(u){const s=e.getSubjectFromParentNodeByEventId(u,n);s&&t.notify(s,{node:h.children[0]})}}}),y.register(x.INSERT_IMAGE_TO_BLOCK,RTECodeBlock.name,new class extends q{handleAction(t,e){e.parent.apply(new Ot(e,t.imageBlockToBeInserted))}}),RTECodeBlock.CODE_BLOCK_PLACEHOLDER_CLASS_NAME="code-block-placeholder-element";export{Et as $,y as A,At as B,C,w as D,S as E,j as F,Nt as G,_t as H,Ot as I,vt as J,Dt as K,Ht as L,m as M,v as N,F as O,K as P,Mt as Q,L as R,X as S,mt as T,ut as U,W as V,it as W,E as X,It as Y,U as Z,$t as _,R as a,RTECodeBlockNode as a0,Z as a1,rt as a2,ct as a3,wt as a4,P as a5,et as a6,st as a7,ot as a8,jt as a9,RTETextNode as b,x as c,q as d,RTETextBlock as e,RTEBlock as f,_ as g,gt as h,RTENode as i,Bt as j,u as k,Lt as l,bt as m,kt as n,Rt as o,yt as p,Ct as q,St as r,T as s,f as t,d as u,k as v,b as w,RTECodeBlock as x,g as y,RTEDecoratorNode as z}
1
+ import{C as t}from"./p-2d0d575f.js";import{d as e}from"./p-31ac7386.js";import{a as s,b as n}from"./p-7c39ce96.js";import{c as r}from"./p-02841589.js";import{L as i}from"./p-6e1ab235.js";import{i as o}from"./p-415ffa35.js";import{g as c}from"./p-8b5d3a52.js";import{V as a}from"./p-8ac2d165.js";import{c as l}from"./p-bf19682d.js";import{f as h}from"./p-6c170474.js";var u,d;!function(t){t.SELECTION_RANGE="SELECTION_RANGE",t.CLEAR_FORMATTING="CLEAR_FORMATTING",t.LINK_GROUP="LINK_GROUP"}(u||(u={}));class p{}!function(t){t.ALIGNMENT="ALIGNMENT",t.TEXT_STYLE="TEXT_STYLE",t.INDENT="INDENT",t.LIST="LIST",t.INTERNAL_WRAPPER="INTERNAL_WRAPPER"}(d||(d={}));class f extends p{}const T=new class{constructor(){this.domToEntity=new WeakMap,this.entityToDOM=new WeakMap,this.contentEntityToRootDom=new Map,this.rootDomToContentEntity=new WeakMap}register(t,e){this.isVegaRTEContent(e)?this.registerRootDomAndContentEntity(t,e):(this.domToEntity.set(t,e),this.entityToDOM.set(e,t))}getEntityByDOM(t){return this.domToEntity.get(t)}getDOMByEntity(t){return this.isVegaRTEContent(t)?this.contentEntityToRootDom.get(t):this.entityToDOM.get(t)}removeDirtyDomRef(t){this.domToEntity.delete(t)}registerRootDomAndContentEntity(t,e){const s=this.rootDomToContentEntity.get(t);s&&s!==e&&this.contentEntityToRootDom.delete(s),this.rootDomToContentEntity.set(t,e),this.contentEntityToRootDom.set(e,t)}isVegaRTEContent(t){return t&&"VegaRTEContent"===t.constructor.name}};var x,E,g,w;!function(t){t.DELETE_CHILDREN="DELETE_CHILDREN",t.DELETE_NEST_LIST="DELETE_NEST_LIST",t.UPDATE_TEXT="UPDATE_TEXT",t.REPLACE_SELECTED_TEXT="REPLACE_SELECTED_TEXT",t.APPEND_CHILDREN="APPEND_CHILDREN",t.INSERT_CHILDREN_AFTER="INSERT_CHILDREN_AFTER",t.INSERT_CHILDREN_BEFORE="INSERT_CHILDREN_BEFORE",t.SPLIT_BLOCK_WITH_NODE="SPLIT_BLOCK_WITH_NODE",t.REPLACE_CHILD_NODES="REPLACE_CHILD_NODES",t.REPLACE_NEST_LIST="REPLACE_NEST_LIST",t.MERGE_TWO_BLOCKS_NODES="MERGE_TWO_BLOCKS_NODES",t.INSERT_NEW_PARAGRAPH="INSERT_NEW_PARAGRAPH",t.LINE_BREAK_SINGLE_BLOCK="LINE_BREAK_SINGLE_BLOCK",t.LINE_BREAK_MULTIPLE_BLOCKS="LINE_BREAK_MULTIPLE_BLOCKS",t.TRANSFORM_LIST_BLOCK="TRANSFORM_LIST_BLOCK",t.TRANSFORM_PARAGRAPH_BLOCK="TRANSFORM_PARAGRAPH_BLOCK",t.DELETE_BLOCK_CONTENT="DELETE_BLOCK_CONTENT",t.INSERT_IMAGE_TO_BLOCK="INSERT_IMAGE_TO_BLOCK",t.UPDATE_IMAGE_NODE_URL="UPDATE_IMAGE_NODE_URL",t.TRANSFORM_TO_CODE_BLOCK="TRANSFORM_TO_CODE_BLOCK",t.UPDATE_CODE_BLOCK="UPDATE_CODE_BLOCK",t.SWITCH_OUT_FROM_CODE_BLOCK="SWITCH_OUT_FROM_CODE_BLOCK",t.DELETE_CODE_BLOCK="DELETE_CODE_BLOCK",t.UNLINK_LINK_GROUP="UNLINK_LINK_GROUP",t.LINK_GROUP_NODE_SPLIT="LINK_GROUP_NODE_SPLIT",t.DELETE_LINK_GROUP="DELETE_LINK_GROUP",t.UPDATE_CURSOR_POSITION="UPDATE_CURSOR_POSITION",t.INSERT_TEXT_TO_DECORATOR_NODE="INSERT_TEXT_TO_DECORATOR_NODE",t.INSERT_NODE_TO_NEAREST_ROOT="INSERT_NODE_TO_NEAREST_ROOT",t.PASTE_CONTENT="PASTE_CONTENT"}(x||(x={}));class m{constructor(){this.isFlushable=!1}}class A extends p{constructor(t){super(),this.type=u.LINK_GROUP,this.linkGroups=new Map,this.linkGroups=new Map([[t,[]]])}clone(){const t=new A("");return this.linkGroups.forEach(((e,s)=>{t.linkGroups.set(s,e.map((t=>t.clone(t.parent))))})),t}toString(t,e){const s=this.toJsx(t,e);return Object.entries(s).map((([t,e])=>{const s="string"==typeof e?e:this.formatStyleToString(e);return`${r(t)}="${s}"`})).join(" ")}toJsx(t,e){const s=this.getStyle(t,e),n=this.getClass(t,e),r=this.getAttribute(t);return n.length>0&&(r.class=n.join(" ")),s&&Object.keys(s).length>0&&(r.style=s),r}getClass(t,e){const s=[];return t.link.customClass&&s.push(...t.link.customClass),!(null==e?void 0:e.standalone)&&t.useInternalStyle&&s.push("v-rte--link"),s}getStyle(t,e){const s={};return t.link.customStyle&&Object.assign(s,t.link.customStyle),(null==e?void 0:e.standalone)&&t.useInternalStyle&&(s.color="rgba(var(--v-text-link, 19, 98, 226, 1))"),s}getAttribute(t){const{href:e,customAttribute:s={}}=t.link,n=t.useInternalStyle,r=s.target||(n?"_blank":"");return Object.assign(Object.assign(Object.assign({},s),e||n?{href:e}:{}),r?{target:r}:{})}formatStyleToString(t){return Object.entries(t).map((([t,e])=>`${r(t)}: ${e};`)).join(" ")}}class O extends f{constructor(t){super(),this.type=d.ALIGNMENT,this.textAlign=t}static from(t){return[d.ALIGNMENT,new O(t)]}toJSON(){return{textAlign:this.textAlign}}renderClass(t){if(null==t?void 0:t.standalone)return null;switch(this.textAlign){case"right":case"center":case"justify":return`v-rte--horizontal-alignment-${this.textAlign}`;case"left":default:return"v-rte--horizontal-alignment-left"}}clone(){return new O(this.textAlign)}renderStyle(t){if(!(null==t?void 0:t.standalone))return null;switch(this.textAlign){case"right":case"center":case"justify":return{textAlign:this.textAlign};case"left":default:return{textAlign:"left"}}}}class N extends f{constructor(t){super(),this.type=d.INDENT,this.indent=Math.max(0,t)}static from(t){return[d.INDENT,new N(t)]}toJSON(){return this.indent>0?{indent:this.indent}:null}clone(){return new N(this.indent)}renderClass(){return null}renderStyle(){return this.indent>0?{marginLeft:16*this.indent+"px"}:null}}class R{static register(t,e,s){this.registry.has(e)||this.registry.set(e,new Map),this.registry.get(e).has(t)||this.registry.get(e).set(t,new Set),this.registry.get(e).get(t).add(s)}static unregister(t,e,s){const n=this.registry.get(e);if(n){const e=n.get(t);e&&e.delete(s)}}static get(t,e){const s=t instanceof m?t.type:t.constructor.name,n=this.registry.get(e.constructor.name);if(n){const r=n.get(s);if(r&&r.size>0)return Array.from(r).find((s=>s.canIntercept(t,e)))}}}R.registry=new Map;class y{static register(t,e,s){this.registry.has(e)||this.registry.set(e,new Map),this.registry.get(e).set(t,s)}static unregister(t,e){const s=this.registry.get(e);s&&s.delete(t)}static get(t,e){const s=this.registry.get(e);if(s)return s.get(t)}static executeTheStrategy(t,e){const s=R.get(t,e),n=()=>{const s=t instanceof m?t.type:t.constructor.name,n=y.get(s,e.constructor.name);if(n)return t.executedFlag=!0,n.execute(t,e);i.warn(`Type ${s} action handle strategy is not registered in class ${e.constructor.name}`)};return s?s.intercept(n,t,e):n()}static canHandle(t,e){return!!y.get(t,e.constructor.name)}}y.registry=new Map,function(t){t.CUSTOM_ATTRIBUTE="CUSTOM_ATTRIBUTE",t.CUSTOM_CLASS="CUSTOM_CLASS",t.CUSTOM_STYLE="CUSTOM_STYLE"}(E||(E={}));class S extends p{}class C extends S{constructor(t){super(),this.type=E.CUSTOM_ATTRIBUTE,this.BOOLEAN_ATTRS=new Set(["controls","disabled","checked","readonly","multiple","required","autoplay","muted"]),this.customAttribute=t}static from(t){return[E.CUSTOM_ATTRIBUTE,new C(t)]}toJSON(){return{customAttribute:this.customAttribute}}clone(){return new C(this.customAttribute)}toString(t=[]){const e=t.map((t=>t.split("=")[0]));return Object.keys(this.customAttribute).map((t=>e.includes(t)?null:`${t}="${this.customAttribute[t]}"`)).filter(o)}render(t={}){var e;const s=Object.assign({},this.customAttribute);return null===(e=t.filterAttributes)||void 0===e||e.forEach((t=>delete s[t])),Object.keys(s).forEach((t=>{this.BOOLEAN_ATTRS.has(t)&&""===s[t]&&(s[t]="true")})),s}}class b extends S{constructor(t){super(),this.type=E.CUSTOM_CLASS,this.customClass=t}static from(t){return[E.CUSTOM_CLASS,new b(t)]}toJSON(){return{customClass:this.customClass}}clone(){return new b(this.customClass)}toString(){return`class="${this.customClass.join(" ")}"`}renderClass(){return this.customClass}}class k extends S{constructor(t){super(),this.type=E.CUSTOM_STYLE,this.customStyle=t}static from(t){return[E.CUSTOM_STYLE,new k(t)]}toJSON(){return{customStyle:this.customStyle}}clone(){return new k(this.customStyle)}renderStyle(){return this.customStyle}removeStyles(t){const e=Object.assign({},this.customStyle);return t.forEach((t=>delete e[t])),e}toString(){return`style="${Object.entries(this.customStyle).map((([t,e])=>`${t}: ${e};`)).join(" ")}"`}}class B extends f{constructor(t){super(),this.type=d.INTERNAL_WRAPPER,this.internalWrapper=t}static from(t){return[d.INTERNAL_WRAPPER,new B(t)]}clone(){return new B(this.internalWrapper)}renderClass(){}renderStyle(){}toJSON(){return this.internalWrapper?{internalWrapper:this.internalWrapper}:void 0}}!function(t){t.BOLD="BOLD",t.ITALIC="ITALIC",t.UNDERLINE="UNDERLINE",t.STRIKETHROUGH="STRIKETHROUGH",t.SELECTION_RANGE="SELECTION_RANGE",t.IMAGE="IMAGE",t.CODE="CODE",t.TEXT_COLOR="TEXT_COLOR",t.LINK="LINK",t.INLINE_HTML="INLINE_HTML",t.PLAIN_TEXT="PLAIN_TEXT"}(g||(g={}));class v extends p{}class _{constructor(t){this.dtoType=t instanceof RTEBlock?"block":"node",this.annotationMap=t.annotationMap}toCssText(t={standalone:!1},e,s){return s=s||this.toJSON(t,e),Object.entries(Object.assign({},s)).map((([t,e])=>`${r(t)}: ${e};`)).join("")}toJSON(t={standalone:!1},e){const s=Array.from(this.annotationMap.values()).filter((t=>this.filterAnnotation(t)||t instanceof k)).map((e=>e.renderStyle(t))).filter(o);return e&&e.length>0?this.mergeAnnotationStyles(s,e):s.reduce(((t,e)=>Object.assign(Object.assign({},t),e)),{})}filterAnnotation(t){return"block"===this.dtoType?t instanceof f:t instanceof v}mergeAnnotationStyles(t,e){const s={};for(const n of t)for(const t in n){const r=n[t],i=s[t];s[t]="string"==typeof i&&"string"==typeof r&&e.includes(t)?Array.from(new Set(`${i} ${r}`.split(/\s+/).filter(Boolean))).join(" "):r}return s}}!function(t){t.TEXT="TEXT",t.IMAGE="IMAGE",t.CODE_BLOCK_NODE="CODE_BLOCK_NODE"}(w||(w={}));class RTENode{constructor(t,e){this.annotationMap=new Map,this.id=t,e&&(this.annotationMap=e)}static from(t,e,s){throw new Error(`[Vega] ${this.constructor.name}.from(${JSON.stringify(t)}, ${e}, ${s}) is not implemented. Please implement this method in the subclass.`)}static createAnnotationEntity(t,e){switch(t){case"customAttribute":return C.from(e);case"customClass":return b.from(e);case"customStyle":return k.from(e)}}getAnnotationByType(t){return this.annotationMap.get(t)}deleteAnnotationByType(t){this.annotationMap.delete(t),this.flushChange()}apply(t){return this.doApply(t),t.isFlushable&&this.flushChange(),this}getStyles(t={standalone:!1}){return new _(this).toJSON(t,["textDecoration"])}getClasses(t={standalone:!1}){return Array.from(this.annotationMap.values()).filter((t=>t instanceof v||t instanceof b)).map((e=>e.renderClass(t))).filter(o).reduce(((t,e)=>[t,e].join(" ").trim()),"")}getCustomAttributesAnnotation(){return this.annotationMap.get(E.CUSTOM_ATTRIBUTE)}isTextNode(){return!1}getElementRef(){return T.getDOMByEntity(this)}generateAttributeString(...t){var e;const s=new _(this).toCssText({standalone:!0},["textDecoration"]),n=this.annotationMap.get(E.CUSTOM_CLASS),r=[...(null===(e=this.getCustomAttributesAnnotation())||void 0===e?void 0:e.toString(t))||[],null==n?void 0:n.toString(),s?`style="${s}"`:null,...t].filter(o);return r.length?` ${r.join(" ")}`:""}doApply(t){t instanceof m?this.doModifyActionApply(t):this.doAnnotationActionApply(t)}flushChange(){const n=T.getDOMByEntity(this);if(n){const r=e.getSubjectFromParentNodeByEventId(n,s);r&&t.notify(r,{})}}cloneAnnotations(){return new Map(Array.from(this.annotationMap.entries()).map((([t,e])=>[t,e.clone()])))}doAnnotationActionApply(t){}doModifyActionApply(t){}}const L=new class{constructor(){this.RTE_BLOCK_DTO_CLASS_MAP=new Map,this.RTE_NODE_DTO_CLASS_MAP=new Map}registerRTEDTOClass(t,e){if(e.prototype instanceof RTEBlock)this.RTE_BLOCK_DTO_CLASS_MAP.set(t,e);else{if(!(e.prototype instanceof RTENode))throw new Error(`Invalid RTE DTO class type: ${t}`);this.RTE_NODE_DTO_CLASS_MAP.set(t,e)}}getRTEBlockClass(t){return this.RTE_BLOCK_DTO_CLASS_MAP.get(t)}getRTENodeClass(t){return this.RTE_NODE_DTO_CLASS_MAP.get(t)}};class RTEBlock{constructor(t){this.annotationMap=new Map,this.id=t}static from(t,e){throw new Error(`[Vega] ${this.constructor.name}.from(${JSON.stringify(t)}, ${e}) is not implemented. Please implement this method in the subclass.`)}static generateBlockChildren(t,e,s){return t.map((t=>{const n=L.getRTEBlockClass(t.type);if(n){const r=n.from(t,e);return r.parent=s,r}})).filter(o)}static createAnnotationEntity(t,e){switch(t){case"textAlign":return O.from(e);case"indent":return N.from(e);case"customAttribute":return C.from(e);case"customClass":return b.from(e);case"customStyle":return k.from(e);case"internalWrapper":return B.from(e)}}static convertAnnotationsToMap(t,e){Object.entries(e).forEach((([e,s])=>{const n=this.createAnnotationEntity(e,s);o(n)&&t.set(...n)}))}shouldRenderAsInternalWrapper(){const t=this.getAnnotationByType(d.INTERNAL_WRAPPER);return!!t&&t.internalWrapper&&0===Array.from(this.annotationMap.values()).filter((t=>!(t instanceof A||t instanceof B))).length}toJSON(){const t=Array.from(this.annotationMap.values()).filter((t=>t instanceof f||t instanceof S)).reduce(((t,e)=>Object.assign(Object.assign({},t),e.toJSON())),{});return Object.assign({id:this.id},Object.keys(t).length>0?{annotations:t}:{})}getAnnotationByType(t){return this.annotationMap.get(t)}apply(n){if(this.doApply(n),n.isFlushable){const n=T.getDOMByEntity(this);if(n){const r=e.getSubjectFromParentNodeByEventId(n,s);r&&t.notify(r,{})}}}isListItemBlock(){return"list-item"===this.type}getStyles(t={standalone:!1}){const e=new _(this).toJSON(t);return Object.assign(Object.assign({},e),this.shouldRenderAsInternalWrapper()?{display:"contents"}:{})}getClasses(t={standalone:!1}){return Array.from(this.annotationMap.values()).filter((t=>t instanceof f||t instanceof b)).map((e=>e.renderClass(t))).filter(o).reduce(((t,e)=>[t,e].join(" ").trim()),"")}getCustomAttributesAnnotation(){return this.annotationMap.get(E.CUSTOM_ATTRIBUTE)}generateAttributeString(...t){var e;const s=new _(this).toCssText({standalone:!0}),n=this.annotationMap.get(E.CUSTOM_CLASS),r=[...(null===(e=this.getCustomAttributesAnnotation())||void 0===e?void 0:e.toString(t))||[],null==n?void 0:n.toString(),s?`style="${s}"`:null,...t].filter(o);return r.length?` ${r.join(" ")}`:""}doApply(t){t instanceof m?y.executeTheStrategy(t,this):this.applyAnnotationAction(t)}applyAnnotationAction(t){const e=t.toAnnotation();e instanceof A||this.annotationMap.set(e.type,e),"function"==typeof this.doAnnotationActionApply&&this.doAnnotationActionApply(t)}cloneAnnotations(){return new Map(Array.from(this.annotationMap.entries()).map((([t,e])=>[t,e.clone()])))}}class j{}class D extends j{constructor(){super(...arguments),this.doSplit=!0}}class I extends p{constructor(t){super(),this.type=u.SELECTION_RANGE,this.range=t}clone(){return new I(this.range)}}class $ extends v{constructor(t){super(),this.type=g.STRIKETHROUGH,this.strikethrough=t}static from(t){return[g.STRIKETHROUGH,new $(t)]}toJSON(){return{strikethrough:this.strikethrough}}clone(){return new $(this.strikethrough)}renderClass(t){return(null==t?void 0:t.standalone)?null:this.strikethrough?"v-rte--strikethrough":null}renderStyle(t){return(null==t?void 0:t.standalone)&&this.strikethrough?{textDecoration:"line-through"}:null}}class M extends v{constructor(t){super(),this.type=g.UNDERLINE,this.underline=t}static from(t){return[g.UNDERLINE,new M(t)]}toJSON(){return{underline:this.underline}}clone(){return new M(this.underline)}renderClass(t){return(null==t?void 0:t.standalone)?null:this.underline?"v-rte--underline":null}renderStyle(t){return(null==t?void 0:t.standalone)&&this.underline?{textDecoration:"underline"}:null}}class H extends v{constructor(t){super(),this.type=g.ITALIC,this.italic=t}static from(t){return[g.ITALIC,new H(t)]}toJSON(){return{italic:this.italic}}clone(){return new H(this.italic)}renderClass(t){return(null==t?void 0:t.standalone)?null:this.italic?"v-rte--italic":null}renderStyle(t){return(null==t?void 0:t.standalone)&&this.italic?{fontStyle:"italic"}:null}}class P extends v{constructor(t){super(),this.type=g.BOLD,this.bold=t}static from(t){return[g.BOLD,new P(t)]}toJSON(){return{bold:this.bold}}clone(){return new P(this.bold)}renderClass(t){return(null==t?void 0:t.standalone)?null:this.bold?"v-rte--bold":null}renderStyle(t){return(null==t?void 0:t.standalone)&&this.bold?{fontWeight:"700"}:null}}class J extends v{constructor(t,e=!0){super(),this.type=g.CODE,this.code=t,this.useInternalStyle=e}static from(t,e){return[g.CODE,new J(t,e)]}toJSON(){return{code:this.code}}clone(){return new J(this.code,this.useInternalStyle)}renderClass(t){return(null==t?void 0:t.standalone)?null:this.code&&this.useInternalStyle?"v-rte--code":null}renderStyle(t){return(null==t?void 0:t.standalone)&&this.code&&this.useInternalStyle?{fontFamily:"Roboto Mono",whiteSpace:"pre-wrap"}:null}}const K={key:"black",light:"#111128",dark:"#E3E3E8"},F=[K,{key:"gray",light:"#5E5E6D",dark:"#B9B9C1"},{key:"green",light:"#01801F",dark:"#59D977"},{key:"red",light:"#BD2947",dark:"#FFB2B5"},{key:"purple",light:"#563D82",dark:"#BEB2FF"},{key:"teal",light:"#17758F",dark:"#4CD8FF"}],U="​",W=[["textStyles"],["bold","italic","underline","strikethrough","code"],["textColor"],["horizontalAlignment","bulletsNumbers"],["moreIndent","lessIndent"],["link"],["image"],["clearStyle"]];class G extends v{constructor(t){super(),this.type=g.TEXT_COLOR,this.textColor=this.formatTextColor(t)}static from(t){return[g.TEXT_COLOR,new G(t)]}toJSON(){return{textColor:this.textColor.key}}clone(){return new G(this.textColor.key)}renderClass(){return null}renderStyle(){return{color:a.isDarkMode()?this.textColor.dark:this.textColor.light}}formatTextColor(t){return F.find((e=>e.key===t))||F[0]}}class z extends v{constructor(t,e=!0){super(),this.type=g.LINK,this.link=t,this.useInternalStyle=e}static from(t,e=!0){return[g.LINK,new z(t,e)]}toJSON(){return{link:this.link}}clone(){return new z(this.link,this.useInternalStyle)}toEqual(t){return this.link.groupKey===t.link.groupKey}renderClass(){return null}renderStyle(){return null}}class V extends j{constructor(t,e,s){super(),this.isFlushable=!1,this.groupKey=t,this.nodes=e,this.type=s}toAnnotation(){return new A(this.groupKey)}}class X extends j{constructor(){super(),this.isFlushable=!1}toAnnotation(){return null}}class q{execute(t,e){return i.log(`Executing action ${t.constructor.name} on ${e.constructor.name} ${e.id}`),this.handleAction(t,e)}updateCustomStyleAnnotation(t,e){const s=t.annotationMap.get(E.CUSTOM_STYLE);s&&this.isCustomStyle(s,e)&&t.annotationMap.set(s.type,new k(s.removeStyles(e)))}createNewParagraph(t){const e=L.getRTEBlockClass("paragraph");if(e)return e.from({id:c(),type:"paragraph",nodes:[{id:c(),type:"text",text:t}]})}getRootContent(t){const e=t.parent;if(e)return"VegaRTEContent"===e.constructor.name?e:this.getRootContent(e)}isCaretPositionAtBlockStart(t,e,s){return e===t.children[0]&&0===s}isCaretPositionAtBlockEnd(t,e,s){return e.isContentEditable()?this.isCaretPositionAtTextBlockEnd(t,e,s):this.isCaretPositionAtDecoratorBlockEnd(t,e,s)}isCaretPositionAtTextBlockEnd(t,e,s){const n=t.children[t.children.length-1];return e===n&&(e.isEmpty()||s===n.text.length)}isCaretPositionAtDecoratorBlockEnd(t,e,s){return e===t.children[t.children.length-1]&&0!==s}isCustomStyle(t,e){return e.some((e=>Object.keys(t.customStyle).includes(e)))}}class Y extends m{constructor(t){super(),this.type=x.LINK_GROUP_NODE_SPLIT,this.splittedTextNodes=t}}class Q extends q{constructor(){super(...arguments),this.applyTargetNode=null}handleAction(t,e){const s=e.getAnnotationByType(u.SELECTION_RANGE);if(this.setApplyTargetNode(null),t instanceof D&&t.doSplit&&s){const{startContainer:t,endContainer:n,startOffset:r,endOffset:i}=s.range,o=t===n&&r===i;e.parent.children=e.parent.children.flatMap((t=>{if(t.id===e.id){if(o)return this.insertNewNode(r,e);if(this.shouldSplitSelection(s.range)&&e.isContentEditable()){const n=this.splitTextNode(s.range,e);return t.annotationMap.has("LINK")&&t.apply(new Y(n)),n}return this.setApplyTargetNode(e),e}return t}))}return this.applyTargetNode}insertNewNode(t,e){const s=e.cloneWithText("");this.setApplyTargetNode(s);const n=e.parent.children.findIndex((t=>t===e));return 0===t||!e.isContentEditable()&&t===n?[s,e]:t===e.text.length||!e.isContentEditable()&&t===n+1?[e,s]:[e.cloneWithText(e.text.substring(0,t)),s,e.cloneWithText(e.text.substring(t))]}shouldSplitSelection(t){const{startContainer:e,endContainer:s,startOffset:n,endOffset:r}=t;return e!==s||n>0||r<(s.textContent?s.textContent.length:0)}splitTextNode(t,e){const{startContainer:s,endContainer:n,startOffset:r}=t,i=s.parentElement,o=n.parentElement,c=(t,s,n)=>{const r=t.substring(0,s),i=t.substring(s,n),o=t.substring(n);return[e.cloneWithText(r),e.cloneWithText(i),e.cloneWithText(o)]},a=i&&T.getEntityByDOM(i),l=o&&T.getEntityByDOM(o);if(a&&a.id===e.id){const i=s===n?t.endOffset:e.text.length,[o,a,l]=c(e.text,r,i);return this.setApplyTargetNode(a),[o,a,l].filter((t=>!!t.text))}if(l&&l.id===e.id){const[s,n,r]=c(e.text,0,t.endOffset);return this.setApplyTargetNode(n),[s,n,r].filter((t=>!!t.text))}return this.setApplyTargetNode(e),e}setApplyTargetNode(t){this.applyTargetNode=t}}class Z extends D{constructor(t){super(),this.isFlushable=!0,this.bold=t}toAnnotation(){return new P(this.bold)}}class tt extends p{constructor(){super(...arguments),this.type=u.CLEAR_FORMATTING,this.items=[g.BOLD,g.ITALIC,g.UNDERLINE,g.STRIKETHROUGH,g.TEXT_COLOR,g.CODE,E.CUSTOM_STYLE]}}class et extends D{constructor(){super(...arguments),this.isFlushable=!0}toAnnotation(){return new tt}}class st extends D{constructor(t){super(),this.isFlushable=!0,this.code=t}toAnnotation(){return new J(this.code)}}class nt extends j{constructor(t){super(),this.isFlushable=!0,this.annotationType=t}toAnnotation(){}}class rt extends D{constructor(t){super(),this.isFlushable=!0,this.italic=t}toAnnotation(){return new H(this.italic)}}class it extends D{constructor({link:t,newText:e,needMergeNode:s,doSplit:n,type:r}){super(),this.isFlushable=!0,this.link=t,this.needMergeNode=s,this.newText=e,this.type=r,o(n)&&(this.doSplit=n)}toAnnotation(){return new z(this.link)}}class ot extends D{constructor(t){super(),this.isFlushable=!0,this.strikethrough=t}toAnnotation(){return new $(this.strikethrough)}}class ct extends D{constructor(t){super(),this.isFlushable=!0,this.underline=t}toAnnotation(){return new M(this.underline)}}class at extends q{handleAction(t,e){const s=t.toAnnotation();if(t instanceof nt)e.annotationMap.delete(t.annotationType);else{if(!(s instanceof tt))return s instanceof v||s instanceof I?(t instanceof it&&(o(t.newText)&&(e.text=t.newText),e.parent.apply(new V(t.link.groupKey,[e],t.type))),t instanceof st&&this.handleAction(new et,e),t instanceof Z&&this.updateCustomStyleAnnotation(e,["fontWeight"]),t instanceof rt&&this.updateCustomStyleAnnotation(e,["fontStyle"]),(t instanceof ct||t instanceof ot)&&this.updateCustomStyleAnnotation(e,["textDecoration"]),void e.annotationMap.set(s.type,s)):void 0;s.items.forEach((t=>{e.deleteAnnotationByType(t)}))}}}class lt extends m{constructor(){super(...arguments),this.type=x.DELETE_LINK_GROUP}}class ht extends q{handleAction(t,e){e.text=t.newTextContent,!e.text&&e.annotationMap.has("LINK")&&e.apply(new lt)}}class ut extends m{constructor(t){super(),this.type=x.UPDATE_TEXT,this.newTextContent="",this.newTextContent=t}}class dt extends q{handleAction(t,e){this.replaceSelectedText(t.textToBeInsert,t.currentRange,e)}replaceSelectedText(t,e,s){if(e&&e.startContainer&&e.endContainer){const{startContainer:n,endContainer:r,startOffset:i,endOffset:o}=e;let c=s.text;if(n===r&&i===o&&t)c=s.text.slice(0,i)+t+s.text.slice(i);else{const e=n.parentElement,a=r.parentElement,l=e&&T.getEntityByDOM(e),h=a&&T.getEntityByDOM(a);let u=0,d=s.text.length;l&&l===s?(u=i,d=n===r?o:d):h&&h===s&&(d=o),c=s.text.slice(0,u)+t+s.text.slice(d)}s.apply(new ut(c))}}}class pt extends p{constructor(t){super(),this.type=g.INLINE_HTML,this.htmlTag=t}static from(t){const{htmlTag:e,child:s,customStyle:n,customClass:r,customAttribute:i}=t,o=new pt(e);return o.child=s?pt.from(s)[1]:void 0,o.customAttribute=i?C.from(i)[1]:void 0,o.customClass=r?b.from(r)[1]:void 0,o.customStyle=n?k.from(n)[1]:void 0,[g.INLINE_HTML,o]}clone(){var t,e,s,n;const r=new pt(this.htmlTag);return r.child=null===(t=this.child)||void 0===t?void 0:t.clone(),r.customAttribute=null===(e=this.customAttribute)||void 0===e?void 0:e.clone(),r.customClass=null===(s=this.customClass)||void 0===s?void 0:s.clone(),r.customStyle=null===(n=this.customStyle)||void 0===n?void 0:n.clone(),r}toJSON(){var t,e,s,n;return{inlineHtml:l({htmlTag:this.htmlTag,child:null===(t=this.child)||void 0===t?void 0:t.toJSON().inlineHtml,customAttribute:null===(e=this.customAttribute)||void 0===e?void 0:e.toJSON().customAttribute,customClass:null===(s=this.customClass)||void 0===s?void 0:s.toJSON().customClass,customStyle:null===(n=this.customStyle)||void 0===n?void 0:n.toJSON().customStyle})}}}class ft extends q{handleAction(t,e){const s=e.parent.getAnnotationByType(u.LINK_GROUP);if(s){const n=e.annotationMap.get("LINK").link.groupKey,r=s.linkGroups.get(n);if(r){const i=r.indexOf(e);-1!==i&&(r.splice(i,1,...Array.isArray(t.splittedTextNodes)?t.splittedTextNodes:[t.splittedTextNodes]),s.linkGroups.set(n,r))}}}}class Tt extends q{handleAction(t,e){const s=e.parent.getAnnotationByType(u.LINK_GROUP);if(s){const t=e.annotationMap.get(g.LINK).link.groupKey,n=s.linkGroups.get(t);if(n){const r=n.indexOf(e);-1!==r&&n.splice(r,1),0===n.length&&s.linkGroups.delete(t),0===s.linkGroups.size&&e.parent.annotationMap.delete(u.LINK_GROUP)}}e.annotationMap.delete(g.LINK)}}class xt extends v{constructor(t){super(),this.type=g.PLAIN_TEXT,this.plainText=!0,this.plainText=t}static from(t){return[g.PLAIN_TEXT,new xt(t)]}clone(){return new xt(this.plainText)}renderClass(){}renderStyle(){}toJSON(){return this.plainText?{plainText:this.plainText}:void 0}}class Et extends D{constructor(t){super(),this.isFlushable=!0,this.textColor=t}toAnnotation(){return new G(this.textColor)}}class RTETextNode extends RTENode{constructor(t,e,s,n){super(t,n),this.type=w.TEXT,this.parent=s,this.text=e,this.registerModifyStrategy()}static supportsHtmlTag(t){return["span","code"].includes(t)}static from(t,e,s={autoMatchFormat:!0}){const n=new RTETextNode(t.id,t.text,e),{annotations:r}=t;return r&&(n.annotationMap=this.generateTextAnnotationMap(r,s,e,n)),n}static generateTextAnnotationMap(t,e,s,n){return new Map(Object.keys(t).map((r=>("link"===r&&t.link&&s&&n&&s.apply(new V(t.link.groupKey,[n],"link")),this.createAnnotationEntity(r,t[r],e)))).filter(o))}static createAnnotationEntity(t,e,s){const n=!(!s||!s.autoMatchFormat);switch(t){case"bold":return P.from(e);case"italic":return H.from(e);case"underline":return M.from(e);case"strikethrough":return $.from(e);case"code":return J.from(e,n);case"textColor":return G.from(e);case"link":return z.from(e,n);case"inlineHtml":return pt.from(e);case"plainText":return xt.from(e)}return RTENode.createAnnotationEntity(t,e)}toJSON(){const t=Array.from(this.annotationMap.values()).filter((t=>t instanceof v||t instanceof S||t instanceof pt)).reduce(((t,e)=>Object.assign(Object.assign({},t),e.toJSON())),{});return Object.assign(Object.assign({id:this.id},Object.keys(t).length>0?{annotations:t}:{}),{type:"text",text:this.text})}toHtml(){const t=this.getAnnotationByType(g.INLINE_HTML);return t?this.renderWithWrapperStr(t):this.renderTextStr()}cloneWithText(t){return new RTETextNode(c(),t,this.parent,super.cloneAnnotations())}clone(t){return new RTETextNode(this.id,this.text,t,super.cloneAnnotations())}isEmpty(){return!this.text||"​"===this.text||"\n"===this.text}isTextNode(){return!0}getRangeEndOffset(){return!this.isContentEditable()&&this.parent?this.parent.children.indexOf(this)+1:"\n"===this.text?0:this.text.length}getRangeContainer(){const t=this.getElementRef();if(t)return this.isContentEditable()?t.firstChild:t.parentElement}isContentEditable(){return!0}registerModifyStrategy(){const t=this.constructor.name;RTETextNode.registerActionStrategyStatus[t]||(this.isContentEditable()&&(y.register(x.UPDATE_TEXT,t,new ht),y.register(x.REPLACE_SELECTED_TEXT,t,new dt),y.register(x.LINK_GROUP_NODE_SPLIT,t,new ft),y.register(it.name,t,new at)),y.register(D.name,t,new Q),y.register(x.DELETE_LINK_GROUP,t,new Tt),y.register(Z.name,t,new at),y.register(et.name,t,new at),y.register(rt.name,t,new at),y.register(ct.name,t,new at),y.register(Et.name,t,new at),y.register(ot.name,t,new at),y.register(st.name,t,new at),y.register(j.name,t,new at),RTETextNode.registerActionStrategyStatus[t]=!0)}doAnnotationActionApply(t){const e=this.getAnnotationByType(u.SELECTION_RANGE);if(t instanceof D&&t.doSplit&&e){const e=y.get(D.name,this.constructor.name);if(e){const s=e.execute(t,this);s&&this.applyActionToNode(s,t)}}else this.applyActionToNode(this,t);"function"==typeof this.parent.mergeNodes&&this.parent.mergeNodes(t)}doModifyActionApply(t){y.executeTheStrategy(t,this)}applyActionToNode(t,e){const s=e.toAnnotation();if(e instanceof X)return void this.syncUpSelectedNodes(t);s instanceof I||this.syncUpSelectedNodes(t);const n=y.get(e.constructor.name,t.constructor.name);if(n)return void n.execute(e,t);const r=y.get(j.name,RTETextNode.name);r&&r.execute(e,t)}syncUpSelectedNodes(s){const r=this.getElementRef();if(r){const i=e.getSubjectFromParentNodeByEventId(r,n);i&&t.notify(i,{node:s})}}renderWithWrapperStr(t){const{htmlTag:e,customAttribute:s,customClass:n,customStyle:r,child:i}=t,c=[...(null==s?void 0:s.toString())||[],null==n?void 0:n.toString(),null==r?void 0:r.toString()].filter(o),a=c.length>0?` ${c.join(" ")}`:"";return i?`<${e}${a}>${this.renderWithWrapperStr(i)}</${e}>`:`<${e}${a}>${this.renderTextStr()}</${e}>`}renderTextStr(){var t;const e=(null===(t=this.getAnnotationByType(g.CODE))||void 0===t?void 0:t.code)?"code":"span",s=super.generateAttributeString();return"\n"===this.text?"<br>":this.shouldRenderAsPlainText()?this.text:`<${e}${s}>${this.text}</${e}>`}shouldRenderAsPlainText(){const t=super.getAnnotationByType(g.PLAIN_TEXT);return!!t&&t.plainText&&0===Array.from(this.annotationMap.values()).filter((t=>t instanceof v&&!(t instanceof z)&&!(t instanceof xt)||t instanceof S)).length}}RTETextNode.registerActionStrategyStatus={},RTETextNode.htmlTag="span";class gt extends m{constructor(t){super(),this.type=x.APPEND_CHILDREN,this.entityToBeAppended=t}}class wt extends f{constructor(t){super(),this.type=d.TEXT_STYLE,this.textStyle=t}static from(t){return[d.TEXT_STYLE,new wt(t)]}toJSON(){return{textStyle:this.textStyle}}clone(){return new wt(this.textStyle)}renderClass(t){return(null==t?void 0:t.standalone)?null:this.textStyle?`v-rte--text-style-${this.textStyle}`:null}renderStyle(t){if(!(null==t?void 0:t.standalone))return null;const e={fontFamily:"Inter",fontSize:"16px",lineHeight:"22px",minHeight:"22px",fontWeight:"500"},s=Object.assign(Object.assign({},e),{marginTop:"0px",marginBottom:"0px"});switch(this.textStyle){case"paragraph":return s;case"title":return Object.assign(Object.assign({},e),{fontSize:"36px",lineHeight:"40px",minHeight:"40px"});case"subtitle":return Object.assign(Object.assign({},e),{fontSize:"28px",lineHeight:"32px",minHeight:"32px"});case"heading-1":return Object.assign(Object.assign({},e),{fontSize:"22px",lineHeight:"24px",minHeight:"24px",marginTop:"0px",marginBottom:"0px"});case"heading-2":return Object.assign(Object.assign({},e),{fontSize:"20px",lineHeight:"24px",minHeight:"24px",marginTop:"0px",marginBottom:"0px"});case"heading-3":return Object.assign(Object.assign({},e),{fontSize:"18px",lineHeight:"22px",minHeight:"22px",marginTop:"0px",marginBottom:"0px"});case"heading-4":return Object.assign(Object.assign({},e),{fontSize:"16px",lineHeight:"22px",minHeight:"22px",marginTop:"0px",marginBottom:"0px"});case"heading-5":return Object.assign(Object.assign({},e),{fontSize:"14px",lineHeight:"22px",minHeight:"22px",marginTop:"0px",marginBottom:"0px"});case"heading-6":return Object.assign(Object.assign({},e),{fontSize:"12px",lineHeight:"22px",minHeight:"22px",marginTop:"0px",marginBottom:"0px"})}}}class mt extends j{constructor(t,e){super(),this.isFlushable=!0,this.textStyle=t,this.bold=e}toAnnotation(){return new wt(this.textStyle)}}class At extends q{handleAction(t,e){"list-item"!==e.type&&(e.type=t.textStyle),e.children.forEach(t.bold?t=>{const e=new Z(!0);e.doSplit=!1,t.apply(e)}:t=>{t.apply(new nt(g.BOLD))}),this.updateCustomStyleAnnotation(e,["fontFamily","lineHeight","fontWeight","fontSize"])}}class Ot extends m{constructor(t,...e){super(),this.type=x.INSERT_CHILDREN_AFTER,this.referChildren=t,this.childrenToBeInserted=e}}class Nt extends m{constructor(t){super(),this.type=x.REPLACE_CHILD_NODES,this.newChildNodes=t}}class Rt extends q{handleAction(t,e){t.newBlock=this.splitTextNodeBlock(t.splitPointNode,t.startOffsetOfNode,e)}splitTextNodeBlock(t,e,s){if(t){const n=t.text.slice(0,e),r=t.text.slice(e),i=s.children.indexOf(t);if(i>-1){const e=s.children.slice(0,i),o=s.children.slice(i+1);n&&e.push(t.cloneWithText(n)),r&&o.unshift(t.cloneWithText(r)),s.apply(new Nt(e));const c=s.cloneWithNodes(o);return s.parent.apply(new Ot(s,c)),c}}}}class yt extends q{handleAction(t,e){e.children=[],e.apply(new gt(t.newChildNodes))}}class St extends m{constructor(t){super(),this.type=x.DELETE_CHILDREN,this.entityToBeRemoved=t}}class Ct extends q{handleAction(t,e){const s=t.blockNeedToBeMerged;if(e.type===s.type||"image"!==e.type&&"image"!==s.type){let t=s.children;"image"!==s.type&&(t=s.children.filter((t=>t.text))),e.apply(new gt(t)),s.parent.apply(new St(s))}}}class bt extends q{handleAction(t,e){t.lineBreakNode=this.lineBreakSingleBlock(t.startContainerNode,t.startOffset,e)}lineBreakSingleBlock(t,e,s){if(t){const n=new RTETextNode(c(),"\n",s),r=t.text.slice(0,e),i=t.text.slice(e),o=s.children.indexOf(t);if(o>-1){const e=s.children.slice(0,o),c=s.children.slice(o+1);r&&e.push(t.cloneWithText(r)),i&&c.unshift(t.cloneWithText(i)),this.mergeLineBreakNodes(e,n,c,s)}return n}}mergeLineBreakNodes(t,e,s,n){(0===s.length||s[0]&&""===s[0].text)&&s.push(new RTETextNode(c(),"\n",n,t[t.length-1]&&t[t.length-1].annotationMap)),n.apply(new Nt([...t,e,...s]))}}class kt extends q{handleAction(t,e){t.lineBreakNode=this.lineBreakMultipleBlocks(t.selectedBlocks,e)}lineBreakMultipleBlocks(t,e){const s=e.children,n=new RTETextNode(c(),"\n",e),r=this.concatBlocksNodes(t.slice(1));return this.mergeLineBreakNodes(s,n,r,e),n}concatBlocksNodes(t){const e=[];return t.map((t=>{"image"!==t.type&&(e.push(...t.children),t.parent.apply(new St(t)))})),e}mergeLineBreakNodes(t,e,s,n){(0===s.length||s[0]&&""===s[0].text)&&s.push(new RTETextNode(c(),"\n",n,t[t.length-1]&&t[t.length-1].annotationMap)),n.apply(new Nt([...t,e,...s]))}}class Bt extends m{constructor(t,...e){super(),this.type=x.INSERT_CHILDREN_BEFORE,this.referChildren=t,this.childrenToBeInserted=e}}class vt extends m{constructor(t,e){super(),this.type=x.SPLIT_BLOCK_WITH_NODE,this.splitPointNode=t,this.startOffsetOfNode=e}}class _t extends j{constructor(t){super(),this.isFlushable=!0,this.textAlign=t}toAnnotation(){return new O(this.textAlign)}}class Lt extends q{handleAction(t,e){this.updateCustomStyleAnnotation(e,["textAlign"])}}class jt extends j{constructor(t){super(),this.isFlushable=!0,this.indent=t}toAnnotation(){return new N(this.indent)}}class RTETextBlock extends RTEBlock{constructor(t,e,s){super(t),this.children=[],this.type=e;const{autoMatchFormat:n}=s||{autoMatchFormat:!0};n&&(this.annotationMap=RTETextBlock.isAcceptableTextStyle(e)?new Map([wt.from(e)]):new Map([wt.from("paragraph")]))}static from(t,e={autoMatchFormat:!0}){var s,n;const r=new RTETextBlock(t.id,t.type,e),i=e.autoMatchFormat?Object.assign(Object.assign({},t.annotations),{textStyle:null!==(n=null===(s=t.annotations)||void 0===s?void 0:s.textStyle)&&void 0!==n?n:r.type}):t.annotations;return r.children=t.nodes.map((t=>{const s=L.getRTENodeClass(t.type);if(s)return s.from(t,r,e)})).filter(o),i&&super.convertAnnotationsToMap(r.annotationMap,i),r}static createAnnotationEntity(t,e){return"textStyle"===t?wt.from(e):super.createAnnotationEntity(t,e)}static isAcceptableTextStyle(t){return["title","subtitle","paragraph","heading-1","heading-2","heading-3","heading-4","heading-5","heading-6"].includes(t)}mergeNodes(t){this.children=this.children.reduce(((e,s)=>{const n=e.at(-1);if(t instanceof it&&t.needMergeNode){const t=null==n?void 0:n.getAnnotationByType(g.LINK),r=s.getAnnotationByType(g.LINK);if(t&&r&&t.toEqual(r))return e}return[...e,s]}),[])}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{type:this.type,nodes:this.children.map((t=>t.toJSON()))})}toHtml(){const t=this.getBlockTag(),e=super.generateAttributeString(),s=this.getChildrenHtml();return super.shouldRenderAsInternalWrapper()?s:[`<${t}${e}>`,s,`</${t}>`].join("")}cloneWithNodes(t){const e=new RTETextBlock(c(),this.type);return e.annotationMap=super.cloneAnnotations(),e.apply(new gt(t)),e}clone(t){const e=new RTETextBlock(this.id,this.type);return e.children=this.children.map((t=>t.clone(e))),e.annotationMap=super.cloneAnnotations(),e.parent=t,e}isNotEmpty(){return this.children.length>0&&this.children.some((t=>!t.isEmpty()))}getLastNode(){return this.children[this.children.length-1]}getBlockTag(){switch(this.type){case"title":case"subtitle":return"div";case"heading-1":return"h1";case"heading-2":return"h2";case"heading-3":return"h3";case"heading-4":return"h4";case"heading-5":return"h5";case"heading-6":return"h6";case"paragraph":default:return"p"}}getChildrenHtml(){const t=this.getAnnotationByType(u.LINK_GROUP);let e=this.children.map((t=>t.toHtml())).join("");return t&&this.children.length>0&&(e=this.generateLinkHtml(t,e)),e}doAnnotationActionApply(t){const e=y.get(t.constructor.name,RTETextBlock.name);e&&e.execute(t,this)}generateLinkHtml(t,e){e="";let s=[];for(let n=0;n<this.children.length;n++){const r=this.children[n].getAnnotationByType(g.LINK),i=this.children[n+1]?this.children[n+1].getAnnotationByType(g.LINK):null;if(r){if(s.push(this.children[n]),!i||r.link.groupKey!==i.link.groupKey){const n=t.toString(r,{standalone:!0});e+=[`<a${n?` ${n}`:""}>`,s.map((t=>t.toHtml())).join(""),"</a>"].join(""),s=[]}}else e+=this.children[n].toHtml()}return e}}y.register(mt.name,RTETextBlock.name,new At),y.register(_t.name,RTETextBlock.name,new Lt),y.register(jt.name,RTETextBlock.name,new class extends q{handleAction(t,e){this.updateCustomStyleAnnotation(e,["marginLeft"])}}),y.register(V.name,RTETextBlock.name,new class extends q{handleAction(t,e){let s=e.getAnnotationByType(u.LINK_GROUP);if("update_link"===t.type){if(s){const e=s.linkGroups.get(t.groupKey);e&&s.linkGroups.set(t.groupKey,[e[0]])}}else{if(s){const e=s.linkGroups.get(t.groupKey)||[];s.linkGroups.set(t.groupKey,[...e,...t.nodes])}else s=t.toAnnotation(),s.linkGroups.set(t.groupKey,[...t.nodes]);e.annotationMap.set(u.LINK_GROUP,s)}}}),y.register(x.UNLINK_LINK_GROUP,RTETextBlock.name,new class extends q{handleAction(t,e){const s=e.getAnnotationByType(u.LINK_GROUP);s&&(s.linkGroups.size>1?s.linkGroups.delete(t.groupKey):e.annotationMap.delete(u.LINK_GROUP))}}),y.register(x.SPLIT_BLOCK_WITH_NODE,RTETextBlock.name,new Rt),y.register(x.REPLACE_CHILD_NODES,RTETextBlock.name,new yt),y.register(x.MERGE_TWO_BLOCKS_NODES,RTETextBlock.name,new Ct),y.register(x.LINE_BREAK_SINGLE_BLOCK,RTETextBlock.name,new bt),y.register(x.LINE_BREAK_MULTIPLE_BLOCKS,RTETextBlock.name,new kt),y.register(x.INSERT_IMAGE_TO_BLOCK,RTETextBlock.name,new class extends q{handleAction(t,e){const s=t.splitPointNode,n=t.startOffsetOfNode,r=t.imageBlockToBeInserted;if(this.isCaretPositionAtBlockEnd(e,s,n))e.parent.apply(new Ot(e,r));else if(this.isCaretPositionAtBlockStart(e,s,n))e.parent.apply(new Bt(e,r));else{const t=new vt(s,n);e.apply(t),e.parent.apply(new Ot(e,r))}}}),y.register(x.TRANSFORM_LIST_BLOCK,RTETextBlock.name,new class extends q{handleAction(t,e){const s=e.parent,n=s.createList(t.listType),r=t.selectedBlocks,i=r.map((t=>s.toListItem(t)));n.apply(new gt(i)),s.apply(new Ot(t.selectedBlocks[0],n)),r.forEach((t=>{t.parent.apply(new St(t))}))}});class Dt extends q{getPreviousNode(t){const e=t.parent,s=e.children.indexOf(t);if(s>0)return e.children[s-1];if(e.parent){const t=this.getPreviousBlock(e);if(t)return this.getBlockLastNode(t)}}getNextNode(t){const e=t.parent,s=e.children.indexOf(t);if(e.children[s+1])return e.children[s+1];if(e.parent){const t=this.getNextBlock(e);if(t)return this.getBlockFirstNode(t)}}isContentFirstNode(t){const e=t.parent,s=e.children.indexOf(t),n=e.parent;if(e.isListItemBlock()){const t=n.parent;return 0===s&&Array.isArray(n.children)&&n.children[0]===e&&"list-item"!==t.type&&Array.isArray(t.children)&&t.children[0]===n}return 0===s&&Array.isArray(n.children)&&n.children[0]===e}getPreviousBlock(t){if(t&&t.parent&&t.parent.children){const e=t.parent.children.indexOf(t);if(e>0)return t.parent.children[e-1];if(this.isRTEBlock(t.parent)&&0===e)return this.getPreviousBlock(t.parent)}}getBlockLastNode(t){return t.getLastNode()}getBlockFirstNode(t){if("number-list"===t.type||"bullet-list"===t.type){if(t.children)return this.getBlockFirstNode(t.children[0])}else if(t.children)return t.children[0]}getNextBlock(t){if(t&&t.parent&&t.parent.children){const e=t.parent.children.indexOf(t);if(t.parent.children[e+1])return t.parent.children[e+1];if("list-item"===t.type&&t.parent.children.length===e+1)return this.getNextBlock(t.parent)}}isRTEBlock(t){return t&&"VegaRTEContent"!==t.constructor.name}}class It extends m{constructor(t,e){super(),this.isFlushable=!0,this.type=x.UPDATE_CODE_BLOCK,this.content=t,this.language=e}}class $t extends j{constructor(t){super(),this.isFlushable=!1,this.range=t}toAnnotation(){return new I(this.range)}}class RTEDecoratorNode extends RTENode{constructor(){super(...arguments),this.type="decorator-node",this.isSelected=!1}static isDecoratorNodeContainerElement(t){return t&&t.classList.contains(RTEDecoratorNode.DECORATOR_CONTAINER_CLASS)}static getDecoratorNodeElement(t){return t.querySelector(`.${RTEDecoratorNode.DECORATOR_NODE_CLASS}`)}getRangeEndOffset(){return 1}getRangeContainer(){const t=this.getElementRef();if(t)return h(t,`.${RTEDecoratorNode.DECORATOR_CONTAINER_CLASS}`)}isContentEditable(){return!1}}RTEDecoratorNode.DECORATOR_CONTAINER_CLASS="v-internal-decorator-container",RTEDecoratorNode.DECORATOR_NODE_CLASS="v-internal-decorator-node";class RTECodeBlockNode extends RTEDecoratorNode{constructor(t,e,s,n){super(t),this.type=w.CODE_BLOCK_NODE,this.text="",this.annotationMap=new Map,this.text=e,this.parent=n,this.language=s}toJSON(){return{id:this.id,type:"text",text:this.text,language:this.language}}toHtml(){return`<code style='box-sizing: border-box;color: rgba(var(--v-text-primary, 32, 54, 69, 1));text-align: left;font-family: "Roboto Mono";font-weight: 400;line-height: 22px;font-size: 16px;white-space: pre-wrap;min-height: 22px;tab-size: 2px;'>${this.text}</code>`}clone(t){return new RTECodeBlockNode(this.id,this.text,this.language,t)}doAnnotationActionApply(t){y.executeTheStrategy(t,this)}doModifyActionApply(t){y.executeTheStrategy(t,this)}}y.register(x.UPDATE_CODE_BLOCK,RTECodeBlockNode.name,new class extends q{handleAction(t,e){const{content:s,language:n}=t;e.language=n,e.text=s}}),y.register($t.name,RTECodeBlockNode.name,new class extends q{handleAction(t,e){e.annotationMap.set(u.SELECTION_RANGE,t.toAnnotation())}});var Mt;!function(t){t.CSS="css",t.HTML="html",t.JavaScript="js",t.JSX="jsx",t["Plain Text"]="plainText",t.TypeScript="ts",t.TSX="tsx"}(Mt||(Mt={}));class Ht extends q{handleAction(t,e){e.children=e.children.filter((e=>e!==t.entityToBeRemoved)),0===e.children.length&&"parent"in e&&e.parent&&(e.isListItemBlock()&&e.nestList&&e.nestList.length||e.parent.apply(new St(e)))}}class RTECodeBlock extends RTEBlock{constructor(t,e,s){super(t),this.type="code-block",this.children=[new RTECodeBlockNode(`${t}-1`,e,s,this)]}static from(t){return new RTECodeBlock(t.id,t.content,t.language)}toJSON(){const{language:t,text:e}=this.children[0];return{id:this.id,type:"code-block",content:e,language:t}}toHtml(){const{language:t=Mt["Plain Text"]}=this.children[0];return`<pre data-language="${t}" style="background-color: rgba(var(--v-bg-secondary, 245, 247, 247, 1)); padding: 12px">${this.children.map((t=>t.toHtml()))}</pre>`}clone(t){const e=RTECodeBlock.from(this.toJSON());return e.parent=t,e}apply(n){if(n instanceof m&&y.executeTheStrategy(n,this),n.isFlushable){const n=T.getDOMByEntity(this);if(n){const r=e.getSubjectFromParentNodeByEventId(n,s);r&&t.notify(r,{})}}}isNotEmpty(){return!!this.children.length}getLastNode(){return this.children[0]}isSelected(){return this.children[0].annotationMap.has(u.SELECTION_RANGE)}}y.register(x.DELETE_CODE_BLOCK,RTECodeBlock.name,new class extends Dt{handleAction(t,e){const s=e.children[0],n=e.parent;if(n){let t=this.getPreviousNode(s),r=this.getRTENodeEndOffset(t);t||(t=this.getNextNode(s),r=0),n.apply(new St(e));const i=t?T.getDOMByEntity(t):null;if(0===n.children.length){const s=RTETextBlock.from({id:c(),type:"paragraph",nodes:[{id:c(),type:"text",text:""}]});e.parent.apply(new gt([s])),t=s.children[0],r=0}this.notifyUpdateSelection(t,i,r,e)}}notifyUpdateSelection(s,r,i,o){const c=T.getDOMByEntity(o);if(c){const o=e.getSubjectFromParentNodeByEventId(c,n);o&&t.notify(o,{node:s,updateDirectly:!!r,offset:i})}}getRTENodeEndOffset(t){return t?t.getRangeEndOffset():0}}),y.register(x.DELETE_CHILDREN,RTECodeBlock.name,new Ht),y.register(x.SWITCH_OUT_FROM_CODE_BLOCK,RTECodeBlock.name,new class extends q{handleAction(s,r){const{content:i,language:o}=s,a=i.split("\n"),l=new It(a.slice(0,a.length-2).join("\n"),o);l.isFlushable=!1,r.children[0].apply(l);const h=RTETextBlock.from({id:c(),type:"paragraph",nodes:[{id:c(),text:"",type:"text"}]});r.parent.apply(new Ot(r,h));const u=T.getDOMByEntity(r);if(u){const s=e.getSubjectFromParentNodeByEventId(u,n);s&&t.notify(s,{node:h.children[0]})}}}),y.register(x.INSERT_IMAGE_TO_BLOCK,RTECodeBlock.name,new class extends q{handleAction(t,e){e.parent.apply(new Ot(e,t.imageBlockToBeInserted))}}),RTECodeBlock.CODE_BLOCK_PLACEHOLDER_CLASS_NAME="code-block-placeholder-element";export{Et as $,y as A,At as B,C,w as D,S as E,j as F,Nt as G,_t as H,Ot as I,vt as J,Dt as K,Ht as L,m as M,v as N,F as O,K as P,Mt as Q,L as R,X as S,mt as T,ut as U,W as V,it as W,E as X,It as Y,U as Z,$t as _,R as a,RTECodeBlockNode as a0,Z as a1,rt as a2,ct as a3,wt as a4,P as a5,et as a6,st as a7,ot as a8,jt as a9,RTETextNode as b,RTEBlock as c,RTETextBlock as d,_ as e,q as f,gt as g,RTENode as h,Bt as i,u as j,x as k,Lt as l,bt as m,kt as n,Rt as o,yt as p,Ct as q,St as r,T as s,f as t,d as u,k as v,b as w,RTECodeBlock as x,g as y,RTEDecoratorNode as z}
@@ -1 +1 @@
1
- import{r as t,h as s,g as e,H as i}from"./p-6b2342e0.js";import{B as r,a,L as o,P as n,b as c,c as h}from"./p-be23bef2.js";import{t as l,a as p,s as u,b as d,c as m,d as f,e as w,f as b,g as v,X as y,Y as j,h as g,i as S}from"./p-46b077d9.js";import{f as x,c as O,s as A,a as k}from"./p-d27ae9ff.js";import{s as R}from"./p-519a7d55.js";import{I as T}from"./p-6e1ab235.js";import{V as C,I as H}from"./p-d849e0f5.js";import"./p-d884c644.js";import"./p-0c667d6a.js";import"./p-262ec334.js";class I extends r{addInteractionSupport(){}draw(){const{positions:t,colors:s}=this.options.renderOptions;let e=t;t&&t[0]&&!Array.isArray(t[0])&&(e=[t]),e.forEach(((t,e)=>{const i=this.getColorByIndex(e,s);this.renderer.drawLinePath(t,this.getColorFromToken(i)),t.forEach((t=>{this.renderer.drawCircle(t,4,this.getColorFromToken("bg-primary"),2,this.getColorFromToken(i))}))}))}}class P{process(t,s){const{dataSource:e,colors:i}=t,{xScale:r,yScale:a}=s;return{positions:this.getPathPositions(e,r,a),colors:i}}getPathPositions(t,s,e){let i=[];const r=x(t).map((({x:t,y:i})=>({x:s(t),y:e(i)})));let a=[];return t&&Array.isArray(t[0])?(i=t.map((t=>t.length)),a=O(r,i)):a=[r],a}}class L{process(t){const{dataSource:s,xAxis:e}=t;let i=s;return"time"===((null==e?void 0:e.type)||"value")&&(i=this.formatTimePositionArray(s)),t.dataSource=i,t}formatTimePositionArray(t){let s=[],e=[];const i=function(t,s){if("function"!=typeof t[Symbol.iterator])throw new TypeError("values is not iterable");return Array.from(t,(t=>s(t)))}(x(t),(t=>({x:"string"==typeof t.x?l("%Y-%m-%d")(t.x):t.x,y:t.y})));return t&&Array.isArray(t[0])?(e=t.map((t=>t.length)),s=O(i,e)):s=i,s}}class Y{process(t){const{dataSource:s,xAxis:e}=t;let i=s;switch((null==e?void 0:e.type)||"value"){case"time":i=k(s,(t=>t.x.valueOf()));break;case"value":i=k(s,(t=>t.x));break;case"category":i=A(s,(t=>t.x),e.sorter)}return t.dataSource=i,t}}class M{constructor(){this.formatMillisecond=p(".%L"),this.formatSecond=p(":%S"),this.formatMinute=p("%I:%M"),this.formatHour=p("%H:00"),this.formatDay=p("%d"),this.formatWeek=p("%b %d"),this.formatMonth=p("%b"),this.formatYear=p("%Y")}process(t,s){const{xAxis:e}=t;return"time"===((null==e?void 0:e.type)||"value")&&"function"!=typeof s.labelFormatter&&(s.scale.tickFormat=()=>this.timeFormatter.bind(this)),s}timeFormatter(t){return(u(t)<t?this.formatMillisecond:d(t)<t?this.formatSecond:m(t)<t?this.formatMinute:f(t)<t?this.formatHour:w(t)<t?b(t)<t?this.formatDay:this.formatWeek:v(t)<t?this.formatMonth:this.formatYear)(t)}}class _ extends a{constructor(){super(...arguments),this.layoutInputProcessor=new o,this.lineDataSourceInputProcessorChain=new n([new L,new Y]),this.xAxisInputProcessorChain=new n([this.layoutInputProcessor,new y,new M]),this.yAxisInputProcessorChain=new n([this.layoutInputProcessor,new j]),this.legendInputProcessorChain=new n([this.layoutInputProcessor,new c]),this.linePathInputProcessor=new P}createDrawerChain(t,s){const e=this.lineDataSourceInputProcessorChain.process(this.options),i=this.xAxisInputProcessorChain.process(e),r=this.yAxisInputProcessorChain.process(e);return[new g(t,s,{renderOptions:i}),new S(t,s,{renderOptions:r}),new h(t,s,{renderOptions:this.legendInputProcessorChain.process(this.options)}),new I(t,s,{renderOptions:this.linePathInputProcessor.process(e,{xScale:i.scale,yScale:r.scale})})]}}var B=function(t,s,e,i){var r,a=arguments.length,o=a<3?s:null===i?i=Object.getOwnPropertyDescriptor(s,e):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,s,e,i);else for(var n=t.length-1;n>=0;n--)(r=t[n])&&(o=(a<3?r(o):a>3?r(s,e,o):r(s,e))||o);return a>3&&o&&Object.defineProperty(s,e,o),o};const D=class{constructor(s){t(this,s),this.globalSlimmers={},this.vegaComponentUsageRuntimeMetricsSlimmer=new C}watchOptionsHandel(t){this.updateChart(t)}disconnectedCallback(){this.chart=null,this.reRenderTimer&&clearTimeout(this.reRenderTimer)}componentWillLoad(){this.updateChart(this.options)}async reRender(){this.reRenderTimer&&clearTimeout(this.reRenderTimer),this.reRenderTimer=setTimeout((()=>{this.chart.reRender()}),0)}render(){return R(s(i,null),this.host)}updateChart(t){if(!t)return;const{mode:s="svg",dataSource:e}=t,i=function(t,s){var e={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&s.indexOf(i)<0&&(e[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)s.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(e[i[r]]=t[i[r]])}return e}(t,["mode","dataSource"]),r=Object.assign(Object.assign({},i),{mode:s,container:this.host,dataSource:e||[]});this.chart?this.chart.updateOptions(r):(this.chart=new _(r),this.chart.render())}get host(){return e(this)}static get watchers(){return{options:["watchOptionsHandel"]}}};B([H()],D.prototype,"globalSlimmers",void 0),B([T()],D.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),D.style=".vega-chart-legend-item{cursor:pointer}.vega-chart-line-path:hover{stroke-width:5}:host{display:block}";export{D as vega_line_chart}
1
+ import{r as t,h as s,g as e,H as i}from"./p-6b2342e0.js";import{B as r,a,L as o,P as n,b as c,c as h}from"./p-be23bef2.js";import{t as l,a as p,s as u,b as d,c as m,d as f,e as w,f as b,g as v,X as y,Y as j,h as g,i as S}from"./p-46b077d9.js";import{f as x,c as O,s as A,a as k}from"./p-d27ae9ff.js";import{s as R}from"./p-519a7d55.js";import{I as T}from"./p-6e1ab235.js";import{V as C,I as H}from"./p-4415ad28.js";import"./p-d884c644.js";import"./p-0c667d6a.js";import"./p-262ec334.js";class I extends r{addInteractionSupport(){}draw(){const{positions:t,colors:s}=this.options.renderOptions;let e=t;t&&t[0]&&!Array.isArray(t[0])&&(e=[t]),e.forEach(((t,e)=>{const i=this.getColorByIndex(e,s);this.renderer.drawLinePath(t,this.getColorFromToken(i)),t.forEach((t=>{this.renderer.drawCircle(t,4,this.getColorFromToken("bg-primary"),2,this.getColorFromToken(i))}))}))}}class P{process(t,s){const{dataSource:e,colors:i}=t,{xScale:r,yScale:a}=s;return{positions:this.getPathPositions(e,r,a),colors:i}}getPathPositions(t,s,e){let i=[];const r=x(t).map((({x:t,y:i})=>({x:s(t),y:e(i)})));let a=[];return t&&Array.isArray(t[0])?(i=t.map((t=>t.length)),a=O(r,i)):a=[r],a}}class L{process(t){const{dataSource:s,xAxis:e}=t;let i=s;return"time"===((null==e?void 0:e.type)||"value")&&(i=this.formatTimePositionArray(s)),t.dataSource=i,t}formatTimePositionArray(t){let s=[],e=[];const i=function(t,s){if("function"!=typeof t[Symbol.iterator])throw new TypeError("values is not iterable");return Array.from(t,(t=>s(t)))}(x(t),(t=>({x:"string"==typeof t.x?l("%Y-%m-%d")(t.x):t.x,y:t.y})));return t&&Array.isArray(t[0])?(e=t.map((t=>t.length)),s=O(i,e)):s=i,s}}class Y{process(t){const{dataSource:s,xAxis:e}=t;let i=s;switch((null==e?void 0:e.type)||"value"){case"time":i=k(s,(t=>t.x.valueOf()));break;case"value":i=k(s,(t=>t.x));break;case"category":i=A(s,(t=>t.x),e.sorter)}return t.dataSource=i,t}}class M{constructor(){this.formatMillisecond=p(".%L"),this.formatSecond=p(":%S"),this.formatMinute=p("%I:%M"),this.formatHour=p("%H:00"),this.formatDay=p("%d"),this.formatWeek=p("%b %d"),this.formatMonth=p("%b"),this.formatYear=p("%Y")}process(t,s){const{xAxis:e}=t;return"time"===((null==e?void 0:e.type)||"value")&&"function"!=typeof s.labelFormatter&&(s.scale.tickFormat=()=>this.timeFormatter.bind(this)),s}timeFormatter(t){return(u(t)<t?this.formatMillisecond:d(t)<t?this.formatSecond:m(t)<t?this.formatMinute:f(t)<t?this.formatHour:w(t)<t?b(t)<t?this.formatDay:this.formatWeek:v(t)<t?this.formatMonth:this.formatYear)(t)}}class _ extends a{constructor(){super(...arguments),this.layoutInputProcessor=new o,this.lineDataSourceInputProcessorChain=new n([new L,new Y]),this.xAxisInputProcessorChain=new n([this.layoutInputProcessor,new y,new M]),this.yAxisInputProcessorChain=new n([this.layoutInputProcessor,new j]),this.legendInputProcessorChain=new n([this.layoutInputProcessor,new c]),this.linePathInputProcessor=new P}createDrawerChain(t,s){const e=this.lineDataSourceInputProcessorChain.process(this.options),i=this.xAxisInputProcessorChain.process(e),r=this.yAxisInputProcessorChain.process(e);return[new g(t,s,{renderOptions:i}),new S(t,s,{renderOptions:r}),new h(t,s,{renderOptions:this.legendInputProcessorChain.process(this.options)}),new I(t,s,{renderOptions:this.linePathInputProcessor.process(e,{xScale:i.scale,yScale:r.scale})})]}}var B=function(t,s,e,i){var r,a=arguments.length,o=a<3?s:null===i?i=Object.getOwnPropertyDescriptor(s,e):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,s,e,i);else for(var n=t.length-1;n>=0;n--)(r=t[n])&&(o=(a<3?r(o):a>3?r(s,e,o):r(s,e))||o);return a>3&&o&&Object.defineProperty(s,e,o),o};const D=class{constructor(s){t(this,s),this.globalSlimmers={},this.vegaComponentUsageRuntimeMetricsSlimmer=new C}watchOptionsHandel(t){this.updateChart(t)}disconnectedCallback(){this.chart=null,this.reRenderTimer&&clearTimeout(this.reRenderTimer)}componentWillLoad(){this.updateChart(this.options)}async reRender(){this.reRenderTimer&&clearTimeout(this.reRenderTimer),this.reRenderTimer=setTimeout((()=>{this.chart.reRender()}),0)}render(){return R(s(i,null),this.host)}updateChart(t){if(!t)return;const{mode:s="svg",dataSource:e}=t,i=function(t,s){var e={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&s.indexOf(i)<0&&(e[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)s.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(e[i[r]]=t[i[r]])}return e}(t,["mode","dataSource"]),r=Object.assign(Object.assign({},i),{mode:s,container:this.host,dataSource:e||[]});this.chart?this.chart.updateOptions(r):(this.chart=new _(r),this.chart.render())}get host(){return e(this)}static get watchers(){return{options:["watchOptionsHandel"]}}};B([H()],D.prototype,"globalSlimmers",void 0),B([T()],D.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),D.style=".vega-chart-legend-item{cursor:pointer}.vega-chart-line-path:hover{stroke-width:5}:host{display:block}";export{D as vega_line_chart}
@@ -0,0 +1 @@
1
+ import{r as t,c as e,h as i,H as a,g as r}from"./p-6b2342e0.js";import{M as s,a as n}from"./p-cdbbdcc2.js";import{R as o}from"./p-280cbcdb.js";import{s as p}from"./p-519a7d55.js";import{I as h}from"./p-6e1ab235.js";import{V as d,I as l}from"./p-4415ad28.js";import{F as x}from"./p-a8792e3d.js";import{F as f}from"./p-a528714c.js";import{C as g}from"./p-2d0d575f.js";import{c as m}from"./p-02c9796a.js";import{f as c,F as v,v as b}from"./p-d64fab3d.js";import{C as u}from"./p-10734a00.js";import{D as w}from"./p-31ac7386.js";import"./p-abd7aeaa.js";import"./p-02841589.js";import"./p-331a62d5.js";import"./p-6c170474.js";import"./p-8b5d3a52.js";import"./p-6a334573.js";import"./p-7c39ce96.js";import"./p-dad3ba5f.js";import"./p-f0e828d8.js";import"./p-b75ee3ba.js";import"./p-021d4ae4.js";import"./p-ab834f06.js";import"./p-40f39194.js";import"./p-ed45b3b6.js";import"./p-78a57a17.js";import"./p-52b8f2d2.js";import"./p-d27ae9ff.js";import"./p-262ec334.js";import"./p-5eb7f382.js";import"./p-b7f3221f.js";import"./p-5f377954.js";import"./p-07cb0243.js";import"./p-5a25014f.js";const y=[{payloadKey:"AUTO_VALIDATION_IS_TRUE",payloadDescription:"Determines whether automatic validation should be implemented for the text area",payloadValue:t=>!0===t.autoValidation},{payloadKey:"AUTO_VALIDATION_IS_FALSE",payloadDescription:"Determines whether automatic validation should be implemented for the text area",payloadValue:t=>!1===t.autoValidation}];var j=function(t,e,i,a){var r,s=arguments.length,n=s<3?e:null===a?a=Object.getOwnPropertyDescriptor(e,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,a);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const z=class{constructor(a){t(this,a),this.vegaChange=e(this,"vegaChange",7),this.change=e(this,"change",7),this.vegaBlur=e(this,"vegaBlur",7),this.blur=e(this,"blur",7),this.vegaLabelButtonClick=e(this,"vegaLabelButtonClick",7),this.labelButtonClick=e(this,"labelButtonClick",7),this.globalSlimmers={},this.formFieldController=new x({propertyRules:[{propertyName:"required",ruleFactory:t=>t?new o:null},{propertyName:"minLength",ruleFactory:t=>t?new s({minStrLength:t}):null},{propertyName:"maxLength",ruleFactory:t=>t?new n({maxStrLength:t}):null}],validationRulesName:"validationRules",defaultValue:"",attributeGetter:t=>this[t],inputContainerGetter:()=>this.inputContainerRef,touchableAreaGetter:()=>[this.textareaRef]}),this.changeEventEmitter=m(z,c),this.blurEventEmitter=m(z,v),this.labelButtonClickEventEmitter=m(z,b),this.textareaEventPrevent=new u([c],(()=>this.inputContainerRef)),this.vegaComponentUsageRuntimeMetricsSlimmer=new d(y),this.currentCharCount=0,this.placeholder="",this.hint="",this.disabled=!1,this.label="",this.labelSuffixButtonConfig=null,this.showCounter=!1,this.value="",this.isValid=null,this.autoValidation=!0,this.required=!1,this.maxLength=null,this.minLength=null,this.resizable=!0,this.rows=5,this.validationRules=[],this.renderTextareaContainer=()=>i("div",{class:{"vega-textarea-container":!0,"vega-textarea-not-resizable":!this.resizable},ref:t=>this.inputContainerRef=t},i("textarea",{rows:this.rows>=2?this.rows-1:4,placeholder:this.placeholder,disabled:this.disabled,required:this.required,ref:this.setTextareaRef,maxLength:this.maxLength,minLength:this.minLength,value:this.value,onBlur:this.handleTextareaBlur,"aria-label":this.label||"No label defined"}),this.showCounter&&this.renderCharacterCounter()),this.renderHintMessage=()=>i("vega-text",null,this.hint),this.renderCharacterCounter=()=>i("div",{class:{"vega-textarea-counter":!0,"counter-exceed-max-length":this.isExceedMaxLength(this.value,this.maxLength)}},i("span",{id:"current"},this.currentCharCount),null!=this.maxLength&&this.renderMaxLengthNumber()),this.renderMaxLengthNumber=()=>i("span",{id:"maximum"},"/",this.maxLength),this.setTextareaRef=t=>{t&&this.textareaRef!==t&&(this.textareaRef=t)},this.inputFocus=()=>{this.textareaRef.focus()},this.handleTextareaBlur=t=>{this.blurEventEmitter.emit(void 0,t)},this.isExceedMaxLength=(t,e)=>null!=e&&t.length>e,this.handleLabelButtonClick=()=>{this.labelButtonClickEventEmitter.emit()}}watchValue(t){this.changeEventEmitter.emit(t),this.textareaRef.value!==this.value&&(this.textareaRef.value=this.value),t&&(this.currentCharCount=t.length),g.notify(f,{host:this.host,detail:t})}watchValidationRules(){}componentWillLoad(){this.currentCharCount=this.value.length}handleValueTextarea(){this.value=this.textareaRef.value,this.currentCharCount=this.value.length}render(){return p(i(a,{class:{disabled:this.disabled}},this.renderLabelDom(),this.renderTextareaContainer(),this.hint&&this.renderHintMessage()),this.host)}renderLabelDom(){return i("vega-field-label",{onClick:this.inputFocus,"is-field-required":this.required,disabled:this.disabled,label:this.label,suffixButtonConfig:this.labelSuffixButtonConfig,ref:t=>{w.addUniqueObserverToNode(t,b,this.handleLabelButtonClick)}})}get host(){return r(this)}static get watchers(){return{value:["watchValue"],validationRules:["watchValidationRules"]}}};j([l()],z.prototype,"globalSlimmers",void 0),j([h()],z.prototype,"formFieldController",void 0),j([h()],z.prototype,"changeEventEmitter",void 0),j([h()],z.prototype,"blurEventEmitter",void 0),j([h()],z.prototype,"labelButtonClickEventEmitter",void 0),j([h()],z.prototype,"textareaEventPrevent",void 0),j([h()],z.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),z.style=':host{display:inline-block;width:100%;text-align:left}:host .vega-textarea-container{display:flex;position:relative;width:100%;resize:vertical;box-sizing:border-box;background-color:rgba(var(--v-bg-primary, 252, 252, 252, 1));border:1px solid rgba(var(--v-border-input-field, 171, 198, 216, 1));border-radius:8px;overflow:hidden;font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px;color:rgba(var(--v-text-primary, 32, 54, 69, 1));min-height:50px}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-textarea-container{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .vega-textarea-container{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .vega-textarea-container{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}:host textarea{display:block;position:relative;padding-top:12px;padding-right:16px;padding-bottom:32px;padding-left:16px;width:100%;resize:vertical;box-sizing:border-box;background-color:rgba(var(--v-bg-primary, 252, 252, 252, 1));border-radius:8px;outline:2px solid transparent;outline-offset:2px;border-style:none;overflow:auto;font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px;color:rgba(var(--v-text-primary, 32, 54, 69, 1));min-height:48px}@media screen and (min-width: 768px) and (max-width: 1023px){:host textarea{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host textarea{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host textarea{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}:host .vega-textarea-container.vega-textarea-not-resizable{resize:none}:host .vega-textarea-container.vega-textarea-not-resizable textarea{resize:none}:host vega-field-label{margin-bottom:8px}:host .vega-textarea-counter{position:absolute;bottom:8px;right:8px;display:flex;padding-left:4px;padding-right:4px;padding-top:2px;padding-bottom:2px;border-radius:4px;font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px;color:rgba(var(--v-text-inverted-primary, 252, 252, 252, 1));background-color:rgba(var(--v-bg-textarea-count, 4, 4, 28, 0.6))}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-textarea-counter{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .vega-textarea-counter{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .vega-textarea-counter{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}:host .vega-textarea-counter.counter-exceed-max-length{background-color:rgba(var(--v-bg-textarea-counter-exceed-max-length, 214, 46, 81))}:host textarea::placeholder{color:rgba(var(--v-text-input-placeholder, 176, 180, 181, 1))}:host .vega-error{display:inline-block;padding-left:8px;padding-right:8px;padding-top:12px;font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px;color:rgba(var(--v-text-error, 189, 41, 71, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}:host vega-text{padding-left:8px;padding-right:8px;padding-top:12px;font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px;color:rgba(var(--v-text-secondary, 107, 116, 125, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){:host vega-text{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host vega-text{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host vega-text{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}:host .vega-textarea-container:hover{border:1px solid rgba(var(--v-border-input-field-hover, 115, 160, 190, 1))}:host .vega-textarea-container:focus-within{border:1px solid rgba(var(--v-border-input-field-focus, 19, 98, 226, 1));outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:3px;border:1px solid rgba(var(--v-border-color-input-field-focus, 19, 98, 226, 1))}:host .vega-textarea-container.error{border:1px solid rgba(var(--v-border-input-field-danger, 230, 50, 87, 1))}:host .vega-textarea-container.error:hover{border:1px solid rgba(var(--v-border-input-field-danger-hover, 255, 87, 114, 1))}:host .vega-textarea-container.error:focus-within{border:1px solid rgba(var(--v-border-input-field-danger-focus, 233, 71, 104, 1));outline:2px solid rgba(var(--v-border-color-danger, 230, 50, 87, 1));outline-offset:3px;border:1px solid rgba(var(--v-border-color-input-field-danger-focus, 233, 71, 104, 1))}:host(.disabled) textarea{color:rgba(var(--v-text-input-disabled, 107, 116, 125, 1));background-color:rgba(var(--v-bg-secondary, 245, 247, 247, 1))}:host(.disabled) .vega-textarea-container{border:1px solid rgba(var(--v-border-input-field-disabled, 222, 225, 227, 1))}:host .vega-hidden{display:none}';export{z as vega_textarea}
@@ -1 +1 @@
1
- import{Q as e}from"./p-1f83cebf.js";import{I as r}from"./p-abd7aeaa.js";class t extends r{constructor(e){super(),this.config=e}evaluate(r){if(!this.isAcceptedInputType(r))throw new Error(`Invalid date value ${r} for mode ${this.config.mode}`);let t;switch(this.config.mode){case"single":t=e(r);break;case"range":t=Array.isArray(r)&&2===r.length&&r.every(e)}return{isValid:t,message:t?"":"This field is required"}}canEvaluate(e,r){return r?this.isAcceptedInputType(e)&&!r.disabled&&r.visible:this.isAcceptedInputType(e)}shouldShowError(e){return!e.disabled&&e.visible&&(e.touched||e.modified)}isAcceptedInputType(e){if(null==e)return!0;if(!this.config.mode)throw new Error(`Unexpected type of mode: ${this.config.mode}`);switch(this.config.mode){case"single":return"string"==typeof e;case"range":return Array.isArray(e);default:return!1}}}export{t as D}
1
+ import{Q as e}from"./p-415ffa35.js";import{I as r}from"./p-abd7aeaa.js";class t extends r{constructor(e){super(),this.config=e}evaluate(r){if(!this.isAcceptedInputType(r))throw new Error(`Invalid date value ${r} for mode ${this.config.mode}`);let t;switch(this.config.mode){case"single":t=e(r);break;case"range":t=Array.isArray(r)&&2===r.length&&r.every(e)}return{isValid:t,message:t?"":"This field is required"}}canEvaluate(e,r){return r?this.isAcceptedInputType(e)&&!r.disabled&&r.visible:this.isAcceptedInputType(e)}shouldShowError(e){return!e.disabled&&e.visible&&(e.touched||e.modified)}isAcceptedInputType(e){if(null==e)return!0;if(!this.config.mode)throw new Error(`Unexpected type of mode: ${this.config.mode}`);switch(this.config.mode){case"single":return"string"==typeof e;case"range":return Array.isArray(e);default:return!1}}}export{t as D}
@@ -0,0 +1 @@
1
+ import{h as e,F as t,r as s,c as r,H as o,g as i}from"./p-6b2342e0.js";import{k as a,W as n}from"./p-d64fab3d.js";import{s as p}from"./p-519a7d55.js";import{c,V as l,M as g,I as d}from"./p-6e1ab235.js";import{V as h,I as v}from"./p-4415ad28.js";import{c as f}from"./p-02c9796a.js";import{c as u}from"./p-8852361b.js";import{d as m,D as b}from"./p-31ac7386.js";import{c as x}from"./p-86194314.js";import{C as _}from"./p-2d0d575f.js";import{z as w}from"./p-7c39ce96.js";import{n as y}from"./p-262ec334.js";import{O as k}from"./p-331a62d5.js";import{S}from"./p-1fb56e14.js";import{c as C}from"./p-e827d56d.js";import{M as j}from"./p-78a57a17.js";import{P as z}from"./p-021d4ae4.js";import{R}from"./p-b256b7a4.js";import{x as D}from"./p-415ffa35.js";import{g as O}from"./p-ab834f06.js";import{S as P}from"./p-5eb7f382.js";import"./p-6a334573.js";import"./p-b7f3221f.js";import"./p-b75ee3ba.js";import"./p-bf19682d.js";import"./p-6c170474.js";import"./p-40f39194.js";import"./p-0c667d6a.js";import"./p-ed45b3b6.js";import"./p-d27ae9ff.js";import"./p-07cb0243.js";import"./p-5a25014f.js";import"./p-d884c644.js";import"./p-dad3ba5f.js";import"./p-a528714c.js";const I=[{payloadKey:"COMPLETED_STEP_ARRAY_IS_EMPTY",payloadDescription:"@deprecated Specifies an array of completed step titles for the Progress Tracker component.",payloadValue:e=>0===e.completedStepArray.length},{payloadKey:"COMPLETED_STEP_ARRAY_IS_NOT_EMPTY",payloadDescription:"@deprecated Specifies an array of completed step titles for the Progress Tracker component.",payloadValue:e=>e.completedStepArray.length>0}];var L=function(e,t,s,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,s):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,s,r);else for(var n=e.length-1;n>=0;n--)(o=e[n])&&(a=(i<3?o(a):i>3?o(t,s,a):o(t,s))||a);return i>3&&a&&Object.defineProperty(t,s,a),a};class E extends l{constructor(){super(...arguments),this.renderStepIcon=(t,s)=>e("div",{class:"vega-progress-step-icon-container"},e("div",{class:"vega-progress-step__icon"},t.isCompleted()?e("vega-icon",{icon:"checkmark-rounded",size:"size-16"}):e("span",null,s+1))),this.renderStep=(t,s)=>{var r;return e("div",{role:t.clickable?"button":null,class:["vega-progress-step",t.progressStatus,t.isCurrent?"current":"",t.clickable?"":"disabled"].filter(Boolean).join(" "),"data-index":s,tabIndex:t.clickable?0:null,onClick:t.clickable?this.onStepIconClick:null,onKeyDown:t.clickable?x():null,"aria-label":t.title},e("div",{class:"vega-progress-step-icon-divider"},e("div",{class:"vega-progress-step__divider left "+((null===(r=this.currentSteps[s-1])||void 0===r?void 0:r.isCompleted())?"background":"")}),this.renderStepIcon(t,s),e("div",{class:"vega-progress-step__divider right "+(t.isCompleted()?"complete":"default")})),e("div",{class:"vega-progress-step__title"},this.renderStepTitle(t,s,"top")))},this.onStepIconClick=e=>{const t=Number(e.currentTarget.getAttribute("data-index"));_.notify(m.getSubject(this.host,w),t)}}async gotoCarouselPage(){this.carouselContainerRef.getBoundingClientRect().width>0&&await this.carouselRef.goToPage(this.current+1)}render(){return e(t,null,e("div",{class:"vega-progress-tracker__container"},e("div",{class:"vega-progress-tracker__slot"},this.currentSteps.map(((e,t)=>this.renderStep(e,t))))),e("div",{class:"vega-progress-tracker__box",ref:e=>this.carouselContainerRef=e},e("vega-carousel",{showSlider:!1,itemsPerPage:1,canSwipe:this.canClickStep,ref:e=>(b.addUniqueObserverToNode(e,a,(async e=>{await this.host.setCurrent(e.detail-1)})),this.carouselRef=e)},this.currentSteps.map(((e,t)=>this.renderStepTitle(e,t,"carousel"))))))}renderStepTitle(t,s,r){const o="horizontal-compact"===this.currentDirection;if(o&&"carousel"===r||!o&&"top"===r)return this.renderModeController.isSourceRenderMode()?e("vega-progress-tracker-step",{key:t.stepKey,stepKey:t.stepKey},t.title):e("slot",{name:`step-${s}`})}}L([c()],E.prototype,"host",void 0),L([c()],E.prototype,"currentSteps",void 0),L([c()],E.prototype,"canClickStep",void 0),L([c()],E.prototype,"current",void 0),L([c()],E.prototype,"deprecatedPropertySlimmer",void 0),L([c()],E.prototype,"currentStepController",void 0),L([c()],E.prototype,"currentDirection",void 0),L([c()],E.prototype,"renderModeController",void 0);var A,T=function(e,t,s,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,s):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,s,r);else for(var n=e.length-1;n>=0;n--)(o=e[n])&&(a=(i<3?o(a):i>3?o(t,s,a):o(t,s))||a);return i>3&&a&&Object.defineProperty(t,s,a),a};class M extends l{constructor(){super(...arguments),this.goToPageTaskQueue=new S,this.updateCurrent=e=>{this.current=y(e,0,this.currentSteps.length-1)}}connectedCallback(){this.initStepClickObserver()}disconnectedCallback(){this.removeStepClickObserver()}componentDidLoad(){this.updateCurrent(this.current)}async componentDidRender(){await this.goToPageTaskQueue.runTask()}async watchCurrentChange(){var e;this.updateCurrent(this.current),this.currentStepUpdateEventEmitter.emit(null===(e=this.currentSteps[this.current])||void 0===e?void 0:e.stepKey),await this.renderer.gotoCarouselPage()}watchSteps(){this.updateCurrent(this.current)}nextStep(){this.updateCurrent(++this.current)}prevStep(){this.updateCurrent(--this.current)}setCurrent(e){this.updateCurrent(e)}async watchDirection(){await this.goToPageTaskQueue.enqueue({run:async()=>await this.renderer.gotoCarouselPage()},!1)}initStepClickObserver(){this.stepClickObserver=new k(this.canAcceptStepClickEvent.bind(this),this.updateCurrent.bind(this)),_.register(m.getSubject(this.host,w),this.stepClickObserver)}removeStepClickObserver(){_.unregister(m.getSubject(this.host,w),this.stepClickObserver)}canAcceptStepClickEvent(){return!0}}T([c()],M.prototype,"currentSteps",void 0),T([c({writable:!0})],M.prototype,"current",void 0),T([c()],M.prototype,"currentStepUpdateEventEmitter",void 0),T([c()],M.prototype,"renderer",void 0),T([c()],M.prototype,"host",void 0),T([g("connectedCallback")],M.prototype,"connectedCallback",null),T([g("disconnectedCallback")],M.prototype,"disconnectedCallback",null),T([g("componentDidLoad")],M.prototype,"componentDidLoad",null),T([g("componentDidRender")],M.prototype,"componentDidRender",null),T([g("watchCurrentChange")],M.prototype,"watchCurrentChange",null),T([g("watchSteps")],M.prototype,"watchSteps",null),T([g("nextStep")],M.prototype,"nextStep",null),T([g("prevStep")],M.prototype,"prevStep",null),T([g("setCurrent")],M.prototype,"setCurrent",null),T([g("watchDirection")],M.prototype,"watchDirection",null),function(e){e.DEFAULT="default",e.IN_PROGRESS="inProgress",e.COMPLETE="complete"}(A||(A={}));class U{constructor(e,t,s,r,o){this.stepKey=e,this.title=t,this.progressStatus=s,this.isCurrent=r,this.clickable=o}static fromSteps(e,t,s,r){return t.map(((t,o)=>{const i="string"==typeof t?t:t.title;return new U(i,i,this.getStepStatus(i,o,s,r),o===s,this.getIsStepClickable(e,t))}))}static fromHostSlot(e,t,s){return Array.from(e.querySelectorAll("vega-progress-tracker-step")).map(((r,o)=>{const i=r.stepKey;return new U(i,"",this.getStepStatus(i,o,t,s),o===t,this.getIsStepClickable(e,r))}))}static getIsStepClickable(e,t){return"string"==typeof t?e.canClickStep:!!e.canClickStep&&("boolean"==typeof t.clickable?t.clickable:e.canClickStep)}isCompleted(){return this.progressStatus===A.COMPLETE}}U.getStepStatus=(e,t,s,r)=>r.includes(e)?A.COMPLETE:t===s?A.IN_PROGRESS:A.DEFAULT;var q=function(e,t,s,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,s):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,s,r);else for(var n=e.length-1;n>=0;n--)(o=e[n])&&(a=(i<3?o(a):i>3?o(t,s,a):o(t,s))||a);return i>3&&a&&Object.defineProperty(t,s,a),a};class W extends l{constructor(){super(...arguments),this.mutationObserver=new j({target:()=>this.host,options:{childList:!0,subtree:!0},callback:()=>{this.appendSlotAttribute(),this.syncUpCurrentSteps()}})}connectedCallback(){this.appendSlotAttribute()}disconnectedCallback(){}componentWillLoad(){this.syncUpCurrentSteps()}componentDidLoad(){}watchSteps(){this.syncUpCurrentSteps()}watchCurrentChange(){this.syncUpCurrentSteps()}watchCompletedStepArray(){this.syncUpCurrentSteps()}watchCompletedSteps(){this.syncUpCurrentSteps()}syncUpCurrentSteps(){this.currentSteps=this.renderModeController.isSourceRenderMode()?U.fromSteps(this.host,this.steps,this.current,this.deprecatedPropertySlimmer.getValue()):U.fromHostSlot(this.host,this.current,this.deprecatedPropertySlimmer.getValue())}appendSlotAttribute(){this.renderModeController.isSourceRenderMode()||Array.from(this.host.querySelectorAll("vega-progress-tracker-step")).map(((e,t)=>{e.setAttribute("slot",`step-${t}`)}))}}q([c()],W.prototype,"host",void 0),q([c()],W.prototype,"steps",void 0),q([c({writable:!0})],W.prototype,"currentSteps",void 0),q([c()],W.prototype,"renderModeController",void 0),q([c()],W.prototype,"current",void 0),q([c()],W.prototype,"deprecatedPropertySlimmer",void 0),q([d()],W.prototype,"mutationObserver",void 0),q([g("connectedCallback")],W.prototype,"connectedCallback",null),q([g("disconnectedCallback")],W.prototype,"disconnectedCallback",null),q([g("componentWillLoad")],W.prototype,"componentWillLoad",null),q([g("componentDidLoad")],W.prototype,"componentDidLoad",null),q([g("watchSteps")],W.prototype,"watchSteps",null),q([g("watchCurrentChange")],W.prototype,"watchCurrentChange",null),q([g("watchCompletedStepArray")],W.prototype,"watchCompletedStepArray",null),q([g("watchCompletedSteps")],W.prototype,"watchCompletedSteps",null);var K=function(e,t,s,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,s):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,s,r);else for(var n=e.length-1;n>=0;n--)(o=e[n])&&(a=(i<3?o(a):i>3?o(t,s,a):o(t,s))||a);return i>3&&a&&Object.defineProperty(t,s,a),a};class N extends l{constructor(){super(...arguments),this.renderMode="SOURCE"}connectedCallback(){this.setRenderMode()}isSourceRenderMode(){return"SOURCE"===this.renderMode}setRenderMode(){this.renderMode=this.host.querySelector("vega-progress-tracker-step")?"SLOT":"SOURCE"}}K([c()],N.prototype,"host",void 0),K([g("connectedCallback")],N.prototype,"connectedCallback",null);var V=function(e,t,s,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,s):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,s,r);else for(var n=e.length-1;n>=0;n--)(o=e[n])&&(a=(i<3?o(a):i>3?o(t,s,a):o(t,s))||a);return i>3&&a&&Object.defineProperty(t,s,a),a};class Y extends l{constructor(){super(...arguments),this.pageResizeObserverSlimmer=new z({callback:async()=>{this.setCurrentDirection(),await this.renderer.gotoCarouselPage()}})}connectedCallback(){}disconnectedCallback(){}componentWillLoad(){this.setCurrentDirection()}componentDidLoad(){}watchDirection(){this.setCurrentDirection()}setCurrentDirection(){let e=R.formatCustom(this.direction)||"vertical";["default","S"].includes(O())&&!D(this.direction)&&(e="horizontal-compact"),this.currentDirection=e}}V([c()],Y.prototype,"direction",void 0),V([c()],Y.prototype,"renderer",void 0),V([c({writable:!0})],Y.prototype,"currentDirection",void 0),V([d()],Y.prototype,"pageResizeObserverSlimmer",void 0),V([g("connectedCallback")],Y.prototype,"connectedCallback",null),V([g("disconnectedCallback")],Y.prototype,"disconnectedCallback",null),V([g("componentWillLoad")],Y.prototype,"componentWillLoad",null),V([g("componentDidLoad")],Y.prototype,"componentDidLoad",null),V([g("watchDirection")],Y.prototype,"watchDirection",null);var H=function(e,t,s,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,s):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,s,r);else for(var n=e.length-1;n>=0;n--)(o=e[n])&&(a=(i<3?o(a):i>3?o(t,s,a):o(t,s))||a);return i>3&&a&&Object.defineProperty(t,s,a),a};const $=class{constructor(e){s(this,e),this.vegaCurrentStepUpdate=r(this,"vegaCurrentStepUpdate",7),this.currentStepUpdate=r(this,"currentStepUpdate",7),this.globalSlimmers={},this.renderModeController=new N,this.currentStepsController=new W,this.currentStepController=new M,this.currentDirectionController=new Y,this.renderer=new E,this.currentStepUpdateEventEmitter=f($,n),this.currentStepsSubStateSlimmer=C($,"currentSteps","watchCurrentSteps"),this.deprecatedPropertySlimmer=u($,"completedSteps","completedStepArray",[]),this.vegaComponentUsageRuntimeMetricsSlimmer=new h(I),this.currentSteps=[],this.current=0,this.direction="vertical",this.steps=[],this.completedStepArray=[],this.completedSteps=[],this.canClickStep=!0}watchCurrentSteps(){}async watchCurrentChange(){}async watchDirection(){}watchSteps(){}watchCompletedStepArray(){}watchCompletedSteps(){}async nextStep(){}async prevStep(){}async setCurrent(e){}async getCurrent(){return this.current}render(){return p(e(o,{class:{"vega-progress-tracker":!0,[this.currentDirection]:!0,"click-step-disabled":!this.canClickStep}},this.renderer.render()),this.host)}get host(){return i(this)}static get watchers(){return{currentSteps:["watchCurrentSteps"],current:["watchCurrentChange"],direction:["watchDirection"],steps:["watchSteps"],completedStepArray:["watchCompletedStepArray"],completedSteps:["watchCompletedSteps"]}}};H([v()],$.prototype,"globalSlimmers",void 0),H([d()],$.prototype,"renderModeController",void 0),H([d()],$.prototype,"currentStepsController",void 0),H([d()],$.prototype,"currentStepController",void 0),H([d()],$.prototype,"currentDirectionController",void 0),H([d()],$.prototype,"renderer",void 0),H([d()],$.prototype,"currentStepUpdateEventEmitter",void 0),H([d()],$.prototype,"currentStepsSubStateSlimmer",void 0),H([d()],$.prototype,"deprecatedPropertySlimmer",void 0),H([d()],$.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),$.style=':host .vega-progress-tracker__container{display:flex;align-items:center;padding-top:0px;padding-bottom:0px}:host .vega-progress-tracker__slot{width:100%;display:block}:host .vega-progress-step{display:flex;gap:16px}:host(:not(.click-step-disabled)) .vega-progress-step{cursor:pointer}:host(:not(.click-step-disabled)) .vega-progress-step.default:hover .vega-progress-step__icon{background-color:rgba(var(--v-bg-action-quaternary-hover, 239, 239, 239, 1))}:host(:not(.click-step-disabled)) .vega-progress-step.default .vega-progress-step__icon:hover{background-color:rgba(var(--v-bg-action-quaternary-hover, 239, 239, 239, 1))}:host(:not(.click-step-disabled)) .vega-progress-step.default:active .vega-progress-step__icon{background-color:rgba(var(--v-bg-action-quaternary-active, 205, 209, 211, 1))}:host(:not(.click-step-disabled)) .vega-progress-step.inProgress .vega-progress-step__icon:hover,:host(:not(.click-step-disabled)) .vega-progress-step.current .vega-progress-step__icon:hover{background-color:rgba(var(--v-bg-action-hover, 4, 112, 236, 1))}:host(:not(.click-step-disabled)) .vega-progress-step.inProgress:hover .vega-progress-step__icon,:host(:not(.click-step-disabled)) .vega-progress-step.current:hover .vega-progress-step__icon{background-color:rgba(var(--v-bg-action-hover, 4, 112, 236, 1))}:host(:not(.click-step-disabled)) .vega-progress-step.inProgress:active .vega-progress-step__icon,:host(:not(.click-step-disabled)) .vega-progress-step.current:active .vega-progress-step__icon{background-color:rgba(var(--v-bg-action-active, 29, 65, 195, 1))}:host(:not(.click-step-disabled)) .vega-progress-step.complete:hover .vega-progress-step__icon{border-color:rgba(var(--v-border-color-action-hover, 4, 112, 236, 1))}:host(:not(.click-step-disabled)) .vega-progress-step.complete:hover .vega-progress-step__icon vega-icon{color:rgba(var(--v-text-link-hover, 4, 112, 236, 1))}:host(:not(.click-step-disabled)) .vega-progress-step.complete:active .vega-progress-step__icon{border-color:rgba(var(--v-border-color-action-active, 29, 65, 195, 1))}:host(:not(.click-step-disabled)) .vega-progress-step.complete:active .vega-progress-step__icon vega-icon{color:rgba(var(--v-text-link-active, 29, 65, 195, 1))}:host(:not(.click-step-disabled)) .vega-progress-step.complete.current:hover .vega-progress-step__icon vega-icon{color:rgba(var(--v-text-inverted-primary, 252, 252, 252, 1))}:host(:not(.click-step-disabled)) .vega-progress-step.disabled{cursor:initial}:host(:not(.click-step-disabled)) .vega-progress-step.disabled.default:hover .vega-progress-step__icon{background-color:rgba(var(--v-bg-action-quaternary, 222, 225, 227, 1))}:host(:not(.click-step-disabled)) .vega-progress-step.disabled.default:active .vega-progress-step__icon{background-color:rgba(var(--v-bg-action-quaternary, 222, 225, 227, 1))}:host(:not(.click-step-disabled)) .vega-progress-step.disabled.inProgress:hover .vega-progress-step__icon,:host(:not(.click-step-disabled)) .vega-progress-step.disabled.current:hover .vega-progress-step__icon{background-color:rgba(var(--v-bg-action, 19, 98, 226, 1))}:host .vega-progress-step:focus-visible{outline-width:0px}:host .vega-progress-step:focus-visible .vega-progress-step-icon-container{border-radius:8px;outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:2px}:host .vega-progress-step .vega-progress-step-icon-divider{display:flex;flex-direction:column;align-items:center;gap:0px}:host .vega-progress-step .vega-progress-step-icon-container{padding:8px}:host .vega-progress-step .vega-progress-step__icon{display:block;font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border-radius:9999px;box-sizing:content-box;height:32px;width:32px;min-width:32px;line-height:32px}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-progress-step .vega-progress-step__icon{font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .vega-progress-step .vega-progress-step__icon{font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .vega-progress-step .vega-progress-step__icon{font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px}}:host .vega-progress-step .vega-progress-step__icon span{display:block}:host .vega-progress-step .vega-progress-step__icon:not(.disable-responsive){line-height:32px}:host .vega-progress-step .vega-progress-step__divider{width:1px;flex-grow:1;height:100%;background-color:rgba(var(--v-bg-action-quaternary, 222, 225, 227, 1));display:block}:host .vega-progress-step .vega-progress-step__divider.right.complete{background-color:rgba(var(--v-bg-action, 19, 98, 226, 1))}:host .vega-progress-step .vega-progress-step__divider.left{display:none}:host .vega-progress-step:last-child .vega-progress-step__divider.right{display:none}:host .vega-progress-step.default .vega-progress-step__icon{color:rgba(var(--v-text-primary, 32, 54, 69, 1));background-color:rgba(var(--v-bg-action-quaternary, 222, 225, 227, 1))}:host .vega-progress-step.complete .vega-progress-step__icon{display:flex;justify-content:center;align-items:center;background-color:rgba(var(--v-bg-action-tertiary, 0, 0, 0, 0));box-sizing:border-box;border-width:1px;border-style:solid;border-color:rgba(var(--v-border-color-action, 19, 98, 226, 1))}:host .vega-progress-step.complete .vega-progress-step__icon vega-icon{color:rgba(var(--v-text-link, 19, 98, 226, 1))}:host .vega-progress-step.complete.current .vega-progress-step__icon vega-icon{color:rgba(var(--v-text-inverted-primary, 252, 252, 252, 1))}:host .vega-progress-step.inProgress .vega-progress-step__icon,:host .vega-progress-step.current .vega-progress-step__icon{background-color:rgba(var(--v-bg-action, 19, 98, 226, 1));color:rgba(var(--v-text-inverted-primary, 252, 252, 252, 1));box-shadow:0 0 0 4px rgba(var(--v-ring-input-focus, 19, 98, 226, 0.25))}:host(.horizontal-compact){flex:1 1 100%;padding-top:0px}:host(.horizontal-compact) .vega-progress-tracker__container{padding-top:16px;padding-bottom:16px}:host(.horizontal-compact) .vega-progress-tracker__slot{display:flex;flex-wrap:nowrap;align-items:center;justify-content:space-between;gap:0px}:host(.horizontal-compact) .vega-progress-step{display:flex;flex-grow:1;flex-basis:0}:host(.horizontal-compact) .vega-progress-step .vega-progress-step-icon-divider{display:flex;flex-direction:row;gap:4px;width:100%}:host(.horizontal-compact) .vega-progress-step .vega-progress-step__icon{height:16px;width:16px;min-width:16px}:host(.horizontal-compact) .vega-progress-step .vega-progress-step__icon{line-height:16px}:host(.horizontal-compact) .vega-progress-step .vega-progress-step__icon vega-icon{height:8px;width:8px}:host(.horizontal-compact) .vega-progress-step .vega-progress-step__icon span{display:none}:host(.horizontal-compact) .vega-progress-step .vega-progress-step__divider{height:1px;flex-grow:1}:host(.horizontal-compact) .vega-progress-step .vega-progress-step__divider.left{display:block}:host(.horizontal-compact) .vega-progress-step .vega-progress-step__divider.left.background{background-color:rgba(var(--v-bg-action, 19, 98, 226, 1))}:host(.horizontal-compact) .vega-progress-step .vega-progress-step__divider.right{display:block}:host(.horizontal-compact) .vega-progress-step .vega-progress-step__title{display:none}:host(.horizontal-compact) .vega-progress-step:first-child .vega-progress-step__divider.left{opacity:0}:host(.horizontal-compact) .vega-progress-step:last-child .vega-progress-step__divider.right{display:block;opacity:0}:host(:not(.horizontal-compact)) .vega-progress-tracker__box{display:none}:host(.vertical) .vega-progress-step__title{padding-top:12px;padding-bottom:36px}:host(.horizontal){display:block;overflow-x:auto;padding-top:4px}:host(.horizontal) .vega-progress-tracker__slot{display:flex}:host(.horizontal) .vega-progress-step{flex-direction:column;align-items:center;gap:4px;flex-grow:1;flex-basis:0}:host(.horizontal) .vega-progress-step .vega-progress-step-icon-divider{flex-direction:row;align-items:center;gap:4px;width:100%}:host(.horizontal) .vega-progress-step .vega-progress-step__divider{height:1px;display:block}:host(.horizontal) .vega-progress-step .vega-progress-step__divider.left{display:block}:host(.horizontal) .vega-progress-step .vega-progress-step__divider.right.complete{background-color:rgba(var(--v-bg-action, 19, 98, 226, 1))}:host(.horizontal) .vega-progress-step .vega-progress-step__divider.left.background{background-color:rgba(var(--v-bg-action, 19, 98, 226, 1))}:host(.horizontal) .vega-progress-step .vega-progress-step__title{padding-top:0px;padding-bottom:0px;text-align:center;padding-left:4px;padding-right:4px}:host(.horizontal) .vega-progress-step:first-child .vega-progress-step__divider.left{opacity:0}:host(.horizontal) .vega-progress-step:last-child .vega-progress-step__divider.right{display:block;opacity:0}:host vega-carousel .subTitle{font-family:"Inter", sans-serif;font-size:18px;font-weight:700;line-height:25px;letter-spacing:0px;color:rgba(var(--v-text-primary, 32, 54, 69, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){:host vega-carousel .subTitle{font-family:"Inter", sans-serif;font-size:18px;font-weight:700;line-height:25px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host vega-carousel .subTitle{font-family:"Inter", sans-serif;font-size:18px;font-weight:700;line-height:25px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host vega-carousel .subTitle{font-family:"Inter", sans-serif;font-size:18px;font-weight:700;line-height:25px;letter-spacing:0px}}:host .vega-progress-tracker__box{display:flex;align-items:center}:host .vega-progress-tracker__box vega-carousel{width:100%;text-align:center}';var B=function(e,t,s,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,s):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,s,r);else for(var n=e.length-1;n>=0;n--)(o=e[n])&&(a=(i<3?o(a):i>3?o(t,s,a):o(t,s))||a);return i>3&&a&&Object.defineProperty(t,s,a),a};class F extends P{constructor(){super({parent:"vega-progress-tracker",subStates:[{subStateName:"status",parentStateName:"currentSteps",callback:e=>{const t=e.find((e=>e.stepKey===this.stepKey));this.progressStatus=t.progressStatus,this.isCurrent=t.isCurrent}}]})}}B([c()],F.prototype,"host",void 0),B([c({writable:!0})],F.prototype,"progressStatus",void 0),B([c({writable:!0})],F.prototype,"isCurrent",void 0),B([c()],F.prototype,"stepKey",void 0);var G=function(e,t,s,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,s):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,s,r);else for(var n=e.length-1;n>=0;n--)(o=e[n])&&(a=(i<3?o(a):i>3?o(t,s,a):o(t,s))||a);return i>3&&a&&Object.defineProperty(t,s,a),a};const J=class{constructor(e){s(this,e),this.globalSlimmers={},this.stateController=new F,this.vegaComponentUsageRuntimeMetricsSlimmer=new h,this.progressStatus=A.DEFAULT,this.isCurrent=!1,this.stepKey="",this.clickable=!0}render(){return p(e(o,null,e("div",{class:{"title-container":!0,[this.progressStatus]:!0,current:this.isCurrent}},e("slot",null))),this.host)}get host(){return i(this)}};G([v()],J.prototype,"globalSlimmers",void 0),G([d()],J.prototype,"stateController",void 0),G([d()],J.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),J.style=':host .title-container{font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px;color:rgba(var(--v-text-secondary, 107, 116, 125, 1));display:block}@media screen and (min-width: 768px) and (max-width: 1023px){:host .title-container{font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .title-container{font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .title-container{font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px}}:host .title-container.inProgress,:host .title-container.current{font-family:"Inter", sans-serif;font-size:16px;font-weight:700;line-height:22px;letter-spacing:0px;color:rgba(var(--v-text-primary, 32, 54, 69, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){:host .title-container.inProgress,:host .title-container.current{font-family:"Inter", sans-serif;font-size:16px;font-weight:700;line-height:22px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .title-container.inProgress,:host .title-container.current{font-family:"Inter", sans-serif;font-size:16px;font-weight:700;line-height:22px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .title-container.inProgress,:host .title-container.current{font-family:"Inter", sans-serif;font-size:16px;font-weight:700;line-height:22px;letter-spacing:0px}}:host .title-container.complete{color:rgba(var(--v-text-primary, 32, 54, 69, 1))}';export{$ as vega_progress_tracker,J as vega_progress_tracker_step}
@@ -0,0 +1 @@
1
+ import{V as t,I as e,c as s,M as i}from"./p-6e1ab235.js";import{c as r}from"./p-02841589.js";import{C as o}from"./p-2d0d575f.js";import{O as n}from"./p-331a62d5.js";import{U as a,a as l,b as h,F as c,c as d,d as u,e as f}from"./p-a528714c.js";import{f as m,d as p}from"./p-6c170474.js";import{a as v,g as b}from"./p-8b5d3a52.js";import{c as R}from"./p-6a334573.js";import{d as g,D as j}from"./p-31ac7386.js";import{e as y,c as w,f as O}from"./p-7c39ce96.js";import{V as E}from"./p-dad3ba5f.js";import{h as V,l as F}from"./p-f0e828d8.js";import{P as I}from"./p-021d4ae4.js";import{I as C}from"./p-abd7aeaa.js";import{M as S}from"./p-78a57a17.js";import{A}from"./p-52b8f2d2.js";import{i as k}from"./p-d27ae9ff.js";import{S as T}from"./p-5eb7f382.js";class L{constructor(t){this.rule=t}getStatus(t,e,s){return{canEvaluate:this.rule.canEvaluate(t,e,s),isAsync:v(this.rule.evaluate)}}shouldShowError(t,e){try{return this.rule.shouldShowError?this.rule.shouldShowError(t,e):this.defaultShouldShowError(t)}catch(t){return!1}}handle(t){try{return this.rule.evaluate(t)}catch(t){return{isValid:!0,message:""}}}defaultShouldShowError(t){return!t.disabled&&t.visible&&(t.touched||t.modified)}}class M{constructor(){this.handlers=[],this.processId=""}checkIncludesAsyncRuleHandler(t,e,s){return!!this.handlers.find((i=>{const r=i.getStatus(t,e,s);return r.canEvaluate&&r.isAsync}))}setHandlersByRules(t){this.handlers=t&&t.length?t.map((t=>new L(t))):[]}async process(t,e,s,i,r){const o=this.preProcess();let n;for(const i of this.handlers){if(o!==this.processId)break;const r=i.getStatus(t,e,s);if(!r.canEvaluate)continue;let a;if(r.isAsync)try{a=await i.handle(t)}catch(t){}else a=i.handle(t);if(a&&!a.isValid){const t=i.shouldShowError(e,s);n=Object.assign(Object.assign({},a),{shouldShowError:t});break}}return this.postProcess(o,i,n,r),n?{isValid:!1,message:n.message}:{isValid:!0,message:""}}preProcess(){const t=b();return this.processId=t,t}postProcess(t,e,s,i){this.processId===t&&i(e,s)}}class D{run(t){const e=t.nextElementSibling;return e&&e.querySelector(".vega-error")?e.querySelector(".vega-error"):null}}class B{run(t){let e=t.nextElementSibling;return e&&!e.classList.contains("vega-error")&&(e=document.createElement("label"),e.classList.add("vega-error"),e.setAttribute("part","field-error-message"),t.after(e)),e}}class H{run(t){let e=t.nextElementSibling;return e||(e=document.createElement("label"),e.classList.add("vega-error"),e.setAttribute("part","field-error-message"),t.after(e)),e}}class U extends t{getTranslatedMessage(t){return"string"==typeof t?E.t(t):E.t(t.key,...t.args||[])}}var x=function(t,e,s,i){var r,o=arguments.length,n=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(o<3?r(n):o>3?r(e,s,n):r(e,s))||n);return o>3&&n&&Object.defineProperty(e,s,n),n};class G extends t{constructor(){super(),this.formFieldMessageTranslatorSlimmer=new U,this.fieldErrorUiControllerStrategies=[new D,new B,new H],this.initTranslationObserver()}applyInputInvalidUI(t){const e=this.getInputElementContainer();if(o.notify(g.getSubject(this.host,y),{host:this.host,showError:!0}),e&&(e.classList.add("error"),t)){this.errorMessage=t;const s=this.getErrorContainer(e);s.innerHTML=V.sanitize(this.formFieldMessageTranslatorSlimmer.getTranslatedMessage(t),F),s.classList.remove("vega-hidden")}}resetInputInvalidUI(){this.errorMessage="";const t=this.getInputElementContainer();t&&(this.getErrorContainer(t).classList.add("vega-hidden"),t.classList.remove("error"),o.notify(g.getSubject(this.host,y),{host:this.host,showError:!1}))}getInputElementContainer(){return this.options&&this.options.inputContainerGetter?this.options.inputContainerGetter():null}getErrorContainer(t){for(const e of this.fieldErrorUiControllerStrategies){const s=e.run(t);if(s)return s}}initTranslationObserver(){const t=new n(this.isAcceptableTranslationObserver.bind(this),(()=>{if(!this.errorMessage)return;const t=this.getInputElementContainer();if(t){const e=this.getErrorContainer(t);e&&(e.innerHTML=V.sanitize(this.formFieldMessageTranslatorSlimmer.getTranslatedMessage(this.errorMessage),F))}}));o.register(a,t)}isAcceptableTranslationObserver(){return!0}}x([e()],G.prototype,"formFieldMessageTranslatorSlimmer",void 0),x([s()],G.prototype,"host",void 0),x([s()],G.prototype,"options",void 0);var P=function(t,e,s,i){var r,o=arguments.length,n=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(o<3?r(n):o>3?r(e,s,n):r(e,s))||n);return o>3&&n&&Object.defineProperty(e,s,n),n};class W{constructor(t,e,s,i){var r,n;this.formFieldMessageTranslatorSlimmer=new U,this.fieldErrorUIController=new G,this.resizeObserverSlimmer=R(W,I,[],[{mapFrom:"connectResizeObserver",mapTo:"connectResizeObserver"}],[{callback:t=>{const e=this.isVisible,s=t[0].contentRect.height>0;this.isVisible=s,this.isAutoValidationEnabled()&&m(this.host,"vega-form")&&e!==s&&this.valid(["visible"])},target:()=>this.host}]),this.defaultRules=[],this.additionalRules=[],this.listeners=[],this.isTouched=!1,this.isModified=!1,this.isVisible=!1,this.formFieldValidationRuleHandlerChain=new M,this.hostChildAddedBlurEventMap=new WeakMap,this.handleValidationResult=(t,e)=>{let s=!0;return e?("rule"===t?e.shouldShowError?this.fieldErrorUIController.applyInputInvalidUI(e.message):this.fieldErrorUIController.resetInputInvalidUI():t?this.fieldErrorUIController.applyInputInvalidUI(e.message):this.fieldErrorUIController.resetInputInvalidUI(),s=!1):this.fieldErrorUIController.resetInputInvalidUI(),this.invokeListeners(s),o.notify(l,{host:this.host,detail:s}),s},this.setupTouchedListener=()=>{this.getTouchableAreaElements().filter((t=>t&&!0!==this.hostChildAddedBlurEventMap.get(t))).forEach((t=>{t.addEventListener("blur",(()=>{this.updateIsTouched(!0)})),this.hostChildAddedBlurEventMap.set(t,!0)}))},this.defaultRules=t||[],this.host=e,this.defaultValue=s,this.options=i,this.initDisabledAttrObserver(),this.connectResizeObserver(),this.initFormResetObserver(),null===(n=(r=this.host).componentOnReady)||void 0===n||n.call(r).then((()=>{this.didRender()})),this.setupModifiedListener(),this.listenHostElementKeydown(),this.updateValidationHandlers()}async validate(t){return await this.valid([],t)}addListener(t){this.listeners.push(t)}getRules(){const t=[...this.additionalRules];return[...this.defaultRules.map((e=>this.overrideDefaultRuleByAdditionalRule(e,t))),...t]}setDefaultRules(t){this.defaultRules=t,this.updateValidationHandlers()}setAdditionalRules(t){this.additionalRules=t,this.updateValidationHandlers()}destroy(){o.notify(h,{host:this.host}),this.unregisterFormResetObserver(),o.unregister(c,this.hostValueChangeObserver),this.hostChildrenObserver&&this.hostChildrenObserver.disconnect()}connectResizeObserver(){}updateDisableBlurValidation(t){this.disableBlurValidation=t}updateValidationHandlers(){this.formFieldValidationRuleHandlerChain.setHandlersByRules(this.getRules())}async valid(t,e="rule"){const s=this.getStatus(),i=this.host.value;this.formFieldValidationRuleHandlerChain.checkIncludesAsyncRuleHandler(i,s,t)&&o.notify(l,{host:this.host,detail:null});const{isValid:r,message:n}=await this.formFieldValidationRuleHandlerChain.process(i,s,t,e,this.handleValidationResult);return{isValid:r,message:this.formFieldMessageTranslatorSlimmer.getTranslatedMessage(n)}}invokeListeners(t){this.listeners.forEach((e=>e.callback(t)))}getStatus(){return{touched:this.isTouched,modified:this.isModified,disabled:this.host.disabled,visible:this.isVisible}}updateIsTouched(t){const e=this.isTouched;this.isTouched=t,!this.disableBlurValidation&&this.isAutoValidationEnabled()&&this.valid(e===t?[]:["touched"])}updateIsModified(t){const e=this.isModified;this.isModified=t,this.isAutoValidationEnabled()&&this.valid(e===t?[]:["modified"])}initDisabledAttrObserver(){this.disabledAttrObserver=new MutationObserver((()=>{this.isAutoValidationEnabled()&&this.valid(["disabled"])})),this.disabledAttrObserver.observe(this.host,{attributes:!0,attributeFilter:["disabled"]})}canAcceptFormResetOperation(t){return m(this.host,"vega-form")===t.host}unregisterFormResetObserver(){o.unregister(d,this.formResetTriggeredObserver)}monitorTouchedListener(){const t=this.getInputContainerElements();t&&(this.hostChildrenObserver=new MutationObserver((()=>{this.setupTouchedListener()})),this.hostChildrenObserver.observe(t,{childList:!0,subtree:!0})),this.setupTouchedListener()}getTouchableAreaElements(){return this.options&&this.options.touchableAreaGetter?this.options.touchableAreaGetter():[]}getInputContainerElements(){return this.options&&this.options.inputContainerGetter?this.options.inputContainerGetter():null}setupModifiedListener(){this.hostValueChangeObserver=new n(this.isCurrentTarget.bind(this),(()=>this.updateIsModified(!0))),o.register(c,this.hostValueChangeObserver)}isCurrentTarget(t){return this.host===t.host}async reset(t){var e,s;if(this.shouldVisitElement(this.host,null===(e=t.option)||void 0===e?void 0:e.skipDisabled,null===(s=t.option)||void 0===s?void 0:s.skipInvisible)){const e=t.defaultValueMap,s=this.host.dataset.vegaForm,i=null==e[s]?this.getDefaultValue():e[s];"function"==typeof this.host.setValue?await this.host.setValue(i):this.host.value=i,this.isTouched=!1,this.isModified=!1,this.fieldErrorUIController.resetInputInvalidUI()}}getDefaultValue(){return this.defaultValue instanceof Function?this.defaultValue(this.host):this.defaultValue}didRender(){this.monitorTouchedListener()}initFormResetObserver(){this.formResetTriggeredObserver=new n(this.canAcceptFormResetOperation.bind(this),this.reset.bind(this)),o.register(d,this.formResetTriggeredObserver)}isAutoValidationEnabled(){return!1!==this.host.autoValidation}shouldVisitElement(t,e,s){return!(!t.dataset.vegaForm||e&&t.disabled||s&&!p(t))}listenHostElementKeydown(){this.host.addEventListener("keydown",(t=>{if(this.canSubmitFormByEvent(t)){const t=m(this.host,"vega-form",{outerMost:!0});t&&o.notify(g.getSubject(t,w),{host:this.host})}}))}canSubmitFormByEvent(t){const e="Enter"===t.key||13===t.keyCode,s=e&&t.shiftKey;switch(this.host.tagName){case"VEGA-TEXTAREA":case"VEGA-DATE-PICKER":case"VEGA-TIME-PICKER":return s&&t.preventDefault(),s;case"VEGA-RICH-TEXT-EDITOR":return!1;default:return e}}overrideDefaultRuleByAdditionalRule(t,e){if(t&&e){const s=e.findIndex((e=>e instanceof C&&e instanceof t.constructor&&e.overrideDefault));if(s>-1)return e.splice(s,1)[0]}return t}}P([e()],W.prototype,"formFieldMessageTranslatorSlimmer",void 0),P([e()],W.prototype,"fieldErrorUIController",void 0),P([e()],W.prototype,"resizeObserverSlimmer",void 0);var z=function(t,e,s,i){var r,o=arguments.length,n=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(o<3?r(n):o>3?r(e,s,n):r(e,s))||n);return o>3&&n&&Object.defineProperty(e,s,n),n};class K extends t{constructor(){super(...arguments),this.fieldErrorUIController=new G,this.handleFieldErrorMessageUpdate=t=>{const{message:e,isValid:s}=t;s?this.fieldErrorUIController.resetInputInvalidUI():this.fieldErrorUIController.applyInputInvalidUI(e)}}handleComponentWillLoadByFieldErrorSlimmer(){this.fieldErrorMessageChangeObserver=new n(this.canAcceptFieldErrorMessageUpdate.bind(this),this.handleFieldErrorMessageUpdate),o.register(u,this.fieldErrorMessageChangeObserver)}handleUnregisterObserver(){o.unregister(u,this.fieldErrorMessageChangeObserver)}canAcceptFieldErrorMessageUpdate(t){const{host:e}=t,s=this.host.parentElement;return s&&s===e&&"VEGA-FIELD-ERROR"===s.tagName||this.host===e}}z([s()],K.prototype,"host",void 0),z([s()],K.prototype,"options",void 0),z([e()],K.prototype,"fieldErrorUIController",void 0),z([i("setInjectFormFieldHelper")],K.prototype,"handleComponentWillLoadByFieldErrorSlimmer",null),z([i("disconnectedCallback")],K.prototype,"handleUnregisterObserver",null);var N=function(t,e,s,i){var r,o=arguments.length,n=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(o<3?r(n):o>3?r(e,s,n):r(e,s))||n);return o>3&&n&&Object.defineProperty(e,s,n),n};class X extends t{constructor(){super(...arguments),this.handleValidInvocation=async t=>{if(this.validator){void 0!==t.timerId&&clearTimeout(t.timerId);const e=await this.validator.validate(t.message);if(e){const{isValid:s,message:i}=e;"function"==typeof t.promiseResolve&&t.promiseResolve({isValid:s,message:i})}}}}registerValidInvocationObserver(){j.addUniqueObserverToNode(this.host,O,this.handleValidInvocation)}handleUnregisterObserver(){j.removeUniqueObserverFromNode(this.host,O)}}N([s()],X.prototype,"host",void 0),N([s()],X.prototype,"validator",void 0),N([i("setInjectFormFieldHelper")],X.prototype,"registerValidInvocationObserver",null),N([i("disconnectedCallback")],X.prototype,"handleUnregisterObserver",null);var q=function(t,e,s,i){var r,o=arguments.length,n=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(o<3?r(n):o>3?r(e,s,n):r(e,s))||n);return o>3&&n&&Object.defineProperty(e,s,n),n};class J extends T{constructor(){super({parent:"vega-form",subStates:[{subStateName:"disableBlurValidation",parentStateName:"disableBlurValidation",callback:t=>{var e;null===(e=this.validator)||void 0===e||e.updateDisableBlurValidation(t)}}]})}componentWillLoad(){super.componentWillLoad()}}q([s()],J.prototype,"host",void 0),q([s()],J.prototype,"validator",void 0),q([i("setInjectFormFieldHelper")],J.prototype,"componentWillLoad",null);var Q=function(t,e,s,i){var r,o=arguments.length,n=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(o<3?r(n):o>3?r(e,s,n):r(e,s))||n);return o>3&&n&&Object.defineProperty(e,s,n),n};class Y extends t{constructor(t){super(),this.fieldErrorSlimmer=new K,this.formFieldValidInvokeSlimmer=new X,this.formFormStateController=new J,this.mutationObserverCallBack=()=>{this.validator&&(this.setDefaultRules(),this.internalValidate())},this.options=t,this.setMutationObserverSlimmer()}connectedCallback(){null===this.validator&&this.setInjectFormFieldHelper()}disconnectedCallback(){this.validator&&(this.validator.destroy(),this.validator=null)}componentDidLoad(){}static isValidFormField(t){return t&&Boolean(t.getAttribute("data-vega-form"))}watchValidationRulesByFormControllerSlimmer(t,e){k(t,e,!1,((t,e)=>t===e?0:-1))||(this.setAdditionalRules(),this.internalValidate())}setInjectFormFieldHelper(){if(Y.isValidFormField(this.host)){const{defaultValue:t}=this.options,e=new W(this.getPropertyRules(),this.host,t,this.options);e.addListener({callback:t=>{this.isValid!=t&&(this.isValid=t,o.notify(f,{host:this.host,detail:t}))}}),this.validator=e,this.setAdditionalRules()}}setAdditionalRules(){this.options.validationRulesName&&"validationRules"===this.options.validationRulesName&&this.validator&&this.validator.setAdditionalRules(this.validationRules||[])}setDefaultRules(){this.validator&&this.validator.setDefaultRules(this.getPropertyRules())}getPropertyRules(){const{propertyRules:t,attributeGetter:e}=this.options;return t.map((t=>{const s=t.dependence&&"string"==typeof t.dependence?[e(t.dependence)]:Array.isArray(t.dependence)?t.dependence.map((t=>e(t))):[null];return t.ruleFactory(e(t.propertyName),...s)})).filter(Boolean)}internalValidate(){!this.disabled&&this.validator&&this.validator.validate()}setMutationObserverSlimmer(){this.mutationObserverSlimmer=new S({options:{attributeFilter:this.options.propertyRules.map((t=>r(t.propertyName))),attributeOldValue:!0},mutationFilter:A(),callback:this.mutationObserverCallBack})}}Q([s()],Y.prototype,"host",void 0),Q([s({writable:!0})],Y.prototype,"validationRules",void 0),Q([s()],Y.prototype,"disabled",void 0),Q([s()],Y.prototype,"autoValidation",void 0),Q([s({writable:!0})],Y.prototype,"isValid",void 0),Q([e()],Y.prototype,"fieldErrorSlimmer",void 0),Q([e()],Y.prototype,"formFieldValidInvokeSlimmer",void 0),Q([e()],Y.prototype,"mutationObserverSlimmer",void 0),Q([e()],Y.prototype,"formFormStateController",void 0),Q([i("connectedCallback")],Y.prototype,"connectedCallback",null),Q([i("disconnectedCallback")],Y.prototype,"disconnectedCallback",null),Q([i("componentDidLoad")],Y.prototype,"componentDidLoad",null),Q([i("watchValidationRules")],Y.prototype,"watchValidationRulesByFormControllerSlimmer",null),Q([i("componentWillLoad")],Y.prototype,"setInjectFormFieldHelper",null);export{Y as F}
@@ -1 +1 @@
1
- import{V as t,M as r,A as s,D as e}from"./p-1f83cebf.js";import{m as i,a,s as d}from"./p-262ec334.js";import{I as n}from"./p-abd7aeaa.js";class o extends n{static validateCreditCardDigits(t){const r=i(t).reverse();return!(r.length<12||r.length>19)&&a(r,(t=>t%2==0)).reduce(d,0)%10==0}evaluate(t){if(!this.isAcceptedInputType(t))throw new Error(`Unexpected type of input: ${typeof t}: ${t}`);const r=this.formatCreditCardNumber(t),s=this.isValidVisaCreditCard(t)||this.isValidAmexCreditCard(t)||this.isValidDiscoverCreditCard(t)||this.isValidMasterCardCreditCard(t)||!this.isSupportedCreditCardType(r)&&o.validateCreditCardDigits(r);return{isValid:s,message:s?"":"Credit card number is invalid"}}canEvaluate(t,r){return r?this.isAcceptedInputType(t)&&!r.disabled&&r.visible:this.isAcceptedInputType(t)}shouldShowError(t){return!t.disabled&&t.visible&&(t.touched||t.modified)}isValidVisaCreditCard(r){const s=this.formatCreditCardNumber(r);return t.test(s)&&(13===s.length||16===s.length||19===s.length)&&o.validateCreditCardDigits(s)}isValidMasterCardCreditCard(t){const s=this.formatCreditCardNumber(t);return r.test(s)&&16===s.length&&o.validateCreditCardDigits(s)}isValidAmexCreditCard(t){const r=this.formatCreditCardNumber(t);return s.test(r)&&15===r.length&&o.validateCreditCardDigits(r)}isValidDiscoverCreditCard(t){const r=this.formatCreditCardNumber(t);return e.test(r)&&16===r.length&&o.validateCreditCardDigits(r)}isAcceptedInputType(t){return"string"==typeof t}formatCreditCardNumber(t){return t.replace(/\s/g,"")}isSupportedCreditCardType(i){return t.test(i)||r.test(i)||s.test(i)||e.test(i)}}export{o as V}
1
+ import{V as t,M as r,A as s,D as i}from"./p-415ffa35.js";import{m as e,a,s as d}from"./p-262ec334.js";import{I as n}from"./p-abd7aeaa.js";class o extends n{static validateCreditCardDigits(t){const r=e(t).reverse();return!(r.length<12||r.length>19)&&a(r,(t=>t%2==0)).reduce(d,0)%10==0}evaluate(t){if(!this.isAcceptedInputType(t))throw new Error(`Unexpected type of input: ${typeof t}: ${t}`);const r=this.formatCreditCardNumber(t),s=this.isValidVisaCreditCard(t)||this.isValidAmexCreditCard(t)||this.isValidDiscoverCreditCard(t)||this.isValidMasterCardCreditCard(t)||!this.isSupportedCreditCardType(r)&&o.validateCreditCardDigits(r);return{isValid:s,message:s?"":"Credit card number is invalid"}}canEvaluate(t,r){return r?this.isAcceptedInputType(t)&&!r.disabled&&r.visible:this.isAcceptedInputType(t)}shouldShowError(t){return!t.disabled&&t.visible&&(t.touched||t.modified)}isValidVisaCreditCard(r){const s=this.formatCreditCardNumber(r);return t.test(s)&&(13===s.length||16===s.length||19===s.length)&&o.validateCreditCardDigits(s)}isValidMasterCardCreditCard(t){const s=this.formatCreditCardNumber(t);return r.test(s)&&16===s.length&&o.validateCreditCardDigits(s)}isValidAmexCreditCard(t){const r=this.formatCreditCardNumber(t);return s.test(r)&&15===r.length&&o.validateCreditCardDigits(r)}isValidDiscoverCreditCard(t){const r=this.formatCreditCardNumber(t);return i.test(r)&&16===r.length&&o.validateCreditCardDigits(r)}isAcceptedInputType(t){return"string"==typeof t}formatCreditCardNumber(t){return t.replace(/\s/g,"")}isSupportedCreditCardType(e){return t.test(e)||r.test(e)||s.test(e)||i.test(e)}}export{o as V}
@@ -0,0 +1 @@
1
+ import{e as t}from"./p-40f39194.js";import{B as r}from"./p-ed45b3b6.js";const e=()=>{let e=t.length-1;const o=window.innerWidth;for(;e>=0;e--){const s=t[e];if("default"===s)break;if(o>=r[s])return s}return"default"},o=r=>{let e;return t.forEach((t=>{Object.prototype.hasOwnProperty.call(r,t)?e=r[t]:r[t]=e})),r};export{o as c,e as g}