@globalpayments/vega 2.100.0 → 2.101.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{action-color-accessibility-validator-b8a9ef0f.js → action-color-accessibility-validator-61af71ae.js} +1 -1
- package/dist/cjs/{app-globals-48d067a7.js → app-globals-275ea7c7.js} +15 -7
- package/dist/cjs/{aria-dialog-focusable-trap-slimmer-62147489.js → aria-dialog-focusable-trap-slimmer-c79cc3f8.js} +1 -1
- package/dist/cjs/{child-nodes-event-prevent-slimmer-e0ac8467.js → child-nodes-event-prevent-slimmer-d720d7e9.js} +1 -1
- package/dist/cjs/{code-block-3b42c364.js → code-block-c598832d.js} +793 -781
- package/dist/cjs/{component-value-history-controller-slimmer.abstract-bbe3bcaf.js → component-value-history-controller-slimmer.abstract-4bd47aa1.js} +3 -3
- package/dist/cjs/{content-state-87a06c1a.js → content-state-da23e822.js} +2 -2
- package/dist/cjs/countries-a8e3812a.js +251 -0
- package/dist/cjs/{dark-mode-style-controller-f3da3342.js → dark-mode-style-controller-ec04ece9.js} +45 -45
- package/dist/cjs/{element-appender-slimmer-f7ba5d9a.js → element-appender-slimmer-2aaf8e24.js} +20 -1
- package/dist/cjs/{event-emit-slimmer-34aa195e.js → event-emit-slimmer-67b5c186.js} +1 -1
- package/dist/cjs/{form-field-controller-slimmer-fbaddc91.js → form-field-controller-slimmer-ac9337f4.js} +2 -2
- package/dist/cjs/{image-annotation-action-03d3e01a.js → image-annotation-action-378838c2.js} +4 -4
- package/dist/cjs/{image-extension-ccda26d3.js → image-extension-673ebe7f.js} +2 -2
- package/dist/cjs/index.cjs.js +14 -12
- package/dist/cjs/{internal-vega-event-manager-7003c84a.js → internal-vega-event-manager-976b9526.js} +10 -2
- package/dist/cjs/{link-extension-71eeaa9f.js → link-extension-f493e432.js} +2 -2
- package/dist/cjs/loader.cjs.js +13 -12
- package/dist/cjs/{public-rules-3dc5d02d.js → public-rules-bae12c47.js} +5 -5
- package/dist/cjs/{range-d29751e3.js → range-9f42fb40.js} +1 -1
- package/dist/cjs/{rich-text-editor-required-rule-05de7f0c.js → rich-text-editor-required-rule-bb232741.js} +1 -1
- package/dist/cjs/{split-cell-operation-ef783850.js → split-cell-operation-0d33123e.js} +3 -3
- package/dist/cjs/{string-input-formatter-slimmer-9747039f.js → string-input-formatter-slimmer-2e0a838e.js} +2 -2
- package/dist/cjs/{sub-state-notify-slimmer-e264a120.js → sub-state-notify-slimmer-3b33e31c.js} +1 -1
- package/dist/cjs/{sub-state-observer-slimmer-6033b824.js → sub-state-observer-slimmer-5b68ba3f.js} +1 -1
- package/dist/cjs/{token-extension-8d7bd451.js → token-extension-4badb962.js} +9 -9
- package/dist/cjs/vega-accordion.cjs.entry.js +3 -3
- package/dist/cjs/vega-app-footer.cjs.entry.js +4 -4
- package/dist/cjs/vega-app-header-button.cjs.entry.js +4 -4
- package/dist/cjs/vega-banner.cjs.entry.js +3 -3
- package/dist/cjs/vega-brand-logo.cjs.entry.js +1 -1
- package/dist/cjs/vega-breadcrumb.cjs.entry.js +4 -4
- package/dist/cjs/vega-button-circle.cjs.entry.js +6 -6
- package/dist/cjs/vega-button-group_2.cjs.entry.js +7 -7
- package/dist/cjs/vega-button-link.cjs.entry.js +5 -5
- package/dist/cjs/vega-button.cjs.entry.js +6 -6
- package/dist/cjs/vega-calendar_5.cjs.entry.js +122 -16
- package/dist/cjs/vega-carousel.cjs.entry.js +3 -3
- package/dist/cjs/vega-checkbox_2.cjs.entry.js +7 -7
- package/dist/cjs/vega-chip.cjs.entry.js +4 -4
- package/dist/cjs/vega-code-block.cjs.entry.js +9 -9
- package/dist/cjs/vega-color-picker.cjs.entry.js +6 -6
- package/dist/cjs/vega-color-swatch-picker.cjs.entry.js +7 -7
- package/dist/cjs/vega-color-swatch.cjs.entry.js +3 -3
- package/dist/cjs/vega-combo-box.cjs.entry.js +7 -7
- package/dist/cjs/vega-date-picker_2.cjs.entry.js +11 -11
- package/dist/cjs/vega-dialog_2.cjs.entry.js +6 -6
- package/dist/cjs/vega-dropdown_5.cjs.entry.js +9 -9
- package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
- package/dist/cjs/{vega-event-id-58afed7a.js → vega-event-id-987a170c.js} +2 -0
- package/dist/cjs/vega-field-label.cjs.entry.js +3 -3
- package/dist/cjs/vega-file-uploader.cjs.entry.js +6 -6
- package/dist/cjs/vega-flag-icon.cjs.entry.js +6 -6
- package/dist/cjs/vega-form.cjs.entry.js +7 -7
- package/dist/cjs/vega-image-uploader.cjs.entry.js +8 -8
- package/dist/cjs/vega-input-credit-card.cjs.entry.js +7 -7
- package/dist/cjs/vega-input-numeric.cjs.entry.js +8 -8
- package/dist/cjs/vega-input-passcode.cjs.entry.js +7 -7
- package/dist/cjs/vega-input-phone-number.cjs.entry.js +16 -269
- package/dist/cjs/vega-input-range.cjs.entry.js +7 -7
- package/dist/cjs/vega-input-select.cjs.entry.js +16 -33
- package/dist/cjs/vega-input.cjs.entry.js +8 -8
- package/dist/cjs/{vega-internal-event-id-f4d33037.js → vega-internal-event-id-98d499d7.js} +6 -2
- package/dist/cjs/vega-item-toggle.cjs.entry.js +3 -3
- package/dist/cjs/vega-left-nav_5.cjs.entry.js +7 -7
- package/dist/cjs/vega-page-notification_2.cjs.entry.js +1 -1
- package/dist/cjs/vega-pagination-page-selector-mobile.cjs.entry.js +4 -4
- package/dist/cjs/vega-pagination-page-size-selector-mobile.cjs.entry.js +2 -2
- package/dist/cjs/vega-pagination.cjs.entry.js +5 -5
- package/dist/cjs/vega-popover_2.cjs.entry.js +6 -6
- package/dist/cjs/vega-progress-tracker_2.cjs.entry.js +6 -6
- package/dist/cjs/vega-radio_2.cjs.entry.js +7 -7
- package/dist/cjs/vega-rich-text-content.cjs.entry.js +9 -9
- package/dist/cjs/vega-rich-text-editor_4.cjs.entry.js +18 -18
- package/dist/cjs/vega-rich-text-find-replace-panel.cjs.entry.js +3 -3
- package/dist/cjs/vega-rich-text-special-characters-panel.cjs.entry.js +3 -3
- package/dist/cjs/vega-rich-text-table-properties_3.cjs.entry.js +8 -8
- package/dist/cjs/vega-segment-control.cjs.entry.js +11 -4
- package/dist/cjs/vega-selection-chip_2.cjs.entry.js +8 -8
- package/dist/cjs/vega-selection-tile_2.cjs.entry.js +8 -8
- package/dist/cjs/vega-sidenav_3.cjs.entry.js +6 -6
- package/dist/cjs/vega-signature-capture.cjs.entry.js +6 -6
- package/dist/cjs/vega-stepper.cjs.entry.js +7 -7
- package/dist/cjs/vega-tab-group_2.cjs.entry.js +4 -4
- package/dist/cjs/vega-table_11.cjs.entry.js +620 -661
- package/dist/cjs/vega-textarea.cjs.entry.js +7 -7
- package/dist/cjs/vega-time-picker_2.cjs.entry.js +8 -8
- package/dist/cjs/vega-toggle-switch.cjs.entry.js +6 -6
- package/dist/cjs/vega-tooltip_2.cjs.entry.js +2 -2
- package/dist/cjs/vega.cjs.js +13 -12
- package/dist/cjs/{wait-for-component-did-render-44d006ee.js → wait-for-component-did-render-90edbc1a.js} +1 -1
- package/dist/collection/components/vega-button/vega-button.css +3 -3
- package/dist/collection/components/vega-button-circle/vega-button-circle.css +3 -3
- package/dist/collection/components/vega-button-link/vega-button-link.css +4 -4
- package/dist/collection/components/vega-calendar/slimmers/common/renderers/vega-calendar-event-item-renderer.js +45 -5
- package/dist/collection/components/vega-calendar/slimmers/common/renderers/vega-calendar-event-preview-popover-renderer.js +43 -1
- package/dist/collection/components/vega-calendar/slimmers/month-view/renderers/vega-calendar-month-event-renderer.js +23 -4
- package/dist/collection/components/vega-calendar/vega-calendar.js +77 -1
- package/dist/collection/components/vega-flag-icon/slimmers/controllers/vega-flag-icon-controller.js +6 -6
- package/dist/collection/components/vega-input-phone-number/slimmers/renderers/country-select-renderer.js +4 -8
- package/dist/collection/components/vega-input-select/slimmers/renderers/vega-input-select-prefix-icon-renderer.js +8 -28
- package/dist/collection/components/vega-input-select/vega-input-select.js +3 -1
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/list-item-block.js +1 -2
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/text-block.js +18 -6
- package/dist/collection/components/vega-segment-control/slimmers/renderers/vega-segment-renderer.js +8 -1
- package/dist/collection/components/vega-segment-control/vega-segment-control.js +23 -0
- package/dist/collection/components/vega-table/slimmers/controllers/dto/column-render-input-model.js +25 -8
- package/dist/collection/components/vega-table/slimmers/controllers/dto/row-render-input-model.js +41 -0
- package/dist/collection/components/vega-table/slimmers/controllers/vega-table-head-template-structure-controller.js +1 -0
- package/dist/collection/components/vega-table/slimmers/controllers/vega-table-render-input-controller.js +316 -18
- package/dist/collection/components/vega-table/slimmers/renderers/vega-table-body-renderer.js +6 -1
- package/dist/collection/components/vega-table/slimmers/renderers/vega-table-header-renderer.js +1 -0
- package/dist/collection/components/vega-table/slimmers/renderers/vega-table-pinned-renderer.js +33 -530
- package/dist/collection/components/vega-table/slimmers/renderers/vega-table-row-renderer.js +1 -0
- package/dist/collection/components/vega-table/vega-table-cell/vega-table-cell.css +10 -0
- package/dist/collection/components/vega-table/vega-table-cell/vega-table-cell.js +25 -8
- package/dist/collection/components/vega-table/vega-table-expand-row/slimmers/renderers/vega-table-expand-row-renderer.js +14 -6
- package/dist/collection/components/vega-table/vega-table-expand-row/vega-table-expand-row.css +20 -0
- package/dist/collection/components/vega-table/vega-table-expand-row/vega-table-expand-row.js +7 -0
- package/dist/collection/components/vega-table/vega-table-foot-cell/slimmers/renderers/vega-table-foot-cell-renderer.js +21 -2
- package/dist/collection/components/vega-table/vega-table-foot-cell/vega-table-foot-cell.css +10 -0
- package/dist/collection/components/vega-table/vega-table-foot-cell/vega-table-foot-cell.js +12 -1
- package/dist/collection/components/vega-table/vega-table-foot-row/slimmers/renderers/vega-table-foot-row-renderer.js +20 -13
- package/dist/collection/components/vega-table/vega-table-foot-row/vega-table-foot-row.css +26 -0
- package/dist/collection/components/vega-table/vega-table-foot-row/vega-table-foot-row.js +12 -0
- package/dist/collection/components/vega-table/vega-table-head-cell/vega-table-head-cell.css +10 -0
- package/dist/collection/components/vega-table/vega-table-head-cell/vega-table-head-cell.js +19 -6
- package/dist/collection/components/vega-table/vega-table-head-row/slimmers/renderers/vega-table-head-row-renderer.js +21 -46
- package/dist/collection/components/vega-table/vega-table-head-row/vega-table-head-row.css +16 -7
- package/dist/collection/components/vega-table/vega-table-head-row/vega-table-head-row.js +9 -2
- package/dist/collection/components/vega-table/vega-table-row/slimmers/renderers/vega-table-row-renderer.js +28 -13
- package/dist/collection/components/vega-table/vega-table-row/vega-table-row.css +26 -0
- package/dist/collection/components/vega-table/vega-table-row/vega-table-row.js +11 -0
- package/dist/collection/constants/tokens/themes/v2-new-brand/dark-mode-border-tokens.js +1 -1
- package/dist/collection/constants/tokens/themes/v2-new-brand/dark-mode-color-tokens.js +20 -20
- package/dist/collection/constants/tokens/themes/v2-new-brand/dark-mode-ring-tokens.js +1 -1
- package/dist/collection/constants/tokens/themes/v2-new-brand/dark-mode-shadow-tokens.js +1 -1
- package/dist/collection/constants/tokens/themes/v2-new-brand/light-mode-border-tokens.js +1 -1
- package/dist/collection/constants/tokens/themes/v2-new-brand/light-mode-color-tokens.js +19 -19
- package/dist/collection/constants/tokens/themes/v2-new-brand/light-mode-shadow-tokens.js +1 -1
- package/dist/collection/constants/ui.js +1 -0
- package/dist/collection/global/scripts/before-vega-load.js +8 -0
- package/dist/collection/helpers/event-manager/event-id/component-event-id-map.js +10 -2
- package/dist/collection/helpers/event-manager/event-id/vega-event-id.js +1 -0
- package/dist/collection/helpers/event-manager/event-id/vega-internal-event-id.js +3 -1
- package/dist/collection/helpers/public-api.js +1 -0
- package/dist/collection/helpers/slimmers/position-calculation/position-calculation-controller.js +8 -0
- package/dist/collection/helpers/slimmers/position-calculation/screen-position-calculation-strategy.js +10 -0
- package/dist/collection/helpers/slimmers/vega-table-child-render-input-consumer-slimmer.js +2 -0
- package/dist/collection/helpers/ui/element-appender.js +1 -0
- package/dist/esm/{action-color-accessibility-validator-08877515.js → action-color-accessibility-validator-3e824a59.js} +1 -1
- package/dist/esm/{app-globals-1e1371d5.js → app-globals-ad3c7cea.js} +15 -7
- package/dist/esm/{aria-dialog-focusable-trap-slimmer-b2a24a45.js → aria-dialog-focusable-trap-slimmer-27a6aa19.js} +1 -1
- package/dist/esm/{child-nodes-event-prevent-slimmer-82626871.js → child-nodes-event-prevent-slimmer-0ebcbf47.js} +1 -1
- package/dist/esm/{code-block-741d6b8e.js → code-block-1cdf7a51.js} +793 -781
- package/dist/esm/{component-value-history-controller-slimmer.abstract-2bcd749e.js → component-value-history-controller-slimmer.abstract-bdeeb43f.js} +3 -3
- package/dist/esm/{content-state-2f6f4204.js → content-state-6eb610b8.js} +2 -2
- package/dist/esm/countries-50d3339b.js +249 -0
- package/dist/esm/{dark-mode-style-controller-352f15ff.js → dark-mode-style-controller-4e04a2d3.js} +45 -45
- package/dist/esm/{element-appender-slimmer-c820c0bf.js → element-appender-slimmer-dd4e2908.js} +20 -1
- package/dist/esm/{event-emit-slimmer-e8bb2292.js → event-emit-slimmer-12ee1593.js} +1 -1
- package/dist/esm/{form-field-controller-slimmer-02165dbe.js → form-field-controller-slimmer-5c794b4d.js} +2 -2
- package/dist/esm/{image-annotation-action-972c1074.js → image-annotation-action-cdd50dcc.js} +4 -4
- package/dist/esm/{image-extension-59484e9a.js → image-extension-f6dbd70c.js} +2 -2
- package/dist/esm/index.js +13 -12
- package/dist/esm/{internal-vega-event-manager-2ecc9186.js → internal-vega-event-manager-0c381f3b.js} +10 -2
- package/dist/esm/{link-extension-e89acb5c.js → link-extension-bc234cf7.js} +2 -2
- package/dist/esm/loader.js +13 -12
- package/dist/esm/{public-rules-c154201b.js → public-rules-8dc3fb00.js} +5 -5
- package/dist/esm/{range-c818a1eb.js → range-d2439ba7.js} +1 -1
- package/dist/esm/{rich-text-editor-required-rule-878e91c6.js → rich-text-editor-required-rule-a0663a84.js} +1 -1
- package/dist/esm/{split-cell-operation-cc0cdf90.js → split-cell-operation-1a889fa0.js} +3 -3
- package/dist/esm/{string-input-formatter-slimmer-76fe52d3.js → string-input-formatter-slimmer-69887c40.js} +2 -2
- package/dist/esm/{sub-state-notify-slimmer-e306c849.js → sub-state-notify-slimmer-ba72f30b.js} +1 -1
- package/dist/esm/{sub-state-observer-slimmer-bd85f381.js → sub-state-observer-slimmer-bee1c7fa.js} +1 -1
- package/dist/esm/{token-extension-35c66684.js → token-extension-530d9bde.js} +9 -9
- package/dist/esm/vega-accordion.entry.js +3 -3
- package/dist/esm/vega-app-footer.entry.js +4 -4
- package/dist/esm/vega-app-header-button.entry.js +4 -4
- package/dist/esm/vega-banner.entry.js +3 -3
- package/dist/esm/vega-brand-logo.entry.js +1 -1
- package/dist/esm/vega-breadcrumb.entry.js +4 -4
- package/dist/esm/vega-button-circle.entry.js +6 -6
- package/dist/esm/vega-button-group_2.entry.js +7 -7
- package/dist/esm/vega-button-link.entry.js +5 -5
- package/dist/esm/vega-button.entry.js +6 -6
- package/dist/esm/vega-calendar_5.entry.js +122 -16
- package/dist/esm/vega-carousel.entry.js +3 -3
- package/dist/esm/vega-checkbox_2.entry.js +7 -7
- package/dist/esm/vega-chip.entry.js +4 -4
- package/dist/esm/vega-code-block.entry.js +9 -9
- package/dist/esm/vega-color-picker.entry.js +6 -6
- package/dist/esm/vega-color-swatch-picker.entry.js +7 -7
- package/dist/esm/vega-color-swatch.entry.js +3 -3
- package/dist/esm/vega-combo-box.entry.js +7 -7
- package/dist/esm/vega-date-picker_2.entry.js +11 -11
- package/dist/esm/vega-dialog_2.entry.js +6 -6
- package/dist/esm/vega-dropdown_5.entry.js +9 -9
- package/dist/esm/vega-env-manager-8f8dc473.js +2 -2
- package/dist/esm/{vega-event-id-f55f6977.js → vega-event-id-59cd9297.js} +2 -1
- package/dist/esm/vega-field-label.entry.js +3 -3
- package/dist/esm/vega-file-uploader.entry.js +6 -6
- package/dist/esm/vega-flag-icon.entry.js +6 -6
- package/dist/esm/vega-form.entry.js +7 -7
- package/dist/esm/vega-image-uploader.entry.js +8 -8
- package/dist/esm/vega-input-credit-card.entry.js +7 -7
- package/dist/esm/vega-input-numeric.entry.js +8 -8
- package/dist/esm/vega-input-passcode.entry.js +7 -7
- package/dist/esm/vega-input-phone-number.entry.js +13 -266
- package/dist/esm/vega-input-range.entry.js +7 -7
- package/dist/esm/vega-input-select.entry.js +17 -34
- package/dist/esm/vega-input.entry.js +8 -8
- package/dist/esm/{vega-internal-event-id-86fce049.js → vega-internal-event-id-02093067.js} +4 -2
- package/dist/esm/vega-item-toggle.entry.js +3 -3
- package/dist/esm/vega-left-nav_5.entry.js +7 -7
- package/dist/esm/vega-page-notification_2.entry.js +1 -1
- package/dist/esm/vega-pagination-page-selector-mobile.entry.js +4 -4
- package/dist/esm/vega-pagination-page-size-selector-mobile.entry.js +2 -2
- package/dist/esm/vega-pagination.entry.js +5 -5
- package/dist/esm/vega-popover_2.entry.js +6 -6
- package/dist/esm/vega-progress-tracker_2.entry.js +6 -6
- package/dist/esm/vega-radio_2.entry.js +7 -7
- package/dist/esm/vega-rich-text-content.entry.js +9 -9
- package/dist/esm/vega-rich-text-editor_4.entry.js +18 -18
- package/dist/esm/vega-rich-text-find-replace-panel.entry.js +3 -3
- package/dist/esm/vega-rich-text-special-characters-panel.entry.js +3 -3
- package/dist/esm/vega-rich-text-table-properties_3.entry.js +8 -8
- package/dist/esm/vega-segment-control.entry.js +11 -4
- package/dist/esm/vega-selection-chip_2.entry.js +8 -8
- package/dist/esm/vega-selection-tile_2.entry.js +8 -8
- package/dist/esm/vega-sidenav_3.entry.js +6 -6
- package/dist/esm/vega-signature-capture.entry.js +6 -6
- package/dist/esm/vega-stepper.entry.js +7 -7
- package/dist/esm/vega-tab-group_2.entry.js +4 -4
- package/dist/esm/vega-table_11.entry.js +620 -661
- package/dist/esm/vega-textarea.entry.js +7 -7
- package/dist/esm/vega-time-picker_2.entry.js +8 -8
- package/dist/esm/vega-toggle-switch.entry.js +6 -6
- package/dist/esm/vega-tooltip_2.entry.js +2 -2
- package/dist/esm/vega.js +13 -12
- package/dist/esm/{wait-for-component-did-render-9b91a826.js → wait-for-component-did-render-9e84d92d.js} +1 -1
- package/dist/sri/vega-sri-manifest.json +308 -304
- package/dist/types/components/vega-calendar/slimmers/common/renderers/vega-calendar-event-item-renderer.d.ts +18 -0
- package/dist/types/components/vega-calendar/slimmers/common/renderers/vega-calendar-event-preview-popover-renderer.d.ts +9 -0
- package/dist/types/components/vega-calendar/slimmers/month-view/renderers/vega-calendar-month-event-renderer.d.ts +9 -1
- package/dist/types/components/vega-calendar/types.d.ts +22 -0
- package/dist/types/components/vega-calendar/vega-calendar.d.ts +23 -1
- package/dist/types/components/vega-flag-icon/slimmers/controllers/vega-flag-icon-controller.d.ts +2 -2
- package/dist/types/components/vega-input-phone-number/slimmers/renderers/country-select-renderer.d.ts +0 -1
- package/dist/types/components/vega-input-select/slimmers/renderers/vega-input-select-prefix-icon-renderer.d.ts +2 -14
- package/dist/types/components/vega-input-select/vega-input-select.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/dto/blocks/text-block.d.ts +11 -1
- package/dist/types/components/vega-segment-control/slimmers/renderers/vega-segment-renderer.d.ts +1 -0
- package/dist/types/components/vega-segment-control/types.d.ts +2 -0
- package/dist/types/components/vega-segment-control/vega-segment-control.d.ts +7 -1
- package/dist/types/components/vega-table/slimmers/controllers/dto/column-render-input-model.d.ts +17 -0
- package/dist/types/components/vega-table/slimmers/controllers/dto/row-render-input-model.d.ts +39 -0
- package/dist/types/components/vega-table/slimmers/controllers/vega-table-render-input-controller.d.ts +71 -7
- package/dist/types/components/vega-table/slimmers/renderers/vega-table-body-renderer.d.ts +1 -0
- package/dist/types/components/vega-table/slimmers/renderers/vega-table-pinned-renderer.d.ts +3 -88
- package/dist/types/components/vega-table/vega-table-expand-row/slimmers/renderers/vega-table-expand-row-renderer.d.ts +1 -1
- package/dist/types/components/vega-table/vega-table-expand-row/vega-table-expand-row.d.ts +5 -0
- package/dist/types/components/vega-table/vega-table-foot-cell/slimmers/renderers/vega-table-foot-cell-renderer.d.ts +1 -0
- package/dist/types/components/vega-table/vega-table-foot-cell/vega-table-foot-cell.d.ts +5 -0
- package/dist/types/components/vega-table/vega-table-foot-row/slimmers/renderers/vega-table-foot-row-renderer.d.ts +1 -3
- package/dist/types/components/vega-table/vega-table-foot-row/vega-table-foot-row.d.ts +5 -0
- package/dist/types/components/vega-table/vega-table-head-row/slimmers/renderers/vega-table-head-row-renderer.d.ts +0 -4
- package/dist/types/components/vega-table/vega-table-head-row/vega-table-head-row.d.ts +2 -2
- package/dist/types/components/vega-table/vega-table-row/slimmers/renderers/vega-table-row-renderer.d.ts +2 -3
- package/dist/types/components/vega-table/vega-table-row/vega-table-row.d.ts +4 -0
- package/dist/types/components.d.ts +33 -2
- package/dist/types/constants/ui.d.ts +1 -1
- package/dist/types/helpers/event-manager/event-id/vega-event-id.d.ts +1 -0
- package/dist/types/helpers/event-manager/event-id/vega-internal-event-id.d.ts +3 -1
- package/dist/types/helpers/public-api.d.ts +1 -0
- package/dist/types/helpers/slimmers/position-calculation/position-calculation-controller.d.ts +6 -0
- package/dist/types/helpers/slimmers/position-calculation/screen-position-calculation-strategy.d.ts +6 -0
- package/dist/types/helpers/slimmers/position-calculation/screen-scroll-position-update.d.ts +2 -1
- package/dist/types/helpers/slimmers/vega-table-child-render-input-consumer-slimmer.d.ts +2 -1
- package/dist/types/types/components.type.d.ts +7 -1
- package/dist/types/types/public-api.d.ts +1 -0
- package/dist/vega/index.esm.js +1 -1
- package/dist/vega/{p-85de755f.js → p-022cbf8a.js} +1 -1
- package/dist/vega/{p-284a8828.entry.js → p-02c1284e.entry.js} +1 -1
- package/dist/vega/{p-a488447f.js → p-069bbb4a.js} +1 -1
- package/dist/vega/{p-9efa5d76.js → p-08fd229c.js} +1 -1
- package/dist/vega/{p-e11c6ec4.entry.js → p-131ce9df.entry.js} +1 -1
- package/dist/vega/{p-bedb575c.entry.js → p-143ee395.entry.js} +1 -1
- package/dist/vega/p-178634f3.js +1 -0
- package/dist/vega/{p-9e9f49f4.js → p-1836a6a5.js} +1 -1
- package/dist/vega/p-1dbf8d1f.js +1 -0
- package/dist/vega/p-2dda5c65.entry.js +1 -0
- package/dist/vega/{p-3abb793c.entry.js → p-30010c41.entry.js} +1 -1
- package/dist/vega/p-32f5a6dd.entry.js +1 -0
- package/dist/vega/{p-7ddc0bec.entry.js → p-3460a1c5.entry.js} +1 -1
- package/dist/vega/{p-b07f587a.entry.js → p-34b523da.entry.js} +1 -1
- package/dist/vega/{p-5b9b1631.entry.js → p-357c0226.entry.js} +1 -1
- package/dist/vega/p-361f8996.js +1 -0
- package/dist/vega/p-36ee9d54.js +1 -0
- package/dist/vega/{p-2c8dc0d2.entry.js → p-37d5c37e.entry.js} +1 -1
- package/dist/vega/{p-3f2a4b34.entry.js → p-45ad2d90.entry.js} +1 -1
- package/dist/vega/{p-5d9be870.entry.js → p-4b117bfd.entry.js} +1 -1
- package/dist/vega/p-4e70836a.entry.js +1 -0
- package/dist/vega/{p-8fc0a820.js → p-4ea477d5.js} +1 -1
- package/dist/vega/{p-cd0a108b.entry.js → p-50e8e24f.entry.js} +1 -1
- package/dist/vega/{p-7e22610b.entry.js → p-522a6eec.entry.js} +1 -1
- package/dist/vega/p-53e3f259.js +1 -0
- package/dist/vega/{p-2c737fc8.js → p-5536146c.js} +1 -1
- package/dist/vega/{p-5789690b.entry.js → p-55c2c0df.entry.js} +1 -1
- package/dist/vega/p-587130f6.entry.js +1 -0
- package/dist/vega/{p-379736e2.js → p-58c8a4ac.js} +1 -1
- package/dist/vega/{p-c422ee02.entry.js → p-5c17ddda.entry.js} +1 -1
- package/dist/vega/{p-ea1a0046.entry.js → p-5c9c0c0d.entry.js} +1 -1
- package/dist/vega/p-5f377954.js +1 -1
- package/dist/vega/p-60010f14.entry.js +1 -0
- package/dist/vega/p-6098c4bb.js +1 -0
- package/dist/vega/{p-debf9e06.entry.js → p-61e63c0e.entry.js} +1 -1
- package/dist/vega/{p-7469d0d1.entry.js → p-62254dc7.entry.js} +1 -1
- package/dist/vega/{p-7a03ef96.entry.js → p-62ae9327.entry.js} +1 -1
- package/dist/vega/p-66245bc0.entry.js +1 -0
- package/dist/vega/{p-46f22f6c.entry.js → p-68ca8d3c.entry.js} +1 -1
- package/dist/vega/p-6a6c1279.js +1 -0
- package/dist/vega/{p-61ed7268.entry.js → p-6ae93679.entry.js} +1 -1
- package/dist/vega/{p-c7d46740.entry.js → p-6d90d28d.entry.js} +1 -1
- package/dist/vega/{p-6fd8f14b.js → p-6fae6768.js} +1 -1
- package/dist/vega/{p-8cfdd0e8.entry.js → p-71813a9e.entry.js} +1 -1
- package/dist/vega/{p-816b5fd2.entry.js → p-729529d6.entry.js} +1 -1
- package/dist/vega/{p-7ae4cf82.entry.js → p-75bfbffe.entry.js} +1 -1
- package/dist/vega/{p-bfe5dff7.entry.js → p-764b4e51.entry.js} +1 -1
- package/dist/vega/{p-5c3649f9.js → p-7d3419c7.js} +1 -1
- package/dist/vega/{p-a48468b5.entry.js → p-8e8b5790.entry.js} +1 -1
- package/dist/vega/{p-bc0e5598.entry.js → p-9236b8d9.entry.js} +1 -1
- package/dist/vega/p-9402f32f.js +1 -0
- package/dist/vega/{p-02b5d4ac.entry.js → p-942f9ea6.entry.js} +1 -1
- package/dist/vega/{p-c032f626.entry.js → p-9fdf66a8.entry.js} +1 -1
- package/dist/vega/{p-edd7aa92.entry.js → p-a2c45173.entry.js} +1 -1
- package/dist/vega/{p-ab253867.entry.js → p-a54ed341.entry.js} +1 -1
- package/dist/vega/{p-0f344e02.entry.js → p-a8a246e8.entry.js} +1 -1
- package/dist/vega/{p-bc119e75.entry.js → p-af0e9bd5.entry.js} +1 -1
- package/dist/vega/p-b1557bbe.js +1 -0
- package/dist/vega/p-b94f164a.entry.js +1 -0
- package/dist/vega/{p-01ca92e6.entry.js → p-bbfffe6b.entry.js} +1 -1
- package/dist/vega/{p-5006404e.entry.js → p-beccc38c.entry.js} +1 -1
- package/dist/vega/{p-b52d7724.js → p-c51de680.js} +1 -1
- package/dist/vega/{p-fe985b52.js → p-c601eea6.js} +1 -1
- package/dist/vega/{p-d340ee3d.entry.js → p-c6d2513c.entry.js} +1 -1
- package/dist/vega/{p-4d1896e0.entry.js → p-ca6bd3a0.entry.js} +1 -1
- package/dist/vega/{p-411cadbc.entry.js → p-cab890be.entry.js} +1 -1
- package/dist/vega/p-cb1cd15f.entry.js +1 -0
- package/dist/vega/p-d1f47512.js +1 -0
- package/dist/vega/{p-23db0a92.entry.js → p-d37d2ea4.entry.js} +1 -1
- package/dist/vega/{p-76999ea1.entry.js → p-d3e99d4a.entry.js} +1 -1
- package/dist/vega/{p-7cc8855d.entry.js → p-d6bd3ce4.entry.js} +1 -1
- package/dist/vega/{p-cd04b149.entry.js → p-d7838f6e.entry.js} +1 -1
- package/dist/vega/{p-79b49e8d.entry.js → p-d8c9ea46.entry.js} +1 -1
- package/dist/vega/p-d9588b3f.entry.js +1 -0
- package/dist/vega/{p-74b20563.entry.js → p-db69a5c9.entry.js} +1 -1
- package/dist/vega/{p-9ba2fdff.js → p-de1d0284.js} +1 -1
- package/dist/vega/{p-e0a51e49.js → p-de6fc52c.js} +1 -1
- package/dist/vega/{p-efc08027.entry.js → p-e48b7a8a.entry.js} +1 -1
- package/dist/vega/{p-d897acd5.js → p-e6f67a44.js} +1 -1
- package/dist/vega/{p-844ad6aa.entry.js → p-e8e3bf74.entry.js} +1 -1
- package/dist/vega/p-eadc10bc.entry.js +1 -0
- package/dist/vega/p-ee329596.entry.js +1 -0
- package/dist/vega/p-f01bc6a2.js +1 -0
- package/dist/vega/p-f324e90e.js +1 -0
- package/dist/vega/{p-493108d5.js → p-f48519d2.js} +1 -1
- package/dist/vega/{p-35d37477.entry.js → p-f8d13d01.entry.js} +1 -1
- package/dist/vega/{p-aaaf21eb.entry.js → p-f99f054c.entry.js} +1 -1
- package/dist/vega/{p-49de5559.entry.js → p-fe41e3b6.entry.js} +1 -1
- package/dist/vega/vega.esm.js +1 -1
- package/package.json +1 -1
- package/dist/vega/p-06a42a9f.entry.js +0 -1
- package/dist/vega/p-0cd362f3.entry.js +0 -1
- package/dist/vega/p-0e10798b.entry.js +0 -1
- package/dist/vega/p-401c6764.js +0 -1
- package/dist/vega/p-4a2fe3a4.js +0 -1
- package/dist/vega/p-5447a8e8.js +0 -1
- package/dist/vega/p-5a086e93.js +0 -1
- package/dist/vega/p-5b3c8a56.js +0 -1
- package/dist/vega/p-6336d446.entry.js +0 -1
- package/dist/vega/p-7f395622.entry.js +0 -1
- package/dist/vega/p-8663314e.js +0 -1
- package/dist/vega/p-86fb46d2.entry.js +0 -1
- package/dist/vega/p-8c30a60d.js +0 -1
- package/dist/vega/p-9034f709.js +0 -1
- package/dist/vega/p-a306bb39.js +0 -1
- package/dist/vega/p-a647c856.entry.js +0 -1
- package/dist/vega/p-a92cd703.js +0 -1
- package/dist/vega/p-ad367b48.entry.js +0 -1
- package/dist/vega/p-d1bb6e7a.entry.js +0 -1
- package/dist/vega/p-e5abc288.entry.js +0 -1
- package/dist/vega/p-ef1bbf14.js +0 -1
- package/dist/vega/p-f8bf379c.entry.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as t,f as e,r as i,c as o,H as s,g as r}from"./p-6b2342e0.js";import{V as a,I as l}from"./p-8ce9e214.js";import{R as n}from"./p-8bc15ed0.js";import{c,V as h,M as p,I as d}from"./p-6e1ab235.js";import{s as f}from"./p-519a7d55.js";import{F as u}from"./p-a488447f.js";import{D as v}from"./p-36a57431.js";import{c as m,b as g,a as w,d as b,M as j}from"./p-5447a8e8.js";import{c as x}from"./p-8fc0a820.js";import{V as C}from"./p-6031bed1.js";import{F as R}from"./p-cb378636.js";import{C as y}from"./p-2d0d575f.js";import{T as F}from"./p-8ebe30a8.js";import{C as S}from"./p-2c737fc8.js";import"./p-abd7aeaa.js";import"./p-87a4d75f.js";import"./p-982747ef.js";import"./p-02841589.js";import"./p-331a62d5.js";import"./p-aa135628.js";import"./p-8b5d3a52.js";import"./p-6a334573.js";import"./p-4a2fe3a4.js";import"./p-f485448a.js";import"./p-cc569b54.js";import"./p-b75ee3ba.js";import"./p-81dd00d0.js";import"./p-49a2e141.js";import"./p-d4ea8e22.js";import"./p-ed45b3b6.js";import"./p-71909102.js";import"./p-78a57a17.js";import"./p-52b8f2d2.js";import"./p-d27ae9ff.js";import"./p-262ec334.js";import"./p-5c3649f9.js";import"./p-8c30a60d.js";import"./p-ffdc25ec.js";import"./p-afcd8f04.js";import"./p-5f377954.js";var k=function(t,e,i,o){var s,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};class I extends h{constructor(){super(...arguments),this.handlePopoverShow=()=>{v.addUniqueObserverToNode(this.popoverRef,m,(()=>{this.isPopoverOpen=!0,this.internalColor!==this.value&&this.colorSwatchPickerValueController.updateInternalColor(this.value)}))},this.handlePopoverHide=()=>{v.addUniqueObserverToNode(this.popoverRef,g,(()=>{this.isPopoverOpen=!1}))},this.registerButtonClickHandler=t=>{v.addUniqueObserverToNode(t,w,(()=>{this.popoverRef&&this.popoverRef.hide(),this.colorSwatchPickerValueController.updateValue("clear"===t.dataset.actionType?"":this.internalColor)}))}}hidePopover(){this.popoverRef&&this.popoverRef.hide()}getContainerRef(){return this.containerRef}getLeftContainerRef(){return this.leftContainerRef}render(){const e=this.leftSlotProjection.hasSlot();return t("div",{ref:t=>this.containerRef=t,class:"swatch-picker-container"},t("vega-popover",{ref:t=>{this.popoverRef=t,this.handlePopoverShow(),this.handlePopoverHide()},class:"swatch-popover",alignment:"center",isScreenPosition:!0,trigger:"click"},t("div",{slot:"popover-content"},t("vega-color-swatch",{class:"swatch-picker-trigger","aria-expanded":this.isPopoverOpen?"true":"false","aria-haspopup":"dialog",disabled:this.disabled,color:this.value,size:"small"})),t("vega-box",{slot:"popover",class:"swatch-popover-content",width:"min-content"},t("vega-flex",{gap:"size-16"},e&&t("div",{ref:t=>this.leftContainerRef=t}),e&&t("div",null,t("vega-divider",{direction:"vertical"})),t("div",null,this.colorSwatchInputRenderer.render(),this.colorSwatchGridRenderer.render(),this.renderButtonGroup())))),t("vega-field-label",{label:this.label,disabled:this.disabled,isFieldRequired:this.required}))}renderButtonGroup(){return t("vega-flex",{gap:"size-8",justifyContent:"end",margin:{top:"size-16"}},this.showClearButton&&t("vega-button-link",{ref:this.registerButtonClickHandler,"data-action-type":"clear",label:this.translationSlimmer.t("Clear"),size:"small"}),t("vega-button-link",{ref:this.registerButtonClickHandler,"data-action-type":"apply",label:this.translationSlimmer.t("Apply"),size:"small"}))}}k([c()],I.prototype,"host",void 0),k([c()],I.prototype,"value",void 0),k([c()],I.prototype,"internalColor",void 0),k([c()],I.prototype,"label",void 0),k([c()],I.prototype,"required",void 0),k([c({writable:!0})],I.prototype,"isPopoverOpen",void 0),k([c()],I.prototype,"disabled",void 0),k([c()],I.prototype,"showClearButton",void 0),k([c()],I.prototype,"colorSwatchGridRenderer",void 0),k([c()],I.prototype,"colorSwatchInputRenderer",void 0),k([c()],I.prototype,"colorSwatchPickerValueController",void 0),k([c()],I.prototype,"translationSlimmer",void 0),k([c()],I.prototype,"leftSlotProjection",void 0);var z=function(t,e,i,o){var s,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};class V extends h{constructor(){super(...arguments),this.handleColorSwatchClick=t=>{v.addUniqueObserverToNode(t,w,(()=>{this.colorSwatchPickerValueController.updateInternalColor(t.color)}))}}render(){return t("vega-grid",{column:this.swatchGridColumns,justifyItems:"start",gap:"size-8",style:{width:"max-content"}},this.colors.map((e=>t("vega-color-swatch",{ref:this.handleColorSwatchClick,selected:this.isColorMatched(this.internalColor,e),color:e,size:"extra-small"}))))}isColorMatched(t,e){return t&&e?t.toLowerCase()===e.toLowerCase():t===e}}z([c()],V.prototype,"colors",void 0),z([c()],V.prototype,"internalColor",void 0),z([c()],V.prototype,"swatchGridColumns",void 0),z([c()],V.prototype,"colorSwatchPickerValueController",void 0);var O=function(t,e,i,o){var s,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};class P extends h{constructor(){super(...arguments),this.handleInputEvent=t=>{v.addUniqueObserverToNode(t,b,(()=>{const e=this.colorSwatchPickerColorFormatController.formatColor("output",t.value);e&&!this.isValidColor(e)||this.colorSwatchPickerValueController.updateInternalColor(e)})),v.addUniqueObserverToNode(t,j,(()=>{t.value&&!this.isValidColor(t.value)&&(t.value=this.colorSwatchPickerColorFormatController.formatColor("input",this.internalColor))}))}}render(){return this.showInput?t("vega-flex",{gap:"size-8",alignItems:"center",margin:{bottom:"size-16"}},t("vega-color-swatch",{color:this.internalColor,size:"extra-small"}),t("vega-input",{ref:this.handleInputEvent,size:"small",value:this.colorSwatchPickerColorFormatController.formatColor("input",this.internalColor),placeholder:this.inputPlaceholder||this.translationSlimmer.t("Enter color"),prefixIcon:this.inputPrefixIcon===P.DEFAULT_INPUT_ICON?C.getIconKey("hashtag"):this.inputPrefixIcon})):null}isValidColor(t){let e=!0;return globalThis.CSS&&"function"==typeof globalThis.CSS.supports&&(e=globalThis.CSS.supports("color",t)),e}}C.register({hashtag:{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M188.7 32.5c13 2.6 21.4 15.2 18.8 28.2L192.5 136h111l16.9-84.7c2.6-13 15.2-21.4 28.2-18.8s21.4 15.2 18.8 28.2L352.5 136H424c13.3 0 24 10.7 24 24s-10.7 24-24 24H342.9L314.1 328H392c13.3 0 24 10.7 24 24s-10.7 24-24 24H304.5l-16.9 84.7c-2.6 13-15.2 21.4-28.2 18.8s-21.4-15.2-18.8-28.2L255.5 376h-111l-16.9 84.7c-2.6 13-15.2 21.4-28.2 18.8s-21.4-15.2-18.8-28.2L95.5 376H24c-13.3 0-24-10.7-24-24s10.7-24 24-24h81.1l28.8-144H56c-13.3 0-24-10.7-24-24s10.7-24 24-24h87.5l16.9-84.7c2.6-13 15.2-21.4 28.2-18.8zM182.9 184L154.1 328h111l28.8-144h-111z"/></svg>'}}),P.DEFAULT_INPUT_ICON="hexColorIcon",O([c()],P.prototype,"internalColor",void 0),O([c()],P.prototype,"showInput",void 0),O([c()],P.prototype,"inputPlaceholder",void 0),O([c()],P.prototype,"inputPrefixIcon",void 0),O([c()],P.prototype,"colorSwatchPickerValueController",void 0),O([c()],P.prototype,"colorSwatchPickerColorFormatController",void 0),O([c()],P.prototype,"translationSlimmer",void 0);var L=function(t,e,i,o){var s,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};class H extends h{updateValue(t){this.value=t}updateInternalColor(t){this.internalColor=t}initializeInternalColor(){this.internalColor=this.value}listenToValueChange(){this.internalColor=this.value,this.changeEventEmitter.emit(this.value),y.notify(R,{host:this.host,detail:this.value})}}L([c()],H.prototype,"host",void 0),L([c({writable:!0})],H.prototype,"value",void 0),L([c({writable:!0})],H.prototype,"internalColor",void 0),L([c()],H.prototype,"changeEventEmitter",void 0),L([p("componentWillLoad")],H.prototype,"initializeInternalColor",null),L([p("watchValue")],H.prototype,"listenToValueChange",null);var M=function(t,e,i,o){var s,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};class T extends h{updateTheColor(){this.internalColor&&this.colorSwatchPickerValueController.updateInternalColor(this.formatColor("input",this.internalColor))}formatColor(t,e){return this.inputFormatter===T.DEFAULT_INPUT_FORMATTER?this.handleHexFormat(t,e):"function"==typeof this.inputFormatter?this.inputFormatter(t,e):e}handleHexFormat(t,e){return"input"===t?e.startsWith("#")?e.slice(1):e:e.startsWith("#")?e:e?`#${e}`:e}}T.DEFAULT_INPUT_FORMATTER="hexColorFormatter",M([c()],T.prototype,"inputFormatter",void 0),M([c()],T.prototype,"internalColor",void 0),M([c()],T.prototype,"colorSwatchPickerValueController",void 0),M([p("watchInputFormatter")],T.prototype,"updateTheColor",null);var D=function(t,e,i,o){var s,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};class E extends h{constructor(t,i){super(),this.slotElement=null,this.syncSlotElementFromHost=()=>{var t;const i=this.host.querySelector(this.slotSelector());i&&(this.slotElement=i,null===(t=this.getContainerRef())||void 0===t||t.replaceChildren(i),e(this.host))},this.syncRemovedSlotElement=()=>{this.slotElement&&!this.slotElement.isConnected&&(this.slotElement=null,e(this.host))},this.slotName=t,this.getContainerRef=i}hasSlot(){return!!this.slotElement}detectSlot(){this.slotElement=this.host.querySelector(this.slotSelector()),this.hostMutationObserver=new MutationObserver(this.syncSlotElementFromHost),this.hostMutationObserver.observe(this.host,{childList:!0}),this.containerMutationObserver=new MutationObserver(this.syncRemovedSlotElement)}appendSlotContent(){const t=this.getContainerRef();t&&this.containerMutationObserver.observe(t,{childList:!0}),this.slotElement&&t&&this.slotElement.parentElement!==t&&t.appendChild(this.slotElement)}cleanup(){this.hostMutationObserver&&this.hostMutationObserver.disconnect(),this.containerMutationObserver&&this.containerMutationObserver.disconnect()}slotSelector(){return`[slot="${this.slotName}"]`}}D([c()],E.prototype,"host",void 0),D([p("componentWillLoad")],E.prototype,"detectSlot",null),D([p("componentDidRender")],E.prototype,"appendSlotContent",null),D([p("disconnectedCallback")],E.prototype,"cleanup",null);var G=function(t,e,i,o){var s,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};const B=class{constructor(t){i(this,t),this.vegaChange=o(this,"vegaChange",7),this.change=o(this,"change",7),this.globalSlimmers={},this.vegaComponentUsageRuntimeMetricsSlimmer=new a,this.formFieldController=new u({propertyRules:[{propertyName:"required",ruleFactory:t=>t?new n:null}],validationRulesName:"validationRules",defaultValue:"",attributeGetter:t=>this[t],inputContainerGetter:()=>this.colorSwatchPickerRenderer.getContainerRef(),touchableAreaGetter:()=>[]}),this.translationSlimmer=new F,this.leftSlotProjection=new E("swatch-picker-left",(()=>this.colorSwatchPickerRenderer.getLeftContainerRef())),this.colorSwatchPickerRenderer=new I,this.colorSwatchGridRenderer=new V,this.colorSwatchInputRenderer=new P,this.colorSwatchPickerValueController=new H,this.colorSwatchPickerColorFormatController=new T,this.childNodeEventPreventSlimmer=new S([b],(()=>this.colorSwatchPickerRenderer.getContainerRef())),this.changeEventEmitter=x(B,b),this.internalColor="",this.isPopoverOpen=!1,this.value="",this.label="",this.disabled=!1,this.required=!1,this.name="",this.isValid=null,this.autoValidation=!0,this.validationRules=[],this.colors=["#73E6DC","#806BFF","#FFDC83","#FF9571","#00BBFF","#FF82C9","#259F9F","#563D82"],this.swatchGridColumns=8,this.showInput=!0,this.inputPlaceholder="",this.inputPrefixIcon=P.DEFAULT_INPUT_ICON,this.showClearButton=!1,this.inputFormatter=T.DEFAULT_INPUT_FORMATTER}watchValue(){}watchDisabled(){this.disabled&&this.colorSwatchPickerRenderer.hidePopover()}watchValidationRules(){}watchInputFormatter(){}render(){return f(t(s,{class:{disabled:this.disabled}},this.colorSwatchPickerRenderer.render(),t("div",{class:"vega-error vega-hidden",part:"field-error-message"})),this.host)}get host(){return r(this)}static get watchers(){return{value:["watchValue"],disabled:["watchDisabled"],validationRules:["watchValidationRules"],inputFormatter:["watchInputFormatter"]}}};G([l()],B.prototype,"globalSlimmers",void 0),G([d()],B.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),G([d()],B.prototype,"formFieldController",void 0),G([d()],B.prototype,"translationSlimmer",void 0),G([d()],B.prototype,"leftSlotProjection",void 0),G([d()],B.prototype,"colorSwatchPickerRenderer",void 0),G([d()],B.prototype,"colorSwatchGridRenderer",void 0),G([d()],B.prototype,"colorSwatchInputRenderer",void 0),G([d()],B.prototype,"colorSwatchPickerValueController",void 0),G([d()],B.prototype,"colorSwatchPickerColorFormatController",void 0),G([d()],B.prototype,"childNodeEventPreventSlimmer",void 0),G([d()],B.prototype,"changeEventEmitter",void 0),B.style=':host{display:inline-block}.swatch-picker-container{display:flex;flex-direction:row;align-items:center;gap:8px}.swatch-picker-container.error vega-color-swatch.swatch-picker-trigger::part(swatch){border:1px solid rgba(var(--v-border-input-field-danger, 230, 50, 87, 1))}.swatch-picker-container.error vega-color-swatch.swatch-picker-trigger::part(swatch-container):focus-visible{outline:2px solid rgba(var(--v-border-color-danger, 230, 50, 87, 1));outline-offset:2px}.vega-error{display:inline-block;padding-left:8px;padding-right:8px;padding-top:8px;font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px;color:rgba(var(--v-text-error, 189, 41, 71, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){.vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}.vega-hidden{display:none}';export{B as vega_color_swatch_picker}
|
|
1
|
+
import{h as t,f as e,r as i,c as o,H as s,g as r}from"./p-6b2342e0.js";import{V as a,I as l}from"./p-8ce9e214.js";import{R as n}from"./p-8bc15ed0.js";import{c,V as h,M as p,I as d}from"./p-6e1ab235.js";import{s as f}from"./p-519a7d55.js";import{F as u}from"./p-069bbb4a.js";import{D as v}from"./p-36a57431.js";import{c as m,b as g,a as w,d as b,N as j}from"./p-6a6c1279.js";import{c as x}from"./p-4ea477d5.js";import{V as C}from"./p-6031bed1.js";import{F as R}from"./p-cb378636.js";import{C as y}from"./p-2d0d575f.js";import{T as F}from"./p-8ebe30a8.js";import{C as S}from"./p-5536146c.js";import"./p-abd7aeaa.js";import"./p-87a4d75f.js";import"./p-982747ef.js";import"./p-02841589.js";import"./p-331a62d5.js";import"./p-aa135628.js";import"./p-8b5d3a52.js";import"./p-6a334573.js";import"./p-53e3f259.js";import"./p-f485448a.js";import"./p-cc569b54.js";import"./p-b75ee3ba.js";import"./p-81dd00d0.js";import"./p-49a2e141.js";import"./p-d4ea8e22.js";import"./p-ed45b3b6.js";import"./p-71909102.js";import"./p-78a57a17.js";import"./p-52b8f2d2.js";import"./p-d27ae9ff.js";import"./p-262ec334.js";import"./p-7d3419c7.js";import"./p-1dbf8d1f.js";import"./p-ffdc25ec.js";import"./p-afcd8f04.js";import"./p-5f377954.js";var k=function(t,e,i,o){var s,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};class I extends h{constructor(){super(...arguments),this.handlePopoverShow=()=>{v.addUniqueObserverToNode(this.popoverRef,m,(()=>{this.isPopoverOpen=!0,this.internalColor!==this.value&&this.colorSwatchPickerValueController.updateInternalColor(this.value)}))},this.handlePopoverHide=()=>{v.addUniqueObserverToNode(this.popoverRef,g,(()=>{this.isPopoverOpen=!1}))},this.registerButtonClickHandler=t=>{v.addUniqueObserverToNode(t,w,(()=>{this.popoverRef&&this.popoverRef.hide(),this.colorSwatchPickerValueController.updateValue("clear"===t.dataset.actionType?"":this.internalColor)}))}}hidePopover(){this.popoverRef&&this.popoverRef.hide()}getContainerRef(){return this.containerRef}getLeftContainerRef(){return this.leftContainerRef}render(){const e=this.leftSlotProjection.hasSlot();return t("div",{ref:t=>this.containerRef=t,class:"swatch-picker-container"},t("vega-popover",{ref:t=>{this.popoverRef=t,this.handlePopoverShow(),this.handlePopoverHide()},class:"swatch-popover",alignment:"center",isScreenPosition:!0,trigger:"click"},t("div",{slot:"popover-content"},t("vega-color-swatch",{class:"swatch-picker-trigger","aria-expanded":this.isPopoverOpen?"true":"false","aria-haspopup":"dialog",disabled:this.disabled,color:this.value,size:"small"})),t("vega-box",{slot:"popover",class:"swatch-popover-content",width:"min-content"},t("vega-flex",{gap:"size-16"},e&&t("div",{ref:t=>this.leftContainerRef=t}),e&&t("div",null,t("vega-divider",{direction:"vertical"})),t("div",null,this.colorSwatchInputRenderer.render(),this.colorSwatchGridRenderer.render(),this.renderButtonGroup())))),t("vega-field-label",{label:this.label,disabled:this.disabled,isFieldRequired:this.required}))}renderButtonGroup(){return t("vega-flex",{gap:"size-8",justifyContent:"end",margin:{top:"size-16"}},this.showClearButton&&t("vega-button-link",{ref:this.registerButtonClickHandler,"data-action-type":"clear",label:this.translationSlimmer.t("Clear"),size:"small"}),t("vega-button-link",{ref:this.registerButtonClickHandler,"data-action-type":"apply",label:this.translationSlimmer.t("Apply"),size:"small"}))}}k([c()],I.prototype,"host",void 0),k([c()],I.prototype,"value",void 0),k([c()],I.prototype,"internalColor",void 0),k([c()],I.prototype,"label",void 0),k([c()],I.prototype,"required",void 0),k([c({writable:!0})],I.prototype,"isPopoverOpen",void 0),k([c()],I.prototype,"disabled",void 0),k([c()],I.prototype,"showClearButton",void 0),k([c()],I.prototype,"colorSwatchGridRenderer",void 0),k([c()],I.prototype,"colorSwatchInputRenderer",void 0),k([c()],I.prototype,"colorSwatchPickerValueController",void 0),k([c()],I.prototype,"translationSlimmer",void 0),k([c()],I.prototype,"leftSlotProjection",void 0);var z=function(t,e,i,o){var s,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};class V extends h{constructor(){super(...arguments),this.handleColorSwatchClick=t=>{v.addUniqueObserverToNode(t,w,(()=>{this.colorSwatchPickerValueController.updateInternalColor(t.color)}))}}render(){return t("vega-grid",{column:this.swatchGridColumns,justifyItems:"start",gap:"size-8",style:{width:"max-content"}},this.colors.map((e=>t("vega-color-swatch",{ref:this.handleColorSwatchClick,selected:this.isColorMatched(this.internalColor,e),color:e,size:"extra-small"}))))}isColorMatched(t,e){return t&&e?t.toLowerCase()===e.toLowerCase():t===e}}z([c()],V.prototype,"colors",void 0),z([c()],V.prototype,"internalColor",void 0),z([c()],V.prototype,"swatchGridColumns",void 0),z([c()],V.prototype,"colorSwatchPickerValueController",void 0);var O=function(t,e,i,o){var s,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};class P extends h{constructor(){super(...arguments),this.handleInputEvent=t=>{v.addUniqueObserverToNode(t,b,(()=>{const e=this.colorSwatchPickerColorFormatController.formatColor("output",t.value);e&&!this.isValidColor(e)||this.colorSwatchPickerValueController.updateInternalColor(e)})),v.addUniqueObserverToNode(t,j,(()=>{t.value&&!this.isValidColor(t.value)&&(t.value=this.colorSwatchPickerColorFormatController.formatColor("input",this.internalColor))}))}}render(){return this.showInput?t("vega-flex",{gap:"size-8",alignItems:"center",margin:{bottom:"size-16"}},t("vega-color-swatch",{color:this.internalColor,size:"extra-small"}),t("vega-input",{ref:this.handleInputEvent,size:"small",value:this.colorSwatchPickerColorFormatController.formatColor("input",this.internalColor),placeholder:this.inputPlaceholder||this.translationSlimmer.t("Enter color"),prefixIcon:this.inputPrefixIcon===P.DEFAULT_INPUT_ICON?C.getIconKey("hashtag"):this.inputPrefixIcon})):null}isValidColor(t){let e=!0;return globalThis.CSS&&"function"==typeof globalThis.CSS.supports&&(e=globalThis.CSS.supports("color",t)),e}}C.register({hashtag:{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M188.7 32.5c13 2.6 21.4 15.2 18.8 28.2L192.5 136h111l16.9-84.7c2.6-13 15.2-21.4 28.2-18.8s21.4 15.2 18.8 28.2L352.5 136H424c13.3 0 24 10.7 24 24s-10.7 24-24 24H342.9L314.1 328H392c13.3 0 24 10.7 24 24s-10.7 24-24 24H304.5l-16.9 84.7c-2.6 13-15.2 21.4-28.2 18.8s-21.4-15.2-18.8-28.2L255.5 376h-111l-16.9 84.7c-2.6 13-15.2 21.4-28.2 18.8s-21.4-15.2-18.8-28.2L95.5 376H24c-13.3 0-24-10.7-24-24s10.7-24 24-24h81.1l28.8-144H56c-13.3 0-24-10.7-24-24s10.7-24 24-24h87.5l16.9-84.7c2.6-13 15.2-21.4 28.2-18.8zM182.9 184L154.1 328h111l28.8-144h-111z"/></svg>'}}),P.DEFAULT_INPUT_ICON="hexColorIcon",O([c()],P.prototype,"internalColor",void 0),O([c()],P.prototype,"showInput",void 0),O([c()],P.prototype,"inputPlaceholder",void 0),O([c()],P.prototype,"inputPrefixIcon",void 0),O([c()],P.prototype,"colorSwatchPickerValueController",void 0),O([c()],P.prototype,"colorSwatchPickerColorFormatController",void 0),O([c()],P.prototype,"translationSlimmer",void 0);var L=function(t,e,i,o){var s,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};class H extends h{updateValue(t){this.value=t}updateInternalColor(t){this.internalColor=t}initializeInternalColor(){this.internalColor=this.value}listenToValueChange(){this.internalColor=this.value,this.changeEventEmitter.emit(this.value),y.notify(R,{host:this.host,detail:this.value})}}L([c()],H.prototype,"host",void 0),L([c({writable:!0})],H.prototype,"value",void 0),L([c({writable:!0})],H.prototype,"internalColor",void 0),L([c()],H.prototype,"changeEventEmitter",void 0),L([p("componentWillLoad")],H.prototype,"initializeInternalColor",null),L([p("watchValue")],H.prototype,"listenToValueChange",null);var T=function(t,e,i,o){var s,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};class D extends h{updateTheColor(){this.internalColor&&this.colorSwatchPickerValueController.updateInternalColor(this.formatColor("input",this.internalColor))}formatColor(t,e){return this.inputFormatter===D.DEFAULT_INPUT_FORMATTER?this.handleHexFormat(t,e):"function"==typeof this.inputFormatter?this.inputFormatter(t,e):e}handleHexFormat(t,e){return"input"===t?e.startsWith("#")?e.slice(1):e:e.startsWith("#")?e:e?`#${e}`:e}}D.DEFAULT_INPUT_FORMATTER="hexColorFormatter",T([c()],D.prototype,"inputFormatter",void 0),T([c()],D.prototype,"internalColor",void 0),T([c()],D.prototype,"colorSwatchPickerValueController",void 0),T([p("watchInputFormatter")],D.prototype,"updateTheColor",null);var E=function(t,e,i,o){var s,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};class G extends h{constructor(t,i){super(),this.slotElement=null,this.syncSlotElementFromHost=()=>{var t;const i=this.host.querySelector(this.slotSelector());i&&(this.slotElement=i,null===(t=this.getContainerRef())||void 0===t||t.replaceChildren(i),e(this.host))},this.syncRemovedSlotElement=()=>{this.slotElement&&!this.slotElement.isConnected&&(this.slotElement=null,e(this.host))},this.slotName=t,this.getContainerRef=i}hasSlot(){return!!this.slotElement}detectSlot(){this.slotElement=this.host.querySelector(this.slotSelector()),this.hostMutationObserver=new MutationObserver(this.syncSlotElementFromHost),this.hostMutationObserver.observe(this.host,{childList:!0}),this.containerMutationObserver=new MutationObserver(this.syncRemovedSlotElement)}appendSlotContent(){const t=this.getContainerRef();t&&this.containerMutationObserver.observe(t,{childList:!0}),this.slotElement&&t&&this.slotElement.parentElement!==t&&t.appendChild(this.slotElement)}cleanup(){this.hostMutationObserver&&this.hostMutationObserver.disconnect(),this.containerMutationObserver&&this.containerMutationObserver.disconnect()}slotSelector(){return`[slot="${this.slotName}"]`}}E([c()],G.prototype,"host",void 0),E([p("componentWillLoad")],G.prototype,"detectSlot",null),E([p("componentDidRender")],G.prototype,"appendSlotContent",null),E([p("disconnectedCallback")],G.prototype,"cleanup",null);var M=function(t,e,i,o){var s,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};const B=class{constructor(t){i(this,t),this.vegaChange=o(this,"vegaChange",7),this.change=o(this,"change",7),this.globalSlimmers={},this.vegaComponentUsageRuntimeMetricsSlimmer=new a,this.formFieldController=new u({propertyRules:[{propertyName:"required",ruleFactory:t=>t?new n:null}],validationRulesName:"validationRules",defaultValue:"",attributeGetter:t=>this[t],inputContainerGetter:()=>this.colorSwatchPickerRenderer.getContainerRef(),touchableAreaGetter:()=>[]}),this.translationSlimmer=new F,this.leftSlotProjection=new G("swatch-picker-left",(()=>this.colorSwatchPickerRenderer.getLeftContainerRef())),this.colorSwatchPickerRenderer=new I,this.colorSwatchGridRenderer=new V,this.colorSwatchInputRenderer=new P,this.colorSwatchPickerValueController=new H,this.colorSwatchPickerColorFormatController=new D,this.childNodeEventPreventSlimmer=new S([b],(()=>this.colorSwatchPickerRenderer.getContainerRef())),this.changeEventEmitter=x(B,b),this.internalColor="",this.isPopoverOpen=!1,this.value="",this.label="",this.disabled=!1,this.required=!1,this.name="",this.isValid=null,this.autoValidation=!0,this.validationRules=[],this.colors=["#73E6DC","#806BFF","#FFDC83","#FF9571","#00BBFF","#FF82C9","#259F9F","#563D82"],this.swatchGridColumns=8,this.showInput=!0,this.inputPlaceholder="",this.inputPrefixIcon=P.DEFAULT_INPUT_ICON,this.showClearButton=!1,this.inputFormatter=D.DEFAULT_INPUT_FORMATTER}watchValue(){}watchDisabled(){this.disabled&&this.colorSwatchPickerRenderer.hidePopover()}watchValidationRules(){}watchInputFormatter(){}render(){return f(t(s,{class:{disabled:this.disabled}},this.colorSwatchPickerRenderer.render(),t("div",{class:"vega-error vega-hidden",part:"field-error-message"})),this.host)}get host(){return r(this)}static get watchers(){return{value:["watchValue"],disabled:["watchDisabled"],validationRules:["watchValidationRules"],inputFormatter:["watchInputFormatter"]}}};M([l()],B.prototype,"globalSlimmers",void 0),M([d()],B.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),M([d()],B.prototype,"formFieldController",void 0),M([d()],B.prototype,"translationSlimmer",void 0),M([d()],B.prototype,"leftSlotProjection",void 0),M([d()],B.prototype,"colorSwatchPickerRenderer",void 0),M([d()],B.prototype,"colorSwatchGridRenderer",void 0),M([d()],B.prototype,"colorSwatchInputRenderer",void 0),M([d()],B.prototype,"colorSwatchPickerValueController",void 0),M([d()],B.prototype,"colorSwatchPickerColorFormatController",void 0),M([d()],B.prototype,"childNodeEventPreventSlimmer",void 0),M([d()],B.prototype,"changeEventEmitter",void 0),B.style=':host{display:inline-block}.swatch-picker-container{display:flex;flex-direction:row;align-items:center;gap:8px}.swatch-picker-container.error vega-color-swatch.swatch-picker-trigger::part(swatch){border:1px solid rgba(var(--v-border-input-field-danger, 230, 50, 87, 1))}.swatch-picker-container.error vega-color-swatch.swatch-picker-trigger::part(swatch-container):focus-visible{outline:2px solid rgba(var(--v-border-color-danger, 230, 50, 87, 1));outline-offset:2px}.vega-error{display:inline-block;padding-left:8px;padding-right:8px;padding-top:8px;font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px;color:rgba(var(--v-text-error, 189, 41, 71, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){.vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}.vega-hidden{display:none}';export{B as vega_color_swatch_picker}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as e,H as t,r as i,c as r,g as n}from"./p-6b2342e0.js";import{c as o,V as a,M as s,I as l}from"./p-6e1ab235.js";import{V as c,I as d}from"./p-8ce9e214.js";import{V as p}from"./p-6031bed1.js";import{s as h}from"./p-519a7d55.js";import{D as u}from"./p-36a57431.js";import{a as f,d as g}from"./p-5447a8e8.js";import{f as m}from"./p-4b35c748.js";import{F as v}from"./p-cb378636.js";import{C as b}from"./p-2d0d575f.js";import{d as w}from"./p-a841cf13.js";import{h as x,e as j}from"./p-cc569b54.js";import{c as y}from"./p-8fc0a820.js";import{F as R}from"./p-a488447f.js";import{R as C}from"./p-8bc15ed0.js";import{P as z}from"./p-81dd00d0.js";import{g as I}from"./p-49a2e141.js";import{T as V}from"./p-8ebe30a8.js";import"./p-ffdc25ec.js";import"./p-afcd8f04.js";import"./p-6a334573.js";import"./p-8b5d3a52.js";import"./p-331a62d5.js";import"./p-aa135628.js";import"./p-941a83db.js";import"./p-ed45b3b6.js";import"./p-d4ea8e22.js";import"./p-b438e68b.js";import"./p-f485448a.js";import"./p-e14323f3.js";import"./p-262ec334.js";import"./p-0c667d6a.js";import"./p-d27ae9ff.js";import"./p-87a4d75f.js";import"./p-982747ef.js";import"./p-ab9d53e9.js";import"./p-b75ee3ba.js";import"./p-8c30a60d.js";import"./p-02841589.js";import"./p-4a2fe3a4.js";import"./p-abd7aeaa.js";import"./p-71909102.js";import"./p-78a57a17.js";import"./p-52b8f2d2.js";import"./p-5c3649f9.js";var S=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(o<3?n(a):o>3?n(t,i,a):n(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a};class k extends a{render(){return e(t,null,"written"===this.mode&&this.writtenModeRenderer.render())}}S([o()],k.prototype,"mode",void 0),S([o()],k.prototype,"writtenModeRenderer",void 0);var L=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(o<3?n(a):o>3?n(t,i,a):n(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a};class M extends a{constructor(){super(...arguments),this.signatureCaptureFocus=()=>{this.signatureCaptureContainerRef.focus()}}getSignatureCaptureContainer(){return this.signatureCaptureContainerRef}render(){return e("vega-flex",{direction:"col",gap:"size-8"},this.renderLabel(),this.renderContainer(),this.renderFooter())}renderLabel(){return this.label&&e("vega-field-label",{onClick:this.signatureCaptureFocus,isFieldRequired:this.required,label:this.label,disabled:this.disabled,optional:this.optional})}renderContainer(){return e("div",{class:{"signature-capture-written-container":!0,disabled:this.disabled},"aria-label":"Please sign here",role:"textbox",tabIndex:this.disabled?-1:0,ref:e=>this.signatureCaptureContainerRef=e},this.renderPlaceholder(),this.renderSignaturePad())}renderPlaceholder(){if(!this.isDrawing&&!this.value)return this.placeholder&&e("vega-flex",{class:"placeholder-container",gap:"size-8",justifyContent:"center",alignItems:"center",margin:{left:"size-24",right:"size-24"}},this.placeholderIcon&&e("vega-icon",{class:"placeholder-container-icon",size:"size-20",color:"text-secondary",icon:this.placeholderIcon}),e("div",{class:"placeholder-container-content"},this.translationSlimmer.t(this.placeholder)))}renderSignaturePad(){return e("svg",{width:"100%",height:m(this.height,"widthAndHeight"),"touch-action":"none",ref:e=>this.writtenModeSvgController.setSignatureContainerRef(e)})}renderFooter(){return this.showClearBtn&&e("vega-flex",{class:"signature-capture-written-footer",justifyContent:"space-between"},e("div",{class:"vega-error vega-hidden vega-error-content"}),this.renderClearBtn())}renderClearBtn(){return e("div",{class:"clear-button"},e("vega-button-link",{size:"small",disabled:this.disabled,ref:e=>{u.addUniqueObserverToNode(e,f,(()=>{this.writtenModeSvgController.clear()}))},label:this.translationSlimmer.t("Clear Signature")}))}}p.register({signature:{icon:'<svg width="20" height="20" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M176 128c0-26.5 21.5-48 48-48s48 21.5 48 48v7.9c0 27.5-2.3 55-7 82.1L158 251.1c-36.9 11.4-62 45.5-62 84.1V410c0 38.6 31.3 70 70 70c24.6 0 47.4-12.9 60-34l15.9-26.4c29.6-49.4 51.1-103.3 63.6-159.5l1-4.7 110.8-34.3-23.9 66.8c-2.6 7.4-1.5 15.5 3 21.9s11.8 10.2 19.6 10.2H552c13.3 0 24-10.7 24-24s-10.7-24-24-24H450.1l28.5-79.9c3.1-8.6 1-18.1-5.3-24.7s-15.7-9-24.4-6.3l-133 41.2c2.7-22 4.1-44.2 4.1-66.4V128c0-53-43-96-96-96s-96 43-96 96v40c0 13.3 10.7 24 24 24s24-10.7 24-24V128zm-3.8 169l80.9-25c-11.7 43.2-29.4 84.5-52.4 123l-15.9 26.4c-4 6.6-11.1 10.7-18.8 10.7c-12.1 0-22-9.8-22-22V335.2c0-17.5 11.4-33 28.2-38.2zM64 368H24c-13.3 0-24 10.7-24 24s10.7 24 24 24H64.2c-.1-2-.2-4-.2-6V368zm216.8 48H616c13.3 0 24-10.7 24-24s-10.7-24-24-24H304.1c-7 16.3-14.8 32.4-23.3 48z"/></svg>'}}),L([o()],M.prototype,"label",void 0),L([o()],M.prototype,"required",void 0),L([o()],M.prototype,"optional",void 0),L([o()],M.prototype,"showClearBtn",void 0),L([o()],M.prototype,"placeholder",void 0),L([o()],M.prototype,"placeholderIcon",void 0),L([o()],M.prototype,"disabled",void 0),L([o()],M.prototype,"value",void 0),L([o()],M.prototype,"isDrawing",void 0),L([o()],M.prototype,"height",void 0),L([o()],M.prototype,"writtenModeSvgController",void 0),L([o()],M.prototype,"translationSlimmer",void 0);var O=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(o<3?n(a):o>3?n(t,i,a):n(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a};class D extends a{constructor(){super(...arguments),this.penWidth="4px",this.clear=()=>{this.signatureContainerRef.innerHTML=x.sanitize("",j),this.value=null},this.startDrawing=e=>{if(this.disabled)return;this.isDrawing=!0;const{x:t,y:i}=this.getPoint(e);this.currentPath=document.createElementNS("http://www.w3.org/2000/svg","path"),this.currentPath.setAttribute("d",`M ${t} ${i}`),this.currentPath.setAttribute("stroke","rgba(4, 4, 28, 1)"),this.currentPath.setAttribute("stroke-width",this.penWidth),this.currentPath.setAttribute("fill","none"),this.currentPath.setAttribute("stroke-linecap","round"),this.currentPath.setAttribute("stroke-linejoin","round"),this.signatureContainerRef.appendChild(this.currentPath)},this.getPoint=e=>{var t,i;const r=this.signatureContainerRef.getBoundingClientRect(),n=null!==(t=e.clientX)&&void 0!==t?t:e.touches[0].clientX,o=null!==(i=e.clientY)&&void 0!==i?i:e.touches[0].clientY;return{x:n-r.left,y:o-r.top}},this.draw=e=>{if(!this.isDrawing)return;const{x:t,y:i}=this.getPoint(e),r=this.currentPath.getAttribute("d");this.currentPath.setAttribute("d",`${r} L ${t} ${i}`)},this.stopDrawing=()=>{this.isDrawing&&(this.isDrawing=!1,this.value={type:"written",img:this.generateSignatureImage()})}}componentDidLoad(){this.setupListeners(),this.fillSignature(this.value)}handleClear(){this.clear()}watchValue(e,t){w(e,t)||(this.changeEventEmitter.emit(e),this.fillSignature(e),b.notify(v,{host:this.host,detail:e}))}setSignatureContainerRef(e){this.signatureContainerRef=e}setupListeners(){const e=this.signatureContainerRef;e.addEventListener("mousedown",this.startDrawing),e.addEventListener("mousemove",this.draw),e.addEventListener("mouseup",this.stopDrawing),e.addEventListener("mouseleave",this.stopDrawing),e.addEventListener("touchstart",this.startDrawing),e.addEventListener("touchmove",this.draw),e.addEventListener("touchend",this.stopDrawing)}generateSignatureImage(){const e=(new XMLSerializer).serializeToString(this.signatureContainerRef);return`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(e)))}`}fromDataURL(e){if(!e||!e.img)return;const t=this.value.img.replace("data:image/svg+xml;base64,","");return(new DOMParser).parseFromString(atob(t),"image/svg+xml").documentElement}fillSignature(e){this.signatureContainerRef.replaceChildren();const t=this.fromDataURL(e);if(t){const e=Array.from(t.childNodes);this.signatureContainerRef.append(...e)}}}O([o()],D.prototype,"changeEventEmitter",void 0),O([o()],D.prototype,"host",void 0),O([o({writable:!0})],D.prototype,"value",void 0),O([o({writable:!0})],D.prototype,"isDrawing",void 0),O([o()],D.prototype,"disabled",void 0),O([s("componentDidLoad")],D.prototype,"componentDidLoad",null),O([s("clear")],D.prototype,"handleClear",null),O([s("watchValue")],D.prototype,"watchValue",null);var F=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(o<3?n(a):o>3?n(t,i,a):n(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a};const H=class{constructor(e){i(this,e),this.vegaChange=r(this,"vegaChange",7),this.change=r(this,"change",7),this.globalSlimmers={},this.translationSlimmer=new V,this.vegaComponentUsageRuntimeMetricsSlimmer=new c,this.vegaSignatureCaptureRenderer=new k,this.writtenModeRenderer=new M,this.writtenModeSvgController=new D,this.changeEventEmitter=y(H,g),this.formFieldController=new R({propertyRules:[{propertyName:"required",ruleFactory:e=>e?new C:null}],validationRulesName:"validationRules",defaultValue:null,attributeGetter:e=>this[e],inputContainerGetter:()=>this.writtenModeRenderer.getSignatureCaptureContainer(),touchableAreaGetter:()=>[this.writtenModeRenderer.getSignatureCaptureContainer()]}),this.pageResizeSlimmer=new z,this.currentBreakpoint=I(),this.isDrawing=!1,this.mode="written",this.label="",this.required=!1,this.optional=!1,this.name="",this.showClearBtn=!0,this.placeholder="Please sign here",this.placeholderIcon=p.getIconKey("signature"),this.disabled=!1,this.value=null,this.isValid=null,this.autoValidation=!0,this.validationRules=[],this.height="320px"}watchValue(e,t){}watchValidationRules(){}async clear(){}render(){return h(this.vegaSignatureCaptureRenderer.render(),this.host)}get host(){return n(this)}static get watchers(){return{value:["watchValue"],validationRules:["watchValidationRules"]}}};F([d()],H.prototype,"globalSlimmers",void 0),F([l()],H.prototype,"translationSlimmer",void 0),F([l()],H.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),F([l()],H.prototype,"vegaSignatureCaptureRenderer",void 0),F([l()],H.prototype,"writtenModeRenderer",void 0),F([l()],H.prototype,"writtenModeSvgController",void 0),F([l()],H.prototype,"changeEventEmitter",void 0),F([l()],H.prototype,"formFieldController",void 0),F([l()],H.prototype,"pageResizeSlimmer",void 0),H.style=':host{display:block}.signature-capture-written-container{border:1px solid rgba(var(--v-border-input-field, 171, 198, 216, 1));border-radius:8px;overflow:hidden;width:100%;position:relative;background-color:rgb(252, 252, 252)}.signature-capture-written-container:hover{border:1px solid rgba(var(--v-border-input-field-hover, 115, 160, 190, 1))}.signature-capture-written-container:focus-within{border:1px solid rgba(var(--v-border-input-field-focus, 19, 98, 226, 1));outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:3px;border:1px solid rgba(var(--v-border-color-input-field-focus, 19, 98, 226, 1))}.signature-capture-written-container .placeholder-container{height:100%;position:absolute;top:0px;right:0px;bottom:0px;left:0px;pointer-events:none}.signature-capture-written-container .placeholder-container-content{font-family:"Inter", sans-serif;font-size:18px;font-weight:500;line-height:28px;letter-spacing:0px;color:rgba(4, 4, 28, 0.64)}@media screen and (min-width: 768px) and (max-width: 1023px){.signature-capture-written-container .placeholder-container-content{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){.signature-capture-written-container .placeholder-container-content{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){.signature-capture-written-container .placeholder-container-content{font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px}}.signature-capture-written-container .placeholder-container-icon{flex-shrink:0;color:rgba(4, 4, 28, 0.64)}.signature-capture-written-container.error{border:1px solid rgba(var(--v-border-input-field-danger, 230, 50, 87, 1))}.signature-capture-written-container.error:hover{border:1px solid rgba(var(--v-border-input-field-danger-hover, 255, 87, 114, 1))}.signature-capture-written-container.error:focus-within{outline:2px solid rgba(var(--v-border-color-danger, 230, 50, 87, 1));outline-offset:3px;border:1px solid rgba(var(--v-border-color-input-field-danger-focus, 233, 71, 104, 1));border:1px solid rgba(var(--v-border-input-field-danger-focus, 233, 71, 104, 1))}.signature-capture-written-container.disabled{background-color:rgba(var(--v-bg-secondary, 245, 247, 247, 1));border:1px solid rgba(var(--v-border-input-field-disabled, 222, 225, 227, 1))}.signature-capture-written-container.disabled:hover,.signature-capture-written-container.disabled:focus-within{border:1px solid rgba(var(--v-border-input-field-disabled, 222, 225, 227, 1))}.signature-capture-written-container.disabled:focus-within{outline:none}.signature-capture-written-container.disabled .placeholder-container-content,.signature-capture-written-container.disabled .placeholder-container-icon{color:rgba(var(--v-text-input-disabled, 107, 116, 125, 1))}.signature-capture-written-footer .clear-button{flex-grow:1;padding-right:8px;text-align:right}.signature-capture-written-footer .vega-error-content{padding-top:0px;padding-right:0px;flex-grow:1}.vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px;color:rgba(var(--v-text-error, 189, 41, 71, 1));display:block;padding-right:8px;padding-left:8px}@media screen and (min-width: 768px) and (max-width: 1023px){.vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}.vega-hidden{display:none}';export{H as vega_signature_capture}
|
|
1
|
+
import{h as e,H as t,r as i,c as r,g as n}from"./p-6b2342e0.js";import{c as o,V as a,M as s,I as l}from"./p-6e1ab235.js";import{V as d,I as c}from"./p-8ce9e214.js";import{V as p}from"./p-6031bed1.js";import{s as h}from"./p-519a7d55.js";import{D as u}from"./p-36a57431.js";import{a as f,d as g}from"./p-6a6c1279.js";import{f as m}from"./p-4b35c748.js";import{F as v}from"./p-cb378636.js";import{C as b}from"./p-2d0d575f.js";import{d as w}from"./p-a841cf13.js";import{h as x,e as j}from"./p-cc569b54.js";import{c as y}from"./p-4ea477d5.js";import{F as R}from"./p-069bbb4a.js";import{R as C}from"./p-8bc15ed0.js";import{P as z}from"./p-81dd00d0.js";import{g as I}from"./p-49a2e141.js";import{T as V}from"./p-8ebe30a8.js";import"./p-ffdc25ec.js";import"./p-afcd8f04.js";import"./p-6a334573.js";import"./p-8b5d3a52.js";import"./p-331a62d5.js";import"./p-aa135628.js";import"./p-941a83db.js";import"./p-ed45b3b6.js";import"./p-d4ea8e22.js";import"./p-b438e68b.js";import"./p-f485448a.js";import"./p-e14323f3.js";import"./p-262ec334.js";import"./p-0c667d6a.js";import"./p-d27ae9ff.js";import"./p-87a4d75f.js";import"./p-982747ef.js";import"./p-ab9d53e9.js";import"./p-b75ee3ba.js";import"./p-1dbf8d1f.js";import"./p-02841589.js";import"./p-53e3f259.js";import"./p-abd7aeaa.js";import"./p-71909102.js";import"./p-78a57a17.js";import"./p-52b8f2d2.js";import"./p-7d3419c7.js";var S=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(o<3?n(a):o>3?n(t,i,a):n(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a};class k extends a{render(){return e(t,null,"written"===this.mode&&this.writtenModeRenderer.render())}}S([o()],k.prototype,"mode",void 0),S([o()],k.prototype,"writtenModeRenderer",void 0);var L=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(o<3?n(a):o>3?n(t,i,a):n(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a};class M extends a{constructor(){super(...arguments),this.signatureCaptureFocus=()=>{this.signatureCaptureContainerRef.focus()}}getSignatureCaptureContainer(){return this.signatureCaptureContainerRef}render(){return e("vega-flex",{direction:"col",gap:"size-8"},this.renderLabel(),this.renderContainer(),this.renderFooter())}renderLabel(){return this.label&&e("vega-field-label",{onClick:this.signatureCaptureFocus,isFieldRequired:this.required,label:this.label,disabled:this.disabled,optional:this.optional})}renderContainer(){return e("div",{class:{"signature-capture-written-container":!0,disabled:this.disabled},"aria-label":"Please sign here",role:"textbox",tabIndex:this.disabled?-1:0,ref:e=>this.signatureCaptureContainerRef=e},this.renderPlaceholder(),this.renderSignaturePad())}renderPlaceholder(){if(!this.isDrawing&&!this.value)return this.placeholder&&e("vega-flex",{class:"placeholder-container",gap:"size-8",justifyContent:"center",alignItems:"center",margin:{left:"size-24",right:"size-24"}},this.placeholderIcon&&e("vega-icon",{class:"placeholder-container-icon",size:"size-20",color:"text-secondary",icon:this.placeholderIcon}),e("div",{class:"placeholder-container-content"},this.translationSlimmer.t(this.placeholder)))}renderSignaturePad(){return e("svg",{width:"100%",height:m(this.height,"widthAndHeight"),"touch-action":"none",ref:e=>this.writtenModeSvgController.setSignatureContainerRef(e)})}renderFooter(){return this.showClearBtn&&e("vega-flex",{class:"signature-capture-written-footer",justifyContent:"space-between"},e("div",{class:"vega-error vega-hidden vega-error-content"}),this.renderClearBtn())}renderClearBtn(){return e("div",{class:"clear-button"},e("vega-button-link",{size:"small",disabled:this.disabled,ref:e=>{u.addUniqueObserverToNode(e,f,(()=>{this.writtenModeSvgController.clear()}))},label:this.translationSlimmer.t("Clear Signature")}))}}p.register({signature:{icon:'<svg width="20" height="20" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M176 128c0-26.5 21.5-48 48-48s48 21.5 48 48v7.9c0 27.5-2.3 55-7 82.1L158 251.1c-36.9 11.4-62 45.5-62 84.1V410c0 38.6 31.3 70 70 70c24.6 0 47.4-12.9 60-34l15.9-26.4c29.6-49.4 51.1-103.3 63.6-159.5l1-4.7 110.8-34.3-23.9 66.8c-2.6 7.4-1.5 15.5 3 21.9s11.8 10.2 19.6 10.2H552c13.3 0 24-10.7 24-24s-10.7-24-24-24H450.1l28.5-79.9c3.1-8.6 1-18.1-5.3-24.7s-15.7-9-24.4-6.3l-133 41.2c2.7-22 4.1-44.2 4.1-66.4V128c0-53-43-96-96-96s-96 43-96 96v40c0 13.3 10.7 24 24 24s24-10.7 24-24V128zm-3.8 169l80.9-25c-11.7 43.2-29.4 84.5-52.4 123l-15.9 26.4c-4 6.6-11.1 10.7-18.8 10.7c-12.1 0-22-9.8-22-22V335.2c0-17.5 11.4-33 28.2-38.2zM64 368H24c-13.3 0-24 10.7-24 24s10.7 24 24 24H64.2c-.1-2-.2-4-.2-6V368zm216.8 48H616c13.3 0 24-10.7 24-24s-10.7-24-24-24H304.1c-7 16.3-14.8 32.4-23.3 48z"/></svg>'}}),L([o()],M.prototype,"label",void 0),L([o()],M.prototype,"required",void 0),L([o()],M.prototype,"optional",void 0),L([o()],M.prototype,"showClearBtn",void 0),L([o()],M.prototype,"placeholder",void 0),L([o()],M.prototype,"placeholderIcon",void 0),L([o()],M.prototype,"disabled",void 0),L([o()],M.prototype,"value",void 0),L([o()],M.prototype,"isDrawing",void 0),L([o()],M.prototype,"height",void 0),L([o()],M.prototype,"writtenModeSvgController",void 0),L([o()],M.prototype,"translationSlimmer",void 0);var O=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(o<3?n(a):o>3?n(t,i,a):n(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a};class D extends a{constructor(){super(...arguments),this.penWidth="4px",this.clear=()=>{this.signatureContainerRef.innerHTML=x.sanitize("",j),this.value=null},this.startDrawing=e=>{if(this.disabled)return;this.isDrawing=!0;const{x:t,y:i}=this.getPoint(e);this.currentPath=document.createElementNS("http://www.w3.org/2000/svg","path"),this.currentPath.setAttribute("d",`M ${t} ${i}`),this.currentPath.setAttribute("stroke","rgba(4, 4, 28, 1)"),this.currentPath.setAttribute("stroke-width",this.penWidth),this.currentPath.setAttribute("fill","none"),this.currentPath.setAttribute("stroke-linecap","round"),this.currentPath.setAttribute("stroke-linejoin","round"),this.signatureContainerRef.appendChild(this.currentPath)},this.getPoint=e=>{var t,i;const r=this.signatureContainerRef.getBoundingClientRect(),n=null!==(t=e.clientX)&&void 0!==t?t:e.touches[0].clientX,o=null!==(i=e.clientY)&&void 0!==i?i:e.touches[0].clientY;return{x:n-r.left,y:o-r.top}},this.draw=e=>{if(!this.isDrawing)return;const{x:t,y:i}=this.getPoint(e),r=this.currentPath.getAttribute("d");this.currentPath.setAttribute("d",`${r} L ${t} ${i}`)},this.stopDrawing=()=>{this.isDrawing&&(this.isDrawing=!1,this.value={type:"written",img:this.generateSignatureImage()})}}componentDidLoad(){this.setupListeners(),this.fillSignature(this.value)}handleClear(){this.clear()}watchValue(e,t){w(e,t)||(this.changeEventEmitter.emit(e),this.fillSignature(e),b.notify(v,{host:this.host,detail:e}))}setSignatureContainerRef(e){this.signatureContainerRef=e}setupListeners(){const e=this.signatureContainerRef;e.addEventListener("mousedown",this.startDrawing),e.addEventListener("mousemove",this.draw),e.addEventListener("mouseup",this.stopDrawing),e.addEventListener("mouseleave",this.stopDrawing),e.addEventListener("touchstart",this.startDrawing),e.addEventListener("touchmove",this.draw),e.addEventListener("touchend",this.stopDrawing)}generateSignatureImage(){const e=(new XMLSerializer).serializeToString(this.signatureContainerRef);return`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(e)))}`}fromDataURL(e){if(!e||!e.img)return;const t=this.value.img.replace("data:image/svg+xml;base64,","");return(new DOMParser).parseFromString(atob(t),"image/svg+xml").documentElement}fillSignature(e){this.signatureContainerRef.replaceChildren();const t=this.fromDataURL(e);if(t){const e=Array.from(t.childNodes);this.signatureContainerRef.append(...e)}}}O([o()],D.prototype,"changeEventEmitter",void 0),O([o()],D.prototype,"host",void 0),O([o({writable:!0})],D.prototype,"value",void 0),O([o({writable:!0})],D.prototype,"isDrawing",void 0),O([o()],D.prototype,"disabled",void 0),O([s("componentDidLoad")],D.prototype,"componentDidLoad",null),O([s("clear")],D.prototype,"handleClear",null),O([s("watchValue")],D.prototype,"watchValue",null);var F=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(o<3?n(a):o>3?n(t,i,a):n(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a};const H=class{constructor(e){i(this,e),this.vegaChange=r(this,"vegaChange",7),this.change=r(this,"change",7),this.globalSlimmers={},this.translationSlimmer=new V,this.vegaComponentUsageRuntimeMetricsSlimmer=new d,this.vegaSignatureCaptureRenderer=new k,this.writtenModeRenderer=new M,this.writtenModeSvgController=new D,this.changeEventEmitter=y(H,g),this.formFieldController=new R({propertyRules:[{propertyName:"required",ruleFactory:e=>e?new C:null}],validationRulesName:"validationRules",defaultValue:null,attributeGetter:e=>this[e],inputContainerGetter:()=>this.writtenModeRenderer.getSignatureCaptureContainer(),touchableAreaGetter:()=>[this.writtenModeRenderer.getSignatureCaptureContainer()]}),this.pageResizeSlimmer=new z,this.currentBreakpoint=I(),this.isDrawing=!1,this.mode="written",this.label="",this.required=!1,this.optional=!1,this.name="",this.showClearBtn=!0,this.placeholder="Please sign here",this.placeholderIcon=p.getIconKey("signature"),this.disabled=!1,this.value=null,this.isValid=null,this.autoValidation=!0,this.validationRules=[],this.height="320px"}watchValue(e,t){}watchValidationRules(){}async clear(){}render(){return h(this.vegaSignatureCaptureRenderer.render(),this.host)}get host(){return n(this)}static get watchers(){return{value:["watchValue"],validationRules:["watchValidationRules"]}}};F([c()],H.prototype,"globalSlimmers",void 0),F([l()],H.prototype,"translationSlimmer",void 0),F([l()],H.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),F([l()],H.prototype,"vegaSignatureCaptureRenderer",void 0),F([l()],H.prototype,"writtenModeRenderer",void 0),F([l()],H.prototype,"writtenModeSvgController",void 0),F([l()],H.prototype,"changeEventEmitter",void 0),F([l()],H.prototype,"formFieldController",void 0),F([l()],H.prototype,"pageResizeSlimmer",void 0),H.style=':host{display:block}.signature-capture-written-container{border:1px solid rgba(var(--v-border-input-field, 171, 198, 216, 1));border-radius:8px;overflow:hidden;width:100%;position:relative;background-color:rgb(252, 252, 252)}.signature-capture-written-container:hover{border:1px solid rgba(var(--v-border-input-field-hover, 115, 160, 190, 1))}.signature-capture-written-container:focus-within{border:1px solid rgba(var(--v-border-input-field-focus, 19, 98, 226, 1));outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:3px;border:1px solid rgba(var(--v-border-color-input-field-focus, 19, 98, 226, 1))}.signature-capture-written-container .placeholder-container{height:100%;position:absolute;top:0px;right:0px;bottom:0px;left:0px;pointer-events:none}.signature-capture-written-container .placeholder-container-content{font-family:"Inter", sans-serif;font-size:18px;font-weight:500;line-height:28px;letter-spacing:0px;color:rgba(4, 4, 28, 0.64)}@media screen and (min-width: 768px) and (max-width: 1023px){.signature-capture-written-container .placeholder-container-content{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){.signature-capture-written-container .placeholder-container-content{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){.signature-capture-written-container .placeholder-container-content{font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px}}.signature-capture-written-container .placeholder-container-icon{flex-shrink:0;color:rgba(4, 4, 28, 0.64)}.signature-capture-written-container.error{border:1px solid rgba(var(--v-border-input-field-danger, 230, 50, 87, 1))}.signature-capture-written-container.error:hover{border:1px solid rgba(var(--v-border-input-field-danger-hover, 255, 87, 114, 1))}.signature-capture-written-container.error:focus-within{outline:2px solid rgba(var(--v-border-color-danger, 230, 50, 87, 1));outline-offset:3px;border:1px solid rgba(var(--v-border-color-input-field-danger-focus, 233, 71, 104, 1));border:1px solid rgba(var(--v-border-input-field-danger-focus, 233, 71, 104, 1))}.signature-capture-written-container.disabled{background-color:rgba(var(--v-bg-secondary, 245, 247, 247, 1));border:1px solid rgba(var(--v-border-input-field-disabled, 222, 225, 227, 1))}.signature-capture-written-container.disabled:hover,.signature-capture-written-container.disabled:focus-within{border:1px solid rgba(var(--v-border-input-field-disabled, 222, 225, 227, 1))}.signature-capture-written-container.disabled:focus-within{outline:none}.signature-capture-written-container.disabled .placeholder-container-content,.signature-capture-written-container.disabled .placeholder-container-icon{color:rgba(var(--v-text-input-disabled, 107, 116, 125, 1))}.signature-capture-written-footer .clear-button{flex-grow:1;padding-right:8px;text-align:right}.signature-capture-written-footer .vega-error-content{padding-top:0px;padding-right:0px;flex-grow:1}.vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px;color:rgba(var(--v-text-error, 189, 41, 71, 1));display:block;padding-right:8px;padding-left:8px}@media screen and (min-width: 768px) and (max-width: 1023px){.vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}.vega-hidden{display:none}';export{H as vega_signature_capture}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{e as t,q as e,h as n,l as s,s as r,y as i,N as a,p as o,z as l,D as c,A as h,k as u,j as d,E as w,I as p,f,M as m,b as g,R as T,S as x,a as b,F as O,G as y,J as E,K as k,L as A,U as v,O as C,P as B,r as H,Q as j,T as N,W as I,X as S,Y as R,Z as L,_ as D,$,a0 as M,a1 as P,v as F,a2 as z,a3 as U,c as V,o as W,a4 as G,a5 as J,a6 as K,a7 as Y,a8 as _,n as X,a9 as Q,aa as Z,t as q,ab as tt,ac as et}from"./p-ef1bbf14.js";import{g as nt}from"./p-8b5d3a52.js";import{i as st}from"./p-941a83db.js";import{C as rt}from"./p-2d0d575f.js";import{d as it}from"./p-36a57431.js";import{c as at,d as ot,e as lt}from"./p-4a2fe3a4.js";import{r as ct,i as ht}from"./p-aa135628.js";import{c as ut}from"./p-a841cf13.js";import{L as dt}from"./p-6e1ab235.js";class wt{}class pt{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(st)),e}}const ft=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)}},mt=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 a of n)if(i=a.canHandle(t,r,e),i>0){const n=t.slice(r,r+i),o=new pt(a,n);1===i&&a.shouldProceedToElementChildren()&&o.setChildrenOutput(this.process(Array.from(n[0].childNodes),e)),s.push(o),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 ft.getElementToBlockStrategies()}};class gt extends t{handleAction(t,e){const n=t.entityToBeAppended;e.children&&(n.forEach((t=>{t.parent=e})),e.children=e.children.concat(n))}}class Tt 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 xt extends Tt{handleAction(t,e){this.replaceElementWithElements(e,t.referChildren,[t.referChildren,...t.childrenToBeInserted])}}class bt extends i{constructor(t,e){super(),this.type=a.IMAGE,this.size=t,this.alt=e}static from(t,e){return[a.IMAGE,new bt(t,e)]}static getDefaultStyles(){return{verticalAlign:"bottom"}}toJSON(){return st(this.alt)?{size:this.size,alt:this.alt}:{size:this.size}}clone(){return new bt(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=bt.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%"})}}}bt.BASE_STYLES={verticalAlign:"bottom"};class Ot extends o{constructor(t,e,n,s){super(t,s),this.dtoName=Ot.dtoName,this.type=l.IMAGE,this.url=e,this.parent=n}static from(t,e,n={autoMatchFormat:!0}){const s=new Ot(t.id,t.url,e),r=!!n.autoMatchFormat,i=Object.assign({},t.annotations),{size:a}=i,o=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({},o),{size:null!=a?a:r?"md":void 0});return s.annotationMap=new Map(Object.keys(l).map((t=>"size"===t||"alt"===t?bt.from(l.size,l.alt):this.createAnnotationEntity(t,l[t]))).filter(st)),s}toJSON(){const t=Array.from(this.annotationMap.values()).filter((t=>t instanceof bt||t instanceof c)).reduce(((t,e)=>Object.assign(Object.assign({},t),e.toJSON())),{});return""==t.alt&&delete t.alt,Object.assign(Object.assign({id:this.id},Object.keys(t).length>0?{annotations:t}:{}),{type:"image",url:this.url})}clone(t){return new Ot(this.id,this.url,t,super.cloneAnnotations())}toHtml(t){const e=this.getAnnotationByType(a.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(st))}>`}doAnnotationActionApply(t){const e=h.get(u.name,Ot.name);e&&e.execute(t,this)}doModifyActionApply(t){h.executeTheStrategy(t,this)}}h.register(d.UPDATE_IMAGE_NODE_URL,Ot.name,new class extends t{handleAction(t,e){e.url=t.url}}),h.register(u.name,Ot.name,new class extends t{handleAction(t,e){const n=t.toAnnotation();e.annotationMap.set(n.type,n)}}),Ot.dtoName="RTEImageNode";class yt extends m{constructor(t,e){super(),this.type=d.INSERT_NEW_PARAGRAPH,this.startContainerNode=t,this.startOffset=e}}class Et extends b{constructor(t){super(t),this.dtoName=Et.dtoName,this.type="image",this.children=[]}static from(t,e={autoMatchFormat:!0}){const n=new Et(t.id),{annotations:s}=t;return n.children=t.nodes.map((t=>Ot.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 Et(nt())}clone(t){const e=new Et(this.id);return e.children=this.children.map((t=>t.clone(e))),e.annotationMap=super.cloneAnnotations(),e.parent=t,e}}h.register(d.MERGE_TWO_BLOCKS_NODES,Et.name,new O),h.register(d.REPLACE_CHILD_NODES,Et.name,new y),h.register(d.SPLIT_BLOCK_WITH_NODE,Et.name,new class extends t{handleAction(t,e){t.newBlock=this.splitImageNodes(t.splitPointNode,t.startOffsetOfNode,e)}splitImageNodes(t,e,n){const s=n.children.indexOf(t);if(s>-1){const t=n.children.slice(0,s+e),r=n.children.slice(s+e);n.apply(new w(t));const i=this.cloneWithNodes(r,n);return n.parent.apply(new p(n,i)),i}}cloneWithNodes(t,e){const n=e.createNewImageBlock();return n.children=[],n.apply(new f(t)),n}}),h.register(d.LINE_BREAK_SINGLE_BLOCK,Et.name,new class extends t{handleAction(t,e){const n=new yt(t.startContainerNode,t.startOffset);e.apply(n);const s=n.newBlock;s&&(t.lineBreakNode=s.children[0])}}),h.register(d.LINE_BREAK_MULTIPLE_BLOCKS,Et.name,new class extends t{handleAction(t,e){t.lineBreakNode=this.lineBreakMultipleBlocks(t.selectedBlocks,e)}lineBreakMultipleBlocks(t,e){const n=g.from({id:nt(),type:"paragraph",nodes:[{id:nt(),type:"text",text:"\n"}]});e.parent.apply(new p(e,n));const s=this.concatBlocksNodes(t.slice(1));return(0===s.length||s[0]&&""===s[0].text)&&s.push(new T(nt(),"\n",n)),n.apply(new f(s)),n.children[0]}concatBlocksNodes(t){const e=[];return t.map((t=>{"image"!==t.type&&(e.push(...t.children),t.parent.apply(new s(t)))})),e}}),h.register(d.INSERT_IMAGE_TO_BLOCK,Et.name,new class extends t{handleAction(t,e){const s=t.splitPointNode,r=t.startOffsetOfNode,i=t.imageBlockToBeInserted;e.children.length<1?e.apply(new f(i.children)):this.isCaretPositionAtBlockEnd(e,s,r)?e.parent.apply(new p(e,i)):this.isCaretPositionAtBlockStart(e,s,r)?e.parent.apply(new n(e,i)):(e.apply(new x(s,r)),e.parent.apply(new p(e,i)))}}),h.register(E.name,Et.name,new k),Et.dtoName="RTEImageBlock";class kt extends m{constructor(t){super(),this.type=d.MERGE_TWO_BLOCKS_NODES,this.blockNeedToBeMerged=t}}class At extends A{handleAction(t,e){const{startContainerNode:n}=t;n.isContentEditable()?n.isTextNode()&&this.deleteTextNodeContent(t,e):this.deleteDecoratorNodeContent(t,e);const r=e.parent;r&&e.isListItemBlock()&&0===r.children.length&&r.parent.apply(new s(r))}deleteTextNodeContent(t,e){const n=t.startContainerNode,r=t.startOffset;if(0!==r&&!n.isEmpty()){const i=n.text.slice(0,r-1)+n.text.slice(r);if(n.apply(new v(i)),i)return void(t.previousNode=n);{const r=e.children.indexOf(n),i=e.children[r+1],a=this.getPreviousNode(n);return a&&a.parent===e&&"\n"===a.text||1===e.children.length?void(t.previousNode=n):(e.apply(new s(n)),void(i&&(null==a?void 0:a.parent)!==e?t.nextNode=i:t.previousNode=a))}}{let r=this.getPreviousNode(n),i=null;const a=n.isEmpty();if(e.children.length&&r&&r.parent!==e)a&&e.apply(new s(n)),e.type===r.parent.type&&r.parent.apply(new kt(e));else if(this.isContentFirstNode(n)&&a&&(i=this.getNextNode(n)),a&&e.apply(new s(n)),r&&r.isTextNode()&&(r.isEmpty()||!r.isContentEditable()&&r.parent===e)){const t=r;r=this.getPreviousNode(r),t.parent.apply(new s(t)),r||a||(i=n)}0===e.children.length&&e.parent.apply(new s(e)),r?t.previousNode=r:i&&(t.nextNode=i)}}deleteDecoratorNodeContent(t,e){const n=t.startContainerNode,r=t.startOffset;let i=this.getPreviousNode(n),a=null;if(0!==r){const t=e;this.isContentFirstNode(n)&&(a=this.getNextNode(n)),1===t.children.length?t.parent.apply(new s(t)):t.apply(new s(n))}else{const r=i;r&&!r.isContentEditable()&&r.parent===e?(i=this.getPreviousNode(r),r.parent.apply(new s(r)),i||(t.nextNode=n)):i&&i.parent!==e&&e.type===i.parent.type&&i.parent.apply(new kt(e))}i?t.previousNode=i:a&&(t.nextNode=a)}}class vt extends t{handleAction(t,e){const{startContainerNode:n}=t;t.newBlock=this.breakSingleBlock(n,t.startOffset,e)}breakSingleBlock(t,e,s){const r=this.getNewParagraph(t);if(r){if(this.isCaretPositionAtBlockEnd(s,t,e))s.parent.apply(new p(s,r));else{if(!this.isCaretPositionAtBlockStart(s,t,e)){const n=new x(t,e);return s.apply(n),n.newBlock}s.parent.apply(new n(s,r))}return r}}getNewParagraph(t){const e=this.createNewParagraph("");if(e){let n=e.children[0];return t.isTextNode()&&t.isContentEditable()&&(e.children=[],n=t.cloneWithText(""),n.annotationMap.delete(a.LINK),e.apply(new f([n]))),e}}}class Ct extends m{constructor(t,e,n=!1){super(),this.isFlushable=!0,this.type=d.UPDATE_CURSOR_POSITION,this.immediatelyRun=!1,this.nextFocusNode=t,this.offset=e,this.immediatelyRun=n,this.immediatelyRun&&(this.isFlushable=!1)}}class Bt extends t{handleAction(t,e){const{rteRange:r,nodeToBeInserted:i}=t,{startNode:a,startOffset:o}=r;if(a){const t=e;if(a.isContentEditable()&&a.isTextNode())if("\n"!==a.text&&a.text&&0!==o){const e=a.text.substring(0,o),r=a.text.substring(o),l=a.cloneWithText(e),c=a.cloneWithText(r),h=[l,i];r&&h.push(c),t.apply(new n(a,...h)),t.apply(new s(a))}else t.apply(new n(a,i));else t.apply(0!==o?new p(a,i):new n(a,i));this.updateCursorPosition(i)}}updateCursorPosition(t){const e=this.getRootContent(t.parent);e&&e.apply(new Ct(t))}}class Ht extends t{handleAction(t,e){const{text:s,offset:r,decoratorNode:i}=t,a=this.createNewParagraph(s);if(a){const t=a.children[0];e.apply(0!==r?new p(i,t):new n(i,t)),this.setTheCursorPosition(t)}}setTheCursorPosition(t){const e=this.getRootContent(t.parent);e&&e.apply(new Ct(t))}}class jt extends t{handleAction(t,e){t.newBlock=this.breakSingleListItemBlock(t.startContainerNode,t.startOffset,e)}breakSingleListItemBlock(t,e,s){const r=s.createNewListItem(),i=this.copyInlineStyleToNewNode(t);if(r.apply(new f([i])),this.isCaretPositionAtBlockEnd(s,t,e))return this.breakListItemAtEnd(r,s);if(!this.isCaretPositionAtBlockStart(s,t,e)){const n=new x(t,e);return s.apply(n),n.newBlock}return s.parent.apply(new n(s,r)),r}breakListItemAtEnd(t,e){const n=e.parent.children[e.parent.children.length-1],r=1===e.children.length&&e.children[0].isEmpty();if(e===n&&r){const n=e.parent.parent;if("list-item"!==n.type){const r=g.from({id:nt(),type:"paragraph",nodes:[]});return r.apply(new f(t.children)),n.apply(new p(e.parent,r)),e.parent.apply(new s(e)),r}n.parent.apply(new p(n,t)),e.parent.apply(new s(e))}else e.parent.apply(new p(e,t));return t}copyInlineStyleToNewNode(t){const e=t.cloneWithText("");return e.annotationMap.delete(a.LINK),e}}class Nt extends C{handleAction(t,e){var n,r;const i=t.entityToBeRemoved instanceof H?t.entityToBeRemoved:null,a=i?e.children.indexOf(i):-1;(null===(n=null==i?void 0:i.nestList)||void 0===n?void 0:n.length)&&a>=0&&this.promoteNestListsToUpperLevel(i,e,a),super.handleAction(t,e);const o=e.parent;if(0===e.children.length&&o)if("list-item"===o.type){const t=o;(null===(r=t.nestList)||void 0===r?void 0:r.includes(e))&&t.apply(new B(e))}else o.apply(new s(e))}promoteNestListsToUpperLevel(t,e,s){var r,i;const a=[...null!==(r=t.nestList)&&void 0!==r?r:[]];let o=s+1;const l=[];a.forEach((t=>{if(t.type===e.type){const n=[...t.children];n.length>0&&(n.forEach((t=>{t.parent=e})),e.children.splice(o,0,...n),o+=n.length)}else l.push(t)}));const c=e.parent;if(l.length>0&&c instanceof H){const t=[...null!==(i=c.nestList)&&void 0!==i?i:[]],n=t.indexOf(e);n>=0?t.splice(0===s?n:n+1,0,...l):t.push(...l),c.apply(new j(t))}else l.length>0&&c.apply(0===s?new n(e,...l):new p(e,...l));t.apply(new j([]))}}class It extends t{handleAction(t,e){if(e.parent){const{blocksToBeInserted:s,startNode:r,startOffset:i}=t;let a=e;const o=s[0],l=1===s.length&&r instanceof T&&!["RTEListBlock","RTEHtmlBlock"].includes(o.constructor.name)&&o.children.length>0&&o.children.every((t=>{var e,n;return!0===(null===(n=(e=t).isTextNode)||void 0===n?void 0:n.call(e))}));if(r===e.children[0]&&0===i)e.parent.apply(new n(e,...s));else{if(l)return void this.inlineMergeSingleBlock(t,e);{const n=new x(r,i);e.apply(n),e.parent.apply(new p(e,...s)),a=s[s.length-1],t.futureFocusAtEnd=!0}}t.futureFocusBlock=a}}inlineMergeSingleBlock(t,e){const{blocksToBeInserted:n,startNode:s,startOffset:r}=t,i=n[0],a=i.children,o=s,l=e.children.indexOf(o);if(-1===l){const a=new x(s,r);return e.apply(a),e.parent.apply(new p(e,...n)),t.futureFocusBlock=i,void(t.futureFocusAtEnd=!0)}const c=o.text.slice(0,r),h=o.text.slice(r),u=e.children.slice(0,l),d=e.children.slice(l+1);c&&u.push(o.cloneWithText(c)),h&&d.unshift(o.cloneWithText(h)),e.apply(new w([...u,...a,...d]));const f=a[a.length-1];t.futureFocusBlock=e,t.futureFocusNode=f,f.isTextNode()&&(t.futureFocusNodeOffset=f.text.length)}}const St=new class{registerBlockBasicStrategies(t){h.register(d.DELETE_CHILDREN,t,t===N.name?new Nt:new C),h.register(d.APPEND_CHILDREN,t,new gt),h.register(d.INSERT_CHILDREN_BEFORE,t,new Tt),h.register(d.INSERT_CHILDREN_AFTER,t,new xt),h.register(d.DELETE_BLOCK_CONTENT,t,new At),h.register(d.INSERT_NEW_PARAGRAPH,t,t===H.name?new jt:new vt),h.register(d.INSERT_TEXT_TO_DECORATOR_NODE,t,new Ht),h.register(d.INSERT_NODE_TO_NEAREST_ROOT,t,new Bt),h.register(d.PASTE_CONTENT,t,new It)}};class Rt{}class Lt extends Rt{canHandle(t){return"RTETextNode"===t.dtoName}handle(t,e={}){return this.isBold(t)||e.bold?{bold:!0}:{}}isBold(t){return"STRONG"===t.nodeName||"B"===t.nodeName||t.style.fontWeight===I||t.style.fontWeight===S||t.classList.contains("v-rte--bold")}}class Dt extends Rt{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 $t extends Rt{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 Mt extends Rt{canHandle(t,e){return!e.skipCustomAnnotations&&!!t}handle(t){const e=R(t);return Object.keys(e).length>0?{customStyle:e}:{}}}class Pt extends Rt{canHandle(t){return["RTETextBlock","RTEListItemBlock","RTEListBlock"].includes(t.dtoName)}handle(t){const e=this.getIndent(t);return e?{indent:e}:{}}getIndent(t){const e=t.style;let n;if(e.marginLeft)n=e.marginLeft;else{if(!e.margin)return null;{const t=e.margin.split(" ");switch(t.length){case 4:n=t[3];break;case 2:case 3:n=t[1];break;default:n=t[0]}}}const s=Number(n.replace("px",""));return s&&s>=0?Math.floor(s/16):null}}class Ft extends Rt{canHandle(t){return["RTETextBlock","RTEListItemBlock","RTEListBlock"].includes(t.dtoName)}handle(t){const e=this.getTextAlign(t);return e?{textAlign:e}:{}}getTextAlign(t){const e=t.classList;if(e.contains("v-rte--horizontal-alignment-left"))return"left";if(e.contains("v-rte--horizontal-alignment-center"))return"center";if(e.contains("v-rte--horizontal-alignment-right"))return"right";if(e.contains("v-rte--horizontal-alignment-justify"))return"justify";switch(t.style.textAlign){case"center":return"center";case"right":return"right";case"justify":return"justify";case"left":return"left";default:return null}}}class zt extends Rt{canHandle(t){return"RTETextNode"===t.dtoName}handle(t,e={}){return this.isCode(t)||e.code?{code:!0}:{}}isCode(t){return t.classList.contains("v-rte--code")||"CODE"===t.nodeName||"PRE"===t.nodeName||"monospace"===t.style.fontFamily||"Roboto Mono"===t.style.fontFamily.replace(/["']/g,"")}}class Ut extends Rt{canHandle(t){return"RTETextNode"===t.dtoName}handle(t,e={}){const n=this.getColor(t)||e.textColor;return n?{textColor:n}:{}}getColor(t){var e;const n=null===(e=ct(t.style.color))||void 0===e?void 0:e.toUpperCase();if(n){const t=L.filter((t=>t.key!==D.key)).find((t=>t.light===n||t.dark===n));return t?t.key:null}for(const e of L)if(t.style.color.includes(e.key))return e.key;return null}}class Vt extends Rt{canHandle(t){return"RTETextNode"===t.dtoName}handle(t,e={}){return this.isItalic(t)||e.italic?{italic:!0}:{}}isItalic(t){return"I"===t.nodeName||t.style.fontStyle===$||"EM"===t.nodeName||t.classList.contains("v-rte--italic")}}class Wt extends Rt{canHandle(t,e){return!!e.autoMatchFormat&&"RTETextBlock"===t.dtoName}handle(t){const e=this.getTextStyle(t);return e?{textStyle:e}:{}}getTextStyle(t){const e=this.getElementTypeByDataType(t);if(e)return e;const n=this.getElementTypeByClassName(t);if(n)return n;const s=this.getElementTypeByNodeName(t);if(s)return s;return this.getElementTypeByFontSize(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 Gt{static isTitleOrSubtitle(t){if("DIV"===t.nodeName){const e=Gt.textStyleHandler.getTextStyle(t);return"title"===e||"subtitle"===e}return!1}static isLinkElement(t){return"A"===t.nodeName}}Gt.textStyleHandler=new Wt;class Jt extends Rt{constructor(){super(...arguments),this.handlers=[new Dt,new $t,new Mt]}canHandle(t){return"RTETextNode"===t.dtoName}handle(t,e={}){return e.link?{link:e.link}:Gt.isLinkElement(t)?{link:this.generateLinkAnnotations(t)}:{}}generateLinkAnnotations(t){const e={href:t.getAttribute("href")||"",groupKey:nt()};return this.handlers.forEach((n=>{Object.assign(e,n.handle(t))})),e}}class Kt extends Rt{canHandle(t){return"RTETextNode"===t.dtoName}handle(t,e={}){return this.isStrikethrough(t)||e.strikethrough?{strikethrough:!0}:{}}isStrikethrough(t){return t.style.textDecoration.includes(M)||"S"===t.nodeName||"DEL"===t.nodeName||t.classList.contains("v-rte--strikethrough")}}class Yt extends Rt{canHandle(t){return"RTETextNode"===t.dtoName}handle(t,e={}){return this.isUnderline(t)||e.underline?{underline:!0}:{}}isUnderline(t){return t.style.textDecoration.includes(P)||"U"===t.nodeName||"INS"===t.nodeName||t.classList.contains("v-rte--underline")}}class _t extends Rt{canHandle(t){return"RTEImageNode"===t.dtoName}handle(t){const e=this.getImageSize(t);return e?{size:e}:{}}getImageSize(t){return t.getAttribute("data-size")?t.getAttribute("data-size"):null}}class Xt extends Rt{canHandle(t){return"RTEImageNode"===t.dtoName}handle(t){return t.hasAttribute("alt")?{alt:t.getAttribute("alt")}:{}}}const Qt=new Set(["P","H1","H2","H3","H4","H5","H6","LI"]),Zt=new Set(["P","H1","H2","H3","H4","H5","H6","LI","UL","OL","IMG","CODE"]),qt=new Set(["BR","VEGA-RICH-TEXT-LINK-EDITOR","CODE","A"]),te=new Set(["TABLE","THEAD","TBODY","TFOOT","TR","DL"]),ee=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 ne(t){return Qt.has(t.parentElement.nodeName)}class se extends Rt{constructor(){super(...arguments),this.customAttributeHandler=new Dt,this.customStyleAnnotationHandler=new Mt,this.customClassAnnotationHandler=new $t}canHandle(t,e){return"RTETextNode"===t.dtoName&&!1===e.autoMatchFormat}handle(t,e){if(Zt.has(t.nodeName)&&!qt.has(t.nodeName))return{};const n=this.generateInlineHtmlAnnotation(t,Object.assign({},e));return n?{inlineHtml:n}:{}}generateInlineHtmlAnnotation(t,e){let{inlineHtml:n}=e;const s=Array.from(t.childNodes).some((t=>t.nodeType===Node.ELEMENT_NODE));if(!T.supportsHtmlTag(t.nodeName.toLowerCase())||s){const e=Object.assign(Object.assign({htmlTag:t.nodeName.toLowerCase()},s?{groupId:nt()}:{}),{customAttribute:this.customAttributeHandler.handle(t).customAttribute,customStyle:this.customStyleAnnotationHandler.handle(t).customStyle,customClass:this.customClassAnnotationHandler.handle(t).customClass});n=n?this.appendToInlineHtmlChain(n,e,t.parentNode):e}return n?Object.assign({},n):null}appendToInlineHtmlChain(t,e,n){return t.child&&n&&t.child.htmlTag===n.nodeName.toLowerCase()?Object.assign(Object.assign({},t),{child:this.appendToInlineHtmlChain(t.child,e,n)}):Object.assign(Object.assign({},t),{child:e})}}const re=new class{constructor(){this.handlers=[new Ft,new Pt,new Lt,new Vt,new Yt,new Kt,new Ut,new Jt,new zt,new _t,new Xt,new Dt,new $t,new Mt,new Wt,new se]}registerHandler(t){this.handlers.unshift(t)}generate(t,e,n={autoMatchFormat:!0}){n&&n.filterInlineStyles&&F.executeTheStrategyRefillAction(t.dtoName,e);const s=Gt.isLinkElement(e)&&"RTETextNode"===t.dtoName,r=this.handlers.filter((t=>!(!n.autoMatchFormat&&s)||t instanceof Jt)).filter((r=>e.nodeType!==Node.TEXT_NODE&&r.canHandle(t,{skipCustomAnnotations:n.skipCustomAnnotations||s,autoMatchFormat:n.autoMatchFormat}))).reduce(((t,s)=>{const r=s.handle(e,n.parentAnnotations);return Object.assign(Object.assign({},t),r)}),{});this.removeTextStyleDefaultsFromCustomStyle(r);const i=F.getStrategies(t.dtoName);for(const t of i)(n.autoMatchFormat||t.alwaysFilter)&&t.filterAnnotations(r);return r}removeTextStyleDefaultsFromCustomStyle(t){const e="textStyle"in t?t.textStyle:void 0,n=t.customStyle;if(!e||!n)return t;const s=z.getDefaultStyles(e);if(!s)return t;for(const t of Object.keys(s))n[t]===s[t]&&delete n[t];return 0===Object.keys(n).length&&delete t.customStyle,t}};class ie extends wt{constructor(){super(...arguments),this.annotationHandler=new Wt}generateChildNodes(t,e,n){const s=[],r=!(!n||!1!==n.autoMatchFormat),i=Object.assign({},e);return t.forEach((t=>{const a=ft.getElementToNodeStrategies().find((e=>e.canHandle([t],0,n)>0));let o=null;if(a&&(o=a.handle([t],n,i)),o)s.push(o);else if(ht(t)&&t.childNodes.length>0){const a=re.generate(T,t,Object.assign({parentAnnotations:r?{inlineHtml:i.inlineHtml,link:i.link,code:i.code}:e},n));s.push(...this.generateChildNodes(Array.from(t.childNodes),a,n))}})),s}matchTextBlockType(t){var e;return null!==(e=this.annotationHandler.handle(t).textStyle)&&void 0!==e?e:"paragraph"}}class ae extends ie{canHandle(t,e,n){const s=t[e];return s.nodeType===Node.TEXT_NODE||this.isInlineTagWithoutBlockChildren(s,n)||Zt.has(s.nodeName)&&!this.shouldFallBackToHtmlBlock(s)||n.autoMatchFormat||!this.isCustomHtmlContainer(s)||Gt.isTitleOrSubtitle(s)?0:1}handle(t,e){return U.from(this.generateHtmlBlock(t[0],e),e)}appendChildBlocks(t,e){t.children=e.map((e=>(e.parent=t,e)))}shouldProceedToElementChildren(){return!0}isInlineTagWithoutBlockChildren(t,e){if(qt.has(t.nodeName)&&0===t.childNodes.length)return!0;if(ne(t))return!(0===t.childNodes.length&&""===t.textContent&&!qt.has(t.nodeName)&&!ee.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||!te.has(t.parentElement.nodeName)&&(ee.has(t.nodeName)||qt.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&&!qt.has(t.nodeName)&&!ee.has(t.nodeName)))}isCustomHtmlContainer(t){return"DIV"!==t.nodeName||t.childNodes.length>0&&"IMG"!==t.childNodes[0].nodeName}generateHtmlBlock(t,e){return{id:nt(),type:"html-block",htmlTag:t.nodeName.toLowerCase(),annotations:re.generate(U,t,e),children:[]}}}class oe extends ie{canHandle(t,e){return"PRE"!==t[e].tagName&&"CODE"!==t[e].tagName||!t[e].hasAttribute("data-language")?0:1}handle(t){const n=t[0];if(n){const t=n.textContent,s=n.dataset.language;return e.from({id:nt(),type:"code-block",content:t,language:s})}}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}class le extends ie{createRTEImageBlock(t,e){const n=!(e&&e.autoMatchFormat||!t.parentNode||"DIV"===t.parentNode.nodeName);return Et.from({id:nt(),type:"image",nodes:[{id:nt(),type:"image",url:t.src,annotations:re.generate(Ot,t,e)}],annotations:Object.assign(Object.assign({},re.generate(Et,t.parentElement,e)),{internalWrapper:n})},e)}}class ce extends wt{shouldProceedToElementChildren(){return!1}appendChildBlocks(){}generateTextNode(t,e){return{id:nt(),type:"text",text:t,annotations:e}}}class he extends W{constructor(){super(...arguments),this.stylesToBeFiltered={}}get alwaysFilter(){return!0}filterAnnotations(t){const{textAlign:e,customStyle:n}=t;return e&&n?(this.stylesToBeFiltered=K.getDefaultStyles(e),super.filterAnnotations(t)):t}}class ue extends W{constructor(){super(...arguments),this.stylesToBeFiltered=z.getDefaultStyles("paragraph"),this.type="paragraph",this.elementTagName="p"}filterAnnotations(t){return t}canFilter(t){return G.isTextBlock(t.dtoName)&&t.type===this.type}canRefill(t,e){const n=this.classNameToBeAdded?`.${this.classNameToBeAdded}`:this.elementTagName;return G.isTextBlock(t)&&e.matches(n)}toCssText(){return this.buildCssTextForStyles(this.elementTagName,this.classNameToBeAdded)}}class de extends ue{constructor(t){super(),this.type="heading-1",this.elementTagName="h1",this.type=`heading-${t}`,this.elementTagName=`h${t}`,this.stylesToBeFiltered=z.getDefaultStyles(this.type)}}class we extends ue{constructor(t){super(),this.type="title",this.elementTagName="div",this.classNameToBeAdded="v-rte-title",this.type=t,this.classNameToBeAdded=`v-rte-${t}`,this.stylesToBeFiltered=z.getDefaultStyles(this.type)}}class pe extends W{constructor(){super(...arguments),this.stylesToBeFiltered=pe.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}filterAndDeleteStyles(t,e,n){var s;const r=super.filterAndDeleteStyles(t,e);return this.isExplicitlyNonBold(n)&&void 0===(null===(s=r.styles)||void 0===s?void 0:s.fontWeight)&&(r.styles=Object.assign(Object.assign({},r.styles),{fontWeight:pe.NON_BOLD_FONT_WEIGHT})),r}canFilter(t){return G.isTextNode(t.dtoName)&&this.parentBlockIsHeadingOrTitle(t)}canRefill(t,e){return G.isTextNode(t)&&"SPAN"===e.nodeName&&this.isHeadingOrTitleChild(e)}toCssText(){return`${this.parentElementSelectors.map((t=>`.${pe.RTE_CONTENT_CONTAINER_CLASS_NAME} ${t}`)).join(",")} { ${this.convertStylesMapToCssText()} }`}isExplicitlyNonBold(t){var e;const n=null===(e=t)||void 0===e?void 0:e.getAnnotationByType(a.BOLD);return!1===(null==n?void 0:n.bold)}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(pe.NON_HEADING_TITLE_ELEMENT_TAGS.includes(e.tagName))return!1;e=e.parentElement}return!1}}pe.BOLD_STYLES={fontWeight:"700"},pe.NON_BOLD_FONT_WEIGHT=_,pe.NON_HEADING_TITLE_ELEMENT_TAGS=["TD","TH","TR","TABLE","THEAD","TBODY","DIV","BODY"];class fe extends de{constructor(t){super(t),this.classNameToBeAdded=`v-rte-h${t}`,this.elementTagName="li"}canFilter(t){return G.isListItemBlock(t.dtoName)&&this.isBlockOrNodeStylesMatchFilterStyles(t,["fontSize","lineHeight"])}canRefill(t,e){return G.isListItemBlock(t)&&e.matches(this.elementTagName)&&e.classList.contains(this.classNameToBeAdded)}}class me extends we{constructor(t){super(t),this.classNameToBeAdded=`v-rte-${t}`,this.elementTagName="li"}canFilter(t){return G.isListItemBlock(t.dtoName)&&this.isBlockOrNodeStylesMatchFilterStyles(t,["fontSize","lineHeight"])}canRefill(t,e){return G.isListItemBlock(t)&&e.matches(this.elementTagName)&&e.classList.contains(this.classNameToBeAdded)}}X.registerRTEDTOClass("paragraph",g),X.registerRTEDTOClass("title",g),X.registerRTEDTOClass("subtitle",g),X.registerRTEDTOClass("heading-1",g),X.registerRTEDTOClass("heading-2",g),X.registerRTEDTOClass("heading-3",g),X.registerRTEDTOClass("heading-4",g),X.registerRTEDTOClass("heading-5",g),X.registerRTEDTOClass("heading-6",g),X.registerRTEDTOClass("heading-6",g),X.registerRTEDTOClass("list-item",H),X.registerRTEDTOClass("bullet-list",N),X.registerRTEDTOClass("number-list",N),X.registerRTEDTOClass("image",Et),X.registerRTEDTOClass("code-block",e),X.registerRTEDTOClass("html-block",U),X.registerRTEDTOClass("text",T),X.registerRTEDTOClass("image",Ot),St.registerBlockBasicStrategies(g.name),St.registerBlockBasicStrategies(N.name),St.registerBlockBasicStrategies(H.name),St.registerBlockBasicStrategies(Et.name),St.registerBlockBasicStrategies(U.name),ft.registerElementToBlockStrategy(new class extends ie{canHandle(t,e,n){let s=0;for(let r=e;r<t.length&&this.isInlineCandidate(t[r],n);r++)s++;return s}handle(t,e){const n=t[0].parentElement,s=e&&e.autoMatchFormat,r=this.generateChildNodes(t,s?re.generate(T,n,Object.assign(Object.assign({},e),{skipCustomAnnotations:!0})):{},e),i=s?super.matchTextBlockType(n):this.matchTextBlockTypeByTagName(n),a=!s&&!i;return g.from(Object.assign({id:nt(),type:i||"paragraph",nodes:r},a?{annotations:{internalWrapper:a}}:{annotations:re.generate(g,n,e)}),e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}matchTextBlockTypeByTagName(t){switch(t.nodeName){case"P":return"paragraph";default:return null}}isInlineCandidate(t,e){return t.nodeType===Node.TEXT_NODE||!this.isBlockBoundaryElement(t,e)&&(!!qt.has(t.nodeName)||!this.isDedicatedBlockTag(t.nodeName)&&(!(!1!==e.autoMatchFormat||!ne(t))||this.isInlineLeafOrWrapper(t)))}isBlockBoundaryElement(t,e){var n;return!!t.hasAttribute(V)||!!(null===(n=e.blockBoundaryRegistry)||void 0===n?void 0:n.isBoundary(t))}isDedicatedBlockTag(t){return Zt.has(t)&&!qt.has(t)}isInlineLeafOrWrapper(t){return 0===t.childNodes.length?ee.has(t.nodeName):this.isTextOnlyElement(t)?ee.has(t.nodeName)||qt.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}}),ft.registerElementToBlockStrategy(new class extends le{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}}),ft.registerElementToBlockStrategy(new class extends le{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(st(s))return Et.from({id:nt(),type:"image",nodes:[{id:nt(),type:"image",url:s.src,annotations:re.generate(Ot,n,e)}],annotations:re.generate(Et,n.parentElement,e)},e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),ft.registerElementToBlockStrategy(new class extends le{canHandle(t,e){return"IMG"===t[e].tagName?1:0}handle(t,e){return this.createRTEImageBlock(t[0],e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),ft.registerElementToBlockStrategy(new class extends ie{canHandle(t,e){return["heading-1","heading-2","heading-3","heading-4","heading-5","heading-6","title","subtitle"].includes(super.matchTextBlockType(t[e]))?1:0}handle(t,e){const n=this.generateChildNodes(Array.from(t[0].childNodes),{},e);return 0===n.length?null:g.from({id:nt(),type:super.matchTextBlockType(t[0]),nodes:n,annotations:re.generate(g,t[0],e)},e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),ft.registerElementToBlockStrategy(new class extends ie{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)?H.from(this.generateListItemBlockDTO(n,e),e):this.generateWithListBlock(t,e)}appendChildBlocks(t,e){t.nestList=e.filter((t=>["bullet-list","number-list"].includes(t.type))),t.nestList.forEach((e=>e.parent=t))}shouldProceedToElementChildren(){return!0}generateWithListBlock(t,e){return N.from({id:nt(),type:"bullet-list",blocks:t.map((t=>this.generateListItemBlockDTO(t,e)))},e)}generateListItemBlockDTO(t,e){return{id:nt(),type:"list-item",annotations:re.generate(H,t,e),nodes:this.generateChildNodes(Array.from(t.childNodes.length?t.childNodes:[t]).filter((t=>!["UL","OL"].includes(t.nodeName))),re.generate(T,t,Object.assign(Object.assign({},e),{skipCustomAnnotations:!0})),e)}}}),ft.registerElementToBlockStrategy(new class extends ie{canHandle(t,e){const n=t[e],s=n.parentElement,r="LI"!==n.nodeName,i=n.nodeType===Node.TEXT_NODE&&""===n.textContent.trim(),a=st(s)&&["UL","OL"].includes(s.nodeName);return r&&!i&&a?1:0}handle(t,e){const n=this.generateChildNodes(t,{},e);return H.from({id:nt(),type:"list-item",nodes:n,annotations:{}},e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),ft.registerElementToBlockStrategy(new class extends ie{canHandle(t,e){return"OL"===t[e].tagName?1:0}handle(t,e){return 0===t[0].childNodes.length?null:N.from({id:nt(),type:"number-list",blocks:[],annotations:re.generate(N,t[0],e)},e)}appendChildBlocks(t,e){t.children=e.filter((t=>t instanceof H)),e.forEach((e=>e.parent=t))}shouldProceedToElementChildren(){return!0}}),ft.registerElementToBlockStrategy(new class extends ie{canHandle(t,e){return"UL"===t[e].tagName?1:0}handle(t,e){return 0===t[0].childNodes.length?null:N.from({id:nt(),type:"bullet-list",blocks:[],annotations:re.generate(N,t[0],e)},e)}appendChildBlocks(t,e){t.children=e.filter((t=>t instanceof H)),e.forEach((e=>e.parent=t))}shouldProceedToElementChildren(){return!0}}),ft.registerElementToBlockStrategy(new ae),
|
|
1
|
+
import{e as t,q as e,h as n,l as s,s as r,y as i,N as a,p as o,z as l,D as c,A as h,k as u,j as d,E as w,I as p,f,M as m,b as g,R as T,S as x,a as b,F as O,G as y,J as E,K as k,L as A,U as v,O as C,P as B,r as H,Q as j,T as N,W as I,X as S,Y as R,Z as L,_ as D,$,a0 as M,a1 as P,v as F,a2 as z,a3 as U,c as V,o as W,a4 as G,a5 as J,a6 as K,a7 as Y,a8 as _,n as X,a9 as Q,aa as Z,t as q,ab as tt,ac as et}from"./p-6098c4bb.js";import{g as nt}from"./p-8b5d3a52.js";import{i as st}from"./p-941a83db.js";import{C as rt}from"./p-2d0d575f.js";import{d as it}from"./p-36a57431.js";import{c as at,d as ot,e as lt}from"./p-53e3f259.js";import{r as ct,i as ht}from"./p-aa135628.js";import{c as ut}from"./p-a841cf13.js";import{L as dt}from"./p-6e1ab235.js";class wt{}class pt{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(st)),e}}const ft=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)}},mt=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 a of n)if(i=a.canHandle(t,r,e),i>0){const n=t.slice(r,r+i),o=new pt(a,n);1===i&&a.shouldProceedToElementChildren()&&o.setChildrenOutput(this.process(Array.from(n[0].childNodes),e)),s.push(o),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 ft.getElementToBlockStrategies()}};class gt extends t{handleAction(t,e){const n=t.entityToBeAppended;e.children&&(n.forEach((t=>{t.parent=e})),e.children=e.children.concat(n))}}class Tt 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 xt extends Tt{handleAction(t,e){this.replaceElementWithElements(e,t.referChildren,[t.referChildren,...t.childrenToBeInserted])}}class bt extends i{constructor(t,e){super(),this.type=a.IMAGE,this.size=t,this.alt=e}static from(t,e){return[a.IMAGE,new bt(t,e)]}static getDefaultStyles(){return{verticalAlign:"bottom"}}toJSON(){return st(this.alt)?{size:this.size,alt:this.alt}:{size:this.size}}clone(){return new bt(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=bt.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%"})}}}bt.BASE_STYLES={verticalAlign:"bottom"};class Ot extends o{constructor(t,e,n,s){super(t,s),this.dtoName=Ot.dtoName,this.type=l.IMAGE,this.url=e,this.parent=n}static from(t,e,n={autoMatchFormat:!0}){const s=new Ot(t.id,t.url,e),r=!!n.autoMatchFormat,i=Object.assign({},t.annotations),{size:a}=i,o=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({},o),{size:null!=a?a:r?"md":void 0});return s.annotationMap=new Map(Object.keys(l).map((t=>"size"===t||"alt"===t?bt.from(l.size,l.alt):this.createAnnotationEntity(t,l[t]))).filter(st)),s}toJSON(){const t=Array.from(this.annotationMap.values()).filter((t=>t instanceof bt||t instanceof c)).reduce(((t,e)=>Object.assign(Object.assign({},t),e.toJSON())),{});return""==t.alt&&delete t.alt,Object.assign(Object.assign({id:this.id},Object.keys(t).length>0?{annotations:t}:{}),{type:"image",url:this.url})}clone(t){return new Ot(this.id,this.url,t,super.cloneAnnotations())}toHtml(t){const e=this.getAnnotationByType(a.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(st))}>`}doAnnotationActionApply(t){const e=h.get(u.name,Ot.name);e&&e.execute(t,this)}doModifyActionApply(t){h.executeTheStrategy(t,this)}}h.register(d.UPDATE_IMAGE_NODE_URL,Ot.name,new class extends t{handleAction(t,e){e.url=t.url}}),h.register(u.name,Ot.name,new class extends t{handleAction(t,e){const n=t.toAnnotation();e.annotationMap.set(n.type,n)}}),Ot.dtoName="RTEImageNode";class yt extends m{constructor(t,e){super(),this.type=d.INSERT_NEW_PARAGRAPH,this.startContainerNode=t,this.startOffset=e}}class Et extends b{constructor(t){super(t),this.dtoName=Et.dtoName,this.type="image",this.children=[]}static from(t,e={autoMatchFormat:!0}){const n=new Et(t.id),{annotations:s}=t;return n.children=t.nodes.map((t=>Ot.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 Et(nt())}clone(t){const e=new Et(this.id);return e.children=this.children.map((t=>t.clone(e))),e.annotationMap=super.cloneAnnotations(),e.parent=t,e}}h.register(d.MERGE_TWO_BLOCKS_NODES,Et.name,new O),h.register(d.REPLACE_CHILD_NODES,Et.name,new y),h.register(d.SPLIT_BLOCK_WITH_NODE,Et.name,new class extends t{handleAction(t,e){t.newBlock=this.splitImageNodes(t.splitPointNode,t.startOffsetOfNode,e)}splitImageNodes(t,e,n){const s=n.children.indexOf(t);if(s>-1){const t=n.children.slice(0,s+e),r=n.children.slice(s+e);n.apply(new w(t));const i=this.cloneWithNodes(r,n);return n.parent.apply(new p(n,i)),i}}cloneWithNodes(t,e){const n=e.createNewImageBlock();return n.children=[],n.apply(new f(t)),n}}),h.register(d.LINE_BREAK_SINGLE_BLOCK,Et.name,new class extends t{handleAction(t,e){const n=new yt(t.startContainerNode,t.startOffset);e.apply(n);const s=n.newBlock;s&&(t.lineBreakNode=s.children[0])}}),h.register(d.LINE_BREAK_MULTIPLE_BLOCKS,Et.name,new class extends t{handleAction(t,e){t.lineBreakNode=this.lineBreakMultipleBlocks(t.selectedBlocks,e)}lineBreakMultipleBlocks(t,e){const n=g.from({id:nt(),type:"paragraph",nodes:[{id:nt(),type:"text",text:"\n"}]});e.parent.apply(new p(e,n));const s=this.concatBlocksNodes(t.slice(1));return(0===s.length||s[0]&&""===s[0].text)&&s.push(new T(nt(),"\n",n)),n.apply(new f(s)),n.children[0]}concatBlocksNodes(t){const e=[];return t.map((t=>{"image"!==t.type&&(e.push(...t.children),t.parent.apply(new s(t)))})),e}}),h.register(d.INSERT_IMAGE_TO_BLOCK,Et.name,new class extends t{handleAction(t,e){const s=t.splitPointNode,r=t.startOffsetOfNode,i=t.imageBlockToBeInserted;e.children.length<1?e.apply(new f(i.children)):this.isCaretPositionAtBlockEnd(e,s,r)?e.parent.apply(new p(e,i)):this.isCaretPositionAtBlockStart(e,s,r)?e.parent.apply(new n(e,i)):(e.apply(new x(s,r)),e.parent.apply(new p(e,i)))}}),h.register(E.name,Et.name,new k),Et.dtoName="RTEImageBlock";class kt extends m{constructor(t){super(),this.type=d.MERGE_TWO_BLOCKS_NODES,this.blockNeedToBeMerged=t}}class At extends A{handleAction(t,e){const{startContainerNode:n}=t;n.isContentEditable()?n.isTextNode()&&this.deleteTextNodeContent(t,e):this.deleteDecoratorNodeContent(t,e);const r=e.parent;r&&e.isListItemBlock()&&0===r.children.length&&r.parent.apply(new s(r))}deleteTextNodeContent(t,e){const n=t.startContainerNode,r=t.startOffset;if(0!==r&&!n.isEmpty()){const i=n.text.slice(0,r-1)+n.text.slice(r);if(n.apply(new v(i)),i)return void(t.previousNode=n);{const r=e.children.indexOf(n),i=e.children[r+1],a=this.getPreviousNode(n);return a&&a.parent===e&&"\n"===a.text||1===e.children.length?void(t.previousNode=n):(e.apply(new s(n)),void(i&&(null==a?void 0:a.parent)!==e?t.nextNode=i:t.previousNode=a))}}{let r=this.getPreviousNode(n),i=null;const a=n.isEmpty();if(e.children.length&&r&&r.parent!==e)a&&e.apply(new s(n)),e.type===r.parent.type&&r.parent.apply(new kt(e));else if(this.isContentFirstNode(n)&&a&&(i=this.getNextNode(n)),a&&e.apply(new s(n)),r&&r.isTextNode()&&(r.isEmpty()||!r.isContentEditable()&&r.parent===e)){const t=r;r=this.getPreviousNode(r),t.parent.apply(new s(t)),r||a||(i=n)}0===e.children.length&&e.parent.apply(new s(e)),r?t.previousNode=r:i&&(t.nextNode=i)}}deleteDecoratorNodeContent(t,e){const n=t.startContainerNode,r=t.startOffset;let i=this.getPreviousNode(n),a=null;if(0!==r){const t=e;this.isContentFirstNode(n)&&(a=this.getNextNode(n)),1===t.children.length?t.parent.apply(new s(t)):t.apply(new s(n))}else{const r=i;r&&!r.isContentEditable()&&r.parent===e?(i=this.getPreviousNode(r),r.parent.apply(new s(r)),i||(t.nextNode=n)):i&&i.parent!==e&&e.type===i.parent.type&&i.parent.apply(new kt(e))}i?t.previousNode=i:a&&(t.nextNode=a)}}class vt extends t{handleAction(t,e){const{startContainerNode:n}=t;t.newBlock=this.breakSingleBlock(n,t.startOffset,e)}breakSingleBlock(t,e,s){const r=this.getNewParagraph(t);if(r){if(this.isCaretPositionAtBlockEnd(s,t,e))s.parent.apply(new p(s,r));else{if(!this.isCaretPositionAtBlockStart(s,t,e)){const n=new x(t,e);return s.apply(n),n.newBlock}s.parent.apply(new n(s,r))}return r}}getNewParagraph(t){const e=this.createNewParagraph("");if(e){let n=e.children[0];return t.isTextNode()&&t.isContentEditable()&&(e.children=[],n=t.cloneWithText(""),n.annotationMap.delete(a.LINK),e.apply(new f([n]))),e}}}class Ct extends m{constructor(t,e,n=!1){super(),this.isFlushable=!0,this.type=d.UPDATE_CURSOR_POSITION,this.immediatelyRun=!1,this.nextFocusNode=t,this.offset=e,this.immediatelyRun=n,this.immediatelyRun&&(this.isFlushable=!1)}}class Bt extends t{handleAction(t,e){const{rteRange:r,nodeToBeInserted:i}=t,{startNode:a,startOffset:o}=r;if(a){const t=e;if(a.isContentEditable()&&a.isTextNode())if("\n"!==a.text&&a.text&&0!==o){const e=a.text.substring(0,o),r=a.text.substring(o),l=a.cloneWithText(e),c=a.cloneWithText(r),h=[l,i];r&&h.push(c),t.apply(new n(a,...h)),t.apply(new s(a))}else t.apply(new n(a,i));else t.apply(0!==o?new p(a,i):new n(a,i));this.updateCursorPosition(i)}}updateCursorPosition(t){const e=this.getRootContent(t.parent);e&&e.apply(new Ct(t))}}class Ht extends t{handleAction(t,e){const{text:s,offset:r,decoratorNode:i}=t,a=this.createNewParagraph(s);if(a){const t=a.children[0];e.apply(0!==r?new p(i,t):new n(i,t)),this.setTheCursorPosition(t)}}setTheCursorPosition(t){const e=this.getRootContent(t.parent);e&&e.apply(new Ct(t))}}class jt extends t{handleAction(t,e){t.newBlock=this.breakSingleListItemBlock(t.startContainerNode,t.startOffset,e)}breakSingleListItemBlock(t,e,s){const r=s.createNewListItem(),i=this.copyInlineStyleToNewNode(t);if(r.apply(new f([i])),this.isCaretPositionAtBlockEnd(s,t,e))return this.breakListItemAtEnd(r,s);if(!this.isCaretPositionAtBlockStart(s,t,e)){const n=new x(t,e);return s.apply(n),n.newBlock}return s.parent.apply(new n(s,r)),r}breakListItemAtEnd(t,e){const n=e.parent.children[e.parent.children.length-1],r=1===e.children.length&&e.children[0].isEmpty();if(e===n&&r){const n=e.parent.parent;if("list-item"!==n.type){const r=g.from({id:nt(),type:"paragraph",nodes:[]});return r.apply(new f(t.children)),n.apply(new p(e.parent,r)),e.parent.apply(new s(e)),r}n.parent.apply(new p(n,t)),e.parent.apply(new s(e))}else e.parent.apply(new p(e,t));return t}copyInlineStyleToNewNode(t){const e=t.cloneWithText("");return e.annotationMap.delete(a.LINK),e}}class Nt extends C{handleAction(t,e){var n,r;const i=t.entityToBeRemoved instanceof H?t.entityToBeRemoved:null,a=i?e.children.indexOf(i):-1;(null===(n=null==i?void 0:i.nestList)||void 0===n?void 0:n.length)&&a>=0&&this.promoteNestListsToUpperLevel(i,e,a),super.handleAction(t,e);const o=e.parent;if(0===e.children.length&&o)if("list-item"===o.type){const t=o;(null===(r=t.nestList)||void 0===r?void 0:r.includes(e))&&t.apply(new B(e))}else o.apply(new s(e))}promoteNestListsToUpperLevel(t,e,s){var r,i;const a=[...null!==(r=t.nestList)&&void 0!==r?r:[]];let o=s+1;const l=[];a.forEach((t=>{if(t.type===e.type){const n=[...t.children];n.length>0&&(n.forEach((t=>{t.parent=e})),e.children.splice(o,0,...n),o+=n.length)}else l.push(t)}));const c=e.parent;if(l.length>0&&c instanceof H){const t=[...null!==(i=c.nestList)&&void 0!==i?i:[]],n=t.indexOf(e);n>=0?t.splice(0===s?n:n+1,0,...l):t.push(...l),c.apply(new j(t))}else l.length>0&&c.apply(0===s?new n(e,...l):new p(e,...l));t.apply(new j([]))}}class It extends t{handleAction(t,e){if(e.parent){const{blocksToBeInserted:s,startNode:r,startOffset:i}=t;let a=e;const o=s[0],l=1===s.length&&r instanceof T&&!["RTEListBlock","RTEHtmlBlock"].includes(o.constructor.name)&&o.children.length>0&&o.children.every((t=>{var e,n;return!0===(null===(n=(e=t).isTextNode)||void 0===n?void 0:n.call(e))}));if(r===e.children[0]&&0===i)e.parent.apply(new n(e,...s));else{if(l)return void this.inlineMergeSingleBlock(t,e);{const n=new x(r,i);e.apply(n),e.parent.apply(new p(e,...s)),a=s[s.length-1],t.futureFocusAtEnd=!0}}t.futureFocusBlock=a}}inlineMergeSingleBlock(t,e){const{blocksToBeInserted:n,startNode:s,startOffset:r}=t,i=n[0],a=i.children,o=s,l=e.children.indexOf(o);if(-1===l){const a=new x(s,r);return e.apply(a),e.parent.apply(new p(e,...n)),t.futureFocusBlock=i,void(t.futureFocusAtEnd=!0)}const c=o.text.slice(0,r),h=o.text.slice(r),u=e.children.slice(0,l),d=e.children.slice(l+1);c&&u.push(o.cloneWithText(c)),h&&d.unshift(o.cloneWithText(h)),e.apply(new w([...u,...a,...d]));const f=a[a.length-1];t.futureFocusBlock=e,t.futureFocusNode=f,f.isTextNode()&&(t.futureFocusNodeOffset=f.text.length)}}const St=new class{registerBlockBasicStrategies(t){h.register(d.DELETE_CHILDREN,t,t===N.name?new Nt:new C),h.register(d.APPEND_CHILDREN,t,new gt),h.register(d.INSERT_CHILDREN_BEFORE,t,new Tt),h.register(d.INSERT_CHILDREN_AFTER,t,new xt),h.register(d.DELETE_BLOCK_CONTENT,t,new At),h.register(d.INSERT_NEW_PARAGRAPH,t,t===H.name?new jt:new vt),h.register(d.INSERT_TEXT_TO_DECORATOR_NODE,t,new Ht),h.register(d.INSERT_NODE_TO_NEAREST_ROOT,t,new Bt),h.register(d.PASTE_CONTENT,t,new It)}};class Rt{}class Lt extends Rt{canHandle(t){return"RTETextNode"===t.dtoName}handle(t,e={}){return this.isBold(t)||e.bold?{bold:!0}:{}}isBold(t){return"STRONG"===t.nodeName||"B"===t.nodeName||t.style.fontWeight===I||t.style.fontWeight===S||t.classList.contains("v-rte--bold")}}class Dt extends Rt{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 $t extends Rt{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 Mt extends Rt{canHandle(t,e){return!e.skipCustomAnnotations&&!!t}handle(t){const e=R(t);return Object.keys(e).length>0?{customStyle:e}:{}}}class Pt extends Rt{canHandle(t){return["RTETextBlock","RTEListItemBlock","RTEListBlock"].includes(t.dtoName)}handle(t){const e=this.getIndent(t);return e?{indent:e}:{}}getIndent(t){const e=t.style;let n;if(e.marginLeft)n=e.marginLeft;else{if(!e.margin)return null;{const t=e.margin.split(" ");switch(t.length){case 4:n=t[3];break;case 2:case 3:n=t[1];break;default:n=t[0]}}}const s=Number(n.replace("px",""));return s&&s>=0?Math.floor(s/16):null}}class Ft extends Rt{canHandle(t){return["RTETextBlock","RTEListItemBlock","RTEListBlock"].includes(t.dtoName)}handle(t){const e=this.getTextAlign(t);return e?{textAlign:e}:{}}getTextAlign(t){const e=t.classList;if(e.contains("v-rte--horizontal-alignment-left"))return"left";if(e.contains("v-rte--horizontal-alignment-center"))return"center";if(e.contains("v-rte--horizontal-alignment-right"))return"right";if(e.contains("v-rte--horizontal-alignment-justify"))return"justify";switch(t.style.textAlign){case"center":return"center";case"right":return"right";case"justify":return"justify";case"left":return"left";default:return null}}}class zt extends Rt{canHandle(t){return"RTETextNode"===t.dtoName}handle(t,e={}){return this.isCode(t)||e.code?{code:!0}:{}}isCode(t){return t.classList.contains("v-rte--code")||"CODE"===t.nodeName||"PRE"===t.nodeName||"monospace"===t.style.fontFamily||"Roboto Mono"===t.style.fontFamily.replace(/["']/g,"")}}class Ut extends Rt{canHandle(t){return"RTETextNode"===t.dtoName}handle(t,e={}){const n=this.getColor(t)||e.textColor;return n?{textColor:n}:{}}getColor(t){var e;const n=null===(e=ct(t.style.color))||void 0===e?void 0:e.toUpperCase();if(n){const t=L.filter((t=>t.key!==D.key)).find((t=>t.light===n||t.dark===n));return t?t.key:null}for(const e of L)if(t.style.color.includes(e.key))return e.key;return null}}class Vt extends Rt{canHandle(t){return"RTETextNode"===t.dtoName}handle(t,e={}){return this.isItalic(t)||e.italic?{italic:!0}:{}}isItalic(t){return"I"===t.nodeName||t.style.fontStyle===$||"EM"===t.nodeName||t.classList.contains("v-rte--italic")}}class Wt extends Rt{canHandle(t,e){return!!e.autoMatchFormat&&"RTETextBlock"===t.dtoName}handle(t){const e=this.getTextStyle(t);return e?{textStyle:e}:{}}getTextStyle(t){const e=this.getElementTypeByDataType(t);if(e)return e;const n=this.getElementTypeByClassName(t);if(n)return n;const s=this.getElementTypeByNodeName(t);if(s)return s;return this.getElementTypeByFontSize(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 Gt{static isTitleOrSubtitle(t){if("DIV"===t.nodeName){const e=Gt.textStyleHandler.getTextStyle(t);return"title"===e||"subtitle"===e}return!1}static isLinkElement(t){return"A"===t.nodeName}}Gt.textStyleHandler=new Wt;class Jt extends Rt{constructor(){super(...arguments),this.handlers=[new Dt,new $t,new Mt]}canHandle(t){return"RTETextNode"===t.dtoName}handle(t,e={}){return e.link?{link:e.link}:Gt.isLinkElement(t)?{link:this.generateLinkAnnotations(t)}:{}}generateLinkAnnotations(t){const e={href:t.getAttribute("href")||"",groupKey:nt()};return this.handlers.forEach((n=>{Object.assign(e,n.handle(t))})),e}}class Kt extends Rt{canHandle(t){return"RTETextNode"===t.dtoName}handle(t,e={}){return this.isStrikethrough(t)||e.strikethrough?{strikethrough:!0}:{}}isStrikethrough(t){return t.style.textDecoration.includes(M)||"S"===t.nodeName||"DEL"===t.nodeName||t.classList.contains("v-rte--strikethrough")}}class Yt extends Rt{canHandle(t){return"RTETextNode"===t.dtoName}handle(t,e={}){return this.isUnderline(t)||e.underline?{underline:!0}:{}}isUnderline(t){return t.style.textDecoration.includes(P)||"U"===t.nodeName||"INS"===t.nodeName||t.classList.contains("v-rte--underline")}}class _t extends Rt{canHandle(t){return"RTEImageNode"===t.dtoName}handle(t){const e=this.getImageSize(t);return e?{size:e}:{}}getImageSize(t){return t.getAttribute("data-size")?t.getAttribute("data-size"):null}}class Xt extends Rt{canHandle(t){return"RTEImageNode"===t.dtoName}handle(t){return t.hasAttribute("alt")?{alt:t.getAttribute("alt")}:{}}}const Qt=new Set(["P","H1","H2","H3","H4","H5","H6","LI"]),Zt=new Set(["P","H1","H2","H3","H4","H5","H6","LI","UL","OL","IMG","CODE"]),qt=new Set(["BR","VEGA-RICH-TEXT-LINK-EDITOR","CODE","A"]),te=new Set(["TABLE","THEAD","TBODY","TFOOT","TR","DL"]),ee=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 ne(t){return Qt.has(t.parentElement.nodeName)}class se extends Rt{constructor(){super(...arguments),this.customAttributeHandler=new Dt,this.customStyleAnnotationHandler=new Mt,this.customClassAnnotationHandler=new $t}canHandle(t,e){return"RTETextNode"===t.dtoName&&!1===e.autoMatchFormat}handle(t,e){if(Zt.has(t.nodeName)&&!qt.has(t.nodeName))return{};const n=this.generateInlineHtmlAnnotation(t,Object.assign({},e));return n?{inlineHtml:n}:{}}generateInlineHtmlAnnotation(t,e){let{inlineHtml:n}=e;const s=Array.from(t.childNodes).some((t=>t.nodeType===Node.ELEMENT_NODE));if(!T.supportsHtmlTag(t.nodeName.toLowerCase())||s){const e=Object.assign(Object.assign({htmlTag:t.nodeName.toLowerCase()},s?{groupId:nt()}:{}),{customAttribute:this.customAttributeHandler.handle(t).customAttribute,customStyle:this.customStyleAnnotationHandler.handle(t).customStyle,customClass:this.customClassAnnotationHandler.handle(t).customClass});n=n?this.appendToInlineHtmlChain(n,e,t.parentNode):e}return n?Object.assign({},n):null}appendToInlineHtmlChain(t,e,n){return t.child&&n&&t.child.htmlTag===n.nodeName.toLowerCase()?Object.assign(Object.assign({},t),{child:this.appendToInlineHtmlChain(t.child,e,n)}):Object.assign(Object.assign({},t),{child:e})}}const re=new class{constructor(){this.handlers=[new Ft,new Pt,new Lt,new Vt,new Yt,new Kt,new Ut,new Jt,new zt,new _t,new Xt,new Dt,new $t,new Mt,new Wt,new se]}registerHandler(t){this.handlers.unshift(t)}generate(t,e,n={autoMatchFormat:!0}){n&&n.filterInlineStyles&&F.executeTheStrategyRefillAction(t.dtoName,e);const s=Gt.isLinkElement(e)&&"RTETextNode"===t.dtoName,r=this.handlers.filter((t=>!(!n.autoMatchFormat&&s)||t instanceof Jt)).filter((r=>e.nodeType!==Node.TEXT_NODE&&r.canHandle(t,{skipCustomAnnotations:n.skipCustomAnnotations||s,autoMatchFormat:n.autoMatchFormat}))).reduce(((t,s)=>{const r=s.handle(e,n.parentAnnotations);return Object.assign(Object.assign({},t),r)}),{});this.removeTextStyleDefaultsFromCustomStyle(r);const i=F.getStrategies(t.dtoName);for(const t of i)(n.autoMatchFormat||t.alwaysFilter)&&t.filterAnnotations(r);return r}removeTextStyleDefaultsFromCustomStyle(t){const e="textStyle"in t?t.textStyle:void 0,n=t.customStyle;if(!e||!n)return t;const s=z.getDefaultStyles(e);if(!s)return t;for(const t of Object.keys(s))n[t]===s[t]&&delete n[t];return 0===Object.keys(n).length&&delete t.customStyle,t}};class ie extends wt{constructor(){super(...arguments),this.annotationHandler=new Wt}generateChildNodes(t,e,n){const s=[],r=!(!n||!1!==n.autoMatchFormat),i=Object.assign({},e);return t.forEach((t=>{const a=ft.getElementToNodeStrategies().find((e=>e.canHandle([t],0,n)>0));let o=null;if(a&&(o=a.handle([t],n,i)),o)s.push(o);else if(ht(t)&&t.childNodes.length>0){const a=re.generate(T,t,Object.assign({parentAnnotations:r?{inlineHtml:i.inlineHtml,link:i.link,code:i.code}:e},n));s.push(...this.generateChildNodes(Array.from(t.childNodes),a,n))}})),s}matchTextBlockType(t){var e;return null!==(e=this.annotationHandler.handle(t).textStyle)&&void 0!==e?e:"paragraph"}}class ae extends ie{canHandle(t,e,n){const s=t[e];return s.nodeType===Node.TEXT_NODE||this.isInlineTagWithoutBlockChildren(s,n)||Zt.has(s.nodeName)&&!this.shouldFallBackToHtmlBlock(s)||n.autoMatchFormat||!this.isCustomHtmlContainer(s)||Gt.isTitleOrSubtitle(s)?0:1}handle(t,e){return U.from(this.generateHtmlBlock(t[0],e),e)}appendChildBlocks(t,e){t.children=e.map((e=>(e.parent=t,e)))}shouldProceedToElementChildren(){return!0}isInlineTagWithoutBlockChildren(t,e){if(qt.has(t.nodeName)&&0===t.childNodes.length)return!0;if(ne(t))return!(0===t.childNodes.length&&""===t.textContent&&!qt.has(t.nodeName)&&!ee.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||!te.has(t.parentElement.nodeName)&&(ee.has(t.nodeName)||qt.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&&!qt.has(t.nodeName)&&!ee.has(t.nodeName)))}isCustomHtmlContainer(t){return"DIV"!==t.nodeName||t.childNodes.length>0&&"IMG"!==t.childNodes[0].nodeName}generateHtmlBlock(t,e){return{id:nt(),type:"html-block",htmlTag:t.nodeName.toLowerCase(),annotations:re.generate(U,t,e),children:[]}}}class oe extends ie{canHandle(t,e){return"PRE"!==t[e].tagName&&"CODE"!==t[e].tagName||!t[e].hasAttribute("data-language")?0:1}handle(t){const n=t[0];if(n){const t=n.textContent,s=n.dataset.language;return e.from({id:nt(),type:"code-block",content:t,language:s})}}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}class le extends ie{createRTEImageBlock(t,e){const n=!(e&&e.autoMatchFormat||!t.parentNode||"DIV"===t.parentNode.nodeName);return Et.from({id:nt(),type:"image",nodes:[{id:nt(),type:"image",url:t.src,annotations:re.generate(Ot,t,e)}],annotations:Object.assign(Object.assign({},re.generate(Et,t.parentElement,e)),{internalWrapper:n})},e)}}class ce extends wt{shouldProceedToElementChildren(){return!1}appendChildBlocks(){}generateTextNode(t,e){return{id:nt(),type:"text",text:t,annotations:e}}}class he extends W{constructor(){super(...arguments),this.stylesToBeFiltered={}}get alwaysFilter(){return!0}filterAnnotations(t){const{textAlign:e,customStyle:n}=t;return e&&n?(this.stylesToBeFiltered=K.getDefaultStyles(e),super.filterAnnotations(t)):t}}class ue extends W{constructor(){super(...arguments),this.stylesToBeFiltered=z.getDefaultStyles("paragraph"),this.type="paragraph",this.elementTagName="p"}filterAnnotations(t){return t}canFilter(t){return G.isTextBlock(t.dtoName)&&t.type===this.type}canRefill(t,e){const n=this.classNameToBeAdded?`.${this.classNameToBeAdded}`:this.elementTagName;return G.isTextBlock(t)&&e.matches(n)}toCssText(){return this.buildCssTextForStyles(this.elementTagName,this.classNameToBeAdded)}}class de extends ue{constructor(t){super(),this.type="heading-1",this.elementTagName="h1",this.type=`heading-${t}`,this.elementTagName=`h${t}`,this.stylesToBeFiltered=z.getDefaultStyles(this.type)}}class we extends ue{constructor(t){super(),this.type="title",this.elementTagName="div",this.classNameToBeAdded="v-rte-title",this.type=t,this.classNameToBeAdded=`v-rte-${t}`,this.stylesToBeFiltered=z.getDefaultStyles(this.type)}}class pe extends W{constructor(){super(...arguments),this.stylesToBeFiltered=pe.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}filterAndDeleteStyles(t,e,n){var s;const r=super.filterAndDeleteStyles(t,e);return this.isExplicitlyNonBold(n)&&void 0===(null===(s=r.styles)||void 0===s?void 0:s.fontWeight)&&(r.styles=Object.assign(Object.assign({},r.styles),{fontWeight:pe.NON_BOLD_FONT_WEIGHT})),r}canFilter(t){return G.isTextNode(t.dtoName)&&this.parentBlockIsHeadingOrTitle(t)}canRefill(t,e){return G.isTextNode(t)&&"SPAN"===e.nodeName&&this.isHeadingOrTitleChild(e)}toCssText(){return`${this.parentElementSelectors.map((t=>`.${pe.RTE_CONTENT_CONTAINER_CLASS_NAME} ${t}`)).join(",")} { ${this.convertStylesMapToCssText()} }`}isExplicitlyNonBold(t){var e;const n=null===(e=t)||void 0===e?void 0:e.getAnnotationByType(a.BOLD);return!1===(null==n?void 0:n.bold)}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(pe.NON_HEADING_TITLE_ELEMENT_TAGS.includes(e.tagName))return!1;e=e.parentElement}return!1}}pe.BOLD_STYLES={fontWeight:"700"},pe.NON_BOLD_FONT_WEIGHT=_,pe.NON_HEADING_TITLE_ELEMENT_TAGS=["TD","TH","TR","TABLE","THEAD","TBODY","DIV","BODY"];class fe extends de{constructor(t){super(t),this.classNameToBeAdded=`v-rte-h${t}`,this.elementTagName="li"}canFilter(t){return G.isListItemBlock(t.dtoName)&&this.isBlockOrNodeStylesMatchFilterStyles(t,["fontSize","lineHeight"])}canRefill(t,e){return G.isListItemBlock(t)&&e.matches(this.elementTagName)&&e.classList.contains(this.classNameToBeAdded)}}class me extends we{constructor(t){super(t),this.classNameToBeAdded=`v-rte-${t}`,this.elementTagName="li"}canFilter(t){return G.isListItemBlock(t.dtoName)&&this.isBlockOrNodeStylesMatchFilterStyles(t,["fontSize","lineHeight"])}canRefill(t,e){return G.isListItemBlock(t)&&e.matches(this.elementTagName)&&e.classList.contains(this.classNameToBeAdded)}}X.registerRTEDTOClass("paragraph",g),X.registerRTEDTOClass("title",g),X.registerRTEDTOClass("subtitle",g),X.registerRTEDTOClass("heading-1",g),X.registerRTEDTOClass("heading-2",g),X.registerRTEDTOClass("heading-3",g),X.registerRTEDTOClass("heading-4",g),X.registerRTEDTOClass("heading-5",g),X.registerRTEDTOClass("heading-6",g),X.registerRTEDTOClass("heading-6",g),X.registerRTEDTOClass("list-item",H),X.registerRTEDTOClass("bullet-list",N),X.registerRTEDTOClass("number-list",N),X.registerRTEDTOClass("image",Et),X.registerRTEDTOClass("code-block",e),X.registerRTEDTOClass("html-block",U),X.registerRTEDTOClass("text",T),X.registerRTEDTOClass("image",Ot),St.registerBlockBasicStrategies(g.name),St.registerBlockBasicStrategies(N.name),St.registerBlockBasicStrategies(H.name),St.registerBlockBasicStrategies(Et.name),St.registerBlockBasicStrategies(U.name),ft.registerElementToBlockStrategy(new class extends ie{canHandle(t,e,n){let s=0;for(let r=e;r<t.length&&this.isInlineCandidate(t[r],n);r++)s++;return s}handle(t,e){const n=t[0].parentElement,s=e&&e.autoMatchFormat,r=this.generateChildNodes(t,s?re.generate(T,n,Object.assign(Object.assign({},e),{skipCustomAnnotations:!0})):{},e),i=s?super.matchTextBlockType(n):this.matchTextBlockTypeByTagName(n),a=!s&&!i;return g.from(Object.assign({id:nt(),type:i||"paragraph",nodes:r},a?{annotations:{internalWrapper:a}}:{annotations:re.generate(g,n,e)}),e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}matchTextBlockTypeByTagName(t){switch(t.nodeName){case"P":return"paragraph";default:return null}}isInlineCandidate(t,e){return t.nodeType===Node.TEXT_NODE||!this.isBlockBoundaryElement(t,e)&&(!!qt.has(t.nodeName)||!this.isDedicatedBlockTag(t.nodeName)&&(!(!1!==e.autoMatchFormat||!ne(t))||this.isInlineLeafOrWrapper(t)))}isBlockBoundaryElement(t,e){var n;return!!t.hasAttribute(V)||!!(null===(n=e.blockBoundaryRegistry)||void 0===n?void 0:n.isBoundary(t))}isDedicatedBlockTag(t){return Zt.has(t)&&!qt.has(t)}isInlineLeafOrWrapper(t){return 0===t.childNodes.length?ee.has(t.nodeName):this.isTextOnlyElement(t)?ee.has(t.nodeName)||qt.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}}),ft.registerElementToBlockStrategy(new class extends le{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}}),ft.registerElementToBlockStrategy(new class extends le{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(st(s))return Et.from({id:nt(),type:"image",nodes:[{id:nt(),type:"image",url:s.src,annotations:re.generate(Ot,n,e)}],annotations:re.generate(Et,n.parentElement,e)},e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),ft.registerElementToBlockStrategy(new class extends le{canHandle(t,e){return"IMG"===t[e].tagName?1:0}handle(t,e){return this.createRTEImageBlock(t[0],e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),ft.registerElementToBlockStrategy(new class extends ie{canHandle(t,e){return["heading-1","heading-2","heading-3","heading-4","heading-5","heading-6","title","subtitle"].includes(super.matchTextBlockType(t[e]))?1:0}handle(t,e){const n=this.generateChildNodes(Array.from(t[0].childNodes),{},e);return 0===n.length?null:g.from({id:nt(),type:super.matchTextBlockType(t[0]),nodes:n,annotations:re.generate(g,t[0],e)},e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),ft.registerElementToBlockStrategy(new class extends ie{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)?H.from(this.generateListItemBlockDTO(n,e),e):this.generateWithListBlock(t,e)}appendChildBlocks(t,e){t.nestList=e.filter((t=>["bullet-list","number-list"].includes(t.type))),t.nestList.forEach((e=>e.parent=t))}shouldProceedToElementChildren(){return!0}generateWithListBlock(t,e){return N.from({id:nt(),type:"bullet-list",blocks:t.map((t=>this.generateListItemBlockDTO(t,e)))},e)}generateListItemBlockDTO(t,e){return{id:nt(),type:"list-item",annotations:re.generate(H,t,e),nodes:this.generateChildNodes(Array.from(t.childNodes.length?t.childNodes:[t]).filter((t=>!["UL","OL"].includes(t.nodeName))),re.generate(T,t,Object.assign(Object.assign({},e),{skipCustomAnnotations:!0})),e)}}}),ft.registerElementToBlockStrategy(new class extends ie{canHandle(t,e){const n=t[e],s=n.parentElement,r="LI"!==n.nodeName,i=n.nodeType===Node.TEXT_NODE&&""===n.textContent.trim(),a=st(s)&&["UL","OL"].includes(s.nodeName);return r&&!i&&a?1:0}handle(t,e){const n=this.generateChildNodes(t,{},e);return H.from({id:nt(),type:"list-item",nodes:n,annotations:{}},e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),ft.registerElementToBlockStrategy(new class extends ie{canHandle(t,e){return"OL"===t[e].tagName?1:0}handle(t,e){return 0===t[0].childNodes.length?null:N.from({id:nt(),type:"number-list",blocks:[],annotations:re.generate(N,t[0],e)},e)}appendChildBlocks(t,e){t.children=e.filter((t=>t instanceof H)),e.forEach((e=>e.parent=t))}shouldProceedToElementChildren(){return!0}}),ft.registerElementToBlockStrategy(new class extends ie{canHandle(t,e){return"UL"===t[e].tagName?1:0}handle(t,e){return 0===t[0].childNodes.length?null:N.from({id:nt(),type:"bullet-list",blocks:[],annotations:re.generate(N,t[0],e)},e)}appendChildBlocks(t,e){t.children=e.filter((t=>t instanceof H)),e.forEach((e=>e.parent=t))}shouldProceedToElementChildren(){return!0}}),ft.registerElementToBlockStrategy(new ae),
|
|
2
2
|
//!important: Code block strategies must be registered after HtmlBlockStrategy because registerElementToBlockStrategy uses unshift, giving later registrations higher priority.
|
|
3
3
|
ft.registerElementToBlockStrategy(new oe),ft.registerElementToBlockStrategy(new class extends oe{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}}),ft.registerElementToNodeStrategy(new class extends ce{canHandle(t,e){const n=t[e];return!ht(n)||"BR"!==n.nodeName&&0!==n.childNodes.length?0:1}handle(t,e,n){const s=!(!e||!1!==e.autoMatchFormat),r=Object.assign({},n),i=t[0],a=re.generate(T,i,Object.assign({parentAnnotations:s?{inlineHtml:r.inlineHtml,link:r.link,code:r.code}:n},e));if("BR"===i.nodeName){const{inlineHtml:t}=a,e=function(t,e){var n={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(n[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(t);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(t,s[r])&&(n[s[r]]=t[s[r]])}return n}(a,["inlineHtml"]);return this.generateTextNode("\n",t&&"br"===t.htmlTag?e:a)}if(0===i.childNodes.length){const t=s?ut(Object.assign(Object.assign({},T.supportsHtmlTag(i.nodeName.toLowerCase())?a:{}),{inlineHtml:a.inlineHtml})):a;return Object.assign({},this.generateTextNode("",t))}}}),ft.registerElementToNodeStrategy(new class extends ce{canHandle(t,e){return t[e].nodeType===Node.TEXT_NODE?1:0}handle(t,e,n){const s=Object.assign({},n),r=!(!e||!1!==e.autoMatchFormat),i=t[0],a=i.parentNode.nodeName.toLowerCase(),o=r&&!T.supportsHtmlTag(a),l=this.generateTextNode(String(i.textContent),r?ut(Object.assign(Object.assign({},"span"===a?s:{link:s.link,code:"code"===a?s.code:void 0}),{inlineHtml:s.inlineHtml,plainText:o||void 0})):s);return Object.assign({},l)}}),F.register(g.dtoName,new he),F.register(N.dtoName,new he),F.register(H.dtoName,new he),F.register(T.dtoName,new class extends W{constructor(){super(...arguments),this.stylesToBeFiltered={}}get alwaysFilter(){return!0}filterAnnotations(t){const e=t,n=e.customStyle;if(!n)return t;e.bold&&n.fontWeight===S&&delete n.fontWeight,e.italic&&n.fontStyle===$&&delete n.fontStyle;const s=this.normalizeTextDecoration(n.textDecoration);return s&&this.shouldRemoveTextDecoration(s,e)&&delete n.textDecoration,0===Object.keys(n).length&&delete e.customStyle,t}normalizeTextDecoration(t){if(!t)return;const e=t.trim().toLowerCase().split(/\s+/);return e.some((t=>t!==P&&t!==M))?void 0:Array.from(new Set(e)).sort().join(" ")}shouldRemoveTextDecoration(t,e){const n=[];return e.underline&&n.push(P),e.strikethrough&&n.push(M),0!==n.length&&t===n.sort().join(" ")}}),F.register(g.dtoName,new ue),F.register(g.dtoName,new de(1)),F.register(g.dtoName,new de(2)),F.register(g.dtoName,new de(3)),F.register(g.dtoName,new de(4)),F.register(g.dtoName,new de(5)),F.register(g.dtoName,new de(6)),F.register(g.dtoName,new we("title")),F.register(g.dtoName,new we("subtitle")),F.register(T.dtoName,new pe),F.register(T.dtoName,new class extends W{constructor(){super(...arguments),this.stylesToBeFiltered=Y.getDefaultStyles(),this.elementTagName="code"}filterAnnotations(t){const{code:e,customStyle:n}=t;return e&&n?super.filterAnnotations(t):t}canFilter(t){return G.isCodeNode(t)}canRefill(t,e){return G.isTextNode(t)&&e.matches(this.elementTagName)}toCssText(){return`.${W.RTE_CONTENT_CONTAINER_CLASS_NAME} ${this.elementTagName} { ${this.convertStylesMapToCssText(Object.assign(Object.assign({},this.stylesToBeFiltered),{fontWeight:"500"}))} }`}}),F.register(T.dtoName,new Q),F.register(Ot.dtoName,new class extends W{constructor(){super(...arguments),this.stylesToBeFiltered=bt.getDefaultStyles(),this.elementTagName="img"}get alwaysFilter(){return!0}canFilter(t){return G.isImageNode(t)}canRefill(t,e){return e.tagName.toLowerCase()===this.elementTagName}toCssText(){return this.buildCssTextForStyles(this.elementTagName,this.classNameToBeAdded)}}),F.register(e.dtoName,new Z),F.register(q.dtoName,new tt),F.register(N.dtoName,new class extends W{constructor(){super(...arguments),this.stylesToBeFiltered=J.getDefaultStyles(),this.elementTagName="ol,ul"}canFilter(t){return G.isListBlock(t.dtoName)}canRefill(t,e){return G.isListBlock(t)&&e.matches(this.elementTagName)}toCssText(){const t=W.RTE_CONTENT_CONTAINER_CLASS_NAME,e=this.elementTagName.split(",").map((t=>t.trim())),n=e.map((e=>`.${t} ${e}`)).join(", "),s=e.map((e=>`.${t} ${e} > li::marker`)).join(", "),r=this.convertStylesMapToCssText(J.getDefaultMarkerStyles());return`${n} { ${this.convertStylesMapToCssText(this.stylesToBeFiltered)} } ${s} { ${r} }`}}),F.register(H.dtoName,new class extends W{constructor(){super(...arguments),this.stylesToBeFiltered=z.getDefaultStyles("paragraph"),this.elementTagName="li",this.headingOrTitleClassNamePattern=/^v-rte-(h[1-6]|title|subtitle)$/}canFilter(t){const e=!t.getStyles().fontSize||this.isBlockOrNodeStylesMatchFilterStyles(t,["fontSize","lineHeight"]);return G.isListItemBlock(t.dtoName)&&e}canRefill(t,e){return G.isListItemBlock(t)&&e.matches(this.elementTagName)&&this.isElementNotHeadingOrTitle(e)}toCssText(){return this.buildCssTextForStyles(this.elementTagName)}isElementNotHeadingOrTitle(t){return!t.className.split(" ").some((t=>this.headingOrTitleClassNamePattern.test(t.trim())))}}),F.register(H.dtoName,new fe(1)),F.register(H.dtoName,new fe(2)),F.register(H.dtoName,new fe(3)),F.register(H.dtoName,new fe(4)),F.register(H.dtoName,new fe(5)),F.register(H.dtoName,new fe(6)),F.register(H.dtoName,new me("title")),F.register(H.dtoName,new me("subtitle"));class ge{static preserve(t){const e=t.replace(/\s+style=/g," data-style=");return new Te(e)}}class Te{constructor(t){this.processedHtml=t}getProcessedHtml(){return this.processedHtml}restore(t){this.walkNodes(t)}walkNodes(t){t.forEach((t=>{if(ht(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 xe{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 be{process(t){return t.replace(/(>)[\n\t]+(?=.)/g,"$1")}}class Oe{process(t){return t.replace(/(.?)[\n\t]+(?=<)/g,"$1")}}class ye{constructor(){this.processors=[new xe,new be,new Oe]}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}}const Ee="COMMIT_VALUE";class ke extends m{constructor(t,e,n){super(),this.candidate=t,this.previous=e,this.host=n,this.isFlushable=!1,this.type="COMMIT_VALUE"}}class Ae{constructor(t){this.dtoName=Ae.dtoName,t.forEach((t=>{t.parent=this})),this.children=t}static fromJSON(t,e={autoMatchFormat:!0}){const n=t.map((t=>{const n=X.getRTEBlockClass(t.type);if(n)return n.from(t,e);throw new Error(`[Vega] Unknown block type: ${t.type}`)}));return new Ae(n)}static createEmptyContent(t={autoMatchFormat:!0}){return Ae.fromJSON([{id:nt(),type:"paragraph",annotations:{internalWrapper:!t.autoMatchFormat},nodes:[{id:nt(),annotations:{plainText:!t.autoMatchFormat},type:"text",text:""}]}],t)}static fromHtml(t,e={autoMatchFormat:!0,skipCustomAnnotations:!1}){const n=(new ye).clean(t),s=ge.preserve(n),r=s.getProcessedHtml(),i=(new DOMParser).parseFromString(r,"text/html").body,a=Array.from(i.childNodes);s.restore(a);const o=mt.process(a,e).filter(st).map((t=>t.toDto(e))).filter(st);return new Ae(o)}static generateContentStyles(t){return F.generateAllStylesContent(null==t?void 0:t.enableFontImports)}clone(t=!1){return new Ae(t?this.children.map((t=>t.clone(this))):[...this.children])}toJSON(){return this.children.map((t=>t.toJSON()))}toHtml(t){return t&&(st(t.autoMatchFormat)||st(t.skipCustomAnnotations))&&dt.warn("The 'options' parameter's properties 'autoMatchFormat' and 'skipCustomAnnotations' in toHtml method are deprecated and will be removed in the future."),this.isEmpty()?"":this.children.map((e=>e.toHtml({filterInlineStyles:null==t?void 0:t.filterInlineStyles}))).join("")}isEmpty(){return 0===this.children.length||1===this.children.length&&!this.children[0].isNotEmpty()}apply(t){if(h.executeTheStrategy(t,this),t.executedFlag&&t.isFlushable){const t=r.getDOMByEntity(this);t&&rt.notify(it.getSubject(t,lt),{})}}getLastNode(){return 0===this.children.length?null:this.children[this.children.length-1].getLastNode()}getPlainText(){return this.children.map((t=>t.getPlainText())).join("")}toListItem(t){var e;t.children.map((t=>t.apply(new et)));const n=new H(nt());return n.apply(new f(t.children)),n.annotationMap=t.annotationMap,t instanceof H&&(null===(e=t.nestList)||void 0===e?void 0:e.length)&&(n.apply(new j([...t.nestList])),t.apply(new j([]))),n}createList(t){return new N(nt(),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 H&&n.nestList)for(const e of n.nestList){const n=this.findNodeInBlocksById(t,e.children);if(n)return n}if(n instanceof N&&n.children){const e=this.findNodeInBlocksById(t,n.children);if(e)return e}}return null}}h.register(d.DELETE_CHILDREN,Ae.name,new C),h.register(d.APPEND_CHILDREN,Ae.name,new gt),h.register(d.INSERT_CHILDREN_BEFORE,Ae.name,new Tt),h.register(d.INSERT_CHILDREN_AFTER,Ae.name,new xt),h.register(d.TRANSFORM_TO_CODE_BLOCK,Ae.name,new class extends t{handleAction(t,s){const r=t.selectedBlocks,i=new e(nt(),this.getCodeContent(r),"plainText");s.apply(new n(r[0],i)),t.newCodeBlock=i,this.removeSelectBlocks(r,s)}getCodeContent(t){return t.filter((t=>"image"!==t.type&&"list-item"!==t.type)).map((t=>t.children.map((t=>t.text)).join(""))).join("\n")}removeSelectBlocks(t,e){for(let n=0;n<t.length;n++)e.apply(new s(t[n]))}}),h.register(d.UPDATE_CURSOR_POSITION,Ae.name,new class extends t{handleAction(t,e){const{offset:n,nextFocusNode:s,immediatelyRun:i}=t,a=r.getDOMByEntity(e);a&&rt.notify(it.getSubject(a,at),{node:s,offset:n,updateDirectly:i})}}),h.register(d.DELETE_SELECTED_CONTENT,Ae.name,new class extends t{handleAction(t){const{host:e,mergeFlag:n}=t;rt.notify(it.getSubject(e,ot),{host:e,detail:n})}}),h.register("COMMIT_VALUE",Ae.name,new class extends t{handleAction(t){return t.candidate}}),Ae.dtoName="VegaRTEContent";export{Rt as A,ie as B,Ee as C,wt as E,ae as H,yt as I,kt as M,It as P,Et as R,ge as S,Ct as U,Ae as V,Tt as a,Ot as b,St as c,ft as d,bt as e,ke as f,mt as g,re as h}
|