@heartlandone/vega 2.84.0 → 2.86.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-ea063074.js → app-globals-3080f55a.js} +5 -5
- package/dist/cjs/{child-nodes-event-prevent-slimmer-58bbc5fc.js → child-nodes-event-prevent-slimmer-f3979a03.js} +1 -1
- package/dist/cjs/{code-block-6da521e6.js → code-block-c6c70464.js} +6 -0
- package/dist/cjs/{component-value-history-controller-slimmer.abstract-f3f35f94.js → component-value-history-controller-slimmer.abstract-a523b747.js} +2 -2
- package/dist/cjs/{content-state-89fafb3b.js → content-state-efd3b1a7.js} +1 -1
- package/dist/cjs/{event-emit-slimmer-ecca412d.js → event-emit-slimmer-80e1c8ca.js} +1 -1
- package/dist/cjs/{image-annotation-action-a6e1e9ed.js → image-annotation-action-93bace08.js} +3 -3
- package/dist/cjs/{immutable-map-edf24b54.js → immutable-map-d711339d.js} +16 -4
- package/dist/cjs/index.cjs.js +9 -9
- package/dist/cjs/{internal-vega-event-manager-6b74b3af.js → internal-vega-event-manager-7e0d966d.js} +2 -1
- package/dist/cjs/loader.cjs.js +8 -8
- package/dist/cjs/{public-rules-fc52d624.js → public-rules-3cd0f182.js} +3 -3
- package/dist/cjs/{range-93cc8ab1.js → range-c9bde0b4.js} +1 -1
- package/dist/cjs/{rich-text-editor-required-rule-fd3711fb.js → rich-text-editor-required-rule-d1f0509c.js} +1 -1
- package/dist/cjs/{split-cell-operation-532fb9f0.js → split-cell-operation-6a59c9b0.js} +2 -2
- package/dist/cjs/{token-extension-39f2b886.js → token-extension-d7d2ead6.js} +282 -224
- package/dist/cjs/vega-accordion.cjs.entry.js +3 -3
- package/dist/cjs/vega-app-header-button.cjs.entry.js +4 -4
- package/dist/cjs/vega-banner.cjs.entry.js +3 -3
- package/dist/cjs/vega-breadcrumb.cjs.entry.js +4 -4
- package/dist/cjs/vega-button-circle.cjs.entry.js +4 -4
- package/dist/cjs/vega-button-group_2.cjs.entry.js +4 -4
- package/dist/cjs/vega-button-link.cjs.entry.js +4 -4
- package/dist/cjs/vega-button.cjs.entry.js +4 -4
- package/dist/cjs/vega-calendar_4.cjs.entry.js +8 -7
- package/dist/cjs/vega-carousel.cjs.entry.js +3 -3
- package/dist/cjs/vega-checkbox_2.cjs.entry.js +4 -4
- package/dist/cjs/vega-chip.cjs.entry.js +4 -4
- package/dist/cjs/vega-code-block.cjs.entry.js +7 -7
- package/dist/cjs/vega-color-picker.cjs.entry.js +3 -3
- package/dist/cjs/vega-color-swatch-picker.cjs.entry.js +188 -46
- package/dist/cjs/vega-color-swatch.cjs.entry.js +7 -7
- package/dist/cjs/vega-combo-box.cjs.entry.js +4 -4
- package/dist/cjs/vega-date-picker_2.cjs.entry.js +17 -5
- package/dist/cjs/vega-dialog_2.cjs.entry.js +5 -5
- package/dist/cjs/vega-dropdown_5.cjs.entry.js +4 -4
- package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
- package/dist/cjs/{vega-event-id-c08ce3d3.js → vega-event-id-d9994eb3.js} +2 -0
- package/dist/cjs/vega-field-label.cjs.entry.js +3 -3
- package/dist/cjs/vega-file-uploader.cjs.entry.js +3 -3
- package/dist/cjs/vega-form.cjs.entry.js +5 -5
- package/dist/cjs/vega-image-uploader.cjs.entry.js +4 -4
- package/dist/cjs/vega-input-credit-card.cjs.entry.js +4 -4
- package/dist/cjs/vega-input-numeric.cjs.entry.js +4 -4
- package/dist/cjs/vega-input-passcode.cjs.entry.js +4 -4
- package/dist/cjs/vega-input-phone-number.cjs.entry.js +15 -5
- package/dist/cjs/vega-input-range.cjs.entry.js +4 -4
- package/dist/cjs/vega-input-select.cjs.entry.js +4 -4
- package/dist/cjs/vega-input.cjs.entry.js +3 -3
- package/dist/cjs/vega-item-toggle.cjs.entry.js +3 -3
- package/dist/cjs/vega-left-nav_5.cjs.entry.js +15 -13
- package/dist/cjs/vega-page-notification_2.cjs.entry.js +1 -1
- package/dist/cjs/vega-pagination-page-selector-mobile.cjs.entry.js +3 -3
- package/dist/cjs/vega-pagination-page-size-selector-mobile.cjs.entry.js +1 -1
- package/dist/cjs/vega-pagination.cjs.entry.js +4 -4
- 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 +4 -4
- package/dist/cjs/vega-rich-text-content.cjs.entry.js +4 -4
- package/dist/cjs/vega-rich-text-editor_4.cjs.entry.js +10 -10
- package/dist/cjs/vega-rich-text-table-properties_3.cjs.entry.js +6 -6
- package/dist/cjs/vega-segment-control.cjs.entry.js +3 -3
- package/dist/cjs/vega-selection-chip_2.cjs.entry.js +4 -4
- package/dist/cjs/vega-selection-tile_2.cjs.entry.js +161 -28
- 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 +4 -4
- package/dist/cjs/vega-tab-group_2.cjs.entry.js +4 -4
- package/dist/cjs/vega-table_11.cjs.entry.js +1172 -282
- package/dist/cjs/vega-textarea.cjs.entry.js +4 -4
- package/dist/cjs/vega-time-picker_2.cjs.entry.js +9 -15
- package/dist/cjs/vega-toggle-switch.cjs.entry.js +3 -3
- package/dist/cjs/vega.cjs.js +8 -8
- package/dist/collection/components/vega-calendar/slimmers/day-view/renderers/vega-calendar-view-with-time-renderer.js +2 -2
- package/dist/collection/components/vega-calendar/slimmers/month-view/renderers/vega-calendar-month-view-renderer.js +2 -1
- package/dist/collection/components/vega-color-swatch/vega-color-swatch-picker/slimmers/renderers/color-swatch-picker-renderer.js +24 -5
- package/dist/collection/components/vega-color-swatch/vega-color-swatch-picker/vega-color-swatch-picker.js +15 -0
- package/dist/collection/components/vega-color-swatch/vega-color-swatch.js +6 -6
- package/dist/collection/components/vega-date-picker/vega-date-picker-calendar/slimmers/renderers/vega-date-picker-month-item-renderer.js +3 -0
- package/dist/collection/components/vega-date-picker/vega-date-picker-calendar/vega-date-picker-calendar.css +17 -1
- package/dist/collection/components/vega-date-picker/vega-date-picker-calendar/vega-date-picker-calendar.js +31 -1
- package/dist/collection/components/vega-input-phone-number/vega-input-phone-number.js +10 -0
- package/dist/collection/components/vega-modal/slimmers/renderers/vega-modal-renderer.js +1 -1
- package/dist/collection/components/vega-nav/vega-left-nav/slimmers/controllers/vega-left-nav-backdrop-controller.js +10 -8
- package/dist/collection/components/vega-nav/vega-left-nav/slimmers/controllers/vega-left-nav-zindex-controller.js +2 -2
- package/dist/collection/components/vega-rich-text-editor/dto/nodes/text-node.js +6 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/base-toolbar-button-renderer.js +8 -2
- package/dist/collection/components/vega-rich-text-editor/extensions/functions/renderers/function-toolbar-button-renderer.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/languages/language-toolbar-button-renderer.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/renderers/table-dynamic-popover-renderer.js +53 -51
- package/dist/collection/components/vega-rich-text-editor/extensions/table/renderers/table-renderer.js +40 -10
- package/dist/collection/components/vega-rich-text-editor/extensions/table/renderers/table-setting-popover-renderer.js +75 -62
- package/dist/collection/components/vega-rich-text-editor/extensions/table/table-extension.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/table-toolbar-button-renderer.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/tokens/token-toolbar-button-renderer.js +5 -1
- package/dist/collection/components/vega-selection-tile/slimmers/renderers/vega-selection-tile-renderer.js +71 -10
- package/dist/collection/components/vega-selection-tile/vega-selection-tile-group/slimmers/renderers/vega-selection-tile-group-renderer.js +39 -11
- package/dist/collection/components/vega-selection-tile/vega-selection-tile-group/vega-selection-tile-group.css +1 -3
- package/dist/collection/components/vega-selection-tile/vega-selection-tile.css +23 -18
- package/dist/collection/components/vega-selection-tile/vega-selection-tile.js +45 -1
- package/dist/collection/components/vega-table/slimmers/controllers/vega-table-expand-row-controller.js +88 -4
- package/dist/collection/components/vega-table/slimmers/controllers/vega-table-row-draggable-controller.js +132 -0
- package/dist/collection/components/vega-table/slimmers/controllers/vega-table-sort-controller.js +14 -0
- package/dist/collection/components/vega-table/slimmers/renderers/vega-table-body-renderer.js +8 -5
- package/dist/collection/components/vega-table/slimmers/renderers/vega-table-col-group-renderer.js +6 -2
- package/dist/collection/components/vega-table/slimmers/renderers/vega-table-pinned-renderer.js +8 -2
- package/dist/collection/components/vega-table/utils.js +4 -3
- package/dist/collection/components/vega-table/vega-table-expand-row/slimmers/controllers/vega-table-expand-row-col-span-controller.js +13 -1
- package/dist/collection/components/vega-table/vega-table-expand-row/slimmers/controllers/vega-table-expand-row-state-controller.js +7 -0
- package/dist/collection/components/vega-table/vega-table-expand-row/vega-table-expand-row.js +7 -0
- package/dist/collection/components/vega-table/vega-table-foot-row/slimmers/controllers/vega-table-foot-row-state-controller.js +10 -3
- package/dist/collection/components/vega-table/vega-table-foot-row/slimmers/renderers/vega-table-foot-row-renderer.js +9 -2
- package/dist/collection/components/vega-table/vega-table-foot-row/vega-table-foot-row.js +4 -3
- package/dist/collection/components/vega-table/vega-table-head/vega-table-head.js +5 -0
- package/dist/collection/components/vega-table/vega-table-head-row/slimmers/controllers/vega-table-head-row-state-controller.js +10 -3
- package/dist/collection/components/vega-table/vega-table-head-row/slimmers/renderers/vega-table-head-row-renderer.js +12 -2
- package/dist/collection/components/vega-table/vega-table-head-row/vega-table-head-row.js +5 -4
- package/dist/collection/components/vega-table/vega-table-row/slimmers/controllers/vega-table-row-state-controller.js +22 -1
- package/dist/collection/components/vega-table/vega-table-row/slimmers/renderers/vega-table-row-renderer.js +19 -4
- package/dist/collection/components/vega-table/vega-table-row/vega-table-row.css +6 -0
- package/dist/collection/components/vega-table/vega-table-row/vega-table-row.js +11 -1
- package/dist/collection/components/vega-table/vega-table.css +5 -0
- package/dist/collection/components/vega-table/vega-table.js +135 -11
- package/dist/collection/components/vega-time-picker/vega-time-picker.js +6 -12
- package/dist/collection/constants/ui.js +1 -0
- package/dist/collection/global/icons/grip-dots-vertical.js +3 -0
- package/dist/collection/helpers/event-manager/event-id/component-event-id-map.js +2 -1
- package/dist/collection/helpers/event-manager/event-id/vega-event-id.js +1 -0
- package/dist/collection/helpers/immutable/immutable-map.js +16 -4
- package/dist/collection/helpers/slimmers/draggable-element-slimmer.js +508 -0
- package/dist/collection/helpers/slimmers/popover-nested-slot-projection-slimmer.js +118 -0
- package/dist/esm/{app-globals-d06de2a5.js → app-globals-37536ac9.js} +5 -5
- package/dist/esm/{aria-dialog-focusable-trap-slimmer-853a91de.js → aria-dialog-focusable-trap-slimmer-6eb79723.js} +1 -1
- package/dist/esm/{child-nodes-event-prevent-slimmer-f65e2452.js → child-nodes-event-prevent-slimmer-75f93d85.js} +1 -1
- package/dist/esm/{code-block-65c8804b.js → code-block-10be3916.js} +7 -1
- package/dist/esm/{component-value-history-controller-slimmer.abstract-26c154f6.js → component-value-history-controller-slimmer.abstract-82d51b7a.js} +3 -3
- package/dist/esm/{content-state-e676bdf0.js → content-state-afeb700d.js} +2 -2
- package/dist/esm/{element-appender-slimmer-d4a82dc3.js → element-appender-slimmer-05f487d7.js} +1 -1
- package/dist/esm/{event-emit-slimmer-18711776.js → event-emit-slimmer-1c57093d.js} +1 -1
- package/dist/esm/{form-field-controller-slimmer-9a0f8c54.js → form-field-controller-slimmer-ae8478b5.js} +2 -2
- package/dist/esm/{image-annotation-action-2d87b66a.js → image-annotation-action-bad7c565.js} +3 -3
- package/dist/esm/{immutable-map-612922a2.js → immutable-map-4fe22b11.js} +16 -4
- package/dist/esm/index.js +9 -9
- package/dist/esm/{internal-vega-event-manager-bed71930.js → internal-vega-event-manager-7cdf3c28.js} +2 -1
- package/dist/esm/loader.js +9 -9
- package/dist/esm/{public-rules-a61ff09f.js → public-rules-f54e6f39.js} +4 -4
- package/dist/esm/{range-d9e55d00.js → range-f32f9185.js} +1 -1
- package/dist/esm/{rich-text-editor-required-rule-6a4c853a.js → rich-text-editor-required-rule-627fd7e4.js} +1 -1
- package/dist/esm/{split-cell-operation-2e700c5c.js → split-cell-operation-90c30861.js} +3 -3
- package/dist/esm/{string-input-formatter-slimmer-ad234bec.js → string-input-formatter-slimmer-4059080b.js} +2 -2
- package/dist/esm/{sub-state-notify-slimmer-1f907173.js → sub-state-notify-slimmer-63ecb465.js} +1 -1
- package/dist/esm/{sub-state-observer-slimmer-090c500a.js → sub-state-observer-slimmer-2adbbe00.js} +1 -1
- package/dist/esm/{token-extension-d3a46c04.js → token-extension-728c0678.js} +282 -224
- package/dist/esm/vega-accordion.entry.js +3 -3
- package/dist/esm/vega-app-header-button.entry.js +4 -4
- package/dist/esm/vega-banner.entry.js +3 -3
- package/dist/esm/vega-breadcrumb.entry.js +4 -4
- package/dist/esm/vega-button-circle.entry.js +5 -5
- package/dist/esm/vega-button-group_2.entry.js +7 -7
- package/dist/esm/vega-button-link.entry.js +4 -4
- package/dist/esm/vega-button.entry.js +5 -5
- package/dist/esm/vega-calendar_4.entry.js +11 -10
- package/dist/esm/vega-carousel.entry.js +3 -3
- package/dist/esm/vega-checkbox_2.entry.js +7 -7
- package/dist/esm/vega-chip.entry.js +4 -4
- package/dist/esm/vega-code-block.entry.js +8 -8
- package/dist/esm/vega-color-picker.entry.js +6 -6
- package/dist/esm/vega-color-swatch-picker.entry.js +192 -50
- package/dist/esm/vega-color-swatch.entry.js +7 -7
- package/dist/esm/vega-combo-box.entry.js +7 -7
- package/dist/esm/vega-date-picker_2.entry.js +24 -12
- package/dist/esm/vega-dialog_2.entry.js +7 -7
- package/dist/esm/vega-dropdown_5.entry.js +9 -9
- package/dist/esm/vega-env-manager-8f8dc473.js +2 -2
- package/dist/esm/{vega-event-id-5841d1d3.js → vega-event-id-a6ccca66.js} +2 -1
- package/dist/esm/vega-field-label.entry.js +3 -3
- package/dist/esm/vega-file-uploader.entry.js +6 -6
- package/dist/esm/vega-form.entry.js +9 -9
- package/dist/esm/vega-image-uploader.entry.js +7 -7
- package/dist/esm/vega-input-credit-card.entry.js +7 -7
- package/dist/esm/vega-input-numeric.entry.js +8 -8
- package/dist/esm/vega-input-passcode.entry.js +7 -7
- package/dist/esm/vega-input-phone-number.entry.js +18 -8
- package/dist/esm/vega-input-range.entry.js +7 -7
- package/dist/esm/vega-input-select.entry.js +7 -7
- package/dist/esm/vega-input.entry.js +8 -8
- package/dist/esm/{vega-internal-event-id-194bac82.js → vega-internal-event-id-db974a0d.js} +1 -1
- package/dist/esm/vega-item-toggle.entry.js +3 -3
- package/dist/esm/vega-left-nav_5.entry.js +18 -16
- package/dist/esm/vega-page-notification_2.entry.js +1 -1
- package/dist/esm/vega-pagination-page-selector-mobile.entry.js +4 -4
- package/dist/esm/vega-pagination-page-size-selector-mobile.entry.js +2 -2
- package/dist/esm/vega-pagination.entry.js +5 -5
- package/dist/esm/vega-popover_2.entry.js +6 -6
- package/dist/esm/vega-progress-tracker_2.entry.js +6 -6
- package/dist/esm/vega-radio_2.entry.js +7 -7
- package/dist/esm/vega-rich-text-content.entry.js +7 -7
- package/dist/esm/vega-rich-text-editor_4.entry.js +15 -15
- package/dist/esm/vega-rich-text-table-properties_3.entry.js +7 -7
- package/dist/esm/vega-segment-control.entry.js +3 -3
- package/dist/esm/vega-selection-chip_2.entry.js +8 -8
- package/dist/esm/vega-selection-tile_2.entry.js +165 -32
- package/dist/esm/vega-sidenav_3.entry.js +6 -6
- package/dist/esm/vega-signature-capture.entry.js +6 -6
- package/dist/esm/vega-stepper.entry.js +7 -7
- package/dist/esm/vega-tab-group_2.entry.js +4 -4
- package/dist/esm/vega-table_11.entry.js +1175 -285
- package/dist/esm/vega-textarea.entry.js +7 -7
- package/dist/esm/vega-time-picker_2.entry.js +13 -19
- package/dist/esm/vega-toggle-switch.entry.js +6 -6
- package/dist/esm/vega-tooltip_2.entry.js +2 -2
- package/dist/esm/vega.js +9 -9
- package/dist/esm/{wait-for-component-did-render-30cde59c.js → wait-for-component-did-render-9a83d343.js} +1 -1
- package/dist/sri/vega-sri-manifest.json +276 -276
- package/dist/types/components/vega-color-swatch/vega-color-swatch-picker/slimmers/renderers/color-swatch-picker-renderer.d.ts +9 -0
- package/dist/types/components/vega-color-swatch/vega-color-swatch-picker/vega-color-swatch-picker.d.ts +6 -0
- package/dist/types/components/vega-color-swatch/vega-color-swatch.d.ts +4 -4
- package/dist/types/components/vega-date-picker/vega-date-picker-calendar/slimmers/renderers/vega-date-picker-month-item-renderer.d.ts +1 -0
- package/dist/types/components/vega-date-picker/vega-date-picker-calendar/vega-date-picker-calendar.d.ts +8 -0
- package/dist/types/components/vega-input-phone-number/vega-input-phone-number.d.ts +2 -0
- package/dist/types/components/vega-nav/vega-left-nav/slimmers/controllers/vega-left-nav-backdrop-controller.d.ts +2 -1
- package/dist/types/components/vega-rich-text-editor/extensions/base-toolbar-button-renderer.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/renderers/table-dynamic-popover-renderer.d.ts +15 -11
- package/dist/types/components/vega-rich-text-editor/extensions/table/renderers/table-renderer.d.ts +15 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/renderers/table-setting-popover-renderer.d.ts +25 -22
- package/dist/types/components/vega-rich-text-editor/interface.d.ts +5 -0
- package/dist/types/components/vega-selection-tile/slimmers/renderers/vega-selection-tile-renderer.d.ts +12 -0
- package/dist/types/components/vega-selection-tile/vega-selection-tile-group/slimmers/renderers/vega-selection-tile-group-renderer.d.ts +0 -1
- package/dist/types/components/vega-selection-tile/vega-selection-tile.d.ts +2 -0
- package/dist/types/components/vega-table/interface.d.ts +2 -0
- package/dist/types/components/vega-table/slimmers/controllers/vega-table-expand-row-controller.d.ts +35 -0
- package/dist/types/components/vega-table/slimmers/controllers/vega-table-row-draggable-controller.d.ts +52 -0
- package/dist/types/components/vega-table/slimmers/controllers/vega-table-sort-controller.d.ts +4 -0
- package/dist/types/components/vega-table/slimmers/renderers/vega-table-body-renderer.d.ts +3 -1
- package/dist/types/components/vega-table/slimmers/renderers/vega-table-col-group-renderer.d.ts +2 -1
- package/dist/types/components/vega-table/utils.d.ts +3 -2
- package/dist/types/components/vega-table/vega-table-expand-row/slimmers/controllers/vega-table-expand-row-col-span-controller.d.ts +5 -0
- package/dist/types/components/vega-table/vega-table-expand-row/slimmers/controllers/vega-table-expand-row-state-controller.d.ts +1 -0
- package/dist/types/components/vega-table/vega-table-expand-row/vega-table-expand-row.d.ts +2 -0
- package/dist/types/components/vega-table/vega-table-foot-row/slimmers/controllers/vega-table-foot-row-state-controller.d.ts +2 -1
- package/dist/types/components/vega-table/vega-table-foot-row/slimmers/renderers/vega-table-foot-row-renderer.d.ts +3 -1
- package/dist/types/components/vega-table/vega-table-foot-row/vega-table-foot-row.d.ts +6 -2
- package/dist/types/components/vega-table/vega-table-head/vega-table-head.d.ts +1 -0
- package/dist/types/components/vega-table/vega-table-head-row/slimmers/controllers/vega-table-head-row-state-controller.d.ts +2 -1
- package/dist/types/components/vega-table/vega-table-head-row/slimmers/renderers/vega-table-head-row-renderer.d.ts +3 -1
- package/dist/types/components/vega-table/vega-table-head-row/vega-table-head-row.d.ts +6 -2
- package/dist/types/components/vega-table/vega-table-row/slimmers/controllers/vega-table-row-state-controller.d.ts +3 -0
- package/dist/types/components/vega-table/vega-table-row/slimmers/renderers/vega-table-row-renderer.d.ts +3 -0
- package/dist/types/components/vega-table/vega-table-row/vega-table-row.d.ts +8 -0
- package/dist/types/components/vega-table/vega-table.d.ts +40 -5
- package/dist/types/components/vega-time-picker/vega-time-picker.d.ts +5 -11
- package/dist/types/components.d.ts +47 -12
- package/dist/types/constants/ui.d.ts +1 -1
- package/dist/types/global/icons/grip-dots-vertical.d.ts +3 -0
- package/dist/types/helpers/event-manager/event-id/vega-event-id.d.ts +1 -0
- package/dist/types/helpers/immutable/immutable-map.d.ts +4 -1
- package/dist/types/helpers/slimmers/draggable-element-slimmer.d.ts +260 -0
- package/dist/types/helpers/slimmers/popover-nested-slot-projection-slimmer.d.ts +65 -0
- package/dist/types/types/components.type.d.ts +2 -0
- package/dist/types/types/public-api.d.ts +2 -0
- package/dist/types/types/ui.type.d.ts +40 -0
- package/dist/vega/index.esm.js +1 -1
- package/dist/vega/{p-d3ed7c27.entry.js → p-0b5b0fd2.entry.js} +1 -1
- package/dist/vega/p-13e7f906.entry.js +1 -0
- package/dist/vega/{p-39b71df9.entry.js → p-23b38467.entry.js} +1 -1
- package/dist/vega/{p-8d833b44.entry.js → p-25572ea7.entry.js} +1 -1
- package/dist/vega/{p-03cf2df1.entry.js → p-268e84e0.entry.js} +1 -1
- package/dist/vega/p-2edc066c.entry.js +1 -0
- package/dist/vega/{p-5bbb3e68.entry.js → p-2fb26f4f.entry.js} +1 -1
- package/dist/vega/{p-032183c1.js → p-33234385.js} +1 -1
- package/dist/vega/{p-c0323a55.entry.js → p-35d77c9c.entry.js} +1 -1
- package/dist/vega/{p-5ac4649a.entry.js → p-3c456e91.entry.js} +1 -1
- package/dist/vega/{p-27b1dc0f.entry.js → p-3d0ba2c6.entry.js} +1 -1
- package/dist/vega/{p-20f0060f.entry.js → p-3d92d2af.entry.js} +1 -1
- package/dist/vega/{p-4123559f.entry.js → p-3e64fa38.entry.js} +1 -1
- package/dist/vega/{p-f986f875.entry.js → p-411ea209.entry.js} +1 -1
- package/dist/vega/{p-7cf1e1f7.entry.js → p-423762ae.entry.js} +1 -1
- package/dist/vega/{p-0f31b00b.entry.js → p-4530f0e1.entry.js} +1 -1
- package/dist/vega/{p-b28d4f7d.js → p-48e3be6a.js} +1 -1
- package/dist/vega/{p-753a7832.entry.js → p-4afafeb3.entry.js} +1 -1
- package/dist/vega/{p-c6837173.entry.js → p-4c90d013.entry.js} +1 -1
- package/dist/vega/p-5087fa1e.entry.js +1 -0
- package/dist/vega/{p-7595ad55.js → p-51b2b3de.js} +1 -1
- package/dist/vega/{p-bc2786f9.entry.js → p-59c6dcf7.entry.js} +1 -1
- package/dist/vega/p-5e50dbb9.js +1 -0
- package/dist/vega/p-5f377954.js +1 -1
- package/dist/vega/{p-e5546af5.entry.js → p-606d7113.entry.js} +1 -1
- package/dist/vega/{p-6f790577.js → p-6817b9bd.js} +1 -1
- package/dist/vega/{p-84030271.entry.js → p-69c11b7b.entry.js} +1 -1
- package/dist/vega/{p-effa6495.js → p-6b5cb920.js} +1 -1
- package/dist/vega/{p-aa985d73.js → p-6c43d54a.js} +1 -1
- package/dist/vega/{p-0e15fa94.entry.js → p-6fadee27.entry.js} +1 -1
- package/dist/vega/{p-549bea2c.entry.js → p-73c6669e.entry.js} +1 -1
- package/dist/vega/{p-9375fbce.js → p-7730bace.js} +1 -1
- package/dist/vega/{p-88f57353.entry.js → p-79c12a64.entry.js} +1 -1
- package/dist/vega/{p-f8c700dd.entry.js → p-7f74cd41.entry.js} +1 -1
- package/dist/vega/p-818da356.js +1 -0
- package/dist/vega/{p-aa040383.js → p-84eb3b9c.js} +1 -1
- package/dist/vega/{p-b48b3264.js → p-8d48940d.js} +1 -1
- package/dist/vega/{p-a5e6a3be.js → p-93afdfc3.js} +1 -1
- package/dist/vega/{p-865fc90b.entry.js → p-98a6cd8e.entry.js} +1 -1
- package/dist/vega/p-9af0e2e7.js +1 -0
- package/dist/vega/{p-f6414a24.entry.js → p-9e2b7718.entry.js} +1 -1
- package/dist/vega/{p-e1b1f5f9.entry.js → p-9eb00537.entry.js} +1 -1
- package/dist/vega/{p-f0e855b2.entry.js → p-9f36abf9.entry.js} +1 -1
- package/dist/vega/{p-b88eab9a.entry.js → p-9fc8bd1f.entry.js} +1 -1
- package/dist/vega/{p-9308f874.entry.js → p-a050c24d.entry.js} +1 -1
- package/dist/vega/{p-aa4d419c.entry.js → p-a49c25c2.entry.js} +1 -1
- package/dist/vega/{p-1df2c29b.entry.js → p-a9528dbd.entry.js} +1 -1
- package/dist/vega/{p-0caf52e0.js → p-a9e10a64.js} +1 -1
- package/dist/vega/p-a9f34735.entry.js +1 -0
- package/dist/vega/{p-3ae5f50e.entry.js → p-aaf44879.entry.js} +1 -1
- package/dist/vega/{p-6cada843.js → p-ae1aa4df.js} +1 -1
- package/dist/vega/p-af00e6e2.entry.js +1 -0
- package/dist/vega/{p-a0c3968b.js → p-af5cb9bc.js} +1 -1
- package/dist/vega/{p-d6c9ef6c.entry.js → p-afd1b519.entry.js} +1 -1
- package/dist/vega/{p-5490d499.entry.js → p-bc74d7e7.entry.js} +1 -1
- package/dist/vega/{p-6ba71ec4.entry.js → p-c2388937.entry.js} +1 -1
- package/dist/vega/p-c31a32f4.js +1 -0
- package/dist/vega/{p-11a2f834.js → p-c347e08a.js} +1 -1
- package/dist/vega/{p-91739ed3.entry.js → p-c51ebb14.entry.js} +1 -1
- package/dist/vega/{p-b80217fa.entry.js → p-c601b331.entry.js} +1 -1
- package/dist/vega/{p-d3864b94.entry.js → p-c8fe46fd.entry.js} +1 -1
- package/dist/vega/p-ce61d23f.entry.js +1 -0
- package/dist/vega/{p-d76e3b3c.entry.js → p-cf2838c7.entry.js} +1 -1
- package/dist/vega/{p-e4c5b8d1.entry.js → p-d37636a5.entry.js} +1 -1
- package/dist/vega/{p-19e10a87.entry.js → p-d402eb7b.entry.js} +1 -1
- package/dist/vega/{p-dec5b448.js → p-d4e519a0.js} +1 -1
- package/dist/vega/{p-ce975c69.entry.js → p-da8bb883.entry.js} +1 -1
- package/dist/vega/{p-68a96fbb.entry.js → p-dffbbc3d.entry.js} +1 -1
- package/dist/vega/{p-bdddddb7.js → p-e1709e59.js} +1 -1
- package/dist/vega/{p-c47c37f2.js → p-e27626f6.js} +1 -1
- package/dist/vega/{p-6236f592.entry.js → p-e47b2c4c.entry.js} +1 -1
- package/dist/vega/{p-7dca19d3.entry.js → p-e95cb28f.entry.js} +1 -1
- package/dist/vega/{p-74136508.entry.js → p-ecbb63a5.entry.js} +1 -1
- package/dist/vega/p-ed26f4c8.entry.js +1 -0
- package/dist/vega/{p-43aaeb30.entry.js → p-effb285f.entry.js} +1 -1
- package/dist/vega/p-f1c672e4.js +1 -0
- package/dist/vega/{p-56c28943.js → p-f5f5a0d9.js} +1 -1
- package/dist/vega/{p-748268e6.entry.js → p-f604f2c9.entry.js} +1 -1
- package/dist/vega/{p-e5cc839a.entry.js → p-fa91805b.entry.js} +1 -1
- package/dist/vega/vega.esm.js +1 -1
- package/package.json +1 -1
- package/dist/vega/p-220f8ee7.js +0 -1
- package/dist/vega/p-38af89b9.js +0 -1
- package/dist/vega/p-5215e1d8.entry.js +0 -1
- package/dist/vega/p-5409275a.entry.js +0 -1
- package/dist/vega/p-5f23c52d.entry.js +0 -1
- package/dist/vega/p-7dbaed6c.entry.js +0 -1
- package/dist/vega/p-80cb302f.entry.js +0 -1
- package/dist/vega/p-874bf8b2.js +0 -1
- package/dist/vega/p-99670c56.entry.js +0 -1
- package/dist/vega/p-9de25451.js +0 -1
- package/dist/vega/p-a2d6d695.entry.js +0 -1
- package/dist/vega/p-b78eaec4.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,c as i,h as t,H as a,g as n}from"./p-6b2342e0.js";import{c as r}from"./p-6ac8e655.js";import{s as o}from"./p-519a7d55.js";import{C as s}from"./p-590fd123.js";import{C as c}from"./p-2d0d575f.js";import{C as h,F as l,g as d}from"./p-a528714c.js";import{O as p}from"./p-331a62d5.js";import{f as g,a as x}from"./p-6e70d3cc.js";import{c as b,M as v,V as f,I as m}from"./p-6e1ab235.js";import{V as u,I as k}from"./p-4415ad28.js";import{F as w}from"./p-11a2f834.js";import{c as y}from"./p-effa6495.js";import{i as j}from"./p-b78eaec4.js";import{h as z}from"./p-aa985d73.js";import{d as C}from"./p-f28a6074.js";import{C as I}from"./p-c47c37f2.js";import{R}from"./p-280cbcdb.js";import{C as V}from"./p-75b58efe.js";import{C as D}from"./p-76063dcb.js";import"./p-abd7aeaa.js";import"./p-02841589.js";import"./p-8b5d3a52.js";import"./p-6a334573.js";import"./p-3b791b5d.js";import"./p-f0e828d8.js";import"./p-b75ee3ba.js";import"./p-81dd00d0.js";import"./p-49a2e141.js";import"./p-d4ea8e22.js";import"./p-ed45b3b6.js";import"./p-78a57a17.js";import"./p-52b8f2d2.js";import"./p-d27ae9ff.js";import"./p-262ec334.js";import"./p-a0c3968b.js";import"./p-9de25451.js";import"./p-5f377954.js";import"./p-18e8d9b7.js";import"./p-5a25014f.js";var O=function(e,i,t,a){var n,r=arguments.length,o=r<3?i:null===a?a=Object.getOwnPropertyDescriptor(i,t):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,i,t,a);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(r<3?n(o):r>3?n(i,t,o):n(i,t))||o);return r>3&&o&&Object.defineProperty(i,t,o),o};class E extends f{connectedCallback(){this.checkboxGroup=g(this.host,"vega-checkbox-group")||g(this.host,"vega-selection-tile-group"),this.fieldErrorObserver=new p(this.canAcceptFieldErrorObserver.bind(this),this.fieldErrorObserverListener.bind(this)),c.register(C.getSubject(this.checkboxGroup||this.host,z),this.fieldErrorObserver)}disconnectedCallback(){c.unregister(C.getSubject(this.checkboxGroup||this.host,z),this.fieldErrorObserver)}canAcceptFieldErrorObserver(){return!0}fieldErrorObserverListener(e){this.showError=e.showError}}O([b({writable:!0})],E.prototype,"showError",void 0),O([b()],E.prototype,"host",void 0),O([v("connectedCallback")],E.prototype,"connectedCallback",null),O([v("disconnectedCallback")],E.prototype,"disconnectedCallback",null);var F=function(e,i,t,a){var n,r=arguments.length,o=r<3?i:null===a?a=Object.getOwnPropertyDescriptor(i,t):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,i,t,a);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(r<3?n(o):r>3?n(i,t,o):n(i,t))||o);return r>3&&o&&Object.defineProperty(i,t,o),o};const G=class{constructor(t){e(this,t),this.vegaChange=i(this,"vegaChange",7),this.change=i(this,"change",7),this.globalSlimmers={},this.vegaCheckboxShowErrorController=new E,this.formFieldController=new w({propertyRules:[{propertyName:"required",ruleFactory:e=>e?new s:null}],defaultValue:e=>""!==e.identifier&&"",attributeGetter:e=>this[e],inputContainerGetter:()=>this.inputContainerRef,touchableAreaGetter:()=>[this.inputRef]}),this.changeEventEmitter=y(G,j),this.dropdownEventPrevent=new I([j],(()=>this.host),{customPreventHandle:e=>{e.stopPropagation()}}),this.vegaComponentUsageRuntimeMetricsSlimmer=new u,this.groupDisabled=!1,this.showError=!1,this.identifier="",this.value=""!==this.identifier&&"",this.checked=!1,this.indeterminate=!1,this.disabled=!1,this.size="default",this.required=!1,this.isValid=null,this.onCheckBoxChange=e=>{this.indeterminate&&(this.indeterminate=!1),this.checked=e.currentTarget.checked},this.onSelectedIconClick=e=>{e.stopPropagation()}}watchValueChange(e){this.checked=""!==this.identifier?e===this.identifier:!0===e}watchCheckedChange(){this.initValue(),this.changeEventEmitter.emit(this.value),c.notify(h,{host:this.host,detail:this.value}),c.notify(l,{host:this.host,detail:this.value})}disconnectedCallback(){this.unRegisterGroupDisabledObserver()}componentWillLoad(){!this.checked&&(""!==this.identifier?this.value===this.identifier:!0===this.value||"true"===this.value)&&(this.checked=!0),this.initValue(),this.initAndRegisterGroupDisabledObserver()}componentDidRender(){""===this.host.innerHTML.trim()&&this.labelElement.classList.add("vega-hidden"),this.syncNativeIndeterminate()}async setValue(e){this.checked=this.identifier?e===this.identifier:!0===e}render(){var e;const i="VEGA-CHECKBOX-GROUP"==(null===(e=this.host.parentElement)||void 0===e?void 0:e.nodeName);return o(t(a,{class:{"vega-flex-shrink-0 v-min-w-min":i,checked:this.checked,indeterminate:this.indeterminate,disabled:this.isDisabled()}},t("label",{class:x(["vega-checkbox-container",this.showError&&"error",this.size&&`size-${this.size}`]),ref:e=>this.inputContainerRef=e},t("input",{ref:e=>this.inputRef=e,type:"checkbox",checked:this.checked,value:this.identifier,onChange:this.onCheckBoxChange,"aria-label":this.identifier||"No label defined","aria-checked":this.indeterminate?"mixed":void 0,disabled:this.isDisabled(),tabIndex:0,onKeyDown:r()}),t("span",{class:"vega-checkbox-icon",onClick:this.onSelectedIconClick,tabIndex:-1},this.renderIconDom()),t("div",{class:"vega-checkbox-label-container",ref:e=>this.labelElement=e},this.renderLabelDom(),this.renderRequireDom()))),this.host)}renderIconDom(){return this.indeterminate?t("vega-icon",{icon:"minus-sign",size:"small"===this.size?"size-12":"size-16"}):this.checked?t("vega-icon",{icon:"checkmark",size:"small"===this.size?"size-12":"size-16"}):null}renderLabelDom(){return t("span",{class:"vega-checkbox-label"},t("slot",null))}renderRequireDom(){return t("span",{class:{"vega-require":this.required}},this.required?"*":"")}initValue(){this.value=""!==this.identifier?this.checked?this.identifier:"":this.checked}syncNativeIndeterminate(){this.inputRef&&(this.inputRef.indeterminate=this.indeterminate)}isDisabled(){return this.disabled||this.groupDisabled}canAcceptGroupDisabledObserver(e){return g(this.host,"vega-checkbox-group")===e.host}groupDisabledObserverListener(e){this.groupDisabled=e.host.disabled}initAndRegisterGroupDisabledObserver(){g(this.host,"vega-checkbox-group")&&(this.groupDisabledObserver=new p(this.canAcceptGroupDisabledObserver.bind(this),this.groupDisabledObserverListener.bind(this)),c.register(d,this.groupDisabledObserver))}unRegisterGroupDisabledObserver(){this.groupDisabledObserver&&c.unregister(d,this.groupDisabledObserver)}get host(){return n(this)}static get watchers(){return{value:["watchValueChange"],checked:["watchCheckedChange"]}}};F([k()],G.prototype,"globalSlimmers",void 0),F([m()],G.prototype,"vegaCheckboxShowErrorController",void 0),F([m()],G.prototype,"formFieldController",void 0),F([m()],G.prototype,"changeEventEmitter",void 0),F([m()],G.prototype,"dropdownEventPrevent",void 0),F([m()],G.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),G.style=':host{display:inline-block;vertical-align:middle}.vega-checkbox-container{position:relative;display:flex;-webkit-tap-highlight-color:transparent}.vega-checkbox-container>input[type=checkbox]{position:absolute;left:0px;top:0px;opacity:0;width:24px;height:24px;padding:0px;margin:0px}.vega-checkbox-container>.vega-checkbox-icon{display:inline-block;box-sizing:border-box;width:24px;height:24px;border-style:solid;border-width:2px;border-color:rgba(var(--v-border-color-action-active, 29, 65, 195, 1));position:relative;left:0px;background-color:rgba(var(--v-bg-primary, 252, 252, 252, 1));border:1px solid rgba(var(--v-border-input-field, 171, 198, 216, 1));border-radius:4px;min-width:24px;color:rgba(var(--v-text-inverted-primary, 252, 252, 252, 1))}.vega-checkbox-container>.vega-checkbox-icon:hover{border:1px solid rgba(var(--v-border-input-field-hover, 115, 160, 190, 1))}:host(.checked) .vega-checkbox-container>.vega-checkbox-icon,:host(.indeterminate) .vega-checkbox-container>.vega-checkbox-icon{background-color:rgba(var(--v-bg-action, 19, 98, 226, 1));display:inline-flex;align-items:center;justify-content:center}:host(.checked) .vega-checkbox-container>.vega-checkbox-icon:hover,:host(.indeterminate) .vega-checkbox-container>.vega-checkbox-icon:hover{background-color:rgba(var(--v-bg-action-hover, 4, 112, 236, 1))}.vega-checkbox-container>input[type=checkbox]:focus-visible+.vega-checkbox-icon{outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:3px}.vega-checkbox-container>.vega-checkbox-icon:active{border-width:1px;border-style:solid;border-color:rgba(var(--v-border-color-action-active, 29, 65, 195, 1))}:host(.checked) .vega-checkbox-container>.vega-checkbox-icon:active,:host(.indeterminate) .vega-checkbox-container>.vega-checkbox-icon:active{background-color:rgba(var(--v-bg-action-active, 29, 65, 195, 1))}:host(.disabled) .vega-checkbox-container{cursor:not-allowed}:host(:not(.disabled)) .vega-checkbox-container{cursor:pointer}.vega-checkbox-container .vega-require{color:rgba(var(--v-text-error, 189, 41, 71, 1));margin-left:4px;vertical-align:middle}.vega-checkbox-container.error>.vega-checkbox-icon{background-color:rgba(var(--v-bg-primary, 252, 252, 252, 1));border:1px solid rgba(var(--v-border-input-field-danger, 230, 50, 87, 1))}:host(.checked) .vega-checkbox-container.error>.vega-checkbox-icon,:host(.indeterminate) .vega-checkbox-container.error>.vega-checkbox-icon{background-color:rgba(var(--v-bg-danger, 189, 41, 71, 1))}.vega-checkbox-container.error>.vega-checkbox-icon:hover{border:1px solid rgba(var(--v-border-input-field-danger-hover, 255, 87, 114, 1))}:host(.checked) .vega-checkbox-container.error>.vega-checkbox-icon:hover,:host(.indeterminate) .vega-checkbox-container.error>.vega-checkbox-icon:hover{background-color:rgba(var(--v-bg-danger-hover, 233, 71, 104, 1))}.vega-checkbox-container.error>input[type=checkbox]:focus-visible+.vega-checkbox-icon{outline:2px solid rgba(var(--v-border-color-danger, 230, 50, 87, 1));outline-offset:3px}:host(.checked) .vega-checkbox-container.error>.vega-checkbox-icon:active,:host(.indeterminate) .vega-checkbox-container.error>.vega-checkbox-icon:active{background-color:rgba(var(--v-bg-danger-active, 230, 50, 87, 1))}.vega-checkbox-container.error>.vega-checkbox-icon:active{border-width:1px;border-style:solid;border-color:rgba(var(--v-border-color-danger-active, 189, 41, 71, 1))}:host(.disabled) .vega-checkbox-container>.vega-checkbox-icon{background-color:rgba(var(--v-bg-secondary, 245, 247, 247, 1));border:1px solid rgba(var(--v-border-input-field-disabled, 222, 225, 227, 1))}:host(.checked.disabled) .vega-checkbox-container>.vega-checkbox-icon,:host(.indeterminate.disabled) .vega-checkbox-container>.vega-checkbox-icon{background-color:rgba(var(--v-bg-disabled, 176, 180, 181, 1));border:1px solid rgba(var(--v-border-input-field-disabled, 222, 225, 227, 1))}:host(.checked.disabled) .vega-checkbox-container>.vega-checkbox-icon>vega-icon,:host(.indeterminate.disabled) .vega-checkbox-container>.vega-checkbox-icon>vega-icon{color:rgba(var(--v-text-inverted-primary, 252, 252, 252, 1))}.vega-checkbox-container>.vega-checkbox-label-container{display:inline-block;margin-left:12px;color:rgba(var(--v-text-primary, 32, 54, 69, 1));font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}@media screen and (min-width: 768px) and (max-width: 1023px){.vega-checkbox-container>.vega-checkbox-label-container{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.vega-checkbox-container>.vega-checkbox-label-container{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.vega-checkbox-container>.vega-checkbox-label-container{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}:host(.disabled) .vega-checkbox-container>.vega-checkbox-label-container{color:rgba(var(--v-text-disabled, 176, 180, 181, 1))}.vega-error{display:block;margin-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){.vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}.vega-checkbox-label-container.vega-hidden{display:none}.vega-hidden{display:none}.size-default input[type=checkbox]{width:24px;height:24px}.size-default .vega-checkbox-icon{width:24px;height:24px;min-width:24px;border-radius:4px}.size-default .vega-checkbox-label-container{margin-left:12px;font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}@media screen and (min-width: 768px) and (max-width: 1023px){.size-default .vega-checkbox-label-container{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){.size-default .vega-checkbox-label-container{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){.size-default .vega-checkbox-label-container{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}.size-small input[type=checkbox]{width:16px;height:16px}.size-small .vega-checkbox-icon{width:16px;height:16px;min-width:16px;border-radius:2px}.size-small .vega-checkbox-label-container{margin-left:8px;font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px}@media screen and (min-width: 768px) and (max-width: 1023px){.size-small .vega-checkbox-label-container{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.size-small .vega-checkbox-label-container{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.size-small .vega-checkbox-label-container{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px}}';var P=function(e,i,t,a){var n,r=arguments.length,o=r<3?i:null===a?a=Object.getOwnPropertyDescriptor(i,t):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,i,t,a);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(r<3?n(o):r>3?n(i,t,o):n(i,t))||o);return r>3&&o&&Object.defineProperty(i,t,o),o};const q=class{constructor(t){e(this,t),this.vegaChange=i(this,"vegaChange",7),this.change=i(this,"change",7),this.globalSlimmers={},this.formFieldController=new w({propertyRules:[{propertyName:"required",ruleFactory:e=>e?new R:null}],defaultValue:[],validationRulesName:"validationRules",attributeGetter:e=>this[e],inputContainerGetter:()=>this.inputContainerRef,touchableAreaGetter:()=>this.touchableAreaGetter()}),this.checkboxValueChangeObserver=new D(h,(e=>this.childCheckboxValueChange(e))),this.checkboxEventPrevent=new I([j],(()=>this.vegaFlexElement)),this.changeEventEmitter=y(q,j),this.vegaComponentUsageRuntimeMetricsSlimmer=new u,this.label="",this.value=[],this.vegaFlexProp={},this.disabled=!1,this.required=!1,this.hint="",this.isValid=null,this.autoValidation=!0,this.validationRules=[],this.childCheckboxValueChange=e=>{this.syncCheckboxItemsValue(e.detail,e.host.identifier)},this.touchableAreaGetter=()=>{const e=[];return this.vegaCheckboxArray&&this.vegaCheckboxArray.forEach((async i=>{e.push(i.shadowRoot.querySelector("input"))})),e}}async watchValue(){this.initCheckboxArray(),this.changeEventEmitter.emit(this.value),c.notify(l,{host:this.host,detail:this.value})}watchVegaFlexProp(){this.setVegaFlexProperty()}async watchDisabled(){this.notifyGroupDisabledChange()}watchValidationRules(){}componentDidLoad(){this.setVegaFlexProperty(),this.initCheckboxArray(),this.notifyGroupDisabledChange()}render(){return o(t(a,null,this.renderLabelDom(),t("div",{class:"vega-checkbox-group-container",ref:e=>this.inputContainerRef=e},t("vega-flex",{ref:e=>{this.vegaFlexElement=e}},t("slot",null))),this.renderHintDom()),this.host)}renderLabelDom(){return this.label&&t("div",{class:"vega-label"},t("label",{"aria-label":this.label},this.label,this.renderRequireDom()))}renderRequireDom(){return this.required?t("span",{class:"vega-require"},"*"):null}renderHintDom(){return this.hint&&t("div",{class:"vega-hint"},t("label",null,this.hint))}setVegaFlexProperty(){this.vegaFlexProp&&Object.assign(this.vegaFlexElement,{gap:"size-16",direction:"col"},this.vegaFlexProp)}syncCheckboxItemsValue(e,i){e&&!this.value.includes(i)?this.value=[...this.value,i]:!e&&this.value.includes(i)&&(this.value=[...this.value.filter((e=>e!==i))])}initCheckboxArray(){this.vegaCheckboxArray=Array.from(this.host.querySelectorAll("vega-checkbox")),this.vegaCheckboxArray.forEach((e=>{e.checked=!!(this.value&&this.value.length>0)&&this.value.includes(e.identifier)}))}notifyGroupDisabledChange(){c.notify(d,{host:this.host})}get host(){return n(this)}static get watchers(){return{value:["watchValue"],vegaFlexProp:["watchVegaFlexProp"],disabled:["watchDisabled"],validationRules:["watchValidationRules"]}}};P([k()],q.prototype,"globalSlimmers",void 0),P([m()],q.prototype,"formFieldController",void 0),P([m()],q.prototype,"checkboxValueChangeObserver",void 0),P([m()],q.prototype,"checkboxEventPrevent",void 0),P([m()],q.prototype,"changeEventEmitter",void 0),P([m()],q.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),P([V()],q.prototype,"watchVegaFlexProp",null),q.style=':host{display:block;text-align:left;line-height:normal}.vega-error{display:block;margin-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){.vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}.vega-hidden{display:none}.vega-label{margin-bottom:16px}.vega-label label{font-family:"Inter", sans-serif;font-size:18px;font-weight:500;line-height:30px;letter-spacing:0px;color:rgba(var(--v-text-primary, 32, 54, 69, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){.vega-label label{font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:28px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.vega-label label{font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:28px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.vega-label label{font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:28px;letter-spacing:0px}}.vega-require{color:rgba(var(--v-text-error, 189, 41, 71, 1));margin-left:4px}.vega-hint{padding-top:12px}.vega-hint>label{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){.vega-hint>label{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.vega-hint>label{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.vega-hint>label{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}';export{G as vega_checkbox,q as vega_checkbox_group}
|
|
1
|
+
import{r as e,c as i,h as t,H as a,g as n}from"./p-6b2342e0.js";import{c as r}from"./p-6ac8e655.js";import{s as o}from"./p-519a7d55.js";import{C as s}from"./p-590fd123.js";import{C as c}from"./p-2d0d575f.js";import{C as h,F as l,g as d}from"./p-a528714c.js";import{O as p}from"./p-331a62d5.js";import{f as g,a as x}from"./p-6e70d3cc.js";import{c as b,M as v,V as f,I as m}from"./p-6e1ab235.js";import{V as u,I as k}from"./p-4415ad28.js";import{F as w}from"./p-c347e08a.js";import{c as y}from"./p-6b5cb920.js";import{i as j}from"./p-9af0e2e7.js";import{h as z}from"./p-6c43d54a.js";import{d as C}from"./p-f28a6074.js";import{C as I}from"./p-e27626f6.js";import{R}from"./p-280cbcdb.js";import{C as V}from"./p-75b58efe.js";import{C as D}from"./p-76063dcb.js";import"./p-abd7aeaa.js";import"./p-02841589.js";import"./p-8b5d3a52.js";import"./p-6a334573.js";import"./p-3b791b5d.js";import"./p-f0e828d8.js";import"./p-b75ee3ba.js";import"./p-81dd00d0.js";import"./p-49a2e141.js";import"./p-d4ea8e22.js";import"./p-ed45b3b6.js";import"./p-78a57a17.js";import"./p-52b8f2d2.js";import"./p-d27ae9ff.js";import"./p-262ec334.js";import"./p-af5cb9bc.js";import"./p-f1c672e4.js";import"./p-5f377954.js";import"./p-18e8d9b7.js";import"./p-5a25014f.js";var O=function(e,i,t,a){var n,r=arguments.length,o=r<3?i:null===a?a=Object.getOwnPropertyDescriptor(i,t):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,i,t,a);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(r<3?n(o):r>3?n(i,t,o):n(i,t))||o);return r>3&&o&&Object.defineProperty(i,t,o),o};class E extends f{connectedCallback(){this.checkboxGroup=g(this.host,"vega-checkbox-group")||g(this.host,"vega-selection-tile-group"),this.fieldErrorObserver=new p(this.canAcceptFieldErrorObserver.bind(this),this.fieldErrorObserverListener.bind(this)),c.register(C.getSubject(this.checkboxGroup||this.host,z),this.fieldErrorObserver)}disconnectedCallback(){c.unregister(C.getSubject(this.checkboxGroup||this.host,z),this.fieldErrorObserver)}canAcceptFieldErrorObserver(){return!0}fieldErrorObserverListener(e){this.showError=e.showError}}O([b({writable:!0})],E.prototype,"showError",void 0),O([b()],E.prototype,"host",void 0),O([v("connectedCallback")],E.prototype,"connectedCallback",null),O([v("disconnectedCallback")],E.prototype,"disconnectedCallback",null);var F=function(e,i,t,a){var n,r=arguments.length,o=r<3?i:null===a?a=Object.getOwnPropertyDescriptor(i,t):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,i,t,a);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(r<3?n(o):r>3?n(i,t,o):n(i,t))||o);return r>3&&o&&Object.defineProperty(i,t,o),o};const G=class{constructor(t){e(this,t),this.vegaChange=i(this,"vegaChange",7),this.change=i(this,"change",7),this.globalSlimmers={},this.vegaCheckboxShowErrorController=new E,this.formFieldController=new w({propertyRules:[{propertyName:"required",ruleFactory:e=>e?new s:null}],defaultValue:e=>""!==e.identifier&&"",attributeGetter:e=>this[e],inputContainerGetter:()=>this.inputContainerRef,touchableAreaGetter:()=>[this.inputRef]}),this.changeEventEmitter=y(G,j),this.dropdownEventPrevent=new I([j],(()=>this.host),{customPreventHandle:e=>{e.stopPropagation()}}),this.vegaComponentUsageRuntimeMetricsSlimmer=new u,this.groupDisabled=!1,this.showError=!1,this.identifier="",this.value=""!==this.identifier&&"",this.checked=!1,this.indeterminate=!1,this.disabled=!1,this.size="default",this.required=!1,this.isValid=null,this.onCheckBoxChange=e=>{this.indeterminate&&(this.indeterminate=!1),this.checked=e.currentTarget.checked},this.onSelectedIconClick=e=>{e.stopPropagation()}}watchValueChange(e){this.checked=""!==this.identifier?e===this.identifier:!0===e}watchCheckedChange(){this.initValue(),this.changeEventEmitter.emit(this.value),c.notify(h,{host:this.host,detail:this.value}),c.notify(l,{host:this.host,detail:this.value})}disconnectedCallback(){this.unRegisterGroupDisabledObserver()}componentWillLoad(){!this.checked&&(""!==this.identifier?this.value===this.identifier:!0===this.value||"true"===this.value)&&(this.checked=!0),this.initValue(),this.initAndRegisterGroupDisabledObserver()}componentDidRender(){""===this.host.innerHTML.trim()&&this.labelElement.classList.add("vega-hidden"),this.syncNativeIndeterminate()}async setValue(e){this.checked=this.identifier?e===this.identifier:!0===e}render(){var e;const i="VEGA-CHECKBOX-GROUP"==(null===(e=this.host.parentElement)||void 0===e?void 0:e.nodeName);return o(t(a,{class:{"vega-flex-shrink-0 v-min-w-min":i,checked:this.checked,indeterminate:this.indeterminate,disabled:this.isDisabled()}},t("label",{class:x(["vega-checkbox-container",this.showError&&"error",this.size&&`size-${this.size}`]),ref:e=>this.inputContainerRef=e},t("input",{ref:e=>this.inputRef=e,type:"checkbox",checked:this.checked,value:this.identifier,onChange:this.onCheckBoxChange,"aria-label":this.identifier||"No label defined","aria-checked":this.indeterminate?"mixed":void 0,disabled:this.isDisabled(),tabIndex:0,onKeyDown:r()}),t("span",{class:"vega-checkbox-icon",onClick:this.onSelectedIconClick,tabIndex:-1},this.renderIconDom()),t("div",{class:"vega-checkbox-label-container",ref:e=>this.labelElement=e},this.renderLabelDom(),this.renderRequireDom()))),this.host)}renderIconDom(){return this.indeterminate?t("vega-icon",{icon:"minus-sign",size:"small"===this.size?"size-12":"size-16"}):this.checked?t("vega-icon",{icon:"checkmark",size:"small"===this.size?"size-12":"size-16"}):null}renderLabelDom(){return t("span",{class:"vega-checkbox-label"},t("slot",null))}renderRequireDom(){return t("span",{class:{"vega-require":this.required}},this.required?"*":"")}initValue(){this.value=""!==this.identifier?this.checked?this.identifier:"":this.checked}syncNativeIndeterminate(){this.inputRef&&(this.inputRef.indeterminate=this.indeterminate)}isDisabled(){return this.disabled||this.groupDisabled}canAcceptGroupDisabledObserver(e){return g(this.host,"vega-checkbox-group")===e.host}groupDisabledObserverListener(e){this.groupDisabled=e.host.disabled}initAndRegisterGroupDisabledObserver(){g(this.host,"vega-checkbox-group")&&(this.groupDisabledObserver=new p(this.canAcceptGroupDisabledObserver.bind(this),this.groupDisabledObserverListener.bind(this)),c.register(d,this.groupDisabledObserver))}unRegisterGroupDisabledObserver(){this.groupDisabledObserver&&c.unregister(d,this.groupDisabledObserver)}get host(){return n(this)}static get watchers(){return{value:["watchValueChange"],checked:["watchCheckedChange"]}}};F([k()],G.prototype,"globalSlimmers",void 0),F([m()],G.prototype,"vegaCheckboxShowErrorController",void 0),F([m()],G.prototype,"formFieldController",void 0),F([m()],G.prototype,"changeEventEmitter",void 0),F([m()],G.prototype,"dropdownEventPrevent",void 0),F([m()],G.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),G.style=':host{display:inline-block;vertical-align:middle}.vega-checkbox-container{position:relative;display:flex;-webkit-tap-highlight-color:transparent}.vega-checkbox-container>input[type=checkbox]{position:absolute;left:0px;top:0px;opacity:0;width:24px;height:24px;padding:0px;margin:0px}.vega-checkbox-container>.vega-checkbox-icon{display:inline-block;box-sizing:border-box;width:24px;height:24px;border-style:solid;border-width:2px;border-color:rgba(var(--v-border-color-action-active, 29, 65, 195, 1));position:relative;left:0px;background-color:rgba(var(--v-bg-primary, 252, 252, 252, 1));border:1px solid rgba(var(--v-border-input-field, 171, 198, 216, 1));border-radius:4px;min-width:24px;color:rgba(var(--v-text-inverted-primary, 252, 252, 252, 1))}.vega-checkbox-container>.vega-checkbox-icon:hover{border:1px solid rgba(var(--v-border-input-field-hover, 115, 160, 190, 1))}:host(.checked) .vega-checkbox-container>.vega-checkbox-icon,:host(.indeterminate) .vega-checkbox-container>.vega-checkbox-icon{background-color:rgba(var(--v-bg-action, 19, 98, 226, 1));display:inline-flex;align-items:center;justify-content:center}:host(.checked) .vega-checkbox-container>.vega-checkbox-icon:hover,:host(.indeterminate) .vega-checkbox-container>.vega-checkbox-icon:hover{background-color:rgba(var(--v-bg-action-hover, 4, 112, 236, 1))}.vega-checkbox-container>input[type=checkbox]:focus-visible+.vega-checkbox-icon{outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:3px}.vega-checkbox-container>.vega-checkbox-icon:active{border-width:1px;border-style:solid;border-color:rgba(var(--v-border-color-action-active, 29, 65, 195, 1))}:host(.checked) .vega-checkbox-container>.vega-checkbox-icon:active,:host(.indeterminate) .vega-checkbox-container>.vega-checkbox-icon:active{background-color:rgba(var(--v-bg-action-active, 29, 65, 195, 1))}:host(.disabled) .vega-checkbox-container{cursor:not-allowed}:host(:not(.disabled)) .vega-checkbox-container{cursor:pointer}.vega-checkbox-container .vega-require{color:rgba(var(--v-text-error, 189, 41, 71, 1));margin-left:4px;vertical-align:middle}.vega-checkbox-container.error>.vega-checkbox-icon{background-color:rgba(var(--v-bg-primary, 252, 252, 252, 1));border:1px solid rgba(var(--v-border-input-field-danger, 230, 50, 87, 1))}:host(.checked) .vega-checkbox-container.error>.vega-checkbox-icon,:host(.indeterminate) .vega-checkbox-container.error>.vega-checkbox-icon{background-color:rgba(var(--v-bg-danger, 189, 41, 71, 1))}.vega-checkbox-container.error>.vega-checkbox-icon:hover{border:1px solid rgba(var(--v-border-input-field-danger-hover, 255, 87, 114, 1))}:host(.checked) .vega-checkbox-container.error>.vega-checkbox-icon:hover,:host(.indeterminate) .vega-checkbox-container.error>.vega-checkbox-icon:hover{background-color:rgba(var(--v-bg-danger-hover, 233, 71, 104, 1))}.vega-checkbox-container.error>input[type=checkbox]:focus-visible+.vega-checkbox-icon{outline:2px solid rgba(var(--v-border-color-danger, 230, 50, 87, 1));outline-offset:3px}:host(.checked) .vega-checkbox-container.error>.vega-checkbox-icon:active,:host(.indeterminate) .vega-checkbox-container.error>.vega-checkbox-icon:active{background-color:rgba(var(--v-bg-danger-active, 230, 50, 87, 1))}.vega-checkbox-container.error>.vega-checkbox-icon:active{border-width:1px;border-style:solid;border-color:rgba(var(--v-border-color-danger-active, 189, 41, 71, 1))}:host(.disabled) .vega-checkbox-container>.vega-checkbox-icon{background-color:rgba(var(--v-bg-secondary, 245, 247, 247, 1));border:1px solid rgba(var(--v-border-input-field-disabled, 222, 225, 227, 1))}:host(.checked.disabled) .vega-checkbox-container>.vega-checkbox-icon,:host(.indeterminate.disabled) .vega-checkbox-container>.vega-checkbox-icon{background-color:rgba(var(--v-bg-disabled, 176, 180, 181, 1));border:1px solid rgba(var(--v-border-input-field-disabled, 222, 225, 227, 1))}:host(.checked.disabled) .vega-checkbox-container>.vega-checkbox-icon>vega-icon,:host(.indeterminate.disabled) .vega-checkbox-container>.vega-checkbox-icon>vega-icon{color:rgba(var(--v-text-inverted-primary, 252, 252, 252, 1))}.vega-checkbox-container>.vega-checkbox-label-container{display:inline-block;margin-left:12px;color:rgba(var(--v-text-primary, 32, 54, 69, 1));font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}@media screen and (min-width: 768px) and (max-width: 1023px){.vega-checkbox-container>.vega-checkbox-label-container{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.vega-checkbox-container>.vega-checkbox-label-container{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.vega-checkbox-container>.vega-checkbox-label-container{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}:host(.disabled) .vega-checkbox-container>.vega-checkbox-label-container{color:rgba(var(--v-text-disabled, 176, 180, 181, 1))}.vega-error{display:block;margin-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){.vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}.vega-checkbox-label-container.vega-hidden{display:none}.vega-hidden{display:none}.size-default input[type=checkbox]{width:24px;height:24px}.size-default .vega-checkbox-icon{width:24px;height:24px;min-width:24px;border-radius:4px}.size-default .vega-checkbox-label-container{margin-left:12px;font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}@media screen and (min-width: 768px) and (max-width: 1023px){.size-default .vega-checkbox-label-container{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){.size-default .vega-checkbox-label-container{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){.size-default .vega-checkbox-label-container{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}.size-small input[type=checkbox]{width:16px;height:16px}.size-small .vega-checkbox-icon{width:16px;height:16px;min-width:16px;border-radius:2px}.size-small .vega-checkbox-label-container{margin-left:8px;font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px}@media screen and (min-width: 768px) and (max-width: 1023px){.size-small .vega-checkbox-label-container{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.size-small .vega-checkbox-label-container{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.size-small .vega-checkbox-label-container{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px}}';var P=function(e,i,t,a){var n,r=arguments.length,o=r<3?i:null===a?a=Object.getOwnPropertyDescriptor(i,t):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,i,t,a);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(r<3?n(o):r>3?n(i,t,o):n(i,t))||o);return r>3&&o&&Object.defineProperty(i,t,o),o};const q=class{constructor(t){e(this,t),this.vegaChange=i(this,"vegaChange",7),this.change=i(this,"change",7),this.globalSlimmers={},this.formFieldController=new w({propertyRules:[{propertyName:"required",ruleFactory:e=>e?new R:null}],defaultValue:[],validationRulesName:"validationRules",attributeGetter:e=>this[e],inputContainerGetter:()=>this.inputContainerRef,touchableAreaGetter:()=>this.touchableAreaGetter()}),this.checkboxValueChangeObserver=new D(h,(e=>this.childCheckboxValueChange(e))),this.checkboxEventPrevent=new I([j],(()=>this.vegaFlexElement)),this.changeEventEmitter=y(q,j),this.vegaComponentUsageRuntimeMetricsSlimmer=new u,this.label="",this.value=[],this.vegaFlexProp={},this.disabled=!1,this.required=!1,this.hint="",this.isValid=null,this.autoValidation=!0,this.validationRules=[],this.childCheckboxValueChange=e=>{this.syncCheckboxItemsValue(e.detail,e.host.identifier)},this.touchableAreaGetter=()=>{const e=[];return this.vegaCheckboxArray&&this.vegaCheckboxArray.forEach((async i=>{e.push(i.shadowRoot.querySelector("input"))})),e}}async watchValue(){this.initCheckboxArray(),this.changeEventEmitter.emit(this.value),c.notify(l,{host:this.host,detail:this.value})}watchVegaFlexProp(){this.setVegaFlexProperty()}async watchDisabled(){this.notifyGroupDisabledChange()}watchValidationRules(){}componentDidLoad(){this.setVegaFlexProperty(),this.initCheckboxArray(),this.notifyGroupDisabledChange()}render(){return o(t(a,null,this.renderLabelDom(),t("div",{class:"vega-checkbox-group-container",ref:e=>this.inputContainerRef=e},t("vega-flex",{ref:e=>{this.vegaFlexElement=e}},t("slot",null))),this.renderHintDom()),this.host)}renderLabelDom(){return this.label&&t("div",{class:"vega-label"},t("label",{"aria-label":this.label},this.label,this.renderRequireDom()))}renderRequireDom(){return this.required?t("span",{class:"vega-require"},"*"):null}renderHintDom(){return this.hint&&t("div",{class:"vega-hint"},t("label",null,this.hint))}setVegaFlexProperty(){this.vegaFlexProp&&Object.assign(this.vegaFlexElement,{gap:"size-16",direction:"col"},this.vegaFlexProp)}syncCheckboxItemsValue(e,i){e&&!this.value.includes(i)?this.value=[...this.value,i]:!e&&this.value.includes(i)&&(this.value=[...this.value.filter((e=>e!==i))])}initCheckboxArray(){this.vegaCheckboxArray=Array.from(this.host.querySelectorAll("vega-checkbox")),this.vegaCheckboxArray.forEach((e=>{e.checked=!!(this.value&&this.value.length>0)&&this.value.includes(e.identifier)}))}notifyGroupDisabledChange(){c.notify(d,{host:this.host})}get host(){return n(this)}static get watchers(){return{value:["watchValue"],vegaFlexProp:["watchVegaFlexProp"],disabled:["watchDisabled"],validationRules:["watchValidationRules"]}}};P([k()],q.prototype,"globalSlimmers",void 0),P([m()],q.prototype,"formFieldController",void 0),P([m()],q.prototype,"checkboxValueChangeObserver",void 0),P([m()],q.prototype,"checkboxEventPrevent",void 0),P([m()],q.prototype,"changeEventEmitter",void 0),P([m()],q.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),P([V()],q.prototype,"watchVegaFlexProp",null),q.style=':host{display:block;text-align:left;line-height:normal}.vega-error{display:block;margin-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){.vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}.vega-hidden{display:none}.vega-label{margin-bottom:16px}.vega-label label{font-family:"Inter", sans-serif;font-size:18px;font-weight:500;line-height:30px;letter-spacing:0px;color:rgba(var(--v-text-primary, 32, 54, 69, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){.vega-label label{font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:28px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.vega-label label{font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:28px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.vega-label label{font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:28px;letter-spacing:0px}}.vega-require{color:rgba(var(--v-text-error, 189, 41, 71, 1));margin-left:4px}.vega-hint{padding-top:12px}.vega-hint>label{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){.vega-hint>label{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.vega-hint>label{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.vega-hint>label{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}';export{G as vega_checkbox,q as vega_checkbox_group}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as t,G as s,s as i}from"./p-
|
|
1
|
+
import{i as t,G as s,s as i}from"./p-84eb3b9c.js";import{i as h}from"./p-6e70d3cc.js";class e{constructor(t,s,i=0,h=0,e,n,r){this._startOffset=0,this._endOffset=0,this._startContainer=t,this._endContainer=s,this._startOffset=i,this._endOffset=h,this._startNode=e,this._endNode=n,r&&(this._oldNativeRange=r)}get startContainer(){return this._startContainer}get endContainer(){return this._endContainer}get startNode(){return this._startNode}get endNode(){return this._endNode}get startOffset(){return this._startOffset}get endOffset(){return this._endOffset}updateRTERange(s,i){const{startOffset:h,endOffset:n}=s;this._startOffset=h,this._endOffset=n;const r=s.startNode,o=s.endNode;if(r instanceof t){this._startNode=r,this._endNode=o;const t=this._startNode.getRangeContainer(),s=this._startNode===this._endNode?t:this._endNode.getRangeContainer();t&&(this._startContainer=t,this._endContainer=s)}else this._startContainer=r,this._endContainer=o,this._startNode=this.getRTENodeByElement(this._startContainer),this._endNode=this._startContainer===this._endContainer?this._startNode:this.getRTENodeByElement(this._endContainer),i&&(this._oldNativeRange=i);return new e(this._startContainer,this._endContainer,this._startOffset,this._endOffset,this._startNode,this._endNode,this._oldNativeRange)}clone(){return new e(this._startContainer,this._endContainer,this._startOffset,this._endOffset,this._startNode,this._endNode,this._oldNativeRange)}toNativeRange(){let t=null;if(this._startNode){const s=this._startNode.getRangeContainer(),i=this._startNode===this._endNode?s:this._endNode.getRangeContainer();if(s&&i)return t=new Range,t.setStart(s,this._startOffset),t.setEnd(i,this._endOffset),this._startContainer=s,this._endContainer=i,this._oldNativeRange=t,t}if(!t&&this._oldNativeRange)return this._oldNativeRange}getRTENodeByElement(t){if(t){const e=t.nodeType===Node.TEXT_NODE?t.parentElement:h(t)&&s.isDecoratorNodeContainerElement(t)?s.getDecoratorNodeElement(t):t;return i.getEntityByDOM(e)}}}export{e as R}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as t,M as e,V as s}from"./p-6e1ab235.js";import{i,j as n}from"./p-
|
|
1
|
+
import{c as t,M as e,V as s}from"./p-6e1ab235.js";import{i,j as n}from"./p-f1c672e4.js";import{v as r}from"./p-5f377954.js";import{F as h}from"./p-18e8d9b7.js";var o=function(t,e,s,i){var n,r=arguments.length,h=r<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,e,s,i);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(h=(r<3?n(h):r>3?n(e,s,h):n(e,s))||h);return r>3&&h&&Object.defineProperty(e,s,h),h};class a extends s{constructor(t,e,s,i){if(super(),this.eventIds=[],this.useCapture=!1,this.isEventListenerAdded=!1,this.disabled=!1,this.preventChildEvent=t=>{const e=this.getHostElement();if(!this.shouldSkipEventPrevent())if("function"==typeof this.customPreventHandle)this.customPreventHandle(t);else{const s=t.composedPath();e===t.target&&e===s[0]||t.stopImmediatePropagation()}},this.eventIds=t,this.getHostElement=e,!0===s)this.useCapture=!0;else if(s){const{useCapture:t=!1,customPreventHandle:e}=s;this.useCapture=t,this.customPreventHandle=e}this.disabled=!0===i}setup(){this.addOrRemoveEventListener("add")}checkEventListenerStatus(){this.isEventListenerAdded||this.setup(),this.setSkipEventPreventFlag()}destroy(){this.addOrRemoveEventListener("remove")}setSkipEventPreventFlag(){h.isEnabled("VEGA_REACT.SKIP_NATIVE_EVENT_PREVENT_BY_DEFAULT")&&this.disabled&&this.host&&"react"===r.getVegaEnv().framework&&"native"===i.getSemantics(this.host).namespace&&this.getHostElement().setAttribute("data-vega-no-event-prevent","true")}addOrRemoveEventListener(t){const e=this.getHostElement();this.eventIds&&this.eventIds.length&&e&&(this.eventIds.filter((t=>this.shouldPrevent(t))).forEach((s=>{e["add"===t?"addEventListener":"removeEventListener"](this.getCurrentEventName(s),this.preventChildEvent,this.useCapture)})),this.isEventListenerAdded="add"===t)}getCurrentEventName(t){return t.getCurrentName(i.getSemantics(this.host))}shouldPrevent(t){const{namespace:e,jqueryDelegatedEvent:s}=i.getSemantics(this.host);return!("native"===e&&s&&n.isSupportDelegated(this.host,t))}shouldSkipEventPrevent(){const t=this.getHostElement();return t&&"true"===t.dataset.vegaNoEventPrevent}}o([t()],a.prototype,"host",void 0),o([e("connectedCallback")],a.prototype,"setup",null),o([e("componentDidLoad")],a.prototype,"checkEventListenerStatus",null),o([e("disconnectedCallback")],a.prototype,"destroy",null);export{a as C}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as t,H as n,r as e,c as o,g as r}from"./p-6b2342e0.js";import{c as i,V as s,I as a}from"./p-6e1ab235.js";import{V as c,I as b}from"./p-4415ad28.js";import{s as l}from"./p-519a7d55.js";import{c as p}from"./p-6ac8e655.js";import{g as h,D as d,a as f}from"./p-6e70d3cc.js";import{V as g}from"./p-e1fbfd20.js";import{D as u}from"./p-f28a6074.js";import{a as v,g as m,h as x}from"./p-b78eaec4.js";import{F as w}from"./p-18e8d9b7.js";import{c as y}from"./p-effa6495.js";import"./p-e6adf829.js";import"./p-593e0f80.js";import"./p-6a334573.js";import"./p-8b5d3a52.js";import"./p-2d0d575f.js";import"./p-331a62d5.js";import"./p-5a25014f.js";import"./p-9de25451.js";import"./p-b75ee3ba.js";var C=function(t,n,e,o){var r,i=arguments.length,s=i<3?n:null===o?o=Object.getOwnPropertyDescriptor(n,e):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,n,e,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(i<3?r(s):i>3?r(n,e,s):r(n,e))||s);return i>3&&s&&Object.defineProperty(n,e,s),s};class j extends s{constructor(){super(...arguments),this.isMobileDevice=h()===d.MOBILE,this.space=this.isMobileDevice?"size-16":"size-24",this.handleCloseButtonClick=()=>{const t=this.closeEventEmitter.emit();t&&!t.defaultPrevented&&this.host.remove()}}render(){const e=[`banner-${this.type}`,this.isMobileDevice&&"banner-mobile",!this.isOpen&&"banner-hidden",!this.bannerTitle&&"banner-no-title"].filter(Boolean);return t(n,{class:f(e),padding:this.space},t("vega-flex",{direction:"row",gap:this.isMobileDevice?"size-8":"size-16",justifyContent:"space-between",alignItems:"start"},this.renderPrefixIcon(),this.renderBannerContent(),this.renderCloseButton()),this.isMobileDevice?this.actionButtonRenderer.render():null)}renderBannerContent(){const n=this.hasContentSlot();return t("div",{class:{"banner-content-container":!0,linear:!(this.isMobileDevice||(this.content||n)&&this.bannerTitle)}},this.renderBannerTitle(),t("div",{class:"banner-content"},n?t("slot",{name:"content"}):t("vega-font",{variant:this.isMobileDevice?"font-footnote1-long":"font-p2-short",color:"error"===this.type?"text-primary":"text-black"},this.content),this.isMobileDevice?null:this.actionButtonRenderer.render()))}hasContentSlot(){return null!==this.host.querySelector('[slot="content"]')}renderBannerTitle(){if(this.bannerTitle)return t("vega-font",{class:"banner-title",variant:this.isMobileDevice?"font-h6":"font-h5",color:"error"===this.type?"text-primary":"text-black"},this.bannerTitle)}renderCloseButton(){if(this.showCloseButton)return t("div",{class:"banner-close-button","aria-label":"Close Button",role:"button",tabIndex:0,onClick:this.handleCloseButtonClick,onKeyDown:p()},t("vega-icon",{size:this.isMobileDevice?"size-12":"size-16",icon:this.iconController.getCloseIcon()}))}renderPrefixIcon(){return t("div",{class:"banner-prefix-icon"},t("vega-icon",{size:this.space,icon:this.iconController.getIconByType()}))}}C([i()],j.prototype,"host",void 0),C([i()],j.prototype,"type",void 0),C([i()],j.prototype,"bannerTitle",void 0),C([i()],j.prototype,"content",void 0),C([i()],j.prototype,"showCloseButton",void 0),C([i()],j.prototype,"actionButtons",void 0),C([i()],j.prototype,"actionButtonRenderer",void 0),C([i()],j.prototype,"iconController",void 0),C([i()],j.prototype,"isOpen",void 0),C([i()],j.prototype,"closeEventEmitter",void 0);var z;!function(t){t.warning="triangle-exclamation",t.success="circle-check",t.error="circle-question",t.info="circle-info"}(z||(z={}));class k extends s{getIconByType(){return g.getIconKey(z[this.type])}getCloseIcon(){return g.getIconKey("xmark-large")}}g.register({"triangle-exclamation":{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M256 32c14.2 0 27.3 7.5 34.5 19.8l216 368c7.3 12.4 7.3 27.7 .2 40.1S486.3 480 472 480H40c-14.3 0-27.6-7.7-34.7-20.1s-7-27.8 .2-40.1l216-368C228.7 39.5 241.8 32 256 32zm0 128c-13.3 0-24 10.7-24 24V296c0 13.3 10.7 24 24 24s24-10.7 24-24V184c0-13.3-10.7-24-24-24zm32 224a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"/></svg>'},"circle-check":{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M256 512c141.4 0 256-114.6 256-256S397.4 0 256 0S0 114.6 0 256S114.6 512 256 512zM369 209L241 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L335 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z"/></svg>'},"circle-question":{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM169.8 165.3c7.9-22.3 29.1-37.3 52.8-37.3h58.3c34.9 0 63.1 28.3 63.1 63.1c0 22.6-12.1 43.5-31.7 54.8L280 264.4c-.2 13-10.9 23.6-24 23.6c-13.3 0-24-10.7-24-24V250.5c0-8.6 4.6-16.5 12.1-20.8l44.3-25.4c4.7-2.7 7.6-7.7 7.6-13.1c0-8.4-6.8-15.1-15.1-15.1H222.6c-3.4 0-6.4 2.1-7.5 5.3l-.4 1.2c-4.4 12.5-18.2 19-30.6 14.6s-19-18.2-14.6-30.6l.4-1.2zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"/></svg>'},"circle-info":{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM216 336h24V272H216c-13.3 0-24-10.7-24-24s10.7-24 24-24h48c13.3 0 24 10.7 24 24v88h8c13.3 0 24 10.7 24 24s-10.7 24-24 24H216c-13.3 0-24-10.7-24-24s10.7-24 24-24zm40-208a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"/></svg>'},"xmark-large":{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M393.4 41.4c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3L269.3 256 438.6 425.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L224 301.3 54.6 470.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L178.7 256 9.4 86.6C-3.1 74.1-3.1 53.9 9.4 41.4s32.8-12.5 45.3 0L224 210.7 393.4 41.4z"/></svg>'}}),function(t,n,e,o){var r,i=arguments.length,s=i<3?n:null===o?o=Object.getOwnPropertyDescriptor(n,e):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,n,e,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(i<3?r(s):i>3?r(n,e,s):r(n,e))||s);i>3&&s&&Object.defineProperty(n,e,s)}([i()],k.prototype,"type",void 0);var B=function(t,n,e,o){var r,i=arguments.length,s=i<3?n:null===o?o=Object.getOwnPropertyDescriptor(n,e):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,n,e,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(i<3?r(s):i>3?r(n,e,s):r(n,e))||s);return i>3&&s&&Object.defineProperty(n,e,s),s};class I extends s{render(){var n;if((null===(n=this.actionButtons)||void 0===n?void 0:n.length)>0)return t("div",{class:"banner-buttons"},this.actionButtons.map(((t,n)=>this.renderButtonItem(t,`${t.label}${n}`))))}renderButtonItem(n,e){return t("vega-button",{key:e,size:"small",variant:"secondary",ref:t=>{u.addUniqueObserverToNode(t,v,(()=>{w.isEnabled("VEGA_BANNER_DEPRECATED_ACTION_BUTTON_PROP_VEGA_CLICK")||"function"!=typeof n.vegaClick||n.vegaClick(n),this.actionButtonClickEventEmitter.emit(n)}))}},n.label)}}B([i()],I.prototype,"actionButtons",void 0),B([i()],I.prototype,"actionButtonClickEventEmitter",void 0);var L=function(t,n,e,o){var r,i=arguments.length,s=i<3?n:null===o?o=Object.getOwnPropertyDescriptor(n,e):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,n,e,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(i<3?r(s):i>3?r(n,e,s):r(n,e))||s);return i>3&&s&&Object.defineProperty(n,e,s),s};const R=class{constructor(t){e(this,t),this.vegaClose=o(this,"vegaClose",7),this.close=o(this,"close",7),this.vegaActionButtonClick=o(this,"vegaActionButtonClick",7),this.actionButtonClick=o(this,"actionButtonClick",7),this.globalSlimmers={},this.closeEventEmitter=y(R,m),this.renderer=new j,this.actionButtonRenderer=new I,this.iconController=new k,this.vegaComponentUsageRuntimeMetricsSlimmer=new c,this.actionButtonClickEventEmitter=y(R,x),this.type="info",this.bannerTitle="",this.content="",this.actionButtons=null,this.showCloseButton=!0,this.isOpen=!0}async doClose(){this.host.remove(),this.closeEventEmitter.emit()}render(){return l(this.renderer.render(),this.host)}get host(){return r(this)}};L([b()],R.prototype,"globalSlimmers",void 0),L([a()],R.prototype,"closeEventEmitter",void 0),L([a()],R.prototype,"renderer",void 0),L([a()],R.prototype,"actionButtonRenderer",void 0),L([a()],R.prototype,"iconController",void 0),L([a()],R.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),L([a()],R.prototype,"actionButtonClickEventEmitter",void 0),R.style=':host{display:block;width:100%;padding:24px;background-color:rgba(var(--v-bg-transparent, 0, 0, 0, 0));box-sizing:border-box;box-shadow:var(--v-shadow-card, 0px 2px 8px 0px rgba(0, 0, 0, 0.04), 0px 2px 4px 0px rgba(0, 0, 0, 0.02));border-radius:12px;color:rgba(var(--v-text-black, 32, 54, 69, 1))}:host .banner-prefix-icon{padding-top:4px}:host .banner-prefix-icon vega-icon{display:block}:host .banner-content-container{width:100%}:host .banner-content-container .banner-title{display:block;padding-top:2px}:host .banner-content-container .banner-content{display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:24px;flex-wrap:wrap}:host .banner-content-container .banner-content>vega-font:last-child{padding-top:6px}:host .banner-content-container.linear{display:flex;justify-content:space-between}:host .banner-content-container.linear .banner-content{flex-grow:1}:host .banner-buttons{text-align:right;text-wrap:nowrap;flex:auto}:host .banner-buttons vega-button{margin-left:16px}:host .banner-buttons vega-button::part(button){padding-top:4px;padding-bottom:4px}:host .banner-buttons vega-button::part(button),:host .banner-buttons vega-button::part(button):hover{font-family:"Inter", sans-serif;font-size:18px;font-weight:700;line-height:24px;letter-spacing:0px;color:rgba(var(--v-text-black, 32, 54, 69, 1));background-color:rgba(var(--v-bg-transparent, 0, 0, 0, 0));border:2px solid rgba(var(--v-border-notification-btn-black, 32, 54, 69, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){:host .banner-buttons vega-button::part(button),:host .banner-buttons vega-button::part(button):hover{font-family:"Inter", sans-serif;font-size:16px;font-weight:700;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .banner-buttons vega-button::part(button),:host .banner-buttons vega-button::part(button):hover{font-family:"Inter", sans-serif;font-size:16px;font-weight:700;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .banner-buttons vega-button::part(button),:host .banner-buttons vega-button::part(button):hover{font-family:"Inter", sans-serif;font-size:16px;font-weight:700;line-height:24px;letter-spacing:0px}}:host .banner-buttons vega-button::part(button):focus-visible{outline:2px solid;outline-offset:2px;box-shadow:0 0 0}:host .banner-close-button{padding:4px;padding-top:8px}:host .banner-close-button:focus-visible{outline:2px solid;outline-offset:0px}:host .banner-close-button vega-icon{cursor:pointer;display:block}:host(.banner-mobile){padding:16px}:host(.banner-mobile) .banner-content-container .banner-title{padding-top:0px}:host(.banner-mobile) .banner-content-container .banner-content{padding-top:2px;gap:16px}:host(.banner-mobile) .banner-content-container .banner-content>vega-font:last-child{padding-top:0px}:host(.banner-mobile) .banner-buttons vega-button{margin-left:8px;margin-top:16px}:host(.banner-mobile) .banner-close-button{padding:2px;padding-top:4px}:host(.banner-success){background-color:rgba(var(--v-bg-status-success, 160, 233, 167, 1))}:host(.banner-error){background-color:rgba(var(--v-bg-status-error, 255, 110, 139, 1));color:rgba(var(--v-text-primary, 32, 54, 69, 1))}:host(.banner-error) .banner-buttons vega-button::part(button),:host(.banner-error) .banner-buttons vega-button::part(button):hover{color:rgba(var(--v-text-primary, 32, 54, 69, 1));border:2px solid rgba(var(--v-border-notification-btn, 32, 54, 69, 1))}:host(.banner-error) .banner-buttons vega-button::part(button):focus-visible{outline:2px solid rgba(var(--v-border-color-notification-btn, 32, 54, 69, 1));outline-offset:2px}:host(.banner-error) .banner-close-button:focus-visible{outline:2px solid rgba(var(--v-border-color-notification-btn, 32, 54, 69, 1));outline-offset:0px}:host(.banner-info){background-color:rgba(var(--v-bg-status-info, 205, 209, 211, 1))}:host(.banner-warning){background-color:rgba(var(--v-bg-status-warning, 255, 220, 131, 1))}:host(.banner-no-title) .banner-prefix-icon{padding-top:2px}:host(.banner-no-title) .banner-close-button{padding-top:6px}:host(.banner-no-title) .banner-content-container .banner-content>vega-font:last-child{padding-top:0px}@media (min-width: 768px){:host(.banner-no-title) .banner-prefix-icon{padding-top:0px}:host(.banner-no-title) .banner-close-button{padding-top:3px}}:host(.banner-no-title.banner-mobile) .banner-prefix-icon{padding-top:2px}:host(.banner-no-title.banner-mobile) .banner-close-button{padding-top:2px}:host(.banner-no-title.banner-mobile) .banner-content-container .banner-content{padding-top:0px}@media (min-width: 768px){:host(.banner-no-title.banner-mobile) .banner-prefix-icon{padding-top:1px}:host(.banner-no-title.banner-mobile) .banner-close-button{padding-top:3px}}:host(.banner-hidden){display:none}';export{R as vega_banner}
|
|
1
|
+
import{h as t,H as n,r as e,c as o,g as r}from"./p-6b2342e0.js";import{c as i,V as s,I as a}from"./p-6e1ab235.js";import{V as c,I as b}from"./p-4415ad28.js";import{s as l}from"./p-519a7d55.js";import{c as p}from"./p-6ac8e655.js";import{g as h,D as d,a as f}from"./p-6e70d3cc.js";import{V as g}from"./p-e1fbfd20.js";import{D as u}from"./p-f28a6074.js";import{a as v,g as m,h as x}from"./p-9af0e2e7.js";import{F as w}from"./p-18e8d9b7.js";import{c as y}from"./p-6b5cb920.js";import"./p-e6adf829.js";import"./p-593e0f80.js";import"./p-6a334573.js";import"./p-8b5d3a52.js";import"./p-2d0d575f.js";import"./p-331a62d5.js";import"./p-5a25014f.js";import"./p-f1c672e4.js";import"./p-b75ee3ba.js";var C=function(t,n,e,o){var r,i=arguments.length,s=i<3?n:null===o?o=Object.getOwnPropertyDescriptor(n,e):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,n,e,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(i<3?r(s):i>3?r(n,e,s):r(n,e))||s);return i>3&&s&&Object.defineProperty(n,e,s),s};class j extends s{constructor(){super(...arguments),this.isMobileDevice=h()===d.MOBILE,this.space=this.isMobileDevice?"size-16":"size-24",this.handleCloseButtonClick=()=>{const t=this.closeEventEmitter.emit();t&&!t.defaultPrevented&&this.host.remove()}}render(){const e=[`banner-${this.type}`,this.isMobileDevice&&"banner-mobile",!this.isOpen&&"banner-hidden",!this.bannerTitle&&"banner-no-title"].filter(Boolean);return t(n,{class:f(e),padding:this.space},t("vega-flex",{direction:"row",gap:this.isMobileDevice?"size-8":"size-16",justifyContent:"space-between",alignItems:"start"},this.renderPrefixIcon(),this.renderBannerContent(),this.renderCloseButton()),this.isMobileDevice?this.actionButtonRenderer.render():null)}renderBannerContent(){const n=this.hasContentSlot();return t("div",{class:{"banner-content-container":!0,linear:!(this.isMobileDevice||(this.content||n)&&this.bannerTitle)}},this.renderBannerTitle(),t("div",{class:"banner-content"},n?t("slot",{name:"content"}):t("vega-font",{variant:this.isMobileDevice?"font-footnote1-long":"font-p2-short",color:"error"===this.type?"text-primary":"text-black"},this.content),this.isMobileDevice?null:this.actionButtonRenderer.render()))}hasContentSlot(){return null!==this.host.querySelector('[slot="content"]')}renderBannerTitle(){if(this.bannerTitle)return t("vega-font",{class:"banner-title",variant:this.isMobileDevice?"font-h6":"font-h5",color:"error"===this.type?"text-primary":"text-black"},this.bannerTitle)}renderCloseButton(){if(this.showCloseButton)return t("div",{class:"banner-close-button","aria-label":"Close Button",role:"button",tabIndex:0,onClick:this.handleCloseButtonClick,onKeyDown:p()},t("vega-icon",{size:this.isMobileDevice?"size-12":"size-16",icon:this.iconController.getCloseIcon()}))}renderPrefixIcon(){return t("div",{class:"banner-prefix-icon"},t("vega-icon",{size:this.space,icon:this.iconController.getIconByType()}))}}C([i()],j.prototype,"host",void 0),C([i()],j.prototype,"type",void 0),C([i()],j.prototype,"bannerTitle",void 0),C([i()],j.prototype,"content",void 0),C([i()],j.prototype,"showCloseButton",void 0),C([i()],j.prototype,"actionButtons",void 0),C([i()],j.prototype,"actionButtonRenderer",void 0),C([i()],j.prototype,"iconController",void 0),C([i()],j.prototype,"isOpen",void 0),C([i()],j.prototype,"closeEventEmitter",void 0);var z;!function(t){t.warning="triangle-exclamation",t.success="circle-check",t.error="circle-question",t.info="circle-info"}(z||(z={}));class k extends s{getIconByType(){return g.getIconKey(z[this.type])}getCloseIcon(){return g.getIconKey("xmark-large")}}g.register({"triangle-exclamation":{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M256 32c14.2 0 27.3 7.5 34.5 19.8l216 368c7.3 12.4 7.3 27.7 .2 40.1S486.3 480 472 480H40c-14.3 0-27.6-7.7-34.7-20.1s-7-27.8 .2-40.1l216-368C228.7 39.5 241.8 32 256 32zm0 128c-13.3 0-24 10.7-24 24V296c0 13.3 10.7 24 24 24s24-10.7 24-24V184c0-13.3-10.7-24-24-24zm32 224a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"/></svg>'},"circle-check":{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M256 512c141.4 0 256-114.6 256-256S397.4 0 256 0S0 114.6 0 256S114.6 512 256 512zM369 209L241 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L335 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z"/></svg>'},"circle-question":{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM169.8 165.3c7.9-22.3 29.1-37.3 52.8-37.3h58.3c34.9 0 63.1 28.3 63.1 63.1c0 22.6-12.1 43.5-31.7 54.8L280 264.4c-.2 13-10.9 23.6-24 23.6c-13.3 0-24-10.7-24-24V250.5c0-8.6 4.6-16.5 12.1-20.8l44.3-25.4c4.7-2.7 7.6-7.7 7.6-13.1c0-8.4-6.8-15.1-15.1-15.1H222.6c-3.4 0-6.4 2.1-7.5 5.3l-.4 1.2c-4.4 12.5-18.2 19-30.6 14.6s-19-18.2-14.6-30.6l.4-1.2zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"/></svg>'},"circle-info":{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM216 336h24V272H216c-13.3 0-24-10.7-24-24s10.7-24 24-24h48c13.3 0 24 10.7 24 24v88h8c13.3 0 24 10.7 24 24s-10.7 24-24 24H216c-13.3 0-24-10.7-24-24s10.7-24 24-24zm40-208a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"/></svg>'},"xmark-large":{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M393.4 41.4c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3L269.3 256 438.6 425.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L224 301.3 54.6 470.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L178.7 256 9.4 86.6C-3.1 74.1-3.1 53.9 9.4 41.4s32.8-12.5 45.3 0L224 210.7 393.4 41.4z"/></svg>'}}),function(t,n,e,o){var r,i=arguments.length,s=i<3?n:null===o?o=Object.getOwnPropertyDescriptor(n,e):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,n,e,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(i<3?r(s):i>3?r(n,e,s):r(n,e))||s);i>3&&s&&Object.defineProperty(n,e,s)}([i()],k.prototype,"type",void 0);var B=function(t,n,e,o){var r,i=arguments.length,s=i<3?n:null===o?o=Object.getOwnPropertyDescriptor(n,e):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,n,e,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(i<3?r(s):i>3?r(n,e,s):r(n,e))||s);return i>3&&s&&Object.defineProperty(n,e,s),s};class I extends s{render(){var n;if((null===(n=this.actionButtons)||void 0===n?void 0:n.length)>0)return t("div",{class:"banner-buttons"},this.actionButtons.map(((t,n)=>this.renderButtonItem(t,`${t.label}${n}`))))}renderButtonItem(n,e){return t("vega-button",{key:e,size:"small",variant:"secondary",ref:t=>{u.addUniqueObserverToNode(t,v,(()=>{w.isEnabled("VEGA_BANNER_DEPRECATED_ACTION_BUTTON_PROP_VEGA_CLICK")||"function"!=typeof n.vegaClick||n.vegaClick(n),this.actionButtonClickEventEmitter.emit(n)}))}},n.label)}}B([i()],I.prototype,"actionButtons",void 0),B([i()],I.prototype,"actionButtonClickEventEmitter",void 0);var L=function(t,n,e,o){var r,i=arguments.length,s=i<3?n:null===o?o=Object.getOwnPropertyDescriptor(n,e):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,n,e,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(i<3?r(s):i>3?r(n,e,s):r(n,e))||s);return i>3&&s&&Object.defineProperty(n,e,s),s};const R=class{constructor(t){e(this,t),this.vegaClose=o(this,"vegaClose",7),this.close=o(this,"close",7),this.vegaActionButtonClick=o(this,"vegaActionButtonClick",7),this.actionButtonClick=o(this,"actionButtonClick",7),this.globalSlimmers={},this.closeEventEmitter=y(R,m),this.renderer=new j,this.actionButtonRenderer=new I,this.iconController=new k,this.vegaComponentUsageRuntimeMetricsSlimmer=new c,this.actionButtonClickEventEmitter=y(R,x),this.type="info",this.bannerTitle="",this.content="",this.actionButtons=null,this.showCloseButton=!0,this.isOpen=!0}async doClose(){this.host.remove(),this.closeEventEmitter.emit()}render(){return l(this.renderer.render(),this.host)}get host(){return r(this)}};L([b()],R.prototype,"globalSlimmers",void 0),L([a()],R.prototype,"closeEventEmitter",void 0),L([a()],R.prototype,"renderer",void 0),L([a()],R.prototype,"actionButtonRenderer",void 0),L([a()],R.prototype,"iconController",void 0),L([a()],R.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),L([a()],R.prototype,"actionButtonClickEventEmitter",void 0),R.style=':host{display:block;width:100%;padding:24px;background-color:rgba(var(--v-bg-transparent, 0, 0, 0, 0));box-sizing:border-box;box-shadow:var(--v-shadow-card, 0px 2px 8px 0px rgba(0, 0, 0, 0.04), 0px 2px 4px 0px rgba(0, 0, 0, 0.02));border-radius:12px;color:rgba(var(--v-text-black, 32, 54, 69, 1))}:host .banner-prefix-icon{padding-top:4px}:host .banner-prefix-icon vega-icon{display:block}:host .banner-content-container{width:100%}:host .banner-content-container .banner-title{display:block;padding-top:2px}:host .banner-content-container .banner-content{display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:24px;flex-wrap:wrap}:host .banner-content-container .banner-content>vega-font:last-child{padding-top:6px}:host .banner-content-container.linear{display:flex;justify-content:space-between}:host .banner-content-container.linear .banner-content{flex-grow:1}:host .banner-buttons{text-align:right;text-wrap:nowrap;flex:auto}:host .banner-buttons vega-button{margin-left:16px}:host .banner-buttons vega-button::part(button){padding-top:4px;padding-bottom:4px}:host .banner-buttons vega-button::part(button),:host .banner-buttons vega-button::part(button):hover{font-family:"Inter", sans-serif;font-size:18px;font-weight:700;line-height:24px;letter-spacing:0px;color:rgba(var(--v-text-black, 32, 54, 69, 1));background-color:rgba(var(--v-bg-transparent, 0, 0, 0, 0));border:2px solid rgba(var(--v-border-notification-btn-black, 32, 54, 69, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){:host .banner-buttons vega-button::part(button),:host .banner-buttons vega-button::part(button):hover{font-family:"Inter", sans-serif;font-size:16px;font-weight:700;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .banner-buttons vega-button::part(button),:host .banner-buttons vega-button::part(button):hover{font-family:"Inter", sans-serif;font-size:16px;font-weight:700;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .banner-buttons vega-button::part(button),:host .banner-buttons vega-button::part(button):hover{font-family:"Inter", sans-serif;font-size:16px;font-weight:700;line-height:24px;letter-spacing:0px}}:host .banner-buttons vega-button::part(button):focus-visible{outline:2px solid;outline-offset:2px;box-shadow:0 0 0}:host .banner-close-button{padding:4px;padding-top:8px}:host .banner-close-button:focus-visible{outline:2px solid;outline-offset:0px}:host .banner-close-button vega-icon{cursor:pointer;display:block}:host(.banner-mobile){padding:16px}:host(.banner-mobile) .banner-content-container .banner-title{padding-top:0px}:host(.banner-mobile) .banner-content-container .banner-content{padding-top:2px;gap:16px}:host(.banner-mobile) .banner-content-container .banner-content>vega-font:last-child{padding-top:0px}:host(.banner-mobile) .banner-buttons vega-button{margin-left:8px;margin-top:16px}:host(.banner-mobile) .banner-close-button{padding:2px;padding-top:4px}:host(.banner-success){background-color:rgba(var(--v-bg-status-success, 160, 233, 167, 1))}:host(.banner-error){background-color:rgba(var(--v-bg-status-error, 255, 110, 139, 1));color:rgba(var(--v-text-primary, 32, 54, 69, 1))}:host(.banner-error) .banner-buttons vega-button::part(button),:host(.banner-error) .banner-buttons vega-button::part(button):hover{color:rgba(var(--v-text-primary, 32, 54, 69, 1));border:2px solid rgba(var(--v-border-notification-btn, 32, 54, 69, 1))}:host(.banner-error) .banner-buttons vega-button::part(button):focus-visible{outline:2px solid rgba(var(--v-border-color-notification-btn, 32, 54, 69, 1));outline-offset:2px}:host(.banner-error) .banner-close-button:focus-visible{outline:2px solid rgba(var(--v-border-color-notification-btn, 32, 54, 69, 1));outline-offset:0px}:host(.banner-info){background-color:rgba(var(--v-bg-status-info, 205, 209, 211, 1))}:host(.banner-warning){background-color:rgba(var(--v-bg-status-warning, 255, 220, 131, 1))}:host(.banner-no-title) .banner-prefix-icon{padding-top:2px}:host(.banner-no-title) .banner-close-button{padding-top:6px}:host(.banner-no-title) .banner-content-container .banner-content>vega-font:last-child{padding-top:0px}@media (min-width: 768px){:host(.banner-no-title) .banner-prefix-icon{padding-top:0px}:host(.banner-no-title) .banner-close-button{padding-top:3px}}:host(.banner-no-title.banner-mobile) .banner-prefix-icon{padding-top:2px}:host(.banner-no-title.banner-mobile) .banner-close-button{padding-top:2px}:host(.banner-no-title.banner-mobile) .banner-content-container .banner-content{padding-top:0px}@media (min-width: 768px){:host(.banner-no-title.banner-mobile) .banner-prefix-icon{padding-top:1px}:host(.banner-no-title.banner-mobile) .banner-close-button{padding-top:3px}}:host(.banner-hidden){display:none}';export{R as vega_banner}
|
|
@@ -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-4415ad28.js";import{s as u}from"./p-519a7d55.js";import{V as h}from"./p-e1fbfd20.js";import{t as f}from"./p-aacf6920.js";import{D as v,d as b}from"./p-f28a6074.js";import{i as g,a as m,o as y}from"./p-b78eaec4.js";import{ab as x}from"./p-aa040383.js";import{a as C}from"./p-6e70d3cc.js";import{C as w}from"./p-2d0d575f.js";import{y as j,x as k}from"./p-aa985d73.js";import{c as R}from"./p-effa6495.js";import{d as O}from"./p-a841cf13.js";import{T as E}from"./p-57f220b5.js";import{S,a as F,C as $}from"./p-032183c1.js";import{A as L}from"./p-4d65756f.js";import{d as A}from"./p-1bc5b3bc.js";import{C as T}from"./p-c47c37f2.js";import{C as D}from"./p-2bb5a232.js";import"./p-e6adf829.js";import"./p-593e0f80.js";import"./p-6a334573.js";import"./p-8b5d3a52.js";import"./p-331a62d5.js";import"./p-02841589.js";import"./p-e4c4ea35.js";import"./p-ed45b3b6.js";import"./p-d4ea8e22.js";import"./p-d884c644.js";import"./p-3b791b5d.js";import"./p-a528714c.js";import"./p-8aee6b74.js";import"./p-fb5ea4b2.js";import"./p-4866e390.js";import"./p-b75ee3ba.js";import"./p-f0e828d8.js";import"./p-9de25451.js";import"./p-bdddddb7.js";import"./p-a87cb7ac.js";import"./p-4cefd7fe.js";import"./p-1fb56e14.js";import"./p-5f377954.js";import"./p-18e8d9b7.js";import"./p-5a25014f.js";var H=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};class P extends a{constructor(){super(...arguments),this.languageDropdownProps={searchable:!1},this.languageOptions=Object.keys(x).map((t=>({id:x[t],displayName:t}))),this.handleLanguageChange=t=>{v.addUniqueObserverToNode(t,g,(t=>{var e;this.valueController.updateValue(null===(e=this.value)||void 0===e?void 0:e.code,t.detail)}))},this.handleDeleteClick=t=>{v.addUniqueObserverToNode(t,m,(()=>{this.removeEventEmitter.emit().defaultPrevented||this.host.remove()}))}}getToolbarContainerRef(){return this.toolbarContainerRef}render(){return t(e,null,t("div",{part:"editor-toolbar",contenteditable:!1,class:{"editor-toolbar":!this.readOnly,"copy-button-container":this.showCopyButton&&this.readOnly},ref:t=>this.toolbarContainerRef=t},this.renderEditorToolbar(),this.copyButtonRenderer.render()),this.contentRenderer.render())}renderEditorToolbar(){var n,o;if(!this.readOnly)return t(e,null,t("vega-input-select",{source:this.languageOptions,value:null!==(o=null===(n=this.value)||void 0===n?void 0:n.language)&&void 0!==o?o:"",disabled:this.disabled,placeholder:this.translationSlimmer.t("Select Language"),size:"small",vegaDropdownProps:this.languageDropdownProps,exportparts:"select-container, selected-box, placeholder, toggle-icon-container, toggle-icon",ref:this.handleLanguageChange}),t("vega-button-circle",{key:"delete-button",disabled:this.disabled,label:this.translationSlimmer.t("Delete Code"),icon:h.getIconKey("trash-can"),iconColor:"text-secondary",variant:"icon-only",size:"extra-small",ref:this.handleDeleteClick}))}}h.register({"trash-can":f}),H([s()],P.prototype,"readOnly",void 0),H([s()],P.prototype,"host",void 0),H([s()],P.prototype,"disabled",void 0),H([s()],P.prototype,"showCopyButton",void 0),H([s()],P.prototype,"value",void 0),H([s()],P.prototype,"contentRenderer",void 0),H([s()],P.prototype,"valueController",void 0),H([s()],P.prototype,"removeEventEmitter",void 0),H([s()],P.prototype,"translationSlimmer",void 0),H([s()],P.prototype,"copyButtonRenderer",void 0);var N=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};class _ extends a{constructor(){super(...arguments),this.handleFocus=()=>{this.readOnly||this.disabled||this.host.classList.add("focus")},this.handleBlur=()=>{this.host.classList.remove("focus"),w.notify(b.getSubject(this.host,j),null)}}getCodeContentContainerRef(){return this.codeContentContainerRef}registerEventListener(){this.codeContentContainerRef&&(this.codeContentContainerRef.addEventListener("focusin",this.handleFocus),this.codeContentContainerRef.addEventListener("focusout",this.handleBlur))}unregisterEventListener(){this.codeContentContainerRef&&(this.codeContentContainerRef.removeEventListener("focusin",this.handleFocus),this.codeContentContainerRef.removeEventListener("focusout",this.handleBlur))}render(){var n;const o=this.contentParseController.parseCode(),i=(null===(n=this.value)||void 0===n?void 0:n.language)||"";return t(e,null,t("style",null,this.getLineNumberStyleVariable(o)),t("code",{role:"textbox",tabIndex:0,spellcheck:!1,ref:t=>this.codeContentContainerRef=t,contenteditable:!this.readOnly&&!this.disabled,"data-language":i,innerHTML:o.map((t=>this.renderCodeNode(t))).join("")}))}renderCodeNode(t){const{key:e,className:n,mark:o,text:i}=t;return`<span key='${e}' class='${n}' data-mark='${o}' data-index='${e}'>${i}</span>`}getLineNumberStyleVariable(t){const e=10*(t.filter((t=>"\n"===t.text)).length+1).toString().length;return`code{--v-code-line-number-width:${e}px;--v-code-line-number-ml:-${e+16}px;--v-code-block-pl:${e+16}px}`}}N([s()],_.prototype,"host",void 0),N([s()],_.prototype,"readOnly",void 0),N([s()],_.prototype,"disabled",void 0),N([s()],_.prototype,"value",void 0),N([s()],_.prototype,"contentParseController",void 0),N([c("componentDidLoad")],_.prototype,"registerEventListener",null),N([c("disconnectedCallback")],_.prototype,"unregisterEventListener",null);var z=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};class B extends a{updateValue(t,e,n){this.value&&this.value.code===t&&this.value.language===e||(this.value={language:e,code:t},this.changeEventEmitter.emit(this.value),n&&n.recordHistory&&this.historyController.registerHistory({value:this.value,offset:n.offset}))}initialValue(){this.value||(this.value={code:"",language:"plainText"})}}z([s({writable:!0})],B.prototype,"value",void 0),z([s()],B.prototype,"changeEventEmitter",void 0),z([s()],B.prototype,"historyController",void 0),z([c("connectedCallback")],B.prototype,"initialValue",null);var I=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};class M extends a{constructor(){super(...arguments),this.codeNodes=[]}getCurrentCodeNodes(){return this.codeNodes}parseCode(){const t=[this.prismCodeHighlightParser,this.defaultCodeHighlightParser];let e=[];for(const n of t)if(n.canParse()){e=n.parse();break}return this.codeNodes=e,e}}I([s()],M.prototype,"prismCodeHighlightParser",void 0),I([s()],M.prototype,"defaultCodeHighlightParser",void 0);class V{constructor(t){this.contentOffset=0,this.selectedText="",this.codeContainerRef=t}updateRange(t,e,n,o=""){const i=new V(this.codeContainerRef);return i.selectedText=o,i.contentOffset=i.getContentOffset(t,e,n),i}updateContentOffset(t){return this.contentOffset=Math.max(0,t),this.selectedText="",this.contentOffset}createNativeRange(t){const{nodeIndex:e,offset:n}=this.getFocusNodeState(t,this.contentOffset),o=new Range,i=this.codeContainerRef.querySelector(`span[data-index="${e}"]`);if(i){const t=Math.min(i.firstChild.textContent.length,n);return o.setStart(i.firstChild,t),o.setEnd(i.firstChild,t),o}}getContentOffset(t,e,n){let o=t.nodeType===Node.TEXT_NODE?t.parentElement:t;if("CODE"===o.nodeName&&o.childNodes&&o.childNodes.length&&(o=o.childNodes[Math.min(e,o.childNodes.length-1)],e=0),o&&o.hasAttribute("data-index")){const t=Number(o.dataset.index);let i="";for(let e=0;e<t;e++)i+=n[e].text;return i.length+e}return 0}getFocusNodeState(t,e){const n=this.getCodeContent(t),o={nodeIndex:0,offset:0};if(!n||e>=n.length)o.nodeIndex=t.length-1,o.offset=t[o.nodeIndex].text.length;else{let n="";for(let i=0;i<t.length;i++)if(n+=t[i].text,n.length>=e){o.offset=Math.max(0,t[i].text.length-(n.length-e)),o.nodeIndex=i;break}}return"\n"===t[o.nodeIndex].text&&o.offset>0&&t[o.nodeIndex+1]&&(o.nodeIndex+=1,o.offset=0),o}getCodeContent(t){return t.map((t=>t.text)).join("")}}var Z=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};class U extends L{constructor(){super(1),this.handleSelectionWithDebounce=A(this.handleSelectionChange,U.SELECTION_CHANGE_DEBOUNCE_TIME,this),this.doTask=async()=>{await Promise.resolve();const t=this.getSelection(),e=this.codeBlockRange.createNativeRange(this.contentParseController.getCurrentCodeNodes());t&&e&&(t.removeAllRanges(),t.addRange(e))}}getCurrentRange(){return this.codeBlockRange}setNextCodeBlockRange(t,e=!1){this.codeBlockRange.updateContentOffset(t),super.enqueueTheTaskIntoQueue(e)}addSelectionChangeEventListener(){this.codeBlockRange=new V(this.contentRenderer.getCodeContentContainerRef()),document.addEventListener("selectionchange",this.handleSelectionWithDebounce)}removeSelectionChangeEventListener(){document.removeEventListener("selectionchange",this.handleSelectionWithDebounce)}getSelection(){return S.getSelection(this.host.shadowRoot)}handleSelectionChange(){const t=this.getSelection();t&&t.rangeCount>0?(this.syncCodeRangeByNativeRange(),w.notify(b.getSubject(this.host,k),{detail:!0})):w.notify(b.getSubject(this.host,k),{detail:!1})}syncCodeRangeByNativeRange(){const t=this.getSelection();if(this.isCodeBlockActive()&&0===this.autoRunTaskQueue.queue.length&&!this.insertCompositionTextController.isComposing()){const e=t.getRangeAt(0),{startContainer:n,startOffset:o}=e;this.codeBlockRange=this.codeBlockRange.updateRange(n,o,this.contentParseController.getCurrentCodeNodes(),e.toString())}}isCodeBlockActive(){return this.host&&this.host.classList.contains("focus")}}U.SELECTION_CHANGE_DEBOUNCE_TIME=Math.min(F.SELECTION_CHANGE_DEBOUNCE_TIME,40),Z([s()],U.prototype,"host",void 0),Z([s()],U.prototype,"contentRenderer",void 0),Z([s()],U.prototype,"contentParseController",void 0),Z([s()],U.prototype,"insertCompositionTextController",void 0),Z([c("componentDidLoad")],U.prototype,"addSelectionChangeEventListener",null),Z([c("disconnectedCallback")],U.prototype,"removeSelectionChangeEventListener",null);class Y extends a{deleteSelectedText(t,e,n){return n>=t.length?"":t.slice(0,e)+t.slice(e+n)}getCodeNodesContent(t){return t.map((t=>t.text)).join("")}stopEventPropagation(t){t&&"function"==typeof t.stopPropagation&&t.stopPropagation()}reCalculateRangeAndContent(t,e,n){let o=t.contentOffset,i=e;return t&&(t.selectedText.length&&(i=this.deleteSelectedText(i,t.contentOffset,t.selectedText.length)),i=i.slice(0,t.contentOffset)+n+i.slice(t.contentOffset),o=t.contentOffset+n.length),{nextOffset:o,updatedContent:i}}}var G=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};class q extends Y{constructor(){super(...arguments),this.handleInputEvent=t=>{this.stopEventPropagation(t),this.updateCodeContent()},this.handleBeforeInput=t=>{switch(t.stopPropagation(),t.inputType){case"deleteContentBackward":return void(this.value&&this.value.code&&""!==this.value.code?this.handleDeleteAction(t):t.preventDefault());case"historyUndo":case"historyRedo":return void t.preventDefault()}this.updateCodeBlockRange(t)}}registerInputEvent(){const t=this.contentRenderer.getCodeContentContainerRef();t&&(t.addEventListener("beforeinput",this.handleBeforeInput),t.addEventListener("input",this.handleInputEvent))}unregisterEventListener(){const t=this.contentRenderer.getCodeContentContainerRef();t&&(t.removeEventListener("beforeinput",this.handleBeforeInput),t.removeEventListener("input",this.handleInputEvent))}handleDeleteAction(t){const e=this.selectionController.getCurrentRange();if(e){t.preventDefault();const n=e.contentOffset,o=this.contentParseController.getCurrentCodeNodes();let i=this.getCodeNodesContent(o),r=n;e.selectedText.length?i=this.deleteSelectedText(i,n,e.selectedText.length):n>0&&(i=i.slice(0,n-1)+i.slice(n),r-=1),this.selectionController.setNextCodeBlockRange(r),this.valueController.updateValue(i,this.value.language,{recordHistory:!0,offset:r})}}updateCodeBlockRange(t){const e=this.selectionController.getCurrentRange();!this.insertCompositionTextController.isComposing()&&e&&this.selectionController.setNextCodeBlockRange(e.contentOffset+this.getInsertDataLength(t))}getInsertDataLength(t){const{data:e,inputType:n}=t;switch(n){case"insertText":return e.length;case"insertParagraph":case"insertLineBreak":return 1;default:return 0}}updateCodeContent(){var t;if(!this.insertCompositionTextController.isComposing()){let e=this.contentRenderer.getCodeContentContainerRef().innerText;this.isInsertLineBreakInLowVersionFirefox(e)&&(e+="\n"),this.valueController.updateValue(e,null===(t=this.value)||void 0===t?void 0:t.language,{recordHistory:!0,offset:this.selectionController.getCurrentRange().contentOffset})}}isInsertLineBreakInLowVersionFirefox(t){var e;const n=(null===(e=this.value)||void 0===e?void 0:e.code)||"";return!n.endsWith("\n")&&t===n+"\n"}}G([s()],q.prototype,"selectionController",void 0),G([s()],q.prototype,"contentRenderer",void 0),G([s()],q.prototype,"valueController",void 0),G([s()],q.prototype,"contentParseController",void 0),G([s()],q.prototype,"insertCompositionTextController",void 0),G([s()],q.prototype,"value",void 0),G([c("componentDidLoad")],q.prototype,"registerInputEvent",null),G([c("disconnectedCallback")],q.prototype,"unregisterEventListener",null);var W=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};class X extends a{focusAndUpdateSelection(){if(!this.disabled&&!this.readOnly){const t=this.contentRenderer.getCodeContentContainerRef();t&&(t.focus(),this.selectionController.setNextCodeBlockRange(this.value&&this.value.code&&" "!==this.value.code?this.value.code.length:0,!0))}}removeFocusAfterDisabled(){(this.disabled||this.readOnly)&&this.host.classList.remove("focus")}}W([s()],X.prototype,"host",void 0),W([s()],X.prototype,"value",void 0),W([s()],X.prototype,"readOnly",void 0),W([s()],X.prototype,"disabled",void 0),W([s()],X.prototype,"contentRenderer",void 0),W([s()],X.prototype,"selectionController",void 0),W([c("doFocus")],X.prototype,"focusAndUpdateSelection",null),W([c("watchEditableChange")],X.prototype,"removeFocusAfterDisabled",null);var J=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};class K extends a{constructor(){super(...arguments),this.handleCopyClick=t=>{v.addUniqueObserverToNode(t,m,(async()=>{var e;const n=(null===(e=this.value)||void 0===e?void 0:e.code)||"";if(n&&globalThis.navigator&&globalThis.navigator.clipboard){clearTimeout(this.updateLabelTimer),await globalThis.navigator.clipboard.writeText(n);const e=t.label;t.label=this.translationSlimmer.t("Copied"),this.updateLabelTimer=setTimeout((()=>{t&&(t.label=e)}),K.RESET_TOOLTIP_TIME)}}))}}render(){if(this.showCopyButton&&this.readOnly)return t("vega-button-circle",{key:"copy-button",label:this.translationSlimmer.t("Copy Code"),class:"copy-code-button",icon:h.getIconKey("copy"),iconColor:"text-secondary",variant:"icon-only",size:"extra-small",ref:this.handleCopyClick})}}function Q(t,e){if(!t||!e)return[t];const n=[t];return function(t,e){const n=[],o=[];for(const t of Object.keys(e)){const i=e[t],r=Array.isArray(i)?i:[i];for(const e of r)e.greedy?n.push({tokenType:t,patternDef:e}):o.push({tokenType:t,patternDef:e})}n.length>0&&function(t,e){for(let n=0;n<t.length;n++){const o=t[n];if("string"!=typeof o)continue;const i=o;let r=i;const s=[];for(const{tokenType:t,patternDef:n}of e){const{pattern:e,lookbehind:o,inside:a}=n,c=new RegExp(e.source,e.flags.replace(/g/g,"")+"g");let l;for(;null!==(l=c.exec(r));){let e=l.index,n=l[0];if(0===n.length){c.lastIndex++;continue}if(-1!==n.indexOf("\0GREEDY_PLACEHOLDER\0"))continue;if(o&&l[1]){const t=l[1].length;e+=t,n=n.slice(t)}const d=e+n.length;s.push({tokenType:t,matchStart:e,matchEnd:d,matchText:i.slice(e,d),inside:a}),r=r.slice(0,e)+"\0GREEDY_PLACEHOLDER\0".repeat(n.length).slice(0,n.length)+r.slice(d)}}if(0===s.length)continue;s.sort(((t,e)=>t.matchStart-e.matchStart));const a=[];let c=0;for(const t of s){t.matchStart>c&&a.push(i.slice(c,t.matchStart));let e=t.matchText;if(t.inside){const n=Q(t.matchText,t.inside);e=1===n.length?n[0]:n}a.push({type:t.tokenType,content:e}),c=t.matchEnd}c<i.length&&a.push(i.slice(c)),t.splice(n,1,...a),n+=a.length-1}}(t,n);for(const{tokenType:e,patternDef:n}of o)tt(t,e,n)}(n,e),n}function tt(t,e,n){for(let o=0;o<t.length;o++){const i=t[o];if("string"!=typeof i)continue;const r=et(i,e,n);1===r.length&&"string"==typeof r[0]||(t.splice(o,1,...r),o+=r.length-1)}}function et(t,e,n){const{pattern:o,lookbehind:i,inside:r}=n,s=new RegExp(o.source,o.flags.replace(/g/g,"")+"g"),a=[];let c,l=0;for(;null!==(c=s.exec(t));){let n=c.index,o=c[0];if(0===o.length){s.lastIndex++;continue}if(i&&c[1]){const t=c[1].length;n+=t,o=o.slice(t)}n>l&&a.push(t.slice(l,n));let d=o;if(r){const t=Q(o,r);d=1===t.length?t[0]:t}a.push({type:e,content:d}),l=n+o.length}return l<t.length&&a.push(t.slice(l)),0===a.length?[t]:a}h.register({copy:{icon:'<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12"><g clip-path="url(#clip0_70002_574)"><path fill="currentColor" d="M11.7794 1.65539L10.3439 0.219844C10.2044 0.0790078 10.0122 0 9.81303 0H5.97865C5.15014 0 4.47865 0.671719 4.47865 1.5L4.47911 7.5C4.49975 8.32969 5.1724 9 5.99975 9H10.4997C11.3247 9 11.9997 8.325 11.9997 7.5V2.18555C11.9997 1.9868 11.9201 1.79602 11.7794 1.65539ZM10.8747 7.5C10.8747 7.70709 10.7068 7.875 10.4997 7.875H5.97865C5.77151 7.875 5.60365 7.70709 5.60365 7.5V1.50305C5.60365 1.29595 5.77156 1.12805 5.97865 1.12805H8.97865L8.99975 2.25C8.99975 2.66414 9.33561 3 9.74975 3H10.8537V7.5H10.8747ZM6.37475 10.5C6.37475 10.7071 6.20684 10.875 5.99975 10.875H1.47865C1.27151 10.875 1.10365 10.7071 1.10365 10.5L1.12428 4.50234C1.12428 4.29525 1.29218 4.12734 1.49928 4.12734H3.74975V3H1.49951C0.670996 3 -0.000488281 3.67148 -0.000488281 4.5L-0.000258594 10.5C-0.000207031 11.3273 0.671465 12 1.49975 12H5.99975C6.82475 12 7.49975 11.325 7.49975 10.5V9.75H6.39584L6.37475 10.5Z"/></g><defs><clipPath id="clip0_70002_574"><rect width="12" height="12" fill="currentColor"/></clipPath></defs></svg>'}}),K.RESET_TOOLTIP_TIME=1e3,J([s()],K.prototype,"value",void 0),J([s()],K.prototype,"readOnly",void 0),J([s()],K.prototype,"showCopyButton",void 0),J([s()],K.prototype,"translationSlimmer",void 0);const nt={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"']|"[^"]*"|'[^']*')+(?:>|$)/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0},punctuation:{pattern:/^<!|>$|[[\]]/},"doctype-tag":{pattern:/^DOCTYPE/i},name:{pattern:/[^\s<>'"/]+/},string:{pattern:/("|')[\s\S]*?\1/,greedy:!0}}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>/=$<%]+(?:\s(?:\s*[^\s>/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>/]+/,inside:{punctuation:{pattern:/^<\/?/},namespace:{pattern:/^[^\s>/:]+:/}}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:{pattern:/\/?>/},"attr-name":{pattern:/[^\s>/]+/,inside:{namespace:{pattern:/^[^\s>/:]+:/}}}}},entity:[{pattern:/&[\da-z]{1,8};/i},{pattern:/&#x?[\da-f]{1,8};/i}]},ot={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:[{pattern:/(["'])(?:\\[\s\S]|(?!\1)[^\\\r\n])*\1/,greedy:!0}],"template-string":{pattern:/`(?:\\[\s\S]|[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/},interpolation:{pattern:/\$\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})*\}/,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/}}},string:{pattern:/[\s\S]+/}}},regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[.\r\n,;:})\]]|\/\/))/,lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0},"regex-delimiter":{pattern:/^\/|\/$/},"regex-flags":{pattern:/^[a-z]+$/}}},"class-name":[{pattern:/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,lookbehind:!0,inside:{punctuation:{pattern:/[.\\]/}}}],keyword:[{pattern:/\b(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/}],boolean:{pattern:/\b(?:false|true)\b/},number:{pattern:/\b(?:(?:0[xX][\dA-Fa-f](?:_[\dA-Fa-f])*|0[bB][01](?:_[01])*|0[oO][0-7](?:_[0-7])*)n?|(?:\d(?:_\d)*\.?\d*|\.\d+)(?:[Ee][+-]?\d(?:_\d)*)?n?|NaN|Infinity)\b/},function:{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/},operator:{pattern:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%|&^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/},punctuation:{pattern:/[{}[\];(),.:]/},constant:{pattern:/\b[A-Z](?:[A-Z_]|\dx)*\b/}};const{function:it,punctuation:rt}=ot,st=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(t);i<o.length;i++)e.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(t,o[i])&&(n[o[i]]=t[o[i]])}return n}(ot,["keyword","function","operator","punctuation"]),at=Object.assign(Object.assign({},st),{"class-name":[{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:{punctuation:{pattern:/[<>.,]/}}}],builtin:{pattern:/\b(?:Array|Boolean|Date|Function|Map|Number|Object|Promise|RegExp|Set|String|WeakMap|WeakSet|bigint|boolean|never|null|number|string|symbol|undefined|unknown|void)\b/},keyword:[{pattern:/\b(?:abstract|as|asserts|async|await|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|infer|instanceof|interface|is|keyof|let|module|namespace|new|null|of|package|private|protected|public|readonly|return|require|set|static|super|switch|this|throw|try|type|typeof|undefined|var|void|while|with|yield)\b/}],function:it,"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:{pattern:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/},generic:{pattern:/<[\s\S]+/,inside:{punctuation:{pattern:/[<>(),.]/},keyword:{pattern:/\b(?:extends|infer|keyof)\b/},builtin:{pattern:/\b(?:boolean|never|null|number|string|symbol|undefined|unknown|void)\b/}}}}},operator:{pattern:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%|&^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]|!(?=\s*[^=])/},punctuation:rt}),ct=Object.assign(Object.assign({tag:{pattern:/<\/?(?:[\w.:-]+(?:\s+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])+\}))?|\{\.{3}[a-z_$][\w$]*(?:\.[\w$]+)*\}))*\s*\/?)?>/i,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>/]*/,inside:{punctuation:{pattern:/^<\/?/},namespace:{pattern:/^[^\s>/:]+:/}}},"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])+\})/,inside:{punctuation:[{pattern:/^=/},{pattern:/^(\s*)["'{]|[}"']$/,lookbehind:!0}],script:{pattern:/[\s\S]+/,inside:ot}}},spread:{pattern:/\{\.{3}[a-z_$][\w$]*(?:\.[\w$]+)*\}/,inside:{punctuation:{pattern:/^\{\.{3}|\}$/},"attr-name":{pattern:/[\s\S]+/}}},"attr-name":{pattern:/[^\s>/]+/,inside:{namespace:{pattern:/^[^\s>/:]+:/}}},punctuation:{pattern:/\/?>/}}}},ot),{entity:nt.entity}),lt={css:{comment:{pattern:/\/\*[\s\S]*?\*\//,greedy:!0},string:{pattern:/("|')(?:\\[\s\S]|(?!\1)[^\\\n\r])*\1/,greedy:!0},atrule:[{pattern:/@[\w-](?:[^;{\s]|\s+(?![\s{]))*(?:;|(?=\s*\{))/,inside:{rule:{pattern:/^@[\w-]+/},"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0},punctuation:{pattern:/[;:(){}]/}}}],url:{pattern:/\burl\((?:("|')(?:\\[\s\S]|(?!\1)[^\\\n\r])*\1|(?:[^\\\r\n()"']|\\[\s\S])*)\)/i,greedy:!0,inside:{function:{pattern:/^url/i},punctuation:{pattern:/^\(|\)$/},string:{pattern:/^("|')[\s\S]+(?=\1$)/,lookbehind:!0}}},selector:{pattern:/(?=\S)[^@;{}()]?(?:[^@;{}()\s]|\s+(?![\s{])|\((?:[^()]|\([^()]*\))*\))*(?=\s*\{)/,inside:{"pseudo-element":{pattern:/(?:::)[\w-]+/},"pseudo-class":{pattern:/(?::)[\w-]+/},class:{pattern:/\.[\w-]+/},id:{pattern:/#[\w-]+/},attribute:{pattern:/\[(?:[^[\]"']|("|')(?:\\[\s\S]|(?!\1)[^\\\n\r])*\1)*\]/,greedy:!0,inside:{punctuation:{pattern:/^\[|\]$/},"attr-name":{pattern:/^(\s*)(?:(?!\s)[-\w\u00B7\u00C0-\u024F])+/i,lookbehind:!0},"attr-value":[{pattern:/(=\s*)(?:"[^"]*"|'[^']*'|[^\s'"=]+)/,lookbehind:!0}],operator:{pattern:/[|~*^$]?=/}}}}},property:{pattern:/(?!\s)[-_a-z\u00B7\u00C0-\u024F][-\w\u00B7\u00C0-\u024F]*(?=\s*:)/i},important:{pattern:/!important\b/i},function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},number:{pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?/i,lookbehind:!0},unit:{pattern:/(\b\d+)(?:%|[a-z]+)/,lookbehind:!0},punctuation:{pattern:/[(){};:,]/},operator:{pattern:/[+\-*/=><~^|]+/}},html:nt,markup:nt,javascript:ot,js:ot,typescript:at,ts:at,jsx:ct,tsx:Object.assign(Object.assign({tag:ct.tag},at),{entity:ct.entity}),c:ot,clike:ot};const dt=Object.values(x);class pt extends a{splitTag(t){if(!this.hasSpecialCharacter(t)||t.length<2)return[t];{const e=[],n=t.split("");let o=0;return n.forEach((t=>{"<"===t||">"===t||"/"===t?(e.push(t),o=e.length):e[o]=e[o]?e[o]+t:t})),e}}isHighlightLanguage(t){return"plainText"!==t&&dt.includes(t)}markLineNumberNodes(t){0===t.length&&t.push({text:"\n",key:"0",className:""});let e=0;return t.map(((n,o)=>{let i=n.className;return 0!==o&&"\n"!==t[o-1].text||(e++,i=`v-code-line-number ${n.className}`),{text:n.text,key:`${o}`,className:i,mark:`${e}`}}))}hasSpecialCharacter(t){return/[<|>|\\/]/.test(t)}}!function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);r>3&&s&&Object.defineProperty(e,n,s)}([s()],pt.prototype,"value",void 0);class ut extends pt{canParse(){const{code:t,language:e}=this.value||{code:""};return t&&e&&this.isHighlightLanguage(e)}parse(){const{code:t,language:e}=this.value;let n=[];const o=Q(t,function(t){return lt[t]}(e));return n=this.getHighlightNodes(o),this.markLineNumberNodes(n)}getHighlightNodes(t,e){const n=[];for(const o of t)if("string"==typeof o){const t=o.split(/(\n|\t)/),i=t.length;for(let o=0;o<i;o++){const i=t[o];if(i){const t=this.splitTag(i);n.push(...t.map((t=>this.createCodeNode(t,e))))}}}else{const{content:t}=o;"string"==typeof t?n.push(...this.getHighlightNodes([t],o.type)):Array.isArray(t)&&n.push(...this.getHighlightNodes(t,o.type))}return n}createCodeNode(t,e){return{text:t,key:"",className:`token ${e||""}`,mark:""}}}class ht extends pt{canParse(){const{code:t,language:e}=this.value||{code:""};return!t||!e||"plainText"===e||!this.isHighlightLanguage(e)}parse(){var t,e;const n=(null!==(e=null===(t=this.value)||void 0===t?void 0:t.code)&&void 0!==e?e:"").split(/(\n)/);let o=[];return n.forEach((t=>{if(t){const e=this.splitTag(t);o.push(...e.map((t=>({text:t,key:"",className:""}))))}})),o=this.markLineNumberNodes(o),o}}var ft=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};class vt extends a{constructor(){super(...arguments),this.insertCompositionTextEndFlag=!0,this.handleCompositionStart=t=>{this.insertCompositionTextEndFlag=!1,this.stopEventPropagation(t)},this.handleCompositionEnd=t=>{var e;this.insertCompositionTextEndFlag=!0,this.stopEventPropagation(t);const n=this.selectionController.getCurrentRange();n&&this.selectionController.setNextCodeBlockRange(n.contentOffset+t.data.length);const o=this.contentRenderer.getCodeContentContainerRef().innerText;this.valueController.updateValue(o,null===(e=this.value)||void 0===e?void 0:e.language)}}isComposing(){return!this.insertCompositionTextEndFlag}registerInputEvent(){const t=this.contentRenderer.getCodeContentContainerRef();t&&(t.addEventListener("compositionstart",this.handleCompositionStart),t.addEventListener("compositionend",this.handleCompositionEnd))}unregisterEventListener(){const t=this.contentRenderer.getCodeContentContainerRef();t&&(t.removeEventListener("compositionstart",this.handleCompositionStart),t.removeEventListener("compositionend",this.handleCompositionEnd))}stopEventPropagation(t){t.stopPropagation()}}ft([s()],vt.prototype,"selectionController",void 0),ft([s()],vt.prototype,"contentRenderer",void 0),ft([s()],vt.prototype,"valueController",void 0),ft([s()],vt.prototype,"contentParseController",void 0),ft([s()],vt.prototype,"value",void 0),ft([c("componentDidLoad")],vt.prototype,"registerInputEvent",null),ft([c("disconnectedCallback")],vt.prototype,"unregisterEventListener",null);var bt=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};class gt extends ${constructor(){super(...arguments),this.getEffectiveTargets=()=>[this.contentRenderer.getCodeContentContainerRef()]}async undo(){if(this.undoStack.length>1){const t=this.undoStack.pop();this.redoStack.push(t);const e=this.undoStack[this.undoStack.length-1];e&&await this.restoreState(e)}}async redo(){const t=this.redoStack.pop();this.undoStack.push(t),await this.restoreState(t)}initialHistory(){this.registerHistory({value:this.value,offset:this.value.code.length},!0)}getIneffectiveTargets(){return[]}async restoreState(t){const{value:e,offset:n}=t;this.selectionController.setNextCodeBlockRange(n),this.valueController.updateValue(e.code,e.language)}}bt([s()],gt.prototype,"contentRenderer",void 0),bt([s()],gt.prototype,"value",void 0),bt([s()],gt.prototype,"valueController",void 0),bt([s()],gt.prototype,"selectionController",void 0),bt([c("componentDidLoad")],gt.prototype,"initialHistory",null);var mt=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};class yt extends Y{constructor(){super(...arguments),this.handlePasteEvent=t=>{var e,n;t.preventDefault(),this.stopEventPropagation(t);const o=t.clipboardData;if(null===(e=null==o?void 0:o.files)||void 0===e?void 0:e.length)return;const i=null!==(n=null==o?void 0:o.getData("text/plain"))&&void 0!==n?n:"";i&&this.updateCodeBlockRangeAndContent(i)}}registerInputEvent(){const t=this.contentRenderer.getCodeContentContainerRef();t&&t.addEventListener("paste",this.handlePasteEvent)}unregisterEventListener(){const t=this.contentRenderer.getCodeContentContainerRef();t&&t.removeEventListener("paste",this.handlePasteEvent)}updateCodeBlockRangeAndContent(t){const{nextOffset:e,updatedContent:n}=this.getLatestRangeAndContent(t);this.selectionController.setNextCodeBlockRange(e),this.valueController.updateValue(n,this.value.language,{recordHistory:!0,offset:this.selectionController.getCurrentRange().contentOffset})}getLatestRangeAndContent(t){const e=this.selectionController.getCurrentRange(),n=this.contentParseController.getCurrentCodeNodes(),o=this.getCodeNodesContent(n);return this.reCalculateRangeAndContent(e,o,t)}}mt([s()],yt.prototype,"host",void 0),mt([s()],yt.prototype,"valueController",void 0),mt([s()],yt.prototype,"contentRenderer",void 0),mt([s()],yt.prototype,"value",void 0),mt([s()],yt.prototype,"selectionController",void 0),mt([s()],yt.prototype,"contentParseController",void 0),mt([s()],yt.prototype,"inputController",void 0),mt([c("componentDidLoad")],yt.prototype,"registerInputEvent",null),mt([c("disconnectedCallback")],yt.prototype,"unregisterEventListener",null);var xt=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};const Ct=class{constructor(t){n(this,t),this.vegaChange=o(this,"vegaChange",7),this.change=o(this,"change",7),this.vegaRemove=o(this,"vegaRemove",7),this.remove=o(this,"remove",7),this.globalSlimmers={},this.componentGlobalStyleSlimmer=new D(":root{--code-orange:#cd3e00;--code-green:#007e7e;--code-purple:#6851f5;--code-gray:#67727e;--code-neutral:rgb(15, 36, 51);--code-neutral-8:rgba(15, 36, 51, 0.8);--code-neutral-7:rgba(15, 36, 51, 0.7)}.dark{--code-orange:#ff9571;--code-green:#73e6dc;--code-purple:#c7bdff;--code-gray:#8b959f;--code-neutral:rgb(252, 252, 252);--code-neutral-8:rgba(252, 252, 252, 0.8);--code-neutral-7:rgba(252, 252, 252, 0.7)}"),this.translationSlimmer=new E,this.vegaComponentUsageRuntimeMetricsSlimmer=new d,this.codeBlockRenderer=new P,this.contentRenderer=new _,this.copyButtonRenderer=new K,this.valueController=new B,this.contentParseController=new M,this.prismCodeHighlightParser=new ut,this.defaultCodeHighlightParser=new ht,this.selectionController=new U,this.inputController=new q,this.insertCompositionTextController=new vt,this.focusController=new X,this.historyController=new gt,this.changeEventEmitter=R(Ct,g),this.removeEventEmitter=R(Ct,y),this.codeBlockPasteController=new yt,this.eventPreventSlimmer=new T([g],(()=>this.codeBlockRenderer.getToolbarContainerRef())),this.readOnly=!1,this.disabled=!1,this.showCopyButton=!0,this.showLineNumber=!0}watchEditableChange(){}componentShouldUpdate(t,e,n){return"value"!==n||!O(t,e)}async doFocus(){}render(){const e=C([this.readOnly?"readonly":"",this.disabled?"disabled":"",this.showLineNumber?"show-line-number":"",this.prismCodeHighlightParser.canParse()?"highlight":""]);return u(t(i,{contenteditable:!1,class:e},this.codeBlockRenderer.render()),this.host)}get host(){return r(this)}static get watchers(){return{readOnly:["watchEditableChange"],disabled:["watchEditableChange"]}}};xt([p()],Ct.prototype,"globalSlimmers",void 0),xt([l()],Ct.prototype,"componentGlobalStyleSlimmer",void 0),xt([l()],Ct.prototype,"translationSlimmer",void 0),xt([l()],Ct.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),xt([l()],Ct.prototype,"codeBlockRenderer",void 0),xt([l()],Ct.prototype,"contentRenderer",void 0),xt([l()],Ct.prototype,"copyButtonRenderer",void 0),xt([l()],Ct.prototype,"valueController",void 0),xt([l()],Ct.prototype,"contentParseController",void 0),xt([l()],Ct.prototype,"prismCodeHighlightParser",void 0),xt([l()],Ct.prototype,"defaultCodeHighlightParser",void 0),xt([l()],Ct.prototype,"selectionController",void 0),xt([l()],Ct.prototype,"inputController",void 0),xt([l()],Ct.prototype,"insertCompositionTextController",void 0),xt([l()],Ct.prototype,"focusController",void 0),xt([l()],Ct.prototype,"historyController",void 0),xt([l()],Ct.prototype,"changeEventEmitter",void 0),xt([l()],Ct.prototype,"removeEventEmitter",void 0),xt([l()],Ct.prototype,"codeBlockPasteController",void 0),xt([l()],Ct.prototype,"eventPreventSlimmer",void 0),Ct.style=':host{display:block;border-radius:2px;background-color:rgba(var(--v-bg-secondary, 245, 247, 247, 1));padding-left:12px;padding-right:12px;padding-top:12px;padding-bottom:12px}:host code{display:block;box-sizing:border-box;color:rgba(var(--v-text-primary, 32, 54, 69, 1));text-align:left;font-family:"Roboto Mono";font-weight:400;line-height:22px;font-size:16px;white-space:pre-wrap;min-height:22px;tab-size:2px;word-break:break-word}:host code:focus-visible{outline:none}:host .editor-toolbar{display:flex;flex-direction:row;justify-content:space-between;align-items:center;padding-bottom:12px;border:1px solid rgba(var(--v-border-divider-secondary, 199, 217, 229, 1));border-top-width:0px;border-left-width:0px;border-right-width:0px;margin-bottom:12px;user-select:none}:host .editor-toolbar vega-input-select{width:auto;min-width:161px}:host(.show-line-number) code .v-code-line-number::before{content:attr(data-mark);width:var(--v-code-line-number-width);margin-left:var(--v-code-line-number-ml);padding-right:16px;text-align:right;user-select:none;font-style:normal;word-break:keep-all;color:rgba(var(--v-text-secondary, 107, 116, 125, 1));display:inline-block}:host(.show-line-number) code{padding-left:var(--v-code-block-pl)}:host::part(select-container){padding-top:0px;padding-bottom:0px;padding-left:8px;padding-right:8px;border-radius:4px}:host::part(selected-box),:host::part(placeholder){font-size:14px;user-select:none}:host::part(toggle-icon-container){width:12px;height:12px;line-height:12px}:host::part(toggle-icon){width:12px;height:12px}:host(.readonly) .copy-button-container{position:relative}:host(.readonly) .copy-button-container .copy-code-button{position:absolute;top:0px;right:0px}:host(.disabled:not(.highlight)) code{color:rgba(var(--v-text-input-disabled, 107, 116, 125, 1))}:host(.disabled.highlight){opacity:0.5}:host(.focus:not(.disabled,.readonly)){outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:2px}:host(.highlight) code{color:var(--code-neutral)}code .comment,code .prolog,code .doctype,code .cdata{color:var(--code-gray);font-style:italic}code .namespace{color:var(--code-neutral-7)}code .string,code .attr-value,code .builtin{color:var(--code-green)}code .punctuation,code .operator,code .attr-equals{color:var(--code-gray)}code .entity,code .url,code .symbol,code .number,code .boolean,code .variable,code .constant,code .property,code .regex,code .inserted{color:var(--code-neutral-8)}code .atrule,code .function,code .attr-name{color:var(--code-orange)}code .deleted{color:var(--code-neutral)}code .function-variable{color:#ff0000}code .tag,code .selector,code .keyword{color:var(--code-purple)}';export{Ct as vega_code_block}
|
|
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-4415ad28.js";import{s as u}from"./p-519a7d55.js";import{V as h}from"./p-e1fbfd20.js";import{t as f}from"./p-aacf6920.js";import{D as v,d as b}from"./p-f28a6074.js";import{i as g,a as m,o as y}from"./p-9af0e2e7.js";import{ab as x}from"./p-84eb3b9c.js";import{a as C}from"./p-6e70d3cc.js";import{C as w}from"./p-2d0d575f.js";import{y as j,x as k}from"./p-6c43d54a.js";import{c as R}from"./p-6b5cb920.js";import{d as O}from"./p-a841cf13.js";import{T as E}from"./p-57f220b5.js";import{S,a as F,C as $}from"./p-33234385.js";import{A as L}from"./p-4d65756f.js";import{d as A}from"./p-1bc5b3bc.js";import{C as T}from"./p-e27626f6.js";import{C as D}from"./p-2bb5a232.js";import"./p-e6adf829.js";import"./p-593e0f80.js";import"./p-6a334573.js";import"./p-8b5d3a52.js";import"./p-331a62d5.js";import"./p-02841589.js";import"./p-e4c4ea35.js";import"./p-ed45b3b6.js";import"./p-d4ea8e22.js";import"./p-d884c644.js";import"./p-3b791b5d.js";import"./p-a528714c.js";import"./p-8aee6b74.js";import"./p-fb5ea4b2.js";import"./p-4866e390.js";import"./p-b75ee3ba.js";import"./p-f0e828d8.js";import"./p-f1c672e4.js";import"./p-e1709e59.js";import"./p-a87cb7ac.js";import"./p-4cefd7fe.js";import"./p-1fb56e14.js";import"./p-5f377954.js";import"./p-18e8d9b7.js";import"./p-5a25014f.js";var H=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};class P extends a{constructor(){super(...arguments),this.languageDropdownProps={searchable:!1},this.languageOptions=Object.keys(x).map((t=>({id:x[t],displayName:t}))),this.handleLanguageChange=t=>{v.addUniqueObserverToNode(t,g,(t=>{var e;this.valueController.updateValue(null===(e=this.value)||void 0===e?void 0:e.code,t.detail)}))},this.handleDeleteClick=t=>{v.addUniqueObserverToNode(t,m,(()=>{this.removeEventEmitter.emit().defaultPrevented||this.host.remove()}))}}getToolbarContainerRef(){return this.toolbarContainerRef}render(){return t(e,null,t("div",{part:"editor-toolbar",contenteditable:!1,class:{"editor-toolbar":!this.readOnly,"copy-button-container":this.showCopyButton&&this.readOnly},ref:t=>this.toolbarContainerRef=t},this.renderEditorToolbar(),this.copyButtonRenderer.render()),this.contentRenderer.render())}renderEditorToolbar(){var n,o;if(!this.readOnly)return t(e,null,t("vega-input-select",{source:this.languageOptions,value:null!==(o=null===(n=this.value)||void 0===n?void 0:n.language)&&void 0!==o?o:"",disabled:this.disabled,placeholder:this.translationSlimmer.t("Select Language"),size:"small",vegaDropdownProps:this.languageDropdownProps,exportparts:"select-container, selected-box, placeholder, toggle-icon-container, toggle-icon",ref:this.handleLanguageChange}),t("vega-button-circle",{key:"delete-button",disabled:this.disabled,label:this.translationSlimmer.t("Delete Code"),icon:h.getIconKey("trash-can"),iconColor:"text-secondary",variant:"icon-only",size:"extra-small",ref:this.handleDeleteClick}))}}h.register({"trash-can":f}),H([s()],P.prototype,"readOnly",void 0),H([s()],P.prototype,"host",void 0),H([s()],P.prototype,"disabled",void 0),H([s()],P.prototype,"showCopyButton",void 0),H([s()],P.prototype,"value",void 0),H([s()],P.prototype,"contentRenderer",void 0),H([s()],P.prototype,"valueController",void 0),H([s()],P.prototype,"removeEventEmitter",void 0),H([s()],P.prototype,"translationSlimmer",void 0),H([s()],P.prototype,"copyButtonRenderer",void 0);var N=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};class _ extends a{constructor(){super(...arguments),this.handleFocus=()=>{this.readOnly||this.disabled||this.host.classList.add("focus")},this.handleBlur=()=>{this.host.classList.remove("focus"),w.notify(b.getSubject(this.host,j),null)}}getCodeContentContainerRef(){return this.codeContentContainerRef}registerEventListener(){this.codeContentContainerRef&&(this.codeContentContainerRef.addEventListener("focusin",this.handleFocus),this.codeContentContainerRef.addEventListener("focusout",this.handleBlur))}unregisterEventListener(){this.codeContentContainerRef&&(this.codeContentContainerRef.removeEventListener("focusin",this.handleFocus),this.codeContentContainerRef.removeEventListener("focusout",this.handleBlur))}render(){var n;const o=this.contentParseController.parseCode(),i=(null===(n=this.value)||void 0===n?void 0:n.language)||"";return t(e,null,t("style",null,this.getLineNumberStyleVariable(o)),t("code",{role:"textbox",tabIndex:0,spellcheck:!1,ref:t=>this.codeContentContainerRef=t,contenteditable:!this.readOnly&&!this.disabled,"data-language":i,innerHTML:o.map((t=>this.renderCodeNode(t))).join("")}))}renderCodeNode(t){const{key:e,className:n,mark:o,text:i}=t;return`<span key='${e}' class='${n}' data-mark='${o}' data-index='${e}'>${i}</span>`}getLineNumberStyleVariable(t){const e=10*(t.filter((t=>"\n"===t.text)).length+1).toString().length;return`code{--v-code-line-number-width:${e}px;--v-code-line-number-ml:-${e+16}px;--v-code-block-pl:${e+16}px}`}}N([s()],_.prototype,"host",void 0),N([s()],_.prototype,"readOnly",void 0),N([s()],_.prototype,"disabled",void 0),N([s()],_.prototype,"value",void 0),N([s()],_.prototype,"contentParseController",void 0),N([c("componentDidLoad")],_.prototype,"registerEventListener",null),N([c("disconnectedCallback")],_.prototype,"unregisterEventListener",null);var z=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};class B extends a{updateValue(t,e,n){this.value&&this.value.code===t&&this.value.language===e||(this.value={language:e,code:t},this.changeEventEmitter.emit(this.value),n&&n.recordHistory&&this.historyController.registerHistory({value:this.value,offset:n.offset}))}initialValue(){this.value||(this.value={code:"",language:"plainText"})}}z([s({writable:!0})],B.prototype,"value",void 0),z([s()],B.prototype,"changeEventEmitter",void 0),z([s()],B.prototype,"historyController",void 0),z([c("connectedCallback")],B.prototype,"initialValue",null);var I=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};class M extends a{constructor(){super(...arguments),this.codeNodes=[]}getCurrentCodeNodes(){return this.codeNodes}parseCode(){const t=[this.prismCodeHighlightParser,this.defaultCodeHighlightParser];let e=[];for(const n of t)if(n.canParse()){e=n.parse();break}return this.codeNodes=e,e}}I([s()],M.prototype,"prismCodeHighlightParser",void 0),I([s()],M.prototype,"defaultCodeHighlightParser",void 0);class V{constructor(t){this.contentOffset=0,this.selectedText="",this.codeContainerRef=t}updateRange(t,e,n,o=""){const i=new V(this.codeContainerRef);return i.selectedText=o,i.contentOffset=i.getContentOffset(t,e,n),i}updateContentOffset(t){return this.contentOffset=Math.max(0,t),this.selectedText="",this.contentOffset}createNativeRange(t){const{nodeIndex:e,offset:n}=this.getFocusNodeState(t,this.contentOffset),o=new Range,i=this.codeContainerRef.querySelector(`span[data-index="${e}"]`);if(i){const t=Math.min(i.firstChild.textContent.length,n);return o.setStart(i.firstChild,t),o.setEnd(i.firstChild,t),o}}getContentOffset(t,e,n){let o=t.nodeType===Node.TEXT_NODE?t.parentElement:t;if("CODE"===o.nodeName&&o.childNodes&&o.childNodes.length&&(o=o.childNodes[Math.min(e,o.childNodes.length-1)],e=0),o&&o.hasAttribute("data-index")){const t=Number(o.dataset.index);let i="";for(let e=0;e<t;e++)i+=n[e].text;return i.length+e}return 0}getFocusNodeState(t,e){const n=this.getCodeContent(t),o={nodeIndex:0,offset:0};if(!n||e>=n.length)o.nodeIndex=t.length-1,o.offset=t[o.nodeIndex].text.length;else{let n="";for(let i=0;i<t.length;i++)if(n+=t[i].text,n.length>=e){o.offset=Math.max(0,t[i].text.length-(n.length-e)),o.nodeIndex=i;break}}return"\n"===t[o.nodeIndex].text&&o.offset>0&&t[o.nodeIndex+1]&&(o.nodeIndex+=1,o.offset=0),o}getCodeContent(t){return t.map((t=>t.text)).join("")}}var Z=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};class U extends L{constructor(){super(1),this.handleSelectionWithDebounce=A(this.handleSelectionChange,U.SELECTION_CHANGE_DEBOUNCE_TIME,this),this.doTask=async()=>{await Promise.resolve();const t=this.getSelection(),e=this.codeBlockRange.createNativeRange(this.contentParseController.getCurrentCodeNodes());t&&e&&(t.removeAllRanges(),t.addRange(e))}}getCurrentRange(){return this.codeBlockRange}setNextCodeBlockRange(t,e=!1){this.codeBlockRange.updateContentOffset(t),super.enqueueTheTaskIntoQueue(e)}addSelectionChangeEventListener(){this.codeBlockRange=new V(this.contentRenderer.getCodeContentContainerRef()),document.addEventListener("selectionchange",this.handleSelectionWithDebounce)}removeSelectionChangeEventListener(){document.removeEventListener("selectionchange",this.handleSelectionWithDebounce)}getSelection(){return S.getSelection(this.host.shadowRoot)}handleSelectionChange(){const t=this.getSelection();t&&t.rangeCount>0?(this.syncCodeRangeByNativeRange(),w.notify(b.getSubject(this.host,k),{detail:!0})):w.notify(b.getSubject(this.host,k),{detail:!1})}syncCodeRangeByNativeRange(){const t=this.getSelection();if(this.isCodeBlockActive()&&0===this.autoRunTaskQueue.queue.length&&!this.insertCompositionTextController.isComposing()){const e=t.getRangeAt(0),{startContainer:n,startOffset:o}=e;this.codeBlockRange=this.codeBlockRange.updateRange(n,o,this.contentParseController.getCurrentCodeNodes(),e.toString())}}isCodeBlockActive(){return this.host&&this.host.classList.contains("focus")}}U.SELECTION_CHANGE_DEBOUNCE_TIME=Math.min(F.SELECTION_CHANGE_DEBOUNCE_TIME,40),Z([s()],U.prototype,"host",void 0),Z([s()],U.prototype,"contentRenderer",void 0),Z([s()],U.prototype,"contentParseController",void 0),Z([s()],U.prototype,"insertCompositionTextController",void 0),Z([c("componentDidLoad")],U.prototype,"addSelectionChangeEventListener",null),Z([c("disconnectedCallback")],U.prototype,"removeSelectionChangeEventListener",null);class Y extends a{deleteSelectedText(t,e,n){return n>=t.length?"":t.slice(0,e)+t.slice(e+n)}getCodeNodesContent(t){return t.map((t=>t.text)).join("")}stopEventPropagation(t){t&&"function"==typeof t.stopPropagation&&t.stopPropagation()}reCalculateRangeAndContent(t,e,n){let o=t.contentOffset,i=e;return t&&(t.selectedText.length&&(i=this.deleteSelectedText(i,t.contentOffset,t.selectedText.length)),i=i.slice(0,t.contentOffset)+n+i.slice(t.contentOffset),o=t.contentOffset+n.length),{nextOffset:o,updatedContent:i}}}var G=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};class q extends Y{constructor(){super(...arguments),this.handleInputEvent=t=>{this.stopEventPropagation(t),this.updateCodeContent()},this.handleBeforeInput=t=>{switch(t.stopPropagation(),t.inputType){case"deleteContentBackward":return void(this.value&&this.value.code&&""!==this.value.code?this.handleDeleteAction(t):t.preventDefault());case"historyUndo":case"historyRedo":return void t.preventDefault()}this.updateCodeBlockRange(t)}}registerInputEvent(){const t=this.contentRenderer.getCodeContentContainerRef();t&&(t.addEventListener("beforeinput",this.handleBeforeInput),t.addEventListener("input",this.handleInputEvent))}unregisterEventListener(){const t=this.contentRenderer.getCodeContentContainerRef();t&&(t.removeEventListener("beforeinput",this.handleBeforeInput),t.removeEventListener("input",this.handleInputEvent))}handleDeleteAction(t){const e=this.selectionController.getCurrentRange();if(e){t.preventDefault();const n=e.contentOffset,o=this.contentParseController.getCurrentCodeNodes();let i=this.getCodeNodesContent(o),r=n;e.selectedText.length?i=this.deleteSelectedText(i,n,e.selectedText.length):n>0&&(i=i.slice(0,n-1)+i.slice(n),r-=1),this.selectionController.setNextCodeBlockRange(r),this.valueController.updateValue(i,this.value.language,{recordHistory:!0,offset:r})}}updateCodeBlockRange(t){const e=this.selectionController.getCurrentRange();!this.insertCompositionTextController.isComposing()&&e&&this.selectionController.setNextCodeBlockRange(e.contentOffset+this.getInsertDataLength(t))}getInsertDataLength(t){const{data:e,inputType:n}=t;switch(n){case"insertText":return e.length;case"insertParagraph":case"insertLineBreak":return 1;default:return 0}}updateCodeContent(){var t;if(!this.insertCompositionTextController.isComposing()){let e=this.contentRenderer.getCodeContentContainerRef().innerText;this.isInsertLineBreakInLowVersionFirefox(e)&&(e+="\n"),this.valueController.updateValue(e,null===(t=this.value)||void 0===t?void 0:t.language,{recordHistory:!0,offset:this.selectionController.getCurrentRange().contentOffset})}}isInsertLineBreakInLowVersionFirefox(t){var e;const n=(null===(e=this.value)||void 0===e?void 0:e.code)||"";return!n.endsWith("\n")&&t===n+"\n"}}G([s()],q.prototype,"selectionController",void 0),G([s()],q.prototype,"contentRenderer",void 0),G([s()],q.prototype,"valueController",void 0),G([s()],q.prototype,"contentParseController",void 0),G([s()],q.prototype,"insertCompositionTextController",void 0),G([s()],q.prototype,"value",void 0),G([c("componentDidLoad")],q.prototype,"registerInputEvent",null),G([c("disconnectedCallback")],q.prototype,"unregisterEventListener",null);var W=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};class X extends a{focusAndUpdateSelection(){if(!this.disabled&&!this.readOnly){const t=this.contentRenderer.getCodeContentContainerRef();t&&(t.focus(),this.selectionController.setNextCodeBlockRange(this.value&&this.value.code&&" "!==this.value.code?this.value.code.length:0,!0))}}removeFocusAfterDisabled(){(this.disabled||this.readOnly)&&this.host.classList.remove("focus")}}W([s()],X.prototype,"host",void 0),W([s()],X.prototype,"value",void 0),W([s()],X.prototype,"readOnly",void 0),W([s()],X.prototype,"disabled",void 0),W([s()],X.prototype,"contentRenderer",void 0),W([s()],X.prototype,"selectionController",void 0),W([c("doFocus")],X.prototype,"focusAndUpdateSelection",null),W([c("watchEditableChange")],X.prototype,"removeFocusAfterDisabled",null);var J=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};class K extends a{constructor(){super(...arguments),this.handleCopyClick=t=>{v.addUniqueObserverToNode(t,m,(async()=>{var e;const n=(null===(e=this.value)||void 0===e?void 0:e.code)||"";if(n&&globalThis.navigator&&globalThis.navigator.clipboard){clearTimeout(this.updateLabelTimer),await globalThis.navigator.clipboard.writeText(n);const e=t.label;t.label=this.translationSlimmer.t("Copied"),this.updateLabelTimer=setTimeout((()=>{t&&(t.label=e)}),K.RESET_TOOLTIP_TIME)}}))}}render(){if(this.showCopyButton&&this.readOnly)return t("vega-button-circle",{key:"copy-button",label:this.translationSlimmer.t("Copy Code"),class:"copy-code-button",icon:h.getIconKey("copy"),iconColor:"text-secondary",variant:"icon-only",size:"extra-small",ref:this.handleCopyClick})}}function Q(t,e){if(!t||!e)return[t];const n=[t];return function(t,e){const n=[],o=[];for(const t of Object.keys(e)){const i=e[t],r=Array.isArray(i)?i:[i];for(const e of r)e.greedy?n.push({tokenType:t,patternDef:e}):o.push({tokenType:t,patternDef:e})}n.length>0&&function(t,e){for(let n=0;n<t.length;n++){const o=t[n];if("string"!=typeof o)continue;const i=o;let r=i;const s=[];for(const{tokenType:t,patternDef:n}of e){const{pattern:e,lookbehind:o,inside:a}=n,c=new RegExp(e.source,e.flags.replace(/g/g,"")+"g");let l;for(;null!==(l=c.exec(r));){let e=l.index,n=l[0];if(0===n.length){c.lastIndex++;continue}if(-1!==n.indexOf("\0GREEDY_PLACEHOLDER\0"))continue;if(o&&l[1]){const t=l[1].length;e+=t,n=n.slice(t)}const d=e+n.length;s.push({tokenType:t,matchStart:e,matchEnd:d,matchText:i.slice(e,d),inside:a}),r=r.slice(0,e)+"\0GREEDY_PLACEHOLDER\0".repeat(n.length).slice(0,n.length)+r.slice(d)}}if(0===s.length)continue;s.sort(((t,e)=>t.matchStart-e.matchStart));const a=[];let c=0;for(const t of s){t.matchStart>c&&a.push(i.slice(c,t.matchStart));let e=t.matchText;if(t.inside){const n=Q(t.matchText,t.inside);e=1===n.length?n[0]:n}a.push({type:t.tokenType,content:e}),c=t.matchEnd}c<i.length&&a.push(i.slice(c)),t.splice(n,1,...a),n+=a.length-1}}(t,n);for(const{tokenType:e,patternDef:n}of o)tt(t,e,n)}(n,e),n}function tt(t,e,n){for(let o=0;o<t.length;o++){const i=t[o];if("string"!=typeof i)continue;const r=et(i,e,n);1===r.length&&"string"==typeof r[0]||(t.splice(o,1,...r),o+=r.length-1)}}function et(t,e,n){const{pattern:o,lookbehind:i,inside:r}=n,s=new RegExp(o.source,o.flags.replace(/g/g,"")+"g"),a=[];let c,l=0;for(;null!==(c=s.exec(t));){let n=c.index,o=c[0];if(0===o.length){s.lastIndex++;continue}if(i&&c[1]){const t=c[1].length;n+=t,o=o.slice(t)}n>l&&a.push(t.slice(l,n));let d=o;if(r){const t=Q(o,r);d=1===t.length?t[0]:t}a.push({type:e,content:d}),l=n+o.length}return l<t.length&&a.push(t.slice(l)),0===a.length?[t]:a}h.register({copy:{icon:'<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12"><g clip-path="url(#clip0_70002_574)"><path fill="currentColor" d="M11.7794 1.65539L10.3439 0.219844C10.2044 0.0790078 10.0122 0 9.81303 0H5.97865C5.15014 0 4.47865 0.671719 4.47865 1.5L4.47911 7.5C4.49975 8.32969 5.1724 9 5.99975 9H10.4997C11.3247 9 11.9997 8.325 11.9997 7.5V2.18555C11.9997 1.9868 11.9201 1.79602 11.7794 1.65539ZM10.8747 7.5C10.8747 7.70709 10.7068 7.875 10.4997 7.875H5.97865C5.77151 7.875 5.60365 7.70709 5.60365 7.5V1.50305C5.60365 1.29595 5.77156 1.12805 5.97865 1.12805H8.97865L8.99975 2.25C8.99975 2.66414 9.33561 3 9.74975 3H10.8537V7.5H10.8747ZM6.37475 10.5C6.37475 10.7071 6.20684 10.875 5.99975 10.875H1.47865C1.27151 10.875 1.10365 10.7071 1.10365 10.5L1.12428 4.50234C1.12428 4.29525 1.29218 4.12734 1.49928 4.12734H3.74975V3H1.49951C0.670996 3 -0.000488281 3.67148 -0.000488281 4.5L-0.000258594 10.5C-0.000207031 11.3273 0.671465 12 1.49975 12H5.99975C6.82475 12 7.49975 11.325 7.49975 10.5V9.75H6.39584L6.37475 10.5Z"/></g><defs><clipPath id="clip0_70002_574"><rect width="12" height="12" fill="currentColor"/></clipPath></defs></svg>'}}),K.RESET_TOOLTIP_TIME=1e3,J([s()],K.prototype,"value",void 0),J([s()],K.prototype,"readOnly",void 0),J([s()],K.prototype,"showCopyButton",void 0),J([s()],K.prototype,"translationSlimmer",void 0);const nt={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"']|"[^"]*"|'[^']*')+(?:>|$)/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0},punctuation:{pattern:/^<!|>$|[[\]]/},"doctype-tag":{pattern:/^DOCTYPE/i},name:{pattern:/[^\s<>'"/]+/},string:{pattern:/("|')[\s\S]*?\1/,greedy:!0}}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>/=$<%]+(?:\s(?:\s*[^\s>/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>/]+/,inside:{punctuation:{pattern:/^<\/?/},namespace:{pattern:/^[^\s>/:]+:/}}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:{pattern:/\/?>/},"attr-name":{pattern:/[^\s>/]+/,inside:{namespace:{pattern:/^[^\s>/:]+:/}}}}},entity:[{pattern:/&[\da-z]{1,8};/i},{pattern:/&#x?[\da-f]{1,8};/i}]},ot={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:[{pattern:/(["'])(?:\\[\s\S]|(?!\1)[^\\\r\n])*\1/,greedy:!0}],"template-string":{pattern:/`(?:\\[\s\S]|[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/},interpolation:{pattern:/\$\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})*\}/,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/}}},string:{pattern:/[\s\S]+/}}},regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[.\r\n,;:})\]]|\/\/))/,lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0},"regex-delimiter":{pattern:/^\/|\/$/},"regex-flags":{pattern:/^[a-z]+$/}}},"class-name":[{pattern:/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,lookbehind:!0,inside:{punctuation:{pattern:/[.\\]/}}}],keyword:[{pattern:/\b(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/}],boolean:{pattern:/\b(?:false|true)\b/},number:{pattern:/\b(?:(?:0[xX][\dA-Fa-f](?:_[\dA-Fa-f])*|0[bB][01](?:_[01])*|0[oO][0-7](?:_[0-7])*)n?|(?:\d(?:_\d)*\.?\d*|\.\d+)(?:[Ee][+-]?\d(?:_\d)*)?n?|NaN|Infinity)\b/},function:{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/},operator:{pattern:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%|&^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/},punctuation:{pattern:/[{}[\];(),.:]/},constant:{pattern:/\b[A-Z](?:[A-Z_]|\dx)*\b/}};const{function:it,punctuation:rt}=ot,st=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(t);i<o.length;i++)e.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(t,o[i])&&(n[o[i]]=t[o[i]])}return n}(ot,["keyword","function","operator","punctuation"]),at=Object.assign(Object.assign({},st),{"class-name":[{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:{punctuation:{pattern:/[<>.,]/}}}],builtin:{pattern:/\b(?:Array|Boolean|Date|Function|Map|Number|Object|Promise|RegExp|Set|String|WeakMap|WeakSet|bigint|boolean|never|null|number|string|symbol|undefined|unknown|void)\b/},keyword:[{pattern:/\b(?:abstract|as|asserts|async|await|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|infer|instanceof|interface|is|keyof|let|module|namespace|new|null|of|package|private|protected|public|readonly|return|require|set|static|super|switch|this|throw|try|type|typeof|undefined|var|void|while|with|yield)\b/}],function:it,"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:{pattern:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/},generic:{pattern:/<[\s\S]+/,inside:{punctuation:{pattern:/[<>(),.]/},keyword:{pattern:/\b(?:extends|infer|keyof)\b/},builtin:{pattern:/\b(?:boolean|never|null|number|string|symbol|undefined|unknown|void)\b/}}}}},operator:{pattern:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%|&^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]|!(?=\s*[^=])/},punctuation:rt}),ct=Object.assign(Object.assign({tag:{pattern:/<\/?(?:[\w.:-]+(?:\s+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])+\}))?|\{\.{3}[a-z_$][\w$]*(?:\.[\w$]+)*\}))*\s*\/?)?>/i,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>/]*/,inside:{punctuation:{pattern:/^<\/?/},namespace:{pattern:/^[^\s>/:]+:/}}},"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])+\})/,inside:{punctuation:[{pattern:/^=/},{pattern:/^(\s*)["'{]|[}"']$/,lookbehind:!0}],script:{pattern:/[\s\S]+/,inside:ot}}},spread:{pattern:/\{\.{3}[a-z_$][\w$]*(?:\.[\w$]+)*\}/,inside:{punctuation:{pattern:/^\{\.{3}|\}$/},"attr-name":{pattern:/[\s\S]+/}}},"attr-name":{pattern:/[^\s>/]+/,inside:{namespace:{pattern:/^[^\s>/:]+:/}}},punctuation:{pattern:/\/?>/}}}},ot),{entity:nt.entity}),lt={css:{comment:{pattern:/\/\*[\s\S]*?\*\//,greedy:!0},string:{pattern:/("|')(?:\\[\s\S]|(?!\1)[^\\\n\r])*\1/,greedy:!0},atrule:[{pattern:/@[\w-](?:[^;{\s]|\s+(?![\s{]))*(?:;|(?=\s*\{))/,inside:{rule:{pattern:/^@[\w-]+/},"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0},punctuation:{pattern:/[;:(){}]/}}}],url:{pattern:/\burl\((?:("|')(?:\\[\s\S]|(?!\1)[^\\\n\r])*\1|(?:[^\\\r\n()"']|\\[\s\S])*)\)/i,greedy:!0,inside:{function:{pattern:/^url/i},punctuation:{pattern:/^\(|\)$/},string:{pattern:/^("|')[\s\S]+(?=\1$)/,lookbehind:!0}}},selector:{pattern:/(?=\S)[^@;{}()]?(?:[^@;{}()\s]|\s+(?![\s{])|\((?:[^()]|\([^()]*\))*\))*(?=\s*\{)/,inside:{"pseudo-element":{pattern:/(?:::)[\w-]+/},"pseudo-class":{pattern:/(?::)[\w-]+/},class:{pattern:/\.[\w-]+/},id:{pattern:/#[\w-]+/},attribute:{pattern:/\[(?:[^[\]"']|("|')(?:\\[\s\S]|(?!\1)[^\\\n\r])*\1)*\]/,greedy:!0,inside:{punctuation:{pattern:/^\[|\]$/},"attr-name":{pattern:/^(\s*)(?:(?!\s)[-\w\u00B7\u00C0-\u024F])+/i,lookbehind:!0},"attr-value":[{pattern:/(=\s*)(?:"[^"]*"|'[^']*'|[^\s'"=]+)/,lookbehind:!0}],operator:{pattern:/[|~*^$]?=/}}}}},property:{pattern:/(?!\s)[-_a-z\u00B7\u00C0-\u024F][-\w\u00B7\u00C0-\u024F]*(?=\s*:)/i},important:{pattern:/!important\b/i},function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},number:{pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?/i,lookbehind:!0},unit:{pattern:/(\b\d+)(?:%|[a-z]+)/,lookbehind:!0},punctuation:{pattern:/[(){};:,]/},operator:{pattern:/[+\-*/=><~^|]+/}},html:nt,markup:nt,javascript:ot,js:ot,typescript:at,ts:at,jsx:ct,tsx:Object.assign(Object.assign({tag:ct.tag},at),{entity:ct.entity}),c:ot,clike:ot};const dt=Object.values(x);class pt extends a{splitTag(t){if(!this.hasSpecialCharacter(t)||t.length<2)return[t];{const e=[],n=t.split("");let o=0;return n.forEach((t=>{"<"===t||">"===t||"/"===t?(e.push(t),o=e.length):e[o]=e[o]?e[o]+t:t})),e}}isHighlightLanguage(t){return"plainText"!==t&&dt.includes(t)}markLineNumberNodes(t){0===t.length&&t.push({text:"\n",key:"0",className:""});let e=0;return t.map(((n,o)=>{let i=n.className;return 0!==o&&"\n"!==t[o-1].text||(e++,i=`v-code-line-number ${n.className}`),{text:n.text,key:`${o}`,className:i,mark:`${e}`}}))}hasSpecialCharacter(t){return/[<|>|\\/]/.test(t)}}!function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);r>3&&s&&Object.defineProperty(e,n,s)}([s()],pt.prototype,"value",void 0);class ut extends pt{canParse(){const{code:t,language:e}=this.value||{code:""};return t&&e&&this.isHighlightLanguage(e)}parse(){const{code:t,language:e}=this.value;let n=[];const o=Q(t,function(t){return lt[t]}(e));return n=this.getHighlightNodes(o),this.markLineNumberNodes(n)}getHighlightNodes(t,e){const n=[];for(const o of t)if("string"==typeof o){const t=o.split(/(\n|\t)/),i=t.length;for(let o=0;o<i;o++){const i=t[o];if(i){const t=this.splitTag(i);n.push(...t.map((t=>this.createCodeNode(t,e))))}}}else{const{content:t}=o;"string"==typeof t?n.push(...this.getHighlightNodes([t],o.type)):Array.isArray(t)&&n.push(...this.getHighlightNodes(t,o.type))}return n}createCodeNode(t,e){return{text:t,key:"",className:`token ${e||""}`,mark:""}}}class ht extends pt{canParse(){const{code:t,language:e}=this.value||{code:""};return!t||!e||"plainText"===e||!this.isHighlightLanguage(e)}parse(){var t,e;const n=(null!==(e=null===(t=this.value)||void 0===t?void 0:t.code)&&void 0!==e?e:"").split(/(\n)/);let o=[];return n.forEach((t=>{if(t){const e=this.splitTag(t);o.push(...e.map((t=>({text:t,key:"",className:""}))))}})),o=this.markLineNumberNodes(o),o}}var ft=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};class vt extends a{constructor(){super(...arguments),this.insertCompositionTextEndFlag=!0,this.handleCompositionStart=t=>{this.insertCompositionTextEndFlag=!1,this.stopEventPropagation(t)},this.handleCompositionEnd=t=>{var e;this.insertCompositionTextEndFlag=!0,this.stopEventPropagation(t);const n=this.selectionController.getCurrentRange();n&&this.selectionController.setNextCodeBlockRange(n.contentOffset+t.data.length);const o=this.contentRenderer.getCodeContentContainerRef().innerText;this.valueController.updateValue(o,null===(e=this.value)||void 0===e?void 0:e.language)}}isComposing(){return!this.insertCompositionTextEndFlag}registerInputEvent(){const t=this.contentRenderer.getCodeContentContainerRef();t&&(t.addEventListener("compositionstart",this.handleCompositionStart),t.addEventListener("compositionend",this.handleCompositionEnd))}unregisterEventListener(){const t=this.contentRenderer.getCodeContentContainerRef();t&&(t.removeEventListener("compositionstart",this.handleCompositionStart),t.removeEventListener("compositionend",this.handleCompositionEnd))}stopEventPropagation(t){t.stopPropagation()}}ft([s()],vt.prototype,"selectionController",void 0),ft([s()],vt.prototype,"contentRenderer",void 0),ft([s()],vt.prototype,"valueController",void 0),ft([s()],vt.prototype,"contentParseController",void 0),ft([s()],vt.prototype,"value",void 0),ft([c("componentDidLoad")],vt.prototype,"registerInputEvent",null),ft([c("disconnectedCallback")],vt.prototype,"unregisterEventListener",null);var bt=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};class gt extends ${constructor(){super(...arguments),this.getEffectiveTargets=()=>[this.contentRenderer.getCodeContentContainerRef()]}async undo(){if(this.undoStack.length>1){const t=this.undoStack.pop();this.redoStack.push(t);const e=this.undoStack[this.undoStack.length-1];e&&await this.restoreState(e)}}async redo(){const t=this.redoStack.pop();this.undoStack.push(t),await this.restoreState(t)}initialHistory(){this.registerHistory({value:this.value,offset:this.value.code.length},!0)}getIneffectiveTargets(){return[]}async restoreState(t){const{value:e,offset:n}=t;this.selectionController.setNextCodeBlockRange(n),this.valueController.updateValue(e.code,e.language)}}bt([s()],gt.prototype,"contentRenderer",void 0),bt([s()],gt.prototype,"value",void 0),bt([s()],gt.prototype,"valueController",void 0),bt([s()],gt.prototype,"selectionController",void 0),bt([c("componentDidLoad")],gt.prototype,"initialHistory",null);var mt=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};class yt extends Y{constructor(){super(...arguments),this.handlePasteEvent=t=>{var e,n;t.preventDefault(),this.stopEventPropagation(t);const o=t.clipboardData;if(null===(e=null==o?void 0:o.files)||void 0===e?void 0:e.length)return;const i=null!==(n=null==o?void 0:o.getData("text/plain"))&&void 0!==n?n:"";i&&this.updateCodeBlockRangeAndContent(i)}}registerInputEvent(){const t=this.contentRenderer.getCodeContentContainerRef();t&&t.addEventListener("paste",this.handlePasteEvent)}unregisterEventListener(){const t=this.contentRenderer.getCodeContentContainerRef();t&&t.removeEventListener("paste",this.handlePasteEvent)}updateCodeBlockRangeAndContent(t){const{nextOffset:e,updatedContent:n}=this.getLatestRangeAndContent(t);this.selectionController.setNextCodeBlockRange(e),this.valueController.updateValue(n,this.value.language,{recordHistory:!0,offset:this.selectionController.getCurrentRange().contentOffset})}getLatestRangeAndContent(t){const e=this.selectionController.getCurrentRange(),n=this.contentParseController.getCurrentCodeNodes(),o=this.getCodeNodesContent(n);return this.reCalculateRangeAndContent(e,o,t)}}mt([s()],yt.prototype,"host",void 0),mt([s()],yt.prototype,"valueController",void 0),mt([s()],yt.prototype,"contentRenderer",void 0),mt([s()],yt.prototype,"value",void 0),mt([s()],yt.prototype,"selectionController",void 0),mt([s()],yt.prototype,"contentParseController",void 0),mt([s()],yt.prototype,"inputController",void 0),mt([c("componentDidLoad")],yt.prototype,"registerInputEvent",null),mt([c("disconnectedCallback")],yt.prototype,"unregisterEventListener",null);var xt=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};const Ct=class{constructor(t){n(this,t),this.vegaChange=o(this,"vegaChange",7),this.change=o(this,"change",7),this.vegaRemove=o(this,"vegaRemove",7),this.remove=o(this,"remove",7),this.globalSlimmers={},this.componentGlobalStyleSlimmer=new D(":root{--code-orange:#cd3e00;--code-green:#007e7e;--code-purple:#6851f5;--code-gray:#67727e;--code-neutral:rgb(15, 36, 51);--code-neutral-8:rgba(15, 36, 51, 0.8);--code-neutral-7:rgba(15, 36, 51, 0.7)}.dark{--code-orange:#ff9571;--code-green:#73e6dc;--code-purple:#c7bdff;--code-gray:#8b959f;--code-neutral:rgb(252, 252, 252);--code-neutral-8:rgba(252, 252, 252, 0.8);--code-neutral-7:rgba(252, 252, 252, 0.7)}"),this.translationSlimmer=new E,this.vegaComponentUsageRuntimeMetricsSlimmer=new d,this.codeBlockRenderer=new P,this.contentRenderer=new _,this.copyButtonRenderer=new K,this.valueController=new B,this.contentParseController=new M,this.prismCodeHighlightParser=new ut,this.defaultCodeHighlightParser=new ht,this.selectionController=new U,this.inputController=new q,this.insertCompositionTextController=new vt,this.focusController=new X,this.historyController=new gt,this.changeEventEmitter=R(Ct,g),this.removeEventEmitter=R(Ct,y),this.codeBlockPasteController=new yt,this.eventPreventSlimmer=new T([g],(()=>this.codeBlockRenderer.getToolbarContainerRef())),this.readOnly=!1,this.disabled=!1,this.showCopyButton=!0,this.showLineNumber=!0}watchEditableChange(){}componentShouldUpdate(t,e,n){return"value"!==n||!O(t,e)}async doFocus(){}render(){const e=C([this.readOnly?"readonly":"",this.disabled?"disabled":"",this.showLineNumber?"show-line-number":"",this.prismCodeHighlightParser.canParse()?"highlight":""]);return u(t(i,{contenteditable:!1,class:e},this.codeBlockRenderer.render()),this.host)}get host(){return r(this)}static get watchers(){return{readOnly:["watchEditableChange"],disabled:["watchEditableChange"]}}};xt([p()],Ct.prototype,"globalSlimmers",void 0),xt([l()],Ct.prototype,"componentGlobalStyleSlimmer",void 0),xt([l()],Ct.prototype,"translationSlimmer",void 0),xt([l()],Ct.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),xt([l()],Ct.prototype,"codeBlockRenderer",void 0),xt([l()],Ct.prototype,"contentRenderer",void 0),xt([l()],Ct.prototype,"copyButtonRenderer",void 0),xt([l()],Ct.prototype,"valueController",void 0),xt([l()],Ct.prototype,"contentParseController",void 0),xt([l()],Ct.prototype,"prismCodeHighlightParser",void 0),xt([l()],Ct.prototype,"defaultCodeHighlightParser",void 0),xt([l()],Ct.prototype,"selectionController",void 0),xt([l()],Ct.prototype,"inputController",void 0),xt([l()],Ct.prototype,"insertCompositionTextController",void 0),xt([l()],Ct.prototype,"focusController",void 0),xt([l()],Ct.prototype,"historyController",void 0),xt([l()],Ct.prototype,"changeEventEmitter",void 0),xt([l()],Ct.prototype,"removeEventEmitter",void 0),xt([l()],Ct.prototype,"codeBlockPasteController",void 0),xt([l()],Ct.prototype,"eventPreventSlimmer",void 0),Ct.style=':host{display:block;border-radius:2px;background-color:rgba(var(--v-bg-secondary, 245, 247, 247, 1));padding-left:12px;padding-right:12px;padding-top:12px;padding-bottom:12px}:host code{display:block;box-sizing:border-box;color:rgba(var(--v-text-primary, 32, 54, 69, 1));text-align:left;font-family:"Roboto Mono";font-weight:400;line-height:22px;font-size:16px;white-space:pre-wrap;min-height:22px;tab-size:2px;word-break:break-word}:host code:focus-visible{outline:none}:host .editor-toolbar{display:flex;flex-direction:row;justify-content:space-between;align-items:center;padding-bottom:12px;border:1px solid rgba(var(--v-border-divider-secondary, 199, 217, 229, 1));border-top-width:0px;border-left-width:0px;border-right-width:0px;margin-bottom:12px;user-select:none}:host .editor-toolbar vega-input-select{width:auto;min-width:161px}:host(.show-line-number) code .v-code-line-number::before{content:attr(data-mark);width:var(--v-code-line-number-width);margin-left:var(--v-code-line-number-ml);padding-right:16px;text-align:right;user-select:none;font-style:normal;word-break:keep-all;color:rgba(var(--v-text-secondary, 107, 116, 125, 1));display:inline-block}:host(.show-line-number) code{padding-left:var(--v-code-block-pl)}:host::part(select-container){padding-top:0px;padding-bottom:0px;padding-left:8px;padding-right:8px;border-radius:4px}:host::part(selected-box),:host::part(placeholder){font-size:14px;user-select:none}:host::part(toggle-icon-container){width:12px;height:12px;line-height:12px}:host::part(toggle-icon){width:12px;height:12px}:host(.readonly) .copy-button-container{position:relative}:host(.readonly) .copy-button-container .copy-code-button{position:absolute;top:0px;right:0px}:host(.disabled:not(.highlight)) code{color:rgba(var(--v-text-input-disabled, 107, 116, 125, 1))}:host(.disabled.highlight){opacity:0.5}:host(.focus:not(.disabled,.readonly)){outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:2px}:host(.highlight) code{color:var(--code-neutral)}code .comment,code .prolog,code .doctype,code .cdata{color:var(--code-gray);font-style:italic}code .namespace{color:var(--code-neutral-7)}code .string,code .attr-value,code .builtin{color:var(--code-green)}code .punctuation,code .operator,code .attr-equals{color:var(--code-gray)}code .entity,code .url,code .symbol,code .number,code .boolean,code .variable,code .constant,code .property,code .regex,code .inserted{color:var(--code-neutral-8)}code .atrule,code .function,code .attr-name{color:var(--code-orange)}code .deleted{color:var(--code-neutral)}code .function-variable{color:#ff0000}code .tag,code .selector,code .keyword{color:var(--code-purple)}';export{Ct as vega_code_block}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as t,r as e,c as i,H as s,g as a}from"./p-6b2342e0.js";import{C as o}from"./p-2d0d575f.js";import{d as r,e as n,F as l,b as c,a as d,c as h}from"./p-a528714c.js";import{s as m}from"./p-519a7d55.js";import{c as u,M as f,V as p,I as v}from"./p-6e1ab235.js";import{m as b}from"./p-6bd5c49b.js";import{V as j,I as g}from"./p-4415ad28.js";import{c as V}from"./p-effa6495.js";import{C as F}from"./p-c47c37f2.js";import{B as w,C as y,D as C}from"./p-b78eaec4.js";import{c as R}from"./p-874bf8b2.js";import{S as O}from"./p-a0c3968b.js";import{F as S}from"./p-11a2f834.js";import{t as k}from"./p-b75ee3ba.js";import{f as E,i as M,g as B}from"./p-aa985d73.js";import{d as P}from"./p-f28a6074.js";import{O as I}from"./p-331a62d5.js";import{f as N,b as A,d as x}from"./p-6e70d3cc.js";import{i as D}from"./p-e4c4ea35.js";import{I as H}from"./p-b28d4f7d.js";import{C as $}from"./p-76063dcb.js";import{d as T}from"./p-d27ae9ff.js";import"./p-6a334573.js";import"./p-9de25451.js";import"./p-5f377954.js";import"./p-18e8d9b7.js";import"./p-5a25014f.js";import"./p-02841589.js";import"./p-8b5d3a52.js";import"./p-3b791b5d.js";import"./p-f0e828d8.js";import"./p-81dd00d0.js";import"./p-49a2e141.js";import"./p-d4ea8e22.js";import"./p-ed45b3b6.js";import"./p-abd7aeaa.js";import"./p-78a57a17.js";import"./p-52b8f2d2.js";import"./p-d884c644.js";import"./p-262ec334.js";var W=function(t,e,i,s){var a,o=arguments.length,r=o<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var n=t.length-1;n>=0;n--)(a=t[n])&&(r=(o<3?a(r):o>3?a(e,i,r):a(e,i))||r);return o>3&&r&&Object.defineProperty(e,i,r),r};class G extends O{constructor(){super({parent:"vega-form",subStates:[{subStateName:"disableBlurValidation",parentStateName:"disableBlurValidation"}]})}}W([u()],G.prototype,"host",void 0),W([u({writable:!0})],G.prototype,"disableBlurValidation",void 0);var U=function(t,e,i,s){var a,o=arguments.length,r=o<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var n=t.length-1;n>=0;n--)(a=t[n])&&(r=(o<3?a(r):o>3?a(e,i,r):a(e,i))||r);return o>3&&r&&Object.defineProperty(e,i,r),r};class _ extends p{setValidationStates(t){0!==t.length?t.forEach((t=>{const e=this.getHostByFieldName(t.fieldName);e&&this.updateFieldValidationState(e,{isValid:t.isValid,errorMessage:t.isValid?"":t.errorMessage})})):Array.from(this.host.querySelectorAll("[data-vega-form]")).filter((t=>S.isValidFormField(t))).forEach((t=>{this.updateFieldValidationState(t,{isValid:!0})}))}getHostByFieldName(t){const e=t.split(".");let i=this.host;for(const t of e){const e=i.querySelector(`[data-vega-form="${t}"]`);if(!S.isValidFormField(e))return null;i=e}return i}updateFieldValidationState(t,{isValid:e,errorMessage:i}){t.isValid=e,o.notify(r,{host:t,message:e?"":i,isValid:e}),o.notify(n,{host:t,detail:e})}}U([u()],_.prototype,"host",void 0),U([f("setValidationStates")],_.prototype,"setValidationStates",null);var q=function(t,e,i,s){var a,o=arguments.length,r=o<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var n=t.length-1;n>=0;n--)(a=t[n])&&(r=(o<3?a(r):o>3?a(e,i,r):a(e,i))||r);return o>3&&r&&Object.defineProperty(e,i,r),r};class z extends p{getNativeFormRef(){return this.nativeFormRef}render(){return t("form",{action:this.action,method:this.method,ref:t=>{t&&(this.nativeFormRef=t)}},t("slot",null))}}q([u()],z.prototype,"method",void 0),q([u()],z.prototype,"action",void 0);var J=function(t,e,i,s){var a,o=arguments.length,r=o<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var n=t.length-1;n>=0;n--)(a=t[n])&&(r=(o<3?a(r):o>3?a(e,i,r):a(e,i))||r);return o>3&&r&&Object.defineProperty(e,i,r),r};class K extends p{connectedCallback(){this.registerFormSubmitChangeManager()}disconnectedCallback(){this.unregisterFormSubmitChangeManager()}async submitWithFormData(){if(!this.useNativeForm)return;const t=await this.host.getValue();for(const e in t)if("object"==typeof t[e]){const i=this.flattenObjectWithBrackets({[e]:t[e]});for(const t in i){const e=this.createHiddenInput(t,i[t]);this.nativeFormRenderer.getNativeFormRef().append(e)}}else{const i=this.createHiddenInput(e,t[e]);this.nativeFormRenderer.getNativeFormRef().append(i)}this.nativeFormRenderer.getNativeFormRef().requestSubmit()}createHiddenInput(t,e){const i=k().createElement("input");return i.type="hidden",i.name=t,i.value=D(e)?String(e):"",i}registerFormSubmitChangeManager(){var t;this.formSubmitEventObserver=new I(this.canAcceptFormSubmitEvent.bind(this),this.handleSubmitEvents.bind(this));const e=null!==(t=N(this.host,"vega-form",{outerMost:!0}))&&void 0!==t?t:this.host;o.register(P.getSubject(e,E),this.formSubmitEventObserver)}unregisterFormSubmitChangeManager(){var t;const e=null!==(t=N(this.host,"vega-form",{outerMost:!0}))&&void 0!==t?t:this.host;o.unregister(P.getSubject(e,E),this.formSubmitEventObserver)}canAcceptFormSubmitEvent(t){return this.vegaFormFieldController.isElementInCurrentForm(t.host)}async handleSubmitEvents(){if((await this.host.valid()).isValid){const t=await this.host.getValue();this.submitEventEmitter.emit(t).defaultPrevented||await this.submitWithFormData()}}flattenObjectWithBrackets(t,e="",i={}){return Object.entries(t).forEach((([t,s])=>{const a=e?`${e}[${t}]`:t;Array.isArray(s)?s.forEach(((t,e)=>{const s=`${a}[${e}]`;"object"==typeof t&&null!==t?this.flattenObjectWithBrackets(t,s,i):i[s]=t})):D(s)&&"object"==typeof s?this.flattenObjectWithBrackets(s,a,i):i[a]=s})),i}}J([u()],K.prototype,"host",void 0),J([u()],K.prototype,"useNativeForm",void 0),J([u()],K.prototype,"nativeFormRenderer",void 0),J([u()],K.prototype,"submitEventEmitter",void 0),J([u()],K.prototype,"vegaFormFieldController",void 0),J([f("connectedCallback")],K.prototype,"connectedCallback",null),J([f("disconnectedCallback")],K.prototype,"disconnectedCallback",null);var L=function(t,e,i,s){var a,o=arguments.length,r=o<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var n=t.length-1;n>=0;n--)(a=t[n])&&(r=(o<3?a(r):o>3?a(e,i,r):a(e,i))||r);return o>3&&r&&Object.defineProperty(e,i,r),r};class Q extends p{constructor(){super(...arguments),this.childNotifyObserver=new $(n,(t=>this.updateInternalValidStatus(t))),this.childNodeValueChangeObserver=new $(l,(()=>{this.isTouched=!0})),this._invalidFieldPathMap=new H(new Map,(t=>{this._invalidFieldPathMap=t,this.updateIsValidFlag()})),this._pendingValidFieldPathMap=new H(new Map,(t=>{this._pendingValidFieldPathMap=t,this.updateIsValidFlag()})),this.updateInternalValidStatus=t=>{if(t.host!==this.host){const e=t.host,i=t.detail;S.isValidFormField(e)&&this.shouldVisitElement(e,!1,!1)&&(i?this.invalidFieldPathMap.delete(e):this.invalidFieldPathMap.set(e,e.dataset.vegaForm))}}}connectedCallback(){this.initFormFieldDisconnectedObserver(),this.registerFormFieldPendingValid()}disconnectedCallback(){o.notify(c,{host:this.host}),o.unregister(c,this.formFieldDisconnectedObserver),o.unregister(d,this.formFieldPendingValidObserver)}async getValue(t){const e={};return await this.navigateVegaFormChildren((async(i,s)=>{const a=this.getFormFieldName(i);e[a]=s?await i.getValue(t):this.getFormFieldValue(i)}),t),T(e)?Object.values(e):e}async setValue(t,e){t&&(await this.navigateVegaFormChildren((async(i,s)=>{const a=this.getFormFieldName(i);s?await i.setValue(t[a],e):(await i.componentOnReady(),void 0!==t[a]&&("function"==typeof i.setValue?await i.setValue(t[a]):i.value=t[a]))}),e),this.isTouched=!1)}async valid(t=!0){const e={isValid:!0,invalidFields:[]};return await this.navigateVegaFormChildren((async(i,s)=>{if("function"==typeof i.valid&&s){const s=await i.valid(t);s.isValid||(e.isValid=!1,e.invalidFields.push(...s.invalidFields),e.invalidFieldsErrorMessages=Object.assign(Object.assign({},e.invalidFieldsErrorMessages),s.invalidFieldsErrorMessages))}else{const{isValid:s,message:a}=await this.handleChildFormFieldElementValid(i,t);s||(e.isValid=!1,e.invalidFields.push(this.getFormFieldName(i)),e.invalidFieldsErrorMessages||(e.invalidFieldsErrorMessages={}),e.invalidFieldsErrorMessages[this.getFormFieldName(i)]=a)}})),e}get invalidFieldPathMap(){return this._invalidFieldPathMap}get pendingValidFieldPathMap(){return this._pendingValidFieldPathMap}setIsTouched(t){this.isTouched=t}getFormFieldName(t){return t.dataset.vegaForm}isElementInCurrentForm(t){return this.invalidFieldPathMap.has(t)||A(t,this.host)}async navigateVegaFormChildren(t,e,i=this.host){const s=[];Array.from(i.children).forEach((i=>{S.isValidFormField(i)?this.shouldVisitElement(i,null==e?void 0:e.skipDisabled,null==e?void 0:e.skipInvisible)&&s.push(t(i,"VEGA-FORM"===i.tagName)):s.push(this.navigateVegaFormChildren(t,e,i))})),await Promise.all(s)}updateIsValidFlag(){this.isValid=this.pendingValidFieldPathMap.size>0?null:0===this.invalidFieldPathMap.size}registerFormFieldPendingValid(){this.formFieldPendingValidObserver=new I(this.canAcceptFormFieldPendingValid.bind(this),this.handleFieldPendingValid.bind(this)),o.register(d,this.formFieldPendingValidObserver)}canAcceptFormFieldPendingValid(t){return this.isElementInCurrentForm(t.host)}handleFieldPendingValid(t){"boolean"==typeof t.detail?this.pendingValidFieldPathMap.delete(t.host):this.pendingValidFieldPathMap.set(t.host,t.host.dataset.vegaForm)}initFormFieldDisconnectedObserver(){this.formFieldDisconnectedObserver=new I(this.canAcceptFormFieldDisconnectedOperation.bind(this),this.updateInvalidFieldPath.bind(this)),o.register(c,this.formFieldDisconnectedObserver)}canAcceptFormFieldDisconnectedOperation(t){return this.invalidFieldPathMap.has(t.host)}async updateInvalidFieldPath(t){this.invalidFieldPathMap.delete(t.host),this.pendingValidFieldPathMap.delete(t.host)}shouldVisitElement(t,e,i){return this.getFormFieldName(t)&&(!e||!t.disabled)&&(!i||x(t))}getFormFieldValue(t){return void 0===t.value?t.getAttribute("value"):t.value}async handleChildFormFieldElementValid(t,e){const i=P.getSubject(t,M),{isValid:s,message:a}=await new Promise((s=>{const a=setTimeout((()=>{s({isValid:!0,message:""})}),2e3);o.notify(i,{host:t,message:e,promiseResolve:s,timerId:a})}));return{isValid:s,message:a}}}L([u()],Q.prototype,"host",void 0),L([u({writable:!0})],Q.prototype,"isValid",void 0),L([u({writable:!0})],Q.prototype,"isTouched",void 0),L([v()],Q.prototype,"childNotifyObserver",void 0),L([v()],Q.prototype,"childNodeValueChangeObserver",void 0),L([f("connectedCallback")],Q.prototype,"connectedCallback",null),L([f("disconnectedCallback")],Q.prototype,"disconnectedCallback",null),L([f("getValue")],Q.prototype,"getValue",null),L([f("setValue")],Q.prototype,"setValue",null),L([f("valid")],Q.prototype,"valid",null);var X=function(t,e,i,s){var a,o=arguments.length,r=o<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var n=t.length-1;n>=0;n--)(a=t[n])&&(r=(o<3?a(r):o>3?a(e,i,r):a(e,i))||r);return o>3&&r&&Object.defineProperty(e,i,r),r};class Y extends p{connectedCallback(){this.registerFormResetChangeManager()}disconnectedCallback(){this.unregisterFormResetChangeManager()}async reset(t={},e){await this.vegaFormFieldController.navigateVegaFormChildren((async(i,s)=>{const a=this.vegaFormFieldController.getFormFieldName(i);s&&await i.reset(t[a]||{},e)}),e),o.notify(h,{host:this.host,defaultValueMap:t,option:e}),this.vegaFormFieldController.setIsTouched(!1)}registerFormResetChangeManager(){var t;const e=null!==(t=N(this.host,"vega-form",{outerMost:!0}))&&void 0!==t?t:this.host;this.formResetEventObserver=new I(this.canAcceptFormResetEvent.bind(this),this.handleResetEvents.bind(this)),o.register(P.getSubject(e,B),this.formResetEventObserver)}unregisterFormResetChangeManager(){var t;const e=null!==(t=N(this.host,"vega-form",{outerMost:!0}))&&void 0!==t?t:this.host;o.unregister(P.getSubject(e,B),this.formResetEventObserver)}canAcceptFormResetEvent(t){return this.vegaFormFieldController.isElementInCurrentForm(t.host)}async handleResetEvents(){await this.host.reset(),this.resetEventEmitter.emit()}}X([u()],Y.prototype,"host",void 0),X([u()],Y.prototype,"vegaFormFieldController",void 0),X([u()],Y.prototype,"resetEventEmitter",void 0),X([f("connectedCallback")],Y.prototype,"connectedCallback",null),X([f("disconnectedCallback")],Y.prototype,"disconnectedCallback",null),X([f("reset")],Y.prototype,"reset",null);var Z=function(t,e,i,s){var a,o=arguments.length,r=o<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var n=t.length-1;n>=0;n--)(a=t[n])&&(r=(o<3?a(r):o>3?a(e,i,r):a(e,i))||r);return o>3&&r&&Object.defineProperty(e,i,r),r};const tt=class{constructor(t){e(this,t),this.vegaValidate=i(this,"vegaValidate",7),this.validate=i(this,"validate",7),this.vegaFormSubmit=i(this,"vegaFormSubmit",7),this.formSubmit=i(this,"formSubmit",7),this.vegaFormReset=i(this,"vegaFormReset",7),this.formReset=i(this,"formReset",7),this.globalSlimmers={},this.submitEventEmitter=V(tt,w),this.resetEventEmitter=V(tt,y),this.validateEventEmitter=V(tt,C),this.disableBlurValidationNotifySlimmer=R(tt,"disableBlurValidation","watchDisableBlurValidation"),this.stateController=new G,this.childEventPrevent=new F([w,y],(()=>this.host.querySelector("vega-form")),{customPreventHandle:t=>{t.stopPropagation()}}),this.childFormValidateEventPrevent=new F([C],(()=>this.host),{customPreventHandle:t=>{t.stopPropagation()}}),this.vegaComponentUsageRuntimeMetricsSlimmer=new j,this.vegaFormFieldValidationStateController=new _,this.nativeFormRenderer=new z,this.vegaFormSubmitController=new K,this.vegaFormResetController=new Y,this.vegaFormFieldController=new Q,this.isValid=null,this.isTouched=!1,this.disableBlurValidation=!1,this.useNativeForm=!1,this.method="get"}watchIsValid(){this.validateEventEmitter.emit(this.isValid),o.notify(n,{host:this.host,detail:this.isValid})}watchDisableBlurValidation(){}async valid(t=!0){return b(t)}async getValue(t){return b(t)}async setValue(t,e){}async reset(t={},e){}async setValidationStates(t){}render(){return m(t(s,null,this.useNativeForm?this.nativeFormRenderer.render():t("slot",null)),this.host)}get host(){return a(this)}static get watchers(){return{isValid:["watchIsValid"],disableBlurValidation:["watchDisableBlurValidation"]}}};Z([g()],tt.prototype,"globalSlimmers",void 0),Z([v()],tt.prototype,"submitEventEmitter",void 0),Z([v()],tt.prototype,"resetEventEmitter",void 0),Z([v()],tt.prototype,"validateEventEmitter",void 0),Z([v()],tt.prototype,"disableBlurValidationNotifySlimmer",void 0),Z([v()],tt.prototype,"stateController",void 0),Z([v()],tt.prototype,"childEventPrevent",void 0),Z([v()],tt.prototype,"childFormValidateEventPrevent",void 0),Z([v()],tt.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),Z([v()],tt.prototype,"vegaFormFieldValidationStateController",void 0),Z([v()],tt.prototype,"nativeFormRenderer",void 0),Z([v()],tt.prototype,"vegaFormSubmitController",void 0),Z([v()],tt.prototype,"vegaFormResetController",void 0),Z([v()],tt.prototype,"vegaFormFieldController",void 0),tt.style=":host{display:block}";export{tt as vega_form}
|
|
1
|
+
import{h as t,r as e,c as i,H as s,g as a}from"./p-6b2342e0.js";import{C as o}from"./p-2d0d575f.js";import{d as r,e as n,F as l,b as c,a as d,c as h}from"./p-a528714c.js";import{s as m}from"./p-519a7d55.js";import{c as u,M as f,V as p,I as v}from"./p-6e1ab235.js";import{m as b}from"./p-6bd5c49b.js";import{V as j,I as g}from"./p-4415ad28.js";import{c as V}from"./p-6b5cb920.js";import{C as F}from"./p-e27626f6.js";import{B as w,C as y,D as C}from"./p-9af0e2e7.js";import{c as R}from"./p-c31a32f4.js";import{S as O}from"./p-af5cb9bc.js";import{F as S}from"./p-c347e08a.js";import{t as k}from"./p-b75ee3ba.js";import{f as E,i as M,g as B}from"./p-6c43d54a.js";import{d as P}from"./p-f28a6074.js";import{O as I}from"./p-331a62d5.js";import{f as N,b as A,d as x}from"./p-6e70d3cc.js";import{i as D}from"./p-e4c4ea35.js";import{I as H}from"./p-48e3be6a.js";import{C as $}from"./p-76063dcb.js";import{d as T}from"./p-d27ae9ff.js";import"./p-6a334573.js";import"./p-f1c672e4.js";import"./p-5f377954.js";import"./p-18e8d9b7.js";import"./p-5a25014f.js";import"./p-02841589.js";import"./p-8b5d3a52.js";import"./p-3b791b5d.js";import"./p-f0e828d8.js";import"./p-81dd00d0.js";import"./p-49a2e141.js";import"./p-d4ea8e22.js";import"./p-ed45b3b6.js";import"./p-abd7aeaa.js";import"./p-78a57a17.js";import"./p-52b8f2d2.js";import"./p-d884c644.js";import"./p-262ec334.js";var W=function(t,e,i,s){var a,o=arguments.length,r=o<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var n=t.length-1;n>=0;n--)(a=t[n])&&(r=(o<3?a(r):o>3?a(e,i,r):a(e,i))||r);return o>3&&r&&Object.defineProperty(e,i,r),r};class G extends O{constructor(){super({parent:"vega-form",subStates:[{subStateName:"disableBlurValidation",parentStateName:"disableBlurValidation"}]})}}W([u()],G.prototype,"host",void 0),W([u({writable:!0})],G.prototype,"disableBlurValidation",void 0);var U=function(t,e,i,s){var a,o=arguments.length,r=o<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var n=t.length-1;n>=0;n--)(a=t[n])&&(r=(o<3?a(r):o>3?a(e,i,r):a(e,i))||r);return o>3&&r&&Object.defineProperty(e,i,r),r};class _ extends p{setValidationStates(t){0!==t.length?t.forEach((t=>{const e=this.getHostByFieldName(t.fieldName);e&&this.updateFieldValidationState(e,{isValid:t.isValid,errorMessage:t.isValid?"":t.errorMessage})})):Array.from(this.host.querySelectorAll("[data-vega-form]")).filter((t=>S.isValidFormField(t))).forEach((t=>{this.updateFieldValidationState(t,{isValid:!0})}))}getHostByFieldName(t){const e=t.split(".");let i=this.host;for(const t of e){const e=i.querySelector(`[data-vega-form="${t}"]`);if(!S.isValidFormField(e))return null;i=e}return i}updateFieldValidationState(t,{isValid:e,errorMessage:i}){t.isValid=e,o.notify(r,{host:t,message:e?"":i,isValid:e}),o.notify(n,{host:t,detail:e})}}U([u()],_.prototype,"host",void 0),U([f("setValidationStates")],_.prototype,"setValidationStates",null);var q=function(t,e,i,s){var a,o=arguments.length,r=o<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var n=t.length-1;n>=0;n--)(a=t[n])&&(r=(o<3?a(r):o>3?a(e,i,r):a(e,i))||r);return o>3&&r&&Object.defineProperty(e,i,r),r};class z extends p{getNativeFormRef(){return this.nativeFormRef}render(){return t("form",{action:this.action,method:this.method,ref:t=>{t&&(this.nativeFormRef=t)}},t("slot",null))}}q([u()],z.prototype,"method",void 0),q([u()],z.prototype,"action",void 0);var J=function(t,e,i,s){var a,o=arguments.length,r=o<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var n=t.length-1;n>=0;n--)(a=t[n])&&(r=(o<3?a(r):o>3?a(e,i,r):a(e,i))||r);return o>3&&r&&Object.defineProperty(e,i,r),r};class K extends p{connectedCallback(){this.registerFormSubmitChangeManager()}disconnectedCallback(){this.unregisterFormSubmitChangeManager()}async submitWithFormData(){if(!this.useNativeForm)return;const t=await this.host.getValue();for(const e in t)if("object"==typeof t[e]){const i=this.flattenObjectWithBrackets({[e]:t[e]});for(const t in i){const e=this.createHiddenInput(t,i[t]);this.nativeFormRenderer.getNativeFormRef().append(e)}}else{const i=this.createHiddenInput(e,t[e]);this.nativeFormRenderer.getNativeFormRef().append(i)}this.nativeFormRenderer.getNativeFormRef().requestSubmit()}createHiddenInput(t,e){const i=k().createElement("input");return i.type="hidden",i.name=t,i.value=D(e)?String(e):"",i}registerFormSubmitChangeManager(){var t;this.formSubmitEventObserver=new I(this.canAcceptFormSubmitEvent.bind(this),this.handleSubmitEvents.bind(this));const e=null!==(t=N(this.host,"vega-form",{outerMost:!0}))&&void 0!==t?t:this.host;o.register(P.getSubject(e,E),this.formSubmitEventObserver)}unregisterFormSubmitChangeManager(){var t;const e=null!==(t=N(this.host,"vega-form",{outerMost:!0}))&&void 0!==t?t:this.host;o.unregister(P.getSubject(e,E),this.formSubmitEventObserver)}canAcceptFormSubmitEvent(t){return this.vegaFormFieldController.isElementInCurrentForm(t.host)}async handleSubmitEvents(){if((await this.host.valid()).isValid){const t=await this.host.getValue();this.submitEventEmitter.emit(t).defaultPrevented||await this.submitWithFormData()}}flattenObjectWithBrackets(t,e="",i={}){return Object.entries(t).forEach((([t,s])=>{const a=e?`${e}[${t}]`:t;Array.isArray(s)?s.forEach(((t,e)=>{const s=`${a}[${e}]`;"object"==typeof t&&null!==t?this.flattenObjectWithBrackets(t,s,i):i[s]=t})):D(s)&&"object"==typeof s?this.flattenObjectWithBrackets(s,a,i):i[a]=s})),i}}J([u()],K.prototype,"host",void 0),J([u()],K.prototype,"useNativeForm",void 0),J([u()],K.prototype,"nativeFormRenderer",void 0),J([u()],K.prototype,"submitEventEmitter",void 0),J([u()],K.prototype,"vegaFormFieldController",void 0),J([f("connectedCallback")],K.prototype,"connectedCallback",null),J([f("disconnectedCallback")],K.prototype,"disconnectedCallback",null);var L=function(t,e,i,s){var a,o=arguments.length,r=o<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var n=t.length-1;n>=0;n--)(a=t[n])&&(r=(o<3?a(r):o>3?a(e,i,r):a(e,i))||r);return o>3&&r&&Object.defineProperty(e,i,r),r};class Q extends p{constructor(){super(...arguments),this.childNotifyObserver=new $(n,(t=>this.updateInternalValidStatus(t))),this.childNodeValueChangeObserver=new $(l,(()=>{this.isTouched=!0})),this._invalidFieldPathMap=new H(new Map,(t=>{this._invalidFieldPathMap=t,this.updateIsValidFlag()})),this._pendingValidFieldPathMap=new H(new Map,(t=>{this._pendingValidFieldPathMap=t,this.updateIsValidFlag()})),this.updateInternalValidStatus=t=>{if(t.host!==this.host){const e=t.host,i=t.detail;S.isValidFormField(e)&&this.shouldVisitElement(e,!1,!1)&&(i?this.invalidFieldPathMap.delete(e):this.invalidFieldPathMap.set(e,e.dataset.vegaForm))}}}connectedCallback(){this.initFormFieldDisconnectedObserver(),this.registerFormFieldPendingValid()}disconnectedCallback(){o.notify(c,{host:this.host}),o.unregister(c,this.formFieldDisconnectedObserver),o.unregister(d,this.formFieldPendingValidObserver)}async getValue(t){const e={};return await this.navigateVegaFormChildren((async(i,s)=>{const a=this.getFormFieldName(i);e[a]=s?await i.getValue(t):this.getFormFieldValue(i)}),t),T(e)?Object.values(e):e}async setValue(t,e){t&&(await this.navigateVegaFormChildren((async(i,s)=>{const a=this.getFormFieldName(i);s?await i.setValue(t[a],e):(await i.componentOnReady(),void 0!==t[a]&&("function"==typeof i.setValue?await i.setValue(t[a]):i.value=t[a]))}),e),this.isTouched=!1)}async valid(t=!0){const e={isValid:!0,invalidFields:[]};return await this.navigateVegaFormChildren((async(i,s)=>{if("function"==typeof i.valid&&s){const s=await i.valid(t);s.isValid||(e.isValid=!1,e.invalidFields.push(...s.invalidFields),e.invalidFieldsErrorMessages=Object.assign(Object.assign({},e.invalidFieldsErrorMessages),s.invalidFieldsErrorMessages))}else{const{isValid:s,message:a}=await this.handleChildFormFieldElementValid(i,t);s||(e.isValid=!1,e.invalidFields.push(this.getFormFieldName(i)),e.invalidFieldsErrorMessages||(e.invalidFieldsErrorMessages={}),e.invalidFieldsErrorMessages[this.getFormFieldName(i)]=a)}})),e}get invalidFieldPathMap(){return this._invalidFieldPathMap}get pendingValidFieldPathMap(){return this._pendingValidFieldPathMap}setIsTouched(t){this.isTouched=t}getFormFieldName(t){return t.dataset.vegaForm}isElementInCurrentForm(t){return this.invalidFieldPathMap.has(t)||A(t,this.host)}async navigateVegaFormChildren(t,e,i=this.host){const s=[];Array.from(i.children).forEach((i=>{S.isValidFormField(i)?this.shouldVisitElement(i,null==e?void 0:e.skipDisabled,null==e?void 0:e.skipInvisible)&&s.push(t(i,"VEGA-FORM"===i.tagName)):s.push(this.navigateVegaFormChildren(t,e,i))})),await Promise.all(s)}updateIsValidFlag(){this.isValid=this.pendingValidFieldPathMap.size>0?null:0===this.invalidFieldPathMap.size}registerFormFieldPendingValid(){this.formFieldPendingValidObserver=new I(this.canAcceptFormFieldPendingValid.bind(this),this.handleFieldPendingValid.bind(this)),o.register(d,this.formFieldPendingValidObserver)}canAcceptFormFieldPendingValid(t){return this.isElementInCurrentForm(t.host)}handleFieldPendingValid(t){"boolean"==typeof t.detail?this.pendingValidFieldPathMap.delete(t.host):this.pendingValidFieldPathMap.set(t.host,t.host.dataset.vegaForm)}initFormFieldDisconnectedObserver(){this.formFieldDisconnectedObserver=new I(this.canAcceptFormFieldDisconnectedOperation.bind(this),this.updateInvalidFieldPath.bind(this)),o.register(c,this.formFieldDisconnectedObserver)}canAcceptFormFieldDisconnectedOperation(t){return this.invalidFieldPathMap.has(t.host)}async updateInvalidFieldPath(t){this.invalidFieldPathMap.delete(t.host),this.pendingValidFieldPathMap.delete(t.host)}shouldVisitElement(t,e,i){return this.getFormFieldName(t)&&(!e||!t.disabled)&&(!i||x(t))}getFormFieldValue(t){return void 0===t.value?t.getAttribute("value"):t.value}async handleChildFormFieldElementValid(t,e){const i=P.getSubject(t,M),{isValid:s,message:a}=await new Promise((s=>{const a=setTimeout((()=>{s({isValid:!0,message:""})}),2e3);o.notify(i,{host:t,message:e,promiseResolve:s,timerId:a})}));return{isValid:s,message:a}}}L([u()],Q.prototype,"host",void 0),L([u({writable:!0})],Q.prototype,"isValid",void 0),L([u({writable:!0})],Q.prototype,"isTouched",void 0),L([v()],Q.prototype,"childNotifyObserver",void 0),L([v()],Q.prototype,"childNodeValueChangeObserver",void 0),L([f("connectedCallback")],Q.prototype,"connectedCallback",null),L([f("disconnectedCallback")],Q.prototype,"disconnectedCallback",null),L([f("getValue")],Q.prototype,"getValue",null),L([f("setValue")],Q.prototype,"setValue",null),L([f("valid")],Q.prototype,"valid",null);var X=function(t,e,i,s){var a,o=arguments.length,r=o<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var n=t.length-1;n>=0;n--)(a=t[n])&&(r=(o<3?a(r):o>3?a(e,i,r):a(e,i))||r);return o>3&&r&&Object.defineProperty(e,i,r),r};class Y extends p{connectedCallback(){this.registerFormResetChangeManager()}disconnectedCallback(){this.unregisterFormResetChangeManager()}async reset(t={},e){await this.vegaFormFieldController.navigateVegaFormChildren((async(i,s)=>{const a=this.vegaFormFieldController.getFormFieldName(i);s&&await i.reset(t[a]||{},e)}),e),o.notify(h,{host:this.host,defaultValueMap:t,option:e}),this.vegaFormFieldController.setIsTouched(!1)}registerFormResetChangeManager(){var t;const e=null!==(t=N(this.host,"vega-form",{outerMost:!0}))&&void 0!==t?t:this.host;this.formResetEventObserver=new I(this.canAcceptFormResetEvent.bind(this),this.handleResetEvents.bind(this)),o.register(P.getSubject(e,B),this.formResetEventObserver)}unregisterFormResetChangeManager(){var t;const e=null!==(t=N(this.host,"vega-form",{outerMost:!0}))&&void 0!==t?t:this.host;o.unregister(P.getSubject(e,B),this.formResetEventObserver)}canAcceptFormResetEvent(t){return this.vegaFormFieldController.isElementInCurrentForm(t.host)}async handleResetEvents(){await this.host.reset(),this.resetEventEmitter.emit()}}X([u()],Y.prototype,"host",void 0),X([u()],Y.prototype,"vegaFormFieldController",void 0),X([u()],Y.prototype,"resetEventEmitter",void 0),X([f("connectedCallback")],Y.prototype,"connectedCallback",null),X([f("disconnectedCallback")],Y.prototype,"disconnectedCallback",null),X([f("reset")],Y.prototype,"reset",null);var Z=function(t,e,i,s){var a,o=arguments.length,r=o<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var n=t.length-1;n>=0;n--)(a=t[n])&&(r=(o<3?a(r):o>3?a(e,i,r):a(e,i))||r);return o>3&&r&&Object.defineProperty(e,i,r),r};const tt=class{constructor(t){e(this,t),this.vegaValidate=i(this,"vegaValidate",7),this.validate=i(this,"validate",7),this.vegaFormSubmit=i(this,"vegaFormSubmit",7),this.formSubmit=i(this,"formSubmit",7),this.vegaFormReset=i(this,"vegaFormReset",7),this.formReset=i(this,"formReset",7),this.globalSlimmers={},this.submitEventEmitter=V(tt,w),this.resetEventEmitter=V(tt,y),this.validateEventEmitter=V(tt,C),this.disableBlurValidationNotifySlimmer=R(tt,"disableBlurValidation","watchDisableBlurValidation"),this.stateController=new G,this.childEventPrevent=new F([w,y],(()=>this.host.querySelector("vega-form")),{customPreventHandle:t=>{t.stopPropagation()}}),this.childFormValidateEventPrevent=new F([C],(()=>this.host),{customPreventHandle:t=>{t.stopPropagation()}}),this.vegaComponentUsageRuntimeMetricsSlimmer=new j,this.vegaFormFieldValidationStateController=new _,this.nativeFormRenderer=new z,this.vegaFormSubmitController=new K,this.vegaFormResetController=new Y,this.vegaFormFieldController=new Q,this.isValid=null,this.isTouched=!1,this.disableBlurValidation=!1,this.useNativeForm=!1,this.method="get"}watchIsValid(){this.validateEventEmitter.emit(this.isValid),o.notify(n,{host:this.host,detail:this.isValid})}watchDisableBlurValidation(){}async valid(t=!0){return b(t)}async getValue(t){return b(t)}async setValue(t,e){}async reset(t={},e){}async setValidationStates(t){}render(){return m(t(s,null,this.useNativeForm?this.nativeFormRenderer.render():t("slot",null)),this.host)}get host(){return a(this)}static get watchers(){return{isValid:["watchIsValid"],disableBlurValidation:["watchDisableBlurValidation"]}}};Z([g()],tt.prototype,"globalSlimmers",void 0),Z([v()],tt.prototype,"submitEventEmitter",void 0),Z([v()],tt.prototype,"resetEventEmitter",void 0),Z([v()],tt.prototype,"validateEventEmitter",void 0),Z([v()],tt.prototype,"disableBlurValidationNotifySlimmer",void 0),Z([v()],tt.prototype,"stateController",void 0),Z([v()],tt.prototype,"childEventPrevent",void 0),Z([v()],tt.prototype,"childFormValidateEventPrevent",void 0),Z([v()],tt.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),Z([v()],tt.prototype,"vegaFormFieldValidationStateController",void 0),Z([v()],tt.prototype,"nativeFormRenderer",void 0),Z([v()],tt.prototype,"vegaFormSubmitController",void 0),Z([v()],tt.prototype,"vegaFormResetController",void 0),Z([v()],tt.prototype,"vegaFormFieldController",void 0),tt.style=":host{display:block}";export{tt as vega_form}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as t,f as e,r as i,c as o,H as s,g as r}from"./p-6b2342e0.js";import{V as a,I as l}from"./p-4415ad28.js";import{R as n}from"./p-280cbcdb.js";import{c,V as h,M as p,I as d}from"./p-6e1ab235.js";import{s as f}from"./p-519a7d55.js";import{F as u}from"./p-c347e08a.js";import{D as v}from"./p-f28a6074.js";import{c as m,b as g,a as w,i as b,H as j}from"./p-9af0e2e7.js";import{c as x}from"./p-6b5cb920.js";import{V as C}from"./p-e1fbfd20.js";import{F as R}from"./p-a528714c.js";import{C as y}from"./p-2d0d575f.js";import{T as F}from"./p-57f220b5.js";import{C as S}from"./p-e27626f6.js";import"./p-abd7aeaa.js";import"./p-02841589.js";import"./p-331a62d5.js";import"./p-6e70d3cc.js";import"./p-8b5d3a52.js";import"./p-6a334573.js";import"./p-6c43d54a.js";import"./p-3b791b5d.js";import"./p-f0e828d8.js";import"./p-b75ee3ba.js";import"./p-81dd00d0.js";import"./p-49a2e141.js";import"./p-d4ea8e22.js";import"./p-ed45b3b6.js";import"./p-78a57a17.js";import"./p-52b8f2d2.js";import"./p-d27ae9ff.js";import"./p-262ec334.js";import"./p-af5cb9bc.js";import"./p-f1c672e4.js";import"./p-e6adf829.js";import"./p-593e0f80.js";import"./p-5f377954.js";import"./p-18e8d9b7.js";import"./p-5a25014f.js";var k=function(t,e,i,o){var s,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};class I extends h{constructor(){super(...arguments),this.handlePopoverShow=()=>{v.addUniqueObserverToNode(this.popoverRef,m,(()=>{this.isPopoverOpen=!0,this.internalColor!==this.value&&this.colorSwatchPickerValueController.updateInternalColor(this.value)}))},this.handlePopoverHide=()=>{v.addUniqueObserverToNode(this.popoverRef,g,(()=>{this.isPopoverOpen=!1}))},this.registerButtonClickHandler=t=>{v.addUniqueObserverToNode(t,w,(()=>{this.popoverRef&&this.popoverRef.hide(),this.colorSwatchPickerValueController.updateValue("clear"===t.dataset.actionType?"":this.internalColor)}))}}hidePopover(){this.popoverRef&&this.popoverRef.hide()}getContainerRef(){return this.containerRef}getLeftContainerRef(){return this.leftContainerRef}render(){const e=this.leftSlotProjection.hasSlot();return t("div",{ref:t=>this.containerRef=t,class:"swatch-picker-container"},t("vega-popover",{ref:t=>{this.popoverRef=t,this.handlePopoverShow(),this.handlePopoverHide()},class:"swatch-popover",alignment:"center",isScreenPosition:!0,trigger:"click"},t("div",{slot:"popover-content"},t("vega-color-swatch",{class:"swatch-picker-trigger","aria-expanded":this.isPopoverOpen?"true":"false","aria-haspopup":"dialog",disabled:this.disabled,color:this.value,size:"small"})),t("vega-box",{slot:"popover",class:"swatch-popover-content",width:"min-content"},t("vega-flex",{gap:"size-16"},e&&t("div",{ref:t=>this.leftContainerRef=t}),e&&t("div",null,t("vega-divider",{direction:"vertical"})),t("div",null,this.colorSwatchInputRenderer.render(),this.colorSwatchGridRenderer.render(),this.renderButtonGroup())))),t("vega-field-label",{label:this.label,disabled:this.disabled,isFieldRequired:this.required}))}renderButtonGroup(){return t("vega-flex",{gap:"size-8",justifyContent:"end",margin:{top:"size-16"}},this.showClearButton&&t("vega-button-link",{ref:this.registerButtonClickHandler,"data-action-type":"clear",label:this.translationSlimmer.t("Clear"),size:"small"}),t("vega-button-link",{ref:this.registerButtonClickHandler,"data-action-type":"apply",label:this.translationSlimmer.t("Apply"),size:"small"}))}}k([c()],I.prototype,"host",void 0),k([c()],I.prototype,"value",void 0),k([c()],I.prototype,"internalColor",void 0),k([c()],I.prototype,"label",void 0),k([c()],I.prototype,"required",void 0),k([c({writable:!0})],I.prototype,"isPopoverOpen",void 0),k([c()],I.prototype,"disabled",void 0),k([c()],I.prototype,"showClearButton",void 0),k([c()],I.prototype,"colorSwatchGridRenderer",void 0),k([c()],I.prototype,"colorSwatchInputRenderer",void 0),k([c()],I.prototype,"colorSwatchPickerValueController",void 0),k([c()],I.prototype,"translationSlimmer",void 0),k([c()],I.prototype,"leftSlotProjection",void 0);var z=function(t,e,i,o){var s,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};class V extends h{constructor(){super(...arguments),this.handleColorSwatchClick=t=>{v.addUniqueObserverToNode(t,w,(()=>{this.colorSwatchPickerValueController.updateInternalColor(t.color)}))}}render(){return t("vega-grid",{column:this.swatchGridColumns,justifyItems:"start",gap:"size-8",style:{width:"max-content"}},this.colors.map((e=>t("vega-color-swatch",{ref:this.handleColorSwatchClick,selected:this.isColorMatched(this.internalColor,e),color:e,size:"extra-small"}))))}isColorMatched(t,e){return t&&e?t.toLowerCase()===e.toLowerCase():t===e}}z([c()],V.prototype,"colors",void 0),z([c()],V.prototype,"internalColor",void 0),z([c()],V.prototype,"swatchGridColumns",void 0),z([c()],V.prototype,"colorSwatchPickerValueController",void 0);var O=function(t,e,i,o){var s,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};class P extends h{constructor(){super(...arguments),this.handleInputEvent=t=>{v.addUniqueObserverToNode(t,b,(()=>{const e=this.colorSwatchPickerColorFormatController.formatColor("output",t.value);e&&!this.isValidColor(e)||this.colorSwatchPickerValueController.updateInternalColor(e)})),v.addUniqueObserverToNode(t,j,(()=>{t.value&&!this.isValidColor(t.value)&&(t.value=this.colorSwatchPickerColorFormatController.formatColor("input",this.internalColor))}))}}render(){return this.showInput?t("vega-flex",{gap:"size-8",alignItems:"center",margin:{bottom:"size-16"}},t("vega-color-swatch",{color:this.internalColor,size:"extra-small"}),t("vega-input",{ref:this.handleInputEvent,size:"small",value:this.colorSwatchPickerColorFormatController.formatColor("input",this.internalColor),placeholder:this.inputPlaceholder||this.translationSlimmer.t("Enter color"),prefixIcon:this.inputPrefixIcon===P.DEFAULT_INPUT_ICON?C.getIconKey("hashtag"):this.inputPrefixIcon})):null}isValidColor(t){let e=!0;return globalThis.CSS&&"function"==typeof globalThis.CSS.supports&&(e=globalThis.CSS.supports("color",t)),e}}C.register({hashtag:{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M188.7 32.5c13 2.6 21.4 15.2 18.8 28.2L192.5 136h111l16.9-84.7c2.6-13 15.2-21.4 28.2-18.8s21.4 15.2 18.8 28.2L352.5 136H424c13.3 0 24 10.7 24 24s-10.7 24-24 24H342.9L314.1 328H392c13.3 0 24 10.7 24 24s-10.7 24-24 24H304.5l-16.9 84.7c-2.6 13-15.2 21.4-28.2 18.8s-21.4-15.2-18.8-28.2L255.5 376h-111l-16.9 84.7c-2.6 13-15.2 21.4-28.2 18.8s-21.4-15.2-18.8-28.2L95.5 376H24c-13.3 0-24-10.7-24-24s10.7-24 24-24h81.1l28.8-144H56c-13.3 0-24-10.7-24-24s10.7-24 24-24h87.5l16.9-84.7c2.6-13 15.2-21.4 28.2-18.8zM182.9 184L154.1 328h111l28.8-144h-111z"/></svg>'}}),P.DEFAULT_INPUT_ICON="hexColorIcon",O([c()],P.prototype,"internalColor",void 0),O([c()],P.prototype,"showInput",void 0),O([c()],P.prototype,"inputPlaceholder",void 0),O([c()],P.prototype,"inputPrefixIcon",void 0),O([c()],P.prototype,"colorSwatchPickerValueController",void 0),O([c()],P.prototype,"colorSwatchPickerColorFormatController",void 0),O([c()],P.prototype,"translationSlimmer",void 0);var L=function(t,e,i,o){var s,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};class H extends h{updateValue(t){this.value=t}updateInternalColor(t){this.internalColor=t}initializeInternalColor(){this.internalColor=this.value}listenToValueChange(){this.internalColor=this.value,this.changeEventEmitter.emit(this.value),y.notify(R,{host:this.host,detail:this.value})}}L([c()],H.prototype,"host",void 0),L([c({writable:!0})],H.prototype,"value",void 0),L([c({writable:!0})],H.prototype,"internalColor",void 0),L([c()],H.prototype,"changeEventEmitter",void 0),L([p("componentWillLoad")],H.prototype,"initializeInternalColor",null),L([p("watchValue")],H.prototype,"listenToValueChange",null);var T=function(t,e,i,o){var s,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};class D extends h{updateTheColor(){this.internalColor&&this.colorSwatchPickerValueController.updateInternalColor(this.formatColor("input",this.internalColor))}formatColor(t,e){return this.inputFormatter===D.DEFAULT_INPUT_FORMATTER?this.handleHexFormat(t,e):"function"==typeof this.inputFormatter?this.inputFormatter(t,e):e}handleHexFormat(t,e){return"input"===t?e.startsWith("#")?e.slice(1):e:e.startsWith("#")?e:e?`#${e}`:e}}D.DEFAULT_INPUT_FORMATTER="hexColorFormatter",T([c()],D.prototype,"inputFormatter",void 0),T([c()],D.prototype,"internalColor",void 0),T([c()],D.prototype,"colorSwatchPickerValueController",void 0),T([p("watchInputFormatter")],D.prototype,"updateTheColor",null);var E=function(t,e,i,o){var s,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};class G extends h{constructor(t,i){super(),this.slotElement=null,this.syncSlotElementFromHost=()=>{var t;const i=this.host.querySelector(this.slotSelector());i&&(this.slotElement=i,null===(t=this.getContainerRef())||void 0===t||t.replaceChildren(i),e(this.host))},this.syncRemovedSlotElement=()=>{this.slotElement&&!this.slotElement.isConnected&&(this.slotElement=null,e(this.host))},this.slotName=t,this.getContainerRef=i}hasSlot(){return!!this.slotElement}detectSlot(){this.slotElement=this.host.querySelector(this.slotSelector()),this.hostMutationObserver=new MutationObserver(this.syncSlotElementFromHost),this.hostMutationObserver.observe(this.host,{childList:!0}),this.containerMutationObserver=new MutationObserver(this.syncRemovedSlotElement)}appendSlotContent(){const t=this.getContainerRef();t&&this.containerMutationObserver.observe(t,{childList:!0}),this.slotElement&&t&&this.slotElement.parentElement!==t&&t.appendChild(this.slotElement)}cleanup(){this.hostMutationObserver&&this.hostMutationObserver.disconnect(),this.containerMutationObserver&&this.containerMutationObserver.disconnect()}slotSelector(){return`[slot="${this.slotName}"]`}}E([c()],G.prototype,"host",void 0),E([p("componentWillLoad")],G.prototype,"detectSlot",null),E([p("componentDidRender")],G.prototype,"appendSlotContent",null),E([p("disconnectedCallback")],G.prototype,"cleanup",null);var M=function(t,e,i,o){var s,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};const B=class{constructor(t){i(this,t),this.vegaChange=o(this,"vegaChange",7),this.change=o(this,"change",7),this.globalSlimmers={},this.vegaComponentUsageRuntimeMetricsSlimmer=new a,this.formFieldController=new u({propertyRules:[{propertyName:"required",ruleFactory:t=>t?new n:null}],validationRulesName:"validationRules",defaultValue:"",attributeGetter:t=>this[t],inputContainerGetter:()=>this.colorSwatchPickerRenderer.getContainerRef(),touchableAreaGetter:()=>[]}),this.translationSlimmer=new F,this.leftSlotProjection=new G("swatch-picker-left",(()=>this.colorSwatchPickerRenderer.getLeftContainerRef())),this.colorSwatchPickerRenderer=new I,this.colorSwatchGridRenderer=new V,this.colorSwatchInputRenderer=new P,this.colorSwatchPickerValueController=new H,this.colorSwatchPickerColorFormatController=new D,this.childNodeEventPreventSlimmer=new S([b],(()=>this.colorSwatchPickerRenderer.getContainerRef())),this.changeEventEmitter=x(B,b),this.internalColor="",this.isPopoverOpen=!1,this.value="",this.label="",this.disabled=!1,this.required=!1,this.isValid=null,this.autoValidation=!0,this.validationRules=[],this.colors=["#73E6DC","#806BFF","#FFDC83","#FF9571","#00BBFF","#FF82C9","#259F9F","#563D82"],this.swatchGridColumns=8,this.showInput=!0,this.inputPlaceholder="",this.inputPrefixIcon=P.DEFAULT_INPUT_ICON,this.showClearButton=!1,this.inputFormatter=D.DEFAULT_INPUT_FORMATTER}watchValue(){}watchDisabled(){this.disabled&&this.colorSwatchPickerRenderer.hidePopover()}watchValidationRules(){}watchInputFormatter(){}render(){return f(t(s,{class:{disabled:this.disabled}},this.colorSwatchPickerRenderer.render(),t("div",{class:"vega-error vega-hidden",part:"field-error-message"})),this.host)}get host(){return r(this)}static get watchers(){return{value:["watchValue"],disabled:["watchDisabled"],validationRules:["watchValidationRules"],inputFormatter:["watchInputFormatter"]}}};M([l()],B.prototype,"globalSlimmers",void 0),M([d()],B.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),M([d()],B.prototype,"formFieldController",void 0),M([d()],B.prototype,"translationSlimmer",void 0),M([d()],B.prototype,"leftSlotProjection",void 0),M([d()],B.prototype,"colorSwatchPickerRenderer",void 0),M([d()],B.prototype,"colorSwatchGridRenderer",void 0),M([d()],B.prototype,"colorSwatchInputRenderer",void 0),M([d()],B.prototype,"colorSwatchPickerValueController",void 0),M([d()],B.prototype,"colorSwatchPickerColorFormatController",void 0),M([d()],B.prototype,"childNodeEventPreventSlimmer",void 0),M([d()],B.prototype,"changeEventEmitter",void 0),B.style=':host{display:inline-block}.swatch-picker-container{display:flex;flex-direction:row;align-items:center;gap:8px}.swatch-picker-container.error vega-color-swatch.swatch-picker-trigger::part(swatch){border:1px solid rgba(var(--v-border-input-field-danger, 230, 50, 87, 1))}.swatch-picker-container.error vega-color-swatch.swatch-picker-trigger::part(swatch-container):focus-visible{outline:2px solid rgba(var(--v-border-color-danger, 230, 50, 87, 1));outline-offset:2px}.vega-error{display:inline-block;padding-left:8px;padding-right:8px;padding-top:8px;font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px;color:rgba(var(--v-text-error, 189, 41, 71, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){.vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}.vega-hidden{display:none}';export{B as vega_color_swatch_picker}
|