@globalpayments/vega 2.96.0 → 2.97.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 (426) hide show
  1. package/dist/cjs/{app-globals-38afea36.js → app-globals-3f57f7b9.js} +10 -10
  2. package/dist/cjs/{code-block-4126dc3b.js → code-block-28a7732e.js} +7 -1
  3. package/dist/cjs/{component-value-history-controller-slimmer.abstract-38ba956e.js → component-value-history-controller-slimmer.abstract-50cdba6e.js} +3 -3
  4. package/dist/cjs/{content-state-50e8a03c.js → content-state-e2ab0f06.js} +2 -2
  5. package/dist/cjs/{date-required-rule-4ab06a82.js → date-required-rule-5250f26d.js} +1 -1
  6. package/dist/cjs/{design-token-d3d12fa0.js → design-token-74674ee7.js} +3 -3
  7. package/dist/cjs/{element-appender-slimmer-7773fdab.js → element-appender-slimmer-ccb2e3c2.js} +2 -2
  8. package/dist/cjs/{form-field-controller-slimmer-d638ba12.js → form-field-controller-slimmer-58621b5e.js} +5 -14
  9. package/dist/cjs/form-field-key-8d5edf75.js +25 -0
  10. package/dist/cjs/{image-annotation-action-89363de8.js → image-annotation-action-b54dc669.js} +2 -2
  11. package/dist/cjs/{image-extension-c881c454.js → image-extension-1e3eeaa3.js} +2 -2
  12. package/dist/cjs/index.cjs.js +17 -17
  13. package/dist/cjs/{inject-keyboard-manager-5a105612.js → inject-keyboard-manager-6a6f5c9f.js} +1 -1
  14. package/dist/cjs/{internal-calendar-period-factory-b76006f7.js → internal-calendar-period-factory-dfcdd3f6.js} +1 -1
  15. package/dist/cjs/{internal-translation-controller-eb02c3b1.js → internal-translation-controller-1dac2df8.js} +7 -0
  16. package/dist/cjs/{keyboard-manager-ca76d4dc.js → keyboard-manager-c56033b1.js} +1 -1
  17. package/dist/cjs/{keyboard-manager-slimmer-a1223714.js → keyboard-manager-slimmer-7043a106.js} +1 -1
  18. package/dist/cjs/{link-extension-b7f99a52.js → link-extension-71c27ff3.js} +3 -3
  19. package/dist/cjs/loader.cjs.js +12 -12
  20. package/dist/cjs/{month-view-generator-876c50d4.js → month-view-generator-7b704a80.js} +1 -1
  21. package/dist/cjs/{public-rules-72894208.js → public-rules-55e34d2e.js} +7 -7
  22. package/dist/cjs/{range-95d41dea.js → range-eebe0e3c.js} +1 -1
  23. package/dist/cjs/{responsive-format-facade-25e9f30d.js → responsive-format-facade-493d1763.js} +1 -1
  24. package/dist/cjs/{rich-text-editor-required-rule-4d6d2493.js → rich-text-editor-required-rule-4fdee376.js} +1 -1
  25. package/dist/cjs/{split-cell-operation-70be116d.js → split-cell-operation-51097409.js} +3 -3
  26. package/dist/cjs/{state-border-formatter-f1ce0f3b.js → state-border-formatter-711c7aaa.js} +1 -1
  27. package/dist/cjs/{string-format-strategy.abstract-b22f7754.js → string-format-strategy.abstract-b61bdcbd.js} +1 -1
  28. package/dist/cjs/{string-input-formatter-slimmer-d2c248f7.js → string-input-formatter-slimmer-18d45942.js} +1 -1
  29. package/dist/cjs/{string-mask-strategy-fc01a500.js → string-mask-strategy-ad3fa0ac.js} +2 -2
  30. package/dist/cjs/{style-formatter-73205450.js → style-formatter-8f711cb0.js} +2 -2
  31. package/dist/cjs/{time-required-rule-12d2f394.js → time-required-rule-87417359.js} +1 -1
  32. package/dist/cjs/{token-extension-eb828948.js → token-extension-608bbf7b.js} +8 -8
  33. package/dist/cjs/{translation-slimmer-9099f56c.js → translation-slimmer-77c7f37d.js} +1 -1
  34. package/dist/cjs/{type-guard-f354af8b.js → type-guard-a57ef3ac.js} +1 -1
  35. package/dist/cjs/{valid-credit-card-number-rule-8d370163.js → valid-credit-card-number-rule-4c0a3040.js} +1 -1
  36. package/dist/cjs/vega-accordion.cjs.entry.js +6 -6
  37. package/dist/cjs/vega-app-header-button.cjs.entry.js +5 -5
  38. package/dist/cjs/vega-backdrop.cjs.entry.js +63 -8
  39. package/dist/cjs/vega-box.cjs.entry.js +6 -6
  40. package/dist/cjs/vega-button-circle.cjs.entry.js +5 -5
  41. package/dist/cjs/vega-button.cjs.entry.js +3 -3
  42. package/dist/cjs/vega-calendar_5.cjs.entry.js +7 -7
  43. package/dist/cjs/vega-card.cjs.entry.js +5 -5
  44. package/dist/cjs/vega-carousel.cjs.entry.js +3 -3
  45. package/dist/cjs/vega-checkbox_2.cjs.entry.js +20 -3
  46. package/dist/cjs/vega-chip.cjs.entry.js +5 -5
  47. package/dist/cjs/vega-code-block.cjs.entry.js +8 -8
  48. package/dist/cjs/vega-color-picker.cjs.entry.js +11 -2
  49. package/dist/cjs/vega-color-swatch-picker.cjs.entry.js +12 -3
  50. package/dist/cjs/vega-color-swatch.cjs.entry.js +2 -2
  51. package/dist/cjs/vega-combo-box.cjs.entry.js +17 -8
  52. package/dist/cjs/vega-date-picker_2.cjs.entry.js +22 -13
  53. package/dist/cjs/vega-dialog_2.cjs.entry.js +3 -3
  54. package/dist/cjs/vega-divider.cjs.entry.js +5 -5
  55. package/dist/cjs/vega-dropdown_5.cjs.entry.js +7 -7
  56. package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
  57. package/dist/cjs/vega-field-label.cjs.entry.js +2 -2
  58. package/dist/cjs/vega-file-uploader.cjs.entry.js +12 -3
  59. package/dist/cjs/vega-flag-icon.cjs.entry.js +5 -5
  60. package/dist/cjs/vega-flex.cjs.entry.js +6 -6
  61. package/dist/cjs/vega-font.cjs.entry.js +5 -5
  62. package/dist/cjs/vega-form.cjs.entry.js +28 -25
  63. package/dist/cjs/vega-grid.cjs.entry.js +5 -5
  64. package/dist/cjs/vega-icon.cjs.entry.js +5 -5
  65. package/dist/cjs/vega-image-uploader.cjs.entry.js +14 -5
  66. package/dist/cjs/vega-input-credit-card.cjs.entry.js +16 -7
  67. package/dist/cjs/vega-input-numeric.cjs.entry.js +14 -5
  68. package/dist/cjs/vega-input-passcode.cjs.entry.js +14 -5
  69. package/dist/cjs/vega-input-phone-number.cjs.entry.js +13 -4
  70. package/dist/cjs/vega-input-range.cjs.entry.js +12 -3
  71. package/dist/cjs/vega-input-select.cjs.entry.js +14 -5
  72. package/dist/cjs/vega-input.cjs.entry.js +9 -7
  73. package/dist/cjs/vega-left-nav_5.cjs.entry.js +71 -11
  74. package/dist/cjs/vega-loader-wrapper_2.cjs.entry.js +3 -3
  75. package/dist/cjs/vega-pagination-page-size-selector-mobile.cjs.entry.js +2 -2
  76. package/dist/cjs/vega-pagination.cjs.entry.js +4 -4
  77. package/dist/cjs/vega-popover_2.cjs.entry.js +8 -8
  78. package/dist/cjs/vega-progress-tracker_2.cjs.entry.js +3 -3
  79. package/dist/cjs/vega-radio_2.cjs.entry.js +17 -5
  80. package/dist/cjs/vega-rich-text-content.cjs.entry.js +32 -9
  81. package/dist/cjs/vega-rich-text-editor_4.cjs.entry.js +1581 -428
  82. package/dist/cjs/vega-rich-text-find-replace-panel.cjs.entry.js +1 -1
  83. package/dist/cjs/vega-rich-text-special-characters-panel.cjs.entry.js +5 -5
  84. package/dist/cjs/vega-rich-text-table-properties_3.cjs.entry.js +8 -8
  85. package/dist/cjs/vega-selection-chip_2.cjs.entry.js +13 -4
  86. package/dist/cjs/vega-selection-tile_2.cjs.entry.js +11 -2
  87. package/dist/cjs/vega-sidenav_3.cjs.entry.js +3 -3
  88. package/dist/cjs/vega-signature-capture.cjs.entry.js +16 -7
  89. package/dist/cjs/vega-stepper.cjs.entry.js +12 -3
  90. package/dist/cjs/vega-table_11.cjs.entry.js +4 -4
  91. package/dist/cjs/vega-textarea.cjs.entry.js +12 -3
  92. package/dist/cjs/vega-time-picker_2.cjs.entry.js +18 -9
  93. package/dist/cjs/vega-toggle-switch.cjs.entry.js +12 -3
  94. package/dist/cjs/vega-tooltip_2.cjs.entry.js +6 -6
  95. package/dist/cjs/vega.cjs.js +12 -12
  96. package/dist/collection/components/vega-backdrop/slimmers/controller/vega-backdrop-visible-controller.js +63 -8
  97. package/dist/collection/components/vega-checkbox/vega-checkbox-group/vega-checkbox-group.js +33 -1
  98. package/dist/collection/components/vega-checkbox/vega-checkbox.js +34 -2
  99. package/dist/collection/components/vega-color-picker/vega-color-picker.js +33 -1
  100. package/dist/collection/components/vega-color-swatch/vega-color-swatch-picker/vega-color-swatch-picker.js +33 -1
  101. package/dist/collection/components/vega-combo-box/vega-combo-box.js +33 -1
  102. package/dist/collection/components/vega-date-picker/vega-date-picker.js +33 -1
  103. package/dist/collection/components/vega-file-uploader/vega-file-uploader.js +33 -1
  104. package/dist/collection/components/vega-form/slimmers/controllers/vega-form-field-controller.js +9 -9
  105. package/dist/collection/components/vega-form/slimmers/controllers/vega-form-field-validation-state-controller.js +5 -5
  106. package/dist/collection/components/vega-form/slimmers/renderers/native-form-renderer.js +4 -1
  107. package/dist/collection/components/vega-form/vega-form.js +32 -0
  108. package/dist/collection/components/vega-image-uploader/vega-image-uploader.js +33 -1
  109. package/dist/collection/components/vega-input/vega-input.js +5 -4
  110. package/dist/collection/components/vega-input-credit-card/vega-input-credit-card.js +34 -2
  111. package/dist/collection/components/vega-input-numeric/vega-input-numeric.js +33 -1
  112. package/dist/collection/components/vega-input-passcode/vega-input-passcode.js +33 -1
  113. package/dist/collection/components/vega-input-phone-number/vega-input-phone-number.js +33 -1
  114. package/dist/collection/components/vega-input-range/vega-input-range.js +33 -1
  115. package/dist/collection/components/vega-input-select/vega-input-select.js +33 -1
  116. package/dist/collection/components/vega-nav/vega-left-nav/slimmers/controllers/vega-left-nav-backdrop-manager.js +17 -1
  117. package/dist/collection/components/vega-nav/vega-left-nav/slimmers/controllers/vega-left-nav-open-state-controller.js +48 -5
  118. package/dist/collection/components/vega-radio/vega-radio-group/vega-radio-group.js +18 -3
  119. package/dist/collection/components/vega-rich-text-editor/constants/constant.js +3 -0
  120. package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/link-wrapper-renderer.js +26 -3
  121. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/base-handler.js +1 -1
  122. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/keyboard-link-handler.js +297 -0
  123. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/user-input-controller.js +13 -0
  124. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/link-toolbar-button-slimmer.js +8 -2
  125. package/dist/collection/components/vega-rich-text-editor/vega-rich-text-editor.js +33 -1
  126. package/dist/collection/components/vega-rich-text-editor/vega-rich-text-link-editor/slimmers/controllers/link-editor-controller.js +398 -0
  127. package/dist/collection/components/vega-rich-text-editor/vega-rich-text-link-editor/slimmers/controllers/link-editor-state-manager.js +111 -0
  128. package/dist/collection/components/vega-rich-text-editor/vega-rich-text-link-editor/slimmers/controllers/link-type-config-controller.js +173 -0
  129. package/dist/collection/components/vega-rich-text-editor/vega-rich-text-link-editor/slimmers/renderers/link-type-handler.js +49 -0
  130. package/dist/collection/components/vega-rich-text-editor/vega-rich-text-link-editor/slimmers/renderers/vega-rich-text-link-editor-renderer.js +114 -106
  131. package/dist/collection/components/vega-rich-text-editor/vega-rich-text-link-editor/slimmers/utils/link-url-normalizer.js +80 -0
  132. package/dist/collection/components/vega-rich-text-editor/vega-rich-text-link-editor/vega-rich-text-link-editor.js +44 -1
  133. package/dist/collection/components/vega-selection-chip/vega-selection-chip-group/vega-selection-chip-group.js +33 -1
  134. package/dist/collection/components/vega-selection-tile/vega-selection-tile-group/vega-selection-tile-group.js +33 -1
  135. package/dist/collection/components/vega-signature-capture/vega-signature-capture.js +33 -1
  136. package/dist/collection/components/vega-stepper/vega-stepper.js +34 -2
  137. package/dist/collection/components/vega-textarea/vega-textarea.js +34 -2
  138. package/dist/collection/components/vega-time-picker/vega-time-picker.js +33 -1
  139. package/dist/collection/components/vega-toggle-switch/vega-toggle-switch.js +34 -2
  140. package/dist/collection/helpers/slimmers/{field-error-controller-silmmer.js → form/field-error-controller-silmmer.js} +3 -3
  141. package/dist/collection/helpers/slimmers/{field-error-ui-controller-slimmer.js → form/field-error-ui-controller-slimmer.js} +9 -9
  142. package/dist/collection/helpers/slimmers/{form-field-controller-slimmer.js → form/form-field-controller-slimmer.js} +9 -18
  143. package/dist/collection/helpers/slimmers/{form-field-message-translator.js → form/form-field-message-translator.js} +1 -1
  144. package/dist/collection/helpers/slimmers/{form-field-state-controller-slimmer.js → form/form-field-state-controller-slimmer.js} +1 -1
  145. package/dist/collection/helpers/slimmers/{form-field-valid-invoke-slimmer.js → form/form-field-valid-invoke-slimmer.js} +2 -2
  146. package/dist/collection/helpers/slimmers/form/utils/form-field-key.js +20 -0
  147. package/dist/collection/helpers/translation/locales/en.js +7 -0
  148. package/dist/collection/helpers/validator/form-field-controller.js +5 -4
  149. package/dist/esm/{app-globals-d7b651c1.js → app-globals-d3991e53.js} +10 -10
  150. package/dist/esm/{code-block-0a88b481.js → code-block-8df86434.js} +5 -2
  151. package/dist/esm/{component-value-history-controller-slimmer.abstract-6846edfa.js → component-value-history-controller-slimmer.abstract-e4b95997.js} +3 -3
  152. package/dist/esm/{content-state-79ca99e5.js → content-state-c63fbeda.js} +2 -2
  153. package/dist/esm/{date-required-rule-b88e1650.js → date-required-rule-85334d0c.js} +1 -1
  154. package/dist/esm/{design-token-76bd217c.js → design-token-10ff79b5.js} +3 -3
  155. package/dist/esm/{element-appender-slimmer-73ad10ae.js → element-appender-slimmer-24be8e94.js} +2 -2
  156. package/dist/esm/{form-field-controller-slimmer-395c23e3.js → form-field-controller-slimmer-d8628837.js} +5 -14
  157. package/dist/esm/form-field-key-44ab39d0.js +22 -0
  158. package/dist/esm/{image-annotation-action-bb299ef1.js → image-annotation-action-fcceff95.js} +2 -2
  159. package/dist/esm/{image-extension-48a96f98.js → image-extension-3280bdb0.js} +2 -2
  160. package/dist/esm/index.js +17 -17
  161. package/dist/esm/{inject-keyboard-manager-86126b5b.js → inject-keyboard-manager-ea1aad5b.js} +1 -1
  162. package/dist/esm/{internal-calendar-period-factory-3a07dba0.js → internal-calendar-period-factory-7b294fb6.js} +1 -1
  163. package/dist/esm/{internal-translation-controller-16709132.js → internal-translation-controller-fac22598.js} +7 -0
  164. package/dist/esm/{keyboard-manager-a0c3e1cf.js → keyboard-manager-50da85d7.js} +1 -1
  165. package/dist/esm/{keyboard-manager-slimmer-f3f66c15.js → keyboard-manager-slimmer-1f7c8bfb.js} +1 -1
  166. package/dist/esm/{link-extension-09534514.js → link-extension-f92c06ef.js} +3 -3
  167. package/dist/esm/loader.js +12 -12
  168. package/dist/esm/{month-view-generator-fd0e1856.js → month-view-generator-a1a9a4ec.js} +1 -1
  169. package/dist/esm/{public-rules-5eb03ef0.js → public-rules-3695aaf7.js} +7 -7
  170. package/dist/esm/{range-d4deb7df.js → range-717d552d.js} +1 -1
  171. package/dist/esm/{responsive-format-facade-ced96b0b.js → responsive-format-facade-f19b601c.js} +1 -1
  172. package/dist/esm/{rich-text-editor-required-rule-5bbbce23.js → rich-text-editor-required-rule-2e39264a.js} +1 -1
  173. package/dist/esm/{split-cell-operation-7f3058ad.js → split-cell-operation-6c26af91.js} +3 -3
  174. package/dist/esm/{state-border-formatter-b680e922.js → state-border-formatter-bfda33aa.js} +1 -1
  175. package/dist/esm/{string-format-strategy.abstract-23faab71.js → string-format-strategy.abstract-1f4ff1b3.js} +1 -1
  176. package/dist/esm/{string-input-formatter-slimmer-4b4866a6.js → string-input-formatter-slimmer-68b2af39.js} +1 -1
  177. package/dist/esm/{string-mask-strategy-66586cd8.js → string-mask-strategy-bbbcdbef.js} +2 -2
  178. package/dist/esm/{style-formatter-f4e16af5.js → style-formatter-e9adc8f4.js} +2 -2
  179. package/dist/esm/{time-required-rule-6e80a9ab.js → time-required-rule-1ce2d0a0.js} +1 -1
  180. package/dist/esm/{token-extension-40c32bcc.js → token-extension-5082a4d2.js} +8 -8
  181. package/dist/esm/{translation-slimmer-21748a0e.js → translation-slimmer-ee0f0e76.js} +1 -1
  182. package/dist/esm/{type-guard-ec5e8628.js → type-guard-f2624334.js} +1 -1
  183. package/dist/esm/{valid-credit-card-number-rule-ca5a47d6.js → valid-credit-card-number-rule-60212b1d.js} +1 -1
  184. package/dist/esm/vega-accordion.entry.js +6 -6
  185. package/dist/esm/vega-app-header-button.entry.js +5 -5
  186. package/dist/esm/vega-backdrop.entry.js +63 -8
  187. package/dist/esm/vega-box.entry.js +6 -6
  188. package/dist/esm/vega-button-circle.entry.js +5 -5
  189. package/dist/esm/vega-button.entry.js +3 -3
  190. package/dist/esm/vega-calendar_5.entry.js +7 -7
  191. package/dist/esm/vega-card.entry.js +5 -5
  192. package/dist/esm/vega-carousel.entry.js +3 -3
  193. package/dist/esm/vega-checkbox_2.entry.js +20 -3
  194. package/dist/esm/vega-chip.entry.js +5 -5
  195. package/dist/esm/vega-code-block.entry.js +8 -8
  196. package/dist/esm/vega-color-picker.entry.js +11 -2
  197. package/dist/esm/vega-color-swatch-picker.entry.js +12 -3
  198. package/dist/esm/vega-color-swatch.entry.js +2 -2
  199. package/dist/esm/vega-combo-box.entry.js +17 -8
  200. package/dist/esm/vega-date-picker_2.entry.js +22 -13
  201. package/dist/esm/vega-dialog_2.entry.js +3 -3
  202. package/dist/esm/vega-divider.entry.js +5 -5
  203. package/dist/esm/vega-dropdown_5.entry.js +7 -7
  204. package/dist/esm/vega-env-manager-8f8dc473.js +2 -2
  205. package/dist/esm/vega-field-label.entry.js +2 -2
  206. package/dist/esm/vega-file-uploader.entry.js +12 -3
  207. package/dist/esm/vega-flag-icon.entry.js +5 -5
  208. package/dist/esm/vega-flex.entry.js +6 -6
  209. package/dist/esm/vega-font.entry.js +5 -5
  210. package/dist/esm/vega-form.entry.js +28 -25
  211. package/dist/esm/vega-grid.entry.js +5 -5
  212. package/dist/esm/vega-icon.entry.js +5 -5
  213. package/dist/esm/vega-image-uploader.entry.js +14 -5
  214. package/dist/esm/vega-input-credit-card.entry.js +16 -7
  215. package/dist/esm/vega-input-numeric.entry.js +14 -5
  216. package/dist/esm/vega-input-passcode.entry.js +14 -5
  217. package/dist/esm/vega-input-phone-number.entry.js +13 -4
  218. package/dist/esm/vega-input-range.entry.js +12 -3
  219. package/dist/esm/vega-input-select.entry.js +14 -5
  220. package/dist/esm/vega-input.entry.js +9 -7
  221. package/dist/esm/vega-left-nav_5.entry.js +71 -11
  222. package/dist/esm/vega-loader-wrapper_2.entry.js +3 -3
  223. package/dist/esm/vega-pagination-page-size-selector-mobile.entry.js +2 -2
  224. package/dist/esm/vega-pagination.entry.js +4 -4
  225. package/dist/esm/vega-popover_2.entry.js +8 -8
  226. package/dist/esm/vega-progress-tracker_2.entry.js +3 -3
  227. package/dist/esm/vega-radio_2.entry.js +17 -5
  228. package/dist/esm/vega-rich-text-content.entry.js +32 -9
  229. package/dist/esm/vega-rich-text-editor_4.entry.js +1581 -428
  230. package/dist/esm/vega-rich-text-find-replace-panel.entry.js +1 -1
  231. package/dist/esm/vega-rich-text-special-characters-panel.entry.js +5 -5
  232. package/dist/esm/vega-rich-text-table-properties_3.entry.js +8 -8
  233. package/dist/esm/vega-selection-chip_2.entry.js +13 -4
  234. package/dist/esm/vega-selection-tile_2.entry.js +11 -2
  235. package/dist/esm/vega-sidenav_3.entry.js +3 -3
  236. package/dist/esm/vega-signature-capture.entry.js +16 -7
  237. package/dist/esm/vega-stepper.entry.js +12 -3
  238. package/dist/esm/vega-table_11.entry.js +4 -4
  239. package/dist/esm/vega-textarea.entry.js +12 -3
  240. package/dist/esm/vega-time-picker_2.entry.js +18 -9
  241. package/dist/esm/vega-toggle-switch.entry.js +12 -3
  242. package/dist/esm/vega-tooltip_2.entry.js +6 -6
  243. package/dist/esm/vega.js +12 -12
  244. package/dist/sri/vega-sri-manifest.json +314 -310
  245. package/dist/types/components/vega-backdrop/slimmers/controller/vega-backdrop-visible-controller.d.ts +21 -0
  246. package/dist/types/components/vega-checkbox/vega-checkbox-group/vega-checkbox-group.d.ts +9 -1
  247. package/dist/types/components/vega-checkbox/vega-checkbox.d.ts +9 -1
  248. package/dist/types/components/vega-color-picker/vega-color-picker.d.ts +9 -1
  249. package/dist/types/components/vega-color-swatch/vega-color-swatch-picker/vega-color-swatch-picker.d.ts +9 -1
  250. package/dist/types/components/vega-combo-box/vega-combo-box.d.ts +9 -1
  251. package/dist/types/components/vega-date-picker/vega-date-picker.d.ts +9 -1
  252. package/dist/types/components/vega-file-uploader/vega-file-uploader.d.ts +9 -1
  253. package/dist/types/components/vega-form/slimmers/controllers/vega-form-field-controller.d.ts +3 -2
  254. package/dist/types/components/vega-form/slimmers/renderers/native-form-renderer.d.ts +1 -0
  255. package/dist/types/components/vega-form/vega-form.d.ts +8 -0
  256. package/dist/types/components/vega-image-uploader/vega-image-uploader.d.ts +9 -1
  257. package/dist/types/components/vega-input/vega-input.d.ts +3 -2
  258. package/dist/types/components/vega-input-credit-card/vega-input-credit-card.d.ts +9 -1
  259. package/dist/types/components/vega-input-numeric/vega-input-numeric.d.ts +9 -1
  260. package/dist/types/components/vega-input-passcode/vega-input-passcode.d.ts +9 -1
  261. package/dist/types/components/vega-input-phone-number/vega-input-phone-number.d.ts +9 -1
  262. package/dist/types/components/vega-input-range/vega-input-range.d.ts +9 -1
  263. package/dist/types/components/vega-input-select/vega-input-select.d.ts +9 -1
  264. package/dist/types/components/vega-nav/vega-left-nav/slimmers/controllers/vega-left-nav-backdrop-manager.d.ts +7 -0
  265. package/dist/types/components/vega-nav/vega-left-nav/slimmers/controllers/vega-left-nav-open-state-controller.d.ts +17 -0
  266. package/dist/types/components/vega-radio/vega-radio-group/vega-radio-group.d.ts +5 -1
  267. package/dist/types/components/vega-rich-text-editor/constants/constant.d.ts +3 -0
  268. package/dist/types/components/vega-rich-text-editor/extensions/link/type.d.ts +34 -0
  269. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/base-handler.d.ts +4 -4
  270. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/keyboard-link-handler.d.ts +111 -0
  271. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/user-input-controller.d.ts +7 -0
  272. package/dist/types/components/vega-rich-text-editor/vega-rich-text-editor.d.ts +9 -1
  273. package/dist/types/components/vega-rich-text-editor/vega-rich-text-link-editor/slimmers/controllers/link-editor-controller.d.ts +149 -0
  274. package/dist/types/components/vega-rich-text-editor/vega-rich-text-link-editor/slimmers/controllers/link-editor-state-manager.d.ts +84 -0
  275. package/dist/types/components/vega-rich-text-editor/vega-rich-text-link-editor/slimmers/controllers/link-type-config-controller.d.ts +82 -0
  276. package/dist/types/components/vega-rich-text-editor/vega-rich-text-link-editor/slimmers/renderers/link-type-handler.d.ts +33 -0
  277. package/dist/types/components/vega-rich-text-editor/vega-rich-text-link-editor/slimmers/renderers/vega-rich-text-link-editor-renderer.d.ts +24 -17
  278. package/dist/types/components/vega-rich-text-editor/vega-rich-text-link-editor/slimmers/utils/link-url-normalizer.d.ts +37 -0
  279. package/dist/types/components/vega-rich-text-editor/vega-rich-text-link-editor/types.d.ts +4 -0
  280. package/dist/types/components/vega-rich-text-editor/vega-rich-text-link-editor/vega-rich-text-link-editor.d.ts +12 -0
  281. package/dist/types/components/vega-selection-chip/vega-selection-chip-group/vega-selection-chip-group.d.ts +9 -1
  282. package/dist/types/components/vega-selection-tile/vega-selection-tile-group/vega-selection-tile-group.d.ts +9 -1
  283. package/dist/types/components/vega-signature-capture/vega-signature-capture.d.ts +9 -1
  284. package/dist/types/components/vega-stepper/vega-stepper.d.ts +9 -1
  285. package/dist/types/components/vega-textarea/vega-textarea.d.ts +9 -1
  286. package/dist/types/components/vega-time-picker/vega-time-picker.d.ts +9 -1
  287. package/dist/types/components/vega-toggle-switch/vega-toggle-switch.d.ts +9 -1
  288. package/dist/types/components.d.ts +287 -4
  289. package/dist/types/helpers/slimmers/{field-error-controller-silmmer.d.ts → form/field-error-controller-silmmer.d.ts} +1 -1
  290. package/dist/types/helpers/slimmers/{field-error-ui-controller-slimmer.d.ts → form/field-error-ui-controller-slimmer.d.ts} +2 -2
  291. package/dist/types/helpers/slimmers/{form-field-controller-slimmer.d.ts → form/form-field-controller-slimmer.d.ts} +6 -14
  292. package/dist/types/helpers/slimmers/{form-field-message-translator.d.ts → form/form-field-message-translator.d.ts} +2 -2
  293. package/dist/types/helpers/slimmers/{form-field-state-controller-slimmer.d.ts → form/form-field-state-controller-slimmer.d.ts} +2 -2
  294. package/dist/types/helpers/slimmers/{form-field-valid-invoke-slimmer.d.ts → form/form-field-valid-invoke-slimmer.d.ts} +3 -3
  295. package/dist/types/helpers/slimmers/form/utils/form-field-key.d.ts +17 -0
  296. package/dist/types/helpers/translation/interface.d.ts +7 -0
  297. package/dist/types/helpers/validator/form-field-controller.d.ts +3 -3
  298. package/dist/vega/index.esm.js +1 -1
  299. package/dist/vega/p-040ea356.entry.js +1 -0
  300. package/dist/vega/p-046203cb.entry.js +1 -0
  301. package/dist/vega/p-0499e65a.entry.js +1 -0
  302. package/dist/vega/p-0809c651.js +1 -0
  303. package/dist/vega/{p-3c23ec90.js → p-09524fec.js} +1 -1
  304. package/dist/vega/{p-74f86ff9.entry.js → p-0cf3b5c1.entry.js} +1 -1
  305. package/dist/vega/p-10d43a80.entry.js +1 -0
  306. package/dist/vega/{p-3d6f761a.entry.js → p-1132a74e.entry.js} +1 -1
  307. package/dist/vega/{p-ba662fe5.js → p-12e8a1b2.js} +1 -1
  308. package/dist/vega/{p-55e0014a.js → p-1d5e05d9.js} +1 -1
  309. package/dist/vega/{p-3dee1e55.js → p-1e0a8fd3.js} +1 -1
  310. package/dist/vega/{p-919cddc3.js → p-1ea9ad9a.js} +1 -1
  311. package/dist/vega/p-21626b93.entry.js +1 -0
  312. package/dist/vega/p-21f608e8.entry.js +1 -0
  313. package/dist/vega/p-2540fd1c.entry.js +1 -0
  314. package/dist/vega/{p-9f201152.entry.js → p-26760c66.entry.js} +1 -1
  315. package/dist/vega/{p-892edf88.entry.js → p-2acf9b42.entry.js} +1 -1
  316. package/dist/vega/p-2bb60f89.js +1 -0
  317. package/dist/vega/{p-b1eb9ff0.js → p-2c2e8615.js} +1 -1
  318. package/dist/vega/p-2d158cbd.js +1 -0
  319. package/dist/vega/p-2d7388c9.entry.js +1 -0
  320. package/dist/vega/{p-b3a2ce06.entry.js → p-2eb8e167.entry.js} +1 -1
  321. package/dist/vega/{p-6a51d720.js → p-2ff4ae1c.js} +1 -1
  322. package/dist/vega/p-3488a3f1.entry.js +1 -0
  323. package/dist/vega/p-363ee8a5.entry.js +1 -0
  324. package/dist/vega/p-36c89520.entry.js +1 -0
  325. package/dist/vega/{p-e1737c8e.entry.js → p-3980dfa8.entry.js} +1 -1
  326. package/dist/vega/{p-14baa886.js → p-39c5054b.js} +1 -1
  327. package/dist/vega/p-3af5e87b.entry.js +1 -0
  328. package/dist/vega/{p-8db904dc.js → p-456f678b.js} +1 -1
  329. package/dist/vega/{p-6c9c2f8c.entry.js → p-461100b8.entry.js} +1 -1
  330. package/dist/vega/p-4c3a08be.entry.js +1 -0
  331. package/dist/vega/p-53fd3c41.entry.js +1 -0
  332. package/dist/vega/{p-6fcec7c7.entry.js → p-56417ec5.entry.js} +1 -1
  333. package/dist/vega/{p-9f11b579.js → p-5e37b041.js} +1 -1
  334. package/dist/vega/p-5f377954.js +1 -1
  335. package/dist/vega/{p-a0a58295.entry.js → p-5f96e741.entry.js} +1 -1
  336. package/dist/vega/p-6b76b572.entry.js +1 -0
  337. package/dist/vega/{p-75e33859.js → p-6c95a6a3.js} +1 -1
  338. package/dist/vega/p-703ac992.entry.js +1 -0
  339. package/dist/vega/p-71909102.js +1 -0
  340. package/dist/vega/{p-e1b57e8f.entry.js → p-72ab5cd5.entry.js} +1 -1
  341. package/dist/vega/{p-8720816e.js → p-781b7a54.js} +1 -1
  342. package/dist/vega/{p-7950f3e2.entry.js → p-81d4dfcb.entry.js} +1 -1
  343. package/dist/vega/p-8611465f.entry.js +1 -0
  344. package/dist/vega/{p-0d18368b.js → p-874e5624.js} +1 -1
  345. package/dist/vega/{p-c4564904.js → p-8e7932bc.js} +1 -1
  346. package/dist/vega/p-8ed3b2b6.entry.js +1 -0
  347. package/dist/vega/{p-1dfbc542.entry.js → p-8ff92914.entry.js} +1 -1
  348. package/dist/vega/{p-9bdc6e11.entry.js → p-92528dc9.entry.js} +1 -1
  349. package/dist/vega/p-9664e914.entry.js +1 -0
  350. package/dist/vega/p-98fc5821.entry.js +1 -0
  351. package/dist/vega/{p-6c7b6d45.js → p-9be02fa5.js} +1 -1
  352. package/dist/vega/p-9c4c474e.entry.js +1 -0
  353. package/dist/vega/{p-8354cff0.entry.js → p-a034dfc0.entry.js} +1 -1
  354. package/dist/vega/{p-e48a870f.entry.js → p-a484e32d.entry.js} +1 -1
  355. package/dist/vega/{p-b9e72de2.entry.js → p-a8174ad8.entry.js} +1 -1
  356. package/dist/vega/{p-49e1cf4d.entry.js → p-a91927eb.entry.js} +1 -1
  357. package/dist/vega/{p-2df5d59b.entry.js → p-abbceebf.entry.js} +1 -1
  358. package/dist/vega/{p-e4266b45.entry.js → p-ac94ba1b.entry.js} +1 -1
  359. package/dist/vega/{p-b775e51f.js → p-ae2abdfa.js} +1 -1
  360. package/dist/vega/{p-bb60e381.entry.js → p-aeb50cad.entry.js} +1 -1
  361. package/dist/vega/{p-a890d60b.entry.js → p-b00ec194.entry.js} +1 -1
  362. package/dist/vega/{p-f78944d7.entry.js → p-b3733762.entry.js} +1 -1
  363. package/dist/vega/p-b594a11c.entry.js +1 -0
  364. package/dist/vega/{p-b4e7c967.js → p-b622c455.js} +1 -1
  365. package/dist/vega/{p-1232b553.entry.js → p-b98ead05.entry.js} +1 -1
  366. package/dist/vega/{p-e5ff77f7.entry.js → p-c2277448.entry.js} +1 -1
  367. package/dist/vega/{p-ec5dee32.js → p-c29934ef.js} +1 -1
  368. package/dist/vega/p-c3646101.entry.js +1 -0
  369. package/dist/vega/p-ca270da3.entry.js +1 -0
  370. package/dist/vega/{p-b4c26035.entry.js → p-ccbe3f1b.entry.js} +1 -1
  371. package/dist/vega/{p-6cde45fc.js → p-cd69aeae.js} +1 -1
  372. package/dist/vega/{p-84b7a775.js → p-d25c1a48.js} +1 -1
  373. package/dist/vega/{p-5924adae.entry.js → p-d2cbcf5e.entry.js} +1 -1
  374. package/dist/vega/{p-96da7d30.entry.js → p-d3413a78.entry.js} +1 -1
  375. package/dist/vega/{p-f1974321.js → p-d609c3fd.js} +1 -1
  376. package/dist/vega/{p-3345d903.js → p-dad7d2ac.js} +1 -1
  377. package/dist/vega/{p-61ce8029.js → p-dbb4b1d1.js} +1 -1
  378. package/dist/vega/p-dcd3e3a7.js +1 -0
  379. package/dist/vega/p-de8f0d98.js +1 -0
  380. package/dist/vega/{p-22cc174e.entry.js → p-deaf037a.entry.js} +1 -1
  381. package/dist/vega/p-e1029acc.js +1 -0
  382. package/dist/vega/p-e18c0656.entry.js +1 -0
  383. package/dist/vega/p-e3fdb65c.entry.js +1 -0
  384. package/dist/vega/p-e7e963ba.entry.js +1 -0
  385. package/dist/vega/{p-312d8205.js → p-e9b005df.js} +1 -1
  386. package/dist/vega/{p-9d3f69cb.js → p-e9d09211.js} +1 -1
  387. package/dist/vega/{p-3c309a38.js → p-f1078e63.js} +1 -1
  388. package/dist/vega/{p-595998d9.entry.js → p-f29ea345.entry.js} +1 -1
  389. package/dist/vega/p-f5095035.entry.js +1 -0
  390. package/dist/vega/{p-f29d9707.entry.js → p-f95d8d10.entry.js} +1 -1
  391. package/dist/vega/vega.esm.js +1 -1
  392. package/package.json +1 -1
  393. package/dist/vega/p-0512308f.entry.js +0 -1
  394. package/dist/vega/p-1d8312d3.entry.js +0 -1
  395. package/dist/vega/p-2d77ae73.entry.js +0 -1
  396. package/dist/vega/p-2d8d4d5b.entry.js +0 -1
  397. package/dist/vega/p-320091b7.js +0 -1
  398. package/dist/vega/p-36949349.js +0 -1
  399. package/dist/vega/p-4151f53a.entry.js +0 -1
  400. package/dist/vega/p-4ff48b84.js +0 -1
  401. package/dist/vega/p-5e4517eb.entry.js +0 -1
  402. package/dist/vega/p-6680ba17.entry.js +0 -1
  403. package/dist/vega/p-80b7945a.entry.js +0 -1
  404. package/dist/vega/p-841b3281.entry.js +0 -1
  405. package/dist/vega/p-87e5cb56.entry.js +0 -1
  406. package/dist/vega/p-91303402.entry.js +0 -1
  407. package/dist/vega/p-97215133.js +0 -1
  408. package/dist/vega/p-9d96d83f.entry.js +0 -1
  409. package/dist/vega/p-a05a2f1e.entry.js +0 -1
  410. package/dist/vega/p-a775825e.entry.js +0 -1
  411. package/dist/vega/p-acaff62d.entry.js +0 -1
  412. package/dist/vega/p-ae146458.entry.js +0 -1
  413. package/dist/vega/p-b63319e9.entry.js +0 -1
  414. package/dist/vega/p-b660f38c.entry.js +0 -1
  415. package/dist/vega/p-b8c13ac9.entry.js +0 -1
  416. package/dist/vega/p-b8ffa42f.entry.js +0 -1
  417. package/dist/vega/p-bbad318e.entry.js +0 -1
  418. package/dist/vega/p-c0e42c03.entry.js +0 -1
  419. package/dist/vega/p-c41f5684.entry.js +0 -1
  420. package/dist/vega/p-c54b5a8f.entry.js +0 -1
  421. package/dist/vega/p-cd1e976c.entry.js +0 -1
  422. package/dist/vega/p-d9158512.js +0 -1
  423. package/dist/vega/p-e62d41ee.js +0 -1
  424. package/dist/vega/p-ebe32b25.entry.js +0 -1
  425. package/dist/vega/p-ec162599.entry.js +0 -1
  426. package/dist/vega/p-fc7e4c8a.entry.js +0 -1
@@ -1,3 +1,3 @@
1
- import{d as t,p as e,g as n,k as s,s as r,v as i,N as o,o as a,w as l,x as c,A as h,j as u,i as d,y as w,I as p,e as f,M as m,b as g,R as T,S as x,a as b,z as O,D as y,H as E,E as k,F as A,U as C,G as H,J as v,q as B,K as j,L as N,O as I,P as S,Q as R,T as L,W as D,X as $,Y as P,Z as M,u as F,_ as z,$ as U,n as V,a0 as G,a1 as W,a2 as J,a3 as K,m as Y,a4 as X,a5 as Q,r as Z,a6 as _,a7 as q}from"./p-e62d41ee.js";import{g as tt}from"./p-8b5d3a52.js";import{i as et}from"./p-8db904dc.js";import{C as nt}from"./p-2d0d575f.js";import{d as st}from"./p-526e3634.js";import{c as rt,d as it,e as ot}from"./p-3a68b729.js";import{r as at,i as lt}from"./p-528748fa.js";import{c as ct}from"./p-a841cf13.js";import{L as ht}from"./p-6e1ab235.js";class ut{}class dt{constructor(t,e){this.childrenOutput=[],this.currentStrategy=t,this.currentElements=e}setChildrenOutput(t){this.childrenOutput=t}toDto(t={autoMatchFormat:!0,skipCustomAnnotations:!0}){const e=this.currentStrategy.handle(this.currentElements,t);return this.childrenOutput.length>0&&e&&this.currentStrategy.appendChildBlocks(e,this.childrenOutput.map((e=>e.toDto(t))).filter(et)),e}}const wt=new class{constructor(){this.elementToBlockStrategies=[],this.elementToNodeStrategies=[]}registerElementToBlockStrategy(t){this.hasDuplicateStrategy(t,this.elementToBlockStrategies)||this.elementToBlockStrategies.unshift(t)}registerElementToNodeStrategy(t){this.hasDuplicateStrategy(t,this.elementToNodeStrategies)||this.elementToNodeStrategies.unshift(t)}getElementToBlockStrategies(){return this.elementToBlockStrategies}getElementToNodeStrategies(){return this.elementToNodeStrategies}hasDuplicateStrategy(t,e){return e.includes(t)}},pt=new class{process(t,e={autoMatchFormat:!0,skipCustomAnnotations:!0}){const n=this.getElementToBlockStrategies(),s=[];for(let r=0;r<t.length;r++){if(this.isInvalidElement(t[r],e))continue;let i=0;for(const o of n)if(i=o.canHandle(t,r,e),i>0){const n=t.slice(r,r+i),a=new dt(o,n);1===i&&o.shouldProceedToElementChildren()&&a.setChildrenOutput(this.process(Array.from(n[0].childNodes),e)),s.push(a),r+=i-1;break}if(0===i&&r<t.length){const n=Array.from(t[r].childNodes),i=this.process(Array.from(n),e);i.length>0&&s.push(...i)}}return s}isInvalidElement(t,e){return t.nodeType===Node.COMMENT_NODE||!1!==e.autoMatchFormat&&["META","STYLE"].includes(t.nodeName)}getElementToBlockStrategies(){return wt.getElementToBlockStrategies()}};class ft extends t{handleAction(t,e){const n=t.entityToBeAppended;e.children&&(n.forEach((t=>{t.parent=e})),e.children=e.children.concat(n))}}class mt extends t{handleAction(t,e){this.replaceElementWithElements(e,t.referChildren,[...t.childrenToBeInserted,t.referChildren])}replaceElementWithElements(t,e,n){t.children&&(n.forEach((e=>{e.parent=t})),t.children=t.children.flatMap((t=>t===e?n:t)))}}class gt extends mt{handleAction(t,e){this.replaceElementWithElements(e,t.referChildren,[t.referChildren,...t.childrenToBeInserted])}}class Tt extends i{constructor(t,e){super(),this.type=o.IMAGE,this.size=t,this.alt=e}static from(t,e){return[o.IMAGE,new Tt(t,e)]}static getDefaultStyles(){return{verticalAlign:"bottom"}}toJSON(){return et(this.alt)?{size:this.size,alt:this.alt}:{size:this.size}}clone(){return new Tt(this.size,this.alt)}renderClass(t){return(null==t?void 0:t.standalone)?null:this.size?`v-rte--image-size-${this.size}`:null}renderStyle(t){if(!(null==t?void 0:t.standalone))return null;const e=Tt.getDefaultStyles();switch(this.size){case"sm":return Object.assign(Object.assign({},e),{width:"25%"});case"md":return Object.assign(Object.assign({},e),{width:"50%"});case"lg":return Object.assign(Object.assign({},e),{width:"100%"})}}}Tt.BASE_STYLES={verticalAlign:"bottom"};class xt extends a{constructor(t,e,n,s){super(t,s),this.dtoName=xt.dtoName,this.type=l.IMAGE,this.url=e,this.parent=n}static from(t,e,n={autoMatchFormat:!0}){const s=new xt(t.id,t.url,e),r=!!n.autoMatchFormat,i=Object.assign({},t.annotations),{size:o}=i,a=function(t,e){var n={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(n[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(t);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(t,s[r])&&(n[s[r]]=t[s[r]])}return n}(i,["size"]),l=Object.assign(Object.assign({},a),{size:null!=o?o:r?"md":void 0});return s.annotationMap=new Map(Object.keys(l).map((t=>"size"===t||"alt"===t?Tt.from(l.size,l.alt):this.createAnnotationEntity(t,l[t]))).filter(et)),s}toJSON(){const t=Array.from(this.annotationMap.values()).filter((t=>t instanceof Tt||t instanceof c)).reduce(((t,e)=>Object.assign(Object.assign({},t),e.toJSON())),{});return""==t.alt&&delete t.alt,Object.assign(Object.assign({id:this.id},Object.keys(t).length>0?{annotations:t}:{}),{type:"image",url:this.url})}clone(t){return new xt(this.id,this.url,t,super.cloneAnnotations())}toHtml(t){const e=this.getAnnotationByType(o.IMAGE);return`<img${super.generateAttributeString(t,...[e&&e.alt?`alt="${e.alt}"`:null,`src="${this.url}"`,e&&e.size?`data-size="${e.size}"`:null].filter(et))}>`}doAnnotationActionApply(t){const e=h.get(u.name,xt.name);e&&e.execute(t,this)}doModifyActionApply(t){h.executeTheStrategy(t,this)}}h.register(d.UPDATE_IMAGE_NODE_URL,xt.name,new class extends t{handleAction(t,e){e.url=t.url}}),h.register(u.name,xt.name,new class extends t{handleAction(t,e){const n=t.toAnnotation();e.annotationMap.set(n.type,n)}}),xt.dtoName="RTEImageNode";class bt extends m{constructor(t,e){super(),this.type=d.INSERT_NEW_PARAGRAPH,this.startContainerNode=t,this.startOffset=e}}class Ot extends b{constructor(t){super(t),this.dtoName=Ot.dtoName,this.type="image",this.children=[]}static from(t,e={autoMatchFormat:!0}){const n=new Ot(t.id),{annotations:s}=t;return n.children=t.nodes.map((t=>xt.from(t,n,e))),s&&super.convertAnnotationsToMap(n.annotationMap,s),n}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{type:"image",nodes:this.children.map((t=>t.toJSON()))})}toHtml(t){const e=super.generateAttributeString(t),n=this.children.map((e=>e.toHtml(t))).join("");return super.shouldRenderAsInternalWrapper()?n:[`<div${e}>`,n,"</div>"].join("")}isNotEmpty(){return this.children.length>0&&this.children.some((t=>t.url.length>0))}getLastNode(){return this.children[this.children.length-1]}createNewImageBlock(){return new Ot(tt())}clone(t){const e=new Ot(this.id);return e.children=this.children.map((t=>t.clone(e))),e.annotationMap=super.cloneAnnotations(),e.parent=t,e}}h.register(d.MERGE_TWO_BLOCKS_NODES,Ot.name,new O),h.register(d.REPLACE_CHILD_NODES,Ot.name,new y),h.register(d.SPLIT_BLOCK_WITH_NODE,Ot.name,new class extends t{handleAction(t,e){t.newBlock=this.splitImageNodes(t.splitPointNode,t.startOffsetOfNode,e)}splitImageNodes(t,e,n){const s=n.children.indexOf(t);if(s>-1){const t=n.children.slice(0,s+e),r=n.children.slice(s+e);n.apply(new w(t));const i=this.cloneWithNodes(r,n);return n.parent.apply(new p(n,i)),i}}cloneWithNodes(t,e){const n=e.createNewImageBlock();return n.children=[],n.apply(new f(t)),n}}),h.register(d.LINE_BREAK_SINGLE_BLOCK,Ot.name,new class extends t{handleAction(t,e){const n=new bt(t.startContainerNode,t.startOffset);e.apply(n);const s=n.newBlock;s&&(t.lineBreakNode=s.children[0])}}),h.register(d.LINE_BREAK_MULTIPLE_BLOCKS,Ot.name,new class extends t{handleAction(t,e){t.lineBreakNode=this.lineBreakMultipleBlocks(t.selectedBlocks,e)}lineBreakMultipleBlocks(t,e){const n=g.from({id:tt(),type:"paragraph",nodes:[{id:tt(),type:"text",text:"\n"}]});e.parent.apply(new p(e,n));const s=this.concatBlocksNodes(t.slice(1));return(0===s.length||s[0]&&""===s[0].text)&&s.push(new T(tt(),"\n",n)),n.apply(new f(s)),n.children[0]}concatBlocksNodes(t){const e=[];return t.map((t=>{"image"!==t.type&&(e.push(...t.children),t.parent.apply(new s(t)))})),e}}),h.register(d.INSERT_IMAGE_TO_BLOCK,Ot.name,new class extends t{handleAction(t,e){const s=t.splitPointNode,r=t.startOffsetOfNode,i=t.imageBlockToBeInserted;e.children.length<1?e.apply(new f(i.children)):this.isCaretPositionAtBlockEnd(e,s,r)?e.parent.apply(new p(e,i)):this.isCaretPositionAtBlockStart(e,s,r)?e.parent.apply(new n(e,i)):(e.apply(new x(s,r)),e.parent.apply(new p(e,i)))}}),h.register(E.name,Ot.name,new k),Ot.dtoName="RTEImageBlock";class yt extends m{constructor(t){super(),this.type=d.MERGE_TWO_BLOCKS_NODES,this.blockNeedToBeMerged=t}}class Et extends A{handleAction(t,e){const{startContainerNode:n}=t;n.isContentEditable()?n.isTextNode()&&this.deleteTextNodeContent(t,e):this.deleteDecoratorNodeContent(t,e);const r=e.parent;r&&e.isListItemBlock()&&0===r.children.length&&r.parent.apply(new s(r))}deleteTextNodeContent(t,e){const n=t.startContainerNode,r=t.startOffset;if(0!==r&&!n.isEmpty()){const i=n.text.slice(0,r-1)+n.text.slice(r);if(n.apply(new C(i)),i)return void(t.previousNode=n);{const r=e.children.indexOf(n),i=e.children[r+1],o=this.getPreviousNode(n);return o&&o.parent===e&&"\n"===o.text||1===e.children.length?void(t.previousNode=n):(e.apply(new s(n)),void(i&&(null==o?void 0:o.parent)!==e?t.nextNode=i:t.previousNode=o))}}{let r=this.getPreviousNode(n),i=null;const o=n.isEmpty();if(e.children.length&&r&&r.parent!==e)o&&e.apply(new s(n)),e.type===r.parent.type&&r.parent.apply(new yt(e));else if(this.isContentFirstNode(n)&&o&&(i=this.getNextNode(n)),o&&e.apply(new s(n)),r&&r.isTextNode()&&(r.isEmpty()||!r.isContentEditable()&&r.parent===e)){const t=r;r=this.getPreviousNode(r),t.parent.apply(new s(t)),r||o||(i=n)}0===e.children.length&&e.parent.apply(new s(e)),r?t.previousNode=r:i&&(t.nextNode=i)}}deleteDecoratorNodeContent(t,e){const n=t.startContainerNode,r=t.startOffset;let i=this.getPreviousNode(n),o=null;if(0!==r){const t=e;this.isContentFirstNode(n)&&(o=this.getNextNode(n)),1===t.children.length?t.parent.apply(new s(t)):t.apply(new s(n))}else{const r=i;r&&!r.isContentEditable()&&r.parent===e?(i=this.getPreviousNode(r),r.parent.apply(new s(r)),i||(t.nextNode=n)):i&&i.parent!==e&&e.type===i.parent.type&&i.parent.apply(new yt(e))}i?t.previousNode=i:o&&(t.nextNode=o)}}class kt extends t{handleAction(t,e){const{startContainerNode:n}=t;t.newBlock=this.breakSingleBlock(n,t.startOffset,e)}breakSingleBlock(t,e,s){const r=this.getNewParagraph(t);if(r){if(this.isCaretPositionAtBlockEnd(s,t,e))s.parent.apply(new p(s,r));else{if(!this.isCaretPositionAtBlockStart(s,t,e)){const n=new x(t,e);return s.apply(n),n.newBlock}s.parent.apply(new n(s,r))}return r}}getNewParagraph(t){const e=this.createNewParagraph("");if(e){let n=e.children[0];return t.isTextNode()&&t.isContentEditable()&&(e.children=[],n=t.cloneWithText(""),n.annotationMap.delete(o.LINK),e.apply(new f([n]))),e}}}class At extends m{constructor(t,e,n=!1){super(),this.isFlushable=!0,this.type=d.UPDATE_CURSOR_POSITION,this.immediatelyRun=!1,this.nextFocusNode=t,this.offset=e,this.immediatelyRun=n,this.immediatelyRun&&(this.isFlushable=!1)}}class Ct extends t{handleAction(t,e){const{rteRange:r,nodeToBeInserted:i}=t,{startNode:o,startOffset:a}=r;if(o){const t=e;if(o.isContentEditable()&&o.isTextNode())if("\n"!==o.text&&o.text&&0!==a){const e=o.text.substring(0,a),r=o.text.substring(a),l=o.cloneWithText(e),c=o.cloneWithText(r),h=[l,i];r&&h.push(c),t.apply(new n(o,...h)),t.apply(new s(o))}else t.apply(new n(o,i));else t.apply(0!==a?new p(o,i):new n(o,i));this.updateCursorPosition(i)}}updateCursorPosition(t){const e=this.getRootContent(t.parent);e&&e.apply(new At(t))}}class Ht extends t{handleAction(t,e){const{text:s,offset:r,decoratorNode:i}=t,o=this.createNewParagraph(s);if(o){const t=o.children[0];e.apply(0!==r?new p(i,t):new n(i,t)),this.setTheCursorPosition(t)}}setTheCursorPosition(t){const e=this.getRootContent(t.parent);e&&e.apply(new At(t))}}class vt extends t{handleAction(t,e){t.newBlock=this.breakSingleListItemBlock(t.startContainerNode,t.startOffset,e)}breakSingleListItemBlock(t,e,s){const r=s.createNewListItem(),i=this.copyInlineStyleToNewNode(t);if(r.apply(new f([i])),this.isCaretPositionAtBlockEnd(s,t,e))return this.breakListItemAtEnd(r,s);if(!this.isCaretPositionAtBlockStart(s,t,e)){const n=new x(t,e);return s.apply(n),n.newBlock}return s.parent.apply(new n(s,r)),r}breakListItemAtEnd(t,e){const n=e.parent.children[e.parent.children.length-1],r=1===e.children.length&&e.children[0].isEmpty();if(e===n&&r){const n=e.parent.parent;if("list-item"!==n.type){const r=g.from({id:tt(),type:"paragraph",nodes:[]});return r.apply(new f(t.children)),n.apply(new p(e.parent,r)),e.parent.apply(new s(e)),r}n.parent.apply(new p(n,t)),e.parent.apply(new s(e))}else e.parent.apply(new p(e,t));return t}copyInlineStyleToNewNode(t){const e=t.cloneWithText("");return e.annotationMap.delete(o.LINK),e}}class Bt extends H{handleAction(t,e){var n,r;const i=t.entityToBeRemoved instanceof B?t.entityToBeRemoved:null,o=i?e.children.indexOf(i):-1;(null===(n=null==i?void 0:i.nestList)||void 0===n?void 0:n.length)&&o>=0&&this.promoteNestListsToUpperLevel(i,e,o),super.handleAction(t,e);const a=e.parent;if(0===e.children.length&&a)if("list-item"===a.type){const t=a;(null===(r=t.nestList)||void 0===r?void 0:r.includes(e))&&t.apply(new v(e))}else a.apply(new s(e))}promoteNestListsToUpperLevel(t,e,s){var r,i;const o=[...null!==(r=t.nestList)&&void 0!==r?r:[]];let a=s+1;const l=[];o.forEach((t=>{if(t.type===e.type){const n=[...t.children];n.length>0&&(n.forEach((t=>{t.parent=e})),e.children.splice(a,0,...n),a+=n.length)}else l.push(t)}));const c=e.parent;if(l.length>0&&c instanceof B){const t=[...null!==(i=c.nestList)&&void 0!==i?i:[]],n=t.indexOf(e);n>=0?t.splice(0===s?n:n+1,0,...l):t.push(...l),c.apply(new j(t))}else l.length>0&&c.apply(0===s?new n(e,...l):new p(e,...l));t.apply(new j([]))}}class jt extends t{handleAction(t,e){if(e.parent){const{blocksToBeInserted:s,startNode:r,startOffset:i}=t;let o=e;const a=s[0],l=1===s.length&&r instanceof T&&!["RTEListBlock","RTEHtmlBlock"].includes(a.constructor.name)&&a.children.length>0&&a.children.every((t=>{var e,n;return!0===(null===(n=(e=t).isTextNode)||void 0===n?void 0:n.call(e))}));if(r===e.children[0]&&0===i)e.parent.apply(new n(e,...s));else{if(l)return void this.inlineMergeSingleBlock(t,e);{const n=new x(r,i);e.apply(n),e.parent.apply(new p(e,...s)),o=s[s.length-1],t.futureFocusAtEnd=!0}}t.futureFocusBlock=o}}inlineMergeSingleBlock(t,e){const{blocksToBeInserted:n,startNode:s,startOffset:r}=t,i=n[0],o=i.children,a=s,l=e.children.indexOf(a);if(-1===l){const o=new x(s,r);return e.apply(o),e.parent.apply(new p(e,...n)),t.futureFocusBlock=i,void(t.futureFocusAtEnd=!0)}const c=a.text.slice(0,r),h=a.text.slice(r),u=e.children.slice(0,l),d=e.children.slice(l+1);c&&u.push(a.cloneWithText(c)),h&&d.unshift(a.cloneWithText(h)),e.apply(new w([...u,...o,...d]));const f=o[o.length-1];t.futureFocusBlock=e,t.futureFocusNode=f,f.isTextNode()&&(t.futureFocusNodeOffset=f.text.length)}}const Nt=new class{registerBlockBasicStrategies(t){h.register(d.DELETE_CHILDREN,t,t===N.name?new Bt:new H),h.register(d.APPEND_CHILDREN,t,new ft),h.register(d.INSERT_CHILDREN_BEFORE,t,new mt),h.register(d.INSERT_CHILDREN_AFTER,t,new gt),h.register(d.DELETE_BLOCK_CONTENT,t,new Et),h.register(d.INSERT_NEW_PARAGRAPH,t,t===B.name?new vt:new kt),h.register(d.INSERT_TEXT_TO_DECORATOR_NODE,t,new Ht),h.register(d.INSERT_NODE_TO_NEAREST_ROOT,t,new Ct),h.register(d.PASTE_CONTENT,t,new jt)}};class It{}class St extends It{canHandle(t){return"RTETextNode"===t.dtoName}handle(t,e={}){return this.isBold(t)||e.bold?{bold:!0}:{}}isBold(t){return"STRONG"===t.nodeName||"B"===t.nodeName||t.style.fontWeight===I||t.style.fontWeight===S||t.classList.contains("v-rte--bold")}}class Rt extends It{canHandle(t,e){return!e.skipCustomAnnotations&&!!t}handle(t){const e=this.getAttributes(t);return Object.keys(e).length>0?{customAttribute:e}:{}}getAttributes(t){return t.getAttributeNames().filter((t=>"style"!==t&&"class"!==t&&this.isValidAttr(t))).reduce(((e,n)=>(e[n]=t.getAttribute(n),e)),{})}isValidAttr(t){return/^[a-zA-Z_][\w-]*$/.test(t)}}class Lt extends It{canHandle(t,e){return!e.skipCustomAnnotations&&!!t}handle(t){const e=this.getCustomClass(t);return e.length>0?{customClass:e}:{}}getCustomClass(t){return t.classList.toString().split(" ").filter((t=>!t.includes("v-rte")&&""!==t))}}class Dt extends It{canHandle(t,e){return!e.skipCustomAnnotations&&!!t}handle(t){const e=R(t);return Object.keys(e).length>0?{customStyle:e}:{}}}class $t extends It{canHandle(t){return["RTETextBlock","RTEListItemBlock","RTEListBlock"].includes(t.dtoName)}handle(t){const e=this.getIndent(t);return e?{indent:e}:{}}getIndent(t){const e=t.style;let n;if(e.marginLeft)n=e.marginLeft;else{if(!e.margin)return null;{const t=e.margin.split(" ");switch(t.length){case 4:n=t[3];break;case 2:case 3:n=t[1];break;default:n=t[0]}}}const s=Number(n.replace("px",""));return s&&s>=0?Math.floor(s/16):null}}class Pt extends It{canHandle(t){return["RTETextBlock","RTEListItemBlock","RTEListBlock"].includes(t.dtoName)}handle(t){const e=this.getTextAlign(t);return e?{textAlign:e}:{}}getTextAlign(t){const e=t.classList;if(e.contains("v-rte--horizontal-alignment-left"))return"left";if(e.contains("v-rte--horizontal-alignment-center"))return"center";if(e.contains("v-rte--horizontal-alignment-right"))return"right";if(e.contains("v-rte--horizontal-alignment-justify"))return"justify";switch(t.style.textAlign){case"center":return"center";case"right":return"right";case"justify":return"justify";case"left":return"left";default:return null}}}class Mt extends It{canHandle(t){return"RTETextNode"===t.dtoName}handle(t,e={}){return this.isCode(t)||e.code?{code:!0}:{}}isCode(t){return t.classList.contains("v-rte--code")||"CODE"===t.nodeName||"PRE"===t.nodeName||"monospace"===t.style.fontFamily||"Roboto Mono"===t.style.fontFamily.replace(/["']/g,"")}}class Ft extends It{canHandle(t){return"RTETextNode"===t.dtoName}handle(t,e={}){const n=this.getColor(t)||e.textColor;return n?{textColor:n}:{}}getColor(t){var e;const n=null===(e=at(t.style.color))||void 0===e?void 0:e.toUpperCase();if(n){const t=L.filter((t=>t.key!==D.key)).find((t=>t.light===n||t.dark===n));return t?t.key:null}for(const e of L)if(t.style.color.includes(e.key))return e.key;return null}}class zt extends It{canHandle(t){return"RTETextNode"===t.dtoName}handle(t,e={}){return this.isItalic(t)||e.italic?{italic:!0}:{}}isItalic(t){return"I"===t.nodeName||t.style.fontStyle===$||"EM"===t.nodeName||t.classList.contains("v-rte--italic")}}class Ut extends It{canHandle(t,e){return!!e.autoMatchFormat&&"RTETextBlock"===t.dtoName}handle(t){const e=this.getTextStyle(t);return e?{textStyle:e}:{}}getTextStyle(t){const e=this.getElementTypeByDataType(t);if(e)return e;const n=this.getElementTypeByNodeName(t);if(n)return n;const s=this.getElementTypeByFontSize(t);if(s)return s;return this.getElementTypeByClassName(t)||null}getElementTypeByDataType(t){return t.nodeType!==Node.TEXT_NODE&&t.hasAttribute("data-type")?t.getAttribute("data-type"):null}getElementTypeByFontSize(t){var e;switch(null===(e=t.style)||void 0===e?void 0:e.fontSize){case"36px":return"title";case"28px":return"subtitle";case"22px":return"heading-1";case"20px":return"heading-2";case"18px":return"heading-3";default:return null}}getElementTypeByNodeName(t){switch(t.nodeName){case"P":return"paragraph";case"H1":return"heading-1";case"H2":return"heading-2";case"H3":return"heading-3";case"H4":return"heading-4";case"H5":return"heading-5";case"H6":return"heading-6";default:return null}}getElementTypeByClassName(t){if(t.className){const e=/\bv-rte-(?:-text-style-)?(title|subtitle|heading-1|heading-2|heading-3|heading-4|heading-5|heading-6|paragraph)\b/.exec(t.className);if(e)return e[1]}return null}}class Vt{static isTitleOrSubtitle(t){if("DIV"===t.nodeName){const e=Vt.textStyleHandler.getTextStyle(t);return"title"===e||"subtitle"===e}return!1}static isLinkElement(t){return"A"===t.nodeName}}Vt.textStyleHandler=new Ut;class Gt extends It{constructor(){super(...arguments),this.handlers=[new Rt,new Lt,new Dt]}canHandle(t){return"RTETextNode"===t.dtoName}handle(t,e={}){return e.link?{link:e.link}:Vt.isLinkElement(t)?{link:this.generateLinkAnnotations(t)}:{}}generateLinkAnnotations(t){const e={href:t.getAttribute("href")||"",groupKey:tt()};return this.handlers.forEach((n=>{Object.assign(e,n.handle(t))})),e}}class Wt extends It{canHandle(t){return"RTETextNode"===t.dtoName}handle(t,e={}){return this.isStrikethrough(t)||e.strikethrough?{strikethrough:!0}:{}}isStrikethrough(t){return t.style.textDecoration.includes(P)||"S"===t.nodeName||"DEL"===t.nodeName||t.classList.contains("v-rte--strikethrough")}}class Jt extends It{canHandle(t){return"RTETextNode"===t.dtoName}handle(t,e={}){return this.isUnderline(t)||e.underline?{underline:!0}:{}}isUnderline(t){return t.style.textDecoration.includes(M)||"U"===t.nodeName||"INS"===t.nodeName||t.classList.contains("v-rte--underline")}}class Kt extends It{canHandle(t){return"RTEImageNode"===t.dtoName}handle(t){const e=this.getImageSize(t);return e?{size:e}:{}}getImageSize(t){return t.getAttribute("data-size")?t.getAttribute("data-size"):null}}class Yt extends It{canHandle(t){return"RTEImageNode"===t.dtoName}handle(t){return t.hasAttribute("alt")?{alt:t.getAttribute("alt")}:{}}}const Xt=new Set(["P","H1","H2","H3","H4","H5","H6","LI"]),Qt=new Set(["P","H1","H2","H3","H4","H5","H6","LI","UL","OL","IMG","CODE"]),Zt=new Set(["BR","VEGA-RICH-TEXT-LINK-EDITOR","CODE","A"]),_t=new Set(["TABLE","THEAD","TBODY","TFOOT","TR","DL"]),qt=new Set(["ABBR","B","BDI","BDO","CITE","DEL","DFN","EM","I","INS","KBD","MARK","METER","OUTPUT","PROGRESS","Q","S","SAMP","SMALL","SPAN","STRONG","SUB","SUP","TIME","U","VAR"]);function te(t){return Xt.has(t.parentElement.nodeName)}class ee extends It{constructor(){super(...arguments),this.customAttributeHandler=new Rt,this.customStyleAnnotationHandler=new Dt,this.customClassAnnotationHandler=new Lt}canHandle(t,e){return"RTETextNode"===t.dtoName&&!1===e.autoMatchFormat}handle(t,e){if(Qt.has(t.nodeName)&&!Zt.has(t.nodeName))return{};const n=this.generateInlineHtmlAnnotation(t,Object.assign({},e));return n?{inlineHtml:n}:{}}generateInlineHtmlAnnotation(t,e){let{inlineHtml:n}=e;const s=Array.from(t.childNodes).some((t=>t.nodeType===Node.ELEMENT_NODE));if(!T.supportsHtmlTag(t.nodeName.toLowerCase())||s){const e=Object.assign(Object.assign({htmlTag:t.nodeName.toLowerCase()},s?{groupId:tt()}:{}),{customAttribute:this.customAttributeHandler.handle(t).customAttribute,customStyle:this.customStyleAnnotationHandler.handle(t).customStyle,customClass:this.customClassAnnotationHandler.handle(t).customClass});n=n?this.appendToInlineHtmlChain(n,e,t.parentNode):e}return n?Object.assign({},n):null}appendToInlineHtmlChain(t,e,n){return t.child&&n&&t.child.htmlTag===n.nodeName.toLowerCase()?Object.assign(Object.assign({},t),{child:this.appendToInlineHtmlChain(t.child,e,n)}):Object.assign(Object.assign({},t),{child:e})}}const ne=new class{constructor(){this.handlers=[new Pt,new $t,new St,new zt,new Jt,new Wt,new Ft,new Gt,new Mt,new Kt,new Yt,new Rt,new Lt,new Dt,new Ut,new ee]}registerHandler(t){this.handlers.unshift(t)}generate(t,e,n={autoMatchFormat:!0}){n&&n.filterInlineStyles&&F.executeTheStrategyRefillAction(t.dtoName,e);const s=Vt.isLinkElement(e)&&"RTETextNode"===t.dtoName,r=this.handlers.filter((t=>!(!n.autoMatchFormat&&s)||t instanceof Gt)).filter((r=>e.nodeType!==Node.TEXT_NODE&&r.canHandle(t,{skipCustomAnnotations:n.skipCustomAnnotations||s,autoMatchFormat:n.autoMatchFormat}))).reduce(((t,s)=>{const r=s.handle(e,n.parentAnnotations);return Object.assign(Object.assign({},t),r)}),{});this.removeTextStyleDefaultsFromCustomStyle(r);const i=F.getStrategies(t.dtoName);for(const t of i)(n.autoMatchFormat||t.alwaysFilter)&&t.filterAnnotations(r);return r}removeTextStyleDefaultsFromCustomStyle(t){const e="textStyle"in t?t.textStyle:void 0,n=t.customStyle;if(!e||!n)return t;const s=z.getDefaultStyles(e);if(!s)return t;for(const t of Object.keys(s))n[t]===s[t]&&delete n[t];return 0===Object.keys(n).length&&delete t.customStyle,t}};class se extends ut{constructor(){super(...arguments),this.annotationHandler=new Ut}generateChildNodes(t,e,n){const s=[],r=!(!n||!1!==n.autoMatchFormat),i=Object.assign({},e);return t.forEach((t=>{const o=wt.getElementToNodeStrategies().find((e=>e.canHandle([t],0,n)>0));let a=null;if(o&&(a=o.handle([t],n,i)),a)s.push(a);else if(lt(t)&&t.childNodes.length>0){const o=ne.generate(T,t,Object.assign({parentAnnotations:r?{inlineHtml:i.inlineHtml,link:i.link,code:i.code}:e},n));s.push(...this.generateChildNodes(Array.from(t.childNodes),o,n))}})),s}matchTextBlockType(t){var e;return null!==(e=this.annotationHandler.handle(t).textStyle)&&void 0!==e?e:"paragraph"}}class re extends se{canHandle(t,e){return"PRE"!==t[e].tagName&&"CODE"!==t[e].tagName||!t[e].hasAttribute("data-language")?0:1}handle(t){const n=t[0];if(n){const t=n.textContent,s=n.dataset.language;return e.from({id:tt(),type:"code-block",content:t,language:s})}}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}class ie extends se{createRTEImageBlock(t,e){const n=!(e&&e.autoMatchFormat||!t.parentNode||"DIV"===t.parentNode.nodeName);return Ot.from({id:tt(),type:"image",nodes:[{id:tt(),type:"image",url:t.src,annotations:ne.generate(xt,t,e)}],annotations:Object.assign(Object.assign({},ne.generate(Ot,t.parentElement,e)),{internalWrapper:n})},e)}}class oe extends ut{shouldProceedToElementChildren(){return!1}appendChildBlocks(){}generateTextNode(t,e){return{id:tt(),type:"text",text:t,annotations:e}}}class ae extends V{constructor(){super(...arguments),this.stylesToBeFiltered={}}get alwaysFilter(){return!0}filterAnnotations(t){const{textAlign:e,customStyle:n}=t;return e&&n?(this.stylesToBeFiltered=J.getDefaultStyles(e),super.filterAnnotations(t)):t}}class le extends V{constructor(){super(...arguments),this.stylesToBeFiltered=z.getDefaultStyles("paragraph"),this.type="paragraph",this.elementTagName="p"}filterAnnotations(t){return t}canFilter(t){return G.isTextBlock(t.dtoName)&&t.type===this.type}canRefill(t,e){const n=this.classNameToBeAdded?`.${this.classNameToBeAdded}`:this.elementTagName;return G.isTextBlock(t)&&e.matches(n)}toCssText(){return this.buildCssTextForStyles(this.elementTagName,this.classNameToBeAdded)}}class ce extends le{constructor(t){super(),this.type="heading-1",this.elementTagName="h1",this.type=`heading-${t}`,this.elementTagName=`h${t}`,this.stylesToBeFiltered=z.getDefaultStyles(this.type)}}class he extends le{constructor(t){super(),this.type="title",this.elementTagName="div",this.classNameToBeAdded="v-rte-title",this.type=t,this.classNameToBeAdded=`v-rte-${t}`,this.stylesToBeFiltered=z.getDefaultStyles(this.type)}}class ue extends V{constructor(){super(...arguments),this.stylesToBeFiltered=ue.BOLD_STYLES,this.elementTagName="span",this.parentBlockTypes=["heading-1","heading-2","heading-3","heading-4","heading-5","heading-6","title"],this.parentElementSelectors=["h1","h2","h3","h4","h5","h6",".v-rte-title"],this.toBeCheckedSelector=this.parentElementSelectors.join(",")}filterAnnotations(t){return t}canFilter(t){return G.isTextNode(t.dtoName)&&this.parentBlockIsHeadingOrTitle(t)}canRefill(t,e){return G.isTextNode(t)&&"SPAN"===e.nodeName&&this.isHeadingOrTitleChild(e)}toCssText(){return`${this.parentElementSelectors.map((t=>`.${ue.RTE_CONTENT_CONTAINER_CLASS_NAME} ${t}`)).join(",")} { ${this.convertStylesMapToCssText()} }`}parentBlockIsHeadingOrTitle(t){const e=t.parent;return!!e&&this.parentBlockTypes.includes(e.type)}isHeadingOrTitleChild(t){let e=t.parentElement;for(;e;){if(e.matches(this.toBeCheckedSelector))return!0;if(ue.NON_HEADING_TITLE_ELEMENT_TAGS.includes(e.tagName))return!1;e=e.parentElement}return!1}}ue.BOLD_STYLES={fontWeight:"700"},ue.NON_HEADING_TITLE_ELEMENT_TAGS=["TD","TH","TR","TABLE","THEAD","TBODY","DIV","BODY"];class de extends ce{constructor(t){super(t),this.classNameToBeAdded=`v-rte-h${t}`,this.elementTagName="li"}canFilter(t){return G.isListItemBlock(t.dtoName)&&this.isBlockOrNodeStylesMatchFilterStyles(t,["fontSize","lineHeight"])}canRefill(t,e){return G.isListItemBlock(t)&&e.matches(this.elementTagName)&&e.classList.contains(this.classNameToBeAdded)}}class we extends he{constructor(t){super(t),this.classNameToBeAdded=`v-rte-${t}`,this.elementTagName="li"}canFilter(t){return G.isListItemBlock(t.dtoName)&&this.isBlockOrNodeStylesMatchFilterStyles(t,["fontSize","lineHeight"])}canRefill(t,e){return G.isListItemBlock(t)&&e.matches(this.elementTagName)&&e.classList.contains(this.classNameToBeAdded)}}Y.registerRTEDTOClass("paragraph",g),Y.registerRTEDTOClass("title",g),Y.registerRTEDTOClass("subtitle",g),Y.registerRTEDTOClass("heading-1",g),Y.registerRTEDTOClass("heading-2",g),Y.registerRTEDTOClass("heading-3",g),Y.registerRTEDTOClass("heading-4",g),Y.registerRTEDTOClass("heading-5",g),Y.registerRTEDTOClass("heading-6",g),Y.registerRTEDTOClass("heading-6",g),Y.registerRTEDTOClass("list-item",B),Y.registerRTEDTOClass("bullet-list",N),Y.registerRTEDTOClass("number-list",N),Y.registerRTEDTOClass("image",Ot),Y.registerRTEDTOClass("code-block",e),Y.registerRTEDTOClass("html-block",U),Y.registerRTEDTOClass("text",T),Y.registerRTEDTOClass("image",xt),Nt.registerBlockBasicStrategies(g.name),Nt.registerBlockBasicStrategies(N.name),Nt.registerBlockBasicStrategies(B.name),Nt.registerBlockBasicStrategies(Ot.name),Nt.registerBlockBasicStrategies(U.name),wt.registerElementToBlockStrategy(new class extends se{canHandle(t,e,n){let s=0;for(let r=e;r<t.length&&this.isInlineCandidate(t[r],n);r++)s++;return s}handle(t,e){const n=t[0].parentElement,s=e&&e.autoMatchFormat,r=this.generateChildNodes(t,s?ne.generate(T,n,Object.assign(Object.assign({},e),{skipCustomAnnotations:!0})):{},e),i=s?super.matchTextBlockType(n):this.matchTextBlockTypeByTagName(n),o=!s&&!i;return g.from(Object.assign({id:tt(),type:i||"paragraph",nodes:r},o?{annotations:{internalWrapper:o}}:{annotations:ne.generate(g,n,e)}),e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}matchTextBlockTypeByTagName(t){switch(t.nodeName){case"P":return"paragraph";default:return null}}isInlineCandidate(t,e){return t.nodeType===Node.TEXT_NODE||!!Zt.has(t.nodeName)||!this.isDedicatedBlockTag(t.nodeName)&&(!(!1!==e.autoMatchFormat||!te(t))||this.isInlineLeafOrWrapper(t))}isDedicatedBlockTag(t){return Qt.has(t)&&!Zt.has(t)}isInlineLeafOrWrapper(t){return 0===t.childNodes.length?qt.has(t.nodeName):this.isTextOnlyElement(t)?qt.has(t.nodeName)||Zt.has(t.nodeName):this.hasOnlyInlineDescendants(t)}isTextOnlyElement(t){const e=Array.from(t.childNodes);return!e.some((t=>t.nodeType===Node.ELEMENT_NODE))&&e.some((t=>t.nodeType===Node.TEXT_NODE))}hasOnlyInlineDescendants(t){for(let e=0;e<t.children.length;e++){const n=t.children[e];if(this.isDedicatedBlockTag(n.nodeName))return!1;if(!n.hasChildNodes())return!1;if(!this.hasOnlyInlineDescendants(n))return!1}return!0}}),wt.registerElementToBlockStrategy(new class extends ie{canHandle(t,e){const n=t[e];return n.nodeType===Node.ELEMENT_NODE&&""===n.textContent&&n.querySelector("img")?1:0}handle(t,e){const n=t[0].querySelector("img");return this.createRTEImageBlock(n,e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),wt.registerElementToBlockStrategy(new class extends ie{canHandle(t,e){return"VEGA-RICH-TEXT-IMAGE-EDITOR"===t[e].tagName?1:0}handle(t,e){const n=t[0],s=n.querySelector("img");if(et(s))return Ot.from({id:tt(),type:"image",nodes:[{id:tt(),type:"image",url:s.src,annotations:ne.generate(xt,n,e)}],annotations:ne.generate(Ot,n.parentElement,e)},e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),wt.registerElementToBlockStrategy(new class extends ie{canHandle(t,e){return"IMG"===t[e].tagName?1:0}handle(t,e){return this.createRTEImageBlock(t[0],e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),wt.registerElementToBlockStrategy(new class extends se{canHandle(t,e){return["heading-1","heading-2","heading-3","heading-4","heading-5","heading-6","title","subtitle"].includes(super.matchTextBlockType(t[e]))?1:0}handle(t,e){const n=this.generateChildNodes(Array.from(t[0].childNodes),{},e);return 0===n.length?null:g.from({id:tt(),type:super.matchTextBlockType(t[0]),nodes:n,annotations:ne.generate(g,t[0],e)},e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),wt.registerElementToBlockStrategy(new class extends se{canHandle(t,e){if(!["UL","OL"].includes(t[e].parentElement.nodeName)&&t.some((t=>"LI"===t.nodeName))){let n=0;for(let s=e;s<t.length&&"LI"===t[s].nodeName;s++)n++;return n}return"LI"===t[e].tagName?1:0}handle(t,e){const n=t[0];return["UL","OL"].includes(n.parentElement.nodeName)?B.from(this.generateListItemBlockDTO(n,e),e):this.generateWithListBlock(t,e)}appendChildBlocks(t,e){t.nestList=e.filter((t=>["bullet-list","number-list"].includes(t.type))),t.nestList.forEach((e=>e.parent=t))}shouldProceedToElementChildren(){return!0}generateWithListBlock(t,e){return N.from({id:tt(),type:"bullet-list",blocks:t.map((t=>this.generateListItemBlockDTO(t,e)))},e)}generateListItemBlockDTO(t,e){return{id:tt(),type:"list-item",annotations:ne.generate(B,t,e),nodes:this.generateChildNodes(Array.from(t.childNodes.length?t.childNodes:[t]).filter((t=>!["UL","OL"].includes(t.nodeName))),ne.generate(T,t,Object.assign(Object.assign({},e),{skipCustomAnnotations:!0})),e)}}}),wt.registerElementToBlockStrategy(new class extends se{canHandle(t,e){const n=t[e],s=n.parentElement,r="LI"!==n.nodeName,i=n.nodeType===Node.TEXT_NODE&&""===n.textContent.trim(),o=et(s)&&["UL","OL"].includes(s.nodeName);return r&&!i&&o?1:0}handle(t,e){const n=this.generateChildNodes(t,{},e);return B.from({id:tt(),type:"list-item",nodes:n,annotations:{}},e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),wt.registerElementToBlockStrategy(new class extends se{canHandle(t,e){return"OL"===t[e].tagName?1:0}handle(t,e){return 0===t[0].childNodes.length?null:N.from({id:tt(),type:"number-list",blocks:[],annotations:ne.generate(N,t[0],e)},e)}appendChildBlocks(t,e){t.children=e.filter((t=>t instanceof B)),e.forEach((e=>e.parent=t))}shouldProceedToElementChildren(){return!0}}),wt.registerElementToBlockStrategy(new class extends se{canHandle(t,e){return"UL"===t[e].tagName?1:0}handle(t,e){return 0===t[0].childNodes.length?null:N.from({id:tt(),type:"bullet-list",blocks:[],annotations:ne.generate(N,t[0],e)},e)}appendChildBlocks(t,e){t.children=e.filter((t=>t instanceof B)),e.forEach((e=>e.parent=t))}shouldProceedToElementChildren(){return!0}}),wt.registerElementToBlockStrategy(new class extends se{canHandle(t,e,n){const s=t[e];return s.nodeType===Node.TEXT_NODE||this.isInlineTagWithoutBlockChildren(s,n)||Qt.has(s.nodeName)&&!this.shouldFallBackToHtmlBlock(s)||n.autoMatchFormat||!this.isCustomHtmlContainer(s)||Vt.isTitleOrSubtitle(s)?0:1}handle(t,e){return U.from(this.generateHtmlBlock(t[0],e),e)}appendChildBlocks(t,e){t.children=e.map((e=>(e.parent=t,e)))}shouldProceedToElementChildren(){return!0}isInlineTagWithoutBlockChildren(t,e){if(Zt.has(t.nodeName)&&0===t.childNodes.length)return!0;if(te(t))return!(0===t.childNodes.length&&""===t.textContent&&!Zt.has(t.nodeName)&&!qt.has(t.nodeName));const n=Array.from(t.childNodes);return!(n.some((t=>t.nodeType===Node.ELEMENT_NODE))||!n.some((t=>t.nodeType===Node.TEXT_NODE)))&&(!1!==e.autoMatchFormat||!_t.has(t.parentElement.nodeName)&&(qt.has(t.nodeName)||Zt.has(t.nodeName)))}shouldFallBackToHtmlBlock(t){const e=Array.from(t.childNodes);if(0===e.length)return!1;const n=t.parentElement.nodeName;return"UL"!==n&&"OL"!==n&&e.every((t=>t.nodeType===Node.ELEMENT_NODE&&""===t.textContent&&!Zt.has(t.nodeName)&&!qt.has(t.nodeName)))}isCustomHtmlContainer(t){return"DIV"!==t.nodeName||t.childNodes.length>0&&"IMG"!==t.childNodes[0].nodeName}generateHtmlBlock(t,e){return{id:tt(),type:"html-block",htmlTag:t.nodeName.toLowerCase(),annotations:ne.generate(U,t,e),children:[]}}}),
1
+ import{d as t,p as e,g as n,k as s,s as r,v as i,N as o,o as a,w as l,x as c,A as h,j as u,i as d,y as w,I as p,e as f,M as m,b as g,R as T,S as x,a as b,z as O,D as y,H as E,E as k,F as A,U as C,G as H,J as v,q as B,K as j,L as N,O as I,P as S,Q as R,T as L,W as D,X as $,Y as P,Z as M,u as F,_ as z,$ as U,n as V,a0 as G,a1 as W,a2 as J,a3 as K,m as Y,a4 as X,a5 as Q,r as Z,a6 as _,a7 as q}from"./p-2bb60f89.js";import{g as tt}from"./p-8b5d3a52.js";import{i as et}from"./p-456f678b.js";import{C as nt}from"./p-2d0d575f.js";import{d as st}from"./p-526e3634.js";import{c as rt,d as it,e as ot}from"./p-3a68b729.js";import{r as at,i as lt}from"./p-528748fa.js";import{c as ct}from"./p-a841cf13.js";import{L as ht}from"./p-6e1ab235.js";class ut{}class dt{constructor(t,e){this.childrenOutput=[],this.currentStrategy=t,this.currentElements=e}setChildrenOutput(t){this.childrenOutput=t}toDto(t={autoMatchFormat:!0,skipCustomAnnotations:!0}){const e=this.currentStrategy.handle(this.currentElements,t);return this.childrenOutput.length>0&&e&&this.currentStrategy.appendChildBlocks(e,this.childrenOutput.map((e=>e.toDto(t))).filter(et)),e}}const wt=new class{constructor(){this.elementToBlockStrategies=[],this.elementToNodeStrategies=[]}registerElementToBlockStrategy(t){this.hasDuplicateStrategy(t,this.elementToBlockStrategies)||this.elementToBlockStrategies.unshift(t)}registerElementToNodeStrategy(t){this.hasDuplicateStrategy(t,this.elementToNodeStrategies)||this.elementToNodeStrategies.unshift(t)}getElementToBlockStrategies(){return this.elementToBlockStrategies}getElementToNodeStrategies(){return this.elementToNodeStrategies}hasDuplicateStrategy(t,e){return e.includes(t)}},pt=new class{process(t,e={autoMatchFormat:!0,skipCustomAnnotations:!0}){const n=this.getElementToBlockStrategies(),s=[];for(let r=0;r<t.length;r++){if(this.isInvalidElement(t[r],e))continue;let i=0;for(const o of n)if(i=o.canHandle(t,r,e),i>0){const n=t.slice(r,r+i),a=new dt(o,n);1===i&&o.shouldProceedToElementChildren()&&a.setChildrenOutput(this.process(Array.from(n[0].childNodes),e)),s.push(a),r+=i-1;break}if(0===i&&r<t.length){const n=Array.from(t[r].childNodes),i=this.process(Array.from(n),e);i.length>0&&s.push(...i)}}return s}isInvalidElement(t,e){return t.nodeType===Node.COMMENT_NODE||!1!==e.autoMatchFormat&&["META","STYLE"].includes(t.nodeName)}getElementToBlockStrategies(){return wt.getElementToBlockStrategies()}};class ft extends t{handleAction(t,e){const n=t.entityToBeAppended;e.children&&(n.forEach((t=>{t.parent=e})),e.children=e.children.concat(n))}}class mt extends t{handleAction(t,e){this.replaceElementWithElements(e,t.referChildren,[...t.childrenToBeInserted,t.referChildren])}replaceElementWithElements(t,e,n){t.children&&(n.forEach((e=>{e.parent=t})),t.children=t.children.flatMap((t=>t===e?n:t)))}}class gt extends mt{handleAction(t,e){this.replaceElementWithElements(e,t.referChildren,[t.referChildren,...t.childrenToBeInserted])}}class Tt extends i{constructor(t,e){super(),this.type=o.IMAGE,this.size=t,this.alt=e}static from(t,e){return[o.IMAGE,new Tt(t,e)]}static getDefaultStyles(){return{verticalAlign:"bottom"}}toJSON(){return et(this.alt)?{size:this.size,alt:this.alt}:{size:this.size}}clone(){return new Tt(this.size,this.alt)}renderClass(t){return(null==t?void 0:t.standalone)?null:this.size?`v-rte--image-size-${this.size}`:null}renderStyle(t){if(!(null==t?void 0:t.standalone))return null;const e=Tt.getDefaultStyles();switch(this.size){case"sm":return Object.assign(Object.assign({},e),{width:"25%"});case"md":return Object.assign(Object.assign({},e),{width:"50%"});case"lg":return Object.assign(Object.assign({},e),{width:"100%"})}}}Tt.BASE_STYLES={verticalAlign:"bottom"};class xt extends a{constructor(t,e,n,s){super(t,s),this.dtoName=xt.dtoName,this.type=l.IMAGE,this.url=e,this.parent=n}static from(t,e,n={autoMatchFormat:!0}){const s=new xt(t.id,t.url,e),r=!!n.autoMatchFormat,i=Object.assign({},t.annotations),{size:o}=i,a=function(t,e){var n={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(n[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(t);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(t,s[r])&&(n[s[r]]=t[s[r]])}return n}(i,["size"]),l=Object.assign(Object.assign({},a),{size:null!=o?o:r?"md":void 0});return s.annotationMap=new Map(Object.keys(l).map((t=>"size"===t||"alt"===t?Tt.from(l.size,l.alt):this.createAnnotationEntity(t,l[t]))).filter(et)),s}toJSON(){const t=Array.from(this.annotationMap.values()).filter((t=>t instanceof Tt||t instanceof c)).reduce(((t,e)=>Object.assign(Object.assign({},t),e.toJSON())),{});return""==t.alt&&delete t.alt,Object.assign(Object.assign({id:this.id},Object.keys(t).length>0?{annotations:t}:{}),{type:"image",url:this.url})}clone(t){return new xt(this.id,this.url,t,super.cloneAnnotations())}toHtml(t){const e=this.getAnnotationByType(o.IMAGE);return`<img${super.generateAttributeString(t,...[e&&e.alt?`alt="${e.alt}"`:null,`src="${this.url}"`,e&&e.size?`data-size="${e.size}"`:null].filter(et))}>`}doAnnotationActionApply(t){const e=h.get(u.name,xt.name);e&&e.execute(t,this)}doModifyActionApply(t){h.executeTheStrategy(t,this)}}h.register(d.UPDATE_IMAGE_NODE_URL,xt.name,new class extends t{handleAction(t,e){e.url=t.url}}),h.register(u.name,xt.name,new class extends t{handleAction(t,e){const n=t.toAnnotation();e.annotationMap.set(n.type,n)}}),xt.dtoName="RTEImageNode";class bt extends m{constructor(t,e){super(),this.type=d.INSERT_NEW_PARAGRAPH,this.startContainerNode=t,this.startOffset=e}}class Ot extends b{constructor(t){super(t),this.dtoName=Ot.dtoName,this.type="image",this.children=[]}static from(t,e={autoMatchFormat:!0}){const n=new Ot(t.id),{annotations:s}=t;return n.children=t.nodes.map((t=>xt.from(t,n,e))),s&&super.convertAnnotationsToMap(n.annotationMap,s),n}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{type:"image",nodes:this.children.map((t=>t.toJSON()))})}toHtml(t){const e=super.generateAttributeString(t),n=this.children.map((e=>e.toHtml(t))).join("");return super.shouldRenderAsInternalWrapper()?n:[`<div${e}>`,n,"</div>"].join("")}isNotEmpty(){return this.children.length>0&&this.children.some((t=>t.url.length>0))}getLastNode(){return this.children[this.children.length-1]}createNewImageBlock(){return new Ot(tt())}clone(t){const e=new Ot(this.id);return e.children=this.children.map((t=>t.clone(e))),e.annotationMap=super.cloneAnnotations(),e.parent=t,e}}h.register(d.MERGE_TWO_BLOCKS_NODES,Ot.name,new O),h.register(d.REPLACE_CHILD_NODES,Ot.name,new y),h.register(d.SPLIT_BLOCK_WITH_NODE,Ot.name,new class extends t{handleAction(t,e){t.newBlock=this.splitImageNodes(t.splitPointNode,t.startOffsetOfNode,e)}splitImageNodes(t,e,n){const s=n.children.indexOf(t);if(s>-1){const t=n.children.slice(0,s+e),r=n.children.slice(s+e);n.apply(new w(t));const i=this.cloneWithNodes(r,n);return n.parent.apply(new p(n,i)),i}}cloneWithNodes(t,e){const n=e.createNewImageBlock();return n.children=[],n.apply(new f(t)),n}}),h.register(d.LINE_BREAK_SINGLE_BLOCK,Ot.name,new class extends t{handleAction(t,e){const n=new bt(t.startContainerNode,t.startOffset);e.apply(n);const s=n.newBlock;s&&(t.lineBreakNode=s.children[0])}}),h.register(d.LINE_BREAK_MULTIPLE_BLOCKS,Ot.name,new class extends t{handleAction(t,e){t.lineBreakNode=this.lineBreakMultipleBlocks(t.selectedBlocks,e)}lineBreakMultipleBlocks(t,e){const n=g.from({id:tt(),type:"paragraph",nodes:[{id:tt(),type:"text",text:"\n"}]});e.parent.apply(new p(e,n));const s=this.concatBlocksNodes(t.slice(1));return(0===s.length||s[0]&&""===s[0].text)&&s.push(new T(tt(),"\n",n)),n.apply(new f(s)),n.children[0]}concatBlocksNodes(t){const e=[];return t.map((t=>{"image"!==t.type&&(e.push(...t.children),t.parent.apply(new s(t)))})),e}}),h.register(d.INSERT_IMAGE_TO_BLOCK,Ot.name,new class extends t{handleAction(t,e){const s=t.splitPointNode,r=t.startOffsetOfNode,i=t.imageBlockToBeInserted;e.children.length<1?e.apply(new f(i.children)):this.isCaretPositionAtBlockEnd(e,s,r)?e.parent.apply(new p(e,i)):this.isCaretPositionAtBlockStart(e,s,r)?e.parent.apply(new n(e,i)):(e.apply(new x(s,r)),e.parent.apply(new p(e,i)))}}),h.register(E.name,Ot.name,new k),Ot.dtoName="RTEImageBlock";class yt extends m{constructor(t){super(),this.type=d.MERGE_TWO_BLOCKS_NODES,this.blockNeedToBeMerged=t}}class Et extends A{handleAction(t,e){const{startContainerNode:n}=t;n.isContentEditable()?n.isTextNode()&&this.deleteTextNodeContent(t,e):this.deleteDecoratorNodeContent(t,e);const r=e.parent;r&&e.isListItemBlock()&&0===r.children.length&&r.parent.apply(new s(r))}deleteTextNodeContent(t,e){const n=t.startContainerNode,r=t.startOffset;if(0!==r&&!n.isEmpty()){const i=n.text.slice(0,r-1)+n.text.slice(r);if(n.apply(new C(i)),i)return void(t.previousNode=n);{const r=e.children.indexOf(n),i=e.children[r+1],o=this.getPreviousNode(n);return o&&o.parent===e&&"\n"===o.text||1===e.children.length?void(t.previousNode=n):(e.apply(new s(n)),void(i&&(null==o?void 0:o.parent)!==e?t.nextNode=i:t.previousNode=o))}}{let r=this.getPreviousNode(n),i=null;const o=n.isEmpty();if(e.children.length&&r&&r.parent!==e)o&&e.apply(new s(n)),e.type===r.parent.type&&r.parent.apply(new yt(e));else if(this.isContentFirstNode(n)&&o&&(i=this.getNextNode(n)),o&&e.apply(new s(n)),r&&r.isTextNode()&&(r.isEmpty()||!r.isContentEditable()&&r.parent===e)){const t=r;r=this.getPreviousNode(r),t.parent.apply(new s(t)),r||o||(i=n)}0===e.children.length&&e.parent.apply(new s(e)),r?t.previousNode=r:i&&(t.nextNode=i)}}deleteDecoratorNodeContent(t,e){const n=t.startContainerNode,r=t.startOffset;let i=this.getPreviousNode(n),o=null;if(0!==r){const t=e;this.isContentFirstNode(n)&&(o=this.getNextNode(n)),1===t.children.length?t.parent.apply(new s(t)):t.apply(new s(n))}else{const r=i;r&&!r.isContentEditable()&&r.parent===e?(i=this.getPreviousNode(r),r.parent.apply(new s(r)),i||(t.nextNode=n)):i&&i.parent!==e&&e.type===i.parent.type&&i.parent.apply(new yt(e))}i?t.previousNode=i:o&&(t.nextNode=o)}}class kt extends t{handleAction(t,e){const{startContainerNode:n}=t;t.newBlock=this.breakSingleBlock(n,t.startOffset,e)}breakSingleBlock(t,e,s){const r=this.getNewParagraph(t);if(r){if(this.isCaretPositionAtBlockEnd(s,t,e))s.parent.apply(new p(s,r));else{if(!this.isCaretPositionAtBlockStart(s,t,e)){const n=new x(t,e);return s.apply(n),n.newBlock}s.parent.apply(new n(s,r))}return r}}getNewParagraph(t){const e=this.createNewParagraph("");if(e){let n=e.children[0];return t.isTextNode()&&t.isContentEditable()&&(e.children=[],n=t.cloneWithText(""),n.annotationMap.delete(o.LINK),e.apply(new f([n]))),e}}}class At extends m{constructor(t,e,n=!1){super(),this.isFlushable=!0,this.type=d.UPDATE_CURSOR_POSITION,this.immediatelyRun=!1,this.nextFocusNode=t,this.offset=e,this.immediatelyRun=n,this.immediatelyRun&&(this.isFlushable=!1)}}class Ct extends t{handleAction(t,e){const{rteRange:r,nodeToBeInserted:i}=t,{startNode:o,startOffset:a}=r;if(o){const t=e;if(o.isContentEditable()&&o.isTextNode())if("\n"!==o.text&&o.text&&0!==a){const e=o.text.substring(0,a),r=o.text.substring(a),l=o.cloneWithText(e),c=o.cloneWithText(r),h=[l,i];r&&h.push(c),t.apply(new n(o,...h)),t.apply(new s(o))}else t.apply(new n(o,i));else t.apply(0!==a?new p(o,i):new n(o,i));this.updateCursorPosition(i)}}updateCursorPosition(t){const e=this.getRootContent(t.parent);e&&e.apply(new At(t))}}class Ht extends t{handleAction(t,e){const{text:s,offset:r,decoratorNode:i}=t,o=this.createNewParagraph(s);if(o){const t=o.children[0];e.apply(0!==r?new p(i,t):new n(i,t)),this.setTheCursorPosition(t)}}setTheCursorPosition(t){const e=this.getRootContent(t.parent);e&&e.apply(new At(t))}}class vt extends t{handleAction(t,e){t.newBlock=this.breakSingleListItemBlock(t.startContainerNode,t.startOffset,e)}breakSingleListItemBlock(t,e,s){const r=s.createNewListItem(),i=this.copyInlineStyleToNewNode(t);if(r.apply(new f([i])),this.isCaretPositionAtBlockEnd(s,t,e))return this.breakListItemAtEnd(r,s);if(!this.isCaretPositionAtBlockStart(s,t,e)){const n=new x(t,e);return s.apply(n),n.newBlock}return s.parent.apply(new n(s,r)),r}breakListItemAtEnd(t,e){const n=e.parent.children[e.parent.children.length-1],r=1===e.children.length&&e.children[0].isEmpty();if(e===n&&r){const n=e.parent.parent;if("list-item"!==n.type){const r=g.from({id:tt(),type:"paragraph",nodes:[]});return r.apply(new f(t.children)),n.apply(new p(e.parent,r)),e.parent.apply(new s(e)),r}n.parent.apply(new p(n,t)),e.parent.apply(new s(e))}else e.parent.apply(new p(e,t));return t}copyInlineStyleToNewNode(t){const e=t.cloneWithText("");return e.annotationMap.delete(o.LINK),e}}class Bt extends H{handleAction(t,e){var n,r;const i=t.entityToBeRemoved instanceof B?t.entityToBeRemoved:null,o=i?e.children.indexOf(i):-1;(null===(n=null==i?void 0:i.nestList)||void 0===n?void 0:n.length)&&o>=0&&this.promoteNestListsToUpperLevel(i,e,o),super.handleAction(t,e);const a=e.parent;if(0===e.children.length&&a)if("list-item"===a.type){const t=a;(null===(r=t.nestList)||void 0===r?void 0:r.includes(e))&&t.apply(new v(e))}else a.apply(new s(e))}promoteNestListsToUpperLevel(t,e,s){var r,i;const o=[...null!==(r=t.nestList)&&void 0!==r?r:[]];let a=s+1;const l=[];o.forEach((t=>{if(t.type===e.type){const n=[...t.children];n.length>0&&(n.forEach((t=>{t.parent=e})),e.children.splice(a,0,...n),a+=n.length)}else l.push(t)}));const c=e.parent;if(l.length>0&&c instanceof B){const t=[...null!==(i=c.nestList)&&void 0!==i?i:[]],n=t.indexOf(e);n>=0?t.splice(0===s?n:n+1,0,...l):t.push(...l),c.apply(new j(t))}else l.length>0&&c.apply(0===s?new n(e,...l):new p(e,...l));t.apply(new j([]))}}class jt extends t{handleAction(t,e){if(e.parent){const{blocksToBeInserted:s,startNode:r,startOffset:i}=t;let o=e;const a=s[0],l=1===s.length&&r instanceof T&&!["RTEListBlock","RTEHtmlBlock"].includes(a.constructor.name)&&a.children.length>0&&a.children.every((t=>{var e,n;return!0===(null===(n=(e=t).isTextNode)||void 0===n?void 0:n.call(e))}));if(r===e.children[0]&&0===i)e.parent.apply(new n(e,...s));else{if(l)return void this.inlineMergeSingleBlock(t,e);{const n=new x(r,i);e.apply(n),e.parent.apply(new p(e,...s)),o=s[s.length-1],t.futureFocusAtEnd=!0}}t.futureFocusBlock=o}}inlineMergeSingleBlock(t,e){const{blocksToBeInserted:n,startNode:s,startOffset:r}=t,i=n[0],o=i.children,a=s,l=e.children.indexOf(a);if(-1===l){const o=new x(s,r);return e.apply(o),e.parent.apply(new p(e,...n)),t.futureFocusBlock=i,void(t.futureFocusAtEnd=!0)}const c=a.text.slice(0,r),h=a.text.slice(r),u=e.children.slice(0,l),d=e.children.slice(l+1);c&&u.push(a.cloneWithText(c)),h&&d.unshift(a.cloneWithText(h)),e.apply(new w([...u,...o,...d]));const f=o[o.length-1];t.futureFocusBlock=e,t.futureFocusNode=f,f.isTextNode()&&(t.futureFocusNodeOffset=f.text.length)}}const Nt=new class{registerBlockBasicStrategies(t){h.register(d.DELETE_CHILDREN,t,t===N.name?new Bt:new H),h.register(d.APPEND_CHILDREN,t,new ft),h.register(d.INSERT_CHILDREN_BEFORE,t,new mt),h.register(d.INSERT_CHILDREN_AFTER,t,new gt),h.register(d.DELETE_BLOCK_CONTENT,t,new Et),h.register(d.INSERT_NEW_PARAGRAPH,t,t===B.name?new vt:new kt),h.register(d.INSERT_TEXT_TO_DECORATOR_NODE,t,new Ht),h.register(d.INSERT_NODE_TO_NEAREST_ROOT,t,new Ct),h.register(d.PASTE_CONTENT,t,new jt)}};class It{}class St extends It{canHandle(t){return"RTETextNode"===t.dtoName}handle(t,e={}){return this.isBold(t)||e.bold?{bold:!0}:{}}isBold(t){return"STRONG"===t.nodeName||"B"===t.nodeName||t.style.fontWeight===I||t.style.fontWeight===S||t.classList.contains("v-rte--bold")}}class Rt extends It{canHandle(t,e){return!e.skipCustomAnnotations&&!!t}handle(t){const e=this.getAttributes(t);return Object.keys(e).length>0?{customAttribute:e}:{}}getAttributes(t){return t.getAttributeNames().filter((t=>"style"!==t&&"class"!==t&&this.isValidAttr(t))).reduce(((e,n)=>(e[n]=t.getAttribute(n),e)),{})}isValidAttr(t){return/^[a-zA-Z_][\w-]*$/.test(t)}}class Lt extends It{canHandle(t,e){return!e.skipCustomAnnotations&&!!t}handle(t){const e=this.getCustomClass(t);return e.length>0?{customClass:e}:{}}getCustomClass(t){return t.classList.toString().split(" ").filter((t=>!t.includes("v-rte")&&""!==t))}}class Dt extends It{canHandle(t,e){return!e.skipCustomAnnotations&&!!t}handle(t){const e=R(t);return Object.keys(e).length>0?{customStyle:e}:{}}}class $t extends It{canHandle(t){return["RTETextBlock","RTEListItemBlock","RTEListBlock"].includes(t.dtoName)}handle(t){const e=this.getIndent(t);return e?{indent:e}:{}}getIndent(t){const e=t.style;let n;if(e.marginLeft)n=e.marginLeft;else{if(!e.margin)return null;{const t=e.margin.split(" ");switch(t.length){case 4:n=t[3];break;case 2:case 3:n=t[1];break;default:n=t[0]}}}const s=Number(n.replace("px",""));return s&&s>=0?Math.floor(s/16):null}}class Pt extends It{canHandle(t){return["RTETextBlock","RTEListItemBlock","RTEListBlock"].includes(t.dtoName)}handle(t){const e=this.getTextAlign(t);return e?{textAlign:e}:{}}getTextAlign(t){const e=t.classList;if(e.contains("v-rte--horizontal-alignment-left"))return"left";if(e.contains("v-rte--horizontal-alignment-center"))return"center";if(e.contains("v-rte--horizontal-alignment-right"))return"right";if(e.contains("v-rte--horizontal-alignment-justify"))return"justify";switch(t.style.textAlign){case"center":return"center";case"right":return"right";case"justify":return"justify";case"left":return"left";default:return null}}}class Mt extends It{canHandle(t){return"RTETextNode"===t.dtoName}handle(t,e={}){return this.isCode(t)||e.code?{code:!0}:{}}isCode(t){return t.classList.contains("v-rte--code")||"CODE"===t.nodeName||"PRE"===t.nodeName||"monospace"===t.style.fontFamily||"Roboto Mono"===t.style.fontFamily.replace(/["']/g,"")}}class Ft extends It{canHandle(t){return"RTETextNode"===t.dtoName}handle(t,e={}){const n=this.getColor(t)||e.textColor;return n?{textColor:n}:{}}getColor(t){var e;const n=null===(e=at(t.style.color))||void 0===e?void 0:e.toUpperCase();if(n){const t=L.filter((t=>t.key!==D.key)).find((t=>t.light===n||t.dark===n));return t?t.key:null}for(const e of L)if(t.style.color.includes(e.key))return e.key;return null}}class zt extends It{canHandle(t){return"RTETextNode"===t.dtoName}handle(t,e={}){return this.isItalic(t)||e.italic?{italic:!0}:{}}isItalic(t){return"I"===t.nodeName||t.style.fontStyle===$||"EM"===t.nodeName||t.classList.contains("v-rte--italic")}}class Ut extends It{canHandle(t,e){return!!e.autoMatchFormat&&"RTETextBlock"===t.dtoName}handle(t){const e=this.getTextStyle(t);return e?{textStyle:e}:{}}getTextStyle(t){const e=this.getElementTypeByDataType(t);if(e)return e;const n=this.getElementTypeByNodeName(t);if(n)return n;const s=this.getElementTypeByFontSize(t);if(s)return s;return this.getElementTypeByClassName(t)||null}getElementTypeByDataType(t){return t.nodeType!==Node.TEXT_NODE&&t.hasAttribute("data-type")?t.getAttribute("data-type"):null}getElementTypeByFontSize(t){var e;switch(null===(e=t.style)||void 0===e?void 0:e.fontSize){case"36px":return"title";case"28px":return"subtitle";case"22px":return"heading-1";case"20px":return"heading-2";case"18px":return"heading-3";default:return null}}getElementTypeByNodeName(t){switch(t.nodeName){case"P":return"paragraph";case"H1":return"heading-1";case"H2":return"heading-2";case"H3":return"heading-3";case"H4":return"heading-4";case"H5":return"heading-5";case"H6":return"heading-6";default:return null}}getElementTypeByClassName(t){if(t.className){const e=/\bv-rte-(?:-text-style-)?(title|subtitle|heading-1|heading-2|heading-3|heading-4|heading-5|heading-6|paragraph)\b/.exec(t.className);if(e)return e[1]}return null}}class Vt{static isTitleOrSubtitle(t){if("DIV"===t.nodeName){const e=Vt.textStyleHandler.getTextStyle(t);return"title"===e||"subtitle"===e}return!1}static isLinkElement(t){return"A"===t.nodeName}}Vt.textStyleHandler=new Ut;class Gt extends It{constructor(){super(...arguments),this.handlers=[new Rt,new Lt,new Dt]}canHandle(t){return"RTETextNode"===t.dtoName}handle(t,e={}){return e.link?{link:e.link}:Vt.isLinkElement(t)?{link:this.generateLinkAnnotations(t)}:{}}generateLinkAnnotations(t){const e={href:t.getAttribute("href")||"",groupKey:tt()};return this.handlers.forEach((n=>{Object.assign(e,n.handle(t))})),e}}class Wt extends It{canHandle(t){return"RTETextNode"===t.dtoName}handle(t,e={}){return this.isStrikethrough(t)||e.strikethrough?{strikethrough:!0}:{}}isStrikethrough(t){return t.style.textDecoration.includes(P)||"S"===t.nodeName||"DEL"===t.nodeName||t.classList.contains("v-rte--strikethrough")}}class Jt extends It{canHandle(t){return"RTETextNode"===t.dtoName}handle(t,e={}){return this.isUnderline(t)||e.underline?{underline:!0}:{}}isUnderline(t){return t.style.textDecoration.includes(M)||"U"===t.nodeName||"INS"===t.nodeName||t.classList.contains("v-rte--underline")}}class Kt extends It{canHandle(t){return"RTEImageNode"===t.dtoName}handle(t){const e=this.getImageSize(t);return e?{size:e}:{}}getImageSize(t){return t.getAttribute("data-size")?t.getAttribute("data-size"):null}}class Yt extends It{canHandle(t){return"RTEImageNode"===t.dtoName}handle(t){return t.hasAttribute("alt")?{alt:t.getAttribute("alt")}:{}}}const Xt=new Set(["P","H1","H2","H3","H4","H5","H6","LI"]),Qt=new Set(["P","H1","H2","H3","H4","H5","H6","LI","UL","OL","IMG","CODE"]),Zt=new Set(["BR","VEGA-RICH-TEXT-LINK-EDITOR","CODE","A"]),_t=new Set(["TABLE","THEAD","TBODY","TFOOT","TR","DL"]),qt=new Set(["ABBR","B","BDI","BDO","CITE","DEL","DFN","EM","I","INS","KBD","MARK","METER","OUTPUT","PROGRESS","Q","S","SAMP","SMALL","SPAN","STRONG","SUB","SUP","TIME","U","VAR"]);function te(t){return Xt.has(t.parentElement.nodeName)}class ee extends It{constructor(){super(...arguments),this.customAttributeHandler=new Rt,this.customStyleAnnotationHandler=new Dt,this.customClassAnnotationHandler=new Lt}canHandle(t,e){return"RTETextNode"===t.dtoName&&!1===e.autoMatchFormat}handle(t,e){if(Qt.has(t.nodeName)&&!Zt.has(t.nodeName))return{};const n=this.generateInlineHtmlAnnotation(t,Object.assign({},e));return n?{inlineHtml:n}:{}}generateInlineHtmlAnnotation(t,e){let{inlineHtml:n}=e;const s=Array.from(t.childNodes).some((t=>t.nodeType===Node.ELEMENT_NODE));if(!T.supportsHtmlTag(t.nodeName.toLowerCase())||s){const e=Object.assign(Object.assign({htmlTag:t.nodeName.toLowerCase()},s?{groupId:tt()}:{}),{customAttribute:this.customAttributeHandler.handle(t).customAttribute,customStyle:this.customStyleAnnotationHandler.handle(t).customStyle,customClass:this.customClassAnnotationHandler.handle(t).customClass});n=n?this.appendToInlineHtmlChain(n,e,t.parentNode):e}return n?Object.assign({},n):null}appendToInlineHtmlChain(t,e,n){return t.child&&n&&t.child.htmlTag===n.nodeName.toLowerCase()?Object.assign(Object.assign({},t),{child:this.appendToInlineHtmlChain(t.child,e,n)}):Object.assign(Object.assign({},t),{child:e})}}const ne=new class{constructor(){this.handlers=[new Pt,new $t,new St,new zt,new Jt,new Wt,new Ft,new Gt,new Mt,new Kt,new Yt,new Rt,new Lt,new Dt,new Ut,new ee]}registerHandler(t){this.handlers.unshift(t)}generate(t,e,n={autoMatchFormat:!0}){n&&n.filterInlineStyles&&F.executeTheStrategyRefillAction(t.dtoName,e);const s=Vt.isLinkElement(e)&&"RTETextNode"===t.dtoName,r=this.handlers.filter((t=>!(!n.autoMatchFormat&&s)||t instanceof Gt)).filter((r=>e.nodeType!==Node.TEXT_NODE&&r.canHandle(t,{skipCustomAnnotations:n.skipCustomAnnotations||s,autoMatchFormat:n.autoMatchFormat}))).reduce(((t,s)=>{const r=s.handle(e,n.parentAnnotations);return Object.assign(Object.assign({},t),r)}),{});this.removeTextStyleDefaultsFromCustomStyle(r);const i=F.getStrategies(t.dtoName);for(const t of i)(n.autoMatchFormat||t.alwaysFilter)&&t.filterAnnotations(r);return r}removeTextStyleDefaultsFromCustomStyle(t){const e="textStyle"in t?t.textStyle:void 0,n=t.customStyle;if(!e||!n)return t;const s=z.getDefaultStyles(e);if(!s)return t;for(const t of Object.keys(s))n[t]===s[t]&&delete n[t];return 0===Object.keys(n).length&&delete t.customStyle,t}};class se extends ut{constructor(){super(...arguments),this.annotationHandler=new Ut}generateChildNodes(t,e,n){const s=[],r=!(!n||!1!==n.autoMatchFormat),i=Object.assign({},e);return t.forEach((t=>{const o=wt.getElementToNodeStrategies().find((e=>e.canHandle([t],0,n)>0));let a=null;if(o&&(a=o.handle([t],n,i)),a)s.push(a);else if(lt(t)&&t.childNodes.length>0){const o=ne.generate(T,t,Object.assign({parentAnnotations:r?{inlineHtml:i.inlineHtml,link:i.link,code:i.code}:e},n));s.push(...this.generateChildNodes(Array.from(t.childNodes),o,n))}})),s}matchTextBlockType(t){var e;return null!==(e=this.annotationHandler.handle(t).textStyle)&&void 0!==e?e:"paragraph"}}class re extends se{canHandle(t,e){return"PRE"!==t[e].tagName&&"CODE"!==t[e].tagName||!t[e].hasAttribute("data-language")?0:1}handle(t){const n=t[0];if(n){const t=n.textContent,s=n.dataset.language;return e.from({id:tt(),type:"code-block",content:t,language:s})}}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}class ie extends se{createRTEImageBlock(t,e){const n=!(e&&e.autoMatchFormat||!t.parentNode||"DIV"===t.parentNode.nodeName);return Ot.from({id:tt(),type:"image",nodes:[{id:tt(),type:"image",url:t.src,annotations:ne.generate(xt,t,e)}],annotations:Object.assign(Object.assign({},ne.generate(Ot,t.parentElement,e)),{internalWrapper:n})},e)}}class oe extends ut{shouldProceedToElementChildren(){return!1}appendChildBlocks(){}generateTextNode(t,e){return{id:tt(),type:"text",text:t,annotations:e}}}class ae extends V{constructor(){super(...arguments),this.stylesToBeFiltered={}}get alwaysFilter(){return!0}filterAnnotations(t){const{textAlign:e,customStyle:n}=t;return e&&n?(this.stylesToBeFiltered=J.getDefaultStyles(e),super.filterAnnotations(t)):t}}class le extends V{constructor(){super(...arguments),this.stylesToBeFiltered=z.getDefaultStyles("paragraph"),this.type="paragraph",this.elementTagName="p"}filterAnnotations(t){return t}canFilter(t){return G.isTextBlock(t.dtoName)&&t.type===this.type}canRefill(t,e){const n=this.classNameToBeAdded?`.${this.classNameToBeAdded}`:this.elementTagName;return G.isTextBlock(t)&&e.matches(n)}toCssText(){return this.buildCssTextForStyles(this.elementTagName,this.classNameToBeAdded)}}class ce extends le{constructor(t){super(),this.type="heading-1",this.elementTagName="h1",this.type=`heading-${t}`,this.elementTagName=`h${t}`,this.stylesToBeFiltered=z.getDefaultStyles(this.type)}}class he extends le{constructor(t){super(),this.type="title",this.elementTagName="div",this.classNameToBeAdded="v-rte-title",this.type=t,this.classNameToBeAdded=`v-rte-${t}`,this.stylesToBeFiltered=z.getDefaultStyles(this.type)}}class ue extends V{constructor(){super(...arguments),this.stylesToBeFiltered=ue.BOLD_STYLES,this.elementTagName="span",this.parentBlockTypes=["heading-1","heading-2","heading-3","heading-4","heading-5","heading-6","title"],this.parentElementSelectors=["h1","h2","h3","h4","h5","h6",".v-rte-title"],this.toBeCheckedSelector=this.parentElementSelectors.join(",")}filterAnnotations(t){return t}canFilter(t){return G.isTextNode(t.dtoName)&&this.parentBlockIsHeadingOrTitle(t)}canRefill(t,e){return G.isTextNode(t)&&"SPAN"===e.nodeName&&this.isHeadingOrTitleChild(e)}toCssText(){return`${this.parentElementSelectors.map((t=>`.${ue.RTE_CONTENT_CONTAINER_CLASS_NAME} ${t}`)).join(",")} { ${this.convertStylesMapToCssText()} }`}parentBlockIsHeadingOrTitle(t){const e=t.parent;return!!e&&this.parentBlockTypes.includes(e.type)}isHeadingOrTitleChild(t){let e=t.parentElement;for(;e;){if(e.matches(this.toBeCheckedSelector))return!0;if(ue.NON_HEADING_TITLE_ELEMENT_TAGS.includes(e.tagName))return!1;e=e.parentElement}return!1}}ue.BOLD_STYLES={fontWeight:"700"},ue.NON_HEADING_TITLE_ELEMENT_TAGS=["TD","TH","TR","TABLE","THEAD","TBODY","DIV","BODY"];class de extends ce{constructor(t){super(t),this.classNameToBeAdded=`v-rte-h${t}`,this.elementTagName="li"}canFilter(t){return G.isListItemBlock(t.dtoName)&&this.isBlockOrNodeStylesMatchFilterStyles(t,["fontSize","lineHeight"])}canRefill(t,e){return G.isListItemBlock(t)&&e.matches(this.elementTagName)&&e.classList.contains(this.classNameToBeAdded)}}class we extends he{constructor(t){super(t),this.classNameToBeAdded=`v-rte-${t}`,this.elementTagName="li"}canFilter(t){return G.isListItemBlock(t.dtoName)&&this.isBlockOrNodeStylesMatchFilterStyles(t,["fontSize","lineHeight"])}canRefill(t,e){return G.isListItemBlock(t)&&e.matches(this.elementTagName)&&e.classList.contains(this.classNameToBeAdded)}}Y.registerRTEDTOClass("paragraph",g),Y.registerRTEDTOClass("title",g),Y.registerRTEDTOClass("subtitle",g),Y.registerRTEDTOClass("heading-1",g),Y.registerRTEDTOClass("heading-2",g),Y.registerRTEDTOClass("heading-3",g),Y.registerRTEDTOClass("heading-4",g),Y.registerRTEDTOClass("heading-5",g),Y.registerRTEDTOClass("heading-6",g),Y.registerRTEDTOClass("heading-6",g),Y.registerRTEDTOClass("list-item",B),Y.registerRTEDTOClass("bullet-list",N),Y.registerRTEDTOClass("number-list",N),Y.registerRTEDTOClass("image",Ot),Y.registerRTEDTOClass("code-block",e),Y.registerRTEDTOClass("html-block",U),Y.registerRTEDTOClass("text",T),Y.registerRTEDTOClass("image",xt),Nt.registerBlockBasicStrategies(g.name),Nt.registerBlockBasicStrategies(N.name),Nt.registerBlockBasicStrategies(B.name),Nt.registerBlockBasicStrategies(Ot.name),Nt.registerBlockBasicStrategies(U.name),wt.registerElementToBlockStrategy(new class extends se{canHandle(t,e,n){let s=0;for(let r=e;r<t.length&&this.isInlineCandidate(t[r],n);r++)s++;return s}handle(t,e){const n=t[0].parentElement,s=e&&e.autoMatchFormat,r=this.generateChildNodes(t,s?ne.generate(T,n,Object.assign(Object.assign({},e),{skipCustomAnnotations:!0})):{},e),i=s?super.matchTextBlockType(n):this.matchTextBlockTypeByTagName(n),o=!s&&!i;return g.from(Object.assign({id:tt(),type:i||"paragraph",nodes:r},o?{annotations:{internalWrapper:o}}:{annotations:ne.generate(g,n,e)}),e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}matchTextBlockTypeByTagName(t){switch(t.nodeName){case"P":return"paragraph";default:return null}}isInlineCandidate(t,e){return t.nodeType===Node.TEXT_NODE||!!Zt.has(t.nodeName)||!this.isDedicatedBlockTag(t.nodeName)&&(!(!1!==e.autoMatchFormat||!te(t))||this.isInlineLeafOrWrapper(t))}isDedicatedBlockTag(t){return Qt.has(t)&&!Zt.has(t)}isInlineLeafOrWrapper(t){return 0===t.childNodes.length?qt.has(t.nodeName):this.isTextOnlyElement(t)?qt.has(t.nodeName)||Zt.has(t.nodeName):this.hasOnlyInlineDescendants(t)}isTextOnlyElement(t){const e=Array.from(t.childNodes);return!e.some((t=>t.nodeType===Node.ELEMENT_NODE))&&e.some((t=>t.nodeType===Node.TEXT_NODE))}hasOnlyInlineDescendants(t){for(let e=0;e<t.children.length;e++){const n=t.children[e];if(this.isDedicatedBlockTag(n.nodeName))return!1;if(!n.hasChildNodes())return!1;if(!this.hasOnlyInlineDescendants(n))return!1}return!0}}),wt.registerElementToBlockStrategy(new class extends ie{canHandle(t,e){const n=t[e];return n.nodeType===Node.ELEMENT_NODE&&""===n.textContent&&n.querySelector("img")?1:0}handle(t,e){const n=t[0].querySelector("img");return this.createRTEImageBlock(n,e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),wt.registerElementToBlockStrategy(new class extends ie{canHandle(t,e){return"VEGA-RICH-TEXT-IMAGE-EDITOR"===t[e].tagName?1:0}handle(t,e){const n=t[0],s=n.querySelector("img");if(et(s))return Ot.from({id:tt(),type:"image",nodes:[{id:tt(),type:"image",url:s.src,annotations:ne.generate(xt,n,e)}],annotations:ne.generate(Ot,n.parentElement,e)},e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),wt.registerElementToBlockStrategy(new class extends ie{canHandle(t,e){return"IMG"===t[e].tagName?1:0}handle(t,e){return this.createRTEImageBlock(t[0],e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),wt.registerElementToBlockStrategy(new class extends se{canHandle(t,e){return["heading-1","heading-2","heading-3","heading-4","heading-5","heading-6","title","subtitle"].includes(super.matchTextBlockType(t[e]))?1:0}handle(t,e){const n=this.generateChildNodes(Array.from(t[0].childNodes),{},e);return 0===n.length?null:g.from({id:tt(),type:super.matchTextBlockType(t[0]),nodes:n,annotations:ne.generate(g,t[0],e)},e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),wt.registerElementToBlockStrategy(new class extends se{canHandle(t,e){if(!["UL","OL"].includes(t[e].parentElement.nodeName)&&t.some((t=>"LI"===t.nodeName))){let n=0;for(let s=e;s<t.length&&"LI"===t[s].nodeName;s++)n++;return n}return"LI"===t[e].tagName?1:0}handle(t,e){const n=t[0];return["UL","OL"].includes(n.parentElement.nodeName)?B.from(this.generateListItemBlockDTO(n,e),e):this.generateWithListBlock(t,e)}appendChildBlocks(t,e){t.nestList=e.filter((t=>["bullet-list","number-list"].includes(t.type))),t.nestList.forEach((e=>e.parent=t))}shouldProceedToElementChildren(){return!0}generateWithListBlock(t,e){return N.from({id:tt(),type:"bullet-list",blocks:t.map((t=>this.generateListItemBlockDTO(t,e)))},e)}generateListItemBlockDTO(t,e){return{id:tt(),type:"list-item",annotations:ne.generate(B,t,e),nodes:this.generateChildNodes(Array.from(t.childNodes.length?t.childNodes:[t]).filter((t=>!["UL","OL"].includes(t.nodeName))),ne.generate(T,t,Object.assign(Object.assign({},e),{skipCustomAnnotations:!0})),e)}}}),wt.registerElementToBlockStrategy(new class extends se{canHandle(t,e){const n=t[e],s=n.parentElement,r="LI"!==n.nodeName,i=n.nodeType===Node.TEXT_NODE&&""===n.textContent.trim(),o=et(s)&&["UL","OL"].includes(s.nodeName);return r&&!i&&o?1:0}handle(t,e){const n=this.generateChildNodes(t,{},e);return B.from({id:tt(),type:"list-item",nodes:n,annotations:{}},e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),wt.registerElementToBlockStrategy(new class extends se{canHandle(t,e){return"OL"===t[e].tagName?1:0}handle(t,e){return 0===t[0].childNodes.length?null:N.from({id:tt(),type:"number-list",blocks:[],annotations:ne.generate(N,t[0],e)},e)}appendChildBlocks(t,e){t.children=e.filter((t=>t instanceof B)),e.forEach((e=>e.parent=t))}shouldProceedToElementChildren(){return!0}}),wt.registerElementToBlockStrategy(new class extends se{canHandle(t,e){return"UL"===t[e].tagName?1:0}handle(t,e){return 0===t[0].childNodes.length?null:N.from({id:tt(),type:"bullet-list",blocks:[],annotations:ne.generate(N,t[0],e)},e)}appendChildBlocks(t,e){t.children=e.filter((t=>t instanceof B)),e.forEach((e=>e.parent=t))}shouldProceedToElementChildren(){return!0}}),wt.registerElementToBlockStrategy(new class extends se{canHandle(t,e,n){const s=t[e];return s.nodeType===Node.TEXT_NODE||this.isInlineTagWithoutBlockChildren(s,n)||Qt.has(s.nodeName)&&!this.shouldFallBackToHtmlBlock(s)||n.autoMatchFormat||!this.isCustomHtmlContainer(s)||Vt.isTitleOrSubtitle(s)?0:1}handle(t,e){return U.from(this.generateHtmlBlock(t[0],e),e)}appendChildBlocks(t,e){t.children=e.map((e=>(e.parent=t,e)))}shouldProceedToElementChildren(){return!0}isInlineTagWithoutBlockChildren(t,e){if(Zt.has(t.nodeName)&&0===t.childNodes.length)return!0;if(te(t))return!(0===t.childNodes.length&&""===t.textContent&&!Zt.has(t.nodeName)&&!qt.has(t.nodeName));const n=Array.from(t.childNodes);return!(n.some((t=>t.nodeType===Node.ELEMENT_NODE))||!n.some((t=>t.nodeType===Node.TEXT_NODE)))&&(!1!==e.autoMatchFormat||!_t.has(t.parentElement.nodeName)&&(qt.has(t.nodeName)||Zt.has(t.nodeName)))}shouldFallBackToHtmlBlock(t){const e=Array.from(t.childNodes);if(0===e.length)return!1;const n=t.parentElement.nodeName;return"UL"!==n&&"OL"!==n&&e.every((t=>t.nodeType===Node.ELEMENT_NODE&&""===t.textContent&&!Zt.has(t.nodeName)&&!qt.has(t.nodeName)))}isCustomHtmlContainer(t){return"DIV"!==t.nodeName||t.childNodes.length>0&&"IMG"!==t.childNodes[0].nodeName}generateHtmlBlock(t,e){return{id:tt(),type:"html-block",htmlTag:t.nodeName.toLowerCase(),annotations:ne.generate(U,t,e),children:[]}}}),
2
2
  //!important: Code block strategies must be registered after HtmlBlockStrategy because registerElementToBlockStrategy uses unshift, giving later registrations higher priority.
3
3
  wt.registerElementToBlockStrategy(new re),wt.registerElementToBlockStrategy(new class extends re{canHandle(t,e){return"VEGA-CODE-BLOCK"===t[e].tagName&&0==!!t[e].querySelector("vega-code-block")||this.isCodeBlockContainer(t[e])?1:0}handle(t){const e=this.isCodeBlockContainer(t[0])?t[0].querySelector("vega-code-block"):t[0],n=e.querySelector("code");if(n)return super.handle([n]);if(e.hasAttribute("data-content")){const t=document.createElement("code");return t.textContent=e.dataset.content,t.dataset.language=e.dataset.language,super.handle([t])}}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}isCodeBlockContainer(t){return"PRE"===t.tagName&&t.classList.contains("code-block-container")&&1===t.querySelectorAll("vega-code-block").length}}),wt.registerElementToNodeStrategy(new class extends oe{canHandle(t,e){const n=t[e];return!lt(n)||"BR"!==n.nodeName&&0!==n.childNodes.length?0:1}handle(t,e,n){const s=!(!e||!1!==e.autoMatchFormat),r=Object.assign({},n),i=t[0],o=ne.generate(T,i,Object.assign({parentAnnotations:s?{inlineHtml:r.inlineHtml,link:r.link,code:r.code}:n},e));if("BR"===i.nodeName){const{inlineHtml:t}=o,e=function(t,e){var n={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(n[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(t);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(t,s[r])&&(n[s[r]]=t[s[r]])}return n}(o,["inlineHtml"]);return this.generateTextNode("\n",t&&"br"===t.htmlTag?e:o)}if(0===i.childNodes.length){const t=s?ct(Object.assign(Object.assign({},T.supportsHtmlTag(i.nodeName.toLowerCase())?o:{}),{inlineHtml:o.inlineHtml})):o;return Object.assign({},this.generateTextNode("",t))}}}),wt.registerElementToNodeStrategy(new class extends oe{canHandle(t,e){return t[e].nodeType===Node.TEXT_NODE?1:0}handle(t,e,n){const s=Object.assign({},n),r=!(!e||!1!==e.autoMatchFormat),i=t[0],o=i.parentNode.nodeName.toLowerCase(),a=r&&!T.supportsHtmlTag(o),l=this.generateTextNode(String(i.textContent),r?ct(Object.assign(Object.assign({},"span"===o?s:{link:s.link,code:"code"===o?s.code:void 0}),{inlineHtml:s.inlineHtml,plainText:a||void 0})):s);return Object.assign({},l)}}),F.register(g.dtoName,new ae),F.register(N.dtoName,new ae),F.register(B.dtoName,new ae),F.register(T.dtoName,new class extends V{constructor(){super(...arguments),this.stylesToBeFiltered={}}get alwaysFilter(){return!0}filterAnnotations(t){const e=t,n=e.customStyle;if(!n)return t;e.bold&&n.fontWeight===S&&delete n.fontWeight,e.italic&&n.fontStyle===$&&delete n.fontStyle;const s=this.normalizeTextDecoration(n.textDecoration);return s&&this.shouldRemoveTextDecoration(s,e)&&delete n.textDecoration,0===Object.keys(n).length&&delete e.customStyle,t}normalizeTextDecoration(t){if(!t)return;const e=t.trim().toLowerCase().split(/\s+/);return e.some((t=>t!==M&&t!==P))?void 0:Array.from(new Set(e)).sort().join(" ")}shouldRemoveTextDecoration(t,e){const n=[];return e.underline&&n.push(M),e.strikethrough&&n.push(P),0!==n.length&&t===n.sort().join(" ")}}),F.register(g.dtoName,new le),F.register(g.dtoName,new ce(1)),F.register(g.dtoName,new ce(2)),F.register(g.dtoName,new ce(3)),F.register(g.dtoName,new ce(4)),F.register(g.dtoName,new ce(5)),F.register(g.dtoName,new ce(6)),F.register(g.dtoName,new he("title")),F.register(g.dtoName,new he("subtitle")),F.register(T.dtoName,new ue),F.register(T.dtoName,new class extends V{constructor(){super(...arguments),this.stylesToBeFiltered=K.getDefaultStyles(),this.elementTagName="code"}filterAnnotations(t){const{code:e,customStyle:n}=t;return e&&n?super.filterAnnotations(t):t}canFilter(t){return G.isCodeNode(t)}canRefill(t,e){return G.isTextNode(t)&&e.matches(this.elementTagName)}toCssText(){return`.${V.RTE_CONTENT_CONTAINER_CLASS_NAME} ${this.elementTagName} { ${this.convertStylesMapToCssText(Object.assign(Object.assign({},this.stylesToBeFiltered),{fontWeight:"500"}))} }`}}),F.register(T.dtoName,new X),F.register(xt.dtoName,new class extends V{constructor(){super(...arguments),this.stylesToBeFiltered=Tt.getDefaultStyles(),this.elementTagName="img"}get alwaysFilter(){return!0}canFilter(t){return G.isImageNode(t)}canRefill(t,e){return e.tagName.toLowerCase()===this.elementTagName}toCssText(){return this.buildCssTextForStyles(this.elementTagName,this.classNameToBeAdded)}}),F.register(e.dtoName,new Q),F.register(Z.dtoName,new _),F.register(N.dtoName,new class extends V{constructor(){super(...arguments),this.stylesToBeFiltered=W.getDefaultStyles(),this.elementTagName="ol,ul"}canFilter(t){return G.isListBlock(t.dtoName)}canRefill(t,e){return G.isListBlock(t)&&e.matches(this.elementTagName)}toCssText(){const t=V.RTE_CONTENT_CONTAINER_CLASS_NAME,e=this.elementTagName.split(",").map((t=>t.trim())),n=e.map((e=>`.${t} ${e}`)).join(", "),s=e.map((e=>`.${t} ${e} > li::marker`)).join(", "),r=this.convertStylesMapToCssText(W.getDefaultMarkerStyles());return`${n} { ${this.convertStylesMapToCssText(this.stylesToBeFiltered)} } ${s} { ${r} }`}}),F.register(B.dtoName,new class extends V{constructor(){super(...arguments),this.stylesToBeFiltered=z.getDefaultStyles("paragraph"),this.elementTagName="li",this.headingOrTitleClassNamePattern=/^v-rte-(h[1-6]|title|subtitle)$/}canFilter(t){const e=!t.getStyles().fontSize||this.isBlockOrNodeStylesMatchFilterStyles(t,["fontSize","lineHeight"]);return G.isListItemBlock(t.dtoName)&&e}canRefill(t,e){return G.isListItemBlock(t)&&e.matches(this.elementTagName)&&this.isElementNotHeadingOrTitle(e)}toCssText(){return this.buildCssTextForStyles(this.elementTagName)}isElementNotHeadingOrTitle(t){return!t.className.split(" ").some((t=>this.headingOrTitleClassNamePattern.test(t.trim())))}}),F.register(B.dtoName,new de(1)),F.register(B.dtoName,new de(2)),F.register(B.dtoName,new de(3)),F.register(B.dtoName,new de(4)),F.register(B.dtoName,new de(5)),F.register(B.dtoName,new de(6)),F.register(B.dtoName,new we("title")),F.register(B.dtoName,new we("subtitle"));class pe{static preserve(t){const e=t.replace(/\s+style=/g," data-style=");return new fe(e)}}class fe{constructor(t){this.processedHtml=t}getProcessedHtml(){return this.processedHtml}restore(t){this.walkNodes(t)}walkNodes(t){t.forEach((t=>{if(lt(t)){const e=t.getAttribute("data-style");e&&(t.style.cssText=e,t.removeAttribute("data-style")),t.children.length>0&&this.walkNodes(Array.from(t.children))}}))}}class me{process(t){return t.replace(/(<[^>]+>)(\s+)(<[^>]+>)/g,((t,e,n,s)=>{const r=this.extractOpeningTagName(e),i=this.extractClosingTagName(s);return r&&i&&r===i?`${e}${n}${s}`:`${e}${s}`}))}extractOpeningTagName(t){const e=t.match(/<(\w[\w-]*)/);return e?e[1]:null}extractClosingTagName(t){const e=t.match(/<\/(\w[\w-]*)/);return e?e[1]:null}}class ge{process(t){return t.replace(/(>)[\n\t]+(?=.)/g,"$1")}}class Te{process(t){return t.replace(/(.?)[\n\t]+(?=<)/g,"$1")}}class xe{constructor(){this.processors=[new me,new ge,new Te]}clean(t){if(!t||0===t.trim().length)return t;let e,n=t;do{e=n;for(const t of this.processors)n=t.process(n)}while(n!==e);return n}}class be{constructor(t){this.dtoName=be.dtoName,t.forEach((t=>{t.parent=this})),this.children=t}static fromJSON(t,e={autoMatchFormat:!0}){const n=t.map((t=>{const n=Y.getRTEBlockClass(t.type);if(n)return n.from(t,e);throw new Error(`[Vega] Unknown block type: ${t.type}`)}));return new be(n)}static createEmptyContent(t={autoMatchFormat:!0}){return be.fromJSON([{id:tt(),type:"paragraph",annotations:{internalWrapper:!t.autoMatchFormat},nodes:[{id:tt(),annotations:{plainText:!t.autoMatchFormat},type:"text",text:""}]}],t)}static fromHtml(t,e={autoMatchFormat:!0,skipCustomAnnotations:!1}){const n=(new xe).clean(t),s=pe.preserve(n),r=s.getProcessedHtml(),i=(new DOMParser).parseFromString(r,"text/html").body,o=Array.from(i.childNodes);s.restore(o);const a=pt.process(o,e).filter(et).map((t=>t.toDto(e))).filter(et);return new be(a)}static generateContentStyles(t){return F.generateAllStylesContent(null==t?void 0:t.enableFontImports)}clone(t=!1){return new be(t?this.children.map((t=>t.clone(this))):[...this.children])}toJSON(){return this.children.map((t=>t.toJSON()))}toHtml(t){return t&&(et(t.autoMatchFormat)||et(t.skipCustomAnnotations))&&ht.warn("The 'options' parameter's properties 'autoMatchFormat' and 'skipCustomAnnotations' in toHtml method are deprecated and will be removed in the future."),this.isEmpty()?"":this.children.map((e=>e.toHtml({filterInlineStyles:null==t?void 0:t.filterInlineStyles}))).join("")}isEmpty(){return 0===this.children.length||1===this.children.length&&!this.children[0].isNotEmpty()}apply(t){if(h.executeTheStrategy(t,this),t.executedFlag&&t.isFlushable){const t=r.getDOMByEntity(this);t&&nt.notify(st.getSubject(t,ot),{})}}getLastNode(){return 0===this.children.length?null:this.children[this.children.length-1].getLastNode()}toListItem(t){var e;t.children.map((t=>t.apply(new q)));const n=new B(tt());return n.apply(new f(t.children)),n.annotationMap=t.annotationMap,t instanceof B&&(null===(e=t.nestList)||void 0===e?void 0:e.length)&&(n.apply(new j([...t.nestList])),t.apply(new j([]))),n}createList(t){return new N(tt(),t)}findNodeById(t){return this.findNodeInBlocksById(t,this.children)}findNodeInBlocksById(t,e){for(const n of e){if("children"in n)for(const e of n.children)if(e.id===t)return e;if(n instanceof B&&n.nestList)for(const e of n.nestList){const n=this.findNodeInBlocksById(t,e.children);if(n)return n}if(n instanceof N&&n.children){const e=this.findNodeInBlocksById(t,n.children);if(e)return e}}return null}}h.register(d.DELETE_CHILDREN,be.name,new H),h.register(d.APPEND_CHILDREN,be.name,new ft),h.register(d.INSERT_CHILDREN_BEFORE,be.name,new mt),h.register(d.INSERT_CHILDREN_AFTER,be.name,new gt),h.register(d.TRANSFORM_TO_CODE_BLOCK,be.name,new class extends t{handleAction(t,s){const r=t.selectedBlocks,i=new e(tt(),this.getCodeContent(r),"plainText");s.apply(new n(r[0],i)),t.newCodeBlock=i,this.removeSelectBlocks(r,s)}getCodeContent(t){return t.filter((t=>"image"!==t.type&&"list-item"!==t.type)).map((t=>t.children.map((t=>t.text)).join(""))).join("\n")}removeSelectBlocks(t,e){for(let n=0;n<t.length;n++)e.apply(new s(t[n]))}}),h.register(d.UPDATE_CURSOR_POSITION,be.name,new class extends t{handleAction(t,e){const{offset:n,nextFocusNode:s,immediatelyRun:i}=t,o=r.getDOMByEntity(e);o&&nt.notify(st.getSubject(o,rt),{node:s,offset:n,updateDirectly:i})}}),h.register(d.DELETE_SELECTED_CONTENT,be.name,new class extends t{handleAction(t){const{host:e,mergeFlag:n}=t;nt.notify(st.getSubject(e,it),{host:e,detail:n})}}),be.dtoName="VegaRTEContent";export{It as A,se as B,ut as E,bt as I,yt as M,jt as P,Ot as R,pe as S,At as U,be as V,mt as a,Nt as b,wt as c,xt as d,Tt as e,pt as f,ne as h}
@@ -1 +1 @@
1
- import{w as t,x as e,n as a,y as r,l as s,z as o,E as n,G as i,H as u,I as l,J as d,K as m,L as c,N as f,O as p,P as $,o as b,Q as v,B as g,R as h}from"./p-8db904dc.js";import{L as x}from"./p-6e1ab235.js";import{G as T,F as w,a as y,b as j,c as k,d as O,T as I}from"./p-d4ea8e22.js";import{g as N,c as R}from"./p-49a2e141.js";import{i as C}from"./p-262ec334.js";import{p as E}from"./p-0c667d6a.js";import{B as A}from"./p-ed45b3b6.js";import{s as F}from"./p-d27ae9ff.js";import{F as S}from"./p-87a4d75f.js";class D{format(e){return t(e)?Object.keys(e).map((t=>this.formatToken(e[t],"default"!==t?t:void 0))).join(" "):this.formatToken(e)}}const G={top:"pt",bottom:"pb",left:"pl",right:"pr",x:"px",y:"py"},_=new class extends D{formatToken(t,o){const n=e(o)?`${o}:`:"";return a(t)?`${n}v-p-${t}`:r(t)?Object.keys(t).map((e=>`${n}v-${G[e]}-${t[e]}`)).join(" "):(x.warn(`The padding value ${t} is invalid, it must be a value of: `,s),"")}},B={top:"mt",bottom:"mb",left:"ml",right:"mr",x:"mx",y:"my"},H=new class extends D{formatToken(t,a){const r=e(a)?`${a}:`:"";return o(t)?`${r}v-m-${t}`:n(t)?Object.keys(t).map((e=>`${r}v-${B[e]}-${t[e]}`)).join(" "):(x.warn(`The margin value ${t} is invalid, it must be a value of: `,s),"")}},J={x:"gap-col",y:"gap-row"},L=new class extends D{formatToken(t,o){const n=e(o)?`${o}:`:"";return a(t)?`${n}v-gap-${t}`:r(t)?Object.keys(t).map((e=>`${n}v-${J[e]}-${t[e]}`)).join(" "):(x.warn(`The gap value ${t} is invalid, it must be a value of: `,s),"")}},z=[1,2,3,4,5,6,7,8,9,10,11,12,"1-auto","2-auto","3-auto","4-auto","5-auto","6-auto","7-auto","8-auto","9-auto","10-auto","11-auto","12-auto"],K=[1,2,3,4,5,6,7,8,9,10,11,12,"1-auto","2-auto","3-auto","4-auto","5-auto","6-auto","7-auto","8-auto","9-auto","10-auto","11-auto","12-auto"],P=new class extends D{formatToken(t,a){const r=e(a)?`${a}:`:"";return i(t)?`${r}v-grid-cols-${t}`:(x.warn(`The column value ${t} is invalid, it must be a value of: `,K),"")}},V=new class extends D{formatToken(t,a){const r=e(a)?`${a}:`:"";return u(t)?`${r}v-grid-rows-${t}`:(x.warn(`The row value ${t} is invalid, it must be a value of: `,z),"")}},W=new class extends D{formatToken(t,a){const r=e(a)?`${a}:`:"";return l(t)?`${r}v-justify-items-${t}`:(x.warn(`The grid justifyItems value ${t} is invalid, it must be a value of: `,T),"")}},M=new class{format(e){const a=N();return"number"!=typeof e&&"string"!=typeof e||isNaN(e)?"string"==typeof e&&C(e)?e:t(e)?(e=R(e))[a]:null:Number(e)}},Q=new class{format(e){if(d(e))return e;if(t(e)){const t=N();return(e=R(e))[t]}return null}},U=new class extends D{formatToken(t,a){const r=e(a)?`${a}:`:"";return"string"==typeof t&&"false"===t||!1===t?`${r}v-hidden`:"string"==typeof t&&"true"===t||!0===t?`${r}v-block`:(x.warn(`The display value ${t} is invalid, it must be a boolean`),"")}},q=new class extends D{formatToken(t,a){const r=e(a)?`${a}:`:"";return m(t)?`${r}v-flex-${t}`:(x.warn(`The direction value ${t} is invalid, it must be a value of: `,w),"")}},X=new class extends D{formatToken(t,a){const r=e(a)?`${a}:`:"";return c(t)?`${r}v-items-${t}`:(x.warn(`The flex alignItem value ${t} is invalid, it must be a value of: `,y),"")}},Y=new class extends D{formatToken(t,a){const r=e(a)?`${a}:`:"";return f(t)?`${r}v-justify-${this.mapInput(t)}`:(x.warn(`The flex justifyContent value ${t} is invalid, it must be a value of: `,j),"")}mapInput(t){switch(t){case"start":return"start";case"center":return"center";case"end":return"end";case"space-around":return"around";case"space-between":return"between";case"space-evenly":return"evenly"}}},Z=new class extends D{formatToken(t,a){const r=e(a)?`${a}:`:"";return p(t)?`${r}v-flex-${t}`:(x.warn(`The flex flexWrap value ${t} is invalid, it must be a value of: `,k),"")}},tt=new class{format(e){const a=N();return t(e)?(e=R(e))[a]:e}},et=new class extends D{formatToken(t,a){const r=e(a)?`${a}:`:"";return $(t)?"none"==t?`${r}v-hidden`:`${r}v-${t}`:(x.warn(`The box display value ${t} is invalid, it must be a value of: `,O),"")}},at=new class{format(e){const a=N();return t(e)?(e=R(e),E(e[a])):E(e)}},rt={top:"t",right:"r",bottom:"b",left:"l","top-left":"tl","top-right":"tr","bottom-left":"bl","bottom-right":"br"},st=new class extends D{formatToken(t,a){const r=e(a)?`${a}:`:"";return b(t)?`${r}v-${this.transformRoundedNoneAndFill(t)}`:v(t)?Object.keys(t).map((e=>`${r}v-rounded-${rt[e]}-${this.transformRoundedNoneAndFill(t[e]).replace("rounded-","")}`)).join(" "):(x.warn(`The border radius value ${t} is invalid, it must be a value of: `,g),"")}transformRoundedNoneAndFill(t){return t.replace("rounded-none","rounded-0").replace("rounded-full","rounded-9999")}},ot=new class extends D{formatToken(t,a){const r=e(a)?`${a}:`:"";return h(t)?`${r}v-text-${t}`:(x.warn(`The text align value ${t} is invalid, it must be a value of: `,I),"")}};class nt{format(e){return t(e)?Object.keys(e).map((t=>this.generateCssText(this.formatToken(e[t],"default"!==t?t:void 0),t))).join(" "):this.generateCssText(this.formatToken(e))}generateCssText(t,e){let a="";return t&&(a=e&&"default"!==e?`@media (min-width:${A[e]}px){:host{${t}}}`:`:host{${t}}`),a}}const it={top:["padding-top"],bottom:["padding-bottom"],left:["padding-left"],right:["padding-right"],x:["padding-left","padding-right"],y:["padding-top","padding-bottom"]},ut=new class extends nt{formatToken(t){return a(t)?`padding:${s[t]}px`:r(t)?Object.keys(t).map((e=>it[e].map((a=>`${a}:${s[t[e]]}px`)).join(";"))).join(";"):(x.warn(`The padding value ${t} is invalid, it must be a value of: `,s),"")}},lt={top:["margin-top"],bottom:["margin-bottom"],left:["margin-left"],right:["margin-right"],x:["margin-left","margin-right"],y:["margin-top","margin-bottom"]},dt=new class extends nt{formatToken(t){return a(t)?`margin:${s[t]}px`:r(t)?Object.keys(t).map((e=>lt[e].map((a=>`${a}:${s[t[e]]}px`)).join(";"))).join(";"):(x.warn(`The margin value ${t} is invalid, it must be a value of: `,s),"")}},mt={top:["border-top-left-radius","border-top-right-radius"],right:["border-top-right-radius","border-bottom-right-radius"],bottom:["border-bottom-left-radius","border-bottom-right-radius"],left:["border-top-left-radius","border-bottom-left-radius"],"top-left":["border-top-left-radius"],"top-right":["border-top-right-radius"],"bottom-left":["border-bottom-left-radius"],"bottom-right":["border-bottom-right-radius"]},ct=new class extends nt{formatToken(t){return b(t)?`border-radius:${g[t]}px`:v(t)?this.getDirectionKeys(t).map((e=>mt[e].map((a=>`${a}:${g[t[e]]}px`)).join(";"))).join(";"):(x.warn(`The border radius value ${t} is invalid, it must be a value of: `,g),"")}getDirectionKeys(t){const e=Object.keys(t);return S.isEnabled("VEGA_COMPONENT.CORNERS_USE_OLD_BEHAVIOR")?F(e,(e=>t[e]),void 0,Object.keys(g)):e}},ft=new class{format(t,e){switch(e){case"padding":return _.format(t);case"margin":return H.format(t);case"gap":return L.format(t);case"gridColumn":return P.format(t);case"gridRow":return V.format(t);case"gridJustifyItems":return W.format(t);case"size":return M.format(t);case"translocation":return Q.format(t);case"display":return U.format(t);case"flexDirection":return q.format(t);case"flexAlignItem":return X.format(t);case"flexJustifyContent":return Y.format(t);case"flexWrap":return Z.format(t);case"boxDisplay":return et.format(t);case"widthAndHeight":return at.format(t);case"corners":return st.format(t);case"textAlign":return ot.format(t);case"paddingStyle":return ut.format(t);case"marginStyle":return dt.format(t);case"cornersStyle":return ct.format(t);default:throw new Error(`Invalid flag ${e} passed into ResponsiveFormatFacade`)}}formatCustom(t){return tt.format(t)}};export{K as G,ft as R,z as a}
1
+ import{w as t,x as e,n as a,y as r,l as s,z as o,E as n,G as i,H as u,I as l,J as d,K as m,L as f,N as c,O as p,P as $,o as b,Q as v,B as g,R as h}from"./p-456f678b.js";import{L as x}from"./p-6e1ab235.js";import{G as T,F as w,a as y,b as j,c as k,d as O,T as I}from"./p-d4ea8e22.js";import{g as N,c as R}from"./p-49a2e141.js";import{i as C}from"./p-262ec334.js";import{p as E}from"./p-0c667d6a.js";import{B as A}from"./p-ed45b3b6.js";import{s as F}from"./p-d27ae9ff.js";import{F as S}from"./p-87a4d75f.js";class D{format(e){return t(e)?Object.keys(e).map((t=>this.formatToken(e[t],"default"!==t?t:void 0))).join(" "):this.formatToken(e)}}const G={top:"pt",bottom:"pb",left:"pl",right:"pr",x:"px",y:"py"},_=new class extends D{formatToken(t,o){const n=e(o)?`${o}:`:"";return a(t)?`${n}v-p-${t}`:r(t)?Object.keys(t).map((e=>`${n}v-${G[e]}-${t[e]}`)).join(" "):(x.warn(`The padding value ${t} is invalid, it must be a value of: `,s),"")}},B={top:"mt",bottom:"mb",left:"ml",right:"mr",x:"mx",y:"my"},H=new class extends D{formatToken(t,a){const r=e(a)?`${a}:`:"";return o(t)?`${r}v-m-${t}`:n(t)?Object.keys(t).map((e=>`${r}v-${B[e]}-${t[e]}`)).join(" "):(x.warn(`The margin value ${t} is invalid, it must be a value of: `,s),"")}},J={x:"gap-col",y:"gap-row"},L=new class extends D{formatToken(t,o){const n=e(o)?`${o}:`:"";return a(t)?`${n}v-gap-${t}`:r(t)?Object.keys(t).map((e=>`${n}v-${J[e]}-${t[e]}`)).join(" "):(x.warn(`The gap value ${t} is invalid, it must be a value of: `,s),"")}},z=[1,2,3,4,5,6,7,8,9,10,11,12,"1-auto","2-auto","3-auto","4-auto","5-auto","6-auto","7-auto","8-auto","9-auto","10-auto","11-auto","12-auto"],K=[1,2,3,4,5,6,7,8,9,10,11,12,"1-auto","2-auto","3-auto","4-auto","5-auto","6-auto","7-auto","8-auto","9-auto","10-auto","11-auto","12-auto"],P=new class extends D{formatToken(t,a){const r=e(a)?`${a}:`:"";return i(t)?`${r}v-grid-cols-${t}`:(x.warn(`The column value ${t} is invalid, it must be a value of: `,K),"")}},V=new class extends D{formatToken(t,a){const r=e(a)?`${a}:`:"";return u(t)?`${r}v-grid-rows-${t}`:(x.warn(`The row value ${t} is invalid, it must be a value of: `,z),"")}},W=new class extends D{formatToken(t,a){const r=e(a)?`${a}:`:"";return l(t)?`${r}v-justify-items-${t}`:(x.warn(`The grid justifyItems value ${t} is invalid, it must be a value of: `,T),"")}},M=new class{format(e){const a=N();return"number"!=typeof e&&"string"!=typeof e||isNaN(e)?"string"==typeof e&&C(e)?e:t(e)?(e=R(e))[a]:null:Number(e)}},Q=new class{format(e){if(d(e))return e;if(t(e)){const t=N();return(e=R(e))[t]}return null}},U=new class extends D{formatToken(t,a){const r=e(a)?`${a}:`:"";return"string"==typeof t&&"false"===t||!1===t?`${r}v-hidden`:"string"==typeof t&&"true"===t||!0===t?`${r}v-block`:(x.warn(`The display value ${t} is invalid, it must be a boolean`),"")}},q=new class extends D{formatToken(t,a){const r=e(a)?`${a}:`:"";return m(t)?`${r}v-flex-${t}`:(x.warn(`The direction value ${t} is invalid, it must be a value of: `,w),"")}},X=new class extends D{formatToken(t,a){const r=e(a)?`${a}:`:"";return f(t)?`${r}v-items-${t}`:(x.warn(`The flex alignItem value ${t} is invalid, it must be a value of: `,y),"")}},Y=new class extends D{formatToken(t,a){const r=e(a)?`${a}:`:"";return c(t)?`${r}v-justify-${this.mapInput(t)}`:(x.warn(`The flex justifyContent value ${t} is invalid, it must be a value of: `,j),"")}mapInput(t){switch(t){case"start":return"start";case"center":return"center";case"end":return"end";case"space-around":return"around";case"space-between":return"between";case"space-evenly":return"evenly"}}},Z=new class extends D{formatToken(t,a){const r=e(a)?`${a}:`:"";return p(t)?`${r}v-flex-${t}`:(x.warn(`The flex flexWrap value ${t} is invalid, it must be a value of: `,k),"")}},tt=new class{format(e){const a=N();return t(e)?(e=R(e))[a]:e}},et=new class extends D{formatToken(t,a){const r=e(a)?`${a}:`:"";return $(t)?"none"==t?`${r}v-hidden`:`${r}v-${t}`:(x.warn(`The box display value ${t} is invalid, it must be a value of: `,O),"")}},at=new class{format(e){const a=N();return t(e)?(e=R(e),E(e[a])):E(e)}},rt={top:"t",right:"r",bottom:"b",left:"l","top-left":"tl","top-right":"tr","bottom-left":"bl","bottom-right":"br"},st=new class extends D{formatToken(t,a){const r=e(a)?`${a}:`:"";return b(t)?`${r}v-${this.transformRoundedNoneAndFill(t)}`:v(t)?Object.keys(t).map((e=>`${r}v-rounded-${rt[e]}-${this.transformRoundedNoneAndFill(t[e]).replace("rounded-","")}`)).join(" "):(x.warn(`The border radius value ${t} is invalid, it must be a value of: `,g),"")}transformRoundedNoneAndFill(t){return t.replace("rounded-none","rounded-0").replace("rounded-full","rounded-9999")}},ot=new class extends D{formatToken(t,a){const r=e(a)?`${a}:`:"";return h(t)?`${r}v-text-${t}`:(x.warn(`The text align value ${t} is invalid, it must be a value of: `,I),"")}};class nt{format(e){return t(e)?Object.keys(e).map((t=>this.generateCssText(this.formatToken(e[t],"default"!==t?t:void 0),t))).join(" "):this.generateCssText(this.formatToken(e))}generateCssText(t,e){let a="";return t&&(a=e&&"default"!==e?`@media (min-width:${A[e]}px){:host{${t}}}`:`:host{${t}}`),a}}const it={top:["padding-top"],bottom:["padding-bottom"],left:["padding-left"],right:["padding-right"],x:["padding-left","padding-right"],y:["padding-top","padding-bottom"]},ut=new class extends nt{formatToken(t){return a(t)?`padding:${s[t]}px`:r(t)?Object.keys(t).map((e=>it[e].map((a=>`${a}:${s[t[e]]}px`)).join(";"))).join(";"):(x.warn(`The padding value ${t} is invalid, it must be a value of: `,s),"")}},lt={top:["margin-top"],bottom:["margin-bottom"],left:["margin-left"],right:["margin-right"],x:["margin-left","margin-right"],y:["margin-top","margin-bottom"]},dt=new class extends nt{formatToken(t){return a(t)?`margin:${s[t]}px`:r(t)?Object.keys(t).map((e=>lt[e].map((a=>`${a}:${s[t[e]]}px`)).join(";"))).join(";"):(x.warn(`The margin value ${t} is invalid, it must be a value of: `,s),"")}},mt={top:["border-top-left-radius","border-top-right-radius"],right:["border-top-right-radius","border-bottom-right-radius"],bottom:["border-bottom-left-radius","border-bottom-right-radius"],left:["border-top-left-radius","border-bottom-left-radius"],"top-left":["border-top-left-radius"],"top-right":["border-top-right-radius"],"bottom-left":["border-bottom-left-radius"],"bottom-right":["border-bottom-right-radius"]},ft=new class extends nt{formatToken(t){return b(t)?`border-radius:${g[t]}px`:v(t)?this.getDirectionKeys(t).map((e=>mt[e].map((a=>`${a}:${g[t[e]]}px`)).join(";"))).join(";"):(x.warn(`The border radius value ${t} is invalid, it must be a value of: `,g),"")}getDirectionKeys(t){const e=Object.keys(t);return S.isEnabled("VEGA_COMPONENT.CORNERS_USE_OLD_BEHAVIOR")?F(e,(e=>t[e]),void 0,Object.keys(g)):e}},ct=new class{format(t,e){switch(e){case"padding":return _.format(t);case"margin":return H.format(t);case"gap":return L.format(t);case"gridColumn":return P.format(t);case"gridRow":return V.format(t);case"gridJustifyItems":return W.format(t);case"size":return M.format(t);case"translocation":return Q.format(t);case"display":return U.format(t);case"flexDirection":return q.format(t);case"flexAlignItem":return X.format(t);case"flexJustifyContent":return Y.format(t);case"flexWrap":return Z.format(t);case"boxDisplay":return et.format(t);case"widthAndHeight":return at.format(t);case"corners":return st.format(t);case"textAlign":return ot.format(t);case"paddingStyle":return ut.format(t);case"marginStyle":return dt.format(t);case"cornersStyle":return ft.format(t);default:throw new Error(`Invalid flag ${e} passed into ResponsiveFormatFacade`)}}formatCustom(t){return tt.format(t)}};export{K as G,ct as R,z as a}
@@ -1 +1 @@
1
- import{S as t}from"./p-b775e51f.js";import{i as s}from"./p-8db904dc.js";class e extends t{constructor(t,s=!1){super(),this.insertMode=!0,this.maskConfig=t,this.overrideValue=s,this.slotRegex=new RegExp(t.slot),this.acceptRegex=new RegExp(t.accept,"g"),this.insertMode=!1!==t.insertMode}static getPhoneMaskStrategy(t=!1){return new e(this.DEFAULT_PHONE_MASK_CONFIG,t)}static getZipcodeMaskStrategy(t=!1){return new e(this.DEFAULT_ZIPCODE_MASK_CONFIG,t)}static getTaxIdMaskStrategy(t=!1){return new e(this.DEFAULT_TAX_ID_MASK_CONFIG,t)}setMaskConfig(t){this.maskConfig=t}format(t,e){const i=null==e?void 0:e.caretPosition;if(t.length>this.getLengthLimit()&&s(i)){const s=[...t],e=t.length-this.getLengthLimit();return s.splice(i-e,e),s.join("")}return this.replaceMaskWithMatchedInputSlots(t,this.getMatchedInputSlotValue(t))}calculateCaretPosition(t,e){if(!s(e))return null;if(t.length>this.getLengthLimit())return e-(t.length-this.getLengthLimit());const i=t.substring(0,e);return e+(this.format(i).length-i.length)}shouldOverrideComponentValueAfterBlur(){return!!this.overrideValue||!(!this.maskConfig||!0!==this.maskConfig.overrideValue)}shouldTriggerAtInit(){return!(!this.maskConfig||!0!==this.maskConfig.triggerAtInit)}getLengthLimit(){return this.maskConfig.mask.length}getMatchedInputSlotValue(t){return t.match(this.acceptRegex)||[]}replaceMaskWithMatchedInputSlots(t,s){const e=[];let i=-1;for(let r=0;r<this.maskConfig.mask.length;r++){const n=this.maskConfig.mask.charAt(r);if(this.slotRegex.test(n)&&s.length){const t=s.shift();t&&(e.push(t),i=r)}else this.insertMode||s.shift(),t.charAt(r)===n&&(i=r),e.push(n)}const r=this.insertMode?i+1:t.length;return e.join("").slice(0,r)}}e.DEFAULT_PHONE_MASK_CONFIG={mask:"(999) 999-9999",slot:"9",accept:/\d/g},e.DEFAULT_ZIPCODE_MASK_CONFIG={mask:"99999",slot:"9",accept:/\d/g},e.DEFAULT_TAX_ID_MASK_CONFIG={mask:"99-9999999",slot:"9",accept:/\d/g};export{e as S}
1
+ import{S as t}from"./p-ae2abdfa.js";import{i as s}from"./p-456f678b.js";class e extends t{constructor(t,s=!1){super(),this.insertMode=!0,this.maskConfig=t,this.overrideValue=s,this.slotRegex=new RegExp(t.slot),this.acceptRegex=new RegExp(t.accept,"g"),this.insertMode=!1!==t.insertMode}static getPhoneMaskStrategy(t=!1){return new e(this.DEFAULT_PHONE_MASK_CONFIG,t)}static getZipcodeMaskStrategy(t=!1){return new e(this.DEFAULT_ZIPCODE_MASK_CONFIG,t)}static getTaxIdMaskStrategy(t=!1){return new e(this.DEFAULT_TAX_ID_MASK_CONFIG,t)}setMaskConfig(t){this.maskConfig=t}format(t,e){const i=null==e?void 0:e.caretPosition;if(t.length>this.getLengthLimit()&&s(i)){const s=[...t],e=t.length-this.getLengthLimit();return s.splice(i-e,e),s.join("")}return this.replaceMaskWithMatchedInputSlots(t,this.getMatchedInputSlotValue(t))}calculateCaretPosition(t,e){if(!s(e))return null;if(t.length>this.getLengthLimit())return e-(t.length-this.getLengthLimit());const i=t.substring(0,e);return e+(this.format(i).length-i.length)}shouldOverrideComponentValueAfterBlur(){return!!this.overrideValue||!(!this.maskConfig||!0!==this.maskConfig.overrideValue)}shouldTriggerAtInit(){return!(!this.maskConfig||!0!==this.maskConfig.triggerAtInit)}getLengthLimit(){return this.maskConfig.mask.length}getMatchedInputSlotValue(t){return t.match(this.acceptRegex)||[]}replaceMaskWithMatchedInputSlots(t,s){const e=[];let i=-1;for(let r=0;r<this.maskConfig.mask.length;r++){const n=this.maskConfig.mask.charAt(r);if(this.slotRegex.test(n)&&s.length){const t=s.shift();t&&(e.push(t),i=r)}else this.insertMode||s.shift(),t.charAt(r)===n&&(i=r),e.push(n)}const r=this.insertMode?i+1:t.length;return e.join("").slice(0,r)}}e.DEFAULT_PHONE_MASK_CONFIG={mask:"(999) 999-9999",slot:"9",accept:/\d/g},e.DEFAULT_ZIPCODE_MASK_CONFIG={mask:"99999",slot:"9",accept:/\d/g},e.DEFAULT_TAX_ID_MASK_CONFIG={mask:"99-9999999",slot:"9",accept:/\d/g};export{e as S}
@@ -0,0 +1 @@
1
+ import{h as e,H as t,r as i,c as o,g as a}from"./p-6b2342e0.js";import{s as r}from"./p-519a7d55.js";import{c as s,M as l,V as n,I as d,L as c}from"./p-6e1ab235.js";import{V as h,I as p}from"./p-8ce9e214.js";import{R as v}from"./p-1e0a8fd3.js";import{c as g}from"./p-3a620268.js";import{S as b}from"./p-29e3eb12.js";import{O as f}from"./p-331a62d5.js";import{d as m}from"./p-526e3634.js";import{i as u}from"./p-3a68b729.js";import{f as x}from"./p-528748fa.js";import{C as w}from"./p-2d0d575f.js";import{P as j}from"./p-81dd00d0.js";import{g as y}from"./p-49a2e141.js";import{d as k}from"./p-5447a8e8.js";import{c as C}from"./p-66647244.js";import{F as R}from"./p-cb378636.js";import{M as z}from"./p-78a57a17.js";import{a as S}from"./p-52b8f2d2.js";import{i as O}from"./p-d27ae9ff.js";import{c as E}from"./p-3f183b52.js";import{C as T}from"./p-2c737fc8.js";import{F as I}from"./p-e1029acc.js";import{R as V}from"./p-8bc15ed0.js";import"./p-456f678b.js";import"./p-ed45b3b6.js";import"./p-d4ea8e22.js";import"./p-b438e68b.js";import"./p-874e5624.js";import"./p-262ec334.js";import"./p-0c667d6a.js";import"./p-87a4d75f.js";import"./p-982747ef.js";import"./p-b75ee3ba.js";import"./p-6a334573.js";import"./p-8c30a60d.js";import"./p-5f377954.js";import"./p-02841589.js";import"./p-8b5d3a52.js";import"./p-f0e828d8.js";import"./p-abd7aeaa.js";import"./p-71909102.js";var N=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 l=e.length-1;l>=0;l--)(a=e[l])&&(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 L extends n{componentWillRender(){this.currentSize=v.formatCustom(this.size)}render(){return e(t,{class:{block:this.block}},this.renderTooltip())}renderTooltip(){return e("vega-tooltip",Object.assign({trigger:this.disabled&&this.disabledTooltip?"hover":"none",alignment:"center"},this.disabledTooltip),this.renderSelectionChip())}renderSelectionChip(){return e("vega-box",{corners:"rounded-full",class:{"vega-selection-chip":!0,[`size-${this.currentSize}`]:!0,[`variant-${this.variant||"text"}`]:!0,checked:this.checked,error:this.showError,disabled:this.disabled},"aria-label":this.label||"No label defined",onClick:()=>{"radio"===this.selectType&&this.checked||this.checkedController.onCheck(!this.checked)},onKeyDown:g(),tabIndex:this.disabled?-1:0},this.renderContent())}renderContent(){return e("vega-flex",{gap:L.gapSizeMap[this.currentSize],"align-items":"center","justify-content":"text"===this.variant?"center":"start"},"swatch"===this.variant&&this.renderSwatch(),this.renderLabel())}renderLabel(){return e("vega-font",{color:"text-primary",class:"label vega-flex-grow",variant:L.labelFontMap[this.currentSize]},this.label)}renderSwatch(){return e("vega-box",{"background-color":"bg-primary",corners:"rounded-full",class:"swatch vega-flex-shrink-0"},e("vega-box",{"background-color":this.swatchColor,corners:"rounded-full"}))}}L.gapSizeMap={"extra-small":"size-4",small:"size-4",medium:"size-8",large:"size-8"},L.labelFontMap={"extra-small":"font-field-label-xs",small:"font-field-label-sm",medium:"font-field-label",large:"font-field-label-lg"},N([s()],L.prototype,"host",void 0),N([s()],L.prototype,"label",void 0),N([s()],L.prototype,"block",void 0),N([s()],L.prototype,"size",void 0),N([s()],L.prototype,"variant",void 0),N([s()],L.prototype,"swatchColor",void 0),N([s()],L.prototype,"disabledTooltip",void 0),N([s()],L.prototype,"disabled",void 0),N([s()],L.prototype,"selectType",void 0),N([s()],L.prototype,"checked",void 0),N([s()],L.prototype,"checkedController",void 0),N([s()],L.prototype,"showError",void 0),N([l("componentWillRender")],L.prototype,"componentWillRender",null);var A=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 l=e.length-1;l>=0;l--)(a=e[l])&&(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 F extends n{setChecked(e){this.checked=e}onCheck(e){const t=e?this.value:"";this.setChecked(e),this.changeEventEmitter.emit(t)}}A([s()],F.prototype,"host",void 0),A([s({writable:!0})],F.prototype,"checked",void 0),A([s()],F.prototype,"changeEventEmitter",void 0),A([s()],F.prototype,"value",void 0);var D=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 l=e.length-1;l>=0;l--)(a=e[l])&&(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 G extends b{constructor(){super({parent:"vega-selection-chip-group",subStates:[{subStateName:"disabled",parentStateName:"disabled",callback:e=>{"boolean"==typeof e&&(this.disabled=e)}},{subStateName:"selectType",parentStateName:"selectType",callback:e=>{this.selectType="checkbox"===e?"checkbox":"radio"}},{subStateName:"checked",parentStateName:"value",callback:e=>{this.checkedController.setChecked(Array.isArray(e)?e.includes(this.value):e===this.value)}}]})}}D([s()],G.prototype,"host",void 0),D([s({writable:!0})],G.prototype,"disabled",void 0),D([s({writable:!0})],G.prototype,"selectType",void 0),D([s()],G.prototype,"value",void 0),D([s()],G.prototype,"checkedController",void 0);var W=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 l=e.length-1;l>=0;l--)(a=e[l])&&(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 M extends n{connectedCallback(){this.selectionChipGroup=x(this.host,"vega-selection-chip-group"),this.selectionChipGroup&&(this.fieldErrorObserver=new f(this.canAcceptFieldErrorObserver.bind(this),this.fieldErrorObserverListener.bind(this)),w.register(m.getSubject(this.selectionChipGroup,u),this.fieldErrorObserver))}disconnectedCallback(){this.selectionChipGroup&&w.unregister(m.getSubject(this.selectionChipGroup,u),this.fieldErrorObserver)}canAcceptFieldErrorObserver(){return!0}fieldErrorObserverListener(e){this.showError=e.showError}}W([s({writable:!0})],M.prototype,"showError",void 0),W([s()],M.prototype,"host",void 0),W([l("connectedCallback")],M.prototype,"connectedCallback",null),W([l("disconnectedCallback")],M.prototype,"disconnectedCallback",null);var _=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 l=e.length-1;l>=0;l--)(a=e[l])&&(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 H=class{constructor(e){i(this,e),this.vegaChange=o(this,"vegaChange",7),this.change=o(this,"change",7),this.globalSlimmers={},this.renderer=new L,this.checkedController=new F,this.stateController=new G,this.showErrorController=new M,this.pageResizeObserverSlimmer=new j,this.vegaComponentUsageRuntimeMetricsSlimmer=new h,this.changeEventEmitter=C(H,k),this.showError=!1,this.currentBreakpoint=y(),this.label="",this.size="medium",this.variant="text",this.disabled=!1,this.block=!1,this.swatchColor="bg-status-info"}watchSize(){}componentWillRender(){}render(){return r(this.renderer.render(),this.host)}get host(){return a(this)}static get watchers(){return{size:["watchSize"]}}};_([p()],H.prototype,"globalSlimmers",void 0),_([d()],H.prototype,"renderer",void 0),_([d()],H.prototype,"checkedController",void 0),_([d()],H.prototype,"stateController",void 0),_([d()],H.prototype,"showErrorController",void 0),_([d()],H.prototype,"pageResizeObserverSlimmer",void 0),_([d()],H.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),_([d()],H.prototype,"changeEventEmitter",void 0),H.style=":host(.block){display:block}:host(.block) vega-tooltip{display:block}:host{max-width:100%;display:inline-block;vertical-align:middle;line-height:0}:host vega-tooltip{max-width:100%}:host .swatch{margin:2px;padding:1px;box-sizing:border-box}:host .swatch vega-box{width:100%;height:100%}:host .label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host .vega-selection-chip{background-color:rgba(var(--v-bg-tile, 252, 252, 252, 1));cursor:pointer;margin:1px}:host .variant-text .label{text-align:center}:host .size-extra-small.variant-swatch.vega-selection-chip{padding-top:2px;padding-bottom:2px;padding-left:2px;padding-right:12px}:host .size-extra-small.variant-text.vega-selection-chip{padding-left:12px;padding-right:12px;padding-top:2px;padding-bottom:2px}:host .size-extra-small vega-flex{height:16px}:host .size-extra-small .swatch{width:12px;height:12px}:host .size-small.variant-swatch.vega-selection-chip{padding-top:4px;padding-bottom:4px;padding-left:4px;padding-right:12px}:host .size-small.variant-text.vega-selection-chip{padding-left:12px;padding-right:12px;padding-top:4px;padding-bottom:4px}:host .size-small vega-flex{height:24px}:host .size-small .swatch{width:20px;height:20px}:host .size-medium.variant-swatch.vega-selection-chip{padding-top:4px;padding-bottom:4px;padding-left:4px;padding-right:16px}:host .size-medium.variant-text.vega-selection-chip{padding-left:16px;padding-right:16px;padding-top:4px;padding-bottom:4px}:host .size-medium vega-flex{height:32px}:host .size-medium .swatch{width:28px;height:28px}:host .size-large.variant-swatch.vega-selection-chip{padding-top:4px;padding-bottom:4px;padding-left:4px;padding-right:20px}:host .size-large.variant-text.vega-selection-chip{padding-left:20px;padding-right:20px;padding-top:4px;padding-bottom:4px}:host .size-large vega-flex{height:40px}:host .size-large .swatch{width:36px;height:36px}:host .vega-selection-chip:not(.disabled){background-color:rgba(var(--v-bg-tile, 252, 252, 252, 1));border:1px solid rgba(var(--v-border-tile, 171, 198, 216, 1))}:host .vega-selection-chip:not(.disabled):hover{background-color:rgba(var(--v-bg-tile-hover, 245, 247, 247, 1));border:1px solid rgba(var(--v-border-tile-hover, 115, 160, 190, 1))}:host .vega-selection-chip:not(.disabled):focus-visible{background-color:rgba(var(--v-bg-tile, 252, 252, 252, 1));outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:2px;border:1px solid rgba(var(--v-border-tile-focus, 19, 98, 226, 1))}:host .vega-selection-chip:not(.disabled).checked{background-color:rgba(var(--v-bg-tile-selected, 242, 247, 255, 1));border:2px solid rgba(var(--v-border-tile-selected, 19, 98, 226, 1));margin:0px}:host .vega-selection-chip:not(.disabled).checked:hover{background-color:rgba(var(--v-bg-tile-selected-hover, 229, 239, 255, 1));border:2px solid rgba(var(--v-border-tile-selected-hover, 4, 112, 236, 1))}:host .vega-selection-chip:not(.disabled).checked:focus-visible{background-color:rgba(var(--v-bg-tile-selected, 242, 247, 255, 1));border:2px solid rgba(var(--v-border-tile-selected-focus, 19, 98, 226, 1))}:host .vega-selection-chip:not(.disabled).error{background-color:rgba(var(--v-bg-tile, 252, 252, 252, 1));border:1px solid rgba(var(--v-border-input-field-danger, 230, 50, 87, 1))}:host .vega-selection-chip:not(.disabled).error:hover{background-color:rgba(var(--v-bg-tile-hover, 245, 247, 247, 1));border:1px solid rgba(var(--v-border-input-field-danger-hover, 255, 87, 114, 1))}:host .vega-selection-chip:not(.disabled).error:focus-visible{background-color:rgba(var(--v-bg-tile, 252, 252, 252, 1));outline:2px solid rgba(var(--v-border-color-danger, 230, 50, 87, 1));outline-offset:2px;border:1px solid rgba(var(--v-border-input-field-danger-focus, 233, 71, 104, 1))}:host .vega-selection-chip.disabled{background-color:rgba(var(--v-bg-tile, 252, 252, 252, 1));border:1px solid rgba(var(--v-border-input-field-disabled, 222, 225, 227, 1));pointer-events:none;color:rgba(var(--v-text-disabled, 176, 180, 181, 1))}:host .vega-selection-chip.disabled:focus-visible{outline:none}:host .vega-selection-chip.disabled vega-font{color:rgba(var(--v-text-disabled, 176, 180, 181, 1))}:host .vega-selection-chip.disabled .swatch{opacity:0.5}";var P=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 l=e.length-1;l>=0;l--)(a=e[l])&&(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 $ extends n{getGroupContainerRef(){return this.groupContainerRef}render(){return e("div",null,this.renderLabel(),this.renderContainer(),this.renderHint())}renderLabel(){return e("vega-field-label",{"is-field-required":this.required,disabled:this.disabled,optional:this.optional,label:this.label})}renderContainer(){return e("div",{class:"container",ref:e=>this.groupContainerRef=e},e("slot",null))}renderHint(){return this.hint&&e("div",{class:"vega-hint"},e("label",null,this.hint))}}P([s()],$.prototype,"host",void 0),P([s()],$.prototype,"label",void 0),P([s()],$.prototype,"required",void 0),P([s()],$.prototype,"optional",void 0),P([s()],$.prototype,"hint",void 0),P([s()],$.prototype,"disabled",void 0);var q=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 l=e.length-1;l>=0;l--)(a=e[l])&&(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 U extends n{watchValue(){this.changeEventEmitter.emit(this.value),w.notify(R,{host:this.host,detail:this.value})}setValue(e){this.valueGuard(e)&&(this.value=e)}valueGuard(e){switch(this.selectType){case"radio":return"string"==typeof e;case"checkbox":return Array.isArray(e)&&e.every((e=>"string"==typeof e));default:return c.warn(`Invalid selection chip group value ${e} for ${this.selectType} mode`),!1}}}q([s()],U.prototype,"host",void 0),q([s({writable:!0})],U.prototype,"value",void 0),q([s()],U.prototype,"changeEventEmitter",void 0),q([s()],U.prototype,"selectType",void 0),q([l("watchValue")],U.prototype,"watchValue",null);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 l=e.length-1;l>=0;l--)(a=e[l])&&(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 n{constructor(){super(...arguments),this.mutationObserver=new z({target:()=>this.host,options:{childList:!0,subtree:!0,attributes:!0,attributeFilter:["checked"]},mutationFilter:S("VEGA-SELECTION-CHIP"),callback:this.syncChipArrayAndValue.bind(this)}),this.selectionChipArray=[]}disconnectedCallback(){}componentWillLoad(){this.value&&0!==this.value.length||this.syncChipArrayAndValue()}componentDidLoad(){}watchSelectType(){this.syncChipArrayAndValue()}getSelectionChipArray(){return this.selectionChipArray}syncChipArrayAndValue(e){this.selectionChipArray=Array.from(this.host.querySelectorAll("vega-selection-chip")),"checkbox"===this.selectType?this.setValueFromCheckboxItems():this.setValueFromRadioItems(e)}setValueFromCheckboxItems(){const e=this.selectionChipArray.filter((e=>e.checked)).map((e=>e.value));O(this.value,e,!0)||this.valueController.setValue(e)}setValueFromRadioItems(e){const t=this.findAttributeMutation(e);if(t){const e=this.getCurrentChip(t);e&&e.checked&&this.valueController.setValue(e.value)}else{const e=this.getFirstCheckedChip();this.valueController.setValue(e?e.value:"")}}findAttributeMutation(e){return e&&e.find((e=>e.attributeName))}getCurrentChip(e){if(e&&"VEGA-SELECTION-CHIP"===e.target.tagName&&"checked"===e.attributeName)return e.target}getFirstCheckedChip(){return this.selectionChipArray.find((e=>e.checked))}}K([s()],B.prototype,"host",void 0),K([s()],B.prototype,"selectType",void 0),K([s()],B.prototype,"valueController",void 0),K([s()],B.prototype,"value",void 0),K([d()],B.prototype,"mutationObserver",void 0),K([l("disconnectedCallback")],B.prototype,"disconnectedCallback",null),K([l("componentWillLoad")],B.prototype,"componentWillLoad",null),K([l("componentDidLoad")],B.prototype,"componentDidLoad",null),K([l("watchSelectType")],B.prototype,"watchSelectType",null);var J=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 l=e.length-1;l>=0;l--)(a=e[l])&&(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 Q=class{constructor(e){i(this,e),this.vegaChange=o(this,"vegaChange",7),this.change=o(this,"change",7),this.globalSlimmers={},this.renderer=new $,this.itemsController=new B,this.valueController=new U,this.formFieldController=new I({propertyRules:[{propertyName:"required",ruleFactory:e=>e?new V:null}],validationRulesName:"validationRules",inputContainerGetter:()=>this.renderer.getGroupContainerRef(),touchableAreaGetter:()=>this.itemsController.getSelectionChipArray(),defaultValue:e=>"checkbox"===e.selectType?[]:"",attributeGetter:e=>this[e]}),this.vegaComponentUsageRuntimeMetricsSlimmer=new h,this.changeEventEmitter=C(Q,k),this.valueNotifySlimmer=E(Q,"value","watchValue"),this.disabledNotifySlimmer=E(Q,"disabled","watchDisabled"),this.selectTypeNotifySlimmer=E(Q,"selectType","watchSelectType"),this.changeEventPrevent=new T([k],(()=>this.host),!0),this.label="",this.selectType="radio",this.value="checkbox"===this.selectType?[]:"",this.optional=!1,this.name="",this.validationRules=[],this.isValid=null}watchSelectType(){}watchValue(){}watchDisabled(){}watchValidationRules(){}render(){return r(e(t,null,this.renderer.render()),this.host)}get host(){return a(this)}static get watchers(){return{selectType:["watchSelectType"],value:["watchValue"],disabled:["watchDisabled"],validationRules:["watchValidationRules"]}}};J([p()],Q.prototype,"globalSlimmers",void 0),J([d()],Q.prototype,"renderer",void 0),J([d()],Q.prototype,"itemsController",void 0),J([d()],Q.prototype,"valueController",void 0),J([d()],Q.prototype,"formFieldController",void 0),J([d()],Q.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),J([d()],Q.prototype,"changeEventEmitter",void 0),J([d()],Q.prototype,"valueNotifySlimmer",void 0),J([d()],Q.prototype,"disabledNotifySlimmer",void 0),J([d()],Q.prototype,"selectTypeNotifySlimmer",void 0),J([d()],Q.prototype,"changeEventPrevent",void 0),Q.style=':host{display:block}:host vega-field-label{margin-bottom:8px}:host .vega-hint{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:4px;padding-left:8px;padding-right:8px}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-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){:host .vega-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){:host .vega-hint{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}:host .vega-error{display:block;margin-top:12px;margin-left:8px;margin-right: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){:host .vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}:host .vega-hidden{display:none}';export{H as vega_selection_chip,Q as vega_selection_chip_group}
@@ -0,0 +1 @@
1
+ import{h as t,r as e,c as i,H as s,g as o}from"./p-6b2342e0.js";import{s as r}from"./p-519a7d55.js";import{c as a,V as p,M as n,I as l}from"./p-6e1ab235.js";import{V as h,I as m}from"./p-8ce9e214.js";import{D as c}from"./p-526e3634.js";import{d as f,M as u}from"./p-5447a8e8.js";import{n as d,c as v,b as j}from"./p-262ec334.js";import{C as b}from"./p-2c737fc8.js";import{c as w}from"./p-66647244.js";import{F as x}from"./p-cb378636.js";import{C as y}from"./p-2d0d575f.js";import{K as R}from"./p-d609c3fd.js";import{F as C}from"./p-e1029acc.js";import{R as g}from"./p-8bc15ed0.js";import{c as I}from"./p-3f183b52.js";import{M as V,a as N}from"./p-f0ff4463.js";import"./p-331a62d5.js";import"./p-528748fa.js";import"./p-8c30a60d.js";import"./p-5f377954.js";import"./p-87a4d75f.js";import"./p-982747ef.js";import"./p-6a334573.js";import"./p-b75ee3ba.js";import"./p-6c95a6a3.js";import"./p-456f678b.js";import"./p-ed45b3b6.js";import"./p-d4ea8e22.js";import"./p-b438e68b.js";import"./p-874e5624.js";import"./p-02841589.js";import"./p-8b5d3a52.js";import"./p-3a68b729.js";import"./p-f0e828d8.js";import"./p-81dd00d0.js";import"./p-49a2e141.js";import"./p-abd7aeaa.js";import"./p-71909102.js";import"./p-78a57a17.js";import"./p-52b8f2d2.js";import"./p-d27ae9ff.js";import"./p-29e3eb12.js";var T=function(t,e,i,s){var o,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var p=t.length-1;p>=0;p--)(o=t[p])&&(a=(r<3?o(a):r>3?o(e,i,a):o(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};class S extends p{constructor(){super(...arguments),this.onInputChange=t=>{this.valueController.updateValue(t.detail)},this.onInputBlur=t=>{const e=t.host.value.replace(/,/g,"");if(""!==e&&!isNaN(e)){let t=d(Number(e),this.min,this.max);this.integerOnly&&(t===this.min?t=Math.ceil(this.min):t===this.max&&(t=Math.floor(this.max))),t!==Number(e)&&this.valueController.updateValue(t.toString())}}}getInputRef(){return this.vegaInputRef.shadowRoot.querySelector("input")}getContainerRef(){return this.vegaInputRef.shadowRoot.querySelector(".vega-input-container")}render(){const e={thousandComma:this.thousandComma};return this.integerOnly&&(e.precision=0),t("vega-input",{value:this.value||"",showClearIcon:this.showClearIcon,disabled:this.disabled,label:this.label,hint:this.hint,required:this.required,optional:this.optional,type:"number",placeholder:this.placeholder,size:"small"===this.size?"small":"default",prefixIcon:this.prefixIcon,ref:t=>{this.vegaInputRef=t,c.addUniqueObserverToNode(t,f,(t=>this.onInputChange(t))),c.addUniqueObserverToNode(t,u,(t=>this.onInputBlur(t)))},maskConfig:{type:"number",options:e}})}}T([a()],S.prototype,"prefixIcon",void 0),T([a()],S.prototype,"showClearIcon",void 0),T([a()],S.prototype,"value",void 0),T([a()],S.prototype,"size",void 0),T([a()],S.prototype,"disabled",void 0),T([a()],S.prototype,"placeholder",void 0),T([a()],S.prototype,"label",void 0),T([a()],S.prototype,"optional",void 0),T([a()],S.prototype,"hint",void 0),T([a()],S.prototype,"required",void 0),T([a()],S.prototype,"thousandComma",void 0),T([a()],S.prototype,"integerOnly",void 0),T([a()],S.prototype,"min",void 0),T([a()],S.prototype,"max",void 0),T([a()],S.prototype,"valueController",void 0);var O=function(t,e,i,s){var o,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var p=t.length-1;p>=0;p--)(o=t[p])&&(a=(r<3?o(a):r>3?o(e,i,a):o(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};class k extends p{watchValue(){this.changeEventEmitter.emit(this.value),y.notify(x,{host:this.host,detail:this.value})}updateValue(t){this.value=t}}O([a()],k.prototype,"host",void 0),O([a({writable:!0})],k.prototype,"value",void 0),O([a()],k.prototype,"changeEventEmitter",void 0),O([n("watchValue")],k.prototype,"watchValue",null);var E=function(t,e,i,s){var o,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var p=t.length-1;p>=0;p--)(o=t[p])&&(a=(r<3?o(a):r>3?o(e,i,a):o(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};class M extends R{constructor(){super((t=>[{keyCode:["ArrowUp","ArrowDown"],activeElementInScope:[t.host],callback:t.onArrowUpOrDown},{keyCode:["ArrowUp"],eventName:"keydown",activeElementInScope:[t.host],callback:t=>{t.preventDefault()}}])),this.onArrowUpOrDown=t=>{const e=t.shiftKey?this.majorIncrement:this.minorIncrement,i=v(this.value.replace(/,/g,""))||0,s=Math.max(j(i),j(e));"ArrowUp"===t.code?this.valueController.updateValue(`${(i+e).toFixed(s)}`):"ArrowDown"===t.code&&this.valueController.updateValue(`${(i-e).toFixed(s)}`)}}}E([a()],M.prototype,"host",void 0),E([a()],M.prototype,"value",void 0),E([a()],M.prototype,"minorIncrement",void 0),E([a()],M.prototype,"majorIncrement",void 0),E([a()],M.prototype,"valueController",void 0);var A=function(t,e,i,s){var o,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var p=t.length-1;p>=0;p--)(o=t[p])&&(a=(r<3?o(a):r>3?o(e,i,a):o(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};const F=class{constructor(t){e(this,t),this.vegaChange=i(this,"vegaChange",7),this.change=i(this,"change",7),this.globalSlimmers={},this.valueController=new k,this.keyboardController=new M,this.renderer=new S,this.changeEventEmitter=w(F,f),this.inputEventPrevent=new b([f],(()=>this.host),{useCapture:!0}),this.formFieldController=new C({propertyRules:[{propertyName:"required",ruleFactory:t=>t?new g:null},{propertyName:"min",ruleFactory:t=>"number"==typeof t?new V({minValue:t}):null},{propertyName:"max",ruleFactory:t=>"number"==typeof t?new N({maxValue:t}):null}],validationRulesName:"validationRules",inputContainerGetter:()=>this.renderer.getContainerRef(),touchableAreaGetter:()=>[this.renderer.getInputRef()],defaultValue:"",attributeGetter:t=>this[t]}),this.prefixTextNotifySlimmer=I(F,"prefixText","watchPrefixText"),this.suffixTextNotifySlimmer=I(F,"suffixText","watchSuffixText"),this.isCompactInputWidthNotifySlimmer=I(F,"isCompactInputWidth"),this.vegaComponentUsageRuntimeMetricsSlimmer=new h,this.isCompactInputWidth=!0,this.prefixText="",this.value="",this.size="medium",this.thousandComma=!1,this.integerOnly=!1,this.disabled=!1,this.minorIncrement=1,this.majorIncrement=10,this.label="",this.optional=!1,this.name="",this.validationRules=[],this.isValid=null,this.autoValidation=!0,this.showClearIcon=!0,this.min=null,this.max=null}watchPrefixText(){}watchSuffixText(){}watchValue(){}watchValidationRules(){}render(){return r(t(s,null,this.renderer.render()),this.host)}get host(){return o(this)}static get watchers(){return{prefixText:["watchPrefixText"],suffixText:["watchSuffixText"],value:["watchValue"],validationRules:["watchValidationRules"]}}};A([m()],F.prototype,"globalSlimmers",void 0),A([l()],F.prototype,"valueController",void 0),A([l()],F.prototype,"keyboardController",void 0),A([l()],F.prototype,"renderer",void 0),A([l()],F.prototype,"changeEventEmitter",void 0),A([l()],F.prototype,"inputEventPrevent",void 0),A([l()],F.prototype,"formFieldController",void 0),A([l()],F.prototype,"prefixTextNotifySlimmer",void 0),A([l()],F.prototype,"suffixTextNotifySlimmer",void 0),A([l()],F.prototype,"isCompactInputWidthNotifySlimmer",void 0),A([l()],F.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),F.style=":host{display:inline-block;width:100%}";export{F as vega_input_numeric}