@prolibu-suite/cobalt-core 0.11.11 → 0.11.12
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/custom-elements.json +107 -34
- package/dist/cjs/co-accordion.cjs.entry.js +5 -5
- package/dist/cjs/co-action-bar.cjs.entry.js +1 -1
- package/dist/cjs/co-app-shell.cjs.entry.js +1 -1
- package/dist/cjs/co-audio-player.cjs.entry.js +1 -1
- package/dist/cjs/co-autocomplete.cjs.entry.js +2 -2
- package/dist/cjs/co-avatar-group.cjs.entry.js +1 -1
- package/dist/cjs/co-avatar.cjs.entry.js +1 -1
- package/dist/cjs/co-badge.cjs.entry.js +1 -1
- package/dist/cjs/co-bottom-sheet.cjs.entry.js +1 -1
- package/dist/cjs/co-breadcrumb-item.cjs.entry.js +1 -1
- package/dist/cjs/co-breadcrumb.cjs.entry.js +1 -1
- package/dist/cjs/co-button-group.cjs.entry.js +1 -1
- package/dist/cjs/co-button.cjs.entry.js +1 -1
- package/dist/cjs/co-calendar-month_2.cjs.entry.js +2 -2
- package/dist/cjs/co-calendar_3.cjs.entry.js +2 -2
- package/dist/cjs/co-card.cjs.entry.js +1 -1
- package/dist/cjs/co-carousel-item.cjs.entry.js +1 -1
- package/dist/cjs/co-carousel.cjs.entry.js +2 -2
- package/dist/cjs/co-checkbox-group.cjs.entry.js +2 -2
- package/dist/cjs/co-checkbox.cjs.entry.js +2 -2
- package/dist/cjs/co-chip_2.cjs.entry.js +6 -6
- package/dist/cjs/co-color-area.cjs.entry.js +1 -1
- package/dist/cjs/co-color-picker.cjs.entry.js +3 -3
- package/dist/cjs/co-color-slider.cjs.entry.js +1 -1
- package/dist/cjs/co-column-picker.cjs.entry.js +2 -2
- package/dist/cjs/co-combobox.cjs.entry.js +2 -2
- package/dist/cjs/co-command-search.cjs.entry.js +2 -2
- package/dist/cjs/co-data-table-pagination.cjs.entry.js +2 -2
- package/dist/cjs/co-data-table.cjs.entry.js +2 -2
- package/dist/cjs/co-date-picker.cjs.entry.js +2 -2
- package/dist/cjs/co-date-range-picker.cjs.entry.js +2 -2
- package/dist/cjs/co-date-range.cjs.entry.js +1 -1
- package/dist/cjs/co-date-time-picker.cjs.entry.js +2 -2
- package/dist/cjs/co-document-editor.cjs.entry.js +2 -2
- package/dist/cjs/co-drive-card.cjs.entry.js +1 -1
- package/dist/cjs/co-drop-zone.cjs.entry.js +1 -1
- package/dist/cjs/co-emoji-picker.cjs.entry.js +2 -2
- package/dist/cjs/co-empty-state.cjs.entry.js +2 -2
- package/dist/cjs/co-event-calendar.cjs.entry.js +1 -1
- package/dist/cjs/co-event-popover.cjs.entry.js +1 -1
- package/dist/cjs/co-fab.cjs.entry.js +1 -1
- package/dist/cjs/co-file-field.cjs.entry.js +3 -3
- package/dist/cjs/co-file-type-tile.cjs.entry.js +1 -1
- package/dist/cjs/co-gradient-bar.cjs.entry.js +1 -1
- package/dist/cjs/co-helper-text.cjs.entry.js +1 -1
- package/dist/cjs/co-icon-button.cjs.entry.js +2 -2
- package/dist/cjs/co-icon.cjs.entry.js +1 -1
- package/dist/cjs/co-input.cjs.entry.js +2 -2
- package/dist/cjs/co-json-field.cjs.entry.js +2 -2
- package/dist/cjs/co-kbd_2.cjs.entry.js +1 -1
- package/dist/cjs/co-lightbox.cjs.entry.js +1 -1
- package/dist/cjs/co-list-footer.cjs.entry.js +1 -1
- package/dist/cjs/co-list-item.cjs.entry.js +2 -2
- package/dist/cjs/co-loader.cjs.entry.js +1 -1
- package/dist/cjs/co-media-thumb.cjs.entry.js +1 -1
- package/dist/cjs/co-menu-divider.cjs.entry.js +1 -1
- package/dist/cjs/co-menu-item.cjs.entry.js +40 -7
- package/dist/cjs/co-menu.cjs.entry.js +2 -2
- package/dist/cjs/co-modal.cjs.entry.js +2 -2
- package/dist/cjs/co-navbar.cjs.entry.js +1 -1
- package/dist/cjs/co-number-field.cjs.entry.js +2 -2
- package/dist/cjs/co-overlay.cjs.entry.js +1 -1
- package/dist/cjs/co-page-header.cjs.entry.js +1 -1
- package/dist/cjs/co-phone-field.cjs.entry.js +4 -4
- package/dist/cjs/co-popover.cjs.entry.js +1 -1
- package/dist/cjs/co-progress-bar.cjs.entry.js +1 -1
- package/dist/cjs/co-progress-circle.cjs.entry.js +2 -2
- package/dist/cjs/co-provider-logo_2.cjs.entry.js +2 -2
- package/dist/cjs/co-radio-group.cjs.entry.js +1 -1
- package/dist/cjs/co-radio.cjs.entry.js +2 -2
- package/dist/cjs/co-rating.cjs.entry.js +2 -2
- package/dist/cjs/co-ref-field.cjs.entry.js +3 -3
- package/dist/cjs/co-rich-text-editor.cjs.entry.js +2 -2
- package/dist/cjs/co-rich-text-toolbar.cjs.entry.js +1 -1
- package/dist/cjs/co-rich-text-viewer.cjs.entry.js +1 -1
- package/dist/cjs/co-row.cjs.entry.js +1 -1
- package/dist/cjs/co-segmented-bar.cjs.entry.js +1 -1
- package/dist/cjs/co-select.cjs.entry.js +2 -2
- package/dist/cjs/co-separator.cjs.entry.js +1 -1
- package/dist/cjs/co-sidebar-nav.cjs.entry.js +1 -1
- package/dist/cjs/co-sidebar.cjs.entry.js +1 -1
- package/dist/cjs/co-slider.cjs.entry.js +2 -2
- package/dist/cjs/co-swatch-grid.cjs.entry.js +1 -1
- package/dist/cjs/co-switch.cjs.entry.js +3 -3
- package/dist/cjs/co-tab-group.cjs.entry.js +2 -2
- package/dist/cjs/co-tab.cjs.entry.js +2 -2
- package/dist/cjs/co-tags-field.cjs.entry.js +4 -4
- package/dist/cjs/co-textarea.cjs.entry.js +2 -2
- package/dist/cjs/co-tile.cjs.entry.js +1 -1
- package/dist/cjs/co-time-field.cjs.entry.js +1 -1
- package/dist/cjs/co-toast.cjs.entry.js +1 -1
- package/dist/cjs/co-toggle-button-group.cjs.entry.js +1 -1
- package/dist/cjs/co-toggle-button.cjs.entry.js +2 -2
- package/dist/cjs/co-transfer-list.cjs.entry.js +2 -2
- package/dist/cjs/co-tree-item.cjs.entry.js +2 -2
- package/dist/cjs/co-video.cjs.entry.js +2 -2
- package/dist/cjs/cobalt.cjs.js +2 -2
- package/dist/cjs/{fieldChip-DbYMfylq.js → fieldChip-D-x9bJ-W.js} +1 -1
- package/dist/cjs/{index-bHoidDwv.js → index-CuskTAyj.js} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{requiredMark-21yHvvZS.js → requiredMark-ooEZAZbC.js} +1 -1
- package/dist/cobalt/cobalt.css +1 -1
- package/dist/cobalt/cobalt.esm.js +1 -1
- package/dist/cobalt/{p-d9b4594b.entry.js → p-011fd3ca.entry.js} +1 -1
- package/dist/cobalt/{p-33840969.entry.js → p-038cc50a.entry.js} +1 -1
- package/dist/cobalt/{p-d375c84e.entry.js → p-052289b3.entry.js} +1 -1
- package/dist/cobalt/{p-bbf3d859.entry.js → p-05f0feca.entry.js} +1 -1
- package/dist/cobalt/p-05f90173.entry.js +1 -0
- package/dist/cobalt/{p-c004fde5.entry.js → p-09ff5302.entry.js} +1 -1
- package/dist/cobalt/{p-d26dc681.entry.js → p-0bd8e079.entry.js} +1 -1
- package/dist/cobalt/{p-5a32b9a2.entry.js → p-0d163b25.entry.js} +1 -1
- package/dist/cobalt/{p-cea21e08.entry.js → p-0d2deeaa.entry.js} +1 -1
- package/dist/cobalt/{p-94b871fb.entry.js → p-0ea06cee.entry.js} +1 -1
- package/dist/cobalt/{p-a18c01eb.entry.js → p-1288867e.entry.js} +1 -1
- package/dist/cobalt/p-1318c5b9.entry.js +1 -0
- package/dist/cobalt/{p-15d995b4.entry.js → p-134331e6.entry.js} +1 -1
- package/dist/cobalt/p-1361f386.entry.js +1 -0
- package/dist/cobalt/{p-3e532a11.entry.js → p-15e29500.entry.js} +1 -1
- package/dist/cobalt/{p-feec49a4.entry.js → p-16eb0771.entry.js} +1 -1
- package/dist/cobalt/{p-3b5024ce.entry.js → p-19544796.entry.js} +1 -1
- package/dist/cobalt/{p-71ee36a8.entry.js → p-1cc15af6.entry.js} +1 -1
- package/dist/cobalt/{p-a27013e6.entry.js → p-1ef7bbbc.entry.js} +1 -1
- package/dist/cobalt/{p-b402665a.entry.js → p-20651254.entry.js} +1 -1
- package/dist/cobalt/{p-353ff9ed.entry.js → p-24456175.entry.js} +1 -1
- package/dist/cobalt/{p-d1e83525.entry.js → p-2d76fafb.entry.js} +1 -1
- package/dist/cobalt/{p-dabcbba7.entry.js → p-2f44a37b.entry.js} +1 -1
- package/dist/cobalt/{p-37f9ec35.entry.js → p-3842ac1a.entry.js} +1 -1
- package/dist/cobalt/{p-6b88a52c.entry.js → p-388f5a71.entry.js} +1 -1
- package/dist/cobalt/{p-59a71695.entry.js → p-45460f75.entry.js} +1 -1
- package/dist/cobalt/{p-4ae6fe0e.entry.js → p-4e1ba090.entry.js} +1 -1
- package/dist/cobalt/{p-1c9253a2.entry.js → p-4ee87962.entry.js} +1 -1
- package/dist/cobalt/{p-d7775109.entry.js → p-5009ad0a.entry.js} +1 -1
- package/dist/cobalt/p-5259c731.entry.js +1 -0
- package/dist/cobalt/{p-600d0cab.entry.js → p-5aaaa257.entry.js} +1 -1
- package/dist/cobalt/{p-83691cfb.entry.js → p-5b098a4c.entry.js} +1 -1
- package/dist/cobalt/{p-f1da1df1.entry.js → p-5d17b6e9.entry.js} +1 -1
- package/dist/cobalt/{p-f6f273f7.entry.js → p-5e04cecc.entry.js} +1 -1
- package/dist/cobalt/{p-efb3cbb0.entry.js → p-63c588e1.entry.js} +1 -1
- package/dist/cobalt/{p-f562bd96.entry.js → p-63e5d7fe.entry.js} +1 -1
- package/dist/cobalt/{p-fb6671e0.entry.js → p-65e0176c.entry.js} +1 -1
- package/dist/cobalt/{p-e5350eeb.entry.js → p-66375026.entry.js} +1 -1
- package/dist/cobalt/{p-74804c79.entry.js → p-669ad1c6.entry.js} +1 -1
- package/dist/cobalt/{p-5d41b58b.entry.js → p-66a07095.entry.js} +1 -1
- package/dist/cobalt/{p-4e81e580.entry.js → p-67fac886.entry.js} +1 -1
- package/dist/cobalt/{p-12fc5119.entry.js → p-6a270d5d.entry.js} +1 -1
- package/dist/cobalt/{p-89328cd8.entry.js → p-6bb9964f.entry.js} +1 -1
- package/dist/cobalt/{p-9af26af0.entry.js → p-6c35584c.entry.js} +1 -1
- package/dist/cobalt/{p-019eed8e.entry.js → p-6d12e825.entry.js} +1 -1
- package/dist/cobalt/{p-9125252a.entry.js → p-6fe227e0.entry.js} +1 -1
- package/dist/cobalt/p-71a289f9.entry.js +1 -0
- package/dist/cobalt/{p-b6463d35.entry.js → p-71f9fa68.entry.js} +1 -1
- package/dist/cobalt/{p-3890d22f.entry.js → p-741c14af.entry.js} +1 -1
- package/dist/cobalt/{p-76ea3f34.entry.js → p-7550fc02.entry.js} +1 -1
- package/dist/cobalt/{p-7737354e.entry.js → p-76244cca.entry.js} +1 -1
- package/dist/cobalt/{p-be520bd5.entry.js → p-79b62ce3.entry.js} +1 -1
- package/dist/cobalt/{p-6eca1c7c.entry.js → p-7be0f85b.entry.js} +1 -1
- package/dist/cobalt/{p-a4154bcf.entry.js → p-811f1dd7.entry.js} +1 -1
- package/dist/cobalt/{p-9ce57385.entry.js → p-88edf7d0.entry.js} +1 -1
- package/dist/cobalt/{p-c23630ab.entry.js → p-894f59ce.entry.js} +1 -1
- package/dist/cobalt/{p-0f3a3232.entry.js → p-8b2432b2.entry.js} +1 -1
- package/dist/cobalt/{p-299c2425.entry.js → p-8bf0975d.entry.js} +1 -1
- package/dist/cobalt/p-90823b79.entry.js +1 -0
- package/dist/cobalt/{p-5e14f676.entry.js → p-9a307b64.entry.js} +1 -1
- package/dist/cobalt/p-9a3e631e.entry.js +1 -0
- package/dist/cobalt/{p-3878f174.entry.js → p-9c00499b.entry.js} +1 -1
- package/dist/cobalt/p-C_xES1w3.js +1 -0
- package/dist/cobalt/{p-DJkaRtbb.js → p-YRicbXh3.js} +2 -2
- package/dist/cobalt/{p-3b7e90c8.entry.js → p-a6516907.entry.js} +1 -1
- package/dist/cobalt/{p-b723aa47.entry.js → p-a671facd.entry.js} +1 -1
- package/dist/cobalt/{p-e4646a0e.entry.js → p-a679c368.entry.js} +1 -1
- package/dist/cobalt/{p-a33a277a.entry.js → p-a9242183.entry.js} +1 -1
- package/dist/cobalt/{p-2ff8f591.entry.js → p-ac1565df.entry.js} +1 -1
- package/dist/cobalt/{p-3bff827a.entry.js → p-ac963082.entry.js} +1 -1
- package/dist/cobalt/{p-50ab6b9b.entry.js → p-ae66e746.entry.js} +1 -1
- package/dist/cobalt/{p-438cc876.entry.js → p-af8cc16e.entry.js} +1 -1
- package/dist/cobalt/{p-02133c95.entry.js → p-b3994c94.entry.js} +1 -1
- package/dist/cobalt/{p-53a251ca.entry.js → p-be860577.entry.js} +1 -1
- package/dist/cobalt/{p-c220362c.entry.js → p-be9f69e4.entry.js} +1 -1
- package/dist/cobalt/{p-5e39cf70.entry.js → p-bf8212cf.entry.js} +1 -1
- package/dist/cobalt/{p-cb1013e6.entry.js → p-c01454be.entry.js} +1 -1
- package/dist/cobalt/{p-eab59be5.entry.js → p-c0f579d9.entry.js} +1 -1
- package/dist/cobalt/{p-4a7fd0b4.entry.js → p-c4bbb701.entry.js} +1 -1
- package/dist/cobalt/{p-4cdfcd9c.entry.js → p-c5978c46.entry.js} +1 -1
- package/dist/cobalt/{p-8a26f3cc.entry.js → p-c71b736c.entry.js} +1 -1
- package/dist/cobalt/{p-82bcd062.entry.js → p-ce9a3708.entry.js} +1 -1
- package/dist/cobalt/{p-04e3e1f6.entry.js → p-d0129851.entry.js} +1 -1
- package/dist/cobalt/p-d127a7c4.entry.js +1 -0
- package/dist/cobalt/p-d1293695.entry.js +1 -0
- package/dist/cobalt/{p-d1595580.entry.js → p-d525aec4.entry.js} +1 -1
- package/dist/cobalt/p-ddf6083f.entry.js +1 -0
- package/dist/cobalt/{p-8e7ad2fe.entry.js → p-e0b542ad.entry.js} +1 -1
- package/dist/cobalt/{p-63f888a1.entry.js → p-e120435e.entry.js} +1 -1
- package/dist/cobalt/{p-a4264bde.entry.js → p-e71f6186.entry.js} +1 -1
- package/dist/cobalt/{p-ff218d09.entry.js → p-ea2cc20e.entry.js} +1 -1
- package/dist/cobalt/{p-c026968c.entry.js → p-ebcdc0b2.entry.js} +1 -1
- package/dist/cobalt/{p-3e864e7d.entry.js → p-ec11b337.entry.js} +1 -1
- package/dist/cobalt/{p-a6c9a0c5.entry.js → p-eca12c29.entry.js} +1 -1
- package/dist/cobalt/{p-19f0f534.entry.js → p-f3975988.entry.js} +1 -1
- package/dist/cobalt/{p-7e678cbd.entry.js → p-f9937237.entry.js} +1 -1
- package/dist/cobalt/{p-0bbaaf4f.entry.js → p-fa4a59e8.entry.js} +1 -1
- package/dist/cobalt/{p-f23f52ed.entry.js → p-fd15353a.entry.js} +1 -1
- package/dist/cobalt/p-pl89alJ1.js +1 -0
- package/dist/collection/components/co-accordion/co-accordion.css +1 -1
- package/dist/collection/components/co-accordion/co-accordion.js +3 -3
- package/dist/collection/components/co-autocomplete/co-autocomplete.js +1 -1
- package/dist/collection/components/co-avatar-group/co-avatar-group.js +1 -1
- package/dist/collection/components/co-calendar-month/co-calendar-month.css +9 -4
- package/dist/collection/components/co-carousel/co-carousel.css +7 -5
- package/dist/collection/components/co-checkbox/co-checkbox.css +12 -17
- package/dist/collection/components/co-checkbox-group/co-checkbox-group.css +4 -2
- package/dist/collection/components/co-checkbox-group/co-checkbox-group.js +1 -1
- package/dist/collection/components/co-chip/co-chip.css +14 -1
- package/dist/collection/components/co-color-area/co-color-area.js +2 -2
- package/dist/collection/components/co-color-picker/co-color-picker.css +4 -4
- package/dist/collection/components/co-color-slider/co-color-slider.js +1 -1
- package/dist/collection/components/co-column-picker/co-column-picker.css +12 -2
- package/dist/collection/components/co-combobox/co-combobox.js +1 -1
- package/dist/collection/components/co-command-search/co-command-search.css +1 -1
- package/dist/collection/components/co-command-search/co-command-search.js +1 -1
- package/dist/collection/components/co-data-table/co-data-table.css +20 -10
- package/dist/collection/components/co-data-table/co-data-table.js +1 -1
- package/dist/collection/components/co-data-table-pagination/co-data-table-pagination.css +11 -3
- package/dist/collection/components/co-date-range-picker/co-date-range-picker.js +2 -2
- package/dist/collection/components/co-document-editor/co-document-editor.css +10 -7
- package/dist/collection/components/co-document-editor/co-document-editor.js +5 -5
- package/dist/collection/components/co-emoji-picker/co-emoji-picker.css +3 -3
- package/dist/collection/components/co-empty-state/co-empty-state.css +7 -4
- package/dist/collection/components/co-file-field/co-file-field.css +3 -1
- package/dist/collection/components/co-icon-button/co-icon-button.css +1 -1
- package/dist/collection/components/co-list-item/co-list-item.css +6 -0
- package/dist/collection/components/co-menu/co-menu.css +4 -2
- package/dist/collection/components/co-menu-item/co-menu-item.css +14 -5
- package/dist/collection/components/co-menu-item/co-menu-item.js +80 -7
- package/dist/collection/components/co-option-list/co-option-list.css +12 -4
- package/dist/collection/components/co-option-list/co-option-list.js +3 -3
- package/dist/collection/components/co-phone-field/co-phone-field.css +12 -3
- package/dist/collection/components/co-phone-field/co-phone-field.js +1 -1
- package/dist/collection/components/co-popover/co-popover.js +1 -1
- package/dist/collection/components/co-progress-circle/co-progress-circle.css +3 -1
- package/dist/collection/components/co-radio/co-radio.css +10 -1
- package/dist/collection/components/co-radio-group/co-radio-group.js +1 -1
- package/dist/collection/components/co-rating/co-rating.css +3 -1
- package/dist/collection/components/co-ref-field/co-ref-field.js +4 -4
- package/dist/collection/components/co-segmented-bar/co-segmented-bar.js +1 -1
- package/dist/collection/components/co-select/co-select.js +1 -1
- package/dist/collection/components/co-sidebar-nav/co-sidebar-nav.js +1 -1
- package/dist/collection/components/co-skeleton/co-skeleton.css +6 -3
- package/dist/collection/components/co-slider/co-slider.css +21 -1
- package/dist/collection/components/co-switch/co-switch.css +10 -4
- package/dist/collection/components/co-tab/co-tab.css +14 -8
- package/dist/collection/components/co-tab-group/co-tab-group.css +15 -9
- package/dist/collection/components/co-tags-field/co-tags-field.css +3 -2
- package/dist/collection/components/co-toast/co-toast.js +2 -2
- package/dist/collection/components/co-toggle-button/co-toggle-button.css +10 -4
- package/dist/collection/components/co-transfer-list/co-transfer-list.css +4 -2
- package/dist/collection/components/co-transfer-list/co-transfer-list.js +1 -1
- package/dist/collection/components/co-tree-item/co-tree-item.css +1 -1
- package/dist/collection/components/co-tree-item/co-tree-item.js +2 -2
- package/dist/collection/components/co-video/co-video.css +5 -3
- package/dist/collection/utils/dragMove.js +1 -1
- package/dist/components/co-accordion.js +1 -1
- package/dist/components/co-action-bar.js +1 -1
- package/dist/components/co-autocomplete.js +1 -1
- package/dist/components/co-calendar-month.js +1 -1
- package/dist/components/co-calendar-timegrid.js +1 -1
- package/dist/components/co-carousel.js +1 -1
- package/dist/components/co-checkbox-group.js +1 -1
- package/dist/components/co-checkbox.js +1 -1
- package/dist/components/co-chip.js +1 -1
- package/dist/components/co-color-picker.js +1 -1
- package/dist/components/co-column-picker.js +1 -1
- package/dist/components/co-combobox.js +1 -1
- package/dist/components/co-command-search.js +1 -1
- package/dist/components/co-data-table-pagination.js +1 -1
- package/dist/components/co-data-table.js +1 -1
- package/dist/components/co-document-editor.js +1 -1
- package/dist/components/co-emoji-picker.js +1 -1
- package/dist/components/co-empty-state.js +1 -1
- package/dist/components/co-event-calendar.js +1 -1
- package/dist/components/co-file-field.js +1 -1
- package/dist/components/co-icon-button.js +1 -1
- package/dist/components/co-lightbox.js +1 -1
- package/dist/components/co-list-item.js +1 -1
- package/dist/components/co-menu-item.js +1 -1
- package/dist/components/co-menu.js +1 -1
- package/dist/components/co-modal.js +1 -1
- package/dist/components/co-option-list.js +1 -1
- package/dist/components/co-phone-field.js +1 -1
- package/dist/components/co-progress-circle.js +1 -1
- package/dist/components/co-radio.js +1 -1
- package/dist/components/co-rating.js +1 -1
- package/dist/components/co-ref-field.js +1 -1
- package/dist/components/co-skeleton.js +1 -1
- package/dist/components/co-slider.js +1 -1
- package/dist/components/co-switch.js +1 -1
- package/dist/components/co-tab-group.js +1 -1
- package/dist/components/co-tab.js +1 -1
- package/dist/components/co-tags-field.js +1 -1
- package/dist/components/co-toggle-button.js +1 -1
- package/dist/components/co-transfer-list.js +1 -1
- package/dist/components/co-tree-item.js +1 -1
- package/dist/components/co-video.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/{p-COCcx0DN.js → p-4nVctQq9.js} +1 -1
- package/dist/components/p-BDk4ffI3.js +1 -0
- package/dist/components/p-BXDvRVSp.js +1 -0
- package/dist/components/{p-rfvTj6cP.js → p-C1WNmtGN.js} +1 -1
- package/dist/components/p-CV7I0t8n.js +1 -0
- package/dist/components/p-CpwIdVV5.js +1 -0
- package/dist/components/{p-DMW9TJ7Z.js → p-Ct4MpUdn.js} +1 -1
- package/dist/components/{p-R1W48hzW.js → p-CxXO0llX.js} +1 -1
- package/dist/components/p-DpnlSVX3.js +1 -0
- package/dist/components/{p-BMyWdiVO.js → p-y-UE-CLu.js} +1 -1
- package/dist/esm/co-accordion.entry.js +5 -5
- package/dist/esm/co-action-bar.entry.js +1 -1
- package/dist/esm/co-app-shell.entry.js +1 -1
- package/dist/esm/co-audio-player.entry.js +1 -1
- package/dist/esm/co-autocomplete.entry.js +2 -2
- package/dist/esm/co-avatar-group.entry.js +1 -1
- package/dist/esm/co-avatar.entry.js +1 -1
- package/dist/esm/co-badge.entry.js +1 -1
- package/dist/esm/co-bottom-sheet.entry.js +1 -1
- package/dist/esm/co-breadcrumb-item.entry.js +1 -1
- package/dist/esm/co-breadcrumb.entry.js +1 -1
- package/dist/esm/co-button-group.entry.js +1 -1
- package/dist/esm/co-button.entry.js +1 -1
- package/dist/esm/co-calendar-month_2.entry.js +2 -2
- package/dist/esm/co-calendar_3.entry.js +2 -2
- package/dist/esm/co-card.entry.js +1 -1
- package/dist/esm/co-carousel-item.entry.js +1 -1
- package/dist/esm/co-carousel.entry.js +2 -2
- package/dist/esm/co-checkbox-group.entry.js +2 -2
- package/dist/esm/co-checkbox.entry.js +2 -2
- package/dist/esm/co-chip_2.entry.js +6 -6
- package/dist/esm/co-color-area.entry.js +1 -1
- package/dist/esm/co-color-picker.entry.js +3 -3
- package/dist/esm/co-color-slider.entry.js +1 -1
- package/dist/esm/co-column-picker.entry.js +2 -2
- package/dist/esm/co-combobox.entry.js +2 -2
- package/dist/esm/co-command-search.entry.js +2 -2
- package/dist/esm/co-data-table-pagination.entry.js +2 -2
- package/dist/esm/co-data-table.entry.js +2 -2
- package/dist/esm/co-date-picker.entry.js +2 -2
- package/dist/esm/co-date-range-picker.entry.js +2 -2
- package/dist/esm/co-date-range.entry.js +1 -1
- package/dist/esm/co-date-time-picker.entry.js +2 -2
- package/dist/esm/co-document-editor.entry.js +2 -2
- package/dist/esm/co-drive-card.entry.js +1 -1
- package/dist/esm/co-drop-zone.entry.js +1 -1
- package/dist/esm/co-emoji-picker.entry.js +2 -2
- package/dist/esm/co-empty-state.entry.js +2 -2
- package/dist/esm/co-event-calendar.entry.js +1 -1
- package/dist/esm/co-event-popover.entry.js +1 -1
- package/dist/esm/co-fab.entry.js +1 -1
- package/dist/esm/co-file-field.entry.js +3 -3
- package/dist/esm/co-file-type-tile.entry.js +1 -1
- package/dist/esm/co-gradient-bar.entry.js +1 -1
- package/dist/esm/co-helper-text.entry.js +1 -1
- package/dist/esm/co-icon-button.entry.js +2 -2
- package/dist/esm/co-icon.entry.js +1 -1
- package/dist/esm/co-input.entry.js +2 -2
- package/dist/esm/co-json-field.entry.js +2 -2
- package/dist/esm/co-kbd_2.entry.js +1 -1
- package/dist/esm/co-lightbox.entry.js +1 -1
- package/dist/esm/co-list-footer.entry.js +1 -1
- package/dist/esm/co-list-item.entry.js +2 -2
- package/dist/esm/co-loader.entry.js +1 -1
- package/dist/esm/co-media-thumb.entry.js +1 -1
- package/dist/esm/co-menu-divider.entry.js +1 -1
- package/dist/esm/co-menu-item.entry.js +40 -7
- package/dist/esm/co-menu.entry.js +2 -2
- package/dist/esm/co-modal.entry.js +2 -2
- package/dist/esm/co-navbar.entry.js +1 -1
- package/dist/esm/co-number-field.entry.js +2 -2
- package/dist/esm/co-overlay.entry.js +1 -1
- package/dist/esm/co-page-header.entry.js +1 -1
- package/dist/esm/co-phone-field.entry.js +4 -4
- package/dist/esm/co-popover.entry.js +1 -1
- package/dist/esm/co-progress-bar.entry.js +1 -1
- package/dist/esm/co-progress-circle.entry.js +2 -2
- package/dist/esm/co-provider-logo_2.entry.js +2 -2
- package/dist/esm/co-radio-group.entry.js +1 -1
- package/dist/esm/co-radio.entry.js +2 -2
- package/dist/esm/co-rating.entry.js +2 -2
- package/dist/esm/co-ref-field.entry.js +3 -3
- package/dist/esm/co-rich-text-editor.entry.js +2 -2
- package/dist/esm/co-rich-text-toolbar.entry.js +1 -1
- package/dist/esm/co-rich-text-viewer.entry.js +1 -1
- package/dist/esm/co-row.entry.js +1 -1
- package/dist/esm/co-segmented-bar.entry.js +1 -1
- package/dist/esm/co-select.entry.js +2 -2
- package/dist/esm/co-separator.entry.js +1 -1
- package/dist/esm/co-sidebar-nav.entry.js +1 -1
- package/dist/esm/co-sidebar.entry.js +1 -1
- package/dist/esm/co-slider.entry.js +2 -2
- package/dist/esm/co-swatch-grid.entry.js +1 -1
- package/dist/esm/co-switch.entry.js +3 -3
- package/dist/esm/co-tab-group.entry.js +2 -2
- package/dist/esm/co-tab.entry.js +2 -2
- package/dist/esm/co-tags-field.entry.js +4 -4
- package/dist/esm/co-textarea.entry.js +2 -2
- package/dist/esm/co-tile.entry.js +1 -1
- package/dist/esm/co-time-field.entry.js +1 -1
- package/dist/esm/co-toast.entry.js +1 -1
- package/dist/esm/co-toggle-button-group.entry.js +1 -1
- package/dist/esm/co-toggle-button.entry.js +2 -2
- package/dist/esm/co-transfer-list.entry.js +2 -2
- package/dist/esm/co-tree-item.entry.js +2 -2
- package/dist/esm/co-video.entry.js +2 -2
- package/dist/esm/cobalt.js +3 -3
- package/dist/esm/{fieldChip-B0N8z5W-.js → fieldChip-DFpKjAN_.js} +1 -1
- package/dist/esm/{index-DJkaRtbb.js → index-YRicbXh3.js} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{requiredMark-D5C5NzOE.js → requiredMark-BNC0WBDk.js} +1 -1
- package/dist/types/components/co-menu-item/co-menu-item.d.ts +30 -4
- package/dist/types/components.d.ts +26 -4
- package/package.json +4 -4
- package/dist/cobalt/p-01b54d81.entry.js +0 -1
- package/dist/cobalt/p-21b4a830.entry.js +0 -1
- package/dist/cobalt/p-256ca457.entry.js +0 -1
- package/dist/cobalt/p-7e444408.entry.js +0 -1
- package/dist/cobalt/p-7e72720a.entry.js +0 -1
- package/dist/cobalt/p-84ad0227.entry.js +0 -1
- package/dist/cobalt/p-947b8e35.entry.js +0 -1
- package/dist/cobalt/p-CSLjZ3WO.js +0 -1
- package/dist/cobalt/p-CYN5B3IQ.js +0 -1
- package/dist/cobalt/p-bee52042.entry.js +0 -1
- package/dist/cobalt/p-c93be2d5.entry.js +0 -1
- package/dist/cobalt/p-fb731600.entry.js +0 -1
- package/dist/components/p-B70R6xWE.js +0 -1
- package/dist/components/p-BGNXvnDr.js +0 -1
- package/dist/components/p-BSt2t5Fy.js +0 -1
- package/dist/components/p-BfDYq7JS.js +0 -1
- package/dist/components/p-CwRoHnzq.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,c as t,h as o,a as r}from"./p-DJkaRtbb.js";import{R as i}from"./p-LnW75kr5.js";import{g as a}from"./p-EtYK1iGx.js";import{E as n,p as c,a as s,b as l,c as b,s as d,d as u}from"./p-BmdKHBZP.js";import{R as h}from"./p-CYN5B3IQ.js";import"./p-CqQobidl.js";import"./p-B2QLgWrz.js";import"./p-CRxTFT_z.js";const p=class{constructor(o){e(this,o),this.coInput=t(this,"coInput",7),this.coChange=t(this,"coChange",7),this.coFocus=t(this,"coFocus",7),this.coBlur=t(this,"coBlur",7),this.coClear=t(this,"coClear",7),this.coReady=t(this,"coReady",7),this.coFontPopupShow=t(this,"coFontPopupShow",7),this.coFontPopupHide=t(this,"coFontPopupHide",7),this.coAttachmentsSelected=t(this,"coAttachmentsSelected",7),this.value=null,this.preset="task",this.placeholder="",this.status="default",this.variant="default",this.disabled=!1,this.readonly=!1,this.required=!1,this.showCharacterCount=!1,this.autofocus=!1,this.toolbar="auto",this.toolbarPosition="top",this.attachmentsEnabled=!1,this.locale="en",this.ready=!1,this.hasFocus=!1,this.charCount=0,this.bubbleDragged=!1,this.bubbleDragOffset={x:0,y:0},this.bubbleDragPos={x:0,y:0},this.bubblePositionLocked=!1,this.bubbleLockPos={x:0,y:0},this.applyingBubbleLock=!1,this._loadedAccountFonts=[],this._fontLoaderCalled=!1,this._fontLoaderLoading=!1,this.echo=new n,this.applyingExternal=!1,this.rt=i,this.imgLayoutVisible=!1,this.loaded=!1,this.onToolbarMousedown=()=>{this.closeBubbleDropdowns()},this.onToolbarPopoverChange=e=>{var t;const o=null===(t=e.detail)||void 0===t?void 0:t.open;this.suppressBubble(!!o)},this.handleUpdate=e=>{if(this.refreshCharCount(),this.applyingExternal)return;const t=this.buildOutput(e);this.echo.markEmitted(t),this.coInput.emit(t),this.readonly&&this.coChange.emit(t)},this.handleFocus=()=>{this.hasFocus=!0,this.coFocus.emit()},this.handleBlur=()=>{clearTimeout(this.blurTimeout),this.blurTimeout=setTimeout((()=>{var e,t;(null===(e=this.editor)||void 0===e?void 0:e.isFocused)||(null===(t=this.bubbleEl)||void 0===t?void 0:t.contains(document.activeElement))||(this.hasFocus=!1,this.editor&&this.coChange.emit(this.buildOutput(this.editor)),this.coBlur.emit())}),100)}}connectedCallback(){this.loaded&&!this.editor&&this.mountEditor()}async componentDidLoad(){this.mountEditor(),this.loaded=!0}mountEditor(){var e,t;if(!this.contentEl)return;const o=this.loaded,r="none"!==this.resolvedToolbar&&!this.readonly&&!this.disabled;r&&(this.bubbleEl=this.createBubbleElement());const i=void 0===this.detachedContent,a=i?c(this.value):this.detachedContent;this.detachedContent=void 0,this.editor=this.rt.createEditor({preset:this.preset,element:this.contentEl,content:a,editable:!this.disabled&&!this.readonly,placeholder:this.placeholder,maxLength:this.maxLength,features:this.parsedFeatures,customExtensions:null!==(e=this.customExtensions)&&void 0!==e?e:[],bubbleMenuElement:this.bubbleEl,imageUpload:this.imageUpload,onUpdate:e=>this.handleUpdate(e),onFocus:()=>this.handleFocus(),onBlur:()=>this.handleBlur()}),"document"===this.preset&&this.contentEl.classList.add("co-rte-content--site"),r&&this.imagesEnabled&&(this.contentEl.style.position="relative",this.imgLayoutEl=this.createImageLayoutBar(),this.contentEl.appendChild(this.imgLayoutEl)),this.editor.on("transaction",(({transaction:e})=>{this.bubbleEl&&(this.updateBubbleActiveStates(),(this.bubbleDragged||this.bubblePositionLocked)&&this.bubbleEl&&this.applyBubbleFixedPosition()),this.imagesEnabled&&e.docChanged&&this.syncImageLayouts(),this.updateImageLayoutBar()})),this.bubbleEl&&this.toolbarEl&&(this.toolbarEl.addEventListener("mousedown",this.onToolbarMousedown),this.toolbarEl.addEventListener("coPopoverChange",this.onToolbarPopoverChange)),i&&this.echo.seed(null!==(t=this.value)&&void 0!==t?t:null),this.ready=!0,this.refreshCharCount(),this.syncToolbar(),this.coReady.emit(),this.autofocus&&!o&&this.editor.commands.focus(),requestAnimationFrame((()=>this.syncImageLayouts()))}disconnectedCallback(){queueMicrotask((()=>{"undefined"!=typeof window&&(this.el.isConnected||this.teardownEditor())}))}teardownEditor(){var e,t,o;clearTimeout(this.blurTimeout),clearTimeout(this.bubbleLockTimer),null===(e=this.bubbleStyleObserver)||void 0===e||e.disconnect(),this.bubbleDragMoveHandler&&document.removeEventListener("mousemove",this.bubbleDragMoveHandler),this.bubbleDragEndHandler&&document.removeEventListener("mouseup",this.bubbleDragEndHandler),this.bubbleOutsideClickHandler&&document.removeEventListener("click",this.bubbleOutsideClickHandler,!0),this.editor&&(this.detachedContent=this.editor.isEmpty?null:this.editor.getJSON(),this.editor.destroy()),this.editor=void 0,null===(t=this.bubbleEl)||void 0===t||t.remove(),this.bubbleEl=void 0,null===(o=this.imgLayoutEl)||void 0===o||o.remove(),this.imgLayoutEl=void 0,this.imgLayoutVisible=!1}componentDidRender(){this.syncToolbar()}onAccountFontsChange(){var e;if(this._fontDropdownRenderFn){const t=(null===(e=this._fontDropdownSearchInput)||void 0===e?void 0:e.value)||"";this._fontDropdownRenderFn(t)}}onValueChange(e){if(!this.editor)return void(this.loaded&&(this.detachedContent=void 0));if(this.applyingExternal)return;const t=null!=e?e:null;if(!this.echo.isEcho(t)){this.applyingExternal=!0;try{s(this.editor,t)}finally{this.applyingExternal=!1,this.echo.seed(t),this.refreshCharCount()}}}onEditableChange(){var e;null===(e=this.editor)||void 0===e||e.setEditable(!this.disabled&&!this.readonly)}async getJSON(){return this.editor&&!this.editor.isEmpty?this.editor.getJSON():null}async getHtml(){return this.editor?this.sanitizeHtml(this.editor.getHTML()):""}async getText(){var e,t;return null!==(t=null===(e=this.editor)||void 0===e?void 0:e.getText())&&void 0!==t?t:""}async clear(){this.editor&&(this.editor.commands.clearContent(!0),this.coClear.emit())}async focusEditor(){var e;null===(e=this.editor)||void 0===e||e.commands.focus()}async setContent(e){var t;null===(t=this.editor)||void 0===t||t.commands.setContent(e)}async getEditorInstance(){var e;return null!==(e=this.editor)&&void 0!==e?e:null}get imagesEnabled(){var e;const t=this.parsedFeatures;return null!==(e=null==t?void 0:t.image)&&void 0!==e?e:"document"===this.preset}get parsedFeatures(){return l(this.features)}sanitizeHtml(e){return this.rt.sanitize(e,this.preset,this.parsedFeatures)}buildOutput(e){return b(e,(e=>this.sanitizeHtml(e)))}lockBubblePosition(e=1e3){if(!this.bubbleEl)return;const t=this.bubbleEl.getBoundingClientRect();0!==t.width&&(this.bubbleLockPos={x:t.left,y:t.top},this.bubblePositionLocked=!0,clearTimeout(this.bubbleLockTimer),this.bubbleLockTimer=setTimeout((()=>{this.bubblePositionLocked=!1}),e))}applyBubbleFixedPosition(){if(!this.bubbleEl)return;const e=this.bubbleDragged?this.bubbleDragPos:this.bubbleLockPos;this.applyingBubbleLock=!0,this.bubbleEl.style.position="fixed",this.bubbleEl.style.top=`${e.y}px`,this.bubbleEl.style.left=`${e.x}px`,this.bubbleEl.style.transform="none",this.bubbleEl.style.visibility="visible",requestAnimationFrame((()=>{this.applyingBubbleLock=!1}))}setupBubbleStyleObserver(e){e.addEventListener("co-bubble-hide",(()=>{this.bubbleDragged=!1,this.bubblePositionLocked=!1,clearTimeout(this.bubbleLockTimer),this.closeBubbleDropdowns(),e.style.position="",e.style.top="",e.style.left="",e.style.transform=""})),e.addEventListener("co-bubble-show",(()=>{this.bubbleDragged=!1,this.bubblePositionLocked=!1})),this.bubbleStyleObserver=new MutationObserver((()=>{this.applyingBubbleLock||(this.bubblePositionLocked||this.bubbleDragged)&&this.applyBubbleFixedPosition()})),this.bubbleStyleObserver.observe(e,{attributes:!0,attributeFilter:["style"]})}suppressBubble(e){this.bubbleEl&&(this.bubbleEl.classList.toggle("co-rte-bubble--suppressed",e),e&&this.closeBubbleDropdowns())}closeBubbleDropdowns(){this.bubbleEl&&(this.bubbleEl.querySelectorAll(".co-rte-bubble__select-dropdown").forEach((e=>{e.style.display="none"})),this.bubbleEl.querySelectorAll(".co-rte-bubble__color-dropdown").forEach((e=>{e.style.display="none"})),this.bubbleEl.querySelectorAll(".co-rte-bubble__panel").forEach((e=>{e.style.display="none"})),this.bubbleEl.querySelectorAll(".co-rte-bubble__overflow-menu").forEach((e=>{e.style.display="none"})),this.bubbleLinkFormEl&&(this.bubbleLinkFormEl.style.display="none"))}refreshCharCount(){var e;const t=null===(e=this.editor)||void 0===e?void 0:e.storage;(null==t?void 0:t.characterCount)&&(this.charCount=t.characterCount.characters(),this.charCountEl&&(this.charCountEl.textContent=null!=this.maxLength?`${this.charCount} / ${this.maxLength}`:`${this.charCount}`))}syncToolbar(){d(this.toolbarEl,this.editor,this.imageUpload)}get resolvedToolbar(){return"auto"!==this.toolbar?this.toolbar:this.rt.defaultToolbarForPreset(this.preset)}get resolvedFontFamilies(){if(!this.fontFamilies)return p.DEFAULT_FONTS;if("string"==typeof this.fontFamilies)try{return JSON.parse(this.fontFamilies)}catch(e){return p.DEFAULT_FONTS}return this.fontFamilies}get resolvedAccountFonts(){if(this.accountFonts){if("string"==typeof this.accountFonts)try{return JSON.parse(this.accountFonts)}catch(e){return[]}return this.accountFonts}return this._loadedAccountFonts}registerFontFace(e,t){if(t&&e&&!p._registeredFonts.has(e)){p._registeredFonts.add(e);try{const o=new FontFace(e,`url("${t}")`);o.load().then((()=>document.fonts.add(o))).catch((()=>{}))}catch(e){}}}async loadFontsViaCallback(){var e,t,o;if(!this._fontLoaderCalled&&this.fontLoader){this._fontLoaderCalled=!0,this._fontLoaderLoading=!0,null===(e=this._fontDropdownRenderFn)||void 0===e||e.call(this,"");try{const e=await this.fontLoader();Array.isArray(e)&&(this._loadedAccountFonts=e.map((e=>(e.url&&this.registerFontFace(e.label,e.url),{label:e.label,value:e.value}))))}catch(e){console.error("[co-rich-text-editor] fontLoader error",e)}finally{this._fontLoaderLoading=!1;const e=(null===(t=this._fontDropdownSearchInput)||void 0===t?void 0:t.value)||"";null===(o=this._fontDropdownRenderFn)||void 0===o||o.call(this,e)}}}get helperIcon(){switch(this.status){case"error":case"warning":return"warning-circle";case"success":return"check-circle";default:return"info"}}createBubbleElement(){const e=document.createElement("div");e.className="co-rte-bubble",e.style.visibility="hidden",e.style.position="absolute",e.style.top="0",e.style.left="0",e.addEventListener("mousedown",(e=>{"INPUT"!==e.target.tagName&&e.preventDefault(),this.lockBubblePosition()})),this.bubbleOutsideClickHandler=t=>{e.contains(t.target)||this.closeBubbleDropdowns()},document.addEventListener("click",this.bubbleOutsideClickHandler,!0),this.setupBubbleStyleObserver(e);const t="document"===this.preset;if(t){const t=document.createElement("div");t.className="co-rte-bubble__drag-handle",t.innerHTML='<co-icon name="dots-six-vertical" size="14"></co-icon>',t.addEventListener("mousedown",(t=>{t.preventDefault(),t.stopPropagation();const o=e.getBoundingClientRect();this.bubbleDragOffset={x:t.clientX-o.left,y:t.clientY-o.top},this.bubbleDragged||(this.bubbleDragPos={x:o.left,y:o.top}),this.bubbleDragged=!0,this.bubbleDragMoveHandler=t=>{this.bubbleDragPos.x=t.clientX-this.bubbleDragOffset.x,this.bubbleDragPos.y=t.clientY-this.bubbleDragOffset.y,e.style.position="fixed",e.style.top=`${this.bubbleDragPos.y}px`,e.style.left=`${this.bubbleDragPos.x}px`,e.style.transform="none",e.style.visibility="visible"},this.bubbleDragEndHandler=()=>{document.removeEventListener("mousemove",this.bubbleDragMoveHandler),document.removeEventListener("mouseup",this.bubbleDragEndHandler)},document.addEventListener("mousemove",this.bubbleDragMoveHandler),document.addEventListener("mouseup",this.bubbleDragEndHandler)})),e.appendChild(t)}const o=document.createElement("div");o.className="co-rte-bubble__row";let r=null,i=null,n=null,c=null,s=null,l=null;if(t){const e=this.createBubbleFontFamilySelect();o.appendChild(e),r=this.createBubbleFontSizePanel(),o.appendChild(r.wrap),i=this.createBubbleFontWeightPanel(),o.appendChild(i.wrap),o.appendChild(this.createSep());const t=this.createBubbleColorPicker("textColor",(e=>{this.editor&&this.editor.chain().focus().setColor(e).run()}));o.appendChild(t),o.appendChild(this.createSep())}const b=a(this.locale),d=[{action:"bold",icon:"text-b",label:b.bold,check:"bold"},{action:"italic",icon:"text-italic",label:b.italic,check:"italic"}];"comment"!==this.preset&&d.push({action:"underline",icon:"text-underline",label:b.underline,check:"underline"}),d.forEach((({action:e,icon:t,label:r,check:i})=>{const a=this.createBubbleBtn(t,r,e,i,(()=>{if(!this.editor)return;const t=this.editor.chain().focus();switch(e){case"bold":t.toggleBold().run();break;case"italic":t.toggleItalic().run();break;case"underline":t.toggleUnderline().run()}}));o.appendChild(a)})),o.appendChild(this.createSep()),(t||"email"===this.preset)&&([{align:"left",icon:"text-align-left",label:b.alignLeft},{align:"center",icon:"text-align-center",label:b.center},{align:"right",icon:"text-align-right",label:b.alignRight},{align:"justify",icon:"text-align-justify",label:b.justify}].forEach((({align:e,icon:t,label:r})=>{const i=document.createElement("button");i.type="button",i.className="co-rte-bubble__btn",i.title=r,i.setAttribute("aria-label",r),i.setAttribute("data-action","textAlign"),i.setAttribute("data-align",e),i.innerHTML=`<co-icon name="${t}" size="16"></co-icon>`,i.addEventListener("click",(()=>{this.editor&&this.editor.chain().focus().setTextAlign(e).run()})),o.appendChild(i)})),o.appendChild(this.createSep())),"comment"===this.preset||t||(o.appendChild(this.createBubbleBtn("list-bullets",b.bulletList,"bulletList","bulletList",(()=>{this.editor&&this.editor.chain().focus().toggleBulletList().run()}))),o.appendChild(this.createBubbleBtn("list-numbers",b.orderedList,"orderedList","orderedList",(()=>{this.editor&&this.editor.chain().focus().toggleOrderedList().run()}))),o.appendChild(this.createSep()));const u=this.createBubbleBtn("link",b.link,"link","link",(()=>{this.editor&&this.toggleBubbleLinkForm(!0)}));o.appendChild(u),t&&(o.appendChild(this.createSep()),n=this.createBubbleLineHeightPanel(),c=this.createBubbleLetterSpacingPanel(),s=this.createBubbleBgColorPanel(),l=this.createBubbleOverflowMenu({lineHeight:n,letterSpacing:c,bgColor:s}),o.appendChild(l.overflowWrap)),e.appendChild(o),t&&(r&&e.appendChild(r.panelEl),i&&e.appendChild(i.panelEl),n&&e.appendChild(n),c&&e.appendChild(c),s&&e.appendChild(s));const h=document.createElement("div");h.className="co-rte-bubble__link-form",h.style.display="none",this.bubbleLinkFormEl=h;const p=document.createElement("input");p.type="url",p.className="co-rte-bubble__link-input",p.placeholder="https://...",this.bubbleLinkInputEl=p,p.addEventListener("keydown",(e=>{"Enter"===e.key&&this.submitBubbleLinkImperative(),"Escape"===e.key&&(e.stopPropagation(),this.toggleBubbleLinkForm(!1))}));const f=document.createElement("button");f.type="button",f.className="co-rte-bubble__link-btn",f.innerHTML='<co-icon name="check" size="14"></co-icon>',f.addEventListener("click",(()=>this.submitBubbleLinkImperative()));const m=document.createElement("button");return m.type="button",m.className="co-rte-bubble__link-btn co-rte-bubble__link-unlink",m.title=b.unlinkLink,m.innerHTML='<co-icon name="link-break" size="14"></co-icon>',m.addEventListener("click",(()=>{this.editor&&(this.editor.chain().focus().unsetLink().run(),this.toggleBubbleLinkForm(!1))})),this.bubbleLinkUnlinkEl=m,h.appendChild(p),h.appendChild(f),h.appendChild(m),e.appendChild(h),e}createSep(){const e=document.createElement("span");return e.className="co-rte-bubble__sep",e}positionDropdown(e,t){const o=e.getBoundingClientRect();t.removeAttribute("data-position"),t.style.removeProperty("left"),t.style.removeProperty("transform");const r=t.offsetWidth||224,i=window.innerHeight-o.bottom;if(t.setAttribute("data-position",i>=(t.offsetHeight||320)||i>o.top?"below":"above"),t.classList.contains("co-rte-bubble__color-dropdown")){const o=(e.parentElement||e).getBoundingClientRect(),i=o.left+o.width/2-r/2,a=i+r,n=8;i<n?(t.style.left="0",t.style.transform="none"):a>window.innerWidth-n&&(t.style.left="auto",t.style.right="0",t.style.transform="none")}}positionPanelNearBubble(e){if(!this.bubbleEl)return;const t=this.bubbleEl.querySelector(".co-rte-bubble__overflow-menu"),o=t&&"none"!==t.style.display?t.getBoundingClientRect():this.bubbleEl.getBoundingClientRect(),r=e.offsetHeight||320,i=e.offsetWidth||230;let a=o.top;a+r>window.innerHeight-8&&(a=window.innerHeight-8-r),a<8&&(a=8);let n=o.left-i-4;n<8&&(n=o.right+4),n+i>window.innerWidth-8&&(n=window.innerWidth-8-i),e.style.position="fixed",e.style.top=`${a}px`,e.style.left=`${n}px`,e.style.bottom="auto",e.style.right="auto",e.style.transform="none",e.removeAttribute("data-position")}createBubbleBtn(e,t,o,r,i){const a=document.createElement("button");return a.type="button",a.className="co-rte-bubble__btn",a.title=t,a.setAttribute("aria-label",t),a.setAttribute("data-action",o),a.setAttribute("data-check",r),a.innerHTML=`<co-icon name="${e}" size="16"></co-icon>`,a.addEventListener("click",i),a}createBubbleFontFamilySelect(){const e=document.createElement("div");e.className="co-rte-bubble__select co-rte-bubble__select--font",e.setAttribute("data-select","fontFamily");const t=document.createElement("button");t.type="button",t.className="co-rte-bubble__select-trigger",t.innerHTML='<span class="co-rte-bubble__select-label">Sans-serif</span><co-icon name="caret-down" size="12"></co-icon>';const o=document.createElement("div");o.className="co-rte-bubble__select-dropdown co-rte-bubble__select-dropdown--font",o.style.display="none";const r=document.createElement("div");r.className="co-rte-bubble__font-search";const i=document.createElement("input");i.type="text",i.className="co-rte-bubble__font-search-input",i.placeholder=a(this.locale).searchFont,r.appendChild(i),o.appendChild(r);const n=document.createElement("div");n.className="co-rte-bubble__font-list",o.appendChild(n);const c=(e,r)=>{const a=document.createElement("button");return a.type="button",a.className="co-rte-bubble__select-option",a.setAttribute("data-value",r),a.textContent=e,a.style.fontFamily=r.includes(",")?r:`"${r}", sans-serif`,a.addEventListener("click",(()=>{if(!this.editor)return;this.editor.chain().focus().setFontFamily(r).run(),o.style.display="none";const a=t.querySelector(".co-rte-bubble__select-label");a&&(a.textContent=e),i.value="",this.coFontPopupHide.emit()})),a},s=e=>{n.innerHTML="";const t=e.toLowerCase(),o=this.resolvedAccountFonts,r=this.resolvedFontFamilies,i=t?o.filter((e=>e.label.toLowerCase().includes(t))):o,s=t?r.filter((e=>e.label.toLowerCase().includes(t))):r;if(!i.length&&!s.length){const e=document.createElement("div");return e.className="co-rte-bubble__font-empty",e.textContent=a(this.locale).noResults,void n.appendChild(e)}if((this.fontsLoading||this._fontLoaderLoading)&&!i.length){const e=document.createElement("div");e.className="co-rte-bubble__font-empty",e.textContent=a(this.locale).loadingFonts,n.appendChild(e)}if(i.length){const e=document.createElement("div");e.className="co-rte-bubble__font-section-header",e.textContent=a(this.locale).importedFonts,n.appendChild(e),i.forEach((({label:e,value:t})=>n.appendChild(c(e,t))))}if(s.length){const e=document.createElement("div");e.className="co-rte-bubble__font-section-header",e.textContent=a(this.locale).systemFonts,n.appendChild(e),s.forEach((({label:e,value:t})=>n.appendChild(c(e,t))))}};return i.addEventListener("input",(()=>s(i.value))),this._fontDropdownRenderFn=s,this._fontDropdownSearchInput=i,t.addEventListener("click",(()=>{const r=e.closest(".co-rte-bubble");r&&(r.querySelectorAll(".co-rte-bubble__select-dropdown").forEach((e=>{e!==o&&(e.style.display="none")})),r.querySelectorAll(".co-rte-bubble__color-dropdown").forEach((e=>{e.style.display="none"})));const a="none"!==o.style.display;o.style.display=a?"none":"block",a?this.coFontPopupHide.emit():(this.coFontPopupShow.emit(),this.loadFontsViaCallback(),this.positionDropdown(t,o),s(""),setTimeout((()=>i.focus()),0))})),e.appendChild(t),e.appendChild(o),e}createBubbleSelect(e,t,o,r){const i=document.createElement("div");i.className="co-rte-bubble__select",i.setAttribute("data-select",e);const a=document.createElement("button");a.type="button",a.className="co-rte-bubble__select-trigger",a.innerHTML=`<span class="co-rte-bubble__select-label">${o}</span><co-icon name="caret-down" size="12"></co-icon>`;const n=document.createElement("div");return n.className="co-rte-bubble__select-dropdown",n.style.display="none",t.forEach((({label:t,value:o})=>{const i=document.createElement("button");i.type="button",i.className="co-rte-bubble__select-option",i.setAttribute("data-value",o),i.textContent=t,"fontWeight"===e&&(i.style.fontWeight=o),i.addEventListener("click",(()=>{r(o),n.style.display="none";const e=a.querySelector(".co-rte-bubble__select-label");e&&(e.textContent=t)})),n.appendChild(i)})),a.addEventListener("click",(()=>{const e=i.closest(".co-rte-bubble");e&&(e.querySelectorAll(".co-rte-bubble__select-dropdown").forEach((e=>{e!==n&&(e.style.display="none")})),e.querySelectorAll(".co-rte-bubble__color-dropdown").forEach((e=>{e.style.display="none"})));const t="none"!==n.style.display;n.style.display=t?"none":"block",t||this.positionDropdown(a,n)})),i.appendChild(a),i.appendChild(n),i}createBubbleColorPicker(e,t){const o=document.createElement("div");o.className="co-rte-bubble__color",o.setAttribute("data-color",e);const r="textColor"===e?"":"highlighter",i=document.createElement("button");i.type="button",i.className="co-rte-bubble__btn";const n=a(this.locale);i.title="textColor"===e?n.textColor:n.backgroundColor,i.innerHTML="textColor"===e?'<span class="co-rte-bubble__color-indicator"><span class="co-rte-bubble__color-letter">A</span><span class="co-rte-bubble__color-bar" style="background:#000000"></span></span>':`<co-icon name="${r}" size="16"></co-icon>`;const c=document.createElement("div");c.className="co-rte-bubble__color-dropdown",c.style.display="none";const s="textColor"===e?n.textColor:n.backgroundColor,{resetDrag:l}=this.addDragHeader(c,s);c.addEventListener("mousedown",(e=>{"INPUT"!==e.target.tagName&&e.preventDefault(),this.lockBubblePosition()}));const b=document.createElement("div");b.className="co-rte-bubble__color-grid",["#000000","#434343","#666666","#999999","#b7b7b7","#cccccc","#d9d9d9","#efefef","#f3f3f3","#ffffff","#980000","#ff0000","#ff9900","#ffff00","#00ff00","#00ffff","#4a86e8","#0000ff","#9900ff","#ff00ff","#e6b8af","#f4cccc","#fce5cd","#fff2cc","#d9ead3","#d0e0e3","#c9daf8","#cfe2f3","#d9d2e9","#ead1dc"].forEach((e=>{const o=document.createElement("button");o.type="button",o.className="co-rte-bubble__color-swatch",o.style.background=e,"#ffffff"===e&&(o.style.border="1px solid #e0e0e0"),o.addEventListener("click",(()=>{t(e),c.style.display="none"})),b.appendChild(o)}));const d=document.createElement("div");d.className="co-rte-bubble__color-hex";const u=document.createElement("input");u.type="text",u.className="co-rte-bubble__color-hex-input",u.placeholder="#hex",u.maxLength=7,u.addEventListener("keydown",(e=>{if("Enter"===e.key){const e=u.value.trim();/^#[0-9a-fA-F]{3,6}$/.test(e)&&(t(e),c.style.display="none",u.value="")}}));const h=document.createElement("button");return h.type="button",h.className="co-rte-bubble__color-clear",h.innerHTML=`<co-icon name="x" size="12"></co-icon> ${n.noColor}`,h.addEventListener("click",(()=>{this.editor&&("textColor"===e?this.editor.chain().focus().unsetColor().run():this.editor.chain().focus().unsetHighlight().run(),c.style.display="none")})),c.appendChild(b),d.appendChild(u),c.appendChild(d),c.appendChild(h),i.addEventListener("click",(()=>{const e=o.closest(".co-rte-bubble");e&&(e.querySelectorAll(".co-rte-bubble__select-dropdown").forEach((e=>{e.style.display="none"})),e.querySelectorAll(".co-rte-bubble__color-dropdown").forEach((e=>{e!==c&&(e.style.display="none")}))),"none"!==c.style.display?c.style.display="none":(l(),c.style.position="",c.style.top="",c.style.left="",c.style.bottom="",c.style.right="",c.style.transform="",c.style.display="block",this.positionDropdown(i,c))})),o.appendChild(i),o.appendChild(c),o}closeAllBubblePopups(...e){if(!this.bubbleEl)return;const t=e.filter(Boolean);this.bubbleEl.querySelectorAll(".co-rte-bubble__select-dropdown").forEach((e=>{t.includes(e)||(e.style.display="none")})),this.bubbleEl.querySelectorAll(".co-rte-bubble__color-dropdown").forEach((e=>{t.includes(e)||(e.style.display="none")})),this.bubbleEl.querySelectorAll(".co-rte-bubble__panel").forEach((e=>{t.includes(e)||(e.style.display="none")})),this.bubbleEl.querySelectorAll(".co-rte-bubble__overflow-menu").forEach((e=>{t.includes(e)||(e.style.display="none")})),this.bubbleLinkFormEl&&!t.includes(this.bubbleLinkFormEl)&&(this.bubbleLinkFormEl.style.display="none")}addDragHeader(e,t){let o=!1,r={x:0,y:0},i={x:0,y:0};const a=document.createElement("div");a.className="co-rte-bubble__panel-header";const n=document.createElement("div");n.className="co-rte-bubble__panel-drag",n.innerHTML='<co-icon name="dots-six" size="14"></co-icon>';const c=document.createElement("span");c.className="co-rte-bubble__panel-title",c.textContent=t;const s=document.createElement("button");return s.type="button",s.className="co-rte-bubble__panel-close",s.innerHTML='<co-icon name="x" size="14"></co-icon>',s.addEventListener("click",(()=>{e.style.display="none"})),a.appendChild(n),a.appendChild(c),a.appendChild(s),n.addEventListener("mousedown",(t=>{t.preventDefault(),t.stopPropagation();const a=e.getBoundingClientRect();i={x:t.clientX-a.left,y:t.clientY-a.top},o||(r={x:a.left,y:a.top}),o=!0;const n=t=>{r.x=t.clientX-i.x,r.y=t.clientY-i.y,e.style.position="fixed",e.style.top=`${r.y}px`,e.style.left=`${r.x}px`,e.style.bottom="auto",e.style.right="auto",e.style.transform="none",e.removeAttribute("data-position")},c=()=>{document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",c)};document.addEventListener("mousemove",n),document.addEventListener("mouseup",c)})),e.insertBefore(a,e.firstChild),{header:a,resetDrag:()=>{o=!1}}}createBubblePanel(e){const t=document.createElement("div");t.className="co-rte-bubble__select",t.setAttribute("data-select",e.name);const o=document.createElement("button");o.type="button",o.className="co-rte-bubble__select-trigger",o.innerHTML=`<span class="co-rte-bubble__select-label">${e.triggerLabel}</span><co-icon name="caret-down" size="12"></co-icon>`;const r=document.createElement("div");r.className="co-rte-bubble__panel",r.setAttribute("data-panel",e.name),r.style.display="none";const i=document.createElement("div");i.className="co-rte-bubble__panel-header";const a=document.createElement("div");a.className="co-rte-bubble__panel-drag",a.innerHTML='<co-icon name="dots-six" size="14"></co-icon>';const n=document.createElement("span");n.className="co-rte-bubble__panel-title",n.textContent=e.title;const c=document.createElement("button");c.type="button",c.className="co-rte-bubble__panel-close",c.innerHTML='<co-icon name="x" size="14"></co-icon>',c.addEventListener("click",(()=>{r.style.display="none"})),i.appendChild(a),i.appendChild(n),i.appendChild(c),r.appendChild(i);let s=!1,l={x:0,y:0},b={x:0,y:0};if(a.addEventListener("mousedown",(e=>{e.preventDefault(),e.stopPropagation();const t=r.getBoundingClientRect();b={x:e.clientX-t.left,y:e.clientY-t.top},s||(l={x:t.left,y:t.top}),s=!0;const o=e=>{l.x=e.clientX-b.x,l.y=e.clientY-b.y,r.style.position="fixed",r.style.top=`${l.y}px`,r.style.left=`${l.x}px`,r.style.bottom="auto",r.style.right="auto",r.style.transform="none",r.removeAttribute("data-position")},i=()=>{document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",i)};document.addEventListener("mousemove",o),document.addEventListener("mouseup",i)})),e.hasCustomInput){const t=document.createElement("div");t.className="co-rte-bubble__panel-input-wrap";const o=document.createElement("input");o.type=e.inputType||"text",o.className="co-rte-bubble__panel-input",o.placeholder=e.inputPlaceholder||"",o.addEventListener("mousedown",(e=>e.stopPropagation())),o.addEventListener("keydown",(t=>{if("Enter"===t.key){const t=o.value.trim();t&&e.onCustomInput&&(e.onCustomInput(t),o.value="")}"Escape"===t.key&&(t.stopPropagation(),r.style.display="none")})),t.appendChild(o),r.appendChild(t)}const d=document.createElement("div");return d.className="co-rte-bubble__panel-options",e.options.forEach((t=>{const o=document.createElement("button");o.type="button",o.className="co-rte-bubble__panel-option",o.setAttribute("data-value",t.value),e.renderOption?e.renderOption(t,o):o.textContent=t.label,o.addEventListener("click",(()=>{e.onSelect(t.value),r.style.display="none",s=!1})),d.appendChild(o)})),r.appendChild(d),r.addEventListener("mousedown",(e=>{"INPUT"!==e.target.tagName&&e.preventDefault(),this.lockBubblePosition()})),o.addEventListener("click",(()=>{this.closeAllBubblePopups(r),"none"!==r.style.display?r.style.display="none":(s=!1,r.style.position="",r.style.top="",r.style.left="",r.style.bottom="",r.style.right="",r.style.transform="",r.style.display="block",this.positionDropdown(o,r))})),t.appendChild(o),{wrap:t,panelEl:r,updateLabel:e=>{const t=o.querySelector(".co-rte-bubble__select-label");t&&(t.textContent=e)}}}createBubbleFontSizePanel(){const e=a(this.locale),t=[{label:e.title,value:"h1"},{label:e.heading1,value:"h2"},{label:e.heading2,value:"h3"},{label:"---",value:"---"},...["8px","10px","12px","14px","16px","18px","20px","24px","28px","32px","36px","48px","64px","72px"].map((e=>({label:e,value:e})))];return this.createBubblePanel({name:"fontSize",title:e.fontSize,triggerLabel:"16px",hasCustomInput:!0,inputType:"number",inputPlaceholder:e.writeSize,options:t,renderOption:(e,t)=>{if("---"===e.value)return t.className="co-rte-bubble__panel-sep",t.disabled=!0,void(t.style.pointerEvents="none");if("h1"===e.value)t.textContent=e.label,t.style.fontSize="24px",t.style.fontWeight="700",t.style.padding="6px 8px";else if("h2"===e.value)t.textContent=e.label,t.style.fontSize="18px",t.style.fontWeight="700",t.style.padding="5px 8px";else if("h3"===e.value)t.textContent=e.label,t.style.fontSize="15px",t.style.fontWeight="700",t.style.padding="4px 8px";else{t.textContent=e.label;const o=parseInt(e.value);t.style.fontSize=`${Math.min(o,36)}px`,t.style.lineHeight="1.3"}},onSelect:e=>{if(!this.editor||"---"===e)return;const t=this.editor.chain().focus();"h1"===e?t.toggleHeading({level:1}).run():"h2"===e?t.toggleHeading({level:2}).run():"h3"===e?t.toggleHeading({level:3}).run():t.setFontSize(e).run()},onCustomInput:e=>{if(!this.editor)return;const t=parseInt(e);t>0&&this.editor.chain().focus().setFontSize(`${t}px`).run()}})}createBubbleFontWeightPanel(){return this.createBubblePanel({name:"fontWeight",title:a(this.locale).fontWeight,triggerLabel:"Regular",hasCustomInput:!1,options:[{label:"Thin",value:"100"},{label:"Extra Light",value:"200"},{label:"Light",value:"300"},{label:"Regular",value:"400"},{label:"Medium",value:"500"},{label:"Semi Bold",value:"600"},{label:"Bold",value:"700"},{label:"Extra Bold",value:"800"},{label:"Black",value:"900"}],renderOption:(e,t)=>{t.style.fontWeight=e.value,t.innerHTML=`<span class="co-rte-bubble__panel-opt-row"><span>${e.label}</span><span class="co-rte-bubble__panel-opt-value">${e.value}</span></span>`},onSelect:e=>{this.editor&&this.editor.chain().focus().setFontWeight(e).run()}})}createBubbleLineHeightPanel(){const{panelEl:e}=this.createBubblePanel({name:"lineHeight",title:a(this.locale).lineSpacing,triggerLabel:"1.5",hasCustomInput:!0,inputPlaceholder:"1.5, 20px, 150%...",options:[{label:"0.5",value:"0.5"},{label:"1",value:"1"},{label:"1.15",value:"1.15"},{label:"1.5",value:"1.5"},{label:"1.75",value:"1.75"},{label:"2",value:"2"},{label:"2.5",value:"2.5"},{label:"3",value:"3"},{label:"---",value:"---"},{label:"16px",value:"16px"},{label:"20px",value:"20px"},{label:"24px",value:"24px"},{label:"32px",value:"32px"},{label:"---",value:"---2"},{label:"100%",value:"100%"},{label:"150%",value:"150%"},{label:"200%",value:"200%"}],renderOption:(e,t)=>{if(e.value.startsWith("---"))return t.className="co-rte-bubble__panel-sep",t.disabled=!0,void(t.style.pointerEvents="none");t.textContent=e.label},onSelect:e=>{this.editor&&!e.startsWith("---")&&this.editor.chain().focus().setLineHeight(e).run()},onCustomInput:e=>{this.editor&&this.editor.chain().focus().setLineHeight(e).run()}});return e}createBubbleLetterSpacingPanel(){const{panelEl:e}=this.createBubblePanel({name:"letterSpacing",title:a(this.locale).letterSpacing,triggerLabel:a(this.locale).normal,hasCustomInput:!0,inputPlaceholder:"Custom (em)...",options:[{label:"-0.05em",value:"-0.05em"},{label:"Normal",value:"normal"},{label:"0.05em",value:"0.05em"},{label:"0.1em",value:"0.1em"},{label:"0.2em",value:"0.2em"}],onSelect:e=>{this.editor&&("normal"===e?this.editor.chain().focus().unsetLetterSpacing().run():this.editor.chain().focus().setLetterSpacing(e).run())},onCustomInput:e=>{if(!this.editor)return;const t=e.includes("em")||e.includes("px")?e:`${e}em`;this.editor.chain().focus().setLetterSpacing(t).run()}});return e}createBubbleBgColorPanel(){const e=this.createBubbleColorPicker("bgColor",(e=>{this.editor&&this.editor.chain().focus().toggleHighlight({color:e}).run()})),t=e.querySelector(".co-rte-bubble__btn");return t&&(t.style.display="none"),e}createBubbleOverflowMenu(e){const t=document.createElement("div");t.className="co-rte-bubble__overflow";const o=document.createElement("button");o.type="button",o.className="co-rte-bubble__btn";const r=a(this.locale);o.title=r.moreOptions,o.setAttribute("aria-label",r.moreOptions),o.innerHTML='<co-icon name="dots-three" size="16"></co-icon>';const i=document.createElement("div");i.className="co-rte-bubble__overflow-menu",i.style.display="none";const{resetDrag:n}=this.addDragHeader(i,r.moreOptions);i.addEventListener("mousedown",(e=>{"INPUT"!==e.target.tagName&&e.preventDefault(),this.lockBubblePosition()})),[{icon:"text-strikethrough",label:r.strikethrough,action:"strike",check:"strike",type:"toggle"},{icon:"highlighter",label:r.backgroundColor,action:"bgColor",type:"panel",panel:e.bgColor},{icon:"list-bullets",label:r.bulletList,action:"bulletList",check:"bulletList",type:"toggle"},{icon:"list-numbers",label:r.orderedList,action:"orderedList",check:"orderedList",type:"toggle"},{icon:"text-superscript",label:r.superscript,action:"superscript",check:"superscript",type:"toggle"},{icon:"text-subscript",label:r.subscript,action:"subscript",check:"subscript",type:"toggle"},{icon:"line-segments",label:r.lineSpacing,action:"lineHeight",type:"panel",panel:e.lineHeight,valueAttr:"lineHeight"},{icon:"text-aa",label:r.letterSpacing,action:"letterSpacing",type:"panel",panel:e.letterSpacing,valueAttr:"letterSpacing"},{icon:"minus",label:r.horizontalRule,action:"horizontalRule",type:"toggle"},{icon:"eraser",label:r.clearFormat,action:"clearFormat",type:"toggle"}].forEach((e=>{if("lineHeight"===e.action||"horizontalRule"===e.action){const e=document.createElement("div");e.className="co-rte-bubble__overflow-sep",i.appendChild(e)}const t=document.createElement("button");t.type="button",t.className="co-rte-bubble__overflow-item",t.setAttribute("data-overflow-item",e.action),e.check&&t.setAttribute("data-check",e.check);let o="";e.valueAttr&&(o=`<span class="co-rte-bubble__overflow-value" data-overflow-value="${e.valueAttr}"></span>`),t.innerHTML=`<co-icon name="${e.icon}" size="16"></co-icon><span>${e.label}</span>${o}`,t.addEventListener("click",(()=>{if(!this.editor)return;if("panel"===e.type&&e.panel){if("bgColor"===e.action){const t=e.panel.querySelector(".co-rte-bubble__color-dropdown");if(t){const e="none"!==t.style.display;this.closeAllBubblePopups(i,e?void 0:t),t.style.display=e?"none":"block",e||this.positionPanelNearBubble(t)}}else{const t="none"!==e.panel.style.display;this.closeAllBubblePopups(i,t?void 0:e.panel),e.panel.style.display=t?"none":"block",t||this.positionPanelNearBubble(e.panel)}return}const t=this.editor.chain().focus();switch(e.action){case"strike":t.toggleStrike().run();break;case"bulletList":t.toggleBulletList().run();break;case"orderedList":t.toggleOrderedList().run();break;case"superscript":t.toggleSuperscript().run();break;case"subscript":t.toggleSubscript().run();break;case"horizontalRule":t.setHorizontalRule().run(),i.style.display="none";break;case"clearFormat":t.unsetAllMarks().clearNodes().run(),i.style.display="none"}})),i.appendChild(t)}));const c=document.createElement("div");c.className="co-rte-bubble__overflow-table-section",c.style.display="none";const s=document.createElement("div");s.className="co-rte-bubble__overflow-sep",c.appendChild(s);const l=document.createElement("div");l.className="co-rte-bubble__overflow-section-title",l.textContent=r.tableOptions,c.appendChild(l),[{action:"addColumnBefore",icon:"columns-plus-left",label:r.addColumnBefore},{action:"addColumnAfter",icon:"columns-plus-right",label:r.addColumnAfter},{action:"addRowBefore",icon:"rows-plus-top",label:r.addRowAbove},{action:"addRowAfter",icon:"rows-plus-bottom",label:r.addRowBelow},{action:"mergeCells",icon:"arrows-merge",label:r.mergeCells},{action:"splitCell",icon:"arrows-split",label:r.splitCell},{action:"toggleHeaderRow",icon:"rows",label:r.headerRow}].forEach((({action:e,icon:t,label:o})=>{const r=document.createElement("button");r.type="button",r.className="co-rte-bubble__overflow-item",r.setAttribute("data-overflow-item",e),"toggleHeaderRow"===e&&r.setAttribute("data-check","toggleHeaderRow"),r.innerHTML=`<co-icon name="${t}" size="16"></co-icon><span>${o}</span>`,r.addEventListener("click",(()=>{if(!this.editor)return;const t=this.editor.chain().focus();switch(e){case"addColumnAfter":t.addColumnAfter().run();break;case"addColumnBefore":t.addColumnBefore().run();break;case"addRowAfter":t.addRowAfter().run();break;case"addRowBefore":t.addRowBefore().run();break;case"mergeCells":t.mergeCells().run();break;case"splitCell":t.splitCell().run();break;case"toggleHeaderRow":t.toggleHeaderRow().run()}})),c.appendChild(r)}));const b=document.createElement("div");return b.className="co-rte-bubble__overflow-sep",c.appendChild(b),[{action:"deleteColumn",icon:"minus-square",label:r.deleteColumn},{action:"deleteRow",icon:"x-square",label:r.deleteRow},{action:"deleteTable",icon:"trash",label:r.deleteTable}].forEach((({action:e,icon:t,label:o})=>{const r=document.createElement("button");r.type="button",r.className="co-rte-bubble__overflow-item co-rte-bubble__overflow-item--danger",r.setAttribute("data-overflow-item",e),r.innerHTML=`<co-icon name="${t}" size="16"></co-icon><span>${o}</span>`,r.addEventListener("click",(()=>{if(!this.editor)return;const t=this.editor.chain().focus();switch(e){case"deleteColumn":t.deleteColumn().run();break;case"deleteRow":t.deleteRow().run();break;case"deleteTable":t.deleteTable().run(),i.style.display="none"}})),c.appendChild(r)})),i.appendChild(c),o.addEventListener("click",(()=>{this.closeAllBubblePopups(i),"none"!==i.style.display?i.style.display="none":(n(),i.style.position="",i.style.top="",i.style.left="",i.style.bottom="",i.style.right="",i.style.transform="",i.style.display="block",this.positionDropdown(o,i))})),t.appendChild(o),t.appendChild(i),{overflowWrap:t,overflowMenu:i}}toggleBubbleLinkForm(e){var t,o;if(this.bubbleLinkFormEl&&this.bubbleLinkInputEl&&(this.bubbleLinkFormEl.style.display=e?"flex":"none",e)){const e=(null===(t=this.editor)||void 0===t?void 0:t.isActive("link"))&&(null===(o=this.editor.getAttributes("link"))||void 0===o?void 0:o.href)||"";this.bubbleLinkInputEl.value=e,this.bubbleLinkUnlinkEl&&(this.bubbleLinkUnlinkEl.style.display=e?"flex":"none"),setTimeout((()=>{var e;return null===(e=this.bubbleLinkInputEl)||void 0===e?void 0:e.focus()}),0)}}submitBubbleLinkImperative(){if(!this.editor||!this.bubbleLinkInputEl)return;const e=this.bubbleLinkInputEl.value.trim();e?(this.editor.chain().focus().setLink({href:e}).run(),this.toggleBubbleLinkForm(!1)):this.toggleBubbleLinkForm(!1)}updateBubbleActiveStates(){if(!this.editor||!this.bubbleEl)return;this.bubbleEl.querySelectorAll(".co-rte-bubble__btn[data-check]").forEach((e=>{const t=e.getAttribute("data-check");t&&e.classList.toggle("co-rte-bubble__btn--active",this.editor.isActive(t))})),this.bubbleEl.querySelectorAll(".co-rte-bubble__btn[data-align]").forEach((e=>{const t=e.getAttribute("data-align");t&&e.classList.toggle("co-rte-bubble__btn--active",this.editor.isActive({textAlign:t}))}));const e=this.bubbleEl.querySelector('[data-select="fontFamily"] .co-rte-bubble__select-label');if(e){const t=this.editor.getAttributes("textStyle"),o=(null==t?void 0:t.fontFamily)||"";e.textContent=o?o.split(",")[0].replace(/['"]/g,"").trim():"Sans-serif"}const t=this.bubbleEl.querySelector('[data-select="fontSize"] .co-rte-bubble__select-label');if(t){const e=this.editor.getAttributes("textStyle"),o=a(this.locale);t.textContent=this.editor.isActive("heading",{level:1})?o.title:this.editor.isActive("heading",{level:2})?o.headingAbbr1:this.editor.isActive("heading",{level:3})?o.headingAbbr2:(null==e?void 0:e.fontSize)||"16px"}const o=this.bubbleEl.querySelector('[data-select="fontWeight"] .co-rte-bubble__select-label');if(o){const e=this.editor.getAttributes("textStyle");o.textContent={100:"Thin",200:"Extra Light",300:"Light",400:"Regular",500:"Medium",600:"Semi-bold",700:"Bold",800:"Extra-bold",900:"Black"}[(null==e?void 0:e.fontWeight)||"400"]||"Regular"}this.bubbleEl.querySelectorAll(".co-rte-bubble__overflow-item[data-check]").forEach((e=>{const t=e.getAttribute("data-check");t&&e.classList.toggle("co-rte-bubble__overflow-item--active",this.editor.isActive(t))}));const r=this.bubbleEl.querySelector('[data-overflow-value="lineHeight"]');if(r){const e=this.editor.getAttributes("paragraph"),t=this.editor.getAttributes("heading");r.textContent=(null==e?void 0:e.lineHeight)||(null==t?void 0:t.lineHeight)||""}const i=this.bubbleEl.querySelector('[data-overflow-value="letterSpacing"]');if(i){const e=this.editor.getAttributes("textStyle");i.textContent=(null==e?void 0:e.letterSpacing)||""}const n=this.bubbleEl.querySelector(".co-rte-bubble__color-bar");if(n){const e=this.editor.getAttributes("textStyle");n.style.background=(null==e?void 0:e.color)||"#000000"}const c=this.bubbleEl.querySelector(".co-rte-bubble__overflow-table-section");if(c){const e=this.editor.isActive("table");if(c.style.display=e?"block":"none",e){const e=c.querySelector('[data-overflow-item="toggleHeaderRow"]');if(e){const t=this.editor.view,{$anchor:o}=this.editor.state.selection;let r=o.depth,i=!1;for(;r>0;){if("table"===o.node(r).type.name){const e=t.nodeDOM(o.start(r)-1);if(e){const t=(e.querySelector("table")||e).querySelector("tr");i=!!t&&null!==t.querySelector("th")}break}r--}e.classList.toggle("co-rte-bubble__overflow-item--active",i)}}}}createImageLayoutBar(){const e=document.createElement("div");e.className="co-rte-img-layout",e.style.display="none",e.addEventListener("mousedown",(e=>{e.preventDefault(),e.stopPropagation()}));const t=a(this.locale),o={inline:t.imageLayoutInline,"wrap-left":t.imageLayoutWrapLeft,"wrap-right":t.imageLayoutWrapRight,center:t.imageLayoutCenter,"full-width":t.imageLayoutFullWidth};return["inline","wrap-left","wrap-right","center","full-width"].forEach((t=>{const r=document.createElement("button");r.type="button",r.className="co-rte-img-layout__btn",r.setAttribute("data-layout",t),r.setAttribute("data-tooltip",o[t]||t),r.setAttribute("aria-label",o[t]||t),r.innerHTML=`<co-icon name="${p.IMG_LAYOUT_ICONS[t]}" size="18"></co-icon>`,r.addEventListener("click",(()=>this.setImageLayout(t))),e.appendChild(r)})),e}setImageLayout(e){if(!this.editor||!this.contentEl)return;const{state:t}=this.editor,o=t.selection;if("NodeSelection"!==o.constructor.name)return;const r=o.node;if("image"!==(null==r?void 0:r.type.name))return;const i=o.from,a=t.tr.setNodeMarkup(i,void 0,Object.assign(Object.assign({},r.attrs),{imageLayout:e}));this.editor.view.dispatch(a),this.editor.commands.setNodeSelection(i),requestAnimationFrame((()=>{this.syncImageLayouts(),this.updateImageLayoutBar()}))}getSelectedImageInfo(){var e;if(!this.editor)return null;const{state:t}=this.editor,o=t.selection;if("NodeSelection"!==o.constructor.name)return null;const r=o.node;if("image"!==(null==r?void 0:r.type.name))return null;const i=o.from,a=this.editor.view.nodeDOM(i);return a?{node:r,pos:i,container:(null===(e=a.closest)||void 0===e?void 0:e.call(a,"[data-resize-container]"))||a}:null}syncImageLayouts(){this.editor&&u(this.editor)}updateImageLayoutBarPosition(){if(!this.imgLayoutEl||!this.contentEl)return;const e=this.getSelectedImageInfo();if(!e)return;const t=e.container.getBoundingClientRect(),o=this.contentEl.getBoundingClientRect(),r=this.imgLayoutEl.offsetWidth||194;let i=t.left+t.width/2-o.left+this.contentEl.scrollLeft-r/2;i=Math.max(4,Math.min(i,o.width-r-4));const a=t.bottom-o.top+this.contentEl.scrollTop+8;this.imgLayoutEl.style.left=`${i}px`,this.imgLayoutEl.style.top=`${a}px`}updateImageLayoutBar(){if(!this.imgLayoutEl||!this.editor)return;const e=this.getSelectedImageInfo();if(!e)return void(this.imgLayoutVisible&&(this.imgLayoutEl.style.display="none",this.imgLayoutVisible=!1));this.imgLayoutEl.style.display="flex",this.imgLayoutVisible=!0,this.updateImageLayoutBarPosition();const t=e.node.attrs.imageLayout||"inline";this.imgLayoutEl.querySelectorAll(".co-rte-img-layout__btn").forEach((e=>{e.classList.toggle("co-rte-img-layout__btn--active",e.getAttribute("data-layout")===t)}))}render(){const e=this.showCharacterCount||null!=this.maxLength,t="bottom"===this.toolbarPosition,r="none"!==this.resolvedToolbar&&!this.readonly&&!this.disabled&&o("co-rich-text-toolbar",{key:"7b2112db75bb679695e9bb58385d193e90d3678b",class:"co-rich-text-editor__toolbar",part:"toolbar",variant:this.resolvedToolbar,position:this.toolbarPosition,disabled:this.disabled||this.readonly,locale:this.locale,attachmentsEnabled:this.attachmentsEnabled,attachmentAccept:this.attachmentAccept,onCoAttachmentsSelected:e=>{e.stopPropagation(),this.coAttachmentsSelected.emit(e.detail)},ref:e=>this.toolbarEl=e});return o("div",{key:"8b848da977b08aa7f3466fa14403155ddc1c1d66",class:{"co-rich-text-editor":!0,"co-rich-text-editor--focused":this.hasFocus,"co-rich-text-editor--disabled":this.disabled,"co-rich-text-editor--readonly":this.readonly,"co-rich-text-editor--loading":!this.ready,[`co-rich-text-editor--${this.status}`]:"default"!==this.status,"co-rich-text-editor--flat":"flat"===this.variant,"co-rich-text-editor--toolbar-bottom":t},part:"wrapper"},(this.label||this.secondaryLabel)&&o("div",{key:"f35d59f312dabcd2b384e958a45bb7ac4a33f7bb",class:"co-rich-text-editor__labels"},this.label&&o("label",{key:"e7b2d47de7356e4a89fabf925255dbf0d25fc8e9",class:"co-rich-text-editor__label",part:"label"},this.label,o(h,{key:"f56500b0382d9d12c7f78b4448aab7cc748271be",required:this.required})),this.secondaryLabel&&o("span",{key:"e305aecd4fee9963221210ac076791f456aad91c",class:"co-rich-text-editor__secondary-label"},this.secondaryLabel)),o("div",{key:"284ff5c06606efef9a06de80478acc57868229eb",class:"co-rich-text-editor__frame"},!t&&r,o("div",{key:"145b244c505ae5374bd847855978da02baa878cc",class:"co-rich-text-editor__box"},o("div",{key:"c5f02991df3e712a3e6a0163415a75c5e91e4384",class:"co-rte-content",part:"content",role:"textbox","aria-multiline":"true","aria-label":this.label,"aria-required":this.required?"true":void 0,"aria-invalid":"error"===this.status?"true":void 0,ref:e=>this.contentEl=e})),o("slot",{key:"060e3e5bcda76b403357ada26950c9f50a71076e",name:"content-end"}),t&&o("div",{key:"2ec4329cfc09714a78caab5ca774f08af2984729",class:"co-rich-text-editor__toolbar-row",part:"toolbar-row"},r,o("slot",{key:"806f94a2d924df1b33d5fcf5d28279b093f69845",name:"toolbar-end"}))),o("div",{key:"8fcb92d7f3404c7458f95fc578fbb579ecb4b5e7",class:"co-rich-text-editor__footer"},this.helperText&&o("div",{key:"b1b664ceb090e940cadc3aa782eb074e6517146a",class:`co-rich-text-editor__helper co-rich-text-editor__helper--${this.status}`,part:"helper"},o("co-icon",{key:"a8db33f94d1aec0bc62bd9ee709d4cff914fc51c",name:this.helperIcon,size:14}),o("span",{key:"be99a15b919ea82668da83854735b80eaf03ebf7"},this.helperText)),e&&o("span",{key:"dfde31e7c4f62fc9cf9fc3654f5eb6a2377dcf9a",class:"co-rich-text-editor__count",ref:e=>this.charCountEl=e},this.charCount,null!=this.maxLength?` / ${this.maxLength}`:"")))}get el(){return r(this)}static get watchers(){return{accountFonts:[{onAccountFontsChange:0}],value:[{onValueChange:0}],disabled:[{onEditableChange:0}],readonly:[{onEditableChange:0}]}}};p.DEFAULT_FONTS=[{label:"Arial",value:"Arial, sans-serif"},{label:"Calibri",value:"Calibri, sans-serif"},{label:"Cambria",value:"Cambria, serif"},{label:"Comic Sans MS",value:"'Comic Sans MS', cursive"},{label:"Courier New",value:"'Courier New', monospace"},{label:"Georgia",value:"Georgia, serif"},{label:"Geist",value:"'Geist', sans-serif"},{label:"Helvetica",value:"Helvetica, Arial, sans-serif"},{label:"Impact",value:"Impact, sans-serif"},{label:"Inter",value:"'Inter', sans-serif"},{label:"Lato",value:"'Lato', sans-serif"},{label:"Montserrat",value:"'Montserrat', sans-serif"},{label:"Open Sans",value:"'Open Sans', sans-serif"},{label:"Poppins",value:"'Poppins', sans-serif"},{label:"Roboto",value:"'Roboto', sans-serif"},{label:"Segoe UI",value:"'Segoe UI', sans-serif"},{label:"Tahoma",value:"Tahoma, sans-serif"},{label:"Times New Roman",value:"'Times New Roman', serif"},{label:"Trebuchet MS",value:"'Trebuchet MS', sans-serif"},{label:"Verdana",value:"Verdana, sans-serif"}],p._registeredFonts=new Set,p.IMG_LAYOUT_ICONS={inline:"image-square","wrap-left":"text-align-left","wrap-right":"text-align-right",center:"text-align-center","full-width":"arrows-horizontal"},p.style='co-rich-text-editor{display:block;font-family:var(--co-font-family-primary);font-size:var(--co-font-size-14);letter-spacing:var(--co-font-letter-spacing-body)}.co-rich-text-editor{display:flex;flex-direction:column;gap:var(--co-spacing-sm2, 6px)}.co-rich-text-editor__labels{display:flex;align-items:center;justify-content:space-between;padding:0 var(--co-spacing-xs);gap:var(--co-spacing-sm2, 6px)}.co-rich-text-editor__label,.co-rich-text-editor__secondary-label{color:var(--co-semantic-text-secondary);font-size:var(--co-font-size-14);font-weight:400;line-height:1}.co-rich-text-editor__frame{display:flex;flex-direction:column;background:var(--co-semantic-surface-page);border:1px solid var(--co-semantic-border-field);border-radius:var(--co-border-radius-xs);transition:border-color var(--co-motion-duration-fast) var(--co-motion-ease-out), box-shadow var(--co-motion-duration-fast) var(--co-motion-ease-out);min-height:0;flex:1;position:relative;overflow:visible}.co-rich-text-editor__box{display:flex;flex-direction:column;min-height:0;flex:1;position:relative;overflow-y:auto;overflow-x:hidden}.co-rich-text-editor--flat .co-rich-text-editor__frame{background:transparent;border-color:transparent}.co-rich-text-editor--focused .co-rich-text-editor__frame{border-color:var(--co-semantic-border-focus, var(--co-color-base-negro, #1a1a1a));box-shadow:0 0 0 3px var(--co-semantic-border-focus-ring, rgba(37, 99, 235, 0.15))}.co-rich-text-editor--error .co-rich-text-editor__frame{border-color:var(--co-semantic-border-error, var(--co-color-status-error))}.co-rich-text-editor--success .co-rich-text-editor__frame{border-color:var(--co-color-status-success)}.co-rich-text-editor--disabled .co-rich-text-editor__frame,.co-rich-text-editor--readonly .co-rich-text-editor__frame{opacity:0.7;cursor:not-allowed}.co-rich-text-editor--loading .co-rte-content{min-height:96px;background:linear-gradient(90deg, var(--co-semantic-surface-secondary) 0%, var(--co-semantic-surface-hover, rgba(0, 0, 0, 0.04)) 50%, var(--co-semantic-surface-secondary) 100%);background-size:200% 100%;animation:co-rte-skeleton 1.2s ease-in-out infinite}@keyframes co-rte-skeleton{0%{background-position:200% 0}100%{background-position:-200% 0}}.co-rich-text-editor__toolbar{position:relative;flex-shrink:0;z-index:60;border-top-left-radius:calc(var(--co-border-radius-xs) - 1px);border-top-right-radius:calc(var(--co-border-radius-xs) - 1px)}.co-rich-text-editor__toolbar-row{display:flex;align-items:center;justify-content:space-between;gap:var(--co-spacing-md);flex-shrink:0;min-width:0;border-top:1px solid var(--co-semantic-border-subtle)}.co-rich-text-editor--toolbar-bottom .co-rich-text-editor__toolbar{border-top-left-radius:0;border-top-right-radius:0;min-width:0}.co-rte-content{min-height:96px;color:var(--co-semantic-text-default);flex:1 0 auto;display:flex;flex-direction:column}.co-rte-content .ProseMirror{outline:none;flex:1 0 auto;line-height:1.5;padding:var(--co-spacing-md);box-sizing:border-box}.co-rte-content .ProseMirror p{margin:0 0 var(--co-spacing-sm) 0}.co-rte-content .ProseMirror p:last-child{margin-bottom:0}.co-rte-content .ProseMirror>p{margin-bottom:var(--co-spacing-sm) !important}.co-rte-content .ProseMirror>p:last-child{margin-bottom:0 !important}.co-rte-content .ProseMirror [style*="text-align: justify"]{text-align-last:left}.co-rte-content .ProseMirror [style*="text-align: center"]{text-align:center}.co-rte-content .ProseMirror [style*="text-align: right"]{text-align:right}.co-rte-content .ProseMirror h1,.co-rte-content .ProseMirror h2,.co-rte-content .ProseMirror h3,.co-rte-content .ProseMirror h4{margin:var(--co-spacing-md) 0 var(--co-spacing-sm);font-weight:600;line-height:1.3}.co-rte-content .ProseMirror h1{font-size:var(--co-font-size-28, 28px)}.co-rte-content .ProseMirror h2{font-size:var(--co-font-size-20, 20px)}.co-rte-content .ProseMirror h3{font-size:var(--co-font-size-16, 16px)}.co-rte-content .ProseMirror ul,.co-rte-content .ProseMirror ol{padding-left:var(--co-spacing-xl);margin:0 0 var(--co-spacing-sm) 0}.co-rte-content .ProseMirror ul[data-type="taskList"]{list-style:none;padding-left:0;margin:0 0 var(--co-spacing-sm) 0}.co-rte-content .ProseMirror ul[data-type="taskList"] li{display:flex;align-items:flex-start;gap:var(--co-spacing-sm, 8px)}.co-rte-content .ProseMirror ul[data-type="taskList"] li>label{flex:0 0 auto;margin-top:0.15em;user-select:none}.co-rte-content .ProseMirror ul[data-type="taskList"] li>div{flex:1 1 auto;min-width:0}.co-rte-content .ProseMirror ul[data-type="taskList"] li>div>p{margin:0}.co-rte-content .ProseMirror ul[data-type="taskList"] input[type="checkbox"]{width:16px;height:16px;cursor:pointer;accent-color:var(--co-color-base-negro, #1a1a1a)}.co-rte-content .ProseMirror ul[data-type="taskList"][data-variant="strike"] li[data-checked="true"]>div{text-decoration:line-through;color:var(--co-semantic-text-muted, #999)}.co-rte-content .ProseMirror ul[data-type="taskList"][data-variant="plain"] li[data-checked="true"]>div{text-decoration:none}.co-rte-content .ProseMirror blockquote{border-left:3px solid var(--co-semantic-border-default, var(--co-semantic-border-subtle));padding-left:var(--co-spacing-md);margin:0 0 var(--co-spacing-sm) 0;color:var(--co-semantic-text-secondary)}.co-rte-content .ProseMirror a{color:var(--co-color-base-negro, #1a1a1a);text-decoration:underline;text-underline-offset:2px}.co-rte-content .ProseMirror img{max-width:100%;height:auto;border-radius:var(--co-border-radius-xs);margin:var(--co-spacing-sm) 0;cursor:default;-webkit-user-drag:none;user-select:none}.co-rte-content .ProseMirror img.ProseMirror-selectednode{outline:2px solid var(--co-color-base-negro, #1a1a1a)}.co-rte-content [data-resize-container].ProseMirror-selectednode{outline:2px solid var(--co-color-base-negro, #1a1a1a);outline-offset:0px;border-radius:0}.co-rte-content [data-resize-container]{position:relative;display:inline-block;width:fit-content;max-width:100%;margin:var(--co-spacing-sm) 0;line-height:0}.co-rte-content [data-resize-container][data-resize-state="true"]{outline:2px solid var(--co-color-base-negro, #1a1a1a);outline-offset:0px;border-radius:0}.co-rte-content [data-resize-wrapper]{position:relative;display:inline-block;line-height:0}.co-rte-content [data-resize-handle]{width:10px;height:10px;background:var(--co-color-base-negro, #1a1a1a);border:1.5px solid #fff;border-radius:50%;box-shadow:0 0 2px rgba(0, 0, 0, 0.3);z-index:5;opacity:0;pointer-events:none}.co-rte-content [data-resize-container][data-resize-state="true"] [data-resize-handle],.co-rte-content [data-resize-container].ProseMirror-selectednode [data-resize-handle]{opacity:1;pointer-events:auto}.co-rte-content [data-resize-handle="top-left"]{cursor:nw-resize}.co-rte-content [data-resize-handle="top-right"]{cursor:ne-resize}.co-rte-content [data-resize-handle="bottom-left"]{cursor:sw-resize}.co-rte-content [data-resize-handle="bottom-right"]{cursor:se-resize}.co-rte-content [data-resize-handle="top"],.co-rte-content [data-resize-handle="bottom"]{width:30px;height:6px;border-radius:3px;left:50% !important;transform:translateX(-50%)}.co-rte-content [data-resize-handle="top"]{cursor:n-resize}.co-rte-content [data-resize-handle="bottom"]{cursor:s-resize}.co-rte-content [data-resize-handle="left"],.co-rte-content [data-resize-handle="right"]{width:6px;height:30px;border-radius:3px;top:50% !important;transform:translateY(-50%)}.co-rte-content [data-resize-handle="left"]{cursor:w-resize}.co-rte-content [data-resize-handle="right"]{cursor:e-resize}.co-rte-content [data-resize-container] img{max-width:100%;display:block;border-radius:0;margin:0}.co-rte-content .ProseMirror hr{border:none;border-top:1px solid var(--co-semantic-border-default, #e0e0e0);margin:var(--co-spacing-lg) 0}.co-rte-content .ProseMirror code{font-family:var(--co-font-family-mono);font-size:0.9em;background:var(--co-semantic-surface-hover, rgba(0, 0, 0, 0.06));padding:0.1em 0.3em;border-radius:var(--co-border-radius-xxs)}.co-rte-content .ProseMirror pre{font-family:var(--co-font-family-mono);font-size:0.9em;background:var(--co-semantic-surface-hover, rgba(0, 0, 0, 0.06));padding:var(--co-spacing-md);border-radius:var(--co-border-radius-xs);overflow-x:auto;margin:var(--co-spacing-sm) 0}.co-rte-content .ProseMirror pre code{background:none;padding:0;border-radius:0}.co-rte-content .ProseMirror p.is-editor-empty:first-child::before{content:attr(data-placeholder);color:var(--co-semantic-text-muted);float:left;height:0;pointer-events:none}.co-rte-content .co-rte-variable,.co-rte-content .co-rte-mention{display:inline-block;padding:0.05em 0.4em;border-radius:var(--co-border-radius-xxs);background:var(--co-color-base-negro, #1a1a1a);color:var(--co-color-base-blanco, #fff);font-size:0.9em;white-space:nowrap}.co-rte-content .co-rte-mention{background:var(--co-color-azul-200);color:var(--co-color-azul-800)}.co-rich-text-editor__footer{display:flex;align-items:center;justify-content:space-between;gap:var(--co-spacing-sm);padding:0 var(--co-spacing-xs);min-height:0}.co-rich-text-editor__helper{display:flex;align-items:center;gap:var(--co-spacing-xs);color:var(--co-semantic-text-secondary);font-size:var(--co-font-size-12, 12px)}.co-rich-text-editor__helper--error{color:var(--co-semantic-text-error, var(--co-color-status-error))}.co-rich-text-editor__helper--success{color:var(--co-semantic-text-success, var(--co-color-status-success))}.co-rich-text-editor__count{margin-left:auto;color:var(--co-semantic-text-muted);font-size:var(--co-font-size-12, 12px)}.co-rte-bubble.co-rte-bubble--suppressed{display:none !important}.co-rte-bubble{position:absolute;z-index:50;display:flex;flex-direction:row;align-items:center;gap:2px;padding:var(--co-spacing-xs, 4px) var(--co-spacing-sm, 8px);background:var(--co-semantic-surface-secondary, #fff);border:1px solid var(--co-semantic-border-default, #e0e0e0);border-radius:var(--co-border-radius-xs, 8px);box-shadow:0 4px 16px rgba(0, 0, 0, 0.12);user-select:none;white-space:nowrap;max-width:100%;box-sizing:border-box;flex-wrap:wrap}.co-rte-bubble__drag-handle{display:flex;align-items:center;justify-content:center;cursor:grab;color:var(--co-semantic-text-muted, #999);width:18px;height:28px;margin:0 2px 0 0;flex-shrink:0}.co-rte-bubble__drag-handle:hover{color:var(--co-semantic-text-secondary, #555)}.co-rte-bubble__drag-handle:active{cursor:grabbing}.co-rte-bubble__row{display:flex;align-items:center;gap:2px;flex-wrap:wrap;max-width:100%;min-width:0}.co-rte-bubble__btn{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;padding:0;border:none;border-radius:var(--co-border-radius-xxs, 4px);background:transparent;color:var(--co-semantic-text-default, #333);cursor:pointer}.co-rte-bubble__btn:hover:not(.co-rte-bubble__btn--active){background:var(--co-semantic-surface-hover, rgba(0, 0, 0, 0.06))}.co-rte-bubble__btn--active{background:var(--co-color-base-negro, #1a1a1a);color:var(--co-color-base-blanco, #fff)}.co-rte-bubble__btn--active:hover{background:var(--co-color-base-negro, #333)}.co-rte-bubble__sep{display:inline-block;width:1px;height:18px;margin:0 4px;background:var(--co-semantic-border-default, rgba(0, 0, 0, 0.12));flex-shrink:0}.co-rte-bubble__select{position:relative}.co-rte-bubble__select-trigger{display:flex;align-items:center;gap:2px;height:28px;padding:0 6px;border:1px solid transparent;border-radius:var(--co-border-radius-xxs, 4px);background:transparent;color:var(--co-semantic-text-default, #333);font-family:var(--co-font-family-primary);font-size:11px;cursor:pointer;white-space:nowrap;transition:background var(--co-motion-duration-fast), border-color var(--co-motion-duration-fast)}.co-rte-bubble__select-trigger:hover{background:var(--co-semantic-surface-hover, #f5f5f5);border-color:var(--co-semantic-border-default, #e0e0e0)}.co-rte-bubble__select-label{max-width:72px;overflow:hidden;text-overflow:ellipsis}.co-rte-bubble__select--font .co-rte-bubble__select-label{max-width:110px}.co-rte-bubble__select-dropdown{position:absolute;bottom:100%;left:0;z-index:120;min-width:100px;max-height:260px;overflow-y:auto;padding:var(--co-spacing-xxs, 2px);background:var(--co-semantic-surface-secondary, #fff);border:1px solid var(--co-semantic-border-default, #e0e0e0);border-radius:var(--co-border-radius-xxs, 4px);box-shadow:0 4px 16px rgba(0, 0, 0, 0.12);margin-bottom:4px;white-space:normal}.co-rte-bubble__select-dropdown[data-position="above"]{bottom:100%;top:auto;margin-bottom:4px;margin-top:0}.co-rte-bubble__select-dropdown[data-position="below"]{top:100%;bottom:auto;margin-top:4px;margin-bottom:0}.co-rte-bubble__select-option{display:block;width:100%;padding:4px 8px;border:none;border-radius:3px;background:transparent;color:var(--co-semantic-text-default, #333);font-family:var(--co-font-family-primary);font-size:12px;text-align:left;cursor:pointer;white-space:nowrap}.co-rte-bubble__select-option:hover{background:var(--co-semantic-surface-hover, #f5f5f5)}.co-rte-bubble__select-dropdown--font{min-width:200px;max-height:320px;overflow:hidden;overflow-y:auto;display:flex;flex-direction:column;white-space:normal}.co-rte-bubble__font-search{padding:6px 6px 4px;flex-shrink:0}.co-rte-bubble__font-search-input{width:100%;padding:4px 8px;border:1px solid var(--co-semantic-border-default, #ccc);border-radius:4px;background:var(--co-semantic-surface-secondary, #fff);color:var(--co-semantic-text-default, #333);font-family:var(--co-font-family-primary);font-size:12px;outline:none;box-sizing:border-box}.co-rte-bubble__font-search-input:focus{border-color:var(--co-color-base-negro, #1a1a1a)}.co-rte-bubble__font-list{max-height:260px;overflow-y:auto;padding:0 var(--co-spacing-xxs, 2px) var(--co-spacing-xxs, 2px)}.co-rte-bubble__font-section-header{padding:6px 8px 2px;font-size:11px;font-weight:600;color:var(--co-semantic-text-muted, #888);text-transform:uppercase;letter-spacing:0.5px}.co-rte-bubble__font-empty{padding:12px 8px;text-align:center;color:var(--co-semantic-text-muted, #888);font-size:12px}.co-rte-bubble__color{position:relative}.co-rte-bubble__color-dropdown{position:absolute;bottom:100%;left:50%;transform:translateX(-50%);z-index:120;width:224px;padding:var(--co-spacing-sm, 8px);background:var(--co-semantic-surface-secondary, #fff);border:1px solid var(--co-semantic-border-default, #e0e0e0);border-radius:var(--co-border-radius-xs, 8px);box-shadow:0 4px 16px rgba(0, 0, 0, 0.12);margin-bottom:4px;white-space:normal;max-width:calc(100vw - 16px)}.co-rte-bubble__color-dropdown[data-position="above"]{bottom:100%;top:auto;margin-bottom:4px;margin-top:0}.co-rte-bubble__color-dropdown[data-position="below"]{top:100%;bottom:auto;margin-top:4px;margin-bottom:0}.co-rte-bubble__color-grid{display:grid;grid-template-columns:repeat(10, 1fr);gap:2px}.co-rte-bubble__color-swatch{width:20px;height:20px;padding:0;border:none;border-radius:3px;cursor:pointer;transition:transform var(--co-motion-duration-fast), box-shadow var(--co-motion-duration-fast)}.co-rte-bubble__color-swatch:hover{transform:scale(1.2);box-shadow:0 0 0 2px var(--co-color-base-negro, #1a1a1a)}.co-rte-bubble__color-hex{display:flex;align-items:center;gap:4px;margin-top:6px}.co-rte-bubble__color-hex-input{width:100%;padding:3px 6px;border:1px solid var(--co-semantic-border-default, #ccc);border-radius:3px;background:var(--co-semantic-surface-secondary, #fff);color:var(--co-semantic-text-default, #333);font-family:var(--co-font-family-mono, monospace);font-size:11px;outline:none}.co-rte-bubble__color-hex-input:focus{border-color:var(--co-color-base-negro, #1a1a1a)}.co-rte-bubble__color-clear{display:flex;align-items:center;gap:4px;width:100%;padding:3px 6px;margin-top:4px;border:none;background:transparent;color:var(--co-semantic-text-secondary, #666);font-family:var(--co-font-family-primary);font-size:11px;cursor:pointer;border-radius:3px}.co-rte-bubble__color-clear:hover{background:var(--co-semantic-surface-hover, #f5f5f5)}.co-rte-bubble__link-form{display:flex;align-items:center;gap:4px;margin-left:4px}.co-rte-bubble__link-input{width:160px;padding:3px 8px;border:1px solid var(--co-semantic-border-default, #ccc);border-radius:4px;background:var(--co-semantic-surface-secondary, #fff);color:var(--co-semantic-text-default, #333);font-family:var(--co-font-family-primary);font-size:12px;outline:none}.co-rte-bubble__link-input::placeholder{color:var(--co-semantic-text-muted, #999)}.co-rte-bubble__link-input:focus{border-color:var(--co-color-base-negro, #1a1a1a);box-shadow:0 0 0 2px rgba(0, 0, 0, 0.1)}.co-rte-bubble__link-btn{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:none;border-radius:4px;background:var(--co-color-base-negro, #1a1a1a);color:#fff;cursor:pointer}.co-rte-bubble__link-btn:hover{opacity:0.9}.co-rte-bubble__link-unlink{background:var(--co-semantic-status-error, #aa2e1b)}.co-rte-bubble__panel{position:absolute;z-index:140;width:230px;background:var(--co-semantic-surface-secondary, #fff);border:1px solid var(--co-semantic-border-default, #e0e0e0);border-radius:var(--co-border-radius-xs, 8px);box-shadow:0 4px 16px rgba(0, 0, 0, 0.12);overflow:hidden;user-select:none}.co-rte-bubble__panel-header{display:flex;align-items:center;gap:4px;padding:6px 8px;border-bottom:1px solid var(--co-semantic-border-subtle, #eee)}.co-rte-bubble__panel-drag{cursor:grab;display:flex;align-items:center;justify-content:center;color:var(--co-semantic-text-muted, #999);flex-shrink:0}.co-rte-bubble__panel-drag:active{cursor:grabbing}.co-rte-bubble__panel-title{flex:1;font-size:12px;font-weight:600;color:var(--co-semantic-text-default, #333);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.co-rte-bubble__panel-close{display:flex;align-items:center;justify-content:center;width:22px;height:22px;border:none;border-radius:3px;background:transparent;color:var(--co-semantic-text-muted, #999);cursor:pointer;flex-shrink:0}.co-rte-bubble__panel-close:hover{background:var(--co-semantic-surface-hover, rgba(0, 0, 0, 0.06));color:var(--co-semantic-text-default, #333)}.co-rte-bubble__panel-input-wrap{padding:6px 8px}.co-rte-bubble__panel-input{width:100%;padding:4px 8px;border:1px solid var(--co-semantic-border-default, #e0e0e0);border-radius:4px;font-size:12px;font-family:inherit;outline:none;box-sizing:border-box;background:var(--co-semantic-surface-secondary, #fff);color:var(--co-semantic-text-default, #333)}.co-rte-bubble__panel-input:focus{border-color:var(--co-color-base-negro, #1a1a1a)}.co-rte-bubble__panel-options{max-height:280px;overflow-y:auto;padding:2px 4px 4px}.co-rte-bubble__panel-option{display:block;width:100%;padding:5px 8px;border:none;border-radius:3px;background:transparent;cursor:pointer;text-align:left;font-family:inherit;color:var(--co-semantic-text-default, #333)}.co-rte-bubble__panel-option:hover{background:var(--co-semantic-surface-hover, #f5f5f5)}.co-rte-bubble__panel-sep{height:1px;background:var(--co-semantic-border-subtle, #eee);margin:4px 8px}.co-rte-bubble__panel-opt-row{display:flex;justify-content:space-between;align-items:center;width:100%}.co-rte-bubble__panel-opt-value{color:var(--co-semantic-text-muted, #999);font-size:11px;font-weight:400 !important;min-width:28px;text-align:right}.co-rte-bubble__panel[data-position="above"]{bottom:100%;top:auto;margin-bottom:4px}.co-rte-bubble__panel[data-position="below"]{top:100%;bottom:auto;margin-top:4px}.co-rte-bubble__overflow{position:relative}.co-rte-bubble__overflow-menu{position:absolute;bottom:100%;right:0;z-index:130;min-width:230px;padding:4px;background:var(--co-semantic-surface-secondary, #fff);border:1px solid var(--co-semantic-border-default, #e0e0e0);border-radius:var(--co-border-radius-xs, 8px);box-shadow:0 4px 16px rgba(0, 0, 0, 0.12);margin-bottom:4px}.co-rte-bubble__overflow-menu[data-position="below"]{top:100%;bottom:auto;margin-top:4px;margin-bottom:0}.co-rte-bubble__overflow-item{display:flex;align-items:center;gap:8px;width:100%;padding:6px 8px;border:none;border-radius:4px;background:transparent;font-family:inherit;font-size:13px;color:var(--co-semantic-text-default, #333);cursor:pointer;text-align:left;white-space:nowrap}.co-rte-bubble__overflow-item:hover{background:var(--co-semantic-surface-hover, #f5f5f5)}.co-rte-bubble__overflow-item--active{background:var(--co-semantic-surface-hover, rgba(0, 0, 0, 0.06));color:var(--co-color-base-negro, #1a1a1a);font-weight:600}.co-rte-bubble__overflow-value{margin-left:auto;color:var(--co-semantic-text-muted, #999);font-size:11px}.co-rte-bubble__overflow-sep{height:1px;background:var(--co-semantic-border-subtle, #eee);margin:3px 8px}.co-rte-bubble__overflow-section-title{padding:6px 8px 2px;font-size:11px;font-weight:600;color:var(--co-semantic-text-muted, #888);letter-spacing:0.5px}.co-rte-bubble__overflow-item--danger{color:var(--co-semantic-text-error, var(--co-color-status-error, #aa2e1b))}.co-rte-bubble__overflow-item--danger:hover{background:rgba(170, 46, 27, 0.06)}.co-rte-bubble__color-indicator{display:flex;flex-direction:column;align-items:center;gap:1px;line-height:1}.co-rte-bubble__color-letter{font-family:var(--co-font-family-primary);font-size:14px;font-weight:700;color:var(--co-semantic-text-default, #333);line-height:1}.co-rte-bubble__color-bar{width:14px;height:3px;border-radius:1px}.co-rte-content .callout{display:flex;gap:0.75rem;padding:1rem;border-radius:var(--co-border-radius-xs, 8px);border:2px solid;margin:1rem 0}.co-rte-content .callout--info{background:#eff6ff;border-color:#bfdbfe}.co-rte-content .callout--warning{background:#fffbeb;border-color:#fde68a}.co-rte-content .callout--success{background:#f0fdf4;border-color:#bbf7d0}.co-rte-content .callout--error{background:#fef2f2;border-color:#fecaca}.co-rte-content .callout__icon{flex-shrink:0;font-size:1.2em}.co-rte-content .callout__content{flex:1}.co-rte-content .callout__content p{margin:0}.co-rte-content table{border-collapse:collapse;table-layout:auto;width:100%;margin:1rem 0;overflow:hidden}.co-rte-content .tableWrapper{overflow-x:auto;max-width:100%}.co-rte-content td,.co-rte-content th{min-width:1em;border:1px solid var(--co-semantic-border-default, #e0e0e0);padding:0.5rem;vertical-align:top;box-sizing:border-box;position:relative}.co-rte-content th{font-weight:600;text-align:left;background-color:#e3e3e3;color:var(--co-semantic-text-default, #333)}.co-rte-content .ProseMirror table th{background-color:#e3e3e3}.co-rte-content .selectedCell{background:rgba(0, 0, 0, 0.06)}.co-rte-content .column-resize-handle{position:absolute;right:-2px;top:0;bottom:0;width:4px;background-color:var(--co-color-base-negro, #1a1a1a);pointer-events:none}.co-rte-content .ProseMirror.resize-cursor,.co-rte-content .ProseMirror.resize-cursor *{cursor:col-resize}.co-rte-content iframe{border-radius:var(--co-border-radius-xs, 8px);max-width:100%;aspect-ratio:16 / 9;width:100%;height:auto;display:block;margin:0}.co-rte-content .co-rte-embed{position:relative;display:block;max-width:100%;margin:1rem 0;line-height:0}.co-rte-content .co-rte-embed::before{content:\'\';position:absolute;inset:0;z-index:1}.co-rte-content .co-rte-embed.ProseMirror-selectednode,.co-rte-content .co-rte-embed--selected{outline:2px solid var(--co-color-base-negro, #1a1a1a);outline-offset:2px;border-radius:var(--co-border-radius-xs, 8px)}.co-rte-content .co-rte-embed__handle{position:absolute;width:12px;height:12px;background:var(--co-color-base-negro, #1a1a1a);border:1.5px solid #fff;border-radius:50%;box-shadow:0 0 2px rgba(0, 0, 0, 0.3);z-index:3;opacity:0;pointer-events:none}.co-rte-content .co-rte-embed.ProseMirror-selectednode .co-rte-embed__handle,.co-rte-content .co-rte-embed--selected .co-rte-embed__handle{opacity:1;pointer-events:auto}.co-rte-content .co-rte-embed__handle--bottom-right{right:-6px;bottom:-6px;cursor:nwse-resize}.co-rte-content .co-rte-embed__handle--bottom-left{left:-6px;bottom:-6px;cursor:nesw-resize}.co-rte-content .co-rte-embed--resizing{outline:2px dashed var(--co-color-base-negro, #1a1a1a);outline-offset:2px}.co-rich-text-editor--readonly .co-rte-embed::before,.co-rich-text-editor--disabled .co-rte-embed::before{display:none}.co-rich-text-editor--readonly .co-rte-embed.ProseMirror-selectednode,.co-rich-text-editor--readonly .co-rte-embed--selected,.co-rich-text-editor--disabled .co-rte-embed.ProseMirror-selectednode,.co-rich-text-editor--disabled .co-rte-embed--selected{outline:none !important}.co-rte-img-layout{position:absolute;z-index:50;display:flex;align-items:center;gap:2px;padding:4px;background:var(--co-semantic-surface-secondary, #fff);border:1px solid var(--co-semantic-border-default, #e0e0e0);border-radius:var(--co-border-radius-xs, 8px);box-shadow:0 2px 12px rgba(0, 0, 0, 0.12);pointer-events:auto}.co-rte-img-layout__btn{display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;padding:0;border:1px solid transparent;border-radius:var(--co-border-radius-xxs, 4px);background:transparent;color:var(--co-semantic-text-default, #333);cursor:pointer;transition:background var(--co-motion-duration-fast), border-color var(--co-motion-duration-fast)}.co-rte-img-layout__btn:hover{background:var(--co-semantic-surface-hover, rgba(0, 0, 0, 0.06))}.co-rte-img-layout__btn--active{background:var(--co-color-base-negro, #1a1a1a);color:var(--co-color-base-blanco, #fff)}.co-rte-img-layout__btn--active:hover{background:var(--co-color-base-negro, #333)}.co-rte-img-layout__btn[data-tooltip]{position:relative}.co-rte-img-layout__btn[data-tooltip]::after{content:attr(data-tooltip);position:absolute;bottom:calc(100% + 6px);left:50%;transform:translateX(-50%);padding:4px 8px;background:var(--co-color-base-negro, #1a1a1a);color:var(--co-color-base-blanco, #fff);font-family:var(--co-font-family-primary);font-size:11px;font-weight:500;line-height:1.3;white-space:nowrap;border-radius:4px;pointer-events:none;opacity:0;transition:opacity var(--co-motion-duration-fast) var(--co-motion-ease-out);z-index:100}.co-rte-img-layout__btn[data-tooltip]:hover::after{opacity:1;transition-delay:0.3s}.co-rte-content [data-resize-container][data-image-layout="wrap-left"]{float:left;max-width:50%;margin:4px 16px 8px 0}.co-rte-content [data-resize-container][data-image-layout="wrap-right"]{float:right;max-width:50%;margin:4px 0 8px 16px}.co-rte-content [data-resize-container][data-image-layout="center"]{display:block;margin:12px auto}.co-rte-content [data-resize-container][data-image-layout="full-width"]{display:block;width:100%;margin:12px 0}.co-rte-content [data-resize-container][data-image-layout="full-width"] [data-resize-wrapper],.co-rte-content [data-resize-container][data-image-layout="full-width"] img{width:100%}@media (max-width: 768px){.co-rte-content [data-resize-container][data-image-layout="wrap-left"],.co-rte-content [data-resize-container][data-image-layout="wrap-right"]{float:none;max-width:100%;display:block;margin:12px 0}}.co-rte-content--site .ProseMirror{width:var(--co-rte-content-width, 80%);max-width:100%;margin:0 auto}@media (max-width: 768px){.co-rte-content--site .ProseMirror{width:100%}}.co-rich-text-editor--readonly [data-resize-handle],.co-rich-text-editor--disabled [data-resize-handle]{display:none !important}.co-rich-text-editor--readonly [data-resize-container].ProseMirror-selectednode,.co-rich-text-editor--disabled [data-resize-container].ProseMirror-selectednode,.co-rich-text-editor--readonly img.ProseMirror-selectednode,.co-rich-text-editor--disabled img.ProseMirror-selectednode{outline:none !important}.co-field-required{margin-left:2px;color:var(--co-semantic-text-error, var(--co-color-status-error))}.co-field-required__caption{margin-left:4px;color:var(--co-semantic-text-muted);font-size:var(--co-font-size-12);font-weight:400}.co-field-required__caption::before{content:var(--co-field-required-text, \' (required)\')}';export{p as co_rich_text_editor}
|
|
1
|
+
import{r as e,c as t,h as o,a as r}from"./p-YRicbXh3.js";import{R as i}from"./p-LnW75kr5.js";import{g as a}from"./p-EtYK1iGx.js";import{E as n,p as c,a as s,b as l,c as b,s as d,d as u}from"./p-BmdKHBZP.js";import{R as h}from"./p-pl89alJ1.js";import"./p-CqQobidl.js";import"./p-B2QLgWrz.js";import"./p-CRxTFT_z.js";const p=class{constructor(o){e(this,o),this.coInput=t(this,"coInput",7),this.coChange=t(this,"coChange",7),this.coFocus=t(this,"coFocus",7),this.coBlur=t(this,"coBlur",7),this.coClear=t(this,"coClear",7),this.coReady=t(this,"coReady",7),this.coFontPopupShow=t(this,"coFontPopupShow",7),this.coFontPopupHide=t(this,"coFontPopupHide",7),this.coAttachmentsSelected=t(this,"coAttachmentsSelected",7),this.value=null,this.preset="task",this.placeholder="",this.status="default",this.variant="default",this.disabled=!1,this.readonly=!1,this.required=!1,this.showCharacterCount=!1,this.autofocus=!1,this.toolbar="auto",this.toolbarPosition="top",this.attachmentsEnabled=!1,this.locale="en",this.ready=!1,this.hasFocus=!1,this.charCount=0,this.bubbleDragged=!1,this.bubbleDragOffset={x:0,y:0},this.bubbleDragPos={x:0,y:0},this.bubblePositionLocked=!1,this.bubbleLockPos={x:0,y:0},this.applyingBubbleLock=!1,this._loadedAccountFonts=[],this._fontLoaderCalled=!1,this._fontLoaderLoading=!1,this.echo=new n,this.applyingExternal=!1,this.rt=i,this.imgLayoutVisible=!1,this.loaded=!1,this.onToolbarMousedown=()=>{this.closeBubbleDropdowns()},this.onToolbarPopoverChange=e=>{var t;const o=null===(t=e.detail)||void 0===t?void 0:t.open;this.suppressBubble(!!o)},this.handleUpdate=e=>{if(this.refreshCharCount(),this.applyingExternal)return;const t=this.buildOutput(e);this.echo.markEmitted(t),this.coInput.emit(t),this.readonly&&this.coChange.emit(t)},this.handleFocus=()=>{this.hasFocus=!0,this.coFocus.emit()},this.handleBlur=()=>{clearTimeout(this.blurTimeout),this.blurTimeout=setTimeout((()=>{var e,t;(null===(e=this.editor)||void 0===e?void 0:e.isFocused)||(null===(t=this.bubbleEl)||void 0===t?void 0:t.contains(document.activeElement))||(this.hasFocus=!1,this.editor&&this.coChange.emit(this.buildOutput(this.editor)),this.coBlur.emit())}),100)}}connectedCallback(){this.loaded&&!this.editor&&this.mountEditor()}async componentDidLoad(){this.mountEditor(),this.loaded=!0}mountEditor(){var e,t;if(!this.contentEl)return;const o=this.loaded,r="none"!==this.resolvedToolbar&&!this.readonly&&!this.disabled;r&&(this.bubbleEl=this.createBubbleElement());const i=void 0===this.detachedContent,a=i?c(this.value):this.detachedContent;this.detachedContent=void 0,this.editor=this.rt.createEditor({preset:this.preset,element:this.contentEl,content:a,editable:!this.disabled&&!this.readonly,placeholder:this.placeholder,maxLength:this.maxLength,features:this.parsedFeatures,customExtensions:null!==(e=this.customExtensions)&&void 0!==e?e:[],bubbleMenuElement:this.bubbleEl,imageUpload:this.imageUpload,onUpdate:e=>this.handleUpdate(e),onFocus:()=>this.handleFocus(),onBlur:()=>this.handleBlur()}),"document"===this.preset&&this.contentEl.classList.add("co-rte-content--site"),r&&this.imagesEnabled&&(this.contentEl.style.position="relative",this.imgLayoutEl=this.createImageLayoutBar(),this.contentEl.appendChild(this.imgLayoutEl)),this.editor.on("transaction",(({transaction:e})=>{this.bubbleEl&&(this.updateBubbleActiveStates(),(this.bubbleDragged||this.bubblePositionLocked)&&this.bubbleEl&&this.applyBubbleFixedPosition()),this.imagesEnabled&&e.docChanged&&this.syncImageLayouts(),this.updateImageLayoutBar()})),this.bubbleEl&&this.toolbarEl&&(this.toolbarEl.addEventListener("mousedown",this.onToolbarMousedown),this.toolbarEl.addEventListener("coPopoverChange",this.onToolbarPopoverChange)),i&&this.echo.seed(null!==(t=this.value)&&void 0!==t?t:null),this.ready=!0,this.refreshCharCount(),this.syncToolbar(),this.coReady.emit(),this.autofocus&&!o&&this.editor.commands.focus(),requestAnimationFrame((()=>this.syncImageLayouts()))}disconnectedCallback(){queueMicrotask((()=>{"undefined"!=typeof window&&(this.el.isConnected||this.teardownEditor())}))}teardownEditor(){var e,t,o;clearTimeout(this.blurTimeout),clearTimeout(this.bubbleLockTimer),null===(e=this.bubbleStyleObserver)||void 0===e||e.disconnect(),this.bubbleDragMoveHandler&&document.removeEventListener("mousemove",this.bubbleDragMoveHandler),this.bubbleDragEndHandler&&document.removeEventListener("mouseup",this.bubbleDragEndHandler),this.bubbleOutsideClickHandler&&document.removeEventListener("click",this.bubbleOutsideClickHandler,!0),this.editor&&(this.detachedContent=this.editor.isEmpty?null:this.editor.getJSON(),this.editor.destroy()),this.editor=void 0,null===(t=this.bubbleEl)||void 0===t||t.remove(),this.bubbleEl=void 0,null===(o=this.imgLayoutEl)||void 0===o||o.remove(),this.imgLayoutEl=void 0,this.imgLayoutVisible=!1}componentDidRender(){this.syncToolbar()}onAccountFontsChange(){var e;if(this._fontDropdownRenderFn){const t=(null===(e=this._fontDropdownSearchInput)||void 0===e?void 0:e.value)||"";this._fontDropdownRenderFn(t)}}onValueChange(e){if(!this.editor)return void(this.loaded&&(this.detachedContent=void 0));if(this.applyingExternal)return;const t=null!=e?e:null;if(!this.echo.isEcho(t)){this.applyingExternal=!0;try{s(this.editor,t)}finally{this.applyingExternal=!1,this.echo.seed(t),this.refreshCharCount()}}}onEditableChange(){var e;null===(e=this.editor)||void 0===e||e.setEditable(!this.disabled&&!this.readonly)}async getJSON(){return this.editor&&!this.editor.isEmpty?this.editor.getJSON():null}async getHtml(){return this.editor?this.sanitizeHtml(this.editor.getHTML()):""}async getText(){var e,t;return null!==(t=null===(e=this.editor)||void 0===e?void 0:e.getText())&&void 0!==t?t:""}async clear(){this.editor&&(this.editor.commands.clearContent(!0),this.coClear.emit())}async focusEditor(){var e;null===(e=this.editor)||void 0===e||e.commands.focus()}async setContent(e){var t;null===(t=this.editor)||void 0===t||t.commands.setContent(e)}async getEditorInstance(){var e;return null!==(e=this.editor)&&void 0!==e?e:null}get imagesEnabled(){var e;const t=this.parsedFeatures;return null!==(e=null==t?void 0:t.image)&&void 0!==e?e:"document"===this.preset}get parsedFeatures(){return l(this.features)}sanitizeHtml(e){return this.rt.sanitize(e,this.preset,this.parsedFeatures)}buildOutput(e){return b(e,(e=>this.sanitizeHtml(e)))}lockBubblePosition(e=1e3){if(!this.bubbleEl)return;const t=this.bubbleEl.getBoundingClientRect();0!==t.width&&(this.bubbleLockPos={x:t.left,y:t.top},this.bubblePositionLocked=!0,clearTimeout(this.bubbleLockTimer),this.bubbleLockTimer=setTimeout((()=>{this.bubblePositionLocked=!1}),e))}applyBubbleFixedPosition(){if(!this.bubbleEl)return;const e=this.bubbleDragged?this.bubbleDragPos:this.bubbleLockPos;this.applyingBubbleLock=!0,this.bubbleEl.style.position="fixed",this.bubbleEl.style.top=`${e.y}px`,this.bubbleEl.style.left=`${e.x}px`,this.bubbleEl.style.transform="none",this.bubbleEl.style.visibility="visible",requestAnimationFrame((()=>{this.applyingBubbleLock=!1}))}setupBubbleStyleObserver(e){e.addEventListener("co-bubble-hide",(()=>{this.bubbleDragged=!1,this.bubblePositionLocked=!1,clearTimeout(this.bubbleLockTimer),this.closeBubbleDropdowns(),e.style.position="",e.style.top="",e.style.left="",e.style.transform=""})),e.addEventListener("co-bubble-show",(()=>{this.bubbleDragged=!1,this.bubblePositionLocked=!1})),this.bubbleStyleObserver=new MutationObserver((()=>{this.applyingBubbleLock||(this.bubblePositionLocked||this.bubbleDragged)&&this.applyBubbleFixedPosition()})),this.bubbleStyleObserver.observe(e,{attributes:!0,attributeFilter:["style"]})}suppressBubble(e){this.bubbleEl&&(this.bubbleEl.classList.toggle("co-rte-bubble--suppressed",e),e&&this.closeBubbleDropdowns())}closeBubbleDropdowns(){this.bubbleEl&&(this.bubbleEl.querySelectorAll(".co-rte-bubble__select-dropdown").forEach((e=>{e.style.display="none"})),this.bubbleEl.querySelectorAll(".co-rte-bubble__color-dropdown").forEach((e=>{e.style.display="none"})),this.bubbleEl.querySelectorAll(".co-rte-bubble__panel").forEach((e=>{e.style.display="none"})),this.bubbleEl.querySelectorAll(".co-rte-bubble__overflow-menu").forEach((e=>{e.style.display="none"})),this.bubbleLinkFormEl&&(this.bubbleLinkFormEl.style.display="none"))}refreshCharCount(){var e;const t=null===(e=this.editor)||void 0===e?void 0:e.storage;(null==t?void 0:t.characterCount)&&(this.charCount=t.characterCount.characters(),this.charCountEl&&(this.charCountEl.textContent=null!=this.maxLength?`${this.charCount} / ${this.maxLength}`:`${this.charCount}`))}syncToolbar(){d(this.toolbarEl,this.editor,this.imageUpload)}get resolvedToolbar(){return"auto"!==this.toolbar?this.toolbar:this.rt.defaultToolbarForPreset(this.preset)}get resolvedFontFamilies(){if(!this.fontFamilies)return p.DEFAULT_FONTS;if("string"==typeof this.fontFamilies)try{return JSON.parse(this.fontFamilies)}catch(e){return p.DEFAULT_FONTS}return this.fontFamilies}get resolvedAccountFonts(){if(this.accountFonts){if("string"==typeof this.accountFonts)try{return JSON.parse(this.accountFonts)}catch(e){return[]}return this.accountFonts}return this._loadedAccountFonts}registerFontFace(e,t){if(t&&e&&!p._registeredFonts.has(e)){p._registeredFonts.add(e);try{const o=new FontFace(e,`url("${t}")`);o.load().then((()=>document.fonts.add(o))).catch((()=>{}))}catch(e){}}}async loadFontsViaCallback(){var e,t,o;if(!this._fontLoaderCalled&&this.fontLoader){this._fontLoaderCalled=!0,this._fontLoaderLoading=!0,null===(e=this._fontDropdownRenderFn)||void 0===e||e.call(this,"");try{const e=await this.fontLoader();Array.isArray(e)&&(this._loadedAccountFonts=e.map((e=>(e.url&&this.registerFontFace(e.label,e.url),{label:e.label,value:e.value}))))}catch(e){console.error("[co-rich-text-editor] fontLoader error",e)}finally{this._fontLoaderLoading=!1;const e=(null===(t=this._fontDropdownSearchInput)||void 0===t?void 0:t.value)||"";null===(o=this._fontDropdownRenderFn)||void 0===o||o.call(this,e)}}}get helperIcon(){switch(this.status){case"error":case"warning":return"warning-circle";case"success":return"check-circle";default:return"info"}}createBubbleElement(){const e=document.createElement("div");e.className="co-rte-bubble",e.style.visibility="hidden",e.style.position="absolute",e.style.top="0",e.style.left="0",e.addEventListener("mousedown",(e=>{"INPUT"!==e.target.tagName&&e.preventDefault(),this.lockBubblePosition()})),this.bubbleOutsideClickHandler=t=>{e.contains(t.target)||this.closeBubbleDropdowns()},document.addEventListener("click",this.bubbleOutsideClickHandler,!0),this.setupBubbleStyleObserver(e);const t="document"===this.preset;if(t){const t=document.createElement("div");t.className="co-rte-bubble__drag-handle",t.innerHTML='<co-icon name="dots-six-vertical" size="14"></co-icon>',t.addEventListener("mousedown",(t=>{t.preventDefault(),t.stopPropagation();const o=e.getBoundingClientRect();this.bubbleDragOffset={x:t.clientX-o.left,y:t.clientY-o.top},this.bubbleDragged||(this.bubbleDragPos={x:o.left,y:o.top}),this.bubbleDragged=!0,this.bubbleDragMoveHandler=t=>{this.bubbleDragPos.x=t.clientX-this.bubbleDragOffset.x,this.bubbleDragPos.y=t.clientY-this.bubbleDragOffset.y,e.style.position="fixed",e.style.top=`${this.bubbleDragPos.y}px`,e.style.left=`${this.bubbleDragPos.x}px`,e.style.transform="none",e.style.visibility="visible"},this.bubbleDragEndHandler=()=>{document.removeEventListener("mousemove",this.bubbleDragMoveHandler),document.removeEventListener("mouseup",this.bubbleDragEndHandler)},document.addEventListener("mousemove",this.bubbleDragMoveHandler),document.addEventListener("mouseup",this.bubbleDragEndHandler)})),e.appendChild(t)}const o=document.createElement("div");o.className="co-rte-bubble__row";let r=null,i=null,n=null,c=null,s=null,l=null;if(t){const e=this.createBubbleFontFamilySelect();o.appendChild(e),r=this.createBubbleFontSizePanel(),o.appendChild(r.wrap),i=this.createBubbleFontWeightPanel(),o.appendChild(i.wrap),o.appendChild(this.createSep());const t=this.createBubbleColorPicker("textColor",(e=>{this.editor&&this.editor.chain().focus().setColor(e).run()}));o.appendChild(t),o.appendChild(this.createSep())}const b=a(this.locale),d=[{action:"bold",icon:"text-b",label:b.bold,check:"bold"},{action:"italic",icon:"text-italic",label:b.italic,check:"italic"}];"comment"!==this.preset&&d.push({action:"underline",icon:"text-underline",label:b.underline,check:"underline"}),d.forEach((({action:e,icon:t,label:r,check:i})=>{const a=this.createBubbleBtn(t,r,e,i,(()=>{if(!this.editor)return;const t=this.editor.chain().focus();switch(e){case"bold":t.toggleBold().run();break;case"italic":t.toggleItalic().run();break;case"underline":t.toggleUnderline().run()}}));o.appendChild(a)})),o.appendChild(this.createSep()),(t||"email"===this.preset)&&([{align:"left",icon:"text-align-left",label:b.alignLeft},{align:"center",icon:"text-align-center",label:b.center},{align:"right",icon:"text-align-right",label:b.alignRight},{align:"justify",icon:"text-align-justify",label:b.justify}].forEach((({align:e,icon:t,label:r})=>{const i=document.createElement("button");i.type="button",i.className="co-rte-bubble__btn",i.title=r,i.setAttribute("aria-label",r),i.setAttribute("data-action","textAlign"),i.setAttribute("data-align",e),i.innerHTML=`<co-icon name="${t}" size="16"></co-icon>`,i.addEventListener("click",(()=>{this.editor&&this.editor.chain().focus().setTextAlign(e).run()})),o.appendChild(i)})),o.appendChild(this.createSep())),"comment"===this.preset||t||(o.appendChild(this.createBubbleBtn("list-bullets",b.bulletList,"bulletList","bulletList",(()=>{this.editor&&this.editor.chain().focus().toggleBulletList().run()}))),o.appendChild(this.createBubbleBtn("list-numbers",b.orderedList,"orderedList","orderedList",(()=>{this.editor&&this.editor.chain().focus().toggleOrderedList().run()}))),o.appendChild(this.createSep()));const u=this.createBubbleBtn("link",b.link,"link","link",(()=>{this.editor&&this.toggleBubbleLinkForm(!0)}));o.appendChild(u),t&&(o.appendChild(this.createSep()),n=this.createBubbleLineHeightPanel(),c=this.createBubbleLetterSpacingPanel(),s=this.createBubbleBgColorPanel(),l=this.createBubbleOverflowMenu({lineHeight:n,letterSpacing:c,bgColor:s}),o.appendChild(l.overflowWrap)),e.appendChild(o),t&&(r&&e.appendChild(r.panelEl),i&&e.appendChild(i.panelEl),n&&e.appendChild(n),c&&e.appendChild(c),s&&e.appendChild(s));const h=document.createElement("div");h.className="co-rte-bubble__link-form",h.style.display="none",this.bubbleLinkFormEl=h;const p=document.createElement("input");p.type="url",p.className="co-rte-bubble__link-input",p.placeholder="https://...",this.bubbleLinkInputEl=p,p.addEventListener("keydown",(e=>{"Enter"===e.key&&this.submitBubbleLinkImperative(),"Escape"===e.key&&(e.stopPropagation(),this.toggleBubbleLinkForm(!1))}));const f=document.createElement("button");f.type="button",f.className="co-rte-bubble__link-btn",f.innerHTML='<co-icon name="check" size="14"></co-icon>',f.addEventListener("click",(()=>this.submitBubbleLinkImperative()));const m=document.createElement("button");return m.type="button",m.className="co-rte-bubble__link-btn co-rte-bubble__link-unlink",m.title=b.unlinkLink,m.innerHTML='<co-icon name="link-break" size="14"></co-icon>',m.addEventListener("click",(()=>{this.editor&&(this.editor.chain().focus().unsetLink().run(),this.toggleBubbleLinkForm(!1))})),this.bubbleLinkUnlinkEl=m,h.appendChild(p),h.appendChild(f),h.appendChild(m),e.appendChild(h),e}createSep(){const e=document.createElement("span");return e.className="co-rte-bubble__sep",e}positionDropdown(e,t){const o=e.getBoundingClientRect();t.removeAttribute("data-position"),t.style.removeProperty("left"),t.style.removeProperty("transform");const r=t.offsetWidth||224,i=window.innerHeight-o.bottom;if(t.setAttribute("data-position",i>=(t.offsetHeight||320)||i>o.top?"below":"above"),t.classList.contains("co-rte-bubble__color-dropdown")){const o=(e.parentElement||e).getBoundingClientRect(),i=o.left+o.width/2-r/2,a=i+r,n=8;i<n?(t.style.left="0",t.style.transform="none"):a>window.innerWidth-n&&(t.style.left="auto",t.style.right="0",t.style.transform="none")}}positionPanelNearBubble(e){if(!this.bubbleEl)return;const t=this.bubbleEl.querySelector(".co-rte-bubble__overflow-menu"),o=t&&"none"!==t.style.display?t.getBoundingClientRect():this.bubbleEl.getBoundingClientRect(),r=e.offsetHeight||320,i=e.offsetWidth||230;let a=o.top;a+r>window.innerHeight-8&&(a=window.innerHeight-8-r),a<8&&(a=8);let n=o.left-i-4;n<8&&(n=o.right+4),n+i>window.innerWidth-8&&(n=window.innerWidth-8-i),e.style.position="fixed",e.style.top=`${a}px`,e.style.left=`${n}px`,e.style.bottom="auto",e.style.right="auto",e.style.transform="none",e.removeAttribute("data-position")}createBubbleBtn(e,t,o,r,i){const a=document.createElement("button");return a.type="button",a.className="co-rte-bubble__btn",a.title=t,a.setAttribute("aria-label",t),a.setAttribute("data-action",o),a.setAttribute("data-check",r),a.innerHTML=`<co-icon name="${e}" size="16"></co-icon>`,a.addEventListener("click",i),a}createBubbleFontFamilySelect(){const e=document.createElement("div");e.className="co-rte-bubble__select co-rte-bubble__select--font",e.setAttribute("data-select","fontFamily");const t=document.createElement("button");t.type="button",t.className="co-rte-bubble__select-trigger",t.innerHTML='<span class="co-rte-bubble__select-label">Sans-serif</span><co-icon name="caret-down" size="12"></co-icon>';const o=document.createElement("div");o.className="co-rte-bubble__select-dropdown co-rte-bubble__select-dropdown--font",o.style.display="none";const r=document.createElement("div");r.className="co-rte-bubble__font-search";const i=document.createElement("input");i.type="text",i.className="co-rte-bubble__font-search-input",i.placeholder=a(this.locale).searchFont,r.appendChild(i),o.appendChild(r);const n=document.createElement("div");n.className="co-rte-bubble__font-list",o.appendChild(n);const c=(e,r)=>{const a=document.createElement("button");return a.type="button",a.className="co-rte-bubble__select-option",a.setAttribute("data-value",r),a.textContent=e,a.style.fontFamily=r.includes(",")?r:`"${r}", sans-serif`,a.addEventListener("click",(()=>{if(!this.editor)return;this.editor.chain().focus().setFontFamily(r).run(),o.style.display="none";const a=t.querySelector(".co-rte-bubble__select-label");a&&(a.textContent=e),i.value="",this.coFontPopupHide.emit()})),a},s=e=>{n.innerHTML="";const t=e.toLowerCase(),o=this.resolvedAccountFonts,r=this.resolvedFontFamilies,i=t?o.filter((e=>e.label.toLowerCase().includes(t))):o,s=t?r.filter((e=>e.label.toLowerCase().includes(t))):r;if(!i.length&&!s.length){const e=document.createElement("div");return e.className="co-rte-bubble__font-empty",e.textContent=a(this.locale).noResults,void n.appendChild(e)}if((this.fontsLoading||this._fontLoaderLoading)&&!i.length){const e=document.createElement("div");e.className="co-rte-bubble__font-empty",e.textContent=a(this.locale).loadingFonts,n.appendChild(e)}if(i.length){const e=document.createElement("div");e.className="co-rte-bubble__font-section-header",e.textContent=a(this.locale).importedFonts,n.appendChild(e),i.forEach((({label:e,value:t})=>n.appendChild(c(e,t))))}if(s.length){const e=document.createElement("div");e.className="co-rte-bubble__font-section-header",e.textContent=a(this.locale).systemFonts,n.appendChild(e),s.forEach((({label:e,value:t})=>n.appendChild(c(e,t))))}};return i.addEventListener("input",(()=>s(i.value))),this._fontDropdownRenderFn=s,this._fontDropdownSearchInput=i,t.addEventListener("click",(()=>{const r=e.closest(".co-rte-bubble");r&&(r.querySelectorAll(".co-rte-bubble__select-dropdown").forEach((e=>{e!==o&&(e.style.display="none")})),r.querySelectorAll(".co-rte-bubble__color-dropdown").forEach((e=>{e.style.display="none"})));const a="none"!==o.style.display;o.style.display=a?"none":"block",a?this.coFontPopupHide.emit():(this.coFontPopupShow.emit(),this.loadFontsViaCallback(),this.positionDropdown(t,o),s(""),setTimeout((()=>i.focus()),0))})),e.appendChild(t),e.appendChild(o),e}createBubbleSelect(e,t,o,r){const i=document.createElement("div");i.className="co-rte-bubble__select",i.setAttribute("data-select",e);const a=document.createElement("button");a.type="button",a.className="co-rte-bubble__select-trigger",a.innerHTML=`<span class="co-rte-bubble__select-label">${o}</span><co-icon name="caret-down" size="12"></co-icon>`;const n=document.createElement("div");return n.className="co-rte-bubble__select-dropdown",n.style.display="none",t.forEach((({label:t,value:o})=>{const i=document.createElement("button");i.type="button",i.className="co-rte-bubble__select-option",i.setAttribute("data-value",o),i.textContent=t,"fontWeight"===e&&(i.style.fontWeight=o),i.addEventListener("click",(()=>{r(o),n.style.display="none";const e=a.querySelector(".co-rte-bubble__select-label");e&&(e.textContent=t)})),n.appendChild(i)})),a.addEventListener("click",(()=>{const e=i.closest(".co-rte-bubble");e&&(e.querySelectorAll(".co-rte-bubble__select-dropdown").forEach((e=>{e!==n&&(e.style.display="none")})),e.querySelectorAll(".co-rte-bubble__color-dropdown").forEach((e=>{e.style.display="none"})));const t="none"!==n.style.display;n.style.display=t?"none":"block",t||this.positionDropdown(a,n)})),i.appendChild(a),i.appendChild(n),i}createBubbleColorPicker(e,t){const o=document.createElement("div");o.className="co-rte-bubble__color",o.setAttribute("data-color",e);const r="textColor"===e?"":"highlighter",i=document.createElement("button");i.type="button",i.className="co-rte-bubble__btn";const n=a(this.locale);i.title="textColor"===e?n.textColor:n.backgroundColor,i.innerHTML="textColor"===e?'<span class="co-rte-bubble__color-indicator"><span class="co-rte-bubble__color-letter">A</span><span class="co-rte-bubble__color-bar" style="background:#000000"></span></span>':`<co-icon name="${r}" size="16"></co-icon>`;const c=document.createElement("div");c.className="co-rte-bubble__color-dropdown",c.style.display="none";const s="textColor"===e?n.textColor:n.backgroundColor,{resetDrag:l}=this.addDragHeader(c,s);c.addEventListener("mousedown",(e=>{"INPUT"!==e.target.tagName&&e.preventDefault(),this.lockBubblePosition()}));const b=document.createElement("div");b.className="co-rte-bubble__color-grid",["#000000","#434343","#666666","#999999","#b7b7b7","#cccccc","#d9d9d9","#efefef","#f3f3f3","#ffffff","#980000","#ff0000","#ff9900","#ffff00","#00ff00","#00ffff","#4a86e8","#0000ff","#9900ff","#ff00ff","#e6b8af","#f4cccc","#fce5cd","#fff2cc","#d9ead3","#d0e0e3","#c9daf8","#cfe2f3","#d9d2e9","#ead1dc"].forEach((e=>{const o=document.createElement("button");o.type="button",o.className="co-rte-bubble__color-swatch",o.style.background=e,"#ffffff"===e&&(o.style.border="1px solid #e0e0e0"),o.addEventListener("click",(()=>{t(e),c.style.display="none"})),b.appendChild(o)}));const d=document.createElement("div");d.className="co-rte-bubble__color-hex";const u=document.createElement("input");u.type="text",u.className="co-rte-bubble__color-hex-input",u.placeholder="#hex",u.maxLength=7,u.addEventListener("keydown",(e=>{if("Enter"===e.key){const e=u.value.trim();/^#[0-9a-fA-F]{3,6}$/.test(e)&&(t(e),c.style.display="none",u.value="")}}));const h=document.createElement("button");return h.type="button",h.className="co-rte-bubble__color-clear",h.innerHTML=`<co-icon name="x" size="12"></co-icon> ${n.noColor}`,h.addEventListener("click",(()=>{this.editor&&("textColor"===e?this.editor.chain().focus().unsetColor().run():this.editor.chain().focus().unsetHighlight().run(),c.style.display="none")})),c.appendChild(b),d.appendChild(u),c.appendChild(d),c.appendChild(h),i.addEventListener("click",(()=>{const e=o.closest(".co-rte-bubble");e&&(e.querySelectorAll(".co-rte-bubble__select-dropdown").forEach((e=>{e.style.display="none"})),e.querySelectorAll(".co-rte-bubble__color-dropdown").forEach((e=>{e!==c&&(e.style.display="none")}))),"none"!==c.style.display?c.style.display="none":(l(),c.style.position="",c.style.top="",c.style.left="",c.style.bottom="",c.style.right="",c.style.transform="",c.style.display="block",this.positionDropdown(i,c))})),o.appendChild(i),o.appendChild(c),o}closeAllBubblePopups(...e){if(!this.bubbleEl)return;const t=e.filter(Boolean);this.bubbleEl.querySelectorAll(".co-rte-bubble__select-dropdown").forEach((e=>{t.includes(e)||(e.style.display="none")})),this.bubbleEl.querySelectorAll(".co-rte-bubble__color-dropdown").forEach((e=>{t.includes(e)||(e.style.display="none")})),this.bubbleEl.querySelectorAll(".co-rte-bubble__panel").forEach((e=>{t.includes(e)||(e.style.display="none")})),this.bubbleEl.querySelectorAll(".co-rte-bubble__overflow-menu").forEach((e=>{t.includes(e)||(e.style.display="none")})),this.bubbleLinkFormEl&&!t.includes(this.bubbleLinkFormEl)&&(this.bubbleLinkFormEl.style.display="none")}addDragHeader(e,t){let o=!1,r={x:0,y:0},i={x:0,y:0};const a=document.createElement("div");a.className="co-rte-bubble__panel-header";const n=document.createElement("div");n.className="co-rte-bubble__panel-drag",n.innerHTML='<co-icon name="dots-six" size="14"></co-icon>';const c=document.createElement("span");c.className="co-rte-bubble__panel-title",c.textContent=t;const s=document.createElement("button");return s.type="button",s.className="co-rte-bubble__panel-close",s.innerHTML='<co-icon name="x" size="14"></co-icon>',s.addEventListener("click",(()=>{e.style.display="none"})),a.appendChild(n),a.appendChild(c),a.appendChild(s),n.addEventListener("mousedown",(t=>{t.preventDefault(),t.stopPropagation();const a=e.getBoundingClientRect();i={x:t.clientX-a.left,y:t.clientY-a.top},o||(r={x:a.left,y:a.top}),o=!0;const n=t=>{r.x=t.clientX-i.x,r.y=t.clientY-i.y,e.style.position="fixed",e.style.top=`${r.y}px`,e.style.left=`${r.x}px`,e.style.bottom="auto",e.style.right="auto",e.style.transform="none",e.removeAttribute("data-position")},c=()=>{document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",c)};document.addEventListener("mousemove",n),document.addEventListener("mouseup",c)})),e.insertBefore(a,e.firstChild),{header:a,resetDrag:()=>{o=!1}}}createBubblePanel(e){const t=document.createElement("div");t.className="co-rte-bubble__select",t.setAttribute("data-select",e.name);const o=document.createElement("button");o.type="button",o.className="co-rte-bubble__select-trigger",o.innerHTML=`<span class="co-rte-bubble__select-label">${e.triggerLabel}</span><co-icon name="caret-down" size="12"></co-icon>`;const r=document.createElement("div");r.className="co-rte-bubble__panel",r.setAttribute("data-panel",e.name),r.style.display="none";const i=document.createElement("div");i.className="co-rte-bubble__panel-header";const a=document.createElement("div");a.className="co-rte-bubble__panel-drag",a.innerHTML='<co-icon name="dots-six" size="14"></co-icon>';const n=document.createElement("span");n.className="co-rte-bubble__panel-title",n.textContent=e.title;const c=document.createElement("button");c.type="button",c.className="co-rte-bubble__panel-close",c.innerHTML='<co-icon name="x" size="14"></co-icon>',c.addEventListener("click",(()=>{r.style.display="none"})),i.appendChild(a),i.appendChild(n),i.appendChild(c),r.appendChild(i);let s=!1,l={x:0,y:0},b={x:0,y:0};if(a.addEventListener("mousedown",(e=>{e.preventDefault(),e.stopPropagation();const t=r.getBoundingClientRect();b={x:e.clientX-t.left,y:e.clientY-t.top},s||(l={x:t.left,y:t.top}),s=!0;const o=e=>{l.x=e.clientX-b.x,l.y=e.clientY-b.y,r.style.position="fixed",r.style.top=`${l.y}px`,r.style.left=`${l.x}px`,r.style.bottom="auto",r.style.right="auto",r.style.transform="none",r.removeAttribute("data-position")},i=()=>{document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",i)};document.addEventListener("mousemove",o),document.addEventListener("mouseup",i)})),e.hasCustomInput){const t=document.createElement("div");t.className="co-rte-bubble__panel-input-wrap";const o=document.createElement("input");o.type=e.inputType||"text",o.className="co-rte-bubble__panel-input",o.placeholder=e.inputPlaceholder||"",o.addEventListener("mousedown",(e=>e.stopPropagation())),o.addEventListener("keydown",(t=>{if("Enter"===t.key){const t=o.value.trim();t&&e.onCustomInput&&(e.onCustomInput(t),o.value="")}"Escape"===t.key&&(t.stopPropagation(),r.style.display="none")})),t.appendChild(o),r.appendChild(t)}const d=document.createElement("div");return d.className="co-rte-bubble__panel-options",e.options.forEach((t=>{const o=document.createElement("button");o.type="button",o.className="co-rte-bubble__panel-option",o.setAttribute("data-value",t.value),e.renderOption?e.renderOption(t,o):o.textContent=t.label,o.addEventListener("click",(()=>{e.onSelect(t.value),r.style.display="none",s=!1})),d.appendChild(o)})),r.appendChild(d),r.addEventListener("mousedown",(e=>{"INPUT"!==e.target.tagName&&e.preventDefault(),this.lockBubblePosition()})),o.addEventListener("click",(()=>{this.closeAllBubblePopups(r),"none"!==r.style.display?r.style.display="none":(s=!1,r.style.position="",r.style.top="",r.style.left="",r.style.bottom="",r.style.right="",r.style.transform="",r.style.display="block",this.positionDropdown(o,r))})),t.appendChild(o),{wrap:t,panelEl:r,updateLabel:e=>{const t=o.querySelector(".co-rte-bubble__select-label");t&&(t.textContent=e)}}}createBubbleFontSizePanel(){const e=a(this.locale),t=[{label:e.title,value:"h1"},{label:e.heading1,value:"h2"},{label:e.heading2,value:"h3"},{label:"---",value:"---"},...["8px","10px","12px","14px","16px","18px","20px","24px","28px","32px","36px","48px","64px","72px"].map((e=>({label:e,value:e})))];return this.createBubblePanel({name:"fontSize",title:e.fontSize,triggerLabel:"16px",hasCustomInput:!0,inputType:"number",inputPlaceholder:e.writeSize,options:t,renderOption:(e,t)=>{if("---"===e.value)return t.className="co-rte-bubble__panel-sep",t.disabled=!0,void(t.style.pointerEvents="none");if("h1"===e.value)t.textContent=e.label,t.style.fontSize="24px",t.style.fontWeight="700",t.style.padding="6px 8px";else if("h2"===e.value)t.textContent=e.label,t.style.fontSize="18px",t.style.fontWeight="700",t.style.padding="5px 8px";else if("h3"===e.value)t.textContent=e.label,t.style.fontSize="15px",t.style.fontWeight="700",t.style.padding="4px 8px";else{t.textContent=e.label;const o=parseInt(e.value);t.style.fontSize=`${Math.min(o,36)}px`,t.style.lineHeight="1.3"}},onSelect:e=>{if(!this.editor||"---"===e)return;const t=this.editor.chain().focus();"h1"===e?t.toggleHeading({level:1}).run():"h2"===e?t.toggleHeading({level:2}).run():"h3"===e?t.toggleHeading({level:3}).run():t.setFontSize(e).run()},onCustomInput:e=>{if(!this.editor)return;const t=parseInt(e);t>0&&this.editor.chain().focus().setFontSize(`${t}px`).run()}})}createBubbleFontWeightPanel(){return this.createBubblePanel({name:"fontWeight",title:a(this.locale).fontWeight,triggerLabel:"Regular",hasCustomInput:!1,options:[{label:"Thin",value:"100"},{label:"Extra Light",value:"200"},{label:"Light",value:"300"},{label:"Regular",value:"400"},{label:"Medium",value:"500"},{label:"Semi Bold",value:"600"},{label:"Bold",value:"700"},{label:"Extra Bold",value:"800"},{label:"Black",value:"900"}],renderOption:(e,t)=>{t.style.fontWeight=e.value,t.innerHTML=`<span class="co-rte-bubble__panel-opt-row"><span>${e.label}</span><span class="co-rte-bubble__panel-opt-value">${e.value}</span></span>`},onSelect:e=>{this.editor&&this.editor.chain().focus().setFontWeight(e).run()}})}createBubbleLineHeightPanel(){const{panelEl:e}=this.createBubblePanel({name:"lineHeight",title:a(this.locale).lineSpacing,triggerLabel:"1.5",hasCustomInput:!0,inputPlaceholder:"1.5, 20px, 150%...",options:[{label:"0.5",value:"0.5"},{label:"1",value:"1"},{label:"1.15",value:"1.15"},{label:"1.5",value:"1.5"},{label:"1.75",value:"1.75"},{label:"2",value:"2"},{label:"2.5",value:"2.5"},{label:"3",value:"3"},{label:"---",value:"---"},{label:"16px",value:"16px"},{label:"20px",value:"20px"},{label:"24px",value:"24px"},{label:"32px",value:"32px"},{label:"---",value:"---2"},{label:"100%",value:"100%"},{label:"150%",value:"150%"},{label:"200%",value:"200%"}],renderOption:(e,t)=>{if(e.value.startsWith("---"))return t.className="co-rte-bubble__panel-sep",t.disabled=!0,void(t.style.pointerEvents="none");t.textContent=e.label},onSelect:e=>{this.editor&&!e.startsWith("---")&&this.editor.chain().focus().setLineHeight(e).run()},onCustomInput:e=>{this.editor&&this.editor.chain().focus().setLineHeight(e).run()}});return e}createBubbleLetterSpacingPanel(){const{panelEl:e}=this.createBubblePanel({name:"letterSpacing",title:a(this.locale).letterSpacing,triggerLabel:a(this.locale).normal,hasCustomInput:!0,inputPlaceholder:"Custom (em)...",options:[{label:"-0.05em",value:"-0.05em"},{label:"Normal",value:"normal"},{label:"0.05em",value:"0.05em"},{label:"0.1em",value:"0.1em"},{label:"0.2em",value:"0.2em"}],onSelect:e=>{this.editor&&("normal"===e?this.editor.chain().focus().unsetLetterSpacing().run():this.editor.chain().focus().setLetterSpacing(e).run())},onCustomInput:e=>{if(!this.editor)return;const t=e.includes("em")||e.includes("px")?e:`${e}em`;this.editor.chain().focus().setLetterSpacing(t).run()}});return e}createBubbleBgColorPanel(){const e=this.createBubbleColorPicker("bgColor",(e=>{this.editor&&this.editor.chain().focus().toggleHighlight({color:e}).run()})),t=e.querySelector(".co-rte-bubble__btn");return t&&(t.style.display="none"),e}createBubbleOverflowMenu(e){const t=document.createElement("div");t.className="co-rte-bubble__overflow";const o=document.createElement("button");o.type="button",o.className="co-rte-bubble__btn";const r=a(this.locale);o.title=r.moreOptions,o.setAttribute("aria-label",r.moreOptions),o.innerHTML='<co-icon name="dots-three" size="16"></co-icon>';const i=document.createElement("div");i.className="co-rte-bubble__overflow-menu",i.style.display="none";const{resetDrag:n}=this.addDragHeader(i,r.moreOptions);i.addEventListener("mousedown",(e=>{"INPUT"!==e.target.tagName&&e.preventDefault(),this.lockBubblePosition()})),[{icon:"text-strikethrough",label:r.strikethrough,action:"strike",check:"strike",type:"toggle"},{icon:"highlighter",label:r.backgroundColor,action:"bgColor",type:"panel",panel:e.bgColor},{icon:"list-bullets",label:r.bulletList,action:"bulletList",check:"bulletList",type:"toggle"},{icon:"list-numbers",label:r.orderedList,action:"orderedList",check:"orderedList",type:"toggle"},{icon:"text-superscript",label:r.superscript,action:"superscript",check:"superscript",type:"toggle"},{icon:"text-subscript",label:r.subscript,action:"subscript",check:"subscript",type:"toggle"},{icon:"line-segments",label:r.lineSpacing,action:"lineHeight",type:"panel",panel:e.lineHeight,valueAttr:"lineHeight"},{icon:"text-aa",label:r.letterSpacing,action:"letterSpacing",type:"panel",panel:e.letterSpacing,valueAttr:"letterSpacing"},{icon:"minus",label:r.horizontalRule,action:"horizontalRule",type:"toggle"},{icon:"eraser",label:r.clearFormat,action:"clearFormat",type:"toggle"}].forEach((e=>{if("lineHeight"===e.action||"horizontalRule"===e.action){const e=document.createElement("div");e.className="co-rte-bubble__overflow-sep",i.appendChild(e)}const t=document.createElement("button");t.type="button",t.className="co-rte-bubble__overflow-item",t.setAttribute("data-overflow-item",e.action),e.check&&t.setAttribute("data-check",e.check);let o="";e.valueAttr&&(o=`<span class="co-rte-bubble__overflow-value" data-overflow-value="${e.valueAttr}"></span>`),t.innerHTML=`<co-icon name="${e.icon}" size="16"></co-icon><span>${e.label}</span>${o}`,t.addEventListener("click",(()=>{if(!this.editor)return;if("panel"===e.type&&e.panel){if("bgColor"===e.action){const t=e.panel.querySelector(".co-rte-bubble__color-dropdown");if(t){const e="none"!==t.style.display;this.closeAllBubblePopups(i,e?void 0:t),t.style.display=e?"none":"block",e||this.positionPanelNearBubble(t)}}else{const t="none"!==e.panel.style.display;this.closeAllBubblePopups(i,t?void 0:e.panel),e.panel.style.display=t?"none":"block",t||this.positionPanelNearBubble(e.panel)}return}const t=this.editor.chain().focus();switch(e.action){case"strike":t.toggleStrike().run();break;case"bulletList":t.toggleBulletList().run();break;case"orderedList":t.toggleOrderedList().run();break;case"superscript":t.toggleSuperscript().run();break;case"subscript":t.toggleSubscript().run();break;case"horizontalRule":t.setHorizontalRule().run(),i.style.display="none";break;case"clearFormat":t.unsetAllMarks().clearNodes().run(),i.style.display="none"}})),i.appendChild(t)}));const c=document.createElement("div");c.className="co-rte-bubble__overflow-table-section",c.style.display="none";const s=document.createElement("div");s.className="co-rte-bubble__overflow-sep",c.appendChild(s);const l=document.createElement("div");l.className="co-rte-bubble__overflow-section-title",l.textContent=r.tableOptions,c.appendChild(l),[{action:"addColumnBefore",icon:"columns-plus-left",label:r.addColumnBefore},{action:"addColumnAfter",icon:"columns-plus-right",label:r.addColumnAfter},{action:"addRowBefore",icon:"rows-plus-top",label:r.addRowAbove},{action:"addRowAfter",icon:"rows-plus-bottom",label:r.addRowBelow},{action:"mergeCells",icon:"arrows-merge",label:r.mergeCells},{action:"splitCell",icon:"arrows-split",label:r.splitCell},{action:"toggleHeaderRow",icon:"rows",label:r.headerRow}].forEach((({action:e,icon:t,label:o})=>{const r=document.createElement("button");r.type="button",r.className="co-rte-bubble__overflow-item",r.setAttribute("data-overflow-item",e),"toggleHeaderRow"===e&&r.setAttribute("data-check","toggleHeaderRow"),r.innerHTML=`<co-icon name="${t}" size="16"></co-icon><span>${o}</span>`,r.addEventListener("click",(()=>{if(!this.editor)return;const t=this.editor.chain().focus();switch(e){case"addColumnAfter":t.addColumnAfter().run();break;case"addColumnBefore":t.addColumnBefore().run();break;case"addRowAfter":t.addRowAfter().run();break;case"addRowBefore":t.addRowBefore().run();break;case"mergeCells":t.mergeCells().run();break;case"splitCell":t.splitCell().run();break;case"toggleHeaderRow":t.toggleHeaderRow().run()}})),c.appendChild(r)}));const b=document.createElement("div");return b.className="co-rte-bubble__overflow-sep",c.appendChild(b),[{action:"deleteColumn",icon:"minus-square",label:r.deleteColumn},{action:"deleteRow",icon:"x-square",label:r.deleteRow},{action:"deleteTable",icon:"trash",label:r.deleteTable}].forEach((({action:e,icon:t,label:o})=>{const r=document.createElement("button");r.type="button",r.className="co-rte-bubble__overflow-item co-rte-bubble__overflow-item--danger",r.setAttribute("data-overflow-item",e),r.innerHTML=`<co-icon name="${t}" size="16"></co-icon><span>${o}</span>`,r.addEventListener("click",(()=>{if(!this.editor)return;const t=this.editor.chain().focus();switch(e){case"deleteColumn":t.deleteColumn().run();break;case"deleteRow":t.deleteRow().run();break;case"deleteTable":t.deleteTable().run(),i.style.display="none"}})),c.appendChild(r)})),i.appendChild(c),o.addEventListener("click",(()=>{this.closeAllBubblePopups(i),"none"!==i.style.display?i.style.display="none":(n(),i.style.position="",i.style.top="",i.style.left="",i.style.bottom="",i.style.right="",i.style.transform="",i.style.display="block",this.positionDropdown(o,i))})),t.appendChild(o),t.appendChild(i),{overflowWrap:t,overflowMenu:i}}toggleBubbleLinkForm(e){var t,o;if(this.bubbleLinkFormEl&&this.bubbleLinkInputEl&&(this.bubbleLinkFormEl.style.display=e?"flex":"none",e)){const e=(null===(t=this.editor)||void 0===t?void 0:t.isActive("link"))&&(null===(o=this.editor.getAttributes("link"))||void 0===o?void 0:o.href)||"";this.bubbleLinkInputEl.value=e,this.bubbleLinkUnlinkEl&&(this.bubbleLinkUnlinkEl.style.display=e?"flex":"none"),setTimeout((()=>{var e;return null===(e=this.bubbleLinkInputEl)||void 0===e?void 0:e.focus()}),0)}}submitBubbleLinkImperative(){if(!this.editor||!this.bubbleLinkInputEl)return;const e=this.bubbleLinkInputEl.value.trim();e?(this.editor.chain().focus().setLink({href:e}).run(),this.toggleBubbleLinkForm(!1)):this.toggleBubbleLinkForm(!1)}updateBubbleActiveStates(){if(!this.editor||!this.bubbleEl)return;this.bubbleEl.querySelectorAll(".co-rte-bubble__btn[data-check]").forEach((e=>{const t=e.getAttribute("data-check");t&&e.classList.toggle("co-rte-bubble__btn--active",this.editor.isActive(t))})),this.bubbleEl.querySelectorAll(".co-rte-bubble__btn[data-align]").forEach((e=>{const t=e.getAttribute("data-align");t&&e.classList.toggle("co-rte-bubble__btn--active",this.editor.isActive({textAlign:t}))}));const e=this.bubbleEl.querySelector('[data-select="fontFamily"] .co-rte-bubble__select-label');if(e){const t=this.editor.getAttributes("textStyle"),o=(null==t?void 0:t.fontFamily)||"";e.textContent=o?o.split(",")[0].replace(/['"]/g,"").trim():"Sans-serif"}const t=this.bubbleEl.querySelector('[data-select="fontSize"] .co-rte-bubble__select-label');if(t){const e=this.editor.getAttributes("textStyle"),o=a(this.locale);t.textContent=this.editor.isActive("heading",{level:1})?o.title:this.editor.isActive("heading",{level:2})?o.headingAbbr1:this.editor.isActive("heading",{level:3})?o.headingAbbr2:(null==e?void 0:e.fontSize)||"16px"}const o=this.bubbleEl.querySelector('[data-select="fontWeight"] .co-rte-bubble__select-label');if(o){const e=this.editor.getAttributes("textStyle");o.textContent={100:"Thin",200:"Extra Light",300:"Light",400:"Regular",500:"Medium",600:"Semi-bold",700:"Bold",800:"Extra-bold",900:"Black"}[(null==e?void 0:e.fontWeight)||"400"]||"Regular"}this.bubbleEl.querySelectorAll(".co-rte-bubble__overflow-item[data-check]").forEach((e=>{const t=e.getAttribute("data-check");t&&e.classList.toggle("co-rte-bubble__overflow-item--active",this.editor.isActive(t))}));const r=this.bubbleEl.querySelector('[data-overflow-value="lineHeight"]');if(r){const e=this.editor.getAttributes("paragraph"),t=this.editor.getAttributes("heading");r.textContent=(null==e?void 0:e.lineHeight)||(null==t?void 0:t.lineHeight)||""}const i=this.bubbleEl.querySelector('[data-overflow-value="letterSpacing"]');if(i){const e=this.editor.getAttributes("textStyle");i.textContent=(null==e?void 0:e.letterSpacing)||""}const n=this.bubbleEl.querySelector(".co-rte-bubble__color-bar");if(n){const e=this.editor.getAttributes("textStyle");n.style.background=(null==e?void 0:e.color)||"#000000"}const c=this.bubbleEl.querySelector(".co-rte-bubble__overflow-table-section");if(c){const e=this.editor.isActive("table");if(c.style.display=e?"block":"none",e){const e=c.querySelector('[data-overflow-item="toggleHeaderRow"]');if(e){const t=this.editor.view,{$anchor:o}=this.editor.state.selection;let r=o.depth,i=!1;for(;r>0;){if("table"===o.node(r).type.name){const e=t.nodeDOM(o.start(r)-1);if(e){const t=(e.querySelector("table")||e).querySelector("tr");i=!!t&&null!==t.querySelector("th")}break}r--}e.classList.toggle("co-rte-bubble__overflow-item--active",i)}}}}createImageLayoutBar(){const e=document.createElement("div");e.className="co-rte-img-layout",e.style.display="none",e.addEventListener("mousedown",(e=>{e.preventDefault(),e.stopPropagation()}));const t=a(this.locale),o={inline:t.imageLayoutInline,"wrap-left":t.imageLayoutWrapLeft,"wrap-right":t.imageLayoutWrapRight,center:t.imageLayoutCenter,"full-width":t.imageLayoutFullWidth};return["inline","wrap-left","wrap-right","center","full-width"].forEach((t=>{const r=document.createElement("button");r.type="button",r.className="co-rte-img-layout__btn",r.setAttribute("data-layout",t),r.setAttribute("data-tooltip",o[t]||t),r.setAttribute("aria-label",o[t]||t),r.innerHTML=`<co-icon name="${p.IMG_LAYOUT_ICONS[t]}" size="18"></co-icon>`,r.addEventListener("click",(()=>this.setImageLayout(t))),e.appendChild(r)})),e}setImageLayout(e){if(!this.editor||!this.contentEl)return;const{state:t}=this.editor,o=t.selection;if("NodeSelection"!==o.constructor.name)return;const r=o.node;if("image"!==(null==r?void 0:r.type.name))return;const i=o.from,a=t.tr.setNodeMarkup(i,void 0,Object.assign(Object.assign({},r.attrs),{imageLayout:e}));this.editor.view.dispatch(a),this.editor.commands.setNodeSelection(i),requestAnimationFrame((()=>{this.syncImageLayouts(),this.updateImageLayoutBar()}))}getSelectedImageInfo(){var e;if(!this.editor)return null;const{state:t}=this.editor,o=t.selection;if("NodeSelection"!==o.constructor.name)return null;const r=o.node;if("image"!==(null==r?void 0:r.type.name))return null;const i=o.from,a=this.editor.view.nodeDOM(i);return a?{node:r,pos:i,container:(null===(e=a.closest)||void 0===e?void 0:e.call(a,"[data-resize-container]"))||a}:null}syncImageLayouts(){this.editor&&u(this.editor)}updateImageLayoutBarPosition(){if(!this.imgLayoutEl||!this.contentEl)return;const e=this.getSelectedImageInfo();if(!e)return;const t=e.container.getBoundingClientRect(),o=this.contentEl.getBoundingClientRect(),r=this.imgLayoutEl.offsetWidth||194;let i=t.left+t.width/2-o.left+this.contentEl.scrollLeft-r/2;i=Math.max(4,Math.min(i,o.width-r-4));const a=t.bottom-o.top+this.contentEl.scrollTop+8;this.imgLayoutEl.style.left=`${i}px`,this.imgLayoutEl.style.top=`${a}px`}updateImageLayoutBar(){if(!this.imgLayoutEl||!this.editor)return;const e=this.getSelectedImageInfo();if(!e)return void(this.imgLayoutVisible&&(this.imgLayoutEl.style.display="none",this.imgLayoutVisible=!1));this.imgLayoutEl.style.display="flex",this.imgLayoutVisible=!0,this.updateImageLayoutBarPosition();const t=e.node.attrs.imageLayout||"inline";this.imgLayoutEl.querySelectorAll(".co-rte-img-layout__btn").forEach((e=>{e.classList.toggle("co-rte-img-layout__btn--active",e.getAttribute("data-layout")===t)}))}render(){const e=this.showCharacterCount||null!=this.maxLength,t="bottom"===this.toolbarPosition,r="none"!==this.resolvedToolbar&&!this.readonly&&!this.disabled&&o("co-rich-text-toolbar",{key:"7b2112db75bb679695e9bb58385d193e90d3678b",class:"co-rich-text-editor__toolbar",part:"toolbar",variant:this.resolvedToolbar,position:this.toolbarPosition,disabled:this.disabled||this.readonly,locale:this.locale,attachmentsEnabled:this.attachmentsEnabled,attachmentAccept:this.attachmentAccept,onCoAttachmentsSelected:e=>{e.stopPropagation(),this.coAttachmentsSelected.emit(e.detail)},ref:e=>this.toolbarEl=e});return o("div",{key:"8b848da977b08aa7f3466fa14403155ddc1c1d66",class:{"co-rich-text-editor":!0,"co-rich-text-editor--focused":this.hasFocus,"co-rich-text-editor--disabled":this.disabled,"co-rich-text-editor--readonly":this.readonly,"co-rich-text-editor--loading":!this.ready,[`co-rich-text-editor--${this.status}`]:"default"!==this.status,"co-rich-text-editor--flat":"flat"===this.variant,"co-rich-text-editor--toolbar-bottom":t},part:"wrapper"},(this.label||this.secondaryLabel)&&o("div",{key:"f35d59f312dabcd2b384e958a45bb7ac4a33f7bb",class:"co-rich-text-editor__labels"},this.label&&o("label",{key:"e7b2d47de7356e4a89fabf925255dbf0d25fc8e9",class:"co-rich-text-editor__label",part:"label"},this.label,o(h,{key:"f56500b0382d9d12c7f78b4448aab7cc748271be",required:this.required})),this.secondaryLabel&&o("span",{key:"e305aecd4fee9963221210ac076791f456aad91c",class:"co-rich-text-editor__secondary-label"},this.secondaryLabel)),o("div",{key:"284ff5c06606efef9a06de80478acc57868229eb",class:"co-rich-text-editor__frame"},!t&&r,o("div",{key:"145b244c505ae5374bd847855978da02baa878cc",class:"co-rich-text-editor__box"},o("div",{key:"c5f02991df3e712a3e6a0163415a75c5e91e4384",class:"co-rte-content",part:"content",role:"textbox","aria-multiline":"true","aria-label":this.label,"aria-required":this.required?"true":void 0,"aria-invalid":"error"===this.status?"true":void 0,ref:e=>this.contentEl=e})),o("slot",{key:"060e3e5bcda76b403357ada26950c9f50a71076e",name:"content-end"}),t&&o("div",{key:"2ec4329cfc09714a78caab5ca774f08af2984729",class:"co-rich-text-editor__toolbar-row",part:"toolbar-row"},r,o("slot",{key:"806f94a2d924df1b33d5fcf5d28279b093f69845",name:"toolbar-end"}))),o("div",{key:"8fcb92d7f3404c7458f95fc578fbb579ecb4b5e7",class:"co-rich-text-editor__footer"},this.helperText&&o("div",{key:"b1b664ceb090e940cadc3aa782eb074e6517146a",class:`co-rich-text-editor__helper co-rich-text-editor__helper--${this.status}`,part:"helper"},o("co-icon",{key:"a8db33f94d1aec0bc62bd9ee709d4cff914fc51c",name:this.helperIcon,size:14}),o("span",{key:"be99a15b919ea82668da83854735b80eaf03ebf7"},this.helperText)),e&&o("span",{key:"dfde31e7c4f62fc9cf9fc3654f5eb6a2377dcf9a",class:"co-rich-text-editor__count",ref:e=>this.charCountEl=e},this.charCount,null!=this.maxLength?` / ${this.maxLength}`:"")))}get el(){return r(this)}static get watchers(){return{accountFonts:[{onAccountFontsChange:0}],value:[{onValueChange:0}],disabled:[{onEditableChange:0}],readonly:[{onEditableChange:0}]}}};p.DEFAULT_FONTS=[{label:"Arial",value:"Arial, sans-serif"},{label:"Calibri",value:"Calibri, sans-serif"},{label:"Cambria",value:"Cambria, serif"},{label:"Comic Sans MS",value:"'Comic Sans MS', cursive"},{label:"Courier New",value:"'Courier New', monospace"},{label:"Georgia",value:"Georgia, serif"},{label:"Geist",value:"'Geist', sans-serif"},{label:"Helvetica",value:"Helvetica, Arial, sans-serif"},{label:"Impact",value:"Impact, sans-serif"},{label:"Inter",value:"'Inter', sans-serif"},{label:"Lato",value:"'Lato', sans-serif"},{label:"Montserrat",value:"'Montserrat', sans-serif"},{label:"Open Sans",value:"'Open Sans', sans-serif"},{label:"Poppins",value:"'Poppins', sans-serif"},{label:"Roboto",value:"'Roboto', sans-serif"},{label:"Segoe UI",value:"'Segoe UI', sans-serif"},{label:"Tahoma",value:"Tahoma, sans-serif"},{label:"Times New Roman",value:"'Times New Roman', serif"},{label:"Trebuchet MS",value:"'Trebuchet MS', sans-serif"},{label:"Verdana",value:"Verdana, sans-serif"}],p._registeredFonts=new Set,p.IMG_LAYOUT_ICONS={inline:"image-square","wrap-left":"text-align-left","wrap-right":"text-align-right",center:"text-align-center","full-width":"arrows-horizontal"},p.style='co-rich-text-editor{display:block;font-family:var(--co-font-family-primary);font-size:var(--co-font-size-14);letter-spacing:var(--co-font-letter-spacing-body)}.co-rich-text-editor{display:flex;flex-direction:column;gap:var(--co-spacing-sm2, 6px)}.co-rich-text-editor__labels{display:flex;align-items:center;justify-content:space-between;padding:0 var(--co-spacing-xs);gap:var(--co-spacing-sm2, 6px)}.co-rich-text-editor__label,.co-rich-text-editor__secondary-label{color:var(--co-semantic-text-secondary);font-size:var(--co-font-size-14);font-weight:400;line-height:1}.co-rich-text-editor__frame{display:flex;flex-direction:column;background:var(--co-semantic-surface-page);border:1px solid var(--co-semantic-border-field);border-radius:var(--co-border-radius-xs);transition:border-color var(--co-motion-duration-fast) var(--co-motion-ease-out), box-shadow var(--co-motion-duration-fast) var(--co-motion-ease-out);min-height:0;flex:1;position:relative;overflow:visible}.co-rich-text-editor__box{display:flex;flex-direction:column;min-height:0;flex:1;position:relative;overflow-y:auto;overflow-x:hidden}.co-rich-text-editor--flat .co-rich-text-editor__frame{background:transparent;border-color:transparent}.co-rich-text-editor--focused .co-rich-text-editor__frame{border-color:var(--co-semantic-border-focus, var(--co-color-base-negro, #1a1a1a));box-shadow:0 0 0 3px var(--co-semantic-border-focus-ring, rgba(37, 99, 235, 0.15))}.co-rich-text-editor--error .co-rich-text-editor__frame{border-color:var(--co-semantic-border-error, var(--co-color-status-error))}.co-rich-text-editor--success .co-rich-text-editor__frame{border-color:var(--co-color-status-success)}.co-rich-text-editor--disabled .co-rich-text-editor__frame,.co-rich-text-editor--readonly .co-rich-text-editor__frame{opacity:0.7;cursor:not-allowed}.co-rich-text-editor--loading .co-rte-content{min-height:96px;background:linear-gradient(90deg, var(--co-semantic-surface-secondary) 0%, var(--co-semantic-surface-hover, rgba(0, 0, 0, 0.04)) 50%, var(--co-semantic-surface-secondary) 100%);background-size:200% 100%;animation:co-rte-skeleton 1.2s ease-in-out infinite}@keyframes co-rte-skeleton{0%{background-position:200% 0}100%{background-position:-200% 0}}.co-rich-text-editor__toolbar{position:relative;flex-shrink:0;z-index:60;border-top-left-radius:calc(var(--co-border-radius-xs) - 1px);border-top-right-radius:calc(var(--co-border-radius-xs) - 1px)}.co-rich-text-editor__toolbar-row{display:flex;align-items:center;justify-content:space-between;gap:var(--co-spacing-md);flex-shrink:0;min-width:0;border-top:1px solid var(--co-semantic-border-subtle)}.co-rich-text-editor--toolbar-bottom .co-rich-text-editor__toolbar{border-top-left-radius:0;border-top-right-radius:0;min-width:0}.co-rte-content{min-height:96px;color:var(--co-semantic-text-default);flex:1 0 auto;display:flex;flex-direction:column}.co-rte-content .ProseMirror{outline:none;flex:1 0 auto;line-height:1.5;padding:var(--co-spacing-md);box-sizing:border-box}.co-rte-content .ProseMirror p{margin:0 0 var(--co-spacing-sm) 0}.co-rte-content .ProseMirror p:last-child{margin-bottom:0}.co-rte-content .ProseMirror>p{margin-bottom:var(--co-spacing-sm) !important}.co-rte-content .ProseMirror>p:last-child{margin-bottom:0 !important}.co-rte-content .ProseMirror [style*="text-align: justify"]{text-align-last:left}.co-rte-content .ProseMirror [style*="text-align: center"]{text-align:center}.co-rte-content .ProseMirror [style*="text-align: right"]{text-align:right}.co-rte-content .ProseMirror h1,.co-rte-content .ProseMirror h2,.co-rte-content .ProseMirror h3,.co-rte-content .ProseMirror h4{margin:var(--co-spacing-md) 0 var(--co-spacing-sm);font-weight:600;line-height:1.3}.co-rte-content .ProseMirror h1{font-size:var(--co-font-size-28, 28px)}.co-rte-content .ProseMirror h2{font-size:var(--co-font-size-20, 20px)}.co-rte-content .ProseMirror h3{font-size:var(--co-font-size-16, 16px)}.co-rte-content .ProseMirror ul,.co-rte-content .ProseMirror ol{padding-left:var(--co-spacing-xl);margin:0 0 var(--co-spacing-sm) 0}.co-rte-content .ProseMirror ul[data-type="taskList"]{list-style:none;padding-left:0;margin:0 0 var(--co-spacing-sm) 0}.co-rte-content .ProseMirror ul[data-type="taskList"] li{display:flex;align-items:flex-start;gap:var(--co-spacing-sm, 8px)}.co-rte-content .ProseMirror ul[data-type="taskList"] li>label{flex:0 0 auto;margin-top:0.15em;user-select:none}.co-rte-content .ProseMirror ul[data-type="taskList"] li>div{flex:1 1 auto;min-width:0}.co-rte-content .ProseMirror ul[data-type="taskList"] li>div>p{margin:0}.co-rte-content .ProseMirror ul[data-type="taskList"] input[type="checkbox"]{width:16px;height:16px;cursor:pointer;accent-color:var(--co-color-base-negro, #1a1a1a)}.co-rte-content .ProseMirror ul[data-type="taskList"][data-variant="strike"] li[data-checked="true"]>div{text-decoration:line-through;color:var(--co-semantic-text-muted, #999)}.co-rte-content .ProseMirror ul[data-type="taskList"][data-variant="plain"] li[data-checked="true"]>div{text-decoration:none}.co-rte-content .ProseMirror blockquote{border-left:3px solid var(--co-semantic-border-default, var(--co-semantic-border-subtle));padding-left:var(--co-spacing-md);margin:0 0 var(--co-spacing-sm) 0;color:var(--co-semantic-text-secondary)}.co-rte-content .ProseMirror a{color:var(--co-color-base-negro, #1a1a1a);text-decoration:underline;text-underline-offset:2px}.co-rte-content .ProseMirror img{max-width:100%;height:auto;border-radius:var(--co-border-radius-xs);margin:var(--co-spacing-sm) 0;cursor:default;-webkit-user-drag:none;user-select:none}.co-rte-content .ProseMirror img.ProseMirror-selectednode{outline:2px solid var(--co-color-base-negro, #1a1a1a)}.co-rte-content [data-resize-container].ProseMirror-selectednode{outline:2px solid var(--co-color-base-negro, #1a1a1a);outline-offset:0px;border-radius:0}.co-rte-content [data-resize-container]{position:relative;display:inline-block;width:fit-content;max-width:100%;margin:var(--co-spacing-sm) 0;line-height:0}.co-rte-content [data-resize-container][data-resize-state="true"]{outline:2px solid var(--co-color-base-negro, #1a1a1a);outline-offset:0px;border-radius:0}.co-rte-content [data-resize-wrapper]{position:relative;display:inline-block;line-height:0}.co-rte-content [data-resize-handle]{width:10px;height:10px;background:var(--co-color-base-negro, #1a1a1a);border:1.5px solid #fff;border-radius:50%;box-shadow:0 0 2px rgba(0, 0, 0, 0.3);z-index:5;opacity:0;pointer-events:none}.co-rte-content [data-resize-container][data-resize-state="true"] [data-resize-handle],.co-rte-content [data-resize-container].ProseMirror-selectednode [data-resize-handle]{opacity:1;pointer-events:auto}.co-rte-content [data-resize-handle="top-left"]{cursor:nw-resize}.co-rte-content [data-resize-handle="top-right"]{cursor:ne-resize}.co-rte-content [data-resize-handle="bottom-left"]{cursor:sw-resize}.co-rte-content [data-resize-handle="bottom-right"]{cursor:se-resize}.co-rte-content [data-resize-handle="top"],.co-rte-content [data-resize-handle="bottom"]{width:30px;height:6px;border-radius:3px;left:50% !important;transform:translateX(-50%)}.co-rte-content [data-resize-handle="top"]{cursor:n-resize}.co-rte-content [data-resize-handle="bottom"]{cursor:s-resize}.co-rte-content [data-resize-handle="left"],.co-rte-content [data-resize-handle="right"]{width:6px;height:30px;border-radius:3px;top:50% !important;transform:translateY(-50%)}.co-rte-content [data-resize-handle="left"]{cursor:w-resize}.co-rte-content [data-resize-handle="right"]{cursor:e-resize}.co-rte-content [data-resize-container] img{max-width:100%;display:block;border-radius:0;margin:0}.co-rte-content .ProseMirror hr{border:none;border-top:1px solid var(--co-semantic-border-default, #e0e0e0);margin:var(--co-spacing-lg) 0}.co-rte-content .ProseMirror code{font-family:var(--co-font-family-mono);font-size:0.9em;background:var(--co-semantic-surface-hover, rgba(0, 0, 0, 0.06));padding:0.1em 0.3em;border-radius:var(--co-border-radius-xxs)}.co-rte-content .ProseMirror pre{font-family:var(--co-font-family-mono);font-size:0.9em;background:var(--co-semantic-surface-hover, rgba(0, 0, 0, 0.06));padding:var(--co-spacing-md);border-radius:var(--co-border-radius-xs);overflow-x:auto;margin:var(--co-spacing-sm) 0}.co-rte-content .ProseMirror pre code{background:none;padding:0;border-radius:0}.co-rte-content .ProseMirror p.is-editor-empty:first-child::before{content:attr(data-placeholder);color:var(--co-semantic-text-muted);float:left;height:0;pointer-events:none}.co-rte-content .co-rte-variable,.co-rte-content .co-rte-mention{display:inline-block;padding:0.05em 0.4em;border-radius:var(--co-border-radius-xxs);background:var(--co-color-base-negro, #1a1a1a);color:var(--co-color-base-blanco, #fff);font-size:0.9em;white-space:nowrap}.co-rte-content .co-rte-mention{background:var(--co-color-azul-200);color:var(--co-color-azul-800)}.co-rich-text-editor__footer{display:flex;align-items:center;justify-content:space-between;gap:var(--co-spacing-sm);padding:0 var(--co-spacing-xs);min-height:0}.co-rich-text-editor__helper{display:flex;align-items:center;gap:var(--co-spacing-xs);color:var(--co-semantic-text-secondary);font-size:var(--co-font-size-12, 12px)}.co-rich-text-editor__helper--error{color:var(--co-semantic-text-error, var(--co-color-status-error))}.co-rich-text-editor__helper--success{color:var(--co-semantic-text-success, var(--co-color-status-success))}.co-rich-text-editor__count{margin-left:auto;color:var(--co-semantic-text-muted);font-size:var(--co-font-size-12, 12px)}.co-rte-bubble.co-rte-bubble--suppressed{display:none !important}.co-rte-bubble{position:absolute;z-index:50;display:flex;flex-direction:row;align-items:center;gap:2px;padding:var(--co-spacing-xs, 4px) var(--co-spacing-sm, 8px);background:var(--co-semantic-surface-secondary, #fff);border:1px solid var(--co-semantic-border-default, #e0e0e0);border-radius:var(--co-border-radius-xs, 8px);box-shadow:0 4px 16px rgba(0, 0, 0, 0.12);user-select:none;white-space:nowrap;max-width:100%;box-sizing:border-box;flex-wrap:wrap}.co-rte-bubble__drag-handle{display:flex;align-items:center;justify-content:center;cursor:grab;color:var(--co-semantic-text-muted, #999);width:18px;height:28px;margin:0 2px 0 0;flex-shrink:0}.co-rte-bubble__drag-handle:hover{color:var(--co-semantic-text-secondary, #555)}.co-rte-bubble__drag-handle:active{cursor:grabbing}.co-rte-bubble__row{display:flex;align-items:center;gap:2px;flex-wrap:wrap;max-width:100%;min-width:0}.co-rte-bubble__btn{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;padding:0;border:none;border-radius:var(--co-border-radius-xxs, 4px);background:transparent;color:var(--co-semantic-text-default, #333);cursor:pointer}.co-rte-bubble__btn:hover:not(.co-rte-bubble__btn--active){background:var(--co-semantic-surface-hover, rgba(0, 0, 0, 0.06))}.co-rte-bubble__btn--active{background:var(--co-color-base-negro, #1a1a1a);color:var(--co-color-base-blanco, #fff)}.co-rte-bubble__btn--active:hover{background:var(--co-color-base-negro, #333)}.co-rte-bubble__sep{display:inline-block;width:1px;height:18px;margin:0 4px;background:var(--co-semantic-border-default, rgba(0, 0, 0, 0.12));flex-shrink:0}.co-rte-bubble__select{position:relative}.co-rte-bubble__select-trigger{display:flex;align-items:center;gap:2px;height:28px;padding:0 6px;border:1px solid transparent;border-radius:var(--co-border-radius-xxs, 4px);background:transparent;color:var(--co-semantic-text-default, #333);font-family:var(--co-font-family-primary);font-size:11px;cursor:pointer;white-space:nowrap;transition:background var(--co-motion-duration-fast), border-color var(--co-motion-duration-fast)}.co-rte-bubble__select-trigger:hover{background:var(--co-semantic-surface-hover, #f5f5f5);border-color:var(--co-semantic-border-default, #e0e0e0)}.co-rte-bubble__select-label{max-width:72px;overflow:hidden;text-overflow:ellipsis}.co-rte-bubble__select--font .co-rte-bubble__select-label{max-width:110px}.co-rte-bubble__select-dropdown{position:absolute;bottom:100%;left:0;z-index:120;min-width:100px;max-height:260px;overflow-y:auto;padding:var(--co-spacing-xxs, 2px);background:var(--co-semantic-surface-secondary, #fff);border:1px solid var(--co-semantic-border-default, #e0e0e0);border-radius:var(--co-border-radius-xxs, 4px);box-shadow:0 4px 16px rgba(0, 0, 0, 0.12);margin-bottom:4px;white-space:normal}.co-rte-bubble__select-dropdown[data-position="above"]{bottom:100%;top:auto;margin-bottom:4px;margin-top:0}.co-rte-bubble__select-dropdown[data-position="below"]{top:100%;bottom:auto;margin-top:4px;margin-bottom:0}.co-rte-bubble__select-option{display:block;width:100%;padding:4px 8px;border:none;border-radius:3px;background:transparent;color:var(--co-semantic-text-default, #333);font-family:var(--co-font-family-primary);font-size:12px;text-align:left;cursor:pointer;white-space:nowrap}.co-rte-bubble__select-option:hover{background:var(--co-semantic-surface-hover, #f5f5f5)}.co-rte-bubble__select-dropdown--font{min-width:200px;max-height:320px;overflow:hidden;overflow-y:auto;display:flex;flex-direction:column;white-space:normal}.co-rte-bubble__font-search{padding:6px 6px 4px;flex-shrink:0}.co-rte-bubble__font-search-input{width:100%;padding:4px 8px;border:1px solid var(--co-semantic-border-default, #ccc);border-radius:4px;background:var(--co-semantic-surface-secondary, #fff);color:var(--co-semantic-text-default, #333);font-family:var(--co-font-family-primary);font-size:12px;outline:none;box-sizing:border-box}.co-rte-bubble__font-search-input:focus{border-color:var(--co-color-base-negro, #1a1a1a)}.co-rte-bubble__font-list{max-height:260px;overflow-y:auto;padding:0 var(--co-spacing-xxs, 2px) var(--co-spacing-xxs, 2px)}.co-rte-bubble__font-section-header{padding:6px 8px 2px;font-size:11px;font-weight:600;color:var(--co-semantic-text-muted, #888);text-transform:uppercase;letter-spacing:0.5px}.co-rte-bubble__font-empty{padding:12px 8px;text-align:center;color:var(--co-semantic-text-muted, #888);font-size:12px}.co-rte-bubble__color{position:relative}.co-rte-bubble__color-dropdown{position:absolute;bottom:100%;left:50%;transform:translateX(-50%);z-index:120;width:224px;padding:var(--co-spacing-sm, 8px);background:var(--co-semantic-surface-secondary, #fff);border:1px solid var(--co-semantic-border-default, #e0e0e0);border-radius:var(--co-border-radius-xs, 8px);box-shadow:0 4px 16px rgba(0, 0, 0, 0.12);margin-bottom:4px;white-space:normal;max-width:calc(100vw - 16px)}.co-rte-bubble__color-dropdown[data-position="above"]{bottom:100%;top:auto;margin-bottom:4px;margin-top:0}.co-rte-bubble__color-dropdown[data-position="below"]{top:100%;bottom:auto;margin-top:4px;margin-bottom:0}.co-rte-bubble__color-grid{display:grid;grid-template-columns:repeat(10, 1fr);gap:2px}.co-rte-bubble__color-swatch{width:20px;height:20px;padding:0;border:none;border-radius:3px;cursor:pointer;transition:transform var(--co-motion-duration-fast), box-shadow var(--co-motion-duration-fast)}.co-rte-bubble__color-swatch:hover{transform:scale(1.2);box-shadow:0 0 0 2px var(--co-color-base-negro, #1a1a1a)}.co-rte-bubble__color-hex{display:flex;align-items:center;gap:4px;margin-top:6px}.co-rte-bubble__color-hex-input{width:100%;padding:3px 6px;border:1px solid var(--co-semantic-border-default, #ccc);border-radius:3px;background:var(--co-semantic-surface-secondary, #fff);color:var(--co-semantic-text-default, #333);font-family:var(--co-font-family-mono, monospace);font-size:11px;outline:none}.co-rte-bubble__color-hex-input:focus{border-color:var(--co-color-base-negro, #1a1a1a)}.co-rte-bubble__color-clear{display:flex;align-items:center;gap:4px;width:100%;padding:3px 6px;margin-top:4px;border:none;background:transparent;color:var(--co-semantic-text-secondary, #666);font-family:var(--co-font-family-primary);font-size:11px;cursor:pointer;border-radius:3px}.co-rte-bubble__color-clear:hover{background:var(--co-semantic-surface-hover, #f5f5f5)}.co-rte-bubble__link-form{display:flex;align-items:center;gap:4px;margin-left:4px}.co-rte-bubble__link-input{width:160px;padding:3px 8px;border:1px solid var(--co-semantic-border-default, #ccc);border-radius:4px;background:var(--co-semantic-surface-secondary, #fff);color:var(--co-semantic-text-default, #333);font-family:var(--co-font-family-primary);font-size:12px;outline:none}.co-rte-bubble__link-input::placeholder{color:var(--co-semantic-text-muted, #999)}.co-rte-bubble__link-input:focus{border-color:var(--co-color-base-negro, #1a1a1a);box-shadow:0 0 0 2px rgba(0, 0, 0, 0.1)}.co-rte-bubble__link-btn{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:none;border-radius:4px;background:var(--co-color-base-negro, #1a1a1a);color:#fff;cursor:pointer}.co-rte-bubble__link-btn:hover{opacity:0.9}.co-rte-bubble__link-unlink{background:var(--co-semantic-status-error, #aa2e1b)}.co-rte-bubble__panel{position:absolute;z-index:140;width:230px;background:var(--co-semantic-surface-secondary, #fff);border:1px solid var(--co-semantic-border-default, #e0e0e0);border-radius:var(--co-border-radius-xs, 8px);box-shadow:0 4px 16px rgba(0, 0, 0, 0.12);overflow:hidden;user-select:none}.co-rte-bubble__panel-header{display:flex;align-items:center;gap:4px;padding:6px 8px;border-bottom:1px solid var(--co-semantic-border-subtle, #eee)}.co-rte-bubble__panel-drag{cursor:grab;display:flex;align-items:center;justify-content:center;color:var(--co-semantic-text-muted, #999);flex-shrink:0}.co-rte-bubble__panel-drag:active{cursor:grabbing}.co-rte-bubble__panel-title{flex:1;font-size:12px;font-weight:600;color:var(--co-semantic-text-default, #333);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.co-rte-bubble__panel-close{display:flex;align-items:center;justify-content:center;width:22px;height:22px;border:none;border-radius:3px;background:transparent;color:var(--co-semantic-text-muted, #999);cursor:pointer;flex-shrink:0}.co-rte-bubble__panel-close:hover{background:var(--co-semantic-surface-hover, rgba(0, 0, 0, 0.06));color:var(--co-semantic-text-default, #333)}.co-rte-bubble__panel-input-wrap{padding:6px 8px}.co-rte-bubble__panel-input{width:100%;padding:4px 8px;border:1px solid var(--co-semantic-border-default, #e0e0e0);border-radius:4px;font-size:12px;font-family:inherit;outline:none;box-sizing:border-box;background:var(--co-semantic-surface-secondary, #fff);color:var(--co-semantic-text-default, #333)}.co-rte-bubble__panel-input:focus{border-color:var(--co-color-base-negro, #1a1a1a)}.co-rte-bubble__panel-options{max-height:280px;overflow-y:auto;padding:2px 4px 4px}.co-rte-bubble__panel-option{display:block;width:100%;padding:5px 8px;border:none;border-radius:3px;background:transparent;cursor:pointer;text-align:left;font-family:inherit;color:var(--co-semantic-text-default, #333)}.co-rte-bubble__panel-option:hover{background:var(--co-semantic-surface-hover, #f5f5f5)}.co-rte-bubble__panel-sep{height:1px;background:var(--co-semantic-border-subtle, #eee);margin:4px 8px}.co-rte-bubble__panel-opt-row{display:flex;justify-content:space-between;align-items:center;width:100%}.co-rte-bubble__panel-opt-value{color:var(--co-semantic-text-muted, #999);font-size:11px;font-weight:400 !important;min-width:28px;text-align:right}.co-rte-bubble__panel[data-position="above"]{bottom:100%;top:auto;margin-bottom:4px}.co-rte-bubble__panel[data-position="below"]{top:100%;bottom:auto;margin-top:4px}.co-rte-bubble__overflow{position:relative}.co-rte-bubble__overflow-menu{position:absolute;bottom:100%;right:0;z-index:130;min-width:230px;padding:4px;background:var(--co-semantic-surface-secondary, #fff);border:1px solid var(--co-semantic-border-default, #e0e0e0);border-radius:var(--co-border-radius-xs, 8px);box-shadow:0 4px 16px rgba(0, 0, 0, 0.12);margin-bottom:4px}.co-rte-bubble__overflow-menu[data-position="below"]{top:100%;bottom:auto;margin-top:4px;margin-bottom:0}.co-rte-bubble__overflow-item{display:flex;align-items:center;gap:8px;width:100%;padding:6px 8px;border:none;border-radius:4px;background:transparent;font-family:inherit;font-size:13px;color:var(--co-semantic-text-default, #333);cursor:pointer;text-align:left;white-space:nowrap}.co-rte-bubble__overflow-item:hover{background:var(--co-semantic-surface-hover, #f5f5f5)}.co-rte-bubble__overflow-item--active{background:var(--co-semantic-surface-hover, rgba(0, 0, 0, 0.06));color:var(--co-color-base-negro, #1a1a1a);font-weight:600}.co-rte-bubble__overflow-value{margin-left:auto;color:var(--co-semantic-text-muted, #999);font-size:11px}.co-rte-bubble__overflow-sep{height:1px;background:var(--co-semantic-border-subtle, #eee);margin:3px 8px}.co-rte-bubble__overflow-section-title{padding:6px 8px 2px;font-size:11px;font-weight:600;color:var(--co-semantic-text-muted, #888);letter-spacing:0.5px}.co-rte-bubble__overflow-item--danger{color:var(--co-semantic-text-error, var(--co-color-status-error, #aa2e1b))}.co-rte-bubble__overflow-item--danger:hover{background:rgba(170, 46, 27, 0.06)}.co-rte-bubble__color-indicator{display:flex;flex-direction:column;align-items:center;gap:1px;line-height:1}.co-rte-bubble__color-letter{font-family:var(--co-font-family-primary);font-size:14px;font-weight:700;color:var(--co-semantic-text-default, #333);line-height:1}.co-rte-bubble__color-bar{width:14px;height:3px;border-radius:1px}.co-rte-content .callout{display:flex;gap:0.75rem;padding:1rem;border-radius:var(--co-border-radius-xs, 8px);border:2px solid;margin:1rem 0}.co-rte-content .callout--info{background:#eff6ff;border-color:#bfdbfe}.co-rte-content .callout--warning{background:#fffbeb;border-color:#fde68a}.co-rte-content .callout--success{background:#f0fdf4;border-color:#bbf7d0}.co-rte-content .callout--error{background:#fef2f2;border-color:#fecaca}.co-rte-content .callout__icon{flex-shrink:0;font-size:1.2em}.co-rte-content .callout__content{flex:1}.co-rte-content .callout__content p{margin:0}.co-rte-content table{border-collapse:collapse;table-layout:auto;width:100%;margin:1rem 0;overflow:hidden}.co-rte-content .tableWrapper{overflow-x:auto;max-width:100%}.co-rte-content td,.co-rte-content th{min-width:1em;border:1px solid var(--co-semantic-border-default, #e0e0e0);padding:0.5rem;vertical-align:top;box-sizing:border-box;position:relative}.co-rte-content th{font-weight:600;text-align:left;background-color:#e3e3e3;color:var(--co-semantic-text-default, #333)}.co-rte-content .ProseMirror table th{background-color:#e3e3e3}.co-rte-content .selectedCell{background:rgba(0, 0, 0, 0.06)}.co-rte-content .column-resize-handle{position:absolute;right:-2px;top:0;bottom:0;width:4px;background-color:var(--co-color-base-negro, #1a1a1a);pointer-events:none}.co-rte-content .ProseMirror.resize-cursor,.co-rte-content .ProseMirror.resize-cursor *{cursor:col-resize}.co-rte-content iframe{border-radius:var(--co-border-radius-xs, 8px);max-width:100%;aspect-ratio:16 / 9;width:100%;height:auto;display:block;margin:0}.co-rte-content .co-rte-embed{position:relative;display:block;max-width:100%;margin:1rem 0;line-height:0}.co-rte-content .co-rte-embed::before{content:\'\';position:absolute;inset:0;z-index:1}.co-rte-content .co-rte-embed.ProseMirror-selectednode,.co-rte-content .co-rte-embed--selected{outline:2px solid var(--co-color-base-negro, #1a1a1a);outline-offset:2px;border-radius:var(--co-border-radius-xs, 8px)}.co-rte-content .co-rte-embed__handle{position:absolute;width:12px;height:12px;background:var(--co-color-base-negro, #1a1a1a);border:1.5px solid #fff;border-radius:50%;box-shadow:0 0 2px rgba(0, 0, 0, 0.3);z-index:3;opacity:0;pointer-events:none}.co-rte-content .co-rte-embed.ProseMirror-selectednode .co-rte-embed__handle,.co-rte-content .co-rte-embed--selected .co-rte-embed__handle{opacity:1;pointer-events:auto}.co-rte-content .co-rte-embed__handle--bottom-right{right:-6px;bottom:-6px;cursor:nwse-resize}.co-rte-content .co-rte-embed__handle--bottom-left{left:-6px;bottom:-6px;cursor:nesw-resize}.co-rte-content .co-rte-embed--resizing{outline:2px dashed var(--co-color-base-negro, #1a1a1a);outline-offset:2px}.co-rich-text-editor--readonly .co-rte-embed::before,.co-rich-text-editor--disabled .co-rte-embed::before{display:none}.co-rich-text-editor--readonly .co-rte-embed.ProseMirror-selectednode,.co-rich-text-editor--readonly .co-rte-embed--selected,.co-rich-text-editor--disabled .co-rte-embed.ProseMirror-selectednode,.co-rich-text-editor--disabled .co-rte-embed--selected{outline:none !important}.co-rte-img-layout{position:absolute;z-index:50;display:flex;align-items:center;gap:2px;padding:4px;background:var(--co-semantic-surface-secondary, #fff);border:1px solid var(--co-semantic-border-default, #e0e0e0);border-radius:var(--co-border-radius-xs, 8px);box-shadow:0 2px 12px rgba(0, 0, 0, 0.12);pointer-events:auto}.co-rte-img-layout__btn{display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;padding:0;border:1px solid transparent;border-radius:var(--co-border-radius-xxs, 4px);background:transparent;color:var(--co-semantic-text-default, #333);cursor:pointer;transition:background var(--co-motion-duration-fast), border-color var(--co-motion-duration-fast)}.co-rte-img-layout__btn:hover{background:var(--co-semantic-surface-hover, rgba(0, 0, 0, 0.06))}.co-rte-img-layout__btn--active{background:var(--co-color-base-negro, #1a1a1a);color:var(--co-color-base-blanco, #fff)}.co-rte-img-layout__btn--active:hover{background:var(--co-color-base-negro, #333)}.co-rte-img-layout__btn[data-tooltip]{position:relative}.co-rte-img-layout__btn[data-tooltip]::after{content:attr(data-tooltip);position:absolute;bottom:calc(100% + 6px);left:50%;transform:translateX(-50%);padding:4px 8px;background:var(--co-color-base-negro, #1a1a1a);color:var(--co-color-base-blanco, #fff);font-family:var(--co-font-family-primary);font-size:11px;font-weight:500;line-height:1.3;white-space:nowrap;border-radius:4px;pointer-events:none;opacity:0;transition:opacity var(--co-motion-duration-fast) var(--co-motion-ease-out);z-index:100}.co-rte-img-layout__btn[data-tooltip]:hover::after{opacity:1;transition-delay:0.3s}.co-rte-content [data-resize-container][data-image-layout="wrap-left"]{float:left;max-width:50%;margin:4px 16px 8px 0}.co-rte-content [data-resize-container][data-image-layout="wrap-right"]{float:right;max-width:50%;margin:4px 0 8px 16px}.co-rte-content [data-resize-container][data-image-layout="center"]{display:block;margin:12px auto}.co-rte-content [data-resize-container][data-image-layout="full-width"]{display:block;width:100%;margin:12px 0}.co-rte-content [data-resize-container][data-image-layout="full-width"] [data-resize-wrapper],.co-rte-content [data-resize-container][data-image-layout="full-width"] img{width:100%}@media (max-width: 768px){.co-rte-content [data-resize-container][data-image-layout="wrap-left"],.co-rte-content [data-resize-container][data-image-layout="wrap-right"]{float:none;max-width:100%;display:block;margin:12px 0}}.co-rte-content--site .ProseMirror{width:var(--co-rte-content-width, 80%);max-width:100%;margin:0 auto}@media (max-width: 768px){.co-rte-content--site .ProseMirror{width:100%}}.co-rich-text-editor--readonly [data-resize-handle],.co-rich-text-editor--disabled [data-resize-handle]{display:none !important}.co-rich-text-editor--readonly [data-resize-container].ProseMirror-selectednode,.co-rich-text-editor--disabled [data-resize-container].ProseMirror-selectednode,.co-rich-text-editor--readonly img.ProseMirror-selectednode,.co-rich-text-editor--disabled img.ProseMirror-selectednode{outline:none !important}.co-field-required{margin-left:2px;color:var(--co-semantic-text-error, var(--co-color-status-error))}.co-field-required__caption{margin-left:4px;color:var(--co-semantic-text-muted);font-size:var(--co-font-size-12);font-weight:400}.co-field-required__caption::before{content:var(--co-field-required-text, \' (required)\')}';export{p as co_rich_text_editor}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r,h as s}from"./p-
|
|
1
|
+
import{r,h as s}from"./p-YRicbXh3.js";const o=class{constructor(s){r(this,s),this.value=0,this.status="default",this.variant="solid",this.thickness=4,this.indeterminate=!1}render(){const r=Math.max(0,Math.min(100,this.value)),o=this.indeterminate;return s("div",{key:"11e44e13ee324094bd7992d79cc6dc835c9de2f3",class:{"co-progress-bar":!0,[`co-progress-bar--${this.status}`]:!0,[`co-progress-bar--${this.variant}`]:!0,"co-progress-bar--indeterminate":o},role:"progressbar","aria-valuenow":o?void 0:r,"aria-valuemin":0,"aria-valuemax":100,part:"bar",style:{height:`${this.thickness}px`}},s("div",{key:"e0448637058e041aa2ff6a49f1be5464114c0d15",class:"co-progress-bar__fill",style:o?void 0:{width:`${r}%`}}))}};o.style=":host{display:block;width:100%}.co-progress-bar{width:100%;border-radius:9999px;overflow:hidden;background:var(--co-progress-bar-track, var(--co-semantic-border-subtle));position:relative}.co-progress-bar__fill{height:100%;border-radius:9999px;transition:width 0.3s ease}.co-progress-bar--solid .co-progress-bar__fill{background:var(--co-progress-bar-fill, var(--co-semantic-status-info))}.co-progress-bar--solid.co-progress-bar--success .co-progress-bar__fill{background:var(--co-semantic-status-success)}.co-progress-bar--solid.co-progress-bar--warning .co-progress-bar__fill{background:var(--co-semantic-status-warning)}.co-progress-bar--solid.co-progress-bar--error .co-progress-bar__fill{background:var(--co-semantic-status-error)}.co-progress-bar--dashed{background:transparent;border:2px dashed var(--co-semantic-border-subtle)}.co-progress-bar--dashed .co-progress-bar__fill{background:transparent;border-bottom:2px dashed var(--co-semantic-status-info);border-radius:0}.co-progress-bar--dashed.co-progress-bar--success .co-progress-bar__fill{border-bottom-color:var(--co-semantic-status-success)}.co-progress-bar--dashed.co-progress-bar--warning .co-progress-bar__fill{border-bottom-color:var(--co-semantic-status-warning)}.co-progress-bar--dashed.co-progress-bar--error .co-progress-bar__fill{border-bottom-color:var(--co-semantic-status-error)}.co-progress-bar--dashed.co-progress-bar--default{border-color:var(--co-semantic-border-subtle, rgba(31, 28, 27, 0.08))}.co-progress-bar--indeterminate .co-progress-bar__fill{width:40%;transition:none;animation:co-progress-indeterminate 1.4s ease-in-out infinite;will-change:transform}@keyframes co-progress-indeterminate{0%{transform:translateX(-110%)}100%{transform:translateX(360%)}}@media (prefers-reduced-motion: reduce){.co-progress-bar--indeterminate .co-progress-bar__fill{animation:none;width:100%;opacity:0.45}}";export{o as co_progress_bar}
|