@globalpayments/vega 2.86.0-beta.0 → 2.87.0-beta.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 (378) hide show
  1. package/dist/cjs/{app-globals-844163e7.js → app-globals-a6271a58.js} +11 -11
  2. package/dist/cjs/{child-nodes-event-prevent-slimmer-f3979a03.js → child-nodes-event-prevent-slimmer-d04eaffc.js} +1 -1
  3. package/dist/cjs/{code-block-0ec03cd3.js → code-block-8855ce20.js} +1 -1
  4. package/dist/cjs/{component-usage-runtime-metrics-4572c5b7.js → component-usage-runtime-metrics-389d1548.js} +1 -1
  5. package/dist/cjs/{component-value-history-controller-slimmer.abstract-b243e1e3.js → component-value-history-controller-slimmer.abstract-487eba5f.js} +3 -3
  6. package/dist/cjs/{content-state-8898e96d.js → content-state-71df26bc.js} +2 -2
  7. package/dist/cjs/{create-public-api-runtime-metrics-slimmer-9cb09fb2.js → create-public-api-runtime-metrics-slimmer-122350c3.js} +1 -1
  8. package/dist/cjs/{date-required-rule-0dd83683.js → date-required-rule-1fa16774.js} +1 -1
  9. package/dist/cjs/{design-token-4b3509dd.js → design-token-514f0a48.js} +3 -3
  10. package/dist/cjs/{element-appender-slimmer-2355d6f6.js → element-appender-slimmer-a399a2b4.js} +3 -3
  11. package/dist/cjs/{feature-flag-controller-9129ef52.js → feature-flag-controller-5fa21654.js} +1 -1
  12. package/dist/cjs/{form-field-controller-slimmer-595f4138.js → form-field-controller-slimmer-95e39415.js} +1 -1
  13. package/dist/cjs/{icon-manager-c12c6ea9.js → icon-manager-e855446d.js} +1 -1
  14. package/dist/cjs/{image-annotation-action-37434c42.js → image-annotation-action-de9ea6fe.js} +3 -3
  15. package/dist/cjs/index.cjs.js +20 -20
  16. package/dist/cjs/{inject-keyboard-manager-98ae7ce1.js → inject-keyboard-manager-c40fc223.js} +1 -1
  17. package/dist/cjs/{internal-icon-manager-c989189a.js → internal-icon-manager-66c48800.js} +1 -1
  18. package/dist/cjs/{internal-translation-controller-8360a89c.js → internal-translation-controller-df8d3728.js} +4 -0
  19. package/dist/cjs/{keyboard-manager-d3cc662c.js → keyboard-manager-32f720fe.js} +1 -1
  20. package/dist/cjs/{keyboard-manager-slimmer-3824781d.js → keyboard-manager-slimmer-2f0a5145.js} +1 -1
  21. package/dist/cjs/loader.cjs.js +14 -14
  22. package/dist/cjs/{month-view-generator-41b6c6b6.js → month-view-generator-48f8ad07.js} +1 -1
  23. package/dist/cjs/{public-rules-60e4dfda.js → public-rules-f9a0910c.js} +7 -7
  24. package/dist/cjs/{range-a6c15539.js → range-b60eea23.js} +1 -1
  25. package/dist/cjs/{responsive-format-facade-5f6cd211.js → responsive-format-facade-d8605493.js} +2 -2
  26. package/dist/cjs/{rich-text-editor-required-rule-f69c62ea.js → rich-text-editor-required-rule-980f64a3.js} +1 -1
  27. package/dist/cjs/{split-cell-operation-7920e3a1.js → split-cell-operation-d1ea2acb.js} +4 -4
  28. package/dist/cjs/{state-border-formatter-d1c80c1d.js → state-border-formatter-6d647199.js} +1 -1
  29. package/dist/cjs/{string-format-strategy.abstract-b39da0dd.js → string-format-strategy.abstract-54ec0c41.js} +1 -1
  30. package/dist/cjs/{string-input-formatter-slimmer-fd2fb154.js → string-input-formatter-slimmer-a32cae65.js} +1 -1
  31. package/dist/cjs/{string-mask-strategy-524d0f69.js → string-mask-strategy-c5174484.js} +2 -2
  32. package/dist/cjs/{style-formatter-c201e7d0.js → style-formatter-8de53cdb.js} +2 -2
  33. package/dist/cjs/{time-required-rule-ecb45905.js → time-required-rule-51c21042.js} +1 -1
  34. package/dist/cjs/{token-extension-364972cd.js → token-extension-f66fbf99.js} +7 -7
  35. package/dist/cjs/{translation-slimmer-3cd7d3b2.js → translation-slimmer-96c518cd.js} +1 -1
  36. package/dist/cjs/{type-guard-2e97fc56.js → type-guard-2c1ef8c7.js} +1 -1
  37. package/dist/cjs/{valid-credit-card-number-rule-2d7d20ce.js → valid-credit-card-number-rule-772a3763.js} +1 -1
  38. package/dist/cjs/vega-accordion.cjs.entry.js +30 -12
  39. package/dist/cjs/vega-app-footer.cjs.entry.js +1 -1
  40. package/dist/cjs/vega-app-header-button.cjs.entry.js +12 -12
  41. package/dist/cjs/vega-backdrop.cjs.entry.js +1 -1
  42. package/dist/cjs/vega-banner.cjs.entry.js +6 -6
  43. package/dist/cjs/vega-bar-chart.cjs.entry.js +1 -1
  44. package/dist/cjs/vega-box.cjs.entry.js +9 -9
  45. package/dist/cjs/vega-brand-logo.cjs.entry.js +4 -4
  46. package/dist/cjs/vega-breadcrumb.cjs.entry.js +4 -4
  47. package/dist/cjs/vega-button-circle.cjs.entry.js +9 -9
  48. package/dist/cjs/vega-button-group_2.cjs.entry.js +4 -4
  49. package/dist/cjs/vega-button-link.cjs.entry.js +4 -4
  50. package/dist/cjs/vega-button.cjs.entry.js +7 -7
  51. package/dist/cjs/vega-calendar_4.cjs.entry.js +11 -11
  52. package/dist/cjs/vega-card.cjs.entry.js +8 -8
  53. package/dist/cjs/vega-carousel.cjs.entry.js +6 -6
  54. package/dist/cjs/vega-checkbox_2.cjs.entry.js +6 -6
  55. package/dist/cjs/vega-chip.cjs.entry.js +9 -9
  56. package/dist/cjs/vega-code-block.cjs.entry.js +15 -15
  57. package/dist/cjs/vega-color-picker.cjs.entry.js +3 -3
  58. package/dist/cjs/vega-color-swatch-picker.cjs.entry.js +10 -10
  59. package/dist/cjs/vega-color-swatch.cjs.entry.js +3 -3
  60. package/dist/cjs/vega-combo-box.cjs.entry.js +9 -9
  61. package/dist/cjs/vega-counter-badge.cjs.entry.js +1 -1
  62. package/dist/cjs/vega-date-picker_2.cjs.entry.js +20 -20
  63. package/dist/cjs/{vega-dialog-controller-03ef4d9a.js → vega-dialog-controller-6df7825e.js} +1 -1
  64. package/dist/cjs/vega-dialog_2.cjs.entry.js +7 -7
  65. package/dist/cjs/vega-divider.cjs.entry.js +8 -8
  66. package/dist/cjs/vega-dropdown_5.cjs.entry.js +11 -11
  67. package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
  68. package/dist/cjs/vega-field-error.cjs.entry.js +1 -1
  69. package/dist/cjs/vega-field-label.cjs.entry.js +1 -1
  70. package/dist/cjs/vega-file-uploader.cjs.entry.js +7 -7
  71. package/dist/cjs/vega-flag-icon.cjs.entry.js +11 -11
  72. package/dist/cjs/vega-flex.cjs.entry.js +9 -9
  73. package/dist/cjs/vega-font.cjs.entry.js +8 -8
  74. package/dist/cjs/vega-form.cjs.entry.js +7 -7
  75. package/dist/cjs/vega-grid.cjs.entry.js +8 -8
  76. package/dist/cjs/vega-hint.cjs.entry.js +1 -1
  77. package/dist/cjs/vega-icon.cjs.entry.js +10 -10
  78. package/dist/cjs/vega-image-uploader.cjs.entry.js +11 -11
  79. package/dist/cjs/vega-input-credit-card.cjs.entry.js +13 -13
  80. package/dist/cjs/vega-input-numeric.cjs.entry.js +9 -9
  81. package/dist/cjs/vega-input-passcode.cjs.entry.js +9 -9
  82. package/dist/cjs/vega-input-phone-number.cjs.entry.js +11 -11
  83. package/dist/cjs/vega-input-range.cjs.entry.js +7 -7
  84. package/dist/cjs/vega-input-select.cjs.entry.js +12 -12
  85. package/dist/cjs/vega-input.cjs.entry.js +10 -10
  86. package/dist/cjs/vega-item-toggle.cjs.entry.js +1 -1
  87. package/dist/cjs/vega-left-nav_5.cjs.entry.js +13 -13
  88. package/dist/cjs/vega-line-chart.cjs.entry.js +2 -2
  89. package/dist/cjs/vega-loader-wrapper_2.cjs.entry.js +6 -6
  90. package/dist/cjs/vega-page-notification_2.cjs.entry.js +1 -1
  91. package/dist/cjs/vega-pagination-page-selector-mobile.cjs.entry.js +4 -4
  92. package/dist/cjs/vega-pagination-page-size-selector-mobile.cjs.entry.js +3 -3
  93. package/dist/cjs/vega-pagination.cjs.entry.js +8 -8
  94. package/dist/cjs/vega-pie-chart.cjs.entry.js +1 -1
  95. package/dist/cjs/vega-popover_2.cjs.entry.js +11 -11
  96. package/dist/cjs/vega-progress-tracker_2.cjs.entry.js +6 -6
  97. package/dist/cjs/vega-radio_2.cjs.entry.js +9 -9
  98. package/dist/cjs/vega-rich-text-content.cjs.entry.js +9 -9
  99. package/dist/cjs/vega-rich-text-editor_4.cjs.entry.js +19 -19
  100. package/dist/cjs/vega-rich-text-table-properties_3.cjs.entry.js +15 -15
  101. package/dist/cjs/vega-section-title.cjs.entry.js +1 -1
  102. package/dist/cjs/vega-segment-control.cjs.entry.js +1 -1
  103. package/dist/cjs/vega-selection-chip_2.cjs.entry.js +8 -8
  104. package/dist/cjs/vega-selection-tile_2.cjs.entry.js +6 -6
  105. package/dist/cjs/vega-sidenav_3.cjs.entry.js +9 -9
  106. package/dist/cjs/vega-signature-capture.cjs.entry.js +13 -13
  107. package/dist/cjs/vega-skeleton.cjs.entry.js +1 -1
  108. package/dist/cjs/vega-slot-container.cjs.entry.js +1 -1
  109. package/dist/cjs/vega-stepper.cjs.entry.js +6 -6
  110. package/dist/cjs/vega-tab-group_2.cjs.entry.js +4 -4
  111. package/dist/cjs/vega-table_11.cjs.entry.js +11 -11
  112. package/dist/cjs/vega-text.cjs.entry.js +1 -1
  113. package/dist/cjs/vega-textarea.cjs.entry.js +6 -6
  114. package/dist/cjs/vega-time-picker_2.cjs.entry.js +13 -13
  115. package/dist/cjs/vega-toggle-switch.cjs.entry.js +3 -3
  116. package/dist/cjs/vega-tooltip_2.cjs.entry.js +9 -9
  117. package/dist/cjs/vega.cjs.js +14 -14
  118. package/dist/collection/components/vega-accordion/slimmers/vega-accordion-renderer.js +14 -1
  119. package/dist/collection/components/vega-accordion/vega-accordion.js +5 -0
  120. package/dist/collection/global/scripts/before-vega-load.js +1 -1
  121. package/dist/collection/helpers/feature-control/feature-flag-controller.js +1 -1
  122. package/dist/collection/helpers/slimmers/component-usage-runtime-metrics.js +1 -1
  123. package/dist/collection/helpers/slimmers/runtime-metrics/public-api-runtime-metrics-slimmer-base.js +1 -1
  124. package/dist/collection/helpers/translation/locales/en.js +4 -0
  125. package/dist/collection/polyfill/d3/d3-time-format-polyfill.js +1 -1
  126. package/dist/esm/{app-globals-c5b58e3c.js → app-globals-265fcdbc.js} +11 -11
  127. package/dist/esm/{child-nodes-event-prevent-slimmer-75f93d85.js → child-nodes-event-prevent-slimmer-a1266ec2.js} +1 -1
  128. package/dist/esm/{code-block-3af53bbb.js → code-block-f9e55f6c.js} +1 -1
  129. package/dist/esm/{component-usage-runtime-metrics-46020a03.js → component-usage-runtime-metrics-4b1afd04.js} +1 -1
  130. package/dist/esm/{component-value-history-controller-slimmer.abstract-7f35b770.js → component-value-history-controller-slimmer.abstract-27448796.js} +3 -3
  131. package/dist/esm/{content-state-b3d319b4.js → content-state-8cf47f00.js} +2 -2
  132. package/dist/esm/{create-public-api-runtime-metrics-slimmer-aaadaa08.js → create-public-api-runtime-metrics-slimmer-da6615bf.js} +1 -1
  133. package/dist/esm/{date-required-rule-a84c21d4.js → date-required-rule-8c4c975c.js} +1 -1
  134. package/dist/esm/{design-token-57de4f4f.js → design-token-d0627261.js} +3 -3
  135. package/dist/esm/{element-appender-slimmer-b20308aa.js → element-appender-slimmer-fcb459a0.js} +3 -3
  136. package/dist/esm/{feature-flag-controller-30f7b625.js → feature-flag-controller-5ebc0cec.js} +1 -1
  137. package/dist/esm/{form-field-controller-slimmer-4c1976c9.js → form-field-controller-slimmer-18bbfc1a.js} +1 -1
  138. package/dist/esm/{icon-manager-539d7cf7.js → icon-manager-691c8682.js} +1 -1
  139. package/dist/esm/{image-annotation-action-0287d7f6.js → image-annotation-action-d43ab271.js} +3 -3
  140. package/dist/esm/index.js +20 -20
  141. package/dist/esm/{inject-keyboard-manager-2ec31cf2.js → inject-keyboard-manager-af4ae60e.js} +1 -1
  142. package/dist/esm/{internal-icon-manager-bd80b3bb.js → internal-icon-manager-276f968f.js} +1 -1
  143. package/dist/esm/{internal-translation-controller-d7dee4a0.js → internal-translation-controller-18b9070e.js} +4 -0
  144. package/dist/esm/{keyboard-manager-394883fe.js → keyboard-manager-0c6ad52a.js} +1 -1
  145. package/dist/esm/{keyboard-manager-slimmer-71d1c602.js → keyboard-manager-slimmer-1479c490.js} +1 -1
  146. package/dist/esm/loader.js +14 -14
  147. package/dist/esm/{month-view-generator-70c597a6.js → month-view-generator-f8aac785.js} +1 -1
  148. package/dist/esm/{public-rules-ae0099c8.js → public-rules-413db36c.js} +7 -7
  149. package/dist/esm/{range-dfb5388f.js → range-6be16f3a.js} +1 -1
  150. package/dist/esm/{responsive-format-facade-456a9f16.js → responsive-format-facade-c0801780.js} +2 -2
  151. package/dist/esm/{rich-text-editor-required-rule-cfc7aef8.js → rich-text-editor-required-rule-99260118.js} +1 -1
  152. package/dist/esm/{split-cell-operation-8045ac1d.js → split-cell-operation-a144ff33.js} +4 -4
  153. package/dist/esm/{state-border-formatter-afac8d33.js → state-border-formatter-39a4831a.js} +1 -1
  154. package/dist/esm/{string-format-strategy.abstract-f9907969.js → string-format-strategy.abstract-0125337f.js} +1 -1
  155. package/dist/esm/{string-input-formatter-slimmer-27ef1fc6.js → string-input-formatter-slimmer-17ddd6c8.js} +1 -1
  156. package/dist/esm/{string-mask-strategy-5f655300.js → string-mask-strategy-a7384963.js} +2 -2
  157. package/dist/esm/{style-formatter-ee52d8d0.js → style-formatter-80825302.js} +2 -2
  158. package/dist/esm/{time-required-rule-db873c19.js → time-required-rule-23692991.js} +1 -1
  159. package/dist/esm/{token-extension-3c07558d.js → token-extension-2b778fdf.js} +7 -7
  160. package/dist/esm/{translation-slimmer-5e2bff5f.js → translation-slimmer-daf97b4b.js} +1 -1
  161. package/dist/esm/{type-guard-adc244fd.js → type-guard-78c4233f.js} +1 -1
  162. package/dist/esm/{valid-credit-card-number-rule-a826dd49.js → valid-credit-card-number-rule-3fdaa507.js} +1 -1
  163. package/dist/esm/vega-accordion.entry.js +30 -12
  164. package/dist/esm/vega-app-footer.entry.js +1 -1
  165. package/dist/esm/vega-app-header-button.entry.js +12 -12
  166. package/dist/esm/vega-backdrop.entry.js +1 -1
  167. package/dist/esm/vega-banner.entry.js +6 -6
  168. package/dist/esm/vega-bar-chart.entry.js +1 -1
  169. package/dist/esm/vega-box.entry.js +9 -9
  170. package/dist/esm/vega-brand-logo.entry.js +4 -4
  171. package/dist/esm/vega-breadcrumb.entry.js +4 -4
  172. package/dist/esm/vega-button-circle.entry.js +9 -9
  173. package/dist/esm/vega-button-group_2.entry.js +4 -4
  174. package/dist/esm/vega-button-link.entry.js +4 -4
  175. package/dist/esm/vega-button.entry.js +7 -7
  176. package/dist/esm/vega-calendar_4.entry.js +11 -11
  177. package/dist/esm/vega-card.entry.js +8 -8
  178. package/dist/esm/vega-carousel.entry.js +6 -6
  179. package/dist/esm/vega-checkbox_2.entry.js +6 -6
  180. package/dist/esm/vega-chip.entry.js +9 -9
  181. package/dist/esm/vega-code-block.entry.js +15 -15
  182. package/dist/esm/vega-color-picker.entry.js +3 -3
  183. package/dist/esm/vega-color-swatch-picker.entry.js +10 -10
  184. package/dist/esm/vega-color-swatch.entry.js +3 -3
  185. package/dist/esm/vega-combo-box.entry.js +9 -9
  186. package/dist/esm/vega-counter-badge.entry.js +1 -1
  187. package/dist/esm/vega-date-picker_2.entry.js +20 -20
  188. package/dist/esm/{vega-dialog-controller-bbb2fc52.js → vega-dialog-controller-389e7f7c.js} +1 -1
  189. package/dist/esm/vega-dialog_2.entry.js +7 -7
  190. package/dist/esm/vega-divider.entry.js +8 -8
  191. package/dist/esm/vega-dropdown_5.entry.js +11 -11
  192. package/dist/esm/vega-env-manager-8f8dc473.js +2 -2
  193. package/dist/esm/vega-field-error.entry.js +1 -1
  194. package/dist/esm/vega-field-label.entry.js +1 -1
  195. package/dist/esm/vega-file-uploader.entry.js +7 -7
  196. package/dist/esm/vega-flag-icon.entry.js +11 -11
  197. package/dist/esm/vega-flex.entry.js +9 -9
  198. package/dist/esm/vega-font.entry.js +8 -8
  199. package/dist/esm/vega-form.entry.js +7 -7
  200. package/dist/esm/vega-grid.entry.js +8 -8
  201. package/dist/esm/vega-hint.entry.js +1 -1
  202. package/dist/esm/vega-icon.entry.js +10 -10
  203. package/dist/esm/vega-image-uploader.entry.js +11 -11
  204. package/dist/esm/vega-input-credit-card.entry.js +13 -13
  205. package/dist/esm/vega-input-numeric.entry.js +9 -9
  206. package/dist/esm/vega-input-passcode.entry.js +9 -9
  207. package/dist/esm/vega-input-phone-number.entry.js +11 -11
  208. package/dist/esm/vega-input-range.entry.js +7 -7
  209. package/dist/esm/vega-input-select.entry.js +12 -12
  210. package/dist/esm/vega-input.entry.js +10 -10
  211. package/dist/esm/vega-item-toggle.entry.js +1 -1
  212. package/dist/esm/vega-left-nav_5.entry.js +13 -13
  213. package/dist/esm/vega-line-chart.entry.js +2 -2
  214. package/dist/esm/vega-loader-wrapper_2.entry.js +6 -6
  215. package/dist/esm/vega-page-notification_2.entry.js +1 -1
  216. package/dist/esm/vega-pagination-page-selector-mobile.entry.js +4 -4
  217. package/dist/esm/vega-pagination-page-size-selector-mobile.entry.js +3 -3
  218. package/dist/esm/vega-pagination.entry.js +8 -8
  219. package/dist/esm/vega-pie-chart.entry.js +1 -1
  220. package/dist/esm/vega-popover_2.entry.js +11 -11
  221. package/dist/esm/vega-progress-tracker_2.entry.js +6 -6
  222. package/dist/esm/vega-radio_2.entry.js +9 -9
  223. package/dist/esm/vega-rich-text-content.entry.js +9 -9
  224. package/dist/esm/vega-rich-text-editor_4.entry.js +19 -19
  225. package/dist/esm/vega-rich-text-table-properties_3.entry.js +15 -15
  226. package/dist/esm/vega-section-title.entry.js +1 -1
  227. package/dist/esm/vega-segment-control.entry.js +1 -1
  228. package/dist/esm/vega-selection-chip_2.entry.js +8 -8
  229. package/dist/esm/vega-selection-tile_2.entry.js +6 -6
  230. package/dist/esm/vega-sidenav_3.entry.js +9 -9
  231. package/dist/esm/vega-signature-capture.entry.js +13 -13
  232. package/dist/esm/vega-skeleton.entry.js +1 -1
  233. package/dist/esm/vega-slot-container.entry.js +1 -1
  234. package/dist/esm/vega-stepper.entry.js +6 -6
  235. package/dist/esm/vega-tab-group_2.entry.js +4 -4
  236. package/dist/esm/vega-table_11.entry.js +11 -11
  237. package/dist/esm/vega-text.entry.js +1 -1
  238. package/dist/esm/vega-textarea.entry.js +6 -6
  239. package/dist/esm/vega-time-picker_2.entry.js +13 -13
  240. package/dist/esm/vega-toggle-switch.entry.js +3 -3
  241. package/dist/esm/vega-tooltip_2.entry.js +9 -9
  242. package/dist/esm/vega.js +14 -14
  243. package/dist/sri/vega-sri-manifest.json +380 -380
  244. package/dist/types/components/vega-accordion/slimmers/vega-accordion-renderer.d.ts +2 -0
  245. package/dist/types/components/vega-accordion/vega-accordion.d.ts +2 -0
  246. package/dist/types/helpers/translation/interface.d.ts +4 -0
  247. package/dist/vega/index.esm.js +1 -1
  248. package/dist/vega/{p-c95dbf11.js → p-0177417f.js} +1 -1
  249. package/dist/vega/{p-d8180e42.entry.js → p-018756ad.entry.js} +1 -1
  250. package/dist/vega/{p-becddd0b.js → p-028329be.js} +1 -1
  251. package/dist/vega/{p-97f9ad6c.js → p-047d7881.js} +1 -1
  252. package/dist/vega/{p-a3e40e66.entry.js → p-05140666.entry.js} +1 -1
  253. package/dist/vega/{p-7931e6e6.entry.js → p-073d8581.entry.js} +1 -1
  254. package/dist/vega/{p-87ddb52c.entry.js → p-09af8a35.entry.js} +1 -1
  255. package/dist/vega/p-0fc93a05.js +1 -0
  256. package/dist/vega/{p-91f82047.entry.js → p-1163a68c.entry.js} +1 -1
  257. package/dist/vega/{p-63b585de.entry.js → p-11757645.entry.js} +1 -1
  258. package/dist/vega/{p-2c1a85dd.entry.js → p-1250b1ab.entry.js} +1 -1
  259. package/dist/vega/{p-8283bf6e.entry.js → p-1663d2ac.entry.js} +1 -1
  260. package/dist/vega/{p-e6adf829.js → p-1704ff25.js} +1 -1
  261. package/dist/vega/{p-e4fdccb9.entry.js → p-1868d138.entry.js} +1 -1
  262. package/dist/vega/{p-0bb0b521.entry.js → p-1960a4f9.entry.js} +1 -1
  263. package/dist/vega/{p-2c8a205d.js → p-1aee9480.js} +1 -1
  264. package/dist/vega/{p-21919f19.entry.js → p-1b2e4a2d.entry.js} +1 -1
  265. package/dist/vega/{p-a46e977b.entry.js → p-1be90bab.entry.js} +1 -1
  266. package/dist/vega/{p-1a869f0e.js → p-1c5bf527.js} +1 -1
  267. package/dist/vega/{p-758f9809.entry.js → p-1e3ecefb.entry.js} +1 -1
  268. package/dist/vega/{p-cfede0b1.entry.js → p-200aa886.entry.js} +1 -1
  269. package/dist/vega/{p-e703a770.entry.js → p-23d881c0.entry.js} +1 -1
  270. package/dist/vega/{p-e4c4ea35.js → p-25983017.js} +1 -1
  271. package/dist/vega/{p-2d9ac3d7.entry.js → p-272308f0.entry.js} +1 -1
  272. package/dist/vega/{p-a4cdcdcf.entry.js → p-2852823c.entry.js} +1 -1
  273. package/dist/vega/{p-75636420.entry.js → p-2880b48c.entry.js} +1 -1
  274. package/dist/vega/{p-089ad8ac.entry.js → p-2fe20901.entry.js} +1 -1
  275. package/dist/vega/{p-ecbcbdab.entry.js → p-33cb4317.entry.js} +1 -1
  276. package/dist/vega/{p-dba16739.js → p-3432909d.js} +1 -1
  277. package/dist/vega/{p-c85e743d.js → p-34cb5cbd.js} +1 -1
  278. package/dist/vega/{p-f1eccec7.entry.js → p-35c9fca8.entry.js} +1 -1
  279. package/dist/vega/{p-b7721666.js → p-39090ec9.js} +1 -1
  280. package/dist/vega/{p-83e5600a.entry.js → p-3967fa98.entry.js} +1 -1
  281. package/dist/vega/{p-26c56c5c.entry.js → p-3a265f16.entry.js} +1 -1
  282. package/dist/vega/{p-96301146.entry.js → p-41a7aa47.entry.js} +1 -1
  283. package/dist/vega/{p-3b791b5d.js → p-43ed14c4.js} +1 -1
  284. package/dist/vega/{p-9dd58ae8.js → p-45f19787.js} +1 -1
  285. package/dist/vega/{p-3749e29b.entry.js → p-478a6229.entry.js} +1 -1
  286. package/dist/vega/{p-3b3f2e16.entry.js → p-48a182c9.entry.js} +1 -1
  287. package/dist/vega/{p-5bf3ab33.js → p-4b30ad1f.js} +1 -1
  288. package/dist/vega/{p-2b518ca7.entry.js → p-4f1a5522.entry.js} +1 -1
  289. package/dist/vega/{p-f9d33494.entry.js → p-4f91b230.entry.js} +1 -1
  290. package/dist/vega/{p-120376f6.entry.js → p-502b1318.entry.js} +1 -1
  291. package/dist/vega/{p-331c3e77.js → p-52bf9fa1.js} +1 -1
  292. package/dist/vega/{p-9aeff9b4.js → p-5302889d.js} +1 -1
  293. package/dist/vega/{p-e695657d.entry.js → p-5364c9a2.entry.js} +1 -1
  294. package/dist/vega/{p-bfafd175.entry.js → p-54de12bb.entry.js} +1 -1
  295. package/dist/vega/p-55e4e3d4.entry.js +1 -0
  296. package/dist/vega/{p-e1d2c60d.js → p-593d1a2a.js} +1 -1
  297. package/dist/vega/p-5a71d7bc.js +1 -0
  298. package/dist/vega/p-5f377954.js +1 -1
  299. package/dist/vega/p-610aace7.js +1 -0
  300. package/dist/vega/{p-dfc9f226.entry.js → p-6826ad74.entry.js} +1 -1
  301. package/dist/vega/{p-f90ec132.entry.js → p-704fdd95.entry.js} +1 -1
  302. package/dist/vega/{p-e1fbfd20.js → p-724df1f5.js} +1 -1
  303. package/dist/vega/{p-1deedff2.entry.js → p-740f3325.entry.js} +1 -1
  304. package/dist/vega/{p-264b3309.entry.js → p-76075a1c.entry.js} +1 -1
  305. package/dist/vega/{p-70cd4efd.js → p-78ca326c.js} +1 -1
  306. package/dist/vega/{p-db90512c.entry.js → p-7bc5f81e.entry.js} +1 -1
  307. package/dist/vega/{p-95681890.js → p-82e9febb.js} +1 -1
  308. package/dist/vega/{p-031c0cf7.js → p-8561537b.js} +1 -1
  309. package/dist/vega/{p-1985f011.entry.js → p-8c351b5f.entry.js} +1 -1
  310. package/dist/vega/p-8c7a9085.entry.js +1 -0
  311. package/dist/vega/{p-247308c9.entry.js → p-8ccbd291.entry.js} +1 -1
  312. package/dist/vega/p-8ce9e214.js +1 -0
  313. package/dist/vega/{p-ce5b32e8.entry.js → p-915f6e4d.entry.js} +1 -1
  314. package/dist/vega/{p-f30d8248.entry.js → p-93252b83.entry.js} +1 -1
  315. package/dist/vega/{p-5373c5e6.entry.js → p-94b085b4.entry.js} +1 -1
  316. package/dist/vega/{p-202207a2.entry.js → p-983dfd1d.entry.js} +1 -1
  317. package/dist/vega/{p-1a6f0a51.js → p-98b77a21.js} +1 -1
  318. package/dist/vega/p-9a6bd32c.js +1 -0
  319. package/dist/vega/p-9e0f8b46.entry.js +1 -0
  320. package/dist/vega/{p-34964a53.js → p-a1b0b94f.js} +1 -1
  321. package/dist/vega/{p-f89d14c9.entry.js → p-a44a9a1b.entry.js} +1 -1
  322. package/dist/vega/{p-d7ef3516.entry.js → p-a6022174.entry.js} +1 -1
  323. package/dist/vega/{p-45aaaef6.entry.js → p-a94bffca.entry.js} +1 -1
  324. package/dist/vega/{p-7f46cc1e.entry.js → p-adc64ff6.entry.js} +1 -1
  325. package/dist/vega/{p-5c54bb05.entry.js → p-b340a890.entry.js} +1 -1
  326. package/dist/vega/{p-98e2c103.entry.js → p-b36dc726.entry.js} +1 -1
  327. package/dist/vega/p-b4bcc41c.entry.js +1 -0
  328. package/dist/vega/{p-c801c85d.js → p-b6be1f33.js} +1 -1
  329. package/dist/vega/{p-57edff7d.entry.js → p-b7ecd62d.entry.js} +1 -1
  330. package/dist/vega/{p-d564ff1e.entry.js → p-b8fc5f38.entry.js} +1 -1
  331. package/dist/vega/{p-0b4880bd.entry.js → p-be783294.entry.js} +1 -1
  332. package/dist/vega/{p-57f220b5.js → p-c0a4f6d0.js} +1 -1
  333. package/dist/vega/{p-12bd4bab.entry.js → p-c44cc5f0.entry.js} +1 -1
  334. package/dist/vega/p-c4e71db7.js +1 -0
  335. package/dist/vega/{p-3cea9c0f.entry.js → p-cbb78c3d.entry.js} +1 -1
  336. package/dist/vega/{p-b042c46d.entry.js → p-d1f19c20.entry.js} +1 -1
  337. package/dist/vega/{p-dc965280.entry.js → p-d4367e80.entry.js} +1 -1
  338. package/dist/vega/{p-b208a7cb.entry.js → p-d750c93a.entry.js} +1 -1
  339. package/dist/vega/{p-33a6a38d.entry.js → p-d78f3135.entry.js} +1 -1
  340. package/dist/vega/{p-a8a34c79.entry.js → p-d8d76aca.entry.js} +1 -1
  341. package/dist/vega/{p-13330f58.js → p-d8e1d97d.js} +1 -1
  342. package/dist/vega/{p-18e8d9b7.js → p-dcf162e9.js} +1 -1
  343. package/dist/vega/{p-3f854e0a.entry.js → p-de6d28b7.entry.js} +1 -1
  344. package/dist/vega/{p-89b2a865.entry.js → p-e01d5ee1.entry.js} +1 -1
  345. package/dist/vega/{p-0ef6ceee.entry.js → p-e234d51a.entry.js} +1 -1
  346. package/dist/vega/{p-0be4fe08.entry.js → p-e334dc8a.entry.js} +1 -1
  347. package/dist/vega/p-e5226de6.entry.js +1 -0
  348. package/dist/vega/{p-99d05b8f.entry.js → p-ea0b1a77.entry.js} +1 -1
  349. package/dist/vega/{p-0adb76a2.entry.js → p-eb78a2f2.entry.js} +1 -1
  350. package/dist/vega/{p-e27626f6.js → p-eca16761.js} +1 -1
  351. package/dist/vega/{p-4c210e31.entry.js → p-eee880c2.entry.js} +1 -1
  352. package/dist/vega/{p-801ee68b.js → p-f39bd4b1.js} +1 -1
  353. package/dist/vega/{p-9f99a5d7.entry.js → p-f8077fbd.entry.js} +1 -1
  354. package/dist/vega/{p-2946f85e.entry.js → p-f8e617fd.entry.js} +1 -1
  355. package/dist/vega/{p-b6d7faa2.entry.js → p-fbcfdeb5.entry.js} +1 -1
  356. package/dist/vega/{p-60c7ed92.entry.js → p-fd8c9a92.entry.js} +1 -1
  357. package/dist/vega/{p-f235be72.js → p-fda81c61.js} +1 -1
  358. package/dist/vega/{p-295326ca.entry.js → p-fe220f3a.entry.js} +1 -1
  359. package/dist/vega/p-feb6718c.entry.js +1 -0
  360. package/dist/vega/{p-115d6053.entry.js → p-ff5208f5.entry.js} +1 -1
  361. package/dist/vega/{p-b2df5cb1.js → p-ffc58d14.js} +1 -1
  362. package/dist/vega/vega.esm.js +1 -1
  363. package/package.json +4 -4
  364. package/dist/vega/p-329541e0.js +0 -1
  365. package/dist/vega/p-358b4a06.entry.js +0 -1
  366. package/dist/vega/p-3f566d54.js +0 -1
  367. package/dist/vega/p-4415ad28.js +0 -1
  368. package/dist/vega/p-51fcb07f.entry.js +0 -1
  369. package/dist/vega/p-593e0f80.js +0 -1
  370. package/dist/vega/p-7b7a70b5.entry.js +0 -1
  371. package/dist/vega/p-9f728e0b.js +0 -1
  372. package/dist/vega/p-dbdc9e35.js +0 -1
  373. package/dist/vega/p-ef44af22.entry.js +0 -1
  374. package/dist/vega/p-f0388529.entry.js +0 -1
  375. package/dist/vega/p-fa17fe93.entry.js +0 -1
  376. /package/dist/cjs/{index-f054eb5d.js → index-3ca118c4.js} +0 -0
  377. /package/dist/esm/{index-bfc6dfa2.js → index-9c9865c0.js} +0 -0
  378. /package/dist/vega/{p-5a25014f.js → p-982747ef.js} +0 -0
@@ -1 +1 @@
1
- import{C as t}from"./p-2d0d575f.js";import{d as e}from"./p-11e2dcf5.js";import{d as s,e as n}from"./p-6c43d54a.js";import{d as r,c as i}from"./p-02841589.js";import{L as o}from"./p-6e1ab235.js";import{i as c}from"./p-e4c4ea35.js";import{T as a}from"./p-d884c644.js";import{g as l}from"./p-8b5d3a52.js";import{V as h}from"./p-8aee6b74.js";import{c as u}from"./p-a841cf13.js";import{f as d}from"./p-ec2a1d4c.js";var p,f;!function(t){t.SELECTION_RANGE="SELECTION_RANGE",t.CLEAR_FORMATTING="CLEAR_FORMATTING",t.LINK_GROUP="LINK_GROUP"}(p||(p={}));class T{}!function(t){t.ALIGNMENT="ALIGNMENT",t.TEXT_STYLE="TEXT_STYLE",t.INDENT="INDENT",t.LIST="LIST",t.INTERNAL_WRAPPER="INTERNAL_WRAPPER"}(f||(f={}));class E extends T{}const g=new class{constructor(){this.domToEntity=new WeakMap,this.entityToDOM=new WeakMap,this.contentEntityToRootDom=new Map,this.rootDomToContentEntity=new WeakMap}register(t,e){this.isVegaRTEContent(e)?this.registerRootDomAndContentEntity(t,e):(this.domToEntity.set(t,e),this.entityToDOM.set(e,t))}getEntityByDOM(t){return this.domToEntity.get(t)}getDOMByEntity(t){return this.isVegaRTEContent(t)?this.contentEntityToRootDom.get(t):this.entityToDOM.get(t)}removeDirtyDomRef(t){this.domToEntity.delete(t)}registerRootDomAndContentEntity(t,e){const s=this.rootDomToContentEntity.get(t);s&&s!==e&&this.contentEntityToRootDom.delete(s),this.rootDomToContentEntity.set(t,e),this.contentEntityToRootDom.set(e,t)}isVegaRTEContent(t){return t&&"VegaRTEContent"===t.constructor.name}};var x,w,A,O;!function(t){t.DELETE_CHILDREN="DELETE_CHILDREN",t.DELETE_NEST_LIST="DELETE_NEST_LIST",t.UPDATE_TEXT="UPDATE_TEXT",t.REPLACE_SELECTED_TEXT="REPLACE_SELECTED_TEXT",t.APPEND_CHILDREN="APPEND_CHILDREN",t.INSERT_CHILDREN_AFTER="INSERT_CHILDREN_AFTER",t.INSERT_CHILDREN_BEFORE="INSERT_CHILDREN_BEFORE",t.SPLIT_BLOCK_WITH_NODE="SPLIT_BLOCK_WITH_NODE",t.REPLACE_CHILD_NODES="REPLACE_CHILD_NODES",t.REPLACE_NEST_LIST="REPLACE_NEST_LIST",t.MERGE_TWO_BLOCKS_NODES="MERGE_TWO_BLOCKS_NODES",t.INSERT_NEW_PARAGRAPH="INSERT_NEW_PARAGRAPH",t.LINE_BREAK_SINGLE_BLOCK="LINE_BREAK_SINGLE_BLOCK",t.LINE_BREAK_MULTIPLE_BLOCKS="LINE_BREAK_MULTIPLE_BLOCKS",t.TRANSFORM_LIST_BLOCK="TRANSFORM_LIST_BLOCK",t.TRANSFORM_PARAGRAPH_BLOCK="TRANSFORM_PARAGRAPH_BLOCK",t.DELETE_BLOCK_CONTENT="DELETE_BLOCK_CONTENT",t.INSERT_IMAGE_TO_BLOCK="INSERT_IMAGE_TO_BLOCK",t.UPDATE_IMAGE_NODE_URL="UPDATE_IMAGE_NODE_URL",t.TRANSFORM_TO_CODE_BLOCK="TRANSFORM_TO_CODE_BLOCK",t.UPDATE_CODE_BLOCK="UPDATE_CODE_BLOCK",t.SWITCH_OUT_FROM_CODE_BLOCK="SWITCH_OUT_FROM_CODE_BLOCK",t.DELETE_CODE_BLOCK="DELETE_CODE_BLOCK",t.UNLINK_LINK_GROUP="UNLINK_LINK_GROUP",t.LINK_GROUP_NODE_SPLIT="LINK_GROUP_NODE_SPLIT",t.DELETE_LINK_GROUP="DELETE_LINK_GROUP",t.UPDATE_CURSOR_POSITION="UPDATE_CURSOR_POSITION",t.INSERT_TEXT_TO_DECORATOR_NODE="INSERT_TEXT_TO_DECORATOR_NODE",t.INSERT_NODE_TO_NEAREST_ROOT="INSERT_NODE_TO_NEAREST_ROOT",t.PASTE_CONTENT="PASTE_CONTENT"}(x||(x={}));class y{constructor(){this.isFlushable=!1}}function m(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 N{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=m(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`${`.${N.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]))}}N.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"}(w||(w={}));class R extends T{}class S{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.constructor.name)&&!!t.getAnnotationByType(w.LINK)}static isCodeNode(t){if(this.isTextNode(t.constructor.name)){const e=t.getAnnotationByType(w.CODE);return!!e&&e.code}return!1}static isImageNode(t){return"RTEImageNode"===t.constructor.name}static isCodeBlockNode(t){return"RTECodeBlockNode"===t.constructor.name}}S.RTE_TEXT_NODE_CLASS_NAME="RTETextNode",S.RTE_TEXT_BLOCK_CLASS_NAME="RTETextBlock";class C extends N{constructor(){super(...arguments),this.stylesToBeFiltered=b.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 S.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 b extends T{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 b("");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=b.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,b.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(" ")}}b.linkGroupFilterStylesStrategy=new C;class k extends E{constructor(t){super(),this.type=f.ALIGNMENT,this.textAlign=t}static from(t){return[f.ALIGNMENT,new k(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 k(this.textAlign)}renderStyle(t){return(null==t?void 0:t.standalone)?k.getDefaultStyles(this.textAlign):null}}class v extends E{constructor(t){super(),this.type=f.INDENT,this.indent=Math.max(0,t)}static from(t){return[f.INDENT,new v(t)]}toJSON(){return this.indent>0?{indent:this.indent}:null}clone(){return new v(this.indent)}renderClass(){return null}renderStyle(){return this.indent>0?{marginLeft:16*this.indent+"px"}:null}}class B{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 y?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)))}}}B.registry=new Map;class j{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=B.get(t,e),n=()=>{const s=t instanceof y?t.type:t.constructor.name,n=j.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!!j.get(t,e.constructor.name)}}j.registry=new Map,function(t){t.CUSTOM_ATTRIBUTE="CUSTOM_ATTRIBUTE",t.CUSTOM_CLASS="CUSTOM_CLASS",t.CUSTOM_STYLE="CUSTOM_STYLE"}(A||(A={}));class _ extends T{}class $ extends _{constructor(t){super(),this.type=A.CUSTOM_ATTRIBUTE,this.BOOLEAN_ATTRS=new Set(["controls","disabled","checked","readonly","multiple","required","autoplay","muted"]),this.customAttribute=t}static from(t){return[A.CUSTOM_ATTRIBUTE,new $(t)]}toJSON(){return{customAttribute:this.customAttribute}}clone(){return new $(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(c)}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 L extends _{constructor(t){super(),this.type=A.CUSTOM_CLASS,this.customClass=t}static from(t){return[A.CUSTOM_CLASS,new L(t)]}toJSON(){return{customClass:this.customClass}}clone(){return new L(this.customClass)}toString(){return`class="${this.customClass.join(" ")}"`}renderClass(){return this.customClass}}class D extends _{constructor(t){super(),this.type=A.CUSTOM_STYLE,this.customStyle=t}static from(t){return[A.CUSTOM_STYLE,new D(t)]}toJSON(){return{customStyle:this.customStyle}}clone(){return new D(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 I extends E{constructor(t){super(),this.type=f.INTERNAL_WRAPPER,this.internalWrapper=t}static from(t){return[f.INTERNAL_WRAPPER,new I(t)]}clone(){return new I(this.internalWrapper)}renderClass(){}renderStyle(){}toJSON(){return this.internalWrapper?{internalWrapper:this.internalWrapper}:void 0}}class M{constructor(t){this.dtoType=t instanceof RTEBlock?"block":"node",this.annotationMap=t.annotationMap}toCssText(t={standalone:!1},e,s){return s=s||this.toJSON(t,e),Object.entries(Object.assign({},s)).map((([t,e])=>`${i(t)}: ${e};`)).join("")}toJSON(t={standalone:!1},e){const s=Array.from(this.annotationMap.values()).filter((t=>this.filterAnnotation(t)||t instanceof D)).map((e=>e.renderStyle(t))).filter(c);return e&&e.length>0?this.mergeAnnotationStyles(s,e):s.reduce(((t,e)=>Object.assign(Object.assign({},t),e)),{})}filterAnnotation(t){return"block"===this.dtoType?t instanceof E:t instanceof R}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.constructor.name).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(a).map((t=>`@import url('${a[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"}(O||(O={}));class RTENode{constructor(t,e){this.annotationMap=new Map,this.id=t,e&&(this.annotationMap=e)}static from(t,e,s){throw new Error(`[Vega] ${this.constructor.name}.from(${JSON.stringify(t)}, ${e}, ${s}) is not implemented. Please implement this method in the subclass.`)}static createAnnotationEntity(t,e){switch(t){case"customAttribute":return $.from(e);case"customClass":return L.from(e);case"customStyle":return D.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 R||t instanceof L)).map((e=>e.renderClass(t))).filter(c).reduce(((t,e)=>[t,e].join(" ").trim()),"")}getCustomAttributesAnnotation(){return this.annotationMap.get(A.CUSTOM_ATTRIBUTE)}isTextNode(){return!1}getElementRef(){return g.getDOMByEntity(this)}generateAttributeString(t,...e){var s;const n=new M(this),r=n.toJSON({standalone:!0},["textDecoration"]),i=this.annotationMap.get(A.CUSTOM_CLASS);let o=r,a=null==i?void 0:i.renderClass();if(t&&t.filterInlineStyles){const t=F.executeTheStrategyFilterAction(this,r,a);o=t.styles,a=t.classNames}const l=[...(null===(s=this.getCustomAttributesAnnotation())||void 0===s?void 0:s.toString(e))||[],a&&a.length>0?`class="${a.join(" ")}"`:null,o&&Object.keys(o).length>0?`style="${n.toCssText({standalone:!0},void 0,o)}"`:null,...e].filter(c);return l.length?` ${l.join(" ")}`:""}doApply(t){t instanceof y?this.doModifyActionApply(t):this.doAnnotationActionApply(t)}flushChange(){const n=g.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 H=new class{constructor(){this.RTE_BLOCK_DTO_CLASS_MAP=new Map,this.RTE_NODE_DTO_CLASS_MAP=new Map}registerRTEDTOClass(t,e){if(e.prototype instanceof RTEBlock)this.RTE_BLOCK_DTO_CLASS_MAP.set(t,e);else{if(!(e.prototype instanceof RTENode))throw new Error(`Invalid RTE DTO class type: ${t}`);this.RTE_NODE_DTO_CLASS_MAP.set(t,e)}}getRTEBlockClass(t){return this.RTE_BLOCK_DTO_CLASS_MAP.get(t)}getRTENodeClass(t){return this.RTE_NODE_DTO_CLASS_MAP.get(t)}};class RTEBlock{constructor(t){this.annotationMap=new Map,this.id=t}static from(t,e){throw new Error(`[Vega] ${this.constructor.name}.from(${JSON.stringify(t)}, ${e}) is not implemented. Please implement this method in the subclass.`)}static generateBlockChildren(t,e,s){return t.map((t=>{const n=H.getRTEBlockClass(t.type);if(n){const r=n.from(t,e);return r.parent=s,r}})).filter(c)}static createAnnotationEntity(t,e){switch(t){case"textAlign":return k.from(e);case"indent":return v.from(e);case"customAttribute":return $.from(e);case"customClass":return L.from(e);case"customStyle":return D.from(e);case"internalWrapper":return I.from(e)}}static convertAnnotationsToMap(t,e){Object.entries(e).forEach((([e,s])=>{const n=this.createAnnotationEntity(e,s);c(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 b||t instanceof I))).length}toJSON(){const t=Array.from(this.annotationMap.values()).filter((t=>t instanceof E||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=g.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 RTEBlock?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 E||t instanceof L)).map((e=>e.renderClass(t))).filter(c).reduce(((t,e)=>[t,e].join(" ").trim()),"")}getCustomAttributesAnnotation(){return this.annotationMap.get(A.CUSTOM_ATTRIBUTE)}generateAttributeString(t,...e){var s;const n=new M(this),r=n.toJSON({standalone:!0}),i=this.annotationMap.get(A.CUSTOM_CLASS);let o=r,a=null==i?void 0:i.renderClass();if(t&&t.filterInlineStyles){const t=F.executeTheStrategyFilterAction(this,r,a);o=t.styles,a=t.classNames}const l=[...(null===(s=this.getCustomAttributesAnnotation())||void 0===s?void 0:s.toString(e))||[],a&&a.length>0?`class="${a.join(" ")}"`:null,o&&Object.keys(o).length>0?`style="${n.toCssText({standalone:!0},void 0,o)}"`:null,...e].filter(c);return l.length?` ${l.join(" ")}`:""}doApply(t){t instanceof y?j.executeTheStrategy(t,this):this.applyAnnotationAction(t)}applyAnnotationAction(t){const e=t.toAnnotation();if(e instanceof b||this.annotationMap.set(e.type,e),"function"==typeof this.doAnnotationActionApply)this.doAnnotationActionApply(t);else{const e=j.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 P{}class J extends P{constructor(){super(...arguments),this.doSplit=!0}}class K extends T{constructor(t){super(),this.type=p.SELECTION_RANGE,this.range=t}clone(){return new K(this.range)}}const U="700",W="bold",G="italic",z="underline",V="line-through";class X extends R{constructor(t){super(),this.type=w.STRIKETHROUGH,this.strikethrough=t}static from(t){return[w.STRIKETHROUGH,new X(t)]}toJSON(){return{strikethrough:this.strikethrough}}clone(){return new X(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 R{constructor(t){super(),this.type=w.UNDERLINE,this.underline=t}static from(t){return[w.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 Y extends R{constructor(t){super(),this.type=w.ITALIC,this.italic=t}static from(t){return[w.ITALIC,new Y(t)]}toJSON(){return{italic:this.italic}}clone(){return new Y(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 Q extends R{constructor(t){super(),this.type=w.BOLD,this.bold=t}static from(t){return[w.BOLD,new Q(t)]}toJSON(){return{bold:this.bold}}clone(){return new Q(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 Z extends R{constructor(t,e=!0){super(),this.type=w.CODE,this.code=t,this.useInternalStyle=e}static from(t,e){return[w.CODE,new Z(t,e)]}static getDefaultStyles(){return{fontFamily:"Roboto Mono",whiteSpace:"pre-wrap"}}toJSON(){return{code:this.code}}clone(){return new Z(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?Z.getDefaultStyles():null}}const tt={key:"black",light:"#111128",dark:"#E3E3E8"},et=[tt,{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"}],st="​",nt=[{key:"title"},{key:"subtitle"},{key:"heading-1"},{key:"heading-2"},{key:"heading-3"},{key:"paragraph"}],rt=[["textStyles"],["bold","italic","underline","strikethrough","code"],["textColor"],["horizontalAlignment","bulletsNumbers"],["moreIndent","lessIndent"],["link"],["image"],["clearStyle"]],it=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);class ot extends R{constructor(t){super(),this.type=w.TEXT_COLOR,this.textColor=this.formatTextColor(t)}static from(t){return[w.TEXT_COLOR,new ot(t)]}toJSON(){return{textColor:this.textColor.key}}clone(){return new ot(this.textColor.key)}renderClass(){return null}renderStyle(){return{color:h.isDarkMode()?this.textColor.dark:this.textColor.light}}formatTextColor(t){return et.find((e=>e.key===t))||et[0]}}class ct extends R{constructor(t,e=!0){super(),this.type=w.LINK,this.link=t,this.useInternalStyle=e}static from(t,e=!0){return[w.LINK,new ct(t,e)]}toJSON(){return{link:this.link}}clone(){return new ct(this.link,this.useInternalStyle)}toEqual(t){return this.link.groupKey===t.link.groupKey}renderClass(){return null}renderStyle(){return null}}class at extends P{constructor(t,e,s){super(),this.isFlushable=!1,this.groupKey=t,this.nodes=e,this.type=s}toAnnotation(){return new b(this.groupKey)}}class lt extends P{constructor(){super(),this.isFlushable=!1}toAnnotation(){return null}}class ht{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(A.CUSTOM_STYLE);s&&this.isCustomStyle(s,e)&&t.annotationMap.set(s.type,new D(s.removeStyles(e)))}createNewParagraph(t){const e=H.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.constructor.name?e:this.getRootContent(e)}isCaretPositionAtBlockStart(t,e,s){return e===t.children[0]&&0===s}isCaretPositionAtBlockEnd(t,e,s){return e.isContentEditable()?this.isCaretPositionAtTextBlockEnd(t,e,s):this.isCaretPositionAtDecoratorBlockEnd(t,e,s)}getDOMByEntity(t){return g.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 ut extends y{constructor(t){super(),this.type=x.LINK_GROUP_NODE_SPLIT,this.splittedTextNodes=t}}class dt extends ht{constructor(){super(...arguments),this.applyTargetNode=null}handleAction(t,e){const s=e.getAnnotationByType(p.SELECTION_RANGE);if(this.setApplyTargetNode(null),t instanceof J&&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 ut(n)),n}return this.setApplyTargetNode(e),e}return t}))}return this.applyTargetNode}insertNewNode(t,e){const s=e.cloneWithText("");this.setApplyTargetNode(s);const n=e.parent.children.findIndex((t=>t===e));return 0===t||!e.isContentEditable()&&t===n?[s,e]:t===e.text.length||!e.isContentEditable()&&t===n+1?[e,s]:[e.cloneWithText(e.text.substring(0,t)),s,e.cloneWithText(e.text.substring(t))]}shouldSplitSelection(t){const{startContainer:e,endContainer:s,startOffset:n,endOffset:r}=t;return e!==s||n>0||r<(s.textContent?s.textContent.length:0)}splitTextNode(t,e){const{startContainer:s,endContainer:n,startOffset:r}=t,i=s.parentElement,o=n.parentElement,c=(t,s,n)=>{const r=t.substring(0,s),i=t.substring(s,n),o=t.substring(n);return[e.cloneWithText(r),e.cloneWithText(i),e.cloneWithText(o)]},a=i&&g.getEntityByDOM(i),l=o&&g.getEntityByDOM(o);if(a&&a.id===e.id){const i=s===n?t.endOffset:e.text.length,[o,a,l]=c(e.text,r,i);return this.setApplyTargetNode(a),[o,a,l].filter((t=>!!t.text))}if(l&&l.id===e.id){const[s,n,r]=c(e.text,0,t.endOffset);return this.setApplyTargetNode(n),[s,n,r].filter((t=>!!t.text))}return this.setApplyTargetNode(e),e}setApplyTargetNode(t){this.applyTargetNode=t}}class pt extends J{constructor(t){super(),this.isFlushable=!0,this.bold=t}toAnnotation(){return new Q(this.bold)}}class ft extends T{constructor(){super(...arguments),this.type=p.CLEAR_FORMATTING,this.items=[w.BOLD,w.ITALIC,w.UNDERLINE,w.STRIKETHROUGH,w.TEXT_COLOR,w.CODE,A.CUSTOM_STYLE]}}class Tt extends J{constructor(){super(...arguments),this.isFlushable=!0}toAnnotation(){return new ft}}class Et extends J{constructor(t){super(),this.isFlushable=!0,this.code=t}toAnnotation(){return new Z(this.code)}}class gt extends P{constructor(t){super(),this.isFlushable=!0,this.annotationType=t}toAnnotation(){}}class xt extends J{constructor(t){super(),this.isFlushable=!0,this.italic=t}toAnnotation(){return new Y(this.italic)}}class wt extends J{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,c(n)&&(this.doSplit=n)}toAnnotation(){return new ct(this.link)}}class At extends J{constructor(t){super(),this.isFlushable=!0,this.strikethrough=t}toAnnotation(){return new X(this.strikethrough)}}class Ot extends J{constructor(t){super(),this.isFlushable=!0,this.underline=t}toAnnotation(){return new q(this.underline)}}class yt extends ht{handleAction(t,e){const s=t.toAnnotation();if(t instanceof gt)e.annotationMap.delete(t.annotationType);else{if(!(s instanceof ft))return s instanceof R||s instanceof K?(t instanceof wt&&(c(t.newText)&&(e.text=t.newText),e.parent.apply(new at(t.link.groupKey,[e],t.type))),t instanceof Et&&this.handleAction(new Tt,e),t instanceof pt&&this.updateCustomStyleAnnotation(e,["fontWeight"]),t instanceof xt&&this.updateCustomStyleAnnotation(e,["fontStyle"]),(t instanceof Ot||t instanceof At)&&this.updateCustomStyleAnnotation(e,["textDecoration"]),void e.annotationMap.set(s.type,s)):void 0;s.items.forEach((t=>{e.deleteAnnotationByType(t)}))}}}class mt extends y{constructor(){super(...arguments),this.type=x.DELETE_LINK_GROUP}}class Nt extends ht{handleAction(t,e){e.text=t.newTextContent,!e.text&&e.annotationMap.has("LINK")&&e.apply(new mt)}}class Rt extends y{constructor(t){super(),this.type=x.UPDATE_TEXT,this.newTextContent="",this.newTextContent=t}}class St extends ht{handleAction(t,e){this.replaceSelectedText(t.textToBeInsert,t.currentRange,e)}replaceSelectedText(t,e,s){if(e&&e.startContainer&&e.endContainer){const{startContainer:n,endContainer:r,startOffset:i,endOffset:o}=e;let c=s.text;if(n===r&&i===o&&t)c=s.text.slice(0,i)+t+s.text.slice(i);else{const e=n.parentElement,a=r.parentElement,l=e&&g.getEntityByDOM(e),h=a&&g.getEntityByDOM(a);let u=0,d=s.text.length;l&&l===s?(u=i,d=n===r?o:d):h&&h===s&&(d=o),c=s.text.slice(0,u)+t+s.text.slice(d)}s.apply(new Rt(c))}}}class Ct extends T{constructor(t){super(),this.type=w.INLINE_HTML,this.htmlTag=t}static from(t){const{htmlTag:e,child:s,customStyle:n,customClass:r,customAttribute:i}=t,o=new Ct(e);return o.groupId=t.groupId,o.child=s?Ct.from(s)[1]:void 0,o.customAttribute=i?$.from(i)[1]:void 0,o.customClass=r?L.from(r)[1]:void 0,o.customStyle=n?D.from(n)[1]:void 0,[w.INLINE_HTML,o]}clone(){var t,e,s,n;const r=new Ct(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 bt extends ht{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 kt extends ht{handleAction(t,e){const s=e.parent.getAnnotationByType(p.LINK_GROUP);if(s){const t=e.annotationMap.get(w.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(w.LINK)}}class vt extends R{constructor(t){super(),this.type=w.PLAIN_TEXT,this.plainText=!0,this.plainText=t}static from(t){return[w.PLAIN_TEXT,new vt(t)]}clone(){return new vt(this.plainText)}renderClass(){}renderStyle(){}toJSON(){return this.plainText?{plainText:this.plainText}:void 0}}class Bt extends J{constructor(t){super(),this.isFlushable=!0,this.textColor=t}toAnnotation(){return new ot(this.textColor)}}class RTETextNode extends RTENode{constructor(t,e,s,n){super(t,n),this.type=O.TEXT,this.parent=s,this.text=e,this.registerModifyStrategy()}static supportsHtmlTag(t){return["span","code"].includes(t)}static from(t,e,s={autoMatchFormat:!0}){const n=new RTETextNode(t.id,t.text,e),{annotations:r}=t;return r&&(n.annotationMap=this.generateTextAnnotationMap(r,s,e,n)),n}static generateTextAnnotationMap(t,e,s,n){return new Map(Object.keys(t).map((r=>("link"===r&&t.link&&s&&n&&s.apply(new at(t.link.groupKey,[n],"link")),this.createAnnotationEntity(r,t[r],e)))).filter(c))}static createAnnotationEntity(t,e,s){const n=!(!s||!s.autoMatchFormat);switch(t){case"bold":return Q.from(e);case"italic":return Y.from(e);case"underline":return q.from(e);case"strikethrough":return X.from(e);case"code":return Z.from(e,n);case"textColor":return ot.from(e);case"link":return ct.from(e,n);case"inlineHtml":return Ct.from(e);case"plainText":return vt.from(e)}return RTENode.createAnnotationEntity(t,e)}toJSON(){const t=Array.from(this.annotationMap.values()).filter((t=>t instanceof R||t instanceof _||t instanceof Ct)).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(w.INLINE_HTML);return e?this.renderWithWrapperStr(e,t):this.renderTextStr(t)}cloneWithText(t){return new RTETextNode(l(),t,this.parent,super.cloneAnnotations())}clone(t){return new RTETextNode(this.id,this.text,t,super.cloneAnnotations())}isEmpty(){return!(this.getAnnotationByType(w.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?it.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(w.INLINE_HTML);for(let s=0;s<t&&e;s++)e=e.child;return e}registerModifyStrategy(){const t=this.constructor.name;RTETextNode.registerActionStrategyStatus[t]||(this.isContentEditable()&&(j.register(x.UPDATE_TEXT,t,new Nt),j.register(x.REPLACE_SELECTED_TEXT,t,new St),j.register(x.LINK_GROUP_NODE_SPLIT,t,new bt),j.register(wt.name,t,new yt)),j.register(J.name,t,new dt),j.register(x.DELETE_LINK_GROUP,t,new kt),j.register(pt.name,t,new yt),j.register(Tt.name,t,new yt),j.register(xt.name,t,new yt),j.register(Ot.name,t,new yt),j.register(Bt.name,t,new yt),j.register(At.name,t,new yt),j.register(Et.name,t,new yt),j.register(P.name,t,new yt),RTETextNode.registerActionStrategyStatus[t]=!0)}doAnnotationActionApply(t){const e=this.getAnnotationByType(p.SELECTION_RANGE);if(t instanceof J&&t.doSplit&&e){const e=j.get(J.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){j.executeTheStrategy(t,this)}applyActionToNode(t,e){const s=e.toAnnotation();if(e instanceof lt)return void this.syncUpSelectedNodes(t);s instanceof K||this.syncUpSelectedNodes(t);const n=j.get(e.constructor.name,t.constructor.name);if(n)return void n.execute(e,t);const r=j.get(P.name,RTETextNode.name);r&&r.execute(e,t)}syncUpSelectedNodes(s){const r=this.getElementRef();if(r){const i=e.getSubjectFromParentNodeByEventId(r,n);i&&t.notify(i,{node:s})}}renderWithWrapperStr(t,e){const{htmlTag:s,child:n}=t,r=this.annotationAttrStr(t);return n?`<${s}${r}>${this.renderWithWrapperStr(n,e)}</${s}>`:it.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(c);return r.length>0?` ${r.join(" ")}`:""}renderTextStr(t){var e;const s=(null===(e=this.getAnnotationByType(w.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(w.PLAIN_TEXT);return!!t&&t.plainText&&0===Array.from(this.annotationMap.values()).filter((t=>t instanceof R&&!(t instanceof ct)&&!(t instanceof vt)||t instanceof _)).length}}RTETextNode.registerActionStrategyStatus={},RTETextNode.htmlTag="span";class jt extends y{constructor(t){super(),this.type=x.APPEND_CHILDREN,this.entityToBeAppended=t}}const _t={fontFamily:"Inter",fontSize:"16px",lineHeight:"22px",minHeight:"22px",fontWeight:"500"},$t=Object.assign(Object.assign({},_t),{marginTop:"0px",marginBottom:"0px"}),Lt={paragraph:$t,title:Object.assign(Object.assign({},_t),{fontSize:"36px",lineHeight:"40px",minHeight:"40px"}),subtitle:Object.assign(Object.assign({},_t),{fontSize:"28px",lineHeight:"32px",minHeight:"32px"}),"heading-1":Object.assign(Object.assign({},$t),{fontSize:"22px",lineHeight:"24px",minHeight:"24px"}),"heading-2":Object.assign(Object.assign({},$t),{fontSize:"20px",lineHeight:"24px",minHeight:"24px"}),"heading-3":Object.assign(Object.assign({},$t),{fontSize:"18px"}),"heading-4":Object.assign({},$t),"heading-5":Object.assign(Object.assign({},$t),{fontSize:"14px"}),"heading-6":Object.assign(Object.assign({},$t),{fontSize:"12px"})};class Dt extends E{constructor(t){super(),this.type=f.TEXT_STYLE,this.textStyle=t}static from(t){return[f.TEXT_STYLE,new Dt(t)]}static getDefaultStyles(t){return t?Lt[t]:null}toJSON(){return{textStyle:this.textStyle}}clone(){return new Dt(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?Dt.getDefaultStyles(this.textStyle):null}}class It extends P{constructor(t,e){super(),this.isFlushable=!0,this.textStyle=t,this.bold=e}toAnnotation(){return new Dt(this.textStyle)}}class Mt extends ht{handleAction(t,e){"list-item"!==e.type&&(e.type=t.textStyle),e.children.forEach(t.bold?t=>{const e=new pt(!0);e.doSplit=!1,t.apply(e)}:t=>{t.apply(new gt(w.BOLD))}),this.updateCustomStyleAnnotation(e,["fontFamily","lineHeight","fontWeight","fontSize"])}}class Ft extends y{constructor(t,...e){super(),this.type=x.INSERT_CHILDREN_AFTER,this.referChildren=t,this.childrenToBeInserted=e}}class Ht extends y{constructor(t){super(),this.type=x.REPLACE_CHILD_NODES,this.newChildNodes=t}}class Pt extends ht{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 Ht(e));const c=s.cloneWithNodes(o);return s.parent.apply(new Ft(s,c)),c}}}}class Jt extends ht{handleAction(t,e){e.children=[],e.apply(new jt(t.newChildNodes))}}class Kt extends y{constructor(t){super(),this.type=x.DELETE_CHILDREN,this.entityToBeRemoved=t}}class Ut extends ht{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 jt(t)),s.parent.apply(new Kt(s))}}}class Wt extends ht{handleAction(t,e){t.lineBreakNode=this.lineBreakSingleBlock(t.startContainerNode,t.startOffset,e)}lineBreakSingleBlock(t,e,s){if(t){const n=new RTETextNode(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),c=s.children.slice(o+1);r&&e.push(t.cloneWithText(r)),i&&c.unshift(t.cloneWithText(i)),this.mergeLineBreakNodes(e,n,c,s)}return n}}mergeLineBreakNodes(t,e,s,n){(0===s.length||s[0]&&""===s[0].text)&&s.push(new RTETextNode(l(),"\n",n,t[t.length-1]&&t[t.length-1].annotationMap)),n.apply(new Ht([...t,e,...s]))}}class Gt extends ht{handleAction(t,e){t.lineBreakNode=this.lineBreakMultipleBlocks(t.selectedBlocks,e)}lineBreakMultipleBlocks(t,e){const s=e.children,n=new RTETextNode(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 Kt(t)))})),e}mergeLineBreakNodes(t,e,s,n){(0===s.length||s[0]&&""===s[0].text)&&s.push(new RTETextNode(l(),"\n",n,t[t.length-1]&&t[t.length-1].annotationMap)),n.apply(new Ht([...t,e,...s]))}}class zt extends y{constructor(t,...e){super(),this.type=x.INSERT_CHILDREN_BEFORE,this.referChildren=t,this.childrenToBeInserted=e}}class Vt extends y{constructor(t,e){super(),this.type=x.SPLIT_BLOCK_WITH_NODE,this.splitPointNode=t,this.startOffsetOfNode=e}}class Xt extends P{constructor(t){super(),this.isFlushable=!0,this.textAlign=t}toAnnotation(){return new k(this.textAlign)}}class qt extends ht{handleAction(t,e){this.updateCustomStyleAnnotation(e,["textAlign"])}}class Yt extends P{constructor(t){super(),this.isFlushable=!0,this.indent=t}toAnnotation(){return new v(this.indent)}}class RTETextBlock extends RTEBlock{constructor(t,e,s){super(t),this.children=[],this.type=e;const{autoMatchFormat:n}=s||{autoMatchFormat:!0};n&&(this.annotationMap=RTETextBlock.isAcceptableTextStyle(e)?new Map([Dt.from(e)]):new Map([Dt.from("paragraph")]))}static from(t,e={autoMatchFormat:!0}){var s,n;const r=new RTETextBlock(t.id,t.type,e),i=e.autoMatchFormat?Object.assign(Object.assign({},t.annotations),{textStyle:null!==(n=null===(s=t.annotations)||void 0===s?void 0:s.textStyle)&&void 0!==n?n:r.type}):t.annotations;return r.children=t.nodes.map((t=>{const s=H.getRTENodeClass(t.type);if(s)return s.from(t,r,e)})).filter(c),i&&super.convertAnnotationsToMap(r.annotationMap,i),r}static createAnnotationEntity(t,e){return"textStyle"===t?Dt.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 wt&&t.needMergeNode){const t=null==n?void 0:n.getAnnotationByType(w.LINK),r=s.getAnnotationByType(w.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 RTETextBlock(l(),this.type);return e.annotationMap=super.cloneAnnotations(),e.apply(new jt(t)),e}clone(t){const e=new RTETextBlock(this.id,this.type);return e.children=this.children.map((t=>t.clone(e))),e.annotationMap=super.cloneAnnotations(),e.parent=t,e}isNotEmpty(){return this.children.length>0&&this.children.some((t=>!t.isEmpty()))}getLastNode(){return this.children[this.children.length-1]}getBlockTag(){switch(this.type){case"title":case"subtitle":return"div";case"heading-1":return"h1";case"heading-2":return"h2";case"heading-3":return"h3";case"heading-4":return"h4";case"heading-5":return"h5";case"heading-6":return"h6";case"paragraph":default:return"p"}}getChildrenHtml(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=j.get(t.constructor.name,RTETextBlock.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 c=i+1;for(;c<t.length&&(null===(n=t[c].getInlineHtmlTagAtDepth(e))||void 0===n?void 0:n.groupId)===o.groupId;)c++;if(c===i+1)r+=t[i].renderHtmlFromDepth(e,s);else{const n=this.renderGroupedNodesAtDepth(t.slice(i,c),e+1,s);r+=`<${o.htmlTag}${o.attrStr}>${n}</${o.htmlTag}>`}i=c}return r}generateLinkHtml(t,e,s){e="";let n=[];for(let r=0;r<this.children.length;r++){const i=this.children[r].getAnnotationByType(w.LINK),o=this.children[r+1]?this.children[r+1].getAnnotationByType(w.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}}j.register(It.name,RTETextBlock.name,new Mt),j.register(Xt.name,RTETextBlock.name,new qt),j.register(Yt.name,RTETextBlock.name,new class extends ht{handleAction(t,e){this.updateCustomStyleAnnotation(e,["marginLeft"])}}),j.register(at.name,RTETextBlock.name,new class extends ht{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)}}}),j.register(x.UNLINK_LINK_GROUP,RTETextBlock.name,new class extends ht{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))}}),j.register(x.SPLIT_BLOCK_WITH_NODE,RTETextBlock.name,new Pt),j.register(x.REPLACE_CHILD_NODES,RTETextBlock.name,new Jt),j.register(x.MERGE_TWO_BLOCKS_NODES,RTETextBlock.name,new Ut),j.register(x.LINE_BREAK_SINGLE_BLOCK,RTETextBlock.name,new Wt),j.register(x.LINE_BREAK_MULTIPLE_BLOCKS,RTETextBlock.name,new Gt),j.register(x.INSERT_IMAGE_TO_BLOCK,RTETextBlock.name,new class extends ht{handleAction(t,e){const s=t.splitPointNode,n=t.startOffsetOfNode,r=t.imageBlockToBeInserted;if(this.isCaretPositionAtBlockEnd(e,s,n))e.parent.apply(new Ft(e,r));else if(this.isCaretPositionAtBlockStart(e,s,n))e.parent.apply(new zt(e,r));else{const t=new Vt(s,n);e.apply(t),e.parent.apply(new Ft(e,r))}}}),j.register(x.TRANSFORM_LIST_BLOCK,RTETextBlock.name,new class extends ht{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 jt(i)),s.apply(new Ft(t.selectedBlocks[0],n)),r.forEach((t=>{t.parent.apply(new Kt(t))}))}});class Qt extends ht{getPreviousNode(t){const e=t.parent,s=e.children.indexOf(t);if(s>0)return e.children[s-1];if(e.parent){const t=this.getPreviousBlock(e);if(t)return this.getBlockLastNode(t)}}getNextNode(t){const e=t.parent,s=e.children.indexOf(t);if(e.children[s+1])return e.children[s+1];if(e.parent){const t=this.getNextBlock(e);if(t)return this.getBlockFirstNode(t)}}isContentFirstNode(t){const e=t.parent,s=e.children.indexOf(t),n=e.parent;if(e.isListItemBlock()){const t=n.parent;return 0===s&&Array.isArray(n.children)&&n.children[0]===e&&"list-item"!==t.type&&Array.isArray(t.children)&&t.children[0]===n}return 0===s&&Array.isArray(n.children)&&n.children[0]===e}getPreviousBlock(t){if(t&&t.parent&&t.parent.children){const e=t.parent.children.indexOf(t);if(e>0)return t.parent.children[e-1];if(this.isRTEBlock(t.parent)&&0===e)return this.getPreviousBlock(t.parent)}}getBlockLastNode(t){return t.getLastNode()}getBlockFirstNode(t){if("number-list"===t.type||"bullet-list"===t.type){if(t.children)return this.getBlockFirstNode(t.children[0])}else if(t.children)return t.children[0]}getNextBlock(t){if(t&&t.parent&&t.parent.children){const e=t.parent.children.indexOf(t);if(t.parent.children[e+1])return t.parent.children[e+1];if("list-item"===t.type&&t.parent.children.length===e+1)return this.getNextBlock(t.parent)}}isRTEBlock(t){return t&&"VegaRTEContent"!==t.constructor.name}}class Zt extends y{constructor(t,e){super(),this.isFlushable=!0,this.type=x.UPDATE_CODE_BLOCK,this.content=t,this.language=e}}class te extends P{constructor(t){super(),this.isFlushable=!1,this.range=t}toAnnotation(){return new K(this.range)}}class RTEDecoratorNode extends RTENode{constructor(){super(...arguments),this.type="decorator-node",this.isSelected=!1}static isDecoratorNodeContainerElement(t){return t&&t.classList.contains(RTEDecoratorNode.DECORATOR_CONTAINER_CLASS)}static getDecoratorNodeElement(t){return t.querySelector(`.${RTEDecoratorNode.DECORATOR_NODE_CLASS}`)}getRangeEndOffset(){return 1}getRangeContainer(){const t=this.getElementRef();if(t)return d(t,`.${RTEDecoratorNode.DECORATOR_CONTAINER_CLASS}`)}isContentEditable(){return!1}}RTEDecoratorNode.DECORATOR_CONTAINER_CLASS="v-internal-decorator-container",RTEDecoratorNode.DECORATOR_NODE_CLASS="v-internal-decorator-node";class ee extends N{constructor(){super(...arguments),this.stylesToBeFiltered=ee.STYLES,this.elementTagName="pre code"}canFilter(t){return S.isCodeBlockNode(t)}canRefill(t,e){return!1}toCssText(){return this.buildCssTextForStyles(this.elementTagName,this.classNameToBeAdded)}}ee.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 RTECodeBlockNode extends RTEDecoratorNode{constructor(t,e,s,n){super(t),this.type=O.CODE_BLOCK_NODE,this.text="",this.annotationMap=new Map,this.text=e,this.parent=n,this.language=s,this.annotationMap.set(A.CUSTOM_STYLE,new D(ee.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 RTECodeBlockNode(this.id,this.text,this.language,t)}doAnnotationActionApply(t){j.executeTheStrategy(t,this)}doModifyActionApply(t){j.executeTheStrategy(t,this)}}j.register(x.UPDATE_CODE_BLOCK,RTECodeBlockNode.name,new class extends ht{handleAction(t,e){const{content:s,language:n}=t;e.language=n,e.text=s}}),j.register(te.name,RTECodeBlockNode.name,new class extends ht{handleAction(t,e){e.annotationMap.set(p.SELECTION_RANGE,t.toAnnotation())}});var se;!function(t){t.CSS="css",t.HTML="html",t.JavaScript="js",t.JSX="jsx",t["Plain Text"]="plainText",t.TypeScript="ts",t.TSX="tsx"}(se||(se={}));class ne extends ht{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 Kt(e)))}}class re extends N{constructor(){super(...arguments),this.stylesToBeFiltered=re.STYLES,this.elementTagName="pre"}canFilter(t){return S.isCodeBlock(t.constructor.name)}canRefill(t,e){return!1}toCssText(){return this.buildCssTextForStyles(this.elementTagName,this.classNameToBeAdded)}}re.STYLES={backgroundColor:"rgba(var(--v-bg-secondary, 245, 247, 247, 1))",padding:"12px"};class RTECodeBlock extends RTEBlock{constructor(t,e,s){super(t),this.type="code-block",this.annotationMap=new Map([D.from(re.STYLES)]),this.children=[new RTECodeBlockNode(`${t}-1`,e,s,this)]}static from(t){return new RTECodeBlock(t.id,t.content,t.language)}toJSON(){const{language:t,text:e}=this.children[0];return{id:this.id,type:"code-block",content:e,language:t}}toHtml(t){const{language:e=se["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=RTECodeBlock.from(this.toJSON());return e.parent=t,e}apply(n){if(n instanceof y&&j.executeTheStrategy(n,this),n.isFlushable){const n=g.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)}}j.register(x.DELETE_CODE_BLOCK,RTECodeBlock.name,new class extends Qt{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 Kt(e));const i=t?g.getDOMByEntity(t):null;if(0===n.children.length){const s=RTETextBlock.from({id:l(),type:"paragraph",nodes:[{id:l(),type:"text",text:""}]});e.parent.apply(new jt([s])),t=s.children[0],r=0}this.notifyUpdateSelection(t,i,r,e)}}notifyUpdateSelection(s,r,i,o){const c=g.getDOMByEntity(o);if(c){const o=e.getSubjectFromParentNodeByEventId(c,n);o&&t.notify(o,{node:s,updateDirectly:!!r,offset:i})}}getRTENodeEndOffset(t){return t?t.getRangeEndOffset():0}}),j.register(x.DELETE_CHILDREN,RTECodeBlock.name,new ne),j.register(x.SWITCH_OUT_FROM_CODE_BLOCK,RTECodeBlock.name,new class extends ht{handleAction(s,r){const{content:i,language:o}=s,c=i.split("\n"),a=new Zt(c.slice(0,c.length-2).join("\n"),o);a.isFlushable=!1,r.children[0].apply(a);const h=RTETextBlock.from({id:l(),type:"paragraph",nodes:[{id:l(),text:"",type:"text"}]});r.parent.apply(new Ft(r,h));const u=g.getDOMByEntity(r);if(u){const s=e.getSubjectFromParentNodeByEventId(u,n);s&&t.notify(s,{node:h.children[0]})}}}),j.register(x.INSERT_IMAGE_TO_BLOCK,RTECodeBlock.name,new class extends ht{handleAction(t,e){e.parent.apply(new Ft(e,t.imageBlockToBeInserted))}}),RTECodeBlock.CODE_BLOCK_PLACEHOLDER_CLASS_NAME="code-block-placeholder-element";export{tt as $,j as A,E as B,A as C,L as D,RTECodeBlock as E,w as F,RTEDecoratorNode as G,Xt as H,Ft as I,O as J,_ as K,Ht as L,y as M,R as N,Vt as O,it as P,Qt as Q,F as R,lt as S,It as T,Rt as U,rt as V,ne as W,W as X,U as Y,m as Z,et as _,B as a,G as a0,V as a1,z as a2,Dt as a3,S as a4,k as a5,Z as a6,C as a7,re as a8,RTECodeBlockNode as a9,ee as aa,se as ab,nt as ac,st as ad,wt as ae,Zt as af,te as ag,Bt as ah,pt as ai,xt as aj,Ot as ak,Q as al,Tt as am,Et as an,At as ao,Yt as ap,H as b,RTETextNode as c,RTEBlock as d,RTETextBlock as e,M as f,ht as g,jt as h,RTENode as i,zt as j,p as k,x as l,P as m,Kt as n,$ as o,N as p,Mt as q,qt as r,g as s,Wt as t,Gt as u,Pt as v,Jt as w,Ut as x,f as y,D as z}
1
+ import{C as t}from"./p-2d0d575f.js";import{d as e}from"./p-11e2dcf5.js";import{d as s,e as n}from"./p-6c43d54a.js";import{d as r,c as i}from"./p-02841589.js";import{L as o}from"./p-6e1ab235.js";import{i as c}from"./p-25983017.js";import{T as a}from"./p-d884c644.js";import{g as l}from"./p-8b5d3a52.js";import{V as h}from"./p-8aee6b74.js";import{c as u}from"./p-a841cf13.js";import{f as d}from"./p-ec2a1d4c.js";var p,f;!function(t){t.SELECTION_RANGE="SELECTION_RANGE",t.CLEAR_FORMATTING="CLEAR_FORMATTING",t.LINK_GROUP="LINK_GROUP"}(p||(p={}));class T{}!function(t){t.ALIGNMENT="ALIGNMENT",t.TEXT_STYLE="TEXT_STYLE",t.INDENT="INDENT",t.LIST="LIST",t.INTERNAL_WRAPPER="INTERNAL_WRAPPER"}(f||(f={}));class E extends T{}const g=new class{constructor(){this.domToEntity=new WeakMap,this.entityToDOM=new WeakMap,this.contentEntityToRootDom=new Map,this.rootDomToContentEntity=new WeakMap}register(t,e){this.isVegaRTEContent(e)?this.registerRootDomAndContentEntity(t,e):(this.domToEntity.set(t,e),this.entityToDOM.set(e,t))}getEntityByDOM(t){return this.domToEntity.get(t)}getDOMByEntity(t){return this.isVegaRTEContent(t)?this.contentEntityToRootDom.get(t):this.entityToDOM.get(t)}removeDirtyDomRef(t){this.domToEntity.delete(t)}registerRootDomAndContentEntity(t,e){const s=this.rootDomToContentEntity.get(t);s&&s!==e&&this.contentEntityToRootDom.delete(s),this.rootDomToContentEntity.set(t,e),this.contentEntityToRootDom.set(e,t)}isVegaRTEContent(t){return t&&"VegaRTEContent"===t.constructor.name}};var x,w,A,O;!function(t){t.DELETE_CHILDREN="DELETE_CHILDREN",t.DELETE_NEST_LIST="DELETE_NEST_LIST",t.UPDATE_TEXT="UPDATE_TEXT",t.REPLACE_SELECTED_TEXT="REPLACE_SELECTED_TEXT",t.APPEND_CHILDREN="APPEND_CHILDREN",t.INSERT_CHILDREN_AFTER="INSERT_CHILDREN_AFTER",t.INSERT_CHILDREN_BEFORE="INSERT_CHILDREN_BEFORE",t.SPLIT_BLOCK_WITH_NODE="SPLIT_BLOCK_WITH_NODE",t.REPLACE_CHILD_NODES="REPLACE_CHILD_NODES",t.REPLACE_NEST_LIST="REPLACE_NEST_LIST",t.MERGE_TWO_BLOCKS_NODES="MERGE_TWO_BLOCKS_NODES",t.INSERT_NEW_PARAGRAPH="INSERT_NEW_PARAGRAPH",t.LINE_BREAK_SINGLE_BLOCK="LINE_BREAK_SINGLE_BLOCK",t.LINE_BREAK_MULTIPLE_BLOCKS="LINE_BREAK_MULTIPLE_BLOCKS",t.TRANSFORM_LIST_BLOCK="TRANSFORM_LIST_BLOCK",t.TRANSFORM_PARAGRAPH_BLOCK="TRANSFORM_PARAGRAPH_BLOCK",t.DELETE_BLOCK_CONTENT="DELETE_BLOCK_CONTENT",t.INSERT_IMAGE_TO_BLOCK="INSERT_IMAGE_TO_BLOCK",t.UPDATE_IMAGE_NODE_URL="UPDATE_IMAGE_NODE_URL",t.TRANSFORM_TO_CODE_BLOCK="TRANSFORM_TO_CODE_BLOCK",t.UPDATE_CODE_BLOCK="UPDATE_CODE_BLOCK",t.SWITCH_OUT_FROM_CODE_BLOCK="SWITCH_OUT_FROM_CODE_BLOCK",t.DELETE_CODE_BLOCK="DELETE_CODE_BLOCK",t.UNLINK_LINK_GROUP="UNLINK_LINK_GROUP",t.LINK_GROUP_NODE_SPLIT="LINK_GROUP_NODE_SPLIT",t.DELETE_LINK_GROUP="DELETE_LINK_GROUP",t.UPDATE_CURSOR_POSITION="UPDATE_CURSOR_POSITION",t.INSERT_TEXT_TO_DECORATOR_NODE="INSERT_TEXT_TO_DECORATOR_NODE",t.INSERT_NODE_TO_NEAREST_ROOT="INSERT_NODE_TO_NEAREST_ROOT",t.PASTE_CONTENT="PASTE_CONTENT"}(x||(x={}));class y{constructor(){this.isFlushable=!1}}function m(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 N{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=m(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`${`.${N.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]))}}N.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"}(w||(w={}));class R extends T{}class S{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.constructor.name)&&!!t.getAnnotationByType(w.LINK)}static isCodeNode(t){if(this.isTextNode(t.constructor.name)){const e=t.getAnnotationByType(w.CODE);return!!e&&e.code}return!1}static isImageNode(t){return"RTEImageNode"===t.constructor.name}static isCodeBlockNode(t){return"RTECodeBlockNode"===t.constructor.name}}S.RTE_TEXT_NODE_CLASS_NAME="RTETextNode",S.RTE_TEXT_BLOCK_CLASS_NAME="RTETextBlock";class C extends N{constructor(){super(...arguments),this.stylesToBeFiltered=b.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 S.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 b extends T{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 b("");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=b.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,b.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(" ")}}b.linkGroupFilterStylesStrategy=new C;class k extends E{constructor(t){super(),this.type=f.ALIGNMENT,this.textAlign=t}static from(t){return[f.ALIGNMENT,new k(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 k(this.textAlign)}renderStyle(t){return(null==t?void 0:t.standalone)?k.getDefaultStyles(this.textAlign):null}}class v extends E{constructor(t){super(),this.type=f.INDENT,this.indent=Math.max(0,t)}static from(t){return[f.INDENT,new v(t)]}toJSON(){return this.indent>0?{indent:this.indent}:null}clone(){return new v(this.indent)}renderClass(){return null}renderStyle(){return this.indent>0?{marginLeft:16*this.indent+"px"}:null}}class B{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 y?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)))}}}B.registry=new Map;class j{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=B.get(t,e),n=()=>{const s=t instanceof y?t.type:t.constructor.name,n=j.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!!j.get(t,e.constructor.name)}}j.registry=new Map,function(t){t.CUSTOM_ATTRIBUTE="CUSTOM_ATTRIBUTE",t.CUSTOM_CLASS="CUSTOM_CLASS",t.CUSTOM_STYLE="CUSTOM_STYLE"}(A||(A={}));class _ extends T{}class $ extends _{constructor(t){super(),this.type=A.CUSTOM_ATTRIBUTE,this.BOOLEAN_ATTRS=new Set(["controls","disabled","checked","readonly","multiple","required","autoplay","muted"]),this.customAttribute=t}static from(t){return[A.CUSTOM_ATTRIBUTE,new $(t)]}toJSON(){return{customAttribute:this.customAttribute}}clone(){return new $(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(c)}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 L extends _{constructor(t){super(),this.type=A.CUSTOM_CLASS,this.customClass=t}static from(t){return[A.CUSTOM_CLASS,new L(t)]}toJSON(){return{customClass:this.customClass}}clone(){return new L(this.customClass)}toString(){return`class="${this.customClass.join(" ")}"`}renderClass(){return this.customClass}}class D extends _{constructor(t){super(),this.type=A.CUSTOM_STYLE,this.customStyle=t}static from(t){return[A.CUSTOM_STYLE,new D(t)]}toJSON(){return{customStyle:this.customStyle}}clone(){return new D(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 I extends E{constructor(t){super(),this.type=f.INTERNAL_WRAPPER,this.internalWrapper=t}static from(t){return[f.INTERNAL_WRAPPER,new I(t)]}clone(){return new I(this.internalWrapper)}renderClass(){}renderStyle(){}toJSON(){return this.internalWrapper?{internalWrapper:this.internalWrapper}:void 0}}class M{constructor(t){this.dtoType=t instanceof RTEBlock?"block":"node",this.annotationMap=t.annotationMap}toCssText(t={standalone:!1},e,s){return s=s||this.toJSON(t,e),Object.entries(Object.assign({},s)).map((([t,e])=>`${i(t)}: ${e};`)).join("")}toJSON(t={standalone:!1},e){const s=Array.from(this.annotationMap.values()).filter((t=>this.filterAnnotation(t)||t instanceof D)).map((e=>e.renderStyle(t))).filter(c);return e&&e.length>0?this.mergeAnnotationStyles(s,e):s.reduce(((t,e)=>Object.assign(Object.assign({},t),e)),{})}filterAnnotation(t){return"block"===this.dtoType?t instanceof E:t instanceof R}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.constructor.name).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(a).map((t=>`@import url('${a[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"}(O||(O={}));class RTENode{constructor(t,e){this.annotationMap=new Map,this.id=t,e&&(this.annotationMap=e)}static from(t,e,s){throw new Error(`[Vega] ${this.constructor.name}.from(${JSON.stringify(t)}, ${e}, ${s}) is not implemented. Please implement this method in the subclass.`)}static createAnnotationEntity(t,e){switch(t){case"customAttribute":return $.from(e);case"customClass":return L.from(e);case"customStyle":return D.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 R||t instanceof L)).map((e=>e.renderClass(t))).filter(c).reduce(((t,e)=>[t,e].join(" ").trim()),"")}getCustomAttributesAnnotation(){return this.annotationMap.get(A.CUSTOM_ATTRIBUTE)}isTextNode(){return!1}getElementRef(){return g.getDOMByEntity(this)}generateAttributeString(t,...e){var s;const n=new M(this),r=n.toJSON({standalone:!0},["textDecoration"]),i=this.annotationMap.get(A.CUSTOM_CLASS);let o=r,a=null==i?void 0:i.renderClass();if(t&&t.filterInlineStyles){const t=F.executeTheStrategyFilterAction(this,r,a);o=t.styles,a=t.classNames}const l=[...(null===(s=this.getCustomAttributesAnnotation())||void 0===s?void 0:s.toString(e))||[],a&&a.length>0?`class="${a.join(" ")}"`:null,o&&Object.keys(o).length>0?`style="${n.toCssText({standalone:!0},void 0,o)}"`:null,...e].filter(c);return l.length?` ${l.join(" ")}`:""}doApply(t){t instanceof y?this.doModifyActionApply(t):this.doAnnotationActionApply(t)}flushChange(){const n=g.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 H=new class{constructor(){this.RTE_BLOCK_DTO_CLASS_MAP=new Map,this.RTE_NODE_DTO_CLASS_MAP=new Map}registerRTEDTOClass(t,e){if(e.prototype instanceof RTEBlock)this.RTE_BLOCK_DTO_CLASS_MAP.set(t,e);else{if(!(e.prototype instanceof RTENode))throw new Error(`Invalid RTE DTO class type: ${t}`);this.RTE_NODE_DTO_CLASS_MAP.set(t,e)}}getRTEBlockClass(t){return this.RTE_BLOCK_DTO_CLASS_MAP.get(t)}getRTENodeClass(t){return this.RTE_NODE_DTO_CLASS_MAP.get(t)}};class RTEBlock{constructor(t){this.annotationMap=new Map,this.id=t}static from(t,e){throw new Error(`[Vega] ${this.constructor.name}.from(${JSON.stringify(t)}, ${e}) is not implemented. Please implement this method in the subclass.`)}static generateBlockChildren(t,e,s){return t.map((t=>{const n=H.getRTEBlockClass(t.type);if(n){const r=n.from(t,e);return r.parent=s,r}})).filter(c)}static createAnnotationEntity(t,e){switch(t){case"textAlign":return k.from(e);case"indent":return v.from(e);case"customAttribute":return $.from(e);case"customClass":return L.from(e);case"customStyle":return D.from(e);case"internalWrapper":return I.from(e)}}static convertAnnotationsToMap(t,e){Object.entries(e).forEach((([e,s])=>{const n=this.createAnnotationEntity(e,s);c(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 b||t instanceof I))).length}toJSON(){const t=Array.from(this.annotationMap.values()).filter((t=>t instanceof E||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=g.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 RTEBlock?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 E||t instanceof L)).map((e=>e.renderClass(t))).filter(c).reduce(((t,e)=>[t,e].join(" ").trim()),"")}getCustomAttributesAnnotation(){return this.annotationMap.get(A.CUSTOM_ATTRIBUTE)}generateAttributeString(t,...e){var s;const n=new M(this),r=n.toJSON({standalone:!0}),i=this.annotationMap.get(A.CUSTOM_CLASS);let o=r,a=null==i?void 0:i.renderClass();if(t&&t.filterInlineStyles){const t=F.executeTheStrategyFilterAction(this,r,a);o=t.styles,a=t.classNames}const l=[...(null===(s=this.getCustomAttributesAnnotation())||void 0===s?void 0:s.toString(e))||[],a&&a.length>0?`class="${a.join(" ")}"`:null,o&&Object.keys(o).length>0?`style="${n.toCssText({standalone:!0},void 0,o)}"`:null,...e].filter(c);return l.length?` ${l.join(" ")}`:""}doApply(t){t instanceof y?j.executeTheStrategy(t,this):this.applyAnnotationAction(t)}applyAnnotationAction(t){const e=t.toAnnotation();if(e instanceof b||this.annotationMap.set(e.type,e),"function"==typeof this.doAnnotationActionApply)this.doAnnotationActionApply(t);else{const e=j.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 P{}class J extends P{constructor(){super(...arguments),this.doSplit=!0}}class K extends T{constructor(t){super(),this.type=p.SELECTION_RANGE,this.range=t}clone(){return new K(this.range)}}const U="700",W="bold",G="italic",z="underline",V="line-through";class X extends R{constructor(t){super(),this.type=w.STRIKETHROUGH,this.strikethrough=t}static from(t){return[w.STRIKETHROUGH,new X(t)]}toJSON(){return{strikethrough:this.strikethrough}}clone(){return new X(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 R{constructor(t){super(),this.type=w.UNDERLINE,this.underline=t}static from(t){return[w.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 Y extends R{constructor(t){super(),this.type=w.ITALIC,this.italic=t}static from(t){return[w.ITALIC,new Y(t)]}toJSON(){return{italic:this.italic}}clone(){return new Y(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 Q extends R{constructor(t){super(),this.type=w.BOLD,this.bold=t}static from(t){return[w.BOLD,new Q(t)]}toJSON(){return{bold:this.bold}}clone(){return new Q(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 Z extends R{constructor(t,e=!0){super(),this.type=w.CODE,this.code=t,this.useInternalStyle=e}static from(t,e){return[w.CODE,new Z(t,e)]}static getDefaultStyles(){return{fontFamily:"Roboto Mono",whiteSpace:"pre-wrap"}}toJSON(){return{code:this.code}}clone(){return new Z(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?Z.getDefaultStyles():null}}const tt={key:"black",light:"#111128",dark:"#E3E3E8"},et=[tt,{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"}],st="​",nt=[{key:"title"},{key:"subtitle"},{key:"heading-1"},{key:"heading-2"},{key:"heading-3"},{key:"paragraph"}],rt=[["textStyles"],["bold","italic","underline","strikethrough","code"],["textColor"],["horizontalAlignment","bulletsNumbers"],["moreIndent","lessIndent"],["link"],["image"],["clearStyle"]],it=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);class ot extends R{constructor(t){super(),this.type=w.TEXT_COLOR,this.textColor=this.formatTextColor(t)}static from(t){return[w.TEXT_COLOR,new ot(t)]}toJSON(){return{textColor:this.textColor.key}}clone(){return new ot(this.textColor.key)}renderClass(){return null}renderStyle(){return{color:h.isDarkMode()?this.textColor.dark:this.textColor.light}}formatTextColor(t){return et.find((e=>e.key===t))||et[0]}}class ct extends R{constructor(t,e=!0){super(),this.type=w.LINK,this.link=t,this.useInternalStyle=e}static from(t,e=!0){return[w.LINK,new ct(t,e)]}toJSON(){return{link:this.link}}clone(){return new ct(this.link,this.useInternalStyle)}toEqual(t){return this.link.groupKey===t.link.groupKey}renderClass(){return null}renderStyle(){return null}}class at extends P{constructor(t,e,s){super(),this.isFlushable=!1,this.groupKey=t,this.nodes=e,this.type=s}toAnnotation(){return new b(this.groupKey)}}class lt extends P{constructor(){super(),this.isFlushable=!1}toAnnotation(){return null}}class ht{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(A.CUSTOM_STYLE);s&&this.isCustomStyle(s,e)&&t.annotationMap.set(s.type,new D(s.removeStyles(e)))}createNewParagraph(t){const e=H.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.constructor.name?e:this.getRootContent(e)}isCaretPositionAtBlockStart(t,e,s){return e===t.children[0]&&0===s}isCaretPositionAtBlockEnd(t,e,s){return e.isContentEditable()?this.isCaretPositionAtTextBlockEnd(t,e,s):this.isCaretPositionAtDecoratorBlockEnd(t,e,s)}getDOMByEntity(t){return g.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 ut extends y{constructor(t){super(),this.type=x.LINK_GROUP_NODE_SPLIT,this.splittedTextNodes=t}}class dt extends ht{constructor(){super(...arguments),this.applyTargetNode=null}handleAction(t,e){const s=e.getAnnotationByType(p.SELECTION_RANGE);if(this.setApplyTargetNode(null),t instanceof J&&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 ut(n)),n}return this.setApplyTargetNode(e),e}return t}))}return this.applyTargetNode}insertNewNode(t,e){const s=e.cloneWithText("");this.setApplyTargetNode(s);const n=e.parent.children.findIndex((t=>t===e));return 0===t||!e.isContentEditable()&&t===n?[s,e]:t===e.text.length||!e.isContentEditable()&&t===n+1?[e,s]:[e.cloneWithText(e.text.substring(0,t)),s,e.cloneWithText(e.text.substring(t))]}shouldSplitSelection(t){const{startContainer:e,endContainer:s,startOffset:n,endOffset:r}=t;return e!==s||n>0||r<(s.textContent?s.textContent.length:0)}splitTextNode(t,e){const{startContainer:s,endContainer:n,startOffset:r}=t,i=s.parentElement,o=n.parentElement,c=(t,s,n)=>{const r=t.substring(0,s),i=t.substring(s,n),o=t.substring(n);return[e.cloneWithText(r),e.cloneWithText(i),e.cloneWithText(o)]},a=i&&g.getEntityByDOM(i),l=o&&g.getEntityByDOM(o);if(a&&a.id===e.id){const i=s===n?t.endOffset:e.text.length,[o,a,l]=c(e.text,r,i);return this.setApplyTargetNode(a),[o,a,l].filter((t=>!!t.text))}if(l&&l.id===e.id){const[s,n,r]=c(e.text,0,t.endOffset);return this.setApplyTargetNode(n),[s,n,r].filter((t=>!!t.text))}return this.setApplyTargetNode(e),e}setApplyTargetNode(t){this.applyTargetNode=t}}class pt extends J{constructor(t){super(),this.isFlushable=!0,this.bold=t}toAnnotation(){return new Q(this.bold)}}class ft extends T{constructor(){super(...arguments),this.type=p.CLEAR_FORMATTING,this.items=[w.BOLD,w.ITALIC,w.UNDERLINE,w.STRIKETHROUGH,w.TEXT_COLOR,w.CODE,A.CUSTOM_STYLE]}}class Tt extends J{constructor(){super(...arguments),this.isFlushable=!0}toAnnotation(){return new ft}}class Et extends J{constructor(t){super(),this.isFlushable=!0,this.code=t}toAnnotation(){return new Z(this.code)}}class gt extends P{constructor(t){super(),this.isFlushable=!0,this.annotationType=t}toAnnotation(){}}class xt extends J{constructor(t){super(),this.isFlushable=!0,this.italic=t}toAnnotation(){return new Y(this.italic)}}class wt extends J{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,c(n)&&(this.doSplit=n)}toAnnotation(){return new ct(this.link)}}class At extends J{constructor(t){super(),this.isFlushable=!0,this.strikethrough=t}toAnnotation(){return new X(this.strikethrough)}}class Ot extends J{constructor(t){super(),this.isFlushable=!0,this.underline=t}toAnnotation(){return new q(this.underline)}}class yt extends ht{handleAction(t,e){const s=t.toAnnotation();if(t instanceof gt)e.annotationMap.delete(t.annotationType);else{if(!(s instanceof ft))return s instanceof R||s instanceof K?(t instanceof wt&&(c(t.newText)&&(e.text=t.newText),e.parent.apply(new at(t.link.groupKey,[e],t.type))),t instanceof Et&&this.handleAction(new Tt,e),t instanceof pt&&this.updateCustomStyleAnnotation(e,["fontWeight"]),t instanceof xt&&this.updateCustomStyleAnnotation(e,["fontStyle"]),(t instanceof Ot||t instanceof At)&&this.updateCustomStyleAnnotation(e,["textDecoration"]),void e.annotationMap.set(s.type,s)):void 0;s.items.forEach((t=>{e.deleteAnnotationByType(t)}))}}}class mt extends y{constructor(){super(...arguments),this.type=x.DELETE_LINK_GROUP}}class Nt extends ht{handleAction(t,e){e.text=t.newTextContent,!e.text&&e.annotationMap.has("LINK")&&e.apply(new mt)}}class Rt extends y{constructor(t){super(),this.type=x.UPDATE_TEXT,this.newTextContent="",this.newTextContent=t}}class St extends ht{handleAction(t,e){this.replaceSelectedText(t.textToBeInsert,t.currentRange,e)}replaceSelectedText(t,e,s){if(e&&e.startContainer&&e.endContainer){const{startContainer:n,endContainer:r,startOffset:i,endOffset:o}=e;let c=s.text;if(n===r&&i===o&&t)c=s.text.slice(0,i)+t+s.text.slice(i);else{const e=n.parentElement,a=r.parentElement,l=e&&g.getEntityByDOM(e),h=a&&g.getEntityByDOM(a);let u=0,d=s.text.length;l&&l===s?(u=i,d=n===r?o:d):h&&h===s&&(d=o),c=s.text.slice(0,u)+t+s.text.slice(d)}s.apply(new Rt(c))}}}class Ct extends T{constructor(t){super(),this.type=w.INLINE_HTML,this.htmlTag=t}static from(t){const{htmlTag:e,child:s,customStyle:n,customClass:r,customAttribute:i}=t,o=new Ct(e);return o.groupId=t.groupId,o.child=s?Ct.from(s)[1]:void 0,o.customAttribute=i?$.from(i)[1]:void 0,o.customClass=r?L.from(r)[1]:void 0,o.customStyle=n?D.from(n)[1]:void 0,[w.INLINE_HTML,o]}clone(){var t,e,s,n;const r=new Ct(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 bt extends ht{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 kt extends ht{handleAction(t,e){const s=e.parent.getAnnotationByType(p.LINK_GROUP);if(s){const t=e.annotationMap.get(w.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(w.LINK)}}class vt extends R{constructor(t){super(),this.type=w.PLAIN_TEXT,this.plainText=!0,this.plainText=t}static from(t){return[w.PLAIN_TEXT,new vt(t)]}clone(){return new vt(this.plainText)}renderClass(){}renderStyle(){}toJSON(){return this.plainText?{plainText:this.plainText}:void 0}}class Bt extends J{constructor(t){super(),this.isFlushable=!0,this.textColor=t}toAnnotation(){return new ot(this.textColor)}}class RTETextNode extends RTENode{constructor(t,e,s,n){super(t,n),this.type=O.TEXT,this.parent=s,this.text=e,this.registerModifyStrategy()}static supportsHtmlTag(t){return["span","code"].includes(t)}static from(t,e,s={autoMatchFormat:!0}){const n=new RTETextNode(t.id,t.text,e),{annotations:r}=t;return r&&(n.annotationMap=this.generateTextAnnotationMap(r,s,e,n)),n}static generateTextAnnotationMap(t,e,s,n){return new Map(Object.keys(t).map((r=>("link"===r&&t.link&&s&&n&&s.apply(new at(t.link.groupKey,[n],"link")),this.createAnnotationEntity(r,t[r],e)))).filter(c))}static createAnnotationEntity(t,e,s){const n=!(!s||!s.autoMatchFormat);switch(t){case"bold":return Q.from(e);case"italic":return Y.from(e);case"underline":return q.from(e);case"strikethrough":return X.from(e);case"code":return Z.from(e,n);case"textColor":return ot.from(e);case"link":return ct.from(e,n);case"inlineHtml":return Ct.from(e);case"plainText":return vt.from(e)}return RTENode.createAnnotationEntity(t,e)}toJSON(){const t=Array.from(this.annotationMap.values()).filter((t=>t instanceof R||t instanceof _||t instanceof Ct)).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(w.INLINE_HTML);return e?this.renderWithWrapperStr(e,t):this.renderTextStr(t)}cloneWithText(t){return new RTETextNode(l(),t,this.parent,super.cloneAnnotations())}clone(t){return new RTETextNode(this.id,this.text,t,super.cloneAnnotations())}isEmpty(){return!(this.getAnnotationByType(w.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?it.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(w.INLINE_HTML);for(let s=0;s<t&&e;s++)e=e.child;return e}registerModifyStrategy(){const t=this.constructor.name;RTETextNode.registerActionStrategyStatus[t]||(this.isContentEditable()&&(j.register(x.UPDATE_TEXT,t,new Nt),j.register(x.REPLACE_SELECTED_TEXT,t,new St),j.register(x.LINK_GROUP_NODE_SPLIT,t,new bt),j.register(wt.name,t,new yt)),j.register(J.name,t,new dt),j.register(x.DELETE_LINK_GROUP,t,new kt),j.register(pt.name,t,new yt),j.register(Tt.name,t,new yt),j.register(xt.name,t,new yt),j.register(Ot.name,t,new yt),j.register(Bt.name,t,new yt),j.register(At.name,t,new yt),j.register(Et.name,t,new yt),j.register(P.name,t,new yt),RTETextNode.registerActionStrategyStatus[t]=!0)}doAnnotationActionApply(t){const e=this.getAnnotationByType(p.SELECTION_RANGE);if(t instanceof J&&t.doSplit&&e){const e=j.get(J.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){j.executeTheStrategy(t,this)}applyActionToNode(t,e){const s=e.toAnnotation();if(e instanceof lt)return void this.syncUpSelectedNodes(t);s instanceof K||this.syncUpSelectedNodes(t);const n=j.get(e.constructor.name,t.constructor.name);if(n)return void n.execute(e,t);const r=j.get(P.name,RTETextNode.name);r&&r.execute(e,t)}syncUpSelectedNodes(s){const r=this.getElementRef();if(r){const i=e.getSubjectFromParentNodeByEventId(r,n);i&&t.notify(i,{node:s})}}renderWithWrapperStr(t,e){const{htmlTag:s,child:n}=t,r=this.annotationAttrStr(t);return n?`<${s}${r}>${this.renderWithWrapperStr(n,e)}</${s}>`:it.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(c);return r.length>0?` ${r.join(" ")}`:""}renderTextStr(t){var e;const s=(null===(e=this.getAnnotationByType(w.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(w.PLAIN_TEXT);return!!t&&t.plainText&&0===Array.from(this.annotationMap.values()).filter((t=>t instanceof R&&!(t instanceof ct)&&!(t instanceof vt)||t instanceof _)).length}}RTETextNode.registerActionStrategyStatus={},RTETextNode.htmlTag="span";class jt extends y{constructor(t){super(),this.type=x.APPEND_CHILDREN,this.entityToBeAppended=t}}const _t={fontFamily:"Inter",fontSize:"16px",lineHeight:"22px",minHeight:"22px",fontWeight:"500"},$t=Object.assign(Object.assign({},_t),{marginTop:"0px",marginBottom:"0px"}),Lt={paragraph:$t,title:Object.assign(Object.assign({},_t),{fontSize:"36px",lineHeight:"40px",minHeight:"40px"}),subtitle:Object.assign(Object.assign({},_t),{fontSize:"28px",lineHeight:"32px",minHeight:"32px"}),"heading-1":Object.assign(Object.assign({},$t),{fontSize:"22px",lineHeight:"24px",minHeight:"24px"}),"heading-2":Object.assign(Object.assign({},$t),{fontSize:"20px",lineHeight:"24px",minHeight:"24px"}),"heading-3":Object.assign(Object.assign({},$t),{fontSize:"18px"}),"heading-4":Object.assign({},$t),"heading-5":Object.assign(Object.assign({},$t),{fontSize:"14px"}),"heading-6":Object.assign(Object.assign({},$t),{fontSize:"12px"})};class Dt extends E{constructor(t){super(),this.type=f.TEXT_STYLE,this.textStyle=t}static from(t){return[f.TEXT_STYLE,new Dt(t)]}static getDefaultStyles(t){return t?Lt[t]:null}toJSON(){return{textStyle:this.textStyle}}clone(){return new Dt(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?Dt.getDefaultStyles(this.textStyle):null}}class It extends P{constructor(t,e){super(),this.isFlushable=!0,this.textStyle=t,this.bold=e}toAnnotation(){return new Dt(this.textStyle)}}class Mt extends ht{handleAction(t,e){"list-item"!==e.type&&(e.type=t.textStyle),e.children.forEach(t.bold?t=>{const e=new pt(!0);e.doSplit=!1,t.apply(e)}:t=>{t.apply(new gt(w.BOLD))}),this.updateCustomStyleAnnotation(e,["fontFamily","lineHeight","fontWeight","fontSize"])}}class Ft extends y{constructor(t,...e){super(),this.type=x.INSERT_CHILDREN_AFTER,this.referChildren=t,this.childrenToBeInserted=e}}class Ht extends y{constructor(t){super(),this.type=x.REPLACE_CHILD_NODES,this.newChildNodes=t}}class Pt extends ht{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 Ht(e));const c=s.cloneWithNodes(o);return s.parent.apply(new Ft(s,c)),c}}}}class Jt extends ht{handleAction(t,e){e.children=[],e.apply(new jt(t.newChildNodes))}}class Kt extends y{constructor(t){super(),this.type=x.DELETE_CHILDREN,this.entityToBeRemoved=t}}class Ut extends ht{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 jt(t)),s.parent.apply(new Kt(s))}}}class Wt extends ht{handleAction(t,e){t.lineBreakNode=this.lineBreakSingleBlock(t.startContainerNode,t.startOffset,e)}lineBreakSingleBlock(t,e,s){if(t){const n=new RTETextNode(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),c=s.children.slice(o+1);r&&e.push(t.cloneWithText(r)),i&&c.unshift(t.cloneWithText(i)),this.mergeLineBreakNodes(e,n,c,s)}return n}}mergeLineBreakNodes(t,e,s,n){(0===s.length||s[0]&&""===s[0].text)&&s.push(new RTETextNode(l(),"\n",n,t[t.length-1]&&t[t.length-1].annotationMap)),n.apply(new Ht([...t,e,...s]))}}class Gt extends ht{handleAction(t,e){t.lineBreakNode=this.lineBreakMultipleBlocks(t.selectedBlocks,e)}lineBreakMultipleBlocks(t,e){const s=e.children,n=new RTETextNode(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 Kt(t)))})),e}mergeLineBreakNodes(t,e,s,n){(0===s.length||s[0]&&""===s[0].text)&&s.push(new RTETextNode(l(),"\n",n,t[t.length-1]&&t[t.length-1].annotationMap)),n.apply(new Ht([...t,e,...s]))}}class zt extends y{constructor(t,...e){super(),this.type=x.INSERT_CHILDREN_BEFORE,this.referChildren=t,this.childrenToBeInserted=e}}class Vt extends y{constructor(t,e){super(),this.type=x.SPLIT_BLOCK_WITH_NODE,this.splitPointNode=t,this.startOffsetOfNode=e}}class Xt extends P{constructor(t){super(),this.isFlushable=!0,this.textAlign=t}toAnnotation(){return new k(this.textAlign)}}class qt extends ht{handleAction(t,e){this.updateCustomStyleAnnotation(e,["textAlign"])}}class Yt extends P{constructor(t){super(),this.isFlushable=!0,this.indent=t}toAnnotation(){return new v(this.indent)}}class RTETextBlock extends RTEBlock{constructor(t,e,s){super(t),this.children=[],this.type=e;const{autoMatchFormat:n}=s||{autoMatchFormat:!0};n&&(this.annotationMap=RTETextBlock.isAcceptableTextStyle(e)?new Map([Dt.from(e)]):new Map([Dt.from("paragraph")]))}static from(t,e={autoMatchFormat:!0}){var s,n;const r=new RTETextBlock(t.id,t.type,e),i=e.autoMatchFormat?Object.assign(Object.assign({},t.annotations),{textStyle:null!==(n=null===(s=t.annotations)||void 0===s?void 0:s.textStyle)&&void 0!==n?n:r.type}):t.annotations;return r.children=t.nodes.map((t=>{const s=H.getRTENodeClass(t.type);if(s)return s.from(t,r,e)})).filter(c),i&&super.convertAnnotationsToMap(r.annotationMap,i),r}static createAnnotationEntity(t,e){return"textStyle"===t?Dt.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 wt&&t.needMergeNode){const t=null==n?void 0:n.getAnnotationByType(w.LINK),r=s.getAnnotationByType(w.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 RTETextBlock(l(),this.type);return e.annotationMap=super.cloneAnnotations(),e.apply(new jt(t)),e}clone(t){const e=new RTETextBlock(this.id,this.type);return e.children=this.children.map((t=>t.clone(e))),e.annotationMap=super.cloneAnnotations(),e.parent=t,e}isNotEmpty(){return this.children.length>0&&this.children.some((t=>!t.isEmpty()))}getLastNode(){return this.children[this.children.length-1]}getBlockTag(){switch(this.type){case"title":case"subtitle":return"div";case"heading-1":return"h1";case"heading-2":return"h2";case"heading-3":return"h3";case"heading-4":return"h4";case"heading-5":return"h5";case"heading-6":return"h6";case"paragraph":default:return"p"}}getChildrenHtml(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=j.get(t.constructor.name,RTETextBlock.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 c=i+1;for(;c<t.length&&(null===(n=t[c].getInlineHtmlTagAtDepth(e))||void 0===n?void 0:n.groupId)===o.groupId;)c++;if(c===i+1)r+=t[i].renderHtmlFromDepth(e,s);else{const n=this.renderGroupedNodesAtDepth(t.slice(i,c),e+1,s);r+=`<${o.htmlTag}${o.attrStr}>${n}</${o.htmlTag}>`}i=c}return r}generateLinkHtml(t,e,s){e="";let n=[];for(let r=0;r<this.children.length;r++){const i=this.children[r].getAnnotationByType(w.LINK),o=this.children[r+1]?this.children[r+1].getAnnotationByType(w.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}}j.register(It.name,RTETextBlock.name,new Mt),j.register(Xt.name,RTETextBlock.name,new qt),j.register(Yt.name,RTETextBlock.name,new class extends ht{handleAction(t,e){this.updateCustomStyleAnnotation(e,["marginLeft"])}}),j.register(at.name,RTETextBlock.name,new class extends ht{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)}}}),j.register(x.UNLINK_LINK_GROUP,RTETextBlock.name,new class extends ht{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))}}),j.register(x.SPLIT_BLOCK_WITH_NODE,RTETextBlock.name,new Pt),j.register(x.REPLACE_CHILD_NODES,RTETextBlock.name,new Jt),j.register(x.MERGE_TWO_BLOCKS_NODES,RTETextBlock.name,new Ut),j.register(x.LINE_BREAK_SINGLE_BLOCK,RTETextBlock.name,new Wt),j.register(x.LINE_BREAK_MULTIPLE_BLOCKS,RTETextBlock.name,new Gt),j.register(x.INSERT_IMAGE_TO_BLOCK,RTETextBlock.name,new class extends ht{handleAction(t,e){const s=t.splitPointNode,n=t.startOffsetOfNode,r=t.imageBlockToBeInserted;if(this.isCaretPositionAtBlockEnd(e,s,n))e.parent.apply(new Ft(e,r));else if(this.isCaretPositionAtBlockStart(e,s,n))e.parent.apply(new zt(e,r));else{const t=new Vt(s,n);e.apply(t),e.parent.apply(new Ft(e,r))}}}),j.register(x.TRANSFORM_LIST_BLOCK,RTETextBlock.name,new class extends ht{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 jt(i)),s.apply(new Ft(t.selectedBlocks[0],n)),r.forEach((t=>{t.parent.apply(new Kt(t))}))}});class Qt extends ht{getPreviousNode(t){const e=t.parent,s=e.children.indexOf(t);if(s>0)return e.children[s-1];if(e.parent){const t=this.getPreviousBlock(e);if(t)return this.getBlockLastNode(t)}}getNextNode(t){const e=t.parent,s=e.children.indexOf(t);if(e.children[s+1])return e.children[s+1];if(e.parent){const t=this.getNextBlock(e);if(t)return this.getBlockFirstNode(t)}}isContentFirstNode(t){const e=t.parent,s=e.children.indexOf(t),n=e.parent;if(e.isListItemBlock()){const t=n.parent;return 0===s&&Array.isArray(n.children)&&n.children[0]===e&&"list-item"!==t.type&&Array.isArray(t.children)&&t.children[0]===n}return 0===s&&Array.isArray(n.children)&&n.children[0]===e}getPreviousBlock(t){if(t&&t.parent&&t.parent.children){const e=t.parent.children.indexOf(t);if(e>0)return t.parent.children[e-1];if(this.isRTEBlock(t.parent)&&0===e)return this.getPreviousBlock(t.parent)}}getBlockLastNode(t){return t.getLastNode()}getBlockFirstNode(t){if("number-list"===t.type||"bullet-list"===t.type){if(t.children)return this.getBlockFirstNode(t.children[0])}else if(t.children)return t.children[0]}getNextBlock(t){if(t&&t.parent&&t.parent.children){const e=t.parent.children.indexOf(t);if(t.parent.children[e+1])return t.parent.children[e+1];if("list-item"===t.type&&t.parent.children.length===e+1)return this.getNextBlock(t.parent)}}isRTEBlock(t){return t&&"VegaRTEContent"!==t.constructor.name}}class Zt extends y{constructor(t,e){super(),this.isFlushable=!0,this.type=x.UPDATE_CODE_BLOCK,this.content=t,this.language=e}}class te extends P{constructor(t){super(),this.isFlushable=!1,this.range=t}toAnnotation(){return new K(this.range)}}class RTEDecoratorNode extends RTENode{constructor(){super(...arguments),this.type="decorator-node",this.isSelected=!1}static isDecoratorNodeContainerElement(t){return t&&t.classList.contains(RTEDecoratorNode.DECORATOR_CONTAINER_CLASS)}static getDecoratorNodeElement(t){return t.querySelector(`.${RTEDecoratorNode.DECORATOR_NODE_CLASS}`)}getRangeEndOffset(){return 1}getRangeContainer(){const t=this.getElementRef();if(t)return d(t,`.${RTEDecoratorNode.DECORATOR_CONTAINER_CLASS}`)}isContentEditable(){return!1}}RTEDecoratorNode.DECORATOR_CONTAINER_CLASS="v-internal-decorator-container",RTEDecoratorNode.DECORATOR_NODE_CLASS="v-internal-decorator-node";class ee extends N{constructor(){super(...arguments),this.stylesToBeFiltered=ee.STYLES,this.elementTagName="pre code"}canFilter(t){return S.isCodeBlockNode(t)}canRefill(t,e){return!1}toCssText(){return this.buildCssTextForStyles(this.elementTagName,this.classNameToBeAdded)}}ee.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 RTECodeBlockNode extends RTEDecoratorNode{constructor(t,e,s,n){super(t),this.type=O.CODE_BLOCK_NODE,this.text="",this.annotationMap=new Map,this.text=e,this.parent=n,this.language=s,this.annotationMap.set(A.CUSTOM_STYLE,new D(ee.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 RTECodeBlockNode(this.id,this.text,this.language,t)}doAnnotationActionApply(t){j.executeTheStrategy(t,this)}doModifyActionApply(t){j.executeTheStrategy(t,this)}}j.register(x.UPDATE_CODE_BLOCK,RTECodeBlockNode.name,new class extends ht{handleAction(t,e){const{content:s,language:n}=t;e.language=n,e.text=s}}),j.register(te.name,RTECodeBlockNode.name,new class extends ht{handleAction(t,e){e.annotationMap.set(p.SELECTION_RANGE,t.toAnnotation())}});var se;!function(t){t.CSS="css",t.HTML="html",t.JavaScript="js",t.JSX="jsx",t["Plain Text"]="plainText",t.TypeScript="ts",t.TSX="tsx"}(se||(se={}));class ne extends ht{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 Kt(e)))}}class re extends N{constructor(){super(...arguments),this.stylesToBeFiltered=re.STYLES,this.elementTagName="pre"}canFilter(t){return S.isCodeBlock(t.constructor.name)}canRefill(t,e){return!1}toCssText(){return this.buildCssTextForStyles(this.elementTagName,this.classNameToBeAdded)}}re.STYLES={backgroundColor:"rgba(var(--v-bg-secondary, 245, 247, 247, 1))",padding:"12px"};class RTECodeBlock extends RTEBlock{constructor(t,e,s){super(t),this.type="code-block",this.annotationMap=new Map([D.from(re.STYLES)]),this.children=[new RTECodeBlockNode(`${t}-1`,e,s,this)]}static from(t){return new RTECodeBlock(t.id,t.content,t.language)}toJSON(){const{language:t,text:e}=this.children[0];return{id:this.id,type:"code-block",content:e,language:t}}toHtml(t){const{language:e=se["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=RTECodeBlock.from(this.toJSON());return e.parent=t,e}apply(n){if(n instanceof y&&j.executeTheStrategy(n,this),n.isFlushable){const n=g.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)}}j.register(x.DELETE_CODE_BLOCK,RTECodeBlock.name,new class extends Qt{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 Kt(e));const i=t?g.getDOMByEntity(t):null;if(0===n.children.length){const s=RTETextBlock.from({id:l(),type:"paragraph",nodes:[{id:l(),type:"text",text:""}]});e.parent.apply(new jt([s])),t=s.children[0],r=0}this.notifyUpdateSelection(t,i,r,e)}}notifyUpdateSelection(s,r,i,o){const c=g.getDOMByEntity(o);if(c){const o=e.getSubjectFromParentNodeByEventId(c,n);o&&t.notify(o,{node:s,updateDirectly:!!r,offset:i})}}getRTENodeEndOffset(t){return t?t.getRangeEndOffset():0}}),j.register(x.DELETE_CHILDREN,RTECodeBlock.name,new ne),j.register(x.SWITCH_OUT_FROM_CODE_BLOCK,RTECodeBlock.name,new class extends ht{handleAction(s,r){const{content:i,language:o}=s,c=i.split("\n"),a=new Zt(c.slice(0,c.length-2).join("\n"),o);a.isFlushable=!1,r.children[0].apply(a);const h=RTETextBlock.from({id:l(),type:"paragraph",nodes:[{id:l(),text:"",type:"text"}]});r.parent.apply(new Ft(r,h));const u=g.getDOMByEntity(r);if(u){const s=e.getSubjectFromParentNodeByEventId(u,n);s&&t.notify(s,{node:h.children[0]})}}}),j.register(x.INSERT_IMAGE_TO_BLOCK,RTECodeBlock.name,new class extends ht{handleAction(t,e){e.parent.apply(new Ft(e,t.imageBlockToBeInserted))}}),RTECodeBlock.CODE_BLOCK_PLACEHOLDER_CLASS_NAME="code-block-placeholder-element";export{tt as $,j as A,E as B,A as C,L as D,RTECodeBlock as E,w as F,RTEDecoratorNode as G,Xt as H,Ft as I,O as J,_ as K,Ht as L,y as M,R as N,Vt as O,it as P,Qt as Q,F as R,lt as S,It as T,Rt as U,rt as V,ne as W,W as X,U as Y,m as Z,et as _,B as a,G as a0,V as a1,z as a2,Dt as a3,S as a4,k as a5,Z as a6,C as a7,re as a8,RTECodeBlockNode as a9,ee as aa,se as ab,nt as ac,st as ad,wt as ae,Zt as af,te as ag,Bt as ah,pt as ai,xt as aj,Ot as ak,Q as al,Tt as am,Et as an,At as ao,Yt as ap,H as b,RTETextNode as c,RTEBlock as d,RTETextBlock as e,M as f,ht as g,jt as h,RTENode as i,zt as j,p as k,x as l,P as m,Kt as n,$ as o,N as p,Mt as q,qt as r,g as s,Wt as t,Gt as u,Pt as v,Jt as w,Ut as x,f as y,D as z}
@@ -1 +1 @@
1
- import{h as t,r as e,H as i,g as n}from"./p-6b2342e0.js";import{s}from"./p-519a7d55.js";import{c as r,V as a,I as o}from"./p-6e1ab235.js";import{V as l,I as c}from"./p-4415ad28.js";var p=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};class f extends a{render(){return t("vega-flex",{"align-items":"start","justify-content":"start",gap:"size-8",class:"small"===this.size?"section-title-small":void 0},this.renderPrefixIcon(),this.renderText())}renderPrefixIcon(){return this.icon&&"left"===this.iconAlign&&t("div",{class:"section-title-icon-container"},this.renderIcon())}renderText(){return t("vega-flex",{class:"vega-flex-grow",direction:"col","align-items":"start","justify-content":"start",gap:"size-4"},this.renderTitle(),this.renderDescription())}renderTitle(){return t("div",{class:"section-title-text vega-flex-grow"},t("span",null,this.titleText),this.renderSuffixIcon())}renderDescription(){return t("div",{class:"section-title-description"},this.description)}renderSuffixIcon(){return this.icon&&"right"===this.iconAlign&&t("div",{class:"right-icon-container"},this.renderIcon())}renderIcon(){return t("vega-icon",{icon:this.icon,color:this.iconColor,size:"small"===this.size?"size-16":"size-20",class:"vega-flex-shrink-0"})}}p([r()],f.prototype,"host",void 0),p([r()],f.prototype,"titleText",void 0),p([r()],f.prototype,"description",void 0),p([r()],f.prototype,"icon",void 0),p([r()],f.prototype,"iconAlign",void 0),p([r()],f.prototype,"iconColor",void 0),p([r()],f.prototype,"size",void 0);var h=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};const x=class{constructor(t){e(this,t),this.globalSlimmers={},this.renderer=new f,this.vegaComponentUsageRuntimeMetricsSlimmer=new l,this.titleText="",this.iconAlign="left",this.iconColor="text-primary",this.size="default"}render(){return s(t(i,null,this.renderer.render()),this.host)}get host(){return n(this)}};h([c()],x.prototype,"globalSlimmers",void 0),h([o()],x.prototype,"renderer",void 0),h([o()],x.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),x.style=':host{display:block}.section-title-text{color:rgba(var(--v-text-primary, 32, 54, 69, 1));font-family:"Inter", sans-serif;font-size:20px;font-weight:700;line-height:28px;letter-spacing:0px}@media screen and (min-width: 768px) and (max-width: 1023px){.section-title-text{font-family:"Inter", sans-serif;font-size:20px;font-weight:700;line-height:28px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.section-title-text{font-family:"Inter", sans-serif;font-size:20px;font-weight:700;line-height:28px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.section-title-text{font-family:"Inter", sans-serif;font-size:20px;font-weight:700;line-height:28px;letter-spacing:0px}}.section-title-description{font-family:"Inter", sans-serif;font-size:18px;font-weight:500;line-height:28px;letter-spacing:0px;color:rgba(var(--v-text-secondary, 107, 116, 125, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){.section-title-description{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){.section-title-description{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){.section-title-description{font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px}}.section-title-icon-container{margin-top:4px}.right-icon-container{display:inline-block;margin-left:8px;margin-top:4px;vertical-align:middle}.section-title-small .section-title-text{font-family:"Inter", sans-serif;font-size:18px;font-weight:700;line-height:25px;letter-spacing:0px}@media screen and (min-width: 768px) and (max-width: 1023px){.section-title-small .section-title-text{font-family:"Inter", sans-serif;font-size:18px;font-weight:700;line-height:25px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.section-title-small .section-title-text{font-family:"Inter", sans-serif;font-size:18px;font-weight:700;line-height:25px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.section-title-small .section-title-text{font-family:"Inter", sans-serif;font-size:18px;font-weight:700;line-height:25px;letter-spacing:0px}}';export{x as vega_section_title}
1
+ import{h as t,r as e,H as i,g as n}from"./p-6b2342e0.js";import{s}from"./p-519a7d55.js";import{c as r,V as a,I as o}from"./p-6e1ab235.js";import{V as l,I as c}from"./p-8ce9e214.js";var p=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};class f extends a{render(){return t("vega-flex",{"align-items":"start","justify-content":"start",gap:"size-8",class:"small"===this.size?"section-title-small":void 0},this.renderPrefixIcon(),this.renderText())}renderPrefixIcon(){return this.icon&&"left"===this.iconAlign&&t("div",{class:"section-title-icon-container"},this.renderIcon())}renderText(){return t("vega-flex",{class:"vega-flex-grow",direction:"col","align-items":"start","justify-content":"start",gap:"size-4"},this.renderTitle(),this.renderDescription())}renderTitle(){return t("div",{class:"section-title-text vega-flex-grow"},t("span",null,this.titleText),this.renderSuffixIcon())}renderDescription(){return t("div",{class:"section-title-description"},this.description)}renderSuffixIcon(){return this.icon&&"right"===this.iconAlign&&t("div",{class:"right-icon-container"},this.renderIcon())}renderIcon(){return t("vega-icon",{icon:this.icon,color:this.iconColor,size:"small"===this.size?"size-16":"size-20",class:"vega-flex-shrink-0"})}}p([r()],f.prototype,"host",void 0),p([r()],f.prototype,"titleText",void 0),p([r()],f.prototype,"description",void 0),p([r()],f.prototype,"icon",void 0),p([r()],f.prototype,"iconAlign",void 0),p([r()],f.prototype,"iconColor",void 0),p([r()],f.prototype,"size",void 0);var h=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};const x=class{constructor(t){e(this,t),this.globalSlimmers={},this.renderer=new f,this.vegaComponentUsageRuntimeMetricsSlimmer=new l,this.titleText="",this.iconAlign="left",this.iconColor="text-primary",this.size="default"}render(){return s(t(i,null,this.renderer.render()),this.host)}get host(){return n(this)}};h([c()],x.prototype,"globalSlimmers",void 0),h([o()],x.prototype,"renderer",void 0),h([o()],x.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),x.style=':host{display:block}.section-title-text{color:rgba(var(--v-text-primary, 32, 54, 69, 1));font-family:"Inter", sans-serif;font-size:20px;font-weight:700;line-height:28px;letter-spacing:0px}@media screen and (min-width: 768px) and (max-width: 1023px){.section-title-text{font-family:"Inter", sans-serif;font-size:20px;font-weight:700;line-height:28px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.section-title-text{font-family:"Inter", sans-serif;font-size:20px;font-weight:700;line-height:28px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.section-title-text{font-family:"Inter", sans-serif;font-size:20px;font-weight:700;line-height:28px;letter-spacing:0px}}.section-title-description{font-family:"Inter", sans-serif;font-size:18px;font-weight:500;line-height:28px;letter-spacing:0px;color:rgba(var(--v-text-secondary, 107, 116, 125, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){.section-title-description{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){.section-title-description{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){.section-title-description{font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px}}.section-title-icon-container{margin-top:4px}.right-icon-container{display:inline-block;margin-left:8px;margin-top:4px;vertical-align:middle}.section-title-small .section-title-text{font-family:"Inter", sans-serif;font-size:18px;font-weight:700;line-height:25px;letter-spacing:0px}@media screen and (min-width: 768px) and (max-width: 1023px){.section-title-small .section-title-text{font-family:"Inter", sans-serif;font-size:18px;font-weight:700;line-height:25px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.section-title-small .section-title-text{font-family:"Inter", sans-serif;font-size:18px;font-weight:700;line-height:25px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.section-title-small .section-title-text{font-family:"Inter", sans-serif;font-size:18px;font-weight:700;line-height:25px;letter-spacing:0px}}';export{x as vega_section_title}
@@ -0,0 +1 @@
1
+ import{h as e,F as t,H as i,r as o,c as a,g as r}from"./p-6b2342e0.js";import{R as s}from"./p-280cbcdb.js";import{g as n,s as d}from"./p-519a7d55.js";import{Z as p,_ as c}from"./p-25983017.js";import{c as l,M as h,V as f,I as b}from"./p-6e1ab235.js";import{V as m,I as v}from"./p-8ce9e214.js";import{F as g}from"./p-ffc58d14.js";import{C as x}from"./p-eca16761.js";import{c as u}from"./p-de7109d3.js";import{p as w,v as y,V as j,g as R,i as I,q as C}from"./p-9af0e2e7.js";import{F as k}from"./p-a528714c.js";import{C as O}from"./p-2d0d575f.js";import{c as D}from"./p-6ac8e655.js";import{D as S}from"./p-11e2dcf5.js";import{l as z}from"./p-6c43d54a.js";import{h as E,l as A}from"./p-f0e828d8.js";import{K as V}from"./p-c4e71db7.js";import{f as L}from"./p-ec2a1d4c.js";import{M as T}from"./p-78a57a17.js";import{T as F}from"./p-52b8f2d2.js";import"./p-abd7aeaa.js";import"./p-ed45b3b6.js";import"./p-d4ea8e22.js";import"./p-d884c644.js";import"./p-43ed14c4.js";import"./p-02841589.js";import"./p-331a62d5.js";import"./p-8b5d3a52.js";import"./p-6a334573.js";import"./p-81dd00d0.js";import"./p-49a2e141.js";import"./p-b75ee3ba.js";import"./p-d27ae9ff.js";import"./p-262ec334.js";import"./p-158108ea.js";import"./p-f1c672e4.js";import"./p-5f377954.js";import"./p-dcf162e9.js";import"./p-982747ef.js";import"./p-78ca326c.js";const _=[{payloadKey:"AUTO_VALIDATION_IS_TRUE",payloadDescription:"Determines whether automatic validation should be implemented when a value is edited in the combo box",payloadValue:e=>!0===e.autoValidation},{payloadKey:"AUTO_VALIDATION_IS_FALSE",payloadDescription:"Determines whether automatic validation should be implemented when a value is edited in the combo box",payloadValue:e=>!1===e.autoValidation}];var K=function(e,t,i,o){var a,r=arguments.length,s=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,o);else for(var n=e.length-1;n>=0;n--)(a=e[n])&&(s=(r<3?a(s):r>3?a(t,i,s):a(t,i))||s);return r>3&&s&&Object.defineProperty(t,i,s),s};class N extends f{constructor(){super(...arguments),this.onItemClick=async()=>{this.valueController.setValue(await this.dropdownRef.getSelection()),await this.clearInput()},this.onDropdownHide=async()=>{await this.clearInput()},this.onDropdownCreate=async e=>{this.createEventEmit.emit(e),await this.clearInput()},this.onInputChange=async e=>{const t=e.target.value;(this.useDefaultFilter||this.vegaDropdownProps.dynamicOption)&&(await this.dropdownRef.show(),await this.dropdownRef.search(t)),!this.isTemplateMode&&this.useDefaultFilter||this.searchEventEmit.emit(t)}}connectedCallback(){this.isTemplateMode=null!==this.host.querySelector("[slot=items]")}getDropdownRef(){return this.dropdownRef}getSearchInputRef(){return this.searchInputRef}focusInput(){this.searchInputRef.focus()}async hide(){await this.dropdownRef.hide()}async show(){await this.dropdownRef.show()}replaceItemsSlot(e){e&&this.itemsSlotRef&&(this.itemsSlotRef.remove(),this.dropdownRef.append(e))}renderDropdown(){return e("vega-dropdown",Object.assign({trigger:this.disabled?"none":"click",source:this.source,selectType:"multiple",selectedSourceKey:this.value,matchTargetWidth:!0,useDefaultFilter:this.useDefaultFilter},this.vegaDropdownProps,{ref:e=>{this.dropdownRef=e,S.addUniqueObserverToNode(e,w,(async e=>{await this.onDropdownCreate(e.detail)})),S.addUniqueObserverToNode(e,y,(async()=>{await this.onDropdownHide()})),S.addUniqueObserverToNode(e,j,(async()=>{await this.onItemClick()})),S.addUniqueObserverToNode(e,z,(e=>{const t=Array.from(e).filter((e=>!this.source.find((t=>t.key===e.itemKey)))).map((e=>({key:e.itemKey,label:e.label})));this.sourceController.setSource([...this.source,...t])}))}}),this.renderContainer(),this.renderItemsSlot())}renderContainer(){return e("div",{class:{"vega-combo-box-container":!0,[`vega-combo-box-size-${this.size}`]:!0}},this.renderSelectedContainer(),this.renderInputContainer())}renderItemsSlot(){return this.isTemplateMode&&e("div",{slot:"items",ref:e=>{this.itemsSlotRef=e}})}renderSelectedContainer(){const i=this.value.map((e=>this.source.find((t=>t.key===e)))).filter((e=>e));return e(t,null,i.map((e=>this.renderSelectedChip(e))))}renderSelectedChip(t){return e("vega-chip",{key:t.key,text:E.sanitize(t.label,A),variant:"outlined",showCloseIcon:!this.disabled,size:"small",ref:e=>{S.addUniqueObserverToNode(e,R,(async()=>{await this.onChipClose(t.key)}))}})}renderInputContainer(){return e("div",{class:"vega-combo-box-input-container"},e("input",{onInput:this.onInputChange,"aria-label":this.label||"No label defined",placeholder:0===this.value.length?this.placeholder:"",ref:e=>this.searchInputRef=e,onKeyDown:D(),disabled:this.disabled}))}async onChipClose(e){this.valueController.setValue([...this.value.filter((t=>t!==e))]),await this.dropdownRef.hide()}async clearInput(){this.searchInputRef.value="",await this.dropdownRef.search("")}}K([l()],N.prototype,"host",void 0),K([l()],N.prototype,"value",void 0),K([l()],N.prototype,"source",void 0),K([l()],N.prototype,"disabled",void 0),K([l()],N.prototype,"size",void 0),K([l()],N.prototype,"vegaDropdownProps",void 0),K([l()],N.prototype,"label",void 0),K([l()],N.prototype,"placeholder",void 0),K([l()],N.prototype,"useDefaultFilter",void 0),K([l()],N.prototype,"createEventEmit",void 0),K([l()],N.prototype,"searchEventEmit",void 0),K([l()],N.prototype,"valueController",void 0),K([l()],N.prototype,"sourceController",void 0),K([h("connectedCallback")],N.prototype,"connectedCallback",null);class q extends f{setValue(e){this.value=e}}!function(e,t,i,o){var a,r=arguments.length,s=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,o);else for(var n=e.length-1;n>=0;n--)(a=e[n])&&(s=(r<3?a(s):r>3?a(t,i,s):a(t,i))||s);r>3&&s&&Object.defineProperty(t,i,s)}([l({writable:!0})],q.prototype,"value",void 0);var G=function(e,t,i,o){var a,r=arguments.length,s=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,o);else for(var n=e.length-1;n>=0;n--)(a=e[n])&&(s=(r<3?a(s):r>3?a(t,i,s):a(t,i))||s);return r>3&&s&&Object.defineProperty(t,i,s),s};class H extends f{constructor(){super(...arguments),this.onLabelClick=()=>{this.dropdownRenderer.focusInput()}}render(){return e(i,{class:{"vega-combo-box-disabled":this.disabled}},this.renderLabel(),this.dropdownRenderer.renderDropdown(),this.renderHint())}renderLabel(){return e("vega-field-label",{onClick:this.onLabelClick,"is-field-required":this.required,disabled:this.disabled,label:this.label})}renderHint(){return e("div",{class:"vega-combo-box-hint"},this.hint)}}G([l()],H.prototype,"required",void 0),G([l()],H.prototype,"hint",void 0),G([l()],H.prototype,"disabled",void 0),G([l()],H.prototype,"dropdownRenderer",void 0),G([l()],H.prototype,"label",void 0);var M=function(e,t,i,o){var a,r=arguments.length,s=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,o);else for(var n=e.length-1;n>=0;n--)(a=e[n])&&(s=(r<3?a(s):r>3?a(t,i,s):a(t,i))||s);return r>3&&s&&Object.defineProperty(t,i,s),s};class P extends V{constructor(){super((e=>[{keyCode:"Backspace",activeElementInScope:[e.dropdownRenderer.getSearchInputRef()],eventName:"keydown",callback:e.deleteLastSelectedItem},{keyCode:"ArrowLeft",activeElementInScope:[e.host],callback:()=>e.controlDirectionByKeyboard("ArrowLeft")},{keyCode:"ArrowRight",activeElementInScope:[e.host],callback:()=>e.controlDirectionByKeyboard("ArrowRight")}])),this.deleteLastSelectedItem=()=>{""===this.dropdownRenderer.getSearchInputRef().value&&(this.value.pop(),this.valueController.setValue([...this.value]))}}controlDirectionByKeyboard(e){const t=n();if(t&&t.classList.contains("vega-chip-close-icon")){const i=L(t,"vega-chip");"ArrowLeft"===e&&this.focusItemByKeyboard(i.previousSibling),"ArrowRight"===e&&this.focusItemByKeyboard(i.nextSibling)}else"ArrowLeft"===e&&0===this.dropdownRenderer.getSearchInputRef().selectionStart&&this.focusItemByKeyboard(this.host.shadowRoot.querySelector("vega-chip:last-of-type"))}focusItemByKeyboard(e){e&&(e.classList.contains("vega-combo-box-input-container")?e.querySelector("input").focus():e.shadowRoot.querySelector(".vega-chip-close-icon").focus())}}M([l()],P.prototype,"host",void 0),M([l()],P.prototype,"value",void 0),M([l()],P.prototype,"dropdownRenderer",void 0),M([l()],P.prototype,"valueController",void 0);var U=function(e,t,i,o){var a,r=arguments.length,s=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,o);else for(var n=e.length-1;n>=0;n--)(a=e[n])&&(s=(r<3?a(s):r>3?a(t,i,s):a(t,i))||s);return r>3&&s&&Object.defineProperty(t,i,s),s};class B extends f{constructor(){super(...arguments),this.mutationObserver=new T({mutationFilter:F("VEGA-DROPDOWN-ITEM"),options:{childList:!0,subtree:!0},callback:()=>this.appendHostItemsToDropdown()})}componentDidLoad(){this.appendHostItemsToDropdown()}appendHostItemsToDropdown(){this.dropdownRenderer.replaceItemsSlot(this.host.querySelector("[slot=items]"))}}U([b()],B.prototype,"mutationObserver",void 0),U([l()],B.prototype,"host",void 0),U([l()],B.prototype,"dropdownRenderer",void 0),U([h("componentDidLoad")],B.prototype,"componentDidLoad",null);class W extends f{setSource(e){this.source=e}}!function(e,t,i,o){var a,r=arguments.length,s=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,o);else for(var n=e.length-1;n>=0;n--)(a=e[n])&&(s=(r<3?a(s):r>3?a(t,i,s):a(t,i))||s);r>3&&s&&Object.defineProperty(t,i,s)}([l({writable:!0})],W.prototype,"source",void 0);var Z=function(e,t,i,o){var a,r=arguments.length,s=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,o);else for(var n=e.length-1;n>=0;n--)(a=e[n])&&(s=(r<3?a(s):r>3?a(t,i,s):a(t,i))||s);return r>3&&s&&Object.defineProperty(t,i,s),s};const $=class{constructor(e){o(this,e),this.vegaChange=a(this,"vegaChange",7),this.change=a(this,"change",7),this.vegaCreate=a(this,"vegaCreate",7),this.create=a(this,"create",7),this.vegaSearch=a(this,"vegaSearch",7),this.search=a(this,"search",7),this.globalSlimmers={},this.itemsSlotController=new B,this.keyboardController=new P,this.valueController=new q,this.sourceController=new W,this.renderer=new H,this.dropdownRenderer=new N,this.formFieldController=new g({propertyRules:[{propertyName:"required",ruleFactory:e=>e?new s:null}],validationRulesName:"validationRules",defaultValue:[],attributeGetter:e=>this[e],inputContainerGetter:()=>this.dropdownRenderer.getDropdownRef(),touchableAreaGetter:()=>[this.dropdownRenderer.getSearchInputRef()]}),this.changeEventEmit=u($,I),this.createEventEmit=u($,w),this.searchEventEmit=u($,C),this.dropdownEventPrevent=new x([w,C],(()=>this.dropdownRenderer.getDropdownRef()),{customPreventHandle:e=>{e.stopImmediatePropagation()}}),this.vegaComponentUsageRuntimeMetricsSlimmer=new m(_),this.label="",this.required=!1,this.source=[],this.value=[],this.isValid=null,this.autoValidation=!0,this.validationRules=[],this.disabled=!1,this.placeholder="",this.hint="",this.size="medium",this.vegaDropdownProps={},this.useDefaultFilter=!0}watchSource(){this.source=p(this.source,c)?this.source:[]}watchValue(){this.changeEventEmit.emit(this.value),O.notify(k,{host:this.host,detail:this.value})}watchValidationRules(){}async close(){this.disabled||await this.dropdownRenderer.hide()}async open(){this.disabled||await this.dropdownRenderer.show()}render(){return d(this.renderer.render(),this.host)}get host(){return r(this)}static get watchers(){return{source:["watchSource"],value:["watchValue"],validationRules:["watchValidationRules"]}}};Z([v()],$.prototype,"globalSlimmers",void 0),Z([b()],$.prototype,"itemsSlotController",void 0),Z([b()],$.prototype,"keyboardController",void 0),Z([b()],$.prototype,"valueController",void 0),Z([b()],$.prototype,"sourceController",void 0),Z([b()],$.prototype,"renderer",void 0),Z([b()],$.prototype,"dropdownRenderer",void 0),Z([b()],$.prototype,"formFieldController",void 0),Z([b()],$.prototype,"changeEventEmit",void 0),Z([b()],$.prototype,"createEventEmit",void 0),Z([b()],$.prototype,"searchEventEmit",void 0),Z([b()],$.prototype,"dropdownEventPrevent",void 0),Z([b()],$.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),$.style=':host{display:inline-block;width:100%;min-width:0px;text-align:left;line-height:normal}.vega-combo-box-container{border:1px solid rgba(var(--v-border-input-field, 171, 198, 216, 1));background-color:rgba(var(--v-bg-primary, 252, 252, 252, 1));padding-left:16px;padding-right:16px;padding-top:12px;padding-bottom:12px;border-radius:8px;gap:8px;display:block;display:flex;flex-wrap:wrap;align-items:center;cursor:pointer}.vega-combo-box-container:hover{border:1px solid rgba(var(--v-border-input-field-hover, 115, 160, 190, 1))}.vega-combo-box-container:focus-within{border:1px solid rgba(var(--v-border-input-field-focus, 19, 98, 226, 1));outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:2px}.vega-combo-box-container .vega-combo-box-input-container{width:-webkit-min-content;width:-moz-min-content;width:min-content;flex-grow:1}.vega-combo-box-container input{border-style:none;background-color:rgba(var(--v-bg-transparent, 0, 0, 0, 0));font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px;color:rgba(var(--v-text-primary, 32, 54, 69, 1));width:100%}@media screen and (min-width: 768px) and (max-width: 1023px){.vega-combo-box-container input{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.vega-combo-box-container input{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.vega-combo-box-container input{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}.vega-combo-box-container input:focus{outline:2px solid transparent;outline-offset:2px}.vega-combo-box-size-medium{padding-left:12px;padding-right:12px;padding-top:11px;padding-bottom:11px}.vega-combo-box-size-small{padding-left:12px;padding-right:12px;padding-top:7px;padding-bottom:7px}.vega-combo-box-container:focus{outline:none}vega-field-label{margin-bottom:8px}.error .vega-combo-box-container{border:1px solid rgba(var(--v-border-input-field-danger, 230, 50, 87, 1))}.error .vega-combo-box-container:hover{border:1px solid rgba(var(--v-border-input-field-danger-hover, 255, 87, 114, 1))}.error .vega-combo-box-container:focus-within{border:1px solid rgba(var(--v-border-input-field-danger-focus, 233, 71, 104, 1));outline:2px solid rgba(var(--v-border-color-danger, 230, 50, 87, 1));outline-offset:2px}:host(.vega-combo-box-disabled) .vega-combo-box-container{border:1px solid rgba(var(--v-border-input-field-disabled, 222, 225, 227, 1));background-color:rgba(var(--v-bg-secondary, 245, 247, 247, 1));--tw-shadow:0 0 #0000;box-shadow:rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0) 0px 0px 0px 0px}:host(.vega-combo-box-disabled) .vega-combo-box-container:hover{border:1px solid rgba(var(--v-border-input-field-disabled, 222, 225, 227, 1))}:host(.vega-combo-box-disabled) vega-icon{color:rgba(var(--v-text-disabled, 176, 180, 181, 1))}.vega-combo-box-container input::placeholder{color:rgba(var(--v-text-input-placeholder, 176, 180, 181, 1))}.vega-error{display:inline-block;padding-left:8px;padding-right:8px;padding-top:8px;font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px;color:rgba(var(--v-text-error, 189, 41, 71, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){.vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}.vega-hidden{display:none}.vega-combo-box-hint{padding-left:8px;padding-right:8px;font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px;color:rgba(var(--v-text-secondary, 107, 116, 125, 1));padding-top:8px}@media screen and (min-width: 768px) and (max-width: 1023px){.vega-combo-box-hint{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.vega-combo-box-hint{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.vega-combo-box-hint{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}.vega-error:not(.vega-hidden)+.vega-combo-box-hint{padding-top:4px}vega-dropdown{display:block}';export{$ as vega_combo_box}
@@ -1 +1 @@
1
- import{r as t,h as e,H as i,F as s,g as a}from"./p-6b2342e0.js";import{s as n}from"./p-519a7d55.js";import{I as r}from"./p-6e1ab235.js";import{V as o,I as p}from"./p-4415ad28.js";import{V as l}from"./p-8aee6b74.js";import{B as h}from"./p-7cd2b93b.js";import"./p-a528714c.js";import"./p-2d0d575f.js";import"./p-331a62d5.js";import"./p-fb5ea4b2.js";import"./p-4866e390.js";import"./p-b75ee3ba.js";import"./p-f0e828d8.js";const c=`© ${(new Date).getFullYear()} Heartland Payment Systems, LLC – a Global Payments company. All rights reserved.`,f=`© ${(new Date).getFullYear()} Global Payments Inc. All rights reserved.`;var d=function(t,e,i,s){var a,n=arguments.length,r=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(r=(n<3?a(r):n>3?a(e,i,r):a(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};const g=class{constructor(e){t(this,e),this.globalSlimmers={},this.vegaComponentUsageRuntimeMetricsSlimmer=new o,this.brandSwitchControllerSlimmer=new h,this.googlePrivacyPolicyUrl="https://policies.google.com/privacy",this.googleTermsOfServiceUrl="https://policies.google.com/terms",this.currentBranding=l.getBranding(),this.content=this.getDefaultContent(),this.termOfUseLabel="Terms of Use",this.termOfUseUrl=this.getDefaultTermsOfUseUrl(),this.termOfUseUrlTarget="_self",this.privacyPolicyLabel="Privacy Policy",this.privacyPolicyUrl=this.getDefaultPrivacyPolicyUrl(),this.privacyPolicyUrlTarget="_self",this.hideDefaultLinks=!1,this.additionalLinks=[],this.showDisclaimer=!1,this.disclaimerUrlTarget="_self"}render(){return n(e(i,{class:"v-text-center"},this.renderContent(),this.renderLinks(),this.renderDisclaimer()),this.host)}getDefaultContent(){return"heartland"===l.getBranding()?c:f}getDefaultTermsOfUseUrl(){return"heartland"===l.getBranding()?"https://www.heartland.us/terms":"https://www.globalpayments.com/terms-of-use"}getDefaultPrivacyPolicyUrl(){return"heartland"===l.getBranding()?"https://www.heartland.us/privacy-policy":"https://www.globalpayments.com/privacy-statement"}renderContent(){return e("div",{class:"vega-app-footer-content"},this.content!==f&&this.content!==c?this.content:this.getDefaultContent())}renderLinks(){return e("div",{class:"vega-link"},this.hideDefaultLinks?null:this.renderDefaultLinks(),this.additionalLinks.length?this.renderAdditionalLinks():null)}renderDefaultLinks(){return e(s,null,e("a",{id:this.termOfUseUrlId,target:this.termOfUseUrlTarget,href:this.getTermsOfUseUrl()},this.termOfUseLabel),e("span",{class:"v-separator"}),e("a",{id:this.privacyPolicyUrlId,target:this.privacyPolicyUrlTarget,href:this.getPrivacyPolicyUrl()},this.privacyPolicyLabel))}getTermsOfUseUrl(){return"https://www.heartland.us/terms"!==this.termOfUseUrl&&"https://www.globalpayments.com/terms-of-use"!==this.termOfUseUrl?this.termOfUseUrl:this.getDefaultTermsOfUseUrl()}getPrivacyPolicyUrl(){return"https://www.heartland.us/privacy-policy"!==this.privacyPolicyUrl&&"https://www.globalpayments.com/privacy-statement"!==this.privacyPolicyUrl?this.privacyPolicyUrl:this.getDefaultPrivacyPolicyUrl()}renderAdditionalLinks(){return e(s,null,this.hideDefaultLinks?null:e("span",{class:"v-separator"}),this.additionalLinks.map(((t,i)=>t.URL&&t.label&&e(s,null,e("a",{id:t.id,target:t.target,href:t.URL},t.label),this.additionalLinks.length===i+1?null:e("span",{class:"v-separator"})))))}renderDisclaimer(){return this.showDisclaimer&&e("div",{class:"vega-app-footer-disclaimer"},e("div",{class:"h-separator"}),e("div",{class:"vega-app-footer-disclaimer-content vega-link"},"This site is protected by reCAPTCHA and the"," ",e("a",{target:this.disclaimerUrlTarget,href:this.googlePrivacyPolicyUrl}," ","Google Privacy Policy"," ")," ","and"," ",e("a",{target:this.disclaimerUrlTarget,href:this.googleTermsOfServiceUrl}," ","Google Terms of Service"," "),"apply."))}get host(){return a(this)}};d([p()],g.prototype,"globalSlimmers",void 0),d([r()],g.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),d([r()],g.prototype,"brandSwitchControllerSlimmer",void 0),g.style=':host{display:block;padding-left:0px;padding-right:0px}:host .h-separator{height:1px;background-color:rgba(var(--v-bg-divider, 171, 198, 216, 1));margin-top:20px;margin-bottom:20px}:host .v-separator{display:inline-block;width:1px;margin-left:8px;margin-right:8px;background-color:rgba(70, 71, 101, 0.8)}:host>.vega-link{display:flex;align-items:stretch;justify-content:center;flex-wrap:wrap}:host>.vega-link a{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}@media screen and (min-width: 768px) and (max-width: 1023px){:host>.vega-link a{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host>.vega-link a{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host>.vega-link a{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}:host .vega-app-footer-content{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px;color:rgba(var(--v-text-primary, 32, 54, 69, 1));margin-bottom:8px}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-app-footer-content{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .vega-app-footer-content{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .vega-app-footer-content{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}:host .vega-app-footer-disclaimer-content{font-family:"Inter", sans-serif;font-size:12px;font-weight:400;line-height:16px;letter-spacing:0px;color:rgba(var(--v-text-primary, 32, 54, 69, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-app-footer-disclaimer-content{font-family:"Inter", sans-serif;font-size:12px;font-weight:400;line-height:16px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .vega-app-footer-disclaimer-content{font-family:"Inter", sans-serif;font-size:12px;font-weight:400;line-height:16px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .vega-app-footer-disclaimer-content{font-family:"Inter", sans-serif;font-size:12px;font-weight:400;line-height:16px;letter-spacing:0px}}:host(.v-text-center){text-align:center}:host .vega-link a{color:rgba(var(--v-text-link, 19, 98, 226, 1));border-radius:4px;text-decoration:none}:host .vega-link a:visited{color:rgba(var(--v-text-link-visited, 95, 56, 206, 1))}:host .vega-link a:hover{color:rgba(var(--v-text-link-hover, 4, 112, 236, 1));text-decoration:underline}:host .vega-link a:focus{color:rgba(var(--v-text-link-focus, 4, 112, 236, 1));outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:2px}:host .vega-link a:active{color:rgba(var(--v-text-link-active, 29, 65, 195, 1));text-decoration:underline}';export{g as vega_app_footer}
1
+ import{r as t,h as e,H as i,F as s,g as a}from"./p-6b2342e0.js";import{s as n}from"./p-519a7d55.js";import{I as r}from"./p-6e1ab235.js";import{V as o,I as p}from"./p-8ce9e214.js";import{V as l}from"./p-8aee6b74.js";import{B as h}from"./p-7cd2b93b.js";import"./p-a528714c.js";import"./p-2d0d575f.js";import"./p-331a62d5.js";import"./p-fb5ea4b2.js";import"./p-4866e390.js";import"./p-b75ee3ba.js";import"./p-f0e828d8.js";const c=`© ${(new Date).getFullYear()} Heartland Payment Systems, LLC – a Global Payments company. All rights reserved.`,f=`© ${(new Date).getFullYear()} Global Payments Inc. All rights reserved.`;var d=function(t,e,i,s){var a,n=arguments.length,r=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(r=(n<3?a(r):n>3?a(e,i,r):a(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};const g=class{constructor(e){t(this,e),this.globalSlimmers={},this.vegaComponentUsageRuntimeMetricsSlimmer=new o,this.brandSwitchControllerSlimmer=new h,this.googlePrivacyPolicyUrl="https://policies.google.com/privacy",this.googleTermsOfServiceUrl="https://policies.google.com/terms",this.currentBranding=l.getBranding(),this.content=this.getDefaultContent(),this.termOfUseLabel="Terms of Use",this.termOfUseUrl=this.getDefaultTermsOfUseUrl(),this.termOfUseUrlTarget="_self",this.privacyPolicyLabel="Privacy Policy",this.privacyPolicyUrl=this.getDefaultPrivacyPolicyUrl(),this.privacyPolicyUrlTarget="_self",this.hideDefaultLinks=!1,this.additionalLinks=[],this.showDisclaimer=!1,this.disclaimerUrlTarget="_self"}render(){return n(e(i,{class:"v-text-center"},this.renderContent(),this.renderLinks(),this.renderDisclaimer()),this.host)}getDefaultContent(){return"heartland"===l.getBranding()?c:f}getDefaultTermsOfUseUrl(){return"heartland"===l.getBranding()?"https://www.heartland.us/terms":"https://www.globalpayments.com/terms-of-use"}getDefaultPrivacyPolicyUrl(){return"heartland"===l.getBranding()?"https://www.heartland.us/privacy-policy":"https://www.globalpayments.com/privacy-statement"}renderContent(){return e("div",{class:"vega-app-footer-content"},this.content!==f&&this.content!==c?this.content:this.getDefaultContent())}renderLinks(){return e("div",{class:"vega-link"},this.hideDefaultLinks?null:this.renderDefaultLinks(),this.additionalLinks.length?this.renderAdditionalLinks():null)}renderDefaultLinks(){return e(s,null,e("a",{id:this.termOfUseUrlId,target:this.termOfUseUrlTarget,href:this.getTermsOfUseUrl()},this.termOfUseLabel),e("span",{class:"v-separator"}),e("a",{id:this.privacyPolicyUrlId,target:this.privacyPolicyUrlTarget,href:this.getPrivacyPolicyUrl()},this.privacyPolicyLabel))}getTermsOfUseUrl(){return"https://www.heartland.us/terms"!==this.termOfUseUrl&&"https://www.globalpayments.com/terms-of-use"!==this.termOfUseUrl?this.termOfUseUrl:this.getDefaultTermsOfUseUrl()}getPrivacyPolicyUrl(){return"https://www.heartland.us/privacy-policy"!==this.privacyPolicyUrl&&"https://www.globalpayments.com/privacy-statement"!==this.privacyPolicyUrl?this.privacyPolicyUrl:this.getDefaultPrivacyPolicyUrl()}renderAdditionalLinks(){return e(s,null,this.hideDefaultLinks?null:e("span",{class:"v-separator"}),this.additionalLinks.map(((t,i)=>t.URL&&t.label&&e(s,null,e("a",{id:t.id,target:t.target,href:t.URL},t.label),this.additionalLinks.length===i+1?null:e("span",{class:"v-separator"})))))}renderDisclaimer(){return this.showDisclaimer&&e("div",{class:"vega-app-footer-disclaimer"},e("div",{class:"h-separator"}),e("div",{class:"vega-app-footer-disclaimer-content vega-link"},"This site is protected by reCAPTCHA and the"," ",e("a",{target:this.disclaimerUrlTarget,href:this.googlePrivacyPolicyUrl}," ","Google Privacy Policy"," ")," ","and"," ",e("a",{target:this.disclaimerUrlTarget,href:this.googleTermsOfServiceUrl}," ","Google Terms of Service"," "),"apply."))}get host(){return a(this)}};d([p()],g.prototype,"globalSlimmers",void 0),d([r()],g.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),d([r()],g.prototype,"brandSwitchControllerSlimmer",void 0),g.style=':host{display:block;padding-left:0px;padding-right:0px}:host .h-separator{height:1px;background-color:rgba(var(--v-bg-divider, 171, 198, 216, 1));margin-top:20px;margin-bottom:20px}:host .v-separator{display:inline-block;width:1px;margin-left:8px;margin-right:8px;background-color:rgba(70, 71, 101, 0.8)}:host>.vega-link{display:flex;align-items:stretch;justify-content:center;flex-wrap:wrap}:host>.vega-link a{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}@media screen and (min-width: 768px) and (max-width: 1023px){:host>.vega-link a{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host>.vega-link a{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host>.vega-link a{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}:host .vega-app-footer-content{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px;color:rgba(var(--v-text-primary, 32, 54, 69, 1));margin-bottom:8px}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-app-footer-content{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .vega-app-footer-content{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .vega-app-footer-content{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}:host .vega-app-footer-disclaimer-content{font-family:"Inter", sans-serif;font-size:12px;font-weight:400;line-height:16px;letter-spacing:0px;color:rgba(var(--v-text-primary, 32, 54, 69, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-app-footer-disclaimer-content{font-family:"Inter", sans-serif;font-size:12px;font-weight:400;line-height:16px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .vega-app-footer-disclaimer-content{font-family:"Inter", sans-serif;font-size:12px;font-weight:400;line-height:16px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .vega-app-footer-disclaimer-content{font-family:"Inter", sans-serif;font-size:12px;font-weight:400;line-height:16px;letter-spacing:0px}}:host(.v-text-center){text-align:center}:host .vega-link a{color:rgba(var(--v-text-link, 19, 98, 226, 1));border-radius:4px;text-decoration:none}:host .vega-link a:visited{color:rgba(var(--v-text-link-visited, 95, 56, 206, 1))}:host .vega-link a:hover{color:rgba(var(--v-text-link-hover, 4, 112, 236, 1));text-decoration:underline}:host .vega-link a:focus{color:rgba(var(--v-text-link-focus, 4, 112, 236, 1));outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:2px}:host .vega-link a:active{color:rgba(var(--v-text-link-active, 29, 65, 195, 1));text-decoration:underline}';export{g as vega_app_footer}
@@ -1 +1 @@
1
- import{V as t,I as e,c as s,M as i}from"./p-6e1ab235.js";import{c as r}from"./p-02841589.js";import{C as o}from"./p-2d0d575f.js";import{O as n}from"./p-331a62d5.js";import{U as a,a as l,b as h,F as c,c as d,d as u,e as f}from"./p-a528714c.js";import{f as m,d as p}from"./p-ec2a1d4c.js";import{a as v,g as b}from"./p-8b5d3a52.js";import{c as R}from"./p-6a334573.js";import{d as g,D as j}from"./p-11e2dcf5.js";import{h as y,f as w,i as O}from"./p-6c43d54a.js";import{V as E}from"./p-3b791b5d.js";import{h as V,l as F}from"./p-f0e828d8.js";import{P as I}from"./p-81dd00d0.js";import{I as C}from"./p-abd7aeaa.js";import{M as S}from"./p-78a57a17.js";import{A}from"./p-52b8f2d2.js";import{i as k}from"./p-d27ae9ff.js";import{S as T}from"./p-158108ea.js";class L{constructor(t){this.rule=t}getStatus(t,e,s){return{canEvaluate:this.rule.canEvaluate(t,e,s),isAsync:v(this.rule.evaluate)}}shouldShowError(t,e){try{return this.rule.shouldShowError?this.rule.shouldShowError(t,e):this.defaultShouldShowError(t)}catch(t){return!1}}handle(t){try{return this.rule.evaluate(t)}catch(t){return{isValid:!0,message:""}}}defaultShouldShowError(t){return!t.disabled&&t.visible&&(t.touched||t.modified)}}class M{constructor(){this.handlers=[],this.processId=""}checkIncludesAsyncRuleHandler(t,e,s){return!!this.handlers.find((i=>{const r=i.getStatus(t,e,s);return r.canEvaluate&&r.isAsync}))}setHandlersByRules(t){this.handlers=t&&t.length?t.map((t=>new L(t))):[]}async process(t,e,s,i,r){const o=this.preProcess();let n;for(const i of this.handlers){if(o!==this.processId)break;const r=i.getStatus(t,e,s);if(!r.canEvaluate)continue;let a;if(r.isAsync)try{a=await i.handle(t)}catch(t){}else a=i.handle(t);if(a&&!a.isValid){const t=i.shouldShowError(e,s);n=Object.assign(Object.assign({},a),{shouldShowError:t});break}}return this.postProcess(o,i,n,r),n?{isValid:!1,message:n.message}:{isValid:!0,message:""}}preProcess(){const t=b();return this.processId=t,t}postProcess(t,e,s,i){this.processId===t&&i(e,s)}}class D{run(t){const e=t.nextElementSibling;return e&&e.querySelector(".vega-error")?e.querySelector(".vega-error"):null}}class B{run(t){let e=t.nextElementSibling;return e&&!e.classList.contains("vega-error")&&(e=document.createElement("label"),e.classList.add("vega-error"),e.setAttribute("part","field-error-message"),t.after(e)),e}}class H{run(t){let e=t.nextElementSibling;return e||(e=document.createElement("label"),e.classList.add("vega-error"),e.setAttribute("part","field-error-message"),t.after(e)),e}}class U extends t{getTranslatedMessage(t){return"string"==typeof t?E.t(t):E.t(t.key,...t.args||[])}}var x=function(t,e,s,i){var r,o=arguments.length,n=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(o<3?r(n):o>3?r(e,s,n):r(e,s))||n);return o>3&&n&&Object.defineProperty(e,s,n),n};class G extends t{constructor(){super(),this.formFieldMessageTranslatorSlimmer=new U,this.fieldErrorUiControllerStrategies=[new D,new B,new H],this.initTranslationObserver()}applyInputInvalidUI(t){const e=this.getInputElementContainer();if(o.notify(g.getSubject(this.host,y),{host:this.host,showError:!0}),e&&(e.classList.add("error"),t)){this.errorMessage=t;const s=this.getErrorContainer(e);s.innerHTML=V.sanitize(this.formFieldMessageTranslatorSlimmer.getTranslatedMessage(t),F),s.classList.remove("vega-hidden")}}resetInputInvalidUI(){this.errorMessage="";const t=this.getInputElementContainer();t&&(this.getErrorContainer(t).classList.add("vega-hidden"),t.classList.remove("error"),o.notify(g.getSubject(this.host,y),{host:this.host,showError:!1}))}getInputElementContainer(){return this.options&&this.options.inputContainerGetter?this.options.inputContainerGetter():null}getErrorContainer(t){for(const e of this.fieldErrorUiControllerStrategies){const s=e.run(t);if(s)return s}}initTranslationObserver(){const t=new n(this.isAcceptableTranslationObserver.bind(this),(()=>{if(!this.errorMessage)return;const t=this.getInputElementContainer();if(t){const e=this.getErrorContainer(t);e&&(e.innerHTML=V.sanitize(this.formFieldMessageTranslatorSlimmer.getTranslatedMessage(this.errorMessage),F))}}));o.register(a,t)}isAcceptableTranslationObserver(){return!0}}x([e()],G.prototype,"formFieldMessageTranslatorSlimmer",void 0),x([s()],G.prototype,"host",void 0),x([s()],G.prototype,"options",void 0);var P=function(t,e,s,i){var r,o=arguments.length,n=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(o<3?r(n):o>3?r(e,s,n):r(e,s))||n);return o>3&&n&&Object.defineProperty(e,s,n),n};class W{constructor(t,e,s,i){var r,n;this.formFieldMessageTranslatorSlimmer=new U,this.fieldErrorUIController=new G,this.resizeObserverSlimmer=R(W,I,[],[{mapFrom:"connectResizeObserver",mapTo:"connectResizeObserver"}],[{callback:t=>{const e=this.isVisible,s=t[0].contentRect.height>0;this.isVisible=s,this.isAutoValidationEnabled()&&m(this.host,"vega-form")&&e!==s&&this.valid(["visible"])},target:()=>this.host}]),this.defaultRules=[],this.additionalRules=[],this.listeners=[],this.isTouched=!1,this.isModified=!1,this.isVisible=!1,this.formFieldValidationRuleHandlerChain=new M,this.hostChildAddedBlurEventMap=new WeakMap,this.handleValidationResult=(t,e)=>{let s=!0;return e?("rule"===t?e.shouldShowError?this.fieldErrorUIController.applyInputInvalidUI(e.message):this.fieldErrorUIController.resetInputInvalidUI():t?this.fieldErrorUIController.applyInputInvalidUI(e.message):this.fieldErrorUIController.resetInputInvalidUI(),s=!1):this.fieldErrorUIController.resetInputInvalidUI(),this.invokeListeners(s),o.notify(l,{host:this.host,detail:s}),s},this.setupTouchedListener=()=>{this.getTouchableAreaElements().filter((t=>t&&!0!==this.hostChildAddedBlurEventMap.get(t))).forEach((t=>{t.addEventListener("blur",(()=>{this.updateIsTouched(!0)})),this.hostChildAddedBlurEventMap.set(t,!0)}))},this.defaultRules=t||[],this.host=e,this.defaultValue=s,this.options=i,this.initDisabledAttrObserver(),this.connectResizeObserver(),this.initFormResetObserver(),null===(n=(r=this.host).componentOnReady)||void 0===n||n.call(r).then((()=>{this.didRender()})),this.setupModifiedListener(),this.listenHostElementKeydown(),this.updateValidationHandlers()}async validate(t){return await this.valid([],t)}addListener(t){this.listeners.push(t)}getRules(){const t=[...this.additionalRules];return[...this.defaultRules.map((e=>this.overrideDefaultRuleByAdditionalRule(e,t))),...t]}setDefaultRules(t){this.defaultRules=t,this.updateValidationHandlers()}setAdditionalRules(t){this.additionalRules=t,this.updateValidationHandlers()}destroy(){o.notify(h,{host:this.host}),this.unregisterFormResetObserver(),o.unregister(c,this.hostValueChangeObserver),this.hostChildrenObserver&&this.hostChildrenObserver.disconnect()}connectResizeObserver(){}updateDisableBlurValidation(t){this.disableBlurValidation=t}updateValidationHandlers(){this.formFieldValidationRuleHandlerChain.setHandlersByRules(this.getRules())}async valid(t,e="rule"){const s=this.getStatus(),i=this.host.value;this.formFieldValidationRuleHandlerChain.checkIncludesAsyncRuleHandler(i,s,t)&&o.notify(l,{host:this.host,detail:null});const{isValid:r,message:n}=await this.formFieldValidationRuleHandlerChain.process(i,s,t,e,this.handleValidationResult);return{isValid:r,message:this.formFieldMessageTranslatorSlimmer.getTranslatedMessage(n)}}invokeListeners(t){this.listeners.forEach((e=>e.callback(t)))}getStatus(){return{touched:this.isTouched,modified:this.isModified,disabled:this.host.disabled,visible:this.isVisible}}updateIsTouched(t){const e=this.isTouched;this.isTouched=t,!this.disableBlurValidation&&this.isAutoValidationEnabled()&&this.valid(e===t?[]:["touched"])}updateIsModified(t){const e=this.isModified;this.isModified=t,this.isAutoValidationEnabled()&&this.valid(e===t?[]:["modified"])}initDisabledAttrObserver(){this.disabledAttrObserver=new MutationObserver((()=>{this.isAutoValidationEnabled()&&this.valid(["disabled"])})),this.disabledAttrObserver.observe(this.host,{attributes:!0,attributeFilter:["disabled"]})}canAcceptFormResetOperation(t){return m(this.host,"vega-form")===t.host}unregisterFormResetObserver(){o.unregister(d,this.formResetTriggeredObserver)}monitorTouchedListener(){const t=this.getInputContainerElements();t&&(this.hostChildrenObserver=new MutationObserver((()=>{this.setupTouchedListener()})),this.hostChildrenObserver.observe(t,{childList:!0,subtree:!0})),this.setupTouchedListener()}getTouchableAreaElements(){return this.options&&this.options.touchableAreaGetter?this.options.touchableAreaGetter():[]}getInputContainerElements(){return this.options&&this.options.inputContainerGetter?this.options.inputContainerGetter():null}setupModifiedListener(){this.hostValueChangeObserver=new n(this.isCurrentTarget.bind(this),(()=>this.updateIsModified(!0))),o.register(c,this.hostValueChangeObserver)}isCurrentTarget(t){return this.host===t.host}async reset(t){var e,s;if(this.shouldVisitElement(this.host,null===(e=t.option)||void 0===e?void 0:e.skipDisabled,null===(s=t.option)||void 0===s?void 0:s.skipInvisible)){const e=t.defaultValueMap,s=this.host.dataset.vegaForm,i=null==e[s]?this.getDefaultValue():e[s];"function"==typeof this.host.setValue?await this.host.setValue(i):this.host.value=i,this.isTouched=!1,this.isModified=!1,this.fieldErrorUIController.resetInputInvalidUI()}}getDefaultValue(){return this.defaultValue instanceof Function?this.defaultValue(this.host):this.defaultValue}didRender(){this.monitorTouchedListener()}initFormResetObserver(){this.formResetTriggeredObserver=new n(this.canAcceptFormResetOperation.bind(this),this.reset.bind(this)),o.register(d,this.formResetTriggeredObserver)}isAutoValidationEnabled(){return!1!==this.host.autoValidation}shouldVisitElement(t,e,s){return!(!t.dataset.vegaForm||e&&t.disabled||s&&!p(t))}listenHostElementKeydown(){this.host.addEventListener("keydown",(t=>{if(this.canSubmitFormByEvent(t)){const t=m(this.host,"vega-form",{outerMost:!0});t&&o.notify(g.getSubject(t,w),{host:this.host})}}))}canSubmitFormByEvent(t){const e="Enter"===t.key||13===t.keyCode,s=e&&t.shiftKey;switch(this.host.tagName){case"VEGA-TEXTAREA":case"VEGA-DATE-PICKER":case"VEGA-TIME-PICKER":return s&&t.preventDefault(),s;case"VEGA-RICH-TEXT-EDITOR":return!1;default:return e}}overrideDefaultRuleByAdditionalRule(t,e){if(t&&e){const s=e.findIndex((e=>e instanceof C&&e instanceof t.constructor&&e.overrideDefault));if(s>-1)return e.splice(s,1)[0]}return t}}P([e()],W.prototype,"formFieldMessageTranslatorSlimmer",void 0),P([e()],W.prototype,"fieldErrorUIController",void 0),P([e()],W.prototype,"resizeObserverSlimmer",void 0);var z=function(t,e,s,i){var r,o=arguments.length,n=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(o<3?r(n):o>3?r(e,s,n):r(e,s))||n);return o>3&&n&&Object.defineProperty(e,s,n),n};class K extends t{constructor(){super(...arguments),this.fieldErrorUIController=new G,this.handleFieldErrorMessageUpdate=t=>{const{message:e,isValid:s}=t;s?this.fieldErrorUIController.resetInputInvalidUI():this.fieldErrorUIController.applyInputInvalidUI(e)}}handleComponentWillLoadByFieldErrorSlimmer(){this.fieldErrorMessageChangeObserver=new n(this.canAcceptFieldErrorMessageUpdate.bind(this),this.handleFieldErrorMessageUpdate),o.register(u,this.fieldErrorMessageChangeObserver)}handleUnregisterObserver(){o.unregister(u,this.fieldErrorMessageChangeObserver)}canAcceptFieldErrorMessageUpdate(t){const{host:e}=t,s=this.host.parentElement;return s&&s===e&&"VEGA-FIELD-ERROR"===s.tagName||this.host===e}}z([s()],K.prototype,"host",void 0),z([s()],K.prototype,"options",void 0),z([e()],K.prototype,"fieldErrorUIController",void 0),z([i("setInjectFormFieldHelper")],K.prototype,"handleComponentWillLoadByFieldErrorSlimmer",null),z([i("disconnectedCallback")],K.prototype,"handleUnregisterObserver",null);var N=function(t,e,s,i){var r,o=arguments.length,n=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(o<3?r(n):o>3?r(e,s,n):r(e,s))||n);return o>3&&n&&Object.defineProperty(e,s,n),n};class X extends t{constructor(){super(...arguments),this.handleValidInvocation=async t=>{if(this.validator){void 0!==t.timerId&&clearTimeout(t.timerId);const e=await this.validator.validate(t.message);if(e){const{isValid:s,message:i}=e;"function"==typeof t.promiseResolve&&t.promiseResolve({isValid:s,message:i})}}}}registerValidInvocationObserver(){j.addUniqueObserverToNode(this.host,O,this.handleValidInvocation)}handleUnregisterObserver(){j.removeUniqueObserverFromNode(this.host,O)}}N([s()],X.prototype,"host",void 0),N([s()],X.prototype,"validator",void 0),N([i("setInjectFormFieldHelper")],X.prototype,"registerValidInvocationObserver",null),N([i("disconnectedCallback")],X.prototype,"handleUnregisterObserver",null);var q=function(t,e,s,i){var r,o=arguments.length,n=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(o<3?r(n):o>3?r(e,s,n):r(e,s))||n);return o>3&&n&&Object.defineProperty(e,s,n),n};class J extends T{constructor(){super({parent:"vega-form",subStates:[{subStateName:"disableBlurValidation",parentStateName:"disableBlurValidation",callback:t=>{var e;null===(e=this.validator)||void 0===e||e.updateDisableBlurValidation(t)}}]})}componentWillLoad(){super.componentWillLoad()}}q([s()],J.prototype,"host",void 0),q([s()],J.prototype,"validator",void 0),q([i("setInjectFormFieldHelper")],J.prototype,"componentWillLoad",null);var Q=function(t,e,s,i){var r,o=arguments.length,n=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(o<3?r(n):o>3?r(e,s,n):r(e,s))||n);return o>3&&n&&Object.defineProperty(e,s,n),n};class Y extends t{constructor(t){super(),this.fieldErrorSlimmer=new K,this.formFieldValidInvokeSlimmer=new X,this.formFormStateController=new J,this.mutationObserverCallBack=()=>{this.validator&&(this.setDefaultRules(),this.internalValidate())},this.options=t,this.setMutationObserverSlimmer()}connectedCallback(){null===this.validator&&this.setInjectFormFieldHelper()}disconnectedCallback(){this.validator&&(this.validator.destroy(),this.validator=null)}componentDidLoad(){}static isValidFormField(t){return t&&Boolean(t.getAttribute("data-vega-form"))}watchValidationRulesByFormControllerSlimmer(t,e){k(t,e,!1,((t,e)=>t===e?0:-1))||(this.setAdditionalRules(),this.internalValidate())}setInjectFormFieldHelper(){if(Y.isValidFormField(this.host)){const{defaultValue:t}=this.options,e=new W(this.getPropertyRules(),this.host,t,this.options);e.addListener({callback:t=>{this.isValid!=t&&(this.isValid=t,o.notify(f,{host:this.host,detail:t}))}}),this.validator=e,this.setAdditionalRules()}}setAdditionalRules(){this.options.validationRulesName&&"validationRules"===this.options.validationRulesName&&this.validator&&this.validator.setAdditionalRules(this.validationRules||[])}setDefaultRules(){this.validator&&this.validator.setDefaultRules(this.getPropertyRules())}getPropertyRules(){const{propertyRules:t,attributeGetter:e}=this.options;return t.map((t=>{const s=t.dependence&&"string"==typeof t.dependence?[e(t.dependence)]:Array.isArray(t.dependence)?t.dependence.map((t=>e(t))):[null];return t.ruleFactory(e(t.propertyName),...s)})).filter(Boolean)}internalValidate(){!this.disabled&&this.validator&&this.validator.validate()}setMutationObserverSlimmer(){this.mutationObserverSlimmer=new S({options:{attributeFilter:this.options.propertyRules.map((t=>r(t.propertyName))),attributeOldValue:!0},mutationFilter:A(),callback:this.mutationObserverCallBack})}}Q([s()],Y.prototype,"host",void 0),Q([s({writable:!0})],Y.prototype,"validationRules",void 0),Q([s()],Y.prototype,"disabled",void 0),Q([s()],Y.prototype,"autoValidation",void 0),Q([s({writable:!0})],Y.prototype,"isValid",void 0),Q([e()],Y.prototype,"fieldErrorSlimmer",void 0),Q([e()],Y.prototype,"formFieldValidInvokeSlimmer",void 0),Q([e()],Y.prototype,"mutationObserverSlimmer",void 0),Q([e()],Y.prototype,"formFormStateController",void 0),Q([i("connectedCallback")],Y.prototype,"connectedCallback",null),Q([i("disconnectedCallback")],Y.prototype,"disconnectedCallback",null),Q([i("componentDidLoad")],Y.prototype,"componentDidLoad",null),Q([i("watchValidationRules")],Y.prototype,"watchValidationRulesByFormControllerSlimmer",null),Q([i("componentWillLoad")],Y.prototype,"setInjectFormFieldHelper",null);export{Y as F}
1
+ import{V as t,I as e,c as s,M as i}from"./p-6e1ab235.js";import{c as r}from"./p-02841589.js";import{C as o}from"./p-2d0d575f.js";import{O as n}from"./p-331a62d5.js";import{U as a,a as l,b as h,F as c,c as d,d as u,e as f}from"./p-a528714c.js";import{f as m,d as p}from"./p-ec2a1d4c.js";import{a as v,g as b}from"./p-8b5d3a52.js";import{c as R}from"./p-6a334573.js";import{d as g,D as j}from"./p-11e2dcf5.js";import{h as y,f as w,i as O}from"./p-6c43d54a.js";import{V as E}from"./p-43ed14c4.js";import{h as V,l as F}from"./p-f0e828d8.js";import{P as I}from"./p-81dd00d0.js";import{I as C}from"./p-abd7aeaa.js";import{M as S}from"./p-78a57a17.js";import{A}from"./p-52b8f2d2.js";import{i as k}from"./p-d27ae9ff.js";import{S as T}from"./p-158108ea.js";class L{constructor(t){this.rule=t}getStatus(t,e,s){return{canEvaluate:this.rule.canEvaluate(t,e,s),isAsync:v(this.rule.evaluate)}}shouldShowError(t,e){try{return this.rule.shouldShowError?this.rule.shouldShowError(t,e):this.defaultShouldShowError(t)}catch(t){return!1}}handle(t){try{return this.rule.evaluate(t)}catch(t){return{isValid:!0,message:""}}}defaultShouldShowError(t){return!t.disabled&&t.visible&&(t.touched||t.modified)}}class M{constructor(){this.handlers=[],this.processId=""}checkIncludesAsyncRuleHandler(t,e,s){return!!this.handlers.find((i=>{const r=i.getStatus(t,e,s);return r.canEvaluate&&r.isAsync}))}setHandlersByRules(t){this.handlers=t&&t.length?t.map((t=>new L(t))):[]}async process(t,e,s,i,r){const o=this.preProcess();let n;for(const i of this.handlers){if(o!==this.processId)break;const r=i.getStatus(t,e,s);if(!r.canEvaluate)continue;let a;if(r.isAsync)try{a=await i.handle(t)}catch(t){}else a=i.handle(t);if(a&&!a.isValid){const t=i.shouldShowError(e,s);n=Object.assign(Object.assign({},a),{shouldShowError:t});break}}return this.postProcess(o,i,n,r),n?{isValid:!1,message:n.message}:{isValid:!0,message:""}}preProcess(){const t=b();return this.processId=t,t}postProcess(t,e,s,i){this.processId===t&&i(e,s)}}class D{run(t){const e=t.nextElementSibling;return e&&e.querySelector(".vega-error")?e.querySelector(".vega-error"):null}}class B{run(t){let e=t.nextElementSibling;return e&&!e.classList.contains("vega-error")&&(e=document.createElement("label"),e.classList.add("vega-error"),e.setAttribute("part","field-error-message"),t.after(e)),e}}class H{run(t){let e=t.nextElementSibling;return e||(e=document.createElement("label"),e.classList.add("vega-error"),e.setAttribute("part","field-error-message"),t.after(e)),e}}class U extends t{getTranslatedMessage(t){return"string"==typeof t?E.t(t):E.t(t.key,...t.args||[])}}var x=function(t,e,s,i){var r,o=arguments.length,n=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(o<3?r(n):o>3?r(e,s,n):r(e,s))||n);return o>3&&n&&Object.defineProperty(e,s,n),n};class G extends t{constructor(){super(),this.formFieldMessageTranslatorSlimmer=new U,this.fieldErrorUiControllerStrategies=[new D,new B,new H],this.initTranslationObserver()}applyInputInvalidUI(t){const e=this.getInputElementContainer();if(o.notify(g.getSubject(this.host,y),{host:this.host,showError:!0}),e&&(e.classList.add("error"),t)){this.errorMessage=t;const s=this.getErrorContainer(e);s.innerHTML=V.sanitize(this.formFieldMessageTranslatorSlimmer.getTranslatedMessage(t),F),s.classList.remove("vega-hidden")}}resetInputInvalidUI(){this.errorMessage="";const t=this.getInputElementContainer();t&&(this.getErrorContainer(t).classList.add("vega-hidden"),t.classList.remove("error"),o.notify(g.getSubject(this.host,y),{host:this.host,showError:!1}))}getInputElementContainer(){return this.options&&this.options.inputContainerGetter?this.options.inputContainerGetter():null}getErrorContainer(t){for(const e of this.fieldErrorUiControllerStrategies){const s=e.run(t);if(s)return s}}initTranslationObserver(){const t=new n(this.isAcceptableTranslationObserver.bind(this),(()=>{if(!this.errorMessage)return;const t=this.getInputElementContainer();if(t){const e=this.getErrorContainer(t);e&&(e.innerHTML=V.sanitize(this.formFieldMessageTranslatorSlimmer.getTranslatedMessage(this.errorMessage),F))}}));o.register(a,t)}isAcceptableTranslationObserver(){return!0}}x([e()],G.prototype,"formFieldMessageTranslatorSlimmer",void 0),x([s()],G.prototype,"host",void 0),x([s()],G.prototype,"options",void 0);var P=function(t,e,s,i){var r,o=arguments.length,n=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(o<3?r(n):o>3?r(e,s,n):r(e,s))||n);return o>3&&n&&Object.defineProperty(e,s,n),n};class W{constructor(t,e,s,i){var r,n;this.formFieldMessageTranslatorSlimmer=new U,this.fieldErrorUIController=new G,this.resizeObserverSlimmer=R(W,I,[],[{mapFrom:"connectResizeObserver",mapTo:"connectResizeObserver"}],[{callback:t=>{const e=this.isVisible,s=t[0].contentRect.height>0;this.isVisible=s,this.isAutoValidationEnabled()&&m(this.host,"vega-form")&&e!==s&&this.valid(["visible"])},target:()=>this.host}]),this.defaultRules=[],this.additionalRules=[],this.listeners=[],this.isTouched=!1,this.isModified=!1,this.isVisible=!1,this.formFieldValidationRuleHandlerChain=new M,this.hostChildAddedBlurEventMap=new WeakMap,this.handleValidationResult=(t,e)=>{let s=!0;return e?("rule"===t?e.shouldShowError?this.fieldErrorUIController.applyInputInvalidUI(e.message):this.fieldErrorUIController.resetInputInvalidUI():t?this.fieldErrorUIController.applyInputInvalidUI(e.message):this.fieldErrorUIController.resetInputInvalidUI(),s=!1):this.fieldErrorUIController.resetInputInvalidUI(),this.invokeListeners(s),o.notify(l,{host:this.host,detail:s}),s},this.setupTouchedListener=()=>{this.getTouchableAreaElements().filter((t=>t&&!0!==this.hostChildAddedBlurEventMap.get(t))).forEach((t=>{t.addEventListener("blur",(()=>{this.updateIsTouched(!0)})),this.hostChildAddedBlurEventMap.set(t,!0)}))},this.defaultRules=t||[],this.host=e,this.defaultValue=s,this.options=i,this.initDisabledAttrObserver(),this.connectResizeObserver(),this.initFormResetObserver(),null===(n=(r=this.host).componentOnReady)||void 0===n||n.call(r).then((()=>{this.didRender()})),this.setupModifiedListener(),this.listenHostElementKeydown(),this.updateValidationHandlers()}async validate(t){return await this.valid([],t)}addListener(t){this.listeners.push(t)}getRules(){const t=[...this.additionalRules];return[...this.defaultRules.map((e=>this.overrideDefaultRuleByAdditionalRule(e,t))),...t]}setDefaultRules(t){this.defaultRules=t,this.updateValidationHandlers()}setAdditionalRules(t){this.additionalRules=t,this.updateValidationHandlers()}destroy(){o.notify(h,{host:this.host}),this.unregisterFormResetObserver(),o.unregister(c,this.hostValueChangeObserver),this.hostChildrenObserver&&this.hostChildrenObserver.disconnect()}connectResizeObserver(){}updateDisableBlurValidation(t){this.disableBlurValidation=t}updateValidationHandlers(){this.formFieldValidationRuleHandlerChain.setHandlersByRules(this.getRules())}async valid(t,e="rule"){const s=this.getStatus(),i=this.host.value;this.formFieldValidationRuleHandlerChain.checkIncludesAsyncRuleHandler(i,s,t)&&o.notify(l,{host:this.host,detail:null});const{isValid:r,message:n}=await this.formFieldValidationRuleHandlerChain.process(i,s,t,e,this.handleValidationResult);return{isValid:r,message:this.formFieldMessageTranslatorSlimmer.getTranslatedMessage(n)}}invokeListeners(t){this.listeners.forEach((e=>e.callback(t)))}getStatus(){return{touched:this.isTouched,modified:this.isModified,disabled:this.host.disabled,visible:this.isVisible}}updateIsTouched(t){const e=this.isTouched;this.isTouched=t,!this.disableBlurValidation&&this.isAutoValidationEnabled()&&this.valid(e===t?[]:["touched"])}updateIsModified(t){const e=this.isModified;this.isModified=t,this.isAutoValidationEnabled()&&this.valid(e===t?[]:["modified"])}initDisabledAttrObserver(){this.disabledAttrObserver=new MutationObserver((()=>{this.isAutoValidationEnabled()&&this.valid(["disabled"])})),this.disabledAttrObserver.observe(this.host,{attributes:!0,attributeFilter:["disabled"]})}canAcceptFormResetOperation(t){return m(this.host,"vega-form")===t.host}unregisterFormResetObserver(){o.unregister(d,this.formResetTriggeredObserver)}monitorTouchedListener(){const t=this.getInputContainerElements();t&&(this.hostChildrenObserver=new MutationObserver((()=>{this.setupTouchedListener()})),this.hostChildrenObserver.observe(t,{childList:!0,subtree:!0})),this.setupTouchedListener()}getTouchableAreaElements(){return this.options&&this.options.touchableAreaGetter?this.options.touchableAreaGetter():[]}getInputContainerElements(){return this.options&&this.options.inputContainerGetter?this.options.inputContainerGetter():null}setupModifiedListener(){this.hostValueChangeObserver=new n(this.isCurrentTarget.bind(this),(()=>this.updateIsModified(!0))),o.register(c,this.hostValueChangeObserver)}isCurrentTarget(t){return this.host===t.host}async reset(t){var e,s;if(this.shouldVisitElement(this.host,null===(e=t.option)||void 0===e?void 0:e.skipDisabled,null===(s=t.option)||void 0===s?void 0:s.skipInvisible)){const e=t.defaultValueMap,s=this.host.dataset.vegaForm,i=null==e[s]?this.getDefaultValue():e[s];"function"==typeof this.host.setValue?await this.host.setValue(i):this.host.value=i,this.isTouched=!1,this.isModified=!1,this.fieldErrorUIController.resetInputInvalidUI()}}getDefaultValue(){return this.defaultValue instanceof Function?this.defaultValue(this.host):this.defaultValue}didRender(){this.monitorTouchedListener()}initFormResetObserver(){this.formResetTriggeredObserver=new n(this.canAcceptFormResetOperation.bind(this),this.reset.bind(this)),o.register(d,this.formResetTriggeredObserver)}isAutoValidationEnabled(){return!1!==this.host.autoValidation}shouldVisitElement(t,e,s){return!(!t.dataset.vegaForm||e&&t.disabled||s&&!p(t))}listenHostElementKeydown(){this.host.addEventListener("keydown",(t=>{if(this.canSubmitFormByEvent(t)){const t=m(this.host,"vega-form",{outerMost:!0});t&&o.notify(g.getSubject(t,w),{host:this.host})}}))}canSubmitFormByEvent(t){const e="Enter"===t.key||13===t.keyCode,s=e&&t.shiftKey;switch(this.host.tagName){case"VEGA-TEXTAREA":case"VEGA-DATE-PICKER":case"VEGA-TIME-PICKER":return s&&t.preventDefault(),s;case"VEGA-RICH-TEXT-EDITOR":return!1;default:return e}}overrideDefaultRuleByAdditionalRule(t,e){if(t&&e){const s=e.findIndex((e=>e instanceof C&&e instanceof t.constructor&&e.overrideDefault));if(s>-1)return e.splice(s,1)[0]}return t}}P([e()],W.prototype,"formFieldMessageTranslatorSlimmer",void 0),P([e()],W.prototype,"fieldErrorUIController",void 0),P([e()],W.prototype,"resizeObserverSlimmer",void 0);var z=function(t,e,s,i){var r,o=arguments.length,n=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(o<3?r(n):o>3?r(e,s,n):r(e,s))||n);return o>3&&n&&Object.defineProperty(e,s,n),n};class K extends t{constructor(){super(...arguments),this.fieldErrorUIController=new G,this.handleFieldErrorMessageUpdate=t=>{const{message:e,isValid:s}=t;s?this.fieldErrorUIController.resetInputInvalidUI():this.fieldErrorUIController.applyInputInvalidUI(e)}}handleComponentWillLoadByFieldErrorSlimmer(){this.fieldErrorMessageChangeObserver=new n(this.canAcceptFieldErrorMessageUpdate.bind(this),this.handleFieldErrorMessageUpdate),o.register(u,this.fieldErrorMessageChangeObserver)}handleUnregisterObserver(){o.unregister(u,this.fieldErrorMessageChangeObserver)}canAcceptFieldErrorMessageUpdate(t){const{host:e}=t,s=this.host.parentElement;return s&&s===e&&"VEGA-FIELD-ERROR"===s.tagName||this.host===e}}z([s()],K.prototype,"host",void 0),z([s()],K.prototype,"options",void 0),z([e()],K.prototype,"fieldErrorUIController",void 0),z([i("setInjectFormFieldHelper")],K.prototype,"handleComponentWillLoadByFieldErrorSlimmer",null),z([i("disconnectedCallback")],K.prototype,"handleUnregisterObserver",null);var N=function(t,e,s,i){var r,o=arguments.length,n=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(o<3?r(n):o>3?r(e,s,n):r(e,s))||n);return o>3&&n&&Object.defineProperty(e,s,n),n};class X extends t{constructor(){super(...arguments),this.handleValidInvocation=async t=>{if(this.validator){void 0!==t.timerId&&clearTimeout(t.timerId);const e=await this.validator.validate(t.message);if(e){const{isValid:s,message:i}=e;"function"==typeof t.promiseResolve&&t.promiseResolve({isValid:s,message:i})}}}}registerValidInvocationObserver(){j.addUniqueObserverToNode(this.host,O,this.handleValidInvocation)}handleUnregisterObserver(){j.removeUniqueObserverFromNode(this.host,O)}}N([s()],X.prototype,"host",void 0),N([s()],X.prototype,"validator",void 0),N([i("setInjectFormFieldHelper")],X.prototype,"registerValidInvocationObserver",null),N([i("disconnectedCallback")],X.prototype,"handleUnregisterObserver",null);var q=function(t,e,s,i){var r,o=arguments.length,n=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(o<3?r(n):o>3?r(e,s,n):r(e,s))||n);return o>3&&n&&Object.defineProperty(e,s,n),n};class J extends T{constructor(){super({parent:"vega-form",subStates:[{subStateName:"disableBlurValidation",parentStateName:"disableBlurValidation",callback:t=>{var e;null===(e=this.validator)||void 0===e||e.updateDisableBlurValidation(t)}}]})}componentWillLoad(){super.componentWillLoad()}}q([s()],J.prototype,"host",void 0),q([s()],J.prototype,"validator",void 0),q([i("setInjectFormFieldHelper")],J.prototype,"componentWillLoad",null);var Q=function(t,e,s,i){var r,o=arguments.length,n=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(o<3?r(n):o>3?r(e,s,n):r(e,s))||n);return o>3&&n&&Object.defineProperty(e,s,n),n};class Y extends t{constructor(t){super(),this.fieldErrorSlimmer=new K,this.formFieldValidInvokeSlimmer=new X,this.formFormStateController=new J,this.mutationObserverCallBack=()=>{this.validator&&(this.setDefaultRules(),this.internalValidate())},this.options=t,this.setMutationObserverSlimmer()}connectedCallback(){null===this.validator&&this.setInjectFormFieldHelper()}disconnectedCallback(){this.validator&&(this.validator.destroy(),this.validator=null)}componentDidLoad(){}static isValidFormField(t){return t&&Boolean(t.getAttribute("data-vega-form"))}watchValidationRulesByFormControllerSlimmer(t,e){k(t,e,!1,((t,e)=>t===e?0:-1))||(this.setAdditionalRules(),this.internalValidate())}setInjectFormFieldHelper(){if(Y.isValidFormField(this.host)){const{defaultValue:t}=this.options,e=new W(this.getPropertyRules(),this.host,t,this.options);e.addListener({callback:t=>{this.isValid!=t&&(this.isValid=t,o.notify(f,{host:this.host,detail:t}))}}),this.validator=e,this.setAdditionalRules()}}setAdditionalRules(){this.options.validationRulesName&&"validationRules"===this.options.validationRulesName&&this.validator&&this.validator.setAdditionalRules(this.validationRules||[])}setDefaultRules(){this.validator&&this.validator.setDefaultRules(this.getPropertyRules())}getPropertyRules(){const{propertyRules:t,attributeGetter:e}=this.options;return t.map((t=>{const s=t.dependence&&"string"==typeof t.dependence?[e(t.dependence)]:Array.isArray(t.dependence)?t.dependence.map((t=>e(t))):[null];return t.ruleFactory(e(t.propertyName),...s)})).filter(Boolean)}internalValidate(){!this.disabled&&this.validator&&this.validator.validate()}setMutationObserverSlimmer(){this.mutationObserverSlimmer=new S({options:{attributeFilter:this.options.propertyRules.map((t=>r(t.propertyName))),attributeOldValue:!0},mutationFilter:A(),callback:this.mutationObserverCallBack})}}Q([s()],Y.prototype,"host",void 0),Q([s({writable:!0})],Y.prototype,"validationRules",void 0),Q([s()],Y.prototype,"disabled",void 0),Q([s()],Y.prototype,"autoValidation",void 0),Q([s({writable:!0})],Y.prototype,"isValid",void 0),Q([e()],Y.prototype,"fieldErrorSlimmer",void 0),Q([e()],Y.prototype,"formFieldValidInvokeSlimmer",void 0),Q([e()],Y.prototype,"mutationObserverSlimmer",void 0),Q([e()],Y.prototype,"formFormStateController",void 0),Q([i("connectedCallback")],Y.prototype,"connectedCallback",null),Q([i("disconnectedCallback")],Y.prototype,"disconnectedCallback",null),Q([i("componentDidLoad")],Y.prototype,"componentDidLoad",null),Q([i("watchValidationRules")],Y.prototype,"watchValidationRulesByFormControllerSlimmer",null),Q([i("componentWillLoad")],Y.prototype,"setInjectFormFieldHelper",null);export{Y as F}