@heartlandone/vega 2.86.0 → 2.87.0-beta.1

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 (481) hide show
  1. package/dist/cjs/{accessibility-a5ef2038.js → accessibility-88f8af84.js} +16 -1
  2. package/dist/cjs/{app-globals-3080f55a.js → app-globals-885090b1.js} +11 -11
  3. package/dist/cjs/{aria-dialog-focusable-trap-slimmer-5507f917.js → aria-dialog-focusable-trap-slimmer-c2ca46db.js} +3 -3
  4. package/dist/cjs/{child-nodes-event-prevent-slimmer-f3979a03.js → child-nodes-event-prevent-slimmer-b7498e5a.js} +2 -2
  5. package/dist/cjs/{child-nodes-notify-observer-slimmer-2631c381.js → child-nodes-notify-observer-slimmer-34a606b3.js} +1 -1
  6. package/dist/cjs/{code-block-c6c70464.js → code-block-15411c14.js} +13 -4
  7. package/dist/cjs/{component-usage-runtime-metrics-4572c5b7.js → component-usage-runtime-metrics-389d1548.js} +1 -1
  8. package/dist/cjs/{component-value-history-controller-slimmer.abstract-a523b747.js → component-value-history-controller-slimmer.abstract-5218e4b3.js} +6 -6
  9. package/dist/cjs/{content-state-efd3b1a7.js → content-state-a69d99b4.js} +5 -5
  10. package/dist/cjs/{create-public-api-runtime-metrics-slimmer-9cb09fb2.js → create-public-api-runtime-metrics-slimmer-122350c3.js} +1 -1
  11. package/dist/cjs/{date-required-rule-0dd83683.js → date-required-rule-d65727c5.js} +1 -1
  12. package/dist/cjs/{design-token-4b3509dd.js → design-token-3bc36220.js} +3 -3
  13. package/dist/cjs/{dom-node-subject-observer-factory-9110cb94.js → dom-node-subject-observer-factory-ba6a95f3.js} +1 -1
  14. package/dist/cjs/{element-appender-slimmer-2b4e0a62.js → element-appender-slimmer-f86e6811.js} +6 -6
  15. package/dist/cjs/{event-emit-slimmer-80e1c8ca.js → event-emit-slimmer-73c42d7e.js} +2 -2
  16. package/dist/cjs/{feature-flag-controller-9129ef52.js → feature-flag-controller-5fa21654.js} +1 -1
  17. package/dist/cjs/{form-field-controller-slimmer-a07e3de0.js → form-field-controller-slimmer-44091874.js} +5 -5
  18. package/dist/cjs/{icon-manager-c12c6ea9.js → icon-manager-e855446d.js} +1 -1
  19. package/dist/cjs/{image-annotation-action-93bace08.js → image-annotation-action-aad07357.js} +5 -5
  20. package/dist/cjs/index.cjs.js +26 -25
  21. package/dist/cjs/{inject-keyboard-manager-ff8735b8.js → inject-keyboard-manager-d06b337e.js} +1 -1
  22. package/dist/cjs/{internal-icon-manager-c989189a.js → internal-icon-manager-66c48800.js} +1 -1
  23. package/dist/cjs/{internal-translation-controller-8360a89c.js → internal-translation-controller-f0da24b2.js} +5 -0
  24. package/dist/cjs/{internal-vega-event-manager-7e0d966d.js → internal-vega-event-manager-063c17cb.js} +5 -2
  25. package/dist/cjs/{keyboard-manager-cc446230.js → keyboard-manager-1e045791.js} +2 -2
  26. package/dist/cjs/{keyboard-manager-slimmer-a10b7d6f.js → keyboard-manager-slimmer-861d991f.js} +1 -1
  27. package/dist/cjs/loader.cjs.js +20 -20
  28. package/dist/cjs/{month-view-generator-41b6c6b6.js → month-view-generator-8ed9818e.js} +1 -1
  29. package/dist/cjs/{public-rules-3cd0f182.js → public-rules-c7726702.js} +10 -10
  30. package/dist/cjs/{range-c9bde0b4.js → range-d6fb50a4.js} +2 -2
  31. package/dist/cjs/{responsive-format-facade-5f6cd211.js → responsive-format-facade-9647775d.js} +2 -2
  32. package/dist/cjs/{rich-text-editor-required-rule-d1f0509c.js → rich-text-editor-required-rule-a1a070ce.js} +1 -1
  33. package/dist/cjs/{split-cell-operation-6a59c9b0.js → split-cell-operation-39b19943.js} +5 -5
  34. package/dist/cjs/{state-border-formatter-d1c80c1d.js → state-border-formatter-1a483a9b.js} +1 -1
  35. package/dist/cjs/{string-format-strategy.abstract-b39da0dd.js → string-format-strategy.abstract-2aec209d.js} +1 -1
  36. package/dist/cjs/{string-input-formatter-slimmer-127cf2b8.js → string-input-formatter-slimmer-e061bd10.js} +4 -4
  37. package/dist/cjs/{string-mask-strategy-524d0f69.js → string-mask-strategy-4bc07c00.js} +2 -2
  38. package/dist/cjs/{style-formatter-c201e7d0.js → style-formatter-263d5eb6.js} +2 -2
  39. package/dist/cjs/{sub-state-notify-slimmer-b33171b0.js → sub-state-notify-slimmer-757e3a76.js} +2 -2
  40. package/dist/cjs/{sub-state-observer-slimmer-b8f6f27b.js → sub-state-observer-slimmer-aa93ab4f.js} +3 -3
  41. package/dist/cjs/{time-required-rule-ecb45905.js → time-required-rule-f9a7e897.js} +1 -1
  42. package/dist/cjs/{token-extension-d7d2ead6.js → token-extension-927062b9.js} +12 -12
  43. package/dist/cjs/{translation-slimmer-3cd7d3b2.js → translation-slimmer-a4a7f0eb.js} +1 -1
  44. package/dist/cjs/{type-guard-2e97fc56.js → type-guard-c1195e50.js} +1 -1
  45. package/dist/cjs/{ui-ae4ee13d.js → ui-3727d685.js} +13 -0
  46. package/dist/cjs/{valid-credit-card-number-rule-2d7d20ce.js → valid-credit-card-number-rule-22f3e6cf.js} +1 -1
  47. package/dist/cjs/vega-accordion.cjs.entry.js +35 -17
  48. package/dist/cjs/vega-app-footer.cjs.entry.js +1 -1
  49. package/dist/cjs/vega-app-header-button.cjs.entry.js +17 -17
  50. package/dist/cjs/vega-backdrop.cjs.entry.js +2 -2
  51. package/dist/cjs/vega-banner.cjs.entry.js +12 -12
  52. package/dist/cjs/vega-bar-chart.cjs.entry.js +1 -1
  53. package/dist/cjs/vega-box.cjs.entry.js +10 -10
  54. package/dist/cjs/vega-brand-logo.cjs.entry.js +4 -4
  55. package/dist/cjs/vega-breadcrumb.cjs.entry.js +9 -9
  56. package/dist/cjs/vega-button-circle.cjs.entry.js +15 -15
  57. package/dist/cjs/vega-button-group_2.cjs.entry.js +12 -12
  58. package/dist/cjs/vega-button-link.cjs.entry.js +9 -9
  59. package/dist/cjs/vega-button.cjs.entry.js +13 -13
  60. package/dist/cjs/vega-calendar_4.cjs.entry.js +665 -344
  61. package/dist/cjs/vega-card.cjs.entry.js +9 -9
  62. package/dist/cjs/vega-carousel.cjs.entry.js +12 -12
  63. package/dist/cjs/vega-checkbox_2.cjs.entry.js +28 -16
  64. package/dist/cjs/vega-chip.cjs.entry.js +15 -15
  65. package/dist/cjs/vega-code-block.cjs.entry.js +21 -21
  66. package/dist/cjs/vega-color-picker.cjs.entry.js +11 -11
  67. package/dist/cjs/vega-color-swatch-picker.cjs.entry.js +17 -17
  68. package/dist/cjs/vega-color-swatch.cjs.entry.js +9 -9
  69. package/dist/cjs/vega-combo-box.cjs.entry.js +17 -17
  70. package/dist/cjs/vega-counter-badge.cjs.entry.js +1 -1
  71. package/dist/cjs/vega-date-picker_2.cjs.entry.js +30 -30
  72. package/dist/cjs/{vega-dialog-controller-03ef4d9a.js → vega-dialog-controller-6df7825e.js} +1 -1
  73. package/dist/cjs/vega-dialog_2.cjs.entry.js +15 -15
  74. package/dist/cjs/vega-divider.cjs.entry.js +8 -8
  75. package/dist/cjs/vega-dropdown_5.cjs.entry.js +23 -23
  76. package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
  77. package/dist/cjs/{vega-event-id-d9994eb3.js → vega-event-id-f95480b7.js} +2 -0
  78. package/dist/cjs/vega-field-error.cjs.entry.js +1 -1
  79. package/dist/cjs/vega-field-label.cjs.entry.js +7 -7
  80. package/dist/cjs/vega-file-uploader.cjs.entry.js +15 -15
  81. package/dist/cjs/vega-flag-icon.cjs.entry.js +11 -11
  82. package/dist/cjs/vega-flex.cjs.entry.js +10 -10
  83. package/dist/cjs/vega-font.cjs.entry.js +9 -9
  84. package/dist/cjs/vega-form.cjs.entry.js +16 -16
  85. package/dist/cjs/vega-grid.cjs.entry.js +9 -9
  86. package/dist/cjs/vega-hint.cjs.entry.js +1 -1
  87. package/dist/cjs/vega-icon.cjs.entry.js +11 -11
  88. package/dist/cjs/vega-image-uploader.cjs.entry.js +19 -19
  89. package/dist/cjs/vega-input-credit-card.cjs.entry.js +20 -20
  90. package/dist/cjs/vega-input-numeric.cjs.entry.js +17 -17
  91. package/dist/cjs/vega-input-passcode.cjs.entry.js +16 -16
  92. package/dist/cjs/vega-input-phone-number.cjs.entry.js +18 -18
  93. package/dist/cjs/vega-input-range.cjs.entry.js +15 -15
  94. package/dist/cjs/vega-input-select.cjs.entry.js +20 -20
  95. package/dist/cjs/vega-input.cjs.entry.js +19 -19
  96. package/dist/cjs/{vega-internal-event-id-87014e4f.js → vega-internal-event-id-e138d4d6.js} +2 -0
  97. package/dist/cjs/vega-item-toggle.cjs.entry.js +6 -6
  98. package/dist/cjs/vega-left-nav_5.cjs.entry.js +21 -21
  99. package/dist/cjs/vega-line-chart.cjs.entry.js +2 -2
  100. package/dist/cjs/vega-loader-wrapper_2.cjs.entry.js +7 -7
  101. package/dist/cjs/vega-page-notification_2.cjs.entry.js +5 -5
  102. package/dist/cjs/vega-pagination-page-selector-mobile.cjs.entry.js +9 -9
  103. package/dist/cjs/vega-pagination-page-size-selector-mobile.cjs.entry.js +7 -7
  104. package/dist/cjs/vega-pagination.cjs.entry.js +14 -14
  105. package/dist/cjs/vega-pie-chart.cjs.entry.js +1 -1
  106. package/dist/cjs/vega-popover_2.cjs.entry.js +18 -18
  107. package/dist/cjs/vega-progress-tracker_2.cjs.entry.js +15 -15
  108. package/dist/cjs/vega-radio_2.cjs.entry.js +18 -18
  109. package/dist/cjs/vega-rich-text-content.cjs.entry.js +16 -16
  110. package/dist/cjs/vega-rich-text-editor_4.cjs.entry.js +30 -37
  111. package/dist/cjs/vega-rich-text-table-properties_3.cjs.entry.js +21 -21
  112. package/dist/cjs/vega-section-title.cjs.entry.js +1 -1
  113. package/dist/cjs/vega-segment-control.cjs.entry.js +6 -6
  114. package/dist/cjs/vega-selection-chip_2.cjs.entry.js +17 -17
  115. package/dist/cjs/vega-selection-tile_2.cjs.entry.js +15 -15
  116. package/dist/cjs/vega-sidenav_3.cjs.entry.js +18 -18
  117. package/dist/cjs/vega-signature-capture.cjs.entry.js +20 -20
  118. package/dist/cjs/vega-skeleton.cjs.entry.js +1 -1
  119. package/dist/cjs/vega-slot-container.cjs.entry.js +1 -1
  120. package/dist/cjs/vega-stepper.cjs.entry.js +13 -13
  121. package/dist/cjs/vega-tab-group_2.cjs.entry.js +156 -70
  122. package/dist/cjs/vega-table_11.cjs.entry.js +20 -20
  123. package/dist/cjs/vega-text.cjs.entry.js +2 -2
  124. package/dist/cjs/vega-textarea.cjs.entry.js +13 -13
  125. package/dist/cjs/vega-time-picker_2.cjs.entry.js +21 -21
  126. package/dist/cjs/vega-toggle-switch.cjs.entry.js +11 -11
  127. package/dist/cjs/vega-tooltip_2.cjs.entry.js +12 -12
  128. package/dist/cjs/vega.cjs.js +20 -20
  129. package/dist/cjs/{wait-for-component-did-render-16863a21.js → wait-for-component-did-render-a13f7eb9.js} +2 -2
  130. package/dist/collection/collection-manifest.json +1 -1
  131. package/dist/collection/components/vega-accordion/slimmers/vega-accordion-renderer.js +14 -1
  132. package/dist/collection/components/vega-accordion/vega-accordion.js +5 -0
  133. package/dist/collection/components/vega-calendar/slimmers/common/controllers/vega-calendar-event-preview-actions-controller.js +83 -0
  134. package/dist/collection/components/vega-calendar/slimmers/common/controllers/vega-calendar-keyboard-controller.js +154 -0
  135. package/dist/collection/components/vega-calendar/slimmers/common/renderers/vega-calendar-event-item-renderer.js +4 -0
  136. package/dist/collection/components/vega-calendar/slimmers/month-view/renderers/vega-calendar-month-event-renderer.js +10 -1
  137. package/dist/collection/components/vega-calendar/slimmers/month-view/renderers/vega-calendar-month-view-renderer.js +22 -3
  138. package/dist/collection/components/vega-calendar/vega-calendar-event-preview/assets/pen.js +3 -0
  139. package/dist/collection/components/vega-calendar/vega-calendar-event-preview/slimmers/controllers/vega-calendar-event-preview-state-controller.js +4 -0
  140. package/dist/collection/components/vega-calendar/vega-calendar-event-preview/slimmers/renderers/vega-calendar-event-preview-detail-renderer.js +37 -4
  141. package/dist/collection/components/vega-calendar/vega-calendar-event-preview/vega-calendar-event-preview.js +3 -1
  142. package/dist/collection/components/vega-calendar/vega-calendar.js +115 -1
  143. package/dist/collection/components/vega-checkbox/vega-checkbox.js +14 -2
  144. package/dist/collection/components/vega-dropdown/vega-dropdown-item/slimmers/renderers/vega-dropdown-item-renderer.js +1 -1
  145. package/dist/collection/components/vega-rich-text-editor/constants/constant.js +8 -0
  146. package/dist/collection/components/vega-rich-text-editor/public-api.js +1 -1
  147. package/dist/collection/components/vega-rich-text-editor/vega-rich-text-editor.js +3 -10
  148. package/dist/collection/components/vega-tab-group/slimmers/vega-tab-group/controllers/vega-tab-group-panel-controller.js +14 -1
  149. package/dist/collection/components/vega-tab-group/slimmers/vega-tab-group/controllers/vega-tab-group-voice-over-focus-controller.js +45 -0
  150. package/dist/collection/components/vega-tab-group/slimmers/vega-tab-group/renderers/vega-tab-group-close-button-renderer.js +15 -1
  151. package/dist/collection/components/vega-tab-group/slimmers/vega-tab-group/renderers/vega-tab-group-direction-button-renderer.js +1 -1
  152. package/dist/collection/components/vega-tab-group/slimmers/vega-tab-group/renderers/vega-tab-group-tab-list-renderer.js +16 -4
  153. package/dist/collection/components/vega-tab-group/vega-tab-group.js +5 -0
  154. package/dist/collection/constants/ui.js +1 -0
  155. package/dist/collection/helpers/event-manager/event-id/component-event-id-map.js +5 -2
  156. package/dist/collection/helpers/event-manager/event-id/vega-event-id.js +1 -0
  157. package/dist/collection/helpers/event-manager/event-id/vega-internal-event-id.js +1 -0
  158. package/dist/collection/helpers/translation/locales/en.js +5 -0
  159. package/dist/collection/polyfill/d3/d3-time-format-polyfill.js +1 -1
  160. package/dist/collection/utils/accessibility.js +16 -1
  161. package/dist/collection/utils/ui.js +12 -0
  162. package/dist/esm/{accessibility-524cabd2.js → accessibility-6af5cf2e.js} +16 -1
  163. package/dist/esm/{app-globals-37536ac9.js → app-globals-be458779.js} +11 -11
  164. package/dist/esm/{aria-dialog-focusable-trap-slimmer-6eb79723.js → aria-dialog-focusable-trap-slimmer-7d9a9f5a.js} +3 -3
  165. package/dist/esm/{child-nodes-event-prevent-slimmer-75f93d85.js → child-nodes-event-prevent-slimmer-0a406a71.js} +2 -2
  166. package/dist/esm/{child-nodes-notify-observer-slimmer-a8cb19cf.js → child-nodes-notify-observer-slimmer-8822d0d0.js} +1 -1
  167. package/dist/esm/{code-block-10be3916.js → code-block-ff52d912.js} +13 -5
  168. package/dist/esm/{component-usage-runtime-metrics-46020a03.js → component-usage-runtime-metrics-4b1afd04.js} +1 -1
  169. package/dist/esm/{component-value-history-controller-slimmer.abstract-82d51b7a.js → component-value-history-controller-slimmer.abstract-ad5f29cd.js} +6 -6
  170. package/dist/esm/{content-state-afeb700d.js → content-state-6fccd284.js} +5 -5
  171. package/dist/esm/{create-public-api-runtime-metrics-slimmer-aaadaa08.js → create-public-api-runtime-metrics-slimmer-da6615bf.js} +1 -1
  172. package/dist/esm/{date-required-rule-a84c21d4.js → date-required-rule-70324452.js} +1 -1
  173. package/dist/esm/{design-token-57de4f4f.js → design-token-0e6fb2c4.js} +3 -3
  174. package/dist/esm/{dom-node-subject-observer-factory-aca0116e.js → dom-node-subject-observer-factory-3897e95b.js} +1 -1
  175. package/dist/esm/{element-appender-slimmer-05f487d7.js → element-appender-slimmer-afe5a638.js} +6 -6
  176. package/dist/esm/{event-emit-slimmer-1c57093d.js → event-emit-slimmer-697ad0b7.js} +2 -2
  177. package/dist/esm/{feature-flag-controller-30f7b625.js → feature-flag-controller-5ebc0cec.js} +1 -1
  178. package/dist/esm/{form-field-controller-slimmer-ae8478b5.js → form-field-controller-slimmer-9e70a18d.js} +5 -5
  179. package/dist/esm/{icon-manager-539d7cf7.js → icon-manager-691c8682.js} +1 -1
  180. package/dist/esm/{image-annotation-action-bad7c565.js → image-annotation-action-245eaa54.js} +5 -5
  181. package/dist/esm/index.js +25 -25
  182. package/dist/esm/{inject-keyboard-manager-1ceb9ee0.js → inject-keyboard-manager-05d5db90.js} +1 -1
  183. package/dist/esm/{internal-icon-manager-bd80b3bb.js → internal-icon-manager-276f968f.js} +1 -1
  184. package/dist/esm/{internal-translation-controller-d7dee4a0.js → internal-translation-controller-d8217d93.js} +5 -0
  185. package/dist/esm/{internal-vega-event-manager-7cdf3c28.js → internal-vega-event-manager-1ac5ee9a.js} +5 -2
  186. package/dist/esm/{keyboard-manager-50a1d90e.js → keyboard-manager-26e2fc32.js} +2 -2
  187. package/dist/esm/{keyboard-manager-slimmer-3891ee20.js → keyboard-manager-slimmer-012a9a9b.js} +1 -1
  188. package/dist/esm/loader.js +20 -20
  189. package/dist/esm/{month-view-generator-70c597a6.js → month-view-generator-918f1f88.js} +1 -1
  190. package/dist/esm/polyfills/core-js.js +0 -0
  191. package/dist/esm/polyfills/dom.js +0 -0
  192. package/dist/esm/polyfills/es5-html-element.js +0 -0
  193. package/dist/esm/polyfills/index.js +0 -0
  194. package/dist/esm/polyfills/system.js +0 -0
  195. package/dist/esm/{public-rules-f54e6f39.js → public-rules-22320bdf.js} +10 -10
  196. package/dist/esm/{range-f32f9185.js → range-76f8e7dd.js} +2 -2
  197. package/dist/esm/{responsive-format-facade-456a9f16.js → responsive-format-facade-2a1d6398.js} +2 -2
  198. package/dist/esm/{rich-text-editor-required-rule-627fd7e4.js → rich-text-editor-required-rule-6eb90840.js} +1 -1
  199. package/dist/esm/{split-cell-operation-90c30861.js → split-cell-operation-7652e813.js} +5 -5
  200. package/dist/esm/{state-border-formatter-afac8d33.js → state-border-formatter-a243f3fc.js} +1 -1
  201. package/dist/esm/{string-format-strategy.abstract-f9907969.js → string-format-strategy.abstract-f6625ed7.js} +1 -1
  202. package/dist/esm/{string-input-formatter-slimmer-4059080b.js → string-input-formatter-slimmer-e801bd7e.js} +4 -4
  203. package/dist/esm/{string-mask-strategy-5f655300.js → string-mask-strategy-53cb9b33.js} +2 -2
  204. package/dist/esm/{style-formatter-ee52d8d0.js → style-formatter-a622a045.js} +2 -2
  205. package/dist/esm/{sub-state-notify-slimmer-63ecb465.js → sub-state-notify-slimmer-80ac7dee.js} +2 -2
  206. package/dist/esm/{sub-state-observer-slimmer-2adbbe00.js → sub-state-observer-slimmer-81538a8c.js} +3 -3
  207. package/dist/esm/{time-required-rule-db873c19.js → time-required-rule-2fd8df50.js} +1 -1
  208. package/dist/esm/{token-extension-728c0678.js → token-extension-5838c71b.js} +12 -12
  209. package/dist/esm/{translation-slimmer-5e2bff5f.js → translation-slimmer-32353a1c.js} +1 -1
  210. package/dist/esm/{type-guard-adc244fd.js → type-guard-ed1004cc.js} +1 -1
  211. package/dist/esm/{ui-b7600a48.js → ui-64815a12.js} +13 -1
  212. package/dist/esm/{valid-credit-card-number-rule-a826dd49.js → valid-credit-card-number-rule-7c9d6808.js} +1 -1
  213. package/dist/esm/vega-accordion.entry.js +35 -17
  214. package/dist/esm/vega-app-footer.entry.js +1 -1
  215. package/dist/esm/vega-app-header-button.entry.js +17 -17
  216. package/dist/esm/vega-backdrop.entry.js +2 -2
  217. package/dist/esm/vega-banner.entry.js +12 -12
  218. package/dist/esm/vega-bar-chart.entry.js +1 -1
  219. package/dist/esm/vega-box.entry.js +10 -10
  220. package/dist/esm/vega-brand-logo.entry.js +4 -4
  221. package/dist/esm/vega-breadcrumb.entry.js +9 -9
  222. package/dist/esm/vega-button-circle.entry.js +15 -15
  223. package/dist/esm/vega-button-group_2.entry.js +12 -12
  224. package/dist/esm/vega-button-link.entry.js +9 -9
  225. package/dist/esm/vega-button.entry.js +13 -13
  226. package/dist/esm/vega-calendar_4.entry.js +666 -345
  227. package/dist/esm/vega-card.entry.js +9 -9
  228. package/dist/esm/vega-carousel.entry.js +12 -12
  229. package/dist/esm/vega-checkbox_2.entry.js +28 -16
  230. package/dist/esm/vega-chip.entry.js +15 -15
  231. package/dist/esm/vega-code-block.entry.js +21 -21
  232. package/dist/esm/vega-color-picker.entry.js +11 -11
  233. package/dist/esm/vega-color-swatch-picker.entry.js +17 -17
  234. package/dist/esm/vega-color-swatch.entry.js +9 -9
  235. package/dist/esm/vega-combo-box.entry.js +17 -17
  236. package/dist/esm/vega-counter-badge.entry.js +1 -1
  237. package/dist/esm/vega-date-picker_2.entry.js +30 -30
  238. package/dist/esm/{vega-dialog-controller-bbb2fc52.js → vega-dialog-controller-389e7f7c.js} +1 -1
  239. package/dist/esm/vega-dialog_2.entry.js +15 -15
  240. package/dist/esm/vega-divider.entry.js +8 -8
  241. package/dist/esm/vega-dropdown_5.entry.js +23 -23
  242. package/dist/esm/vega-env-manager-8f8dc473.js +2 -2
  243. package/dist/esm/{vega-event-id-a6ccca66.js → vega-event-id-578c6c6d.js} +2 -1
  244. package/dist/esm/vega-field-error.entry.js +1 -1
  245. package/dist/esm/vega-field-label.entry.js +7 -7
  246. package/dist/esm/vega-file-uploader.entry.js +15 -15
  247. package/dist/esm/vega-flag-icon.entry.js +11 -11
  248. package/dist/esm/vega-flex.entry.js +10 -10
  249. package/dist/esm/vega-font.entry.js +9 -9
  250. package/dist/esm/vega-form.entry.js +16 -16
  251. package/dist/esm/vega-grid.entry.js +9 -9
  252. package/dist/esm/vega-hint.entry.js +1 -1
  253. package/dist/esm/vega-icon.entry.js +11 -11
  254. package/dist/esm/vega-image-uploader.entry.js +19 -19
  255. package/dist/esm/vega-input-credit-card.entry.js +20 -20
  256. package/dist/esm/vega-input-numeric.entry.js +17 -17
  257. package/dist/esm/vega-input-passcode.entry.js +16 -16
  258. package/dist/esm/vega-input-phone-number.entry.js +18 -18
  259. package/dist/esm/vega-input-range.entry.js +15 -15
  260. package/dist/esm/vega-input-select.entry.js +20 -20
  261. package/dist/esm/vega-input.entry.js +19 -19
  262. package/dist/esm/{vega-internal-event-id-db974a0d.js → vega-internal-event-id-913e8be6.js} +2 -1
  263. package/dist/esm/vega-item-toggle.entry.js +6 -6
  264. package/dist/esm/vega-left-nav_5.entry.js +21 -21
  265. package/dist/esm/vega-line-chart.entry.js +2 -2
  266. package/dist/esm/vega-loader-wrapper_2.entry.js +7 -7
  267. package/dist/esm/vega-page-notification_2.entry.js +5 -5
  268. package/dist/esm/vega-pagination-page-selector-mobile.entry.js +9 -9
  269. package/dist/esm/vega-pagination-page-size-selector-mobile.entry.js +7 -7
  270. package/dist/esm/vega-pagination.entry.js +14 -14
  271. package/dist/esm/vega-pie-chart.entry.js +1 -1
  272. package/dist/esm/vega-popover_2.entry.js +18 -18
  273. package/dist/esm/vega-progress-tracker_2.entry.js +15 -15
  274. package/dist/esm/vega-radio_2.entry.js +18 -18
  275. package/dist/esm/vega-rich-text-content.entry.js +16 -16
  276. package/dist/esm/vega-rich-text-editor_4.entry.js +30 -37
  277. package/dist/esm/vega-rich-text-table-properties_3.entry.js +21 -21
  278. package/dist/esm/vega-section-title.entry.js +1 -1
  279. package/dist/esm/vega-segment-control.entry.js +6 -6
  280. package/dist/esm/vega-selection-chip_2.entry.js +17 -17
  281. package/dist/esm/vega-selection-tile_2.entry.js +15 -15
  282. package/dist/esm/vega-sidenav_3.entry.js +18 -18
  283. package/dist/esm/vega-signature-capture.entry.js +20 -20
  284. package/dist/esm/vega-skeleton.entry.js +1 -1
  285. package/dist/esm/vega-slot-container.entry.js +1 -1
  286. package/dist/esm/vega-stepper.entry.js +13 -13
  287. package/dist/esm/vega-tab-group_2.entry.js +156 -70
  288. package/dist/esm/vega-table_11.entry.js +20 -20
  289. package/dist/esm/vega-text.entry.js +2 -2
  290. package/dist/esm/vega-textarea.entry.js +13 -13
  291. package/dist/esm/vega-time-picker_2.entry.js +21 -21
  292. package/dist/esm/vega-toggle-switch.entry.js +11 -11
  293. package/dist/esm/vega-tooltip_2.entry.js +12 -12
  294. package/dist/esm/vega.js +20 -20
  295. package/dist/esm/{wait-for-component-did-render-9a83d343.js → wait-for-component-did-render-4069cbea.js} +2 -2
  296. package/dist/sri/vega-sri-manifest.json +426 -426
  297. package/dist/types/components/vega-accordion/slimmers/vega-accordion-renderer.d.ts +2 -0
  298. package/dist/types/components/vega-accordion/vega-accordion.d.ts +2 -0
  299. package/dist/types/components/vega-calendar/slimmers/common/controllers/vega-calendar-event-preview-actions-controller.d.ts +36 -0
  300. package/dist/types/components/vega-calendar/slimmers/common/controllers/vega-calendar-keyboard-controller.d.ts +35 -0
  301. package/dist/types/components/vega-calendar/slimmers/common/renderers/vega-calendar-event-item-renderer.d.ts +1 -0
  302. package/dist/types/components/vega-calendar/slimmers/month-view/renderers/vega-calendar-month-event-renderer.d.ts +7 -0
  303. package/dist/types/components/vega-calendar/slimmers/month-view/renderers/vega-calendar-month-view-renderer.d.ts +16 -0
  304. package/dist/types/components/vega-calendar/types.d.ts +32 -0
  305. package/dist/types/components/vega-calendar/vega-calendar-event-preview/assets/pen.d.ts +3 -0
  306. package/dist/types/components/vega-calendar/vega-calendar-event-preview/slimmers/controllers/vega-calendar-event-preview-state-controller.d.ts +1 -0
  307. package/dist/types/components/vega-calendar/vega-calendar-event-preview/slimmers/renderers/vega-calendar-event-preview-detail-renderer.d.ts +6 -0
  308. package/dist/types/components/vega-calendar/vega-calendar-event-preview/types.d.ts +6 -0
  309. package/dist/types/components/vega-calendar/vega-calendar-event-preview/vega-calendar-event-preview.d.ts +2 -0
  310. package/dist/types/components/vega-calendar/vega-calendar.d.ts +34 -1
  311. package/dist/types/components/vega-checkbox/vega-checkbox.d.ts +2 -0
  312. package/dist/types/components/vega-rich-text-editor/constants/constant.d.ts +2 -1
  313. package/dist/types/components/vega-rich-text-editor/public-api.d.ts +1 -1
  314. package/dist/types/components/vega-tab-group/slimmers/vega-tab-group/controllers/vega-tab-group-voice-over-focus-controller.d.ts +23 -0
  315. package/dist/types/components/vega-tab-group/slimmers/vega-tab-group/renderers/vega-tab-group-close-button-renderer.d.ts +1 -0
  316. package/dist/types/components/vega-tab-group/slimmers/vega-tab-group/renderers/vega-tab-group-tab-list-renderer.d.ts +2 -0
  317. package/dist/types/components/vega-tab-group/vega-tab-group.d.ts +2 -0
  318. package/dist/types/components.d.ts +32 -1
  319. package/dist/types/constants/ui.d.ts +1 -1
  320. package/dist/types/helpers/event-manager/event-id/vega-event-id.d.ts +1 -0
  321. package/dist/types/helpers/event-manager/event-id/vega-internal-event-id.d.ts +1 -0
  322. package/dist/types/helpers/translation/interface.d.ts +5 -0
  323. package/dist/types/types/components.type.d.ts +2 -0
  324. package/dist/types/utils/accessibility.d.ts +1 -0
  325. package/dist/types/utils/ui.d.ts +9 -0
  326. package/dist/vega/index.esm.js +1 -1
  327. package/dist/vega/{p-d8180e42.entry.js → p-018756ad.entry.js} +1 -1
  328. package/dist/vega/{p-7702a906.entry.js → p-01a54c29.entry.js} +1 -1
  329. package/dist/vega/p-042933f1.js +1 -0
  330. package/dist/vega/{p-6b5cb920.js → p-04a65b3f.js} +1 -1
  331. package/dist/vega/{p-423762ae.entry.js → p-07225567.entry.js} +1 -1
  332. package/dist/vega/{p-6817b9bd.js → p-09076646.js} +1 -1
  333. package/dist/vega/{p-3b791b5d.js → p-0a261b66.js} +1 -1
  334. package/dist/vega/p-0a322971.entry.js +1 -0
  335. package/dist/vega/{p-59c6dcf7.entry.js → p-0b41b49a.entry.js} +1 -1
  336. package/dist/vega/{p-51b2b3de.js → p-0d97dcb9.js} +1 -1
  337. package/dist/vega/{p-af5cb9bc.js → p-10fa27d2.js} +1 -1
  338. package/dist/vega/{p-f28a6074.js → p-11e2dcf5.js} +1 -1
  339. package/dist/vega/{p-2c1a85dd.entry.js → p-1250b1ab.entry.js} +1 -1
  340. package/dist/vega/{p-33234385.js → p-154cc614.js} +1 -1
  341. package/dist/vega/p-15b4f1ce.entry.js +1 -0
  342. package/dist/vega/{p-e6adf829.js → p-1704ff25.js} +1 -1
  343. package/dist/vega/p-186df871.entry.js +1 -0
  344. package/dist/vega/{p-c95dbf11.js → p-189d36ec.js} +1 -1
  345. package/dist/vega/{p-c85e743d.js → p-19adf714.js} +1 -1
  346. package/dist/vega/{p-c2388937.entry.js → p-19df2831.entry.js} +1 -1
  347. package/dist/vega/{p-a46e977b.entry.js → p-1be90bab.entry.js} +1 -1
  348. package/dist/vega/{p-69c11b7b.entry.js → p-1da42a63.entry.js} +1 -1
  349. package/dist/vega/{p-096d186d.entry.js → p-255a7387.entry.js} +1 -1
  350. package/dist/vega/{p-1a869f0e.js → p-281fa1e0.js} +1 -1
  351. package/dist/vega/{p-9af0e2e7.js → p-2927b7a1.js} +1 -1
  352. package/dist/vega/{p-2edc066c.entry.js → p-294cff20.entry.js} +1 -1
  353. package/dist/vega/{p-a87cb7ac.js → p-296c5e52.js} +1 -1
  354. package/dist/vega/{p-dba16739.js → p-2b2fefc6.js} +1 -1
  355. package/dist/vega/{p-c347e08a.js → p-2d694684.js} +1 -1
  356. package/dist/vega/{p-9eb00537.entry.js → p-2e0bdc53.entry.js} +1 -1
  357. package/dist/vega/{p-b7721666.js → p-31ebace1.js} +1 -1
  358. package/dist/vega/{p-818da356.js → p-32a0f887.js} +1 -1
  359. package/dist/vega/{p-c31a32f4.js → p-341d5e4e.js} +1 -1
  360. package/dist/vega/{p-e7a4b760.entry.js → p-3967fa98.entry.js} +1 -1
  361. package/dist/vega/{p-7f74cd41.entry.js → p-3a3720c7.entry.js} +1 -1
  362. package/dist/vega/p-3a620268.js +1 -0
  363. package/dist/vega/{p-6c43d54a.js → p-3a93730e.js} +1 -1
  364. package/dist/vega/{p-98a6cd8e.entry.js → p-3bf3c8bb.entry.js} +1 -1
  365. package/dist/vega/{p-6fadee27.entry.js → p-49341532.entry.js} +1 -1
  366. package/dist/vega/{p-e95cb28f.entry.js → p-4a6f241d.entry.js} +1 -1
  367. package/dist/vega/{p-3e64fa38.entry.js → p-4a954d9d.entry.js} +1 -1
  368. package/dist/vega/{p-9fc8bd1f.entry.js → p-4a9c8ec0.entry.js} +1 -1
  369. package/dist/vega/{p-8d48940d.js → p-4c91b13d.js} +1 -1
  370. package/dist/vega/p-4dd02704.js +1 -0
  371. package/dist/vega/p-50fb936f.entry.js +1 -0
  372. package/dist/vega/{p-da8bb883.entry.js → p-52645382.entry.js} +1 -1
  373. package/dist/vega/{p-73c6669e.entry.js → p-5b43a303.entry.js} +1 -1
  374. package/dist/vega/{p-cf2838c7.entry.js → p-5df7ab03.entry.js} +1 -1
  375. package/dist/vega/p-5f377954.js +1 -1
  376. package/dist/vega/p-612808ce.entry.js +1 -0
  377. package/dist/vega/{p-ecbb63a5.entry.js → p-636d890e.entry.js} +1 -1
  378. package/dist/vega/p-6399b5ed.js +1 -0
  379. package/dist/vega/{p-4afafeb3.entry.js → p-648be36d.entry.js} +1 -1
  380. package/dist/vega/{p-a9f34735.entry.js → p-686e0b6b.entry.js} +1 -1
  381. package/dist/vega/{p-d4e519a0.js → p-6d4faebc.js} +1 -1
  382. package/dist/vega/{p-2fb26f4f.entry.js → p-70ae9157.entry.js} +1 -1
  383. package/dist/vega/{p-e1fbfd20.js → p-724df1f5.js} +1 -1
  384. package/dist/vega/{p-e1709e59.js → p-72e2a587.js} +1 -1
  385. package/dist/vega/{p-1deedff2.entry.js → p-740f3325.entry.js} +1 -1
  386. package/dist/vega/{p-a050c24d.entry.js → p-74a1a82a.entry.js} +1 -1
  387. package/dist/vega/{p-264b3309.entry.js → p-76075a1c.entry.js} +1 -1
  388. package/dist/vega/{p-76063dcb.js → p-77fb5d5c.js} +1 -1
  389. package/dist/vega/{p-e4c4ea35.js → p-78ba7ca9.js} +1 -1
  390. package/dist/vega/{p-a49c25c2.entry.js → p-79bb216e.entry.js} +1 -1
  391. package/dist/vega/{p-d37636a5.entry.js → p-7e7e2f85.entry.js} +1 -1
  392. package/dist/vega/{p-4c90d013.entry.js → p-7ffe8081.entry.js} +1 -1
  393. package/dist/vega/{p-4cefd7fe.js → p-8077b117.js} +1 -1
  394. package/dist/vega/{p-5bf3ab33.js → p-858ec529.js} +1 -1
  395. package/dist/vega/{p-0b5b0fd2.entry.js → p-879d3cc9.entry.js} +1 -1
  396. package/dist/vega/{p-ae1aa4df.js → p-891815d6.js} +1 -1
  397. package/dist/vega/p-8ce9e214.js +1 -0
  398. package/dist/vega/p-8d36afcc.entry.js +1 -0
  399. package/dist/vega/{p-a9e10a64.js → p-919de162.js} +1 -1
  400. package/dist/vega/{p-effb285f.entry.js → p-931dac8c.entry.js} +1 -1
  401. package/dist/vega/{p-c601b331.entry.js → p-979a5e91.entry.js} +1 -1
  402. package/dist/vega/{p-d402eb7b.entry.js → p-98dad153.entry.js} +1 -1
  403. package/dist/vega/p-9a6bd32c.js +1 -0
  404. package/dist/vega/p-9e0f8b46.entry.js +1 -0
  405. package/dist/vega/{p-3d0ba2c6.entry.js → p-a03341d8.entry.js} +1 -1
  406. package/dist/vega/{p-e1d2c60d.js → p-a0dd08b1.js} +1 -1
  407. package/dist/vega/p-a2b8d49d.js +1 -0
  408. package/dist/vega/p-a6565e02.js +1 -0
  409. package/dist/vega/{p-afd1b519.entry.js → p-a67d52ce.entry.js} +1 -1
  410. package/dist/vega/{p-411ea209.entry.js → p-aa4e9a4b.entry.js} +1 -1
  411. package/dist/vega/{p-fa91805b.entry.js → p-aa8f4713.entry.js} +1 -1
  412. package/dist/vega/{p-e27626f6.js → p-ab04eff6.js} +1 -1
  413. package/dist/vega/p-ab4c307b.js +1 -0
  414. package/dist/vega/{p-e47b2c4c.entry.js → p-ac26924d.entry.js} +1 -1
  415. package/dist/vega/{p-7f46cc1e.entry.js → p-adc64ff6.entry.js} +1 -1
  416. package/dist/vega/{p-031c0cf7.js → p-b02b985d.js} +1 -1
  417. package/dist/vega/{p-0bb0b521.entry.js → p-b69755c7.entry.js} +1 -1
  418. package/dist/vega/{p-c801c85d.js → p-b6be1f33.js} +1 -1
  419. package/dist/vega/{p-25572ea7.entry.js → p-bd47d8a7.entry.js} +1 -1
  420. package/dist/vega/{p-0b4880bd.entry.js → p-be783294.entry.js} +1 -1
  421. package/dist/vega/{p-79c12a64.entry.js → p-bee5dfb0.entry.js} +1 -1
  422. package/dist/vega/{p-45aaaef6.entry.js → p-c19132c9.entry.js} +1 -1
  423. package/dist/vega/p-c41b42eb.entry.js +1 -0
  424. package/dist/vega/{p-3d92d2af.entry.js → p-c45acdc3.entry.js} +1 -1
  425. package/dist/vega/{p-571a6d15.entry.js → p-ce034372.entry.js} +1 -1
  426. package/dist/vega/{p-bc74d7e7.entry.js → p-ce2d9efe.entry.js} +1 -1
  427. package/dist/vega/{p-ce61d23f.entry.js → p-d05915af.entry.js} +1 -1
  428. package/dist/vega/{p-c8fe46fd.entry.js → p-d1a6e126.entry.js} +1 -1
  429. package/dist/vega/{p-9297f4a9.entry.js → p-d286da1d.entry.js} +1 -1
  430. package/dist/vega/{p-3c456e91.entry.js → p-d4262f06.entry.js} +1 -1
  431. package/dist/vega/{p-23b38467.entry.js → p-d5aad9f0.entry.js} +1 -1
  432. package/dist/vega/{p-35d77c9c.entry.js → p-d97974be.entry.js} +1 -1
  433. package/dist/vega/{p-9e2b7718.entry.js → p-d9d4bdbf.entry.js} +1 -1
  434. package/dist/vega/{p-18e8d9b7.js → p-dcf162e9.js} +1 -1
  435. package/dist/vega/p-e46a23fc.entry.js +1 -0
  436. package/dist/vega/p-e5226de6.entry.js +1 -0
  437. package/dist/vega/{p-f604f2c9.entry.js → p-e7c930d9.entry.js} +1 -1
  438. package/dist/vega/p-e85497ec.entry.js +1 -0
  439. package/dist/vega/{p-34964a53.js → p-e8de9535.js} +1 -1
  440. package/dist/vega/{p-f5f5a0d9.js → p-e8ea3b16.js} +1 -1
  441. package/dist/vega/{p-268e84e0.entry.js → p-ea0e922f.entry.js} +1 -1
  442. package/dist/vega/p-ea48decc.js +1 -0
  443. package/dist/vega/{p-82039afd.entry.js → p-eb78a2f2.entry.js} +1 -1
  444. package/dist/vega/p-ec2333f7.entry.js +1 -0
  445. package/dist/vega/{p-6e70d3cc.js → p-ec2a1d4c.js} +1 -1
  446. package/dist/vega/{p-9f064488.entry.js → p-ec663f00.entry.js} +1 -1
  447. package/dist/vega/p-ed2b0e01.entry.js +1 -0
  448. package/dist/vega/p-ef13b346.js +1 -0
  449. package/dist/vega/{p-78099a83.entry.js → p-f5ae99b4.entry.js} +1 -1
  450. package/dist/vega/{p-d10ae46a.entry.js → p-fdb97cb7.entry.js} +1 -1
  451. package/dist/vega/{p-295326ca.entry.js → p-fe220f3a.entry.js} +1 -1
  452. package/dist/vega/{p-115d6053.entry.js → p-ff5208f5.entry.js} +1 -1
  453. package/dist/vega/vega.esm.js +1 -1
  454. package/package.json +6 -6
  455. package/dist/vega/p-13e7f906.entry.js +0 -1
  456. package/dist/vega/p-358b4a06.entry.js +0 -1
  457. package/dist/vega/p-4415ad28.js +0 -1
  458. package/dist/vega/p-4530f0e1.entry.js +0 -1
  459. package/dist/vega/p-5087fa1e.entry.js +0 -1
  460. package/dist/vega/p-51fcb07f.entry.js +0 -1
  461. package/dist/vega/p-5657f768.js +0 -1
  462. package/dist/vega/p-57f220b5.js +0 -1
  463. package/dist/vega/p-593e0f80.js +0 -1
  464. package/dist/vega/p-5e50dbb9.js +0 -1
  465. package/dist/vega/p-606d7113.entry.js +0 -1
  466. package/dist/vega/p-6ac8e655.js +0 -1
  467. package/dist/vega/p-7730bace.js +0 -1
  468. package/dist/vega/p-84eb3b9c.js +0 -1
  469. package/dist/vega/p-93afdfc3.js +0 -1
  470. package/dist/vega/p-9f36abf9.entry.js +0 -1
  471. package/dist/vega/p-9f728e0b.js +0 -1
  472. package/dist/vega/p-a9528dbd.entry.js +0 -1
  473. package/dist/vega/p-aaf44879.entry.js +0 -1
  474. package/dist/vega/p-af00e6e2.entry.js +0 -1
  475. package/dist/vega/p-c51ebb14.entry.js +0 -1
  476. package/dist/vega/p-dffbbc3d.entry.js +0 -1
  477. package/dist/vega/p-ed26f4c8.entry.js +0 -1
  478. package/dist/vega/p-f1c672e4.js +0 -1
  479. /package/dist/cjs/{index-f054eb5d.js → index-3ca118c4.js} +0 -0
  480. /package/dist/esm/{index-bfc6dfa2.js → index-9c9865c0.js} +0 -0
  481. /package/dist/vega/{p-5a25014f.js → p-982747ef.js} +0 -0
@@ -1 +1 @@
1
- import{h as e,r as t,c as i,H as a,g as n}from"./p-6b2342e0.js";import{s as o}from"./p-519a7d55.js";import{n as s,c as r}from"./p-262ec334.js";import{D as l}from"./p-f28a6074.js";import{B as g,H as p,i as h,a as c,U as m}from"./p-9af0e2e7.js";import{n as f,s as v,P as u,r as d,i as b,h as x}from"./p-9dcecdd3.js";import{a as w}from"./p-6e70d3cc.js";import{C as S}from"./p-e27626f6.js";import{c as y}from"./p-6b5cb920.js";import{c as C,M as z,V as j,I as P}from"./p-6e1ab235.js";import{V as O,I as k}from"./p-4415ad28.js";import{T as I}from"./p-57f220b5.js";import{R as M}from"./p-031c0cf7.js";import{g as L}from"./p-49a2e141.js";import{P as A}from"./p-81dd00d0.js";import{t as E,u as R}from"./p-6c43d54a.js";import{F as T}from"./p-18e8d9b7.js";import"./p-2d0d575f.js";import"./p-331a62d5.js";import"./p-f1c672e4.js";import"./p-5f377954.js";import"./p-6a334573.js";import"./p-b75ee3ba.js";import"./p-3b791b5d.js";import"./p-a528714c.js";import"./p-e4c4ea35.js";import"./p-ed45b3b6.js";import"./p-d4ea8e22.js";import"./p-d884c644.js";import"./p-0c667d6a.js";import"./p-d27ae9ff.js";import"./p-5a25014f.js";const N=({pageSize:t,current:i,total:a,translationSlimmer:n})=>{const o=a>0?t*(i-1)+1:0,s=Math.min(i*t,a);return e("vega-field-label",{label:n.t("Viewing {0}-{1} of {2}",o,s,a)})},_=({onChange:t,pageCount:i,translationSlimmer:a})=>{let n;const o=()=>{if(n.value){const e=s(r(n.value,1),1,i);t(e),n.value=""}},h=e=>{e.stopPropagation()};return e("vega-flex",{alignItems:"center",justifyContent:"center",gap:"size-8"},e("vega-field-label",{label:a.t("Go To")}),e("vega-form",{ref:e=>{l.addUniqueObserverToNode(e,g,o)}},e("vega-input",{"data-vega-form":"paginationGoTo",type:"number",size:"small",autocomplete:"on",showClearIcon:!1,style:{width:"60px"},maskConfig:{type:"number",options:{allowNegative:!1,precision:0}},onVegaChange:h,onChange:h,ref:e=>{n=e,l.addUniqueObserverToNode(e,p,o)}})))},V=({pageSize:t,pageSizeSelectorOptions:i,dropdownProps:a,onChange:n,translationSlimmer:o,isAllActive:s})=>{const r=i.map(f),g=v(r),p=e=>{const t=Number(e.detail);n(t)},c=s?u:t;return e("vega-flex",{alignItems:"center",justifyContent:"center",gap:"size-8"},e("vega-field-label",{label:o.t("Show")}),e("div",null,e("vega-input-select",{size:"small",source:g.map((e=>({id:e.value.toString(),displayName:e.label}))),value:c.toString(),placeholder:"Page Size",vegaDropdownProps:Object.assign({matchTargetWidth:!1,searchable:!1},a),ref:e=>{l.addUniqueObserverToNode(e,h,p)}})))},B=({total:t,current:i,onChange:a,pageCount:n})=>{const o=t=>{const n=i!==t;return e("li",{key:t,class:w(["vega-pagination-item",i===t?"active":""])},e("button",{onClick:()=>n&&a(t)},t))},s=(t,i,a)=>e("li",{class:w(["vega-pagination-button",i&&"disabled"])},e("vega-button-circle",{variant:"icon-only",icon:t,iconColor:"text-link",size:"small",disabled:i,ref:e=>{l.addUniqueObserverToNode(e,c,a)}}));return e("ul",{class:"vega-pagination"},s("chevron-left",0===t||1===i,(()=>{a(i-1)})),0===t?[o(1)]:((e,t,i=7)=>{if(i<7)throw new Error("Must allow at least 7 pager items");if(i%2==0)throw new Error("Must allow odd number of pager items");if(t<i)return Array(t).fill(0).map(((e,t)=>t+1));const a=Math.max(1,Math.min(t-i+1,e-Math.floor(i/2))),n=new Array(i);for(let e=0;e<i;e+=1)n[e]=e+a;return Number(n[0])>1&&(n[0]=1,n[1]="..."),Number(n[n.length-1])<=t-1&&(n[n.length-1]=t,n[n.length-2]="..."),n})(i,n).map((t=>"string"==typeof t?e("li",{class:"vega-pagination-item pager-ellipsis"},"..."):o(t))),s("chevron-right",0===t||i===n,(()=>{a(i+1)})))};var W=function(e,t,i,a){var n,o=arguments.length,s=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,a);else for(var r=e.length-1;r>=0;r--)(n=e[r])&&(s=(o<3?n(s):o>3?n(t,i,s):n(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s};class G extends j{registerPaginationPageSizeChangeObserver(){l.addUniqueObserverToNode(this.host,E,(e=>{const t=Number(e.detail);this.isAllActive=t===u,this.pageSize=d(t,this.total)}))}unregisterPaginationPageSizeChangeObserver(){l.removeUniqueObserverFromNode(this.host,E)}}W([C()],G.prototype,"host",void 0),W([C({writable:!0})],G.prototype,"pageSize",void 0),W([C({writable:!0})],G.prototype,"isAllActive",void 0),W([C()],G.prototype,"total",void 0),W([z("connectedCallback")],G.prototype,"registerPaginationPageSizeChangeObserver",null),W([z("disconnectedCallback")],G.prototype,"unregisterPaginationPageSizeChangeObserver",null);var U=function(e,t,i,a){var n,o=arguments.length,s=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,a);else for(var r=e.length-1;r>=0;r--)(n=e[r])&&(s=(o<3?n(s):o>3?n(t,i,s):n(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s};class D extends j{registerPaginationCurrentChangeObserver(){l.addUniqueObserverToNode(this.host,R,(e=>{this.current=Number(e.detail)}))}unregisterPaginationCurrentChangeObserver(){l.removeUniqueObserverFromNode(this.host,R)}}U([C()],D.prototype,"host",void 0),U([C({writable:!0})],D.prototype,"current",void 0),U([z("connectedCallback")],D.prototype,"registerPaginationCurrentChangeObserver",null),U([z("disconnectedCallback")],D.prototype,"unregisterPaginationCurrentChangeObserver",null);var F=function(e,t,i,a){var n,o=arguments.length,s=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,a);else for(var r=e.length-1;r>=0;r--)(n=e[r])&&(s=(o<3?n(s):o>3?n(t,i,s):n(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s};class H extends A{constructor(){super({callback:()=>{this.calculatePaginationLayout()}}),this.calculatePaginationLayout=()=>{if("vertical"===this.currentLayout)this.host.classList.add("vega-pagination-vertical"),this.host.classList.remove("vega-pagination-horizontal");else{this.host.classList.remove("vega-pagination-vertical"),this.host.classList.add("vega-pagination-horizontal");const e=this.host.offsetHeight;Array.from(this.host.shadowRoot.children).filter((e=>"VEGA-FLEX"===e.tagName)).every((t=>e>t.offsetHeight))&&(this.host.classList.add("vega-pagination-vertical"),this.host.classList.remove("vega-pagination-horizontal"))}}}componentWillLoad(){this.setCurrentLayout()}watchCurrentBreakpoint(){this.setCurrentLayout()}watchLayout(){this.setCurrentLayout(),this.calculatePaginationLayout()}setCurrentLayout(){this.currentLayout=M.formatCustom(this.layout)}}F([C()],H.prototype,"host",void 0),F([C()],H.prototype,"layout",void 0),F([z("componentWillLoad")],H.prototype,"componentWillLoad",null),F([z("watchCurrentBreakpoint")],H.prototype,"watchCurrentBreakpoint",null),F([z("watchLayout")],H.prototype,"watchLayout",null);var X=function(e,t,i,a){var n,o=arguments.length,s=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,a);else for(var r=e.length-1;r>=0;r--)(n=e[r])&&(s=(o<3?n(s):o>3?n(t,i,s):n(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s};const $=class{constructor(a){t(this,a),this.vegaChange=i(this,"vegaChange",7),this.change=i(this,"change",7),this.vegaPageSizeChange=i(this,"vegaPageSizeChange",7),this.pageSizeChange=i(this,"pageSizeChange",7),this.globalSlimmers={},this.translationSlimmer=new I,this.childEventPrevent=new S([g],(()=>this.host)),this.childValueChangePrevent=new S([h],(()=>this.host),!0),this.vegaChangeEventEmitter=y($,h),this.vegaPageSizeChangeEventEmitter=y($,m),this.vegaComponentUsageRuntimeMetricsSlimmer=new O,this.vegaPaginationPageSizeObserverController=new G,this.vegaPaginationCurrentPageObserverController=new D,this.breakpointPageResizeObserverSlimmer=new A,this.vegaPaginationLayoutController=new H,this.vegaPaginationItemTypes=["currentPageLabel","pageSizeSelector","pageSelector","goTo","pageSelectorMobile","pageSizeSelectorMobile","pageSelectorMobile_goTo","pageSizeSelectorMobile_currentPageLabel"],this.currentBreakpoint=L(),this.pageCount=0,this.isAllActive=!1,this.current=1,this.total=0,this.pageSize=10,this.extensions=T.isEnabled("VEGA_PAGINATION.ENABLE_EXTENSIONS_RESPONSIVE_DEFAULT_VALUE")?{default:[["pageSizeSelectorMobile_currentPageLabel"],["pageSelectorMobile_goTo"]],M:[["pageSelector"]]}:[["pageSelector"]],this.layout="horizontal",this.pageSizeSelectorOptions=[10,20,50,100],this.renderPaginationItemsWrapper=t=>e("vega-flex",{gap:{default:"size-4",M:"size-24"},flexWrap:"wrap",alignItems:"center",justifyContent:"center",key:this.generateWrapperKey(t)},t.map((t=>e("div",{key:t},this.renderPaginationItem(t))))),this.renderPaginationItem=t=>{switch(t){case"currentPageLabel":return e(N,{total:this.total,current:this.current,pageSize:this.pageSize,translationSlimmer:this.translationSlimmer});case"pageSizeSelector":{const t=this.isAllActive||b(this.pageSizeSelectorOptions,this.pageSize)?this.pageSizeSelectorOptions:[...this.pageSizeSelectorOptions,this.pageSize];return e(V,{pageSize:this.pageSize,pageSizeSelectorOptions:t,dropdownProps:this.dropdownProps,onChange:this.onPageSizeSelectorChange,translationSlimmer:this.translationSlimmer,isAllActive:this.isAllActive})}case"pageSelector":return e(B,{current:this.current,total:this.total,onChange:this.onPageSelectorChange,pageCount:this.pageCount});case"goTo":return e(_,{onChange:this.handlePaginationGoToChange,pageCount:this.pageCount,translationSlimmer:this.translationSlimmer});case"pageSelectorMobile":case"pageSelectorMobile_goTo":return e("vega-pagination-page-selector-mobile",{type:t,pageCount:this.pageCount,current:this.current,total:this.total});case"pageSizeSelectorMobile":case"pageSizeSelectorMobile_currentPageLabel":return e("vega-pagination-page-size-selector-mobile",{type:t,pageSize:this.pageSize,current:this.current,total:this.total,pageSizeSelectorOptions:this.pageSizeSelectorOptions,dropdownProps:this.dropdownProps,isAllActive:this.isAllActive})}},this.handlePaginationGoToChange=e=>{this.current=e},this.onPageSizeSelectorChange=e=>{this.isAllActive=e===u,this.pageSize=d(e,this.total)},this.calculatePages=()=>this.total?Math.floor((this.total-1)/this.pageSize)+1:0,this.onPageSelectorChange=e=>{this.current=e},this.removeDuplicateItems=e=>{const t=[...this.vegaPaginationItemTypes];return[...e].map((e=>e.filter(((i,a)=>{const n=t.indexOf(i);return n>=0?(t.splice(n,1),!0):(e.splice(a,1),!1)})))).filter((e=>e.length>0))},this.generateWrapperKey=e=>e.map(String).reduce(((e,t)=>`${e}-${t}`)),this.currentValueGuard=()=>{0===this.pageCount?this.current=1:this.current>this.pageCount&&(this.current=this.pageCount)}}watchCurrentBreakpoint(){}watchPageCount(){this.currentValueGuard()}watchCurrent(){this.currentValueGuard(),this.vegaChangeEventEmitter.emit(this.current)}watchTotal(e){this.isAllActive&&(this.pageSize=e),this.pageCount=this.calculatePages()}watchPageSize(){this.vegaPageSizeChangeEventEmitter.emit(this.pageSize),this.pageCount=this.calculatePages()}watchLayout(){}componentWillLoad(){this.isAllActive=x(this.pageSizeSelectorOptions)&&this.pageSize===this.total&&!b(this.pageSizeSelectorOptions,this.pageSize),this.pageCount=this.calculatePages(),this.currentValueGuard(),this.isAllActive||b(this.pageSizeSelectorOptions,this.pageSize)||(this.pageSizeSelectorOptions=[...this.pageSizeSelectorOptions,this.pageSize])}render(){const t=M.formatCustom(this.extensions);return o(e(a,null,this.removeDuplicateItems(t).map(this.renderPaginationItemsWrapper)),this.host)}get host(){return n(this)}static get watchers(){return{currentBreakpoint:["watchCurrentBreakpoint"],pageCount:["watchPageCount"],current:["watchCurrent"],total:["watchTotal"],pageSize:["watchPageSize"],layout:["watchLayout"]}}};X([k()],$.prototype,"globalSlimmers",void 0),X([P()],$.prototype,"translationSlimmer",void 0),X([P()],$.prototype,"childEventPrevent",void 0),X([P()],$.prototype,"childValueChangePrevent",void 0),X([P()],$.prototype,"vegaChangeEventEmitter",void 0),X([P()],$.prototype,"vegaPageSizeChangeEventEmitter",void 0),X([P()],$.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),X([P()],$.prototype,"vegaPaginationPageSizeObserverController",void 0),X([P()],$.prototype,"vegaPaginationCurrentPageObserverController",void 0),X([P()],$.prototype,"breakpointPageResizeObserverSlimmer",void 0),X([P()],$.prototype,"vegaPaginationLayoutController",void 0),$.style=':host{display:flex;align-items:center;line-height:normal;flex-wrap:wrap}:host(.vega-pagination-horizontal){flex-direction:row;justify-content:space-between}:host(.vega-pagination-vertical){flex-direction:column;gap:16px;justify-content:center}@media (min-width: 320px){:host(.vega-pagination-horizontal){gap:4px}}@media (min-width: 768px){:host(.vega-pagination-horizontal){gap:24px}}.vega-pagination{display:flex;padding:0px;margin:0px}.vega-pagination .vega-pagination-item{list-style-type:none;display:inline-flex;align-items:center;justify-content:center;min-width:32px;height:32px;font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;color:rgba(var(--v-text-link, 19, 98, 226, 1));cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}@media screen and (min-width: 768px) and (max-width: 1023px){.vega-pagination .vega-pagination-item{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.vega-pagination .vega-pagination-item{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.vega-pagination .vega-pagination-item{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px}}.vega-pagination .vega-pagination-item button{background-color:rgba(var(--v-bg-transparent, 0, 0, 0, 0));border-width:0px;outline:2px solid transparent;outline-offset:2px;width:100%;height:100%;cursor:pointer;font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;color:rgba(var(--v-text-link, 19, 98, 226, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){.vega-pagination .vega-pagination-item button{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.vega-pagination .vega-pagination-item button{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.vega-pagination .vega-pagination-item button{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px}}.vega-pagination .vega-pagination-item.pager-ellipsis{cursor:default}.vega-pagination .vega-pagination-item:not(.pager-ellipsis):not(:active):hover{text-decoration:underline;text-underline-offset:2px}.vega-pagination .vega-pagination-item button:active,.vega-pagination .vega-pagination-item.active button{color:rgba(var(--v-text-primary, 32, 54, 69, 1));font-family:"Inter", sans-serif;font-size:14px;font-weight:700;line-height:18px}@media screen and (min-width: 768px) and (max-width: 1023px){.vega-pagination .vega-pagination-item button:active,.vega-pagination .vega-pagination-item.active button{font-family:"Inter", sans-serif;font-size:14px;font-weight:700;line-height:18px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.vega-pagination .vega-pagination-item button:active,.vega-pagination .vega-pagination-item.active button{font-family:"Inter", sans-serif;font-size:14px;font-weight:700;line-height:18px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.vega-pagination .vega-pagination-item button:active,.vega-pagination .vega-pagination-item.active button{font-family:"Inter", sans-serif;font-size:14px;font-weight:700;line-height:18px}}.vega-pagination .vega-pagination-item button:focus-visible{outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:0px;border-radius:9999px}.vega-pagination .vega-pagination-button{list-style-type:none;display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}';export{$ as vega_pagination}
1
+ import{h as e,r as t,c as i,H as a,g as n}from"./p-6b2342e0.js";import{s as o}from"./p-519a7d55.js";import{n as s,c as r}from"./p-262ec334.js";import{D as l}from"./p-11e2dcf5.js";import{C as g,I as p,i as h,a as c,W as m}from"./p-2927b7a1.js";import{n as f,s as v,P as u,r as d,i as b,h as x}from"./p-9dcecdd3.js";import{a as w}from"./p-ec2a1d4c.js";import{C as S}from"./p-ab04eff6.js";import{c as C}from"./p-04a65b3f.js";import{c as y,M as z,V as j,I as P}from"./p-6e1ab235.js";import{V as O,I as k}from"./p-8ce9e214.js";import{T as I}from"./p-a6565e02.js";import{R as M}from"./p-b02b985d.js";import{g as L}from"./p-49a2e141.js";import{P as A}from"./p-81dd00d0.js";import{t as E,u as R}from"./p-3a93730e.js";import{F as T}from"./p-dcf162e9.js";import"./p-2d0d575f.js";import"./p-331a62d5.js";import"./p-4dd02704.js";import"./p-5f377954.js";import"./p-6a334573.js";import"./p-b75ee3ba.js";import"./p-0a261b66.js";import"./p-a528714c.js";import"./p-78ba7ca9.js";import"./p-ed45b3b6.js";import"./p-d4ea8e22.js";import"./p-d884c644.js";import"./p-0c667d6a.js";import"./p-d27ae9ff.js";import"./p-982747ef.js";const N=({pageSize:t,current:i,total:a,translationSlimmer:n})=>{const o=a>0?t*(i-1)+1:0,s=Math.min(i*t,a);return e("vega-field-label",{label:n.t("Viewing {0}-{1} of {2}",o,s,a)})},_=({onChange:t,pageCount:i,translationSlimmer:a})=>{let n;const o=()=>{if(n.value){const e=s(r(n.value,1),1,i);t(e),n.value=""}},h=e=>{e.stopPropagation()};return e("vega-flex",{alignItems:"center",justifyContent:"center",gap:"size-8"},e("vega-field-label",{label:a.t("Go To")}),e("vega-form",{ref:e=>{l.addUniqueObserverToNode(e,g,o)}},e("vega-input",{"data-vega-form":"paginationGoTo",type:"number",size:"small",autocomplete:"on",showClearIcon:!1,style:{width:"60px"},maskConfig:{type:"number",options:{allowNegative:!1,precision:0}},onVegaChange:h,onChange:h,ref:e=>{n=e,l.addUniqueObserverToNode(e,p,o)}})))},V=({pageSize:t,pageSizeSelectorOptions:i,dropdownProps:a,onChange:n,translationSlimmer:o,isAllActive:s})=>{const r=i.map(f),g=v(r),p=e=>{const t=Number(e.detail);n(t)},c=s?u:t;return e("vega-flex",{alignItems:"center",justifyContent:"center",gap:"size-8"},e("vega-field-label",{label:o.t("Show")}),e("div",null,e("vega-input-select",{size:"small",source:g.map((e=>({id:e.value.toString(),displayName:e.label}))),value:c.toString(),placeholder:"Page Size",vegaDropdownProps:Object.assign({matchTargetWidth:!1,searchable:!1},a),ref:e=>{l.addUniqueObserverToNode(e,h,p)}})))},B=({total:t,current:i,onChange:a,pageCount:n})=>{const o=t=>{const n=i!==t;return e("li",{key:t,class:w(["vega-pagination-item",i===t?"active":""])},e("button",{onClick:()=>n&&a(t)},t))},s=(t,i,a)=>e("li",{class:w(["vega-pagination-button",i&&"disabled"])},e("vega-button-circle",{variant:"icon-only",icon:t,iconColor:"text-link",size:"small",disabled:i,ref:e=>{l.addUniqueObserverToNode(e,c,a)}}));return e("ul",{class:"vega-pagination"},s("chevron-left",0===t||1===i,(()=>{a(i-1)})),0===t?[o(1)]:((e,t,i=7)=>{if(i<7)throw new Error("Must allow at least 7 pager items");if(i%2==0)throw new Error("Must allow odd number of pager items");if(t<i)return Array(t).fill(0).map(((e,t)=>t+1));const a=Math.max(1,Math.min(t-i+1,e-Math.floor(i/2))),n=new Array(i);for(let e=0;e<i;e+=1)n[e]=e+a;return Number(n[0])>1&&(n[0]=1,n[1]="..."),Number(n[n.length-1])<=t-1&&(n[n.length-1]=t,n[n.length-2]="..."),n})(i,n).map((t=>"string"==typeof t?e("li",{class:"vega-pagination-item pager-ellipsis"},"..."):o(t))),s("chevron-right",0===t||i===n,(()=>{a(i+1)})))};var W=function(e,t,i,a){var n,o=arguments.length,s=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,a);else for(var r=e.length-1;r>=0;r--)(n=e[r])&&(s=(o<3?n(s):o>3?n(t,i,s):n(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s};class G extends j{registerPaginationPageSizeChangeObserver(){l.addUniqueObserverToNode(this.host,E,(e=>{const t=Number(e.detail);this.isAllActive=t===u,this.pageSize=d(t,this.total)}))}unregisterPaginationPageSizeChangeObserver(){l.removeUniqueObserverFromNode(this.host,E)}}W([y()],G.prototype,"host",void 0),W([y({writable:!0})],G.prototype,"pageSize",void 0),W([y({writable:!0})],G.prototype,"isAllActive",void 0),W([y()],G.prototype,"total",void 0),W([z("connectedCallback")],G.prototype,"registerPaginationPageSizeChangeObserver",null),W([z("disconnectedCallback")],G.prototype,"unregisterPaginationPageSizeChangeObserver",null);var D=function(e,t,i,a){var n,o=arguments.length,s=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,a);else for(var r=e.length-1;r>=0;r--)(n=e[r])&&(s=(o<3?n(s):o>3?n(t,i,s):n(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s};class F extends j{registerPaginationCurrentChangeObserver(){l.addUniqueObserverToNode(this.host,R,(e=>{this.current=Number(e.detail)}))}unregisterPaginationCurrentChangeObserver(){l.removeUniqueObserverFromNode(this.host,R)}}D([y()],F.prototype,"host",void 0),D([y({writable:!0})],F.prototype,"current",void 0),D([z("connectedCallback")],F.prototype,"registerPaginationCurrentChangeObserver",null),D([z("disconnectedCallback")],F.prototype,"unregisterPaginationCurrentChangeObserver",null);var U=function(e,t,i,a){var n,o=arguments.length,s=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,a);else for(var r=e.length-1;r>=0;r--)(n=e[r])&&(s=(o<3?n(s):o>3?n(t,i,s):n(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s};class X extends A{constructor(){super({callback:()=>{this.calculatePaginationLayout()}}),this.calculatePaginationLayout=()=>{if("vertical"===this.currentLayout)this.host.classList.add("vega-pagination-vertical"),this.host.classList.remove("vega-pagination-horizontal");else{this.host.classList.remove("vega-pagination-vertical"),this.host.classList.add("vega-pagination-horizontal");const e=this.host.offsetHeight;Array.from(this.host.shadowRoot.children).filter((e=>"VEGA-FLEX"===e.tagName)).every((t=>e>t.offsetHeight))&&(this.host.classList.add("vega-pagination-vertical"),this.host.classList.remove("vega-pagination-horizontal"))}}}componentWillLoad(){this.setCurrentLayout()}watchCurrentBreakpoint(){this.setCurrentLayout()}watchLayout(){this.setCurrentLayout(),this.calculatePaginationLayout()}setCurrentLayout(){this.currentLayout=M.formatCustom(this.layout)}}U([y()],X.prototype,"host",void 0),U([y()],X.prototype,"layout",void 0),U([z("componentWillLoad")],X.prototype,"componentWillLoad",null),U([z("watchCurrentBreakpoint")],X.prototype,"watchCurrentBreakpoint",null),U([z("watchLayout")],X.prototype,"watchLayout",null);var $=function(e,t,i,a){var n,o=arguments.length,s=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,a);else for(var r=e.length-1;r>=0;r--)(n=e[r])&&(s=(o<3?n(s):o>3?n(t,i,s):n(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s};const H=class{constructor(a){t(this,a),this.vegaChange=i(this,"vegaChange",7),this.change=i(this,"change",7),this.vegaPageSizeChange=i(this,"vegaPageSizeChange",7),this.pageSizeChange=i(this,"pageSizeChange",7),this.globalSlimmers={},this.translationSlimmer=new I,this.childEventPrevent=new S([g],(()=>this.host)),this.childValueChangePrevent=new S([h],(()=>this.host),!0),this.vegaChangeEventEmitter=C(H,h),this.vegaPageSizeChangeEventEmitter=C(H,m),this.vegaComponentUsageRuntimeMetricsSlimmer=new O,this.vegaPaginationPageSizeObserverController=new G,this.vegaPaginationCurrentPageObserverController=new F,this.breakpointPageResizeObserverSlimmer=new A,this.vegaPaginationLayoutController=new X,this.vegaPaginationItemTypes=["currentPageLabel","pageSizeSelector","pageSelector","goTo","pageSelectorMobile","pageSizeSelectorMobile","pageSelectorMobile_goTo","pageSizeSelectorMobile_currentPageLabel"],this.currentBreakpoint=L(),this.pageCount=0,this.isAllActive=!1,this.current=1,this.total=0,this.pageSize=10,this.extensions=T.isEnabled("VEGA_PAGINATION.ENABLE_EXTENSIONS_RESPONSIVE_DEFAULT_VALUE")?{default:[["pageSizeSelectorMobile_currentPageLabel"],["pageSelectorMobile_goTo"]],M:[["pageSelector"]]}:[["pageSelector"]],this.layout="horizontal",this.pageSizeSelectorOptions=[10,20,50,100],this.renderPaginationItemsWrapper=t=>e("vega-flex",{gap:{default:"size-4",M:"size-24"},flexWrap:"wrap",alignItems:"center",justifyContent:"center",key:this.generateWrapperKey(t)},t.map((t=>e("div",{key:t},this.renderPaginationItem(t))))),this.renderPaginationItem=t=>{switch(t){case"currentPageLabel":return e(N,{total:this.total,current:this.current,pageSize:this.pageSize,translationSlimmer:this.translationSlimmer});case"pageSizeSelector":{const t=this.isAllActive||b(this.pageSizeSelectorOptions,this.pageSize)?this.pageSizeSelectorOptions:[...this.pageSizeSelectorOptions,this.pageSize];return e(V,{pageSize:this.pageSize,pageSizeSelectorOptions:t,dropdownProps:this.dropdownProps,onChange:this.onPageSizeSelectorChange,translationSlimmer:this.translationSlimmer,isAllActive:this.isAllActive})}case"pageSelector":return e(B,{current:this.current,total:this.total,onChange:this.onPageSelectorChange,pageCount:this.pageCount});case"goTo":return e(_,{onChange:this.handlePaginationGoToChange,pageCount:this.pageCount,translationSlimmer:this.translationSlimmer});case"pageSelectorMobile":case"pageSelectorMobile_goTo":return e("vega-pagination-page-selector-mobile",{type:t,pageCount:this.pageCount,current:this.current,total:this.total});case"pageSizeSelectorMobile":case"pageSizeSelectorMobile_currentPageLabel":return e("vega-pagination-page-size-selector-mobile",{type:t,pageSize:this.pageSize,current:this.current,total:this.total,pageSizeSelectorOptions:this.pageSizeSelectorOptions,dropdownProps:this.dropdownProps,isAllActive:this.isAllActive})}},this.handlePaginationGoToChange=e=>{this.current=e},this.onPageSizeSelectorChange=e=>{this.isAllActive=e===u,this.pageSize=d(e,this.total)},this.calculatePages=()=>this.total?Math.floor((this.total-1)/this.pageSize)+1:0,this.onPageSelectorChange=e=>{this.current=e},this.removeDuplicateItems=e=>{const t=[...this.vegaPaginationItemTypes];return[...e].map((e=>e.filter(((i,a)=>{const n=t.indexOf(i);return n>=0?(t.splice(n,1),!0):(e.splice(a,1),!1)})))).filter((e=>e.length>0))},this.generateWrapperKey=e=>e.map(String).reduce(((e,t)=>`${e}-${t}`)),this.currentValueGuard=()=>{0===this.pageCount?this.current=1:this.current>this.pageCount&&(this.current=this.pageCount)}}watchCurrentBreakpoint(){}watchPageCount(){this.currentValueGuard()}watchCurrent(){this.currentValueGuard(),this.vegaChangeEventEmitter.emit(this.current)}watchTotal(e){this.isAllActive&&(this.pageSize=e),this.pageCount=this.calculatePages()}watchPageSize(){this.vegaPageSizeChangeEventEmitter.emit(this.pageSize),this.pageCount=this.calculatePages()}watchLayout(){}componentWillLoad(){this.isAllActive=x(this.pageSizeSelectorOptions)&&this.pageSize===this.total&&!b(this.pageSizeSelectorOptions,this.pageSize),this.pageCount=this.calculatePages(),this.currentValueGuard(),this.isAllActive||b(this.pageSizeSelectorOptions,this.pageSize)||(this.pageSizeSelectorOptions=[...this.pageSizeSelectorOptions,this.pageSize])}render(){const t=M.formatCustom(this.extensions);return o(e(a,null,this.removeDuplicateItems(t).map(this.renderPaginationItemsWrapper)),this.host)}get host(){return n(this)}static get watchers(){return{currentBreakpoint:["watchCurrentBreakpoint"],pageCount:["watchPageCount"],current:["watchCurrent"],total:["watchTotal"],pageSize:["watchPageSize"],layout:["watchLayout"]}}};$([k()],H.prototype,"globalSlimmers",void 0),$([P()],H.prototype,"translationSlimmer",void 0),$([P()],H.prototype,"childEventPrevent",void 0),$([P()],H.prototype,"childValueChangePrevent",void 0),$([P()],H.prototype,"vegaChangeEventEmitter",void 0),$([P()],H.prototype,"vegaPageSizeChangeEventEmitter",void 0),$([P()],H.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),$([P()],H.prototype,"vegaPaginationPageSizeObserverController",void 0),$([P()],H.prototype,"vegaPaginationCurrentPageObserverController",void 0),$([P()],H.prototype,"breakpointPageResizeObserverSlimmer",void 0),$([P()],H.prototype,"vegaPaginationLayoutController",void 0),H.style=':host{display:flex;align-items:center;line-height:normal;flex-wrap:wrap}:host(.vega-pagination-horizontal){flex-direction:row;justify-content:space-between}:host(.vega-pagination-vertical){flex-direction:column;gap:16px;justify-content:center}@media (min-width: 320px){:host(.vega-pagination-horizontal){gap:4px}}@media (min-width: 768px){:host(.vega-pagination-horizontal){gap:24px}}.vega-pagination{display:flex;padding:0px;margin:0px}.vega-pagination .vega-pagination-item{list-style-type:none;display:inline-flex;align-items:center;justify-content:center;min-width:32px;height:32px;font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;color:rgba(var(--v-text-link, 19, 98, 226, 1));cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}@media screen and (min-width: 768px) and (max-width: 1023px){.vega-pagination .vega-pagination-item{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.vega-pagination .vega-pagination-item{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.vega-pagination .vega-pagination-item{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px}}.vega-pagination .vega-pagination-item button{background-color:rgba(var(--v-bg-transparent, 0, 0, 0, 0));border-width:0px;outline:2px solid transparent;outline-offset:2px;width:100%;height:100%;cursor:pointer;font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;color:rgba(var(--v-text-link, 19, 98, 226, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){.vega-pagination .vega-pagination-item button{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.vega-pagination .vega-pagination-item button{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.vega-pagination .vega-pagination-item button{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px}}.vega-pagination .vega-pagination-item.pager-ellipsis{cursor:default}.vega-pagination .vega-pagination-item:not(.pager-ellipsis):not(:active):hover{text-decoration:underline;text-underline-offset:2px}.vega-pagination .vega-pagination-item button:active,.vega-pagination .vega-pagination-item.active button{color:rgba(var(--v-text-primary, 32, 54, 69, 1));font-family:"Inter", sans-serif;font-size:14px;font-weight:700;line-height:18px}@media screen and (min-width: 768px) and (max-width: 1023px){.vega-pagination .vega-pagination-item button:active,.vega-pagination .vega-pagination-item.active button{font-family:"Inter", sans-serif;font-size:14px;font-weight:700;line-height:18px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.vega-pagination .vega-pagination-item button:active,.vega-pagination .vega-pagination-item.active button{font-family:"Inter", sans-serif;font-size:14px;font-weight:700;line-height:18px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.vega-pagination .vega-pagination-item button:active,.vega-pagination .vega-pagination-item.active button{font-family:"Inter", sans-serif;font-size:14px;font-weight:700;line-height:18px}}.vega-pagination .vega-pagination-item button:focus-visible{outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:0px;border-radius:9999px}.vega-pagination .vega-pagination-button{list-style-type:none;display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}';export{H as vega_pagination}
@@ -0,0 +1 @@
1
+ import{h as e,F as t,r as a,c as i,H as o,g as n}from"./p-6b2342e0.js";import{s as r}from"./p-519a7d55.js";import{c as s,V as l,M as d,I as c}from"./p-6e1ab235.js";import{s as h}from"./p-6bd5c49b.js";import{V as b,I as v}from"./p-8ce9e214.js";import{P as g}from"./p-81dd00d0.js";import{d as p}from"./p-1bc5b3bc.js";import{c as u}from"./p-3a620268.js";import{D as f}from"./p-11e2dcf5.js";import{V as m,a as y}from"./p-2927b7a1.js";import{C as x}from"./p-2d0d575f.js";import{O as w}from"./p-331a62d5.js";import{T}from"./p-a528714c.js";import{f as C,l as R,m as j,n as D}from"./p-ec2a1d4c.js";import{S as I}from"./p-1fb56e14.js";import{C as P}from"./p-ab04eff6.js";import{c as k}from"./p-04a65b3f.js";import"./p-49a2e141.js";import"./p-d4ea8e22.js";import"./p-ed45b3b6.js";import"./p-b75ee3ba.js";import"./p-4dd02704.js";import"./p-5f377954.js";import"./p-dcf162e9.js";import"./p-982747ef.js";import"./p-6a334573.js";var S=function(e,t,a,i){var o,n=arguments.length,r=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,a):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,a,i);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(r=(n<3?o(r):n>3?o(t,a,r):o(t,a))||r);return n>3&&r&&Object.defineProperty(t,a,r),r};class O extends l{getTabMenuContainer(){return this.tabMenuContainer}render(){return e(t,null,e("div",{class:{"tab-content-container":!0,"more-tab":this.tabPages.length>1,"tab-style-secondary":"secondary"===this.variant,"tab-style-primary":"secondary"!==this.variant,"swipe-more-tabs":"scroll"===this.overflow},ref:e=>this.tabMenuContainer=e},"menu"===this.overflow&&this.directionButtonRenderer.render("left"),this.tabListRenderer.render(),"menu"===this.overflow&&this.directionButtonRenderer.render("right")),e("div",{class:"horizontal-divider"}),this.contentRenderer.render())}}S([s()],O.prototype,"tabPages",void 0),S([s()],O.prototype,"variant",void 0),S([s()],O.prototype,"overflow",void 0),S([s({componentFieldName:"vegaTabGroupTabListRenderer"})],O.prototype,"tabListRenderer",void 0),S([s({componentFieldName:"vegaTabGroupDirectionButtonRenderer"})],O.prototype,"directionButtonRenderer",void 0),S([s({componentFieldName:"vegaTabGroupContentRenderer"})],O.prototype,"contentRenderer",void 0);var G=function(e,t,a,i){var o,n=arguments.length,r=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,a):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,a,i);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(r=(n<3?o(r):n>3?o(t,a,r):o(t,a))||r);return n>3&&r&&Object.defineProperty(t,a,r),r};class A extends l{setSelectedDataTarget(e){this.selectedTabDataTarget=e}handleTabItemClick(e){const t=this.clickEventEmitter.emit(e);t&&!t.defaultPrevented&&(e===this.selectedTabDataTarget?this.vegaTabGroupPageIndexController.setCurrentPageIndexBySelectedTab(e):this.setSelectedDataTarget(e))}}G([s()],A.prototype,"clickEventEmitter",void 0),G([s({writable:!0})],A.prototype,"selectedTabDataTarget",void 0),G([s()],A.prototype,"vegaTabGroupPageIndexController",void 0);class F{paginate(e,t,a){const i=e.map(t);return this.doPaginateByCapacity(e,i,a)}doPaginateByCapacity(e,t,a){const i=[];let o=0;for(;o<t.length;){const n=this.valueSum(o,t,a);if(0===n)break;i.push(e.slice(o,o+n)),o+=n}return i}valueSum(e,t,a){let i=0,o=!1,n=0;const r="function"==typeof a?a(e,t):a;return t.slice(e).forEach(((e,t)=>{i+=e,i>r&&!o&&(o=!0,n=t)})),o||(n=t.slice(e).length),n}}var L=function(e,t,a,i){var o,n=arguments.length,r=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,a):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,a,i);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(r=(n<3?o(r):n>3?o(t,a,r):o(t,a))||r);return n>3&&r&&Object.defineProperty(t,a,r),r};class z extends g{constructor(){super({callback:()=>{this.initTabPagesWithDebounce()},target:()=>this.host,shouldTrigger:()=>!this.sliderStateController.isAnimationInProgress()}),this.TAB_SIDE_BUTTON_WIDTH=37,this.TAB_SIDE_BUTTON_AND_CONTENT_SPACE=8,this.valuePaginator=new F,this.initTabPagesWithDebounce=p(this.initTabPages,80,this),this.getTabContainerSpace=(e,t)=>{const a=this.host.getBoundingClientRect().width;let i="secondary"===this.variant?a:a-48;return"menu"===this.overflow&&(e>0&&(i-=this.TAB_SIDE_BUTTON_WIDTH+this.TAB_SIDE_BUTTON_AND_CONTENT_SPACE),t.length>0&&t.slice(e).reduce(((e,t)=>e+t))>i&&i>0&&(i-=this.TAB_SIDE_BUTTON_WIDTH)),i},this.emptySourceAndHiddenDropdown=()=>{Array.from(this.host.shadowRoot.querySelectorAll("vega-dropdown")).forEach((async e=>{0===e.source.length&&await e.hide()}))}}componentDidLoad(){this.initTabPages()}componentDidRender(){this.initTabsWidthArray(),this.emptySourceAndHiddenDropdown()}handleGapChange(){this.initTabPages()}handleTabWidthArrayChange(){this.tabWidthArray.length>0&&this.initTabPages()}handleTabItemsChange(){this.initTabPagesWithDebounce()}setTabItems(e){this.tabItems=e}setTabWidthArray(e){this.tabWidthArray=e}initTabPages(){this.tabItems&&(this.tabPages="scroll"===this.overflow?[[...this.tabItems]]:this.valuePaginator.paginate(this.tabItems,((e,t)=>this.tabWidthArray[t]>0?this.tabWidthArray[t]+Number(this.formatAndValidGap(this.gap)):this.tabWidthArray[t]),this.getTabContainerSpace))}formatAndValidGap(e){return e.replace("size-","")}initTabsWidthArray(){if(0===this.tabWidthArray.length||this.tabWidthArray.some((e=>0===e))){const e=[];this.tabItems.forEach((t=>{const a=this.host.shadowRoot.querySelector(`.vega-tab[data-target='${t.dataTarget}']`);if(a){const t=a.getBoundingClientRect().width;e.push(t)}})),e.length>0&&!e.some((e=>0===e))&&(this.tabWidthArray=[...e])}}}L([s()],z.prototype,"host",void 0),L([s()],z.prototype,"gap",void 0),L([s({writable:!0})],z.prototype,"tabPages",void 0),L([s({writable:!0})],z.prototype,"tabWidthArray",void 0),L([s({writable:!0})],z.prototype,"tabItems",void 0),L([s()],z.prototype,"variant",void 0),L([s()],z.prototype,"overflow",void 0),L([s({componentFieldName:"vegaTabGroupSliderStateController"})],z.prototype,"sliderStateController",void 0),L([d("componentDidLoad")],z.prototype,"componentDidLoad",null),L([d("componentDidRender")],z.prototype,"componentDidRender",null),L([d("watchGapChange")],z.prototype,"handleGapChange",null),L([d("watchTabWidthArrayChange")],z.prototype,"handleTabWidthArrayChange",null),L([d("watchTabItemsChange")],z.prototype,"handleTabItemsChange",null);var B=function(e,t,a,i){var o,n=arguments.length,r=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,a):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,a,i);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(r=(n<3?o(r):n>3?o(t,a,r):o(t,a))||r);return n>3&&r&&Object.defineProperty(t,a,r),r};class N extends l{handleTabPagesChange(){this.selectedTabDataTarget?this.setCurrentPageIndexBySelectedTab(this.selectedTabDataTarget):this.setCurrentPageIndexWhenTabPagesChange()}handleSelectedDataTargetChange(){this.setCurrentPageIndexBySelectedTab(this.selectedTabDataTarget)}setCurrentPageIndexBySelectedTab(e){let t=-1;this.tabPages.forEach(((a,i)=>{-1!==a.findIndex((t=>t.dataTarget===e))&&(t=i)})),t>=0&&(this.currentPageIndex=t)}setPageIndex(e){this.currentPageIndex=e}setCurrentPageIndexWhenTabPagesChange(){this.tabPages&&this.tabPages.length&&!this.tabPages[this.currentPageIndex]&&(this.currentPageIndex=this.tabPages.length-1)}}B([s()],N.prototype,"tabPages",void 0),B([s({writable:!0})],N.prototype,"currentPageIndex",void 0),B([s()],N.prototype,"selectedTabDataTarget",void 0),B([d("watchTabPagesChange")],N.prototype,"handleTabPagesChange",null),B([d("watchSelectedTabDataTargetChange")],N.prototype,"handleSelectedDataTargetChange",null);var V=function(e,t,a,i){var o,n=arguments.length,r=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,a):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,a,i);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(r=(n<3?o(r):n>3?o(t,a,r):o(t,a))||r);return n>3&&r&&Object.defineProperty(t,a,r),r};class W extends l{constructor(){super(...arguments),this.onCloseTab=e=>{var t;const a=e.currentTarget,i=a.closest(".vega-tab"),o=(null===(t=this.host.shadowRoot)||void 0===t?void 0:t.activeElement)===a,n=this.tabItems.findIndex((e=>e.dataTarget===i.getAttribute("data-target")));let r;i.classList.contains("selected")&&(r=this.tabItems[n===this.tabItems.length-1?n-1:n+1].dataTarget,this.selectedTargetController.setSelectedDataTarget(r));const s=this.tabItems.slice(0,n).concat(this.tabItems.slice(n+1));this.tabPagesController.setTabItems(s);const l=this.tabWidthArray.slice(0,n).concat(this.tabWidthArray.slice(n+1));if(this.tabPagesController.setTabWidthArray(l),o&&r&&this.host.shadowRoot){const e=this.host.shadowRoot;requestAnimationFrame((()=>{const t=e.querySelector(`.vega-tab[data-target='${r}'] .label`);null==t||t.focus()}))}e.stopPropagation()}}render(t){return this.showCloseButton&&this.tabItems.length>1&&e("div",{class:this.showCloseButton?"vega-close-icon":"vega-close-icon vega-hidden",onClick:this.onCloseTab,role:"button",tabIndex:t.disabled?-1:0,onKeyDown:u(),"aria-label":"Close Button"},e("vega-icon",{icon:"close",size:"size-12"}))}}V([s()],W.prototype,"host",void 0),V([s()],W.prototype,"tabWidthArray",void 0),V([s()],W.prototype,"showCloseButton",void 0),V([s()],W.prototype,"tabItems",void 0),V([s({componentFieldName:"vegaTabGroupSelectedTargetController"})],W.prototype,"selectedTargetController",void 0),V([s({componentFieldName:"vegaTabGroupPagesController"})],W.prototype,"tabPagesController",void 0);var E=function(e,t,a,i){var o,n=arguments.length,r=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,a):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,a,i);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(r=(n<3?o(r):n>3?o(t,a,r):o(t,a))||r);return n>3&&r&&Object.defineProperty(t,a,r),r};class _ extends l{constructor(){super(...arguments),this.onDirectionButtonClick=e=>{this.pageIndexController.setPageIndex("left"===e?this.currentPageIndex-1:this.currentPageIndex+1)}}getDropdownRef(){return this.dropdownRef}render(t){const a=[];this.tabPages.slice("left"===t?0:this.currentPageIndex+1,"left"===t?this.currentPageIndex:this.tabPages.length).flat().map((e=>{a.push({key:e.dataTarget,label:e.label,disabled:e.disabled})}));const i="left"===t?0===this.currentPageIndex:this.currentPageIndex+1===this.tabPages.length||this.tabPages.length<=1,o="left"===t?"chevron-backward-rounded":"chevron-forward-rounded",n=a.find((e=>e.key===this.selectedTabDataTarget))?this.selectedTabDataTarget:"";return e("div",{class:{"tab-left-button":"left"===t,"tab-right-button":"right"===t,"vega-hidden":i},onClick:()=>this.onDirectionButtonClick(t),"aria-label":"left"===t?"Show previous tabs":"Show next tabs",role:"button",tabIndex:0,onKeyDown:u()},e("vega-dropdown",{source:a,translocation:{X:0,Y:16},selectType:"single",selectedSourceKey:n,"position-relative-to":this.positionRelativeTo,ref:e=>{this.dropdownRef=e,f.addUniqueObserverToNode(e,m,(e=>{this.vegaTabGroupSelectedTargetController.handleTabItemClick(e.detail)}))}},e("vega-icon",{size:"size-12",icon:o})))}}E([s()],_.prototype,"tabPages",void 0),E([s()],_.prototype,"currentPageIndex",void 0),E([s()],_.prototype,"selectedTabDataTarget",void 0),E([s()],_.prototype,"positionRelativeTo",void 0),E([s({componentFieldName:"vegaTabGroupPageIndexController"})],_.prototype,"pageIndexController",void 0),E([s()],_.prototype,"vegaTabGroupSelectedTargetController",void 0);var K=function(e,t,a,i){var o,n=arguments.length,r=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,a):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,a,i);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(r=(n<3?o(r):n>3?o(t,a,r):o(t,a))||r);return n>3&&r&&Object.defineProperty(t,a,r),r};class M extends l{constructor(){super(...arguments),this.tabPanels=[],this.handlePanelUpdate=e=>{const{host:t,type:a}=e;"ADD"===a?this.tabPanels.push(t):this.tabPanels=this.tabPanels.filter((e=>e!==t))}}connectedCallback(){this.tabPanelUpdateObserver=new w(this.canAcceptPanelUpdate.bind(this),this.handlePanelUpdate),x.register(T,this.tabPanelUpdateObserver)}disconnectedCallback(){x.unregister(T,this.tabPanelUpdateObserver),this.tabPanels=[]}componentDidLoad(){this.initSelectedTabDataTarget()}watchSelectedTabDataTargetChange(){this.updateTabPanelsStatus(this.selectedTabDataTarget)}canAcceptPanelUpdate(e){const{host:t,type:a}=e;return"ADD"===a?C(e.host,"VEGA-TAB-GROUP")===this.host&&!this.tabPanels.includes(t):this.tabPanels&&this.tabPanels.includes(t)}initSelectedTabDataTarget(){if(this.selectedTabDataTarget)this.updateTabPanelsStatus(this.selectedTabDataTarget);else{let e=this.getDefaultActivePanelId();!e&&this.tabItems&&this.tabItems.length&&(e=this.tabItems[0].dataTarget),e&&this.selectTargetController.setSelectedDataTarget(e)}}getDefaultActivePanelId(){if(this.tabPanels&&this.tabPanels.length){const e=this.tabPanels.find((e=>!0===e.isActive));return e?e.getAttribute("id"):null}}updateTabPanelsStatus(e){this.tabPanels.length&&e&&this.tabPanels.forEach((t=>{const a=t.getAttribute("id"),i=a===e,o=this.tabItems.find((e=>e.dataTarget===a));t.setAttribute("role","tabpanel"),(null==o?void 0:o.label)?t.setAttribute("aria-label",o.label):t.removeAttribute("aria-label"),i?(t.isActive=!0,t.setAttribute("tabindex","0"),t.setAttribute("aria-hidden","false")):(t.isActive=!1,t.setAttribute("tabindex","-1"),t.setAttribute("aria-hidden","true"))}))}}K([s()],M.prototype,"host",void 0),K([s()],M.prototype,"selectedTabDataTarget",void 0),K([s()],M.prototype,"tabItems",void 0),K([s({componentFieldName:"vegaTabGroupSelectedTargetController"})],M.prototype,"selectTargetController",void 0),K([d("connectedCallback")],M.prototype,"connectedCallback",null),K([d("disconnectedCallback")],M.prototype,"disconnectedCallback",null),K([d("componentDidLoad")],M.prototype,"componentDidLoad",null),K([d("watchSelectedTabDataTargetChange")],M.prototype,"watchSelectedTabDataTargetChange",null);class q extends l{handleVoiceOverPanelFocus(e,t){R(e)&&requestAnimationFrame((()=>{const e=this.findPanelById(t),a=e&&j(e)||e;null==a||a.focus()}))}findPanelById(e){return Array.from(this.host.querySelectorAll("vega-tab-group-panel")).find((t=>(null==t?void 0:t.getAttribute("id"))===e))}}!function(e,t,a,i){var o,n=arguments.length,r=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,a):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,a,i);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(r=(n<3?o(r):n>3?o(t,a,r):o(t,a))||r);n>3&&r&&Object.defineProperty(t,a,r)}([s()],q.prototype,"host",void 0);var $=function(e,t,a,i){var o,n=arguments.length,r=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,a):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,a,i);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(r=(n<3?o(r):n>3?o(t,a,r):o(t,a))||r);return n>3&&r&&Object.defineProperty(t,a,r),r};class U extends l{constructor(){super(...arguments),this.TAB_LABEL_MAX_SIZE=32,this.getCarouselDomRef=()=>this.carouselDom}render(){return e("div",{class:{"tab-list":!0,menu:"menu"===this.overflow,scroll:"scroll"===this.overflow}},"menu"===this.overflow&&this.renderTabListInMenuOverflow(),"scroll"===this.overflow&&this.renderTabListInScrollOverflow())}renderTabListInMenuOverflow(){return e("vega-carousel",{showSlider:!1,ref:e=>this.carouselDom=e},this.tabPages.length>0?this.tabPages.map(((t,a)=>e("div",{key:a},this.renderTabList(t)))):e("div",null,this.renderTabList(this.tabItems)))}renderTabListInScrollOverflow(){return e("div",{class:"overflow-scroll"},this.tabPages.map(((t,a)=>e("div",{key:a},this.renderTabList(t)))))}renderTabList(t){return e("vega-flex",{gap:this.gap,role:"tablist"},t.map((t=>{const a=D(t.dataTarget,"vega-tab-label");return e("div",{class:{"vega-tab":!0,selected:this.selectedTabDataTarget===t.dataTarget,"last-page":this.currentPageIndex+1===this.tabPages.length,"vega-flex-shrink-0":!0,"v-min-w-min":!0,disabled:Boolean(t.disabled)},"data-target":t.dataTarget,key:t.dataTarget},e("div",{class:"vega-tab-container"},e("div",{class:{label:!0,"vega-close-icon-space":this.showCloseButton},onClick:e=>this.handleTabItemClick(e,t.dataTarget),id:a,"aria-label":this.getTabAriaLabel(t),"aria-selected":(this.selectedTabDataTarget===t.dataTarget).toString(),role:"tab",tabIndex:t.disabled?-1:0,onKeyDown:u()},this.renderPrefixIconDom(t),this.renderTabLabelDom(t),this.renderCounterBadgeDom(t)),this.closeButtonRenderer.render(t)))})))}renderPrefixIconDom(t){const a=t.prefixIcon;return a&&e("vega-icon",{icon:a})}renderTabLabelDom(t){return t.label.length>this.TAB_LABEL_MAX_SIZE?e("vega-tooltip",{text:t.label,placement:"bottom","position-relative-to":this.positionRelativeTo},e("span",null,t.label.substring(0,this.TAB_LABEL_MAX_SIZE),"...")):t.label}renderCounterBadgeDom(t){const a=t.counterBadge,i=this.getCounterBadgeClassByCount(a);return void 0!==(null==a?void 0:a.count)&&a.count>0&&e("div",{class:`vega-counter-badge ${i}`,"aria-hidden":"true"},e("vega-counter-badge",{count:a.count,color:a.color}))}getTabAriaLabel(e){const t=e.counterBadge;return(null==t?void 0:t.count)&&t.count>0?`${e.label}, ${t.count}`:e.label}getCounterBadgeClassByCount(e){if(e&&e.count){const t=e.count.toString().length;return 1===t?"one-digit":2===t?"two-digits":"multi-digits"}return""}handleTabItemClick(e,t){this.selectedTargetController.handleTabItemClick(t),this.voiceOverFocusController.handleVoiceOverPanelFocus(e,t)}}$([s()],U.prototype,"tabPages",void 0),$([s()],U.prototype,"currentPageIndex",void 0),$([s()],U.prototype,"selectedTabDataTarget",void 0),$([s()],U.prototype,"gap",void 0),$([s()],U.prototype,"showCloseButton",void 0),$([s()],U.prototype,"tabItems",void 0),$([s()],U.prototype,"overflow",void 0),$([s()],U.prototype,"positionRelativeTo",void 0),$([s({componentFieldName:"vegaTabGroupCloseButtonRenderer"})],U.prototype,"closeButtonRenderer",void 0),$([s({componentFieldName:"vegaTabGroupSelectedTargetController"})],U.prototype,"selectedTargetController",void 0),$([s({componentFieldName:"vegaTabGroupVoiceOverFocusController"})],U.prototype,"voiceOverFocusController",void 0);class Y extends l{render(){return"secondary"===this.variant?e("div",{class:"vega-tab-group-content"},e("slot",null)):e("vega-card",{margin:"0",padding:{default:"size-24",S:"size-12"},variant:"shadow",backgroundColor:"bg-primary"},e("div",{class:"vega-tab-group-content"},e("slot",null)))}}!function(e,t,a,i){var o,n=arguments.length,r=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,a):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,a,i);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(r=(n<3?o(r):n>3?o(t,a,r):o(t,a))||r);n>3&&r&&Object.defineProperty(t,a,r)}([s()],Y.prototype,"variant",void 0);var H=function(e,t,a,i){var o,n=arguments.length,r=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,a):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,a,i);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(r=(n<3?o(r):n>3?o(t,a,r):o(t,a))||r);return n>3&&r&&Object.defineProperty(t,a,r),r};class X extends l{constructor(){super(...arguments),this.UPDATE_ANIMATION_FLAG_DELAY=32,this.goToPageTaskQueue=new I,this.pendingCarouselActionCount=0}async componentDidRender(){await this.goToPageTaskQueue.runTask()}async handlePageIndexChange(){const e=this.tabListRenderer.getCarouselDomRef();e&&(this.pendingCarouselActionCount+=1,setTimeout((()=>{this&&"number"==typeof this.pendingCarouselActionCount&&(this.pendingCarouselActionCount-=1)}),this.UPDATE_ANIMATION_FLAG_DELAY),await this.goToPageTaskQueue.enqueue({run:async()=>await e.goToPage(this.currentPageIndex+1)},!1))}isAnimationInProgress(){return this.pendingCarouselActionCount>0}}H([s({componentFieldName:"vegaTabGroupTabListRenderer"})],X.prototype,"tabListRenderer",void 0),H([s()],X.prototype,"currentPageIndex",void 0),H([d("componentDidRender")],X.prototype,"componentDidRender",null),H([d("watchCurrentPageIndexChange")],X.prototype,"handlePageIndexChange",null);const J=[{payloadKey:"VARIANT_IS_PRIMARY",payloadDescription:"Specifies the visual style and prominence of the tab group",payloadValue:e=>"primary"===e.variant},{payloadKey:"VARIANT_IS_SECONDARY",payloadDescription:"Specifies the visual style and prominence of the tab group",payloadValue:e=>"secondary"===e.variant}];var Q=function(e,t,a,i){var o,n=arguments.length,r=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,a):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,a,i);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(r=(n<3?o(r):n>3?o(t,a,r):o(t,a))||r);return n>3&&r&&Object.defineProperty(t,a,r),r};const Z=class{constructor(e){a(this,e),this.vegaClick=i(this,"vegaClick",7),this.click=i(this,"click",7),this.globalSlimmers={},this.vegaTabGroupRenderer=new O,this.vegaTabGroupDirectionButtonRenderer=new _,this.vegaTabGroupTabListRenderer=new U,this.vegaTabGroupCloseButtonRenderer=new W,this.vegaTabGroupPagesController=new z,this.vegaTabGroupSelectedTargetController=new A,this.vegaTabGroupPageIndexController=new N,this.vegaTabGroupPanelController=new M,this.vegaTabGroupVoiceOverFocusController=new q,this.vegaTabGroupContentRenderer=new Y,this.vegaTabGroupSliderStateController=new X,this.clickEventEmitter=k(Z,y),this.dropdownEventPrevent=new P([y],(()=>this.vegaTabGroupRenderer.getTabMenuContainer())),this.vegaComponentUsageRuntimeMetricsSlimmer=new b(J),this.tabPages=[],this.tabWidthArray=[],this.currentPageIndex=0,this.selectedTabDataTarget="",this.gap="size-8",this.showCloseButton=!1,this.tabItems=[],this.variant="primary",this.overflow="menu"}watchTabPagesChange(){}watchTabWidthArrayChange(){}async watchCurrentPageIndexChange(e){}watchSelectedTabDataTargetChange(){}watchGapChange(){}watchTabItemsChange(){}componentDidLoad(){}componentDidRender(){}render(){return h(e("slot",null)),r(e(o,null,this.vegaTabGroupRenderer.render()),this.host)}get host(){return n(this)}static get watchers(){return{tabPages:["watchTabPagesChange"],tabWidthArray:["watchTabWidthArrayChange"],currentPageIndex:["watchCurrentPageIndexChange"],selectedTabDataTarget:["watchSelectedTabDataTargetChange"],gap:["watchGapChange"],tabItems:["watchTabItemsChange"]}}};Q([v()],Z.prototype,"globalSlimmers",void 0),Q([c()],Z.prototype,"vegaTabGroupRenderer",void 0),Q([c()],Z.prototype,"vegaTabGroupDirectionButtonRenderer",void 0),Q([c()],Z.prototype,"vegaTabGroupTabListRenderer",void 0),Q([c()],Z.prototype,"vegaTabGroupCloseButtonRenderer",void 0),Q([c()],Z.prototype,"vegaTabGroupPagesController",void 0),Q([c()],Z.prototype,"vegaTabGroupSelectedTargetController",void 0),Q([c()],Z.prototype,"vegaTabGroupPageIndexController",void 0),Q([c()],Z.prototype,"vegaTabGroupPanelController",void 0),Q([c()],Z.prototype,"vegaTabGroupVoiceOverFocusController",void 0),Q([c()],Z.prototype,"vegaTabGroupContentRenderer",void 0),Q([c()],Z.prototype,"vegaTabGroupSliderStateController",void 0),Q([c()],Z.prototype,"clickEventEmitter",void 0),Q([c()],Z.prototype,"dropdownEventPrevent",void 0),Q([c()],Z.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),Z.style='.tab-content-container.tab-style-primary{margin-left:24px;margin-right:24px}.vega-tab{cursor:pointer;border-top-left-radius:8px;border-top-right-radius:8px;background-color:rgba(var(--v-bg-action-quaternary, 222, 225, 227, 1))}.tab-content-container .tab-list.scroll{width:100%;overflow:hidden}.tab-content-container .tab-list.scroll .overflow-scroll>div{display:flex;overflow-x:auto;scroll-behavior:smooth;-webkit-overflow-scrolling:touch;scrollbar-width:none;-ms-overflow-style:none}.tab-content-container .tab-list.scroll .overflow-scroll>div::-webkit-scrollbar{display:none}.tab-content-container.more-tab .vega-tab{flex-grow:1}.tab-content-container.more-tab .vega-tab.last-page{flex-grow:0}.vega-tab>div.vega-tab-container{display:flex;align-items:center}.vega-tab>div.vega-tab-container>div{flex-grow:1}.tab-style-primary .vega-tab:hover{background-color:rgba(var(--v-bg-tab-hover, 245, 247, 247, 1))}.tab-style-primary .vega-tab.selected,.tab-style-primary .vega-tab.selected:hover{background-color:rgba(var(--v-bg-primary, 252, 252, 252, 1))}.vega-tab>div>.label{display:inline-flex;align-items:center;font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px;padding-top:8px;padding-bottom:8px;padding-left:16px;padding-right:16px;cursor:pointer;color:rgba(var(--v-text-primary, 32, 54, 69, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){.vega-tab>div>.label{font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.vega-tab>div>.label{font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.vega-tab>div>.label{font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px}}.vega-tab>div>.label vega-icon{padding-right:8px}.vega-tab>div>.label .vega-counter-badge{position:relative;height:20px;padding-left:8px}.vega-tab>div>.label .vega-counter-badge vega-counter-badge{position:absolute;padding-left:8px;top:10px}.vega-tab>div>.label .vega-counter-badge.one-digit{width:20px}.vega-tab>div>.label .vega-counter-badge.one-digit vega-counter-badge{left:10px}.vega-tab>div>.label .vega-counter-badge.two-digits{width:28px}.vega-tab>div>.label .vega-counter-badge.two-digits vega-counter-badge{left:14px}.vega-tab>div>.label .vega-counter-badge.multi-digits{width:32px}.vega-tab>div>.label .vega-counter-badge.multi-digits vega-counter-badge{left:16px}.vega-tab>div>.label.vega-close-icon-space{padding-right:12px}.vega-tab>div>div.vega-close-icon{padding-left:0px;flex-grow:0;padding-right:13px}.vega-tab>div>div.vega-hidden{display:none}.vega-tab>div vega-icon{color:rgba(var(--v-text-primary, 32, 54, 69, 1));box-sizing:content-box}.vega-tab>div>div.vega-close-icon vega-icon{color:rgba(var(--v-text-input-placeholder, 176, 180, 181, 1))}.vega-tab.disabled{pointer-events:none;background-color:rgba(var(--v-bg-action-quaternary, 222, 225, 227, 1))}.vega-tab.disabled .label,.vega-tab.disabled vega-icon{color:rgba(var(--v-text-disabled, 176, 180, 181, 1))}:host{display:block;width:100%;text-align:left;line-height:normal;min-width:270px}.horizontal-divider{height:1px;background-color:rgba(var(--v-bg-divider, 171, 198, 216, 1));width:100%;display:none;margin-top:-1px}.tab-content-container{display:flex;gap:8px;justify-content:space-between}.tab-content-container.more-tab .tab-list{width:100%}div.tab-left-button,div.tab-right-button{display:inline-block;cursor:pointer;border-top-left-radius:8px;border-top-right-radius:8px;background-color:rgba(var(--v-bg-action-quaternary, 222, 225, 227, 1));color:rgba(var(--v-text-primary, 32, 54, 69, 1))}div.tab-left-button.vega-hidden,div.tab-right-button.vega-hidden{display:none}div.tab-left-button vega-icon,div.tab-right-button vega-icon{box-sizing:content-box;padding:13px 13px 13px 12px}.vega-tab-group-content vega-tab-group-panel{display:none}.vega-tab-group-content vega-tab-group-panel.active{display:block}.tab-style-secondary .vega-tab>div.vega-tab-container{align-items:baseline}.tab-style-secondary+.horizontal-divider{display:block}.tab-style-secondary .vega-tab{background-color:rgba(var(--v-bg-transparent, 0, 0, 0, 0))}.tab-style-secondary .vega-tab>div>.label{padding-left:16px;padding-right:16px;padding-top:0px;padding-bottom:12px}.tab-style-secondary .vega-tab.selected>div>.label,.tab-style-secondary .vega-tab.selected>div>.label vega-icon,.tab-style-secondary .vega-tab:hover>div>.label,.tab-style-secondary .vega-tab:hover>div>.label vega-icon{color:rgba(var(--v-text-link, 19, 98, 226, 1))}.tab-style-secondary .vega-tab{border-top-width:0px;border-left-width:0px;border-right-width:0px;border-bottom-width:2px;border-style:solid;border-color:transparent}.tab-style-secondary .vega-tab.selected{border-color:rgba(var(--v-border-color-action, 19, 98, 226, 1))}.tab-style-secondary div.tab-left-button,.tab-style-secondary div.tab-right-button{background-color:rgba(var(--v-bg-transparent, 0, 0, 0, 0))}.tab-style-secondary div.tab-left-button vega-icon,.tab-style-secondary div.tab-right-button vega-icon{padding:6px 13px 13px 6px}.tab-style-secondary div.tab-left-button:hover vega-icon,.tab-style-secondary div.tab-right-button:hover vega-icon{color:rgba(var(--v-text-link, 19, 98, 226, 1))}';var ee=function(e,t,a,i){var o,n=arguments.length,r=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,a):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,a,i);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(r=(n<3?o(r):n>3?o(t,a,r):o(t,a))||r);return n>3&&r&&Object.defineProperty(t,a,r),r};const te=class{constructor(e){a(this,e),this.globalSlimmers={},this.clickEventPrevent=new P([y],(()=>this.host),void 0,!0),this.vegaComponentUsageRuntimeMetricsSlimmer=new b,this.isActive=!1}connectedCallback(){this.notifyGroupAddOrDelPanel("ADD")}disconnectedCallback(){this.notifyGroupAddOrDelPanel("DEL")}componentWillLoad(){this.notifyGroupAddOrDelPanel("ADD")}render(){return r(e(o,{class:this.isActive?"active":""},e("slot",null)),this.host)}notifyGroupAddOrDelPanel(e){x.notify(T,{host:this.host,type:e})}get host(){return n(this)}};ee([v()],te.prototype,"globalSlimmers",void 0),ee([c()],te.prototype,"clickEventPrevent",void 0),ee([c()],te.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),te.style=":host{display:none}:host(.active){display:block}";export{Z as vega_tab_group,te as vega_tab_group_panel}
@@ -1 +1 @@
1
- import{S as t}from"./p-b7721666.js";import{i as s}from"./p-e4c4ea35.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-31ebace1.js";import{i as s}from"./p-78ba7ca9.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,3 +1,3 @@
1
- import{g as t,e,c as n,h as s,A as r,T as i,q as o,H as a,r as l,l as c,t as h,u,v as d,w as m,x as w,I as T,n as p,S as g,j as E,B as f,y as k,d as R,z as B,D as x,o as I,E as b,s as O,N as L,F as y,G as N,J as C,K as A,m as H,L as j,M as v,O as S,P as $,Q as D,U as M,W as P,X as F,Y as z,Z as V,_ as U,$ as W,a0 as G,a1 as J,a2 as K,R as Y,a3 as X,p as Q,a4 as Z,a5 as _,a6 as q,b as tt,a7 as et,a8 as nt,a9 as st,aa as rt}from"./p-84eb3b9c.js";import{g as it}from"./p-8b5d3a52.js";import{i as ot}from"./p-e4c4ea35.js";import{C as at}from"./p-2d0d575f.js";import{d as lt}from"./p-f28a6074.js";import{c as ct,d as ht}from"./p-6c43d54a.js";import{r as ut,i as dt}from"./p-6e70d3cc.js";import{c as mt}from"./p-a841cf13.js";import{L as wt}from"./p-6e1ab235.js";class RTEListItemBlock extends e{constructor(t,e,n){super(t,"list-item",n),this.nestList=[],this.nestList=e}static from(t,e={autoMatchFormat:!0}){const s=new RTEListItemBlock(t.id,void 0,e);s.children=t.nodes.map((t=>n.from(t,s,e))),t.children&&(s.nestList=t.children.map((t=>{const e=RTEListBlock.from(t);return e.parent=s,e})));const{annotations:r}=t;return r&&Object.entries(r).forEach((([t,e])=>{const n=this.createAnnotationEntity(t,e);ot(n)&&s.annotationMap.set(...n)})),s}toJSON(){var t;return Object.assign(Object.assign({},super.toJSON()),{type:"list-item",children:null===(t=this.nestList)||void 0===t?void 0:t.map((t=>t.toJSON()))})}toHtml(t){return[`<li${super.generateAttributeString(t)}>`,this.getChildrenHtml(t),"</li>"].join("")}cloneWithNodes(t){const e=new RTEListItemBlock(it());return e.children=[],e.apply(new s(t)),e}getLastNode(){return this.nestList&&this.nestList.length>0?this.nestList[this.nestList.length-1].getLastNode():super.getLastNode()}createNewListItem(){return new RTEListItemBlock(it())}clone(t){var e;const n=new RTEListItemBlock(this.id);return n.children=this.children.map((t=>t.clone(n))),n.annotationMap=super.cloneAnnotations(),n.nestList=null===(e=this.nestList)||void 0===e?void 0:e.map((t=>t.clone(n))),n.parent=t,n}}r.register(i.name,RTEListItemBlock.name,new o),r.register(a.name,RTEListItemBlock.name,new l),r.register(c.LINE_BREAK_SINGLE_BLOCK,RTEListItemBlock.name,new h),r.register(c.LINE_BREAK_MULTIPLE_BLOCKS,RTEListItemBlock.name,new u),r.register(c.DELETE_NEST_LIST,RTEListItemBlock.name,new class extends t{handleAction(t,e){e.nestList&&(e.nestList=e.nestList.length>1?e.nestList.filter((e=>e!==t.nestListBlockToBeRemoved)):void 0)}}),r.register(c.SPLIT_BLOCK_WITH_NODE,RTEListItemBlock.name,new d),r.register(c.REPLACE_CHILD_NODES,RTEListItemBlock.name,new m),r.register(c.REPLACE_NEST_LIST,RTEListItemBlock.name,new class extends t{handleAction(t,e){t.newList.forEach((t=>{t.parent=e})),e.nestList=t.newList}}),r.register(c.MERGE_TWO_BLOCKS_NODES,RTEListItemBlock.name,new w),r.register(c.INSERT_IMAGE_TO_BLOCK,RTEListItemBlock.name,new class extends t{handleAction(t,e){e.parent.apply(t)}});class Tt extends f{constructor(){super(...arguments),this.type=k.LIST}static getDefaultStyles(){return{paddingLeft:"8px",marginLeft:"16px"}}renderStyle(t){return(null==t?void 0:t.standalone)?Tt.getDefaultStyles():null}renderClass(t){return(null==t?void 0:t.standalone)?null:"v-rte--list"}clone(){return new Tt}toJSON(){}}class RTEListBlock extends R{constructor(t,e,n){super(t),this.type="bullet-list",this.children=[],this.type=e;const{autoMatchFormat:s}=n||{autoMatchFormat:!0};s&&this.annotationMap.set(k.LIST,new Tt)}static from(t,e={autoMatchFormat:!0}){const n=new RTEListBlock(t.id,t.type,e),{annotations:s}=t;return s&&Object.entries(s).forEach((([t,e])=>{const s=this.createAnnotationEntity(t,e);ot(s)&&n.annotationMap.set(...s)})),n.children=t.blocks.map((t=>{const s=RTEListItemBlock.from(t,e);return s.parent=n,s})),n}static createAnnotationEntity(t,e){switch(t){case"customAttribute":return I.from(e);case"customClass":return x.from(e);case"customStyle":return B.from(e)}}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{id:this.id,type:this.type,blocks:this.children.map((t=>t.toJSON()))})}toHtml(t){const e=this.getBlockTag();return[`<${e}${super.generateAttributeString(t)}>`,this.children.map((e=>e.toHtml(t))).join(""),`</${e}>`].join("")}isNotEmpty(){return this.children.length>0}getLastNode(){return this.children[this.children.length-1].getLastNode()}clone(t){const e=new RTEListBlock(this.id,this.type);return e.children=this.children.map((t=>t.clone(e))),e.annotationMap=super.cloneAnnotations(),e.parent=t,e}getBlockTag(){return"number-list"===this.type?"ol":"ul"}}r.register(c.TRANSFORM_LIST_BLOCK,RTEListBlock.name,new class extends t{handleAction(t,e){const n=t.selectedBlocks,r=e.parent.createList(t.listType);if(n.every((t=>t.parent===e)))r.apply(new s(e.children)),e.parent.apply(new T(e,r)),e.parent.apply(new p(e)),n.forEach((t=>t.children.map((t=>t.apply(new g)))));else{const n=t.selectedBlocks.map((t=>e.parent.toListItem(t)));r.apply(new s(n)),e.parent.apply(new T(e,r)),t.selectedBlocks.forEach((t=>{t.parent.apply(new p(t))})),0===e.children.length&&e.parent.apply(new p(e))}}}),r.register(c.TRANSFORM_PARAGRAPH_BLOCK,RTEListBlock.name,new class extends t{handleAction(t,e){let n=!1,r=!1;const i=t.selectedBlocks,o=i.map((t=>(t.children.map((t=>t.apply(new g))),t===e.children[0]&&(n=!0),t===e.children[e.children.length-1]&&(r=!0),this.toParagraph(t))));if(n)e.parent.apply(new E(e,...o));else if(r)e.parent.apply(new T(e,...o));else{const t=e.children.indexOf(i[0]),n=e.children.indexOf(i[i.length-1]),r=e.parent.createList(e.type);r.apply(new s(e.children.slice(0,t)));const a=e.parent.createList(e.type);a.apply(new s(e.children.slice(n+1))),e.parent.apply(new E(e,r,...o,a)),e.parent.apply(new p(e))}i.map((t=>{e.apply(new p(t))})),0===e.children.length&&e.parent.apply(new p(e))}toParagraph(t){const n=new e(it(),"paragraph");return n.apply(new s(t.children)),n.annotationMap=t.annotationMap,n}}),r.register(c.INSERT_IMAGE_TO_BLOCK,RTEListBlock.name,new class extends t{handleAction(t,e){e.parent.apply("list-item"!==e.parent.type?new T(e,t.imageBlockToBeInserted):t)}});class pt{}class gt{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(ot)),e}}const Et=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)}},ft=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 gt(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 Et.getElementToBlockStrategies()}};class kt extends t{handleAction(t,e){const n=t.entityToBeAppended;e.children&&(n.forEach((t=>{t.parent=e})),e.children=e.children.concat(n))}}class Rt 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 Bt extends Rt{handleAction(t,e){this.replaceElementWithElements(e,t.referChildren,[t.referChildren,...t.childrenToBeInserted])}}class xt extends L{constructor(t,e){super(),this.type=y.IMAGE,this.size=t,this.alt=e}static from(t,e){return[y.IMAGE,new xt(t,e)]}static getDefaultStyles(){return{verticalAlign:"bottom"}}toJSON(){return ot(this.alt)?{size:this.size,alt:this.alt}:{size:this.size}}clone(){return new xt(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=xt.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%"})}}}xt.BASE_STYLES={verticalAlign:"bottom"};class RTEImageNode extends N{constructor(t,e,n,s){super(t,s),this.type=C.IMAGE,this.url=e,this.parent=n}static from(t,e,n={autoMatchFormat:!0}){const s=new RTEImageNode(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?xt.from(l.size,l.alt):this.createAnnotationEntity(t,l[t]))).filter(ot)),s}toJSON(){const t=Array.from(this.annotationMap.values()).filter((t=>t instanceof xt||t instanceof A)).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 RTEImageNode(this.id,this.url,t,super.cloneAnnotations())}toHtml(t){const e=this.getAnnotationByType(y.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(ot))}>`}doAnnotationActionApply(t){const e=r.get(H.name,RTEImageNode.name);e&&e.execute(t,this)}doModifyActionApply(t){r.executeTheStrategy(t,this)}}r.register(c.UPDATE_IMAGE_NODE_URL,RTEImageNode.name,new class extends t{handleAction(t,e){e.url=t.url}}),r.register(H.name,RTEImageNode.name,new class extends t{handleAction(t,e){const n=t.toAnnotation();e.annotationMap.set(n.type,n)}});class It extends v{constructor(t,e){super(),this.type=c.INSERT_NEW_PARAGRAPH,this.startContainerNode=t,this.startOffset=e}}class RTEImageBlock extends R{constructor(t){super(t),this.type="image",this.children=[]}static from(t,e={autoMatchFormat:!0}){const n=new RTEImageBlock(t.id),{annotations:s}=t;return n.children=t.nodes.map((t=>RTEImageNode.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 RTEImageBlock(it())}clone(t){const e=new RTEImageBlock(this.id);return e.children=this.children.map((t=>t.clone(e))),e.annotationMap=super.cloneAnnotations(),e.parent=t,e}}r.register(c.MERGE_TWO_BLOCKS_NODES,RTEImageBlock.name,new w),r.register(c.REPLACE_CHILD_NODES,RTEImageBlock.name,new m),r.register(c.SPLIT_BLOCK_WITH_NODE,RTEImageBlock.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 j(t));const i=this.cloneWithNodes(r,n);return n.parent.apply(new T(n,i)),i}}cloneWithNodes(t,e){const n=e.createNewImageBlock();return n.children=[],n.apply(new s(t)),n}}),r.register(c.LINE_BREAK_SINGLE_BLOCK,RTEImageBlock.name,new class extends t{handleAction(t,e){const n=new It(t.startContainerNode,t.startOffset);e.apply(n);const s=n.newBlock;s&&(t.lineBreakNode=s.children[0])}}),r.register(c.LINE_BREAK_MULTIPLE_BLOCKS,RTEImageBlock.name,new class extends t{handleAction(t,e){t.lineBreakNode=this.lineBreakMultipleBlocks(t.selectedBlocks,e)}lineBreakMultipleBlocks(t,r){const i=e.from({id:it(),type:"paragraph",nodes:[{id:it(),type:"text",text:"\n"}]});r.parent.apply(new T(r,i));const o=this.concatBlocksNodes(t.slice(1));return(0===o.length||o[0]&&""===o[0].text)&&o.push(new n(it(),"\n",i)),i.apply(new s(o)),i.children[0]}concatBlocksNodes(t){const e=[];return t.map((t=>{"image"!==t.type&&(e.push(...t.children),t.parent.apply(new p(t)))})),e}}),r.register(c.INSERT_IMAGE_TO_BLOCK,RTEImageBlock.name,new class extends t{handleAction(t,e){const n=t.splitPointNode,r=t.startOffsetOfNode,i=t.imageBlockToBeInserted;e.children.length<1?e.apply(new s(i.children)):this.isCaretPositionAtBlockEnd(e,n,r)?e.parent.apply(new T(e,i)):this.isCaretPositionAtBlockStart(e,n,r)?e.parent.apply(new E(e,i)):(e.apply(new S(n,r)),e.parent.apply(new T(e,i)))}}),r.register(a.name,RTEImageBlock.name,new l);class RTEHtmlBlock extends R{constructor(t,e){super(t),this.type="html-block",this.children=[],this.htmlTag=e}static from(t,e){const n=new RTEHtmlBlock(t.id,t.htmlTag),{annotations:s}=t;return s&&super.convertAnnotationsToMap(n.annotationMap,s),n.children=this.generateBlockChildren(t.children,e,n),n}clone(t){const e=new RTEHtmlBlock(this.id,this.htmlTag);return e.children=this.children.map((t=>t.clone(e))),e.annotationMap=super.cloneAnnotations(),e.parent=t,e}getLastNode(){return this.children[this.children.length-1].getLastNode()}isNotEmpty(){return!0}toHtml(t){const e=this.htmlTag,n=super.generateAttributeString(t);return $.has(this.htmlTag)?`<${e}${n}>`:[`<${e}${n}>`,this.children.map((e=>e.toHtml(t))).join(""),`</${e}>`].join("")}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{id:this.id,type:this.type,htmlTag:this.htmlTag,children:this.children.map((t=>t.toJSON()))})}}class bt extends v{constructor(t){super(),this.type=c.MERGE_TWO_BLOCKS_NODES,this.blockNeedToBeMerged=t}}class Ot extends D{handleAction(t,e){const{startContainerNode:n}=t;n.isContentEditable()?n.isTextNode()&&this.deleteTextNodeContent(t,e):this.deleteDecoratorNodeContent(t,e);const s=e.parent;s&&e.isListItemBlock()&&0===s.children.length&&s.parent.apply(new p(s))}deleteTextNodeContent(t,e){const n=t.startContainerNode,s=t.startOffset;if(0!==s&&!n.isEmpty()){const r=n.text.slice(0,s-1)+n.text.slice(s);if(n.apply(new M(r)),r)return void(t.previousNode=n);{const s=this.getPreviousNode(n);return s&&s.parent===e&&"\n"===s.text||1===e.children.length?void(t.previousNode=n):(e.apply(new p(n)),void(t.previousNode=s))}}{let s=this.getPreviousNode(n),r=null;const i=n.isEmpty();if(e.children.length&&s&&s.parent!==e)i&&e.apply(new p(n)),e.type===s.parent.type&&s.parent.apply(new bt(e));else if(this.isContentFirstNode(n)&&i&&(r=this.getNextNode(n)),i&&e.apply(new p(n)),s&&s.isTextNode()&&(s.isEmpty()||!s.isContentEditable()&&s.parent===e)){const t=s;s=this.getPreviousNode(s),t.parent.apply(new p(t)),s||i||(r=n)}0===e.children.length&&e.parent.apply(new p(e)),s?t.previousNode=s:r&&(t.nextNode=r)}}deleteDecoratorNodeContent(t,e){const n=t.startContainerNode,s=t.startOffset;let r=this.getPreviousNode(n),i=null;if(0!==s){const t=e;this.isContentFirstNode(n)&&(i=this.getNextNode(n)),1===t.children.length?t.parent.apply(new p(t)):t.apply(new p(n))}else{const e=r;e&&!e.isContentEditable()&&(r=this.getPreviousNode(e),e.parent.apply(new p(e)),r||(t.nextNode=n))}r?t.previousNode=r:i&&(t.nextNode=i)}}class Lt extends t{handleAction(t,e){const{startContainerNode:n}=t;t.newBlock=this.breakSingleBlock(n,t.startOffset,e)}breakSingleBlock(t,e,n){const s=this.getNewParagraph(t);if(s){if(this.isCaretPositionAtBlockEnd(n,t,e))n.parent.apply(new T(n,s));else{if(!this.isCaretPositionAtBlockStart(n,t,e)){const s=new S(t,e);return n.apply(s),s.newBlock}n.parent.apply(new E(n,s))}return s}}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(y.LINK),e.apply(new s([n]))),e}}}class yt extends v{constructor(t,e,n=!1){super(),this.isFlushable=!0,this.type=c.UPDATE_CURSOR_POSITION,this.immediatelyRun=!1,this.nextFocusNode=t,this.offset=e,this.immediatelyRun=n,this.immediatelyRun&&(this.isFlushable=!1)}}class Nt extends t{handleAction(t,e){const{rteRange:n,nodeToBeInserted:s}=t,{startNode:r,startOffset:i}=n;if(r){const t=e;if(r.isContentEditable()&&r.isTextNode())if("\n"!==r.text&&r.text&&0!==i){const e=r.text.substring(0,i),n=r.text.substring(i),o=r.cloneWithText(e),a=r.cloneWithText(n),l=[o,s];n&&l.push(a),t.apply(new E(r,...l)),t.apply(new p(r))}else t.apply(new E(r,s));else t.apply(0!==i?new T(r,s):new E(r,s));this.updateCursorPosition(s)}}updateCursorPosition(t){const e=this.getRootContent(t.parent);e&&e.apply(new yt(t))}}class Ct extends t{handleAction(t,e){const{text:n,offset:s,decoratorNode:r}=t,i=this.createNewParagraph(n);if(i){const t=i.children[0];e.apply(0!==s?new T(r,t):new E(r,t)),this.setTheCursorPosition(t)}}setTheCursorPosition(t){const e=this.getRootContent(t.parent);e&&e.apply(new yt(t))}}class At extends t{handleAction(t,e){t.newBlock=this.breakSingleListItemBlock(t.startContainerNode,t.startOffset,e)}breakSingleListItemBlock(t,e,n){const r=n.createNewListItem(),i=this.copyInlineStyleToNewNode(t);if(r.apply(new s([i])),this.isCaretPositionAtBlockEnd(n,t,e))return this.breakListItemAtEnd(r,n);if(!this.isCaretPositionAtBlockStart(n,t,e)){const s=new S(t,e);return n.apply(s),s.newBlock}return n.parent.apply(new E(n,r)),r}breakListItemAtEnd(t,n){const r=n.parent.children[n.parent.children.length-1],i=1===n.children.length&&n.children[0].isEmpty();if(n===r&&i){const r=n.parent.parent;if("list-item"!==r.type){const i=e.from({id:it(),type:"paragraph",nodes:[]});return i.apply(new s(t.children)),r.apply(new T(n.parent,i)),n.parent.apply(new p(n)),i}r.parent.apply(new T(r,t)),n.parent.apply(new p(n))}else n.parent.apply(new T(n,t));return t}copyInlineStyleToNewNode(t){const e=t.cloneWithText("");return e.annotationMap.delete(y.LINK),e}}class Ht extends v{constructor(t){super(),this.type=c.DELETE_NEST_LIST,this.nestListBlockToBeRemoved=t}}class jt extends P{handleAction(t,e){super.handleAction(t,e);const n=e.parent;0===e.children.length&&n&&n.apply("list-item"===n.type?new Ht(e):new p(e))}}class vt extends t{handleAction(t,e){if(e.parent){const{blocksToBeInserted:n,startNode:s,startOffset:r}=t;let i=e;if(s===e.children[0]&&0===r)e.parent.apply(new E(e,...n));else{const t=new S(s,r);e.apply(t),e.parent.apply(new T(e,...n)),i=t.newBlock}t.futureFocusBlock=i}}}const St=new class{registerBlockBasicStrategies(t){r.register(c.DELETE_CHILDREN,t,t===RTEListBlock.name?new jt:new P),r.register(c.APPEND_CHILDREN,t,new kt),r.register(c.INSERT_CHILDREN_BEFORE,t,new Rt),r.register(c.INSERT_CHILDREN_AFTER,t,new Bt),r.register(c.DELETE_BLOCK_CONTENT,t,new Ot),r.register(c.INSERT_NEW_PARAGRAPH,t,t===RTEListItemBlock.name?new At:new Lt),r.register(c.INSERT_TEXT_TO_DECORATOR_NODE,t,new Ct),r.register(c.INSERT_NODE_TO_NEAREST_ROOT,t,new Nt),r.register(c.PASTE_CONTENT,t,new vt)}};class $t{}class Dt extends $t{canHandle(t){return"RTETextNode"===t.name}handle(t,e={}){return this.isBold(t)||e.bold?{bold:!0}:{}}isBold(t){return"STRONG"===t.nodeName||"B"===t.nodeName||t.style.fontWeight===F||t.style.fontWeight===z||t.classList.contains("v-rte--bold")}}class Mt extends $t{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 Pt extends $t{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 Ft extends $t{canHandle(t,e){return!e.skipCustomAnnotations&&!!t}handle(t){const e=V(t);return Object.keys(e).length>0?{customStyle:e}:{}}}class zt extends $t{canHandle(t){return["RTETextBlock","RTEListItemBlock","RTEListBlock"].includes(t.name)}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 Vt extends $t{canHandle(t){return["RTETextBlock","RTEListItemBlock","RTEListBlock"].includes(t.name)}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 Ut extends $t{canHandle(t){return"RTETextNode"===t.name}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 Wt extends $t{canHandle(t){return"RTETextNode"===t.name}handle(t,e={}){const n=this.getColor(t)||e.textColor;return n?{textColor:n}:{}}getColor(t){var e;const n=null===(e=ut(t.style.color))||void 0===e?void 0:e.toUpperCase();if(n){const t=U.filter((t=>t.key!==W.key)).find((t=>t.light===n||t.dark===n));return t?t.key:null}for(const e of U)if(t.style.color.includes(e.key))return e.key;return null}}class Gt extends $t{canHandle(t){return"RTETextNode"===t.name}handle(t,e={}){return this.isItalic(t)||e.italic?{italic:!0}:{}}isItalic(t){return"I"===t.nodeName||t.style.fontStyle===G||"EM"===t.nodeName||t.classList.contains("v-rte--italic")}}class Jt extends $t{canHandle(t,e){return!!e.autoMatchFormat&&"RTETextBlock"===t.name}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 Kt{static isTitleOrSubtitle(t){if("DIV"===t.nodeName){const e=Kt.textStyleHandler.getTextStyle(t);return"title"===e||"subtitle"===e}return!1}static isLinkElement(t){return"A"===t.nodeName}}Kt.textStyleHandler=new Jt;class Yt extends $t{constructor(){super(...arguments),this.handlers=[new Mt,new Pt,new Ft]}canHandle(t){return"RTETextNode"===t.name}handle(t,e={}){return e.link?{link:e.link}:Kt.isLinkElement(t)?{link:this.generateLinkAnnotations(t)}:{}}generateLinkAnnotations(t){const e={href:t.getAttribute("href")||"",groupKey:it()};return this.handlers.forEach((n=>{Object.assign(e,n.handle(t))})),e}}class Xt extends $t{canHandle(t){return"RTETextNode"===t.name}handle(t,e={}){return this.isStrikethrough(t)||e.strikethrough?{strikethrough:!0}:{}}isStrikethrough(t){return t.style.textDecoration.includes(J)||"S"===t.nodeName||"DEL"===t.nodeName||t.classList.contains("v-rte--strikethrough")}}class Qt extends $t{canHandle(t){return"RTETextNode"===t.name}handle(t,e={}){return this.isUnderline(t)||e.underline?{underline:!0}:{}}isUnderline(t){return t.style.textDecoration.includes(K)||"U"===t.nodeName||"INS"===t.nodeName||t.classList.contains("v-rte--underline")}}class Zt extends $t{canHandle(t){return"RTEImageNode"===t.name}handle(t){const e=this.getImageSize(t);return e?{size:e}:{}}getImageSize(t){return t.getAttribute("data-size")?t.getAttribute("data-size"):null}}class _t extends $t{canHandle(t){return"RTEImageNode"===t.name}handle(t){return t.hasAttribute("alt")?{alt:t.getAttribute("alt")}:{}}}const qt=new Set(["P","H1","H2","H3","H4","H5","H6","LI"]),te=new Set(["P","H1","H2","H3","H4","H5","H6","LI","UL","OL","IMG","CODE"]),ee=new Set(["BR","VEGA-RICH-TEXT-LINK-EDITOR","CODE","A"]),ne=new Set(["TABLE","THEAD","TBODY","TFOOT","TR","DL"]),se=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 re(t){return qt.has(t.parentElement.nodeName)}class ie extends $t{constructor(){super(...arguments),this.customAttributeHandler=new Mt,this.customStyleAnnotationHandler=new Ft,this.customClassAnnotationHandler=new Pt}canHandle(t,e){return"RTETextNode"===t.name&&!1===e.autoMatchFormat}handle(t,e){if(te.has(t.nodeName)&&!ee.has(t.nodeName))return{};const n=this.generateInlineHtmlAnnotation(t,Object.assign({},e));return n?{inlineHtml:n}:{}}generateInlineHtmlAnnotation(t,e){let{inlineHtml:s}=e;const r=Array.from(t.childNodes).some((t=>t.nodeType===Node.ELEMENT_NODE));if(!n.supportsHtmlTag(t.nodeName.toLowerCase())||r){const e=Object.assign(Object.assign({htmlTag:t.nodeName.toLowerCase()},r?{groupId:it()}:{}),{customAttribute:this.customAttributeHandler.handle(t).customAttribute,customStyle:this.customStyleAnnotationHandler.handle(t).customStyle,customClass:this.customClassAnnotationHandler.handle(t).customClass});s=s?this.appendToInlineHtmlChain(s,e,t.parentNode):e}return s?Object.assign({},s):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 oe=new class{constructor(){this.handlers=[new Vt,new zt,new Dt,new Gt,new Qt,new Xt,new Wt,new Yt,new Ut,new Zt,new _t,new Mt,new Pt,new Ft,new Jt,new ie]}registerHandler(t){this.handlers.unshift(t)}generate(t,e,n={autoMatchFormat:!0}){n&&n.filterInlineStyles&&Y.executeTheStrategyRefillAction(t.name,e);const s=Kt.isLinkElement(e)&&"RTETextNode"===t.name,r=this.handlers.filter((t=>!(!n.autoMatchFormat&&s)||t instanceof Yt)).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=Y.getStrategies(t.name);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=X.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 ae extends pt{constructor(){super(...arguments),this.annotationHandler=new Jt}generateChildNodes(t,e,s){const r=[],i=!(!s||!1!==s.autoMatchFormat),o=Object.assign({},e);return t.forEach((t=>{const a=Et.getElementToNodeStrategies().find((e=>e.canHandle([t],0,s)>0));let l=null;if(a&&(l=a.handle([t],s,o)),l)r.push(l);else if(dt(t)&&t.childNodes.length>0){const a=oe.generate(n,t,Object.assign({parentAnnotations:i?{inlineHtml:o.inlineHtml,link:o.link,code:o.code}:e},s));r.push(...this.generateChildNodes(Array.from(t.childNodes),a,s))}})),r}matchTextBlockType(t){var e;return null!==(e=this.annotationHandler.handle(t).textStyle)&&void 0!==e?e:"paragraph"}}class le extends ae{canHandle(t,e){return"PRE"!==t[e].tagName&&"CODE"!==t[e].tagName||!t[e].hasAttribute("data-language")?0:1}handle(t){const e=t[0];if(e){const t=e.textContent,n=e.dataset.language;return b.from({id:it(),type:"code-block",content:t,language:n})}}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}class ce extends ae{createRTEImageBlock(t,e){const n=!(e&&e.autoMatchFormat||!t.parentNode||"DIV"===t.parentNode.nodeName);return RTEImageBlock.from({id:it(),type:"image",nodes:[{id:it(),type:"image",url:t.src,annotations:oe.generate(RTEImageNode,t,e)}],annotations:Object.assign(Object.assign({},oe.generate(RTEImageBlock,t.parentElement,e)),{internalWrapper:n})},e)}}class he extends pt{shouldProceedToElementChildren(){return!1}appendChildBlocks(){}generateTextNode(t,e){return{id:it(),type:"text",text:t,annotations:e}}}class ue extends Q{constructor(){super(...arguments),this.stylesToBeFiltered={}}get alwaysFilter(){return!0}filterAnnotations(t){const{textAlign:e,customStyle:n}=t;return e&&n?(this.stylesToBeFiltered=_.getDefaultStyles(e),super.filterAnnotations(t)):t}}class de extends Q{constructor(){super(...arguments),this.stylesToBeFiltered=X.getDefaultStyles("paragraph"),this.type="paragraph",this.elementTagName="p"}filterAnnotations(t){return t}canFilter(t){return Z.isTextBlock(t.constructor.name)&&t.type===this.type}canRefill(t,e){const n=this.classNameToBeAdded?`.${this.classNameToBeAdded}`:this.elementTagName;return Z.isTextBlock(t)&&e.matches(n)}toCssText(){return this.buildCssTextForStyles(this.elementTagName,this.classNameToBeAdded)}}class me extends de{constructor(t){super(),this.type="heading-1",this.elementTagName="h1",this.type=`heading-${t}`,this.elementTagName=`h${t}`,this.stylesToBeFiltered=X.getDefaultStyles(this.type)}}class we extends de{constructor(t){super(),this.type="title",this.elementTagName="div",this.classNameToBeAdded="v-rte-title",this.type=t,this.classNameToBeAdded=`v-rte-${t}`,this.stylesToBeFiltered=X.getDefaultStyles(this.type)}}class Te extends Q{constructor(){super(...arguments),this.stylesToBeFiltered=Te.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 Z.isTextNode(t.constructor.name)&&this.parentBlockIsHeadingOrTitle(t)}canRefill(t,e){return Z.isTextNode(t)&&"SPAN"===e.nodeName&&this.isHeadingOrTitleChild(e)}toCssText(){return`${this.parentElementSelectors.map((t=>`.${Te.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(Te.NON_HEADING_TITLE_ELEMENT_TAGS.includes(e.tagName))return!1;e=e.parentElement}return!1}}Te.BOLD_STYLES={fontWeight:"700"},Te.NON_HEADING_TITLE_ELEMENT_TAGS=["TD","TH","TR","TABLE","THEAD","TBODY","DIV","BODY"];class pe extends me{constructor(t){super(t),this.classNameToBeAdded=`v-rte-h${t}`,this.elementTagName="li"}canFilter(t){return Z.isListItemBlock(t.constructor.name)&&this.isBlockOrNodeStylesMatchFilterStyles(t,["fontSize","lineHeight"])}canRefill(t,e){return Z.isListItemBlock(t)&&e.matches(this.elementTagName)&&e.classList.contains(this.classNameToBeAdded)}}class ge extends we{constructor(t){super(t),this.classNameToBeAdded=`v-rte-${t}`,this.elementTagName="li"}canFilter(t){return Z.isListItemBlock(t.constructor.name)&&this.isBlockOrNodeStylesMatchFilterStyles(t,["fontSize","lineHeight"])}canRefill(t,e){return Z.isListItemBlock(t)&&e.matches(this.elementTagName)&&e.classList.contains(this.classNameToBeAdded)}}tt.registerRTEDTOClass("paragraph",e),tt.registerRTEDTOClass("title",e),tt.registerRTEDTOClass("subtitle",e),tt.registerRTEDTOClass("heading-1",e),tt.registerRTEDTOClass("heading-2",e),tt.registerRTEDTOClass("heading-3",e),tt.registerRTEDTOClass("heading-4",e),tt.registerRTEDTOClass("heading-5",e),tt.registerRTEDTOClass("heading-6",e),tt.registerRTEDTOClass("heading-6",e),tt.registerRTEDTOClass("list-item",RTEListItemBlock),tt.registerRTEDTOClass("bullet-list",RTEListBlock),tt.registerRTEDTOClass("number-list",RTEListBlock),tt.registerRTEDTOClass("image",RTEImageBlock),tt.registerRTEDTOClass("code-block",b),tt.registerRTEDTOClass("html-block",RTEHtmlBlock),tt.registerRTEDTOClass("text",n),tt.registerRTEDTOClass("image",RTEImageNode),St.registerBlockBasicStrategies(e.name),St.registerBlockBasicStrategies(RTEListBlock.name),St.registerBlockBasicStrategies(RTEListItemBlock.name),St.registerBlockBasicStrategies(RTEImageBlock.name),St.registerBlockBasicStrategies(RTEHtmlBlock.name),Et.registerElementToBlockStrategy(new class extends ae{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,s){const r=t[0].parentElement,i=s&&s.autoMatchFormat,o=this.generateChildNodes(t,i?oe.generate(n,r,Object.assign(Object.assign({},s),{skipCustomAnnotations:!0})):{},s),a=i?super.matchTextBlockType(r):this.matchTextBlockTypeByTagName(r),l=!i&&!a;return e.from(Object.assign({id:it(),type:a||"paragraph",nodes:o},l?{annotations:{internalWrapper:l}}:{annotations:oe.generate(e,r,s)}),s)}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||!!ee.has(t.nodeName)||!this.isDedicatedBlockTag(t.nodeName)&&(!(!1!==e.autoMatchFormat||!re(t))||this.isInlineLeafOrWrapper(t))}isDedicatedBlockTag(t){return te.has(t)&&!ee.has(t)}isInlineLeafOrWrapper(t){return 0===t.childNodes.length?se.has(t.nodeName):this.isTextOnlyElement(t)?se.has(t.nodeName)||ee.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}}),Et.registerElementToBlockStrategy(new class extends ce{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}}),Et.registerElementToBlockStrategy(new class extends ce{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(ot(s))return RTEImageBlock.from({id:it(),type:"image",nodes:[{id:it(),type:"image",url:s.src,annotations:oe.generate(RTEImageNode,n,e)}],annotations:oe.generate(RTEImageBlock,n.parentElement,e)},e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),Et.registerElementToBlockStrategy(new class extends ce{canHandle(t,e){return"IMG"===t[e].tagName?1:0}handle(t,e){return this.createRTEImageBlock(t[0],e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),Et.registerElementToBlockStrategy(new class extends ae{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,n){const s=this.generateChildNodes(Array.from(t[0].childNodes),{},n);return 0===s.length?null:e.from({id:it(),type:super.matchTextBlockType(t[0]),nodes:s,annotations:oe.generate(e,t[0],n)},n)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),Et.registerElementToBlockStrategy(new class extends ae{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)?RTEListItemBlock.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)))}shouldProceedToElementChildren(){return!0}generateWithListBlock(t,e){return RTEListBlock.from({id:it(),type:"bullet-list",blocks:t.map((t=>this.generateListItemBlockDTO(t,e)))},e)}generateListItemBlockDTO(t,e){return{id:it(),type:"list-item",annotations:oe.generate(RTEListItemBlock,t,e),nodes:this.generateChildNodes(Array.from(t.childNodes.length?t.childNodes:[t]).filter((t=>!["UL","OL"].includes(t.nodeName))),oe.generate(n,t,Object.assign(Object.assign({},e),{skipCustomAnnotations:!0})),e)}}}),Et.registerElementToBlockStrategy(new class extends ae{canHandle(t,e){const n=t[e],s=n.parentElement,r="LI"!==n.nodeName,i=n.nodeType===Node.TEXT_NODE&&""===n.textContent.trim(),o=ot(s)&&["UL","OL"].includes(s.nodeName);return r&&!i&&o?1:0}handle(t,e){const n=this.generateChildNodes(t,{},e);return RTEListItemBlock.from({id:it(),type:"list-item",nodes:n,annotations:{}},e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),Et.registerElementToBlockStrategy(new class extends ae{canHandle(t,e){return"OL"===t[e].tagName?1:0}handle(t,e){return 0===t[0].childNodes.length?null:RTEListBlock.from({id:it(),type:"number-list",blocks:[],annotations:oe.generate(RTEListBlock,t[0],e)},e)}appendChildBlocks(t,e){t.children=e.filter((t=>t instanceof RTEListItemBlock)),e.forEach((e=>e.parent=t))}shouldProceedToElementChildren(){return!0}}),Et.registerElementToBlockStrategy(new class extends ae{canHandle(t,e){return"UL"===t[e].tagName?1:0}handle(t,e){return 0===t[0].childNodes.length?null:RTEListBlock.from({id:it(),type:"bullet-list",blocks:[],annotations:oe.generate(RTEListBlock,t[0],e)},e)}appendChildBlocks(t,e){t.children=e.filter((t=>t instanceof RTEListItemBlock)),e.forEach((e=>e.parent=t))}shouldProceedToElementChildren(){return!0}}),Et.registerElementToBlockStrategy(new class extends ae{canHandle(t,e,n){const s=t[e];return s.nodeType===Node.TEXT_NODE||this.isInlineTagWithoutBlockChildren(s,n)||te.has(s.nodeName)&&!this.shouldFallBackToHtmlBlock(s)||n.autoMatchFormat||!this.isCustomHtmlContainer(s)||Kt.isTitleOrSubtitle(s)?0:1}handle(t,e){return RTEHtmlBlock.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(re(t))return!(0===t.childNodes.length&&""===t.textContent&&!ee.has(t.nodeName)&&!se.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||!ne.has(t.parentElement.nodeName)&&(se.has(t.nodeName)||ee.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&&!ee.has(t.nodeName)&&!se.has(t.nodeName)))}isCustomHtmlContainer(t){return"DIV"!==t.nodeName||t.childNodes.length>0&&"IMG"!==t.childNodes[0].nodeName}generateHtmlBlock(t,e){return{id:it(),type:"html-block",htmlTag:t.nodeName.toLowerCase(),annotations:oe.generate(RTEHtmlBlock,t,e),children:[]}}}),
1
+ import{g as t,e,c as n,h as s,A as r,T as i,q as o,H as a,r as l,l as c,t as h,u,v as d,w as m,x as w,I as T,n as p,S as g,j as E,B as f,y as k,d as R,z as B,D as x,o as I,E as b,s as O,N as L,F as y,G as N,J as C,K as A,m as H,L as j,M as v,O as S,P as $,Q as D,U as M,W as P,X as F,Y as z,Z as V,_ as U,$ as W,a0 as G,a1 as J,a2 as K,R as Y,a3 as X,p as Q,a4 as Z,a5 as _,a6 as q,b as tt,a7 as et,a8 as nt,a9 as st,aa as rt}from"./p-a2b8d49d.js";import{g as it}from"./p-8b5d3a52.js";import{i as ot}from"./p-78ba7ca9.js";import{C as at}from"./p-2d0d575f.js";import{d as lt}from"./p-11e2dcf5.js";import{c as ct,d as ht}from"./p-3a93730e.js";import{r as ut,i as dt}from"./p-ec2a1d4c.js";import{c as mt}from"./p-a841cf13.js";import{L as wt}from"./p-6e1ab235.js";class RTEListItemBlock extends e{constructor(t,e,n){super(t,"list-item",n),this.nestList=[],this.nestList=e}static from(t,e={autoMatchFormat:!0}){const s=new RTEListItemBlock(t.id,void 0,e);s.children=t.nodes.map((t=>n.from(t,s,e))),t.children&&(s.nestList=t.children.map((t=>{const e=RTEListBlock.from(t);return e.parent=s,e})));const{annotations:r}=t;return r&&Object.entries(r).forEach((([t,e])=>{const n=this.createAnnotationEntity(t,e);ot(n)&&s.annotationMap.set(...n)})),s}toJSON(){var t;return Object.assign(Object.assign({},super.toJSON()),{type:"list-item",children:null===(t=this.nestList)||void 0===t?void 0:t.map((t=>t.toJSON()))})}toHtml(t){return[`<li${super.generateAttributeString(t)}>`,this.getChildrenHtml(t),"</li>"].join("")}cloneWithNodes(t){const e=new RTEListItemBlock(it());return e.children=[],e.apply(new s(t)),e}getLastNode(){return this.nestList&&this.nestList.length>0?this.nestList[this.nestList.length-1].getLastNode():super.getLastNode()}createNewListItem(){return new RTEListItemBlock(it())}clone(t){var e;const n=new RTEListItemBlock(this.id);return n.children=this.children.map((t=>t.clone(n))),n.annotationMap=super.cloneAnnotations(),n.nestList=null===(e=this.nestList)||void 0===e?void 0:e.map((t=>t.clone(n))),n.parent=t,n}}r.register(i.name,RTEListItemBlock.name,new o),r.register(a.name,RTEListItemBlock.name,new l),r.register(c.LINE_BREAK_SINGLE_BLOCK,RTEListItemBlock.name,new h),r.register(c.LINE_BREAK_MULTIPLE_BLOCKS,RTEListItemBlock.name,new u),r.register(c.DELETE_NEST_LIST,RTEListItemBlock.name,new class extends t{handleAction(t,e){e.nestList&&(e.nestList=e.nestList.length>1?e.nestList.filter((e=>e!==t.nestListBlockToBeRemoved)):void 0)}}),r.register(c.SPLIT_BLOCK_WITH_NODE,RTEListItemBlock.name,new d),r.register(c.REPLACE_CHILD_NODES,RTEListItemBlock.name,new m),r.register(c.REPLACE_NEST_LIST,RTEListItemBlock.name,new class extends t{handleAction(t,e){t.newList.forEach((t=>{t.parent=e})),e.nestList=t.newList}}),r.register(c.MERGE_TWO_BLOCKS_NODES,RTEListItemBlock.name,new w),r.register(c.INSERT_IMAGE_TO_BLOCK,RTEListItemBlock.name,new class extends t{handleAction(t,e){e.parent.apply(t)}});class Tt extends f{constructor(){super(...arguments),this.type=k.LIST}static getDefaultStyles(){return{paddingLeft:"8px",marginLeft:"16px"}}renderStyle(t){return(null==t?void 0:t.standalone)?Tt.getDefaultStyles():null}renderClass(t){return(null==t?void 0:t.standalone)?null:"v-rte--list"}clone(){return new Tt}toJSON(){}}class RTEListBlock extends R{constructor(t,e,n){super(t),this.type="bullet-list",this.children=[],this.type=e;const{autoMatchFormat:s}=n||{autoMatchFormat:!0};s&&this.annotationMap.set(k.LIST,new Tt)}static from(t,e={autoMatchFormat:!0}){const n=new RTEListBlock(t.id,t.type,e),{annotations:s}=t;return s&&Object.entries(s).forEach((([t,e])=>{const s=this.createAnnotationEntity(t,e);ot(s)&&n.annotationMap.set(...s)})),n.children=t.blocks.map((t=>{const s=RTEListItemBlock.from(t,e);return s.parent=n,s})),n}static createAnnotationEntity(t,e){switch(t){case"customAttribute":return I.from(e);case"customClass":return x.from(e);case"customStyle":return B.from(e)}}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{id:this.id,type:this.type,blocks:this.children.map((t=>t.toJSON()))})}toHtml(t){const e=this.getBlockTag();return[`<${e}${super.generateAttributeString(t)}>`,this.children.map((e=>e.toHtml(t))).join(""),`</${e}>`].join("")}isNotEmpty(){return this.children.length>0}getLastNode(){return this.children[this.children.length-1].getLastNode()}clone(t){const e=new RTEListBlock(this.id,this.type);return e.children=this.children.map((t=>t.clone(e))),e.annotationMap=super.cloneAnnotations(),e.parent=t,e}getBlockTag(){return"number-list"===this.type?"ol":"ul"}}r.register(c.TRANSFORM_LIST_BLOCK,RTEListBlock.name,new class extends t{handleAction(t,e){const n=t.selectedBlocks,r=e.parent.createList(t.listType);if(n.every((t=>t.parent===e)))r.apply(new s(e.children)),e.parent.apply(new T(e,r)),e.parent.apply(new p(e)),n.forEach((t=>t.children.map((t=>t.apply(new g)))));else{const n=t.selectedBlocks.map((t=>e.parent.toListItem(t)));r.apply(new s(n)),e.parent.apply(new T(e,r)),t.selectedBlocks.forEach((t=>{t.parent.apply(new p(t))})),0===e.children.length&&e.parent.apply(new p(e))}}}),r.register(c.TRANSFORM_PARAGRAPH_BLOCK,RTEListBlock.name,new class extends t{handleAction(t,e){let n=!1,r=!1;const i=t.selectedBlocks,o=i.map((t=>(t.children.map((t=>t.apply(new g))),t===e.children[0]&&(n=!0),t===e.children[e.children.length-1]&&(r=!0),this.toParagraph(t))));if(n)e.parent.apply(new E(e,...o));else if(r)e.parent.apply(new T(e,...o));else{const t=e.children.indexOf(i[0]),n=e.children.indexOf(i[i.length-1]),r=e.parent.createList(e.type);r.apply(new s(e.children.slice(0,t)));const a=e.parent.createList(e.type);a.apply(new s(e.children.slice(n+1))),e.parent.apply(new E(e,r,...o,a)),e.parent.apply(new p(e))}i.map((t=>{e.apply(new p(t))})),0===e.children.length&&e.parent.apply(new p(e))}toParagraph(t){const n=new e(it(),"paragraph");return n.apply(new s(t.children)),n.annotationMap=t.annotationMap,n}}),r.register(c.INSERT_IMAGE_TO_BLOCK,RTEListBlock.name,new class extends t{handleAction(t,e){e.parent.apply("list-item"!==e.parent.type?new T(e,t.imageBlockToBeInserted):t)}});class pt{}class gt{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(ot)),e}}const Et=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)}},ft=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 gt(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 Et.getElementToBlockStrategies()}};class kt extends t{handleAction(t,e){const n=t.entityToBeAppended;e.children&&(n.forEach((t=>{t.parent=e})),e.children=e.children.concat(n))}}class Rt 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 Bt extends Rt{handleAction(t,e){this.replaceElementWithElements(e,t.referChildren,[t.referChildren,...t.childrenToBeInserted])}}class xt extends L{constructor(t,e){super(),this.type=y.IMAGE,this.size=t,this.alt=e}static from(t,e){return[y.IMAGE,new xt(t,e)]}static getDefaultStyles(){return{verticalAlign:"bottom"}}toJSON(){return ot(this.alt)?{size:this.size,alt:this.alt}:{size:this.size}}clone(){return new xt(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=xt.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%"})}}}xt.BASE_STYLES={verticalAlign:"bottom"};class RTEImageNode extends N{constructor(t,e,n,s){super(t,s),this.type=C.IMAGE,this.url=e,this.parent=n}static from(t,e,n={autoMatchFormat:!0}){const s=new RTEImageNode(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?xt.from(l.size,l.alt):this.createAnnotationEntity(t,l[t]))).filter(ot)),s}toJSON(){const t=Array.from(this.annotationMap.values()).filter((t=>t instanceof xt||t instanceof A)).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 RTEImageNode(this.id,this.url,t,super.cloneAnnotations())}toHtml(t){const e=this.getAnnotationByType(y.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(ot))}>`}doAnnotationActionApply(t){const e=r.get(H.name,RTEImageNode.name);e&&e.execute(t,this)}doModifyActionApply(t){r.executeTheStrategy(t,this)}}r.register(c.UPDATE_IMAGE_NODE_URL,RTEImageNode.name,new class extends t{handleAction(t,e){e.url=t.url}}),r.register(H.name,RTEImageNode.name,new class extends t{handleAction(t,e){const n=t.toAnnotation();e.annotationMap.set(n.type,n)}});class It extends v{constructor(t,e){super(),this.type=c.INSERT_NEW_PARAGRAPH,this.startContainerNode=t,this.startOffset=e}}class RTEImageBlock extends R{constructor(t){super(t),this.type="image",this.children=[]}static from(t,e={autoMatchFormat:!0}){const n=new RTEImageBlock(t.id),{annotations:s}=t;return n.children=t.nodes.map((t=>RTEImageNode.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 RTEImageBlock(it())}clone(t){const e=new RTEImageBlock(this.id);return e.children=this.children.map((t=>t.clone(e))),e.annotationMap=super.cloneAnnotations(),e.parent=t,e}}r.register(c.MERGE_TWO_BLOCKS_NODES,RTEImageBlock.name,new w),r.register(c.REPLACE_CHILD_NODES,RTEImageBlock.name,new m),r.register(c.SPLIT_BLOCK_WITH_NODE,RTEImageBlock.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 j(t));const i=this.cloneWithNodes(r,n);return n.parent.apply(new T(n,i)),i}}cloneWithNodes(t,e){const n=e.createNewImageBlock();return n.children=[],n.apply(new s(t)),n}}),r.register(c.LINE_BREAK_SINGLE_BLOCK,RTEImageBlock.name,new class extends t{handleAction(t,e){const n=new It(t.startContainerNode,t.startOffset);e.apply(n);const s=n.newBlock;s&&(t.lineBreakNode=s.children[0])}}),r.register(c.LINE_BREAK_MULTIPLE_BLOCKS,RTEImageBlock.name,new class extends t{handleAction(t,e){t.lineBreakNode=this.lineBreakMultipleBlocks(t.selectedBlocks,e)}lineBreakMultipleBlocks(t,r){const i=e.from({id:it(),type:"paragraph",nodes:[{id:it(),type:"text",text:"\n"}]});r.parent.apply(new T(r,i));const o=this.concatBlocksNodes(t.slice(1));return(0===o.length||o[0]&&""===o[0].text)&&o.push(new n(it(),"\n",i)),i.apply(new s(o)),i.children[0]}concatBlocksNodes(t){const e=[];return t.map((t=>{"image"!==t.type&&(e.push(...t.children),t.parent.apply(new p(t)))})),e}}),r.register(c.INSERT_IMAGE_TO_BLOCK,RTEImageBlock.name,new class extends t{handleAction(t,e){const n=t.splitPointNode,r=t.startOffsetOfNode,i=t.imageBlockToBeInserted;e.children.length<1?e.apply(new s(i.children)):this.isCaretPositionAtBlockEnd(e,n,r)?e.parent.apply(new T(e,i)):this.isCaretPositionAtBlockStart(e,n,r)?e.parent.apply(new E(e,i)):(e.apply(new S(n,r)),e.parent.apply(new T(e,i)))}}),r.register(a.name,RTEImageBlock.name,new l);class RTEHtmlBlock extends R{constructor(t,e){super(t),this.type="html-block",this.children=[],this.htmlTag=e}static from(t,e){const n=new RTEHtmlBlock(t.id,t.htmlTag),{annotations:s}=t;return s&&super.convertAnnotationsToMap(n.annotationMap,s),n.children=this.generateBlockChildren(t.children,e,n),n}clone(t){const e=new RTEHtmlBlock(this.id,this.htmlTag);return e.children=this.children.map((t=>t.clone(e))),e.annotationMap=super.cloneAnnotations(),e.parent=t,e}getLastNode(){return this.children[this.children.length-1].getLastNode()}isNotEmpty(){return!0}toHtml(t){const e=this.htmlTag,n=super.generateAttributeString(t);return $.has(this.htmlTag)?`<${e}${n}>`:[`<${e}${n}>`,this.children.map((e=>e.toHtml(t))).join(""),`</${e}>`].join("")}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{id:this.id,type:this.type,htmlTag:this.htmlTag,children:this.children.map((t=>t.toJSON()))})}}class bt extends v{constructor(t){super(),this.type=c.MERGE_TWO_BLOCKS_NODES,this.blockNeedToBeMerged=t}}class Ot extends D{handleAction(t,e){const{startContainerNode:n}=t;n.isContentEditable()?n.isTextNode()&&this.deleteTextNodeContent(t,e):this.deleteDecoratorNodeContent(t,e);const s=e.parent;s&&e.isListItemBlock()&&0===s.children.length&&s.parent.apply(new p(s))}deleteTextNodeContent(t,e){const n=t.startContainerNode,s=t.startOffset;if(0!==s&&!n.isEmpty()){const r=n.text.slice(0,s-1)+n.text.slice(s);if(n.apply(new M(r)),r)return void(t.previousNode=n);{const s=this.getPreviousNode(n);return s&&s.parent===e&&"\n"===s.text||1===e.children.length?void(t.previousNode=n):(e.apply(new p(n)),void(t.previousNode=s))}}{let s=this.getPreviousNode(n),r=null;const i=n.isEmpty();if(e.children.length&&s&&s.parent!==e)i&&e.apply(new p(n)),e.type===s.parent.type&&s.parent.apply(new bt(e));else if(this.isContentFirstNode(n)&&i&&(r=this.getNextNode(n)),i&&e.apply(new p(n)),s&&s.isTextNode()&&(s.isEmpty()||!s.isContentEditable()&&s.parent===e)){const t=s;s=this.getPreviousNode(s),t.parent.apply(new p(t)),s||i||(r=n)}0===e.children.length&&e.parent.apply(new p(e)),s?t.previousNode=s:r&&(t.nextNode=r)}}deleteDecoratorNodeContent(t,e){const n=t.startContainerNode,s=t.startOffset;let r=this.getPreviousNode(n),i=null;if(0!==s){const t=e;this.isContentFirstNode(n)&&(i=this.getNextNode(n)),1===t.children.length?t.parent.apply(new p(t)):t.apply(new p(n))}else{const e=r;e&&!e.isContentEditable()&&(r=this.getPreviousNode(e),e.parent.apply(new p(e)),r||(t.nextNode=n))}r?t.previousNode=r:i&&(t.nextNode=i)}}class Lt extends t{handleAction(t,e){const{startContainerNode:n}=t;t.newBlock=this.breakSingleBlock(n,t.startOffset,e)}breakSingleBlock(t,e,n){const s=this.getNewParagraph(t);if(s){if(this.isCaretPositionAtBlockEnd(n,t,e))n.parent.apply(new T(n,s));else{if(!this.isCaretPositionAtBlockStart(n,t,e)){const s=new S(t,e);return n.apply(s),s.newBlock}n.parent.apply(new E(n,s))}return s}}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(y.LINK),e.apply(new s([n]))),e}}}class yt extends v{constructor(t,e,n=!1){super(),this.isFlushable=!0,this.type=c.UPDATE_CURSOR_POSITION,this.immediatelyRun=!1,this.nextFocusNode=t,this.offset=e,this.immediatelyRun=n,this.immediatelyRun&&(this.isFlushable=!1)}}class Nt extends t{handleAction(t,e){const{rteRange:n,nodeToBeInserted:s}=t,{startNode:r,startOffset:i}=n;if(r){const t=e;if(r.isContentEditable()&&r.isTextNode())if("\n"!==r.text&&r.text&&0!==i){const e=r.text.substring(0,i),n=r.text.substring(i),o=r.cloneWithText(e),a=r.cloneWithText(n),l=[o,s];n&&l.push(a),t.apply(new E(r,...l)),t.apply(new p(r))}else t.apply(new E(r,s));else t.apply(0!==i?new T(r,s):new E(r,s));this.updateCursorPosition(s)}}updateCursorPosition(t){const e=this.getRootContent(t.parent);e&&e.apply(new yt(t))}}class Ct extends t{handleAction(t,e){const{text:n,offset:s,decoratorNode:r}=t,i=this.createNewParagraph(n);if(i){const t=i.children[0];e.apply(0!==s?new T(r,t):new E(r,t)),this.setTheCursorPosition(t)}}setTheCursorPosition(t){const e=this.getRootContent(t.parent);e&&e.apply(new yt(t))}}class At extends t{handleAction(t,e){t.newBlock=this.breakSingleListItemBlock(t.startContainerNode,t.startOffset,e)}breakSingleListItemBlock(t,e,n){const r=n.createNewListItem(),i=this.copyInlineStyleToNewNode(t);if(r.apply(new s([i])),this.isCaretPositionAtBlockEnd(n,t,e))return this.breakListItemAtEnd(r,n);if(!this.isCaretPositionAtBlockStart(n,t,e)){const s=new S(t,e);return n.apply(s),s.newBlock}return n.parent.apply(new E(n,r)),r}breakListItemAtEnd(t,n){const r=n.parent.children[n.parent.children.length-1],i=1===n.children.length&&n.children[0].isEmpty();if(n===r&&i){const r=n.parent.parent;if("list-item"!==r.type){const i=e.from({id:it(),type:"paragraph",nodes:[]});return i.apply(new s(t.children)),r.apply(new T(n.parent,i)),n.parent.apply(new p(n)),i}r.parent.apply(new T(r,t)),n.parent.apply(new p(n))}else n.parent.apply(new T(n,t));return t}copyInlineStyleToNewNode(t){const e=t.cloneWithText("");return e.annotationMap.delete(y.LINK),e}}class Ht extends v{constructor(t){super(),this.type=c.DELETE_NEST_LIST,this.nestListBlockToBeRemoved=t}}class jt extends P{handleAction(t,e){super.handleAction(t,e);const n=e.parent;0===e.children.length&&n&&n.apply("list-item"===n.type?new Ht(e):new p(e))}}class vt extends t{handleAction(t,e){if(e.parent){const{blocksToBeInserted:n,startNode:s,startOffset:r}=t;let i=e;if(s===e.children[0]&&0===r)e.parent.apply(new E(e,...n));else{const t=new S(s,r);e.apply(t),e.parent.apply(new T(e,...n)),i=t.newBlock}t.futureFocusBlock=i}}}const St=new class{registerBlockBasicStrategies(t){r.register(c.DELETE_CHILDREN,t,t===RTEListBlock.name?new jt:new P),r.register(c.APPEND_CHILDREN,t,new kt),r.register(c.INSERT_CHILDREN_BEFORE,t,new Rt),r.register(c.INSERT_CHILDREN_AFTER,t,new Bt),r.register(c.DELETE_BLOCK_CONTENT,t,new Ot),r.register(c.INSERT_NEW_PARAGRAPH,t,t===RTEListItemBlock.name?new At:new Lt),r.register(c.INSERT_TEXT_TO_DECORATOR_NODE,t,new Ct),r.register(c.INSERT_NODE_TO_NEAREST_ROOT,t,new Nt),r.register(c.PASTE_CONTENT,t,new vt)}};class $t{}class Dt extends $t{canHandle(t){return"RTETextNode"===t.name}handle(t,e={}){return this.isBold(t)||e.bold?{bold:!0}:{}}isBold(t){return"STRONG"===t.nodeName||"B"===t.nodeName||t.style.fontWeight===F||t.style.fontWeight===z||t.classList.contains("v-rte--bold")}}class Mt extends $t{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 Pt extends $t{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 Ft extends $t{canHandle(t,e){return!e.skipCustomAnnotations&&!!t}handle(t){const e=V(t);return Object.keys(e).length>0?{customStyle:e}:{}}}class zt extends $t{canHandle(t){return["RTETextBlock","RTEListItemBlock","RTEListBlock"].includes(t.name)}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 Vt extends $t{canHandle(t){return["RTETextBlock","RTEListItemBlock","RTEListBlock"].includes(t.name)}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 Ut extends $t{canHandle(t){return"RTETextNode"===t.name}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 Wt extends $t{canHandle(t){return"RTETextNode"===t.name}handle(t,e={}){const n=this.getColor(t)||e.textColor;return n?{textColor:n}:{}}getColor(t){var e;const n=null===(e=ut(t.style.color))||void 0===e?void 0:e.toUpperCase();if(n){const t=U.filter((t=>t.key!==W.key)).find((t=>t.light===n||t.dark===n));return t?t.key:null}for(const e of U)if(t.style.color.includes(e.key))return e.key;return null}}class Gt extends $t{canHandle(t){return"RTETextNode"===t.name}handle(t,e={}){return this.isItalic(t)||e.italic?{italic:!0}:{}}isItalic(t){return"I"===t.nodeName||t.style.fontStyle===G||"EM"===t.nodeName||t.classList.contains("v-rte--italic")}}class Jt extends $t{canHandle(t,e){return!!e.autoMatchFormat&&"RTETextBlock"===t.name}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 Kt{static isTitleOrSubtitle(t){if("DIV"===t.nodeName){const e=Kt.textStyleHandler.getTextStyle(t);return"title"===e||"subtitle"===e}return!1}static isLinkElement(t){return"A"===t.nodeName}}Kt.textStyleHandler=new Jt;class Yt extends $t{constructor(){super(...arguments),this.handlers=[new Mt,new Pt,new Ft]}canHandle(t){return"RTETextNode"===t.name}handle(t,e={}){return e.link?{link:e.link}:Kt.isLinkElement(t)?{link:this.generateLinkAnnotations(t)}:{}}generateLinkAnnotations(t){const e={href:t.getAttribute("href")||"",groupKey:it()};return this.handlers.forEach((n=>{Object.assign(e,n.handle(t))})),e}}class Xt extends $t{canHandle(t){return"RTETextNode"===t.name}handle(t,e={}){return this.isStrikethrough(t)||e.strikethrough?{strikethrough:!0}:{}}isStrikethrough(t){return t.style.textDecoration.includes(J)||"S"===t.nodeName||"DEL"===t.nodeName||t.classList.contains("v-rte--strikethrough")}}class Qt extends $t{canHandle(t){return"RTETextNode"===t.name}handle(t,e={}){return this.isUnderline(t)||e.underline?{underline:!0}:{}}isUnderline(t){return t.style.textDecoration.includes(K)||"U"===t.nodeName||"INS"===t.nodeName||t.classList.contains("v-rte--underline")}}class Zt extends $t{canHandle(t){return"RTEImageNode"===t.name}handle(t){const e=this.getImageSize(t);return e?{size:e}:{}}getImageSize(t){return t.getAttribute("data-size")?t.getAttribute("data-size"):null}}class _t extends $t{canHandle(t){return"RTEImageNode"===t.name}handle(t){return t.hasAttribute("alt")?{alt:t.getAttribute("alt")}:{}}}const qt=new Set(["P","H1","H2","H3","H4","H5","H6","LI"]),te=new Set(["P","H1","H2","H3","H4","H5","H6","LI","UL","OL","IMG","CODE"]),ee=new Set(["BR","VEGA-RICH-TEXT-LINK-EDITOR","CODE","A"]),ne=new Set(["TABLE","THEAD","TBODY","TFOOT","TR","DL"]),se=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 re(t){return qt.has(t.parentElement.nodeName)}class ie extends $t{constructor(){super(...arguments),this.customAttributeHandler=new Mt,this.customStyleAnnotationHandler=new Ft,this.customClassAnnotationHandler=new Pt}canHandle(t,e){return"RTETextNode"===t.name&&!1===e.autoMatchFormat}handle(t,e){if(te.has(t.nodeName)&&!ee.has(t.nodeName))return{};const n=this.generateInlineHtmlAnnotation(t,Object.assign({},e));return n?{inlineHtml:n}:{}}generateInlineHtmlAnnotation(t,e){let{inlineHtml:s}=e;const r=Array.from(t.childNodes).some((t=>t.nodeType===Node.ELEMENT_NODE));if(!n.supportsHtmlTag(t.nodeName.toLowerCase())||r){const e=Object.assign(Object.assign({htmlTag:t.nodeName.toLowerCase()},r?{groupId:it()}:{}),{customAttribute:this.customAttributeHandler.handle(t).customAttribute,customStyle:this.customStyleAnnotationHandler.handle(t).customStyle,customClass:this.customClassAnnotationHandler.handle(t).customClass});s=s?this.appendToInlineHtmlChain(s,e,t.parentNode):e}return s?Object.assign({},s):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 oe=new class{constructor(){this.handlers=[new Vt,new zt,new Dt,new Gt,new Qt,new Xt,new Wt,new Yt,new Ut,new Zt,new _t,new Mt,new Pt,new Ft,new Jt,new ie]}registerHandler(t){this.handlers.unshift(t)}generate(t,e,n={autoMatchFormat:!0}){n&&n.filterInlineStyles&&Y.executeTheStrategyRefillAction(t.name,e);const s=Kt.isLinkElement(e)&&"RTETextNode"===t.name,r=this.handlers.filter((t=>!(!n.autoMatchFormat&&s)||t instanceof Yt)).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=Y.getStrategies(t.name);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=X.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 ae extends pt{constructor(){super(...arguments),this.annotationHandler=new Jt}generateChildNodes(t,e,s){const r=[],i=!(!s||!1!==s.autoMatchFormat),o=Object.assign({},e);return t.forEach((t=>{const a=Et.getElementToNodeStrategies().find((e=>e.canHandle([t],0,s)>0));let l=null;if(a&&(l=a.handle([t],s,o)),l)r.push(l);else if(dt(t)&&t.childNodes.length>0){const a=oe.generate(n,t,Object.assign({parentAnnotations:i?{inlineHtml:o.inlineHtml,link:o.link,code:o.code}:e},s));r.push(...this.generateChildNodes(Array.from(t.childNodes),a,s))}})),r}matchTextBlockType(t){var e;return null!==(e=this.annotationHandler.handle(t).textStyle)&&void 0!==e?e:"paragraph"}}class le extends ae{canHandle(t,e){return"PRE"!==t[e].tagName&&"CODE"!==t[e].tagName||!t[e].hasAttribute("data-language")?0:1}handle(t){const e=t[0];if(e){const t=e.textContent,n=e.dataset.language;return b.from({id:it(),type:"code-block",content:t,language:n})}}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}class ce extends ae{createRTEImageBlock(t,e){const n=!(e&&e.autoMatchFormat||!t.parentNode||"DIV"===t.parentNode.nodeName);return RTEImageBlock.from({id:it(),type:"image",nodes:[{id:it(),type:"image",url:t.src,annotations:oe.generate(RTEImageNode,t,e)}],annotations:Object.assign(Object.assign({},oe.generate(RTEImageBlock,t.parentElement,e)),{internalWrapper:n})},e)}}class he extends pt{shouldProceedToElementChildren(){return!1}appendChildBlocks(){}generateTextNode(t,e){return{id:it(),type:"text",text:t,annotations:e}}}class ue extends Q{constructor(){super(...arguments),this.stylesToBeFiltered={}}get alwaysFilter(){return!0}filterAnnotations(t){const{textAlign:e,customStyle:n}=t;return e&&n?(this.stylesToBeFiltered=_.getDefaultStyles(e),super.filterAnnotations(t)):t}}class de extends Q{constructor(){super(...arguments),this.stylesToBeFiltered=X.getDefaultStyles("paragraph"),this.type="paragraph",this.elementTagName="p"}filterAnnotations(t){return t}canFilter(t){return Z.isTextBlock(t.constructor.name)&&t.type===this.type}canRefill(t,e){const n=this.classNameToBeAdded?`.${this.classNameToBeAdded}`:this.elementTagName;return Z.isTextBlock(t)&&e.matches(n)}toCssText(){return this.buildCssTextForStyles(this.elementTagName,this.classNameToBeAdded)}}class me extends de{constructor(t){super(),this.type="heading-1",this.elementTagName="h1",this.type=`heading-${t}`,this.elementTagName=`h${t}`,this.stylesToBeFiltered=X.getDefaultStyles(this.type)}}class we extends de{constructor(t){super(),this.type="title",this.elementTagName="div",this.classNameToBeAdded="v-rte-title",this.type=t,this.classNameToBeAdded=`v-rte-${t}`,this.stylesToBeFiltered=X.getDefaultStyles(this.type)}}class Te extends Q{constructor(){super(...arguments),this.stylesToBeFiltered=Te.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 Z.isTextNode(t.constructor.name)&&this.parentBlockIsHeadingOrTitle(t)}canRefill(t,e){return Z.isTextNode(t)&&"SPAN"===e.nodeName&&this.isHeadingOrTitleChild(e)}toCssText(){return`${this.parentElementSelectors.map((t=>`.${Te.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(Te.NON_HEADING_TITLE_ELEMENT_TAGS.includes(e.tagName))return!1;e=e.parentElement}return!1}}Te.BOLD_STYLES={fontWeight:"700"},Te.NON_HEADING_TITLE_ELEMENT_TAGS=["TD","TH","TR","TABLE","THEAD","TBODY","DIV","BODY"];class pe extends me{constructor(t){super(t),this.classNameToBeAdded=`v-rte-h${t}`,this.elementTagName="li"}canFilter(t){return Z.isListItemBlock(t.constructor.name)&&this.isBlockOrNodeStylesMatchFilterStyles(t,["fontSize","lineHeight"])}canRefill(t,e){return Z.isListItemBlock(t)&&e.matches(this.elementTagName)&&e.classList.contains(this.classNameToBeAdded)}}class ge extends we{constructor(t){super(t),this.classNameToBeAdded=`v-rte-${t}`,this.elementTagName="li"}canFilter(t){return Z.isListItemBlock(t.constructor.name)&&this.isBlockOrNodeStylesMatchFilterStyles(t,["fontSize","lineHeight"])}canRefill(t,e){return Z.isListItemBlock(t)&&e.matches(this.elementTagName)&&e.classList.contains(this.classNameToBeAdded)}}tt.registerRTEDTOClass("paragraph",e),tt.registerRTEDTOClass("title",e),tt.registerRTEDTOClass("subtitle",e),tt.registerRTEDTOClass("heading-1",e),tt.registerRTEDTOClass("heading-2",e),tt.registerRTEDTOClass("heading-3",e),tt.registerRTEDTOClass("heading-4",e),tt.registerRTEDTOClass("heading-5",e),tt.registerRTEDTOClass("heading-6",e),tt.registerRTEDTOClass("heading-6",e),tt.registerRTEDTOClass("list-item",RTEListItemBlock),tt.registerRTEDTOClass("bullet-list",RTEListBlock),tt.registerRTEDTOClass("number-list",RTEListBlock),tt.registerRTEDTOClass("image",RTEImageBlock),tt.registerRTEDTOClass("code-block",b),tt.registerRTEDTOClass("html-block",RTEHtmlBlock),tt.registerRTEDTOClass("text",n),tt.registerRTEDTOClass("image",RTEImageNode),St.registerBlockBasicStrategies(e.name),St.registerBlockBasicStrategies(RTEListBlock.name),St.registerBlockBasicStrategies(RTEListItemBlock.name),St.registerBlockBasicStrategies(RTEImageBlock.name),St.registerBlockBasicStrategies(RTEHtmlBlock.name),Et.registerElementToBlockStrategy(new class extends ae{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,s){const r=t[0].parentElement,i=s&&s.autoMatchFormat,o=this.generateChildNodes(t,i?oe.generate(n,r,Object.assign(Object.assign({},s),{skipCustomAnnotations:!0})):{},s),a=i?super.matchTextBlockType(r):this.matchTextBlockTypeByTagName(r),l=!i&&!a;return e.from(Object.assign({id:it(),type:a||"paragraph",nodes:o},l?{annotations:{internalWrapper:l}}:{annotations:oe.generate(e,r,s)}),s)}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||!!ee.has(t.nodeName)||!this.isDedicatedBlockTag(t.nodeName)&&(!(!1!==e.autoMatchFormat||!re(t))||this.isInlineLeafOrWrapper(t))}isDedicatedBlockTag(t){return te.has(t)&&!ee.has(t)}isInlineLeafOrWrapper(t){return 0===t.childNodes.length?se.has(t.nodeName):this.isTextOnlyElement(t)?se.has(t.nodeName)||ee.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}}),Et.registerElementToBlockStrategy(new class extends ce{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}}),Et.registerElementToBlockStrategy(new class extends ce{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(ot(s))return RTEImageBlock.from({id:it(),type:"image",nodes:[{id:it(),type:"image",url:s.src,annotations:oe.generate(RTEImageNode,n,e)}],annotations:oe.generate(RTEImageBlock,n.parentElement,e)},e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),Et.registerElementToBlockStrategy(new class extends ce{canHandle(t,e){return"IMG"===t[e].tagName?1:0}handle(t,e){return this.createRTEImageBlock(t[0],e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),Et.registerElementToBlockStrategy(new class extends ae{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,n){const s=this.generateChildNodes(Array.from(t[0].childNodes),{},n);return 0===s.length?null:e.from({id:it(),type:super.matchTextBlockType(t[0]),nodes:s,annotations:oe.generate(e,t[0],n)},n)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),Et.registerElementToBlockStrategy(new class extends ae{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)?RTEListItemBlock.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)))}shouldProceedToElementChildren(){return!0}generateWithListBlock(t,e){return RTEListBlock.from({id:it(),type:"bullet-list",blocks:t.map((t=>this.generateListItemBlockDTO(t,e)))},e)}generateListItemBlockDTO(t,e){return{id:it(),type:"list-item",annotations:oe.generate(RTEListItemBlock,t,e),nodes:this.generateChildNodes(Array.from(t.childNodes.length?t.childNodes:[t]).filter((t=>!["UL","OL"].includes(t.nodeName))),oe.generate(n,t,Object.assign(Object.assign({},e),{skipCustomAnnotations:!0})),e)}}}),Et.registerElementToBlockStrategy(new class extends ae{canHandle(t,e){const n=t[e],s=n.parentElement,r="LI"!==n.nodeName,i=n.nodeType===Node.TEXT_NODE&&""===n.textContent.trim(),o=ot(s)&&["UL","OL"].includes(s.nodeName);return r&&!i&&o?1:0}handle(t,e){const n=this.generateChildNodes(t,{},e);return RTEListItemBlock.from({id:it(),type:"list-item",nodes:n,annotations:{}},e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),Et.registerElementToBlockStrategy(new class extends ae{canHandle(t,e){return"OL"===t[e].tagName?1:0}handle(t,e){return 0===t[0].childNodes.length?null:RTEListBlock.from({id:it(),type:"number-list",blocks:[],annotations:oe.generate(RTEListBlock,t[0],e)},e)}appendChildBlocks(t,e){t.children=e.filter((t=>t instanceof RTEListItemBlock)),e.forEach((e=>e.parent=t))}shouldProceedToElementChildren(){return!0}}),Et.registerElementToBlockStrategy(new class extends ae{canHandle(t,e){return"UL"===t[e].tagName?1:0}handle(t,e){return 0===t[0].childNodes.length?null:RTEListBlock.from({id:it(),type:"bullet-list",blocks:[],annotations:oe.generate(RTEListBlock,t[0],e)},e)}appendChildBlocks(t,e){t.children=e.filter((t=>t instanceof RTEListItemBlock)),e.forEach((e=>e.parent=t))}shouldProceedToElementChildren(){return!0}}),Et.registerElementToBlockStrategy(new class extends ae{canHandle(t,e,n){const s=t[e];return s.nodeType===Node.TEXT_NODE||this.isInlineTagWithoutBlockChildren(s,n)||te.has(s.nodeName)&&!this.shouldFallBackToHtmlBlock(s)||n.autoMatchFormat||!this.isCustomHtmlContainer(s)||Kt.isTitleOrSubtitle(s)?0:1}handle(t,e){return RTEHtmlBlock.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(re(t))return!(0===t.childNodes.length&&""===t.textContent&&!ee.has(t.nodeName)&&!se.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||!ne.has(t.parentElement.nodeName)&&(se.has(t.nodeName)||ee.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&&!ee.has(t.nodeName)&&!se.has(t.nodeName)))}isCustomHtmlContainer(t){return"DIV"!==t.nodeName||t.childNodes.length>0&&"IMG"!==t.childNodes[0].nodeName}generateHtmlBlock(t,e){return{id:it(),type:"html-block",htmlTag:t.nodeName.toLowerCase(),annotations:oe.generate(RTEHtmlBlock,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
  Et.registerElementToBlockStrategy(new le),Et.registerElementToBlockStrategy(new class extends le{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}}),Et.registerElementToNodeStrategy(new class extends he{canHandle(t,e){const n=t[e];return!dt(n)||"BR"!==n.nodeName&&0!==n.childNodes.length?0:1}handle(t,e,s){const r=!(!e||!1!==e.autoMatchFormat),i=Object.assign({},s),o=t[0],a=oe.generate(n,o,Object.assign({parentAnnotations:r?{inlineHtml:i.inlineHtml,link:i.link,code:i.code}:s},e));if("BR"===o.nodeName)return this.generateTextNode("\n",a);if(0===o.childNodes.length){const t=r?mt(Object.assign(Object.assign({},n.supportsHtmlTag(o.nodeName.toLowerCase())?a:{}),{inlineHtml:a.inlineHtml})):a;return Object.assign({},this.generateTextNode("",t))}}}),Et.registerElementToNodeStrategy(new class extends he{canHandle(t,e){return t[e].nodeType===Node.TEXT_NODE?1:0}handle(t,e,s){const r=Object.assign({},s),i=!(!e||!1!==e.autoMatchFormat),o=t[0],a=o.parentNode.nodeName.toLowerCase(),l=i&&!n.supportsHtmlTag(a),c=this.generateTextNode(String(o.textContent),i?mt(Object.assign(Object.assign({},"span"===a?r:{link:r.link,code:"code"===a?r.code:void 0}),{inlineHtml:r.inlineHtml,plainText:l||void 0})):r);return Object.assign({},c)}}),Y.register(e.name,new ue),Y.register(RTEListBlock.name,new ue),Y.register(RTEListItemBlock.name,new ue),Y.register(n.name,new class extends Q{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===z&&delete n.fontWeight,e.italic&&n.fontStyle===G&&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!==K&&t!==J))?void 0:Array.from(new Set(e)).sort().join(" ")}shouldRemoveTextDecoration(t,e){const n=[];return e.underline&&n.push(K),e.strikethrough&&n.push(J),0!==n.length&&t===n.sort().join(" ")}}),Y.register(e.name,new de),Y.register(e.name,new me(1)),Y.register(e.name,new me(2)),Y.register(e.name,new me(3)),Y.register(e.name,new me(4)),Y.register(e.name,new me(5)),Y.register(e.name,new me(6)),Y.register(e.name,new we("title")),Y.register(e.name,new we("subtitle")),Y.register(n.name,new Te),Y.register(n.name,new class extends Q{constructor(){super(...arguments),this.stylesToBeFiltered=q.getDefaultStyles(),this.elementTagName="code"}filterAnnotations(t){const{code:e,customStyle:n}=t;return e&&n?super.filterAnnotations(t):t}canFilter(t){return Z.isCodeNode(t)}canRefill(t,e){return Z.isTextNode(t)&&e.matches(this.elementTagName)}toCssText(){return`.${Q.RTE_CONTENT_CONTAINER_CLASS_NAME} ${this.elementTagName} { ${this.convertStylesMapToCssText(Object.assign(Object.assign({},this.stylesToBeFiltered),{fontWeight:"500"}))} }`}}),Y.register(n.name,new et),Y.register(RTEImageNode.name,new class extends Q{constructor(){super(...arguments),this.stylesToBeFiltered=xt.getDefaultStyles(),this.elementTagName="img"}get alwaysFilter(){return!0}canFilter(t){return Z.isImageNode(t)}canRefill(t,e){return e.tagName.toLowerCase()===this.elementTagName}toCssText(){return this.buildCssTextForStyles(this.elementTagName,this.classNameToBeAdded)}}),Y.register(b.name,new nt),Y.register(st.name,new rt),Y.register(RTEListBlock.name,new class extends Q{constructor(){super(...arguments),this.stylesToBeFiltered=Tt.getDefaultStyles(),this.elementTagName="ol,ul"}canFilter(t){return Z.isListBlock(t.constructor.name)}canRefill(t,e){return Z.isListBlock(t)&&e.matches(this.elementTagName)}toCssText(){return`${this.elementTagName.split(",").map((t=>`.${Q.RTE_CONTENT_CONTAINER_CLASS_NAME} ${t.trim()}`)).join(", ")} { ${this.convertStylesMapToCssText(this.stylesToBeFiltered)} }`}}),Y.register(RTEListItemBlock.name,new class extends Q{constructor(){super(...arguments),this.stylesToBeFiltered=X.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 Z.isListItemBlock(t.constructor.name)&&e}canRefill(t,e){return Z.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())))}}),Y.register(RTEListItemBlock.name,new pe(1)),Y.register(RTEListItemBlock.name,new pe(2)),Y.register(RTEListItemBlock.name,new pe(3)),Y.register(RTEListItemBlock.name,new pe(4)),Y.register(RTEListItemBlock.name,new pe(5)),Y.register(RTEListItemBlock.name,new pe(6)),Y.register(RTEListItemBlock.name,new ge("title")),Y.register(RTEListItemBlock.name,new ge("subtitle"));class Ee{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(dt(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 ke{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 Re{process(t){return t.replace(/(>)[\n\t]+(?=.)/g,"$1")}}class Be{process(t){return t.replace(/(.?)[\n\t]+(?=<)/g,"$1")}}class xe{constructor(){this.processors=[new ke,new Re,new Be]}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 VegaRTEContent{constructor(t){t.forEach((t=>{t.parent=this})),this.children=t}static fromJSON(t,e={autoMatchFormat:!0}){const n=t.map((t=>{const n=tt.getRTEBlockClass(t.type);if(n)return n.from(t,e);throw new Error(`[Vega] Unknown block type: ${t.type}`)}));return new VegaRTEContent(n)}static createEmptyContent(t={autoMatchFormat:!0}){return VegaRTEContent.fromJSON([{id:it(),type:"paragraph",annotations:{internalWrapper:!t.autoMatchFormat},nodes:[{id:it(),annotations:{plainText:!t.autoMatchFormat},type:"text",text:""}]}],t)}static fromHtml(t,e={autoMatchFormat:!0,skipCustomAnnotations:!1}){const n=(new xe).clean(t),s=Ee.preserve(n),r=s.getProcessedHtml(),i=(new DOMParser).parseFromString(r,"text/html").body,o=Array.from(i.childNodes);s.restore(o);const a=ft.process(o,e).filter(ot).map((t=>t.toDto(e))).filter(ot);return new VegaRTEContent(a)}static generateContentStyles(t){return Y.generateAllStylesContent(null==t?void 0:t.enableFontImports)}clone(t=!1){return new VegaRTEContent(t?this.children.map((t=>t.clone(this))):[...this.children])}toJSON(){return this.children.map((t=>t.toJSON()))}toHtml(t){return t&&(ot(t.autoMatchFormat)||ot(t.skipCustomAnnotations))&&wt.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(r.executeTheStrategy(t,this),t.executedFlag&&t.isFlushable){const t=O.getDOMByEntity(this);t&&at.notify(lt.getSubject(t,ht),{})}}getLastNode(){return 0===this.children.length?null:this.children[this.children.length-1].getLastNode()}toListItem(t){t.children.map((t=>t.apply(new g)));const e=new RTEListItemBlock(it());return e.apply(new s(t.children)),e.annotationMap=t.annotationMap,e}createList(t){return new RTEListBlock(it(),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 RTEListItemBlock&&n.nestList)for(const e of n.nestList){const n=this.findNodeInBlocksById(t,e.children);if(n)return n}if(n instanceof RTEListBlock&&n.children){const e=this.findNodeInBlocksById(t,n.children);if(e)return e}}return null}}r.register(c.DELETE_CHILDREN,VegaRTEContent.name,new P),r.register(c.APPEND_CHILDREN,VegaRTEContent.name,new kt),r.register(c.INSERT_CHILDREN_BEFORE,VegaRTEContent.name,new Rt),r.register(c.INSERT_CHILDREN_AFTER,VegaRTEContent.name,new Bt),r.register(c.TRANSFORM_TO_CODE_BLOCK,VegaRTEContent.name,new class extends t{handleAction(t,e){const n=t.selectedBlocks,s=new b(it(),this.getCodeContent(n),"plainText");e.apply(new E(n[0],s)),t.newCodeBlock=s,this.removeSelectBlocks(n,e)}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 p(t[n]))}}),r.register(c.UPDATE_CURSOR_POSITION,VegaRTEContent.name,new class extends t{handleAction(t,e){const{offset:n,nextFocusNode:s,immediatelyRun:r}=t,i=O.getDOMByEntity(e);i&&at.notify(lt.getSubject(i,ct),{node:s,offset:n,updateDirectly:r})}});export{$t as A,ae as B,Et as E,It as I,bt as M,vt as P,St as R,Ee as S,yt as U,VegaRTEContent as V,pt as a,RTEImageBlock as b,Rt as c,RTEListItemBlock as d,RTEListBlock as e,RTEImageNode as f,xt as g,oe as h,ft as i}