@heartlandone/vega 2.89.0 → 2.90.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 (348) hide show
  1. package/dist/cjs/{app-globals-4872f4e6.js → app-globals-08924736.js} +9 -7
  2. package/dist/cjs/{code-block-7c49d175.js → code-block-89850671.js} +1 -1
  3. package/dist/cjs/{component-value-history-controller-slimmer.abstract-aae22ddf.js → component-value-history-controller-slimmer.abstract-a8da4087.js} +3 -3
  4. package/dist/cjs/{content-state-76b81780.js → content-state-e1c3efe6.js} +2 -2
  5. package/dist/cjs/{date-required-rule-71f71b32.js → date-required-rule-3437acbc.js} +1 -1
  6. package/dist/cjs/{design-token-c80d3f32.js → design-token-939bf72c.js} +3 -3
  7. package/dist/cjs/{element-appender-slimmer-e95427b5.js → element-appender-slimmer-14e85a91.js} +2 -2
  8. package/dist/cjs/{form-field-controller-slimmer-430b4f02.js → form-field-controller-slimmer-c4ebee27.js} +1 -1
  9. package/dist/cjs/{image-annotation-action-7959fd77.js → image-annotation-action-f86690fd.js} +26 -2
  10. package/dist/cjs/index.cjs.js +19 -19
  11. package/dist/cjs/{inject-keyboard-manager-3ccf1cb6.js → inject-keyboard-manager-743de047.js} +1 -1
  12. package/dist/cjs/{internal-translation-controller-5582d789.js → internal-translation-controller-9785d4e8.js} +4 -0
  13. package/dist/cjs/{keyboard-manager-5babfda8.js → keyboard-manager-5396083a.js} +1 -1
  14. package/dist/cjs/{keyboard-manager-slimmer-a73354ca.js → keyboard-manager-slimmer-eedcfbc8.js} +1 -1
  15. package/dist/cjs/link-extension-dafeeed0.js +583 -0
  16. package/dist/cjs/loader.cjs.js +11 -12
  17. package/dist/cjs/{month-view-generator-43e75062.js → month-view-generator-c7492e06.js} +1 -1
  18. package/dist/cjs/{public-rules-b23ab52d.js → public-rules-b032050f.js} +7 -7
  19. package/dist/cjs/{range-abe1b989.js → range-efdf6f78.js} +1 -1
  20. package/dist/cjs/{replace-selected-text-action-ef079fed.js → replace-selected-text-action-0f7b7c78.js} +1 -1
  21. package/dist/cjs/{responsive-format-facade-cc368403.js → responsive-format-facade-d112aa9f.js} +1 -1
  22. package/dist/cjs/{rich-text-editor-required-rule-bbd727a2.js → rich-text-editor-required-rule-86d9cd4d.js} +1 -1
  23. package/dist/cjs/{split-cell-operation-b1fe91b5.js → split-cell-operation-b41344bd.js} +3 -3
  24. package/dist/cjs/{state-border-formatter-398134c1.js → state-border-formatter-c3c9b90d.js} +1 -1
  25. package/dist/cjs/{string-format-strategy.abstract-67421e2b.js → string-format-strategy.abstract-d51050cd.js} +1 -1
  26. package/dist/cjs/{string-input-formatter-slimmer-e84530b9.js → string-input-formatter-slimmer-23fdb50e.js} +1 -1
  27. package/dist/cjs/{string-mask-strategy-f9806f9b.js → string-mask-strategy-10fe0f6d.js} +2 -2
  28. package/dist/cjs/{style-formatter-da3a556b.js → style-formatter-11c95331.js} +2 -2
  29. package/dist/cjs/{time-required-rule-618109fa.js → time-required-rule-2fd7c828.js} +1 -1
  30. package/dist/cjs/{token-extension-dfee303a.js → token-extension-2e3e1631.js} +125 -498
  31. package/dist/cjs/{translation-slimmer-1a7a2b6d.js → translation-slimmer-e8549aff.js} +17 -1
  32. package/dist/cjs/{type-guard-474dec0d.js → type-guard-9917b11f.js} +1 -1
  33. package/dist/cjs/{valid-credit-card-number-rule-00c18527.js → valid-credit-card-number-rule-8c541bcd.js} +1 -1
  34. package/dist/cjs/vega-accordion.cjs.entry.js +6 -6
  35. package/dist/cjs/vega-app-header-button.cjs.entry.js +5 -5
  36. package/dist/cjs/vega-box.cjs.entry.js +6 -6
  37. package/dist/cjs/vega-button-circle.cjs.entry.js +5 -5
  38. package/dist/cjs/vega-button.cjs.entry.js +3 -3
  39. package/dist/cjs/vega-calendar_4.cjs.entry.js +6 -6
  40. package/dist/cjs/vega-card.cjs.entry.js +5 -5
  41. package/dist/cjs/vega-carousel.cjs.entry.js +3 -3
  42. package/dist/cjs/vega-checkbox_2.cjs.entry.js +14 -7
  43. package/dist/cjs/vega-chip.cjs.entry.js +5 -5
  44. package/dist/cjs/vega-code-block.cjs.entry.js +8 -8
  45. package/dist/cjs/vega-color-picker.cjs.entry.js +2 -2
  46. package/dist/cjs/vega-color-swatch-picker.cjs.entry.js +3 -3
  47. package/dist/cjs/vega-color-swatch.cjs.entry.js +2 -2
  48. package/dist/cjs/vega-combo-box.cjs.entry.js +8 -8
  49. package/dist/cjs/vega-date-picker_2.cjs.entry.js +13 -13
  50. package/dist/cjs/vega-dialog_2.cjs.entry.js +3 -3
  51. package/dist/cjs/vega-divider.cjs.entry.js +5 -5
  52. package/dist/cjs/vega-dropdown_5.cjs.entry.js +7 -7
  53. package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
  54. package/dist/cjs/vega-field-label.cjs.entry.js +3 -3
  55. package/dist/cjs/vega-file-uploader.cjs.entry.js +3 -3
  56. package/dist/cjs/vega-flag-icon.cjs.entry.js +5 -5
  57. package/dist/cjs/vega-flex.cjs.entry.js +6 -6
  58. package/dist/cjs/vega-font.cjs.entry.js +5 -5
  59. package/dist/cjs/vega-form.cjs.entry.js +3 -3
  60. package/dist/cjs/vega-grid.cjs.entry.js +5 -5
  61. package/dist/cjs/vega-icon.cjs.entry.js +5 -5
  62. package/dist/cjs/vega-image-uploader.cjs.entry.js +5 -5
  63. package/dist/cjs/vega-input-credit-card.cjs.entry.js +17 -7
  64. package/dist/cjs/vega-input-numeric.cjs.entry.js +5 -5
  65. package/dist/cjs/vega-input-passcode.cjs.entry.js +5 -5
  66. package/dist/cjs/vega-input-phone-number.cjs.entry.js +4 -4
  67. package/dist/cjs/vega-input-range.cjs.entry.js +3 -3
  68. package/dist/cjs/vega-input-select.cjs.entry.js +5 -5
  69. package/dist/cjs/vega-input.cjs.entry.js +6 -6
  70. package/dist/cjs/vega-left-nav_5.cjs.entry.js +7 -7
  71. package/dist/cjs/vega-loader-wrapper_2.cjs.entry.js +3 -3
  72. package/dist/cjs/vega-pagination-page-size-selector-mobile.cjs.entry.js +2 -2
  73. package/dist/cjs/vega-pagination.cjs.entry.js +4 -4
  74. package/dist/cjs/vega-popover_2.cjs.entry.js +8 -8
  75. package/dist/cjs/vega-progress-tracker_2.cjs.entry.js +3 -3
  76. package/dist/cjs/vega-radio_2.cjs.entry.js +17 -10
  77. package/dist/cjs/vega-rich-text-content.cjs.entry.js +63 -31
  78. package/dist/cjs/vega-rich-text-editor_4.cjs.entry.js +65 -22
  79. package/dist/cjs/vega-rich-text-special-characters-panel.cjs.entry.js +5 -5
  80. package/dist/cjs/vega-rich-text-table-properties_3.cjs.entry.js +8 -8
  81. package/dist/cjs/vega-selection-chip_2.cjs.entry.js +18 -5
  82. package/dist/cjs/vega-selection-tile_2.cjs.entry.js +2 -2
  83. package/dist/cjs/vega-sidenav_3.cjs.entry.js +3 -3
  84. package/dist/cjs/vega-signature-capture.cjs.entry.js +7 -7
  85. package/dist/cjs/vega-stepper.cjs.entry.js +2 -2
  86. package/dist/cjs/vega-tab-group_2.cjs.entry.js +8 -5
  87. package/dist/cjs/vega-table_11.cjs.entry.js +4 -4
  88. package/dist/cjs/vega-textarea.cjs.entry.js +2 -2
  89. package/dist/cjs/vega-time-picker_2.cjs.entry.js +9 -9
  90. package/dist/cjs/vega-toggle-switch.cjs.entry.js +2 -2
  91. package/dist/cjs/vega-tooltip_2.cjs.entry.js +6 -6
  92. package/dist/cjs/vega.cjs.js +11 -12
  93. package/dist/collection/components/vega-checkbox/vega-checkbox-group/vega-checkbox-group.css +8 -11
  94. package/dist/collection/components/vega-checkbox/vega-checkbox-group/vega-checkbox-group.js +35 -7
  95. package/dist/collection/components/vega-field-label/vega-field-label.js +2 -2
  96. package/dist/collection/components/vega-input-credit-card/vega-input-credit-card.js +35 -1
  97. package/dist/collection/components/vega-radio/vega-radio-group/vega-radio-group.css +8 -11
  98. package/dist/collection/components/vega-radio/vega-radio-group/vega-radio-group.js +35 -7
  99. package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/link-wrapper-renderer.js +36 -1
  100. package/dist/collection/components/vega-rich-text-editor/extensions/base-toolbar-button-renderer.js +15 -12
  101. package/dist/collection/components/vega-rich-text-editor/extensions/extension.abstract.js +11 -0
  102. package/dist/collection/components/vega-rich-text-editor/extensions/functions/renderers/function-toolbar-button-renderer.js +1 -1
  103. package/dist/collection/components/vega-rich-text-editor/extensions/languages/language-toolbar-button-renderer.js +30 -16
  104. package/dist/collection/components/vega-rich-text-editor/extensions/line-height/line-height-toolbar-button-renderer.js +1 -1
  105. package/dist/collection/components/vega-rich-text-editor/extensions/link/link-extension.js +34 -0
  106. package/dist/collection/components/vega-rich-text-editor/extensions/link/type.js +1 -0
  107. package/dist/collection/components/vega-rich-text-editor/extensions/link/utils.js +22 -0
  108. package/dist/collection/components/vega-rich-text-editor/extensions/rte-extension-state-store.js +37 -0
  109. package/dist/collection/components/vega-rich-text-editor/extensions/tokens/token-toolbar-button-renderer.js +1 -1
  110. package/dist/collection/components/vega-rich-text-editor/public-api.js +1 -0
  111. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/toolbar-renderer.js +5 -3
  112. package/dist/collection/components/vega-rich-text-editor/vega-rich-text-editor.js +39 -1
  113. package/dist/collection/components/vega-rich-text-editor/vega-rich-text-link-editor/slimmers/renderers/vega-rich-text-link-editor-renderer.js +13 -4
  114. package/dist/collection/components/vega-selection-chip/vega-selection-chip-group/slimmers/renderers/vega-selection-chip-group-renderer.js +4 -1
  115. package/dist/collection/components/vega-selection-chip/vega-selection-chip-group/vega-selection-chip-group.js +34 -0
  116. package/dist/collection/components/vega-tab-group/slimmers/vega-tab-group/controllers/vega-tab-group-pages-controller.js +4 -2
  117. package/dist/collection/components/vega-tab-group/vega-tab-group.js +5 -4
  118. package/dist/collection/global/scripts/before-vega-load.js +2 -0
  119. package/dist/collection/helpers/slimmers/translation/translation-slimmer.js +16 -0
  120. package/dist/collection/helpers/translation/locales/en.js +4 -0
  121. package/dist/esm/{app-globals-081bbfd9.js → app-globals-a4134d21.js} +9 -7
  122. package/dist/esm/{code-block-17f596fc.js → code-block-9a17d89b.js} +2 -2
  123. package/dist/esm/{component-value-history-controller-slimmer.abstract-21e9126a.js → component-value-history-controller-slimmer.abstract-a64c3678.js} +3 -3
  124. package/dist/esm/{content-state-96741bb0.js → content-state-d59b4560.js} +3 -3
  125. package/dist/esm/{date-required-rule-d6ce832c.js → date-required-rule-cb960229.js} +1 -1
  126. package/dist/esm/{design-token-0a575bf2.js → design-token-f73ebce9.js} +3 -3
  127. package/dist/esm/{element-appender-slimmer-44bbb5c6.js → element-appender-slimmer-c62cf540.js} +2 -2
  128. package/dist/esm/{form-field-controller-slimmer-03894a51.js → form-field-controller-slimmer-514a3195.js} +1 -1
  129. package/dist/esm/{image-annotation-action-e8ab7b64.js → image-annotation-action-f4ea265c.js} +26 -3
  130. package/dist/esm/index.js +16 -17
  131. package/dist/esm/{inject-keyboard-manager-e5874185.js → inject-keyboard-manager-6522df5c.js} +1 -1
  132. package/dist/esm/{internal-translation-controller-84958bc9.js → internal-translation-controller-653bd7e3.js} +4 -0
  133. package/dist/esm/{keyboard-manager-404b9c17.js → keyboard-manager-9615fa9b.js} +1 -1
  134. package/dist/esm/{keyboard-manager-slimmer-c8fcfe60.js → keyboard-manager-slimmer-21bdc3a4.js} +1 -1
  135. package/dist/esm/link-extension-be164793.js +576 -0
  136. package/dist/esm/loader.js +11 -12
  137. package/dist/esm/{month-view-generator-d341fa5a.js → month-view-generator-1b7c9bb8.js} +1 -1
  138. package/dist/esm/{public-rules-09387dcf.js → public-rules-58f31834.js} +7 -7
  139. package/dist/esm/{range-47d9f95e.js → range-1c1c20fa.js} +1 -1
  140. package/dist/esm/{replace-selected-text-action-a217dc89.js → replace-selected-text-action-1abc5200.js} +1 -1
  141. package/dist/esm/{responsive-format-facade-51c0c2e1.js → responsive-format-facade-12697af2.js} +1 -1
  142. package/dist/esm/{rich-text-editor-required-rule-cca16fd0.js → rich-text-editor-required-rule-050d292b.js} +1 -1
  143. package/dist/esm/{split-cell-operation-ddde4106.js → split-cell-operation-8251d2a1.js} +3 -3
  144. package/dist/esm/{state-border-formatter-50394e9c.js → state-border-formatter-55cee24d.js} +1 -1
  145. package/dist/esm/{string-format-strategy.abstract-de17b899.js → string-format-strategy.abstract-14c1e874.js} +1 -1
  146. package/dist/esm/{string-input-formatter-slimmer-c3d483ef.js → string-input-formatter-slimmer-ec297247.js} +1 -1
  147. package/dist/esm/{string-mask-strategy-87efdb9e.js → string-mask-strategy-18760123.js} +2 -2
  148. package/dist/esm/{style-formatter-c20c1988.js → style-formatter-6073ae27.js} +2 -2
  149. package/dist/esm/{time-required-rule-026c17a1.js → time-required-rule-9b775d24.js} +1 -1
  150. package/dist/esm/{token-extension-76323d76.js → token-extension-6cb7dcb2.js} +58 -429
  151. package/dist/esm/{translation-slimmer-7f195ba8.js → translation-slimmer-d32eb861.js} +17 -1
  152. package/dist/esm/{type-guard-30eec79c.js → type-guard-fd1f4760.js} +1 -1
  153. package/dist/esm/{valid-credit-card-number-rule-1ac471e8.js → valid-credit-card-number-rule-dfd3e0a6.js} +1 -1
  154. package/dist/esm/vega-accordion.entry.js +6 -6
  155. package/dist/esm/vega-app-header-button.entry.js +5 -5
  156. package/dist/esm/vega-box.entry.js +6 -6
  157. package/dist/esm/vega-button-circle.entry.js +5 -5
  158. package/dist/esm/vega-button.entry.js +3 -3
  159. package/dist/esm/vega-calendar_4.entry.js +6 -6
  160. package/dist/esm/vega-card.entry.js +5 -5
  161. package/dist/esm/vega-carousel.entry.js +3 -3
  162. package/dist/esm/vega-checkbox_2.entry.js +14 -7
  163. package/dist/esm/vega-chip.entry.js +5 -5
  164. package/dist/esm/vega-code-block.entry.js +8 -8
  165. package/dist/esm/vega-color-picker.entry.js +2 -2
  166. package/dist/esm/vega-color-swatch-picker.entry.js +3 -3
  167. package/dist/esm/vega-color-swatch.entry.js +2 -2
  168. package/dist/esm/vega-combo-box.entry.js +8 -8
  169. package/dist/esm/vega-date-picker_2.entry.js +13 -13
  170. package/dist/esm/vega-dialog_2.entry.js +3 -3
  171. package/dist/esm/vega-divider.entry.js +5 -5
  172. package/dist/esm/vega-dropdown_5.entry.js +7 -7
  173. package/dist/esm/vega-env-manager-8f8dc473.js +2 -2
  174. package/dist/esm/vega-field-label.entry.js +3 -3
  175. package/dist/esm/vega-file-uploader.entry.js +3 -3
  176. package/dist/esm/vega-flag-icon.entry.js +5 -5
  177. package/dist/esm/vega-flex.entry.js +6 -6
  178. package/dist/esm/vega-font.entry.js +5 -5
  179. package/dist/esm/vega-form.entry.js +3 -3
  180. package/dist/esm/vega-grid.entry.js +5 -5
  181. package/dist/esm/vega-icon.entry.js +5 -5
  182. package/dist/esm/vega-image-uploader.entry.js +5 -5
  183. package/dist/esm/vega-input-credit-card.entry.js +17 -7
  184. package/dist/esm/vega-input-numeric.entry.js +5 -5
  185. package/dist/esm/vega-input-passcode.entry.js +5 -5
  186. package/dist/esm/vega-input-phone-number.entry.js +4 -4
  187. package/dist/esm/vega-input-range.entry.js +3 -3
  188. package/dist/esm/vega-input-select.entry.js +5 -5
  189. package/dist/esm/vega-input.entry.js +6 -6
  190. package/dist/esm/vega-left-nav_5.entry.js +7 -7
  191. package/dist/esm/vega-loader-wrapper_2.entry.js +3 -3
  192. package/dist/esm/vega-pagination-page-size-selector-mobile.entry.js +2 -2
  193. package/dist/esm/vega-pagination.entry.js +4 -4
  194. package/dist/esm/vega-popover_2.entry.js +8 -8
  195. package/dist/esm/vega-progress-tracker_2.entry.js +3 -3
  196. package/dist/esm/vega-radio_2.entry.js +17 -10
  197. package/dist/esm/vega-rich-text-content.entry.js +40 -8
  198. package/dist/esm/vega-rich-text-editor_4.entry.js +64 -21
  199. package/dist/esm/vega-rich-text-special-characters-panel.entry.js +5 -5
  200. package/dist/esm/vega-rich-text-table-properties_3.entry.js +8 -8
  201. package/dist/esm/vega-selection-chip_2.entry.js +18 -5
  202. package/dist/esm/vega-selection-tile_2.entry.js +2 -2
  203. package/dist/esm/vega-sidenav_3.entry.js +3 -3
  204. package/dist/esm/vega-signature-capture.entry.js +7 -7
  205. package/dist/esm/vega-stepper.entry.js +2 -2
  206. package/dist/esm/vega-tab-group_2.entry.js +8 -5
  207. package/dist/esm/vega-table_11.entry.js +4 -4
  208. package/dist/esm/vega-textarea.entry.js +2 -2
  209. package/dist/esm/vega-time-picker_2.entry.js +9 -9
  210. package/dist/esm/vega-toggle-switch.entry.js +2 -2
  211. package/dist/esm/vega-tooltip_2.entry.js +6 -6
  212. package/dist/esm/vega.js +11 -12
  213. package/dist/sri/vega-sri-manifest.json +302 -306
  214. package/dist/types/components/vega-checkbox/vega-checkbox-group/vega-checkbox-group.d.ts +10 -1
  215. package/dist/types/components/vega-input-credit-card/vega-input-credit-card.d.ts +10 -0
  216. package/dist/types/components/vega-radio/vega-radio-group/vega-radio-group.d.ts +10 -1
  217. package/dist/types/components/vega-rich-text-editor/dto/renderers/blocks/link-wrapper-renderer.d.ts +3 -1
  218. package/dist/types/components/vega-rich-text-editor/extensions/base-toolbar-button-renderer.d.ts +8 -5
  219. package/dist/types/components/vega-rich-text-editor/extensions/extension.abstract.d.ts +9 -0
  220. package/dist/types/components/vega-rich-text-editor/extensions/languages/language-toolbar-button-renderer.d.ts +16 -12
  221. package/dist/types/components/vega-rich-text-editor/extensions/link/link-extension.d.ts +27 -0
  222. package/dist/types/components/vega-rich-text-editor/extensions/link/type.d.ts +15 -0
  223. package/dist/types/components/vega-rich-text-editor/extensions/link/utils.d.ts +8 -0
  224. package/dist/types/components/vega-rich-text-editor/extensions/rte-extension-state-store.d.ts +30 -0
  225. package/dist/types/components/vega-rich-text-editor/public-api.d.ts +2 -0
  226. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/toolbar-renderer.d.ts +1 -1
  227. package/dist/types/components/vega-rich-text-editor/vega-rich-text-editor.d.ts +22 -0
  228. package/dist/types/components/vega-rich-text-editor/vega-rich-text-link-editor/slimmers/renderers/vega-rich-text-link-editor-renderer.d.ts +1 -0
  229. package/dist/types/components/vega-selection-chip/vega-selection-chip-group/slimmers/renderers/vega-selection-chip-group-renderer.d.ts +1 -0
  230. package/dist/types/components/vega-selection-chip/vega-selection-chip-group/vega-selection-chip-group.d.ts +10 -0
  231. package/dist/types/components/vega-tab-group/slimmers/vega-tab-group/controllers/vega-tab-group-pages-controller.d.ts +3 -2
  232. package/dist/types/components/vega-tab-group/vega-tab-group.d.ts +4 -3
  233. package/dist/types/components.d.ts +50 -2
  234. package/dist/types/helpers/slimmers/translation/translation-slimmer.d.ts +11 -0
  235. package/dist/types/helpers/translation/interface.d.ts +4 -0
  236. package/dist/vega/index.esm.js +1 -1
  237. package/dist/vega/p-02492864.entry.js +1 -0
  238. package/dist/vega/{p-df3a649c.entry.js → p-0278cd2b.entry.js} +1 -1
  239. package/dist/vega/{p-630cd479.js → p-0542b8ac.js} +1 -1
  240. package/dist/vega/p-0a1c7f80.js +1 -0
  241. package/dist/vega/{p-b9bd85d6.entry.js → p-0cc4a052.entry.js} +1 -1
  242. package/dist/vega/{p-976536c7.entry.js → p-1b4abd76.entry.js} +1 -1
  243. package/dist/vega/{p-efe6e4e6.entry.js → p-1ee185d9.entry.js} +1 -1
  244. package/dist/vega/{p-c3be0c29.entry.js → p-203f4ce9.entry.js} +1 -1
  245. package/dist/vega/p-2620a164.js +1 -0
  246. package/dist/vega/{p-2abdca42.js → p-277c306b.js} +1 -1
  247. package/dist/vega/{p-2c5352fe.entry.js → p-285e5e52.entry.js} +1 -1
  248. package/dist/vega/p-2c7e1bcb.js +1 -0
  249. package/dist/vega/{p-1ab4c08d.js → p-30487f0e.js} +1 -1
  250. package/dist/vega/{p-c016b230.entry.js → p-30a6b7aa.entry.js} +1 -1
  251. package/dist/vega/p-350d1b75.entry.js +1 -0
  252. package/dist/vega/{p-4c6baf92.entry.js → p-355ea330.entry.js} +1 -1
  253. package/dist/vega/{p-50e7020c.js → p-35d617d5.js} +1 -1
  254. package/dist/vega/{p-6c484462.entry.js → p-3755d8d3.entry.js} +1 -1
  255. package/dist/vega/{p-61536fcf.entry.js → p-3e956269.entry.js} +1 -1
  256. package/dist/vega/{p-fae4d64e.js → p-3ed6a602.js} +1 -1
  257. package/dist/vega/{p-a0705cd0.entry.js → p-4386625c.entry.js} +1 -1
  258. package/dist/vega/{p-b66d46ce.js → p-44f39eee.js} +1 -1
  259. package/dist/vega/{p-df71c830.entry.js → p-44f81987.entry.js} +1 -1
  260. package/dist/vega/{p-d93574dd.entry.js → p-456890f5.entry.js} +1 -1
  261. package/dist/vega/p-465590d1.entry.js +1 -0
  262. package/dist/vega/{p-f764b62e.entry.js → p-47ffdc0f.entry.js} +1 -1
  263. package/dist/vega/p-4fdd0a71.js +1 -0
  264. package/dist/vega/{p-9a562813.entry.js → p-54141828.entry.js} +1 -1
  265. package/dist/vega/{p-35e800ac.js → p-566ba295.js} +1 -1
  266. package/dist/vega/{p-baef217a.entry.js → p-581d89bb.entry.js} +1 -1
  267. package/dist/vega/p-5f048811.entry.js +1 -0
  268. package/dist/vega/p-5f377954.js +1 -1
  269. package/dist/vega/{p-8ce92f5f.entry.js → p-616d7096.entry.js} +1 -1
  270. package/dist/vega/{p-dbb02b32.entry.js → p-6528739f.entry.js} +1 -1
  271. package/dist/vega/{p-b3b22e36.entry.js → p-667c980d.entry.js} +1 -1
  272. package/dist/vega/{p-f597b65e.entry.js → p-6845ed5c.entry.js} +1 -1
  273. package/dist/vega/p-6cedb325.js +1 -0
  274. package/dist/vega/{p-78a6e741.entry.js → p-6d99a0b3.entry.js} +1 -1
  275. package/dist/vega/{p-43af604c.entry.js → p-6fec4d46.entry.js} +1 -1
  276. package/dist/vega/{p-337440ce.entry.js → p-716a393e.entry.js} +1 -1
  277. package/dist/vega/p-73ce8fef.js +1 -0
  278. package/dist/vega/p-788a7a5a.js +1 -0
  279. package/dist/vega/{p-ed0cc518.entry.js → p-7fe292af.entry.js} +1 -1
  280. package/dist/vega/{p-ad89f499.js → p-820ff54c.js} +1 -1
  281. package/dist/vega/p-82c133aa.js +1 -0
  282. package/dist/vega/{p-f7e8081e.js → p-844b7826.js} +1 -1
  283. package/dist/vega/{p-93cbc231.entry.js → p-850ea38b.entry.js} +1 -1
  284. package/dist/vega/p-85dcd07b.js +3 -0
  285. package/dist/vega/{p-3a49089e.js → p-881622fd.js} +1 -1
  286. package/dist/vega/{p-6a3ea3f0.entry.js → p-88c29aae.entry.js} +1 -1
  287. package/dist/vega/{p-a9b6ce74.js → p-8a054a13.js} +1 -1
  288. package/dist/vega/{p-bd5566e3.entry.js → p-8d9c4338.entry.js} +1 -1
  289. package/dist/vega/{p-26a54a73.entry.js → p-939c486f.entry.js} +1 -1
  290. package/dist/vega/{p-76454c9a.js → p-97e7da55.js} +1 -1
  291. package/dist/vega/{p-89d55444.entry.js → p-99545fd7.entry.js} +1 -1
  292. package/dist/vega/{p-157a2459.entry.js → p-99ea0fa0.entry.js} +1 -1
  293. package/dist/vega/{p-be6c1415.js → p-a809b33a.js} +1 -1
  294. package/dist/vega/{p-8865613a.entry.js → p-a9a70696.entry.js} +1 -1
  295. package/dist/vega/{p-9cb92fa3.entry.js → p-aae71499.entry.js} +1 -1
  296. package/dist/vega/{p-b2488adb.js → p-b0f55f5f.js} +1 -1
  297. package/dist/vega/{p-09deb867.entry.js → p-b5c08306.entry.js} +1 -1
  298. package/dist/vega/{p-c91e0a43.js → p-b7c90543.js} +1 -1
  299. package/dist/vega/{p-fc0ce3b5.entry.js → p-bcd3bd79.entry.js} +1 -1
  300. package/dist/vega/{p-8457b6b7.entry.js → p-bce9f489.entry.js} +1 -1
  301. package/dist/vega/{p-57b34bf9.entry.js → p-c0a6ed53.entry.js} +1 -1
  302. package/dist/vega/{p-48ea74b5.entry.js → p-c1c5bd2c.entry.js} +1 -1
  303. package/dist/vega/{p-f7cab150.entry.js → p-c5621f60.entry.js} +1 -1
  304. package/dist/vega/{p-94a064a3.js → p-c596bb49.js} +1 -1
  305. package/dist/vega/{p-dd529875.js → p-c9c42a07.js} +1 -1
  306. package/dist/vega/{p-d1cc3544.entry.js → p-d0e7c14b.entry.js} +1 -1
  307. package/dist/vega/{p-cdde6e64.entry.js → p-d6422004.entry.js} +1 -1
  308. package/dist/vega/{p-1e68e217.entry.js → p-d76cb9da.entry.js} +1 -1
  309. package/dist/vega/{p-c4bd6cf8.entry.js → p-d871e8eb.entry.js} +1 -1
  310. package/dist/vega/p-d905159c.entry.js +1 -0
  311. package/dist/vega/{p-285b161c.entry.js → p-dfda6e01.entry.js} +1 -1
  312. package/dist/vega/{p-3390bb20.js → p-e30a4f3e.js} +1 -1
  313. package/dist/vega/{p-059ba5f5.entry.js → p-e8c5a446.entry.js} +1 -1
  314. package/dist/vega/{p-091fbc35.js → p-eb927e2b.js} +1 -1
  315. package/dist/vega/{p-fbde6153.js → p-ecea4d24.js} +1 -1
  316. package/dist/vega/{p-44d2f9e7.entry.js → p-ed1dbc98.entry.js} +1 -1
  317. package/dist/vega/p-f0b99c3a.entry.js +1 -0
  318. package/dist/vega/{p-363e453b.js → p-f0d6e2f2.js} +1 -1
  319. package/dist/vega/{p-4b34df4c.entry.js → p-f251a907.entry.js} +1 -1
  320. package/dist/vega/{p-9a35a34f.entry.js → p-f5c8024e.entry.js} +1 -1
  321. package/dist/vega/{p-fa398acc.entry.js → p-f70cfac5.entry.js} +1 -1
  322. package/dist/vega/p-f830deb8.js +1 -0
  323. package/dist/vega/{p-2f2201d6.entry.js → p-f9ae396b.entry.js} +1 -1
  324. package/dist/vega/{p-e80e7cd9.entry.js → p-fd2a49be.entry.js} +1 -1
  325. package/dist/vega/{p-3ef9c69d.entry.js → p-fe573f85.entry.js} +1 -1
  326. package/dist/vega/vega.esm.js +1 -1
  327. package/package.json +1 -1
  328. package/dist/cjs/base-renderer-0a3b62b7.js +0 -9
  329. package/dist/cjs/dto-renderer-manager-7eb5c5ce.js +0 -98
  330. package/dist/esm/base-renderer-101f6d04.js +0 -7
  331. package/dist/esm/dto-renderer-manager-abc7eb5f.js +0 -96
  332. package/dist/vega/p-2e86aee5.js +0 -1
  333. package/dist/vega/p-3a5737fa.js +0 -1
  334. package/dist/vega/p-5f09aba8.js +0 -1
  335. package/dist/vega/p-5fd29f29.entry.js +0 -1
  336. package/dist/vega/p-66b2a285.entry.js +0 -1
  337. package/dist/vega/p-73508c24.js +0 -1
  338. package/dist/vega/p-7fbd11b0.js +0 -1
  339. package/dist/vega/p-894fb9c9.entry.js +0 -1
  340. package/dist/vega/p-89947a43.js +0 -1
  341. package/dist/vega/p-8a3d12e6.js +0 -1
  342. package/dist/vega/p-a18d280f.js +0 -3
  343. package/dist/vega/p-a7b5f497.js +0 -1
  344. package/dist/vega/p-b6c3ce6d.js +0 -1
  345. package/dist/vega/p-ca4773c3.entry.js +0 -1
  346. package/dist/vega/p-efe48ed5.entry.js +0 -1
  347. package/dist/vega/p-f7c6af07.js +0 -1
  348. package/dist/vega/p-ff24b342.entry.js +0 -1
@@ -1 +1 @@
1
- import{C as t}from"./p-2d0d575f.js";import{d as e}from"./p-526e3634.js";import{d as s,e as n}from"./p-3a93730e.js";import{d as r,c as i}from"./p-02841589.js";import{L as o}from"./p-6e1ab235.js";import{i as a}from"./p-b2488adb.js";import{T as c}from"./p-d884c644.js";import{g as l}from"./p-8b5d3a52.js";import{V as h}from"./p-3e09aeed.js";import{c as u}from"./p-a841cf13.js";import{f as d}from"./p-528748fa.js";var p,f;!function(t){t.SELECTION_RANGE="SELECTION_RANGE",t.CLEAR_FORMATTING="CLEAR_FORMATTING",t.LINK_GROUP="LINK_GROUP"}(p||(p={}));class g{}!function(t){t.ALIGNMENT="ALIGNMENT",t.TEXT_STYLE="TEXT_STYLE",t.INDENT="INDENT",t.LIST="LIST",t.INTERNAL_WRAPPER="INTERNAL_WRAPPER"}(f||(f={}));class x extends g{}const w=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.dtoName}};var A,O,y,m;!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"}(A||(A={}));class E{constructor(){this.isFlushable=!1}}function S(t){const e=t.getAttribute("style");return e?e.split(";").filter(Boolean).filter((t=>" "!==t)).map((t=>{const e=t.replace(/(['"])(.*?)\1/g,"$2").split(":");return{[r(e[0].trim())]:e[1].trim().replace(";","")}})).reduce(((t,e)=>Object.assign(Object.assign({},t),e)),{}):{}}class T{constructor(){this.classNameToBeAdded=""}filterAnnotations(t){const e=t.customStyle;return e?(this.extractAndDeleteMatchedStyles(e),0===Object.keys(e).length&&delete t.customStyle,t):t}filterAndDeleteStyles(t,e){const s=new Set(e);return this.extractAndDeleteMatchedStyles(t)&&this.classNameToBeAdded&&s.add(this.classNameToBeAdded),{styles:t,classNames:Array.from(s)}}refillStyles(t){this.classNameToBeAdded&&t.classList.remove(this.classNameToBeAdded);const e=S(t),s=Object.assign(Object.assign({},this.stylesToBeFiltered),e),n=Object.entries(Object.assign({},s)).map((([t,e])=>`${i(t)}: ${e};`)).join("");t.setAttribute("style",n)}canFilter(t){return!1}canRefill(t,e){return!1}toCssText(){return""}get alwaysFilter(){return!1}extractAndDeleteMatchedStyles(t){let e=!1;const s=this.stylesToBeFiltered;if(t&&s){const n=Object.keys(s);for(const r of n)t[r]===s[r]&&(delete t[r],e=!0)}return e}buildCssTextForStyles(t,e){return`${`.${T.RTE_CONTENT_CONTAINER_CLASS_NAME}`+(e?` .${e}`:` ${t}`)} { ${Object.entries(this.stylesToBeFiltered).map((([t,e])=>`${i(t)}: ${e};`)).join(" ")} }`}convertStylesMapToCssText(t){return Object.entries(t||this.stylesToBeFiltered).map((([t,e])=>`${i(t)}: ${e};`)).join(" ")}isBlockOrNodeStylesMatchFilterStyles(t,e){const s=t.getStyles({standalone:!0});return this.isMatchFilterStyles(s,e)}isMatchFilterStyles(t,e){return(e&&e.length>0?e:Object.keys(this.stylesToBeFiltered)).every((e=>t[e]===this.stylesToBeFiltered[e]))}}T.RTE_CONTENT_CONTAINER_CLASS_NAME="vega-rte-content",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"}(O||(O={}));class b extends g{}class N{static isTextBlock(t){return t===this.RTE_TEXT_BLOCK_CLASS_NAME}static isCodeBlock(t){return"RTECodeBlock"===t}static isListBlock(t){return"RTEListBlock"===t}static isListItemBlock(t){return"RTEListItemBlock"===t}static isTextNode(t){return t===this.RTE_TEXT_NODE_CLASS_NAME}static isLinkNode(t){return this.isTextNode(t.dtoName)&&!!t.getAnnotationByType(O.LINK)}static isCodeNode(t){if(this.isTextNode(t.dtoName)){const e=t.getAnnotationByType(O.CODE);return!!e&&e.code}return!1}static isImageNode(t){return"RTEImageNode"===t.dtoName}static isCodeBlockNode(t){return"RTECodeBlockNode"===t.dtoName}}N.RTE_TEXT_NODE_CLASS_NAME="RTETextNode",N.RTE_TEXT_BLOCK_CLASS_NAME="RTETextBlock";class C extends T{constructor(){super(...arguments),this.stylesToBeFiltered=v.getDefaultStyles(),this.elementTagName="a"}filterAnnotations(t){const e=t.link;return(null==e?void 0:e.customStyle)?(this.extractAndDeleteMatchedStyles(e.customStyle),0===Object.keys(e.customStyle).length&&delete e.customStyle,t):t}canFilter(t){return N.isLinkNode(t)}canRefill(t,e){return"RTETextNode"===t&&e.matches(this.elementTagName)}toCssText(){return this.buildCssTextForStyles(this.elementTagName,this.classNameToBeAdded)}filterLinkGroupInlineStyles(t){const e=t.style,s=t.class?t.class.split(" "):[],n=this.filterAndDeleteStyles(e,s);return n.styles&&Object.keys(n.styles).length>0&&(t.style=n.styles),n.classNames&&n.classNames.length>0&&(t.class=n.classNames.join(" ")),t.style&&0===Object.keys(t.style).length&&delete t.style,t}}class v extends g{constructor(t){super(),this.type=p.LINK_GROUP,this.linkGroups=new Map,this.linkGroups=new Map([[t,[]]])}static getDefaultStyles(){return{color:"rgba(var(--v-text-link, 19, 98, 226, 1))"}}clone(){const t=new v("");return this.linkGroups.forEach(((e,s)=>{t.linkGroups.set(s,e.map((t=>t.clone(t.parent))))})),t}toString(t,e){let s=this.toJsx(t,e);return(null==e?void 0:e.filterInlineStyles)&&(s=v.linkGroupFilterStylesStrategy.filterLinkGroupInlineStyles(s)),Object.entries(s).map((([t,e])=>{const s="string"==typeof e?e:this.formatStyleToString(e);return`${i(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&&Object.assign(s,v.getDefaultStyles()),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])=>`${i(t)}: ${e};`)).join(" ")}}v.linkGroupFilterStylesStrategy=new C;class R extends x{constructor(t){super(),this.type=f.ALIGNMENT,this.textAlign=t}static from(t){return[f.ALIGNMENT,new R(t)]}static getDefaultStyles(t){switch(t){case"right":case"center":case"justify":return{textAlign:t};case"left":default:return{textAlign:"left"}}}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 R(this.textAlign)}renderStyle(t){return(null==t?void 0:t.standalone)?R.getDefaultStyles(this.textAlign):null}}class j extends x{constructor(t){super(),this.type=f.INDENT,this.indent=Math.max(0,t)}static from(t){return[f.INDENT,new j(t)]}toJSON(){return this.indent>0?{indent:this.indent}:null}clone(){return new j(this.indent)}renderClass(){return null}renderStyle(){return this.indent>0?{marginLeft:16*this.indent+"px"}:null}}class _{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 E?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)))}}}_.registry=new Map;class k{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=_.get(t,e),n=()=>{const s=t instanceof E?t.type:t.constructor.name,n=k.get(s,e.constructor.name);if(n)return t.executedFlag=!0,n.execute(t,e);o.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!!k.get(t,e.constructor.name)}}k.registry=new Map,function(t){t.CUSTOM_ATTRIBUTE="CUSTOM_ATTRIBUTE",t.CUSTOM_CLASS="CUSTOM_CLASS",t.CUSTOM_STYLE="CUSTOM_STYLE"}(y||(y={}));class $ extends g{}class L extends ${constructor(t){super(),this.type=y.CUSTOM_ATTRIBUTE,this.BOOLEAN_ATTRS=new Set(["controls","disabled","checked","readonly","multiple","required","autoplay","muted"]),this.customAttribute=t}static from(t){return[y.CUSTOM_ATTRIBUTE,new L(t)]}toJSON(){return{customAttribute:this.customAttribute}}clone(){return new L(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(a)}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 ${constructor(t){super(),this.type=y.CUSTOM_CLASS,this.customClass=t}static from(t){return[y.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 I extends ${constructor(t){super(),this.type=y.CUSTOM_STYLE,this.customStyle=t}static from(t){return[y.CUSTOM_STYLE,new I(t)]}toJSON(){return{customStyle:this.customStyle}}clone(){return new I(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 D extends x{constructor(t){super(),this.type=f.INTERNAL_WRAPPER,this.internalWrapper=t}static from(t){return[f.INTERNAL_WRAPPER,new D(t)]}clone(){return new D(this.internalWrapper)}renderClass(){}renderStyle(){}toJSON(){return this.internalWrapper?{internalWrapper:this.internalWrapper}:void 0}}class M{constructor(t){this.dtoName=t instanceof J?"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])=>`${i(t)}: ${e};`)).join("")}toJSON(t={standalone:!1},e){const s=Array.from(this.annotationMap.values()).filter((t=>this.filterAnnotation(t)||t instanceof I)).map((e=>e.renderStyle(t))).filter(a);return e&&e.length>0?this.mergeAnnotationStyles(s,e):s.reduce(((t,e)=>Object.assign(Object.assign({},t),e)),{})}filterAnnotation(t){return"block"===this.dtoName?t instanceof x:t instanceof b}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}}class F{static register(t,e){var s;const n=null!==(s=this.registry.get(t))&&void 0!==s?s:new Set;n.add(e),this.registry.set(t,n)}static getStrategies(t){var e;return Array.from(null!==(e=this.registry.get(t))&&void 0!==e?e:[])}static executeTheStrategyFilterAction(t,e,s){return this.getStrategies(t.dtoName).filter((e=>e.canFilter(t))).reduce(((t,e)=>e.filterAndDeleteStyles(t.styles,t.classNames)),{styles:e,classNames:s})}static executeTheStrategyRefillAction(t,e){this.getStrategies(t).filter((s=>s.canRefill(t,e))).forEach((t=>{t.refillStyles(e)}))}static generateAllStylesContent(t=!1){const e=[];return t&&(e.push("/* Font-face imports begin */\n"),e.push(Object.keys(c).map((t=>`@import url('${c[t].url}');\n`)).join(" ")),e.push("/* Font-face imports end */\n")),this.registry.forEach((t=>{t.forEach((t=>{const s=t.toCssText();s&&!e.includes(s)&&e.push(s)}))})),e.join(" ")}}F.registry=new Map,function(t){t.TEXT="TEXT",t.IMAGE="IMAGE",t.CODE_BLOCK_NODE="CODE_BLOCK_NODE"}(m||(m={}));class H{constructor(t,e){this.annotationMap=new Map,this.dtoName=this.constructor.name,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 L.from(e);case"customClass":return B.from(e);case"customStyle":return I.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 M(this).toJSON(t,["textDecoration"])}getClasses(t={standalone:!1}){return Array.from(this.annotationMap.values()).filter((t=>t instanceof b||t instanceof B)).map((e=>e.renderClass(t))).filter(a).reduce(((t,e)=>[t,e].join(" ").trim()),"")}getCustomAttributesAnnotation(){return this.annotationMap.get(y.CUSTOM_ATTRIBUTE)}isTextNode(){return!1}getElementRef(){return w.getDOMByEntity(this)}generateAttributeString(t,...e){var s;const n=new M(this),r=n.toJSON({standalone:!0},["textDecoration"]),i=this.annotationMap.get(y.CUSTOM_CLASS);let o=r,c=null==i?void 0:i.renderClass();if(t&&t.filterInlineStyles){const t=F.executeTheStrategyFilterAction(this,r,c);o=t.styles,c=t.classNames}const l=[...(null===(s=this.getCustomAttributesAnnotation())||void 0===s?void 0:s.toString(e))||[],c&&c.length>0?`class="${c.join(" ")}"`:null,o&&Object.keys(o).length>0?`style="${n.toCssText({standalone:!0},void 0,o)}"`:null,...e].filter(a);return l.length?` ${l.join(" ")}`:""}doApply(t){t instanceof E?this.doModifyActionApply(t):this.doAnnotationActionApply(t)}flushChange(){const n=w.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 P=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 J)this.RTE_BLOCK_DTO_CLASS_MAP.set(t,e);else{if(!(e.prototype instanceof H))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 J{constructor(t){this.annotationMap=new Map,this.dtoName=this.constructor.name,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=P.getRTEBlockClass(t.type);if(n){const r=n.from(t,e);return r.parent=s,r}})).filter(a)}static createAnnotationEntity(t,e){switch(t){case"textAlign":return R.from(e);case"indent":return j.from(e);case"customAttribute":return L.from(e);case"customClass":return B.from(e);case"customStyle":return I.from(e);case"internalWrapper":return D.from(e)}}static convertAnnotationsToMap(t,e){Object.entries(e).forEach((([e,s])=>{const n=this.createAnnotationEntity(e,s);a(n)&&t.set(...n)}))}shouldRenderAsInternalWrapper(){const t=this.getAnnotationByType(f.INTERNAL_WRAPPER);return!!t&&t.internalWrapper&&0===Array.from(this.annotationMap.values()).filter((t=>!(t instanceof v||t instanceof D))).length}toJSON(){const t=Array.from(this.annotationMap.values()).filter((t=>t instanceof x||t instanceof $)).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=w.getDOMByEntity(this);if(n){const r=e.getSubjectFromParentNodeByEventId(n,s);r&&t.notify(r,{})}}}getFirstNode(){if(!this.children||!this.children[0])return null;const t=this.children[0];return t instanceof J?t.getFirstNode():t}isListItemBlock(){return"list-item"===this.type}getStyles(t={standalone:!1}){const e=new M(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 x||t instanceof B)).map((e=>e.renderClass(t))).filter(a).reduce(((t,e)=>[t,e].join(" ").trim()),"")}getCustomAttributesAnnotation(){return this.annotationMap.get(y.CUSTOM_ATTRIBUTE)}generateAttributeString(t,...e){var s;const n=new M(this),r=n.toJSON({standalone:!0}),i=this.annotationMap.get(y.CUSTOM_CLASS);let o=r,c=null==i?void 0:i.renderClass();if(t&&t.filterInlineStyles){const t=F.executeTheStrategyFilterAction(this,r,c);o=t.styles,c=t.classNames}const l=[...(null===(s=this.getCustomAttributesAnnotation())||void 0===s?void 0:s.toString(e))||[],c&&c.length>0?`class="${c.join(" ")}"`:null,o&&Object.keys(o).length>0?`style="${n.toCssText({standalone:!0},void 0,o)}"`:null,...e].filter(a);return l.length?` ${l.join(" ")}`:""}doApply(t){t instanceof E?k.executeTheStrategy(t,this):this.applyAnnotationAction(t)}applyAnnotationAction(t){const e=t.toAnnotation();if(e instanceof v||this.annotationMap.set(e.type,e),"function"==typeof this.doAnnotationActionApply)this.doAnnotationActionApply(t);else{const e=k.get(t.constructor.name,this.constructor.name);e&&e.execute(t,this)}}cloneAnnotations(){return new Map(Array.from(this.annotationMap.entries()).map((([t,e])=>[t,e.clone()])))}}class K{}class U extends K{constructor(){super(...arguments),this.doSplit=!0}}class W extends g{constructor(t){super(),this.type=p.SELECTION_RANGE,this.range=t}clone(){return new W(this.range)}}const G="700",z="bold",V="italic",X="underline",q="line-through";class Y extends b{constructor(t){super(),this.type=O.STRIKETHROUGH,this.strikethrough=t}static from(t){return[O.STRIKETHROUGH,new Y(t)]}toJSON(){return{strikethrough:this.strikethrough}}clone(){return new Y(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 Q extends b{constructor(t){super(),this.type=O.UNDERLINE,this.underline=t}static from(t){return[O.UNDERLINE,new Q(t)]}toJSON(){return{underline:this.underline}}clone(){return new Q(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 Z extends b{constructor(t){super(),this.type=O.ITALIC,this.italic=t}static from(t){return[O.ITALIC,new Z(t)]}toJSON(){return{italic:this.italic}}clone(){return new Z(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 tt extends b{constructor(t){super(),this.type=O.BOLD,this.bold=t}static from(t){return[O.BOLD,new tt(t)]}toJSON(){return{bold:this.bold}}clone(){return new tt(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 et extends b{constructor(t,e=!0){super(),this.type=O.CODE,this.code=t,this.useInternalStyle=e}static from(t,e){return[O.CODE,new et(t,e)]}static getDefaultStyles(){return{fontFamily:"Roboto Mono",whiteSpace:"pre-wrap"}}toJSON(){return{code:this.code}}clone(){return new et(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?et.getDefaultStyles():null}}const st={key:"black",light:"#111128",dark:"#E3E3E8"},nt=[st,{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"}],rt="​",it=[{key:"title"},{key:"subtitle"},{key:"heading-1"},{key:"heading-2"},{key:"heading-3"},{key:"paragraph"}],ot=[["textStyles"],["bold","italic","underline","strikethrough","code"],["textColor"],["horizontalAlignment","bulletsNumbers"],["moreIndent","lessIndent"],["link"],["image"],["clearStyle"]],at=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);class ct extends b{constructor(t){super(),this.type=O.TEXT_COLOR,this.textColor=this.formatTextColor(t)}static from(t){return[O.TEXT_COLOR,new ct(t)]}toJSON(){return{textColor:this.textColor.key}}clone(){return new ct(this.textColor.key)}renderClass(){return null}renderStyle(){return{color:h.isDarkMode()?this.textColor.dark:this.textColor.light}}formatTextColor(t){return nt.find((e=>e.key===t))||nt[0]}}class lt extends b{constructor(t,e=!0){super(),this.type=O.LINK,this.link=t,this.useInternalStyle=e}static from(t,e=!0){return[O.LINK,new lt(t,e)]}toJSON(){return{link:this.link}}clone(){return new lt(this.link,this.useInternalStyle)}toEqual(t){return this.link.groupKey===t.link.groupKey}renderClass(){return null}renderStyle(){return null}}class ht extends K{constructor(t,e,s){super(),this.isFlushable=!1,this.groupKey=t,this.nodes=e,this.type=s}toAnnotation(){return new v(this.groupKey)}}class ut extends K{constructor(){super(),this.isFlushable=!1}toAnnotation(){return null}}class dt{execute(t,e){return o.log(`Executing action ${t.constructor.name} on ${e.constructor.name} ${e.id}`),this.handleAction(t,e)}updateCustomStyleAnnotation(t,e){const s=t.annotationMap.get(y.CUSTOM_STYLE);s&&this.isCustomStyle(s,e)&&t.annotationMap.set(s.type,new I(s.removeStyles(e)))}createNewParagraph(t){const e=P.getRTEBlockClass("paragraph");if(e)return e.from({id:l(),type:"paragraph",nodes:[{id:l(),type:"text",text:t}]})}getRootContent(t){const e=t.parent;if(e)return"VegaRTEContent"===e.dtoName?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)}getDOMByEntity(t){return w.getDOMByEntity(t)}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 pt extends E{constructor(t){super(),this.type=A.LINK_GROUP_NODE_SPLIT,this.splittedTextNodes=t}}class ft extends dt{constructor(){super(...arguments),this.applyTargetNode=null}handleAction(t,e){const s=e.getAnnotationByType(p.SELECTION_RANGE);if(this.setApplyTargetNode(null),t instanceof U&&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 pt(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,a=(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)]},c=i&&w.getEntityByDOM(i),l=o&&w.getEntityByDOM(o);if(c&&c.id===e.id){const i=s===n?t.endOffset:e.text.length,[o,c,l]=a(e.text,r,i);return this.setApplyTargetNode(c),[o,c,l].filter((t=>!!t.text))}if(l&&l.id===e.id){const[s,n,r]=a(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 gt extends U{constructor(t){super(),this.isFlushable=!0,this.bold=t}toAnnotation(){return new tt(this.bold)}}class xt extends g{constructor(){super(...arguments),this.type=p.CLEAR_FORMATTING,this.items=[O.BOLD,O.ITALIC,O.UNDERLINE,O.STRIKETHROUGH,O.TEXT_COLOR,O.CODE,y.CUSTOM_STYLE]}}class wt extends U{constructor(){super(...arguments),this.isFlushable=!0}toAnnotation(){return new xt}}class At extends U{constructor(t){super(),this.isFlushable=!0,this.code=t}toAnnotation(){return new et(this.code)}}class Ot extends K{constructor(t){super(),this.isFlushable=!0,this.annotationType=t}toAnnotation(){}}class yt extends U{constructor(t){super(),this.isFlushable=!0,this.italic=t}toAnnotation(){return new Z(this.italic)}}class mt extends U{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,a(n)&&(this.doSplit=n)}toAnnotation(){return new lt(this.link)}}class Et extends U{constructor(t){super(),this.isFlushable=!0,this.strikethrough=t}toAnnotation(){return new Y(this.strikethrough)}}class St extends U{constructor(t){super(),this.isFlushable=!0,this.underline=t}toAnnotation(){return new Q(this.underline)}}class Tt extends dt{handleAction(t,e){const s=t.toAnnotation();if(t instanceof Ot)e.annotationMap.delete(t.annotationType);else{if(!(s instanceof xt))return s instanceof b||s instanceof W?(t instanceof mt&&(a(t.newText)&&(e.text=t.newText),e.parent.apply(new ht(t.link.groupKey,[e],t.type))),t instanceof At&&this.handleAction(new wt,e),t instanceof gt&&this.updateCustomStyleAnnotation(e,["fontWeight"]),t instanceof yt&&this.updateCustomStyleAnnotation(e,["fontStyle"]),(t instanceof St||t instanceof Et)&&this.updateCustomStyleAnnotation(e,["textDecoration"]),void e.annotationMap.set(s.type,s)):void 0;s.items.forEach((t=>{e.deleteAnnotationByType(t)}))}}}class bt extends E{constructor(){super(...arguments),this.type=A.DELETE_LINK_GROUP}}class Nt extends dt{handleAction(t,e){e.text=t.newTextContent,!e.text&&e.annotationMap.has("LINK")&&e.apply(new bt)}}class Ct extends E{constructor(t){super(),this.type=A.UPDATE_TEXT,this.newTextContent="",this.newTextContent=t}}class vt extends dt{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 a=s.text;if(n===r&&i===o&&t)a=s.text.slice(0,i)+t+s.text.slice(i);else{const e=n.parentElement,c=r.parentElement,l=e&&w.getEntityByDOM(e),h=c&&w.getEntityByDOM(c);let u=0,d=s.text.length;l&&l===s?(u=i,d=n===r?o:d):h&&h===s&&(d=o),a=s.text.slice(0,u)+t+s.text.slice(d)}s.apply(new Ct(a))}}}class Rt extends g{constructor(t){super(),this.type=O.INLINE_HTML,this.htmlTag=t}static from(t){const{htmlTag:e,child:s,customStyle:n,customClass:r,customAttribute:i}=t,o=new Rt(e);return o.groupId=t.groupId,o.child=s?Rt.from(s)[1]:void 0,o.customAttribute=i?L.from(i)[1]:void 0,o.customClass=r?B.from(r)[1]:void 0,o.customStyle=n?I.from(n)[1]:void 0,[O.INLINE_HTML,o]}clone(){var t,e,s,n;const r=new Rt(this.htmlTag);return r.groupId=this.groupId,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}renderProps(){var t,e,s;return Object.assign(Object.assign({},null===(t=this.customAttribute)||void 0===t?void 0:t.render()),{style:null===(e=this.customStyle)||void 0===e?void 0:e.renderStyle(),class:null===(s=this.customClass)||void 0===s?void 0:s.renderClass().join(" ")})}toJSON(){var t,e,s,n;return{inlineHtml:u({htmlTag:this.htmlTag,groupId:this.groupId,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 jt extends dt{handleAction(t,e){const s=e.parent.getAnnotationByType(p.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 _t extends dt{handleAction(t,e){const s=e.parent.getAnnotationByType(p.LINK_GROUP);if(s){const t=e.annotationMap.get(O.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(p.LINK_GROUP)}}e.annotationMap.delete(O.LINK)}}class kt extends b{constructor(t){super(),this.type=O.PLAIN_TEXT,this.plainText=!0,this.plainText=t}static from(t){return[O.PLAIN_TEXT,new kt(t)]}clone(){return new kt(this.plainText)}renderClass(){}renderStyle(){}toJSON(){return this.plainText?{plainText:this.plainText}:void 0}}class $t extends U{constructor(t){super(),this.isFlushable=!0,this.textColor=t}toAnnotation(){return new ct(this.textColor)}}class Lt extends H{constructor(t,e,s,n){super(t,n),this.dtoName=Lt.dtoName,this.type=m.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 Lt(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 ht(t.link.groupKey,[n],"link")),this.createAnnotationEntity(r,t[r],e)))).filter(a))}static createAnnotationEntity(t,e,s){const n=!(!s||!s.autoMatchFormat);switch(t){case"bold":return tt.from(e);case"italic":return Z.from(e);case"underline":return Q.from(e);case"strikethrough":return Y.from(e);case"code":return et.from(e,n);case"textColor":return ct.from(e);case"link":return lt.from(e,n);case"inlineHtml":return Rt.from(e);case"plainText":return kt.from(e)}return H.createAnnotationEntity(t,e)}toJSON(){const t=Array.from(this.annotationMap.values()).filter((t=>t instanceof b||t instanceof $||t instanceof Rt)).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(t){const e=this.getAnnotationByType(O.INLINE_HTML);return e?this.renderWithWrapperStr(e,t):this.renderTextStr(t)}cloneWithText(t){return new Lt(l(),t,this.parent,super.cloneAnnotations())}clone(t){return new Lt(this.id,this.text,t,super.cloneAnnotations())}isEmpty(){return!(this.getAnnotationByType(O.INLINE_HTML)||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}getInlineHtmlTagAtDepth(t){const e=this.getInlineHtmlAnnotationAtDepth(t);return e?at.has(e.htmlTag)?null:{htmlTag:e.htmlTag,attrStr:this.annotationAttrStr(e),groupId:e.groupId,annotation:e}:null}renderHtmlFromDepth(t,e){if(0===t)return this.toHtml(e);const s=this.getInlineHtmlAnnotationAtDepth(t);return s?this.renderWithWrapperStr(s,e):this.renderTextStr(e)}getInlineHtmlAnnotationAtDepth(t){let e=this.getAnnotationByType(O.INLINE_HTML);for(let s=0;s<t&&e;s++)e=e.child;return e}registerModifyStrategy(){const t=this.constructor.name;Lt.registerActionStrategyStatus[t]||(this.isContentEditable()&&(k.register(A.UPDATE_TEXT,t,new Nt),k.register(A.REPLACE_SELECTED_TEXT,t,new vt),k.register(A.LINK_GROUP_NODE_SPLIT,t,new jt),k.register(mt.name,t,new Tt)),k.register(U.name,t,new ft),k.register(A.DELETE_LINK_GROUP,t,new _t),k.register(gt.name,t,new Tt),k.register(wt.name,t,new Tt),k.register(yt.name,t,new Tt),k.register(St.name,t,new Tt),k.register($t.name,t,new Tt),k.register(Et.name,t,new Tt),k.register(At.name,t,new Tt),k.register(K.name,t,new Tt),Lt.registerActionStrategyStatus[t]=!0)}doAnnotationActionApply(t){const e=this.getAnnotationByType(p.SELECTION_RANGE);if(t instanceof U&&t.doSplit&&e){const e=k.get(U.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){k.executeTheStrategy(t,this)}applyActionToNode(t,e){const s=e.toAnnotation();if(e instanceof ut)return void this.syncUpSelectedNodes(t);s instanceof W||this.syncUpSelectedNodes(t);const n=k.get(e.constructor.name,t.constructor.name);if(n)return void n.execute(e,t);const r=k.get(K.name,Lt.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,e){const{htmlTag:s,child:n}=t,r=this.annotationAttrStr(t);return n?`<${s}${r}>${this.renderWithWrapperStr(n,e)}</${s}>`:at.has(s)?`<${s}${r}>`:this.text?`<${s}${r}>${this.renderTextStr(e)}</${s}>`:`<${s}${r}></${s}>`}annotationAttrStr(t){const{customAttribute:e,customClass:s,customStyle:n}=t,r=[...(null==e?void 0:e.toString())||[],null==s?void 0:s.toString(),null==n?void 0:n.toString()].filter(a);return r.length>0?` ${r.join(" ")}`:""}renderTextStr(t){var e;const s=(null===(e=this.getAnnotationByType(O.CODE))||void 0===e?void 0:e.code)?"code":"span",n=super.generateAttributeString(t);return"\n"===this.text?"<br>":this.shouldRenderAsPlainText()?this.text:`<${s}${n}>${this.text}</${s}>`}shouldRenderAsPlainText(){const t=super.getAnnotationByType(O.PLAIN_TEXT);return!!t&&t.plainText&&0===Array.from(this.annotationMap.values()).filter((t=>t instanceof b&&!(t instanceof lt)&&!(t instanceof kt)||t instanceof $)).length}}Lt.registerActionStrategyStatus={},Lt.htmlTag="span",Lt.dtoName="RTETextNode";class Bt extends E{constructor(t){super(),this.type=A.APPEND_CHILDREN,this.entityToBeAppended=t}}const It={fontFamily:"Inter",fontSize:"16px",lineHeight:"22px",minHeight:"22px",fontWeight:"500"},Dt=Object.assign(Object.assign({},It),{marginTop:"0px",marginBottom:"0px"}),Mt={paragraph:Dt,title:Object.assign(Object.assign({},It),{fontSize:"36px",lineHeight:"40px",minHeight:"40px"}),subtitle:Object.assign(Object.assign({},It),{fontSize:"28px",lineHeight:"32px",minHeight:"32px"}),"heading-1":Object.assign(Object.assign({},Dt),{fontSize:"22px",lineHeight:"24px",minHeight:"24px"}),"heading-2":Object.assign(Object.assign({},Dt),{fontSize:"20px",lineHeight:"24px",minHeight:"24px"}),"heading-3":Object.assign(Object.assign({},Dt),{fontSize:"18px"}),"heading-4":Object.assign({},Dt),"heading-5":Object.assign(Object.assign({},Dt),{fontSize:"14px"}),"heading-6":Object.assign(Object.assign({},Dt),{fontSize:"12px"})};class Ft extends x{constructor(t){super(),this.type=f.TEXT_STYLE,this.textStyle=t}static from(t){return[f.TEXT_STYLE,new Ft(t)]}static getDefaultStyles(t){return t?Mt[t]:null}toJSON(){return{textStyle:this.textStyle}}clone(){return new Ft(this.textStyle)}renderClass(t){return(null==t?void 0:t.standalone)?null:this.textStyle?`v-rte--text-style-${this.textStyle}`:null}renderStyle(t){return(null==t?void 0:t.standalone)&&this.textStyle?Ft.getDefaultStyles(this.textStyle):null}}class Ht extends K{constructor(t,e){super(),this.isFlushable=!0,this.textStyle=t,this.bold=e}toAnnotation(){return new Ft(this.textStyle)}}class Pt extends dt{handleAction(t,e){"list-item"!==e.type&&(e.type=t.textStyle),e.children.forEach(t.bold?t=>{const e=new gt(!0);e.doSplit=!1,t.apply(e)}:t=>{t.apply(new Ot(O.BOLD))}),this.updateCustomStyleAnnotation(e,["fontFamily","lineHeight","fontWeight","fontSize"])}}class Jt extends E{constructor(t,...e){super(),this.type=A.INSERT_CHILDREN_AFTER,this.referChildren=t,this.childrenToBeInserted=e}}class Kt extends E{constructor(t){super(),this.type=A.REPLACE_CHILD_NODES,this.newChildNodes=t}}class Ut extends dt{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 Kt(e));const a=s.cloneWithNodes(o);return s.parent.apply(new Jt(s,a)),a}}}}class Wt extends dt{handleAction(t,e){e.children=[],e.apply(new Bt(t.newChildNodes))}}class Gt extends E{constructor(t){super(),this.type=A.DELETE_CHILDREN,this.entityToBeRemoved=t}}class zt extends dt{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 Bt(t)),s.parent.apply(new Gt(s))}}}class Vt extends dt{handleAction(t,e){t.lineBreakNode=this.lineBreakSingleBlock(t.startContainerNode,t.startOffset,e)}lineBreakSingleBlock(t,e,s){if(t){const n=new Lt(l(),"\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),a=s.children.slice(o+1);r&&e.push(t.cloneWithText(r)),i&&a.unshift(t.cloneWithText(i)),this.mergeLineBreakNodes(e,n,a,s)}return n}}mergeLineBreakNodes(t,e,s,n){(0===s.length||s[0]&&""===s[0].text)&&s.push(new Lt(l(),"\n",n,t[t.length-1]&&t[t.length-1].annotationMap)),n.apply(new Kt([...t,e,...s]))}}class Xt extends dt{handleAction(t,e){t.lineBreakNode=this.lineBreakMultipleBlocks(t.selectedBlocks,e)}lineBreakMultipleBlocks(t,e){const s=e.children,n=new Lt(l(),"\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 Gt(t)))})),e}mergeLineBreakNodes(t,e,s,n){(0===s.length||s[0]&&""===s[0].text)&&s.push(new Lt(l(),"\n",n,t[t.length-1]&&t[t.length-1].annotationMap)),n.apply(new Kt([...t,e,...s]))}}class qt extends E{constructor(t,...e){super(),this.type=A.INSERT_CHILDREN_BEFORE,this.referChildren=t,this.childrenToBeInserted=e}}class Yt extends E{constructor(t,e){super(),this.type=A.SPLIT_BLOCK_WITH_NODE,this.splitPointNode=t,this.startOffsetOfNode=e}}class Qt extends K{constructor(t){super(),this.isFlushable=!0,this.textAlign=t}toAnnotation(){return new R(this.textAlign)}}class Zt extends dt{handleAction(t,e){this.updateCustomStyleAnnotation(e,["textAlign"])}}class te extends K{constructor(t){super(),this.isFlushable=!0,this.indent=t}toAnnotation(){return new j(this.indent)}}class ee extends J{constructor(t,e,s){super(t),this.dtoName=ee.dtoName,this.children=[],this.type=e;const{autoMatchFormat:n}=s||{autoMatchFormat:!0};n&&(this.annotationMap=ee.isAcceptableTextStyle(e)?new Map([Ft.from(e)]):new Map([Ft.from("paragraph")]))}static from(t,e={autoMatchFormat:!0}){var s,n;const r=new ee(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=P.getRTENodeClass(t.type);if(s)return s.from(t,r,e)})).filter(a),i&&super.convertAnnotationsToMap(r.annotationMap,i),r}static createAnnotationEntity(t,e){return"textStyle"===t?Ft.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 mt&&t.needMergeNode){const t=null==n?void 0:n.getAnnotationByType(O.LINK),r=s.getAnnotationByType(O.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(t){const e=this.getBlockTag(),s=super.generateAttributeString(t),n=this.getChildrenHtml(t);return super.shouldRenderAsInternalWrapper()?n:[`<${e}${s}>`,n,`</${e}>`].join("")}cloneWithNodes(t){const e=new ee(l(),this.type);return e.annotationMap=super.cloneAnnotations(),e.apply(new Bt(t)),e}clone(t){const e=new ee(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(t){const e=this.getAnnotationByType(p.LINK_GROUP);let s=this.renderGroupedNodesAtDepth(this.children,0,t);return e&&this.children.length>0&&(s=this.generateLinkHtml(e,s,t)),s}doAnnotationActionApply(t){const e=k.get(t.constructor.name,ee.name);e&&e.execute(t,this)}renderGroupedNodesAtDepth(t,e,s){var n;let r="",i=0;for(;i<t.length;){const o=t[i].getInlineHtmlTagAtDepth(e);if(!(null==o?void 0:o.groupId)){r+=t[i].renderHtmlFromDepth(e,s),i++;continue}let a=i+1;for(;a<t.length&&(null===(n=t[a].getInlineHtmlTagAtDepth(e))||void 0===n?void 0:n.groupId)===o.groupId;)a++;if(a===i+1)r+=t[i].renderHtmlFromDepth(e,s);else{const n=this.renderGroupedNodesAtDepth(t.slice(i,a),e+1,s);r+=`<${o.htmlTag}${o.attrStr}>${n}</${o.htmlTag}>`}i=a}return r}generateLinkHtml(t,e,s){e="";let n=[];for(let r=0;r<this.children.length;r++){const i=this.children[r].getAnnotationByType(O.LINK),o=this.children[r+1]?this.children[r+1].getAnnotationByType(O.LINK):null;if(i){if(n.push(this.children[r]),!o||i.link.groupKey!==o.link.groupKey){const r=t.toString(i,{standalone:!0,filterInlineStyles:null==s?void 0:s.filterInlineStyles});e+=[`<a${r?` ${r}`:""}>`,this.renderGroupedNodesAtDepth(n,0,s),"</a>"].join(""),n=[]}}else e+=this.children[r].toHtml(s)}return e}}k.register(Ht.name,ee.name,new Pt),k.register(Qt.name,ee.name,new Zt),k.register(te.name,ee.name,new class extends dt{handleAction(t,e){this.updateCustomStyleAnnotation(e,["marginLeft"])}}),k.register(ht.name,ee.name,new class extends dt{handleAction(t,e){let s=e.getAnnotationByType(p.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(p.LINK_GROUP,s)}}}),k.register(A.UNLINK_LINK_GROUP,ee.name,new class extends dt{handleAction(t,e){const s=e.getAnnotationByType(p.LINK_GROUP);s&&(s.linkGroups.size>1?s.linkGroups.delete(t.groupKey):e.annotationMap.delete(p.LINK_GROUP))}}),k.register(A.SPLIT_BLOCK_WITH_NODE,ee.name,new Ut),k.register(A.REPLACE_CHILD_NODES,ee.name,new Wt),k.register(A.MERGE_TWO_BLOCKS_NODES,ee.name,new zt),k.register(A.LINE_BREAK_SINGLE_BLOCK,ee.name,new Vt),k.register(A.LINE_BREAK_MULTIPLE_BLOCKS,ee.name,new Xt),k.register(A.INSERT_IMAGE_TO_BLOCK,ee.name,new class extends dt{handleAction(t,e){const s=t.splitPointNode,n=t.startOffsetOfNode,r=t.imageBlockToBeInserted;if(this.isCaretPositionAtBlockEnd(e,s,n))e.parent.apply(new Jt(e,r));else if(this.isCaretPositionAtBlockStart(e,s,n))e.parent.apply(new qt(e,r));else{const t=new Yt(s,n);e.apply(t),e.parent.apply(new Jt(e,r))}}}),k.register(A.TRANSFORM_LIST_BLOCK,ee.name,new class extends dt{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 Bt(i)),s.apply(new Jt(t.selectedBlocks[0],n)),r.forEach((t=>{t.parent.apply(new Gt(t))}))}}),ee.dtoName="RTETextBlock";class se extends dt{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.dtoName}}class ne extends E{constructor(t,e){super(),this.isFlushable=!0,this.type=A.UPDATE_CODE_BLOCK,this.content=t,this.language=e}}class re extends K{constructor(t){super(),this.isFlushable=!1,this.range=t}toAnnotation(){return new W(this.range)}}class ie extends H{constructor(){super(...arguments),this.type="decorator-node",this.isSelected=!1}static isDecoratorNodeContainerElement(t){return t&&t.classList.contains(ie.DECORATOR_CONTAINER_CLASS)}static getDecoratorNodeElement(t){return t.querySelector(`.${ie.DECORATOR_NODE_CLASS}`)}getRangeEndOffset(){return 1}getRangeContainer(){const t=this.getElementRef();if(t)return d(t,`.${ie.DECORATOR_CONTAINER_CLASS}`)}isContentEditable(){return!1}}ie.DECORATOR_CONTAINER_CLASS="v-internal-decorator-container",ie.DECORATOR_NODE_CLASS="v-internal-decorator-node";class oe extends T{constructor(){super(...arguments),this.stylesToBeFiltered=oe.STYLES,this.elementTagName="pre code"}canFilter(t){return N.isCodeBlockNode(t)}canRefill(t,e){return!1}toCssText(){return this.buildCssTextForStyles(this.elementTagName,this.classNameToBeAdded)}}oe.STYLES={boxSizing:"border-box",color:"rgba(var(--v-text-primary, 32, 54, 69, 1))",textAlign:"left",fontFamily:'"Roboto Mono"',fontWeight:"400",lineHeight:"22px",fontSize:"16px",whiteSpace:"pre-wrap",minHeight:"22px",tabSize:"2px"};class ae extends ie{constructor(t,e,s,n){super(t),this.dtoName=ae.dtoName,this.type=m.CODE_BLOCK_NODE,this.text="",this.annotationMap=new Map,this.text=e,this.parent=n,this.language=s,this.annotationMap.set(y.CUSTOM_STYLE,new I(oe.STYLES))}toJSON(){return{id:this.id,type:"text",text:this.text,language:this.language}}toHtml(t){return`<code${this.generateAttributeString(t)}>${this.text}</code>`}clone(t){return new ae(this.id,this.text,this.language,t)}doAnnotationActionApply(t){k.executeTheStrategy(t,this)}doModifyActionApply(t){k.executeTheStrategy(t,this)}}k.register(A.UPDATE_CODE_BLOCK,ae.name,new class extends dt{handleAction(t,e){const{content:s,language:n}=t;e.language=n,e.text=s}}),k.register(re.name,ae.name,new class extends dt{handleAction(t,e){e.annotationMap.set(p.SELECTION_RANGE,t.toAnnotation())}}),ae.dtoName="RTECodeBlockNode";var ce;!function(t){t.CSS="css",t.HTML="html",t.JavaScript="js",t.JSX="jsx",t["Plain Text"]="plainText",t.TypeScript="ts",t.TSX="tsx"}(ce||(ce={}));class le extends dt{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 Gt(e)))}}class he extends T{constructor(){super(...arguments),this.stylesToBeFiltered=he.STYLES,this.elementTagName="pre"}canFilter(t){return N.isCodeBlock(t.dtoName)}canRefill(t,e){return!1}toCssText(){return this.buildCssTextForStyles(this.elementTagName,this.classNameToBeAdded)}}he.STYLES={backgroundColor:"rgba(var(--v-bg-secondary, 245, 247, 247, 1))",padding:"12px"};class ue extends J{constructor(t,e,s){super(t),this.dtoName=ue.dtoName,this.type="code-block",this.annotationMap=new Map([I.from(he.STYLES)]),this.children=[new ae(`${t}-1`,e,s,this)]}static from(t){return new ue(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(t){const{language:e=ce["Plain Text"]}=this.children[0];return`<pre data-language="${e}"${super.generateAttributeString(t)}>${this.children.map((e=>e.toHtml(t)))}</pre>`}clone(t){const e=ue.from(this.toJSON());return e.parent=t,e}apply(n){if(n instanceof E&&k.executeTheStrategy(n,this),n.isFlushable){const n=w.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(p.SELECTION_RANGE)}}k.register(A.DELETE_CODE_BLOCK,ue.name,new class extends se{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 Gt(e));const i=t?w.getDOMByEntity(t):null;if(0===n.children.length){const s=ee.from({id:l(),type:"paragraph",nodes:[{id:l(),type:"text",text:""}]});e.parent.apply(new Bt([s])),t=s.children[0],r=0}this.notifyUpdateSelection(t,i,r,e)}}notifyUpdateSelection(s,r,i,o){const a=w.getDOMByEntity(o);if(a){const o=e.getSubjectFromParentNodeByEventId(a,n);o&&t.notify(o,{node:s,updateDirectly:!!r,offset:i})}}getRTENodeEndOffset(t){return t?t.getRangeEndOffset():0}}),k.register(A.DELETE_CHILDREN,ue.name,new le),k.register(A.SWITCH_OUT_FROM_CODE_BLOCK,ue.name,new class extends dt{handleAction(s,r){const{content:i,language:o}=s,a=i.split("\n"),c=new ne(a.slice(0,a.length-2).join("\n"),o);c.isFlushable=!1,r.children[0].apply(c);const h=ee.from({id:l(),type:"paragraph",nodes:[{id:l(),text:"",type:"text"}]});r.parent.apply(new Jt(r,h));const u=w.getDOMByEntity(r);if(u){const s=e.getSubjectFromParentNodeByEventId(u,n);s&&t.notify(s,{node:h.children[0]})}}}),k.register(A.INSERT_IMAGE_TO_BLOCK,ue.name,new class extends dt{handleAction(t,e){e.parent.apply(new Jt(e,t.imageBlockToBeInserted))}}),ue.CODE_BLOCK_PLACEHOLDER_CLASS_NAME="code-block-placeholder-element",ue.dtoName="RTECodeBlock";export{st as $,k as A,x as B,y as C,zt as D,ut as E,f as F,B as G,Qt as H,Jt as I,b as J,m as K,$ as L,E as M,O as N,Kt as O,at as P,se as Q,F as R,Yt as S,Ht as T,Ct as U,ot as V,le as W,z as X,G as Y,S as Z,nt as _,_ as a,V as a0,q as a1,X as a2,Ft as a3,N as a4,R as a5,et as a6,C as a7,he as a8,ae as a9,oe as aa,ce as ab,it as ac,rt as ad,mt as ae,ne as af,re as ag,$t as ah,gt as ai,yt as aj,St as ak,tt as al,wt as am,At as an,Et as ao,te as ap,P as b,Lt as c,J as d,ee as e,M as f,dt as g,Bt as h,H as i,qt as j,p as k,A as l,K as m,Gt as n,L as o,T as p,ie as q,ue as r,w as s,I as t,Pt as u,Zt as v,Vt as w,Xt as x,Ut as y,Wt as z}
1
+ import{C as t}from"./p-2d0d575f.js";import{d as e}from"./p-526e3634.js";import{d as s,e as n}from"./p-3a93730e.js";import{d as r,c as i}from"./p-02841589.js";import{L as o}from"./p-6e1ab235.js";import{i as a}from"./p-b0f55f5f.js";import{T as c}from"./p-d884c644.js";import{g as l}from"./p-8b5d3a52.js";import{V as h}from"./p-3e09aeed.js";import{c as u}from"./p-a841cf13.js";import{f as d}from"./p-528748fa.js";var p,f;!function(t){t.SELECTION_RANGE="SELECTION_RANGE",t.CLEAR_FORMATTING="CLEAR_FORMATTING",t.LINK_GROUP="LINK_GROUP"}(p||(p={}));class g{}!function(t){t.ALIGNMENT="ALIGNMENT",t.TEXT_STYLE="TEXT_STYLE",t.INDENT="INDENT",t.LIST="LIST",t.INTERNAL_WRAPPER="INTERNAL_WRAPPER"}(f||(f={}));class x extends g{}const w=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.dtoName}};var A,O,y,m;!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"}(A||(A={}));class E{constructor(){this.isFlushable=!1}}function S(t){const e=t.getAttribute("style");return e?e.split(";").filter(Boolean).filter((t=>" "!==t)).map((t=>{const e=t.replace(/(['"])(.*?)\1/g,"$2").split(":");return{[r(e[0].trim())]:e[1].trim().replace(";","")}})).reduce(((t,e)=>Object.assign(Object.assign({},t),e)),{}):{}}class T{constructor(){this.classNameToBeAdded=""}filterAnnotations(t){const e=t.customStyle;return e?(this.extractAndDeleteMatchedStyles(e),0===Object.keys(e).length&&delete t.customStyle,t):t}filterAndDeleteStyles(t,e){const s=new Set(e);return this.extractAndDeleteMatchedStyles(t)&&this.classNameToBeAdded&&s.add(this.classNameToBeAdded),{styles:t,classNames:Array.from(s)}}refillStyles(t){this.classNameToBeAdded&&t.classList.remove(this.classNameToBeAdded);const e=S(t),s=Object.assign(Object.assign({},this.stylesToBeFiltered),e),n=Object.entries(Object.assign({},s)).map((([t,e])=>`${i(t)}: ${e};`)).join("");t.setAttribute("style",n)}canFilter(t){return!1}canRefill(t,e){return!1}toCssText(){return""}get alwaysFilter(){return!1}extractAndDeleteMatchedStyles(t){let e=!1;const s=this.stylesToBeFiltered;if(t&&s){const n=Object.keys(s);for(const r of n)t[r]===s[r]&&(delete t[r],e=!0)}return e}buildCssTextForStyles(t,e){return`${`.${T.RTE_CONTENT_CONTAINER_CLASS_NAME}`+(e?` .${e}`:` ${t}`)} { ${Object.entries(this.stylesToBeFiltered).map((([t,e])=>`${i(t)}: ${e};`)).join(" ")} }`}convertStylesMapToCssText(t){return Object.entries(t||this.stylesToBeFiltered).map((([t,e])=>`${i(t)}: ${e};`)).join(" ")}isBlockOrNodeStylesMatchFilterStyles(t,e){const s=t.getStyles({standalone:!0});return this.isMatchFilterStyles(s,e)}isMatchFilterStyles(t,e){return(e&&e.length>0?e:Object.keys(this.stylesToBeFiltered)).every((e=>t[e]===this.stylesToBeFiltered[e]))}}T.RTE_CONTENT_CONTAINER_CLASS_NAME="vega-rte-content",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"}(O||(O={}));class N extends g{}class b{static isTextBlock(t){return t===this.RTE_TEXT_BLOCK_CLASS_NAME}static isCodeBlock(t){return"RTECodeBlock"===t}static isListBlock(t){return"RTEListBlock"===t}static isListItemBlock(t){return"RTEListItemBlock"===t}static isTextNode(t){return t===this.RTE_TEXT_NODE_CLASS_NAME}static isLinkNode(t){return this.isTextNode(t.dtoName)&&!!t.getAnnotationByType(O.LINK)}static isCodeNode(t){if(this.isTextNode(t.dtoName)){const e=t.getAnnotationByType(O.CODE);return!!e&&e.code}return!1}static isImageNode(t){return"RTEImageNode"===t.dtoName}static isCodeBlockNode(t){return"RTECodeBlockNode"===t.dtoName}}b.RTE_TEXT_NODE_CLASS_NAME="RTETextNode",b.RTE_TEXT_BLOCK_CLASS_NAME="RTETextBlock";class C extends T{constructor(){super(...arguments),this.stylesToBeFiltered=v.getDefaultStyles(),this.elementTagName="a"}filterAnnotations(t){const e=t.link;return(null==e?void 0:e.customStyle)?(this.extractAndDeleteMatchedStyles(e.customStyle),0===Object.keys(e.customStyle).length&&delete e.customStyle,t):t}canFilter(t){return b.isLinkNode(t)}canRefill(t,e){return"RTETextNode"===t&&e.matches(this.elementTagName)}toCssText(){return this.buildCssTextForStyles(this.elementTagName,this.classNameToBeAdded)}filterLinkGroupInlineStyles(t){const e=t.style,s=t.class?t.class.split(" "):[],n=this.filterAndDeleteStyles(e,s);return n.styles&&Object.keys(n.styles).length>0&&(t.style=n.styles),n.classNames&&n.classNames.length>0&&(t.class=n.classNames.join(" ")),t.style&&0===Object.keys(t.style).length&&delete t.style,t}}class v extends g{constructor(t){super(),this.type=p.LINK_GROUP,this.linkGroups=new Map,this.linkGroups=new Map([[t,[]]])}static getDefaultStyles(){return{color:"rgba(var(--v-text-link, 19, 98, 226, 1))"}}clone(){const t=new v("");return this.linkGroups.forEach(((e,s)=>{t.linkGroups.set(s,e.map((t=>t.clone(t.parent))))})),t}toString(t,e){let s=this.toJsx(t,e);return(null==e?void 0:e.filterInlineStyles)&&(s=v.linkGroupFilterStylesStrategy.filterLinkGroupInlineStyles(s)),Object.entries(s).map((([t,e])=>{const s="string"==typeof e?e:this.formatStyleToString(e);return`${i(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&&Object.assign(s,v.getDefaultStyles()),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])=>`${i(t)}: ${e};`)).join(" ")}}v.linkGroupFilterStylesStrategy=new C;class R extends x{constructor(t){super(),this.type=f.ALIGNMENT,this.textAlign=t}static from(t){return[f.ALIGNMENT,new R(t)]}static getDefaultStyles(t){switch(t){case"right":case"center":case"justify":return{textAlign:t};case"left":default:return{textAlign:"left"}}}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 R(this.textAlign)}renderStyle(t){return(null==t?void 0:t.standalone)?R.getDefaultStyles(this.textAlign):null}}class j extends x{constructor(t){super(),this.type=f.INDENT,this.indent=Math.max(0,t)}static from(t){return[f.INDENT,new j(t)]}toJSON(){return this.indent>0?{indent:this.indent}:null}clone(){return new j(this.indent)}renderClass(){return null}renderStyle(){return this.indent>0?{marginLeft:16*this.indent+"px"}:null}}class _{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 E?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)))}}}_.registry=new Map;class k{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=_.get(t,e),n=()=>{const s=t instanceof E?t.type:t.constructor.name,n=k.get(s,e.constructor.name);if(n)return t.executedFlag=!0,n.execute(t,e);o.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!!k.get(t,e.constructor.name)}}k.registry=new Map,function(t){t.CUSTOM_ATTRIBUTE="CUSTOM_ATTRIBUTE",t.CUSTOM_CLASS="CUSTOM_CLASS",t.CUSTOM_STYLE="CUSTOM_STYLE"}(y||(y={}));class $ extends g{}class L extends ${constructor(t){super(),this.type=y.CUSTOM_ATTRIBUTE,this.BOOLEAN_ATTRS=new Set(["controls","disabled","checked","readonly","multiple","required","autoplay","muted"]),this.customAttribute=t}static from(t){return[y.CUSTOM_ATTRIBUTE,new L(t)]}toJSON(){return{customAttribute:this.customAttribute}}clone(){return new L(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(a)}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 ${constructor(t){super(),this.type=y.CUSTOM_CLASS,this.customClass=t}static from(t){return[y.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 I extends ${constructor(t){super(),this.type=y.CUSTOM_STYLE,this.customStyle=t}static from(t){return[y.CUSTOM_STYLE,new I(t)]}toJSON(){return{customStyle:this.customStyle}}clone(){return new I(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 D extends x{constructor(t){super(),this.type=f.INTERNAL_WRAPPER,this.internalWrapper=t}static from(t){return[f.INTERNAL_WRAPPER,new D(t)]}clone(){return new D(this.internalWrapper)}renderClass(){}renderStyle(){}toJSON(){return this.internalWrapper?{internalWrapper:this.internalWrapper}:void 0}}class M{constructor(t){this.dtoName=t instanceof J?"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])=>`${i(t)}: ${e};`)).join("")}toJSON(t={standalone:!1},e){const s=Array.from(this.annotationMap.values()).filter((t=>this.filterAnnotation(t)||t instanceof I)).map((e=>e.renderStyle(t))).filter(a);return e&&e.length>0?this.mergeAnnotationStyles(s,e):s.reduce(((t,e)=>Object.assign(Object.assign({},t),e)),{})}filterAnnotation(t){return"block"===this.dtoName?t instanceof x:t instanceof N}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}}class F{static register(t,e){var s;const n=null!==(s=this.registry.get(t))&&void 0!==s?s:new Set;n.add(e),this.registry.set(t,n)}static getStrategies(t){var e;return Array.from(null!==(e=this.registry.get(t))&&void 0!==e?e:[])}static executeTheStrategyFilterAction(t,e,s){return this.getStrategies(t.dtoName).filter((e=>e.canFilter(t))).reduce(((t,e)=>e.filterAndDeleteStyles(t.styles,t.classNames)),{styles:e,classNames:s})}static executeTheStrategyRefillAction(t,e){this.getStrategies(t).filter((s=>s.canRefill(t,e))).forEach((t=>{t.refillStyles(e)}))}static generateAllStylesContent(t=!1){const e=[];return t&&(e.push("/* Font-face imports begin */\n"),e.push(Object.keys(c).map((t=>`@import url('${c[t].url}');\n`)).join(" ")),e.push("/* Font-face imports end */\n")),this.registry.forEach((t=>{t.forEach((t=>{const s=t.toCssText();s&&!e.includes(s)&&e.push(s)}))})),e.join(" ")}}F.registry=new Map,function(t){t.TEXT="TEXT",t.IMAGE="IMAGE",t.CODE_BLOCK_NODE="CODE_BLOCK_NODE"}(m||(m={}));class H{constructor(t,e){this.annotationMap=new Map,this.dtoName=this.constructor.name,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 L.from(e);case"customClass":return B.from(e);case"customStyle":return I.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 M(this).toJSON(t,["textDecoration"])}getClasses(t={standalone:!1}){return Array.from(this.annotationMap.values()).filter((t=>t instanceof N||t instanceof B)).map((e=>e.renderClass(t))).filter(a).reduce(((t,e)=>[t,e].join(" ").trim()),"")}getCustomAttributesAnnotation(){return this.annotationMap.get(y.CUSTOM_ATTRIBUTE)}isTextNode(){return!1}getElementRef(){return w.getDOMByEntity(this)}generateAttributeString(t,...e){var s;const n=new M(this),r=n.toJSON({standalone:!0},["textDecoration"]),i=this.annotationMap.get(y.CUSTOM_CLASS);let o=r,c=null==i?void 0:i.renderClass();if(t&&t.filterInlineStyles){const t=F.executeTheStrategyFilterAction(this,r,c);o=t.styles,c=t.classNames}const l=[...(null===(s=this.getCustomAttributesAnnotation())||void 0===s?void 0:s.toString(e))||[],c&&c.length>0?`class="${c.join(" ")}"`:null,o&&Object.keys(o).length>0?`style="${n.toCssText({standalone:!0},void 0,o)}"`:null,...e].filter(a);return l.length?` ${l.join(" ")}`:""}doApply(t){t instanceof E?this.doModifyActionApply(t):this.doAnnotationActionApply(t)}flushChange(){const n=w.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 P=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 J)this.RTE_BLOCK_DTO_CLASS_MAP.set(t,e);else{if(!(e.prototype instanceof H))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 J{constructor(t){this.annotationMap=new Map,this.dtoName=this.constructor.name,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=P.getRTEBlockClass(t.type);if(n){const r=n.from(t,e);return r.parent=s,r}})).filter(a)}static createAnnotationEntity(t,e){switch(t){case"textAlign":return R.from(e);case"indent":return j.from(e);case"customAttribute":return L.from(e);case"customClass":return B.from(e);case"customStyle":return I.from(e);case"internalWrapper":return D.from(e)}}static convertAnnotationsToMap(t,e){Object.entries(e).forEach((([e,s])=>{const n=this.createAnnotationEntity(e,s);a(n)&&t.set(...n)}))}shouldRenderAsInternalWrapper(){const t=this.getAnnotationByType(f.INTERNAL_WRAPPER);return!!t&&t.internalWrapper&&0===Array.from(this.annotationMap.values()).filter((t=>!(t instanceof v||t instanceof D))).length}toJSON(){const t=Array.from(this.annotationMap.values()).filter((t=>t instanceof x||t instanceof $)).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=w.getDOMByEntity(this);if(n){const r=e.getSubjectFromParentNodeByEventId(n,s);r&&t.notify(r,{})}}}getFirstNode(){if(!this.children||!this.children[0])return null;const t=this.children[0];return t instanceof J?t.getFirstNode():t}isListItemBlock(){return"list-item"===this.type}getStyles(t={standalone:!1}){const e=new M(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 x||t instanceof B)).map((e=>e.renderClass(t))).filter(a).reduce(((t,e)=>[t,e].join(" ").trim()),"")}getCustomAttributesAnnotation(){return this.annotationMap.get(y.CUSTOM_ATTRIBUTE)}generateAttributeString(t,...e){var s;const n=new M(this),r=n.toJSON({standalone:!0}),i=this.annotationMap.get(y.CUSTOM_CLASS);let o=r,c=null==i?void 0:i.renderClass();if(t&&t.filterInlineStyles){const t=F.executeTheStrategyFilterAction(this,r,c);o=t.styles,c=t.classNames}const l=[...(null===(s=this.getCustomAttributesAnnotation())||void 0===s?void 0:s.toString(e))||[],c&&c.length>0?`class="${c.join(" ")}"`:null,o&&Object.keys(o).length>0?`style="${n.toCssText({standalone:!0},void 0,o)}"`:null,...e].filter(a);return l.length?` ${l.join(" ")}`:""}doApply(t){t instanceof E?k.executeTheStrategy(t,this):this.applyAnnotationAction(t)}applyAnnotationAction(t){const e=t.toAnnotation();if(e instanceof v||this.annotationMap.set(e.type,e),"function"==typeof this.doAnnotationActionApply)this.doAnnotationActionApply(t);else{const e=k.get(t.constructor.name,this.constructor.name);e&&e.execute(t,this)}}cloneAnnotations(){return new Map(Array.from(this.annotationMap.entries()).map((([t,e])=>[t,e.clone()])))}}class K{}class U extends K{constructor(){super(...arguments),this.doSplit=!0}}class W extends g{constructor(t){super(),this.type=p.SELECTION_RANGE,this.range=t}clone(){return new W(this.range)}}const G="700",z="bold",V="italic",X="underline",q="line-through";class Y extends N{constructor(t){super(),this.type=O.STRIKETHROUGH,this.strikethrough=t}static from(t){return[O.STRIKETHROUGH,new Y(t)]}toJSON(){return{strikethrough:this.strikethrough}}clone(){return new Y(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 Q extends N{constructor(t){super(),this.type=O.UNDERLINE,this.underline=t}static from(t){return[O.UNDERLINE,new Q(t)]}toJSON(){return{underline:this.underline}}clone(){return new Q(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 Z extends N{constructor(t){super(),this.type=O.ITALIC,this.italic=t}static from(t){return[O.ITALIC,new Z(t)]}toJSON(){return{italic:this.italic}}clone(){return new Z(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 tt extends N{constructor(t){super(),this.type=O.BOLD,this.bold=t}static from(t){return[O.BOLD,new tt(t)]}toJSON(){return{bold:this.bold}}clone(){return new tt(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 et extends N{constructor(t,e=!0){super(),this.type=O.CODE,this.code=t,this.useInternalStyle=e}static from(t,e){return[O.CODE,new et(t,e)]}static getDefaultStyles(){return{fontFamily:"Roboto Mono",whiteSpace:"pre-wrap"}}toJSON(){return{code:this.code}}clone(){return new et(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?et.getDefaultStyles():null}}const st={key:"black",light:"#111128",dark:"#E3E3E8"},nt=[st,{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"}],rt="​",it=[{key:"title"},{key:"subtitle"},{key:"heading-1"},{key:"heading-2"},{key:"heading-3"},{key:"paragraph"}],ot=[["textStyles"],["bold","italic","underline","strikethrough","code"],["textColor"],["horizontalAlignment","bulletsNumbers"],["moreIndent","lessIndent"],["link"],["image"],["clearStyle"]],at=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);class ct extends N{constructor(t){super(),this.type=O.TEXT_COLOR,this.textColor=this.formatTextColor(t)}static from(t){return[O.TEXT_COLOR,new ct(t)]}toJSON(){return{textColor:this.textColor.key}}clone(){return new ct(this.textColor.key)}renderClass(){return null}renderStyle(){return{color:h.isDarkMode()?this.textColor.dark:this.textColor.light}}formatTextColor(t){return nt.find((e=>e.key===t))||nt[0]}}class lt extends N{constructor(t,e=!0){super(),this.type=O.LINK,this.link=t,this.useInternalStyle=e}static from(t,e=!0){return[O.LINK,new lt(t,e)]}toJSON(){return{link:this.link}}clone(){return new lt(this.link,this.useInternalStyle)}toEqual(t){return this.link.groupKey===t.link.groupKey}renderClass(){return null}renderStyle(){return null}}class ht extends K{constructor(t,e,s){super(),this.isFlushable=!1,this.groupKey=t,this.nodes=e,this.type=s}toAnnotation(){return new v(this.groupKey)}}class ut extends K{constructor(){super(),this.isFlushable=!1}toAnnotation(){return null}}class dt{execute(t,e){return o.log(`Executing action ${t.constructor.name} on ${e.constructor.name} ${e.id}`),this.handleAction(t,e)}updateCustomStyleAnnotation(t,e){const s=t.annotationMap.get(y.CUSTOM_STYLE);s&&this.isCustomStyle(s,e)&&t.annotationMap.set(s.type,new I(s.removeStyles(e)))}createNewParagraph(t){const e=P.getRTEBlockClass("paragraph");if(e)return e.from({id:l(),type:"paragraph",nodes:[{id:l(),type:"text",text:t}]})}getRootContent(t){const e=t.parent;if(e)return"VegaRTEContent"===e.dtoName?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)}getDOMByEntity(t){return w.getDOMByEntity(t)}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 pt extends E{constructor(t){super(),this.type=A.LINK_GROUP_NODE_SPLIT,this.splittedTextNodes=t}}class ft extends dt{constructor(){super(...arguments),this.applyTargetNode=null}handleAction(t,e){const s=e.getAnnotationByType(p.SELECTION_RANGE);if(this.setApplyTargetNode(null),t instanceof U&&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 pt(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,a=(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)]},c=i&&w.getEntityByDOM(i),l=o&&w.getEntityByDOM(o);if(c&&c.id===e.id){const i=s===n?t.endOffset:e.text.length,[o,c,l]=a(e.text,r,i);return this.setApplyTargetNode(c),[o,c,l].filter((t=>!!t.text))}if(l&&l.id===e.id){const[s,n,r]=a(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 gt extends U{constructor(t){super(),this.isFlushable=!0,this.bold=t}toAnnotation(){return new tt(this.bold)}}class xt extends g{constructor(){super(...arguments),this.type=p.CLEAR_FORMATTING,this.items=[O.BOLD,O.ITALIC,O.UNDERLINE,O.STRIKETHROUGH,O.TEXT_COLOR,O.CODE,y.CUSTOM_STYLE]}}class wt extends U{constructor(){super(...arguments),this.isFlushable=!0}toAnnotation(){return new xt}}class At extends U{constructor(t){super(),this.isFlushable=!0,this.code=t}toAnnotation(){return new et(this.code)}}class Ot extends K{constructor(t){super(),this.isFlushable=!0,this.annotationType=t}toAnnotation(){}}class yt extends U{constructor(t){super(),this.isFlushable=!0,this.italic=t}toAnnotation(){return new Z(this.italic)}}class mt extends U{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,a(n)&&(this.doSplit=n)}toAnnotation(){return new lt(this.link)}}class Et extends U{constructor(t){super(),this.isFlushable=!0,this.strikethrough=t}toAnnotation(){return new Y(this.strikethrough)}}class St extends U{constructor(t){super(),this.isFlushable=!0,this.underline=t}toAnnotation(){return new Q(this.underline)}}class Tt extends dt{handleAction(t,e){const s=t.toAnnotation();if(t instanceof Ot)e.annotationMap.delete(t.annotationType);else{if(!(s instanceof xt))return s instanceof N||s instanceof W?(t instanceof mt&&(a(t.newText)&&(e.text=t.newText),e.parent.apply(new ht(t.link.groupKey,[e],t.type))),t instanceof At&&this.handleAction(new wt,e),t instanceof gt&&this.updateCustomStyleAnnotation(e,["fontWeight"]),t instanceof yt&&this.updateCustomStyleAnnotation(e,["fontStyle"]),(t instanceof St||t instanceof Et)&&this.updateCustomStyleAnnotation(e,["textDecoration"]),void e.annotationMap.set(s.type,s)):void 0;s.items.forEach((t=>{e.deleteAnnotationByType(t)}))}}}class Nt extends E{constructor(){super(...arguments),this.type=A.DELETE_LINK_GROUP}}class bt extends dt{handleAction(t,e){e.text=t.newTextContent,!e.text&&e.annotationMap.has("LINK")&&e.apply(new Nt)}}class Ct extends E{constructor(t){super(),this.type=A.UPDATE_TEXT,this.newTextContent="",this.newTextContent=t}}class vt extends dt{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 a=s.text;if(n===r&&i===o&&t)a=s.text.slice(0,i)+t+s.text.slice(i);else{const e=n.parentElement,c=r.parentElement,l=e&&w.getEntityByDOM(e),h=c&&w.getEntityByDOM(c);let u=0,d=s.text.length;l&&l===s?(u=i,d=n===r?o:d):h&&h===s&&(d=o),a=s.text.slice(0,u)+t+s.text.slice(d)}s.apply(new Ct(a))}}}class Rt extends g{constructor(t){super(),this.type=O.INLINE_HTML,this.htmlTag=t}static from(t){const{htmlTag:e,child:s,customStyle:n,customClass:r,customAttribute:i}=t,o=new Rt(e);return o.groupId=t.groupId,o.child=s?Rt.from(s)[1]:void 0,o.customAttribute=i?L.from(i)[1]:void 0,o.customClass=r?B.from(r)[1]:void 0,o.customStyle=n?I.from(n)[1]:void 0,[O.INLINE_HTML,o]}clone(){var t,e,s,n;const r=new Rt(this.htmlTag);return r.groupId=this.groupId,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}renderProps(){var t,e,s;return Object.assign(Object.assign({},null===(t=this.customAttribute)||void 0===t?void 0:t.render()),{style:null===(e=this.customStyle)||void 0===e?void 0:e.renderStyle(),class:null===(s=this.customClass)||void 0===s?void 0:s.renderClass().join(" ")})}toJSON(){var t,e,s,n;return{inlineHtml:u({htmlTag:this.htmlTag,groupId:this.groupId,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 jt extends dt{handleAction(t,e){const s=e.parent.getAnnotationByType(p.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 _t extends dt{handleAction(t,e){const s=e.parent.getAnnotationByType(p.LINK_GROUP);if(s){const t=e.annotationMap.get(O.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(p.LINK_GROUP)}}e.annotationMap.delete(O.LINK)}}class kt extends N{constructor(t){super(),this.type=O.PLAIN_TEXT,this.plainText=!0,this.plainText=t}static from(t){return[O.PLAIN_TEXT,new kt(t)]}clone(){return new kt(this.plainText)}renderClass(){}renderStyle(){}toJSON(){return this.plainText?{plainText:this.plainText}:void 0}}class $t extends U{constructor(t){super(),this.isFlushable=!0,this.textColor=t}toAnnotation(){return new ct(this.textColor)}}class Lt extends H{constructor(t,e,s,n){super(t,n),this.dtoName=Lt.dtoName,this.type=m.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 Lt(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 ht(t.link.groupKey,[n],"link")),this.createAnnotationEntity(r,t[r],e)))).filter(a))}static createAnnotationEntity(t,e,s){const n=!(!s||!s.autoMatchFormat);switch(t){case"bold":return tt.from(e);case"italic":return Z.from(e);case"underline":return Q.from(e);case"strikethrough":return Y.from(e);case"code":return et.from(e,n);case"textColor":return ct.from(e);case"link":return lt.from(e,n);case"inlineHtml":return Rt.from(e);case"plainText":return kt.from(e)}return H.createAnnotationEntity(t,e)}toJSON(){const t=Array.from(this.annotationMap.values()).filter((t=>t instanceof N||t instanceof $||t instanceof Rt)).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(t){const e=this.getAnnotationByType(O.INLINE_HTML);return e?this.renderWithWrapperStr(e,t):this.renderTextStr(t)}cloneWithText(t){return new Lt(l(),t,this.parent,super.cloneAnnotations())}clone(t){return new Lt(this.id,this.text,t,super.cloneAnnotations())}isEmpty(){return!(this.getAnnotationByType(O.INLINE_HTML)||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}getInlineHtmlTagAtDepth(t){const e=this.getInlineHtmlAnnotationAtDepth(t);return e?at.has(e.htmlTag)?null:{htmlTag:e.htmlTag,attrStr:this.annotationAttrStr(e),groupId:e.groupId,annotation:e}:null}renderHtmlFromDepth(t,e){if(0===t)return this.toHtml(e);const s=this.getInlineHtmlAnnotationAtDepth(t);return s?this.renderWithWrapperStr(s,e):this.renderTextStr(e)}getInlineHtmlAnnotationAtDepth(t){let e=this.getAnnotationByType(O.INLINE_HTML);for(let s=0;s<t&&e;s++)e=e.child;return e}registerModifyStrategy(){const t=this.constructor.name;Lt.registerActionStrategyStatus[t]||(this.isContentEditable()&&(k.register(A.UPDATE_TEXT,t,new bt),k.register(A.REPLACE_SELECTED_TEXT,t,new vt),k.register(A.LINK_GROUP_NODE_SPLIT,t,new jt),k.register(mt.name,t,new Tt)),k.register(U.name,t,new ft),k.register(A.DELETE_LINK_GROUP,t,new _t),k.register(gt.name,t,new Tt),k.register(wt.name,t,new Tt),k.register(yt.name,t,new Tt),k.register(St.name,t,new Tt),k.register($t.name,t,new Tt),k.register(Et.name,t,new Tt),k.register(At.name,t,new Tt),k.register(K.name,t,new Tt),Lt.registerActionStrategyStatus[t]=!0)}doAnnotationActionApply(t){const e=this.getAnnotationByType(p.SELECTION_RANGE);if(t instanceof U&&t.doSplit&&e){const e=k.get(U.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){k.executeTheStrategy(t,this)}applyActionToNode(t,e){const s=e.toAnnotation();if(e instanceof ut)return void this.syncUpSelectedNodes(t);s instanceof W||this.syncUpSelectedNodes(t);const n=k.get(e.constructor.name,t.constructor.name);if(n)return void n.execute(e,t);const r=k.get(K.name,Lt.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,e){const{htmlTag:s,child:n}=t,r=this.annotationAttrStr(t);return n?`<${s}${r}>${this.renderWithWrapperStr(n,e)}</${s}>`:at.has(s)?`<${s}${r}>`:this.text?`<${s}${r}>${this.renderTextStr(e)}</${s}>`:`<${s}${r}></${s}>`}annotationAttrStr(t){const{customAttribute:e,customClass:s,customStyle:n}=t,r=[...(null==e?void 0:e.toString())||[],null==s?void 0:s.toString(),null==n?void 0:n.toString()].filter(a);return r.length>0?` ${r.join(" ")}`:""}renderTextStr(t){var e;const s=(null===(e=this.getAnnotationByType(O.CODE))||void 0===e?void 0:e.code)?"code":"span",n=super.generateAttributeString(t);return"\n"===this.text?"<br>":this.shouldRenderAsPlainText()?this.text:`<${s}${n}>${this.text}</${s}>`}shouldRenderAsPlainText(){const t=super.getAnnotationByType(O.PLAIN_TEXT);return!!t&&t.plainText&&0===Array.from(this.annotationMap.values()).filter((t=>t instanceof N&&!(t instanceof lt)&&!(t instanceof kt)||t instanceof $)).length}}Lt.registerActionStrategyStatus={},Lt.htmlTag="span",Lt.dtoName="RTETextNode";class Bt extends E{constructor(t){super(),this.type=A.APPEND_CHILDREN,this.entityToBeAppended=t}}const It={fontFamily:"Inter",fontSize:"16px",lineHeight:"22px",minHeight:"22px",fontWeight:"500"},Dt=Object.assign(Object.assign({},It),{marginTop:"0px",marginBottom:"0px"}),Mt={paragraph:Dt,title:Object.assign(Object.assign({},It),{fontSize:"36px",lineHeight:"40px",minHeight:"40px"}),subtitle:Object.assign(Object.assign({},It),{fontSize:"28px",lineHeight:"32px",minHeight:"32px"}),"heading-1":Object.assign(Object.assign({},Dt),{fontSize:"22px",lineHeight:"24px",minHeight:"24px"}),"heading-2":Object.assign(Object.assign({},Dt),{fontSize:"20px",lineHeight:"24px",minHeight:"24px"}),"heading-3":Object.assign(Object.assign({},Dt),{fontSize:"18px"}),"heading-4":Object.assign({},Dt),"heading-5":Object.assign(Object.assign({},Dt),{fontSize:"14px"}),"heading-6":Object.assign(Object.assign({},Dt),{fontSize:"12px"})};class Ft extends x{constructor(t){super(),this.type=f.TEXT_STYLE,this.textStyle=t}static from(t){return[f.TEXT_STYLE,new Ft(t)]}static getDefaultStyles(t){return t?Mt[t]:null}toJSON(){return{textStyle:this.textStyle}}clone(){return new Ft(this.textStyle)}renderClass(t){return(null==t?void 0:t.standalone)?null:this.textStyle?`v-rte--text-style-${this.textStyle}`:null}renderStyle(t){return(null==t?void 0:t.standalone)&&this.textStyle?Ft.getDefaultStyles(this.textStyle):null}}class Ht extends K{constructor(t,e){super(),this.isFlushable=!0,this.textStyle=t,this.bold=e}toAnnotation(){return new Ft(this.textStyle)}}class Pt extends dt{handleAction(t,e){"list-item"!==e.type&&(e.type=t.textStyle),e.children.forEach(t.bold?t=>{const e=new gt(!0);e.doSplit=!1,t.apply(e)}:t=>{t.apply(new Ot(O.BOLD))}),this.updateCustomStyleAnnotation(e,["fontFamily","lineHeight","fontWeight","fontSize"])}}class Jt extends E{constructor(t,...e){super(),this.type=A.INSERT_CHILDREN_AFTER,this.referChildren=t,this.childrenToBeInserted=e}}class Kt extends E{constructor(t){super(),this.type=A.REPLACE_CHILD_NODES,this.newChildNodes=t}}class Ut extends dt{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 Kt(e));const a=s.cloneWithNodes(o);return s.parent.apply(new Jt(s,a)),a}}}}class Wt extends dt{handleAction(t,e){e.children=[],e.apply(new Bt(t.newChildNodes))}}class Gt extends E{constructor(t){super(),this.type=A.DELETE_CHILDREN,this.entityToBeRemoved=t}}class zt extends dt{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 Bt(t)),s.parent.apply(new Gt(s))}}}class Vt extends dt{handleAction(t,e){t.lineBreakNode=this.lineBreakSingleBlock(t.startContainerNode,t.startOffset,e)}lineBreakSingleBlock(t,e,s){if(t){const n=new Lt(l(),"\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),a=s.children.slice(o+1);r&&e.push(t.cloneWithText(r)),i&&a.unshift(t.cloneWithText(i)),this.mergeLineBreakNodes(e,n,a,s)}return n}}mergeLineBreakNodes(t,e,s,n){(0===s.length||s[0]&&""===s[0].text)&&s.push(new Lt(l(),"\n",n,t[t.length-1]&&t[t.length-1].annotationMap)),n.apply(new Kt([...t,e,...s]))}}class Xt extends dt{handleAction(t,e){t.lineBreakNode=this.lineBreakMultipleBlocks(t.selectedBlocks,e)}lineBreakMultipleBlocks(t,e){const s=e.children,n=new Lt(l(),"\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 Gt(t)))})),e}mergeLineBreakNodes(t,e,s,n){(0===s.length||s[0]&&""===s[0].text)&&s.push(new Lt(l(),"\n",n,t[t.length-1]&&t[t.length-1].annotationMap)),n.apply(new Kt([...t,e,...s]))}}class qt extends E{constructor(t,...e){super(),this.type=A.INSERT_CHILDREN_BEFORE,this.referChildren=t,this.childrenToBeInserted=e}}class Yt extends E{constructor(t,e){super(),this.type=A.SPLIT_BLOCK_WITH_NODE,this.splitPointNode=t,this.startOffsetOfNode=e}}class Qt extends K{constructor(t){super(),this.isFlushable=!0,this.textAlign=t}toAnnotation(){return new R(this.textAlign)}}class Zt extends dt{handleAction(t,e){this.updateCustomStyleAnnotation(e,["textAlign"])}}class te extends K{constructor(t){super(),this.isFlushable=!0,this.indent=t}toAnnotation(){return new j(this.indent)}}class ee extends J{constructor(t,e,s){super(t),this.dtoName=ee.dtoName,this.children=[],this.type=e;const{autoMatchFormat:n}=s||{autoMatchFormat:!0};n&&(this.annotationMap=ee.isAcceptableTextStyle(e)?new Map([Ft.from(e)]):new Map([Ft.from("paragraph")]))}static from(t,e={autoMatchFormat:!0}){var s,n;const r=new ee(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=P.getRTENodeClass(t.type);if(s)return s.from(t,r,e)})).filter(a),i&&super.convertAnnotationsToMap(r.annotationMap,i),r}static createAnnotationEntity(t,e){return"textStyle"===t?Ft.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 mt&&t.needMergeNode){const t=null==n?void 0:n.getAnnotationByType(O.LINK),r=s.getAnnotationByType(O.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(t){const e=this.getBlockTag(),s=super.generateAttributeString(t),n=this.getChildrenHtml(t);return super.shouldRenderAsInternalWrapper()?n:[`<${e}${s}>`,n,`</${e}>`].join("")}cloneWithNodes(t){const e=new ee(l(),this.type);return e.annotationMap=super.cloneAnnotations(),e.apply(new Bt(t)),e}clone(t){const e=new ee(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(t){const e=this.getAnnotationByType(p.LINK_GROUP);let s=this.renderGroupedNodesAtDepth(this.children,0,t);return e&&this.children.length>0&&(s=this.generateLinkHtml(e,s,t)),s}doAnnotationActionApply(t){const e=k.get(t.constructor.name,ee.name);e&&e.execute(t,this)}renderGroupedNodesAtDepth(t,e,s){var n;let r="",i=0;for(;i<t.length;){const o=t[i].getInlineHtmlTagAtDepth(e);if(!(null==o?void 0:o.groupId)){r+=t[i].renderHtmlFromDepth(e,s),i++;continue}let a=i+1;for(;a<t.length&&(null===(n=t[a].getInlineHtmlTagAtDepth(e))||void 0===n?void 0:n.groupId)===o.groupId;)a++;if(a===i+1)r+=t[i].renderHtmlFromDepth(e,s);else{const n=this.renderGroupedNodesAtDepth(t.slice(i,a),e+1,s);r+=`<${o.htmlTag}${o.attrStr}>${n}</${o.htmlTag}>`}i=a}return r}generateLinkHtml(t,e,s){e="";let n=[];for(let r=0;r<this.children.length;r++){const i=this.children[r].getAnnotationByType(O.LINK),o=this.children[r+1]?this.children[r+1].getAnnotationByType(O.LINK):null;if(i){if(n.push(this.children[r]),!o||i.link.groupKey!==o.link.groupKey){const r=t.toString(i,{standalone:!0,filterInlineStyles:null==s?void 0:s.filterInlineStyles});e+=[`<a${r?` ${r}`:""}>`,this.renderGroupedNodesAtDepth(n,0,s),"</a>"].join(""),n=[]}}else e+=this.children[r].toHtml(s)}return e}}k.register(Ht.name,ee.name,new Pt),k.register(Qt.name,ee.name,new Zt),k.register(te.name,ee.name,new class extends dt{handleAction(t,e){this.updateCustomStyleAnnotation(e,["marginLeft"])}}),k.register(ht.name,ee.name,new class extends dt{handleAction(t,e){let s=e.getAnnotationByType(p.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(p.LINK_GROUP,s)}}}),k.register(A.UNLINK_LINK_GROUP,ee.name,new class extends dt{handleAction(t,e){const s=e.getAnnotationByType(p.LINK_GROUP);s&&(s.linkGroups.size>1?s.linkGroups.delete(t.groupKey):e.annotationMap.delete(p.LINK_GROUP))}}),k.register(A.SPLIT_BLOCK_WITH_NODE,ee.name,new Ut),k.register(A.REPLACE_CHILD_NODES,ee.name,new Wt),k.register(A.MERGE_TWO_BLOCKS_NODES,ee.name,new zt),k.register(A.LINE_BREAK_SINGLE_BLOCK,ee.name,new Vt),k.register(A.LINE_BREAK_MULTIPLE_BLOCKS,ee.name,new Xt),k.register(A.INSERT_IMAGE_TO_BLOCK,ee.name,new class extends dt{handleAction(t,e){const s=t.splitPointNode,n=t.startOffsetOfNode,r=t.imageBlockToBeInserted;if(this.isCaretPositionAtBlockEnd(e,s,n))e.parent.apply(new Jt(e,r));else if(this.isCaretPositionAtBlockStart(e,s,n))e.parent.apply(new qt(e,r));else{const t=new Yt(s,n);e.apply(t),e.parent.apply(new Jt(e,r))}}}),k.register(A.TRANSFORM_LIST_BLOCK,ee.name,new class extends dt{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 Bt(i)),s.apply(new Jt(t.selectedBlocks[0],n)),r.forEach((t=>{t.parent.apply(new Gt(t))}))}}),ee.dtoName="RTETextBlock";class se extends dt{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.dtoName}}class ne extends E{constructor(t,e){super(),this.isFlushable=!0,this.type=A.UPDATE_CODE_BLOCK,this.content=t,this.language=e}}class re extends K{constructor(t){super(),this.isFlushable=!1,this.range=t}toAnnotation(){return new W(this.range)}}class ie extends H{constructor(){super(...arguments),this.type="decorator-node",this.isSelected=!1}static isDecoratorNodeContainerElement(t){return t&&t.classList.contains(ie.DECORATOR_CONTAINER_CLASS)}static getDecoratorNodeElement(t){return t.querySelector(`.${ie.DECORATOR_NODE_CLASS}`)}getRangeEndOffset(){return 1}getRangeContainer(){const t=this.getElementRef();if(t)return d(t,`.${ie.DECORATOR_CONTAINER_CLASS}`)}isContentEditable(){return!1}}ie.DECORATOR_CONTAINER_CLASS="v-internal-decorator-container",ie.DECORATOR_NODE_CLASS="v-internal-decorator-node";class oe extends T{constructor(){super(...arguments),this.stylesToBeFiltered=oe.STYLES,this.elementTagName="pre code"}canFilter(t){return b.isCodeBlockNode(t)}canRefill(t,e){return!1}toCssText(){return this.buildCssTextForStyles(this.elementTagName,this.classNameToBeAdded)}}oe.STYLES={boxSizing:"border-box",color:"rgba(var(--v-text-primary, 32, 54, 69, 1))",textAlign:"left",fontFamily:'"Roboto Mono"',fontWeight:"400",lineHeight:"22px",fontSize:"16px",whiteSpace:"pre-wrap",minHeight:"22px",tabSize:"2px"};class ae extends ie{constructor(t,e,s,n){super(t),this.dtoName=ae.dtoName,this.type=m.CODE_BLOCK_NODE,this.text="",this.annotationMap=new Map,this.text=e,this.parent=n,this.language=s,this.annotationMap.set(y.CUSTOM_STYLE,new I(oe.STYLES))}toJSON(){return{id:this.id,type:"text",text:this.text,language:this.language}}toHtml(t){return`<code${this.generateAttributeString(t)}>${this.text}</code>`}clone(t){return new ae(this.id,this.text,this.language,t)}doAnnotationActionApply(t){k.executeTheStrategy(t,this)}doModifyActionApply(t){k.executeTheStrategy(t,this)}}k.register(A.UPDATE_CODE_BLOCK,ae.name,new class extends dt{handleAction(t,e){const{content:s,language:n}=t;e.language=n,e.text=s}}),k.register(re.name,ae.name,new class extends dt{handleAction(t,e){e.annotationMap.set(p.SELECTION_RANGE,t.toAnnotation())}}),ae.dtoName="RTECodeBlockNode";var ce;!function(t){t.CSS="css",t.HTML="html",t.JavaScript="js",t.JSX="jsx",t["Plain Text"]="plainText",t.TypeScript="ts",t.TSX="tsx"}(ce||(ce={}));class le extends dt{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 Gt(e)))}}class he extends T{constructor(){super(...arguments),this.stylesToBeFiltered=he.STYLES,this.elementTagName="pre"}canFilter(t){return b.isCodeBlock(t.dtoName)}canRefill(t,e){return!1}toCssText(){return this.buildCssTextForStyles(this.elementTagName,this.classNameToBeAdded)}}he.STYLES={backgroundColor:"rgba(var(--v-bg-secondary, 245, 247, 247, 1))",padding:"12px"};class ue extends J{constructor(t,e,s){super(t),this.dtoName=ue.dtoName,this.type="code-block",this.annotationMap=new Map([I.from(he.STYLES)]),this.children=[new ae(`${t}-1`,e,s,this)]}static from(t){return new ue(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(t){const{language:e=ce["Plain Text"]}=this.children[0];return`<pre data-language="${e}"${super.generateAttributeString(t)}>${this.children.map((e=>e.toHtml(t)))}</pre>`}clone(t){const e=ue.from(this.toJSON());return e.parent=t,e}apply(n){if(n instanceof E&&k.executeTheStrategy(n,this),n.isFlushable){const n=w.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(p.SELECTION_RANGE)}}k.register(A.DELETE_CODE_BLOCK,ue.name,new class extends se{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 Gt(e));const i=t?w.getDOMByEntity(t):null;if(0===n.children.length){const s=ee.from({id:l(),type:"paragraph",nodes:[{id:l(),type:"text",text:""}]});e.parent.apply(new Bt([s])),t=s.children[0],r=0}this.notifyUpdateSelection(t,i,r,e)}}notifyUpdateSelection(s,r,i,o){const a=w.getDOMByEntity(o);if(a){const o=e.getSubjectFromParentNodeByEventId(a,n);o&&t.notify(o,{node:s,updateDirectly:!!r,offset:i})}}getRTENodeEndOffset(t){return t?t.getRangeEndOffset():0}}),k.register(A.DELETE_CHILDREN,ue.name,new le),k.register(A.SWITCH_OUT_FROM_CODE_BLOCK,ue.name,new class extends dt{handleAction(s,r){const{content:i,language:o}=s,a=i.split("\n"),c=new ne(a.slice(0,a.length-2).join("\n"),o);c.isFlushable=!1,r.children[0].apply(c);const h=ee.from({id:l(),type:"paragraph",nodes:[{id:l(),text:"",type:"text"}]});r.parent.apply(new Jt(r,h));const u=w.getDOMByEntity(r);if(u){const s=e.getSubjectFromParentNodeByEventId(u,n);s&&t.notify(s,{node:h.children[0]})}}}),k.register(A.INSERT_IMAGE_TO_BLOCK,ue.name,new class extends dt{handleAction(t,e){e.parent.apply(new Jt(e,t.imageBlockToBeInserted))}}),ue.CODE_BLOCK_PLACEHOLDER_CLASS_NAME="code-block-placeholder-element",ue.dtoName="RTECodeBlock";export{V as $,k as A,x as B,y as C,ut as D,f as E,B as F,N as G,Qt as H,Jt as I,m as J,$ as K,Kt as L,E as M,O as N,at as O,se as P,le as Q,Lt as R,Yt as S,Ht as T,Ct as U,ot as V,z as W,G as X,S as Y,nt as Z,st as _,J as a,q as a0,X as a1,Ft as a2,b as a3,R as a4,et as a5,C as a6,he as a7,ae as a8,oe as a9,_ as aa,ce as ab,it as ac,rt as ad,mt as ae,ne as af,re as ag,$t as ah,gt as ai,yt as aj,St as ak,tt as al,wt as am,At as an,Et as ao,te as ap,ee as b,M as c,dt as d,Bt as e,H as f,qt as g,p as h,A as i,K as j,Gt as k,L as l,P as m,T as n,ie as o,ue as p,I as q,F as r,w as s,Pt as t,Zt as u,Vt as v,Xt as w,Ut as x,Wt as y,zt as z}
@@ -1 +1 @@
1
- import{h as t,r as e,c as i,H as n,g as s}from"./p-6b2342e0.js";import{s as a}from"./p-519a7d55.js";import{c as o,V as r,I as l}from"./p-6e1ab235.js";import{V as p,I as f}from"./p-8ce9e214.js";import{c as h}from"./p-d7790113.js";import{a as d,A as c}from"./p-fcefb62c.js";import{c as m}from"./p-3a620268.js";import{T as x}from"./p-7fbd11b0.js";import"./p-6a334573.js";import"./p-2d0d575f.js";import"./p-526e3634.js";import"./p-331a62d5.js";import"./p-528748fa.js";import"./p-46cab60a.js";import"./p-b75ee3ba.js";import"./p-091fbc35.js";import"./p-cb378636.js";var g=function(t,e,i,n){var s,a=arguments.length,o=a<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var r=t.length-1;r>=0;r--)(s=t[r])&&(o=(a<3?s(o):a>3?s(e,i,o):s(e,i))||o);return a>3&&o&&Object.defineProperty(e,i,o),o};class b extends r{constructor(){super(...arguments),this.handleSuffixButtonClick=t=>{t.stopPropagation(),this.suffixButtonClickEventEmitter.emit()}}render(){if(this.suffixButtonConfig||this.suffixButtonProps){const{icon:e,text:i,size:n,minWidth:s,maxWidth:a,placement:o="right",alignment:r="start",trigger:l="hover"}=this.suffixButtonConfig||this.suffixButtonProps&&{icon:this.suffixButtonProps.icon,text:this.suffixButtonProps.tooltipText,trigger:this.suffixButtonProps.trigger};return t("div",{class:"label-suffix-button",role:"button",tabIndex:0,onClick:this.handleSuffixButtonClick,onKeyDown:m()},i?t("vega-tooltip",{trigger:l,text:i,size:n,minWidth:s,maxWidth:a,alignment:r,placement:o},this.renderSuffixButton(e)):this.renderSuffixButton(e))}}renderSuffixButton(e){return t("vega-button-circle",{size:"extra-small",variant:"icon-only",iconColor:"text-link",showTooltip:!1,icon:e})}}g([o()],b.prototype,"suffixButtonProps",void 0),g([o()],b.prototype,"suffixButtonConfig",void 0),g([o()],b.prototype,"suffixButtonClickEventEmitter",void 0);var u=function(t,e,i,n){var s,a=arguments.length,o=a<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var r=t.length-1;r>=0;r--)(s=t[r])&&(o=(a<3?s(o):a>3?s(e,i,o):s(e,i))||o);return a>3&&o&&Object.defineProperty(e,i,o),o};class v extends r{render(){return this.label&&t("span",{class:"aria-announcement"},this.generateAnnouncement())}generateAnnouncement(){let t=this.label;return this.isFieldRequired?t+=`, ${this.translationSlimmer.t("Required")}`:this.optional&&(t+=`, ${this.translationSlimmer.t("Optional")}`),this.disabled&&(t+=`, ${this.translationSlimmer.t("Disabled")}`),t}}u([o()],v.prototype,"label",void 0),u([o()],v.prototype,"isFieldRequired",void 0),u([o()],v.prototype,"optional",void 0),u([o()],v.prototype,"disabled",void 0),u([o()],v.prototype,"translationSlimmer",void 0);var w=function(t,e,i,n){var s,a=arguments.length,o=a<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var r=t.length-1;r>=0;r--)(s=t[r])&&(o=(a<3?s(o):a>3?s(e,i,o):s(e,i))||o);return a>3&&o&&Object.defineProperty(e,i,o),o};const y=class{constructor(t){e(this,t),this.vegaClick=i(this,"vegaClick",7),this.vegaLabelButtonClick=i(this,"vegaLabelButtonClick",1),this.labelButtonClick=i(this,"labelButtonClick",1),this.globalSlimmers={},this.clickEventEmitter=h(y,d),this.suffixButtonClickEventEmitter=h(y,c),this.vegaComponentUsageRuntimeMetricsSlimmer=new p,this.suffixElementRenderer=new b,this.labelAnnouncementRenderer=new v,this.translationSlimmer=new x,this.suffixButtonProps=null,this.suffixButtonConfig=null,this.label="",this.isFieldRequired=!1,this.disabled=!1,this.optional=!1,this.handleClick=t=>{this.clickEventEmitter.emit(void 0,t)}}componentWillLoad(){""===this.label&&(this.label=this.host.textContent,this.host.textContent="")}render(){return a(t(n,{class:{hidden:""===this.label,disabled:this.disabled},onClick:this.handleClick},this.labelAnnouncementRenderer.render(),t("label",{"aria-hidden":"true"},t("span",{class:"vega-field-label"},this.label),!this.isFieldRequired&&this.optional&&t("span",{class:"optional"},"(",this.translationSlimmer.t("Optional"),")"),t("span",{class:{"vega-field-label-required":!0,hidden:!this.isFieldRequired}},"*")),this.suffixElementRenderer.render()),this.host)}get host(){return s(this)}};w([f()],y.prototype,"globalSlimmers",void 0),w([l()],y.prototype,"clickEventEmitter",void 0),w([l()],y.prototype,"suffixButtonClickEventEmitter",void 0),w([l()],y.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),w([l()],y.prototype,"suffixElementRenderer",void 0),w([l()],y.prototype,"labelAnnouncementRenderer",void 0),w([l()],y.prototype,"translationSlimmer",void 0),y.style=':host{display:inline-block}:host(.disabled){pointer-events:none}:host(.hidden){display:none}label:first-of-type{color:rgba(var(--v-text-primary, 32, 54, 69, 1));font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px;word-break:break-word}@media screen and (min-width: 768px) and (max-width: 1023px){label:first-of-type{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){label:first-of-type{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){label:first-of-type{font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px}}:host(.disabled)>label>span.vega-field-label{color:rgba(var(--v-text-secondary, 107, 116, 125, 1))}.vega-field-label-required{color:rgba(var(--v-text-error, 189, 41, 71, 1));margin-left:4px}.vega-field-label-required.hidden{display:none}.label-suffix-button{display:inline-block;margin-left:4px;vertical-align:top}.optional{margin-left:4px;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))}@media screen and (min-width: 768px) and (max-width: 1023px){.optional{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){.optional{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){.optional{font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px}}.aria-announcement{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0}';export{y as vega_field_label}
1
+ import{h as t,r as e,c as i,H as n,g as s}from"./p-6b2342e0.js";import{s as a}from"./p-519a7d55.js";import{c as o,V as r,I as l}from"./p-6e1ab235.js";import{V as p,I as h}from"./p-8ce9e214.js";import{c as f}from"./p-d7790113.js";import{a as d,A as c}from"./p-fcefb62c.js";import{c as m}from"./p-3a620268.js";import{T as x}from"./p-0a1c7f80.js";import"./p-6a334573.js";import"./p-2d0d575f.js";import"./p-526e3634.js";import"./p-331a62d5.js";import"./p-528748fa.js";import"./p-46cab60a.js";import"./p-b75ee3ba.js";import"./p-eb927e2b.js";import"./p-cb378636.js";var g=function(t,e,i,n){var s,a=arguments.length,o=a<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var r=t.length-1;r>=0;r--)(s=t[r])&&(o=(a<3?s(o):a>3?s(e,i,o):s(e,i))||o);return a>3&&o&&Object.defineProperty(e,i,o),o};class b extends r{constructor(){super(...arguments),this.handleSuffixButtonClick=t=>{t.stopPropagation(),this.suffixButtonClickEventEmitter.emit()}}render(){if(this.suffixButtonConfig||this.suffixButtonProps){const{icon:e,text:i,size:n,minWidth:s,maxWidth:a,placement:o="right",alignment:r="start",trigger:l="hover"}=this.suffixButtonConfig||this.suffixButtonProps&&{icon:this.suffixButtonProps.icon,text:this.suffixButtonProps.tooltipText,trigger:this.suffixButtonProps.trigger};return t("div",{class:"label-suffix-button",role:"button",tabIndex:0,onClick:this.handleSuffixButtonClick,onKeyDown:m()},i?t("vega-tooltip",{trigger:l,text:i,size:n,minWidth:s,maxWidth:a,alignment:r,placement:o},this.renderSuffixButton(e)):this.renderSuffixButton(e))}}renderSuffixButton(e){return t("vega-button-circle",{size:"extra-small",variant:"icon-only",iconColor:"text-link",showTooltip:!1,icon:e})}}g([o()],b.prototype,"suffixButtonProps",void 0),g([o()],b.prototype,"suffixButtonConfig",void 0),g([o()],b.prototype,"suffixButtonClickEventEmitter",void 0);var u=function(t,e,i,n){var s,a=arguments.length,o=a<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var r=t.length-1;r>=0;r--)(s=t[r])&&(o=(a<3?s(o):a>3?s(e,i,o):s(e,i))||o);return a>3&&o&&Object.defineProperty(e,i,o),o};class v extends r{render(){return this.label&&t("span",{class:"aria-announcement"},this.generateAnnouncement())}generateAnnouncement(){let t=this.label;return this.isFieldRequired?t+=`, ${this.translationSlimmer.t("Required")}`:this.optional&&(t+=`, ${this.translationSlimmer.t("Optional")}`),this.disabled&&(t+=`, ${this.translationSlimmer.t("Disabled")}`),t}}u([o()],v.prototype,"label",void 0),u([o()],v.prototype,"isFieldRequired",void 0),u([o()],v.prototype,"optional",void 0),u([o()],v.prototype,"disabled",void 0),u([o()],v.prototype,"translationSlimmer",void 0);var w=function(t,e,i,n){var s,a=arguments.length,o=a<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var r=t.length-1;r>=0;r--)(s=t[r])&&(o=(a<3?s(o):a>3?s(e,i,o):s(e,i))||o);return a>3&&o&&Object.defineProperty(e,i,o),o};const y=class{constructor(t){e(this,t),this.vegaClick=i(this,"vegaClick",7),this.vegaLabelButtonClick=i(this,"vegaLabelButtonClick",1),this.labelButtonClick=i(this,"labelButtonClick",1),this.globalSlimmers={},this.clickEventEmitter=f(y,d),this.suffixButtonClickEventEmitter=f(y,c),this.vegaComponentUsageRuntimeMetricsSlimmer=new p,this.suffixElementRenderer=new b,this.labelAnnouncementRenderer=new v,this.translationSlimmer=new x,this.suffixButtonProps=null,this.suffixButtonConfig=null,this.label="",this.isFieldRequired=!1,this.disabled=!1,this.optional=!1,this.handleClick=t=>{this.clickEventEmitter.emit(void 0,t)}}componentWillLoad(){""===this.label&&(this.label=this.host.textContent,this.host.textContent="")}render(){return a(t(n,{class:{hidden:""===this.label,disabled:this.disabled},onClick:this.handleClick},this.labelAnnouncementRenderer.render(),t("label",{"aria-hidden":"true",part:"container"},t("span",{class:"vega-field-label",part:"label"},this.label),!this.isFieldRequired&&this.optional&&t("span",{class:"optional"},"(",this.translationSlimmer.t("Optional"),")"),t("span",{class:{"vega-field-label-required":!0,hidden:!this.isFieldRequired}},"*")),this.suffixElementRenderer.render()),this.host)}get host(){return s(this)}};w([h()],y.prototype,"globalSlimmers",void 0),w([l()],y.prototype,"clickEventEmitter",void 0),w([l()],y.prototype,"suffixButtonClickEventEmitter",void 0),w([l()],y.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),w([l()],y.prototype,"suffixElementRenderer",void 0),w([l()],y.prototype,"labelAnnouncementRenderer",void 0),w([l()],y.prototype,"translationSlimmer",void 0),y.style=':host{display:inline-block}:host(.disabled){pointer-events:none}:host(.hidden){display:none}label:first-of-type{color:rgba(var(--v-text-primary, 32, 54, 69, 1));font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px;word-break:break-word}@media screen and (min-width: 768px) and (max-width: 1023px){label:first-of-type{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){label:first-of-type{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){label:first-of-type{font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px}}:host(.disabled)>label>span.vega-field-label{color:rgba(var(--v-text-secondary, 107, 116, 125, 1))}.vega-field-label-required{color:rgba(var(--v-text-error, 189, 41, 71, 1));margin-left:4px}.vega-field-label-required.hidden{display:none}.label-suffix-button{display:inline-block;margin-left:4px;vertical-align:top}.optional{margin-left:4px;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))}@media screen and (min-width: 768px) and (max-width: 1023px){.optional{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){.optional{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){.optional{font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px}}.aria-announcement{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0}';export{y as vega_field_label}