@globalpayments/vega 2.87.0 → 2.88.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-15fa91e4.js +1817 -0
- package/dist/cjs/{app-globals-885090b1.js → app-globals-6fbbcb2f.js} +16 -7
- package/dist/cjs/{child-nodes-event-prevent-slimmer-b7498e5a.js → child-nodes-event-prevent-slimmer-01930b4e.js} +1 -1
- package/dist/cjs/{code-block-15411c14.js → code-block-00fee034.js} +31 -13
- package/dist/cjs/{component-value-history-controller-slimmer.abstract-5218e4b3.js → component-value-history-controller-slimmer.abstract-066645b3.js} +25 -5
- package/dist/cjs/{content-state-a69d99b4.js → content-state-d4f54659.js} +66 -54
- package/dist/cjs/{dark-mode-style-controller-bd765afb.js → dark-mode-style-controller-ed481250.js} +41 -2
- package/dist/cjs/{date-required-rule-d65727c5.js → date-required-rule-4cea8fc8.js} +1 -1
- package/dist/cjs/{design-token-3bc36220.js → design-token-ad9f413c.js} +3 -3
- package/dist/cjs/{element-appender-slimmer-f86e6811.js → element-appender-slimmer-d04aa177.js} +2 -2
- package/dist/cjs/{event-emit-slimmer-73c42d7e.js → event-emit-slimmer-5fd6e54a.js} +1 -1
- package/dist/cjs/{form-field-controller-slimmer-44091874.js → form-field-controller-slimmer-23d112bd.js} +1 -1
- package/dist/cjs/{image-annotation-action-aad07357.js → image-annotation-action-bcf2a1b4.js} +4 -4
- package/dist/cjs/index-58ea899e.js +4 -0
- package/dist/cjs/index.cjs.js +27 -17
- package/dist/cjs/{inject-keyboard-manager-d06b337e.js → inject-keyboard-manager-acaf1530.js} +1 -1
- package/dist/cjs/{internal-translation-controller-f0da24b2.js → internal-translation-controller-a1250419.js} +8 -0
- package/dist/cjs/{internal-vega-event-manager-063c17cb.js → internal-vega-event-manager-c515cf5e.js} +2 -2
- package/dist/cjs/{keyboard-manager-1e045791.js → keyboard-manager-6821709a.js} +1 -1
- package/dist/cjs/{keyboard-manager-slimmer-861d991f.js → keyboard-manager-slimmer-74528545.js} +1 -1
- package/dist/cjs/loader.cjs.js +13 -12
- package/dist/cjs/{month-view-generator-8ed9818e.js → month-view-generator-61578283.js} +1 -1
- package/dist/cjs/{public-rules-c7726702.js → public-rules-d2fbbbf5.js} +8 -8
- package/dist/cjs/{range-d6fb50a4.js → range-e797475c.js} +1 -1
- package/dist/cjs/replace-selected-text-action-a098523f.js +20 -0
- package/dist/cjs/{responsive-format-facade-9647775d.js → responsive-format-facade-bf330592.js} +1 -1
- package/dist/cjs/{rich-text-editor-required-rule-a1a070ce.js → rich-text-editor-required-rule-ba9d42fa.js} +1 -1
- package/dist/cjs/{split-cell-operation-39b19943.js → split-cell-operation-91ee6894.js} +79 -16
- package/dist/cjs/{state-border-formatter-1a483a9b.js → state-border-formatter-fd194e53.js} +1 -1
- package/dist/cjs/{string-format-strategy.abstract-2aec209d.js → string-format-strategy.abstract-af9fc35e.js} +1 -1
- package/dist/cjs/{string-input-formatter-slimmer-e061bd10.js → string-input-formatter-slimmer-a3fb1292.js} +1 -1
- package/dist/cjs/{string-mask-strategy-4bc07c00.js → string-mask-strategy-2054f3fb.js} +2 -2
- package/dist/cjs/{style-formatter-263d5eb6.js → style-formatter-7d60fb70.js} +2 -2
- package/dist/cjs/{time-required-rule-f9a7e897.js → time-required-rule-ba450bbd.js} +1 -1
- package/dist/cjs/{token-extension-927062b9.js → token-extension-8b69f7e1.js} +1136 -26
- package/dist/cjs/{translation-slimmer-a4a7f0eb.js → translation-slimmer-aee3fb1c.js} +1 -1
- package/dist/cjs/{type-guard-c1195e50.js → type-guard-424efe26.js} +1 -1
- package/dist/cjs/{valid-credit-card-number-rule-22f3e6cf.js → valid-credit-card-number-rule-6bd5834c.js} +1 -1
- package/dist/cjs/vega-accordion.cjs.entry.js +22 -15
- package/dist/cjs/vega-app-footer.cjs.entry.js +1 -1
- package/dist/cjs/vega-app-header-button.cjs.entry.js +9 -9
- package/dist/cjs/vega-banner.cjs.entry.js +3 -3
- package/dist/cjs/vega-box.cjs.entry.js +6 -6
- 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 +9 -9
- package/dist/cjs/vega-button-group_2.cjs.entry.js +4 -4
- package/dist/cjs/vega-button-link.cjs.entry.js +4 -4
- package/dist/cjs/vega-button.cjs.entry.js +7 -7
- package/dist/cjs/vega-calendar_4.cjs.entry.js +10 -10
- package/dist/cjs/vega-card.cjs.entry.js +5 -5
- package/dist/cjs/vega-carousel.cjs.entry.js +6 -6
- package/dist/cjs/vega-checkbox_2.cjs.entry.js +6 -6
- package/dist/cjs/vega-chip.cjs.entry.js +9 -9
- package/dist/cjs/vega-code-block.cjs.entry.js +16 -15
- package/dist/cjs/vega-color-picker.cjs.entry.js +5 -5
- package/dist/cjs/vega-color-swatch-picker.cjs.entry.js +7 -7
- package/dist/cjs/vega-color-swatch.cjs.entry.js +5 -5
- package/dist/cjs/vega-combo-box.cjs.entry.js +23 -10
- package/dist/cjs/vega-date-picker_2.cjs.entry.js +327 -267
- package/dist/cjs/vega-dialog_2.cjs.entry.js +7 -7
- package/dist/cjs/vega-divider.cjs.entry.js +5 -5
- package/dist/cjs/vega-dropdown_5.cjs.entry.js +11 -11
- package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
- package/dist/cjs/{vega-event-id-f95480b7.js → vega-event-id-39dedd17.js} +2 -0
- package/dist/cjs/vega-field-label.cjs.entry.js +22 -5
- package/dist/cjs/vega-file-uploader.cjs.entry.js +20 -7
- package/dist/cjs/vega-flag-icon.cjs.entry.js +5 -5
- package/dist/cjs/vega-flex.cjs.entry.js +6 -6
- package/dist/cjs/vega-font.cjs.entry.js +5 -5
- package/dist/cjs/vega-form.cjs.entry.js +7 -7
- package/dist/cjs/vega-grid.cjs.entry.js +5 -5
- package/dist/cjs/vega-icon.cjs.entry.js +5 -5
- package/dist/cjs/vega-image-uploader.cjs.entry.js +10 -10
- package/dist/cjs/vega-input-credit-card.cjs.entry.js +10 -10
- package/dist/cjs/vega-input-numeric.cjs.entry.js +9 -9
- package/dist/cjs/vega-input-passcode.cjs.entry.js +23 -10
- package/dist/cjs/vega-input-phone-number.cjs.entry.js +22 -9
- package/dist/cjs/vega-input-range.cjs.entry.js +7 -7
- package/dist/cjs/vega-input-select.cjs.entry.js +9 -9
- package/dist/cjs/vega-input.cjs.entry.js +23 -10
- package/dist/cjs/vega-item-toggle.cjs.entry.js +3 -3
- package/dist/cjs/vega-left-nav_5.cjs.entry.js +11 -11
- package/dist/cjs/vega-loader-wrapper_2.cjs.entry.js +3 -3
- package/dist/cjs/vega-page-notification_2.cjs.entry.js +1 -1
- package/dist/cjs/vega-pagination-page-selector-mobile.cjs.entry.js +3 -3
- package/dist/cjs/vega-pagination-page-size-selector-mobile.cjs.entry.js +3 -3
- package/dist/cjs/vega-pagination.cjs.entry.js +8 -8
- package/dist/cjs/vega-popover_2.cjs.entry.js +11 -11
- package/dist/cjs/vega-progress-tracker_2.cjs.entry.js +6 -6
- package/dist/cjs/vega-radio_2.cjs.entry.js +9 -9
- package/dist/cjs/vega-rich-text-content.cjs.entry.js +7 -7
- package/dist/cjs/vega-rich-text-editor_4.cjs.entry.js +289 -193
- package/dist/cjs/vega-rich-text-special-characters-panel.cjs.entry.js +400 -0
- package/dist/cjs/vega-rich-text-table-properties_3.cjs.entry.js +12 -12
- package/dist/cjs/vega-section-title.cjs.entry.js +3 -2
- package/dist/cjs/vega-segment-control.cjs.entry.js +3 -3
- package/dist/cjs/vega-selection-chip_2.cjs.entry.js +8 -8
- package/dist/cjs/vega-selection-tile_2.cjs.entry.js +6 -6
- package/dist/cjs/vega-sidenav_3.cjs.entry.js +6 -6
- package/dist/cjs/vega-signature-capture.cjs.entry.js +10 -10
- package/dist/cjs/vega-stepper.cjs.entry.js +6 -6
- package/dist/cjs/vega-tab-group_2.cjs.entry.js +4 -4
- package/dist/cjs/vega-table_11.cjs.entry.js +8 -8
- package/dist/cjs/vega-textarea.cjs.entry.js +17 -7
- package/dist/cjs/vega-time-picker_2.cjs.entry.js +13 -13
- package/dist/cjs/vega-toggle-switch.cjs.entry.js +5 -5
- package/dist/cjs/vega-tooltip_2.cjs.entry.js +6 -6
- package/dist/cjs/vega.cjs.js +13 -12
- package/dist/collection/collection-manifest.json +6 -0
- package/dist/collection/components/vega-accordion/slimmers/vega-accordion-renderer.js +12 -5
- package/dist/collection/components/vega-accordion/vega-accordion.css +23 -0
- package/dist/collection/components/vega-accordion/vega-accordion.js +28 -0
- package/dist/collection/components/vega-box/vega-box.js +3 -3
- package/dist/collection/components/vega-code-block/slimmers/renderers/vega-code-block-copy-button-renderer.js +2 -2
- package/dist/collection/components/vega-code-block/vega-code-block.js +4 -0
- package/dist/collection/components/vega-combo-box/slimmers/renderers/vega-combo-box-renderer.js +4 -1
- package/dist/collection/components/vega-combo-box/vega-combo-box.js +34 -0
- package/dist/collection/components/vega-date-picker/vega-date-picker-calendar/slimmers/controllers/vega-date-picker-calendar-size-controller.js +46 -0
- package/dist/collection/components/vega-date-picker/vega-date-picker-calendar/slimmers/renderers/vega-date-picker-calendar-header-render.js +8 -4
- package/dist/collection/components/vega-date-picker/vega-date-picker-calendar/slimmers/renderers/vega-date-picker-calendar-year-month-switcher-renderer.js +3 -3
- package/dist/collection/components/vega-date-picker/vega-date-picker-calendar/slimmers/renderers/vega-date-picker-month-item-renderer.js +0 -3
- package/dist/collection/components/vega-date-picker/vega-date-picker-calendar/vega-date-picker-calendar.js +67 -6
- package/dist/collection/components/vega-field-label/vega-field-label.css +37 -0
- package/dist/collection/components/vega-field-label/vega-field-label.js +40 -0
- package/dist/collection/components/vega-file-uploader/slimmers/renderers/vega-file-uploader-renderer.js +4 -1
- package/dist/collection/components/vega-file-uploader/vega-file-uploader.js +34 -0
- package/dist/collection/components/vega-input/slimmers/renderers/vega-input-renderer.js +4 -1
- package/dist/collection/components/vega-input/vega-input.js +34 -0
- package/dist/collection/components/vega-input-passcode/slimmers/renderers/vega-input-passcode-renderer.js +4 -1
- package/dist/collection/components/vega-input-passcode/vega-input-passcode.js +34 -0
- package/dist/collection/components/vega-input-phone-number/slimmers/renderers/vega-input-phone-number-renderer.js +4 -1
- package/dist/collection/components/vega-input-phone-number/vega-input-phone-number.js +34 -0
- package/dist/collection/components/vega-rich-text-editor/assets/redo.js +3 -0
- package/dist/collection/components/vega-rich-text-editor/assets/undo.js +3 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/action-handle-strategy.abstract.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-delete-node-content-strategy.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/annotation-style.js +2 -2
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/block.abstract.js +5 -0
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/code-block.js +2 -0
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/html-block.js +2 -0
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/image-block.js +2 -0
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/list-block.js +2 -0
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/list-item-block.js +2 -0
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/text-block.js +2 -0
- package/dist/collection/components/vega-rich-text-editor/dto/content-state.js +3 -0
- package/dist/collection/components/vega-rich-text-editor/dto/filter-styles-strategies/code-block/code-block-filter-styles-strategy.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/dto/filter-styles-strategies/filter-styles-strategy-registry.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/dto/filter-styles-strategies/list-block/list-block-filter-styles-strategy.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/dto/filter-styles-strategies/list-block/list-heading-item-block-filter-styles-strategy.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/dto/filter-styles-strategies/list-block/list-item-block-filter-styles-strategy.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/dto/filter-styles-strategies/list-block/list-title-item-block-filter-styles-strategy.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/dto/filter-styles-strategies/predicate.js +4 -4
- package/dist/collection/components/vega-rich-text-editor/dto/filter-styles-strategies/text-block/paragraph-filter-styles-strategy.js +1 -2
- package/dist/collection/components/vega-rich-text-editor/dto/filter-styles-strategies/text-node/title-heading-node-filter-styles-strategy.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/dto/nodes/code-block-node.js +2 -0
- package/dist/collection/components/vega-rich-text-editor/dto/nodes/image-node.js +2 -0
- package/dist/collection/components/vega-rich-text-editor/dto/nodes/node.abstract.js +5 -0
- package/dist/collection/components/vega-rich-text-editor/dto/nodes/text-node.js +2 -0
- package/dist/collection/components/vega-rich-text-editor/dto/setup.js +29 -29
- package/dist/collection/components/vega-rich-text-editor/extensions/base-toolbar-button-renderer.js +105 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/extension.abstract.js +50 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/functions/dto/function-block.js +2 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/functions/dto/logic-control-block.js +2 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/functions/dto/logic-control-node.js +2 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/functions/function-extension.js +4 -2
- package/dist/collection/components/vega-rich-text-editor/extensions/line-height/action-handler-strategies/block-update-line-height-strategy.js +18 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/line-height/actions/line-height-annotation-action.js +20 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/line-height/annotations/line-height-annotation.js +61 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/line-height/assets/line-height.js +3 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/line-height/constants.js +11 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/line-height/element-to-dto-strategies/line-height-annotation-handler.js +41 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/line-height/element-to-dto-strategies/line-height-filter-styles-strategy.js +41 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/line-height/element-to-dto-strategies/line-height-from-json-handler.js +65 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/line-height/line-height-extension.js +44 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/line-height/line-height-toolbar-button-renderer.js +131 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/special-characters/constants/arrow-characters.js +24 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/special-characters/constants/currency-characters.js +38 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/special-characters/constants/default-categories.js +37 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/special-characters/constants/latin-characters.js +130 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/special-characters/constants/mathematical-characters.js +46 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/special-characters/constants/text-characters.js +29 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/special-characters/special-characters-extension.js +34 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/special-characters/special-characters-icon.js +3 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/special-characters/special-characters-toolbar-button-renderer.js +184 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/special-characters/types.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/special-characters/vega-rich-text-special-characters-panel/constants.js +11 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/special-characters/vega-rich-text-special-characters-panel/slimmers/controllers/special-characters-panel-keyboard-controller.js +85 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/special-characters/vega-rich-text-special-characters-panel/slimmers/renderers/special-characters-panel-renderer.js +210 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/special-characters/vega-rich-text-special-characters-panel/vega-rich-text-special-characters-panel.css +66 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/special-characters/vega-rich-text-special-characters-panel/vega-rich-text-special-characters-panel.js +174 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/annotation-handler/table-annotation-handler.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/table/annotation-handler/table-cell-annotation-handler.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/table/annotation-handler/table-head-cell-annotation-handler.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/table/dto/table-block.js +2 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/dto/table-body-block.js +2 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/dto/table-caption-block.js +2 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/dto/table-cell-block.js +2 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/dto/table-head-block.js +2 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/dto/table-head-cell-block.js +2 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/dto/table-row-block.js +2 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/filter-styles-strategies/table-block/table-block-filter-styles-strategy.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/table/filter-styles-strategies/table-caption/table-caption-filter-styles-strategy.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/table/filter-styles-strategies/table-cell/table-cell-filter-styles-strategy.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/table/table-extension.js +4 -4
- package/dist/collection/components/vega-rich-text-editor/extensions/tokens/token-extension.js +5 -2
- package/dist/collection/components/vega-rich-text-editor/extensions/tokens/token-node.js +2 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/type.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/helpers/extension-context-manager.js +8 -2
- package/dist/collection/components/vega-rich-text-editor/public-api.js +4 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/bold-annotaion-handler.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/code-annotation-handler.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/color-annotation-handler.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/html-element-to-annotation-generator.js +3 -3
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/image-alt-annotation-handler.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/image-size-annotation-handler.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/indent-annotation-handler.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/inline-html-annotation-handler.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/italic-annotation-handler.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/link-annotation-handler.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/strike-through-annotation-handler.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/text-align-annotation-handler.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/text-style-annotation-handler.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/underline-annotation-handler.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/history-controller.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/state-entity-rendering-registry.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/toolbar-renderer.js +14 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/redo-toolbar-button-slimmer.js +36 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/undo-toolbar-button-slimmer.js +36 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/vega-rich-text-editor-renderer.js +4 -1
- package/dist/collection/components/vega-rich-text-editor/vega-rich-text-editor.js +44 -0
- package/dist/collection/components/vega-section-title/slimmers/renderers/vega-section-title-renderer.js +1 -1
- package/dist/collection/components/vega-section-title/vega-section-title.js +2 -1
- package/dist/collection/components/vega-textarea/vega-textarea.js +35 -1
- package/dist/collection/constants/runtime-metrics-payload-definition/public-api/ThemeManager/runtime-metrics-payload-definition.js +30 -10
- package/dist/collection/constants/ui.js +1 -0
- package/dist/collection/global/scripts/before-vega-load.js +13 -0
- package/dist/collection/helpers/event-manager/event-id/component-event-id-map.js +2 -2
- package/dist/collection/helpers/event-manager/event-id/vega-event-id.js +1 -0
- package/dist/collection/helpers/slimmers/component-value-history-controller-slimmer.abstract.js +22 -2
- package/dist/collection/helpers/theme/controllers/action-color-accessibility-validator.js +34 -0
- package/dist/collection/helpers/theme/internal-theme-manager.js +39 -2
- package/dist/collection/helpers/theme/theme-manager.js +33 -2
- package/dist/collection/helpers/translation/locales/en.js +8 -0
- package/dist/esm/action-color-accessibility-validator-3d8efb64.js +1815 -0
- package/dist/esm/{app-globals-be458779.js → app-globals-98c3d676.js} +16 -7
- package/dist/esm/{child-nodes-event-prevent-slimmer-0a406a71.js → child-nodes-event-prevent-slimmer-2f823df2.js} +1 -1
- package/dist/esm/{code-block-ff52d912.js → code-block-6261a99d.js} +32 -14
- package/dist/esm/{component-value-history-controller-slimmer.abstract-ad5f29cd.js → component-value-history-controller-slimmer.abstract-07488472.js} +25 -5
- package/dist/esm/{content-state-6fccd284.js → content-state-9bf85e00.js} +66 -54
- package/dist/esm/{dark-mode-style-controller-e9a6b097.js → dark-mode-style-controller-fcda24ec.js} +40 -3
- package/dist/esm/{date-required-rule-70324452.js → date-required-rule-281aab50.js} +1 -1
- package/dist/esm/{design-token-0e6fb2c4.js → design-token-b7ce7ed4.js} +3 -3
- package/dist/esm/{element-appender-slimmer-afe5a638.js → element-appender-slimmer-3926470f.js} +2 -2
- package/dist/esm/{event-emit-slimmer-697ad0b7.js → event-emit-slimmer-0990037c.js} +1 -1
- package/dist/esm/{form-field-controller-slimmer-9e70a18d.js → form-field-controller-slimmer-24aca6c4.js} +1 -1
- package/dist/esm/{image-annotation-action-245eaa54.js → image-annotation-action-dadda36f.js} +4 -4
- package/dist/esm/index-090d31ca.js +4 -0
- package/dist/esm/index.js +18 -17
- package/dist/esm/{inject-keyboard-manager-05d5db90.js → inject-keyboard-manager-6317d1b3.js} +1 -1
- package/dist/esm/{internal-translation-controller-d8217d93.js → internal-translation-controller-0b9589d0.js} +8 -0
- package/dist/esm/{internal-vega-event-manager-1ac5ee9a.js → internal-vega-event-manager-dc4c3a37.js} +2 -2
- package/dist/esm/{keyboard-manager-26e2fc32.js → keyboard-manager-69761aa6.js} +1 -1
- package/dist/esm/{keyboard-manager-slimmer-012a9a9b.js → keyboard-manager-slimmer-c2d038f0.js} +1 -1
- package/dist/esm/loader.js +13 -12
- package/dist/esm/{month-view-generator-918f1f88.js → month-view-generator-4c1ee949.js} +1 -1
- package/dist/esm/{public-rules-22320bdf.js → public-rules-da28b413.js} +8 -8
- package/dist/esm/{range-76f8e7dd.js → range-342cbce9.js} +1 -1
- package/dist/esm/replace-selected-text-action-a45bee4b.js +18 -0
- package/dist/esm/{responsive-format-facade-2a1d6398.js → responsive-format-facade-3ca1422d.js} +1 -1
- package/dist/esm/{rich-text-editor-required-rule-6eb90840.js → rich-text-editor-required-rule-46d0bc5b.js} +1 -1
- package/dist/esm/{split-cell-operation-7652e813.js → split-cell-operation-1d114aa3.js} +79 -16
- package/dist/esm/{state-border-formatter-a243f3fc.js → state-border-formatter-3ebc76a4.js} +1 -1
- package/dist/esm/{string-format-strategy.abstract-f6625ed7.js → string-format-strategy.abstract-95d691e1.js} +1 -1
- package/dist/esm/{string-input-formatter-slimmer-e801bd7e.js → string-input-formatter-slimmer-e18d202c.js} +1 -1
- package/dist/esm/{string-mask-strategy-53cb9b33.js → string-mask-strategy-43d846ac.js} +2 -2
- package/dist/esm/{style-formatter-a622a045.js → style-formatter-197e2fd3.js} +2 -2
- package/dist/esm/{time-required-rule-2fd8df50.js → time-required-rule-78d8ecf1.js} +1 -1
- package/dist/esm/{token-extension-5838c71b.js → token-extension-30011dc4.js} +1128 -27
- package/dist/esm/{translation-slimmer-32353a1c.js → translation-slimmer-49903fc8.js} +1 -1
- package/dist/esm/{type-guard-ed1004cc.js → type-guard-b18807dc.js} +1 -1
- package/dist/esm/{valid-credit-card-number-rule-7c9d6808.js → valid-credit-card-number-rule-fe1c8a9c.js} +1 -1
- package/dist/esm/vega-accordion.entry.js +22 -15
- package/dist/esm/vega-app-footer.entry.js +1 -1
- package/dist/esm/vega-app-header-button.entry.js +9 -9
- package/dist/esm/vega-banner.entry.js +3 -3
- package/dist/esm/vega-box.entry.js +6 -6
- 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 +9 -9
- package/dist/esm/vega-button-group_2.entry.js +4 -4
- package/dist/esm/vega-button-link.entry.js +4 -4
- package/dist/esm/vega-button.entry.js +7 -7
- package/dist/esm/vega-calendar_4.entry.js +10 -10
- package/dist/esm/vega-card.entry.js +5 -5
- package/dist/esm/vega-carousel.entry.js +6 -6
- package/dist/esm/vega-checkbox_2.entry.js +6 -6
- package/dist/esm/vega-chip.entry.js +9 -9
- package/dist/esm/vega-code-block.entry.js +16 -15
- package/dist/esm/vega-color-picker.entry.js +5 -5
- package/dist/esm/vega-color-swatch-picker.entry.js +7 -7
- package/dist/esm/vega-color-swatch.entry.js +5 -5
- package/dist/esm/vega-combo-box.entry.js +23 -10
- package/dist/esm/vega-date-picker_2.entry.js +327 -267
- package/dist/esm/vega-dialog_2.entry.js +7 -7
- package/dist/esm/vega-divider.entry.js +5 -5
- package/dist/esm/vega-dropdown_5.entry.js +11 -11
- package/dist/esm/vega-env-manager-8f8dc473.js +2 -2
- package/dist/esm/{vega-event-id-578c6c6d.js → vega-event-id-20494454.js} +2 -1
- package/dist/esm/vega-field-label.entry.js +22 -5
- package/dist/esm/vega-file-uploader.entry.js +20 -7
- package/dist/esm/vega-flag-icon.entry.js +5 -5
- package/dist/esm/vega-flex.entry.js +6 -6
- package/dist/esm/vega-font.entry.js +5 -5
- package/dist/esm/vega-form.entry.js +7 -7
- package/dist/esm/vega-grid.entry.js +5 -5
- package/dist/esm/vega-icon.entry.js +5 -5
- package/dist/esm/vega-image-uploader.entry.js +10 -10
- package/dist/esm/vega-input-credit-card.entry.js +10 -10
- package/dist/esm/vega-input-numeric.entry.js +9 -9
- package/dist/esm/vega-input-passcode.entry.js +23 -10
- package/dist/esm/vega-input-phone-number.entry.js +22 -9
- package/dist/esm/vega-input-range.entry.js +7 -7
- package/dist/esm/vega-input-select.entry.js +9 -9
- package/dist/esm/vega-input.entry.js +23 -10
- package/dist/esm/vega-item-toggle.entry.js +3 -3
- package/dist/esm/vega-left-nav_5.entry.js +11 -11
- package/dist/esm/vega-loader-wrapper_2.entry.js +3 -3
- package/dist/esm/vega-page-notification_2.entry.js +1 -1
- package/dist/esm/vega-pagination-page-selector-mobile.entry.js +3 -3
- package/dist/esm/vega-pagination-page-size-selector-mobile.entry.js +3 -3
- package/dist/esm/vega-pagination.entry.js +8 -8
- package/dist/esm/vega-popover_2.entry.js +11 -11
- package/dist/esm/vega-progress-tracker_2.entry.js +6 -6
- package/dist/esm/vega-radio_2.entry.js +9 -9
- package/dist/esm/vega-rich-text-content.entry.js +7 -7
- package/dist/esm/vega-rich-text-editor_4.entry.js +285 -189
- package/dist/esm/vega-rich-text-special-characters-panel.entry.js +396 -0
- package/dist/esm/vega-rich-text-table-properties_3.entry.js +12 -12
- package/dist/esm/vega-section-title.entry.js +3 -2
- package/dist/esm/vega-segment-control.entry.js +3 -3
- package/dist/esm/vega-selection-chip_2.entry.js +8 -8
- package/dist/esm/vega-selection-tile_2.entry.js +6 -6
- package/dist/esm/vega-sidenav_3.entry.js +6 -6
- package/dist/esm/vega-signature-capture.entry.js +10 -10
- package/dist/esm/vega-stepper.entry.js +6 -6
- package/dist/esm/vega-tab-group_2.entry.js +4 -4
- package/dist/esm/vega-table_11.entry.js +8 -8
- package/dist/esm/vega-textarea.entry.js +17 -7
- package/dist/esm/vega-time-picker_2.entry.js +13 -13
- package/dist/esm/vega-toggle-switch.entry.js +5 -5
- package/dist/esm/vega-tooltip_2.entry.js +6 -6
- package/dist/esm/vega.js +13 -12
- package/dist/sri/vega-sri-manifest.json +363 -351
- package/dist/types/components/vega-accordion/slimmers/vega-accordion-renderer.d.ts +1 -0
- package/dist/types/components/vega-accordion/vega-accordion.d.ts +14 -0
- package/dist/types/components/vega-code-block/vega-code-block.d.ts +1 -0
- package/dist/types/components/vega-combo-box/slimmers/renderers/vega-combo-box-renderer.d.ts +1 -0
- package/dist/types/components/vega-combo-box/vega-combo-box.d.ts +10 -0
- package/dist/types/components/vega-date-picker/vega-date-picker-calendar/slimmers/controllers/vega-date-picker-calendar-size-controller.d.ts +20 -0
- package/dist/types/components/vega-date-picker/vega-date-picker-calendar/slimmers/renderers/vega-date-picker-calendar-header-render.d.ts +2 -1
- package/dist/types/components/vega-date-picker/vega-date-picker-calendar/slimmers/renderers/vega-date-picker-calendar-year-month-switcher-renderer.d.ts +1 -1
- package/dist/types/components/vega-date-picker/vega-date-picker-calendar/slimmers/renderers/vega-date-picker-month-item-renderer.d.ts +0 -1
- package/dist/types/components/vega-date-picker/vega-date-picker-calendar/vega-date-picker-calendar.d.ts +22 -2
- package/dist/types/components/vega-field-label/vega-field-label.d.ts +12 -0
- package/dist/types/components/vega-file-uploader/slimmers/renderers/vega-file-uploader-renderer.d.ts +1 -0
- package/dist/types/components/vega-file-uploader/vega-file-uploader.d.ts +10 -0
- package/dist/types/components/vega-input/slimmers/renderers/vega-input-renderer.d.ts +1 -0
- package/dist/types/components/vega-input/vega-input.d.ts +10 -0
- package/dist/types/components/vega-input-passcode/slimmers/renderers/vega-input-passcode-renderer.d.ts +1 -0
- package/dist/types/components/vega-input-passcode/vega-input-passcode.d.ts +10 -0
- package/dist/types/components/vega-input-phone-number/slimmers/renderers/vega-input-phone-number-renderer.d.ts +1 -0
- package/dist/types/components/vega-input-phone-number/vega-input-phone-number.d.ts +10 -0
- package/dist/types/components/vega-rich-text-editor/assets/redo.d.ts +3 -0
- package/dist/types/components/vega-rich-text-editor/assets/undo.d.ts +3 -0
- package/dist/types/components/vega-rich-text-editor/dto/annotations/annotation-style.d.ts +1 -1
- package/dist/types/components/vega-rich-text-editor/dto/blocks/block.abstract.d.ts +5 -0
- package/dist/types/components/vega-rich-text-editor/dto/blocks/code-block.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/dto/blocks/html-block.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/dto/blocks/image-block.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/dto/blocks/list-block.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/dto/blocks/list-item-block.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/dto/blocks/text-block.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/dto/content-state.d.ts +3 -0
- package/dist/types/components/vega-rich-text-editor/dto/nodes/code-block-node.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/dto/nodes/image-node.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/dto/nodes/node.abstract.d.ts +5 -0
- package/dist/types/components/vega-rich-text-editor/dto/nodes/text-node.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/extensions/base-toolbar-button-renderer.d.ts +31 -0
- package/dist/types/components/vega-rich-text-editor/extensions/extension.abstract.d.ts +19 -0
- package/dist/types/components/vega-rich-text-editor/extensions/functions/dto/function-block.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/extensions/functions/dto/logic-control-block.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/extensions/functions/dto/logic-control-node.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/extensions/functions/function-extension.d.ts +2 -1
- package/dist/types/components/vega-rich-text-editor/extensions/line-height/action-handler-strategies/block-update-line-height-strategy.d.ts +18 -0
- package/dist/types/components/vega-rich-text-editor/extensions/line-height/actions/line-height-annotation-action.d.ts +16 -0
- package/dist/types/components/vega-rich-text-editor/extensions/line-height/annotations/line-height-annotation.d.ts +46 -0
- package/dist/types/components/vega-rich-text-editor/extensions/line-height/assets/line-height.d.ts +3 -0
- package/dist/types/components/vega-rich-text-editor/extensions/line-height/constants.d.ts +6 -0
- package/dist/types/components/vega-rich-text-editor/extensions/line-height/element-to-dto-strategies/line-height-annotation-handler.d.ts +23 -0
- package/dist/types/components/vega-rich-text-editor/extensions/line-height/element-to-dto-strategies/line-height-filter-styles-strategy.d.ts +26 -0
- package/dist/types/components/vega-rich-text-editor/extensions/line-height/element-to-dto-strategies/line-height-from-json-handler.d.ts +17 -0
- package/dist/types/components/vega-rich-text-editor/extensions/line-height/line-height-extension.d.ts +19 -0
- package/dist/types/components/vega-rich-text-editor/extensions/line-height/line-height-toolbar-button-renderer.d.ts +44 -0
- package/dist/types/components/vega-rich-text-editor/extensions/special-characters/constants/arrow-characters.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/extensions/special-characters/constants/currency-characters.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/extensions/special-characters/constants/default-categories.d.ts +7 -0
- package/dist/types/components/vega-rich-text-editor/extensions/special-characters/constants/latin-characters.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/extensions/special-characters/constants/mathematical-characters.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/extensions/special-characters/constants/text-characters.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/extensions/special-characters/special-characters-extension.d.ts +20 -0
- package/dist/types/components/vega-rich-text-editor/extensions/special-characters/special-characters-icon.d.ts +3 -0
- package/dist/types/components/vega-rich-text-editor/extensions/special-characters/special-characters-toolbar-button-renderer.d.ts +83 -0
- package/dist/types/components/vega-rich-text-editor/extensions/special-characters/types.d.ts +20 -0
- package/dist/types/components/vega-rich-text-editor/extensions/special-characters/vega-rich-text-special-characters-panel/constants.d.ts +11 -0
- package/dist/types/components/vega-rich-text-editor/extensions/special-characters/vega-rich-text-special-characters-panel/slimmers/controllers/special-characters-panel-keyboard-controller.d.ts +18 -0
- package/dist/types/components/vega-rich-text-editor/extensions/special-characters/vega-rich-text-special-characters-panel/slimmers/renderers/special-characters-panel-renderer.d.ts +66 -0
- package/dist/types/components/vega-rich-text-editor/extensions/special-characters/vega-rich-text-special-characters-panel/vega-rich-text-special-characters-panel.d.ts +58 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/dto/table-block.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/dto/table-body-block.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/dto/table-caption-block.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/dto/table-cell-block.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/dto/table-head-block.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/dto/table-head-cell-block.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/dto/table-row-block.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/extensions/tokens/token-extension.d.ts +3 -1
- package/dist/types/components/vega-rich-text-editor/extensions/tokens/token-node.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/extensions/type.d.ts +14 -0
- package/dist/types/components/vega-rich-text-editor/helpers/extension-context-manager.d.ts +1 -1
- package/dist/types/components/vega-rich-text-editor/interface.d.ts +8 -0
- package/dist/types/components/vega-rich-text-editor/public-api.d.ts +5 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/html-element-to-annotation-generator.d.ts +3 -1
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/toolbar-renderer.d.ts +3 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/redo-toolbar-button-slimmer.d.ts +9 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/undo-toolbar-button-slimmer.d.ts +9 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/vega-rich-text-editor-renderer.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/vega-rich-text-editor.d.ts +14 -0
- package/dist/types/components/vega-textarea/vega-textarea.d.ts +10 -0
- package/dist/types/components.d.ts +169 -5
- 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/slimmers/component-value-history-controller-slimmer.abstract.d.ts +13 -0
- package/dist/types/helpers/theme/controllers/action-color-accessibility-validator.d.ts +10 -0
- package/dist/types/helpers/theme/internal-theme-manager.d.ts +28 -1
- package/dist/types/helpers/theme/theme-manager.d.ts +24 -1
- package/dist/types/helpers/theme/theme.d.ts +8 -0
- package/dist/types/helpers/translation/interface.d.ts +10 -1
- package/dist/types/types/components.type.d.ts +11 -10
- package/dist/types/types/public-api.d.ts +1 -0
- package/dist/types/vega-color-token-contrast-checker/src/check/checker.d.ts +177 -0
- package/dist/types/vega-color-token-contrast-checker/src/check/color-math.d.ts +125 -0
- package/dist/types/vega-color-token-contrast-checker/src/check/contrast-check-strategy.d.ts +38 -0
- package/dist/types/vega-color-token-contrast-checker/src/check/search.d.ts +58 -0
- package/dist/types/vega-color-token-contrast-checker/src/check/token-checks.d.ts +122 -0
- package/dist/types/vega-color-token-contrast-checker/src/check/token-checks.generated.d.ts +2 -0
- package/dist/types/vega-color-token-contrast-checker/src/index.d.ts +2 -0
- package/dist/vega/index.esm.js +1 -1
- package/dist/vega/{p-636d890e.entry.js → p-01f617ee.entry.js} +1 -1
- package/dist/vega/{p-fdb97cb7.entry.js → p-03b32939.entry.js} +1 -1
- package/dist/vega/{p-2927b7a1.js → p-05dc6718.js} +1 -1
- package/dist/vega/{p-72e2a587.js → p-0b2ca33b.js} +1 -1
- package/dist/vega/p-0c460945.js +1 -0
- package/dist/vega/{p-d286da1d.entry.js → p-0d248322.entry.js} +1 -1
- package/dist/vega/{p-2b2fefc6.js → p-0d3830f1.js} +1 -1
- package/dist/vega/{p-c45acdc3.entry.js → p-0dafd071.entry.js} +1 -1
- package/dist/vega/{p-a67d52ce.entry.js → p-0edf9c6e.entry.js} +1 -1
- package/dist/vega/{p-a03341d8.entry.js → p-1385da31.entry.js} +1 -1
- package/dist/vega/{p-d1a6e126.entry.js → p-18d1d404.entry.js} +1 -1
- package/dist/vega/{p-aa8f4713.entry.js → p-1d752c37.entry.js} +1 -1
- package/dist/vega/p-1f563387.js +1 -0
- package/dist/vega/{p-e85497ec.entry.js → p-296c90bd.entry.js} +1 -1
- package/dist/vega/p-30f76962.js +3 -0
- package/dist/vega/p-3186995a.entry.js +1 -0
- package/dist/vega/p-3312e3dd.js +1 -0
- package/dist/vega/{p-a0dd08b1.js → p-36e46c4f.js} +1 -1
- package/dist/vega/p-36f3dd19.entry.js +1 -0
- package/dist/vega/{p-d5aad9f0.entry.js → p-3ab50c06.entry.js} +1 -1
- package/dist/vega/{p-31ebace1.js → p-3d6568cc.js} +1 -1
- package/dist/vega/{p-19df2831.entry.js → p-3e2e4b00.entry.js} +1 -1
- package/dist/vega/{p-ff5208f5.entry.js → p-416e89b0.entry.js} +1 -1
- package/dist/vega/{p-79bb216e.entry.js → p-4914a5f8.entry.js} +1 -1
- package/dist/vega/{p-ac26924d.entry.js → p-4f53b45d.entry.js} +1 -1
- package/dist/vega/p-50958342.js +1 -0
- package/dist/vega/{p-2d694684.js → p-518e0a24.js} +1 -1
- package/dist/vega/p-540bd78a.entry.js +1 -0
- package/dist/vega/p-5424e837.js +1 -0
- package/dist/vega/p-54ed506c.entry.js +1 -0
- package/dist/vega/{p-7e7e2f85.entry.js → p-5a960f83.entry.js} +1 -1
- package/dist/vega/{p-879d3cc9.entry.js → p-5c1a4fd7.entry.js} +1 -1
- package/dist/vega/{p-5b43a303.entry.js → p-5c8522eb.entry.js} +1 -1
- package/dist/vega/p-5f377954.js +1 -1
- package/dist/vega/{p-0b41b49a.entry.js → p-6205288e.entry.js} +1 -1
- package/dist/vega/{p-04a65b3f.js → p-6629a68b.js} +1 -1
- package/dist/vega/p-696d7b8f.js +1 -0
- package/dist/vega/{p-931dac8c.entry.js → p-6ab23e89.entry.js} +1 -1
- package/dist/vega/{p-154cc614.js → p-6bd37d32.js} +1 -1
- package/dist/vega/{p-ce034372.entry.js → p-6be01c6b.entry.js} +1 -1
- package/dist/vega/{p-294cff20.entry.js → p-70e0c3eb.entry.js} +1 -1
- package/dist/vega/{p-4a9c8ec0.entry.js → p-7168ef16.entry.js} +1 -1
- package/dist/vega/{p-ab04eff6.js → p-7292ac20.js} +1 -1
- package/dist/vega/p-7348a091.entry.js +1 -0
- package/dist/vega/{p-19adf714.js → p-788ada42.js} +1 -1
- package/dist/vega/p-7cd8d054.entry.js +1 -0
- package/dist/vega/{p-bee5dfb0.entry.js → p-7dcc0b23.entry.js} +1 -1
- package/dist/vega/{p-189d36ec.js → p-81d55efd.js} +1 -1
- package/dist/vega/{p-8077b117.js → p-8ee917b4.js} +1 -1
- package/dist/vega/{p-52645382.entry.js → p-92468c30.entry.js} +1 -1
- package/dist/vega/{p-3a3720c7.entry.js → p-92710213.entry.js} +1 -1
- package/dist/vega/{p-e8de9535.js → p-9c48e4e5.js} +1 -1
- package/dist/vega/{p-891815d6.js → p-9f03856e.js} +1 -1
- package/dist/vega/{p-7ffe8081.entry.js → p-a0dd5273.entry.js} +1 -1
- package/dist/vega/p-a0fa5ccc.entry.js +1 -0
- package/dist/vega/{p-4a954d9d.entry.js → p-a32ad1ac.entry.js} +1 -1
- package/dist/vega/{p-01a54c29.entry.js → p-a36d4199.entry.js} +1 -1
- package/dist/vega/{p-d97974be.entry.js → p-a53e1a60.entry.js} +1 -1
- package/dist/vega/{p-d4262f06.entry.js → p-a73d8915.entry.js} +1 -1
- package/dist/vega/{p-07225567.entry.js → p-a87bc75a.entry.js} +1 -1
- package/dist/vega/{p-09076646.js → p-abfe46ca.js} +1 -1
- package/dist/vega/p-ad815280.js +1 -0
- package/dist/vega/p-b0fb5099.entry.js +1 -0
- package/dist/vega/{p-d05915af.entry.js → p-b218141f.entry.js} +1 -1
- package/dist/vega/{p-e7c930d9.entry.js → p-b2a0d104.entry.js} +1 -1
- package/dist/vega/{p-3bf3c8bb.entry.js → p-b31802b3.entry.js} +1 -1
- package/dist/vega/{p-255a7387.entry.js → p-b3e97e2f.entry.js} +1 -1
- package/dist/vega/{p-15b4f1ce.entry.js → p-b519b9ab.entry.js} +1 -1
- package/dist/vega/{p-8aee6b74.js → p-b565a6a5.js} +1 -1
- package/dist/vega/{p-2e0bdc53.entry.js → p-b5a3de00.entry.js} +1 -1
- package/dist/vega/p-b5d00d38.entry.js +1 -0
- package/dist/vega/p-b72d7b57.entry.js +1 -0
- package/dist/vega/{p-f5ae99b4.entry.js → p-b7f30f68.entry.js} +1 -1
- package/dist/vega/p-b857a661.js +1 -0
- package/dist/vega/{p-d9d4bdbf.entry.js → p-ba4f23d8.entry.js} +1 -1
- package/dist/vega/{p-5df7ab03.entry.js → p-c0c13993.entry.js} +1 -1
- package/dist/vega/p-c4675cd2.entry.js +1 -0
- package/dist/vega/p-c51e3b9e.js +1 -0
- package/dist/vega/{p-bd47d8a7.entry.js → p-c6201e76.entry.js} +1 -1
- package/dist/vega/p-c84aa55a.js +1 -0
- package/dist/vega/{p-858ec529.js → p-c93dfe23.js} +1 -1
- package/dist/vega/p-cacec680.js +1 -0
- package/dist/vega/{p-186df871.entry.js → p-cd382652.entry.js} +1 -1
- package/dist/vega/{p-49341532.entry.js → p-cdd3af89.entry.js} +1 -1
- package/dist/vega/{p-ec663f00.entry.js → p-ce8a0aa6.entry.js} +1 -1
- package/dist/vega/{p-648be36d.entry.js → p-cf5c6172.entry.js} +1 -1
- package/dist/vega/{p-0a322971.entry.js → p-d1641644.entry.js} +1 -1
- package/dist/vega/p-d2237b95.entry.js +1 -0
- package/dist/vega/{p-76075a1c.entry.js → p-d24892d6.entry.js} +1 -1
- package/dist/vega/p-d25ca0c3.entry.js +1 -0
- package/dist/vega/{p-b69755c7.entry.js → p-d8591207.entry.js} +1 -1
- package/dist/vega/p-da42fde0.js +1 -0
- package/dist/vega/{p-aa4e9a4b.entry.js → p-dc0f7ef1.entry.js} +1 -1
- package/dist/vega/{p-70ae9157.entry.js → p-dcd3b421.entry.js} +1 -1
- package/dist/vega/{p-c19132c9.entry.js → p-df4f9264.entry.js} +1 -1
- package/dist/vega/p-e5726df7.entry.js +1 -0
- package/dist/vega/{p-4c91b13d.js → p-e7fb7eee.js} +1 -1
- package/dist/vega/{p-98dad153.entry.js → p-ea4b5520.entry.js} +1 -1
- package/dist/vega/p-ecbead18.entry.js +1 -0
- package/dist/vega/{p-b02b985d.js → p-f0d70de3.js} +1 -1
- package/dist/vega/{p-78ba7ca9.js → p-f7ad9349.js} +1 -1
- package/dist/vega/{p-a6565e02.js → p-fdf6f368.js} +1 -1
- package/dist/vega/{p-0a261b66.js → p-fea75b87.js} +1 -1
- package/dist/vega/{p-296c5e52.js → p-ffda64ac.js} +1 -1
- package/dist/vega/{p-74a1a82a.entry.js → p-ffe8a826.entry.js} +1 -1
- package/dist/vega/vega.esm.js +1 -1
- package/package.json +3 -2
- package/dist/vega/p-042933f1.js +0 -1
- package/dist/vega/p-0d97dcb9.js +0 -1
- package/dist/vega/p-1da42a63.entry.js +0 -1
- package/dist/vega/p-281fa1e0.js +0 -1
- package/dist/vega/p-32a0f887.js +0 -1
- package/dist/vega/p-4a6f241d.entry.js +0 -1
- package/dist/vega/p-4dd02704.js +0 -1
- package/dist/vega/p-50fb936f.entry.js +0 -1
- package/dist/vega/p-612808ce.entry.js +0 -1
- package/dist/vega/p-6399b5ed.js +0 -1
- package/dist/vega/p-686e0b6b.entry.js +0 -1
- package/dist/vega/p-6d4faebc.js +0 -1
- package/dist/vega/p-88e56a47.entry.js +0 -1
- package/dist/vega/p-8d36afcc.entry.js +0 -1
- package/dist/vega/p-979a5e91.entry.js +0 -1
- package/dist/vega/p-a2b8d49d.js +0 -1
- package/dist/vega/p-ab4c307b.js +0 -1
- package/dist/vega/p-ce2d9efe.entry.js +0 -1
- package/dist/vega/p-e46a23fc.entry.js +0 -1
- package/dist/vega/p-e8ea3b16.js +0 -3
- package/dist/vega/p-ea0e922f.entry.js +0 -1
- package/dist/vega/p-ec2333f7.entry.js +0 -1
- package/dist/vega/p-ed2b0e01.entry.js +0 -1
- package/dist/vega/p-ef13b346.js +0 -1
- package/dist/vega/p-fe220f3a.entry.js +0 -1
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{g as t,e,c as n,h as s,A as r,T as i,t as a,H as o,u as l,l as c,v as h,w as u,x as d,y as w,z as p,I as m,n as f,S as g,j as x,B as T,D as b,d as O,r as y,E,o as A,q as k,s as N,F as C,N as H,G as j,J as B,K as v,m as S,L as I,M as R,O as L,P as $,Q as D,U as M,W as P,X as F,Y as z,Z as U,_ as V,$ as W,a0 as G,a1 as J,a2 as K,R as Y,a3 as X,p as Q,a4 as Z,a5 as _,a6 as q,b as tt,a7 as et,a8 as nt,a9 as st,aa as rt}from"./p-3312e3dd.js";import{g as it}from"./p-8b5d3a52.js";import{i as at}from"./p-f7ad9349.js";import{C as ot}from"./p-2d0d575f.js";import{d as lt}from"./p-11e2dcf5.js";import{c as ct,d as ht}from"./p-3a93730e.js";import{r as ut,i as dt}from"./p-ec2a1d4c.js";import{c as wt}from"./p-a841cf13.js";import{L as pt}from"./p-6e1ab235.js";class mt extends e{constructor(t,e,n){super(t,"list-item",n),this.dtoName=mt.dtoName,this.nestList=[],this.nestList=e}static from(t,e={autoMatchFormat:!0}){const s=new mt(t.id,void 0,e);s.children=t.nodes.map((t=>n.from(t,s,e))),t.children&&(s.nestList=t.children.map((t=>{const e=gt.from(t);return e.parent=s,e})));const{annotations:r}=t;return r&&Object.entries(r).forEach((([t,e])=>{const n=this.createAnnotationEntity(t,e);at(n)&&s.annotationMap.set(...n)})),s}toJSON(){var t;return Object.assign(Object.assign({},super.toJSON()),{type:"list-item",children:null===(t=this.nestList)||void 0===t?void 0:t.map((t=>t.toJSON()))})}toHtml(t){return[`<li${super.generateAttributeString(t)}>`,this.getChildrenHtml(t),"</li>"].join("")}cloneWithNodes(t){const e=new mt(it());return e.children=[],e.apply(new s(t)),e}getLastNode(){return this.nestList&&this.nestList.length>0?this.nestList[this.nestList.length-1].getLastNode():super.getLastNode()}createNewListItem(){return new mt(it())}clone(t){var e;const n=new mt(this.id);return n.children=this.children.map((t=>t.clone(n))),n.annotationMap=super.cloneAnnotations(),n.nestList=null===(e=this.nestList)||void 0===e?void 0:e.map((t=>t.clone(n))),n.parent=t,n}}r.register(i.name,mt.name,new a),r.register(o.name,mt.name,new l),r.register(c.LINE_BREAK_SINGLE_BLOCK,mt.name,new h),r.register(c.LINE_BREAK_MULTIPLE_BLOCKS,mt.name,new u),r.register(c.DELETE_NEST_LIST,mt.name,new class extends t{handleAction(t,e){e.nestList&&(e.nestList=e.nestList.length>1?e.nestList.filter((e=>e!==t.nestListBlockToBeRemoved)):void 0)}}),r.register(c.SPLIT_BLOCK_WITH_NODE,mt.name,new d),r.register(c.REPLACE_CHILD_NODES,mt.name,new w),r.register(c.REPLACE_NEST_LIST,mt.name,new class extends t{handleAction(t,e){t.newList.forEach((t=>{t.parent=e})),e.nestList=t.newList}}),r.register(c.MERGE_TWO_BLOCKS_NODES,mt.name,new p),r.register(c.INSERT_IMAGE_TO_BLOCK,mt.name,new class extends t{handleAction(t,e){e.parent.apply(t)}}),mt.dtoName="RTEListItemBlock";class ft extends T{constructor(){super(...arguments),this.type=b.LIST}static getDefaultStyles(){return{paddingLeft:"8px",marginLeft:"16px"}}renderStyle(t){return(null==t?void 0:t.standalone)?ft.getDefaultStyles():null}renderClass(t){return(null==t?void 0:t.standalone)?null:"v-rte--list"}clone(){return new ft}toJSON(){}}class gt extends O{constructor(t,e,n){super(t),this.dtoName=gt.dtoName,this.type="bullet-list",this.children=[],this.type=e;const{autoMatchFormat:s}=n||{autoMatchFormat:!0};s&&this.annotationMap.set(b.LIST,new ft)}static from(t,e={autoMatchFormat:!0}){const n=new gt(t.id,t.type,e),{annotations:s}=t;return s&&Object.entries(s).forEach((([t,e])=>{const s=this.createAnnotationEntity(t,e);at(s)&&n.annotationMap.set(...s)})),n.children=t.blocks.map((t=>{const s=mt.from(t,e);return s.parent=n,s})),n}static createAnnotationEntity(t,e){switch(t){case"customAttribute":return A.from(e);case"customClass":return E.from(e);case"customStyle":return y.from(e)}}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{id:this.id,type:this.type,blocks:this.children.map((t=>t.toJSON()))})}toHtml(t){const e=this.getBlockTag();return[`<${e}${super.generateAttributeString(t)}>`,this.children.map((e=>e.toHtml(t))).join(""),`</${e}>`].join("")}isNotEmpty(){return this.children.length>0}getLastNode(){return this.children[this.children.length-1].getLastNode()}clone(t){const e=new gt(this.id,this.type);return e.children=this.children.map((t=>t.clone(e))),e.annotationMap=super.cloneAnnotations(),e.parent=t,e}getBlockTag(){return"number-list"===this.type?"ol":"ul"}}r.register(c.TRANSFORM_LIST_BLOCK,gt.name,new class extends t{handleAction(t,e){const n=t.selectedBlocks,r=e.parent.createList(t.listType);if(n.every((t=>t.parent===e)))r.apply(new s(e.children)),e.parent.apply(new m(e,r)),e.parent.apply(new f(e)),n.forEach((t=>t.children.map((t=>t.apply(new g)))));else{const n=t.selectedBlocks.map((t=>e.parent.toListItem(t)));r.apply(new s(n)),e.parent.apply(new m(e,r)),t.selectedBlocks.forEach((t=>{t.parent.apply(new f(t))})),0===e.children.length&&e.parent.apply(new f(e))}}}),r.register(c.TRANSFORM_PARAGRAPH_BLOCK,gt.name,new class extends t{handleAction(t,e){let n=!1,r=!1;const i=t.selectedBlocks,a=i.map((t=>(t.children.map((t=>t.apply(new g))),t===e.children[0]&&(n=!0),t===e.children[e.children.length-1]&&(r=!0),this.toParagraph(t))));if(n)e.parent.apply(new x(e,...a));else if(r)e.parent.apply(new m(e,...a));else{const t=e.children.indexOf(i[0]),n=e.children.indexOf(i[i.length-1]),r=e.parent.createList(e.type);r.apply(new s(e.children.slice(0,t)));const o=e.parent.createList(e.type);o.apply(new s(e.children.slice(n+1))),e.parent.apply(new x(e,r,...a,o)),e.parent.apply(new f(e))}i.map((t=>{e.apply(new f(t))})),0===e.children.length&&e.parent.apply(new f(e))}toParagraph(t){const n=new e(it(),"paragraph");return n.apply(new s(t.children)),n.annotationMap=t.annotationMap,n}}),r.register(c.INSERT_IMAGE_TO_BLOCK,gt.name,new class extends t{handleAction(t,e){e.parent.apply("list-item"!==e.parent.type?new m(e,t.imageBlockToBeInserted):t)}}),gt.dtoName="RTEListBlock";class xt{}class Tt{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(at)),e}}const bt=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)}},Ot=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 Tt(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 bt.getElementToBlockStrategies()}};class yt extends t{handleAction(t,e){const n=t.entityToBeAppended;e.children&&(n.forEach((t=>{t.parent=e})),e.children=e.children.concat(n))}}class Et 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 At extends Et{handleAction(t,e){this.replaceElementWithElements(e,t.referChildren,[t.referChildren,...t.childrenToBeInserted])}}class kt extends C{constructor(t,e){super(),this.type=H.IMAGE,this.size=t,this.alt=e}static from(t,e){return[H.IMAGE,new kt(t,e)]}static getDefaultStyles(){return{verticalAlign:"bottom"}}toJSON(){return at(this.alt)?{size:this.size,alt:this.alt}:{size:this.size}}clone(){return new kt(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=kt.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%"})}}}kt.BASE_STYLES={verticalAlign:"bottom"};class Nt extends j{constructor(t,e,n,s){super(t,s),this.dtoName=Nt.dtoName,this.type=B.IMAGE,this.url=e,this.parent=n}static from(t,e,n={autoMatchFormat:!0}){const s=new Nt(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?kt.from(l.size,l.alt):this.createAnnotationEntity(t,l[t]))).filter(at)),s}toJSON(){const t=Array.from(this.annotationMap.values()).filter((t=>t instanceof kt||t instanceof v)).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 Nt(this.id,this.url,t,super.cloneAnnotations())}toHtml(t){const e=this.getAnnotationByType(H.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(at))}>`}doAnnotationActionApply(t){const e=r.get(S.name,Nt.name);e&&e.execute(t,this)}doModifyActionApply(t){r.executeTheStrategy(t,this)}}r.register(c.UPDATE_IMAGE_NODE_URL,Nt.name,new class extends t{handleAction(t,e){e.url=t.url}}),r.register(S.name,Nt.name,new class extends t{handleAction(t,e){const n=t.toAnnotation();e.annotationMap.set(n.type,n)}}),Nt.dtoName="RTEImageNode";class Ct extends R{constructor(t,e){super(),this.type=c.INSERT_NEW_PARAGRAPH,this.startContainerNode=t,this.startOffset=e}}class Ht extends O{constructor(t){super(t),this.dtoName=Ht.dtoName,this.type="image",this.children=[]}static from(t,e={autoMatchFormat:!0}){const n=new Ht(t.id),{annotations:s}=t;return n.children=t.nodes.map((t=>Nt.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 Ht(it())}clone(t){const e=new Ht(this.id);return e.children=this.children.map((t=>t.clone(e))),e.annotationMap=super.cloneAnnotations(),e.parent=t,e}}r.register(c.MERGE_TWO_BLOCKS_NODES,Ht.name,new p),r.register(c.REPLACE_CHILD_NODES,Ht.name,new w),r.register(c.SPLIT_BLOCK_WITH_NODE,Ht.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 I(t));const i=this.cloneWithNodes(r,n);return n.parent.apply(new m(n,i)),i}}cloneWithNodes(t,e){const n=e.createNewImageBlock();return n.children=[],n.apply(new s(t)),n}}),r.register(c.LINE_BREAK_SINGLE_BLOCK,Ht.name,new class extends t{handleAction(t,e){const n=new Ct(t.startContainerNode,t.startOffset);e.apply(n);const s=n.newBlock;s&&(t.lineBreakNode=s.children[0])}}),r.register(c.LINE_BREAK_MULTIPLE_BLOCKS,Ht.name,new class extends t{handleAction(t,e){t.lineBreakNode=this.lineBreakMultipleBlocks(t.selectedBlocks,e)}lineBreakMultipleBlocks(t,r){const i=e.from({id:it(),type:"paragraph",nodes:[{id:it(),type:"text",text:"\n"}]});r.parent.apply(new m(r,i));const a=this.concatBlocksNodes(t.slice(1));return(0===a.length||a[0]&&""===a[0].text)&&a.push(new n(it(),"\n",i)),i.apply(new s(a)),i.children[0]}concatBlocksNodes(t){const e=[];return t.map((t=>{"image"!==t.type&&(e.push(...t.children),t.parent.apply(new f(t)))})),e}}),r.register(c.INSERT_IMAGE_TO_BLOCK,Ht.name,new class extends t{handleAction(t,e){const n=t.splitPointNode,r=t.startOffsetOfNode,i=t.imageBlockToBeInserted;e.children.length<1?e.apply(new s(i.children)):this.isCaretPositionAtBlockEnd(e,n,r)?e.parent.apply(new m(e,i)):this.isCaretPositionAtBlockStart(e,n,r)?e.parent.apply(new x(e,i)):(e.apply(new L(n,r)),e.parent.apply(new m(e,i)))}}),r.register(o.name,Ht.name,new l),Ht.dtoName="RTEImageBlock";class jt extends O{constructor(t,e){super(t),this.dtoName=jt.dtoName,this.type="html-block",this.children=[],this.htmlTag=e}static from(t,e){const n=new jt(t.id,t.htmlTag),{annotations:s}=t;return s&&super.convertAnnotationsToMap(n.annotationMap,s),n.children=this.generateBlockChildren(t.children,e,n),n}clone(t){const e=new jt(this.id,this.htmlTag);return e.children=this.children.map((t=>t.clone(e))),e.annotationMap=super.cloneAnnotations(),e.parent=t,e}getLastNode(){return this.children[this.children.length-1].getLastNode()}isNotEmpty(){return!0}toHtml(t){const e=this.htmlTag,n=super.generateAttributeString(t);return $.has(this.htmlTag)?`<${e}${n}>`:[`<${e}${n}>`,this.children.map((e=>e.toHtml(t))).join(""),`</${e}>`].join("")}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{id:this.id,type:this.type,htmlTag:this.htmlTag,children:this.children.map((t=>t.toJSON()))})}}jt.dtoName="RTEHtmlBlock";class Bt extends R{constructor(t){super(),this.type=c.MERGE_TWO_BLOCKS_NODES,this.blockNeedToBeMerged=t}}class vt extends D{handleAction(t,e){const{startContainerNode:n}=t;n.isContentEditable()?n.isTextNode()&&this.deleteTextNodeContent(t,e):this.deleteDecoratorNodeContent(t,e);const s=e.parent;s&&e.isListItemBlock()&&0===s.children.length&&s.parent.apply(new f(s))}deleteTextNodeContent(t,e){const n=t.startContainerNode,s=t.startOffset;if(0!==s&&!n.isEmpty()){const r=n.text.slice(0,s-1)+n.text.slice(s);if(n.apply(new M(r)),r)return void(t.previousNode=n);{const s=this.getPreviousNode(n);return s&&s.parent===e&&"\n"===s.text||1===e.children.length?void(t.previousNode=n):(e.apply(new f(n)),void(t.previousNode=s))}}{let s=this.getPreviousNode(n),r=null;const i=n.isEmpty();if(e.children.length&&s&&s.parent!==e)i&&e.apply(new f(n)),e.type===s.parent.type&&s.parent.apply(new Bt(e));else if(this.isContentFirstNode(n)&&i&&(r=this.getNextNode(n)),i&&e.apply(new f(n)),s&&s.isTextNode()&&(s.isEmpty()||!s.isContentEditable()&&s.parent===e)){const t=s;s=this.getPreviousNode(s),t.parent.apply(new f(t)),s||i||(r=n)}0===e.children.length&&e.parent.apply(new f(e)),s?t.previousNode=s:r&&(t.nextNode=r)}}deleteDecoratorNodeContent(t,e){const n=t.startContainerNode,s=t.startOffset;let r=this.getPreviousNode(n),i=null;if(0!==s){const t=e;this.isContentFirstNode(n)&&(i=this.getNextNode(n)),1===t.children.length?t.parent.apply(new f(t)):t.apply(new f(n))}else{const e=r;e&&!e.isContentEditable()&&(r=this.getPreviousNode(e),e.parent.apply(new f(e)),r||(t.nextNode=n))}r?t.previousNode=r:i&&(t.nextNode=i)}}class St extends t{handleAction(t,e){const{startContainerNode:n}=t;t.newBlock=this.breakSingleBlock(n,t.startOffset,e)}breakSingleBlock(t,e,n){const s=this.getNewParagraph(t);if(s){if(this.isCaretPositionAtBlockEnd(n,t,e))n.parent.apply(new m(n,s));else{if(!this.isCaretPositionAtBlockStart(n,t,e)){const s=new L(t,e);return n.apply(s),s.newBlock}n.parent.apply(new x(n,s))}return s}}getNewParagraph(t){const e=this.createNewParagraph("");if(e){let n=e.children[0];return t.isTextNode()&&t.isContentEditable()&&(e.children=[],n=t.cloneWithText(""),n.annotationMap.delete(H.LINK),e.apply(new s([n]))),e}}}class It extends R{constructor(t,e,n=!1){super(),this.isFlushable=!0,this.type=c.UPDATE_CURSOR_POSITION,this.immediatelyRun=!1,this.nextFocusNode=t,this.offset=e,this.immediatelyRun=n,this.immediatelyRun&&(this.isFlushable=!1)}}class Rt extends t{handleAction(t,e){const{rteRange:n,nodeToBeInserted:s}=t,{startNode:r,startOffset:i}=n;if(r){const t=e;if(r.isContentEditable()&&r.isTextNode())if("\n"!==r.text&&r.text&&0!==i){const e=r.text.substring(0,i),n=r.text.substring(i),a=r.cloneWithText(e),o=r.cloneWithText(n),l=[a,s];n&&l.push(o),t.apply(new x(r,...l)),t.apply(new f(r))}else t.apply(new x(r,s));else t.apply(0!==i?new m(r,s):new x(r,s));this.updateCursorPosition(s)}}updateCursorPosition(t){const e=this.getRootContent(t.parent);e&&e.apply(new It(t))}}class Lt extends t{handleAction(t,e){const{text:n,offset:s,decoratorNode:r}=t,i=this.createNewParagraph(n);if(i){const t=i.children[0];e.apply(0!==s?new m(r,t):new x(r,t)),this.setTheCursorPosition(t)}}setTheCursorPosition(t){const e=this.getRootContent(t.parent);e&&e.apply(new It(t))}}class $t extends t{handleAction(t,e){t.newBlock=this.breakSingleListItemBlock(t.startContainerNode,t.startOffset,e)}breakSingleListItemBlock(t,e,n){const r=n.createNewListItem(),i=this.copyInlineStyleToNewNode(t);if(r.apply(new s([i])),this.isCaretPositionAtBlockEnd(n,t,e))return this.breakListItemAtEnd(r,n);if(!this.isCaretPositionAtBlockStart(n,t,e)){const s=new L(t,e);return n.apply(s),s.newBlock}return n.parent.apply(new x(n,r)),r}breakListItemAtEnd(t,n){const r=n.parent.children[n.parent.children.length-1],i=1===n.children.length&&n.children[0].isEmpty();if(n===r&&i){const r=n.parent.parent;if("list-item"!==r.type){const i=e.from({id:it(),type:"paragraph",nodes:[]});return i.apply(new s(t.children)),r.apply(new m(n.parent,i)),n.parent.apply(new f(n)),i}r.parent.apply(new m(r,t)),n.parent.apply(new f(n))}else n.parent.apply(new m(n,t));return t}copyInlineStyleToNewNode(t){const e=t.cloneWithText("");return e.annotationMap.delete(H.LINK),e}}class Dt extends R{constructor(t){super(),this.type=c.DELETE_NEST_LIST,this.nestListBlockToBeRemoved=t}}class Mt extends P{handleAction(t,e){super.handleAction(t,e);const n=e.parent;0===e.children.length&&n&&n.apply("list-item"===n.type?new Dt(e):new f(e))}}class Pt extends t{handleAction(t,e){if(e.parent){const{blocksToBeInserted:n,startNode:s,startOffset:r}=t;let i=e;if(s===e.children[0]&&0===r)e.parent.apply(new x(e,...n));else{const t=new L(s,r);e.apply(t),e.parent.apply(new m(e,...n)),i=t.newBlock}t.futureFocusBlock=i}}}const Ft=new class{registerBlockBasicStrategies(t){r.register(c.DELETE_CHILDREN,t,t===gt.name?new Mt:new P),r.register(c.APPEND_CHILDREN,t,new yt),r.register(c.INSERT_CHILDREN_BEFORE,t,new Et),r.register(c.INSERT_CHILDREN_AFTER,t,new At),r.register(c.DELETE_BLOCK_CONTENT,t,new vt),r.register(c.INSERT_NEW_PARAGRAPH,t,t===mt.name?new $t:new St),r.register(c.INSERT_TEXT_TO_DECORATOR_NODE,t,new Lt),r.register(c.INSERT_NODE_TO_NEAREST_ROOT,t,new Rt),r.register(c.PASTE_CONTENT,t,new Pt)}};class zt{}class Ut extends zt{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===F||t.style.fontWeight===z||t.classList.contains("v-rte--bold")}}class Vt extends zt{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 Wt extends zt{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 Gt extends zt{canHandle(t,e){return!e.skipCustomAnnotations&&!!t}handle(t){const e=U(t);return Object.keys(e).length>0?{customStyle:e}:{}}}class Jt extends zt{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 Kt extends zt{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 Yt extends zt{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 Xt extends zt{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=ut(t.style.color))||void 0===e?void 0:e.toUpperCase();if(n){const t=V.filter((t=>t.key!==W.key)).find((t=>t.light===n||t.dark===n));return t?t.key:null}for(const e of V)if(t.style.color.includes(e.key))return e.key;return null}}class Qt extends zt{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===G||"EM"===t.nodeName||t.classList.contains("v-rte--italic")}}class Zt extends zt{canHandle(t,e){return!!e.autoMatchFormat&&"RTETextBlock"===t.dtoName}handle(t){const e=this.getTextStyle(t);return e?{textStyle:e}:{}}getTextStyle(t){const e=this.getElementTypeByDataType(t);if(e)return e;const n=this.getElementTypeByNodeName(t);if(n)return n;const s=this.getElementTypeByFontSize(t);if(s)return s;return this.getElementTypeByClassName(t)||null}getElementTypeByDataType(t){return t.nodeType!==Node.TEXT_NODE&&t.hasAttribute("data-type")?t.getAttribute("data-type"):null}getElementTypeByFontSize(t){var e;switch(null===(e=t.style)||void 0===e?void 0:e.fontSize){case"36px":return"title";case"28px":return"subtitle";case"22px":return"heading-1";case"20px":return"heading-2";case"18px":return"heading-3";default:return null}}getElementTypeByNodeName(t){switch(t.nodeName){case"P":return"paragraph";case"H1":return"heading-1";case"H2":return"heading-2";case"H3":return"heading-3";case"H4":return"heading-4";case"H5":return"heading-5";case"H6":return"heading-6";default:return null}}getElementTypeByClassName(t){if(t.className){const e=/\bv-rte-(?:-text-style-)?(title|subtitle|heading-1|heading-2|heading-3|heading-4|heading-5|heading-6|paragraph)\b/.exec(t.className);if(e)return e[1]}return null}}class _t{static isTitleOrSubtitle(t){if("DIV"===t.nodeName){const e=_t.textStyleHandler.getTextStyle(t);return"title"===e||"subtitle"===e}return!1}static isLinkElement(t){return"A"===t.nodeName}}_t.textStyleHandler=new Zt;class qt extends zt{constructor(){super(...arguments),this.handlers=[new Vt,new Wt,new Gt]}canHandle(t){return"RTETextNode"===t.dtoName}handle(t,e={}){return e.link?{link:e.link}:_t.isLinkElement(t)?{link:this.generateLinkAnnotations(t)}:{}}generateLinkAnnotations(t){const e={href:t.getAttribute("href")||"",groupKey:it()};return this.handlers.forEach((n=>{Object.assign(e,n.handle(t))})),e}}class te extends zt{canHandle(t){return"RTETextNode"===t.dtoName}handle(t,e={}){return this.isStrikethrough(t)||e.strikethrough?{strikethrough:!0}:{}}isStrikethrough(t){return t.style.textDecoration.includes(J)||"S"===t.nodeName||"DEL"===t.nodeName||t.classList.contains("v-rte--strikethrough")}}class ee extends zt{canHandle(t){return"RTETextNode"===t.dtoName}handle(t,e={}){return this.isUnderline(t)||e.underline?{underline:!0}:{}}isUnderline(t){return t.style.textDecoration.includes(K)||"U"===t.nodeName||"INS"===t.nodeName||t.classList.contains("v-rte--underline")}}class ne extends zt{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 se extends zt{canHandle(t){return"RTEImageNode"===t.dtoName}handle(t){return t.hasAttribute("alt")?{alt:t.getAttribute("alt")}:{}}}const re=new Set(["P","H1","H2","H3","H4","H5","H6","LI"]),ie=new Set(["P","H1","H2","H3","H4","H5","H6","LI","UL","OL","IMG","CODE"]),ae=new Set(["BR","VEGA-RICH-TEXT-LINK-EDITOR","CODE","A"]),oe=new Set(["TABLE","THEAD","TBODY","TFOOT","TR","DL"]),le=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 ce(t){return re.has(t.parentElement.nodeName)}class he extends zt{constructor(){super(...arguments),this.customAttributeHandler=new Vt,this.customStyleAnnotationHandler=new Gt,this.customClassAnnotationHandler=new Wt}canHandle(t,e){return"RTETextNode"===t.dtoName&&!1===e.autoMatchFormat}handle(t,e){if(ie.has(t.nodeName)&&!ae.has(t.nodeName))return{};const n=this.generateInlineHtmlAnnotation(t,Object.assign({},e));return n?{inlineHtml:n}:{}}generateInlineHtmlAnnotation(t,e){let{inlineHtml:s}=e;const r=Array.from(t.childNodes).some((t=>t.nodeType===Node.ELEMENT_NODE));if(!n.supportsHtmlTag(t.nodeName.toLowerCase())||r){const e=Object.assign(Object.assign({htmlTag:t.nodeName.toLowerCase()},r?{groupId:it()}:{}),{customAttribute:this.customAttributeHandler.handle(t).customAttribute,customStyle:this.customStyleAnnotationHandler.handle(t).customStyle,customClass:this.customClassAnnotationHandler.handle(t).customClass});s=s?this.appendToInlineHtmlChain(s,e,t.parentNode):e}return s?Object.assign({},s):null}appendToInlineHtmlChain(t,e,n){return t.child&&n&&t.child.htmlTag===n.nodeName.toLowerCase()?Object.assign(Object.assign({},t),{child:this.appendToInlineHtmlChain(t.child,e,n)}):Object.assign(Object.assign({},t),{child:e})}}const ue=new class{constructor(){this.handlers=[new Kt,new Jt,new Ut,new Qt,new ee,new te,new Xt,new qt,new Yt,new ne,new se,new Vt,new Wt,new Gt,new Zt,new he]}registerHandler(t){this.handlers.unshift(t)}generate(t,e,n={autoMatchFormat:!0}){n&&n.filterInlineStyles&&Y.executeTheStrategyRefillAction(t.dtoName,e);const s=_t.isLinkElement(e)&&"RTETextNode"===t.dtoName,r=this.handlers.filter((t=>!(!n.autoMatchFormat&&s)||t instanceof qt)).filter((r=>e.nodeType!==Node.TEXT_NODE&&r.canHandle(t,{skipCustomAnnotations:n.skipCustomAnnotations||s,autoMatchFormat:n.autoMatchFormat}))).reduce(((t,s)=>{const r=s.handle(e,n.parentAnnotations);return Object.assign(Object.assign({},t),r)}),{});this.removeTextStyleDefaultsFromCustomStyle(r);const i=Y.getStrategies(t.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=X.getDefaultStyles(e);if(!s)return t;for(const t of Object.keys(s))n[t]===s[t]&&delete n[t];return 0===Object.keys(n).length&&delete t.customStyle,t}};class de extends xt{constructor(){super(...arguments),this.annotationHandler=new Zt}generateChildNodes(t,e,s){const r=[],i=!(!s||!1!==s.autoMatchFormat),a=Object.assign({},e);return t.forEach((t=>{const o=bt.getElementToNodeStrategies().find((e=>e.canHandle([t],0,s)>0));let l=null;if(o&&(l=o.handle([t],s,a)),l)r.push(l);else if(dt(t)&&t.childNodes.length>0){const o=ue.generate(n,t,Object.assign({parentAnnotations:i?{inlineHtml:a.inlineHtml,link:a.link,code:a.code}:e},s));r.push(...this.generateChildNodes(Array.from(t.childNodes),o,s))}})),r}matchTextBlockType(t){var e;return null!==(e=this.annotationHandler.handle(t).textStyle)&&void 0!==e?e:"paragraph"}}class we extends de{canHandle(t,e){return"PRE"!==t[e].tagName&&"CODE"!==t[e].tagName||!t[e].hasAttribute("data-language")?0:1}handle(t){const e=t[0];if(e){const t=e.textContent,n=e.dataset.language;return k.from({id:it(),type:"code-block",content:t,language:n})}}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}class pe extends de{createRTEImageBlock(t,e){const n=!(e&&e.autoMatchFormat||!t.parentNode||"DIV"===t.parentNode.nodeName);return Ht.from({id:it(),type:"image",nodes:[{id:it(),type:"image",url:t.src,annotations:ue.generate(Nt,t,e)}],annotations:Object.assign(Object.assign({},ue.generate(Ht,t.parentElement,e)),{internalWrapper:n})},e)}}class me extends xt{shouldProceedToElementChildren(){return!1}appendChildBlocks(){}generateTextNode(t,e){return{id:it(),type:"text",text:t,annotations:e}}}class fe extends Q{constructor(){super(...arguments),this.stylesToBeFiltered={}}get alwaysFilter(){return!0}filterAnnotations(t){const{textAlign:e,customStyle:n}=t;return e&&n?(this.stylesToBeFiltered=_.getDefaultStyles(e),super.filterAnnotations(t)):t}}class ge extends Q{constructor(){super(...arguments),this.stylesToBeFiltered=X.getDefaultStyles("paragraph"),this.type="paragraph",this.elementTagName="p"}filterAnnotations(t){return t}canFilter(t){return Z.isTextBlock(t.dtoName)&&t.type===this.type}canRefill(t,e){const n=this.classNameToBeAdded?`.${this.classNameToBeAdded}`:this.elementTagName;return Z.isTextBlock(t)&&e.matches(n)}toCssText(){return this.buildCssTextForStyles(this.elementTagName,this.classNameToBeAdded)}}class xe extends ge{constructor(t){super(),this.type="heading-1",this.elementTagName="h1",this.type=`heading-${t}`,this.elementTagName=`h${t}`,this.stylesToBeFiltered=X.getDefaultStyles(this.type)}}class Te extends ge{constructor(t){super(),this.type="title",this.elementTagName="div",this.classNameToBeAdded="v-rte-title",this.type=t,this.classNameToBeAdded=`v-rte-${t}`,this.stylesToBeFiltered=X.getDefaultStyles(this.type)}}class be extends Q{constructor(){super(...arguments),this.stylesToBeFiltered=be.BOLD_STYLES,this.elementTagName="span",this.parentBlockTypes=["heading-1","heading-2","heading-3","heading-4","heading-5","heading-6","title"],this.parentElementSelectors=["h1","h2","h3","h4","h5","h6",".v-rte-title"],this.toBeCheckedSelector=this.parentElementSelectors.join(",")}filterAnnotations(t){return t}canFilter(t){return Z.isTextNode(t.dtoName)&&this.parentBlockIsHeadingOrTitle(t)}canRefill(t,e){return Z.isTextNode(t)&&"SPAN"===e.nodeName&&this.isHeadingOrTitleChild(e)}toCssText(){return`${this.parentElementSelectors.map((t=>`.${be.RTE_CONTENT_CONTAINER_CLASS_NAME} ${t}`)).join(",")} { ${this.convertStylesMapToCssText()} }`}parentBlockIsHeadingOrTitle(t){const e=t.parent;return!!e&&this.parentBlockTypes.includes(e.type)}isHeadingOrTitleChild(t){let e=t.parentElement;for(;e;){if(e.matches(this.toBeCheckedSelector))return!0;if(be.NON_HEADING_TITLE_ELEMENT_TAGS.includes(e.tagName))return!1;e=e.parentElement}return!1}}be.BOLD_STYLES={fontWeight:"700"},be.NON_HEADING_TITLE_ELEMENT_TAGS=["TD","TH","TR","TABLE","THEAD","TBODY","DIV","BODY"];class Oe extends xe{constructor(t){super(t),this.classNameToBeAdded=`v-rte-h${t}`,this.elementTagName="li"}canFilter(t){return Z.isListItemBlock(t.dtoName)&&this.isBlockOrNodeStylesMatchFilterStyles(t,["fontSize","lineHeight"])}canRefill(t,e){return Z.isListItemBlock(t)&&e.matches(this.elementTagName)&&e.classList.contains(this.classNameToBeAdded)}}class ye extends Te{constructor(t){super(t),this.classNameToBeAdded=`v-rte-${t}`,this.elementTagName="li"}canFilter(t){return Z.isListItemBlock(t.dtoName)&&this.isBlockOrNodeStylesMatchFilterStyles(t,["fontSize","lineHeight"])}canRefill(t,e){return Z.isListItemBlock(t)&&e.matches(this.elementTagName)&&e.classList.contains(this.classNameToBeAdded)}}tt.registerRTEDTOClass("paragraph",e),tt.registerRTEDTOClass("title",e),tt.registerRTEDTOClass("subtitle",e),tt.registerRTEDTOClass("heading-1",e),tt.registerRTEDTOClass("heading-2",e),tt.registerRTEDTOClass("heading-3",e),tt.registerRTEDTOClass("heading-4",e),tt.registerRTEDTOClass("heading-5",e),tt.registerRTEDTOClass("heading-6",e),tt.registerRTEDTOClass("heading-6",e),tt.registerRTEDTOClass("list-item",mt),tt.registerRTEDTOClass("bullet-list",gt),tt.registerRTEDTOClass("number-list",gt),tt.registerRTEDTOClass("image",Ht),tt.registerRTEDTOClass("code-block",k),tt.registerRTEDTOClass("html-block",jt),tt.registerRTEDTOClass("text",n),tt.registerRTEDTOClass("image",Nt),Ft.registerBlockBasicStrategies(e.name),Ft.registerBlockBasicStrategies(gt.name),Ft.registerBlockBasicStrategies(mt.name),Ft.registerBlockBasicStrategies(Ht.name),Ft.registerBlockBasicStrategies(jt.name),bt.registerElementToBlockStrategy(new class extends de{canHandle(t,e,n){let s=0;for(let r=e;r<t.length&&this.isInlineCandidate(t[r],n);r++)s++;return s}handle(t,s){const r=t[0].parentElement,i=s&&s.autoMatchFormat,a=this.generateChildNodes(t,i?ue.generate(n,r,Object.assign(Object.assign({},s),{skipCustomAnnotations:!0})):{},s),o=i?super.matchTextBlockType(r):this.matchTextBlockTypeByTagName(r),l=!i&&!o;return e.from(Object.assign({id:it(),type:o||"paragraph",nodes:a},l?{annotations:{internalWrapper:l}}:{annotations:ue.generate(e,r,s)}),s)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}matchTextBlockTypeByTagName(t){switch(t.nodeName){case"P":return"paragraph";default:return null}}isInlineCandidate(t,e){return t.nodeType===Node.TEXT_NODE||!!ae.has(t.nodeName)||!this.isDedicatedBlockTag(t.nodeName)&&(!(!1!==e.autoMatchFormat||!ce(t))||this.isInlineLeafOrWrapper(t))}isDedicatedBlockTag(t){return ie.has(t)&&!ae.has(t)}isInlineLeafOrWrapper(t){return 0===t.childNodes.length?le.has(t.nodeName):this.isTextOnlyElement(t)?le.has(t.nodeName)||ae.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}}),bt.registerElementToBlockStrategy(new class extends pe{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}}),bt.registerElementToBlockStrategy(new class extends pe{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(at(s))return Ht.from({id:it(),type:"image",nodes:[{id:it(),type:"image",url:s.src,annotations:ue.generate(Nt,n,e)}],annotations:ue.generate(Ht,n.parentElement,e)},e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),bt.registerElementToBlockStrategy(new class extends pe{canHandle(t,e){return"IMG"===t[e].tagName?1:0}handle(t,e){return this.createRTEImageBlock(t[0],e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),bt.registerElementToBlockStrategy(new class extends de{canHandle(t,e){return["heading-1","heading-2","heading-3","heading-4","heading-5","heading-6","title","subtitle"].includes(super.matchTextBlockType(t[e]))?1:0}handle(t,n){const s=this.generateChildNodes(Array.from(t[0].childNodes),{},n);return 0===s.length?null:e.from({id:it(),type:super.matchTextBlockType(t[0]),nodes:s,annotations:ue.generate(e,t[0],n)},n)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),bt.registerElementToBlockStrategy(new class extends de{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)?mt.from(this.generateListItemBlockDTO(n,e),e):this.generateWithListBlock(t,e)}appendChildBlocks(t,e){t.nestList=e.filter((t=>["bullet-list","number-list"].includes(t.type)))}shouldProceedToElementChildren(){return!0}generateWithListBlock(t,e){return gt.from({id:it(),type:"bullet-list",blocks:t.map((t=>this.generateListItemBlockDTO(t,e)))},e)}generateListItemBlockDTO(t,e){return{id:it(),type:"list-item",annotations:ue.generate(mt,t,e),nodes:this.generateChildNodes(Array.from(t.childNodes.length?t.childNodes:[t]).filter((t=>!["UL","OL"].includes(t.nodeName))),ue.generate(n,t,Object.assign(Object.assign({},e),{skipCustomAnnotations:!0})),e)}}}),bt.registerElementToBlockStrategy(new class extends de{canHandle(t,e){const n=t[e],s=n.parentElement,r="LI"!==n.nodeName,i=n.nodeType===Node.TEXT_NODE&&""===n.textContent.trim(),a=at(s)&&["UL","OL"].includes(s.nodeName);return r&&!i&&a?1:0}handle(t,e){const n=this.generateChildNodes(t,{},e);return mt.from({id:it(),type:"list-item",nodes:n,annotations:{}},e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),bt.registerElementToBlockStrategy(new class extends de{canHandle(t,e){return"OL"===t[e].tagName?1:0}handle(t,e){return 0===t[0].childNodes.length?null:gt.from({id:it(),type:"number-list",blocks:[],annotations:ue.generate(gt,t[0],e)},e)}appendChildBlocks(t,e){t.children=e.filter((t=>t instanceof mt)),e.forEach((e=>e.parent=t))}shouldProceedToElementChildren(){return!0}}),bt.registerElementToBlockStrategy(new class extends de{canHandle(t,e){return"UL"===t[e].tagName?1:0}handle(t,e){return 0===t[0].childNodes.length?null:gt.from({id:it(),type:"bullet-list",blocks:[],annotations:ue.generate(gt,t[0],e)},e)}appendChildBlocks(t,e){t.children=e.filter((t=>t instanceof mt)),e.forEach((e=>e.parent=t))}shouldProceedToElementChildren(){return!0}}),bt.registerElementToBlockStrategy(new class extends de{canHandle(t,e,n){const s=t[e];return s.nodeType===Node.TEXT_NODE||this.isInlineTagWithoutBlockChildren(s,n)||ie.has(s.nodeName)&&!this.shouldFallBackToHtmlBlock(s)||n.autoMatchFormat||!this.isCustomHtmlContainer(s)||_t.isTitleOrSubtitle(s)?0:1}handle(t,e){return jt.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(ce(t))return!(0===t.childNodes.length&&""===t.textContent&&!ae.has(t.nodeName)&&!le.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||!oe.has(t.parentElement.nodeName)&&(le.has(t.nodeName)||ae.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&&!ae.has(t.nodeName)&&!le.has(t.nodeName)))}isCustomHtmlContainer(t){return"DIV"!==t.nodeName||t.childNodes.length>0&&"IMG"!==t.childNodes[0].nodeName}generateHtmlBlock(t,e){return{id:it(),type:"html-block",htmlTag:t.nodeName.toLowerCase(),annotations:ue.generate(jt,t,e),children:[]}}}),
|
|
2
|
+
//!important: Code block strategies must be registered after HtmlBlockStrategy because registerElementToBlockStrategy uses unshift, giving later registrations higher priority.
|
|
3
|
+
bt.registerElementToBlockStrategy(new we),bt.registerElementToBlockStrategy(new class extends we{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}}),bt.registerElementToNodeStrategy(new class extends me{canHandle(t,e){const n=t[e];return!dt(n)||"BR"!==n.nodeName&&0!==n.childNodes.length?0:1}handle(t,e,s){const r=!(!e||!1!==e.autoMatchFormat),i=Object.assign({},s),a=t[0],o=ue.generate(n,a,Object.assign({parentAnnotations:r?{inlineHtml:i.inlineHtml,link:i.link,code:i.code}:s},e));if("BR"===a.nodeName)return this.generateTextNode("\n",o);if(0===a.childNodes.length){const t=r?wt(Object.assign(Object.assign({},n.supportsHtmlTag(a.nodeName.toLowerCase())?o:{}),{inlineHtml:o.inlineHtml})):o;return Object.assign({},this.generateTextNode("",t))}}}),bt.registerElementToNodeStrategy(new class extends me{canHandle(t,e){return t[e].nodeType===Node.TEXT_NODE?1:0}handle(t,e,s){const r=Object.assign({},s),i=!(!e||!1!==e.autoMatchFormat),a=t[0],o=a.parentNode.nodeName.toLowerCase(),l=i&&!n.supportsHtmlTag(o),c=this.generateTextNode(String(a.textContent),i?wt(Object.assign(Object.assign({},"span"===o?r:{link:r.link,code:"code"===o?r.code:void 0}),{inlineHtml:r.inlineHtml,plainText:l||void 0})):r);return Object.assign({},c)}}),Y.register(e.dtoName,new fe),Y.register(gt.dtoName,new fe),Y.register(mt.dtoName,new fe),Y.register(n.dtoName,new class extends Q{constructor(){super(...arguments),this.stylesToBeFiltered={}}get alwaysFilter(){return!0}filterAnnotations(t){const e=t,n=e.customStyle;if(!n)return t;e.bold&&n.fontWeight===z&&delete n.fontWeight,e.italic&&n.fontStyle===G&&delete n.fontStyle;const s=this.normalizeTextDecoration(n.textDecoration);return s&&this.shouldRemoveTextDecoration(s,e)&&delete n.textDecoration,0===Object.keys(n).length&&delete e.customStyle,t}normalizeTextDecoration(t){if(!t)return;const e=t.trim().toLowerCase().split(/\s+/);return e.some((t=>t!==K&&t!==J))?void 0:Array.from(new Set(e)).sort().join(" ")}shouldRemoveTextDecoration(t,e){const n=[];return e.underline&&n.push(K),e.strikethrough&&n.push(J),0!==n.length&&t===n.sort().join(" ")}}),Y.register(e.dtoName,new ge),Y.register(e.dtoName,new xe(1)),Y.register(e.dtoName,new xe(2)),Y.register(e.dtoName,new xe(3)),Y.register(e.dtoName,new xe(4)),Y.register(e.dtoName,new xe(5)),Y.register(e.dtoName,new xe(6)),Y.register(e.dtoName,new Te("title")),Y.register(e.dtoName,new Te("subtitle")),Y.register(n.dtoName,new be),Y.register(n.dtoName,new class extends Q{constructor(){super(...arguments),this.stylesToBeFiltered=q.getDefaultStyles(),this.elementTagName="code"}filterAnnotations(t){const{code:e,customStyle:n}=t;return e&&n?super.filterAnnotations(t):t}canFilter(t){return Z.isCodeNode(t)}canRefill(t,e){return Z.isTextNode(t)&&e.matches(this.elementTagName)}toCssText(){return`.${Q.RTE_CONTENT_CONTAINER_CLASS_NAME} ${this.elementTagName} { ${this.convertStylesMapToCssText(Object.assign(Object.assign({},this.stylesToBeFiltered),{fontWeight:"500"}))} }`}}),Y.register(n.dtoName,new et),Y.register(Nt.dtoName,new class extends Q{constructor(){super(...arguments),this.stylesToBeFiltered=kt.getDefaultStyles(),this.elementTagName="img"}get alwaysFilter(){return!0}canFilter(t){return Z.isImageNode(t)}canRefill(t,e){return e.tagName.toLowerCase()===this.elementTagName}toCssText(){return this.buildCssTextForStyles(this.elementTagName,this.classNameToBeAdded)}}),Y.register(k.dtoName,new nt),Y.register(st.dtoName,new rt),Y.register(gt.dtoName,new class extends Q{constructor(){super(...arguments),this.stylesToBeFiltered=ft.getDefaultStyles(),this.elementTagName="ol,ul"}canFilter(t){return Z.isListBlock(t.dtoName)}canRefill(t,e){return Z.isListBlock(t)&&e.matches(this.elementTagName)}toCssText(){return`${this.elementTagName.split(",").map((t=>`.${Q.RTE_CONTENT_CONTAINER_CLASS_NAME} ${t.trim()}`)).join(", ")} { ${this.convertStylesMapToCssText(this.stylesToBeFiltered)} }`}}),Y.register(mt.dtoName,new class extends Q{constructor(){super(...arguments),this.stylesToBeFiltered=X.getDefaultStyles("paragraph"),this.elementTagName="li",this.headingOrTitleClassNamePattern=/^v-rte-(h[1-6]|title|subtitle)$/}canFilter(t){const e=!t.getStyles().fontSize||this.isBlockOrNodeStylesMatchFilterStyles(t,["fontSize","lineHeight"]);return Z.isListItemBlock(t.dtoName)&&e}canRefill(t,e){return Z.isListItemBlock(t)&&e.matches(this.elementTagName)&&this.isElementNotHeadingOrTitle(e)}toCssText(){return this.buildCssTextForStyles(this.elementTagName)}isElementNotHeadingOrTitle(t){return!t.className.split(" ").some((t=>this.headingOrTitleClassNamePattern.test(t.trim())))}}),Y.register(mt.dtoName,new Oe(1)),Y.register(mt.dtoName,new Oe(2)),Y.register(mt.dtoName,new Oe(3)),Y.register(mt.dtoName,new Oe(4)),Y.register(mt.dtoName,new Oe(5)),Y.register(mt.dtoName,new Oe(6)),Y.register(mt.dtoName,new ye("title")),Y.register(mt.dtoName,new ye("subtitle"));class Ee{static preserve(t){const e=t.replace(/\s+style=/g," data-style=");return new Ae(e)}}class Ae{constructor(t){this.processedHtml=t}getProcessedHtml(){return this.processedHtml}restore(t){this.walkNodes(t)}walkNodes(t){t.forEach((t=>{if(dt(t)){const e=t.getAttribute("data-style");e&&(t.style.cssText=e,t.removeAttribute("data-style")),t.children.length>0&&this.walkNodes(Array.from(t.children))}}))}}class ke{process(t){return t.replace(/(<[^>]+>)(\s+)(<[^>]+>)/g,((t,e,n,s)=>{const r=this.extractOpeningTagName(e),i=this.extractClosingTagName(s);return r&&i&&r===i?`${e}${n}${s}`:`${e}${s}`}))}extractOpeningTagName(t){const e=t.match(/<(\w[\w-]*)/);return e?e[1]:null}extractClosingTagName(t){const e=t.match(/<\/(\w[\w-]*)/);return e?e[1]:null}}class Ne{process(t){return t.replace(/(>)[\n\t]+(?=.)/g,"$1")}}class Ce{process(t){return t.replace(/(.?)[\n\t]+(?=<)/g,"$1")}}class He{constructor(){this.processors=[new ke,new Ne,new Ce]}clean(t){if(!t||0===t.trim().length)return t;let e,n=t;do{e=n;for(const t of this.processors)n=t.process(n)}while(n!==e);return n}}class je{constructor(t){this.dtoName=je.dtoName,t.forEach((t=>{t.parent=this})),this.children=t}static fromJSON(t,e={autoMatchFormat:!0}){const n=t.map((t=>{const n=tt.getRTEBlockClass(t.type);if(n)return n.from(t,e);throw new Error(`[Vega] Unknown block type: ${t.type}`)}));return new je(n)}static createEmptyContent(t={autoMatchFormat:!0}){return je.fromJSON([{id:it(),type:"paragraph",annotations:{internalWrapper:!t.autoMatchFormat},nodes:[{id:it(),annotations:{plainText:!t.autoMatchFormat},type:"text",text:""}]}],t)}static fromHtml(t,e={autoMatchFormat:!0,skipCustomAnnotations:!1}){const n=(new He).clean(t),s=Ee.preserve(n),r=s.getProcessedHtml(),i=(new DOMParser).parseFromString(r,"text/html").body,a=Array.from(i.childNodes);s.restore(a);const o=Ot.process(a,e).filter(at).map((t=>t.toDto(e))).filter(at);return new je(o)}static generateContentStyles(t){return Y.generateAllStylesContent(null==t?void 0:t.enableFontImports)}clone(t=!1){return new je(t?this.children.map((t=>t.clone(this))):[...this.children])}toJSON(){return this.children.map((t=>t.toJSON()))}toHtml(t){return t&&(at(t.autoMatchFormat)||at(t.skipCustomAnnotations))&&pt.warn("The 'options' parameter's properties 'autoMatchFormat' and 'skipCustomAnnotations' in toHtml method are deprecated and will be removed in the future."),this.isEmpty()?"":this.children.map((e=>e.toHtml({filterInlineStyles:null==t?void 0:t.filterInlineStyles}))).join("")}isEmpty(){return 0===this.children.length||1===this.children.length&&!this.children[0].isNotEmpty()}apply(t){if(r.executeTheStrategy(t,this),t.executedFlag&&t.isFlushable){const t=N.getDOMByEntity(this);t&&ot.notify(lt.getSubject(t,ht),{})}}getLastNode(){return 0===this.children.length?null:this.children[this.children.length-1].getLastNode()}toListItem(t){t.children.map((t=>t.apply(new g)));const e=new mt(it());return e.apply(new s(t.children)),e.annotationMap=t.annotationMap,e}createList(t){return new gt(it(),t)}findNodeById(t){return this.findNodeInBlocksById(t,this.children)}findNodeInBlocksById(t,e){for(const n of e){if("children"in n)for(const e of n.children)if(e.id===t)return e;if(n instanceof mt&&n.nestList)for(const e of n.nestList){const n=this.findNodeInBlocksById(t,e.children);if(n)return n}if(n instanceof gt&&n.children){const e=this.findNodeInBlocksById(t,n.children);if(e)return e}}return null}}r.register(c.DELETE_CHILDREN,je.name,new P),r.register(c.APPEND_CHILDREN,je.name,new yt),r.register(c.INSERT_CHILDREN_BEFORE,je.name,new Et),r.register(c.INSERT_CHILDREN_AFTER,je.name,new At),r.register(c.TRANSFORM_TO_CODE_BLOCK,je.name,new class extends t{handleAction(t,e){const n=t.selectedBlocks,s=new k(it(),this.getCodeContent(n),"plainText");e.apply(new x(n[0],s)),t.newCodeBlock=s,this.removeSelectBlocks(n,e)}getCodeContent(t){return t.filter((t=>"image"!==t.type&&"list-item"!==t.type)).map((t=>t.children.map((t=>t.text)).join(""))).join("\n")}removeSelectBlocks(t,e){for(let n=0;n<t.length;n++)e.apply(new f(t[n]))}}),r.register(c.UPDATE_CURSOR_POSITION,je.name,new class extends t{handleAction(t,e){const{offset:n,nextFocusNode:s,immediatelyRun:r}=t,i=N.getDOMByEntity(e);i&&ot.notify(lt.getSubject(i,ct),{node:s,offset:n,updateDirectly:r})}}),je.dtoName="VegaRTEContent";export{zt as A,de as B,bt as E,Ct as I,Bt as M,Pt as P,Ft as R,Ee as S,It as U,je as V,xt as a,Ht as b,Et as c,mt as d,gt as e,Nt as f,kt as g,ue as h,Ot as i}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as e,F as t,H as i,r as o,c as a,g as r}from"./p-6b2342e0.js";import{R as s}from"./p-280cbcdb.js";import{g as n,s as d}from"./p-519a7d55.js";import{Z as p,_ as l}from"./p-f7ad9349.js";import{c,M as h,V as f,I as b}from"./p-6e1ab235.js";import{V as m,I as v}from"./p-8ce9e214.js";import{F as g}from"./p-518e0a24.js";import{C as x}from"./p-7292ac20.js";import{c as u}from"./p-6629a68b.js";import{q as w,x as y,V as j,g as R,i as I,r as C}from"./p-05dc6718.js";import{F as k}from"./p-a528714c.js";import{C as O}from"./p-2d0d575f.js";import{c as D}from"./p-3a620268.js";import{D as S}from"./p-11e2dcf5.js";import{l as z}from"./p-3a93730e.js";import{h as E,l as A}from"./p-f0e828d8.js";import{K as V}from"./p-ffda64ac.js";import{f as L}from"./p-ec2a1d4c.js";import{M as T}from"./p-78a57a17.js";import{T as F}from"./p-52b8f2d2.js";import"./p-abd7aeaa.js";import"./p-ed45b3b6.js";import"./p-d4ea8e22.js";import"./p-d884c644.js";import"./p-fea75b87.js";import"./p-02841589.js";import"./p-331a62d5.js";import"./p-8b5d3a52.js";import"./p-6a334573.js";import"./p-81dd00d0.js";import"./p-49a2e141.js";import"./p-b75ee3ba.js";import"./p-d27ae9ff.js";import"./p-262ec334.js";import"./p-10fa27d2.js";import"./p-c84aa55a.js";import"./p-5f377954.js";import"./p-dcf162e9.js";import"./p-982747ef.js";import"./p-8ee917b4.js";const _=[{payloadKey:"AUTO_VALIDATION_IS_TRUE",payloadDescription:"Determines whether automatic validation should be implemented when a value is edited in the combo box",payloadValue:e=>!0===e.autoValidation},{payloadKey:"AUTO_VALIDATION_IS_FALSE",payloadDescription:"Determines whether automatic validation should be implemented when a value is edited in the combo box",payloadValue:e=>!1===e.autoValidation}];var K=function(e,t,i,o){var a,r=arguments.length,s=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,o);else for(var n=e.length-1;n>=0;n--)(a=e[n])&&(s=(r<3?a(s):r>3?a(t,i,s):a(t,i))||s);return r>3&&s&&Object.defineProperty(t,i,s),s};class N extends f{constructor(){super(...arguments),this.onItemClick=async()=>{this.valueController.setValue(await this.dropdownRef.getSelection()),await this.clearInput()},this.onDropdownHide=async()=>{await this.clearInput()},this.onDropdownCreate=async e=>{this.createEventEmit.emit(e),await this.clearInput()},this.onInputChange=async e=>{const t=e.target.value;(this.useDefaultFilter||this.vegaDropdownProps.dynamicOption)&&(await this.dropdownRef.show(),await this.dropdownRef.search(t)),!this.isTemplateMode&&this.useDefaultFilter||this.searchEventEmit.emit(t)}}connectedCallback(){this.isTemplateMode=null!==this.host.querySelector("[slot=items]")}getDropdownRef(){return this.dropdownRef}getSearchInputRef(){return this.searchInputRef}focusInput(){this.searchInputRef.focus()}async hide(){await this.dropdownRef.hide()}async show(){await this.dropdownRef.show()}replaceItemsSlot(e){e&&this.itemsSlotRef&&(this.itemsSlotRef.remove(),this.dropdownRef.append(e))}renderDropdown(){return e("vega-dropdown",Object.assign({trigger:this.disabled?"none":"click",source:this.source,selectType:"multiple",selectedSourceKey:this.value,matchTargetWidth:!0,useDefaultFilter:this.useDefaultFilter},this.vegaDropdownProps,{ref:e=>{this.dropdownRef=e,S.addUniqueObserverToNode(e,w,(async e=>{await this.onDropdownCreate(e.detail)})),S.addUniqueObserverToNode(e,y,(async()=>{await this.onDropdownHide()})),S.addUniqueObserverToNode(e,j,(async()=>{await this.onItemClick()})),S.addUniqueObserverToNode(e,z,(e=>{const t=Array.from(e).filter((e=>!this.source.find((t=>t.key===e.itemKey)))).map((e=>({key:e.itemKey,label:e.label})));this.sourceController.setSource([...this.source,...t])}))}}),this.renderContainer(),this.renderItemsSlot())}renderContainer(){return e("div",{class:{"vega-combo-box-container":!0,[`vega-combo-box-size-${this.size}`]:!0}},this.renderSelectedContainer(),this.renderInputContainer())}renderItemsSlot(){return this.isTemplateMode&&e("div",{slot:"items",ref:e=>{this.itemsSlotRef=e}})}renderSelectedContainer(){const i=this.value.map((e=>this.source.find((t=>t.key===e)))).filter((e=>e));return e(t,null,i.map((e=>this.renderSelectedChip(e))))}renderSelectedChip(t){return e("vega-chip",{key:t.key,text:E.sanitize(t.label,A),variant:"outlined",showCloseIcon:!this.disabled,size:"small",ref:e=>{S.addUniqueObserverToNode(e,R,(async()=>{await this.onChipClose(t.key)}))}})}renderInputContainer(){return e("div",{class:"vega-combo-box-input-container"},e("input",{onInput:this.onInputChange,"aria-label":this.label||"No label defined",placeholder:0===this.value.length?this.placeholder:"",ref:e=>this.searchInputRef=e,onKeyDown:D(),disabled:this.disabled}))}async onChipClose(e){this.valueController.setValue([...this.value.filter((t=>t!==e))]),await this.dropdownRef.hide()}async clearInput(){this.searchInputRef.value="",await this.dropdownRef.search("")}}K([c()],N.prototype,"host",void 0),K([c()],N.prototype,"value",void 0),K([c()],N.prototype,"source",void 0),K([c()],N.prototype,"disabled",void 0),K([c()],N.prototype,"size",void 0),K([c()],N.prototype,"vegaDropdownProps",void 0),K([c()],N.prototype,"label",void 0),K([c()],N.prototype,"placeholder",void 0),K([c()],N.prototype,"useDefaultFilter",void 0),K([c()],N.prototype,"createEventEmit",void 0),K([c()],N.prototype,"searchEventEmit",void 0),K([c()],N.prototype,"valueController",void 0),K([c()],N.prototype,"sourceController",void 0),K([h("connectedCallback")],N.prototype,"connectedCallback",null);class q extends f{setValue(e){this.value=e}}!function(e,t,i,o){var a,r=arguments.length,s=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,o);else for(var n=e.length-1;n>=0;n--)(a=e[n])&&(s=(r<3?a(s):r>3?a(t,i,s):a(t,i))||s);r>3&&s&&Object.defineProperty(t,i,s)}([c({writable:!0})],q.prototype,"value",void 0);var G=function(e,t,i,o){var a,r=arguments.length,s=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,o);else for(var n=e.length-1;n>=0;n--)(a=e[n])&&(s=(r<3?a(s):r>3?a(t,i,s):a(t,i))||s);return r>3&&s&&Object.defineProperty(t,i,s),s};class H extends f{constructor(){super(...arguments),this.onLabelClick=()=>{this.dropdownRenderer.focusInput()}}render(){return e(i,{class:{"vega-combo-box-disabled":this.disabled}},this.renderLabel(),this.dropdownRenderer.renderDropdown(),this.renderHint())}renderLabel(){return e("vega-field-label",{onClick:this.onLabelClick,"is-field-required":this.required,disabled:this.disabled,optional:this.optional,label:this.label})}renderHint(){return e("div",{class:"vega-combo-box-hint"},this.hint)}}G([c()],H.prototype,"required",void 0),G([c()],H.prototype,"optional",void 0),G([c()],H.prototype,"hint",void 0),G([c()],H.prototype,"disabled",void 0),G([c()],H.prototype,"dropdownRenderer",void 0),G([c()],H.prototype,"label",void 0);var M=function(e,t,i,o){var a,r=arguments.length,s=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,o);else for(var n=e.length-1;n>=0;n--)(a=e[n])&&(s=(r<3?a(s):r>3?a(t,i,s):a(t,i))||s);return r>3&&s&&Object.defineProperty(t,i,s),s};class P extends V{constructor(){super((e=>[{keyCode:"Backspace",activeElementInScope:[e.dropdownRenderer.getSearchInputRef()],eventName:"keydown",callback:e.deleteLastSelectedItem},{keyCode:"ArrowLeft",activeElementInScope:[e.host],callback:()=>e.controlDirectionByKeyboard("ArrowLeft")},{keyCode:"ArrowRight",activeElementInScope:[e.host],callback:()=>e.controlDirectionByKeyboard("ArrowRight")}])),this.deleteLastSelectedItem=()=>{""===this.dropdownRenderer.getSearchInputRef().value&&(this.value.pop(),this.valueController.setValue([...this.value]))}}controlDirectionByKeyboard(e){const t=n();if(t&&t.classList.contains("vega-chip-close-icon")){const i=L(t,"vega-chip");"ArrowLeft"===e&&this.focusItemByKeyboard(i.previousSibling),"ArrowRight"===e&&this.focusItemByKeyboard(i.nextSibling)}else"ArrowLeft"===e&&0===this.dropdownRenderer.getSearchInputRef().selectionStart&&this.focusItemByKeyboard(this.host.shadowRoot.querySelector("vega-chip:last-of-type"))}focusItemByKeyboard(e){e&&(e.classList.contains("vega-combo-box-input-container")?e.querySelector("input").focus():e.shadowRoot.querySelector(".vega-chip-close-icon").focus())}}M([c()],P.prototype,"host",void 0),M([c()],P.prototype,"value",void 0),M([c()],P.prototype,"dropdownRenderer",void 0),M([c()],P.prototype,"valueController",void 0);var U=function(e,t,i,o){var a,r=arguments.length,s=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,o);else for(var n=e.length-1;n>=0;n--)(a=e[n])&&(s=(r<3?a(s):r>3?a(t,i,s):a(t,i))||s);return r>3&&s&&Object.defineProperty(t,i,s),s};class B extends f{constructor(){super(...arguments),this.mutationObserver=new T({mutationFilter:F("VEGA-DROPDOWN-ITEM"),options:{childList:!0,subtree:!0},callback:()=>this.appendHostItemsToDropdown()})}componentDidLoad(){this.appendHostItemsToDropdown()}appendHostItemsToDropdown(){this.dropdownRenderer.replaceItemsSlot(this.host.querySelector("[slot=items]"))}}U([b()],B.prototype,"mutationObserver",void 0),U([c()],B.prototype,"host",void 0),U([c()],B.prototype,"dropdownRenderer",void 0),U([h("componentDidLoad")],B.prototype,"componentDidLoad",null);class W extends f{setSource(e){this.source=e}}!function(e,t,i,o){var a,r=arguments.length,s=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,o);else for(var n=e.length-1;n>=0;n--)(a=e[n])&&(s=(r<3?a(s):r>3?a(t,i,s):a(t,i))||s);r>3&&s&&Object.defineProperty(t,i,s)}([c({writable:!0})],W.prototype,"source",void 0);var Z=function(e,t,i,o){var a,r=arguments.length,s=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,o);else for(var n=e.length-1;n>=0;n--)(a=e[n])&&(s=(r<3?a(s):r>3?a(t,i,s):a(t,i))||s);return r>3&&s&&Object.defineProperty(t,i,s),s};const $=class{constructor(e){o(this,e),this.vegaChange=a(this,"vegaChange",7),this.change=a(this,"change",7),this.vegaCreate=a(this,"vegaCreate",7),this.create=a(this,"create",7),this.vegaSearch=a(this,"vegaSearch",7),this.search=a(this,"search",7),this.globalSlimmers={},this.itemsSlotController=new B,this.keyboardController=new P,this.valueController=new q,this.sourceController=new W,this.renderer=new H,this.dropdownRenderer=new N,this.formFieldController=new g({propertyRules:[{propertyName:"required",ruleFactory:e=>e?new s:null}],validationRulesName:"validationRules",defaultValue:[],attributeGetter:e=>this[e],inputContainerGetter:()=>this.dropdownRenderer.getDropdownRef(),touchableAreaGetter:()=>[this.dropdownRenderer.getSearchInputRef()]}),this.changeEventEmit=u($,I),this.createEventEmit=u($,w),this.searchEventEmit=u($,C),this.dropdownEventPrevent=new x([w,C],(()=>this.dropdownRenderer.getDropdownRef()),{customPreventHandle:e=>{e.stopImmediatePropagation()}}),this.vegaComponentUsageRuntimeMetricsSlimmer=new m(_),this.label="",this.required=!1,this.optional=!1,this.source=[],this.value=[],this.isValid=null,this.autoValidation=!0,this.validationRules=[],this.disabled=!1,this.placeholder="",this.hint="",this.size="medium",this.vegaDropdownProps={},this.useDefaultFilter=!0}watchSource(){this.source=p(this.source,l)?this.source:[]}watchValue(){this.changeEventEmit.emit(this.value),O.notify(k,{host:this.host,detail:this.value})}watchValidationRules(){}async close(){this.disabled||await this.dropdownRenderer.hide()}async open(){this.disabled||await this.dropdownRenderer.show()}render(){return d(this.renderer.render(),this.host)}get host(){return r(this)}static get watchers(){return{source:["watchSource"],value:["watchValue"],validationRules:["watchValidationRules"]}}};Z([v()],$.prototype,"globalSlimmers",void 0),Z([b()],$.prototype,"itemsSlotController",void 0),Z([b()],$.prototype,"keyboardController",void 0),Z([b()],$.prototype,"valueController",void 0),Z([b()],$.prototype,"sourceController",void 0),Z([b()],$.prototype,"renderer",void 0),Z([b()],$.prototype,"dropdownRenderer",void 0),Z([b()],$.prototype,"formFieldController",void 0),Z([b()],$.prototype,"changeEventEmit",void 0),Z([b()],$.prototype,"createEventEmit",void 0),Z([b()],$.prototype,"searchEventEmit",void 0),Z([b()],$.prototype,"dropdownEventPrevent",void 0),Z([b()],$.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),$.style=':host{display:inline-block;width:100%;min-width:0px;text-align:left;line-height:normal}.vega-combo-box-container{border:1px solid rgba(var(--v-border-input-field, 171, 198, 216, 1));background-color:rgba(var(--v-bg-primary, 252, 252, 252, 1));padding-left:16px;padding-right:16px;padding-top:12px;padding-bottom:12px;border-radius:8px;gap:8px;display:block;display:flex;flex-wrap:wrap;align-items:center;cursor:pointer}.vega-combo-box-container:hover{border:1px solid rgba(var(--v-border-input-field-hover, 115, 160, 190, 1))}.vega-combo-box-container:focus-within{border:1px solid rgba(var(--v-border-input-field-focus, 19, 98, 226, 1));outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:2px}.vega-combo-box-container .vega-combo-box-input-container{width:-webkit-min-content;width:-moz-min-content;width:min-content;flex-grow:1}.vega-combo-box-container input{border-style:none;background-color:rgba(var(--v-bg-transparent, 0, 0, 0, 0));font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px;color:rgba(var(--v-text-primary, 32, 54, 69, 1));width:100%}@media screen and (min-width: 768px) and (max-width: 1023px){.vega-combo-box-container input{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.vega-combo-box-container input{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.vega-combo-box-container input{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}.vega-combo-box-container input:focus{outline:2px solid transparent;outline-offset:2px}.vega-combo-box-size-medium{padding-left:12px;padding-right:12px;padding-top:11px;padding-bottom:11px}.vega-combo-box-size-small{padding-left:12px;padding-right:12px;padding-top:7px;padding-bottom:7px}.vega-combo-box-container:focus{outline:none}vega-field-label{margin-bottom:8px}.error .vega-combo-box-container{border:1px solid rgba(var(--v-border-input-field-danger, 230, 50, 87, 1))}.error .vega-combo-box-container:hover{border:1px solid rgba(var(--v-border-input-field-danger-hover, 255, 87, 114, 1))}.error .vega-combo-box-container:focus-within{border:1px solid rgba(var(--v-border-input-field-danger-focus, 233, 71, 104, 1));outline:2px solid rgba(var(--v-border-color-danger, 230, 50, 87, 1));outline-offset:2px}:host(.vega-combo-box-disabled) .vega-combo-box-container{border:1px solid rgba(var(--v-border-input-field-disabled, 222, 225, 227, 1));background-color:rgba(var(--v-bg-secondary, 245, 247, 247, 1));--tw-shadow:0 0 #0000;box-shadow:rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0) 0px 0px 0px 0px}:host(.vega-combo-box-disabled) .vega-combo-box-container:hover{border:1px solid rgba(var(--v-border-input-field-disabled, 222, 225, 227, 1))}:host(.vega-combo-box-disabled) vega-icon{color:rgba(var(--v-text-disabled, 176, 180, 181, 1))}.vega-combo-box-container input::placeholder{color:rgba(var(--v-text-input-placeholder, 176, 180, 181, 1))}.vega-error{display:inline-block;padding-left:8px;padding-right:8px;padding-top:8px;font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px;color:rgba(var(--v-text-error, 189, 41, 71, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){.vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}.vega-hidden{display:none}.vega-combo-box-hint{padding-left:8px;padding-right:8px;font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px;color:rgba(var(--v-text-secondary, 107, 116, 125, 1));padding-top:8px}@media screen and (min-width: 768px) and (max-width: 1023px){.vega-combo-box-hint{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.vega-combo-box-hint{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.vega-combo-box-hint{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}.vega-error:not(.vega-hidden)+.vega-combo-box-hint{padding-top:4px}vega-dropdown{display:block}';export{$ as vega_combo_box}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{C as t}from"./p-2d0d575f.js";import{d as e}from"./p-11e2dcf5.js";import{d as s,e as n}from"./p-3a93730e.js";import{d as r,c as i}from"./p-02841589.js";import{L as o}from"./p-6e1ab235.js";import{i as a}from"./p-f7ad9349.js";import{T as c}from"./p-d884c644.js";import{g as l}from"./p-8b5d3a52.js";import{V as h}from"./p-b565a6a5.js";import{c as u}from"./p-a841cf13.js";import{f as d}from"./p-ec2a1d4c.js";var p,f;!function(t){t.SELECTION_RANGE="SELECTION_RANGE",t.CLEAR_FORMATTING="CLEAR_FORMATTING",t.LINK_GROUP="LINK_GROUP"}(p||(p={}));class g{}!function(t){t.ALIGNMENT="ALIGNMENT",t.TEXT_STYLE="TEXT_STYLE",t.INDENT="INDENT",t.LIST="LIST",t.INTERNAL_WRAPPER="INTERNAL_WRAPPER"}(f||(f={}));class x extends g{}const w=new class{constructor(){this.domToEntity=new WeakMap,this.entityToDOM=new WeakMap,this.contentEntityToRootDom=new Map,this.rootDomToContentEntity=new WeakMap}register(t,e){this.isVegaRTEContent(e)?this.registerRootDomAndContentEntity(t,e):(this.domToEntity.set(t,e),this.entityToDOM.set(e,t))}getEntityByDOM(t){return this.domToEntity.get(t)}getDOMByEntity(t){return this.isVegaRTEContent(t)?this.contentEntityToRootDom.get(t):this.entityToDOM.get(t)}removeDirtyDomRef(t){this.domToEntity.delete(t)}registerRootDomAndContentEntity(t,e){const s=this.rootDomToContentEntity.get(t);s&&s!==e&&this.contentEntityToRootDom.delete(s),this.rootDomToContentEntity.set(t,e),this.contentEntityToRootDom.set(e,t)}isVegaRTEContent(t){return t&&"VegaRTEContent"===t.dtoName}};var A,O,y,m;!function(t){t.DELETE_CHILDREN="DELETE_CHILDREN",t.DELETE_NEST_LIST="DELETE_NEST_LIST",t.UPDATE_TEXT="UPDATE_TEXT",t.REPLACE_SELECTED_TEXT="REPLACE_SELECTED_TEXT",t.APPEND_CHILDREN="APPEND_CHILDREN",t.INSERT_CHILDREN_AFTER="INSERT_CHILDREN_AFTER",t.INSERT_CHILDREN_BEFORE="INSERT_CHILDREN_BEFORE",t.SPLIT_BLOCK_WITH_NODE="SPLIT_BLOCK_WITH_NODE",t.REPLACE_CHILD_NODES="REPLACE_CHILD_NODES",t.REPLACE_NEST_LIST="REPLACE_NEST_LIST",t.MERGE_TWO_BLOCKS_NODES="MERGE_TWO_BLOCKS_NODES",t.INSERT_NEW_PARAGRAPH="INSERT_NEW_PARAGRAPH",t.LINE_BREAK_SINGLE_BLOCK="LINE_BREAK_SINGLE_BLOCK",t.LINE_BREAK_MULTIPLE_BLOCKS="LINE_BREAK_MULTIPLE_BLOCKS",t.TRANSFORM_LIST_BLOCK="TRANSFORM_LIST_BLOCK",t.TRANSFORM_PARAGRAPH_BLOCK="TRANSFORM_PARAGRAPH_BLOCK",t.DELETE_BLOCK_CONTENT="DELETE_BLOCK_CONTENT",t.INSERT_IMAGE_TO_BLOCK="INSERT_IMAGE_TO_BLOCK",t.UPDATE_IMAGE_NODE_URL="UPDATE_IMAGE_NODE_URL",t.TRANSFORM_TO_CODE_BLOCK="TRANSFORM_TO_CODE_BLOCK",t.UPDATE_CODE_BLOCK="UPDATE_CODE_BLOCK",t.SWITCH_OUT_FROM_CODE_BLOCK="SWITCH_OUT_FROM_CODE_BLOCK",t.DELETE_CODE_BLOCK="DELETE_CODE_BLOCK",t.UNLINK_LINK_GROUP="UNLINK_LINK_GROUP",t.LINK_GROUP_NODE_SPLIT="LINK_GROUP_NODE_SPLIT",t.DELETE_LINK_GROUP="DELETE_LINK_GROUP",t.UPDATE_CURSOR_POSITION="UPDATE_CURSOR_POSITION",t.INSERT_TEXT_TO_DECORATOR_NODE="INSERT_TEXT_TO_DECORATOR_NODE",t.INSERT_NODE_TO_NEAREST_ROOT="INSERT_NODE_TO_NEAREST_ROOT",t.PASTE_CONTENT="PASTE_CONTENT"}(A||(A={}));class E{constructor(){this.isFlushable=!1}}function S(t){const e=t.getAttribute("style");return e?e.split(";").filter(Boolean).filter((t=>" "!==t)).map((t=>{const e=t.replace(/(['"])(.*?)\1/g,"$2").split(":");return{[r(e[0].trim())]:e[1].trim().replace(";","")}})).reduce(((t,e)=>Object.assign(Object.assign({},t),e)),{}):{}}class T{constructor(){this.classNameToBeAdded=""}filterAnnotations(t){const e=t.customStyle;return e?(this.extractAndDeleteMatchedStyles(e),0===Object.keys(e).length&&delete t.customStyle,t):t}filterAndDeleteStyles(t,e){const s=new Set(e);return this.extractAndDeleteMatchedStyles(t)&&this.classNameToBeAdded&&s.add(this.classNameToBeAdded),{styles:t,classNames:Array.from(s)}}refillStyles(t){this.classNameToBeAdded&&t.classList.remove(this.classNameToBeAdded);const e=S(t),s=Object.assign(Object.assign({},this.stylesToBeFiltered),e),n=Object.entries(Object.assign({},s)).map((([t,e])=>`${i(t)}: ${e};`)).join("");t.setAttribute("style",n)}canFilter(t){return!1}canRefill(t,e){return!1}toCssText(){return""}get alwaysFilter(){return!1}extractAndDeleteMatchedStyles(t){let e=!1;const s=this.stylesToBeFiltered;if(t&&s){const n=Object.keys(s);for(const r of n)t[r]===s[r]&&(delete t[r],e=!0)}return e}buildCssTextForStyles(t,e){return`${`.${T.RTE_CONTENT_CONTAINER_CLASS_NAME}`+(e?` .${e}`:` ${t}`)} { ${Object.entries(this.stylesToBeFiltered).map((([t,e])=>`${i(t)}: ${e};`)).join(" ")} }`}convertStylesMapToCssText(t){return Object.entries(t||this.stylesToBeFiltered).map((([t,e])=>`${i(t)}: ${e};`)).join(" ")}isBlockOrNodeStylesMatchFilterStyles(t,e){const s=t.getStyles({standalone:!0});return this.isMatchFilterStyles(s,e)}isMatchFilterStyles(t,e){return(e&&e.length>0?e:Object.keys(this.stylesToBeFiltered)).every((e=>t[e]===this.stylesToBeFiltered[e]))}}T.RTE_CONTENT_CONTAINER_CLASS_NAME="vega-rte-content",function(t){t.BOLD="BOLD",t.ITALIC="ITALIC",t.UNDERLINE="UNDERLINE",t.STRIKETHROUGH="STRIKETHROUGH",t.SELECTION_RANGE="SELECTION_RANGE",t.IMAGE="IMAGE",t.CODE="CODE",t.TEXT_COLOR="TEXT_COLOR",t.LINK="LINK",t.INLINE_HTML="INLINE_HTML",t.PLAIN_TEXT="PLAIN_TEXT"}(O||(O={}));class N extends g{}class b{static isTextBlock(t){return t===this.RTE_TEXT_BLOCK_CLASS_NAME}static isCodeBlock(t){return"RTECodeBlock"===t}static isListBlock(t){return"RTEListBlock"===t}static isListItemBlock(t){return"RTEListItemBlock"===t}static isTextNode(t){return t===this.RTE_TEXT_NODE_CLASS_NAME}static isLinkNode(t){return this.isTextNode(t.dtoName)&&!!t.getAnnotationByType(O.LINK)}static isCodeNode(t){if(this.isTextNode(t.dtoName)){const e=t.getAnnotationByType(O.CODE);return!!e&&e.code}return!1}static isImageNode(t){return"RTEImageNode"===t.dtoName}static isCodeBlockNode(t){return"RTECodeBlockNode"===t.dtoName}}b.RTE_TEXT_NODE_CLASS_NAME="RTETextNode",b.RTE_TEXT_BLOCK_CLASS_NAME="RTETextBlock";class C extends T{constructor(){super(...arguments),this.stylesToBeFiltered=v.getDefaultStyles(),this.elementTagName="a"}filterAnnotations(t){const e=t.link;return(null==e?void 0:e.customStyle)?(this.extractAndDeleteMatchedStyles(e.customStyle),0===Object.keys(e.customStyle).length&&delete e.customStyle,t):t}canFilter(t){return b.isLinkNode(t)}canRefill(t,e){return"RTETextNode"===t&&e.matches(this.elementTagName)}toCssText(){return this.buildCssTextForStyles(this.elementTagName,this.classNameToBeAdded)}filterLinkGroupInlineStyles(t){const e=t.style,s=t.class?t.class.split(" "):[],n=this.filterAndDeleteStyles(e,s);return n.styles&&Object.keys(n.styles).length>0&&(t.style=n.styles),n.classNames&&n.classNames.length>0&&(t.class=n.classNames.join(" ")),t.style&&0===Object.keys(t.style).length&&delete t.style,t}}class v extends g{constructor(t){super(),this.type=p.LINK_GROUP,this.linkGroups=new Map,this.linkGroups=new Map([[t,[]]])}static getDefaultStyles(){return{color:"rgba(var(--v-text-link, 19, 98, 226, 1))"}}clone(){const t=new v("");return this.linkGroups.forEach(((e,s)=>{t.linkGroups.set(s,e.map((t=>t.clone(t.parent))))})),t}toString(t,e){let s=this.toJsx(t,e);return(null==e?void 0:e.filterInlineStyles)&&(s=v.linkGroupFilterStylesStrategy.filterLinkGroupInlineStyles(s)),Object.entries(s).map((([t,e])=>{const s="string"==typeof e?e:this.formatStyleToString(e);return`${i(t)}="${s}"`})).join(" ")}toJsx(t,e){const s=this.getStyle(t,e),n=this.getClass(t,e),r=this.getAttribute(t);return n.length>0&&(r.class=n.join(" ")),s&&Object.keys(s).length>0&&(r.style=s),r}getClass(t,e){const s=[];return t.link.customClass&&s.push(...t.link.customClass),!(null==e?void 0:e.standalone)&&t.useInternalStyle&&s.push("v-rte--link"),s}getStyle(t,e){const s={};return t.link.customStyle&&Object.assign(s,t.link.customStyle),(null==e?void 0:e.standalone)&&t.useInternalStyle&&Object.assign(s,v.getDefaultStyles()),s}getAttribute(t){const{href:e,customAttribute:s={}}=t.link,n=t.useInternalStyle,r=s.target||(n?"_blank":"");return Object.assign(Object.assign(Object.assign({},s),e||n?{href:e}:{}),r?{target:r}:{})}formatStyleToString(t){return Object.entries(t).map((([t,e])=>`${i(t)}: ${e};`)).join(" ")}}v.linkGroupFilterStylesStrategy=new C;class R extends x{constructor(t){super(),this.type=f.ALIGNMENT,this.textAlign=t}static from(t){return[f.ALIGNMENT,new R(t)]}static getDefaultStyles(t){switch(t){case"right":case"center":case"justify":return{textAlign:t};case"left":default:return{textAlign:"left"}}}toJSON(){return{textAlign:this.textAlign}}renderClass(t){if(null==t?void 0:t.standalone)return null;switch(this.textAlign){case"right":case"center":case"justify":return`v-rte--horizontal-alignment-${this.textAlign}`;case"left":default:return"v-rte--horizontal-alignment-left"}}clone(){return new R(this.textAlign)}renderStyle(t){return(null==t?void 0:t.standalone)?R.getDefaultStyles(this.textAlign):null}}class j extends x{constructor(t){super(),this.type=f.INDENT,this.indent=Math.max(0,t)}static from(t){return[f.INDENT,new j(t)]}toJSON(){return this.indent>0?{indent:this.indent}:null}clone(){return new j(this.indent)}renderClass(){return null}renderStyle(){return this.indent>0?{marginLeft:16*this.indent+"px"}:null}}class _{static register(t,e,s){this.registry.has(e)||this.registry.set(e,new Map),this.registry.get(e).has(t)||this.registry.get(e).set(t,new Set),this.registry.get(e).get(t).add(s)}static unregister(t,e,s){const n=this.registry.get(e);if(n){const e=n.get(t);e&&e.delete(s)}}static get(t,e){const s=t instanceof E?t.type:t.constructor.name,n=this.registry.get(e.constructor.name);if(n){const r=n.get(s);if(r&&r.size>0)return Array.from(r).find((s=>s.canIntercept(t,e)))}}}_.registry=new Map;class k{static register(t,e,s){this.registry.has(e)||this.registry.set(e,new Map),this.registry.get(e).set(t,s)}static unregister(t,e){const s=this.registry.get(e);s&&s.delete(t)}static get(t,e){const s=this.registry.get(e);if(s)return s.get(t)}static executeTheStrategy(t,e){const s=_.get(t,e),n=()=>{const s=t instanceof E?t.type:t.constructor.name,n=k.get(s,e.constructor.name);if(n)return t.executedFlag=!0,n.execute(t,e);o.warn(`Type ${s} action handle strategy is not registered in class ${e.constructor.name}`)};return s?s.intercept(n,t,e):n()}static canHandle(t,e){return!!k.get(t,e.constructor.name)}}k.registry=new Map,function(t){t.CUSTOM_ATTRIBUTE="CUSTOM_ATTRIBUTE",t.CUSTOM_CLASS="CUSTOM_CLASS",t.CUSTOM_STYLE="CUSTOM_STYLE"}(y||(y={}));class $ extends g{}class L extends ${constructor(t){super(),this.type=y.CUSTOM_ATTRIBUTE,this.BOOLEAN_ATTRS=new Set(["controls","disabled","checked","readonly","multiple","required","autoplay","muted"]),this.customAttribute=t}static from(t){return[y.CUSTOM_ATTRIBUTE,new L(t)]}toJSON(){return{customAttribute:this.customAttribute}}clone(){return new L(this.customAttribute)}toString(t=[]){const e=t.map((t=>t.split("=")[0]));return Object.keys(this.customAttribute).map((t=>e.includes(t)?null:`${t}="${this.customAttribute[t]}"`)).filter(a)}render(t={}){var e;const s=Object.assign({},this.customAttribute);return null===(e=t.filterAttributes)||void 0===e||e.forEach((t=>delete s[t])),Object.keys(s).forEach((t=>{this.BOOLEAN_ATTRS.has(t)&&""===s[t]&&(s[t]="true")})),s}}class B extends ${constructor(t){super(),this.type=y.CUSTOM_CLASS,this.customClass=t}static from(t){return[y.CUSTOM_CLASS,new B(t)]}toJSON(){return{customClass:this.customClass}}clone(){return new B(this.customClass)}toString(){return`class="${this.customClass.join(" ")}"`}renderClass(){return this.customClass}}class I extends ${constructor(t){super(),this.type=y.CUSTOM_STYLE,this.customStyle=t}static from(t){return[y.CUSTOM_STYLE,new I(t)]}toJSON(){return{customStyle:this.customStyle}}clone(){return new I(this.customStyle)}renderStyle(){return this.customStyle}removeStyles(t){const e=Object.assign({},this.customStyle);return t.forEach((t=>delete e[t])),e}toString(){return`style="${Object.entries(this.customStyle).map((([t,e])=>`${t}: ${e};`)).join(" ")}"`}}class D extends x{constructor(t){super(),this.type=f.INTERNAL_WRAPPER,this.internalWrapper=t}static from(t){return[f.INTERNAL_WRAPPER,new D(t)]}clone(){return new D(this.internalWrapper)}renderClass(){}renderStyle(){}toJSON(){return this.internalWrapper?{internalWrapper:this.internalWrapper}:void 0}}class M{constructor(t){this.dtoName=t instanceof J?"block":"node",this.annotationMap=t.annotationMap}toCssText(t={standalone:!1},e,s){return s=s||this.toJSON(t,e),Object.entries(Object.assign({},s)).map((([t,e])=>`${i(t)}: ${e};`)).join("")}toJSON(t={standalone:!1},e){const s=Array.from(this.annotationMap.values()).filter((t=>this.filterAnnotation(t)||t instanceof I)).map((e=>e.renderStyle(t))).filter(a);return e&&e.length>0?this.mergeAnnotationStyles(s,e):s.reduce(((t,e)=>Object.assign(Object.assign({},t),e)),{})}filterAnnotation(t){return"block"===this.dtoName?t instanceof x:t instanceof N}mergeAnnotationStyles(t,e){const s={};for(const n of t)for(const t in n){const r=n[t],i=s[t];s[t]="string"==typeof i&&"string"==typeof r&&e.includes(t)?Array.from(new Set(`${i} ${r}`.split(/\s+/).filter(Boolean))).join(" "):r}return s}}class F{static register(t,e){var s;const n=null!==(s=this.registry.get(t))&&void 0!==s?s:new Set;n.add(e),this.registry.set(t,n)}static getStrategies(t){var e;return Array.from(null!==(e=this.registry.get(t))&&void 0!==e?e:[])}static executeTheStrategyFilterAction(t,e,s){return this.getStrategies(t.dtoName).filter((e=>e.canFilter(t))).reduce(((t,e)=>e.filterAndDeleteStyles(t.styles,t.classNames)),{styles:e,classNames:s})}static executeTheStrategyRefillAction(t,e){this.getStrategies(t).filter((s=>s.canRefill(t,e))).forEach((t=>{t.refillStyles(e)}))}static generateAllStylesContent(t=!1){const e=[];return t&&(e.push("/* Font-face imports begin */\n"),e.push(Object.keys(c).map((t=>`@import url('${c[t].url}');\n`)).join(" ")),e.push("/* Font-face imports end */\n")),this.registry.forEach((t=>{t.forEach((t=>{const s=t.toCssText();s&&!e.includes(s)&&e.push(s)}))})),e.join(" ")}}F.registry=new Map,function(t){t.TEXT="TEXT",t.IMAGE="IMAGE",t.CODE_BLOCK_NODE="CODE_BLOCK_NODE"}(m||(m={}));class H{constructor(t,e){this.annotationMap=new Map,this.dtoName=this.constructor.name,this.id=t,e&&(this.annotationMap=e)}static from(t,e,s){throw new Error(`[Vega] ${this.constructor.name}.from(${JSON.stringify(t)}, ${e}, ${s}) is not implemented. Please implement this method in the subclass.`)}static createAnnotationEntity(t,e){switch(t){case"customAttribute":return L.from(e);case"customClass":return B.from(e);case"customStyle":return I.from(e)}}getAnnotationByType(t){return this.annotationMap.get(t)}deleteAnnotationByType(t){this.annotationMap.delete(t),this.flushChange()}apply(t){return this.doApply(t),t.isFlushable&&this.flushChange(),this}getStyles(t={standalone:!1}){return new M(this).toJSON(t,["textDecoration"])}getClasses(t={standalone:!1}){return Array.from(this.annotationMap.values()).filter((t=>t instanceof N||t instanceof B)).map((e=>e.renderClass(t))).filter(a).reduce(((t,e)=>[t,e].join(" ").trim()),"")}getCustomAttributesAnnotation(){return this.annotationMap.get(y.CUSTOM_ATTRIBUTE)}isTextNode(){return!1}getElementRef(){return w.getDOMByEntity(this)}generateAttributeString(t,...e){var s;const n=new M(this),r=n.toJSON({standalone:!0},["textDecoration"]),i=this.annotationMap.get(y.CUSTOM_CLASS);let o=r,c=null==i?void 0:i.renderClass();if(t&&t.filterInlineStyles){const t=F.executeTheStrategyFilterAction(this,r,c);o=t.styles,c=t.classNames}const l=[...(null===(s=this.getCustomAttributesAnnotation())||void 0===s?void 0:s.toString(e))||[],c&&c.length>0?`class="${c.join(" ")}"`:null,o&&Object.keys(o).length>0?`style="${n.toCssText({standalone:!0},void 0,o)}"`:null,...e].filter(a);return l.length?` ${l.join(" ")}`:""}doApply(t){t instanceof E?this.doModifyActionApply(t):this.doAnnotationActionApply(t)}flushChange(){const n=w.getDOMByEntity(this);if(n){const r=e.getSubjectFromParentNodeByEventId(n,s);r&&t.notify(r,{})}}cloneAnnotations(){return new Map(Array.from(this.annotationMap.entries()).map((([t,e])=>[t,e.clone()])))}doAnnotationActionApply(t){}doModifyActionApply(t){}}const P=new class{constructor(){this.RTE_BLOCK_DTO_CLASS_MAP=new Map,this.RTE_NODE_DTO_CLASS_MAP=new Map}registerRTEDTOClass(t,e){if(e.prototype instanceof J)this.RTE_BLOCK_DTO_CLASS_MAP.set(t,e);else{if(!(e.prototype instanceof H))throw new Error(`Invalid RTE DTO class type: ${t}`);this.RTE_NODE_DTO_CLASS_MAP.set(t,e)}}getRTEBlockClass(t){return this.RTE_BLOCK_DTO_CLASS_MAP.get(t)}getRTENodeClass(t){return this.RTE_NODE_DTO_CLASS_MAP.get(t)}};class J{constructor(t){this.annotationMap=new Map,this.dtoName=this.constructor.name,this.id=t}static from(t,e){throw new Error(`[Vega] ${this.constructor.name}.from(${JSON.stringify(t)}, ${e}) is not implemented. Please implement this method in the subclass.`)}static generateBlockChildren(t,e,s){return t.map((t=>{const n=P.getRTEBlockClass(t.type);if(n){const r=n.from(t,e);return r.parent=s,r}})).filter(a)}static createAnnotationEntity(t,e){switch(t){case"textAlign":return R.from(e);case"indent":return j.from(e);case"customAttribute":return L.from(e);case"customClass":return B.from(e);case"customStyle":return I.from(e);case"internalWrapper":return D.from(e)}}static convertAnnotationsToMap(t,e){Object.entries(e).forEach((([e,s])=>{const n=this.createAnnotationEntity(e,s);a(n)&&t.set(...n)}))}shouldRenderAsInternalWrapper(){const t=this.getAnnotationByType(f.INTERNAL_WRAPPER);return!!t&&t.internalWrapper&&0===Array.from(this.annotationMap.values()).filter((t=>!(t instanceof v||t instanceof D))).length}toJSON(){const t=Array.from(this.annotationMap.values()).filter((t=>t instanceof x||t instanceof $)).reduce(((t,e)=>Object.assign(Object.assign({},t),e.toJSON())),{});return Object.assign({id:this.id},Object.keys(t).length>0?{annotations:t}:{})}getAnnotationByType(t){return this.annotationMap.get(t)}apply(n){if(this.doApply(n),n.isFlushable){const n=w.getDOMByEntity(this);if(n){const r=e.getSubjectFromParentNodeByEventId(n,s);r&&t.notify(r,{})}}}getFirstNode(){if(!this.children||!this.children[0])return null;const t=this.children[0];return t instanceof J?t.getFirstNode():t}isListItemBlock(){return"list-item"===this.type}getStyles(t={standalone:!1}){const e=new M(this).toJSON(t);return Object.assign(Object.assign({},e),this.shouldRenderAsInternalWrapper()?{display:"contents"}:{})}getClasses(t={standalone:!1}){return Array.from(this.annotationMap.values()).filter((t=>t instanceof x||t instanceof B)).map((e=>e.renderClass(t))).filter(a).reduce(((t,e)=>[t,e].join(" ").trim()),"")}getCustomAttributesAnnotation(){return this.annotationMap.get(y.CUSTOM_ATTRIBUTE)}generateAttributeString(t,...e){var s;const n=new M(this),r=n.toJSON({standalone:!0}),i=this.annotationMap.get(y.CUSTOM_CLASS);let o=r,c=null==i?void 0:i.renderClass();if(t&&t.filterInlineStyles){const t=F.executeTheStrategyFilterAction(this,r,c);o=t.styles,c=t.classNames}const l=[...(null===(s=this.getCustomAttributesAnnotation())||void 0===s?void 0:s.toString(e))||[],c&&c.length>0?`class="${c.join(" ")}"`:null,o&&Object.keys(o).length>0?`style="${n.toCssText({standalone:!0},void 0,o)}"`:null,...e].filter(a);return l.length?` ${l.join(" ")}`:""}doApply(t){t instanceof E?k.executeTheStrategy(t,this):this.applyAnnotationAction(t)}applyAnnotationAction(t){const e=t.toAnnotation();if(e instanceof v||this.annotationMap.set(e.type,e),"function"==typeof this.doAnnotationActionApply)this.doAnnotationActionApply(t);else{const e=k.get(t.constructor.name,this.constructor.name);e&&e.execute(t,this)}}cloneAnnotations(){return new Map(Array.from(this.annotationMap.entries()).map((([t,e])=>[t,e.clone()])))}}class K{}class U extends K{constructor(){super(...arguments),this.doSplit=!0}}class W extends g{constructor(t){super(),this.type=p.SELECTION_RANGE,this.range=t}clone(){return new W(this.range)}}const G="700",z="bold",V="italic",X="underline",q="line-through";class Y extends N{constructor(t){super(),this.type=O.STRIKETHROUGH,this.strikethrough=t}static from(t){return[O.STRIKETHROUGH,new Y(t)]}toJSON(){return{strikethrough:this.strikethrough}}clone(){return new Y(this.strikethrough)}renderClass(t){return(null==t?void 0:t.standalone)?null:this.strikethrough?"v-rte--strikethrough":null}renderStyle(t){return(null==t?void 0:t.standalone)&&this.strikethrough?{textDecoration:"line-through"}:null}}class Q extends N{constructor(t){super(),this.type=O.UNDERLINE,this.underline=t}static from(t){return[O.UNDERLINE,new Q(t)]}toJSON(){return{underline:this.underline}}clone(){return new Q(this.underline)}renderClass(t){return(null==t?void 0:t.standalone)?null:this.underline?"v-rte--underline":null}renderStyle(t){return(null==t?void 0:t.standalone)&&this.underline?{textDecoration:"underline"}:null}}class Z extends N{constructor(t){super(),this.type=O.ITALIC,this.italic=t}static from(t){return[O.ITALIC,new Z(t)]}toJSON(){return{italic:this.italic}}clone(){return new Z(this.italic)}renderClass(t){return(null==t?void 0:t.standalone)?null:this.italic?"v-rte--italic":null}renderStyle(t){return(null==t?void 0:t.standalone)&&this.italic?{fontStyle:"italic"}:null}}class tt extends N{constructor(t){super(),this.type=O.BOLD,this.bold=t}static from(t){return[O.BOLD,new tt(t)]}toJSON(){return{bold:this.bold}}clone(){return new tt(this.bold)}renderClass(t){return(null==t?void 0:t.standalone)?null:this.bold?"v-rte--bold":null}renderStyle(t){return(null==t?void 0:t.standalone)&&this.bold?{fontWeight:"700"}:null}}class et extends N{constructor(t,e=!0){super(),this.type=O.CODE,this.code=t,this.useInternalStyle=e}static from(t,e){return[O.CODE,new et(t,e)]}static getDefaultStyles(){return{fontFamily:"Roboto Mono",whiteSpace:"pre-wrap"}}toJSON(){return{code:this.code}}clone(){return new et(this.code,this.useInternalStyle)}renderClass(t){return(null==t?void 0:t.standalone)?null:this.code&&this.useInternalStyle?"v-rte--code":null}renderStyle(t){return(null==t?void 0:t.standalone)&&this.code&&this.useInternalStyle?et.getDefaultStyles():null}}const st={key:"black",light:"#111128",dark:"#E3E3E8"},nt=[st,{key:"gray",light:"#5E5E6D",dark:"#B9B9C1"},{key:"green",light:"#01801F",dark:"#59D977"},{key:"red",light:"#BD2947",dark:"#FFB2B5"},{key:"purple",light:"#563D82",dark:"#BEB2FF"},{key:"teal",light:"#17758F",dark:"#4CD8FF"}],rt="",it=[{key:"title"},{key:"subtitle"},{key:"heading-1"},{key:"heading-2"},{key:"heading-3"},{key:"paragraph"}],ot=[["textStyles"],["bold","italic","underline","strikethrough","code"],["textColor"],["horizontalAlignment","bulletsNumbers"],["moreIndent","lessIndent"],["link"],["image"],["clearStyle"]],at=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);class ct extends N{constructor(t){super(),this.type=O.TEXT_COLOR,this.textColor=this.formatTextColor(t)}static from(t){return[O.TEXT_COLOR,new ct(t)]}toJSON(){return{textColor:this.textColor.key}}clone(){return new ct(this.textColor.key)}renderClass(){return null}renderStyle(){return{color:h.isDarkMode()?this.textColor.dark:this.textColor.light}}formatTextColor(t){return nt.find((e=>e.key===t))||nt[0]}}class lt extends N{constructor(t,e=!0){super(),this.type=O.LINK,this.link=t,this.useInternalStyle=e}static from(t,e=!0){return[O.LINK,new lt(t,e)]}toJSON(){return{link:this.link}}clone(){return new lt(this.link,this.useInternalStyle)}toEqual(t){return this.link.groupKey===t.link.groupKey}renderClass(){return null}renderStyle(){return null}}class ht extends K{constructor(t,e,s){super(),this.isFlushable=!1,this.groupKey=t,this.nodes=e,this.type=s}toAnnotation(){return new v(this.groupKey)}}class ut extends K{constructor(){super(),this.isFlushable=!1}toAnnotation(){return null}}class dt{execute(t,e){return o.log(`Executing action ${t.constructor.name} on ${e.constructor.name} ${e.id}`),this.handleAction(t,e)}updateCustomStyleAnnotation(t,e){const s=t.annotationMap.get(y.CUSTOM_STYLE);s&&this.isCustomStyle(s,e)&&t.annotationMap.set(s.type,new I(s.removeStyles(e)))}createNewParagraph(t){const e=P.getRTEBlockClass("paragraph");if(e)return e.from({id:l(),type:"paragraph",nodes:[{id:l(),type:"text",text:t}]})}getRootContent(t){const e=t.parent;if(e)return"VegaRTEContent"===e.dtoName?e:this.getRootContent(e)}isCaretPositionAtBlockStart(t,e,s){return e===t.children[0]&&0===s}isCaretPositionAtBlockEnd(t,e,s){return e.isContentEditable()?this.isCaretPositionAtTextBlockEnd(t,e,s):this.isCaretPositionAtDecoratorBlockEnd(t,e,s)}getDOMByEntity(t){return w.getDOMByEntity(t)}isCaretPositionAtTextBlockEnd(t,e,s){const n=t.children[t.children.length-1];return e===n&&(e.isEmpty()||s===n.text.length)}isCaretPositionAtDecoratorBlockEnd(t,e,s){return e===t.children[t.children.length-1]&&0!==s}isCustomStyle(t,e){return e.some((e=>Object.keys(t.customStyle).includes(e)))}}class pt extends E{constructor(t){super(),this.type=A.LINK_GROUP_NODE_SPLIT,this.splittedTextNodes=t}}class ft extends dt{constructor(){super(...arguments),this.applyTargetNode=null}handleAction(t,e){const s=e.getAnnotationByType(p.SELECTION_RANGE);if(this.setApplyTargetNode(null),t instanceof U&&t.doSplit&&s){const{startContainer:t,endContainer:n,startOffset:r,endOffset:i}=s.range,o=t===n&&r===i;e.parent.children=e.parent.children.flatMap((t=>{if(t.id===e.id){if(o)return this.insertNewNode(r,e);if(this.shouldSplitSelection(s.range)&&e.isContentEditable()){const n=this.splitTextNode(s.range,e);return t.annotationMap.has("LINK")&&t.apply(new pt(n)),n}return this.setApplyTargetNode(e),e}return t}))}return this.applyTargetNode}insertNewNode(t,e){const s=e.cloneWithText("");this.setApplyTargetNode(s);const n=e.parent.children.findIndex((t=>t===e));return 0===t||!e.isContentEditable()&&t===n?[s,e]:t===e.text.length||!e.isContentEditable()&&t===n+1?[e,s]:[e.cloneWithText(e.text.substring(0,t)),s,e.cloneWithText(e.text.substring(t))]}shouldSplitSelection(t){const{startContainer:e,endContainer:s,startOffset:n,endOffset:r}=t;return e!==s||n>0||r<(s.textContent?s.textContent.length:0)}splitTextNode(t,e){const{startContainer:s,endContainer:n,startOffset:r}=t,i=s.parentElement,o=n.parentElement,a=(t,s,n)=>{const r=t.substring(0,s),i=t.substring(s,n),o=t.substring(n);return[e.cloneWithText(r),e.cloneWithText(i),e.cloneWithText(o)]},c=i&&w.getEntityByDOM(i),l=o&&w.getEntityByDOM(o);if(c&&c.id===e.id){const i=s===n?t.endOffset:e.text.length,[o,c,l]=a(e.text,r,i);return this.setApplyTargetNode(c),[o,c,l].filter((t=>!!t.text))}if(l&&l.id===e.id){const[s,n,r]=a(e.text,0,t.endOffset);return this.setApplyTargetNode(n),[s,n,r].filter((t=>!!t.text))}return this.setApplyTargetNode(e),e}setApplyTargetNode(t){this.applyTargetNode=t}}class gt extends U{constructor(t){super(),this.isFlushable=!0,this.bold=t}toAnnotation(){return new tt(this.bold)}}class xt extends g{constructor(){super(...arguments),this.type=p.CLEAR_FORMATTING,this.items=[O.BOLD,O.ITALIC,O.UNDERLINE,O.STRIKETHROUGH,O.TEXT_COLOR,O.CODE,y.CUSTOM_STYLE]}}class wt extends U{constructor(){super(...arguments),this.isFlushable=!0}toAnnotation(){return new xt}}class At extends U{constructor(t){super(),this.isFlushable=!0,this.code=t}toAnnotation(){return new et(this.code)}}class Ot extends K{constructor(t){super(),this.isFlushable=!0,this.annotationType=t}toAnnotation(){}}class yt extends U{constructor(t){super(),this.isFlushable=!0,this.italic=t}toAnnotation(){return new Z(this.italic)}}class mt extends U{constructor({link:t,newText:e,needMergeNode:s,doSplit:n,type:r}){super(),this.isFlushable=!0,this.link=t,this.needMergeNode=s,this.newText=e,this.type=r,a(n)&&(this.doSplit=n)}toAnnotation(){return new lt(this.link)}}class Et extends U{constructor(t){super(),this.isFlushable=!0,this.strikethrough=t}toAnnotation(){return new Y(this.strikethrough)}}class St extends U{constructor(t){super(),this.isFlushable=!0,this.underline=t}toAnnotation(){return new Q(this.underline)}}class Tt extends dt{handleAction(t,e){const s=t.toAnnotation();if(t instanceof Ot)e.annotationMap.delete(t.annotationType);else{if(!(s instanceof xt))return s instanceof N||s instanceof W?(t instanceof mt&&(a(t.newText)&&(e.text=t.newText),e.parent.apply(new ht(t.link.groupKey,[e],t.type))),t instanceof At&&this.handleAction(new wt,e),t instanceof gt&&this.updateCustomStyleAnnotation(e,["fontWeight"]),t instanceof yt&&this.updateCustomStyleAnnotation(e,["fontStyle"]),(t instanceof St||t instanceof Et)&&this.updateCustomStyleAnnotation(e,["textDecoration"]),void e.annotationMap.set(s.type,s)):void 0;s.items.forEach((t=>{e.deleteAnnotationByType(t)}))}}}class Nt extends E{constructor(){super(...arguments),this.type=A.DELETE_LINK_GROUP}}class bt extends dt{handleAction(t,e){e.text=t.newTextContent,!e.text&&e.annotationMap.has("LINK")&&e.apply(new Nt)}}class Ct extends E{constructor(t){super(),this.type=A.UPDATE_TEXT,this.newTextContent="",this.newTextContent=t}}class vt extends dt{handleAction(t,e){this.replaceSelectedText(t.textToBeInsert,t.currentRange,e)}replaceSelectedText(t,e,s){if(e&&e.startContainer&&e.endContainer){const{startContainer:n,endContainer:r,startOffset:i,endOffset:o}=e;let a=s.text;if(n===r&&i===o&&t)a=s.text.slice(0,i)+t+s.text.slice(i);else{const e=n.parentElement,c=r.parentElement,l=e&&w.getEntityByDOM(e),h=c&&w.getEntityByDOM(c);let u=0,d=s.text.length;l&&l===s?(u=i,d=n===r?o:d):h&&h===s&&(d=o),a=s.text.slice(0,u)+t+s.text.slice(d)}s.apply(new Ct(a))}}}class Rt extends g{constructor(t){super(),this.type=O.INLINE_HTML,this.htmlTag=t}static from(t){const{htmlTag:e,child:s,customStyle:n,customClass:r,customAttribute:i}=t,o=new Rt(e);return o.groupId=t.groupId,o.child=s?Rt.from(s)[1]:void 0,o.customAttribute=i?L.from(i)[1]:void 0,o.customClass=r?B.from(r)[1]:void 0,o.customStyle=n?I.from(n)[1]:void 0,[O.INLINE_HTML,o]}clone(){var t,e,s,n;const r=new Rt(this.htmlTag);return r.groupId=this.groupId,r.child=null===(t=this.child)||void 0===t?void 0:t.clone(),r.customAttribute=null===(e=this.customAttribute)||void 0===e?void 0:e.clone(),r.customClass=null===(s=this.customClass)||void 0===s?void 0:s.clone(),r.customStyle=null===(n=this.customStyle)||void 0===n?void 0:n.clone(),r}renderProps(){var t,e,s;return Object.assign(Object.assign({},null===(t=this.customAttribute)||void 0===t?void 0:t.render()),{style:null===(e=this.customStyle)||void 0===e?void 0:e.renderStyle(),class:null===(s=this.customClass)||void 0===s?void 0:s.renderClass().join(" ")})}toJSON(){var t,e,s,n;return{inlineHtml:u({htmlTag:this.htmlTag,groupId:this.groupId,child:null===(t=this.child)||void 0===t?void 0:t.toJSON().inlineHtml,customAttribute:null===(e=this.customAttribute)||void 0===e?void 0:e.toJSON().customAttribute,customClass:null===(s=this.customClass)||void 0===s?void 0:s.toJSON().customClass,customStyle:null===(n=this.customStyle)||void 0===n?void 0:n.toJSON().customStyle})}}}class jt extends dt{handleAction(t,e){const s=e.parent.getAnnotationByType(p.LINK_GROUP);if(s){const n=e.annotationMap.get("LINK").link.groupKey,r=s.linkGroups.get(n);if(r){const i=r.indexOf(e);-1!==i&&(r.splice(i,1,...Array.isArray(t.splittedTextNodes)?t.splittedTextNodes:[t.splittedTextNodes]),s.linkGroups.set(n,r))}}}}class _t extends dt{handleAction(t,e){const s=e.parent.getAnnotationByType(p.LINK_GROUP);if(s){const t=e.annotationMap.get(O.LINK).link.groupKey,n=s.linkGroups.get(t);if(n){const r=n.indexOf(e);-1!==r&&n.splice(r,1),0===n.length&&s.linkGroups.delete(t),0===s.linkGroups.size&&e.parent.annotationMap.delete(p.LINK_GROUP)}}e.annotationMap.delete(O.LINK)}}class kt extends N{constructor(t){super(),this.type=O.PLAIN_TEXT,this.plainText=!0,this.plainText=t}static from(t){return[O.PLAIN_TEXT,new kt(t)]}clone(){return new kt(this.plainText)}renderClass(){}renderStyle(){}toJSON(){return this.plainText?{plainText:this.plainText}:void 0}}class $t extends U{constructor(t){super(),this.isFlushable=!0,this.textColor=t}toAnnotation(){return new ct(this.textColor)}}class Lt extends H{constructor(t,e,s,n){super(t,n),this.dtoName=Lt.dtoName,this.type=m.TEXT,this.parent=s,this.text=e,this.registerModifyStrategy()}static supportsHtmlTag(t){return["span","code"].includes(t)}static from(t,e,s={autoMatchFormat:!0}){const n=new Lt(t.id,t.text,e),{annotations:r}=t;return r&&(n.annotationMap=this.generateTextAnnotationMap(r,s,e,n)),n}static generateTextAnnotationMap(t,e,s,n){return new Map(Object.keys(t).map((r=>("link"===r&&t.link&&s&&n&&s.apply(new ht(t.link.groupKey,[n],"link")),this.createAnnotationEntity(r,t[r],e)))).filter(a))}static createAnnotationEntity(t,e,s){const n=!(!s||!s.autoMatchFormat);switch(t){case"bold":return tt.from(e);case"italic":return Z.from(e);case"underline":return Q.from(e);case"strikethrough":return Y.from(e);case"code":return et.from(e,n);case"textColor":return ct.from(e);case"link":return lt.from(e,n);case"inlineHtml":return Rt.from(e);case"plainText":return kt.from(e)}return H.createAnnotationEntity(t,e)}toJSON(){const t=Array.from(this.annotationMap.values()).filter((t=>t instanceof N||t instanceof $||t instanceof Rt)).reduce(((t,e)=>Object.assign(Object.assign({},t),e.toJSON())),{});return Object.assign(Object.assign({id:this.id},Object.keys(t).length>0?{annotations:t}:{}),{type:"text",text:this.text})}toHtml(t){const e=this.getAnnotationByType(O.INLINE_HTML);return e?this.renderWithWrapperStr(e,t):this.renderTextStr(t)}cloneWithText(t){return new Lt(l(),t,this.parent,super.cloneAnnotations())}clone(t){return new Lt(this.id,this.text,t,super.cloneAnnotations())}isEmpty(){return!(this.getAnnotationByType(O.INLINE_HTML)||this.text&&""!==this.text&&"\n"!==this.text)}isTextNode(){return!0}getRangeEndOffset(){return!this.isContentEditable()&&this.parent?this.parent.children.indexOf(this)+1:"\n"===this.text?0:this.text.length}getRangeContainer(){const t=this.getElementRef();if(t)return this.isContentEditable()?t.firstChild:t.parentElement}isContentEditable(){return!0}getInlineHtmlTagAtDepth(t){const e=this.getInlineHtmlAnnotationAtDepth(t);return e?at.has(e.htmlTag)?null:{htmlTag:e.htmlTag,attrStr:this.annotationAttrStr(e),groupId:e.groupId,annotation:e}:null}renderHtmlFromDepth(t,e){if(0===t)return this.toHtml(e);const s=this.getInlineHtmlAnnotationAtDepth(t);return s?this.renderWithWrapperStr(s,e):this.renderTextStr(e)}getInlineHtmlAnnotationAtDepth(t){let e=this.getAnnotationByType(O.INLINE_HTML);for(let s=0;s<t&&e;s++)e=e.child;return e}registerModifyStrategy(){const t=this.constructor.name;Lt.registerActionStrategyStatus[t]||(this.isContentEditable()&&(k.register(A.UPDATE_TEXT,t,new bt),k.register(A.REPLACE_SELECTED_TEXT,t,new vt),k.register(A.LINK_GROUP_NODE_SPLIT,t,new jt),k.register(mt.name,t,new Tt)),k.register(U.name,t,new ft),k.register(A.DELETE_LINK_GROUP,t,new _t),k.register(gt.name,t,new Tt),k.register(wt.name,t,new Tt),k.register(yt.name,t,new Tt),k.register(St.name,t,new Tt),k.register($t.name,t,new Tt),k.register(Et.name,t,new Tt),k.register(At.name,t,new Tt),k.register(K.name,t,new Tt),Lt.registerActionStrategyStatus[t]=!0)}doAnnotationActionApply(t){const e=this.getAnnotationByType(p.SELECTION_RANGE);if(t instanceof U&&t.doSplit&&e){const e=k.get(U.name,this.constructor.name);if(e){const s=e.execute(t,this);s&&this.applyActionToNode(s,t)}}else this.applyActionToNode(this,t);"function"==typeof this.parent.mergeNodes&&this.parent.mergeNodes(t)}doModifyActionApply(t){k.executeTheStrategy(t,this)}applyActionToNode(t,e){const s=e.toAnnotation();if(e instanceof ut)return void this.syncUpSelectedNodes(t);s instanceof W||this.syncUpSelectedNodes(t);const n=k.get(e.constructor.name,t.constructor.name);if(n)return void n.execute(e,t);const r=k.get(K.name,Lt.name);r&&r.execute(e,t)}syncUpSelectedNodes(s){const r=this.getElementRef();if(r){const i=e.getSubjectFromParentNodeByEventId(r,n);i&&t.notify(i,{node:s})}}renderWithWrapperStr(t,e){const{htmlTag:s,child:n}=t,r=this.annotationAttrStr(t);return n?`<${s}${r}>${this.renderWithWrapperStr(n,e)}</${s}>`:at.has(s)?`<${s}${r}>`:this.text?`<${s}${r}>${this.renderTextStr(e)}</${s}>`:`<${s}${r}></${s}>`}annotationAttrStr(t){const{customAttribute:e,customClass:s,customStyle:n}=t,r=[...(null==e?void 0:e.toString())||[],null==s?void 0:s.toString(),null==n?void 0:n.toString()].filter(a);return r.length>0?` ${r.join(" ")}`:""}renderTextStr(t){var e;const s=(null===(e=this.getAnnotationByType(O.CODE))||void 0===e?void 0:e.code)?"code":"span",n=super.generateAttributeString(t);return"\n"===this.text?"<br>":this.shouldRenderAsPlainText()?this.text:`<${s}${n}>${this.text}</${s}>`}shouldRenderAsPlainText(){const t=super.getAnnotationByType(O.PLAIN_TEXT);return!!t&&t.plainText&&0===Array.from(this.annotationMap.values()).filter((t=>t instanceof N&&!(t instanceof lt)&&!(t instanceof kt)||t instanceof $)).length}}Lt.registerActionStrategyStatus={},Lt.htmlTag="span",Lt.dtoName="RTETextNode";class Bt extends E{constructor(t){super(),this.type=A.APPEND_CHILDREN,this.entityToBeAppended=t}}const It={fontFamily:"Inter",fontSize:"16px",lineHeight:"22px",minHeight:"22px",fontWeight:"500"},Dt=Object.assign(Object.assign({},It),{marginTop:"0px",marginBottom:"0px"}),Mt={paragraph:Dt,title:Object.assign(Object.assign({},It),{fontSize:"36px",lineHeight:"40px",minHeight:"40px"}),subtitle:Object.assign(Object.assign({},It),{fontSize:"28px",lineHeight:"32px",minHeight:"32px"}),"heading-1":Object.assign(Object.assign({},Dt),{fontSize:"22px",lineHeight:"24px",minHeight:"24px"}),"heading-2":Object.assign(Object.assign({},Dt),{fontSize:"20px",lineHeight:"24px",minHeight:"24px"}),"heading-3":Object.assign(Object.assign({},Dt),{fontSize:"18px"}),"heading-4":Object.assign({},Dt),"heading-5":Object.assign(Object.assign({},Dt),{fontSize:"14px"}),"heading-6":Object.assign(Object.assign({},Dt),{fontSize:"12px"})};class Ft extends x{constructor(t){super(),this.type=f.TEXT_STYLE,this.textStyle=t}static from(t){return[f.TEXT_STYLE,new Ft(t)]}static getDefaultStyles(t){return t?Mt[t]:null}toJSON(){return{textStyle:this.textStyle}}clone(){return new Ft(this.textStyle)}renderClass(t){return(null==t?void 0:t.standalone)?null:this.textStyle?`v-rte--text-style-${this.textStyle}`:null}renderStyle(t){return(null==t?void 0:t.standalone)&&this.textStyle?Ft.getDefaultStyles(this.textStyle):null}}class Ht extends K{constructor(t,e){super(),this.isFlushable=!0,this.textStyle=t,this.bold=e}toAnnotation(){return new Ft(this.textStyle)}}class Pt extends dt{handleAction(t,e){"list-item"!==e.type&&(e.type=t.textStyle),e.children.forEach(t.bold?t=>{const e=new gt(!0);e.doSplit=!1,t.apply(e)}:t=>{t.apply(new Ot(O.BOLD))}),this.updateCustomStyleAnnotation(e,["fontFamily","lineHeight","fontWeight","fontSize"])}}class Jt extends E{constructor(t,...e){super(),this.type=A.INSERT_CHILDREN_AFTER,this.referChildren=t,this.childrenToBeInserted=e}}class Kt extends E{constructor(t){super(),this.type=A.REPLACE_CHILD_NODES,this.newChildNodes=t}}class Ut extends dt{handleAction(t,e){t.newBlock=this.splitTextNodeBlock(t.splitPointNode,t.startOffsetOfNode,e)}splitTextNodeBlock(t,e,s){if(t){const n=t.text.slice(0,e),r=t.text.slice(e),i=s.children.indexOf(t);if(i>-1){const e=s.children.slice(0,i),o=s.children.slice(i+1);n&&e.push(t.cloneWithText(n)),r&&o.unshift(t.cloneWithText(r)),s.apply(new Kt(e));const a=s.cloneWithNodes(o);return s.parent.apply(new Jt(s,a)),a}}}}class Wt extends dt{handleAction(t,e){e.children=[],e.apply(new Bt(t.newChildNodes))}}class Gt extends E{constructor(t){super(),this.type=A.DELETE_CHILDREN,this.entityToBeRemoved=t}}class zt extends dt{handleAction(t,e){const s=t.blockNeedToBeMerged;if(e.type===s.type||"image"!==e.type&&"image"!==s.type){let t=s.children;"image"!==s.type&&(t=s.children.filter((t=>t.text))),e.apply(new Bt(t)),s.parent.apply(new Gt(s))}}}class Vt extends dt{handleAction(t,e){t.lineBreakNode=this.lineBreakSingleBlock(t.startContainerNode,t.startOffset,e)}lineBreakSingleBlock(t,e,s){if(t){const n=new Lt(l(),"\n",s),r=t.text.slice(0,e),i=t.text.slice(e),o=s.children.indexOf(t);if(o>-1){const e=s.children.slice(0,o),a=s.children.slice(o+1);r&&e.push(t.cloneWithText(r)),i&&a.unshift(t.cloneWithText(i)),this.mergeLineBreakNodes(e,n,a,s)}return n}}mergeLineBreakNodes(t,e,s,n){(0===s.length||s[0]&&""===s[0].text)&&s.push(new Lt(l(),"\n",n,t[t.length-1]&&t[t.length-1].annotationMap)),n.apply(new Kt([...t,e,...s]))}}class Xt extends dt{handleAction(t,e){t.lineBreakNode=this.lineBreakMultipleBlocks(t.selectedBlocks,e)}lineBreakMultipleBlocks(t,e){const s=e.children,n=new Lt(l(),"\n",e),r=this.concatBlocksNodes(t.slice(1));return this.mergeLineBreakNodes(s,n,r,e),n}concatBlocksNodes(t){const e=[];return t.map((t=>{"image"!==t.type&&(e.push(...t.children),t.parent.apply(new Gt(t)))})),e}mergeLineBreakNodes(t,e,s,n){(0===s.length||s[0]&&""===s[0].text)&&s.push(new Lt(l(),"\n",n,t[t.length-1]&&t[t.length-1].annotationMap)),n.apply(new Kt([...t,e,...s]))}}class qt extends E{constructor(t,...e){super(),this.type=A.INSERT_CHILDREN_BEFORE,this.referChildren=t,this.childrenToBeInserted=e}}class Yt extends E{constructor(t,e){super(),this.type=A.SPLIT_BLOCK_WITH_NODE,this.splitPointNode=t,this.startOffsetOfNode=e}}class Qt extends K{constructor(t){super(),this.isFlushable=!0,this.textAlign=t}toAnnotation(){return new R(this.textAlign)}}class Zt extends dt{handleAction(t,e){this.updateCustomStyleAnnotation(e,["textAlign"])}}class te extends K{constructor(t){super(),this.isFlushable=!0,this.indent=t}toAnnotation(){return new j(this.indent)}}class ee extends J{constructor(t,e,s){super(t),this.dtoName=ee.dtoName,this.children=[],this.type=e;const{autoMatchFormat:n}=s||{autoMatchFormat:!0};n&&(this.annotationMap=ee.isAcceptableTextStyle(e)?new Map([Ft.from(e)]):new Map([Ft.from("paragraph")]))}static from(t,e={autoMatchFormat:!0}){var s,n;const r=new ee(t.id,t.type,e),i=e.autoMatchFormat?Object.assign(Object.assign({},t.annotations),{textStyle:null!==(n=null===(s=t.annotations)||void 0===s?void 0:s.textStyle)&&void 0!==n?n:r.type}):t.annotations;return r.children=t.nodes.map((t=>{const s=P.getRTENodeClass(t.type);if(s)return s.from(t,r,e)})).filter(a),i&&super.convertAnnotationsToMap(r.annotationMap,i),r}static createAnnotationEntity(t,e){return"textStyle"===t?Ft.from(e):super.createAnnotationEntity(t,e)}static isAcceptableTextStyle(t){return["title","subtitle","paragraph","heading-1","heading-2","heading-3","heading-4","heading-5","heading-6"].includes(t)}mergeNodes(t){this.children=this.children.reduce(((e,s)=>{const n=e.at(-1);if(t instanceof mt&&t.needMergeNode){const t=null==n?void 0:n.getAnnotationByType(O.LINK),r=s.getAnnotationByType(O.LINK);if(t&&r&&t.toEqual(r))return e}return[...e,s]}),[])}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{type:this.type,nodes:this.children.map((t=>t.toJSON()))})}toHtml(t){const e=this.getBlockTag(),s=super.generateAttributeString(t),n=this.getChildrenHtml(t);return super.shouldRenderAsInternalWrapper()?n:[`<${e}${s}>`,n,`</${e}>`].join("")}cloneWithNodes(t){const e=new ee(l(),this.type);return e.annotationMap=super.cloneAnnotations(),e.apply(new Bt(t)),e}clone(t){const e=new ee(this.id,this.type);return e.children=this.children.map((t=>t.clone(e))),e.annotationMap=super.cloneAnnotations(),e.parent=t,e}isNotEmpty(){return this.children.length>0&&this.children.some((t=>!t.isEmpty()))}getLastNode(){return this.children[this.children.length-1]}getBlockTag(){switch(this.type){case"title":case"subtitle":return"div";case"heading-1":return"h1";case"heading-2":return"h2";case"heading-3":return"h3";case"heading-4":return"h4";case"heading-5":return"h5";case"heading-6":return"h6";case"paragraph":default:return"p"}}getChildrenHtml(t){const e=this.getAnnotationByType(p.LINK_GROUP);let s=this.renderGroupedNodesAtDepth(this.children,0,t);return e&&this.children.length>0&&(s=this.generateLinkHtml(e,s,t)),s}doAnnotationActionApply(t){const e=k.get(t.constructor.name,ee.name);e&&e.execute(t,this)}renderGroupedNodesAtDepth(t,e,s){var n;let r="",i=0;for(;i<t.length;){const o=t[i].getInlineHtmlTagAtDepth(e);if(!(null==o?void 0:o.groupId)){r+=t[i].renderHtmlFromDepth(e,s),i++;continue}let a=i+1;for(;a<t.length&&(null===(n=t[a].getInlineHtmlTagAtDepth(e))||void 0===n?void 0:n.groupId)===o.groupId;)a++;if(a===i+1)r+=t[i].renderHtmlFromDepth(e,s);else{const n=this.renderGroupedNodesAtDepth(t.slice(i,a),e+1,s);r+=`<${o.htmlTag}${o.attrStr}>${n}</${o.htmlTag}>`}i=a}return r}generateLinkHtml(t,e,s){e="";let n=[];for(let r=0;r<this.children.length;r++){const i=this.children[r].getAnnotationByType(O.LINK),o=this.children[r+1]?this.children[r+1].getAnnotationByType(O.LINK):null;if(i){if(n.push(this.children[r]),!o||i.link.groupKey!==o.link.groupKey){const r=t.toString(i,{standalone:!0,filterInlineStyles:null==s?void 0:s.filterInlineStyles});e+=[`<a${r?` ${r}`:""}>`,this.renderGroupedNodesAtDepth(n,0,s),"</a>"].join(""),n=[]}}else e+=this.children[r].toHtml(s)}return e}}k.register(Ht.name,ee.name,new Pt),k.register(Qt.name,ee.name,new Zt),k.register(te.name,ee.name,new class extends dt{handleAction(t,e){this.updateCustomStyleAnnotation(e,["marginLeft"])}}),k.register(ht.name,ee.name,new class extends dt{handleAction(t,e){let s=e.getAnnotationByType(p.LINK_GROUP);if("update_link"===t.type){if(s){const e=s.linkGroups.get(t.groupKey);e&&s.linkGroups.set(t.groupKey,[e[0]])}}else{if(s){const e=s.linkGroups.get(t.groupKey)||[];s.linkGroups.set(t.groupKey,[...e,...t.nodes])}else s=t.toAnnotation(),s.linkGroups.set(t.groupKey,[...t.nodes]);e.annotationMap.set(p.LINK_GROUP,s)}}}),k.register(A.UNLINK_LINK_GROUP,ee.name,new class extends dt{handleAction(t,e){const s=e.getAnnotationByType(p.LINK_GROUP);s&&(s.linkGroups.size>1?s.linkGroups.delete(t.groupKey):e.annotationMap.delete(p.LINK_GROUP))}}),k.register(A.SPLIT_BLOCK_WITH_NODE,ee.name,new Ut),k.register(A.REPLACE_CHILD_NODES,ee.name,new Wt),k.register(A.MERGE_TWO_BLOCKS_NODES,ee.name,new zt),k.register(A.LINE_BREAK_SINGLE_BLOCK,ee.name,new Vt),k.register(A.LINE_BREAK_MULTIPLE_BLOCKS,ee.name,new Xt),k.register(A.INSERT_IMAGE_TO_BLOCK,ee.name,new class extends dt{handleAction(t,e){const s=t.splitPointNode,n=t.startOffsetOfNode,r=t.imageBlockToBeInserted;if(this.isCaretPositionAtBlockEnd(e,s,n))e.parent.apply(new Jt(e,r));else if(this.isCaretPositionAtBlockStart(e,s,n))e.parent.apply(new qt(e,r));else{const t=new Yt(s,n);e.apply(t),e.parent.apply(new Jt(e,r))}}}),k.register(A.TRANSFORM_LIST_BLOCK,ee.name,new class extends dt{handleAction(t,e){const s=e.parent,n=s.createList(t.listType),r=t.selectedBlocks,i=r.map((t=>s.toListItem(t)));n.apply(new Bt(i)),s.apply(new Jt(t.selectedBlocks[0],n)),r.forEach((t=>{t.parent.apply(new Gt(t))}))}}),ee.dtoName="RTETextBlock";class se extends dt{getPreviousNode(t){const e=t.parent,s=e.children.indexOf(t);if(s>0)return e.children[s-1];if(e.parent){const t=this.getPreviousBlock(e);if(t)return this.getBlockLastNode(t)}}getNextNode(t){const e=t.parent,s=e.children.indexOf(t);if(e.children[s+1])return e.children[s+1];if(e.parent){const t=this.getNextBlock(e);if(t)return this.getBlockFirstNode(t)}}isContentFirstNode(t){const e=t.parent,s=e.children.indexOf(t),n=e.parent;if(e.isListItemBlock()){const t=n.parent;return 0===s&&Array.isArray(n.children)&&n.children[0]===e&&"list-item"!==t.type&&Array.isArray(t.children)&&t.children[0]===n}return 0===s&&Array.isArray(n.children)&&n.children[0]===e}getPreviousBlock(t){if(t&&t.parent&&t.parent.children){const e=t.parent.children.indexOf(t);if(e>0)return t.parent.children[e-1];if(this.isRTEBlock(t.parent)&&0===e)return this.getPreviousBlock(t.parent)}}getBlockLastNode(t){return t.getLastNode()}getBlockFirstNode(t){if("number-list"===t.type||"bullet-list"===t.type){if(t.children)return this.getBlockFirstNode(t.children[0])}else if(t.children)return t.children[0]}getNextBlock(t){if(t&&t.parent&&t.parent.children){const e=t.parent.children.indexOf(t);if(t.parent.children[e+1])return t.parent.children[e+1];if("list-item"===t.type&&t.parent.children.length===e+1)return this.getNextBlock(t.parent)}}isRTEBlock(t){return t&&"VegaRTEContent"!==t.dtoName}}class ne extends E{constructor(t,e){super(),this.isFlushable=!0,this.type=A.UPDATE_CODE_BLOCK,this.content=t,this.language=e}}class re extends K{constructor(t){super(),this.isFlushable=!1,this.range=t}toAnnotation(){return new W(this.range)}}class ie extends H{constructor(){super(...arguments),this.type="decorator-node",this.isSelected=!1}static isDecoratorNodeContainerElement(t){return t&&t.classList.contains(ie.DECORATOR_CONTAINER_CLASS)}static getDecoratorNodeElement(t){return t.querySelector(`.${ie.DECORATOR_NODE_CLASS}`)}getRangeEndOffset(){return 1}getRangeContainer(){const t=this.getElementRef();if(t)return d(t,`.${ie.DECORATOR_CONTAINER_CLASS}`)}isContentEditable(){return!1}}ie.DECORATOR_CONTAINER_CLASS="v-internal-decorator-container",ie.DECORATOR_NODE_CLASS="v-internal-decorator-node";class oe extends T{constructor(){super(...arguments),this.stylesToBeFiltered=oe.STYLES,this.elementTagName="pre code"}canFilter(t){return b.isCodeBlockNode(t)}canRefill(t,e){return!1}toCssText(){return this.buildCssTextForStyles(this.elementTagName,this.classNameToBeAdded)}}oe.STYLES={boxSizing:"border-box",color:"rgba(var(--v-text-primary, 32, 54, 69, 1))",textAlign:"left",fontFamily:'"Roboto Mono"',fontWeight:"400",lineHeight:"22px",fontSize:"16px",whiteSpace:"pre-wrap",minHeight:"22px",tabSize:"2px"};class ae extends ie{constructor(t,e,s,n){super(t),this.dtoName=ae.dtoName,this.type=m.CODE_BLOCK_NODE,this.text="",this.annotationMap=new Map,this.text=e,this.parent=n,this.language=s,this.annotationMap.set(y.CUSTOM_STYLE,new I(oe.STYLES))}toJSON(){return{id:this.id,type:"text",text:this.text,language:this.language}}toHtml(t){return`<code${this.generateAttributeString(t)}>${this.text}</code>`}clone(t){return new ae(this.id,this.text,this.language,t)}doAnnotationActionApply(t){k.executeTheStrategy(t,this)}doModifyActionApply(t){k.executeTheStrategy(t,this)}}k.register(A.UPDATE_CODE_BLOCK,ae.name,new class extends dt{handleAction(t,e){const{content:s,language:n}=t;e.language=n,e.text=s}}),k.register(re.name,ae.name,new class extends dt{handleAction(t,e){e.annotationMap.set(p.SELECTION_RANGE,t.toAnnotation())}}),ae.dtoName="RTECodeBlockNode";var ce;!function(t){t.CSS="css",t.HTML="html",t.JavaScript="js",t.JSX="jsx",t["Plain Text"]="plainText",t.TypeScript="ts",t.TSX="tsx"}(ce||(ce={}));class le extends dt{handleAction(t,e){e.children=e.children.filter((e=>e!==t.entityToBeRemoved)),0===e.children.length&&"parent"in e&&e.parent&&(e.isListItemBlock()&&e.nestList&&e.nestList.length||e.parent.apply(new Gt(e)))}}class he extends T{constructor(){super(...arguments),this.stylesToBeFiltered=he.STYLES,this.elementTagName="pre"}canFilter(t){return b.isCodeBlock(t.dtoName)}canRefill(t,e){return!1}toCssText(){return this.buildCssTextForStyles(this.elementTagName,this.classNameToBeAdded)}}he.STYLES={backgroundColor:"rgba(var(--v-bg-secondary, 245, 247, 247, 1))",padding:"12px"};class ue extends J{constructor(t,e,s){super(t),this.dtoName=ue.dtoName,this.type="code-block",this.annotationMap=new Map([I.from(he.STYLES)]),this.children=[new ae(`${t}-1`,e,s,this)]}static from(t){return new ue(t.id,t.content,t.language)}toJSON(){const{language:t,text:e}=this.children[0];return{id:this.id,type:"code-block",content:e,language:t}}toHtml(t){const{language:e=ce["Plain Text"]}=this.children[0];return`<pre data-language="${e}"${super.generateAttributeString(t)}>${this.children.map((e=>e.toHtml(t)))}</pre>`}clone(t){const e=ue.from(this.toJSON());return e.parent=t,e}apply(n){if(n instanceof E&&k.executeTheStrategy(n,this),n.isFlushable){const n=w.getDOMByEntity(this);if(n){const r=e.getSubjectFromParentNodeByEventId(n,s);r&&t.notify(r,{})}}}isNotEmpty(){return!!this.children.length}getLastNode(){return this.children[0]}isSelected(){return this.children[0].annotationMap.has(p.SELECTION_RANGE)}}k.register(A.DELETE_CODE_BLOCK,ue.name,new class extends se{handleAction(t,e){const s=e.children[0],n=e.parent;if(n){let t=this.getPreviousNode(s),r=this.getRTENodeEndOffset(t);t||(t=this.getNextNode(s),r=0),n.apply(new Gt(e));const i=t?w.getDOMByEntity(t):null;if(0===n.children.length){const s=ee.from({id:l(),type:"paragraph",nodes:[{id:l(),type:"text",text:""}]});e.parent.apply(new Bt([s])),t=s.children[0],r=0}this.notifyUpdateSelection(t,i,r,e)}}notifyUpdateSelection(s,r,i,o){const a=w.getDOMByEntity(o);if(a){const o=e.getSubjectFromParentNodeByEventId(a,n);o&&t.notify(o,{node:s,updateDirectly:!!r,offset:i})}}getRTENodeEndOffset(t){return t?t.getRangeEndOffset():0}}),k.register(A.DELETE_CHILDREN,ue.name,new le),k.register(A.SWITCH_OUT_FROM_CODE_BLOCK,ue.name,new class extends dt{handleAction(s,r){const{content:i,language:o}=s,a=i.split("\n"),c=new ne(a.slice(0,a.length-2).join("\n"),o);c.isFlushable=!1,r.children[0].apply(c);const h=ee.from({id:l(),type:"paragraph",nodes:[{id:l(),text:"",type:"text"}]});r.parent.apply(new Jt(r,h));const u=w.getDOMByEntity(r);if(u){const s=e.getSubjectFromParentNodeByEventId(u,n);s&&t.notify(s,{node:h.children[0]})}}}),k.register(A.INSERT_IMAGE_TO_BLOCK,ue.name,new class extends dt{handleAction(t,e){e.parent.apply(new Jt(e,t.imageBlockToBeInserted))}}),ue.CODE_BLOCK_PLACEHOLDER_CLASS_NAME="code-block-placeholder-element",ue.dtoName="RTECodeBlock";export{st as $,k as A,x as B,y as C,f as D,B as E,N as F,ie as G,Qt as H,Jt as I,m as J,$ as K,Kt as L,E as M,O as N,Yt as O,at as P,se as Q,F as R,ut as S,Ht as T,Ct as U,ot as V,le as W,z as X,G as Y,S as Z,nt as _,_ as a,V as a0,q as a1,X as a2,Ft as a3,b as a4,R as a5,et as a6,C as a7,he as a8,ae as a9,oe as aa,ce as ab,it as ac,rt as ad,mt as ae,ne as af,re as ag,$t as ah,gt as ai,yt as aj,St as ak,tt as al,wt as am,At as an,Et as ao,te as ap,P as b,Lt as c,J as d,ee as e,M as f,dt as g,Bt as h,H as i,qt as j,p as k,A as l,K as m,Gt as n,L as o,T as p,ue as q,I as r,w as s,Pt as t,Zt as u,Vt as v,Xt as w,Ut as x,Wt as y,zt as z}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Q as r}from"./p-
|
|
1
|
+
import{Q as r}from"./p-f7ad9349.js";import{I as e}from"./p-abd7aeaa.js";class s extends e{constructor(r){super(),this.config=r}evaluate(e){if(!this.isAcceptedInputType(e))throw new Error(`Invalid time value ${e} for range mode`);const s=Array.isArray(e)&&2===e.length&&e.every((e=>r(e,this.config.timeFormat)));return{isValid:s,message:s?"":"This field is required"}}canEvaluate(r,e){return e?this.isAcceptedInputType(r)&&!e.disabled&&e.visible:this.isAcceptedInputType(r)}shouldShowError(r){return!r.disabled&&r.visible&&(r.touched||r.modified)}isAcceptedInputType(r){return null==r||Array.isArray(r)}}class t extends e{constructor(r){super(),this.config=r}evaluate(e){if(!this.isAcceptedInputType(e))throw new Error(`Invalid time value ${e}`);const s=r(e,this.config.timeFormat);return{isValid:s,message:s?"":"This field is required"}}canEvaluate(r,e){return e?this.isAcceptedInputType(r)&&!e.disabled&&e.visible:this.isAcceptedInputType(r)}shouldShowError(r){return!r.disabled&&r.visible&&(r.touched||r.modified)}isAcceptedInputType(r){return null==r||"string"==typeof r}}export{s as T,t as a}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as t,F as e,r as n,c as o,H as i,g as r}from"./p-6b2342e0.js";import{c as s,V as a,M as c,I as l}from"./p-6e1ab235.js";import{V as d,I as p}from"./p-8ce9e214.js";import{s as u}from"./p-519a7d55.js";import{V as h}from"./p-724df1f5.js";import{t as f}from"./p-aacf6920.js";import{D as v,d as b}from"./p-11e2dcf5.js";import{i as g,a as m,p as y}from"./p-05dc6718.js";import{ab as x}from"./p-3312e3dd.js";import{a as C}from"./p-ec2a1d4c.js";import{C as w}from"./p-2d0d575f.js";import{y as j,x as k}from"./p-3a93730e.js";import{c as R}from"./p-6629a68b.js";import{d as O}from"./p-a841cf13.js";import{T as E}from"./p-fdf6f368.js";import{S,a as F,C as $}from"./p-6bd37d32.js";import{A as L}from"./p-4d65756f.js";import{d as A}from"./p-1bc5b3bc.js";import{C as T}from"./p-7292ac20.js";import{C as D}from"./p-2bb5a232.js";import"./p-1704ff25.js";import"./p-9a6bd32c.js";import"./p-6a334573.js";import"./p-8b5d3a52.js";import"./p-331a62d5.js";import"./p-02841589.js";import"./p-f7ad9349.js";import"./p-ed45b3b6.js";import"./p-d4ea8e22.js";import"./p-d884c644.js";import"./p-fea75b87.js";import"./p-a528714c.js";import"./p-b565a6a5.js";import"./p-fb5ea4b2.js";import"./p-4866e390.js";import"./p-b75ee3ba.js";import"./p-f0e828d8.js";import"./p-c84aa55a.js";import"./p-0b2ca33b.js";import"./p-ffda64ac.js";import"./p-8ee917b4.js";import"./p-1fb56e14.js";import"./p-5f377954.js";import"./p-dcf162e9.js";import"./p-982747ef.js";var H=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};class P extends a{constructor(){super(...arguments),this.languageDropdownProps={searchable:!1},this.languageOptions=Object.keys(x).map((t=>({id:x[t],displayName:t}))),this.handleLanguageChange=t=>{v.addUniqueObserverToNode(t,g,(t=>{var e;this.valueController.updateValue(null===(e=this.value)||void 0===e?void 0:e.code,t.detail)}))},this.handleDeleteClick=t=>{v.addUniqueObserverToNode(t,m,(()=>{this.removeEventEmitter.emit().defaultPrevented||this.host.remove()}))}}getToolbarContainerRef(){return this.toolbarContainerRef}render(){return t(e,null,t("div",{part:"editor-toolbar",contenteditable:!1,class:{"editor-toolbar":!this.readOnly,"copy-button-container":this.showCopyButton&&this.readOnly},ref:t=>this.toolbarContainerRef=t},this.renderEditorToolbar(),this.copyButtonRenderer.render()),this.contentRenderer.render())}renderEditorToolbar(){var n,o;if(!this.readOnly)return t(e,null,t("vega-input-select",{source:this.languageOptions,value:null!==(o=null===(n=this.value)||void 0===n?void 0:n.language)&&void 0!==o?o:"",disabled:this.disabled,placeholder:this.translationSlimmer.t("Select Language"),size:"small",vegaDropdownProps:this.languageDropdownProps,exportparts:"select-container, selected-box, placeholder, toggle-icon-container, toggle-icon",ref:this.handleLanguageChange}),t("vega-button-circle",{key:"delete-button",disabled:this.disabled,label:this.translationSlimmer.t("Delete Code"),icon:h.getIconKey("trash-can"),iconColor:"text-secondary",variant:"icon-only",size:"extra-small",ref:this.handleDeleteClick}))}}h.register({"trash-can":f}),H([s()],P.prototype,"readOnly",void 0),H([s()],P.prototype,"host",void 0),H([s()],P.prototype,"disabled",void 0),H([s()],P.prototype,"showCopyButton",void 0),H([s()],P.prototype,"value",void 0),H([s()],P.prototype,"contentRenderer",void 0),H([s()],P.prototype,"valueController",void 0),H([s()],P.prototype,"removeEventEmitter",void 0),H([s()],P.prototype,"translationSlimmer",void 0),H([s()],P.prototype,"copyButtonRenderer",void 0);var N=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};class _ extends a{constructor(){super(...arguments),this.handleFocus=()=>{this.readOnly||this.disabled||this.host.classList.add("focus")},this.handleBlur=()=>{this.host.classList.remove("focus"),w.notify(b.getSubject(this.host,j),null)}}getCodeContentContainerRef(){return this.codeContentContainerRef}registerEventListener(){this.codeContentContainerRef&&(this.codeContentContainerRef.addEventListener("focusin",this.handleFocus),this.codeContentContainerRef.addEventListener("focusout",this.handleBlur))}unregisterEventListener(){this.codeContentContainerRef&&(this.codeContentContainerRef.removeEventListener("focusin",this.handleFocus),this.codeContentContainerRef.removeEventListener("focusout",this.handleBlur))}render(){var n;const o=this.contentParseController.parseCode(),i=(null===(n=this.value)||void 0===n?void 0:n.language)||"";return t(e,null,t("style",null,this.getLineNumberStyleVariable(o)),t("code",{role:"textbox",tabIndex:0,spellcheck:!1,ref:t=>this.codeContentContainerRef=t,contenteditable:!this.readOnly&&!this.disabled,"data-language":i,innerHTML:o.map((t=>this.renderCodeNode(t))).join("")}))}renderCodeNode(t){const{key:e,className:n,mark:o,text:i}=t;return`<span key='${e}' class='${n}' data-mark='${o}' data-index='${e}'>${i}</span>`}getLineNumberStyleVariable(t){const e=10*(t.filter((t=>"\n"===t.text)).length+1).toString().length;return`code{--v-code-line-number-width:${e}px;--v-code-line-number-ml:-${e+16}px;--v-code-block-pl:${e+16}px}`}}N([s()],_.prototype,"host",void 0),N([s()],_.prototype,"readOnly",void 0),N([s()],_.prototype,"disabled",void 0),N([s()],_.prototype,"value",void 0),N([s()],_.prototype,"contentParseController",void 0),N([c("componentDidLoad")],_.prototype,"registerEventListener",null),N([c("disconnectedCallback")],_.prototype,"unregisterEventListener",null);var z=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};class B extends a{updateValue(t,e,n){this.value&&this.value.code===t&&this.value.language===e||(this.value={language:e,code:t},this.changeEventEmitter.emit(this.value),n&&n.recordHistory&&this.historyController.registerHistory({value:this.value,offset:n.offset}))}initialValue(){this.value||(this.value={code:"",language:"plainText"})}}z([s({writable:!0})],B.prototype,"value",void 0),z([s()],B.prototype,"changeEventEmitter",void 0),z([s()],B.prototype,"historyController",void 0),z([c("connectedCallback")],B.prototype,"initialValue",null);var I=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};class M extends a{constructor(){super(...arguments),this.codeNodes=[]}getCurrentCodeNodes(){return this.codeNodes}parseCode(){const t=[this.prismCodeHighlightParser,this.defaultCodeHighlightParser];let e=[];for(const n of t)if(n.canParse()){e=n.parse();break}return this.codeNodes=e,e}}I([s()],M.prototype,"prismCodeHighlightParser",void 0),I([s()],M.prototype,"defaultCodeHighlightParser",void 0);class V{constructor(t){this.contentOffset=0,this.selectedText="",this.codeContainerRef=t}updateRange(t,e,n,o=""){const i=new V(this.codeContainerRef);return i.selectedText=o,i.contentOffset=i.getContentOffset(t,e,n),i}updateContentOffset(t){return this.contentOffset=Math.max(0,t),this.selectedText="",this.contentOffset}createNativeRange(t){const{nodeIndex:e,offset:n}=this.getFocusNodeState(t,this.contentOffset),o=new Range,i=this.codeContainerRef.querySelector(`span[data-index="${e}"]`);if(i){const t=Math.min(i.firstChild.textContent.length,n);return o.setStart(i.firstChild,t),o.setEnd(i.firstChild,t),o}}getContentOffset(t,e,n){let o=t.nodeType===Node.TEXT_NODE?t.parentElement:t;if("CODE"===o.nodeName&&o.childNodes&&o.childNodes.length&&(o=o.childNodes[Math.min(e,o.childNodes.length-1)],e=0),o&&o.hasAttribute("data-index")){const t=Number(o.dataset.index);let i="";for(let e=0;e<t;e++)i+=n[e].text;return i.length+e}return 0}getFocusNodeState(t,e){const n=this.getCodeContent(t),o={nodeIndex:0,offset:0};if(!n||e>=n.length)o.nodeIndex=t.length-1,o.offset=t[o.nodeIndex].text.length;else{let n="";for(let i=0;i<t.length;i++)if(n+=t[i].text,n.length>=e){o.offset=Math.max(0,t[i].text.length-(n.length-e)),o.nodeIndex=i;break}}return"\n"===t[o.nodeIndex].text&&o.offset>0&&t[o.nodeIndex+1]&&(o.nodeIndex+=1,o.offset=0),o}getCodeContent(t){return t.map((t=>t.text)).join("")}}var Z=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};class U extends L{constructor(){super(1),this.handleSelectionWithDebounce=A(this.handleSelectionChange,U.SELECTION_CHANGE_DEBOUNCE_TIME,this),this.doTask=async()=>{await Promise.resolve();const t=this.getSelection(),e=this.codeBlockRange.createNativeRange(this.contentParseController.getCurrentCodeNodes());t&&e&&(t.removeAllRanges(),t.addRange(e))}}getCurrentRange(){return this.codeBlockRange}setNextCodeBlockRange(t,e=!1){this.codeBlockRange.updateContentOffset(t),super.enqueueTheTaskIntoQueue(e)}addSelectionChangeEventListener(){this.codeBlockRange=new V(this.contentRenderer.getCodeContentContainerRef()),document.addEventListener("selectionchange",this.handleSelectionWithDebounce)}removeSelectionChangeEventListener(){document.removeEventListener("selectionchange",this.handleSelectionWithDebounce)}getSelection(){return S.getSelection(this.host.shadowRoot)}handleSelectionChange(){const t=this.getSelection();t&&t.rangeCount>0?(this.syncCodeRangeByNativeRange(),w.notify(b.getSubject(this.host,k),{detail:!0})):w.notify(b.getSubject(this.host,k),{detail:!1})}syncCodeRangeByNativeRange(){const t=this.getSelection();if(this.isCodeBlockActive()&&0===this.autoRunTaskQueue.queue.length&&!this.insertCompositionTextController.isComposing()){const e=t.getRangeAt(0),{startContainer:n,startOffset:o}=e;this.codeBlockRange=this.codeBlockRange.updateRange(n,o,this.contentParseController.getCurrentCodeNodes(),e.toString())}}isCodeBlockActive(){return this.host&&this.host.classList.contains("focus")}}U.SELECTION_CHANGE_DEBOUNCE_TIME=Math.min(F.SELECTION_CHANGE_DEBOUNCE_TIME,40),Z([s()],U.prototype,"host",void 0),Z([s()],U.prototype,"contentRenderer",void 0),Z([s()],U.prototype,"contentParseController",void 0),Z([s()],U.prototype,"insertCompositionTextController",void 0),Z([c("componentDidLoad")],U.prototype,"addSelectionChangeEventListener",null),Z([c("disconnectedCallback")],U.prototype,"removeSelectionChangeEventListener",null);class Y extends a{deleteSelectedText(t,e,n){return n>=t.length?"":t.slice(0,e)+t.slice(e+n)}getCodeNodesContent(t){return t.map((t=>t.text)).join("")}stopEventPropagation(t){t&&"function"==typeof t.stopPropagation&&t.stopPropagation()}reCalculateRangeAndContent(t,e,n){let o=t.contentOffset,i=e;return t&&(t.selectedText.length&&(i=this.deleteSelectedText(i,t.contentOffset,t.selectedText.length)),i=i.slice(0,t.contentOffset)+n+i.slice(t.contentOffset),o=t.contentOffset+n.length),{nextOffset:o,updatedContent:i}}}var G=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};class q extends Y{constructor(){super(...arguments),this.handleInputEvent=t=>{this.stopEventPropagation(t),this.updateCodeContent()},this.handleBeforeInput=t=>{switch(t.stopPropagation(),t.inputType){case"deleteContentBackward":return void(this.value&&this.value.code&&""!==this.value.code?this.handleDeleteAction(t):t.preventDefault());case"historyUndo":case"historyRedo":return void t.preventDefault()}this.updateCodeBlockRange(t)}}registerInputEvent(){const t=this.contentRenderer.getCodeContentContainerRef();t&&(t.addEventListener("beforeinput",this.handleBeforeInput),t.addEventListener("input",this.handleInputEvent))}unregisterEventListener(){const t=this.contentRenderer.getCodeContentContainerRef();t&&(t.removeEventListener("beforeinput",this.handleBeforeInput),t.removeEventListener("input",this.handleInputEvent))}handleDeleteAction(t){const e=this.selectionController.getCurrentRange();if(e){t.preventDefault();const n=e.contentOffset,o=this.contentParseController.getCurrentCodeNodes();let i=this.getCodeNodesContent(o),r=n;e.selectedText.length?i=this.deleteSelectedText(i,n,e.selectedText.length):n>0&&(i=i.slice(0,n-1)+i.slice(n),r-=1),this.selectionController.setNextCodeBlockRange(r),this.valueController.updateValue(i,this.value.language,{recordHistory:!0,offset:r})}}updateCodeBlockRange(t){const e=this.selectionController.getCurrentRange();!this.insertCompositionTextController.isComposing()&&e&&this.selectionController.setNextCodeBlockRange(e.contentOffset+this.getInsertDataLength(t))}getInsertDataLength(t){const{data:e,inputType:n}=t;switch(n){case"insertText":return e.length;case"insertParagraph":case"insertLineBreak":return 1;default:return 0}}updateCodeContent(){var t;if(!this.insertCompositionTextController.isComposing()){let e=this.contentRenderer.getCodeContentContainerRef().innerText;this.isInsertLineBreakInLowVersionFirefox(e)&&(e+="\n"),this.valueController.updateValue(e,null===(t=this.value)||void 0===t?void 0:t.language,{recordHistory:!0,offset:this.selectionController.getCurrentRange().contentOffset})}}isInsertLineBreakInLowVersionFirefox(t){var e;const n=(null===(e=this.value)||void 0===e?void 0:e.code)||"";return!n.endsWith("\n")&&t===n+"\n"}}G([s()],q.prototype,"selectionController",void 0),G([s()],q.prototype,"contentRenderer",void 0),G([s()],q.prototype,"valueController",void 0),G([s()],q.prototype,"contentParseController",void 0),G([s()],q.prototype,"insertCompositionTextController",void 0),G([s()],q.prototype,"value",void 0),G([c("componentDidLoad")],q.prototype,"registerInputEvent",null),G([c("disconnectedCallback")],q.prototype,"unregisterEventListener",null);var W=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};class X extends a{focusAndUpdateSelection(){if(!this.disabled&&!this.readOnly){const t=this.contentRenderer.getCodeContentContainerRef();t&&(t.focus(),this.selectionController.setNextCodeBlockRange(this.value&&this.value.code&&" "!==this.value.code?this.value.code.length:0,!0))}}removeFocusAfterDisabled(){(this.disabled||this.readOnly)&&this.host.classList.remove("focus")}}W([s()],X.prototype,"host",void 0),W([s()],X.prototype,"value",void 0),W([s()],X.prototype,"readOnly",void 0),W([s()],X.prototype,"disabled",void 0),W([s()],X.prototype,"contentRenderer",void 0),W([s()],X.prototype,"selectionController",void 0),W([c("doFocus")],X.prototype,"focusAndUpdateSelection",null),W([c("watchEditableChange")],X.prototype,"removeFocusAfterDisabled",null);var J=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};class K extends a{constructor(){super(...arguments),this.handleCopyClick=t=>{v.addUniqueObserverToNode(t,m,(async()=>{var e;const n=(null===(e=this.value)||void 0===e?void 0:e.code)||"";if(n&&globalThis.navigator&&globalThis.navigator.clipboard){clearTimeout(this.updateLabelTimer),await globalThis.navigator.clipboard.writeText(n);const e=this.translationSlimmer.t("Copy Code");t.label=this.translationSlimmer.t("Copied"),this.updateLabelTimer=setTimeout((()=>{t&&(t.label=e)}),K.RESET_TOOLTIP_TIME)}}))}}render(){if(this.showCopyButton&&this.readOnly)return t("vega-button-circle",{key:"copy-button",label:this.translationSlimmer.t("Copy Code"),class:"copy-code-button",icon:h.getIconKey("copy"),iconColor:"text-secondary",variant:"icon-only",size:"extra-small",ref:this.handleCopyClick})}}function Q(t,e){if(!t||!e)return[t];const n=[t];return function(t,e){const n=[],o=[];for(const t of Object.keys(e)){const i=e[t],r=Array.isArray(i)?i:[i];for(const e of r)e.greedy?n.push({tokenType:t,patternDef:e}):o.push({tokenType:t,patternDef:e})}n.length>0&&function(t,e){for(let n=0;n<t.length;n++){const o=t[n];if("string"!=typeof o)continue;const i=o;let r=i;const s=[];for(const{tokenType:t,patternDef:n}of e){const{pattern:e,lookbehind:o,inside:a}=n,c=new RegExp(e.source,e.flags.replace(/g/g,"")+"g");let l;for(;null!==(l=c.exec(r));){let e=l.index,n=l[0];if(0===n.length){c.lastIndex++;continue}if(-1!==n.indexOf("\0GREEDY_PLACEHOLDER\0"))continue;if(o&&l[1]){const t=l[1].length;e+=t,n=n.slice(t)}const d=e+n.length;s.push({tokenType:t,matchStart:e,matchEnd:d,matchText:i.slice(e,d),inside:a}),r=r.slice(0,e)+"\0GREEDY_PLACEHOLDER\0".repeat(n.length).slice(0,n.length)+r.slice(d)}}if(0===s.length)continue;s.sort(((t,e)=>t.matchStart-e.matchStart));const a=[];let c=0;for(const t of s){t.matchStart>c&&a.push(i.slice(c,t.matchStart));let e=t.matchText;if(t.inside){const n=Q(t.matchText,t.inside);e=1===n.length?n[0]:n}a.push({type:t.tokenType,content:e}),c=t.matchEnd}c<i.length&&a.push(i.slice(c)),t.splice(n,1,...a),n+=a.length-1}}(t,n);for(const{tokenType:e,patternDef:n}of o)tt(t,e,n)}(n,e),n}function tt(t,e,n){for(let o=0;o<t.length;o++){const i=t[o];if("string"!=typeof i)continue;const r=et(i,e,n);1===r.length&&"string"==typeof r[0]||(t.splice(o,1,...r),o+=r.length-1)}}function et(t,e,n){const{pattern:o,lookbehind:i,inside:r}=n,s=new RegExp(o.source,o.flags.replace(/g/g,"")+"g"),a=[];let c,l=0;for(;null!==(c=s.exec(t));){let n=c.index,o=c[0];if(0===o.length){s.lastIndex++;continue}if(i&&c[1]){const t=c[1].length;n+=t,o=o.slice(t)}n>l&&a.push(t.slice(l,n));let d=o;if(r){const t=Q(o,r);d=1===t.length?t[0]:t}a.push({type:e,content:d}),l=n+o.length}return l<t.length&&a.push(t.slice(l)),0===a.length?[t]:a}h.register({copy:{icon:'<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12"><g clip-path="url(#clip0_70002_574)"><path fill="currentColor" d="M11.7794 1.65539L10.3439 0.219844C10.2044 0.0790078 10.0122 0 9.81303 0H5.97865C5.15014 0 4.47865 0.671719 4.47865 1.5L4.47911 7.5C4.49975 8.32969 5.1724 9 5.99975 9H10.4997C11.3247 9 11.9997 8.325 11.9997 7.5V2.18555C11.9997 1.9868 11.9201 1.79602 11.7794 1.65539ZM10.8747 7.5C10.8747 7.70709 10.7068 7.875 10.4997 7.875H5.97865C5.77151 7.875 5.60365 7.70709 5.60365 7.5V1.50305C5.60365 1.29595 5.77156 1.12805 5.97865 1.12805H8.97865L8.99975 2.25C8.99975 2.66414 9.33561 3 9.74975 3H10.8537V7.5H10.8747ZM6.37475 10.5C6.37475 10.7071 6.20684 10.875 5.99975 10.875H1.47865C1.27151 10.875 1.10365 10.7071 1.10365 10.5L1.12428 4.50234C1.12428 4.29525 1.29218 4.12734 1.49928 4.12734H3.74975V3H1.49951C0.670996 3 -0.000488281 3.67148 -0.000488281 4.5L-0.000258594 10.5C-0.000207031 11.3273 0.671465 12 1.49975 12H5.99975C6.82475 12 7.49975 11.325 7.49975 10.5V9.75H6.39584L6.37475 10.5Z"/></g><defs><clipPath id="clip0_70002_574"><rect width="12" height="12" fill="currentColor"/></clipPath></defs></svg>'}}),K.RESET_TOOLTIP_TIME=1e3,J([s()],K.prototype,"value",void 0),J([s()],K.prototype,"readOnly",void 0),J([s()],K.prototype,"showCopyButton",void 0),J([s()],K.prototype,"translationSlimmer",void 0);const nt={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"']|"[^"]*"|'[^']*')+(?:>|$)/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0},punctuation:{pattern:/^<!|>$|[[\]]/},"doctype-tag":{pattern:/^DOCTYPE/i},name:{pattern:/[^\s<>'"/]+/},string:{pattern:/("|')[\s\S]*?\1/,greedy:!0}}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>/=$<%]+(?:\s(?:\s*[^\s>/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>/]+/,inside:{punctuation:{pattern:/^<\/?/},namespace:{pattern:/^[^\s>/:]+:/}}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:{pattern:/\/?>/},"attr-name":{pattern:/[^\s>/]+/,inside:{namespace:{pattern:/^[^\s>/:]+:/}}}}},entity:[{pattern:/&[\da-z]{1,8};/i},{pattern:/&#x?[\da-f]{1,8};/i}]},ot={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:[{pattern:/(["'])(?:\\[\s\S]|(?!\1)[^\\\r\n])*\1/,greedy:!0}],"template-string":{pattern:/`(?:\\[\s\S]|[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/},interpolation:{pattern:/\$\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})*\}/,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/}}},string:{pattern:/[\s\S]+/}}},regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[.\r\n,;:})\]]|\/\/))/,lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0},"regex-delimiter":{pattern:/^\/|\/$/},"regex-flags":{pattern:/^[a-z]+$/}}},"class-name":[{pattern:/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,lookbehind:!0,inside:{punctuation:{pattern:/[.\\]/}}}],keyword:[{pattern:/\b(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/}],boolean:{pattern:/\b(?:false|true)\b/},number:{pattern:/\b(?:(?:0[xX][\dA-Fa-f](?:_[\dA-Fa-f])*|0[bB][01](?:_[01])*|0[oO][0-7](?:_[0-7])*)n?|(?:\d(?:_\d)*\.?\d*|\.\d+)(?:[Ee][+-]?\d(?:_\d)*)?n?|NaN|Infinity)\b/},function:{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/},operator:{pattern:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%|&^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/},punctuation:{pattern:/[{}[\];(),.:]/},constant:{pattern:/\b[A-Z](?:[A-Z_]|\dx)*\b/}};const{function:it,punctuation:rt}=ot,st=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(t);i<o.length;i++)e.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(t,o[i])&&(n[o[i]]=t[o[i]])}return n}(ot,["keyword","function","operator","punctuation"]),at=Object.assign(Object.assign({},st),{"class-name":[{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:{punctuation:{pattern:/[<>.,]/}}}],builtin:{pattern:/\b(?:Array|Boolean|Date|Function|Map|Number|Object|Promise|RegExp|Set|String|WeakMap|WeakSet|bigint|boolean|never|null|number|string|symbol|undefined|unknown|void)\b/},keyword:[{pattern:/\b(?:abstract|as|asserts|async|await|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|infer|instanceof|interface|is|keyof|let|module|namespace|new|null|of|package|private|protected|public|readonly|return|require|set|static|super|switch|this|throw|try|type|typeof|undefined|var|void|while|with|yield)\b/}],function:it,"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:{pattern:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/},generic:{pattern:/<[\s\S]+/,inside:{punctuation:{pattern:/[<>(),.]/},keyword:{pattern:/\b(?:extends|infer|keyof)\b/},builtin:{pattern:/\b(?:boolean|never|null|number|string|symbol|undefined|unknown|void)\b/}}}}},operator:{pattern:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%|&^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]|!(?=\s*[^=])/},punctuation:rt}),ct=Object.assign(Object.assign({tag:{pattern:/<\/?(?:[\w.:-]+(?:\s+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])+\}))?|\{\.{3}[a-z_$][\w$]*(?:\.[\w$]+)*\}))*\s*\/?)?>/i,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>/]*/,inside:{punctuation:{pattern:/^<\/?/},namespace:{pattern:/^[^\s>/:]+:/}}},"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])+\})/,inside:{punctuation:[{pattern:/^=/},{pattern:/^(\s*)["'{]|[}"']$/,lookbehind:!0}],script:{pattern:/[\s\S]+/,inside:ot}}},spread:{pattern:/\{\.{3}[a-z_$][\w$]*(?:\.[\w$]+)*\}/,inside:{punctuation:{pattern:/^\{\.{3}|\}$/},"attr-name":{pattern:/[\s\S]+/}}},"attr-name":{pattern:/[^\s>/]+/,inside:{namespace:{pattern:/^[^\s>/:]+:/}}},punctuation:{pattern:/\/?>/}}}},ot),{entity:nt.entity}),lt={css:{comment:{pattern:/\/\*[\s\S]*?\*\//,greedy:!0},string:{pattern:/("|')(?:\\[\s\S]|(?!\1)[^\\\n\r])*\1/,greedy:!0},atrule:[{pattern:/@[\w-](?:[^;{\s]|\s+(?![\s{]))*(?:;|(?=\s*\{))/,inside:{rule:{pattern:/^@[\w-]+/},"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0},punctuation:{pattern:/[;:(){}]/}}}],url:{pattern:/\burl\((?:("|')(?:\\[\s\S]|(?!\1)[^\\\n\r])*\1|(?:[^\\\r\n()"']|\\[\s\S])*)\)/i,greedy:!0,inside:{function:{pattern:/^url/i},punctuation:{pattern:/^\(|\)$/},string:{pattern:/^("|')[\s\S]+(?=\1$)/,lookbehind:!0}}},selector:{pattern:/(?=\S)[^@;{}()]?(?:[^@;{}()\s]|\s+(?![\s{])|\((?:[^()]|\([^()]*\))*\))*(?=\s*\{)/,inside:{"pseudo-element":{pattern:/(?:::)[\w-]+/},"pseudo-class":{pattern:/(?::)[\w-]+/},class:{pattern:/\.[\w-]+/},id:{pattern:/#[\w-]+/},attribute:{pattern:/\[(?:[^[\]"']|("|')(?:\\[\s\S]|(?!\1)[^\\\n\r])*\1)*\]/,greedy:!0,inside:{punctuation:{pattern:/^\[|\]$/},"attr-name":{pattern:/^(\s*)(?:(?!\s)[-\w\u00B7\u00C0-\u024F])+/i,lookbehind:!0},"attr-value":[{pattern:/(=\s*)(?:"[^"]*"|'[^']*'|[^\s'"=]+)/,lookbehind:!0}],operator:{pattern:/[|~*^$]?=/}}}}},property:{pattern:/(?!\s)[-_a-z\u00B7\u00C0-\u024F][-\w\u00B7\u00C0-\u024F]*(?=\s*:)/i},important:{pattern:/!important\b/i},function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},number:{pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?/i,lookbehind:!0},unit:{pattern:/(\b\d+)(?:%|[a-z]+)/,lookbehind:!0},punctuation:{pattern:/[(){};:,]/},operator:{pattern:/[+\-*/=><~^|]+/}},html:nt,markup:nt,javascript:ot,js:ot,typescript:at,ts:at,jsx:ct,tsx:Object.assign(Object.assign({tag:ct.tag},at),{entity:ct.entity}),c:ot,clike:ot};const dt=Object.values(x);class pt extends a{splitTag(t){if(!this.hasSpecialCharacter(t)||t.length<2)return[t];{const e=[],n=t.split("");let o=0;return n.forEach((t=>{"<"===t||">"===t||"/"===t?(e.push(t),o=e.length):e[o]=e[o]?e[o]+t:t})),e}}isHighlightLanguage(t){return"plainText"!==t&&dt.includes(t)}markLineNumberNodes(t){0===t.length&&t.push({text:"\n",key:"0",className:""});let e=0;return t.map(((n,o)=>{let i=n.className;return 0!==o&&"\n"!==t[o-1].text||(e++,i=`v-code-line-number ${n.className}`),{text:n.text,key:`${o}`,className:i,mark:`${e}`}}))}hasSpecialCharacter(t){return/[<|>|\\/]/.test(t)}}!function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);r>3&&s&&Object.defineProperty(e,n,s)}([s()],pt.prototype,"value",void 0);class ut extends pt{canParse(){const{code:t,language:e}=this.value||{code:""};return t&&e&&this.isHighlightLanguage(e)}parse(){const{code:t,language:e}=this.value;let n=[];const o=Q(t,function(t){return lt[t]}(e));return n=this.getHighlightNodes(o),this.markLineNumberNodes(n)}getHighlightNodes(t,e){const n=[];for(const o of t)if("string"==typeof o){const t=o.split(/(\n|\t)/),i=t.length;for(let o=0;o<i;o++){const i=t[o];if(i){const t=this.splitTag(i);n.push(...t.map((t=>this.createCodeNode(t,e))))}}}else{const{content:t}=o;"string"==typeof t?n.push(...this.getHighlightNodes([t],o.type)):Array.isArray(t)&&n.push(...this.getHighlightNodes(t,o.type))}return n}createCodeNode(t,e){return{text:t,key:"",className:`token ${e||""}`,mark:""}}}class ht extends pt{canParse(){const{code:t,language:e}=this.value||{code:""};return!t||!e||"plainText"===e||!this.isHighlightLanguage(e)}parse(){var t,e;const n=(null!==(e=null===(t=this.value)||void 0===t?void 0:t.code)&&void 0!==e?e:"").split(/(\n)/);let o=[];return n.forEach((t=>{if(t){const e=this.splitTag(t);o.push(...e.map((t=>({text:t,key:"",className:""}))))}})),o=this.markLineNumberNodes(o),o}}var ft=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};class vt extends a{constructor(){super(...arguments),this.insertCompositionTextEndFlag=!0,this.handleCompositionStart=t=>{this.insertCompositionTextEndFlag=!1,this.stopEventPropagation(t)},this.handleCompositionEnd=t=>{var e;this.insertCompositionTextEndFlag=!0,this.stopEventPropagation(t);const n=this.selectionController.getCurrentRange();n&&this.selectionController.setNextCodeBlockRange(n.contentOffset+t.data.length);const o=this.contentRenderer.getCodeContentContainerRef().innerText;this.valueController.updateValue(o,null===(e=this.value)||void 0===e?void 0:e.language)}}isComposing(){return!this.insertCompositionTextEndFlag}registerInputEvent(){const t=this.contentRenderer.getCodeContentContainerRef();t&&(t.addEventListener("compositionstart",this.handleCompositionStart),t.addEventListener("compositionend",this.handleCompositionEnd))}unregisterEventListener(){const t=this.contentRenderer.getCodeContentContainerRef();t&&(t.removeEventListener("compositionstart",this.handleCompositionStart),t.removeEventListener("compositionend",this.handleCompositionEnd))}stopEventPropagation(t){t.stopPropagation()}}ft([s()],vt.prototype,"selectionController",void 0),ft([s()],vt.prototype,"contentRenderer",void 0),ft([s()],vt.prototype,"valueController",void 0),ft([s()],vt.prototype,"contentParseController",void 0),ft([s()],vt.prototype,"value",void 0),ft([c("componentDidLoad")],vt.prototype,"registerInputEvent",null),ft([c("disconnectedCallback")],vt.prototype,"unregisterEventListener",null);var bt=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};class gt extends ${constructor(){super(...arguments),this.getEffectiveTargets=()=>[this.contentRenderer.getCodeContentContainerRef()]}async undo(){if(this.undoStack.length>1){const t=this.undoStack.pop();this.redoStack.push(t);const e=this.undoStack[this.undoStack.length-1];e&&await this.restoreState(e)}}async redo(){const t=this.redoStack.pop();this.undoStack.push(t),await this.restoreState(t)}initialHistory(){this.registerHistory({value:this.value,offset:this.value.code.length},!0)}getIneffectiveTargets(){return[]}async restoreState(t){const{value:e,offset:n}=t;this.selectionController.setNextCodeBlockRange(n),this.valueController.updateValue(e.code,e.language)}}bt([s()],gt.prototype,"contentRenderer",void 0),bt([s()],gt.prototype,"value",void 0),bt([s()],gt.prototype,"valueController",void 0),bt([s()],gt.prototype,"selectionController",void 0),bt([c("componentDidLoad")],gt.prototype,"initialHistory",null);var mt=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};class yt extends Y{constructor(){super(...arguments),this.handlePasteEvent=t=>{var e,n;t.preventDefault(),this.stopEventPropagation(t);const o=t.clipboardData;if(null===(e=null==o?void 0:o.files)||void 0===e?void 0:e.length)return;const i=null!==(n=null==o?void 0:o.getData("text/plain"))&&void 0!==n?n:"";i&&this.updateCodeBlockRangeAndContent(i)}}registerInputEvent(){const t=this.contentRenderer.getCodeContentContainerRef();t&&t.addEventListener("paste",this.handlePasteEvent)}unregisterEventListener(){const t=this.contentRenderer.getCodeContentContainerRef();t&&t.removeEventListener("paste",this.handlePasteEvent)}updateCodeBlockRangeAndContent(t){const{nextOffset:e,updatedContent:n}=this.getLatestRangeAndContent(t);this.selectionController.setNextCodeBlockRange(e),this.valueController.updateValue(n,this.value.language,{recordHistory:!0,offset:this.selectionController.getCurrentRange().contentOffset})}getLatestRangeAndContent(t){const e=this.selectionController.getCurrentRange(),n=this.contentParseController.getCurrentCodeNodes(),o=this.getCodeNodesContent(n);return this.reCalculateRangeAndContent(e,o,t)}}mt([s()],yt.prototype,"host",void 0),mt([s()],yt.prototype,"valueController",void 0),mt([s()],yt.prototype,"contentRenderer",void 0),mt([s()],yt.prototype,"value",void 0),mt([s()],yt.prototype,"selectionController",void 0),mt([s()],yt.prototype,"contentParseController",void 0),mt([s()],yt.prototype,"inputController",void 0),mt([c("componentDidLoad")],yt.prototype,"registerInputEvent",null),mt([c("disconnectedCallback")],yt.prototype,"unregisterEventListener",null);var xt=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};const Ct=class{constructor(t){n(this,t),this.vegaChange=o(this,"vegaChange",7),this.change=o(this,"change",7),this.vegaRemove=o(this,"vegaRemove",7),this.remove=o(this,"remove",7),this.globalSlimmers={},this.componentGlobalStyleSlimmer=new D(":root{--code-orange:#cd3e00;--code-green:#007e7e;--code-purple:#6851f5;--code-gray:#67727e;--code-neutral:rgb(15, 36, 51);--code-neutral-8:rgba(15, 36, 51, 0.8);--code-neutral-7:rgba(15, 36, 51, 0.7)}.dark{--code-orange:#ff9571;--code-green:#73e6dc;--code-purple:#c7bdff;--code-gray:#8b959f;--code-neutral:rgb(252, 252, 252);--code-neutral-8:rgba(252, 252, 252, 0.8);--code-neutral-7:rgba(252, 252, 252, 0.7)}"),this.translationSlimmer=new E,this.vegaComponentUsageRuntimeMetricsSlimmer=new d,this.codeBlockRenderer=new P,this.contentRenderer=new _,this.copyButtonRenderer=new K,this.valueController=new B,this.contentParseController=new M,this.prismCodeHighlightParser=new ut,this.defaultCodeHighlightParser=new ht,this.selectionController=new U,this.inputController=new q,this.insertCompositionTextController=new vt,this.focusController=new X,this.historyController=new gt,this.changeEventEmitter=R(Ct,g),this.removeEventEmitter=R(Ct,y),this.codeBlockPasteController=new yt,this.eventPreventSlimmer=new T([g],(()=>this.codeBlockRenderer.getToolbarContainerRef())),this.readOnly=!1,this.disabled=!1,this.showCopyButton=!0,this.showLineNumber=!0}watchEditableChange(){}componentShouldUpdate(t,e,n){return"value"!==n||!O(t,e)}async doFocus(){}render(){const e=C([this.readOnly?"readonly":"",this.disabled?"disabled":"",this.showLineNumber?"show-line-number":"",this.prismCodeHighlightParser.canParse()?"highlight":""]);return u(t(i,{contenteditable:!1,class:e},this.codeBlockRenderer.render()),this.host)}get host(){return r(this)}static get watchers(){return{readOnly:["watchEditableChange"],disabled:["watchEditableChange"]}}};xt([p()],Ct.prototype,"globalSlimmers",void 0),xt([l()],Ct.prototype,"componentGlobalStyleSlimmer",void 0),xt([l()],Ct.prototype,"translationSlimmer",void 0),xt([l()],Ct.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),xt([l()],Ct.prototype,"codeBlockRenderer",void 0),xt([l()],Ct.prototype,"contentRenderer",void 0),xt([l()],Ct.prototype,"copyButtonRenderer",void 0),xt([l()],Ct.prototype,"valueController",void 0),xt([l()],Ct.prototype,"contentParseController",void 0),xt([l()],Ct.prototype,"prismCodeHighlightParser",void 0),xt([l()],Ct.prototype,"defaultCodeHighlightParser",void 0),xt([l()],Ct.prototype,"selectionController",void 0),xt([l()],Ct.prototype,"inputController",void 0),xt([l()],Ct.prototype,"insertCompositionTextController",void 0),xt([l()],Ct.prototype,"focusController",void 0),xt([l()],Ct.prototype,"historyController",void 0),xt([l()],Ct.prototype,"changeEventEmitter",void 0),xt([l()],Ct.prototype,"removeEventEmitter",void 0),xt([l()],Ct.prototype,"codeBlockPasteController",void 0),xt([l()],Ct.prototype,"eventPreventSlimmer",void 0),Ct.style=':host{display:block;border-radius:2px;background-color:rgba(var(--v-bg-secondary, 245, 247, 247, 1));padding-left:12px;padding-right:12px;padding-top:12px;padding-bottom:12px}:host code{display:block;box-sizing:border-box;color:rgba(var(--v-text-primary, 32, 54, 69, 1));text-align:left;font-family:"Roboto Mono";font-weight:400;line-height:22px;font-size:16px;white-space:pre-wrap;min-height:22px;tab-size:2px;word-break:break-word}:host code:focus-visible{outline:none}:host .editor-toolbar{display:flex;flex-direction:row;justify-content:space-between;align-items:center;padding-bottom:12px;border:1px solid rgba(var(--v-border-divider-secondary, 199, 217, 229, 1));border-top-width:0px;border-left-width:0px;border-right-width:0px;margin-bottom:12px;user-select:none}:host .editor-toolbar vega-input-select{width:auto;min-width:161px}:host(.show-line-number) code .v-code-line-number::before{content:attr(data-mark);width:var(--v-code-line-number-width);margin-left:var(--v-code-line-number-ml);padding-right:16px;text-align:right;user-select:none;font-style:normal;word-break:keep-all;color:rgba(var(--v-text-secondary, 107, 116, 125, 1));display:inline-block}:host(.show-line-number) code{padding-left:var(--v-code-block-pl)}:host::part(select-container){padding-top:0px;padding-bottom:0px;padding-left:8px;padding-right:8px;border-radius:4px}:host::part(selected-box),:host::part(placeholder){font-size:14px;user-select:none}:host::part(toggle-icon-container){width:12px;height:12px;line-height:12px}:host::part(toggle-icon){width:12px;height:12px}:host(.readonly) .copy-button-container{position:relative}:host(.readonly) .copy-button-container .copy-code-button{position:absolute;top:0px;right:0px}:host(.disabled:not(.highlight)) code{color:rgba(var(--v-text-input-disabled, 107, 116, 125, 1))}:host(.disabled.highlight){opacity:0.5}:host(.focus:not(.disabled,.readonly)){outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:2px}:host(.highlight) code{color:var(--code-neutral)}code .comment,code .prolog,code .doctype,code .cdata{color:var(--code-gray);font-style:italic}code .namespace{color:var(--code-neutral-7)}code .string,code .attr-value,code .builtin{color:var(--code-green)}code .punctuation,code .operator,code .attr-equals{color:var(--code-gray)}code .entity,code .url,code .symbol,code .number,code .boolean,code .variable,code .constant,code .property,code .regex,code .inserted{color:var(--code-neutral-8)}code .atrule,code .function,code .attr-name{color:var(--code-orange)}code .deleted{color:var(--code-neutral)}code .function-variable{color:#ff0000}code .tag,code .selector,code .keyword{color:var(--code-purple)}';export{Ct as vega_code_block}
|