@heartlandone/vega 2.97.0 → 2.98.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-3f57f7b9.js → app-globals-b3f05631.js} +7 -7
- package/dist/cjs/{aria-dialog-focusable-trap-slimmer-73b4c0cb.js → aria-dialog-focusable-trap-slimmer-62147489.js} +1 -1
- package/dist/cjs/{code-block-28a7732e.js → code-block-d78c2b2c.js} +15 -8
- package/dist/cjs/{component-value-history-controller-slimmer.abstract-50cdba6e.js → component-value-history-controller-slimmer.abstract-beb00fea.js} +3 -3
- package/dist/cjs/constants-907d7d89.js +16 -0
- package/dist/cjs/{content-state-e2ab0f06.js → content-state-78a620a9.js} +2 -2
- package/dist/cjs/{element-appender-slimmer-ccb2e3c2.js → element-appender-slimmer-597e9e48.js} +1 -1
- package/dist/cjs/{form-field-controller-slimmer-58621b5e.js → form-field-controller-slimmer-a743be34.js} +2 -2
- package/dist/cjs/{image-annotation-action-b54dc669.js → image-annotation-action-85c4bd83.js} +2 -2
- package/dist/cjs/{image-extension-1e3eeaa3.js → image-extension-260fa69c.js} +2 -2
- package/dist/cjs/index.cjs.js +9 -9
- package/dist/cjs/{link-extension-71c27ff3.js → link-extension-220ff6a9.js} +2 -2
- package/dist/cjs/loader.cjs.js +9 -9
- package/dist/cjs/{public-rules-55e34d2e.js → public-rules-5657bce4.js} +4 -4
- package/dist/cjs/{range-eebe0e3c.js → range-c5afd53a.js} +1 -1
- package/dist/cjs/{rich-text-editor-required-rule-4fdee376.js → rich-text-editor-required-rule-385c1b61.js} +1 -1
- package/dist/cjs/{split-cell-operation-51097409.js → split-cell-operation-873d5db7.js} +2 -2
- package/dist/cjs/{string-input-formatter-slimmer-18d45942.js → string-input-formatter-slimmer-ef65cca7.js} +2 -2
- package/dist/cjs/{sub-state-notify-slimmer-18891389.js → sub-state-notify-slimmer-e264a120.js} +1 -1
- package/dist/cjs/{sub-state-observer-slimmer-eee2f0ae.js → sub-state-observer-slimmer-6033b824.js} +1 -1
- package/dist/cjs/{token-extension-608bbf7b.js → token-extension-78b5a026.js} +6 -6
- package/dist/cjs/vega-button-circle.cjs.entry.js +1 -1
- package/dist/cjs/vega-button-group_2.cjs.entry.js +3 -3
- package/dist/cjs/vega-button.cjs.entry.js +1 -1
- package/dist/cjs/vega-calendar_5.cjs.entry.js +3 -3
- package/dist/cjs/vega-checkbox_2.cjs.entry.js +3 -3
- package/dist/cjs/vega-code-block.cjs.entry.js +8 -21
- package/dist/cjs/vega-color-picker.cjs.entry.js +3 -3
- package/dist/cjs/vega-color-swatch-picker.cjs.entry.js +3 -3
- package/dist/cjs/vega-combo-box.cjs.entry.js +3 -3
- package/dist/cjs/vega-date-picker_2.cjs.entry.js +7 -7
- package/dist/cjs/vega-dialog_2.cjs.entry.js +2 -2
- package/dist/cjs/vega-dropdown_5.cjs.entry.js +24 -18
- package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
- package/dist/cjs/vega-file-uploader.cjs.entry.js +38 -5
- package/dist/cjs/vega-form.cjs.entry.js +3 -3
- package/dist/cjs/vega-image-uploader.cjs.entry.js +3 -3
- package/dist/cjs/vega-input-credit-card.cjs.entry.js +3 -3
- package/dist/cjs/vega-input-numeric.cjs.entry.js +4 -4
- package/dist/cjs/vega-input-passcode.cjs.entry.js +3 -3
- package/dist/cjs/vega-input-phone-number.cjs.entry.js +3 -3
- package/dist/cjs/vega-input-range.cjs.entry.js +3 -3
- package/dist/cjs/vega-input-select.cjs.entry.js +3 -3
- package/dist/cjs/vega-input.cjs.entry.js +12 -7
- package/dist/cjs/{vega-internal-event-id-ecc5b87a.js → vega-internal-event-id-f4d33037.js} +2 -0
- package/dist/cjs/vega-left-nav_5.cjs.entry.js +3 -3
- package/dist/cjs/vega-pagination-page-selector-mobile.cjs.entry.js +1 -1
- package/dist/cjs/vega-pagination-page-size-selector-mobile.cjs.entry.js +1 -1
- package/dist/cjs/vega-pagination.cjs.entry.js +1 -1
- package/dist/cjs/vega-popover_2.cjs.entry.js +3 -3
- package/dist/cjs/vega-progress-tracker_2.cjs.entry.js +3 -3
- package/dist/cjs/vega-radio_2.cjs.entry.js +3 -3
- package/dist/cjs/vega-rich-text-content.cjs.entry.js +7 -7
- package/dist/cjs/vega-rich-text-editor_4.cjs.entry.js +13 -13
- package/dist/cjs/vega-rich-text-table-properties_3.cjs.entry.js +4 -4
- package/dist/cjs/vega-selection-chip_2.cjs.entry.js +4 -4
- package/dist/cjs/vega-selection-tile_2.cjs.entry.js +4 -4
- package/dist/cjs/vega-sidenav_3.cjs.entry.js +3 -3
- package/dist/cjs/vega-signature-capture.cjs.entry.js +3 -3
- package/dist/cjs/vega-stepper.cjs.entry.js +3 -3
- package/dist/cjs/vega-table_11.cjs.entry.js +1140 -446
- package/dist/cjs/vega-textarea.cjs.entry.js +3 -3
- package/dist/cjs/vega-time-picker_2.cjs.entry.js +4 -4
- package/dist/cjs/vega-toggle-switch.cjs.entry.js +3 -3
- package/dist/cjs/vega-tooltip_2.cjs.entry.js +2 -2
- package/dist/cjs/vega.cjs.js +9 -9
- package/dist/cjs/{wait-for-component-did-render-02ca4bee.js → wait-for-component-did-render-44d006ee.js} +1 -1
- package/dist/collection/components/vega-accordion/vega-accordion.js +2 -0
- package/dist/collection/components/vega-app-footer/vega-app-footer.js +2 -0
- package/dist/collection/components/vega-app-header-button/vega-app-header-button.js +2 -0
- package/dist/collection/components/vega-banner/vega-banner.js +2 -0
- package/dist/collection/components/vega-box/vega-box.js +2 -0
- package/dist/collection/components/vega-brand-logo/vega-brand-logo.js +2 -0
- package/dist/collection/components/vega-breadcrumb/vega-breadcrumb.js +2 -0
- package/dist/collection/components/vega-button/vega-button.js +2 -0
- package/dist/collection/components/vega-button-circle/vega-button-circle.js +2 -0
- package/dist/collection/components/vega-button-group/vega-button-group.js +2 -0
- package/dist/collection/components/vega-button-link/vega-button-link.js +2 -0
- package/dist/collection/components/vega-calendar/vega-calendar.js +2 -0
- package/dist/collection/components/vega-card/vega-card.js +2 -0
- package/dist/collection/components/vega-carousel/vega-carousel.js +2 -0
- package/dist/collection/components/vega-checkbox/vega-checkbox.js +2 -0
- package/dist/collection/components/vega-chip/vega-chip.js +2 -0
- package/dist/collection/components/vega-code-block/slimmers/controllers/code-highlight-parser.abstract.js +4 -17
- package/dist/collection/components/vega-color-picker/vega-color-picker.js +2 -0
- package/dist/collection/components/vega-combo-box/vega-combo-box.js +2 -0
- package/dist/collection/components/vega-counter-badge/vega-counter-badge.js +2 -0
- package/dist/collection/components/vega-date-picker/vega-date-picker.js +2 -0
- package/dist/collection/components/vega-divider/vega-divider.js +2 -0
- package/dist/collection/components/vega-dropdown/constants.js +10 -0
- package/dist/collection/components/vega-dropdown/vega-dropdown.js +45 -14
- package/dist/collection/components/vega-field-error/vega-field-error.js +2 -0
- package/dist/collection/components/vega-file-uploader/slimmers/renderers/vega-file-uploader-file-list-renderer.js +22 -2
- package/dist/collection/components/vega-file-uploader/vega-file-uploader.js +63 -6
- package/dist/collection/components/vega-flag-icon/vega-flag-icon.js +2 -0
- package/dist/collection/components/vega-flex/vega-flex.js +2 -0
- package/dist/collection/components/vega-font/vega-font.js +2 -0
- package/dist/collection/components/vega-form/vega-form.js +2 -0
- package/dist/collection/components/vega-grid/vega-grid.js +2 -0
- package/dist/collection/components/vega-icon/vega-icon.js +2 -0
- package/dist/collection/components/vega-image-uploader/vega-image-uploader.js +2 -0
- package/dist/collection/components/vega-input/slimmers/renderers/vega-input-input-suggestions-renderer.js +7 -2
- package/dist/collection/components/vega-input/vega-input.js +2 -0
- package/dist/collection/components/vega-input-credit-card/vega-input-credit-card.js +2 -0
- package/dist/collection/components/vega-input-numeric/vega-input-numeric.js +2 -0
- package/dist/collection/components/vega-input-passcode/vega-input-passcode.js +2 -0
- package/dist/collection/components/vega-input-phone-number/vega-input-phone-number.js +2 -0
- package/dist/collection/components/vega-input-range/vega-input-range.js +2 -0
- package/dist/collection/components/vega-input-select/vega-input-select.js +2 -0
- package/dist/collection/components/vega-item-toggle/vega-item-toggle.js +2 -0
- package/dist/collection/components/vega-loading-indicator/vega-loading-indicator.js +2 -0
- package/dist/collection/components/vega-modal/vega-modal.js +2 -0
- package/dist/collection/components/vega-page-notification/vega-page-notification.js +2 -0
- package/dist/collection/components/vega-pagination/vega-pagination.js +2 -0
- package/dist/collection/components/vega-popover/vega-popover.js +2 -0
- package/dist/collection/components/vega-progress-tracker/vega-progress-tracker.js +2 -0
- package/dist/collection/components/vega-radio/vega-radio.js +2 -0
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/text-block.js +3 -0
- package/dist/collection/components/vega-rich-text-editor/dto/nodes/code-block-node.js +2 -1
- package/dist/collection/components/vega-rich-text-editor/helpers/utils.js +10 -6
- package/dist/collection/components/vega-rich-text-editor/vega-rich-text-editor.js +2 -0
- package/dist/collection/components/vega-section-title/vega-section-title.js +2 -0
- package/dist/collection/components/vega-segment-control/vega-segment-control.js +2 -0
- package/dist/collection/components/vega-selection-chip/vega-selection-chip.js +2 -0
- package/dist/collection/components/vega-selection-tile/vega-selection-tile.js +2 -0
- package/dist/collection/components/vega-sidenav/vega-sidenav.js +2 -0
- package/dist/collection/components/vega-signature-capture/vega-signature-capture.js +2 -0
- package/dist/collection/components/vega-skeleton/vega-skeleton.js +2 -0
- package/dist/collection/components/vega-stepper/vega-stepper.js +2 -0
- package/dist/collection/components/vega-tab-group/vega-tab-group.js +2 -0
- package/dist/collection/components/vega-table/slimmers/controllers/vega-table-column-structure-model-controller.js +17 -7
- package/dist/collection/components/vega-table/slimmers/controllers/vega-table-head-template-structure-controller.js +440 -0
- package/dist/collection/components/vega-table/slimmers/controllers/vega-table-render-input-controller.js +11 -3
- package/dist/collection/components/vega-table/slimmers/renderers/vega-table-pinned-renderer.js +207 -17
- package/dist/collection/components/vega-table/vega-table-foot/vega-table-foot.css +1 -0
- package/dist/collection/components/vega-table/vega-table-foot-cell/slimmers/renderers/vega-table-foot-cell-renderer.js +4 -1
- package/dist/collection/components/vega-table/vega-table-foot-cell/vega-table-foot-cell.css +15 -0
- package/dist/collection/components/vega-table/vega-table-foot-cell/vega-table-foot-cell.js +1 -1
- package/dist/collection/components/vega-table/vega-table-head-cell/slimmers/controllers/vega-table-head-cell-template-structure-controller.js +28 -0
- package/dist/collection/components/vega-table/vega-table-head-cell/vega-table-head-cell.css +1 -0
- package/dist/collection/components/vega-table/vega-table-head-cell/vega-table-head-cell.js +68 -4
- package/dist/collection/components/vega-table/vega-table.js +15 -0
- package/dist/collection/components/vega-textarea/vega-textarea.js +2 -0
- package/dist/collection/components/vega-time-picker/vega-time-picker.js +2 -0
- package/dist/collection/components/vega-toggle-switch/vega-toggle-switch.js +2 -0
- package/dist/collection/components/vega-tooltip/vega-tooltip.js +2 -0
- package/dist/collection/helpers/event-manager/event-id/vega-internal-event-id.js +1 -0
- package/dist/esm/{app-globals-d3991e53.js → app-globals-95c7110a.js} +7 -7
- package/dist/esm/{aria-dialog-focusable-trap-slimmer-9eae86c6.js → aria-dialog-focusable-trap-slimmer-f069f54d.js} +1 -1
- package/dist/esm/{code-block-8df86434.js → code-block-9c513169.js} +15 -8
- package/dist/esm/{component-value-history-controller-slimmer.abstract-e4b95997.js → component-value-history-controller-slimmer.abstract-9cef2a2a.js} +3 -3
- package/dist/esm/constants-4725f97f.js +13 -0
- package/dist/esm/{content-state-c63fbeda.js → content-state-25c81c08.js} +2 -2
- package/dist/esm/{element-appender-slimmer-24be8e94.js → element-appender-slimmer-8a06ecdd.js} +1 -1
- package/dist/esm/{form-field-controller-slimmer-d8628837.js → form-field-controller-slimmer-68fc5380.js} +2 -2
- package/dist/esm/{image-annotation-action-fcceff95.js → image-annotation-action-d7f2aecc.js} +2 -2
- package/dist/esm/{image-extension-3280bdb0.js → image-extension-fbd1ed6e.js} +2 -2
- package/dist/esm/index.js +9 -9
- package/dist/esm/{link-extension-f92c06ef.js → link-extension-e8ee103e.js} +2 -2
- package/dist/esm/loader.js +9 -9
- package/dist/esm/{public-rules-3695aaf7.js → public-rules-49de79c7.js} +4 -4
- package/dist/esm/{range-717d552d.js → range-b678c693.js} +1 -1
- package/dist/esm/{rich-text-editor-required-rule-2e39264a.js → rich-text-editor-required-rule-578e0958.js} +1 -1
- package/dist/esm/{split-cell-operation-6c26af91.js → split-cell-operation-1c8e7585.js} +2 -2
- package/dist/esm/{string-input-formatter-slimmer-68b2af39.js → string-input-formatter-slimmer-0006a107.js} +2 -2
- package/dist/esm/{sub-state-notify-slimmer-0f72ce74.js → sub-state-notify-slimmer-23b7d0e8.js} +1 -1
- package/dist/esm/{sub-state-observer-slimmer-64532d94.js → sub-state-observer-slimmer-722f6b92.js} +1 -1
- package/dist/esm/{token-extension-5082a4d2.js → token-extension-f2d009e3.js} +6 -6
- package/dist/esm/vega-button-circle.entry.js +1 -1
- package/dist/esm/vega-button-group_2.entry.js +3 -3
- package/dist/esm/vega-button.entry.js +1 -1
- package/dist/esm/vega-calendar_5.entry.js +3 -3
- package/dist/esm/vega-checkbox_2.entry.js +3 -3
- package/dist/esm/vega-code-block.entry.js +8 -21
- package/dist/esm/vega-color-picker.entry.js +3 -3
- package/dist/esm/vega-color-swatch-picker.entry.js +3 -3
- package/dist/esm/vega-combo-box.entry.js +3 -3
- package/dist/esm/vega-date-picker_2.entry.js +7 -7
- package/dist/esm/vega-dialog_2.entry.js +2 -2
- package/dist/esm/vega-dropdown_5.entry.js +20 -14
- package/dist/esm/vega-env-manager-8f8dc473.js +2 -2
- package/dist/esm/vega-file-uploader.entry.js +38 -5
- package/dist/esm/vega-form.entry.js +3 -3
- package/dist/esm/vega-image-uploader.entry.js +3 -3
- package/dist/esm/vega-input-credit-card.entry.js +3 -3
- package/dist/esm/vega-input-numeric.entry.js +4 -4
- package/dist/esm/vega-input-passcode.entry.js +3 -3
- package/dist/esm/vega-input-phone-number.entry.js +3 -3
- package/dist/esm/vega-input-range.entry.js +3 -3
- package/dist/esm/vega-input-select.entry.js +3 -3
- package/dist/esm/vega-input.entry.js +12 -7
- package/dist/esm/{vega-internal-event-id-827eb1ce.js → vega-internal-event-id-86fce049.js} +2 -1
- package/dist/esm/vega-left-nav_5.entry.js +3 -3
- package/dist/esm/vega-pagination-page-selector-mobile.entry.js +1 -1
- package/dist/esm/vega-pagination-page-size-selector-mobile.entry.js +1 -1
- package/dist/esm/vega-pagination.entry.js +1 -1
- package/dist/esm/vega-popover_2.entry.js +3 -3
- package/dist/esm/vega-progress-tracker_2.entry.js +3 -3
- package/dist/esm/vega-radio_2.entry.js +3 -3
- package/dist/esm/vega-rich-text-content.entry.js +7 -7
- package/dist/esm/vega-rich-text-editor_4.entry.js +13 -13
- package/dist/esm/vega-rich-text-table-properties_3.entry.js +4 -4
- package/dist/esm/vega-selection-chip_2.entry.js +4 -4
- package/dist/esm/vega-selection-tile_2.entry.js +4 -4
- package/dist/esm/vega-sidenav_3.entry.js +3 -3
- package/dist/esm/vega-signature-capture.entry.js +3 -3
- package/dist/esm/vega-stepper.entry.js +3 -3
- package/dist/esm/vega-table_11.entry.js +1141 -447
- package/dist/esm/vega-textarea.entry.js +3 -3
- package/dist/esm/vega-time-picker_2.entry.js +4 -4
- package/dist/esm/vega-toggle-switch.entry.js +3 -3
- package/dist/esm/vega-tooltip_2.entry.js +2 -2
- package/dist/esm/vega.js +9 -9
- package/dist/esm/{wait-for-component-did-render-0c237cb8.js → wait-for-component-did-render-ff7062aa.js} +1 -1
- package/dist/sri/vega-sri-manifest.json +228 -224
- package/dist/types/components/vega-accordion/vega-accordion.d.ts +2 -0
- package/dist/types/components/vega-app-footer/vega-app-footer.d.ts +2 -0
- package/dist/types/components/vega-app-header-button/vega-app-header-button.d.ts +2 -0
- package/dist/types/components/vega-banner/vega-banner.d.ts +2 -0
- package/dist/types/components/vega-box/vega-box.d.ts +2 -0
- package/dist/types/components/vega-brand-logo/vega-brand-logo.d.ts +2 -0
- package/dist/types/components/vega-breadcrumb/vega-breadcrumb.d.ts +2 -0
- package/dist/types/components/vega-button/vega-button.d.ts +2 -0
- package/dist/types/components/vega-button-circle/vega-button-circle.d.ts +2 -0
- package/dist/types/components/vega-button-group/vega-button-group.d.ts +2 -0
- package/dist/types/components/vega-button-link/vega-button-link.d.ts +2 -0
- package/dist/types/components/vega-calendar/vega-calendar.d.ts +2 -0
- package/dist/types/components/vega-card/vega-card.d.ts +2 -0
- package/dist/types/components/vega-carousel/vega-carousel.d.ts +2 -0
- package/dist/types/components/vega-checkbox/vega-checkbox.d.ts +2 -0
- package/dist/types/components/vega-chip/vega-chip.d.ts +2 -0
- package/dist/types/components/vega-code-block/slimmers/controllers/code-highlight-parser.abstract.d.ts +2 -1
- package/dist/types/components/vega-color-picker/vega-color-picker.d.ts +2 -0
- package/dist/types/components/vega-combo-box/vega-combo-box.d.ts +2 -0
- package/dist/types/components/vega-counter-badge/vega-counter-badge.d.ts +2 -0
- package/dist/types/components/vega-date-picker/vega-date-picker.d.ts +2 -0
- package/dist/types/components/vega-divider/vega-divider.d.ts +2 -0
- package/dist/types/components/vega-dropdown/constants.d.ts +12 -0
- package/dist/types/components/vega-dropdown/vega-dropdown.d.ts +9 -0
- package/dist/types/components/vega-field-error/vega-field-error.d.ts +2 -0
- package/dist/types/components/vega-file-uploader/slimmers/renderers/vega-file-uploader-file-list-renderer.d.ts +10 -0
- package/dist/types/components/vega-file-uploader/types.d.ts +4 -0
- package/dist/types/components/vega-file-uploader/vega-file-uploader.d.ts +15 -0
- package/dist/types/components/vega-flag-icon/vega-flag-icon.d.ts +2 -0
- package/dist/types/components/vega-flex/vega-flex.d.ts +2 -0
- package/dist/types/components/vega-font/vega-font.d.ts +2 -0
- package/dist/types/components/vega-form/vega-form.d.ts +2 -0
- package/dist/types/components/vega-grid/vega-grid.d.ts +2 -0
- package/dist/types/components/vega-icon/vega-icon.d.ts +2 -0
- package/dist/types/components/vega-image-uploader/vega-image-uploader.d.ts +2 -0
- package/dist/types/components/vega-input/types.d.ts +11 -1
- package/dist/types/components/vega-input/vega-input.d.ts +2 -0
- package/dist/types/components/vega-input-credit-card/vega-input-credit-card.d.ts +2 -0
- package/dist/types/components/vega-input-numeric/vega-input-numeric.d.ts +2 -0
- package/dist/types/components/vega-input-passcode/vega-input-passcode.d.ts +2 -0
- package/dist/types/components/vega-input-phone-number/vega-input-phone-number.d.ts +2 -0
- package/dist/types/components/vega-input-range/vega-input-range.d.ts +2 -0
- package/dist/types/components/vega-input-select/vega-input-select.d.ts +2 -0
- package/dist/types/components/vega-item-toggle/vega-item-toggle.d.ts +2 -0
- package/dist/types/components/vega-loading-indicator/vega-loading-indicator.d.ts +2 -0
- package/dist/types/components/vega-modal/vega-modal.d.ts +2 -0
- package/dist/types/components/vega-page-notification/vega-page-notification.d.ts +2 -0
- package/dist/types/components/vega-pagination/vega-pagination.d.ts +2 -0
- package/dist/types/components/vega-popover/vega-popover.d.ts +2 -0
- package/dist/types/components/vega-progress-tracker/vega-progress-tracker.d.ts +2 -0
- package/dist/types/components/vega-radio/vega-radio.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/helpers/utils.d.ts +7 -0
- package/dist/types/components/vega-rich-text-editor/vega-rich-text-editor.d.ts +2 -0
- package/dist/types/components/vega-section-title/vega-section-title.d.ts +2 -0
- package/dist/types/components/vega-segment-control/vega-segment-control.d.ts +2 -0
- package/dist/types/components/vega-selection-chip/vega-selection-chip.d.ts +2 -0
- package/dist/types/components/vega-selection-tile/vega-selection-tile.d.ts +2 -0
- package/dist/types/components/vega-sidenav/vega-sidenav.d.ts +2 -0
- package/dist/types/components/vega-signature-capture/vega-signature-capture.d.ts +2 -0
- package/dist/types/components/vega-skeleton/vega-skeleton.d.ts +2 -0
- package/dist/types/components/vega-stepper/vega-stepper.d.ts +2 -0
- package/dist/types/components/vega-tab-group/vega-tab-group.d.ts +2 -0
- package/dist/types/components/vega-table/slimmers/controllers/vega-table-column-structure-model-controller.d.ts +8 -4
- package/dist/types/components/vega-table/slimmers/controllers/vega-table-head-template-structure-controller.d.ts +168 -0
- package/dist/types/components/vega-table/slimmers/controllers/vega-table-render-input-controller.d.ts +8 -1
- package/dist/types/components/vega-table/slimmers/renderers/vega-table-pinned-renderer.d.ts +76 -0
- package/dist/types/components/vega-table/vega-table-foot-cell/slimmers/renderers/vega-table-foot-cell-renderer.d.ts +1 -0
- package/dist/types/components/vega-table/vega-table-head-cell/slimmers/controllers/vega-table-head-cell-template-structure-controller.d.ts +12 -0
- package/dist/types/components/vega-table/vega-table-head-cell/vega-table-head-cell.d.ts +19 -0
- package/dist/types/components/vega-table/vega-table.d.ts +6 -0
- package/dist/types/components/vega-textarea/vega-textarea.d.ts +2 -0
- package/dist/types/components/vega-time-picker/vega-time-picker.d.ts +2 -0
- package/dist/types/components/vega-toggle-switch/vega-toggle-switch.d.ts +2 -0
- package/dist/types/components/vega-tooltip/vega-tooltip.d.ts +2 -0
- package/dist/types/components.d.ts +54 -0
- 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-2eb8e167.entry.js → p-02d3ce79.entry.js} +1 -1
- package/dist/vega/{p-3488a3f1.entry.js → p-035e2f05.entry.js} +1 -1
- package/dist/vega/p-03eeadc1.entry.js +1 -0
- package/dist/vega/{p-d2cbcf5e.entry.js → p-085d1647.entry.js} +1 -1
- package/dist/vega/{p-36c89520.entry.js → p-0cbf09f7.entry.js} +1 -1
- package/dist/vega/{p-1d5e05d9.js → p-0eb29065.js} +1 -1
- package/dist/vega/{p-2ff4ae1c.js → p-10d30c03.js} +1 -1
- package/dist/vega/{p-4c3a08be.entry.js → p-17c69503.entry.js} +1 -1
- package/dist/vega/{p-9be02fa5.js → p-1abd3c17.js} +1 -1
- package/dist/vega/{p-98fc5821.entry.js → p-1aedbfd2.entry.js} +1 -1
- package/dist/vega/{p-c3646101.entry.js → p-1cff027b.entry.js} +1 -1
- package/dist/vega/{p-deaf037a.entry.js → p-2a245138.entry.js} +1 -1
- package/dist/vega/{p-a034dfc0.entry.js → p-2f07d719.entry.js} +1 -1
- package/dist/vega/{p-0499e65a.entry.js → p-36d9e782.entry.js} +1 -1
- package/dist/vega/{p-e9d09211.js → p-373541fa.js} +1 -1
- package/dist/vega/{p-703ac992.entry.js → p-3737b9e2.entry.js} +1 -1
- package/dist/vega/{p-e9b005df.js → p-3d0b4074.js} +1 -1
- package/dist/vega/p-4a2fe3a4.js +1 -0
- package/dist/vega/{p-040ea356.entry.js → p-4bfe3258.entry.js} +1 -1
- package/dist/vega/{p-21f608e8.entry.js → p-4cbfc01e.entry.js} +1 -1
- package/dist/vega/{p-21626b93.entry.js → p-4e065ef7.entry.js} +1 -1
- package/dist/vega/{p-c29934ef.js → p-4fd0cf01.js} +1 -1
- package/dist/vega/{p-3af5e87b.entry.js → p-52c69f9e.entry.js} +1 -1
- package/dist/vega/{p-e7e963ba.entry.js → p-544ce391.entry.js} +1 -1
- package/dist/vega/{p-8e7932bc.js → p-56493601.js} +1 -1
- package/dist/vega/{p-8611465f.entry.js → p-56598858.entry.js} +1 -1
- package/dist/vega/{p-e1029acc.js → p-56db3323.js} +1 -1
- package/dist/vega/p-571ec00b.js +1 -0
- package/dist/vega/{p-abbceebf.entry.js → p-585e4f1c.entry.js} +1 -1
- package/dist/vega/p-5b1f5e4a.entry.js +1 -0
- package/dist/vega/p-5f377954.js +1 -1
- package/dist/vega/{p-10d43a80.entry.js → p-6234852e.entry.js} +1 -1
- package/dist/vega/p-67eaf77e.js +1 -0
- package/dist/vega/{p-2540fd1c.entry.js → p-6d4518d7.entry.js} +1 -1
- package/dist/vega/p-6db1b9ac.js +1 -0
- package/dist/vega/{p-363ee8a5.entry.js → p-6f537797.entry.js} +1 -1
- package/dist/vega/{p-0809c651.js → p-6fd4f2c6.js} +1 -1
- package/dist/vega/p-72fd17a1.entry.js +1 -0
- package/dist/vega/{p-b594a11c.entry.js → p-7dcd2850.entry.js} +1 -1
- package/dist/vega/{p-5e37b041.js → p-7e8fdac4.js} +1 -1
- package/dist/vega/{p-d25c1a48.js → p-810c9c29.js} +1 -1
- package/dist/vega/{p-a2bd621e.js → p-83ad8988.js} +1 -1
- package/dist/vega/{p-26760c66.entry.js → p-8c56d74d.entry.js} +1 -1
- package/dist/vega/{p-09524fec.js → p-8d2501b2.js} +1 -1
- package/dist/vega/{p-1132a74e.entry.js → p-94975537.entry.js} +1 -1
- package/dist/vega/{p-9c4c474e.entry.js → p-95c18f79.entry.js} +1 -1
- package/dist/vega/p-9834d5d4.entry.js +1 -0
- package/dist/vega/{p-dad7d2ac.js → p-a090b2be.js} +1 -1
- package/dist/vega/{p-f1078e63.js → p-a81ad3bd.js} +1 -1
- package/dist/vega/{p-29e3eb12.js → p-c41a2d4a.js} +1 -1
- package/dist/vega/{p-8ed3b2b6.entry.js → p-c5fb8a69.entry.js} +1 -1
- package/dist/vega/{p-d3413a78.entry.js → p-c6d775b8.entry.js} +1 -1
- package/dist/vega/{p-046203cb.entry.js → p-c70748f7.entry.js} +1 -1
- package/dist/vega/{p-53fd3c41.entry.js → p-c98c2f5f.entry.js} +1 -1
- package/dist/vega/{p-aeb50cad.entry.js → p-ca3c1317.entry.js} +1 -1
- package/dist/vega/{p-f5095035.entry.js → p-cb81126a.entry.js} +1 -1
- package/dist/vega/{p-775ecfad.entry.js → p-cf4b3d40.entry.js} +1 -1
- package/dist/vega/{p-3980dfa8.entry.js → p-cfe268a8.entry.js} +1 -1
- package/dist/vega/{p-e3fdb65c.entry.js → p-d470fce2.entry.js} +1 -1
- package/dist/vega/{p-8ff92914.entry.js → p-da867019.entry.js} +1 -1
- package/dist/vega/{p-3f183b52.js → p-daba4af1.js} +1 -1
- package/dist/vega/{p-9664e914.entry.js → p-f62c5a20.entry.js} +1 -1
- package/dist/vega/{p-6b76b572.entry.js → p-f6c0e9e7.entry.js} +1 -1
- package/dist/vega/{p-56d19601.entry.js → p-fb9475ab.entry.js} +1 -1
- package/dist/vega/vega.esm.js +1 -1
- package/package.json +1 -1
- package/dist/vega/p-2bb60f89.js +0 -1
- package/dist/vega/p-2d7388c9.entry.js +0 -1
- package/dist/vega/p-3a68b729.js +0 -1
- package/dist/vega/p-81d4dfcb.entry.js +0 -1
- package/dist/vega/p-88a6c89a.js +0 -1
- package/dist/vega/p-ca270da3.entry.js +0 -1
- package/dist/vega/p-f95d8d10.entry.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as i,h as e,H as s,g as h}from"./p-6b2342e0.js";import{F as r}from"./p-87a4d75f.js";import{V as a,M as l,A as o,D as c,i as p}from"./p-456f678b.js";import{R as n}from"./p-8bc15ed0.js";import{V as d}from"./p-12e8a1b2.js";import{s as m}from"./p-519a7d55.js";import{I as v}from"./p-6e1ab235.js";import{V as f,I as u}from"./p-8ce9e214.js";import{F as g}from"./p-e1029acc.js";import{F as _}from"./p-cb378636.js";import{C as A}from"./p-2d0d575f.js";import{c as E}from"./p-66647244.js";import{C as M}from"./p-2c737fc8.js";import{D as I}from"./p-526e3634.js";import{d as j,M as w,L as D}from"./p-5447a8e8.js";import{V as Z}from"./p-6031bed1.js";import{S as C}from"./p-1ea9ad9a.js";import"./p-982747ef.js";import"./p-ed45b3b6.js";import"./p-d4ea8e22.js";import"./p-b438e68b.js";import"./p-874e5624.js";import"./p-abd7aeaa.js";import"./p-262ec334.js";import"./p-02841589.js";import"./p-331a62d5.js";import"./p-528748fa.js";import"./p-8b5d3a52.js";import"./p-6a334573.js";import"./p-3a68b729.js";import"./p-f0e828d8.js";import"./p-b75ee3ba.js";import"./p-81dd00d0.js";import"./p-49a2e141.js";import"./p-71909102.js";import"./p-78a57a17.js";import"./p-52b8f2d2.js";import"./p-d27ae9ff.js";import"./p-29e3eb12.js";import"./p-8c30a60d.js";import"./p-5f377954.js";import"./p-ffdc25ec.js";import"./p-afcd8f04.js";import"./p-ae2abdfa.js";const R=[{type:"visa",iconName:"visa",pattern:a,maskConfig:{type:"custom",options:{mask:"9999 9999 9999 9999 999",slot:"9",accept:/\d/,triggerAtInit:r.isEnabled("VEGA_INPUT_CREDIT_CARD.ENABLE_HIDE_NUMBER_MASK_ON_FIRST_LOAD")}}},{type:"mastercard",iconName:"mastercard",pattern:l,maskConfig:{type:"custom",options:{mask:"9999 9999 9999 9999",slot:"9",accept:/\d/,triggerAtInit:r.isEnabled("VEGA_INPUT_CREDIT_CARD.ENABLE_HIDE_NUMBER_MASK_ON_FIRST_LOAD")}}},{type:"amex",iconName:"amex",pattern:o,maskConfig:{type:"custom",options:{mask:"9999 999999 99999",slot:"9",accept:/\d/,triggerAtInit:r.isEnabled("VEGA_INPUT_CREDIT_CARD.ENABLE_HIDE_NUMBER_MASK_ON_FIRST_LOAD")}}},{type:"discover",iconName:"discover",pattern:c,maskConfig:{type:"custom",options:{mask:"9999 9999 9999 9999",slot:"9",accept:/\d/,triggerAtInit:r.isEnabled("VEGA_INPUT_CREDIT_CARD.ENABLE_HIDE_NUMBER_MASK_ON_FIRST_LOAD")}}}],b=[{payloadKey:"AUTO_VALIDATION_IS_TRUE",payloadDescription:"Determines whether the user's input in the credit card field should be automatically validated",payloadValue:t=>!0===t.autoValidation},{payloadKey:"AUTO_VALIDATION_IS_FALSE",payloadDescription:"Determines whether the user's input in the credit card field should be automatically validated",payloadValue:t=>!1===t.autoValidation}];class N extends C{calculateCaretPosition(t,i){if(!p(i))return null;if(this.getCreditCardMaskConfig(t)){if(t.length>this.getLengthLimit())return i-(t.length-this.getLengthLimit());const e=t.substring(0,i);return i+(this.format(e).length-e.length)}return i}format(t,i){const e=this.getCreditCardMaskConfig(t);if(e){this.setMaskConfig(e.options);const s=null==i?void 0:i.caretPosition;if(t.length>this.getLengthLimit()&&p(s)){const i=[...t],e=t.length-this.getLengthLimit();return i.splice(s-e,e),i.join("")}return this.replaceMaskWithMatchedInputSlots(t,this.getMatchedInputSlotValue(t))}return t}getCreditCardType(t){return R.filter((i=>i.pattern.test(t)))[0]}}class y extends N{constructor(){super({mask:"",slot:"9",accept:/\d/,triggerAtInit:r.isEnabled("VEGA_INPUT_CREDIT_CARD.ENABLE_HIDE_NUMBER_MASK_ON_FIRST_LOAD")})}getCreditCardMaskConfig(t){let i;const e=this.getCreditCardType(t);return e&&(i=e.maskConfig),i}}class V extends N{constructor(t){super({mask:"",slot:"9",accept:/[\d\s]/,insertMode:!1,triggerAtInit:r.isEnabled("VEGA_INPUT_CREDIT_CARD.ENABLE_HIDE_NUMBER_MASK_ON_FIRST_LOAD")}),this.hideCardNumberOnBlur=t}getCreditCardMaskConfig(t){let i;return this.getCreditCardType(t)&&this.hideCardNumberOnBlur&&t.trim().includes(" ")&&(i=this.generateDynamicMask(t)),i}generateDynamicMask(t){const i={type:"custom",options:{mask:"",slot:"9",accept:/[\d\s]/,insertMode:!1,triggerAtInit:r.isEnabled("VEGA_INPUT_CREDIT_CARD.ENABLE_HIDE_NUMBER_MASK_ON_FIRST_LOAD")},trigger:"blur"},e=t.trim().split(" "),s=e.map(((t,i)=>(i===e.length-1?"9":"X").repeat(t.length))).join(" ");return i.options.mask=s,i}}var H=function(t,i,e,s){var h,r=arguments.length,a=r<3?i:null===s?s=Object.getOwnPropertyDescriptor(i,e):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,i,e,s);else for(var l=t.length-1;l>=0;l--)(h=t[l])&&(a=(r<3?h(a):r>3?h(i,e,a):h(i,e))||a);return r>3&&a&&Object.defineProperty(i,e,a),a};const T=class{constructor(s){t(this,s),this.vegaChange=i(this,"vegaChange",7),this.change=i(this,"change",7),this.vegaBlur=i(this,"vegaBlur",7),this.blur=i(this,"blur",7),this.vegaFocus=i(this,"vegaFocus",7),this.focus=i(this,"focus",7),this.globalSlimmers={},this.formFieldController=new g({propertyRules:[{propertyName:"required",ruleFactory:t=>t?new n:null},{propertyName:"",ruleFactory:()=>new d}],validationRulesName:"validationRules",defaultValue:"",attributeGetter:t=>this[t],inputContainerGetter:()=>this.inputContainerGetter(),touchableAreaGetter:()=>this.touchableAreaGetter()}),this.changeEventEmitter=E(T,j),this.blurEventEmitter=E(T,w),this.focusEventEmitter=E(T,D),this.inputCreditCardEventPrevent=new M([j,D,w],(()=>this.host),!0),this.vegaComponentUsageRuntimeMetricsSlimmer=new f(b),this.required=!1,this.optional=!1,this.name="",this.disabled=!1,this.label="",this.hint="",this.size="default",this.placeholder="",this.hideCardNumberOnBlur=!0,this.autoValidation=!0,this.validationRules=[],this.isValid=null,this.value="",this.renderInputContainer=()=>{var t;const i=(null===(t=this.getCreditCardType(this.value))||void 0===t?void 0:t.iconName)||"regular-credit-card";return e("vega-input",{label:this.label,type:"number",prefixIcon:Z.getIconKey(i),maskConfig:this.getMaskConfig(),placeholder:this.placeholder,disabled:this.disabled,size:this.size,value:this.value,hint:this.hint,required:this.required,optional:this.optional,name:this.name,showClearIcon:!1,ref:t=>{this.inputRef=t,I.addUniqueObserverToNode(t,j,(t=>{this.handleVegaChange(t)})),I.addUniqueObserverToNode(t,w,(()=>{this.handleVegaBlur()})),I.addUniqueObserverToNode(t,D,(()=>{this.handleVegaFocus()}))},"data-aria-label":this.label||"Input credit card"})},this.handleVegaChange=t=>{this.value=t.detail},this.handleVegaBlur=()=>{this.blurEventEmitter.emit()},this.handleVegaFocus=()=>{this.focusEventEmitter.emit()},this.inputContainerGetter=()=>this.inputRef.shadowRoot.querySelector(".vega-input-container"),this.touchableAreaGetter=()=>Array.from(this.inputRef.shadowRoot.querySelectorAll("input"))}watchValidationRules(){}watchValue(t){this.changeEventEmitter.emit(t),A.notify(_,{host:this.host,detail:t})}componentDidLoad(){r.isEnabled("VEGA_INPUT_CREDIT_CARD.ENABLE_HIDE_NUMBER_MASK_ON_FIRST_LOAD")&&this.hideCardNumberOnBlur&&this.inputRef.value&&this.value!==this.inputRef.value&&(this.value=this.inputRef.value)}render(){return m(e(s,null,this.renderInputContainer()),this.host)}getCreditCardType(t){return R.filter((i=>i.pattern.test(t)))[0]}getMaskConfig(){return[{type:"custom",trigger:"input",strategy:()=>new y},{type:"custom",trigger:"blur",strategy:()=>new V(this.hideCardNumberOnBlur)}]}get host(){return h(this)}static get watchers(){return{validationRules:["watchValidationRules"],value:["watchValue"]}}};Z.register({visa:{icon:'<svg xmlns="http://www.w3.org/2000/svg" width="36" height="24" fill="none"><rect width="36" height="24" fill="#00579F" rx="2"/><path fill="#fff" d="M15.474 15.792h-1.979l1.238-7.653h1.979l-1.238 7.653ZM22.647 8.326A4.877 4.877 0 0 0 20.872 8c-1.954 0-3.33 1.042-3.339 2.532-.016 1.1.986 1.71 1.735 2.076.765.375 1.026.62 1.026.953-.008.513-.619.75-1.189.75-.79 0-1.213-.123-1.857-.408l-.26-.122-.277 1.718c.464.211 1.32.4 2.207.407 2.076 0 3.428-1.026 3.444-2.613.008-.872-.52-1.54-1.66-2.085-.693-.35-1.117-.586-1.117-.944.008-.326.359-.66 1.14-.66a3.362 3.362 0 0 1 1.474.293l.18.082.268-1.653ZM25.279 13.08l.79-2.14c-.008.016.162-.448.26-.733l.138.66s.375 1.831.457 2.214h-1.645ZM27.72 8.14h-1.53c-.472 0-.831.138-1.035.635l-2.94 7.018h2.077l.416-1.148h2.54c.057.269.237 1.148.237 1.148h1.832L27.72 8.14ZM11.842 8.139l-1.938 5.219-.212-1.059c-.358-1.221-1.482-2.548-2.736-3.208l1.775 6.693h2.093l3.11-7.645h-2.092Z"/><path fill="#FAA61A" d="M8.104 8.139H4.92l-.032.154c2.483.635 4.128 2.166 4.804 4.007L9 8.782c-.114-.489-.464-.627-.896-.643Z"/></svg>',autoSize:!0},mastercard:{icon:'<svg xmlns="http://www.w3.org/2000/svg" width="36" height="24" fill="none"><rect width="36" height="24" fill="#000" rx="2"/><path fill="#ED0006" fill-rule="evenodd" d="M18.25 17.157a6.75 6.75 0 0 1-4.426 1.649c-3.769 0-6.824-3.09-6.824-6.903C7 8.091 10.055 5 13.824 5a6.75 6.75 0 0 1 4.426 1.649A6.75 6.75 0 0 1 22.676 5c3.769 0 6.824 3.09 6.824 6.903 0 3.812-3.055 6.903-6.824 6.903a6.75 6.75 0 0 1-4.426-1.65Z" clip-rule="evenodd"/><path fill="#F9A000" fill-rule="evenodd" d="M18.25 17.157a6.92 6.92 0 0 0 2.398-5.254 6.92 6.92 0 0 0-2.398-5.254A6.75 6.75 0 0 1 22.676 5c3.769 0 6.824 3.09 6.824 6.903 0 3.812-3.055 6.903-6.824 6.903a6.75 6.75 0 0 1-4.426-1.65Z" clip-rule="evenodd"/><path fill="#FF5E00" fill-rule="evenodd" d="M18.25 6.65a6.92 6.92 0 0 1 2.398 5.253 6.92 6.92 0 0 1-2.398 5.254 6.92 6.92 0 0 1-2.398-5.254A6.92 6.92 0 0 1 18.25 6.65Z" clip-rule="evenodd"/></svg>',autoSize:!0},amex:{icon:'<svg xmlns="http://www.w3.org/2000/svg" width="36" height="24" fill="none"><g clip-path="url(#a)"><rect width="36" height="24" fill="#016FD0" rx="2"/><path fill="#fff" d="M6.99 18.549v-5.654h5.986l.643.838.663-.838h21.729v5.264s-.569.384-1.226.39H22.754l-.724-.891v.891h-2.373v-1.521s-.325.212-1.025.212h-.808v1.309h-3.593l-.641-.855-.651.855H6.99ZM0 8.634l1.35-3.147h2.334l.767 1.763V5.487h2.902l.456 1.274.442-1.274h13.027v.64s.685-.64 1.81-.64l4.227.015.753 1.74V5.487h2.428l.669 1v-1h2.45v5.654h-2.45l-.64-1.003v1.003h-3.569l-.359-.892h-.959l-.353.892h-2.42c-.968 0-1.587-.628-1.587-.628v.628H17.63l-.725-.892v.892H3.34l-.359-.892h-.956l-.356.892H0V8.634Z"/><path fill="#016FD0" d="M1.827 6.184.006 10.417h1.185l.336-.847H3.48l.335.847h1.211L3.207 6.184h-1.38Zm.673.985.596 1.482H1.903L2.5 7.169ZM5.151 10.416V6.183l1.685.006.98 2.73.956-2.736h1.671v4.233H9.385v-3.12l-1.122 3.12h-.928L6.21 7.296v3.12H5.15ZM11.168 10.416V6.183h3.454v.947h-2.384v.724h2.328v.891h-2.328v.752h2.384v.92h-3.454ZM15.233 6.184v4.233h1.059V8.913h.445l1.27 1.504H19.3l-1.393-1.56a1.29 1.29 0 0 0 1.161-1.3c0-.89-.7-1.373-1.48-1.373h-2.355Zm1.059.947h1.21c.29 0 .5.227.5.446 0 .28-.273.445-.485.445h-1.225v-.891ZM20.582 10.416h-1.08V6.183h1.08v4.233ZM23.144 10.416h-.233c-1.129 0-1.814-.889-1.814-2.1 0-1.24.678-2.133 2.103-2.133h1.17v1.003h-1.213c-.578 0-.988.451-.988 1.141 0 .82.468 1.165 1.142 1.165h.279l-.446.924ZM25.448 6.184l-1.82 4.233h1.185l.336-.847h1.953l.334.847h1.211l-1.819-4.233h-1.38Zm.674.985.595 1.482h-1.192l.597-1.482ZM28.77 10.416V6.183h1.345l1.718 2.66v-2.66h1.059v4.233H31.59l-1.762-2.73v2.73H28.77ZM7.715 17.825v-4.233h3.453v.947H8.784v.724h2.329v.89H8.784v.753h2.384v.919H7.715ZM24.636 17.825v-4.233h3.454v.947h-2.384v.724h2.317v.89h-2.317v.753h2.384v.919h-3.454ZM11.303 17.825l1.681-2.09-1.721-2.143h1.333l1.025 1.324 1.029-1.324h1.281l-1.699 2.116 1.685 2.117h-1.333l-.996-1.304-.971 1.304h-1.314ZM16.041 13.592v4.233h1.086v-1.337h1.114c.943 0 1.658-.5 1.658-1.472 0-.806-.56-1.424-1.52-1.424H16.04Zm1.086.957h1.174c.304 0 .522.187.522.488 0 .282-.217.487-.526.487h-1.17v-.975ZM20.359 13.592v4.233h1.058V16.32h.446l1.269 1.504h1.293l-1.393-1.56a1.29 1.29 0 0 0 1.162-1.3c0-.89-.7-1.373-1.48-1.373h-2.355Zm1.058.947h1.21c.29 0 .501.226.501.445 0 .281-.273.446-.486.446h-1.225v-.891ZM28.58 17.825v-.92H30.7c.313 0 .449-.169.449-.354 0-.178-.136-.358-.45-.358h-.957c-.831 0-1.295-.507-1.295-1.268 0-.679.424-1.333 1.66-1.333h2.062l-.446.952H29.94c-.341 0-.446.179-.446.35 0 .175.13.369.39.369h1.003c.927 0 1.33.526 1.33 1.215 0 .74-.449 1.347-1.38 1.347H28.58ZM32.464 17.825v-.92h2.118c.313 0 .45-.169.45-.354 0-.178-.136-.358-.45-.358h-.957c-.832 0-1.295-.507-1.295-1.268 0-.679.424-1.333 1.66-1.333h2.02l-.404.952h-1.783c-.34 0-.446.179-.446.35 0 .175.13.369.39.369h1.003c.927 0 1.33.526 1.33 1.215 0 .74-.449 1.347-1.38 1.347h-2.256Z"/></g><defs><clipPath id="a"><rect width="36" height="24" fill="#fff" rx="2"/></clipPath></defs></svg>',autoSize:!0},discover:{icon:'<svg xmlns="http://www.w3.org/2000/svg" width="36" height="24" fill="none"><rect width="36" height="24" fill="#232342" rx="2"/><path fill="#fff" fill-rule="evenodd" d="M30.686 9.61c1.086 0 1.684.484 1.684 1.398a1.307 1.307 0 0 1-1.087 1.397l1.467 1.988h-1.14l-1.25-1.935h-.109v1.935h-.924V9.61h1.359Zm-.435 2.204h.272c.597 0 .869-.269.869-.752 0-.43-.272-.699-.87-.699h-.27v1.45Zm-4.129 2.579h2.608v-.806h-1.684v-1.29h1.63v-.806h-1.63v-1.074h1.684V9.61h-2.608v4.781Zm-2.716-1.559-1.25-3.223h-.978l2.01 4.889h.49l2.01-4.89h-.978l-1.304 3.225Zm-11.029-.805c0 1.343 1.087 2.471 2.445 2.471.435 0 .815-.107 1.195-.269v-1.074c-.271.322-.652.537-1.086.537-.87 0-1.576-.645-1.576-1.504v-.108c-.054-.86.652-1.612 1.521-1.665.435 0 .87.215 1.141.537V9.879c-.326-.214-.76-.268-1.14-.268-1.413-.108-2.5 1.02-2.5 2.418Zm-1.684-.591c-.543-.215-.706-.323-.706-.591.054-.323.326-.591.652-.538.271 0 .543.162.76.376l.49-.644c-.381-.323-.87-.538-1.359-.538-.76-.053-1.412.538-1.467 1.29v.054c0 .644.272 1.02 1.141 1.289.217.054.435.161.652.269a.563.563 0 0 1 .272.483c0 .376-.326.699-.652.699h-.055c-.434 0-.814-.269-.977-.645l-.598.59c.326.592.978.914 1.63.914.869.054 1.575-.59 1.63-1.45v-.162c-.055-.644-.326-.967-1.413-1.396Zm-3.15 2.954h.923V9.611h-.924v4.781ZM3.25 9.611H4.88c1.304.054 2.336 1.128 2.282 2.418 0 .698-.326 1.343-.87 1.826-.488.376-1.086.591-1.684.538H3.25V9.61Zm1.195 3.976c.435.053.924-.108 1.25-.376.326-.323.489-.753.489-1.236 0-.43-.163-.86-.49-1.182-.325-.269-.814-.43-1.249-.376h-.271v3.17h.271Z" clip-rule="evenodd"/><path fill="#FD6020" fill-rule="evenodd" d="M18.788 9.5c-1.358 0-2.499 1.075-2.499 2.471 0 1.344 1.087 2.472 2.5 2.526 1.412.053 2.498-1.075 2.553-2.472C21.287 10.628 20.2 9.5 18.788 9.5Z" clip-rule="evenodd"/></svg>',autoSize:!0},"regular-credit-card":{icon:'<svg xmlns="http://www.w3.org/2000/svg" width="36" height="24" fill="none"><rect width="36" height="24" rx="2" fill=\'rgba(var(--v-regular-credit-card-bg, 205, 209, 211, 1))\'/><g clip-path="url(#a)"><path fill="rgba(var(--v-regular-credit-card-top, 252, 252, 252, 1))" d="M11 5c-1.103 0-2 .897-2 2v1h18V7c0-1.103-.897-2-2-2H11Zm16 6H9v6c0 1.103.897 2 2 2h14c1.103 0 2-.897 2-2v-6Zm-14.5 4h2c.275 0 .5.225.5.5s-.225.5-.5.5h-2a.501.501 0 0 1-.5-.5c0-.275.225-.5.5-.5Zm3.5.5c0-.275.225-.5.5-.5h4c.275 0 .5.225.5.5s-.225.5-.5.5h-4a.501.501 0 0 1-.5-.5Z"/></g><defs><clipPath id="a"><path d="M9 4h18v16H9z" fill=\'rgba(var(--v-regular-credit-card-bottom, 255, 255, 255, 1))\'/></clipPath></defs></svg>',autoSize:!0}}),H([u()],T.prototype,"globalSlimmers",void 0),H([v()],T.prototype,"formFieldController",void 0),H([v()],T.prototype,"changeEventEmitter",void 0),H([v()],T.prototype,"blurEventEmitter",void 0),H([v()],T.prototype,"focusEventEmitter",void 0),H([v()],T.prototype,"inputCreditCardEventPrevent",void 0),H([v()],T.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),T.style=":host{display:inline-block;width:100%;text-align:left;line-height:normal}";export{T as vega_input_credit_card}
|
|
1
|
+
import{r as t,c as i,h as e,H as s,g as h}from"./p-6b2342e0.js";import{F as r}from"./p-87a4d75f.js";import{V as a,M as l,A as o,D as c,i as p}from"./p-456f678b.js";import{R as n}from"./p-8bc15ed0.js";import{V as d}from"./p-12e8a1b2.js";import{s as m}from"./p-519a7d55.js";import{I as v}from"./p-6e1ab235.js";import{V as f,I as u}from"./p-8ce9e214.js";import{F as g}from"./p-56db3323.js";import{F as _}from"./p-cb378636.js";import{C as A}from"./p-2d0d575f.js";import{c as E}from"./p-66647244.js";import{C as M}from"./p-2c737fc8.js";import{D as I}from"./p-526e3634.js";import{d as j,M as w,L as D}from"./p-5447a8e8.js";import{V as Z}from"./p-6031bed1.js";import{S as C}from"./p-1ea9ad9a.js";import"./p-982747ef.js";import"./p-ed45b3b6.js";import"./p-d4ea8e22.js";import"./p-b438e68b.js";import"./p-874e5624.js";import"./p-abd7aeaa.js";import"./p-262ec334.js";import"./p-02841589.js";import"./p-331a62d5.js";import"./p-528748fa.js";import"./p-8b5d3a52.js";import"./p-6a334573.js";import"./p-4a2fe3a4.js";import"./p-f0e828d8.js";import"./p-b75ee3ba.js";import"./p-81dd00d0.js";import"./p-49a2e141.js";import"./p-71909102.js";import"./p-78a57a17.js";import"./p-52b8f2d2.js";import"./p-d27ae9ff.js";import"./p-c41a2d4a.js";import"./p-8c30a60d.js";import"./p-5f377954.js";import"./p-ffdc25ec.js";import"./p-afcd8f04.js";import"./p-ae2abdfa.js";const R=[{type:"visa",iconName:"visa",pattern:a,maskConfig:{type:"custom",options:{mask:"9999 9999 9999 9999 999",slot:"9",accept:/\d/,triggerAtInit:r.isEnabled("VEGA_INPUT_CREDIT_CARD.ENABLE_HIDE_NUMBER_MASK_ON_FIRST_LOAD")}}},{type:"mastercard",iconName:"mastercard",pattern:l,maskConfig:{type:"custom",options:{mask:"9999 9999 9999 9999",slot:"9",accept:/\d/,triggerAtInit:r.isEnabled("VEGA_INPUT_CREDIT_CARD.ENABLE_HIDE_NUMBER_MASK_ON_FIRST_LOAD")}}},{type:"amex",iconName:"amex",pattern:o,maskConfig:{type:"custom",options:{mask:"9999 999999 99999",slot:"9",accept:/\d/,triggerAtInit:r.isEnabled("VEGA_INPUT_CREDIT_CARD.ENABLE_HIDE_NUMBER_MASK_ON_FIRST_LOAD")}}},{type:"discover",iconName:"discover",pattern:c,maskConfig:{type:"custom",options:{mask:"9999 9999 9999 9999",slot:"9",accept:/\d/,triggerAtInit:r.isEnabled("VEGA_INPUT_CREDIT_CARD.ENABLE_HIDE_NUMBER_MASK_ON_FIRST_LOAD")}}}],N=[{payloadKey:"AUTO_VALIDATION_IS_TRUE",payloadDescription:"Determines whether the user's input in the credit card field should be automatically validated",payloadValue:t=>!0===t.autoValidation},{payloadKey:"AUTO_VALIDATION_IS_FALSE",payloadDescription:"Determines whether the user's input in the credit card field should be automatically validated",payloadValue:t=>!1===t.autoValidation}];class b extends C{calculateCaretPosition(t,i){if(!p(i))return null;if(this.getCreditCardMaskConfig(t)){if(t.length>this.getLengthLimit())return i-(t.length-this.getLengthLimit());const e=t.substring(0,i);return i+(this.format(e).length-e.length)}return i}format(t,i){const e=this.getCreditCardMaskConfig(t);if(e){this.setMaskConfig(e.options);const s=null==i?void 0:i.caretPosition;if(t.length>this.getLengthLimit()&&p(s)){const i=[...t],e=t.length-this.getLengthLimit();return i.splice(s-e,e),i.join("")}return this.replaceMaskWithMatchedInputSlots(t,this.getMatchedInputSlotValue(t))}return t}getCreditCardType(t){return R.filter((i=>i.pattern.test(t)))[0]}}class y extends b{constructor(){super({mask:"",slot:"9",accept:/\d/,triggerAtInit:r.isEnabled("VEGA_INPUT_CREDIT_CARD.ENABLE_HIDE_NUMBER_MASK_ON_FIRST_LOAD")})}getCreditCardMaskConfig(t){let i;const e=this.getCreditCardType(t);return e&&(i=e.maskConfig),i}}class V extends b{constructor(t){super({mask:"",slot:"9",accept:/[\d\s]/,insertMode:!1,triggerAtInit:r.isEnabled("VEGA_INPUT_CREDIT_CARD.ENABLE_HIDE_NUMBER_MASK_ON_FIRST_LOAD")}),this.hideCardNumberOnBlur=t}getCreditCardMaskConfig(t){let i;return this.getCreditCardType(t)&&this.hideCardNumberOnBlur&&t.trim().includes(" ")&&(i=this.generateDynamicMask(t)),i}generateDynamicMask(t){const i={type:"custom",options:{mask:"",slot:"9",accept:/[\d\s]/,insertMode:!1,triggerAtInit:r.isEnabled("VEGA_INPUT_CREDIT_CARD.ENABLE_HIDE_NUMBER_MASK_ON_FIRST_LOAD")},trigger:"blur"},e=t.trim().split(" "),s=e.map(((t,i)=>(i===e.length-1?"9":"X").repeat(t.length))).join(" ");return i.options.mask=s,i}}var H=function(t,i,e,s){var h,r=arguments.length,a=r<3?i:null===s?s=Object.getOwnPropertyDescriptor(i,e):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,i,e,s);else for(var l=t.length-1;l>=0;l--)(h=t[l])&&(a=(r<3?h(a):r>3?h(i,e,a):h(i,e))||a);return r>3&&a&&Object.defineProperty(i,e,a),a};const T=class{constructor(s){t(this,s),this.vegaChange=i(this,"vegaChange",7),this.change=i(this,"change",7),this.vegaBlur=i(this,"vegaBlur",7),this.blur=i(this,"blur",7),this.vegaFocus=i(this,"vegaFocus",7),this.focus=i(this,"focus",7),this.globalSlimmers={},this.formFieldController=new g({propertyRules:[{propertyName:"required",ruleFactory:t=>t?new n:null},{propertyName:"",ruleFactory:()=>new d}],validationRulesName:"validationRules",defaultValue:"",attributeGetter:t=>this[t],inputContainerGetter:()=>this.inputContainerGetter(),touchableAreaGetter:()=>this.touchableAreaGetter()}),this.changeEventEmitter=E(T,j),this.blurEventEmitter=E(T,w),this.focusEventEmitter=E(T,D),this.inputCreditCardEventPrevent=new M([j,D,w],(()=>this.host),!0),this.vegaComponentUsageRuntimeMetricsSlimmer=new f(N),this.required=!1,this.optional=!1,this.name="",this.disabled=!1,this.label="",this.hint="",this.size="default",this.placeholder="",this.hideCardNumberOnBlur=!0,this.autoValidation=!0,this.validationRules=[],this.isValid=null,this.value="",this.renderInputContainer=()=>{var t;const i=(null===(t=this.getCreditCardType(this.value))||void 0===t?void 0:t.iconName)||"regular-credit-card";return e("vega-input",{label:this.label,type:"number",prefixIcon:Z.getIconKey(i),maskConfig:this.getMaskConfig(),placeholder:this.placeholder,disabled:this.disabled,size:this.size,value:this.value,hint:this.hint,required:this.required,optional:this.optional,name:this.name,showClearIcon:!1,ref:t=>{this.inputRef=t,I.addUniqueObserverToNode(t,j,(t=>{this.handleVegaChange(t)})),I.addUniqueObserverToNode(t,w,(()=>{this.handleVegaBlur()})),I.addUniqueObserverToNode(t,D,(()=>{this.handleVegaFocus()}))},"data-aria-label":this.label||"Input credit card"})},this.handleVegaChange=t=>{this.value=t.detail},this.handleVegaBlur=()=>{this.blurEventEmitter.emit()},this.handleVegaFocus=()=>{this.focusEventEmitter.emit()},this.inputContainerGetter=()=>this.inputRef.shadowRoot.querySelector(".vega-input-container"),this.touchableAreaGetter=()=>Array.from(this.inputRef.shadowRoot.querySelectorAll("input"))}watchValidationRules(){}watchValue(t){this.changeEventEmitter.emit(t),A.notify(_,{host:this.host,detail:t})}componentDidLoad(){r.isEnabled("VEGA_INPUT_CREDIT_CARD.ENABLE_HIDE_NUMBER_MASK_ON_FIRST_LOAD")&&this.hideCardNumberOnBlur&&this.inputRef.value&&this.value!==this.inputRef.value&&(this.value=this.inputRef.value)}render(){return m(e(s,null,this.renderInputContainer()),this.host)}getCreditCardType(t){return R.filter((i=>i.pattern.test(t)))[0]}getMaskConfig(){return[{type:"custom",trigger:"input",strategy:()=>new y},{type:"custom",trigger:"blur",strategy:()=>new V(this.hideCardNumberOnBlur)}]}get host(){return h(this)}static get watchers(){return{validationRules:["watchValidationRules"],value:["watchValue"]}}};Z.register({visa:{icon:'<svg xmlns="http://www.w3.org/2000/svg" width="36" height="24" fill="none"><rect width="36" height="24" fill="#00579F" rx="2"/><path fill="#fff" d="M15.474 15.792h-1.979l1.238-7.653h1.979l-1.238 7.653ZM22.647 8.326A4.877 4.877 0 0 0 20.872 8c-1.954 0-3.33 1.042-3.339 2.532-.016 1.1.986 1.71 1.735 2.076.765.375 1.026.62 1.026.953-.008.513-.619.75-1.189.75-.79 0-1.213-.123-1.857-.408l-.26-.122-.277 1.718c.464.211 1.32.4 2.207.407 2.076 0 3.428-1.026 3.444-2.613.008-.872-.52-1.54-1.66-2.085-.693-.35-1.117-.586-1.117-.944.008-.326.359-.66 1.14-.66a3.362 3.362 0 0 1 1.474.293l.18.082.268-1.653ZM25.279 13.08l.79-2.14c-.008.016.162-.448.26-.733l.138.66s.375 1.831.457 2.214h-1.645ZM27.72 8.14h-1.53c-.472 0-.831.138-1.035.635l-2.94 7.018h2.077l.416-1.148h2.54c.057.269.237 1.148.237 1.148h1.832L27.72 8.14ZM11.842 8.139l-1.938 5.219-.212-1.059c-.358-1.221-1.482-2.548-2.736-3.208l1.775 6.693h2.093l3.11-7.645h-2.092Z"/><path fill="#FAA61A" d="M8.104 8.139H4.92l-.032.154c2.483.635 4.128 2.166 4.804 4.007L9 8.782c-.114-.489-.464-.627-.896-.643Z"/></svg>',autoSize:!0},mastercard:{icon:'<svg xmlns="http://www.w3.org/2000/svg" width="36" height="24" fill="none"><rect width="36" height="24" fill="#000" rx="2"/><path fill="#ED0006" fill-rule="evenodd" d="M18.25 17.157a6.75 6.75 0 0 1-4.426 1.649c-3.769 0-6.824-3.09-6.824-6.903C7 8.091 10.055 5 13.824 5a6.75 6.75 0 0 1 4.426 1.649A6.75 6.75 0 0 1 22.676 5c3.769 0 6.824 3.09 6.824 6.903 0 3.812-3.055 6.903-6.824 6.903a6.75 6.75 0 0 1-4.426-1.65Z" clip-rule="evenodd"/><path fill="#F9A000" fill-rule="evenodd" d="M18.25 17.157a6.92 6.92 0 0 0 2.398-5.254 6.92 6.92 0 0 0-2.398-5.254A6.75 6.75 0 0 1 22.676 5c3.769 0 6.824 3.09 6.824 6.903 0 3.812-3.055 6.903-6.824 6.903a6.75 6.75 0 0 1-4.426-1.65Z" clip-rule="evenodd"/><path fill="#FF5E00" fill-rule="evenodd" d="M18.25 6.65a6.92 6.92 0 0 1 2.398 5.253 6.92 6.92 0 0 1-2.398 5.254 6.92 6.92 0 0 1-2.398-5.254A6.92 6.92 0 0 1 18.25 6.65Z" clip-rule="evenodd"/></svg>',autoSize:!0},amex:{icon:'<svg xmlns="http://www.w3.org/2000/svg" width="36" height="24" fill="none"><g clip-path="url(#a)"><rect width="36" height="24" fill="#016FD0" rx="2"/><path fill="#fff" d="M6.99 18.549v-5.654h5.986l.643.838.663-.838h21.729v5.264s-.569.384-1.226.39H22.754l-.724-.891v.891h-2.373v-1.521s-.325.212-1.025.212h-.808v1.309h-3.593l-.641-.855-.651.855H6.99ZM0 8.634l1.35-3.147h2.334l.767 1.763V5.487h2.902l.456 1.274.442-1.274h13.027v.64s.685-.64 1.81-.64l4.227.015.753 1.74V5.487h2.428l.669 1v-1h2.45v5.654h-2.45l-.64-1.003v1.003h-3.569l-.359-.892h-.959l-.353.892h-2.42c-.968 0-1.587-.628-1.587-.628v.628H17.63l-.725-.892v.892H3.34l-.359-.892h-.956l-.356.892H0V8.634Z"/><path fill="#016FD0" d="M1.827 6.184.006 10.417h1.185l.336-.847H3.48l.335.847h1.211L3.207 6.184h-1.38Zm.673.985.596 1.482H1.903L2.5 7.169ZM5.151 10.416V6.183l1.685.006.98 2.73.956-2.736h1.671v4.233H9.385v-3.12l-1.122 3.12h-.928L6.21 7.296v3.12H5.15ZM11.168 10.416V6.183h3.454v.947h-2.384v.724h2.328v.891h-2.328v.752h2.384v.92h-3.454ZM15.233 6.184v4.233h1.059V8.913h.445l1.27 1.504H19.3l-1.393-1.56a1.29 1.29 0 0 0 1.161-1.3c0-.89-.7-1.373-1.48-1.373h-2.355Zm1.059.947h1.21c.29 0 .5.227.5.446 0 .28-.273.445-.485.445h-1.225v-.891ZM20.582 10.416h-1.08V6.183h1.08v4.233ZM23.144 10.416h-.233c-1.129 0-1.814-.889-1.814-2.1 0-1.24.678-2.133 2.103-2.133h1.17v1.003h-1.213c-.578 0-.988.451-.988 1.141 0 .82.468 1.165 1.142 1.165h.279l-.446.924ZM25.448 6.184l-1.82 4.233h1.185l.336-.847h1.953l.334.847h1.211l-1.819-4.233h-1.38Zm.674.985.595 1.482h-1.192l.597-1.482ZM28.77 10.416V6.183h1.345l1.718 2.66v-2.66h1.059v4.233H31.59l-1.762-2.73v2.73H28.77ZM7.715 17.825v-4.233h3.453v.947H8.784v.724h2.329v.89H8.784v.753h2.384v.919H7.715ZM24.636 17.825v-4.233h3.454v.947h-2.384v.724h2.317v.89h-2.317v.753h2.384v.919h-3.454ZM11.303 17.825l1.681-2.09-1.721-2.143h1.333l1.025 1.324 1.029-1.324h1.281l-1.699 2.116 1.685 2.117h-1.333l-.996-1.304-.971 1.304h-1.314ZM16.041 13.592v4.233h1.086v-1.337h1.114c.943 0 1.658-.5 1.658-1.472 0-.806-.56-1.424-1.52-1.424H16.04Zm1.086.957h1.174c.304 0 .522.187.522.488 0 .282-.217.487-.526.487h-1.17v-.975ZM20.359 13.592v4.233h1.058V16.32h.446l1.269 1.504h1.293l-1.393-1.56a1.29 1.29 0 0 0 1.162-1.3c0-.89-.7-1.373-1.48-1.373h-2.355Zm1.058.947h1.21c.29 0 .501.226.501.445 0 .281-.273.446-.486.446h-1.225v-.891ZM28.58 17.825v-.92H30.7c.313 0 .449-.169.449-.354 0-.178-.136-.358-.45-.358h-.957c-.831 0-1.295-.507-1.295-1.268 0-.679.424-1.333 1.66-1.333h2.062l-.446.952H29.94c-.341 0-.446.179-.446.35 0 .175.13.369.39.369h1.003c.927 0 1.33.526 1.33 1.215 0 .74-.449 1.347-1.38 1.347H28.58ZM32.464 17.825v-.92h2.118c.313 0 .45-.169.45-.354 0-.178-.136-.358-.45-.358h-.957c-.832 0-1.295-.507-1.295-1.268 0-.679.424-1.333 1.66-1.333h2.02l-.404.952h-1.783c-.34 0-.446.179-.446.35 0 .175.13.369.39.369h1.003c.927 0 1.33.526 1.33 1.215 0 .74-.449 1.347-1.38 1.347h-2.256Z"/></g><defs><clipPath id="a"><rect width="36" height="24" fill="#fff" rx="2"/></clipPath></defs></svg>',autoSize:!0},discover:{icon:'<svg xmlns="http://www.w3.org/2000/svg" width="36" height="24" fill="none"><rect width="36" height="24" fill="#232342" rx="2"/><path fill="#fff" fill-rule="evenodd" d="M30.686 9.61c1.086 0 1.684.484 1.684 1.398a1.307 1.307 0 0 1-1.087 1.397l1.467 1.988h-1.14l-1.25-1.935h-.109v1.935h-.924V9.61h1.359Zm-.435 2.204h.272c.597 0 .869-.269.869-.752 0-.43-.272-.699-.87-.699h-.27v1.45Zm-4.129 2.579h2.608v-.806h-1.684v-1.29h1.63v-.806h-1.63v-1.074h1.684V9.61h-2.608v4.781Zm-2.716-1.559-1.25-3.223h-.978l2.01 4.889h.49l2.01-4.89h-.978l-1.304 3.225Zm-11.029-.805c0 1.343 1.087 2.471 2.445 2.471.435 0 .815-.107 1.195-.269v-1.074c-.271.322-.652.537-1.086.537-.87 0-1.576-.645-1.576-1.504v-.108c-.054-.86.652-1.612 1.521-1.665.435 0 .87.215 1.141.537V9.879c-.326-.214-.76-.268-1.14-.268-1.413-.108-2.5 1.02-2.5 2.418Zm-1.684-.591c-.543-.215-.706-.323-.706-.591.054-.323.326-.591.652-.538.271 0 .543.162.76.376l.49-.644c-.381-.323-.87-.538-1.359-.538-.76-.053-1.412.538-1.467 1.29v.054c0 .644.272 1.02 1.141 1.289.217.054.435.161.652.269a.563.563 0 0 1 .272.483c0 .376-.326.699-.652.699h-.055c-.434 0-.814-.269-.977-.645l-.598.59c.326.592.978.914 1.63.914.869.054 1.575-.59 1.63-1.45v-.162c-.055-.644-.326-.967-1.413-1.396Zm-3.15 2.954h.923V9.611h-.924v4.781ZM3.25 9.611H4.88c1.304.054 2.336 1.128 2.282 2.418 0 .698-.326 1.343-.87 1.826-.488.376-1.086.591-1.684.538H3.25V9.61Zm1.195 3.976c.435.053.924-.108 1.25-.376.326-.323.489-.753.489-1.236 0-.43-.163-.86-.49-1.182-.325-.269-.814-.43-1.249-.376h-.271v3.17h.271Z" clip-rule="evenodd"/><path fill="#FD6020" fill-rule="evenodd" d="M18.788 9.5c-1.358 0-2.499 1.075-2.499 2.471 0 1.344 1.087 2.472 2.5 2.526 1.412.053 2.498-1.075 2.553-2.472C21.287 10.628 20.2 9.5 18.788 9.5Z" clip-rule="evenodd"/></svg>',autoSize:!0},"regular-credit-card":{icon:'<svg xmlns="http://www.w3.org/2000/svg" width="36" height="24" fill="none"><rect width="36" height="24" rx="2" fill=\'rgba(var(--v-regular-credit-card-bg, 205, 209, 211, 1))\'/><g clip-path="url(#a)"><path fill="rgba(var(--v-regular-credit-card-top, 252, 252, 252, 1))" d="M11 5c-1.103 0-2 .897-2 2v1h18V7c0-1.103-.897-2-2-2H11Zm16 6H9v6c0 1.103.897 2 2 2h14c1.103 0 2-.897 2-2v-6Zm-14.5 4h2c.275 0 .5.225.5.5s-.225.5-.5.5h-2a.501.501 0 0 1-.5-.5c0-.275.225-.5.5-.5Zm3.5.5c0-.275.225-.5.5-.5h4c.275 0 .5.225.5.5s-.225.5-.5.5h-4a.501.501 0 0 1-.5-.5Z"/></g><defs><clipPath id="a"><path d="M9 4h18v16H9z" fill=\'rgba(var(--v-regular-credit-card-bottom, 255, 255, 255, 1))\'/></clipPath></defs></svg>',autoSize:!0}}),H([u()],T.prototype,"globalSlimmers",void 0),H([v()],T.prototype,"formFieldController",void 0),H([v()],T.prototype,"changeEventEmitter",void 0),H([v()],T.prototype,"blurEventEmitter",void 0),H([v()],T.prototype,"focusEventEmitter",void 0),H([v()],T.prototype,"inputCreditCardEventPrevent",void 0),H([v()],T.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),T.style=":host{display:inline-block;width:100%;text-align:left;line-height:normal}";export{T as vega_input_credit_card}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as t,F as e,r as n,c as o,H as i,g as r}from"./p-6b2342e0.js";import{c as s,V as a,M as c,I as l}from"./p-6e1ab235.js";import{V as d,I as p}from"./p-8ce9e214.js";import{s as u}from"./p-519a7d55.js";import{V as h}from"./p-6031bed1.js";import{t as f}from"./p-aacf6920.js";import{D as v,d as b}from"./p-526e3634.js";import{d as g,a as m,r as y}from"./p-5447a8e8.js";import{a9 as x}from"./p-2bb60f89.js";import{a as C}from"./p-528748fa.js";import{C as w}from"./p-2d0d575f.js";import{z as j,y as k}from"./p-3a68b729.js";import{c as R}from"./p-66647244.js";import{d as O}from"./p-a841cf13.js";import{T as E}from"./p-cd69aeae.js";import{S,a as F,C as $}from"./p-dad7d2ac.js";import{A}from"./p-4d65756f.js";import{d as L}from"./p-1bc5b3bc.js";import{C as T}from"./p-2c737fc8.js";import{c as D}from"./p-890a5254.js";import{C as P}from"./p-2bb5a232.js";import"./p-ffdc25ec.js";import"./p-afcd8f04.js";import"./p-6a334573.js";import"./p-8b5d3a52.js";import"./p-331a62d5.js";import"./p-02841589.js";import"./p-456f678b.js";import"./p-ed45b3b6.js";import"./p-d4ea8e22.js";import"./p-b438e68b.js";import"./p-874e5624.js";import"./p-cb378636.js";import"./p-3e09aeed.js";import"./p-fb5ea4b2.js";import"./p-4866e390.js";import"./p-b75ee3ba.js";import"./p-f0e828d8.js";import"./p-8c30a60d.js";import"./p-09524fec.js";import"./p-d609c3fd.js";import"./p-6c95a6a3.js";import"./p-1fb56e14.js";import"./p-5f377954.js";import"./p-87a4d75f.js";import"./p-982747ef.js";var N=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};class z extends a{constructor(){super(...arguments),this.languageDropdownProps={searchable:!1},this.languageOptions=Object.keys(x).map((t=>({id:x[t],displayName:t}))),this.handleLanguageChange=t=>{v.addUniqueObserverToNode(t,g,(t=>{var e;this.valueController.updateValue(null===(e=this.value)||void 0===e?void 0:e.code,t.detail)}))},this.handleDeleteClick=t=>{v.addUniqueObserverToNode(t,m,(()=>{this.removeEventEmitter.emit().defaultPrevented||this.host.remove()}))}}getToolbarContainerRef(){return this.toolbarContainerRef}render(){return t(e,null,t("div",{part:"editor-toolbar",contenteditable:!1,class:{"editor-toolbar":!this.readOnly,"copy-button-container":this.showCopyButton&&this.readOnly},ref:t=>this.toolbarContainerRef=t},this.renderEditorToolbar(),this.copyButtonRenderer.render()),this.contentRenderer.render())}renderEditorToolbar(){var n,o;if(!this.readOnly)return t(e,null,t("vega-input-select",{source:this.languageOptions,value:null!==(o=null===(n=this.value)||void 0===n?void 0:n.language)&&void 0!==o?o:"",disabled:this.disabled,placeholder:this.translationSlimmer.t("Select Language"),size:"small",vegaDropdownProps:this.languageDropdownProps,exportparts:"select-container, selected-box, placeholder, toggle-icon-container, toggle-icon",ref:this.handleLanguageChange}),t("vega-button-circle",{key:"delete-button",disabled:this.disabled,label:this.translationSlimmer.t("Delete Code"),icon:h.getIconKey("trash-can"),iconColor:"text-secondary",variant:"icon-only",size:"extra-small",ref:this.handleDeleteClick}))}}h.register({"trash-can":f}),N([s()],z.prototype,"readOnly",void 0),N([s()],z.prototype,"host",void 0),N([s()],z.prototype,"disabled",void 0),N([s()],z.prototype,"showCopyButton",void 0),N([s()],z.prototype,"value",void 0),N([s()],z.prototype,"contentRenderer",void 0),N([s()],z.prototype,"valueController",void 0),N([s()],z.prototype,"removeEventEmitter",void 0),N([s()],z.prototype,"translationSlimmer",void 0),N([s()],z.prototype,"copyButtonRenderer",void 0);var B=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};class _ extends a{constructor(){super(...arguments),this.handleFocus=()=>{this.readOnly||this.disabled||this.host.classList.add("focus")},this.handleBlur=()=>{this.host.classList.remove("focus"),w.notify(b.getSubject(this.host,j),null)}}getCodeContentContainerRef(){return this.codeContentContainerRef}registerEventListener(){this.codeContentContainerRef&&(this.codeContentContainerRef.addEventListener("focusin",this.handleFocus),this.codeContentContainerRef.addEventListener("focusout",this.handleBlur))}unregisterEventListener(){this.codeContentContainerRef&&(this.codeContentContainerRef.removeEventListener("focusin",this.handleFocus),this.codeContentContainerRef.removeEventListener("focusout",this.handleBlur))}render(){var n;const o=this.contentParseController.parseCode(),i=(null===(n=this.value)||void 0===n?void 0:n.language)||"";return t(e,null,t("style",null,this.getLineNumberStyleVariable(o)),t("code",{role:"textbox",tabIndex:0,spellcheck:!1,ref:t=>this.codeContentContainerRef=t,contenteditable:!this.readOnly&&!this.disabled,"data-language":i,innerHTML:o.map((t=>this.renderCodeNode(t))).join("")}))}renderCodeNode(t){const{key:e,className:n,mark:o,text:i}=t;return`<span key='${e}' class='${n}' data-mark='${o}' data-index='${e}'>${i}</span>`}getLineNumberStyleVariable(t){const e=10*(t.filter((t=>"\n"===t.text)).length+1).toString().length;return`code{--v-code-line-number-width:${e}px;--v-code-line-number-ml:-${e+16}px;--v-code-block-pl:${e+16}px}`}}B([s()],_.prototype,"host",void 0),B([s()],_.prototype,"readOnly",void 0),B([s()],_.prototype,"disabled",void 0),B([s()],_.prototype,"value",void 0),B([s()],_.prototype,"contentParseController",void 0),B([c("componentDidLoad")],_.prototype,"registerEventListener",null),B([c("disconnectedCallback")],_.prototype,"unregisterEventListener",null);var I=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};class H extends a{updateValue(t,e,n){this.value&&this.value.code===t&&this.value.language===e||(this.value={language:e,code:t},this.changeEventEmitter.emit(this.value),n&&n.recordHistory&&this.historyController.registerHistory({value:this.value,offset:n.offset}))}initialValue(){this.value||(this.value={code:"",language:"plainText"})}}I([s({writable:!0})],H.prototype,"value",void 0),I([s()],H.prototype,"changeEventEmitter",void 0),I([s()],H.prototype,"historyController",void 0),I([c("connectedCallback")],H.prototype,"initialValue",null);var M=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};class V extends a{constructor(){super(...arguments),this.codeNodes=[]}getCurrentCodeNodes(){return this.codeNodes}parseCode(){const t=[this.prismCodeHighlightParser,this.defaultCodeHighlightParser];let e=[];for(const n of t)if(n.canParse()){e=n.parse();break}return this.codeNodes=e,e}}M([s()],V.prototype,"prismCodeHighlightParser",void 0),M([s()],V.prototype,"defaultCodeHighlightParser",void 0);class Z{constructor(t){this.contentOffset=0,this.selectedText="",this.codeContainerRef=t}updateRange(t,e,n,o=""){const i=new Z(this.codeContainerRef);return i.selectedText=o,i.contentOffset=i.getContentOffset(t,e,n),i}updateContentOffset(t){return this.contentOffset=Math.max(0,t),this.selectedText="",this.contentOffset}createNativeRange(t){const{nodeIndex:e,offset:n}=this.getFocusNodeState(t,this.contentOffset),o=new Range,i=this.codeContainerRef.querySelector(`span[data-index="${e}"]`);if(i){const t=Math.min(i.firstChild.textContent.length,n);return o.setStart(i.firstChild,t),o.setEnd(i.firstChild,t),o}}getContentOffset(t,e,n){let o=t.nodeType===Node.TEXT_NODE?t.parentElement:t;if("CODE"===o.nodeName&&o.childNodes&&o.childNodes.length&&(o=o.childNodes[Math.min(e,o.childNodes.length-1)],e=0),o&&o.hasAttribute("data-index")){const t=Number(o.dataset.index);let i="";for(let e=0;e<t;e++)i+=n[e].text;return i.length+e}return 0}getFocusNodeState(t,e){const n=this.getCodeContent(t),o={nodeIndex:0,offset:0};if(!n||e>=n.length)o.nodeIndex=t.length-1,o.offset=t[o.nodeIndex].text.length;else{let n="";for(let i=0;i<t.length;i++)if(n+=t[i].text,n.length>=e){o.offset=Math.max(0,t[i].text.length-(n.length-e)),o.nodeIndex=i;break}}return"\n"===t[o.nodeIndex].text&&o.offset>0&&t[o.nodeIndex+1]&&(o.nodeIndex+=1,o.offset=0),o}getCodeContent(t){return t.map((t=>t.text)).join("")}}var U=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};class Y extends A{constructor(){super(1),this.handleSelectionWithDebounce=L(this.handleSelectionChange,Y.SELECTION_CHANGE_DEBOUNCE_TIME,this),this.doTask=async()=>{await Promise.resolve();const t=this.getSelection(),e=this.codeBlockRange.createNativeRange(this.contentParseController.getCurrentCodeNodes());t&&e&&(t.removeAllRanges(),t.addRange(e))}}getCurrentRange(){return this.codeBlockRange}setNextCodeBlockRange(t,e=!1){this.codeBlockRange.updateContentOffset(t),super.enqueueTheTaskIntoQueue(e)}addSelectionChangeEventListener(){this.codeBlockRange=new Z(this.contentRenderer.getCodeContentContainerRef()),document.addEventListener("selectionchange",this.handleSelectionWithDebounce)}removeSelectionChangeEventListener(){document.removeEventListener("selectionchange",this.handleSelectionWithDebounce)}getSelection(){return S.getSelection(this.host.shadowRoot)}handleSelectionChange(){const t=this.getSelection();t&&t.rangeCount>0?(this.syncCodeRangeByNativeRange(),w.notify(b.getSubject(this.host,k),{detail:!0})):w.notify(b.getSubject(this.host,k),{detail:!1})}syncCodeRangeByNativeRange(){const t=this.getSelection();if(this.isCodeBlockActive()&&0===this.autoRunTaskQueue.queue.length&&!this.insertCompositionTextController.isComposing()){const e=t.getRangeAt(0),{startContainer:n,startOffset:o}=e;this.codeBlockRange=this.codeBlockRange.updateRange(n,o,this.contentParseController.getCurrentCodeNodes(),e.toString())}}isCodeBlockActive(){return this.host&&this.host.classList.contains("focus")}}Y.SELECTION_CHANGE_DEBOUNCE_TIME=Math.min(F.SELECTION_CHANGE_DEBOUNCE_TIME,40),U([s()],Y.prototype,"host",void 0),U([s()],Y.prototype,"contentRenderer",void 0),U([s()],Y.prototype,"contentParseController",void 0),U([s()],Y.prototype,"insertCompositionTextController",void 0),U([c("componentDidLoad")],Y.prototype,"addSelectionChangeEventListener",null),U([c("disconnectedCallback")],Y.prototype,"removeSelectionChangeEventListener",null);class G extends a{deleteSelectedText(t,e,n){return n>=t.length?"":t.slice(0,e)+t.slice(e+n)}getCodeNodesContent(t){return t.map((t=>t.text)).join("")}stopEventPropagation(t){t&&"function"==typeof t.stopPropagation&&t.stopPropagation()}reCalculateRangeAndContent(t,e,n){let o=t.contentOffset,i=e;return t&&(t.selectedText.length&&(i=this.deleteSelectedText(i,t.contentOffset,t.selectedText.length)),i=i.slice(0,t.contentOffset)+n+i.slice(t.contentOffset),o=t.contentOffset+n.length),{nextOffset:o,updatedContent:i}}}var q=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};class W extends G{constructor(){super(...arguments),this.handleInputEvent=t=>{this.stopEventPropagation(t),this.updateCodeContent()},this.handleBeforeInput=t=>{switch(t.stopPropagation(),t.inputType){case"deleteContentBackward":return void(this.value&&this.value.code&&""!==this.value.code?this.handleDeleteAction(t):t.preventDefault());case"historyUndo":case"historyRedo":return void t.preventDefault()}this.updateCodeBlockRange(t)}}registerInputEvent(){const t=this.contentRenderer.getCodeContentContainerRef();t&&(t.addEventListener("beforeinput",this.handleBeforeInput),t.addEventListener("input",this.handleInputEvent))}unregisterEventListener(){const t=this.contentRenderer.getCodeContentContainerRef();t&&(t.removeEventListener("beforeinput",this.handleBeforeInput),t.removeEventListener("input",this.handleInputEvent))}handleDeleteAction(t){const e=this.selectionController.getCurrentRange();if(e){t.preventDefault();const n=e.contentOffset,o=this.contentParseController.getCurrentCodeNodes();let i=this.getCodeNodesContent(o),r=n;e.selectedText.length?i=this.deleteSelectedText(i,n,e.selectedText.length):n>0&&(i=i.slice(0,n-1)+i.slice(n),r-=1),this.selectionController.setNextCodeBlockRange(r),this.valueController.updateValue(i,this.value.language,{recordHistory:!0,offset:r})}}updateCodeBlockRange(t){const e=this.selectionController.getCurrentRange();!this.insertCompositionTextController.isComposing()&&e&&this.selectionController.setNextCodeBlockRange(e.contentOffset+this.getInsertDataLength(t))}getInsertDataLength(t){const{data:e,inputType:n}=t;switch(n){case"insertText":return e.length;case"insertParagraph":case"insertLineBreak":return 1;default:return 0}}updateCodeContent(){var t;if(!this.insertCompositionTextController.isComposing()){let e=this.contentRenderer.getCodeContentContainerRef().innerText;this.isInsertLineBreakInLowVersionFirefox(e)&&(e+="\n"),this.valueController.updateValue(e,null===(t=this.value)||void 0===t?void 0:t.language,{recordHistory:!0,offset:this.selectionController.getCurrentRange().contentOffset})}}isInsertLineBreakInLowVersionFirefox(t){var e;const n=(null===(e=this.value)||void 0===e?void 0:e.code)||"";return!n.endsWith("\n")&&t===n+"\n"}}q([s()],W.prototype,"selectionController",void 0),q([s()],W.prototype,"contentRenderer",void 0),q([s()],W.prototype,"valueController",void 0),q([s()],W.prototype,"contentParseController",void 0),q([s()],W.prototype,"insertCompositionTextController",void 0),q([s()],W.prototype,"value",void 0),q([c("componentDidLoad")],W.prototype,"registerInputEvent",null),q([c("disconnectedCallback")],W.prototype,"unregisterEventListener",null);var X=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};class J extends a{focusAndUpdateSelection(){if(!this.disabled&&!this.readOnly){const t=this.contentRenderer.getCodeContentContainerRef();t&&(t.focus(),this.selectionController.setNextCodeBlockRange(this.value&&this.value.code&&" "!==this.value.code?this.value.code.length:0,!0))}}removeFocusAfterDisabled(){(this.disabled||this.readOnly)&&this.host.classList.remove("focus")}}X([s()],J.prototype,"host",void 0),X([s()],J.prototype,"value",void 0),X([s()],J.prototype,"readOnly",void 0),X([s()],J.prototype,"disabled",void 0),X([s()],J.prototype,"contentRenderer",void 0),X([s()],J.prototype,"selectionController",void 0),X([c("doFocus")],J.prototype,"focusAndUpdateSelection",null),X([c("watchEditableChange")],J.prototype,"removeFocusAfterDisabled",null);var K=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};class Q extends a{constructor(){super(...arguments),this.handleCopyClick=t=>{v.addUniqueObserverToNode(t,m,(async()=>{var e;const n=(null===(e=this.value)||void 0===e?void 0:e.code)||"";if(n&&globalThis.navigator&&globalThis.navigator.clipboard){clearTimeout(this.updateLabelTimer),await globalThis.navigator.clipboard.writeText(n);const e=this.translationSlimmer.t("Copy Code");t.label=this.translationSlimmer.t("Copied"),this.updateLabelTimer=setTimeout((()=>{t&&(t.label=e)}),Q.RESET_TOOLTIP_TIME)}}))}}render(){if(this.showCopyButton&&this.readOnly)return t("vega-button-circle",{key:"copy-button",label:this.translationSlimmer.t("Copy Code"),class:"copy-code-button",icon:h.getIconKey("copy"),iconColor:"text-secondary",variant:"icon-only",size:"extra-small",ref:this.handleCopyClick})}}function tt(t,e){if(!t||!e)return[t];const n=[t];return function(t,e){const n=[],o=[];for(const t of Object.keys(e)){const i=e[t],r=Array.isArray(i)?i:[i];for(const e of r)e.greedy?n.push({tokenType:t,patternDef:e}):o.push({tokenType:t,patternDef:e})}n.length>0&&function(t,e){for(let n=0;n<t.length;n++){const o=t[n];if("string"!=typeof o)continue;const i=o;let r=i;const s=[];for(const{tokenType:t,patternDef:n}of e){const{pattern:e,lookbehind:o,inside:a}=n,c=new RegExp(e.source,e.flags.replace(/g/g,"")+"g");let l;for(;null!==(l=c.exec(r));){let e=l.index,n=l[0];if(0===n.length){c.lastIndex++;continue}if(-1!==n.indexOf("\0GREEDY_PLACEHOLDER\0"))continue;if(o&&l[1]){const t=l[1].length;e+=t,n=n.slice(t)}const d=e+n.length;s.push({tokenType:t,matchStart:e,matchEnd:d,matchText:i.slice(e,d),inside:a}),r=r.slice(0,e)+"\0GREEDY_PLACEHOLDER\0".repeat(n.length).slice(0,n.length)+r.slice(d)}}if(0===s.length)continue;s.sort(((t,e)=>t.matchStart-e.matchStart));const a=[];let c=0;for(const t of s){t.matchStart>c&&a.push(i.slice(c,t.matchStart));let e=t.matchText;if(t.inside){const n=tt(t.matchText,t.inside);e=1===n.length?n[0]:n}a.push({type:t.tokenType,content:e}),c=t.matchEnd}c<i.length&&a.push(i.slice(c)),t.splice(n,1,...a),n+=a.length-1}}(t,n);for(const{tokenType:e,patternDef:n}of o)et(t,e,n)}(n,e),n}function et(t,e,n){for(let o=0;o<t.length;o++){const i=t[o];if("string"!=typeof i)continue;const r=nt(i,e,n);1===r.length&&"string"==typeof r[0]||(t.splice(o,1,...r),o+=r.length-1)}}function nt(t,e,n){const{pattern:o,lookbehind:i,inside:r}=n,s=new RegExp(o.source,o.flags.replace(/g/g,"")+"g"),a=[];let c,l=0;for(;null!==(c=s.exec(t));){let n=c.index,o=c[0];if(0===o.length){s.lastIndex++;continue}if(i&&c[1]){const t=c[1].length;n+=t,o=o.slice(t)}n>l&&a.push(t.slice(l,n));let d=o;if(r){const t=tt(o,r);d=1===t.length?t[0]:t}a.push({type:e,content:d}),l=n+o.length}return l<t.length&&a.push(t.slice(l)),0===a.length?[t]:a}h.register({copy:D}),Q.RESET_TOOLTIP_TIME=1e3,K([s()],Q.prototype,"value",void 0),K([s()],Q.prototype,"readOnly",void 0),K([s()],Q.prototype,"showCopyButton",void 0),K([s()],Q.prototype,"translationSlimmer",void 0);const ot={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"']|"[^"]*"|'[^']*')+(?:>|$)/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0},punctuation:{pattern:/^<!|>$|[[\]]/},"doctype-tag":{pattern:/^DOCTYPE/i},name:{pattern:/[^\s<>'"/]+/},string:{pattern:/("|')[\s\S]*?\1/,greedy:!0}}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>/=$<%]+(?:\s(?:\s*[^\s>/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>/]+/,inside:{punctuation:{pattern:/^<\/?/},namespace:{pattern:/^[^\s>/:]+:/}}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:{pattern:/\/?>/},"attr-name":{pattern:/[^\s>/]+/,inside:{namespace:{pattern:/^[^\s>/:]+:/}}}}},entity:[{pattern:/&[\da-z]{1,8};/i},{pattern:/&#x?[\da-f]{1,8};/i}]},it={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:[{pattern:/(["'])(?:\\[\s\S]|(?!\1)[^\\\r\n])*\1/,greedy:!0}],"template-string":{pattern:/`(?:\\[\s\S]|[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/},interpolation:{pattern:/\$\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})*\}/,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/}}},string:{pattern:/[\s\S]+/}}},regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[.\r\n,;:})\]]|\/\/))/,lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0},"regex-delimiter":{pattern:/^\/|\/$/},"regex-flags":{pattern:/^[a-z]+$/}}},"class-name":[{pattern:/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,lookbehind:!0,inside:{punctuation:{pattern:/[.\\]/}}}],keyword:[{pattern:/\b(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/}],boolean:{pattern:/\b(?:false|true)\b/},number:{pattern:/\b(?:(?:0[xX][\dA-Fa-f](?:_[\dA-Fa-f])*|0[bB][01](?:_[01])*|0[oO][0-7](?:_[0-7])*)n?|(?:\d(?:_\d)*\.?\d*|\.\d+)(?:[Ee][+-]?\d(?:_\d)*)?n?|NaN|Infinity)\b/},function:{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/},operator:{pattern:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%|&^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/},punctuation:{pattern:/[{}[\];(),.:]/},constant:{pattern:/\b[A-Z](?:[A-Z_]|\dx)*\b/}};const{function:rt,punctuation:st}=it,at=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(t);i<o.length;i++)e.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(t,o[i])&&(n[o[i]]=t[o[i]])}return n}(it,["keyword","function","operator","punctuation"]),ct=Object.assign(Object.assign({},at),{"class-name":[{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:{punctuation:{pattern:/[<>.,]/}}}],builtin:{pattern:/\b(?:Array|Boolean|Date|Function|Map|Number|Object|Promise|RegExp|Set|String|WeakMap|WeakSet|bigint|boolean|never|null|number|string|symbol|undefined|unknown|void)\b/},keyword:[{pattern:/\b(?:abstract|as|asserts|async|await|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|infer|instanceof|interface|is|keyof|let|module|namespace|new|null|of|package|private|protected|public|readonly|return|require|set|static|super|switch|this|throw|try|type|typeof|undefined|var|void|while|with|yield)\b/}],function:rt,"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:{pattern:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/},generic:{pattern:/<[\s\S]+/,inside:{punctuation:{pattern:/[<>(),.]/},keyword:{pattern:/\b(?:extends|infer|keyof)\b/},builtin:{pattern:/\b(?:boolean|never|null|number|string|symbol|undefined|unknown|void)\b/}}}}},operator:{pattern:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%|&^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]|!(?=\s*[^=])/},punctuation:st}),lt=Object.assign(Object.assign({tag:{pattern:/<\/?(?:[\w.:-]+(?:\s+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])+\}))?|\{\.{3}[a-z_$][\w$]*(?:\.[\w$]+)*\}))*\s*\/?)?>/i,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>/]*/,inside:{punctuation:{pattern:/^<\/?/},namespace:{pattern:/^[^\s>/:]+:/}}},"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])+\})/,inside:{punctuation:[{pattern:/^=/},{pattern:/^(\s*)["'{]|[}"']$/,lookbehind:!0}],script:{pattern:/[\s\S]+/,inside:it}}},spread:{pattern:/\{\.{3}[a-z_$][\w$]*(?:\.[\w$]+)*\}/,inside:{punctuation:{pattern:/^\{\.{3}|\}$/},"attr-name":{pattern:/[\s\S]+/}}},"attr-name":{pattern:/[^\s>/]+/,inside:{namespace:{pattern:/^[^\s>/:]+:/}}},punctuation:{pattern:/\/?>/}}}},it),{entity:ot.entity}),dt={css:{comment:{pattern:/\/\*[\s\S]*?\*\//,greedy:!0},string:{pattern:/("|')(?:\\[\s\S]|(?!\1)[^\\\n\r])*\1/,greedy:!0},atrule:[{pattern:/@[\w-](?:[^;{\s]|\s+(?![\s{]))*(?:;|(?=\s*\{))/,inside:{rule:{pattern:/^@[\w-]+/},"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0},punctuation:{pattern:/[;:(){}]/}}}],url:{pattern:/\burl\((?:("|')(?:\\[\s\S]|(?!\1)[^\\\n\r])*\1|(?:[^\\\r\n()"']|\\[\s\S])*)\)/i,greedy:!0,inside:{function:{pattern:/^url/i},punctuation:{pattern:/^\(|\)$/},string:{pattern:/^("|')[\s\S]+(?=\1$)/,lookbehind:!0}}},selector:{pattern:/(?=\S)[^@;{}()]?(?:[^@;{}()\s]|\s+(?![\s{])|\((?:[^()]|\([^()]*\))*\))*(?=\s*\{)/,inside:{"pseudo-element":{pattern:/(?:::)[\w-]+/},"pseudo-class":{pattern:/(?::)[\w-]+/},class:{pattern:/\.[\w-]+/},id:{pattern:/#[\w-]+/},attribute:{pattern:/\[(?:[^[\]"']|("|')(?:\\[\s\S]|(?!\1)[^\\\n\r])*\1)*\]/,greedy:!0,inside:{punctuation:{pattern:/^\[|\]$/},"attr-name":{pattern:/^(\s*)(?:(?!\s)[-\w\u00B7\u00C0-\u024F])+/i,lookbehind:!0},"attr-value":[{pattern:/(=\s*)(?:"[^"]*"|'[^']*'|[^\s'"=]+)/,lookbehind:!0}],operator:{pattern:/[|~*^$]?=/}}}}},property:{pattern:/(?!\s)[-_a-z\u00B7\u00C0-\u024F][-\w\u00B7\u00C0-\u024F]*(?=\s*:)/i},important:{pattern:/!important\b/i},function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},number:{pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?/i,lookbehind:!0},unit:{pattern:/(\b\d+)(?:%|[a-z]+)/,lookbehind:!0},punctuation:{pattern:/[(){};:,]/},operator:{pattern:/[+\-*/=><~^|]+/}},html:ot,markup:ot,javascript:it,js:it,typescript:ct,ts:ct,jsx:lt,tsx:Object.assign(Object.assign({tag:lt.tag},ct),{entity:lt.entity}),c:it,clike:it};const pt=Object.values(x);class ut extends a{splitTag(t){if(!this.hasSpecialCharacter(t)||t.length<2)return[t];{const e=[],n=t.split("");let o=0;return n.forEach((t=>{"<"===t||">"===t||"/"===t?(e.push(t),o=e.length):e[o]=e[o]?e[o]+t:t})),e}}isHighlightLanguage(t){return"plainText"!==t&&pt.includes(t)}markLineNumberNodes(t){0===t.length&&t.push({text:"\n",key:"0",className:""});let e=0;return t.map(((n,o)=>{let i=n.className;return 0!==o&&"\n"!==t[o-1].text||(e++,i=`v-code-line-number ${n.className}`),{text:n.text,key:`${o}`,className:i,mark:`${e}`}}))}hasSpecialCharacter(t){return/[<|>|\\/]/.test(t)}}!function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);r>3&&s&&Object.defineProperty(e,n,s)}([s()],ut.prototype,"value",void 0);class ht extends ut{canParse(){const{code:t,language:e}=this.value||{code:""};return t&&e&&this.isHighlightLanguage(e)}parse(){const{code:t,language:e}=this.value;let n=[];const o=tt(t,function(t){return dt[t]}(e));return n=this.getHighlightNodes(o),this.markLineNumberNodes(n)}getHighlightNodes(t,e){const n=[];for(const o of t)if("string"==typeof o){const t=o.split(/(\n|\t)/),i=t.length;for(let o=0;o<i;o++){const i=t[o];if(i){const t=this.splitTag(i);n.push(...t.map((t=>this.createCodeNode(t,e))))}}}else{const{content:t}=o;"string"==typeof t?n.push(...this.getHighlightNodes([t],o.type)):Array.isArray(t)&&n.push(...this.getHighlightNodes(t,o.type))}return n}createCodeNode(t,e){return{text:t,key:"",className:`token ${e||""}`,mark:""}}}class ft extends ut{canParse(){const{code:t,language:e}=this.value||{code:""};return!t||!e||"plainText"===e||!this.isHighlightLanguage(e)}parse(){var t,e;const n=(null!==(e=null===(t=this.value)||void 0===t?void 0:t.code)&&void 0!==e?e:"").split(/(\n)/);let o=[];return n.forEach((t=>{if(t){const e=this.splitTag(t);o.push(...e.map((t=>({text:t,key:"",className:""}))))}})),o=this.markLineNumberNodes(o),o}}var vt=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};class bt extends a{constructor(){super(...arguments),this.insertCompositionTextEndFlag=!0,this.handleCompositionStart=t=>{this.insertCompositionTextEndFlag=!1,this.stopEventPropagation(t)},this.handleCompositionEnd=t=>{var e;this.insertCompositionTextEndFlag=!0,this.stopEventPropagation(t);const n=this.selectionController.getCurrentRange();n&&this.selectionController.setNextCodeBlockRange(n.contentOffset+t.data.length);const o=this.contentRenderer.getCodeContentContainerRef().innerText;this.valueController.updateValue(o,null===(e=this.value)||void 0===e?void 0:e.language)}}isComposing(){return!this.insertCompositionTextEndFlag}registerInputEvent(){const t=this.contentRenderer.getCodeContentContainerRef();t&&(t.addEventListener("compositionstart",this.handleCompositionStart),t.addEventListener("compositionend",this.handleCompositionEnd))}unregisterEventListener(){const t=this.contentRenderer.getCodeContentContainerRef();t&&(t.removeEventListener("compositionstart",this.handleCompositionStart),t.removeEventListener("compositionend",this.handleCompositionEnd))}stopEventPropagation(t){t.stopPropagation()}}vt([s()],bt.prototype,"selectionController",void 0),vt([s()],bt.prototype,"contentRenderer",void 0),vt([s()],bt.prototype,"valueController",void 0),vt([s()],bt.prototype,"contentParseController",void 0),vt([s()],bt.prototype,"value",void 0),vt([c("componentDidLoad")],bt.prototype,"registerInputEvent",null),vt([c("disconnectedCallback")],bt.prototype,"unregisterEventListener",null);var gt=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};class mt extends ${constructor(){super(...arguments),this.getEffectiveTargets=()=>[this.contentRenderer.getCodeContentContainerRef()]}async undo(){if(this.undoStack.length>1){const t=this.undoStack.pop();this.redoStack.push(t);const e=this.undoStack[this.undoStack.length-1];e&&await this.restoreState(e)}}async redo(){const t=this.redoStack.pop();this.undoStack.push(t),await this.restoreState(t)}initialHistory(){this.registerHistory({value:this.value,offset:this.value.code.length},!0)}getIneffectiveTargets(){return[]}async restoreState(t){const{value:e,offset:n}=t;this.selectionController.setNextCodeBlockRange(n),this.valueController.updateValue(e.code,e.language)}}gt([s()],mt.prototype,"contentRenderer",void 0),gt([s()],mt.prototype,"value",void 0),gt([s()],mt.prototype,"valueController",void 0),gt([s()],mt.prototype,"selectionController",void 0),gt([c("componentDidLoad")],mt.prototype,"initialHistory",null);var yt=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};class xt extends G{constructor(){super(...arguments),this.handlePasteEvent=t=>{var e,n;t.preventDefault(),this.stopEventPropagation(t);const o=t.clipboardData;if(null===(e=null==o?void 0:o.files)||void 0===e?void 0:e.length)return;const i=null!==(n=null==o?void 0:o.getData("text/plain"))&&void 0!==n?n:"";i&&this.updateCodeBlockRangeAndContent(i)}}registerInputEvent(){const t=this.contentRenderer.getCodeContentContainerRef();t&&t.addEventListener("paste",this.handlePasteEvent)}unregisterEventListener(){const t=this.contentRenderer.getCodeContentContainerRef();t&&t.removeEventListener("paste",this.handlePasteEvent)}updateCodeBlockRangeAndContent(t){const{nextOffset:e,updatedContent:n}=this.getLatestRangeAndContent(t);this.selectionController.setNextCodeBlockRange(e),this.valueController.updateValue(n,this.value.language,{recordHistory:!0,offset:this.selectionController.getCurrentRange().contentOffset})}getLatestRangeAndContent(t){const e=this.selectionController.getCurrentRange(),n=this.contentParseController.getCurrentCodeNodes(),o=this.getCodeNodesContent(n);return this.reCalculateRangeAndContent(e,o,t)}}yt([s()],xt.prototype,"host",void 0),yt([s()],xt.prototype,"valueController",void 0),yt([s()],xt.prototype,"contentRenderer",void 0),yt([s()],xt.prototype,"value",void 0),yt([s()],xt.prototype,"selectionController",void 0),yt([s()],xt.prototype,"contentParseController",void 0),yt([s()],xt.prototype,"inputController",void 0),yt([c("componentDidLoad")],xt.prototype,"registerInputEvent",null),yt([c("disconnectedCallback")],xt.prototype,"unregisterEventListener",null);var Ct=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};const wt=class{constructor(t){n(this,t),this.vegaChange=o(this,"vegaChange",7),this.change=o(this,"change",7),this.vegaRemove=o(this,"vegaRemove",7),this.remove=o(this,"remove",7),this.globalSlimmers={},this.componentGlobalStyleSlimmer=new P(":root{--code-orange:#cd3e00;--code-green:#007e7e;--code-purple:#6851f5;--code-gray:#67727e;--code-neutral:rgb(15, 36, 51);--code-neutral-8:rgba(15, 36, 51, 0.8);--code-neutral-7:rgba(15, 36, 51, 0.7)}.dark{--code-orange:#ff9571;--code-green:#73e6dc;--code-purple:#c7bdff;--code-gray:#8b959f;--code-neutral:rgb(252, 252, 252);--code-neutral-8:rgba(252, 252, 252, 0.8);--code-neutral-7:rgba(252, 252, 252, 0.7)}"),this.translationSlimmer=new E,this.vegaComponentUsageRuntimeMetricsSlimmer=new d,this.codeBlockRenderer=new z,this.contentRenderer=new _,this.copyButtonRenderer=new Q,this.valueController=new H,this.contentParseController=new V,this.prismCodeHighlightParser=new ht,this.defaultCodeHighlightParser=new ft,this.selectionController=new Y,this.inputController=new W,this.insertCompositionTextController=new bt,this.focusController=new J,this.historyController=new mt,this.changeEventEmitter=R(wt,g),this.removeEventEmitter=R(wt,y),this.codeBlockPasteController=new xt,this.eventPreventSlimmer=new T([g],(()=>this.codeBlockRenderer.getToolbarContainerRef())),this.readOnly=!1,this.disabled=!1,this.showCopyButton=!0,this.showLineNumber=!0}watchEditableChange(){}componentShouldUpdate(t,e,n){return"value"!==n||!O(t,e)}async doFocus(){}render(){const e=C([this.readOnly?"readonly":"",this.disabled?"disabled":"",this.showLineNumber?"show-line-number":"",this.prismCodeHighlightParser.canParse()?"highlight":""]);return u(t(i,{contenteditable:!1,class:e},this.codeBlockRenderer.render()),this.host)}get host(){return r(this)}static get watchers(){return{readOnly:["watchEditableChange"],disabled:["watchEditableChange"]}}};Ct([p()],wt.prototype,"globalSlimmers",void 0),Ct([l()],wt.prototype,"componentGlobalStyleSlimmer",void 0),Ct([l()],wt.prototype,"translationSlimmer",void 0),Ct([l()],wt.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),Ct([l()],wt.prototype,"codeBlockRenderer",void 0),Ct([l()],wt.prototype,"contentRenderer",void 0),Ct([l()],wt.prototype,"copyButtonRenderer",void 0),Ct([l()],wt.prototype,"valueController",void 0),Ct([l()],wt.prototype,"contentParseController",void 0),Ct([l()],wt.prototype,"prismCodeHighlightParser",void 0),Ct([l()],wt.prototype,"defaultCodeHighlightParser",void 0),Ct([l()],wt.prototype,"selectionController",void 0),Ct([l()],wt.prototype,"inputController",void 0),Ct([l()],wt.prototype,"insertCompositionTextController",void 0),Ct([l()],wt.prototype,"focusController",void 0),Ct([l()],wt.prototype,"historyController",void 0),Ct([l()],wt.prototype,"changeEventEmitter",void 0),Ct([l()],wt.prototype,"removeEventEmitter",void 0),Ct([l()],wt.prototype,"codeBlockPasteController",void 0),Ct([l()],wt.prototype,"eventPreventSlimmer",void 0),wt.style=':host{display:block;border-radius:2px;background-color:rgba(var(--v-bg-secondary, 245, 247, 247, 1));padding-left:12px;padding-right:12px;padding-top:12px;padding-bottom:12px}:host code{display:block;box-sizing:border-box;color:rgba(var(--v-text-primary, 32, 54, 69, 1));text-align:left;font-family:"Roboto Mono";font-weight:400;line-height:22px;font-size:16px;white-space:pre-wrap;min-height:22px;tab-size:2px;word-break:break-word}:host code:focus-visible{outline:none}:host .editor-toolbar{display:flex;flex-direction:row;justify-content:space-between;align-items:center;padding-bottom:12px;border:1px solid rgba(var(--v-border-divider-secondary, 199, 217, 229, 1));border-top-width:0px;border-left-width:0px;border-right-width:0px;margin-bottom:12px;user-select:none}:host .editor-toolbar vega-input-select{width:auto;min-width:161px}:host(.show-line-number) code .v-code-line-number::before{content:attr(data-mark);width:var(--v-code-line-number-width);margin-left:var(--v-code-line-number-ml);padding-right:16px;text-align:right;user-select:none;font-style:normal;word-break:keep-all;color:rgba(var(--v-text-secondary, 107, 116, 125, 1));display:inline-block}:host(.show-line-number) code{padding-left:var(--v-code-block-pl)}:host::part(select-container){padding-top:0px;padding-bottom:0px;padding-left:8px;padding-right:8px;border-radius:4px}:host::part(selected-box),:host::part(placeholder){font-size:14px;user-select:none}:host::part(toggle-icon-container){width:12px;height:12px;line-height:12px}:host::part(toggle-icon){width:12px;height:12px}:host(.readonly) .copy-button-container{position:relative}:host(.readonly) .copy-button-container .copy-code-button{position:absolute;top:0px;right:0px}:host(.disabled:not(.highlight)) code{color:rgba(var(--v-text-input-disabled, 107, 116, 125, 1))}:host(.disabled.highlight){opacity:0.5}:host(.focus:not(.disabled,.readonly)){outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:2px}:host(.highlight) code{color:var(--code-neutral)}code .comment,code .prolog,code .doctype,code .cdata{color:var(--code-gray);font-style:italic}code .namespace{color:var(--code-neutral-7)}code .string,code .attr-value,code .builtin{color:var(--code-green)}code .punctuation,code .operator,code .attr-equals{color:var(--code-gray)}code .entity,code .url,code .symbol,code .number,code .boolean,code .variable,code .constant,code .property,code .regex,code .inserted{color:var(--code-neutral-8)}code .atrule,code .function,code .attr-name{color:var(--code-orange)}code .deleted{color:var(--code-neutral)}code .function-variable{color:#ff0000}code .tag,code .selector,code .keyword{color:var(--code-purple)}';export{wt as vega_code_block}
|
|
1
|
+
import{h as t,F as e,r as n,c as o,H as i,g as r}from"./p-6b2342e0.js";import{c as s,V as a,M as c,I as l}from"./p-6e1ab235.js";import{V as d,I as p}from"./p-8ce9e214.js";import{s as u}from"./p-519a7d55.js";import{V as h}from"./p-6031bed1.js";import{t as f}from"./p-aacf6920.js";import{D as v,d as b}from"./p-526e3634.js";import{d as g,a as m,r as y}from"./p-5447a8e8.js";import{a9 as x}from"./p-571ec00b.js";import{a as C}from"./p-528748fa.js";import{C as w}from"./p-2d0d575f.js";import{z as j,y as k}from"./p-4a2fe3a4.js";import{c as R}from"./p-66647244.js";import{d as O}from"./p-a841cf13.js";import{T as E}from"./p-cd69aeae.js";import{S,a as F,C as $}from"./p-a090b2be.js";import{A}from"./p-4d65756f.js";import{d as L}from"./p-1bc5b3bc.js";import{C as T}from"./p-2c737fc8.js";import{c as D}from"./p-890a5254.js";import{C as P}from"./p-2bb5a232.js";import"./p-ffdc25ec.js";import"./p-afcd8f04.js";import"./p-6a334573.js";import"./p-8b5d3a52.js";import"./p-331a62d5.js";import"./p-02841589.js";import"./p-456f678b.js";import"./p-ed45b3b6.js";import"./p-d4ea8e22.js";import"./p-b438e68b.js";import"./p-874e5624.js";import"./p-cb378636.js";import"./p-3e09aeed.js";import"./p-fb5ea4b2.js";import"./p-4866e390.js";import"./p-b75ee3ba.js";import"./p-f0e828d8.js";import"./p-8c30a60d.js";import"./p-8d2501b2.js";import"./p-d609c3fd.js";import"./p-6c95a6a3.js";import"./p-1fb56e14.js";import"./p-5f377954.js";import"./p-87a4d75f.js";import"./p-982747ef.js";var N=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};class z extends a{constructor(){super(...arguments),this.languageDropdownProps={searchable:!1},this.languageOptions=Object.keys(x).map((t=>({id:x[t],displayName:t}))),this.handleLanguageChange=t=>{v.addUniqueObserverToNode(t,g,(t=>{var e;this.valueController.updateValue(null===(e=this.value)||void 0===e?void 0:e.code,t.detail)}))},this.handleDeleteClick=t=>{v.addUniqueObserverToNode(t,m,(()=>{this.removeEventEmitter.emit().defaultPrevented||this.host.remove()}))}}getToolbarContainerRef(){return this.toolbarContainerRef}render(){return t(e,null,t("div",{part:"editor-toolbar",contenteditable:!1,class:{"editor-toolbar":!this.readOnly,"copy-button-container":this.showCopyButton&&this.readOnly},ref:t=>this.toolbarContainerRef=t},this.renderEditorToolbar(),this.copyButtonRenderer.render()),this.contentRenderer.render())}renderEditorToolbar(){var n,o;if(!this.readOnly)return t(e,null,t("vega-input-select",{source:this.languageOptions,value:null!==(o=null===(n=this.value)||void 0===n?void 0:n.language)&&void 0!==o?o:"",disabled:this.disabled,placeholder:this.translationSlimmer.t("Select Language"),size:"small",vegaDropdownProps:this.languageDropdownProps,exportparts:"select-container, selected-box, placeholder, toggle-icon-container, toggle-icon",ref:this.handleLanguageChange}),t("vega-button-circle",{key:"delete-button",disabled:this.disabled,label:this.translationSlimmer.t("Delete Code"),icon:h.getIconKey("trash-can"),iconColor:"text-secondary",variant:"icon-only",size:"extra-small",ref:this.handleDeleteClick}))}}h.register({"trash-can":f}),N([s()],z.prototype,"readOnly",void 0),N([s()],z.prototype,"host",void 0),N([s()],z.prototype,"disabled",void 0),N([s()],z.prototype,"showCopyButton",void 0),N([s()],z.prototype,"value",void 0),N([s()],z.prototype,"contentRenderer",void 0),N([s()],z.prototype,"valueController",void 0),N([s()],z.prototype,"removeEventEmitter",void 0),N([s()],z.prototype,"translationSlimmer",void 0),N([s()],z.prototype,"copyButtonRenderer",void 0);var B=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};class _ extends a{constructor(){super(...arguments),this.handleFocus=()=>{this.readOnly||this.disabled||this.host.classList.add("focus")},this.handleBlur=()=>{this.host.classList.remove("focus"),w.notify(b.getSubject(this.host,j),null)}}getCodeContentContainerRef(){return this.codeContentContainerRef}registerEventListener(){this.codeContentContainerRef&&(this.codeContentContainerRef.addEventListener("focusin",this.handleFocus),this.codeContentContainerRef.addEventListener("focusout",this.handleBlur))}unregisterEventListener(){this.codeContentContainerRef&&(this.codeContentContainerRef.removeEventListener("focusin",this.handleFocus),this.codeContentContainerRef.removeEventListener("focusout",this.handleBlur))}render(){var n;const o=this.contentParseController.parseCode(),i=(null===(n=this.value)||void 0===n?void 0:n.language)||"";return t(e,null,t("style",null,this.getLineNumberStyleVariable(o)),t("code",{role:"textbox",tabIndex:0,spellcheck:!1,ref:t=>this.codeContentContainerRef=t,contenteditable:!this.readOnly&&!this.disabled,"data-language":i,innerHTML:o.map((t=>this.renderCodeNode(t))).join("")}))}renderCodeNode(t){const{key:e,className:n,mark:o,text:i}=t;return`<span key='${e}' class='${n}' data-mark='${o}' data-index='${e}'>${i}</span>`}getLineNumberStyleVariable(t){const e=10*(t.filter((t=>"\n"===t.text)).length+1).toString().length;return`code{--v-code-line-number-width:${e}px;--v-code-line-number-ml:-${e+16}px;--v-code-block-pl:${e+16}px}`}}B([s()],_.prototype,"host",void 0),B([s()],_.prototype,"readOnly",void 0),B([s()],_.prototype,"disabled",void 0),B([s()],_.prototype,"value",void 0),B([s()],_.prototype,"contentParseController",void 0),B([c("componentDidLoad")],_.prototype,"registerEventListener",null),B([c("disconnectedCallback")],_.prototype,"unregisterEventListener",null);var I=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};class H extends a{updateValue(t,e,n){this.value&&this.value.code===t&&this.value.language===e||(this.value={language:e,code:t},this.changeEventEmitter.emit(this.value),n&&n.recordHistory&&this.historyController.registerHistory({value:this.value,offset:n.offset}))}initialValue(){this.value||(this.value={code:"",language:"plainText"})}}I([s({writable:!0})],H.prototype,"value",void 0),I([s()],H.prototype,"changeEventEmitter",void 0),I([s()],H.prototype,"historyController",void 0),I([c("connectedCallback")],H.prototype,"initialValue",null);var M=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};class V extends a{constructor(){super(...arguments),this.codeNodes=[]}getCurrentCodeNodes(){return this.codeNodes}parseCode(){const t=[this.prismCodeHighlightParser,this.defaultCodeHighlightParser];let e=[];for(const n of t)if(n.canParse()){e=n.parse();break}return this.codeNodes=e,e}}M([s()],V.prototype,"prismCodeHighlightParser",void 0),M([s()],V.prototype,"defaultCodeHighlightParser",void 0);class Z{constructor(t){this.contentOffset=0,this.selectedText="",this.codeContainerRef=t}updateRange(t,e,n,o=""){const i=new Z(this.codeContainerRef);return i.selectedText=o,i.contentOffset=i.getContentOffset(t,e,n),i}updateContentOffset(t){return this.contentOffset=Math.max(0,t),this.selectedText="",this.contentOffset}createNativeRange(t){const{nodeIndex:e,offset:n}=this.getFocusNodeState(t,this.contentOffset),o=new Range,i=this.codeContainerRef.querySelector(`span[data-index="${e}"]`);if(i){const t=Math.min(i.firstChild.textContent.length,n);return o.setStart(i.firstChild,t),o.setEnd(i.firstChild,t),o}}getContentOffset(t,e,n){let o=t.nodeType===Node.TEXT_NODE?t.parentElement:t;if("CODE"===o.nodeName&&o.childNodes&&o.childNodes.length&&(o=o.childNodes[Math.min(e,o.childNodes.length-1)],e=0),o&&o.hasAttribute("data-index")){const t=Number(o.dataset.index);let i="";for(let e=0;e<t;e++)i+=n[e].text;return i.length+e}return 0}getFocusNodeState(t,e){const n=this.getCodeContent(t),o={nodeIndex:0,offset:0};if(!n||e>=n.length)o.nodeIndex=t.length-1,o.offset=t[o.nodeIndex].text.length;else{let n="";for(let i=0;i<t.length;i++)if(n+=t[i].text,n.length>=e){o.offset=Math.max(0,t[i].text.length-(n.length-e)),o.nodeIndex=i;break}}return"\n"===t[o.nodeIndex].text&&o.offset>0&&t[o.nodeIndex+1]&&(o.nodeIndex+=1,o.offset=0),o}getCodeContent(t){return t.map((t=>t.text)).join("")}}var U=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};class Y extends A{constructor(){super(1),this.handleSelectionWithDebounce=L(this.handleSelectionChange,Y.SELECTION_CHANGE_DEBOUNCE_TIME,this),this.doTask=async()=>{await Promise.resolve();const t=this.getSelection(),e=this.codeBlockRange.createNativeRange(this.contentParseController.getCurrentCodeNodes());t&&e&&(t.removeAllRanges(),t.addRange(e))}}getCurrentRange(){return this.codeBlockRange}setNextCodeBlockRange(t,e=!1){this.codeBlockRange.updateContentOffset(t),super.enqueueTheTaskIntoQueue(e)}addSelectionChangeEventListener(){this.codeBlockRange=new Z(this.contentRenderer.getCodeContentContainerRef()),document.addEventListener("selectionchange",this.handleSelectionWithDebounce)}removeSelectionChangeEventListener(){document.removeEventListener("selectionchange",this.handleSelectionWithDebounce)}getSelection(){return S.getSelection(this.host.shadowRoot)}handleSelectionChange(){const t=this.getSelection();t&&t.rangeCount>0?(this.syncCodeRangeByNativeRange(),w.notify(b.getSubject(this.host,k),{detail:!0})):w.notify(b.getSubject(this.host,k),{detail:!1})}syncCodeRangeByNativeRange(){const t=this.getSelection();if(this.isCodeBlockActive()&&0===this.autoRunTaskQueue.queue.length&&!this.insertCompositionTextController.isComposing()){const e=t.getRangeAt(0),{startContainer:n,startOffset:o}=e;this.codeBlockRange=this.codeBlockRange.updateRange(n,o,this.contentParseController.getCurrentCodeNodes(),e.toString())}}isCodeBlockActive(){return this.host&&this.host.classList.contains("focus")}}Y.SELECTION_CHANGE_DEBOUNCE_TIME=Math.min(F.SELECTION_CHANGE_DEBOUNCE_TIME,40),U([s()],Y.prototype,"host",void 0),U([s()],Y.prototype,"contentRenderer",void 0),U([s()],Y.prototype,"contentParseController",void 0),U([s()],Y.prototype,"insertCompositionTextController",void 0),U([c("componentDidLoad")],Y.prototype,"addSelectionChangeEventListener",null),U([c("disconnectedCallback")],Y.prototype,"removeSelectionChangeEventListener",null);class G extends a{deleteSelectedText(t,e,n){return n>=t.length?"":t.slice(0,e)+t.slice(e+n)}getCodeNodesContent(t){return t.map((t=>t.text)).join("")}stopEventPropagation(t){t&&"function"==typeof t.stopPropagation&&t.stopPropagation()}reCalculateRangeAndContent(t,e,n){let o=t.contentOffset,i=e;return t&&(t.selectedText.length&&(i=this.deleteSelectedText(i,t.contentOffset,t.selectedText.length)),i=i.slice(0,t.contentOffset)+n+i.slice(t.contentOffset),o=t.contentOffset+n.length),{nextOffset:o,updatedContent:i}}}var q=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};class W extends G{constructor(){super(...arguments),this.handleInputEvent=t=>{this.stopEventPropagation(t),this.updateCodeContent()},this.handleBeforeInput=t=>{switch(t.stopPropagation(),t.inputType){case"deleteContentBackward":return void(this.value&&this.value.code&&""!==this.value.code?this.handleDeleteAction(t):t.preventDefault());case"historyUndo":case"historyRedo":return void t.preventDefault()}this.updateCodeBlockRange(t)}}registerInputEvent(){const t=this.contentRenderer.getCodeContentContainerRef();t&&(t.addEventListener("beforeinput",this.handleBeforeInput),t.addEventListener("input",this.handleInputEvent))}unregisterEventListener(){const t=this.contentRenderer.getCodeContentContainerRef();t&&(t.removeEventListener("beforeinput",this.handleBeforeInput),t.removeEventListener("input",this.handleInputEvent))}handleDeleteAction(t){const e=this.selectionController.getCurrentRange();if(e){t.preventDefault();const n=e.contentOffset,o=this.contentParseController.getCurrentCodeNodes();let i=this.getCodeNodesContent(o),r=n;e.selectedText.length?i=this.deleteSelectedText(i,n,e.selectedText.length):n>0&&(i=i.slice(0,n-1)+i.slice(n),r-=1),this.selectionController.setNextCodeBlockRange(r),this.valueController.updateValue(i,this.value.language,{recordHistory:!0,offset:r})}}updateCodeBlockRange(t){const e=this.selectionController.getCurrentRange();!this.insertCompositionTextController.isComposing()&&e&&this.selectionController.setNextCodeBlockRange(e.contentOffset+this.getInsertDataLength(t))}getInsertDataLength(t){const{data:e,inputType:n}=t;switch(n){case"insertText":return e.length;case"insertParagraph":case"insertLineBreak":return 1;default:return 0}}updateCodeContent(){var t;if(!this.insertCompositionTextController.isComposing()){let e=this.contentRenderer.getCodeContentContainerRef().innerText;this.isInsertLineBreakInLowVersionFirefox(e)&&(e+="\n"),this.valueController.updateValue(e,null===(t=this.value)||void 0===t?void 0:t.language,{recordHistory:!0,offset:this.selectionController.getCurrentRange().contentOffset})}}isInsertLineBreakInLowVersionFirefox(t){var e;const n=(null===(e=this.value)||void 0===e?void 0:e.code)||"";return!n.endsWith("\n")&&t===n+"\n"}}q([s()],W.prototype,"selectionController",void 0),q([s()],W.prototype,"contentRenderer",void 0),q([s()],W.prototype,"valueController",void 0),q([s()],W.prototype,"contentParseController",void 0),q([s()],W.prototype,"insertCompositionTextController",void 0),q([s()],W.prototype,"value",void 0),q([c("componentDidLoad")],W.prototype,"registerInputEvent",null),q([c("disconnectedCallback")],W.prototype,"unregisterEventListener",null);var X=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};class J extends a{focusAndUpdateSelection(){if(!this.disabled&&!this.readOnly){const t=this.contentRenderer.getCodeContentContainerRef();t&&(t.focus(),this.selectionController.setNextCodeBlockRange(this.value&&this.value.code&&" "!==this.value.code?this.value.code.length:0,!0))}}removeFocusAfterDisabled(){(this.disabled||this.readOnly)&&this.host.classList.remove("focus")}}X([s()],J.prototype,"host",void 0),X([s()],J.prototype,"value",void 0),X([s()],J.prototype,"readOnly",void 0),X([s()],J.prototype,"disabled",void 0),X([s()],J.prototype,"contentRenderer",void 0),X([s()],J.prototype,"selectionController",void 0),X([c("doFocus")],J.prototype,"focusAndUpdateSelection",null),X([c("watchEditableChange")],J.prototype,"removeFocusAfterDisabled",null);var K=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};class Q extends a{constructor(){super(...arguments),this.handleCopyClick=t=>{v.addUniqueObserverToNode(t,m,(async()=>{var e;const n=(null===(e=this.value)||void 0===e?void 0:e.code)||"";if(n&&globalThis.navigator&&globalThis.navigator.clipboard){clearTimeout(this.updateLabelTimer),await globalThis.navigator.clipboard.writeText(n);const e=this.translationSlimmer.t("Copy Code");t.label=this.translationSlimmer.t("Copied"),this.updateLabelTimer=setTimeout((()=>{t&&(t.label=e)}),Q.RESET_TOOLTIP_TIME)}}))}}render(){if(this.showCopyButton&&this.readOnly)return t("vega-button-circle",{key:"copy-button",label:this.translationSlimmer.t("Copy Code"),class:"copy-code-button",icon:h.getIconKey("copy"),iconColor:"text-secondary",variant:"icon-only",size:"extra-small",ref:this.handleCopyClick})}}function tt(t,e){if(!t||!e)return[t];const n=[t];return function(t,e){const n=[],o=[];for(const t of Object.keys(e)){const i=e[t],r=Array.isArray(i)?i:[i];for(const e of r)e.greedy?n.push({tokenType:t,patternDef:e}):o.push({tokenType:t,patternDef:e})}n.length>0&&function(t,e){for(let n=0;n<t.length;n++){const o=t[n];if("string"!=typeof o)continue;const i=o;let r=i;const s=[];for(const{tokenType:t,patternDef:n}of e){const{pattern:e,lookbehind:o,inside:a}=n,c=new RegExp(e.source,e.flags.replace(/g/g,"")+"g");let l;for(;null!==(l=c.exec(r));){let e=l.index,n=l[0];if(0===n.length){c.lastIndex++;continue}if(-1!==n.indexOf("\0GREEDY_PLACEHOLDER\0"))continue;if(o&&l[1]){const t=l[1].length;e+=t,n=n.slice(t)}const d=e+n.length;s.push({tokenType:t,matchStart:e,matchEnd:d,matchText:i.slice(e,d),inside:a}),r=r.slice(0,e)+"\0GREEDY_PLACEHOLDER\0".repeat(n.length).slice(0,n.length)+r.slice(d)}}if(0===s.length)continue;s.sort(((t,e)=>t.matchStart-e.matchStart));const a=[];let c=0;for(const t of s){t.matchStart>c&&a.push(i.slice(c,t.matchStart));let e=t.matchText;if(t.inside){const n=tt(t.matchText,t.inside);e=1===n.length?n[0]:n}a.push({type:t.tokenType,content:e}),c=t.matchEnd}c<i.length&&a.push(i.slice(c)),t.splice(n,1,...a),n+=a.length-1}}(t,n);for(const{tokenType:e,patternDef:n}of o)et(t,e,n)}(n,e),n}function et(t,e,n){for(let o=0;o<t.length;o++){const i=t[o];if("string"!=typeof i)continue;const r=nt(i,e,n);1===r.length&&"string"==typeof r[0]||(t.splice(o,1,...r),o+=r.length-1)}}function nt(t,e,n){const{pattern:o,lookbehind:i,inside:r}=n,s=new RegExp(o.source,o.flags.replace(/g/g,"")+"g"),a=[];let c,l=0;for(;null!==(c=s.exec(t));){let n=c.index,o=c[0];if(0===o.length){s.lastIndex++;continue}if(i&&c[1]){const t=c[1].length;n+=t,o=o.slice(t)}n>l&&a.push(t.slice(l,n));let d=o;if(r){const t=tt(o,r);d=1===t.length?t[0]:t}a.push({type:e,content:d}),l=n+o.length}return l<t.length&&a.push(t.slice(l)),0===a.length?[t]:a}h.register({copy:D}),Q.RESET_TOOLTIP_TIME=1e3,K([s()],Q.prototype,"value",void 0),K([s()],Q.prototype,"readOnly",void 0),K([s()],Q.prototype,"showCopyButton",void 0),K([s()],Q.prototype,"translationSlimmer",void 0);const ot={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"']|"[^"]*"|'[^']*')+(?:>|$)/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0},punctuation:{pattern:/^<!|>$|[[\]]/},"doctype-tag":{pattern:/^DOCTYPE/i},name:{pattern:/[^\s<>'"/]+/},string:{pattern:/("|')[\s\S]*?\1/,greedy:!0}}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>/=$<%]+(?:\s(?:\s*[^\s>/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>/]+/,inside:{punctuation:{pattern:/^<\/?/},namespace:{pattern:/^[^\s>/:]+:/}}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:{pattern:/\/?>/},"attr-name":{pattern:/[^\s>/]+/,inside:{namespace:{pattern:/^[^\s>/:]+:/}}}}},entity:[{pattern:/&[\da-z]{1,8};/i},{pattern:/&#x?[\da-f]{1,8};/i}]},it={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:[{pattern:/(["'])(?:\\[\s\S]|(?!\1)[^\\\r\n])*\1/,greedy:!0}],"template-string":{pattern:/`(?:\\[\s\S]|[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/},interpolation:{pattern:/\$\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})*\}/,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/}}},string:{pattern:/[\s\S]+/}}},regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[.\r\n,;:})\]]|\/\/))/,lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0},"regex-delimiter":{pattern:/^\/|\/$/},"regex-flags":{pattern:/^[a-z]+$/}}},"class-name":[{pattern:/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,lookbehind:!0,inside:{punctuation:{pattern:/[.\\]/}}}],keyword:[{pattern:/\b(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/}],boolean:{pattern:/\b(?:false|true)\b/},number:{pattern:/\b(?:(?:0[xX][\dA-Fa-f](?:_[\dA-Fa-f])*|0[bB][01](?:_[01])*|0[oO][0-7](?:_[0-7])*)n?|(?:\d(?:_\d)*\.?\d*|\.\d+)(?:[Ee][+-]?\d(?:_\d)*)?n?|NaN|Infinity)\b/},function:{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/},operator:{pattern:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%|&^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/},punctuation:{pattern:/[{}[\];(),.:]/},constant:{pattern:/\b[A-Z](?:[A-Z_]|\dx)*\b/}};const{function:rt,punctuation:st}=it,at=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(t);i<o.length;i++)e.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(t,o[i])&&(n[o[i]]=t[o[i]])}return n}(it,["keyword","function","operator","punctuation"]),ct=Object.assign(Object.assign({},at),{"class-name":[{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:{punctuation:{pattern:/[<>.,]/}}}],builtin:{pattern:/\b(?:Array|Boolean|Date|Function|Map|Number|Object|Promise|RegExp|Set|String|WeakMap|WeakSet|bigint|boolean|never|null|number|string|symbol|undefined|unknown|void)\b/},keyword:[{pattern:/\b(?:abstract|as|asserts|async|await|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|infer|instanceof|interface|is|keyof|let|module|namespace|new|null|of|package|private|protected|public|readonly|return|require|set|static|super|switch|this|throw|try|type|typeof|undefined|var|void|while|with|yield)\b/}],function:rt,"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:{pattern:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/},generic:{pattern:/<[\s\S]+/,inside:{punctuation:{pattern:/[<>(),.]/},keyword:{pattern:/\b(?:extends|infer|keyof)\b/},builtin:{pattern:/\b(?:boolean|never|null|number|string|symbol|undefined|unknown|void)\b/}}}}},operator:{pattern:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%|&^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]|!(?=\s*[^=])/},punctuation:st}),lt=Object.assign(Object.assign({tag:{pattern:/<\/?(?:[\w.:-]+(?:\s+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])+\}))?|\{\.{3}[a-z_$][\w$]*(?:\.[\w$]+)*\}))*\s*\/?)?>/i,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>/]*/,inside:{punctuation:{pattern:/^<\/?/},namespace:{pattern:/^[^\s>/:]+:/}}},"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])+\})/,inside:{punctuation:[{pattern:/^=/},{pattern:/^(\s*)["'{]|[}"']$/,lookbehind:!0}],script:{pattern:/[\s\S]+/,inside:it}}},spread:{pattern:/\{\.{3}[a-z_$][\w$]*(?:\.[\w$]+)*\}/,inside:{punctuation:{pattern:/^\{\.{3}|\}$/},"attr-name":{pattern:/[\s\S]+/}}},"attr-name":{pattern:/[^\s>/]+/,inside:{namespace:{pattern:/^[^\s>/:]+:/}}},punctuation:{pattern:/\/?>/}}}},it),{entity:ot.entity}),dt={css:{comment:{pattern:/\/\*[\s\S]*?\*\//,greedy:!0},string:{pattern:/("|')(?:\\[\s\S]|(?!\1)[^\\\n\r])*\1/,greedy:!0},atrule:[{pattern:/@[\w-](?:[^;{\s]|\s+(?![\s{]))*(?:;|(?=\s*\{))/,inside:{rule:{pattern:/^@[\w-]+/},"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0},punctuation:{pattern:/[;:(){}]/}}}],url:{pattern:/\burl\((?:("|')(?:\\[\s\S]|(?!\1)[^\\\n\r])*\1|(?:[^\\\r\n()"']|\\[\s\S])*)\)/i,greedy:!0,inside:{function:{pattern:/^url/i},punctuation:{pattern:/^\(|\)$/},string:{pattern:/^("|')[\s\S]+(?=\1$)/,lookbehind:!0}}},selector:{pattern:/(?=\S)[^@;{}()]?(?:[^@;{}()\s]|\s+(?![\s{])|\((?:[^()]|\([^()]*\))*\))*(?=\s*\{)/,inside:{"pseudo-element":{pattern:/(?:::)[\w-]+/},"pseudo-class":{pattern:/(?::)[\w-]+/},class:{pattern:/\.[\w-]+/},id:{pattern:/#[\w-]+/},attribute:{pattern:/\[(?:[^[\]"']|("|')(?:\\[\s\S]|(?!\1)[^\\\n\r])*\1)*\]/,greedy:!0,inside:{punctuation:{pattern:/^\[|\]$/},"attr-name":{pattern:/^(\s*)(?:(?!\s)[-\w\u00B7\u00C0-\u024F])+/i,lookbehind:!0},"attr-value":[{pattern:/(=\s*)(?:"[^"]*"|'[^']*'|[^\s'"=]+)/,lookbehind:!0}],operator:{pattern:/[|~*^$]?=/}}}}},property:{pattern:/(?!\s)[-_a-z\u00B7\u00C0-\u024F][-\w\u00B7\u00C0-\u024F]*(?=\s*:)/i},important:{pattern:/!important\b/i},function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},number:{pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?/i,lookbehind:!0},unit:{pattern:/(\b\d+)(?:%|[a-z]+)/,lookbehind:!0},punctuation:{pattern:/[(){};:,]/},operator:{pattern:/[+\-*/=><~^|]+/}},html:ot,markup:ot,javascript:it,js:it,typescript:ct,ts:ct,jsx:lt,tsx:Object.assign(Object.assign({tag:lt.tag},ct),{entity:lt.entity}),c:it,clike:it};const pt=Object.values(x);class ut extends a{splitTag(t){return!this.hasSpecialCharacter(t)||t.length<2?[t]:t.split(/([<>&/])/).filter(Boolean)}isHighlightLanguage(t){return"plainText"!==t&&pt.includes(t)}markLineNumberNodes(t){0===t.length&&t.push({text:"\n",key:"0",className:""});let e=0;return t.map(((n,o)=>{let i=n.className;return 0!==o&&"\n"!==t[o-1].text||(e++,i=`v-code-line-number ${n.className}`),{text:n.text,key:`${o}`,className:i,mark:`${e}`}}))}hasSpecialCharacter(t){return/[<>&/]/.test(t)}}!function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);r>3&&s&&Object.defineProperty(e,n,s)}([s()],ut.prototype,"value",void 0);class ht extends ut{canParse(){const{code:t,language:e}=this.value||{code:""};return t&&e&&this.isHighlightLanguage(e)}parse(){const{code:t,language:e}=this.value;let n=[];const o=tt(t,function(t){return dt[t]}(e));return n=this.getHighlightNodes(o),this.markLineNumberNodes(n)}getHighlightNodes(t,e){const n=[];for(const o of t)if("string"==typeof o){const t=o.split(/(\n|\t)/),i=t.length;for(let o=0;o<i;o++){const i=t[o];if(i){const t=this.splitTag(i);n.push(...t.map((t=>this.createCodeNode(t,e))))}}}else{const{content:t}=o;"string"==typeof t?n.push(...this.getHighlightNodes([t],o.type)):Array.isArray(t)&&n.push(...this.getHighlightNodes(t,o.type))}return n}createCodeNode(t,e){return{text:t,key:"",className:`token ${e||""}`,mark:""}}}class ft extends ut{canParse(){const{code:t,language:e}=this.value||{code:""};return!t||!e||"plainText"===e||!this.isHighlightLanguage(e)}parse(){var t,e;const n=(null!==(e=null===(t=this.value)||void 0===t?void 0:t.code)&&void 0!==e?e:"").split(/(\n)/);let o=[];return n.forEach((t=>{if(t){const e=this.splitTag(t);o.push(...e.map((t=>({text:t,key:"",className:""}))))}})),o=this.markLineNumberNodes(o),o}}var vt=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};class bt extends a{constructor(){super(...arguments),this.insertCompositionTextEndFlag=!0,this.handleCompositionStart=t=>{this.insertCompositionTextEndFlag=!1,this.stopEventPropagation(t)},this.handleCompositionEnd=t=>{var e;this.insertCompositionTextEndFlag=!0,this.stopEventPropagation(t);const n=this.selectionController.getCurrentRange();n&&this.selectionController.setNextCodeBlockRange(n.contentOffset+t.data.length);const o=this.contentRenderer.getCodeContentContainerRef().innerText;this.valueController.updateValue(o,null===(e=this.value)||void 0===e?void 0:e.language)}}isComposing(){return!this.insertCompositionTextEndFlag}registerInputEvent(){const t=this.contentRenderer.getCodeContentContainerRef();t&&(t.addEventListener("compositionstart",this.handleCompositionStart),t.addEventListener("compositionend",this.handleCompositionEnd))}unregisterEventListener(){const t=this.contentRenderer.getCodeContentContainerRef();t&&(t.removeEventListener("compositionstart",this.handleCompositionStart),t.removeEventListener("compositionend",this.handleCompositionEnd))}stopEventPropagation(t){t.stopPropagation()}}vt([s()],bt.prototype,"selectionController",void 0),vt([s()],bt.prototype,"contentRenderer",void 0),vt([s()],bt.prototype,"valueController",void 0),vt([s()],bt.prototype,"contentParseController",void 0),vt([s()],bt.prototype,"value",void 0),vt([c("componentDidLoad")],bt.prototype,"registerInputEvent",null),vt([c("disconnectedCallback")],bt.prototype,"unregisterEventListener",null);var gt=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};class mt extends ${constructor(){super(...arguments),this.getEffectiveTargets=()=>[this.contentRenderer.getCodeContentContainerRef()]}async undo(){if(this.undoStack.length>1){const t=this.undoStack.pop();this.redoStack.push(t);const e=this.undoStack[this.undoStack.length-1];e&&await this.restoreState(e)}}async redo(){const t=this.redoStack.pop();this.undoStack.push(t),await this.restoreState(t)}initialHistory(){this.registerHistory({value:this.value,offset:this.value.code.length},!0)}getIneffectiveTargets(){return[]}async restoreState(t){const{value:e,offset:n}=t;this.selectionController.setNextCodeBlockRange(n),this.valueController.updateValue(e.code,e.language)}}gt([s()],mt.prototype,"contentRenderer",void 0),gt([s()],mt.prototype,"value",void 0),gt([s()],mt.prototype,"valueController",void 0),gt([s()],mt.prototype,"selectionController",void 0),gt([c("componentDidLoad")],mt.prototype,"initialHistory",null);var yt=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};class xt extends G{constructor(){super(...arguments),this.handlePasteEvent=t=>{var e,n;t.preventDefault(),this.stopEventPropagation(t);const o=t.clipboardData;if(null===(e=null==o?void 0:o.files)||void 0===e?void 0:e.length)return;const i=null!==(n=null==o?void 0:o.getData("text/plain"))&&void 0!==n?n:"";i&&this.updateCodeBlockRangeAndContent(i)}}registerInputEvent(){const t=this.contentRenderer.getCodeContentContainerRef();t&&t.addEventListener("paste",this.handlePasteEvent)}unregisterEventListener(){const t=this.contentRenderer.getCodeContentContainerRef();t&&t.removeEventListener("paste",this.handlePasteEvent)}updateCodeBlockRangeAndContent(t){const{nextOffset:e,updatedContent:n}=this.getLatestRangeAndContent(t);this.selectionController.setNextCodeBlockRange(e),this.valueController.updateValue(n,this.value.language,{recordHistory:!0,offset:this.selectionController.getCurrentRange().contentOffset})}getLatestRangeAndContent(t){const e=this.selectionController.getCurrentRange(),n=this.contentParseController.getCurrentCodeNodes(),o=this.getCodeNodesContent(n);return this.reCalculateRangeAndContent(e,o,t)}}yt([s()],xt.prototype,"host",void 0),yt([s()],xt.prototype,"valueController",void 0),yt([s()],xt.prototype,"contentRenderer",void 0),yt([s()],xt.prototype,"value",void 0),yt([s()],xt.prototype,"selectionController",void 0),yt([s()],xt.prototype,"contentParseController",void 0),yt([s()],xt.prototype,"inputController",void 0),yt([c("componentDidLoad")],xt.prototype,"registerInputEvent",null),yt([c("disconnectedCallback")],xt.prototype,"unregisterEventListener",null);var Ct=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};const wt=class{constructor(t){n(this,t),this.vegaChange=o(this,"vegaChange",7),this.change=o(this,"change",7),this.vegaRemove=o(this,"vegaRemove",7),this.remove=o(this,"remove",7),this.globalSlimmers={},this.componentGlobalStyleSlimmer=new P(":root{--code-orange:#cd3e00;--code-green:#007e7e;--code-purple:#6851f5;--code-gray:#67727e;--code-neutral:rgb(15, 36, 51);--code-neutral-8:rgba(15, 36, 51, 0.8);--code-neutral-7:rgba(15, 36, 51, 0.7)}.dark{--code-orange:#ff9571;--code-green:#73e6dc;--code-purple:#c7bdff;--code-gray:#8b959f;--code-neutral:rgb(252, 252, 252);--code-neutral-8:rgba(252, 252, 252, 0.8);--code-neutral-7:rgba(252, 252, 252, 0.7)}"),this.translationSlimmer=new E,this.vegaComponentUsageRuntimeMetricsSlimmer=new d,this.codeBlockRenderer=new z,this.contentRenderer=new _,this.copyButtonRenderer=new Q,this.valueController=new H,this.contentParseController=new V,this.prismCodeHighlightParser=new ht,this.defaultCodeHighlightParser=new ft,this.selectionController=new Y,this.inputController=new W,this.insertCompositionTextController=new bt,this.focusController=new J,this.historyController=new mt,this.changeEventEmitter=R(wt,g),this.removeEventEmitter=R(wt,y),this.codeBlockPasteController=new xt,this.eventPreventSlimmer=new T([g],(()=>this.codeBlockRenderer.getToolbarContainerRef())),this.readOnly=!1,this.disabled=!1,this.showCopyButton=!0,this.showLineNumber=!0}watchEditableChange(){}componentShouldUpdate(t,e,n){return"value"!==n||!O(t,e)}async doFocus(){}render(){const e=C([this.readOnly?"readonly":"",this.disabled?"disabled":"",this.showLineNumber?"show-line-number":"",this.prismCodeHighlightParser.canParse()?"highlight":""]);return u(t(i,{contenteditable:!1,class:e},this.codeBlockRenderer.render()),this.host)}get host(){return r(this)}static get watchers(){return{readOnly:["watchEditableChange"],disabled:["watchEditableChange"]}}};Ct([p()],wt.prototype,"globalSlimmers",void 0),Ct([l()],wt.prototype,"componentGlobalStyleSlimmer",void 0),Ct([l()],wt.prototype,"translationSlimmer",void 0),Ct([l()],wt.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),Ct([l()],wt.prototype,"codeBlockRenderer",void 0),Ct([l()],wt.prototype,"contentRenderer",void 0),Ct([l()],wt.prototype,"copyButtonRenderer",void 0),Ct([l()],wt.prototype,"valueController",void 0),Ct([l()],wt.prototype,"contentParseController",void 0),Ct([l()],wt.prototype,"prismCodeHighlightParser",void 0),Ct([l()],wt.prototype,"defaultCodeHighlightParser",void 0),Ct([l()],wt.prototype,"selectionController",void 0),Ct([l()],wt.prototype,"inputController",void 0),Ct([l()],wt.prototype,"insertCompositionTextController",void 0),Ct([l()],wt.prototype,"focusController",void 0),Ct([l()],wt.prototype,"historyController",void 0),Ct([l()],wt.prototype,"changeEventEmitter",void 0),Ct([l()],wt.prototype,"removeEventEmitter",void 0),Ct([l()],wt.prototype,"codeBlockPasteController",void 0),Ct([l()],wt.prototype,"eventPreventSlimmer",void 0),wt.style=':host{display:block;border-radius:2px;background-color:rgba(var(--v-bg-secondary, 245, 247, 247, 1));padding-left:12px;padding-right:12px;padding-top:12px;padding-bottom:12px}:host code{display:block;box-sizing:border-box;color:rgba(var(--v-text-primary, 32, 54, 69, 1));text-align:left;font-family:"Roboto Mono";font-weight:400;line-height:22px;font-size:16px;white-space:pre-wrap;min-height:22px;tab-size:2px;word-break:break-word}:host code:focus-visible{outline:none}:host .editor-toolbar{display:flex;flex-direction:row;justify-content:space-between;align-items:center;padding-bottom:12px;border:1px solid rgba(var(--v-border-divider-secondary, 199, 217, 229, 1));border-top-width:0px;border-left-width:0px;border-right-width:0px;margin-bottom:12px;user-select:none}:host .editor-toolbar vega-input-select{width:auto;min-width:161px}:host(.show-line-number) code .v-code-line-number::before{content:attr(data-mark);width:var(--v-code-line-number-width);margin-left:var(--v-code-line-number-ml);padding-right:16px;text-align:right;user-select:none;font-style:normal;word-break:keep-all;color:rgba(var(--v-text-secondary, 107, 116, 125, 1));display:inline-block}:host(.show-line-number) code{padding-left:var(--v-code-block-pl)}:host::part(select-container){padding-top:0px;padding-bottom:0px;padding-left:8px;padding-right:8px;border-radius:4px}:host::part(selected-box),:host::part(placeholder){font-size:14px;user-select:none}:host::part(toggle-icon-container){width:12px;height:12px;line-height:12px}:host::part(toggle-icon){width:12px;height:12px}:host(.readonly) .copy-button-container{position:relative}:host(.readonly) .copy-button-container .copy-code-button{position:absolute;top:0px;right:0px}:host(.disabled:not(.highlight)) code{color:rgba(var(--v-text-input-disabled, 107, 116, 125, 1))}:host(.disabled.highlight){opacity:0.5}:host(.focus:not(.disabled,.readonly)){outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:2px}:host(.highlight) code{color:var(--code-neutral)}code .comment,code .prolog,code .doctype,code .cdata{color:var(--code-gray);font-style:italic}code .namespace{color:var(--code-neutral-7)}code .string,code .attr-value,code .builtin{color:var(--code-green)}code .punctuation,code .operator,code .attr-equals{color:var(--code-gray)}code .entity,code .url,code .symbol,code .number,code .boolean,code .variable,code .constant,code .property,code .regex,code .inserted{color:var(--code-neutral-8)}code .atrule,code .function,code .attr-name{color:var(--code-orange)}code .deleted{color:var(--code-neutral)}code .function-variable{color:#ff0000}code .tag,code .selector,code .keyword{color:var(--code-purple)}';export{wt as vega_code_block}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{V as t}from"./p-6e1ab235.js";import{c as s}from"./p-6a334573.js";import{C as a}from"./p-2d0d575f.js";import{O as o}from"./p-331a62d5.js";import{l as m,k as p}from"./p-
|
|
1
|
+
import{V as t}from"./p-6e1ab235.js";import{c as s}from"./p-6a334573.js";import{C as a}from"./p-2d0d575f.js";import{O as o}from"./p-331a62d5.js";import{l as m,k as p}from"./p-4a2fe3a4.js";import{d as e}from"./p-526e3634.js";class i extends t{constructor({propName:t}){super(),this.isAcceptableObserverPayload=t=>t.host===this.host&&t.stateName===this.propName,this.propName=t}connectedCallback(){this.subStateObserver=new o(this.isAcceptableObserverPayload.bind(this),(t=>{t.callback(this.propValue)})),a.register(e.getSubject(this.host,m),this.subStateObserver)}disconnectedCallback(){a.unregister(e.getSubject(this.host,m),this.subStateObserver)}subStateNotify(){a.notify(e.getSubject(this.host,p),{host:this.host,stateName:this.propName,value:this.propValue})}}function r(t,a,o){const m=[{mapFrom:"connectedCallback",mapTo:"connectedCallback"},{mapFrom:"disconnectedCallback",mapTo:"disconnectedCallback"}];return o&&m.push({mapFrom:o,mapTo:"subStateNotify"}),s(t,i,[{mapFrom:"host",mapTo:"host"},{mapFrom:a,mapTo:"propValue"}],m,[{propName:a}])}export{r as c}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as t,H as e,r as n,g as r}from"./p-6b2342e0.js";import{c as i,M as o,V as s,I as a}from"./p-6e1ab235.js";import{V as l,I as c}from"./p-8ce9e214.js";import{s as h}from"./p-519a7d55.js";import{a as d,V as p}from"./p-3e09aeed.js";import{n as f,I as u,T as x}from"./p-e9d09211.js";import{e as m,V as g}from"./p-1d5e05d9.js";import{s as v,N as b,ac as w,M as y,i as j,ad as k,h as O,C,v as z,o as R,q as T,ae as I,af as S,p as E}from"./p-2bb60f89.js";import{c as N,d as M,V as B}from"./p-e9b005df.js";import{c as L}from"./p-3a620268.js";import{D as P}from"./p-526e3634.js";import{d as V,r as D}from"./p-5447a8e8.js";import{i as K}from"./p-456f678b.js";import{y as A}from"./p-3a68b729.js";import{t as U}from"./p-b75ee3ba.js";import{v as W}from"./p-4866e390.js";import{S as F}from"./p-29e3eb12.js";import{f as $}from"./p-528748fa.js";import{w as _}from"./p-88a6c89a.js";import{i as G}from"./p-d27ae9ff.js";import{D as q}from"./p-4edd7f8c.js";import"./p-cb378636.js";import"./p-2d0d575f.js";import"./p-331a62d5.js";import"./p-fb5ea4b2.js";import"./p-f0e828d8.js";import"./p-6031bed1.js";import"./p-ffdc25ec.js";import"./p-afcd8f04.js";import"./p-6a334573.js";import"./p-8b5d3a52.js";import"./p-a841cf13.js";import"./p-02841589.js";import"./p-b438e68b.js";import"./p-ed45b3b6.js";import"./p-d4ea8e22.js";import"./p-874e5624.js";import"./p-262ec334.js";class H extends N{registerRef(t,e){t&&v.register(t,e)}getCustomAttrs(t){var e;return(null===(e=t.getCustomAttributesAnnotation())||void 0===e?void 0:e.render())||{}}}class J extends N{registerRef(t,e){t&&v.register(t,e)}}const X=new class extends J{renderFromAnnotation(t,e){const n=this.renderText(t);return e?this.renderWithWrapper(n,e):n}render(t){return this.renderFromAnnotation(t,t.getAnnotationByType(b.INLINE_HTML))}renderWithWrapper(e,n){const{htmlTag:r,customStyle:i,customAttribute:o,customClass:s}=n,a=Object.assign(Object.assign({},null==o?void 0:o.render()),{style:null==i?void 0:i.renderStyle(),class:null==s?void 0:s.renderClass().join(" ")});return t(r,Object.assign({},a),n.child?this.renderWithWrapper(e,n.child):e)}renderText(e){var n,r;const i=(null===(n=e.getAnnotationByType(b.CODE))||void 0===n?void 0:n.code)?"code":"span",o=Object.assign(Object.assign({},null===(r=e.getCustomAttributesAnnotation())||void 0===r?void 0:r.render()),{key:e.id,style:e.getStyles(),class:e.getClasses(),ref:t=>this.registerRef(t,e)});return t(i,Object.assign({},o),e.text||w)}};class Q extends y{constructor(t){super(),this.type=j.UNLINK_LINK_GROUP,this.groupKey=t}}const Y=new class{constructor(){this.handleChange=({detail:t},e,n)=>{switch(t.action){case"link":{const{url:r,text:i,linkType:o}=t.payload,s=i!==e;return void n.forEach((t=>{const e=t.getAnnotationByType(b.LINK),a=e.link.groupKey,l=Object.assign({},e.link.customAttribute||{});o?l["data-link-type"]=o:delete l["data-link-type"];const c={href:r,groupKey:a};Object.keys(l).length>0&&(c.customAttribute=l),e.link.customClass&&(c.customClass=e.link.customClass),e.link.customStyle&&(c.customStyle=e.link.customStyle);const h=new k({link:c,newText:s?i:void 0,needMergeNode:s&&n.length>1,doSplit:!1,type:"update_link"});t.apply(h)}))}case"unlink":return void n.forEach((t=>{t.parent.apply(new Q(t.annotationMap.get(b.LINK).link.groupKey)),t.deleteAnnotationByType(b.LINK)}))}}}render(e,n,{editable:r,host:i}){return this.groupNodesByLink(e).flatMap((e=>{if(this.isLinkGroup(e)){let t;return e.find((e=>{const n=e.getAnnotationByType(b.LINK);if(n)return t=n,!0})),this.normalizeLinkNodesByDefaultProtocol(e,i),t=e[0].getAnnotationByType(b.LINK),r?this.renderLinkEditorWrapper(e,t,n):this.renderLink(e,t,n)}const o=M.getRTERenderer(e.type);if(o)return o.render(e,{editable:r},t)})).filter(K)}groupNodesByLink(t){return t.reduce(((t,e)=>{const n=e.getAnnotationByType(b.LINK),r=t[t.length-1];return K(n)?r&&this.isLinkGroup(r)&&r[0].getAnnotationByType(b.LINK).toEqual(n)?r.push(e):t.push([e]):t.push(e),t}),[])}isLinkGroup(t){return Array.isArray(t)}renderLinkEditorWrapper(e,n,r){var i;const{href:o}=n.link,s=e.map((t=>t.text)).join("");let a;return t("span",{class:"link-editor-wrapper",role:"link",tabIndex:0,onKeyDown:L(),ref:t=>{t&&(a=t,v.removeDirtyDomRef(t))}},this.renderLink(e,n,r),t("vega-rich-text-link-editor",{record:{linkType:null===(i=n.link.customAttribute)||void 0===i?void 0:i["data-link-type"],text:s,url:o},ref:t=>{t&&(t.target=a,P.addUniqueObserverToNode(t,V,(t=>{this.handleChange(t,s,e)})))}}))}renderLink(e,n,r){return t("a",Object.assign({},r.toJsx(n)),e.map((t=>X.render(t))))}normalizeLinkNodesByDefaultProtocol(t,e){if(!e||0===t.length)return;const n=t[0].getAnnotationByType(b.LINK);if(!n)return;const r=this.normalizeUrlByDefaultProtocol(n.link.href,e);r&&r!==n.link.href&&t.forEach((t=>{const e=t.getAnnotationByType(b.LINK);e&&e.link.href!==r&&t.apply(new k({link:{href:r,groupKey:e.link.groupKey},type:"update_link",doSplit:!1}))}))}normalizeUrlByDefaultProtocol(t,e){const n=B.configStore.get(e)||{};return f(t,n.defaultProtocol)}};class Z extends H{renderNodes(t,e){const n=t.getAnnotationByType(O.LINK_GROUP);return n?Y.render(t.children,n,e):this.renderGroupedNodesAtDepth(t.children,0,e)}renderGroupedNodesAtDepth(e,n,r){var i;const o=[];let s=0;for(;s<e.length;){const a=e[s].getInlineHtmlTagAtDepth(n);if(!(null==a?void 0:a.groupId)){o.push(this.renderNodeFromDepth(e[s],n,r)),s++;continue}let l=s+1;for(;l<e.length&&(null===(i=e[l].getInlineHtmlTagAtDepth(n))||void 0===i?void 0:i.groupId)===a.groupId;)l++;if(l===s+1)o.push(this.renderNodeFromDepth(e[s],n,r));else{const i=a.annotation.renderProps(),c=this.renderGroupedNodesAtDepth(e.slice(s,l),n+1,r);o.push(t(a.htmlTag,i,c))}s=l}return o}renderNodeFromDepth(e,n,r){return 0===n?M.getRTERenderer(e.type).render(e,r,t):X.renderFromAnnotation(e,e.getInlineHtmlAnnotationAtDepth(n))}}const tt=new class extends Z{render(e,n){if(e.shouldRenderAsInternalWrapper()){const r=this.getOuterInlineTag(e.children);if(r)return t(r.htmlTag,Object.assign({},r.annotation.renderProps(),{key:e.id,ref:t=>super.registerRef(t,e)}),super.renderGroupedNodesAtDepth(e.children,1,n))}const r=e.getBlockTag();return t(r,Object.assign({},this.getCustomAttrs(e),{key:e.id,ref:t=>super.registerRef(t,e),style:e.getStyles(),class:e.getClasses()}),super.renderNodes(e,n))}getOuterInlineTag(t){return 1!==t.length?null:t[0].getInlineHtmlTagAtDepth(0)}},et=new class extends J{constructor(){super(...arguments),this.handleChange=({detail:t},e)=>{switch(t.action){case"edit":e.apply(new u(t.payload.size,t.payload.alt));break;case"delete":{const t=new InputEvent("beforeinput",{inputType:"deleteContentBackward",bubbles:!0});setTimeout((()=>{v.getDOMByEntity(e).dispatchEvent(t)}),50);break}}}}render(e,n){const r=e.getAnnotationByType(b.IMAGE)||new m("md","");return n.editable?t("vega-rich-text-image-editor",{key:e.id,class:this.getClassesForImageEditor(e),size:r.size,alt:r.alt,ref:t=>{P.addUniqueObserverToNode(t,V,(t=>this.handleChange(t,e)))}},this.renderImage(r,e,n)):this.renderImage(r,e,n)}renderImage(e,n,r){var i;return t("img",Object.assign({},null===(i=n.getCustomAttributesAnnotation())||void 0===i?void 0:i.render({filterAttributes:["width","height"]}),{class:this.getClassesForImageNode(n,r.editable),style:Object.assign(Object.assign({},n.getStyles()),r.editable?{width:"100%"}:e.renderStyle({standalone:!0})),alt:e.alt,"data-size":e.size,src:n.url,ref:t=>super.registerRef(t,n),onError:t=>{const e=t.target;e.style.width="16px",e.style.height="16px"}}))}getCommonClasses(t){const e=t.getAnnotationByType(C.CUSTOM_CLASS);return e?e.customClass.filter(K).reduce(((t,e)=>[t,e].join(" ").trim()),""):null}getClasses(t,e={standalone:!1}){return Array.from(t.annotationMap.values()).filter((t=>t instanceof z)).map((t=>t.renderClass(e))).filter(K).reduce(((t,e)=>[t,e].join(" ").trim()),"")}getClassesForImageNode(t,e){var n;return e?`${R.DECORATOR_NODE_CLASS} ${null!==(n=this.getCommonClasses(t))&&void 0!==n?n:""}`:t.getClasses()}getClassesForImageEditor(t){return`${R.DECORATOR_CONTAINER_CLASS} ${this.getClasses(t)}`}},nt=new class extends H{render(e,n){return t("div",Object.assign({},this.getCustomAttrs(e),{key:e.id,ref:t=>super.registerRef(t,e),style:e.getStyles(),class:e.getClasses()}),e.children.map((t=>et.render(t,n))))}},rt=new class extends Z{render(e,n){var r;const i=(null===(r=e.nestList)||void 0===r?void 0:r.length)>0;return t("li",Object.assign({},this.getCustomAttrs(e),{key:this.getRenderKey(e),ref:t=>super.registerRef(t,e),style:e.getStyles(),class:e.getClasses()}),i?t("span",{style:{display:"block"}},super.renderNodes(e,n)):super.renderNodes(e,n),i&&this.renderChildren(e.nestList,n))}getRenderKey(t){var e;const n=(null!==(e=t.nestList)&&void 0!==e?e:[]).map((t=>t.id));return JSON.stringify([t.parent.id,t.id,n])}renderChildren(t,e){return null==t?void 0:t.map((t=>st.render(t,e)))}},it=["decimal","lower-alpha","lower-roman"],ot=["disc","circle","square"],st=new class extends H{render(e,n){const r=e.getBlockTag(),i=e.getStyles(n),o=this.resolveListMarker(e,i);return o&&(i.listStyleType=o),t(r,Object.assign({},this.getCustomAttrs(e),{key:e.id,ref:t=>super.registerRef(t,e),style:i,class:e.getClasses()}),e.children.map((t=>rt.render(t,n))))}resolveListMarker(t,e){if(e.listStyleType||e["list-style-type"])return;const n=this.getListDepth(t,t.type);return"number-list"===t.type?it[n%it.length]:"bullet-list"===t.type?ot[n%ot.length]:void 0}getListDepth(t,e){let n=0,r=t;for(;r.parent instanceof T;){const t=r.parent.parent;t.type===e&&n++,r=t}return n}};class at extends y{constructor(t,e){super(),this.isFlushable=!0,this.type=j.SWITCH_OUT_FROM_CODE_BLOCK,this.content=t,this.language=e}}class lt extends y{constructor(){super(...arguments),this.isFlushable=!0,this.type=j.DELETE_CODE_BLOCK}}const ct=new class extends J{render(e,n){const{text:r,language:i}=e;return t("vega-code-block",{key:e.id,value:{code:r,language:i},readOnly:!n.editable,"data-content":r,"data-language":i,ref:t=>{this.registerRef(t,e),P.addUniqueObserverToNode(t,V,(t=>this.handleCodeContentChange(t.detail,e))),P.addUniqueObserverToNode(t,D,(t=>this.handleCodeBlockRemove(t,e))),P.addUniqueObserverToNode(t,A,(t=>this.handleSelectionChange(t.detail,e)))}})}handleCodeContentChange(t,e){const{code:n,language:r}=t;if(this.shouldSwitchOutOfCodeBlock(e.text,n)){const t=new at(n,r);e.parent.apply(t)}else e.apply(new I(n,r))}handleCodeBlockRemove(t,e){t.preventDefault(),e.parent.apply(new lt)}shouldSwitchOutOfCodeBlock(t,e){const n=e.split("\n");return e.length>t.length&&n.length>4&&""===n.slice(n.length-4).join("")}handleSelectionChange(t,e){t?e.apply(new S(null)):e.annotationMap.delete(O.SELECTION_RANGE)}},ht=new class extends H{constructor(){super(...arguments),this.preventParentDoFocus=t=>{t.stopPropagation(),"keydown"===t.type&&this.dispatchMockKeydownEvent(t)}}render(e,n){const{id:r,children:i}=e;return t("pre",{key:r,class:"code-block-container",ref:t=>this.registerRef(t,e),onKeyDown:this.preventParentDoFocus,onClick:this.preventParentDoFocus,"data-language":i[0].language},this.renderPlaceholderElement("TOP"),ct.render(i[0],n),this.renderPlaceholderElement("BOTTOM"))}renderPlaceholderElement(e){return t("span",{class:E.CODE_BLOCK_PLACEHOLDER_CLASS_NAME,style:{display:"block",height:"1px",overflow:"hidden",zIndex:"1",marginTop:"BOTTOM"===e?"-1px":"0px",marginBottom:"BOTTOM"===e?"0px":"-1px"}},w)}dispatchMockKeydownEvent(t){const e=U();if(e){const{type:n,code:r,metaKey:i,ctrlKey:o,shiftKey:s}=t,a=new Event(n,{bubbles:!1,cancelable:!0});a.code=r,a.metaKey=i,a.ctrlKey=o,a.shiftKey=s,e.dispatchEvent(a)}}},dt=new class extends H{render(e,n){return t(e.htmlTag,Object.assign({},this.getCustomAttrs(e),{key:e.id,ref:t=>super.registerRef(t,e),style:e.getStyles(),class:e.getClasses()}),e.children.map((e=>M.getRTERenderer(e.type).render(e,n,t))))}},pt=new class{constructor(){M.registerRTEDTORenderer("title",tt),M.registerRTEDTORenderer("subtitle",tt),M.registerRTEDTORenderer("paragraph",tt),M.registerRTEDTORenderer("heading-1",tt),M.registerRTEDTORenderer("heading-2",tt),M.registerRTEDTORenderer("heading-3",tt),M.registerRTEDTORenderer("heading-4",tt),M.registerRTEDTORenderer("heading-5",tt),M.registerRTEDTORenderer("heading-6",tt),M.registerRTEDTORenderer("bullet-list",st),M.registerRTEDTORenderer("number-list",st),M.registerRTEDTORenderer("list-item",rt),M.registerRTEDTORenderer("image",nt),M.registerRTEDTORenderer("code-block",ht),M.registerRTEDTORenderer("html-block",dt),M.registerRTEDTORenderer("TEXT",X),M.registerRTEDTORenderer("IMAGE",et)}getBlockRenderer(t){return M.getRTERenderer(t)}};var ft=function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s};class ut extends s{constructor(){super(),d.registerCustomDarkModeColor(x.formatDarkModeColor())}componentWillLoad(){this.setRTEContent()}watchValueUpdate(){this.setRTEContent()}getRichTextContentRef(){return this.richTextContentRef}render(){return t(e,null,this.extensionStyles?t("style",{nonce:W.nonce,class:"rte-extension-styles"},this.extensionStyles):null,this.renderRichTextContent())}setRTEContent(){!this.content||this.content instanceof g||(this.content=g.fromJSON(this.content))}renderRichTextContent(){const e=this.shouldShowPlaceholder();return t("div",{ref:t=>this.richTextContentRef=t,class:{showPlaceholder:e,"rich-text-content":!0},"data-placeholder":this.placeholder,contenteditable:this.contentEditable},this.renderContent())}renderContent(){var e;const n={editable:this.contentEditable};return this.injectRTERefIntoContext(n),null===(e=this.content)||void 0===e?void 0:e.children.map((e=>{const r=pt.getBlockRenderer(e.type);if(r)return r.render(e,n,t)}))}shouldShowPlaceholder(){var t;const e=null===(t=this.content)||void 0===t?void 0:t.children;if(e){if(e.length>1)return!1;for(const t of e)if(t.isNotEmpty())return!1}return!0}injectRTERefIntoContext(t){const e=this.content;if(e){const n=v.getDOMByEntity(e);n&&(t.host=n)}}}ft([i()],ut.prototype,"placeholder",void 0),ft([i()],ut.prototype,"contentEditable",void 0),ft([i({writable:!0})],ut.prototype,"content",void 0),ft([i()],ut.prototype,"extensionStyles",void 0),ft([o("componentWillLoad")],ut.prototype,"componentWillLoad",null),ft([o("watchValueUpdate")],ut.prototype,"watchValueUpdate",null);var xt=function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s};class mt extends F{constructor(){super({parent:"vega-rich-text-editor",subStates:[{subStateName:"placeholder",parentStateName:"placeholder"},{subStateName:"contentEditable",parentStateName:"richTextContentEditable"}]})}}xt([i()],mt.prototype,"host",void 0),xt([i({writable:!0})],mt.prototype,"placeholder",void 0),xt([i({writable:!0})],mt.prototype,"contentEditable",void 0);var gt=function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s};class vt extends s{attachExtensionStyles(){this.attachStylesToHost()}handleExtensionsChange(t,e){G(t,e,!1,((t,e)=>t===e?0:1))||this.attachStylesToHost()}attachStylesToHost(){if(this.extensions){let t="";for(const e of this.extensions){const n=e.collectExtensionRendererStyles();n&&(t+=`${n}\n`)}this.extensionStyles=t}}}gt([i()],vt.prototype,"extensions",void 0),gt([i()],vt.prototype,"host",void 0),gt([i({writable:!0})],vt.prototype,"extensionStyles",void 0),gt([o("componentWillLoad")],vt.prototype,"attachExtensionStyles",null),gt([o("watchExtensions")],vt.prototype,"handleExtensionsChange",null);var bt=function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s};const wt=class{constructor(t){n(this,t),this.globalSlimmers={},this.vegaComponentUsageRuntimeMetricsSlimmer=new l,this.vegaRichTextContentRenderer=new ut,this.vegaRichTextContentStateController=new mt,this.vegaRichTextContentExtensionsStylesController=new vt,this.darkModeStateControllerSlimmer=new q,this.contentEditable=!1,this.extensionStyles="",this.isInDarkMode=p.isDarkMode(),this.extensions=[]}watchValueUpdate(){}watchExtensions(t,e){}async vegaFocus(){this.vegaRichTextContentRenderer.getRichTextContentRef().focus();const t=$(this.host,"vega-rich-text-editor");t&&await _(t)}render(){return h(this.vegaRichTextContentRenderer.render(),this.host)}get host(){return r(this)}static get watchers(){return{content:["watchValueUpdate"],extensions:["watchExtensions"]}}};bt([c()],wt.prototype,"globalSlimmers",void 0),bt([a()],wt.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),bt([a()],wt.prototype,"vegaRichTextContentRenderer",void 0),bt([a()],wt.prototype,"vegaRichTextContentStateController",void 0),bt([a()],wt.prototype,"vegaRichTextContentExtensionsStylesController",void 0),bt([a()],wt.prototype,"darkModeStateControllerSlimmer",void 0),wt.style=':host{display:flex;flex-direction:column;width:100%;overflow-y:auto;min-height:0}:host .rich-text-content{position:relative;min-height:100%;outline:2px solid transparent;outline-offset:2px;font-weight:500;color:var(--v-rich-text-editor-black, #111128);overflow-wrap:break-word;white-space:pre-wrap}:host .rich-text-content.showPlaceholder::before{position:absolute;content:attr(data-placeholder);font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px;color:rgba(var(--v-text-input-placeholder, 176, 180, 181, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){:host .rich-text-content.showPlaceholder::before{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){:host .rich-text-content.showPlaceholder::before{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){:host .rich-text-content.showPlaceholder::before{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}:host .rich-text-content a.v-rte--link{color:rgba(var(--v-text-link, 19, 98, 226, 1));outline:none}:host .rich-text-content a.v-rte--link:visited{color:rgba(var(--v-text-link-visited, 95, 56, 206, 1))}:host .rich-text-content a.v-rte--link:hover{color:rgba(var(--v-text-link-hover, 4, 112, 236, 1))}:host .rich-text-content a.v-rte--link:active{color:rgba(var(--v-text-link-active, 29, 65, 195, 1))}:host .rich-text-content a.v-rte--link:focus-visible{color:rgba(var(--v-text-link-focus, 4, 112, 236, 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));border-radius:8px}:host .rich-text-content .v-rte--underline{text-decoration:underline}:host .rich-text-content .v-rte--strikethrough{text-decoration:line-through}:host .rich-text-content .v-rte--underline.v-rte--strikethrough{text-decoration:underline line-through}:host .rich-text-content .v-rte--horizontal-alignment-right{text-align:right}:host .rich-text-content .v-rte--horizontal-alignment-left{text-align:left}:host .rich-text-content .v-rte--horizontal-alignment-center{text-align:center}:host .rich-text-content .v-rte--horizontal-alignment-justify{text-align:justify}:host .rich-text-content .v-rte--code{font-family:"Roboto Mono";white-space:pre-wrap}:host .rich-text-content img{cursor:pointer}:host .rich-text-content ul.v-rte--list,:host .rich-text-content ol.v-rte--list{padding-left:8px;margin-left:16px}:host .rich-text-content ul.v-rte--list>li::marker,:host .rich-text-content ol.v-rte--list>li::marker{font-size:16px}:host .rich-text-content .link-editor-wrapper{position:relative;outline:2px solid transparent;outline-offset:2px}:host .rich-text-content .link-editor-wrapper vega-rich-text-link-editor{position:absolute;bottom:0;left:0;right:0}:host .rich-text-content .code-block-container{margin-top:22px;margin-bottom:22px}:host .rich-text-content vega-code-block.focus{outline:none}:host .rich-text-content .v-rte--bold{font-weight:700}:host .rich-text-content .v-rte--italic{font-style:italic}:host .rich-text-content .v-rte--image-base img,:host .rich-text-content .v-rte--image-size-lg img,:host .rich-text-content .v-rte--image-size-md img,:host .rich-text-content .v-rte--image-size-sm img{vertical-align:bottom}:host .rich-text-content .v-rte--image-size-sm{width:25%}:host .rich-text-content .v-rte--image-size-md{width:50%}:host .rich-text-content .v-rte--image-size-lg{width:100%}:host .rich-text-content .v-rte--text-style-paragraph{font-family:"Inter";font-size:16px;line-height:22px;font-weight:500;margin:0}:host .rich-text-content .v-rte--text-style-title{font-family:"Inter";font-size:36px;line-height:40px;font-weight:500}:host .rich-text-content .v-rte--text-style-subtitle{font-family:"Inter";font-size:28px;line-height:32px;font-weight:500}:host .rich-text-content .v-rte--text-style-heading-1{font-family:"Inter";font-size:22px;line-height:24px;font-weight:500;margin:0}:host .rich-text-content .v-rte--text-style-heading-2{font-family:"Inter";font-size:20px;line-height:24px;font-weight:500;margin:0}:host .rich-text-content .v-rte--text-style-heading-3{font-family:"Inter";font-size:18px;line-height:22px;font-weight:500;margin:0}:host .rich-text-content .v-rte--text-style-heading-4{font-family:"Inter";font-size:16px;line-height:22px;font-weight:500;margin:0}:host .rich-text-content .v-rte--text-style-heading-5{font-family:"Inter";font-size:14px;line-height:22px;font-weight:500;margin:0}:host .rich-text-content .v-rte--text-style-heading-6{font-family:"Inter";font-size:12px;line-height:22px;font-weight:500;margin:0}';export{wt as vega_rich_text_content}
|
|
1
|
+
import{h as t,H as e,r as n,g as r}from"./p-6b2342e0.js";import{c as i,M as o,V as s,I as a}from"./p-6e1ab235.js";import{V as l,I as c}from"./p-8ce9e214.js";import{s as h}from"./p-519a7d55.js";import{a as d,V as p}from"./p-3e09aeed.js";import{n as f,I as u,T as x}from"./p-373541fa.js";import{e as m,V as g}from"./p-0eb29065.js";import{s as v,N as b,ac as w,M as y,i as j,ad as k,h as O,C,v as z,o as R,q as T,ae as I,af as S,p as E}from"./p-571ec00b.js";import{c as N,d as M,V as B}from"./p-3d0b4074.js";import{c as L}from"./p-3a620268.js";import{D as P}from"./p-526e3634.js";import{d as V,r as D}from"./p-5447a8e8.js";import{i as K}from"./p-456f678b.js";import{y as A}from"./p-4a2fe3a4.js";import{t as U}from"./p-b75ee3ba.js";import{v as W}from"./p-4866e390.js";import{S as F}from"./p-c41a2d4a.js";import{f as $}from"./p-528748fa.js";import{w as _}from"./p-67eaf77e.js";import{i as G}from"./p-d27ae9ff.js";import{D as q}from"./p-4edd7f8c.js";import"./p-cb378636.js";import"./p-2d0d575f.js";import"./p-331a62d5.js";import"./p-fb5ea4b2.js";import"./p-f0e828d8.js";import"./p-6031bed1.js";import"./p-ffdc25ec.js";import"./p-afcd8f04.js";import"./p-6a334573.js";import"./p-8b5d3a52.js";import"./p-a841cf13.js";import"./p-02841589.js";import"./p-b438e68b.js";import"./p-ed45b3b6.js";import"./p-d4ea8e22.js";import"./p-874e5624.js";import"./p-262ec334.js";class H extends N{registerRef(t,e){t&&v.register(t,e)}getCustomAttrs(t){var e;return(null===(e=t.getCustomAttributesAnnotation())||void 0===e?void 0:e.render())||{}}}class J extends N{registerRef(t,e){t&&v.register(t,e)}}const X=new class extends J{renderFromAnnotation(t,e){const n=this.renderText(t);return e?this.renderWithWrapper(n,e):n}render(t){return this.renderFromAnnotation(t,t.getAnnotationByType(b.INLINE_HTML))}renderWithWrapper(e,n){const{htmlTag:r,customStyle:i,customAttribute:o,customClass:s}=n,a=Object.assign(Object.assign({},null==o?void 0:o.render()),{style:null==i?void 0:i.renderStyle(),class:null==s?void 0:s.renderClass().join(" ")});return t(r,Object.assign({},a),n.child?this.renderWithWrapper(e,n.child):e)}renderText(e){var n,r;const i=(null===(n=e.getAnnotationByType(b.CODE))||void 0===n?void 0:n.code)?"code":"span",o=Object.assign(Object.assign({},null===(r=e.getCustomAttributesAnnotation())||void 0===r?void 0:r.render()),{key:e.id,style:e.getStyles(),class:e.getClasses(),ref:t=>this.registerRef(t,e)});return t(i,Object.assign({},o),e.text||w)}};class Q extends y{constructor(t){super(),this.type=j.UNLINK_LINK_GROUP,this.groupKey=t}}const Y=new class{constructor(){this.handleChange=({detail:t},e,n)=>{switch(t.action){case"link":{const{url:r,text:i,linkType:o}=t.payload,s=i!==e;return void n.forEach((t=>{const e=t.getAnnotationByType(b.LINK),a=e.link.groupKey,l=Object.assign({},e.link.customAttribute||{});o?l["data-link-type"]=o:delete l["data-link-type"];const c={href:r,groupKey:a};Object.keys(l).length>0&&(c.customAttribute=l),e.link.customClass&&(c.customClass=e.link.customClass),e.link.customStyle&&(c.customStyle=e.link.customStyle);const h=new k({link:c,newText:s?i:void 0,needMergeNode:s&&n.length>1,doSplit:!1,type:"update_link"});t.apply(h)}))}case"unlink":return void n.forEach((t=>{t.parent.apply(new Q(t.annotationMap.get(b.LINK).link.groupKey)),t.deleteAnnotationByType(b.LINK)}))}}}render(e,n,{editable:r,host:i}){return this.groupNodesByLink(e).flatMap((e=>{if(this.isLinkGroup(e)){let t;return e.find((e=>{const n=e.getAnnotationByType(b.LINK);if(n)return t=n,!0})),this.normalizeLinkNodesByDefaultProtocol(e,i),t=e[0].getAnnotationByType(b.LINK),r?this.renderLinkEditorWrapper(e,t,n):this.renderLink(e,t,n)}const o=M.getRTERenderer(e.type);if(o)return o.render(e,{editable:r},t)})).filter(K)}groupNodesByLink(t){return t.reduce(((t,e)=>{const n=e.getAnnotationByType(b.LINK),r=t[t.length-1];return K(n)?r&&this.isLinkGroup(r)&&r[0].getAnnotationByType(b.LINK).toEqual(n)?r.push(e):t.push([e]):t.push(e),t}),[])}isLinkGroup(t){return Array.isArray(t)}renderLinkEditorWrapper(e,n,r){var i;const{href:o}=n.link,s=e.map((t=>t.text)).join("");let a;return t("span",{class:"link-editor-wrapper",role:"link",tabIndex:0,onKeyDown:L(),ref:t=>{t&&(a=t,v.removeDirtyDomRef(t))}},this.renderLink(e,n,r),t("vega-rich-text-link-editor",{record:{linkType:null===(i=n.link.customAttribute)||void 0===i?void 0:i["data-link-type"],text:s,url:o},ref:t=>{t&&(t.target=a,P.addUniqueObserverToNode(t,V,(t=>{this.handleChange(t,s,e)})))}}))}renderLink(e,n,r){return t("a",Object.assign({},r.toJsx(n)),e.map((t=>X.render(t))))}normalizeLinkNodesByDefaultProtocol(t,e){if(!e||0===t.length)return;const n=t[0].getAnnotationByType(b.LINK);if(!n)return;const r=this.normalizeUrlByDefaultProtocol(n.link.href,e);r&&r!==n.link.href&&t.forEach((t=>{const e=t.getAnnotationByType(b.LINK);e&&e.link.href!==r&&t.apply(new k({link:{href:r,groupKey:e.link.groupKey},type:"update_link",doSplit:!1}))}))}normalizeUrlByDefaultProtocol(t,e){const n=B.configStore.get(e)||{};return f(t,n.defaultProtocol)}};class Z extends H{renderNodes(t,e){const n=t.getAnnotationByType(O.LINK_GROUP);return n?Y.render(t.children,n,e):this.renderGroupedNodesAtDepth(t.children,0,e)}renderGroupedNodesAtDepth(e,n,r){var i;const o=[];let s=0;for(;s<e.length;){const a=e[s].getInlineHtmlTagAtDepth(n);if(!(null==a?void 0:a.groupId)){o.push(this.renderNodeFromDepth(e[s],n,r)),s++;continue}let l=s+1;for(;l<e.length&&(null===(i=e[l].getInlineHtmlTagAtDepth(n))||void 0===i?void 0:i.groupId)===a.groupId;)l++;if(l===s+1)o.push(this.renderNodeFromDepth(e[s],n,r));else{const i=a.annotation.renderProps(),c=this.renderGroupedNodesAtDepth(e.slice(s,l),n+1,r);o.push(t(a.htmlTag,i,c))}s=l}return o}renderNodeFromDepth(e,n,r){return 0===n?M.getRTERenderer(e.type).render(e,r,t):X.renderFromAnnotation(e,e.getInlineHtmlAnnotationAtDepth(n))}}const tt=new class extends Z{render(e,n){if(e.shouldRenderAsInternalWrapper()){const r=this.getOuterInlineTag(e.children);if(r)return t(r.htmlTag,Object.assign({},r.annotation.renderProps(),{key:e.id,ref:t=>super.registerRef(t,e)}),super.renderGroupedNodesAtDepth(e.children,1,n))}const r=e.getBlockTag();return t(r,Object.assign({},this.getCustomAttrs(e),{key:e.id,ref:t=>super.registerRef(t,e),style:e.getStyles(),class:e.getClasses()}),super.renderNodes(e,n))}getOuterInlineTag(t){return 1!==t.length?null:t[0].getInlineHtmlTagAtDepth(0)}},et=new class extends J{constructor(){super(...arguments),this.handleChange=({detail:t},e)=>{switch(t.action){case"edit":e.apply(new u(t.payload.size,t.payload.alt));break;case"delete":{const t=new InputEvent("beforeinput",{inputType:"deleteContentBackward",bubbles:!0});setTimeout((()=>{v.getDOMByEntity(e).dispatchEvent(t)}),50);break}}}}render(e,n){const r=e.getAnnotationByType(b.IMAGE)||new m("md","");return n.editable?t("vega-rich-text-image-editor",{key:e.id,class:this.getClassesForImageEditor(e),size:r.size,alt:r.alt,ref:t=>{P.addUniqueObserverToNode(t,V,(t=>this.handleChange(t,e)))}},this.renderImage(r,e,n)):this.renderImage(r,e,n)}renderImage(e,n,r){var i;return t("img",Object.assign({},null===(i=n.getCustomAttributesAnnotation())||void 0===i?void 0:i.render({filterAttributes:["width","height"]}),{class:this.getClassesForImageNode(n,r.editable),style:Object.assign(Object.assign({},n.getStyles()),r.editable?{width:"100%"}:e.renderStyle({standalone:!0})),alt:e.alt,"data-size":e.size,src:n.url,ref:t=>super.registerRef(t,n),onError:t=>{const e=t.target;e.style.width="16px",e.style.height="16px"}}))}getCommonClasses(t){const e=t.getAnnotationByType(C.CUSTOM_CLASS);return e?e.customClass.filter(K).reduce(((t,e)=>[t,e].join(" ").trim()),""):null}getClasses(t,e={standalone:!1}){return Array.from(t.annotationMap.values()).filter((t=>t instanceof z)).map((t=>t.renderClass(e))).filter(K).reduce(((t,e)=>[t,e].join(" ").trim()),"")}getClassesForImageNode(t,e){var n;return e?`${R.DECORATOR_NODE_CLASS} ${null!==(n=this.getCommonClasses(t))&&void 0!==n?n:""}`:t.getClasses()}getClassesForImageEditor(t){return`${R.DECORATOR_CONTAINER_CLASS} ${this.getClasses(t)}`}},nt=new class extends H{render(e,n){return t("div",Object.assign({},this.getCustomAttrs(e),{key:e.id,ref:t=>super.registerRef(t,e),style:e.getStyles(),class:e.getClasses()}),e.children.map((t=>et.render(t,n))))}},rt=new class extends Z{render(e,n){var r;const i=(null===(r=e.nestList)||void 0===r?void 0:r.length)>0;return t("li",Object.assign({},this.getCustomAttrs(e),{key:this.getRenderKey(e),ref:t=>super.registerRef(t,e),style:e.getStyles(),class:e.getClasses()}),i?t("span",{style:{display:"block"}},super.renderNodes(e,n)):super.renderNodes(e,n),i&&this.renderChildren(e.nestList,n))}getRenderKey(t){var e;const n=(null!==(e=t.nestList)&&void 0!==e?e:[]).map((t=>t.id));return JSON.stringify([t.parent.id,t.id,n])}renderChildren(t,e){return null==t?void 0:t.map((t=>st.render(t,e)))}},it=["decimal","lower-alpha","lower-roman"],ot=["disc","circle","square"],st=new class extends H{render(e,n){const r=e.getBlockTag(),i=e.getStyles(n),o=this.resolveListMarker(e,i);return o&&(i.listStyleType=o),t(r,Object.assign({},this.getCustomAttrs(e),{key:e.id,ref:t=>super.registerRef(t,e),style:i,class:e.getClasses()}),e.children.map((t=>rt.render(t,n))))}resolveListMarker(t,e){if(e.listStyleType||e["list-style-type"])return;const n=this.getListDepth(t,t.type);return"number-list"===t.type?it[n%it.length]:"bullet-list"===t.type?ot[n%ot.length]:void 0}getListDepth(t,e){let n=0,r=t;for(;r.parent instanceof T;){const t=r.parent.parent;t.type===e&&n++,r=t}return n}};class at extends y{constructor(t,e){super(),this.isFlushable=!0,this.type=j.SWITCH_OUT_FROM_CODE_BLOCK,this.content=t,this.language=e}}class lt extends y{constructor(){super(...arguments),this.isFlushable=!0,this.type=j.DELETE_CODE_BLOCK}}const ct=new class extends J{render(e,n){const{text:r,language:i}=e;return t("vega-code-block",{key:e.id,value:{code:r,language:i},readOnly:!n.editable,"data-content":r,"data-language":i,ref:t=>{this.registerRef(t,e),P.addUniqueObserverToNode(t,V,(t=>this.handleCodeContentChange(t.detail,e))),P.addUniqueObserverToNode(t,D,(t=>this.handleCodeBlockRemove(t,e))),P.addUniqueObserverToNode(t,A,(t=>this.handleSelectionChange(t.detail,e)))}})}handleCodeContentChange(t,e){const{code:n,language:r}=t;if(this.shouldSwitchOutOfCodeBlock(e.text,n)){const t=new at(n,r);e.parent.apply(t)}else e.apply(new I(n,r))}handleCodeBlockRemove(t,e){t.preventDefault(),e.parent.apply(new lt)}shouldSwitchOutOfCodeBlock(t,e){const n=e.split("\n");return e.length>t.length&&n.length>4&&""===n.slice(n.length-4).join("")}handleSelectionChange(t,e){t?e.apply(new S(null)):e.annotationMap.delete(O.SELECTION_RANGE)}},ht=new class extends H{constructor(){super(...arguments),this.preventParentDoFocus=t=>{t.stopPropagation(),"keydown"===t.type&&this.dispatchMockKeydownEvent(t)}}render(e,n){const{id:r,children:i}=e;return t("pre",{key:r,class:"code-block-container",ref:t=>this.registerRef(t,e),onKeyDown:this.preventParentDoFocus,onClick:this.preventParentDoFocus,"data-language":i[0].language},this.renderPlaceholderElement("TOP"),ct.render(i[0],n),this.renderPlaceholderElement("BOTTOM"))}renderPlaceholderElement(e){return t("span",{class:E.CODE_BLOCK_PLACEHOLDER_CLASS_NAME,style:{display:"block",height:"1px",overflow:"hidden",zIndex:"1",marginTop:"BOTTOM"===e?"-1px":"0px",marginBottom:"BOTTOM"===e?"0px":"-1px"}},w)}dispatchMockKeydownEvent(t){const e=U();if(e){const{type:n,code:r,metaKey:i,ctrlKey:o,shiftKey:s}=t,a=new Event(n,{bubbles:!1,cancelable:!0});a.code=r,a.metaKey=i,a.ctrlKey=o,a.shiftKey=s,e.dispatchEvent(a)}}},dt=new class extends H{render(e,n){return t(e.htmlTag,Object.assign({},this.getCustomAttrs(e),{key:e.id,ref:t=>super.registerRef(t,e),style:e.getStyles(),class:e.getClasses()}),e.children.map((e=>M.getRTERenderer(e.type).render(e,n,t))))}},pt=new class{constructor(){M.registerRTEDTORenderer("title",tt),M.registerRTEDTORenderer("subtitle",tt),M.registerRTEDTORenderer("paragraph",tt),M.registerRTEDTORenderer("heading-1",tt),M.registerRTEDTORenderer("heading-2",tt),M.registerRTEDTORenderer("heading-3",tt),M.registerRTEDTORenderer("heading-4",tt),M.registerRTEDTORenderer("heading-5",tt),M.registerRTEDTORenderer("heading-6",tt),M.registerRTEDTORenderer("bullet-list",st),M.registerRTEDTORenderer("number-list",st),M.registerRTEDTORenderer("list-item",rt),M.registerRTEDTORenderer("image",nt),M.registerRTEDTORenderer("code-block",ht),M.registerRTEDTORenderer("html-block",dt),M.registerRTEDTORenderer("TEXT",X),M.registerRTEDTORenderer("IMAGE",et)}getBlockRenderer(t){return M.getRTERenderer(t)}};var ft=function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s};class ut extends s{constructor(){super(),d.registerCustomDarkModeColor(x.formatDarkModeColor())}componentWillLoad(){this.setRTEContent()}watchValueUpdate(){this.setRTEContent()}getRichTextContentRef(){return this.richTextContentRef}render(){return t(e,null,this.extensionStyles?t("style",{nonce:W.nonce,class:"rte-extension-styles"},this.extensionStyles):null,this.renderRichTextContent())}setRTEContent(){!this.content||this.content instanceof g||(this.content=g.fromJSON(this.content))}renderRichTextContent(){const e=this.shouldShowPlaceholder();return t("div",{ref:t=>this.richTextContentRef=t,class:{showPlaceholder:e,"rich-text-content":!0},"data-placeholder":this.placeholder,contenteditable:this.contentEditable},this.renderContent())}renderContent(){var e;const n={editable:this.contentEditable};return this.injectRTERefIntoContext(n),null===(e=this.content)||void 0===e?void 0:e.children.map((e=>{const r=pt.getBlockRenderer(e.type);if(r)return r.render(e,n,t)}))}shouldShowPlaceholder(){var t;const e=null===(t=this.content)||void 0===t?void 0:t.children;if(e){if(e.length>1)return!1;for(const t of e)if(t.isNotEmpty())return!1}return!0}injectRTERefIntoContext(t){const e=this.content;if(e){const n=v.getDOMByEntity(e);n&&(t.host=n)}}}ft([i()],ut.prototype,"placeholder",void 0),ft([i()],ut.prototype,"contentEditable",void 0),ft([i({writable:!0})],ut.prototype,"content",void 0),ft([i()],ut.prototype,"extensionStyles",void 0),ft([o("componentWillLoad")],ut.prototype,"componentWillLoad",null),ft([o("watchValueUpdate")],ut.prototype,"watchValueUpdate",null);var xt=function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s};class mt extends F{constructor(){super({parent:"vega-rich-text-editor",subStates:[{subStateName:"placeholder",parentStateName:"placeholder"},{subStateName:"contentEditable",parentStateName:"richTextContentEditable"}]})}}xt([i()],mt.prototype,"host",void 0),xt([i({writable:!0})],mt.prototype,"placeholder",void 0),xt([i({writable:!0})],mt.prototype,"contentEditable",void 0);var gt=function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s};class vt extends s{attachExtensionStyles(){this.attachStylesToHost()}handleExtensionsChange(t,e){G(t,e,!1,((t,e)=>t===e?0:1))||this.attachStylesToHost()}attachStylesToHost(){if(this.extensions){let t="";for(const e of this.extensions){const n=e.collectExtensionRendererStyles();n&&(t+=`${n}\n`)}this.extensionStyles=t}}}gt([i()],vt.prototype,"extensions",void 0),gt([i()],vt.prototype,"host",void 0),gt([i({writable:!0})],vt.prototype,"extensionStyles",void 0),gt([o("componentWillLoad")],vt.prototype,"attachExtensionStyles",null),gt([o("watchExtensions")],vt.prototype,"handleExtensionsChange",null);var bt=function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s};const wt=class{constructor(t){n(this,t),this.globalSlimmers={},this.vegaComponentUsageRuntimeMetricsSlimmer=new l,this.vegaRichTextContentRenderer=new ut,this.vegaRichTextContentStateController=new mt,this.vegaRichTextContentExtensionsStylesController=new vt,this.darkModeStateControllerSlimmer=new q,this.contentEditable=!1,this.extensionStyles="",this.isInDarkMode=p.isDarkMode(),this.extensions=[]}watchValueUpdate(){}watchExtensions(t,e){}async vegaFocus(){this.vegaRichTextContentRenderer.getRichTextContentRef().focus();const t=$(this.host,"vega-rich-text-editor");t&&await _(t)}render(){return h(this.vegaRichTextContentRenderer.render(),this.host)}get host(){return r(this)}static get watchers(){return{content:["watchValueUpdate"],extensions:["watchExtensions"]}}};bt([c()],wt.prototype,"globalSlimmers",void 0),bt([a()],wt.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),bt([a()],wt.prototype,"vegaRichTextContentRenderer",void 0),bt([a()],wt.prototype,"vegaRichTextContentStateController",void 0),bt([a()],wt.prototype,"vegaRichTextContentExtensionsStylesController",void 0),bt([a()],wt.prototype,"darkModeStateControllerSlimmer",void 0),wt.style=':host{display:flex;flex-direction:column;width:100%;overflow-y:auto;min-height:0}:host .rich-text-content{position:relative;min-height:100%;outline:2px solid transparent;outline-offset:2px;font-weight:500;color:var(--v-rich-text-editor-black, #111128);overflow-wrap:break-word;white-space:pre-wrap}:host .rich-text-content.showPlaceholder::before{position:absolute;content:attr(data-placeholder);font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px;color:rgba(var(--v-text-input-placeholder, 176, 180, 181, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){:host .rich-text-content.showPlaceholder::before{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){:host .rich-text-content.showPlaceholder::before{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){:host .rich-text-content.showPlaceholder::before{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}:host .rich-text-content a.v-rte--link{color:rgba(var(--v-text-link, 19, 98, 226, 1));outline:none}:host .rich-text-content a.v-rte--link:visited{color:rgba(var(--v-text-link-visited, 95, 56, 206, 1))}:host .rich-text-content a.v-rte--link:hover{color:rgba(var(--v-text-link-hover, 4, 112, 236, 1))}:host .rich-text-content a.v-rte--link:active{color:rgba(var(--v-text-link-active, 29, 65, 195, 1))}:host .rich-text-content a.v-rte--link:focus-visible{color:rgba(var(--v-text-link-focus, 4, 112, 236, 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));border-radius:8px}:host .rich-text-content .v-rte--underline{text-decoration:underline}:host .rich-text-content .v-rte--strikethrough{text-decoration:line-through}:host .rich-text-content .v-rte--underline.v-rte--strikethrough{text-decoration:underline line-through}:host .rich-text-content .v-rte--horizontal-alignment-right{text-align:right}:host .rich-text-content .v-rte--horizontal-alignment-left{text-align:left}:host .rich-text-content .v-rte--horizontal-alignment-center{text-align:center}:host .rich-text-content .v-rte--horizontal-alignment-justify{text-align:justify}:host .rich-text-content .v-rte--code{font-family:"Roboto Mono";white-space:pre-wrap}:host .rich-text-content img{cursor:pointer}:host .rich-text-content ul.v-rte--list,:host .rich-text-content ol.v-rte--list{padding-left:8px;margin-left:16px}:host .rich-text-content ul.v-rte--list>li::marker,:host .rich-text-content ol.v-rte--list>li::marker{font-size:16px}:host .rich-text-content .link-editor-wrapper{position:relative;outline:2px solid transparent;outline-offset:2px}:host .rich-text-content .link-editor-wrapper vega-rich-text-link-editor{position:absolute;bottom:0;left:0;right:0}:host .rich-text-content .code-block-container{margin-top:22px;margin-bottom:22px}:host .rich-text-content vega-code-block.focus{outline:none}:host .rich-text-content .v-rte--bold{font-weight:700}:host .rich-text-content .v-rte--italic{font-style:italic}:host .rich-text-content .v-rte--image-base img,:host .rich-text-content .v-rte--image-size-lg img,:host .rich-text-content .v-rte--image-size-md img,:host .rich-text-content .v-rte--image-size-sm img{vertical-align:bottom}:host .rich-text-content .v-rte--image-size-sm{width:25%}:host .rich-text-content .v-rte--image-size-md{width:50%}:host .rich-text-content .v-rte--image-size-lg{width:100%}:host .rich-text-content .v-rte--text-style-paragraph{font-family:"Inter";font-size:16px;line-height:22px;font-weight:500;margin:0}:host .rich-text-content .v-rte--text-style-title{font-family:"Inter";font-size:36px;line-height:40px;font-weight:500}:host .rich-text-content .v-rte--text-style-subtitle{font-family:"Inter";font-size:28px;line-height:32px;font-weight:500}:host .rich-text-content .v-rte--text-style-heading-1{font-family:"Inter";font-size:22px;line-height:24px;font-weight:500;margin:0}:host .rich-text-content .v-rte--text-style-heading-2{font-family:"Inter";font-size:20px;line-height:24px;font-weight:500;margin:0}:host .rich-text-content .v-rte--text-style-heading-3{font-family:"Inter";font-size:18px;line-height:22px;font-weight:500;margin:0}:host .rich-text-content .v-rte--text-style-heading-4{font-family:"Inter";font-size:16px;line-height:22px;font-weight:500;margin:0}:host .rich-text-content .v-rte--text-style-heading-5{font-family:"Inter";font-size:14px;line-height:22px;font-weight:500;margin:0}:host .rich-text-content .v-rte--text-style-heading-6{font-family:"Inter";font-size:12px;line-height:22px;font-weight:500;margin:0}';export{wt as vega_rich_text_content}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as e,H as t,r as i,c as s,g as o}from"./p-6b2342e0.js";import{R as r}from"./p-8bc15ed0.js";import{s as n}from"./p-519a7d55.js";import{g as a}from"./p-49a2e141.js";import{c as l,V as p,M as d,L as h,I as c}from"./p-6e1ab235.js";import{a as v}from"./p-528748fa.js";import{R as u}from"./p-1e0a8fd3.js";import{D as f,d as g}from"./p-526e3634.js";import{C as m,z as x,A as b,V as w,h as y,B as j,u as I,g as S,d as R,t as C,R as D,S as T}from"./p-5447a8e8.js";import{V as E,I as O}from"./p-8ce9e214.js";import{m as L,n as V,o as k}from"./p-3a68b729.js";import{i as z}from"./p-d27ae9ff.js";import{C as P}from"./p-2d0d575f.js";import{F as A}from"./p-cb378636.js";import{c as _}from"./p-3a620268.js";import{c as N}from"./p-1ec763ab.js";import{c as B}from"./p-613ddaab.js";import{V as F}from"./p-6031bed1.js";import{h as U,l as G}from"./p-f0e828d8.js";import{F as M}from"./p-e1029acc.js";import{P as K}from"./p-81dd00d0.js";import{c as W}from"./p-66647244.js";import{C as H}from"./p-2c737fc8.js";import{a1 as $,a3 as q}from"./p-456f678b.js";import{M as J}from"./p-78a57a17.js";import{T as Q}from"./p-52b8f2d2.js";import{T as X}from"./p-cd69aeae.js";import{r as Y}from"./p-77e64f26.js";import{I as Z}from"./p-abd7aeaa.js";import{V as ee}from"./p-874e5624.js";import"./p-87a4d75f.js";import"./p-982747ef.js";import"./p-d4ea8e22.js";import"./p-ed45b3b6.js";import"./p-262ec334.js";import"./p-0c667d6a.js";import"./p-331a62d5.js";import"./p-ffdc25ec.js";import"./p-afcd8f04.js";import"./p-6a334573.js";import"./p-8b5d3a52.js";import"./p-b75ee3ba.js";import"./p-02841589.js";import"./p-71909102.js";import"./p-29e3eb12.js";import"./p-8c30a60d.js";import"./p-5f377954.js";import"./p-b438e68b.js";var te=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class ie extends p{constructor(){super(...arguments),this.renderErrorMessage=()=>e("div",{class:"vega-input-select-error-message"}),this.renderHelpMessage=()=>e("div",{class:"vega-input-select-hint"},this.hint),this.handleLabelButtonClick=()=>{this.labelButtonClickEventEmitter.emit()}}render(){return e(t,{class:v([this.disabled?"vega-input-select-disabled":"",u.formatCustom(this.size)])},this.renderLabel(),this.dropdownRenderer.render(),this.renderErrorMessage(),this.hint&&this.renderHelpMessage())}renderLabel(){return this.label&&e("vega-field-label",{"is-field-required":this.required,disabled:this.disabled,optional:this.optional,label:this.label,suffixButtonConfig:this.labelSuffixButtonConfig,ref:e=>{f.addUniqueObserverToNode(e,m,this.handleLabelButtonClick)}})}}te([l()],ie.prototype,"disabled",void 0),te([l()],ie.prototype,"size",void 0),te([l()],ie.prototype,"hint",void 0),te([l()],ie.prototype,"label",void 0),te([l()],ie.prototype,"required",void 0),te([l()],ie.prototype,"optional",void 0),te([l()],ie.prototype,"labelSuffixButtonConfig",void 0),te([l()],ie.prototype,"labelButtonClickEventEmitter",void 0),te([l({componentFieldName:"vegaInputSelectDropdownRenderer"})],ie.prototype,"dropdownRenderer",void 0);var se=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class oe extends p{constructor(){super(...arguments),this.onDropdownShow=()=>{this.isDropdownShow=!0},this.onDropdownHide=()=>{this.isDropdownShow=!1}}addDropdownObserver(e){f.addUniqueObserverToNode(e,x,(e=>{this.onDropdownShow(),this.showEventEmitter.emit(e.detail)})),f.addUniqueObserverToNode(e,b,(e=>{this.onDropdownHide(),this.hideEventEmitter.emit(e.detail)})),f.addUniqueObserverToNode(e,w,(async e=>{this.vegaInputSelectValueController.setValue(await e.host.getSelection())})),f.addUniqueObserverToNode(e,y,(e=>{this.searchEventEmitter.emit(e.detail)})),f.addUniqueObserverToNode(e,j,(e=>{this.searchTriggerEventEmitter.emit(e.detail)})),f.addUniqueObserverToNode(e,I,(async e=>{this.vegaInputSelectValueController.setValue(await e.host.getSelection()),this.selectAllClickEventEmitter.emit(e.detail)})),f.addUniqueObserverToNode(e,L,(e=>{const t=Array.from(e).filter((e=>!this.source.find((t=>t.id===e.itemKey)))).map((e=>({id:e.itemKey,displayName:e.label})));this.sourceController.appendSourceItems(t)})),f.addUniqueObserverToNode(e,S,(async()=>{this.vegaInputSelectValueController.setValue("multiple"===this.selectType?[]:"")}))}}se([l({writable:!0})],oe.prototype,"isDropdownShow",void 0),se([l()],oe.prototype,"vegaSearch",void 0),se([l()],oe.prototype,"searchEventEmitter",void 0),se([l()],oe.prototype,"searchTriggerEventEmitter",void 0),se([l()],oe.prototype,"vegaInputSelectValueController",void 0),se([l()],oe.prototype,"sourceController",void 0),se([l()],oe.prototype,"source",void 0),se([l()],oe.prototype,"showEventEmitter",void 0),se([l()],oe.prototype,"hideEventEmitter",void 0),se([l()],oe.prototype,"vegaDropdownProps",void 0),se([l()],oe.prototype,"selectType",void 0),se([l()],oe.prototype,"selectAllClickEventEmitter",void 0);var re=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class ne extends p{constructor(){super(...arguments),this.handleValueChange=(e,t)=>{if("multiple"===this.selectType){let i;t=t,i=(e=e)?this.vegaDropdownProps.preserveValueIfNotInSource?e:e.filter((e=>this.sourceController.getItem(e))):[],z(i,t,!0)?z(i,e,!0)||this.setValue(i):(this.setValue(i),this.changeEventEmitter.emit(i),P.notify(A,{host:this.host,detail:i}))}else if(e!==t){const t=this.sourceController.getItem(e);this.setValue(this.vegaDropdownProps.preserveValueIfNotInSource?e:t?t.id:""),this.changeEventEmitter.emit(this.value),P.notify(A,{host:this.host,detail:this.value})}}}setValue(e){this.valueGuard(e)&&(this.value=e,this.vegaInputSelectItemController.setSelectedItem())}valueGuard(e){switch(this.selectType){case"single":return null===e||"string"==typeof e;case"multiple":return Array.isArray(e)&&e.every((e=>"string"==typeof e));default:return h.warn(`Invalid input select value ${e} for ${this.selectType} mode`),!1}}}re([l({writable:!0})],ne.prototype,"value",void 0),re([l()],ne.prototype,"selectType",void 0),re([l()],ne.prototype,"changeEventEmitter",void 0),re([l()],ne.prototype,"host",void 0),re([l()],ne.prototype,"sourceController",void 0),re([l()],ne.prototype,"vegaInputSelectItemController",void 0),re([l()],ne.prototype,"vegaDropdownProps",void 0),re([d("watchValue")],ne.prototype,"handleValueChange",void 0);var ae=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class le extends p{componentWillLoad(){this.setSelectedItem()}watchSelectType(){"multiple"===this.selectType?(this.selectedItem=[],this.vegaInputSelectValueController.setValue([])):(this.selectedItem=null,this.vegaInputSelectValueController.setValue(""))}setSelectedItem(){var e;if("multiple"===this.selectType){const e=this.value.map((e=>this.sourceController.getItem(e))),t=this.selectedItem?this.selectedItem.filter((e=>this.value.includes(null==e?void 0:e.id))):[];this.selectedItem=this.updateSelectedItemUnderMultiple(t,e)}else{const t=this.sourceController.getItem(this.value);this.value&&this.value===(null===(e=this.selectedItem)||void 0===e?void 0:e.id)||(this.selectedItem=null),t&&(this.selectedItem=t)}}updateSelectedItemUnderMultiple(e,t){const i=new Map(e.map((e=>[e.id,e])));return t.forEach((e=>{i.set(null==e?void 0:e.id,e)})),Array.from(i.values())}}ae([l()],le.prototype,"value",void 0),ae([l()],le.prototype,"selectType",void 0),ae([l({writable:!0})],le.prototype,"selectedItem",void 0),ae([l()],le.prototype,"sourceController",void 0),ae([l()],le.prototype,"vegaInputSelectValueController",void 0),ae([d("componentWillLoad")],le.prototype,"componentWillLoad",null),ae([d("watchSelectType")],le.prototype,"watchSelectType",null);var pe=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class de extends p{constructor(){super(...arguments),this.renderContainer=()=>e("div",{role:"button",class:"vega-input-select-container",ref:e=>this.inputSelectContainer=e,tabIndex:0,"aria-disabled":`${this.disabled}`,onKeyDown:_(),part:"select-container"},this.renderPrefixIcon(),this.renderSelectContainer(),this.renderToggleIcon()),this.renderPrefixIcon=()=>this.vegaInputSelectPrefixIconRenderer.render(),this.renderToggleIcon=()=>e("div",{class:"vega-input-select-toggle-icon",part:"toggle-icon-container"},e("vega-icon",{part:"toggle-icon",icon:F.getIconKey(this.isDropdownShow?"chevron-up":"chevron-down")})),this.renderSelectContainer=()=>{var t,i;return"function"!=typeof this.selectedLabel&&((null===(t=this.selectedLabel)||void 0===t?void 0:t.single)||(this.selectedLabel.single=(e,t)=>t.displayName),(null===(i=this.selectedLabel)||void 0===i?void 0:i.multiple)||(this.selectedLabel.multiple=e=>`${e.length} Selected`)),e("div",{class:"vega-input-select-select-container"},e("div",{class:"vega-input-select-selected-box"},"multiple"===this.selectType?this.renderMultipleSelected():this.renderSingleSelected()))},this.renderMultipleSelected=()=>{if(this.value.length>0){const t="function"==typeof this.selectedLabel?this.selectedLabel(this.value):this.selectedLabel.multiple(this.value,this.selectedItem);return e("span",{class:"vega-input-select-selected"},e("vega-text",{overflow:"ellipsis",tooltip:this.getSelectedLabelTooltipProps(),text:t,key:t}))}return e("div",{class:"vega-input-select-placeholder"},this.translationSlimmer.t(this.placeholder))},this.renderSingleSelected=()=>{var t,i;const s=this.selectedItem;(null==s?void 0:s.displayName)&&(s.displayName=U.sanitize(s.displayName,G));const o=null===(i=(t=this.selectedLabel).single)||void 0===i?void 0:i.call(t,this.value,s);return"function"==typeof this.selectedLabel&&this.selectedItem||"function"!=typeof this.selectedLabel&&o?e("span",{class:"vega-input-select-selected",part:"selected-box"},e("vega-text","function"==typeof this.selectedLabel?{overflow:"ellipsis",tooltip:this.getSelectedLabelTooltipProps(),text:s.displayName,key:s.displayName}:{overflow:"ellipsis",tooltip:this.getSelectedLabelTooltipProps(),text:o,key:o})):e("div",{class:"vega-input-select-placeholder",part:"placeholder"},this.translationSlimmer.t(this.placeholder))},this.getVegaDropdownProperties=()=>{const e=Object.assign({searchable:!0,caseSensitive:!1},this.vegaDropdownProps);return this.dropdownItemTooltipProps&&Object.keys(this.dropdownItemTooltipProps).length>0&&(e.itemTooltipProps=this.dropdownItemTooltipProps),e},this.getSelectedLabelTooltipProps=()=>Object.assign({placement:"bottom"},this.selectedLabelTooltipProps)}watchVegaDropdownProps(){this.vegaDropdownProps&&void 0!==this.vegaDropdownProps.preserveValueIfNotInSource&&(this.dropdown.preserveValueIfNotInSource=this.vegaDropdownProps.preserveValueIfNotInSource,this.dropdown.selectedSourceKey=this.value)}show(){return this.dropdown.show()}hide(){return this.dropdown.hide()}getDropdownRef(){return this.dropdown}getInputSelectContainerRef(){return this.inputSelectContainer}getItemsSlotRef(){return this.itemsSlotRef}render(){return e("vega-dropdown",Object.assign({trigger:"click",source:this.getDropdownSource(),selectType:this.selectType,selectedSourceKey:this.value,matchTargetWidth:!0},this.getVegaDropdownProperties(),{ref:e=>{this.dropdown=e,this.vegaInputSelectDropdownController.addDropdownObserver(e)},isLazyLoading:this.isLazyLoading}),this.renderContainer(),this.renderItemsSlot())}renderItemsSlot(){return this.host.querySelector("[slot=items]")&&e("div",{slot:"items",ref:e=>{this.itemsSlotRef=e}})}getDropdownSource(){return this.source.map((e=>({key:e.id,label:e.displayName})))}}F.register({"chevron-up":N,"chevron-down":B}),pe([l()],de.prototype,"value",void 0),pe([l()],de.prototype,"source",void 0),pe([l()],de.prototype,"host",void 0),pe([l()],de.prototype,"selectType",void 0),pe([l()],de.prototype,"isDropdownShow",void 0),pe([l()],de.prototype,"vegaDropdownProps",void 0),pe([l()],de.prototype,"placeholder",void 0),pe([l()],de.prototype,"selectedLabel",void 0),pe([l()],de.prototype,"isLazyLoading",void 0),pe([l()],de.prototype,"vegaInputSelectDropdownController",void 0),pe([l()],de.prototype,"vegaInputSelectPrefixIconRenderer",void 0),pe([l()],de.prototype,"translationSlimmer",void 0),pe([l()],de.prototype,"disabled",void 0),pe([l()],de.prototype,"selectedItem",void 0),pe([l()],de.prototype,"selectedLabelTooltipProps",void 0),pe([l()],de.prototype,"dropdownItemTooltipProps",void 0),pe([d("watchVegaDropdownProps")],de.prototype,"watchVegaDropdownProps",null);var he=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class ce extends p{constructor(){super(...arguments),this.hasMore=!0}componentDidLoad(){const e=this.getVirtualScroll();e&&f.addUniqueObserverToNode(e,V,this.onScrollToBottom.bind(this))}getVirtualScroll(){var e,t,i;return null===(i=null===(t=null===(e=this.vegaInputSelectDropdownRenderer.getDropdownRef().shadowRoot)||void 0===e?void 0:e.querySelector("vega-dropdown-content-box"))||void 0===t?void 0:t.shadowRoot)||void 0===i?void 0:i.querySelector("vega-virtual-scroll")}async onScrollToBottom(e){if(this.sourceLazyLoadCallback&&this.hasMore){this.isLazyLoading=!0;const t=await this.sourceLazyLoadCallback(e.endIndex);this.hasMore=t.hasMore,t.items.length>0&&this.sourceController.appendSourceItems(t.items),this.isLazyLoading=!1}}}he([l()],ce.prototype,"sourceLazyLoadCallback",void 0),he([l({writable:!0})],ce.prototype,"isLazyLoading",void 0),he([l()],ce.prototype,"sourceController",void 0),he([l()],ce.prototype,"vegaInputSelectDropdownRenderer",void 0),he([d("componentDidLoad")],ce.prototype,"componentDidLoad",null);const ve=[{payloadKey:"AUTO_VALIDATION_IS_TRUE",payloadDescription:"Specifies whether the system should automatically carry out validation checks on the user's selection in real-time, ensuring that the input adheres to predefined criteria before submission or proceeding further",payloadValue:e=>!0===e.autoValidation},{payloadKey:"AUTO_VALIDATION_IS_FALSE",payloadDescription:"Specifies whether the system should automatically carry out validation checks on the user's selection in real-time, ensuring that the input adheres to predefined criteria before submission or proceeding further",payloadValue:e=>!1===e.autoValidation},{payloadKey:"IS_USING_TEMPLATE",payloadDescription:"Contains the data records to be rendered and displayed within the input select",payloadValue:e=>0===e.source.length},{payloadKey:"IS_USING_DATA_SOURCE",payloadDescription:"Contains the data records to be rendered and displayed within the input select",payloadValue:e=>e.source.length>0}];var ue=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class fe extends p{constructor(){super(...arguments),this.handleSourceChange=()=>{this.host.dataset.source=JSON.stringify(this.source),this.source=$(this.source,q)?this.source:[],this.vegaInputSelectItemController.setSelectedItem()}}appendSourceItems(e){this.source=[...this.source,...e]}getItem(e){return this.source.find((t=>t.id===e))}}ue([l()],fe.prototype,"host",void 0),ue([l({writable:!0})],fe.prototype,"source",void 0),ue([l()],fe.prototype,"vegaInputSelectItemController",void 0),ue([d("watchSource")],fe.prototype,"handleSourceChange",void 0);var ge=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class me extends p{constructor(){super(...arguments),this.mutationObserver=new J({target:()=>this.getItemsContainer()||this.host,mutationFilter:Q("VEGA-DROPDOWN-ITEM"),options:{childList:!0,subtree:!0},callback:()=>this.appendHostItemsToDropdown()})}componentDidLoad(){this.appendHostItemsToDropdown()}appendHostItemsToDropdown(){const e=this.getItemsContainer(),t=this.vegaInputSelectDropdownRenderer.getItemsSlotRef(),i=this.vegaInputSelectDropdownRenderer.getDropdownRef();e&&t&&(t.remove(),i.append(e)),t&&i.syncTemplateData()}getItemsContainer(){const e=this.vegaInputSelectDropdownRenderer.getDropdownRef();return this.host.querySelector("[slot=items]")||(null==e?void 0:e.querySelector("[slot=items]"))}}ge([c()],me.prototype,"mutationObserver",void 0),ge([l()],me.prototype,"host",void 0),ge([l()],me.prototype,"vegaInputSelectDropdownRenderer",void 0),ge([d("componentDidLoad")],me.prototype,"componentDidLoad",null);var xe=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class be extends p{connectedCallback(){this.remotePhoneNumberPrefixIconRenderSubject=g.getSubjectFromParentNodeByEventId(this.host,k)}callRemotePrefixIconRender(...e){if(this.remotePhoneNumberPrefixIconRenderSubject){const t=Y.call(this.remotePhoneNumberPrefixIconRenderSubject,...e);if(t)return t}return null}render(){const t=this.callRemotePrefixIconRender(this.prefixIcon);return this.prefixIcon&&e("div",{class:"vega-input-select-prefix-icon"},t||e("vega-icon",{icon:this.prefixIcon,size:"size-16"}))}}xe([l()],be.prototype,"host",void 0),xe([l()],be.prototype,"prefixIcon",void 0),xe([d("connectedCallback")],be.prototype,"connectedCallback",null);class we extends Z{constructor(e){super(),this.inputSelectSourceGetter=e,this.invalidResult=e=>({isValid:!1,message:e}),this.validResult=()=>({isValid:!0,message:""})}canEvaluate(e,t){return t?this.isAcceptedInputType(e)&&!t.disabled&&t.visible:this.isAcceptedInputType(e)}evaluate(e){return"string"!=typeof e||this.inputSelectSourceGetter().find((t=>t.id===e))?Array.isArray(e)&&!e.every((e=>this.inputSelectSourceGetter().find((t=>t.id===e))))?this.invalidResult("There are values that do not exist in the source"):this.validResult():this.invalidResult("The value does not exist in the source")}shouldShowError(e){return!e.disabled&&e.visible&&(e.touched||e.modified)}isAcceptedInputType(e){return("string"==typeof e||Array.isArray(e)&&e.every((e=>"string"==typeof e)))&&e.length>0}}var ye=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};const je=class{constructor(e){i(this,e),this.vegaChange=s(this,"vegaChange",7),this.change=s(this,"change",7),this.vegaSearch=s(this,"vegaSearch",7),this.search=s(this,"search",7),this.vegaSearchTrigger=s(this,"vegaSearchTrigger",7),this.searchTrigger=s(this,"searchTrigger",7),this.vegaDropdownSelectAllClick=s(this,"vegaDropdownSelectAllClick",7),this.dropdownSelectAllClick=s(this,"dropdownSelectAllClick",7),this.vegaShow=s(this,"vegaShow",7),this.vegaHide=s(this,"vegaHide",7),this.vegaLabelButtonClick=s(this,"vegaLabelButtonClick",7),this.labelButtonClick=s(this,"labelButtonClick",7),this.globalSlimmers={},this.translationSlimmer=new X,this.sourceController=new fe,this.vegaInputSelectRenderer=new ie,this.vegaInputSelectPrefixIconRenderer=new be,this.vegaInputSelectDropdownController=new oe,this.vegaInputSelectValueController=new ne,this.vegaInputSelectDropdownRenderer=new de,this.vegaInputSelectItemsSlotController=new me,this.vegaInputSelectItemController=new le,this.formFieldControllerSlimmer=new M({propertyRules:[{propertyName:"required",ruleFactory:e=>e?new r:null},{propertyName:"data-source",ruleFactory:()=>new we((()=>this.source))}],validationRulesName:"validationRules",defaultValue:e=>"multiple"===e.selectType?[]:"",attributeGetter:e=>this[e],inputContainerGetter:()=>this.vegaInputSelectDropdownRenderer.getDropdownRef(),touchableAreaGetter:()=>[this.vegaInputSelectDropdownRenderer.getInputSelectContainerRef()]}),this.pageResizeObserverSlimmer=new K,this.lazyLoadController=new ce,this.changeEventEmitter=W(je,R),this.searchEventEmitter=W(je,C),this.searchTriggerEventEmitter=W(je,j),this.showEventEmitter=W(je,D),this.hideEventEmitter=W(je,T),this.labelButtonClickEventEmitter=W(je,m),this.selectAllClickEventEmitter=W(je,I),this.eventPrevent=new H([C,j,D,T],(()=>this.host),!0),this.dropdownEventPreventSelectAllClick=new H([I],(()=>this.vegaInputSelectDropdownRenderer.getDropdownRef()),{customPreventHandle:e=>{e.stopPropagation()}}),this.vegaComponentUsageRuntimeMetricsSlimmer=new E(ve),this.isDropdownShow=!1,this.currentBreakpoint=a(),this.isLazyLoading=!1,this.label="",this.labelSuffixButtonConfig=null,this.required=!1,this.optional=!1,this.name="",this.selectedLabel=e=>ee.t("{0} Selected",e.length),this.selectType="single",this.source=[],this.value="multiple"===this.selectType?[]:"",this.isValid=null,this.autoValidation=!0,this.validationRules=[],this.disabled=!1,this.placeholder="Please select",this.vegaDropdownProps={},this.selectedLabelTooltipProps={},this.dropdownItemTooltipProps={},this.size="default"}watchSelectType(){}watchSource(){}watchValue(e,t){}watchValidationRules(){}watchVegaDropdownProps(){}watchSelectedLabelTooltipProps(){}watchDropdownItemTooltipProps(){}componentWillLoad(){}async doClose(){await this.vegaInputSelectDropdownRenderer.hide()}async doOpen(){await this.vegaInputSelectDropdownRenderer.show()}async doChange(e){this.vegaInputSelectValueController.setValue(e)}render(){return n(this.vegaInputSelectRenderer.render(),this.host)}get host(){return o(this)}static get watchers(){return{selectType:["watchSelectType"],source:["watchSource"],value:["watchValue"],validationRules:["watchValidationRules"],vegaDropdownProps:["watchVegaDropdownProps"],selectedLabelTooltipProps:["watchSelectedLabelTooltipProps"],dropdownItemTooltipProps:["watchDropdownItemTooltipProps"]}}};ye([O()],je.prototype,"globalSlimmers",void 0),ye([c()],je.prototype,"translationSlimmer",void 0),ye([c()],je.prototype,"sourceController",void 0),ye([c()],je.prototype,"vegaInputSelectRenderer",void 0),ye([c()],je.prototype,"vegaInputSelectPrefixIconRenderer",void 0),ye([c()],je.prototype,"vegaInputSelectDropdownController",void 0),ye([c()],je.prototype,"vegaInputSelectValueController",void 0),ye([c()],je.prototype,"vegaInputSelectDropdownRenderer",void 0),ye([c()],je.prototype,"vegaInputSelectItemsSlotController",void 0),ye([c()],je.prototype,"vegaInputSelectItemController",void 0),ye([c()],je.prototype,"formFieldControllerSlimmer",void 0),ye([c()],je.prototype,"pageResizeObserverSlimmer",void 0),ye([c()],je.prototype,"lazyLoadController",void 0),ye([c()],je.prototype,"changeEventEmitter",void 0),ye([c()],je.prototype,"searchEventEmitter",void 0),ye([c()],je.prototype,"searchTriggerEventEmitter",void 0),ye([c()],je.prototype,"showEventEmitter",void 0),ye([c()],je.prototype,"hideEventEmitter",void 0),ye([c()],je.prototype,"labelButtonClickEventEmitter",void 0),ye([c()],je.prototype,"selectAllClickEventEmitter",void 0),ye([c()],je.prototype,"eventPrevent",void 0),ye([c()],je.prototype,"dropdownEventPreventSelectAllClick",void 0),ye([c()],je.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),je.style=':host{display:inline-block;width:100%;min-width:0px;text-align:left;line-height:normal;vertical-align:middle}:host(.default) .vega-input-select-container{padding-left:16px;padding-right:16px;padding-top:12px;padding-bottom:12px}:host(.small) .vega-input-select-container{padding-left:12px;padding-right:12px;padding-top:8px;padding-bottom:8px}vega-field-label{margin-bottom:8px}:host .vega-input-select-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));border-radius:8px;gap:8px;display:block;display:flex;align-items:center;cursor:pointer}:host .vega-input-select-container:hover{border:1px solid rgba(var(--v-border-input-field-hover, 115, 160, 190, 1))}:host .vega-input-select-container:focus{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 .error .vega-input-select-container{border:1px solid rgba(var(--v-border-input-field-danger, 230, 50, 87, 1))}:host .error .vega-input-select-container:hover{border:1px solid rgba(var(--v-border-input-field-danger-hover, 255, 87, 114, 1))}:host .error .vega-input-select-container:focus{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(.vega-input-select-disabled) vega-dropdown{pointer-events:none}:host(.vega-input-select-disabled) .vega-input-select-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-input-select-disabled) .vega-input-select-container:hover{border:1px solid rgba(var(--v-border-input-field-disabled, 222, 225, 227, 1))}:host(.vega-input-select-disabled) vega-icon{color:rgba(var(--v-text-disabled, 176, 180, 181, 1))}:host .vega-input-select-select-container{flex-grow:1;min-width:0px}:host .vega-input-select-selected{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));display:block;min-height:24px}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-input-select-selected{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){:host .vega-input-select-selected{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){:host .vega-input-select-selected{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}:host(.vega-input-select-disabled) .vega-input-select-selected{color:rgba(var(--v-text-input-disabled, 107, 116, 125, 1))}:host .vega-input-select-placeholder{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px;color:rgba(var(--v-text-input-placeholder, 176, 180, 181, 1));overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-height:24px}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-input-select-placeholder{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){:host .vega-input-select-placeholder{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){:host .vega-input-select-placeholder{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}:host .vega-input-select-prefix-icon{text-align:center;color:rgba(var(--v-text-secondary, 107, 116, 125, 1));font-size:0px}:host .vega-input-select-toggle-icon{width:16px;height:16px;color:rgba(var(--v-text-link, 19, 98, 226, 1))}:host .vega-error{display:inline-block;padding-left:8px;padding-right:8px;padding-top:12px;font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px;color:rgba(var(--v-text-error, 189, 41, 71, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}:host .vega-hidden{display:none}:host .vega-input-select-hint{padding-left:8px;padding-right:8px;padding-top:12px;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-input-select-hint{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .vega-input-select-hint{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .vega-input-select-hint{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}:host vega-dropdown{display:block}';export{je as vega_input_select}
|
|
1
|
+
import{h as e,H as t,r as i,c as s,g as o}from"./p-6b2342e0.js";import{R as r}from"./p-8bc15ed0.js";import{s as n}from"./p-519a7d55.js";import{g as a}from"./p-49a2e141.js";import{c as l,V as p,M as d,L as h,I as c}from"./p-6e1ab235.js";import{a as v}from"./p-528748fa.js";import{R as u}from"./p-1e0a8fd3.js";import{D as f,d as g}from"./p-526e3634.js";import{C as m,z as x,A as b,V as w,h as y,B as j,u as I,g as S,d as R,t as C,R as D,S as T}from"./p-5447a8e8.js";import{V as E,I as O}from"./p-8ce9e214.js";import{m as L,n as V,o as k}from"./p-4a2fe3a4.js";import{i as z}from"./p-d27ae9ff.js";import{C as P}from"./p-2d0d575f.js";import{F as A}from"./p-cb378636.js";import{c as _}from"./p-3a620268.js";import{c as N}from"./p-1ec763ab.js";import{c as B}from"./p-613ddaab.js";import{V as F}from"./p-6031bed1.js";import{h as U,l as G}from"./p-f0e828d8.js";import{F as M}from"./p-56db3323.js";import{P as K}from"./p-81dd00d0.js";import{c as W}from"./p-66647244.js";import{C as H}from"./p-2c737fc8.js";import{a1 as $,a3 as q}from"./p-456f678b.js";import{M as J}from"./p-78a57a17.js";import{T as Q}from"./p-52b8f2d2.js";import{T as X}from"./p-cd69aeae.js";import{r as Y}from"./p-77e64f26.js";import{I as Z}from"./p-abd7aeaa.js";import{V as ee}from"./p-874e5624.js";import"./p-87a4d75f.js";import"./p-982747ef.js";import"./p-d4ea8e22.js";import"./p-ed45b3b6.js";import"./p-262ec334.js";import"./p-0c667d6a.js";import"./p-331a62d5.js";import"./p-ffdc25ec.js";import"./p-afcd8f04.js";import"./p-6a334573.js";import"./p-8b5d3a52.js";import"./p-b75ee3ba.js";import"./p-02841589.js";import"./p-71909102.js";import"./p-c41a2d4a.js";import"./p-8c30a60d.js";import"./p-5f377954.js";import"./p-b438e68b.js";var te=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class ie extends p{constructor(){super(...arguments),this.renderErrorMessage=()=>e("div",{class:"vega-input-select-error-message"}),this.renderHelpMessage=()=>e("div",{class:"vega-input-select-hint"},this.hint),this.handleLabelButtonClick=()=>{this.labelButtonClickEventEmitter.emit()}}render(){return e(t,{class:v([this.disabled?"vega-input-select-disabled":"",u.formatCustom(this.size)])},this.renderLabel(),this.dropdownRenderer.render(),this.renderErrorMessage(),this.hint&&this.renderHelpMessage())}renderLabel(){return this.label&&e("vega-field-label",{"is-field-required":this.required,disabled:this.disabled,optional:this.optional,label:this.label,suffixButtonConfig:this.labelSuffixButtonConfig,ref:e=>{f.addUniqueObserverToNode(e,m,this.handleLabelButtonClick)}})}}te([l()],ie.prototype,"disabled",void 0),te([l()],ie.prototype,"size",void 0),te([l()],ie.prototype,"hint",void 0),te([l()],ie.prototype,"label",void 0),te([l()],ie.prototype,"required",void 0),te([l()],ie.prototype,"optional",void 0),te([l()],ie.prototype,"labelSuffixButtonConfig",void 0),te([l()],ie.prototype,"labelButtonClickEventEmitter",void 0),te([l({componentFieldName:"vegaInputSelectDropdownRenderer"})],ie.prototype,"dropdownRenderer",void 0);var se=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class oe extends p{constructor(){super(...arguments),this.onDropdownShow=()=>{this.isDropdownShow=!0},this.onDropdownHide=()=>{this.isDropdownShow=!1}}addDropdownObserver(e){f.addUniqueObserverToNode(e,x,(e=>{this.onDropdownShow(),this.showEventEmitter.emit(e.detail)})),f.addUniqueObserverToNode(e,b,(e=>{this.onDropdownHide(),this.hideEventEmitter.emit(e.detail)})),f.addUniqueObserverToNode(e,w,(async e=>{this.vegaInputSelectValueController.setValue(await e.host.getSelection())})),f.addUniqueObserverToNode(e,y,(e=>{this.searchEventEmitter.emit(e.detail)})),f.addUniqueObserverToNode(e,j,(e=>{this.searchTriggerEventEmitter.emit(e.detail)})),f.addUniqueObserverToNode(e,I,(async e=>{this.vegaInputSelectValueController.setValue(await e.host.getSelection()),this.selectAllClickEventEmitter.emit(e.detail)})),f.addUniqueObserverToNode(e,L,(e=>{const t=Array.from(e).filter((e=>!this.source.find((t=>t.id===e.itemKey)))).map((e=>({id:e.itemKey,displayName:e.label})));this.sourceController.appendSourceItems(t)})),f.addUniqueObserverToNode(e,S,(async()=>{this.vegaInputSelectValueController.setValue("multiple"===this.selectType?[]:"")}))}}se([l({writable:!0})],oe.prototype,"isDropdownShow",void 0),se([l()],oe.prototype,"vegaSearch",void 0),se([l()],oe.prototype,"searchEventEmitter",void 0),se([l()],oe.prototype,"searchTriggerEventEmitter",void 0),se([l()],oe.prototype,"vegaInputSelectValueController",void 0),se([l()],oe.prototype,"sourceController",void 0),se([l()],oe.prototype,"source",void 0),se([l()],oe.prototype,"showEventEmitter",void 0),se([l()],oe.prototype,"hideEventEmitter",void 0),se([l()],oe.prototype,"vegaDropdownProps",void 0),se([l()],oe.prototype,"selectType",void 0),se([l()],oe.prototype,"selectAllClickEventEmitter",void 0);var re=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class ne extends p{constructor(){super(...arguments),this.handleValueChange=(e,t)=>{if("multiple"===this.selectType){let i;t=t,i=(e=e)?this.vegaDropdownProps.preserveValueIfNotInSource?e:e.filter((e=>this.sourceController.getItem(e))):[],z(i,t,!0)?z(i,e,!0)||this.setValue(i):(this.setValue(i),this.changeEventEmitter.emit(i),P.notify(A,{host:this.host,detail:i}))}else if(e!==t){const t=this.sourceController.getItem(e);this.setValue(this.vegaDropdownProps.preserveValueIfNotInSource?e:t?t.id:""),this.changeEventEmitter.emit(this.value),P.notify(A,{host:this.host,detail:this.value})}}}setValue(e){this.valueGuard(e)&&(this.value=e,this.vegaInputSelectItemController.setSelectedItem())}valueGuard(e){switch(this.selectType){case"single":return null===e||"string"==typeof e;case"multiple":return Array.isArray(e)&&e.every((e=>"string"==typeof e));default:return h.warn(`Invalid input select value ${e} for ${this.selectType} mode`),!1}}}re([l({writable:!0})],ne.prototype,"value",void 0),re([l()],ne.prototype,"selectType",void 0),re([l()],ne.prototype,"changeEventEmitter",void 0),re([l()],ne.prototype,"host",void 0),re([l()],ne.prototype,"sourceController",void 0),re([l()],ne.prototype,"vegaInputSelectItemController",void 0),re([l()],ne.prototype,"vegaDropdownProps",void 0),re([d("watchValue")],ne.prototype,"handleValueChange",void 0);var ae=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class le extends p{componentWillLoad(){this.setSelectedItem()}watchSelectType(){"multiple"===this.selectType?(this.selectedItem=[],this.vegaInputSelectValueController.setValue([])):(this.selectedItem=null,this.vegaInputSelectValueController.setValue(""))}setSelectedItem(){var e;if("multiple"===this.selectType){const e=this.value.map((e=>this.sourceController.getItem(e))),t=this.selectedItem?this.selectedItem.filter((e=>this.value.includes(null==e?void 0:e.id))):[];this.selectedItem=this.updateSelectedItemUnderMultiple(t,e)}else{const t=this.sourceController.getItem(this.value);this.value&&this.value===(null===(e=this.selectedItem)||void 0===e?void 0:e.id)||(this.selectedItem=null),t&&(this.selectedItem=t)}}updateSelectedItemUnderMultiple(e,t){const i=new Map(e.map((e=>[e.id,e])));return t.forEach((e=>{i.set(null==e?void 0:e.id,e)})),Array.from(i.values())}}ae([l()],le.prototype,"value",void 0),ae([l()],le.prototype,"selectType",void 0),ae([l({writable:!0})],le.prototype,"selectedItem",void 0),ae([l()],le.prototype,"sourceController",void 0),ae([l()],le.prototype,"vegaInputSelectValueController",void 0),ae([d("componentWillLoad")],le.prototype,"componentWillLoad",null),ae([d("watchSelectType")],le.prototype,"watchSelectType",null);var pe=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class de extends p{constructor(){super(...arguments),this.renderContainer=()=>e("div",{role:"button",class:"vega-input-select-container",ref:e=>this.inputSelectContainer=e,tabIndex:0,"aria-disabled":`${this.disabled}`,onKeyDown:_(),part:"select-container"},this.renderPrefixIcon(),this.renderSelectContainer(),this.renderToggleIcon()),this.renderPrefixIcon=()=>this.vegaInputSelectPrefixIconRenderer.render(),this.renderToggleIcon=()=>e("div",{class:"vega-input-select-toggle-icon",part:"toggle-icon-container"},e("vega-icon",{part:"toggle-icon",icon:F.getIconKey(this.isDropdownShow?"chevron-up":"chevron-down")})),this.renderSelectContainer=()=>{var t,i;return"function"!=typeof this.selectedLabel&&((null===(t=this.selectedLabel)||void 0===t?void 0:t.single)||(this.selectedLabel.single=(e,t)=>t.displayName),(null===(i=this.selectedLabel)||void 0===i?void 0:i.multiple)||(this.selectedLabel.multiple=e=>`${e.length} Selected`)),e("div",{class:"vega-input-select-select-container"},e("div",{class:"vega-input-select-selected-box"},"multiple"===this.selectType?this.renderMultipleSelected():this.renderSingleSelected()))},this.renderMultipleSelected=()=>{if(this.value.length>0){const t="function"==typeof this.selectedLabel?this.selectedLabel(this.value):this.selectedLabel.multiple(this.value,this.selectedItem);return e("span",{class:"vega-input-select-selected"},e("vega-text",{overflow:"ellipsis",tooltip:this.getSelectedLabelTooltipProps(),text:t,key:t}))}return e("div",{class:"vega-input-select-placeholder"},this.translationSlimmer.t(this.placeholder))},this.renderSingleSelected=()=>{var t,i;const s=this.selectedItem;(null==s?void 0:s.displayName)&&(s.displayName=U.sanitize(s.displayName,G));const o=null===(i=(t=this.selectedLabel).single)||void 0===i?void 0:i.call(t,this.value,s);return"function"==typeof this.selectedLabel&&this.selectedItem||"function"!=typeof this.selectedLabel&&o?e("span",{class:"vega-input-select-selected",part:"selected-box"},e("vega-text","function"==typeof this.selectedLabel?{overflow:"ellipsis",tooltip:this.getSelectedLabelTooltipProps(),text:s.displayName,key:s.displayName}:{overflow:"ellipsis",tooltip:this.getSelectedLabelTooltipProps(),text:o,key:o})):e("div",{class:"vega-input-select-placeholder",part:"placeholder"},this.translationSlimmer.t(this.placeholder))},this.getVegaDropdownProperties=()=>{const e=Object.assign({searchable:!0,caseSensitive:!1},this.vegaDropdownProps);return this.dropdownItemTooltipProps&&Object.keys(this.dropdownItemTooltipProps).length>0&&(e.itemTooltipProps=this.dropdownItemTooltipProps),e},this.getSelectedLabelTooltipProps=()=>Object.assign({placement:"bottom"},this.selectedLabelTooltipProps)}watchVegaDropdownProps(){this.vegaDropdownProps&&void 0!==this.vegaDropdownProps.preserveValueIfNotInSource&&(this.dropdown.preserveValueIfNotInSource=this.vegaDropdownProps.preserveValueIfNotInSource,this.dropdown.selectedSourceKey=this.value)}show(){return this.dropdown.show()}hide(){return this.dropdown.hide()}getDropdownRef(){return this.dropdown}getInputSelectContainerRef(){return this.inputSelectContainer}getItemsSlotRef(){return this.itemsSlotRef}render(){return e("vega-dropdown",Object.assign({trigger:"click",source:this.getDropdownSource(),selectType:this.selectType,selectedSourceKey:this.value,matchTargetWidth:!0},this.getVegaDropdownProperties(),{ref:e=>{this.dropdown=e,this.vegaInputSelectDropdownController.addDropdownObserver(e)},isLazyLoading:this.isLazyLoading}),this.renderContainer(),this.renderItemsSlot())}renderItemsSlot(){return this.host.querySelector("[slot=items]")&&e("div",{slot:"items",ref:e=>{this.itemsSlotRef=e}})}getDropdownSource(){return this.source.map((e=>({key:e.id,label:e.displayName})))}}F.register({"chevron-up":N,"chevron-down":B}),pe([l()],de.prototype,"value",void 0),pe([l()],de.prototype,"source",void 0),pe([l()],de.prototype,"host",void 0),pe([l()],de.prototype,"selectType",void 0),pe([l()],de.prototype,"isDropdownShow",void 0),pe([l()],de.prototype,"vegaDropdownProps",void 0),pe([l()],de.prototype,"placeholder",void 0),pe([l()],de.prototype,"selectedLabel",void 0),pe([l()],de.prototype,"isLazyLoading",void 0),pe([l()],de.prototype,"vegaInputSelectDropdownController",void 0),pe([l()],de.prototype,"vegaInputSelectPrefixIconRenderer",void 0),pe([l()],de.prototype,"translationSlimmer",void 0),pe([l()],de.prototype,"disabled",void 0),pe([l()],de.prototype,"selectedItem",void 0),pe([l()],de.prototype,"selectedLabelTooltipProps",void 0),pe([l()],de.prototype,"dropdownItemTooltipProps",void 0),pe([d("watchVegaDropdownProps")],de.prototype,"watchVegaDropdownProps",null);var he=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class ce extends p{constructor(){super(...arguments),this.hasMore=!0}componentDidLoad(){const e=this.getVirtualScroll();e&&f.addUniqueObserverToNode(e,V,this.onScrollToBottom.bind(this))}getVirtualScroll(){var e,t,i;return null===(i=null===(t=null===(e=this.vegaInputSelectDropdownRenderer.getDropdownRef().shadowRoot)||void 0===e?void 0:e.querySelector("vega-dropdown-content-box"))||void 0===t?void 0:t.shadowRoot)||void 0===i?void 0:i.querySelector("vega-virtual-scroll")}async onScrollToBottom(e){if(this.sourceLazyLoadCallback&&this.hasMore){this.isLazyLoading=!0;const t=await this.sourceLazyLoadCallback(e.endIndex);this.hasMore=t.hasMore,t.items.length>0&&this.sourceController.appendSourceItems(t.items),this.isLazyLoading=!1}}}he([l()],ce.prototype,"sourceLazyLoadCallback",void 0),he([l({writable:!0})],ce.prototype,"isLazyLoading",void 0),he([l()],ce.prototype,"sourceController",void 0),he([l()],ce.prototype,"vegaInputSelectDropdownRenderer",void 0),he([d("componentDidLoad")],ce.prototype,"componentDidLoad",null);const ve=[{payloadKey:"AUTO_VALIDATION_IS_TRUE",payloadDescription:"Specifies whether the system should automatically carry out validation checks on the user's selection in real-time, ensuring that the input adheres to predefined criteria before submission or proceeding further",payloadValue:e=>!0===e.autoValidation},{payloadKey:"AUTO_VALIDATION_IS_FALSE",payloadDescription:"Specifies whether the system should automatically carry out validation checks on the user's selection in real-time, ensuring that the input adheres to predefined criteria before submission or proceeding further",payloadValue:e=>!1===e.autoValidation},{payloadKey:"IS_USING_TEMPLATE",payloadDescription:"Contains the data records to be rendered and displayed within the input select",payloadValue:e=>0===e.source.length},{payloadKey:"IS_USING_DATA_SOURCE",payloadDescription:"Contains the data records to be rendered and displayed within the input select",payloadValue:e=>e.source.length>0}];var ue=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class fe extends p{constructor(){super(...arguments),this.handleSourceChange=()=>{this.host.dataset.source=JSON.stringify(this.source),this.source=$(this.source,q)?this.source:[],this.vegaInputSelectItemController.setSelectedItem()}}appendSourceItems(e){this.source=[...this.source,...e]}getItem(e){return this.source.find((t=>t.id===e))}}ue([l()],fe.prototype,"host",void 0),ue([l({writable:!0})],fe.prototype,"source",void 0),ue([l()],fe.prototype,"vegaInputSelectItemController",void 0),ue([d("watchSource")],fe.prototype,"handleSourceChange",void 0);var ge=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class me extends p{constructor(){super(...arguments),this.mutationObserver=new J({target:()=>this.getItemsContainer()||this.host,mutationFilter:Q("VEGA-DROPDOWN-ITEM"),options:{childList:!0,subtree:!0},callback:()=>this.appendHostItemsToDropdown()})}componentDidLoad(){this.appendHostItemsToDropdown()}appendHostItemsToDropdown(){const e=this.getItemsContainer(),t=this.vegaInputSelectDropdownRenderer.getItemsSlotRef(),i=this.vegaInputSelectDropdownRenderer.getDropdownRef();e&&t&&(t.remove(),i.append(e)),t&&i.syncTemplateData()}getItemsContainer(){const e=this.vegaInputSelectDropdownRenderer.getDropdownRef();return this.host.querySelector("[slot=items]")||(null==e?void 0:e.querySelector("[slot=items]"))}}ge([c()],me.prototype,"mutationObserver",void 0),ge([l()],me.prototype,"host",void 0),ge([l()],me.prototype,"vegaInputSelectDropdownRenderer",void 0),ge([d("componentDidLoad")],me.prototype,"componentDidLoad",null);var xe=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class be extends p{connectedCallback(){this.remotePhoneNumberPrefixIconRenderSubject=g.getSubjectFromParentNodeByEventId(this.host,k)}callRemotePrefixIconRender(...e){if(this.remotePhoneNumberPrefixIconRenderSubject){const t=Y.call(this.remotePhoneNumberPrefixIconRenderSubject,...e);if(t)return t}return null}render(){const t=this.callRemotePrefixIconRender(this.prefixIcon);return this.prefixIcon&&e("div",{class:"vega-input-select-prefix-icon"},t||e("vega-icon",{icon:this.prefixIcon,size:"size-16"}))}}xe([l()],be.prototype,"host",void 0),xe([l()],be.prototype,"prefixIcon",void 0),xe([d("connectedCallback")],be.prototype,"connectedCallback",null);class we extends Z{constructor(e){super(),this.inputSelectSourceGetter=e,this.invalidResult=e=>({isValid:!1,message:e}),this.validResult=()=>({isValid:!0,message:""})}canEvaluate(e,t){return t?this.isAcceptedInputType(e)&&!t.disabled&&t.visible:this.isAcceptedInputType(e)}evaluate(e){return"string"!=typeof e||this.inputSelectSourceGetter().find((t=>t.id===e))?Array.isArray(e)&&!e.every((e=>this.inputSelectSourceGetter().find((t=>t.id===e))))?this.invalidResult("There are values that do not exist in the source"):this.validResult():this.invalidResult("The value does not exist in the source")}shouldShowError(e){return!e.disabled&&e.visible&&(e.touched||e.modified)}isAcceptedInputType(e){return("string"==typeof e||Array.isArray(e)&&e.every((e=>"string"==typeof e)))&&e.length>0}}var ye=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};const je=class{constructor(e){i(this,e),this.vegaChange=s(this,"vegaChange",7),this.change=s(this,"change",7),this.vegaSearch=s(this,"vegaSearch",7),this.search=s(this,"search",7),this.vegaSearchTrigger=s(this,"vegaSearchTrigger",7),this.searchTrigger=s(this,"searchTrigger",7),this.vegaDropdownSelectAllClick=s(this,"vegaDropdownSelectAllClick",7),this.dropdownSelectAllClick=s(this,"dropdownSelectAllClick",7),this.vegaShow=s(this,"vegaShow",7),this.vegaHide=s(this,"vegaHide",7),this.vegaLabelButtonClick=s(this,"vegaLabelButtonClick",7),this.labelButtonClick=s(this,"labelButtonClick",7),this.globalSlimmers={},this.translationSlimmer=new X,this.sourceController=new fe,this.vegaInputSelectRenderer=new ie,this.vegaInputSelectPrefixIconRenderer=new be,this.vegaInputSelectDropdownController=new oe,this.vegaInputSelectValueController=new ne,this.vegaInputSelectDropdownRenderer=new de,this.vegaInputSelectItemsSlotController=new me,this.vegaInputSelectItemController=new le,this.formFieldControllerSlimmer=new M({propertyRules:[{propertyName:"required",ruleFactory:e=>e?new r:null},{propertyName:"data-source",ruleFactory:()=>new we((()=>this.source))}],validationRulesName:"validationRules",defaultValue:e=>"multiple"===e.selectType?[]:"",attributeGetter:e=>this[e],inputContainerGetter:()=>this.vegaInputSelectDropdownRenderer.getDropdownRef(),touchableAreaGetter:()=>[this.vegaInputSelectDropdownRenderer.getInputSelectContainerRef()]}),this.pageResizeObserverSlimmer=new K,this.lazyLoadController=new ce,this.changeEventEmitter=W(je,R),this.searchEventEmitter=W(je,C),this.searchTriggerEventEmitter=W(je,j),this.showEventEmitter=W(je,D),this.hideEventEmitter=W(je,T),this.labelButtonClickEventEmitter=W(je,m),this.selectAllClickEventEmitter=W(je,I),this.eventPrevent=new H([C,j,D,T],(()=>this.host),!0),this.dropdownEventPreventSelectAllClick=new H([I],(()=>this.vegaInputSelectDropdownRenderer.getDropdownRef()),{customPreventHandle:e=>{e.stopPropagation()}}),this.vegaComponentUsageRuntimeMetricsSlimmer=new E(ve),this.isDropdownShow=!1,this.currentBreakpoint=a(),this.isLazyLoading=!1,this.label="",this.labelSuffixButtonConfig=null,this.required=!1,this.optional=!1,this.name="",this.selectedLabel=e=>ee.t("{0} Selected",e.length),this.selectType="single",this.source=[],this.value="multiple"===this.selectType?[]:"",this.isValid=null,this.autoValidation=!0,this.validationRules=[],this.disabled=!1,this.placeholder="Please select",this.vegaDropdownProps={},this.selectedLabelTooltipProps={},this.dropdownItemTooltipProps={},this.size="default"}watchSelectType(){}watchSource(){}watchValue(e,t){}watchValidationRules(){}watchVegaDropdownProps(){}watchSelectedLabelTooltipProps(){}watchDropdownItemTooltipProps(){}componentWillLoad(){}async doClose(){await this.vegaInputSelectDropdownRenderer.hide()}async doOpen(){await this.vegaInputSelectDropdownRenderer.show()}async doChange(e){this.vegaInputSelectValueController.setValue(e)}render(){return n(this.vegaInputSelectRenderer.render(),this.host)}get host(){return o(this)}static get watchers(){return{selectType:["watchSelectType"],source:["watchSource"],value:["watchValue"],validationRules:["watchValidationRules"],vegaDropdownProps:["watchVegaDropdownProps"],selectedLabelTooltipProps:["watchSelectedLabelTooltipProps"],dropdownItemTooltipProps:["watchDropdownItemTooltipProps"]}}};ye([O()],je.prototype,"globalSlimmers",void 0),ye([c()],je.prototype,"translationSlimmer",void 0),ye([c()],je.prototype,"sourceController",void 0),ye([c()],je.prototype,"vegaInputSelectRenderer",void 0),ye([c()],je.prototype,"vegaInputSelectPrefixIconRenderer",void 0),ye([c()],je.prototype,"vegaInputSelectDropdownController",void 0),ye([c()],je.prototype,"vegaInputSelectValueController",void 0),ye([c()],je.prototype,"vegaInputSelectDropdownRenderer",void 0),ye([c()],je.prototype,"vegaInputSelectItemsSlotController",void 0),ye([c()],je.prototype,"vegaInputSelectItemController",void 0),ye([c()],je.prototype,"formFieldControllerSlimmer",void 0),ye([c()],je.prototype,"pageResizeObserverSlimmer",void 0),ye([c()],je.prototype,"lazyLoadController",void 0),ye([c()],je.prototype,"changeEventEmitter",void 0),ye([c()],je.prototype,"searchEventEmitter",void 0),ye([c()],je.prototype,"searchTriggerEventEmitter",void 0),ye([c()],je.prototype,"showEventEmitter",void 0),ye([c()],je.prototype,"hideEventEmitter",void 0),ye([c()],je.prototype,"labelButtonClickEventEmitter",void 0),ye([c()],je.prototype,"selectAllClickEventEmitter",void 0),ye([c()],je.prototype,"eventPrevent",void 0),ye([c()],je.prototype,"dropdownEventPreventSelectAllClick",void 0),ye([c()],je.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),je.style=':host{display:inline-block;width:100%;min-width:0px;text-align:left;line-height:normal;vertical-align:middle}:host(.default) .vega-input-select-container{padding-left:16px;padding-right:16px;padding-top:12px;padding-bottom:12px}:host(.small) .vega-input-select-container{padding-left:12px;padding-right:12px;padding-top:8px;padding-bottom:8px}vega-field-label{margin-bottom:8px}:host .vega-input-select-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));border-radius:8px;gap:8px;display:block;display:flex;align-items:center;cursor:pointer}:host .vega-input-select-container:hover{border:1px solid rgba(var(--v-border-input-field-hover, 115, 160, 190, 1))}:host .vega-input-select-container:focus{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 .error .vega-input-select-container{border:1px solid rgba(var(--v-border-input-field-danger, 230, 50, 87, 1))}:host .error .vega-input-select-container:hover{border:1px solid rgba(var(--v-border-input-field-danger-hover, 255, 87, 114, 1))}:host .error .vega-input-select-container:focus{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(.vega-input-select-disabled) vega-dropdown{pointer-events:none}:host(.vega-input-select-disabled) .vega-input-select-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-input-select-disabled) .vega-input-select-container:hover{border:1px solid rgba(var(--v-border-input-field-disabled, 222, 225, 227, 1))}:host(.vega-input-select-disabled) vega-icon{color:rgba(var(--v-text-disabled, 176, 180, 181, 1))}:host .vega-input-select-select-container{flex-grow:1;min-width:0px}:host .vega-input-select-selected{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));display:block;min-height:24px}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-input-select-selected{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){:host .vega-input-select-selected{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){:host .vega-input-select-selected{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}:host(.vega-input-select-disabled) .vega-input-select-selected{color:rgba(var(--v-text-input-disabled, 107, 116, 125, 1))}:host .vega-input-select-placeholder{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px;color:rgba(var(--v-text-input-placeholder, 176, 180, 181, 1));overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-height:24px}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-input-select-placeholder{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){:host .vega-input-select-placeholder{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){:host .vega-input-select-placeholder{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}:host .vega-input-select-prefix-icon{text-align:center;color:rgba(var(--v-text-secondary, 107, 116, 125, 1));font-size:0px}:host .vega-input-select-toggle-icon{width:16px;height:16px;color:rgba(var(--v-text-link, 19, 98, 226, 1))}:host .vega-error{display:inline-block;padding-left:8px;padding-right:8px;padding-top:12px;font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px;color:rgba(var(--v-text-error, 189, 41, 71, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}:host .vega-hidden{display:none}:host .vega-input-select-hint{padding-left:8px;padding-right:8px;padding-top:12px;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-input-select-hint{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .vega-input-select-hint{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .vega-input-select-hint{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}:host vega-dropdown{display:block}';export{je as vega_input_select}
|