@heartlandone/vega 2.63.1 → 2.64.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/{app-globals-2d0b157e.js → app-globals-a190cd2d.js} +9 -9
- package/dist/cjs/{brand-switch-state-controller-slimmer-b83a4596.js → brand-switch-state-controller-slimmer-5efa1b24.js} +1 -1
- package/dist/cjs/{code-block-cc740807.js → code-block-417a131b.js} +11 -15
- package/dist/cjs/{component-value-history-controller-slimmer.abstract-0bb81172.js → component-value-history-controller-slimmer.abstract-0c4d1453.js} +3 -3
- package/dist/cjs/{dark-mode-state-controller-slimmer-17022f93.js → dark-mode-state-controller-slimmer-add5d8a8.js} +1 -1
- package/dist/cjs/{dark-mode-style-controller-b1e9ec82.js → dark-mode-style-controller-41c94aac.js} +1 -1
- package/dist/cjs/{design-token-bf913c86.js → design-token-ae0de304.js} +1 -1
- package/dist/cjs/{dto-renderer-manager-424c5031.js → dto-renderer-manager-6d338e46.js} +9 -4
- package/dist/cjs/{element-appender-slimmer-1d035b1f.js → element-appender-slimmer-5a23e722.js} +4 -4
- package/dist/cjs/{form-field-controller-slimmer-cc6e53a4.js → form-field-controller-slimmer-cceb5c79.js} +4 -4
- package/dist/cjs/{image-annotation-action-f831e09b.js → image-annotation-action-9785bc59.js} +4 -4
- package/dist/cjs/{index-00ba6623.js → index-58ea899e.js} +1 -0
- package/dist/cjs/{index-5505e8dd.js → index-9a92abce.js} +1 -1
- package/dist/cjs/index.cjs.js +13 -13
- package/dist/cjs/{language-extension-cfe0eabd.js → language-extension-abbc251a.js} +2 -2
- package/dist/cjs/loader.cjs.js +12 -12
- package/dist/cjs/{public-rules-7e9b633d.js → public-rules-ffc5db13.js} +6 -6
- package/dist/cjs/{range-44f08955.js → range-37161c00.js} +1 -1
- package/dist/cjs/{responsive-format-facade-a7fbefc4.js → responsive-format-facade-b20dad44.js} +4 -4
- package/dist/cjs/{rich-text-editor-required-rule-a0618c85.js → rich-text-editor-required-rule-604ea2b9.js} +1 -1
- package/dist/cjs/{static-subject-title-85732e0f.js → static-subject-title-7e7d791a.js} +0 -2
- package/dist/cjs/{string-input-formatter-slimmer-f6c7a255.js → string-input-formatter-slimmer-8445abc9.js} +2 -2
- package/dist/cjs/{style-formatter-795451f2.js → style-formatter-56751462.js} +1 -1
- package/dist/cjs/{sub-state-notify-slimmer-bb64fcfc.js → sub-state-notify-slimmer-52fa23af.js} +1 -1
- package/dist/cjs/{sub-state-observer-slimmer-84175d61.js → sub-state-observer-slimmer-90c26113.js} +1 -1
- package/dist/cjs/{token-extension-4764d5f3.js → token-extension-46821c19.js} +3 -3
- package/dist/cjs/{translation-cde4dce3.js → translation-ecfc704a.js} +1 -1
- package/dist/cjs/{translation-slimmer-af399096.js → translation-slimmer-40a3536d.js} +1 -1
- package/dist/cjs/vega-accordion.cjs.entry.js +10 -10
- package/dist/cjs/vega-app-footer.cjs.entry.js +4 -4
- package/dist/cjs/vega-app-header-button.cjs.entry.js +10 -10
- package/dist/cjs/vega-backdrop.cjs.entry.js +1 -1
- package/dist/cjs/vega-banner.cjs.entry.js +1 -1
- package/dist/cjs/vega-bar-chart.cjs.entry.js +1 -1
- package/dist/cjs/vega-box.cjs.entry.js +11 -11
- package/dist/cjs/vega-brand-logo.cjs.entry.js +4 -4
- package/dist/cjs/vega-breadcrumb.cjs.entry.js +1 -1
- package/dist/cjs/vega-button-circle.cjs.entry.js +10 -10
- package/dist/cjs/vega-button-group_2.cjs.entry.js +4 -4
- package/dist/cjs/vega-button-link.cjs.entry.js +1 -1
- package/dist/cjs/vega-button.cjs.entry.js +9 -9
- package/dist/cjs/vega-calendar_4.cjs.entry.js +29 -21
- package/dist/cjs/vega-card.cjs.entry.js +10 -10
- package/dist/cjs/vega-carousel.cjs.entry.js +9 -9
- package/dist/cjs/vega-checkbox_2.cjs.entry.js +6 -6
- package/dist/cjs/vega-chip.cjs.entry.js +10 -10
- package/dist/cjs/vega-code-block.cjs.entry.js +9 -9
- package/dist/cjs/vega-color-picker.cjs.entry.js +6 -6
- package/dist/cjs/vega-combo-box.cjs.entry.js +6 -6
- package/dist/cjs/vega-counter-badge.cjs.entry.js +1 -1
- package/dist/cjs/vega-date-picker_2.cjs.entry.js +15 -15
- package/dist/cjs/vega-dialog_2.cjs.entry.js +10 -10
- package/dist/cjs/vega-divider.cjs.entry.js +10 -10
- package/dist/cjs/vega-dropdown_5.cjs.entry.js +13 -13
- package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
- package/dist/cjs/vega-field-error.cjs.entry.js +2 -2
- package/dist/cjs/vega-field-label.cjs.entry.js +1 -1
- package/dist/cjs/vega-file-uploader.cjs.entry.js +7 -7
- package/dist/cjs/vega-flag-icon.cjs.entry.js +10 -10
- package/dist/cjs/vega-flex.cjs.entry.js +11 -11
- package/dist/cjs/vega-font.cjs.entry.js +10 -10
- package/dist/cjs/vega-form.cjs.entry.js +90 -16
- package/dist/cjs/vega-grid.cjs.entry.js +10 -10
- package/dist/cjs/vega-hint.cjs.entry.js +1 -1
- package/dist/cjs/vega-icon.cjs.entry.js +10 -10
- package/dist/cjs/vega-image-uploader.cjs.entry.js +13 -13
- package/dist/cjs/vega-input-credit-card.cjs.entry.js +6 -6
- package/dist/cjs/vega-input-numeric.cjs.entry.js +7 -7
- package/dist/cjs/vega-input-phone-number.cjs.entry.js +10 -10
- package/dist/cjs/vega-input-range.cjs.entry.js +7 -7
- package/dist/cjs/vega-input-select.cjs.entry.js +12 -12
- package/dist/cjs/vega-input.cjs.entry.js +8 -8
- package/dist/cjs/{vega-internal-event-id-9647aaf8.js → vega-internal-event-id-dfd8b802.js} +2 -0
- package/dist/cjs/vega-item-toggle.cjs.entry.js +1 -1
- package/dist/cjs/vega-left-nav_5.cjs.entry.js +13 -13
- package/dist/cjs/vega-line-chart.cjs.entry.js +1 -1
- package/dist/cjs/vega-loader-wrapper_2.cjs.entry.js +9 -9
- package/dist/cjs/vega-page-notification_2.cjs.entry.js +1 -1
- package/dist/cjs/vega-pagination-page-selector-mobile.cjs.entry.js +2 -2
- package/dist/cjs/vega-pagination-page-size-selector-mobile.cjs.entry.js +5 -5
- package/dist/cjs/vega-pagination.cjs.entry.js +10 -10
- package/dist/cjs/vega-pie-chart.cjs.entry.js +1 -1
- package/dist/cjs/vega-popover_2.cjs.entry.js +11 -11
- package/dist/cjs/vega-progress-tracker.cjs.entry.js +1 -1
- package/dist/cjs/vega-radio_2.cjs.entry.js +6 -6
- package/dist/cjs/vega-rich-text-content.cjs.entry.js +9 -9
- package/dist/cjs/vega-rich-text-editor_4.cjs.entry.js +18 -22
- package/dist/cjs/vega-section-title.cjs.entry.js +1 -1
- package/dist/cjs/vega-segment-control.cjs.entry.js +1 -1
- package/dist/cjs/vega-selection-chip_2.cjs.entry.js +12 -12
- package/dist/cjs/vega-selection-tile_2.cjs.entry.js +7 -7
- package/dist/cjs/vega-sidenav_3.cjs.entry.js +11 -11
- package/dist/cjs/vega-signature-capture.cjs.entry.js +13 -13
- package/dist/cjs/vega-skeleton.cjs.entry.js +1 -1
- package/dist/cjs/vega-slot-container.cjs.entry.js +1 -1
- package/dist/cjs/vega-stepper.cjs.entry.js +6 -6
- package/dist/cjs/vega-tab-group_2.cjs.entry.js +2 -2
- package/dist/cjs/vega-table_8.cjs.entry.js +12 -12
- package/dist/cjs/vega-text.cjs.entry.js +1 -1
- package/dist/cjs/vega-textarea.cjs.entry.js +6 -6
- package/dist/cjs/vega-time-picker_2.cjs.entry.js +13 -13
- package/dist/cjs/vega-toggle-switch.cjs.entry.js +6 -6
- package/dist/cjs/vega-tooltip_2.cjs.entry.js +10 -10
- package/dist/cjs/vega.cjs.js +12 -12
- package/dist/collection/components/vega-calendar/slimmers/common/renderers/vega-calendar-event-preview-popover-renderer.js +7 -6
- package/dist/collection/components/vega-calendar/slimmers/month-view/renderers/vega-calendar-month-event-renderer.js +6 -7
- package/dist/collection/components/vega-calendar/vega-calendar-event-preview/slimmers/renderers/vega-calendar-event-preview-detail-renderer.js +15 -5
- package/dist/collection/components/vega-form/slimmers/renderers/native-form-renderer.js +30 -0
- package/dist/collection/components/vega-form/vega-form.js +111 -3
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/link-annotation.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/link-group-annotation.js +5 -7
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/text-block.js +3 -5
- package/dist/collection/components/vega-rich-text-editor/dto/content-state.js +7 -2
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/vega-rich-text-editor-renderer.js +1 -5
- package/dist/collection/components/vega-rich-text-editor/test/dto/annotations.test.js +9 -1
- package/dist/collection/components/vega-rich-text-editor/test/dto/blocks/text-block.test.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/test/dto/content-state.test.js +51 -40
- package/dist/collection/helpers/change-manager/subject/static-subject/static-subject-title.js +0 -1
- package/dist/collection/helpers/event-manager/event-id/vega-internal-event-id.js +1 -0
- package/dist/esm/{app-globals-2623304e.js → app-globals-b074e012.js} +9 -9
- package/dist/esm/{brand-switch-state-controller-slimmer-d6e4d217.js → brand-switch-state-controller-slimmer-05c85e6d.js} +1 -1
- package/dist/esm/{code-block-23e7f8d0.js → code-block-a6c78bbb.js} +11 -15
- package/dist/esm/{component-value-history-controller-slimmer.abstract-df25e4a1.js → component-value-history-controller-slimmer.abstract-d37d2df7.js} +3 -3
- package/dist/esm/{dark-mode-state-controller-slimmer-0c7d1c77.js → dark-mode-state-controller-slimmer-f1c2c299.js} +1 -1
- package/dist/esm/{dark-mode-style-controller-972e1f06.js → dark-mode-style-controller-5cf1c482.js} +1 -1
- package/dist/esm/{design-token-0f439510.js → design-token-6f9e70c4.js} +1 -1
- package/dist/esm/{dto-renderer-manager-65b7b1b1.js → dto-renderer-manager-5b036e47.js} +9 -4
- package/dist/esm/{element-appender-slimmer-bf5ca501.js → element-appender-slimmer-1d6c2960.js} +4 -4
- package/dist/esm/{form-field-controller-slimmer-f7e8845b.js → form-field-controller-slimmer-c29b345f.js} +4 -4
- package/dist/esm/{image-annotation-action-af21ea8f.js → image-annotation-action-f6308cf4.js} +4 -4
- package/dist/esm/{index-057d0f70.js → index-090d31ca.js} +1 -0
- package/dist/esm/{index-7fe93427.js → index-4f26bbd0.js} +1 -1
- package/dist/esm/index.js +13 -13
- package/dist/esm/{language-extension-d355f9aa.js → language-extension-962c427a.js} +2 -2
- package/dist/esm/loader.js +12 -12
- package/dist/esm/{public-rules-1a5da7bf.js → public-rules-6fa7533f.js} +6 -6
- package/dist/esm/{range-fac2962c.js → range-4d7aa0fd.js} +1 -1
- package/dist/esm/{responsive-format-facade-2904b456.js → responsive-format-facade-b594fc72.js} +4 -4
- package/dist/esm/{rich-text-editor-required-rule-bb94d680.js → rich-text-editor-required-rule-a72374cd.js} +1 -1
- package/dist/esm/{static-subject-title-633b3474.js → static-subject-title-ca83d6b6.js} +1 -2
- package/dist/esm/{string-input-formatter-slimmer-69117deb.js → string-input-formatter-slimmer-75256a17.js} +2 -2
- package/dist/esm/{style-formatter-a724e38d.js → style-formatter-56074ede.js} +1 -1
- package/dist/esm/{sub-state-notify-slimmer-4252a90e.js → sub-state-notify-slimmer-85c658b7.js} +1 -1
- package/dist/esm/{sub-state-observer-slimmer-baa8853a.js → sub-state-observer-slimmer-e58a2485.js} +1 -1
- package/dist/esm/{token-extension-89eeef74.js → token-extension-3c198013.js} +3 -3
- package/dist/esm/{translation-833d9ef4.js → translation-3d35961b.js} +1 -1
- package/dist/esm/{translation-slimmer-c83b52c1.js → translation-slimmer-d5b0d292.js} +1 -1
- package/dist/esm/vega-accordion.entry.js +10 -10
- package/dist/esm/vega-app-footer.entry.js +4 -4
- package/dist/esm/vega-app-header-button.entry.js +10 -10
- package/dist/esm/vega-backdrop.entry.js +1 -1
- package/dist/esm/vega-banner.entry.js +1 -1
- package/dist/esm/vega-bar-chart.entry.js +1 -1
- package/dist/esm/vega-box.entry.js +11 -11
- package/dist/esm/vega-brand-logo.entry.js +4 -4
- package/dist/esm/vega-breadcrumb.entry.js +1 -1
- package/dist/esm/vega-button-circle.entry.js +10 -10
- package/dist/esm/vega-button-group_2.entry.js +4 -4
- package/dist/esm/vega-button-link.entry.js +1 -1
- package/dist/esm/vega-button.entry.js +9 -9
- package/dist/esm/vega-calendar_4.entry.js +30 -22
- package/dist/esm/vega-card.entry.js +10 -10
- package/dist/esm/vega-carousel.entry.js +9 -9
- package/dist/esm/vega-checkbox_2.entry.js +6 -6
- package/dist/esm/vega-chip.entry.js +10 -10
- package/dist/esm/vega-code-block.entry.js +9 -9
- package/dist/esm/vega-color-picker.entry.js +6 -6
- package/dist/esm/vega-combo-box.entry.js +6 -6
- package/dist/esm/vega-counter-badge.entry.js +1 -1
- package/dist/esm/vega-date-picker_2.entry.js +15 -15
- package/dist/esm/vega-dialog_2.entry.js +10 -10
- package/dist/esm/vega-divider.entry.js +10 -10
- package/dist/esm/vega-dropdown_5.entry.js +13 -13
- package/dist/esm/vega-env-manager-8f8dc473.js +2 -2
- package/dist/esm/vega-field-error.entry.js +2 -2
- package/dist/esm/vega-field-label.entry.js +1 -1
- package/dist/esm/vega-file-uploader.entry.js +7 -7
- package/dist/esm/vega-flag-icon.entry.js +10 -10
- package/dist/esm/vega-flex.entry.js +11 -11
- package/dist/esm/vega-font.entry.js +10 -10
- package/dist/esm/vega-form.entry.js +90 -16
- package/dist/esm/vega-grid.entry.js +10 -10
- package/dist/esm/vega-hint.entry.js +1 -1
- package/dist/esm/vega-icon.entry.js +10 -10
- package/dist/esm/vega-image-uploader.entry.js +13 -13
- package/dist/esm/vega-input-credit-card.entry.js +6 -6
- package/dist/esm/vega-input-numeric.entry.js +7 -7
- package/dist/esm/vega-input-phone-number.entry.js +10 -10
- package/dist/esm/vega-input-range.entry.js +7 -7
- package/dist/esm/vega-input-select.entry.js +12 -12
- package/dist/esm/vega-input.entry.js +8 -8
- package/dist/esm/{vega-internal-event-id-5a143cd2.js → vega-internal-event-id-bee7946b.js} +2 -1
- package/dist/esm/vega-item-toggle.entry.js +1 -1
- package/dist/esm/vega-left-nav_5.entry.js +13 -13
- package/dist/esm/vega-line-chart.entry.js +1 -1
- package/dist/esm/vega-loader-wrapper_2.entry.js +9 -9
- package/dist/esm/vega-page-notification_2.entry.js +1 -1
- package/dist/esm/vega-pagination-page-selector-mobile.entry.js +2 -2
- package/dist/esm/vega-pagination-page-size-selector-mobile.entry.js +5 -5
- package/dist/esm/vega-pagination.entry.js +10 -10
- package/dist/esm/vega-pie-chart.entry.js +1 -1
- package/dist/esm/vega-popover_2.entry.js +11 -11
- package/dist/esm/vega-progress-tracker.entry.js +1 -1
- package/dist/esm/vega-radio_2.entry.js +6 -6
- package/dist/esm/vega-rich-text-content.entry.js +9 -9
- package/dist/esm/vega-rich-text-editor_4.entry.js +18 -22
- package/dist/esm/vega-section-title.entry.js +1 -1
- package/dist/esm/vega-segment-control.entry.js +1 -1
- package/dist/esm/vega-selection-chip_2.entry.js +12 -12
- package/dist/esm/vega-selection-tile_2.entry.js +7 -7
- package/dist/esm/vega-sidenav_3.entry.js +11 -11
- package/dist/esm/vega-signature-capture.entry.js +13 -13
- package/dist/esm/vega-skeleton.entry.js +1 -1
- package/dist/esm/vega-slot-container.entry.js +1 -1
- package/dist/esm/vega-stepper.entry.js +6 -6
- package/dist/esm/vega-tab-group_2.entry.js +2 -2
- package/dist/esm/vega-table_8.entry.js +12 -12
- package/dist/esm/vega-text.entry.js +1 -1
- package/dist/esm/vega-textarea.entry.js +6 -6
- package/dist/esm/vega-time-picker_2.entry.js +13 -13
- package/dist/esm/vega-toggle-switch.entry.js +6 -6
- package/dist/esm/vega-tooltip_2.entry.js +10 -10
- package/dist/esm/vega.js +12 -12
- package/dist/types/components/vega-calendar/vega-calendar-event-preview/slimmers/renderers/vega-calendar-event-preview-detail-renderer.d.ts +3 -0
- package/dist/types/components/vega-form/slimmers/renderers/native-form-renderer.d.ts +12 -0
- package/dist/types/components/vega-form/vega-form.d.ts +35 -0
- package/dist/types/components/vega-rich-text-editor/dto/annotations/link-group-annotation.d.ts +0 -1
- package/dist/types/components/vega-rich-text-editor/dto/blocks/text-block.d.ts +1 -2
- package/dist/types/components/vega-rich-text-editor/dto/content-state.d.ts +2 -1
- package/dist/types/components.d.ts +30 -0
- package/dist/types/helpers/change-manager/subject/static-subject/static-subject-title.d.ts +1 -2
- package/dist/types/helpers/event-manager/event-id/vega-internal-event-id.d.ts +1 -0
- package/dist/vega/index.esm.js +1 -1
- package/dist/vega/{p-81765b4b.entry.js → p-04158119.entry.js} +1 -1
- package/dist/vega/{p-66199d68.js → p-06b624e6.js} +1 -1
- package/dist/vega/p-06e6be0e.js +1 -0
- package/dist/vega/{p-476cc642.entry.js → p-0b38a01f.entry.js} +1 -1
- package/dist/vega/p-0b92b15b.entry.js +1 -0
- package/dist/vega/{p-5e4fb663.entry.js → p-0bb3be0b.entry.js} +1 -1
- package/dist/vega/{p-c61f8ca6.entry.js → p-0f2c83a1.entry.js} +1 -1
- package/dist/vega/{p-427b2b55.entry.js → p-1110b422.entry.js} +1 -1
- package/dist/vega/{p-5397648b.entry.js → p-119430db.entry.js} +1 -1
- package/dist/vega/{p-6585cfd5.entry.js → p-15766433.entry.js} +1 -1
- package/dist/vega/{p-320cccc5.entry.js → p-159fda34.entry.js} +1 -1
- package/dist/vega/{p-0ec14fbc.entry.js → p-1655b920.entry.js} +1 -1
- package/dist/vega/{p-25c831a4.entry.js → p-179693f1.entry.js} +1 -1
- package/dist/vega/p-1aba48bc.js +1 -0
- package/dist/vega/{p-4f21faf1.js → p-1be68fba.js} +1 -1
- package/dist/vega/{p-e0729c4d.entry.js → p-1cb87bad.entry.js} +1 -1
- package/dist/vega/{p-6180c1af.entry.js → p-1d3a7be6.entry.js} +1 -1
- package/dist/vega/{p-5313d0bc.js → p-2044aa2c.js} +1 -1
- package/dist/vega/{p-2591f217.entry.js → p-21a480b0.entry.js} +1 -1
- package/dist/vega/{p-614e450a.entry.js → p-3176804b.entry.js} +1 -1
- package/dist/vega/{p-648134d2.entry.js → p-32058dbd.entry.js} +1 -1
- package/dist/vega/{p-5970369e.entry.js → p-32655cfc.entry.js} +1 -1
- package/dist/vega/{p-c2377afa.js → p-3354f5a7.js} +1 -1
- package/dist/vega/p-3355ec0f.js +1 -0
- package/dist/vega/{p-02b29c18.js → p-3674db0f.js} +1 -1
- package/dist/vega/p-36f331bf.entry.js +1 -0
- package/dist/vega/p-3709b0e0.js +1 -0
- package/dist/vega/{p-e513f041.js → p-37fd7a80.js} +1 -1
- package/dist/vega/{p-0717073b.entry.js → p-3a0b9e66.entry.js} +1 -1
- package/dist/vega/{p-dcae53cf.entry.js → p-3a455ac3.entry.js} +1 -1
- package/dist/vega/{p-7cd2fac8.entry.js → p-3a9aa6eb.entry.js} +1 -1
- package/dist/vega/{p-89d2cf34.js → p-3af81271.js} +1 -1
- package/dist/vega/{p-b110b7bd.entry.js → p-3eaa6cce.entry.js} +1 -1
- package/dist/vega/{p-40924882.entry.js → p-4082fa22.entry.js} +1 -1
- package/dist/vega/{p-9b2d8516.entry.js → p-459efe39.entry.js} +1 -1
- package/dist/vega/p-465a6660.entry.js +1 -0
- package/dist/vega/{p-2a1b3108.entry.js → p-4669ce11.entry.js} +1 -1
- package/dist/vega/{p-3ab20f9e.entry.js → p-4ae3eebf.entry.js} +1 -1
- package/dist/vega/{p-8a484812.entry.js → p-4b57bb12.entry.js} +1 -1
- package/dist/vega/{p-cc5a3a1b.entry.js → p-4dd6554e.entry.js} +1 -1
- package/dist/vega/p-4e503e23.entry.js +1 -0
- package/dist/vega/{p-2f88ba36.entry.js → p-4faa7bab.entry.js} +1 -1
- package/dist/vega/{p-9c309b85.entry.js → p-52b0abb5.entry.js} +1 -1
- package/dist/vega/{p-6244b0ad.entry.js → p-5443d614.entry.js} +1 -1
- package/dist/vega/{p-f92fc49b.entry.js → p-55c26035.entry.js} +1 -1
- package/dist/vega/{p-76c7538a.entry.js → p-56b8ffd5.entry.js} +1 -1
- package/dist/vega/p-5773a9a3.js +1 -0
- package/dist/vega/{p-de1ee131.entry.js → p-57c42c30.entry.js} +1 -1
- package/dist/vega/{p-57257de0.entry.js → p-5910be31.entry.js} +1 -1
- package/dist/vega/p-5f377954.js +1 -1
- package/dist/vega/p-6163818f.js +1 -0
- package/dist/vega/{p-09cb98f3.entry.js → p-61966868.entry.js} +1 -1
- package/dist/vega/p-641fbb48.entry.js +1 -0
- package/dist/vega/{p-7bad6577.entry.js → p-64e949fa.entry.js} +1 -1
- package/dist/vega/{p-2d58cf34.entry.js → p-684391a4.entry.js} +1 -1
- package/dist/vega/{p-ab29f968.js → p-697acd40.js} +1 -1
- package/dist/vega/p-6be16084.js +1 -0
- package/dist/vega/{p-b6c51409.entry.js → p-6c85c1f3.entry.js} +1 -1
- package/dist/vega/{p-56ff8559.entry.js → p-6ed663d5.entry.js} +1 -1
- package/dist/vega/{p-3be7bfee.entry.js → p-7aae9252.entry.js} +1 -1
- package/dist/vega/{p-b32f7aac.entry.js → p-7c75ce6c.entry.js} +1 -1
- package/dist/vega/{p-d87c3058.entry.js → p-84eabbec.entry.js} +1 -1
- package/dist/vega/{p-02a4732a.js → p-8938b5c4.js} +1 -1
- package/dist/vega/{p-846ae5fb.js → p-904d1b43.js} +1 -1
- package/dist/vega/{p-20223e8e.entry.js → p-92ec4fac.entry.js} +1 -1
- package/dist/vega/{p-b4d88fce.entry.js → p-956a5899.entry.js} +1 -1
- package/dist/vega/{p-0e954b9b.js → p-96bda7ca.js} +1 -1
- package/dist/vega/{p-bc0ae89a.entry.js → p-9819dda9.entry.js} +1 -1
- package/dist/vega/{p-942fc9b9.js → p-a1cf29a9.js} +1 -1
- package/dist/vega/{p-bdd9ef3b.js → p-a30ebdf5.js} +1 -1
- package/dist/vega/{p-c7726252.js → p-a3d77013.js} +1 -1
- package/dist/vega/{p-cfb2af9c.entry.js → p-a9e3058e.entry.js} +1 -1
- package/dist/vega/{p-8175d8de.entry.js → p-ad2055f4.entry.js} +1 -1
- package/dist/vega/{p-460429da.entry.js → p-ae963cb3.entry.js} +1 -1
- package/dist/vega/{p-92469fa1.entry.js → p-b3cd1992.entry.js} +1 -1
- package/dist/vega/{p-da6369d4.entry.js → p-b9e8c6bf.entry.js} +1 -1
- package/dist/vega/{p-351405f2.entry.js → p-bb58a7cf.entry.js} +1 -1
- package/dist/vega/{p-bb61f015.js → p-be539a54.js} +1 -1
- package/dist/vega/{p-589b7ea3.entry.js → p-bf8d2978.entry.js} +1 -1
- package/dist/vega/{p-dadc6ab3.js → p-c7f68d74.js} +1 -1
- package/dist/vega/p-c8789df1.entry.js +1 -0
- package/dist/vega/p-d20ab09f.entry.js +1 -0
- package/dist/vega/{p-bf0ced3c.js → p-d3bf55e9.js} +1 -1
- package/dist/vega/{p-26ef2066.entry.js → p-db29b9f9.entry.js} +1 -1
- package/dist/vega/{p-e74c275a.entry.js → p-df31307b.entry.js} +1 -1
- package/dist/vega/{p-4c3075ef.js → p-e27802fb.js} +1 -1
- package/dist/vega/{p-134ed822.entry.js → p-e41931d4.entry.js} +1 -1
- package/dist/vega/{p-3fba9e77.entry.js → p-e4acac0a.entry.js} +1 -1
- package/dist/vega/{p-d15e70d7.entry.js → p-e4b0606a.entry.js} +1 -1
- package/dist/vega/{p-36ae2dd3.entry.js → p-e5af5a4d.entry.js} +1 -1
- package/dist/vega/{p-10454aa5.entry.js → p-e6158a33.entry.js} +1 -1
- package/dist/vega/{p-d72abacd.entry.js → p-e9b86dac.entry.js} +1 -1
- package/dist/vega/{p-969066d3.entry.js → p-eb5f99db.entry.js} +1 -1
- package/dist/vega/{p-d85b0bfa.entry.js → p-ed0f000b.entry.js} +1 -1
- package/dist/vega/p-f37558c1.js +1 -0
- package/dist/vega/{p-81fbf18f.entry.js → p-f4877bee.entry.js} +1 -1
- package/dist/vega/{p-64c281ec.entry.js → p-f81f2071.entry.js} +1 -1
- package/dist/vega/{p-4f5a2b0c.entry.js → p-fd2d02ea.entry.js} +1 -1
- package/dist/vega/{p-0bc93777.entry.js → p-ffc2ef90.entry.js} +1 -1
- package/dist/vega/{p-b73532c0.entry.js → p-fff13ed1.entry.js} +1 -1
- package/dist/vega/vega.esm.js +1 -1
- package/package.json +1 -1
- package/dist/vega/p-079f5d94.entry.js +0 -1
- package/dist/vega/p-0b36f4ce.js +0 -1
- package/dist/vega/p-0e3cd270.entry.js +0 -1
- package/dist/vega/p-258f9603.js +0 -1
- package/dist/vega/p-2b90fae6.js +0 -1
- package/dist/vega/p-51d40b0d.entry.js +0 -1
- package/dist/vega/p-521ace2d.js +0 -1
- package/dist/vega/p-657446a3.entry.js +0 -1
- package/dist/vega/p-6908117a.js +0 -1
- package/dist/vega/p-893d5dfa.js +0 -1
- package/dist/vega/p-8a6b820a.entry.js +0 -1
- package/dist/vega/p-8a877e12.js +0 -1
- package/dist/vega/p-9ffd2a96.entry.js +0 -1
- package/dist/vega/p-b1054e18.entry.js +0 -1
- package/dist/vega/p-e5cd6521.js +0 -1
- /package/dist/vega/{p-48a58baf.js → p-6b2342e0.js} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h as e,F as t,H as i,r as o,c as a,g as r}from"./p-48a58baf.js";import{R as n}from"./p-280cbcdb.js";import{g as s,s as d}from"./p-519a7d55.js";import{Q as p,R as c}from"./p-b1faebe0.js";import{c as l,M as h,V as b,I as f}from"./p-6e1ab235.js";import{V as m,I as v}from"./p-d849e0f5.js";import{F as g}from"./p-c7726252.js";import{C as x}from"./p-1da54ff3.js";import{c as u}from"./p-3cdbee7e.js";import{D as w,m as y,q as j,V as R,c as I,f as C,n as k}from"./p-2ee4def0.js";import{b as O}from"./p-8a877e12.js";import{C as D}from"./p-2d0d575f.js";import{c as S}from"./p-86194314.js";import{h as z}from"./p-0e954b9b.js";import{K as E}from"./p-743c5baf.js";import{f as A}from"./p-575235c8.js";import{M as V}from"./p-78a57a17.js";import{T as L}from"./p-52b8f2d2.js";import"./p-abd7aeaa.js";import"./p-ed45b3b6.js";import"./p-74168615.js";import"./p-d884c644.js";import"./p-02841589.js";import"./p-331a62d5.js";import"./p-a4670e23.js";import"./p-6a334573.js";import"./p-bf0ced3c.js";import"./p-7d9cd9c8.js";import"./p-b75ee3ba.js";import"./p-d27ae9ff.js";import"./p-262ec334.js";import"./p-bdd9ef3b.js";import"./p-f1436035.js";import"./p-5f377954.js";import"./p-e77a83e4.js";import"./p-db8cdba6.js";import"./p-112455b1.js";import"./p-2608b9fe.js";const T=[{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 F=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class _ extends b{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,w.addUniqueObserverToNode(e,y,(async e=>{await this.onDropdownCreate(e.detail)})),w.addUniqueObserverToNode(e,j,(async()=>{await this.onDropdownHide()})),w.addUniqueObserverToNode(e,R,(async()=>{await this.onItemClick()})),w.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:t.label,variant:"outlined",showCloseIcon:!this.disabled,size:"small",ref:e=>{w.addUniqueObserverToNode(e,I,(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:S(),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("")}}F([l()],_.prototype,"host",void 0),F([l()],_.prototype,"value",void 0),F([l()],_.prototype,"source",void 0),F([l()],_.prototype,"disabled",void 0),F([l()],_.prototype,"size",void 0),F([l()],_.prototype,"vegaDropdownProps",void 0),F([l()],_.prototype,"label",void 0),F([l()],_.prototype,"placeholder",void 0),F([l()],_.prototype,"useDefaultFilter",void 0),F([l()],_.prototype,"createEventEmit",void 0),F([l()],_.prototype,"searchEventEmit",void 0),F([l()],_.prototype,"valueController",void 0),F([l()],_.prototype,"sourceController",void 0),F([h("connectedCallback")],_.prototype,"connectedCallback",null);class K extends b{setValue(e){this.value=e}}!function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);r>3&&n&&Object.defineProperty(t,i,n)}([l({writable:!0})],K.prototype,"value",void 0);var N=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class q extends b{constructor(){super(...arguments),this.onLabelClick=()=>{this.dropdownRenderer.focusInput()}}render(){return e(i,{class:{"vega-combo-box-disabled":this.disabled}},this.renderLabel(),this.dropdownRenderer.renderDropdown(),this.renderHint())}renderLabel(){return e("vega-field-label",{onClick:this.onLabelClick,"is-field-required":this.required,disabled:this.disabled,label:this.label})}renderHint(){return e("div",{class:"vega-combo-box-hint"},this.hint)}}N([l()],q.prototype,"required",void 0),N([l()],q.prototype,"hint",void 0),N([l()],q.prototype,"disabled",void 0),N([l()],q.prototype,"dropdownRenderer",void 0),N([l()],q.prototype,"label",void 0);var G=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class H extends E{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=s();if(t&&t.classList.contains("vega-chip-close-icon")){const i=A(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())}}G([l()],H.prototype,"host",void 0),G([l()],H.prototype,"value",void 0),G([l()],H.prototype,"dropdownRenderer",void 0),G([l()],H.prototype,"valueController",void 0);var M=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class P extends b{constructor(){super(...arguments),this.mutationObserver=new V({mutationFilter:L("VEGA-DROPDOWN-ITEM"),options:{childList:!0,subtree:!0},callback:()=>this.appendHostItemsToDropdown()})}componentDidLoad(){this.appendHostItemsToDropdown()}appendHostItemsToDropdown(){this.dropdownRenderer.replaceItemsSlot(this.host.querySelector("[slot=items]"))}}M([f()],P.prototype,"mutationObserver",void 0),M([l()],P.prototype,"host",void 0),M([l()],P.prototype,"dropdownRenderer",void 0),M([h("componentDidLoad")],P.prototype,"componentDidLoad",null);class U extends b{setSource(e){this.source=e}}!function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);r>3&&n&&Object.defineProperty(t,i,n)}([l({writable:!0})],U.prototype,"source",void 0);var B=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};const W=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 P,this.keyboardController=new H,this.valueController=new K,this.sourceController=new U,this.renderer=new q,this.dropdownRenderer=new _,this.formFieldController=new g({propertyRules:[{propertyName:"required",ruleFactory:e=>e?new n:null}],validationRulesName:"validationRules",defaultValue:[],attributeGetter:e=>this[e],inputContainerGetter:()=>this.dropdownRenderer.getDropdownRef(),touchableAreaGetter:()=>[this.dropdownRenderer.getSearchInputRef()]}),this.changeEventEmit=u(W,C),this.createEventEmit=u(W,y),this.searchEventEmit=u(W,k),this.dropdownEventPrevent=new x([y,k],(()=>this.dropdownRenderer.getDropdownRef()),{customPreventHandle:e=>{e.stopImmediatePropagation()}}),this.vegaComponentUsageRuntimeMetricsSlimmer=new m(T),this.label="",this.required=!1,this.source=[],this.value=[],this.isValid=null,this.autoValidation=!0,this.validationRules=[],this.disabled=!1,this.placeholder="",this.hint="",this.size="medium",this.vegaDropdownProps={},this.useDefaultFilter=!0}watchSource(){this.source=p(this.source,c)?this.source:[]}watchValue(){this.changeEventEmit.emit(this.value),D.notify(O,{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"]}}};B([v()],W.prototype,"globalSlimmers",void 0),B([f()],W.prototype,"itemsSlotController",void 0),B([f()],W.prototype,"keyboardController",void 0),B([f()],W.prototype,"valueController",void 0),B([f()],W.prototype,"sourceController",void 0),B([f()],W.prototype,"renderer",void 0),B([f()],W.prototype,"dropdownRenderer",void 0),B([f()],W.prototype,"formFieldController",void 0),B([f()],W.prototype,"changeEventEmit",void 0),B([f()],W.prototype,"createEventEmit",void 0),B([f()],W.prototype,"searchEventEmit",void 0),B([f()],W.prototype,"dropdownEventPrevent",void 0),B([f()],W.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),W.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{W as vega_combo_box}
|
package/dist/vega/p-0b36f4ce.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{F as s}from"./p-e77a83e4.js";import{V as t,a as o,b as l,c as a,d as c,e,f as i,g as n}from"./p-89d2cf34.js";import{M as r,V as f,s as b,G as p}from"./p-6e1ab235.js";import{v as h}from"./p-5f377954.js";import{V as d}from"./p-8c9ea6f4.js";import"./p-5d676a94.js";import"./p-575235c8.js";import{V as m,a as u,s as T}from"./p-bf0ced3c.js";import{V as j}from"./p-e5cd6521.js";import{v as g,s as C}from"./p-54ae02db.js";import{V as O}from"./p-258f9603.js";import{T as E}from"./p-d884c644.js";import{V as k}from"./p-9ce249a9.js";import{w as v}from"./p-893d5dfa.js";import{V as R}from"./p-5313d0bc.js";import{U as _}from"./p-8a877e12.js";import{C as V}from"./p-2d0d575f.js";import{O as A}from"./p-331a62d5.js";import{f as L}from"./p-48a58baf.js";var y=function(s,t,o,l){var a,c=arguments.length,e=c<3?t:null===l?l=Object.getOwnPropertyDescriptor(t,o):l;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)e=Reflect.decorate(s,t,o,l);else for(var i=s.length-1;i>=0;i--)(a=s[i])&&(e=(c<3?a(e):c>3?a(t,o,e):a(t,o))||e);return c>3&&e&&Object.defineProperty(t,o,e),e};class D extends f{constructor(t){super(),this.originalWatchers=new Map,this.hasDisconnected=!1,this.isEnabled=s.isEnabled("VEGA_REACT.PREVENT_CALL_WATCH_METHOD_BEFORE_COMPONENT_LOAD")&&s.isEnabled("VEGA_FRAMEWORK.PREVENT_CALL_WATCH_METHOD_BEFORE_COMPONENT_LOAD"),this.component=t.component}connectedCallback(){if(!this.isEnabled)return;if(this.hasDisconnected)return;const s=this.component.constructor.watchers;for(const t in s)s[t].forEach((s=>{this.originalWatchers.has(s)||(this.originalWatchers.set(s,this.component[s]),this.component[s]=function(){})}))}disconnectedCallback(){this.isEnabled&&(this.hasDisconnected=!0)}componentDidLoad(){this.isEnabled&&this.originalWatchers.forEach(((s,t)=>{const o=s;this.component[t]=function(...s){return o.apply(this,s)}}))}}y([r("connectedCallback")],D.prototype,"connectedCallback",null),y([r("disconnectedCallback")],D.prototype,"disconnectedCallback",null),y([r("componentDidLoad")],D.prototype,"componentDidLoad",null);var M=function(s,t,o,l){var a,c=arguments.length,e=c<3?t:null===l?l=Object.getOwnPropertyDescriptor(t,o):l;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)e=Reflect.decorate(s,t,o,l);else for(var i=s.length-1;i>=0;i--)(a=s[i])&&(e=(c<3?a(e):c>3?a(t,o,e):a(t,o))||e);return c>3&&e&&Object.defineProperty(t,o,e),e};class N extends f{constructor(s){super(),this.component=s.component}connectedCallback(){this.observer=new A(this.isAcceptable.bind(this),(()=>{L(this.component)})),V.register(_,this.observer)}disconnectedCallback(){this.observer&&(V.unregister(_,this.observer),this.observer=null)}isAcceptable(){var s,t;const o=this.component.host;return null!==(t=null===(s=m.getConnectedComponents().get(o.tagName))||void 0===s?void 0:s.has(o))&&void 0!==t&&t}}M([r("connectedCallback")],N.prototype,"connectedCallback",null),M([r("disconnectedCallback")],N.prototype,"disconnectedCallback",null);class x extends f{constructor(s){super(),this.component=s.component}connectedCallback(){const s=this.component.host.shadowRoot,t=s.insertBefore;s.insertBefore=function(s,o){if("STYLE"===s.nodeName){const t=g.nonce;void 0!==t&&s.setAttribute("nonce",t)}return t.call(this,s,o)}}}!function(s,t,o,l){var a,c=arguments.length,e=c<3?t:null===l?l=Object.getOwnPropertyDescriptor(t,o):l;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)e=Reflect.decorate(s,t,o,l);else for(var i=s.length-1;i>=0;i--)(a=s[i])&&(e=(c<3?a(e):c>3?a(t,o,e):a(t,o))||e);c>3&&e&&Object.defineProperty(t,o,e)}([r("connectedCallback")],x.prototype,"connectedCallback",null);const F=function(){globalThis.VegaDisabledFeatureKeys&&s.disable(...globalThis.VegaDisabledFeatureKeys),globalThis.VegaEnabledFeatureKeys&&s.enable(...globalThis.VegaEnabledFeatureKeys),globalThis.VegaLoader=t,globalThis.VegaNotify=o,globalThis.VegaThemeManager=l,globalThis.setVegaLogLevel=b,globalThis.VegaDialog=a,p.register([D,N,x]),globalThis.VegaEventManager=c,Object.keys(E).forEach((s=>{const{url:t}=E[s],o="vega-typography-"+s;if(!document.querySelector("#"+o)){const s=document.createElement("link");s.id=o,s.href=t,s.rel="stylesheet",document.head.append(s)}})),globalThis.VegaIconManager=d,globalThis.VegaZIndexManager=e,globalThis.ValidCreditCardNumberRule=k,globalThis.VegaEnvInfo=h.getVegaEnv(),import("./p-db8cdba6.js").then((t=>{t.default.init(s)})),globalThis.waitForVega=v,globalThis.VegaSkeletonLoader=i,globalThis.VegaTranslation=u,globalThis.VegaTranslationResourceEN=T,globalThis.VegaRTEContent=j,globalThis.VegaRTETokenExtension=n,globalThis.VegaRTELanguageExtension=R,globalThis.VegaRTEPresetToolbarItems=O,import("./p-dadc6ab3.js").then((s=>{Object.entries(s).forEach((([s,t])=>{globalThis[s]=t}))})),globalThis.VegaThemeManagerApplyBranding&&l.applyBranding(globalThis.VegaThemeManagerApplyBranding),globalThis.setVegaNonce=C,g.patchHeadInsertBeforeWithNonceToStencil()};export{F as g}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h as t,H as e,F as i,r as o,c as s,g as n}from"./p-48a58baf.js";import{c as r,M as c,V as l,I as a}from"./p-6e1ab235.js";import{V as h,I as d}from"./p-d849e0f5.js";import{s as u}from"./p-519a7d55.js";import{c as f}from"./p-86194314.js";import{C as p}from"./p-2d0d575f.js";import{d as v,D as m,V as b,f as g,S as x,a as w,P as C,Q as y}from"./p-2ee4def0.js";import{V as R,b as j,z as k,A as S,B as O,t as H}from"./p-0e954b9b.js";import{R as z,f as T,c as L,V as E,M as B,g as M,S as I,h as A,d as D}from"./p-e5cd6521.js";import{i as F}from"./p-b1faebe0.js";import{a as V}from"./p-8c9ea6f4.js";import{a as P,_ as N,u as W,Y as $,$ as U,a0 as _,d as K,a1 as q,a2 as G,a3 as J,m as Y,a4 as Z,a5 as Q,a6 as X,T as tt,L as et,A as it,a7 as ot,M as st,b as nt,H as rt,s as ct,e as lt,Z as at,U as ht,k as dt,D as ut,j as ft,z as pt,I as vt,q as mt,V as bt}from"./p-258f9603.js";import{V as gt,I as xt,T as wt,b as Ct,a as yt}from"./p-4c3075ef.js";import{g as Rt}from"./p-a4670e23.js";import{a as jt}from"./p-893d5dfa.js";import{F as kt}from"./p-c7726252.js";import{c as St}from"./p-3cdbee7e.js";import{c as Ot}from"./p-bb61f015.js";import{R as Ht,C as zt,A as Tt,a as Lt}from"./p-942fc9b9.js";import{b as Et,D as Bt}from"./p-8a877e12.js";import{O as Mt}from"./p-331a62d5.js";import{d as It}from"./p-1bc5b3bc.js";import{D as At}from"./p-521ace2d.js";import{R as Dt}from"./p-2b90fae6.js";import{C as Ft}from"./p-1da54ff3.js";import{T as Vt}from"./p-02b29c18.js";import{V as Pt}from"./p-02a4732a.js";import{i as Nt}from"./p-d27ae9ff.js";import{c as Wt}from"./p-613ddaab.js";import{t as $t}from"./p-aacf6920.js";import{f as Ut}from"./p-575235c8.js";import{r as _t}from"./p-77e64f26.js";import"./p-02841589.js";import"./p-bf19682d.js";import"./p-ed45b3b6.js";import"./p-74168615.js";import"./p-d884c644.js";import"./p-6a334573.js";import"./p-5d676a94.js";import"./p-bf0ced3c.js";import"./p-7d9cd9c8.js";import"./p-b75ee3ba.js";import"./p-abd7aeaa.js";import"./p-78a57a17.js";import"./p-52b8f2d2.js";import"./p-bdd9ef3b.js";import"./p-f1436035.js";import"./p-ab29f968.js";import"./p-1fb56e14.js";import"./p-743c5baf.js";import"./p-2608b9fe.js";import"./p-5f377954.js";import"./p-e77a83e4.js";import"./p-db8cdba6.js";import"./p-112455b1.js";import"./p-54ae02db.js";import"./p-262ec334.js";class Kt{constructor(){this.format=(t,e={})=>{const{tabWidth:i=4,useTabs:o=!0}=e,s=(o?"\t":" ").repeat(i),n=t.split(/(<\/?[^>]+>)/g).filter((t=>t.length>0));let r=0,c="";for(let t=0;t<n.length;t++){let e=n[t];e.startsWith("</")&&(r=Math.max(0,r-1));const i=s.repeat(r);if(e.startsWith("<")){e=e.replace(/style\s*=\s*"([^"]*)"/g,((t,e)=>`style="${this.formatStyle(e)}"`));const o=Kt.getTagName(e);if(Kt.INLINE_TAGS.has(o)&&t+2<n.length&&n[t+2]===`</${o}>`){let o=`${e}${n[t+1]}${n[t+2]}`;for(t+=2;t+2<n.length&&n[t+1].startsWith("<")&&Kt.INLINE_TAGS.has(Kt.getTagName(n[t+1]))&&n[t+3]===`</${Kt.getTagName(n[t+1])}>`;)o+=`${n[t+1]}${n[t+2]}${n[t+3]}`,t+=3;c+=`${i}${o}\n`}else c+=`${i}${e}\n`,e.startsWith("</")||e.endsWith("/>")||/^<br|^<img|^<meta|^<input|^<hr/i.test(e)||r++}else{const t=e;t.length>0&&(c+=`${s.repeat(r)}${t}\n`)}}return c.trim()}}static getTagName(t){var e;const i=t.match(/^<\/?([a-z0-9]+)/i);return null!==(e=null==i?void 0:i[1].toLowerCase())&&void 0!==e?e:""}formatStyle(t){return t.split(";").map((t=>t.trim())).filter(Boolean).join("; ")}}Kt.INLINE_TAGS=new Set(["span","strong","em","a","b","i","u","small","abbr","code","b","u","s","mark","time","del","ins"]);const qt=new Kt;var Gt=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class Jt extends l{constructor(){super(...arguments),this.renderHintMessage=()=>t("vega-text",null,this.hint),this.renderTextContent=()=>t("div",{class:{"rich-text-editor-container":!0,disabled:this.disabled,"vega-hidden":this.sourceView},style:{minHeight:24*this.rows+"px"},onClick:this.richTextContentFocus,role:"textbox",tabIndex:this.disabled?0:-1,onKeyDown:f(),ref:t=>this.richTextContainerRef=t},t("vega-rich-text-content",{ref:t=>this.richTextContentRef=t,content:this.value}),this.renderCharacterCounter()),this.renderCharacterCounter=()=>t("div",{class:{"text-editor-counter":!0,"counter-exceed-max-length":!1},style:{display:"none"}},t("span",null,"0"),t("span",null,"/100")),this.renderErrorMessage=()=>t("div",{class:"vega-error vega-hidden"}),this.richTextContentFocus=()=>{this.richTextContentRef.vegaFocus()},this.renderSourceViewContent=()=>{if(!this.allowSourceEdit)return;const e=this.sourceView?qt.format(this.value.toHtml({autoMatchFormat:this.sourceEditConfig.autoMatchFormat})):"";return t("div",{class:{"source-view-container":!0,"vega-hidden":!this.sourceView}},t("vega-code-block",{ref:t=>this.sourceCodeBlockRef=t,disabled:this.disabled,value:{language:"html",code:e}}))}}componentDidRender(){p.notify(v.getSubject(this.host,R),{})}getRichTextContainerRef(){return this.richTextContainerRef}getRichTextContentRef(){return this.richTextContentRef}getRichTextWrapperRef(){return this.richTextWrapperRef}getRTEEditableElementRef(){if(this.richTextContentRef&&this.richTextContentRef.shadowRoot)return this.richTextContentRef.shadowRoot.querySelector(".rich-text-content")}getSourceCode(){if(this.sourceCodeBlockRef)return this.sourceCodeBlockRef.value.code}render(){return t(e,null,this.renderRichTextEditor())}renderRichTextEditor(){return t("vega-flex",{direction:"col",gap:"0",ref:t=>this.richTextWrapperRef=t},this.renderLabel(),this.hint&&this.renderHintMessage(),this.toolbarRenderer.render(),this.renderContent(),this.renderErrorMessage())}renderLabel(){return this.label&&t("vega-field-label",{onClick:this.richTextContentFocus,isFieldRequired:this.required,disabled:this.disabled,label:this.label})}renderContent(){return t(i,null,this.renderTextContent(),this.renderSourceViewContent())}}Gt([r()],Jt.prototype,"host",void 0),Gt([r()],Jt.prototype,"toolbarRenderer",void 0),Gt([r()],Jt.prototype,"label",void 0),Gt([r()],Jt.prototype,"required",void 0),Gt([r()],Jt.prototype,"hint",void 0),Gt([r()],Jt.prototype,"disabled",void 0),Gt([r()],Jt.prototype,"rows",void 0),Gt([r()],Jt.prototype,"placeholder",void 0),Gt([r()],Jt.prototype,"value",void 0),Gt([r()],Jt.prototype,"sourceView",void 0),Gt([r()],Jt.prototype,"toolbarItems",void 0),Gt([r()],Jt.prototype,"sourceEditConfig",void 0),Gt([r()],Jt.prototype,"allowSourceEdit",void 0),Gt([c("componentDidRender")],Jt.prototype,"componentDidRender",null);var Yt=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class Zt extends l{constructor(){super(...arguments),this.getToolbarBtnRenderer=t=>{switch(t){case"clearStyle":return this.clearStyleToolbarButtonSlimmer;case"bold":return this.boldToolbarButtonSlimmer;case"textStyles":return this.textStylesToolbarButtonSlimmer;case"italic":return this.italicToolbarButtonSlimmer;case"underline":return this.underlineToolbarButtonSlimmer;case"textColor":return this.textColorToolbarButtonSlimmer;case"moreIndent":return this.moreIndentToolbarButtonSlimmer;case"lessIndent":return this.lessIndentToolbarButtonSlimmer;case"code":return this.codeToolbarButtonSlimmer;case"strikethrough":return this.strikethroughToolbarButtonSlimmer;case"link":return this.linkToolbarButtonSlimmer;case"image":return this.imageToolbarButtonSlimmer;case"bulletsNumbers":return this.bulletsNumbersToolbarButtonSlimmer;case"horizontalAlignment":return this.horizontalAlignmentToolbarButtonSlimmer;case"codeBlock":return this.codeBlockToolbarButtonSlimmer}}}render(){const[e,o]=this.renderToolbarItems();return t("vega-flex",{gap:"size-8",alignItems:"center",flexWrap:"wrap"},this.allowSourceEdit&&t(i,null,t("div",{class:"toolbar-btn-group"},this.sourceEditToolbarButtonSlimmer.render()),this.toolbarItems.length>0&&o>0&&this.renderVegaDivider()),e)}renderVegaDivider(){return t("vega-box",{height:"size-32"},t("vega-divider",{direction:"vertical"}))}renderToolbarItems(){let e=0;return[this.toolbarItems.map((i=>{let o=0;const s=i.map((i=>{const s=this.getToolbarBtnRenderer(i),n=z.getRTEToolbarButtonRenderer(i);if(s)return s.isHidden()||(e++,o++),s.render();if(n){const i={sourceEditMode:this.sourceView,host:this.host,rteRange:this.selectionController.getCurrentRange()};return n.isHidden(i)||(e++,o++),n.render(t,i)}return null})).filter(F);return t("div",{class:{"toolbar-btn-group":!0,"vega-hidden":o<1}},s)})),e]}}Yt([r()],Zt.prototype,"toolbarItems",void 0),Yt([r()],Zt.prototype,"allowSourceEdit",void 0),Yt([r()],Zt.prototype,"host",void 0),Yt([r()],Zt.prototype,"clearStyleToolbarButtonSlimmer",void 0),Yt([r()],Zt.prototype,"boldToolbarButtonSlimmer",void 0),Yt([r()],Zt.prototype,"textStylesToolbarButtonSlimmer",void 0),Yt([r()],Zt.prototype,"italicToolbarButtonSlimmer",void 0),Yt([r()],Zt.prototype,"underlineToolbarButtonSlimmer",void 0),Yt([r()],Zt.prototype,"textColorToolbarButtonSlimmer",void 0),Yt([r()],Zt.prototype,"bulletsNumbersToolbarButtonSlimmer",void 0),Yt([r()],Zt.prototype,"horizontalAlignmentToolbarButtonSlimmer",void 0),Yt([r()],Zt.prototype,"strikethroughToolbarButtonSlimmer",void 0),Yt([r()],Zt.prototype,"imageToolbarButtonSlimmer",void 0),Yt([r()],Zt.prototype,"moreIndentToolbarButtonSlimmer",void 0),Yt([r()],Zt.prototype,"lessIndentToolbarButtonSlimmer",void 0),Yt([r()],Zt.prototype,"codeToolbarButtonSlimmer",void 0),Yt([r()],Zt.prototype,"linkToolbarButtonSlimmer",void 0),Yt([r()],Zt.prototype,"codeBlockToolbarButtonSlimmer",void 0),Yt([r()],Zt.prototype,"sourceEditToolbarButtonSlimmer",void 0),Yt([r()],Zt.prototype,"selectionController",void 0),Yt([r()],Zt.prototype,"sourceView",void 0);class Qt extends gt{constructor(){super({icon:"bold",tooltip:{text:"Bold"}})}onClick(){const t=this.isSelected();this.selectionController.getSelectedNodes().filter((t=>t instanceof P)).forEach((e=>e.apply(new N(!t))))}isSelected(){const t=this.selectionController.getSelectedNodes().filter((t=>t instanceof P));return t.length>0&&t.every((t=>{var e;return null===(e=t.getAnnotationByType(W.BOLD))||void 0===e?void 0:e.bold}))}isDisabled(){const t=this.selectionController.getSelectedNodes();return super.isDisabled()||t.some((t=>{var e;return t instanceof $||(null===(e=t.getAnnotationByType(W.CODE))||void 0===e?void 0:e.code)||t.getAnnotationByType(W.IMAGE)}))}}V.register({bold:{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M0 64C0 46.3 14.3 32 32 32H80 96 224c70.7 0 128 57.3 128 128c0 31.3-11.3 60.1-30 82.3c37.1 22.4 62 63.1 62 109.7c0 70.7-57.3 128-128 128H96 80 32c-17.7 0-32-14.3-32-32s14.3-32 32-32H48V256 96H32C14.3 96 0 81.7 0 64zM224 224c35.3 0 64-28.7 64-64s-28.7-64-64-64H112V224H224zM112 288V416H256c35.3 0 64-28.7 64-64s-28.7-64-64-64H224 112z"/></svg>'}}),function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);n>3&&r&&Object.defineProperty(e,i,r)}([r()],Qt.prototype,"selectionController",void 0);class Xt extends gt{constructor(){super({icon:"italic",tooltip:{text:"Italic"}})}isSelected(){const t=this.selectionController.getSelectedNodes().filter((t=>t instanceof P));return t.length>0&&t.every((t=>{var e;return null===(e=t.getAnnotationByType(W.ITALIC))||void 0===e?void 0:e.italic}))}onClick(){const t=this.isSelected();this.selectionController.getSelectedNodes().filter((t=>t instanceof P)).forEach((e=>e.apply(new U(!t))))}isDisabled(){const t=this.selectionController.getSelectedNodes();return super.isDisabled()||t.some((t=>{var e;return t instanceof $||(null===(e=t.getAnnotationByType(W.CODE))||void 0===e?void 0:e.code)||t.getAnnotationByType(W.IMAGE)}))}}V.register({italic:{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M128 64c0-17.7 14.3-32 32-32H352c17.7 0 32 14.3 32 32s-14.3 32-32 32H293.3L160 416h64c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-17.7 0-32-14.3-32-32s14.3-32 32-32H90.7L224 96H160c-17.7 0-32-14.3-32-32z"/></svg>'}}),function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);n>3&&r&&Object.defineProperty(e,i,r)}([r()],Xt.prototype,"selectionController",void 0);class te extends gt{constructor(){super({icon:"underline",tooltip:{text:"Underline"}})}isSelected(){const t=this.selectionController.getSelectedNodes().filter((t=>t instanceof P));return t.length>0&&t.every((t=>{var e;return null===(e=t.getAnnotationByType(W.UNDERLINE))||void 0===e?void 0:e.underline}))}onClick(){const t=this.isSelected();this.selectionController.getSelectedNodes().filter((t=>t instanceof P)).forEach((e=>e.apply(new _(!t))))}isDisabled(){const t=this.selectionController.getSelectedNodes();return super.isDisabled()||t.some((t=>{var e;return t instanceof $||(null===(e=t.getAnnotationByType(W.CODE))||void 0===e?void 0:e.code)||t.getAnnotationByType(W.IMAGE)}))}}V.register({underline:{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M16 64c0-17.7 14.3-32 32-32h96c17.7 0 32 14.3 32 32s-14.3 32-32 32H128V224c0 53 43 96 96 96s96-43 96-96V96H304c-17.7 0-32-14.3-32-32s14.3-32 32-32h96c17.7 0 32 14.3 32 32s-14.3 32-32 32H384V224c0 88.4-71.6 160-160 160s-160-71.6-160-160V96H48C30.3 96 16 81.7 16 64zM0 448c0-17.7 14.3-32 32-32H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-17.7 0-32-14.3-32-32z"/></svg>'}}),function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);n>3&&r&&Object.defineProperty(e,i,r)}([r()],te.prototype,"selectionController",void 0);var ee=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class ie extends gt{constructor(){super({icon:"text-size",tooltip:{text:"Text Styles"}}),this.handleDropdownItemClick=t=>{const e=t.detail,i=ie.items.find((t=>t.key===e)).bold,o=this.selectionController.getSelectedBlocks().filter((t=>t instanceof K));o.length>0?o.forEach((t=>{t.apply(new q(e,i))})):this.focusController.focusOnLastTextNode({newLine:!0}).then((()=>{this.selectionController.getSelectedBlocks().filter((t=>t instanceof K)).forEach((t=>{t.apply(new q(e,i))}))}))}}renderBtnWrapper(e){return t("vega-dropdown",{selectType:"single",trigger:"click",alignment:"center",selectedSourceKey:this.getSelectedSourceKey(),ref:t=>{this.addDropdownObserver(t)}},e({showArrowIcon:!0}),t("div",Object.assign({slot:"items"},super.preventLostFocus()),this.renderDropdownContent()))}renderDropdownContent(){return t(i,null,ie.items.map((e=>{const i=new G(e.key),o=new J(e.bold);return t("vega-dropdown-item",{key:e.key,itemKey:e.key},t("vega-box",{padding:{right:"size-20"}},t("div",{style:Object.assign(Object.assign({},i.renderStyle({standalone:!0})),o.renderStyle({standalone:!0}))},this.translationSlimmer.t(e.label))))})))}isSelected(){return!1}isDisabled(){const t=this.selectionController.getSelectedNodes();return super.isDisabled()||t.some((t=>t instanceof $||t.getAnnotationByType(W.IMAGE)))}addDropdownObserver(t){m.addUniqueObserverToNode(t,b,this.handleDropdownItemClick)}getSelectedSourceKey(){var t;const e=this.selectionController.getSelectedBlocks().filter((t=>t instanceof K));if(e.length>0&&e.every((t=>t.type===e[0].type))){const i=e[0].getAnnotationByType(Y.TEXT_STYLE);return null!==(t=null==i?void 0:i.textStyle)&&void 0!==t?t:""}return""}}V.register({"text-size":{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M64 128V96h96l0 320H128c-17.7 0-32 14.3-32 32s14.3 32 32 32H256c17.7 0 32-14.3 32-32s-14.3-32-32-32H224l0-320h96v32c0 17.7 14.3 32 32 32s32-14.3 32-32V80c0-26.5-21.5-48-48-48H192 48C21.5 32 0 53.5 0 80v48c0 17.7 14.3 32 32 32s32-14.3 32-32zM384 304V288h64l0 128H432c-17.7 0-32 14.3-32 32s14.3 32 32 32h96c17.7 0 32-14.3 32-32s-14.3-32-32-32H512l0-128h64v16c0 17.7 14.3 32 32 32s32-14.3 32-32V272c0-26.5-21.5-48-48-48H368c-26.5 0-48 21.5-48 48v32c0 17.7 14.3 32 32 32s32-14.3 32-32z"/></svg>'}}),ie.items=[{key:"title",label:"Title",bold:!0},{key:"subtitle",label:"Subtitle"},{key:"heading-1",label:"Heading 1",bold:!0},{key:"heading-2",label:"Heading 2",bold:!0},{key:"heading-3",label:"Heading 3",bold:!0},{key:"paragraph",label:"Paragraph"}],ee([r()],ie.prototype,"selectionController",void 0),ee([r()],ie.prototype,"focusController",void 0);class oe extends gt{constructor(){super({icon:"text-slash",tooltip:{text:"Clear Style"}})}isSelected(){return!1}onClick(){this.selectionController.getSelectedNodes().filter((t=>t instanceof P)).forEach((t=>{t.apply(new Z)}))}isDisabled(){const t=this.selectionController.getSelectedNodes();return super.isDisabled()||t.some((t=>t instanceof $||t.getAnnotationByType(W.IMAGE)))}}V.register({"text-slash":{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L355.7 253.5 400.2 96H503L497 120.2c-4.3 17.1 6.1 34.5 23.3 38.8s34.5-6.1 38.8-23.3l11-44.1C577.6 61.3 554.7 32 523.5 32H376.1h-.3H204.5c-22 0-41.2 15-46.6 36.4l-6.3 25.2L38.8 5.1zm168 131.7c.1-.3 .2-.7 .3-1L217 96H333.7L301.3 210.8l-94.5-74.1zM243.3 416H192c-17.7 0-32 14.3-32 32s14.3 32 32 32H352c17.7 0 32-14.3 32-32s-14.3-32-32-32H309.8l17.6-62.1L272.9 311 243.3 416z"/></svg>'}}),function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);n>3&&r&&Object.defineProperty(e,i,r)}([r()],oe.prototype,"selectionController",void 0);class se extends gt{constructor(){super({icon:"code-simple",tooltip:{text:"Code"}})}onClick(){const t=this.isSelected();this.selectionController.getSelectedNodes().filter((t=>t instanceof P)).forEach((e=>e.apply(new Q(!t))))}isSelected(){const t=this.selectionController.getSelectedNodes();return t.length>0&&t.filter((t=>t instanceof P)).map((t=>t.getAnnotationByType(W.CODE))).every((t=>t&&t.code))}isDisabled(){const t=this.selectionController.getSelectedNodes();return super.isDisabled()||t.some((t=>t instanceof $||t.getAnnotationByType(W.LINK)||t.getAnnotationByType(W.IMAGE)))}}V.register({"code-simple":{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M214.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256 214.6 118.6zm146.7 0L498.7 256 361.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3z"/></svg>'}}),function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);n>3&&r&&Object.defineProperty(e,i,r)}([r()],se.prototype,"selectionController",void 0);class ne extends gt{constructor(){super({icon:"strikethrough",tooltip:{text:"Strikethrough"}})}isSelected(){const t=this.selectionController.getSelectedNodes().filter((t=>t instanceof P));return t.length>0&&t.every((t=>{var e;return null===(e=t.getAnnotationByType(W.STRIKETHROUGH))||void 0===e?void 0:e.strikethrough}))}onClick(){const t=this.isSelected();this.selectionController.getSelectedNodes().filter((t=>t instanceof P)).forEach((e=>e.apply(new X(!t))))}isDisabled(){const t=this.selectionController.getSelectedNodes();return super.isDisabled()||t.some((t=>{var e;return t instanceof $||(null===(e=t.getAnnotationByType(W.CODE))||void 0===e?void 0:e.code)||t.getAnnotationByType(W.IMAGE)}))}}V.register({strikethrough:{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\x3c!--! Font Awesome Free 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc. --\x3e<path fill="currentColor" d="M332.2 319.9c17.22 12.17 22.33 26.51 18.61 48.21c-3.031 17.59-10.88 29.34-24.72 36.99c-35.44 19.75-108.5 11.96-186-19.68c-16.34-6.686-35.03 1.156-41.72 17.53s1.188 35.05 17.53 41.71c31.75 12.93 95.69 35.37 157.6 35.37c29.62 0 58.81-5.156 83.72-18.96c30.81-17.09 50.44-45.46 56.72-82.11c3.998-23.27 2.168-42.58-3.488-59.05H332.2zM488 239.9l-176.5-.0309c-15.85-5.613-31.83-10.34-46.7-14.62c-85.47-24.62-110.9-39.05-103.7-81.33c2.5-14.53 10.16-25.96 22.72-34.03c20.47-13.15 64.06-23.84 155.4 .3438c17.09 4.531 34.59-5.654 39.13-22.74c4.531-17.09-5.656-34.59-22.75-39.12c-91.31-24.18-160.7-21.62-206.3 7.654C121.8 73.72 103.6 101.1 98.09 133.1C89.26 184.5 107.9 217.3 137.2 239.9L24 239.9c-13.25 0-24 10.75-24 23.1c0 13.25 10.75 23.1 24 23.1h464c13.25 0 24-10.75 24-23.1C512 250.7 501.3 239.9 488 239.9z"/></svg>'}}),function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);n>3&&r&&Object.defineProperty(e,i,r)}([r()],ne.prototype,"selectionController",void 0);class re extends gt{constructor(){super({icon:"link",tooltip:{text:"Link"}}),this.handleLinkEditorChange=({detail:t})=>{switch(t.action){case"link":{const{url:e,text:i}=t.payload,o=i!==this.currentSelectedText,s=Rt();return void this.currentSelectedNodes.forEach((t=>{t.apply(new tt(this.currentRange)).apply(new et({link:{href:e,groupKey:s},newText:o?i:void 0,needMergeNode:o&&this.currentSelectedNodes.length>1,type:"link"}))}))}}}}renderBtnWrapper(e){return t("div",{class:"toolbar-btn-link-wrapper",ref:t=>this.linkBtnWrapperRef=t},e(),t("vega-rich-text-link-editor",{resetStatusAfterHide:!1,status:"linkEdit",ref:t=>{t&&(this.linkEditorRef=t),m.addUniqueObserverToNode(t,g,this.handleLinkEditorChange)}}))}isSelected(){return!1}isDisabled(){const t=this.selectionController.getSelectedNodes(),e=this.selectionController.getSelectedBlocks();return super.isDisabled()||e.length>1||t.some((t=>{var e;return!(t instanceof P&&it.canHandle(et.name,t))||t.getAnnotationByType(W.LINK)||(null===(e=t.getAnnotationByType(W.CODE))||void 0===e?void 0:e.code)}))}onClick(){this.currentRange=this.selectionController.getCurrentRange().toNativeRange(),this.currentSelectedNodes=this.selectionController.getSelectedNodes(),this.currentRange&&(this.currentSelectedText=this.currentRange.toString(),this.currentSelectedNodes.length>0&&(this.linkEditorRef.record={text:this.currentSelectedText,url:""})),this.linkEditorRef.target||(this.linkEditorRef.target=this.linkBtnWrapperRef,jt(this.linkEditorRef).then((()=>{this.linkEditorRef.show()})))}}V.register({link:{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M562.8 267.7c56.5-56.5 56.5-148 0-204.5c-50-50-128.8-56.5-186.3-15.4l-1.6 1.1c-14.4 10.3-17.7 30.3-7.4 44.6s30.3 17.7 44.6 7.4l1.6-1.1c32.1-22.9 76-19.3 103.8 8.6c31.5 31.5 31.5 82.5 0 114L405.3 334.8c-31.5 31.5-82.5 31.5-114 0c-27.9-27.9-31.5-71.8-8.6-103.8l1.1-1.6c10.3-14.4 6.9-34.4-7.4-44.6s-34.4-6.9-44.6 7.4l-1.1 1.6C189.5 251.2 196 330 246 380c56.5 56.5 148 56.5 204.5 0L562.8 267.7zM43.2 244.3c-56.5 56.5-56.5 148 0 204.5c50 50 128.8 56.5 186.3 15.4l1.6-1.1c14.4-10.3 17.7-30.3 7.4-44.6s-30.3-17.7-44.6-7.4l-1.6 1.1c-32.1 22.9-76 19.3-103.8-8.6C57 372 57 321 88.5 289.5L200.7 177.2c31.5-31.5 82.5-31.5 114 0c27.9 27.9 31.5 71.8 8.6 103.9l-1.1 1.6c-10.3 14.4-6.9 34.4 7.4 44.6s34.4 6.9 44.6-7.4l1.1-1.6C416.5 260.8 410 182 360 132c-56.5-56.5-148-56.5-204.5 0L43.2 244.3z"/></svg>'}}),function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);n>3&&r&&Object.defineProperty(e,i,r)}([r()],re.prototype,"selectionController",void 0);class ce extends gt{constructor(){super({icon:"indent",tooltip:{text:"More Indent"}})}isSelected(){return!1}isDisabled(){const t=this.selectionController.getSelectedBlocks(),e=this.selectionController.getSelectedNodes();return super.isDisabled()||t.some((t=>"list-item"===t.type||"code-block"===t.type))||e.some((t=>t instanceof T))}onClick(){this.selectionController.getSelectedBlocks().forEach((t=>{var e,i;const o=null!==(i=null===(e=t.getAnnotationByType(Y.INDENT))||void 0===e?void 0:e.indent)&&void 0!==i?i:0;t.apply(new ot(o+1))}))}}V.register({indent:{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M0 64C0 46.3 14.3 32 32 32H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32C14.3 96 0 81.7 0 64zM192 192c0-17.7 14.3-32 32-32H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H224c-17.7 0-32-14.3-32-32zm32 96H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H224c-17.7 0-32-14.3-32-32s14.3-32 32-32zM0 448c0-17.7 14.3-32 32-32H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-17.7 0-32-14.3-32-32zM127.8 268.6L25.8 347.9C15.3 356.1 0 348.6 0 335.3V176.7c0-13.3 15.3-20.8 25.8-12.6l101.9 79.3c8.2 6.4 8.2 18.9 0 25.3z"/></svg>'}}),function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);n>3&&r&&Object.defineProperty(e,i,r)}([r()],ce.prototype,"selectionController",void 0);class le extends gt{constructor(){super({icon:"outdent",tooltip:{text:"Less Indent"}})}isSelected(){return!1}isDisabled(){const t=this.selectionController.getSelectedBlocks(),e=this.selectionController.getSelectedNodes();return super.isDisabled()||t.some((t=>"list-item"===t.type||"code-block"===t.type))||e.some((t=>t instanceof T))}onClick(){this.selectionController.getSelectedBlocks().forEach((t=>{var e,i;const o=null!==(i=null===(e=t.getAnnotationByType(Y.INDENT))||void 0===e?void 0:e.indent)&&void 0!==i?i:0;t.apply(new ot(o>1?o-1:0))}))}}V.register({outdent:{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M6 64C6 46.3 20.3 32 38 32H422c17.7 0 32 14.3 32 32s-14.3 32-32 32H38C20.3 96 6 81.7 6 64zM198 192c0-17.7 14.3-32 32-32H422c17.7 0 32 14.3 32 32s-14.3 32-32 32H230c-17.7 0-32-14.3-32-32zm32 96H422c17.7 0 32 14.3 32 32s-14.3 32-32 32H230c-17.7 0-32-14.3-32-32s14.3-32 32-32zM6 448c0-17.7 14.3-32 32-32H422c17.7 0 32 14.3 32 32s-14.3 32-32 32H38c-17.7 0-32-14.3-32-32zm.2-179.4c-8.2-6.4-8.2-18.9 0-25.3l101.9-79.3c10.5-8.2 25.8-.7 25.8 12.6V335.3c0 13.3-15.3 20.8-25.8 12.6L6.2 268.6z"/></svg>'}}),function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);n>3&&r&&Object.defineProperty(e,i,r)}([r()],le.prototype,"selectionController",void 0);class ae extends st{constructor(t){super(),this.type=nt.UPDATE_IMAGE_NODE_URL,this.url=t}}var he=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class de extends gt{constructor(){super({icon:"image",tooltip:{text:"Image"}}),this.onClick=()=>{this.inputElementRef.click()},this.fileInputChange=t=>{t.stopPropagation();const e=t.target;if(!e.files.length)return;const i=this.insertImageController.insertImageToCaretPosition(URL.createObjectURL(e.files[0]));this.updateNodeURLMap||(this.updateNodeURLMap=new Map),this.updateNodeURLMap.set(i,(t=>{i.apply(new ae(t))}));const o={file:e.files[0],sendBackUploadedURLCallback:this.updateNodeURLMap.get(i)};this.imageInsertedEventEmitter.emit(o),e.value=""}}renderBtnWrapper(e){return t("vega-box",null,e({showArrowIcon:!1}),t("input",{type:"file",style:{display:"none"},ref:t=>this.inputElementRef=t,accept:"image/*",onChange:this.fileInputChange}))}isSelected(){return!1}isDisabled(){const t=this.selectionController.getSelectedNodes();return super.isDisabled()||t.some((t=>t.getAnnotationByType(W.LINK)))}}V.register({image:{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M0 96C0 60.7 28.7 32 64 32H448c35.3 0 64 28.7 64 64V416c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V96zM323.8 202.5c-4.5-6.6-11.9-10.5-19.8-10.5s-15.4 3.9-19.8 10.5l-87 127.6L170.7 297c-4.6-5.7-11.5-9-18.7-9s-14.2 3.3-18.7 9l-64 80c-5.8 7.2-6.9 17.1-2.9 25.4s12.4 13.6 21.6 13.6h96 32H424c8.9 0 17.1-4.9 21.2-12.8s3.6-17.4-1.4-24.7l-120-176zM112 192a48 48 0 1 0 0-96 48 48 0 1 0 0 96z"/></svg>'}}),he([r()],de.prototype,"insertImageController",void 0),he([r()],de.prototype,"imageInsertedEventEmitter",void 0),he([r()],de.prototype,"selectionController",void 0);class ue extends st{constructor(t,e){super(),this.type=nt.TRANSFORM_LIST_BLOCK,this.isFlushable=!0,this.listType=t,this.selectedBlocks=e}}class fe extends st{constructor(t){super(),this.type=nt.TRANSFORM_PARAGRAPH_BLOCK,this.isFlushable=!0,this.selectedBlocks=t}}var pe=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class ve extends gt{constructor(){super({icon:"list-ul",tooltip:{text:"Bullets"}})}isSelected(){const t=this.selectionController.getSelectedBlocks();return this.isListType(t)}onClick(){this.isSelected()?this.deselectBulletList():this.selectBulletList(),this.popoverRef.hide()}isDisabled(){const t=this.selectionController.getSelectedNodes();return super.isDisabled()||t.some((t=>t instanceof T||t instanceof $))}isListType(t,e="bullet-list"){return t.length>0&&t.every((t=>t instanceof L&&t.parent.type===e))}deselectBulletList(){const t=this.selectionController.getSelectedBlocks();t[0]&&t[0].parent.apply(new fe(t))}selectBulletList(){const t=this.selectionController.getSelectedBlocks();t[0]&&("list-item"===t[0].type?t[0].parent:t[0]).apply(new ue("bullet-list",t))}}pe([r()],ve.prototype,"selectionController",void 0),pe([r()],ve.prototype,"popoverRef",void 0);var me=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class be extends gt{constructor(){super({icon:"list-ol",tooltip:{text:"Numbers"}})}isSelected(){const t=this.selectionController.getSelectedBlocks();return this.isListType(t)}onClick(){this.isSelected()?this.deselectNumberList():this.selectNumberList(),this.popoverRef.hide()}isDisabled(){const t=this.selectionController.getSelectedNodes();return super.isDisabled()||t.some((t=>t instanceof T||t instanceof $))}isListType(t,e="number-list"){return t.length>0&&t.every((t=>t instanceof L&&t.parent.type===e))}deselectNumberList(){const t=this.selectionController.getSelectedBlocks();t[0]&&t[0].parent.apply(new fe(t))}selectNumberList(){const t=this.selectionController.getSelectedBlocks();t[0]&&("list-item"===t[0].type?t[0].parent:t[0]).apply(new ue("number-list",t))}}me([r()],be.prototype,"selectionController",void 0),me([r()],be.prototype,"popoverRef",void 0);var ge=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class xe extends gt{constructor(){super({icon:"list-ul",tooltip:{text:"Bullets"}}),this.bulletsToolbarButtonSlimmer=new ve,this.numbersToolbarButtonSlimmer=new be}componentWillRender(){this.numbersToolbarButtonSlimmer.isSelected()?super.setIcon("list-ol"):super.setIcon("list-ul")}renderBtnWrapper(e){return t("vega-popover",{showArrow:!1,trigger:"click",placement:"bottom",alignment:"center",ref:t=>this.popoverRef=t},t("div",{slot:"popover-content"},e({showArrowIcon:!0})),t("div",{slot:"popover"},this.renderContent()))}renderContent(){return t("vega-flex",{gap:"size-8","justify-content":"center"},t("div",null,this.bulletsToolbarButtonSlimmer.render()),t("div",null,this.numbersToolbarButtonSlimmer.render()))}isSelected(){return!1}isDisabled(){const t=this.selectionController.getSelectedNodes();return super.isDisabled()||t.some((t=>t instanceof T||t instanceof $))}}V.register({"list-ul":{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M64 144a48 48 0 1 0 0-96 48 48 0 1 0 0 96zM192 64c-17.7 0-32 14.3-32 32s14.3 32 32 32H480c17.7 0 32-14.3 32-32s-14.3-32-32-32H192zm0 160c-17.7 0-32 14.3-32 32s14.3 32 32 32H480c17.7 0 32-14.3 32-32s-14.3-32-32-32H192zm0 160c-17.7 0-32 14.3-32 32s14.3 32 32 32H480c17.7 0 32-14.3 32-32s-14.3-32-32-32H192zM64 464a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm48-208a48 48 0 1 0 -96 0 48 48 0 1 0 96 0z"/></svg>'},"list-ol":{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M24 56c0-13.3 10.7-24 24-24H80c13.3 0 24 10.7 24 24V176h16c13.3 0 24 10.7 24 24s-10.7 24-24 24H40c-13.3 0-24-10.7-24-24s10.7-24 24-24H56V80H48C34.7 80 24 69.3 24 56zM86.7 341.2c-6.5-7.4-18.3-6.9-24 1.2L51.5 357.9c-7.7 10.8-22.7 13.3-33.5 5.6s-13.3-22.7-5.6-33.5l11.1-15.6c23.7-33.2 72.3-35.6 99.2-4.9c21.3 24.4 20.8 60.9-1.1 84.7L86.8 432H120c13.3 0 24 10.7 24 24s-10.7 24-24 24H32c-9.5 0-18.2-5.6-22-14.4s-2.1-18.9 4.3-25.9l72-78c5.3-5.8 5.4-14.6 .3-20.5zM224 64H480c17.7 0 32 14.3 32 32s-14.3 32-32 32H224c-17.7 0-32-14.3-32-32s14.3-32 32-32zm0 160H480c17.7 0 32 14.3 32 32s-14.3 32-32 32H224c-17.7 0-32-14.3-32-32s14.3-32 32-32zm0 160H480c17.7 0 32 14.3 32 32s-14.3 32-32 32H224c-17.7 0-32-14.3-32-32s14.3-32 32-32z"/></svg>'}}),ge([r()],xe.prototype,"selectionController",void 0),ge([a()],xe.prototype,"bulletsToolbarButtonSlimmer",void 0),ge([a()],xe.prototype,"numbersToolbarButtonSlimmer",void 0),ge([c("componentWillRender")],xe.prototype,"componentWillRender",null);var we=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class Ce extends gt{constructor(){super({icon:"align-left",tooltip:{text:"Left Align"}})}isSelected(){const t=this.selectionController.getSelectedBlocks();return t.length>0&&t.every((t=>{var e;return"left"===(null===(e=t.getAnnotationByType(Y.ALIGNMENT))||void 0===e?void 0:e.textAlign)}))}onClick(){this.selectionController.getSelectedBlocks().forEach((t=>t.apply(new rt("left")))),this.popoverRef.hide()}}V.register({"align-left":{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M288 64c0 17.7-14.3 32-32 32H32C14.3 96 0 81.7 0 64S14.3 32 32 32H256c17.7 0 32 14.3 32 32zm0 256c0 17.7-14.3 32-32 32H32c-17.7 0-32-14.3-32-32s14.3-32 32-32H256c17.7 0 32 14.3 32 32zM0 192c0-17.7 14.3-32 32-32H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-17.7 0-32-14.3-32-32zM448 448c0 17.7-14.3 32-32 32H32c-17.7 0-32-14.3-32-32s14.3-32 32-32H416c17.7 0 32 14.3 32 32z"/></svg>'}}),we([r()],Ce.prototype,"selectionController",void 0),we([r()],Ce.prototype,"popoverRef",void 0);var ye=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class Re extends gt{constructor(){super({icon:"align-center",tooltip:{text:"Center Align"}})}isSelected(){const t=this.selectionController.getSelectedBlocks();return t.length>0&&t.every((t=>{var e;return"center"===(null===(e=t.getAnnotationByType(Y.ALIGNMENT))||void 0===e?void 0:e.textAlign)}))}onClick(){this.selectionController.getSelectedBlocks().forEach((t=>t.apply(new rt("center")))),this.popoverRef.hide()}}V.register({"align-center":{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M352 64c0-17.7-14.3-32-32-32H128c-17.7 0-32 14.3-32 32s14.3 32 32 32H320c17.7 0 32-14.3 32-32zm96 128c0-17.7-14.3-32-32-32H32c-17.7 0-32 14.3-32 32s14.3 32 32 32H416c17.7 0 32-14.3 32-32zM0 448c0 17.7 14.3 32 32 32H416c17.7 0 32-14.3 32-32s-14.3-32-32-32H32c-17.7 0-32 14.3-32 32zM352 320c0-17.7-14.3-32-32-32H128c-17.7 0-32 14.3-32 32s14.3 32 32 32H320c17.7 0 32-14.3 32-32z"/></svg>'}}),ye([r()],Re.prototype,"selectionController",void 0),ye([r()],Re.prototype,"popoverRef",void 0);var je=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class ke extends gt{constructor(){super({icon:"align-right",tooltip:{text:"Right Align"}})}isSelected(){const t=this.selectionController.getSelectedBlocks();return t.length>0&&t.every((t=>{var e;return"right"===(null===(e=t.getAnnotationByType(Y.ALIGNMENT))||void 0===e?void 0:e.textAlign)}))}onClick(){this.selectionController.getSelectedBlocks().forEach((t=>t.apply(new rt("right")))),this.popoverRef.hide()}}V.register({"align-right":{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M448 64c0 17.7-14.3 32-32 32H192c-17.7 0-32-14.3-32-32s14.3-32 32-32H416c17.7 0 32 14.3 32 32zm0 256c0 17.7-14.3 32-32 32H192c-17.7 0-32-14.3-32-32s14.3-32 32-32H416c17.7 0 32 14.3 32 32zM0 192c0-17.7 14.3-32 32-32H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-17.7 0-32-14.3-32-32zM448 448c0 17.7-14.3 32-32 32H32c-17.7 0-32-14.3-32-32s14.3-32 32-32H416c17.7 0 32 14.3 32 32z"/></svg>'}}),je([r()],ke.prototype,"selectionController",void 0),je([r()],ke.prototype,"popoverRef",void 0);var Se=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class Oe extends gt{constructor(){super({icon:"align-justify",tooltip:{text:"Justified"}})}isSelected(){const t=this.selectionController.getSelectedBlocks();return t.length>0&&t.every((t=>{var e;return"justify"===(null===(e=t.getAnnotationByType(Y.ALIGNMENT))||void 0===e?void 0:e.textAlign)}))}onClick(){this.selectionController.getSelectedBlocks().forEach((t=>t.apply(new rt("justify")))),this.popoverRef.hide()}}V.register({"align-justify":{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M448 64c0-17.7-14.3-32-32-32H32C14.3 32 0 46.3 0 64S14.3 96 32 96H416c17.7 0 32-14.3 32-32zm0 256c0-17.7-14.3-32-32-32H32c-17.7 0-32 14.3-32 32s14.3 32 32 32H416c17.7 0 32-14.3 32-32zM0 192c0 17.7 14.3 32 32 32H416c17.7 0 32-14.3 32-32s-14.3-32-32-32H32c-17.7 0-32 14.3-32 32zM448 448c0-17.7-14.3-32-32-32H32c-17.7 0-32 14.3-32 32s14.3 32 32 32H416c17.7 0 32-14.3 32-32z"/></svg>'}}),Se([r()],Oe.prototype,"selectionController",void 0),Se([r()],Oe.prototype,"popoverRef",void 0);var He=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class ze extends gt{constructor(){super({icon:"align-left",tooltip:{text:"Left Align"}}),this.leftAlignToolbarButtonSlimmer=new Ce,this.centerAlignToolbarButtonSlimmer=new Re,this.rightAlignToolbarButtonSlimmer=new ke,this.justifiedToolbarButtonSlimmer=new Oe}componentWillRender(){this.leftAlignToolbarButtonSlimmer.isSelected()?super.setIcon("align-left"):this.centerAlignToolbarButtonSlimmer.isSelected()?super.setIcon("align-center"):this.rightAlignToolbarButtonSlimmer.isSelected()?super.setIcon("align-right"):this.justifiedToolbarButtonSlimmer.isSelected()?super.setIcon("align-justify"):super.setIcon("align-left")}renderBtnWrapper(e){return t("vega-popover",{trigger:"click",showArrow:!1,alignment:"center",placement:"bottom",ref:t=>this.popoverRef=t},t("div",{slot:"popover-content"},e({showArrowIcon:!0})),t("div",{slot:"popover"},this.renderContent()))}renderContent(){return t("vega-flex",{gap:"size-8","justify-content":"center"},t("div",null,this.leftAlignToolbarButtonSlimmer.render()),t("div",null,this.centerAlignToolbarButtonSlimmer.render()),t("div",null,this.rightAlignToolbarButtonSlimmer.render()),t("div",null,this.justifiedToolbarButtonSlimmer.render()))}isSelected(){return!1}isDisabled(){return super.isDisabled()||this.selectionController.getSelectedBlocks().some((t=>"code-block"===t.type))}}He([r()],ze.prototype,"selectionController",void 0),He([a()],ze.prototype,"leftAlignToolbarButtonSlimmer",void 0),He([a()],ze.prototype,"centerAlignToolbarButtonSlimmer",void 0),He([a()],ze.prototype,"rightAlignToolbarButtonSlimmer",void 0),He([a()],ze.prototype,"justifiedToolbarButtonSlimmer",void 0),He([c("componentWillRender")],ze.prototype,"componentWillRender",null);class Te{constructor(t,e){this.content=t.clone(!0),this.selection=e.clone(),this.refreshSelectionNodes()}clone(){return new Te(this.content,this.selection)}refreshSelectionNodes(){const{startNode:t,endNode:e,startOffset:i,endOffset:o}=this.selection.range;if(t&&e){const s=this.content.findNodeById(t.id),n=this.content.findNodeById(e.id);s&&n&&this.selection.range.updateRTERange({startNode:s,endNode:n,startOffset:i,endOffset:o})}}}var Le=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class Ee extends l{connectedCallback(){const t=It((()=>{this.valueController.flushChanges(this.value)}),Ee.VALUE_CHANGE_DEBOUNCE_TIME,this);this.flushChangeObserver=new Mt(this.isAcceptableFlushChange.bind(this),t),p.register(v.getSubject(this.host,j),this.flushChangeObserver)}disconnectedCallback(){p.unregister(v.getSubject(this.host,j),this.flushChangeObserver)}componentWillLoad(){!this.value||this.value instanceof E||(this.value=E.fromJSON(this.value)),this.registerEditorRefAndContent()}watchValueUpdate(){!this.value||this.value instanceof E?this.value&&0!==this.value.children.length?(this.changeEventEmitter.emit(this.value),p.notify(Et,{host:this.host,detail:this.value})):this.value=E.createEmptyContent():this.value=E.fromJSON(this.value),this.registerEditorRefAndContent()}async flushChanges(t,e=!0){this.value=t.clone(),e&&this.historyController.registerHistory(new Te(this.value,new Ht(this.selectionController.getCurrentRange()))),await jt(this.host)}isAcceptableFlushChange(){return!0}registerEditorRefAndContent(){this.host&&this.host.value&&ct.register(this.host,this.host.value)}}Ee.VALUE_CHANGE_DEBOUNCE_TIME=50,Le([r()],Ee.prototype,"host",void 0),Le([r({writable:!0})],Ee.prototype,"value",void 0),Le([r()],Ee.prototype,"changeEventEmitter",void 0),Le([r()],Ee.prototype,"valueController",void 0),Le([r()],Ee.prototype,"historyController",void 0),Le([r()],Ee.prototype,"selectionController",void 0),Le([c("connectedCallback")],Ee.prototype,"connectedCallback",null),Le([c("disconnectedCallback")],Ee.prototype,"disconnectedCallback",null),Le([c("componentWillLoad")],Ee.prototype,"componentWillLoad",null),Le([c("watchValueUpdate")],Ee.prototype,"watchValueUpdate",null);class Be{constructor(t){this.editor=t}syncRichTextContentEditable(){this.editor.richTextContentEditable=!this.editor.disabled}}class Me{execute(t,e,i,o){this.initCurrentStateAndSelection(t,e),this.setCurrentRichTextEditor(i),this.handleEvent(o)}isRootContainer(t){return t&&t.nodeType===Node.ELEMENT_NODE&&t.classList.contains("rich-text-content")}isEmptyParagraph(t){return t&&t.childNodes&&0===t.childNodes.length}removeSelectionRange(t=!1){p.notify(v.getSubject(this.richTextEditorRef,k),{host:this.richTextEditorRef,detail:t});const e=this.selectionController.getCurrentRange(),i=this.selectionController.getSelectedNodes();return e.startNode||i[0]}createEmptyParagraph(){const t=new K(Rt(),"paragraph"),e=new P(`${t.id}1`,"",t);return t.apply(new lt([e])),t}initCurrentStateAndSelection(t,e){this.currentState=t,this.selectionController=e}setCurrentRichTextEditor(t){this.richTextEditorRef=t}}class Ie extends st{constructor(t,e){super(),this.type=nt.REPLACE_SELECTED_TEXT,this.textToBeInsert="",this.textToBeInsert=t,this.currentRange=e}}class Ae extends st{constructor(t,e,i){super(),this.type=nt.INSERT_TEXT_TO_DECORATOR_NODE,this.text="",this.offset=0,this.decoratorNode=t,this.text=e,this.offset=i}}class De extends Me{handleEvent(t){const e=t.data,i=this.selectionController.getCurrentRange(),{startContainer:o,startOffset:s}=i,n=this.selectionController.getSelectedNodes();if(n.length<2){if(!n.length&&this.isRootContainer(o)){const t=this.insertTextToRoot(e);this.selectionController.enqueueSelectionRangeFutureState(t,e.length)}else if(n[0]instanceof P)if(n[0].isContentEditable()){let t=s+e.length,r=!1,c=n[0];"\n"===c.text?(c=this.insertTextToLineBreakNode(c,e),r=!0):(o.nodeValue===at&&s===at.length&&c.isEmpty()&&(o.nodeValue="",t-=at.length),c instanceof P&&(r=!0,c.apply(new Ie(e,i)))),r&&this.selectionController.enqueueSelectionRangeFutureState(c,Math.min(t,c.text.length))}else n[0].parent.apply(new Ae(n[0],e,s))}else{const t=this.removeSelectionRange(!0);t instanceof P&&(t.apply(new Ie(e,i)),this.selectionController.enqueueSelectionRangeFutureState(t,Math.min(s+e.length,t.text.length)))}}insertTextToRoot(t){if(this.currentState&&this.currentState.children[0]&&this.currentState.children[0]instanceof K){const e=this.currentState.children[0].children[0];return e.apply(new ht(t)),e}}insertTextToLineBreakNode(t,e){const{startOffset:i,endOffset:o}=this.selectionController.getCurrentRange(),s=t.parent;if(s instanceof K){const n=s.children.indexOf(t);if(0===i&&i===o&&s.children[n+1]){const i=t.cloneWithText(e);return s.apply(new dt(t,i)),i}return t.apply(new ht(e)),t}}}class Fe extends Me{handleEvent(){const t=this.selectionController.getSelectedBlocks();t.length&&(t.length<2?this.breakSingleBlock():this.breakMultipleBlocks())}breakMultipleBlocks(){const t=this.selectionController.getSelectedBlocks(),e=this.selectionController.getCurrentRange(),i=this.removeSelectionRange();if(t.length&&"list-item"===t[0].type||"list-item"===t[t.length-1].type){const o=i.parent,s=t[t.length-1];if(o.type!==s.type&&e.startContainer.nodeType===e.endContainer.nodeType){o.apply(new B(s));const t=new ut(i,i.text.length);return o.apply(t),void this.switchCaretPositionToNextElement(t.newBlock)}}this.selectionController.enqueueSelectionRangeFutureState(i,e.startOffset)}breakSingleBlock(){const t=this.removeSelectionRange(),e=t.parent,{startOffset:i}=this.selectionController.getCurrentRange();if(e){const o=new M(t,i);e.apply(o),this.switchCaretPositionToNextElement(o.newBlock)}}switchCaretPositionToNextElement(t){t&&t.children&&this.selectionController.enqueueSelectionRangeFutureState(t.children[0],0)}}class Ve extends st{constructor(t,e){super(),this.type=nt.LINE_BREAK_SINGLE_BLOCK,this.startContainerNode=t,this.startOffset=e}}class Pe extends st{constructor(t){super(),this.type=nt.LINE_BREAK_MULTIPLE_BLOCKS,this.selectedBlocks=t}}class Ne extends Me{handleEvent(){const t=this.selectionController.getCurrentRange(),e=this.selectionController.getSelectedBlocks();this.isRootContainer(t.startContainer)&&this.breakNewBlock(),e.length&&(e.length<2?this.breakSingleBlock():this.breakMultipleBlocks())}breakNewBlock(){if(this.currentState&&this.currentState.children[0]&&this.currentState.children[0]instanceof K){const t=new Ve(this.currentState.children[0].children[0],0);this.currentState.children[0].apply(t),this.switchCaretPositionToSpecifiedNode(t.lineBreakNode)}}breakSingleBlock(){const t=this.selectionController.getCurrentRange(),e=this.removeSelectionRange(),i=e.parent;if(i){const o=new Ve(e,t.startOffset);i.apply(o),this.switchCaretPositionToSpecifiedNode(o.lineBreakNode)}}breakMultipleBlocks(){const t=this.selectionController.getSelectedBlocks(),e=this.removeSelectionRange(),i=new Pe(t);e.parent.apply(i),this.switchCaretPositionToSpecifiedNode(i.lineBreakNode)}switchCaretPositionToSpecifiedNode(t){this.selectionController.enqueueSelectionRangeFutureState(this.getNextRTENode(t),0)}getNextRTENode(t){const e=t.parent.children.indexOf(t);return t.parent.children[e+1]||t}}class We extends st{constructor(t,e){super(),this.type=nt.DELETE_BLOCK_CONTENT,this.startContainerNode=t,this.startOffset=e}}class $e extends Me{handleEvent(){this.selectionController.getSelectedBlocks().length<2?this.deleteContentWithSingleBlock():this.deleteContentWithMultipleNodes()}deleteContentWithSingleBlock(){const t=this.selectionController.getCurrentRange(),{startOffset:e,endOffset:i,startContainer:o,endContainer:s}=t,n=this.selectionController.getSelectedBlocks(),r=this.selectionController.getSelectedNodes();if(e!==i||o!==s)this.deleteContentWithMultipleNodes();else if(n[0]){const t=new We(r[0],e);if(n[0].apply(t),t.previousNode){const i=t.previousNode===r[0]?Math.max(0,e-1):t.previousNode.getRangeEndOffset();this.selectionController.enqueueSelectionRangeFutureState(t.previousNode,i)}else t.nextNode?this.selectionController.enqueueSelectionRangeFutureState(t.nextNode,0):0===this.currentState.children.length&&this.insertDefaultParagraph()}}deleteContentWithMultipleNodes(){const t=this.selectionController.getSelectedNodes(),e=this.removeSelectionRange(!0),i=t[t.length-1];t.length>1&&i instanceof P&&i.isEmpty()&&i.parent.apply(new ft(i)),this.convertFirstBlockToParagraph(e.parent)}convertFirstBlockToParagraph(t){if(this.currentState.children[0]===t&&t instanceof K&&1===t.children.length&&t.children[0].isEmpty()&&"paragraph"!==t.type){const e=this.createEmptyParagraph();e.apply(new pt(t.children)),t.parent.apply(new dt(t,e)),t.parent.apply(new ft(t))}}insertDefaultParagraph(){const t=this.createEmptyParagraph();this.currentState.apply(new lt([t])),this.selectionController.enqueueSelectionRangeFutureState(t.children[0],1)}}class Ue extends Me{handleEvent(t){const e=this.parsePastedElements(t),{startContainer:i}=this.selectionController.getCurrentRange();this.isRootContainer(i)?this.insertBlocksToRoot(e):this.isEmptyParagraph(i)?this.insertBlocksBeforeEmptyBlock(e):this.insertBlocksToContent(e)}insertBlocksToRoot(t){this.currentState.apply(new lt(t))}insertBlocksToContent(t){const e=this.removeSelectionRange();if(e&&e.parent){const i=e.parent,{startOffset:o}=this.selectionController.getCurrentRange(),s=new ut(e,o);i.apply(s),i.parent.apply(new vt(i,...t)),this.switchCaretPositionToNextElement(s.newBlock)}}insertBlocksBeforeEmptyBlock(t){const e=this.removeSelectionRange(),i=null==e?void 0:e.parent;i&&(i.parent.apply(new dt(i,...t)),this.switchCaretPositionToNextElement(i))}parsePastedElements(t){let e=t.dataTransfer.getData("text/html");if(!e){const i=t.dataTransfer.getData("text/plain");e=this.parsePlainText(i)}const i=I.preserve(e),o=i.getProcessedHtml(),s=(new DOMParser).parseFromString(o,"text/html"),n=Array.from(s.body.childNodes);return i.restore(n),A.process(n).filter(Boolean).map((t=>t.toDto())).filter(Boolean)}switchCaretPositionToNextElement(t){t&&t.children&&this.selectionController.enqueueSelectionRangeFutureState(t.children[0],0)}parsePlainText(t){return t.split("\n").map((t=>""===t?"<p>\n</p>":`<p>${t}</p>`)).join("")}}var _e=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class Ke extends l{constructor(){super(...arguments),this.insertTextHandler=new De,this.insertParagraphHandler=new Fe,this.insertLineBreakHandler=new Ne,this.deleteContentHandler=new $e,this.insertPasteHandler=new Ue,this.handleUserInputAction=t=>{const e=t.inputType;if(t.preventDefault(),this.initValueIfEmpty(),"insertCompositionText"===e||this.isFocusNodeNonEditable())return;this.insertCompositionTextController.removeObserver();let i=!1;switch(e){case"insertParagraph":i=!0,this.insertParagraphHandler.execute(this.value,this.selectionController,this.host,t);break;case"insertText":i=!0,this.insertTextHandler.execute(this.value,this.selectionController,this.host,t);break;case"insertLineBreak":i=!0,this.insertLineBreakHandler.execute(this.value,this.selectionController,this.host,t);break;case"deleteContentBackward":i=!0,this.deleteContentHandler.execute(this.value,this.selectionController,this.host,t);break;case"insertFromPaste":i=!0,this.insertPasteHandler.execute(this.value,this.selectionController,this.host,t)}i&&this.valueController.flushChanges(this.value)}}addActionListener(){const t=this.getEditableElementRef();t&&(t.addEventListener("beforeinput",this.handleUserInputAction),t.addEventListener("drop",this.preventDropEvent))}removeActionListener(){const t=this.getEditableElementRef();t&&(t.removeEventListener("beforeinput",this.handleUserInputAction),t.removeEventListener("drop",this.preventDropEvent))}getEditableElementRef(){return this.editableElementRef||(this.editableElementRef=this.vegaRichTextEditorRenderer.getRTEEditableElementRef()),this.editableElementRef}preventDropEvent(t){t.preventDefault()}initValueIfEmpty(){if(!this.value){const t=Rt();this.valueController.flushChanges(E.fromJSON([{id:t,type:"paragraph",nodes:[{id:`${t}1`,type:"text",text:""}]}]))}}isFocusNodeNonEditable(){const{startContainer:t,endContainer:e}=this.selectionController.getCurrentRange(),i=this.selectionController.getSelectedNodes();if(t&&t===e&&0===i.length){const e=t.nodeType===Node.ELEMENT_NODE?t:t.parentElement;return e&&e.classList.contains(mt.CODE_BLOCK_PLACEHOLDER_CLASS_NAME)}return!1}}_e([r()],Ke.prototype,"host",void 0),_e([r()],Ke.prototype,"value",void 0),_e([r()],Ke.prototype,"valueController",void 0),_e([r()],Ke.prototype,"vegaRichTextEditorRenderer",void 0),_e([r()],Ke.prototype,"selectionController",void 0),_e([r()],Ke.prototype,"insertCompositionTextController",void 0),_e([c("componentDidLoad")],Ke.prototype,"addActionListener",null),_e([c("disconnectedCallback")],Ke.prototype,"removeActionListener",null);class qe extends st{constructor(t,e,i){super(),this.isFlushable=!0,this.type=nt.INSERT_IMAGE_TO_BLOCK,this.splitPointNode=t,this.startOffsetOfNode=e,this.imageBlockToBeInserted=i}}var Ge=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class Je extends l{insertImageToCaretPosition(t){const e=this.selectionController.getSelectedBlocks(),i=new D(Rt()),o=new T(Rt(),t,i);if(o.apply(new xt("md","")),i.apply(new lt([o])),e.length<1||this.value.children.length<1)this.value.apply(new lt([i])),this.valueController.flushChanges(this.value);else{const{startOffset:t}=this.selectionController.getCurrentRange(),o=this.selectionController.getSelectedNodes();e[0].apply(new qe(o[0],t,i))}return this.updateCaretPosition(o),o}registerObserver(){this.registerImageSelectedObserver()}unRegisterObserver(){this.removeImageSelectedObserver()}updateCaretPosition(t){this.selectionController.enqueueSelectionRangeFutureState(t,1)}registerImageSelectedObserver(){const t=this.vegaRichTextEditorRenderer.getRichTextContentRef();t&&(m.addUniqueObserverToNode(t,S,(t=>{const e=this.selectionController.getCurrentRange();if(!e||e.startContainer!==t.host||0!==e.startOffset){const e=ct.getEntityByDOM(t.host.querySelector("img"));this.selectionController.enqueueSelectionRangeFutureState(e,0,e,0,!0)}})),m.addUniqueObserverToNode(t,O,(t=>{const e=this.selectionController.getCurrentRange();e&&e.startContainer===t.host&&1===e.startOffset||this.selectionController.enqueueSelectionRangeFutureState(t.host,1,t.host,1,!0)})))}removeImageSelectedObserver(){const t=this.vegaRichTextEditorRenderer.getRichTextContentRef();t&&(m.removeUniqueObserverFromNode(t,S),m.removeUniqueObserverFromNode(t,O))}}Ge([r()],Je.prototype,"selectionController",void 0),Ge([r()],Je.prototype,"value",void 0),Ge([r()],Je.prototype,"valueController",void 0),Ge([r()],Je.prototype,"vegaRichTextEditorRenderer",void 0),Ge([c("componentDidLoad")],Je.prototype,"registerObserver",null),Ge([c("disconnectedCallback")],Je.prototype,"unRegisterObserver",null);var Ye=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class Ze extends l{constructor(){super(...arguments),this.doFocusOnLastTextNode=async t=>{const e=t.getLastNode(),i=ct.getDOMByEntity(e);i&&(e.isContentEditable()?this.setCaretRangeToNodeEnd(i.firstChild,i.firstChild.nodeValue.length):this.setCaretRangeToNodeEnd(i.parentElement,e.getRangeEndOffset()),await this.vegaRichTextEditorRenderer.getRichTextContentRef().vegaFocus())}}async focusOnLastTextNode(t){const e=this.value.children[this.value.children.length-1];if(e instanceof K&&!(null==t?void 0:t.newLine))await this.doFocusOnLastTextNode(e);else{const t=K.from({id:Rt(),type:"paragraph",nodes:[{id:Rt(),type:"text",text:""}]});e.parent.apply(new vt(e,t)),await this.valueController.flushChanges(this.value),await this.doFocusOnLastTextNode(t)}}setCaretRangeToNodeEnd(t,e){const i=new Range;i.setStart(t,e),this.selectionController.setSelectionRange(i)}}Ye([r()],Ze.prototype,"vegaRichTextEditorRenderer",void 0),Ye([r()],Ze.prototype,"selectionController",void 0),Ye([r()],Ze.prototype,"valueController",void 0),Ye([r()],Ze.prototype,"value",void 0);var Qe=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class Xe extends l{connectedCallback(){this.observer=new Mt(this.isAcceptObserver.bind(this),(t=>{wt.getTextNodeElements().forEach(((e,i)=>{i.style.color=t?e.textColor.dark:e.textColor.light}))})),p.register(Bt,this.observer)}disconnectResizeObserver(){p.unregister(Bt,this.observer)}isAcceptObserver(){return!0}}Qe([c("connectedCallback")],Xe.prototype,"connectedCallback",null),Qe([c("disconnectedCallback")],Xe.prototype,"disconnectResizeObserver",null);var ti=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class ei extends l{constructor(){super(...arguments),this.insertCompositionTextEndFlag=!0,this.observerOptions={characterData:!0,characterDataOldValue:!0,subtree:!0,childList:!0},this.updateTextFromDom=t=>{let e=!1;!1!==this.insertCompositionTextEndFlag&&t.forEach((t=>{const{target:i,oldValue:o}=t;if(i.nodeType===Node.TEXT_NODE&&i.parentElement){const t=ct.getEntityByDOM(i.parentElement),s=i.textContent;t instanceof P&&t.isContentEditable()&&t.parent instanceof K?e=this.updateCurrentNodeText(t,s,o):s&&(i.parentElement.removeChild(i),e=!0)}})),e&&this.valueController.flushChanges(this.value)},this.handleObserver=t=>{t.every((t=>"characterData"===t.type))&&this.updateTextFromDom(t)},this.handleCompositionStart=()=>{this.insertCompositionTextEndFlag=!1,p.notify(v.getSubject(this.host,k),{host:this.host,detail:!0})},this.handleCompositionEnd=t=>{this.insertCompositionTextEndFlag=!0;const e=t.data;e&&this.dispatchInsertTextEvent(e)}}initMutationObserver(){if(this.mutationObserver){const t=this.getEditableElementRef();t&&(this.mutationObserver.disconnect(),this.mutationObserver.observe(t,this.observerOptions))}}removeObserver(){this.mutationObserver&&this.mutationObserver.disconnect()}isComposing(){return!this.insertCompositionTextEndFlag}addCompositionTextEventListener(){const t=this.getEditableElementRef();t&&(t.addEventListener("compositionstart",this.handleCompositionStart),t.addEventListener("compositionend",this.handleCompositionEnd)),this.mutationObserver=new MutationObserver(this.handleObserver),this.initMutationObserver()}removeCompositionTextEventListener(){const t=this.getEditableElementRef();t&&(t.removeEventListener("compositionstart",this.handleCompositionStart),t.removeEventListener("compositionend",this.handleCompositionEnd)),this.removeObserver()}reConnectObserver(){this.initMutationObserver()}appendLineBreakNode(t){const e=t.parent,i=e.children.indexOf(t);if(e.children[i+1]){const o=t.cloneWithText("\n");e.apply(new dt(e.children[i+1],o))}}updateCurrentNodeText(t,e,i){const o=this.removeZeroWidthSpace(e.replace(/(\n)$/,""));if(t.text!==o){const{startOffset:s}=this.selectionController.getCurrentRange(),n="\n"===t.text;t.apply(new ht(o)),n&&this.appendLineBreakNode(t);const r=Math.min(o.length,s-(i?i.length-e.length:0));return this.selectionController.enqueueSelectionRangeFutureState(t,Math.max(0,r)),!0}}getEditableElementRef(){return this.editableElementRef||(this.editableElementRef=this.vegaRichTextEditorRenderer.getRTEEditableElementRef()),this.editableElementRef}removeZeroWidthSpace(t){return t.startsWith(at)?t.slice(at.length):t.endsWith(at)?t.slice(0,t.length-at.length):t}dispatchInsertTextEvent(t){const e=new CustomEvent("beforeinput");e.data=t,e.inputType="insertText",this.editableElementRef.dispatchEvent(e)}}ti([r()],ei.prototype,"selectionController",void 0),ti([r()],ei.prototype,"host",void 0),ti([r()],ei.prototype,"value",void 0),ti([r()],ei.prototype,"valueController",void 0),ti([r()],ei.prototype,"userInputController",void 0),ti([r()],ei.prototype,"vegaRichTextEditorRenderer",void 0),ti([c("componentDidLoad")],ei.prototype,"addCompositionTextEventListener",null),ti([c("disconnectedCallback")],ei.prototype,"removeCompositionTextEventListener",null),ti([c("componentDidRender")],ei.prototype,"reConnectObserver",null);var ii=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class oi extends l{constructor(){super(...arguments),this.deleteActionProcess=t=>{const e=this.selectionController.getCurrentRange(),{startContainer:i,endContainer:o,startOffset:s,endOffset:n}=e;if(i!==o||s!==n){const s=this.removeSelectionRange();!(!t||!t.detail)&&t.detail&&this.mergeRangeStartAndEnd(i,o),this.selectionController.enqueueSelectionRangeFutureState(s,e.startOffset)}}}addDeleteObserver(){m.addUniqueObserverToNode(this.host,k,this.deleteActionProcess)}removeDeleteObserver(){m.removeUniqueObserverFromNode(this.host,k)}removeSelectionRange(){const t=this.selectionController.getCurrentRange(),e=this.selectionController.getSelectedNodes(),{endOffset:i,startOffset:o}=t,s=e[0],n=e[e.length-1];if(e.length>1&&e.filter((t=>t.isContentEditable()?t!==s&&t!==n:t!==s&&(t!==n||this.isEndNodeFullyInTheRange(n,i,t)))).forEach((t=>{t.parent.apply(new ft(t))})),this.removeRangeStartAndEndSelectedText(),!s.isContentEditable()&&this.isStartNodeFullyInTheRange(s,n,o,i)){if(1===s.parent.children.length){const t=this.createEmptyParagraph();return s.parent.parent.apply(new dt(s.parent,t)),s.parent.apply(new ft(s)),t.children[0]}if(s===s.parent.children[0])return s.parent.apply(new ft(s)),s.parent.children[0]}return s}removeRangeStartAndEndSelectedText(){const t=this.selectionController.getSelectedNodes(),e=this.selectionController.getCurrentRange();t[0]instanceof P&&t[0].isContentEditable()&&t[0].apply(new Ie("",e));const i=t[t.length-1];t.length>1&&i instanceof P&&i.isContentEditable()&&t[t.length-1].apply(new Ie("",e))}createEmptyParagraph(){const t=new K(Rt(),"paragraph"),e=new P(`${t.id}1`,"",t);return t.apply(new lt([e])),t}mergeRangeStartAndEnd(t,e){if(t!==e&&t.nodeType===Node.TEXT_NODE&&e.nodeType===Node.TEXT_NODE){const t=this.selectionController.getSelectedNodes(),e=t[0],i=t[t.length-1];if(e&&e.parent&&i&&i.parent){const t=i.parent;this.shouldMergeTextNode(e,i)&&(e.apply(new ht(e.text+i.text)),e.parent===i.parent?e.parent.apply(new ft(i)):i.parent.apply(new ft(i.parent.children[0]))),e instanceof P&&i instanceof P&&e.parent!==i.parent&&(e.parent.apply(new lt(t.children)),t.children=[]),t.children.length<1&&t.parent.apply(new ft(t))}}}shouldMergeTextNode(t,e){const{annotations:i}=t.toJSON(),{annotations:o}=e.toJSON();return t instanceof P&&e instanceof P&&JSON.stringify(i)===JSON.stringify(o)}isEndNodeFullyInTheRange(t,e,i){return i instanceof $||i===t&&0!==e}isStartNodeFullyInTheRange(t,e,i,o){return t instanceof $||0===i&&(e!==t||0!==o)}}ii([r()],oi.prototype,"host",void 0),ii([r()],oi.prototype,"selectionController",void 0),ii([r()],oi.prototype,"value",void 0),ii([c("connectedCallback")],oi.prototype,"addDeleteObserver",null),ii([c("disconnectedCallback")],oi.prototype,"removeDeleteObserver",null);var si=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class ni extends zt{constructor(){super(...arguments),this.getEffectiveTargets=()=>[this.vegaRichTextEditorRenderer.getRTEEditableElementRef()],this.getIneffectiveTargets=()=>{const t=this.vegaRichTextEditorRenderer.getRTEEditableElementRef();let e=[];return t&&(e=Array.from(t.querySelectorAll(".code-block-container"))),e}}registerInitState(){this.value&&this.registerHistory(new Te(this.value,new Ht(this.selectionController.getCurrentRange())),!0)}async undo(){if(this.undoStack.length>1){const t=this.undoStack.pop().clone();this.redoStack.push(t);const e=this.undoStack[this.undoStack.length-1];e&&await this.restoreState(e)}}async redo(){if(this.redoStack.length>0){const t=this.redoStack.pop().clone();this.undoStack.push(t),await this.restoreState(t)}}async restoreState(t){const{content:e,selection:i}=t.clone();this.selectionController.setSelectionState(i),await this.valueController.flushChanges(e,!1)}}si([r()],ni.prototype,"host",void 0),si([r()],ni.prototype,"vegaRichTextEditorRenderer",void 0),si([r()],ni.prototype,"valueController",void 0),si([r()],ni.prototype,"value",void 0),si([r()],ni.prototype,"selectionController",void 0),si([c("componentDidLoad")],ni.prototype,"registerInitState",null);class ri extends st{constructor(t){super(),this.type=nt.TRANSFORM_TO_CODE_BLOCK,this.selectedBlocks=t}}var ci=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class li extends gt{constructor(){super({icon:"rectangle-code",tooltip:{text:"Code Block"}})}onClick(){if(!this.isSelected()){const t=this.selectionController.getSelectedBlocks(),e=t[0].parent,i=new ri(t);e.apply(i),this.valueController.flushChanges(this.value),this.selectionController.enqueueSelectionRangeFutureState(i.newCodeBlock.children[0],0)}}isSelected(){const t=this.selectionController.getSelectedBlocks();return!(!t.length||!t.every((t=>"code-block"===t.type)))}isDisabled(){const t=this.selectionController.getSelectedBlocks();return super.isDisabled()||t.some((t=>"image"===t.type||"list-item"===t.type))}}V.register({"rectangle-code":{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill=\'currentColor\' d="M320.1 175L384.1 239C394.3 248.4 394.3 263.6 384.1 272.1L320.1 336.1C311.6 346.3 296.4 346.3 287 336.1C277.7 327.6 277.7 312.4 287 303L334.1 256L287 208.1C277.7 199.6 277.7 184.4 287 175C296.4 165.7 311.6 165.7 320.1 175V175zM177.9 256L224.1 303C234.3 312.4 234.3 327.6 224.1 336.1C215.6 346.3 200.4 346.3 191 336.1L127 272.1C117.7 263.6 117.7 248.4 127 239L191 175C200.4 165.7 215.6 165.7 224.1 175C234.3 184.4 234.3 199.6 224.1 208.1L177.9 256zM448 32C483.3 32 512 60.65 512 96V416C512 451.3 483.3 480 448 480H64C28.65 480 0 451.3 0 416V96C0 60.65 28.65 32 64 32H448zM448 80H64C55.16 80 48 87.16 48 96V416C48 424.8 55.16 432 64 432H448C456.8 432 464 424.8 464 416V96C464 87.16 456.8 80 448 80z"/></svg>'}}),ci([r()],li.prototype,"selectionController",void 0),ci([r()],li.prototype,"valueController",void 0),ci([r()],li.prototype,"value",void 0);class ai extends Tt{constructor(){super(1),this.focusNodeOffset=0,this.doTask=async()=>{await this.focusTheCodeBlock(this.shouldFocusNode)}}enqueueSelectionRangeFutureState(t,e,i){this.shouldFocusNode=t,this.focusNodeOffset=e,super.enqueueTheTaskIntoQueue(i)}isCodeBlockSelected(t,e){const i=ct.getDOMByEntity(t.children[0]);return t.isSelected()||i&&e.intersectsNode(i.nextSibling)&&e.intersectsNode(i.previousSibling)}async focusTheCodeBlock(t){await Promise.resolve();const e=ct.getDOMByEntity(t);e&&e.doFocus()}}var hi=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class di extends Ct{constructor(){super({icon:"display-code",tooltip:{text:"Edit Source"},autoFocusOnClick:!1})}async onClick(){const t=this.sourceView;t?await this.saveSourceCode():this.selectionController.setSelectionRange(new Range),this.sourceView=!t}isSelected(){return this.sourceView}isDisabled(){return super.isDisabled()}async saveSourceCode(){const t=this.vegaRichTextEditorRenderer.getSourceCode();"string"==typeof t&&await this.valueController.flushChanges(E.fromHtml(t,{autoMatchFormat:this.sourceEditConfig.autoMatchFormat}))}}V.register({"display-code":{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M512 48c8.8 0 16 7.2 16 16V352c0 8.8-7.2 16-16 16H336.5c-.3 0-.6 0-.8 0H240.4c-.3 0-.6 0-.8 0H64c-8.8 0-16-7.2-16-16V64c0-8.8 7.2-16 16-16H512zM64 416H211.7l-8 48H152c-13.3 0-24 10.7-24 24s10.7 24 24 24h72H352h72c13.3 0 24-10.7 24-24s-10.7-24-24-24H372.3l-8-48H512c35.3 0 64-28.7 64-64V64c0-35.3-28.7-64-64-64H64C28.7 0 0 28.7 0 64V352c0 35.3 28.7 64 64 64zm188.3 48l8-48h55.3l8 48H252.3zM249 177c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-48 48c-9.4 9.4-9.4 24.6 0 33.9l48 48c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-31-31 31-31zM361 143c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l31 31-31 31c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l48-48c9.4-9.4 9.4-24.6 0-33.9l-48-48z"/></svg>'}}),hi([r({writable:!0})],di.prototype,"sourceView",void 0),hi([r()],di.prototype,"selectionController",void 0),hi([r()],di.prototype,"valueController",void 0),hi([r()],di.prototype,"vegaRichTextEditorRenderer",void 0),hi([r()],di.prototype,"sourceEditConfig",void 0);var ui=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class fi extends l{constructor(){super(...arguments),this.flushValue=(t,e=!1)=>{if(this.host&&t&&(this.valueController.flushChanges(t,!0),e)){const t=this.host.value.getLastNode();t&&this.selectionController.enqueueSelectionRangeFutureState(t,t.getRangeEndOffset())}},this.isSourceEditMode=()=>this.sourceView,this.getSelectedNodes=()=>this.selectionController.getSelectedNodes()}initialExtensionContext(){if(this.extensions&&this.host)for(const t of this.extensions)t.initialExtension({host:this.host,flushValue:this.flushValue,isSourceEditMode:this.isSourceEditMode,getSelectedNodes:this.getSelectedNodes})}handleExtensionsChange(t,e){Nt(t,e,!1,((t,e)=>t===e?0:1))||this.initialExtensionContext()}}ui([r()],fi.prototype,"extensions",void 0),ui([r()],fi.prototype,"host",void 0),ui([r()],fi.prototype,"sourceView",void 0),ui([r()],fi.prototype,"valueController",void 0),ui([r()],fi.prototype,"selectionController",void 0),ui([c("connectedCallback")],fi.prototype,"initialExtensionContext",null),ui([c("watchExtensions")],fi.prototype,"handleExtensionsChange",null);var pi=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};const vi=class{constructor(t){o(this,t),this.vegaChange=s(this,"vegaChange",7),this.change=s(this,"change",7),this.vegaImageInserted=s(this,"vegaImageInserted",7),this.imageInserted=s(this,"imageInserted",7),this.globalSlimmers={},this.translationSlimmer=new Vt,this.vegaComponentUsageRuntimeMetricsSlimmer=new h,this.formFieldController=new kt({propertyRules:[{propertyName:"required",ruleFactory:t=>t?new Dt:null}],validationRulesName:"validationRules",defaultValue:null,attributeGetter:t=>this[t],inputContainerGetter:()=>this.vegaRichTextEditorRenderer.getRichTextContainerRef(),touchableAreaGetter:()=>[this.vegaRichTextEditorRenderer.getRichTextContentRef()]}),this.changeEventEmitter=St(vi,g),this.vegaRichTextEditorRenderer=new Jt,this.valueController=new Ee,this.selectionController=new Lt,this.focusController=new Ze,this.darkModeStateControllerSlimmer=new At,this.toolbarRenderer=new Zt,this.clearStyleToolbarButtonSlimmer=new oe,this.boldToolbarButtonSlimmer=new Qt,this.italicToolbarButtonSlimmer=new Xt,this.underlineToolbarButtonSlimmer=new te,this.textColorToolbarButtonSlimmer=new yt,this.textStylesToolbarButtonSlimmer=new ie,this.codeToolbarButtonSlimmer=new se,this.strikethroughToolbarButtonSlimmer=new ne,this.imageToolbarButtonSlimmer=new de,this.linkToolbarButtonSlimmer=new re,this.moreIndentToolbarButtonSlimmer=new ce,this.lessIndentToolbarButtonSlimmer=new le,this.bulletsNumbersToolbarButtonSlimmer=new xe,this.horizontalAlignmentToolbarButtonSlimmer=new ze,this.codeBlockToolbarButtonSlimmer=new li,this.sourceEditToolbarButtonSlimmer=new di,this.placeholderNotifySlimmer=Ot(vi,"placeholder","watchPlaceholder"),this.disabledNotifySlimmer=Ot(vi,"richTextContentEditable","watchRichTextContentEditable"),this.richTextContentController=new Be(this),this.userInputController=new Ke,this.insertImageController=new Je,this.insertCompositionTextController=new ei,this.imageInsertedEventEmitter=St(vi,x),this.changeEventPreventSlimmer=new Ft([g],(()=>this.vegaRichTextEditorRenderer.getRichTextWrapperRef())),this.textNodeColorController=new Xe,this.deleteSelectedNodesController=new oi,this.historyController=new ni,this.internalCodeBlockSelectionController=new ai,this.rteExtensionController=new fi,this.richTextContentEditable=!0,this.selectionMap=new Map,this.isInDarkMode=Pt.isDarkMode(),this.sourceView=!1,this.label="",this.required=!1,this.placeholder="",this.disabled=!1,this.hint="",this.rows=4,this.value=E.createEmptyContent(),this.toolbarItems=bt,this.allowSourceEdit=!1,this.sourceEditConfig={autoMatchFormat:!0},this.isValid=null,this.autoValidation=!0,this.validationRules=[],this.extensions=[]}watchRichTextContentEditable(){}watchPlaceholder(){}watchDisabled(){this.richTextContentController.syncRichTextContentEditable()}watchValueUpdate(){}watchValidationRules(){}watchExtensions(){}componentWillLoad(){this.richTextContentController.syncRichTextContentEditable()}render(){return u(this.vegaRichTextEditorRenderer.render(),this.host)}get host(){return n(this)}static get watchers(){return{richTextContentEditable:["watchRichTextContentEditable"],placeholder:["watchPlaceholder"],disabled:["watchDisabled"],value:["watchValueUpdate"],validationRules:["watchValidationRules"],extensions:["watchExtensions"]}}};pi([d()],vi.prototype,"globalSlimmers",void 0),pi([a()],vi.prototype,"translationSlimmer",void 0),pi([a()],vi.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),pi([a()],vi.prototype,"formFieldController",void 0),pi([a()],vi.prototype,"changeEventEmitter",void 0),pi([a()],vi.prototype,"vegaRichTextEditorRenderer",void 0),pi([a()],vi.prototype,"valueController",void 0),pi([a()],vi.prototype,"selectionController",void 0),pi([a()],vi.prototype,"focusController",void 0),pi([a()],vi.prototype,"darkModeStateControllerSlimmer",void 0),pi([a()],vi.prototype,"toolbarRenderer",void 0),pi([a()],vi.prototype,"clearStyleToolbarButtonSlimmer",void 0),pi([a()],vi.prototype,"boldToolbarButtonSlimmer",void 0),pi([a()],vi.prototype,"italicToolbarButtonSlimmer",void 0),pi([a()],vi.prototype,"underlineToolbarButtonSlimmer",void 0),pi([a()],vi.prototype,"textColorToolbarButtonSlimmer",void 0),pi([a()],vi.prototype,"textStylesToolbarButtonSlimmer",void 0),pi([a()],vi.prototype,"codeToolbarButtonSlimmer",void 0),pi([a()],vi.prototype,"strikethroughToolbarButtonSlimmer",void 0),pi([a()],vi.prototype,"imageToolbarButtonSlimmer",void 0),pi([a()],vi.prototype,"linkToolbarButtonSlimmer",void 0),pi([a()],vi.prototype,"moreIndentToolbarButtonSlimmer",void 0),pi([a()],vi.prototype,"lessIndentToolbarButtonSlimmer",void 0),pi([a()],vi.prototype,"bulletsNumbersToolbarButtonSlimmer",void 0),pi([a()],vi.prototype,"horizontalAlignmentToolbarButtonSlimmer",void 0),pi([a()],vi.prototype,"codeBlockToolbarButtonSlimmer",void 0),pi([a()],vi.prototype,"sourceEditToolbarButtonSlimmer",void 0),pi([a()],vi.prototype,"placeholderNotifySlimmer",void 0),pi([a()],vi.prototype,"disabledNotifySlimmer",void 0),pi([a()],vi.prototype,"richTextContentController",void 0),pi([a()],vi.prototype,"userInputController",void 0),pi([a()],vi.prototype,"insertImageController",void 0),pi([a()],vi.prototype,"insertCompositionTextController",void 0),pi([a()],vi.prototype,"imageInsertedEventEmitter",void 0),pi([a()],vi.prototype,"changeEventPreventSlimmer",void 0),pi([a()],vi.prototype,"textNodeColorController",void 0),pi([a()],vi.prototype,"deleteSelectedNodesController",void 0),pi([a()],vi.prototype,"historyController",void 0),pi([a()],vi.prototype,"internalCodeBlockSelectionController",void 0),pi([a()],vi.prototype,"rteExtensionController",void 0),vi.style=':host{display:block}:host vega-field-label{margin-bottom:8px}:host vega-text{margin-bottom:16px;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))}@media screen and (min-width: 768px) and (max-width: 1023px){:host vega-text{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host vega-text{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host vega-text{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}:host .rich-text-editor-container{display:flex;box-sizing:content-box;position:relative;box-sizing:content-box;background-color:rgba(var(--v-bg-primary, 252, 252, 252, 1));border:1px solid rgba(var(--v-border-input-field, 171, 198, 216, 1));border-radius:8px;color:rgba(var(--v-text-primary, 32, 54, 69, 1));margin-top:12px;overflow:auto;resize:vertical;padding-top:12px;padding-right:16px;padding-bottom:32px;padding-left:16px}:host .rich-text-editor-container:hover{border:1px solid rgba(var(--v-border-input-field-hover, 115, 160, 190, 1))}:host .rich-text-editor-container:focus-within{border:1px solid rgba(var(--v-border-input-field-focus, 19, 98, 226, 1));outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:3px;border:1px solid rgba(var(--v-border-color-input-field-focus, 19, 98, 226, 1))}:host .rich-text-editor-container.disabled{background-color:rgba(var(--v-bg-secondary, 245, 247, 247, 1));border:1px solid rgba(var(--v-border-input-field-disabled, 222, 225, 227, 1));cursor:not-allowed}:host .rich-text-editor-container.disabled:hover,:host .rich-text-editor-container.disabled:focus-within{border:1px solid rgba(var(--v-border-input-field-disabled, 222, 225, 227, 1))}:host .rich-text-editor-container.disabled:focus-within{outline:none}:host .rich-text-editor-container.disabled vega-rich-text-content{pointer-events:none;opacity:0.35}:host .rich-text-editor-container.error{border:1px solid rgba(var(--v-border-input-field-danger, 230, 50, 87, 1))}:host .rich-text-editor-container.error:hover{border:1px solid rgba(var(--v-border-input-field-danger-hover, 255, 87, 114, 1))}:host .rich-text-editor-container.error:focus-within{outline:2px solid rgba(var(--v-border-color-danger, 230, 50, 87, 1));outline-offset:3px;border:1px solid rgba(var(--v-border-color-input-field-danger-focus, 233, 71, 104, 1))}:host .rich-text-editor-container .text-editor-counter{position:absolute;bottom:8px;right:8px;display:flex;padding-left:4px;padding-right:4px;padding-top:2px;padding-bottom:2px;border-radius:4px;font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px;color:rgba(var(--v-text-inverted-primary, 252, 252, 252, 1));background-color:rgba(var(--v-bg-textarea-count, 4, 4, 28, 0.6))}@media screen and (min-width: 768px) and (max-width: 1023px){:host .rich-text-editor-container .text-editor-counter{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .rich-text-editor-container .text-editor-counter{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .rich-text-editor-container .text-editor-counter{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}:host .rich-text-editor-container .text-editor-counter.counter-exceed-max-length{background-color:rgba(var(--v-bg-textarea-counter-exceed-max-length, 214, 46, 81))}.toolbar-btn-group{display:flex;justify-content:center;align-items:center}.toolbar-btn-group>*:not(:first-child):not(:last-child) ::part(rich-text-editor-toolbar-button){border-radius:0px}.toolbar-btn-group>*:first-child:not(:last-child) ::part(rich-text-editor-toolbar-button){border-top-left-radius:4px;border-bottom-left-radius:4px;border-top-right-radius:0px;border-bottom-right-radius:0px}.toolbar-btn-group>*:last-child:not(:first-child) ::part(rich-text-editor-toolbar-button){border-top-left-radius:0px;border-bottom-left-radius:0px;border-top-right-radius:4px;border-bottom-right-radius:4px}.toolbar-btn-group>*:not(:first-child) ::part(rich-text-editor-toolbar-button){margin-left:-1px}.toolbar-btn-group .toolbar-btn-color-preview-box{display:flex;border:1px solid rgba(var(--v-border-chip, 205, 209, 211, 1));box-sizing:border-box;border-radius:4px;width:16px;height:16px;justify-content:center;align-items:center;margin-left:6px}.toolbar-btn-group .toolbar-btn-color-preview-box.disabled{opacity:0.35}.toolbar-btn-group .toolbar-btn-link-wrapper{position:relative}.toolbar-btn-group .toolbar-btn-link-wrapper vega-rich-text-link-editor{position:absolute;bottom:0;left:0;right:0}.vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px;color:rgba(var(--v-text-error, 189, 41, 71, 1));display:block;margin-top:12px}@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 !important}.source-view-container{margin-top:12px}.source-view-container vega-code-block::part(editor-toolbar){display:none}';var mi=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class bi extends l{constructor(){super(...arguments),this.handleClick=t=>{this.disabled?t.preventDefault():this.clickEventEmitter.emit(void 0,t)}}render(){return t("button",{part:"rich-text-editor-toolbar-button",class:{"rich-text-editor-toolbar-btn":!0,"rich-text-editor-toolbar-button-disabled":this.disabled,"rich-text-editor-toolbar-button-hidden":this.hidden,"rich-text-editor-toolbar-button-selected":this.selected},onClick:this.handleClick,disabled:this.disabled,hidden:this.hidden},t("vega-flex",{gap:"size-8",justifyContent:"center",alignItems:"center"},this.icon&&t("vega-icon",{size:"size-16",color:this.iconColor,icon:V.getIconKey(this.icon)}),this.showArrowIcon&&t("vega-icon",{size:"size-8",color:"text-secondary",icon:V.getIconKey("chevron-down")})),t("slot",null))}}V.register({"chevron-down":Wt}),mi([r()],bi.prototype,"disabled",void 0),mi([r()],bi.prototype,"hidden",void 0),mi([r()],bi.prototype,"selected",void 0),mi([r()],bi.prototype,"showArrowIcon",void 0),mi([r()],bi.prototype,"icon",void 0),mi([r()],bi.prototype,"iconColor",void 0),mi([r()],bi.prototype,"clickEventEmitter",void 0);var gi=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};const xi=class{constructor(t){o(this,t),this.vegaClick=s(this,"vegaClick",7),this.click=s(this,"click",7),this.globalSlimmers={},this.vegaComponentUsageRuntimeMetricsSlimmer=new h,this.clickEventEmitter=St(xi,w),this.eventPrevent=new Ft([w],(()=>this.host),{useCapture:!0,customPreventHandle:t=>{this.disabled&&t.stopImmediatePropagation()}}),this.renderer=new bi,this.disabled=!1,this.hidden=!1,this.selected=!1,this.showArrowIcon=!1,this.icon="",this.iconColor="text-primary"}render(){return u(t(e,null,this.renderer.render()),this.host)}get host(){return n(this)}};gi([d()],xi.prototype,"globalSlimmers",void 0),gi([a()],xi.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),gi([a()],xi.prototype,"clickEventEmitter",void 0),gi([a()],xi.prototype,"eventPrevent",void 0),gi([a()],xi.prototype,"renderer",void 0),xi.style=":host{display:inline-block}.rich-text-editor-toolbar-btn{display:flex;justify-content:center;align-items:center;border-radius:4px;border:1px solid rgba(var(--v-border-input-field, 171, 198, 216, 1));padding-top:8px;padding-bottom:8px;padding-left:12px;padding-right:12px;cursor:pointer;position:relative;background-color:rgba(var(--v-bg-primary, 252, 252, 252, 1))}.rich-text-editor-toolbar-btn:hover{background-color:rgba(var(--v-bg-quaternary, 241, 248, 251, 1));border:1px solid rgba(var(--v-border-input-field-hover, 115, 160, 190, 1));z-index:1}.rich-text-editor-toolbar-btn:active{border:1px solid rgba(var(--v-border-input-field-focus, 19, 98, 226, 1));background-color:rgba(var(--v-bg-quaternary, 241, 248, 251, 1));z-index:1}.rich-text-editor-toolbar-btn:focus-visible{outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:-1px;z-index:2}.rich-text-editor-toolbar-btn.rich-text-editor-toolbar-button-selected{border:1px solid rgba(var(--v-border-input-field-focus, 19, 98, 226, 1));background-color:rgba(var(--v-bg-quaternary, 241, 248, 251, 1));z-index:1}.rich-text-editor-toolbar-btn.rich-text-editor-toolbar-button-disabled{background-color:rgba(var(--v-bg-secondary, 245, 247, 247, 1));border:1px solid rgba(var(--v-border-input-field-disabled, 222, 225, 227, 1));cursor:not-allowed}.rich-text-editor-toolbar-btn.rich-text-editor-toolbar-button-disabled vega-icon{color:rgba(var(--v-text-disabled, 176, 180, 181, 1))}.rich-text-editor-toolbar-btn.rich-text-editor-toolbar-button-hidden{display:none}";var wi=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class Ci extends l{constructor(){super(...arguments),this.handleKeyDown=t=>{"Enter"===t.key&&(this.formRef.getValue().then((({alt:t})=>{this.changeEventEmitter.emit({action:"edit",payload:{size:this.size,alt:t}})})),this.popoverRef.hide())}}render(){return t("vega-popover",{style:{width:"100%"},trigger:"click",alignment:"start",placement:"bottom",showArrow:!1,ref:t=>{this.popoverRef=t,m.addUniqueObserverToNode(t,C,(()=>{this.selected=!0,this.notifyImageSelected(),this.formRef.setValue({alt:this.alt})})),m.addUniqueObserverToNode(t,y,(()=>{this.currentPage=1,this.selected=!1,this.formRef.reset()}))}},t("div",{slot:"popover-content"},t("slot",null)),t("div",{slot:"popover"},this.renderImageEditor(),this.renderAltTextEditor()))}findParentContainerRef(){this.parentContainerRef=Ut(this.host,"vega-rich-text-content")}renderImageEditor(){return t("vega-box",{display:1===this.currentPage?"block":"none"},t("vega-flex",{gap:"size-12",alignItems:"center"},t("vega-font",{variant:"font-field-label-sm",color:"text-primary"},this.translationSlimmer.t("Size"),":"),t("vega-segment-control",{size:"small",segments:[{key:"sm",text:this.translationSlimmer.t("Sm")},{key:"md",text:this.translationSlimmer.t("Md")},{key:"lg",text:this.translationSlimmer.t("Lg")}],selected:this.size,ref:t=>{m.addUniqueObserverToNode(t,g,(t=>{if(!this.selected)return;const e=t.detail;this.size=e,this.changeEventEmitter.emit({action:"edit",payload:{size:e,alt:this.alt}})}))}}),t("vega-button-group",{variant:"tertiary",size:"small",ref:t=>{m.addUniqueObserverToNode(t,w,(t=>{"Alt Text"===t.detail?this.currentPage=2:(this.notifyImageDeleteButtonClicked(),this.changeEventEmitter.emit({action:"delete"}),this.popoverRef.hide())}))}},t("vega-button-group-item",{label:this.translationSlimmer.t("Alt Text"),itemKey:"Alt Text"}),t("vega-button-group-item",{label:this.translationSlimmer.t("Delete Image"),icon:V.getIconKey("trash-can"),iconOnly:!0,itemKey:"trash-can"}))))}renderAltTextEditor(){return t("vega-box",{display:2===this.currentPage?"block":"none"},t("vega-form",{ref:t=>this.formRef=t},t("vega-input",{"data-vega-form":"alt",style:{width:"315px"},label:this.translationSlimmer.t("Alt Text"),ref:t=>{t.doFocus()},onKeyDown:this.handleKeyDown})))}notifyImageSelected(){this.parentContainerRef&&p.notify(v.getSubject(this.parentContainerRef,S),{host:this.host})}notifyImageDeleteButtonClicked(){this.parentContainerRef&&p.notify(v.getSubject(this.parentContainerRef,O),{host:this.host})}}V.register({"trash-can":$t}),wi([r({writable:!0})],Ci.prototype,"currentPage",void 0),wi([r({writable:!0})],Ci.prototype,"selected",void 0),wi([r()],Ci.prototype,"host",void 0),wi([r()],Ci.prototype,"alt",void 0),wi([r({writable:!0})],Ci.prototype,"size",void 0),wi([r()],Ci.prototype,"changeEventEmitter",void 0),wi([r()],Ci.prototype,"translationSlimmer",void 0),wi([c("componentDidLoad")],Ci.prototype,"findParentContainerRef",null);var yi=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};const Ri=class{constructor(t){o(this,t),this.vegaChange=s(this,"vegaChange",7),this.change=s(this,"change",7),this.globalSlimmers={},this.translationSlimmer=new Vt,this.vegaComponentUsageRuntimeMetricsSlimmer=new h,this.renderer=new Ci,this.changeEventEmitter=St(Ri,g),this.currentPage=1,this.selected=!1,this.alt="",this.size="md"}render(){return u(t(e,{class:{"rte-image-selected":this.selected}},this.renderer.render()),this.host)}get host(){return n(this)}};yi([d()],Ri.prototype,"globalSlimmers",void 0),yi([a()],Ri.prototype,"translationSlimmer",void 0),yi([a()],Ri.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),yi([a()],Ri.prototype,"renderer",void 0),yi([a()],Ri.prototype,"changeEventEmitter",void 0),Ri.style=":host{display:inline-block}:host(.rte-image-selected){outline:2px solid rgba(var(--v-border-color-tile-selected, 19, 98, 226, 1));outline-offset:-2px}";var ji=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class ki extends l{constructor(){super(...arguments),this.handleKeyDown=t=>{"Enter"===t.key&&this.formRef.getValue().then((({text:t,url:e})=>{e.length>0&&(this.changeEventEmitter.emit({action:"link",payload:{text:t||e,url:e}}),this.popoverRef.hide())}))}}componentDidLoad(){this.updatePopoverTarget()}componentDidRender(){p.notify(v.getSubject(this.host,R),{})}watchStatusChange(){"linkEdit"===this.status&&setTimeout((()=>{this.urlInputRef.doFocus()}))}watchTargetChange(){this.updatePopoverTarget()}getPopoverRef(){return this.popoverRef}render(){return t("vega-popover",{trigger:"click",alignment:"start",placement:"bottom",showArrow:!1,ref:t=>{this.popoverRef=t,m.addUniqueObserverToNode(t,C,(()=>{var t,e;"linkEdit"===this.status&&this.urlInputRef.doFocus(),this.formRef.setValue({text:null===(t=this.record)||void 0===t?void 0:t.text,url:null===(e=this.record)||void 0===e?void 0:e.url})})),m.addUniqueObserverToNode(t,y,(()=>{this.formRef.reset(),this.resetStatusAfterHide&&(this.status="editOrUnlinkSelection")}))}},t("span",{slot:"popover-content"},t("slot",null)),t("div",{slot:"popover"},this.renderLinkUnlinkContent(),this.renderLinkEditContent()))}renderLinkUnlinkContent(){return t("vega-box",{display:"editOrUnlinkSelection"===this.status?"block":"none"},t("vega-button-group",{size:"small",variant:"tertiary",ref:t=>{m.addUniqueObserverToNode(t,w,(({detail:t})=>{switch(t){case"edit":return void(this.status="linkEdit");case"unlink":this.changeEventEmitter.emit({action:"unlink"}),this.popoverRef.hide()}}))}},t("vega-button-group-item",{label:this.translationSlimmer.t("Edit"),itemKey:"edit"}),t("vega-button-group-item",{label:this.translationSlimmer.t("Unlink"),itemKey:"unlink"})))}renderLinkEditContent(){return t("vega-box",{display:"linkEdit"===this.status?"block":"none"},t("vega-form",{ref:t=>this.formRef=t},t("vega-flex",{style:{width:"419px"},direction:"col",gap:"size-16"},t("vega-input",{"data-vega-form":"url",ref:t=>{this.urlInputRef=t},size:"small",label:this.translationSlimmer.t("URL"),onKeyDown:this.handleKeyDown}),t("vega-input",{size:"small",label:this.translationSlimmer.t("Text"),"data-vega-form":"text",onKeyDown:this.handleKeyDown}))))}updatePopoverTarget(){_t.call(v.getSubject(this.popoverRef,H),this.target)}}ji([r()],ki.prototype,"host",void 0),ji([r({writable:!0})],ki.prototype,"status",void 0),ji([r({writable:!0})],ki.prototype,"record",void 0),ji([r()],ki.prototype,"changeEventEmitter",void 0),ji([r()],ki.prototype,"resetStatusAfterHide",void 0),ji([r()],ki.prototype,"translationSlimmer",void 0),ji([r()],ki.prototype,"target",void 0),ji([c("componentDidLoad")],ki.prototype,"componentDidLoad",null),ji([c("componentDidRender")],ki.prototype,"componentDidRender",null),ji([c("watchStatusChange")],ki.prototype,"watchStatusChange",null),ji([c("watchTargetChange")],ki.prototype,"watchTargetChange",null);var Si=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};const Oi=class{constructor(t){o(this,t),this.vegaChange=s(this,"vegaChange",7),this.change=s(this,"change",7),this.globalSlimmers={},this.translationSlimmer=new Vt,this.vegaComponentUsageRuntimeMetricsSlimmer=new h,this.renderer=new ki,this.changeEventEmitter=St(Oi,g),this.status="editOrUnlinkSelection",this.resetStatusAfterHide=!0}watchStatusChange(){}watchTargetChange(){}async show(){await this.renderer.getPopoverRef().show()}render(){return u(t(e,null,this.renderer.render()),this.host)}get host(){return n(this)}static get watchers(){return{status:["watchStatusChange"],target:["watchTargetChange"]}}};Si([d()],Oi.prototype,"globalSlimmers",void 0),Si([a()],Oi.prototype,"translationSlimmer",void 0),Si([a()],Oi.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),Si([a()],Oi.prototype,"renderer",void 0),Si([a()],Oi.prototype,"changeEventEmitter",void 0),Oi.style=":host{display:contents}:host vega-popover{display:inline}";export{vi as vega_rich_text_editor,xi as vega_rich_text_editor_toolbar_button,Ri as vega_rich_text_image_editor,Oi as vega_rich_text_link_editor}
|
package/dist/vega/p-258f9603.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{C as t}from"./p-2d0d575f.js";import{d as e}from"./p-2ee4def0.js";import{b as n,c as s}from"./p-0e954b9b.js";import{c as r}from"./p-02841589.js";import{L as i}from"./p-6e1ab235.js";import{i as o}from"./p-b1faebe0.js";import{g as a}from"./p-a4670e23.js";import{V as c}from"./p-02a4732a.js";import{c as l}from"./p-bf19682d.js";import{f as h}from"./p-575235c8.js";var u,d;!function(t){t.SELECTION_RANGE="SELECTION_RANGE",t.CLEAR_FORMATTING="CLEAR_FORMATTING",t.LINK_GROUP="LINK_GROUP"}(u||(u={}));class p{}!function(t){t.ALIGNMENT="ALIGNMENT",t.TEXT_STYLE="TEXT_STYLE",t.INDENT="INDENT",t.LIST="LIST",t.INTERNAL_WRAPPER="INTERNAL_WRAPPER"}(d||(d={}));class f extends p{}const T=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 n=this.rootDomToContentEntity.get(t);n&&n!==e&&this.contentEntityToRootDom.delete(n),this.rootDomToContentEntity.set(t,e),this.contentEntityToRootDom.set(e,t)}isVegaRTEContent(t){return t&&"VegaRTEContent"===t.constructor.name}};var E,x,g,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"}(E||(E={}));class w{constructor(){this.isFlushable=!1}}class A extends p{constructor(t){super(),this.type=u.LINK_GROUP,this.linkGroups=new Map,this.linkGroups=new Map([[t,[]]])}clone(){const t=new A("");return this.linkGroups.forEach(((e,n)=>{t.linkGroups.set(n,e.map((t=>t.clone())))})),t}toString(t,e){const n=this.toJsx(t,e);return Object.entries(n).map((([t,e])=>{const n="string"==typeof e?e:this.formatStyleToString(e);return`${r(t)}="${n}"`})).join(" ")}toJsx(t,e){const n=this.getStyle(t,e),s=this.getClass(t,e),r=this.getAttribute(t,e);return s.length>0&&(r.class=s.join(" ")),n&&Object.keys(n).length>0&&(r.style=n),r}getClass(t,e){const n=[];return t.link.customClass&&n.push(...t.link.customClass),!(null==e?void 0:e.standalone)&&t.useInternalStyle&&n.push("v-rte--link"),n}getStyle(t,e){const n={};return t.link.customStyle&&Object.assign(n,t.link.customStyle),(null==e?void 0:e.standalone)&&t.useInternalStyle&&(n.color="rgba(var(--v-text-link, 19, 98, 226, 1))"),n}getAttribute(t,e){var n;const{href:s,customAttribute:r={}}=t.link,i=null===(n=null==e?void 0:e.autoMatchFormat)||void 0===n||n,o=r.target||(i?"_blank":"");return Object.assign(Object.assign(Object.assign({},r),s||i?{href:s}:{}),o?{target:o}:{})}formatStyleToString(t){return Object.entries(t).map((([t,e])=>`${r(t)}: ${e};`)).join(" ")}}class N extends f{constructor(t){super(),this.type=d.ALIGNMENT,this.textAlign=t}static from(t){return[d.ALIGNMENT,new N(t)]}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 N(this.textAlign)}renderStyle(t){if(!(null==t?void 0:t.standalone))return null;switch(this.textAlign){case"right":case"center":case"justify":return{textAlign:this.textAlign};case"left":default:return{textAlign:"left"}}}}class y extends f{constructor(t){super(),this.type=d.INDENT,this.indent=Math.max(0,t)}static from(t){return[d.INDENT,new y(t)]}toJSON(){return this.indent>0?{indent:this.indent}:null}clone(){return new y(this.indent)}renderClass(){return null}renderStyle(){return this.indent>0?{marginLeft:16*this.indent+"px"}:null}}class R{static register(t,e,n){this.registry.has(e)||this.registry.set(e,new Map),this.registry.get(e).set(t,n)}static get(t,e){const n=this.registry.get(e);if(n)return n.get(t)}static executeTheStrategy(t,e){const n=t instanceof w?t.type:t.constructor.name,s=R.get(n,e.constructor.name);if(s)return s.execute(t,e);i.error(`Type ${n} action handle strategy is not registered in class ${e.constructor.name}`)}static canHandle(t,e){return!!R.get(t,e.constructor.name)}}R.registry=new Map,function(t){t.CUSTOM_ATTRIBUTE="CUSTOM_ATTRIBUTE",t.CUSTOM_CLASS="CUSTOM_CLASS",t.CUSTOM_STYLE="CUSTOM_STYLE"}(x||(x={}));class O extends p{}class S extends O{constructor(t){super(),this.type=x.CUSTOM_ATTRIBUTE,this.BOOLEAN_ATTRS=new Set(["controls","disabled","checked","readonly","multiple","required","autoplay","muted"]),this.customAttribute=t}static from(t){return[x.CUSTOM_ATTRIBUTE,new S(t)]}toJSON(){return{customAttribute:this.customAttribute}}clone(){return new S(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(o)}render(t={}){var e;const n=Object.assign({},this.customAttribute);return null===(e=t.filterAttributes)||void 0===e||e.forEach((t=>delete n[t])),Object.keys(n).forEach((t=>{this.BOOLEAN_ATTRS.has(t)&&""===n[t]&&(n[t]="true")})),n}}class C extends O{constructor(t){super(),this.type=x.CUSTOM_CLASS,this.customClass=t}static from(t){return[x.CUSTOM_CLASS,new C(t)]}toJSON(){return{customClass:this.customClass}}clone(){return new C(this.customClass)}toString(){return`class="${this.customClass.join(" ")}"`}renderClass(){return this.customClass}}class B extends O{constructor(t){super(),this.type=x.CUSTOM_STYLE,this.customStyle=t}static from(t){return[x.CUSTOM_STYLE,new B(t)]}toJSON(){return{customStyle:this.customStyle}}clone(){return new B(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 k extends f{constructor(t){super(),this.type=d.INTERNAL_WRAPPER,this.internalWrapper=t}static from(t){return[d.INTERNAL_WRAPPER,new k(t)]}clone(){return new k(this.internalWrapper)}renderClass(){}renderStyle(){}toJSON(){return this.internalWrapper?{internalWrapper:this.internalWrapper}:void 0}}class RTEBlock{constructor(t){this.annotationMap=new Map,this.id=t}static from(t,e){throw new Error(`[Vega] ${this.constructor.name}.from(${JSON.stringify(t)}, ${e}) is not implemented. Please implement this method in the subclass.`)}static createAnnotationEntity(t,e){switch(t){case"textAlign":return N.from(e);case"indent":return y.from(e);case"customAttribute":return S.from(e);case"customClass":return C.from(e);case"customStyle":return B.from(e);case"internalWrapper":return k.from(e)}}static convertAnnotationsToMap(t,e){Object.entries(e).forEach((([e,n])=>{const s=this.createAnnotationEntity(e,n);o(s)&&t.set(...s)}))}shouldRenderAsInternalWrapper(){const t=this.getAnnotationByType(d.INTERNAL_WRAPPER);return!!t&&t.internalWrapper&&0===Array.from(this.annotationMap.values()).filter((t=>!(t instanceof A||t instanceof k))).length}toJSON(){const t=Array.from(this.annotationMap.values()).filter((t=>t instanceof f||t instanceof O)).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(s){if(this.doApply(s),s.isFlushable){const s=T.getDOMByEntity(this);if(s){const r=e.getSubjectFromParentNodeByEventId(s,n);r&&t.notify(r,{})}}}isListItemBlock(){return"list-item"===this.type}getStyles(t={standalone:!1}){return Object.assign(Object.assign({},Array.from(this.annotationMap.values()).filter((t=>t instanceof f||t instanceof B)).map((e=>e.renderStyle(t))).filter(o).reduce(((t,e)=>Object.assign(Object.assign({},t),e)),{})),this.shouldRenderAsInternalWrapper()?{display:"contents"}:{})}getClasses(t={standalone:!1}){return Array.from(this.annotationMap.values()).filter((t=>t instanceof f||t instanceof C)).map((e=>e.renderClass(t))).filter(o).reduce(((t,e)=>[t,e].join(" ").trim()),"")}getCustomAttributesAnnotation(){return this.annotationMap.get(x.CUSTOM_ATTRIBUTE)}generateAttributeString(...t){var e;const n=Object.entries(Object.assign({},this.getStyles({standalone:!0}))).map((([t,e])=>`${r(t)}: ${e};`)).join(""),s=this.annotationMap.get(x.CUSTOM_CLASS),i=[...(null===(e=this.getCustomAttributesAnnotation())||void 0===e?void 0:e.toString(t))||[],null==s?void 0:s.toString(),n?`style="${n}"`:null,...t].filter(o);return i.length?` ${i.join(" ")}`:""}doApply(t){t instanceof w?R.executeTheStrategy(t,this):this.applyAnnotationAction(t)}applyAnnotationAction(t){const e=t.toAnnotation();e instanceof A||this.annotationMap.set(e.type,e),"function"==typeof this.doAnnotationActionApply&&this.doAnnotationActionApply(t)}cloneAnnotations(){return new Map(Array.from(this.annotationMap.entries()).map((([t,e])=>[t,e.clone()])))}}!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"}(g||(g={}));class v extends p{}!function(t){t.TEXT="TEXT",t.IMAGE="IMAGE",t.CODE_BLOCK_NODE="CODE_BLOCK_NODE"}(m||(m={}));class RTENode{constructor(t,e){this.annotationMap=new Map,this.id=t,e&&(this.annotationMap=e)}static from(t,e,n){throw new Error(`[Vega] ${this.constructor.name}.from(${JSON.stringify(t)}, ${e}, ${n}) is not implemented. Please implement this method in the subclass.`)}static createAnnotationEntity(t,e){switch(t){case"customAttribute":return S.from(e);case"customClass":return C.from(e);case"customStyle":return B.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}){const e=Array.from(this.annotationMap.values()).filter((t=>t instanceof v||t instanceof B)).map((e=>e.renderStyle(t))).filter(Boolean);return this.mergeAnnotationStyles(e,["textDecoration"])}getClasses(t={standalone:!1}){return Array.from(this.annotationMap.values()).filter((t=>t instanceof v||t instanceof C)).map((e=>e.renderClass(t))).filter(o).reduce(((t,e)=>[t,e].join(" ").trim()),"")}getCustomAttributesAnnotation(){return this.annotationMap.get(x.CUSTOM_ATTRIBUTE)}isTextNode(){return!1}getElementRef(){return T.getDOMByEntity(this)}generateAttributeString(...t){var e;const n=Object.entries(Object.assign({},this.getStyles({standalone:!0}))).map((([t,e])=>`${r(t)}: ${e};`)).join(""),s=this.annotationMap.get(x.CUSTOM_CLASS),i=[...(null===(e=this.getCustomAttributesAnnotation())||void 0===e?void 0:e.toString(t))||[],null==s?void 0:s.toString(),n?`style="${n}"`:null,...t].filter(o);return i.length?` ${i.join(" ")}`:""}doApply(t){t instanceof w?this.doModifyActionApply(t):this.doAnnotationActionApply(t)}flushChange(){const s=T.getDOMByEntity(this);if(s){const r=e.getSubjectFromParentNodeByEventId(s,n);r&&t.notify(r,{})}}cloneAnnotations(){return new Map(Array.from(this.annotationMap.entries()).map((([t,e])=>[t,e.clone()])))}doAnnotationActionApply(t){}doModifyActionApply(t){}mergeAnnotationStyles(t,e){const n={};for(const s of t)for(const t in s){const r=s[t],i=n[t];n[t]="string"==typeof i&&"string"==typeof r&&e.includes(t)?Array.from(new Set(`${i} ${r}`.split(/\s+/).filter(Boolean))).join(" "):r}return n}}class b{}class _ extends b{constructor(){super(...arguments),this.doSplit=!0}}class L extends p{constructor(t){super(),this.type=u.SELECTION_RANGE,this.range=t}clone(){return new L(this.range)}}class I extends v{constructor(t){super(),this.type=g.STRIKETHROUGH,this.strikethrough=t}static from(t){return[g.STRIKETHROUGH,new I(t)]}toJSON(){return{strikethrough:this.strikethrough}}clone(){return new I(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 D extends v{constructor(t){super(),this.type=g.UNDERLINE,this.underline=t}static from(t){return[g.UNDERLINE,new D(t)]}toJSON(){return{underline:this.underline}}clone(){return new D(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 $ extends v{constructor(t){super(),this.type=g.ITALIC,this.italic=t}static from(t){return[g.ITALIC,new $(t)]}toJSON(){return{italic:this.italic}}clone(){return new $(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 M extends v{constructor(t){super(),this.type=g.BOLD,this.bold=t}static from(t){return[g.BOLD,new M(t)]}toJSON(){return{bold:this.bold}}clone(){return new M(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 j extends v{constructor(t,e=!0){super(),this.type=g.CODE,this.code=t,this.useInternalStyle=e}static from(t,e){return[g.CODE,new j(t,e)]}toJSON(){return{code:this.code}}clone(){return new j(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?{fontFamily:"Roboto Mono",whiteSpace:"pre-wrap"}:null}}const P={key:"black",light:"#111128",dark:"#E3E3E8"},F=[P,{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"}],H="",W=[["textStyles"],["bold","italic","underline","strikethrough","code"],["textColor"],["horizontalAlignment","bulletsNumbers"],["moreIndent","lessIndent"],["link"],["image"],["clearStyle"]];class K extends v{constructor(t){super(),this.type=g.TEXT_COLOR,this.textColor=this.formatTextColor(t)}static from(t){return[g.TEXT_COLOR,new K(t)]}toJSON(){return{textColor:this.textColor.key}}clone(){return new K(this.textColor.key)}renderClass(){return null}renderStyle(){return{color:c.isDarkMode()?this.textColor.dark:this.textColor.light}}formatTextColor(t){return F.find((e=>e.key===t))||F[0]}}class J extends v{constructor(t,e=!0){super(),this.type=g.LINK,this.link=t,this.useInternalStyle=e}static from(t,e=!0){return[g.LINK,new J(t,e)]}toJSON(){return{link:this.link}}clone(){return new J(this.link)}toEqual(t){return this.link.groupKey===t.link.groupKey}renderClass(){return null}renderStyle(){return null}}class U extends b{constructor(t,e,n){super(),this.isFlushable=!1,this.groupKey=t,this.nodes=e,this.type=n}toAnnotation(){return new A(this.groupKey)}}class G extends b{constructor(){super(),this.isFlushable=!1}toAnnotation(){return null}}const z=new class{constructor(){this.RTE_BLOCK_DTO_CLASS_MAP=new Map,this.RTE_NODE_DTO_CLASS_MAP=new Map}registerRTEDTOClass(t,e){if(e.prototype instanceof RTEBlock)this.RTE_BLOCK_DTO_CLASS_MAP.set(t,e);else{if(!(e.prototype instanceof RTENode))throw new Error(`Invalid RTE DTO class type: ${t}`);this.RTE_NODE_DTO_CLASS_MAP.set(t,e)}}getRTEBlockClass(t){return this.RTE_BLOCK_DTO_CLASS_MAP.get(t)}getRTENodeClass(t){return this.RTE_NODE_DTO_CLASS_MAP.get(t)}};class X{execute(t,e){return i.log(`Executing action ${t.constructor.name} on ${e.constructor.name} ${e.id}`),this.handleAction(t,e)}updateCustomStyleAnnotation(t,e){const n=t.annotationMap.get(x.CUSTOM_STYLE);n&&this.isCustomStyle(n,e)&&t.annotationMap.set(n.type,new B(n.removeStyles(e)))}createNewParagraph(t){const e=z.getRTEBlockClass("paragraph");if(e)return e.from({id:a(),type:"paragraph",nodes:[{id:a(),type:"text",text:t}]})}getRootContent(t){const e=t.parent;if(e)return"VegaRTEContent"===e.constructor.name?e:this.getRootContent(e)}isCaretPositionAtBlockStart(t,e,n){return e===t.children[0]&&0===n}isCaretPositionAtBlockEnd(t,e,n){return e.isContentEditable()?this.isCaretPositionAtTextBlockEnd(t,e,n):this.isCaretPositionAtDecoratorBlockEnd(t,e,n)}isCaretPositionAtTextBlockEnd(t,e,n){const s=t.children[t.children.length-1];return e===s&&(e.isEmpty()||n===s.text.length)}isCaretPositionAtDecoratorBlockEnd(t,e,n){return e===t.children[t.children.length-1]&&0!==n}isCustomStyle(t,e){return e.some((e=>Object.keys(t.customStyle).includes(e)))}}class V extends w{constructor(t){super(),this.type=E.LINK_GROUP_NODE_SPLIT,this.splittedTextNodes=t}}class q extends X{constructor(){super(...arguments),this.applyTargetNode=null}handleAction(t,e){const n=e.getAnnotationByType(u.SELECTION_RANGE);if(this.setApplyTargetNode(null),t instanceof _&&t.doSplit&&n){const{startContainer:t,endContainer:s,startOffset:r,endOffset:i}=n.range,o=t===s&&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(n.range)&&e.isContentEditable()){const s=this.splitTextNode(n.range,e);return t.annotationMap.has("LINK")&&t.apply(new V(s)),s}return this.setApplyTargetNode(e),e}return t}))}return this.applyTargetNode}insertNewNode(t,e){const n=e.cloneWithText("");this.setApplyTargetNode(n);const s=e.parent.children.findIndex((t=>t===e));return 0===t||!e.isContentEditable()&&t===s?[n,e]:t===e.text.length||!e.isContentEditable()&&t===s+1?[e,n]:[e.cloneWithText(e.text.substring(0,t)),n,e.cloneWithText(e.text.substring(t))]}shouldSplitSelection(t){const{startContainer:e,endContainer:n,startOffset:s,endOffset:r}=t;return e!==n||s>0||r<(n.textContent?n.textContent.length:0)}splitTextNode(t,e){const{startContainer:n,endContainer:s,startOffset:r}=t,i=n.parentElement,o=s.parentElement,a=(t,n,s)=>{const r=t.substring(0,n),i=t.substring(n,s),o=t.substring(s);return[e.cloneWithText(r),e.cloneWithText(i),e.cloneWithText(o)]},c=i&&T.getEntityByDOM(i),l=o&&T.getEntityByDOM(o);if(c&&c.id===e.id){const i=n===s?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[n,s,r]=a(e.text,0,t.endOffset);return this.setApplyTargetNode(s),[n,s,r].filter((t=>!!t.text))}return this.setApplyTargetNode(e),e}setApplyTargetNode(t){this.applyTargetNode=t}}class Y extends _{constructor(t){super(),this.isFlushable=!0,this.bold=t}toAnnotation(){return new M(this.bold)}}class Q extends p{constructor(){super(...arguments),this.type=u.CLEAR_FORMATTING,this.items=[g.BOLD,g.ITALIC,g.UNDERLINE,g.STRIKETHROUGH,g.TEXT_COLOR,g.CODE,x.CUSTOM_STYLE]}}class Z extends _{constructor(){super(...arguments),this.isFlushable=!0}toAnnotation(){return new Q}}class tt extends _{constructor(t){super(),this.isFlushable=!0,this.code=t}toAnnotation(){return new j(this.code)}}class et extends b{constructor(t){super(),this.isFlushable=!0,this.annotationType=t}toAnnotation(){}}class nt extends _{constructor(t){super(),this.isFlushable=!0,this.italic=t}toAnnotation(){return new $(this.italic)}}class st extends _{constructor({link:t,newText:e,needMergeNode:n,doSplit:s,type:r}){super(),this.isFlushable=!0,this.link=t,this.needMergeNode=n,this.newText=e,this.type=r,o(s)&&(this.doSplit=s)}toAnnotation(){return new J(this.link)}}class rt extends _{constructor(t){super(),this.isFlushable=!0,this.strikethrough=t}toAnnotation(){return new I(this.strikethrough)}}class it extends _{constructor(t){super(),this.isFlushable=!0,this.underline=t}toAnnotation(){return new D(this.underline)}}class ot extends X{handleAction(t,e){const n=t.toAnnotation();if(t instanceof et)e.annotationMap.delete(t.annotationType);else{if(!(n instanceof Q))return n instanceof v||n instanceof L?(t instanceof st&&(o(t.newText)&&(e.text=t.newText),e.parent.apply(new U(t.link.groupKey,[e],t.type))),t instanceof tt&&this.handleAction(new Z,e),t instanceof Y&&this.updateCustomStyleAnnotation(e,["fontWeight"]),t instanceof nt&&this.updateCustomStyleAnnotation(e,["fontStyle"]),(t instanceof it||t instanceof rt)&&this.updateCustomStyleAnnotation(e,["textDecoration"]),void e.annotationMap.set(n.type,n)):void 0;n.items.forEach((t=>{e.deleteAnnotationByType(t)}))}}}class at extends w{constructor(){super(...arguments),this.type=E.DELETE_LINK_GROUP}}class ct extends X{handleAction(t,e){e.text=t.newTextContent,!e.text&&e.annotationMap.has("LINK")&&e.apply(new at)}}class lt extends w{constructor(t){super(),this.type=E.UPDATE_TEXT,this.newTextContent="",this.newTextContent=t}}class ht extends X{handleAction(t,e){this.replaceSelectedText(t.textToBeInsert,t.currentRange,e)}replaceSelectedText(t,e,n){if(e&&e.startContainer&&e.endContainer){const{startContainer:s,endContainer:r,startOffset:i,endOffset:o}=e;let a=n.text;if(s===r&&i===o&&t)a=n.text.slice(0,i)+t+n.text.slice(i);else{const e=s.parentElement,c=r.parentElement,l=e&&T.getEntityByDOM(e),h=c&&T.getEntityByDOM(c);let u=0,d=n.text.length;l&&l===n?(u=i,d=s===r?o:d):h&&h===n&&(d=o),a=n.text.slice(0,u)+t+n.text.slice(d)}n.apply(new lt(a))}}}class ut extends p{constructor(t){super(),this.type=g.INLINE_HTML,this.htmlTag=t}static from(t){const{htmlTag:e,child:n,customStyle:s,customClass:r,customAttribute:i}=t,o=new ut(e);return o.child=n?ut.from(n)[1]:void 0,o.customAttribute=i?S.from(i)[1]:void 0,o.customClass=r?C.from(r)[1]:void 0,o.customStyle=s?B.from(s)[1]:void 0,[g.INLINE_HTML,o]}clone(){var t,e,n,s;const r=new ut(this.htmlTag);return 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===(n=this.customClass)||void 0===n?void 0:n.clone(),r.customStyle=null===(s=this.customStyle)||void 0===s?void 0:s.clone(),r}toJSON(){var t,e,n,s;return{inlineHtml:l({htmlTag:this.htmlTag,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===(n=this.customClass)||void 0===n?void 0:n.toJSON().customClass,customStyle:null===(s=this.customStyle)||void 0===s?void 0:s.toJSON().customStyle})}}}class dt extends X{handleAction(t,e){const n=e.parent.getAnnotationByType(u.LINK_GROUP);if(n){const s=e.annotationMap.get("LINK").link.groupKey,r=n.linkGroups.get(s);if(r){const i=r.indexOf(e);-1!==i&&(r.splice(i,1,...Array.isArray(t.splittedTextNodes)?t.splittedTextNodes:[t.splittedTextNodes]),n.linkGroups.set(s,r))}}}}class pt extends X{handleAction(t,e){const n=e.parent.getAnnotationByType(u.LINK_GROUP);if(n){const t=e.annotationMap.get(g.LINK).link.groupKey,s=n.linkGroups.get(t);if(s){const r=s.indexOf(e);-1!==r&&s.splice(r,1),0===s.length&&n.linkGroups.delete(t),0===n.linkGroups.size&&e.parent.annotationMap.delete(u.LINK_GROUP)}}e.annotationMap.delete(g.LINK)}}class ft extends v{constructor(t){super(),this.type=g.PLAIN_TEXT,this.plainText=!0,this.plainText=t}static from(t){return[g.PLAIN_TEXT,new ft(t)]}clone(){return new ft(this.plainText)}renderClass(){}renderStyle(){}toJSON(){return{plainText:this.plainText}}}class RTETextNode extends RTENode{constructor(t,e,n,s){super(t,s),this.type=m.TEXT,this.parent=n,this.text=e,this.registerModifyStrategy()}static supportsHtmlTag(t){return["span","code"].includes(t)}static from(t,e,n={autoMatchFormat:!0}){const s=new RTETextNode(t.id,t.text,e),{annotations:r}=t;return r&&(s.annotationMap=this.generateTextAnnotationMap(r,n,e,s)),s}static generateTextAnnotationMap(t,e,n,s){return new Map(Object.keys(t).map((r=>("link"===r&&t.link&&n&&s&&n.apply(new U(t.link.groupKey,[s],"link")),this.createAnnotationEntity(r,t[r],e)))).filter(o))}static createAnnotationEntity(t,e,n){const s=!(!n||!n.autoMatchFormat);switch(t){case"bold":return M.from(e);case"italic":return $.from(e);case"underline":return D.from(e);case"strikethrough":return I.from(e);case"code":return j.from(e,s);case"textColor":return K.from(e);case"link":return J.from(e,s);case"inlineHtml":return ut.from(e);case"plainText":return ft.from(e)}return RTENode.createAnnotationEntity(t,e)}toJSON(){const t=Array.from(this.annotationMap.values()).filter((t=>t instanceof v||t instanceof O||t instanceof ut)).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(){const t=this.getAnnotationByType(g.INLINE_HTML);return t?this.renderWithWrapperStr(t):this.renderTextStr()}cloneWithText(t){return new RTETextNode(a(),t,this.parent,super.cloneAnnotations())}clone(){return new RTETextNode(this.id,this.text,this.parent,super.cloneAnnotations())}isEmpty(){return!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}registerModifyStrategy(){const t=this.constructor.name;RTETextNode.registerActionStrategyStatus[t]||(this.isContentEditable()&&(R.register(E.UPDATE_TEXT,t,new ct),R.register(E.REPLACE_SELECTED_TEXT,t,new ht),R.register(E.LINK_GROUP_NODE_SPLIT,t,new dt),R.register(st.name,t,new ot)),R.register(_.name,t,new q),R.register(E.DELETE_LINK_GROUP,t,new pt),R.register(b.name,t,new ot),RTETextNode.registerActionStrategyStatus[t]=!0)}doAnnotationActionApply(t){const e=this.getAnnotationByType(u.SELECTION_RANGE);if(t instanceof _&&t.doSplit&&e){const e=R.get(_.name,this.constructor.name);if(e){const n=e.execute(t,this);n&&this.applyActionToNode(n,t)}}else this.applyActionToNode(this,t);"function"==typeof this.parent.mergeNodes&&this.parent.mergeNodes(t)}doModifyActionApply(t){R.executeTheStrategy(t,this)}applyActionToNode(t,e){const n=e.toAnnotation();if(e instanceof G)return void this.syncUpSelectedNodes(t);n instanceof L||this.syncUpSelectedNodes(t);const s=R.get(e.constructor.name,t.constructor.name);if(s)return void s.execute(e,t);const r=R.get(b.name,RTETextNode.name);r&&r.execute(e,t)}syncUpSelectedNodes(n){const r=this.getElementRef();if(r){const i=e.getSubjectFromParentNodeByEventId(r,s);i&&t.notify(i,{node:n})}}renderWithWrapperStr(t){const{htmlTag:e,customAttribute:n,customClass:s,customStyle:r,child:i}=t,a=[...(null==n?void 0:n.toString())||[],null==s?void 0:s.toString(),null==r?void 0:r.toString()].filter(o),c=a.length>0?` ${a.join(" ")}`:"";return i?`<${e}${c}>${this.renderWithWrapperStr(i)}</${e}>`:`<${e}${c}>${this.renderTextStr()}</${e}>`}renderTextStr(){var t;const e=(null===(t=this.getAnnotationByType(g.CODE))||void 0===t?void 0:t.code)?"code":"span",n=super.generateAttributeString();return"\n"===this.text?"<br>":this.shouldRenderAsPlainText()?this.text:`<${e}${n}>${this.text}</${e}>`}shouldRenderAsPlainText(){const t=super.getAnnotationByType(g.PLAIN_TEXT);return!!t&&t.plainText&&0===Array.from(this.annotationMap.values()).filter((t=>t instanceof v&&!(t instanceof J)&&!(t instanceof ft)||t instanceof O)).length}}RTETextNode.registerActionStrategyStatus={},RTETextNode.htmlTag="span";class Tt extends w{constructor(t){super(),this.type=E.APPEND_CHILDREN,this.entityToBeAppended=t}}class Et extends f{constructor(t){super(),this.type=d.TEXT_STYLE,this.textStyle=t}static from(t){return[d.TEXT_STYLE,new Et(t)]}toJSON(){return{textStyle:this.textStyle}}clone(){return new Et(this.textStyle)}renderClass(t){return(null==t?void 0:t.standalone)?null:this.textStyle?`v-rte--text-style-${this.textStyle}`:null}renderStyle(t){if(!(null==t?void 0:t.standalone))return null;const e={fontFamily:"Inter",fontSize:"16px",lineHeight:"22px",fontWeight:"500",marginTop:"0px",marginBottom:"0px"};switch(this.textStyle){case"paragraph":return e;case"title":return{fontFamily:"Inter",fontSize:"36px",lineHeight:"40px",fontWeight:"500"};case"subtitle":return{fontFamily:"Inter",fontSize:"28px",lineHeight:"32px",fontWeight:"500"};case"heading-1":return{fontFamily:"Inter",fontSize:"22px",lineHeight:"24px",fontWeight:"500",marginTop:"0px",marginBottom:"0px"};case"heading-2":return{fontFamily:"Inter",fontSize:"20px",lineHeight:"24px",fontWeight:"500",marginTop:"0px",marginBottom:"0px"};case"heading-3":return{fontFamily:"Inter",fontSize:"18px",lineHeight:"22px",fontWeight:"500",marginTop:"0px",marginBottom:"0px"};case"heading-4":return{fontFamily:"Inter",fontSize:"16px",lineHeight:"22px",fontWeight:"500",marginTop:"0px",marginBottom:"0px"};case"heading-5":return{fontFamily:"Inter",fontSize:"14px",lineHeight:"22px",fontWeight:"500",marginTop:"0px",marginBottom:"0px"};case"heading-6":return{fontFamily:"Inter",fontSize:"12px",lineHeight:"22px",fontWeight:"500",marginTop:"0px",marginBottom:"0px"}}}}class xt extends b{constructor(t,e){super(),this.isFlushable=!0,this.textStyle=t,this.bold=e}toAnnotation(){return new Et(this.textStyle)}}class gt extends w{constructor(t,...e){super(),this.type=E.INSERT_CHILDREN_AFTER,this.referChildren=t,this.childrenToBeInserted=e}}class mt extends w{constructor(t){super(),this.type=E.REPLACE_CHILD_NODES,this.newChildNodes=t}}class wt extends X{handleAction(t,e){t.newBlock=this.splitTextNodeBlock(t.splitPointNode,t.startOffsetOfNode,e)}splitTextNodeBlock(t,e,n){if(t){const s=t.text.slice(0,e),r=t.text.slice(e),i=n.children.indexOf(t);if(i>-1){const e=n.children.slice(0,i),o=n.children.slice(i+1);s&&e.push(t.cloneWithText(s)),r&&o.unshift(t.cloneWithText(r)),n.apply(new mt(e));const a=n.cloneWithNodes(o);return n.parent.apply(new gt(n,a)),a}}}}class At extends X{handleAction(t,e){e.children=[],e.apply(new Tt(t.newChildNodes))}}class Nt extends w{constructor(t){super(),this.type=E.DELETE_CHILDREN,this.entityToBeRemoved=t}}class yt extends X{handleAction(t,e){const n=t.blockNeedToBeMerged;if(e.type===n.type||"image"!==e.type&&"image"!==n.type){let t=n.children;"image"!==n.type&&(t=n.children.filter((t=>t.text))),e.apply(new Tt(t)),n.parent.apply(new Nt(n))}}}class Rt extends X{handleAction(t,e){t.lineBreakNode=this.lineBreakSingleBlock(t.startContainerNode,t.startOffset,e)}lineBreakSingleBlock(t,e,n){if(t){const s=new RTETextNode(a(),"\n",n),r=t.text.slice(0,e),i=t.text.slice(e),o=n.children.indexOf(t);if(o>-1){const e=n.children.slice(0,o),a=n.children.slice(o+1);r&&e.push(t.cloneWithText(r)),i&&a.unshift(t.cloneWithText(i)),this.mergeLineBreakNodes(e,s,a,n)}return s}}mergeLineBreakNodes(t,e,n,s){(0===n.length||n[0]&&""===n[0].text)&&n.push(new RTETextNode(a(),"\n",s,t[t.length-1]&&t[t.length-1].annotationMap)),s.apply(new mt([...t,e,...n]))}}class Ot extends X{handleAction(t,e){t.lineBreakNode=this.lineBreakMultipleBlocks(t.selectedBlocks,e)}lineBreakMultipleBlocks(t,e){const n=e.children,s=new RTETextNode(a(),"\n",e),r=this.concatBlocksNodes(t.slice(1));return this.mergeLineBreakNodes(n,s,r,e),s}concatBlocksNodes(t){const e=[];return t.map((t=>{"image"!==t.type&&(e.push(...t.children),t.parent.apply(new Nt(t)))})),e}mergeLineBreakNodes(t,e,n,s){(0===n.length||n[0]&&""===n[0].text)&&n.push(new RTETextNode(a(),"\n",s,t[t.length-1]&&t[t.length-1].annotationMap)),s.apply(new mt([...t,e,...n]))}}class St extends w{constructor(t,...e){super(),this.type=E.INSERT_CHILDREN_BEFORE,this.referChildren=t,this.childrenToBeInserted=e}}class Ct extends w{constructor(t,e){super(),this.type=E.SPLIT_BLOCK_WITH_NODE,this.splitPointNode=t,this.startOffsetOfNode=e}}class Bt extends b{constructor(t){super(),this.isFlushable=!0,this.textAlign=t}toAnnotation(){return new N(this.textAlign)}}class kt extends X{handleAction(t,e){this.updateCustomStyleAnnotation(e,["textAlign"])}}class vt extends b{constructor(t){super(),this.isFlushable=!0,this.indent=t}toAnnotation(){return new y(this.indent)}}class RTETextBlock extends RTEBlock{constructor(t,e,n){super(t),this.children=[],this.type=e;const{autoMatchFormat:s}=n||{autoMatchFormat:!0};s&&(this.annotationMap=RTETextBlock.isAcceptableTextStyle(e)?new Map([Et.from(e)]):new Map([Et.from("paragraph")]))}static from(t,e={autoMatchFormat:!0}){var n,s;const r=new RTETextBlock(t.id,t.type,e),i=e.autoMatchFormat?Object.assign(Object.assign({},t.annotations),{textStyle:null!==(s=null===(n=t.annotations)||void 0===n?void 0:n.textStyle)&&void 0!==s?s:r.type}):t.annotations;return r.children=t.nodes.map((t=>{const n=z.getRTENodeClass(t.type);if(n)return n.from(t,r,e)})).filter(o),i&&super.convertAnnotationsToMap(r.annotationMap,i),r}static createAnnotationEntity(t,e){return"textStyle"===t?Et.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,n)=>{const s=e.at(-1);if(t instanceof st&&t.needMergeNode){const t=null==s?void 0:s.getAnnotationByType(g.LINK),r=n.getAnnotationByType(g.LINK);if(t&&r&&t.toEqual(r))return e}return[...e,n]}),[])}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{type:this.type,nodes:this.children.map((t=>t.toJSON()))})}toHtml(t){const e=this.getBlockTag(),n=super.generateAttributeString(),s=this.getAnnotationByType(u.LINK_GROUP);let r=this.children.map((t=>t.toHtml())).join("");return s&&this.children.length>0&&(r=this.generateLinkHtml(s,r,t)),super.shouldRenderAsInternalWrapper()?r:[`<${e}${n}>`,r,`</${e}>`].join("")}cloneWithNodes(t){const e=new RTETextBlock(a(),this.type);return e.annotationMap=super.cloneAnnotations(),e.apply(new Tt(t)),e}clone(){const t=new RTETextBlock(this.id,this.type);return t.children=this.children.map((e=>{const n=e.clone();return n.parent=t,n})),t.annotationMap=super.cloneAnnotations(),t.parent=this.parent,t}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"}}doAnnotationActionApply(t){const e=R.get(t.constructor.name,RTETextBlock.name);e&&e.execute(t,this)}generateLinkHtml(t,e,n){e="";let s=[];for(let r=0;r<this.children.length;r++){const i=this.children[r].getAnnotationByType(g.LINK),o=this.children[r+1]?this.children[r+1].getAnnotationByType(g.LINK):null;if(i){if(s.push(this.children[r]),!o||i.link.groupKey!==o.link.groupKey){const r=t.toString(i,{standalone:!0,autoMatchFormat:null==n?void 0:n.autoMatchFormat});e+=[`<a${r?` ${r}`:""}>`,s.map((t=>t.toHtml())).join(""),"</a>"].join(""),s=[]}}else e+=this.children[r].toHtml()}return e}}R.register(xt.name,RTETextBlock.name,new class extends X{handleAction(t,e){"list-item"!==e.type&&(e.type=t.textStyle),e.children.forEach(t.bold?t=>{const e=new Y(!0);e.doSplit=!1,t.apply(e)}:t=>{t.apply(new et(g.BOLD))}),this.updateCustomStyleAnnotation(e,["fontFamily","lineHeight","fontWeight","fontSize"])}}),R.register(Bt.name,RTETextBlock.name,new kt),R.register(vt.name,RTETextBlock.name,new class extends X{handleAction(t,e){this.updateCustomStyleAnnotation(e,["marginLeft"])}}),R.register(U.name,RTETextBlock.name,new class extends X{handleAction(t,e){let n=e.getAnnotationByType(u.LINK_GROUP);if("update_link"===t.type){if(n){const e=n.linkGroups.get(t.groupKey);e&&n.linkGroups.set(t.groupKey,[e[0]])}}else{if(n){const e=n.linkGroups.get(t.groupKey)||[];n.linkGroups.set(t.groupKey,[...e,...t.nodes])}else n=t.toAnnotation(),n.linkGroups.set(t.groupKey,[...t.nodes]);e.annotationMap.set(u.LINK_GROUP,n)}}}),R.register(E.UNLINK_LINK_GROUP,RTETextBlock.name,new class extends X{handleAction(t,e){const n=e.getAnnotationByType(u.LINK_GROUP);n&&(n.linkGroups.size>1?n.linkGroups.delete(t.groupKey):e.annotationMap.delete(u.LINK_GROUP))}}),R.register(E.SPLIT_BLOCK_WITH_NODE,RTETextBlock.name,new wt),R.register(E.REPLACE_CHILD_NODES,RTETextBlock.name,new At),R.register(E.MERGE_TWO_BLOCKS_NODES,RTETextBlock.name,new yt),R.register(E.LINE_BREAK_SINGLE_BLOCK,RTETextBlock.name,new Rt),R.register(E.LINE_BREAK_MULTIPLE_BLOCKS,RTETextBlock.name,new Ot),R.register(E.INSERT_IMAGE_TO_BLOCK,RTETextBlock.name,new class extends X{handleAction(t,e){const n=t.splitPointNode,s=t.startOffsetOfNode,r=t.imageBlockToBeInserted;if(this.isCaretPositionAtBlockEnd(e,n,s))e.parent.apply(new gt(e,r));else if(this.isCaretPositionAtBlockStart(e,n,s))e.parent.apply(new St(e,r));else{const t=new Ct(n,s);e.apply(t),e.parent.apply(new gt(e,r))}}}),R.register(E.TRANSFORM_LIST_BLOCK,RTETextBlock.name,new class extends X{handleAction(t,e){const n=e.parent,s=n.createList(t.listType),r=t.selectedBlocks,i=r.map((t=>n.toListItem(t)));s.apply(new Tt(i)),n.apply(new gt(t.selectedBlocks[0],s)),r.forEach((t=>{t.parent.apply(new Nt(t))}))}});class bt extends X{getPreviousNode(t){const e=t.parent,n=e.children.indexOf(t);if(n>0)return e.children[n-1];if(e.parent){const t=this.getPreviousBlock(e);if(t)return this.getBlockLastNode(t)}}getNextNode(t){const e=t.parent,n=e.children.indexOf(t);if(e.children[n+1])return e.children[n+1];if(e.parent){const t=this.getNextBlock(e);if(t)return this.getBlockFirstNode(t)}}isContentFirstNode(t){const e=t.parent,n=e.children.indexOf(t),s=e.parent;if(e.isListItemBlock()){const t=s.parent;return 0===n&&Array.isArray(s.children)&&s.children[0]===e&&"list-item"!==t.type&&Array.isArray(t.children)&&t.children[0]===s}return 0===n&&Array.isArray(s.children)&&s.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(("number-list"===t.parent.type||"bullet-list"===t.parent.type)&&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)}}}class _t extends w{constructor(t,e){super(),this.isFlushable=!0,this.type=E.UPDATE_CODE_BLOCK,this.content=t,this.language=e}}class Lt extends b{constructor(t){super(),this.isFlushable=!1,this.range=t}toAnnotation(){return new L(this.range)}}class RTEDecoratorNode extends RTENode{constructor(){super(...arguments),this.type="decorator-node",this.isSelected=!1}static isDecoratorNodeContainerElement(t){return t&&t.classList.contains(RTEDecoratorNode.DECORATOR_CONTAINER_CLASS)}static getDecoratorNodeElement(t){return t.querySelector(`.${RTEDecoratorNode.DECORATOR_NODE_CLASS}`)}getRangeEndOffset(){return 1}getRangeContainer(){const t=this.getElementRef();if(t)return h(t,`.${RTEDecoratorNode.DECORATOR_CONTAINER_CLASS}`)}isContentEditable(){return!1}}RTEDecoratorNode.DECORATOR_CONTAINER_CLASS="v-internal-decorator-container",RTEDecoratorNode.DECORATOR_NODE_CLASS="v-internal-decorator-node";class RTECodeBlockNode extends RTEDecoratorNode{constructor(t,e,n,s){super(t),this.type=m.CODE_BLOCK_NODE,this.text="",this.annotationMap=new Map,this.text=e,this.parent=s,this.language=n}toJSON(){return{id:this.id,type:"text",text:this.text,language:this.language}}toHtml(){return`<code style='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;'>${this.text}</code>`}clone(){return new RTECodeBlockNode(this.id,this.text,this.language,this.parent)}doAnnotationActionApply(t){R.executeTheStrategy(t,this)}doModifyActionApply(t){R.executeTheStrategy(t,this)}}R.register(E.UPDATE_CODE_BLOCK,RTECodeBlockNode.name,new class extends X{handleAction(t,e){const{content:n,language:s}=t;e.language=s,e.text=n}}),R.register(Lt.name,RTECodeBlockNode.name,new class extends X{handleAction(t,e){e.annotationMap.set(u.SELECTION_RANGE,t.toAnnotation())}});var It;!function(t){t.CSS="css",t.HTML="html",t.JavaScript="js",t.JSX="jsx",t["Plain Text"]="plainText",t.TypeScript="ts",t.TSX="tsx"}(It||(It={}));class Dt extends X{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 Nt(e)))}}class RTECodeBlock extends RTEBlock{constructor(t,e,n){super(t),this.type="code-block",this.children=[new RTECodeBlockNode(`${t}-1`,e,n,this)]}static from(t){return new RTECodeBlock(t.id,t.content,t.language)}toJSON(){const{language:t,text:e}=this.children[0];return{id:this.id,type:"code-block",content:e,language:t}}toHtml(){const{language:t=It["Plain Text"]}=this.children[0];return`<pre data-language="${t}" style="background-color: rgba(var(--v-bg-secondary, 245, 247, 247, 1)); padding: 12px">${this.children.map((t=>t.toHtml()))}</pre>`}clone(){const t=RTECodeBlock.from(this.toJSON());return t.parent=this.parent,t}apply(s){if(s instanceof w&&R.executeTheStrategy(s,this),s.isFlushable){const s=T.getDOMByEntity(this);if(s){const r=e.getSubjectFromParentNodeByEventId(s,n);r&&t.notify(r,{})}}}isNotEmpty(){return!!this.children.length}getLastNode(){return this.children[0]}isSelected(){return this.children[0].annotationMap.has(u.SELECTION_RANGE)}}R.register(E.DELETE_CODE_BLOCK,RTECodeBlock.name,new class extends bt{handleAction(t,e){const n=e.children[0],s=e.parent;if(s){let t=this.getPreviousNode(n),r=this.getRTENodeEndOffset(t);t||(t=this.getNextNode(n),r=0),s.apply(new Nt(e));const i=t?T.getDOMByEntity(t):null;if(0===s.children.length){const n=RTETextBlock.from({id:a(),type:"paragraph",nodes:[{id:a(),type:"text",text:""}]});e.parent.apply(new Tt([n])),t=n.children[0],r=0}this.notifyUpdateSelection(t,i,r,e)}}notifyUpdateSelection(n,r,i,o){const a=T.getDOMByEntity(o);if(a){const o=e.getSubjectFromParentNodeByEventId(a,s);o&&t.notify(o,{node:n,updateDirectly:!!r,offset:i})}}getRTENodeEndOffset(t){return t?t.getRangeEndOffset():0}}),R.register(E.DELETE_CHILDREN,RTECodeBlock.name,new Dt),R.register(E.SWITCH_OUT_FROM_CODE_BLOCK,RTECodeBlock.name,new class extends X{handleAction(n,r){const{content:i,language:o}=n,c=i.split("\n"),l=new _t(c.slice(0,c.length-2).join("\n"),o);l.isFlushable=!1,r.children[0].apply(l);const h=RTETextBlock.from({id:a(),type:"paragraph",nodes:[{id:a(),text:"",type:"text"}]});r.parent.apply(new gt(r,h));const u=T.getDOMByEntity(r);if(u){const n=e.getSubjectFromParentNodeByEventId(u,s);n&&t.notify(n,{node:h.children[0]})}}}),R.register(E.INSERT_IMAGE_TO_BLOCK,RTECodeBlock.name,new class extends X{handleAction(t,e){e.parent.apply(new gt(e,t.imageBlockToBeInserted))}}),RTECodeBlock.CODE_BLOCK_PLACEHOLDER_CLASS_NAME="code-block-placeholder-element";export{nt as $,R as A,Rt as B,B as C,Ct as D,kt as E,bt as F,Dt as G,Bt as H,gt as I,RTENode as J,It as K,st as L,w as M,v as N,u as O,x as P,_t as Q,z as R,G as S,Lt as T,lt as U,W as V,_ as W,K as X,RTECodeBlockNode as Y,H as Z,Y as _,RTETextNode as a,it as a0,xt as a1,Et as a2,M as a3,Z as a4,tt as a5,rt as a6,vt as a7,E as b,X as c,RTETextBlock as d,Tt as e,Ot as f,wt as g,At as h,yt as i,Nt as j,St as k,f as l,d as m,RTEBlock as n,C as o,S as p,RTECodeBlock as q,F as r,T as s,P as t,g as u,RTEDecoratorNode as v,m as w,O as x,b as y,mt as z}
|
package/dist/vega/p-2b90fae6.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{V as r}from"./p-e5cd6521.js";import{I as e}from"./p-abd7aeaa.js";class i extends e{evaluate(r){var e,i;if(!this.isAcceptedInputType(r))throw new Error(`Invalid value ${r} for rich text editor`);const t=(null===(e=null==r?void 0:r.children)||void 0===e?void 0:e.length)>1||1===(null===(i=null==r?void 0:r.children)||void 0===i?void 0:i.length)&&r.children.some((r=>r.isNotEmpty()));return{isValid:t,message:t?"":"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(e){return null==e||e instanceof r}}export{i as R}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as i,h as s,H as e,g as a}from"./p-48a58baf.js";import{F as o}from"./p-c7726252.js";import{C as r}from"./p-2d0d575f.js";import{O as n}from"./p-331a62d5.js";import{f as h,g as l,b as d,d as c,c as m,e as p,F as f,a as u}from"./p-8a877e12.js";import{d as v}from"./p-d27ae9ff.js";import{s as b}from"./p-519a7d55.js";import{f as j,d as g,b as V}from"./p-575235c8.js";import{I as w}from"./p-b28d4f7d.js";import{c as F,M as y,V as S,I as R}from"./p-6e1ab235.js";import{V as E,I as O}from"./p-d849e0f5.js";import{c as C}from"./p-3cdbee7e.js";import{C as M}from"./p-1da54ff3.js";import{y as B,z as I,A as P,d as A}from"./p-2ee4def0.js";import{C as N}from"./p-d4564bfd.js";import{e as D}from"./p-0e954b9b.js";import{c as H}from"./p-bb61f015.js";import{S as x}from"./p-bdd9ef3b.js";import"./p-02841589.js";import"./p-a4670e23.js";import"./p-6a334573.js";import"./p-bf0ced3c.js";import"./p-7d9cd9c8.js";import"./p-74168615.js";import"./p-ed45b3b6.js";import"./p-b75ee3ba.js";import"./p-abd7aeaa.js";import"./p-78a57a17.js";import"./p-52b8f2d2.js";import"./p-262ec334.js";import"./p-f1436035.js";import"./p-5f377954.js";import"./p-e77a83e4.js";import"./p-db8cdba6.js";import"./p-112455b1.js";var k=function(t,i,s,e){var a,o=arguments.length,r=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,s):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,i,s,e);else for(var n=t.length-1;n>=0;n--)(a=t[n])&&(r=(o<3?a(r):o>3?a(i,s,r):a(i,s))||r);return o>3&&r&&Object.defineProperty(i,s,r),r};class T extends x{constructor(){super({parent:"vega-form",subStates:[{subStateName:"disableBlurValidation",parentStateName:"disableBlurValidation"}]})}}k([F()],T.prototype,"host",void 0),k([F({writable:!0})],T.prototype,"disableBlurValidation",void 0);var z=function(t,i,s,e){var a,o=arguments.length,r=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,s):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,i,s,e);else for(var n=t.length-1;n>=0;n--)(a=t[n])&&(r=(o<3?a(r):o>3?a(i,s,r):a(i,s))||r);return o>3&&r&&Object.defineProperty(i,s,r),r};class G extends S{setValidationStates(t){0!==t.length?t.forEach((t=>{const i=this.getHostByFieldName(t.fieldName);i&&this.updateFieldValidationState(i,{isValid:t.isValid,errorMessage:t.isValid?"":t.errorMessage})})):Array.from(this.host.querySelectorAll("[data-vega-form]")).filter((t=>o.isValidFormField(t))).forEach((t=>{this.updateFieldValidationState(t,{isValid:!0})}))}getHostByFieldName(t){const i=t.split(".");let s=this.host;for(const t of i){const i=s.querySelector(`[data-vega-form="${t}"]`);if(!o.isValidFormField(i))return null;s=i}return s}updateFieldValidationState(t,{isValid:i,errorMessage:s}){t.isValid=i,r.notify(h,{host:t,message:i?"":s,isValid:i}),r.notify(l,{host:t,detail:i})}}z([F()],G.prototype,"host",void 0),z([y("setValidationStates")],G.prototype,"setValidationStates",null);var L=function(t,i,s,e){var a,o=arguments.length,r=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,s):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,i,s,e);else for(var n=t.length-1;n>=0;n--)(a=t[n])&&(r=(o<3?a(r):o>3?a(i,s,r):a(i,s))||r);return o>3&&r&&Object.defineProperty(i,s,r),r};const U=class{constructor(s){t(this,s),this.vegaValidate=i(this,"vegaValidate",7),this.validate=i(this,"validate",7),this.vegaFormSubmit=i(this,"vegaFormSubmit",7),this.formSubmit=i(this,"formSubmit",7),this.vegaFormReset=i(this,"vegaFormReset",7),this.formReset=i(this,"formReset",7),this.globalSlimmers={},this.submitEventEmitter=C(U,B),this.resetEventEmitter=C(U,I),this.validateEventEmitter=C(U,P),this.disableBlurValidationNotifySlimmer=H(U,"disableBlurValidation","watchDisableBlurValidation"),this.stateController=new T,this.childEventPrevent=new M([B,I],(()=>this.host.querySelector("vega-form")),{customPreventHandle:t=>{t.stopPropagation()}}),this.childFormValidateEventPrevent=new M([P],(()=>this.host),{customPreventHandle:t=>{t.stopPropagation()}}),this.childNotifyObserver=new N(l,(t=>this.updateInternalValidStatus(t))),this.childNodeValueChangeObserver=new N(d,(()=>this.updateInternalTouchedStatus())),this.vegaComponentUsageRuntimeMetricsSlimmer=new E,this.vegaFormFieldValidationStateController=new G,this.invalidFieldPathMap=new w(new Map,(t=>{this.invalidFieldPathMap=t,this.updateIsValidFlag()})),this.pendingValidFieldPathMap=new w(new Map,(t=>{this.pendingValidFieldPathMap=t,this.updateIsValidFlag()})),this.controlledFieldPathSet=new Set,this.isValid=null,this.isTouched=!1,this.disableBlurValidation=!1,this.updateInternalValidStatus=t=>{if(t.host!==this.host){const i=t.host,s=t.detail;o.isValidFormField(i)&&this.shouldVisitElement(i,!1,!1)&&(s?this.invalidFieldPathMap.delete(i):this.invalidFieldPathMap.set(i,i.dataset.vegaForm))}}}watchIsValid(){this.validateEventEmitter.emit(this.isValid),r.notify(l,{host:this.host,detail:this.isValid})}watchDisableBlurValidation(){}async disconnectedCallback(){r.notify(c,{host:this.host}),r.unregister(c,this.formFieldDisconnectedObserver),r.unregister(m,this.formFieldPendingValidObserver)}async componentDidLoad(){await this.navigateVegaFormChildren((async(t,i)=>{i||this.controlledFieldPathSet.add(this.getFormFieldName(t,!0))})),this.initFormFieldDisconnectedObserver(),this.registerFormSubmitChangeManager(),this.registerFormResetChangeManager(),this.registerFormFieldPendingValidChangeManager()}async valid(t=!0){const i={isValid:!0,invalidFields:[]};return await this.navigateVegaFormChildren((async(s,e)=>{if("function"==typeof s.valid&&e){const e=await s.valid(t);e.isValid||(i.isValid=!1,i.invalidFields.push(...e.invalidFields),i.invalidFieldsErrorMessages=Object.assign(Object.assign({},i.invalidFieldsErrorMessages),e.invalidFieldsErrorMessages))}else{const{isValid:e,message:a}=await this.handleChildFormFieldElementValid(s,t);e||(i.isValid=!1,i.invalidFields.push(this.getFormFieldName(s)),i.invalidFieldsErrorMessages||(i.invalidFieldsErrorMessages={}),i.invalidFieldsErrorMessages[this.getFormFieldName(s)]=a)}})),i}async getValue(t){const i={};return await this.navigateVegaFormChildren((async(s,e)=>{const a=this.getFormFieldName(s);i[a]=e?await s.getValue(t):U.getFormFieldValue(s)}),t),v(i)?Object.values(i):i}async setValue(t,i){t&&(await this.navigateVegaFormChildren((async(s,e)=>{const a=this.getFormFieldName(s);e?await s.setValue(t[a],i):(await s.componentOnReady(),void 0!==t[a]&&("function"==typeof s.setValue?await s.setValue(t[a]):s.value=t[a]))}),i),this.isTouched=!1)}async reset(t={},i){await this.navigateVegaFormChildren((async(s,e)=>{const a=this.getFormFieldName(s);e&&await s.reset(t[a]||{},i)}),i),r.notify(p,{host:this.host,defaultValueMap:t,option:i}),this.isTouched=!1}async setValidationStates(t){}static getFormFieldValue(t){return void 0===t.value?t.getAttribute("value"):t.value}render(){return b(s(e,null,s("slot",null)),this.host)}updateInternalTouchedStatus(){this.isTouched=!0}async navigateVegaFormChildren(t,i,s=this.host){const e=[];Array.from(s.children).forEach((s=>{o.isValidFormField(s)?this.shouldVisitElement(s,null==i?void 0:i.skipDisabled,null==i?void 0:i.skipInvisible)&&e.push(t(s,"VEGA-FORM"===s.tagName)):e.push(this.navigateVegaFormChildren(t,i,s))})),await Promise.all(e)}updateIsValidFlag(){this.isValid=this.pendingValidFieldPathMap.size>0?null:0===this.invalidFieldPathMap.size}getFormFieldName(t,i){let s=t.dataset.vegaForm;if(i){let i=j(t,"vega-form");for(;i&&i!==this.host;)s=i.dataset.vegaForm+" -> "+s,i=j(i,"vega-form")}return s}shouldVisitElement(t,i,s){return this.getFormFieldName(t)&&(!i||!t.disabled)&&(!s||g(t))}initFormFieldDisconnectedObserver(){this.formFieldDisconnectedObserver=new n(this.canAcceptFormFieldDisconnectedOperation.bind(this),this.updateInvalidFieldPath.bind(this)),r.register(c,this.formFieldDisconnectedObserver)}canAcceptFormFieldDisconnectedOperation(t){return this.invalidFieldPathMap.has(t.host)}async updateInvalidFieldPath(t){this.invalidFieldPathMap.delete(t.host),this.pendingValidFieldPathMap.delete(t.host)}registerFormSubmitChangeManager(){this.formEventsObserver=new n(this.canAcceptFormSubmitEvent.bind(this),this.handleSubmitEvents.bind(this)),r.register(f,this.formEventsObserver)}canAcceptFormSubmitEvent(t){return this.isElementInCurrentForm(t.host)}async handleSubmitEvents(){if((await this.valid()).isValid){const t=await this.getValue();this.submitEventEmitter.emit(t)}}registerFormResetChangeManager(){this.formEventsObserver=new n(this.canAcceptFormResetEvent.bind(this),this.handleResetEvents.bind(this)),r.register(u,this.formEventsObserver)}canAcceptFormResetEvent(t){return this.isElementInCurrentForm(t.host)}async handleResetEvents(){await this.reset(),this.resetEventEmitter.emit()}registerFormFieldPendingValidChangeManager(){this.formFieldPendingValidObserver=new n(this.canAcceptFormFieldPendingValid.bind(this),this.handleFieldPendingValid.bind(this)),r.register(m,this.formFieldPendingValidObserver)}canAcceptFormFieldPendingValid(t){return this.isElementInCurrentForm(t.host)}handleFieldPendingValid(t){"boolean"==typeof t.detail?this.pendingValidFieldPathMap.delete(t.host):this.pendingValidFieldPathMap.set(t.host,t.host.dataset.vegaForm)}isElementInCurrentForm(t){return this.invalidFieldPathMap.has(t)||V(t,this.host)}async handleChildFormFieldElementValid(t,i){const s=A.getSubject(t,D),{isValid:e,message:a}=await new Promise((e=>{const a=setTimeout((()=>{e({isValid:!0,message:""})}),2e3);r.notify(s,{host:t,message:i,promiseResolve:e,timerId:a})}));return{isValid:e,message:a}}get host(){return a(this)}static get watchers(){return{isValid:["watchIsValid"],disableBlurValidation:["watchDisableBlurValidation"]}}};L([O()],U.prototype,"globalSlimmers",void 0),L([R()],U.prototype,"submitEventEmitter",void 0),L([R()],U.prototype,"resetEventEmitter",void 0),L([R()],U.prototype,"validateEventEmitter",void 0),L([R()],U.prototype,"disableBlurValidationNotifySlimmer",void 0),L([R()],U.prototype,"stateController",void 0),L([R()],U.prototype,"childEventPrevent",void 0),L([R()],U.prototype,"childFormValidateEventPrevent",void 0),L([R()],U.prototype,"childNotifyObserver",void 0),L([R()],U.prototype,"childNodeValueChangeObserver",void 0),L([R()],U.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),L([R()],U.prototype,"vegaFormFieldValidationStateController",void 0),U.style=":host{display:block}";export{U as vega_form}
|
package/dist/vega/p-521ace2d.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as e,M as t,V as s}from"./p-6e1ab235.js";import{D as c}from"./p-8a877e12.js";import{O as r}from"./p-331a62d5.js";import{C as a}from"./p-2d0d575f.js";var n=function(e,t,s,c){var r,a=arguments.length,n=a<3?t:null===c?c=Object.getOwnPropertyDescriptor(t,s):c;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,s,c);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(n=(a<3?r(n):a>3?r(t,s,n):r(t,s))||n);return a>3&&n&&Object.defineProperty(t,s,n),n};class o extends s{connectedCallback(){this.observer=new r(this.isAcceptObserver.bind(this),(e=>{this.isInDarkMode=e})),a.register(c,this.observer)}disconnectResizeObserver(){a.unregister(c,this.observer)}isAcceptObserver(){return!0}}n([e({writable:!0})],o.prototype,"isInDarkMode",void 0),n([t("connectedCallback")],o.prototype,"connectedCallback",null),n([t("disconnectedCallback")],o.prototype,"disconnectResizeObserver",null);export{o as D}
|