@aquera/nile-elements 1.5.2 → 1.5.3
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/README.md +6 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +239 -195
- package/dist/nile-auto-complete/nile-auto-complete.cjs.js +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.cjs.js.map +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.css.cjs.js +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.css.cjs.js.map +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.css.esm.js +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.esm.js +1 -1
- package/dist/nile-file-preview/nile-file-preview.cjs.js +1 -1
- package/dist/nile-file-preview/nile-file-preview.cjs.js.map +1 -1
- package/dist/nile-file-preview/nile-file-preview.css.cjs.js +1 -1
- package/dist/nile-file-preview/nile-file-preview.css.cjs.js.map +1 -1
- package/dist/nile-file-preview/nile-file-preview.css.esm.js +2 -2
- package/dist/nile-file-preview/nile-file-preview.esm.js +1 -1
- package/dist/nile-file-preview/nile-file-preview.template.cjs.js +1 -1
- package/dist/nile-file-preview/nile-file-preview.template.cjs.js.map +1 -1
- package/dist/nile-file-preview/nile-file-preview.template.esm.js +55 -25
- package/dist/nile-file-preview/utils/index.cjs.js +1 -1
- package/dist/nile-file-preview/utils/index.esm.js +1 -1
- package/dist/nile-file-preview/utils/nile-file-preview.util.cjs.js +1 -1
- package/dist/nile-file-preview/utils/nile-file-preview.util.cjs.js.map +1 -1
- package/dist/nile-file-preview/utils/nile-file-preview.util.esm.js +1 -1
- package/dist/nile-file-upload/nile-file-upload.cjs.js +1 -1
- package/dist/nile-file-upload/nile-file-upload.cjs.js.map +1 -1
- package/dist/nile-file-upload/nile-file-upload.css.cjs.js +1 -1
- package/dist/nile-file-upload/nile-file-upload.css.cjs.js.map +1 -1
- package/dist/nile-file-upload/nile-file-upload.css.esm.js +15 -5
- package/dist/nile-file-upload/nile-file-upload.esm.js +2 -2
- package/dist/nile-file-upload/nile-file-upload.template.cjs.js +2 -2
- package/dist/nile-file-upload/nile-file-upload.template.cjs.js.map +1 -1
- package/dist/nile-file-upload/nile-file-upload.template.esm.js +36 -32
- package/dist/nile-file-upload/types/file-upload.enums.cjs.js +1 -1
- package/dist/nile-file-upload/types/file-upload.enums.cjs.js.map +1 -1
- package/dist/nile-file-upload/types/file-upload.enums.esm.js +1 -1
- package/dist/nile-file-upload/types/index.cjs.js +1 -1
- package/dist/nile-file-upload/types/index.esm.js +1 -1
- package/dist/nile-file-upload/utils/drag-drop.util.cjs.js +1 -1
- package/dist/nile-file-upload/utils/drag-drop.util.cjs.js.map +1 -1
- package/dist/nile-file-upload/utils/drag-drop.util.esm.js +1 -1
- package/dist/nile-file-upload/utils/file-validation.util.cjs.js +4 -2
- package/dist/nile-file-upload/utils/file-validation.util.cjs.js.map +1 -1
- package/dist/nile-file-upload/utils/file-validation.util.esm.js +1 -1
- package/dist/nile-grid/nile-grid-head-item/nile-grid-head-item.cjs.js +1 -1
- package/dist/nile-grid/nile-grid-head-item/nile-grid-head-item.cjs.js.map +1 -1
- package/dist/nile-grid/nile-grid-head-item/nile-grid-head-item.esm.js +3 -3
- package/dist/nile-grid/nile-grid-head-item/nile-grid-head-item.utils.cjs.js +1 -1
- package/dist/nile-grid/nile-grid-head-item/nile-grid-head-item.utils.cjs.js.map +1 -1
- package/dist/nile-grid/nile-grid-head-item/nile-grid-head-item.utils.esm.js +1 -1
- package/dist/nile-grid/nile-grid.cjs.js +1 -1
- package/dist/nile-grid/nile-grid.cjs.js.map +1 -1
- package/dist/nile-grid/nile-grid.esm.js +2 -2
- package/dist/nile-grid/nile-grid.layout.cjs.js +1 -1
- package/dist/nile-grid/nile-grid.layout.esm.js +1 -1
- package/dist/nile-grid/nile-grid.resize.cjs.js +1 -1
- package/dist/nile-grid/nile-grid.resize.esm.js +1 -1
- package/dist/nile-grid/nile-grid.utils.cjs.js +1 -1
- package/dist/nile-grid/nile-grid.utils.esm.js +1 -1
- package/dist/nile-grid/nile-grid.width.cjs.js +1 -1
- package/dist/nile-grid/nile-grid.width.cjs.js.map +1 -1
- package/dist/nile-grid/nile-grid.width.esm.js +1 -1
- package/dist/nile-input/nile-input.cjs.js +1 -1
- package/dist/nile-input/nile-input.cjs.js.map +1 -1
- package/dist/nile-input/nile-input.esm.js +1 -1
- package/dist/nile-popover/index.cjs.js +1 -1
- package/dist/nile-popover/index.esm.js +1 -1
- package/dist/nile-popover/nile-popover.cjs.js +4 -4
- package/dist/nile-popover/nile-popover.cjs.js.map +1 -1
- package/dist/nile-popover/nile-popover.esm.js +11 -6
- package/dist/src/nile-accordion/nile-accordian.test.js +101 -99
- package/dist/src/nile-accordion/nile-accordian.test.js.map +1 -1
- package/dist/src/nile-auto-complete/nile-auto-complete.css.js +1 -1
- package/dist/src/nile-auto-complete/nile-auto-complete.css.js.map +1 -1
- package/dist/src/nile-auto-complete/nile-auto-complete.js +1 -1
- package/dist/src/nile-auto-complete/nile-auto-complete.js.map +1 -1
- package/dist/src/nile-auto-complete/nile-auto-complete.test.js +104 -112
- package/dist/src/nile-auto-complete/nile-auto-complete.test.js.map +1 -1
- package/dist/src/nile-avatar/nile-avatar.test.d.ts +0 -1
- package/dist/src/nile-avatar/nile-avatar.test.js +103 -87
- package/dist/src/nile-avatar/nile-avatar.test.js.map +1 -1
- package/dist/src/nile-badge/nile-badge.test.js +554 -35
- package/dist/src/nile-badge/nile-badge.test.js.map +1 -1
- package/dist/src/nile-breadcrumb/nile-breadcrumb.test.d.ts +2 -0
- package/dist/src/nile-breadcrumb/nile-breadcrumb.test.js +106 -0
- package/dist/src/nile-breadcrumb/nile-breadcrumb.test.js.map +1 -0
- package/dist/src/nile-breadcrumb-item/nile-breadcrumb-item.test.d.ts +1 -0
- package/dist/src/nile-breadcrumb-item/nile-breadcrumb-item.test.js +108 -0
- package/dist/src/nile-breadcrumb-item/nile-breadcrumb-item.test.js.map +1 -0
- package/dist/src/nile-button/nile-button.test.js +499 -39
- package/dist/src/nile-button/nile-button.test.js.map +1 -1
- package/dist/src/nile-button-filter/nile-button-filter.test.d.ts +1 -0
- package/dist/src/nile-button-filter/nile-button-filter.test.js +108 -0
- package/dist/src/nile-button-filter/nile-button-filter.test.js.map +1 -0
- package/dist/src/nile-button-toggle/nile-button-toggle.test.d.ts +1 -0
- package/dist/src/nile-button-toggle/nile-button-toggle.test.js +108 -0
- package/dist/src/nile-button-toggle/nile-button-toggle.test.js.map +1 -0
- package/dist/src/nile-button-toggle-group/nile-button-toggle-group.test.d.ts +1 -1
- package/dist/src/nile-button-toggle-group/nile-button-toggle-group.test.js +105 -104
- package/dist/src/nile-button-toggle-group/nile-button-toggle-group.test.js.map +1 -1
- package/dist/src/nile-calendar/nile-calendar.test.d.ts +0 -6
- package/dist/src/nile-calendar/nile-calendar.test.js +103 -318
- package/dist/src/nile-calendar/nile-calendar.test.js.map +1 -1
- package/dist/src/nile-card/nile-card.test.js +102 -66
- package/dist/src/nile-card/nile-card.test.js.map +1 -1
- package/dist/src/nile-checkbox/nile-checkbox.test.js +547 -108
- package/dist/src/nile-checkbox/nile-checkbox.test.js.map +1 -1
- package/dist/src/nile-chip/nile-chip.test.d.ts +0 -2
- package/dist/src/nile-chip/nile-chip.test.js +101 -102
- package/dist/src/nile-chip/nile-chip.test.js.map +1 -1
- package/dist/src/nile-circular-progressbar/nile-circular-progressbar.test.d.ts +1 -0
- package/dist/src/nile-circular-progressbar/nile-circular-progressbar.test.js +108 -0
- package/dist/src/nile-circular-progressbar/nile-circular-progressbar.test.js.map +1 -0
- package/dist/src/nile-date-picker/nile-date-picker.test.d.ts +1 -0
- package/dist/src/nile-date-picker/nile-date-picker.test.js +108 -0
- package/dist/src/nile-date-picker/nile-date-picker.test.js.map +1 -0
- package/dist/src/nile-dialog/nile-dialog.test.d.ts +0 -1
- package/dist/src/nile-dialog/nile-dialog.test.js +104 -126
- package/dist/src/nile-dialog/nile-dialog.test.js.map +1 -1
- package/dist/src/nile-divider/nile-divider.test.d.ts +1 -0
- package/dist/src/nile-divider/nile-divider.test.js +560 -0
- package/dist/src/nile-divider/nile-divider.test.js.map +1 -0
- package/dist/src/nile-drawer/nile-drawer.test.js +106 -86
- package/dist/src/nile-drawer/nile-drawer.test.js.map +1 -1
- package/dist/src/nile-dropdown/nile-dropdown.test.js +104 -148
- package/dist/src/nile-dropdown/nile-dropdown.test.js.map +1 -1
- package/dist/src/nile-empty-state/nile-empty-state.test.js +107 -59
- package/dist/src/nile-empty-state/nile-empty-state.test.js.map +1 -1
- package/dist/src/nile-error-message/nile-error-message.test.js +105 -55
- package/dist/src/nile-error-message/nile-error-message.test.js.map +1 -1
- package/dist/src/nile-error-notification/nile-error-notification.test.d.ts +1 -0
- package/dist/src/nile-error-notification/nile-error-notification.test.js +108 -0
- package/dist/src/nile-error-notification/nile-error-notification.test.js.map +1 -0
- package/dist/src/nile-file-preview/nile-file-preview.css.js +2 -2
- package/dist/src/nile-file-preview/nile-file-preview.css.js.map +1 -1
- package/dist/src/nile-file-preview/nile-file-preview.d.ts +1 -4
- package/dist/src/nile-file-preview/nile-file-preview.js +21 -47
- package/dist/src/nile-file-preview/nile-file-preview.js.map +1 -1
- package/dist/src/nile-file-preview/nile-file-preview.template.d.ts +6 -6
- package/dist/src/nile-file-preview/nile-file-preview.template.js +53 -23
- package/dist/src/nile-file-preview/nile-file-preview.template.js.map +1 -1
- package/dist/src/nile-file-preview/nile-file-preview.test.d.ts +0 -6
- package/dist/src/nile-file-preview/nile-file-preview.test.js +106 -28
- package/dist/src/nile-file-preview/nile-file-preview.test.js.map +1 -1
- package/dist/src/nile-file-preview/utils/nile-file-preview.util.d.ts +3 -2
- package/dist/src/nile-file-preview/utils/nile-file-preview.util.js +32 -7
- package/dist/src/nile-file-preview/utils/nile-file-preview.util.js.map +1 -1
- package/dist/src/nile-file-upload/nile-file-upload.css.js +15 -5
- package/dist/src/nile-file-upload/nile-file-upload.css.js.map +1 -1
- package/dist/src/nile-file-upload/nile-file-upload.d.ts +4 -1
- package/dist/src/nile-file-upload/nile-file-upload.js +13 -1
- package/dist/src/nile-file-upload/nile-file-upload.js.map +1 -1
- package/dist/src/nile-file-upload/nile-file-upload.template.js +19 -15
- package/dist/src/nile-file-upload/nile-file-upload.template.js.map +1 -1
- package/dist/src/nile-file-upload/nile-file-upload.test.d.ts +0 -6
- package/dist/src/nile-file-upload/nile-file-upload.test.js +106 -28
- package/dist/src/nile-file-upload/nile-file-upload.test.js.map +1 -1
- package/dist/src/nile-file-upload/types/file-upload.enums.d.ts +17 -3
- package/dist/src/nile-file-upload/types/file-upload.enums.js +17 -1
- package/dist/src/nile-file-upload/types/file-upload.enums.js.map +1 -1
- package/dist/src/nile-file-upload/utils/drag-drop.util.d.ts +2 -0
- package/dist/src/nile-file-upload/utils/drag-drop.util.js +14 -8
- package/dist/src/nile-file-upload/utils/drag-drop.util.js.map +1 -1
- package/dist/src/nile-file-upload/utils/file-validation.util.js +89 -10
- package/dist/src/nile-file-upload/utils/file-validation.util.js.map +1 -1
- package/dist/src/nile-filter-chip/nile-filter-chip.test.js +102 -77
- package/dist/src/nile-filter-chip/nile-filter-chip.test.js.map +1 -1
- package/dist/src/nile-form-error-message/nile-form-error-message.test.d.ts +1 -0
- package/dist/src/nile-form-error-message/nile-form-error-message.test.js +108 -0
- package/dist/src/nile-form-error-message/nile-form-error-message.test.js.map +1 -0
- package/dist/src/nile-form-group/nile-form-group.test.js +104 -51
- package/dist/src/nile-form-group/nile-form-group.test.js.map +1 -1
- package/dist/src/nile-form-help-text/nile-form-help-text.test.js +104 -84
- package/dist/src/nile-form-help-text/nile-form-help-text.test.js.map +1 -1
- package/dist/src/nile-format-date/nile-format-date.test.d.ts +1 -0
- package/dist/src/nile-format-date/nile-format-date.test.js +108 -0
- package/dist/src/nile-format-date/nile-format-date.test.js.map +1 -0
- package/dist/src/nile-grid/nile-grid-head-item/nile-grid-head-item.js +6 -5
- package/dist/src/nile-grid/nile-grid-head-item/nile-grid-head-item.js.map +1 -1
- package/dist/src/nile-grid/nile-grid-head-item/nile-grid-head-item.utils.d.ts +14 -0
- package/dist/src/nile-grid/nile-grid-head-item/nile-grid-head-item.utils.js +24 -0
- package/dist/src/nile-grid/nile-grid-head-item/nile-grid-head-item.utils.js.map +1 -1
- package/dist/src/nile-grid/nile-grid.d.ts +1 -0
- package/dist/src/nile-grid/nile-grid.js +5 -1
- package/dist/src/nile-grid/nile-grid.js.map +1 -1
- package/dist/src/nile-grid/nile-grid.utils.d.ts +6 -0
- package/dist/src/nile-grid/nile-grid.utils.js +13 -0
- package/dist/src/nile-grid/nile-grid.utils.js.map +1 -1
- package/dist/src/nile-heading/nile-heading.test.d.ts +1 -0
- package/dist/src/nile-heading/nile-heading.test.js +108 -0
- package/dist/src/nile-heading/nile-heading.test.js.map +1 -0
- package/dist/src/nile-hero/nile-hero.test.js +101 -38
- package/dist/src/nile-hero/nile-hero.test.js.map +1 -1
- package/dist/src/nile-icon/nile-icon.test.js +103 -40
- package/dist/src/nile-icon/nile-icon.test.js.map +1 -1
- package/dist/src/nile-icon-button/nile-icon-button.test.d.ts +1 -0
- package/dist/src/nile-icon-button/nile-icon-button.test.js +568 -0
- package/dist/src/nile-icon-button/nile-icon-button.test.js.map +1 -0
- package/dist/src/nile-inline-edit/nile-inline-edit.test.d.ts +1 -0
- package/dist/src/nile-inline-edit/nile-inline-edit.test.js +108 -0
- package/dist/src/nile-inline-edit/nile-inline-edit.test.js.map +1 -0
- package/dist/src/nile-input/nile-input.js +1 -1
- package/dist/src/nile-input/nile-input.js.map +1 -1
- package/dist/src/nile-input/nile-input.test.js +109 -139
- package/dist/src/nile-input/nile-input.test.js.map +1 -1
- package/dist/src/nile-link/nile-link.test.js +103 -67
- package/dist/src/nile-link/nile-link.test.js.map +1 -1
- package/dist/src/nile-list/nile-list.test.d.ts +1 -0
- package/dist/src/nile-list/nile-list.test.js +108 -0
- package/dist/src/nile-list/nile-list.test.js.map +1 -0
- package/dist/src/nile-list-item/nile-list-item.test.d.ts +1 -0
- package/dist/src/nile-list-item/nile-list-item.test.js +108 -0
- package/dist/src/nile-list-item/nile-list-item.test.js.map +1 -0
- package/dist/src/nile-lite-tooltip/nile-lite-tooltip.test.d.ts +2 -0
- package/dist/src/nile-lite-tooltip/nile-lite-tooltip.test.js +109 -0
- package/dist/src/nile-lite-tooltip/nile-lite-tooltip.test.js.map +1 -0
- package/dist/src/nile-loader/nile-loader.test.js +107 -40
- package/dist/src/nile-loader/nile-loader.test.js.map +1 -1
- package/dist/src/nile-menu/nile-menu.test.d.ts +1 -0
- package/dist/src/nile-menu/nile-menu.test.js +113 -0
- package/dist/src/nile-menu/nile-menu.test.js.map +1 -0
- package/dist/src/nile-menu-item/nile-menu-item.test.d.ts +1 -0
- package/dist/src/nile-menu-item/nile-menu-item.test.js +113 -0
- package/dist/src/nile-menu-item/nile-menu-item.test.js.map +1 -0
- package/dist/src/nile-option/nile-option.test.d.ts +1 -0
- package/dist/src/nile-option/nile-option.test.js +108 -0
- package/dist/src/nile-option/nile-option.test.js.map +1 -0
- package/dist/src/nile-option-group/nile-option-group.test.d.ts +1 -0
- package/dist/src/nile-option-group/nile-option-group.test.js +108 -0
- package/dist/src/nile-option-group/nile-option-group.test.js.map +1 -0
- package/dist/src/nile-page-header/nile-page-header.test.d.ts +1 -0
- package/dist/src/nile-page-header/nile-page-header.test.js +108 -0
- package/dist/src/nile-page-header/nile-page-header.test.js.map +1 -0
- package/dist/src/nile-pagination/nile-pagination.test.d.ts +1 -0
- package/dist/src/nile-pagination/nile-pagination.test.js +108 -0
- package/dist/src/nile-pagination/nile-pagination.test.js.map +1 -0
- package/dist/src/nile-popover/nile-popover.test.js +103 -68
- package/dist/src/nile-popover/nile-popover.test.js.map +1 -1
- package/dist/src/nile-popup/nile-popup.test.js +104 -65
- package/dist/src/nile-popup/nile-popup.test.js.map +1 -1
- package/dist/src/nile-progress-bar/nile-progress-bar.test.js +104 -44
- package/dist/src/nile-progress-bar/nile-progress-bar.test.js.map +1 -1
- package/dist/src/nile-radio/nile-radio.test.js +103 -66
- package/dist/src/nile-radio/nile-radio.test.js.map +1 -1
- package/dist/src/nile-radio-group/nile-radio-group.test.d.ts +0 -1
- package/dist/src/nile-radio-group/nile-radio-group.test.js +105 -171
- package/dist/src/nile-radio-group/nile-radio-group.test.js.map +1 -1
- package/dist/src/nile-section-message/nile-section-message.test.d.ts +1 -0
- package/dist/src/nile-section-message/nile-section-message.test.js +108 -0
- package/dist/src/nile-section-message/nile-section-message.test.js.map +1 -0
- package/dist/src/nile-select/nile-select.test.d.ts +0 -5
- package/dist/src/nile-select/nile-select.test.js +105 -244
- package/dist/src/nile-select/nile-select.test.js.map +1 -1
- package/dist/src/nile-skeleton-loader/nile-skeleton-loader.test.d.ts +1 -0
- package/dist/src/nile-skeleton-loader/nile-skeleton-loader.test.js +108 -0
- package/dist/src/nile-skeleton-loader/nile-skeleton-loader.test.js.map +1 -0
- package/dist/src/nile-slide-toggle/nile-slide-toggle.test.js +104 -50
- package/dist/src/nile-slide-toggle/nile-slide-toggle.test.js.map +1 -1
- package/dist/src/nile-slider/nile-slider.test.d.ts +1 -0
- package/dist/src/nile-slider/nile-slider.test.js +108 -0
- package/dist/src/nile-slider/nile-slider.test.js.map +1 -0
- package/dist/src/nile-spinner/nile-spinner.test.d.ts +1 -0
- package/dist/src/nile-spinner/nile-spinner.test.js +569 -0
- package/dist/src/nile-spinner/nile-spinner.test.js.map +1 -0
- package/dist/src/nile-split-panel/nile-split-panel.test.d.ts +1 -0
- package/dist/src/nile-split-panel/nile-split-panel.test.js +108 -0
- package/dist/src/nile-split-panel/nile-split-panel.test.js.map +1 -0
- package/dist/src/nile-stepper/nile-stepper.test.d.ts +2 -0
- package/dist/src/nile-stepper/nile-stepper.test.js +109 -0
- package/dist/src/nile-stepper/nile-stepper.test.js.map +1 -0
- package/dist/src/nile-stepper-item/nile-stepper-item.test.d.ts +1 -0
- package/dist/src/nile-stepper-item/nile-stepper-item.test.js +108 -0
- package/dist/src/nile-stepper-item/nile-stepper-item.test.js.map +1 -0
- package/dist/src/nile-tab/nile-tab.test.d.ts +1 -0
- package/dist/src/nile-tab/nile-tab.test.js +108 -0
- package/dist/src/nile-tab/nile-tab.test.js.map +1 -0
- package/dist/src/nile-tab-group/nile-tab-group.test.js +105 -172
- package/dist/src/nile-tab-group/nile-tab-group.test.js.map +1 -1
- package/dist/src/nile-tab-panel/nile-tab-panel.test.d.ts +1 -0
- package/dist/src/nile-tab-panel/nile-tab-panel.test.js +108 -0
- package/dist/src/nile-tab-panel/nile-tab-panel.test.js.map +1 -0
- package/dist/src/nile-tag/nile-tag.test.d.ts +1 -0
- package/dist/src/nile-tag/nile-tag.test.js +574 -0
- package/dist/src/nile-tag/nile-tag.test.js.map +1 -0
- package/dist/src/nile-textarea/nile-textarea.test.d.ts +1 -1
- package/dist/src/nile-textarea/nile-textarea.test.js +105 -84
- package/dist/src/nile-textarea/nile-textarea.test.js.map +1 -1
- package/dist/src/nile-title/nile-title.test.d.ts +1 -0
- package/dist/src/nile-title/nile-title.test.js +108 -0
- package/dist/src/nile-title/nile-title.test.js.map +1 -0
- package/dist/src/nile-toast/nile-toast.test.d.ts +1 -0
- package/dist/src/nile-toast/nile-toast.test.js +526 -0
- package/dist/src/nile-toast/nile-toast.test.js.map +1 -0
- package/dist/src/nile-toolbar/nile-toolbar.test.d.ts +1 -0
- package/dist/src/nile-toolbar/nile-toolbar.test.js +108 -0
- package/dist/src/nile-toolbar/nile-toolbar.test.js.map +1 -0
- package/dist/src/nile-tooltip/nile-tooltip.test.d.ts +1 -0
- package/dist/src/nile-tooltip/nile-tooltip.test.js +546 -0
- package/dist/src/nile-tooltip/nile-tooltip.test.js.map +1 -0
- package/dist/src/nile-virtual-select/nile-virtual-select.test.d.ts +1 -7
- package/dist/src/nile-virtual-select/nile-virtual-select.test.js +105 -628
- package/dist/src/nile-virtual-select/nile-virtual-select.test.js.map +1 -1
- package/dist/src/version.js +1 -1
- package/dist/src/version.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/rollup.config.js +7 -1
- package/src/nile-accordion/nile-accordian.test.ts +102 -116
- package/src/nile-auto-complete/nile-auto-complete.css.ts +1 -1
- package/src/nile-auto-complete/nile-auto-complete.test.ts +102 -145
- package/src/nile-auto-complete/nile-auto-complete.ts +1 -1
- package/src/nile-avatar/nile-avatar.test.ts +102 -112
- package/src/nile-badge/nile-badge.test.ts +642 -30
- package/src/nile-breadcrumb/nile-breadcrumb.test.ts +107 -0
- package/src/nile-breadcrumb-item/nile-breadcrumb-item.test.ts +106 -0
- package/src/nile-button/nile-button.test.ts +593 -61
- package/src/nile-button-filter/nile-button-filter.test.ts +106 -0
- package/src/nile-button-toggle/nile-button-toggle.test.ts +106 -0
- package/src/nile-button-toggle-group/nile-button-toggle-group.test.ts +104 -126
- package/src/nile-calendar/nile-calendar.test.ts +102 -406
- package/src/nile-card/nile-card.test.ts +103 -71
- package/src/nile-checkbox/nile-checkbox.test.ts +614 -108
- package/src/nile-chip/nile-chip.test.ts +102 -136
- package/src/nile-circular-progressbar/nile-circular-progressbar.test.ts +106 -0
- package/src/nile-date-picker/nile-date-picker.test.ts +106 -0
- package/src/nile-dialog/nile-dialog.test.ts +102 -164
- package/src/nile-divider/nile-divider.test.ts +659 -0
- package/src/nile-drawer/nile-drawer.test.ts +105 -105
- package/src/nile-dropdown/nile-dropdown.test.ts +102 -190
- package/src/nile-empty-state/nile-empty-state.test.ts +104 -67
- package/src/nile-error-message/nile-error-message.test.ts +104 -67
- package/src/nile-error-notification/nile-error-notification.test.ts +106 -0
- package/src/nile-file-preview/nile-file-preview.css.ts +2 -2
- package/src/nile-file-preview/nile-file-preview.template.ts +59 -23
- package/src/nile-file-preview/nile-file-preview.test.ts +105 -37
- package/src/nile-file-preview/nile-file-preview.ts +23 -56
- package/src/nile-file-preview/utils/nile-file-preview.util.ts +37 -8
- package/src/nile-file-upload/nile-file-upload.css.ts +15 -5
- package/src/nile-file-upload/nile-file-upload.template.ts +22 -18
- package/src/nile-file-upload/nile-file-upload.test.ts +105 -37
- package/src/nile-file-upload/nile-file-upload.ts +11 -3
- package/src/nile-file-upload/types/file-upload.enums.ts +20 -4
- package/src/nile-file-upload/utils/drag-drop.util.ts +20 -11
- package/src/nile-file-upload/utils/file-validation.util.ts +104 -22
- package/src/nile-filter-chip/nile-filter-chip.test.ts +103 -89
- package/src/nile-form-error-message/nile-form-error-message.test.ts +106 -0
- package/src/nile-form-group/nile-form-group.test.ts +103 -60
- package/src/nile-form-help-text/nile-form-help-text.test.ts +102 -106
- package/src/nile-format-date/nile-format-date.test.ts +106 -0
- package/src/nile-grid/nile-grid-head-item/nile-grid-head-item.ts +7 -5
- package/src/nile-grid/nile-grid-head-item/nile-grid-head-item.utils.ts +28 -0
- package/src/nile-grid/nile-grid.ts +6 -1
- package/src/nile-grid/nile-grid.utils.ts +18 -1
- package/src/nile-heading/nile-heading.test.ts +106 -0
- package/src/nile-hero/nile-hero.test.ts +103 -42
- package/src/nile-icon/nile-icon.test.ts +103 -50
- package/src/nile-icon-button/nile-icon-button.test.ts +667 -0
- package/src/nile-inline-edit/nile-inline-edit.test.ts +106 -0
- package/src/nile-input/nile-input.test.ts +105 -164
- package/src/nile-input/nile-input.ts +1 -1
- package/src/nile-link/nile-link.test.ts +104 -81
- package/src/nile-list/nile-list.test.ts +106 -0
- package/src/nile-list-item/nile-list-item.test.ts +106 -0
- package/src/nile-lite-tooltip/nile-lite-tooltip.test.ts +107 -0
- package/src/nile-loader/nile-loader.test.ts +103 -48
- package/src/nile-menu/nile-menu.test.ts +106 -0
- package/src/nile-menu-item/nile-menu-item.test.ts +106 -0
- package/src/nile-option/nile-option.test.ts +106 -0
- package/src/nile-option-group/nile-option-group.test.ts +106 -0
- package/src/nile-page-header/nile-page-header.test.ts +106 -0
- package/src/nile-pagination/nile-pagination.test.ts +106 -0
- package/src/nile-popover/nile-popover.test.ts +103 -83
- package/src/nile-popup/nile-popup.test.ts +102 -82
- package/src/nile-progress-bar/nile-progress-bar.test.ts +103 -52
- package/src/nile-radio/nile-radio.test.ts +103 -78
- package/src/nile-radio-group/nile-radio-group.test.ts +104 -213
- package/src/nile-section-message/nile-section-message.test.ts +106 -0
- package/src/nile-select/nile-select.test.ts +105 -308
- package/src/nile-skeleton-loader/nile-skeleton-loader.test.ts +106 -0
- package/src/nile-slide-toggle/nile-slide-toggle.test.ts +103 -58
- package/src/nile-slider/nile-slider.test.ts +106 -0
- package/src/nile-spinner/nile-spinner.test.ts +668 -0
- package/src/nile-split-panel/nile-split-panel.test.ts +106 -0
- package/src/nile-stepper/nile-stepper.test.ts +107 -0
- package/src/nile-stepper-item/nile-stepper-item.test.ts +106 -0
- package/src/nile-tab/nile-tab.test.ts +106 -0
- package/src/nile-tab-group/nile-tab-group.test.ts +104 -211
- package/src/nile-tab-panel/nile-tab-panel.test.ts +106 -0
- package/src/nile-tag/nile-tag.test.ts +675 -0
- package/src/nile-textarea/nile-textarea.test.ts +104 -100
- package/src/nile-title/nile-title.test.ts +106 -0
- package/src/nile-toast/nile-toast.test.ts +625 -0
- package/src/nile-toolbar/nile-toolbar.test.ts +106 -0
- package/src/nile-tooltip/nile-tooltip.test.ts +645 -0
- package/src/nile-virtual-select/nile-virtual-select.test.ts +104 -772
- package/vscode-html-custom-data.json +8 -3
- package/web-test-runner.config.mjs +4 -2
- package/dist/axe.min-2720cd56.esm.js +0 -1
- package/dist/axe.min-69d47269.cjs.js +0 -2
- package/dist/axe.min-69d47269.cjs.js.map +0 -1
- package/dist/css-tag-bb10c0fa.cjs.js +0 -6
- package/dist/css-tag-bb10c0fa.cjs.js.map +0 -1
- package/dist/css-tag-dc564feb.esm.js +0 -6
- package/dist/fixture-958445f8.cjs.js +0 -395
- package/dist/fixture-958445f8.cjs.js.map +0 -1
- package/dist/fixture-985bba12.esm.js +0 -569
- package/dist/nile-accordion/nile-accordian.test.cjs.js +0 -2
- package/dist/nile-accordion/nile-accordian.test.cjs.js.map +0 -1
- package/dist/nile-accordion/nile-accordian.test.esm.js +0 -1
- package/dist/nile-auto-complete/nile-auto-complete.test.cjs.js +0 -2
- package/dist/nile-auto-complete/nile-auto-complete.test.cjs.js.map +0 -1
- package/dist/nile-auto-complete/nile-auto-complete.test.esm.js +0 -9
- package/dist/nile-avatar/nile-avatar.test.cjs.js +0 -2
- package/dist/nile-avatar/nile-avatar.test.cjs.js.map +0 -1
- package/dist/nile-avatar/nile-avatar.test.esm.js +0 -11
- package/dist/nile-badge/nile-badge.test.cjs.js +0 -2
- package/dist/nile-badge/nile-badge.test.cjs.js.map +0 -1
- package/dist/nile-badge/nile-badge.test.esm.js +0 -1
- package/dist/nile-button/nile-button.test.cjs.js +0 -2
- package/dist/nile-button/nile-button.test.cjs.js.map +0 -1
- package/dist/nile-button/nile-button.test.esm.js +0 -4
- package/dist/nile-button-toggle-group/nile-button-toggle-group.test.cjs.js +0 -2
- package/dist/nile-button-toggle-group/nile-button-toggle-group.test.cjs.js.map +0 -1
- package/dist/nile-button-toggle-group/nile-button-toggle-group.test.esm.js +0 -49
- package/dist/nile-calendar/nile-calendar.test.cjs.js +0 -2
- package/dist/nile-calendar/nile-calendar.test.cjs.js.map +0 -1
- package/dist/nile-calendar/nile-calendar.test.esm.js +0 -11
- package/dist/nile-card/nile-card.test.cjs.js +0 -2
- package/dist/nile-card/nile-card.test.cjs.js.map +0 -1
- package/dist/nile-card/nile-card.test.esm.js +0 -51
- package/dist/nile-checkbox/nile-checkbox.test.cjs.js +0 -2
- package/dist/nile-checkbox/nile-checkbox.test.cjs.js.map +0 -1
- package/dist/nile-checkbox/nile-checkbox.test.esm.js +0 -17
- package/dist/nile-chip/nile-chip.test.cjs.js +0 -2
- package/dist/nile-chip/nile-chip.test.cjs.js.map +0 -1
- package/dist/nile-chip/nile-chip.test.esm.js +0 -1
- package/dist/nile-dialog/nile-dialog.test.cjs.js +0 -2
- package/dist/nile-dialog/nile-dialog.test.cjs.js.map +0 -1
- package/dist/nile-dialog/nile-dialog.test.esm.js +0 -7
- package/dist/nile-drawer/nile-drawer.test.cjs.js +0 -2
- package/dist/nile-drawer/nile-drawer.test.cjs.js.map +0 -1
- package/dist/nile-drawer/nile-drawer.test.esm.js +0 -17
- package/dist/nile-dropdown/nile-dropdown.test.cjs.js +0 -2
- package/dist/nile-dropdown/nile-dropdown.test.cjs.js.map +0 -1
- package/dist/nile-dropdown/nile-dropdown.test.esm.js +0 -28
- package/dist/nile-empty-state/nile-empty-state.test.cjs.js +0 -2
- package/dist/nile-empty-state/nile-empty-state.test.cjs.js.map +0 -1
- package/dist/nile-empty-state/nile-empty-state.test.esm.js +0 -9
- package/dist/nile-error-message/nile-error-message.test.cjs.js +0 -2
- package/dist/nile-error-message/nile-error-message.test.cjs.js.map +0 -1
- package/dist/nile-error-message/nile-error-message.test.esm.js +0 -1
- package/dist/nile-file-preview/nile-file-preview.test.cjs.js +0 -2
- package/dist/nile-file-preview/nile-file-preview.test.cjs.js.map +0 -1
- package/dist/nile-file-preview/nile-file-preview.test.esm.js +0 -1
- package/dist/nile-file-upload/nile-file-upload.test.cjs.js +0 -2
- package/dist/nile-file-upload/nile-file-upload.test.cjs.js.map +0 -1
- package/dist/nile-file-upload/nile-file-upload.test.esm.js +0 -1
- package/dist/nile-filter-chip/nile-filter-chip.test.cjs.js +0 -2
- package/dist/nile-filter-chip/nile-filter-chip.test.cjs.js.map +0 -1
- package/dist/nile-filter-chip/nile-filter-chip.test.esm.js +0 -20
- package/dist/nile-form-group/nile-form-group.test.cjs.js +0 -2
- package/dist/nile-form-group/nile-form-group.test.cjs.js.map +0 -1
- package/dist/nile-form-group/nile-form-group.test.esm.js +0 -1
- package/dist/nile-form-help-text/nile-form-help-text.test.cjs.js +0 -2
- package/dist/nile-form-help-text/nile-form-help-text.test.cjs.js.map +0 -1
- package/dist/nile-form-help-text/nile-form-help-text.test.esm.js +0 -1
- package/dist/nile-hero/nile-hero.test.cjs.js +0 -2
- package/dist/nile-hero/nile-hero.test.cjs.js.map +0 -1
- package/dist/nile-hero/nile-hero.test.esm.js +0 -14
- package/dist/nile-icon/nile-icon.test.cjs.js +0 -2
- package/dist/nile-icon/nile-icon.test.cjs.js.map +0 -1
- package/dist/nile-icon/nile-icon.test.esm.js +0 -1
- package/dist/nile-input/nile-input.test.cjs.js +0 -2
- package/dist/nile-input/nile-input.test.cjs.js.map +0 -1
- package/dist/nile-input/nile-input.test.esm.js +0 -17
- package/dist/nile-link/nile-link.test.cjs.js +0 -2
- package/dist/nile-link/nile-link.test.cjs.js.map +0 -1
- package/dist/nile-link/nile-link.test.esm.js +0 -1
- package/dist/nile-loader/nile-loader.test.cjs.js +0 -2
- package/dist/nile-loader/nile-loader.test.cjs.js.map +0 -1
- package/dist/nile-loader/nile-loader.test.esm.js +0 -1
- package/dist/nile-popover/nile-popover.test.cjs.js +0 -2
- package/dist/nile-popover/nile-popover.test.cjs.js.map +0 -1
- package/dist/nile-popover/nile-popover.test.esm.js +0 -21
- package/dist/nile-popup/nile-popup.test.cjs.js +0 -2
- package/dist/nile-popup/nile-popup.test.cjs.js.map +0 -1
- package/dist/nile-popup/nile-popup.test.esm.js +0 -1
- package/dist/nile-progress-bar/nile-progress-bar.test.cjs.js +0 -2
- package/dist/nile-progress-bar/nile-progress-bar.test.cjs.js.map +0 -1
- package/dist/nile-progress-bar/nile-progress-bar.test.esm.js +0 -1
- package/dist/nile-radio/nile-radio.test.cjs.js +0 -2
- package/dist/nile-radio/nile-radio.test.cjs.js.map +0 -1
- package/dist/nile-radio/nile-radio.test.esm.js +0 -1
- package/dist/nile-radio-group/nile-radio-group.test.cjs.js +0 -2
- package/dist/nile-radio-group/nile-radio-group.test.cjs.js.map +0 -1
- package/dist/nile-radio-group/nile-radio-group.test.esm.js +0 -57
- package/dist/nile-select/nile-select.test.cjs.js +0 -2
- package/dist/nile-select/nile-select.test.cjs.js.map +0 -1
- package/dist/nile-select/nile-select.test.esm.js +0 -55
- package/dist/nile-slide-toggle/nile-slide-toggle.test.cjs.js +0 -2
- package/dist/nile-slide-toggle/nile-slide-toggle.test.cjs.js.map +0 -1
- package/dist/nile-slide-toggle/nile-slide-toggle.test.esm.js +0 -1
- package/dist/nile-tab-group/nile-tab-group.test.cjs.js +0 -2
- package/dist/nile-tab-group/nile-tab-group.test.cjs.js.map +0 -1
- package/dist/nile-tab-group/nile-tab-group.test.esm.js +0 -65
- package/dist/nile-textarea/nile-textarea.test.cjs.js +0 -2
- package/dist/nile-textarea/nile-textarea.test.cjs.js.map +0 -1
- package/dist/nile-textarea/nile-textarea.test.esm.js +0 -1
- package/dist/nile-virtual-select/nile-virtual-select.test.cjs.js +0 -2
- package/dist/nile-virtual-select/nile-virtual-select.test.cjs.js.map +0 -1
- package/dist/nile-virtual-select/nile-virtual-select.test.esm.js +0 -93
- package/dist/scopedElementsWrapper-31107e48.esm.js +0 -1
- package/dist/scopedElementsWrapper-9b188ea6.cjs.js +0 -2
- package/dist/scopedElementsWrapper-9b188ea6.cjs.js.map +0 -1
- package/dist/sinon-esm-68c8e378.esm.js +0 -1
- package/dist/sinon-esm-97570c13.cjs.js +0 -2
- package/dist/sinon-esm-97570c13.cjs.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1787,7 +1787,7 @@ const de=1,he=2,Te=3,ye=4,Ae=e=>(...t)=>({_$litDirective$:e,values:t});let Oe=cl
|
|
|
1787
1787
|
</div>
|
|
1788
1788
|
|
|
1789
1789
|
${M?R`
|
|
1790
|
-
<nile-form-help-text>${this.helpText}</nile-form-help-text>
|
|
1790
|
+
<nile-form-help-text exportparts="container:help__text">${this.helpText}</nile-form-help-text>
|
|
1791
1791
|
`:""}
|
|
1792
1792
|
|
|
1793
1793
|
${n?R`
|
|
@@ -4874,7 +4874,7 @@ class CM{constructor(e){this._element=null;const t=e??window;this._node=t,e&&(th
|
|
|
4874
4874
|
* @license
|
|
4875
4875
|
* Copyright 2021 Google LLC
|
|
4876
4876
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
4877
|
-
*/(this._hostElement,e),this._scrollerController=new bM(this,this._clippingAncestors[0]),this._schedule(this._updateLayout),this._observeAndListen(),this._connected=!0}_observeAndListen(){this._mutationObserver.observe(this._hostElement,{childList:!0}),this._hostElementRO.observe(this._hostElement),this._scrollEventListeners.push(window),window.addEventListener("scroll",this,this._scrollEventListenerOptions),this._clippingAncestors.forEach((e=>{e.addEventListener("scroll",this,this._scrollEventListenerOptions),this._scrollEventListeners.push(e),this._hostElementRO.observe(e)})),this._hostElementRO.observe(this._scrollerController.element),this._children.forEach((e=>this._childrenRO.observe(e))),this._scrollEventListeners.forEach((e=>e.addEventListener("scroll",this,this._scrollEventListenerOptions)))}disconnected(){this._scrollEventListeners.forEach((e=>e.removeEventListener("scroll",this,this._scrollEventListenerOptions))),this._scrollEventListeners=[],this._clippingAncestors=[],this._scrollerController?.detach(this),this._scrollerController=null,this._mutationObserver?.disconnect(),this._mutationObserver=null,this._hostElementRO?.disconnect(),this._hostElementRO=null,this._childrenRO?.disconnect(),this._childrenRO=null,this._rejectLayoutCompletePromise("disconnected"),this._connected=!1}_applyVirtualizerStyles(){const e=this._hostElement.style;e.display=e.display||"block",e.position=e.position||"relative",e.contain=e.contain||"size layout",this._isScroller&&(e.overflow=e.overflow||"auto",e.minHeight=e.minHeight||"150px")}_getSizer(){const e=this._hostElement;if(!this._sizer){let t=e.querySelector(`[${UM}]`);t||(t=document.createElement("div"),t.setAttribute(UM,""),e.appendChild(t)),Object.assign(t.style,{position:"absolute",margin:"-2px 0 0 0",padding:0,visibility:"hidden",fontSize:"2px"}),t.textContent=" ",t.setAttribute(UM,""),this._sizer=t}return this._sizer}async updateLayoutConfig(e){await this._layoutInitialized;const t=e.type||YM;if("function"==typeof t&&this._layout instanceof t){const t={...e};return delete t.type,this._layout.config=t,!0}return!1}async _initLayout(e){let t,i;if("function"==typeof e.type){i=e.type;const M={...e};delete M.type,t=M}else t=e;void 0===i&&(YM=i=(await Promise.resolve().then((function(){return OQ}))).FlowLayout),this._layout=new i((e=>this._handleLayoutMessage(e)),t),this._layout.measureChildren&&"function"==typeof this._layout.updateItemSizes&&("function"==typeof this._layout.measureChildren&&(this._measureChildOverride=this._layout.measureChildren),this._measureCallback=this._layout.updateItemSizes.bind(this._layout)),this._layout.listenForChildLoadEvents&&this._hostElement.addEventListener("load",this._loadListener,!0),this._schedule(this._updateLayout)}startBenchmarking(){null===this._benchmarkStart&&(this._benchmarkStart=window.performance.now())}stopBenchmarking(){if(null!==this._benchmarkStart){const e=window.performance.now(),t=e-this._benchmarkStart,i=performance.getEntriesByName("uv-virtualizing","measure").filter((t=>t.startTime>=this._benchmarkStart&&t.startTime<e)).reduce(((e,t)=>e+t.duration),0);return this._benchmarkStart=null,{timeElapsed:t,virtualizationTime:i}}return null}_measureChildren(){const e={},t=this._children,i=this._measureChildOverride||this._measureChild;for(let M=0;M<t.length;M++){const n=t[M],o=this._first+M;(this._itemsChanged||this._toBeMeasured.has(n))&&(e[o]=i.call(this,n,this._items[o]))}this._childMeasurements=e,this._schedule(this._updateLayout),this._toBeMeasured.clear()}_measureChild(e){const{width:t,height:i}=e.getBoundingClientRect();return Object.assign({width:t,height:i},function(e){const t=window.getComputedStyle(e);return{marginTop:VM(t.marginTop),marginRight:VM(t.marginRight),marginBottom:VM(t.marginBottom),marginLeft:VM(t.marginLeft)}}(e))}async _schedule(e){this._scheduled.has(e)||(this._scheduled.add(e),await Promise.resolve(),this._scheduled.delete(e),e.call(this))}async _updateDOM(e){this._scrollSize=e.scrollSize,this._adjustRange(e.range),this._childrenPos=e.childPositions,this._scrollError=e.scrollError||null;const{_rangeChanged:t,_itemsChanged:i}=this;this._visibilityChanged&&(this._notifyVisibility(),this._visibilityChanged=!1),(t||i)&&(this._notifyRange(),this._rangeChanged=!1),this._finishDOMUpdate()}_finishDOMUpdate(){this._connected&&(this._children.forEach((e=>this._childrenRO.observe(e))),this._checkScrollIntoViewTarget(this._childrenPos),this._positionChildren(this._childrenPos),this._sizeHostElement(this._scrollSize),this._correctScrollError(),this._benchmarkStart&&"mark"in window.performance&&window.performance.mark("uv-end"))}_updateLayout(){this._layout&&this._connected&&(this._layout.items=this._items,this._updateView(),null!==this._childMeasurements&&(this._measureCallback&&this._measureCallback(this._childMeasurements),this._childMeasurements=null),this._layout.reflowIfNeeded(),this._benchmarkStart&&"mark"in window.performance&&window.performance.mark("uv-end"))}_handleScrollEvent(){if(this._benchmarkStart&&"mark"in window.performance){try{window.performance.measure("uv-virtualizing","uv-start","uv-end")}catch(e){console.warn("Error measuring performance data: ",e)}window.performance.mark("uv-start")}!1===this._scrollerController.correctingScrollError&&this._layout?.unpin(),this._schedule(this._updateLayout)}handleEvent(e){if("scroll"===e.type)(e.currentTarget===window||this._clippingAncestors.includes(e.currentTarget))&&this._handleScrollEvent();else console.warn("event not handled",e)}_handleLayoutMessage(e){"stateChanged"===e.type?this._updateDOM(e):"visibilityChanged"===e.type?(this._firstVisible=e.firstVisible,this._lastVisible=e.lastVisible,this._notifyVisibility()):"unpinned"===e.type&&this._hostElement.dispatchEvent(new kM)}get _children(){const e=[];let t=this._hostElement.firstElementChild;for(;t;)t.hasAttribute(UM)||e.push(t),t=t.nextElementSibling;return e}_updateView(){const e=this._hostElement,t=this._scrollerController?.element,i=this._layout;if(e&&t&&i){let M,n,o,r;const s=e.getBoundingClientRect();M=0,n=0,o=window.innerHeight,r=window.innerWidth;const a=this._clippingAncestors.map((e=>e.getBoundingClientRect()));a.unshift(s);for(const e of a)M=Math.max(M,e.top),n=Math.max(n,e.left),o=Math.min(o,e.bottom),r=Math.min(r,e.right);const l=t.getBoundingClientRect(),N={left:s.left-l.left,top:s.top-l.top},g={width:t.scrollWidth,height:t.scrollHeight},u=M-s.top+e.scrollTop,c=n-s.left+e.scrollLeft,D=Math.max(0,o-M),j=Math.max(0,r-n);i.viewportSize={width:j,height:D},i.viewportScroll={top:u,left:c},i.totalScrollSize=g,i.offsetWithinScroller=N}}_sizeHostElement(e){const t=82e5,i=e&&null!==e.width?Math.min(t,e.width):0,M=e&&null!==e.height?Math.min(t,e.height):0;if(this._isScroller)this._getSizer().style.transform=`translate(${i}px, ${M}px)`;else{const e=this._hostElement.style;e.minWidth=i?`${i}px`:"100%",e.minHeight=M?`${M}px`:"100%"}}_positionChildren(e){e&&e.forEach((({top:e,left:t,width:i,height:M,xOffset:n,yOffset:o},r)=>{const s=this._children[r-this._first];s&&(s.style.position="absolute",s.style.boxSizing="border-box",s.style.transform=`translate(${t}px, ${e}px)`,void 0!==i&&(s.style.width=i+"px"),void 0!==M&&(s.style.height=M+"px"),s.style.left=void 0===n?null:n+"px",s.style.top=void 0===o?null:o+"px")}))}async _adjustRange(e){const{_first:t,_last:i,_firstVisible:M,_lastVisible:n}=this;this._first=e.first,this._last=e.last,this._firstVisible=e.firstVisible,this._lastVisible=e.lastVisible,this._rangeChanged=this._rangeChanged||this._first!==t||this._last!==i,this._visibilityChanged=this._visibilityChanged||this._firstVisible!==M||this._lastVisible!==n}_correctScrollError(){if(this._scrollError){const{scrollTop:e,scrollLeft:t}=this._scrollerController,{top:i,left:M}=this._scrollError;this._scrollError=null,this._scrollerController.correctScrollError({top:e-i,left:t-M})}}element(e){return e===1/0&&(e=this._items.length-1),void 0===this._items?.[e]?void 0:{scrollIntoView:(t={})=>this._scrollElementIntoView({...t,index:e})}}_scrollElementIntoView(e){if(e.index>=this._first&&e.index<=this._last)this._children[e.index-this._first].scrollIntoView(e);else if(e.index=Math.min(e.index,this._items.length-1),"smooth"===e.behavior){const t=this._layout.getScrollIntoViewCoordinates(e),{behavior:i}=e;this._updateScrollIntoViewCoordinates=this._scrollerController.managedScrollTo(Object.assign(t,{behavior:i}),(()=>this._layout.getScrollIntoViewCoordinates(e)),(()=>this._scrollIntoViewTarget=null)),this._scrollIntoViewTarget=e}else this._layout.pin=e}_checkScrollIntoViewTarget(e){const{index:t}=this._scrollIntoViewTarget||{};t&&e?.has(t)&&this._updateScrollIntoViewCoordinates(this._layout.getScrollIntoViewCoordinates(this._scrollIntoViewTarget))}_notifyRange(){this._hostElement.dispatchEvent(new wM({first:this._first,last:this._last}))}_notifyVisibility(){this._hostElement.dispatchEvent(new QM({first:this._firstVisible,last:this._lastVisible}))}get layoutComplete(){return this._layoutCompletePromise||(this._layoutCompletePromise=new Promise(((e,t)=>{this._layoutCompleteResolver=e,this._layoutCompleteRejecter=t}))),this._layoutCompletePromise}_rejectLayoutCompletePromise(e){null!==this._layoutCompleteRejecter&&this._layoutCompleteRejecter(e),this._resetLayoutCompleteState()}_scheduleLayoutComplete(){this._layoutCompletePromise&&null===this._pendingLayoutComplete&&(this._pendingLayoutComplete=requestAnimationFrame((()=>requestAnimationFrame((()=>this._resolveLayoutCompletePromise())))))}_resolveLayoutCompletePromise(){null!==this._layoutCompleteResolver&&this._layoutCompleteResolver(),this._resetLayoutCompleteState()}_resetLayoutCompleteState(){this._layoutCompletePromise=null,this._layoutCompleteResolver=null,this._layoutCompleteRejecter=null,this._pendingLayoutComplete=null}_hostElementSizeChanged(){this._schedule(this._updateLayout)}_childLoaded(){}_childrenSizeChanged(e){if(this._layout?.measureChildren){for(const t of e)this._toBeMeasured.set(t.target,t.contentRect);this._measureChildren()}this._scheduleLayoutComplete(),this._itemsChanged=!1,this._rangeChanged=!1}}function VM(e){const t=e?parseFloat(e):NaN;return Number.isNaN(t)?0:t}function WM(e){if(null!==e.assignedSlot)return e.assignedSlot;if(null!==e.parentElement)return e.parentElement;const t=e.parentNode;return t&&t.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&t.host||null}const PM=Ae(class extends SM{constructor(e){if(super(e),this._virtualizer=null,this._first=0,this._last=-1,this._renderItem=(e,t)=>((e,t)=>R`${t}: ${JSON.stringify(e,null,2)}`)(e,t+this._first),this._keyFunction=(e,t)=>(e=>e)(e,this._first),this._items=[],e.type!==he)throw new Error("The virtualize directive can only be used in child expressions")}render(e){e&&this._setFunctions(e);const t=[];if(this._first>=0&&this._last>=this._first)for(let e=this._first;e<=this._last;e++)t.push(this._items[e]);return EM(t,this._keyFunction,this._renderItem)}update(e,[t]){this._setFunctions(t);const i=this._items!==t.items;return this._items=t.items||[],this._virtualizer?this._updateVirtualizerConfig(e,t):this._initialize(e,t),i?B:this.render()}async _updateVirtualizerConfig(e,t){if(!await this._virtualizer.updateLayoutConfig(t.layout||{})){const i=e.parentNode;this._makeVirtualizer(i,t)}this._virtualizer.items=this._items}_setFunctions(e){const{renderItem:t,keyFunction:i}=e;t&&(this._renderItem=(e,i)=>t(e,i+this._first)),i&&(this._keyFunction=(e,t)=>i(e,t+this._first))}_makeVirtualizer(e,t){this._virtualizer&&this._virtualizer.disconnected();const{layout:i,scroller:M,items:n}=t;this._virtualizer=new ZM({hostElement:e,layout:i,scroller:M}),this._virtualizer.items=n,this._virtualizer.connected()}_initialize(e,t){const i=e.parentNode;i&&1===i.nodeType&&(i.addEventListener("rangeChanged",(e=>{this._first=e.first,this._last=e.last,this.setValue(this.render())})),this._makeVirtualizer(i,t))}disconnected(){this._virtualizer?.disconnected()}reconnected(){this._virtualizer?.connected()}});class RM{static getVirtualizedContent(e,t,i,M,n,o,r,s,a,l,N,g,u,c,D,j){return R`
|
|
4877
|
+
*/(this._hostElement,e),this._scrollerController=new bM(this,this._clippingAncestors[0]),this._schedule(this._updateLayout),this._observeAndListen(),this._connected=!0}_observeAndListen(){this._mutationObserver.observe(this._hostElement,{childList:!0}),this._hostElementRO.observe(this._hostElement),this._scrollEventListeners.push(window),window.addEventListener("scroll",this,this._scrollEventListenerOptions),this._clippingAncestors.forEach((e=>{e.addEventListener("scroll",this,this._scrollEventListenerOptions),this._scrollEventListeners.push(e),this._hostElementRO.observe(e)})),this._hostElementRO.observe(this._scrollerController.element),this._children.forEach((e=>this._childrenRO.observe(e))),this._scrollEventListeners.forEach((e=>e.addEventListener("scroll",this,this._scrollEventListenerOptions)))}disconnected(){this._scrollEventListeners.forEach((e=>e.removeEventListener("scroll",this,this._scrollEventListenerOptions))),this._scrollEventListeners=[],this._clippingAncestors=[],this._scrollerController?.detach(this),this._scrollerController=null,this._mutationObserver?.disconnect(),this._mutationObserver=null,this._hostElementRO?.disconnect(),this._hostElementRO=null,this._childrenRO?.disconnect(),this._childrenRO=null,this._rejectLayoutCompletePromise("disconnected"),this._connected=!1}_applyVirtualizerStyles(){const e=this._hostElement.style;e.display=e.display||"block",e.position=e.position||"relative",e.contain=e.contain||"size layout",this._isScroller&&(e.overflow=e.overflow||"auto",e.minHeight=e.minHeight||"150px")}_getSizer(){const e=this._hostElement;if(!this._sizer){let t=e.querySelector(`[${UM}]`);t||(t=document.createElement("div"),t.setAttribute(UM,""),e.appendChild(t)),Object.assign(t.style,{position:"absolute",margin:"-2px 0 0 0",padding:0,visibility:"hidden",fontSize:"2px"}),t.textContent=" ",t.setAttribute(UM,""),this._sizer=t}return this._sizer}async updateLayoutConfig(e){await this._layoutInitialized;const t=e.type||YM;if("function"==typeof t&&this._layout instanceof t){const t={...e};return delete t.type,this._layout.config=t,!0}return!1}async _initLayout(e){let t,i;if("function"==typeof e.type){i=e.type;const M={...e};delete M.type,t=M}else t=e;void 0===i&&(YM=i=(await Promise.resolve().then((function(){return yQ}))).FlowLayout),this._layout=new i((e=>this._handleLayoutMessage(e)),t),this._layout.measureChildren&&"function"==typeof this._layout.updateItemSizes&&("function"==typeof this._layout.measureChildren&&(this._measureChildOverride=this._layout.measureChildren),this._measureCallback=this._layout.updateItemSizes.bind(this._layout)),this._layout.listenForChildLoadEvents&&this._hostElement.addEventListener("load",this._loadListener,!0),this._schedule(this._updateLayout)}startBenchmarking(){null===this._benchmarkStart&&(this._benchmarkStart=window.performance.now())}stopBenchmarking(){if(null!==this._benchmarkStart){const e=window.performance.now(),t=e-this._benchmarkStart,i=performance.getEntriesByName("uv-virtualizing","measure").filter((t=>t.startTime>=this._benchmarkStart&&t.startTime<e)).reduce(((e,t)=>e+t.duration),0);return this._benchmarkStart=null,{timeElapsed:t,virtualizationTime:i}}return null}_measureChildren(){const e={},t=this._children,i=this._measureChildOverride||this._measureChild;for(let M=0;M<t.length;M++){const n=t[M],o=this._first+M;(this._itemsChanged||this._toBeMeasured.has(n))&&(e[o]=i.call(this,n,this._items[o]))}this._childMeasurements=e,this._schedule(this._updateLayout),this._toBeMeasured.clear()}_measureChild(e){const{width:t,height:i}=e.getBoundingClientRect();return Object.assign({width:t,height:i},function(e){const t=window.getComputedStyle(e);return{marginTop:VM(t.marginTop),marginRight:VM(t.marginRight),marginBottom:VM(t.marginBottom),marginLeft:VM(t.marginLeft)}}(e))}async _schedule(e){this._scheduled.has(e)||(this._scheduled.add(e),await Promise.resolve(),this._scheduled.delete(e),e.call(this))}async _updateDOM(e){this._scrollSize=e.scrollSize,this._adjustRange(e.range),this._childrenPos=e.childPositions,this._scrollError=e.scrollError||null;const{_rangeChanged:t,_itemsChanged:i}=this;this._visibilityChanged&&(this._notifyVisibility(),this._visibilityChanged=!1),(t||i)&&(this._notifyRange(),this._rangeChanged=!1),this._finishDOMUpdate()}_finishDOMUpdate(){this._connected&&(this._children.forEach((e=>this._childrenRO.observe(e))),this._checkScrollIntoViewTarget(this._childrenPos),this._positionChildren(this._childrenPos),this._sizeHostElement(this._scrollSize),this._correctScrollError(),this._benchmarkStart&&"mark"in window.performance&&window.performance.mark("uv-end"))}_updateLayout(){this._layout&&this._connected&&(this._layout.items=this._items,this._updateView(),null!==this._childMeasurements&&(this._measureCallback&&this._measureCallback(this._childMeasurements),this._childMeasurements=null),this._layout.reflowIfNeeded(),this._benchmarkStart&&"mark"in window.performance&&window.performance.mark("uv-end"))}_handleScrollEvent(){if(this._benchmarkStart&&"mark"in window.performance){try{window.performance.measure("uv-virtualizing","uv-start","uv-end")}catch(e){console.warn("Error measuring performance data: ",e)}window.performance.mark("uv-start")}!1===this._scrollerController.correctingScrollError&&this._layout?.unpin(),this._schedule(this._updateLayout)}handleEvent(e){if("scroll"===e.type)(e.currentTarget===window||this._clippingAncestors.includes(e.currentTarget))&&this._handleScrollEvent();else console.warn("event not handled",e)}_handleLayoutMessage(e){"stateChanged"===e.type?this._updateDOM(e):"visibilityChanged"===e.type?(this._firstVisible=e.firstVisible,this._lastVisible=e.lastVisible,this._notifyVisibility()):"unpinned"===e.type&&this._hostElement.dispatchEvent(new kM)}get _children(){const e=[];let t=this._hostElement.firstElementChild;for(;t;)t.hasAttribute(UM)||e.push(t),t=t.nextElementSibling;return e}_updateView(){const e=this._hostElement,t=this._scrollerController?.element,i=this._layout;if(e&&t&&i){let M,n,o,r;const s=e.getBoundingClientRect();M=0,n=0,o=window.innerHeight,r=window.innerWidth;const a=this._clippingAncestors.map((e=>e.getBoundingClientRect()));a.unshift(s);for(const e of a)M=Math.max(M,e.top),n=Math.max(n,e.left),o=Math.min(o,e.bottom),r=Math.min(r,e.right);const l=t.getBoundingClientRect(),N={left:s.left-l.left,top:s.top-l.top},g={width:t.scrollWidth,height:t.scrollHeight},u=M-s.top+e.scrollTop,c=n-s.left+e.scrollLeft,D=Math.max(0,o-M),j=Math.max(0,r-n);i.viewportSize={width:j,height:D},i.viewportScroll={top:u,left:c},i.totalScrollSize=g,i.offsetWithinScroller=N}}_sizeHostElement(e){const t=82e5,i=e&&null!==e.width?Math.min(t,e.width):0,M=e&&null!==e.height?Math.min(t,e.height):0;if(this._isScroller)this._getSizer().style.transform=`translate(${i}px, ${M}px)`;else{const e=this._hostElement.style;e.minWidth=i?`${i}px`:"100%",e.minHeight=M?`${M}px`:"100%"}}_positionChildren(e){e&&e.forEach((({top:e,left:t,width:i,height:M,xOffset:n,yOffset:o},r)=>{const s=this._children[r-this._first];s&&(s.style.position="absolute",s.style.boxSizing="border-box",s.style.transform=`translate(${t}px, ${e}px)`,void 0!==i&&(s.style.width=i+"px"),void 0!==M&&(s.style.height=M+"px"),s.style.left=void 0===n?null:n+"px",s.style.top=void 0===o?null:o+"px")}))}async _adjustRange(e){const{_first:t,_last:i,_firstVisible:M,_lastVisible:n}=this;this._first=e.first,this._last=e.last,this._firstVisible=e.firstVisible,this._lastVisible=e.lastVisible,this._rangeChanged=this._rangeChanged||this._first!==t||this._last!==i,this._visibilityChanged=this._visibilityChanged||this._firstVisible!==M||this._lastVisible!==n}_correctScrollError(){if(this._scrollError){const{scrollTop:e,scrollLeft:t}=this._scrollerController,{top:i,left:M}=this._scrollError;this._scrollError=null,this._scrollerController.correctScrollError({top:e-i,left:t-M})}}element(e){return e===1/0&&(e=this._items.length-1),void 0===this._items?.[e]?void 0:{scrollIntoView:(t={})=>this._scrollElementIntoView({...t,index:e})}}_scrollElementIntoView(e){if(e.index>=this._first&&e.index<=this._last)this._children[e.index-this._first].scrollIntoView(e);else if(e.index=Math.min(e.index,this._items.length-1),"smooth"===e.behavior){const t=this._layout.getScrollIntoViewCoordinates(e),{behavior:i}=e;this._updateScrollIntoViewCoordinates=this._scrollerController.managedScrollTo(Object.assign(t,{behavior:i}),(()=>this._layout.getScrollIntoViewCoordinates(e)),(()=>this._scrollIntoViewTarget=null)),this._scrollIntoViewTarget=e}else this._layout.pin=e}_checkScrollIntoViewTarget(e){const{index:t}=this._scrollIntoViewTarget||{};t&&e?.has(t)&&this._updateScrollIntoViewCoordinates(this._layout.getScrollIntoViewCoordinates(this._scrollIntoViewTarget))}_notifyRange(){this._hostElement.dispatchEvent(new wM({first:this._first,last:this._last}))}_notifyVisibility(){this._hostElement.dispatchEvent(new QM({first:this._firstVisible,last:this._lastVisible}))}get layoutComplete(){return this._layoutCompletePromise||(this._layoutCompletePromise=new Promise(((e,t)=>{this._layoutCompleteResolver=e,this._layoutCompleteRejecter=t}))),this._layoutCompletePromise}_rejectLayoutCompletePromise(e){null!==this._layoutCompleteRejecter&&this._layoutCompleteRejecter(e),this._resetLayoutCompleteState()}_scheduleLayoutComplete(){this._layoutCompletePromise&&null===this._pendingLayoutComplete&&(this._pendingLayoutComplete=requestAnimationFrame((()=>requestAnimationFrame((()=>this._resolveLayoutCompletePromise())))))}_resolveLayoutCompletePromise(){null!==this._layoutCompleteResolver&&this._layoutCompleteResolver(),this._resetLayoutCompleteState()}_resetLayoutCompleteState(){this._layoutCompletePromise=null,this._layoutCompleteResolver=null,this._layoutCompleteRejecter=null,this._pendingLayoutComplete=null}_hostElementSizeChanged(){this._schedule(this._updateLayout)}_childLoaded(){}_childrenSizeChanged(e){if(this._layout?.measureChildren){for(const t of e)this._toBeMeasured.set(t.target,t.contentRect);this._measureChildren()}this._scheduleLayoutComplete(),this._itemsChanged=!1,this._rangeChanged=!1}}function VM(e){const t=e?parseFloat(e):NaN;return Number.isNaN(t)?0:t}function WM(e){if(null!==e.assignedSlot)return e.assignedSlot;if(null!==e.parentElement)return e.parentElement;const t=e.parentNode;return t&&t.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&t.host||null}const PM=Ae(class extends SM{constructor(e){if(super(e),this._virtualizer=null,this._first=0,this._last=-1,this._renderItem=(e,t)=>((e,t)=>R`${t}: ${JSON.stringify(e,null,2)}`)(e,t+this._first),this._keyFunction=(e,t)=>(e=>e)(e,this._first),this._items=[],e.type!==he)throw new Error("The virtualize directive can only be used in child expressions")}render(e){e&&this._setFunctions(e);const t=[];if(this._first>=0&&this._last>=this._first)for(let e=this._first;e<=this._last;e++)t.push(this._items[e]);return EM(t,this._keyFunction,this._renderItem)}update(e,[t]){this._setFunctions(t);const i=this._items!==t.items;return this._items=t.items||[],this._virtualizer?this._updateVirtualizerConfig(e,t):this._initialize(e,t),i?B:this.render()}async _updateVirtualizerConfig(e,t){if(!await this._virtualizer.updateLayoutConfig(t.layout||{})){const i=e.parentNode;this._makeVirtualizer(i,t)}this._virtualizer.items=this._items}_setFunctions(e){const{renderItem:t,keyFunction:i}=e;t&&(this._renderItem=(e,i)=>t(e,i+this._first)),i&&(this._keyFunction=(e,t)=>i(e,t+this._first))}_makeVirtualizer(e,t){this._virtualizer&&this._virtualizer.disconnected();const{layout:i,scroller:M,items:n}=t;this._virtualizer=new ZM({hostElement:e,layout:i,scroller:M}),this._virtualizer.items=n,this._virtualizer.connected()}_initialize(e,t){const i=e.parentNode;i&&1===i.nodeType&&(i.addEventListener("rangeChanged",(e=>{this._first=e.first,this._last=e.last,this.setValue(this.render())})),this._makeVirtualizer(i,t))}disconnected(){this._virtualizer?.disconnected()}reconnected(){this._virtualizer?.connected()}});class RM{static getVirtualizedContent(e,t,i,M,n,o,r,s,a,l,N,g,u,c,D,j){return R`
|
|
4878
4878
|
<div part="select-options" class="select__options ${t?"select__options__search-enabled":""} ${u?"loading":""}">
|
|
4879
4879
|
${N&&!u?R`
|
|
4880
4880
|
<div part="select-no-results" class="select__no-results">
|
|
@@ -5881,11 +5881,11 @@ class CM{constructor(e){this._element=null;const t=e??window;this._node=t,e&&(th
|
|
|
5881
5881
|
:host([required]) .nile-auto-complete__label::after {
|
|
5882
5882
|
content: "*";
|
|
5883
5883
|
color: var(--nile-colors-red-700, var(--ng-colors-text-error-primary-600));
|
|
5884
|
-
margin-inline-start:
|
|
5884
|
+
margin-inline-start: 2px;
|
|
5885
5885
|
}
|
|
5886
5886
|
`;let un=class{static calculateAvailableSpace(e){const t=e.getBoundingClientRect(),i=window.innerHeight,M=i-t.bottom;return{spaceAbove:t.top,spaceBelow:M,viewportHeight:i}}static getOptimalPlacement(e){const{spaceAbove:t,spaceBelow:i}=this.calculateAvailableSpace(e);return i<200&&t>i?"top":"bottom"}static findBoundaryElements(e){const t=[];let i=e.parentElement;for(;i&&i!==document.body;){const e=window.getComputedStyle(i),M=e.overflow,n=e.overflowY,o=e.overflowX;"auto"!==M&&"scroll"!==M&&"auto"!==n&&"scroll"!==n&&"auto"!==o&&"scroll"!==o||t.push(i),(i.hasAttribute("data-floating-boundary")||i.classList.contains("floating-boundary")||i.classList.contains("scroll-container"))&&t.push(i),i=i.parentElement}return t.length>0?t:void 0}static calculateOptimalHeight(e,t,i){const M=t-(e.y+e.height),n=e.y;return n>M?Math.max(n-20,100):M>n?Math.max(M-20,100):Math.max(Math.min(n,M)-20,100)}static extractStylesAsCSS(e){return"string"==typeof e?e:Array.isArray(e)?e.map((e=>this.extractStylesAsCSS(e))).join("\n"):e&&"object"==typeof e&&e.cssText?e.cssText:""}static generateStyleId(){return`nile-auto-complete-styles-${Math.random().toString(36).substring(2,11)}`}static isPositioningOptimal(e,t){const{spaceAbove:i,spaceBelow:M}=this.calculateAvailableSpace(t),n=e.startsWith("top"),o=e.startsWith("bottom");return!(n&&M>i)&&!(o&&i>M)}static applyCollisionData(e,t,i){if(t.flip){const{overflows:M}=t.flip;if(e.setAttribute("data-placement",i),M&&M.length>0){const t=M.map((e=>e.placement)).join(",");e.setAttribute("data-overflow",t)}else e.removeAttribute("data-overflow")}if(t.shift){const{x:i,y:M}=t.shift;void 0===i||void 0===M||0===i&&0===M?e.removeAttribute("data-shift"):e.setAttribute("data-shift",`${i},${M}`)}if(t.size){const{availableWidth:i,availableHeight:M}=t.size;void 0!==i&&e.setAttribute("data-available-width",i.toString()),void 0!==M&&e.setAttribute("data-available-height",M.toString())}}},cn=class{static createBaseMenu(e){const t=document.createElement("nile-menu");return t.id="content-menu",t.className=e.enableVirtualScroll?"virtualized__menu":"",e.enableVirtualScroll,t.setAttribute("exportparts","menu__items-wrapper:options__wrapper"),t}static addMenuItems(e,t){(t.menuItems||[]).forEach((i=>{const M=this.createMenuItem(i,t);e.appendChild(M)}))}static createMenuItem(e,t){const i=document.createElement("div"),M=t.getItemRenderFunction(e);return se(M,i),i.firstElementChild}static createPortalMenu(e){const t=this.createBaseMenu(e);return this.addMenuItems(t,e),t}static updatePortalMenuItems(e,t){if(!e)return;e.querySelectorAll("nile-menu-item").forEach((e=>e.remove())),this.addMenuItems(e,t)}},Dn=class{static setupPortalEventListeners(e,t){e&&this.setupMenuSelectListeners(e,t)}static setupMenuSelectListeners(e,t){e&&e.addEventListener("nile-select",(e=>{const i=e;t.handleSelect&&t.handleSelect(i)}))}};class jn{constructor(e){this.portalContainer=null,this.originalMenuParent=null,this.measuredMenuHeight=null,this.clonedMenu=null,this.cleanupAutoUpdate=null,this.currentPlacement="bottom",this.currentMiddlewareData=null,this.component=e}createPortalAppendContainer(){const e=document.createElement("div");return e.style.position="absolute",e.style.zIndex="9999",e.style.pointerEvents="none",e.style.width="auto",e.style.minWidth="auto",e.className="nile-auto-complete-portal-append",e}positionPortalAppend(){this.portalContainer&&this.component.dropdownElement&&(this.measureMenuHeight(),this.computeFloatingUIPosition())}measureMenuHeight(){!this.measuredMenuHeight&&this.portalContainer&&(this.portalContainer.style.position="absolute",this.portalContainer.style.visibility="hidden",this.portalContainer.style.top="0px",this.portalContainer.style.left="0px",this.portalContainer.offsetHeight,this.measuredMenuHeight=this.portalContainer.offsetHeight,this.portalContainer.style.visibility="")}async computeFloatingUIPosition(){if(!this.portalContainer)return;const e=this.component.inputElement||this.component,t=this.portalContainer;try{const{x:i,y:M,placement:n,middlewareData:o}=await this.calculateFloatingUIPosition(e,t);this.applyFloatingUIPosition(t,e,i,M,n,o)}catch(e){console.warn("Floating UI positioning failed, falling back to simple positioning:",e),this.fallbackPositioning()}}async calculateFloatingUIPosition(e,t){const i=un.findBoundaryElements(e),M="top"===un.getOptimalPlacement(e)?"top-start":"bottom-start",n=this.createFloatingUIMiddleware(i);return await Ji(e,t,{placement:M,strategy:"fixed",middleware:n,platform:this.createCustomPlatform()})}createFloatingUIMiddleware(e){return[Bi(4),Fi({apply:this.handleSizeMiddleware.bind(this),padding:10,boundary:e}),_i({fallbackPlacements:["bottom-start","top-start","bottom","top","bottom-end","top-end"],fallbackStrategy:"bestFit",padding:10,boundary:e}),Gi({padding:10,crossAxis:!0,boundary:e})]}handleSizeMiddleware({availableWidth:e,availableHeight:t,elements:i,rects:M}){const n=un.calculateOptimalHeight(M.reference,window.innerHeight,this.currentPlacement);i.floating.style.maxHeight=`${n}px`,i.floating.style.setProperty("--auto-size-available-width",`${e}px`),i.floating.style.setProperty("--auto-size-available-height",`${n}px`)}createCustomPlatform(){return Wi}applyFloatingUIPosition(e,t,i,M,n,o){const r=t.getBoundingClientRect();Object.assign(e.style,{left:`${r.left}px`,top:`${M}px`,position:"fixed",pointerEvents:"auto",width:"auto",minWidth:"auto"}),this.currentPlacement=n,this.currentMiddlewareData=o,un.applyCollisionData(e,o,n);const s=n.split("-")[0];e.className=`nile-auto-complete-portal-append menu__listbox--${s}`}fallbackPositioning(){if(!this.portalContainer)return;const e=(this.component.inputElement||this.component).getBoundingClientRect(),t=window.innerHeight;this.measuredMenuHeight;const i=t-e.bottom,M=e.top;let n,o,r;M>i?(r=Math.max(M-20,100),n=Math.max(e.top-r-4,10),o="top"):(r=Math.max(i-20,100),n=e.bottom+4,o="bottom"),this.portalContainer.style.left=`${e.left}px`,this.portalContainer.style.top=`${n}px`,this.portalContainer.style.width="auto",this.portalContainer.style.minWidth="auto",this.portalContainer.style.maxHeight=`${r}px`,this.portalContainer.style.pointerEvents="auto",this.portalContainer.className=`nile-auto-complete-portal-append menu__listbox--${o}`,this.calculateAndSetAutoSizeProperties(e,n,o)}calculateAndSetAutoSizeProperties(e,t,i){if(!this.portalContainer)return;const M=window.innerHeight,n=window.innerWidth;let o;o="top"===i?e.top-10:M-e.bottom-10;const r=Math.min(e.width,n-e.left-10);this.portalContainer.style.setProperty("--auto-size-available-height",`${Math.max(o,100)}px`),this.portalContainer.style.setProperty("--auto-size-available-width",`${Math.max(r,200)}px`)}updatePortalAppendPosition(){this.component.portal&&this.portalContainer&&this.positionPortalAppend()}handleWindowResize(){this.component.portal&&this.portalContainer&&this.positionPortalAppend()}setupAutoUpdatePositioning(){this.portalContainer&&this.component&&(this.cleanupAutoUpdatePositioning(),this.cleanupAutoUpdate=Ri(this.component,this.portalContainer,(()=>{this.computeFloatingUIPosition()}),{ancestorScroll:!0,ancestorResize:!0,elementResize:!0,layoutShift:!0,animationFrame:!0}))}cleanupAutoUpdatePositioning(){this.cleanupAutoUpdate&&(this.cleanupAutoUpdate(),this.cleanupAutoUpdate=null)}injectStylesToDocument(){if(!this.portalContainer)return;const e=un.generateStyleId();if(document.getElementById(e))return;const t=this.component.constructor.styles;if(!t)return;const i=document.createElement("style");i.id=e,i.textContent=un.extractStylesAsCSS(t),document.head.appendChild(i),this.portalContainer.__injectedStyleId=e}adoptStylesToPortalAppend(){this.portalContainer&&this.injectStylesToDocument()}setupPortalAppend(){this.component.portal&&this.component.updateComplete.then((()=>{setTimeout((()=>{const e=this.component.shadowRoot?.querySelector("#content-menu")||this.component.querySelector("#content-menu");e&&this.component.isDropdownOpen&&(this.originalMenuParent=e.parentElement,this.clonedMenu=this.createPortalMenu(),this.portalContainer=this.createPortalAppendContainer(),this.portalContainer.appendChild(this.clonedMenu),document.body.appendChild(this.portalContainer),this.adoptStylesToPortalAppend(),this.clonedMenu.style.display="",this.positionPortalAppend(),this.setupPortalEventListeners(),this.setupAutoUpdatePositioning(),window.addEventListener("resize",this.handleWindowResize.bind(this)))}),10)}))}createPortalMenu(){return cn.createPortalMenu(this.component)}setupPortalEventListeners(){Dn.setupPortalEventListeners(this.clonedMenu,this.component)}cleanupPortalAppend(){if(this.cleanupAutoUpdatePositioning(),this.portalContainer&&this.portalContainer.parentNode){const e=this.portalContainer.__injectedStyleId;if(e){const t=document.getElementById(e);t&&t.remove()}this.portalContainer.parentNode.removeChild(this.portalContainer)}window.removeEventListener("resize",this.handleWindowResize.bind(this)),this.portalContainer=null,this.originalMenuParent=null,this.clonedMenu=null,this.measuredMenuHeight=null,this.currentPlacement="bottom",this.currentMiddlewareData=null}get portalContainerElement(){return this.portalContainer}resetMeasuredHeight(){this.measuredMenuHeight=null}updatePortalOptions(){this.portalContainer&&this.clonedMenu&&(cn.updatePortalMenuItems(this.clonedMenu,this.component),this.forceReposition())}forceReposition(){this.portalContainer&&this.computeFloatingUIPosition()}getCurrentPlacement(){return this.currentPlacement}getCurrentMiddlewareData(){return this.currentMiddlewareData}isUsingFloatingUI(){return null!==this.cleanupAutoUpdate}isPositioningOptimal(){if(!this.portalContainer||!this.currentMiddlewareData)return!0;const e=(this.component.inputElement||this.component).getBoundingClientRect(),t=window.innerHeight-e.bottom,i=e.top,M=this.currentPlacement.startsWith("top"),n=this.currentPlacement.startsWith("bottom");return!(M&&t>i)&&!(n&&i>t)}}let In=class extends Re{constructor(){super(...arguments),this.disabled=!1,this.isDropdownOpen=!1,this.portal=!1,this.portalManager=new jn(this),this.enableVirtualScroll=!1,this.openOnFocus=!1,this.value="",this.placeholder="Type here ..",this.noBorder=!1,this.noOutline=!1,this.noPadding=!1,this.loading=!1,this.filterFunction=(e,t)=>e.toLowerCase().includes(t.toLowerCase()),this.renderItemFunction=e=>e,this.allMenuItems=[],this.enableVisibilityEffect=!1,this.enableTabClose=!1,this.noDropdownClose=!1,this.label="",this.menuItems=[],this.handleWindowResize=()=>{this.portalManager.updatePortalAppendPosition()},this.handleWindowScroll=()=>{this.portalManager.updatePortalAppendPosition()}}async firstUpdated(e){await this.updateComplete,this.visibilityManager=new tM({host:this,target:this.inputElement.input,enableVisibilityEffect:this.enableVisibilityEffect,enableTabClose:this.enableTabClose,isOpen:()=>this.isDropdownOpen,onAnchorOutOfView:()=>{this.isDropdownOpen=!1,this.dropdownElement?.hide(),this.emit("nile-visibility-change",{visible:!1,reason:"anchor-out-of-view"})},onDocumentHidden:()=>{this.isDropdownOpen=!1,this.dropdownElement?.hide(),this.emit("nile-visibility-change",{visible:!1,reason:"document-hidden"})},emit:(e,t)=>this.emit(`nile-${e}`,t)})}connectedCallback(){super.connectedCallback(),this.renderItemFunction=e=>e,this.handleDocumentFocusIn=this.handleDocumentFocusIn.bind(this),this.handleDocumentMouseDown=this.handleDocumentMouseDown.bind(this),this.handleWindowResize=this.handleWindowResize.bind(this),this.handleWindowScroll=this.handleWindowScroll.bind(this)}disconnectedCallback(){super.disconnectedCallback(),this.removeOpenListeners(),this.visibilityManager?.cleanup(),this.portalManager.cleanupPortalAppend()}updated(e){super.updated(e),e.has("allMenuItems")&&(this.menuItems=this.applyFilter(this.allMenuItems,this.filterFunction),this.setVirtualMenuWidth(),this.portal&&this.isDropdownOpen&&this.portalManager.updatePortalOptions()),e.has("isDropdownOpen")&&(this.menuItems=this.applyFilter(this.allMenuItems,this.filterFunction),this.handleDropdownOpenChange()),e.has("value")&&(this.menuItems=this.applyFilter(this.allMenuItems,this.filterFunction),this.portal&&this.isDropdownOpen&&this.portalManager.updatePortalOptions()),e.has("portal")&&this.handlePortalChange()}handlePortalChange(){this.isDropdownOpen&&(this.portal?this.portalManager.setupPortalAppend():this.portalManager.cleanupPortalAppend())}handleDropdownOpenChange(){this.isDropdownOpen?(this.addOpenListeners(),this.visibilityManager?.setup(),this.portal&&this.portalManager.setupPortalAppend()):(this.removeOpenListeners(),this.visibilityManager?.cleanup(),this.portal&&this.portalManager.cleanupPortalAppend())}addOpenListeners(){document.addEventListener("focusin",this.handleDocumentFocusIn),document.addEventListener("mousedown",this.handleDocumentMouseDown),this.portal&&(window.addEventListener("resize",this.handleWindowResize),window.addEventListener("scroll",this.handleWindowScroll,!0))}removeOpenListeners(){document.removeEventListener("focusin",this.handleDocumentFocusIn),document.removeEventListener("mousedown",this.handleDocumentMouseDown),window.removeEventListener("resize",this.handleWindowResize),window.removeEventListener("scroll",this.handleWindowScroll,!0)}handleDocumentFocusIn(e){if(!this.isDropdownOpen)return;const t=e.composedPath(),i=t.includes(this),M=this.dropdownElement&&t.includes(this.dropdownElement),n=this.portal&&this.portalManager.portalContainerElement&&t.includes(this.portalManager.portalContainerElement);i||M||n||(this.isDropdownOpen=!1,this.dropdownElement?.hide())}handleDocumentMouseDown(e){if(!this.isDropdownOpen)return;const t=e.composedPath(),i=t.includes(this),M=this.dropdownElement&&t.includes(this.dropdownElement),n=this.portal&&this.portalManager.portalContainerElement&&t.includes(this.portalManager.portalContainerElement);i||M||n||(this.isDropdownOpen=!1,this.dropdownElement?.hide())}render(){const e=this.enableVirtualScroll?this.getVirtualizedContent():this.getContent();return R`
|
|
5887
5887
|
${this.label?R`
|
|
5888
|
-
<label class="nile-auto-complete__label"
|
|
5888
|
+
<label class="nile-auto-complete__label">${this.label}</label>
|
|
5889
5889
|
`:G}
|
|
5890
5890
|
<nile-dropdown class="nile-dropdown--input" ?open=${this.isDropdownOpen} ?stay-open-on-select=${this.noDropdownClose} noOpenOnCLick exportparts="input, base">
|
|
5891
5891
|
<nile-input class="nile-auto-complete--input"
|
|
@@ -13076,6 +13076,7 @@ nile-badge::part(content) {
|
|
|
13076
13076
|
`;var i}disconnectedCallback(){super.disconnectedCallback(),this.emit("nile-destroy")}};e([ce({type:Number})],DL.prototype,"minValue",void 0),e([ce({type:Number})],DL.prototype,"value",void 0),e([ce({type:Number})],DL.prototype,"maxValue",void 0),e([ce({type:Number})],DL.prototype,"rangeOneValue",void 0),e([ce({type:Number})],DL.prototype,"rangeTwoValue",void 0),e([ce({type:Boolean})],DL.prototype,"showLabel",void 0),e([ce({type:String})],DL.prototype,"labelStart",void 0),e([ce({type:String})],DL.prototype,"labelEnd",void 0),e([ce({type:Boolean})],DL.prototype,"rangeSlider",void 0),e([ce({type:String})],DL.prototype,"labelPosition",void 0),e([ce({type:String})],DL.prototype,"tooltipPosition",void 0),DL=e([Ne("nile-slider")],DL);const jL=r`
|
|
13077
13077
|
:host {
|
|
13078
13078
|
display: inline-block;
|
|
13079
|
+
width: 100%;
|
|
13079
13080
|
}
|
|
13080
13081
|
|
|
13081
13082
|
* {
|
|
@@ -13089,7 +13090,7 @@ nile-badge::part(content) {
|
|
|
13089
13090
|
flex-direction: column;
|
|
13090
13091
|
justify-content: center;
|
|
13091
13092
|
align-items: flex-start;
|
|
13092
|
-
width:
|
|
13093
|
+
width: 100%;
|
|
13093
13094
|
}
|
|
13094
13095
|
|
|
13095
13096
|
input {
|
|
@@ -13097,10 +13098,8 @@ nile-badge::part(content) {
|
|
|
13097
13098
|
}
|
|
13098
13099
|
|
|
13099
13100
|
.horizontal-div {
|
|
13100
|
-
margin-bottom: 10px;
|
|
13101
13101
|
height: 62px;
|
|
13102
|
-
|
|
13103
|
-
width: 648px;
|
|
13102
|
+
width: 100%;
|
|
13104
13103
|
min-width: 230px;
|
|
13105
13104
|
padding: 12px;
|
|
13106
13105
|
display: flex;
|
|
@@ -13113,6 +13112,16 @@ nile-badge::part(content) {
|
|
|
13113
13112
|
background-color: var(--nile-colors-white-base);
|
|
13114
13113
|
}
|
|
13115
13114
|
|
|
13115
|
+
@media (width < 400px) {
|
|
13116
|
+
.browse-file-button {
|
|
13117
|
+
display: none;
|
|
13118
|
+
}
|
|
13119
|
+
|
|
13120
|
+
.horizontal-div {
|
|
13121
|
+
cursor: pointer;
|
|
13122
|
+
}
|
|
13123
|
+
}
|
|
13124
|
+
|
|
13116
13125
|
.hover-border {
|
|
13117
13126
|
border-color: var(--nile-colors-primary-600);
|
|
13118
13127
|
}
|
|
@@ -13153,7 +13162,6 @@ nile-badge::part(content) {
|
|
|
13153
13162
|
border: 1px dashed var(--nile-colors-neutral-500);
|
|
13154
13163
|
background-color: var(--nile-colors-white-base);
|
|
13155
13164
|
position: relative;
|
|
13156
|
-
margin-bottom: 10px;
|
|
13157
13165
|
}
|
|
13158
13166
|
|
|
13159
13167
|
.vertical-div:hover {
|
|
@@ -13656,6 +13664,7 @@ nile-badge::part(content) {
|
|
|
13656
13664
|
justify-content: flex-start;
|
|
13657
13665
|
align-items: center;
|
|
13658
13666
|
gap: var(--nile-spacing-one-half-x);
|
|
13667
|
+
margin-top: 10px;
|
|
13659
13668
|
}
|
|
13660
13669
|
|
|
13661
13670
|
.upload-error > nile-tooltip > span {
|
|
@@ -13670,6 +13679,7 @@ nile-badge::part(content) {
|
|
|
13670
13679
|
.vertical-upload-error {
|
|
13671
13680
|
display: flex;
|
|
13672
13681
|
gap: 4px;
|
|
13682
|
+
margin-top: 10px;
|
|
13673
13683
|
}
|
|
13674
13684
|
|
|
13675
13685
|
.vertical-upload-error nile-tooltip span, .vertical-upload-error span {
|
|
@@ -13682,7 +13692,7 @@ nile-badge::part(content) {
|
|
|
13682
13692
|
font-size: var(--nile-type-scale-2);
|
|
13683
13693
|
display: inline-block;
|
|
13684
13694
|
}
|
|
13685
|
-
`;var IL,zL,dL,hL,TL;!function(e){e.DEFAULT="default",e.DISABLED="disabled",e.HOVER="hover",e.DRAG="drag",e.ERROR="error"}(IL||(IL={})),function(e){e.HORIZONTAL="horizontal",e.VERTICAL="vertical"}(zL||(zL={})),function(e){e.INVALID_FORMAT="Invalid file format! Upload valid file.",e.SIZE_LIMIT_EXCEEDED="File exceeds size limit! Upload smaller file.",e.MULTIPLE_NOT_ALLOWED="Please Upload Single File!",e.DUPLICATES_NOT_ALLOWED="Duplicate Files Are Not Allowed!",e.UPLOAD_URL_REQUIRED="Upload URL is required!",e.SERVER_SIDE_ERROR="Error from server! Please try again later.",e.NETWORK_ERROR="Network error! Please try again later."}(dL||(dL={})),function(e){e.NILE_INIT="nile-init",e.NILE_BROWSE="nile-browse",e.
|
|
13695
|
+
`;var IL,zL,dL,hL,TL,yL,AL;!function(e){e.DEFAULT="default",e.DISABLED="disabled",e.HOVER="hover",e.DRAG="drag",e.ERROR="error"}(IL||(IL={})),function(e){e.HORIZONTAL="horizontal",e.VERTICAL="vertical"}(zL||(zL={})),function(e){e.INVALID_FORMAT="Invalid file format! Upload valid file.",e.SIZE_LIMIT_EXCEEDED="File exceeds size limit! Upload smaller file.",e.MULTIPLE_NOT_ALLOWED="Please Upload Single File!",e.DUPLICATES_NOT_ALLOWED="Duplicate Files Are Not Allowed!",e.UPLOAD_URL_REQUIRED="Upload URL is required!",e.SERVER_SIDE_ERROR="Error from server! Please try again later.",e.NETWORK_ERROR="Network error! Please try again later.",e.UPLOAD_CANCELLED="File upload cancelled."}(dL||(dL={})),function(e){e.NILE_INIT="nile-init",e.NILE_BROWSE="nile-browse",e.NILE_CHANGE="nile-change",e.NILE_UPLOADING="nile-uploading",e.NILE_UPLOAD_PROGRESS="nile-upload-progress",e.NILE_UPLOAD_SUCCESS="nile-upload-success",e.NILE_UPLOAD_CANCELLED="nile-upload-cancelled",e.NILE_SIZE_EXCEED_FILES="nile-size-exceed-files",e.NILE_CANCEL_UPLOAD="nile-cancel-upload",e.NILE_NETWORK_ERROR="nile-network-error",e.SERVER_SIDE_ERROR="nile-server-error",e.NILE_DESTROY="nile-destroy",e.NILE_ERROR="nile-error"}(hL||(hL={})),function(e){e.TITLE="Drag and drop to upload",e.SUBTITLE="PNG, JPG or SVG (upto 1MB) | 1:1 ratio",e.ERROR_MESSAGE="Invalid File Format.",e.DRAG_STATE_DEFAULT="Drop files here to upload",e.CUSTOM_ERROR="Error Occured!"}(TL||(TL={})),function(e){e.INVALID_FORMAT="Invalid Format",e.SIZE_LIMIT_EXCEEDED="Size Limit Exceeded",e.SERVER_SIDE_ERROR="Server Side Error",e.NETWORK_ERROR="Network Error",e.UPLOAD_CANCELLED="Upload Cancelled"}(yL||(yL={})),function(e){e.SERVER="SERVER",e.NETWORK="NETWORK",e.UPLOAD_CANCELLED="UPLOAD_CANCELLED",e.VALIDATION="VALIDATION"}(AL||(AL={}));const OL=(e,t)=>{t.setIsDisabled((()=>e.state===IL.DISABLED)),t.onStateChange((t=>{e.state=t})),t.onFileDrop((t=>{if(e.state===IL.DISABLED)return;e.errorMessage="";const i=function(e){const t={B:1,KB:1024,MB:1048576,GB:1024**3},i=parseFloat(e),M=e.replace(/[0-9.\s]/g,"").toUpperCase(),n=t[M]||1;return i*n}(e.size),M=e.uploadedFiles;if(!e.allowMultiple&&M.length+t.length>1)return e.errorMessage=dL.MULTIPLE_NOT_ALLOWED,void e.requestUpdate();let n=!1,o=!1;const r=[],s=[];for(const a of t)a.size>i?(n=!0,s.push(a)):e.allowDuplicates||!M.some((e=>e.name===a.name&&e.size===a.size&&e.type===a.type))?s.includes(a)||r.push(a):(o=!0,s.push(a));if(n){e.errorMessage=dL.SIZE_LIMIT_EXCEEDED;const t=s.filter((e=>e.size>i));e.dispatchEvent(new CustomEvent(hL.NILE_ERROR,{detail:{files:t,type:yL.SIZE_LIMIT_EXCEEDED,errorType:AL.VALIDATION,message:dL.SIZE_LIMIT_EXCEEDED},bubbles:!0,composed:!0})),e.dispatchEvent(new CustomEvent(hL.NILE_SIZE_EXCEED_FILES,{detail:{files:s}})),e.requestUpdate()}o&&0===r.length&&(e.errorMessage=dL.DUPLICATES_NOT_ALLOWED,e.requestUpdate());let a=[];for(const t of r)e.allowedTypes.includes(t.type)?a.push(t):e.errorMessage=dL.INVALID_FORMAT;e.uploadedFiles=[...M,...a],e.requestUpdate()})),t.setErrorMessage((t=>{e.errorMessage=t}))},pL=(e,t,i)=>{e.addEventListener("mouseenter",(t=>{return i=e.setState,void(e.state===IL.DEFAULT&&i(IL.HOVER));var i})),e.addEventListener("mouseleave",(t=>{return i=e.setState,void(e.state===IL.HOVER&&i(IL.DEFAULT));var i})),e.addEventListener("dragenter",(e=>t.dragEnter(e))),e.addEventListener("dragleave",(e=>t.dragLeave(e))),e.addEventListener("dragover",(e=>t.dragOver(e))),e.addEventListener("drop",(e=>t.drop(e)));const M=e.browseFiles.bind(e);new ResizeObserver((t=>{for(const i of t)i.contentRect.width<400?e.horizontalDiv.addEventListener("click",M):e.horizontalDiv.removeEventListener("click",M)})).observe(e.horizontalDiv),LL(e,i),mL(e.uploadedFiles,e)};function xL(e){const{uploadedFiles:t,fileUploadUrl:i,uploadRequests:M}=e;if(i&&t?.length)for(const n of t){if(M.has(n))continue;if(e.doNotUpload.includes(n))continue;if(n.errorMessage)continue;const t=new FormData;t.append("file",n);const o=new XMLHttpRequest;M.set(n,o),e.emit(hL.NILE_UPLOADING),o.upload.onprogress=t=>{const i=Math.floor(t.loaded/t.total*100);e.dispatchEvent(new CustomEvent(hL.NILE_UPLOAD_PROGRESS,{detail:{file:n,progress:i},bubbles:!0,composed:!0}))},o.onload=()=>{o.status>=200&&o.status<300?e.dispatchEvent(new CustomEvent(hL.NILE_UPLOAD_SUCCESS,{detail:{file:n,response:o.response},bubbles:!0,composed:!0})):(e.errorMessage=dL.SERVER_SIDE_ERROR,e.dispatchEvent(new CustomEvent(hL.SERVER_SIDE_ERROR,{detail:{file:n,status:o.status,response:o.response}})),e.dispatchEvent(new CustomEvent(hL.NILE_ERROR,{detail:{type:yL.SERVER_SIDE_ERROR,file:n,status:o?.status||0,response:o?.response,message:dL.SERVER_SIDE_ERROR,errorType:AL.SERVER},bubbles:!0,composed:!0})),e.requestUpdate())},o.onerror=()=>{M.delete(n),e.doNotUpload.push(n),e.errorMessage=dL.NETWORK_ERROR,e.dispatchEvent(new CustomEvent(hL.NILE_ERROR,{detail:{type:yL.NETWORK_ERROR,file:n,status:o.status,response:o.response,errorType:AL.NETWORK,message:dL.NETWORK_ERROR},bubbles:!0,composed:!0})),e.dispatchEvent(new CustomEvent(hL.NILE_NETWORK_ERROR,{detail:{file:n,status:o.status,response:o.response},bubbles:!0,composed:!0}))},o.open("POST",i),o.send(t)}}const LL=(e,t)=>{document.addEventListener(hL.NILE_CANCEL_UPLOAD,(i=>{const M=i.detail.file,n=t.get(M);n&&n.abort(),t.delete(M),e.uploadedFiles=e.uploadedFiles.filter((e=>e!==M)),e.dispatchEvent(new CustomEvent(hL.NILE_ERROR,{detail:{type:yL.UPLOAD_CANCELLED,file:M,message:dL.UPLOAD_CANCELLED,errorType:AL.UPLOAD_CANCELLED},bubbles:!0,composed:!0})),e.dispatchEvent(new CustomEvent(hL.NILE_UPLOAD_CANCELLED,{detail:{file:M}}))}))};const SL=e=>{e.preventDefault?.(),e.stopPropagation()},mL=(e,t)=>{document.addEventListener("nile-remove",(i=>{const{value:M}=i.detail;e=e.filter((e=>e!==M)),t.uploadedFiles=e,t.errorMessage="",t.requestUpdate()}))},EL=e=>{("vertical"===e.variant&&e.errorMessage.length>34||"horizontal"===e.variant&&e.errorMessage.length>96)&&(e.isStringTruncated=!0,e.requestUpdate())};class wL{constructor(){this.currentState=IL.DEFAULT}setErrorMessage(e){this.errorMessageCallback=e}setIsDisabled(e){this.isDisabledCallback=e}setValuesInDragHandler(e){this.currentState=e}onFileDrop(e){this.fileDropCallback=e}onStateChange(e){this.stateChangeCallback=e}setState(e){this.currentState===IL.DISABLED||this.isDisabledCallback?.()||(this.currentState=e,this.stateChangeCallback?.(e))}dragEnter(e){SL(e),this.currentState===IL.DISABLED||this.isDisabledCallback?.()||this.setState(IL.DRAG)}dragLeave(e){SL(e),this.currentState===IL.DISABLED||this.isDisabledCallback?.()||this.setState(IL.DEFAULT)}dragOver(e){SL(e),this.currentState!==IL.DISABLED&&this.isDisabledCallback?.()}drop(e){SL(e),this.currentState===IL.DISABLED||this.isDisabledCallback?.()||(this.setState(IL.DEFAULT),this.handleFiles(e))}handleDocumentDrop(e){SL(e),this.currentState!==IL.DISABLED&&this.setState(IL.DEFAULT)}preventDragOver(e){SL(e)}preventDrop(e){SL(e)}handleFiles(e){if(SL(e),this.currentState===IL.DISABLED||this.isDisabledCallback?.())return;let t=null;if("dataTransfer"in e&&e.dataTransfer&&(t=e.dataTransfer.files),!t&&e.target instanceof HTMLInputElement&&(t=e.target.files),t&&t.length>0){const e=Array.from(t);this.fileDropCallback?.(e)}e.target instanceof HTMLInputElement&&(e.target.value="")}}const QL=(e,t,i,M,n,o,r,s,a)=>(EL(a),R`
|
|
13686
13696
|
<div class="wrapper" part="horizontal-wrapper">
|
|
13687
13697
|
<div part="horizontal-div" class=${pe({"hover-border":"hover"===o,"horizontal-div":!0,disable:M})}>
|
|
13688
13698
|
<div part="inner-div" class="inner-div">
|
|
@@ -13690,15 +13700,15 @@ nile-badge::part(content) {
|
|
|
13690
13700
|
<nile-icon name="upload" size="24"></nile-icon>
|
|
13691
13701
|
</slot>
|
|
13692
13702
|
<div part="content" class="content">
|
|
13693
|
-
<div class="title">${t}</div>
|
|
13694
|
-
<div class="subtitle">${i}</div>
|
|
13703
|
+
<div part="horizontal-title" class="title">${t}</div>
|
|
13704
|
+
<div part="horizontal-subtitle" class="subtitle">${i}</div>
|
|
13695
13705
|
</div>
|
|
13696
13706
|
</div>
|
|
13697
13707
|
<input
|
|
13698
13708
|
type="file"
|
|
13699
13709
|
?disabled=${M}
|
|
13700
13710
|
@change=${e=>{n.handleFiles(e)}}
|
|
13701
|
-
multiple
|
|
13711
|
+
?multiple=${a.allowMultiple}
|
|
13702
13712
|
accept=${s.join(",")}
|
|
13703
13713
|
/>
|
|
13704
13714
|
<slot class="browse-file-button" @click=${M?void 0:e} name="browse-file-button">
|
|
@@ -13707,22 +13717,26 @@ nile-badge::part(content) {
|
|
|
13707
13717
|
</nile-button>
|
|
13708
13718
|
</slot>
|
|
13709
13719
|
</div>
|
|
13710
|
-
${r||a.state===IL.ERROR?R
|
|
13711
|
-
|
|
13712
|
-
|
|
13713
|
-
|
|
13714
|
-
|
|
13715
|
-
|
|
13720
|
+
${r||a.state===IL.ERROR?R`
|
|
13721
|
+
<slot name="error-message">
|
|
13722
|
+
<div class="upload-error" part="horizontal-upload-error">
|
|
13723
|
+
<nile-icon name="warning" size="12" color="var(--nile-colors-red-700)"></nile-icon>
|
|
13724
|
+
${a.isStringTruncated?R`<nile-lite-tooltip .content=${r||TL.CUSTOM_ERROR}>
|
|
13725
|
+
<span>${r||TL.CUSTOM_ERROR}</span>
|
|
13726
|
+
</nile-lite-tooltip>`:R`<span>${r||TL.CUSTOM_ERROR}</span>`}
|
|
13727
|
+
</div>
|
|
13728
|
+
</slot>
|
|
13729
|
+
`:R``}
|
|
13716
13730
|
</div>
|
|
13717
|
-
`),
|
|
13731
|
+
`),kL=(e,t,i,M,n,o,r,s)=>QL(e,t,i,!1,M,n,o,r,s),CL=(e,t,i,M,n,o,r,s)=>(EL(s),R`
|
|
13718
13732
|
<div part="vertical-wrapper" class="wrapper">
|
|
13719
13733
|
<div part="vertical-default" class="vertical-default vertical-div ${M?"disable":""}">
|
|
13720
13734
|
<slot name="upload-icon">
|
|
13721
13735
|
<nile-icon name="upload" size="24"></nile-icon>
|
|
13722
13736
|
</slot>
|
|
13723
13737
|
<div part="vertical-content-container" class="content-container">
|
|
13724
|
-
<div class="title">${t}</div>
|
|
13725
|
-
<div class="subtitle">${i}</div>
|
|
13738
|
+
<div part="vertical-title" class="title">${t}</div>
|
|
13739
|
+
<div part="vertical-subtitle" class="subtitle">${i}</div>
|
|
13726
13740
|
</div>
|
|
13727
13741
|
<input
|
|
13728
13742
|
type="file"
|
|
@@ -13737,16 +13751,16 @@ nile-badge::part(content) {
|
|
|
13737
13751
|
</nile-button>
|
|
13738
13752
|
</slot>
|
|
13739
13753
|
</div>
|
|
13740
|
-
${o||s.state===IL.ERROR?R`<div class="vertical-upload-error">
|
|
13754
|
+
${o||s.state===IL.ERROR?R`<div class="vertical-upload-error" part="vertical-upload-error">
|
|
13741
13755
|
<nile-icon name="warning" size="12" color="var(--nile-colors-red-700)"></nile-icon>
|
|
13742
|
-
${s.isStringTruncated?R`<nile-tooltip content=${o||TL.CUSTOM_ERROR}>
|
|
13756
|
+
${s.isStringTruncated?R`<nile-lite-tooltip .content=${o||TL.CUSTOM_ERROR}>
|
|
13743
13757
|
<span>${o||TL.CUSTOM_ERROR}</span>
|
|
13744
|
-
</nile-tooltip>`:R`<span>${o||TL.CUSTOM_ERROR}</span>`}
|
|
13758
|
+
</nile-lite-tooltip>`:R`<span>${o||TL.CUSTOM_ERROR}</span>`}
|
|
13745
13759
|
</div>`:R``}
|
|
13746
13760
|
</div>
|
|
13747
|
-
`),
|
|
13761
|
+
`),bL=(e,t,i,M,n,o,r)=>CL(e,t,i,!1,M,n,o,r);let fL=class extends Re{constructor(){super(...arguments),this.size="10MB",this.error=!1,this.errorMessage="",this.allowMultiple=!1,this.allowDuplicates=!1,this.allowedTypes=[],this.uploadedFiles=[],this.title=TL.TITLE,this.subtitle=TL.SUBTITLE,this.state=IL.DEFAULT,this.variant=zL.HORIZONTAL,this.fileUploadUrl="",this.autoUpload=!0,this.doNotUpload=[],this.uploadRequests=new Map,this.fileSizeExceededFilesNumber=0,this.isStringTruncated=!1,this.setState=e=>{this.state=e}}static get styles(){return[jL]}connectedCallback(){super.connectedCallback(),this.emit(hL.NILE_INIT)}firstUpdated(e){var t;super.firstUpdated(e),this.dragHandler=new wL,OL(this,this.dragHandler),pL(this,this.dragHandler,this.uploadRequests),t=this.dragHandler,document.addEventListener("dragover",t.preventDragOver,{passive:!1}),document.addEventListener("drop",t.preventDrop,{passive:!1})}updated(e){super.updated(e),e.has("uploadedFiles")?(this.fileUploadUrl&&this.autoUpload&&xL(this),this.emit(hL.NILE_CHANGE,{files:this.uploadedFiles})):e.has("state")&&this.dragHandler.setValuesInDragHandler(this.state),e.has("autoUpload")&&this.autoUpload&&(this.fileUploadUrl&&this.autoUpload&&xL(this),this.emit(hL.NILE_CHANGE,{files:this.uploadedFiles}))}browseFiles(){this.emit(hL.NILE_BROWSE),this.errorMessage="",this.input.click()}render(){return R`
|
|
13748
13762
|
${this.getState()}
|
|
13749
|
-
`}getState(){return this.variant===zL.HORIZONTAL?this.getHorizontalState():this.getVerticalState()}getHorizontalState(){switch(this.state){case IL.DEFAULT:return
|
|
13763
|
+
`}clearAllUploadedFiles(){this.uploadedFiles=[],this.state=IL.DEFAULT,this.errorMessage=""}getState(){return this.variant===zL.HORIZONTAL?this.getHorizontalState():this.getVerticalState()}getHorizontalState(){switch(this.state){case IL.DEFAULT:return kL(this.browseFiles,this.title,this.subtitle,this.dragHandler,this.state,this.errorMessage,this.allowedTypes,this);case IL.DISABLED:return e=this.browseFiles,t=this.title,i=this.subtitle,M=this.dragHandler,n=this.state,o=this.errorMessage,r=this.allowedTypes,QL(e,t,i,!0,M,n,o,r,this);case IL.DRAG:return R`
|
|
13750
13764
|
<div part="horizontal-drag-state" class="horizontal-div dragging">
|
|
13751
13765
|
<div class="icons-container">
|
|
13752
13766
|
<nile-icon
|
|
@@ -13764,7 +13778,7 @@ nile-badge::part(content) {
|
|
|
13764
13778
|
</div>
|
|
13765
13779
|
<p>${TL.DRAG_STATE_DEFAULT}</p>
|
|
13766
13780
|
</div>
|
|
13767
|
-
`;case IL.ERROR:return((e,t,i,M,n,o,r,s)=>
|
|
13781
|
+
`;case IL.ERROR:return((e,t,i,M,n,o,r,s)=>QL(e,t,i,!1,M,n,o,r,s))(this.browseFiles,this.title,this.subtitle,this.dragHandler,this.state,this.errorMessage,this.allowedTypes,this);default:return kL(this.browseFiles,this.title,this.subtitle,this.dragHandler,this.state,this.errorMessage,this.allowedTypes,this)}var e,t,i,M,n,o,r}getVerticalState(){switch(this.state){case IL.DEFAULT:return bL(this.browseFiles,this.title,this.subtitle,this.dragHandler,this.errorMessage,this.allowedTypes,this);case IL.DISABLED:return e=this.browseFiles,t=this.title,i=this.subtitle,M=this.dragHandler,n=this.errorMessage,o=this.allowedTypes,CL(e,t,i,!0,M,n,o,this);case IL.DRAG:return R`
|
|
13768
13782
|
<div part="vertical-drag-state" class="vertical-div vertical-drag">
|
|
13769
13783
|
<div class="icons-container">
|
|
13770
13784
|
<nile-icon
|
|
@@ -13782,7 +13796,7 @@ nile-badge::part(content) {
|
|
|
13782
13796
|
</div>
|
|
13783
13797
|
<p>${TL.DRAG_STATE_DEFAULT}</p>
|
|
13784
13798
|
</div>
|
|
13785
|
-
`;case IL.ERROR:return((e,t,i,M,n,o,r)=>
|
|
13799
|
+
`;case IL.ERROR:return((e,t,i,M,n,o,r)=>CL(e,t,i,!1,M,n,o,r))(this.browseFiles,this.title,this.subtitle,this.dragHandler,this.errorMessage,this.allowedTypes,this);default:return bL(this.browseFiles,this.title,this.subtitle,this.dragHandler,this.errorMessage,this.allowedTypes,this)}var e,t,i,M,n,o}disconnectedCallback(){this.emit(hL.NILE_DESTROY)}};e([ce({type:String})],fL.prototype,"size",void 0),e([ce({type:Boolean})],fL.prototype,"error",void 0),e([ce({type:String})],fL.prototype,"errorMessage",void 0),e([ce({type:Boolean})],fL.prototype,"allowMultiple",void 0),e([ce({type:Boolean})],fL.prototype,"allowDuplicates",void 0),e([ce({type:Array})],fL.prototype,"allowedTypes",void 0),e([ce({type:Array})],fL.prototype,"uploadedFiles",void 0),e([ce({type:String})],fL.prototype,"title",void 0),e([ce({type:String})],fL.prototype,"subtitle",void 0),e([ce({type:String})],fL.prototype,"state",void 0),e([ce({type:String})],fL.prototype,"variant",void 0),e([ce({type:String})],fL.prototype,"fileUploadUrl",void 0),e([ce({type:Boolean})],fL.prototype,"autoUpload",void 0),e([De()],fL.prototype,"doNotUpload",void 0),e([Ie("input")],fL.prototype,"input",void 0),e([Ie(".horizontal-div")],fL.prototype,"horizontalDiv",void 0),fL=e([Ne("nile-file-upload")],fL);const vL=r`
|
|
13786
13800
|
:host {
|
|
13787
13801
|
display: inline-block;
|
|
13788
13802
|
width: 100%;
|
|
@@ -13887,7 +13901,7 @@ nile-badge::part(content) {
|
|
|
13887
13901
|
|
|
13888
13902
|
.uploading {
|
|
13889
13903
|
height: 62px;
|
|
13890
|
-
width:
|
|
13904
|
+
width: 100%;
|
|
13891
13905
|
padding: 12px;
|
|
13892
13906
|
min-width: 230px;
|
|
13893
13907
|
display: flex;
|
|
@@ -13941,7 +13955,7 @@ nile-badge::part(content) {
|
|
|
13941
13955
|
white-space: nowrap;
|
|
13942
13956
|
overflow: hidden;
|
|
13943
13957
|
text-overflow: ellipsis;
|
|
13944
|
-
width:
|
|
13958
|
+
width: 100%;
|
|
13945
13959
|
}
|
|
13946
13960
|
|
|
13947
13961
|
.progress-bar-container .vertical-file-name {
|
|
@@ -14360,68 +14374,25 @@ nile-badge::part(content) {
|
|
|
14360
14374
|
.preview-file-info p {
|
|
14361
14375
|
width: 100%;
|
|
14362
14376
|
}
|
|
14363
|
-
`;var
|
|
14364
|
-
<div class="uploading" part="horizontal-uploading-state">
|
|
14365
|
-
<nile-loader width="24" height="24"></nile-loader>
|
|
14366
|
-
<div class="progress-bar-container" part="horizontal-progress-bar-container">
|
|
14367
|
-
<div class="progress-bar-percent" part="horizontal-progress-bar-percent">
|
|
14368
|
-
<p part="horizontal-progress-bar-percent-text">Uploading File...</p>
|
|
14369
|
-
<p part="horizontal-progress-bar-percent-value">${t}%</p>
|
|
14370
|
-
</div>
|
|
14371
|
-
<nile-progress-bar
|
|
14372
|
-
part="horizontal-progress-bar"
|
|
14373
|
-
value="${t}"
|
|
14374
|
-
></nile-progress-bar>
|
|
14375
|
-
<p class="horizontal-file-name" part="horizontal-file-name">${e.name}</p>
|
|
14376
|
-
</div>
|
|
14377
|
-
<slot @click=${t=>VL(e,t)} name="cancelIcon">
|
|
14378
|
-
<nile-icon
|
|
14379
|
-
name="close"
|
|
14380
|
-
size="14"
|
|
14381
|
-
class="icon"
|
|
14382
|
-
></nile-icon>
|
|
14383
|
-
</slot>
|
|
14384
|
-
</div>
|
|
14385
|
-
`}function GL(e,t,i){return R`
|
|
14386
|
-
<div class="preview horizontal-div" part="horizontal-preview-state">
|
|
14387
|
-
<div class="preview-inner" part="horizontal-preview-inner">
|
|
14388
|
-
<div class="preview-image-container" part="horizontal-preview-image-container">
|
|
14389
|
-
<img
|
|
14390
|
-
class="image-preview"
|
|
14391
|
-
src=${e}
|
|
14392
|
-
alt=${t.name}
|
|
14393
|
-
part="horizontal-preview-image"
|
|
14394
|
-
/>
|
|
14395
|
-
</div>
|
|
14396
|
-
<div class="preview-file-info" part="horizontal-preview-file-info">
|
|
14397
|
-
<p part="horizontal-preview-file-info-name">${t.name}</p>
|
|
14398
|
-
<p part="horizontal-preview-file-info-type">${PL(t.type)} • ${WL(Number(t.size))}</p>
|
|
14399
|
-
</div>
|
|
14400
|
-
</div>
|
|
14401
|
-
<div class="preview-actions" part="horizontal-preview-actions">
|
|
14402
|
-
<slot @click=${e=>ZL(t,e,i)} name="cancel-icon">
|
|
14403
|
-
<nile-icon
|
|
14404
|
-
name="trash"
|
|
14405
|
-
size="14"
|
|
14406
|
-
class="icon"
|
|
14407
|
-
part="horizontal-preview-actions-icon"
|
|
14408
|
-
></nile-icon>
|
|
14409
|
-
</slot>
|
|
14410
|
-
</div>
|
|
14411
|
-
</div>
|
|
14412
|
-
`}function _L(e,t){return R`
|
|
14377
|
+
`;var UL,YL,ZL,VL;!function(e){e.DEFAULT="default",e.UPLOADING="uploading",e.PREVIEW="preview",e.NO_PREVIEW="no-preview",e.ERROR="error"}(UL||(UL={})),function(e){e.HORIZONTAL="horizontal",e.VERTICAL="vertical"}(YL||(YL={})),function(e){e.INVALID_FORMAT="Invalid File Format. Please try again.",e.SIZE_LIMIT="File exceeds size limit.",e.FAILED_TO_LOAD="Failed to load file from URL",e.UNKNOWN_FILE_NAME="unknown-file",e.UPLOAD_CANCEL="File upload cancelled.",e.NO_FILE_SELECTED="No file selected.",e.UNABLE_TO_GENEARTE_URL="Unable to generate the url.",e.NETWORK_ERROR="Network error! Please try again later.",e.CUSTOM_ERROR="Error Occured!"}(ZL||(ZL={})),function(e){e.NILE_INIT="nile-init",e.NILE_RECEIVE="nile-receive",e.NILE_REMOVE="nile-remove",e.NILE_CANCEL_UPLOAD="nile-cancel-upload",e.NILE_DESTROY="nile-destroy"}(VL||(VL={}));const WL=(e,t,i)=>{t.target&&t.target.dispatchEvent(new CustomEvent(VL.NILE_REMOVE,{detail:{value:e,url:i},bubbles:!0,composed:!0}))},PL=(e,t,i)=>{t.target&&(t.target.dispatchEvent(new CustomEvent(VL.NILE_CANCEL_UPLOAD,{detail:{file:e},bubbles:!0,composed:!0})),i.state=UL.ERROR,i.errorMessage=ZL.UPLOAD_CANCEL,i.requestUpdate())},RL=e=>{const t=e/1e3,i=e/1e6,M=e/1e9;return M>=1?M.toFixed(2)+" GB":i>=1?i.toFixed(2)+" MB":t>=1?t.toFixed(2)+" KB":e+" B"},BL=(e,t)=>{if(t)return e.name.split(".").pop()||"";return((e.type||"").split("/")[1]||"").toUpperCase()},GL=e=>{("vertical"===e.variant&&e.errorMessage.length>34||"horizontal"===e.variant&&e.errorMessage.length>96)&&(e.isStringTruncated=!0,e.requestUpdate())};function _L(e,t,i){return R`
|
|
14413
14378
|
<div class="no-preview horizontal-div" part="horizontal-no-preview-state">
|
|
14414
14379
|
<div class="no-preview-container" part="horizontal-no-preview-container">
|
|
14415
14380
|
<div class="document-icon" part="horizontal-no-preview-document-icon">
|
|
14416
14381
|
<nile-icon name="general" size="20" color="var(--nile-colors-blue-500)"></nile-icon>
|
|
14417
14382
|
</div>
|
|
14418
14383
|
<div class="preview-file-info" part="horizontal-no-preview-file-info">
|
|
14419
|
-
<p part="horizontal-no-preview-file-info-name"
|
|
14420
|
-
|
|
14384
|
+
<p part="horizontal-no-preview-file-info-name">
|
|
14385
|
+
<slot name="file-name">${e.name}</slot>
|
|
14386
|
+
</p>
|
|
14387
|
+
<p part="horizontal-no-preview-file-info-type">
|
|
14388
|
+
<slot name="file-type">${BL(e,i)}</slot>
|
|
14389
|
+
•
|
|
14390
|
+
<slot name="file-size">${RL(Number(e.size))}</slot>
|
|
14391
|
+
</p>
|
|
14421
14392
|
</div>
|
|
14422
14393
|
</div>
|
|
14423
14394
|
<div>
|
|
14424
|
-
<slot @click=${i=>
|
|
14395
|
+
<slot @click=${i=>WL(e,i,t)} name="cancelIcon">
|
|
14425
14396
|
<nile-icon
|
|
14426
14397
|
name="trash"
|
|
14427
14398
|
size="14"
|
|
@@ -14431,20 +14402,24 @@ nile-badge::part(content) {
|
|
|
14431
14402
|
</slot>
|
|
14432
14403
|
</div>
|
|
14433
14404
|
</div>
|
|
14434
|
-
`}function FL(e,t,i,M){return
|
|
14405
|
+
`}function FL(e,t,i,M){return GL(M),R`
|
|
14435
14406
|
<div class="error horizontal-div" part="horizontal-error-state">
|
|
14436
14407
|
<div class="error-container" part="horizontal-error-container">
|
|
14437
14408
|
<div class="error-icon" part="horizontal-error-icon">
|
|
14438
14409
|
<nile-icon name="info-icon" size="20" color="var(--nile-colors-red-700)"></nile-icon>
|
|
14439
14410
|
</div>
|
|
14440
14411
|
<div class="file-info" part="horizontal-error-file-info">
|
|
14441
|
-
<p class="horizontal-file-name" part="horizontal-error-file-info-name"
|
|
14442
|
-
|
|
14412
|
+
<p class="horizontal-file-name" part="horizontal-error-file-info-name">
|
|
14413
|
+
<slot name="file-name">
|
|
14414
|
+
${e.name}
|
|
14415
|
+
</slot>
|
|
14416
|
+
</p>
|
|
14417
|
+
${M.isStringTruncated?R`<nile-lite-tooltip .content=${t}>
|
|
14443
14418
|
<span>${t}</span>
|
|
14444
|
-
</nile-tooltip>`:R`<span>${t}</span>`}
|
|
14419
|
+
</nile-lite-tooltip>`:R`<span>${t}</span>`}
|
|
14445
14420
|
</div>
|
|
14446
14421
|
</div>
|
|
14447
|
-
<slot @click=${t=>
|
|
14422
|
+
<slot @click=${t=>WL(e,t,i)} name="cancelIcon">
|
|
14448
14423
|
<nile-icon
|
|
14449
14424
|
name="close"
|
|
14450
14425
|
size="14"
|
|
@@ -14453,7 +14428,79 @@ nile-badge::part(content) {
|
|
|
14453
14428
|
></nile-icon>
|
|
14454
14429
|
</slot>
|
|
14455
14430
|
</div>
|
|
14456
|
-
`}function HL(e,t){return R`
|
|
14431
|
+
`}function HL(e,t,i){return R`
|
|
14432
|
+
<div class="vertical-div vertical-no-preview" part="vertical-no-preview-state">
|
|
14433
|
+
<div class="vertical-document-icon" part="vertical-no-preview-document-icon">
|
|
14434
|
+
<nile-icon name="general" size="20" color="var(--nile-colors-blue-500)"></nile-icon>
|
|
14435
|
+
</div>
|
|
14436
|
+
|
|
14437
|
+
<div class="content-container" part="vertical-no-preview-file-info">
|
|
14438
|
+
<p part="vertical-no-preview-file-info-name">
|
|
14439
|
+
<slot name="file-name">${e.name}</slot>
|
|
14440
|
+
</p>
|
|
14441
|
+
<p part="vertical-no-preview-file-info-type">
|
|
14442
|
+
<slot name="file-type">${BL(e,i)}</slot>
|
|
14443
|
+
•
|
|
14444
|
+
<slot name="file-size">${RL(Number(e.size))}</slot>
|
|
14445
|
+
</p>
|
|
14446
|
+
</div>
|
|
14447
|
+
|
|
14448
|
+
<slot @click=${i=>WL(e,i,t)} name="cancelIcon">
|
|
14449
|
+
<nile-icon
|
|
14450
|
+
name="trash"
|
|
14451
|
+
size="14"
|
|
14452
|
+
class="icon corner-icon"
|
|
14453
|
+
part="vertical-no-preview-actions-icon"
|
|
14454
|
+
></nile-icon>
|
|
14455
|
+
</slot>
|
|
14456
|
+
</div>
|
|
14457
|
+
`}function JL(e,t,i,M){return GL(M),R`
|
|
14458
|
+
<div class="vertical-div vertical-error" part="vertical-error-state">
|
|
14459
|
+
<div class="vertical-document-icon error-bg" part="vertical-error-document-icon">
|
|
14460
|
+
<nile-icon name="info-icon" size="20" color="var(--nile-colors-red-700)"></nile-icon>
|
|
14461
|
+
</div>
|
|
14462
|
+
|
|
14463
|
+
<div class="file-info-vertical-state" part="vertical-error-file-info">
|
|
14464
|
+
<p class="vertical-file-name" part="vertical-error-file-info-name">
|
|
14465
|
+
<slot name="file-name">${e.name}</slot>
|
|
14466
|
+
</p>
|
|
14467
|
+
${M.isStringTruncated?R`<nile-lite-tooltip .content=${t}>
|
|
14468
|
+
<span>${t}</span>
|
|
14469
|
+
</nile-lite-tooltip>`:R`<span>${t}</span>`}
|
|
14470
|
+
</div>
|
|
14471
|
+
|
|
14472
|
+
<slot @click=${t=>WL(e,t,i)} name="cancelIcon">
|
|
14473
|
+
<nile-icon
|
|
14474
|
+
name="close"
|
|
14475
|
+
size="14"
|
|
14476
|
+
class="icon corner-icon"
|
|
14477
|
+
part="vertical-error-actions-icon"
|
|
14478
|
+
></nile-icon>
|
|
14479
|
+
</slot>
|
|
14480
|
+
</div>
|
|
14481
|
+
`}let $L=class extends Re{constructor(){super(...arguments),this.errorMessage="",this.fileUrl="",this.uploadStatus=0,this.state=UL.DEFAULT,this.variant=YL.HORIZONTAL,this.inputFileName="",this.showFileType=!1,this.inputFileHtml=null,this.originalUrl="",this.isStringTruncated=!1}static get styles(){return[vL]}connectedCallback(){super.connectedCallback(),this.emit(VL.NILE_INIT)}firstUpdated(e){super.firstUpdated(e)}updated(e){e.has("uploadStatus")&&this.uploadStatus?this.uploadStatus<100?this.createUploadState(this.inputFile,this.uploadStatus):this.createState(this.inputFile):e.has("inputFile")&&this.inputFile?(this.createState(this.inputFile),this.emit(VL.NILE_RECEIVE)):e.has("fileUrl")&&this.fileUrl?(this.handleFileUrl(this.fileUrl),this.emit(VL.NILE_RECEIVE)):e.has("errorMessage")&&this.createState(this.inputFile)}createUploadState(e,t){const i=this.variant===YL.HORIZONTAL;this.inputFileHtml=i?function(e,t,i){return R`
|
|
14482
|
+
<div class="uploading" part="horizontal-uploading-state">
|
|
14483
|
+
<nile-loader width="24" height="24"></nile-loader>
|
|
14484
|
+
<div class="progress-bar-container" part="horizontal-progress-bar-container">
|
|
14485
|
+
<div class="progress-bar-percent" part="horizontal-progress-bar-percent">
|
|
14486
|
+
<p part="horizontal-progress-bar-percent-text">Uploading File...</p>
|
|
14487
|
+
<p part="horizontal-progress-bar-percent-value">${t}%</p>
|
|
14488
|
+
</div>
|
|
14489
|
+
<nile-progress-bar
|
|
14490
|
+
part="horizontal-progress-bar"
|
|
14491
|
+
.value="${t}"
|
|
14492
|
+
></nile-progress-bar>
|
|
14493
|
+
<p class="horizontal-file-name" part="horizontal-file-name">${e.name}</p>
|
|
14494
|
+
</div>
|
|
14495
|
+
<slot @click=${t=>PL(e,t,i)} name="cancelIcon">
|
|
14496
|
+
<nile-icon
|
|
14497
|
+
name="close"
|
|
14498
|
+
size="14"
|
|
14499
|
+
class="icon"
|
|
14500
|
+
></nile-icon>
|
|
14501
|
+
</slot>
|
|
14502
|
+
</div>
|
|
14503
|
+
`}(e,t,this):function(e,t,i){return R`
|
|
14457
14504
|
<div class="vertical-div vertical-uploading" part="vertical-uploading-state">
|
|
14458
14505
|
<div class="loading" part="vertical-loading">
|
|
14459
14506
|
<nile-loader width="24" height="24"></nile-loader>
|
|
@@ -14468,7 +14515,7 @@ nile-badge::part(content) {
|
|
|
14468
14515
|
<p class="vertical-file-name" part="vertical-file-name">${e.name}</p>
|
|
14469
14516
|
</div>
|
|
14470
14517
|
|
|
14471
|
-
<slot @click=${t=>
|
|
14518
|
+
<slot @click=${t=>PL(e,t,i)} name="cancelIcon">
|
|
14472
14519
|
<nile-icon
|
|
14473
14520
|
name="close"
|
|
14474
14521
|
size="14"
|
|
@@ -14477,7 +14524,40 @@ nile-badge::part(content) {
|
|
|
14477
14524
|
></nile-icon>
|
|
14478
14525
|
</slot>
|
|
14479
14526
|
</div>
|
|
14480
|
-
`}
|
|
14527
|
+
`}(e,t,this),this.requestUpdate()}async handleFileUrl(e){this.originalUrl=e;try{const t=await fetch(e),i=await t.blob(),M=this.inputFileName||e.split("/").pop()||ZL.UNKNOWN_FILE_NAME,n=new File([i],M,{type:i.type});this.createState(n)}catch(e){const t=new File([],this.inputFileName||ZL.UNKNOWN_FILE_NAME,{type:"application/octet-stream"});this.errorMessage=ZL.FAILED_TO_LOAD,console.error(this.errorMessage),this.inputFileHtml=this.variant===YL.HORIZONTAL?FL(t,this.errorMessage,this.originalUrl,this):JL(t,this.errorMessage,this.originalUrl,this),this.requestUpdate()}}async createState(e){const t=this.variant===YL.HORIZONTAL;if(this.errorMessage)this.inputFileHtml=t?FL(e,this.errorMessage,this.originalUrl,this):JL(e,this.errorMessage,this.originalUrl,this);else{let i=!1;try{i=e&&await(e=>new Promise((t=>{const i=new Blob([e],{type:e.type}),M=URL.createObjectURL(i),n=new Image;n.onload=()=>{URL.revokeObjectURL(M),t(!0)},n.onerror=()=>{URL.revokeObjectURL(M),t(!1)},n.src=M})))(e)}catch(e){i=!1}if(i)try{const i=await(e=>new Promise(((t,i)=>{const M=new FileReader;e?M.readAsDataURL(e):i(ZL.NO_FILE_SELECTED),M.onload=()=>{const e=M.result;t(e)},M.onerror=e=>{i(ZL.UNABLE_TO_GENEARTE_URL)}})))(e);this.inputFileHtml=t?function(e,t,i,M){return R`
|
|
14528
|
+
<div class="preview horizontal-div" part="horizontal-preview-state">
|
|
14529
|
+
<div class="preview-inner" part="horizontal-preview-inner">
|
|
14530
|
+
<div class="preview-image-container" part="horizontal-preview-image-container">
|
|
14531
|
+
<img
|
|
14532
|
+
class="image-preview"
|
|
14533
|
+
src=${e}
|
|
14534
|
+
alt=${t.name}
|
|
14535
|
+
part="horizontal-preview-image"
|
|
14536
|
+
/>
|
|
14537
|
+
</div>
|
|
14538
|
+
<div class="preview-file-info" part="horizontal-preview-file-info">
|
|
14539
|
+
<p part="horizontal-preview-file-info-name">
|
|
14540
|
+
<slot name="file-name">${t.name}</slot>
|
|
14541
|
+
</p>
|
|
14542
|
+
<p part="horizontal-preview-file-info-type">
|
|
14543
|
+
<slot name="file-type">${BL(t,M)}</slot>
|
|
14544
|
+
•
|
|
14545
|
+
<slot name="file-size">${RL(Number(t.size))}</slot>
|
|
14546
|
+
</p>
|
|
14547
|
+
</div>
|
|
14548
|
+
</div>
|
|
14549
|
+
<div class="preview-actions" part="horizontal-preview-actions">
|
|
14550
|
+
<slot @click=${e=>WL(t,e,i)} name="cancel-icon">
|
|
14551
|
+
<nile-icon
|
|
14552
|
+
name="trash"
|
|
14553
|
+
size="14"
|
|
14554
|
+
class="icon"
|
|
14555
|
+
part="horizontal-preview-actions-icon"
|
|
14556
|
+
></nile-icon>
|
|
14557
|
+
</slot>
|
|
14558
|
+
</div>
|
|
14559
|
+
</div>
|
|
14560
|
+
`}(i,e,this.originalUrl,this.showFileType):function(e,t,i,M){return R`
|
|
14481
14561
|
<div class="vertical-div vertical-preview" part="vertical-preview-state">
|
|
14482
14562
|
<div part="vertical-preview-image-container">
|
|
14483
14563
|
<img
|
|
@@ -14489,11 +14569,17 @@ nile-badge::part(content) {
|
|
|
14489
14569
|
</div>
|
|
14490
14570
|
|
|
14491
14571
|
<div class="content-container" part="vertical-preview-file-info">
|
|
14492
|
-
<p part="vertical-preview-file-info-name"
|
|
14493
|
-
|
|
14572
|
+
<p part="vertical-preview-file-info-name">
|
|
14573
|
+
<slot name="file-name">${t.name}</slot>
|
|
14574
|
+
</p>
|
|
14575
|
+
<p part="vertical-preview-file-info-type">
|
|
14576
|
+
<slot name="file-type">${BL(t,M)}</slot>
|
|
14577
|
+
•
|
|
14578
|
+
<slot name="file-size">${RL(Number(t.size))}</slot>
|
|
14579
|
+
</p>
|
|
14494
14580
|
</div>
|
|
14495
14581
|
|
|
14496
|
-
<slot @click=${e=>
|
|
14582
|
+
<slot @click=${e=>WL(t,e,i)} name="cancelIcon">
|
|
14497
14583
|
<nile-icon
|
|
14498
14584
|
name="trash"
|
|
14499
14585
|
size="14"
|
|
@@ -14502,49 +14588,7 @@ nile-badge::part(content) {
|
|
|
14502
14588
|
></nile-icon>
|
|
14503
14589
|
</slot>
|
|
14504
14590
|
</div>
|
|
14505
|
-
`}
|
|
14506
|
-
<div class="vertical-div vertical-no-preview" part="vertical-no-preview-state">
|
|
14507
|
-
<div class="vertical-document-icon" part="vertical-no-preview-document-icon">
|
|
14508
|
-
<nile-icon name="general" size="20" color="var(--nile-colors-blue-500)"></nile-icon>
|
|
14509
|
-
</div>
|
|
14510
|
-
|
|
14511
|
-
<div class="content-container" part="vertical-no-preview-file-info">
|
|
14512
|
-
<p part="vertical-no-preview-file-info-name">${e.name}</p>
|
|
14513
|
-
<p part="vertical-no-preview-file-info-type">${PL(e.type)} • ${WL(Number(e.size))}</p>
|
|
14514
|
-
</div>
|
|
14515
|
-
|
|
14516
|
-
<slot @click=${i=>ZL(e,i,t)} name="cancelIcon">
|
|
14517
|
-
<nile-icon
|
|
14518
|
-
name="trash"
|
|
14519
|
-
size="14"
|
|
14520
|
-
class="icon corner-icon"
|
|
14521
|
-
part="vertical-no-preview-actions-icon"
|
|
14522
|
-
></nile-icon>
|
|
14523
|
-
</slot>
|
|
14524
|
-
</div>
|
|
14525
|
-
`}function XL(e,t,i,M){return RL(M),R`
|
|
14526
|
-
<div class="vertical-div vertical-error" part="vertical-error-state">
|
|
14527
|
-
<div class="vertical-document-icon error-bg" part="vertical-error-document-icon">
|
|
14528
|
-
<nile-icon name="info-icon" size="20" color="var(--nile-colors-red-700)"></nile-icon>
|
|
14529
|
-
</div>
|
|
14530
|
-
|
|
14531
|
-
<div class="file-info-vertical-state" part="vertical-error-file-info">
|
|
14532
|
-
<p class="vertical-file-name" part="vertical-error-file-info-name">${e.name}</p>
|
|
14533
|
-
${M.isStringTruncated?R`<nile-tooltip content=${t}>
|
|
14534
|
-
<span>${t}</span>
|
|
14535
|
-
</nile-tooltip>`:R`<span>${t}</span>`}
|
|
14536
|
-
</div>
|
|
14537
|
-
|
|
14538
|
-
<slot @click=${t=>ZL(e,t,i)} name="cancelIcon">
|
|
14539
|
-
<nile-icon
|
|
14540
|
-
name="close"
|
|
14541
|
-
size="14"
|
|
14542
|
-
class="icon corner-icon"
|
|
14543
|
-
part="vertical-error-actions-icon"
|
|
14544
|
-
></nile-icon>
|
|
14545
|
-
</slot>
|
|
14546
|
-
</div>
|
|
14547
|
-
`}let qL=class extends Re{constructor(){super(...arguments),this.errorMessage="",this.fileUrl="",this.uploadStatus=0,this.state=fL.DEFAULT,this.variant=vL.HORIZONTAL,this.inputFileName="",this.inputFileHtml=null,this.originalUrl="",this.isStringTruncated=!1,this.customFile=new File([],"Harsh",{type:"image/png"})}static get styles(){return[bL]}connectedCallback(){super.connectedCallback(),this.emit(YL.NILE_INIT)}firstUpdated(e){super.firstUpdated(e)}updated(e){e.has("uploadStatus")&&this.uploadStatus?this.uploadStatus<100?this.createUploadState(this.inputFile,this.uploadStatus):this.createState(this.inputFile):e.has("inputFile")&&this.inputFile?(this.createState(this.inputFile),this.emit(YL.NILE_RECEIVE)):e.has("fileUrl")&&this.fileUrl?(this.handleFileUrl(this.fileUrl),this.emit(YL.NILE_RECEIVE)):e.has("errorMessage")&&this.createState(this.inputFile)}createUploadState(e,t){const i=this.variant===vL.HORIZONTAL;this.inputFileHtml=i?BL(e,t):HL(e,t),this.requestUpdate()}async handleFileUrl(e){this.originalUrl=e;try{const t=await fetch(e),i=await t.blob(),M=this.inputFileName||e.split("/").pop()||UL.UNKNOWN_FILE_NAME,n=new File([i],M,{type:i.type});this.createState(n)}catch(e){const t=new File([],this.inputFileName||UL.UNKNOWN_FILE_NAME,{type:"application/octet-stream"});this.errorMessage=UL.FAILED_TO_LOAD,console.error(this.errorMessage),this.inputFileHtml=this.variant===vL.HORIZONTAL?FL(t,this.errorMessage,this.originalUrl,this):XL(t,this.errorMessage,this.originalUrl,this),this.requestUpdate()}}async createState(e){const t=this.variant===vL.HORIZONTAL;if(this.errorMessage)this.inputFileHtml=t?FL(e,this.errorMessage,this.originalUrl,this):XL(e,this.errorMessage,this.originalUrl,this);else if(e&&e.type.startsWith("image/"))try{const i=await(e=>new Promise(((t,i)=>{const M=new FileReader;e?M.readAsDataURL(e):i(UL.NO_FILE_SELECTED),M.onload=()=>{const e=M.result;t(e)},M.onerror=e=>{i(UL.UNABLE_TO_GENEARTE_URL)}})))(e);this.inputFileHtml=t?GL(i,e,this.originalUrl):JL(i,e,this.originalUrl)}catch(i){this.inputFileHtml=t?_L(e,this.originalUrl):$L(e,this.originalUrl)}else this.inputFileHtml=t?_L(e,this.originalUrl):$L(e,this.originalUrl);this.requestUpdate()}getState(){return"horizontal"===this.variant?this.getHorizontalStates():this.getVerticalStates()}getHorizontalStates(){switch(this.state){case fL.UPLOADING:return BL(this.customFile,2);case fL.PREVIEW:return GL("https://s6.imgcdn.dev/YINe6a.jpg",this.customFile,this.originalUrl);case fL.NO_PREVIEW:return _L(this.customFile,this.originalUrl);case fL.ERROR:return FL(this.customFile,UL.CUSTOM_ERROR,this.originalUrl,this);default:return this.inputFileHtml||R``}}getVerticalStates(){switch(this.state){case fL.UPLOADING:return HL(this.customFile,2);case fL.PREVIEW:return JL("https://s6.imgcdn.dev/YINe6a.jpg",this.customFile,this.originalUrl);case fL.NO_PREVIEW:return $L(this.customFile,this.originalUrl);case fL.ERROR:return XL(this.customFile,UL.CUSTOM_ERROR,this.originalUrl,this);default:return this.inputFileHtml||R``}}render(){return this.state?this.getState():R`${this.inputFileHtml??R``}`}disconnectedCallback(){super.disconnectedCallback(),this.emit(YL.NILE_DESTROY)}};e([ce({type:String})],qL.prototype,"errorMessage",void 0),e([ce({type:Object})],qL.prototype,"inputFile",void 0),e([ce({type:String})],qL.prototype,"fileUrl",void 0),e([ce({type:Number})],qL.prototype,"uploadStatus",void 0),e([ce({type:String})],qL.prototype,"state",void 0),e([ce({type:String})],qL.prototype,"variant",void 0),e([ce({type:String})],qL.prototype,"inputFileName",void 0),qL=e([Ne("nile-file-preview")],qL);const KL=r`
|
|
14591
|
+
`}(i,e,this.originalUrl,this.showFileType)}catch(i){this.inputFileHtml=t?_L(e,this.originalUrl,this.showFileType):HL(e,this.originalUrl,this.showFileType)}else this.inputFileHtml=t?_L(e,this.originalUrl,this.showFileType):HL(e,this.originalUrl,this.showFileType)}this.requestUpdate()}render(){return R`${this.inputFileHtml??R``}`}disconnectedCallback(){super.disconnectedCallback(),this.emit(VL.NILE_DESTROY)}};e([ce({type:String})],$L.prototype,"errorMessage",void 0),e([ce({type:Object})],$L.prototype,"inputFile",void 0),e([ce({type:String})],$L.prototype,"fileUrl",void 0),e([ce({type:Number})],$L.prototype,"uploadStatus",void 0),e([ce({type:String})],$L.prototype,"state",void 0),e([ce({type:String})],$L.prototype,"variant",void 0),e([ce({type:String})],$L.prototype,"inputFileName",void 0),e([ce({type:Boolean,reflect:!0,attribute:!0})],$L.prototype,"showFileType",void 0),$L=e([Ne("nile-file-preview")],$L);const XL=r`
|
|
14548
14592
|
.option-group-header {
|
|
14549
14593
|
height: 40px;
|
|
14550
14594
|
display: flex;
|
|
@@ -14603,7 +14647,7 @@ nile-badge::part(content) {
|
|
|
14603
14647
|
top: 46px;
|
|
14604
14648
|
}
|
|
14605
14649
|
|
|
14606
|
-
`;let
|
|
14650
|
+
`;let qL=class extends Re{constructor(){super(...arguments),this.name="",this.data=null,this.sticky=!1}static get styles(){return[XL]}checkForImageOrIcon(){return this.data?.prefix?.icon?.name||this.data?.prefix?.image?.src||this.data?.prefix?.prefixText}normalizeImageDimension(e){if(null==e||""===e)return"20";const t=Number(e);return isNaN(t)||t<=0?"20":t>40?"25":t.toString()}render(){return R`
|
|
14607
14651
|
<div part="option-group-header" class="option-group-header">
|
|
14608
14652
|
<div part="content-container" class="content-container ${this.checkForImageOrIcon()?"gap-18px":""}">
|
|
14609
14653
|
<!-- prefix content -->
|
|
@@ -14616,7 +14660,7 @@ nile-badge::part(content) {
|
|
|
14616
14660
|
<!-- suffix content -->
|
|
14617
14661
|
${this.data?.suffix?.icon?.name?R`<nile-icon part="suffix-icon" name="${this.data?.suffix?.icon?.name}" size="${this.data?.suffix?.icon?.size||"16"}" color="${this.data?.suffix?.icon?.color||"var(--nile-colors-dark-500)"}" method="${this.data?.suffix?.icon?.method||"fill"}"></nile-icon>`:this.data?.suffix?.suffixText?R`<span part="suffix-text">${this.data?.suffix?.suffixText}</span>`:this.data?.suffix?.image?.src?R`<img part="suffix-image" src="${this.data?.prefix?.image?.src}" width="${this.normalizeImageDimension(this.data?.suffix?.image?.width)}" height="${this.normalizeImageDimension(this.data?.suffix?.image?.height)}">`:R`<slot part="suffix" name="suffix" class="option-group-suffix"></slot>`}
|
|
14618
14662
|
</div>
|
|
14619
|
-
`}};e([ce({type:String,reflect:!0,attribute:!0})],
|
|
14663
|
+
`}};e([ce({type:String,reflect:!0,attribute:!0})],qL.prototype,"name",void 0),e([ce({type:Object,reflect:!0,attribute:!0})],qL.prototype,"data",void 0),e([ce({type:Boolean,reflect:!0,attribute:!0})],qL.prototype,"sticky",void 0),qL=e([Ne("nile-option-group")],qL);const KL=r`
|
|
14620
14664
|
:host {
|
|
14621
14665
|
--min-width: 180px;
|
|
14622
14666
|
display: grid;
|
|
@@ -14651,7 +14695,7 @@ nile-badge::part(content) {
|
|
|
14651
14695
|
display: none;
|
|
14652
14696
|
bottom: 0;
|
|
14653
14697
|
}
|
|
14654
|
-
`;function iS(e,t,i,M,n,o){const r=e.minColumnWidth,s=function(e){return Math.max(0,(e.getBoundingClientRect().width||0)-4)}(e),a=function(e,t,i,M,n,o,r){const s=Array(t).fill(null);if(o){const M=NS(e);M&&function(e,t,i,M,n){const o=[...e.children].filter((e=>"nile-grid-row"===e.tagName.toLowerCase()));for(const e of o)MS(e,t,i,M,n)}(M,s,t,i,n)}r?.length&&r.some((e=>e>0))&&r?.length===t&&function(e,t,i){for(let M=0;M<t.length;M++)null==e[M]&&Number.isFinite(t[M])&&(e[M]=Math.max(i.minColumnWidth,Math.round(t[M])))}(s,r,M);return s}(M,t,s,e,n,o,i),l=function(e,t,i){const M=Array(e.length).fill(!1);for(let n=0;n<e.length;n++){const o=e[n]??null;t[n]=null==o||Number.isNaN(o)?0:Math.max(i,Number(o)),M[n]=null!=o&&!Number.isNaN(o)}return M}(a,i,r);!function(e,t,i,M){const n=e.reduce(((e,t)=>e+t),0),o=i-n,r=Array.from({length:e.length},((e,t)=>t)).filter((e=>!t[e]));if(0===r.length)return;const s=o/r.length;for(const t of r)e[t]=Math.max(M,s)}(i,l,s,r),e.enableScroll||function(e,t,i){let M=(n=e,n.reduce(((e,t)=>e+t),0));var n;M<t?function(e,t,i){if(!e.length)return;const M=t-i,n=i||1;for(let t=0;t<e.length;t++)e[t]+=M*(e[t]/n)}(e,t,M):M>t&&function(e,t,i,M){let n=i-t;for(let t=0;t<8&&n>.5;t++){const{candidates:t,weightSum:i}=nS(e,M);if(!t.length||i<=0)break;const o=oS(e,t,i,n,M);if(n-=o,o<.5)break}}(e,t,M,i)}(i,s,r),function(e,t){for(let i=0;i<e.length;i++)e[i]=Math.max(t,Math.round(e[i]))}(i,r),hS(e,i)}function MS(e,t,i,M,n){const o=[...e.children].filter((e=>"nile-grid-head-item"===e.tagName.toLowerCase())).map((e=>function(e,t,i){const M=Number(e.dataset?.cStart)||1,n=Math.max(1,Number(e.getAttribute("colspan"))||1),o=e.width??e.getAttribute("width")??null;e.hasAttribute("lockWidth")&&(i[M-1]=!0);const r=function(e,t){if(null==e)return null;if("number"==typeof e&&Number.isFinite(e))return e;const i=String(e).trim().toLowerCase();if(!i)return null;if(i.endsWith("px")){const e=parseFloat(i);return Number.isFinite(e)?e:null}if(i.endsWith("%")){const e=parseFloat(i);return Number.isFinite(e)?e/100*t:null}const M=parseFloat(i);return Number.isFinite(M)?M:null}(o,t);return{cStart:M,colspan:n,cw:r}}(e,M,n))).filter((e=>null!=e.cw));o.sort(((e,t)=>e.colspan-t.colspan)),o.forEach((({cStart:e,colspan:M,cw:n})=>{!function(e,t,i,M,n){const o=Math.round(M/i);for(let M=0;M<i;M++){const i=t-1+M;i>=0&&i<n&&null==e[i]&&(e[i]=o)}}(t,e,M,n,i)}))}function nS(e,t){const i=[];let M=0;for(let n=0;n<e.length;n++){Math.max(0,e[n]-t)>0&&(i.push(n),M+=e[n])}return{candidates:i,weightSum:M}}function oS(e,t,i,M,n){let o=0;for(const r of t){const t=Math.max(0,e[r]-n),s=e[r]/i,a=Math.min(t,M*s);e[r]-=a,o+=a}return o}const rS=(e,t,i,M,n,o)=>{t.style.display="block",i.style.display="block",t.style.height=n+"px",i.style.height=n+"px";const r=e,s=e=>Math.max(0,Math.round(e||0)),a=s(o.reduce(((e,t)=>e+(t||0)),0)),l=(N=M,s(o.slice(0,Math.max(0,N)).reduce(((e,t)=>e+(t||0)),0)));var N;let g=l+s(Math.max(r,o[M]??r));const u=l+r,c=a;g=Math.min(Math.max(g,u),c),g=Math.max(g,20),t.style.left=g-6+"px",i.style.left=g-2+"px"};function sS({grid:e,col:t,prevW:i,newW:M,floor:n}){if(e.lockedWidthColumns?.[t])return;let o=M-i;if(o>0){const M=function(e,t,i,M){let n=0;for(let o=t;o<e.length;o++)M?.[o]||(n+=Math.max(0,e[o]-i));return n}(e.columnWidths,t+1,n,e.lockedWidthColumns);if(M<=0)return;o=Math.min(o,M),e.columnWidths[t]=i+o,function(e,t,i,M,n){let o=i;for(let i=t;i<e.length&&o>0;i++){if(n?.[i])continue;const t=e[i]-M;if(t<=0)continue;const r=Math.min(t,o);e[i]-=r,o-=r}}(e.columnWidths,t+1,o,n,e.lockedWidthColumns)}else{const o=Math.max(n,M),r=i-o;e.columnWidths[t]=o,function(e,t,i){let M=i;t<e.length&&M>0&&(e[t]+=M,M=0)}(e.columnWidths,t+1,r)}}function aS(e,t){rS(e.minColumnWidth,e.resizeStart,e.resizeEnd,t,e.scrollHeight,e.columnWidths)}const lS=(e,t,i,M)=>{e.addEventListener("nile-column-resize",t),e.addEventListener("nile-resize-start",(t=>{t.stopPropagation(),e.resizeStart.style.display="block"})),e.addEventListener("nile-resize-end",(t=>{var i,M;t.stopPropagation(),i=e,M=t.detail.col,rS(i.minColumnWidth,i.resizeStart,i.resizeEnd,M,i.scrollHeight,i.columnWidths),hS(i,i.columnWidths),e.resizeStart.style.display="none",e.resizeEnd.style.display="none"})),i.addEventListener("slotchange",(()=>M())),e.addEventListener("scroll",(()=>uS(e)))},NS=e=>(e?.assignedElements()??[]).find((e=>"nile-grid-head"===e.tagName.toLowerCase()))||null,gS=e=>(e?.assignedElements()??[]).find((e=>"nile-grid-body"===e.tagName.toLowerCase()))||null,uS=e=>{const t=Math.max(1,e.scrollHeight-e.clientHeight),i=Math.max(1,e.scrollWidth-e.clientWidth),M=Math.round(e.scrollTop/t*100),n=Math.round(e.scrollLeft/i*100);e.emit("nile-scroll",{bubbles:!0,composed:!0,detail:{horizontalScroll:n,verticalScroll:M,left:e.scrollLeft,top:e.scrollTop}})},cS="NILE-GRID-HEAD-ITEM",DS=(e,t,i,M,n)=>{const o=NS(t),r=gS(t);if(!o&&!r)return;let s=e.colCount||0,a=!1;if(e.needsStructureLayout)a=!0,e.headRows=o?Array.from(o.querySelectorAll("nile-grid-row")):[],s=0,e.headRows.length&&(s=function(e,t,i,M,n,o){return jS(e,t,i,M,n,o,{itemSelector:"nile-grid-head-item",useStickyAttr:!0,handleRowBg:!1})}(e,e.headRows,[],s,M,n)),r&&(e.bodyRows=Array.from(r.querySelectorAll("nile-grid-row")),s?dS(e,e.bodyRows,[],s,M,n):s=dS(e,e.bodyRows,[],s,M,n)),e.stickyLeftIndexes.length||e.stickyRightIndexes.length?function(e){const{head:t,body:i}=function(e){if(!e.shadowRoot)return{head:void 0,body:void 0};const t=e.slotEl.assignedElements(),i=e=>t.find((t=>t.tagName.toLowerCase()===e));return{head:i("nile-grid-head"),body:i("nile-grid-body")}}(e);e.stickyLeftHeadEls=t?Array.from(t.querySelectorAll('nile-grid-head-item[data-sticky="left"]')):[],e.stickyRightHeadEls=t?Array.from(t.querySelectorAll('nile-grid-head-item[data-sticky="right"]')):[],e.stickyLeftBodyEls=i?Array.from(i.querySelectorAll('nile-grid-cell-item[data-sticky="left"]')):[],e.stickyRightBodyEls=i?Array.from(i.querySelectorAll('nile-grid-cell-item[data-sticky="right"]')):[]}(e):(e.stickyLeftHeadEls=[],e.stickyRightHeadEls=[],e.stickyLeftBodyEls=[],e.stickyRightBodyEls=[],e.shadowLeftVisibleSticky=!1,e.shadowRightVisibleSticky=!1),e.colCount=s,e.needsStructureLayout=!1,e.needsSpanLayout=!1,e.needsWidthLayout=!0;else if(e.needsSpanLayout&&r){const t=e.bodyRows;s=e.colCount||0,s&&dS(e,t,[],s,M,n),e.needsSpanLayout=!1}if(e.needsWidthLayout){if(s=e.colCount||s,!s)return;i(s),iS(e,s,e.columnWidths,t,e.lockedWidthColumns,a),function(e){const t=e.columnWidths,i=e.stickyLeftIndexes,M=e.stickyRightIndexes,n=[],o=e;let r=0;for(let e=0;e<i.length;e++){const M=i[e];n.push({colNumber:M,left:r,right:0}),o.style.setProperty(`--sticky-left-${M}`,`${r}px`),r+=t[M]}let s=0;for(let e=M.length-1;e>=0;e--){const i=M[e];n.push({colNumber:i,left:0,right:s}),o.style.setProperty(`--sticky-right-${i}`,`${s}px`),s+=t[i]}e.prefixSumColumnsWidth=n}(e),hS(e,e.columnWidths),e.needsWidthLayout=!1}};function jS(e,t,i,M,n,o,r){return t.forEach(((t,s)=>{e.hoverable&&t.setAttribute("hover","true"),M=function(e,t,i,M,n,o,r,s){let a=1;const l=i+1,N=s.itemSelector.toLowerCase(),g=Array.from(t.children).filter((e=>e.tagName.toLowerCase()===N));for(const t of g){for(;(M[a-1]||0)>0;)a++;({c:a,colCount:n}=IS(e,t,a,l,M,n,o,r,s))}return function(e){for(let t=0;t<e.length;t++)e[t]>0&&e[t]--}(M),n}(e,t,s,i,M,n,o,r)})),M}function IS(e,t,i,M,n,o,r,s,a){const l=Math.max(1,+t.getAttribute("colspan")||1),N=Math.max(1,+t.getAttribute("rowspan")||1);!function(e,t,i){if(i<=1)return;t.style.position="absolute",t.style.zIndex="1",t.tagName===cS?(e.headHeight||(e.headHeight=t.getBoundingClientRect().height),t.style.height=e.headHeight*i+(i-1)+"px",t.style.backgroundColor="var(--nile-colors-neutral-100, var(--ng-colors-bg-secondary))",t.style.backgroundColor="var(--nile-colors-neutral-100, var(--ng-colors-bg-secondary))"):(e.cellHeight||(e.cellHeight=t.getBoundingClientRect().height),t.style.height=e.cellHeight*i+(i-1)+"px",t.style.backgroundColor="var(--nile-colors-white-base, var(--ng-colors-bg-primary))",t.style.backgroundColor="var(--nile-colors-white-base, var(--ng-colors-bg-primary))")}(e,t,N);const g=i,u=i+l;!function(e,t,i,M,n){const o=M+n;e.style.gridColumn=`${t} / ${i}`,e.style.gridRow=`${M} / ${o}`,e.dataset.cStart=String(t)}(t,g,u,M,N),(a.useStickyAttr||r.length||s.length)&&function(e,t,i,M,n){i.useStickyAttr&&"left"===e.getAttribute("sticky")&&!M.includes(t-1)&&M.push(t-1);i.useStickyAttr&&"right"===e.getAttribute("sticky")&&!n.includes(t-1)&&n.push(t-1);!function(e,t,i,M){const n=i.includes(t),o=M.includes(t);if(!n&&!o)return;(function(e){e.style.position="sticky",e.style.left="",e.style.right="",e.removeAttribute("data-sticky")})(e),n&&!o?function(e,t){e.setAttribute("data-sticky","left"),e.tagName===cS?e.style.backgroundColor="var(--nile-colors-neutral-100, var(--ng-colors-bg-secondary))":e.style.backgroundColor="var(--nile-colors-white-base, var(--ng-colors-bg-primary))";e.style.zIndex="1",e.style.left=`var(--sticky-left-${t})`}(e,t):function(e,t){e.setAttribute("data-sticky","right"),e.tagName===cS?e.style.backgroundColor="var(--nile-colors-neutral-100, var(--ng-colors-bg-secondary))":e.style.backgroundColor="var(--nile-colors-white-base, var(--ng-colors-bg-primary))";e.style.zIndex="1",e.style.right=`var(--sticky-right-${t})`}(e,t)}(e,t-1,M,n)}(t,g,a,r,s);for(let e=0;e<l;e++)n[i-1+e]=Math.max(n[i-1+e]||0,N);return{c:u,colCount:Math.max(o,u-1)}}function zS(e){if(!e.stickyLeftIndexes.length&&!e.stickyRightIndexes.length)return;const{showRightOnLeftStickies:t,showLeftOnRightStickies:i}=function(e){const t=Math.max(0,e.scrollWidth-e.clientWidth);return{showRightOnLeftStickies:e.scrollLeft>0,showLeftOnRightStickies:e.scrollLeft<t}}(e);if(e.shadowLeftVisibleSticky!==t||e.shadowRightVisibleSticky!==i){e.shadowLeftVisibleSticky=t,e.shadowRightVisibleSticky=i;for(const i of e.stickyLeftHeadEls)i.classList.toggle("shadow-left",t);for(const i of e.stickyLeftBodyEls)i.classList.toggle("shadow-left",t);for(const t of e.stickyRightHeadEls)t.classList.toggle("shadow-right",i);for(const t of e.stickyRightBodyEls)t.classList.toggle("shadow-right",i)}}function dS(e,t,i,M,n,o){return jS(e,t,i,M,n,o,{itemSelector:"nile-grid-cell-item",useStickyAttr:!1,handleRowBg:!0})}function hS(e,t){const i=t.map(((e,i)=>i===t.length-1?`minmax(${Math.round(e)}px, auto)`:`${Math.max(0,Math.round(e))}px`)).join(" ");e.style.setProperty("--nile-grid-columns",i)}let TS=class extends Re{static get styles(){return[tS]}constructor(){super(),this.columnWidths=[],this.enableScroll=!1,this.hoverable=!1,this.raf=0,this.minColumnWidth=40,this.stickyLeftIndexes=[],this.stickyRightIndexes=[],this.cellHeight=null,this.headHeight=null,this.widthsInitialized=!1,this.lockedWidthColumns=[],this.prefixSumColumnsWidth=[],this.stickyColumns=[],this.bodyRows=[],this.headRows=[],this.needsStructureLayout=!1,this.needsWidthLayout=!1,this.needsSpanLayout=!1,this.colCount=0,this.stickyLeftHeadEls=[],this.stickyRightHeadEls=[],this.stickyLeftBodyEls=[],this.stickyRightBodyEls=[],this.resizeTimer=0,this.shadowRaf=0,this.syncStickyShadowsRaf=()=>{this.shadowRaf||(this.shadowRaf=requestAnimationFrame((()=>{this.shadowRaf=0,zS(this)})))},this.onResize=e=>{e.stopPropagation(),this.emit("nile-resize",{columnNumber:e.detail.col,columnWidth:e.detail.widthPx});const{col:t,widthPx:i}=e.detail,{prevW:M,newW:n,delta0:o}=function(e){const{target:t,col:i,widthPx:M,floor:n,columnWidths:o}=e,r=!!t.getAttribute("colspan")&&parseInt(t.getAttribute("colspan"),10)>1,s=o[i]??n,a=r?M-(o[i-1]??0):M,l=Math.max(n,Math.round(Number.isFinite(a)?a:s));return{prevW:s,newW:l,delta0:l-s}}({target:e.target,col:t,widthPx:i,floor:this.minColumnWidth,columnWidths:this.columnWidths});0!==o?(this.enableScroll?function(e){const{grid:t,col:i,newW:M}=e;t.lockedWidthColumns?.[i]||(t.columnWidths[i]=M)}({grid:this,col:t,newW:n}):sS({grid:this,col:t,prevW:M,newW:n,floor:this.minColumnWidth}),aS(this,t)):aS(this,t)}}connectedCallback(){super.connectedCallback(),this.emit("nile-init")}scheduleLayout(){this.raf&&cancelAnimationFrame(this.raf),this.raf=requestAnimationFrame((()=>{this.raf=0,DS(this,this.slotEl,this.ensureWidths.bind(this),this.stickyLeftIndexes,this.stickyRightIndexes),zS(this)}))}ensureWidths(e){this.columnWidths.length!==e&&(this.columnWidths=Array(e).fill(0),this.lockedWidthColumns=Array(e).fill(!1))}firstUpdated(){this.setAttribute("role","table"),lS(this,this.onResize,this.slotEl,this._attachObserverAndLayout.bind(this)),this.addEventListener("scroll",this.syncStickyShadowsRaf),this.resizeObserverStickyShadows=new ResizeObserver((()=>zS(this))),this.resizeObserverStickyShadows.observe(this),this.syncStickyShadowsRaf()}_attachObserverAndLayout(){this.mo?.disconnect(),this.mo=new MutationObserver((()=>{this.needsStructureLayout=!0,this.needsWidthLayout=!0,this.needsSpanLayout=!0,this.scheduleLayout()})),this.resizeObserver?.disconnect(),this.resizeObserver=new ResizeObserver((()=>{this.resizeTimer&&clearTimeout(this.resizeTimer),this.resizeTimer=setTimeout((()=>{this.resizeTimer=0,this.needsWidthLayout=!0,this.scheduleLayout()}),16)}));const e=NS(this.slotEl),t=gS(this.slotEl);if(!e&&!t)return;const i=e??this;this.mo.observe(i,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["colspan","rowspan","width","lockwidth","sticky"]}),this.resizeObserver?.observe(this),this.colCount&&this.columnWidths?.length||(this.needsStructureLayout=!0,this.needsSpanLayout=!0,this.needsWidthLayout=!0,this.scheduleLayout())}render(){return R`
|
|
14698
|
+
`;function eS(e,t,i,M,n,o){const r=e.minColumnWidth,s=function(e){return Math.max(0,(e.getBoundingClientRect().width||0)-4)}(e),a=function(e,t,i,M,n,o,r){const s=Array(t).fill(null);if(o){const M=aS(e);M&&function(e,t,i,M,n){const o=[...e.children].filter((e=>"nile-grid-row"===e.tagName.toLowerCase()));for(const e of o)tS(e,t,i,M,n)}(M,s,t,i,n)}r?.length&&r.some((e=>e>0))&&r?.length===t&&function(e,t,i){for(let M=0;M<t.length;M++)null==e[M]&&Number.isFinite(t[M])&&(e[M]=Math.max(i.minColumnWidth,Math.round(t[M])))}(s,r,M);return s}(M,t,s,e,n,o,i),l=function(e,t,i){const M=Array(e.length).fill(!1);for(let n=0;n<e.length;n++){const o=e[n]??null;t[n]=null==o||Number.isNaN(o)?0:Math.max(i,Number(o)),M[n]=null!=o&&!Number.isNaN(o)}return M}(a,i,r);!function(e,t,i,M){const n=e.reduce(((e,t)=>e+t),0),o=i-n,r=Array.from({length:e.length},((e,t)=>t)).filter((e=>!t[e]));if(0===r.length)return;const s=o/r.length;for(const t of r)e[t]=Math.max(M,s)}(i,l,s,r),e.enableScroll||function(e,t,i){let M=(n=e,n.reduce(((e,t)=>e+t),0));var n;M<t?function(e,t,i){if(!e.length)return;const M=t-i,n=i||1;for(let t=0;t<e.length;t++)e[t]+=M*(e[t]/n)}(e,t,M):M>t&&function(e,t,i,M){let n=i-t;for(let t=0;t<8&&n>.5;t++){const{candidates:t,weightSum:i}=iS(e,M);if(!t.length||i<=0)break;const o=MS(e,t,i,n,M);if(n-=o,o<.5)break}}(e,t,M,i)}(i,s,r),function(e,t){for(let i=0;i<e.length;i++)e[i]=Math.max(t,Math.round(e[i]))}(i,r),zS(e,i)}function tS(e,t,i,M,n){const o=[...e.children].filter((e=>"nile-grid-head-item"===e.tagName.toLowerCase())).map((e=>function(e,t,i){const M=Number(e.dataset?.cStart)||1,n=Math.max(1,Number(e.getAttribute("colspan"))||1),o=e.width??e.getAttribute("width")??null;e.hasAttribute("lockWidth")&&(i[M-1]=!0);const r=function(e,t){if(null==e)return null;if("number"==typeof e&&Number.isFinite(e))return e;const i=String(e).trim().toLowerCase();if(!i)return null;if(i.endsWith("px")){const e=parseFloat(i);return Number.isFinite(e)?e:null}if(i.endsWith("%")){const e=parseFloat(i);return Number.isFinite(e)?e/100*t:null}const M=parseFloat(i);return Number.isFinite(M)?M:null}(o,t);return{cStart:M,colspan:n,cw:r}}(e,M,n))).filter((e=>null!=e.cw));o.sort(((e,t)=>e.colspan-t.colspan)),o.forEach((({cStart:e,colspan:M,cw:n})=>{!function(e,t,i,M,n){const o=Math.round(M/i);for(let M=0;M<i;M++){const i=t-1+M;i>=0&&i<n&&null==e[i]&&(e[i]=o)}}(t,e,M,n,i)}))}function iS(e,t){const i=[];let M=0;for(let n=0;n<e.length;n++){Math.max(0,e[n]-t)>0&&(i.push(n),M+=e[n])}return{candidates:i,weightSum:M}}function MS(e,t,i,M,n){let o=0;for(const r of t){const t=Math.max(0,e[r]-n),s=e[r]/i,a=Math.min(t,M*s);e[r]-=a,o+=a}return o}const nS=(e,t,i,M,n,o)=>{t.style.display="block",i.style.display="block",t.style.height=n+"px",i.style.height=n+"px";const r=e,s=e=>Math.max(0,Math.round(e||0)),a=s(o.reduce(((e,t)=>e+(t||0)),0)),l=(N=M,s(o.slice(0,Math.max(0,N)).reduce(((e,t)=>e+(t||0)),0)));var N;let g=l+s(Math.max(r,o[M]??r));const u=l+r,c=a;g=Math.min(Math.max(g,u),c),g=Math.max(g,20),t.style.left=g-6+"px",i.style.left=g-2+"px"};function oS({grid:e,col:t,prevW:i,newW:M,floor:n}){if(e.lockedWidthColumns?.[t])return;let o=M-i;if(o>0){const M=function(e,t,i,M){let n=0;for(let o=t;o<e.length;o++)M?.[o]||(n+=Math.max(0,e[o]-i));return n}(e.columnWidths,t+1,n,e.lockedWidthColumns);if(M<=0)return;o=Math.min(o,M),e.columnWidths[t]=i+o,function(e,t,i,M,n){let o=i;for(let i=t;i<e.length&&o>0;i++){if(n?.[i])continue;const t=e[i]-M;if(t<=0)continue;const r=Math.min(t,o);e[i]-=r,o-=r}}(e.columnWidths,t+1,o,n,e.lockedWidthColumns)}else{const o=Math.max(n,M),r=i-o;e.columnWidths[t]=o,function(e,t,i){let M=i;t<e.length&&M>0&&(e[t]+=M,M=0)}(e.columnWidths,t+1,r)}}function rS(e,t){nS(e.minColumnWidth,e.resizeStart,e.resizeEnd,t,e.scrollHeight,e.columnWidths)}const sS=(e,t,i,M)=>{e.addEventListener("nile-column-resize",t),e.addEventListener("nile-resize-start",(t=>{t.stopPropagation(),e.resizeBaseColumnWidths=[...e.columnWidths],e.resizeStart.style.display="block"})),e.addEventListener("nile-resize-end",(t=>{var i,M;t.stopPropagation(),i=e,M=t.detail.col,nS(i.minColumnWidth,i.resizeStart,i.resizeEnd,M,i.scrollHeight,i.columnWidths),zS(i,i.columnWidths),e.resizeBaseColumnWidths=[],e.resizeStart.style.display="none",e.resizeEnd.style.display="none"})),i.addEventListener("slotchange",(()=>M())),e.addEventListener("scroll",(()=>NS(e)))},aS=e=>(e?.assignedElements()??[]).find((e=>"nile-grid-head"===e.tagName.toLowerCase()))||null,lS=e=>(e?.assignedElements()??[]).find((e=>"nile-grid-body"===e.tagName.toLowerCase()))||null,NS=e=>{const t=Math.max(1,e.scrollHeight-e.clientHeight),i=Math.max(1,e.scrollWidth-e.clientWidth),M=Math.round(e.scrollTop/t*100),n=Math.round(e.scrollLeft/i*100);e.emit("nile-scroll",{bubbles:!0,composed:!0,detail:{horizontalScroll:n,verticalScroll:M,left:e.scrollLeft,top:e.scrollTop}})};const gS="NILE-GRID-HEAD-ITEM",uS=(e,t,i,M,n)=>{const o=aS(t),r=lS(t);if(!o&&!r)return;let s=e.colCount||0,a=!1;if(e.needsStructureLayout)a=!0,e.headRows=o?Array.from(o.querySelectorAll("nile-grid-row")):[],s=0,e.headRows.length&&(s=function(e,t,i,M,n,o){return cS(e,t,i,M,n,o,{itemSelector:"nile-grid-head-item",useStickyAttr:!0,handleRowBg:!1})}(e,e.headRows,[],s,M,n)),r&&(e.bodyRows=Array.from(r.querySelectorAll("nile-grid-row")),s?IS(e,e.bodyRows,[],s,M,n):s=IS(e,e.bodyRows,[],s,M,n)),e.stickyLeftIndexes.length||e.stickyRightIndexes.length?function(e){const{head:t,body:i}=function(e){if(!e.shadowRoot)return{head:void 0,body:void 0};const t=e.slotEl.assignedElements(),i=e=>t.find((t=>t.tagName.toLowerCase()===e));return{head:i("nile-grid-head"),body:i("nile-grid-body")}}(e);e.stickyLeftHeadEls=t?Array.from(t.querySelectorAll('nile-grid-head-item[data-sticky="left"]')):[],e.stickyRightHeadEls=t?Array.from(t.querySelectorAll('nile-grid-head-item[data-sticky="right"]')):[],e.stickyLeftBodyEls=i?Array.from(i.querySelectorAll('nile-grid-cell-item[data-sticky="left"]')):[],e.stickyRightBodyEls=i?Array.from(i.querySelectorAll('nile-grid-cell-item[data-sticky="right"]')):[]}(e):(e.stickyLeftHeadEls=[],e.stickyRightHeadEls=[],e.stickyLeftBodyEls=[],e.stickyRightBodyEls=[],e.shadowLeftVisibleSticky=!1,e.shadowRightVisibleSticky=!1),e.colCount=s,e.needsStructureLayout=!1,e.needsSpanLayout=!1,e.needsWidthLayout=!0;else if(e.needsSpanLayout&&r){const t=e.bodyRows;s=e.colCount||0,s&&IS(e,t,[],s,M,n),e.needsSpanLayout=!1}if(e.needsWidthLayout){if(s=e.colCount||s,!s)return;i(s),eS(e,s,e.columnWidths,t,e.lockedWidthColumns,a),function(e){const t=e.columnWidths,i=e.stickyLeftIndexes,M=e.stickyRightIndexes,n=[],o=e;let r=0;for(let e=0;e<i.length;e++){const M=i[e];n.push({colNumber:M,left:r,right:0}),o.style.setProperty(`--sticky-left-${M}`,`${r}px`),r+=t[M]}let s=0;for(let e=M.length-1;e>=0;e--){const i=M[e];n.push({colNumber:i,left:0,right:s}),o.style.setProperty(`--sticky-right-${i}`,`${s}px`),s+=t[i]}e.prefixSumColumnsWidth=n}(e),zS(e,e.columnWidths),e.needsWidthLayout=!1}};function cS(e,t,i,M,n,o,r){return t.forEach(((t,s)=>{e.hoverable&&t.setAttribute("hover","true"),M=function(e,t,i,M,n,o,r,s){let a=1;const l=i+1,N=s.itemSelector.toLowerCase(),g=Array.from(t.children).filter((e=>e.tagName.toLowerCase()===N));for(const t of g){for(;(M[a-1]||0)>0;)a++;({c:a,colCount:n}=DS(e,t,a,l,M,n,o,r,s))}return function(e){for(let t=0;t<e.length;t++)e[t]>0&&e[t]--}(M),n}(e,t,s,i,M,n,o,r)})),M}function DS(e,t,i,M,n,o,r,s,a){const l=Math.max(1,+t.getAttribute("colspan")||1),N=Math.max(1,+t.getAttribute("rowspan")||1);!function(e,t,i){if(i<=1)return;t.style.position="absolute",t.style.zIndex="1",t.tagName===gS?(e.headHeight||(e.headHeight=t.getBoundingClientRect().height),t.style.height=e.headHeight*i+(i-1)+"px",t.style.backgroundColor="var(--nile-colors-neutral-100, var(--ng-colors-bg-secondary))",t.style.backgroundColor="var(--nile-colors-neutral-100, var(--ng-colors-bg-secondary))"):(e.cellHeight||(e.cellHeight=t.getBoundingClientRect().height),t.style.height=e.cellHeight*i+(i-1)+"px",t.style.backgroundColor="var(--nile-colors-white-base, var(--ng-colors-bg-primary))",t.style.backgroundColor="var(--nile-colors-white-base, var(--ng-colors-bg-primary))")}(e,t,N);const g=i,u=i+l;!function(e,t,i,M,n){const o=M+n;e.style.gridColumn=`${t} / ${i}`,e.style.gridRow=`${M} / ${o}`,e.dataset.cStart=String(t)}(t,g,u,M,N),(a.useStickyAttr||r.length||s.length)&&function(e,t,i,M,n){i.useStickyAttr&&"left"===e.getAttribute("sticky")&&!M.includes(t-1)&&M.push(t-1);i.useStickyAttr&&"right"===e.getAttribute("sticky")&&!n.includes(t-1)&&n.push(t-1);!function(e,t,i,M){const n=i.includes(t),o=M.includes(t);if(!n&&!o)return;(function(e){e.style.position="sticky",e.style.left="",e.style.right="",e.removeAttribute("data-sticky")})(e),n&&!o?function(e,t){e.setAttribute("data-sticky","left"),e.tagName===gS?e.style.backgroundColor="var(--nile-colors-neutral-100, var(--ng-colors-bg-secondary))":e.style.backgroundColor="var(--nile-colors-white-base, var(--ng-colors-bg-primary))";e.style.zIndex="1",e.style.left=`var(--sticky-left-${t})`}(e,t):function(e,t){e.setAttribute("data-sticky","right"),e.tagName===gS?e.style.backgroundColor="var(--nile-colors-neutral-100, var(--ng-colors-bg-secondary))":e.style.backgroundColor="var(--nile-colors-white-base, var(--ng-colors-bg-primary))";e.style.zIndex="1",e.style.right=`var(--sticky-right-${t})`}(e,t)}(e,t-1,M,n)}(t,g,a,r,s);for(let e=0;e<l;e++)n[i-1+e]=Math.max(n[i-1+e]||0,N);return{c:u,colCount:Math.max(o,u-1)}}function jS(e){if(!e.stickyLeftIndexes.length&&!e.stickyRightIndexes.length)return;const{showRightOnLeftStickies:t,showLeftOnRightStickies:i}=function(e){const t=Math.max(0,e.scrollWidth-e.clientWidth);return{showRightOnLeftStickies:e.scrollLeft>0,showLeftOnRightStickies:e.scrollLeft<t}}(e);if(e.shadowLeftVisibleSticky!==t||e.shadowRightVisibleSticky!==i){e.shadowLeftVisibleSticky=t,e.shadowRightVisibleSticky=i;for(const i of e.stickyLeftHeadEls)i.classList.toggle("shadow-left",t);for(const i of e.stickyLeftBodyEls)i.classList.toggle("shadow-left",t);for(const t of e.stickyRightHeadEls)t.classList.toggle("shadow-right",i);for(const t of e.stickyRightBodyEls)t.classList.toggle("shadow-right",i)}}function IS(e,t,i,M,n,o){return cS(e,t,i,M,n,o,{itemSelector:"nile-grid-cell-item",useStickyAttr:!1,handleRowBg:!0})}function zS(e,t){const i=t.map(((e,i)=>i===t.length-1?`minmax(${Math.round(e)}px, auto)`:`${Math.max(0,Math.round(e))}px`)).join(" ");e.style.setProperty("--nile-grid-columns",i)}let dS=class extends Re{static get styles(){return[KL]}constructor(){super(),this.columnWidths=[],this.enableScroll=!1,this.hoverable=!1,this.raf=0,this.minColumnWidth=40,this.stickyLeftIndexes=[],this.stickyRightIndexes=[],this.cellHeight=null,this.headHeight=null,this.widthsInitialized=!1,this.lockedWidthColumns=[],this.prefixSumColumnsWidth=[],this.stickyColumns=[],this.bodyRows=[],this.headRows=[],this.needsStructureLayout=!1,this.needsWidthLayout=!1,this.needsSpanLayout=!1,this.colCount=0,this.stickyLeftHeadEls=[],this.stickyRightHeadEls=[],this.stickyLeftBodyEls=[],this.stickyRightBodyEls=[],this.resizeTimer=0,this.shadowRaf=0,this.resizeBaseColumnWidths=[],this.syncStickyShadowsRaf=()=>{this.shadowRaf||(this.shadowRaf=requestAnimationFrame((()=>{this.shadowRaf=0,jS(this)})))},this.onResize=e=>{e.stopPropagation(),this.emit("nile-resize",{columnNumber:e.detail.col,columnWidth:e.detail.widthPx});const{col:t,widthPx:i}=e.detail;if(!this.resizeBaseColumnWidths)return;!function(e,t){const i=Math.min(e.length,t.length);for(let M=0;M<i;M++)e[M]=t[M]}(this.columnWidths,this.resizeBaseColumnWidths);const{prevW:M,newW:n,delta0:o}=function(e){const{target:t,col:i,widthPx:M,floor:n,columnWidths:o}=e,r=!!t.getAttribute("colspan")&&parseInt(t.getAttribute("colspan"),10)>1,s=o[i]??n,a=r?M-(o[i-1]??0):M,l=Math.max(n,Math.round(Number.isFinite(a)?a:s));return{prevW:s,newW:l,delta0:l-s}}({target:e.target,col:t,widthPx:i,floor:this.minColumnWidth,columnWidths:this.columnWidths});0!==o?(this.enableScroll?function(e){const{grid:t,col:i,newW:M}=e;t.lockedWidthColumns?.[i]||(t.columnWidths[i]=M)}({grid:this,col:t,newW:n}):oS({grid:this,col:t,prevW:M,newW:n,floor:this.minColumnWidth}),rS(this,t)):rS(this,t)}}connectedCallback(){super.connectedCallback(),this.emit("nile-init")}scheduleLayout(){this.raf&&cancelAnimationFrame(this.raf),this.raf=requestAnimationFrame((()=>{this.raf=0,uS(this,this.slotEl,this.ensureWidths.bind(this),this.stickyLeftIndexes,this.stickyRightIndexes),jS(this)}))}ensureWidths(e){this.columnWidths.length!==e&&(this.columnWidths=Array(e).fill(0),this.lockedWidthColumns=Array(e).fill(!1))}firstUpdated(){this.setAttribute("role","table"),sS(this,this.onResize,this.slotEl,this._attachObserverAndLayout.bind(this)),this.addEventListener("scroll",this.syncStickyShadowsRaf),this.resizeObserverStickyShadows=new ResizeObserver((()=>jS(this))),this.resizeObserverStickyShadows.observe(this),this.syncStickyShadowsRaf()}_attachObserverAndLayout(){this.mo?.disconnect(),this.mo=new MutationObserver((()=>{this.needsStructureLayout=!0,this.needsWidthLayout=!0,this.needsSpanLayout=!0,this.scheduleLayout()})),this.resizeObserver?.disconnect(),this.resizeObserver=new ResizeObserver((()=>{this.resizeTimer&&clearTimeout(this.resizeTimer),this.resizeTimer=setTimeout((()=>{this.resizeTimer=0,this.needsWidthLayout=!0,this.scheduleLayout()}),16)}));const e=aS(this.slotEl),t=lS(this.slotEl);if(!e&&!t)return;const i=e??this;this.mo.observe(i,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["colspan","rowspan","width","lockwidth","sticky"]}),this.resizeObserver?.observe(this),this.colCount&&this.columnWidths?.length||(this.needsStructureLayout=!0,this.needsSpanLayout=!0,this.needsWidthLayout=!0,this.scheduleLayout())}render(){return R`
|
|
14655
14699
|
<div part="grid-base" class="nile-grid-base">
|
|
14656
14700
|
<div part="grid-slot-wrapper">
|
|
14657
14701
|
<slot part="grid-slot"></slot>
|
|
@@ -14659,16 +14703,16 @@ nile-badge::part(content) {
|
|
|
14659
14703
|
<div part="resize-start" class="nile-resize-start"></div>
|
|
14660
14704
|
<div part="resize-end" class="nile-resize-end"></div>
|
|
14661
14705
|
</div>
|
|
14662
|
-
`}disconnectedCallback(){var e,t,i,M;this.emit("nile-destroy"),super.disconnectedCallback?.(),this.mo?.disconnect(),this.resizeObserver?.disconnect(),this.resizeObserverStickyShadows?.disconnect(),this.raf&&cancelAnimationFrame(this.raf),e=this,t=this.onResize,i=this.slotEl,M=this._attachObserverAndLayout.bind(this),e.removeEventListener("nile-column-resize",t),e.removeEventListener("nile-resize-start",(()=>{e.resizeStart.style.display="block"})),e.removeEventListener("nile-resize-end",(()=>{e.resizeStart.style.display="none",e.resizeEnd.style.display="none"})),i.removeEventListener("slotchange",(()=>M())),e.removeEventListener("scroll",(()=>
|
|
14706
|
+
`}disconnectedCallback(){var e,t,i,M;this.emit("nile-destroy"),super.disconnectedCallback?.(),this.mo?.disconnect(),this.resizeObserver?.disconnect(),this.resizeObserverStickyShadows?.disconnect(),this.raf&&cancelAnimationFrame(this.raf),e=this,t=this.onResize,i=this.slotEl,M=this._attachObserverAndLayout.bind(this),e.removeEventListener("nile-column-resize",t),e.removeEventListener("nile-resize-start",(()=>{e.resizeStart.style.display="block"})),e.removeEventListener("nile-resize-end",(()=>{e.resizeStart.style.display="none",e.resizeEnd.style.display="none"})),i.removeEventListener("slotchange",(()=>M())),e.removeEventListener("scroll",(()=>NS(e)))}};e([De()],dS.prototype,"columnWidths",void 0),e([Ie("slot")],dS.prototype,"slotEl",void 0),e([Ie(".nile-resize-start")],dS.prototype,"resizeStart",void 0),e([Ie(".nile-resize-end")],dS.prototype,"resizeEnd",void 0),e([Ie(".shadow-left")],dS.prototype,"shadowLeft",void 0),e([Ie(".shadow-right")],dS.prototype,"shadowRight",void 0),e([ce({type:Boolean,attribute:!0,reflect:!0})],dS.prototype,"enableScroll",void 0),e([ce({type:Boolean,attribute:!0,reflect:!0})],dS.prototype,"hoverable",void 0),e([ce({type:Number,reflect:!0,attribute:!0})],dS.prototype,"minColumnWidth",void 0),e([De()],dS.prototype,"stickyLeftIndexes",void 0),e([De()],dS.prototype,"stickyRightIndexes",void 0),e([De()],dS.prototype,"cellHeight",void 0),e([De()],dS.prototype,"headHeight",void 0),e([De()],dS.prototype,"widthsInitialized",void 0),e([De()],dS.prototype,"lockedWidthColumns",void 0),e([De()],dS.prototype,"prefixSumColumnsWidth",void 0),e([De()],dS.prototype,"stickyColumns",void 0),e([De()],dS.prototype,"bodyRows",void 0),e([De()],dS.prototype,"headRows",void 0),e([De()],dS.prototype,"needsStructureLayout",void 0),e([De()],dS.prototype,"needsWidthLayout",void 0),e([De()],dS.prototype,"needsSpanLayout",void 0),e([De()],dS.prototype,"colCount",void 0),dS=e([Ne("nile-grid")],dS);const hS=r`
|
|
14663
14707
|
:host {
|
|
14664
14708
|
box-sizing: border-box;
|
|
14665
14709
|
background-color: var(--nile-colors-white-base, var(--ng-colors-bg-primary));
|
|
14666
14710
|
}
|
|
14667
|
-
`;let
|
|
14711
|
+
`;let TS=class extends Re{static get styles(){return[hS]}connectedCallback(){super.connectedCallback(),this.setAttribute("role","rowgroup")}render(){return R`
|
|
14668
14712
|
<div part="grid-body-base">
|
|
14669
14713
|
<slot></slot>
|
|
14670
14714
|
</div>
|
|
14671
|
-
`}};
|
|
14715
|
+
`}};TS=e([Ne("nile-grid-body")],TS);const yS=r`
|
|
14672
14716
|
.row-base {
|
|
14673
14717
|
display: grid;
|
|
14674
14718
|
grid-template-columns: var(--nile-grid-columns);
|
|
@@ -14704,14 +14748,14 @@ nile-badge::part(content) {
|
|
|
14704
14748
|
:host-context(nile-grid-body):host(:last-child)::part(grid-row-base) {
|
|
14705
14749
|
border-bottom: none;
|
|
14706
14750
|
}
|
|
14707
|
-
`;let
|
|
14751
|
+
`;let AS=class extends Re{constructor(){super(...arguments),this.disabled=!1,this.hover=!1,this.selected=!1}static get styles(){return[yS]}connectedCallback(){super.connectedCallback(),this.setAttribute("role","row")}render(){return R`
|
|
14708
14752
|
<div part="grid-row-base" class="row-base">
|
|
14709
14753
|
<div part="row-slot" class="row-slot">
|
|
14710
14754
|
<slot></slot>
|
|
14711
14755
|
</div>
|
|
14712
14756
|
<div part="row-bg" class="row-bg"></div>
|
|
14713
14757
|
</div>
|
|
14714
|
-
`}};e([ce({type:Boolean,reflect:!0,attribute:!0})],
|
|
14758
|
+
`}};e([ce({type:Boolean,reflect:!0,attribute:!0})],AS.prototype,"disabled",void 0),e([ce({type:Boolean,reflect:!0,attribute:!0})],AS.prototype,"hover",void 0),e([ce({type:Boolean,reflect:!0,attribute:!0})],AS.prototype,"selected",void 0),AS=e([Ne("nile-grid-row")],AS);const OS=r`
|
|
14715
14759
|
:host {
|
|
14716
14760
|
--padding: var(--nile-spacing-lg, var(--ng-spacing-lg)) var(--nile-spacing-10px, var(--ng-spacing-3xl));
|
|
14717
14761
|
--height: 50px;
|
|
@@ -14777,7 +14821,7 @@ nile-badge::part(content) {
|
|
|
14777
14821
|
z-index: 1;
|
|
14778
14822
|
background-color: var(--nile-colors-neutral-100, var(--ng-colors-bg-secondary));
|
|
14779
14823
|
}
|
|
14780
|
-
`;let
|
|
14824
|
+
`;let pS=class extends Re{constructor(){super(...arguments),this.colspan=1,this.rowspan=1,this.resizable=!1,this.width=null,this.sticky=null,this.lockWidth=!1,this.onHandlePointerDown=e=>{const t=this,i=this.closest("nile-grid"),M={value:0},n={value:0},o=function(e,t,i,M){t.preventDefault(),t.stopPropagation();const n=Number(e.dataset.cStart);if(!n)return null;const o=Number(e.getAttribute("colspan"))||1,r=Math.max(0,n+o-1-1);i.value=t.clientX,M.value=e.getBoundingClientRect().width;const s=t.currentTarget;return s.setPointerCapture(t.pointerId),e.dispatchEvent(new CustomEvent("nile-column-resize",{detail:{col:r,widthPx:M.value},bubbles:!0,composed:!0})),e.dispatchEvent(new CustomEvent("nile-resize-start",{bubbles:!0,composed:!0})),{target:s,col:r}}(t,e,M,n);if(!o)return;const{target:r,col:s}=o,a=e=>function(e,t,i,M,n,o){const r=Math.max(o.minColumnWidth,Math.round(i+(n.clientX-M)));e.dispatchEvent(new CustomEvent("nile-column-resize",{detail:{col:t,widthPx:r},bubbles:!0,composed:!0}))}(t,s,n.value,M.value,e,i),l=e=>{!function(e,t,i,M,n){M.releasePointerCapture(i.pointerId),M.removeEventListener("pointermove",n),e.dispatchEvent(new CustomEvent("nile-resize-end",{bubbles:!0,composed:!0,detail:{col:t}}))}(t,s,e,r,a),function(e,t,i){e.removeEventListener("pointermove",t),e.removeEventListener("pointerup",i),e.removeEventListener("pointercancel",i),window.removeEventListener("pointerup",i)}(r,a,l)};!function(e,t,i){e.addEventListener("pointermove",t),e.addEventListener("pointerup",i),e.addEventListener("pointercancel",i),window.addEventListener("pointerup",i,{once:!0})}(r,a,l)}}static get styles(){return[OS]}connectedCallback(){super.connectedCallback(),this.setAttribute("role","row")}disconnectedCallback(){super.disconnectedCallback(),this.removeAttribute("role")}render(){return R`
|
|
14781
14825
|
<div part="grid-head-item-base" class="head-item-base">
|
|
14782
14826
|
<slot></slot>
|
|
14783
14827
|
${this.resizable?R`
|
|
@@ -14789,7 +14833,7 @@ nile-badge::part(content) {
|
|
|
14789
14833
|
></div>
|
|
14790
14834
|
`:null}
|
|
14791
14835
|
</div>
|
|
14792
|
-
`}};e([ce({type:Number,reflect:!0,attribute:!0})],
|
|
14836
|
+
`}};e([ce({type:Number,reflect:!0,attribute:!0})],pS.prototype,"colspan",void 0),e([ce({type:Number,reflect:!0,attribute:!0})],pS.prototype,"rowspan",void 0),e([ce({type:Boolean,reflect:!0,attribute:!0})],pS.prototype,"resizable",void 0),e([ce({type:String,reflect:!0,attribute:!0})],pS.prototype,"width",void 0),e([ce({type:String,reflect:!0,attribute:!0})],pS.prototype,"sticky",void 0),e([ce({type:Boolean,reflect:!0,attribute:!0})],pS.prototype,"lockWidth",void 0),pS=e([Ne("nile-grid-head-item")],pS);const xS=r`
|
|
14793
14837
|
:host {
|
|
14794
14838
|
--padding: var(--nile-spacing-xl, var(--ng-spacing-lg)) var(--nile-spacing-10px, var(--ng-spacing-3xl));
|
|
14795
14839
|
--height: 44px;
|
|
@@ -14865,7 +14909,7 @@ nile-badge::part(content) {
|
|
|
14865
14909
|
z-index: 1;
|
|
14866
14910
|
background-color: var(--nile-colors-white-base, var(--ng-colors-bg-primary));
|
|
14867
14911
|
}
|
|
14868
|
-
`;let
|
|
14912
|
+
`;let LS=class extends Re{constructor(){super(...arguments),this.colspan=1,this.rowspan=1,this.resizable=!1,this.onHandlePointerDown=e=>{const t=this,i={value:0},M={value:0},n=function(e,t,i,M){t.preventDefault(),t.stopPropagation();const n=Number(e.dataset.cStart);if(!n)return null;const o=Number(e.getAttribute("colspan"))||1,r=Math.max(0,n+o-1-1);i.value=t.clientX,M.value=e.getBoundingClientRect().width;const s=t.currentTarget;return s.setPointerCapture(t.pointerId),e.dispatchEvent(new CustomEvent("nile-column-resize",{detail:{col:r,widthPx:M.value},bubbles:!0,composed:!0})),e.dispatchEvent(new CustomEvent("nile-resize-start",{bubbles:!0,composed:!0})),{target:s,col:r}}(t,e,i,M);if(!n)return;const{target:o,col:r}=n,s=e=>function(e,t,i,M,n){const o=Math.max(40,Math.round(i+(n.clientX-M)));e.dispatchEvent(new CustomEvent("nile-column-resize",{detail:{col:t,widthPx:o},bubbles:!0,composed:!0}))}(t,r,M.value,i.value,e),a=()=>function(e,t,i,M,n){M.releasePointerCapture(i.pointerId),M.removeEventListener("pointermove",n),e.dispatchEvent(new CustomEvent("nile-resize-end",{bubbles:!0,composed:!0,detail:{col:t}}))}(t,r,e,o,s);o.addEventListener("pointermove",s),o.addEventListener("pointerup",a,{once:!0}),o.addEventListener("pointercancel",a,{once:!0})}}static get styles(){return[xS]}connectedCallback(){super.connectedCallback(),this.setAttribute("role","cell")}render(){return R`
|
|
14869
14913
|
<div class="cell-item-base" part="grid-cell-item-base">
|
|
14870
14914
|
<slot></slot>
|
|
14871
14915
|
${this.resizable?R`
|
|
@@ -14876,7 +14920,7 @@ nile-badge::part(content) {
|
|
|
14876
14920
|
></div>
|
|
14877
14921
|
`:null}
|
|
14878
14922
|
</div>
|
|
14879
|
-
`}};e([ce({type:Number,reflect:!0,attribute:!0})],
|
|
14923
|
+
`}};e([ce({type:Number,reflect:!0,attribute:!0})],LS.prototype,"colspan",void 0),e([ce({type:Number,reflect:!0,attribute:!0})],LS.prototype,"rowspan",void 0),e([ce({type:Boolean,reflect:!0,attribute:!0})],LS.prototype,"resizable",void 0),LS=e([Ne("nile-grid-cell-item")],LS);const SS=r`
|
|
14880
14924
|
:host([sticky]) {
|
|
14881
14925
|
position: sticky;
|
|
14882
14926
|
z-index: 2;
|
|
@@ -14888,11 +14932,11 @@ nile-badge::part(content) {
|
|
|
14888
14932
|
display: block;
|
|
14889
14933
|
}
|
|
14890
14934
|
}
|
|
14891
|
-
`;let
|
|
14935
|
+
`;let mS=class extends Re{constructor(){super(...arguments),this.sticky=!1}static get styles(){return[SS]}render(){return R`
|
|
14892
14936
|
<div part="grid-head-base">
|
|
14893
14937
|
<slot></slot>
|
|
14894
14938
|
</div>
|
|
14895
|
-
`}};e([ce({type:Boolean,reflect:!0,attribute:!0})],
|
|
14939
|
+
`}};e([ce({type:Boolean,reflect:!0,attribute:!0})],mS.prototype,"sticky",void 0),mS=e([Ne("nile-grid-head")],mS);let ES=class extends ae{createRenderRoot(){return this}shouldUpdate(){return!1}};ES=e([Ne("nile-rte-toolbar")],ES);let wS=class extends ae{constructor(){super(...arguments),this.name="",this.label=""}createRenderRoot(){return this}shouldUpdate(){return!1}};e([ce({type:String,attribute:!0,reflect:!0})],wS.prototype,"name",void 0),e([ce({type:String,attribute:!0,reflect:!0})],wS.prototype,"label",void 0),wS=e([Ne("nile-rte-toolbar-item")],wS);const QS=new Set(["p","h1","h2","h3","h4","h5","h6"]);function kS(e){return QS.has(e)}let CS=class extends ae{constructor(){super(...arguments),this.type="",this.options="[]",this.label="",this.selectedValue=""}createRenderRoot(){return this}mapAlignIcon(e){return{left:"format_align_left",center:"format_align_middle",right:"format_align_right",justify:"format_align_justify"}[e]||"format_align_left"}get parsedOptions(){const e=this.optionsObj??this.options;let t=(()=>{if(Array.isArray(e))return e;try{return JSON.parse(String(e))}catch{return[]}})();"align"===this.type&&0===t.length&&(t=[{value:"left",label:"Align Left"},{value:"center",label:"Align Center"},{value:"right",label:"Align Right"},{value:"justify",label:"Justify"}]);let i=t.map((e=>{const t=e?.value??e;return{value:t,label:e?.label??e?.value??e,icon:e?.icon??("align"===this.type?this.mapAlignIcon(String(t)):void 0)}}));if("heading"===this.type){i.length;i=i.filter((e=>kS(e.value))),i.length,this.selectedValue&&!kS(this.selectedValue)&&(this.selectedValue="")}return i}ensureDefault(){if(!this.selectedValue){const e=this.parsedOptions[0];e&&(this.selectedValue=e.value)}}onSelect(e){"heading"!==this.type||kS(e)?(this.selectedValue=e,this.dispatchEvent(new CustomEvent("change",{detail:e,bubbles:!0,composed:!0}))):console.warn(`[nile-rte-select] Ignoring invalid heading value: ${e}`)}connectedCallback(){super.connectedCallback(),this.injectLocalStyles()}injectLocalStyles(){if(this.querySelector("style[data-rte-select-style]"))return;const e=document.createElement("style");e.setAttribute("data-rte-select-style","true"),e.textContent="\n nile-menu.rte-align-menu::part(menu__items-wrapper) {\n display: flex;\n }\n nile-menu.rte-align-menu,\n nile-menu.rte-default-menu {\n margin-top: 0px;\n }\n nile-button.rte-align-trigger::part(base),\n nile-button.rte-default-trigger::part(base) {\n min-width: 32px;\n height: 32px;\n padding: 0px 6px;\n box-shadow: none;\n }\n nile-button.rte-align-trigger::part(base) {\n\n border: none;\n}\n\n \n ",this.insertBefore(e,this.firstChild)}render(){const e=this.parsedOptions;this.ensureDefault();const t=e.find((e=>e.value===this.selectedValue));if("align"===this.type){const i=t?.icon?R`<nile-icon name="${t.icon}"></nile-icon>`:this.label||"Align";return R`
|
|
14896
14940
|
<nile-dropdown class="rte-align-dd">
|
|
14897
14941
|
<nile-button
|
|
14898
14942
|
slot="trigger"
|
|
@@ -14957,7 +15001,7 @@ nile-badge::part(content) {
|
|
|
14957
15001
|
`))}
|
|
14958
15002
|
</nile-menu>
|
|
14959
15003
|
</nile-dropdown>
|
|
14960
|
-
`}};e([ce({type:String,attribute:!0,reflect:!0})],
|
|
15004
|
+
`}};e([ce({type:String,attribute:!0,reflect:!0})],CS.prototype,"type",void 0),e([ce({type:String,attribute:!0,reflect:!0})],CS.prototype,"options",void 0),e([ce({attribute:!1})],CS.prototype,"optionsObj",void 0),e([ce({type:String,attribute:!0,reflect:!0})],CS.prototype,"label",void 0),e([De()],CS.prototype,"selectedValue",void 0),CS=e([Ne("nile-rte-select")],CS);let bS=class extends ae{constructor(){super(...arguments),this.mode="foreColor",this.label="Text Color",this.value="#000000",this.palette=["#000000","#444444","#666666","#999999","#cccccc","#eeeeee","#ffffff","#d32f2f","#f44336","#ff9800","#ffeb3b","#4caf50","#2196f3","#3f51b5","#9c27b0","#03a9f4","#00bcd4","#009688","#8bc34a","#cddc39","#ffc107","#ff5722"],this.recentColors=[],this.pickCustom=()=>this.inputEl.click()}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.injectCss("\n nile-button.rte-color-trigger::part(base){\n width:32px; height:32px; padding:0px 6px;\n }\n\n .glyph-stack { display:grid; align-items:center; justify-items:center; line-height:1; }\n .glyph { font-size:14px; margin-bottom:2px; }\n .underline { width:18px; height:3px; border-radius:2px; }\n .swatch-box { width:18px; height:16px; border-radius:4px; border:1px solid rgba(0,0,0,0.35); }\n\n nile-popover::part(popover) {\n min-width: 225px;\n height: 250px;\n padding: 0px;\n gap: 0px;\n }\n\n .swatch-dropdown {\n height: 245px;\n width: 275px;\n padding: 12px;\n background: #fff;\n border-radius: 8px;\n box-sizing: border-box;\n overflow-y: auto;\n }\n\n .section { margin-bottom: 12px; }\n .title { font-size: 13px; font-weight: 600; margin-bottom: 8px; color:#111; }\n\n .swatches {\n display: grid;\n grid-template-columns: repeat(auto-fill, 24px);\n gap: 8px;\n }\n\n .swatch {\n width: 24px;\n height: 24px;\n border-radius: 50%;\n border: 1px solid rgba(0,0,0,0.25);\n cursor: pointer;\n position: relative;\n background-clip: content-box;\n }\n\n .swatch.add {\n display:flex;\n align-items:center;\n justify-content:center;\n font-weight:bold;\n font-size:16px;\n background:#fff;\n }\n\n .checkmark {\n position: absolute;\n top: 50%; left: 50%;\n transform: translate(-50%,-50%);\n font-size: 13px;\n color: white;\n text-shadow: 0 0 2px rgba(0,0,0,0.6);\n }\n "),this.inputEl=document.createElement("input"),this.inputEl.type="color",this.inputEl.style.position="absolute",this.inputEl.style.opacity="0",this.inputEl.style.pointerEvents="none",this.inputEl.value=this.value,this.appendChild(this.inputEl),this.inputEl.addEventListener("input",(()=>this.setColor(this.inputEl.value)))}injectCss(e){if(this.querySelector("style[data-rte-color-style]"))return;const t=document.createElement("style");t.setAttribute("data-rte-color-style","true"),t.textContent=e,this.insertBefore(t,this.firstChild)}setColor(e){this.value=e,this.recentColors=[e,...this.recentColors.filter((t=>t!==e))].slice(0,8),this.dispatchEvent(new CustomEvent("change",{detail:{mode:this.mode,value:e},bubbles:!0,composed:!0}))}render(){return R`
|
|
14961
15005
|
<nile-popover placement="bottom-start" distance="6" .arrow=${!1}>
|
|
14962
15006
|
<nile-button
|
|
14963
15007
|
slot="anchor"
|
|
@@ -15009,7 +15053,7 @@ nile-badge::part(content) {
|
|
|
15009
15053
|
</div>
|
|
15010
15054
|
</div>
|
|
15011
15055
|
</nile-popover>
|
|
15012
|
-
`}};e([ce({type:String,attribute:!0,reflect:!0})],vS.prototype,"mode",void 0),e([ce({type:String,attribute:!0,reflect:!0})],vS.prototype,"label",void 0),e([ce({type:String,attribute:!0,reflect:!0})],vS.prototype,"value",void 0),e([ce({type:Array,attribute:!0,reflect:!0})],vS.prototype,"palette",void 0),e([De()],vS.prototype,"recentColors",void 0),vS=e([Ne("nile-rte-color")],vS);let US=class extends ae{createRenderRoot(){return this}shouldUpdate(){return!1}};US=e([Ne("nile-rte-divider")],US);let YS=class extends ae{createRenderRoot(){return this}shouldUpdate(){return!1}};YS=e([Ne("nile-rte-preview")],YS);let ZS=class extends ae{constructor(){super(...arguments),this.displayFormat=!1,this.mentions={},this.mentionFormat={},this.itemsFormats={},this.mentionColors={},this.externalConfig={},this.itemsConfig={},this.mentionActiveIndex=-1,this.itemsColors={},this.editorEl=null,this.hostEl=null,this.dropdownEl=null,this.menuEl=null,this.lastRange=null,this.mentionOpen=!1,this.mentionTrigger=null,this.mentionQuery="",this.mentionSuggestions=[],this.mentionFiltered=[],this.mentionX=0,this.mentionY=0,this.triggerBtn=null,this.mo=null,this.onSelectionChange=()=>{if(!this.editorEl)return;const e=document.getSelection();if(!e||0===e.rangeCount)return;const t=e.getRangeAt(0);this.editorEl.contains(t.commonAncestorContainer)&&(this.lastRange=t.cloneRange())},this.saveSelection=()=>{const e=window.getSelection();e&&e.rangeCount&&(this.lastRange=e.getRangeAt(0).cloneRange())},this.onEditorInput=()=>{if(this.mentionOpen)return void this.handleMention();const e=window.getSelection();if(!e||!e.anchorNode)return;let t=e.anchorNode;if(t.nodeType!==Node.TEXT_NODE&&t.firstChild?.nodeType===Node.TEXT_NODE&&(t=t.firstChild),!t||t.nodeType!==Node.TEXT_NODE)return;const i=t.textContent||"",M=this.config;for(const t of Object.keys(M)){const M=i.lastIndexOf(t);if(-1!==M){const i=e.focusOffset;if(i>=M+t.length&&i<=M+t.length+1)return void this.openMention(t)}}},this.onEditorKeyUp=e=>{this.saveSelection();const t=e.key,i=this.config;if(t&&i[t])return this.mentionOpen&&this.mentionTrigger!==t&&this.closeMention(),void this.openMention(t);this.mentionOpen&&this.handleMention()},this.onEditorKeyDown=e=>{if(!this.mentionOpen)return;const t=e.key;if("ArrowDown"===t||"ArrowUp"===t){if(e.preventDefault(),!this.mentionFiltered.length)return;this.mentionActiveIndex="ArrowDown"===t?(this.mentionActiveIndex+1)%this.mentionFiltered.length:(this.mentionActiveIndex-1+this.mentionFiltered.length)%this.mentionFiltered.length,this.renderMentionList()}else"Enter"===t?this.mentionActiveIndex>=0&&this.mentionFiltered[this.mentionActiveIndex]&&(e.preventDefault(),this.selectMention(this.mentionFiltered[this.mentionActiveIndex])):"Escape"===t&&(e.preventDefault(),this.closeMention())},this.repositionMention=()=>{if(!this.mentionOpen||!this.hostEl||!this.triggerBtn)return;const e=this.getCaretClientRect();if(!e)return;const t=this.hostEl.getBoundingClientRect();this.mentionX=e.left-t.left,this.mentionY=e.bottom-t.top,this.triggerBtn.style.left=`${this.mentionX}px`,this.triggerBtn.style.top=`${this.mentionY}px`}}createRenderRoot(){return this}getTriggerFormat(e){const t=this.itemsFormats[e]||{},i=this.mentionFormat[e]||{};return{prefix:t.prefix??i.prefix??"",suffix:t.suffix??i.suffix??""}}formatLabel(e,t){const{prefix:i,suffix:M}=this.getTriggerFormat(e);return`${i??""}${t}${M??""}`}get config(){return{...this.externalConfig,...this.mentions,...this.itemsConfig}}attach(e,t){this.editorEl=e,this.hostEl=t,this.injectStyles(),this.ensureMentionDropdown(),this.rebuildConfigFromChildren(),this.mo=new MutationObserver((()=>this.rebuildConfigFromChildren())),this.mo.observe(this,{childList:!0,subtree:!0,attributes:!0}),this.editorEl.addEventListener("input",this.onEditorInput),this.editorEl.addEventListener("mouseup",this.saveSelection),this.editorEl.addEventListener("keyup",this.onEditorKeyUp),this.editorEl.addEventListener("keydown",this.onEditorKeyDown),this.editorEl.addEventListener("scroll",this.repositionMention),document.addEventListener("selectionchange",this.onSelectionChange,!0)}detach(){this.mo&&(this.mo.disconnect(),this.mo=null),this.editorEl&&(this.editorEl.removeEventListener("input",this.onEditorInput),this.editorEl.removeEventListener("mouseup",this.saveSelection),this.editorEl.removeEventListener("keyup",this.onEditorKeyUp),this.editorEl.removeEventListener("keydown",this.onEditorKeyDown),this.editorEl.removeEventListener("scroll",this.repositionMention)),document.removeEventListener("selectionchange",this.onSelectionChange,!0)}setExternalConfig(e){this.externalConfig=e||{}}disconnectedCallback(){this.detach(),super.disconnectedCallback()}rebuildConfigFromChildren(){const e={},t={},i={},M=Array.from(this.querySelectorAll("nile-rte-mentions-item"));for(const n of M){const M=n.mentionsCharacter??n.getAttribute("mentionscharacter")??"";if(!M||"string"!=typeof M)continue;let o=n.mentionsData??(()=>{const e=n.getAttribute("mentionsdata");if(!e)return null;try{const t=JSON.parse(e);return Array.isArray(t)?t.filter((e=>e&&"string"==typeof e.key&&"string"==typeof e.label)):[]}catch{return[]}})();const r=n.mentionsColor??n.getAttribute("mentionscolor")??"",s=n.mentionsPrefix??n.getAttribute("mentionsprefix")??"",a=n.mentionsSuffix??n.getAttribute("mentionssuffix")??"";Array.isArray(o)||(o=[]),e[M]=o,r&&(t[M]=String(r)),(s||a)&&(i[M]={prefix:s,suffix:a})}this.itemsConfig=e,this.itemsColors=t,this.itemsFormats=i}injectStyles(){if(this.querySelector("style[data-mentions-style]"))return;const e=document.createElement("style");e.setAttribute("data-mentions-style","true"),e.textContent="\n .mention-dropdown {\n position: absolute; z-index: 1000; list-style: none; margin: 0; padding: 4px;\n border: 1px solid #e5e7eb; border-radius: 6px; background: #fff;\n box-shadow: 0 4px 10px rgba(0,0,0,.08); max-height: 180px; overflow: auto; font-size: 14px;\n }\n .mention-dropdown li { padding: 6px 8px; cursor: pointer; border-radius: 4px; }\n .mention-dropdown li:hover { background: #f1f5f9; }\n .mention { background: #eef2ff; padding: 0 3px; border-radius: 3px; }\n nile-menu.mentions-menu::part(menu__items-wrapper){\n max-height: 260px;\n overflow-y: auto;\n }\n .mentions-menu nile-menu-item.active {\n background: #dbeafe; /* highlight */\n outline: none;\n}\n\n\n ",this.insertBefore(e,this.firstChild)}getTriggerColor(e){return this.itemsColors[e]??this.mentionColors[e]}ensureMentionDropdown(){if(this.dropdownEl||!this.hostEl)return;const e=document.createElement("nile-dropdown");e.style.zIndex="1000";const t=document.createElement("nile-button");t.setAttribute("slot","trigger"),t.style.position="absolute",t.style.width="1px",t.style.height="1px",t.style.border="0",t.style.padding="0",t.style.opacity="0",t.style.pointerEvents="none",e.appendChild(t),this.triggerBtn=t;const i=document.createElement("nile-menu");i.classList.add("mentions-menu"),e.appendChild(i),this.hostEl.appendChild(e),this.dropdownEl=e,this.menuEl=i}restoreSelection(){if(!this.lastRange)return;const e=document.getSelection();e&&(e.removeAllRanges(),e.addRange(this.lastRange))}getCaretClientRect(){const e=document.getSelection();if(!e||0===e.rangeCount)return null;const t=e.getRangeAt(0).cloneRange();t.collapse(!1);const i=t.getClientRects();if(i&&i.length>0)return i[0];const M=document.createElement("span");M.setAttribute("data-caret-marker","1"),M.textContent="",t.insertNode(M);const n=M.getBoundingClientRect(),o=document.createRange();return o.setStartAfter(M),o.collapse(!0),e.removeAllRanges(),e.addRange(o),M.remove(),n||null}openMention(e){if(this.saveSelection(),!this.editorEl||!this.dropdownEl||!this.hostEl)return;const t=this.getCaretClientRect();if(!t)return;const i=this.hostEl.getBoundingClientRect();this.mentionX=t.left-i.left,this.mentionY=t.bottom-i.top,this.mentionTrigger=e,this.mentionSuggestions=this.config[e]||[],this.mentionQuery="",this.updateMentionFiltered(),this.mentionActiveIndex=this.mentionFiltered.length?0:-1,this.mentionOpen=!0,this.renderMentionList(),this.dispatchEvent(new CustomEvent("nile-mention-opened",{detail:{trigger:e,suggestions:this.mentionSuggestions},bubbles:!0,composed:!0}))}closeMention(){this.mentionOpen=!1,this.mentionTrigger=null,this.mentionQuery="",this.mentionFiltered=[],this.dropdownEl?.removeAttribute("open")}handleMention(){if(!this.mentionOpen||!this.mentionTrigger)return;const e=window.getSelection();if(!e||!e.anchorNode)return;let t=e.anchorNode;if(t.nodeType!==Node.TEXT_NODE){const i=t.childNodes?.[e.anchorOffset]||t.firstChild;i?.nodeType===Node.TEXT_NODE&&(t=i)}const i=t&&t.nodeType===Node.TEXT_NODE&&t.textContent||"",M=i.lastIndexOf(this.mentionTrigger);M>=0?(this.mentionQuery=i.substring(M+1),this.updateMentionFiltered(),this.renderMentionList()):this.closeMention()}updateMentionFiltered(){const e=this.mentionQuery.toLowerCase();this.mentionFiltered=(this.mentionSuggestions||[]).filter((t=>t.label.toLowerCase().startsWith(e)))}renderMentionList(){this.dropdownEl&&this.menuEl&&this.triggerBtn&&(this.triggerBtn.style.left=`${this.mentionX}px`,this.triggerBtn.style.top=`${this.mentionY}px`,this.menuEl.innerHTML="",this.mentionOpen&&this.mentionFiltered.length?(this.mentionFiltered.forEach(((e,t)=>{const i=document.createElement("nile-menu-item");i.textContent=e.label,i.setAttribute("role","option"),t===this.mentionActiveIndex?(i.classList.add("active"),i.setAttribute("aria-selected","true")):(i.classList.remove("active"),i.removeAttribute("aria-selected")),i.addEventListener("mouseenter",(()=>{this.mentionActiveIndex=t,this.renderMentionList()})),i.addEventListener("pointerdown",(t=>{t.preventDefault(),this.selectMention(e)})),this.menuEl?.appendChild(i)})),this.dropdownEl.setAttribute("open","")):this.dropdownEl.removeAttribute("open"))}selectMention(e){if(this.restoreSelection(),!this.lastRange||!this.mentionTrigger||!this.editorEl)return;const t=this.mentionTrigger;let i=this.lastRange.startContainer,M=this.lastRange.startOffset;if(i.nodeType!==Node.TEXT_NODE){const e=i.childNodes[M];if(e?.nodeType!==Node.TEXT_NODE)return;i=e,M=0}const n=i,o=(n.textContent||"").lastIndexOf(this.mentionTrigger,M);if(o<0)return;const r=o+1+this.mentionQuery.length,s=document.createRange();s.setStart(n,o),s.setEnd(n,r),s.deleteContents();const a=document.createElement("span");a.classList.add("mention");const l=this.getTriggerFormat(this.mentionTrigger);this.displayFormat?a.textContent=`${l.prefix??""}${e.label}${l.suffix??""}`:(a.textContent=`${this.mentionTrigger}${e.label}`,l.prefix&&a.setAttribute("data-mention-prefix",l.prefix),l.suffix&&a.setAttribute("data-mention-suffix",l.suffix)),a.setAttribute("data-mention-key",e.key),a.setAttribute("data-mention-label",e.label),a.setAttribute("data-mention-trigger",this.mentionTrigger);const N=this.getTriggerColor(this.mentionTrigger);N&&(a.style.backgroundColor=N),s.insertNode(a);const g=document.createTextNode(" ");a.after(g);const u=window.getSelection(),c=document.createRange();c.setStartAfter(g),c.collapse(!0),u?.removeAllRanges(),u?.addRange(c),this.lastRange=c.cloneRange(),this.closeMention(),this.dispatchEvent(new CustomEvent("nile-mention-selected",{detail:{trigger:t,key:e.key,label:e.label,prefix:l.prefix??"",suffix:l.suffix??""},bubbles:!0,composed:!0})),this.editorEl.dispatchEvent(new InputEvent("input",{bubbles:!0}))}};e([ce({type:Boolean,attribute:"displayformat",reflect:!0})],ZS.prototype,"displayFormat",void 0),e([ce({attribute:"mentions",converter:{fromAttribute:e=>{try{const t=JSON.parse(e),i={};for(const e of Object.keys(t)){const M=t[e];Array.isArray(M)&&(i[e]=M.filter((e=>e&&"string"==typeof e.key&&"string"==typeof e.label)).map((e=>({key:e.key,label:e.label}))))}return i}catch{return{}}},toAttribute:e=>JSON.stringify(e)}})],ZS.prototype,"mentions",void 0),e([ce({attribute:"mentionformat",converter:{fromAttribute:e=>{try{const t=JSON.parse(e);return t&&"object"==typeof t?t:{}}catch{return{}}},toAttribute:e=>JSON.stringify(e??{})}})],ZS.prototype,"mentionFormat",void 0),e([De()],ZS.prototype,"itemsFormats",void 0),e([ce({attribute:"mentioncolors",converter:{fromAttribute:e=>{try{const t=JSON.parse(e);return t&&"object"==typeof t?t:{}}catch{return{}}},toAttribute:e=>JSON.stringify(e??{})}})],ZS.prototype,"mentionColors",void 0),e([De()],ZS.prototype,"externalConfig",void 0),e([De()],ZS.prototype,"itemsConfig",void 0),e([De()],ZS.prototype,"mentionActiveIndex",void 0),e([De()],ZS.prototype,"itemsColors",void 0),ZS=e([Ne("nile-rte-mentions")],ZS);let VS=class extends ae{constructor(){super(...arguments),this.newTab=!1,this.placeholder="Type or paste link here",this.label="Link",this.linkValue="",this.hasActiveLink=!1,this.popoverStyle="",this.selectionRange=null,this.activeAnchor=null,this.ignoreBlur=!1,this.isApplying=!1,this.onScroll=()=>{this.closePopover()}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.injectCss("\n nile-popover.rte-link-popover::part(popover) {\n min-width: 316px;\n background: white;\n border: 1px solid var(--nile-colors-neutral-400,var(--ng-componentcolors-utility-gray-400));\n border-radius: 4px;\n padding: 0;\n gap: 0;\n }\n\n .link-popup {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 6px 8px;\n }\n\n .link-input {\n flex: 1;\n padding: 6px 8px;\n font-size: 14px;\n width: 276px;\n height: 14px;\n padding: 12px;\n border: 1px solid var(--nile-colors-primary-600, var(--ng-colors-border-brand));\n border-radius: 4px;\n }\n nile-button.rte-link-button::part(base) {\n border: none;\n height: 32px; \n width: 32px;\n }\n nile-button.rte-edit-button::part(base) {\n border: none;\n height: 38px; \n width: 38px;\n }\n ")}injectCss(e){if(this.querySelector("style[data-rte-link-style]"))return;const t=document.createElement("style");t.setAttribute("data-rte-link-style","true"),t.textContent=e,this.insertBefore(t,this.firstChild)}normalizeUrl(e){return/^(https?:|mailto:|tel:)/i.test(e)?e:`https://${e}`}displayUrl(e){return e.replace(/^https?:\/\//i,"")}getSelectionRect(){if(!this.selectionRange)return null;let e=this.selectionRange.getBoundingClientRect();if(0===e.width&&0===e.height){const t=document.createElement("span");t.textContent="";this.selectionRange.cloneRange().insertNode(t),e=t.getBoundingClientRect(),t.remove()}return e}positionPopover(){const e=this.getSelectionRect();e&&(this.popoverStyle=`\n position: fixed;\n top: ${e.bottom+8}px;\n left: ${e.left+e.width/2}px;\n transform: translateX(-50%);\n z-index: 1000;\n `)}openPopover(){requestAnimationFrame((()=>{const e=this.querySelector("nile-popover");e&&(e.isShow=!0),window.addEventListener("scroll",this.onScroll,!0)}))}closePopover(){const e=this.querySelector("nile-popover");e&&(e.isShow=!1),window.removeEventListener("scroll",this.onScroll,!0),this.linkValue="",this.selectionRange=null,this.activeAnchor=null,this.hasActiveLink=!1,this.popoverStyle=""}unwrapLink(e){for(;e.firstChild;)e.parentNode?.insertBefore(e.firstChild,e);e.remove()}onOpen(){const e=document.getSelection();if(!e||0===e.rangeCount)return;this.selectionRange=e.getRangeAt(0).cloneRange(),this.activeAnchor=null,this.hasActiveLink=!1;let t=this.selectionRange.startContainer;for(;t&&t!==this.editorEl;){if(t instanceof HTMLAnchorElement){this.activeAnchor=t,this.hasActiveLink=!0;break}t=t.parentNode}this.linkValue=this.activeAnchor?this.displayUrl(this.activeAnchor.href):"",this.positionPopover(),this.openPopover(),requestAnimationFrame((()=>{this.querySelector(".link-input")?.focus()}))}onInputKeydown(e){if("Escape"===e.key||"Enter"===e.key)if(e.preventDefault(),e.stopPropagation(),"Escape"!==e.key){this.isApplying=!0;try{this.applyLink()}finally{this.isApplying=!1}}else this.closePopover()}onInputBlur(){this.ignoreBlur||this.isApplying||this.closePopover()}applyLink(){if(!(this.selectionRange instanceof Range))return;let e,t=this.linkValue.trim();if(!t)return;try{if(e=new URL(t,window.location.href),!["http:","https:","mailto:","tel:"].includes(e.protocol))return}catch{return}t=e.href,t=this.normalizeUrl(t),this.editorEl.focus();const i=document.getSelection();if(i){if(i.removeAllRanges(),i.addRange(this.selectionRange),this.activeAnchor)this.activeAnchor.href=t,this.newTab?(this.activeAnchor.target="_blank",this.activeAnchor.rel="noopener noreferrer"):(this.activeAnchor.removeAttribute("target"),this.activeAnchor.removeAttribute("rel"));else{const e=document.createElement("a");if(e.href=t,this.newTab?(e.target="_blank",e.rel="noopener noreferrer"):(e.removeAttribute("target"),e.removeAttribute("rel")),this.selectionRange.collapsed)e.textContent=t,this.selectionRange.insertNode(e);else try{this.selectionRange.surroundContents(e)}catch{const t=this.selectionRange.extractContents();e.appendChild(t),this.selectionRange.insertNode(e)}}this.emit(t),this.closePopover()}}onRemove(){this.activeAnchor&&(this.unwrapLink(this.activeAnchor),this.emit(""),this.closePopover())}emit(e){this.dispatchEvent(new CustomEvent("nile-link-changed",{detail:{href:e},bubbles:!0,composed:!0}))}render(){return R`
|
|
15056
|
+
`}};e([ce({type:String,attribute:!0,reflect:!0})],bS.prototype,"mode",void 0),e([ce({type:String,attribute:!0,reflect:!0})],bS.prototype,"label",void 0),e([ce({type:String,attribute:!0,reflect:!0})],bS.prototype,"value",void 0),e([ce({type:Array,attribute:!0,reflect:!0})],bS.prototype,"palette",void 0),e([De()],bS.prototype,"recentColors",void 0),bS=e([Ne("nile-rte-color")],bS);let fS=class extends ae{createRenderRoot(){return this}shouldUpdate(){return!1}};fS=e([Ne("nile-rte-divider")],fS);let vS=class extends ae{createRenderRoot(){return this}shouldUpdate(){return!1}};vS=e([Ne("nile-rte-preview")],vS);let US=class extends ae{constructor(){super(...arguments),this.displayFormat=!1,this.mentions={},this.mentionFormat={},this.itemsFormats={},this.mentionColors={},this.externalConfig={},this.itemsConfig={},this.mentionActiveIndex=-1,this.itemsColors={},this.editorEl=null,this.hostEl=null,this.dropdownEl=null,this.menuEl=null,this.lastRange=null,this.mentionOpen=!1,this.mentionTrigger=null,this.mentionQuery="",this.mentionSuggestions=[],this.mentionFiltered=[],this.mentionX=0,this.mentionY=0,this.triggerBtn=null,this.mo=null,this.onSelectionChange=()=>{if(!this.editorEl)return;const e=document.getSelection();if(!e||0===e.rangeCount)return;const t=e.getRangeAt(0);this.editorEl.contains(t.commonAncestorContainer)&&(this.lastRange=t.cloneRange())},this.saveSelection=()=>{const e=window.getSelection();e&&e.rangeCount&&(this.lastRange=e.getRangeAt(0).cloneRange())},this.onEditorInput=()=>{if(this.mentionOpen)return void this.handleMention();const e=window.getSelection();if(!e||!e.anchorNode)return;let t=e.anchorNode;if(t.nodeType!==Node.TEXT_NODE&&t.firstChild?.nodeType===Node.TEXT_NODE&&(t=t.firstChild),!t||t.nodeType!==Node.TEXT_NODE)return;const i=t.textContent||"",M=this.config;for(const t of Object.keys(M)){const M=i.lastIndexOf(t);if(-1!==M){const i=e.focusOffset;if(i>=M+t.length&&i<=M+t.length+1)return void this.openMention(t)}}},this.onEditorKeyUp=e=>{this.saveSelection();const t=e.key,i=this.config;if(t&&i[t])return this.mentionOpen&&this.mentionTrigger!==t&&this.closeMention(),void this.openMention(t);this.mentionOpen&&this.handleMention()},this.onEditorKeyDown=e=>{if(!this.mentionOpen)return;const t=e.key;if("ArrowDown"===t||"ArrowUp"===t){if(e.preventDefault(),!this.mentionFiltered.length)return;this.mentionActiveIndex="ArrowDown"===t?(this.mentionActiveIndex+1)%this.mentionFiltered.length:(this.mentionActiveIndex-1+this.mentionFiltered.length)%this.mentionFiltered.length,this.renderMentionList()}else"Enter"===t?this.mentionActiveIndex>=0&&this.mentionFiltered[this.mentionActiveIndex]&&(e.preventDefault(),this.selectMention(this.mentionFiltered[this.mentionActiveIndex])):"Escape"===t&&(e.preventDefault(),this.closeMention())},this.repositionMention=()=>{if(!this.mentionOpen||!this.hostEl||!this.triggerBtn)return;const e=this.getCaretClientRect();if(!e)return;const t=this.hostEl.getBoundingClientRect();this.mentionX=e.left-t.left,this.mentionY=e.bottom-t.top,this.triggerBtn.style.left=`${this.mentionX}px`,this.triggerBtn.style.top=`${this.mentionY}px`}}createRenderRoot(){return this}getTriggerFormat(e){const t=this.itemsFormats[e]||{},i=this.mentionFormat[e]||{};return{prefix:t.prefix??i.prefix??"",suffix:t.suffix??i.suffix??""}}formatLabel(e,t){const{prefix:i,suffix:M}=this.getTriggerFormat(e);return`${i??""}${t}${M??""}`}get config(){return{...this.externalConfig,...this.mentions,...this.itemsConfig}}attach(e,t){this.editorEl=e,this.hostEl=t,this.injectStyles(),this.ensureMentionDropdown(),this.rebuildConfigFromChildren(),this.mo=new MutationObserver((()=>this.rebuildConfigFromChildren())),this.mo.observe(this,{childList:!0,subtree:!0,attributes:!0}),this.editorEl.addEventListener("input",this.onEditorInput),this.editorEl.addEventListener("mouseup",this.saveSelection),this.editorEl.addEventListener("keyup",this.onEditorKeyUp),this.editorEl.addEventListener("keydown",this.onEditorKeyDown),this.editorEl.addEventListener("scroll",this.repositionMention),document.addEventListener("selectionchange",this.onSelectionChange,!0)}detach(){this.mo&&(this.mo.disconnect(),this.mo=null),this.editorEl&&(this.editorEl.removeEventListener("input",this.onEditorInput),this.editorEl.removeEventListener("mouseup",this.saveSelection),this.editorEl.removeEventListener("keyup",this.onEditorKeyUp),this.editorEl.removeEventListener("keydown",this.onEditorKeyDown),this.editorEl.removeEventListener("scroll",this.repositionMention)),document.removeEventListener("selectionchange",this.onSelectionChange,!0)}setExternalConfig(e){this.externalConfig=e||{}}disconnectedCallback(){this.detach(),super.disconnectedCallback()}rebuildConfigFromChildren(){const e={},t={},i={},M=Array.from(this.querySelectorAll("nile-rte-mentions-item"));for(const n of M){const M=n.mentionsCharacter??n.getAttribute("mentionscharacter")??"";if(!M||"string"!=typeof M)continue;let o=n.mentionsData??(()=>{const e=n.getAttribute("mentionsdata");if(!e)return null;try{const t=JSON.parse(e);return Array.isArray(t)?t.filter((e=>e&&"string"==typeof e.key&&"string"==typeof e.label)):[]}catch{return[]}})();const r=n.mentionsColor??n.getAttribute("mentionscolor")??"",s=n.mentionsPrefix??n.getAttribute("mentionsprefix")??"",a=n.mentionsSuffix??n.getAttribute("mentionssuffix")??"";Array.isArray(o)||(o=[]),e[M]=o,r&&(t[M]=String(r)),(s||a)&&(i[M]={prefix:s,suffix:a})}this.itemsConfig=e,this.itemsColors=t,this.itemsFormats=i}injectStyles(){if(this.querySelector("style[data-mentions-style]"))return;const e=document.createElement("style");e.setAttribute("data-mentions-style","true"),e.textContent="\n .mention-dropdown {\n position: absolute; z-index: 1000; list-style: none; margin: 0; padding: 4px;\n border: 1px solid #e5e7eb; border-radius: 6px; background: #fff;\n box-shadow: 0 4px 10px rgba(0,0,0,.08); max-height: 180px; overflow: auto; font-size: 14px;\n }\n .mention-dropdown li { padding: 6px 8px; cursor: pointer; border-radius: 4px; }\n .mention-dropdown li:hover { background: #f1f5f9; }\n .mention { background: #eef2ff; padding: 0 3px; border-radius: 3px; }\n nile-menu.mentions-menu::part(menu__items-wrapper){\n max-height: 260px;\n overflow-y: auto;\n }\n .mentions-menu nile-menu-item.active {\n background: #dbeafe; /* highlight */\n outline: none;\n}\n\n\n ",this.insertBefore(e,this.firstChild)}getTriggerColor(e){return this.itemsColors[e]??this.mentionColors[e]}ensureMentionDropdown(){if(this.dropdownEl||!this.hostEl)return;const e=document.createElement("nile-dropdown");e.style.zIndex="1000";const t=document.createElement("nile-button");t.setAttribute("slot","trigger"),t.style.position="absolute",t.style.width="1px",t.style.height="1px",t.style.border="0",t.style.padding="0",t.style.opacity="0",t.style.pointerEvents="none",e.appendChild(t),this.triggerBtn=t;const i=document.createElement("nile-menu");i.classList.add("mentions-menu"),e.appendChild(i),this.hostEl.appendChild(e),this.dropdownEl=e,this.menuEl=i}restoreSelection(){if(!this.lastRange)return;const e=document.getSelection();e&&(e.removeAllRanges(),e.addRange(this.lastRange))}getCaretClientRect(){const e=document.getSelection();if(!e||0===e.rangeCount)return null;const t=e.getRangeAt(0).cloneRange();t.collapse(!1);const i=t.getClientRects();if(i&&i.length>0)return i[0];const M=document.createElement("span");M.setAttribute("data-caret-marker","1"),M.textContent="",t.insertNode(M);const n=M.getBoundingClientRect(),o=document.createRange();return o.setStartAfter(M),o.collapse(!0),e.removeAllRanges(),e.addRange(o),M.remove(),n||null}openMention(e){if(this.saveSelection(),!this.editorEl||!this.dropdownEl||!this.hostEl)return;const t=this.getCaretClientRect();if(!t)return;const i=this.hostEl.getBoundingClientRect();this.mentionX=t.left-i.left,this.mentionY=t.bottom-i.top,this.mentionTrigger=e,this.mentionSuggestions=this.config[e]||[],this.mentionQuery="",this.updateMentionFiltered(),this.mentionActiveIndex=this.mentionFiltered.length?0:-1,this.mentionOpen=!0,this.renderMentionList(),this.dispatchEvent(new CustomEvent("nile-mention-opened",{detail:{trigger:e,suggestions:this.mentionSuggestions},bubbles:!0,composed:!0}))}closeMention(){this.mentionOpen=!1,this.mentionTrigger=null,this.mentionQuery="",this.mentionFiltered=[],this.dropdownEl?.removeAttribute("open")}handleMention(){if(!this.mentionOpen||!this.mentionTrigger)return;const e=window.getSelection();if(!e||!e.anchorNode)return;let t=e.anchorNode;if(t.nodeType!==Node.TEXT_NODE){const i=t.childNodes?.[e.anchorOffset]||t.firstChild;i?.nodeType===Node.TEXT_NODE&&(t=i)}const i=t&&t.nodeType===Node.TEXT_NODE&&t.textContent||"",M=i.lastIndexOf(this.mentionTrigger);M>=0?(this.mentionQuery=i.substring(M+1),this.updateMentionFiltered(),this.renderMentionList()):this.closeMention()}updateMentionFiltered(){const e=this.mentionQuery.toLowerCase();this.mentionFiltered=(this.mentionSuggestions||[]).filter((t=>t.label.toLowerCase().startsWith(e)))}renderMentionList(){this.dropdownEl&&this.menuEl&&this.triggerBtn&&(this.triggerBtn.style.left=`${this.mentionX}px`,this.triggerBtn.style.top=`${this.mentionY}px`,this.menuEl.innerHTML="",this.mentionOpen&&this.mentionFiltered.length?(this.mentionFiltered.forEach(((e,t)=>{const i=document.createElement("nile-menu-item");i.textContent=e.label,i.setAttribute("role","option"),t===this.mentionActiveIndex?(i.classList.add("active"),i.setAttribute("aria-selected","true")):(i.classList.remove("active"),i.removeAttribute("aria-selected")),i.addEventListener("mouseenter",(()=>{this.mentionActiveIndex=t,this.renderMentionList()})),i.addEventListener("pointerdown",(t=>{t.preventDefault(),this.selectMention(e)})),this.menuEl?.appendChild(i)})),this.dropdownEl.setAttribute("open","")):this.dropdownEl.removeAttribute("open"))}selectMention(e){if(this.restoreSelection(),!this.lastRange||!this.mentionTrigger||!this.editorEl)return;const t=this.mentionTrigger;let i=this.lastRange.startContainer,M=this.lastRange.startOffset;if(i.nodeType!==Node.TEXT_NODE){const e=i.childNodes[M];if(e?.nodeType!==Node.TEXT_NODE)return;i=e,M=0}const n=i,o=(n.textContent||"").lastIndexOf(this.mentionTrigger,M);if(o<0)return;const r=o+1+this.mentionQuery.length,s=document.createRange();s.setStart(n,o),s.setEnd(n,r),s.deleteContents();const a=document.createElement("span");a.classList.add("mention");const l=this.getTriggerFormat(this.mentionTrigger);this.displayFormat?a.textContent=`${l.prefix??""}${e.label}${l.suffix??""}`:(a.textContent=`${this.mentionTrigger}${e.label}`,l.prefix&&a.setAttribute("data-mention-prefix",l.prefix),l.suffix&&a.setAttribute("data-mention-suffix",l.suffix)),a.setAttribute("data-mention-key",e.key),a.setAttribute("data-mention-label",e.label),a.setAttribute("data-mention-trigger",this.mentionTrigger);const N=this.getTriggerColor(this.mentionTrigger);N&&(a.style.backgroundColor=N),s.insertNode(a);const g=document.createTextNode(" ");a.after(g);const u=window.getSelection(),c=document.createRange();c.setStartAfter(g),c.collapse(!0),u?.removeAllRanges(),u?.addRange(c),this.lastRange=c.cloneRange(),this.closeMention(),this.dispatchEvent(new CustomEvent("nile-mention-selected",{detail:{trigger:t,key:e.key,label:e.label,prefix:l.prefix??"",suffix:l.suffix??""},bubbles:!0,composed:!0})),this.editorEl.dispatchEvent(new InputEvent("input",{bubbles:!0}))}};e([ce({type:Boolean,attribute:"displayformat",reflect:!0})],US.prototype,"displayFormat",void 0),e([ce({attribute:"mentions",converter:{fromAttribute:e=>{try{const t=JSON.parse(e),i={};for(const e of Object.keys(t)){const M=t[e];Array.isArray(M)&&(i[e]=M.filter((e=>e&&"string"==typeof e.key&&"string"==typeof e.label)).map((e=>({key:e.key,label:e.label}))))}return i}catch{return{}}},toAttribute:e=>JSON.stringify(e)}})],US.prototype,"mentions",void 0),e([ce({attribute:"mentionformat",converter:{fromAttribute:e=>{try{const t=JSON.parse(e);return t&&"object"==typeof t?t:{}}catch{return{}}},toAttribute:e=>JSON.stringify(e??{})}})],US.prototype,"mentionFormat",void 0),e([De()],US.prototype,"itemsFormats",void 0),e([ce({attribute:"mentioncolors",converter:{fromAttribute:e=>{try{const t=JSON.parse(e);return t&&"object"==typeof t?t:{}}catch{return{}}},toAttribute:e=>JSON.stringify(e??{})}})],US.prototype,"mentionColors",void 0),e([De()],US.prototype,"externalConfig",void 0),e([De()],US.prototype,"itemsConfig",void 0),e([De()],US.prototype,"mentionActiveIndex",void 0),e([De()],US.prototype,"itemsColors",void 0),US=e([Ne("nile-rte-mentions")],US);let YS=class extends ae{constructor(){super(...arguments),this.newTab=!1,this.placeholder="Type or paste link here",this.label="Link",this.linkValue="",this.hasActiveLink=!1,this.popoverStyle="",this.selectionRange=null,this.activeAnchor=null,this.ignoreBlur=!1,this.isApplying=!1,this.onScroll=()=>{this.closePopover()}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.injectCss("\n nile-popover.rte-link-popover::part(popover) {\n min-width: 316px;\n background: white;\n border: 1px solid var(--nile-colors-neutral-400,var(--ng-componentcolors-utility-gray-400));\n border-radius: 4px;\n padding: 0;\n gap: 0;\n }\n\n .link-popup {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 6px 8px;\n }\n\n .link-input {\n flex: 1;\n padding: 6px 8px;\n font-size: 14px;\n width: 276px;\n height: 14px;\n padding: 12px;\n border: 1px solid var(--nile-colors-primary-600, var(--ng-colors-border-brand));\n border-radius: 4px;\n }\n nile-button.rte-link-button::part(base) {\n border: none;\n height: 32px; \n width: 32px;\n }\n nile-button.rte-edit-button::part(base) {\n border: none;\n height: 38px; \n width: 38px;\n }\n ")}injectCss(e){if(this.querySelector("style[data-rte-link-style]"))return;const t=document.createElement("style");t.setAttribute("data-rte-link-style","true"),t.textContent=e,this.insertBefore(t,this.firstChild)}normalizeUrl(e){return/^(https?:|mailto:|tel:)/i.test(e)?e:`https://${e}`}displayUrl(e){return e.replace(/^https?:\/\//i,"")}getSelectionRect(){if(!this.selectionRange)return null;let e=this.selectionRange.getBoundingClientRect();if(0===e.width&&0===e.height){const t=document.createElement("span");t.textContent="";this.selectionRange.cloneRange().insertNode(t),e=t.getBoundingClientRect(),t.remove()}return e}positionPopover(){const e=this.getSelectionRect();e&&(this.popoverStyle=`\n position: fixed;\n top: ${e.bottom+8}px;\n left: ${e.left+e.width/2}px;\n transform: translateX(-50%);\n z-index: 1000;\n `)}openPopover(){requestAnimationFrame((()=>{const e=this.querySelector("nile-popover");e&&(e.isShow=!0),window.addEventListener("scroll",this.onScroll,!0)}))}closePopover(){const e=this.querySelector("nile-popover");e&&(e.isShow=!1),window.removeEventListener("scroll",this.onScroll,!0),this.linkValue="",this.selectionRange=null,this.activeAnchor=null,this.hasActiveLink=!1,this.popoverStyle=""}unwrapLink(e){for(;e.firstChild;)e.parentNode?.insertBefore(e.firstChild,e);e.remove()}onOpen(){const e=document.getSelection();if(!e||0===e.rangeCount)return;this.selectionRange=e.getRangeAt(0).cloneRange(),this.activeAnchor=null,this.hasActiveLink=!1;let t=this.selectionRange.startContainer;for(;t&&t!==this.editorEl;){if(t instanceof HTMLAnchorElement){this.activeAnchor=t,this.hasActiveLink=!0;break}t=t.parentNode}this.linkValue=this.activeAnchor?this.displayUrl(this.activeAnchor.href):"",this.positionPopover(),this.openPopover(),requestAnimationFrame((()=>{this.querySelector(".link-input")?.focus()}))}onInputKeydown(e){if("Escape"===e.key||"Enter"===e.key)if(e.preventDefault(),e.stopPropagation(),"Escape"!==e.key){this.isApplying=!0;try{this.applyLink()}finally{this.isApplying=!1}}else this.closePopover()}onInputBlur(){this.ignoreBlur||this.isApplying||this.closePopover()}applyLink(){if(!(this.selectionRange instanceof Range))return;let e,t=this.linkValue.trim();if(!t)return;try{if(e=new URL(t,window.location.href),!["http:","https:","mailto:","tel:"].includes(e.protocol))return}catch{return}t=e.href,t=this.normalizeUrl(t),this.editorEl.focus();const i=document.getSelection();if(i){if(i.removeAllRanges(),i.addRange(this.selectionRange),this.activeAnchor)this.activeAnchor.href=t,this.newTab?(this.activeAnchor.target="_blank",this.activeAnchor.rel="noopener noreferrer"):(this.activeAnchor.removeAttribute("target"),this.activeAnchor.removeAttribute("rel"));else{const e=document.createElement("a");if(e.href=t,this.newTab?(e.target="_blank",e.rel="noopener noreferrer"):(e.removeAttribute("target"),e.removeAttribute("rel")),this.selectionRange.collapsed)e.textContent=t,this.selectionRange.insertNode(e);else try{this.selectionRange.surroundContents(e)}catch{const t=this.selectionRange.extractContents();e.appendChild(t),this.selectionRange.insertNode(e)}}this.emit(t),this.closePopover()}}onRemove(){this.activeAnchor&&(this.unwrapLink(this.activeAnchor),this.emit(""),this.closePopover())}emit(e){this.dispatchEvent(new CustomEvent("nile-link-changed",{detail:{href:e},bubbles:!0,composed:!0}))}render(){return R`
|
|
15013
15057
|
<nile-lite-tooltip content=${this.label}>
|
|
15014
15058
|
<nile-button
|
|
15015
15059
|
variant="tertiary"
|
|
@@ -15060,7 +15104,7 @@ nile-badge::part(content) {
|
|
|
15060
15104
|
`:null}
|
|
15061
15105
|
</div>
|
|
15062
15106
|
</nile-popover>
|
|
15063
|
-
`}};function WS(e,t){for(;e&&e!==t;){if(e instanceof HTMLElement){const t=getComputedStyle(e).display;if(e.tagName.match(/^(P|DIV|H1|H2|H3|H4|H5|H6|LI)$/)||"block"===t||"list-item"===t)return e}e=e?.parentNode||null}return t}function PS(e,t){const i=window.getSelection();if(!i||0===i.rangeCount)return;const M=i.getRangeAt(0),n=M.commonAncestorContainer,o=[],r=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t=e;return M.intersectsNode(t)&&/^(P|DIV|LI|H[1-6])$/.test(t.tagName)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let s=r.nextNode();for(;s;)o.push(s),s=r.nextNode();if(0===o.length){const t=WS(i.focusNode,e);t&&o.push(t)}o.forEach((e=>{e.style.textAlign=t}))}function RS(e,t,i){const M=window.getSelection();if(!M||0===M.rangeCount)return;const n=M.getRangeAt(0),o={strong:["strong","b"],em:["em","i"],u:["u"],span:["span"]}[t]??[t],r=e=>o.includes(e.tagName.toLowerCase());function s(e){const t=e.parentNode;if(t){for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}}function a(e){e.querySelectorAll(o.join(",")).forEach((e=>{if(!e.textContent?.trim())return void e.remove();Array.from(e.querySelectorAll(o.join(","))).forEach((t=>{if(t!==e){for(;t.firstChild;)e.insertBefore(t.firstChild,t);t.remove()}}))}))}function l(e){Array.from(e.querySelectorAll(o.join(","))).forEach((e=>{const t=e.nextSibling;if(t instanceof HTMLElement&&r(t)){for(;t.firstChild;)e.appendChild(t.firstChild);t.remove()}}))}if(n.collapsed){let o=!1,N=n.startContainer;for(;N&&N!==e;){if(N instanceof HTMLElement&&r(N)){o=!0;break}N=N.parentNode}if(o&&N instanceof HTMLElement)s(N);else{const e=document.createElement(t);i&&Object.entries(i).forEach((([t,i])=>e.setAttribute(t,i))),e.appendChild(document.createTextNode("")),n.insertNode(e),n.setStart(e.firstChild,1),n.collapse(!0),M.removeAllRanges(),M.addRange(n)}return a(e),void l(e)}n.startContainer.nodeType===Node.TEXT_NODE&&n.startContainer.splitText(n.startOffset),n.endContainer.nodeType===Node.TEXT_NODE&&n.endContainer.splitText(n.endOffset);const N=document.createTreeWalker(n.commonAncestorContainer,NodeFilter.SHOW_TEXT,{acceptNode:e=>{if(!e.nodeValue?.trim())return NodeFilter.FILTER_REJECT;const t=document.createRange();t.selectNodeContents(e);return n.compareBoundaryPoints(Range.END_TO_START,t)<0&&n.compareBoundaryPoints(Range.START_TO_END,t)>0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}}),g=[];let u;for(;u=N.nextNode();)g.push(u);const c=g.length>0&&g.every((t=>{let i=t;for(;i&&i!==e;){if(i instanceof HTMLElement&&r(i))return!0;i=i.parentNode}return!1}));if(c){const i=g[0],M=g[g.length-1],n=i.parentElement?.closest(t);if(n&&n.contains(M)){const e=n.parentNode;if(e){const o=document.createRange();o.setStartBefore(n),o.setEndBefore(i);const r=o.cloneContents(),s=document.createRange();s.setStartAfter(M),s.setEndAfter(n);const a=s.cloneContents(),l=document.createRange();l.setStartBefore(i),l.setEndAfter(M);const N=l.extractContents(),g=document.createDocumentFragment();if(r.childNodes.length){const e=document.createElement(t);for(;r.firstChild;)e.appendChild(r.firstChild);g.appendChild(e)}for(;N.firstChild;)g.appendChild(N.firstChild);if(a.childNodes.length){const e=document.createElement(t);for(;a.firstChild;)e.appendChild(a.firstChild);g.appendChild(e)}e.insertBefore(g,n),e.removeChild(n)}}else g.forEach((t=>{let i=t;for(;i&&i!==e;){if(i instanceof HTMLElement&&r(i)){s(i);break}i=i.parentNode}}))}else g.forEach((e=>{const M=e.parentElement?.closest("a, .mention, nile-mention");if(M)return;const n=document.createElement(t);i&&Object.entries(i).forEach((([e,t])=>n.setAttribute(e,t))),e.parentNode?.insertBefore(n,e),n.appendChild(e)}));a(e),l(e),M.removeAllRanges(),M.addRange(n)}function BS(e){const t=e.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/i);if(!t)return"#000000";return`#${Number(t[1]).toString(16).padStart(2,"0")}${Number(t[2]).toString(16).padStart(2,"0")}${Number(t[3]).toString(16).padStart(2,"0")}`}function GS(e,t){const i=document.getSelection();if(!i||0===i.rangeCount)return;const M=i.getRangeAt(0);if(M.collapsed){const e=document.createElement("span");e.style.fontFamily=t,e.appendChild(document.createTextNode("")),M.insertNode(e);const n=document.createRange();return n.setStart(e.firstChild,1),n.collapse(!0),i.removeAllRanges(),void i.addRange(n)}!function(e,t,i){const M=document.createElement(t);i&&Object.entries(i).forEach((([e,t])=>M.setAttribute(e,t)));try{e.surroundContents(M)}catch{const t=e.extractContents();M.appendChild(t),e.insertNode(M)}}(M,"span",{style:`font-family:${t}`})}function _S(e,t,i){for(;t&&t!==e;){if(t instanceof HTMLSpanElement&&t.hasAttribute(i))return t;t=t.parentNode}return null}function FS(e,t,i,M){const n=window.getSelection();if(!n||0===n.rangeCount)return;const o=n.getRangeAt(0);if(!e.contains(o.commonAncestorContainer))return;const r=o.cloneRange();if(r.collapsed){const o=_S(e,r.startContainer,M);if(o)return o.style[t]=i,void HS(e,M,t);const s=document.createElement("span");s.setAttribute(M,"1"),s.style[t]=i,s.appendChild(document.createTextNode("")),r.insertNode(s);const a=document.createRange();return a.setStart(s.firstChild,1),a.collapse(!0),n.removeAllRanges(),n.addRange(a),void HS(e,M,t)}const s=_S(e,r.startContainer,M),a=_S(e,r.endContainer,M);if(s&&s===a){if(function(e,t){const i=document.createRange();return i.selectNodeContents(t),e.compareBoundaryPoints(Range.START_TO_START,i)<=0&&e.compareBoundaryPoints(Range.END_TO_END,i)>=0}(r,s))s.style[t]=i;else{const e=function(e,t,i,M,n){const o=e.style[M],r=document.createRange();r.setStart(e,0),r.setEnd(t.startContainer,t.startOffset);const s=document.createRange();s.setStart(t.endContainer,t.endOffset),s.setEnd(e,e.childNodes.length);const a=document.createDocumentFragment(),l=e=>{const t=document.createElement("span");return t.setAttribute(i,"1"),t.style[M]=e,t};if(JS(r)){const e=l(o);e.appendChild(r.cloneContents()),a.appendChild(e)}const N=l(n);if(N.appendChild(t.cloneContents()),a.appendChild(N),JS(s)){const e=l(o);e.appendChild(s.cloneContents()),a.appendChild(e)}return e.replaceWith(a),N}(s,r,M,t,i),n=window.getSelection(),o=document.createRange();o.selectNodeContents(e),n?.removeAllRanges(),n?.addRange(o)}return void HS(e,M,t)}const l=(()=>{let e=r.commonAncestorContainer;for(;e&&!(e instanceof HTMLElement);)e=e.parentNode;return e})(),N=document.createTreeWalker(l||e,NodeFilter.SHOW_TEXT,{acceptNode:e=>{if(!e.nodeValue||!e.nodeValue.trim())return NodeFilter.FILTER_REJECT;const t=document.createRange();t.selectNodeContents(e);return r.compareBoundaryPoints(Range.END_TO_START,t)<0&&r.compareBoundaryPoints(Range.START_TO_END,t)>0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}}),g=[];let u;for(;u=N.nextNode();)g.push(u);g.forEach((n=>{let o=0,s=n.length;n===r.startContainer&&(o=r.startOffset),n===r.endContainer&&(s=r.endOffset),o>0&&(n=n.splitText(o)),s<n.length&&n.splitText(s);const a=_S(e,n,M);if(a)return void(a.style[t]=i);const l=document.createElement("span");l.setAttribute(M,"1"),l.style[t]=i;n.parentElement.replaceChild(l,n),l.appendChild(n)})),HS(e,M,t),n.removeAllRanges(),n.addRange(r)}function HS(e,t,i){const M=Array.from(e.querySelectorAll(`span[${t}]`)),n=e=>e.style[i];M.forEach((e=>{Array.from(e.querySelectorAll(`span[${t}]`)).forEach((t=>{if(n(t)===n(e)){for(;t.firstChild;)e.insertBefore(t.firstChild,t);t.remove()}}));const i=e.previousSibling;if(i instanceof HTMLSpanElement&&i.hasAttribute(t)&&n(i)===n(e)){for(;e.firstChild;)i.appendChild(e.firstChild);return void e.remove()}const M=e.nextSibling;if(M instanceof HTMLSpanElement&&M.hasAttribute(t)&&n(M)===n(e)){for(;M.firstChild;)e.appendChild(M.firstChild);M.remove()}}))}function JS(e){if(e.collapsed)return!1;return(e.cloneContents().textContent||"").length>0}function $S(e,t){const i=document.getSelection();if(!i||0===i.rangeCount)return;const M=i.getRangeAt(0);function n(e){e.style.paddingInlineStart="0",e.style.margin="0"}function o(e){const t=document.getSelection();if(!t)return;const i=document.createRange();i.selectNodeContents(e),i.collapse(!0),t.removeAllRanges(),t.addRange(i)}function r(t){for(;t&&t!==e;){if(t instanceof HTMLElement){const e=getComputedStyle(t).display;if(t.tagName.match(/^(P|DIV|H[1-6]|LI)$/)||"block"===e||"list-item"===e)return t}t=t.parentNode}return null}function s(e,t){const i=document.createElement(t);for(n(i);e.firstChild;)i.appendChild(e.firstChild);e.replaceWith(i)}if(M.collapsed){const i=r(M.startContainer),l=i?.closest("ul,ol");if(l&&l.tagName.toLowerCase()===t)return void function(e){const t=e.closest("li");if(!t)return;const i=t.parentElement,M=document.createElement("p");for(t.style.textAlign&&(M.style.textAlign=t.style.textAlign);t.firstChild;)M.appendChild(t.firstChild);i.parentNode?.insertBefore(M,i.nextSibling),t.remove(),0===i.childNodes.length&&i.remove(),o(M)}(i);if(l&&l.tagName.toLowerCase()!==t)return void s(l,t);if(!i||i===e||0===i.childNodes.length||(a=i,!a.textContent?.trim()&&!a.querySelector("img,br"))){const e=document.createElement(t),i=document.createElement("li");return i.appendChild(document.createElement("br")),e.appendChild(i),n(e),M.insertNode(e),void o(i)}const N=document.createElement(t);n(N);const g=document.createElement("li");for(i.style.textAlign&&(g.style.textAlign=i.style.textAlign);i.firstChild;)g.appendChild(i.firstChild);return N.appendChild(g),i.replaceWith(N),void o(g)}var a;const l=[],N=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{if(!(e instanceof HTMLElement))return NodeFilter.FILTER_SKIP;if(!/^(P|DIV|LI|H[1-6])$/.test(e.tagName))return NodeFilter.FILTER_SKIP;const t=document.createRange();t.selectNodeContents(e);return M.compareBoundaryPoints(Range.END_TO_START,t)<0&&M.compareBoundaryPoints(Range.START_TO_END,t)>0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}});let g;for(;g=N.nextNode();)l.push(g);if(0===l.length){const e=r(M.startContainer);e&&l.push(e)}const u=l[0].closest("li");if(u){const e=u.closest("ul,ol");if(!e)return;return void(e.tagName.toLowerCase()===t?function(e){const t=document.createDocumentFragment();Array.from(e.querySelectorAll("li")).forEach((e=>{const i=document.createElement("p");for(e.style.textAlign&&(i.style.textAlign=e.style.textAlign);e.firstChild;)i.appendChild(e.firstChild);t.appendChild(i)})),e.replaceWith(t)}(e):s(e,t))}const c=document.createElement(t);n(c);for(const e of l){const t=document.createElement("li");for(e.style.textAlign&&(t.style.textAlign=e.style.textAlign);e.firstChild;)t.appendChild(e.firstChild);c.appendChild(t)}l[0].replaceWith(c);for(let e=1;e<l.length;e++)l[e].remove()}e([ce({attribute:!1})],VS.prototype,"editorEl",void 0),e([ce({type:Boolean})],VS.prototype,"newTab",void 0),e([ce({type:String})],VS.prototype,"placeholder",void 0),e([ce({type:String})],VS.prototype,"label",void 0),e([De()],VS.prototype,"linkValue",void 0),e([De()],VS.prototype,"hasActiveLink",void 0),e([De()],VS.prototype,"popoverStyle",void 0),VS=e([Ne("nile-rte-link")],VS);const XS=r`
|
|
15107
|
+
`}};function ZS(e,t){for(;e&&e!==t;){if(e instanceof HTMLElement){const t=getComputedStyle(e).display;if(e.tagName.match(/^(P|DIV|H1|H2|H3|H4|H5|H6|LI)$/)||"block"===t||"list-item"===t)return e}e=e?.parentNode||null}return t}function VS(e,t){const i=window.getSelection();if(!i||0===i.rangeCount)return;const M=i.getRangeAt(0),n=M.commonAncestorContainer,o=[],r=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t=e;return M.intersectsNode(t)&&/^(P|DIV|LI|H[1-6])$/.test(t.tagName)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let s=r.nextNode();for(;s;)o.push(s),s=r.nextNode();if(0===o.length){const t=ZS(i.focusNode,e);t&&o.push(t)}o.forEach((e=>{e.style.textAlign=t}))}function WS(e,t,i){const M=window.getSelection();if(!M||0===M.rangeCount)return;const n=M.getRangeAt(0),o={strong:["strong","b"],em:["em","i"],u:["u"],span:["span"]}[t]??[t],r=e=>o.includes(e.tagName.toLowerCase());function s(e){const t=e.parentNode;if(t){for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}}function a(e){e.querySelectorAll(o.join(",")).forEach((e=>{if(!e.textContent?.trim())return void e.remove();Array.from(e.querySelectorAll(o.join(","))).forEach((t=>{if(t!==e){for(;t.firstChild;)e.insertBefore(t.firstChild,t);t.remove()}}))}))}function l(e){Array.from(e.querySelectorAll(o.join(","))).forEach((e=>{const t=e.nextSibling;if(t instanceof HTMLElement&&r(t)){for(;t.firstChild;)e.appendChild(t.firstChild);t.remove()}}))}if(n.collapsed){let o=!1,N=n.startContainer;for(;N&&N!==e;){if(N instanceof HTMLElement&&r(N)){o=!0;break}N=N.parentNode}if(o&&N instanceof HTMLElement)s(N);else{const e=document.createElement(t);i&&Object.entries(i).forEach((([t,i])=>e.setAttribute(t,i))),e.appendChild(document.createTextNode("")),n.insertNode(e),n.setStart(e.firstChild,1),n.collapse(!0),M.removeAllRanges(),M.addRange(n)}return a(e),void l(e)}n.startContainer.nodeType===Node.TEXT_NODE&&n.startContainer.splitText(n.startOffset),n.endContainer.nodeType===Node.TEXT_NODE&&n.endContainer.splitText(n.endOffset);const N=document.createTreeWalker(n.commonAncestorContainer,NodeFilter.SHOW_TEXT,{acceptNode:e=>{if(!e.nodeValue?.trim())return NodeFilter.FILTER_REJECT;const t=document.createRange();t.selectNodeContents(e);return n.compareBoundaryPoints(Range.END_TO_START,t)<0&&n.compareBoundaryPoints(Range.START_TO_END,t)>0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}}),g=[];let u;for(;u=N.nextNode();)g.push(u);const c=g.length>0&&g.every((t=>{let i=t;for(;i&&i!==e;){if(i instanceof HTMLElement&&r(i))return!0;i=i.parentNode}return!1}));if(c){const i=g[0],M=g[g.length-1],n=i.parentElement?.closest(t);if(n&&n.contains(M)){const e=n.parentNode;if(e){const o=document.createRange();o.setStartBefore(n),o.setEndBefore(i);const r=o.cloneContents(),s=document.createRange();s.setStartAfter(M),s.setEndAfter(n);const a=s.cloneContents(),l=document.createRange();l.setStartBefore(i),l.setEndAfter(M);const N=l.extractContents(),g=document.createDocumentFragment();if(r.childNodes.length){const e=document.createElement(t);for(;r.firstChild;)e.appendChild(r.firstChild);g.appendChild(e)}for(;N.firstChild;)g.appendChild(N.firstChild);if(a.childNodes.length){const e=document.createElement(t);for(;a.firstChild;)e.appendChild(a.firstChild);g.appendChild(e)}e.insertBefore(g,n),e.removeChild(n)}}else g.forEach((t=>{let i=t;for(;i&&i!==e;){if(i instanceof HTMLElement&&r(i)){s(i);break}i=i.parentNode}}))}else g.forEach((e=>{const M=e.parentElement?.closest("a, .mention, nile-mention");if(M)return;const n=document.createElement(t);i&&Object.entries(i).forEach((([e,t])=>n.setAttribute(e,t))),e.parentNode?.insertBefore(n,e),n.appendChild(e)}));a(e),l(e),M.removeAllRanges(),M.addRange(n)}function PS(e){const t=e.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/i);if(!t)return"#000000";return`#${Number(t[1]).toString(16).padStart(2,"0")}${Number(t[2]).toString(16).padStart(2,"0")}${Number(t[3]).toString(16).padStart(2,"0")}`}function RS(e,t){const i=document.getSelection();if(!i||0===i.rangeCount)return;const M=i.getRangeAt(0);if(M.collapsed){const e=document.createElement("span");e.style.fontFamily=t,e.appendChild(document.createTextNode("")),M.insertNode(e);const n=document.createRange();return n.setStart(e.firstChild,1),n.collapse(!0),i.removeAllRanges(),void i.addRange(n)}!function(e,t,i){const M=document.createElement(t);i&&Object.entries(i).forEach((([e,t])=>M.setAttribute(e,t)));try{e.surroundContents(M)}catch{const t=e.extractContents();M.appendChild(t),e.insertNode(M)}}(M,"span",{style:`font-family:${t}`})}function BS(e,t,i){for(;t&&t!==e;){if(t instanceof HTMLSpanElement&&t.hasAttribute(i))return t;t=t.parentNode}return null}function GS(e,t,i,M){const n=window.getSelection();if(!n||0===n.rangeCount)return;const o=n.getRangeAt(0);if(!e.contains(o.commonAncestorContainer))return;const r=o.cloneRange();if(r.collapsed){const o=BS(e,r.startContainer,M);if(o)return o.style[t]=i,void _S(e,M,t);const s=document.createElement("span");s.setAttribute(M,"1"),s.style[t]=i,s.appendChild(document.createTextNode("")),r.insertNode(s);const a=document.createRange();return a.setStart(s.firstChild,1),a.collapse(!0),n.removeAllRanges(),n.addRange(a),void _S(e,M,t)}const s=BS(e,r.startContainer,M),a=BS(e,r.endContainer,M);if(s&&s===a){if(function(e,t){const i=document.createRange();return i.selectNodeContents(t),e.compareBoundaryPoints(Range.START_TO_START,i)<=0&&e.compareBoundaryPoints(Range.END_TO_END,i)>=0}(r,s))s.style[t]=i;else{const e=function(e,t,i,M,n){const o=e.style[M],r=document.createRange();r.setStart(e,0),r.setEnd(t.startContainer,t.startOffset);const s=document.createRange();s.setStart(t.endContainer,t.endOffset),s.setEnd(e,e.childNodes.length);const a=document.createDocumentFragment(),l=e=>{const t=document.createElement("span");return t.setAttribute(i,"1"),t.style[M]=e,t};if(FS(r)){const e=l(o);e.appendChild(r.cloneContents()),a.appendChild(e)}const N=l(n);if(N.appendChild(t.cloneContents()),a.appendChild(N),FS(s)){const e=l(o);e.appendChild(s.cloneContents()),a.appendChild(e)}return e.replaceWith(a),N}(s,r,M,t,i),n=window.getSelection(),o=document.createRange();o.selectNodeContents(e),n?.removeAllRanges(),n?.addRange(o)}return void _S(e,M,t)}const l=(()=>{let e=r.commonAncestorContainer;for(;e&&!(e instanceof HTMLElement);)e=e.parentNode;return e})(),N=document.createTreeWalker(l||e,NodeFilter.SHOW_TEXT,{acceptNode:e=>{if(!e.nodeValue||!e.nodeValue.trim())return NodeFilter.FILTER_REJECT;const t=document.createRange();t.selectNodeContents(e);return r.compareBoundaryPoints(Range.END_TO_START,t)<0&&r.compareBoundaryPoints(Range.START_TO_END,t)>0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}}),g=[];let u;for(;u=N.nextNode();)g.push(u);g.forEach((n=>{let o=0,s=n.length;n===r.startContainer&&(o=r.startOffset),n===r.endContainer&&(s=r.endOffset),o>0&&(n=n.splitText(o)),s<n.length&&n.splitText(s);const a=BS(e,n,M);if(a)return void(a.style[t]=i);const l=document.createElement("span");l.setAttribute(M,"1"),l.style[t]=i;n.parentElement.replaceChild(l,n),l.appendChild(n)})),_S(e,M,t),n.removeAllRanges(),n.addRange(r)}function _S(e,t,i){const M=Array.from(e.querySelectorAll(`span[${t}]`)),n=e=>e.style[i];M.forEach((e=>{Array.from(e.querySelectorAll(`span[${t}]`)).forEach((t=>{if(n(t)===n(e)){for(;t.firstChild;)e.insertBefore(t.firstChild,t);t.remove()}}));const i=e.previousSibling;if(i instanceof HTMLSpanElement&&i.hasAttribute(t)&&n(i)===n(e)){for(;e.firstChild;)i.appendChild(e.firstChild);return void e.remove()}const M=e.nextSibling;if(M instanceof HTMLSpanElement&&M.hasAttribute(t)&&n(M)===n(e)){for(;M.firstChild;)e.appendChild(M.firstChild);M.remove()}}))}function FS(e){if(e.collapsed)return!1;return(e.cloneContents().textContent||"").length>0}function HS(e,t){const i=document.getSelection();if(!i||0===i.rangeCount)return;const M=i.getRangeAt(0);function n(e){e.style.paddingInlineStart="0",e.style.margin="0"}function o(e){const t=document.getSelection();if(!t)return;const i=document.createRange();i.selectNodeContents(e),i.collapse(!0),t.removeAllRanges(),t.addRange(i)}function r(t){for(;t&&t!==e;){if(t instanceof HTMLElement){const e=getComputedStyle(t).display;if(t.tagName.match(/^(P|DIV|H[1-6]|LI)$/)||"block"===e||"list-item"===e)return t}t=t.parentNode}return null}function s(e,t){const i=document.createElement(t);for(n(i);e.firstChild;)i.appendChild(e.firstChild);e.replaceWith(i)}if(M.collapsed){const i=r(M.startContainer),l=i?.closest("ul,ol");if(l&&l.tagName.toLowerCase()===t)return void function(e){const t=e.closest("li");if(!t)return;const i=t.parentElement,M=document.createElement("p");for(t.style.textAlign&&(M.style.textAlign=t.style.textAlign);t.firstChild;)M.appendChild(t.firstChild);i.parentNode?.insertBefore(M,i.nextSibling),t.remove(),0===i.childNodes.length&&i.remove(),o(M)}(i);if(l&&l.tagName.toLowerCase()!==t)return void s(l,t);if(!i||i===e||0===i.childNodes.length||(a=i,!a.textContent?.trim()&&!a.querySelector("img,br"))){const e=document.createElement(t),i=document.createElement("li");return i.appendChild(document.createElement("br")),e.appendChild(i),n(e),M.insertNode(e),void o(i)}const N=document.createElement(t);n(N);const g=document.createElement("li");for(i.style.textAlign&&(g.style.textAlign=i.style.textAlign);i.firstChild;)g.appendChild(i.firstChild);return N.appendChild(g),i.replaceWith(N),void o(g)}var a;const l=[],N=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{if(!(e instanceof HTMLElement))return NodeFilter.FILTER_SKIP;if(!/^(P|DIV|LI|H[1-6])$/.test(e.tagName))return NodeFilter.FILTER_SKIP;const t=document.createRange();t.selectNodeContents(e);return M.compareBoundaryPoints(Range.END_TO_START,t)<0&&M.compareBoundaryPoints(Range.START_TO_END,t)>0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}});let g;for(;g=N.nextNode();)l.push(g);if(0===l.length){const e=r(M.startContainer);e&&l.push(e)}const u=l[0].closest("li");if(u){const e=u.closest("ul,ol");if(!e)return;return void(e.tagName.toLowerCase()===t?function(e){const t=document.createDocumentFragment();Array.from(e.querySelectorAll("li")).forEach((e=>{const i=document.createElement("p");for(e.style.textAlign&&(i.style.textAlign=e.style.textAlign);e.firstChild;)i.appendChild(e.firstChild);t.appendChild(i)})),e.replaceWith(t)}(e):s(e,t))}const c=document.createElement(t);n(c);for(const e of l){const t=document.createElement("li");for(e.style.textAlign&&(t.style.textAlign=e.style.textAlign);e.firstChild;)t.appendChild(e.firstChild);c.appendChild(t)}l[0].replaceWith(c);for(let e=1;e<l.length;e++)l[e].remove()}e([ce({attribute:!1})],YS.prototype,"editorEl",void 0),e([ce({type:Boolean})],YS.prototype,"newTab",void 0),e([ce({type:String})],YS.prototype,"placeholder",void 0),e([ce({type:String})],YS.prototype,"label",void 0),e([De()],YS.prototype,"linkValue",void 0),e([De()],YS.prototype,"hasActiveLink",void 0),e([De()],YS.prototype,"popoverStyle",void 0),YS=e([Ne("nile-rte-link")],YS);const JS=r`
|
|
15064
15108
|
.editor { all: revert; }
|
|
15065
15109
|
|
|
15066
15110
|
nile-rich-text-editor {
|
|
@@ -15223,7 +15267,7 @@ nile-rte-toolbar-item nile-button[data-active]::part(base):hover {
|
|
|
15223
15267
|
|
|
15224
15268
|
|
|
15225
15269
|
|
|
15226
|
-
`,qS={bold:"format_bold",italic:"format_italic",underline:"format_underline",link:"link_2",left:"format_align_left",center:"format_align_middle",right:"format_align_right",justify:"format_align_justify",ul:"format_list_bulleted",ol:"format_list_numbered",clear:"format_clear"},KS=["font-weight","font-style","text-decoration","color","background-color","font-size","font-family","text-align","line-height","letter-spacing","white-space","vertical-align","list-style-position","padding-inline-start"];let em=class extends ae{constructor(){super(...arguments),this.value="",this.noStyles=!1,this.singleLineEditor=!1,this.placeholder="",this.mentions={},this.whitelist=[],this.content="",this.previewEl=null,this.toolbarEl=null,this.lastRange=null,this.buttonMap=new Map,this.headingSelect=null,this.fontSelect=null,this.colorInput=null,this.bgColorInput=null,this.colorSwatchEl=null,this.bgSwatchEl=null,this.containerEl=null,this.mentionsEl=null,this.onEditorKeydown=e=>{if(this.singleLineEditor&&"Enter"===e.key&&e.shiftKey)return void e.preventDefault();if(e.ctrlKey&&"i"===e.key.toLowerCase()&&(e.preventDefault(),RS(this.editorEl,"em"),this.updateContent(),this.updateToolbarState()),this.singleLineEditor&&"Enter"===e.key)return void e.preventDefault();if("Tab"!==e.key)return;e.preventDefault(),this.focusAndRestore();const t=window.getSelection();if(!t||0===t.rangeCount)return;const i=t.getRangeAt(0);if(e.shiftKey){if(i.collapsed&&i.startContainer.nodeType===Node.TEXT_NODE){const e=i.startContainer,M=i.startOffset,n=e.data.slice(0,M),o=n.replace(/(\t|[ \u00a0]{2})$/,"");if(o.length!==n.length){e.data=o+e.data.slice(M);const i=document.createRange();i.setStart(e,o.length),i.collapse(!0),t.removeAllRanges(),t.addRange(i),this.updateContent(),this.updateToolbarState()}}return}i.deleteContents();const M=document.createTextNode("\t");i.insertNode(M);const n=document.createRange();n.setStartAfter(M),n.collapse(!0),t.removeAllRanges(),t.addRange(n),this.updateContent(),this.updateToolbarState()},this.onSelectionChange=()=>{if(!this.editorEl)return;const e=document.getSelection();if(!e||0===e.rangeCount)return;const t=e.getRangeAt(0);this.editorEl.contains(t.commonAncestorContainer)&&(this.lastRange=t.cloneRange(),this.updateToolbarState())}}createRenderRoot(){return this}injectCss(e){if(this.querySelector("style[data-rte-style]"))return;const t=document.createElement("style");t.setAttribute("data-rte-style","true"),t.textContent=e,this.insertBefore(t,this.firstChild)}connectedCallback(){super.connectedCallback(),this.injectCss(XS.cssText),this.ensureStructure(),this.placeholder&&this.editorEl&&(this.editorEl.dataset.placeholder=this.placeholder),this.value&&!this.editorEl.innerHTML.trim()&&(this.editorEl.innerHTML=this.value),this.content=this.editorEl.innerHTML,this.toolbarEl&&this.wireAuthoredToolbar(this.toolbarEl),this.mentionsEl=this.querySelector("nile-rte-mentions"),this.mentionsEl&&(this.mentionsEl.attach?.(this.editorEl,this),this.mentionsEl.setExternalConfig?.(this.mentions)),this.wireEditor(),document.addEventListener("selectionchange",this.onSelectionChange,{passive:!0}),this.updateToolbarState(),this.syncPreview()}ensureStructure(){this.toolbarEl=this.querySelector("nile-rte-toolbar"),this.previewEl=this.querySelector("nile-rte-preview"),this.containerEl=this.querySelector(".rte-container"),this.containerEl||(this.containerEl=document.createElement("div"),this.containerEl.className="rte-container",this.appendChild(this.containerEl)),this.ensureEditor(),this.toolbarEl&&this.toolbarEl.parentElement!==this.containerEl&&this.containerEl.appendChild(this.toolbarEl),this.editorEl.parentElement!==this.containerEl&&this.containerEl.appendChild(this.editorEl),this.previewEl&&(this.previewEl.parentElement!==this&&this.appendChild(this.previewEl),this.previewEl.previousElementSibling!==this.containerEl&&this.insertBefore(this.previewEl,this.containerEl.nextSibling))}updateContentWithMention(e){this.updateContent(),this.dispatchEvent(new CustomEvent("nile-change",{detail:{content:this.content,mention:e},bubbles:!0,composed:!0}))}disconnectedCallback(){document.removeEventListener("selectionchange",this.onSelectionChange),this.mentionsEl&&this.mentionsEl.detach&&this.mentionsEl.detach(),super.disconnectedCallback()}updated(e){e.has("value")&&this.editorEl&&this.value!==this.editorEl.innerHTML&&(this.editorEl.innerHTML=this.value||"<p><br></p>",this.content=this.editorEl.innerHTML,this.syncPreview()),e.has("singleLineEditor")&&(this.editorEl&&this.editorEl.classList.toggle("single-line",this.singleLineEditor),this.previewEl&&this.previewEl.classList.toggle("single-line",this.singleLineEditor))}ensureEditor(){if(this.editorEl=this.querySelector(".editor"),!this.editorEl){const e=document.createElement("article");e.className="editor",e.setAttribute("contenteditable","true"),this.editorEl=e}this.placeholder&&(this.editorEl.dataset.placeholder=this.placeholder),this.editorEl.innerHTML.trim()||(this.editorEl.innerHTML="<p><br></p>")}unwrapMention(e,t=!0){const i=e.parentNode;if(!i)return;const M=t?(e.textContent??"").replace(/\u200B/g,""):"",n=document.createTextNode(M);i.insertBefore(n,e),i.removeChild(e);const o=document.createRange();o.setStartAfter(n),o.collapse(!0);const r=window.getSelection();r?.removeAllRanges(),r?.addRange(o)}scrubBrokenMentions(){if(!this.editorEl)return;this.editorEl.querySelectorAll("span.mention").forEach((e=>{const t=e,i=t.getAttribute("data-mention-key"),M=t.getAttribute("data-mention-label"),n=t.getAttribute("data-mention-trigger")||"",o=(t.textContent??"").replace(/\u200B/g,"").trim(),r=!!i&&!!M&&o.length>0&&o.startsWith(n)&&o.includes(M);o&&r||this.unwrapMention(t,!0)}))}wireEditor(){this.editorEl.addEventListener("input",(()=>{this.ensureAtLeastOneParagraph(),this.scrubBrokenMentions(),this.updateContent(),this.updateToolbarState()})),this.editorEl.addEventListener("mouseup",(()=>{this.saveSelection(),this.updateToolbarState()})),this.editorEl.addEventListener("keyup",(e=>{this.saveSelection(),["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(e.key)&&this.updateToolbarState()})),this.editorEl.addEventListener("keydown",this.onEditorKeydown)}wireAuthoredToolbar(e){this.buttonMap.clear(),this.headingSelect=null,this.fontSelect=null,this.colorInput=null,Array.from(e.children).forEach((e=>{const t=e.tagName.toLowerCase();if("nile-rte-select"!==t||"align"!==e.getAttribute("type")){if("nile-rte-link"===t)return e.editorEl=this.editorEl,void e.addEventListener("link-changed",(()=>{this.updateContent(),this.updateToolbarState()}));if("nile-rte-toolbar-item"===t){let t=e.querySelector(":scope > nile-button");const i=e.getAttribute("name")||"",M=e.getAttribute("label")||i,n=e.getAttribute("icon"),o=e.innerHTML.trim().length>0;if(t||(t=document.createElement("nile-button"),t.variant="tertiary",t.size="small"),n)t.innerHTML=`<nile-icon name="${n}" aria-label="${M}"></nile-icon>`,e.innerHTML="";else if(o)t.innerHTML=e.innerHTML,e.innerHTML="";else{const n=qS[i];n?t.innerHTML=`<nile-icon name="${n}" size="20" color="black" aria-label="${M}"></nile-icon>`:t.textContent=M||i,e.innerHTML=""}if(!t.isConnected){const i=document.createElement("nile-lite-tooltip");i.setAttribute("content",M),i.appendChild(t),e.appendChild(i)}t.setAttribute("aria-label",M),t.addEventListener("mousedown",(e=>e.preventDefault())),t.addEventListener("click",(()=>this.onToolbarCommand(i)));const r=this.buttonMap.get(i)??[];return r.push(t),void this.buttonMap.set(i,r)}if("nile-rte-select"!==t)"nile-rte-color"!==t||e.addEventListener("change",(e=>{this.focusAndRestore();const{mode:t,value:i}=e.detail;"backColor"===t?FS(this.editorEl,"backgroundColor",i,"data-rte-bg"):function(e,t){FS(e,"color",t,"data-rte-color")}(this.editorEl,i),this.updateContent(),this.updateToolbarState()}));else{const t=e.getAttribute("type")||"";e.addEventListener("change",(e=>{this.focusAndRestore();const i=e.detail;"heading"===t?function(e,t){const i=document.getSelection();if(!i||0===i.rangeCount)return;const M=WS(i.getRangeAt(0).startContainer,e);if(!M)return;if(M.tagName.toLowerCase()===t)return;const n=document.createElement(t);for(;M.firstChild;)n.appendChild(M.firstChild);M.replaceWith(n);const o=document.createRange();o.selectNodeContents(n),o.collapse(!0),i.removeAllRanges(),i.addRange(o)}(this.editorEl,i):"font"===t&&GS(this.editorEl,i),this.updateContent(),this.updateToolbarState()}))}}else e.addEventListener("change",(e=>{this.focusAndRestore();const t=e.detail;PS(this.editorEl,t),this.updateContent(),this.updateToolbarState()}))}))}saveSelection(){const e=window.getSelection();e&&e.rangeCount&&(this.lastRange=e.getRangeAt(0).cloneRange())}restoreSelection(){if(!this.lastRange)return;const e=document.getSelection();e&&(e.removeAllRanges(),e.addRange(this.lastRange))}focusAndRestore(){this.editorEl?.focus(),this.restoreSelection()}getCleanContent(){const e=this.editorEl.cloneNode(!0);return e.querySelectorAll("*").forEach((e=>{e.removeAttribute("style")})),e.innerHTML}insertList(e){if(this.restoreSelection(),!this.lastRange)return;const t=document.createElement(e),i=this.lastRange.extractContents(),M=document.createElement("div");M.appendChild(i),Array.from(M.childNodes).forEach((e=>{if(e.nodeType===Node.TEXT_NODE&&!e.textContent?.trim())return;const i=document.createElement("li");i.appendChild(e),t.appendChild(i)})),this.lastRange.insertNode(t),this.afterListEdit(t)}afterListEdit(e){const t=document.createRange();t.setStartAfter(e),t.collapse(!0);const i=window.getSelection();i?.removeAllRanges(),i?.addRange(t),this.saveSelection(),this.updateContent(),this.updateToolbarState()}ensureAtLeastOneParagraph(){const e=this.editorEl;if(!e)return;const t=""===(e.textContent??"").replace(/\u200B/g,"").trim();if(0===e.childNodes.length||t)return void(e.innerHTML="<p><br></p>");if(!e.querySelector("p,h1,h2,h3,h4,h5,h6,ul,ol,table,blockquote,pre")){const t=document.createElement("p");for(;e.firstChild;)t.appendChild(e.firstChild);return t.hasChildNodes()||t.appendChild(document.createElement("br")),void e.appendChild(t)}e.querySelectorAll("p").forEach((e=>{""===(e.textContent??"").replace(/\u200B/g,"")&&(e.innerHTML.toLowerCase().includes("<br")||(e.innerHTML="<br>"))}))}onToolbarCommand(e){switch(this.focusAndRestore(),e){case"bold":RS(this.editorEl,"strong");break;case"italic":RS(this.editorEl,"em");break;case"underline":RS(this.editorEl,"u");break;case"left":PS(this.editorEl,"left");break;case"center":PS(this.editorEl,"center");break;case"right":PS(this.editorEl,"right");break;case"justify":PS(this.editorEl,"justify");break;case"ul":$S(this.editorEl,"ul"),this.updateContent(),this.updateToolbarState();break;case"ol":$S(this.editorEl,"ol"),this.updateContent(),this.updateToolbarState();break;case"link":break;case"clear":const e=document.createTreeWalker(this.editorEl,NodeFilter.SHOW_ELEMENT),t=[];for(;e.nextNode();){const i=e.currentNode;i.removeAttribute("style"),["B","STRONG","I","EM","U","SPAN","FONT"].includes(i.tagName)&&t.push(i)}for(const e of t){for(;e.firstChild;)e.parentNode?.insertBefore(e.firstChild,e);e.remove()}this.ensureAtLeastOneParagraph()}this.updateContent(),this.updateToolbarState()}setBtnActive(e,t){const i=this.buttonMap.get(e);if(i)for(const e of i)e.toggleAttribute("data-active",!!t)}updateToolbarState(){if(!this.editorEl)return;const e=document.getSelection();if(!e||0===e.rangeCount)return;const t=e.getRangeAt(0);if(!this.editorEl.contains(t.commonAncestorContainer))return;const i=function(e){for(;e&&!(e instanceof HTMLElement);)e=e.parentNode;return e}(t.startContainer)||this.editorEl,M=getComputedStyle(i),n=WS(t.startContainer,this.editorEl)||this.editorEl,o=(()=>{let e=i;for(;e&&e!==this.editorEl;){if(e instanceof HTMLElement){const t=e.tagName.toLowerCase();if("strong"===t||"b"===t)return!0;const i=getComputedStyle(e).fontWeight;if(parseInt(i,10)>=600)return!0}e=e.parentNode}return!1})(),r=(()=>{let e=i;for(;e&&e!==this.editorEl;){if(e instanceof HTMLElement){const t=e.tagName.toLowerCase();if("em"===t||"i"===t)return!0;if("italic"===getComputedStyle(e).fontStyle)return!0}e=e.parentNode}return!1})(),s=(()=>{let e=i;for(;e&&e!==this.editorEl;){if(e instanceof HTMLElement){const t=getComputedStyle(e).textDecorationLine;if(t&&t.includes("underline"))return!0;if("u"===e.tagName.toLowerCase())return!0}e=e.parentNode}return!1})(),a=!!i.closest("a"),l=n.style.textAlign||getComputedStyle(n).textAlign||"start",N="start"===l?"left":l,g=!!i.closest("li")&&i.closest("ul,ol")?.tagName.toLowerCase()||"";if(this.setBtnActive("bold",o),this.setBtnActive("italic",r),this.setBtnActive("underline",s),this.setBtnActive("link",a),this.setBtnActive("left","left"===N&&!["center","right","justify"].includes(N)),this.setBtnActive("center","center"===N),this.setBtnActive("right","right"===N),this.setBtnActive("justify","justify"===N),this.setBtnActive("ul","ul"===g),this.setBtnActive("ol","ol"===g),this.headingSelect){const e=n.tagName.toLowerCase(),t=["h1","h2","h3"].includes(e)?e:"p";this.headingSelect.value!==t&&(this.headingSelect.value=t)}if(this.fontSelect){const e=(M.fontFamily||"").replace(/["']/g,"").split(",")[0].trim().toLowerCase();if(e)for(const t of Array.from(this.fontSelect.options))if(t.value.toLowerCase()===e){this.fontSelect.value=t.value;break}}if(this.colorInput){const e=BS(M.color);e&&this.colorInput.value.toLowerCase()!==e.toLowerCase()&&(this.colorInput.value=e),this.colorSwatchEl&&(this.colorSwatchEl.style.backgroundColor=this.colorInput.value)}if(this.bgColorInput){const e=getComputedStyle(i).backgroundColor;if(e&&!/transparent|rgba\(\s*0\s*,\s*0\s*,\s*0\s*,\s*0\s*\)/i.test(e)){const t=BS(e);t&&this.bgColorInput.value.toLowerCase()!==t.toLowerCase()&&(this.bgColorInput.value=t)}this.bgSwatchEl&&(this.bgSwatchEl.style.backgroundColor=this.bgColorInput.value)}}syncPreview(){this.updateContent()}getComputedImportantProps(){return Array.from(new Set([...KS,...this.whitelist??[]]))}updateContent(){if(!this.editorEl)return;this.ensureAtLeastOneParagraph();const e=""===(this.editorEl.textContent??"").trim();this.editorEl.classList.toggle("empty",e);const t=this.editorEl.cloneNode(!0);if(this.noStyles)t.querySelectorAll("[style]").forEach((e=>e.removeAttribute("style")));else{const e=document.createTreeWalker(this.editorEl,NodeFilter.SHOW_ELEMENT),i=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT),M=this.getComputedImportantProps();for(;e.nextNode()&&i.nextNode();){const t=e.currentNode,n=i.currentNode,o=window.getComputedStyle(t),r=M.map((e=>`${e}:${o.getPropertyValue(e)}`)).join(";");r.trim()&&n.setAttribute("style",r)}}this.content=t.innerHTML,this.previewEl&&(this.previewEl.innerHTML=this.content),this.dispatchEvent(new CustomEvent("nile-change",{detail:{content:this.content},bubbles:!0,composed:!0}))}};e([ce({type:String,attribute:!0,reflect:!0})],em.prototype,"value",void 0),e([ce({type:Boolean,attribute:!0,reflect:!0})],em.prototype,"noStyles",void 0),e([ce({type:Boolean,attribute:"singlelineeditor",reflect:!0})],em.prototype,"singleLineEditor",void 0),e([ce({type:String})],em.prototype,"placeholder",void 0),e([ce({attribute:"mentions",reflect:!0,converter:{fromAttribute:e=>{try{const t=JSON.parse(e),i={};for(const e of Object.keys(t)){const M=t[e];Array.isArray(M)&&(i[e]=M.filter((e=>e&&"string"==typeof e.key&&"string"==typeof e.label)).map((e=>({key:e.key,label:e.label}))))}return i}catch{return{}}},toAttribute:e=>JSON.stringify(e)}})],em.prototype,"mentions",void 0),e([ce({attribute:"whitelist",reflect:!1,converter:{fromAttribute:e=>{try{const t=JSON.parse(e);return Array.isArray(t)?t.filter((e=>"string"==typeof e)):[]}catch{return[]}}}})],em.prototype,"whitelist",void 0),e([De()],em.prototype,"content",void 0),em=e([Ne("nile-rich-text-editor")],em);"undefined"!=typeof window&&(window.nileElementsVersion='"1.5.2"',window.nileVersion="__NILE_VERSION__",window.process=window.process||{env:{NODE_ENV:"production"}});const tm=r`
|
|
15270
|
+
`,$S={bold:"format_bold",italic:"format_italic",underline:"format_underline",link:"link_2",left:"format_align_left",center:"format_align_middle",right:"format_align_right",justify:"format_align_justify",ul:"format_list_bulleted",ol:"format_list_numbered",clear:"format_clear"},XS=["font-weight","font-style","text-decoration","color","background-color","font-size","font-family","text-align","line-height","letter-spacing","white-space","vertical-align","list-style-position","padding-inline-start"];let qS=class extends ae{constructor(){super(...arguments),this.value="",this.noStyles=!1,this.singleLineEditor=!1,this.placeholder="",this.mentions={},this.whitelist=[],this.content="",this.previewEl=null,this.toolbarEl=null,this.lastRange=null,this.buttonMap=new Map,this.headingSelect=null,this.fontSelect=null,this.colorInput=null,this.bgColorInput=null,this.colorSwatchEl=null,this.bgSwatchEl=null,this.containerEl=null,this.mentionsEl=null,this.onEditorKeydown=e=>{if(this.singleLineEditor&&"Enter"===e.key&&e.shiftKey)return void e.preventDefault();if(e.ctrlKey&&"i"===e.key.toLowerCase()&&(e.preventDefault(),WS(this.editorEl,"em"),this.updateContent(),this.updateToolbarState()),this.singleLineEditor&&"Enter"===e.key)return void e.preventDefault();if("Tab"!==e.key)return;e.preventDefault(),this.focusAndRestore();const t=window.getSelection();if(!t||0===t.rangeCount)return;const i=t.getRangeAt(0);if(e.shiftKey){if(i.collapsed&&i.startContainer.nodeType===Node.TEXT_NODE){const e=i.startContainer,M=i.startOffset,n=e.data.slice(0,M),o=n.replace(/(\t|[ \u00a0]{2})$/,"");if(o.length!==n.length){e.data=o+e.data.slice(M);const i=document.createRange();i.setStart(e,o.length),i.collapse(!0),t.removeAllRanges(),t.addRange(i),this.updateContent(),this.updateToolbarState()}}return}i.deleteContents();const M=document.createTextNode("\t");i.insertNode(M);const n=document.createRange();n.setStartAfter(M),n.collapse(!0),t.removeAllRanges(),t.addRange(n),this.updateContent(),this.updateToolbarState()},this.onSelectionChange=()=>{if(!this.editorEl)return;const e=document.getSelection();if(!e||0===e.rangeCount)return;const t=e.getRangeAt(0);this.editorEl.contains(t.commonAncestorContainer)&&(this.lastRange=t.cloneRange(),this.updateToolbarState())}}createRenderRoot(){return this}injectCss(e){if(this.querySelector("style[data-rte-style]"))return;const t=document.createElement("style");t.setAttribute("data-rte-style","true"),t.textContent=e,this.insertBefore(t,this.firstChild)}connectedCallback(){super.connectedCallback(),this.injectCss(JS.cssText),this.ensureStructure(),this.placeholder&&this.editorEl&&(this.editorEl.dataset.placeholder=this.placeholder),this.value&&!this.editorEl.innerHTML.trim()&&(this.editorEl.innerHTML=this.value),this.content=this.editorEl.innerHTML,this.toolbarEl&&this.wireAuthoredToolbar(this.toolbarEl),this.mentionsEl=this.querySelector("nile-rte-mentions"),this.mentionsEl&&(this.mentionsEl.attach?.(this.editorEl,this),this.mentionsEl.setExternalConfig?.(this.mentions)),this.wireEditor(),document.addEventListener("selectionchange",this.onSelectionChange,{passive:!0}),this.updateToolbarState(),this.syncPreview()}ensureStructure(){this.toolbarEl=this.querySelector("nile-rte-toolbar"),this.previewEl=this.querySelector("nile-rte-preview"),this.containerEl=this.querySelector(".rte-container"),this.containerEl||(this.containerEl=document.createElement("div"),this.containerEl.className="rte-container",this.appendChild(this.containerEl)),this.ensureEditor(),this.toolbarEl&&this.toolbarEl.parentElement!==this.containerEl&&this.containerEl.appendChild(this.toolbarEl),this.editorEl.parentElement!==this.containerEl&&this.containerEl.appendChild(this.editorEl),this.previewEl&&(this.previewEl.parentElement!==this&&this.appendChild(this.previewEl),this.previewEl.previousElementSibling!==this.containerEl&&this.insertBefore(this.previewEl,this.containerEl.nextSibling))}updateContentWithMention(e){this.updateContent(),this.dispatchEvent(new CustomEvent("nile-change",{detail:{content:this.content,mention:e},bubbles:!0,composed:!0}))}disconnectedCallback(){document.removeEventListener("selectionchange",this.onSelectionChange),this.mentionsEl&&this.mentionsEl.detach&&this.mentionsEl.detach(),super.disconnectedCallback()}updated(e){e.has("value")&&this.editorEl&&this.value!==this.editorEl.innerHTML&&(this.editorEl.innerHTML=this.value||"<p><br></p>",this.content=this.editorEl.innerHTML,this.syncPreview()),e.has("singleLineEditor")&&(this.editorEl&&this.editorEl.classList.toggle("single-line",this.singleLineEditor),this.previewEl&&this.previewEl.classList.toggle("single-line",this.singleLineEditor))}ensureEditor(){if(this.editorEl=this.querySelector(".editor"),!this.editorEl){const e=document.createElement("article");e.className="editor",e.setAttribute("contenteditable","true"),this.editorEl=e}this.placeholder&&(this.editorEl.dataset.placeholder=this.placeholder),this.editorEl.innerHTML.trim()||(this.editorEl.innerHTML="<p><br></p>")}unwrapMention(e,t=!0){const i=e.parentNode;if(!i)return;const M=t?(e.textContent??"").replace(/\u200B/g,""):"",n=document.createTextNode(M);i.insertBefore(n,e),i.removeChild(e);const o=document.createRange();o.setStartAfter(n),o.collapse(!0);const r=window.getSelection();r?.removeAllRanges(),r?.addRange(o)}scrubBrokenMentions(){if(!this.editorEl)return;this.editorEl.querySelectorAll("span.mention").forEach((e=>{const t=e,i=t.getAttribute("data-mention-key"),M=t.getAttribute("data-mention-label"),n=t.getAttribute("data-mention-trigger")||"",o=(t.textContent??"").replace(/\u200B/g,"").trim(),r=!!i&&!!M&&o.length>0&&o.startsWith(n)&&o.includes(M);o&&r||this.unwrapMention(t,!0)}))}wireEditor(){this.editorEl.addEventListener("input",(()=>{this.ensureAtLeastOneParagraph(),this.scrubBrokenMentions(),this.updateContent(),this.updateToolbarState()})),this.editorEl.addEventListener("mouseup",(()=>{this.saveSelection(),this.updateToolbarState()})),this.editorEl.addEventListener("keyup",(e=>{this.saveSelection(),["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(e.key)&&this.updateToolbarState()})),this.editorEl.addEventListener("keydown",this.onEditorKeydown)}wireAuthoredToolbar(e){this.buttonMap.clear(),this.headingSelect=null,this.fontSelect=null,this.colorInput=null,Array.from(e.children).forEach((e=>{const t=e.tagName.toLowerCase();if("nile-rte-select"!==t||"align"!==e.getAttribute("type")){if("nile-rte-link"===t)return e.editorEl=this.editorEl,void e.addEventListener("link-changed",(()=>{this.updateContent(),this.updateToolbarState()}));if("nile-rte-toolbar-item"===t){let t=e.querySelector(":scope > nile-button");const i=e.getAttribute("name")||"",M=e.getAttribute("label")||i,n=e.getAttribute("icon"),o=e.innerHTML.trim().length>0;if(t||(t=document.createElement("nile-button"),t.variant="tertiary",t.size="small"),n)t.innerHTML=`<nile-icon name="${n}" aria-label="${M}"></nile-icon>`,e.innerHTML="";else if(o)t.innerHTML=e.innerHTML,e.innerHTML="";else{const n=$S[i];n?t.innerHTML=`<nile-icon name="${n}" size="20" color="black" aria-label="${M}"></nile-icon>`:t.textContent=M||i,e.innerHTML=""}if(!t.isConnected){const i=document.createElement("nile-lite-tooltip");i.setAttribute("content",M),i.appendChild(t),e.appendChild(i)}t.setAttribute("aria-label",M),t.addEventListener("mousedown",(e=>e.preventDefault())),t.addEventListener("click",(()=>this.onToolbarCommand(i)));const r=this.buttonMap.get(i)??[];return r.push(t),void this.buttonMap.set(i,r)}if("nile-rte-select"!==t)"nile-rte-color"!==t||e.addEventListener("change",(e=>{this.focusAndRestore();const{mode:t,value:i}=e.detail;"backColor"===t?GS(this.editorEl,"backgroundColor",i,"data-rte-bg"):function(e,t){GS(e,"color",t,"data-rte-color")}(this.editorEl,i),this.updateContent(),this.updateToolbarState()}));else{const t=e.getAttribute("type")||"";e.addEventListener("change",(e=>{this.focusAndRestore();const i=e.detail;"heading"===t?function(e,t){const i=document.getSelection();if(!i||0===i.rangeCount)return;const M=ZS(i.getRangeAt(0).startContainer,e);if(!M)return;if(M.tagName.toLowerCase()===t)return;const n=document.createElement(t);for(;M.firstChild;)n.appendChild(M.firstChild);M.replaceWith(n);const o=document.createRange();o.selectNodeContents(n),o.collapse(!0),i.removeAllRanges(),i.addRange(o)}(this.editorEl,i):"font"===t&&RS(this.editorEl,i),this.updateContent(),this.updateToolbarState()}))}}else e.addEventListener("change",(e=>{this.focusAndRestore();const t=e.detail;VS(this.editorEl,t),this.updateContent(),this.updateToolbarState()}))}))}saveSelection(){const e=window.getSelection();e&&e.rangeCount&&(this.lastRange=e.getRangeAt(0).cloneRange())}restoreSelection(){if(!this.lastRange)return;const e=document.getSelection();e&&(e.removeAllRanges(),e.addRange(this.lastRange))}focusAndRestore(){this.editorEl?.focus(),this.restoreSelection()}getCleanContent(){const e=this.editorEl.cloneNode(!0);return e.querySelectorAll("*").forEach((e=>{e.removeAttribute("style")})),e.innerHTML}insertList(e){if(this.restoreSelection(),!this.lastRange)return;const t=document.createElement(e),i=this.lastRange.extractContents(),M=document.createElement("div");M.appendChild(i),Array.from(M.childNodes).forEach((e=>{if(e.nodeType===Node.TEXT_NODE&&!e.textContent?.trim())return;const i=document.createElement("li");i.appendChild(e),t.appendChild(i)})),this.lastRange.insertNode(t),this.afterListEdit(t)}afterListEdit(e){const t=document.createRange();t.setStartAfter(e),t.collapse(!0);const i=window.getSelection();i?.removeAllRanges(),i?.addRange(t),this.saveSelection(),this.updateContent(),this.updateToolbarState()}ensureAtLeastOneParagraph(){const e=this.editorEl;if(!e)return;const t=""===(e.textContent??"").replace(/\u200B/g,"").trim();if(0===e.childNodes.length||t)return void(e.innerHTML="<p><br></p>");if(!e.querySelector("p,h1,h2,h3,h4,h5,h6,ul,ol,table,blockquote,pre")){const t=document.createElement("p");for(;e.firstChild;)t.appendChild(e.firstChild);return t.hasChildNodes()||t.appendChild(document.createElement("br")),void e.appendChild(t)}e.querySelectorAll("p").forEach((e=>{""===(e.textContent??"").replace(/\u200B/g,"")&&(e.innerHTML.toLowerCase().includes("<br")||(e.innerHTML="<br>"))}))}onToolbarCommand(e){switch(this.focusAndRestore(),e){case"bold":WS(this.editorEl,"strong");break;case"italic":WS(this.editorEl,"em");break;case"underline":WS(this.editorEl,"u");break;case"left":VS(this.editorEl,"left");break;case"center":VS(this.editorEl,"center");break;case"right":VS(this.editorEl,"right");break;case"justify":VS(this.editorEl,"justify");break;case"ul":HS(this.editorEl,"ul"),this.updateContent(),this.updateToolbarState();break;case"ol":HS(this.editorEl,"ol"),this.updateContent(),this.updateToolbarState();break;case"link":break;case"clear":const e=document.createTreeWalker(this.editorEl,NodeFilter.SHOW_ELEMENT),t=[];for(;e.nextNode();){const i=e.currentNode;i.removeAttribute("style"),["B","STRONG","I","EM","U","SPAN","FONT"].includes(i.tagName)&&t.push(i)}for(const e of t){for(;e.firstChild;)e.parentNode?.insertBefore(e.firstChild,e);e.remove()}this.ensureAtLeastOneParagraph()}this.updateContent(),this.updateToolbarState()}setBtnActive(e,t){const i=this.buttonMap.get(e);if(i)for(const e of i)e.toggleAttribute("data-active",!!t)}updateToolbarState(){if(!this.editorEl)return;const e=document.getSelection();if(!e||0===e.rangeCount)return;const t=e.getRangeAt(0);if(!this.editorEl.contains(t.commonAncestorContainer))return;const i=function(e){for(;e&&!(e instanceof HTMLElement);)e=e.parentNode;return e}(t.startContainer)||this.editorEl,M=getComputedStyle(i),n=ZS(t.startContainer,this.editorEl)||this.editorEl,o=(()=>{let e=i;for(;e&&e!==this.editorEl;){if(e instanceof HTMLElement){const t=e.tagName.toLowerCase();if("strong"===t||"b"===t)return!0;const i=getComputedStyle(e).fontWeight;if(parseInt(i,10)>=600)return!0}e=e.parentNode}return!1})(),r=(()=>{let e=i;for(;e&&e!==this.editorEl;){if(e instanceof HTMLElement){const t=e.tagName.toLowerCase();if("em"===t||"i"===t)return!0;if("italic"===getComputedStyle(e).fontStyle)return!0}e=e.parentNode}return!1})(),s=(()=>{let e=i;for(;e&&e!==this.editorEl;){if(e instanceof HTMLElement){const t=getComputedStyle(e).textDecorationLine;if(t&&t.includes("underline"))return!0;if("u"===e.tagName.toLowerCase())return!0}e=e.parentNode}return!1})(),a=!!i.closest("a"),l=n.style.textAlign||getComputedStyle(n).textAlign||"start",N="start"===l?"left":l,g=!!i.closest("li")&&i.closest("ul,ol")?.tagName.toLowerCase()||"";if(this.setBtnActive("bold",o),this.setBtnActive("italic",r),this.setBtnActive("underline",s),this.setBtnActive("link",a),this.setBtnActive("left","left"===N&&!["center","right","justify"].includes(N)),this.setBtnActive("center","center"===N),this.setBtnActive("right","right"===N),this.setBtnActive("justify","justify"===N),this.setBtnActive("ul","ul"===g),this.setBtnActive("ol","ol"===g),this.headingSelect){const e=n.tagName.toLowerCase(),t=["h1","h2","h3"].includes(e)?e:"p";this.headingSelect.value!==t&&(this.headingSelect.value=t)}if(this.fontSelect){const e=(M.fontFamily||"").replace(/["']/g,"").split(",")[0].trim().toLowerCase();if(e)for(const t of Array.from(this.fontSelect.options))if(t.value.toLowerCase()===e){this.fontSelect.value=t.value;break}}if(this.colorInput){const e=PS(M.color);e&&this.colorInput.value.toLowerCase()!==e.toLowerCase()&&(this.colorInput.value=e),this.colorSwatchEl&&(this.colorSwatchEl.style.backgroundColor=this.colorInput.value)}if(this.bgColorInput){const e=getComputedStyle(i).backgroundColor;if(e&&!/transparent|rgba\(\s*0\s*,\s*0\s*,\s*0\s*,\s*0\s*\)/i.test(e)){const t=PS(e);t&&this.bgColorInput.value.toLowerCase()!==t.toLowerCase()&&(this.bgColorInput.value=t)}this.bgSwatchEl&&(this.bgSwatchEl.style.backgroundColor=this.bgColorInput.value)}}syncPreview(){this.updateContent()}getComputedImportantProps(){return Array.from(new Set([...XS,...this.whitelist??[]]))}updateContent(){if(!this.editorEl)return;this.ensureAtLeastOneParagraph();const e=""===(this.editorEl.textContent??"").trim();this.editorEl.classList.toggle("empty",e);const t=this.editorEl.cloneNode(!0);if(this.noStyles)t.querySelectorAll("[style]").forEach((e=>e.removeAttribute("style")));else{const e=document.createTreeWalker(this.editorEl,NodeFilter.SHOW_ELEMENT),i=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT),M=this.getComputedImportantProps();for(;e.nextNode()&&i.nextNode();){const t=e.currentNode,n=i.currentNode,o=window.getComputedStyle(t),r=M.map((e=>`${e}:${o.getPropertyValue(e)}`)).join(";");r.trim()&&n.setAttribute("style",r)}}this.content=t.innerHTML,this.previewEl&&(this.previewEl.innerHTML=this.content),this.dispatchEvent(new CustomEvent("nile-change",{detail:{content:this.content},bubbles:!0,composed:!0}))}};e([ce({type:String,attribute:!0,reflect:!0})],qS.prototype,"value",void 0),e([ce({type:Boolean,attribute:!0,reflect:!0})],qS.prototype,"noStyles",void 0),e([ce({type:Boolean,attribute:"singlelineeditor",reflect:!0})],qS.prototype,"singleLineEditor",void 0),e([ce({type:String})],qS.prototype,"placeholder",void 0),e([ce({attribute:"mentions",reflect:!0,converter:{fromAttribute:e=>{try{const t=JSON.parse(e),i={};for(const e of Object.keys(t)){const M=t[e];Array.isArray(M)&&(i[e]=M.filter((e=>e&&"string"==typeof e.key&&"string"==typeof e.label)).map((e=>({key:e.key,label:e.label}))))}return i}catch{return{}}},toAttribute:e=>JSON.stringify(e)}})],qS.prototype,"mentions",void 0),e([ce({attribute:"whitelist",reflect:!1,converter:{fromAttribute:e=>{try{const t=JSON.parse(e);return Array.isArray(t)?t.filter((e=>"string"==typeof e)):[]}catch{return[]}}}})],qS.prototype,"whitelist",void 0),e([De()],qS.prototype,"content",void 0),qS=e([Ne("nile-rich-text-editor")],qS);"undefined"!=typeof window&&(window.nileElementsVersion='"1.5.3"',window.nileVersion="__NILE_VERSION__",window.process=window.process||{env:{NODE_ENV:"production"}});const KS=r`
|
|
15227
15271
|
:host {
|
|
15228
15272
|
|
|
15229
15273
|
top: 0;
|
|
@@ -15304,13 +15348,13 @@ nile-rte-toolbar-item nile-button[data-active]::part(base):hover {
|
|
|
15304
15348
|
|
|
15305
15349
|
|
|
15306
15350
|
|
|
15307
|
-
`;let
|
|
15351
|
+
`;let em=class extends Re{constructor(){super(...arguments),this.position="left",this.collapsed=!1,this.fullHeight=!1,this.width=null,this.collapsedWidth=null}static get styles(){return[KS]}updated(e){super.updated(e),e.has("collapsed")&&this.querySelectorAll("\n nile-side-bar-logo,\n nile-side-bar-footer-item,\n nile-side-bar-group-item,\n nile-side-bar-group,\n nile-side-bar-header,\n nile-side-bar-group-item-text,\n nile-side-bar-group-item-icon,\n nile-side-bar-expand\n ").forEach((e=>e.toggleAttribute("collapsed",this.collapsed))),e.has("width")&&null!==this.width&&this.style.setProperty("--sidebar-width",`${this.width}px`),e.has("collapsedWidth")&&null!==this.collapsedWidth&&this.style.setProperty("--sidebar-collapsed-width",`${this.collapsedWidth}px`)}render(){return R`
|
|
15308
15352
|
<slot name="header" part="header"></slot>
|
|
15309
15353
|
<div class="scroll-container" part="scroll-container">
|
|
15310
15354
|
<slot></slot>
|
|
15311
15355
|
</div>
|
|
15312
15356
|
<slot name="footer" part="footer"></slot>
|
|
15313
|
-
`}};e([ce({type:String,reflect:!0,attribute:!0})],
|
|
15357
|
+
`}};e([ce({type:String,reflect:!0,attribute:!0})],em.prototype,"position",void 0),e([ce({type:Boolean,reflect:!0,attribute:!0})],em.prototype,"collapsed",void 0),e([ce({type:Boolean,reflect:!0,attribute:!0})],em.prototype,"fullHeight",void 0),e([ce({type:Number,attribute:!0})],em.prototype,"width",void 0),e([ce({type:Number,attribute:!0})],em.prototype,"collapsedWidth",void 0),em=e([Ne("nile-side-bar")],em);const tm=r`
|
|
15314
15358
|
:host {
|
|
15315
15359
|
display: flex;
|
|
15316
15360
|
align-items: center;
|
|
@@ -15355,12 +15399,12 @@ nile-rte-toolbar-item nile-button[data-active]::part(base):hover {
|
|
|
15355
15399
|
gap: var(--nile-spacing-md);
|
|
15356
15400
|
}
|
|
15357
15401
|
|
|
15358
|
-
`;let
|
|
15402
|
+
`;let im=class extends Re{static get styles(){return[tm]}render(){return R`
|
|
15359
15403
|
<div class="header-content" part="header-content">
|
|
15360
15404
|
<slot name="logo" part="logo"></slot>
|
|
15361
15405
|
<slot name="expand" part="expand"></slot>
|
|
15362
15406
|
</div>
|
|
15363
|
-
`}};
|
|
15407
|
+
`}};im=e([Ne("nile-side-bar-header")],im);const Mm=r`
|
|
15364
15408
|
:host {
|
|
15365
15409
|
justify-content: center;
|
|
15366
15410
|
height: 100%;
|
|
@@ -15396,10 +15440,10 @@ nile-rte-toolbar-item nile-button[data-active]::part(base):hover {
|
|
|
15396
15440
|
:host(:not([collapsed])) .logo.collapsed {
|
|
15397
15441
|
display: none;
|
|
15398
15442
|
}
|
|
15399
|
-
`;let
|
|
15443
|
+
`;let nm=class extends Re{constructor(){super(...arguments),this.src="https://assets.aquera.io/img/aquera-logo-blue.svg",this.collapsedSrc="https://assets.aqueralabs.com/img/aquera-logo-mini.png"}static get styles(){return[Mm]}render(){return R`
|
|
15400
15444
|
<img class="logo expanded" src="${this.src}" alt="Logo" part="logo-expanded" />
|
|
15401
15445
|
<img class="logo collapsed" src="${this.collapsedSrc}" alt="Logo icon" part="logo-collapsed" />
|
|
15402
|
-
`}};e([ce({type:String,attribute:!0,reflect:!0})],
|
|
15446
|
+
`}};e([ce({type:String,attribute:!0,reflect:!0})],nm.prototype,"src",void 0),e([ce({type:String,attribute:"collapsed-src"})],nm.prototype,"collapsedSrc",void 0),nm=e([Ne("nile-side-bar-logo")],nm);const om=r`
|
|
15403
15447
|
:host {
|
|
15404
15448
|
display: inline-flex;
|
|
15405
15449
|
}
|
|
@@ -15418,7 +15462,7 @@ nile-rte-toolbar-item nile-button[data-active]::part(base):hover {
|
|
|
15418
15462
|
transition: background-color 0.2s ease;
|
|
15419
15463
|
}
|
|
15420
15464
|
|
|
15421
|
-
`;let
|
|
15465
|
+
`;let rm=class extends Re{constructor(){super(...arguments),this.collapsed=!1,this.expandTooltipText="Expand Sidebar",this.collapseTooltipText="Collapse Sidebar"}static get styles(){return[om]}connectedCallback(){super.connectedCallback();const e=this.closest("nile-side-bar");e&&(this.collapsed=e.hasAttribute("collapsed"))}toggleSidebar(){const e=this.closest("nile-side-bar");if(!e)return;e.hasAttribute("collapsed")?(e.removeAttribute("collapsed"),this.collapsed=!1):(e.setAttribute("collapsed",""),this.collapsed=!0)}render(){return R`
|
|
15422
15466
|
<button class="expand-btn" part="expand-btn" @click=${this.toggleSidebar}>
|
|
15423
15467
|
${this.collapsed?R`
|
|
15424
15468
|
<nile-lite-tooltip placement="right" hoist content=${this.expandTooltipText}>
|
|
@@ -15430,7 +15474,7 @@ nile-rte-toolbar-item nile-button[data-active]::part(base):hover {
|
|
|
15430
15474
|
</nile-lite-tooltip>
|
|
15431
15475
|
`}
|
|
15432
15476
|
</button>
|
|
15433
|
-
`}};e([ce({type:Boolean,reflect:!0})],
|
|
15477
|
+
`}};e([ce({type:Boolean,reflect:!0})],rm.prototype,"collapsed",void 0),e([ce({type:String,reflect:!0,attribute:!0})],rm.prototype,"expandTooltipText",void 0),e([ce({type:String,reflect:!0,attribute:!0})],rm.prototype,"collapseTooltipText",void 0),rm=e([Ne("nile-side-bar-expand")],rm);const sm=r`
|
|
15434
15478
|
:host {
|
|
15435
15479
|
display: flex;
|
|
15436
15480
|
flex-direction: column;
|
|
@@ -15475,7 +15519,7 @@ nile-rte-toolbar-item nile-button[data-active]::part(base):hover {
|
|
|
15475
15519
|
align-items: center;
|
|
15476
15520
|
justify-content: center;
|
|
15477
15521
|
}
|
|
15478
|
-
`;let
|
|
15522
|
+
`;let am=class extends Re{constructor(){super(...arguments),this.label="",this.footer=!1,this.divider=!1}static get styles(){return[sm]}render(){return R`
|
|
15479
15523
|
<section
|
|
15480
15524
|
part="base"
|
|
15481
15525
|
class="side-bar-group"
|
|
@@ -15486,7 +15530,7 @@ justify-content: center;
|
|
|
15486
15530
|
${this.label?R`<div part="label" class="group-label">${this.label}</div>`:null}
|
|
15487
15531
|
<slot></slot>
|
|
15488
15532
|
</section>
|
|
15489
|
-
`}};e([ce({type:String})],
|
|
15533
|
+
`}};e([ce({type:String})],am.prototype,"label",void 0),e([ce({type:Boolean,reflect:!0})],am.prototype,"footer",void 0),e([ce({type:Boolean,reflect:!0})],am.prototype,"divider",void 0),am=e([Ne("nile-side-bar-group")],am);const lm=r`
|
|
15490
15534
|
:host {
|
|
15491
15535
|
display: block;
|
|
15492
15536
|
}
|
|
@@ -15546,7 +15590,7 @@ justify-content: center;
|
|
|
15546
15590
|
pointer-events: none;
|
|
15547
15591
|
cursor: not-allowed;
|
|
15548
15592
|
}
|
|
15549
|
-
`;let
|
|
15593
|
+
`;let Nm=class extends Re{constructor(){super(...arguments),this.link=null,this.active=!1,this.type="default",this.expanded=!1,this.disabled=!1}static get styles(){return[lm]}toggleExpand(){"dropdown"!==this.type&&"popover"!==this.type||this.disabled||(this.expanded=!this.expanded)}connectedCallback(){super.connectedCallback(),this.link&&window.location.pathname===this.link&&(this.active=!0)}handleSelect(e){if(e.preventDefault(),this.disabled)return void e.stopImmediatePropagation();this.link||e.preventDefault();const t=this.closest("nile-side-bar");t&&t.querySelectorAll("nile-side-bar-group-item[active]").forEach((e=>{e!==this&&(e.active=!1,e.expanded=!1)})),this.active=!0,"dropdown"!==this.type&&"popover"!==this.type||this.disabled||(this.expanded=!0),this.dispatchEvent(new CustomEvent("nile-click",{bubbles:!0,composed:!0,detail:{href:this.link,text:this.textContent?.trim()||"",type:this.type}}))}render(){const e="dropdown"===this.type||"popover"===this.type;return R`
|
|
15550
15594
|
<div
|
|
15551
15595
|
part="base"
|
|
15552
15596
|
class="group-item ${this.disabled?"disabled":""}"
|
|
@@ -15590,7 +15634,7 @@ justify-content: center;
|
|
|
15590
15634
|
<slot name="content"></slot>
|
|
15591
15635
|
</div>
|
|
15592
15636
|
`:null}
|
|
15593
|
-
`}};e([ce({type:String})],
|
|
15637
|
+
`}};e([ce({type:String})],Nm.prototype,"link",void 0),e([ce({type:Boolean,reflect:!0,attribute:!0})],Nm.prototype,"active",void 0),e([ce({type:String,reflect:!0})],Nm.prototype,"type",void 0),e([ce({type:Boolean,reflect:!0})],Nm.prototype,"expanded",void 0),e([ce({type:Boolean,reflect:!0})],Nm.prototype,"disabled",void 0),Nm=e([Ne("nile-side-bar-group-item")],Nm);const gm=r`
|
|
15594
15638
|
:host {
|
|
15595
15639
|
display: inline-flex;
|
|
15596
15640
|
align-items: center;
|
|
@@ -15623,7 +15667,7 @@ justify-content: center;
|
|
|
15623
15667
|
padding-right: var(--nile-spacing-sm, var(--ng-spacing-sm));
|
|
15624
15668
|
overflow-x: hidden;
|
|
15625
15669
|
}
|
|
15626
|
-
`;let
|
|
15670
|
+
`;let um=class extends Re{constructor(){super(...arguments),this.icon="",this.tooltip="",this.method="fill",this.size="14",this.enableVisibilityEffect=!1,this.duration=200,this.sidebar=null}static get styles(){return[gm]}connectedCallback(){if(this.hasAttribute("slot")||this.setAttribute("slot","icon"),super.connectedCallback(),this.sidebar=this.closest("nile-side-bar"),this.sidebar){const e=new MutationObserver((()=>this.requestUpdate()));e.observe(this.sidebar,{attributes:!0,attributeFilter:["collapsed"]}),this._observer=e}}disconnectedCallback(){super.disconnectedCallback(),this._observer?.disconnect()}getSiblingText(){const e=this.parentElement,t=e?.querySelector("nile-side-bar-group-item-text");return t?.textContent?.trim()??""}render(){const e=!!this.sidebar?.collapsed,t=this.tooltip||this.getSiblingText();return e&&t?R`
|
|
15627
15671
|
|
|
15628
15672
|
<slot>
|
|
15629
15673
|
<nile-lite-tooltip hoist distance="18" content=${t} placement="right" enableVisibilityEffect=${this.enableVisibilityEffect} duration=${this.duration}>
|
|
@@ -15635,7 +15679,7 @@ justify-content: center;
|
|
|
15635
15679
|
<slot>
|
|
15636
15680
|
${this.icon?R`<nile-icon size=${this.size} color="var(--nile-colors-dark-900,var(--ng-colors-fg-quaternary-400))" size="14" name=${this.icon} method=${this.method}></nile-icon>`:null}
|
|
15637
15681
|
</slot>
|
|
15638
|
-
`}};e([ce({type:String,reflect:!0})],
|
|
15682
|
+
`}};e([ce({type:String,reflect:!0})],um.prototype,"icon",void 0),e([ce({type:String})],um.prototype,"tooltip",void 0),e([ce({type:String})],um.prototype,"method",void 0),e([ce({type:String})],um.prototype,"size",void 0),e([ce({type:Boolean,attribute:!0,reflect:!0})],um.prototype,"enableVisibilityEffect",void 0),e([ce({type:Number,attribute:!0,reflect:!0})],um.prototype,"duration",void 0),um=e([Ne("nile-side-bar-group-item-icon")],um);const cm=r`
|
|
15639
15683
|
:host {
|
|
15640
15684
|
display: block;
|
|
15641
15685
|
flex: 1 1 auto;
|
|
@@ -15657,7 +15701,7 @@ justify-content: center;
|
|
|
15657
15701
|
:host([collapsed]) {
|
|
15658
15702
|
display: none;
|
|
15659
15703
|
}
|
|
15660
|
-
`;let
|
|
15704
|
+
`;let Dm=class extends Re{static get styles(){return[cm]}connectedCallback(){super.connectedCallback(),this.hasAttribute("slot")||this.setAttribute("slot","text")}render(){return R` <slot></slot> `}};Dm=e([Ne("nile-side-bar-group-item-text")],Dm);const jm=r`
|
|
15661
15705
|
:host {
|
|
15662
15706
|
display: block;
|
|
15663
15707
|
bottom: var(--nile-spacing-md);
|
|
@@ -15694,11 +15738,11 @@ justify-content: center;
|
|
|
15694
15738
|
|
|
15695
15739
|
|
|
15696
15740
|
|
|
15697
|
-
`;let
|
|
15741
|
+
`;let Im=class extends Re{static get styles(){return[jm]}render(){return R`
|
|
15698
15742
|
<div part="base" class="footer">
|
|
15699
15743
|
<slot> </slot>
|
|
15700
15744
|
</div>
|
|
15701
|
-
`}};
|
|
15745
|
+
`}};Im=e([Ne("nile-side-bar-footer")],Im);const zm=r`
|
|
15702
15746
|
:host {
|
|
15703
15747
|
display: block;
|
|
15704
15748
|
width: 100%;
|
|
@@ -15786,13 +15830,13 @@ border: none;
|
|
|
15786
15830
|
height: 38px;
|
|
15787
15831
|
width: 38px;
|
|
15788
15832
|
}
|
|
15789
|
-
`;let
|
|
15833
|
+
`;let dm=class extends Re{constructor(){super(...arguments),this.type=null}static get styles(){return[zm]}handleClick(){this.dispatchEvent(new CustomEvent("nile-click",{detail:{type:this.type},bubbles:!0,composed:!0}))}render(){return R`
|
|
15790
15834
|
<div part="base" class="footer-item" @click=${this.handleClick}>
|
|
15791
15835
|
<slot name="icon" part="icon"></slot>
|
|
15792
15836
|
<slot name="text" part="text"></slot>
|
|
15793
15837
|
<slot name="action" part="action"></slot>
|
|
15794
15838
|
</div>
|
|
15795
|
-
`}};e([ce({type:String,reflect:!0})],
|
|
15839
|
+
`}};e([ce({type:String,reflect:!0})],dm.prototype,"type",void 0),dm=e([Ne("nile-side-bar-footer-item")],dm);const hm=r`
|
|
15796
15840
|
:host {
|
|
15797
15841
|
display: inline-block;
|
|
15798
15842
|
-webkit-font-smoothing: var(--nile-webkit-font-smoothing, var(--ng-webkit-font-smoothing));
|
|
@@ -15842,7 +15886,7 @@ border: none;
|
|
|
15842
15886
|
max-width: var(--auto-size-available-width) !important;
|
|
15843
15887
|
max-height: var(--auto-size-available-height) !important;
|
|
15844
15888
|
}
|
|
15845
|
-
`;class Am{static calculateAvailableSpace(e){const t=e.getBoundingClientRect(),i=window.innerHeight,M=window.innerWidth,n=i-t.bottom,o=t.top,r=M-t.right;return{spaceAbove:o,spaceBelow:n,spaceLeft:t.left,spaceRight:r,viewportHeight:i,viewportWidth:M}}static getOptimalPlacement(e){const{spaceAbove:t,spaceBelow:i,spaceLeft:M,spaceRight:n}=this.calculateAvailableSpace(e);return i>=200&&i>=t?"bottom":t>=200&&t>i?"top":n>=200&&n>=M?"right":M>=200?"left":"bottom"}static findBoundaryElements(e){const t=[];let i=e.parentElement;for(;i&&i!==document.body;){const e=window.getComputedStyle(i),M=e.overflow,n=e.overflowY,o=e.overflowX;"auto"!==M&&"scroll"!==M&&"auto"!==n&&"scroll"!==n&&"auto"!==o&&"scroll"!==o||t.push(i),(i.hasAttribute("data-floating-boundary")||i.classList.contains("floating-boundary")||i.classList.contains("scroll-container"))&&t.push(i),i=i.parentElement}return t.length>0?t:void 0}static calculateOptimalHeight(e,t,i){const M=t-(e.y+e.height),n=e.y;return i.startsWith("top")?Math.max(n-20,100):i.startsWith("bottom")?Math.max(M-20,100):(i.startsWith("left")||i.startsWith("right"),Math.max(Math.min(n,M)-20,100))}static extractStylesAsCSS(e){return"string"==typeof e?e:Array.isArray(e)?e.map((e=>this.extractStylesAsCSS(e))).join("\n"):e&&"object"==typeof e&&e.cssText?e.cssText:""}static generateStyleId(){return`nile-dropdown-styles-${Math.random().toString(36).substring(2,11)}`}static isPositioningOptimal(e,t){const{spaceAbove:i,spaceBelow:M,spaceLeft:n,spaceRight:o}=this.calculateAvailableSpace(t),r=e.startsWith("top"),s=e.startsWith("bottom"),a=e.startsWith("left"),l=e.startsWith("right");return!(r&&M>i)&&(!(s&&i>M)&&(!(a&&o>n)&&!(l&&n>o)))}static applyCollisionData(e,t,i){if(t.flip){const{overflows:M}=t.flip;if(e.setAttribute("data-placement",i),M&&M.length>0){const t=M.map((e=>e.placement)).join(",");e.setAttribute("data-overflow",t)}else e.removeAttribute("data-overflow")}if(t.shift){const{x:i,y:M}=t.shift;void 0===i||void 0===M||0===i&&0===M?e.removeAttribute("data-shift"):e.setAttribute("data-shift",`${i},${M}`)}if(t.size){const{availableWidth:i,availableHeight:M}=t.size;void 0!==i&&e.setAttribute("data-available-width",i.toString()),void 0!==M&&e.setAttribute("data-available-height",M.toString())}}}class Om{static createPortalPanel(e){const t=e.shadowRoot?.querySelector(".dropdown__panel");if(!t){const t=e.querySelector("[slot]");if(!t||"trigger"===t.getAttribute("slot"))return document.createElement("div")}let i=t?.assignedElements({flatten:!0})||[];if(0===i.length){i=Array.from(e.children).filter((e=>{const t=e.getAttribute("slot");return!t||"trigger"!==t}))}const M=document.createElement("div");return M.className="dropdown__panel",M.setAttribute("part","panel"),M.setAttribute("aria-hidden","false"),M.setAttribute("aria-labelledby","dropdown"),i.forEach((e=>{const t=e.cloneNode(!0);M.appendChild(t)})),M}static updatePortalPanel(e,t){if(!e)return;e.innerHTML="";const i=t.shadowRoot?.querySelector(".dropdown__panel");let M=i?.assignedElements({flatten:!0})||[];if(0===M.length){M=Array.from(t.children).filter((e=>{const t=e.getAttribute("slot");return!t||"trigger"!==t}))}M.forEach((t=>{const i=t.cloneNode(!0);e.appendChild(i)}))}}class pm{static setupPortalEventListeners(e,t){e&&(this.setupMenuSelectListeners(e,t),this.setupKeyDownListeners(e,t))}static setupMenuSelectListeners(e,t){e&&e.addEventListener("nile-select",(e=>{const i=e;t.handlePanelSelect&&t.handlePanelSelect(i)}))}static setupKeyDownListeners(e,t){e&&e.addEventListener("keydown",(e=>{t.handleKeyDown&&t.handleKeyDown(e)}))}}class xm{constructor(e){this.portalContainer=null,this.measuredPanelHeight=null,this.clonedPanel=null,this.cleanupAutoUpdate=null,this.currentPlacement="bottom-start",this.currentMiddlewareData=null,this.boundHandleWindowResize=null,this.component=e}createPortalAppendContainer(){const e=document.createElement("div");return e.style.position="absolute",e.style.zIndex="9999",e.style.pointerEvents="none",e.style.width="auto",e.style.maxWidth="none",e.style.minWidth="auto",e.className="nile-dropdown-portal-append",e}positionPortalAppend(){this.portalContainer&&this.component.open&&(this.measurePanelHeight(),this.computeFloatingUIPosition())}measurePanelHeight(){!this.measuredPanelHeight&&this.portalContainer&&(this.portalContainer.style.position="absolute",this.portalContainer.style.visibility="hidden",this.portalContainer.style.top="0px",this.portalContainer.style.left="0px",this.portalContainer.offsetHeight,this.measuredPanelHeight=this.portalContainer.offsetHeight,this.portalContainer.style.visibility="")}async computeFloatingUIPosition(){if(!this.portalContainer)return;const e=this.component.shadowRoot?.querySelector('[slot="anchor"]')?.assignedElements({flatten:!0})[0]||this.component.querySelector('[slot="trigger"]')?.assignedElements({flatten:!0})[0]||this.component,t=this.portalContainer;try{const{x:i,y:M,placement:n,middlewareData:o}=await this.calculateFloatingUIPosition(e,t);this.applyFloatingUIPosition(t,e,i,M,n,o)}catch(e){console.warn("Floating UI positioning failed, falling back to simple positioning:",e),this.fallbackPositioning()}}async calculateFloatingUIPosition(e,t){const i=Am.findBoundaryElements(e),M=this.getInitialPlacement(),n=this.createFloatingUIMiddleware(i);return await Ji(e,t,{placement:M,strategy:"fixed",middleware:n,platform:this.createCustomPlatform()})}getInitialPlacement(){return this.component.placement||"bottom-start"}createFloatingUIMiddleware(e){const t=[Bi(this.component.distance||0)];return this.component.sync&&t.push(Fi({apply:this.handleSizeMiddleware.bind(this),padding:10,boundary:e})),t.push(_i({fallbackPlacements:this.getFallbackPlacements(),fallbackStrategy:"bestFit",padding:10,boundary:e})),t.push(Gi({padding:10,crossAxis:!0,boundary:e})),t}handleSizeMiddleware({availableWidth:e,availableHeight:t,elements:i,rects:M}){const n=Am.calculateOptimalHeight(M.reference,window.innerHeight,this.currentPlacement);"width"!==this.component.sync&&"both"!==this.component.sync||(i.floating.style.width=`${M.reference.width}px`),"height"!==this.component.sync&&"both"!==this.component.sync||(i.floating.style.height=`${M.reference.height}px`),i.floating.style.maxHeight=`${n}px`,i.floating.style.setProperty("--auto-size-available-width",`${e}px`),i.floating.style.setProperty("--auto-size-available-height",`${n}px`)}getFallbackPlacements(){const e=this.component.placement||"bottom-start",t=[];return e.startsWith("top")?t.push("bottom-start","bottom","bottom-end","top","top-end","right-start","left-start"):e.startsWith("bottom")?t.push("top-start","top","top-end","bottom","bottom-end","right-start","left-start"):e.startsWith("left")?t.push("right-start","right","right-end","left","left-end","top-start","bottom-start"):e.startsWith("right")&&t.push("left-start","left","left-end","right","right-end","top-start","bottom-start"),t}createCustomPlatform(){return Wi}applyFloatingUIPosition(e,t,i,M,n,o){const r=t.getBoundingClientRect();Object.assign(e.style,{left:`${i}px`,top:`${M}px`,position:"fixed",pointerEvents:"auto",width:"auto",minWidth:"auto"}),"width"!==this.component.sync&&"both"!==this.component.sync||(e.style.width=`${r.width}px`),this.currentPlacement=n,this.currentMiddlewareData=o,Am.applyCollisionData(e,o,n);const s=n.split("-")[0];e.className=`nile-dropdown-portal-append dropdown--open dropdown__panel--${s}`}fallbackPositioning(){if(!this.portalContainer)return;const e=(this.component.shadowRoot?.querySelector('[slot="anchor"]')?.assignedElements({flatten:!0})[0]||this.component.querySelector('[slot="trigger"]')?.assignedElements({flatten:!0})[0]||this.component).getBoundingClientRect(),t=window.innerHeight,i=window.innerWidth,M=t-e.bottom,n=e.top,o=i-e.right,r=e.left;let s,a,l,N=e.left;const g=this.component.placement||"bottom-start";g.startsWith("bottom")?(l=Math.max(M-20,100),s=e.bottom+(this.component.distance||0),a="bottom"):g.startsWith("top")?(l=Math.max(n-20,100),s=Math.max(e.top-l-(this.component.distance||0),10),a="top"):g.startsWith("right")?(l=Math.max(Math.min(o,M,n)-20,100),s=e.top,N=e.right+(this.component.distance||0),a="right"):(l=Math.max(Math.min(r,M,n)-20,100),s=e.top,N=Math.max(e.left-200-(this.component.distance||0),10),a="left"),this.portalContainer.style.left=`${N}px`,this.portalContainer.style.top=`${s}px`,this.portalContainer.style.maxHeight=`${l}px`,this.portalContainer.style.pointerEvents="auto",this.portalContainer.style.width="auto",this.portalContainer.style.minWidth="auto","width"!==this.component.sync&&"both"!==this.component.sync||(this.portalContainer.style.width=`${e.width}px`),this.portalContainer.className=`nile-dropdown-portal-append dropdown__panel--${a}`,this.calculateAndSetAutoSizeProperties(e,s,a)}calculateAndSetAutoSizeProperties(e,t,i){if(!this.portalContainer)return;const M=window.innerHeight,n=window.innerWidth;let o,r=n-e.left-10;"top"===i?o=e.top-10:"bottom"===i?o=M-e.bottom-10:"left"===i?(o=Math.min(M-e.top,e.bottom),r=e.left-10):(o=Math.min(M-e.top,e.bottom),r=n-e.right-10),this.portalContainer.style.setProperty("--auto-size-available-height",`${Math.max(o,100)}px`),this.portalContainer.style.setProperty("--auto-size-available-width",`${Math.max(r,200)}px`)}updatePortalAppendPosition(){this.component.portal&&this.portalContainer&&this.positionPortalAppend()}handleWindowResize(){this.component.portal&&this.portalContainer&&this.positionPortalAppend()}setupAutoUpdatePositioning(){if(!this.portalContainer||!this.component)return;this.cleanupAutoUpdatePositioning();const e=this.component.shadowRoot?.querySelector('[slot="anchor"]')?.assignedElements({flatten:!0})[0]||this.component.querySelector('[slot="trigger"]')?.assignedElements({flatten:!0})[0]||this.component;this.cleanupAutoUpdate=Ri(e,this.portalContainer,(()=>{this.computeFloatingUIPosition()}),{ancestorScroll:!0,ancestorResize:!0,elementResize:!0,layoutShift:!0,animationFrame:!0})}cleanupAutoUpdatePositioning(){this.cleanupAutoUpdate&&(this.cleanupAutoUpdate(),this.cleanupAutoUpdate=null)}injectStylesToDocument(){if(!this.portalContainer)return;const e=Am.generateStyleId();if(document.getElementById(e))return;const t=this.component.constructor.styles;if(!t)return;const i=document.createElement("style");i.id=e,i.textContent=Am.extractStylesAsCSS(t),document.head.appendChild(i),this.portalContainer.__injectedStyleId=e}adoptStylesToPortalAppend(){this.portalContainer&&this.injectStylesToDocument()}setupPortalAppend(){this.component.portal&&this.component.updateComplete.then((()=>{setTimeout((()=>{this.component.open&&(this.clonedPanel=this.createPortalPanel(),this.portalContainer=this.createPortalAppendContainer(),this.portalContainer.appendChild(this.clonedPanel),document.body.appendChild(this.portalContainer),this.adoptStylesToPortalAppend(),this.clonedPanel.style.display="",this.positionPortalAppend(),this.setupPortalEventListeners(),this.setupAutoUpdatePositioning(),this.boundHandleWindowResize=this.handleWindowResize.bind(this),window.addEventListener("resize",this.boundHandleWindowResize))}),10)}))}createPortalPanel(){return Om.createPortalPanel(this.component)}setupPortalEventListeners(){pm.setupPortalEventListeners(this.clonedPanel,this.component)}cleanupPortalAppend(){if(this.cleanupAutoUpdatePositioning(),this.portalContainer&&this.portalContainer.parentNode){const e=this.portalContainer.__injectedStyleId;if(e){const t=document.getElementById(e);t&&t.remove()}this.portalContainer.parentNode.removeChild(this.portalContainer)}this.boundHandleWindowResize&&(window.removeEventListener("resize",this.boundHandleWindowResize),this.boundHandleWindowResize=null),this.portalContainer=null,this.clonedPanel=null,this.measuredPanelHeight=null,this.currentPlacement="bottom-start",this.currentMiddlewareData=null}get portalContainerElement(){return this.portalContainer}resetMeasuredHeight(){this.measuredPanelHeight=null}forceReposition(){this.portalContainer&&this.computeFloatingUIPosition()}getCurrentPlacement(){return this.currentPlacement}getCurrentMiddlewareData(){return this.currentMiddlewareData}isUsingFloatingUI(){return null!==this.cleanupAutoUpdate}isPositioningOptimal(){if(!this.portalContainer||!this.currentMiddlewareData)return!0;const e=(this.component.shadowRoot?.querySelector('[slot="anchor"]')?.assignedElements({flatten:!0})[0]||this.component.querySelector('[slot="trigger"]')?.assignedElements({flatten:!0})[0]||this.component).getBoundingClientRect(),t=window.innerHeight-e.bottom,i=e.top,M=this.currentPlacement.startsWith("top"),n=this.currentPlacement.startsWith("bottom");return!(M&&t>i)&&!(n&&i>t)}updatePortalPanel(){this.portalContainer&&this.clonedPanel&&(Om.updatePortalPanel(this.clonedPanel,this.component),this.forceReposition())}}let Lm=class extends Re{constructor(){super(...arguments),this.open=!1,this.placement="bottom-start",this.disabled=!1,this.stayOpenOnSelect=!1,this.distance=0,this.skidding=0,this.hoist=!1,this.portal=!1,this.portalManager=null,this.triggerDropdown="click"}connectedCallback(){super.connectedCallback(),this.handlePanelSelect=this.handlePanelSelect.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleDocumentKeyDown=this.handleDocumentKeyDown.bind(this),this.handleDocumentMouseDown=this.handleDocumentMouseDown.bind(this),this.handleTriggerMouseEnter=this.handleTriggerMouseEnter.bind(this),this.handleTriggerMouseLeave=this.handleTriggerMouseLeave.bind(this),this.containingElement||(this.containingElement=this),this.emit("nile-init"),requestAnimationFrame((()=>{this.portal&&!this.portalManager&&(this.portalManager=new xm(this))}))}firstUpdated(){if(this.panel.hidden=!this.open,"hover"===this.triggerDropdown){const e=this.trigger;e&&(e.addEventListener("mouseenter",this.handleTriggerMouseEnter),e.addEventListener("mouseleave",this.handleTriggerMouseLeave)),this.panel&&(this.panel.addEventListener("mouseenter",this.handleTriggerMouseEnter),this.panel.addEventListener("mouseleave",this.handleTriggerMouseLeave))}this.open&&(this.addOpenListeners(),this.popup.active=!0)}handleTriggerMouseEnter(){clearTimeout(this.hoverTimeout),this.show()}handleTriggerMouseLeave(){clearTimeout(this.hoverTimeout),this.hoverTimeout=window.setTimeout((()=>this.hide()),200)}disconnectedCallback(){super.disconnectedCallback(),this.removeOpenListeners(),this.hide(),this.emit("nile-destroy"),this.portalManager&&(this.portalManager.cleanupPortalAppend(),this.portalManager=null)}focusOnTrigger(){const e=this.trigger.assignedElements({flatten:!0})[0];"function"==typeof e?.focus&&e.focus()}getMenu(){return this.panel.assignedElements({flatten:!0}).find((e=>"nile-menu"===e.tagName.toLowerCase()))}handleKeyDown(e){this.open&&"Escape"===e.key&&(e.stopPropagation(),this.hide(),this.focusOnTrigger())}handleDocumentKeyDown(e){if("Escape"===e.key&&this.open)return e.stopPropagation(),this.focusOnTrigger(),void this.hide();"Tab"===e.key&&setTimeout((()=>{const e=this.containingElement?.getRootNode()instanceof ShadowRoot?document.activeElement?.shadowRoot?.activeElement:document.activeElement,t=this.containingElement&&e?.closest(this.containingElement.tagName.toLowerCase())===this.containingElement,i=this.portal&&this.portalManager?.portalContainerElement&&(e===this.portalManager.portalContainerElement||e?.closest(".nile-dropdown-portal-append")===this.portalManager.portalContainerElement);t||i||this.hide()}))}handleDocumentMouseDown(e){const t=e.composedPath(),i=this.containingElement&&t.includes(this.containingElement),M=this.portal&&this.portalManager?.portalContainerElement&&t.includes(this.portalManager.portalContainerElement);i||M||this.hide()}handlePanelSelect(e){const t=e.target;this.stayOpenOnSelect||"nile-menu"!==t.tagName.toLowerCase()||(this.hide(),this.focusOnTrigger())}handleTriggerClick(){this.open?this.hide():(this.show(),this.focusOnTrigger())}handleTriggerKeyDown(e){const t=this.getMenu();if(t){const i=t.getAllItems(),M=i[0],n=i[i.length-1];["ArrowDown","ArrowUp","Home","End"].includes(e.key)&&(e.preventDefault(),this.open||this.show(),i.length>0&&this.updateComplete.then((()=>{"ArrowDown"!==e.key&&"Home"!==e.key||(t.setCurrentItem(M),M.focus()),"ArrowUp"!==e.key&&"End"!==e.key||(t.setCurrentItem(n),n.focus())})))}}handleTriggerKeyUp(e){" "===e.key&&e.preventDefault()}handleTriggerSlotChange(){this.updateAccessibleTrigger()}updateAccessibleTrigger(){const e=this.trigger.assignedElements({flatten:!0}).find((e=>Et(e).start));let t;if(e){switch(e.tagName.toLowerCase()){case"nile-button":case"nile-icon-button":t=e.button;break;default:t=e}t.setAttribute("aria-haspopup","true"),t.setAttribute("aria-expanded",this.open?"true":"false")}}async show(){if(!this.open)return this.open=!0,St(this,"nile-after-show")}async hide(){if(this.open)return this.open=!1,St(this,"nile-after-hide")}reposition(){this.popup.reposition()}addOpenListeners(){this.panel.addEventListener("nile-select",this.handlePanelSelect),this.panel.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keydown",this.handleDocumentKeyDown),document.addEventListener("mousedown",this.handleDocumentMouseDown)}removeOpenListeners(){this.panel&&(this.panel.removeEventListener("nile-select",this.handlePanelSelect),this.panel.removeEventListener("keydown",this.handleKeyDown)),document.removeEventListener("keydown",this.handleDocumentKeyDown),document.removeEventListener("mousedown",this.handleDocumentMouseDown)}updated(e){super.updated(e),e.has("portal")&&(this.portal&&!this.portalManager?(this.portalManager=new xm(this),this.open&&this.portalManager.setupPortalAppend()):!this.portal&&this.portalManager&&(this.portalManager.cleanupPortalAppend(),this.portalManager=null))}async handleOpenChange(){if(this.disabled)this.open=!1;else if(this.updateAccessibleTrigger(),this.open){if(this.emit("nile-show"),this.addOpenListeners(),this.portal&&this.portalManager?this.portalManager.setupPortalAppend():this.portal&&!this.portalManager&&(this.portalManager=new xm(this),this.portalManager.setupPortalAppend()),await jt(this),!this.portal){this.panel.hidden=!1,this.popup.active=!0;const{keyframes:e,options:t}=yt(this,"dropdown.show",{dir:""});await ut(this.popup.popup,e,t)}this.emit("nile-after-show")}else{if(this.emit("nile-hide"),this.removeOpenListeners(),this.portal&&this.portalManager&&this.portalManager.cleanupPortalAppend(),await jt(this),!this.portal){const{keyframes:e,options:t}=yt(this,"dropdown.hide",{dir:""});await ut(this.popup.popup,e,t),this.panel.hidden=!0,this.popup.active=!1}this.emit("nile-after-hide")}}render(){return R`
|
|
15889
|
+
`;class Tm{static calculateAvailableSpace(e){const t=e.getBoundingClientRect(),i=window.innerHeight,M=window.innerWidth,n=i-t.bottom,o=t.top,r=M-t.right;return{spaceAbove:o,spaceBelow:n,spaceLeft:t.left,spaceRight:r,viewportHeight:i,viewportWidth:M}}static getOptimalPlacement(e){const{spaceAbove:t,spaceBelow:i,spaceLeft:M,spaceRight:n}=this.calculateAvailableSpace(e);return i>=200&&i>=t?"bottom":t>=200&&t>i?"top":n>=200&&n>=M?"right":M>=200?"left":"bottom"}static findBoundaryElements(e){const t=[];let i=e.parentElement;for(;i&&i!==document.body;){const e=window.getComputedStyle(i),M=e.overflow,n=e.overflowY,o=e.overflowX;"auto"!==M&&"scroll"!==M&&"auto"!==n&&"scroll"!==n&&"auto"!==o&&"scroll"!==o||t.push(i),(i.hasAttribute("data-floating-boundary")||i.classList.contains("floating-boundary")||i.classList.contains("scroll-container"))&&t.push(i),i=i.parentElement}return t.length>0?t:void 0}static calculateOptimalHeight(e,t,i){const M=t-(e.y+e.height),n=e.y;return i.startsWith("top")?Math.max(n-20,100):i.startsWith("bottom")?Math.max(M-20,100):(i.startsWith("left")||i.startsWith("right"),Math.max(Math.min(n,M)-20,100))}static extractStylesAsCSS(e){return"string"==typeof e?e:Array.isArray(e)?e.map((e=>this.extractStylesAsCSS(e))).join("\n"):e&&"object"==typeof e&&e.cssText?e.cssText:""}static generateStyleId(){return`nile-dropdown-styles-${Math.random().toString(36).substring(2,11)}`}static isPositioningOptimal(e,t){const{spaceAbove:i,spaceBelow:M,spaceLeft:n,spaceRight:o}=this.calculateAvailableSpace(t),r=e.startsWith("top"),s=e.startsWith("bottom"),a=e.startsWith("left"),l=e.startsWith("right");return!(r&&M>i)&&(!(s&&i>M)&&(!(a&&o>n)&&!(l&&n>o)))}static applyCollisionData(e,t,i){if(t.flip){const{overflows:M}=t.flip;if(e.setAttribute("data-placement",i),M&&M.length>0){const t=M.map((e=>e.placement)).join(",");e.setAttribute("data-overflow",t)}else e.removeAttribute("data-overflow")}if(t.shift){const{x:i,y:M}=t.shift;void 0===i||void 0===M||0===i&&0===M?e.removeAttribute("data-shift"):e.setAttribute("data-shift",`${i},${M}`)}if(t.size){const{availableWidth:i,availableHeight:M}=t.size;void 0!==i&&e.setAttribute("data-available-width",i.toString()),void 0!==M&&e.setAttribute("data-available-height",M.toString())}}}class ym{static createPortalPanel(e){const t=e.shadowRoot?.querySelector(".dropdown__panel");if(!t){const t=e.querySelector("[slot]");if(!t||"trigger"===t.getAttribute("slot"))return document.createElement("div")}let i=t?.assignedElements({flatten:!0})||[];if(0===i.length){i=Array.from(e.children).filter((e=>{const t=e.getAttribute("slot");return!t||"trigger"!==t}))}const M=document.createElement("div");return M.className="dropdown__panel",M.setAttribute("part","panel"),M.setAttribute("aria-hidden","false"),M.setAttribute("aria-labelledby","dropdown"),i.forEach((e=>{const t=e.cloneNode(!0);M.appendChild(t)})),M}static updatePortalPanel(e,t){if(!e)return;e.innerHTML="";const i=t.shadowRoot?.querySelector(".dropdown__panel");let M=i?.assignedElements({flatten:!0})||[];if(0===M.length){M=Array.from(t.children).filter((e=>{const t=e.getAttribute("slot");return!t||"trigger"!==t}))}M.forEach((t=>{const i=t.cloneNode(!0);e.appendChild(i)}))}}class Am{static setupPortalEventListeners(e,t){e&&(this.setupMenuSelectListeners(e,t),this.setupKeyDownListeners(e,t))}static setupMenuSelectListeners(e,t){e&&e.addEventListener("nile-select",(e=>{const i=e;t.handlePanelSelect&&t.handlePanelSelect(i)}))}static setupKeyDownListeners(e,t){e&&e.addEventListener("keydown",(e=>{t.handleKeyDown&&t.handleKeyDown(e)}))}}class Om{constructor(e){this.portalContainer=null,this.measuredPanelHeight=null,this.clonedPanel=null,this.cleanupAutoUpdate=null,this.currentPlacement="bottom-start",this.currentMiddlewareData=null,this.boundHandleWindowResize=null,this.component=e}createPortalAppendContainer(){const e=document.createElement("div");return e.style.position="absolute",e.style.zIndex="9999",e.style.pointerEvents="none",e.style.width="auto",e.style.maxWidth="none",e.style.minWidth="auto",e.className="nile-dropdown-portal-append",e}positionPortalAppend(){this.portalContainer&&this.component.open&&(this.measurePanelHeight(),this.computeFloatingUIPosition())}measurePanelHeight(){!this.measuredPanelHeight&&this.portalContainer&&(this.portalContainer.style.position="absolute",this.portalContainer.style.visibility="hidden",this.portalContainer.style.top="0px",this.portalContainer.style.left="0px",this.portalContainer.offsetHeight,this.measuredPanelHeight=this.portalContainer.offsetHeight,this.portalContainer.style.visibility="")}async computeFloatingUIPosition(){if(!this.portalContainer)return;const e=this.component.shadowRoot?.querySelector('[slot="anchor"]')?.assignedElements({flatten:!0})[0]||this.component.querySelector('[slot="trigger"]')?.assignedElements({flatten:!0})[0]||this.component,t=this.portalContainer;try{const{x:i,y:M,placement:n,middlewareData:o}=await this.calculateFloatingUIPosition(e,t);this.applyFloatingUIPosition(t,e,i,M,n,o)}catch(e){console.warn("Floating UI positioning failed, falling back to simple positioning:",e),this.fallbackPositioning()}}async calculateFloatingUIPosition(e,t){const i=Tm.findBoundaryElements(e),M=this.getInitialPlacement(),n=this.createFloatingUIMiddleware(i);return await Ji(e,t,{placement:M,strategy:"fixed",middleware:n,platform:this.createCustomPlatform()})}getInitialPlacement(){return this.component.placement||"bottom-start"}createFloatingUIMiddleware(e){const t=[Bi(this.component.distance||0)];return this.component.sync&&t.push(Fi({apply:this.handleSizeMiddleware.bind(this),padding:10,boundary:e})),t.push(_i({fallbackPlacements:this.getFallbackPlacements(),fallbackStrategy:"bestFit",padding:10,boundary:e})),t.push(Gi({padding:10,crossAxis:!0,boundary:e})),t}handleSizeMiddleware({availableWidth:e,availableHeight:t,elements:i,rects:M}){const n=Tm.calculateOptimalHeight(M.reference,window.innerHeight,this.currentPlacement);"width"!==this.component.sync&&"both"!==this.component.sync||(i.floating.style.width=`${M.reference.width}px`),"height"!==this.component.sync&&"both"!==this.component.sync||(i.floating.style.height=`${M.reference.height}px`),i.floating.style.maxHeight=`${n}px`,i.floating.style.setProperty("--auto-size-available-width",`${e}px`),i.floating.style.setProperty("--auto-size-available-height",`${n}px`)}getFallbackPlacements(){const e=this.component.placement||"bottom-start",t=[];return e.startsWith("top")?t.push("bottom-start","bottom","bottom-end","top","top-end","right-start","left-start"):e.startsWith("bottom")?t.push("top-start","top","top-end","bottom","bottom-end","right-start","left-start"):e.startsWith("left")?t.push("right-start","right","right-end","left","left-end","top-start","bottom-start"):e.startsWith("right")&&t.push("left-start","left","left-end","right","right-end","top-start","bottom-start"),t}createCustomPlatform(){return Wi}applyFloatingUIPosition(e,t,i,M,n,o){const r=t.getBoundingClientRect();Object.assign(e.style,{left:`${i}px`,top:`${M}px`,position:"fixed",pointerEvents:"auto",width:"auto",minWidth:"auto"}),"width"!==this.component.sync&&"both"!==this.component.sync||(e.style.width=`${r.width}px`),this.currentPlacement=n,this.currentMiddlewareData=o,Tm.applyCollisionData(e,o,n);const s=n.split("-")[0];e.className=`nile-dropdown-portal-append dropdown--open dropdown__panel--${s}`}fallbackPositioning(){if(!this.portalContainer)return;const e=(this.component.shadowRoot?.querySelector('[slot="anchor"]')?.assignedElements({flatten:!0})[0]||this.component.querySelector('[slot="trigger"]')?.assignedElements({flatten:!0})[0]||this.component).getBoundingClientRect(),t=window.innerHeight,i=window.innerWidth,M=t-e.bottom,n=e.top,o=i-e.right,r=e.left;let s,a,l,N=e.left;const g=this.component.placement||"bottom-start";g.startsWith("bottom")?(l=Math.max(M-20,100),s=e.bottom+(this.component.distance||0),a="bottom"):g.startsWith("top")?(l=Math.max(n-20,100),s=Math.max(e.top-l-(this.component.distance||0),10),a="top"):g.startsWith("right")?(l=Math.max(Math.min(o,M,n)-20,100),s=e.top,N=e.right+(this.component.distance||0),a="right"):(l=Math.max(Math.min(r,M,n)-20,100),s=e.top,N=Math.max(e.left-200-(this.component.distance||0),10),a="left"),this.portalContainer.style.left=`${N}px`,this.portalContainer.style.top=`${s}px`,this.portalContainer.style.maxHeight=`${l}px`,this.portalContainer.style.pointerEvents="auto",this.portalContainer.style.width="auto",this.portalContainer.style.minWidth="auto","width"!==this.component.sync&&"both"!==this.component.sync||(this.portalContainer.style.width=`${e.width}px`),this.portalContainer.className=`nile-dropdown-portal-append dropdown__panel--${a}`,this.calculateAndSetAutoSizeProperties(e,s,a)}calculateAndSetAutoSizeProperties(e,t,i){if(!this.portalContainer)return;const M=window.innerHeight,n=window.innerWidth;let o,r=n-e.left-10;"top"===i?o=e.top-10:"bottom"===i?o=M-e.bottom-10:"left"===i?(o=Math.min(M-e.top,e.bottom),r=e.left-10):(o=Math.min(M-e.top,e.bottom),r=n-e.right-10),this.portalContainer.style.setProperty("--auto-size-available-height",`${Math.max(o,100)}px`),this.portalContainer.style.setProperty("--auto-size-available-width",`${Math.max(r,200)}px`)}updatePortalAppendPosition(){this.component.portal&&this.portalContainer&&this.positionPortalAppend()}handleWindowResize(){this.component.portal&&this.portalContainer&&this.positionPortalAppend()}setupAutoUpdatePositioning(){if(!this.portalContainer||!this.component)return;this.cleanupAutoUpdatePositioning();const e=this.component.shadowRoot?.querySelector('[slot="anchor"]')?.assignedElements({flatten:!0})[0]||this.component.querySelector('[slot="trigger"]')?.assignedElements({flatten:!0})[0]||this.component;this.cleanupAutoUpdate=Ri(e,this.portalContainer,(()=>{this.computeFloatingUIPosition()}),{ancestorScroll:!0,ancestorResize:!0,elementResize:!0,layoutShift:!0,animationFrame:!0})}cleanupAutoUpdatePositioning(){this.cleanupAutoUpdate&&(this.cleanupAutoUpdate(),this.cleanupAutoUpdate=null)}injectStylesToDocument(){if(!this.portalContainer)return;const e=Tm.generateStyleId();if(document.getElementById(e))return;const t=this.component.constructor.styles;if(!t)return;const i=document.createElement("style");i.id=e,i.textContent=Tm.extractStylesAsCSS(t),document.head.appendChild(i),this.portalContainer.__injectedStyleId=e}adoptStylesToPortalAppend(){this.portalContainer&&this.injectStylesToDocument()}setupPortalAppend(){this.component.portal&&this.component.updateComplete.then((()=>{setTimeout((()=>{this.component.open&&(this.clonedPanel=this.createPortalPanel(),this.portalContainer=this.createPortalAppendContainer(),this.portalContainer.appendChild(this.clonedPanel),document.body.appendChild(this.portalContainer),this.adoptStylesToPortalAppend(),this.clonedPanel.style.display="",this.positionPortalAppend(),this.setupPortalEventListeners(),this.setupAutoUpdatePositioning(),this.boundHandleWindowResize=this.handleWindowResize.bind(this),window.addEventListener("resize",this.boundHandleWindowResize))}),10)}))}createPortalPanel(){return ym.createPortalPanel(this.component)}setupPortalEventListeners(){Am.setupPortalEventListeners(this.clonedPanel,this.component)}cleanupPortalAppend(){if(this.cleanupAutoUpdatePositioning(),this.portalContainer&&this.portalContainer.parentNode){const e=this.portalContainer.__injectedStyleId;if(e){const t=document.getElementById(e);t&&t.remove()}this.portalContainer.parentNode.removeChild(this.portalContainer)}this.boundHandleWindowResize&&(window.removeEventListener("resize",this.boundHandleWindowResize),this.boundHandleWindowResize=null),this.portalContainer=null,this.clonedPanel=null,this.measuredPanelHeight=null,this.currentPlacement="bottom-start",this.currentMiddlewareData=null}get portalContainerElement(){return this.portalContainer}resetMeasuredHeight(){this.measuredPanelHeight=null}forceReposition(){this.portalContainer&&this.computeFloatingUIPosition()}getCurrentPlacement(){return this.currentPlacement}getCurrentMiddlewareData(){return this.currentMiddlewareData}isUsingFloatingUI(){return null!==this.cleanupAutoUpdate}isPositioningOptimal(){if(!this.portalContainer||!this.currentMiddlewareData)return!0;const e=(this.component.shadowRoot?.querySelector('[slot="anchor"]')?.assignedElements({flatten:!0})[0]||this.component.querySelector('[slot="trigger"]')?.assignedElements({flatten:!0})[0]||this.component).getBoundingClientRect(),t=window.innerHeight-e.bottom,i=e.top,M=this.currentPlacement.startsWith("top"),n=this.currentPlacement.startsWith("bottom");return!(M&&t>i)&&!(n&&i>t)}updatePortalPanel(){this.portalContainer&&this.clonedPanel&&(ym.updatePortalPanel(this.clonedPanel,this.component),this.forceReposition())}}let pm=class extends Re{constructor(){super(...arguments),this.open=!1,this.placement="bottom-start",this.disabled=!1,this.stayOpenOnSelect=!1,this.distance=0,this.skidding=0,this.hoist=!1,this.portal=!1,this.portalManager=null,this.triggerDropdown="click"}connectedCallback(){super.connectedCallback(),this.handlePanelSelect=this.handlePanelSelect.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleDocumentKeyDown=this.handleDocumentKeyDown.bind(this),this.handleDocumentMouseDown=this.handleDocumentMouseDown.bind(this),this.handleTriggerMouseEnter=this.handleTriggerMouseEnter.bind(this),this.handleTriggerMouseLeave=this.handleTriggerMouseLeave.bind(this),this.containingElement||(this.containingElement=this),this.emit("nile-init"),requestAnimationFrame((()=>{this.portal&&!this.portalManager&&(this.portalManager=new Om(this))}))}firstUpdated(){if(this.panel.hidden=!this.open,"hover"===this.triggerDropdown){const e=this.trigger;e&&(e.addEventListener("mouseenter",this.handleTriggerMouseEnter),e.addEventListener("mouseleave",this.handleTriggerMouseLeave)),this.panel&&(this.panel.addEventListener("mouseenter",this.handleTriggerMouseEnter),this.panel.addEventListener("mouseleave",this.handleTriggerMouseLeave))}this.open&&(this.addOpenListeners(),this.popup.active=!0)}handleTriggerMouseEnter(){clearTimeout(this.hoverTimeout),this.show()}handleTriggerMouseLeave(){clearTimeout(this.hoverTimeout),this.hoverTimeout=window.setTimeout((()=>this.hide()),200)}disconnectedCallback(){super.disconnectedCallback(),this.removeOpenListeners(),this.hide(),this.emit("nile-destroy"),this.portalManager&&(this.portalManager.cleanupPortalAppend(),this.portalManager=null)}focusOnTrigger(){const e=this.trigger.assignedElements({flatten:!0})[0];"function"==typeof e?.focus&&e.focus()}getMenu(){return this.panel.assignedElements({flatten:!0}).find((e=>"nile-menu"===e.tagName.toLowerCase()))}handleKeyDown(e){this.open&&"Escape"===e.key&&(e.stopPropagation(),this.hide(),this.focusOnTrigger())}handleDocumentKeyDown(e){if("Escape"===e.key&&this.open)return e.stopPropagation(),this.focusOnTrigger(),void this.hide();"Tab"===e.key&&setTimeout((()=>{const e=this.containingElement?.getRootNode()instanceof ShadowRoot?document.activeElement?.shadowRoot?.activeElement:document.activeElement,t=this.containingElement&&e?.closest(this.containingElement.tagName.toLowerCase())===this.containingElement,i=this.portal&&this.portalManager?.portalContainerElement&&(e===this.portalManager.portalContainerElement||e?.closest(".nile-dropdown-portal-append")===this.portalManager.portalContainerElement);t||i||this.hide()}))}handleDocumentMouseDown(e){const t=e.composedPath(),i=this.containingElement&&t.includes(this.containingElement),M=this.portal&&this.portalManager?.portalContainerElement&&t.includes(this.portalManager.portalContainerElement);i||M||this.hide()}handlePanelSelect(e){const t=e.target;this.stayOpenOnSelect||"nile-menu"!==t.tagName.toLowerCase()||(this.hide(),this.focusOnTrigger())}handleTriggerClick(){this.open?this.hide():(this.show(),this.focusOnTrigger())}handleTriggerKeyDown(e){const t=this.getMenu();if(t){const i=t.getAllItems(),M=i[0],n=i[i.length-1];["ArrowDown","ArrowUp","Home","End"].includes(e.key)&&(e.preventDefault(),this.open||this.show(),i.length>0&&this.updateComplete.then((()=>{"ArrowDown"!==e.key&&"Home"!==e.key||(t.setCurrentItem(M),M.focus()),"ArrowUp"!==e.key&&"End"!==e.key||(t.setCurrentItem(n),n.focus())})))}}handleTriggerKeyUp(e){" "===e.key&&e.preventDefault()}handleTriggerSlotChange(){this.updateAccessibleTrigger()}updateAccessibleTrigger(){const e=this.trigger.assignedElements({flatten:!0}).find((e=>Et(e).start));let t;if(e){switch(e.tagName.toLowerCase()){case"nile-button":case"nile-icon-button":t=e.button;break;default:t=e}t.setAttribute("aria-haspopup","true"),t.setAttribute("aria-expanded",this.open?"true":"false")}}async show(){if(!this.open)return this.open=!0,St(this,"nile-after-show")}async hide(){if(this.open)return this.open=!1,St(this,"nile-after-hide")}reposition(){this.popup.reposition()}addOpenListeners(){this.panel.addEventListener("nile-select",this.handlePanelSelect),this.panel.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keydown",this.handleDocumentKeyDown),document.addEventListener("mousedown",this.handleDocumentMouseDown)}removeOpenListeners(){this.panel&&(this.panel.removeEventListener("nile-select",this.handlePanelSelect),this.panel.removeEventListener("keydown",this.handleKeyDown)),document.removeEventListener("keydown",this.handleDocumentKeyDown),document.removeEventListener("mousedown",this.handleDocumentMouseDown)}updated(e){super.updated(e),e.has("portal")&&(this.portal&&!this.portalManager?(this.portalManager=new Om(this),this.open&&this.portalManager.setupPortalAppend()):!this.portal&&this.portalManager&&(this.portalManager.cleanupPortalAppend(),this.portalManager=null))}async handleOpenChange(){if(this.disabled)this.open=!1;else if(this.updateAccessibleTrigger(),this.open){if(this.emit("nile-show"),this.addOpenListeners(),this.portal&&this.portalManager?this.portalManager.setupPortalAppend():this.portal&&!this.portalManager&&(this.portalManager=new Om(this),this.portalManager.setupPortalAppend()),await jt(this),!this.portal){this.panel.hidden=!1,this.popup.active=!0;const{keyframes:e,options:t}=yt(this,"dropdown.show",{dir:""});await ut(this.popup.popup,e,t)}this.emit("nile-after-show")}else{if(this.emit("nile-hide"),this.removeOpenListeners(),this.portal&&this.portalManager&&this.portalManager.cleanupPortalAppend(),await jt(this),!this.portal){const{keyframes:e,options:t}=yt(this,"dropdown.hide",{dir:""});await ut(this.popup.popup,e,t),this.panel.hidden=!0,this.popup.active=!1}this.emit("nile-after-hide")}}render(){return R`
|
|
15846
15890
|
<nile-popup
|
|
15847
15891
|
part="base"
|
|
15848
15892
|
id="sidebar-action-dropdown"
|
|
@@ -15876,7 +15920,7 @@ border: none;
|
|
|
15876
15920
|
style=${this.portal&&this.portalManager?"display: none;":""}
|
|
15877
15921
|
></slot>
|
|
15878
15922
|
</nile-popup>
|
|
15879
|
-
`}};
|
|
15923
|
+
`}};pm.styles=[hm],e([Ie(".dropdown")],pm.prototype,"popup",void 0),e([Ie(".dropdown__trigger")],pm.prototype,"trigger",void 0),e([Ie(".dropdown__panel")],pm.prototype,"panel",void 0),e([ce({type:Boolean,reflect:!0})],pm.prototype,"open",void 0),e([ce({reflect:!0})],pm.prototype,"placement",void 0),e([ce({type:Boolean,reflect:!0})],pm.prototype,"disabled",void 0),e([ce({attribute:"stay-open-on-select",type:Boolean,reflect:!0})],pm.prototype,"stayOpenOnSelect",void 0),e([ce({attribute:!1})],pm.prototype,"containingElement",void 0),e([ce({type:Number})],pm.prototype,"distance",void 0),e([ce({type:Number})],pm.prototype,"skidding",void 0),e([ce()],pm.prototype,"sync",void 0),e([ce({type:Boolean})],pm.prototype,"hoist",void 0),e([ce({type:Boolean,reflect:!0})],pm.prototype,"portal",void 0),e([ce({reflect:!0})],pm.prototype,"triggerDropdown",void 0),e([We("open",{waitUntilFirstUpdate:!0})],pm.prototype,"handleOpenChange",null),pm=e([Ne("nile-side-bar-action")],pm),Tt("dropdown.show",{keyframes:[{opacity:0,scale:.9},{opacity:1,scale:1}],options:{duration:100,easing:"ease"}}),Tt("dropdown.hide",{keyframes:[{opacity:1,scale:1},{opacity:0,scale:.9}],options:{duration:100,easing:"ease"}});const xm=r`
|
|
15880
15924
|
:host {
|
|
15881
15925
|
display: block;
|
|
15882
15926
|
line-height: 20px;
|
|
@@ -15905,12 +15949,12 @@ border: none;
|
|
|
15905
15949
|
overflow: hidden;
|
|
15906
15950
|
text-overflow: ellipsis;
|
|
15907
15951
|
}
|
|
15908
|
-
`;let
|
|
15952
|
+
`;let Lm=class extends Re{constructor(){super(...arguments),this.text="",this.subtext=""}static get styles(){return[xm]}render(){return R`
|
|
15909
15953
|
<div class="footer-text" part="footer-text">
|
|
15910
15954
|
<div class="main" part="main">${this.text}</div>
|
|
15911
15955
|
${this.subtext?R`<div class="sub" part="sub">${this.subtext}</div>`:null}
|
|
15912
15956
|
</div>
|
|
15913
|
-
`}};e([ce({type:String})],
|
|
15957
|
+
`}};e([ce({type:String})],Lm.prototype,"text",void 0),e([ce({type:String})],Lm.prototype,"subtext",void 0),Lm=e([Ne("nile-side-bar-footer-text")],Lm);const Sm=r`
|
|
15914
15958
|
:host {
|
|
15915
15959
|
box-sizing: border-box;
|
|
15916
15960
|
-webkit-font-smoothing: var(--nile-webkit-font-smoothing, var(--ng-webkit-font-smoothing));
|
|
@@ -16037,7 +16081,7 @@ border: none;
|
|
|
16037
16081
|
}
|
|
16038
16082
|
|
|
16039
16083
|
}
|
|
16040
|
-
`;let
|
|
16084
|
+
`;let mm=class extends Re{constructor(){super(...arguments),this.type="normal",this.checked=!1,this.value="",this.disabled=!1,this.hasSubMenu=!1}connectedCallback(){super.connectedCallback(),this.handleHostClick=this.handleHostClick.bind(this),this.addEventListener("click",this.handleHostClick)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this.handleHostClick)}handleDefaultSlotChange(){const e=this.getTextLabel();void 0!==this.cachedTextLabel?e!==this.cachedTextLabel&&(this.cachedTextLabel=e,this.emit("slotchange")):this.cachedTextLabel=e}handleHostClick(e){this.disabled&&(e.preventDefault(),e.stopImmediatePropagation())}handleCheckedChange(){if(this.checked&&"checkbox"!==this.type)return this.checked=!1,void console.error('The checked attribute can only be used on menu items with type="checkbox"',this);"checkbox"===this.type?this.setAttribute("aria-checked",this.checked?"true":"false"):this.removeAttribute("aria-checked")}handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false")}handleTypeChange(){"checkbox"===this.type?(this.setAttribute("role","menuitemcheckbox"),this.setAttribute("aria-checked",this.checked?"true":"false")):(this.setAttribute("role","menuitem"),this.removeAttribute("aria-checked"))}getTextLabel(){return Ze(this.defaultSlot)}render(){return R`
|
|
16041
16085
|
<div
|
|
16042
16086
|
part="base"
|
|
16043
16087
|
class=${pe({"menu-item":!0,"menu-item--checked":this.checked,"menu-item--disabled":this.disabled,"menu-item--has-submenu":this.hasSubMenu})}
|
|
@@ -16073,7 +16117,7 @@ border: none;
|
|
|
16073
16117
|
></nile-icon>
|
|
16074
16118
|
</span>`:""}
|
|
16075
16119
|
</div>
|
|
16076
|
-
`}};
|
|
16120
|
+
`}};mm.styles=Sm,e([Ie("slot:not([name])")],mm.prototype,"defaultSlot",void 0),e([Ie(".menu-item")],mm.prototype,"menuItem",void 0),e([ce()],mm.prototype,"type",void 0),e([ce({type:Boolean,reflect:!0})],mm.prototype,"checked",void 0),e([ce()],mm.prototype,"value",void 0),e([ce({type:Boolean,reflect:!0})],mm.prototype,"disabled",void 0),e([ce({type:Boolean,reflect:!0})],mm.prototype,"hasSubMenu",void 0),e([We("checked")],mm.prototype,"handleCheckedChange",null),e([We("disabled")],mm.prototype,"handleDisabledChange",null),e([We("type")],mm.prototype,"handleTypeChange",null),mm=e([Ne("nile-side-bar-action-menu-item")],mm);const Em=r`
|
|
16077
16121
|
:host {
|
|
16078
16122
|
display: block;
|
|
16079
16123
|
position: relative;
|
|
@@ -16133,7 +16177,7 @@ border: none;
|
|
|
16133
16177
|
.menu__footer:hover {
|
|
16134
16178
|
background-color:var(--nile-menu-item-background-color, var(--ng-colors-bg-secondary));
|
|
16135
16179
|
}
|
|
16136
|
-
`;let
|
|
16180
|
+
`;let wm=class extends Re{constructor(){super(...arguments),this.searchValue="",this.searchWidth=0,this.searchEnabled=!1,this.customSearch=!1,this.showNoResults=!1,this.allowSpaceKey=!1,this.noResultsMessage="No results found",this.hasSlotController=new Ye(this,"menu__footer","menu__header")}connectedCallback(){super.connectedCallback(),this.setAttribute("role","menu")}handleClick(e){const t=e.target.closest("nile-menu-item");t?.hasSubMenu||t&&!t.disabled&&("checkbox"===t.type&&(t.checked=!t.checked),this.emit("nile-select",{value:t.value}))}handleKeyDown(e){if("Enter"===e.key){const t=this.getCurrentItem();e.preventDefault(),t?.click()}if(this.allowSpaceKey||" "!==e.key||e.preventDefault(),["ArrowDown","ArrowUp","Home","End"].includes(e.key)){const t=this.getAllItems(),i=this.getCurrentItem();let M=i?t.indexOf(i):0;t.length>0&&(e.preventDefault(),"ArrowDown"===e.key?M++:"ArrowUp"===e.key?M--:"Home"===e.key?M=0:"End"===e.key&&(M=t.length-1),M<0&&(M=t.length-1),M>t.length-1&&(M=0),this.setCurrentItem(t[M]),t[M].focus())}}handleMouseDown(e){const t=e.target;this.isMenuItem(t)&&this.setCurrentItem(t)}handleSlotChange(){const e=this.getAllItems();e.length>0&&this.setCurrentItem(e[0])}isMenuItem(e){return"nile-menu-item"===e.tagName.toLowerCase()||["menuitem","menuitemcheckbox","menuitemradio"].includes(e.getAttribute("role")??"")}getAllItems(){return[...this.defaultSlot.assignedElements({flatten:!0})].filter((e=>!!this.isMenuItem(e)))}getCurrentItem(){return this.getAllItems().find((e=>"0"===e.getAttribute("tabindex")))}setCurrentItem(e){this.getAllItems().forEach((t=>{t.setAttribute("tabindex",t===e?"0":"-1")}))}handleSearchChange(e){let t=this.getAllItems(),i=e.target.value;if(this.customSearch)return void this.emit("nile-search-value",{value:i});let M=0;t.map((t=>{this.searchWidth=Math.max(this.searchWidth,t.offsetWidth),t.innerText.toLowerCase().includes(e.target.value.toLowerCase())?(t.style.display="block",M++):t.style.display="none"})),this.showNoResults=0===M}render(){return R`
|
|
16137
16181
|
<slot name="menu__pre-header" part="menu__pre-header" @click=${e=>{e.stopPropagation()}}></slot>
|
|
16138
16182
|
${this.searchEnabled?R`<div class="search__wrapper" part="search__wrapper">
|
|
16139
16183
|
<nile-input
|
|
@@ -16173,7 +16217,7 @@ border: none;
|
|
|
16173
16217
|
class="menu__footer"
|
|
16174
16218
|
></slot>`:null}
|
|
16175
16219
|
|
|
16176
|
-
`}};
|
|
16220
|
+
`}};wm.styles=Em,e([De()],wm.prototype,"searchValue",void 0),e([De()],wm.prototype,"searchWidth",void 0),e([ce({type:Boolean,reflect:!0})],wm.prototype,"searchEnabled",void 0),e([ce({type:Boolean,reflect:!0})],wm.prototype,"customSearch",void 0),e([ce({type:Boolean})],wm.prototype,"showNoResults",void 0),e([ce({type:Boolean})],wm.prototype,"allowSpaceKey",void 0),e([ce({type:String})],wm.prototype,"noResultsMessage",void 0),e([Ie("slot:not([name])")],wm.prototype,"defaultSlot",void 0),wm=e([Ne("nile-side-bar-action-menu")],wm);const Qm=r`
|
|
16177
16221
|
:host {
|
|
16178
16222
|
display: block;
|
|
16179
16223
|
}
|
|
@@ -16205,7 +16249,7 @@ border: none;
|
|
|
16205
16249
|
flex-direction: column;
|
|
16206
16250
|
gap: var(--nile-spacing-xs);
|
|
16207
16251
|
}
|
|
16208
|
-
`;let
|
|
16252
|
+
`;let km=class extends Re{constructor(){super(...arguments),this.label="",this.divider=!1}static get styles(){return[Qm]}render(){return R`
|
|
16209
16253
|
<div class="group">
|
|
16210
16254
|
${this.label||this.hasLabelSlot()?R`
|
|
16211
16255
|
<div class="group-label">
|
|
@@ -16216,7 +16260,7 @@ border: none;
|
|
|
16216
16260
|
<slot></slot>
|
|
16217
16261
|
</div>
|
|
16218
16262
|
</div>
|
|
16219
|
-
`}hasLabelSlot(){const e=this.shadowRoot?.querySelector('slot[name="label"]');return!!e}};e([ce({type:String})],
|
|
16263
|
+
`}hasLabelSlot(){const e=this.shadowRoot?.querySelector('slot[name="label"]');return!!e}};e([ce({type:String})],km.prototype,"label",void 0),e([ce({type:Boolean,reflect:!0})],km.prototype,"divider",void 0),km=e([Ne("nile-inline-sidebar-group")],km);const Cm=r`
|
|
16220
16264
|
:host {
|
|
16221
16265
|
display: block;
|
|
16222
16266
|
height: 100%;
|
|
@@ -16312,7 +16356,7 @@ border: none;
|
|
|
16312
16356
|
pointer-events: auto;
|
|
16313
16357
|
transition-delay: 0ms;
|
|
16314
16358
|
}
|
|
16315
|
-
`;let
|
|
16359
|
+
`;let bm=class extends Re{constructor(){super(...arguments),this.collapsed=!1,this.fixed=!1,this.showTooltip=!1,this.activeIndex=-1,this.handleItemSelect=e=>{const t=e.detail.item,i=this.sidebarItems.indexOf(t);this.sidebarItems.forEach(((e,t)=>e.active=t===i)),this.activeIndex=i,this.dispatchEvent(new CustomEvent("nile-change",{detail:{selectedItem:t,index:i},bubbles:!0,composed:!0})),this.requestUpdate()}}static get styles(){return[Cm]}get sidebarItems(){if(!this.defaultSlot)return[];return this.defaultSlot.assignedElements({flatten:!0}).flatMap((e=>"nile-inline-sidebar-item"===e.tagName.toLowerCase()?[e]:Array.from(e.querySelectorAll("nile-inline-sidebar-item"))))}connectedCallback(){super.connectedCallback(),this.addEventListener("nile-click",this.handleItemSelect),this.mutationObserver=new MutationObserver((()=>this.syncActiveFromItems()))}disconnectedCallback(){super.disconnectedCallback(),this.mutationObserver?.disconnect(),this.removeEventListener("nile-click",this.handleItemSelect)}firstUpdated(){this.observeSidebarItems(),this.syncActiveFromItems(),this.fixed&&(this.collapsed=!1)}observeSidebarItems(){this.sidebarItems?.length&&this.mutationObserver&&this.sidebarItems.forEach((e=>this.mutationObserver.observe(e,{attributes:!0,attributeFilter:["active"]})))}syncActiveFromItems(){if(!this.sidebarItems?.length)return;const e=this.sidebarItems.findIndex((e=>e.hasAttribute("active")));-1!==e&&e!==this.activeIndex&&(this.activeIndex=e,this.requestUpdate())}toggleCollapse(){this.fixed||(this.collapsed=!this.collapsed,this.dispatchEvent(new CustomEvent("nile-toggle",{detail:{collapsed:this.collapsed},bubbles:!0,composed:!0})))}handleMenuItemClick(e){const t=this.sidebarItems[e];if(!t||t.hasAttribute("disabled"))return;this.sidebarItems.forEach(((t,i)=>t.active=i===e)),this.activeIndex=e;const i=t.textContent?.trim()||"",M=t.href;this.dispatchEvent(new CustomEvent("nile-click",{detail:{item:t,href:M,text:i},bubbles:!0,composed:!0})),M&&(window.location.href=M),this.requestUpdate()}get menuItemsTemplate(){return this.sidebarItems?.length?this.sidebarItems.map(((e,t)=>{const i=e.tooltip,M=e.scrollWidth>e.clientWidth||e.scrollHeight>e.clientHeight,n=R`
|
|
16316
16360
|
<nile-side-bar-action-menu-item
|
|
16317
16361
|
?disabled=${e.hasAttribute("disabled")}
|
|
16318
16362
|
?active=${this.activeIndex===t}
|
|
@@ -16372,7 +16416,7 @@ border: none;
|
|
|
16372
16416
|
></slot>
|
|
16373
16417
|
</nav>
|
|
16374
16418
|
</div>
|
|
16375
|
-
`}};e([ce({type:Boolean,reflect:!0})],
|
|
16419
|
+
`}};e([ce({type:Boolean,reflect:!0})],bm.prototype,"collapsed",void 0),e([ce({type:Boolean,reflect:!0,attribute:!0})],bm.prototype,"fixed",void 0),e([ce({type:Boolean,reflect:!0})],bm.prototype,"showTooltip",void 0),e([De()],bm.prototype,"activeIndex",void 0),e([Ie("slot")],bm.prototype,"defaultSlot",void 0),bm=e([Ne("nile-inline-sidebar")],bm);const fm=r`
|
|
16376
16420
|
:host {
|
|
16377
16421
|
display: block;
|
|
16378
16422
|
font-family: var(--nile-font-family-sans-serif);
|
|
@@ -16430,11 +16474,11 @@ a {
|
|
|
16430
16474
|
|
|
16431
16475
|
|
|
16432
16476
|
|
|
16433
|
-
`;let
|
|
16477
|
+
`;let vm=class extends Re{constructor(){super(...arguments),this.active=!1,this.disabled=!1,this.tooltip=!1}static get styles(){return[fm]}handleClick(e){if(this.disabled)return e.preventDefault(),void e.stopPropagation();const t=this.closest("nile-inline-sidebar");if(t){t.querySelectorAll("nile-inline-sidebar-item").forEach((e=>e.active=e===this))}const i=this.textContent?.trim()||"";this.dispatchEvent(new CustomEvent("nile-click",{detail:{item:this,href:this.href,text:i},bubbles:!0,composed:!0})),this.href&&(window.location.href=this.href)}render(){return R`
|
|
16434
16478
|
<div class="item" @click=${this.handleClick} role="button" tabindex="0">
|
|
16435
16479
|
${this.href?R`<a href=${this.href} @click=${e=>e.preventDefault()}><slot></slot></a>`:R`<slot></slot>`}
|
|
16436
16480
|
</div>
|
|
16437
|
-
`}};e([ce({type:Boolean,reflect:!0})],
|
|
16481
|
+
`}};e([ce({type:Boolean,reflect:!0})],vm.prototype,"active",void 0),e([ce({type:Boolean,reflect:!0})],vm.prototype,"disabled",void 0),e([ce({type:String})],vm.prototype,"href",void 0),e([ce({type:Boolean,reflect:!0})],vm.prototype,"tooltip",void 0),vm=e([Ne("nile-inline-sidebar-item")],vm);const Um=r`
|
|
16438
16482
|
:host { }
|
|
16439
16483
|
|
|
16440
16484
|
.tippy-box[data-animation=fade][data-state=hidden] { opacity: 0; }
|
|
@@ -16536,29 +16580,29 @@ a {
|
|
|
16536
16580
|
.tippy-svg-arrow > svg {
|
|
16537
16581
|
position: absolute;
|
|
16538
16582
|
}
|
|
16539
|
-
`;!function(){const e="nile-lite-tooltip-styles";if(document.getElementById(e))return;const t=document.createElement("style");t.id=e,t.textContent=Zm.cssText,document.head.appendChild(t)}();var Vm="top",Wm="bottom",Pm="right",Rm="left",Bm="auto",Gm=[Vm,Wm,Pm,Rm],_m="start",Fm="end",Hm="viewport",Jm="popper",$m=Gm.reduce((function(e,t){return e.concat([t+"-"+_m,t+"-"+Fm])}),[]),Xm=[].concat(Gm,[Bm]).reduce((function(e,t){return e.concat([t,t+"-"+_m,t+"-"+Fm])}),[]),qm=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function Km(e){return e?(e.nodeName||"").toLowerCase():null}function eE(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function tE(e){return e instanceof eE(e).Element||e instanceof Element}function iE(e){return e instanceof eE(e).HTMLElement||e instanceof HTMLElement}function ME(e){return"undefined"!=typeof ShadowRoot&&(e instanceof eE(e).ShadowRoot||e instanceof ShadowRoot)}var nE={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var i=t.styles[e]||{},M=t.attributes[e]||{},n=t.elements[e];iE(n)&&Km(n)&&(Object.assign(n.style,i),Object.keys(M).forEach((function(e){var t=M[e];!1===t?n.removeAttribute(e):n.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,i={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,i.popper),t.styles=i,t.elements.arrow&&Object.assign(t.elements.arrow.style,i.arrow),function(){Object.keys(t.elements).forEach((function(e){var M=t.elements[e],n=t.attributes[e]||{},o=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:i[e]).reduce((function(e,t){return e[t]="",e}),{});iE(M)&&Km(M)&&(Object.assign(M.style,o),Object.keys(n).forEach((function(e){M.removeAttribute(e)})))}))}},requires:["computeStyles"]};function oE(e){return e.split("-")[0]}var rE=Math.max,sE=Math.min,aE=Math.round;function lE(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function NE(){return!/^((?!chrome|android).)*safari/i.test(lE())}function gE(e,t,i){void 0===t&&(t=!1),void 0===i&&(i=!1);var M=e.getBoundingClientRect(),n=1,o=1;t&&iE(e)&&(n=e.offsetWidth>0&&aE(M.width)/e.offsetWidth||1,o=e.offsetHeight>0&&aE(M.height)/e.offsetHeight||1);var r=(tE(e)?eE(e):window).visualViewport,s=!NE()&&i,a=(M.left+(s&&r?r.offsetLeft:0))/n,l=(M.top+(s&&r?r.offsetTop:0))/o,N=M.width/n,g=M.height/o;return{width:N,height:g,top:l,right:a+N,bottom:l+g,left:a,x:a,y:l}}function uE(e){var t=gE(e),i=e.offsetWidth,M=e.offsetHeight;return Math.abs(t.width-i)<=1&&(i=t.width),Math.abs(t.height-M)<=1&&(M=t.height),{x:e.offsetLeft,y:e.offsetTop,width:i,height:M}}function cE(e,t){var i=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(i&&ME(i)){var M=t;do{if(M&&e.isSameNode(M))return!0;M=M.parentNode||M.host}while(M)}return!1}function DE(e){return eE(e).getComputedStyle(e)}function jE(e){return["table","td","th"].indexOf(Km(e))>=0}function IE(e){return((tE(e)?e.ownerDocument:e.document)||window.document).documentElement}function zE(e){return"html"===Km(e)?e:e.assignedSlot||e.parentNode||(ME(e)?e.host:null)||IE(e)}function dE(e){return iE(e)&&"fixed"!==DE(e).position?e.offsetParent:null}function hE(e){for(var t=eE(e),i=dE(e);i&&jE(i)&&"static"===DE(i).position;)i=dE(i);return i&&("html"===Km(i)||"body"===Km(i)&&"static"===DE(i).position)?t:i||function(e){var t=/firefox/i.test(lE());if(/Trident/i.test(lE())&&iE(e)&&"fixed"===DE(e).position)return null;var i=zE(e);for(ME(i)&&(i=i.host);iE(i)&&["html","body"].indexOf(Km(i))<0;){var M=DE(i);if("none"!==M.transform||"none"!==M.perspective||"paint"===M.contain||-1!==["transform","perspective"].indexOf(M.willChange)||t&&"filter"===M.willChange||t&&M.filter&&"none"!==M.filter)return i;i=i.parentNode}return null}(e)||t}function TE(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function yE(e,t,i){return rE(e,sE(t,i))}function AE(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function OE(e,t){return t.reduce((function(t,i){return t[i]=e,t}),{})}var pE={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,i=e.state,M=e.name,n=e.options,o=i.elements.arrow,r=i.modifiersData.popperOffsets,s=oE(i.placement),a=TE(s),l=[Rm,Pm].indexOf(s)>=0?"height":"width";if(o&&r){var N=function(e,t){return AE("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:OE(e,Gm))}(n.padding,i),g=uE(o),u="y"===a?Vm:Rm,c="y"===a?Wm:Pm,D=i.rects.reference[l]+i.rects.reference[a]-r[a]-i.rects.popper[l],j=r[a]-i.rects.reference[a],I=hE(o),z=I?"y"===a?I.clientHeight||0:I.clientWidth||0:0,d=D/2-j/2,h=N[u],T=z-g[l]-N[c],y=z/2-g[l]/2+d,A=yE(h,y,T),O=a;i.modifiersData[M]=((t={})[O]=A,t.centerOffset=A-y,t)}},effect:function(e){var t=e.state,i=e.options.element,M=void 0===i?"[data-popper-arrow]":i;null!=M&&("string"!=typeof M||(M=t.elements.popper.querySelector(M)))&&cE(t.elements.popper,M)&&(t.elements.arrow=M)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function xE(e){return e.split("-")[1]}var LE={top:"auto",right:"auto",bottom:"auto",left:"auto"};function SE(e){var t,i=e.popper,M=e.popperRect,n=e.placement,o=e.variation,r=e.offsets,s=e.position,a=e.gpuAcceleration,l=e.adaptive,N=e.roundOffsets,g=e.isFixed,u=r.x,c=void 0===u?0:u,D=r.y,j=void 0===D?0:D,I="function"==typeof N?N({x:c,y:j}):{x:c,y:j};c=I.x,j=I.y;var z=r.hasOwnProperty("x"),d=r.hasOwnProperty("y"),h=Rm,T=Vm,y=window;if(l){var A=hE(i),O="clientHeight",p="clientWidth";if(A===eE(i)&&"static"!==DE(A=IE(i)).position&&"absolute"===s&&(O="scrollHeight",p="scrollWidth"),n===Vm||(n===Rm||n===Pm)&&o===Fm)T=Wm,j-=(g&&A===y&&y.visualViewport?y.visualViewport.height:A[O])-M.height,j*=a?1:-1;if(n===Rm||(n===Vm||n===Wm)&&o===Fm)h=Pm,c-=(g&&A===y&&y.visualViewport?y.visualViewport.width:A[p])-M.width,c*=a?1:-1}var x,L=Object.assign({position:s},l&&LE),S=!0===N?function(e,t){var i=e.x,M=e.y,n=t.devicePixelRatio||1;return{x:aE(i*n)/n||0,y:aE(M*n)/n||0}}({x:c,y:j},eE(i)):{x:c,y:j};return c=S.x,j=S.y,a?Object.assign({},L,((x={})[T]=d?"0":"",x[h]=z?"0":"",x.transform=(y.devicePixelRatio||1)<=1?"translate("+c+"px, "+j+"px)":"translate3d("+c+"px, "+j+"px, 0)",x)):Object.assign({},L,((t={})[T]=d?j+"px":"",t[h]=z?c+"px":"",t.transform="",t))}var mE={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,i=e.options,M=i.gpuAcceleration,n=void 0===M||M,o=i.adaptive,r=void 0===o||o,s=i.roundOffsets,a=void 0===s||s,l={placement:oE(t.placement),variation:xE(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:n,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,SE(Object.assign({},l,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:r,roundOffsets:a})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,SE(Object.assign({},l,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:a})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},EE={passive:!0};var wE={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,i=e.instance,M=e.options,n=M.scroll,o=void 0===n||n,r=M.resize,s=void 0===r||r,a=eE(t.elements.popper),l=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&l.forEach((function(e){e.addEventListener("scroll",i.update,EE)})),s&&a.addEventListener("resize",i.update,EE),function(){o&&l.forEach((function(e){e.removeEventListener("scroll",i.update,EE)})),s&&a.removeEventListener("resize",i.update,EE)}},data:{}},QE={left:"right",right:"left",bottom:"top",top:"bottom"};function kE(e){return e.replace(/left|right|bottom|top/g,(function(e){return QE[e]}))}var CE={start:"end",end:"start"};function bE(e){return e.replace(/start|end/g,(function(e){return CE[e]}))}function fE(e){var t=eE(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function vE(e){return gE(IE(e)).left+fE(e).scrollLeft}function UE(e){var t=DE(e),i=t.overflow,M=t.overflowX,n=t.overflowY;return/auto|scroll|overlay|hidden/.test(i+n+M)}function YE(e){return["html","body","#document"].indexOf(Km(e))>=0?e.ownerDocument.body:iE(e)&&UE(e)?e:YE(zE(e))}function ZE(e,t){var i;void 0===t&&(t=[]);var M=YE(e),n=M===(null==(i=e.ownerDocument)?void 0:i.body),o=eE(M),r=n?[o].concat(o.visualViewport||[],UE(M)?M:[]):M,s=t.concat(r);return n?s:s.concat(ZE(zE(r)))}function VE(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function WE(e,t,i){return t===Hm?VE(function(e,t){var i=eE(e),M=IE(e),n=i.visualViewport,o=M.clientWidth,r=M.clientHeight,s=0,a=0;if(n){o=n.width,r=n.height;var l=NE();(l||!l&&"fixed"===t)&&(s=n.offsetLeft,a=n.offsetTop)}return{width:o,height:r,x:s+vE(e),y:a}}(e,i)):tE(t)?function(e,t){var i=gE(e,!1,"fixed"===t);return i.top=i.top+e.clientTop,i.left=i.left+e.clientLeft,i.bottom=i.top+e.clientHeight,i.right=i.left+e.clientWidth,i.width=e.clientWidth,i.height=e.clientHeight,i.x=i.left,i.y=i.top,i}(t,i):VE(function(e){var t,i=IE(e),M=fE(e),n=null==(t=e.ownerDocument)?void 0:t.body,o=rE(i.scrollWidth,i.clientWidth,n?n.scrollWidth:0,n?n.clientWidth:0),r=rE(i.scrollHeight,i.clientHeight,n?n.scrollHeight:0,n?n.clientHeight:0),s=-M.scrollLeft+vE(e),a=-M.scrollTop;return"rtl"===DE(n||i).direction&&(s+=rE(i.clientWidth,n?n.clientWidth:0)-o),{width:o,height:r,x:s,y:a}}(IE(e)))}function PE(e,t,i,M){var n="clippingParents"===t?function(e){var t=ZE(zE(e)),i=["absolute","fixed"].indexOf(DE(e).position)>=0&&iE(e)?hE(e):e;return tE(i)?t.filter((function(e){return tE(e)&&cE(e,i)&&"body"!==Km(e)})):[]}(e):[].concat(t),o=[].concat(n,[i]),r=o[0],s=o.reduce((function(t,i){var n=WE(e,i,M);return t.top=rE(n.top,t.top),t.right=sE(n.right,t.right),t.bottom=sE(n.bottom,t.bottom),t.left=rE(n.left,t.left),t}),WE(e,r,M));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function RE(e){var t,i=e.reference,M=e.element,n=e.placement,o=n?oE(n):null,r=n?xE(n):null,s=i.x+i.width/2-M.width/2,a=i.y+i.height/2-M.height/2;switch(o){case Vm:t={x:s,y:i.y-M.height};break;case Wm:t={x:s,y:i.y+i.height};break;case Pm:t={x:i.x+i.width,y:a};break;case Rm:t={x:i.x-M.width,y:a};break;default:t={x:i.x,y:i.y}}var l=o?TE(o):null;if(null!=l){var N="y"===l?"height":"width";switch(r){case _m:t[l]=t[l]-(i[N]/2-M[N]/2);break;case Fm:t[l]=t[l]+(i[N]/2-M[N]/2)}}return t}function BE(e,t){void 0===t&&(t={});var i=t,M=i.placement,n=void 0===M?e.placement:M,o=i.strategy,r=void 0===o?e.strategy:o,s=i.boundary,a=void 0===s?"clippingParents":s,l=i.rootBoundary,N=void 0===l?Hm:l,g=i.elementContext,u=void 0===g?Jm:g,c=i.altBoundary,D=void 0!==c&&c,j=i.padding,I=void 0===j?0:j,z=AE("number"!=typeof I?I:OE(I,Gm)),d=u===Jm?"reference":Jm,h=e.rects.popper,T=e.elements[D?d:u],y=PE(tE(T)?T:T.contextElement||IE(e.elements.popper),a,N,r),A=gE(e.elements.reference),O=RE({reference:A,element:h,strategy:"absolute",placement:n}),p=VE(Object.assign({},h,O)),x=u===Jm?p:A,L={top:y.top-x.top+z.top,bottom:x.bottom-y.bottom+z.bottom,left:y.left-x.left+z.left,right:x.right-y.right+z.right},S=e.modifiersData.offset;if(u===Jm&&S){var m=S[n];Object.keys(L).forEach((function(e){var t=[Pm,Wm].indexOf(e)>=0?1:-1,i=[Vm,Wm].indexOf(e)>=0?"y":"x";L[e]+=m[i]*t}))}return L}function GE(e,t){void 0===t&&(t={});var i=t,M=i.placement,n=i.boundary,o=i.rootBoundary,r=i.padding,s=i.flipVariations,a=i.allowedAutoPlacements,l=void 0===a?Xm:a,N=xE(M),g=N?s?$m:$m.filter((function(e){return xE(e)===N})):Gm,u=g.filter((function(e){return l.indexOf(e)>=0}));0===u.length&&(u=g);var c=u.reduce((function(t,i){return t[i]=BE(e,{placement:i,boundary:n,rootBoundary:o,padding:r})[oE(i)],t}),{});return Object.keys(c).sort((function(e,t){return c[e]-c[t]}))}var _E={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,i=e.options,M=e.name;if(!t.modifiersData[M]._skip){for(var n=i.mainAxis,o=void 0===n||n,r=i.altAxis,s=void 0===r||r,a=i.fallbackPlacements,l=i.padding,N=i.boundary,g=i.rootBoundary,u=i.altBoundary,c=i.flipVariations,D=void 0===c||c,j=i.allowedAutoPlacements,I=t.options.placement,z=oE(I),d=a||(z===I||!D?[kE(I)]:function(e){if(oE(e)===Bm)return[];var t=kE(e);return[bE(e),t,bE(t)]}(I)),h=[I].concat(d).reduce((function(e,i){return e.concat(oE(i)===Bm?GE(t,{placement:i,boundary:N,rootBoundary:g,padding:l,flipVariations:D,allowedAutoPlacements:j}):i)}),[]),T=t.rects.reference,y=t.rects.popper,A=new Map,O=!0,p=h[0],x=0;x<h.length;x++){var L=h[x],S=oE(L),m=xE(L)===_m,E=[Vm,Wm].indexOf(S)>=0,w=E?"width":"height",Q=BE(t,{placement:L,boundary:N,rootBoundary:g,altBoundary:u,padding:l}),k=E?m?Pm:Rm:m?Wm:Vm;T[w]>y[w]&&(k=kE(k));var C=kE(k),b=[];if(o&&b.push(Q[S]<=0),s&&b.push(Q[k]<=0,Q[C]<=0),b.every((function(e){return e}))){p=L,O=!1;break}A.set(L,b)}if(O)for(var f=function(e){var t=h.find((function(t){var i=A.get(t);if(i)return i.slice(0,e).every((function(e){return e}))}));if(t)return p=t,"break"},v=D?3:1;v>0;v--){if("break"===f(v))break}t.placement!==p&&(t.modifiersData[M]._skip=!0,t.placement=p,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function FE(e,t,i){return void 0===i&&(i={x:0,y:0}),{top:e.top-t.height-i.y,right:e.right-t.width+i.x,bottom:e.bottom-t.height+i.y,left:e.left-t.width-i.x}}function HE(e){return[Vm,Pm,Wm,Rm].some((function(t){return e[t]>=0}))}var JE={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,i=e.name,M=t.rects.reference,n=t.rects.popper,o=t.modifiersData.preventOverflow,r=BE(t,{elementContext:"reference"}),s=BE(t,{altBoundary:!0}),a=FE(r,M),l=FE(s,n,o),N=HE(a),g=HE(l);t.modifiersData[i]={referenceClippingOffsets:a,popperEscapeOffsets:l,isReferenceHidden:N,hasPopperEscaped:g},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":N,"data-popper-escaped":g})}};var $E={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,i=e.options,M=e.name,n=i.offset,o=void 0===n?[0,0]:n,r=Xm.reduce((function(e,i){return e[i]=function(e,t,i){var M=oE(e),n=[Rm,Vm].indexOf(M)>=0?-1:1,o="function"==typeof i?i(Object.assign({},t,{placement:e})):i,r=o[0],s=o[1];return r=r||0,s=(s||0)*n,[Rm,Pm].indexOf(M)>=0?{x:s,y:r}:{x:r,y:s}}(i,t.rects,o),e}),{}),s=r[t.placement],a=s.x,l=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=a,t.modifiersData.popperOffsets.y+=l),t.modifiersData[M]=r}};var XE={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,i=e.name;t.modifiersData[i]=RE({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}};var qE={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,i=e.options,M=e.name,n=i.mainAxis,o=void 0===n||n,r=i.altAxis,s=void 0!==r&&r,a=i.boundary,l=i.rootBoundary,N=i.altBoundary,g=i.padding,u=i.tether,c=void 0===u||u,D=i.tetherOffset,j=void 0===D?0:D,I=BE(t,{boundary:a,rootBoundary:l,padding:g,altBoundary:N}),z=oE(t.placement),d=xE(t.placement),h=!d,T=TE(z),y="x"===T?"y":"x",A=t.modifiersData.popperOffsets,O=t.rects.reference,p=t.rects.popper,x="function"==typeof j?j(Object.assign({},t.rects,{placement:t.placement})):j,L="number"==typeof x?{mainAxis:x,altAxis:x}:Object.assign({mainAxis:0,altAxis:0},x),S=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,m={x:0,y:0};if(A){if(o){var E,w="y"===T?Vm:Rm,Q="y"===T?Wm:Pm,k="y"===T?"height":"width",C=A[T],b=C+I[w],f=C-I[Q],v=c?-p[k]/2:0,U=d===_m?O[k]:p[k],Y=d===_m?-p[k]:-O[k],Z=t.elements.arrow,V=c&&Z?uE(Z):{width:0,height:0},W=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},P=W[w],R=W[Q],B=yE(0,O[k],V[k]),G=h?O[k]/2-v-B-P-L.mainAxis:U-B-P-L.mainAxis,_=h?-O[k]/2+v+B+R+L.mainAxis:Y+B+R+L.mainAxis,F=t.elements.arrow&&hE(t.elements.arrow),H=F?"y"===T?F.clientTop||0:F.clientLeft||0:0,J=null!=(E=null==S?void 0:S[T])?E:0,$=C+_-J,X=yE(c?sE(b,C+G-J-H):b,C,c?rE(f,$):f);A[T]=X,m[T]=X-C}if(s){var q,K="x"===T?Vm:Rm,ee="x"===T?Wm:Pm,te=A[y],ie="y"===y?"height":"width",Me=te+I[K],ne=te-I[ee],oe=-1!==[Vm,Rm].indexOf(z),re=null!=(q=null==S?void 0:S[y])?q:0,se=oe?Me:te-O[ie]-p[ie]-re+L.altAxis,ae=oe?te+O[ie]+p[ie]-re-L.altAxis:ne,le=c&&oe?function(e,t,i){var M=yE(e,t,i);return M>i?i:M}(se,te,ae):yE(c?se:Me,te,c?ae:ne);A[y]=le,m[y]=le-te}t.modifiersData[M]=m}},requiresIfExists:["offset"]};function KE(e,t,i){void 0===i&&(i=!1);var M,n,o=iE(t),r=iE(t)&&function(e){var t=e.getBoundingClientRect(),i=aE(t.width)/e.offsetWidth||1,M=aE(t.height)/e.offsetHeight||1;return 1!==i||1!==M}(t),s=IE(t),a=gE(e,r,i),l={scrollLeft:0,scrollTop:0},N={x:0,y:0};return(o||!o&&!i)&&(("body"!==Km(t)||UE(s))&&(l=(M=t)!==eE(M)&&iE(M)?{scrollLeft:(n=M).scrollLeft,scrollTop:n.scrollTop}:fE(M)),iE(t)?((N=gE(t,!0)).x+=t.clientLeft,N.y+=t.clientTop):s&&(N.x=vE(s))),{x:a.left+l.scrollLeft-N.x,y:a.top+l.scrollTop-N.y,width:a.width,height:a.height}}function ew(e){var t=new Map,i=new Set,M=[];function n(e){i.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!i.has(e)){var M=t.get(e);M&&n(M)}})),M.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){i.has(e.name)||n(e)})),M}var tw={placement:"bottom",modifiers:[],strategy:"absolute"};function iw(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return!t.some((function(e){return!(e&&"function"==typeof e.getBoundingClientRect)}))}function Mw(e){void 0===e&&(e={});var t=e,i=t.defaultModifiers,M=void 0===i?[]:i,n=t.defaultOptions,o=void 0===n?tw:n;return function(e,t,i){void 0===i&&(i=o);var n,r,s={placement:"bottom",orderedModifiers:[],options:Object.assign({},tw,o),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},a=[],l=!1,N={state:s,setOptions:function(i){var n="function"==typeof i?i(s.options):i;g(),s.options=Object.assign({},o,s.options,n),s.scrollParents={reference:tE(e)?ZE(e):e.contextElement?ZE(e.contextElement):[],popper:ZE(t)};var r=function(e){var t=ew(e);return qm.reduce((function(e,i){return e.concat(t.filter((function(e){return e.phase===i})))}),[])}(function(e){var t=e.reduce((function(e,t){var i=e[t.name];return e[t.name]=i?Object.assign({},i,t,{options:Object.assign({},i.options,t.options),data:Object.assign({},i.data,t.data)}):t,e}),{});return Object.keys(t).map((function(e){return t[e]}))}([].concat(M,s.options.modifiers)));return s.orderedModifiers=r.filter((function(e){return e.enabled})),s.orderedModifiers.forEach((function(e){var t=e.name,i=e.options,M=void 0===i?{}:i,n=e.effect;if("function"==typeof n){var o=n({state:s,name:t,instance:N,options:M}),r=function(){};a.push(o||r)}})),N.update()},forceUpdate:function(){if(!l){var e=s.elements,t=e.reference,i=e.popper;if(iw(t,i)){s.rects={reference:KE(t,hE(i),"fixed"===s.options.strategy),popper:uE(i)},s.reset=!1,s.placement=s.options.placement,s.orderedModifiers.forEach((function(e){return s.modifiersData[e.name]=Object.assign({},e.data)}));for(var M=0;M<s.orderedModifiers.length;M++)if(!0!==s.reset){var n=s.orderedModifiers[M],o=n.fn,r=n.options,a=void 0===r?{}:r,g=n.name;"function"==typeof o&&(s=o({state:s,options:a,name:g,instance:N})||s)}else s.reset=!1,M=-1}}},update:(n=function(){return new Promise((function(e){N.forceUpdate(),e(s)}))},function(){return r||(r=new Promise((function(e){Promise.resolve().then((function(){r=void 0,e(n())}))}))),r}),destroy:function(){g(),l=!0}};if(!iw(e,t))return N;function g(){a.forEach((function(e){return e()})),a=[]}return N.setOptions(i).then((function(e){!l&&i.onFirstUpdate&&i.onFirstUpdate(e)})),N}}var nw=Mw({defaultModifiers:[wE,XE,mE,nE,$E,_E,qE,pE,JE]}),ow='<svg width="16" height="6" xmlns="http://www.w3.org/2000/svg"><path d="M0 6s1.796-.013 4.67-3.615C5.851.9 6.93.006 8 0c1.07-.006 2.148.887 3.343 2.385C14.233 6.005 16 6 16 6H0z"></svg>',rw="tippy-content",sw="tippy-arrow",aw="tippy-svg-arrow",lw={passive:!0,capture:!0},Nw=function(){return document.body};function gw(e,t,i){if(Array.isArray(e)){var M=e[t];return null==M?Array.isArray(i)?i[t]:i:M}return e}function uw(e,t){var i={}.toString.call(e);return 0===i.indexOf("[object")&&i.indexOf(t+"]")>-1}function cw(e,t){return"function"==typeof e?e.apply(void 0,t):e}function Dw(e,t){return 0===t?e:function(M){clearTimeout(i),i=setTimeout((function(){e(M)}),t)};var i}function jw(e,t){var i=Object.assign({},e);return t.forEach((function(e){delete i[e]})),i}function Iw(e){return[].concat(e)}function zw(e,t){-1===e.indexOf(t)&&e.push(t)}function dw(e){return[].slice.call(e)}function hw(e){return Object.keys(e).reduce((function(t,i){return void 0!==e[i]&&(t[i]=e[i]),t}),{})}function Tw(){return document.createElement("div")}function yw(e){return["Element","Fragment"].some((function(t){return uw(e,t)}))}function Aw(e){return uw(e,"MouseEvent")}function Ow(e){return yw(e)?[e]:function(e){return uw(e,"NodeList")}(e)?dw(e):Array.isArray(e)?e:dw(document.querySelectorAll(e))}function pw(e,t){e.forEach((function(e){e&&(e.style.transitionDuration=t+"ms")}))}function xw(e,t){e.forEach((function(e){e&&e.setAttribute("data-state",t)}))}function Lw(e){var t,i=Iw(e)[0];return null!=i&&null!=(t=i.ownerDocument)&&t.body?i.ownerDocument:document}function Sw(e,t,i){var M=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(t){e[M](t,i)}))}function mw(e,t){for(var i=t;i;){var M;if(e.contains(i))return!0;i=null==i.getRootNode||null==(M=i.getRootNode())?void 0:M.host}return!1}var Ew={isTouch:!1},ww=0;function Qw(){Ew.isTouch||(Ew.isTouch=!0,window.performance&&document.addEventListener("mousemove",kw))}function kw(){var e=performance.now();e-ww<20&&(Ew.isTouch=!1,document.removeEventListener("mousemove",kw)),ww=e}function Cw(){var e,t=document.activeElement;if((e=t)&&e._tippy&&e._tippy.reference===e){var i=t._tippy;t.blur&&!i.state.isVisible&&t.blur()}}var bw,fw=!!("undefined"!=typeof window&&"undefined"!=typeof document)&&!!window.msCrypto;function vw(e){return[e+"() was called on a"+("destroy"===e?"n already-":" ")+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function Uw(e){return e.replace(/[ \t]{2,}/g," ").replace(/^[ \t]*/gm,"").trim()}function Yw(e){return Uw("\n %ctippy.js\n\n %c"+Uw(e)+"\n\n %c👷 This is a development-only message. It will be removed in production.\n ")}function Zw(e){return[Yw(e),"color: #00C584; font-size: 1.3em; font-weight: bold;","line-height: 1.5","color: #a6a095;"]}function Vw(e,t){var i;e&&!bw.has(t)&&(bw.add(t),(i=console).warn.apply(i,Zw(t)))}function Ww(e,t){var i;e&&!bw.has(t)&&(bw.add(t),(i=console).error.apply(i,Zw(t)))}"production"!==process.env.NODE_ENV&&(bw=new Set);var Pw={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},Rw=Object.assign({appendTo:Nw,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},Pw,{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),Bw=Object.keys(Rw);function Gw(e){var t=(e.plugins||[]).reduce((function(t,i){var M,n=i.name,o=i.defaultValue;n&&(t[n]=void 0!==e[n]?e[n]:null!=(M=Rw[n])?M:o);return t}),{});return Object.assign({},e,t)}function _w(e,t){var i=Object.assign({},t,{content:cw(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys(Gw(Object.assign({},Rw,{plugins:t}))):Bw).reduce((function(t,i){var M=(e.getAttribute("data-tippy-"+i)||"").trim();if(!M)return t;if("content"===i)t[i]=M;else try{t[i]=JSON.parse(M)}catch(e){t[i]=M}return t}),{})}(e,t.plugins));return i.aria=Object.assign({},Rw.aria,i.aria),i.aria={expanded:"auto"===i.aria.expanded?t.interactive:i.aria.expanded,content:"auto"===i.aria.content?t.interactive?null:"describedby":i.aria.content},i}function Fw(e,t){void 0===e&&(e={}),void 0===t&&(t=[]),Object.keys(e).forEach((function(e){var i,M,n=jw(Rw,Object.keys(Pw)),o=(i=n,M=e,!{}.hasOwnProperty.call(i,M));o&&(o=0===t.filter((function(t){return t.name===e})).length),Vw(o,["`"+e+"`","is not a valid prop. You may have spelled it incorrectly, or if it's","a plugin, forgot to pass it in an array as props.plugins.","\n\n","All props: https://atomiks.github.io/tippyjs/v6/all-props/\n","Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))}))}function Hw(e,t){e.innerHTML=t}function Jw(e){var t=Tw();return!0===e?t.className=sw:(t.className=aw,yw(e)?t.appendChild(e):Hw(t,e)),t}function $w(e,t){yw(t.content)?(Hw(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?Hw(e,t.content):e.textContent=t.content)}function Xw(e){var t=e.firstElementChild,i=dw(t.children);return{box:t,content:i.find((function(e){return e.classList.contains(rw)})),arrow:i.find((function(e){return e.classList.contains(sw)||e.classList.contains(aw)})),backdrop:i.find((function(e){return e.classList.contains("tippy-backdrop")}))}}function qw(e){var t=Tw(),i=Tw();i.className="tippy-box",i.setAttribute("data-state","hidden"),i.setAttribute("tabindex","-1");var M=Tw();function n(i,M){var n=Xw(t),o=n.box,r=n.content,s=n.arrow;M.theme?o.setAttribute("data-theme",M.theme):o.removeAttribute("data-theme"),"string"==typeof M.animation?o.setAttribute("data-animation",M.animation):o.removeAttribute("data-animation"),M.inertia?o.setAttribute("data-inertia",""):o.removeAttribute("data-inertia"),o.style.maxWidth="number"==typeof M.maxWidth?M.maxWidth+"px":M.maxWidth,M.role?o.setAttribute("role",M.role):o.removeAttribute("role"),i.content===M.content&&i.allowHTML===M.allowHTML||$w(r,e.props),M.arrow?s?i.arrow!==M.arrow&&(o.removeChild(s),o.appendChild(Jw(M.arrow))):o.appendChild(Jw(M.arrow)):s&&o.removeChild(s)}return M.className=rw,M.setAttribute("data-state","hidden"),$w(M,e.props),t.appendChild(i),i.appendChild(M),n(e.props,e.props),{popper:t,onUpdate:n}}qw.$$tippy=!0;var Kw=1,eQ=[],tQ=[];function iQ(e,t){var i,M,n,o,r,s,a,l,N=_w(e,Object.assign({},Rw,Gw(hw(t)))),g=!1,u=!1,c=!1,D=!1,j=[],I=Dw(F,N.interactiveDebounce),z=Kw++,d=(l=N.plugins).filter((function(e,t){return l.indexOf(e)===t})),h={id:z,reference:e,popper:Tw(),popperInstance:null,props:N,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:d,clearDelayTimeouts:function(){clearTimeout(i),clearTimeout(M),cancelAnimationFrame(n)},setProps:function(t){"production"!==process.env.NODE_ENV&&Vw(h.state.isDestroyed,vw("setProps"));if(h.state.isDestroyed)return;C("onBeforeUpdate",[h,t]),G();var i=h.props,M=_w(e,Object.assign({},i,hw(t),{ignoreAttributes:!0}));h.props=M,B(),i.interactiveDebounce!==M.interactiveDebounce&&(v(),I=Dw(F,M.interactiveDebounce));i.triggerTarget&&!M.triggerTarget?Iw(i.triggerTarget).forEach((function(e){e.removeAttribute("aria-expanded")})):M.triggerTarget&&e.removeAttribute("aria-expanded");f(),k(),A&&A(i,M);h.popperInstance&&(X(),K().forEach((function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)})));C("onAfterUpdate",[h,t])},setContent:function(e){h.setProps({content:e})},show:function(){"production"!==process.env.NODE_ENV&&Vw(h.state.isDestroyed,vw("show"));var e=h.state.isVisible,t=h.state.isDestroyed,i=!h.state.isEnabled,M=Ew.isTouch&&!h.props.touch,n=gw(h.props.duration,0,Rw.duration);if(e||t||i||M)return;if(m().hasAttribute("disabled"))return;if(C("onShow",[h],!1),!1===h.props.onShow(h))return;h.state.isVisible=!0,S()&&(y.style.visibility="visible");k(),V(),h.state.isMounted||(y.style.transition="none");if(S()){var o=w();pw([o.box,o.content],0)}s=function(){var e;if(h.state.isVisible&&!D){if(D=!0,y.offsetHeight,y.style.transition=h.props.moveTransition,S()&&h.props.animation){var t=w(),i=t.box,M=t.content;pw([i,M],n),xw([i,M],"visible")}b(),f(),zw(tQ,h),null==(e=h.popperInstance)||e.forceUpdate(),C("onMount",[h]),h.props.animation&&S()&&function(e,t){P(e,t)}(n,(function(){h.state.isShown=!0,C("onShown",[h])}))}},function(){var e,t=h.props.appendTo,i=m();e=h.props.interactive&&t===Nw||"parent"===t?i.parentNode:cw(t,[i]);e.contains(y)||e.appendChild(y);h.state.isMounted=!0,X(),"production"!==process.env.NODE_ENV&&Vw(h.props.interactive&&t===Rw.appendTo&&i.nextElementSibling!==y,["Interactive tippy element may not be accessible via keyboard","navigation because it is not directly after the reference element","in the DOM source order.","\n\n","Using a wrapper <div> or <span> tag around the reference element","solves this by creating a new parentNode context.","\n\n","Specifying `appendTo: document.body` silences this warning, but it","assumes you are using a focus management solution to handle","keyboard navigation.","\n\n","See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}()},hide:function(){"production"!==process.env.NODE_ENV&&Vw(h.state.isDestroyed,vw("hide"));var e=!h.state.isVisible,t=h.state.isDestroyed,i=!h.state.isEnabled,M=gw(h.props.duration,1,Rw.duration);if(e||t||i)return;if(C("onHide",[h],!1),!1===h.props.onHide(h))return;h.state.isVisible=!1,h.state.isShown=!1,D=!1,g=!1,S()&&(y.style.visibility="hidden");if(v(),W(),k(!0),S()){var n=w(),o=n.box,r=n.content;h.props.animation&&(pw([o,r],M),xw([o,r],"hidden"))}b(),f(),h.props.animation?S()&&function(e,t){P(e,(function(){!h.state.isVisible&&y.parentNode&&y.parentNode.contains(y)&&t()}))}(M,h.unmount):h.unmount()},hideWithInteractivity:function(e){"production"!==process.env.NODE_ENV&&Vw(h.state.isDestroyed,vw("hideWithInteractivity"));E().addEventListener("mousemove",I),zw(eQ,I),I(e)},enable:function(){h.state.isEnabled=!0},disable:function(){h.hide(),h.state.isEnabled=!1},unmount:function(){"production"!==process.env.NODE_ENV&&Vw(h.state.isDestroyed,vw("unmount"));h.state.isVisible&&h.hide();if(!h.state.isMounted)return;q(),K().forEach((function(e){e._tippy.unmount()})),y.parentNode&&y.parentNode.removeChild(y);tQ=tQ.filter((function(e){return e!==h})),h.state.isMounted=!1,C("onHidden",[h])},destroy:function(){"production"!==process.env.NODE_ENV&&Vw(h.state.isDestroyed,vw("destroy"));if(h.state.isDestroyed)return;h.clearDelayTimeouts(),h.unmount(),G(),delete e._tippy,h.state.isDestroyed=!0,C("onDestroy",[h])}};if(!N.render)return"production"!==process.env.NODE_ENV&&Ww(!0,"render() function has not been supplied."),h;var T=N.render(h),y=T.popper,A=T.onUpdate;y.setAttribute("data-tippy-root",""),y.id="tippy-"+h.id,h.popper=y,e._tippy=h,y._tippy=h;var O=d.map((function(e){return e.fn(h)})),p=e.hasAttribute("aria-expanded");return B(),f(),k(),C("onCreate",[h]),N.showOnCreate&&ee(),y.addEventListener("mouseenter",(function(){h.props.interactive&&h.state.isVisible&&h.clearDelayTimeouts()})),y.addEventListener("mouseleave",(function(){h.props.interactive&&h.props.trigger.indexOf("mouseenter")>=0&&E().addEventListener("mousemove",I)})),h;function x(){var e=h.props.touch;return Array.isArray(e)?e:[e,0]}function L(){return"hold"===x()[0]}function S(){var e;return!(null==(e=h.props.render)||!e.$$tippy)}function m(){return a||e}function E(){var e=m().parentNode;return e?Lw(e):document}function w(){return Xw(y)}function Q(e){return h.state.isMounted&&!h.state.isVisible||Ew.isTouch||o&&"focus"===o.type?0:gw(h.props.delay,e?0:1,Rw.delay)}function k(e){void 0===e&&(e=!1),y.style.pointerEvents=h.props.interactive&&!e?"":"none",y.style.zIndex=""+h.props.zIndex}function C(e,t,i){var M;(void 0===i&&(i=!0),O.forEach((function(i){i[e]&&i[e].apply(i,t)})),i)&&(M=h.props)[e].apply(M,t)}function b(){var t=h.props.aria;if(t.content){var i="aria-"+t.content,M=y.id;Iw(h.props.triggerTarget||e).forEach((function(e){var t=e.getAttribute(i);if(h.state.isVisible)e.setAttribute(i,t?t+" "+M:M);else{var n=t&&t.replace(M,"").trim();n?e.setAttribute(i,n):e.removeAttribute(i)}}))}}function f(){!p&&h.props.aria.expanded&&Iw(h.props.triggerTarget||e).forEach((function(e){h.props.interactive?e.setAttribute("aria-expanded",h.state.isVisible&&e===m()?"true":"false"):e.removeAttribute("aria-expanded")}))}function v(){E().removeEventListener("mousemove",I),eQ=eQ.filter((function(e){return e!==I}))}function U(t){if(!Ew.isTouch||!c&&"mousedown"!==t.type){var i=t.composedPath&&t.composedPath()[0]||t.target;if(!h.props.interactive||!mw(y,i)){if(Iw(h.props.triggerTarget||e).some((function(e){return mw(e,i)}))){if(Ew.isTouch)return;if(h.state.isVisible&&h.props.trigger.indexOf("click")>=0)return}else C("onClickOutside",[h,t]);!0===h.props.hideOnClick&&(h.clearDelayTimeouts(),h.hide(),u=!0,setTimeout((function(){u=!1})),h.state.isMounted||W())}}}function Y(){c=!0}function Z(){c=!1}function V(){var e=E();e.addEventListener("mousedown",U,!0),e.addEventListener("touchend",U,lw),e.addEventListener("touchstart",Z,lw),e.addEventListener("touchmove",Y,lw)}function W(){var e=E();e.removeEventListener("mousedown",U,!0),e.removeEventListener("touchend",U,lw),e.removeEventListener("touchstart",Z,lw),e.removeEventListener("touchmove",Y,lw)}function P(e,t){var i=w().box;function M(e){e.target===i&&(Sw(i,"remove",M),t())}if(0===e)return t();Sw(i,"remove",r),Sw(i,"add",M),r=M}function R(t,i,M){void 0===M&&(M=!1),Iw(h.props.triggerTarget||e).forEach((function(e){e.addEventListener(t,i,M),j.push({node:e,eventType:t,handler:i,options:M})}))}function B(){var e;L()&&(R("touchstart",_,{passive:!0}),R("touchend",H,{passive:!0})),(e=h.props.trigger,e.split(/\s+/).filter(Boolean)).forEach((function(e){if("manual"!==e)switch(R(e,_),e){case"mouseenter":R("mouseleave",H);break;case"focus":R(fw?"focusout":"blur",J);break;case"focusin":R("focusout",J)}}))}function G(){j.forEach((function(e){var t=e.node,i=e.eventType,M=e.handler,n=e.options;t.removeEventListener(i,M,n)})),j=[]}function _(e){var t,i=!1;if(h.state.isEnabled&&!$(e)&&!u){var M="focus"===(null==(t=o)?void 0:t.type);o=e,a=e.currentTarget,f(),!h.state.isVisible&&Aw(e)&&eQ.forEach((function(t){return t(e)})),"click"===e.type&&(h.props.trigger.indexOf("mouseenter")<0||g)&&!1!==h.props.hideOnClick&&h.state.isVisible?i=!0:ee(e),"click"===e.type&&(g=!i),i&&!M&&te(e)}}function F(e){var t=e.target,i=m().contains(t)||y.contains(t);if("mousemove"!==e.type||!i){var M=K().concat(y).map((function(e){var t,i=null==(t=e._tippy.popperInstance)?void 0:t.state;return i?{popperRect:e.getBoundingClientRect(),popperState:i,props:N}:null})).filter(Boolean);(function(e,t){var i=t.clientX,M=t.clientY;return e.every((function(e){var t=e.popperRect,n=e.popperState,o=e.props.interactiveBorder,r=n.placement.split("-")[0],s=n.modifiersData.offset;if(!s)return!0;var a="bottom"===r?s.top.y:0,l="top"===r?s.bottom.y:0,N="right"===r?s.left.x:0,g="left"===r?s.right.x:0,u=t.top-M+a>o,c=M-t.bottom-l>o,D=t.left-i+N>o,j=i-t.right-g>o;return u||c||D||j}))})(M,e)&&(v(),te(e))}}function H(e){$(e)||h.props.trigger.indexOf("click")>=0&&g||(h.props.interactive?h.hideWithInteractivity(e):te(e))}function J(e){h.props.trigger.indexOf("focusin")<0&&e.target!==m()||h.props.interactive&&e.relatedTarget&&y.contains(e.relatedTarget)||te(e)}function $(e){return!!Ew.isTouch&&L()!==e.type.indexOf("touch")>=0}function X(){q();var t=h.props,i=t.popperOptions,M=t.placement,n=t.offset,o=t.getReferenceClientRect,r=t.moveTransition,a=S()?Xw(y).arrow:null,l=o?{getBoundingClientRect:o,contextElement:o.contextElement||m()}:e,N={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if(S()){var i=w().box;["placement","reference-hidden","escaped"].forEach((function(e){"placement"===e?i.setAttribute("data-placement",t.placement):t.attributes.popper["data-popper-"+e]?i.setAttribute("data-"+e,""):i.removeAttribute("data-"+e)})),t.attributes.popper={}}}},g=[{name:"offset",options:{offset:n}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!r}},N];S()&&a&&g.push({name:"arrow",options:{element:a,padding:3}}),g.push.apply(g,(null==i?void 0:i.modifiers)||[]),h.popperInstance=nw(l,y,Object.assign({},i,{placement:M,onFirstUpdate:s,modifiers:g}))}function q(){h.popperInstance&&(h.popperInstance.destroy(),h.popperInstance=null)}function K(){return dw(y.querySelectorAll("[data-tippy-root]"))}function ee(e){h.clearDelayTimeouts(),e&&C("onTrigger",[h,e]),V();var t=Q(!0),M=x(),n=M[0],o=M[1];Ew.isTouch&&"hold"===n&&o&&(t=o),t?i=setTimeout((function(){h.show()}),t):h.show()}function te(e){if(h.clearDelayTimeouts(),C("onUntrigger",[h,e]),h.state.isVisible){if(!(h.props.trigger.indexOf("mouseenter")>=0&&h.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&g)){var t=Q(!1);t?M=setTimeout((function(){h.state.isVisible&&h.hide()}),t):n=requestAnimationFrame((function(){h.hide()}))}}else W()}}function MQ(e,t){void 0===t&&(t={});var i=Rw.plugins.concat(t.plugins||[]);"production"!==process.env.NODE_ENV&&(!function(e){var t=!e,i="[object Object]"===Object.prototype.toString.call(e)&&!e.addEventListener;Ww(t,["tippy() was passed","`"+String(e)+"`","as its targets (first) argument. Valid types are: String, Element,","Element[], or NodeList."].join(" ")),Ww(i,["tippy() was passed a plain object which is not supported as an argument","for virtual positioning. Use props.getReferenceClientRect instead."].join(" "))}(e),Fw(t,i)),document.addEventListener("touchstart",Qw,lw),window.addEventListener("blur",Cw);var M=Object.assign({},t,{plugins:i}),n=Ow(e);if("production"!==process.env.NODE_ENV){var o=yw(M.content),r=n.length>1;Vw(o&&r,["tippy() was passed an Element as the `content` prop, but more than","one tippy instance was created by this invocation. This means the","content element will only be appended to the last tippy instance.","\n\n","Instead, pass the .innerHTML of the element, or use a function that","returns a cloned version of the element instead.","\n\n","1) content: element.innerHTML\n","2) content: () => element.cloneNode(true)"].join(" "))}var s=n.reduce((function(e,t){var i=t&&iQ(t,M);return i&&e.push(i),e}),[]);return yw(e)?s[0]:s}MQ.defaultProps=Rw,MQ.setDefaultProps=function(e){"production"!==process.env.NODE_ENV&&Fw(e,[]),Object.keys(e).forEach((function(t){Rw[t]=e[t]}))},MQ.currentInput=Ew;var nQ=Object.assign({},nE,{effect:function(e){var t=e.state,i={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,i.popper),t.styles=i,t.elements.arrow&&Object.assign(t.elements.arrow.style,i.arrow)}}),oQ=function(e,t){var i;void 0===t&&(t={}),"production"!==process.env.NODE_ENV&&Ww(!Array.isArray(e),["The first argument passed to createSingleton() must be an array of","tippy instances. The passed value was",String(e)].join(" "));var M,n=e,o=[],r=[],s=t.overrides,a=[],l=!1;function N(){r=n.map((function(e){return Iw(e.props.triggerTarget||e.reference)})).reduce((function(e,t){return e.concat(t)}),[])}function g(){o=n.map((function(e){return e.reference}))}function u(e){n.forEach((function(t){e?t.enable():t.disable()}))}function c(e){return n.map((function(t){var i=t.setProps;return t.setProps=function(n){i(n),t.reference===M&&e.setProps(n)},function(){t.setProps=i}}))}function D(e,t){var i=r.indexOf(t);if(t!==M){M=t;var a=(s||[]).concat("content").reduce((function(e,t){return e[t]=n[i].props[t],e}),{});e.setProps(Object.assign({},a,{getReferenceClientRect:"function"==typeof a.getReferenceClientRect?a.getReferenceClientRect:function(){var e;return null==(e=o[i])?void 0:e.getBoundingClientRect()}}))}}u(!1),g(),N();var j={fn:function(){return{onDestroy:function(){u(!0)},onHidden:function(){M=null},onClickOutside:function(e){e.props.showOnCreate&&!l&&(l=!0,M=null)},onShow:function(e){e.props.showOnCreate&&!l&&(l=!0,D(e,o[0]))},onTrigger:function(e,t){D(e,t.currentTarget)}}}},I=MQ(Tw(),Object.assign({},jw(t,["overrides"]),{plugins:[j].concat(t.plugins||[]),triggerTarget:r,popperOptions:Object.assign({},t.popperOptions,{modifiers:[].concat((null==(i=t.popperOptions)?void 0:i.modifiers)||[],[nQ])})})),z=I.show;I.show=function(e){if(z(),!M&&null==e)return D(I,o[0]);if(!M||null!=e){if("number"==typeof e)return o[e]&&D(I,o[e]);if(n.indexOf(e)>=0){var t=e.reference;return D(I,t)}return o.indexOf(e)>=0?D(I,e):void 0}},I.showNext=function(){var e=o[0];if(!M)return I.show(0);var t=o.indexOf(M);I.show(o[t+1]||e)},I.showPrevious=function(){var e=o[o.length-1];if(!M)return I.show(e);var t=o.indexOf(M),i=o[t-1]||e;I.show(i)};var d=I.setProps;return I.setProps=function(e){s=e.overrides||s,d(e)},I.setInstances=function(e){u(!0),a.forEach((function(e){return e()})),n=e,u(!1),g(),N(),a=c(I),I.setProps({triggerTarget:r})},a=c(I),I},rQ={clientX:0,clientY:0},sQ=[];function aQ(e){var t=e.clientX,i=e.clientY;rQ={clientX:t,clientY:i}}var lQ={name:"followCursor",defaultValue:!1,fn:function(e){var t=e.reference,i=Lw(e.props.triggerTarget||t),M=!1,n=!1,o=!0,r=e.props;function s(){return"initial"===e.props.followCursor&&e.state.isVisible}function a(){i.addEventListener("mousemove",g)}function l(){i.removeEventListener("mousemove",g)}function N(){M=!0,e.setProps({getReferenceClientRect:null}),M=!1}function g(i){var M=!i.target||t.contains(i.target),n=e.props.followCursor,o=i.clientX,r=i.clientY,s=t.getBoundingClientRect(),a=o-s.left,l=r-s.top;!M&&e.props.interactive||e.setProps({getReferenceClientRect:function(){var e=t.getBoundingClientRect(),i=o,M=r;"initial"===n&&(i=e.left+a,M=e.top+l);var s="horizontal"===n?e.top:M,N="vertical"===n?e.right:i,g="horizontal"===n?e.bottom:M,u="vertical"===n?e.left:i;return{width:N-u,height:g-s,top:s,right:N,bottom:g,left:u}}})}function u(){e.props.followCursor&&(sQ.push({instance:e,doc:i}),function(e){e.addEventListener("mousemove",aQ)}(i))}function c(){0===(sQ=sQ.filter((function(t){return t.instance!==e}))).filter((function(e){return e.doc===i})).length&&function(e){e.removeEventListener("mousemove",aQ)}(i)}return{onCreate:u,onDestroy:c,onBeforeUpdate:function(){r=e.props},onAfterUpdate:function(t,i){var o=i.followCursor;M||void 0!==o&&r.followCursor!==o&&(c(),o?(u(),!e.state.isMounted||n||s()||a()):(l(),N()))},onMount:function(){e.props.followCursor&&!n&&(o&&(g(rQ),o=!1),s()||a())},onTrigger:function(e,t){Aw(t)&&(rQ={clientX:t.clientX,clientY:t.clientY}),n="focus"===t.type},onHidden:function(){e.props.followCursor&&(N(),l(),o=!0)}}}};function NQ(e){return!0===e||"true"===e||!1!==e&&"false"!==e&&(!!["initial","horizontal","vertical"].includes(String(e))&&e)}function gQ(e){if(Array.isArray(e))return e;if("number"==typeof e)return e;if("string"==typeof e){if(e.includes(",")){const t=e.split(",").map((e=>parseInt(e.trim(),10)));return t}const t=parseInt(e,10);if(!isNaN(t))return t}return 200}MQ.setDefaultProps({render:qw});let uQ=class extends Re{static get styles(){return[Zm]}createRenderRoot(){return this}constructor(){super(),this.for=null,this.content="",this.size="small",this.duration=200,this.interactive=!1,this.placement="top",this.disabled=!1,this.distance=8,this.skidding=0,this.open=!1,this.trigger="mouseenter focus",this.allowHTML=!1,this.followCursor=!1,this.arrow="default",this.singleton=!1,this.enableRecursiveMode=!1,this.delay=0,this.maxWidth="auto",this.zIndex=9999,this.hideOnClick=!0,this.inertia=!1,this.interactiveBorder=2,this.enableVisibilityEffect=!1,this.enableTabClose=!1}firstUpdated(){this.attachTooltip();const e=this.for&&document.getElementById(this.for)||this.firstElementChild;this.visibilityManager=new tM({host:this,target:e,enableVisibilityEffect:this.enableVisibilityEffect,enableTabClose:this.enableTabClose,isOpen:()=>this.open,onAnchorOutOfView:()=>{this.open=!1,this.hideAllTooltips(),this.emit("nile-visibility-change",{visible:!1,reason:"anchor-out-of-view"})},onDocumentHidden:()=>{this.open=!1,this.hideAllTooltips(),this.emit("nile-visibility-change",{visible:!1,reason:"document-hidden"})},emit:(e,t)=>this.emit(`nile-${e}`,t)})}refresh(){this.attachTooltip()}hasValidContent(){const e=this.content??this.getAttribute("data-tippy-content")??"";return"string"==typeof e&&e.trim().length>0}attachTooltip(){if(this.destroyTooltips(),this.disabled||!this.enableRecursiveMode&&!this.singleton&&!this.hasValidContent())return;const e={content:this.content||this.getAttribute("data-tippy-content")||void 0,placement:this.placement,trigger:this.trigger,offset:[this.skidding,this.distance],theme:"lite",animation:"fade",interactive:this.interactive,arrow:ow,duration:gQ(this.duration),allowHTML:this.allowHTML,delay:this.delay,maxWidth:this.maxWidth,zIndex:this.zIndex,hideOnClick:!1,inertia:this.inertia,interactiveBorder:this.interactiveBorder,appendTo:document.body,followCursor:NQ(this.followCursor),plugins:NQ(this.followCursor)?[lQ]:[],onShow:e=>{this.open=!0;const t=e.popper.querySelector(".tippy-content");t&&(this.width&&(t.style.width=this.width),this.height&&(t.style.height=this.height,t.style.overflow="auto")),this.dispatchEvent(new CustomEvent("nile-show",{detail:{instance:e,target:e.reference}})),this.dispatchEvent(new CustomEvent("nile-toggle",{detail:{open:!0,instance:e,target:e.reference}}))},onHide:e=>{this.open=!1,this.dispatchEvent(new CustomEvent("nile-hide",{detail:{instance:e,target:e.reference}})),this.dispatchEvent(new CustomEvent("nile-toggle",{detail:{open:!1,instance:e,target:e.reference}}))}};if(this.for){if(this.singleton&&!this.for.startsWith("#")&&!document.getElementById(this.for)){const t=Array.from(document.querySelectorAll(`.${this.for}`));if(t.length>0)return this.tooltipInstances=t.map((t=>{const i=MQ(t,{...e,content:t.getAttribute("content")||this.content});return i.popper.querySelector(".tippy-box")?.classList.add(this.size),i})),this.singletonInstance=oQ(this.tooltipInstances,{delay:[75,0],arrow:ow,moveTransition:"transform 0.15s ease-out"}),void(this.open&&queueMicrotask((()=>this.singletonInstance?.show())))}const t=document.getElementById(this.for);if(this.singleton&&t){const i=Array.from(t.querySelectorAll("[content]"));if(i.length>0)return this.tooltipInstances=i.map((t=>{const i=MQ(t,{...e,content:t.getAttribute("content")||this.content});return i.popper.querySelector(".tippy-box")?.classList.add(this.size),i})),this.singletonInstance=oQ(this.tooltipInstances,{delay:[75,0],arrow:ow,moveTransition:"transform 0.15s ease-out"}),void(this.open&&queueMicrotask((()=>this.singletonInstance?.show())))}if(this.targetEl=document.getElementById(this.for),!this.targetEl)return;this.id||(this.generatedId=`nile-tooltip-${Math.random().toString(36).slice(2,9)}`,this.id=this.generatedId),this.prevDescribedby=this.targetEl.getAttribute("aria-describedby");const i=this.prevDescribedby?`${this.prevDescribedby} ${this.id}`:this.id;return this.targetEl.setAttribute("aria-describedby",i),this.singleInstance=MQ(this.targetEl,e),this.size&&this.singleInstance.popper.querySelector(".tippy-box")?.classList.add(this.size),void(this.open&&queueMicrotask((()=>this.singleInstance?.show())))}if(this.enableRecursiveMode){const t=Array.from(this.querySelectorAll("[content]")).filter((e=>{const t=e.getAttribute("content");return null!==t&&t.trim().length>0}));t.length>0&&(this.tooltipInstances=t.map((t=>{const i=t,M=i.getAttribute("content")||this.content,n=MQ(i,{...e,content:M});return n.popper.querySelector(".tippy-box")?.classList.add(this.size),n})),this.singleton&&this.tooltipInstances.length>1&&(this.singletonInstance=oQ(this.tooltipInstances,{delay:[75,0],arrow:ow,moveTransition:"transform 0.15s ease-out"})),this.open&&(this.singletonInstance?this.singletonInstance.show():this.tooltipInstances.forEach((e=>e.show()))))}else{const t=this.firstElementChild;if(t){const i=t.getAttribute("content")||this.content,M=MQ(t,{...e,content:i});M.popper.querySelector(".tippy-box")?.classList.add(this.size),this.tooltipInstances=[M],this.open&&M.show()}}}destroyTooltips(){if(this.tooltipInstances?.forEach((e=>e.destroy())),this.singleInstance?.destroy(),this.singletonInstance?.destroy(),this.tooltipInstances=void 0,this.singleInstance=void 0,this.singletonInstance=void 0,this.targetEl&&this.id){const e=this.targetEl.getAttribute("aria-describedby")?.split(" ").filter((e=>e!==this.id)).join(" ").trim();e?this.targetEl.setAttribute("aria-describedby",e):this.targetEl.removeAttribute("aria-describedby")}}hideAllTooltips(){this.singleInstance?.hide(),this.singletonInstance?.hide(),this.tooltipInstances?.forEach((e=>e.hide()))}disconnectedCallback(){super.disconnectedCallback(),this.visibilityManager?.cleanup(),this.destroyTooltips()}updated(e){super.updated(e),["for","content","placement","distance","skidding","trigger","disabled","hoist","size","arrow","singleton"].some((t=>e.has(t)))&&this.attachTooltip(),e.has("open")&&(this.open?(this.visibilityManager?.setup(),this.singleInstance?.show(),this.singletonInstance?.show(),this.tooltipInstances?.forEach((e=>e.show()))):(this.visibilityManager?.cleanup(),this.singleInstance?.hide(),this.singletonInstance?.hide(),this.tooltipInstances?.forEach((e=>e.hide()))))}};e([ce({type:String,attribute:"for"})],uQ.prototype,"for",void 0),e([ce({type:String,reflect:!0})],uQ.prototype,"content",void 0),e([ce({type:String,reflect:!0})],uQ.prototype,"size",void 0),e([ce({type:String,reflect:!0})],uQ.prototype,"duration",void 0),e([ce({type:Boolean,reflect:!0})],uQ.prototype,"interactive",void 0),e([ce({type:String})],uQ.prototype,"placement",void 0),e([ce({type:Boolean})],uQ.prototype,"disabled",void 0),e([ce({type:Number})],uQ.prototype,"distance",void 0),e([ce({type:Number})],uQ.prototype,"skidding",void 0),e([ce({type:Boolean,reflect:!0})],uQ.prototype,"open",void 0),e([ce({type:String})],uQ.prototype,"trigger",void 0),e([ce({type:Boolean,reflect:!0})],uQ.prototype,"allowHTML",void 0),e([ce({type:String,reflect:!0,attribute:!0})],uQ.prototype,"followCursor",void 0),e([ce({type:String,reflect:!0,attribute:!0})],uQ.prototype,"arrow",void 0),e([ce({type:Boolean,reflect:!0})],uQ.prototype,"singleton",void 0),e([ce({type:Boolean,reflect:!0})],uQ.prototype,"enableRecursiveMode",void 0),e([ce({type:String,reflect:!0})],uQ.prototype,"delay",void 0),e([ce({type:String,reflect:!0})],uQ.prototype,"maxWidth",void 0),e([ce({type:Number})],uQ.prototype,"zIndex",void 0),e([ce({type:[Boolean,String],reflect:!0})],uQ.prototype,"hideOnClick",void 0),e([ce({type:Boolean,reflect:!0})],uQ.prototype,"inertia",void 0),e([ce({type:Number})],uQ.prototype,"interactiveBorder",void 0),e([ce({type:Boolean,reflect:!0})],uQ.prototype,"enableVisibilityEffect",void 0),e([ce({type:Boolean,reflect:!0})],uQ.prototype,"enableTabClose",void 0),e([ce({type:String,reflect:!0})],uQ.prototype,"width",void 0),e([ce({type:String,reflect:!0})],uQ.prototype,"height",void 0),uQ=e([Ne("nile-lite-tooltip")],uQ);const cQ=r`
|
|
16583
|
+
`;!function(){const e="nile-lite-tooltip-styles";if(document.getElementById(e))return;const t=document.createElement("style");t.id=e,t.textContent=Um.cssText,document.head.appendChild(t)}();var Ym="top",Zm="bottom",Vm="right",Wm="left",Pm="auto",Rm=[Ym,Zm,Vm,Wm],Bm="start",Gm="end",_m="viewport",Fm="popper",Hm=Rm.reduce((function(e,t){return e.concat([t+"-"+Bm,t+"-"+Gm])}),[]),Jm=[].concat(Rm,[Pm]).reduce((function(e,t){return e.concat([t,t+"-"+Bm,t+"-"+Gm])}),[]),$m=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function Xm(e){return e?(e.nodeName||"").toLowerCase():null}function qm(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Km(e){return e instanceof qm(e).Element||e instanceof Element}function eE(e){return e instanceof qm(e).HTMLElement||e instanceof HTMLElement}function tE(e){return"undefined"!=typeof ShadowRoot&&(e instanceof qm(e).ShadowRoot||e instanceof ShadowRoot)}var iE={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var i=t.styles[e]||{},M=t.attributes[e]||{},n=t.elements[e];eE(n)&&Xm(n)&&(Object.assign(n.style,i),Object.keys(M).forEach((function(e){var t=M[e];!1===t?n.removeAttribute(e):n.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,i={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,i.popper),t.styles=i,t.elements.arrow&&Object.assign(t.elements.arrow.style,i.arrow),function(){Object.keys(t.elements).forEach((function(e){var M=t.elements[e],n=t.attributes[e]||{},o=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:i[e]).reduce((function(e,t){return e[t]="",e}),{});eE(M)&&Xm(M)&&(Object.assign(M.style,o),Object.keys(n).forEach((function(e){M.removeAttribute(e)})))}))}},requires:["computeStyles"]};function ME(e){return e.split("-")[0]}var nE=Math.max,oE=Math.min,rE=Math.round;function sE(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function aE(){return!/^((?!chrome|android).)*safari/i.test(sE())}function lE(e,t,i){void 0===t&&(t=!1),void 0===i&&(i=!1);var M=e.getBoundingClientRect(),n=1,o=1;t&&eE(e)&&(n=e.offsetWidth>0&&rE(M.width)/e.offsetWidth||1,o=e.offsetHeight>0&&rE(M.height)/e.offsetHeight||1);var r=(Km(e)?qm(e):window).visualViewport,s=!aE()&&i,a=(M.left+(s&&r?r.offsetLeft:0))/n,l=(M.top+(s&&r?r.offsetTop:0))/o,N=M.width/n,g=M.height/o;return{width:N,height:g,top:l,right:a+N,bottom:l+g,left:a,x:a,y:l}}function NE(e){var t=lE(e),i=e.offsetWidth,M=e.offsetHeight;return Math.abs(t.width-i)<=1&&(i=t.width),Math.abs(t.height-M)<=1&&(M=t.height),{x:e.offsetLeft,y:e.offsetTop,width:i,height:M}}function gE(e,t){var i=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(i&&tE(i)){var M=t;do{if(M&&e.isSameNode(M))return!0;M=M.parentNode||M.host}while(M)}return!1}function uE(e){return qm(e).getComputedStyle(e)}function cE(e){return["table","td","th"].indexOf(Xm(e))>=0}function DE(e){return((Km(e)?e.ownerDocument:e.document)||window.document).documentElement}function jE(e){return"html"===Xm(e)?e:e.assignedSlot||e.parentNode||(tE(e)?e.host:null)||DE(e)}function IE(e){return eE(e)&&"fixed"!==uE(e).position?e.offsetParent:null}function zE(e){for(var t=qm(e),i=IE(e);i&&cE(i)&&"static"===uE(i).position;)i=IE(i);return i&&("html"===Xm(i)||"body"===Xm(i)&&"static"===uE(i).position)?t:i||function(e){var t=/firefox/i.test(sE());if(/Trident/i.test(sE())&&eE(e)&&"fixed"===uE(e).position)return null;var i=jE(e);for(tE(i)&&(i=i.host);eE(i)&&["html","body"].indexOf(Xm(i))<0;){var M=uE(i);if("none"!==M.transform||"none"!==M.perspective||"paint"===M.contain||-1!==["transform","perspective"].indexOf(M.willChange)||t&&"filter"===M.willChange||t&&M.filter&&"none"!==M.filter)return i;i=i.parentNode}return null}(e)||t}function dE(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function hE(e,t,i){return nE(e,oE(t,i))}function TE(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function yE(e,t){return t.reduce((function(t,i){return t[i]=e,t}),{})}var AE={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,i=e.state,M=e.name,n=e.options,o=i.elements.arrow,r=i.modifiersData.popperOffsets,s=ME(i.placement),a=dE(s),l=[Wm,Vm].indexOf(s)>=0?"height":"width";if(o&&r){var N=function(e,t){return TE("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:yE(e,Rm))}(n.padding,i),g=NE(o),u="y"===a?Ym:Wm,c="y"===a?Zm:Vm,D=i.rects.reference[l]+i.rects.reference[a]-r[a]-i.rects.popper[l],j=r[a]-i.rects.reference[a],I=zE(o),z=I?"y"===a?I.clientHeight||0:I.clientWidth||0:0,d=D/2-j/2,h=N[u],T=z-g[l]-N[c],y=z/2-g[l]/2+d,A=hE(h,y,T),O=a;i.modifiersData[M]=((t={})[O]=A,t.centerOffset=A-y,t)}},effect:function(e){var t=e.state,i=e.options.element,M=void 0===i?"[data-popper-arrow]":i;null!=M&&("string"!=typeof M||(M=t.elements.popper.querySelector(M)))&&gE(t.elements.popper,M)&&(t.elements.arrow=M)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function OE(e){return e.split("-")[1]}var pE={top:"auto",right:"auto",bottom:"auto",left:"auto"};function xE(e){var t,i=e.popper,M=e.popperRect,n=e.placement,o=e.variation,r=e.offsets,s=e.position,a=e.gpuAcceleration,l=e.adaptive,N=e.roundOffsets,g=e.isFixed,u=r.x,c=void 0===u?0:u,D=r.y,j=void 0===D?0:D,I="function"==typeof N?N({x:c,y:j}):{x:c,y:j};c=I.x,j=I.y;var z=r.hasOwnProperty("x"),d=r.hasOwnProperty("y"),h=Wm,T=Ym,y=window;if(l){var A=zE(i),O="clientHeight",p="clientWidth";if(A===qm(i)&&"static"!==uE(A=DE(i)).position&&"absolute"===s&&(O="scrollHeight",p="scrollWidth"),n===Ym||(n===Wm||n===Vm)&&o===Gm)T=Zm,j-=(g&&A===y&&y.visualViewport?y.visualViewport.height:A[O])-M.height,j*=a?1:-1;if(n===Wm||(n===Ym||n===Zm)&&o===Gm)h=Vm,c-=(g&&A===y&&y.visualViewport?y.visualViewport.width:A[p])-M.width,c*=a?1:-1}var x,L=Object.assign({position:s},l&&pE),S=!0===N?function(e,t){var i=e.x,M=e.y,n=t.devicePixelRatio||1;return{x:rE(i*n)/n||0,y:rE(M*n)/n||0}}({x:c,y:j},qm(i)):{x:c,y:j};return c=S.x,j=S.y,a?Object.assign({},L,((x={})[T]=d?"0":"",x[h]=z?"0":"",x.transform=(y.devicePixelRatio||1)<=1?"translate("+c+"px, "+j+"px)":"translate3d("+c+"px, "+j+"px, 0)",x)):Object.assign({},L,((t={})[T]=d?j+"px":"",t[h]=z?c+"px":"",t.transform="",t))}var LE={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,i=e.options,M=i.gpuAcceleration,n=void 0===M||M,o=i.adaptive,r=void 0===o||o,s=i.roundOffsets,a=void 0===s||s,l={placement:ME(t.placement),variation:OE(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:n,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,xE(Object.assign({},l,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:r,roundOffsets:a})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,xE(Object.assign({},l,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:a})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},SE={passive:!0};var mE={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,i=e.instance,M=e.options,n=M.scroll,o=void 0===n||n,r=M.resize,s=void 0===r||r,a=qm(t.elements.popper),l=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&l.forEach((function(e){e.addEventListener("scroll",i.update,SE)})),s&&a.addEventListener("resize",i.update,SE),function(){o&&l.forEach((function(e){e.removeEventListener("scroll",i.update,SE)})),s&&a.removeEventListener("resize",i.update,SE)}},data:{}},EE={left:"right",right:"left",bottom:"top",top:"bottom"};function wE(e){return e.replace(/left|right|bottom|top/g,(function(e){return EE[e]}))}var QE={start:"end",end:"start"};function kE(e){return e.replace(/start|end/g,(function(e){return QE[e]}))}function CE(e){var t=qm(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function bE(e){return lE(DE(e)).left+CE(e).scrollLeft}function fE(e){var t=uE(e),i=t.overflow,M=t.overflowX,n=t.overflowY;return/auto|scroll|overlay|hidden/.test(i+n+M)}function vE(e){return["html","body","#document"].indexOf(Xm(e))>=0?e.ownerDocument.body:eE(e)&&fE(e)?e:vE(jE(e))}function UE(e,t){var i;void 0===t&&(t=[]);var M=vE(e),n=M===(null==(i=e.ownerDocument)?void 0:i.body),o=qm(M),r=n?[o].concat(o.visualViewport||[],fE(M)?M:[]):M,s=t.concat(r);return n?s:s.concat(UE(jE(r)))}function YE(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function ZE(e,t,i){return t===_m?YE(function(e,t){var i=qm(e),M=DE(e),n=i.visualViewport,o=M.clientWidth,r=M.clientHeight,s=0,a=0;if(n){o=n.width,r=n.height;var l=aE();(l||!l&&"fixed"===t)&&(s=n.offsetLeft,a=n.offsetTop)}return{width:o,height:r,x:s+bE(e),y:a}}(e,i)):Km(t)?function(e,t){var i=lE(e,!1,"fixed"===t);return i.top=i.top+e.clientTop,i.left=i.left+e.clientLeft,i.bottom=i.top+e.clientHeight,i.right=i.left+e.clientWidth,i.width=e.clientWidth,i.height=e.clientHeight,i.x=i.left,i.y=i.top,i}(t,i):YE(function(e){var t,i=DE(e),M=CE(e),n=null==(t=e.ownerDocument)?void 0:t.body,o=nE(i.scrollWidth,i.clientWidth,n?n.scrollWidth:0,n?n.clientWidth:0),r=nE(i.scrollHeight,i.clientHeight,n?n.scrollHeight:0,n?n.clientHeight:0),s=-M.scrollLeft+bE(e),a=-M.scrollTop;return"rtl"===uE(n||i).direction&&(s+=nE(i.clientWidth,n?n.clientWidth:0)-o),{width:o,height:r,x:s,y:a}}(DE(e)))}function VE(e,t,i,M){var n="clippingParents"===t?function(e){var t=UE(jE(e)),i=["absolute","fixed"].indexOf(uE(e).position)>=0&&eE(e)?zE(e):e;return Km(i)?t.filter((function(e){return Km(e)&&gE(e,i)&&"body"!==Xm(e)})):[]}(e):[].concat(t),o=[].concat(n,[i]),r=o[0],s=o.reduce((function(t,i){var n=ZE(e,i,M);return t.top=nE(n.top,t.top),t.right=oE(n.right,t.right),t.bottom=oE(n.bottom,t.bottom),t.left=nE(n.left,t.left),t}),ZE(e,r,M));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function WE(e){var t,i=e.reference,M=e.element,n=e.placement,o=n?ME(n):null,r=n?OE(n):null,s=i.x+i.width/2-M.width/2,a=i.y+i.height/2-M.height/2;switch(o){case Ym:t={x:s,y:i.y-M.height};break;case Zm:t={x:s,y:i.y+i.height};break;case Vm:t={x:i.x+i.width,y:a};break;case Wm:t={x:i.x-M.width,y:a};break;default:t={x:i.x,y:i.y}}var l=o?dE(o):null;if(null!=l){var N="y"===l?"height":"width";switch(r){case Bm:t[l]=t[l]-(i[N]/2-M[N]/2);break;case Gm:t[l]=t[l]+(i[N]/2-M[N]/2)}}return t}function PE(e,t){void 0===t&&(t={});var i=t,M=i.placement,n=void 0===M?e.placement:M,o=i.strategy,r=void 0===o?e.strategy:o,s=i.boundary,a=void 0===s?"clippingParents":s,l=i.rootBoundary,N=void 0===l?_m:l,g=i.elementContext,u=void 0===g?Fm:g,c=i.altBoundary,D=void 0!==c&&c,j=i.padding,I=void 0===j?0:j,z=TE("number"!=typeof I?I:yE(I,Rm)),d=u===Fm?"reference":Fm,h=e.rects.popper,T=e.elements[D?d:u],y=VE(Km(T)?T:T.contextElement||DE(e.elements.popper),a,N,r),A=lE(e.elements.reference),O=WE({reference:A,element:h,strategy:"absolute",placement:n}),p=YE(Object.assign({},h,O)),x=u===Fm?p:A,L={top:y.top-x.top+z.top,bottom:x.bottom-y.bottom+z.bottom,left:y.left-x.left+z.left,right:x.right-y.right+z.right},S=e.modifiersData.offset;if(u===Fm&&S){var m=S[n];Object.keys(L).forEach((function(e){var t=[Vm,Zm].indexOf(e)>=0?1:-1,i=[Ym,Zm].indexOf(e)>=0?"y":"x";L[e]+=m[i]*t}))}return L}function RE(e,t){void 0===t&&(t={});var i=t,M=i.placement,n=i.boundary,o=i.rootBoundary,r=i.padding,s=i.flipVariations,a=i.allowedAutoPlacements,l=void 0===a?Jm:a,N=OE(M),g=N?s?Hm:Hm.filter((function(e){return OE(e)===N})):Rm,u=g.filter((function(e){return l.indexOf(e)>=0}));0===u.length&&(u=g);var c=u.reduce((function(t,i){return t[i]=PE(e,{placement:i,boundary:n,rootBoundary:o,padding:r})[ME(i)],t}),{});return Object.keys(c).sort((function(e,t){return c[e]-c[t]}))}var BE={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,i=e.options,M=e.name;if(!t.modifiersData[M]._skip){for(var n=i.mainAxis,o=void 0===n||n,r=i.altAxis,s=void 0===r||r,a=i.fallbackPlacements,l=i.padding,N=i.boundary,g=i.rootBoundary,u=i.altBoundary,c=i.flipVariations,D=void 0===c||c,j=i.allowedAutoPlacements,I=t.options.placement,z=ME(I),d=a||(z===I||!D?[wE(I)]:function(e){if(ME(e)===Pm)return[];var t=wE(e);return[kE(e),t,kE(t)]}(I)),h=[I].concat(d).reduce((function(e,i){return e.concat(ME(i)===Pm?RE(t,{placement:i,boundary:N,rootBoundary:g,padding:l,flipVariations:D,allowedAutoPlacements:j}):i)}),[]),T=t.rects.reference,y=t.rects.popper,A=new Map,O=!0,p=h[0],x=0;x<h.length;x++){var L=h[x],S=ME(L),m=OE(L)===Bm,E=[Ym,Zm].indexOf(S)>=0,w=E?"width":"height",Q=PE(t,{placement:L,boundary:N,rootBoundary:g,altBoundary:u,padding:l}),k=E?m?Vm:Wm:m?Zm:Ym;T[w]>y[w]&&(k=wE(k));var C=wE(k),b=[];if(o&&b.push(Q[S]<=0),s&&b.push(Q[k]<=0,Q[C]<=0),b.every((function(e){return e}))){p=L,O=!1;break}A.set(L,b)}if(O)for(var f=function(e){var t=h.find((function(t){var i=A.get(t);if(i)return i.slice(0,e).every((function(e){return e}))}));if(t)return p=t,"break"},v=D?3:1;v>0;v--){if("break"===f(v))break}t.placement!==p&&(t.modifiersData[M]._skip=!0,t.placement=p,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function GE(e,t,i){return void 0===i&&(i={x:0,y:0}),{top:e.top-t.height-i.y,right:e.right-t.width+i.x,bottom:e.bottom-t.height+i.y,left:e.left-t.width-i.x}}function _E(e){return[Ym,Vm,Zm,Wm].some((function(t){return e[t]>=0}))}var FE={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,i=e.name,M=t.rects.reference,n=t.rects.popper,o=t.modifiersData.preventOverflow,r=PE(t,{elementContext:"reference"}),s=PE(t,{altBoundary:!0}),a=GE(r,M),l=GE(s,n,o),N=_E(a),g=_E(l);t.modifiersData[i]={referenceClippingOffsets:a,popperEscapeOffsets:l,isReferenceHidden:N,hasPopperEscaped:g},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":N,"data-popper-escaped":g})}};var HE={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,i=e.options,M=e.name,n=i.offset,o=void 0===n?[0,0]:n,r=Jm.reduce((function(e,i){return e[i]=function(e,t,i){var M=ME(e),n=[Wm,Ym].indexOf(M)>=0?-1:1,o="function"==typeof i?i(Object.assign({},t,{placement:e})):i,r=o[0],s=o[1];return r=r||0,s=(s||0)*n,[Wm,Vm].indexOf(M)>=0?{x:s,y:r}:{x:r,y:s}}(i,t.rects,o),e}),{}),s=r[t.placement],a=s.x,l=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=a,t.modifiersData.popperOffsets.y+=l),t.modifiersData[M]=r}};var JE={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,i=e.name;t.modifiersData[i]=WE({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}};var $E={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,i=e.options,M=e.name,n=i.mainAxis,o=void 0===n||n,r=i.altAxis,s=void 0!==r&&r,a=i.boundary,l=i.rootBoundary,N=i.altBoundary,g=i.padding,u=i.tether,c=void 0===u||u,D=i.tetherOffset,j=void 0===D?0:D,I=PE(t,{boundary:a,rootBoundary:l,padding:g,altBoundary:N}),z=ME(t.placement),d=OE(t.placement),h=!d,T=dE(z),y="x"===T?"y":"x",A=t.modifiersData.popperOffsets,O=t.rects.reference,p=t.rects.popper,x="function"==typeof j?j(Object.assign({},t.rects,{placement:t.placement})):j,L="number"==typeof x?{mainAxis:x,altAxis:x}:Object.assign({mainAxis:0,altAxis:0},x),S=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,m={x:0,y:0};if(A){if(o){var E,w="y"===T?Ym:Wm,Q="y"===T?Zm:Vm,k="y"===T?"height":"width",C=A[T],b=C+I[w],f=C-I[Q],v=c?-p[k]/2:0,U=d===Bm?O[k]:p[k],Y=d===Bm?-p[k]:-O[k],Z=t.elements.arrow,V=c&&Z?NE(Z):{width:0,height:0},W=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},P=W[w],R=W[Q],B=hE(0,O[k],V[k]),G=h?O[k]/2-v-B-P-L.mainAxis:U-B-P-L.mainAxis,_=h?-O[k]/2+v+B+R+L.mainAxis:Y+B+R+L.mainAxis,F=t.elements.arrow&&zE(t.elements.arrow),H=F?"y"===T?F.clientTop||0:F.clientLeft||0:0,J=null!=(E=null==S?void 0:S[T])?E:0,$=C+_-J,X=hE(c?oE(b,C+G-J-H):b,C,c?nE(f,$):f);A[T]=X,m[T]=X-C}if(s){var q,K="x"===T?Ym:Wm,ee="x"===T?Zm:Vm,te=A[y],ie="y"===y?"height":"width",Me=te+I[K],ne=te-I[ee],oe=-1!==[Ym,Wm].indexOf(z),re=null!=(q=null==S?void 0:S[y])?q:0,se=oe?Me:te-O[ie]-p[ie]-re+L.altAxis,ae=oe?te+O[ie]+p[ie]-re-L.altAxis:ne,le=c&&oe?function(e,t,i){var M=hE(e,t,i);return M>i?i:M}(se,te,ae):hE(c?se:Me,te,c?ae:ne);A[y]=le,m[y]=le-te}t.modifiersData[M]=m}},requiresIfExists:["offset"]};function XE(e,t,i){void 0===i&&(i=!1);var M,n,o=eE(t),r=eE(t)&&function(e){var t=e.getBoundingClientRect(),i=rE(t.width)/e.offsetWidth||1,M=rE(t.height)/e.offsetHeight||1;return 1!==i||1!==M}(t),s=DE(t),a=lE(e,r,i),l={scrollLeft:0,scrollTop:0},N={x:0,y:0};return(o||!o&&!i)&&(("body"!==Xm(t)||fE(s))&&(l=(M=t)!==qm(M)&&eE(M)?{scrollLeft:(n=M).scrollLeft,scrollTop:n.scrollTop}:CE(M)),eE(t)?((N=lE(t,!0)).x+=t.clientLeft,N.y+=t.clientTop):s&&(N.x=bE(s))),{x:a.left+l.scrollLeft-N.x,y:a.top+l.scrollTop-N.y,width:a.width,height:a.height}}function qE(e){var t=new Map,i=new Set,M=[];function n(e){i.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!i.has(e)){var M=t.get(e);M&&n(M)}})),M.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){i.has(e.name)||n(e)})),M}var KE={placement:"bottom",modifiers:[],strategy:"absolute"};function ew(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return!t.some((function(e){return!(e&&"function"==typeof e.getBoundingClientRect)}))}function tw(e){void 0===e&&(e={});var t=e,i=t.defaultModifiers,M=void 0===i?[]:i,n=t.defaultOptions,o=void 0===n?KE:n;return function(e,t,i){void 0===i&&(i=o);var n,r,s={placement:"bottom",orderedModifiers:[],options:Object.assign({},KE,o),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},a=[],l=!1,N={state:s,setOptions:function(i){var n="function"==typeof i?i(s.options):i;g(),s.options=Object.assign({},o,s.options,n),s.scrollParents={reference:Km(e)?UE(e):e.contextElement?UE(e.contextElement):[],popper:UE(t)};var r=function(e){var t=qE(e);return $m.reduce((function(e,i){return e.concat(t.filter((function(e){return e.phase===i})))}),[])}(function(e){var t=e.reduce((function(e,t){var i=e[t.name];return e[t.name]=i?Object.assign({},i,t,{options:Object.assign({},i.options,t.options),data:Object.assign({},i.data,t.data)}):t,e}),{});return Object.keys(t).map((function(e){return t[e]}))}([].concat(M,s.options.modifiers)));return s.orderedModifiers=r.filter((function(e){return e.enabled})),s.orderedModifiers.forEach((function(e){var t=e.name,i=e.options,M=void 0===i?{}:i,n=e.effect;if("function"==typeof n){var o=n({state:s,name:t,instance:N,options:M}),r=function(){};a.push(o||r)}})),N.update()},forceUpdate:function(){if(!l){var e=s.elements,t=e.reference,i=e.popper;if(ew(t,i)){s.rects={reference:XE(t,zE(i),"fixed"===s.options.strategy),popper:NE(i)},s.reset=!1,s.placement=s.options.placement,s.orderedModifiers.forEach((function(e){return s.modifiersData[e.name]=Object.assign({},e.data)}));for(var M=0;M<s.orderedModifiers.length;M++)if(!0!==s.reset){var n=s.orderedModifiers[M],o=n.fn,r=n.options,a=void 0===r?{}:r,g=n.name;"function"==typeof o&&(s=o({state:s,options:a,name:g,instance:N})||s)}else s.reset=!1,M=-1}}},update:(n=function(){return new Promise((function(e){N.forceUpdate(),e(s)}))},function(){return r||(r=new Promise((function(e){Promise.resolve().then((function(){r=void 0,e(n())}))}))),r}),destroy:function(){g(),l=!0}};if(!ew(e,t))return N;function g(){a.forEach((function(e){return e()})),a=[]}return N.setOptions(i).then((function(e){!l&&i.onFirstUpdate&&i.onFirstUpdate(e)})),N}}var iw=tw({defaultModifiers:[mE,JE,LE,iE,HE,BE,$E,AE,FE]}),Mw='<svg width="16" height="6" xmlns="http://www.w3.org/2000/svg"><path d="M0 6s1.796-.013 4.67-3.615C5.851.9 6.93.006 8 0c1.07-.006 2.148.887 3.343 2.385C14.233 6.005 16 6 16 6H0z"></svg>',nw="tippy-content",ow="tippy-arrow",rw="tippy-svg-arrow",sw={passive:!0,capture:!0},aw=function(){return document.body};function lw(e,t,i){if(Array.isArray(e)){var M=e[t];return null==M?Array.isArray(i)?i[t]:i:M}return e}function Nw(e,t){var i={}.toString.call(e);return 0===i.indexOf("[object")&&i.indexOf(t+"]")>-1}function gw(e,t){return"function"==typeof e?e.apply(void 0,t):e}function uw(e,t){return 0===t?e:function(M){clearTimeout(i),i=setTimeout((function(){e(M)}),t)};var i}function cw(e,t){var i=Object.assign({},e);return t.forEach((function(e){delete i[e]})),i}function Dw(e){return[].concat(e)}function jw(e,t){-1===e.indexOf(t)&&e.push(t)}function Iw(e){return[].slice.call(e)}function zw(e){return Object.keys(e).reduce((function(t,i){return void 0!==e[i]&&(t[i]=e[i]),t}),{})}function dw(){return document.createElement("div")}function hw(e){return["Element","Fragment"].some((function(t){return Nw(e,t)}))}function Tw(e){return Nw(e,"MouseEvent")}function yw(e){return hw(e)?[e]:function(e){return Nw(e,"NodeList")}(e)?Iw(e):Array.isArray(e)?e:Iw(document.querySelectorAll(e))}function Aw(e,t){e.forEach((function(e){e&&(e.style.transitionDuration=t+"ms")}))}function Ow(e,t){e.forEach((function(e){e&&e.setAttribute("data-state",t)}))}function pw(e){var t,i=Dw(e)[0];return null!=i&&null!=(t=i.ownerDocument)&&t.body?i.ownerDocument:document}function xw(e,t,i){var M=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(t){e[M](t,i)}))}function Lw(e,t){for(var i=t;i;){var M;if(e.contains(i))return!0;i=null==i.getRootNode||null==(M=i.getRootNode())?void 0:M.host}return!1}var Sw={isTouch:!1},mw=0;function Ew(){Sw.isTouch||(Sw.isTouch=!0,window.performance&&document.addEventListener("mousemove",ww))}function ww(){var e=performance.now();e-mw<20&&(Sw.isTouch=!1,document.removeEventListener("mousemove",ww)),mw=e}function Qw(){var e,t=document.activeElement;if((e=t)&&e._tippy&&e._tippy.reference===e){var i=t._tippy;t.blur&&!i.state.isVisible&&t.blur()}}var kw,Cw=!!("undefined"!=typeof window&&"undefined"!=typeof document)&&!!window.msCrypto;function bw(e){return[e+"() was called on a"+("destroy"===e?"n already-":" ")+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function fw(e){return e.replace(/[ \t]{2,}/g," ").replace(/^[ \t]*/gm,"").trim()}function vw(e){return fw("\n %ctippy.js\n\n %c"+fw(e)+"\n\n %c👷 This is a development-only message. It will be removed in production.\n ")}function Uw(e){return[vw(e),"color: #00C584; font-size: 1.3em; font-weight: bold;","line-height: 1.5","color: #a6a095;"]}function Yw(e,t){var i;e&&!kw.has(t)&&(kw.add(t),(i=console).warn.apply(i,Uw(t)))}function Zw(e,t){var i;e&&!kw.has(t)&&(kw.add(t),(i=console).error.apply(i,Uw(t)))}"production"!==process.env.NODE_ENV&&(kw=new Set);var Vw={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},Ww=Object.assign({appendTo:aw,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},Vw,{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),Pw=Object.keys(Ww);function Rw(e){var t=(e.plugins||[]).reduce((function(t,i){var M,n=i.name,o=i.defaultValue;n&&(t[n]=void 0!==e[n]?e[n]:null!=(M=Ww[n])?M:o);return t}),{});return Object.assign({},e,t)}function Bw(e,t){var i=Object.assign({},t,{content:gw(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys(Rw(Object.assign({},Ww,{plugins:t}))):Pw).reduce((function(t,i){var M=(e.getAttribute("data-tippy-"+i)||"").trim();if(!M)return t;if("content"===i)t[i]=M;else try{t[i]=JSON.parse(M)}catch(e){t[i]=M}return t}),{})}(e,t.plugins));return i.aria=Object.assign({},Ww.aria,i.aria),i.aria={expanded:"auto"===i.aria.expanded?t.interactive:i.aria.expanded,content:"auto"===i.aria.content?t.interactive?null:"describedby":i.aria.content},i}function Gw(e,t){void 0===e&&(e={}),void 0===t&&(t=[]),Object.keys(e).forEach((function(e){var i,M,n=cw(Ww,Object.keys(Vw)),o=(i=n,M=e,!{}.hasOwnProperty.call(i,M));o&&(o=0===t.filter((function(t){return t.name===e})).length),Yw(o,["`"+e+"`","is not a valid prop. You may have spelled it incorrectly, or if it's","a plugin, forgot to pass it in an array as props.plugins.","\n\n","All props: https://atomiks.github.io/tippyjs/v6/all-props/\n","Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))}))}function _w(e,t){e.innerHTML=t}function Fw(e){var t=dw();return!0===e?t.className=ow:(t.className=rw,hw(e)?t.appendChild(e):_w(t,e)),t}function Hw(e,t){hw(t.content)?(_w(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?_w(e,t.content):e.textContent=t.content)}function Jw(e){var t=e.firstElementChild,i=Iw(t.children);return{box:t,content:i.find((function(e){return e.classList.contains(nw)})),arrow:i.find((function(e){return e.classList.contains(ow)||e.classList.contains(rw)})),backdrop:i.find((function(e){return e.classList.contains("tippy-backdrop")}))}}function $w(e){var t=dw(),i=dw();i.className="tippy-box",i.setAttribute("data-state","hidden"),i.setAttribute("tabindex","-1");var M=dw();function n(i,M){var n=Jw(t),o=n.box,r=n.content,s=n.arrow;M.theme?o.setAttribute("data-theme",M.theme):o.removeAttribute("data-theme"),"string"==typeof M.animation?o.setAttribute("data-animation",M.animation):o.removeAttribute("data-animation"),M.inertia?o.setAttribute("data-inertia",""):o.removeAttribute("data-inertia"),o.style.maxWidth="number"==typeof M.maxWidth?M.maxWidth+"px":M.maxWidth,M.role?o.setAttribute("role",M.role):o.removeAttribute("role"),i.content===M.content&&i.allowHTML===M.allowHTML||Hw(r,e.props),M.arrow?s?i.arrow!==M.arrow&&(o.removeChild(s),o.appendChild(Fw(M.arrow))):o.appendChild(Fw(M.arrow)):s&&o.removeChild(s)}return M.className=nw,M.setAttribute("data-state","hidden"),Hw(M,e.props),t.appendChild(i),i.appendChild(M),n(e.props,e.props),{popper:t,onUpdate:n}}$w.$$tippy=!0;var Xw=1,qw=[],Kw=[];function eQ(e,t){var i,M,n,o,r,s,a,l,N=Bw(e,Object.assign({},Ww,Rw(zw(t)))),g=!1,u=!1,c=!1,D=!1,j=[],I=uw(F,N.interactiveDebounce),z=Xw++,d=(l=N.plugins).filter((function(e,t){return l.indexOf(e)===t})),h={id:z,reference:e,popper:dw(),popperInstance:null,props:N,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:d,clearDelayTimeouts:function(){clearTimeout(i),clearTimeout(M),cancelAnimationFrame(n)},setProps:function(t){"production"!==process.env.NODE_ENV&&Yw(h.state.isDestroyed,bw("setProps"));if(h.state.isDestroyed)return;C("onBeforeUpdate",[h,t]),G();var i=h.props,M=Bw(e,Object.assign({},i,zw(t),{ignoreAttributes:!0}));h.props=M,B(),i.interactiveDebounce!==M.interactiveDebounce&&(v(),I=uw(F,M.interactiveDebounce));i.triggerTarget&&!M.triggerTarget?Dw(i.triggerTarget).forEach((function(e){e.removeAttribute("aria-expanded")})):M.triggerTarget&&e.removeAttribute("aria-expanded");f(),k(),A&&A(i,M);h.popperInstance&&(X(),K().forEach((function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)})));C("onAfterUpdate",[h,t])},setContent:function(e){h.setProps({content:e})},show:function(){"production"!==process.env.NODE_ENV&&Yw(h.state.isDestroyed,bw("show"));var e=h.state.isVisible,t=h.state.isDestroyed,i=!h.state.isEnabled,M=Sw.isTouch&&!h.props.touch,n=lw(h.props.duration,0,Ww.duration);if(e||t||i||M)return;if(m().hasAttribute("disabled"))return;if(C("onShow",[h],!1),!1===h.props.onShow(h))return;h.state.isVisible=!0,S()&&(y.style.visibility="visible");k(),V(),h.state.isMounted||(y.style.transition="none");if(S()){var o=w();Aw([o.box,o.content],0)}s=function(){var e;if(h.state.isVisible&&!D){if(D=!0,y.offsetHeight,y.style.transition=h.props.moveTransition,S()&&h.props.animation){var t=w(),i=t.box,M=t.content;Aw([i,M],n),Ow([i,M],"visible")}b(),f(),jw(Kw,h),null==(e=h.popperInstance)||e.forceUpdate(),C("onMount",[h]),h.props.animation&&S()&&function(e,t){P(e,t)}(n,(function(){h.state.isShown=!0,C("onShown",[h])}))}},function(){var e,t=h.props.appendTo,i=m();e=h.props.interactive&&t===aw||"parent"===t?i.parentNode:gw(t,[i]);e.contains(y)||e.appendChild(y);h.state.isMounted=!0,X(),"production"!==process.env.NODE_ENV&&Yw(h.props.interactive&&t===Ww.appendTo&&i.nextElementSibling!==y,["Interactive tippy element may not be accessible via keyboard","navigation because it is not directly after the reference element","in the DOM source order.","\n\n","Using a wrapper <div> or <span> tag around the reference element","solves this by creating a new parentNode context.","\n\n","Specifying `appendTo: document.body` silences this warning, but it","assumes you are using a focus management solution to handle","keyboard navigation.","\n\n","See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}()},hide:function(){"production"!==process.env.NODE_ENV&&Yw(h.state.isDestroyed,bw("hide"));var e=!h.state.isVisible,t=h.state.isDestroyed,i=!h.state.isEnabled,M=lw(h.props.duration,1,Ww.duration);if(e||t||i)return;if(C("onHide",[h],!1),!1===h.props.onHide(h))return;h.state.isVisible=!1,h.state.isShown=!1,D=!1,g=!1,S()&&(y.style.visibility="hidden");if(v(),W(),k(!0),S()){var n=w(),o=n.box,r=n.content;h.props.animation&&(Aw([o,r],M),Ow([o,r],"hidden"))}b(),f(),h.props.animation?S()&&function(e,t){P(e,(function(){!h.state.isVisible&&y.parentNode&&y.parentNode.contains(y)&&t()}))}(M,h.unmount):h.unmount()},hideWithInteractivity:function(e){"production"!==process.env.NODE_ENV&&Yw(h.state.isDestroyed,bw("hideWithInteractivity"));E().addEventListener("mousemove",I),jw(qw,I),I(e)},enable:function(){h.state.isEnabled=!0},disable:function(){h.hide(),h.state.isEnabled=!1},unmount:function(){"production"!==process.env.NODE_ENV&&Yw(h.state.isDestroyed,bw("unmount"));h.state.isVisible&&h.hide();if(!h.state.isMounted)return;q(),K().forEach((function(e){e._tippy.unmount()})),y.parentNode&&y.parentNode.removeChild(y);Kw=Kw.filter((function(e){return e!==h})),h.state.isMounted=!1,C("onHidden",[h])},destroy:function(){"production"!==process.env.NODE_ENV&&Yw(h.state.isDestroyed,bw("destroy"));if(h.state.isDestroyed)return;h.clearDelayTimeouts(),h.unmount(),G(),delete e._tippy,h.state.isDestroyed=!0,C("onDestroy",[h])}};if(!N.render)return"production"!==process.env.NODE_ENV&&Zw(!0,"render() function has not been supplied."),h;var T=N.render(h),y=T.popper,A=T.onUpdate;y.setAttribute("data-tippy-root",""),y.id="tippy-"+h.id,h.popper=y,e._tippy=h,y._tippy=h;var O=d.map((function(e){return e.fn(h)})),p=e.hasAttribute("aria-expanded");return B(),f(),k(),C("onCreate",[h]),N.showOnCreate&&ee(),y.addEventListener("mouseenter",(function(){h.props.interactive&&h.state.isVisible&&h.clearDelayTimeouts()})),y.addEventListener("mouseleave",(function(){h.props.interactive&&h.props.trigger.indexOf("mouseenter")>=0&&E().addEventListener("mousemove",I)})),h;function x(){var e=h.props.touch;return Array.isArray(e)?e:[e,0]}function L(){return"hold"===x()[0]}function S(){var e;return!(null==(e=h.props.render)||!e.$$tippy)}function m(){return a||e}function E(){var e=m().parentNode;return e?pw(e):document}function w(){return Jw(y)}function Q(e){return h.state.isMounted&&!h.state.isVisible||Sw.isTouch||o&&"focus"===o.type?0:lw(h.props.delay,e?0:1,Ww.delay)}function k(e){void 0===e&&(e=!1),y.style.pointerEvents=h.props.interactive&&!e?"":"none",y.style.zIndex=""+h.props.zIndex}function C(e,t,i){var M;(void 0===i&&(i=!0),O.forEach((function(i){i[e]&&i[e].apply(i,t)})),i)&&(M=h.props)[e].apply(M,t)}function b(){var t=h.props.aria;if(t.content){var i="aria-"+t.content,M=y.id;Dw(h.props.triggerTarget||e).forEach((function(e){var t=e.getAttribute(i);if(h.state.isVisible)e.setAttribute(i,t?t+" "+M:M);else{var n=t&&t.replace(M,"").trim();n?e.setAttribute(i,n):e.removeAttribute(i)}}))}}function f(){!p&&h.props.aria.expanded&&Dw(h.props.triggerTarget||e).forEach((function(e){h.props.interactive?e.setAttribute("aria-expanded",h.state.isVisible&&e===m()?"true":"false"):e.removeAttribute("aria-expanded")}))}function v(){E().removeEventListener("mousemove",I),qw=qw.filter((function(e){return e!==I}))}function U(t){if(!Sw.isTouch||!c&&"mousedown"!==t.type){var i=t.composedPath&&t.composedPath()[0]||t.target;if(!h.props.interactive||!Lw(y,i)){if(Dw(h.props.triggerTarget||e).some((function(e){return Lw(e,i)}))){if(Sw.isTouch)return;if(h.state.isVisible&&h.props.trigger.indexOf("click")>=0)return}else C("onClickOutside",[h,t]);!0===h.props.hideOnClick&&(h.clearDelayTimeouts(),h.hide(),u=!0,setTimeout((function(){u=!1})),h.state.isMounted||W())}}}function Y(){c=!0}function Z(){c=!1}function V(){var e=E();e.addEventListener("mousedown",U,!0),e.addEventListener("touchend",U,sw),e.addEventListener("touchstart",Z,sw),e.addEventListener("touchmove",Y,sw)}function W(){var e=E();e.removeEventListener("mousedown",U,!0),e.removeEventListener("touchend",U,sw),e.removeEventListener("touchstart",Z,sw),e.removeEventListener("touchmove",Y,sw)}function P(e,t){var i=w().box;function M(e){e.target===i&&(xw(i,"remove",M),t())}if(0===e)return t();xw(i,"remove",r),xw(i,"add",M),r=M}function R(t,i,M){void 0===M&&(M=!1),Dw(h.props.triggerTarget||e).forEach((function(e){e.addEventListener(t,i,M),j.push({node:e,eventType:t,handler:i,options:M})}))}function B(){var e;L()&&(R("touchstart",_,{passive:!0}),R("touchend",H,{passive:!0})),(e=h.props.trigger,e.split(/\s+/).filter(Boolean)).forEach((function(e){if("manual"!==e)switch(R(e,_),e){case"mouseenter":R("mouseleave",H);break;case"focus":R(Cw?"focusout":"blur",J);break;case"focusin":R("focusout",J)}}))}function G(){j.forEach((function(e){var t=e.node,i=e.eventType,M=e.handler,n=e.options;t.removeEventListener(i,M,n)})),j=[]}function _(e){var t,i=!1;if(h.state.isEnabled&&!$(e)&&!u){var M="focus"===(null==(t=o)?void 0:t.type);o=e,a=e.currentTarget,f(),!h.state.isVisible&&Tw(e)&&qw.forEach((function(t){return t(e)})),"click"===e.type&&(h.props.trigger.indexOf("mouseenter")<0||g)&&!1!==h.props.hideOnClick&&h.state.isVisible?i=!0:ee(e),"click"===e.type&&(g=!i),i&&!M&&te(e)}}function F(e){var t=e.target,i=m().contains(t)||y.contains(t);if("mousemove"!==e.type||!i){var M=K().concat(y).map((function(e){var t,i=null==(t=e._tippy.popperInstance)?void 0:t.state;return i?{popperRect:e.getBoundingClientRect(),popperState:i,props:N}:null})).filter(Boolean);(function(e,t){var i=t.clientX,M=t.clientY;return e.every((function(e){var t=e.popperRect,n=e.popperState,o=e.props.interactiveBorder,r=n.placement.split("-")[0],s=n.modifiersData.offset;if(!s)return!0;var a="bottom"===r?s.top.y:0,l="top"===r?s.bottom.y:0,N="right"===r?s.left.x:0,g="left"===r?s.right.x:0,u=t.top-M+a>o,c=M-t.bottom-l>o,D=t.left-i+N>o,j=i-t.right-g>o;return u||c||D||j}))})(M,e)&&(v(),te(e))}}function H(e){$(e)||h.props.trigger.indexOf("click")>=0&&g||(h.props.interactive?h.hideWithInteractivity(e):te(e))}function J(e){h.props.trigger.indexOf("focusin")<0&&e.target!==m()||h.props.interactive&&e.relatedTarget&&y.contains(e.relatedTarget)||te(e)}function $(e){return!!Sw.isTouch&&L()!==e.type.indexOf("touch")>=0}function X(){q();var t=h.props,i=t.popperOptions,M=t.placement,n=t.offset,o=t.getReferenceClientRect,r=t.moveTransition,a=S()?Jw(y).arrow:null,l=o?{getBoundingClientRect:o,contextElement:o.contextElement||m()}:e,N={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if(S()){var i=w().box;["placement","reference-hidden","escaped"].forEach((function(e){"placement"===e?i.setAttribute("data-placement",t.placement):t.attributes.popper["data-popper-"+e]?i.setAttribute("data-"+e,""):i.removeAttribute("data-"+e)})),t.attributes.popper={}}}},g=[{name:"offset",options:{offset:n}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!r}},N];S()&&a&&g.push({name:"arrow",options:{element:a,padding:3}}),g.push.apply(g,(null==i?void 0:i.modifiers)||[]),h.popperInstance=iw(l,y,Object.assign({},i,{placement:M,onFirstUpdate:s,modifiers:g}))}function q(){h.popperInstance&&(h.popperInstance.destroy(),h.popperInstance=null)}function K(){return Iw(y.querySelectorAll("[data-tippy-root]"))}function ee(e){h.clearDelayTimeouts(),e&&C("onTrigger",[h,e]),V();var t=Q(!0),M=x(),n=M[0],o=M[1];Sw.isTouch&&"hold"===n&&o&&(t=o),t?i=setTimeout((function(){h.show()}),t):h.show()}function te(e){if(h.clearDelayTimeouts(),C("onUntrigger",[h,e]),h.state.isVisible){if(!(h.props.trigger.indexOf("mouseenter")>=0&&h.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&g)){var t=Q(!1);t?M=setTimeout((function(){h.state.isVisible&&h.hide()}),t):n=requestAnimationFrame((function(){h.hide()}))}}else W()}}function tQ(e,t){void 0===t&&(t={});var i=Ww.plugins.concat(t.plugins||[]);"production"!==process.env.NODE_ENV&&(!function(e){var t=!e,i="[object Object]"===Object.prototype.toString.call(e)&&!e.addEventListener;Zw(t,["tippy() was passed","`"+String(e)+"`","as its targets (first) argument. Valid types are: String, Element,","Element[], or NodeList."].join(" ")),Zw(i,["tippy() was passed a plain object which is not supported as an argument","for virtual positioning. Use props.getReferenceClientRect instead."].join(" "))}(e),Gw(t,i)),document.addEventListener("touchstart",Ew,sw),window.addEventListener("blur",Qw);var M=Object.assign({},t,{plugins:i}),n=yw(e);if("production"!==process.env.NODE_ENV){var o=hw(M.content),r=n.length>1;Yw(o&&r,["tippy() was passed an Element as the `content` prop, but more than","one tippy instance was created by this invocation. This means the","content element will only be appended to the last tippy instance.","\n\n","Instead, pass the .innerHTML of the element, or use a function that","returns a cloned version of the element instead.","\n\n","1) content: element.innerHTML\n","2) content: () => element.cloneNode(true)"].join(" "))}var s=n.reduce((function(e,t){var i=t&&eQ(t,M);return i&&e.push(i),e}),[]);return hw(e)?s[0]:s}tQ.defaultProps=Ww,tQ.setDefaultProps=function(e){"production"!==process.env.NODE_ENV&&Gw(e,[]),Object.keys(e).forEach((function(t){Ww[t]=e[t]}))},tQ.currentInput=Sw;var iQ=Object.assign({},iE,{effect:function(e){var t=e.state,i={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,i.popper),t.styles=i,t.elements.arrow&&Object.assign(t.elements.arrow.style,i.arrow)}}),MQ=function(e,t){var i;void 0===t&&(t={}),"production"!==process.env.NODE_ENV&&Zw(!Array.isArray(e),["The first argument passed to createSingleton() must be an array of","tippy instances. The passed value was",String(e)].join(" "));var M,n=e,o=[],r=[],s=t.overrides,a=[],l=!1;function N(){r=n.map((function(e){return Dw(e.props.triggerTarget||e.reference)})).reduce((function(e,t){return e.concat(t)}),[])}function g(){o=n.map((function(e){return e.reference}))}function u(e){n.forEach((function(t){e?t.enable():t.disable()}))}function c(e){return n.map((function(t){var i=t.setProps;return t.setProps=function(n){i(n),t.reference===M&&e.setProps(n)},function(){t.setProps=i}}))}function D(e,t){var i=r.indexOf(t);if(t!==M){M=t;var a=(s||[]).concat("content").reduce((function(e,t){return e[t]=n[i].props[t],e}),{});e.setProps(Object.assign({},a,{getReferenceClientRect:"function"==typeof a.getReferenceClientRect?a.getReferenceClientRect:function(){var e;return null==(e=o[i])?void 0:e.getBoundingClientRect()}}))}}u(!1),g(),N();var j={fn:function(){return{onDestroy:function(){u(!0)},onHidden:function(){M=null},onClickOutside:function(e){e.props.showOnCreate&&!l&&(l=!0,M=null)},onShow:function(e){e.props.showOnCreate&&!l&&(l=!0,D(e,o[0]))},onTrigger:function(e,t){D(e,t.currentTarget)}}}},I=tQ(dw(),Object.assign({},cw(t,["overrides"]),{plugins:[j].concat(t.plugins||[]),triggerTarget:r,popperOptions:Object.assign({},t.popperOptions,{modifiers:[].concat((null==(i=t.popperOptions)?void 0:i.modifiers)||[],[iQ])})})),z=I.show;I.show=function(e){if(z(),!M&&null==e)return D(I,o[0]);if(!M||null!=e){if("number"==typeof e)return o[e]&&D(I,o[e]);if(n.indexOf(e)>=0){var t=e.reference;return D(I,t)}return o.indexOf(e)>=0?D(I,e):void 0}},I.showNext=function(){var e=o[0];if(!M)return I.show(0);var t=o.indexOf(M);I.show(o[t+1]||e)},I.showPrevious=function(){var e=o[o.length-1];if(!M)return I.show(e);var t=o.indexOf(M),i=o[t-1]||e;I.show(i)};var d=I.setProps;return I.setProps=function(e){s=e.overrides||s,d(e)},I.setInstances=function(e){u(!0),a.forEach((function(e){return e()})),n=e,u(!1),g(),N(),a=c(I),I.setProps({triggerTarget:r})},a=c(I),I},nQ={clientX:0,clientY:0},oQ=[];function rQ(e){var t=e.clientX,i=e.clientY;nQ={clientX:t,clientY:i}}var sQ={name:"followCursor",defaultValue:!1,fn:function(e){var t=e.reference,i=pw(e.props.triggerTarget||t),M=!1,n=!1,o=!0,r=e.props;function s(){return"initial"===e.props.followCursor&&e.state.isVisible}function a(){i.addEventListener("mousemove",g)}function l(){i.removeEventListener("mousemove",g)}function N(){M=!0,e.setProps({getReferenceClientRect:null}),M=!1}function g(i){var M=!i.target||t.contains(i.target),n=e.props.followCursor,o=i.clientX,r=i.clientY,s=t.getBoundingClientRect(),a=o-s.left,l=r-s.top;!M&&e.props.interactive||e.setProps({getReferenceClientRect:function(){var e=t.getBoundingClientRect(),i=o,M=r;"initial"===n&&(i=e.left+a,M=e.top+l);var s="horizontal"===n?e.top:M,N="vertical"===n?e.right:i,g="horizontal"===n?e.bottom:M,u="vertical"===n?e.left:i;return{width:N-u,height:g-s,top:s,right:N,bottom:g,left:u}}})}function u(){e.props.followCursor&&(oQ.push({instance:e,doc:i}),function(e){e.addEventListener("mousemove",rQ)}(i))}function c(){0===(oQ=oQ.filter((function(t){return t.instance!==e}))).filter((function(e){return e.doc===i})).length&&function(e){e.removeEventListener("mousemove",rQ)}(i)}return{onCreate:u,onDestroy:c,onBeforeUpdate:function(){r=e.props},onAfterUpdate:function(t,i){var o=i.followCursor;M||void 0!==o&&r.followCursor!==o&&(c(),o?(u(),!e.state.isMounted||n||s()||a()):(l(),N()))},onMount:function(){e.props.followCursor&&!n&&(o&&(g(nQ),o=!1),s()||a())},onTrigger:function(e,t){Tw(t)&&(nQ={clientX:t.clientX,clientY:t.clientY}),n="focus"===t.type},onHidden:function(){e.props.followCursor&&(N(),l(),o=!0)}}}};function aQ(e){return!0===e||"true"===e||!1!==e&&"false"!==e&&(!!["initial","horizontal","vertical"].includes(String(e))&&e)}function lQ(e){if(Array.isArray(e))return e;if("number"==typeof e)return e;if("string"==typeof e){if(e.includes(",")){const t=e.split(",").map((e=>parseInt(e.trim(),10)));return t}const t=parseInt(e,10);if(!isNaN(t))return t}return 200}tQ.setDefaultProps({render:$w});let NQ=class extends Re{static get styles(){return[Um]}createRenderRoot(){return this}constructor(){super(),this.for=null,this.content="",this.size="small",this.duration=200,this.interactive=!1,this.placement="top",this.disabled=!1,this.distance=8,this.skidding=0,this.open=!1,this.trigger="mouseenter focus",this.allowHTML=!1,this.followCursor=!1,this.arrow="default",this.singleton=!1,this.enableRecursiveMode=!1,this.delay=0,this.maxWidth="auto",this.zIndex=9999,this.hideOnClick=!0,this.inertia=!1,this.interactiveBorder=2,this.enableVisibilityEffect=!1,this.enableTabClose=!1}firstUpdated(){this.attachTooltip();const e=this.for&&document.getElementById(this.for)||this.firstElementChild;this.visibilityManager=new tM({host:this,target:e,enableVisibilityEffect:this.enableVisibilityEffect,enableTabClose:this.enableTabClose,isOpen:()=>this.open,onAnchorOutOfView:()=>{this.open=!1,this.hideAllTooltips(),this.emit("nile-visibility-change",{visible:!1,reason:"anchor-out-of-view"})},onDocumentHidden:()=>{this.open=!1,this.hideAllTooltips(),this.emit("nile-visibility-change",{visible:!1,reason:"document-hidden"})},emit:(e,t)=>this.emit(`nile-${e}`,t)})}refresh(){this.attachTooltip()}hasValidContent(){const e=this.content??this.getAttribute("data-tippy-content")??"";return"string"==typeof e&&e.trim().length>0}attachTooltip(){if(this.destroyTooltips(),this.disabled||!this.enableRecursiveMode&&!this.singleton&&!this.hasValidContent())return;const e={content:this.content||this.getAttribute("data-tippy-content")||void 0,placement:this.placement,trigger:this.trigger,offset:[this.skidding,this.distance],theme:"lite",animation:"fade",interactive:this.interactive,arrow:Mw,duration:lQ(this.duration),allowHTML:this.allowHTML,delay:this.delay,maxWidth:this.maxWidth,zIndex:this.zIndex,hideOnClick:!1,inertia:this.inertia,interactiveBorder:this.interactiveBorder,appendTo:document.body,followCursor:aQ(this.followCursor),plugins:aQ(this.followCursor)?[sQ]:[],onShow:e=>{this.open=!0;const t=e.popper.querySelector(".tippy-content");t&&(this.width&&(t.style.width=this.width),this.height&&(t.style.height=this.height,t.style.overflow="auto")),this.dispatchEvent(new CustomEvent("nile-show",{detail:{instance:e,target:e.reference}})),this.dispatchEvent(new CustomEvent("nile-toggle",{detail:{open:!0,instance:e,target:e.reference}}))},onHide:e=>{this.open=!1,this.dispatchEvent(new CustomEvent("nile-hide",{detail:{instance:e,target:e.reference}})),this.dispatchEvent(new CustomEvent("nile-toggle",{detail:{open:!1,instance:e,target:e.reference}}))}};if(this.for){if(this.singleton&&!this.for.startsWith("#")&&!document.getElementById(this.for)){const t=Array.from(document.querySelectorAll(`.${this.for}`));if(t.length>0)return this.tooltipInstances=t.map((t=>{const i=tQ(t,{...e,content:t.getAttribute("content")||this.content});return i.popper.querySelector(".tippy-box")?.classList.add(this.size),i})),this.singletonInstance=MQ(this.tooltipInstances,{delay:[75,0],arrow:Mw,moveTransition:"transform 0.15s ease-out"}),void(this.open&&queueMicrotask((()=>this.singletonInstance?.show())))}const t=document.getElementById(this.for);if(this.singleton&&t){const i=Array.from(t.querySelectorAll("[content]"));if(i.length>0)return this.tooltipInstances=i.map((t=>{const i=tQ(t,{...e,content:t.getAttribute("content")||this.content});return i.popper.querySelector(".tippy-box")?.classList.add(this.size),i})),this.singletonInstance=MQ(this.tooltipInstances,{delay:[75,0],arrow:Mw,moveTransition:"transform 0.15s ease-out"}),void(this.open&&queueMicrotask((()=>this.singletonInstance?.show())))}if(this.targetEl=document.getElementById(this.for),!this.targetEl)return;this.id||(this.generatedId=`nile-tooltip-${Math.random().toString(36).slice(2,9)}`,this.id=this.generatedId),this.prevDescribedby=this.targetEl.getAttribute("aria-describedby");const i=this.prevDescribedby?`${this.prevDescribedby} ${this.id}`:this.id;return this.targetEl.setAttribute("aria-describedby",i),this.singleInstance=tQ(this.targetEl,e),this.size&&this.singleInstance.popper.querySelector(".tippy-box")?.classList.add(this.size),void(this.open&&queueMicrotask((()=>this.singleInstance?.show())))}if(this.enableRecursiveMode){const t=Array.from(this.querySelectorAll("[content]")).filter((e=>{const t=e.getAttribute("content");return null!==t&&t.trim().length>0}));t.length>0&&(this.tooltipInstances=t.map((t=>{const i=t,M=i.getAttribute("content")||this.content,n=tQ(i,{...e,content:M});return n.popper.querySelector(".tippy-box")?.classList.add(this.size),n})),this.singleton&&this.tooltipInstances.length>1&&(this.singletonInstance=MQ(this.tooltipInstances,{delay:[75,0],arrow:Mw,moveTransition:"transform 0.15s ease-out"})),this.open&&(this.singletonInstance?this.singletonInstance.show():this.tooltipInstances.forEach((e=>e.show()))))}else{const t=this.firstElementChild;if(t){const i=t.getAttribute("content")||this.content,M=tQ(t,{...e,content:i});M.popper.querySelector(".tippy-box")?.classList.add(this.size),this.tooltipInstances=[M],this.open&&M.show()}}}destroyTooltips(){if(this.tooltipInstances?.forEach((e=>e.destroy())),this.singleInstance?.destroy(),this.singletonInstance?.destroy(),this.tooltipInstances=void 0,this.singleInstance=void 0,this.singletonInstance=void 0,this.targetEl&&this.id){const e=this.targetEl.getAttribute("aria-describedby")?.split(" ").filter((e=>e!==this.id)).join(" ").trim();e?this.targetEl.setAttribute("aria-describedby",e):this.targetEl.removeAttribute("aria-describedby")}}hideAllTooltips(){this.singleInstance?.hide(),this.singletonInstance?.hide(),this.tooltipInstances?.forEach((e=>e.hide()))}disconnectedCallback(){super.disconnectedCallback(),this.visibilityManager?.cleanup(),this.destroyTooltips()}updated(e){super.updated(e),["for","content","placement","distance","skidding","trigger","disabled","hoist","size","arrow","singleton"].some((t=>e.has(t)))&&this.attachTooltip(),e.has("open")&&(this.open?(this.visibilityManager?.setup(),this.singleInstance?.show(),this.singletonInstance?.show(),this.tooltipInstances?.forEach((e=>e.show()))):(this.visibilityManager?.cleanup(),this.singleInstance?.hide(),this.singletonInstance?.hide(),this.tooltipInstances?.forEach((e=>e.hide()))))}};e([ce({type:String,attribute:"for"})],NQ.prototype,"for",void 0),e([ce({type:String,reflect:!0})],NQ.prototype,"content",void 0),e([ce({type:String,reflect:!0})],NQ.prototype,"size",void 0),e([ce({type:String,reflect:!0})],NQ.prototype,"duration",void 0),e([ce({type:Boolean,reflect:!0})],NQ.prototype,"interactive",void 0),e([ce({type:String})],NQ.prototype,"placement",void 0),e([ce({type:Boolean})],NQ.prototype,"disabled",void 0),e([ce({type:Number})],NQ.prototype,"distance",void 0),e([ce({type:Number})],NQ.prototype,"skidding",void 0),e([ce({type:Boolean,reflect:!0})],NQ.prototype,"open",void 0),e([ce({type:String})],NQ.prototype,"trigger",void 0),e([ce({type:Boolean,reflect:!0})],NQ.prototype,"allowHTML",void 0),e([ce({type:String,reflect:!0,attribute:!0})],NQ.prototype,"followCursor",void 0),e([ce({type:String,reflect:!0,attribute:!0})],NQ.prototype,"arrow",void 0),e([ce({type:Boolean,reflect:!0})],NQ.prototype,"singleton",void 0),e([ce({type:Boolean,reflect:!0})],NQ.prototype,"enableRecursiveMode",void 0),e([ce({type:String,reflect:!0})],NQ.prototype,"delay",void 0),e([ce({type:String,reflect:!0})],NQ.prototype,"maxWidth",void 0),e([ce({type:Number})],NQ.prototype,"zIndex",void 0),e([ce({type:[Boolean,String],reflect:!0})],NQ.prototype,"hideOnClick",void 0),e([ce({type:Boolean,reflect:!0})],NQ.prototype,"inertia",void 0),e([ce({type:Number})],NQ.prototype,"interactiveBorder",void 0),e([ce({type:Boolean,reflect:!0})],NQ.prototype,"enableVisibilityEffect",void 0),e([ce({type:Boolean,reflect:!0})],NQ.prototype,"enableTabClose",void 0),e([ce({type:String,reflect:!0})],NQ.prototype,"width",void 0),e([ce({type:String,reflect:!0})],NQ.prototype,"height",void 0),NQ=e([Ne("nile-lite-tooltip")],NQ);const gQ=r`
|
|
16540
16584
|
:host {
|
|
16541
16585
|
width: 100%;
|
|
16542
16586
|
height: 100%;
|
|
16543
16587
|
overflow-y: auto;
|
|
16544
16588
|
}
|
|
16545
16589
|
|
|
16546
|
-
`;let
|
|
16590
|
+
`;let uQ=class extends Re{static get styles(){return[gQ]}render(){return R`
|
|
16547
16591
|
<slot> </slot>
|
|
16548
|
-
`}};
|
|
16592
|
+
`}};uQ=e([Ne("nile-side-bar-panel")],uQ);
|
|
16549
16593
|
/**
|
|
16550
16594
|
* @license
|
|
16551
16595
|
* Copyright 2021 Google LLC
|
|
16552
16596
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
16553
16597
|
*/
|
|
16554
|
-
class
|
|
16598
|
+
class cQ{constructor(e){this._map=new Map,this._roundAverageSize=!1,this.totalSize=0,!0===e?.roundAverageSize&&(this._roundAverageSize=!0)}set(e,t){const i=this._map.get(e)||0;this._map.set(e,t),this.totalSize+=t-i}get averageSize(){if(this._map.size>0){const e=this.totalSize/this._map.size;return this._roundAverageSize?Math.round(e):e}return 0}getSize(e){return this._map.get(e)}clear(){this._map.clear(),this.totalSize=0}}
|
|
16555
16599
|
/**
|
|
16556
16600
|
* @license
|
|
16557
16601
|
* Copyright 2021 Google LLC
|
|
16558
16602
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
16559
|
-
*/function
|
|
16603
|
+
*/function DQ(e){return"horizontal"===e?"width":"height"}class jQ{_getDefaultConfig(){return{direction:"vertical"}}constructor(e,t){this._latestCoords={left:0,top:0},this._direction=null,this._viewportSize={width:0,height:0},this.totalScrollSize={width:0,height:0},this.offsetWithinScroller={left:0,top:0},this._pendingReflow=!1,this._pendingLayoutUpdate=!1,this._pin=null,this._firstVisible=0,this._lastVisible=0,this._physicalMin=0,this._physicalMax=0,this._first=-1,this._last=-1,this._sizeDim="height",this._secondarySizeDim="width",this._positionDim="top",this._secondaryPositionDim="left",this._scrollPosition=0,this._scrollError=0,this._items=[],this._scrollSize=1,this._overhang=1e3,this._hostSink=e,Promise.resolve().then((()=>this.config=t||this._getDefaultConfig()))}set config(e){Object.assign(this,Object.assign({},this._getDefaultConfig(),e))}get config(){return{direction:this.direction}}get items(){return this._items}set items(e){this._setItems(e)}_setItems(e){e!==this._items&&(this._items=e,this._scheduleReflow())}get direction(){return this._direction}set direction(e){(e="horizontal"===e?e:"vertical")!==this._direction&&(this._direction=e,this._sizeDim="horizontal"===e?"width":"height",this._secondarySizeDim="horizontal"===e?"height":"width",this._positionDim="horizontal"===e?"left":"top",this._secondaryPositionDim="horizontal"===e?"top":"left",this._triggerReflow())}get viewportSize(){return this._viewportSize}set viewportSize(e){const{_viewDim1:t,_viewDim2:i}=this;Object.assign(this._viewportSize,e),i!==this._viewDim2?this._scheduleLayoutUpdate():t!==this._viewDim1&&this._checkThresholds()}get viewportScroll(){return this._latestCoords}set viewportScroll(e){Object.assign(this._latestCoords,e);const t=this._scrollPosition;this._scrollPosition=this._latestCoords[this._positionDim];Math.abs(t-this._scrollPosition)>=1&&this._checkThresholds()}reflowIfNeeded(e=!1){(e||this._pendingReflow)&&(this._pendingReflow=!1,this._reflow())}set pin(e){this._pin=e,this._triggerReflow()}get pin(){if(null!==this._pin){const{index:e,block:t}=this._pin;return{index:Math.max(0,Math.min(e,this.items.length-1)),block:t}}return null}_clampScrollPosition(e){return Math.max(-this.offsetWithinScroller[this._positionDim],Math.min(e,this.totalScrollSize[DQ(this.direction)]-this._viewDim1))}unpin(){null!==this._pin&&(this._sendUnpinnedMessage(),this._pin=null)}_updateLayout(){}get _viewDim1(){return this._viewportSize[this._sizeDim]}get _viewDim2(){return this._viewportSize[this._secondarySizeDim]}_scheduleReflow(){this._pendingReflow=!0}_scheduleLayoutUpdate(){this._pendingLayoutUpdate=!0,this._scheduleReflow()}_triggerReflow(){this._scheduleLayoutUpdate(),Promise.resolve().then((()=>this.reflowIfNeeded()))}_reflow(){this._pendingLayoutUpdate&&(this._updateLayout(),this._pendingLayoutUpdate=!1),this._updateScrollSize(),this._setPositionFromPin(),this._getActiveItems(),this._updateVisibleIndices(),this._sendStateChangedMessage()}_setPositionFromPin(){if(null!==this.pin){const e=this._scrollPosition,{index:t,block:i}=this.pin;this._scrollPosition=this._calculateScrollIntoViewPosition({index:t,block:i||"start"})-this.offsetWithinScroller[this._positionDim],this._scrollError=e-this._scrollPosition}}_calculateScrollIntoViewPosition(e){const{block:t}=e,i=Math.min(this.items.length,Math.max(0,e.index)),M=this._getItemPosition(i)[this._positionDim];let n=M;if("start"!==t){const e=this._getItemSize(i)[this._sizeDim];if("center"===t)n=M-.5*this._viewDim1+.5*e;else{const i=M-this._viewDim1+e;if("end"===t)n=i;else{const e=this._scrollPosition;n=Math.abs(e-M)<Math.abs(e-i)?M:i}}}return n+=this.offsetWithinScroller[this._positionDim],this._clampScrollPosition(n)}getScrollIntoViewCoordinates(e){return{[this._positionDim]:this._calculateScrollIntoViewPosition(e)}}_sendUnpinnedMessage(){this._hostSink({type:"unpinned"})}_sendVisibilityChangedMessage(){this._hostSink({type:"visibilityChanged",firstVisible:this._firstVisible,lastVisible:this._lastVisible})}_sendStateChangedMessage(){const e=new Map;if(-1!==this._first&&-1!==this._last)for(let t=this._first;t<=this._last;t++)e.set(t,this._getItemPosition(t));const t={type:"stateChanged",scrollSize:{[this._sizeDim]:this._scrollSize,[this._secondarySizeDim]:null},range:{first:this._first,last:this._last,firstVisible:this._firstVisible,lastVisible:this._lastVisible},childPositions:e};this._scrollError&&(t.scrollError={[this._positionDim]:this._scrollError,[this._secondaryPositionDim]:0},this._scrollError=0),this._hostSink(t)}get _num(){return-1===this._first||-1===this._last?0:this._last-this._first+1}_checkThresholds(){if(0===this._viewDim1&&this._num>0||null!==this._pin)this._scheduleReflow();else{const e=Math.max(0,this._scrollPosition-this._overhang),t=Math.min(this._scrollSize,this._scrollPosition+this._viewDim1+this._overhang);this._physicalMin>e||this._physicalMax<t?this._scheduleReflow():this._updateVisibleIndices({emit:!0})}}_updateVisibleIndices(e){if(-1===this._first||-1===this._last)return;let t=this._first;for(;t<this._last&&Math.round(this._getItemPosition(t)[this._positionDim]+this._getItemSize(t)[this._sizeDim])<=Math.round(this._scrollPosition);)t++;let i=this._last;for(;i>this._first&&Math.round(this._getItemPosition(i)[this._positionDim])>=Math.round(this._scrollPosition+this._viewDim1);)i--;t===this._firstVisible&&i===this._lastVisible||(this._firstVisible=t,this._lastVisible=i,e&&e.emit&&this._sendVisibilityChangedMessage())}}
|
|
16560
16604
|
/**
|
|
16561
16605
|
* @license
|
|
16562
16606
|
* Copyright 2021 Google LLC
|
|
16563
16607
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
16564
|
-
*/function
|
|
16608
|
+
*/function IQ(e){return"horizontal"===e?"marginLeft":"marginTop"}function zQ(e){return"horizontal"===e?"marginRight":"marginBottom"}function dQ(e){return"horizontal"===e?"xOffset":"yOffset"}function hQ(e,t){const i=[e,t].sort();return i[1]<=0?Math.min(...i):i[0]>=0?Math.max(...i):i[0]+i[1]}class TQ{constructor(){this._childSizeCache=new cQ,this._marginSizeCache=new cQ,this._metricsCache=new Map}update(e,t){const i=new Set;Object.keys(e).forEach((M=>{const n=Number(M);this._metricsCache.set(n,e[n]),this._childSizeCache.set(n,e[n][DQ(t)]),i.add(n),i.add(n+1)}));for(const e of i){const i=this._metricsCache.get(e)?.[IQ(t)]||0,M=this._metricsCache.get(e-1)?.[zQ(t)]||0;this._marginSizeCache.set(e,hQ(i,M))}}get averageChildSize(){return this._childSizeCache.averageSize}get totalChildSize(){return this._childSizeCache.totalSize}get averageMarginSize(){return this._marginSizeCache.averageSize}get totalMarginSize(){return this._marginSizeCache.totalSize}getLeadingMarginValue(e,t){return this._metricsCache.get(e)?.[IQ(t)]||0}getChildSize(e){return this._childSizeCache.getSize(e)}getMarginSize(e){return this._marginSizeCache.getSize(e)}clear(){this._childSizeCache.clear(),this._marginSizeCache.clear(),this._metricsCache.clear()}}var yQ=Object.freeze({__proto__:null,FlowLayout:class extends jQ{constructor(){super(...arguments),this._itemSize={width:100,height:100},this._physicalItems=new Map,this._newPhysicalItems=new Map,this._metricsCache=new TQ,this._anchorIdx=null,this._anchorPos=null,this._stable=!0,this._measureChildren=!0,this._estimate=!0}get measureChildren(){return this._measureChildren}updateItemSizes(e){this._metricsCache.update(e,this.direction),this._scheduleReflow()}_getPhysicalItem(e){return this._newPhysicalItems.get(e)??this._physicalItems.get(e)}_getSize(e){return this._getPhysicalItem(e)&&this._metricsCache.getChildSize(e)}_getAverageSize(){return this._metricsCache.averageChildSize||this._itemSize[this._sizeDim]}_estimatePosition(e){const t=this._metricsCache;if(-1===this._first||-1===this._last)return t.averageMarginSize+e*(t.averageMarginSize+this._getAverageSize());if(e<this._first){const i=this._first-e;return this._getPhysicalItem(this._first).pos-(t.getMarginSize(this._first-1)||t.averageMarginSize)-(i*t.averageChildSize+(i-1)*t.averageMarginSize)}{const i=e-this._last;return this._getPhysicalItem(this._last).pos+(t.getChildSize(this._last)||t.averageChildSize)+(t.getMarginSize(this._last)||t.averageMarginSize)+i*(t.averageChildSize+t.averageMarginSize)}}_getPosition(e){const t=this._getPhysicalItem(e),{averageMarginSize:i}=this._metricsCache;return 0===e?this._metricsCache.getMarginSize(0)??i:t?t.pos:this._estimatePosition(e)}_calculateAnchor(e,t){return e<=0?0:t>this._scrollSize-this._viewDim1?this.items.length-1:Math.max(0,Math.min(this.items.length-1,Math.floor((e+t)/2/this._delta)))}_getAnchor(e,t){if(0===this._physicalItems.size)return this._calculateAnchor(e,t);if(this._first<0)return this._calculateAnchor(e,t);if(this._last<0)return this._calculateAnchor(e,t);const i=this._getPhysicalItem(this._first),M=this._getPhysicalItem(this._last),n=i.pos;if(M.pos+this._metricsCache.getChildSize(this._last)<e)return this._calculateAnchor(e,t);if(n>t)return this._calculateAnchor(e,t);let o=this._firstVisible-1,r=-1/0;for(;r<e;){r=this._getPhysicalItem(++o).pos+this._metricsCache.getChildSize(o)}return o}_getActiveItems(){0===this._viewDim1||0===this.items.length?this._clearItems():this._getItems()}_clearItems(){this._first=-1,this._last=-1,this._physicalMin=0,this._physicalMax=0;const e=this._newPhysicalItems;this._newPhysicalItems=this._physicalItems,this._newPhysicalItems.clear(),this._physicalItems=e,this._stable=!0}_getItems(){const e=this._newPhysicalItems;let t,i;if(this._stable=!0,null!==this.pin){const{index:e}=this.pin;this._anchorIdx=e,this._anchorPos=this._getPosition(e)}if(t=this._scrollPosition-this._overhang,i=this._scrollPosition+this._viewDim1+this._overhang,i<0||t>this._scrollSize)return void this._clearItems();null!==this._anchorIdx&&null!==this._anchorPos||(this._anchorIdx=this._getAnchor(t,i),this._anchorPos=this._getPosition(this._anchorIdx));let M=this._getSize(this._anchorIdx);void 0===M&&(this._stable=!1,M=this._getAverageSize());const n=this._metricsCache.getMarginSize(this._anchorIdx)??this._metricsCache.averageMarginSize,o=this._metricsCache.getMarginSize(this._anchorIdx+1)??this._metricsCache.averageMarginSize;0===this._anchorIdx&&(this._anchorPos=n),this._anchorIdx===this.items.length-1&&(this._anchorPos=this._scrollSize-o-M);let r=0;for(this._anchorPos+M+o<t&&(r=t-(this._anchorPos+M+o)),this._anchorPos-n>i&&(r=i-(this._anchorPos-n)),r&&(this._scrollPosition-=r,t-=r,i-=r,this._scrollError+=r),e.set(this._anchorIdx,{pos:this._anchorPos,size:M}),this._first=this._last=this._anchorIdx,this._physicalMin=this._anchorPos-n,this._physicalMax=this._anchorPos+M+o;this._physicalMin>t&&this._first>0;){let t=this._getSize(--this._first);void 0===t&&(this._stable=!1,t=this._getAverageSize());let i=this._metricsCache.getMarginSize(this._first);void 0===i&&(this._stable=!1,i=this._metricsCache.averageMarginSize),this._physicalMin-=t;const M=this._physicalMin;if(e.set(this._first,{pos:M,size:t}),this._physicalMin-=i,!1===this._stable&&!1===this._estimate)break}for(;this._physicalMax<i&&this._last<this.items.length-1;){let t=this._getSize(++this._last);void 0===t&&(this._stable=!1,t=this._getAverageSize());let i=this._metricsCache.getMarginSize(this._last);void 0===i&&(this._stable=!1,i=this._metricsCache.averageMarginSize);const M=this._physicalMax;if(e.set(this._last,{pos:M,size:t}),this._physicalMax+=t+i,!this._stable&&!this._estimate)break}const s=this._calculateError();s&&(this._physicalMin-=s,this._physicalMax-=s,this._anchorPos-=s,this._scrollPosition-=s,e.forEach((e=>e.pos-=s)),this._scrollError+=s),this._stable&&(this._newPhysicalItems=this._physicalItems,this._newPhysicalItems.clear(),this._physicalItems=e)}_calculateError(){return 0===this._first?this._physicalMin:this._physicalMin<=0?this._physicalMin-this._first*this._delta:this._last===this.items.length-1?this._physicalMax-this._scrollSize:this._physicalMax>=this._scrollSize?this._physicalMax-this._scrollSize+(this.items.length-1-this._last)*this._delta:0}_reflow(){const{_first:e,_last:t}=this;super._reflow(),(-1===this._first&&-1==this._last||this._first===e&&this._last===t)&&this._resetReflowState()}_resetReflowState(){this._anchorIdx=null,this._anchorPos=null,this._stable=!0}_updateScrollSize(){const{averageMarginSize:e}=this._metricsCache;this._scrollSize=Math.max(1,this.items.length*(e+this._getAverageSize())+e)}get _delta(){const{averageMarginSize:e}=this._metricsCache;return this._getAverageSize()+e}_getItemPosition(e){return{[this._positionDim]:this._getPosition(e),[this._secondaryPositionDim]:0,[dQ(this.direction)]:-(this._metricsCache.getLeadingMarginValue(e,this.direction)??this._metricsCache.averageMarginSize)}}_getItemSize(e){return{[this._sizeDim]:this._getSize(e)||this._getAverageSize(),[this._secondarySizeDim]:this._itemSize[this._secondarySizeDim]}}_viewDim2Changed(){this._metricsCache.clear(),this._scheduleReflow()}}});export{kx as NileAccordion,In as NileAutoComplete,ex as NileAvatar,gt as NileBadge,Ip as NileBreadcrumb,dp as NileBreadcrumbItem,_e as NileButton,vp as NileButtonFilter,Zn as NileButtonToggle,Wn as NileButtonToggleGroup,Cn as NileCalendar,Ap as NileCard,mp as NileCarousel,pp as NileCarouselItem,ft as NileCheckbox,dn as NileChip,Yp as NileCircularProgressbar,Np as NileCodeEditor,$n as NileContentEditor,pn as NileDatePicker,qn as NileDialog,bx as NileDivider,Ct as NileDrawer,Nn as NileDropdown,nx as NileEmptyState,Ln as NileErrorMessage,eo as NileErrorNotification,$L as NileFilePreview,fL as NileFileUpload,nL as NileFilterChip,Kx as NileFloatingPanel,mn as NileFormErrorMessage,Tp as NileFormGroup,wn as NileFormHelpText,Ix as NileFormatDate,dS as NileGrid,TS as NileGridBody,LS as NileGridCellItem,mS as NileGridHead,pS as NileGridHeadItem,AS as NileGridRow,Fe as NileHeading,rx as NileHero,ux as NileHeroHeader,Qe as NileIcon,Nt as NileIconButton,Gx as NileInlineEdit,bm as NileInlineSidebar,km as NileInlineSidebarGroup,vm as NileInlineSidebarItem,ot as NileInput,vn as NileLink,wx as NileList,mx as NileListItem,rM as NileLoader,st as NileMenu,nn as NileMenuItem,tn as NileOption,qL as NileOptionGroup,ix as NilePageHeader,sL as NilePagination,bp as NilePopover,Ki as NilePopup,aM as NileProgressBar,Ut as NileRadio,Zt as NileRadioGroup,qS as NileRichTextEditor,Yx as NileSectionMessage,KM as NileSelect,em as NileSideBar,pm as NileSideBarAction,wm as NileSideBarActionMenu,mm as NileSideBarActionMenuItem,rm as NileSideBarExpand,Im as NileSideBarFooter,dm as NileSideBarFooterItem,Lm as NileSideBarFooterText,am as NileSideBarGroup,Nm as NileSideBarGroupItem,um as NileSideBarGroupItemIcon,Dm as NileSideBarGroupItemText,im as NileSideBarHeader,nm as NileSideBarLogo,uQ as NileSideBarPanel,uM as NileSkeletonLoader,nM as NileSlideToggle,DL as NileSlider,NM as NileSpinner,dx as NileSplitPanel,Nx as NileStepper,ax as NileStepperItem,Fn as NileSwitcher,oo as NileTab,io as NileTabGroup,ao as NileTabPanel,tL as NileTable,$p as NileTableBody,_p as NileTableCellItem,qp as NileTableHeaderItem,Hp as NileTableRow,jM as NileTag,Tn as NileTextarea,vx as NileTitle,Dp as NileToast,Vx as NileToolbar,iM as NileTooltip,Lx as NileTree,Ox as NileTreeItem,Dx as NileVerticalStepperItem,$M as NileVirtualSelect,NQ as NileliteTooltip};
|