@sankhyalabs/ezui 7.3.3-rc.1 → 7.3.4-dev.1

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.
Files changed (721) hide show
  1. package/README.md +8 -8
  2. package/dist/cjs/classic-search-list_8.cjs.entry.js +1 -1
  3. package/dist/cjs/ez-chart.cjs.entry.js +1 -1
  4. package/dist/cjs/ez-grid.cjs.entry.js +821 -105
  5. package/dist/cjs/ez-multi-selection-list_5.cjs.entry.js +1 -1
  6. package/dist/cjs/ez-tooltip.cjs.entry.js +1 -1
  7. package/dist/cjs/{floating-ui.dom.esm-9c8bfebb.js → floating-ui.dom.esm-4a0428c0.js} +189 -186
  8. package/dist/cjs/purify-4f39f037.js +2672 -0
  9. package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +56 -0
  10. package/dist/custom-elements/index.js +2623 -630
  11. package/dist/esm/classic-search-list_8.entry.js +1 -1
  12. package/dist/esm/ez-chart.entry.js +1 -1
  13. package/dist/esm/ez-grid.entry.js +821 -105
  14. package/dist/esm/ez-multi-selection-list_5.entry.js +1 -1
  15. package/dist/esm/ez-tooltip.entry.js +1 -1
  16. package/dist/esm/{floating-ui.dom.esm-0c464cef.js → floating-ui.dom.esm-ffa73324.js} +189 -186
  17. package/dist/esm/purify-f52f5419.js +2670 -0
  18. package/dist/ezui/ezui.esm.js +1 -1
  19. package/dist/ezui/{p-9d06f315.entry.js → p-1222005d.entry.js} +1 -1
  20. package/dist/ezui/{p-1222e1b6.entry.js → p-359430a5.entry.js} +1 -1
  21. package/dist/ezui/p-58ce160e.js +3 -0
  22. package/dist/ezui/p-6369a0cd.entry.js +1 -0
  23. package/dist/ezui/p-7b6c9097.entry.js +309 -0
  24. package/dist/ezui/p-8ebe11f4.js +1 -0
  25. package/dist/ezui/{p-f7f7bb17.entry.js → p-b5d88625.entry.js} +1 -1
  26. package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +17 -0
  27. package/package.json +9 -4
  28. package/dist/cjs/ApplicationUtils-9a9185fc.js.gz +0 -0
  29. package/dist/cjs/CSSVarsUtils-f20973d1.js.gz +0 -0
  30. package/dist/cjs/CheckMode-ecb90b87.js.gz +0 -0
  31. package/dist/cjs/DialogType-2114c337.js.gz +0 -0
  32. package/dist/cjs/EzScrollDirection-b2c99895.js.gz +0 -0
  33. package/dist/cjs/FocusResolver-885f2173.js.gz +0 -0
  34. package/dist/cjs/FormLayout-fe8da83c.js.gz +0 -0
  35. package/dist/cjs/RichToolbarHelper-ea12328f.js.gz +0 -0
  36. package/dist/cjs/_commonjsHelpers-537d719a.js.gz +0 -0
  37. package/dist/cjs/app-globals-27a943d9.js.gz +0 -0
  38. package/dist/cjs/classic-search-list_8.cjs.entry.js.gz +0 -0
  39. package/dist/cjs/constants-72b7e05e.js.gz +0 -0
  40. package/dist/cjs/ez-actions-button.cjs.entry.js.gz +0 -0
  41. package/dist/cjs/ez-alert-list.cjs.entry.js.gz +0 -0
  42. package/dist/cjs/ez-alert.cjs.entry.js.gz +0 -0
  43. package/dist/cjs/ez-application.cjs.entry.js.gz +0 -0
  44. package/dist/cjs/ez-avatar.cjs.entry.js.gz +0 -0
  45. package/dist/cjs/ez-badge.cjs.entry.js.gz +0 -0
  46. package/dist/cjs/ez-breadcrumb.cjs.entry.js.gz +0 -0
  47. package/dist/cjs/ez-button.cjs.entry.js.gz +0 -0
  48. package/dist/cjs/ez-calendar.cjs.entry.js.gz +0 -0
  49. package/dist/cjs/ez-card-item.cjs.entry.js.gz +0 -0
  50. package/dist/cjs/ez-chart.cjs.entry.js.gz +0 -0
  51. package/dist/cjs/ez-check.cjs.entry.js.gz +0 -0
  52. package/dist/cjs/ez-chip.cjs.entry.js.gz +0 -0
  53. package/dist/cjs/ez-classic-combo-box.cjs.entry.js.gz +0 -0
  54. package/dist/cjs/ez-classic-date-input.cjs.entry.js.gz +0 -0
  55. package/dist/cjs/ez-classic-date-time-input.cjs.entry.js.gz +0 -0
  56. package/dist/cjs/ez-classic-input.cjs.entry.js.gz +0 -0
  57. package/dist/cjs/ez-classic-number-input.cjs.entry.js.gz +0 -0
  58. package/dist/cjs/ez-classic-search-plus.cjs.entry.js.gz +0 -0
  59. package/dist/cjs/ez-classic-search.cjs.entry.js.gz +0 -0
  60. package/dist/cjs/ez-classic-text-area.cjs.entry.js.gz +0 -0
  61. package/dist/cjs/ez-classic-time-input.cjs.entry.js.gz +0 -0
  62. package/dist/cjs/ez-collapsible-box.cjs.entry.js.gz +0 -0
  63. package/dist/cjs/ez-combo-box.cjs.entry.js.gz +0 -0
  64. package/dist/cjs/ez-date-input.cjs.entry.js.gz +0 -0
  65. package/dist/cjs/ez-date-time-input.cjs.entry.js.gz +0 -0
  66. package/dist/cjs/ez-dialog.cjs.entry.js.gz +0 -0
  67. package/dist/cjs/ez-double-list.cjs.entry.js.gz +0 -0
  68. package/dist/cjs/ez-dropdown.cjs.entry.js.gz +0 -0
  69. package/dist/cjs/ez-empty-card.cjs.entry.js.gz +0 -0
  70. package/dist/cjs/ez-file-item.cjs.entry.js.gz +0 -0
  71. package/dist/cjs/ez-filter-input.cjs.entry.js.gz +0 -0
  72. package/dist/cjs/ez-form-view.cjs.entry.js.gz +0 -0
  73. package/dist/cjs/ez-form.cjs.entry.js.gz +0 -0
  74. package/dist/cjs/ez-grid-pagination.cjs.entry.js.gz +0 -0
  75. package/dist/cjs/ez-grid-view.cjs.entry.js.gz +0 -0
  76. package/dist/cjs/ez-grid.cjs.entry.js.gz +0 -0
  77. package/dist/cjs/ez-guide-navigator.cjs.entry.js.gz +0 -0
  78. package/dist/cjs/ez-icon.cjs.entry.js.gz +0 -0
  79. package/dist/cjs/ez-link-builder_6.cjs.entry.js.gz +0 -0
  80. package/dist/cjs/ez-list-item.cjs.entry.js.gz +0 -0
  81. package/dist/cjs/ez-list.cjs.entry.js.gz +0 -0
  82. package/dist/cjs/ez-loading-bar.cjs.entry.js.gz +0 -0
  83. package/dist/cjs/ez-modal-container.cjs.entry.js.gz +0 -0
  84. package/dist/cjs/ez-modal.cjs.entry.js.gz +0 -0
  85. package/dist/cjs/ez-multi-selection-list_5.cjs.entry.js.gz +0 -0
  86. package/dist/cjs/ez-number-input.cjs.entry.js.gz +0 -0
  87. package/dist/cjs/ez-pagination.cjs.entry.js.gz +0 -0
  88. package/dist/cjs/ez-popover.cjs.entry.js.gz +0 -0
  89. package/dist/cjs/ez-popup.cjs.entry.js.gz +0 -0
  90. package/dist/cjs/ez-progress-bar.cjs.entry.js.gz +0 -0
  91. package/dist/cjs/ez-radio-button.cjs.entry.js.gz +0 -0
  92. package/dist/cjs/ez-record-navigation.cjs.entry.js.gz +0 -0
  93. package/dist/cjs/ez-rich-toolbar-item.cjs.entry.js.gz +0 -0
  94. package/dist/cjs/ez-scroller_2.cjs.entry.js.gz +0 -0
  95. package/dist/cjs/ez-search-plus.cjs.entry.js.gz +0 -0
  96. package/dist/cjs/ez-search-result-list.cjs.entry.js.gz +0 -0
  97. package/dist/cjs/ez-search.cjs.entry.js.gz +0 -0
  98. package/dist/cjs/ez-sidebar-navigator.cjs.entry.js.gz +0 -0
  99. package/dist/cjs/ez-skeleton.cjs.entry.js.gz +0 -0
  100. package/dist/cjs/ez-sortable-list.cjs.entry.js.gz +0 -0
  101. package/dist/cjs/ez-spinner.cjs.entry.js.gz +0 -0
  102. package/dist/cjs/ez-split-button.cjs.entry.js.gz +0 -0
  103. package/dist/cjs/ez-split-item.cjs.entry.js.gz +0 -0
  104. package/dist/cjs/ez-split-panel.cjs.entry.js.gz +0 -0
  105. package/dist/cjs/ez-tabselector.cjs.entry.js.gz +0 -0
  106. package/dist/cjs/ez-tag-input.cjs.entry.js.gz +0 -0
  107. package/dist/cjs/ez-tag.cjs.entry.js.gz +0 -0
  108. package/dist/cjs/ez-text-area.cjs.entry.js.gz +0 -0
  109. package/dist/cjs/ez-text-input.cjs.entry.js.gz +0 -0
  110. package/dist/cjs/ez-tile-medium.cjs.entry.js.gz +0 -0
  111. package/dist/cjs/ez-tile.cjs.entry.js.gz +0 -0
  112. package/dist/cjs/ez-time-input.cjs.entry.js.gz +0 -0
  113. package/dist/cjs/ez-toast.cjs.entry.js.gz +0 -0
  114. package/dist/cjs/ez-tooltip.cjs.entry.js.gz +0 -0
  115. package/dist/cjs/ez-tree.cjs.entry.js.gz +0 -0
  116. package/dist/cjs/ez-underface.cjs.entry.js.gz +0 -0
  117. package/dist/cjs/ez-upload.cjs.entry.js.gz +0 -0
  118. package/dist/cjs/ez-view-stack.cjs.entry.js.gz +0 -0
  119. package/dist/cjs/ezListHelper-0d3970b4.js.gz +0 -0
  120. package/dist/cjs/ezui.cjs.js.gz +0 -0
  121. package/dist/cjs/filter-column.cjs.entry.js.gz +0 -0
  122. package/dist/cjs/floating-ui.dom.esm-9c8bfebb.js.gz +0 -0
  123. package/dist/cjs/index-a7b0c73d.js.gz +0 -0
  124. package/dist/cjs/index-d4a1cad8.js.gz +0 -0
  125. package/dist/cjs/index.cjs.js.gz +0 -0
  126. package/dist/cjs/loader.cjs.js.gz +0 -0
  127. package/dist/cjs/purify-8c74770b.js +0 -1398
  128. package/dist/cjs/purify-8c74770b.js.gz +0 -0
  129. package/dist/cjs/search-column-c04897a9.js.gz +0 -0
  130. package/dist/cjs/searchFormatters-051f8677.js.gz +0 -0
  131. package/dist/cjs/searchFormatters-b7e1ed1e.js.gz +0 -0
  132. package/dist/cjs/types-6a5df0c7.js.gz +0 -0
  133. package/dist/collection/components/ez-actions-button/ez-actions-button.css.gz +0 -0
  134. package/dist/collection/components/ez-actions-button/ez-actions-button.js.gz +0 -0
  135. package/dist/collection/components/ez-alert/ez-alert.css.gz +0 -0
  136. package/dist/collection/components/ez-alert/ez-alert.js.gz +0 -0
  137. package/dist/collection/components/ez-alert-list/ez-alert-list.css.gz +0 -0
  138. package/dist/collection/components/ez-alert-list/ez-alert-list.js.gz +0 -0
  139. package/dist/collection/components/ez-application/ez-application.css.gz +0 -0
  140. package/dist/collection/components/ez-application/ez-application.js.gz +0 -0
  141. package/dist/collection/components/ez-avatar/ez-avatar.css.gz +0 -0
  142. package/dist/collection/components/ez-avatar/ez-avatar.js.gz +0 -0
  143. package/dist/collection/components/ez-badge/enum/sizes.js.gz +0 -0
  144. package/dist/collection/components/ez-badge/ez-badge.css.gz +0 -0
  145. package/dist/collection/components/ez-badge/ez-badge.js.gz +0 -0
  146. package/dist/collection/components/ez-badge/interfaces/IPosition.js.gz +0 -0
  147. package/dist/collection/components/ez-breadcrumb/ez-breadcrumb.css.gz +0 -0
  148. package/dist/collection/components/ez-breadcrumb/ez-breadcrumb.js.gz +0 -0
  149. package/dist/collection/components/ez-breadcrumb/subcomponents/breadcrumb-item.js.gz +0 -0
  150. package/dist/collection/components/ez-button/ez-button.css.gz +0 -0
  151. package/dist/collection/components/ez-button/ez-button.js.gz +0 -0
  152. package/dist/collection/components/ez-calendar/ez-calendar.css.gz +0 -0
  153. package/dist/collection/components/ez-calendar/ez-calendar.js.gz +0 -0
  154. package/dist/collection/components/ez-card-item/ez-card-item.css.gz +0 -0
  155. package/dist/collection/components/ez-card-item/ez-card-item.js.gz +0 -0
  156. package/dist/collection/components/ez-chart/components/BarChart.js.gz +0 -0
  157. package/dist/collection/components/ez-chart/components/ColumnChart.js.gz +0 -0
  158. package/dist/collection/components/ez-chart/components/DonutChart.js.gz +0 -0
  159. package/dist/collection/components/ez-chart/components/LineChart.js.gz +0 -0
  160. package/dist/collection/components/ez-chart/components/PieChart.js.gz +0 -0
  161. package/dist/collection/components/ez-chart/components/index.js.gz +0 -0
  162. package/dist/collection/components/ez-chart/ez-chart.css.gz +0 -0
  163. package/dist/collection/components/ez-chart/ez-chart.js.gz +0 -0
  164. package/dist/collection/components/ez-chart/interfaces/ChartAxis.js.gz +0 -0
  165. package/dist/collection/components/ez-chart/interfaces/ChartContext.js.gz +0 -0
  166. package/dist/collection/components/ez-chart/interfaces/ChartOptions.js.gz +0 -0
  167. package/dist/collection/components/ez-chart/interfaces/ChartSerie.js.gz +0 -0
  168. package/dist/collection/components/ez-chart/interfaces/ChartStrategies.js.gz +0 -0
  169. package/dist/collection/components/ez-chart/interfaces/ChartType.js.gz +0 -0
  170. package/dist/collection/components/ez-chart/interfaces/ChartTypeValue.js.gz +0 -0
  171. package/dist/collection/components/ez-chart/interfaces/index.js.gz +0 -0
  172. package/dist/collection/components/ez-chart/test/mock-chart.js.gz +0 -0
  173. package/dist/collection/components/ez-chart/types/BaseHighChartsRender.js.gz +0 -0
  174. package/dist/collection/components/ez-check/CheckMode.js.gz +0 -0
  175. package/dist/collection/components/ez-check/ez-check.css.gz +0 -0
  176. package/dist/collection/components/ez-check/ez-check.js.gz +0 -0
  177. package/dist/collection/components/ez-chip/ez-chip.css.gz +0 -0
  178. package/dist/collection/components/ez-chip/ez-chip.js.gz +0 -0
  179. package/dist/collection/components/ez-classic-combo-box/ez-classic-combo-box.css.gz +0 -0
  180. package/dist/collection/components/ez-classic-combo-box/ez-classic-combo-box.js.gz +0 -0
  181. package/dist/collection/components/ez-classic-combo-box/interfaces/IOption.js.gz +0 -0
  182. package/dist/collection/components/ez-classic-date-input/ez-classic-date-input.css.gz +0 -0
  183. package/dist/collection/components/ez-classic-date-input/ez-classic-date-input.js.gz +0 -0
  184. package/dist/collection/components/ez-classic-date-time-input/ez-classic-date-time-input.css.gz +0 -0
  185. package/dist/collection/components/ez-classic-date-time-input/ez-classic-date-time-input.js.gz +0 -0
  186. package/dist/collection/components/ez-classic-input/ez-classic-input.css.gz +0 -0
  187. package/dist/collection/components/ez-classic-input/ez-classic-input.js.gz +0 -0
  188. package/dist/collection/components/ez-classic-input/interfaces/optionsSetFocus.js.gz +0 -0
  189. package/dist/collection/components/ez-classic-input/utils/maskFormatter.js.gz +0 -0
  190. package/dist/collection/components/ez-classic-number-input/ez-classic-number-input.css.gz +0 -0
  191. package/dist/collection/components/ez-classic-number-input/ez-classic-number-input.js.gz +0 -0
  192. package/dist/collection/components/ez-classic-search/ez-classic-search.css.gz +0 -0
  193. package/dist/collection/components/ez-classic-search/ez-classic-search.js.gz +0 -0
  194. package/dist/collection/components/ez-classic-search/subcomponent/classic-search-list/classic-search-list.css.gz +0 -0
  195. package/dist/collection/components/ez-classic-search/subcomponent/classic-search-list/classic-search-list.js.gz +0 -0
  196. package/dist/collection/components/ez-classic-search/utils/searchFormatters.js.gz +0 -0
  197. package/dist/collection/components/ez-classic-search-plus/ez-classic-search-plus.css.gz +0 -0
  198. package/dist/collection/components/ez-classic-search-plus/ez-classic-search-plus.js.gz +0 -0
  199. package/dist/collection/components/ez-classic-search-plus/subcomponent/ez-search-result-list/ez-classic-search-result-list.css.gz +0 -0
  200. package/dist/collection/components/ez-classic-search-plus/subcomponent/ez-search-result-list/ez-classic-search-result-list.js.gz +0 -0
  201. package/dist/collection/components/ez-classic-text-area/ez-classic-text-area.css.gz +0 -0
  202. package/dist/collection/components/ez-classic-text-area/ez-classic-text-area.js.gz +0 -0
  203. package/dist/collection/components/ez-classic-text-area/interfaces/optionsSetFocus.js.gz +0 -0
  204. package/dist/collection/components/ez-classic-time-input/ez-classic-time-input.css.gz +0 -0
  205. package/dist/collection/components/ez-classic-time-input/ez-classic-time-input.js.gz +0 -0
  206. package/dist/collection/components/ez-collapsible-box/ez-collapsible-box.css.gz +0 -0
  207. package/dist/collection/components/ez-collapsible-box/ez-collapsible-box.js.gz +0 -0
  208. package/dist/collection/components/ez-combo-box/ez-combo-box-list/ez-combo-box-list.css.gz +0 -0
  209. package/dist/collection/components/ez-combo-box/ez-combo-box-list/ez-combo-box-list.js.gz +0 -0
  210. package/dist/collection/components/ez-combo-box/ez-combo-box.css.gz +0 -0
  211. package/dist/collection/components/ez-combo-box/ez-combo-box.js.gz +0 -0
  212. package/dist/collection/components/ez-date-input/ez-date-input.css.gz +0 -0
  213. package/dist/collection/components/ez-date-input/ez-date-input.js.gz +0 -0
  214. package/dist/collection/components/ez-date-time-input/ez-date-time-input.css.gz +0 -0
  215. package/dist/collection/components/ez-date-time-input/ez-date-time-input.js.gz +0 -0
  216. package/dist/collection/components/ez-dialog/DialogType.js.gz +0 -0
  217. package/dist/collection/components/ez-dialog/ez-dialog.css.gz +0 -0
  218. package/dist/collection/components/ez-dialog/ez-dialog.js.gz +0 -0
  219. package/dist/collection/components/ez-double-list/doubleListHelper.js.gz +0 -0
  220. package/dist/collection/components/ez-double-list/ez-double-list.css.gz +0 -0
  221. package/dist/collection/components/ez-double-list/ez-double-list.js.gz +0 -0
  222. package/dist/collection/components/ez-dropdown/ez-dropdown.css.gz +0 -0
  223. package/dist/collection/components/ez-dropdown/ez-dropdown.js.gz +0 -0
  224. package/dist/collection/components/ez-dropdown/structure/DropdownItem.js.gz +0 -0
  225. package/dist/collection/components/ez-dropdown/structure/SubmenuControl.js.gz +0 -0
  226. package/dist/collection/components/ez-empty-card/ez-empty-card.css.gz +0 -0
  227. package/dist/collection/components/ez-empty-card/ez-empty-card.js.gz +0 -0
  228. package/dist/collection/components/ez-file-item/ez-file-item.css.gz +0 -0
  229. package/dist/collection/components/ez-file-item/ez-file-item.js.gz +0 -0
  230. package/dist/collection/components/ez-filter-input/ez-filter-input.css.gz +0 -0
  231. package/dist/collection/components/ez-filter-input/ez-filter-input.js.gz +0 -0
  232. package/dist/collection/components/ez-form/ez-form.css.gz +0 -0
  233. package/dist/collection/components/ez-form/ez-form.js.gz +0 -0
  234. package/dist/collection/components/ez-form/store/form.slice.js.gz +0 -0
  235. package/dist/collection/components/ez-form-view/custom-input/ez-custom-form-input.js.gz +0 -0
  236. package/dist/collection/components/ez-form-view/ez-form-view.css.gz +0 -0
  237. package/dist/collection/components/ez-form-view/ez-form-view.js.gz +0 -0
  238. package/dist/collection/components/ez-form-view/fieldbuilder/FieldBuilder.js.gz +0 -0
  239. package/dist/collection/components/ez-form-view/fieldbuilder/templates/CheckBox.tpl.js.gz +0 -0
  240. package/dist/collection/components/ez-form-view/fieldbuilder/templates/ComboBox.tpl.js.gz +0 -0
  241. package/dist/collection/components/ez-form-view/fieldbuilder/templates/DateInput.tpl.js.gz +0 -0
  242. package/dist/collection/components/ez-form-view/fieldbuilder/templates/FileInput.tpl.js.gz +0 -0
  243. package/dist/collection/components/ez-form-view/fieldbuilder/templates/ImageInput.tpl.js.gz +0 -0
  244. package/dist/collection/components/ez-form-view/fieldbuilder/templates/MultiSelectInput.tpl.js.gz +0 -0
  245. package/dist/collection/components/ez-form-view/fieldbuilder/templates/NumberInput.tpl.js.gz +0 -0
  246. package/dist/collection/components/ez-form-view/fieldbuilder/templates/RichText.tpl.js.gz +0 -0
  247. package/dist/collection/components/ez-form-view/fieldbuilder/templates/SearchInput.tpl.js.gz +0 -0
  248. package/dist/collection/components/ez-form-view/fieldbuilder/templates/SearchInputPlus.tpl.js.gz +0 -0
  249. package/dist/collection/components/ez-form-view/fieldbuilder/templates/TextArea.tpl.js.gz +0 -0
  250. package/dist/collection/components/ez-form-view/fieldbuilder/templates/TextInput.tpl.js.gz +0 -0
  251. package/dist/collection/components/ez-form-view/interfaces/IFormViewField.js.gz +0 -0
  252. package/dist/collection/components/ez-form-view/interfaces/index.js.gz +0 -0
  253. package/dist/collection/components/ez-form-view/structure/index.js.gz +0 -0
  254. package/dist/collection/components/ez-grid/controller/EzGridController.js.gz +0 -0
  255. package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js.gz +0 -0
  256. package/dist/collection/components/ez-grid/controller/ag-grid/DataSource.js.gz +0 -0
  257. package/dist/collection/components/ez-grid/controller/ag-grid/DataSourceInterceptor.js.gz +0 -0
  258. package/dist/collection/components/ez-grid/controller/ag-grid/GridEditionManager.js.gz +0 -0
  259. package/dist/collection/components/ez-grid/controller/ag-grid/components/EzGridCustomCellEditor.js.gz +0 -0
  260. package/dist/collection/components/ez-grid/controller/ag-grid/components/EzGridCustomCellRender.js.gz +0 -0
  261. package/dist/collection/components/ez-grid/controller/ag-grid/components/EzGridCustomHeader.js.gz +0 -0
  262. package/dist/collection/components/ez-grid/controller/ag-grid/components/cellRendererStatus.js.gz +0 -0
  263. package/dist/collection/components/ez-grid/controller/ag-grid/components/selectionHeader.js.gz +0 -0
  264. package/dist/collection/components/ez-grid/controller/ag-grid/components/test/constants/EzGridCustomCellEditorConstants.js.gz +0 -0
  265. package/dist/collection/components/ez-grid/controller/ag-grid/components/test/constants/EzGridCustomCellRenderConstants.js.gz +0 -0
  266. package/dist/collection/components/ez-grid/controller/ag-grid/editor/EzCellEditor.js.gz +0 -0
  267. package/dist/collection/components/ez-grid/controller/ag-grid/editor/EzCellRender.js.gz +0 -0
  268. package/dist/collection/components/ez-grid/controller/ag-grid/editor/GridEditorUtils.js.gz +0 -0
  269. package/dist/collection/components/ez-grid/controller/ag-grid/editor/IEditorMetadata.js.gz +0 -0
  270. package/dist/collection/components/ez-grid/controller/ag-grid/editor/IUICellEditor.js.gz +0 -0
  271. package/dist/collection/components/ez-grid/controller/ag-grid/editor/IUICellRender.js.gz +0 -0
  272. package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/ComboBox.tpl.js.gz +0 -0
  273. package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/DateInput.tpl.js.gz +0 -0
  274. package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/NumberInput.tpl.js.gz +0 -0
  275. package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/Search.tpl.js.gz +0 -0
  276. package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/SearchPlus.tpl.js.gz +0 -0
  277. package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/TextInput.tpl.js.gz +0 -0
  278. package/dist/collection/components/ez-grid/controller/ag-grid/gridColumnDefaultWidths.js.gz +0 -0
  279. package/dist/collection/components/ez-grid/controller/ag-grid/mock/Server.js.gz +0 -0
  280. package/dist/collection/components/ez-grid/controller/ag-grid/test/constants/GridEditionMock.js.gz +0 -0
  281. package/dist/collection/components/ez-grid/controller/ag-grid/utils/AggFunctionResolver.js.gz +0 -0
  282. package/dist/collection/components/ez-grid/controller/ag-grid/utils/buildLocaleText.js.gz +0 -0
  283. package/dist/collection/components/ez-grid/ez-grid.css.gz +0 -0
  284. package/dist/collection/components/ez-grid/ez-grid.js.gz +0 -0
  285. package/dist/collection/components/ez-grid/interfaces/IAggegationFunc.js.gz +0 -0
  286. package/dist/collection/components/ez-grid/interfaces/IColumnFilter.js.gz +0 -0
  287. package/dist/collection/components/ez-grid/interfaces/ICustomFormatter.js.gz +0 -0
  288. package/dist/collection/components/ez-grid/interfaces/IGridMode.js.gz +0 -0
  289. package/dist/collection/components/ez-grid/interfaces/ISelection.js.gz +0 -0
  290. package/dist/collection/components/ez-grid/interfaces/ISelectionToastConfig.js.gz +0 -0
  291. package/dist/collection/components/ez-grid/interfaces/index.js.gz +0 -0
  292. package/dist/collection/components/ez-grid/subcomponents/filter-column.css.gz +0 -0
  293. package/dist/collection/components/ez-grid/subcomponents/filter-column.js.gz +0 -0
  294. package/dist/collection/components/ez-grid/subcomponents/selection-counter.js.gz +0 -0
  295. package/dist/collection/components/ez-grid/subcomponents/utils/selectionCounterUtils.js.gz +0 -0
  296. package/dist/collection/components/ez-grid/test/resources/gridDataUnit.js.gz +0 -0
  297. package/dist/collection/components/ez-grid/utils/ColumnFilterManager.js.gz +0 -0
  298. package/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource.js.gz +0 -0
  299. package/dist/collection/components/ez-grid/utils/index.js.gz +0 -0
  300. package/dist/collection/components/ez-grid-pagination/ez-grid-pagination.css.gz +0 -0
  301. package/dist/collection/components/ez-grid-pagination/ez-grid-pagination.js.gz +0 -0
  302. package/dist/collection/components/ez-grid-pagination/ez-grid-pagination.model.js.gz +0 -0
  303. package/dist/collection/components/ez-grid-view/ez-grid-view.css.gz +0 -0
  304. package/dist/collection/components/ez-grid-view/ez-grid-view.js.gz +0 -0
  305. package/dist/collection/components/ez-guide-navigator/ez-guide-navigator.css.gz +0 -0
  306. package/dist/collection/components/ez-guide-navigator/ez-guide-navigator.js.gz +0 -0
  307. package/dist/collection/components/ez-guide-navigator/interfaces/IGuideItem.js.gz +0 -0
  308. package/dist/collection/components/ez-guide-navigator/interfaces/index.js.gz +0 -0
  309. package/dist/collection/components/ez-icon/ez-icon.css.gz +0 -0
  310. package/dist/collection/components/ez-icon/ez-icon.js.gz +0 -0
  311. package/dist/collection/components/ez-image-input/ez-image-input.css.gz +0 -0
  312. package/dist/collection/components/ez-image-input/ez-image-input.js.gz +0 -0
  313. package/dist/collection/components/ez-list/ez-list.css.gz +0 -0
  314. package/dist/collection/components/ez-list/ez-list.js.gz +0 -0
  315. package/dist/collection/components/ez-list/ezListHelper.js.gz +0 -0
  316. package/dist/collection/components/ez-list-item/ez-list-item.css.gz +0 -0
  317. package/dist/collection/components/ez-list-item/ez-list-item.js.gz +0 -0
  318. package/dist/collection/components/ez-loading-bar/ez-loading-bar.css.gz +0 -0
  319. package/dist/collection/components/ez-loading-bar/ez-loading-bar.js.gz +0 -0
  320. package/dist/collection/components/ez-modal/ez-modal.css.gz +0 -0
  321. package/dist/collection/components/ez-modal/ez-modal.js.gz +0 -0
  322. package/dist/collection/components/ez-modal-container/ez-modal-container.css.gz +0 -0
  323. package/dist/collection/components/ez-modal-container/ez-modal-container.js.gz +0 -0
  324. package/dist/collection/components/ez-modal-container/index.js.gz +0 -0
  325. package/dist/collection/components/ez-modal-container/modal-action.js.gz +0 -0
  326. package/dist/collection/components/ez-modal-container/modal-button-status.js.gz +0 -0
  327. package/dist/collection/components/ez-multi-select-input/ez-multi-select-input.css.gz +0 -0
  328. package/dist/collection/components/ez-multi-select-input/ez-multi-select-input.js.gz +0 -0
  329. package/dist/collection/components/ez-multi-selection-list/ez-multi-selection-list.css.gz +0 -0
  330. package/dist/collection/components/ez-multi-selection-list/ez-multi-selection-list.js.gz +0 -0
  331. package/dist/collection/components/ez-multi-selection-list/interfaces/IMultiSelectionListDataSource.js.gz +0 -0
  332. package/dist/collection/components/ez-multi-selection-list/interfaces/IMultiSelectionOption.js.gz +0 -0
  333. package/dist/collection/components/ez-multi-selection-list/interfaces/IStaticOptionsFetchConfig.js.gz +0 -0
  334. package/dist/collection/components/ez-multi-selection-list/subcomponents/multi-selection-box-message.css.gz +0 -0
  335. package/dist/collection/components/ez-multi-selection-list/subcomponents/multi-selection-box-message.js.gz +0 -0
  336. package/dist/collection/components/ez-number-input/ez-number-input.css.gz +0 -0
  337. package/dist/collection/components/ez-number-input/ez-number-input.js.gz +0 -0
  338. package/dist/collection/components/ez-pagination/ez-pagination.css.gz +0 -0
  339. package/dist/collection/components/ez-pagination/ez-pagination.js.gz +0 -0
  340. package/dist/collection/components/ez-popover/ez-popover.css.gz +0 -0
  341. package/dist/collection/components/ez-popover/ez-popover.js.gz +0 -0
  342. package/dist/collection/components/ez-popover-plus/ez-popover-plus.css.gz +0 -0
  343. package/dist/collection/components/ez-popover-plus/ez-popover-plus.js.gz +0 -0
  344. package/dist/collection/components/ez-popover-plus/subcomponent/ez-popover-core.css.gz +0 -0
  345. package/dist/collection/components/ez-popover-plus/subcomponent/ez-popover-core.js.gz +0 -0
  346. package/dist/collection/components/ez-popup/ez-popup.css.gz +0 -0
  347. package/dist/collection/components/ez-popup/ez-popup.js.gz +0 -0
  348. package/dist/collection/components/ez-popup/interfaces/EzButtonProps.js.gz +0 -0
  349. package/dist/collection/components/ez-progress-bar/ez-progress-bar.css.gz +0 -0
  350. package/dist/collection/components/ez-progress-bar/ez-progress-bar.js.gz +0 -0
  351. package/dist/collection/components/ez-radio-button/ez-radio-button.css.gz +0 -0
  352. package/dist/collection/components/ez-radio-button/ez-radio-button.js.gz +0 -0
  353. package/dist/collection/components/ez-record-navigation/ez-record-navigation.css.gz +0 -0
  354. package/dist/collection/components/ez-record-navigation/ez-record-navigation.js.gz +0 -0
  355. package/dist/collection/components/ez-rich-text/ez-link-builder/ez-link-builder.css.gz +0 -0
  356. package/dist/collection/components/ez-rich-text/ez-link-builder/ez-link-builder.js.gz +0 -0
  357. package/dist/collection/components/ez-rich-text/ez-rich-text.css.gz +0 -0
  358. package/dist/collection/components/ez-rich-text/ez-rich-text.js.gz +0 -0
  359. package/dist/collection/components/ez-rich-text/ez-rich-toolbar/RichToolbarHelper.js.gz +0 -0
  360. package/dist/collection/components/ez-rich-text/ez-rich-toolbar/ez-rich-toolbar-arrows/ez-rich-toolbar-arrows.css.gz +0 -0
  361. package/dist/collection/components/ez-rich-text/ez-rich-toolbar/ez-rich-toolbar-arrows/ez-rich-toolbar-arrows.js.gz +0 -0
  362. package/dist/collection/components/ez-rich-text/ez-rich-toolbar/ez-rich-toolbar-configs/ez-rich-toolbar-configs.css.gz +0 -0
  363. package/dist/collection/components/ez-rich-text/ez-rich-toolbar/ez-rich-toolbar-configs/ez-rich-toolbar-configs.js.gz +0 -0
  364. package/dist/collection/components/ez-rich-text/ez-rich-toolbar/ez-rich-toolbar-item/ez-rich-toolbar-item.css.gz +0 -0
  365. package/dist/collection/components/ez-rich-text/ez-rich-toolbar/ez-rich-toolbar-item/ez-rich-toolbar-item.js.gz +0 -0
  366. package/dist/collection/components/ez-rich-text/ez-rich-toolbar/ez-rich-toolbar-letters/ez-rich-toolbar-letters.css.gz +0 -0
  367. package/dist/collection/components/ez-rich-text/ez-rich-toolbar/ez-rich-toolbar-letters/ez-rich-toolbar-letters.js.gz +0 -0
  368. package/dist/collection/components/ez-rich-text/ez-rich-toolbar/ez-rich-toolbar.css.gz +0 -0
  369. package/dist/collection/components/ez-rich-text/ez-rich-toolbar/ez-rich-toolbar.js.gz +0 -0
  370. package/dist/collection/components/ez-rich-text/ez-simple-image-uploader/ez-simple-image-uploader.css.gz +0 -0
  371. package/dist/collection/components/ez-rich-text/ez-simple-image-uploader/ez-simple-image-uploader.js.gz +0 -0
  372. package/dist/collection/components/ez-rich-text/ez-simple-image-uploader/test/resource/imageBase64.js.gz +0 -0
  373. package/dist/collection/components/ez-rich-text/ez-simple-image-uploader/utils/fileToBase64.js.gz +0 -0
  374. package/dist/collection/components/ez-rich-text/ez-simple-image-uploader/utils/formatBytes.js.gz +0 -0
  375. package/dist/collection/components/ez-scroller/EzScrollDirection.js.gz +0 -0
  376. package/dist/collection/components/ez-scroller/EzScrollNavigationMode.js.gz +0 -0
  377. package/dist/collection/components/ez-scroller/ez-scroller.css.gz +0 -0
  378. package/dist/collection/components/ez-scroller/ez-scroller.js.gz +0 -0
  379. package/dist/collection/components/ez-search/ez-search.css.gz +0 -0
  380. package/dist/collection/components/ez-search/ez-search.js.gz +0 -0
  381. package/dist/collection/components/ez-search/subcomponent/search-list/search-list.css.gz +0 -0
  382. package/dist/collection/components/ez-search/subcomponent/search-list/search-list.js.gz +0 -0
  383. package/dist/collection/components/ez-search/utils/searchFormatters.js.gz +0 -0
  384. package/dist/collection/components/ez-search-plus/ez-search-plus.css.gz +0 -0
  385. package/dist/collection/components/ez-search-plus/ez-search-plus.js.gz +0 -0
  386. package/dist/collection/components/ez-search-plus/subcomponent/ez-search-result-list/ez-search-result-list.css.gz +0 -0
  387. package/dist/collection/components/ez-search-plus/subcomponent/ez-search-result-list/ez-search-result-list.js.gz +0 -0
  388. package/dist/collection/components/ez-sidebar-button/ez-sidebar-button.css.gz +0 -0
  389. package/dist/collection/components/ez-sidebar-button/ez-sidebar-button.js.gz +0 -0
  390. package/dist/collection/components/ez-sidebar-navigator/ez-sidebar-navigator.css.gz +0 -0
  391. package/dist/collection/components/ez-sidebar-navigator/ez-sidebar-navigator.js.gz +0 -0
  392. package/dist/collection/components/ez-sidebar-navigator/interfaces/ModeMenuEnum.js.gz +0 -0
  393. package/dist/collection/components/ez-sidebar-navigator/interfaces/SizeMenuEnum.js.gz +0 -0
  394. package/dist/collection/components/ez-sidebar-navigator/interfaces/TypeMenuEnum.js.gz +0 -0
  395. package/dist/collection/components/ez-sidebar-navigator/interfaces/index.js.gz +0 -0
  396. package/dist/collection/components/ez-skeleton/ez-skeleton.constants.js.gz +0 -0
  397. package/dist/collection/components/ez-skeleton/ez-skeleton.css.gz +0 -0
  398. package/dist/collection/components/ez-skeleton/ez-skeleton.js.gz +0 -0
  399. package/dist/collection/components/ez-sortable-list/ez-sortable-list.css.gz +0 -0
  400. package/dist/collection/components/ez-sortable-list/ez-sortable-list.js.gz +0 -0
  401. package/dist/collection/components/ez-spinner/ez-spinner.css.gz +0 -0
  402. package/dist/collection/components/ez-spinner/ez-spinner.js.gz +0 -0
  403. package/dist/collection/components/ez-split-button/ez-split-button.css.gz +0 -0
  404. package/dist/collection/components/ez-split-button/ez-split-button.js.gz +0 -0
  405. package/dist/collection/components/ez-split-button/test/dropdownItems.js.gz +0 -0
  406. package/dist/collection/components/ez-split-panel/ez-split-panel.css.gz +0 -0
  407. package/dist/collection/components/ez-split-panel/ez-split-panel.js.gz +0 -0
  408. package/dist/collection/components/ez-split-panel/interfaces/IPanelSizeInfo.js.gz +0 -0
  409. package/dist/collection/components/ez-split-panel/structure/item/ez-split-item.css.gz +0 -0
  410. package/dist/collection/components/ez-split-panel/structure/item/ez-split-item.js.gz +0 -0
  411. package/dist/collection/components/ez-tabselector/ez-tabselector.css.gz +0 -0
  412. package/dist/collection/components/ez-tabselector/ez-tabselector.js.gz +0 -0
  413. package/dist/collection/components/ez-tag/ez-tag.css.gz +0 -0
  414. package/dist/collection/components/ez-tag/ez-tag.js.gz +0 -0
  415. package/dist/collection/components/ez-tag-input/ez-tag-input.css.gz +0 -0
  416. package/dist/collection/components/ez-tag-input/ez-tag-input.js.gz +0 -0
  417. package/dist/collection/components/ez-tag-input/interfaces/optionsSetFocus.js.gz +0 -0
  418. package/dist/collection/components/ez-text-area/ez-text-area.css.gz +0 -0
  419. package/dist/collection/components/ez-text-area/ez-text-area.js.gz +0 -0
  420. package/dist/collection/components/ez-text-edit/ez-text-edit.css.gz +0 -0
  421. package/dist/collection/components/ez-text-edit/ez-text-edit.js.gz +0 -0
  422. package/dist/collection/components/ez-text-input/ez-text-input.css.gz +0 -0
  423. package/dist/collection/components/ez-text-input/ez-text-input.js.gz +0 -0
  424. package/dist/collection/components/ez-tile/ez-tile.css.gz +0 -0
  425. package/dist/collection/components/ez-tile/ez-tile.js.gz +0 -0
  426. package/dist/collection/components/ez-tile-medium/ez-tile-medium.css.gz +0 -0
  427. package/dist/collection/components/ez-tile-medium/ez-tile-medium.js.gz +0 -0
  428. package/dist/collection/components/ez-time-input/ez-time-input.css.gz +0 -0
  429. package/dist/collection/components/ez-time-input/ez-time-input.js.gz +0 -0
  430. package/dist/collection/components/ez-toast/ez-toast.css.gz +0 -0
  431. package/dist/collection/components/ez-toast/ez-toast.js.gz +0 -0
  432. package/dist/collection/components/ez-tooltip/ez-tooltip.css.gz +0 -0
  433. package/dist/collection/components/ez-tooltip/ez-tooltip.js.gz +0 -0
  434. package/dist/collection/components/ez-tree/ez-tree.css.gz +0 -0
  435. package/dist/collection/components/ez-tree/ez-tree.js.gz +0 -0
  436. package/dist/collection/components/ez-tree/interfaces/ITree.js.gz +0 -0
  437. package/dist/collection/components/ez-tree/interfaces/ITreeItem.js.gz +0 -0
  438. package/dist/collection/components/ez-tree/interfaces/ITreeItemBadge.js.gz +0 -0
  439. package/dist/collection/components/ez-tree/subcomponents/DefaultIconResolver.js.gz +0 -0
  440. package/dist/collection/components/ez-tree/subcomponents/DefaultTooltipResolver.js.gz +0 -0
  441. package/dist/collection/components/ez-tree/subcomponents/TreeItem.js.gz +0 -0
  442. package/dist/collection/components/ez-tree/subcomponents/index.js.gz +0 -0
  443. package/dist/collection/components/ez-tree/types/Node.js.gz +0 -0
  444. package/dist/collection/components/ez-tree/types/Tree.js.gz +0 -0
  445. package/dist/collection/components/ez-tree/types/UpdateItemConfig.js.gz +0 -0
  446. package/dist/collection/components/ez-underface/ez-underface.css.gz +0 -0
  447. package/dist/collection/components/ez-underface/ez-underface.js.gz +0 -0
  448. package/dist/collection/components/ez-upload/RemoteFile.js.gz +0 -0
  449. package/dist/collection/components/ez-upload/ez-upload.css.gz +0 -0
  450. package/dist/collection/components/ez-upload/ez-upload.js.gz +0 -0
  451. package/dist/collection/components/ez-view-stack/ez-view-stack.css.gz +0 -0
  452. package/dist/collection/components/ez-view-stack/ez-view-stack.js.gz +0 -0
  453. package/dist/collection/global/app-init.js.gz +0 -0
  454. package/dist/collection/index.js.gz +0 -0
  455. package/dist/collection/servidor.js.gz +0 -0
  456. package/dist/collection/setupTests.js.gz +0 -0
  457. package/dist/collection/sw.js.gz +0 -0
  458. package/dist/collection/utils/ApplicationUtils.js.gz +0 -0
  459. package/dist/collection/utils/AssetsUtils.js.gz +0 -0
  460. package/dist/collection/utils/CSSVarsUtils.js.gz +0 -0
  461. package/dist/collection/utils/FocusResolver.js.gz +0 -0
  462. package/dist/collection/utils/ag-grid-license.js.gz +0 -0
  463. package/dist/collection/utils/constants.js.gz +0 -0
  464. package/dist/collection/utils/customEditor/interfaces/ICustomEditor.js.gz +0 -0
  465. package/dist/collection/utils/customEditor/interfaces/ICustomEditorInfo.js.gz +0 -0
  466. package/dist/collection/utils/customRender/interfaces/ICustomRender.js.gz +0 -0
  467. package/dist/collection/utils/customRender/interfaces/ICustomRenderInfo.js.gz +0 -0
  468. package/dist/collection/utils/form/DataBinder.js.gz +0 -0
  469. package/dist/collection/utils/form/FormMetadata.js.gz +0 -0
  470. package/dist/collection/utils/form/index.js.gz +0 -0
  471. package/dist/collection/utils/form/interfaces/FormLayout.js.gz +0 -0
  472. package/dist/collection/utils/form/interfaces/IDefaultConfig.js.gz +0 -0
  473. package/dist/collection/utils/form/interfaces/IFormCardConfig.js.gz +0 -0
  474. package/dist/collection/utils/form/interfaces/IFormConfig.js.gz +0 -0
  475. package/dist/collection/utils/form/interfaces/IFormSheetMetadata.js.gz +0 -0
  476. package/dist/collection/utils/form/interfaces/ISummaryField.js.gz +0 -0
  477. package/dist/collection/utils/form/interfaces/ITabConfig.js.gz +0 -0
  478. package/dist/collection/utils/form/interfaces/index.js.gz +0 -0
  479. package/dist/collection/utils/form/test/DataBinder.test.js.gz +0 -0
  480. package/dist/collection/utils/form/test/resources/metadataTest.js.gz +0 -0
  481. package/dist/collection/utils/i18n/elanguages.js.gz +0 -0
  482. package/dist/collection/utils/i18n/index.js.gz +0 -0
  483. package/dist/collection/utils/i18n/locales/en-us.js.gz +0 -0
  484. package/dist/collection/utils/i18n/locales/es-es.js.gz +0 -0
  485. package/dist/collection/utils/i18n/locales/pt-br.js.gz +0 -0
  486. package/dist/collection/utils/i18n/translations.js.gz +0 -0
  487. package/dist/collection/utils/index.js.gz +0 -0
  488. package/dist/collection/utils/interfaces/AbstractFieldMetadata.js.gz +0 -0
  489. package/dist/collection/utils/interfaces/IAction.js.gz +0 -0
  490. package/dist/collection/utils/interfaces/IFieldConfig.js.gz +0 -0
  491. package/dist/collection/utils/mock/ez-upload-mock.js.gz +0 -0
  492. package/dist/collection/utils/search/types.js.gz +0 -0
  493. package/dist/collection/utils/searchColumn/search-column.js.gz +0 -0
  494. package/dist/collection/utils/utils.js.gz +0 -0
  495. package/dist/collection/utils/validators/recordvalidator/IInvalidCells.js.gz +0 -0
  496. package/dist/collection/utils/validators/recordvalidator/IInvalidField.js.gz +0 -0
  497. package/dist/collection/utils/validators/recordvalidator/IRecordValidator.js.gz +0 -0
  498. package/dist/collection/utils/validators/recordvalidator/IValidationResult.js.gz +0 -0
  499. package/dist/collection/utils/validators/recordvalidator/IValidationSource.js.gz +0 -0
  500. package/dist/collection/utils/validators/recordvalidator/RecordValidationProcessor.js.gz +0 -0
  501. package/dist/custom-elements/index.js.gz +0 -0
  502. package/dist/esm/ApplicationUtils-29d2709c.js.gz +0 -0
  503. package/dist/esm/CSSVarsUtils-acba92d7.js.gz +0 -0
  504. package/dist/esm/CheckMode-bdb2ec19.js.gz +0 -0
  505. package/dist/esm/DialogType-54a62731.js.gz +0 -0
  506. package/dist/esm/EzScrollDirection-2df26c93.js.gz +0 -0
  507. package/dist/esm/FocusResolver-1ccbf850.js.gz +0 -0
  508. package/dist/esm/FormLayout-bda67973.js.gz +0 -0
  509. package/dist/esm/RichToolbarHelper-f3a149c4.js.gz +0 -0
  510. package/dist/esm/_commonjsHelpers-9943807e.js.gz +0 -0
  511. package/dist/esm/app-globals-44bdc4c4.js.gz +0 -0
  512. package/dist/esm/classic-search-list_8.entry.js.gz +0 -0
  513. package/dist/esm/constants-3fabe81e.js.gz +0 -0
  514. package/dist/esm/ez-actions-button.entry.js.gz +0 -0
  515. package/dist/esm/ez-alert-list.entry.js.gz +0 -0
  516. package/dist/esm/ez-alert.entry.js.gz +0 -0
  517. package/dist/esm/ez-application.entry.js.gz +0 -0
  518. package/dist/esm/ez-avatar.entry.js.gz +0 -0
  519. package/dist/esm/ez-badge.entry.js.gz +0 -0
  520. package/dist/esm/ez-breadcrumb.entry.js.gz +0 -0
  521. package/dist/esm/ez-button.entry.js.gz +0 -0
  522. package/dist/esm/ez-calendar.entry.js.gz +0 -0
  523. package/dist/esm/ez-card-item.entry.js.gz +0 -0
  524. package/dist/esm/ez-chart.entry.js.gz +0 -0
  525. package/dist/esm/ez-check.entry.js.gz +0 -0
  526. package/dist/esm/ez-chip.entry.js.gz +0 -0
  527. package/dist/esm/ez-classic-combo-box.entry.js.gz +0 -0
  528. package/dist/esm/ez-classic-date-input.entry.js.gz +0 -0
  529. package/dist/esm/ez-classic-date-time-input.entry.js.gz +0 -0
  530. package/dist/esm/ez-classic-input.entry.js.gz +0 -0
  531. package/dist/esm/ez-classic-number-input.entry.js.gz +0 -0
  532. package/dist/esm/ez-classic-search-plus.entry.js.gz +0 -0
  533. package/dist/esm/ez-classic-search.entry.js.gz +0 -0
  534. package/dist/esm/ez-classic-text-area.entry.js.gz +0 -0
  535. package/dist/esm/ez-classic-time-input.entry.js.gz +0 -0
  536. package/dist/esm/ez-collapsible-box.entry.js.gz +0 -0
  537. package/dist/esm/ez-combo-box.entry.js.gz +0 -0
  538. package/dist/esm/ez-date-input.entry.js.gz +0 -0
  539. package/dist/esm/ez-date-time-input.entry.js.gz +0 -0
  540. package/dist/esm/ez-dialog.entry.js.gz +0 -0
  541. package/dist/esm/ez-double-list.entry.js.gz +0 -0
  542. package/dist/esm/ez-dropdown.entry.js.gz +0 -0
  543. package/dist/esm/ez-empty-card.entry.js.gz +0 -0
  544. package/dist/esm/ez-file-item.entry.js.gz +0 -0
  545. package/dist/esm/ez-filter-input.entry.js.gz +0 -0
  546. package/dist/esm/ez-form-view.entry.js.gz +0 -0
  547. package/dist/esm/ez-form.entry.js.gz +0 -0
  548. package/dist/esm/ez-grid-pagination.entry.js.gz +0 -0
  549. package/dist/esm/ez-grid-view.entry.js.gz +0 -0
  550. package/dist/esm/ez-grid.entry.js.gz +0 -0
  551. package/dist/esm/ez-guide-navigator.entry.js.gz +0 -0
  552. package/dist/esm/ez-icon.entry.js.gz +0 -0
  553. package/dist/esm/ez-link-builder_6.entry.js.gz +0 -0
  554. package/dist/esm/ez-list-item.entry.js.gz +0 -0
  555. package/dist/esm/ez-list.entry.js.gz +0 -0
  556. package/dist/esm/ez-loading-bar.entry.js.gz +0 -0
  557. package/dist/esm/ez-modal-container.entry.js.gz +0 -0
  558. package/dist/esm/ez-modal.entry.js.gz +0 -0
  559. package/dist/esm/ez-multi-selection-list_5.entry.js.gz +0 -0
  560. package/dist/esm/ez-number-input.entry.js.gz +0 -0
  561. package/dist/esm/ez-pagination.entry.js.gz +0 -0
  562. package/dist/esm/ez-popover.entry.js.gz +0 -0
  563. package/dist/esm/ez-popup.entry.js.gz +0 -0
  564. package/dist/esm/ez-progress-bar.entry.js.gz +0 -0
  565. package/dist/esm/ez-radio-button.entry.js.gz +0 -0
  566. package/dist/esm/ez-record-navigation.entry.js.gz +0 -0
  567. package/dist/esm/ez-rich-toolbar-item.entry.js.gz +0 -0
  568. package/dist/esm/ez-scroller_2.entry.js.gz +0 -0
  569. package/dist/esm/ez-search-plus.entry.js.gz +0 -0
  570. package/dist/esm/ez-search-result-list.entry.js.gz +0 -0
  571. package/dist/esm/ez-search.entry.js.gz +0 -0
  572. package/dist/esm/ez-sidebar-navigator.entry.js.gz +0 -0
  573. package/dist/esm/ez-skeleton.entry.js.gz +0 -0
  574. package/dist/esm/ez-sortable-list.entry.js.gz +0 -0
  575. package/dist/esm/ez-spinner.entry.js.gz +0 -0
  576. package/dist/esm/ez-split-button.entry.js.gz +0 -0
  577. package/dist/esm/ez-split-item.entry.js.gz +0 -0
  578. package/dist/esm/ez-split-panel.entry.js.gz +0 -0
  579. package/dist/esm/ez-tabselector.entry.js.gz +0 -0
  580. package/dist/esm/ez-tag-input.entry.js.gz +0 -0
  581. package/dist/esm/ez-tag.entry.js.gz +0 -0
  582. package/dist/esm/ez-text-area.entry.js.gz +0 -0
  583. package/dist/esm/ez-text-input.entry.js.gz +0 -0
  584. package/dist/esm/ez-tile-medium.entry.js.gz +0 -0
  585. package/dist/esm/ez-tile.entry.js.gz +0 -0
  586. package/dist/esm/ez-time-input.entry.js.gz +0 -0
  587. package/dist/esm/ez-toast.entry.js.gz +0 -0
  588. package/dist/esm/ez-tooltip.entry.js.gz +0 -0
  589. package/dist/esm/ez-tree.entry.js.gz +0 -0
  590. package/dist/esm/ez-underface.entry.js.gz +0 -0
  591. package/dist/esm/ez-upload.entry.js.gz +0 -0
  592. package/dist/esm/ez-view-stack.entry.js.gz +0 -0
  593. package/dist/esm/ezListHelper-00fb9b8d.js.gz +0 -0
  594. package/dist/esm/ezui.js.gz +0 -0
  595. package/dist/esm/filter-column.entry.js.gz +0 -0
  596. package/dist/esm/floating-ui.dom.esm-0c464cef.js.gz +0 -0
  597. package/dist/esm/index-b5a15d4b.js.gz +0 -0
  598. package/dist/esm/index-baa5e267.js.gz +0 -0
  599. package/dist/esm/index.js.gz +0 -0
  600. package/dist/esm/loader.js.gz +0 -0
  601. package/dist/esm/polyfills/core-js.js.gz +0 -0
  602. package/dist/esm/polyfills/css-shim.js.gz +0 -0
  603. package/dist/esm/polyfills/dom.js.gz +0 -0
  604. package/dist/esm/polyfills/es5-html-element.js.gz +0 -0
  605. package/dist/esm/polyfills/index.js.gz +0 -0
  606. package/dist/esm/polyfills/system.js.gz +0 -0
  607. package/dist/esm/purify-ff423562.js +0 -1396
  608. package/dist/esm/purify-ff423562.js.gz +0 -0
  609. package/dist/esm/search-column-9414ad22.js.gz +0 -0
  610. package/dist/esm/searchFormatters-6d9b06e4.js.gz +0 -0
  611. package/dist/esm/searchFormatters-8229207e.js.gz +0 -0
  612. package/dist/esm/types-6f6b2650.js.gz +0 -0
  613. package/dist/ezui/ezui.esm.js.gz +0 -0
  614. package/dist/ezui/index.esm.js.gz +0 -0
  615. package/dist/ezui/p-08e3184d.entry.js.gz +0 -0
  616. package/dist/ezui/p-0d80e3ec.entry.js.gz +0 -0
  617. package/dist/ezui/p-0ddb9a95.entry.js.gz +0 -0
  618. package/dist/ezui/p-0fbf5842.entry.js.gz +0 -0
  619. package/dist/ezui/p-112455b1.js.gz +0 -0
  620. package/dist/ezui/p-1160c33a.entry.js.gz +0 -0
  621. package/dist/ezui/p-11fa490d.entry.js +0 -309
  622. package/dist/ezui/p-11fa490d.entry.js.gz +0 -0
  623. package/dist/ezui/p-1222e1b6.entry.js.gz +0 -0
  624. package/dist/ezui/p-178cb9df.entry.js.gz +0 -0
  625. package/dist/ezui/p-1c7aa5af.entry.js.gz +0 -0
  626. package/dist/ezui/p-1e7a8633.entry.js.gz +0 -0
  627. package/dist/ezui/p-1f50fa05.entry.js.gz +0 -0
  628. package/dist/ezui/p-20c024f7.entry.js.gz +0 -0
  629. package/dist/ezui/p-23a36bb6.js.gz +0 -0
  630. package/dist/ezui/p-27236a0f.entry.js.gz +0 -0
  631. package/dist/ezui/p-2c1c9ec6.entry.js.gz +0 -0
  632. package/dist/ezui/p-320c401f.js.gz +0 -0
  633. package/dist/ezui/p-34a09786.entry.js.gz +0 -0
  634. package/dist/ezui/p-381570d2.entry.js.gz +0 -0
  635. package/dist/ezui/p-3b7d9f30.js.gz +0 -0
  636. package/dist/ezui/p-3b9ccdb7.entry.js.gz +0 -0
  637. package/dist/ezui/p-3e767a74.js.gz +0 -0
  638. package/dist/ezui/p-40a0a773.entry.js.gz +0 -0
  639. package/dist/ezui/p-40a60148.js.gz +0 -0
  640. package/dist/ezui/p-40c92fc7.entry.js.gz +0 -0
  641. package/dist/ezui/p-411c0222.entry.js.gz +0 -0
  642. package/dist/ezui/p-45d09b32.entry.js.gz +0 -0
  643. package/dist/ezui/p-46188bfe.entry.js.gz +0 -0
  644. package/dist/ezui/p-47e4a8ce.js.gz +0 -0
  645. package/dist/ezui/p-49bc0b59.entry.js.gz +0 -0
  646. package/dist/ezui/p-5124ba43.entry.js.gz +0 -0
  647. package/dist/ezui/p-52122022.entry.js.gz +0 -0
  648. package/dist/ezui/p-5895e687.js.gz +0 -0
  649. package/dist/ezui/p-58fa7883.js.gz +0 -0
  650. package/dist/ezui/p-5a217a52.entry.js.gz +0 -0
  651. package/dist/ezui/p-5c440899.js +0 -3
  652. package/dist/ezui/p-5c440899.js.gz +0 -0
  653. package/dist/ezui/p-5ed81457.entry.js.gz +0 -0
  654. package/dist/ezui/p-63409a57.entry.js.gz +0 -0
  655. package/dist/ezui/p-664b9f4c.entry.js.gz +0 -0
  656. package/dist/ezui/p-6c24ab67.entry.js.gz +0 -0
  657. package/dist/ezui/p-6d596a5a.entry.js.gz +0 -0
  658. package/dist/ezui/p-6f77a359.entry.js.gz +0 -0
  659. package/dist/ezui/p-73bae77e.entry.js.gz +0 -0
  660. package/dist/ezui/p-7995dcb4.entry.js +0 -1
  661. package/dist/ezui/p-7995dcb4.entry.js.gz +0 -0
  662. package/dist/ezui/p-7ecac0c4.entry.js.gz +0 -0
  663. package/dist/ezui/p-7f792043.entry.js.gz +0 -0
  664. package/dist/ezui/p-80dfc50b.js.gz +0 -0
  665. package/dist/ezui/p-83ffba67.entry.js.gz +0 -0
  666. package/dist/ezui/p-852d6133.entry.js.gz +0 -0
  667. package/dist/ezui/p-88a115b3.js.gz +0 -0
  668. package/dist/ezui/p-8df1ca33.entry.js.gz +0 -0
  669. package/dist/ezui/p-90a0b52b.entry.js.gz +0 -0
  670. package/dist/ezui/p-91c9d50e.entry.js.gz +0 -0
  671. package/dist/ezui/p-93e1c917.entry.js.gz +0 -0
  672. package/dist/ezui/p-95fb50d1.entry.js.gz +0 -0
  673. package/dist/ezui/p-97545f8e.entry.js.gz +0 -0
  674. package/dist/ezui/p-98bb8b16.js.gz +0 -0
  675. package/dist/ezui/p-9d06f315.entry.js.gz +0 -0
  676. package/dist/ezui/p-9f5fa3f9.entry.js.gz +0 -0
  677. package/dist/ezui/p-a0bf1fc7.entry.js.gz +0 -0
  678. package/dist/ezui/p-a3075f52.entry.js.gz +0 -0
  679. package/dist/ezui/p-a3ada561.entry.js.gz +0 -0
  680. package/dist/ezui/p-a62bbd49.entry.js.gz +0 -0
  681. package/dist/ezui/p-ab574d59.js.gz +0 -0
  682. package/dist/ezui/p-abfbbe1e.entry.js.gz +0 -0
  683. package/dist/ezui/p-ade1c43b.entry.js.gz +0 -0
  684. package/dist/ezui/p-afb2f145.entry.js.gz +0 -0
  685. package/dist/ezui/p-b1e45320.js.gz +0 -0
  686. package/dist/ezui/p-b29d9b0e.entry.js.gz +0 -0
  687. package/dist/ezui/p-b43fcdb6.js.gz +0 -0
  688. package/dist/ezui/p-b50289bb.entry.js.gz +0 -0
  689. package/dist/ezui/p-b853763b.js.gz +0 -0
  690. package/dist/ezui/p-bc2f844e.entry.js.gz +0 -0
  691. package/dist/ezui/p-bcf0460e.entry.js.gz +0 -0
  692. package/dist/ezui/p-be4b042f.entry.js.gz +0 -0
  693. package/dist/ezui/p-c547f48f.entry.js.gz +0 -0
  694. package/dist/ezui/p-c6b9a72a.entry.js.gz +0 -0
  695. package/dist/ezui/p-ca4c015a.entry.js.gz +0 -0
  696. package/dist/ezui/p-d6742c1e.entry.js.gz +0 -0
  697. package/dist/ezui/p-d6f50207.entry.js.gz +0 -0
  698. package/dist/ezui/p-d892e4c5.entry.js.gz +0 -0
  699. package/dist/ezui/p-d8cc640d.entry.js.gz +0 -0
  700. package/dist/ezui/p-dc628ed3.js.gz +0 -0
  701. package/dist/ezui/p-dcb7275b.entry.js.gz +0 -0
  702. package/dist/ezui/p-dcd6a163.entry.js.gz +0 -0
  703. package/dist/ezui/p-dcde2e69.entry.js.gz +0 -0
  704. package/dist/ezui/p-ddf856db.entry.js.gz +0 -0
  705. package/dist/ezui/p-de14fe07.js +0 -1
  706. package/dist/ezui/p-de14fe07.js.gz +0 -0
  707. package/dist/ezui/p-df6173c8.entry.js.gz +0 -0
  708. package/dist/ezui/p-e60aa084.entry.js.gz +0 -0
  709. package/dist/ezui/p-e75c7a23.entry.js.gz +0 -0
  710. package/dist/ezui/p-e7a7c594.entry.js.gz +0 -0
  711. package/dist/ezui/p-e8c57463.entry.js.gz +0 -0
  712. package/dist/ezui/p-eb0cfd29.entry.js.gz +0 -0
  713. package/dist/ezui/p-ec7db713.js.gz +0 -0
  714. package/dist/ezui/p-ef3cd4ef.entry.js.gz +0 -0
  715. package/dist/ezui/p-efea2c79.entry.js.gz +0 -0
  716. package/dist/ezui/p-f34ec732.entry.js.gz +0 -0
  717. package/dist/ezui/p-f7f7bb17.entry.js.gz +0 -0
  718. package/dist/ezui/p-f7fb2587.entry.js.gz +0 -0
  719. package/dist/ezui/p-fed3f5fe.entry.js.gz +0 -0
  720. package/dist/index.cjs.js.gz +0 -0
  721. package/dist/index.js.gz +0 -0
@@ -0,0 +1,2672 @@
1
+ 'use strict';
2
+
3
+ const _commonjsHelpers = require('./_commonjsHelpers-537d719a.js');
4
+
5
+ var purify = _commonjsHelpers.createCommonjsModule(function (module, exports) {
6
+ /*! @license DOMPurify 3.4.14 | (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.14/LICENSE */
7
+
8
+ (function (global, factory) {
9
+ module.exports = factory() ;
10
+ })(_commonjsHelpers.commonjsGlobal, (function () {
11
+ function _arrayLikeToArray(r, a) {
12
+ (null == a || a > r.length) && (a = r.length);
13
+ for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
14
+ return n;
15
+ }
16
+ function _arrayWithHoles(r) {
17
+ if (Array.isArray(r)) return r;
18
+ }
19
+ function _iterableToArrayLimit(r, l) {
20
+ var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
21
+ if (null != t) {
22
+ var e,
23
+ n,
24
+ i,
25
+ u,
26
+ a = [],
27
+ f = true,
28
+ o = false;
29
+ try {
30
+ if (i = (t = t.call(r)).next, 0 === l) ; else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
31
+ } catch (r) {
32
+ o = true, n = r;
33
+ } finally {
34
+ try {
35
+ if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
36
+ } finally {
37
+ if (o) throw n;
38
+ }
39
+ }
40
+ return a;
41
+ }
42
+ }
43
+ function _nonIterableRest() {
44
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
45
+ }
46
+ function _slicedToArray(r, e) {
47
+ return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
48
+ }
49
+ function _unsupportedIterableToArray(r, a) {
50
+ if (r) {
51
+ if ("string" == typeof r) return _arrayLikeToArray(r, a);
52
+ var t = {}.toString.call(r).slice(8, -1);
53
+ return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
54
+ }
55
+ }
56
+
57
+ const entries = Object.entries,
58
+ setPrototypeOf = Object.setPrototypeOf,
59
+ isFrozen = Object.isFrozen,
60
+ getPrototypeOf = Object.getPrototypeOf,
61
+ getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
62
+ let freeze = Object.freeze,
63
+ seal = Object.seal,
64
+ create = Object.create; // eslint-disable-line import/no-mutable-exports
65
+ let _ref = typeof Reflect !== 'undefined' && Reflect,
66
+ apply = _ref.apply,
67
+ construct = _ref.construct;
68
+ if (!freeze) {
69
+ freeze = function freeze(x) {
70
+ return x;
71
+ };
72
+ }
73
+ if (!seal) {
74
+ seal = function seal(x) {
75
+ return x;
76
+ };
77
+ }
78
+ if (!apply) {
79
+ apply = function apply(func, thisArg) {
80
+ for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
81
+ args[_key - 2] = arguments[_key];
82
+ }
83
+ return func.apply(thisArg, args);
84
+ };
85
+ }
86
+ if (!construct) {
87
+ construct = function construct(Func) {
88
+ for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
89
+ args[_key2 - 1] = arguments[_key2];
90
+ }
91
+ return new Func(...args);
92
+ };
93
+ }
94
+ const arrayForEach = unapply(Array.prototype.forEach);
95
+ const arrayLastIndexOf = unapply(Array.prototype.lastIndexOf);
96
+ const arrayPop = unapply(Array.prototype.pop);
97
+ const arrayPush = unapply(Array.prototype.push);
98
+ const arraySplice = unapply(Array.prototype.splice);
99
+ const arrayIsArray = Array.isArray;
100
+ const stringToLowerCase = unapply(String.prototype.toLowerCase);
101
+ const stringToString = unapply(String.prototype.toString);
102
+ const stringMatch = unapply(String.prototype.match);
103
+ const stringReplace = unapply(String.prototype.replace);
104
+ const stringIndexOf = unapply(String.prototype.indexOf);
105
+ const stringTrim = unapply(String.prototype.trim);
106
+ const numberToString = unapply(Number.prototype.toString);
107
+ const booleanToString = unapply(Boolean.prototype.toString);
108
+ const bigintToString = typeof BigInt === 'undefined' ? null : unapply(BigInt.prototype.toString);
109
+ const symbolToString = typeof Symbol === 'undefined' ? null : unapply(Symbol.prototype.toString);
110
+ const objectHasOwnProperty = unapply(Object.prototype.hasOwnProperty);
111
+ const objectToString = unapply(Object.prototype.toString);
112
+ const regExpTest = unapply(RegExp.prototype.test);
113
+ const typeErrorCreate = unconstruct(TypeError);
114
+ /**
115
+ * Creates a new function that calls the given function with a specified thisArg and arguments.
116
+ *
117
+ * @param func - The function to be wrapped and called.
118
+ * @returns A new function that calls the given function with a specified thisArg and arguments.
119
+ */
120
+ function unapply(func) {
121
+ return function (thisArg) {
122
+ if (thisArg instanceof RegExp) {
123
+ thisArg.lastIndex = 0;
124
+ }
125
+ for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
126
+ args[_key3 - 1] = arguments[_key3];
127
+ }
128
+ return apply(func, thisArg, args);
129
+ };
130
+ }
131
+ /**
132
+ * Creates a new function that constructs an instance of the given constructor function with the provided arguments.
133
+ *
134
+ * @param func - The constructor function to be wrapped and called.
135
+ * @returns A new function that constructs an instance of the given constructor function with the provided arguments.
136
+ */
137
+ function unconstruct(Func) {
138
+ return function () {
139
+ for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
140
+ args[_key4] = arguments[_key4];
141
+ }
142
+ return construct(Func, args);
143
+ };
144
+ }
145
+ /**
146
+ * Add properties to a lookup table
147
+ *
148
+ * @param set - The set to which elements will be added.
149
+ * @param array - The array containing elements to be added to the set.
150
+ * @param transformCaseFunc - An optional function to transform the case of each element before adding to the set.
151
+ * @returns The modified set with added elements.
152
+ */
153
+ function addToSet(set, array) {
154
+ let transformCaseFunc = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : stringToLowerCase;
155
+ if (setPrototypeOf) {
156
+ // Make 'in' and truthy checks like Boolean(set.constructor)
157
+ // independent of any properties defined on Object.prototype.
158
+ // Prevent prototype setters from intercepting set as a this value.
159
+ setPrototypeOf(set, null);
160
+ }
161
+ if (!arrayIsArray(array)) {
162
+ return set;
163
+ }
164
+ let l = array.length;
165
+ while (l--) {
166
+ let element = array[l];
167
+ if (typeof element === 'string') {
168
+ const lcElement = transformCaseFunc(element);
169
+ if (lcElement !== element) {
170
+ // Config presets (e.g. tags.js, attrs.js) are immutable.
171
+ if (!isFrozen(array)) {
172
+ array[l] = lcElement;
173
+ }
174
+ element = lcElement;
175
+ }
176
+ }
177
+ set[element] = true;
178
+ }
179
+ return set;
180
+ }
181
+ /**
182
+ * Clean up an array to harden against CSPP
183
+ *
184
+ * @param array - The array to be cleaned.
185
+ * @returns The cleaned version of the array
186
+ */
187
+ function cleanArray(array) {
188
+ for (let index = 0; index < array.length; index++) {
189
+ const isPropertyExist = objectHasOwnProperty(array, index);
190
+ if (!isPropertyExist) {
191
+ array[index] = null;
192
+ }
193
+ }
194
+ return array;
195
+ }
196
+ /**
197
+ * Shallow clone an object
198
+ *
199
+ * @param object - The object to be cloned.
200
+ * @returns A new object that copies the original.
201
+ */
202
+ function clone(object) {
203
+ const newObject = create(null);
204
+ for (const _ref2 of entries(object)) {
205
+ var _ref3 = _slicedToArray(_ref2, 2);
206
+ const property = _ref3[0];
207
+ const value = _ref3[1];
208
+ const isPropertyExist = objectHasOwnProperty(object, property);
209
+ if (isPropertyExist) {
210
+ if (arrayIsArray(value)) {
211
+ newObject[property] = cleanArray(value);
212
+ } else if (value && typeof value === 'object' && value.constructor === Object) {
213
+ newObject[property] = clone(value);
214
+ } else {
215
+ newObject[property] = value;
216
+ }
217
+ }
218
+ }
219
+ return newObject;
220
+ }
221
+ /**
222
+ * Convert non-node values into strings without depending on direct property access.
223
+ *
224
+ * @param value - The value to stringify.
225
+ * @returns A string representation of the provided value.
226
+ */
227
+ function stringifyValue(value) {
228
+ switch (typeof value) {
229
+ case 'string':
230
+ {
231
+ return value;
232
+ }
233
+ case 'number':
234
+ {
235
+ return numberToString(value);
236
+ }
237
+ case 'boolean':
238
+ {
239
+ return booleanToString(value);
240
+ }
241
+ case 'bigint':
242
+ {
243
+ return bigintToString ? bigintToString(value) : '0';
244
+ }
245
+ case 'symbol':
246
+ {
247
+ return symbolToString ? symbolToString(value) : 'Symbol()';
248
+ }
249
+ case 'undefined':
250
+ {
251
+ return objectToString(value);
252
+ }
253
+ case 'function':
254
+ case 'object':
255
+ {
256
+ if (value === null) {
257
+ return objectToString(value);
258
+ }
259
+ const valueAsRecord = value;
260
+ const valueToString = lookupGetter(valueAsRecord, 'toString');
261
+ if (typeof valueToString === 'function') {
262
+ const stringified = valueToString(valueAsRecord);
263
+ return typeof stringified === 'string' ? stringified : objectToString(stringified);
264
+ }
265
+ return objectToString(value);
266
+ }
267
+ default:
268
+ {
269
+ return objectToString(value);
270
+ }
271
+ }
272
+ }
273
+ /**
274
+ * This method automatically checks if the prop is function or getter and behaves accordingly.
275
+ *
276
+ * @param object - The object to look up the getter function in its prototype chain.
277
+ * @param prop - The property name for which to find the getter function.
278
+ * @returns The getter function found in the prototype chain or a fallback function.
279
+ */
280
+ function lookupGetter(object, prop) {
281
+ while (object !== null) {
282
+ const desc = getOwnPropertyDescriptor(object, prop);
283
+ if (desc) {
284
+ if (desc.get) {
285
+ return unapply(desc.get);
286
+ }
287
+ if (typeof desc.value === 'function') {
288
+ return unapply(desc.value);
289
+ }
290
+ }
291
+ object = getPrototypeOf(object);
292
+ }
293
+ function fallbackValue() {
294
+ return null;
295
+ }
296
+ return fallbackValue;
297
+ }
298
+ function isRegex(value) {
299
+ try {
300
+ regExpTest(value, '');
301
+ return true;
302
+ } catch (_unused) {
303
+ return false;
304
+ }
305
+ }
306
+
307
+ const html$1 = freeze(['a', 'abbr', 'acronym', 'address', 'area', 'article', 'aside', 'audio', 'b', 'bdi', 'bdo', 'big', 'blink', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'content', 'data', 'datalist', 'dd', 'decorator', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'element', 'em', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'img', 'input', 'ins', 'kbd', 'label', 'legend', 'li', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meter', 'nav', 'nobr', 'ol', 'optgroup', 'option', 'output', 'p', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'search', 'section', 'select', 'shadow', 'slot', 'small', 'source', 'spacer', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr']);
308
+ const svg$1 = freeze(['svg', 'a', 'altglyph', 'altglyphdef', 'altglyphitem', 'animatecolor', 'animatemotion', 'animatetransform', 'circle', 'clippath', 'defs', 'desc', 'ellipse', 'enterkeyhint', 'exportparts', 'filter', 'font', 'g', 'glyph', 'glyphref', 'hkern', 'image', 'inputmode', 'line', 'lineargradient', 'marker', 'mask', 'metadata', 'mpath', 'part', 'path', 'pattern', 'polygon', 'polyline', 'radialgradient', 'rect', 'stop', 'style', 'switch', 'symbol', 'text', 'textpath', 'title', 'tref', 'tspan', 'view', 'vkern']);
309
+ const svgFilters = freeze(['feBlend', 'feColorMatrix', 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', 'feDistantLight', 'feDropShadow', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feImage', 'feMerge', 'feMergeNode', 'feMorphology', 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence']);
310
+ // List of SVG elements that are disallowed by default.
311
+ // We still need to know them so that we can do namespace
312
+ // checks properly in case one wants to add them to
313
+ // allow-list.
314
+ const svgDisallowed = freeze(['animate', 'color-profile', 'cursor', 'discard', 'font-face', 'font-face-format', 'font-face-name', 'font-face-src', 'font-face-uri', 'foreignobject', 'hatch', 'hatchpath', 'mesh', 'meshgradient', 'meshpatch', 'meshrow', 'missing-glyph', 'script', 'set', 'solidcolor', 'unknown', 'use']);
315
+ const mathMl$1 = freeze(['math', 'menclose', 'merror', 'mfenced', 'mfrac', 'mglyph', 'mi', 'mlabeledtr', 'mmultiscripts', 'mn', 'mo', 'mover', 'mpadded', 'mphantom', 'mroot', 'mrow', 'ms', 'mspace', 'msqrt', 'mstyle', 'msub', 'msup', 'msubsup', 'mtable', 'mtd', 'mtext', 'mtr', 'munder', 'munderover', 'mprescripts']);
316
+ // Similarly to SVG, we want to know all MathML elements,
317
+ // even those that we disallow by default.
318
+ const mathMlDisallowed = freeze(['maction', 'maligngroup', 'malignmark', 'mlongdiv', 'mscarries', 'mscarry', 'msgroup', 'mstack', 'msline', 'msrow', 'semantics', 'annotation', 'annotation-xml', 'mprescripts', 'none']);
319
+ const text = freeze(['#text']);
320
+
321
+ const html = freeze(['accept', 'action', 'align', 'alt', 'autocapitalize', 'autocomplete', 'autopictureinpicture', 'autoplay', 'background', 'bgcolor', 'border', 'capture', 'cellpadding', 'cellspacing', 'checked', 'cite', 'class', 'clear', 'color', 'cols', 'colspan', 'command', 'commandfor', 'controls', 'controlslist', 'coords', 'crossorigin', 'datetime', 'decoding', 'default', 'dir', 'disabled', 'disablepictureinpicture', 'disableremoteplayback', 'download', 'draggable', 'enctype', 'enterkeyhint', 'exportparts', 'face', 'for', 'headers', 'height', 'hidden', 'high', 'href', 'hreflang', 'id', 'inert', 'inputmode', 'integrity', 'ismap', 'kind', 'label', 'lang', 'list', 'loading', 'loop', 'low', 'max', 'maxlength', 'media', 'method', 'min', 'minlength', 'multiple', 'muted', 'name', 'nonce', 'noshade', 'novalidate', 'nowrap', 'open', 'optimum', 'part', 'pattern', 'placeholder', 'playsinline', 'popover', 'popovertarget', 'popovertargetaction', 'poster', 'preload', 'pubdate', 'radiogroup', 'readonly', 'rel', 'required', 'rev', 'reversed', 'role', 'rows', 'rowspan', 'spellcheck', 'scope', 'selected', 'shape', 'size', 'sizes', 'slot', 'span', 'srclang', 'start', 'src', 'srcset', 'step', 'style', 'summary', 'tabindex', 'title', 'translate', 'type', 'usemap', 'valign', 'value', 'width', 'wrap', 'xmlns']);
322
+ const svg = freeze(['accent-height', 'accumulate', 'additive', 'alignment-baseline', 'amplitude', 'ascent', 'attributename', 'attributetype', 'azimuth', 'basefrequency', 'baseline-shift', 'begin', 'bias', 'by', 'class', 'clip', 'clippathunits', 'clip-path', 'clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cx', 'cy', 'd', 'dx', 'dy', 'diffuseconstant', 'direction', 'display', 'divisor', 'dominant-baseline', 'dur', 'edgemode', 'elevation', 'end', 'exponent', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'filterunits', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'fx', 'fy', 'g1', 'g2', 'glyph-name', 'glyphref', 'gradientunits', 'gradienttransform', 'height', 'href', 'id', 'image-rendering', 'in', 'in2', 'intercept', 'k', 'k1', 'k2', 'k3', 'k4', 'kerning', 'keypoints', 'keysplines', 'keytimes', 'lang', 'lengthadjust', 'letter-spacing', 'kernelmatrix', 'kernelunitlength', 'lighting-color', 'local', 'marker-end', 'marker-mid', 'marker-start', 'markerheight', 'markerunits', 'markerwidth', 'maskcontentunits', 'maskunits', 'max', 'mask', 'mask-type', 'media', 'method', 'mode', 'min', 'name', 'numoctaves', 'offset', 'operator', 'opacity', 'order', 'orient', 'orientation', 'origin', 'overflow', 'paint-order', 'path', 'pathlength', 'patterncontentunits', 'patterntransform', 'patternunits', 'pointer-events', 'points', 'preservealpha', 'preserveaspectratio', 'primitiveunits', 'r', 'rx', 'ry', 'radius', 'refx', 'refy', 'repeatcount', 'repeatdur', 'restart', 'result', 'rotate', 'scale', 'seed', 'shape-rendering', 'slope', 'specularconstant', 'specularexponent', 'spreadmethod', 'startoffset', 'stddeviation', 'stitchtiles', 'stop-color', 'stop-opacity', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke', 'stroke-width', 'style', 'surfacescale', 'systemlanguage', 'tabindex', 'tablevalues', 'targetx', 'targety', 'transform', 'transform-origin', 'text-anchor', 'text-decoration', 'text-orientation', 'text-rendering', 'textlength', 'type', 'u1', 'u2', 'unicode', 'values', 'vector-effect', 'viewbox', 'visibility', 'version', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'width', 'word-spacing', 'wrap', 'writing-mode', 'xchannelselector', 'ychannelselector', 'x', 'x1', 'x2', 'xmlns', 'y', 'y1', 'y2', 'z', 'zoomandpan']);
323
+ const mathMl = freeze(['accent', 'accentunder', 'align', 'bevelled', 'close', 'columnalign', 'columnlines', 'columnspacing', 'columnspan', 'denomalign', 'depth', 'dir', 'display', 'displaystyle', 'encoding', 'fence', 'frame', 'height', 'href', 'id', 'largeop', 'length', 'linethickness', 'lquote', 'lspace', 'mathbackground', 'mathcolor', 'mathsize', 'mathvariant', 'maxsize', 'minsize', 'movablelimits', 'notation', 'numalign', 'open', 'rowalign', 'rowlines', 'rowspacing', 'rowspan', 'rspace', 'rquote', 'scriptlevel', 'scriptminsize', 'scriptsizemultiplier', 'selection', 'separator', 'separators', 'stretchy', 'subscriptshift', 'supscriptshift', 'symmetric', 'voffset', 'width', 'xmlns']);
324
+ const xml = freeze(['xlink:href', 'xml:id', 'xlink:title', 'xml:space', 'xmlns:xlink']);
325
+
326
+ const MUSTACHE_EXPR = seal(/{{[\w\W]*|^[\w\W]*}}/g);
327
+ const ERB_EXPR = seal(/<%[\w\W]*|^[\w\W]*%>/g);
328
+ const TMPLIT_EXPR = seal(/\${[\w\W]*/g);
329
+ const DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]+$/); // eslint-disable-line no-useless-escape
330
+ const ARIA_ATTR = seal(/^aria-[\-\w]+$/); // eslint-disable-line no-useless-escape
331
+ const IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i // eslint-disable-line no-useless-escape
332
+ );
333
+ const IS_SCRIPT_OR_DATA = seal(/^(?:\w+script|data):/i);
334
+ const ATTR_WHITESPACE = seal(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g // eslint-disable-line no-control-regex
335
+ );
336
+ const DOCTYPE_NAME = seal(/^html$/i);
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);
345
+
346
+ // https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType
347
+ const NODE_TYPE = {
348
+ element: 1,
349
+ attribute: 2,
350
+ text: 3,
351
+ cdataSection: 4,
352
+ entityReference: 5,
353
+ // Deprecated
354
+ entityNode: 6,
355
+ // Deprecated
356
+ processingInstruction: 7,
357
+ comment: 8,
358
+ document: 9,
359
+ documentType: 10,
360
+ documentFragment: 11,
361
+ notation: 12 // Deprecated
362
+ };
363
+ /* HTML-namespace elements whose child text nodes are serialized *literally*
364
+ (unescaped) by the HTML fragment-serialization algorithm. Two reparse-mXSS
365
+ shapes ride on that literal serialization:
366
+ (a) an element child - a tree the HTML parser can never build, but the DOM
367
+ API and an XML/XHTML parse can - after which a `</tag>`-bearing text
368
+ sibling breaks the element open on reparse; and
369
+ (b) text-only content that already carries the element's OWN end tag, e.g.
370
+ `<style>...</style><img onerror=x>` built as a node, which the literal
371
+ serializer emits verbatim for the HTML parser to re-open.
372
+ Shape (a) is handled by the firstElementChild branch in _isUnsafeNode; shape
373
+ (b) by the LITERAL_TEXT_CLOSE probe. Both read textContent (the raw-serialized
374
+ form for these elements) rather than innerHTML, because an XML/XHTML working
375
+ document serializes innerHTML with `<` escaped, which silently blinds the
376
+ innerHTML-based probes (rule 1's second probe and FALLBACK_TAG_CLOSE) there.
377
+ `script` is never allow-listed, but is kept here so the guard matches the
378
+ serializer's own literal-text list exactly. */
379
+ const LITERAL_TEXT_ELEMENT_NAMES = ['style', 'script', 'xmp', 'iframe', 'noembed', 'noframes', 'plaintext', 'noscript'];
380
+ const LITERAL_TEXT_ELEMENTS = freeze(addToSet({}, LITERAL_TEXT_ELEMENT_NAMES));
381
+ /* Per-element end-tag matcher. On an HTML reparse the ONLY token that
382
+ terminates a literal-text element's raw content is its own end tag; a foreign
383
+ literal-text close (e.g. `</xmp>` sitting inside `<style>`) does not break
384
+ out, so matching is per-element, not a shared alternation. The lookahead
385
+ requires an HTML tag-name terminator (whitespace, `/` or `>`) so a longer
386
+ name such as `</styles` is not mistaken for `</style`. */
387
+ const LITERAL_TEXT_CLOSE = function () {
388
+ const map = {};
389
+ arrayForEach(LITERAL_TEXT_ELEMENT_NAMES, name => {
390
+ map[name] = seal(new RegExp('</' + name + '(?=[\\t\\n\\f\\r />])', 'i'));
391
+ });
392
+ return freeze(map);
393
+ }();
394
+ const getGlobal = function getGlobal() {
395
+ return typeof window === 'undefined' ? null : window;
396
+ };
397
+ /**
398
+ * Creates a no-op policy for internal use only.
399
+ * Don't export this function outside this module!
400
+ * @param trustedTypes The policy factory.
401
+ * @param purifyHostElement The Script element used to load DOMPurify (to determine policy name suffix).
402
+ * @return The policy created (or null, if Trusted Types
403
+ * are not supported or creating the policy failed).
404
+ */
405
+ const _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes, purifyHostElement) {
406
+ if (typeof trustedTypes !== 'object' || typeof trustedTypes.createPolicy !== 'function') {
407
+ return null;
408
+ }
409
+ // Allow the callers to control the unique policy name
410
+ // by adding a data-tt-policy-suffix to the script element with the DOMPurify.
411
+ // Policy creation with duplicate names throws in Trusted Types.
412
+ let suffix = null;
413
+ const ATTR_NAME = 'data-tt-policy-suffix';
414
+ if (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) {
415
+ suffix = purifyHostElement.getAttribute(ATTR_NAME);
416
+ }
417
+ const policyName = 'dompurify' + (suffix ? '#' + suffix : '');
418
+ try {
419
+ return trustedTypes.createPolicy(policyName, {
420
+ createHTML(html) {
421
+ return html;
422
+ },
423
+ createScriptURL(scriptUrl) {
424
+ return scriptUrl;
425
+ }
426
+ });
427
+ } catch (_) {
428
+ // Policy creation failed (most likely another DOMPurify script has
429
+ // already run). Skip creating the policy, as this will only cause errors
430
+ // if TT are enforced.
431
+ console.warn('TrustedTypes policy ' + policyName + ' could not be created.');
432
+ return null;
433
+ }
434
+ };
435
+ const _createHooksMap = function _createHooksMap() {
436
+ return {
437
+ afterSanitizeAttributes: [],
438
+ afterSanitizeElements: [],
439
+ afterSanitizeShadowDOM: [],
440
+ beforeSanitizeAttributes: [],
441
+ beforeSanitizeElements: [],
442
+ beforeSanitizeShadowDOM: [],
443
+ uponSanitizeAttribute: [],
444
+ uponSanitizeElement: [],
445
+ uponSanitizeShadowNode: []
446
+ };
447
+ };
448
+ /**
449
+ * Resolve a set-valued configuration option: a fresh set built from
450
+ * cfg[key] when it is an own array property (seeded with a clone of
451
+ * options.base when given, case-normalized via options.transform),
452
+ * the fallback set otherwise.
453
+ *
454
+ * @param cfg the cloned, prototype-free configuration object
455
+ * @param key the configuration property to read
456
+ * @param fallback the set to use when the option is absent or not an array
457
+ * @param options transform and optional base set to merge into
458
+ * @returns the resolved set
459
+ */
460
+ const _resolveSetOption = function _resolveSetOption(cfg, key, fallback, options) {
461
+ return objectHasOwnProperty(cfg, key) && arrayIsArray(cfg[key]) ? addToSet(options.base ? clone(options.base) : {}, cfg[key], options.transform) : fallback;
462
+ };
463
+ /**
464
+ * Resolve an object-valued configuration option: a prototype-free clone
465
+ * of cfg[key] when it is an own, truthy object property, else a fresh
466
+ * fallback built by makeFallback (fresh on every parse, so a previous
467
+ * parse can never leak state into the next one).
468
+ *
469
+ * @param cfg the cloned, prototype-free configuration object
470
+ * @param key the configuration property to read
471
+ * @param makeFallback builds the fallback value when the option is absent
472
+ * @returns the resolved object
473
+ */
474
+ const _resolveObjectOption = function _resolveObjectOption(cfg, key, makeFallback) {
475
+ const value = objectHasOwnProperty(cfg, key) ? cfg[key] : undefined;
476
+ return value && typeof value === 'object' ? clone(value) : makeFallback();
477
+ };
478
+ function createDOMPurify() {
479
+ let window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();
480
+ const DOMPurify = root => createDOMPurify(root);
481
+ DOMPurify.version = '3.4.14';
482
+ DOMPurify.removed = [];
483
+ if (!window || !window.document || window.document.nodeType !== NODE_TYPE.document || !window.Element) {
484
+ // Not running in a browser, provide a factory function
485
+ // so that you can pass your own Window
486
+ DOMPurify.isSupported = false;
487
+ return DOMPurify;
488
+ }
489
+ let document = window.document;
490
+ const originalDocument = document;
491
+ const currentScript = originalDocument.currentScript;
492
+ const HTMLTemplateElement = window.HTMLTemplateElement,
493
+ Node = window.Node,
494
+ Element = window.Element,
495
+ NodeFilter = window.NodeFilter;
496
+ const DOMParser = window.DOMParser,
497
+ trustedTypes = window.trustedTypes;
498
+ const ElementPrototype = Element.prototype;
499
+ const cloneNode = lookupGetter(ElementPrototype, 'cloneNode');
500
+ const remove = lookupGetter(ElementPrototype, 'remove');
501
+ const getNextSibling = lookupGetter(ElementPrototype, 'nextSibling');
502
+ const getChildNodes = lookupGetter(ElementPrototype, 'childNodes');
503
+ const getParentNode = lookupGetter(ElementPrototype, 'parentNode');
504
+ const getShadowRoot = lookupGetter(ElementPrototype, 'shadowRoot');
505
+ const getAttributes = lookupGetter(ElementPrototype, 'attributes');
506
+ const getNodeType = Node && Node.prototype ? lookupGetter(Node.prototype, 'nodeType') : null;
507
+ const getNodeName = Node && Node.prototype ? lookupGetter(Node.prototype, 'nodeName') : null;
508
+ const getOwnerDocument = Node && Node.prototype ? lookupGetter(Node.prototype, 'ownerDocument') : null;
509
+ /* Clobber-safe nodeType / nodeName reads through the cached Node.prototype
510
+ getters, with a direct-property fallback for environments that lack
511
+ Node.prototype. Sites that need a different fallback (e.g. _isClobbered
512
+ returns early on a null name) intentionally keep their own reads. */
513
+ const _readNodeType = function _readNodeType(node) {
514
+ return getNodeType ? getNodeType(node) : node.nodeType;
515
+ };
516
+ const _readNodeName = function _readNodeName(node) {
517
+ return getNodeName ? getNodeName(node) : node.nodeName;
518
+ };
519
+ // As per issue #47, the web-components registry is inherited by a
520
+ // new document created via createHTMLDocument. As per the spec
521
+ // (http://w3c.github.io/webcomponents/spec/custom/#creating-and-passing-registries)
522
+ // a new empty registry is used when creating a template contents owner
523
+ // document, so we use that as our parent document to ensure nothing
524
+ // is inherited.
525
+ if (typeof HTMLTemplateElement === 'function') {
526
+ const template = document.createElement('template');
527
+ if (template.content && template.content.ownerDocument) {
528
+ document = template.content.ownerDocument;
529
+ }
530
+ }
531
+ let trustedTypesPolicy;
532
+ let emptyHTML = '';
533
+ // The instance's own internal Trusted Types policy. Unlike a caller-supplied
534
+ // `TRUSTED_TYPES_POLICY`, this is created at most once — Trusted Types throws
535
+ // on duplicate policy names — and is the only policy allowed to persist
536
+ // across configurations and survive `clearConfig()`.
537
+ let defaultTrustedTypesPolicy;
538
+ let defaultTrustedTypesPolicyResolved = false;
539
+ // Tracks whether we are already inside a call to the configured Trusted Types
540
+ // policy (`createHTML` or `createScriptURL`). If a supplied policy callback
541
+ // itself calls `DOMPurify.sanitize` (the cause of #1422), `sanitize` would
542
+ // re-enter the policy and recurse until the stack overflows. We detect that
543
+ // re-entry and throw a clear, actionable error instead. The guard is shared
544
+ // across both callbacks, because either one re-entering `sanitize` triggers
545
+ // the same unbounded recursion.
546
+ let IN_TRUSTED_TYPES_POLICY = 0;
547
+ const _assertNotInTrustedTypesPolicy = function _assertNotInTrustedTypesPolicy() {
548
+ if (IN_TRUSTED_TYPES_POLICY > 0) {
549
+ 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.');
550
+ }
551
+ };
552
+ const _createTrustedHTML = function _createTrustedHTML(html) {
553
+ _assertNotInTrustedTypesPolicy();
554
+ IN_TRUSTED_TYPES_POLICY++;
555
+ try {
556
+ return trustedTypesPolicy.createHTML(html);
557
+ } finally {
558
+ IN_TRUSTED_TYPES_POLICY--;
559
+ }
560
+ };
561
+ const _createTrustedScriptURL = function _createTrustedScriptURL(scriptUrl) {
562
+ _assertNotInTrustedTypesPolicy();
563
+ IN_TRUSTED_TYPES_POLICY++;
564
+ try {
565
+ return trustedTypesPolicy.createScriptURL(scriptUrl);
566
+ } finally {
567
+ IN_TRUSTED_TYPES_POLICY--;
568
+ }
569
+ };
570
+ // Lazily resolve (and cache) the instance's internal default policy.
571
+ // Resolution is attempted at most once: a successful `createPolicy` cannot be
572
+ // repeated (Trusted Types throws on duplicate names), and a failed or
573
+ // unsupported attempt must not be retried on every parse.
574
+ const _getDefaultTrustedTypesPolicy = function _getDefaultTrustedTypesPolicy() {
575
+ if (!defaultTrustedTypesPolicyResolved) {
576
+ defaultTrustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript);
577
+ defaultTrustedTypesPolicyResolved = true;
578
+ }
579
+ return defaultTrustedTypesPolicy;
580
+ };
581
+ const _document = document,
582
+ implementation = _document.implementation,
583
+ createNodeIterator = _document.createNodeIterator,
584
+ createDocumentFragment = _document.createDocumentFragment,
585
+ getElementsByTagName = _document.getElementsByTagName;
586
+ const importNode = originalDocument.importNode;
587
+ let hooks = _createHooksMap();
588
+ /**
589
+ * Expose whether this browser supports running the full DOMPurify.
590
+ */
591
+ DOMPurify.isSupported = typeof entries === 'function' && typeof getParentNode === 'function' && implementation && implementation.createHTMLDocument !== undefined;
592
+ const MUSTACHE_EXPR$1 = MUSTACHE_EXPR,
593
+ ERB_EXPR$1 = ERB_EXPR,
594
+ TMPLIT_EXPR$1 = TMPLIT_EXPR,
595
+ DATA_ATTR$1 = DATA_ATTR,
596
+ ARIA_ATTR$1 = ARIA_ATTR,
597
+ IS_SCRIPT_OR_DATA$1 = IS_SCRIPT_OR_DATA,
598
+ ATTR_WHITESPACE$1 = ATTR_WHITESPACE,
599
+ CUSTOM_ELEMENT$1 = CUSTOM_ELEMENT;
600
+ let IS_ALLOWED_URI$1 = IS_ALLOWED_URI;
601
+ /**
602
+ * We consider the elements and attributes below to be safe. Ideally
603
+ * don't add any new ones but feel free to remove unwanted ones.
604
+ */
605
+ /* allowed element names */
606
+ let ALLOWED_TAGS = null;
607
+ const DEFAULT_ALLOWED_TAGS = addToSet({}, [...html$1, ...svg$1, ...svgFilters, ...mathMl$1, ...text]);
608
+ /* Allowed attribute names */
609
+ let ALLOWED_ATTR = null;
610
+ const DEFAULT_ALLOWED_ATTR = addToSet({}, [...html, ...svg, ...mathMl, ...xml]);
611
+ /*
612
+ * Configure how DOMPurify should handle custom elements and their attributes as well as customized built-in elements.
613
+ * @property {RegExp|Function|null} tagNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any custom elements)
614
+ * @property {RegExp|Function|null} attributeNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any attributes not on the allow list)
615
+ * @property {boolean} allowCustomizedBuiltInElements allow custom elements derived from built-ins if they pass CUSTOM_ELEMENT_HANDLING.tagNameCheck. Default: `false`.
616
+ */
617
+ let CUSTOM_ELEMENT_HANDLING = Object.seal(create(null, {
618
+ tagNameCheck: {
619
+ writable: true,
620
+ configurable: false,
621
+ enumerable: true,
622
+ value: null
623
+ },
624
+ attributeNameCheck: {
625
+ writable: true,
626
+ configurable: false,
627
+ enumerable: true,
628
+ value: null
629
+ },
630
+ allowCustomizedBuiltInElements: {
631
+ writable: true,
632
+ configurable: false,
633
+ enumerable: true,
634
+ value: false
635
+ }
636
+ }));
637
+ /* Explicitly forbidden tags (overrides ALLOWED_TAGS/ADD_TAGS) */
638
+ let FORBID_TAGS = null;
639
+ /* Explicitly forbidden attributes (overrides ALLOWED_ATTR/ADD_ATTR) */
640
+ let FORBID_ATTR = null;
641
+ /* Config object to store ADD_TAGS/ADD_ATTR functions (when used as functions) */
642
+ const EXTRA_ELEMENT_HANDLING = Object.seal(create(null, {
643
+ tagCheck: {
644
+ writable: true,
645
+ configurable: false,
646
+ enumerable: true,
647
+ value: null
648
+ },
649
+ attributeCheck: {
650
+ writable: true,
651
+ configurable: false,
652
+ enumerable: true,
653
+ value: null
654
+ }
655
+ }));
656
+ /* Decide if ARIA attributes are okay */
657
+ let ALLOW_ARIA_ATTR = true;
658
+ /* Decide if custom data attributes are okay */
659
+ let ALLOW_DATA_ATTR = true;
660
+ /* Decide if unknown protocols are okay */
661
+ let ALLOW_UNKNOWN_PROTOCOLS = false;
662
+ /* Decide if self-closing tags in attributes are allowed.
663
+ * Usually removed due to a mXSS issue in jQuery 3.0 */
664
+ let ALLOW_SELF_CLOSE_IN_ATTR = true;
665
+ /* Output should be safe for common template engines.
666
+ * This means, DOMPurify removes data attributes, mustaches and ERB
667
+ */
668
+ let SAFE_FOR_TEMPLATES = false;
669
+ /* Output should be safe even for XML used within HTML and alike.
670
+ * This means, DOMPurify removes comments when containing risky content.
671
+ */
672
+ let SAFE_FOR_XML = true;
673
+ /* Decide if document with <html>... should be returned */
674
+ let WHOLE_DOCUMENT = false;
675
+ /* Track whether config is already set on this instance of DOMPurify. */
676
+ let SET_CONFIG = false;
677
+ /* Pristine allowlist bindings captured at setConfig() time. On the
678
+ * persistent-config path sanitize() restores the sets from these before
679
+ * the per-walk hook clone-guard, so a hook's in-call widening cannot
680
+ * carry across calls. Null until setConfig() is called; reset by
681
+ * clearConfig(). */
682
+ let SET_CONFIG_ALLOWED_TAGS = null;
683
+ let SET_CONFIG_ALLOWED_ATTR = null;
684
+ /* Decide if all elements (e.g. style, script) must be children of
685
+ * document.body. By default, browsers might move them to document.head */
686
+ let FORCE_BODY = false;
687
+ /* Decide if a DOM `HTMLBodyElement` should be returned, instead of a html
688
+ * string (or a TrustedHTML object if Trusted Types are supported).
689
+ * If `WHOLE_DOCUMENT` is enabled a `HTMLHtmlElement` will be returned instead
690
+ */
691
+ let RETURN_DOM = false;
692
+ /* Decide if a DOM `DocumentFragment` should be returned, instead of a html
693
+ * string (or a TrustedHTML object if Trusted Types are supported) */
694
+ let RETURN_DOM_FRAGMENT = false;
695
+ /* Try to return a Trusted Type object instead of a string, return a string in
696
+ * case Trusted Types are not supported */
697
+ let RETURN_TRUSTED_TYPE = false;
698
+ /* Output should be free from DOM clobbering attacks?
699
+ * This sanitizes markups named with colliding, clobberable built-in DOM APIs.
700
+ */
701
+ let SANITIZE_DOM = true;
702
+ /* Achieve full DOM Clobbering protection by isolating the namespace of named
703
+ * properties and JS variables, mitigating attacks that abuse the HTML/DOM spec rules.
704
+ *
705
+ * HTML/DOM spec rules that enable DOM Clobbering:
706
+ * - Named Access on Window (§7.3.3)
707
+ * - DOM Tree Accessors (§3.1.5)
708
+ * - Form Element Parent-Child Relations (§4.10.3)
709
+ * - Iframe srcdoc / Nested WindowProxies (§4.8.5)
710
+ * - HTMLCollection (§4.2.10.2)
711
+ *
712
+ * Namespace isolation is implemented by prefixing `id` and `name` attributes
713
+ * with a constant string, i.e., `user-content-`
714
+ */
715
+ let SANITIZE_NAMED_PROPS = false;
716
+ const SANITIZE_NAMED_PROPS_PREFIX = 'user-content-';
717
+ /* Keep element content when removing element? */
718
+ let KEEP_CONTENT = true;
719
+ /* If a `Node` is passed to sanitize(), then performs sanitization in-place instead
720
+ * of importing it into a new Document and returning a sanitized copy */
721
+ let IN_PLACE = false;
722
+ /* Allow usage of profiles like html, svg and mathMl */
723
+ let USE_PROFILES = {};
724
+ /* Tags to ignore content of when KEEP_CONTENT is true */
725
+ let FORBID_CONTENTS = null;
726
+ const DEFAULT_FORBID_CONTENTS = addToSet({}, ['annotation-xml', 'audio', 'colgroup', 'desc', 'foreignobject', 'head', 'iframe', 'math', 'mi', 'mn', 'mo', 'ms', 'mtext', 'noembed', 'noframes', 'noscript', 'plaintext', 'script',
727
+ // <selectedcontent> mirrors the selected <option>'s subtree, cloned by
728
+ // the UA (customizable <select>) — including any on* handlers — and the
729
+ // engine re-mirrors synchronously whenever a removal changes which
730
+ // option/selectedcontent is current, even inside DOMPurify's inert
731
+ // DOMParser document. Hoisting its children on removal re-inserts a fresh
732
+ // mirror target ahead of the walk, which the engine refills, looping
733
+ // forever (DoS) and amplifying output. Dropping its content on removal
734
+ // (rather than hoisting) breaks that cascade; the content is a duplicate
735
+ // of the option, which is sanitized on its own. See campaign-3 F1/F6.
736
+ 'selectedcontent', 'style', 'svg', 'template', 'thead', 'title', 'video', 'xmp']);
737
+ /* Tags that are safe for data: URIs */
738
+ let DATA_URI_TAGS = null;
739
+ const DEFAULT_DATA_URI_TAGS = addToSet({}, ['audio', 'video', 'img', 'source', 'image', 'track']);
740
+ /* Attributes safe for values like "javascript:" */
741
+ let URI_SAFE_ATTRIBUTES = null;
742
+ const DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ['alt', 'class', 'for', 'id', 'label', 'name', 'pattern', 'placeholder', 'role', 'summary', 'title', 'value', 'style', 'xmlns']);
743
+ const MATHML_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';
744
+ const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';
745
+ const HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';
746
+ /* Document namespace */
747
+ let NAMESPACE = HTML_NAMESPACE;
748
+ let IS_EMPTY_INPUT = false;
749
+ /* Allowed XHTML+XML namespaces */
750
+ let ALLOWED_NAMESPACES = null;
751
+ const DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE], stringToString);
752
+ const DEFAULT_MATHML_TEXT_INTEGRATION_POINTS = freeze(['mi', 'mo', 'mn', 'ms', 'mtext']);
753
+ let MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, DEFAULT_MATHML_TEXT_INTEGRATION_POINTS);
754
+ const DEFAULT_HTML_INTEGRATION_POINTS = freeze(['annotation-xml']);
755
+ let HTML_INTEGRATION_POINTS = addToSet({}, DEFAULT_HTML_INTEGRATION_POINTS);
756
+ // Certain elements are allowed in both SVG and HTML
757
+ // namespace. We need to specify them explicitly
758
+ // so that they don't get erroneously deleted from
759
+ // HTML namespace.
760
+ const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, ['title', 'style', 'font', 'a', 'script']);
761
+ /* Parsing of strict XHTML documents */
762
+ let PARSER_MEDIA_TYPE = null;
763
+ const SUPPORTED_PARSER_MEDIA_TYPES = ['application/xhtml+xml', 'text/html'];
764
+ const DEFAULT_PARSER_MEDIA_TYPE = 'text/html';
765
+ let transformCaseFunc = null;
766
+ /* Keep a reference to config to pass to hooks */
767
+ let CONFIG = null;
768
+ /* Ideally, do not touch anything below this line */
769
+ /* ______________________________________________ */
770
+ const formElement = document.createElement('form');
771
+ const isRegexOrFunction = function isRegexOrFunction(testValue) {
772
+ return testValue instanceof RegExp || testValue instanceof Function;
773
+ };
774
+ /**
775
+ * _parseConfig
776
+ *
777
+ * @param cfg optional config literal
778
+ */
779
+ // eslint-disable-next-line complexity
780
+ const _parseConfig = function _parseConfig() {
781
+ let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
782
+ if (CONFIG && CONFIG === cfg) {
783
+ return;
784
+ }
785
+ /* Shield configuration object from tampering */
786
+ if (!cfg || typeof cfg !== 'object') {
787
+ cfg = {};
788
+ }
789
+ /* Shield configuration object from prototype pollution */
790
+ cfg = clone(cfg);
791
+ PARSER_MEDIA_TYPE =
792
+ // eslint-disable-next-line unicorn/prefer-includes
793
+ SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? DEFAULT_PARSER_MEDIA_TYPE : cfg.PARSER_MEDIA_TYPE;
794
+ // HTML tags and attributes are not case-sensitive, converting to lowercase. Keeping XHTML as is.
795
+ transformCaseFunc = PARSER_MEDIA_TYPE === 'application/xhtml+xml' ? stringToString : stringToLowerCase;
796
+ /* Set configuration parameters */
797
+ ALLOWED_TAGS = _resolveSetOption(cfg, 'ALLOWED_TAGS', DEFAULT_ALLOWED_TAGS, {
798
+ transform: transformCaseFunc
799
+ });
800
+ ALLOWED_ATTR = _resolveSetOption(cfg, 'ALLOWED_ATTR', DEFAULT_ALLOWED_ATTR, {
801
+ transform: transformCaseFunc
802
+ });
803
+ ALLOWED_NAMESPACES = _resolveSetOption(cfg, 'ALLOWED_NAMESPACES', DEFAULT_ALLOWED_NAMESPACES, {
804
+ transform: stringToString
805
+ });
806
+ URI_SAFE_ATTRIBUTES = _resolveSetOption(cfg, 'ADD_URI_SAFE_ATTR', DEFAULT_URI_SAFE_ATTRIBUTES, {
807
+ transform: transformCaseFunc,
808
+ base: DEFAULT_URI_SAFE_ATTRIBUTES
809
+ });
810
+ DATA_URI_TAGS = _resolveSetOption(cfg, 'ADD_DATA_URI_TAGS', DEFAULT_DATA_URI_TAGS, {
811
+ transform: transformCaseFunc,
812
+ base: DEFAULT_DATA_URI_TAGS
813
+ });
814
+ FORBID_CONTENTS = _resolveSetOption(cfg, 'FORBID_CONTENTS', DEFAULT_FORBID_CONTENTS, {
815
+ transform: transformCaseFunc
816
+ });
817
+ FORBID_TAGS = _resolveSetOption(cfg, 'FORBID_TAGS', clone({}), {
818
+ transform: transformCaseFunc
819
+ });
820
+ FORBID_ATTR = _resolveSetOption(cfg, 'FORBID_ATTR', clone({}), {
821
+ transform: transformCaseFunc
822
+ });
823
+ USE_PROFILES = objectHasOwnProperty(cfg, 'USE_PROFILES') ? cfg.USE_PROFILES && typeof cfg.USE_PROFILES === 'object' ? clone(cfg.USE_PROFILES) : cfg.USE_PROFILES : false;
824
+ ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; // Default true
825
+ ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; // Default true
826
+ ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false; // Default false
827
+ ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false; // Default true
828
+ SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false; // Default false
829
+ SAFE_FOR_XML = cfg.SAFE_FOR_XML !== false; // Default true
830
+ WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false; // Default false
831
+ RETURN_DOM = cfg.RETURN_DOM || false; // Default false
832
+ RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false; // Default false
833
+ RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false; // Default false
834
+ FORCE_BODY = cfg.FORCE_BODY || false; // Default false
835
+ SANITIZE_DOM = cfg.SANITIZE_DOM !== false; // Default true
836
+ SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false; // Default false
837
+ KEEP_CONTENT = cfg.KEEP_CONTENT !== false; // Default true
838
+ IN_PLACE = cfg.IN_PLACE || false; // Default false
839
+ IS_ALLOWED_URI$1 = isRegex(cfg.ALLOWED_URI_REGEXP) ? cfg.ALLOWED_URI_REGEXP : IS_ALLOWED_URI; // Default regexp
840
+ NAMESPACE = typeof cfg.NAMESPACE === 'string' ? cfg.NAMESPACE : HTML_NAMESPACE; // Default HTML namespace
841
+ MATHML_TEXT_INTEGRATION_POINTS = _resolveObjectOption(cfg, 'MATHML_TEXT_INTEGRATION_POINTS', () => addToSet({}, DEFAULT_MATHML_TEXT_INTEGRATION_POINTS) // Default built-in map
842
+ );
843
+ HTML_INTEGRATION_POINTS = _resolveObjectOption(cfg, 'HTML_INTEGRATION_POINTS', () => addToSet({}, DEFAULT_HTML_INTEGRATION_POINTS) // Default built-in map
844
+ );
845
+ const customElementHandling = _resolveObjectOption(cfg, 'CUSTOM_ELEMENT_HANDLING', () => create(null));
846
+ CUSTOM_ELEMENT_HANDLING = create(null);
847
+ if (objectHasOwnProperty(customElementHandling, 'tagNameCheck') && isRegexOrFunction(customElementHandling.tagNameCheck)) {
848
+ CUSTOM_ELEMENT_HANDLING.tagNameCheck = customElementHandling.tagNameCheck; // Default undefined
849
+ }
850
+ if (objectHasOwnProperty(customElementHandling, 'attributeNameCheck') && isRegexOrFunction(customElementHandling.attributeNameCheck)) {
851
+ CUSTOM_ELEMENT_HANDLING.attributeNameCheck = customElementHandling.attributeNameCheck; // Default undefined
852
+ }
853
+ if (objectHasOwnProperty(customElementHandling, 'allowCustomizedBuiltInElements') && typeof customElementHandling.allowCustomizedBuiltInElements === 'boolean') {
854
+ CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = customElementHandling.allowCustomizedBuiltInElements; // Default undefined
855
+ }
856
+ seal(CUSTOM_ELEMENT_HANDLING);
857
+ if (SAFE_FOR_TEMPLATES) {
858
+ ALLOW_DATA_ATTR = false;
859
+ }
860
+ if (RETURN_DOM_FRAGMENT) {
861
+ RETURN_DOM = true;
862
+ }
863
+ /* Parse profile info */
864
+ if (USE_PROFILES) {
865
+ ALLOWED_TAGS = addToSet({}, text);
866
+ ALLOWED_ATTR = create(null);
867
+ if (USE_PROFILES.html === true) {
868
+ addToSet(ALLOWED_TAGS, html$1);
869
+ addToSet(ALLOWED_ATTR, html);
870
+ }
871
+ if (USE_PROFILES.svg === true) {
872
+ addToSet(ALLOWED_TAGS, svg$1);
873
+ addToSet(ALLOWED_ATTR, svg);
874
+ addToSet(ALLOWED_ATTR, xml);
875
+ }
876
+ if (USE_PROFILES.svgFilters === true) {
877
+ addToSet(ALLOWED_TAGS, svgFilters);
878
+ addToSet(ALLOWED_ATTR, svg);
879
+ addToSet(ALLOWED_ATTR, xml);
880
+ }
881
+ if (USE_PROFILES.mathMl === true) {
882
+ addToSet(ALLOWED_TAGS, mathMl$1);
883
+ addToSet(ALLOWED_ATTR, mathMl);
884
+ addToSet(ALLOWED_ATTR, xml);
885
+ }
886
+ }
887
+ /* Always reset function-based ADD_TAGS / ADD_ATTR checks to prevent
888
+ * leaking across calls when switching from function to array config */
889
+ EXTRA_ELEMENT_HANDLING.tagCheck = null;
890
+ EXTRA_ELEMENT_HANDLING.attributeCheck = null;
891
+ /* Merge configuration parameters */
892
+ if (objectHasOwnProperty(cfg, 'ADD_TAGS')) {
893
+ if (typeof cfg.ADD_TAGS === 'function') {
894
+ EXTRA_ELEMENT_HANDLING.tagCheck = cfg.ADD_TAGS;
895
+ } else if (arrayIsArray(cfg.ADD_TAGS)) {
896
+ if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {
897
+ ALLOWED_TAGS = clone(ALLOWED_TAGS);
898
+ }
899
+ addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);
900
+ }
901
+ }
902
+ if (objectHasOwnProperty(cfg, 'ADD_ATTR')) {
903
+ if (typeof cfg.ADD_ATTR === 'function') {
904
+ EXTRA_ELEMENT_HANDLING.attributeCheck = cfg.ADD_ATTR;
905
+ } else if (arrayIsArray(cfg.ADD_ATTR)) {
906
+ if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {
907
+ ALLOWED_ATTR = clone(ALLOWED_ATTR);
908
+ }
909
+ addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);
910
+ }
911
+ }
912
+ if (objectHasOwnProperty(cfg, 'ADD_FORBID_CONTENTS') && arrayIsArray(cfg.ADD_FORBID_CONTENTS)) {
913
+ if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {
914
+ FORBID_CONTENTS = clone(FORBID_CONTENTS);
915
+ }
916
+ addToSet(FORBID_CONTENTS, cfg.ADD_FORBID_CONTENTS, transformCaseFunc);
917
+ }
918
+ /* Add #text in case KEEP_CONTENT is set to true */
919
+ if (KEEP_CONTENT) {
920
+ ALLOWED_TAGS['#text'] = true;
921
+ }
922
+ /* Add html, head and body to ALLOWED_TAGS in case WHOLE_DOCUMENT is true */
923
+ if (WHOLE_DOCUMENT) {
924
+ addToSet(ALLOWED_TAGS, ['html', 'head', 'body']);
925
+ }
926
+ /* Add tbody to ALLOWED_TAGS in case tables are permitted, see #286, #365 */
927
+ if (ALLOWED_TAGS.table) {
928
+ addToSet(ALLOWED_TAGS, ['tbody']);
929
+ delete FORBID_TAGS.tbody;
930
+ }
931
+ // Re-derive the active Trusted Types policy from this configuration on
932
+ // every parse. The active policy must never be sticky closure state that
933
+ // outlives the config that set it: a caller-supplied policy left in place
934
+ // after `clearConfig()` — or after a later call that supplied none, or
935
+ // `TRUSTED_TYPES_POLICY: null` — could sign a subsequent "default"
936
+ // `RETURN_TRUSTED_TYPE` result with a foreign, possibly unsafe policy.
937
+ // See GHSA-vxr8-fq34-vvx9.
938
+ if (cfg.TRUSTED_TYPES_POLICY) {
939
+ if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== 'function') {
940
+ throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
941
+ }
942
+ if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== 'function') {
943
+ throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
944
+ }
945
+ // A caller-supplied policy applies to this configuration only.
946
+ const previousTrustedTypesPolicy = trustedTypesPolicy;
947
+ trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY;
948
+ // Sign local variables required by `sanitize`. If the supplied policy's
949
+ // `createHTML` is circular (i.e. it calls `DOMPurify.sanitize`), this
950
+ // throws via the re-entrancy guard. Restore the previous policy first so
951
+ // the instance is not left in a poisoned state. See #1422.
952
+ try {
953
+ emptyHTML = _createTrustedHTML('');
954
+ } catch (error) {
955
+ trustedTypesPolicy = previousTrustedTypesPolicy;
956
+ throw error;
957
+ }
958
+ } else if (cfg.TRUSTED_TYPES_POLICY === null) {
959
+ // Explicit opt-out for this call: perform no Trusted Types signing and
960
+ // create nothing (so a strict `trusted-types` CSP that disallows a
961
+ // `dompurify` policy can still call `sanitize` from inside its own
962
+ // policy — see #1422). Resetting to `undefined` rather than a sticky
963
+ // `null` also drops any previously retained caller policy, so it cannot
964
+ // resurface on a later call, while still allowing the next config-less
965
+ // call to restore the internal default policy. See GHSA-vxr8-fq34-vvx9.
966
+ trustedTypesPolicy = undefined;
967
+ emptyHTML = '';
968
+ } else {
969
+ // No policy supplied: keep the currently active policy if one is set — a
970
+ // previously supplied policy is intentionally sticky across config-less
971
+ // calls — otherwise fall back to the instance's own internal policy,
972
+ // created at most once. (A policy supplied for a *single* call still
973
+ // lingers by design; what must not linger is a policy whose configuration
974
+ // has been torn down via `clearConfig()`, which restores the default.)
975
+ if (trustedTypesPolicy === undefined) {
976
+ trustedTypesPolicy = _getDefaultTrustedTypesPolicy();
977
+ }
978
+ // Sign internal variables only when a policy is active. A falsy policy
979
+ // (Trusted Types unsupported, creation failed, or an explicit opt-out)
980
+ // leaves `emptyHTML` as a plain string, so we never call `.createHTML` on
981
+ // a non-policy and throw. See #1422.
982
+ if (trustedTypesPolicy && typeof emptyHTML === 'string') {
983
+ emptyHTML = _createTrustedHTML('');
984
+ }
985
+ }
986
+ // Prevent further manipulation of configuration.
987
+ // Not available in IE8, Safari 5, etc.
988
+ if (freeze) {
989
+ freeze(cfg);
990
+ }
991
+ CONFIG = cfg;
992
+ };
993
+ /* Keep track of all possible SVG and MathML tags
994
+ * so that we can perform the namespace checks
995
+ * correctly. */
996
+ const ALL_SVG_TAGS = addToSet({}, [...svg$1, ...svgFilters, ...svgDisallowed]);
997
+ const ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]);
998
+ /**
999
+ * Namespace rules for an element in the SVG namespace.
1000
+ *
1001
+ * @param tagName the element's lowercase tag name
1002
+ * @param parent the (possibly simulated) parent node
1003
+ * @param parentTagName the parent's lowercase tag name
1004
+ * @returns true if a spec-compliant parser could produce this element
1005
+ */
1006
+ const _checkSvgNamespace = function _checkSvgNamespace(tagName, parent, parentTagName) {
1007
+ // The only way to switch from HTML namespace to SVG
1008
+ // is via <svg>. If it happens via any other tag, then
1009
+ // it should be killed.
1010
+ if (parent.namespaceURI === HTML_NAMESPACE) {
1011
+ return tagName === 'svg';
1012
+ }
1013
+ // The only way to switch from MathML to SVG is via <svg>
1014
+ // if the parent is either <annotation-xml> or a MathML
1015
+ // text integration point.
1016
+ if (parent.namespaceURI === MATHML_NAMESPACE) {
1017
+ return tagName === 'svg' && (parentTagName === 'annotation-xml' || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);
1018
+ }
1019
+ // We only allow elements that are defined in SVG
1020
+ // spec. All others are disallowed in SVG namespace.
1021
+ return Boolean(ALL_SVG_TAGS[tagName]);
1022
+ };
1023
+ /**
1024
+ * Namespace rules for an element in the MathML namespace.
1025
+ *
1026
+ * @param tagName the element's lowercase tag name
1027
+ * @param parent the (possibly simulated) parent node
1028
+ * @param parentTagName the parent's lowercase tag name
1029
+ * @returns true if a spec-compliant parser could produce this element
1030
+ */
1031
+ const _checkMathMlNamespace = function _checkMathMlNamespace(tagName, parent, parentTagName) {
1032
+ // The only way to switch from HTML namespace to MathML
1033
+ // is via <math>. If it happens via any other tag, then
1034
+ // it should be killed.
1035
+ if (parent.namespaceURI === HTML_NAMESPACE) {
1036
+ return tagName === 'math';
1037
+ }
1038
+ // The only way to switch from SVG to MathML is via
1039
+ // <math> and HTML integration points
1040
+ if (parent.namespaceURI === SVG_NAMESPACE) {
1041
+ return tagName === 'math' && HTML_INTEGRATION_POINTS[parentTagName];
1042
+ }
1043
+ // We only allow elements that are defined in MathML
1044
+ // spec. All others are disallowed in MathML namespace.
1045
+ return Boolean(ALL_MATHML_TAGS[tagName]);
1046
+ };
1047
+ /**
1048
+ * Namespace rules for an element in the HTML namespace.
1049
+ *
1050
+ * @param tagName the element's lowercase tag name
1051
+ * @param parent the (possibly simulated) parent node
1052
+ * @param parentTagName the parent's lowercase tag name
1053
+ * @returns true if a spec-compliant parser could produce this element
1054
+ */
1055
+ const _checkHtmlNamespace = function _checkHtmlNamespace(tagName, parent, parentTagName) {
1056
+ // The only way to switch from SVG to HTML is via
1057
+ // HTML integration points, and from MathML to HTML
1058
+ // is via MathML text integration points
1059
+ if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) {
1060
+ return false;
1061
+ }
1062
+ if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) {
1063
+ return false;
1064
+ }
1065
+ // We disallow tags that are specific for MathML
1066
+ // or SVG and should never appear in HTML namespace
1067
+ return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]);
1068
+ };
1069
+ /**
1070
+ * @param element a DOM element whose namespace is being checked
1071
+ * @returns Return false if the element has a
1072
+ * namespace that a spec-compliant parser would never
1073
+ * return. Return true otherwise.
1074
+ */
1075
+ const _checkValidNamespace = function _checkValidNamespace(element) {
1076
+ let parent = getParentNode(element);
1077
+ // In JSDOM, if we're inside shadow DOM, then parentNode
1078
+ // can be null. We just simulate parent in this case.
1079
+ if (!parent || !parent.tagName) {
1080
+ parent = {
1081
+ namespaceURI: NAMESPACE,
1082
+ tagName: 'template'
1083
+ };
1084
+ }
1085
+ const tagName = stringToLowerCase(element.tagName);
1086
+ const parentTagName = stringToLowerCase(parent.tagName);
1087
+ if (!ALLOWED_NAMESPACES[element.namespaceURI]) {
1088
+ return false;
1089
+ }
1090
+ if (element.namespaceURI === SVG_NAMESPACE) {
1091
+ return _checkSvgNamespace(tagName, parent, parentTagName);
1092
+ }
1093
+ if (element.namespaceURI === MATHML_NAMESPACE) {
1094
+ return _checkMathMlNamespace(tagName, parent, parentTagName);
1095
+ }
1096
+ if (element.namespaceURI === HTML_NAMESPACE) {
1097
+ return _checkHtmlNamespace(tagName, parent, parentTagName);
1098
+ }
1099
+ // For XHTML and XML documents that support custom namespaces
1100
+ if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && ALLOWED_NAMESPACES[element.namespaceURI]) {
1101
+ return true;
1102
+ }
1103
+ // The code should never reach this place (this means
1104
+ // that the element somehow got namespace that is not
1105
+ // HTML, SVG, MathML or allowed via ALLOWED_NAMESPACES).
1106
+ // Return false just in case.
1107
+ return false;
1108
+ };
1109
+ /**
1110
+ * _forceRemove
1111
+ *
1112
+ * @param node a DOM node
1113
+ */
1114
+ const _forceRemove = function _forceRemove(node) {
1115
+ arrayPush(DOMPurify.removed, {
1116
+ element: node
1117
+ });
1118
+ try {
1119
+ // eslint-disable-next-line unicorn/prefer-dom-node-remove
1120
+ getParentNode(node).removeChild(node);
1121
+ } catch (_) {
1122
+ /* The normal detach failed — this is reached for a parentless node
1123
+ (getParentNode() is null, so .removeChild throws). Element.prototype
1124
+ .remove() is itself a spec no-op on a parentless node, so a recorded
1125
+ "removal" would otherwise hand the caller back an intact,
1126
+ payload-bearing node (e.g. a detached IN_PLACE root the mXSS canary or
1127
+ the style-with-element-child rule decided to kill). Fail closed by
1128
+ throwing — exactly as a clobbered root does at the IN_PLACE entry —
1129
+ rather than trying to "neutralize" the node via its own methods.
1130
+ Neutralizing would mean calling getAttributeNames()/removeAttribute()
1131
+ on the node, both of which a <form> root can clobber via a named child
1132
+ (and _isClobbered does not even probe getAttributeNames), so the
1133
+ neutralize step could itself be silently defeated, leaving the payload
1134
+ intact. A throw touches only the cached, clobber-safe remove() and
1135
+ getParentNode(). Generalizes GHSA-r47g-fvhr-h676 (clobbered-form root)
1136
+ to every root-kill reason. REPORT-3.
1137
+ This lives inside the catch, so it never fires for a normally-removed
1138
+ in-tree node: those have a parent, removeChild() succeeds, and the
1139
+ catch is not entered. Only a kept (parentless) root reaches here. */
1140
+ remove(node);
1141
+ if (!getParentNode(node)) {
1142
+ throw typeErrorCreate('a node selected for removal could not be detached from its tree ' + 'and cannot be safely returned; refusing to sanitize in place');
1143
+ }
1144
+ }
1145
+ };
1146
+ /**
1147
+ * _stripAttributeNode
1148
+ *
1149
+ * Remove a single Attr node case/namespace-exactly on an attribute-teardown
1150
+ * path. Name-based removeAttribute() ASCII-lowercases its lookup key for an
1151
+ * HTML element in an HTML document and so silently misses a case-preserved
1152
+ * handler (e.g. `ONERROR` off an XML/XHTML import) - the same defect
1153
+ * _removeAttribute() was fixed for, which a name-based call would reintroduce
1154
+ * on these IN_PLACE teardown paths. Unlike _removeAttribute this does not
1155
+ * record into DOMPurify.removed: the neutralize passes intentionally do not
1156
+ * book-keep. A clobbered/detached node falls back to best-effort name-based
1157
+ * removal.
1158
+ *
1159
+ * @param element the element to strip the attribute from
1160
+ * @param attribute the Attr node to remove
1161
+ * @param name the attribute's name, for the fallback path
1162
+ */
1163
+ const _stripAttributeNode = function _stripAttributeNode(element, attribute, name) {
1164
+ try {
1165
+ element.removeAttributeNode(attribute);
1166
+ } catch (_) {
1167
+ try {
1168
+ element.removeAttribute(name);
1169
+ } catch (_) {}
1170
+ }
1171
+ };
1172
+ /**
1173
+ * _neutralizeRoot
1174
+ *
1175
+ * Fail-closed teardown of an in-place root after the sanitize walk aborts
1176
+ * (campaign-3 F2). An internal throw mid-walk — e.g. a page-registered
1177
+ * custom element's reaction detaches a node so `_forceRemove`'s deliberate
1178
+ * parentless guard throws, or any other re-entrant engine mutation — would
1179
+ * otherwise leave the caller's *live* tree half-sanitized, with everything
1180
+ * after the abort point still carrying its handlers. There is no safe way
1181
+ * to resume the walk (the tree mutated under us), so we strip the root bare:
1182
+ * remove every child and every attribute, then let the caller's catch see
1183
+ * the original error. Clobber-safe (cached `remove`/`childNodes`/`attributes`
1184
+ * getters; the root was already clobber-pre-flighted at the IN_PLACE entry).
1185
+ *
1186
+ * @param root the in-place root to empty
1187
+ */
1188
+ const _neutralizeRoot = function _neutralizeRoot(root) {
1189
+ /* Strip every disallowed attribute (on* handlers included) off the whole
1190
+ subtree BEFORE detaching anything. Detaching first would hand back
1191
+ handler-bearing originals (e.g. an already-loading `<img onerror>`)
1192
+ whose queued resource event still fires in page scope after we throw.
1193
+ Clobber-safe reads; a doomed clobbered node's own attributes are
1194
+ irrelevant while its non-clobbered descendants are reached and scrubbed. */
1195
+ _neutralizeSubtree(root);
1196
+ const childNodes = getChildNodes(root);
1197
+ if (childNodes) {
1198
+ const snapshot = [];
1199
+ arrayForEach(childNodes, child => {
1200
+ arrayPush(snapshot, child);
1201
+ });
1202
+ arrayForEach(snapshot, child => {
1203
+ try {
1204
+ remove(child);
1205
+ } catch (_) {
1206
+ /* Best-effort teardown; a still-attached child is handled below */
1207
+ }
1208
+ });
1209
+ }
1210
+ const attributes = getAttributes(root);
1211
+ if (attributes) {
1212
+ for (let i = attributes.length - 1; i >= 0; --i) {
1213
+ const attribute = attributes[i];
1214
+ const name = attribute && attribute.name;
1215
+ if (typeof name === 'string') {
1216
+ _stripAttributeNode(root, attribute, name);
1217
+ }
1218
+ }
1219
+ }
1220
+ };
1221
+ /**
1222
+ * _removeAttribute
1223
+ *
1224
+ * Name-based getAttributeNode()/removeAttribute() ASCII-lowercase their
1225
+ * lookup key for HTML elements in an HTML document, so they silently miss an
1226
+ * attribute whose stored qualified name still contains uppercase ASCII
1227
+ * letters. That happens when the node came from a case-preserving source
1228
+ * (an XML/XHTML document imported via importNode(), or createAttributeNS()),
1229
+ * where e.g. `ONERROR` survives the walk: the policy check lowercases to
1230
+ * `onerror` and rejects it, but `removeAttribute('ONERROR')` looks up
1231
+ * `onerror` and finds nothing. Remove the exact Attr node instead, which is
1232
+ * case- and namespace-exact, and fall back to name-based removal only when
1233
+ * the caller could not supply the node.
1234
+ *
1235
+ * @param name an Attribute name
1236
+ * @param element a DOM node
1237
+ * @param attr the exact Attr node to remove, when the caller has it
1238
+ */
1239
+ const _removeAttribute = function _removeAttribute(name, element, attr) {
1240
+ if (!attr) {
1241
+ try {
1242
+ attr = element.getAttributeNode(name);
1243
+ } catch (_) {
1244
+ attr = null;
1245
+ }
1246
+ }
1247
+ arrayPush(DOMPurify.removed, {
1248
+ attribute: attr || null,
1249
+ from: element
1250
+ });
1251
+ try {
1252
+ if (attr) {
1253
+ element.removeAttributeNode(attr);
1254
+ } else {
1255
+ element.removeAttribute(name);
1256
+ }
1257
+ } catch (_) {
1258
+ /* Clobbered or already-detached node - best-effort fall back to a
1259
+ name-based removal so the "is" handling below still runs. */
1260
+ try {
1261
+ element.removeAttribute(name);
1262
+ } catch (_) {}
1263
+ }
1264
+ // We void attribute values for unremovable "is" attributes
1265
+ if (name === 'is') {
1266
+ if (RETURN_DOM || RETURN_DOM_FRAGMENT) {
1267
+ try {
1268
+ _forceRemove(element);
1269
+ } catch (_) {}
1270
+ } else {
1271
+ try {
1272
+ element.setAttribute(name, '');
1273
+ } catch (_) {}
1274
+ }
1275
+ }
1276
+ };
1277
+ /**
1278
+ * _stripDisallowedAttributes
1279
+ *
1280
+ * Removes every attribute the active configuration does not allow from a
1281
+ * single element, using the same allowlist as the main attribute pass (so
1282
+ * `on*` handlers go, but no `/^on/` blocklist is introduced). Used only to
1283
+ * neutralise nodes that are being discarded from an in-place tree.
1284
+ *
1285
+ * @param element the element to strip
1286
+ */
1287
+ const _stripDisallowedAttributes = function _stripDisallowedAttributes(element) {
1288
+ const attributes = getAttributes(element);
1289
+ if (!attributes) {
1290
+ return;
1291
+ }
1292
+ for (let i = attributes.length - 1; i >= 0; --i) {
1293
+ const attribute = attributes[i];
1294
+ const name = attribute && attribute.name;
1295
+ if (typeof name !== 'string' || ALLOWED_ATTR[transformCaseFunc(name)]) {
1296
+ continue;
1297
+ }
1298
+ _stripAttributeNode(element, attribute, name);
1299
+ }
1300
+ };
1301
+ /**
1302
+ * _neutralizeSubtree
1303
+ *
1304
+ * Completes the audit-5 F1 fix across every removal path. The KEEP_CONTENT
1305
+ * move-hoist neutralises only disallowed-tag removals; clobber, mXSS-canary,
1306
+ * namespace, comment, processing-instruction and KEEP_CONTENT:false removals
1307
+ * all drop their subtree wholesale via `_forceRemove`. On the IN_PLACE path
1308
+ * those dropped nodes are detached from the caller's LIVE tree but a
1309
+ * handler-bearing original among them (an `<img onerror>`/`<video>` that was
1310
+ * loading) keeps its queued resource event, which fires in page scope after
1311
+ * sanitize returns. This walks a removed subtree and strips every attribute
1312
+ * the active configuration does not allow — so `on*` handlers are cancelled
1313
+ * through the SAME allowlist that governs kept nodes, not a separate `/^on/`
1314
+ * blocklist. Run synchronously before sanitize returns, i.e. before any
1315
+ * queued event can fire. Hook-free by design: these nodes leave the output,
1316
+ * so firing attribute hooks for them would be surprising. Clobber-safe reads;
1317
+ * a doomed clobbered node may shadow `removeAttribute` (its own attributes are
1318
+ * irrelevant — it is discarded — while its non-clobbered descendants, e.g.
1319
+ * the `<img>`, are reached and scrubbed).
1320
+ *
1321
+ * @param root the root of a removed subtree to neutralise
1322
+ */
1323
+ const _neutralizeSubtree = function _neutralizeSubtree(root) {
1324
+ const stack = [root];
1325
+ while (stack.length > 0) {
1326
+ const node = stack.pop();
1327
+ const nodeType = _readNodeType(node);
1328
+ if (nodeType === NODE_TYPE.element) {
1329
+ _stripDisallowedAttributes(node);
1330
+ }
1331
+ const childNodes = getChildNodes(node);
1332
+ if (childNodes) {
1333
+ for (let i = childNodes.length - 1; i >= 0; --i) {
1334
+ stack.push(childNodes[i]);
1335
+ }
1336
+ }
1337
+ }
1338
+ };
1339
+ /**
1340
+ * _neutralizePatchLinkage
1341
+ *
1342
+ * IN_PLACE entry pre-pass (declarative-partial-updates / streaming
1343
+ * hardening, https://github.com/WICG/declarative-partial-updates).
1344
+ *
1345
+ * The main walk strips patch linkage (`for`/`patchsrc`) and removes range
1346
+ * markers (PIs / markup comments) node-by-node, in document order, AS it
1347
+ * reaches each node. On a live in-place root that leaves a window: from the
1348
+ * moment the root is connected until the walk arrives at a given node, that
1349
+ * node's linkage is live. A patch applied on connection/stream can fire as
1350
+ * a microtask during the walk and inject or teleport an unsanitized DOM
1351
+ * range into a region the iterator has already passed and will not revisit,
1352
+ * so the post-return "tree is sanitized" contract is violated. Sweep the
1353
+ * whole tree once up front and sever every linkage before the walk begins,
1354
+ * closing that window.
1355
+ *
1356
+ * This CANNOT undo a patch that already fired before sanitize ran — that is
1357
+ * the irreducible "do not IN_PLACE a live-connected attacker tree" caveat —
1358
+ * but it closes everything from sanitize-start onward. Gated on SAFE_FOR_XML
1359
+ * to group with the rest of the declarative-partial-updates handling and
1360
+ * stay overridable, consistent with the codebase.
1361
+ *
1362
+ * Clobber-safe traversal (cached childNodes getter); per-node try/catch so a
1363
+ * clobbered root cannot defeat the sweep of its non-clobbered descendants.
1364
+ *
1365
+ * NOTE (pending real-Chrome confirmation, see test/declarative-patch-probe
1366
+ * .html Q1): this mirrors the existing policy of keeping `for` on
1367
+ * <label>/<output>. If the shipping feature can drive a patch through a
1368
+ * surviving `for`-on-label/output + `id` pair, this pre-pass and the
1369
+ * attribute check at _isBasicCustomElement's caller must additionally drop
1370
+ * that pair on the IN_PLACE path. Left as-is until the taxonomy is verified.
1371
+ *
1372
+ * @param root the in-place root to sweep
1373
+ */
1374
+ /**
1375
+ * Central policy for declarative-partial-updates patch-linkage attributes,
1376
+ * shared by the _neutralizePatchLinkage pre-pass and _isValidAttribute so
1377
+ * the two sites cannot drift: `patchsrc` always links, `for` links
1378
+ * everywhere except on <label>/<output>, and the whole policy is gated on
1379
+ * SAFE_FOR_XML (see the rationale block in _isValidAttribute).
1380
+ *
1381
+ * @param lcName the transformCaseFunc'd attribute name
1382
+ * @param lcTag the transformCaseFunc'd tag name of the carrying element
1383
+ * @return true if the attribute is patch linkage and must be dropped
1384
+ */
1385
+ const _isPatchLinkageAttribute = function _isPatchLinkageAttribute(lcName, lcTag) {
1386
+ if (!SAFE_FOR_XML) {
1387
+ return false;
1388
+ }
1389
+ if (lcName === 'patchsrc') {
1390
+ return true;
1391
+ }
1392
+ return lcName === 'for' && lcTag !== 'label' && lcTag !== 'output';
1393
+ };
1394
+ const _neutralizePatchLinkage = function _neutralizePatchLinkage(root) {
1395
+ if (!SAFE_FOR_XML) {
1396
+ return;
1397
+ }
1398
+ const stack = [root];
1399
+ while (stack.length > 0) {
1400
+ const node = stack.pop();
1401
+ const nodeType = _readNodeType(node);
1402
+ /* Remove range markers (the target side of a patch linkage): every
1403
+ processing instruction, and any markup-bearing comment. */
1404
+ if (nodeType === NODE_TYPE.processingInstruction || nodeType === NODE_TYPE.comment && regExpTest(COMMENT_MARKUP_PROBE, node.data)) {
1405
+ try {
1406
+ remove(node);
1407
+ } catch (_) {
1408
+ /* Best-effort */
1409
+ }
1410
+ continue;
1411
+ }
1412
+ /* Strip patch-source attributes (the source side) off elements. */
1413
+ if (nodeType === NODE_TYPE.element) {
1414
+ const element = node;
1415
+ const lcTag = transformCaseFunc(_readNodeName(node));
1416
+ try {
1417
+ if (element.hasAttribute && element.hasAttribute('patchsrc')) {
1418
+ element.removeAttribute('patchsrc');
1419
+ }
1420
+ if (element.hasAttribute && element.hasAttribute('for') && _isPatchLinkageAttribute('for', lcTag)) {
1421
+ element.removeAttribute('for');
1422
+ }
1423
+ } catch (_) {
1424
+ /* Clobbered removeAttribute/hasAttribute on a doomed node — ignore */
1425
+ }
1426
+ }
1427
+ const childNodes = getChildNodes(node);
1428
+ if (childNodes) {
1429
+ for (let i = childNodes.length - 1; i >= 0; --i) {
1430
+ stack.push(childNodes[i]);
1431
+ }
1432
+ }
1433
+ }
1434
+ };
1435
+ /**
1436
+ * _initDocument
1437
+ *
1438
+ * @param dirty - a string of dirty markup
1439
+ * @return a DOM, filled with the dirty markup
1440
+ */
1441
+ const _initDocument = function _initDocument(dirty) {
1442
+ /* Create a HTML document */
1443
+ let doc = null;
1444
+ let leadingWhitespace = null;
1445
+ if (FORCE_BODY) {
1446
+ dirty = '<remove></remove>' + dirty;
1447
+ } else {
1448
+ /* If FORCE_BODY isn't used, leading whitespace needs to be preserved manually */
1449
+ const matches = stringMatch(dirty, /^[\r\n\t ]+/);
1450
+ leadingWhitespace = matches && matches[0];
1451
+ }
1452
+ if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && NAMESPACE === HTML_NAMESPACE) {
1453
+ // Root of XHTML doc must contain xmlns declaration (see https://www.w3.org/TR/xhtml1/normative.html#strict)
1454
+ dirty = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + dirty + '</body></html>';
1455
+ }
1456
+ const dirtyPayload = trustedTypesPolicy ? _createTrustedHTML(dirty) : dirty;
1457
+ /*
1458
+ * Use the DOMParser API by default, fallback later if needs be
1459
+ * DOMParser not work for svg when has multiple root element.
1460
+ */
1461
+ if (NAMESPACE === HTML_NAMESPACE) {
1462
+ try {
1463
+ doc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE);
1464
+ } catch (_) {}
1465
+ }
1466
+ /* Use createHTMLDocument in case DOMParser is not available */
1467
+ if (!doc || !doc.documentElement) {
1468
+ doc = implementation.createDocument(NAMESPACE, 'template', null);
1469
+ try {
1470
+ doc.documentElement.innerHTML = IS_EMPTY_INPUT ? emptyHTML : dirtyPayload;
1471
+ } catch (_) {
1472
+ // Syntax error if dirtyPayload is invalid xml
1473
+ }
1474
+ }
1475
+ const body = doc.body || doc.documentElement;
1476
+ if (dirty && leadingWhitespace) {
1477
+ body.insertBefore(document.createTextNode(leadingWhitespace), body.childNodes[0] || null);
1478
+ }
1479
+ /* Work on whole document or just its body */
1480
+ if (NAMESPACE === HTML_NAMESPACE) {
1481
+ return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? 'html' : 'body')[0];
1482
+ }
1483
+ return WHOLE_DOCUMENT ? doc.documentElement : body;
1484
+ };
1485
+ /**
1486
+ * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.
1487
+ *
1488
+ * @param root The root element or node to start traversing on.
1489
+ * @return The created NodeIterator
1490
+ */
1491
+ const _createNodeIterator = function _createNodeIterator(root) {
1492
+ /* Read ownerDocument through the cached Node.prototype getter, never the
1493
+ direct property. HTMLFormElement has [LegacyOverrideBuiltIns], so a
1494
+ clobbering child (<input name="ownerDocument"> or a form-associated
1495
+ external input) shadows the prototype getter and makes a direct read
1496
+ return that <input>. createNodeIterator.call(<input>, ...) then throws
1497
+ "Illegal invocation", and on the IN_PLACE path that throw lands before
1498
+ the walk's fail-closed barrier - leaving the caller's live tree, with
1499
+ any already-armed handler in it, un-neutralized. The cached getter
1500
+ returns the real Document regardless of the clobber. */
1501
+ const doc = getOwnerDocument ? getOwnerDocument(root) : root.ownerDocument;
1502
+ return createNodeIterator.call(doc || root, root,
1503
+ // eslint-disable-next-line no-bitwise
1504
+ NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION | NodeFilter.SHOW_CDATA_SECTION, null);
1505
+ };
1506
+ /**
1507
+ * Replace template expression syntax (mustache, ERB, template
1508
+ * literal) with a space; shared by all SAFE_FOR_TEMPLATES scrub
1509
+ * sites. Order matters: mustache, then ERB, then template literal.
1510
+ *
1511
+ * @param value the string to scrub
1512
+ * @returns the scrubbed string
1513
+ */
1514
+ const _stripTemplateExpressions = function _stripTemplateExpressions(value) {
1515
+ value = stringReplace(value, MUSTACHE_EXPR$1, ' ');
1516
+ value = stringReplace(value, ERB_EXPR$1, ' ');
1517
+ value = stringReplace(value, TMPLIT_EXPR$1, ' ');
1518
+ return value;
1519
+ };
1520
+ /**
1521
+ * Strip template-engine expressions ({{...}}, ${...}, <%...%>) from the
1522
+ * character data of an element subtree. Used as the final safety net for
1523
+ * SAFE_FOR_TEMPLATES on every DOM-returning code path so that expressions
1524
+ * which only form after text-node normalization (e.g. fragments split across
1525
+ * stripped elements) cannot survive into a template-evaluating framework.
1526
+ *
1527
+ * Walks text/comment/CDATA/processing-instruction nodes and mutates `.data`
1528
+ * in place rather than round-tripping through innerHTML. This preserves
1529
+ * descendant node references (important for IN_PLACE callers), avoids a
1530
+ * serialize/reparse cycle, and reads literal character data — which means
1531
+ * `<%...%>` in text content matches the ERB regex against its real bytes
1532
+ * instead of the HTML-entity-escaped form innerHTML would produce.
1533
+ *
1534
+ * Attribute values are not visited here; SAFE_FOR_TEMPLATES handling for
1535
+ * attributes is performed during the per-node `_sanitizeAttributes` pass.
1536
+ *
1537
+ * @param node The root element whose character data should be scrubbed.
1538
+ */
1539
+ const _scrubTemplateExpressions2 = function _scrubTemplateExpressions(node) {
1540
+ var _node$querySelectorAl;
1541
+ node.normalize();
1542
+ /* Clobber-safe ownerDocument read, same reasoning as _createNodeIterator:
1543
+ under SAFE_FOR_TEMPLATES this runs on the live IN_PLACE root, which may
1544
+ carry a form-named-getter override of ownerDocument. */
1545
+ const doc = getOwnerDocument ? getOwnerDocument(node) : node.ownerDocument;
1546
+ const walker = createNodeIterator.call(doc || node, node,
1547
+ // eslint-disable-next-line no-bitwise
1548
+ NodeFilter.SHOW_TEXT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_CDATA_SECTION | NodeFilter.SHOW_PROCESSING_INSTRUCTION, null);
1549
+ let currentNode = walker.nextNode();
1550
+ while (currentNode) {
1551
+ currentNode.data = _stripTemplateExpressions(currentNode.data);
1552
+ currentNode = walker.nextNode();
1553
+ }
1554
+ // NodeIterator does not descend into <template>.content per the DOM spec,
1555
+ // so we must explicitly recurse into each template's content fragment,
1556
+ // mirroring the approach used by _sanitizeShadowDOM.
1557
+ const templates = (_node$querySelectorAl = node.querySelectorAll) === null || _node$querySelectorAl === void 0 ? void 0 : _node$querySelectorAl.call(node, 'template');
1558
+ if (templates) {
1559
+ arrayForEach(templates, tmpl => {
1560
+ if (_isDocumentFragment(tmpl.content)) {
1561
+ _scrubTemplateExpressions2(tmpl.content);
1562
+ }
1563
+ });
1564
+ }
1565
+ };
1566
+ /**
1567
+ * _isClobbered
1568
+ *
1569
+ * Detect DOM-clobbering on HTMLFormElement nodes. Form is the only HTML
1570
+ * interface with [LegacyOverrideBuiltIns]; a descendant element with a
1571
+ * `name` attribute matching a prototype property shadows that property
1572
+ * on direct reads. We use this check at the IN_PLACE entry-point and
1573
+ * during attribute sanitization to refuse clobbered forms.
1574
+ *
1575
+ * @param element element to check for clobbering attacks
1576
+ * @return true if clobbered, false if safe
1577
+ */
1578
+ const _isClobbered = function _isClobbered(element) {
1579
+ // Realm-independent tag-name probe. If we can't determine the tag
1580
+ // name at all, we can't reason about clobbering — return false
1581
+ // (the caller's other defences still apply).
1582
+ const realTagName = getNodeName ? getNodeName(element) : null;
1583
+ if (typeof realTagName !== 'string') {
1584
+ return false;
1585
+ }
1586
+ if (transformCaseFunc(realTagName) !== 'form') {
1587
+ return false;
1588
+ }
1589
+ return typeof element.nodeName !== 'string' || typeof element.textContent !== 'string' || typeof element.removeChild !== 'function' ||
1590
+ // Realm-safe NamedNodeMap detection: equality against the cached
1591
+ // prototype getter. Clobbered .attributes (e.g. <input name="attributes">)
1592
+ // makes the direct read diverge from the cached read; a clean form
1593
+ // (same-realm OR foreign-realm) has both reads pointing at the same
1594
+ // canonical NamedNodeMap.
1595
+ element.attributes !== getAttributes(element) || typeof element.removeAttribute !== 'function' || typeof element.setAttribute !== 'function' || typeof element.namespaceURI !== 'string' || typeof element.insertBefore !== 'function' || typeof element.hasChildNodes !== 'function' ||
1596
+ // NodeType clobbering probe. Cached Node.prototype.nodeType getter
1597
+ // returns the integer 1 for any Element regardless of realm; direct
1598
+ // read on a clobbered form (e.g. <input name="nodeType">) returns
1599
+ // the named child element. Cheap addition — nodeType is read from
1600
+ // an internal slot, no serialization cost — and removes a residual
1601
+ // clobbering surface used by several mXSS / PI / comment branches
1602
+ // in _sanitizeElements that compare currentNode.nodeType directly.
1603
+ element.nodeType !== getNodeType(element) ||
1604
+ // HTMLFormElement has [LegacyOverrideBuiltIns]: a descendant named
1605
+ // "childNodes" shadows the prototype getter. Direct reads of
1606
+ // form.childNodes from a clobbered form return the named child
1607
+ // instead of the real NodeList, so any walk that reads it directly
1608
+ // skips the form's real children. Compare the direct read to the
1609
+ // cached Node.prototype getter — when the form's named-property
1610
+ // getter intercepts the read, the two values differ and we flag
1611
+ // the form. This catches every clobbering child type (input,
1612
+ // select, etc.) regardless of whether the named child happens to
1613
+ // carry a numeric .length, which a typeof-based probe would miss
1614
+ // (e.g. HTMLSelectElement.length is a defined unsigned-long).
1615
+ element.childNodes !== getChildNodes(element);
1616
+ };
1617
+ /**
1618
+ * Checks whether the given value is a DocumentFragment from any realm.
1619
+ *
1620
+ * The realm-independent replacement reads `nodeType` through the cached
1621
+ * Node.prototype getter and compares to the DOCUMENT_FRAGMENT_NODE
1622
+ * constant (11). nodeType is a numeric value resolved from the node's
1623
+ * internal slot, identical across realms for the same kind of node.
1624
+ *
1625
+ * @param value object to check
1626
+ * @return true if value is a DocumentFragment-shaped node from any realm
1627
+ */
1628
+ const _isDocumentFragment = function _isDocumentFragment(value) {
1629
+ if (!getNodeType || typeof value !== 'object' || value === null) {
1630
+ return false;
1631
+ }
1632
+ try {
1633
+ return getNodeType(value) === NODE_TYPE.documentFragment;
1634
+ } catch (_) {
1635
+ return false;
1636
+ }
1637
+ };
1638
+ /**
1639
+ * Checks whether the given object is a DOM node, including nodes that
1640
+ * originate from a different window/realm (e.g. an iframe's
1641
+ * contentDocument). The previous `value instanceof Node` check was
1642
+ * realm-bound: nodes from a different window failed it, causing
1643
+ * sanitize() to silently stringify them and reset IN_PLACE to false,
1644
+ * returning the original node unsanitized. See GHSA-4w3q-35jp-p934.
1645
+ *
1646
+ * @param value object to check whether it's a DOM node
1647
+ * @return true if value is a DOM node from any realm
1648
+ */
1649
+ const _isNode = function _isNode(value) {
1650
+ if (!getNodeType || typeof value !== 'object' || value === null) {
1651
+ return false;
1652
+ }
1653
+ try {
1654
+ return typeof getNodeType(value) === 'number';
1655
+ } catch (_) {
1656
+ return false;
1657
+ }
1658
+ };
1659
+ function _executeHooks(hooks, currentNode, data) {
1660
+ if (hooks.length === 0) {
1661
+ return;
1662
+ }
1663
+ arrayForEach(hooks, hook => {
1664
+ hook.call(DOMPurify, currentNode, data, CONFIG);
1665
+ });
1666
+ }
1667
+ /**
1668
+ * Structural-threat checks that condemn a node regardless of the
1669
+ * allowlists: mXSS via namespace confusion, risky CSS construction,
1670
+ * processing instructions, markup-bearing comments. Pure predicate;
1671
+ * the caller removes. Check order is load-bearing.
1672
+ *
1673
+ * @param currentNode the node to inspect
1674
+ * @param tagName the node's transformCaseFunc'd tag name
1675
+ * @return true if the node must be removed
1676
+ */
1677
+ const _isUnsafeNode = function _isUnsafeNode(currentNode, tagName) {
1678
+ /* Detect mXSS attempts abusing namespace confusion */
1679
+ if (SAFE_FOR_XML && currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(ELEMENT_MARKUP_PROBE, currentNode.textContent) && regExpTest(ELEMENT_MARKUP_PROBE, currentNode.innerHTML)) {
1680
+ return true;
1681
+ }
1682
+ /* Remove rawtext/literal-text elements whose literal serialization
1683
+ re-opens markup on an HTML reparse - shapes (a) and (b) documented at
1684
+ LITERAL_TEXT_ELEMENTS. Both are invisible to rule 1 above (which
1685
+ self-disables once there is an element child, and whose second probe
1686
+ reads the innerHTML an XML/XHTML document serializes escaped), which
1687
+ is why both probes here read textContent instead. Previously only
1688
+ `style`-with-element-child was covered; every element in
1689
+ LITERAL_TEXT_ELEMENTS shares this literal serialization and is
1690
+ equally affected. */
1691
+ if (SAFE_FOR_XML && currentNode.namespaceURI === HTML_NAMESPACE && LITERAL_TEXT_ELEMENTS[tagName] && (_isNode(currentNode.firstElementChild) || typeof currentNode.textContent === 'string' && regExpTest(LITERAL_TEXT_CLOSE[tagName], currentNode.textContent))) {
1692
+ return true;
1693
+ }
1694
+ /* Remove any occurrence of processing instructions */
1695
+ if (currentNode.nodeType === NODE_TYPE.processingInstruction) {
1696
+ return true;
1697
+ }
1698
+ /* Remove any kind of possibly harmful comments */
1699
+ if (SAFE_FOR_XML && currentNode.nodeType === NODE_TYPE.comment && regExpTest(COMMENT_MARKUP_PROBE, currentNode.data)) {
1700
+ return true;
1701
+ }
1702
+ return false;
1703
+ };
1704
+ /**
1705
+ * Evaluate a CUSTOM_ELEMENT_HANDLING check (a RegExp or a predicate
1706
+ * function, per the validation in _parseConfig) against a name.
1707
+ * Additional arguments are forwarded to predicate functions - the
1708
+ * attributeNameCheck predicate receives the tag name as its second
1709
+ * argument. A null/absent check never matches.
1710
+ *
1711
+ * @param check the configured tagNameCheck / attributeNameCheck value
1712
+ * @param name the name to test
1713
+ * @param args extra arguments forwarded to a predicate function
1714
+ * @return true if the check matches the name
1715
+ */
1716
+ const _matchesNameCheck = function _matchesNameCheck(check, name) {
1717
+ if (check instanceof RegExp) {
1718
+ return regExpTest(check, name);
1719
+ }
1720
+ if (check instanceof Function) {
1721
+ for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
1722
+ args[_key - 2] = arguments[_key];
1723
+ }
1724
+ return Boolean(check(name, ...args));
1725
+ }
1726
+ return false;
1727
+ };
1728
+ /**
1729
+ * Handle a node whose tag is forbidden or not allowlisted: keep
1730
+ * allowed custom elements (false return exits _sanitizeElements
1731
+ * early - the namespace and fallback-tag removal checks are
1732
+ * intentionally skipped for kept custom elements), else hoist
1733
+ * content per KEEP_CONTENT and remove.
1734
+ *
1735
+ * A kept custom element is the ONLY case in which this function
1736
+ * returns false, so the caller uses that return value to run the
1737
+ * afterSanitizeElements hook on the kept element and keep the
1738
+ * element-hook lifecycle consistent with normal allowlisted
1739
+ * elements (GHSA-c2j3-45gr-mqc4).
1740
+ *
1741
+ * @param currentNode the disallowed node
1742
+ * @param tagName the node's transformCaseFunc'd tag name
1743
+ * @return true if the node was removed, false if kept
1744
+ */
1745
+ const _sanitizeDisallowedNode = function _sanitizeDisallowedNode(currentNode, tagName, root) {
1746
+ /* Check if we have a custom element to handle */
1747
+ if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName) && _matchesNameCheck(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) {
1748
+ return false;
1749
+ }
1750
+ /* Keep content except for bad-listed elements.
1751
+ Use the cached prototype getters exclusively — the previous code
1752
+ had `|| currentNode.parentNode` / `|| currentNode.childNodes`
1753
+ fallbacks, but the cached getters always return the canonical
1754
+ value (or null for a real parent-less node), so the fallback
1755
+ path was dead in safe cases and a clobbering surface in unsafe
1756
+ ones. Falsy cached results stay falsy; the `if (childNodes &&
1757
+ parentNode)` check already gates correctly. */
1758
+ if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {
1759
+ const parentNode = getParentNode(currentNode);
1760
+ const childNodes = getChildNodes(currentNode);
1761
+ if (childNodes && parentNode) {
1762
+ const childCount = childNodes.length;
1763
+ /* Hoist by moving each child up one level rather than deep-cloning
1764
+ it. Moving transfers every descendant exactly once, so a chain of
1765
+ nested disallowed elements costs O(n) instead of the O(n^2) that
1766
+ re-cloning the shrinking subtree at each level produced; it also
1767
+ empties the removed original, so `DOMPurify.removed` no longer
1768
+ pins whole subtrees. Moving preserves the in-place guarantee too:
1769
+ an original carrying already-queued resource events (`<img
1770
+ onerror>`, `<video>`/`<audio>` error, lazy/`onload`, …) is
1771
+ relocated and sanitised rather than left detached but still armed.
1772
+ The sole case that must clone is removing the walk root itself.
1773
+ The result is serialised from the root's subtree, so a restrictive
1774
+ ALLOWED_TAGS that strips the root (`body` on the string path) must
1775
+ leave the content inside it, which only cloning does. In IN_PLACE
1776
+ the root is pre-validated as an allowed tag and so is never removed
1777
+ here, so that path always takes the move branch.
1778
+ `childNodes` is live; a tail-to-head walk keeps `childNodes[i]`
1779
+ valid whether we move (drops the trailing entry) or clone (leaves
1780
+ the list intact). */
1781
+ for (let i = childCount - 1; i >= 0; --i) {
1782
+ const hoisted = currentNode === root ? cloneNode(childNodes[i], true) : childNodes[i];
1783
+ parentNode.insertBefore(hoisted, getNextSibling(currentNode));
1784
+ }
1785
+ }
1786
+ }
1787
+ _forceRemove(currentNode);
1788
+ return true;
1789
+ };
1790
+ /**
1791
+ * Fork a hook-mutable allowlist off its shared binding the first time a
1792
+ * (possibly lazily-installed) uponSanitize* hook is about to see it, so the
1793
+ * hook cannot widen the per-instance default or the setConfig binding by
1794
+ * reference and leak past the call. Returns the set unchanged once it is
1795
+ * already call-local, so repeated calls across elements are idempotent.
1796
+ *
1797
+ * @param hookList the uponSanitize* hook array for this event
1798
+ * @param set the current ALLOWED_TAGS / ALLOWED_ATTR binding
1799
+ * @param defaultSet the per-instance DEFAULT_ALLOWED_* constant
1800
+ * @param setConfigSet the captured setConfig() binding, or null
1801
+ * @return a call-local clone if a hook is present and set is still shared,
1802
+ * else set unchanged
1803
+ */
1804
+ const _forkSharedAllowlist = function _forkSharedAllowlist(hookList, set, defaultSet, setConfigSet) {
1805
+ if (hookList.length === 0) {
1806
+ return set;
1807
+ }
1808
+ return set === defaultSet || set === setConfigSet ? clone(set) : set;
1809
+ };
1810
+ /**
1811
+ * Shared guard for a node that a hook has detached from the walk tree,
1812
+ * used after each element-hook site in _sanitizeElements. Detaching is a
1813
+ * long-standing user pattern (issue #469; draw.io-style foreignObject
1814
+ * filtering). Per the cached, unclobberable parentNode getter the node is
1815
+ * genuinely out of the tree, so it can reach neither the serialized
1816
+ * output nor an IN_PLACE live tree; treat it as removed and stop
1817
+ * processing it. Without this guard, the unsafe-node / namespace checks
1818
+ * would call _forceRemove on a parentless node and hit the REPORT-3
1819
+ * fail-closed throw — which exists for nodes DOMPurify wants gone but
1820
+ * *cannot* detach (clobbered / parentless roots), the opposite of a node
1821
+ * that is already safely gone. The walk root is exempt: a detached
1822
+ * IN_PLACE root is legitimate input and must still be fully sanitized,
1823
+ * and a kill-decision on it must keep hitting the REPORT-3 throw.
1824
+ *
1825
+ * Nodes detached by hooks stay the hook's responsibility for placement:
1826
+ * they are not recorded in DOMPurify.removed, so the post-walk IN_PLACE
1827
+ * pass (which iterates DOMPurify.removed) does not reach them. But a
1828
+ * hook-detached subtree can still hold a queued resource-event handler -
1829
+ * e.g. an <img onload> that began loading when the caller built the live
1830
+ * tree - which fires in page scope after sanitize returns even though the
1831
+ * handler never reached the returned tree. That is the audit-5 F1 hazard,
1832
+ * and the documented node.remove() hook pattern walks straight into it.
1833
+ * So on the IN_PLACE path we neutralize the detached subtree inline,
1834
+ * stripping its non-allow-listed attributes before returning, exactly as
1835
+ * the post-walk pass does for _forceRemove'd subtrees.
1836
+ *
1837
+ * @param currentNode the node a hook may have detached
1838
+ * @param root the current walk root
1839
+ * @return true if the node is detached and now handled, false otherwise
1840
+ */
1841
+ const _handleHookDetachedNode = function _handleHookDetachedNode(currentNode, root) {
1842
+ if (currentNode === root || getParentNode(currentNode) !== null) {
1843
+ return false;
1844
+ }
1845
+ if (IN_PLACE) {
1846
+ _neutralizeSubtree(currentNode);
1847
+ }
1848
+ return true;
1849
+ };
1850
+ /**
1851
+ * _sanitizeElements
1852
+ *
1853
+ * @protect nodeName
1854
+ * @protect textContent
1855
+ * @protect removeChild
1856
+ * @param currentNode to check for permission to exist
1857
+ * @return true if node was killed, false if left alive
1858
+ */
1859
+ const _sanitizeElements = function _sanitizeElements(currentNode, root) {
1860
+ /* Execute a hook if present */
1861
+ _executeHooks(hooks.beforeSanitizeElements, currentNode, null);
1862
+ /* A hook may have detached the node - treat it as removed (see
1863
+ _handleHookDetachedNode for the full rationale). */
1864
+ if (_handleHookDetachedNode(currentNode, root)) {
1865
+ return true;
1866
+ }
1867
+ /* Check if element is clobbered or can clobber */
1868
+ if (_isClobbered(currentNode)) {
1869
+ _forceRemove(currentNode);
1870
+ return true;
1871
+ }
1872
+ /* Now let's check the element's type and name */
1873
+ const tagName = transformCaseFunc(_readNodeName(currentNode));
1874
+ /* Close the pre-walk clone-guard's timing gap: an uponSanitizeElement
1875
+ hook may have been installed after that guard sampled the hook arrays
1876
+ (e.g. lazily from beforeSanitizeElements), leaving ALLOWED_TAGS still
1877
+ aliasing a shared binding that a widening hook would mutate by
1878
+ reference. Fork it before exposing it to the hook. */
1879
+ ALLOWED_TAGS = _forkSharedAllowlist(hooks.uponSanitizeElement, ALLOWED_TAGS, DEFAULT_ALLOWED_TAGS, SET_CONFIG_ALLOWED_TAGS);
1880
+ /* Execute a hook if present */
1881
+ _executeHooks(hooks.uponSanitizeElement, currentNode, {
1882
+ tagName,
1883
+ allowedTags: ALLOWED_TAGS
1884
+ });
1885
+ /* The uponSanitizeElement hook may have detached the node, exactly as
1886
+ above (see _handleHookDetachedNode for the full rationale). */
1887
+ if (_handleHookDetachedNode(currentNode, root)) {
1888
+ return true;
1889
+ }
1890
+ /* Remove mXSS vectors, processing instructions and risky comments */
1891
+ if (_isUnsafeNode(currentNode, tagName)) {
1892
+ _forceRemove(currentNode);
1893
+ return true;
1894
+ }
1895
+ /* Remove element if anything forbids its presence */
1896
+ if (FORBID_TAGS[tagName] || !(EXTRA_ELEMENT_HANDLING.tagCheck instanceof Function && EXTRA_ELEMENT_HANDLING.tagCheck(tagName)) && !ALLOWED_TAGS[tagName]) {
1897
+ const removed = _sanitizeDisallowedNode(currentNode, tagName, root);
1898
+ /* A false return means the node is a custom element kept via
1899
+ CUSTOM_ELEMENT_HANDLING - the only keep path through
1900
+ _sanitizeDisallowedNode. Run afterSanitizeElements on it so the
1901
+ element-hook lifecycle matches normal allowlisted elements: a
1902
+ security policy applied in this hook (e.g. stripping an attribute
1903
+ from every surviving element) must not silently skip kept custom
1904
+ elements (GHSA-c2j3-45gr-mqc4). This mirrors the normal-element
1905
+ tail below - the hook runs, then the walker's subsequent
1906
+ _sanitizeAttributes pass sanitizes the element's attributes. The
1907
+ deliberately skipped namespace and fallback-tag removal checks stay
1908
+ skipped; they are removal decisions, not the hook contract. */
1909
+ if (removed === false) {
1910
+ _executeHooks(hooks.afterSanitizeElements, currentNode, null);
1911
+ }
1912
+ return removed;
1913
+ }
1914
+ /* Check whether element has a valid namespace.
1915
+ Realm-safe check (GHSA-hpcv-96wg-7vj8): use the cached Node.prototype
1916
+ nodeType getter rather than `instanceof Element`, which is realm-
1917
+ bound and short-circuits to false for any node minted in a different
1918
+ realm — letting a foreign-realm element with a forbidden namespace
1919
+ slip past the namespace check entirely. */
1920
+ const nt = _readNodeType(currentNode);
1921
+ if (nt === NODE_TYPE.element && !_checkValidNamespace(currentNode)) {
1922
+ _forceRemove(currentNode);
1923
+ return true;
1924
+ }
1925
+ /* Make sure that older browsers don't get fallback-tag mXSS */
1926
+ if ((tagName === 'noscript' || tagName === 'noembed' || tagName === 'noframes') && regExpTest(FALLBACK_TAG_CLOSE, currentNode.innerHTML)) {
1927
+ _forceRemove(currentNode);
1928
+ return true;
1929
+ }
1930
+ /* Sanitize element content to be template-safe */
1931
+ if (SAFE_FOR_TEMPLATES && currentNode.nodeType === NODE_TYPE.text) {
1932
+ /* Get the element's text content */
1933
+ const content = _stripTemplateExpressions(currentNode.textContent);
1934
+ if (currentNode.textContent !== content) {
1935
+ arrayPush(DOMPurify.removed, {
1936
+ element: currentNode.cloneNode()
1937
+ });
1938
+ currentNode.textContent = content;
1939
+ }
1940
+ }
1941
+ /* Execute a hook if present */
1942
+ _executeHooks(hooks.afterSanitizeElements, currentNode, null);
1943
+ return false;
1944
+ };
1945
+ /**
1946
+ * _isValidAttribute
1947
+ *
1948
+ * @param lcTag Lowercase tag name of containing element.
1949
+ * @param lcName Lowercase attribute name.
1950
+ * @param value Attribute value.
1951
+ * @return Returns true if `value` is valid, otherwise false.
1952
+ */
1953
+ // eslint-disable-next-line complexity
1954
+ const _isValidAttribute = function _isValidAttribute(lcTag, lcName, value) {
1955
+ /* FORBID_ATTR must always win, even if ADD_ATTR predicate would allow it */
1956
+ if (FORBID_ATTR[lcName]) {
1957
+ return false;
1958
+ }
1959
+ /* Reject declarative-partial-updates patch-linkage attributes
1960
+ (https://github.com/WICG/declarative-partial-updates).
1961
+ Empirical note (Chrome 150, verified — see
1962
+ test/declarative-patch-probe-v3.html): expansion is NOT applied after
1963
+ sanitization. For the string path it fires during sanitize()'s own
1964
+ parse, so the walk sees and sanitizes the fully materialized expanded
1965
+ tree — teleports into MathML/SVG integration points included; a
1966
+ weaponized `<template for>`->`<img onerror>` comes back with the handler
1967
+ stripped. For the IN_PLACE path it fires on connection, before the walk.
1968
+ Either way DOMPurify is NOT blind to the patch.
1969
+ This removal is therefore defense-in-depth rather than the sole barrier:
1970
+ it prevents live linkage from surviving into the OUTPUT and re-expanding
1971
+ in the caller's context, and keeps behaviour deterministic if a future
1972
+ engine defers expansion. `for` is legitimate only on <label>/<output>;
1973
+ anywhere else (notably <template for>) it links the element to a patch
1974
+ target and teleports or removes an arbitrary DOM range by id/marker name.
1975
+ `patchsrc` fetches remote markup and is treated as a script-loading
1976
+ mechanism (CSP). Gated on SAFE_FOR_XML so the removal groups with the
1977
+ other structural-threat checks and stays overridable, consistent with
1978
+ the rest of the codebase. PI range markers are already removed by
1979
+ _isUnsafeNode. */
1980
+ if (_isPatchLinkageAttribute(lcName, lcTag)) {
1981
+ return false;
1982
+ }
1983
+ /* Make sure attribute cannot clobber */
1984
+ if (SANITIZE_DOM && (lcName === 'id' || lcName === 'name') && (value in document || value in formElement)) {
1985
+ return false;
1986
+ }
1987
+ const nameIsPermitted = ALLOWED_ATTR[lcName] || EXTRA_ELEMENT_HANDLING.attributeCheck instanceof Function && EXTRA_ELEMENT_HANDLING.attributeCheck(lcName, lcTag);
1988
+ /* Allow valid data-* attributes: At least one character after "-"
1989
+ (https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes)
1990
+ XML-compatible (https://html.spec.whatwg.org/multipage/infrastructure.html#xml-compatible and http://www.w3.org/TR/xml/#d0e804)
1991
+ We don't need to check the value; it's always URI safe. */
1992
+ if (ALLOW_DATA_ATTR && regExpTest(DATA_ATTR$1, lcName)) {
1993
+ return true;
1994
+ }
1995
+ /* Allow valid aria-* attributes, the value is always URI safe */
1996
+ if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR$1, lcName)) {
1997
+ return true;
1998
+ }
1999
+ /* A name outside the allowlist is acceptable on custom-element terms
2000
+ only. The value checks below are intentionally skipped in that case:
2001
+ if the user supplied a tagNameCheck we also allow derived custom
2002
+ elements using the same test, and attributes passing the configured
2003
+ attributeNameCheck are allowed as custom elements define these at
2004
+ their own discretion. */
2005
+ if (!nameIsPermitted) {
2006
+ return (
2007
+ // Condition a) covers a basically valid custom element tag name whose
2008
+ // tag passes the configured tagNameCheck and whose attribute name
2009
+ // passes the configured attributeNameCheck ...
2010
+ _isBasicCustomElement(lcTag) && _matchesNameCheck(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag) && _matchesNameCheck(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName, lcTag) ||
2011
+ // Condition b) covers an `is` attribute whose value passes the
2012
+ // configured tagNameCheck while customized built-in elements are
2013
+ // allowed.
2014
+ lcName === 'is' && CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements && _matchesNameCheck(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value)
2015
+ );
2016
+ }
2017
+ /* Check value is safe. First, is attr inert? If so, is safe */
2018
+ if (URI_SAFE_ATTRIBUTES[lcName]) {
2019
+ return true;
2020
+ }
2021
+ /* Check no script, data or unknown possibly unsafe URI
2022
+ unless we know URI values are safe for that attribute */
2023
+ if (regExpTest(IS_ALLOWED_URI$1, stringReplace(value, ATTR_WHITESPACE$1, ''))) {
2024
+ return true;
2025
+ }
2026
+ /* Keep image data URIs alive if src/xlink:href is allowed */
2027
+ /* Further prevent gadget XSS for dynamically built script tags */
2028
+ if ((lcName === 'src' || lcName === 'xlink:href' || lcName === 'href') && lcTag !== 'script' && stringIndexOf(value, 'data:') === 0 && DATA_URI_TAGS[lcTag]) {
2029
+ return true;
2030
+ }
2031
+ /* Allow unknown protocols: This provides support for links that
2032
+ are handled by protocol handlers which may be unknown ahead of
2033
+ time, e.g. fb:, spotify: */
2034
+ if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA$1, stringReplace(value, ATTR_WHITESPACE$1, ''))) {
2035
+ return true;
2036
+ }
2037
+ /* Only an empty (binary) value remains safe at this point;
2038
+ anything else is presumed unsafe, do not add it back */
2039
+ return !value;
2040
+ };
2041
+ /* Names the HTML spec reserves from valid-custom-element-name; these must
2042
+ * never be treated as basic custom elements even when a permissive
2043
+ * CUSTOM_ELEMENT_HANDLING.tagNameCheck is configured. */
2044
+ const RESERVED_CUSTOM_ELEMENT_NAMES = addToSet({}, ['annotation-xml', 'color-profile', 'font-face', 'font-face-format', 'font-face-name', 'font-face-src', 'font-face-uri', 'missing-glyph']);
2045
+ /**
2046
+ * _isBasicCustomElement
2047
+ * checks if at least one dash is included in tagName, and it's not the first char
2048
+ * for more sophisticated checking see https://github.com/sindresorhus/validate-element-name
2049
+ *
2050
+ * @param tagName name of the tag of the node to sanitize
2051
+ * @returns Returns true if the tag name meets the basic criteria for a custom element, otherwise false.
2052
+ */
2053
+ const _isBasicCustomElement = function _isBasicCustomElement(tagName) {
2054
+ return !RESERVED_CUSTOM_ELEMENT_NAMES[stringToLowerCase(tagName)] && regExpTest(CUSTOM_ELEMENT$1, tagName);
2055
+ };
2056
+ /**
2057
+ * Wrap an attribute value in the matching Trusted Types object when
2058
+ * the active policy requires it. Namespaced attributes pass through
2059
+ * unchanged (no TT support yet, see
2060
+ * https://bugs.chromium.org/p/chromium/issues/detail?id=1305293).
2061
+ *
2062
+ * @param lcTag lowercase tag name of the containing element
2063
+ * @param lcName lowercase attribute name
2064
+ * @param namespaceURI the attribute's namespace, if any
2065
+ * @param value the attribute value to wrap
2066
+ * @return the value, wrapped when Trusted Types demand it
2067
+ */
2068
+ const _applyTrustedTypesToAttribute = function _applyTrustedTypesToAttribute(lcTag, lcName, namespaceURI, value) {
2069
+ if (trustedTypesPolicy && typeof trustedTypes === 'object' && typeof trustedTypes.getAttributeType === 'function' && !namespaceURI) {
2070
+ switch (trustedTypes.getAttributeType(lcTag, lcName)) {
2071
+ case 'TrustedHTML':
2072
+ {
2073
+ return _createTrustedHTML(value);
2074
+ }
2075
+ case 'TrustedScriptURL':
2076
+ {
2077
+ return _createTrustedScriptURL(value);
2078
+ }
2079
+ }
2080
+ }
2081
+ return value;
2082
+ };
2083
+ /**
2084
+ * Write a modified attribute value back onto the element. On
2085
+ * success, re-probe for clobbering introduced by the new value and
2086
+ * remove the element when found; otherwise pop the removal entry
2087
+ * recorded by the earlier _removeAttribute (long-standing pairing
2088
+ * with the SANITIZE_NAMED_PROPS path - do not "fix" casually). On
2089
+ * failure, remove the attribute instead.
2090
+ *
2091
+ * @param currentNode the element carrying the attribute
2092
+ * @param name the attribute name as present on the element
2093
+ * @param namespaceURI the attribute's namespace, if any
2094
+ * @param value the new attribute value
2095
+ */
2096
+ const _setAttributeValue = function _setAttributeValue(currentNode, name, namespaceURI, value) {
2097
+ try {
2098
+ if (namespaceURI) {
2099
+ currentNode.setAttributeNS(namespaceURI, name, value);
2100
+ } else {
2101
+ /* Fallback to setAttribute() for browser-unrecognized namespaces e.g. "x-schema". */
2102
+ currentNode.setAttribute(name, value);
2103
+ }
2104
+ if (_isClobbered(currentNode)) {
2105
+ _forceRemove(currentNode);
2106
+ } else {
2107
+ arrayPop(DOMPurify.removed);
2108
+ }
2109
+ } catch (_) {
2110
+ _removeAttribute(name, currentNode);
2111
+ }
2112
+ };
2113
+ /**
2114
+ * _sanitizeAttributes
2115
+ *
2116
+ * @protect attributes
2117
+ * @protect nodeName
2118
+ * @protect removeAttribute
2119
+ * @protect setAttribute
2120
+ *
2121
+ * @param currentNode to sanitize
2122
+ */
2123
+ const _sanitizeAttributes = function _sanitizeAttributes(currentNode) {
2124
+ /* Execute a hook if present */
2125
+ _executeHooks(hooks.beforeSanitizeAttributes, currentNode, null);
2126
+ const attributes = currentNode.attributes;
2127
+ /* Check if we have attributes; if not we might have a text node */
2128
+ if (!attributes || _isClobbered(currentNode)) {
2129
+ return;
2130
+ }
2131
+ /* Same lazy-install guard as uponSanitizeElement (see there): fork the
2132
+ attribute allowlist off its shared binding before a hook can see it. */
2133
+ ALLOWED_ATTR = _forkSharedAllowlist(hooks.uponSanitizeAttribute, ALLOWED_ATTR, DEFAULT_ALLOWED_ATTR, SET_CONFIG_ALLOWED_ATTR);
2134
+ const hookEvent = {
2135
+ attrName: '',
2136
+ attrValue: '',
2137
+ keepAttr: true,
2138
+ allowedAttributes: ALLOWED_ATTR,
2139
+ forceKeepAttr: undefined
2140
+ };
2141
+ let l = attributes.length;
2142
+ const lcTag = transformCaseFunc(currentNode.nodeName);
2143
+ /* Go backwards over all attributes; safely remove bad ones */
2144
+ while (l--) {
2145
+ const attr = attributes[l];
2146
+ const name = attr.name,
2147
+ namespaceURI = attr.namespaceURI,
2148
+ attrValue = attr.value;
2149
+ const lcName = transformCaseFunc(name);
2150
+ const initValue = attrValue;
2151
+ let value = name === 'value' ? initValue : stringTrim(initValue);
2152
+ /* Execute a hook if present */
2153
+ hookEvent.attrName = lcName;
2154
+ hookEvent.attrValue = value;
2155
+ hookEvent.keepAttr = true;
2156
+ hookEvent.forceKeepAttr = undefined; // Allows developers to see this is a property they can set
2157
+ _executeHooks(hooks.uponSanitizeAttribute, currentNode, hookEvent);
2158
+ value = hookEvent.attrValue;
2159
+ /* Full DOM Clobbering protection via namespace isolation,
2160
+ * Prefix id and name attributes with `user-content-`
2161
+ */
2162
+ if (SANITIZE_NAMED_PROPS && (lcName === 'id' || lcName === 'name') && stringIndexOf(value, SANITIZE_NAMED_PROPS_PREFIX) !== 0) {
2163
+ // Remove the attribute with this value
2164
+ _removeAttribute(name, currentNode, attr);
2165
+ // Prefix the value and later re-create the attribute with the sanitized value
2166
+ value = SANITIZE_NAMED_PROPS_PREFIX + value;
2167
+ }
2168
+ // Else: already prefixed, leave the attribute alone — the prefix is
2169
+ // itself the clobbering protection, and re-applying it is incorrect.
2170
+ /* Work around a security issue with comments inside attributes */
2171
+ if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, value)) {
2172
+ _removeAttribute(name, currentNode, attr);
2173
+ continue;
2174
+ }
2175
+ /* Make sure we cannot easily use animated hrefs, even if animations are allowed */
2176
+ if (lcName === 'attributename' && stringMatch(value, 'href')) {
2177
+ _removeAttribute(name, currentNode, attr);
2178
+ continue;
2179
+ }
2180
+ /* Did the hooks force-keep the attribute? */
2181
+ if (hookEvent.forceKeepAttr) {
2182
+ continue;
2183
+ }
2184
+ /* Did the hooks approve of the attribute? */
2185
+ if (!hookEvent.keepAttr) {
2186
+ _removeAttribute(name, currentNode, attr);
2187
+ continue;
2188
+ }
2189
+ /* Work around a security issue in jQuery 3.0 */
2190
+ if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(SELF_CLOSING_TAG, value)) {
2191
+ _removeAttribute(name, currentNode, attr);
2192
+ continue;
2193
+ }
2194
+ /* Sanitize attribute content to be template-safe */
2195
+ if (SAFE_FOR_TEMPLATES) {
2196
+ value = _stripTemplateExpressions(value);
2197
+ }
2198
+ /* Is `value` valid for this attribute? */
2199
+ if (!_isValidAttribute(lcTag, lcName, value)) {
2200
+ _removeAttribute(name, currentNode, attr);
2201
+ continue;
2202
+ }
2203
+ /* Handle attributes that require Trusted Types */
2204
+ value = _applyTrustedTypesToAttribute(lcTag, lcName, namespaceURI, value);
2205
+ /* Handle invalid data-* attribute set by try-catching it */
2206
+ if (value !== initValue) {
2207
+ _setAttributeValue(currentNode, name, namespaceURI, value);
2208
+ }
2209
+ }
2210
+ /* Execute a hook if present */
2211
+ _executeHooks(hooks.afterSanitizeAttributes, currentNode, null);
2212
+ };
2213
+ /**
2214
+ * _sanitizeShadowDOM
2215
+ *
2216
+ * @param fragment to iterate over recursively
2217
+ */
2218
+ const _sanitizeShadowDOM2 = function _sanitizeShadowDOM(fragment) {
2219
+ let shadowNode = null;
2220
+ const shadowIterator = _createNodeIterator(fragment);
2221
+ /* Execute a hook if present */
2222
+ _executeHooks(hooks.beforeSanitizeShadowDOM, fragment, null);
2223
+ while (shadowNode = shadowIterator.nextNode()) {
2224
+ /* Execute a hook if present */
2225
+ _executeHooks(hooks.uponSanitizeShadowNode, shadowNode, null);
2226
+ /* Sanitize tags and elements */
2227
+ _sanitizeElements(shadowNode, fragment);
2228
+ /* Check attributes next */
2229
+ _sanitizeAttributes(shadowNode);
2230
+ /* Deep shadow DOM detected.
2231
+ Realm-safe check (GHSA-hpcv-96wg-7vj8): use nodeType against the
2232
+ DOCUMENT_FRAGMENT_NODE constant rather than instanceof, so we
2233
+ recurse into <template>.content from foreign realms too. */
2234
+ if (_isDocumentFragment(shadowNode.content)) {
2235
+ _sanitizeShadowDOM2(shadowNode.content);
2236
+ }
2237
+ /* An element iterated here may itself host an attached
2238
+ shadow root. The default NodeIterator does not enter shadow
2239
+ trees, so a shadow root nested inside template.content was
2240
+ previously reached by no walk at all (the pre-pass at
2241
+ _sanitizeAttachedShadowRoots descends via childNodes, which
2242
+ doesn't enter template.content; the template-content recursion
2243
+ above iterates the content but never inspected shadowRoot).
2244
+ Walk it explicitly. The nodeType guard avoids reading
2245
+ shadowRoot off text / comment / CDATA / PI nodes that the
2246
+ iterator also surfaces. */
2247
+ if (_readNodeType(shadowNode) === NODE_TYPE.element) {
2248
+ const innerSr = getShadowRoot(shadowNode);
2249
+ if (_isDocumentFragment(innerSr)) {
2250
+ _sanitizeAttachedShadowRoots(innerSr);
2251
+ _sanitizeShadowDOM2(innerSr);
2252
+ }
2253
+ }
2254
+ }
2255
+ /* Execute a hook if present */
2256
+ _executeHooks(hooks.afterSanitizeShadowDOM, fragment, null);
2257
+ };
2258
+ /**
2259
+ * _sanitizeAttachedShadowRoots
2260
+ *
2261
+ * Walks `root` and feeds every attached shadow root we encounter into
2262
+ * the existing _sanitizeShadowDOM pipeline. The default node iterator
2263
+ * does not descend into shadow trees, so nodes inside an attached
2264
+ * shadow root would otherwise be skipped entirely.
2265
+ *
2266
+ * Two real input paths put attached shadow roots in front of us:
2267
+ * 1. IN_PLACE on a DOM node that already has shadow roots attached.
2268
+ * 2. DOM-node input where importNode(dirty, true) deep-clones the
2269
+ * shadow root because it was created with `clonable: true`.
2270
+ *
2271
+ * This pass runs once, up front, so the main iteration loop (and the
2272
+ * existing _sanitizeShadowDOM template-content recursion) stay
2273
+ * untouched — string-input paths are not affected.
2274
+ *
2275
+ * @param root the subtree root to walk for attached shadow roots
2276
+ */
2277
+ const _sanitizeAttachedShadowRoots = function _sanitizeAttachedShadowRoots(root) {
2278
+ /* Iterative (explicit stack) rather than per-child recursion. DOM APIs
2279
+ impose no depth cap, so an attacker-shaped tree (JSON/CRDT/editor data
2280
+ built straight into the DOM — the IN_PLACE surface) deeper than the JS
2281
+ call-stack budget would otherwise overflow native recursion here and
2282
+ throw at the IN_PLACE entry pre-pass, before a single node is
2283
+ sanitized, leaving the caller's live tree untouched (fail-open). See
2284
+ campaign-3 F4. A heap stack keeps depth off the call stack.
2285
+ Each work item is either a node to descend into, or a deferred
2286
+ `_sanitizeShadowDOM` for an already-walked shadow root. The deferred
2287
+ form preserves the original post-order discipline: a shadow root's
2288
+ nested shadow roots are discovered before the outer shadow is
2289
+ sanitized (which may remove hosts). Pushes are in reverse of the
2290
+ desired processing order (LIFO): template content, then children, then
2291
+ the shadow-sanitize, then the shadow walk — so the order matches the
2292
+ previous recursion exactly. */
2293
+ const stack = [{
2294
+ node: root,
2295
+ shadow: null
2296
+ }];
2297
+ while (stack.length > 0) {
2298
+ const item = stack.pop();
2299
+ /* Deferred shadow-DOM sanitisation: runs after its subtree was walked. */
2300
+ if (item.shadow) {
2301
+ _sanitizeShadowDOM2(item.shadow);
2302
+ continue;
2303
+ }
2304
+ const node = item.node;
2305
+ const nodeType = _readNodeType(node);
2306
+ const isElement = nodeType === NODE_TYPE.element;
2307
+ /* (pushed last → processed first) Children, snapshotted in reverse so
2308
+ the first child is processed first. Snapshotting matters because a
2309
+ hook may detach siblings mid-walk. */
2310
+ const childNodes = getChildNodes(node);
2311
+ if (childNodes) {
2312
+ for (let i = childNodes.length - 1; i >= 0; --i) {
2313
+ stack.push({
2314
+ node: childNodes[i],
2315
+ shadow: null
2316
+ });
2317
+ }
2318
+ }
2319
+ /* (pushed before children → processed after them, matching the old
2320
+ "template content last" order) When the node is a <template>,
2321
+ descend into its content. */
2322
+ if (isElement) {
2323
+ const rootName = getNodeName ? getNodeName(node) : null;
2324
+ if (typeof rootName === 'string' && transformCaseFunc(rootName) === 'template') {
2325
+ const content = node.content;
2326
+ if (_isDocumentFragment(content)) {
2327
+ stack.push({
2328
+ node: content,
2329
+ shadow: null
2330
+ });
2331
+ }
2332
+ }
2333
+ }
2334
+ /* Shadow root (processed first): walk its subtree, then sanitise it.
2335
+ Realm-safe check (GHSA-hpcv-96wg-7vj8): nodeType-based detection
2336
+ rather than `instanceof DocumentFragment`, which is realm-bound and
2337
+ silently skipped foreign-realm shadow roots (e.g.
2338
+ iframe.contentDocument attachShadow). */
2339
+ if (isElement) {
2340
+ const sr = getShadowRoot(node);
2341
+ if (_isDocumentFragment(sr)) {
2342
+ /* Push the deferred sanitise first so it pops after the shadow
2343
+ walk we push next, i.e. nested shadow roots are discovered
2344
+ before this one is sanitised. */
2345
+ stack.push({
2346
+ node: null,
2347
+ shadow: sr
2348
+ }, {
2349
+ node: sr,
2350
+ shadow: null
2351
+ });
2352
+ }
2353
+ }
2354
+ }
2355
+ };
2356
+ // eslint-disable-next-line complexity
2357
+ DOMPurify.sanitize = function (dirty) {
2358
+ let cfg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2359
+ let body = null;
2360
+ let importedNode = null;
2361
+ let currentNode = null;
2362
+ let returnNode = null;
2363
+ /* Make sure we have a string to sanitize.
2364
+ DO NOT return early, as this will return the wrong type if
2365
+ the user has requested a DOM object rather than a string */
2366
+ IS_EMPTY_INPUT = !dirty;
2367
+ if (IS_EMPTY_INPUT) {
2368
+ dirty = '<!-->';
2369
+ }
2370
+ /* Stringify, in case dirty is an object */
2371
+ if (typeof dirty !== 'string' && !_isNode(dirty)) {
2372
+ dirty = stringifyValue(dirty);
2373
+ if (typeof dirty !== 'string') {
2374
+ throw typeErrorCreate('dirty is not a string, aborting');
2375
+ }
2376
+ }
2377
+ /* Return dirty HTML if DOMPurify cannot run */
2378
+ if (!DOMPurify.isSupported) {
2379
+ return dirty;
2380
+ }
2381
+ /* Assign config vars */
2382
+ if (SET_CONFIG) {
2383
+ /* Persistent setConfig() path: _parseConfig is skipped, so the sets are
2384
+ * not re-derived per call. Restore them from the pristine bindings
2385
+ * captured at setConfig() time so a previous call's hook clone (mutated
2386
+ * below) does not carry over. */
2387
+ ALLOWED_TAGS = SET_CONFIG_ALLOWED_TAGS;
2388
+ ALLOWED_ATTR = SET_CONFIG_ALLOWED_ATTR;
2389
+ } else {
2390
+ _parseConfig(cfg);
2391
+ }
2392
+ /* Clone the hook-mutable allowlists before the walk whenever an
2393
+ * uponSanitize* hook is registered. The hook event exposes ALLOWED_TAGS
2394
+ * and ALLOWED_ATTR by reference (as allowedTags / allowedAttributes), so
2395
+ * a hook that widens them would otherwise mutate the shared set
2396
+ * permanently: across later calls and across every element. Cloning per
2397
+ * walk keeps documented in-call widening working while scoping it to the
2398
+ * call. A single guard for both config paths - the per-call path rebinds
2399
+ * the sets in _parseConfig each call, the persistent path restores them
2400
+ * from the captured bindings just above - so the two cannot diverge. */
2401
+ if (hooks.uponSanitizeElement.length > 0 || hooks.uponSanitizeAttribute.length > 0) {
2402
+ ALLOWED_TAGS = clone(ALLOWED_TAGS);
2403
+ }
2404
+ if (hooks.uponSanitizeAttribute.length > 0) {
2405
+ ALLOWED_ATTR = clone(ALLOWED_ATTR);
2406
+ }
2407
+ /* Clean up removed elements */
2408
+ DOMPurify.removed = [];
2409
+ /* Resolve IN_PLACE for this call without mutating persistent config.
2410
+ Writing the IN_PLACE closure variable here leaks under setConfig(),
2411
+ where _parseConfig is skipped on later calls: a single string call would
2412
+ disable in-place mode for every subsequent node call, returning a
2413
+ sanitized copy while leaving the caller's node — which in-place callers
2414
+ keep using and whose return value they ignore — unsanitized. REPORT-2. */
2415
+ const inPlace = IN_PLACE && typeof dirty !== 'string' && _isNode(dirty);
2416
+ if (inPlace) {
2417
+ /* Declarative-partial-updates / streaming pre-pass: sever every patch
2418
+ linkage across the live tree BEFORE the walk, so no patch can fire
2419
+ mid-walk and inject into an already-processed region. Runs first, so
2420
+ it also covers the forbidden/clobbered roots that throw below. */
2421
+ _neutralizePatchLinkage(dirty);
2422
+ /* Do some early pre-sanitization to avoid unsafe root nodes.
2423
+ Read nodeName through the cached prototype getter — a clobbering
2424
+ child named "nodeName" on the form root would otherwise shadow
2425
+ the property and let this check skip the root-allowlist
2426
+ validation entirely. */
2427
+ const nn = _readNodeName(dirty);
2428
+ if (typeof nn === 'string') {
2429
+ const tagName = transformCaseFunc(nn);
2430
+ if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {
2431
+ /* Fail closed on a live root: neutralize handlers/children before
2432
+ throwing, exactly as the mid-walk abort path does. */
2433
+ _neutralizeRoot(dirty);
2434
+ throw typeErrorCreate('root node is forbidden and cannot be sanitized in-place');
2435
+ }
2436
+ }
2437
+ /* Pre-flight the root through _isClobbered. The iterator-driven
2438
+ removal path can not detach a parent-less root: _forceRemove
2439
+ falls through to Element.prototype.remove(), which per spec
2440
+ is a no-op on a node with no parent. A clobbered root would
2441
+ then survive the main loop with its attributes uninspected,
2442
+ because _sanitizeAttributes early-returns on _isClobbered. The
2443
+ result would be an attacker-controlled form, complete with any
2444
+ event-handler attributes the caller passed in, handed back to
2445
+ the application unsanitized. Refuse to sanitize such a root
2446
+ the same way we refuse a forbidden tag. GHSA-r47g-fvhr-h676. */
2447
+ if (_isClobbered(dirty)) {
2448
+ /* Fail closed on a live clobbered root before throwing.
2449
+ _neutralizeRoot's reads are clobber-safe (cached getters); the
2450
+ form's non-clobbered descendants, e.g. an armed <img>, are scrubbed. */
2451
+ _neutralizeRoot(dirty);
2452
+ throw typeErrorCreate('root node is clobbered and cannot be sanitized in-place');
2453
+ }
2454
+ /* Sanitize attached shadow roots before the main iterator runs.
2455
+ The iterator does not descend into shadow trees. Same fail-closed
2456
+ barrier as the main walk (campaign-3 F2): a custom-element reaction
2457
+ inside a shadow root could abort this pre-pass before the walk runs,
2458
+ which would otherwise leave the entire live tree unsanitized. */
2459
+ try {
2460
+ _sanitizeAttachedShadowRoots(dirty);
2461
+ } catch (error) {
2462
+ _neutralizeRoot(dirty);
2463
+ throw error;
2464
+ }
2465
+ } else if (_isNode(dirty)) {
2466
+ /* If dirty is a DOM element, append to an empty document to avoid
2467
+ elements being stripped by the parser */
2468
+ body = _initDocument('<!---->');
2469
+ importedNode = body.ownerDocument.importNode(dirty, true);
2470
+ if (importedNode.nodeType === NODE_TYPE.element && importedNode.nodeName === 'BODY') {
2471
+ /* Node is already a body, use as is */
2472
+ body = importedNode;
2473
+ } else if (importedNode.nodeName === 'HTML') {
2474
+ body = importedNode;
2475
+ } else {
2476
+ // eslint-disable-next-line unicorn/prefer-dom-node-append
2477
+ body.appendChild(importedNode);
2478
+ }
2479
+ /* Clonable shadow roots are deep-cloned by importNode(); sanitize
2480
+ them before the main iterator runs, since the iterator does not
2481
+ descend into shadow trees. The walk routes every read through a
2482
+ cached prototype getter so clobbering descendants on a form root
2483
+ cannot hide a shadow host from this pass. */
2484
+ _sanitizeAttachedShadowRoots(importedNode);
2485
+ } else {
2486
+ /* Exit directly if we have nothing to do */
2487
+ if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT &&
2488
+ // eslint-disable-next-line unicorn/prefer-includes
2489
+ dirty.indexOf('<') === -1) {
2490
+ return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? _createTrustedHTML(dirty) : dirty;
2491
+ }
2492
+ /* Initialize the document to work on */
2493
+ body = _initDocument(dirty);
2494
+ /* Check we have a DOM node from the data */
2495
+ if (!body) {
2496
+ return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : '';
2497
+ }
2498
+ }
2499
+ /* Remove first element node (ours) if FORCE_BODY is set */
2500
+ if (body && FORCE_BODY) {
2501
+ _forceRemove(body.firstChild);
2502
+ }
2503
+ /* Get node iterator */
2504
+ const walkRoot = inPlace ? dirty : body;
2505
+ /* Now start iterating over the created document.
2506
+ The walk runs inside an exception barrier (campaign-3 F2): a re-entrant
2507
+ engine/custom-element mutation can detach a node mid-walk so
2508
+ `_forceRemove`'s parentless guard throws, aborting the loop. Without the
2509
+ barrier the caller's in-place tree would be left half-sanitized with the
2510
+ unvisited tail still armed. _createNodeIterator itself is inside the
2511
+ barrier too: constructing the iterator dereferences the root's document,
2512
+ and any failure there (e.g. an exotic/clobbered root) must still fail
2513
+ closed rather than skip the neutralize. On any throw we fail closed -
2514
+ strip the in-place root bare - then rethrow so the existing throw
2515
+ contract is preserved. (String/DOM-copy paths never return the partial
2516
+ body, so the propagating throw is already fail-closed there.) */
2517
+ try {
2518
+ const nodeIterator = _createNodeIterator(walkRoot);
2519
+ while (currentNode = nodeIterator.nextNode()) {
2520
+ /* Sanitize tags and elements */
2521
+ _sanitizeElements(currentNode, walkRoot);
2522
+ /* Check attributes next */
2523
+ _sanitizeAttributes(currentNode);
2524
+ /* Shadow DOM detected, sanitize it.
2525
+ Realm-safe check (GHSA-hpcv-96wg-7vj8): nodeType-based detection
2526
+ instead of instanceof, so foreign-realm <template>.content is
2527
+ walked correctly. */
2528
+ if (_isDocumentFragment(currentNode.content)) {
2529
+ _sanitizeShadowDOM2(currentNode.content);
2530
+ }
2531
+ }
2532
+ } catch (error) {
2533
+ if (inPlace) {
2534
+ _neutralizeRoot(dirty);
2535
+ /* Nodes _forceRemove'd earlier in the aborted walk are already
2536
+ detached from the root, so _neutralizeRoot's subtree pass does not
2537
+ reach them. Defuse them too, mirroring the success-path loop below. */
2538
+ arrayForEach(DOMPurify.removed, entry => {
2539
+ if (entry.element) {
2540
+ _neutralizeSubtree(entry.element);
2541
+ }
2542
+ });
2543
+ }
2544
+ throw error;
2545
+ }
2546
+ /* If we sanitized `dirty` in-place, return it. */
2547
+ if (inPlace) {
2548
+ /* Fail-closed completion of the audit-5 F1 fix: every node removed from
2549
+ the caller's live tree is detached but may still hold a queued
2550
+ resource-event handler that fires in page scope after we return. The
2551
+ move-hoist covers only disallowed-tag KEEP_CONTENT removals; strip the
2552
+ non-allow-listed attributes off every other removed subtree (clobber,
2553
+ mXSS, namespace, comments, KEEP_CONTENT:false, …) so those handlers are
2554
+ cancelled before any event can fire. Runs synchronously, pre-return. */
2555
+ arrayForEach(DOMPurify.removed, entry => {
2556
+ if (entry.element) {
2557
+ _neutralizeSubtree(entry.element);
2558
+ }
2559
+ });
2560
+ if (SAFE_FOR_TEMPLATES) {
2561
+ _scrubTemplateExpressions2(dirty);
2562
+ }
2563
+ return dirty;
2564
+ }
2565
+ /* Return sanitized string or DOM */
2566
+ if (RETURN_DOM) {
2567
+ if (SAFE_FOR_TEMPLATES) {
2568
+ _scrubTemplateExpressions2(body);
2569
+ }
2570
+ if (RETURN_DOM_FRAGMENT) {
2571
+ returnNode = createDocumentFragment.call(body.ownerDocument);
2572
+ while (body.firstChild) {
2573
+ // eslint-disable-next-line unicorn/prefer-dom-node-append
2574
+ returnNode.appendChild(body.firstChild);
2575
+ }
2576
+ } else {
2577
+ returnNode = body;
2578
+ }
2579
+ if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) {
2580
+ /*
2581
+ AdoptNode() is not used because internal state is not reset
2582
+ (e.g. the past names map of a HTMLFormElement), this is safe
2583
+ in theory but we would rather not risk another attack vector.
2584
+ The state that is cloned by importNode() is explicitly defined
2585
+ by the specs.
2586
+ */
2587
+ returnNode = importNode.call(originalDocument, returnNode, true);
2588
+ }
2589
+ return returnNode;
2590
+ }
2591
+ let serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;
2592
+ /* Serialize doctype if allowed */
2593
+ if (WHOLE_DOCUMENT && ALLOWED_TAGS['!doctype'] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) {
2594
+ serializedHTML = '<!DOCTYPE ' + body.ownerDocument.doctype.name + '>\n' + serializedHTML;
2595
+ }
2596
+ /* Sanitize final string template-safe */
2597
+ if (SAFE_FOR_TEMPLATES) {
2598
+ serializedHTML = _stripTemplateExpressions(serializedHTML);
2599
+ }
2600
+ return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? _createTrustedHTML(serializedHTML) : serializedHTML;
2601
+ };
2602
+ DOMPurify.setConfig = function () {
2603
+ let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2604
+ _parseConfig(cfg);
2605
+ SET_CONFIG = true;
2606
+ SET_CONFIG_ALLOWED_TAGS = ALLOWED_TAGS;
2607
+ SET_CONFIG_ALLOWED_ATTR = ALLOWED_ATTR;
2608
+ };
2609
+ DOMPurify.clearConfig = function () {
2610
+ CONFIG = null;
2611
+ SET_CONFIG = false;
2612
+ SET_CONFIG_ALLOWED_TAGS = null;
2613
+ SET_CONFIG_ALLOWED_ATTR = null;
2614
+ // Drop any caller-supplied Trusted Types policy so it cannot poison later
2615
+ // `RETURN_TRUSTED_TYPE` output. The internal default policy (cached, and
2616
+ // never recreated — Trusted Types throws on duplicate names) is restored by
2617
+ // the next `_parseConfig`. See GHSA-vxr8-fq34-vvx9.
2618
+ trustedTypesPolicy = defaultTrustedTypesPolicy;
2619
+ emptyHTML = '';
2620
+ };
2621
+ DOMPurify.isValidAttribute = function (tag, attr, value) {
2622
+ /* Initialize shared config vars if necessary. */
2623
+ if (!CONFIG) {
2624
+ _parseConfig({});
2625
+ }
2626
+ const lcTag = transformCaseFunc(tag);
2627
+ const lcName = transformCaseFunc(attr);
2628
+ return _isValidAttribute(lcTag, lcName, value);
2629
+ };
2630
+ DOMPurify.addHook = function (entryPoint, hookFunction) {
2631
+ if (typeof hookFunction !== 'function') {
2632
+ return;
2633
+ }
2634
+ /* Reject unknown entry points. Without this, a non-hook key (e.g.
2635
+ * '__proto__') indexes off the prototype chain rather than a real
2636
+ * hook array, and arrayPush then writes to Object.prototype. Guard
2637
+ * with an own-property check against the known hook names. */
2638
+ if (!objectHasOwnProperty(hooks, entryPoint)) {
2639
+ return;
2640
+ }
2641
+ arrayPush(hooks[entryPoint], hookFunction);
2642
+ };
2643
+ DOMPurify.removeHook = function (entryPoint, hookFunction) {
2644
+ if (!objectHasOwnProperty(hooks, entryPoint)) {
2645
+ return undefined;
2646
+ }
2647
+ if (hookFunction !== undefined) {
2648
+ const index = arrayLastIndexOf(hooks[entryPoint], hookFunction);
2649
+ return index === -1 ? undefined : arraySplice(hooks[entryPoint], index, 1)[0];
2650
+ }
2651
+ return arrayPop(hooks[entryPoint]);
2652
+ };
2653
+ DOMPurify.removeHooks = function (entryPoint) {
2654
+ if (!objectHasOwnProperty(hooks, entryPoint)) {
2655
+ return;
2656
+ }
2657
+ hooks[entryPoint] = [];
2658
+ };
2659
+ DOMPurify.removeAllHooks = function () {
2660
+ hooks = _createHooksMap();
2661
+ };
2662
+ return DOMPurify;
2663
+ }
2664
+ var purify = createDOMPurify();
2665
+
2666
+ return purify;
2667
+
2668
+ }));
2669
+ //# sourceMappingURL=purify.js.map
2670
+ });
2671
+
2672
+ exports.purify = purify;