@sankhyalabs/ezui 7.1.8 → 7.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/ApplicationUtils-5cc05979.js.gz +0 -0
- package/dist/cjs/CSSVarsUtils-f20973d1.js.gz +0 -0
- package/dist/cjs/CheckMode-ecb90b87.js.gz +0 -0
- package/dist/cjs/DialogType-2114c337.js.gz +0 -0
- package/dist/cjs/EzScrollDirection-b2c99895.js.gz +0 -0
- package/dist/cjs/FocusResolver-885f2173.js.gz +0 -0
- package/dist/cjs/FormLayout-18853e70.js.gz +0 -0
- package/dist/cjs/RichToolbarHelper-ea12328f.js.gz +0 -0
- package/dist/cjs/_commonjsHelpers-537d719a.js.gz +0 -0
- package/dist/cjs/app-globals-2fbe4b17.js.gz +0 -0
- package/dist/cjs/constants-72b7e05e.js.gz +0 -0
- package/dist/cjs/ez-actions-button.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-alert-list.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-alert.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-application.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-avatar.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-badge.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-breadcrumb.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-button.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-calendar.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-card-item.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-chart.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-check.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-chip.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-classic-combo-box.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-classic-input.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-classic-text-area.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-collapsible-box.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-combo-box-list_4.cjs.entry.js +1 -1
- package/dist/cjs/ez-combo-box-list_4.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-combo-box.cjs.entry.js +5 -0
- package/dist/cjs/ez-combo-box.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-date-input.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-date-time-input.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-dialog.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-double-list.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-dropdown.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-empty-card.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-file-item.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-filter-input.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-form-view.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-form.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-grid-view.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-grid.cjs.entry.js +1 -1
- package/dist/cjs/ez-grid.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-guide-navigator.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-icon.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-link-builder_6.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-list-item.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-list.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-loading-bar.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-modal-container.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-modal.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-multi-selection-list.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-number-input.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-pagination.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-popover-core.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-popover-plus_3.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-popover.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-popup.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-progress-bar.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-radio-button.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-rich-toolbar-item.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-scroller_2.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-search-plus.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-search-result-list.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-search.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-sidebar-navigator.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-skeleton.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-sortable-list.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-spinner.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-split-button.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-split-item.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-split-panel.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-tabselector.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-tag-input.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-tag.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-text-area.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-text-input.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-tile-medium.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-tile.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-time-input.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-toast.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-tooltip.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-tree.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-underface.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-upload.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-view-stack.cjs.entry.js.gz +0 -0
- package/dist/cjs/ezListHelper-0d3970b4.js.gz +0 -0
- package/dist/cjs/ezui.cjs.js.gz +0 -0
- package/dist/cjs/filter-column.cjs.entry.js +6 -1
- package/dist/cjs/filter-column.cjs.entry.js.gz +0 -0
- package/dist/cjs/floating-ui.dom.esm-f4d87617.js.gz +0 -0
- package/dist/cjs/index-1be40f19.js.gz +0 -0
- package/dist/cjs/index-a7b0c73d.js.gz +0 -0
- package/dist/cjs/index.cjs.js.gz +0 -0
- package/dist/cjs/loader.cjs.js.gz +0 -0
- package/dist/cjs/{purify-29cc6f77.js → purify-db11ac44.js} +856 -228
- package/dist/cjs/purify-db11ac44.js.gz +0 -0
- package/dist/cjs/search-column-316e2c59.js.gz +0 -0
- package/dist/cjs/searchFormatters-b7e1ed1e.js.gz +0 -0
- package/dist/collection/components/ez-actions-button/ez-actions-button.css.gz +0 -0
- package/dist/collection/components/ez-actions-button/ez-actions-button.js.gz +0 -0
- package/dist/collection/components/ez-alert/ez-alert.css.gz +0 -0
- package/dist/collection/components/ez-alert/ez-alert.js.gz +0 -0
- package/dist/collection/components/ez-alert-list/ez-alert-list.css.gz +0 -0
- package/dist/collection/components/ez-alert-list/ez-alert-list.js.gz +0 -0
- package/dist/collection/components/ez-application/ez-application.css.gz +0 -0
- package/dist/collection/components/ez-application/ez-application.js.gz +0 -0
- package/dist/collection/components/ez-avatar/ez-avatar.css.gz +0 -0
- package/dist/collection/components/ez-avatar/ez-avatar.js.gz +0 -0
- package/dist/collection/components/ez-badge/enum/sizes.js.gz +0 -0
- package/dist/collection/components/ez-badge/ez-badge.css.gz +0 -0
- package/dist/collection/components/ez-badge/ez-badge.js.gz +0 -0
- package/dist/collection/components/ez-badge/interfaces/IPosition.js.gz +0 -0
- package/dist/collection/components/ez-breadcrumb/ez-breadcrumb.css.gz +0 -0
- package/dist/collection/components/ez-breadcrumb/ez-breadcrumb.js.gz +0 -0
- package/dist/collection/components/ez-breadcrumb/subcomponents/breadcrumb-item.js.gz +0 -0
- package/dist/collection/components/ez-button/ez-button.css.gz +0 -0
- package/dist/collection/components/ez-button/ez-button.js.gz +0 -0
- package/dist/collection/components/ez-calendar/ez-calendar.css.gz +0 -0
- package/dist/collection/components/ez-calendar/ez-calendar.js.gz +0 -0
- package/dist/collection/components/ez-card-item/ez-card-item.css.gz +0 -0
- package/dist/collection/components/ez-card-item/ez-card-item.js.gz +0 -0
- package/dist/collection/components/ez-chart/components/BarChart.js.gz +0 -0
- package/dist/collection/components/ez-chart/components/ColumnChart.js.gz +0 -0
- package/dist/collection/components/ez-chart/components/DonutChart.js.gz +0 -0
- package/dist/collection/components/ez-chart/components/LineChart.js.gz +0 -0
- package/dist/collection/components/ez-chart/components/PieChart.js.gz +0 -0
- package/dist/collection/components/ez-chart/components/index.js.gz +0 -0
- package/dist/collection/components/ez-chart/ez-chart.css.gz +0 -0
- package/dist/collection/components/ez-chart/ez-chart.js.gz +0 -0
- package/dist/collection/components/ez-chart/interfaces/ChartAxis.js.gz +0 -0
- package/dist/collection/components/ez-chart/interfaces/ChartContext.js.gz +0 -0
- package/dist/collection/components/ez-chart/interfaces/ChartOptions.js.gz +0 -0
- package/dist/collection/components/ez-chart/interfaces/ChartSerie.js.gz +0 -0
- package/dist/collection/components/ez-chart/interfaces/ChartStrategies.js.gz +0 -0
- package/dist/collection/components/ez-chart/interfaces/ChartType.js.gz +0 -0
- package/dist/collection/components/ez-chart/interfaces/ChartTypeValue.js.gz +0 -0
- package/dist/collection/components/ez-chart/interfaces/index.js.gz +0 -0
- package/dist/collection/components/ez-chart/test/mock-chart.js.gz +0 -0
- package/dist/collection/components/ez-chart/types/BaseHighChartsRender.js.gz +0 -0
- package/dist/collection/components/ez-check/CheckMode.js.gz +0 -0
- package/dist/collection/components/ez-check/ez-check.css.gz +0 -0
- package/dist/collection/components/ez-check/ez-check.js.gz +0 -0
- package/dist/collection/components/ez-chip/ez-chip.css.gz +0 -0
- package/dist/collection/components/ez-chip/ez-chip.js.gz +0 -0
- package/dist/collection/components/ez-classic-combo-box/ez-classic-combo-box.css.gz +0 -0
- package/dist/collection/components/ez-classic-combo-box/ez-classic-combo-box.js.gz +0 -0
- package/dist/collection/components/ez-classic-combo-box/interfaces/IOption.js.gz +0 -0
- package/dist/collection/components/ez-classic-input/ez-classic-input.css.gz +0 -0
- package/dist/collection/components/ez-classic-input/ez-classic-input.js.gz +0 -0
- package/dist/collection/components/ez-classic-input/interfaces/optionsSetFocus.js.gz +0 -0
- package/dist/collection/components/ez-classic-input/utils/maskFormatter.js.gz +0 -0
- package/dist/collection/components/ez-classic-text-area/ez-classic-text-area.css.gz +0 -0
- package/dist/collection/components/ez-classic-text-area/ez-classic-text-area.js.gz +0 -0
- package/dist/collection/components/ez-classic-text-area/interfaces/optionsSetFocus.js.gz +0 -0
- package/dist/collection/components/ez-collapsible-box/ez-collapsible-box.css.gz +0 -0
- package/dist/collection/components/ez-collapsible-box/ez-collapsible-box.js.gz +0 -0
- package/dist/collection/components/ez-combo-box/ez-combo-box-list/ez-combo-box-list.css.gz +0 -0
- package/dist/collection/components/ez-combo-box/ez-combo-box-list/ez-combo-box-list.js.gz +0 -0
- package/dist/collection/components/ez-combo-box/ez-combo-box.css.gz +0 -0
- package/dist/collection/components/ez-combo-box/ez-combo-box.js +5 -0
- package/dist/collection/components/ez-combo-box/ez-combo-box.js.gz +0 -0
- package/dist/collection/components/ez-date-input/ez-date-input.css.gz +0 -0
- package/dist/collection/components/ez-date-input/ez-date-input.js.gz +0 -0
- package/dist/collection/components/ez-date-time-input/ez-date-time-input.css.gz +0 -0
- package/dist/collection/components/ez-date-time-input/ez-date-time-input.js.gz +0 -0
- package/dist/collection/components/ez-dialog/DialogType.js.gz +0 -0
- package/dist/collection/components/ez-dialog/ez-dialog.css.gz +0 -0
- package/dist/collection/components/ez-dialog/ez-dialog.js.gz +0 -0
- package/dist/collection/components/ez-double-list/doubleListHelper.js.gz +0 -0
- package/dist/collection/components/ez-double-list/ez-double-list.css.gz +0 -0
- package/dist/collection/components/ez-double-list/ez-double-list.js.gz +0 -0
- package/dist/collection/components/ez-dropdown/ez-dropdown.css.gz +0 -0
- package/dist/collection/components/ez-dropdown/ez-dropdown.js.gz +0 -0
- package/dist/collection/components/ez-dropdown/structure/DropdownItem.js.gz +0 -0
- package/dist/collection/components/ez-dropdown/structure/SubmenuControl.js.gz +0 -0
- package/dist/collection/components/ez-empty-card/ez-empty-card.css.gz +0 -0
- package/dist/collection/components/ez-empty-card/ez-empty-card.js.gz +0 -0
- package/dist/collection/components/ez-file-item/ez-file-item.css.gz +0 -0
- package/dist/collection/components/ez-file-item/ez-file-item.js.gz +0 -0
- package/dist/collection/components/ez-filter-input/ez-filter-input.css.gz +0 -0
- package/dist/collection/components/ez-filter-input/ez-filter-input.js.gz +0 -0
- package/dist/collection/components/ez-form/ez-form.css.gz +0 -0
- package/dist/collection/components/ez-form/ez-form.js.gz +0 -0
- package/dist/collection/components/ez-form/store/form.slice.js.gz +0 -0
- package/dist/collection/components/ez-form-view/custom-input/ez-custom-form-input.js.gz +0 -0
- package/dist/collection/components/ez-form-view/ez-form-view.css.gz +0 -0
- package/dist/collection/components/ez-form-view/ez-form-view.js.gz +0 -0
- package/dist/collection/components/ez-form-view/fieldbuilder/FieldBuilder.js.gz +0 -0
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/CheckBox.tpl.js.gz +0 -0
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/ComboBox.tpl.js.gz +0 -0
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/DateInput.tpl.js.gz +0 -0
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/FileInput.tpl.js.gz +0 -0
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/NumberInput.tpl.js.gz +0 -0
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/RichText.tpl.js.gz +0 -0
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/SearchInput.tpl.js.gz +0 -0
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/SearchInputPlus.tpl.js.gz +0 -0
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/TextArea.tpl.js.gz +0 -0
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/TextInput.tpl.js.gz +0 -0
- package/dist/collection/components/ez-form-view/interfaces/IFormViewField.js.gz +0 -0
- package/dist/collection/components/ez-form-view/interfaces/index.js.gz +0 -0
- package/dist/collection/components/ez-form-view/structure/index.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/EzGridController.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/DataSource.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/DataSourceInterceptor.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/GridEditionManager.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/components/EzGridCustomCellEditor.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/components/EzGridCustomCellRender.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/components/EzGridCustomHeader.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/components/cellRendererStatus.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/components/selectionHeader.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/components/test/constants/EzGridCustomCellEditorConstants.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/components/test/constants/EzGridCustomCellRenderConstants.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/EzCellEditor.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/EzCellRender.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/GridEditorUtils.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/IEditorMetadata.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/IUICellEditor.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/IUICellRender.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/ComboBox.tpl.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/DateInput.tpl.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/NumberInput.tpl.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/Search.tpl.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/SearchPlus.tpl.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/TextInput.tpl.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/mock/Server.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/test/constants/GridEditionMock.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/utils/buildLocaleText.js.gz +0 -0
- package/dist/collection/components/ez-grid/ez-grid.css.gz +0 -0
- package/dist/collection/components/ez-grid/ez-grid.js.gz +0 -0
- package/dist/collection/components/ez-grid/interfaces/IColumnFilter.js.gz +0 -0
- package/dist/collection/components/ez-grid/interfaces/ICustomFormatter.js.gz +0 -0
- package/dist/collection/components/ez-grid/interfaces/IGridMode.js.gz +0 -0
- package/dist/collection/components/ez-grid/interfaces/ISelection.js.gz +0 -0
- package/dist/collection/components/ez-grid/interfaces/ISelectionToastConfig.js.gz +0 -0
- package/dist/collection/components/ez-grid/interfaces/index.js.gz +0 -0
- package/dist/collection/components/ez-grid/subcomponents/filter-column.css.gz +0 -0
- package/dist/collection/components/ez-grid/subcomponents/filter-column.js +6 -1
- package/dist/collection/components/ez-grid/subcomponents/filter-column.js.gz +0 -0
- package/dist/collection/components/ez-grid/subcomponents/selection-counter.js.gz +0 -0
- package/dist/collection/components/ez-grid/subcomponents/utils/selectionCounterUtils.js.gz +0 -0
- package/dist/collection/components/ez-grid/test/resources/gridDataUnit.js.gz +0 -0
- package/dist/collection/components/ez-grid/utils/ColumnFilterManager.js.gz +0 -0
- package/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource.js.gz +0 -0
- package/dist/collection/components/ez-grid/utils/index.js.gz +0 -0
- package/dist/collection/components/ez-grid-view/ez-grid-view.css.gz +0 -0
- package/dist/collection/components/ez-grid-view/ez-grid-view.js.gz +0 -0
- package/dist/collection/components/ez-guide-navigator/ez-guide-navigator.css.gz +0 -0
- package/dist/collection/components/ez-guide-navigator/ez-guide-navigator.js.gz +0 -0
- package/dist/collection/components/ez-guide-navigator/interfaces/IGuideItem.js.gz +0 -0
- package/dist/collection/components/ez-guide-navigator/interfaces/index.js.gz +0 -0
- package/dist/collection/components/ez-icon/ez-icon.css.gz +0 -0
- package/dist/collection/components/ez-icon/ez-icon.js.gz +0 -0
- package/dist/collection/components/ez-list/ez-list.css.gz +0 -0
- package/dist/collection/components/ez-list/ez-list.js.gz +0 -0
- package/dist/collection/components/ez-list/ezListHelper.js.gz +0 -0
- package/dist/collection/components/ez-list-item/ez-list-item.css.gz +0 -0
- package/dist/collection/components/ez-list-item/ez-list-item.js.gz +0 -0
- package/dist/collection/components/ez-loading-bar/ez-loading-bar.css.gz +0 -0
- package/dist/collection/components/ez-loading-bar/ez-loading-bar.js.gz +0 -0
- package/dist/collection/components/ez-modal/ez-modal.css.gz +0 -0
- package/dist/collection/components/ez-modal/ez-modal.js.gz +0 -0
- package/dist/collection/components/ez-modal-container/ez-modal-container.css.gz +0 -0
- package/dist/collection/components/ez-modal-container/ez-modal-container.js.gz +0 -0
- package/dist/collection/components/ez-modal-container/index.js.gz +0 -0
- package/dist/collection/components/ez-modal-container/modal-action.js.gz +0 -0
- package/dist/collection/components/ez-modal-container/modal-button-status.js.gz +0 -0
- package/dist/collection/components/ez-multi-selection-list/ez-multi-selection-list.css.gz +0 -0
- package/dist/collection/components/ez-multi-selection-list/ez-multi-selection-list.js.gz +0 -0
- package/dist/collection/components/ez-multi-selection-list/interfaces/IMultiSelectionListDataSource.js.gz +0 -0
- package/dist/collection/components/ez-multi-selection-list/interfaces/IMultiSelectionOption.js.gz +0 -0
- package/dist/collection/components/ez-multi-selection-list/interfaces/IStaticOptionsFetchConfig.js.gz +0 -0
- package/dist/collection/components/ez-multi-selection-list/subcomponents/multi-selection-box-message.css.gz +0 -0
- package/dist/collection/components/ez-multi-selection-list/subcomponents/multi-selection-box-message.js.gz +0 -0
- package/dist/collection/components/ez-number-input/ez-number-input.css.gz +0 -0
- package/dist/collection/components/ez-number-input/ez-number-input.js.gz +0 -0
- package/dist/collection/components/ez-pagination/ez-pagination.css.gz +0 -0
- package/dist/collection/components/ez-pagination/ez-pagination.js.gz +0 -0
- package/dist/collection/components/ez-popover/ez-popover.css.gz +0 -0
- package/dist/collection/components/ez-popover/ez-popover.js.gz +0 -0
- package/dist/collection/components/ez-popover-plus/ez-popover-plus.css.gz +0 -0
- package/dist/collection/components/ez-popover-plus/ez-popover-plus.js.gz +0 -0
- package/dist/collection/components/ez-popover-plus/subcomponent/ez-popover-core.css.gz +0 -0
- package/dist/collection/components/ez-popover-plus/subcomponent/ez-popover-core.js.gz +0 -0
- package/dist/collection/components/ez-popup/ez-popup.css.gz +0 -0
- package/dist/collection/components/ez-popup/ez-popup.js.gz +0 -0
- package/dist/collection/components/ez-popup/interfaces/EzButtonProps.js.gz +0 -0
- package/dist/collection/components/ez-progress-bar/ez-progress-bar.css.gz +0 -0
- package/dist/collection/components/ez-progress-bar/ez-progress-bar.js.gz +0 -0
- package/dist/collection/components/ez-radio-button/ez-radio-button.css.gz +0 -0
- package/dist/collection/components/ez-radio-button/ez-radio-button.js.gz +0 -0
- package/dist/collection/components/ez-rich-text/ez-link-builder/ez-link-builder.css.gz +0 -0
- package/dist/collection/components/ez-rich-text/ez-link-builder/ez-link-builder.js.gz +0 -0
- package/dist/collection/components/ez-rich-text/ez-rich-text.css.gz +0 -0
- package/dist/collection/components/ez-rich-text/ez-rich-text.js.gz +0 -0
- package/dist/collection/components/ez-rich-text/ez-rich-toolbar/RichToolbarHelper.js.gz +0 -0
- package/dist/collection/components/ez-rich-text/ez-rich-toolbar/ez-rich-toolbar-arrows/ez-rich-toolbar-arrows.css.gz +0 -0
- package/dist/collection/components/ez-rich-text/ez-rich-toolbar/ez-rich-toolbar-arrows/ez-rich-toolbar-arrows.js.gz +0 -0
- package/dist/collection/components/ez-rich-text/ez-rich-toolbar/ez-rich-toolbar-configs/ez-rich-toolbar-configs.css.gz +0 -0
- package/dist/collection/components/ez-rich-text/ez-rich-toolbar/ez-rich-toolbar-configs/ez-rich-toolbar-configs.js.gz +0 -0
- package/dist/collection/components/ez-rich-text/ez-rich-toolbar/ez-rich-toolbar-item/ez-rich-toolbar-item.css.gz +0 -0
- package/dist/collection/components/ez-rich-text/ez-rich-toolbar/ez-rich-toolbar-item/ez-rich-toolbar-item.js.gz +0 -0
- package/dist/collection/components/ez-rich-text/ez-rich-toolbar/ez-rich-toolbar-letters/ez-rich-toolbar-letters.css.gz +0 -0
- package/dist/collection/components/ez-rich-text/ez-rich-toolbar/ez-rich-toolbar-letters/ez-rich-toolbar-letters.js.gz +0 -0
- package/dist/collection/components/ez-rich-text/ez-rich-toolbar/ez-rich-toolbar.css.gz +0 -0
- package/dist/collection/components/ez-rich-text/ez-rich-toolbar/ez-rich-toolbar.js.gz +0 -0
- package/dist/collection/components/ez-rich-text/ez-simple-image-uploader/ez-simple-image-uploader.css.gz +0 -0
- package/dist/collection/components/ez-rich-text/ez-simple-image-uploader/ez-simple-image-uploader.js.gz +0 -0
- package/dist/collection/components/ez-rich-text/ez-simple-image-uploader/test/resource/imageBase64.js.gz +0 -0
- package/dist/collection/components/ez-rich-text/ez-simple-image-uploader/utils/fileToBase64.js.gz +0 -0
- package/dist/collection/components/ez-rich-text/ez-simple-image-uploader/utils/formatBytes.js.gz +0 -0
- package/dist/collection/components/ez-scroller/EzScrollDirection.js.gz +0 -0
- package/dist/collection/components/ez-scroller/ez-scroller.css.gz +0 -0
- package/dist/collection/components/ez-scroller/ez-scroller.js.gz +0 -0
- package/dist/collection/components/ez-search/ez-search.css.gz +0 -0
- package/dist/collection/components/ez-search/ez-search.js.gz +0 -0
- package/dist/collection/components/ez-search/subcomponent/search-list/search-list.css.gz +0 -0
- package/dist/collection/components/ez-search/subcomponent/search-list/search-list.js.gz +0 -0
- package/dist/collection/components/ez-search/utils/searchFormatters.js.gz +0 -0
- package/dist/collection/components/ez-search-plus/ez-search-plus.css.gz +0 -0
- package/dist/collection/components/ez-search-plus/ez-search-plus.js.gz +0 -0
- package/dist/collection/components/ez-search-plus/subcomponent/ez-search-result-list/ez-search-result-list.css.gz +0 -0
- package/dist/collection/components/ez-search-plus/subcomponent/ez-search-result-list/ez-search-result-list.js.gz +0 -0
- package/dist/collection/components/ez-sidebar-button/ez-sidebar-button.css.gz +0 -0
- package/dist/collection/components/ez-sidebar-button/ez-sidebar-button.js.gz +0 -0
- package/dist/collection/components/ez-sidebar-navigator/ez-sidebar-navigator.css.gz +0 -0
- package/dist/collection/components/ez-sidebar-navigator/ez-sidebar-navigator.js.gz +0 -0
- package/dist/collection/components/ez-sidebar-navigator/interfaces/ModeMenuEnum.js.gz +0 -0
- package/dist/collection/components/ez-sidebar-navigator/interfaces/SizeMenuEnum.js.gz +0 -0
- package/dist/collection/components/ez-sidebar-navigator/interfaces/TypeMenuEnum.js.gz +0 -0
- package/dist/collection/components/ez-sidebar-navigator/interfaces/index.js.gz +0 -0
- package/dist/collection/components/ez-skeleton/ez-skeleton.constants.js.gz +0 -0
- package/dist/collection/components/ez-skeleton/ez-skeleton.css.gz +0 -0
- package/dist/collection/components/ez-skeleton/ez-skeleton.js.gz +0 -0
- package/dist/collection/components/ez-sortable-list/ez-sortable-list.css.gz +0 -0
- package/dist/collection/components/ez-sortable-list/ez-sortable-list.js.gz +0 -0
- package/dist/collection/components/ez-spinner/ez-spinner.css.gz +0 -0
- package/dist/collection/components/ez-spinner/ez-spinner.js.gz +0 -0
- package/dist/collection/components/ez-split-button/ez-split-button.css.gz +0 -0
- package/dist/collection/components/ez-split-button/ez-split-button.js.gz +0 -0
- package/dist/collection/components/ez-split-button/test/dropdownItems.js.gz +0 -0
- package/dist/collection/components/ez-split-panel/ez-split-panel.css.gz +0 -0
- package/dist/collection/components/ez-split-panel/ez-split-panel.js.gz +0 -0
- package/dist/collection/components/ez-split-panel/interfaces/IPanelSizeInfo.js.gz +0 -0
- package/dist/collection/components/ez-split-panel/structure/item/ez-split-item.css.gz +0 -0
- package/dist/collection/components/ez-split-panel/structure/item/ez-split-item.js.gz +0 -0
- package/dist/collection/components/ez-tabselector/ez-tabselector.css.gz +0 -0
- package/dist/collection/components/ez-tabselector/ez-tabselector.js.gz +0 -0
- package/dist/collection/components/ez-tag/ez-tag.css.gz +0 -0
- package/dist/collection/components/ez-tag/ez-tag.js.gz +0 -0
- package/dist/collection/components/ez-tag-input/ez-tag-input.css.gz +0 -0
- package/dist/collection/components/ez-tag-input/ez-tag-input.js.gz +0 -0
- package/dist/collection/components/ez-tag-input/interfaces/optionsSetFocus.js.gz +0 -0
- package/dist/collection/components/ez-text-area/ez-text-area.css.gz +0 -0
- package/dist/collection/components/ez-text-area/ez-text-area.js.gz +0 -0
- package/dist/collection/components/ez-text-edit/ez-text-edit.css.gz +0 -0
- package/dist/collection/components/ez-text-edit/ez-text-edit.js.gz +0 -0
- package/dist/collection/components/ez-text-input/ez-text-input.css.gz +0 -0
- package/dist/collection/components/ez-text-input/ez-text-input.js.gz +0 -0
- package/dist/collection/components/ez-tile/ez-tile.css.gz +0 -0
- package/dist/collection/components/ez-tile/ez-tile.js.gz +0 -0
- package/dist/collection/components/ez-tile-medium/ez-tile-medium.css.gz +0 -0
- package/dist/collection/components/ez-tile-medium/ez-tile-medium.js.gz +0 -0
- package/dist/collection/components/ez-time-input/ez-time-input.css.gz +0 -0
- package/dist/collection/components/ez-time-input/ez-time-input.js.gz +0 -0
- package/dist/collection/components/ez-toast/ez-toast.css.gz +0 -0
- package/dist/collection/components/ez-toast/ez-toast.js.gz +0 -0
- package/dist/collection/components/ez-tooltip/ez-tooltip.css.gz +0 -0
- package/dist/collection/components/ez-tooltip/ez-tooltip.js.gz +0 -0
- package/dist/collection/components/ez-tree/ez-tree.css.gz +0 -0
- package/dist/collection/components/ez-tree/ez-tree.js.gz +0 -0
- package/dist/collection/components/ez-tree/interfaces/ITree.js.gz +0 -0
- package/dist/collection/components/ez-tree/interfaces/ITreeItem.js.gz +0 -0
- package/dist/collection/components/ez-tree/interfaces/ITreeItemBadge.js.gz +0 -0
- package/dist/collection/components/ez-tree/subcomponents/DefaultIconResolver.js.gz +0 -0
- package/dist/collection/components/ez-tree/subcomponents/DefaultTooltipResolver.js.gz +0 -0
- package/dist/collection/components/ez-tree/subcomponents/TreeItem.js.gz +0 -0
- package/dist/collection/components/ez-tree/subcomponents/index.js.gz +0 -0
- package/dist/collection/components/ez-tree/types/Node.js.gz +0 -0
- package/dist/collection/components/ez-tree/types/Tree.js.gz +0 -0
- package/dist/collection/components/ez-tree/types/UpdateItemConfig.js.gz +0 -0
- package/dist/collection/components/ez-underface/ez-underface.css.gz +0 -0
- package/dist/collection/components/ez-underface/ez-underface.js.gz +0 -0
- package/dist/collection/components/ez-upload/RemoteFile.js.gz +0 -0
- package/dist/collection/components/ez-upload/ez-upload.css.gz +0 -0
- package/dist/collection/components/ez-upload/ez-upload.js.gz +0 -0
- package/dist/collection/components/ez-view-stack/ez-view-stack.css.gz +0 -0
- package/dist/collection/components/ez-view-stack/ez-view-stack.js.gz +0 -0
- package/dist/collection/global/app-init.js.gz +0 -0
- package/dist/collection/index.js.gz +0 -0
- package/dist/collection/servidor.js.gz +0 -0
- package/dist/collection/setupTests.js.gz +0 -0
- package/dist/collection/sw.js.gz +0 -0
- package/dist/collection/utils/ApplicationUtils.js.gz +0 -0
- package/dist/collection/utils/AssetsUtils.js.gz +0 -0
- package/dist/collection/utils/CSSVarsUtils.js.gz +0 -0
- package/dist/collection/utils/FocusResolver.js.gz +0 -0
- package/dist/collection/utils/ag-grid-license.js.gz +0 -0
- package/dist/collection/utils/constants.js.gz +0 -0
- package/dist/collection/utils/customEditor/interfaces/ICustomEditor.js.gz +0 -0
- package/dist/collection/utils/customEditor/interfaces/ICustomEditorInfo.js.gz +0 -0
- package/dist/collection/utils/customRender/interfaces/ICustomRender.js.gz +0 -0
- package/dist/collection/utils/customRender/interfaces/ICustomRenderInfo.js.gz +0 -0
- package/dist/collection/utils/form/DataBinder.js.gz +0 -0
- package/dist/collection/utils/form/FormMetadata.js.gz +0 -0
- package/dist/collection/utils/form/index.js.gz +0 -0
- package/dist/collection/utils/form/interfaces/FormLayout.js.gz +0 -0
- package/dist/collection/utils/form/interfaces/IDefaultConfig.js.gz +0 -0
- package/dist/collection/utils/form/interfaces/IFormCardConfig.js.gz +0 -0
- package/dist/collection/utils/form/interfaces/IFormConfig.js.gz +0 -0
- package/dist/collection/utils/form/interfaces/IFormSheetMetadata.js.gz +0 -0
- package/dist/collection/utils/form/interfaces/ISummaryField.js.gz +0 -0
- package/dist/collection/utils/form/interfaces/ITabConfig.js.gz +0 -0
- package/dist/collection/utils/form/interfaces/index.js.gz +0 -0
- package/dist/collection/utils/form/test/DataBinder.test.js.gz +0 -0
- package/dist/collection/utils/form/test/resources/metadataTest.js.gz +0 -0
- package/dist/collection/utils/i18n/elanguages.js.gz +0 -0
- package/dist/collection/utils/i18n/index.js.gz +0 -0
- package/dist/collection/utils/i18n/locales/en-us.js.gz +0 -0
- package/dist/collection/utils/i18n/locales/es-es.js.gz +0 -0
- package/dist/collection/utils/i18n/locales/pt-br.js.gz +0 -0
- package/dist/collection/utils/i18n/translations.js.gz +0 -0
- package/dist/collection/utils/index.js.gz +0 -0
- package/dist/collection/utils/interfaces/AbstractFieldMetadata.js.gz +0 -0
- package/dist/collection/utils/interfaces/IAction.js.gz +0 -0
- package/dist/collection/utils/interfaces/IFieldConfig.js.gz +0 -0
- package/dist/collection/utils/mock/ez-upload-mock.js.gz +0 -0
- package/dist/collection/utils/search/types.js.gz +0 -0
- package/dist/collection/utils/searchColumn/search-column.js.gz +0 -0
- package/dist/collection/utils/utils.js.gz +0 -0
- package/dist/collection/utils/validators/recordvalidator/IInvalidCells.js.gz +0 -0
- package/dist/collection/utils/validators/recordvalidator/IInvalidField.js.gz +0 -0
- package/dist/collection/utils/validators/recordvalidator/IRecordValidator.js.gz +0 -0
- package/dist/collection/utils/validators/recordvalidator/IValidationResult.js.gz +0 -0
- package/dist/collection/utils/validators/recordvalidator/IValidationSource.js.gz +0 -0
- package/dist/collection/utils/validators/recordvalidator/RecordValidationProcessor.js.gz +0 -0
- package/dist/custom-elements/index.js +867 -229
- package/dist/custom-elements/index.js.gz +0 -0
- package/dist/esm/ApplicationUtils-1569f757.js.gz +0 -0
- package/dist/esm/CSSVarsUtils-acba92d7.js.gz +0 -0
- package/dist/esm/CheckMode-bdb2ec19.js.gz +0 -0
- package/dist/esm/DialogType-54a62731.js.gz +0 -0
- package/dist/esm/EzScrollDirection-2df26c93.js.gz +0 -0
- package/dist/esm/FocusResolver-1ccbf850.js.gz +0 -0
- package/dist/esm/FormLayout-071d324c.js.gz +0 -0
- package/dist/esm/RichToolbarHelper-f3a149c4.js.gz +0 -0
- package/dist/esm/_commonjsHelpers-9943807e.js.gz +0 -0
- package/dist/esm/app-globals-c0ac93c0.js.gz +0 -0
- package/dist/esm/constants-3fabe81e.js.gz +0 -0
- package/dist/esm/ez-actions-button.entry.js.gz +0 -0
- package/dist/esm/ez-alert-list.entry.js.gz +0 -0
- package/dist/esm/ez-alert.entry.js.gz +0 -0
- package/dist/esm/ez-application.entry.js.gz +0 -0
- package/dist/esm/ez-avatar.entry.js.gz +0 -0
- package/dist/esm/ez-badge.entry.js.gz +0 -0
- package/dist/esm/ez-breadcrumb.entry.js.gz +0 -0
- package/dist/esm/ez-button.entry.js.gz +0 -0
- package/dist/esm/ez-calendar.entry.js.gz +0 -0
- package/dist/esm/ez-card-item.entry.js.gz +0 -0
- package/dist/esm/ez-chart.entry.js.gz +0 -0
- package/dist/esm/ez-check.entry.js.gz +0 -0
- package/dist/esm/ez-chip.entry.js.gz +0 -0
- package/dist/esm/ez-classic-combo-box.entry.js.gz +0 -0
- package/dist/esm/ez-classic-input.entry.js.gz +0 -0
- package/dist/esm/ez-classic-text-area.entry.js.gz +0 -0
- package/dist/esm/ez-collapsible-box.entry.js.gz +0 -0
- package/dist/esm/ez-combo-box-list_4.entry.js +1 -1
- package/dist/esm/ez-combo-box-list_4.entry.js.gz +0 -0
- package/dist/esm/ez-combo-box.entry.js +5 -0
- package/dist/esm/ez-combo-box.entry.js.gz +0 -0
- package/dist/esm/ez-date-input.entry.js.gz +0 -0
- package/dist/esm/ez-date-time-input.entry.js.gz +0 -0
- package/dist/esm/ez-dialog.entry.js.gz +0 -0
- package/dist/esm/ez-double-list.entry.js.gz +0 -0
- package/dist/esm/ez-dropdown.entry.js.gz +0 -0
- package/dist/esm/ez-empty-card.entry.js.gz +0 -0
- package/dist/esm/ez-file-item.entry.js.gz +0 -0
- package/dist/esm/ez-filter-input.entry.js.gz +0 -0
- package/dist/esm/ez-form-view.entry.js.gz +0 -0
- package/dist/esm/ez-form.entry.js.gz +0 -0
- package/dist/esm/ez-grid-view.entry.js.gz +0 -0
- package/dist/esm/ez-grid.entry.js +1 -1
- package/dist/esm/ez-grid.entry.js.gz +0 -0
- package/dist/esm/ez-guide-navigator.entry.js.gz +0 -0
- package/dist/esm/ez-icon.entry.js.gz +0 -0
- package/dist/esm/ez-link-builder_6.entry.js.gz +0 -0
- package/dist/esm/ez-list-item.entry.js.gz +0 -0
- package/dist/esm/ez-list.entry.js.gz +0 -0
- package/dist/esm/ez-loading-bar.entry.js.gz +0 -0
- package/dist/esm/ez-modal-container.entry.js.gz +0 -0
- package/dist/esm/ez-modal.entry.js.gz +0 -0
- package/dist/esm/ez-multi-selection-list.entry.js.gz +0 -0
- package/dist/esm/ez-number-input.entry.js.gz +0 -0
- package/dist/esm/ez-pagination.entry.js.gz +0 -0
- package/dist/esm/ez-popover-core.entry.js.gz +0 -0
- package/dist/esm/ez-popover-plus_3.entry.js.gz +0 -0
- package/dist/esm/ez-popover.entry.js.gz +0 -0
- package/dist/esm/ez-popup.entry.js.gz +0 -0
- package/dist/esm/ez-progress-bar.entry.js.gz +0 -0
- package/dist/esm/ez-radio-button.entry.js.gz +0 -0
- package/dist/esm/ez-rich-toolbar-item.entry.js.gz +0 -0
- package/dist/esm/ez-scroller_2.entry.js.gz +0 -0
- package/dist/esm/ez-search-plus.entry.js.gz +0 -0
- package/dist/esm/ez-search-result-list.entry.js.gz +0 -0
- package/dist/esm/ez-search.entry.js.gz +0 -0
- package/dist/esm/ez-sidebar-navigator.entry.js.gz +0 -0
- package/dist/esm/ez-skeleton.entry.js.gz +0 -0
- package/dist/esm/ez-sortable-list.entry.js.gz +0 -0
- package/dist/esm/ez-spinner.entry.js.gz +0 -0
- package/dist/esm/ez-split-button.entry.js.gz +0 -0
- package/dist/esm/ez-split-item.entry.js.gz +0 -0
- package/dist/esm/ez-split-panel.entry.js.gz +0 -0
- package/dist/esm/ez-tabselector.entry.js.gz +0 -0
- package/dist/esm/ez-tag-input.entry.js.gz +0 -0
- package/dist/esm/ez-tag.entry.js.gz +0 -0
- package/dist/esm/ez-text-area.entry.js.gz +0 -0
- package/dist/esm/ez-text-input.entry.js.gz +0 -0
- package/dist/esm/ez-tile-medium.entry.js.gz +0 -0
- package/dist/esm/ez-tile.entry.js.gz +0 -0
- package/dist/esm/ez-time-input.entry.js.gz +0 -0
- package/dist/esm/ez-toast.entry.js.gz +0 -0
- package/dist/esm/ez-tooltip.entry.js.gz +0 -0
- package/dist/esm/ez-tree.entry.js.gz +0 -0
- package/dist/esm/ez-underface.entry.js.gz +0 -0
- package/dist/esm/ez-upload.entry.js.gz +0 -0
- package/dist/esm/ez-view-stack.entry.js.gz +0 -0
- package/dist/esm/ezListHelper-00fb9b8d.js.gz +0 -0
- package/dist/esm/ezui.js.gz +0 -0
- package/dist/esm/filter-column.entry.js +6 -1
- package/dist/esm/filter-column.entry.js.gz +0 -0
- package/dist/esm/floating-ui.dom.esm-ad30f2f0.js.gz +0 -0
- package/dist/esm/index-41363fa6.js.gz +0 -0
- package/dist/esm/index-baa5e267.js.gz +0 -0
- package/dist/esm/index.js.gz +0 -0
- package/dist/esm/loader.js.gz +0 -0
- package/dist/esm/polyfills/core-js.js.gz +0 -0
- package/dist/esm/polyfills/css-shim.js.gz +0 -0
- package/dist/esm/polyfills/dom.js.gz +0 -0
- package/dist/esm/polyfills/es5-html-element.js.gz +0 -0
- package/dist/esm/polyfills/index.js.gz +0 -0
- package/dist/esm/polyfills/system.js.gz +0 -0
- package/dist/esm/{purify-04150ce3.js → purify-d55d1f11.js} +856 -228
- package/dist/esm/purify-d55d1f11.js.gz +0 -0
- package/dist/esm/search-column-c20d2b01.js.gz +0 -0
- package/dist/esm/searchFormatters-8229207e.js.gz +0 -0
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/ezui.esm.js.gz +0 -0
- package/dist/ezui/index.esm.js.gz +0 -0
- package/dist/ezui/p-02d448bb.entry.js.gz +0 -0
- package/dist/ezui/p-04126429.js.gz +0 -0
- package/dist/ezui/p-05c32903.entry.js.gz +0 -0
- package/dist/ezui/p-0f7971cf.entry.js.gz +0 -0
- package/dist/ezui/p-110cfb7d.entry.js.gz +0 -0
- package/dist/ezui/p-112455b1.js.gz +0 -0
- package/dist/ezui/p-18384b91.entry.js.gz +0 -0
- package/dist/ezui/p-1e7a8633.entry.js.gz +0 -0
- package/dist/ezui/p-1f50fa05.entry.js.gz +0 -0
- package/dist/ezui/p-20c024f7.entry.js.gz +0 -0
- package/dist/ezui/p-23a36bb6.js.gz +0 -0
- package/dist/ezui/p-2528e988.entry.js.gz +0 -0
- package/dist/ezui/p-288631d1.entry.js.gz +0 -0
- package/dist/ezui/p-2a806303.js.gz +0 -0
- package/dist/ezui/{p-a9e13b05.entry.js → p-2cc07392.entry.js} +1 -1
- package/dist/ezui/p-2cc07392.entry.js.gz +0 -0
- package/dist/ezui/p-30ffb9ed.js.gz +0 -0
- package/dist/ezui/p-34a476a9.entry.js.gz +0 -0
- package/dist/ezui/p-351fb12f.entry.js.gz +0 -0
- package/dist/ezui/p-39761eca.entry.js.gz +0 -0
- package/dist/ezui/p-3afa1c6e.entry.js.gz +0 -0
- package/dist/ezui/p-3ce867cf.entry.js.gz +0 -0
- package/dist/ezui/p-3e767a74.js.gz +0 -0
- package/dist/ezui/p-40a60148.js.gz +0 -0
- package/dist/ezui/p-411c0222.entry.js.gz +0 -0
- package/dist/ezui/p-4314f87a.entry.js.gz +0 -0
- package/dist/ezui/p-48effc69.entry.js.gz +0 -0
- package/dist/ezui/p-4d30b703.entry.js.gz +0 -0
- package/dist/ezui/p-4fe123b6.entry.js.gz +0 -0
- package/dist/ezui/p-5554704c.js.gz +0 -0
- package/dist/ezui/p-5ed81457.entry.js.gz +0 -0
- package/dist/ezui/p-6020f3d5.entry.js.gz +0 -0
- package/dist/ezui/p-62a362b4.js +3 -0
- package/dist/ezui/p-62a362b4.js.gz +0 -0
- package/dist/ezui/p-6c51ccd1.entry.js.gz +0 -0
- package/dist/ezui/p-6ca0815e.entry.js.gz +0 -0
- package/dist/ezui/p-6cb82d33.entry.js.gz +0 -0
- package/dist/ezui/p-6d596a5a.entry.js.gz +0 -0
- package/dist/ezui/p-6de4cae1.entry.js +1 -0
- package/dist/ezui/p-6de4cae1.entry.js.gz +0 -0
- package/dist/ezui/p-6f77a359.entry.js.gz +0 -0
- package/dist/ezui/p-721fd999.entry.js.gz +0 -0
- package/dist/ezui/p-7995dcb4.entry.js.gz +0 -0
- package/dist/ezui/p-7f37ee99.entry.js.gz +0 -0
- package/dist/ezui/p-7f792043.entry.js.gz +0 -0
- package/dist/ezui/p-7fe97ef5.entry.js.gz +0 -0
- package/dist/ezui/p-80dfc50b.js.gz +0 -0
- package/dist/ezui/p-859e3134.entry.js.gz +0 -0
- package/dist/ezui/p-8df1ca33.entry.js.gz +0 -0
- package/dist/ezui/p-91c9d50e.entry.js.gz +0 -0
- package/dist/ezui/p-93e1c917.entry.js.gz +0 -0
- package/dist/ezui/p-948f0fb2.entry.js.gz +0 -0
- package/dist/ezui/p-94deb71e.entry.js.gz +0 -0
- package/dist/ezui/p-967ed829.entry.js +1 -0
- package/dist/ezui/p-967ed829.entry.js.gz +0 -0
- package/dist/ezui/p-98bb8b16.js.gz +0 -0
- package/dist/ezui/p-9ab2add9.entry.js.gz +0 -0
- package/dist/ezui/p-9b215871.entry.js.gz +0 -0
- package/dist/ezui/p-9b3f3c02.entry.js.gz +0 -0
- package/dist/ezui/p-9f5fa3f9.entry.js.gz +0 -0
- package/dist/ezui/p-a0bf1fc7.entry.js.gz +0 -0
- package/dist/ezui/p-a278f26e.entry.js.gz +0 -0
- package/dist/ezui/p-a3075f52.entry.js.gz +0 -0
- package/dist/ezui/p-a3ada561.entry.js.gz +0 -0
- package/dist/ezui/p-a4083a7a.entry.js.gz +0 -0
- package/dist/ezui/p-a61fdd20.js.gz +0 -0
- package/dist/ezui/p-a63b20a0.entry.js.gz +0 -0
- package/dist/ezui/p-a80b1287.entry.js.gz +0 -0
- package/dist/ezui/p-ab574d59.js.gz +0 -0
- package/dist/ezui/p-b1e45320.js.gz +0 -0
- package/dist/ezui/p-b3d8034b.entry.js.gz +0 -0
- package/dist/ezui/p-b853763b.js.gz +0 -0
- package/dist/ezui/p-b989a33e.entry.js.gz +0 -0
- package/dist/ezui/p-baec56c9.js.gz +0 -0
- package/dist/ezui/p-bc2f844e.entry.js.gz +0 -0
- package/dist/ezui/{p-87a6feba.entry.js → p-c2d1f276.entry.js} +1 -1
- package/dist/ezui/{p-87a6feba.entry.js.gz → p-c2d1f276.entry.js.gz} +0 -0
- package/dist/ezui/p-cde41310.entry.js.gz +0 -0
- package/dist/ezui/p-ce0b36d7.entry.js.gz +0 -0
- package/dist/ezui/p-d2645bdf.entry.js.gz +0 -0
- package/dist/ezui/p-d5eb2fad.entry.js.gz +0 -0
- package/dist/ezui/p-d6742c1e.entry.js.gz +0 -0
- package/dist/ezui/p-d6bb930d.entry.js.gz +0 -0
- package/dist/ezui/p-d6f50207.entry.js.gz +0 -0
- package/dist/ezui/p-d8cc640d.entry.js.gz +0 -0
- package/dist/ezui/p-dc628ed3.js.gz +0 -0
- package/dist/ezui/p-de862af4.entry.js.gz +0 -0
- package/dist/ezui/p-dee18824.entry.js.gz +0 -0
- package/dist/ezui/p-e5de42e7.entry.js.gz +0 -0
- package/dist/ezui/p-e75c7a23.entry.js.gz +0 -0
- package/dist/ezui/p-e7a7c594.entry.js.gz +0 -0
- package/dist/ezui/p-e8c57463.entry.js.gz +0 -0
- package/dist/ezui/p-ec7db713.js.gz +0 -0
- package/dist/ezui/p-ecd6409d.entry.js.gz +0 -0
- package/dist/ezui/p-ef8bd3e8.entry.js.gz +0 -0
- package/dist/ezui/p-f00c9dc2.entry.js.gz +0 -0
- package/dist/ezui/p-f34ec732.entry.js.gz +0 -0
- package/dist/ezui/p-fa6732f2.entry.js.gz +0 -0
- package/dist/index.cjs.js.gz +0 -0
- package/dist/index.js.gz +0 -0
- package/package.json +1 -1
- package/dist/cjs/purify-29cc6f77.js.gz +0 -0
- package/dist/esm/purify-04150ce3.js.gz +0 -0
- package/dist/ezui/p-2b49aa22.entry.js +0 -1
- package/dist/ezui/p-2b49aa22.entry.js.gz +0 -0
- package/dist/ezui/p-30e4a165.js +0 -3
- package/dist/ezui/p-30e4a165.js.gz +0 -0
- package/dist/ezui/p-35bfaa88.entry.js +0 -1
- package/dist/ezui/p-35bfaa88.entry.js.gz +0 -0
- package/dist/ezui/p-a9e13b05.entry.js.gz +0 -0
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
const _commonjsHelpers = require('./_commonjsHelpers-537d719a.js');
|
|
4
4
|
|
|
5
5
|
var purify = _commonjsHelpers.createCommonjsModule(function (module, exports) {
|
|
6
|
-
/*! @license DOMPurify 3.4.
|
|
6
|
+
/*! @license DOMPurify 3.4.10 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.10/LICENSE */
|
|
7
7
|
|
|
8
8
|
(function (global, factory) {
|
|
9
9
|
module.exports = factory() ;
|
|
@@ -335,16 +335,32 @@ var purify = _commonjsHelpers.createCommonjsModule(function (module, exports) {
|
|
|
335
335
|
);
|
|
336
336
|
const DOCTYPE_NAME = seal(/^html$/i);
|
|
337
337
|
const CUSTOM_ELEMENT = seal(/^[a-z][.\w]*(-[.\w]+)+$/i);
|
|
338
|
+
// Markup-significant character probes used by _sanitizeElements.
|
|
339
|
+
// Shared module-level instances are safe despite the sticky /g flags:
|
|
340
|
+
// unapply() resets lastIndex for RegExp receivers before every call.
|
|
341
|
+
const ELEMENT_MARKUP_PROBE = seal(/<[/\w!]/g);
|
|
342
|
+
const COMMENT_MARKUP_PROBE = seal(/<[/\w]/g);
|
|
343
|
+
const FALLBACK_TAG_CLOSE = seal(/<\/no(script|embed|frames)/i);
|
|
344
|
+
const SELF_CLOSING_TAG = seal(/\/>/i);
|
|
338
345
|
|
|
339
346
|
/* eslint-disable @typescript-eslint/indent */
|
|
340
347
|
// https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType
|
|
341
348
|
const NODE_TYPE = {
|
|
342
349
|
element: 1,
|
|
350
|
+
attribute: 2,
|
|
343
351
|
text: 3,
|
|
352
|
+
cdataSection: 4,
|
|
353
|
+
entityReference: 5,
|
|
344
354
|
// Deprecated
|
|
345
|
-
|
|
355
|
+
entityNode: 6,
|
|
356
|
+
// Deprecated
|
|
357
|
+
processingInstruction: 7,
|
|
346
358
|
comment: 8,
|
|
347
|
-
document: 9
|
|
359
|
+
document: 9,
|
|
360
|
+
documentType: 10,
|
|
361
|
+
documentFragment: 11,
|
|
362
|
+
notation: 12 // Deprecated
|
|
363
|
+
};
|
|
348
364
|
const getGlobal = function getGlobal() {
|
|
349
365
|
return typeof window === 'undefined' ? null : window;
|
|
350
366
|
};
|
|
@@ -398,10 +414,25 @@ var purify = _commonjsHelpers.createCommonjsModule(function (module, exports) {
|
|
|
398
414
|
uponSanitizeShadowNode: []
|
|
399
415
|
};
|
|
400
416
|
};
|
|
417
|
+
/**
|
|
418
|
+
* Resolve a set-valued configuration option: a fresh set built from
|
|
419
|
+
* cfg[key] when it is an own array property (seeded with a clone of
|
|
420
|
+
* options.base when given, case-normalized via options.transform),
|
|
421
|
+
* the fallback set otherwise.
|
|
422
|
+
*
|
|
423
|
+
* @param cfg the cloned, prototype-free configuration object
|
|
424
|
+
* @param key the configuration property to read
|
|
425
|
+
* @param fallback the set to use when the option is absent or not an array
|
|
426
|
+
* @param options transform and optional base set to merge into
|
|
427
|
+
* @returns the resolved set
|
|
428
|
+
*/
|
|
429
|
+
const _resolveSetOption = function _resolveSetOption(cfg, key, fallback, options) {
|
|
430
|
+
return objectHasOwnProperty(cfg, key) && arrayIsArray(cfg[key]) ? addToSet(options.base ? clone(options.base) : {}, cfg[key], options.transform) : fallback;
|
|
431
|
+
};
|
|
401
432
|
function createDOMPurify() {
|
|
402
433
|
let window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();
|
|
403
434
|
const DOMPurify = root => createDOMPurify(root);
|
|
404
|
-
DOMPurify.version = '3.4.
|
|
435
|
+
DOMPurify.version = '3.4.10';
|
|
405
436
|
DOMPurify.removed = [];
|
|
406
437
|
if (!window || !window.document || window.document.nodeType !== NODE_TYPE.document || !window.Element) {
|
|
407
438
|
// Not running in a browser, provide a factory function
|
|
@@ -412,15 +443,11 @@ var purify = _commonjsHelpers.createCommonjsModule(function (module, exports) {
|
|
|
412
443
|
let document = window.document;
|
|
413
444
|
const originalDocument = document;
|
|
414
445
|
const currentScript = originalDocument.currentScript;
|
|
415
|
-
|
|
416
|
-
HTMLTemplateElement = window.HTMLTemplateElement,
|
|
446
|
+
const HTMLTemplateElement = window.HTMLTemplateElement,
|
|
417
447
|
Node = window.Node,
|
|
418
448
|
Element = window.Element,
|
|
419
|
-
NodeFilter = window.NodeFilter
|
|
420
|
-
|
|
421
|
-
NamedNodeMap = _window$NamedNodeMap === void 0 ? window.NamedNodeMap || window.MozNamedAttrMap : _window$NamedNodeMap,
|
|
422
|
-
HTMLFormElement = window.HTMLFormElement,
|
|
423
|
-
DOMParser = window.DOMParser,
|
|
449
|
+
NodeFilter = window.NodeFilter;
|
|
450
|
+
const DOMParser = window.DOMParser,
|
|
424
451
|
trustedTypes = window.trustedTypes;
|
|
425
452
|
const ElementPrototype = Element.prototype;
|
|
426
453
|
const cloneNode = lookupGetter(ElementPrototype, 'cloneNode');
|
|
@@ -428,7 +455,10 @@ var purify = _commonjsHelpers.createCommonjsModule(function (module, exports) {
|
|
|
428
455
|
const getNextSibling = lookupGetter(ElementPrototype, 'nextSibling');
|
|
429
456
|
const getChildNodes = lookupGetter(ElementPrototype, 'childNodes');
|
|
430
457
|
const getParentNode = lookupGetter(ElementPrototype, 'parentNode');
|
|
458
|
+
const getShadowRoot = lookupGetter(ElementPrototype, 'shadowRoot');
|
|
459
|
+
const getAttributes = lookupGetter(ElementPrototype, 'attributes');
|
|
431
460
|
const getNodeType = Node && Node.prototype ? lookupGetter(Node.prototype, 'nodeType') : null;
|
|
461
|
+
const getNodeName = Node && Node.prototype ? lookupGetter(Node.prototype, 'nodeName') : null;
|
|
432
462
|
// As per issue #47, the web-components registry is inherited by a
|
|
433
463
|
// new document created via createHTMLDocument. As per the spec
|
|
434
464
|
// (http://w3c.github.io/webcomponents/spec/custom/#creating-and-passing-registries)
|
|
@@ -443,6 +473,54 @@ var purify = _commonjsHelpers.createCommonjsModule(function (module, exports) {
|
|
|
443
473
|
}
|
|
444
474
|
let trustedTypesPolicy;
|
|
445
475
|
let emptyHTML = '';
|
|
476
|
+
// The instance's own internal Trusted Types policy. Unlike a caller-supplied
|
|
477
|
+
// `TRUSTED_TYPES_POLICY`, this is created at most once — Trusted Types throws
|
|
478
|
+
// on duplicate policy names — and is the only policy allowed to persist
|
|
479
|
+
// across configurations and survive `clearConfig()`.
|
|
480
|
+
let defaultTrustedTypesPolicy;
|
|
481
|
+
let defaultTrustedTypesPolicyResolved = false;
|
|
482
|
+
// Tracks whether we are already inside a call to the configured Trusted Types
|
|
483
|
+
// policy (`createHTML` or `createScriptURL`). If a supplied policy callback
|
|
484
|
+
// itself calls `DOMPurify.sanitize` (the cause of #1422), `sanitize` would
|
|
485
|
+
// re-enter the policy and recurse until the stack overflows. We detect that
|
|
486
|
+
// re-entry and throw a clear, actionable error instead. The guard is shared
|
|
487
|
+
// across both callbacks, because either one re-entering `sanitize` triggers
|
|
488
|
+
// the same unbounded recursion.
|
|
489
|
+
let IN_TRUSTED_TYPES_POLICY = 0;
|
|
490
|
+
const _assertNotInTrustedTypesPolicy = function _assertNotInTrustedTypesPolicy() {
|
|
491
|
+
if (IN_TRUSTED_TYPES_POLICY > 0) {
|
|
492
|
+
throw typeErrorCreate('A configured TRUSTED_TYPES_POLICY callback (createHTML or ' + 'createScriptURL) must not call DOMPurify.sanitize, as that causes ' + 'infinite recursion. Do not pass a policy whose callbacks wrap ' + 'DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted ' + 'Types" section of the README.');
|
|
493
|
+
}
|
|
494
|
+
};
|
|
495
|
+
const _createTrustedHTML = function _createTrustedHTML(html) {
|
|
496
|
+
_assertNotInTrustedTypesPolicy();
|
|
497
|
+
IN_TRUSTED_TYPES_POLICY++;
|
|
498
|
+
try {
|
|
499
|
+
return trustedTypesPolicy.createHTML(html);
|
|
500
|
+
} finally {
|
|
501
|
+
IN_TRUSTED_TYPES_POLICY--;
|
|
502
|
+
}
|
|
503
|
+
};
|
|
504
|
+
const _createTrustedScriptURL = function _createTrustedScriptURL(scriptUrl) {
|
|
505
|
+
_assertNotInTrustedTypesPolicy();
|
|
506
|
+
IN_TRUSTED_TYPES_POLICY++;
|
|
507
|
+
try {
|
|
508
|
+
return trustedTypesPolicy.createScriptURL(scriptUrl);
|
|
509
|
+
} finally {
|
|
510
|
+
IN_TRUSTED_TYPES_POLICY--;
|
|
511
|
+
}
|
|
512
|
+
};
|
|
513
|
+
// Lazily resolve (and cache) the instance's internal default policy.
|
|
514
|
+
// Resolution is attempted at most once: a successful `createPolicy` cannot be
|
|
515
|
+
// repeated (Trusted Types throws on duplicate names), and a failed or
|
|
516
|
+
// unsupported attempt must not be retried on every parse.
|
|
517
|
+
const _getDefaultTrustedTypesPolicy = function _getDefaultTrustedTypesPolicy() {
|
|
518
|
+
if (!defaultTrustedTypesPolicyResolved) {
|
|
519
|
+
defaultTrustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript);
|
|
520
|
+
defaultTrustedTypesPolicyResolved = true;
|
|
521
|
+
}
|
|
522
|
+
return defaultTrustedTypesPolicy;
|
|
523
|
+
};
|
|
446
524
|
const _document = document,
|
|
447
525
|
implementation = _document.implementation,
|
|
448
526
|
createNodeIterator = _document.createNodeIterator,
|
|
@@ -581,7 +659,17 @@ var purify = _commonjsHelpers.createCommonjsModule(function (module, exports) {
|
|
|
581
659
|
let USE_PROFILES = {};
|
|
582
660
|
/* Tags to ignore content of when KEEP_CONTENT is true */
|
|
583
661
|
let FORBID_CONTENTS = null;
|
|
584
|
-
const DEFAULT_FORBID_CONTENTS = addToSet({}, ['annotation-xml', 'audio', 'colgroup', 'desc', 'foreignobject', 'head', 'iframe', 'math', 'mi', 'mn', 'mo', 'ms', 'mtext', 'noembed', 'noframes', 'noscript', 'plaintext', 'script',
|
|
662
|
+
const DEFAULT_FORBID_CONTENTS = addToSet({}, ['annotation-xml', 'audio', 'colgroup', 'desc', 'foreignobject', 'head', 'iframe', 'math', 'mi', 'mn', 'mo', 'ms', 'mtext', 'noembed', 'noframes', 'noscript', 'plaintext', 'script',
|
|
663
|
+
// <selectedcontent> mirrors the selected <option>'s subtree, cloned by
|
|
664
|
+
// the UA (customizable <select>) — including any on* handlers — and the
|
|
665
|
+
// engine re-mirrors synchronously whenever a removal changes which
|
|
666
|
+
// option/selectedcontent is current, even inside DOMPurify's inert
|
|
667
|
+
// DOMParser document. Hoisting its children on removal re-inserts a fresh
|
|
668
|
+
// mirror target ahead of the walk, which the engine refills, looping
|
|
669
|
+
// forever (DoS) and amplifying output. Dropping its content on removal
|
|
670
|
+
// (rather than hoisting) breaks that cascade; the content is a duplicate
|
|
671
|
+
// of the option, which is sanitized on its own. See campaign-3 F1/F6.
|
|
672
|
+
'selectedcontent', 'style', 'svg', 'template', 'thead', 'title', 'video', 'xmp']);
|
|
585
673
|
/* Tags that are safe for data: URIs */
|
|
586
674
|
let DATA_URI_TAGS = null;
|
|
587
675
|
const DEFAULT_DATA_URI_TAGS = addToSet({}, ['audio', 'video', 'img', 'source', 'image', 'track']);
|
|
@@ -597,8 +685,10 @@ var purify = _commonjsHelpers.createCommonjsModule(function (module, exports) {
|
|
|
597
685
|
/* Allowed XHTML+XML namespaces */
|
|
598
686
|
let ALLOWED_NAMESPACES = null;
|
|
599
687
|
const DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE], stringToString);
|
|
600
|
-
|
|
601
|
-
let
|
|
688
|
+
const DEFAULT_MATHML_TEXT_INTEGRATION_POINTS = freeze(['mi', 'mo', 'mn', 'ms', 'mtext']);
|
|
689
|
+
let MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, DEFAULT_MATHML_TEXT_INTEGRATION_POINTS);
|
|
690
|
+
const DEFAULT_HTML_INTEGRATION_POINTS = freeze(['annotation-xml']);
|
|
691
|
+
let HTML_INTEGRATION_POINTS = addToSet({}, DEFAULT_HTML_INTEGRATION_POINTS);
|
|
602
692
|
// Certain elements are allowed in both SVG and HTML
|
|
603
693
|
// namespace. We need to specify them explicitly
|
|
604
694
|
// so that they don't get erroneously deleted from
|
|
@@ -640,14 +730,32 @@ var purify = _commonjsHelpers.createCommonjsModule(function (module, exports) {
|
|
|
640
730
|
// HTML tags and attributes are not case-sensitive, converting to lowercase. Keeping XHTML as is.
|
|
641
731
|
transformCaseFunc = PARSER_MEDIA_TYPE === 'application/xhtml+xml' ? stringToString : stringToLowerCase;
|
|
642
732
|
/* Set configuration parameters */
|
|
643
|
-
ALLOWED_TAGS =
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
733
|
+
ALLOWED_TAGS = _resolveSetOption(cfg, 'ALLOWED_TAGS', DEFAULT_ALLOWED_TAGS, {
|
|
734
|
+
transform: transformCaseFunc
|
|
735
|
+
});
|
|
736
|
+
ALLOWED_ATTR = _resolveSetOption(cfg, 'ALLOWED_ATTR', DEFAULT_ALLOWED_ATTR, {
|
|
737
|
+
transform: transformCaseFunc
|
|
738
|
+
});
|
|
739
|
+
ALLOWED_NAMESPACES = _resolveSetOption(cfg, 'ALLOWED_NAMESPACES', DEFAULT_ALLOWED_NAMESPACES, {
|
|
740
|
+
transform: stringToString
|
|
741
|
+
});
|
|
742
|
+
URI_SAFE_ATTRIBUTES = _resolveSetOption(cfg, 'ADD_URI_SAFE_ATTR', DEFAULT_URI_SAFE_ATTRIBUTES, {
|
|
743
|
+
transform: transformCaseFunc,
|
|
744
|
+
base: DEFAULT_URI_SAFE_ATTRIBUTES
|
|
745
|
+
});
|
|
746
|
+
DATA_URI_TAGS = _resolveSetOption(cfg, 'ADD_DATA_URI_TAGS', DEFAULT_DATA_URI_TAGS, {
|
|
747
|
+
transform: transformCaseFunc,
|
|
748
|
+
base: DEFAULT_DATA_URI_TAGS
|
|
749
|
+
});
|
|
750
|
+
FORBID_CONTENTS = _resolveSetOption(cfg, 'FORBID_CONTENTS', DEFAULT_FORBID_CONTENTS, {
|
|
751
|
+
transform: transformCaseFunc
|
|
752
|
+
});
|
|
753
|
+
FORBID_TAGS = _resolveSetOption(cfg, 'FORBID_TAGS', clone({}), {
|
|
754
|
+
transform: transformCaseFunc
|
|
755
|
+
});
|
|
756
|
+
FORBID_ATTR = _resolveSetOption(cfg, 'FORBID_ATTR', clone({}), {
|
|
757
|
+
transform: transformCaseFunc
|
|
758
|
+
});
|
|
651
759
|
USE_PROFILES = objectHasOwnProperty(cfg, 'USE_PROFILES') ? cfg.USE_PROFILES && typeof cfg.USE_PROFILES === 'object' ? clone(cfg.USE_PROFILES) : cfg.USE_PROFILES : false;
|
|
652
760
|
ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; // Default true
|
|
653
761
|
ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; // Default true
|
|
@@ -666,8 +774,8 @@ var purify = _commonjsHelpers.createCommonjsModule(function (module, exports) {
|
|
|
666
774
|
IN_PLACE = cfg.IN_PLACE || false; // Default false
|
|
667
775
|
IS_ALLOWED_URI$1 = isRegex(cfg.ALLOWED_URI_REGEXP) ? cfg.ALLOWED_URI_REGEXP : IS_ALLOWED_URI; // Default regexp
|
|
668
776
|
NAMESPACE = typeof cfg.NAMESPACE === 'string' ? cfg.NAMESPACE : HTML_NAMESPACE; // Default HTML namespace
|
|
669
|
-
MATHML_TEXT_INTEGRATION_POINTS = objectHasOwnProperty(cfg, 'MATHML_TEXT_INTEGRATION_POINTS') && cfg.MATHML_TEXT_INTEGRATION_POINTS && typeof cfg.MATHML_TEXT_INTEGRATION_POINTS === 'object' ? clone(cfg.MATHML_TEXT_INTEGRATION_POINTS) : addToSet({},
|
|
670
|
-
HTML_INTEGRATION_POINTS = objectHasOwnProperty(cfg, 'HTML_INTEGRATION_POINTS') && cfg.HTML_INTEGRATION_POINTS && typeof cfg.HTML_INTEGRATION_POINTS === 'object' ? clone(cfg.HTML_INTEGRATION_POINTS) : addToSet({},
|
|
777
|
+
MATHML_TEXT_INTEGRATION_POINTS = objectHasOwnProperty(cfg, 'MATHML_TEXT_INTEGRATION_POINTS') && cfg.MATHML_TEXT_INTEGRATION_POINTS && typeof cfg.MATHML_TEXT_INTEGRATION_POINTS === 'object' ? clone(cfg.MATHML_TEXT_INTEGRATION_POINTS) : addToSet({}, DEFAULT_MATHML_TEXT_INTEGRATION_POINTS); // Default built-in map
|
|
778
|
+
HTML_INTEGRATION_POINTS = objectHasOwnProperty(cfg, 'HTML_INTEGRATION_POINTS') && cfg.HTML_INTEGRATION_POINTS && typeof cfg.HTML_INTEGRATION_POINTS === 'object' ? clone(cfg.HTML_INTEGRATION_POINTS) : addToSet({}, DEFAULT_HTML_INTEGRATION_POINTS); // Default built-in map
|
|
671
779
|
const customElementHandling = objectHasOwnProperty(cfg, 'CUSTOM_ELEMENT_HANDLING') && cfg.CUSTOM_ELEMENT_HANDLING && typeof cfg.CUSTOM_ELEMENT_HANDLING === 'object' ? clone(cfg.CUSTOM_ELEMENT_HANDLING) : create(null);
|
|
672
780
|
CUSTOM_ELEMENT_HANDLING = create(null);
|
|
673
781
|
if (objectHasOwnProperty(customElementHandling, 'tagNameCheck') && isRegexOrFunction(customElementHandling.tagNameCheck)) {
|
|
@@ -679,6 +787,7 @@ var purify = _commonjsHelpers.createCommonjsModule(function (module, exports) {
|
|
|
679
787
|
if (objectHasOwnProperty(customElementHandling, 'allowCustomizedBuiltInElements') && typeof customElementHandling.allowCustomizedBuiltInElements === 'boolean') {
|
|
680
788
|
CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = customElementHandling.allowCustomizedBuiltInElements; // Default undefined
|
|
681
789
|
}
|
|
790
|
+
seal(CUSTOM_ELEMENT_HANDLING);
|
|
682
791
|
if (SAFE_FOR_TEMPLATES) {
|
|
683
792
|
ALLOW_DATA_ATTR = false;
|
|
684
793
|
}
|
|
@@ -762,6 +871,13 @@ var purify = _commonjsHelpers.createCommonjsModule(function (module, exports) {
|
|
|
762
871
|
addToSet(ALLOWED_TAGS, ['tbody']);
|
|
763
872
|
delete FORBID_TAGS.tbody;
|
|
764
873
|
}
|
|
874
|
+
// Re-derive the active Trusted Types policy from this configuration on
|
|
875
|
+
// every parse. The active policy must never be sticky closure state that
|
|
876
|
+
// outlives the config that set it: a caller-supplied policy left in place
|
|
877
|
+
// after `clearConfig()` — or after a later call that supplied none, or
|
|
878
|
+
// `TRUSTED_TYPES_POLICY: null` — could sign a subsequent "default"
|
|
879
|
+
// `RETURN_TRUSTED_TYPE` result with a foreign, possibly unsafe policy.
|
|
880
|
+
// See GHSA-vxr8-fq34-vvx9.
|
|
765
881
|
if (cfg.TRUSTED_TYPES_POLICY) {
|
|
766
882
|
if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== 'function') {
|
|
767
883
|
throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
|
@@ -769,20 +885,62 @@ var purify = _commonjsHelpers.createCommonjsModule(function (module, exports) {
|
|
|
769
885
|
if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== 'function') {
|
|
770
886
|
throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
|
|
771
887
|
}
|
|
772
|
-
//
|
|
888
|
+
// A caller-supplied policy applies to this configuration only.
|
|
889
|
+
const previousTrustedTypesPolicy = trustedTypesPolicy;
|
|
773
890
|
trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY;
|
|
774
|
-
// Sign local variables required by `sanitize`.
|
|
775
|
-
|
|
891
|
+
// Sign local variables required by `sanitize`. If the supplied policy's
|
|
892
|
+
// `createHTML` is circular (i.e. it calls `DOMPurify.sanitize`), this
|
|
893
|
+
// throws via the re-entrancy guard. Restore the previous policy first so
|
|
894
|
+
// the instance is not left in a poisoned state. See #1422.
|
|
895
|
+
try {
|
|
896
|
+
emptyHTML = _createTrustedHTML('');
|
|
897
|
+
} catch (error) {
|
|
898
|
+
trustedTypesPolicy = previousTrustedTypesPolicy;
|
|
899
|
+
throw error;
|
|
900
|
+
}
|
|
901
|
+
} else if (cfg.TRUSTED_TYPES_POLICY === null) {
|
|
902
|
+
// Explicit opt-out for this call: perform no Trusted Types signing and
|
|
903
|
+
// create nothing (so a strict `trusted-types` CSP that disallows a
|
|
904
|
+
// `dompurify` policy can still call `sanitize` from inside its own
|
|
905
|
+
// policy — see #1422). Resetting to `undefined` rather than a sticky
|
|
906
|
+
// `null` also drops any previously retained caller policy, so it cannot
|
|
907
|
+
// resurface on a later call, while still allowing the next config-less
|
|
908
|
+
// call to restore the internal default policy. See GHSA-vxr8-fq34-vvx9.
|
|
909
|
+
trustedTypesPolicy = undefined;
|
|
910
|
+
emptyHTML = '';
|
|
776
911
|
} else {
|
|
777
|
-
//
|
|
912
|
+
// No policy supplied: keep the currently active policy if one is set — a
|
|
913
|
+
// previously supplied policy is intentionally sticky across config-less
|
|
914
|
+
// calls — otherwise fall back to the instance's own internal policy,
|
|
915
|
+
// created at most once. (A policy supplied for a *single* call still
|
|
916
|
+
// lingers by design; what must not linger is a policy whose configuration
|
|
917
|
+
// has been torn down via `clearConfig()`, which restores the default.)
|
|
778
918
|
if (trustedTypesPolicy === undefined) {
|
|
779
|
-
trustedTypesPolicy =
|
|
919
|
+
trustedTypesPolicy = _getDefaultTrustedTypesPolicy();
|
|
780
920
|
}
|
|
781
|
-
//
|
|
782
|
-
|
|
783
|
-
|
|
921
|
+
// Sign internal variables only when a policy is active. A falsy policy
|
|
922
|
+
// (Trusted Types unsupported, creation failed, or an explicit opt-out)
|
|
923
|
+
// leaves `emptyHTML` as a plain string, so we never call `.createHTML` on
|
|
924
|
+
// a non-policy and throw. See #1422.
|
|
925
|
+
if (trustedTypesPolicy && typeof emptyHTML === 'string') {
|
|
926
|
+
emptyHTML = _createTrustedHTML('');
|
|
784
927
|
}
|
|
785
928
|
}
|
|
929
|
+
/*
|
|
930
|
+
* Mirror the clone-before-mutate pattern already applied above for
|
|
931
|
+
* cfg.ADD_TAGS / cfg.ADD_ATTR: if any uponSanitize* hook is
|
|
932
|
+
* registered AND the set still points at the default constant,
|
|
933
|
+
* clone it. The hook then mutates the clone (in-call widening
|
|
934
|
+
* still works exactly as documented) and the next default-cfg
|
|
935
|
+
* call rebinds to the untouched original via the reassignment at
|
|
936
|
+
* the top of this function.
|
|
937
|
+
*/
|
|
938
|
+
if ((hooks.uponSanitizeElement.length > 0 || hooks.uponSanitizeAttribute.length > 0) && ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {
|
|
939
|
+
ALLOWED_TAGS = clone(ALLOWED_TAGS);
|
|
940
|
+
}
|
|
941
|
+
if (hooks.uponSanitizeAttribute.length > 0 && ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {
|
|
942
|
+
ALLOWED_ATTR = clone(ALLOWED_ATTR);
|
|
943
|
+
}
|
|
786
944
|
// Prevent further manipulation of configuration.
|
|
787
945
|
// Not available in IE8, Safari 5, etc.
|
|
788
946
|
if (freeze) {
|
|
@@ -795,6 +953,77 @@ var purify = _commonjsHelpers.createCommonjsModule(function (module, exports) {
|
|
|
795
953
|
* correctly. */
|
|
796
954
|
const ALL_SVG_TAGS = addToSet({}, [...svg$1, ...svgFilters, ...svgDisallowed]);
|
|
797
955
|
const ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]);
|
|
956
|
+
/**
|
|
957
|
+
* Namespace rules for an element in the SVG namespace.
|
|
958
|
+
*
|
|
959
|
+
* @param tagName the element's lowercase tag name
|
|
960
|
+
* @param parent the (possibly simulated) parent node
|
|
961
|
+
* @param parentTagName the parent's lowercase tag name
|
|
962
|
+
* @returns true if a spec-compliant parser could produce this element
|
|
963
|
+
*/
|
|
964
|
+
const _checkSvgNamespace = function _checkSvgNamespace(tagName, parent, parentTagName) {
|
|
965
|
+
// The only way to switch from HTML namespace to SVG
|
|
966
|
+
// is via <svg>. If it happens via any other tag, then
|
|
967
|
+
// it should be killed.
|
|
968
|
+
if (parent.namespaceURI === HTML_NAMESPACE) {
|
|
969
|
+
return tagName === 'svg';
|
|
970
|
+
}
|
|
971
|
+
// The only way to switch from MathML to SVG is via <svg>
|
|
972
|
+
// if the parent is either <annotation-xml> or a MathML
|
|
973
|
+
// text integration point.
|
|
974
|
+
if (parent.namespaceURI === MATHML_NAMESPACE) {
|
|
975
|
+
return tagName === 'svg' && (parentTagName === 'annotation-xml' || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);
|
|
976
|
+
}
|
|
977
|
+
// We only allow elements that are defined in SVG
|
|
978
|
+
// spec. All others are disallowed in SVG namespace.
|
|
979
|
+
return Boolean(ALL_SVG_TAGS[tagName]);
|
|
980
|
+
};
|
|
981
|
+
/**
|
|
982
|
+
* Namespace rules for an element in the MathML namespace.
|
|
983
|
+
*
|
|
984
|
+
* @param tagName the element's lowercase tag name
|
|
985
|
+
* @param parent the (possibly simulated) parent node
|
|
986
|
+
* @param parentTagName the parent's lowercase tag name
|
|
987
|
+
* @returns true if a spec-compliant parser could produce this element
|
|
988
|
+
*/
|
|
989
|
+
const _checkMathMlNamespace = function _checkMathMlNamespace(tagName, parent, parentTagName) {
|
|
990
|
+
// The only way to switch from HTML namespace to MathML
|
|
991
|
+
// is via <math>. If it happens via any other tag, then
|
|
992
|
+
// it should be killed.
|
|
993
|
+
if (parent.namespaceURI === HTML_NAMESPACE) {
|
|
994
|
+
return tagName === 'math';
|
|
995
|
+
}
|
|
996
|
+
// The only way to switch from SVG to MathML is via
|
|
997
|
+
// <math> and HTML integration points
|
|
998
|
+
if (parent.namespaceURI === SVG_NAMESPACE) {
|
|
999
|
+
return tagName === 'math' && HTML_INTEGRATION_POINTS[parentTagName];
|
|
1000
|
+
}
|
|
1001
|
+
// We only allow elements that are defined in MathML
|
|
1002
|
+
// spec. All others are disallowed in MathML namespace.
|
|
1003
|
+
return Boolean(ALL_MATHML_TAGS[tagName]);
|
|
1004
|
+
};
|
|
1005
|
+
/**
|
|
1006
|
+
* Namespace rules for an element in the HTML namespace.
|
|
1007
|
+
*
|
|
1008
|
+
* @param tagName the element's lowercase tag name
|
|
1009
|
+
* @param parent the (possibly simulated) parent node
|
|
1010
|
+
* @param parentTagName the parent's lowercase tag name
|
|
1011
|
+
* @returns true if a spec-compliant parser could produce this element
|
|
1012
|
+
*/
|
|
1013
|
+
const _checkHtmlNamespace = function _checkHtmlNamespace(tagName, parent, parentTagName) {
|
|
1014
|
+
// The only way to switch from SVG to HTML is via
|
|
1015
|
+
// HTML integration points, and from MathML to HTML
|
|
1016
|
+
// is via MathML text integration points
|
|
1017
|
+
if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) {
|
|
1018
|
+
return false;
|
|
1019
|
+
}
|
|
1020
|
+
if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) {
|
|
1021
|
+
return false;
|
|
1022
|
+
}
|
|
1023
|
+
// We disallow tags that are specific for MathML
|
|
1024
|
+
// or SVG and should never appear in HTML namespace
|
|
1025
|
+
return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]);
|
|
1026
|
+
};
|
|
798
1027
|
/**
|
|
799
1028
|
* @param element a DOM element whose namespace is being checked
|
|
800
1029
|
* @returns Return false if the element has a
|
|
@@ -817,51 +1046,13 @@ var purify = _commonjsHelpers.createCommonjsModule(function (module, exports) {
|
|
|
817
1046
|
return false;
|
|
818
1047
|
}
|
|
819
1048
|
if (element.namespaceURI === SVG_NAMESPACE) {
|
|
820
|
-
|
|
821
|
-
// is via <svg>. If it happens via any other tag, then
|
|
822
|
-
// it should be killed.
|
|
823
|
-
if (parent.namespaceURI === HTML_NAMESPACE) {
|
|
824
|
-
return tagName === 'svg';
|
|
825
|
-
}
|
|
826
|
-
// The only way to switch from MathML to SVG is via`
|
|
827
|
-
// svg if parent is either <annotation-xml> or MathML
|
|
828
|
-
// text integration points.
|
|
829
|
-
if (parent.namespaceURI === MATHML_NAMESPACE) {
|
|
830
|
-
return tagName === 'svg' && (parentTagName === 'annotation-xml' || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);
|
|
831
|
-
}
|
|
832
|
-
// We only allow elements that are defined in SVG
|
|
833
|
-
// spec. All others are disallowed in SVG namespace.
|
|
834
|
-
return Boolean(ALL_SVG_TAGS[tagName]);
|
|
1049
|
+
return _checkSvgNamespace(tagName, parent, parentTagName);
|
|
835
1050
|
}
|
|
836
1051
|
if (element.namespaceURI === MATHML_NAMESPACE) {
|
|
837
|
-
|
|
838
|
-
// is via <math>. If it happens via any other tag, then
|
|
839
|
-
// it should be killed.
|
|
840
|
-
if (parent.namespaceURI === HTML_NAMESPACE) {
|
|
841
|
-
return tagName === 'math';
|
|
842
|
-
}
|
|
843
|
-
// The only way to switch from SVG to MathML is via
|
|
844
|
-
// <math> and HTML integration points
|
|
845
|
-
if (parent.namespaceURI === SVG_NAMESPACE) {
|
|
846
|
-
return tagName === 'math' && HTML_INTEGRATION_POINTS[parentTagName];
|
|
847
|
-
}
|
|
848
|
-
// We only allow elements that are defined in MathML
|
|
849
|
-
// spec. All others are disallowed in MathML namespace.
|
|
850
|
-
return Boolean(ALL_MATHML_TAGS[tagName]);
|
|
1052
|
+
return _checkMathMlNamespace(tagName, parent, parentTagName);
|
|
851
1053
|
}
|
|
852
1054
|
if (element.namespaceURI === HTML_NAMESPACE) {
|
|
853
|
-
|
|
854
|
-
// HTML integration points, and from MathML to HTML
|
|
855
|
-
// is via MathML text integration points
|
|
856
|
-
if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) {
|
|
857
|
-
return false;
|
|
858
|
-
}
|
|
859
|
-
if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) {
|
|
860
|
-
return false;
|
|
861
|
-
}
|
|
862
|
-
// We disallow tags that are specific for MathML
|
|
863
|
-
// or SVG and should never appear in HTML namespace
|
|
864
|
-
return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]);
|
|
1055
|
+
return _checkHtmlNamespace(tagName, parent, parentTagName);
|
|
865
1056
|
}
|
|
866
1057
|
// For XHTML and XML documents that support custom namespaces
|
|
867
1058
|
if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && ALLOWED_NAMESPACES[element.namespaceURI]) {
|
|
@@ -886,7 +1077,74 @@ var purify = _commonjsHelpers.createCommonjsModule(function (module, exports) {
|
|
|
886
1077
|
// eslint-disable-next-line unicorn/prefer-dom-node-remove
|
|
887
1078
|
getParentNode(node).removeChild(node);
|
|
888
1079
|
} catch (_) {
|
|
1080
|
+
/* The normal detach failed — this is reached for a parentless node
|
|
1081
|
+
(getParentNode() is null, so .removeChild throws). Element.prototype
|
|
1082
|
+
.remove() is itself a spec no-op on a parentless node, so a recorded
|
|
1083
|
+
"removal" would otherwise hand the caller back an intact,
|
|
1084
|
+
payload-bearing node (e.g. a detached IN_PLACE root the mXSS canary or
|
|
1085
|
+
the style-with-element-child rule decided to kill). Fail closed by
|
|
1086
|
+
throwing — exactly as a clobbered root does at the IN_PLACE entry —
|
|
1087
|
+
rather than trying to "neutralize" the node via its own methods.
|
|
1088
|
+
Neutralizing would mean calling getAttributeNames()/removeAttribute()
|
|
1089
|
+
on the node, both of which a <form> root can clobber via a named child
|
|
1090
|
+
(and _isClobbered does not even probe getAttributeNames), so the
|
|
1091
|
+
neutralize step could itself be silently defeated, leaving the payload
|
|
1092
|
+
intact. A throw touches only the cached, clobber-safe remove() and
|
|
1093
|
+
getParentNode(). Generalizes GHSA-r47g-fvhr-h676 (clobbered-form root)
|
|
1094
|
+
to every root-kill reason. REPORT-3.
|
|
1095
|
+
This lives inside the catch, so it never fires for a normally-removed
|
|
1096
|
+
in-tree node: those have a parent, removeChild() succeeds, and the
|
|
1097
|
+
catch is not entered. Only a kept (parentless) root reaches here. */
|
|
889
1098
|
remove(node);
|
|
1099
|
+
if (!getParentNode(node)) {
|
|
1100
|
+
throw typeErrorCreate('a node selected for removal could not be detached from its tree ' + 'and cannot be safely returned; refusing to sanitize in place');
|
|
1101
|
+
}
|
|
1102
|
+
}
|
|
1103
|
+
};
|
|
1104
|
+
/**
|
|
1105
|
+
* _neutralizeRoot
|
|
1106
|
+
*
|
|
1107
|
+
* Fail-closed teardown of an in-place root after the sanitize walk aborts
|
|
1108
|
+
* (campaign-3 F2). An internal throw mid-walk — e.g. a page-registered
|
|
1109
|
+
* custom element's reaction detaches a node so `_forceRemove`'s deliberate
|
|
1110
|
+
* parentless guard throws, or any other re-entrant engine mutation — would
|
|
1111
|
+
* otherwise leave the caller's *live* tree half-sanitized, with everything
|
|
1112
|
+
* after the abort point still carrying its handlers. There is no safe way
|
|
1113
|
+
* to resume the walk (the tree mutated under us), so we strip the root bare:
|
|
1114
|
+
* remove every child and every attribute, then let the caller's catch see
|
|
1115
|
+
* the original error. Clobber-safe (cached `remove`/`childNodes`/`attributes`
|
|
1116
|
+
* getters; the root was already clobber-pre-flighted at the IN_PLACE entry).
|
|
1117
|
+
*
|
|
1118
|
+
* @param root the in-place root to empty
|
|
1119
|
+
*/
|
|
1120
|
+
const _neutralizeRoot = function _neutralizeRoot(root) {
|
|
1121
|
+
const childNodes = getChildNodes(root);
|
|
1122
|
+
if (childNodes) {
|
|
1123
|
+
const snapshot = [];
|
|
1124
|
+
arrayForEach(childNodes, child => {
|
|
1125
|
+
arrayPush(snapshot, child);
|
|
1126
|
+
});
|
|
1127
|
+
arrayForEach(snapshot, child => {
|
|
1128
|
+
try {
|
|
1129
|
+
remove(child);
|
|
1130
|
+
} catch (_) {
|
|
1131
|
+
/* Best-effort teardown; a still-attached child is handled below */
|
|
1132
|
+
}
|
|
1133
|
+
});
|
|
1134
|
+
}
|
|
1135
|
+
const attributes = getAttributes(root);
|
|
1136
|
+
if (attributes) {
|
|
1137
|
+
for (let i = attributes.length - 1; i >= 0; --i) {
|
|
1138
|
+
const attribute = attributes[i];
|
|
1139
|
+
const name = attribute && attribute.name;
|
|
1140
|
+
if (typeof name === 'string') {
|
|
1141
|
+
try {
|
|
1142
|
+
root.removeAttribute(name);
|
|
1143
|
+
} catch (_) {
|
|
1144
|
+
/* Clobbered removeAttribute — ignore (fail-closed best effort) */
|
|
1145
|
+
}
|
|
1146
|
+
}
|
|
1147
|
+
}
|
|
890
1148
|
}
|
|
891
1149
|
};
|
|
892
1150
|
/**
|
|
@@ -921,6 +1179,72 @@ var purify = _commonjsHelpers.createCommonjsModule(function (module, exports) {
|
|
|
921
1179
|
}
|
|
922
1180
|
}
|
|
923
1181
|
};
|
|
1182
|
+
/**
|
|
1183
|
+
* _stripDisallowedAttributes
|
|
1184
|
+
*
|
|
1185
|
+
* Removes every attribute the active configuration does not allow from a
|
|
1186
|
+
* single element, using the same allowlist as the main attribute pass (so
|
|
1187
|
+
* `on*` handlers go, but no `/^on/` blocklist is introduced). Used only to
|
|
1188
|
+
* neutralise nodes that are being discarded from an in-place tree.
|
|
1189
|
+
*
|
|
1190
|
+
* @param element the element to strip
|
|
1191
|
+
*/
|
|
1192
|
+
const _stripDisallowedAttributes = function _stripDisallowedAttributes(element) {
|
|
1193
|
+
const attributes = getAttributes(element);
|
|
1194
|
+
if (!attributes) {
|
|
1195
|
+
return;
|
|
1196
|
+
}
|
|
1197
|
+
for (let i = attributes.length - 1; i >= 0; --i) {
|
|
1198
|
+
const attribute = attributes[i];
|
|
1199
|
+
const name = attribute && attribute.name;
|
|
1200
|
+
if (typeof name !== 'string' || ALLOWED_ATTR[transformCaseFunc(name)]) {
|
|
1201
|
+
continue;
|
|
1202
|
+
}
|
|
1203
|
+
try {
|
|
1204
|
+
element.removeAttribute(name);
|
|
1205
|
+
} catch (_) {
|
|
1206
|
+
/* Clobbered removeAttribute on a doomed node — ignore */
|
|
1207
|
+
}
|
|
1208
|
+
}
|
|
1209
|
+
};
|
|
1210
|
+
/**
|
|
1211
|
+
* _neutralizeSubtree
|
|
1212
|
+
*
|
|
1213
|
+
* Completes the audit-5 F1 fix across every removal path. The KEEP_CONTENT
|
|
1214
|
+
* move-hoist neutralises only disallowed-tag removals; clobber, mXSS-canary,
|
|
1215
|
+
* namespace, comment, processing-instruction and KEEP_CONTENT:false removals
|
|
1216
|
+
* all drop their subtree wholesale via `_forceRemove`. On the IN_PLACE path
|
|
1217
|
+
* those dropped nodes are detached from the caller's LIVE tree but a
|
|
1218
|
+
* handler-bearing original among them (an `<img onerror>`/`<video>` that was
|
|
1219
|
+
* loading) keeps its queued resource event, which fires in page scope after
|
|
1220
|
+
* sanitize returns. This walks a removed subtree and strips every attribute
|
|
1221
|
+
* the active configuration does not allow — so `on*` handlers are cancelled
|
|
1222
|
+
* through the SAME allowlist that governs kept nodes, not a separate `/^on/`
|
|
1223
|
+
* blocklist. Run synchronously before sanitize returns, i.e. before any
|
|
1224
|
+
* queued event can fire. Hook-free by design: these nodes leave the output,
|
|
1225
|
+
* so firing attribute hooks for them would be surprising. Clobber-safe reads;
|
|
1226
|
+
* a doomed clobbered node may shadow `removeAttribute` (its own attributes are
|
|
1227
|
+
* irrelevant — it is discarded — while its non-clobbered descendants, e.g.
|
|
1228
|
+
* the `<img>`, are reached and scrubbed).
|
|
1229
|
+
*
|
|
1230
|
+
* @param root the root of a removed subtree to neutralise
|
|
1231
|
+
*/
|
|
1232
|
+
const _neutralizeSubtree = function _neutralizeSubtree(root) {
|
|
1233
|
+
const stack = [root];
|
|
1234
|
+
while (stack.length > 0) {
|
|
1235
|
+
const node = stack.pop();
|
|
1236
|
+
const nodeType = getNodeType ? getNodeType(node) : node.nodeType;
|
|
1237
|
+
if (nodeType === NODE_TYPE.element) {
|
|
1238
|
+
_stripDisallowedAttributes(node);
|
|
1239
|
+
}
|
|
1240
|
+
const childNodes = getChildNodes(node);
|
|
1241
|
+
if (childNodes) {
|
|
1242
|
+
for (let i = childNodes.length - 1; i >= 0; --i) {
|
|
1243
|
+
stack.push(childNodes[i]);
|
|
1244
|
+
}
|
|
1245
|
+
}
|
|
1246
|
+
}
|
|
1247
|
+
};
|
|
924
1248
|
/**
|
|
925
1249
|
* _initDocument
|
|
926
1250
|
*
|
|
@@ -942,7 +1266,7 @@ var purify = _commonjsHelpers.createCommonjsModule(function (module, exports) {
|
|
|
942
1266
|
// Root of XHTML doc must contain xmlns declaration (see https://www.w3.org/TR/xhtml1/normative.html#strict)
|
|
943
1267
|
dirty = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + dirty + '</body></html>';
|
|
944
1268
|
}
|
|
945
|
-
const dirtyPayload = trustedTypesPolicy ?
|
|
1269
|
+
const dirtyPayload = trustedTypesPolicy ? _createTrustedHTML(dirty) : dirty;
|
|
946
1270
|
/*
|
|
947
1271
|
* Use the DOMParser API by default, fallback later if needs be
|
|
948
1272
|
* DOMParser not work for svg when has multiple root element.
|
|
@@ -982,6 +1306,20 @@ var purify = _commonjsHelpers.createCommonjsModule(function (module, exports) {
|
|
|
982
1306
|
// eslint-disable-next-line no-bitwise
|
|
983
1307
|
NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION | NodeFilter.SHOW_CDATA_SECTION, null);
|
|
984
1308
|
};
|
|
1309
|
+
/**
|
|
1310
|
+
* Replace template expression syntax (mustache, ERB, template
|
|
1311
|
+
* literal) with a space; shared by all SAFE_FOR_TEMPLATES scrub
|
|
1312
|
+
* sites. Order matters: mustache, then ERB, then template literal.
|
|
1313
|
+
*
|
|
1314
|
+
* @param value the string to scrub
|
|
1315
|
+
* @returns the scrubbed string
|
|
1316
|
+
*/
|
|
1317
|
+
const _stripTemplateExpressions = function _stripTemplateExpressions(value) {
|
|
1318
|
+
value = stringReplace(value, MUSTACHE_EXPR$1, ' ');
|
|
1319
|
+
value = stringReplace(value, ERB_EXPR$1, ' ');
|
|
1320
|
+
value = stringReplace(value, TMPLIT_EXPR$1, ' ');
|
|
1321
|
+
return value;
|
|
1322
|
+
};
|
|
985
1323
|
/**
|
|
986
1324
|
* Strip template-engine expressions ({{...}}, ${...}, <%...%>) from the
|
|
987
1325
|
* character data of an element subtree. Used as the final safety net for
|
|
@@ -1001,29 +1339,100 @@ var purify = _commonjsHelpers.createCommonjsModule(function (module, exports) {
|
|
|
1001
1339
|
*
|
|
1002
1340
|
* @param node The root element whose character data should be scrubbed.
|
|
1003
1341
|
*/
|
|
1004
|
-
const
|
|
1342
|
+
const _scrubTemplateExpressions2 = function _scrubTemplateExpressions(node) {
|
|
1343
|
+
var _node$querySelectorAl;
|
|
1005
1344
|
node.normalize();
|
|
1006
1345
|
const walker = createNodeIterator.call(node.ownerDocument || node, node,
|
|
1007
1346
|
// eslint-disable-next-line no-bitwise
|
|
1008
1347
|
NodeFilter.SHOW_TEXT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_CDATA_SECTION | NodeFilter.SHOW_PROCESSING_INSTRUCTION, null);
|
|
1009
1348
|
let currentNode = walker.nextNode();
|
|
1010
1349
|
while (currentNode) {
|
|
1011
|
-
|
|
1012
|
-
arrayForEach([MUSTACHE_EXPR$1, ERB_EXPR$1, TMPLIT_EXPR$1], expr => {
|
|
1013
|
-
data = stringReplace(data, expr, ' ');
|
|
1014
|
-
});
|
|
1015
|
-
currentNode.data = data;
|
|
1350
|
+
currentNode.data = _stripTemplateExpressions(currentNode.data);
|
|
1016
1351
|
currentNode = walker.nextNode();
|
|
1017
1352
|
}
|
|
1353
|
+
// NodeIterator does not descend into <template>.content per the DOM spec,
|
|
1354
|
+
// so we must explicitly recurse into each template's content fragment,
|
|
1355
|
+
// mirroring the approach used by _sanitizeShadowDOM.
|
|
1356
|
+
const templates = (_node$querySelectorAl = node.querySelectorAll) === null || _node$querySelectorAl === void 0 ? void 0 : _node$querySelectorAl.call(node, 'template');
|
|
1357
|
+
if (templates) {
|
|
1358
|
+
arrayForEach(templates, tmpl => {
|
|
1359
|
+
if (_isDocumentFragment(tmpl.content)) {
|
|
1360
|
+
_scrubTemplateExpressions2(tmpl.content);
|
|
1361
|
+
}
|
|
1362
|
+
});
|
|
1363
|
+
}
|
|
1018
1364
|
};
|
|
1019
1365
|
/**
|
|
1020
1366
|
* _isClobbered
|
|
1021
1367
|
*
|
|
1368
|
+
* Detect DOM-clobbering on HTMLFormElement nodes. Form is the only HTML
|
|
1369
|
+
* interface with [LegacyOverrideBuiltIns]; a descendant element with a
|
|
1370
|
+
* `name` attribute matching a prototype property shadows that property
|
|
1371
|
+
* on direct reads. We use this check at the IN_PLACE entry-point and
|
|
1372
|
+
* during attribute sanitization to refuse clobbered forms.
|
|
1373
|
+
*
|
|
1022
1374
|
* @param element element to check for clobbering attacks
|
|
1023
1375
|
* @return true if clobbered, false if safe
|
|
1024
1376
|
*/
|
|
1025
1377
|
const _isClobbered = function _isClobbered(element) {
|
|
1026
|
-
|
|
1378
|
+
// Realm-independent tag-name probe. If we can't determine the tag
|
|
1379
|
+
// name at all, we can't reason about clobbering — return false
|
|
1380
|
+
// (the caller's other defences still apply).
|
|
1381
|
+
const realTagName = getNodeName ? getNodeName(element) : null;
|
|
1382
|
+
if (typeof realTagName !== 'string') {
|
|
1383
|
+
return false;
|
|
1384
|
+
}
|
|
1385
|
+
if (transformCaseFunc(realTagName) !== 'form') {
|
|
1386
|
+
return false;
|
|
1387
|
+
}
|
|
1388
|
+
return typeof element.nodeName !== 'string' || typeof element.textContent !== 'string' || typeof element.removeChild !== 'function' ||
|
|
1389
|
+
// Realm-safe NamedNodeMap detection: equality against the cached
|
|
1390
|
+
// prototype getter. Clobbered .attributes (e.g. <input name="attributes">)
|
|
1391
|
+
// makes the direct read diverge from the cached read; a clean form
|
|
1392
|
+
// (same-realm OR foreign-realm) has both reads pointing at the same
|
|
1393
|
+
// canonical NamedNodeMap.
|
|
1394
|
+
element.attributes !== getAttributes(element) || typeof element.removeAttribute !== 'function' || typeof element.setAttribute !== 'function' || typeof element.namespaceURI !== 'string' || typeof element.insertBefore !== 'function' || typeof element.hasChildNodes !== 'function' ||
|
|
1395
|
+
// NodeType clobbering probe. Cached Node.prototype.nodeType getter
|
|
1396
|
+
// returns the integer 1 for any Element regardless of realm; direct
|
|
1397
|
+
// read on a clobbered form (e.g. <input name="nodeType">) returns
|
|
1398
|
+
// the named child element. Cheap addition — nodeType is read from
|
|
1399
|
+
// an internal slot, no serialization cost — and removes a residual
|
|
1400
|
+
// clobbering surface used by several mXSS / PI / comment branches
|
|
1401
|
+
// in _sanitizeElements that compare currentNode.nodeType directly.
|
|
1402
|
+
element.nodeType !== getNodeType(element) ||
|
|
1403
|
+
// HTMLFormElement has [LegacyOverrideBuiltIns]: a descendant named
|
|
1404
|
+
// "childNodes" shadows the prototype getter. Direct reads of
|
|
1405
|
+
// form.childNodes from a clobbered form return the named child
|
|
1406
|
+
// instead of the real NodeList, so any walk that reads it directly
|
|
1407
|
+
// skips the form's real children. Compare the direct read to the
|
|
1408
|
+
// cached Node.prototype getter — when the form's named-property
|
|
1409
|
+
// getter intercepts the read, the two values differ and we flag
|
|
1410
|
+
// the form. This catches every clobbering child type (input,
|
|
1411
|
+
// select, etc.) regardless of whether the named child happens to
|
|
1412
|
+
// carry a numeric .length, which a typeof-based probe would miss
|
|
1413
|
+
// (e.g. HTMLSelectElement.length is a defined unsigned-long).
|
|
1414
|
+
element.childNodes !== getChildNodes(element);
|
|
1415
|
+
};
|
|
1416
|
+
/**
|
|
1417
|
+
* Checks whether the given value is a DocumentFragment from any realm.
|
|
1418
|
+
*
|
|
1419
|
+
* The realm-independent replacement reads `nodeType` through the cached
|
|
1420
|
+
* Node.prototype getter and compares to the DOCUMENT_FRAGMENT_NODE
|
|
1421
|
+
* constant (11). nodeType is a numeric value resolved from the node's
|
|
1422
|
+
* internal slot, identical across realms for the same kind of node.
|
|
1423
|
+
*
|
|
1424
|
+
* @param value object to check
|
|
1425
|
+
* @return true if value is a DocumentFragment-shaped node from any realm
|
|
1426
|
+
*/
|
|
1427
|
+
const _isDocumentFragment = function _isDocumentFragment(value) {
|
|
1428
|
+
if (!getNodeType || typeof value !== 'object' || value === null) {
|
|
1429
|
+
return false;
|
|
1430
|
+
}
|
|
1431
|
+
try {
|
|
1432
|
+
return getNodeType(value) === NODE_TYPE.documentFragment;
|
|
1433
|
+
} catch (_) {
|
|
1434
|
+
return false;
|
|
1435
|
+
}
|
|
1027
1436
|
};
|
|
1028
1437
|
/**
|
|
1029
1438
|
* Checks whether the given object is a DOM node, including nodes that
|
|
@@ -1033,12 +1442,6 @@ var purify = _commonjsHelpers.createCommonjsModule(function (module, exports) {
|
|
|
1033
1442
|
* sanitize() to silently stringify them and reset IN_PLACE to false,
|
|
1034
1443
|
* returning the original node unsanitized. See GHSA-4w3q-35jp-p934.
|
|
1035
1444
|
*
|
|
1036
|
-
* Implementation: call the cached `nodeType` getter from Node.prototype
|
|
1037
|
-
* directly on the value. This bypasses any clobbered instance property
|
|
1038
|
-
* (e.g. a child element named "nodeType") and works across realms
|
|
1039
|
-
* because the WebIDL `nodeType` getter reads an internal slot that
|
|
1040
|
-
* every real Node has, regardless of which window minted it.
|
|
1041
|
-
*
|
|
1042
1445
|
* @param value object to check whether it's a DOM node
|
|
1043
1446
|
* @return true if value is a DOM node from any realm
|
|
1044
1447
|
*/
|
|
@@ -1053,10 +1456,104 @@ var purify = _commonjsHelpers.createCommonjsModule(function (module, exports) {
|
|
|
1053
1456
|
}
|
|
1054
1457
|
};
|
|
1055
1458
|
function _executeHooks(hooks, currentNode, data) {
|
|
1459
|
+
if (hooks.length === 0) {
|
|
1460
|
+
return;
|
|
1461
|
+
}
|
|
1056
1462
|
arrayForEach(hooks, hook => {
|
|
1057
1463
|
hook.call(DOMPurify, currentNode, data, CONFIG);
|
|
1058
1464
|
});
|
|
1059
1465
|
}
|
|
1466
|
+
/**
|
|
1467
|
+
* Structural-threat checks that condemn a node regardless of the
|
|
1468
|
+
* allowlists: mXSS via namespace confusion, risky CSS construction,
|
|
1469
|
+
* processing instructions, markup-bearing comments. Pure predicate;
|
|
1470
|
+
* the caller removes. Check order is load-bearing.
|
|
1471
|
+
*
|
|
1472
|
+
* @param currentNode the node to inspect
|
|
1473
|
+
* @param tagName the node's transformCaseFunc'd tag name
|
|
1474
|
+
* @return true if the node must be removed
|
|
1475
|
+
*/
|
|
1476
|
+
const _isUnsafeNode = function _isUnsafeNode(currentNode, tagName) {
|
|
1477
|
+
/* Detect mXSS attempts abusing namespace confusion */
|
|
1478
|
+
if (SAFE_FOR_XML && currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(ELEMENT_MARKUP_PROBE, currentNode.textContent) && regExpTest(ELEMENT_MARKUP_PROBE, currentNode.innerHTML)) {
|
|
1479
|
+
return true;
|
|
1480
|
+
}
|
|
1481
|
+
/* Remove risky CSS construction leading to mXSS */
|
|
1482
|
+
if (SAFE_FOR_XML && currentNode.namespaceURI === HTML_NAMESPACE && tagName === 'style' && _isNode(currentNode.firstElementChild)) {
|
|
1483
|
+
return true;
|
|
1484
|
+
}
|
|
1485
|
+
/* Remove any occurrence of processing instructions */
|
|
1486
|
+
if (currentNode.nodeType === NODE_TYPE.processingInstruction) {
|
|
1487
|
+
return true;
|
|
1488
|
+
}
|
|
1489
|
+
/* Remove any kind of possibly harmful comments */
|
|
1490
|
+
if (SAFE_FOR_XML && currentNode.nodeType === NODE_TYPE.comment && regExpTest(COMMENT_MARKUP_PROBE, currentNode.data)) {
|
|
1491
|
+
return true;
|
|
1492
|
+
}
|
|
1493
|
+
return false;
|
|
1494
|
+
};
|
|
1495
|
+
/**
|
|
1496
|
+
* Handle a node whose tag is forbidden or not allowlisted: keep
|
|
1497
|
+
* allowed custom elements (false return exits _sanitizeElements
|
|
1498
|
+
* early - namespace/fallback checks and the afterSanitizeElements
|
|
1499
|
+
* hook are intentionally skipped for kept custom elements), else
|
|
1500
|
+
* hoist content per KEEP_CONTENT and remove.
|
|
1501
|
+
*
|
|
1502
|
+
* @param currentNode the disallowed node
|
|
1503
|
+
* @param tagName the node's transformCaseFunc'd tag name
|
|
1504
|
+
* @return true if the node was removed, false if kept
|
|
1505
|
+
*/
|
|
1506
|
+
const _sanitizeDisallowedNode = function _sanitizeDisallowedNode(currentNode, tagName) {
|
|
1507
|
+
/* Check if we have a custom element to handle */
|
|
1508
|
+
if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName)) {
|
|
1509
|
+
if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) {
|
|
1510
|
+
return false;
|
|
1511
|
+
}
|
|
1512
|
+
if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(tagName)) {
|
|
1513
|
+
return false;
|
|
1514
|
+
}
|
|
1515
|
+
}
|
|
1516
|
+
/* Keep content except for bad-listed elements.
|
|
1517
|
+
Use the cached prototype getters exclusively — the previous code
|
|
1518
|
+
had `|| currentNode.parentNode` / `|| currentNode.childNodes`
|
|
1519
|
+
fallbacks, but the cached getters always return the canonical
|
|
1520
|
+
value (or null for a real parent-less node), so the fallback
|
|
1521
|
+
path was dead in safe cases and a clobbering surface in unsafe
|
|
1522
|
+
ones. Falsy cached results stay falsy; the `if (childNodes &&
|
|
1523
|
+
parentNode)` check already gates correctly. */
|
|
1524
|
+
if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {
|
|
1525
|
+
const parentNode = getParentNode(currentNode);
|
|
1526
|
+
const childNodes = getChildNodes(currentNode);
|
|
1527
|
+
if (childNodes && parentNode) {
|
|
1528
|
+
const childCount = childNodes.length;
|
|
1529
|
+
/* In-place: hoist the *original* children so the iterator visits
|
|
1530
|
+
and sanitises them through the same allowlist pass as every other
|
|
1531
|
+
node. The caller built the tree in the live document, so the
|
|
1532
|
+
originals carry already-queued resource events (`<img onerror>`,
|
|
1533
|
+
`<video>`/`<audio>` error, lazy/`onload`, …); cloning would leave
|
|
1534
|
+
those originals detached but still armed, firing in page scope
|
|
1535
|
+
while the returned tree looked clean. Moving is safe in-place: the
|
|
1536
|
+
root is pre-validated as an allowed tag and so is never the node
|
|
1537
|
+
being removed, which keeps `parentNode` inside the iterator root
|
|
1538
|
+
and the relocated child inside the serialised tree.
|
|
1539
|
+
Otherwise (string / DOM-copy paths): clone. The iterator is rooted
|
|
1540
|
+
at — and the result serialised from — `body`, so a restrictive
|
|
1541
|
+
ALLOWED_TAGS that removes `body` itself must leave its content in
|
|
1542
|
+
place, which only cloning does; and those paths parse into an
|
|
1543
|
+
inert document, so their discarded originals never had a queued
|
|
1544
|
+
event to neutralise.
|
|
1545
|
+
`childNodes` is live; a tail-to-head walk keeps `childNodes[i]`
|
|
1546
|
+
valid whether we move (drops the trailing entry) or clone (leaves
|
|
1547
|
+
the list intact). */
|
|
1548
|
+
for (let i = childCount - 1; i >= 0; --i) {
|
|
1549
|
+
const hoisted = IN_PLACE ? childNodes[i] : cloneNode(childNodes[i], true);
|
|
1550
|
+
parentNode.insertBefore(hoisted, getNextSibling(currentNode));
|
|
1551
|
+
}
|
|
1552
|
+
}
|
|
1553
|
+
}
|
|
1554
|
+
_forceRemove(currentNode);
|
|
1555
|
+
return true;
|
|
1556
|
+
};
|
|
1060
1557
|
/**
|
|
1061
1558
|
* _sanitizeElements
|
|
1062
1559
|
*
|
|
@@ -1067,7 +1564,6 @@ var purify = _commonjsHelpers.createCommonjsModule(function (module, exports) {
|
|
|
1067
1564
|
* @return true if node was killed, false if left alive
|
|
1068
1565
|
*/
|
|
1069
1566
|
const _sanitizeElements = function _sanitizeElements(currentNode) {
|
|
1070
|
-
let content = null;
|
|
1071
1567
|
/* Execute a hook if present */
|
|
1072
1568
|
_executeHooks(hooks.beforeSanitizeElements, currentNode, null);
|
|
1073
1569
|
/* Check if element is clobbered or can clobber */
|
|
@@ -1076,75 +1572,41 @@ var purify = _commonjsHelpers.createCommonjsModule(function (module, exports) {
|
|
|
1076
1572
|
return true;
|
|
1077
1573
|
}
|
|
1078
1574
|
/* Now let's check the element's type and name */
|
|
1079
|
-
const tagName = transformCaseFunc(currentNode.nodeName);
|
|
1575
|
+
const tagName = transformCaseFunc(getNodeName ? getNodeName(currentNode) : currentNode.nodeName);
|
|
1080
1576
|
/* Execute a hook if present */
|
|
1081
1577
|
_executeHooks(hooks.uponSanitizeElement, currentNode, {
|
|
1082
1578
|
tagName,
|
|
1083
1579
|
allowedTags: ALLOWED_TAGS
|
|
1084
1580
|
});
|
|
1085
|
-
/*
|
|
1086
|
-
if (
|
|
1087
|
-
_forceRemove(currentNode);
|
|
1088
|
-
return true;
|
|
1089
|
-
}
|
|
1090
|
-
/* Remove risky CSS construction leading to mXSS */
|
|
1091
|
-
if (SAFE_FOR_XML && currentNode.namespaceURI === HTML_NAMESPACE && tagName === 'style' && _isNode(currentNode.firstElementChild)) {
|
|
1092
|
-
_forceRemove(currentNode);
|
|
1093
|
-
return true;
|
|
1094
|
-
}
|
|
1095
|
-
/* Remove any occurrence of processing instructions */
|
|
1096
|
-
if (currentNode.nodeType === NODE_TYPE.progressingInstruction) {
|
|
1097
|
-
_forceRemove(currentNode);
|
|
1098
|
-
return true;
|
|
1099
|
-
}
|
|
1100
|
-
/* Remove any kind of possibly harmful comments */
|
|
1101
|
-
if (SAFE_FOR_XML && currentNode.nodeType === NODE_TYPE.comment && regExpTest(/<[/\w]/g, currentNode.data)) {
|
|
1581
|
+
/* Remove mXSS vectors, processing instructions and risky comments */
|
|
1582
|
+
if (_isUnsafeNode(currentNode, tagName)) {
|
|
1102
1583
|
_forceRemove(currentNode);
|
|
1103
1584
|
return true;
|
|
1104
1585
|
}
|
|
1105
1586
|
/* Remove element if anything forbids its presence */
|
|
1106
1587
|
if (FORBID_TAGS[tagName] || !(EXTRA_ELEMENT_HANDLING.tagCheck instanceof Function && EXTRA_ELEMENT_HANDLING.tagCheck(tagName)) && !ALLOWED_TAGS[tagName]) {
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {
|
|
1118
|
-
const parentNode = getParentNode(currentNode) || currentNode.parentNode;
|
|
1119
|
-
const childNodes = getChildNodes(currentNode) || currentNode.childNodes;
|
|
1120
|
-
if (childNodes && parentNode) {
|
|
1121
|
-
const childCount = childNodes.length;
|
|
1122
|
-
for (let i = childCount - 1; i >= 0; --i) {
|
|
1123
|
-
const childClone = cloneNode(childNodes[i], true);
|
|
1124
|
-
parentNode.insertBefore(childClone, getNextSibling(currentNode));
|
|
1125
|
-
}
|
|
1126
|
-
}
|
|
1127
|
-
}
|
|
1128
|
-
_forceRemove(currentNode);
|
|
1129
|
-
return true;
|
|
1130
|
-
}
|
|
1131
|
-
/* Check whether element has a valid namespace */
|
|
1132
|
-
if (currentNode instanceof Element && !_checkValidNamespace(currentNode)) {
|
|
1588
|
+
return _sanitizeDisallowedNode(currentNode, tagName);
|
|
1589
|
+
}
|
|
1590
|
+
/* Check whether element has a valid namespace.
|
|
1591
|
+
Realm-safe check (GHSA-hpcv-96wg-7vj8): use the cached Node.prototype
|
|
1592
|
+
nodeType getter rather than `instanceof Element`, which is realm-
|
|
1593
|
+
bound and short-circuits to false for any node minted in a different
|
|
1594
|
+
realm — letting a foreign-realm element with a forbidden namespace
|
|
1595
|
+
slip past the namespace check entirely. */
|
|
1596
|
+
const nt = getNodeType ? getNodeType(currentNode) : currentNode.nodeType;
|
|
1597
|
+
if (nt === NODE_TYPE.element && !_checkValidNamespace(currentNode)) {
|
|
1133
1598
|
_forceRemove(currentNode);
|
|
1134
1599
|
return true;
|
|
1135
1600
|
}
|
|
1136
1601
|
/* Make sure that older browsers don't get fallback-tag mXSS */
|
|
1137
|
-
if ((tagName === 'noscript' || tagName === 'noembed' || tagName === 'noframes') && regExpTest(
|
|
1602
|
+
if ((tagName === 'noscript' || tagName === 'noembed' || tagName === 'noframes') && regExpTest(FALLBACK_TAG_CLOSE, currentNode.innerHTML)) {
|
|
1138
1603
|
_forceRemove(currentNode);
|
|
1139
1604
|
return true;
|
|
1140
1605
|
}
|
|
1141
1606
|
/* Sanitize element content to be template-safe */
|
|
1142
1607
|
if (SAFE_FOR_TEMPLATES && currentNode.nodeType === NODE_TYPE.text) {
|
|
1143
1608
|
/* Get the element's text content */
|
|
1144
|
-
content = currentNode.textContent;
|
|
1145
|
-
arrayForEach([MUSTACHE_EXPR$1, ERB_EXPR$1, TMPLIT_EXPR$1], expr => {
|
|
1146
|
-
content = stringReplace(content, expr, ' ');
|
|
1147
|
-
});
|
|
1609
|
+
const content = _stripTemplateExpressions(currentNode.textContent);
|
|
1148
1610
|
if (currentNode.textContent !== content) {
|
|
1149
1611
|
arrayPush(DOMPurify.removed, {
|
|
1150
1612
|
element: currentNode.cloneNode()
|
|
@@ -1179,7 +1641,7 @@ var purify = _commonjsHelpers.createCommonjsModule(function (module, exports) {
|
|
|
1179
1641
|
(https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes)
|
|
1180
1642
|
XML-compatible (https://html.spec.whatwg.org/multipage/infrastructure.html#xml-compatible and http://www.w3.org/TR/xml/#d0e804)
|
|
1181
1643
|
We don't need to check the value; it's always URI safe. */
|
|
1182
|
-
if (ALLOW_DATA_ATTR &&
|
|
1644
|
+
if (ALLOW_DATA_ATTR && regExpTest(DATA_ATTR$1, lcName)) ; else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR$1, lcName)) ; else if (!nameIsPermitted) {
|
|
1183
1645
|
if (
|
|
1184
1646
|
// First condition does a very basic check if a) it's basically a valid custom element tagname AND
|
|
1185
1647
|
// b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
@@ -1211,6 +1673,63 @@ var purify = _commonjsHelpers.createCommonjsModule(function (module, exports) {
|
|
|
1211
1673
|
const _isBasicCustomElement = function _isBasicCustomElement(tagName) {
|
|
1212
1674
|
return !RESERVED_CUSTOM_ELEMENT_NAMES[stringToLowerCase(tagName)] && regExpTest(CUSTOM_ELEMENT$1, tagName);
|
|
1213
1675
|
};
|
|
1676
|
+
/**
|
|
1677
|
+
* Wrap an attribute value in the matching Trusted Types object when
|
|
1678
|
+
* the active policy requires it. Namespaced attributes pass through
|
|
1679
|
+
* unchanged (no TT support yet, see
|
|
1680
|
+
* https://bugs.chromium.org/p/chromium/issues/detail?id=1305293).
|
|
1681
|
+
*
|
|
1682
|
+
* @param lcTag lowercase tag name of the containing element
|
|
1683
|
+
* @param lcName lowercase attribute name
|
|
1684
|
+
* @param namespaceURI the attribute's namespace, if any
|
|
1685
|
+
* @param value the attribute value to wrap
|
|
1686
|
+
* @return the value, wrapped when Trusted Types demand it
|
|
1687
|
+
*/
|
|
1688
|
+
const _applyTrustedTypesToAttribute = function _applyTrustedTypesToAttribute(lcTag, lcName, namespaceURI, value) {
|
|
1689
|
+
if (trustedTypesPolicy && typeof trustedTypes === 'object' && typeof trustedTypes.getAttributeType === 'function' && !namespaceURI) {
|
|
1690
|
+
switch (trustedTypes.getAttributeType(lcTag, lcName)) {
|
|
1691
|
+
case 'TrustedHTML':
|
|
1692
|
+
{
|
|
1693
|
+
return _createTrustedHTML(value);
|
|
1694
|
+
}
|
|
1695
|
+
case 'TrustedScriptURL':
|
|
1696
|
+
{
|
|
1697
|
+
return _createTrustedScriptURL(value);
|
|
1698
|
+
}
|
|
1699
|
+
}
|
|
1700
|
+
}
|
|
1701
|
+
return value;
|
|
1702
|
+
};
|
|
1703
|
+
/**
|
|
1704
|
+
* Write a modified attribute value back onto the element. On
|
|
1705
|
+
* success, re-probe for clobbering introduced by the new value and
|
|
1706
|
+
* remove the element when found; otherwise pop the removal entry
|
|
1707
|
+
* recorded by the earlier _removeAttribute (long-standing pairing
|
|
1708
|
+
* with the SANITIZE_NAMED_PROPS path - do not "fix" casually). On
|
|
1709
|
+
* failure, remove the attribute instead.
|
|
1710
|
+
*
|
|
1711
|
+
* @param currentNode the element carrying the attribute
|
|
1712
|
+
* @param name the attribute name as present on the element
|
|
1713
|
+
* @param namespaceURI the attribute's namespace, if any
|
|
1714
|
+
* @param value the new attribute value
|
|
1715
|
+
*/
|
|
1716
|
+
const _setAttributeValue = function _setAttributeValue(currentNode, name, namespaceURI, value) {
|
|
1717
|
+
try {
|
|
1718
|
+
if (namespaceURI) {
|
|
1719
|
+
currentNode.setAttributeNS(namespaceURI, name, value);
|
|
1720
|
+
} else {
|
|
1721
|
+
/* Fallback to setAttribute() for browser-unrecognized namespaces e.g. "x-schema". */
|
|
1722
|
+
currentNode.setAttribute(name, value);
|
|
1723
|
+
}
|
|
1724
|
+
if (_isClobbered(currentNode)) {
|
|
1725
|
+
_forceRemove(currentNode);
|
|
1726
|
+
} else {
|
|
1727
|
+
arrayPop(DOMPurify.removed);
|
|
1728
|
+
}
|
|
1729
|
+
} catch (_) {
|
|
1730
|
+
_removeAttribute(name, currentNode);
|
|
1731
|
+
}
|
|
1732
|
+
};
|
|
1214
1733
|
/**
|
|
1215
1734
|
* _sanitizeAttributes
|
|
1216
1735
|
*
|
|
@@ -1237,6 +1756,7 @@ var purify = _commonjsHelpers.createCommonjsModule(function (module, exports) {
|
|
|
1237
1756
|
forceKeepAttr: undefined
|
|
1238
1757
|
};
|
|
1239
1758
|
let l = attributes.length;
|
|
1759
|
+
const lcTag = transformCaseFunc(currentNode.nodeName);
|
|
1240
1760
|
/* Go backwards over all attributes; safely remove bad ones */
|
|
1241
1761
|
while (l--) {
|
|
1242
1762
|
const attr = attributes[l];
|
|
@@ -1274,7 +1794,7 @@ var purify = _commonjsHelpers.createCommonjsModule(function (module, exports) {
|
|
|
1274
1794
|
_removeAttribute(name, currentNode);
|
|
1275
1795
|
continue;
|
|
1276
1796
|
}
|
|
1277
|
-
/* Did the hooks
|
|
1797
|
+
/* Did the hooks force-keep the attribute? */
|
|
1278
1798
|
if (hookEvent.forceKeepAttr) {
|
|
1279
1799
|
continue;
|
|
1280
1800
|
}
|
|
@@ -1284,56 +1804,24 @@ var purify = _commonjsHelpers.createCommonjsModule(function (module, exports) {
|
|
|
1284
1804
|
continue;
|
|
1285
1805
|
}
|
|
1286
1806
|
/* Work around a security issue in jQuery 3.0 */
|
|
1287
|
-
if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(
|
|
1807
|
+
if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(SELF_CLOSING_TAG, value)) {
|
|
1288
1808
|
_removeAttribute(name, currentNode);
|
|
1289
1809
|
continue;
|
|
1290
1810
|
}
|
|
1291
1811
|
/* Sanitize attribute content to be template-safe */
|
|
1292
1812
|
if (SAFE_FOR_TEMPLATES) {
|
|
1293
|
-
|
|
1294
|
-
value = stringReplace(value, expr, ' ');
|
|
1295
|
-
});
|
|
1813
|
+
value = _stripTemplateExpressions(value);
|
|
1296
1814
|
}
|
|
1297
1815
|
/* Is `value` valid for this attribute? */
|
|
1298
|
-
const lcTag = transformCaseFunc(currentNode.nodeName);
|
|
1299
1816
|
if (!_isValidAttribute(lcTag, lcName, value)) {
|
|
1300
1817
|
_removeAttribute(name, currentNode);
|
|
1301
1818
|
continue;
|
|
1302
1819
|
}
|
|
1303
1820
|
/* Handle attributes that require Trusted Types */
|
|
1304
|
-
|
|
1305
|
-
if (namespaceURI) ; else {
|
|
1306
|
-
switch (trustedTypes.getAttributeType(lcTag, lcName)) {
|
|
1307
|
-
case 'TrustedHTML':
|
|
1308
|
-
{
|
|
1309
|
-
value = trustedTypesPolicy.createHTML(value);
|
|
1310
|
-
break;
|
|
1311
|
-
}
|
|
1312
|
-
case 'TrustedScriptURL':
|
|
1313
|
-
{
|
|
1314
|
-
value = trustedTypesPolicy.createScriptURL(value);
|
|
1315
|
-
break;
|
|
1316
|
-
}
|
|
1317
|
-
}
|
|
1318
|
-
}
|
|
1319
|
-
}
|
|
1821
|
+
value = _applyTrustedTypesToAttribute(lcTag, lcName, namespaceURI, value);
|
|
1320
1822
|
/* Handle invalid data-* attribute set by try-catching it */
|
|
1321
1823
|
if (value !== initValue) {
|
|
1322
|
-
|
|
1323
|
-
if (namespaceURI) {
|
|
1324
|
-
currentNode.setAttributeNS(namespaceURI, name, value);
|
|
1325
|
-
} else {
|
|
1326
|
-
/* Fallback to setAttribute() for browser-unrecognized namespaces e.g. "x-schema". */
|
|
1327
|
-
currentNode.setAttribute(name, value);
|
|
1328
|
-
}
|
|
1329
|
-
if (_isClobbered(currentNode)) {
|
|
1330
|
-
_forceRemove(currentNode);
|
|
1331
|
-
} else {
|
|
1332
|
-
arrayPop(DOMPurify.removed);
|
|
1333
|
-
}
|
|
1334
|
-
} catch (_) {
|
|
1335
|
-
_removeAttribute(name, currentNode);
|
|
1336
|
-
}
|
|
1824
|
+
_setAttributeValue(currentNode, name, namespaceURI, value);
|
|
1337
1825
|
}
|
|
1338
1826
|
}
|
|
1339
1827
|
/* Execute a hook if present */
|
|
@@ -1356,10 +1844,31 @@ var purify = _commonjsHelpers.createCommonjsModule(function (module, exports) {
|
|
|
1356
1844
|
_sanitizeElements(shadowNode);
|
|
1357
1845
|
/* Check attributes next */
|
|
1358
1846
|
_sanitizeAttributes(shadowNode);
|
|
1359
|
-
/* Deep shadow DOM detected
|
|
1360
|
-
|
|
1847
|
+
/* Deep shadow DOM detected.
|
|
1848
|
+
Realm-safe check (GHSA-hpcv-96wg-7vj8): use nodeType against the
|
|
1849
|
+
DOCUMENT_FRAGMENT_NODE constant rather than instanceof, so we
|
|
1850
|
+
recurse into <template>.content from foreign realms too. */
|
|
1851
|
+
if (_isDocumentFragment(shadowNode.content)) {
|
|
1361
1852
|
_sanitizeShadowDOM2(shadowNode.content);
|
|
1362
1853
|
}
|
|
1854
|
+
/* An element iterated here may itself host an attached
|
|
1855
|
+
shadow root. The default NodeIterator does not enter shadow
|
|
1856
|
+
trees, so a shadow root nested inside template.content was
|
|
1857
|
+
previously reached by no walk at all (the pre-pass at
|
|
1858
|
+
_sanitizeAttachedShadowRoots descends via childNodes, which
|
|
1859
|
+
doesn't enter template.content; the template-content recursion
|
|
1860
|
+
above iterates the content but never inspected shadowRoot).
|
|
1861
|
+
Walk it explicitly. The nodeType guard avoids reading
|
|
1862
|
+
shadowRoot off text / comment / CDATA / PI nodes that the
|
|
1863
|
+
iterator also surfaces. */
|
|
1864
|
+
const shadowNodeType = getNodeType ? getNodeType(shadowNode) : shadowNode.nodeType;
|
|
1865
|
+
if (shadowNodeType === NODE_TYPE.element) {
|
|
1866
|
+
const innerSr = getShadowRoot(shadowNode);
|
|
1867
|
+
if (_isDocumentFragment(innerSr)) {
|
|
1868
|
+
_sanitizeAttachedShadowRoots(innerSr);
|
|
1869
|
+
_sanitizeShadowDOM2(innerSr);
|
|
1870
|
+
}
|
|
1871
|
+
}
|
|
1363
1872
|
}
|
|
1364
1873
|
/* Execute a hook if present */
|
|
1365
1874
|
_executeHooks(hooks.afterSanitizeShadowDOM, fragment, null);
|
|
@@ -1383,28 +1892,83 @@ var purify = _commonjsHelpers.createCommonjsModule(function (module, exports) {
|
|
|
1383
1892
|
*
|
|
1384
1893
|
* @param root the subtree root to walk for attached shadow roots
|
|
1385
1894
|
*/
|
|
1386
|
-
const
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
const
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
}
|
|
1406
|
-
|
|
1407
|
-
|
|
1895
|
+
const _sanitizeAttachedShadowRoots = function _sanitizeAttachedShadowRoots(root) {
|
|
1896
|
+
/* Iterative (explicit stack) rather than per-child recursion. DOM APIs
|
|
1897
|
+
impose no depth cap, so an attacker-shaped tree (JSON/CRDT/editor data
|
|
1898
|
+
built straight into the DOM — the IN_PLACE surface) deeper than the JS
|
|
1899
|
+
call-stack budget would otherwise overflow native recursion here and
|
|
1900
|
+
throw at the IN_PLACE entry pre-pass, before a single node is
|
|
1901
|
+
sanitized, leaving the caller's live tree untouched (fail-open). See
|
|
1902
|
+
campaign-3 F4. A heap stack keeps depth off the call stack.
|
|
1903
|
+
Each work item is either a node to descend into, or a deferred
|
|
1904
|
+
`_sanitizeShadowDOM` for an already-walked shadow root. The deferred
|
|
1905
|
+
form preserves the original post-order discipline: a shadow root's
|
|
1906
|
+
nested shadow roots are discovered before the outer shadow is
|
|
1907
|
+
sanitized (which may remove hosts). Pushes are in reverse of the
|
|
1908
|
+
desired processing order (LIFO): template content, then children, then
|
|
1909
|
+
the shadow-sanitize, then the shadow walk — so the order matches the
|
|
1910
|
+
previous recursion exactly. */
|
|
1911
|
+
const stack = [{
|
|
1912
|
+
node: root,
|
|
1913
|
+
shadow: null
|
|
1914
|
+
}];
|
|
1915
|
+
while (stack.length > 0) {
|
|
1916
|
+
const item = stack.pop();
|
|
1917
|
+
/* Deferred shadow-DOM sanitisation: runs after its subtree was walked. */
|
|
1918
|
+
if (item.shadow) {
|
|
1919
|
+
_sanitizeShadowDOM2(item.shadow);
|
|
1920
|
+
continue;
|
|
1921
|
+
}
|
|
1922
|
+
const node = item.node;
|
|
1923
|
+
const nodeType = getNodeType ? getNodeType(node) : node.nodeType;
|
|
1924
|
+
const isElement = nodeType === NODE_TYPE.element;
|
|
1925
|
+
/* (pushed last → processed first) Children, snapshotted in reverse so
|
|
1926
|
+
the first child is processed first. Snapshotting matters because a
|
|
1927
|
+
hook may detach siblings mid-walk. */
|
|
1928
|
+
const childNodes = getChildNodes(node);
|
|
1929
|
+
if (childNodes) {
|
|
1930
|
+
for (let i = childNodes.length - 1; i >= 0; --i) {
|
|
1931
|
+
stack.push({
|
|
1932
|
+
node: childNodes[i],
|
|
1933
|
+
shadow: null
|
|
1934
|
+
});
|
|
1935
|
+
}
|
|
1936
|
+
}
|
|
1937
|
+
/* (pushed before children → processed after them, matching the old
|
|
1938
|
+
"template content last" order) When the node is a <template>,
|
|
1939
|
+
descend into its content. */
|
|
1940
|
+
if (isElement) {
|
|
1941
|
+
const rootName = getNodeName ? getNodeName(node) : null;
|
|
1942
|
+
if (typeof rootName === 'string' && transformCaseFunc(rootName) === 'template') {
|
|
1943
|
+
const content = node.content;
|
|
1944
|
+
if (_isDocumentFragment(content)) {
|
|
1945
|
+
stack.push({
|
|
1946
|
+
node: content,
|
|
1947
|
+
shadow: null
|
|
1948
|
+
});
|
|
1949
|
+
}
|
|
1950
|
+
}
|
|
1951
|
+
}
|
|
1952
|
+
/* Shadow root (processed first): walk its subtree, then sanitise it.
|
|
1953
|
+
Realm-safe check (GHSA-hpcv-96wg-7vj8): nodeType-based detection
|
|
1954
|
+
rather than `instanceof DocumentFragment`, which is realm-bound and
|
|
1955
|
+
silently skipped foreign-realm shadow roots (e.g.
|
|
1956
|
+
iframe.contentDocument attachShadow). */
|
|
1957
|
+
if (isElement) {
|
|
1958
|
+
const sr = getShadowRoot(node);
|
|
1959
|
+
if (_isDocumentFragment(sr)) {
|
|
1960
|
+
/* Push the deferred sanitise first so it pops after the shadow
|
|
1961
|
+
walk we push next, i.e. nested shadow roots are discovered
|
|
1962
|
+
before this one is sanitised. */
|
|
1963
|
+
stack.push({
|
|
1964
|
+
node: null,
|
|
1965
|
+
shadow: sr
|
|
1966
|
+
}, {
|
|
1967
|
+
node: sr,
|
|
1968
|
+
shadow: null
|
|
1969
|
+
});
|
|
1970
|
+
}
|
|
1971
|
+
}
|
|
1408
1972
|
}
|
|
1409
1973
|
};
|
|
1410
1974
|
// eslint-disable-next-line complexity
|
|
@@ -1438,22 +2002,50 @@ var purify = _commonjsHelpers.createCommonjsModule(function (module, exports) {
|
|
|
1438
2002
|
}
|
|
1439
2003
|
/* Clean up removed elements */
|
|
1440
2004
|
DOMPurify.removed = [];
|
|
1441
|
-
/*
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
2005
|
+
/* Resolve IN_PLACE for this call without mutating persistent config.
|
|
2006
|
+
Writing the IN_PLACE closure variable here leaks under setConfig(),
|
|
2007
|
+
where _parseConfig is skipped on later calls: a single string call would
|
|
2008
|
+
disable in-place mode for every subsequent node call, returning a
|
|
2009
|
+
sanitized copy while leaving the caller's node — which in-place callers
|
|
2010
|
+
keep using and whose return value they ignore — unsanitized. REPORT-2. */
|
|
2011
|
+
const inPlace = IN_PLACE && typeof dirty !== 'string' && _isNode(dirty);
|
|
2012
|
+
if (inPlace) {
|
|
2013
|
+
/* Do some early pre-sanitization to avoid unsafe root nodes.
|
|
2014
|
+
Read nodeName through the cached prototype getter — a clobbering
|
|
2015
|
+
child named "nodeName" on the form root would otherwise shadow
|
|
2016
|
+
the property and let this check skip the root-allowlist
|
|
2017
|
+
validation entirely. */
|
|
2018
|
+
const nn = getNodeName ? getNodeName(dirty) : dirty.nodeName;
|
|
1448
2019
|
if (typeof nn === 'string') {
|
|
1449
2020
|
const tagName = transformCaseFunc(nn);
|
|
1450
2021
|
if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {
|
|
1451
2022
|
throw typeErrorCreate('root node is forbidden and cannot be sanitized in-place');
|
|
1452
2023
|
}
|
|
1453
2024
|
}
|
|
2025
|
+
/* Pre-flight the root through _isClobbered. The iterator-driven
|
|
2026
|
+
removal path can not detach a parent-less root: _forceRemove
|
|
2027
|
+
falls through to Element.prototype.remove(), which per spec
|
|
2028
|
+
is a no-op on a node with no parent. A clobbered root would
|
|
2029
|
+
then survive the main loop with its attributes uninspected,
|
|
2030
|
+
because _sanitizeAttributes early-returns on _isClobbered. The
|
|
2031
|
+
result would be an attacker-controlled form, complete with any
|
|
2032
|
+
event-handler attributes the caller passed in, handed back to
|
|
2033
|
+
the application unsanitized. Refuse to sanitize such a root
|
|
2034
|
+
the same way we refuse a forbidden tag. GHSA-r47g-fvhr-h676. */
|
|
2035
|
+
if (_isClobbered(dirty)) {
|
|
2036
|
+
throw typeErrorCreate('root node is clobbered and cannot be sanitized in-place');
|
|
2037
|
+
}
|
|
1454
2038
|
/* Sanitize attached shadow roots before the main iterator runs.
|
|
1455
|
-
The iterator does not descend into shadow trees.
|
|
1456
|
-
|
|
2039
|
+
The iterator does not descend into shadow trees. Same fail-closed
|
|
2040
|
+
barrier as the main walk (campaign-3 F2): a custom-element reaction
|
|
2041
|
+
inside a shadow root could abort this pre-pass before the walk runs,
|
|
2042
|
+
which would otherwise leave the entire live tree unsanitized. */
|
|
2043
|
+
try {
|
|
2044
|
+
_sanitizeAttachedShadowRoots(dirty);
|
|
2045
|
+
} catch (error) {
|
|
2046
|
+
_neutralizeRoot(dirty);
|
|
2047
|
+
throw error;
|
|
2048
|
+
}
|
|
1457
2049
|
} else if (_isNode(dirty)) {
|
|
1458
2050
|
/* If dirty is a DOM element, append to an empty document to avoid
|
|
1459
2051
|
elements being stripped by the parser */
|
|
@@ -1470,14 +2062,16 @@ var purify = _commonjsHelpers.createCommonjsModule(function (module, exports) {
|
|
|
1470
2062
|
}
|
|
1471
2063
|
/* Clonable shadow roots are deep-cloned by importNode(); sanitize
|
|
1472
2064
|
them before the main iterator runs, since the iterator does not
|
|
1473
|
-
descend into shadow trees.
|
|
1474
|
-
|
|
2065
|
+
descend into shadow trees. The walk routes every read through a
|
|
2066
|
+
cached prototype getter so clobbering descendants on a form root
|
|
2067
|
+
cannot hide a shadow host from this pass. */
|
|
2068
|
+
_sanitizeAttachedShadowRoots(importedNode);
|
|
1475
2069
|
} else {
|
|
1476
2070
|
/* Exit directly if we have nothing to do */
|
|
1477
2071
|
if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT &&
|
|
1478
2072
|
// eslint-disable-next-line unicorn/prefer-includes
|
|
1479
2073
|
dirty.indexOf('<') === -1) {
|
|
1480
|
-
return trustedTypesPolicy && RETURN_TRUSTED_TYPE ?
|
|
2074
|
+
return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? _createTrustedHTML(dirty) : dirty;
|
|
1481
2075
|
}
|
|
1482
2076
|
/* Initialize the document to work on */
|
|
1483
2077
|
body = _initDocument(dirty);
|
|
@@ -1491,29 +2085,59 @@ var purify = _commonjsHelpers.createCommonjsModule(function (module, exports) {
|
|
|
1491
2085
|
_forceRemove(body.firstChild);
|
|
1492
2086
|
}
|
|
1493
2087
|
/* Get node iterator */
|
|
1494
|
-
const nodeIterator = _createNodeIterator(
|
|
1495
|
-
/* Now start iterating over the created document
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
2088
|
+
const nodeIterator = _createNodeIterator(inPlace ? dirty : body);
|
|
2089
|
+
/* Now start iterating over the created document.
|
|
2090
|
+
The walk runs inside an exception barrier (campaign-3 F2): a re-entrant
|
|
2091
|
+
engine/custom-element mutation can detach a node mid-walk so
|
|
2092
|
+
`_forceRemove`'s parentless guard throws, aborting the loop. Without the
|
|
2093
|
+
barrier the caller's in-place tree would be left half-sanitized with the
|
|
2094
|
+
unvisited tail still armed. On any throw we fail closed — strip the
|
|
2095
|
+
in-place root bare — then rethrow so the existing throw contract is
|
|
2096
|
+
preserved. (String/DOM-copy paths never return the partial body, so the
|
|
2097
|
+
propagating throw is already fail-closed there.) */
|
|
2098
|
+
try {
|
|
2099
|
+
while (currentNode = nodeIterator.nextNode()) {
|
|
2100
|
+
/* Sanitize tags and elements */
|
|
2101
|
+
_sanitizeElements(currentNode);
|
|
2102
|
+
/* Check attributes next */
|
|
2103
|
+
_sanitizeAttributes(currentNode);
|
|
2104
|
+
/* Shadow DOM detected, sanitize it.
|
|
2105
|
+
Realm-safe check (GHSA-hpcv-96wg-7vj8): nodeType-based detection
|
|
2106
|
+
instead of instanceof, so foreign-realm <template>.content is
|
|
2107
|
+
walked correctly. */
|
|
2108
|
+
if (_isDocumentFragment(currentNode.content)) {
|
|
2109
|
+
_sanitizeShadowDOM2(currentNode.content);
|
|
2110
|
+
}
|
|
2111
|
+
}
|
|
2112
|
+
} catch (error) {
|
|
2113
|
+
if (inPlace) {
|
|
2114
|
+
_neutralizeRoot(dirty);
|
|
1504
2115
|
}
|
|
2116
|
+
throw error;
|
|
1505
2117
|
}
|
|
1506
2118
|
/* If we sanitized `dirty` in-place, return it. */
|
|
1507
|
-
if (
|
|
2119
|
+
if (inPlace) {
|
|
2120
|
+
/* Fail-closed completion of the audit-5 F1 fix: every node removed from
|
|
2121
|
+
the caller's live tree is detached but may still hold a queued
|
|
2122
|
+
resource-event handler that fires in page scope after we return. The
|
|
2123
|
+
move-hoist covers only disallowed-tag KEEP_CONTENT removals; strip the
|
|
2124
|
+
non-allow-listed attributes off every other removed subtree (clobber,
|
|
2125
|
+
mXSS, namespace, comments, KEEP_CONTENT:false, …) so those handlers are
|
|
2126
|
+
cancelled before any event can fire. Runs synchronously, pre-return. */
|
|
2127
|
+
arrayForEach(DOMPurify.removed, entry => {
|
|
2128
|
+
if (entry.element) {
|
|
2129
|
+
_neutralizeSubtree(entry.element);
|
|
2130
|
+
}
|
|
2131
|
+
});
|
|
1508
2132
|
if (SAFE_FOR_TEMPLATES) {
|
|
1509
|
-
|
|
2133
|
+
_scrubTemplateExpressions2(dirty);
|
|
1510
2134
|
}
|
|
1511
2135
|
return dirty;
|
|
1512
2136
|
}
|
|
1513
2137
|
/* Return sanitized string or DOM */
|
|
1514
2138
|
if (RETURN_DOM) {
|
|
1515
2139
|
if (SAFE_FOR_TEMPLATES) {
|
|
1516
|
-
|
|
2140
|
+
_scrubTemplateExpressions2(body);
|
|
1517
2141
|
}
|
|
1518
2142
|
if (RETURN_DOM_FRAGMENT) {
|
|
1519
2143
|
returnNode = createDocumentFragment.call(body.ownerDocument);
|
|
@@ -1543,11 +2167,9 @@ var purify = _commonjsHelpers.createCommonjsModule(function (module, exports) {
|
|
|
1543
2167
|
}
|
|
1544
2168
|
/* Sanitize final string template-safe */
|
|
1545
2169
|
if (SAFE_FOR_TEMPLATES) {
|
|
1546
|
-
|
|
1547
|
-
serializedHTML = stringReplace(serializedHTML, expr, ' ');
|
|
1548
|
-
});
|
|
2170
|
+
serializedHTML = _stripTemplateExpressions(serializedHTML);
|
|
1549
2171
|
}
|
|
1550
|
-
return trustedTypesPolicy && RETURN_TRUSTED_TYPE ?
|
|
2172
|
+
return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? _createTrustedHTML(serializedHTML) : serializedHTML;
|
|
1551
2173
|
};
|
|
1552
2174
|
DOMPurify.setConfig = function () {
|
|
1553
2175
|
let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
@@ -1557,6 +2179,12 @@ var purify = _commonjsHelpers.createCommonjsModule(function (module, exports) {
|
|
|
1557
2179
|
DOMPurify.clearConfig = function () {
|
|
1558
2180
|
CONFIG = null;
|
|
1559
2181
|
SET_CONFIG = false;
|
|
2182
|
+
// Drop any caller-supplied Trusted Types policy so it cannot poison later
|
|
2183
|
+
// `RETURN_TRUSTED_TYPE` output. The internal default policy (cached, and
|
|
2184
|
+
// never recreated — Trusted Types throws on duplicate names) is restored by
|
|
2185
|
+
// the next `_parseConfig`. See GHSA-vxr8-fq34-vvx9.
|
|
2186
|
+
trustedTypesPolicy = defaultTrustedTypesPolicy;
|
|
2187
|
+
emptyHTML = '';
|
|
1560
2188
|
};
|
|
1561
2189
|
DOMPurify.isValidAttribute = function (tag, attr, value) {
|
|
1562
2190
|
/* Initialize shared config vars if necessary. */
|