@pine-ds/core 5.0.0-mercury.0 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1473) hide show
  1. package/components/aria-references.js +1 -0
  2. package/components/attributes.js +1 -0
  3. package/components/closest.js +1 -11
  4. package/components/floating-ui.dom.js +1 -0
  5. package/components/form.js +1 -0
  6. package/components/i18n-format.js +1 -0
  7. package/components/index.d.ts +51 -0
  8. package/components/index.js +1 -33
  9. package/components/index2.js +1 -14
  10. package/components/keep-hydrated.js +1 -0
  11. package/components/mock-pds-modal.d.ts +11 -0
  12. package/components/mock-pds-modal.js +1 -0
  13. package/components/pds-accordion.js +1 -68
  14. package/components/pds-alert.d.ts +11 -0
  15. package/components/pds-alert.js +1 -0
  16. package/components/pds-avatar.js +1 -103
  17. package/components/pds-box.js +1 -124
  18. package/components/pds-box2.js +1 -0
  19. package/components/pds-button.js +1 -8
  20. package/components/pds-button2.js +1 -84
  21. package/components/pds-checkbox.js +1 -8
  22. package/components/pds-checkbox2.js +1 -101
  23. package/components/pds-chip.js +1 -78
  24. package/components/pds-chip2.js +1 -0
  25. package/components/pds-combobox.d.ts +11 -0
  26. package/components/pds-combobox.js +2 -0
  27. package/components/pds-container.d.ts +11 -0
  28. package/components/pds-container.js +1 -0
  29. package/components/pds-copytext.js +1 -88
  30. package/components/pds-datepicker.d.ts +11 -0
  31. package/components/pds-datepicker.js +1 -0
  32. package/components/pds-divider.js +1 -54
  33. package/components/pds-drawer-content.d.ts +11 -0
  34. package/components/pds-drawer-content.js +1 -0
  35. package/components/pds-drawer-footer.d.ts +11 -0
  36. package/components/pds-drawer-footer.js +1 -0
  37. package/components/pds-drawer-header.d.ts +11 -0
  38. package/components/pds-drawer-header.js +1 -0
  39. package/components/pds-drawer.d.ts +11 -0
  40. package/components/pds-drawer.js +1 -0
  41. package/components/pds-dropdown-menu-item.d.ts +11 -0
  42. package/components/pds-dropdown-menu-item.js +1 -0
  43. package/components/pds-dropdown-menu-separator.d.ts +11 -0
  44. package/components/pds-dropdown-menu-separator.js +1 -0
  45. package/components/pds-dropdown-menu.d.ts +11 -0
  46. package/components/pds-dropdown-menu.js +1 -0
  47. package/components/pds-filter.d.ts +11 -0
  48. package/components/pds-filter.js +1 -0
  49. package/components/pds-filters.d.ts +11 -0
  50. package/components/pds-filters.js +1 -0
  51. package/components/pds-icon.js +1 -8
  52. package/components/pds-icon2.js +1 -370
  53. package/components/pds-image.js +1 -55
  54. package/components/pds-input.js +1 -72
  55. package/components/pds-input2.js +1 -0
  56. package/components/pds-link.js +1 -65
  57. package/components/pds-link2.js +1 -0
  58. package/components/pds-loader.js +1 -68
  59. package/components/pds-loader2.js +1 -0
  60. package/components/pds-modal-content.d.ts +11 -0
  61. package/components/pds-modal-content.js +1 -0
  62. package/components/pds-modal-footer.d.ts +11 -0
  63. package/components/pds-modal-footer.js +1 -0
  64. package/components/pds-modal-header.d.ts +11 -0
  65. package/components/pds-modal-header.js +1 -0
  66. package/components/pds-modal.d.ts +11 -0
  67. package/components/pds-modal.js +1 -0
  68. package/components/pds-modal2.js +1 -0
  69. package/components/pds-multiselect.d.ts +11 -0
  70. package/components/pds-multiselect.js +1 -0
  71. package/components/pds-popover.d.ts +11 -0
  72. package/components/pds-popover.js +1 -0
  73. package/components/pds-progress.js +1 -49
  74. package/components/pds-property.d.ts +11 -0
  75. package/components/pds-property.js +1 -0
  76. package/components/pds-radio-group.d.ts +11 -0
  77. package/components/pds-radio-group.js +1 -0
  78. package/components/pds-radio.js +1 -78
  79. package/components/pds-row.js +1 -72
  80. package/components/pds-select.d.ts +11 -0
  81. package/components/pds-select.js +1 -0
  82. package/components/pds-sortable-item.js +1 -58
  83. package/components/pds-sortable.js +3 -2718
  84. package/components/pds-switch.js +1 -82
  85. package/components/pds-tab.js +1 -53
  86. package/components/pds-table-body.js +1 -36
  87. package/components/pds-table-cell.js +1 -8
  88. package/components/pds-table-cell2.js +1 -72
  89. package/components/pds-table-head-cell.js +1 -8
  90. package/components/pds-table-head-cell2.js +1 -98
  91. package/components/pds-table-head.js +1 -90
  92. package/components/pds-table-row.js +1 -95
  93. package/components/pds-table.js +1 -124
  94. package/components/pds-tabpanel.js +1 -45
  95. package/components/pds-tabs.js +1 -119
  96. package/components/pds-text.d.ts +11 -0
  97. package/components/pds-text.js +1 -0
  98. package/components/pds-text2.js +1 -0
  99. package/components/pds-textarea.js +1 -82
  100. package/components/pds-toast.d.ts +11 -0
  101. package/components/pds-toast.js +1 -0
  102. package/components/pds-tooltip.js +1 -178
  103. package/components/portal-target.js +1 -0
  104. package/components/reconnected-content.js +1 -0
  105. package/components/reflected-attribute-default.js +1 -0
  106. package/components/scroll.js +1 -0
  107. package/components/sortable-label.js +1 -0
  108. package/components/tabbable.js +1 -0
  109. package/components/truncation-tooltip.js +1 -0
  110. package/components/utils.js +1 -0
  111. package/dist/cjs/aria-references-CUmqibnO.js +54 -0
  112. package/dist/cjs/attributes-Cgbkw6gO.js +188 -0
  113. package/dist/cjs/closest-D0qyYtJ3.js +20 -0
  114. package/dist/cjs/floating-ui.dom-Dw41zbyY.js +1715 -0
  115. package/dist/cjs/form-MhwfKTuo.js +69 -0
  116. package/dist/cjs/i18n-format-BD0PmYzT.js +65 -0
  117. package/dist/cjs/index-BDnbr0DK.js +39 -0
  118. package/dist/cjs/index-D9iJuJCP.js +2950 -0
  119. package/dist/cjs/index.cjs.js +21 -2
  120. package/dist/cjs/keep-hydrated-AKoh0DG4.js +197 -0
  121. package/dist/cjs/loader.cjs.js +4 -8
  122. package/dist/cjs/mock-pds-modal.cjs.entry.js +92 -0
  123. package/dist/cjs/pds-accordion.cjs.entry.js +16 -14
  124. package/dist/cjs/pds-alert.cjs.entry.js +88 -0
  125. package/dist/cjs/pds-avatar.cjs.entry.js +123 -28
  126. package/dist/cjs/pds-box.cjs.entry.js +143 -58
  127. package/dist/cjs/pds-button.cjs.entry.js +234 -25
  128. package/dist/cjs/pds-checkbox.cjs.entry.js +102 -26
  129. package/dist/cjs/pds-chip.cjs.entry.js +226 -23
  130. package/dist/cjs/pds-combobox.cjs.entry.js +4500 -0
  131. package/dist/cjs/pds-container.cjs.entry.js +37 -0
  132. package/dist/cjs/pds-copytext.cjs.entry.js +98 -17
  133. package/dist/cjs/pds-datepicker.cjs.entry.js +2139 -0
  134. package/dist/cjs/pds-divider.cjs.entry.js +16 -11
  135. package/dist/cjs/pds-drawer-content.cjs.entry.js +24 -0
  136. package/dist/cjs/pds-drawer-footer.cjs.entry.js +24 -0
  137. package/dist/cjs/pds-drawer-header.cjs.entry.js +24 -0
  138. package/dist/cjs/pds-drawer.cjs.entry.js +156 -0
  139. package/dist/cjs/pds-dropdown-menu-item.cjs.entry.js +151 -0
  140. package/dist/cjs/pds-dropdown-menu-separator.cjs.entry.js +23 -0
  141. package/dist/cjs/pds-dropdown-menu.cjs.entry.js +453 -0
  142. package/dist/cjs/pds-filter.cjs.entry.js +512 -0
  143. package/dist/cjs/pds-filters.cjs.entry.js +18 -0
  144. package/dist/cjs/pds-icon.cjs.entry.js +334 -44
  145. package/dist/cjs/pds-image.cjs.entry.js +158 -16
  146. package/dist/cjs/pds-input.cjs.entry.js +300 -26
  147. package/dist/cjs/pds-link.cjs.entry.js +50 -13
  148. package/dist/cjs/pds-loader.cjs.entry.js +49 -14
  149. package/dist/cjs/pds-modal-content.cjs.entry.js +199 -0
  150. package/dist/cjs/pds-modal-footer.cjs.entry.js +24 -0
  151. package/dist/cjs/pds-modal-header.cjs.entry.js +24 -0
  152. package/dist/cjs/pds-modal.cjs.entry.js +592 -0
  153. package/dist/cjs/pds-multiselect.cjs.entry.js +1384 -0
  154. package/dist/cjs/pds-popover.cjs.entry.js +1103 -0
  155. package/dist/cjs/pds-progress.cjs.entry.js +30 -12
  156. package/dist/cjs/pds-property.cjs.entry.js +22 -0
  157. package/dist/cjs/pds-radio-group.cjs.entry.js +260 -0
  158. package/dist/cjs/pds-radio.cjs.entry.js +101 -23
  159. package/dist/cjs/pds-row.cjs.entry.js +50 -21
  160. package/dist/cjs/pds-select.cjs.entry.js +380 -0
  161. package/dist/cjs/pds-sortable-item.cjs.entry.js +59 -11
  162. package/dist/cjs/pds-sortable.cjs.entry.js +504 -119
  163. package/dist/cjs/pds-switch.cjs.entry.js +185 -27
  164. package/dist/cjs/pds-tab.cjs.entry.js +78 -16
  165. package/dist/cjs/pds-table-body.cjs.entry.js +5 -9
  166. package/dist/cjs/pds-table-cell.cjs.entry.js +150 -19
  167. package/dist/cjs/pds-table-head-cell.cjs.entry.js +222 -30
  168. package/dist/cjs/pds-table-head.cjs.entry.js +17 -13
  169. package/dist/cjs/pds-table-row.cjs.entry.js +104 -16
  170. package/dist/cjs/pds-table.cjs.entry.js +434 -22
  171. package/dist/cjs/pds-tabpanel.cjs.entry.js +32 -13
  172. package/dist/cjs/pds-tabs.cjs.entry.js +206 -18
  173. package/dist/cjs/pds-text.cjs.entry.js +141 -0
  174. package/dist/cjs/pds-textarea.cjs.entry.js +318 -29
  175. package/dist/cjs/pds-toast.cjs.entry.js +156 -0
  176. package/dist/cjs/pds-tooltip.cjs.entry.js +401 -110
  177. package/dist/cjs/pine-core.cjs.js +8 -10
  178. package/dist/cjs/portal-target-e8WQ6dLx.js +70 -0
  179. package/dist/cjs/reconnected-content-CpnEQcTp.js +29 -0
  180. package/dist/cjs/reflected-attribute-default-DVYHG6O1.js +44 -0
  181. package/dist/cjs/scroll-2XcoE_6Q.js +79 -0
  182. package/dist/cjs/sortable-label-DOcJrHvA.js +37 -0
  183. package/dist/cjs/tabbable-BrrrGvdG.js +86 -0
  184. package/dist/cjs/truncation-tooltip-CM5HgRHh.js +430 -0
  185. package/dist/cjs/utils-BhRmyxT8.js +121 -0
  186. package/dist/collection/collection-manifest.json +30 -3
  187. package/dist/collection/components/_internal/pds-label/pds-label.js +0 -1
  188. package/dist/collection/components/pds-accordion/pds-accordion.css +24 -29
  189. package/dist/collection/components/pds-accordion/pds-accordion.js +36 -9
  190. package/dist/collection/components/pds-accordion/stories/pds-accordion.stories.js +12 -18
  191. package/dist/collection/components/pds-alert/pds-alert.css +141 -0
  192. package/dist/collection/components/pds-alert/pds-alert.js +291 -0
  193. package/dist/collection/components/pds-alert/pds-alert.tokens.css +85 -0
  194. package/dist/collection/components/pds-alert/stories/pds-alert.stories.js +114 -0
  195. package/dist/collection/components/pds-avatar/pds-avatar.css +56 -23
  196. package/dist/collection/components/pds-avatar/pds-avatar.js +284 -32
  197. package/dist/collection/components/pds-avatar/stories/pds-avatar.stories.js +41 -3
  198. package/dist/collection/components/pds-box/pds-box.css +5520 -264
  199. package/dist/collection/components/pds-box/pds-box.js +2854 -252
  200. package/dist/collection/components/pds-box/stories/pds-box.stories.js +86 -30
  201. package/dist/collection/components/pds-button/pds-button.css +255 -93
  202. package/dist/collection/components/pds-button/pds-button.js +470 -40
  203. package/dist/collection/components/pds-button/stories/pds-button.stories.js +242 -16
  204. package/dist/collection/components/pds-checkbox/checkbox-interface.js +0 -1
  205. package/dist/collection/components/pds-checkbox/pds-checkbox.css +168 -60
  206. package/dist/collection/components/pds-checkbox/pds-checkbox.js +186 -54
  207. package/dist/collection/components/pds-checkbox/stories/pds-checkbox.stories.js +45 -15
  208. package/dist/collection/components/pds-chip/pds-chip.css +239 -114
  209. package/dist/collection/components/pds-chip/pds-chip.js +437 -60
  210. package/dist/collection/components/pds-chip/pds-chip.tokens.css +69 -0
  211. package/dist/collection/components/pds-chip/stories/pds-chip.stories.js +164 -24
  212. package/dist/collection/components/pds-combobox/combobox-interface.js +1 -0
  213. package/dist/collection/components/pds-combobox/grouped-options-panel.js +318 -0
  214. package/dist/collection/components/pds-combobox/pds-combobox.css +953 -0
  215. package/dist/collection/components/pds-combobox/pds-combobox.js +3839 -0
  216. package/dist/collection/components/pds-combobox/stories/pds-combobox.stories.js +934 -0
  217. package/dist/collection/components/pds-container/pds-container.css +26 -0
  218. package/dist/collection/components/pds-container/pds-container.js +111 -0
  219. package/dist/collection/components/pds-container/stories/pds-container.stories.js +89 -0
  220. package/dist/collection/components/pds-copytext/pds-copytext.css +39 -51
  221. package/dist/collection/components/pds-copytext/pds-copytext.js +116 -23
  222. package/dist/collection/components/pds-copytext/stories/pds-copytext.stories.js +6 -12
  223. package/dist/collection/components/pds-datepicker/calendar-portal.js +99 -0
  224. package/dist/collection/components/pds-datepicker/date-utils.js +174 -0
  225. package/dist/collection/components/pds-datepicker/datepicker-interface.js +1 -0
  226. package/dist/collection/components/pds-datepicker/pds-datepicker.css +547 -0
  227. package/dist/collection/components/pds-datepicker/pds-datepicker.js +2505 -0
  228. package/dist/collection/components/pds-datepicker/presets.js +131 -0
  229. package/dist/collection/components/pds-datepicker/stories/pds-datepicker.stories.js +206 -0
  230. package/dist/collection/components/pds-datepicker/value.js +296 -0
  231. package/dist/collection/components/pds-divider/pds-divider.css +71 -40
  232. package/dist/collection/components/pds-divider/pds-divider.js +47 -11
  233. package/dist/collection/components/pds-divider/stories/pds-divider.stories.js +7 -2
  234. package/dist/collection/components/pds-drawer/pds-drawer-content/pds-drawer-content.css +22 -0
  235. package/dist/collection/components/pds-drawer/pds-drawer-content/pds-drawer-content.js +27 -0
  236. package/dist/collection/components/pds-drawer/pds-drawer-footer/pds-drawer-footer.css +15 -0
  237. package/dist/collection/components/pds-drawer/pds-drawer-footer/pds-drawer-footer.js +27 -0
  238. package/dist/collection/components/pds-drawer/pds-drawer-header/pds-drawer-header.css +15 -0
  239. package/dist/collection/components/pds-drawer/pds-drawer-header/pds-drawer-header.js +27 -0
  240. package/dist/collection/components/pds-drawer/pds-drawer.css +47 -0
  241. package/dist/collection/components/pds-drawer/pds-drawer.js +405 -0
  242. package/dist/collection/components/pds-drawer/stories/pds-drawer.stories.js +77 -0
  243. package/dist/collection/components/pds-dropdown-menu/pds-dropdown-menu-item/pds-dropdown-menu-item.css +93 -0
  244. package/dist/collection/components/pds-dropdown-menu/pds-dropdown-menu-item/pds-dropdown-menu-item.js +398 -0
  245. package/dist/collection/components/pds-dropdown-menu/pds-dropdown-menu-separator/pds-dropdown-menu-separator.css +7 -0
  246. package/dist/collection/components/pds-dropdown-menu/pds-dropdown-menu-separator/pds-dropdown-menu-separator.js +71 -0
  247. package/dist/collection/components/pds-dropdown-menu/pds-dropdown-menu.css +68 -0
  248. package/dist/collection/components/pds-dropdown-menu/pds-dropdown-menu.js +545 -0
  249. package/dist/collection/components/pds-dropdown-menu/stories/pds-dropdown-menu.stories.js +100 -0
  250. package/dist/collection/components/pds-filters/pds-filter/filter-interface.js +1 -0
  251. package/dist/collection/components/pds-filters/pds-filter/pds-filter.css +200 -0
  252. package/dist/collection/components/pds-filters/pds-filter/pds-filter.js +756 -0
  253. package/dist/collection/components/pds-filters/pds-filter/stories/pds-filter.stories.js +87 -0
  254. package/dist/collection/components/pds-filters/pds-filters.css +10 -0
  255. package/dist/collection/components/pds-filters/pds-filters.js +44 -0
  256. package/dist/collection/components/pds-filters/stories/pds-filters.stories.js +34 -0
  257. package/dist/collection/components/pds-icon/stories/pds-icon.stories.js +2 -2
  258. package/dist/collection/components/pds-image/image-interface.js +1 -0
  259. package/dist/collection/components/pds-image/pds-image.css +13 -1
  260. package/dist/collection/components/pds-image/pds-image.js +297 -31
  261. package/dist/collection/components/pds-image/stories/pds-image.stories.js +124 -8
  262. package/dist/collection/components/pds-input/input-interface.js +1 -0
  263. package/dist/collection/components/pds-input/pds-input.css +275 -63
  264. package/dist/collection/components/pds-input/pds-input.js +687 -57
  265. package/dist/collection/components/pds-input/pds-input.tokens.css +3 -0
  266. package/dist/collection/components/pds-input/stories/pds-input.stories.js +310 -14
  267. package/dist/collection/components/pds-link/pds-link.css +45 -30
  268. package/dist/collection/components/pds-link/pds-link.js +332 -19
  269. package/dist/collection/components/pds-link/stories/pds-link.stories.js +82 -4
  270. package/dist/collection/components/pds-loader/pds-loader.css +17 -30
  271. package/dist/collection/components/pds-loader/pds-loader.js +62 -14
  272. package/dist/collection/components/pds-loader/stories/pds-loader.stories.js +3 -5
  273. package/dist/collection/components/pds-modal/pds-modal-content/pds-modal-content.css +25 -0
  274. package/dist/collection/components/pds-modal/pds-modal-content/pds-modal-content.js +235 -0
  275. package/dist/collection/components/pds-modal/pds-modal-footer/pds-modal-footer.css +8 -0
  276. package/dist/collection/components/pds-modal/pds-modal-footer/pds-modal-footer.js +27 -0
  277. package/dist/collection/components/pds-modal/pds-modal-header/pds-modal-header.css +8 -0
  278. package/dist/collection/components/pds-modal/pds-modal-header/pds-modal-header.js +27 -0
  279. package/dist/collection/components/pds-modal/pds-modal.css +142 -0
  280. package/dist/collection/components/pds-modal/pds-modal.js +852 -0
  281. package/dist/collection/components/pds-modal/stories/pds-modal.stories.js +745 -0
  282. package/dist/collection/components/pds-modal/test/mock-pds-modal.js +286 -0
  283. package/dist/collection/components/pds-multiselect/multiselect-interface.js +1 -0
  284. package/dist/collection/components/pds-multiselect/pds-multiselect.css +365 -0
  285. package/dist/collection/components/pds-multiselect/pds-multiselect.js +2597 -0
  286. package/dist/collection/components/pds-multiselect/stories/pds-multiselect.stories.js +866 -0
  287. package/dist/collection/components/pds-popover/pds-popover.css +16 -0
  288. package/dist/collection/components/pds-popover/pds-popover.js +1347 -0
  289. package/dist/collection/components/pds-popover/popover-interface.js +1 -0
  290. package/dist/collection/components/pds-popover/stories/pds-popover.stories.js +117 -0
  291. package/dist/collection/components/pds-progress/pds-progress.css +11 -24
  292. package/dist/collection/components/pds-progress/pds-progress.js +49 -16
  293. package/dist/collection/components/pds-progress/stories/pds-progress.stories.js +2 -4
  294. package/dist/collection/components/pds-property/pds-property.css +4 -0
  295. package/dist/collection/components/pds-property/pds-property.js +70 -0
  296. package/dist/collection/components/pds-property/stories/pds-property.stories.js +16 -0
  297. package/dist/collection/components/pds-radio/pds-radio.css +285 -54
  298. package/dist/collection/components/pds-radio/pds-radio.js +226 -53
  299. package/dist/collection/components/pds-radio/stories/pds-radio.stories.js +66 -19
  300. package/dist/collection/components/pds-radio-group/pds-radio-group.css +45 -0
  301. package/dist/collection/components/pds-radio-group/pds-radio-group.js +514 -0
  302. package/dist/collection/components/pds-radio-group/radio-group-interface.js +1 -0
  303. package/dist/collection/components/pds-radio-group/stories/pds-radio-group.stories.js +179 -0
  304. package/dist/collection/components/pds-row/pds-row.css +10 -9
  305. package/dist/collection/components/pds-row/pds-row.js +132 -30
  306. package/dist/collection/components/pds-row/stories/pds-row.stories.js +27 -24
  307. package/dist/collection/components/pds-select/pds-select.css +168 -0
  308. package/dist/collection/components/pds-select/pds-select.js +728 -0
  309. package/dist/collection/components/pds-select/pds-select.tokens.css +3 -0
  310. package/dist/collection/components/pds-select/stories/pds-select.stories.js +205 -0
  311. package/dist/collection/components/pds-sortable/pds-sortable-item/pds-sortable-item.css +64 -26
  312. package/dist/collection/components/pds-sortable/pds-sortable-item/pds-sortable-item.js +87 -10
  313. package/dist/collection/components/pds-sortable/pds-sortable-item/stories/pds-sortable-item.stories.js +0 -2
  314. package/dist/collection/components/pds-sortable/pds-sortable.css +2 -4
  315. package/dist/collection/components/pds-sortable/pds-sortable.js +571 -17
  316. package/dist/collection/components/pds-sortable/sortable-interface.js +0 -1
  317. package/dist/collection/components/pds-sortable/sortable-label.js +33 -0
  318. package/dist/collection/components/pds-sortable/stories/pds-sortable.stories.js +49 -13
  319. package/dist/collection/components/pds-switch/pds-switch.css +60 -59
  320. package/dist/collection/components/pds-switch/pds-switch.js +268 -63
  321. package/dist/collection/components/pds-switch/stories/pds-switch.stories.js +90 -28
  322. package/dist/collection/components/pds-table/pds-table-body/pds-table-body.js +4 -2
  323. package/dist/collection/components/pds-table/pds-table-cell/pds-table-cell.css +36 -19
  324. package/dist/collection/components/pds-table/pds-table-cell/pds-table-cell.js +193 -15
  325. package/dist/collection/components/pds-table/pds-table-cell/stories/pds-table-cell.stories.js +22 -7
  326. package/dist/collection/components/pds-table/pds-table-head/pds-table-head.css +22 -5
  327. package/dist/collection/components/pds-table/pds-table-head/pds-table-head.js +75 -11
  328. package/dist/collection/components/pds-table/pds-table-head-cell/pds-table-head-cell.css +57 -25
  329. package/dist/collection/components/pds-table/pds-table-head-cell/pds-table-head-cell.js +328 -24
  330. package/dist/collection/components/pds-table/pds-table-head-cell/stories/pds-table-head-cell.stories.js +12 -7
  331. package/dist/collection/components/pds-table/pds-table-row/pds-table-row.css +14 -5
  332. package/dist/collection/components/pds-table/pds-table-row/pds-table-row.js +118 -13
  333. package/dist/collection/components/pds-table/pds-table-row/stories/pds-table-row.stories.js +3 -9
  334. package/dist/collection/components/pds-table/pds-table.css +106 -17
  335. package/dist/collection/components/pds-table/pds-table.js +576 -44
  336. package/dist/collection/components/pds-table/stories/pds-table.stories.js +428 -33
  337. package/dist/collection/components/pds-tabs/pds-tab/pds-tab.css +102 -60
  338. package/dist/collection/components/pds-tabs/pds-tab/pds-tab.js +240 -18
  339. package/dist/collection/components/pds-tabs/pds-tab/stories/pds-tab.stories.js +15 -0
  340. package/dist/collection/components/pds-tabs/pds-tabpanel/pds-tabpanel.css +15 -2
  341. package/dist/collection/components/pds-tabs/pds-tabpanel/pds-tabpanel.js +68 -12
  342. package/dist/collection/components/pds-tabs/pds-tabpanel/stories/pds-tabpanel.stories.js +15 -0
  343. package/dist/collection/components/pds-tabs/pds-tabs.css +31 -11
  344. package/dist/collection/components/pds-tabs/pds-tabs.js +301 -30
  345. package/dist/collection/components/pds-tabs/stories/pds-tabs.stories.js +70 -27
  346. package/dist/collection/components/pds-text/pds-text.css +207 -0
  347. package/dist/collection/components/pds-text/pds-text.js +328 -0
  348. package/dist/collection/components/pds-text/stories/pds-text.stories.js +141 -0
  349. package/dist/collection/components/pds-textarea/pds-textarea.css +127 -57
  350. package/dist/collection/components/pds-textarea/pds-textarea.js +598 -57
  351. package/dist/collection/components/pds-textarea/stories/pds-textarea.stories.js +101 -25
  352. package/dist/collection/components/pds-textarea/textarea-interface.js +0 -1
  353. package/dist/collection/components/pds-toast/pds-toast.css +167 -0
  354. package/dist/collection/components/pds-toast/pds-toast.js +362 -0
  355. package/dist/collection/components/pds-toast/stories/pds-toast.stories.js +98 -0
  356. package/dist/collection/components/pds-tooltip/pds-tooltip.css +73 -79
  357. package/dist/collection/components/pds-tooltip/pds-tooltip.js +451 -80
  358. package/dist/collection/components/pds-tooltip/stories/pds-tooltip.stories.js +52 -24
  359. package/dist/collection/global/pine-global.js +6 -0
  360. package/dist/collection/global/pine-ui-global.js +0 -1
  361. package/dist/collection/global/styles/utils/label.css +17 -0
  362. package/dist/collection/i18n/i18n-format.js +59 -0
  363. package/dist/collection/i18n/index.js +1 -0
  364. package/dist/collection/index.js +3 -1
  365. package/dist/collection/utils/aria-references.js +48 -0
  366. package/dist/collection/utils/attributes.js +180 -0
  367. package/dist/collection/utils/closest.js +8 -1
  368. package/dist/collection/utils/css.js +41 -0
  369. package/dist/collection/utils/form.js +41 -8
  370. package/dist/collection/utils/interfaces.js +1 -0
  371. package/dist/collection/utils/keep-hydrated.js +188 -0
  372. package/dist/collection/utils/overlay.js +66 -50
  373. package/dist/collection/utils/portal-target.js +64 -0
  374. package/dist/collection/utils/reconnected-content.js +25 -0
  375. package/dist/collection/utils/reflected-attribute-default.js +40 -0
  376. package/dist/collection/utils/scroll.js +77 -0
  377. package/dist/collection/utils/tabbable.js +82 -0
  378. package/dist/collection/utils/test/axe.js +106 -0
  379. package/dist/collection/utils/test/host-strip.js +50 -0
  380. package/dist/collection/utils/test/reconnect-safety.js +31 -0
  381. package/dist/collection/utils/test/reduced-motion.js +78 -0
  382. package/dist/collection/utils/truncation-tooltip.js +422 -0
  383. package/dist/collection/utils/types.js +18 -2
  384. package/dist/collection/utils/utils.js +109 -4
  385. package/dist/docs.d.ts +45 -0
  386. package/dist/docs.json +25718 -2809
  387. package/dist/esm/aria-references-CNn1lObg.js +50 -0
  388. package/dist/esm/attributes-CD8knu3a.js +183 -0
  389. package/dist/esm/closest-DHPzKMVS.js +17 -0
  390. package/dist/esm/floating-ui.dom-Cuc0DYlm.js +1706 -0
  391. package/dist/esm/form-BuRbS7Hp.js +63 -0
  392. package/dist/esm/i18n-format-BJgZHCWe.js +61 -0
  393. package/dist/esm/index-4_RRPJTO.js +2938 -0
  394. package/dist/esm/index-B0DXTeeV.js +21 -0
  395. package/dist/esm/index.js +21 -2
  396. package/dist/esm/keep-hydrated-BgNaWLoS.js +190 -0
  397. package/dist/esm/loader.js +4 -6
  398. package/dist/esm/mock-pds-modal.entry.js +90 -0
  399. package/dist/esm/pds-accordion.entry.js +16 -12
  400. package/dist/esm/pds-alert.entry.js +86 -0
  401. package/dist/esm/pds-avatar.entry.js +123 -26
  402. package/dist/esm/pds-box.entry.js +143 -56
  403. package/dist/esm/pds-button.entry.js +233 -22
  404. package/dist/esm/pds-checkbox.entry.js +103 -25
  405. package/dist/esm/pds-chip.entry.js +227 -22
  406. package/dist/esm/pds-combobox.entry.js +4498 -0
  407. package/dist/esm/pds-container.entry.js +35 -0
  408. package/dist/esm/pds-copytext.entry.js +98 -15
  409. package/dist/esm/pds-datepicker.entry.js +2137 -0
  410. package/dist/esm/pds-divider.entry.js +16 -9
  411. package/dist/esm/pds-drawer-content.entry.js +22 -0
  412. package/dist/esm/pds-drawer-footer.entry.js +22 -0
  413. package/dist/esm/pds-drawer-header.entry.js +22 -0
  414. package/dist/esm/pds-drawer.entry.js +154 -0
  415. package/dist/esm/pds-dropdown-menu-item.entry.js +149 -0
  416. package/dist/esm/pds-dropdown-menu-separator.entry.js +21 -0
  417. package/dist/esm/pds-dropdown-menu.entry.js +451 -0
  418. package/dist/esm/pds-filter.entry.js +510 -0
  419. package/dist/esm/pds-filters.entry.js +16 -0
  420. package/dist/esm/pds-icon.entry.js +334 -42
  421. package/dist/esm/pds-image.entry.js +158 -14
  422. package/dist/esm/pds-input.entry.js +301 -25
  423. package/dist/esm/pds-link.entry.js +50 -11
  424. package/dist/esm/pds-loader.entry.js +49 -12
  425. package/dist/esm/pds-modal-content.entry.js +197 -0
  426. package/dist/esm/pds-modal-footer.entry.js +22 -0
  427. package/dist/esm/pds-modal-header.entry.js +22 -0
  428. package/dist/esm/pds-modal.entry.js +590 -0
  429. package/dist/esm/pds-multiselect.entry.js +1382 -0
  430. package/dist/esm/pds-popover.entry.js +1101 -0
  431. package/dist/esm/pds-progress.entry.js +30 -10
  432. package/dist/esm/pds-property.entry.js +20 -0
  433. package/dist/esm/pds-radio-group.entry.js +258 -0
  434. package/dist/esm/pds-radio.entry.js +102 -22
  435. package/dist/esm/pds-row.entry.js +50 -19
  436. package/dist/esm/pds-select.entry.js +378 -0
  437. package/dist/esm/pds-sortable-item.entry.js +59 -9
  438. package/dist/esm/pds-sortable.entry.js +504 -117
  439. package/dist/esm/pds-switch.entry.js +186 -26
  440. package/dist/esm/pds-tab.entry.js +78 -14
  441. package/dist/esm/pds-table-body.entry.js +5 -7
  442. package/dist/esm/pds-table-cell.entry.js +150 -17
  443. package/dist/esm/pds-table-head-cell.entry.js +222 -28
  444. package/dist/esm/pds-table-head.entry.js +17 -11
  445. package/dist/esm/pds-table-row.entry.js +104 -14
  446. package/dist/esm/pds-table.entry.js +434 -20
  447. package/dist/esm/pds-tabpanel.entry.js +32 -11
  448. package/dist/esm/pds-tabs.entry.js +206 -16
  449. package/dist/esm/pds-text.entry.js +139 -0
  450. package/dist/esm/pds-textarea.entry.js +319 -28
  451. package/dist/esm/pds-toast.entry.js +154 -0
  452. package/dist/esm/pds-tooltip.entry.js +401 -108
  453. package/dist/esm/pine-core.js +6 -7
  454. package/dist/esm/portal-target-CKRzRKdO.js +66 -0
  455. package/dist/esm/reconnected-content-RFpTWV6r.js +27 -0
  456. package/dist/esm/reflected-attribute-default-t3idJwV0.js +42 -0
  457. package/dist/esm/scroll-DtgUQhjl.js +75 -0
  458. package/dist/esm/sortable-label-PItnzVVR.js +35 -0
  459. package/dist/esm/tabbable-C6ZWpp3v.js +84 -0
  460. package/dist/esm/truncation-tooltip-CkIWm6Z-.js +425 -0
  461. package/dist/esm/utils-OYK5-nwe.js +114 -0
  462. package/dist/esm-es5/aria-references-CNn1lObg.js +1 -0
  463. package/dist/esm-es5/attributes-CD8knu3a.js +1 -0
  464. package/dist/esm-es5/closest-DHPzKMVS.js +1 -0
  465. package/dist/esm-es5/floating-ui.dom-Cuc0DYlm.js +1 -0
  466. package/dist/esm-es5/form-BuRbS7Hp.js +1 -0
  467. package/dist/esm-es5/i18n-format-BJgZHCWe.js +1 -0
  468. package/dist/esm-es5/index-4_RRPJTO.js +2 -0
  469. package/dist/esm-es5/index-B0DXTeeV.js +1 -0
  470. package/dist/esm-es5/index.js +1 -2
  471. package/dist/esm-es5/keep-hydrated-BgNaWLoS.js +1 -0
  472. package/dist/esm-es5/loader.js +1 -2
  473. package/dist/esm-es5/mock-pds-modal.entry.js +1 -0
  474. package/dist/esm-es5/pds-accordion.entry.js +1 -2
  475. package/dist/esm-es5/pds-alert.entry.js +1 -0
  476. package/dist/esm-es5/pds-avatar.entry.js +1 -2
  477. package/dist/esm-es5/pds-box.entry.js +1 -2
  478. package/dist/esm-es5/pds-button.entry.js +1 -2
  479. package/dist/esm-es5/pds-checkbox.entry.js +1 -2
  480. package/dist/esm-es5/pds-chip.entry.js +1 -2
  481. package/dist/esm-es5/pds-combobox.entry.js +2 -0
  482. package/dist/esm-es5/pds-container.entry.js +1 -0
  483. package/dist/esm-es5/pds-copytext.entry.js +1 -2
  484. package/dist/esm-es5/pds-datepicker.entry.js +1 -0
  485. package/dist/esm-es5/pds-divider.entry.js +1 -2
  486. package/dist/esm-es5/pds-drawer-content.entry.js +1 -0
  487. package/dist/esm-es5/pds-drawer-footer.entry.js +1 -0
  488. package/dist/esm-es5/pds-drawer-header.entry.js +1 -0
  489. package/dist/esm-es5/pds-drawer.entry.js +1 -0
  490. package/dist/esm-es5/pds-dropdown-menu-item.entry.js +1 -0
  491. package/dist/esm-es5/pds-dropdown-menu-separator.entry.js +1 -0
  492. package/dist/esm-es5/pds-dropdown-menu.entry.js +1 -0
  493. package/dist/esm-es5/pds-filter.entry.js +1 -0
  494. package/dist/esm-es5/pds-filters.entry.js +1 -0
  495. package/dist/esm-es5/pds-icon.entry.js +1 -2
  496. package/dist/esm-es5/pds-image.entry.js +1 -2
  497. package/dist/esm-es5/pds-input.entry.js +1 -2
  498. package/dist/esm-es5/pds-link.entry.js +1 -2
  499. package/dist/esm-es5/pds-loader.entry.js +1 -2
  500. package/dist/esm-es5/pds-modal-content.entry.js +1 -0
  501. package/dist/esm-es5/pds-modal-footer.entry.js +1 -0
  502. package/dist/esm-es5/pds-modal-header.entry.js +1 -0
  503. package/dist/esm-es5/pds-modal.entry.js +1 -0
  504. package/dist/esm-es5/pds-multiselect.entry.js +1 -0
  505. package/dist/esm-es5/pds-popover.entry.js +1 -0
  506. package/dist/esm-es5/pds-progress.entry.js +1 -2
  507. package/dist/esm-es5/pds-property.entry.js +1 -0
  508. package/dist/esm-es5/pds-radio-group.entry.js +1 -0
  509. package/dist/esm-es5/pds-radio.entry.js +1 -2
  510. package/dist/esm-es5/pds-row.entry.js +1 -2
  511. package/dist/esm-es5/pds-select.entry.js +1 -0
  512. package/dist/esm-es5/pds-sortable-item.entry.js +1 -2
  513. package/dist/esm-es5/pds-sortable.entry.js +3 -4
  514. package/dist/esm-es5/pds-switch.entry.js +1 -2
  515. package/dist/esm-es5/pds-tab.entry.js +1 -2
  516. package/dist/esm-es5/pds-table-body.entry.js +1 -2
  517. package/dist/esm-es5/pds-table-cell.entry.js +1 -2
  518. package/dist/esm-es5/pds-table-head-cell.entry.js +1 -2
  519. package/dist/esm-es5/pds-table-head.entry.js +1 -2
  520. package/dist/esm-es5/pds-table-row.entry.js +1 -2
  521. package/dist/esm-es5/pds-table.entry.js +1 -2
  522. package/dist/esm-es5/pds-tabpanel.entry.js +1 -2
  523. package/dist/esm-es5/pds-tabs.entry.js +1 -2
  524. package/dist/esm-es5/pds-text.entry.js +1 -0
  525. package/dist/esm-es5/pds-textarea.entry.js +1 -2
  526. package/dist/esm-es5/pds-toast.entry.js +1 -0
  527. package/dist/esm-es5/pds-tooltip.entry.js +1 -2
  528. package/dist/esm-es5/pine-core.js +1 -2
  529. package/dist/esm-es5/portal-target-CKRzRKdO.js +1 -0
  530. package/dist/esm-es5/reconnected-content-RFpTWV6r.js +1 -0
  531. package/dist/esm-es5/reflected-attribute-default-t3idJwV0.js +1 -0
  532. package/dist/esm-es5/scroll-DtgUQhjl.js +1 -0
  533. package/dist/esm-es5/sortable-label-PItnzVVR.js +1 -0
  534. package/dist/esm-es5/tabbable-C6ZWpp3v.js +1 -0
  535. package/dist/esm-es5/truncation-tooltip-CkIWm6Z-.js +1 -0
  536. package/dist/esm-es5/utils-OYK5-nwe.js +1 -0
  537. package/dist/pine-core/index.esm.js +1 -2
  538. package/dist/pine-core/p-053ff8eb.system.entry.js +1 -0
  539. package/dist/pine-core/p-08b9e3ad.entry.js +1 -0
  540. package/dist/pine-core/p-0ac4262e.system.entry.js +1 -0
  541. package/dist/pine-core/p-0e1b8bd1.system.entry.js +1 -0
  542. package/dist/pine-core/p-12fdc65f.entry.js +1 -0
  543. package/dist/pine-core/p-1765a41b.system.entry.js +1 -0
  544. package/dist/pine-core/p-18524c25.entry.js +1 -0
  545. package/dist/pine-core/p-191eb9e5.system.entry.js +1 -0
  546. package/dist/pine-core/p-1c584a20.entry.js +1 -0
  547. package/dist/pine-core/p-1d4ecc35.entry.js +7 -0
  548. package/dist/pine-core/p-1e0c9738.system.entry.js +1 -0
  549. package/dist/pine-core/p-1fb1ca3d.entry.js +1 -0
  550. package/dist/pine-core/p-2482e4ab.system.entry.js +1 -0
  551. package/dist/pine-core/p-2cc7c682.entry.js +1 -0
  552. package/dist/pine-core/p-2f15e85f.entry.js +1 -0
  553. package/dist/pine-core/p-3306dc5a.system.entry.js +1 -0
  554. package/dist/pine-core/p-3338fc2e.entry.js +1 -0
  555. package/dist/pine-core/p-33da254f.system.entry.js +1 -0
  556. package/dist/pine-core/p-34d22a45.system.entry.js +1 -0
  557. package/dist/pine-core/p-35b90796.entry.js +1 -0
  558. package/dist/pine-core/p-38148f5b.entry.js +1 -0
  559. package/dist/pine-core/p-39264dfb.system.entry.js +1 -0
  560. package/dist/pine-core/p-3aed0418.system.entry.js +1 -0
  561. package/dist/pine-core/p-3dd879fd.entry.js +1 -0
  562. package/dist/pine-core/p-3f1c05cd.system.entry.js +1 -0
  563. package/dist/pine-core/p-3fc9ef80.system.entry.js +1 -0
  564. package/dist/pine-core/p-4125a4a6.system.entry.js +1 -0
  565. package/dist/pine-core/p-42376f2c.entry.js +1 -0
  566. package/dist/pine-core/p-4263038f.entry.js +1 -0
  567. package/dist/pine-core/p-47df9e9f.system.entry.js +3 -0
  568. package/dist/pine-core/p-55a4659a.system.entry.js +1 -0
  569. package/dist/pine-core/p-563baadd.system.entry.js +1 -0
  570. package/dist/pine-core/p-57af5c29.system.entry.js +1 -0
  571. package/dist/pine-core/p-587bd9ed.entry.js +1 -0
  572. package/dist/pine-core/p-5c7dfa7a.entry.js +1 -0
  573. package/dist/pine-core/p-5db87fda.system.entry.js +1 -0
  574. package/dist/pine-core/p-5eb0c78c.system.entry.js +1 -0
  575. package/dist/pine-core/p-6017afb5.system.entry.js +1 -0
  576. package/dist/pine-core/p-63d47dd4.system.entry.js +1 -0
  577. package/dist/pine-core/p-66e61921.system.entry.js +1 -0
  578. package/dist/pine-core/p-67999353.entry.js +1 -0
  579. package/dist/pine-core/p-68328afc.entry.js +1 -0
  580. package/dist/pine-core/p-6a965119.entry.js +1 -0
  581. package/dist/pine-core/p-6fdc6df9.system.entry.js +1 -0
  582. package/dist/pine-core/p-72668673.system.entry.js +1 -0
  583. package/dist/pine-core/p-765f4207.entry.js +1 -0
  584. package/dist/pine-core/p-77530cf2.entry.js +1 -0
  585. package/dist/pine-core/p-77a22399.entry.js +1 -0
  586. package/dist/pine-core/p-783127bf.entry.js +1 -0
  587. package/dist/pine-core/p-7a51f15e.entry.js +1 -0
  588. package/dist/pine-core/p-7b978fff.system.entry.js +1 -0
  589. package/dist/pine-core/p-82f7eed1.entry.js +1 -0
  590. package/dist/pine-core/p-863ff553.system.entry.js +1 -0
  591. package/dist/pine-core/p-87a32ded.system.entry.js +1 -0
  592. package/dist/pine-core/p-87cadd6f.system.entry.js +8 -0
  593. package/dist/pine-core/p-8db554fe.entry.js +1 -0
  594. package/dist/pine-core/p-8e7e7bba.entry.js +1 -0
  595. package/dist/pine-core/p-907c69e9.system.entry.js +1 -0
  596. package/dist/pine-core/p-90f83a5b.system.entry.js +1 -0
  597. package/dist/pine-core/p-931a0ccd.system.entry.js +1 -0
  598. package/dist/pine-core/p-94fd9595.entry.js +1 -0
  599. package/dist/pine-core/p-96bccf85.system.entry.js +1 -0
  600. package/dist/pine-core/p-9a63bf72.entry.js +1 -0
  601. package/dist/pine-core/p-9d983e09.system.entry.js +1 -0
  602. package/dist/pine-core/p-9da10cfb.system.entry.js +1 -0
  603. package/dist/pine-core/p-9e005996.entry.js +1 -0
  604. package/dist/pine-core/p-B0DXTeeV.js +1 -0
  605. package/dist/pine-core/p-BJgZHCWe.js +1 -0
  606. package/dist/pine-core/p-BK1sLRfg.system.js +2 -0
  607. package/dist/pine-core/p-BNTlHhoO.system.js +1 -0
  608. package/dist/pine-core/p-BSRFZB4I.system.js +1 -0
  609. package/dist/pine-core/p-BZ1l3LGl.system.js +1 -0
  610. package/dist/pine-core/p-BZsj6eAn.system.js +1 -0
  611. package/dist/pine-core/p-BbXp4qBM.system.js +1 -0
  612. package/dist/pine-core/p-BgNaWLoS.js +1 -0
  613. package/dist/pine-core/p-Bkho_oFB.system.js +1 -0
  614. package/dist/pine-core/p-BlJQebvG.system.js +1 -0
  615. package/dist/pine-core/p-BuRbS7Hp.js +1 -0
  616. package/dist/pine-core/p-BxIzb-Wc.system.js +1 -0
  617. package/dist/pine-core/p-C35-349-.system.js +1 -0
  618. package/dist/pine-core/p-C6ZWpp3v.js +1 -0
  619. package/dist/pine-core/p-CANeE7Ss.system.js +1 -0
  620. package/dist/pine-core/p-CIe1DGXa.system.js +1 -0
  621. package/dist/pine-core/p-CKRzRKdO.js +1 -0
  622. package/dist/pine-core/p-CNn1lObg.js +1 -0
  623. package/dist/pine-core/p-CQJ44c6o.system.js +1 -0
  624. package/dist/pine-core/p-Cuc0DYlm.js +1 -0
  625. package/dist/pine-core/p-DHPzKMVS.js +1 -0
  626. package/dist/pine-core/p-DVra397g.system.js +1 -0
  627. package/dist/pine-core/p-DtgUQhjl.js +1 -0
  628. package/dist/pine-core/p-Dv9QBmIF.js +1 -0
  629. package/dist/pine-core/p-Dx8tEj0U.system.js +1 -0
  630. package/dist/pine-core/p-M31tvpDN.js +2 -0
  631. package/dist/pine-core/p-OYK5-nwe.js +1 -0
  632. package/dist/pine-core/p-PItnzVVR.js +1 -0
  633. package/dist/pine-core/p-RFpTWV6r.js +1 -0
  634. package/dist/pine-core/p-VPGVqK3P.system.js +1 -0
  635. package/dist/pine-core/p-XK45dzWR.system.js +1 -0
  636. package/dist/pine-core/p-a0fa77b1.system.entry.js +1 -0
  637. package/dist/pine-core/p-a149af29.entry.js +1 -0
  638. package/dist/pine-core/p-a1575919.entry.js +1 -0
  639. package/dist/pine-core/p-a20d9eca.system.entry.js +1 -0
  640. package/dist/pine-core/p-a5782d99.entry.js +1 -0
  641. package/dist/pine-core/p-a9eaf160.system.entry.js +1 -0
  642. package/dist/pine-core/p-aae96744.entry.js +1 -0
  643. package/dist/pine-core/p-b379d9bc.system.entry.js +1 -0
  644. package/dist/pine-core/p-b96bdff6.entry.js +1 -0
  645. package/dist/pine-core/p-badde164.entry.js +1 -0
  646. package/dist/pine-core/p-bbd9ab75.entry.js +1 -0
  647. package/dist/pine-core/p-biShcgLI.js +1 -0
  648. package/dist/pine-core/p-c12b5cd7.system.entry.js +1 -0
  649. package/dist/pine-core/p-c2afe4f3.system.entry.js +1 -0
  650. package/dist/pine-core/p-c65f4eaa.system.entry.js +1 -0
  651. package/dist/pine-core/p-c6c5ada6.system.entry.js +1 -0
  652. package/dist/pine-core/p-c76d8b9e.system.entry.js +1 -0
  653. package/dist/pine-core/p-c89ea2d3.entry.js +1 -0
  654. package/dist/pine-core/p-ce9fa14b.entry.js +1 -0
  655. package/dist/pine-core/p-d4b0122f.system.entry.js +1 -0
  656. package/dist/pine-core/p-d61a0fe8.system.entry.js +1 -0
  657. package/dist/pine-core/p-d7d7a4e1.entry.js +1 -0
  658. package/dist/pine-core/p-d85d50cb.entry.js +1 -0
  659. package/dist/pine-core/p-daa802f1.entry.js +2 -0
  660. package/dist/pine-core/p-de3f4a28.system.entry.js +1 -0
  661. package/dist/pine-core/p-e00777da.system.entry.js +1 -0
  662. package/dist/pine-core/p-e2a1a49a.system.entry.js +1 -0
  663. package/dist/pine-core/p-e334af06.entry.js +1 -0
  664. package/dist/pine-core/p-e4216ff6.entry.js +1 -0
  665. package/dist/pine-core/p-e68044b3.entry.js +1 -0
  666. package/dist/pine-core/p-e75d8bc1.entry.js +1 -0
  667. package/dist/pine-core/p-e871cfce.entry.js +1 -0
  668. package/dist/pine-core/p-e92d0f0f.system.entry.js +1 -0
  669. package/dist/pine-core/p-eab165b9.system.entry.js +1 -0
  670. package/dist/pine-core/p-eabc4bd8.entry.js +1 -0
  671. package/dist/pine-core/p-eeYeEogd.system.js +1 -0
  672. package/dist/pine-core/p-eee042d3.entry.js +1 -0
  673. package/dist/pine-core/p-ef9f84f2.system.entry.js +1 -0
  674. package/dist/pine-core/p-f026af73.entry.js +1 -0
  675. package/dist/pine-core/p-f0509c8e.entry.js +1 -0
  676. package/dist/pine-core/p-f1252e72.system.entry.js +1 -0
  677. package/dist/pine-core/p-f3496fd1.entry.js +1 -0
  678. package/dist/pine-core/p-f65127f1.entry.js +1 -0
  679. package/dist/pine-core/p-f90f4be7.system.entry.js +1 -0
  680. package/dist/pine-core/p-f99bd77f.entry.js +1 -0
  681. package/dist/pine-core/p-fda791df.entry.js +1 -0
  682. package/dist/pine-core/p-t3idJwV0.js +1 -0
  683. package/dist/pine-core/p-wB2y8gR7.system.js +1 -0
  684. package/dist/pine-core/pine-core.css +1 -1
  685. package/dist/pine-core/pine-core.esm.js +1 -2
  686. package/dist/pine-core/pine-core.js +1 -1
  687. package/dist/scripts/vscode-custom-data-generator.js +406 -0
  688. package/dist/scripts/vscode-settings-patcher.cjs +89 -0
  689. package/dist/types/components/pds-accordion/pds-accordion.d.ts +9 -1
  690. package/dist/types/components/pds-alert/pds-alert.d.ts +62 -0
  691. package/dist/types/components/pds-avatar/pds-avatar.d.ts +53 -3
  692. package/dist/types/components/pds-box/pds-box.d.ts +495 -16
  693. package/dist/types/components/pds-button/pds-button.d.ts +91 -13
  694. package/dist/types/components/pds-checkbox/pds-checkbox.d.ts +43 -9
  695. package/dist/types/components/pds-chip/pds-chip.d.ts +77 -14
  696. package/dist/types/components/pds-combobox/combobox-interface.d.ts +73 -0
  697. package/dist/types/components/pds-combobox/grouped-options-panel.d.ts +128 -0
  698. package/dist/types/components/pds-combobox/pds-combobox.d.ts +714 -0
  699. package/dist/types/components/pds-container/pds-container.d.ts +22 -0
  700. package/dist/types/components/pds-copytext/pds-copytext.d.ts +20 -5
  701. package/dist/types/components/pds-datepicker/calendar-portal.d.ts +36 -0
  702. package/dist/types/components/pds-datepicker/date-utils.d.ts +67 -0
  703. package/dist/types/components/pds-datepicker/datepicker-interface.d.ts +47 -0
  704. package/dist/types/components/pds-datepicker/pds-datepicker.d.ts +515 -0
  705. package/dist/types/components/pds-datepicker/presets.d.ts +24 -0
  706. package/dist/types/components/pds-datepicker/value.d.ts +59 -0
  707. package/dist/types/components/pds-divider/pds-divider.d.ts +10 -2
  708. package/dist/types/components/pds-drawer/pds-drawer-content/pds-drawer-content.d.ts +9 -0
  709. package/dist/types/components/pds-drawer/pds-drawer-footer/pds-drawer-footer.d.ts +9 -0
  710. package/dist/types/components/pds-drawer/pds-drawer-header/pds-drawer-header.d.ts +9 -0
  711. package/dist/types/components/pds-drawer/pds-drawer.d.ts +89 -0
  712. package/dist/types/components/pds-dropdown-menu/pds-dropdown-menu-item/pds-dropdown-menu-item.d.ts +87 -0
  713. package/dist/types/components/pds-dropdown-menu/pds-dropdown-menu-separator/pds-dropdown-menu-separator.d.ts +13 -0
  714. package/dist/types/components/pds-dropdown-menu/pds-dropdown-menu.d.ts +60 -0
  715. package/dist/types/components/pds-filters/pds-filter/filter-interface.d.ts +19 -0
  716. package/dist/types/components/pds-filters/pds-filter/pds-filter.d.ts +135 -0
  717. package/dist/types/components/pds-filters/pds-filters.d.ts +11 -0
  718. package/dist/types/components/pds-image/image-interface.d.ts +12 -0
  719. package/dist/types/components/pds-image/pds-image.d.ts +75 -11
  720. package/dist/types/components/pds-input/input-interface.d.ts +12 -0
  721. package/dist/types/components/pds-input/pds-input.d.ts +174 -9
  722. package/dist/types/components/pds-link/pds-link.d.ts +81 -11
  723. package/dist/types/components/pds-loader/pds-loader.d.ts +10 -3
  724. package/dist/types/components/pds-modal/pds-modal-content/pds-modal-content.d.ts +43 -0
  725. package/dist/types/components/pds-modal/pds-modal-footer/pds-modal-footer.d.ts +9 -0
  726. package/dist/types/components/pds-modal/pds-modal-header/pds-modal-header.d.ts +9 -0
  727. package/dist/types/components/pds-modal/pds-modal.d.ts +152 -0
  728. package/dist/types/components/pds-modal/test/mock-pds-modal.d.ts +68 -0
  729. package/dist/types/components/pds-multiselect/multiselect-interface.d.ts +61 -0
  730. package/dist/types/components/pds-multiselect/pds-multiselect.d.ts +402 -0
  731. package/dist/types/components/pds-popover/pds-popover.d.ts +292 -0
  732. package/dist/types/components/pds-popover/popover-interface.d.ts +4 -0
  733. package/dist/types/components/pds-progress/pds-progress.d.ts +6 -2
  734. package/dist/types/components/pds-property/pds-property.d.ts +14 -0
  735. package/dist/types/components/pds-radio/pds-radio.d.ts +42 -11
  736. package/dist/types/components/pds-radio-group/pds-radio-group.d.ts +84 -0
  737. package/dist/types/components/pds-radio-group/radio-group-interface.d.ts +5 -0
  738. package/dist/types/components/pds-row/pds-row.d.ts +17 -2
  739. package/dist/types/components/pds-select/pds-select.d.ts +182 -0
  740. package/dist/types/components/pds-sortable/pds-sortable-item/pds-sortable-item.d.ts +14 -3
  741. package/dist/types/components/pds-sortable/pds-sortable.d.ts +99 -4
  742. package/dist/types/components/pds-sortable/sortable-interface.d.ts +3 -1
  743. package/dist/types/components/pds-sortable/sortable-label.d.ts +7 -0
  744. package/dist/types/components/pds-switch/pds-switch.d.ts +51 -17
  745. package/dist/types/components/pds-table/pds-table-body/pds-table-body.d.ts +3 -0
  746. package/dist/types/components/pds-table/pds-table-cell/pds-table-cell.d.ts +40 -1
  747. package/dist/types/components/pds-table/pds-table-head/pds-table-head.d.ts +19 -2
  748. package/dist/types/components/pds-table/pds-table-head-cell/pds-table-head-cell.d.ts +73 -2
  749. package/dist/types/components/pds-table/pds-table-row/pds-table-row.d.ts +27 -4
  750. package/dist/types/components/pds-table/pds-table.d.ts +138 -12
  751. package/dist/types/components/pds-tabs/pds-tab/pds-tab.d.ts +55 -0
  752. package/dist/types/components/pds-tabs/pds-tabpanel/pds-tabpanel.d.ts +12 -0
  753. package/dist/types/components/pds-tabs/pds-tabs.d.ts +45 -5
  754. package/dist/types/components/pds-text/pds-text.d.ts +61 -0
  755. package/dist/types/components/pds-textarea/pds-textarea.d.ts +140 -15
  756. package/dist/types/components/pds-textarea/textarea-interface.d.ts +5 -1
  757. package/dist/types/components/pds-toast/pds-toast.d.ts +83 -0
  758. package/dist/types/components/pds-tooltip/pds-tooltip.d.ts +80 -20
  759. package/dist/types/components.d.ts +7070 -1247
  760. package/dist/types/global/pine-global.d.ts +2 -0
  761. package/dist/types/home/runner/work/pine/pine/libs/core/.stencil/scripts/vscode-custom-data-generator.d.ts +6 -0
  762. package/dist/types/i18n/i18n-format.d.ts +38 -0
  763. package/dist/types/i18n/index.d.ts +2 -0
  764. package/dist/types/index.d.ts +3 -0
  765. package/dist/types/stencil-public-runtime.d.ts +195 -8
  766. package/dist/types/utils/aria-references.d.ts +28 -0
  767. package/dist/types/utils/attributes.d.ts +44 -0
  768. package/dist/types/utils/closest.d.ts +2 -0
  769. package/dist/types/utils/css.d.ts +7 -0
  770. package/dist/types/utils/form.d.ts +23 -1
  771. package/dist/types/utils/interfaces.d.ts +6 -0
  772. package/dist/types/utils/keep-hydrated.d.ts +56 -0
  773. package/dist/types/utils/overlay.d.ts +3 -3
  774. package/dist/types/utils/portal-target.d.ts +17 -0
  775. package/dist/types/utils/reconnected-content.d.ts +14 -0
  776. package/dist/types/utils/reflected-attribute-default.d.ts +31 -0
  777. package/dist/types/utils/scroll.d.ts +21 -0
  778. package/dist/types/utils/tabbable.d.ts +2 -0
  779. package/dist/types/utils/test/axe.d.ts +81 -0
  780. package/dist/types/utils/test/host-strip.d.ts +10 -0
  781. package/dist/types/utils/test/reconnect-safety.d.ts +11 -0
  782. package/dist/types/utils/test/reduced-motion.d.ts +30 -0
  783. package/dist/types/utils/truncation-tooltip.d.ts +88 -0
  784. package/dist/types/utils/types.d.ts +13 -2
  785. package/dist/types/utils/utils.d.ts +37 -2
  786. package/dist/vscode.html-data.json +11913 -0
  787. package/hydrate/index.d.ts +58 -7
  788. package/hydrate/index.js +29932 -3726
  789. package/hydrate/index.mjs +29929 -3725
  790. package/package.json +52 -26
  791. package/readme.md +26 -55
  792. package/components/closest.js.map +0 -1
  793. package/components/index.js.map +0 -1
  794. package/components/index2.js.map +0 -1
  795. package/components/pds-accordion.js.map +0 -1
  796. package/components/pds-avatar.js.map +0 -1
  797. package/components/pds-box.js.map +0 -1
  798. package/components/pds-button.js.map +0 -1
  799. package/components/pds-button2.js.map +0 -1
  800. package/components/pds-checkbox.js.map +0 -1
  801. package/components/pds-checkbox2.js.map +0 -1
  802. package/components/pds-chip.js.map +0 -1
  803. package/components/pds-copytext.js.map +0 -1
  804. package/components/pds-divider.js.map +0 -1
  805. package/components/pds-icon.js.map +0 -1
  806. package/components/pds-icon2.js.map +0 -1
  807. package/components/pds-image.js.map +0 -1
  808. package/components/pds-input.js.map +0 -1
  809. package/components/pds-label.js +0 -39
  810. package/components/pds-label.js.map +0 -1
  811. package/components/pds-link.js.map +0 -1
  812. package/components/pds-loader.js.map +0 -1
  813. package/components/pds-progress.js.map +0 -1
  814. package/components/pds-radio.js.map +0 -1
  815. package/components/pds-row.js.map +0 -1
  816. package/components/pds-sortable-item.js.map +0 -1
  817. package/components/pds-sortable.js.map +0 -1
  818. package/components/pds-switch.js.map +0 -1
  819. package/components/pds-tab.js.map +0 -1
  820. package/components/pds-table-body.js.map +0 -1
  821. package/components/pds-table-cell.js.map +0 -1
  822. package/components/pds-table-cell2.js.map +0 -1
  823. package/components/pds-table-head-cell.js.map +0 -1
  824. package/components/pds-table-head-cell2.js.map +0 -1
  825. package/components/pds-table-head.js.map +0 -1
  826. package/components/pds-table-row.js.map +0 -1
  827. package/components/pds-table.js.map +0 -1
  828. package/components/pds-tabpanel.js.map +0 -1
  829. package/components/pds-tabs.js.map +0 -1
  830. package/components/pds-textarea.js.map +0 -1
  831. package/components/pds-tooltip.js.map +0 -1
  832. package/dist/cjs/app-globals-3a1e7e63.js +0 -7
  833. package/dist/cjs/app-globals-3a1e7e63.js.map +0 -1
  834. package/dist/cjs/closest-b45138d3.js +0 -13
  835. package/dist/cjs/closest-b45138d3.js.map +0 -1
  836. package/dist/cjs/index-46fb0736.js +0 -1956
  837. package/dist/cjs/index-46fb0736.js.map +0 -1
  838. package/dist/cjs/index-de3f0730.js +0 -24
  839. package/dist/cjs/index-de3f0730.js.map +0 -1
  840. package/dist/cjs/index.cjs.js.map +0 -1
  841. package/dist/cjs/loader.cjs.js.map +0 -1
  842. package/dist/cjs/pds-accordion.cjs.entry.js.map +0 -1
  843. package/dist/cjs/pds-avatar.cjs.entry.js.map +0 -1
  844. package/dist/cjs/pds-box.cjs.entry.js.map +0 -1
  845. package/dist/cjs/pds-button.cjs.entry.js.map +0 -1
  846. package/dist/cjs/pds-checkbox.cjs.entry.js.map +0 -1
  847. package/dist/cjs/pds-chip.cjs.entry.js.map +0 -1
  848. package/dist/cjs/pds-copytext.cjs.entry.js.map +0 -1
  849. package/dist/cjs/pds-divider.cjs.entry.js.map +0 -1
  850. package/dist/cjs/pds-icon.cjs.entry.js.map +0 -1
  851. package/dist/cjs/pds-image.cjs.entry.js.map +0 -1
  852. package/dist/cjs/pds-input.cjs.entry.js.map +0 -1
  853. package/dist/cjs/pds-label-7aabdc4e.js +0 -44
  854. package/dist/cjs/pds-label-7aabdc4e.js.map +0 -1
  855. package/dist/cjs/pds-link.cjs.entry.js.map +0 -1
  856. package/dist/cjs/pds-loader.cjs.entry.js.map +0 -1
  857. package/dist/cjs/pds-progress.cjs.entry.js.map +0 -1
  858. package/dist/cjs/pds-radio.cjs.entry.js.map +0 -1
  859. package/dist/cjs/pds-row.cjs.entry.js.map +0 -1
  860. package/dist/cjs/pds-sortable-item.cjs.entry.js.map +0 -1
  861. package/dist/cjs/pds-sortable.cjs.entry.js.map +0 -1
  862. package/dist/cjs/pds-switch.cjs.entry.js.map +0 -1
  863. package/dist/cjs/pds-tab.cjs.entry.js.map +0 -1
  864. package/dist/cjs/pds-table-body.cjs.entry.js.map +0 -1
  865. package/dist/cjs/pds-table-cell.cjs.entry.js.map +0 -1
  866. package/dist/cjs/pds-table-head-cell.cjs.entry.js.map +0 -1
  867. package/dist/cjs/pds-table-head.cjs.entry.js.map +0 -1
  868. package/dist/cjs/pds-table-row.cjs.entry.js.map +0 -1
  869. package/dist/cjs/pds-table.cjs.entry.js.map +0 -1
  870. package/dist/cjs/pds-tabpanel.cjs.entry.js.map +0 -1
  871. package/dist/cjs/pds-tabs.cjs.entry.js.map +0 -1
  872. package/dist/cjs/pds-textarea.cjs.entry.js.map +0 -1
  873. package/dist/cjs/pds-tooltip.cjs.entry.js.map +0 -1
  874. package/dist/cjs/pine-core.cjs.js.map +0 -1
  875. package/dist/collection/components/_internal/pds-label/pds-label.js.map +0 -1
  876. package/dist/collection/components/pds-accordion/pds-accordion.js.map +0 -1
  877. package/dist/collection/components/pds-avatar/pds-avatar.js.map +0 -1
  878. package/dist/collection/components/pds-box/pds-box.js.map +0 -1
  879. package/dist/collection/components/pds-button/pds-button.js.map +0 -1
  880. package/dist/collection/components/pds-checkbox/checkbox-interface.js.map +0 -1
  881. package/dist/collection/components/pds-checkbox/pds-checkbox.js.map +0 -1
  882. package/dist/collection/components/pds-chip/pds-chip.js.map +0 -1
  883. package/dist/collection/components/pds-copytext/pds-copytext.js.map +0 -1
  884. package/dist/collection/components/pds-divider/pds-divider.js.map +0 -1
  885. package/dist/collection/components/pds-image/pds-image.js.map +0 -1
  886. package/dist/collection/components/pds-input/pds-input.js.map +0 -1
  887. package/dist/collection/components/pds-link/pds-link.js.map +0 -1
  888. package/dist/collection/components/pds-loader/pds-loader.js.map +0 -1
  889. package/dist/collection/components/pds-progress/pds-progress.js.map +0 -1
  890. package/dist/collection/components/pds-radio/pds-radio.js.map +0 -1
  891. package/dist/collection/components/pds-row/pds-row.js.map +0 -1
  892. package/dist/collection/components/pds-sortable/pds-sortable-item/pds-sortable-item.js.map +0 -1
  893. package/dist/collection/components/pds-sortable/pds-sortable.js.map +0 -1
  894. package/dist/collection/components/pds-sortable/sortable-interface.js.map +0 -1
  895. package/dist/collection/components/pds-switch/pds-switch.js.map +0 -1
  896. package/dist/collection/components/pds-table/pds-table-body/pds-table-body.js.map +0 -1
  897. package/dist/collection/components/pds-table/pds-table-cell/pds-table-cell.js.map +0 -1
  898. package/dist/collection/components/pds-table/pds-table-head/pds-table-head.js.map +0 -1
  899. package/dist/collection/components/pds-table/pds-table-head-cell/pds-table-head-cell.js.map +0 -1
  900. package/dist/collection/components/pds-table/pds-table-row/pds-table-row.js.map +0 -1
  901. package/dist/collection/components/pds-table/pds-table.js.map +0 -1
  902. package/dist/collection/components/pds-tabs/pds-tab/pds-tab.js.map +0 -1
  903. package/dist/collection/components/pds-tabs/pds-tabpanel/pds-tabpanel.js.map +0 -1
  904. package/dist/collection/components/pds-tabs/pds-tabs.js.map +0 -1
  905. package/dist/collection/components/pds-textarea/pds-textarea.js.map +0 -1
  906. package/dist/collection/components/pds-textarea/textarea-interface.js.map +0 -1
  907. package/dist/collection/components/pds-tooltip/pds-tooltip.js.map +0 -1
  908. package/dist/collection/global/pine-ui-global.js.map +0 -1
  909. package/dist/collection/index.js.map +0 -1
  910. package/dist/collection/stories/_helpers/index.js +0 -15
  911. package/dist/collection/stories/_helpers/index.js.map +0 -1
  912. package/dist/collection/utils/closest.js.map +0 -1
  913. package/dist/collection/utils/form.js.map +0 -1
  914. package/dist/collection/utils/overlay.js.map +0 -1
  915. package/dist/collection/utils/types.js.map +0 -1
  916. package/dist/collection/utils/utils.js.map +0 -1
  917. package/dist/esm/app-globals-0f993ce5.js +0 -5
  918. package/dist/esm/app-globals-0f993ce5.js.map +0 -1
  919. package/dist/esm/closest-d2d192be.js +0 -11
  920. package/dist/esm/closest-d2d192be.js.map +0 -1
  921. package/dist/esm/index-2a33b470.js +0 -1927
  922. package/dist/esm/index-2a33b470.js.map +0 -1
  923. package/dist/esm/index-a1e2f9af.js +0 -14
  924. package/dist/esm/index-a1e2f9af.js.map +0 -1
  925. package/dist/esm/index.js.map +0 -1
  926. package/dist/esm/loader.js.map +0 -1
  927. package/dist/esm/pds-accordion.entry.js.map +0 -1
  928. package/dist/esm/pds-avatar.entry.js.map +0 -1
  929. package/dist/esm/pds-box.entry.js.map +0 -1
  930. package/dist/esm/pds-button.entry.js.map +0 -1
  931. package/dist/esm/pds-checkbox.entry.js.map +0 -1
  932. package/dist/esm/pds-chip.entry.js.map +0 -1
  933. package/dist/esm/pds-copytext.entry.js.map +0 -1
  934. package/dist/esm/pds-divider.entry.js.map +0 -1
  935. package/dist/esm/pds-icon.entry.js.map +0 -1
  936. package/dist/esm/pds-image.entry.js.map +0 -1
  937. package/dist/esm/pds-input.entry.js.map +0 -1
  938. package/dist/esm/pds-label-31a5848b.js +0 -39
  939. package/dist/esm/pds-label-31a5848b.js.map +0 -1
  940. package/dist/esm/pds-link.entry.js.map +0 -1
  941. package/dist/esm/pds-loader.entry.js.map +0 -1
  942. package/dist/esm/pds-progress.entry.js.map +0 -1
  943. package/dist/esm/pds-radio.entry.js.map +0 -1
  944. package/dist/esm/pds-row.entry.js.map +0 -1
  945. package/dist/esm/pds-sortable-item.entry.js.map +0 -1
  946. package/dist/esm/pds-sortable.entry.js.map +0 -1
  947. package/dist/esm/pds-switch.entry.js.map +0 -1
  948. package/dist/esm/pds-tab.entry.js.map +0 -1
  949. package/dist/esm/pds-table-body.entry.js.map +0 -1
  950. package/dist/esm/pds-table-cell.entry.js.map +0 -1
  951. package/dist/esm/pds-table-head-cell.entry.js.map +0 -1
  952. package/dist/esm/pds-table-head.entry.js.map +0 -1
  953. package/dist/esm/pds-table-row.entry.js.map +0 -1
  954. package/dist/esm/pds-table.entry.js.map +0 -1
  955. package/dist/esm/pds-tabpanel.entry.js.map +0 -1
  956. package/dist/esm/pds-tabs.entry.js.map +0 -1
  957. package/dist/esm/pds-textarea.entry.js.map +0 -1
  958. package/dist/esm/pds-tooltip.entry.js.map +0 -1
  959. package/dist/esm/pine-core.js.map +0 -1
  960. package/dist/esm-es5/app-globals-0f993ce5.js +0 -2
  961. package/dist/esm-es5/app-globals-0f993ce5.js.map +0 -1
  962. package/dist/esm-es5/closest-d2d192be.js +0 -2
  963. package/dist/esm-es5/closest-d2d192be.js.map +0 -1
  964. package/dist/esm-es5/index-2a33b470.js +0 -3
  965. package/dist/esm-es5/index-2a33b470.js.map +0 -1
  966. package/dist/esm-es5/index-a1e2f9af.js +0 -2
  967. package/dist/esm-es5/index-a1e2f9af.js.map +0 -1
  968. package/dist/esm-es5/index.js.map +0 -1
  969. package/dist/esm-es5/loader.js.map +0 -1
  970. package/dist/esm-es5/pds-accordion.entry.js.map +0 -1
  971. package/dist/esm-es5/pds-avatar.entry.js.map +0 -1
  972. package/dist/esm-es5/pds-box.entry.js.map +0 -1
  973. package/dist/esm-es5/pds-button.entry.js.map +0 -1
  974. package/dist/esm-es5/pds-checkbox.entry.js.map +0 -1
  975. package/dist/esm-es5/pds-chip.entry.js.map +0 -1
  976. package/dist/esm-es5/pds-copytext.entry.js.map +0 -1
  977. package/dist/esm-es5/pds-divider.entry.js.map +0 -1
  978. package/dist/esm-es5/pds-icon.entry.js.map +0 -1
  979. package/dist/esm-es5/pds-image.entry.js.map +0 -1
  980. package/dist/esm-es5/pds-input.entry.js.map +0 -1
  981. package/dist/esm-es5/pds-label-31a5848b.js +0 -2
  982. package/dist/esm-es5/pds-label-31a5848b.js.map +0 -1
  983. package/dist/esm-es5/pds-link.entry.js.map +0 -1
  984. package/dist/esm-es5/pds-loader.entry.js.map +0 -1
  985. package/dist/esm-es5/pds-progress.entry.js.map +0 -1
  986. package/dist/esm-es5/pds-radio.entry.js.map +0 -1
  987. package/dist/esm-es5/pds-row.entry.js.map +0 -1
  988. package/dist/esm-es5/pds-sortable-item.entry.js.map +0 -1
  989. package/dist/esm-es5/pds-sortable.entry.js.map +0 -1
  990. package/dist/esm-es5/pds-switch.entry.js.map +0 -1
  991. package/dist/esm-es5/pds-tab.entry.js.map +0 -1
  992. package/dist/esm-es5/pds-table-body.entry.js.map +0 -1
  993. package/dist/esm-es5/pds-table-cell.entry.js.map +0 -1
  994. package/dist/esm-es5/pds-table-head-cell.entry.js.map +0 -1
  995. package/dist/esm-es5/pds-table-head.entry.js.map +0 -1
  996. package/dist/esm-es5/pds-table-row.entry.js.map +0 -1
  997. package/dist/esm-es5/pds-table.entry.js.map +0 -1
  998. package/dist/esm-es5/pds-tabpanel.entry.js.map +0 -1
  999. package/dist/esm-es5/pds-tabs.entry.js.map +0 -1
  1000. package/dist/esm-es5/pds-textarea.entry.js.map +0 -1
  1001. package/dist/esm-es5/pds-tooltip.entry.js.map +0 -1
  1002. package/dist/esm-es5/pine-core.js.map +0 -1
  1003. package/dist/pine-core/index.esm.js.map +0 -1
  1004. package/dist/pine-core/p-06c33261.system.entry.js +0 -2
  1005. package/dist/pine-core/p-06c33261.system.entry.js.map +0 -1
  1006. package/dist/pine-core/p-07f80cb6.entry.js +0 -2
  1007. package/dist/pine-core/p-07f80cb6.entry.js.map +0 -1
  1008. package/dist/pine-core/p-09b1c7f1.system.entry.js +0 -2
  1009. package/dist/pine-core/p-09b1c7f1.system.entry.js.map +0 -1
  1010. package/dist/pine-core/p-0a4b1ce9.system.entry.js +0 -2
  1011. package/dist/pine-core/p-0a4b1ce9.system.entry.js.map +0 -1
  1012. package/dist/pine-core/p-0b541f88.js +0 -3
  1013. package/dist/pine-core/p-0b541f88.js.map +0 -1
  1014. package/dist/pine-core/p-0b77685e.js +0 -2
  1015. package/dist/pine-core/p-0b77685e.js.map +0 -1
  1016. package/dist/pine-core/p-0d6fafef.system.entry.js +0 -2
  1017. package/dist/pine-core/p-0d6fafef.system.entry.js.map +0 -1
  1018. package/dist/pine-core/p-0e1c0d03.entry.js +0 -8
  1019. package/dist/pine-core/p-0e1c0d03.entry.js.map +0 -1
  1020. package/dist/pine-core/p-0e936138.entry.js +0 -2
  1021. package/dist/pine-core/p-0e936138.entry.js.map +0 -1
  1022. package/dist/pine-core/p-143795e5.system.entry.js +0 -2
  1023. package/dist/pine-core/p-143795e5.system.entry.js.map +0 -1
  1024. package/dist/pine-core/p-1f2b0be3.system.entry.js +0 -2
  1025. package/dist/pine-core/p-1f2b0be3.system.entry.js.map +0 -1
  1026. package/dist/pine-core/p-224a435b.system.js +0 -2
  1027. package/dist/pine-core/p-224a435b.system.js.map +0 -1
  1028. package/dist/pine-core/p-31056348.system.entry.js +0 -2
  1029. package/dist/pine-core/p-31056348.system.entry.js.map +0 -1
  1030. package/dist/pine-core/p-32498622.system.entry.js +0 -2
  1031. package/dist/pine-core/p-32498622.system.entry.js.map +0 -1
  1032. package/dist/pine-core/p-3261fdf5.system.entry.js +0 -2
  1033. package/dist/pine-core/p-3261fdf5.system.entry.js.map +0 -1
  1034. package/dist/pine-core/p-32e41e3d.system.entry.js +0 -2
  1035. package/dist/pine-core/p-32e41e3d.system.entry.js.map +0 -1
  1036. package/dist/pine-core/p-34631565.system.js +0 -2
  1037. package/dist/pine-core/p-34631565.system.js.map +0 -1
  1038. package/dist/pine-core/p-3ba3d44c.entry.js +0 -2
  1039. package/dist/pine-core/p-3ba3d44c.entry.js.map +0 -1
  1040. package/dist/pine-core/p-46161cec.entry.js +0 -2
  1041. package/dist/pine-core/p-46161cec.entry.js.map +0 -1
  1042. package/dist/pine-core/p-4f69a7b7.entry.js +0 -2
  1043. package/dist/pine-core/p-4f69a7b7.entry.js.map +0 -1
  1044. package/dist/pine-core/p-50a23474.entry.js +0 -2
  1045. package/dist/pine-core/p-50a23474.entry.js.map +0 -1
  1046. package/dist/pine-core/p-511bf308.entry.js +0 -2
  1047. package/dist/pine-core/p-511bf308.entry.js.map +0 -1
  1048. package/dist/pine-core/p-52515d64.system.entry.js +0 -2
  1049. package/dist/pine-core/p-52515d64.system.entry.js.map +0 -1
  1050. package/dist/pine-core/p-56ba5cbf.system.js +0 -2
  1051. package/dist/pine-core/p-56ba5cbf.system.js.map +0 -1
  1052. package/dist/pine-core/p-5a384517.entry.js +0 -2
  1053. package/dist/pine-core/p-5a384517.entry.js.map +0 -1
  1054. package/dist/pine-core/p-5bee6677.system.entry.js +0 -2
  1055. package/dist/pine-core/p-5bee6677.system.entry.js.map +0 -1
  1056. package/dist/pine-core/p-5df76e04.system.js +0 -2
  1057. package/dist/pine-core/p-5df76e04.system.js.map +0 -1
  1058. package/dist/pine-core/p-62ec9a0f.system.entry.js +0 -2
  1059. package/dist/pine-core/p-62ec9a0f.system.entry.js.map +0 -1
  1060. package/dist/pine-core/p-6a7a864f.entry.js +0 -2
  1061. package/dist/pine-core/p-6a7a864f.entry.js.map +0 -1
  1062. package/dist/pine-core/p-6ae2f0f5.entry.js +0 -2
  1063. package/dist/pine-core/p-6ae2f0f5.entry.js.map +0 -1
  1064. package/dist/pine-core/p-6e146962.entry.js +0 -2
  1065. package/dist/pine-core/p-6e146962.entry.js.map +0 -1
  1066. package/dist/pine-core/p-6ff9ebfa.entry.js +0 -2
  1067. package/dist/pine-core/p-6ff9ebfa.entry.js.map +0 -1
  1068. package/dist/pine-core/p-701ba882.entry.js +0 -2
  1069. package/dist/pine-core/p-701ba882.entry.js.map +0 -1
  1070. package/dist/pine-core/p-73eb1722.entry.js +0 -2
  1071. package/dist/pine-core/p-73eb1722.entry.js.map +0 -1
  1072. package/dist/pine-core/p-78c6c37a.system.entry.js +0 -2
  1073. package/dist/pine-core/p-78c6c37a.system.entry.js.map +0 -1
  1074. package/dist/pine-core/p-79ca4ab9.system.entry.js +0 -2
  1075. package/dist/pine-core/p-79ca4ab9.system.entry.js.map +0 -1
  1076. package/dist/pine-core/p-7c33a02e.entry.js +0 -2
  1077. package/dist/pine-core/p-7c33a02e.entry.js.map +0 -1
  1078. package/dist/pine-core/p-7dac515e.system.entry.js +0 -2
  1079. package/dist/pine-core/p-7dac515e.system.entry.js.map +0 -1
  1080. package/dist/pine-core/p-7ea6838b.system.entry.js +0 -2
  1081. package/dist/pine-core/p-7ea6838b.system.entry.js.map +0 -1
  1082. package/dist/pine-core/p-7ebfdef4.system.entry.js +0 -2
  1083. package/dist/pine-core/p-7ebfdef4.system.entry.js.map +0 -1
  1084. package/dist/pine-core/p-829777e4.system.entry.js +0 -2
  1085. package/dist/pine-core/p-829777e4.system.entry.js.map +0 -1
  1086. package/dist/pine-core/p-8317c6c2.js +0 -2
  1087. package/dist/pine-core/p-8317c6c2.js.map +0 -1
  1088. package/dist/pine-core/p-8469b65a.entry.js +0 -2
  1089. package/dist/pine-core/p-8469b65a.entry.js.map +0 -1
  1090. package/dist/pine-core/p-8d8de5fd.entry.js +0 -2
  1091. package/dist/pine-core/p-8d8de5fd.entry.js.map +0 -1
  1092. package/dist/pine-core/p-8df8debd.entry.js +0 -2
  1093. package/dist/pine-core/p-8df8debd.entry.js.map +0 -1
  1094. package/dist/pine-core/p-8f73bf14.system.entry.js +0 -2
  1095. package/dist/pine-core/p-8f73bf14.system.entry.js.map +0 -1
  1096. package/dist/pine-core/p-8fbec4fe.system.js +0 -2
  1097. package/dist/pine-core/p-8fbec4fe.system.js.map +0 -1
  1098. package/dist/pine-core/p-909b305c.system.entry.js +0 -2
  1099. package/dist/pine-core/p-909b305c.system.entry.js.map +0 -1
  1100. package/dist/pine-core/p-936d96ec.system.entry.js +0 -9
  1101. package/dist/pine-core/p-936d96ec.system.entry.js.map +0 -1
  1102. package/dist/pine-core/p-9583e6d5.entry.js +0 -2
  1103. package/dist/pine-core/p-9583e6d5.entry.js.map +0 -1
  1104. package/dist/pine-core/p-96c750d1.entry.js +0 -2
  1105. package/dist/pine-core/p-96c750d1.entry.js.map +0 -1
  1106. package/dist/pine-core/p-a03e587c.entry.js +0 -2
  1107. package/dist/pine-core/p-a03e587c.entry.js.map +0 -1
  1108. package/dist/pine-core/p-a79a8159.entry.js +0 -2
  1109. package/dist/pine-core/p-a79a8159.entry.js.map +0 -1
  1110. package/dist/pine-core/p-a962fe8e.entry.js +0 -2
  1111. package/dist/pine-core/p-a962fe8e.entry.js.map +0 -1
  1112. package/dist/pine-core/p-ac228abf.entry.js +0 -2
  1113. package/dist/pine-core/p-ac228abf.entry.js.map +0 -1
  1114. package/dist/pine-core/p-ad4238c9.system.entry.js +0 -2
  1115. package/dist/pine-core/p-ad4238c9.system.entry.js.map +0 -1
  1116. package/dist/pine-core/p-af7df3c2.system.entry.js +0 -2
  1117. package/dist/pine-core/p-af7df3c2.system.entry.js.map +0 -1
  1118. package/dist/pine-core/p-b18b20f4.system.js +0 -2
  1119. package/dist/pine-core/p-b18b20f4.system.js.map +0 -1
  1120. package/dist/pine-core/p-b4518566.entry.js +0 -2
  1121. package/dist/pine-core/p-b4518566.entry.js.map +0 -1
  1122. package/dist/pine-core/p-b5c7e02a.entry.js +0 -2
  1123. package/dist/pine-core/p-b5c7e02a.entry.js.map +0 -1
  1124. package/dist/pine-core/p-bc20946b.system.entry.js +0 -2
  1125. package/dist/pine-core/p-bc20946b.system.entry.js.map +0 -1
  1126. package/dist/pine-core/p-c52d0465.system.entry.js +0 -2
  1127. package/dist/pine-core/p-c52d0465.system.entry.js.map +0 -1
  1128. package/dist/pine-core/p-c84cc2f8.system.entry.js +0 -2
  1129. package/dist/pine-core/p-c84cc2f8.system.entry.js.map +0 -1
  1130. package/dist/pine-core/p-ca239d59.system.entry.js +0 -2
  1131. package/dist/pine-core/p-ca239d59.system.entry.js.map +0 -1
  1132. package/dist/pine-core/p-cfacf2e0.system.entry.js +0 -2
  1133. package/dist/pine-core/p-cfacf2e0.system.entry.js.map +0 -1
  1134. package/dist/pine-core/p-e1255160.js +0 -2
  1135. package/dist/pine-core/p-e1255160.js.map +0 -1
  1136. package/dist/pine-core/p-e4b3115c.entry.js +0 -2
  1137. package/dist/pine-core/p-e4b3115c.entry.js.map +0 -1
  1138. package/dist/pine-core/p-e60fccc0.js +0 -2
  1139. package/dist/pine-core/p-e60fccc0.js.map +0 -1
  1140. package/dist/pine-core/p-eb56f262.system.entry.js +0 -2
  1141. package/dist/pine-core/p-eb56f262.system.entry.js.map +0 -1
  1142. package/dist/pine-core/p-ec484bf6.entry.js +0 -2
  1143. package/dist/pine-core/p-ec484bf6.entry.js.map +0 -1
  1144. package/dist/pine-core/p-f59d4a46.entry.js +0 -2
  1145. package/dist/pine-core/p-f59d4a46.entry.js.map +0 -1
  1146. package/dist/pine-core/p-f74c489d.system.js +0 -3
  1147. package/dist/pine-core/p-f74c489d.system.js.map +0 -1
  1148. package/dist/pine-core/pine-core.esm.js.map +0 -1
  1149. package/dist/pine-core/svg/access-key.svg +0 -1
  1150. package/dist/pine-core/svg/add-circle.svg +0 -1
  1151. package/dist/pine-core/svg/add-image.svg +0 -1
  1152. package/dist/pine-core/svg/add-small.svg +0 -1
  1153. package/dist/pine-core/svg/add-square.svg +0 -1
  1154. package/dist/pine-core/svg/add.svg +0 -1
  1155. package/dist/pine-core/svg/advanced.svg +0 -1
  1156. package/dist/pine-core/svg/ai-sparkle.svg +0 -1
  1157. package/dist/pine-core/svg/ai-writer-filled.svg +0 -1
  1158. package/dist/pine-core/svg/ai-writer.svg +0 -1
  1159. package/dist/pine-core/svg/align-center.svg +0 -1
  1160. package/dist/pine-core/svg/align-justify.svg +0 -1
  1161. package/dist/pine-core/svg/align-left.svg +0 -1
  1162. package/dist/pine-core/svg/align-right.svg +0 -1
  1163. package/dist/pine-core/svg/app-store.svg +0 -1
  1164. package/dist/pine-core/svg/archive.svg +0 -1
  1165. package/dist/pine-core/svg/arrow-corner.svg +0 -1
  1166. package/dist/pine-core/svg/arrow-down.svg +0 -1
  1167. package/dist/pine-core/svg/arrow-left.svg +0 -1
  1168. package/dist/pine-core/svg/arrow-right.svg +0 -1
  1169. package/dist/pine-core/svg/arrow-up.svg +0 -1
  1170. package/dist/pine-core/svg/assessment.svg +0 -1
  1171. package/dist/pine-core/svg/at-sign.svg +0 -1
  1172. package/dist/pine-core/svg/attach.svg +0 -1
  1173. package/dist/pine-core/svg/automations.svg +0 -1
  1174. package/dist/pine-core/svg/ban.svg +0 -1
  1175. package/dist/pine-core/svg/bank.svg +0 -1
  1176. package/dist/pine-core/svg/bar-chart-10-tone.svg +0 -1
  1177. package/dist/pine-core/svg/bell-01-tone.svg +0 -1
  1178. package/dist/pine-core/svg/bell.svg +0 -1
  1179. package/dist/pine-core/svg/block.svg +0 -1
  1180. package/dist/pine-core/svg/blog-filled.svg +0 -1
  1181. package/dist/pine-core/svg/blog.svg +0 -1
  1182. package/dist/pine-core/svg/bold.svg +0 -1
  1183. package/dist/pine-core/svg/broadcast.svg +0 -1
  1184. package/dist/pine-core/svg/bulb.svg +0 -1
  1185. package/dist/pine-core/svg/button.svg +0 -1
  1186. package/dist/pine-core/svg/calendar-date.svg +0 -1
  1187. package/dist/pine-core/svg/calendar-schedule.svg +0 -1
  1188. package/dist/pine-core/svg/calendar-simple.svg +0 -1
  1189. package/dist/pine-core/svg/card-amex.svg +0 -1
  1190. package/dist/pine-core/svg/card-android.svg +0 -1
  1191. package/dist/pine-core/svg/card-apple.svg +0 -1
  1192. package/dist/pine-core/svg/card-diners-club.svg +0 -1
  1193. package/dist/pine-core/svg/card-discover.svg +0 -1
  1194. package/dist/pine-core/svg/card-generic.svg +0 -1
  1195. package/dist/pine-core/svg/card-gpay.svg +0 -1
  1196. package/dist/pine-core/svg/card-mastercard.svg +0 -1
  1197. package/dist/pine-core/svg/card-paypal.svg +0 -1
  1198. package/dist/pine-core/svg/card-stripe.svg +0 -1
  1199. package/dist/pine-core/svg/card-update.svg +0 -1
  1200. package/dist/pine-core/svg/card-visa.svg +0 -1
  1201. package/dist/pine-core/svg/caret-down.svg +0 -1
  1202. package/dist/pine-core/svg/caret-left.svg +0 -1
  1203. package/dist/pine-core/svg/caret-right.svg +0 -1
  1204. package/dist/pine-core/svg/caret-up.svg +0 -1
  1205. package/dist/pine-core/svg/cart-add.svg +0 -1
  1206. package/dist/pine-core/svg/cart.svg +0 -1
  1207. package/dist/pine-core/svg/certificate.svg +0 -1
  1208. package/dist/pine-core/svg/chart-filled.svg +0 -1
  1209. package/dist/pine-core/svg/chart.svg +0 -1
  1210. package/dist/pine-core/svg/check-circle-filled.svg +0 -1
  1211. package/dist/pine-core/svg/check-circle.svg +0 -1
  1212. package/dist/pine-core/svg/check.svg +0 -1
  1213. package/dist/pine-core/svg/circle-1.svg +0 -1
  1214. package/dist/pine-core/svg/circle-2.svg +0 -1
  1215. package/dist/pine-core/svg/circle-3.svg +0 -1
  1216. package/dist/pine-core/svg/circle-4.svg +0 -1
  1217. package/dist/pine-core/svg/circle-5.svg +0 -1
  1218. package/dist/pine-core/svg/circle-6.svg +0 -1
  1219. package/dist/pine-core/svg/circle-7.svg +0 -1
  1220. package/dist/pine-core/svg/circle-8.svg +0 -1
  1221. package/dist/pine-core/svg/circle-9.svg +0 -1
  1222. package/dist/pine-core/svg/circle-a.svg +0 -1
  1223. package/dist/pine-core/svg/circle-b.svg +0 -1
  1224. package/dist/pine-core/svg/circle-dashed.svg +0 -1
  1225. package/dist/pine-core/svg/clapperboard-tone.svg +0 -1
  1226. package/dist/pine-core/svg/clock.svg +0 -1
  1227. package/dist/pine-core/svg/closed-captions.svg +0 -1
  1228. package/dist/pine-core/svg/cloud-upload.svg +0 -1
  1229. package/dist/pine-core/svg/code-block.svg +0 -1
  1230. package/dist/pine-core/svg/code.svg +0 -1
  1231. package/dist/pine-core/svg/color.svg +0 -1
  1232. package/dist/pine-core/svg/columns.svg +0 -1
  1233. package/dist/pine-core/svg/comment-no.svg +0 -1
  1234. package/dist/pine-core/svg/comment.svg +0 -1
  1235. package/dist/pine-core/svg/connect.svg +0 -1
  1236. package/dist/pine-core/svg/contact.svg +0 -1
  1237. package/dist/pine-core/svg/conversation.svg +0 -1
  1238. package/dist/pine-core/svg/copy.svg +0 -1
  1239. package/dist/pine-core/svg/coupon.svg +0 -1
  1240. package/dist/pine-core/svg/course-filled.svg +0 -1
  1241. package/dist/pine-core/svg/course.svg +0 -1
  1242. package/dist/pine-core/svg/creator-studio-filled.svg +0 -1
  1243. package/dist/pine-core/svg/creator-studio.svg +0 -1
  1244. package/dist/pine-core/svg/credit-card-02-tone.svg +0 -1
  1245. package/dist/pine-core/svg/cube-01-tone.svg +0 -1
  1246. package/dist/pine-core/svg/cursor-pointer.svg +0 -1
  1247. package/dist/pine-core/svg/cursor.svg +0 -1
  1248. package/dist/pine-core/svg/custom-field.svg +0 -1
  1249. package/dist/pine-core/svg/customize.svg +0 -1
  1250. package/dist/pine-core/svg/danger-filled.svg +0 -1
  1251. package/dist/pine-core/svg/danger.svg +0 -1
  1252. package/dist/pine-core/svg/delete-circle.svg +0 -1
  1253. package/dist/pine-core/svg/delete-key.svg +0 -1
  1254. package/dist/pine-core/svg/delete-x.svg +0 -1
  1255. package/dist/pine-core/svg/dollar.svg +0 -1
  1256. package/dist/pine-core/svg/dot-menu-horizontal.svg +0 -1
  1257. package/dist/pine-core/svg/dots-horizontal-tone.svg +0 -1
  1258. package/dist/pine-core/svg/down-small.svg +0 -1
  1259. package/dist/pine-core/svg/download.svg +0 -1
  1260. package/dist/pine-core/svg/downsell.svg +0 -1
  1261. package/dist/pine-core/svg/draft.svg +0 -1
  1262. package/dist/pine-core/svg/drawer-collapse.svg +0 -1
  1263. package/dist/pine-core/svg/drawer-expand.svg +0 -1
  1264. package/dist/pine-core/svg/drop.svg +0 -1
  1265. package/dist/pine-core/svg/duplicate.svg +0 -1
  1266. package/dist/pine-core/svg/editor-filled.svg +0 -1
  1267. package/dist/pine-core/svg/editor.svg +0 -1
  1268. package/dist/pine-core/svg/email-activity.svg +0 -1
  1269. package/dist/pine-core/svg/emoji.svg +0 -1
  1270. package/dist/pine-core/svg/enlarge-vertical.svg +0 -1
  1271. package/dist/pine-core/svg/enlarge.svg +0 -1
  1272. package/dist/pine-core/svg/expand.svg +0 -1
  1273. package/dist/pine-core/svg/favorite.svg +0 -1
  1274. package/dist/pine-core/svg/feedback.svg +0 -1
  1275. package/dist/pine-core/svg/file-02.svg +0 -1
  1276. package/dist/pine-core/svg/file-money.svg +0 -1
  1277. package/dist/pine-core/svg/file.svg +0 -1
  1278. package/dist/pine-core/svg/filter.svg +0 -1
  1279. package/dist/pine-core/svg/flag.svg +0 -1
  1280. package/dist/pine-core/svg/flash-filled.svg +0 -1
  1281. package/dist/pine-core/svg/flash.svg +0 -1
  1282. package/dist/pine-core/svg/floppy-disk.svg +0 -1
  1283. package/dist/pine-core/svg/folder-group.svg +0 -1
  1284. package/dist/pine-core/svg/folder.svg +0 -1
  1285. package/dist/pine-core/svg/form-field.svg +0 -1
  1286. package/dist/pine-core/svg/form-filled.svg +0 -1
  1287. package/dist/pine-core/svg/form.svg +0 -1
  1288. package/dist/pine-core/svg/fullscreen.svg +0 -1
  1289. package/dist/pine-core/svg/funnel.svg +0 -1
  1290. package/dist/pine-core/svg/gear-filled.svg +0 -1
  1291. package/dist/pine-core/svg/gear.svg +0 -1
  1292. package/dist/pine-core/svg/grant-offer.svg +0 -1
  1293. package/dist/pine-core/svg/handle-2-vertical.svg +0 -1
  1294. package/dist/pine-core/svg/handle-2.svg +0 -1
  1295. package/dist/pine-core/svg/handle.svg +0 -1
  1296. package/dist/pine-core/svg/hashtag.svg +0 -1
  1297. package/dist/pine-core/svg/hd-video.svg +0 -1
  1298. package/dist/pine-core/svg/heading-1.svg +0 -1
  1299. package/dist/pine-core/svg/heading-2.svg +0 -1
  1300. package/dist/pine-core/svg/heading-3.svg +0 -1
  1301. package/dist/pine-core/svg/heading-4.svg +0 -1
  1302. package/dist/pine-core/svg/heading-5.svg +0 -1
  1303. package/dist/pine-core/svg/heading-6.svg +0 -1
  1304. package/dist/pine-core/svg/heading-large.svg +0 -1
  1305. package/dist/pine-core/svg/heading-small.svg +0 -1
  1306. package/dist/pine-core/svg/headset-tone.svg +0 -1
  1307. package/dist/pine-core/svg/headset.svg +0 -1
  1308. package/dist/pine-core/svg/help-filled.svg +0 -1
  1309. package/dist/pine-core/svg/help.svg +0 -1
  1310. package/dist/pine-core/svg/home-02-tone.svg +0 -1
  1311. package/dist/pine-core/svg/home-alt.svg +0 -1
  1312. package/dist/pine-core/svg/home-filled.svg +0 -1
  1313. package/dist/pine-core/svg/home.svg +0 -1
  1314. package/dist/pine-core/svg/horizontal-line.svg +0 -1
  1315. package/dist/pine-core/svg/image.svg +0 -1
  1316. package/dist/pine-core/svg/info-circle-filled.svg +0 -1
  1317. package/dist/pine-core/svg/info-circle.svg +0 -1
  1318. package/dist/pine-core/svg/ios-battery.svg +0 -1
  1319. package/dist/pine-core/svg/ios-data.svg +0 -1
  1320. package/dist/pine-core/svg/ios-wifi.svg +0 -1
  1321. package/dist/pine-core/svg/italic.svg +0 -1
  1322. package/dist/pine-core/svg/kajabi-filled.svg +0 -1
  1323. package/dist/pine-core/svg/kajabi.svg +0 -1
  1324. package/dist/pine-core/svg/klarna.svg +0 -1
  1325. package/dist/pine-core/svg/lab.svg +0 -1
  1326. package/dist/pine-core/svg/launch.svg +0 -1
  1327. package/dist/pine-core/svg/layout-grid.svg +0 -1
  1328. package/dist/pine-core/svg/layout-list.svg +0 -1
  1329. package/dist/pine-core/svg/left-small.svg +0 -1
  1330. package/dist/pine-core/svg/list-bullet.svg +0 -1
  1331. package/dist/pine-core/svg/list-details.svg +0 -1
  1332. package/dist/pine-core/svg/list-numbers.svg +0 -1
  1333. package/dist/pine-core/svg/location.svg +0 -1
  1334. package/dist/pine-core/svg/lock-alt.svg +0 -1
  1335. package/dist/pine-core/svg/lock.svg +0 -1
  1336. package/dist/pine-core/svg/logo-afterpay.svg +0 -1
  1337. package/dist/pine-core/svg/logo-facebook-round.svg +0 -1
  1338. package/dist/pine-core/svg/logo-facebook.svg +0 -1
  1339. package/dist/pine-core/svg/logo-instagram.svg +0 -1
  1340. package/dist/pine-core/svg/logo-linkedin.svg +0 -1
  1341. package/dist/pine-core/svg/logo-tiktok.svg +0 -1
  1342. package/dist/pine-core/svg/logo-twitter-x.svg +0 -1
  1343. package/dist/pine-core/svg/logo-twitter.svg +0 -1
  1344. package/dist/pine-core/svg/logo-youtube.svg +0 -1
  1345. package/dist/pine-core/svg/loop.svg +0 -1
  1346. package/dist/pine-core/svg/mail-01-tone.svg +0 -1
  1347. package/dist/pine-core/svg/mail-filled.svg +0 -1
  1348. package/dist/pine-core/svg/mail-open.svg +0 -1
  1349. package/dist/pine-core/svg/mail.svg +0 -1
  1350. package/dist/pine-core/svg/map.svg +0 -1
  1351. package/dist/pine-core/svg/mapped.svg +0 -1
  1352. package/dist/pine-core/svg/margin-left.svg +0 -1
  1353. package/dist/pine-core/svg/margin-right.svg +0 -1
  1354. package/dist/pine-core/svg/marker-filled.svg +0 -1
  1355. package/dist/pine-core/svg/marker.svg +0 -1
  1356. package/dist/pine-core/svg/megaphone-filled.svg +0 -1
  1357. package/dist/pine-core/svg/megaphone.svg +0 -1
  1358. package/dist/pine-core/svg/menu-alt.svg +0 -1
  1359. package/dist/pine-core/svg/menu-bordered.svg +0 -1
  1360. package/dist/pine-core/svg/menu.svg +0 -1
  1361. package/dist/pine-core/svg/merge.svg +0 -1
  1362. package/dist/pine-core/svg/microphone-off.svg +0 -1
  1363. package/dist/pine-core/svg/microphone.svg +0 -1
  1364. package/dist/pine-core/svg/monitor-03-tone.svg +0 -1
  1365. package/dist/pine-core/svg/monitor-filled.svg +0 -1
  1366. package/dist/pine-core/svg/monitor.svg +0 -1
  1367. package/dist/pine-core/svg/more-menu-filled.svg +0 -1
  1368. package/dist/pine-core/svg/more-menu.svg +0 -1
  1369. package/dist/pine-core/svg/move-left.svg +0 -1
  1370. package/dist/pine-core/svg/move-right.svg +0 -1
  1371. package/dist/pine-core/svg/multi-pay.svg +0 -1
  1372. package/dist/pine-core/svg/newsletter-2.svg +0 -1
  1373. package/dist/pine-core/svg/newsletter.svg +0 -1
  1374. package/dist/pine-core/svg/one-off-session.svg +0 -1
  1375. package/dist/pine-core/svg/one-time.svg +0 -1
  1376. package/dist/pine-core/svg/packages.svg +0 -1
  1377. package/dist/pine-core/svg/pause-circle.svg +0 -1
  1378. package/dist/pine-core/svg/pause.svg +0 -1
  1379. package/dist/pine-core/svg/payout.svg +0 -1
  1380. package/dist/pine-core/svg/pen.svg +0 -1
  1381. package/dist/pine-core/svg/phone-02-tone.svg +0 -1
  1382. package/dist/pine-core/svg/phone-portrait.svg +0 -1
  1383. package/dist/pine-core/svg/phone-toolbar-filled.svg +0 -1
  1384. package/dist/pine-core/svg/phone-toolbar.svg +0 -1
  1385. package/dist/pine-core/svg/play-circle.svg +0 -1
  1386. package/dist/pine-core/svg/play-outline.svg +0 -1
  1387. package/dist/pine-core/svg/play-store.svg +0 -1
  1388. package/dist/pine-core/svg/play.svg +0 -1
  1389. package/dist/pine-core/svg/plug.svg +0 -1
  1390. package/dist/pine-core/svg/premium.svg +0 -1
  1391. package/dist/pine-core/svg/present.svg +0 -1
  1392. package/dist/pine-core/svg/preview-off.svg +0 -1
  1393. package/dist/pine-core/svg/preview-on.svg +0 -1
  1394. package/dist/pine-core/svg/product-filled.svg +0 -1
  1395. package/dist/pine-core/svg/product.svg +0 -1
  1396. package/dist/pine-core/svg/question-circle.svg +0 -1
  1397. package/dist/pine-core/svg/quote.svg +0 -1
  1398. package/dist/pine-core/svg/redo.svg +0 -1
  1399. package/dist/pine-core/svg/refresh.svg +0 -1
  1400. package/dist/pine-core/svg/remove-circle.svg +0 -1
  1401. package/dist/pine-core/svg/remove.svg +0 -1
  1402. package/dist/pine-core/svg/rename.svg +0 -1
  1403. package/dist/pine-core/svg/reset-password.svg +0 -1
  1404. package/dist/pine-core/svg/restore.svg +0 -1
  1405. package/dist/pine-core/svg/right-small.svg +0 -1
  1406. package/dist/pine-core/svg/rocket-filled.svg +0 -1
  1407. package/dist/pine-core/svg/rocket.svg +0 -1
  1408. package/dist/pine-core/svg/round-dollar.svg +0 -1
  1409. package/dist/pine-core/svg/rows.svg +0 -1
  1410. package/dist/pine-core/svg/scissor.svg +0 -1
  1411. package/dist/pine-core/svg/screen-share-off.svg +0 -1
  1412. package/dist/pine-core/svg/screen-share-on.svg +0 -1
  1413. package/dist/pine-core/svg/search-md-tone.svg +0 -1
  1414. package/dist/pine-core/svg/search-small.svg +0 -1
  1415. package/dist/pine-core/svg/search.svg +0 -1
  1416. package/dist/pine-core/svg/send-message.svg +0 -1
  1417. package/dist/pine-core/svg/sequences.svg +0 -1
  1418. package/dist/pine-core/svg/settings-01-tone.svg +0 -1
  1419. package/dist/pine-core/svg/share.svg +0 -1
  1420. package/dist/pine-core/svg/skipped.svg +0 -1
  1421. package/dist/pine-core/svg/slash-divider.svg +0 -1
  1422. package/dist/pine-core/svg/speaker.svg +0 -1
  1423. package/dist/pine-core/svg/stack.svg +0 -1
  1424. package/dist/pine-core/svg/star.svg +0 -1
  1425. package/dist/pine-core/svg/stars-01-tone.svg +0 -1
  1426. package/dist/pine-core/svg/stop.svg +0 -1
  1427. package/dist/pine-core/svg/stopwatch.svg +0 -1
  1428. package/dist/pine-core/svg/strikethrough.svg +0 -1
  1429. package/dist/pine-core/svg/subscript.svg +0 -1
  1430. package/dist/pine-core/svg/subscriptions.svg +0 -1
  1431. package/dist/pine-core/svg/super-admin.svg +0 -1
  1432. package/dist/pine-core/svg/superscript.svg +0 -1
  1433. package/dist/pine-core/svg/sync.svg +0 -1
  1434. package/dist/pine-core/svg/tablet-landscape.svg +0 -1
  1435. package/dist/pine-core/svg/tablet-portrait.svg +0 -1
  1436. package/dist/pine-core/svg/tag-filled.svg +0 -1
  1437. package/dist/pine-core/svg/tag.svg +0 -1
  1438. package/dist/pine-core/svg/text-styles.svg +0 -1
  1439. package/dist/pine-core/svg/theme-store-filled.svg +0 -1
  1440. package/dist/pine-core/svg/theme-store.svg +0 -1
  1441. package/dist/pine-core/svg/thumb-down-filled.svg +0 -1
  1442. package/dist/pine-core/svg/thumb-down.svg +0 -1
  1443. package/dist/pine-core/svg/thumb-up-filled.svg +0 -1
  1444. package/dist/pine-core/svg/thumb-up.svg +0 -1
  1445. package/dist/pine-core/svg/trash.svg +0 -1
  1446. package/dist/pine-core/svg/trophy-filled.svg +0 -1
  1447. package/dist/pine-core/svg/trophy.svg +0 -1
  1448. package/dist/pine-core/svg/underline.svg +0 -1
  1449. package/dist/pine-core/svg/undo.svg +0 -1
  1450. package/dist/pine-core/svg/unlock.svg +0 -1
  1451. package/dist/pine-core/svg/unmapped.svg +0 -1
  1452. package/dist/pine-core/svg/up-small.svg +0 -1
  1453. package/dist/pine-core/svg/upload.svg +0 -1
  1454. package/dist/pine-core/svg/url.svg +0 -1
  1455. package/dist/pine-core/svg/user-circle-filled.svg +0 -1
  1456. package/dist/pine-core/svg/user-circle.svg +0 -1
  1457. package/dist/pine-core/svg/user-filled.svg +0 -1
  1458. package/dist/pine-core/svg/user-star-filled.svg +0 -1
  1459. package/dist/pine-core/svg/user-star.svg +0 -1
  1460. package/dist/pine-core/svg/user.svg +0 -1
  1461. package/dist/pine-core/svg/users-02-tone.svg +0 -1
  1462. package/dist/pine-core/svg/users-alt.svg +0 -1
  1463. package/dist/pine-core/svg/users-filled.svg +0 -1
  1464. package/dist/pine-core/svg/users.svg +0 -1
  1465. package/dist/pine-core/svg/video-off.svg +0 -1
  1466. package/dist/pine-core/svg/video-on.svg +0 -1
  1467. package/dist/pine-core/svg/warning-filled.svg +0 -1
  1468. package/dist/pine-core/svg/warning.svg +0 -1
  1469. package/dist/pine-core/svg/window-paragraph.svg +0 -1
  1470. package/dist/pine-core/svg/world.svg +0 -1
  1471. package/dist/pine-core/svg/wrench.svg +0 -1
  1472. package/dist/types/stories/_helpers/index.d.ts +0 -12
  1473. package/loader/package.json +0 -11
@@ -0,0 +1,4500 @@
1
+ 'use strict';
2
+
3
+ var index = require('./index-D9iJuJCP.js');
4
+ var form = require('./form-MhwfKTuo.js');
5
+ var floatingUi_dom = require('./floating-ui.dom-Dw41zbyY.js');
6
+ var utils = require('./utils-BhRmyxT8.js');
7
+ var closest = require('./closest-D0qyYtJ3.js');
8
+ require('./keep-hydrated-AKoh0DG4.js');
9
+
10
+ /*! @license DOMPurify 3.3.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.3/LICENSE */
11
+
12
+ const {
13
+ entries,
14
+ setPrototypeOf,
15
+ isFrozen,
16
+ getPrototypeOf,
17
+ getOwnPropertyDescriptor
18
+ } = Object;
19
+ let {
20
+ freeze,
21
+ seal,
22
+ create
23
+ } = Object; // eslint-disable-line import/no-mutable-exports
24
+ let {
25
+ apply,
26
+ construct
27
+ } = typeof Reflect !== 'undefined' && Reflect;
28
+ if (!freeze) {
29
+ freeze = function freeze(x) {
30
+ return x;
31
+ };
32
+ }
33
+ if (!seal) {
34
+ seal = function seal(x) {
35
+ return x;
36
+ };
37
+ }
38
+ if (!apply) {
39
+ apply = function apply(func, thisArg) {
40
+ for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
41
+ args[_key - 2] = arguments[_key];
42
+ }
43
+ return func.apply(thisArg, args);
44
+ };
45
+ }
46
+ if (!construct) {
47
+ construct = function construct(Func) {
48
+ for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
49
+ args[_key2 - 1] = arguments[_key2];
50
+ }
51
+ return new Func(...args);
52
+ };
53
+ }
54
+ const arrayForEach = unapply(Array.prototype.forEach);
55
+ const arrayLastIndexOf = unapply(Array.prototype.lastIndexOf);
56
+ const arrayPop = unapply(Array.prototype.pop);
57
+ const arrayPush = unapply(Array.prototype.push);
58
+ const arraySplice = unapply(Array.prototype.splice);
59
+ const stringToLowerCase = unapply(String.prototype.toLowerCase);
60
+ const stringToString = unapply(String.prototype.toString);
61
+ const stringMatch = unapply(String.prototype.match);
62
+ const stringReplace = unapply(String.prototype.replace);
63
+ const stringIndexOf = unapply(String.prototype.indexOf);
64
+ const stringTrim = unapply(String.prototype.trim);
65
+ const objectHasOwnProperty = unapply(Object.prototype.hasOwnProperty);
66
+ const regExpTest = unapply(RegExp.prototype.test);
67
+ const typeErrorCreate = unconstruct(TypeError);
68
+ /**
69
+ * Creates a new function that calls the given function with a specified thisArg and arguments.
70
+ *
71
+ * @param func - The function to be wrapped and called.
72
+ * @returns A new function that calls the given function with a specified thisArg and arguments.
73
+ */
74
+ function unapply(func) {
75
+ return function (thisArg) {
76
+ if (thisArg instanceof RegExp) {
77
+ thisArg.lastIndex = 0;
78
+ }
79
+ for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
80
+ args[_key3 - 1] = arguments[_key3];
81
+ }
82
+ return apply(func, thisArg, args);
83
+ };
84
+ }
85
+ /**
86
+ * Creates a new function that constructs an instance of the given constructor function with the provided arguments.
87
+ *
88
+ * @param func - The constructor function to be wrapped and called.
89
+ * @returns A new function that constructs an instance of the given constructor function with the provided arguments.
90
+ */
91
+ function unconstruct(Func) {
92
+ return function () {
93
+ for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
94
+ args[_key4] = arguments[_key4];
95
+ }
96
+ return construct(Func, args);
97
+ };
98
+ }
99
+ /**
100
+ * Add properties to a lookup table
101
+ *
102
+ * @param set - The set to which elements will be added.
103
+ * @param array - The array containing elements to be added to the set.
104
+ * @param transformCaseFunc - An optional function to transform the case of each element before adding to the set.
105
+ * @returns The modified set with added elements.
106
+ */
107
+ function addToSet(set, array) {
108
+ let transformCaseFunc = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : stringToLowerCase;
109
+ if (setPrototypeOf) {
110
+ // Make 'in' and truthy checks like Boolean(set.constructor)
111
+ // independent of any properties defined on Object.prototype.
112
+ // Prevent prototype setters from intercepting set as a this value.
113
+ setPrototypeOf(set, null);
114
+ }
115
+ let l = array.length;
116
+ while (l--) {
117
+ let element = array[l];
118
+ if (typeof element === 'string') {
119
+ const lcElement = transformCaseFunc(element);
120
+ if (lcElement !== element) {
121
+ // Config presets (e.g. tags.js, attrs.js) are immutable.
122
+ if (!isFrozen(array)) {
123
+ array[l] = lcElement;
124
+ }
125
+ element = lcElement;
126
+ }
127
+ }
128
+ set[element] = true;
129
+ }
130
+ return set;
131
+ }
132
+ /**
133
+ * Clean up an array to harden against CSPP
134
+ *
135
+ * @param array - The array to be cleaned.
136
+ * @returns The cleaned version of the array
137
+ */
138
+ function cleanArray(array) {
139
+ for (let index = 0; index < array.length; index++) {
140
+ const isPropertyExist = objectHasOwnProperty(array, index);
141
+ if (!isPropertyExist) {
142
+ array[index] = null;
143
+ }
144
+ }
145
+ return array;
146
+ }
147
+ /**
148
+ * Shallow clone an object
149
+ *
150
+ * @param object - The object to be cloned.
151
+ * @returns A new object that copies the original.
152
+ */
153
+ function clone(object) {
154
+ const newObject = create(null);
155
+ for (const [property, value] of entries(object)) {
156
+ const isPropertyExist = objectHasOwnProperty(object, property);
157
+ if (isPropertyExist) {
158
+ if (Array.isArray(value)) {
159
+ newObject[property] = cleanArray(value);
160
+ } else if (value && typeof value === 'object' && value.constructor === Object) {
161
+ newObject[property] = clone(value);
162
+ } else {
163
+ newObject[property] = value;
164
+ }
165
+ }
166
+ }
167
+ return newObject;
168
+ }
169
+ /**
170
+ * This method automatically checks if the prop is function or getter and behaves accordingly.
171
+ *
172
+ * @param object - The object to look up the getter function in its prototype chain.
173
+ * @param prop - The property name for which to find the getter function.
174
+ * @returns The getter function found in the prototype chain or a fallback function.
175
+ */
176
+ function lookupGetter(object, prop) {
177
+ while (object !== null) {
178
+ const desc = getOwnPropertyDescriptor(object, prop);
179
+ if (desc) {
180
+ if (desc.get) {
181
+ return unapply(desc.get);
182
+ }
183
+ if (typeof desc.value === 'function') {
184
+ return unapply(desc.value);
185
+ }
186
+ }
187
+ object = getPrototypeOf(object);
188
+ }
189
+ function fallbackValue() {
190
+ return null;
191
+ }
192
+ return fallbackValue;
193
+ }
194
+
195
+ 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']);
196
+ 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']);
197
+ 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']);
198
+ // List of SVG elements that are disallowed by default.
199
+ // We still need to know them so that we can do namespace
200
+ // checks properly in case one wants to add them to
201
+ // allow-list.
202
+ 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']);
203
+ 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']);
204
+ // Similarly to SVG, we want to know all MathML elements,
205
+ // even those that we disallow by default.
206
+ const mathMlDisallowed = freeze(['maction', 'maligngroup', 'malignmark', 'mlongdiv', 'mscarries', 'mscarry', 'msgroup', 'mstack', 'msline', 'msrow', 'semantics', 'annotation', 'annotation-xml', 'mprescripts', 'none']);
207
+ const text = freeze(['#text']);
208
+
209
+ const html = freeze(['accept', 'action', 'align', 'alt', 'autocapitalize', 'autocomplete', 'autopictureinpicture', 'autoplay', 'background', 'bgcolor', 'border', 'capture', 'cellpadding', 'cellspacing', 'checked', 'cite', 'class', 'clear', 'color', 'cols', 'colspan', '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', 'slot']);
210
+ 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', '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', '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-rendering', 'textlength', 'type', 'u1', 'u2', 'unicode', 'values', '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']);
211
+ const mathMl = freeze(['accent', 'accentunder', 'align', 'bevelled', 'close', 'columnsalign', 'columnlines', 'columnspan', 'denomalign', 'depth', 'dir', 'display', 'displaystyle', 'encoding', 'fence', 'frame', 'height', 'href', 'id', 'largeop', 'length', 'linethickness', 'lspace', 'lquote', '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']);
212
+ const xml = freeze(['xlink:href', 'xml:id', 'xlink:title', 'xml:space', 'xmlns:xlink']);
213
+
214
+ // eslint-disable-next-line unicorn/better-regex
215
+ const MUSTACHE_EXPR = seal(/\{\{[\w\W]*|[\w\W]*\}\}/gm); // Specify template detection regex for SAFE_FOR_TEMPLATES mode
216
+ const ERB_EXPR = seal(/<%[\w\W]*|[\w\W]*%>/gm);
217
+ const TMPLIT_EXPR = seal(/\$\{[\w\W]*/gm); // eslint-disable-line unicorn/better-regex
218
+ const DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]+$/); // eslint-disable-line no-useless-escape
219
+ const ARIA_ATTR = seal(/^aria-[\-\w]+$/); // eslint-disable-line no-useless-escape
220
+ 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
221
+ );
222
+ const IS_SCRIPT_OR_DATA = seal(/^(?:\w+script|data):/i);
223
+ const ATTR_WHITESPACE = seal(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g // eslint-disable-line no-control-regex
224
+ );
225
+ const DOCTYPE_NAME = seal(/^html$/i);
226
+ const CUSTOM_ELEMENT = seal(/^[a-z][.\w]*(-[.\w]+)+$/i);
227
+
228
+ var EXPRESSIONS = /*#__PURE__*/Object.freeze({
229
+ __proto__: null,
230
+ ARIA_ATTR: ARIA_ATTR,
231
+ ATTR_WHITESPACE: ATTR_WHITESPACE,
232
+ CUSTOM_ELEMENT: CUSTOM_ELEMENT,
233
+ DATA_ATTR: DATA_ATTR,
234
+ DOCTYPE_NAME: DOCTYPE_NAME,
235
+ ERB_EXPR: ERB_EXPR,
236
+ IS_ALLOWED_URI: IS_ALLOWED_URI,
237
+ IS_SCRIPT_OR_DATA: IS_SCRIPT_OR_DATA,
238
+ MUSTACHE_EXPR: MUSTACHE_EXPR,
239
+ TMPLIT_EXPR: TMPLIT_EXPR
240
+ });
241
+
242
+ /* eslint-disable @typescript-eslint/indent */
243
+ // https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType
244
+ const NODE_TYPE = {
245
+ element: 1,
246
+ text: 3,
247
+ // Deprecated
248
+ progressingInstruction: 7,
249
+ comment: 8,
250
+ document: 9};
251
+ const getGlobal = function getGlobal() {
252
+ return typeof window === 'undefined' ? null : window;
253
+ };
254
+ /**
255
+ * Creates a no-op policy for internal use only.
256
+ * Don't export this function outside this module!
257
+ * @param trustedTypes The policy factory.
258
+ * @param purifyHostElement The Script element used to load DOMPurify (to determine policy name suffix).
259
+ * @return The policy created (or null, if Trusted Types
260
+ * are not supported or creating the policy failed).
261
+ */
262
+ const _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes, purifyHostElement) {
263
+ if (typeof trustedTypes !== 'object' || typeof trustedTypes.createPolicy !== 'function') {
264
+ return null;
265
+ }
266
+ // Allow the callers to control the unique policy name
267
+ // by adding a data-tt-policy-suffix to the script element with the DOMPurify.
268
+ // Policy creation with duplicate names throws in Trusted Types.
269
+ let suffix = null;
270
+ const ATTR_NAME = 'data-tt-policy-suffix';
271
+ if (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) {
272
+ suffix = purifyHostElement.getAttribute(ATTR_NAME);
273
+ }
274
+ const policyName = 'dompurify' + (suffix ? '#' + suffix : '');
275
+ try {
276
+ return trustedTypes.createPolicy(policyName, {
277
+ createHTML(html) {
278
+ return html;
279
+ },
280
+ createScriptURL(scriptUrl) {
281
+ return scriptUrl;
282
+ }
283
+ });
284
+ } catch (_) {
285
+ // Policy creation failed (most likely another DOMPurify script has
286
+ // already run). Skip creating the policy, as this will only cause errors
287
+ // if TT are enforced.
288
+ console.warn('TrustedTypes policy ' + policyName + ' could not be created.');
289
+ return null;
290
+ }
291
+ };
292
+ const _createHooksMap = function _createHooksMap() {
293
+ return {
294
+ afterSanitizeAttributes: [],
295
+ afterSanitizeElements: [],
296
+ afterSanitizeShadowDOM: [],
297
+ beforeSanitizeAttributes: [],
298
+ beforeSanitizeElements: [],
299
+ beforeSanitizeShadowDOM: [],
300
+ uponSanitizeAttribute: [],
301
+ uponSanitizeElement: [],
302
+ uponSanitizeShadowNode: []
303
+ };
304
+ };
305
+ function createDOMPurify() {
306
+ let window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();
307
+ const DOMPurify = root => createDOMPurify(root);
308
+ DOMPurify.version = '3.3.3';
309
+ DOMPurify.removed = [];
310
+ if (!window || !window.document || window.document.nodeType !== NODE_TYPE.document || !window.Element) {
311
+ // Not running in a browser, provide a factory function
312
+ // so that you can pass your own Window
313
+ DOMPurify.isSupported = false;
314
+ return DOMPurify;
315
+ }
316
+ let {
317
+ document
318
+ } = window;
319
+ const originalDocument = document;
320
+ const currentScript = originalDocument.currentScript;
321
+ const {
322
+ DocumentFragment,
323
+ HTMLTemplateElement,
324
+ Node,
325
+ Element,
326
+ NodeFilter,
327
+ NamedNodeMap = window.NamedNodeMap || window.MozNamedAttrMap,
328
+ HTMLFormElement,
329
+ DOMParser,
330
+ trustedTypes
331
+ } = window;
332
+ const ElementPrototype = Element.prototype;
333
+ const cloneNode = lookupGetter(ElementPrototype, 'cloneNode');
334
+ const remove = lookupGetter(ElementPrototype, 'remove');
335
+ const getNextSibling = lookupGetter(ElementPrototype, 'nextSibling');
336
+ const getChildNodes = lookupGetter(ElementPrototype, 'childNodes');
337
+ const getParentNode = lookupGetter(ElementPrototype, 'parentNode');
338
+ // As per issue #47, the web-components registry is inherited by a
339
+ // new document created via createHTMLDocument. As per the spec
340
+ // (http://w3c.github.io/webcomponents/spec/custom/#creating-and-passing-registries)
341
+ // a new empty registry is used when creating a template contents owner
342
+ // document, so we use that as our parent document to ensure nothing
343
+ // is inherited.
344
+ if (typeof HTMLTemplateElement === 'function') {
345
+ const template = document.createElement('template');
346
+ if (template.content && template.content.ownerDocument) {
347
+ document = template.content.ownerDocument;
348
+ }
349
+ }
350
+ let trustedTypesPolicy;
351
+ let emptyHTML = '';
352
+ const {
353
+ implementation,
354
+ createNodeIterator,
355
+ createDocumentFragment,
356
+ getElementsByTagName
357
+ } = document;
358
+ const {
359
+ importNode
360
+ } = originalDocument;
361
+ let hooks = _createHooksMap();
362
+ /**
363
+ * Expose whether this browser supports running the full DOMPurify.
364
+ */
365
+ DOMPurify.isSupported = typeof entries === 'function' && typeof getParentNode === 'function' && implementation && implementation.createHTMLDocument !== undefined;
366
+ const {
367
+ MUSTACHE_EXPR,
368
+ ERB_EXPR,
369
+ TMPLIT_EXPR,
370
+ DATA_ATTR,
371
+ ARIA_ATTR,
372
+ IS_SCRIPT_OR_DATA,
373
+ ATTR_WHITESPACE,
374
+ CUSTOM_ELEMENT
375
+ } = EXPRESSIONS;
376
+ let {
377
+ IS_ALLOWED_URI: IS_ALLOWED_URI$1
378
+ } = EXPRESSIONS;
379
+ /**
380
+ * We consider the elements and attributes below to be safe. Ideally
381
+ * don't add any new ones but feel free to remove unwanted ones.
382
+ */
383
+ /* allowed element names */
384
+ let ALLOWED_TAGS = null;
385
+ const DEFAULT_ALLOWED_TAGS = addToSet({}, [...html$1, ...svg$1, ...svgFilters, ...mathMl$1, ...text]);
386
+ /* Allowed attribute names */
387
+ let ALLOWED_ATTR = null;
388
+ const DEFAULT_ALLOWED_ATTR = addToSet({}, [...html, ...svg, ...mathMl, ...xml]);
389
+ /*
390
+ * Configure how DOMPurify should handle custom elements and their attributes as well as customized built-in elements.
391
+ * @property {RegExp|Function|null} tagNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any custom elements)
392
+ * @property {RegExp|Function|null} attributeNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any attributes not on the allow list)
393
+ * @property {boolean} allowCustomizedBuiltInElements allow custom elements derived from built-ins if they pass CUSTOM_ELEMENT_HANDLING.tagNameCheck. Default: `false`.
394
+ */
395
+ let CUSTOM_ELEMENT_HANDLING = Object.seal(create(null, {
396
+ tagNameCheck: {
397
+ writable: true,
398
+ configurable: false,
399
+ enumerable: true,
400
+ value: null
401
+ },
402
+ attributeNameCheck: {
403
+ writable: true,
404
+ configurable: false,
405
+ enumerable: true,
406
+ value: null
407
+ },
408
+ allowCustomizedBuiltInElements: {
409
+ writable: true,
410
+ configurable: false,
411
+ enumerable: true,
412
+ value: false
413
+ }
414
+ }));
415
+ /* Explicitly forbidden tags (overrides ALLOWED_TAGS/ADD_TAGS) */
416
+ let FORBID_TAGS = null;
417
+ /* Explicitly forbidden attributes (overrides ALLOWED_ATTR/ADD_ATTR) */
418
+ let FORBID_ATTR = null;
419
+ /* Config object to store ADD_TAGS/ADD_ATTR functions (when used as functions) */
420
+ const EXTRA_ELEMENT_HANDLING = Object.seal(create(null, {
421
+ tagCheck: {
422
+ writable: true,
423
+ configurable: false,
424
+ enumerable: true,
425
+ value: null
426
+ },
427
+ attributeCheck: {
428
+ writable: true,
429
+ configurable: false,
430
+ enumerable: true,
431
+ value: null
432
+ }
433
+ }));
434
+ /* Decide if ARIA attributes are okay */
435
+ let ALLOW_ARIA_ATTR = true;
436
+ /* Decide if custom data attributes are okay */
437
+ let ALLOW_DATA_ATTR = true;
438
+ /* Decide if unknown protocols are okay */
439
+ let ALLOW_UNKNOWN_PROTOCOLS = false;
440
+ /* Decide if self-closing tags in attributes are allowed.
441
+ * Usually removed due to a mXSS issue in jQuery 3.0 */
442
+ let ALLOW_SELF_CLOSE_IN_ATTR = true;
443
+ /* Output should be safe for common template engines.
444
+ * This means, DOMPurify removes data attributes, mustaches and ERB
445
+ */
446
+ let SAFE_FOR_TEMPLATES = false;
447
+ /* Output should be safe even for XML used within HTML and alike.
448
+ * This means, DOMPurify removes comments when containing risky content.
449
+ */
450
+ let SAFE_FOR_XML = true;
451
+ /* Decide if document with <html>... should be returned */
452
+ let WHOLE_DOCUMENT = false;
453
+ /* Track whether config is already set on this instance of DOMPurify. */
454
+ let SET_CONFIG = false;
455
+ /* Decide if all elements (e.g. style, script) must be children of
456
+ * document.body. By default, browsers might move them to document.head */
457
+ let FORCE_BODY = false;
458
+ /* Decide if a DOM `HTMLBodyElement` should be returned, instead of a html
459
+ * string (or a TrustedHTML object if Trusted Types are supported).
460
+ * If `WHOLE_DOCUMENT` is enabled a `HTMLHtmlElement` will be returned instead
461
+ */
462
+ let RETURN_DOM = false;
463
+ /* Decide if a DOM `DocumentFragment` should be returned, instead of a html
464
+ * string (or a TrustedHTML object if Trusted Types are supported) */
465
+ let RETURN_DOM_FRAGMENT = false;
466
+ /* Try to return a Trusted Type object instead of a string, return a string in
467
+ * case Trusted Types are not supported */
468
+ let RETURN_TRUSTED_TYPE = false;
469
+ /* Output should be free from DOM clobbering attacks?
470
+ * This sanitizes markups named with colliding, clobberable built-in DOM APIs.
471
+ */
472
+ let SANITIZE_DOM = true;
473
+ /* Achieve full DOM Clobbering protection by isolating the namespace of named
474
+ * properties and JS variables, mitigating attacks that abuse the HTML/DOM spec rules.
475
+ *
476
+ * HTML/DOM spec rules that enable DOM Clobbering:
477
+ * - Named Access on Window (§7.3.3)
478
+ * - DOM Tree Accessors (§3.1.5)
479
+ * - Form Element Parent-Child Relations (§4.10.3)
480
+ * - Iframe srcdoc / Nested WindowProxies (§4.8.5)
481
+ * - HTMLCollection (§4.2.10.2)
482
+ *
483
+ * Namespace isolation is implemented by prefixing `id` and `name` attributes
484
+ * with a constant string, i.e., `user-content-`
485
+ */
486
+ let SANITIZE_NAMED_PROPS = false;
487
+ const SANITIZE_NAMED_PROPS_PREFIX = 'user-content-';
488
+ /* Keep element content when removing element? */
489
+ let KEEP_CONTENT = true;
490
+ /* If a `Node` is passed to sanitize(), then performs sanitization in-place instead
491
+ * of importing it into a new Document and returning a sanitized copy */
492
+ let IN_PLACE = false;
493
+ /* Allow usage of profiles like html, svg and mathMl */
494
+ let USE_PROFILES = {};
495
+ /* Tags to ignore content of when KEEP_CONTENT is true */
496
+ let FORBID_CONTENTS = null;
497
+ const DEFAULT_FORBID_CONTENTS = addToSet({}, ['annotation-xml', 'audio', 'colgroup', 'desc', 'foreignobject', 'head', 'iframe', 'math', 'mi', 'mn', 'mo', 'ms', 'mtext', 'noembed', 'noframes', 'noscript', 'plaintext', 'script', 'style', 'svg', 'template', 'thead', 'title', 'video', 'xmp']);
498
+ /* Tags that are safe for data: URIs */
499
+ let DATA_URI_TAGS = null;
500
+ const DEFAULT_DATA_URI_TAGS = addToSet({}, ['audio', 'video', 'img', 'source', 'image', 'track']);
501
+ /* Attributes safe for values like "javascript:" */
502
+ let URI_SAFE_ATTRIBUTES = null;
503
+ const DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ['alt', 'class', 'for', 'id', 'label', 'name', 'pattern', 'placeholder', 'role', 'summary', 'title', 'value', 'style', 'xmlns']);
504
+ const MATHML_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';
505
+ const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';
506
+ const HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';
507
+ /* Document namespace */
508
+ let NAMESPACE = HTML_NAMESPACE;
509
+ let IS_EMPTY_INPUT = false;
510
+ /* Allowed XHTML+XML namespaces */
511
+ let ALLOWED_NAMESPACES = null;
512
+ const DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE], stringToString);
513
+ let MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ['mi', 'mo', 'mn', 'ms', 'mtext']);
514
+ let HTML_INTEGRATION_POINTS = addToSet({}, ['annotation-xml']);
515
+ // Certain elements are allowed in both SVG and HTML
516
+ // namespace. We need to specify them explicitly
517
+ // so that they don't get erroneously deleted from
518
+ // HTML namespace.
519
+ const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, ['title', 'style', 'font', 'a', 'script']);
520
+ /* Parsing of strict XHTML documents */
521
+ let PARSER_MEDIA_TYPE = null;
522
+ const SUPPORTED_PARSER_MEDIA_TYPES = ['application/xhtml+xml', 'text/html'];
523
+ const DEFAULT_PARSER_MEDIA_TYPE = 'text/html';
524
+ let transformCaseFunc = null;
525
+ /* Keep a reference to config to pass to hooks */
526
+ let CONFIG = null;
527
+ /* Ideally, do not touch anything below this line */
528
+ /* ______________________________________________ */
529
+ const formElement = document.createElement('form');
530
+ const isRegexOrFunction = function isRegexOrFunction(testValue) {
531
+ return testValue instanceof RegExp || testValue instanceof Function;
532
+ };
533
+ /**
534
+ * _parseConfig
535
+ *
536
+ * @param cfg optional config literal
537
+ */
538
+ // eslint-disable-next-line complexity
539
+ const _parseConfig = function _parseConfig() {
540
+ let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
541
+ if (CONFIG && CONFIG === cfg) {
542
+ return;
543
+ }
544
+ /* Shield configuration object from tampering */
545
+ if (!cfg || typeof cfg !== 'object') {
546
+ cfg = {};
547
+ }
548
+ /* Shield configuration object from prototype pollution */
549
+ cfg = clone(cfg);
550
+ PARSER_MEDIA_TYPE =
551
+ // eslint-disable-next-line unicorn/prefer-includes
552
+ SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? DEFAULT_PARSER_MEDIA_TYPE : cfg.PARSER_MEDIA_TYPE;
553
+ // HTML tags and attributes are not case-sensitive, converting to lowercase. Keeping XHTML as is.
554
+ transformCaseFunc = PARSER_MEDIA_TYPE === 'application/xhtml+xml' ? stringToString : stringToLowerCase;
555
+ /* Set configuration parameters */
556
+ ALLOWED_TAGS = objectHasOwnProperty(cfg, 'ALLOWED_TAGS') ? addToSet({}, cfg.ALLOWED_TAGS, transformCaseFunc) : DEFAULT_ALLOWED_TAGS;
557
+ ALLOWED_ATTR = objectHasOwnProperty(cfg, 'ALLOWED_ATTR') ? addToSet({}, cfg.ALLOWED_ATTR, transformCaseFunc) : DEFAULT_ALLOWED_ATTR;
558
+ ALLOWED_NAMESPACES = objectHasOwnProperty(cfg, 'ALLOWED_NAMESPACES') ? addToSet({}, cfg.ALLOWED_NAMESPACES, stringToString) : DEFAULT_ALLOWED_NAMESPACES;
559
+ URI_SAFE_ATTRIBUTES = objectHasOwnProperty(cfg, 'ADD_URI_SAFE_ATTR') ? addToSet(clone(DEFAULT_URI_SAFE_ATTRIBUTES), cfg.ADD_URI_SAFE_ATTR, transformCaseFunc) : DEFAULT_URI_SAFE_ATTRIBUTES;
560
+ DATA_URI_TAGS = objectHasOwnProperty(cfg, 'ADD_DATA_URI_TAGS') ? addToSet(clone(DEFAULT_DATA_URI_TAGS), cfg.ADD_DATA_URI_TAGS, transformCaseFunc) : DEFAULT_DATA_URI_TAGS;
561
+ FORBID_CONTENTS = objectHasOwnProperty(cfg, 'FORBID_CONTENTS') ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc) : DEFAULT_FORBID_CONTENTS;
562
+ FORBID_TAGS = objectHasOwnProperty(cfg, 'FORBID_TAGS') ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc) : clone({});
563
+ FORBID_ATTR = objectHasOwnProperty(cfg, 'FORBID_ATTR') ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc) : clone({});
564
+ USE_PROFILES = objectHasOwnProperty(cfg, 'USE_PROFILES') ? cfg.USE_PROFILES : false;
565
+ ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; // Default true
566
+ ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; // Default true
567
+ ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false; // Default false
568
+ ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false; // Default true
569
+ SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false; // Default false
570
+ SAFE_FOR_XML = cfg.SAFE_FOR_XML !== false; // Default true
571
+ WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false; // Default false
572
+ RETURN_DOM = cfg.RETURN_DOM || false; // Default false
573
+ RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false; // Default false
574
+ RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false; // Default false
575
+ FORCE_BODY = cfg.FORCE_BODY || false; // Default false
576
+ SANITIZE_DOM = cfg.SANITIZE_DOM !== false; // Default true
577
+ SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false; // Default false
578
+ KEEP_CONTENT = cfg.KEEP_CONTENT !== false; // Default true
579
+ IN_PLACE = cfg.IN_PLACE || false; // Default false
580
+ IS_ALLOWED_URI$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI;
581
+ NAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE;
582
+ MATHML_TEXT_INTEGRATION_POINTS = cfg.MATHML_TEXT_INTEGRATION_POINTS || MATHML_TEXT_INTEGRATION_POINTS;
583
+ HTML_INTEGRATION_POINTS = cfg.HTML_INTEGRATION_POINTS || HTML_INTEGRATION_POINTS;
584
+ CUSTOM_ELEMENT_HANDLING = cfg.CUSTOM_ELEMENT_HANDLING || {};
585
+ if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck)) {
586
+ CUSTOM_ELEMENT_HANDLING.tagNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck;
587
+ }
588
+ if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)) {
589
+ CUSTOM_ELEMENT_HANDLING.attributeNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck;
590
+ }
591
+ if (cfg.CUSTOM_ELEMENT_HANDLING && typeof cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements === 'boolean') {
592
+ CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements;
593
+ }
594
+ if (SAFE_FOR_TEMPLATES) {
595
+ ALLOW_DATA_ATTR = false;
596
+ }
597
+ if (RETURN_DOM_FRAGMENT) {
598
+ RETURN_DOM = true;
599
+ }
600
+ /* Parse profile info */
601
+ if (USE_PROFILES) {
602
+ ALLOWED_TAGS = addToSet({}, text);
603
+ ALLOWED_ATTR = create(null);
604
+ if (USE_PROFILES.html === true) {
605
+ addToSet(ALLOWED_TAGS, html$1);
606
+ addToSet(ALLOWED_ATTR, html);
607
+ }
608
+ if (USE_PROFILES.svg === true) {
609
+ addToSet(ALLOWED_TAGS, svg$1);
610
+ addToSet(ALLOWED_ATTR, svg);
611
+ addToSet(ALLOWED_ATTR, xml);
612
+ }
613
+ if (USE_PROFILES.svgFilters === true) {
614
+ addToSet(ALLOWED_TAGS, svgFilters);
615
+ addToSet(ALLOWED_ATTR, svg);
616
+ addToSet(ALLOWED_ATTR, xml);
617
+ }
618
+ if (USE_PROFILES.mathMl === true) {
619
+ addToSet(ALLOWED_TAGS, mathMl$1);
620
+ addToSet(ALLOWED_ATTR, mathMl);
621
+ addToSet(ALLOWED_ATTR, xml);
622
+ }
623
+ }
624
+ /* Prevent function-based ADD_ATTR / ADD_TAGS from leaking across calls */
625
+ if (!objectHasOwnProperty(cfg, 'ADD_TAGS')) {
626
+ EXTRA_ELEMENT_HANDLING.tagCheck = null;
627
+ }
628
+ if (!objectHasOwnProperty(cfg, 'ADD_ATTR')) {
629
+ EXTRA_ELEMENT_HANDLING.attributeCheck = null;
630
+ }
631
+ /* Merge configuration parameters */
632
+ if (cfg.ADD_TAGS) {
633
+ if (typeof cfg.ADD_TAGS === 'function') {
634
+ EXTRA_ELEMENT_HANDLING.tagCheck = cfg.ADD_TAGS;
635
+ } else {
636
+ if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {
637
+ ALLOWED_TAGS = clone(ALLOWED_TAGS);
638
+ }
639
+ addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);
640
+ }
641
+ }
642
+ if (cfg.ADD_ATTR) {
643
+ if (typeof cfg.ADD_ATTR === 'function') {
644
+ EXTRA_ELEMENT_HANDLING.attributeCheck = cfg.ADD_ATTR;
645
+ } else {
646
+ if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {
647
+ ALLOWED_ATTR = clone(ALLOWED_ATTR);
648
+ }
649
+ addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);
650
+ }
651
+ }
652
+ if (cfg.ADD_URI_SAFE_ATTR) {
653
+ addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc);
654
+ }
655
+ if (cfg.FORBID_CONTENTS) {
656
+ if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {
657
+ FORBID_CONTENTS = clone(FORBID_CONTENTS);
658
+ }
659
+ addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc);
660
+ }
661
+ if (cfg.ADD_FORBID_CONTENTS) {
662
+ if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {
663
+ FORBID_CONTENTS = clone(FORBID_CONTENTS);
664
+ }
665
+ addToSet(FORBID_CONTENTS, cfg.ADD_FORBID_CONTENTS, transformCaseFunc);
666
+ }
667
+ /* Add #text in case KEEP_CONTENT is set to true */
668
+ if (KEEP_CONTENT) {
669
+ ALLOWED_TAGS['#text'] = true;
670
+ }
671
+ /* Add html, head and body to ALLOWED_TAGS in case WHOLE_DOCUMENT is true */
672
+ if (WHOLE_DOCUMENT) {
673
+ addToSet(ALLOWED_TAGS, ['html', 'head', 'body']);
674
+ }
675
+ /* Add tbody to ALLOWED_TAGS in case tables are permitted, see #286, #365 */
676
+ if (ALLOWED_TAGS.table) {
677
+ addToSet(ALLOWED_TAGS, ['tbody']);
678
+ delete FORBID_TAGS.tbody;
679
+ }
680
+ if (cfg.TRUSTED_TYPES_POLICY) {
681
+ if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== 'function') {
682
+ throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
683
+ }
684
+ if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== 'function') {
685
+ throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
686
+ }
687
+ // Overwrite existing TrustedTypes policy.
688
+ trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY;
689
+ // Sign local variables required by `sanitize`.
690
+ emptyHTML = trustedTypesPolicy.createHTML('');
691
+ } else {
692
+ // Uninitialized policy, attempt to initialize the internal dompurify policy.
693
+ if (trustedTypesPolicy === undefined) {
694
+ trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript);
695
+ }
696
+ // If creating the internal policy succeeded sign internal variables.
697
+ if (trustedTypesPolicy !== null && typeof emptyHTML === 'string') {
698
+ emptyHTML = trustedTypesPolicy.createHTML('');
699
+ }
700
+ }
701
+ // Prevent further manipulation of configuration.
702
+ // Not available in IE8, Safari 5, etc.
703
+ if (freeze) {
704
+ freeze(cfg);
705
+ }
706
+ CONFIG = cfg;
707
+ };
708
+ /* Keep track of all possible SVG and MathML tags
709
+ * so that we can perform the namespace checks
710
+ * correctly. */
711
+ const ALL_SVG_TAGS = addToSet({}, [...svg$1, ...svgFilters, ...svgDisallowed]);
712
+ const ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]);
713
+ /**
714
+ * @param element a DOM element whose namespace is being checked
715
+ * @returns Return false if the element has a
716
+ * namespace that a spec-compliant parser would never
717
+ * return. Return true otherwise.
718
+ */
719
+ const _checkValidNamespace = function _checkValidNamespace(element) {
720
+ let parent = getParentNode(element);
721
+ // In JSDOM, if we're inside shadow DOM, then parentNode
722
+ // can be null. We just simulate parent in this case.
723
+ if (!parent || !parent.tagName) {
724
+ parent = {
725
+ namespaceURI: NAMESPACE,
726
+ tagName: 'template'
727
+ };
728
+ }
729
+ const tagName = stringToLowerCase(element.tagName);
730
+ const parentTagName = stringToLowerCase(parent.tagName);
731
+ if (!ALLOWED_NAMESPACES[element.namespaceURI]) {
732
+ return false;
733
+ }
734
+ if (element.namespaceURI === SVG_NAMESPACE) {
735
+ // The only way to switch from HTML namespace to SVG
736
+ // is via <svg>. If it happens via any other tag, then
737
+ // it should be killed.
738
+ if (parent.namespaceURI === HTML_NAMESPACE) {
739
+ return tagName === 'svg';
740
+ }
741
+ // The only way to switch from MathML to SVG is via`
742
+ // svg if parent is either <annotation-xml> or MathML
743
+ // text integration points.
744
+ if (parent.namespaceURI === MATHML_NAMESPACE) {
745
+ return tagName === 'svg' && (parentTagName === 'annotation-xml' || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);
746
+ }
747
+ // We only allow elements that are defined in SVG
748
+ // spec. All others are disallowed in SVG namespace.
749
+ return Boolean(ALL_SVG_TAGS[tagName]);
750
+ }
751
+ if (element.namespaceURI === MATHML_NAMESPACE) {
752
+ // The only way to switch from HTML namespace to MathML
753
+ // is via <math>. If it happens via any other tag, then
754
+ // it should be killed.
755
+ if (parent.namespaceURI === HTML_NAMESPACE) {
756
+ return tagName === 'math';
757
+ }
758
+ // The only way to switch from SVG to MathML is via
759
+ // <math> and HTML integration points
760
+ if (parent.namespaceURI === SVG_NAMESPACE) {
761
+ return tagName === 'math' && HTML_INTEGRATION_POINTS[parentTagName];
762
+ }
763
+ // We only allow elements that are defined in MathML
764
+ // spec. All others are disallowed in MathML namespace.
765
+ return Boolean(ALL_MATHML_TAGS[tagName]);
766
+ }
767
+ if (element.namespaceURI === HTML_NAMESPACE) {
768
+ // The only way to switch from SVG to HTML is via
769
+ // HTML integration points, and from MathML to HTML
770
+ // is via MathML text integration points
771
+ if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) {
772
+ return false;
773
+ }
774
+ if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) {
775
+ return false;
776
+ }
777
+ // We disallow tags that are specific for MathML
778
+ // or SVG and should never appear in HTML namespace
779
+ return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]);
780
+ }
781
+ // For XHTML and XML documents that support custom namespaces
782
+ if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && ALLOWED_NAMESPACES[element.namespaceURI]) {
783
+ return true;
784
+ }
785
+ // The code should never reach this place (this means
786
+ // that the element somehow got namespace that is not
787
+ // HTML, SVG, MathML or allowed via ALLOWED_NAMESPACES).
788
+ // Return false just in case.
789
+ return false;
790
+ };
791
+ /**
792
+ * _forceRemove
793
+ *
794
+ * @param node a DOM node
795
+ */
796
+ const _forceRemove = function _forceRemove(node) {
797
+ arrayPush(DOMPurify.removed, {
798
+ element: node
799
+ });
800
+ try {
801
+ // eslint-disable-next-line unicorn/prefer-dom-node-remove
802
+ getParentNode(node).removeChild(node);
803
+ } catch (_) {
804
+ remove(node);
805
+ }
806
+ };
807
+ /**
808
+ * _removeAttribute
809
+ *
810
+ * @param name an Attribute name
811
+ * @param element a DOM node
812
+ */
813
+ const _removeAttribute = function _removeAttribute(name, element) {
814
+ try {
815
+ arrayPush(DOMPurify.removed, {
816
+ attribute: element.getAttributeNode(name),
817
+ from: element
818
+ });
819
+ } catch (_) {
820
+ arrayPush(DOMPurify.removed, {
821
+ attribute: null,
822
+ from: element
823
+ });
824
+ }
825
+ element.removeAttribute(name);
826
+ // We void attribute values for unremovable "is" attributes
827
+ if (name === 'is') {
828
+ if (RETURN_DOM || RETURN_DOM_FRAGMENT) {
829
+ try {
830
+ _forceRemove(element);
831
+ } catch (_) {}
832
+ } else {
833
+ try {
834
+ element.setAttribute(name, '');
835
+ } catch (_) {}
836
+ }
837
+ }
838
+ };
839
+ /**
840
+ * _initDocument
841
+ *
842
+ * @param dirty - a string of dirty markup
843
+ * @return a DOM, filled with the dirty markup
844
+ */
845
+ const _initDocument = function _initDocument(dirty) {
846
+ /* Create a HTML document */
847
+ let doc = null;
848
+ let leadingWhitespace = null;
849
+ if (FORCE_BODY) {
850
+ dirty = '<remove></remove>' + dirty;
851
+ } else {
852
+ /* If FORCE_BODY isn't used, leading whitespace needs to be preserved manually */
853
+ const matches = stringMatch(dirty, /^[\r\n\t ]+/);
854
+ leadingWhitespace = matches && matches[0];
855
+ }
856
+ if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && NAMESPACE === HTML_NAMESPACE) {
857
+ // Root of XHTML doc must contain xmlns declaration (see https://www.w3.org/TR/xhtml1/normative.html#strict)
858
+ dirty = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + dirty + '</body></html>';
859
+ }
860
+ const dirtyPayload = trustedTypesPolicy ? trustedTypesPolicy.createHTML(dirty) : dirty;
861
+ /*
862
+ * Use the DOMParser API by default, fallback later if needs be
863
+ * DOMParser not work for svg when has multiple root element.
864
+ */
865
+ if (NAMESPACE === HTML_NAMESPACE) {
866
+ try {
867
+ doc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE);
868
+ } catch (_) {}
869
+ }
870
+ /* Use createHTMLDocument in case DOMParser is not available */
871
+ if (!doc || !doc.documentElement) {
872
+ doc = implementation.createDocument(NAMESPACE, 'template', null);
873
+ try {
874
+ doc.documentElement.innerHTML = IS_EMPTY_INPUT ? emptyHTML : dirtyPayload;
875
+ } catch (_) {
876
+ // Syntax error if dirtyPayload is invalid xml
877
+ }
878
+ }
879
+ const body = doc.body || doc.documentElement;
880
+ if (dirty && leadingWhitespace) {
881
+ body.insertBefore(document.createTextNode(leadingWhitespace), body.childNodes[0] || null);
882
+ }
883
+ /* Work on whole document or just its body */
884
+ if (NAMESPACE === HTML_NAMESPACE) {
885
+ return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? 'html' : 'body')[0];
886
+ }
887
+ return WHOLE_DOCUMENT ? doc.documentElement : body;
888
+ };
889
+ /**
890
+ * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.
891
+ *
892
+ * @param root The root element or node to start traversing on.
893
+ * @return The created NodeIterator
894
+ */
895
+ const _createNodeIterator = function _createNodeIterator(root) {
896
+ return createNodeIterator.call(root.ownerDocument || root, root,
897
+ // eslint-disable-next-line no-bitwise
898
+ NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION | NodeFilter.SHOW_CDATA_SECTION, null);
899
+ };
900
+ /**
901
+ * _isClobbered
902
+ *
903
+ * @param element element to check for clobbering attacks
904
+ * @return true if clobbered, false if safe
905
+ */
906
+ const _isClobbered = function _isClobbered(element) {
907
+ return element instanceof HTMLFormElement && (typeof element.nodeName !== 'string' || typeof element.textContent !== 'string' || typeof element.removeChild !== 'function' || !(element.attributes instanceof NamedNodeMap) || typeof element.removeAttribute !== 'function' || typeof element.setAttribute !== 'function' || typeof element.namespaceURI !== 'string' || typeof element.insertBefore !== 'function' || typeof element.hasChildNodes !== 'function');
908
+ };
909
+ /**
910
+ * Checks whether the given object is a DOM node.
911
+ *
912
+ * @param value object to check whether it's a DOM node
913
+ * @return true is object is a DOM node
914
+ */
915
+ const _isNode = function _isNode(value) {
916
+ return typeof Node === 'function' && value instanceof Node;
917
+ };
918
+ function _executeHooks(hooks, currentNode, data) {
919
+ arrayForEach(hooks, hook => {
920
+ hook.call(DOMPurify, currentNode, data, CONFIG);
921
+ });
922
+ }
923
+ /**
924
+ * _sanitizeElements
925
+ *
926
+ * @protect nodeName
927
+ * @protect textContent
928
+ * @protect removeChild
929
+ * @param currentNode to check for permission to exist
930
+ * @return true if node was killed, false if left alive
931
+ */
932
+ const _sanitizeElements = function _sanitizeElements(currentNode) {
933
+ let content = null;
934
+ /* Execute a hook if present */
935
+ _executeHooks(hooks.beforeSanitizeElements, currentNode, null);
936
+ /* Check if element is clobbered or can clobber */
937
+ if (_isClobbered(currentNode)) {
938
+ _forceRemove(currentNode);
939
+ return true;
940
+ }
941
+ /* Now let's check the element's type and name */
942
+ const tagName = transformCaseFunc(currentNode.nodeName);
943
+ /* Execute a hook if present */
944
+ _executeHooks(hooks.uponSanitizeElement, currentNode, {
945
+ tagName,
946
+ allowedTags: ALLOWED_TAGS
947
+ });
948
+ /* Detect mXSS attempts abusing namespace confusion */
949
+ if (SAFE_FOR_XML && currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(/<[/\w!]/g, currentNode.innerHTML) && regExpTest(/<[/\w!]/g, currentNode.textContent)) {
950
+ _forceRemove(currentNode);
951
+ return true;
952
+ }
953
+ /* Remove any occurrence of processing instructions */
954
+ if (currentNode.nodeType === NODE_TYPE.progressingInstruction) {
955
+ _forceRemove(currentNode);
956
+ return true;
957
+ }
958
+ /* Remove any kind of possibly harmful comments */
959
+ if (SAFE_FOR_XML && currentNode.nodeType === NODE_TYPE.comment && regExpTest(/<[/\w]/g, currentNode.data)) {
960
+ _forceRemove(currentNode);
961
+ return true;
962
+ }
963
+ /* Remove element if anything forbids its presence */
964
+ if (!(EXTRA_ELEMENT_HANDLING.tagCheck instanceof Function && EXTRA_ELEMENT_HANDLING.tagCheck(tagName)) && (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName])) {
965
+ /* Check if we have a custom element to handle */
966
+ if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName)) {
967
+ if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) {
968
+ return false;
969
+ }
970
+ if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(tagName)) {
971
+ return false;
972
+ }
973
+ }
974
+ /* Keep content except for bad-listed elements */
975
+ if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {
976
+ const parentNode = getParentNode(currentNode) || currentNode.parentNode;
977
+ const childNodes = getChildNodes(currentNode) || currentNode.childNodes;
978
+ if (childNodes && parentNode) {
979
+ const childCount = childNodes.length;
980
+ for (let i = childCount - 1; i >= 0; --i) {
981
+ const childClone = cloneNode(childNodes[i], true);
982
+ childClone.__removalCount = (currentNode.__removalCount || 0) + 1;
983
+ parentNode.insertBefore(childClone, getNextSibling(currentNode));
984
+ }
985
+ }
986
+ }
987
+ _forceRemove(currentNode);
988
+ return true;
989
+ }
990
+ /* Check whether element has a valid namespace */
991
+ if (currentNode instanceof Element && !_checkValidNamespace(currentNode)) {
992
+ _forceRemove(currentNode);
993
+ return true;
994
+ }
995
+ /* Make sure that older browsers don't get fallback-tag mXSS */
996
+ if ((tagName === 'noscript' || tagName === 'noembed' || tagName === 'noframes') && regExpTest(/<\/no(script|embed|frames)/i, currentNode.innerHTML)) {
997
+ _forceRemove(currentNode);
998
+ return true;
999
+ }
1000
+ /* Sanitize element content to be template-safe */
1001
+ if (SAFE_FOR_TEMPLATES && currentNode.nodeType === NODE_TYPE.text) {
1002
+ /* Get the element's text content */
1003
+ content = currentNode.textContent;
1004
+ arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {
1005
+ content = stringReplace(content, expr, ' ');
1006
+ });
1007
+ if (currentNode.textContent !== content) {
1008
+ arrayPush(DOMPurify.removed, {
1009
+ element: currentNode.cloneNode()
1010
+ });
1011
+ currentNode.textContent = content;
1012
+ }
1013
+ }
1014
+ /* Execute a hook if present */
1015
+ _executeHooks(hooks.afterSanitizeElements, currentNode, null);
1016
+ return false;
1017
+ };
1018
+ /**
1019
+ * _isValidAttribute
1020
+ *
1021
+ * @param lcTag Lowercase tag name of containing element.
1022
+ * @param lcName Lowercase attribute name.
1023
+ * @param value Attribute value.
1024
+ * @return Returns true if `value` is valid, otherwise false.
1025
+ */
1026
+ // eslint-disable-next-line complexity
1027
+ const _isValidAttribute = function _isValidAttribute(lcTag, lcName, value) {
1028
+ /* FORBID_ATTR must always win, even if ADD_ATTR predicate would allow it */
1029
+ if (FORBID_ATTR[lcName]) {
1030
+ return false;
1031
+ }
1032
+ /* Make sure attribute cannot clobber */
1033
+ if (SANITIZE_DOM && (lcName === 'id' || lcName === 'name') && (value in document || value in formElement)) {
1034
+ return false;
1035
+ }
1036
+ /* Allow valid data-* attributes: At least one character after "-"
1037
+ (https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes)
1038
+ XML-compatible (https://html.spec.whatwg.org/multipage/infrastructure.html#xml-compatible and http://www.w3.org/TR/xml/#d0e804)
1039
+ We don't need to check the value; it's always URI safe. */
1040
+ if (ALLOW_DATA_ATTR && !FORBID_ATTR[lcName] && regExpTest(DATA_ATTR, lcName)) ; else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR, lcName)) ; else if (EXTRA_ELEMENT_HANDLING.attributeCheck instanceof Function && EXTRA_ELEMENT_HANDLING.attributeCheck(lcName, lcTag)) ; else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) {
1041
+ if (
1042
+ // First condition does a very basic check if a) it's basically a valid custom element tagname AND
1043
+ // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
1044
+ // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
1045
+ _isBasicCustomElement(lcTag) && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(lcTag)) && (CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName) || CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.attributeNameCheck(lcName, lcTag)) ||
1046
+ // Alternative, second condition checks if it's an `is`-attribute, AND
1047
+ // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
1048
+ lcName === 'is' && CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(value))) ; else {
1049
+ return false;
1050
+ }
1051
+ /* Check value is safe. First, is attr inert? If so, is safe */
1052
+ } else if (URI_SAFE_ATTRIBUTES[lcName]) ; else if (regExpTest(IS_ALLOWED_URI$1, stringReplace(value, ATTR_WHITESPACE, ''))) ; else if ((lcName === 'src' || lcName === 'xlink:href' || lcName === 'href') && lcTag !== 'script' && stringIndexOf(value, 'data:') === 0 && DATA_URI_TAGS[lcTag]) ; else if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA, stringReplace(value, ATTR_WHITESPACE, ''))) ; else if (value) {
1053
+ return false;
1054
+ } else ;
1055
+ return true;
1056
+ };
1057
+ /**
1058
+ * _isBasicCustomElement
1059
+ * checks if at least one dash is included in tagName, and it's not the first char
1060
+ * for more sophisticated checking see https://github.com/sindresorhus/validate-element-name
1061
+ *
1062
+ * @param tagName name of the tag of the node to sanitize
1063
+ * @returns Returns true if the tag name meets the basic criteria for a custom element, otherwise false.
1064
+ */
1065
+ const _isBasicCustomElement = function _isBasicCustomElement(tagName) {
1066
+ return tagName !== 'annotation-xml' && stringMatch(tagName, CUSTOM_ELEMENT);
1067
+ };
1068
+ /**
1069
+ * _sanitizeAttributes
1070
+ *
1071
+ * @protect attributes
1072
+ * @protect nodeName
1073
+ * @protect removeAttribute
1074
+ * @protect setAttribute
1075
+ *
1076
+ * @param currentNode to sanitize
1077
+ */
1078
+ const _sanitizeAttributes = function _sanitizeAttributes(currentNode) {
1079
+ /* Execute a hook if present */
1080
+ _executeHooks(hooks.beforeSanitizeAttributes, currentNode, null);
1081
+ const {
1082
+ attributes
1083
+ } = currentNode;
1084
+ /* Check if we have attributes; if not we might have a text node */
1085
+ if (!attributes || _isClobbered(currentNode)) {
1086
+ return;
1087
+ }
1088
+ const hookEvent = {
1089
+ attrName: '',
1090
+ attrValue: '',
1091
+ keepAttr: true,
1092
+ allowedAttributes: ALLOWED_ATTR,
1093
+ forceKeepAttr: undefined
1094
+ };
1095
+ let l = attributes.length;
1096
+ /* Go backwards over all attributes; safely remove bad ones */
1097
+ while (l--) {
1098
+ const attr = attributes[l];
1099
+ const {
1100
+ name,
1101
+ namespaceURI,
1102
+ value: attrValue
1103
+ } = attr;
1104
+ const lcName = transformCaseFunc(name);
1105
+ const initValue = attrValue;
1106
+ let value = name === 'value' ? initValue : stringTrim(initValue);
1107
+ /* Execute a hook if present */
1108
+ hookEvent.attrName = lcName;
1109
+ hookEvent.attrValue = value;
1110
+ hookEvent.keepAttr = true;
1111
+ hookEvent.forceKeepAttr = undefined; // Allows developers to see this is a property they can set
1112
+ _executeHooks(hooks.uponSanitizeAttribute, currentNode, hookEvent);
1113
+ value = hookEvent.attrValue;
1114
+ /* Full DOM Clobbering protection via namespace isolation,
1115
+ * Prefix id and name attributes with `user-content-`
1116
+ */
1117
+ if (SANITIZE_NAMED_PROPS && (lcName === 'id' || lcName === 'name')) {
1118
+ // Remove the attribute with this value
1119
+ _removeAttribute(name, currentNode);
1120
+ // Prefix the value and later re-create the attribute with the sanitized value
1121
+ value = SANITIZE_NAMED_PROPS_PREFIX + value;
1122
+ }
1123
+ /* Work around a security issue with comments inside attributes */
1124
+ if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, value)) {
1125
+ _removeAttribute(name, currentNode);
1126
+ continue;
1127
+ }
1128
+ /* Make sure we cannot easily use animated hrefs, even if animations are allowed */
1129
+ if (lcName === 'attributename' && stringMatch(value, 'href')) {
1130
+ _removeAttribute(name, currentNode);
1131
+ continue;
1132
+ }
1133
+ /* Did the hooks approve of the attribute? */
1134
+ if (hookEvent.forceKeepAttr) {
1135
+ continue;
1136
+ }
1137
+ /* Did the hooks approve of the attribute? */
1138
+ if (!hookEvent.keepAttr) {
1139
+ _removeAttribute(name, currentNode);
1140
+ continue;
1141
+ }
1142
+ /* Work around a security issue in jQuery 3.0 */
1143
+ if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(/\/>/i, value)) {
1144
+ _removeAttribute(name, currentNode);
1145
+ continue;
1146
+ }
1147
+ /* Sanitize attribute content to be template-safe */
1148
+ if (SAFE_FOR_TEMPLATES) {
1149
+ arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {
1150
+ value = stringReplace(value, expr, ' ');
1151
+ });
1152
+ }
1153
+ /* Is `value` valid for this attribute? */
1154
+ const lcTag = transformCaseFunc(currentNode.nodeName);
1155
+ if (!_isValidAttribute(lcTag, lcName, value)) {
1156
+ _removeAttribute(name, currentNode);
1157
+ continue;
1158
+ }
1159
+ /* Handle attributes that require Trusted Types */
1160
+ if (trustedTypesPolicy && typeof trustedTypes === 'object' && typeof trustedTypes.getAttributeType === 'function') {
1161
+ if (namespaceURI) ; else {
1162
+ switch (trustedTypes.getAttributeType(lcTag, lcName)) {
1163
+ case 'TrustedHTML':
1164
+ {
1165
+ value = trustedTypesPolicy.createHTML(value);
1166
+ break;
1167
+ }
1168
+ case 'TrustedScriptURL':
1169
+ {
1170
+ value = trustedTypesPolicy.createScriptURL(value);
1171
+ break;
1172
+ }
1173
+ }
1174
+ }
1175
+ }
1176
+ /* Handle invalid data-* attribute set by try-catching it */
1177
+ if (value !== initValue) {
1178
+ try {
1179
+ if (namespaceURI) {
1180
+ currentNode.setAttributeNS(namespaceURI, name, value);
1181
+ } else {
1182
+ /* Fallback to setAttribute() for browser-unrecognized namespaces e.g. "x-schema". */
1183
+ currentNode.setAttribute(name, value);
1184
+ }
1185
+ if (_isClobbered(currentNode)) {
1186
+ _forceRemove(currentNode);
1187
+ } else {
1188
+ arrayPop(DOMPurify.removed);
1189
+ }
1190
+ } catch (_) {
1191
+ _removeAttribute(name, currentNode);
1192
+ }
1193
+ }
1194
+ }
1195
+ /* Execute a hook if present */
1196
+ _executeHooks(hooks.afterSanitizeAttributes, currentNode, null);
1197
+ };
1198
+ /**
1199
+ * _sanitizeShadowDOM
1200
+ *
1201
+ * @param fragment to iterate over recursively
1202
+ */
1203
+ const _sanitizeShadowDOM = function _sanitizeShadowDOM(fragment) {
1204
+ let shadowNode = null;
1205
+ const shadowIterator = _createNodeIterator(fragment);
1206
+ /* Execute a hook if present */
1207
+ _executeHooks(hooks.beforeSanitizeShadowDOM, fragment, null);
1208
+ while (shadowNode = shadowIterator.nextNode()) {
1209
+ /* Execute a hook if present */
1210
+ _executeHooks(hooks.uponSanitizeShadowNode, shadowNode, null);
1211
+ /* Sanitize tags and elements */
1212
+ _sanitizeElements(shadowNode);
1213
+ /* Check attributes next */
1214
+ _sanitizeAttributes(shadowNode);
1215
+ /* Deep shadow DOM detected */
1216
+ if (shadowNode.content instanceof DocumentFragment) {
1217
+ _sanitizeShadowDOM(shadowNode.content);
1218
+ }
1219
+ }
1220
+ /* Execute a hook if present */
1221
+ _executeHooks(hooks.afterSanitizeShadowDOM, fragment, null);
1222
+ };
1223
+ // eslint-disable-next-line complexity
1224
+ DOMPurify.sanitize = function (dirty) {
1225
+ let cfg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1226
+ let body = null;
1227
+ let importedNode = null;
1228
+ let currentNode = null;
1229
+ let returnNode = null;
1230
+ /* Make sure we have a string to sanitize.
1231
+ DO NOT return early, as this will return the wrong type if
1232
+ the user has requested a DOM object rather than a string */
1233
+ IS_EMPTY_INPUT = !dirty;
1234
+ if (IS_EMPTY_INPUT) {
1235
+ dirty = '<!-->';
1236
+ }
1237
+ /* Stringify, in case dirty is an object */
1238
+ if (typeof dirty !== 'string' && !_isNode(dirty)) {
1239
+ if (typeof dirty.toString === 'function') {
1240
+ dirty = dirty.toString();
1241
+ if (typeof dirty !== 'string') {
1242
+ throw typeErrorCreate('dirty is not a string, aborting');
1243
+ }
1244
+ } else {
1245
+ throw typeErrorCreate('toString is not a function');
1246
+ }
1247
+ }
1248
+ /* Return dirty HTML if DOMPurify cannot run */
1249
+ if (!DOMPurify.isSupported) {
1250
+ return dirty;
1251
+ }
1252
+ /* Assign config vars */
1253
+ if (!SET_CONFIG) {
1254
+ _parseConfig(cfg);
1255
+ }
1256
+ /* Clean up removed elements */
1257
+ DOMPurify.removed = [];
1258
+ /* Check if dirty is correctly typed for IN_PLACE */
1259
+ if (typeof dirty === 'string') {
1260
+ IN_PLACE = false;
1261
+ }
1262
+ if (IN_PLACE) {
1263
+ /* Do some early pre-sanitization to avoid unsafe root nodes */
1264
+ if (dirty.nodeName) {
1265
+ const tagName = transformCaseFunc(dirty.nodeName);
1266
+ if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {
1267
+ throw typeErrorCreate('root node is forbidden and cannot be sanitized in-place');
1268
+ }
1269
+ }
1270
+ } else if (dirty instanceof Node) {
1271
+ /* If dirty is a DOM element, append to an empty document to avoid
1272
+ elements being stripped by the parser */
1273
+ body = _initDocument('<!---->');
1274
+ importedNode = body.ownerDocument.importNode(dirty, true);
1275
+ if (importedNode.nodeType === NODE_TYPE.element && importedNode.nodeName === 'BODY') {
1276
+ /* Node is already a body, use as is */
1277
+ body = importedNode;
1278
+ } else if (importedNode.nodeName === 'HTML') {
1279
+ body = importedNode;
1280
+ } else {
1281
+ // eslint-disable-next-line unicorn/prefer-dom-node-append
1282
+ body.appendChild(importedNode);
1283
+ }
1284
+ } else {
1285
+ /* Exit directly if we have nothing to do */
1286
+ if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT &&
1287
+ // eslint-disable-next-line unicorn/prefer-includes
1288
+ dirty.indexOf('<') === -1) {
1289
+ return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(dirty) : dirty;
1290
+ }
1291
+ /* Initialize the document to work on */
1292
+ body = _initDocument(dirty);
1293
+ /* Check we have a DOM node from the data */
1294
+ if (!body) {
1295
+ return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : '';
1296
+ }
1297
+ }
1298
+ /* Remove first element node (ours) if FORCE_BODY is set */
1299
+ if (body && FORCE_BODY) {
1300
+ _forceRemove(body.firstChild);
1301
+ }
1302
+ /* Get node iterator */
1303
+ const nodeIterator = _createNodeIterator(IN_PLACE ? dirty : body);
1304
+ /* Now start iterating over the created document */
1305
+ while (currentNode = nodeIterator.nextNode()) {
1306
+ /* Sanitize tags and elements */
1307
+ _sanitizeElements(currentNode);
1308
+ /* Check attributes next */
1309
+ _sanitizeAttributes(currentNode);
1310
+ /* Shadow DOM detected, sanitize it */
1311
+ if (currentNode.content instanceof DocumentFragment) {
1312
+ _sanitizeShadowDOM(currentNode.content);
1313
+ }
1314
+ }
1315
+ /* If we sanitized `dirty` in-place, return it. */
1316
+ if (IN_PLACE) {
1317
+ return dirty;
1318
+ }
1319
+ /* Return sanitized string or DOM */
1320
+ if (RETURN_DOM) {
1321
+ if (RETURN_DOM_FRAGMENT) {
1322
+ returnNode = createDocumentFragment.call(body.ownerDocument);
1323
+ while (body.firstChild) {
1324
+ // eslint-disable-next-line unicorn/prefer-dom-node-append
1325
+ returnNode.appendChild(body.firstChild);
1326
+ }
1327
+ } else {
1328
+ returnNode = body;
1329
+ }
1330
+ if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) {
1331
+ /*
1332
+ AdoptNode() is not used because internal state is not reset
1333
+ (e.g. the past names map of a HTMLFormElement), this is safe
1334
+ in theory but we would rather not risk another attack vector.
1335
+ The state that is cloned by importNode() is explicitly defined
1336
+ by the specs.
1337
+ */
1338
+ returnNode = importNode.call(originalDocument, returnNode, true);
1339
+ }
1340
+ return returnNode;
1341
+ }
1342
+ let serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;
1343
+ /* Serialize doctype if allowed */
1344
+ if (WHOLE_DOCUMENT && ALLOWED_TAGS['!doctype'] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) {
1345
+ serializedHTML = '<!DOCTYPE ' + body.ownerDocument.doctype.name + '>\n' + serializedHTML;
1346
+ }
1347
+ /* Sanitize final string template-safe */
1348
+ if (SAFE_FOR_TEMPLATES) {
1349
+ arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {
1350
+ serializedHTML = stringReplace(serializedHTML, expr, ' ');
1351
+ });
1352
+ }
1353
+ return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(serializedHTML) : serializedHTML;
1354
+ };
1355
+ DOMPurify.setConfig = function () {
1356
+ let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1357
+ _parseConfig(cfg);
1358
+ SET_CONFIG = true;
1359
+ };
1360
+ DOMPurify.clearConfig = function () {
1361
+ CONFIG = null;
1362
+ SET_CONFIG = false;
1363
+ };
1364
+ DOMPurify.isValidAttribute = function (tag, attr, value) {
1365
+ /* Initialize shared config vars if necessary. */
1366
+ if (!CONFIG) {
1367
+ _parseConfig({});
1368
+ }
1369
+ const lcTag = transformCaseFunc(tag);
1370
+ const lcName = transformCaseFunc(attr);
1371
+ return _isValidAttribute(lcTag, lcName, value);
1372
+ };
1373
+ DOMPurify.addHook = function (entryPoint, hookFunction) {
1374
+ if (typeof hookFunction !== 'function') {
1375
+ return;
1376
+ }
1377
+ arrayPush(hooks[entryPoint], hookFunction);
1378
+ };
1379
+ DOMPurify.removeHook = function (entryPoint, hookFunction) {
1380
+ if (hookFunction !== undefined) {
1381
+ const index = arrayLastIndexOf(hooks[entryPoint], hookFunction);
1382
+ return index === -1 ? undefined : arraySplice(hooks[entryPoint], index, 1)[0];
1383
+ }
1384
+ return arrayPop(hooks[entryPoint]);
1385
+ };
1386
+ DOMPurify.removeHooks = function (entryPoint) {
1387
+ hooks[entryPoint] = [];
1388
+ };
1389
+ DOMPurify.removeAllHooks = function () {
1390
+ hooks = _createHooksMap();
1391
+ };
1392
+ return DOMPurify;
1393
+ }
1394
+ var purify = createDOMPurify();
1395
+
1396
+ /** The optgroup an option sits in, or null for an ungrouped option. */
1397
+ function parentOptgroupOf(option) {
1398
+ const parent = option === null || option === void 0 ? void 0 : option.parentElement;
1399
+ return parent !== null && parent !== undefined && parent.tagName === 'OPTGROUP' ? parent : null;
1400
+ }
1401
+ /** A Pine icon name: letters, digits and hyphens, such as `hashtag`. Never a URL or file path. */
1402
+ const PINE_ICON_NAME = /^[a-z0-9-]+$/i;
1403
+ /**
1404
+ * An optgroup's `data-icon` when it's a Pine icon name, or null. One definition of a usable group
1405
+ * icon for every mode, checked here rather than trusting `pds-icon` to reject anything else; it is
1406
+ * only ever passed to `pds-icon` as `name`.
1407
+ */
1408
+ function groupIconOf(optgroup) {
1409
+ return iconOf(optgroup);
1410
+ }
1411
+ /** An option's `data-icon` when it's a Pine icon name, or null; the same check as a group's. */
1412
+ function optionIconOf(option) {
1413
+ return iconOf(option);
1414
+ }
1415
+ /** Every `pds-chip` sentiment: a sentiment added to `ChipSentimentType` fails to compile until it's listed. */
1416
+ const BADGE_SENTIMENTS = {
1417
+ accent: true,
1418
+ brand: true,
1419
+ danger: true,
1420
+ info: true,
1421
+ neutral: true,
1422
+ solid: true,
1423
+ subtle: true,
1424
+ success: true,
1425
+ warning: true,
1426
+ };
1427
+ const isBadgeSentiment = (value) => value !== null && Object.prototype.hasOwnProperty.call(BADGE_SENTIMENTS, value);
1428
+ /**
1429
+ * An option's badge from its `data-badge*` attributes, or null without a label. An unknown
1430
+ * sentiment falls back to `neutral`, and an icon that isn't a Pine icon name is dropped: the
1431
+ * badge is a `pds-chip`, whose `icon` also loads URLs.
1432
+ */
1433
+ function optionBadgeOf(option) {
1434
+ return badgeOf(option);
1435
+ }
1436
+ /** An optgroup's badge from its `data-badge*` attributes, or null; the same check as an option's. */
1437
+ function groupBadgeOf(optgroup) {
1438
+ return badgeOf(optgroup);
1439
+ }
1440
+ function badgeOf(element) {
1441
+ var _a;
1442
+ const label = (_a = element.getAttribute('data-badge')) === null || _a === void 0 ? void 0 : _a.trim();
1443
+ if (label === undefined || label === '')
1444
+ return null;
1445
+ const sentiment = element.getAttribute('data-badge-sentiment');
1446
+ const icon = element.getAttribute('data-badge-icon');
1447
+ return {
1448
+ label,
1449
+ sentiment: isBadgeSentiment(sentiment) ? sentiment : 'neutral',
1450
+ icon: icon !== null && PINE_ICON_NAME.test(icon) ? icon : null,
1451
+ };
1452
+ }
1453
+ function iconOf(element) {
1454
+ const icon = element.getAttribute('data-icon');
1455
+ return icon !== null && PINE_ICON_NAME.test(icon) ? icon : null;
1456
+ }
1457
+ /** An option is disabled by its own `disabled` or its optgroup's, as in a native select. */
1458
+ function isOptionDisabled(option) {
1459
+ var _a;
1460
+ if (option === null || option === undefined)
1461
+ return false;
1462
+ return option.hasAttribute('disabled') || ((_a = parentOptgroupOf(option)) === null || _a === void 0 ? void 0 : _a.hasAttribute('disabled')) === true;
1463
+ }
1464
+ /** A group with no option left to choose. It still opens, so its options can be seen. */
1465
+ function isGroupDisabled(group) {
1466
+ return group.options.every(({ option }) => isOptionDisabled(option));
1467
+ }
1468
+ /**
1469
+ * Groups the combobox's filtered items for the panel: each optgroup becomes one entry holding its
1470
+ * options, and ungrouped options stay where they are. Indexes count options in list order, the
1471
+ * same as the inline listbox, so `data-option-index` means the same thing in every mode.
1472
+ *
1473
+ * `position`, when given, orders the entries instead: an ungrouped option or an optgroup it knows
1474
+ * goes where it reports, and the rest keep their place after those. Options from the `options` prop
1475
+ * use it, so a row the data lists between two groups is drawn between them.
1476
+ */
1477
+ function buildPanelEntries(items, position) {
1478
+ const entries = [];
1479
+ const groups = new Map();
1480
+ let index = 0;
1481
+ items.forEach(item => {
1482
+ if (item.tagName !== 'OPTION')
1483
+ return;
1484
+ const option = item;
1485
+ const optgroup = parentOptgroupOf(option);
1486
+ if (optgroup !== null) {
1487
+ let group = groups.get(optgroup);
1488
+ if (!group) {
1489
+ group = { optgroup, label: optgroup.label, icon: groupIconOf(optgroup), badge: groupBadgeOf(optgroup), options: [] };
1490
+ groups.set(optgroup, group);
1491
+ entries.push({ kind: 'group', group });
1492
+ }
1493
+ group.options.push({ option, index: index++ });
1494
+ }
1495
+ else {
1496
+ entries.push({ kind: 'option', option, index: index++ });
1497
+ }
1498
+ });
1499
+ if (position === undefined)
1500
+ return entries;
1501
+ const at = (entry) => { var _a; return (_a = position(entry.kind === 'group' ? entry.group.optgroup : entry.option)) !== null && _a !== void 0 ? _a : Infinity; };
1502
+ // Array.prototype.sort is stable, so entries with no position keep their order.
1503
+ return entries.sort((a, b) => {
1504
+ const [first, second] = [at(a), at(b)];
1505
+ return first === second ? 0 : first < second ? -1 : 1;
1506
+ });
1507
+ }
1508
+ /** The label of the optgroup an option sits in, or null for an ungrouped option. */
1509
+ function groupLabelOf(option) {
1510
+ var _a, _b;
1511
+ return (_b = (_a = parentOptgroupOf(option)) === null || _a === void 0 ? void 0 : _a.label) !== null && _b !== void 0 ? _b : null;
1512
+ }
1513
+ /**
1514
+ * The items Up and Down move through from `current`, one tree level at a time: the panel's rows
1515
+ * (groups and ungrouped options), or the open group's options. Drilled into a group, its row
1516
+ * (drawn as the row back) comes first, above its options, as a tree draws a parent above its children.
1517
+ * Disabled options and groups stay in it, as the APG listbox and tree patterns advise, so they're
1518
+ * announced as unavailable rather than hidden from the keyboard.
1519
+ */
1520
+ function panelColumn(entries, openGroup, current, drilledIn) {
1521
+ const open = openGroup === null ? undefined : findGroup(entries, openGroup);
1522
+ if (open !== undefined) {
1523
+ const options = open.options.map(({ index }) => index);
1524
+ if (drilledIn)
1525
+ return [open.optgroup, ...options];
1526
+ if (typeof current === 'number' && options.includes(current))
1527
+ return options;
1528
+ }
1529
+ return entries.map(entry => (entry.kind === 'group' ? entry.group.optgroup : entry.index));
1530
+ }
1531
+ /** The panel's group for an optgroup, if it's showing. */
1532
+ function findGroup(entries, optgroup) {
1533
+ for (const entry of entries) {
1534
+ if (entry.kind === 'group' && entry.group.optgroup === optgroup)
1535
+ return entry.group;
1536
+ }
1537
+ return undefined;
1538
+ }
1539
+ /** Moving from one group row to another waits this long, so a diagonal trip into the flyout doesn't switch groups. */
1540
+ const SWITCH_DELAY_MS = 120;
1541
+ /** Leaving a group (into the gap beside its flyout, say) waits this long before closing it. */
1542
+ const CLOSE_DELAY_MS = 200;
1543
+ /** Space between the panel's edge and the flyout: --pine-dimension-050 (4px), per the Figma frames. */
1544
+ const FLYOUT_GAP_PX = 4;
1545
+ /** How close the flyout may come to the viewport edge: --pine-dimension-100 (8px). */
1546
+ const VIEWPORT_PADDING_PX = 8;
1547
+ /** A flyout never shrinks below roughly three rows, even when little space is left. */
1548
+ const MIN_FLYOUT_HEIGHT_PX = 120;
1549
+ /**
1550
+ * Opens and closes a group's flyout with hover intent, and keeps the open flyout positioned beside
1551
+ * its group row. The flyout renders inside the row, so moving the pointer into it never leaves
1552
+ * the row; the delays cover the gap between panel and flyout and diagonal moves across rows.
1553
+ */
1554
+ /**
1555
+ * Scrolls `el` into view inside `container` only. A flyout option needs this: the flyout is `fixed`
1556
+ * beside the panel but sits inside it in the DOM, so `scrollIntoView` would also scroll the panel
1557
+ * and the page, moving the flyout's row out from under it.
1558
+ */
1559
+ function scrollIntoViewWithin(container, el) {
1560
+ const bounds = container.getBoundingClientRect();
1561
+ const rect = el.getBoundingClientRect();
1562
+ if (rect.top < bounds.top) {
1563
+ container.scrollTop -= bounds.top - rect.top;
1564
+ }
1565
+ else if (rect.bottom > bounds.bottom) {
1566
+ container.scrollTop += rect.bottom - bounds.bottom;
1567
+ }
1568
+ }
1569
+ class FlyoutController {
1570
+ constructor(getOpenGroup, setOpenGroup) {
1571
+ this.getOpenGroup = getOpenGroup;
1572
+ this.setOpenGroup = setOpenGroup;
1573
+ }
1574
+ /** Pointer entered a group row (or its flyout, which sits inside it). */
1575
+ enter(label) {
1576
+ this.clearClose();
1577
+ const open = this.getOpenGroup();
1578
+ if (open === label) {
1579
+ this.clearSwitch();
1580
+ return;
1581
+ }
1582
+ if (open === null) {
1583
+ this.setOpenGroup(label);
1584
+ return;
1585
+ }
1586
+ this.clearSwitch();
1587
+ this.switchTimer = setTimeout(() => {
1588
+ this.switchTimer = undefined;
1589
+ this.setOpenGroup(label);
1590
+ }, SWITCH_DELAY_MS);
1591
+ }
1592
+ /** Pointer left a group row and its flyout. */
1593
+ leave(label) {
1594
+ this.clearSwitch();
1595
+ if (this.getOpenGroup() !== label)
1596
+ return;
1597
+ this.clearClose();
1598
+ this.closeTimer = setTimeout(() => {
1599
+ this.closeTimer = undefined;
1600
+ if (this.getOpenGroup() === label)
1601
+ this.setOpenGroup(null);
1602
+ }, CLOSE_DELAY_MS);
1603
+ }
1604
+ /**
1605
+ * A click or tap on a group row opens it. It never closes it: on desktop the hover that preceded
1606
+ * the click has already opened it, and touch browsers fire an emulated mouseenter and then click
1607
+ * in the same tap. Closing happens on leaving the row or closing the panel.
1608
+ */
1609
+ open(label) {
1610
+ this.clearTimers();
1611
+ this.setOpenGroup(label);
1612
+ }
1613
+ /**
1614
+ * Keeps `flyout` beside `row`: horizontally against the panel's edge, vertically so its first
1615
+ * option lines up with the row. `fixed` positioning so the panel's scrolling can't clip it,
1616
+ * including when the panel is portaled into a dialog.
1617
+ */
1618
+ position(row, panel, flyout) {
1619
+ if (this.positionedFlyout === flyout && this.stopAutoUpdate)
1620
+ return;
1621
+ this.stopPositioning();
1622
+ this.positionedFlyout = flyout;
1623
+ const reference = {
1624
+ getBoundingClientRect: () => {
1625
+ const panelRect = panel.getBoundingClientRect();
1626
+ const rowRect = row.getBoundingClientRect();
1627
+ return {
1628
+ x: panelRect.x,
1629
+ y: rowRect.y,
1630
+ left: panelRect.left,
1631
+ right: panelRect.right,
1632
+ top: rowRect.top,
1633
+ bottom: rowRect.bottom,
1634
+ width: panelRect.width,
1635
+ height: rowRect.height,
1636
+ };
1637
+ },
1638
+ contextElement: row,
1639
+ };
1640
+ // The flyout's own top padding, so its first option, not its edge, lines up with the row.
1641
+ const flyoutPaddingTop = parseFloat(getComputedStyle(flyout).paddingTop) || 0;
1642
+ const update = () => floatingUi_dom.computePosition(reference, flyout, {
1643
+ placement: 'right-start',
1644
+ strategy: 'fixed',
1645
+ middleware: [
1646
+ floatingUi_dom.offset({ mainAxis: FLYOUT_GAP_PX, crossAxis: -flyoutPaddingTop }),
1647
+ floatingUi_dom.flip({ fallbackPlacements: ['left-start'] }),
1648
+ floatingUi_dom.shift({ padding: VIEWPORT_PADDING_PX }),
1649
+ // A long group scrolls inside the flyout instead of running off the viewport.
1650
+ floatingUi_dom.size({
1651
+ padding: VIEWPORT_PADDING_PX,
1652
+ apply({ availableHeight }) {
1653
+ flyout.style.maxHeight = `${Math.max(availableHeight, MIN_FLYOUT_HEIGHT_PX)}px`;
1654
+ },
1655
+ }),
1656
+ // Hidden with its row when the panel scrolls the row out of view.
1657
+ floatingUi_dom.hide({ strategy: 'referenceHidden' }),
1658
+ ],
1659
+ }).then(({ x, y, middlewareData }) => {
1660
+ var _a;
1661
+ // It starts hidden (see the stylesheet) so it never flashes in the row before it's placed.
1662
+ Object.assign(flyout.style, {
1663
+ position: 'fixed',
1664
+ left: `${x}px`,
1665
+ top: `${y}px`,
1666
+ visibility: ((_a = middlewareData.hide) === null || _a === void 0 ? void 0 : _a.referenceHidden) === true ? 'hidden' : 'visible',
1667
+ });
1668
+ const reveal = this.pendingReveal;
1669
+ this.pendingReveal = undefined;
1670
+ if (reveal !== undefined && flyout.contains(reveal))
1671
+ scrollIntoViewWithin(flyout, reveal);
1672
+ });
1673
+ this.stopAutoUpdate = floatingUi_dom.autoUpdate(reference, flyout, () => {
1674
+ void update();
1675
+ });
1676
+ }
1677
+ /**
1678
+ * Scrolls `option` into view inside its flyout. Before the flyout's first placement its height
1679
+ * isn't capped yet, so the option looks visible; it's revealed again once the placement lands.
1680
+ */
1681
+ reveal(flyout, option) {
1682
+ scrollIntoViewWithin(flyout, option);
1683
+ if (flyout.style.maxHeight === '')
1684
+ this.pendingReveal = option;
1685
+ }
1686
+ stopPositioning() {
1687
+ var _a;
1688
+ (_a = this.stopAutoUpdate) === null || _a === void 0 ? void 0 : _a.call(this);
1689
+ this.stopAutoUpdate = undefined;
1690
+ this.positionedFlyout = undefined;
1691
+ this.pendingReveal = undefined;
1692
+ }
1693
+ /** The panel closed or the component left the page. */
1694
+ reset() {
1695
+ this.clearTimers();
1696
+ this.stopPositioning();
1697
+ }
1698
+ clearTimers() {
1699
+ this.clearSwitch();
1700
+ this.clearClose();
1701
+ }
1702
+ clearSwitch() {
1703
+ if (this.switchTimer !== undefined)
1704
+ clearTimeout(this.switchTimer);
1705
+ this.switchTimer = undefined;
1706
+ }
1707
+ clearClose() {
1708
+ if (this.closeTimer !== undefined)
1709
+ clearTimeout(this.closeTimer);
1710
+ this.closeTimer = undefined;
1711
+ }
1712
+ }
1713
+
1714
+ const pdsComboboxCss = () => `:host{display:block}:host([truncate]){display:block;min-width:0}:host([aria-disabled=true]) .pds-combobox__input-icon{color:var(--pine-color-text-disabled);pointer-events:none}.pds-combobox{position:relative}.pds-combobox__label{color:var(--pine-color-text-label);display:block;font:var(--pine-typography-body-medium);letter-spacing:var(--pine-letter-spacing);-webkit-margin-after:var(--pine-dimension-2xs);margin-block-end:var(--pine-dimension-2xs)}.pds-combobox__input-wrapper{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;position:relative;width:100%}.pds-combobox__input{background:var(--pine-color-background-container);border:var(--pine-border);border-radius:var(--pine-dimension-125);-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--pine-color-text-strong);-ms-flex:1;flex:1;font:var(--pine-typography-body);padding:var(--pine-dimension-xs) var(--pine-dimension-450) var(--pine-dimension-xs) var(--pine-dimension-150);-webkit-transition:border-color var(--pine-motion-duration-base) ease;transition:border-color var(--pine-motion-duration-base) ease;width:100%}.pds-combobox__input:hover:not(:disabled){border-color:var(--pine-color-border-hover)}.pds-combobox__input:disabled{background:var(--pine-color-background-container-disabled);border-color:var(--pine-color-border-disabled);color:var(--pine-color-text-disabled);cursor:not-allowed}.pds-combobox__input:disabled::-webkit-input-placeholder{color:var(--pine-color-text-placeholder-disabled)}.pds-combobox__input:disabled::-moz-placeholder{color:var(--pine-color-text-placeholder-disabled)}.pds-combobox__input:disabled:-ms-input-placeholder{color:var(--pine-color-text-placeholder-disabled)}.pds-combobox__input:disabled::-ms-input-placeholder{color:var(--pine-color-text-placeholder-disabled)}.pds-combobox__input:disabled::placeholder{color:var(--pine-color-text-placeholder-disabled)}.pds-combobox__input:focus-visible{border-color:var(--pine-color-border-active);outline:var(--pine-outline-focus);outline-offset:var(--pine-border-width)}.pds-combobox__input::-webkit-input-placeholder{color:var(--pine-color-text-placeholder)}.pds-combobox__input::-moz-placeholder{color:var(--pine-color-text-placeholder)}.pds-combobox__input:-ms-input-placeholder{color:var(--pine-color-text-placeholder)}.pds-combobox__input::-ms-input-placeholder{color:var(--pine-color-text-placeholder)}.pds-combobox__input::placeholder{color:var(--pine-color-text-placeholder)}.pds-combobox__input.pds-combobox__input--invalid{background:var(--pine-color-red-050);border-color:var(--pine-color-border-danger)}:host-context([data-theme=dark]) .pds-combobox__input.pds-combobox__input--invalid{background:var(--pine-color-red-950)}.pds-combobox__input.pds-combobox__input--invalid:hover:not(:disabled){border-color:var(--pine-color-border-danger)}.pds-combobox__input.pds-combobox__input--invalid:focus-visible{outline-color:var(--pine-color-focus-ring-danger)}.pds-combobox__input-icon{color:var(--pine-color-text-secondary);inset-inline-end:var(--pine-dimension-150);pointer-events:none;position:absolute;z-index:calc(var(--pine-z-index-raised) - 1)}.pds-combobox__helper{color:var(--pine-color-text-message);font:var(--pine-typography-body-sm-medium);-webkit-margin-before:var(--pine-dimension-2xs);margin-block-start:var(--pine-dimension-2xs)}.pds-combobox__error{-ms-flex-align:start;align-items:flex-start;color:var(--pine-color-text-message-danger);display:-ms-flexbox;display:flex;font:var(--pine-typography-body-sm-medium);gap:var(--pine-dimension-2xs);-webkit-margin-before:var(--pine-dimension-2xs);margin-block-start:var(--pine-dimension-2xs)}.pds-combobox__error pds-icon{-ms-flex-negative:0;flex-shrink:0;-webkit-margin-before:var(--pine-dimension-025);margin-block-start:var(--pine-dimension-025)}.pds-combobox__listbox{--pds-combobox-open-from:calc(var(--pine-dimension-2xs) * -1);-webkit-animation:pds-combobox-open var(--pine-motion-duration-base) var(--pine-motion-easing-out);animation:pds-combobox-open var(--pine-motion-duration-base) var(--pine-motion-easing-out);background:var(--pine-color-background-overlay);border:0;border-radius:var(--pine-dimension-125);-webkit-box-shadow:var(--pine-box-shadow);box-shadow:var(--pine-box-shadow);-webkit-box-sizing:border-box;box-sizing:border-box;list-style:none;margin:0;min-width:calc(220px + var(--pine-dimension-xs) * 2);overflow-y:auto;padding:var(--pine-dimension-xs);position:absolute;width:calc(236px + var(--pine-dimension-xs) * 2);z-index:var(--pine-z-index-raised)}.pds-combobox__listbox[data-placement^=top]{--pds-combobox-open-from:var(--pine-dimension-2xs)}@-webkit-keyframes pds-combobox-open{0%{-webkit-margin-before:var(--pds-combobox-open-from);margin-block-start:var(--pds-combobox-open-from);opacity:0}40%{opacity:1}}@keyframes pds-combobox-open{0%{-webkit-margin-before:var(--pds-combobox-open-from);margin-block-start:var(--pds-combobox-open-from);opacity:0}40%{opacity:1}}.pds-combobox__option{-ms-flex-align:center;align-items:center;background:transparent;border-radius:var(--pine-dimension-xs);color:var(--pine-color-text-secondary);cursor:pointer;display:-ms-flexbox;display:flex;font:var(--pine-typography-body);-ms-flex-pack:justify;justify-content:space-between;padding:var(--pine-dimension-xs) var(--pine-dimension-sm);position:relative;-webkit-transition:background 0.15s;transition:background 0.15s}.pds-combobox__option:focus-visible{outline:0}.pds-combobox__option.pds-combobox__option--layout .pds-combobox__option-layout-wrapper{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;width:100%}.pds-combobox__option:last-child{-webkit-margin-after:0;margin-block-end:0}.pds-combobox__option--highlighted{background:var(--pine-color-background-muted)}.pds-combobox__option--disabled,.pds-combobox__group-row--disabled>.pds-combobox__group-row-trigger,.pds-combobox__group-back--disabled>.pds-combobox__group-back-trigger,.pds-combobox__group--disabled>.pds-combobox__group-label{color:var(--pine-color-text-disabled)}.pds-combobox__option--disabled{cursor:not-allowed}.pds-combobox__option--disabled .pds-combobox__option-chip,.pds-combobox__option--disabled .pds-combobox__option-layout-wrapper,.pds-combobox__option--disabled .pds-combobox__option-badge,.pds-combobox__group-row--disabled>.pds-combobox__group-row-trigger>.pds-combobox__group-badge,.pds-combobox__group--disabled>.pds-combobox__group-label>.pds-combobox__group-badge{opacity:0.5}.pds-combobox__option-label{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;gap:var(--pine-dimension-xs);min-width:0;overflow-wrap:anywhere}.pds-combobox__option-icon{-ms-flex-negative:0;flex-shrink:0}.pds-combobox__option-chip{min-width:0;overflow-wrap:anywhere}.pds-combobox__listbox--truncate .pds-combobox__option-label{-ms-flex:1 1 auto;flex:1 1 auto;overflow-wrap:normal}.pds-combobox__listbox--truncate .pds-combobox__option-check{-ms-flex-negative:0;flex-shrink:0}.pds-combobox__option--with-badge{-webkit-column-gap:var(--pine-dimension-xs);-moz-column-gap:var(--pine-dimension-xs);column-gap:var(--pine-dimension-xs)}.pds-combobox__option-badge,.pds-combobox__group-badge{-ms-flex-negative:0;flex-shrink:0;isolation:isolate;margin-block:calc(var(--pine-dimension-025) * -1);-webkit-margin-start:auto;margin-inline-start:auto}.pds-combobox__option--with-badge .pds-combobox__option-check{-webkit-margin-start:calc(var(--pine-dimension-150) - var(--pine-dimension-xs));margin-inline-start:calc(var(--pine-dimension-150) - var(--pine-dimension-xs))}.pds-combobox__option-check{color:currentColor;font-size:var(--pine-dimension-150);-webkit-margin-start:var(--pine-dimension-150);margin-inline-start:var(--pine-dimension-150)}.pds-combobox__group-label{color:var(--pine-color-text-tertiary);cursor:default;font:var(--pine-typography-heading-caption);-webkit-margin-after:var(--pine-dimension-2xs);margin-block-end:var(--pine-dimension-2xs);-webkit-margin-before:var(--pine-dimension-150);margin-block-start:var(--pine-dimension-150);padding:var(--pine-dimension-2xs) var(--pine-dimension-sm);text-transform:uppercase}.pds-combobox__group-label:first-child{-webkit-margin-before:0;margin-block-start:0}.pds-combobox__group{list-style:none;-webkit-margin-before:var(--pine-dimension-150);margin-block-start:var(--pine-dimension-150)}.pds-combobox__group:first-child{-webkit-margin-before:0;margin-block-start:0}.pds-combobox__group-list{list-style:none;margin:0;padding:0}.pds-combobox__listbox--grouped .pds-combobox__group-list{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.pds-combobox__group-label--with-icon{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;gap:var(--pine-dimension-xs)}.pds-combobox__group-icon{-ms-flex-negative:0;flex-shrink:0}.pds-combobox__group-label--with-badge{-ms-flex-align:center;align-items:center;-webkit-column-gap:var(--pine-dimension-xs);-moz-column-gap:var(--pine-dimension-xs);column-gap:var(--pine-dimension-xs);display:-ms-flexbox;display:flex}.pds-combobox__group-label-text{min-width:0;overflow-wrap:anywhere}.pds-combobox__group-label>.pds-combobox__group-badge{margin-block:calc(var(--pine-dimension-xs) * -1);text-transform:none}.pds-combobox__group-row{list-style:none;position:relative}.pds-combobox__group-row-trigger{-ms-flex-align:center;align-items:center;border-radius:var(--pine-dimension-xs);color:var(--pine-color-text-secondary);cursor:pointer;display:-ms-flexbox;display:flex;font:var(--pine-typography-body);gap:var(--pine-dimension-xs);-ms-flex-pack:justify;justify-content:space-between;padding:var(--pine-dimension-xs) var(--pine-dimension-150);-webkit-transition:background 0.15s;transition:background 0.15s}.pds-combobox__group-row--open>.pds-combobox__group-row-trigger,.pds-combobox__group-row--highlighted>.pds-combobox__group-row-trigger,.pds-combobox__group-back--highlighted>.pds-combobox__group-row-trigger{background:var(--pine-color-background-muted)}.pds-combobox__listbox--pointer-hover .pds-combobox__group-row-trigger:hover{background:var(--pine-color-background-muted)}.pds-combobox__listbox--drill-in,.pds-combobox__listbox--drill-out{overflow-x:hidden}.pds-combobox__listbox--drill-in,.pds-combobox__listbox--drill-out:dir(rtl),.pds-combobox__panel-search--drill-out:dir(rtl){--pds-combobox-drill-from:var(--pine-dimension-sm)}.pds-combobox__listbox--drill-out,.pds-combobox__listbox--drill-in:dir(rtl),.pds-combobox__panel-search--drill-out{--pds-combobox-drill-from:calc(var(--pine-dimension-sm) * -1)}.pds-combobox__listbox--drill-in .pds-combobox__drill-in-options>li,.pds-combobox__listbox--drill-in .pds-combobox__group-back-trigger>*,.pds-combobox__listbox--drill-out>li,.pds-combobox__panel-search--drill-out>*{-webkit-animation:pds-combobox-drill var(--pine-motion-duration-slow) var(--pine-motion-easing-out);animation:pds-combobox-drill var(--pine-motion-duration-slow) var(--pine-motion-easing-out)}@-webkit-keyframes pds-combobox-drill{from{opacity:0;-webkit-transform:translateX(var(--pds-combobox-drill-from));transform:translateX(var(--pds-combobox-drill-from))}}@keyframes pds-combobox-drill{from{opacity:0;-webkit-transform:translateX(var(--pds-combobox-drill-from));transform:translateX(var(--pds-combobox-drill-from))}}.pds-combobox__listbox--height-glide{-webkit-animation:pds-combobox-open var(--pine-motion-duration-base) var(--pine-motion-easing-out), pds-combobox-height-glide var(--pine-motion-duration-base) var(--pine-motion-easing-out);animation:pds-combobox-open var(--pine-motion-duration-base) var(--pine-motion-easing-out), pds-combobox-height-glide var(--pine-motion-duration-base) var(--pine-motion-easing-out)}.pds-combobox__listbox--height-glide,.pds-combobox__listbox--height-glide .pds-combobox__listbox-options,.pds-combobox__listbox--height-glide .pds-combobox__drill-in-options,.pds-combobox__listbox--height-hold,.pds-combobox__listbox--height-hold .pds-combobox__listbox-options,.pds-combobox__listbox--height-hold .pds-combobox__drill-in-options{overflow-y:hidden}@-webkit-keyframes pds-combobox-height-glide{from{height:var(--pds-combobox-glide-from)}to{height:var(--pds-combobox-glide-to)}}@keyframes pds-combobox-height-glide{from{height:var(--pds-combobox-glide-from)}to{height:var(--pds-combobox-glide-to)}}.pds-combobox__group-row--keyboard>.pds-combobox__group-row-trigger,.pds-combobox__group-back--keyboard>.pds-combobox__group-row-trigger,.pds-combobox__option.pds-combobox__option--keyboard{outline:var(--pine-outline-focus);outline-offset:calc(var(--pine-border-width) * -2)}.pds-combobox__group-row-label{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;gap:var(--pine-dimension-xs);min-width:0;overflow-wrap:anywhere}.pds-combobox__group-row-caret{-ms-flex-negative:0;flex-shrink:0}.pds-combobox__listbox--grouped,.pds-combobox__flyout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;padding:var(--pine-dimension-2xs)}.pds-combobox__listbox--grouped .pds-combobox__option,.pds-combobox__listbox--grouped .pds-combobox__group-label{padding-inline:var(--pine-dimension-150)}.pds-combobox__listbox--grouped .pds-combobox__group-label{font:var(--pine-typography-body-sm);margin-block:0;padding-block:var(--pine-dimension-xs) var(--pine-dimension-2xs);text-transform:none}.pds-combobox__listbox--grouped .pds-combobox__group{-webkit-margin-before:0;margin-block-start:0}.pds-combobox__flyout{background:var(--pine-color-background-overlay);border-radius:var(--pine-dimension-125);-webkit-box-shadow:var(--pine-box-shadow);box-shadow:var(--pine-box-shadow);-webkit-box-sizing:border-box;box-sizing:border-box;list-style:none;margin:0;overflow-y:auto;position:fixed;visibility:hidden;width:-webkit-max-content;width:-moz-max-content;width:max-content;z-index:1}.pds-combobox__listbox.pds-combobox__listbox--grouped{min-width:calc(220px + var(--pine-dimension-2xs) * 2);width:calc(236px + var(--pine-dimension-2xs) * 2)}.pds-combobox__listbox.pds-combobox__listbox--with-search{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;min-width:220px;overflow:hidden;padding:0;width:236px}.pds-combobox__listbox-options{-ms-flex:1;flex:1;list-style:none;margin:0;min-height:0;overflow-y:auto;padding:var(--pine-dimension-xs)}.pds-combobox__listbox-options.pds-combobox__listbox--grouped{padding:var(--pine-dimension-2xs)}.pds-combobox__panel-search{-ms-flex-align:center;align-items:center;-webkit-border-after:var(--pine-border);border-block-end:var(--pine-border);border-block-end-color:var(--pine-color-border-active);display:-ms-flexbox;display:flex;-ms-flex-negative:0;flex-shrink:0;gap:var(--pine-dimension-xs);padding:var(--pine-dimension-150) var(--pine-dimension-sm)}.pds-combobox__panel-search pds-icon{color:var(--pine-color-text-muted);-ms-flex-negative:0;flex-shrink:0}.pds-combobox__panel-search-input{background:transparent;border:0;color:var(--pine-color-text-strong);-ms-flex:1;flex:1;font:var(--pine-typography-body);letter-spacing:var(--pine-letter-spacing);min-width:0;outline:none;padding:0}.pds-combobox__panel-search-input::-webkit-input-placeholder{color:var(--pine-color-text-placeholder)}.pds-combobox__panel-search-input::-moz-placeholder{color:var(--pine-color-text-placeholder)}.pds-combobox__panel-search-input:-ms-input-placeholder{color:var(--pine-color-text-placeholder)}.pds-combobox__panel-search-input::-ms-input-placeholder{color:var(--pine-color-text-placeholder)}.pds-combobox__panel-search-input::placeholder{color:var(--pine-color-text-placeholder)}.pds-combobox__listbox--grouped.pds-combobox__listbox--grouped:has(>.pds-combobox__group-back){display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;padding:0}.pds-combobox__listbox.pds-combobox__listbox--grouped:has(>.pds-combobox__group-back){min-width:220px;width:236px}.pds-combobox__group-back{display:-ms-flexbox;display:flex;-ms-flex:1 1 auto;flex:1 1 auto;-ms-flex-direction:column;flex-direction:column;list-style:none;min-height:0}.pds-combobox__group-back-trigger{-ms-flex-negative:0;flex-shrink:0;-ms-flex-pack:start;justify-content:flex-start}.pds-combobox__listbox-options--drilled-in:focus{outline:none}:where(.pds-combobox__listbox--grouped) .pds-combobox__group-back-trigger{background-color:var(--pine-color-background-overlay);-webkit-border-after:var(--pine-border);border-block-end:var(--pine-border);border-block-end-color:var(--pine-color-border-active);border-radius:0;color:var(--pine-color-text-secondary);font:var(--pine-typography-body);letter-spacing:var(--pine-letter-spacing);padding:var(--pine-dimension-150) var(--pine-dimension-sm);position:relative}:where(.pds-combobox__listbox--grouped) .pds-combobox__group-back-trigger .pds-combobox__group-row-caret{margin-inline:calc(var(--pine-dimension-2xs) * -1) var(--pine-dimension-2xs)}.pds-combobox__listbox--grouped .pds-combobox__group-back>.pds-combobox__group-back-trigger{isolation:isolate}.pds-combobox__listbox--grouped .pds-combobox__group-back>.pds-combobox__group-back-trigger::before{border-radius:var(--pine-dimension-xs);content:"";inset:var(--pine-dimension-2xs);position:absolute;-webkit-transition:background 0.15s;transition:background 0.15s;z-index:-1}.pds-combobox__listbox--pointer-hover.pds-combobox__listbox--grouped .pds-combobox__group-back>.pds-combobox__group-back-trigger:hover,.pds-combobox__listbox--grouped .pds-combobox__group-back--highlighted>.pds-combobox__group-back-trigger{background-color:var(--pine-color-background-overlay)}.pds-combobox__listbox--pointer-hover.pds-combobox__listbox--grouped .pds-combobox__group-back>.pds-combobox__group-back-trigger:hover::before,.pds-combobox__listbox--grouped .pds-combobox__group-back--highlighted>.pds-combobox__group-back-trigger::before{background:var(--pine-color-background-muted)}.pds-combobox__listbox--grouped .pds-combobox__group-back--keyboard>.pds-combobox__group-back-trigger{outline:none}.pds-combobox__listbox--grouped .pds-combobox__group-back--keyboard>.pds-combobox__group-back-trigger::before{outline:var(--pine-outline-focus);outline-offset:calc(var(--pine-border-width) * -2)}.pds-combobox__drill-in-options{display:-ms-flexbox;display:flex;-ms-flex:1 1 auto;flex:1 1 auto;-ms-flex-direction:column;flex-direction:column;list-style:none;margin:0;min-height:0;overflow-x:hidden;overflow-y:auto;padding:var(--pine-dimension-2xs)}.visually-hidden{border:0;clip:rect(0 0 0 0);-webkit-clip-path:polygon(0 0, 0 0, 0 0);clip-path:polygon(0 0, 0 0, 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.pds-combobox__loading{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;padding:var(--pine-dimension-150)}.pds-combobox__empty{color:var(--pine-color-text-tertiary);padding:var(--pine-dimension-150) var(--pine-dimension-sm);text-align:center}.pds-combobox__load-more{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;padding:var(--pine-dimension-150)}:host(.pds-combobox-dropdown-portal) .pds-combobox__listbox{position:fixed;z-index:var(--pine-z-index-priority)}.pds-combobox__button-trigger{-ms-flex-align:center;align-items:center;background:var(--color-background-default, var(--pine-color-secondary));border:var(--pine-border);border-radius:var(--pine-border-radius-full);-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--color-text-default, var(--pine-color-text-inverse-emphasis));cursor:pointer;display:-ms-flexbox;display:flex;font:var(--pine-typography-body);-ms-flex-pack:justify;justify-content:space-between;min-height:var(--pine-dimension-450);outline:none;padding:0 var(--pine-dimension-sm);-webkit-transition:border-color 0.15s, background 0.15s, -webkit-box-shadow 0.15s;transition:border-color 0.15s, background 0.15s, -webkit-box-shadow 0.15s;transition:border-color 0.15s, box-shadow 0.15s, background 0.15s;transition:border-color 0.15s, box-shadow 0.15s, background 0.15s, -webkit-box-shadow 0.15s;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}.pds-combobox__button-trigger .pds-combobox__button-trigger-layout-wrapper{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex:1;flex:1}.pds-combobox__button-trigger .trigger-content{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;width:100%}.pds-combobox__button-trigger:focus-visible{border-color:var(--color-border-focus, var(--pine-color-border));-webkit-box-shadow:0 0 0 2px var(--color-outline, var(--pine-color-focus-ring));box-shadow:0 0 0 2px var(--color-outline, var(--pine-color-focus-ring))}.pds-combobox__button-trigger:hover{background:var(--color-background-hover, var(--pine-color-secondary-hover));border-color:var(--color-border-hover, var(--pine-color-border-hover))}.pds-combobox__button-trigger[aria-disabled=true],.pds-combobox__button-trigger:disabled{background:var(--color-background-disabled, var(--pine-color-secondary-disabled));border-color:var(--color-border-disabled, var(--pine-color-border-disabled));color:var(--color-text-disabled, var(--pine-color-text-secondary-disabled));cursor:not-allowed;opacity:0.6}.pds-combobox__button-trigger-label{color:inherit;-ms-flex:1 1 auto;flex:1 1 auto;min-width:0;overflow-wrap:anywhere;text-align:start}.pds-combobox__button-trigger-label--with-icon{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;gap:var(--pine-dimension-xs)}.pds-combobox__button-trigger-label--value-in{-webkit-animation:pds-combobox-value-in var(--pine-motion-duration-base) var(--pine-motion-easing-out);animation:pds-combobox-value-in var(--pine-motion-duration-base) var(--pine-motion-easing-out)}@-webkit-keyframes pds-combobox-value-in{from{opacity:0}}@keyframes pds-combobox-value-in{from{opacity:0}}.pds-combobox__button-trigger-icon{block-size:var(--pine-dimension-sm);-ms-flex-negative:0;flex-shrink:0;inline-size:var(--pine-dimension-sm)}.pds-combobox__button-trigger--truncate{max-width:100%}.pds-combobox__button-trigger--truncate .pds-combobox__button-trigger-label{overflow-wrap:normal}.pds-combobox__button-trigger--truncate .pds-combobox__button-trigger-chevron{-ms-flex-negative:0;flex-shrink:0}.pds-combobox__button-trigger-text,.pds-combobox__listbox--truncate .pds-combobox__option-text{display:block;-ms-flex:1 1 auto;flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pds-combobox__button-trigger--input-shape{border-radius:var(--pine-dimension-125);font:var(--pine-typography-body);letter-spacing:var(--pine-letter-spacing);min-height:var(--pine-dimension-450);padding:calc(var(--pine-dimension-xs) - var(--pine-border-width)) var(--pine-dimension-150)}.pds-combobox__button-trigger--secondary.pds-combobox__button-trigger--input-shape{--color-background-hover:var(--pine-color-secondary)}.pds-combobox__button-trigger--secondary.pds-combobox__button-trigger--input-shape:not([aria-disabled=true]) .pds-combobox__button-trigger-label--placeholder{color:var(--pine-color-text-muted)}.pds-combobox__button-trigger-chevron{color:currentColor;-webkit-margin-start:var(--pine-dimension-150);margin-inline-start:var(--pine-dimension-150)}.pds-combobox__button-trigger--primary{--color-background-default:var(--pine-color-primary);--color-background-hover:var(--pine-color-primary-hover);--color-background-disabled:var(--pine-color-primary-disabled);--color-border-default:var(--pine-color-primary);--color-border-hover:var(--pine-color-primary-hover);--color-border-disabled:var(--pine-color-primary-disabled);--color-border-focus:var(--pine-color-primary);--color-text-default:var(--pine-color-text-primary);--color-text-disabled:var(--pine-color-text-primary-disabled);--color-outline:var(--pine-color-focus-ring)}.pds-combobox__button-trigger--accent{--color-background-default:var(--pine-color-accent);--color-background-hover:var(--pine-color-accent-hover);--color-background-disabled:var(--pine-color-accent-disabled);--color-border-default:var(--pine-color-accent);--color-border-hover:var(--pine-color-accent-hover);--color-border-disabled:var(--pine-color-accent-disabled);--color-border-focus:var(--pine-color-accent);--color-text-default:var(--pine-color-text-primary);--color-text-disabled:var(--pine-color-text-accent-disabled);--color-outline:var(--pine-color-focus-ring)}.pds-combobox__button-trigger--secondary{--color-background-default:var(--pine-color-secondary);--color-background-hover:var(--pine-color-secondary-hover);--color-background-disabled:var(--pine-color-secondary-disabled);--color-border-default:var(--pine-color-border);--color-border-hover:var(--pine-color-border-hover);--color-border-disabled:var(--pine-color-border-disabled);--color-border-focus:var(--pine-color-border);--color-text-default:var(--pine-color-text-secondary);--color-text-disabled:var(--pine-color-text-secondary-disabled);--color-outline:var(--pine-color-focus-ring)}.pds-combobox__button-trigger--destructive{--color-background-default:var(--pine-color-danger);--color-background-hover:var(--pine-color-danger-hover);--color-background-disabled:var(--pine-color-danger-disabled);--color-border-default:var(--pine-color-danger);--color-border-hover:var(--pine-color-danger-hover);--color-border-disabled:var(--pine-color-danger-disabled);--color-border-focus:var(--pine-color-danger);--color-text-default:var(--pine-color-white);--color-text-disabled:var(--pine-color-text-danger-disabled);--color-outline:var(--pine-color-focus-ring-danger)}[data-layout]{border-radius:var(--pine-dimension-125);padding-block:var(--pine-dimension-xs)}.pds-combobox__chip-trigger{-ms-flex-align:center;align-items:center;border-radius:var(--pine-dimension-sm);-webkit-box-sizing:border-box;box-sizing:border-box;cursor:pointer;display:-ms-inline-flexbox;display:inline-flex;font:var(--pine-typography-body-medium);-ms-flex-pack:justify;justify-content:space-between;outline:none;padding-block:var(--pine-dimension-025);padding-inline:var(--pine-dimension-150);-webkit-transition:all 0.15s ease;transition:all 0.15s ease;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}.pds-combobox__chip-trigger .pds-combobox__chip-trigger-layout-wrapper{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex:1;flex:1}.pds-combobox__chip-trigger .trigger-content{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;width:100%}.pds-combobox__chip-trigger:focus-visible{outline:var(--pine-outline-focus);outline-offset:var(--pine-border-width)}.pds-combobox__chip-trigger[aria-disabled=true]{cursor:not-allowed;opacity:0.6}.pds-combobox__chip-trigger-label{color:inherit;-ms-flex:1 1 auto;flex:1 1 auto;text-align:start}.pds-combobox__chip-trigger-chevron{color:currentColor;-webkit-margin-start:var(--pine-dimension-150);margin-inline-start:var(--pine-dimension-150)}.pds-combobox__chip-trigger-icon{-webkit-margin-end:var(--pine-dimension-2xs);margin-inline-end:var(--pine-dimension-2xs)}.pds-combobox__chip-trigger--neutral,.pds-combobox__chip-trigger--accent,.pds-combobox__chip-trigger--success,.pds-combobox__chip-trigger--warning,.pds-combobox__chip-trigger--danger,.pds-combobox__chip-trigger--info{background:var(--chip-bg);border:var(--pine-border-width) solid var(--chip-border);color:var(--chip-text)}.pds-combobox__chip-trigger--neutral:hover:not([aria-disabled=true]),.pds-combobox__chip-trigger--accent:hover:not([aria-disabled=true]),.pds-combobox__chip-trigger--success:hover:not([aria-disabled=true]),.pds-combobox__chip-trigger--warning:hover:not([aria-disabled=true]),.pds-combobox__chip-trigger--danger:hover:not([aria-disabled=true]),.pds-combobox__chip-trigger--info:hover:not([aria-disabled=true]){background:var(--chip-bg-hover)}.pds-combobox__chip-trigger--neutral:focus-visible,.pds-combobox__chip-trigger--accent:focus-visible,.pds-combobox__chip-trigger--success:focus-visible,.pds-combobox__chip-trigger--warning:focus-visible,.pds-combobox__chip-trigger--danger:focus-visible,.pds-combobox__chip-trigger--info:focus-visible{border-color:var(--chip-border)}.pds-combobox__chip-trigger--neutral{--chip-bg:var(--pine-chip-color-neutral);--chip-bg-hover:var(--pine-chip-color-neutral-hover);--chip-border:var(--pine-chip-color-neutral-hover);--chip-text:var(--pine-color-text-neutral)}.pds-combobox__chip-trigger--accent{--chip-bg:var(--pine-chip-color-accent);--chip-bg-hover:var(--pine-chip-color-accent-hover);--chip-border:var(--pine-chip-color-accent-hover);--chip-text:var(--pine-color-text-accent)}.pds-combobox__chip-trigger--success{--chip-bg:var(--pine-chip-color-success);--chip-bg-hover:var(--pine-chip-color-success-hover);--chip-border:var(--pine-chip-color-success-hover);--chip-text:var(--pine-color-text-success)}.pds-combobox__chip-trigger--warning{--chip-bg:var(--pine-chip-color-warning);--chip-bg-hover:var(--pine-chip-color-warning-hover);--chip-border:var(--pine-chip-color-warning-hover);--chip-text:var(--pine-color-text-warning)}.pds-combobox__chip-trigger--danger{--chip-bg:var(--pine-chip-color-danger);--chip-bg-hover:var(--pine-chip-color-danger-hover);--chip-border:var(--pine-chip-color-danger-hover);--chip-text:var(--pine-color-text-danger)}.pds-combobox__chip-trigger--info{--chip-bg:var(--pine-chip-color-info);--chip-bg-hover:var(--pine-chip-color-info-hover);--chip-border:var(--pine-chip-color-info-hover);--chip-text:var(--pine-color-text-info)}.pds-combobox__chip-trigger--brand{background:-webkit-gradient(linear, left top, right top, from(#FF3E14), to(#6B62F2));background:linear-gradient(90deg, #FF3E14 0%, #6B62F2 100%);border:0;color:var(--pine-color-text-neutral);padding:1px;position:relative}.pds-combobox__chip-trigger--brand .pds-combobox__chip-trigger-label{background:rgba(255, 255, 255, 0.9);border-radius:calc(var(--pine-dimension-sm) - 1px);color:var(--pine-color-text-neutral);font-weight:var(--pine-font-weight-medium);padding:var(--pine-dimension-025) var(--pine-dimension-150);position:relative;z-index:1}.pds-combobox__chip-trigger--brand .pds-combobox__chip-trigger-chevron{position:relative;z-index:1}.pds-combobox__chip-trigger--brand:hover:not([aria-disabled=true]) .pds-combobox__chip-trigger-label{background:rgba(255, 255, 255, 0.8)}.pds-combobox__chip-trigger--dropdown:not(.pds-combobox__chip-trigger--brand){padding:var(--pine-dimension-none)}.pds-combobox__chip-trigger--dropdown:not(.pds-combobox__chip-trigger--brand) .pds-combobox__chip-trigger-label{padding:var(--pine-dimension-025) var(--pine-dimension-150)}.pds-combobox__chip-trigger--large .pds-combobox__chip-trigger-label{font-family:var(--pine-font-family-heading);font-size:var(--pine-font-size-heading-6);font-weight:var(--pine-font-weight-medium);letter-spacing:var(--pine-letter-spacing-heading-6)}.pds-combobox__chip-trigger--dot .pds-combobox__chip-trigger-label::before{border:var(--pine-border-width) solid transparent;border-radius:var(--pine-border-radius-full);content:"";display:inline-block;height:var(--pine-dimension-2xs);-webkit-margin-end:var(--pine-dimension-2xs);margin-inline-end:var(--pine-dimension-2xs);width:var(--pine-dimension-2xs)}`;
1715
+
1716
+ const PdsCombobox = class {
1717
+ constructor(hostRef) {
1718
+ index.registerInstance(this, hostRef);
1719
+ this.pdsComboboxChange = index.createEvent(this, "pdsComboboxChange");
1720
+ this.pdsComboboxSearch = index.createEvent(this, "pdsComboboxSearch");
1721
+ this.pdsComboboxLoadOptions = index.createEvent(this, "pdsComboboxLoadOptions");
1722
+ /**
1723
+ * Enable custom layout content for options. Options with data-layout attribute will render their HTML content.
1724
+ * ⚠️ Security Warning: Only use with trusted content. Basic XSS protection is applied, but avoid user-generated content.
1725
+ * @default false
1726
+ */
1727
+ this.customOptionLayouts = false;
1728
+ /**
1729
+ * Enable custom layout content for the button trigger via the trigger-content slot.
1730
+ * When true, uses slot content for initial state but updates dynamically with selected option layout.
1731
+ * ⚠️ Security Warning: Only use with trusted content. Basic XSS protection is applied, but avoid user-generated content.
1732
+ * @default false
1733
+ */
1734
+ this.customTriggerContent = false;
1735
+ /**
1736
+ * If true, the combobox is disabled.
1737
+ */
1738
+ this.disabled = false;
1739
+ /**
1740
+ * Placement of the dropdown relative to the trigger.
1741
+ * @default 'bottom-start'
1742
+ */
1743
+ this.dropdownPlacement = 'bottom-start';
1744
+ /**
1745
+ * Where to mount the dropdown listbox (`host` or `body`, sometimes called “append to body”).
1746
+ * Use `body` inside scrollable containers (for example modals) so the list is not clipped by
1747
+ * `overflow: hidden` ancestors. The portal is appended to the nearest `<dialog>` when present
1748
+ * (including `pds-modal` / `showModal()`), using a composed ascent so shadow DOM and slot
1749
+ * boundaries do not hide the dialog from discovery; otherwise it is appended to `document.body`.
1750
+ * Keyboard focus stays on the trigger, or moves to the panel's own search field, so modal focus
1751
+ * traps keep working. The mounted dropdown renders in its own shadow root with the combobox's
1752
+ * styles, so it needs no global CSS and page CSS can't reach it: customize it with custom
1753
+ * properties on `pds-combobox`. Its reading direction, language, theme and custom properties are
1754
+ * taken from the combobox when it opens. Custom `empty` and `loading` slots are not supported when
1755
+ * `body` is used; the default empty and loading content is shown instead.
1756
+ * @default 'host'
1757
+ */
1758
+ this.dropdownMount = 'host';
1759
+ /**
1760
+ * Accessible prefix for the row that returns to the group list when `group-display` is
1761
+ * `drill-in`, read before the open group's label. Pass a translated string to localize it; defaults to English.
1762
+ * @defaultValue 'Back'
1763
+ */
1764
+ this.drillInBackLabel = 'Back';
1765
+ /**
1766
+ * Text shown when no options match the search. Pass a translated string to localize it; defaults to English.
1767
+ * @defaultValue 'No options found'
1768
+ */
1769
+ this.noOptionsFoundLabel = 'No options found';
1770
+ /**
1771
+ * Maximum width of a group's flyout when `group-display` is `flyout`. Any valid CSS width
1772
+ * value, including its padding.
1773
+ * @default '388px'
1774
+ */
1775
+ this.flyoutMaxWidth = '388px';
1776
+ /**
1777
+ * Minimum width of a group's flyout when `group-display` is `flyout`. Any valid CSS width
1778
+ * value, including its padding. The flyout is as wide as its options, between this and
1779
+ * `flyout-max-width`.
1780
+ * @default '288px'
1781
+ */
1782
+ this.flyoutMinWidth = '288px';
1783
+ /**
1784
+ * How option groups (`<optgroup>`, or the `group` field of `options`) are shown in the dropdown.
1785
+ * `inline` lists each group's label above its options. `flyout` lists the groups, and opens a
1786
+ * group's options in a panel beside it on hover or click; while searching, the matching options
1787
+ * are listed under their group labels, and search also matches group labels. `flyout` groups
1788
+ * by `<optgroup>` (or `group`) only: options under a `<pds-text>` heading are listed ungrouped.
1789
+ * `drill-in` lists the groups too, but a click replaces the list with that group's options and a
1790
+ * row back to the groups; use it where nothing can open beside the dropdown, such as a side
1791
+ * panel. `flyout` falls back to `drill-in` when there is no room for a flyout on either side.
1792
+ * @default 'inline'
1793
+ */
1794
+ this.groupDisplay = 'inline';
1795
+ /**
1796
+ * Visually hides the label text for instances where only the combobox should be displayed.
1797
+ * The visible `<label>` is omitted (same pattern as `pds-select`) so label spacing does not reserve layout;
1798
+ * the trigger uses `aria-label` so the name stays available to assistive technology.
1799
+ */
1800
+ this.hideLabel = false;
1801
+ /**
1802
+ * Determines the combobox mode: 'filter' (filter options as you type) or 'select-only' (show all options).
1803
+ * In filter mode, reopening the menu while the input still shows the label of the selected option temporarily lists
1804
+ * all options until you type (so you can switch to a different choice without clearing the field first).
1805
+ * @default 'filter'
1806
+ */
1807
+ this.mode = 'filter';
1808
+ /**
1809
+ * Shows a search field at the top of the dropdown for the `button` and `chip` triggers, which
1810
+ * can't be typed into. Search filters the options the same way typing in the `input` trigger
1811
+ * does; in a grouped display it also matches group labels.
1812
+ * @default false
1813
+ */
1814
+ this.panelSearch = false;
1815
+ /**
1816
+ * Accessible label for the search input inside the dropdown panel (`panel-search`). Pass a translated string to localize it; defaults to English.
1817
+ * @defaultValue 'Search options'
1818
+ */
1819
+ this.searchOptionsLabel = 'Search options';
1820
+ /**
1821
+ * Placeholder text for the search input inside the dropdown panel (`panel-search`). Pass a translated string to localize it; defaults to English.
1822
+ * @defaultValue 'Find...'
1823
+ */
1824
+ this.searchPlaceholder = 'Find...';
1825
+ /**
1826
+ * Determines the combobox trigger: 'input' (editable input), 'button' (button-like, non-editable), or 'chip' (chip-like, non-editable).
1827
+ * @default 'input'
1828
+ */
1829
+ this.trigger = 'input';
1830
+ /**
1831
+ * Width of the trigger (button or input). Any valid CSS width value.
1832
+ * @default 'fit-content'
1833
+ */
1834
+ this.triggerWidth = 'fit-content';
1835
+ /**
1836
+ * The visual variant for the button trigger. Matches Pine button variants.
1837
+ * @default 'secondary'
1838
+ */
1839
+ this.triggerVariant = 'secondary';
1840
+ /**
1841
+ * The shape of the button trigger. Use 'input' to render the trigger with input-like styling
1842
+ * (subtle border radius, input height) for use in form or filter rows alongside PdsSelect and PdsMultiselect.
1843
+ * @default 'pill'
1844
+ */
1845
+ this.triggerShape = 'pill';
1846
+ /**
1847
+ * Determines whether the button trigger's label and the option labels should truncate and display with an ellipsis.
1848
+ * When a label overflows, a `title` showing the full label will appear on hover.
1849
+ * Chip options, custom layouts and group rows aren't affected.
1850
+ * @defaultValue false
1851
+ */
1852
+ this.truncate = false;
1853
+ /**
1854
+ * The sentiment for the chip trigger. Matches Pine chip sentiments.
1855
+ * @default 'neutral'
1856
+ */
1857
+ this.chipSentiment = 'neutral';
1858
+ /**
1859
+ * Whether the chip trigger should be displayed in a larger size.
1860
+ * @default false
1861
+ */
1862
+ this.chipLarge = false;
1863
+ /**
1864
+ * Whether a dot should be displayed on the chip trigger.
1865
+ * @default false
1866
+ */
1867
+ this.chipDot = false;
1868
+ /**
1869
+ * The `value` of the selected option.
1870
+ */
1871
+ this.value = '';
1872
+ /**
1873
+ * HTTP method for async requests.
1874
+ */
1875
+ this.asyncMethod = 'GET';
1876
+ /**
1877
+ * Debounce delay in milliseconds for search/fetch.
1878
+ */
1879
+ this.debounce = 300;
1880
+ /**
1881
+ * Timeout in milliseconds for async fetch requests.
1882
+ */
1883
+ this.fetchTimeout = 30000;
1884
+ /**
1885
+ * Whether the component is currently loading async options.
1886
+ */
1887
+ this.loading = false;
1888
+ /**
1889
+ * Internal state for the display text shown in the input/trigger
1890
+ */
1891
+ this.displayText = '';
1892
+ /**
1893
+ * Internal state for filtered options and group labels
1894
+ */
1895
+ this.filteredItems = [];
1896
+ /**
1897
+ * Internal state for the currently highlighted option index
1898
+ */
1899
+ this.highlightedIndex = -1;
1900
+ /**
1901
+ * Internal state for dropdown open/close
1902
+ */
1903
+ this.isOpen = false;
1904
+ /**
1905
+ * The optgroup whose flyout is open, when `groupDisplay` is `flyout`.
1906
+ */
1907
+ this.openGroup = null;
1908
+ /**
1909
+ * Which way drill-in just moved, so the list slides that way: `in` to a group, `out` back to the
1910
+ * groups. Cleared once the slide ends, so later renders don't animate.
1911
+ */
1912
+ this.drillDirection = null;
1913
+ /**
1914
+ * The group row highlighted in the grouped panel. It counts only while no option is
1915
+ * highlighted (`highlightedIndex` is -1); see `highlightedGroupRow`.
1916
+ */
1917
+ this.highlightedGroup = null;
1918
+ /** The keys, not the pointer, moved the highlight last; the focus ring shows only then. */
1919
+ this.keyboardNavigating = false;
1920
+ /**
1921
+ * A drill-in group row the first arrow showed rather than moved past. `aria-activedescendant`
1922
+ * already pointed at it, so the status region says it instead.
1923
+ */
1924
+ this.revealedGroupLabel = null;
1925
+ /**
1926
+ * The pointer in the panel can hover: a mouse or pen, not touch. Touch browsers keep a tapped row
1927
+ * hovered, so group rows shade on `:hover` only for a pointer that can hover. Checked on the
1928
+ * pointer itself rather than `(hover: hover)`, which a touch-first device with a trackpad fails.
1929
+ */
1930
+ this.pointerCanHover = true;
1931
+ /**
1932
+ * What's typed in the dropdown's own search field (`panelSearch`).
1933
+ */
1934
+ this.panelQuery = '';
1935
+ /**
1936
+ * `groupDisplay` is `flyout` but there's no room beside the dropdown, so groups drill in instead.
1937
+ */
1938
+ this.flyoutFallback = false;
1939
+ /**
1940
+ * Internal state for the currently selected option
1941
+ */
1942
+ this.selectedOption = null;
1943
+ /**
1944
+ * Internal state for the sanitized layout content of the selected option
1945
+ */
1946
+ this.selectedOptionLayoutContent = '';
1947
+ /**
1948
+ * Internal state to track chip properties for automatic rendering
1949
+ */
1950
+ this.selectedOptionChipProps = null;
1951
+ /**
1952
+ * Internal state for async options.
1953
+ */
1954
+ this.internalOptions = [];
1955
+ /**
1956
+ * Internal state for current page (pagination).
1957
+ */
1958
+ this.currentPage = 1;
1959
+ /**
1960
+ * Internal state for hasMore (pagination).
1961
+ */
1962
+ this.hasMore = false;
1963
+ this.optionEls = [];
1964
+ this.allItems = [];
1965
+ this.portalEl = null;
1966
+ /** The portal's shadow root, which holds the dropdown and a copy of the combobox's styles. */
1967
+ this.portalRoot = null;
1968
+ this.bodyPortalAutoUpdateActive = false;
1969
+ this.isUpdatingFromSelection = false;
1970
+ this.flyout = new FlyoutController(() => this.openGroup, group => {
1971
+ this.openGroup = group;
1972
+ });
1973
+ /** The groups in the flyout panel's last render, so a row's index finds its optgroup. */
1974
+ this.renderedGroups = [];
1975
+ /**
1976
+ * Where each ungrouped option and optgroup built from the `options` prop came in the data, so
1977
+ * the flyout and drill-in panels draw them in that order. Slotted markup is already in order.
1978
+ */
1979
+ this.panelPositions = new WeakMap();
1980
+ /** Room for a flyout was checked for this open. */
1981
+ this.flyoutRoomChecked = false;
1982
+ /** The highlighted option sits in a flyout that hasn't rendered yet; focus it after the next render. */
1983
+ this.pendingOptionFocus = false;
1984
+ /** Group rows' DOM ids, stable across renders so `aria-activedescendant` can point at a row. */
1985
+ this.groupIds = new WeakMap();
1986
+ this.groupIdCount = 0;
1987
+ /**
1988
+ * In filter mode, after choosing an option the input still shows the label and would
1989
+ * otherwise filter the list to matching substrings only. While this flag is true,
1990
+ * the list shows every option until the user types (then normal filtering applies).
1991
+ */
1992
+ this.expandFilterListWhileOpen = false;
1993
+ this.onHeightGlideCancel = (event) => {
1994
+ const panel = this.listboxEl;
1995
+ if (event.animationName !== 'pds-combobox-height-glide' || event.target !== panel)
1996
+ return;
1997
+ // Turning around mid-glide cancels the old glide as the new one starts; only a glide with none
1998
+ // left running cleans up.
1999
+ const running = panel.getAnimations().some(a => a.animationName === 'pds-combobox-height-glide');
2000
+ // A drill waiting to render glides from here next; it cleans up then.
2001
+ if (!running && this.drillFromHeight === undefined)
2002
+ this.endHeightGlide();
2003
+ };
2004
+ this.onPanelPointer = (event) => {
2005
+ const canHover = event.pointerType !== 'touch';
2006
+ if (this.pointerCanHover !== canHover)
2007
+ this.pointerCanHover = canHover;
2008
+ };
2009
+ this.onDrillAnimationEnd = (event) => {
2010
+ // Only the component's own ends (the slide by name, the glide by its target): slotted consumer
2011
+ // content can animate inside the list too.
2012
+ if (event.animationName === 'pds-combobox-drill')
2013
+ this.drillDirection = null;
2014
+ if (event.animationName === 'pds-combobox-height-glide' && event.target === this.listboxEl && this.drillFromHeight === undefined) {
2015
+ this.endHeightGlide();
2016
+ }
2017
+ };
2018
+ /** `<label for>` only works on the input trigger; for a div trigger a click on the label focuses it. */
2019
+ this.onLabelClick = () => {
2020
+ var _a;
2021
+ if (this.trigger !== 'input' && !this.disabled) {
2022
+ (_a = this.triggerEl) === null || _a === void 0 ? void 0 : _a.focus();
2023
+ }
2024
+ };
2025
+ /** The query behind the options loaded from `async-url`. */
2026
+ this.lastFetchedQuery = '';
2027
+ this.handleInput = (e) => {
2028
+ const target = e.target;
2029
+ this.clearExpandFilterList();
2030
+ this.displayText = target.value;
2031
+ this.isOpen = true;
2032
+ this.filterOptions();
2033
+ // Emit search event for consumer-managed async
2034
+ this.pdsComboboxSearch.emit({ query: this.displayText });
2035
+ // Fetch from async URL if configured
2036
+ if (this.asyncUrl) {
2037
+ this.debouncedFetchAsyncOptions(this.displayText, 1);
2038
+ }
2039
+ setTimeout(() => this.openDropdownPositioning(), 0);
2040
+ };
2041
+ this.handleInputClick = () => {
2042
+ // Open dropdown when input is clicked (but not when tabbed into)
2043
+ if (!this.isOpen) {
2044
+ this.isOpen = true;
2045
+ this.prepareExpandFilterListOnOpen();
2046
+ this.filterOptions();
2047
+ // Trigger initial fetch if async and no options loaded yet
2048
+ if (this.asyncUrl && this.internalOptions.length === 0) {
2049
+ this.debouncedFetchAsyncOptions(this.displayText, 1);
2050
+ }
2051
+ this.setInitialHighlightedIndex();
2052
+ setTimeout(() => {
2053
+ this.openDropdownPositioning();
2054
+ if (this.trigger === 'input' && this.expandFilterListWhileOpen && this.inputEl) {
2055
+ this.inputEl.select();
2056
+ }
2057
+ }, 0);
2058
+ }
2059
+ };
2060
+ this.handleKeyDown = (e) => {
2061
+ if (!this.isOpen && (e.key === 'ArrowDown' || e.key === 'ArrowUp' || (e.altKey && e.key === 'ArrowDown'))) {
2062
+ e.preventDefault();
2063
+ this.keyboardNavigating = true;
2064
+ this.isOpen = true;
2065
+ this.prepareExpandFilterListOnOpen();
2066
+ this.filterOptions();
2067
+ // Set highlighted index immediately for testing
2068
+ this.setInitialHighlightedIndex();
2069
+ setTimeout(() => {
2070
+ this.openDropdownPositioning();
2071
+ // For input trigger, keep focus on input and use aria-activedescendant
2072
+ // For button trigger, move focus to first option for keyboard navigation
2073
+ if (this.trigger === 'input') {
2074
+ this.focusFirstOption();
2075
+ }
2076
+ else {
2077
+ this.focusFirstOptionForArrowKeys();
2078
+ }
2079
+ }, 0);
2080
+ return;
2081
+ }
2082
+ if (!this.isOpen) {
2083
+ return;
2084
+ }
2085
+ if (this.handleGroupedPanelKey(e))
2086
+ return;
2087
+ // The input trigger's text keeps Space, Home and End while the grouped panel shows.
2088
+ if (this.showsGroupedPanel && this.trigger === 'input' && (e.key === ' ' || e.key === 'Home' || e.key === 'End'))
2089
+ return;
2090
+ // Get only the option elements (skip group labels) for navigation
2091
+ const selectableOptions = this.filteredItems.filter(item => item.tagName === 'OPTION');
2092
+ switch (e.key) {
2093
+ case 'ArrowDown':
2094
+ e.preventDefault();
2095
+ // If no option is highlighted, start at the first
2096
+ this.highlightOptionAt(selectableOptions, this.highlightedIndex < 0 ? 0 : this.highlightedIndex + 1);
2097
+ break;
2098
+ case 'ArrowUp':
2099
+ e.preventDefault();
2100
+ // If no option is highlighted, start at the last
2101
+ this.highlightOptionAt(selectableOptions, this.highlightedIndex < 0 ? selectableOptions.length - 1 : this.highlightedIndex - 1);
2102
+ break;
2103
+ case 'Home':
2104
+ e.preventDefault();
2105
+ this.highlightOptionAt(selectableOptions, 0);
2106
+ break;
2107
+ case 'End':
2108
+ e.preventDefault();
2109
+ this.highlightOptionAt(selectableOptions, selectableOptions.length - 1);
2110
+ break;
2111
+ case 'PageDown':
2112
+ e.preventDefault();
2113
+ this.highlightOptionAt(selectableOptions, this.highlightedIndex + 10);
2114
+ break;
2115
+ case 'PageUp':
2116
+ e.preventDefault();
2117
+ this.highlightOptionAt(selectableOptions, this.highlightedIndex - 10);
2118
+ break;
2119
+ case 'Enter':
2120
+ case ' ': {
2121
+ e.preventDefault();
2122
+ // An option in a flyout the pointer has since closed isn't on screen; don't choose it.
2123
+ if (this.showsGroupedPanel && this.activeDescendantId === undefined)
2124
+ break;
2125
+ const option = selectableOptions[this.highlightedIndex];
2126
+ if (option !== undefined && !isOptionDisabled(option)) {
2127
+ this.handleOptionClick(option);
2128
+ this.restoreFocusToTrigger();
2129
+ }
2130
+ break;
2131
+ }
2132
+ case 'Escape':
2133
+ e.preventDefault();
2134
+ this.isOpen = false;
2135
+ this.highlightedIndex = -1;
2136
+ this.clearExpandFilterList();
2137
+ this.isArrowKeyNavigationMode = false; // Reset arrow-key navigation mode
2138
+ this.restoreFocusToTrigger();
2139
+ break;
2140
+ case 'Tab':
2141
+ // Allow normal tab behavior to close dropdown and move focus
2142
+ this.isOpen = false;
2143
+ this.highlightedIndex = -1;
2144
+ this.clearExpandFilterList();
2145
+ this.isArrowKeyNavigationMode = false; // Reset arrow-key navigation mode
2146
+ break;
2147
+ }
2148
+ };
2149
+ // Track if we're in arrow-key navigation mode (focus should move between options)
2150
+ this.isArrowKeyNavigationMode = false;
2151
+ // Event handler for option click
2152
+ this.onOptionClick = (event) => {
2153
+ const idx = Number(event.currentTarget.getAttribute('data-option-index'));
2154
+ const selectableOptions = this.filteredItems.filter(item => item.tagName === 'OPTION');
2155
+ const option = selectableOptions[idx];
2156
+ if (isOptionDisabled(option))
2157
+ return;
2158
+ this.handleOptionClick(option);
2159
+ // The search field closes with the panel; send focus back to the trigger instead of losing it.
2160
+ // (Enter and Space already restore focus in the key handler.)
2161
+ if (this.usesPanelSearch)
2162
+ this.restoreFocusToTrigger();
2163
+ };
2164
+ this.onButtonTriggerMouseEnter = (event) => {
2165
+ this.syncTitle(event.currentTarget, '.pds-combobox__button-trigger-text');
2166
+ };
2167
+ // Event handler for mouse enter on option
2168
+ this.onOptionMouseEnter = (event) => {
2169
+ const row = event.currentTarget;
2170
+ if (this.truncate)
2171
+ this.syncTitle(row, '.pds-combobox__option-text');
2172
+ this.highlightedIndex = Number(row.getAttribute('data-option-index'));
2173
+ this.keyboardNavigating = false;
2174
+ };
2175
+ this.onGroupRowMouseEnter = (event) => {
2176
+ const group = this.groupFromEvent(event);
2177
+ if (group !== null)
2178
+ this.flyout.enter(group);
2179
+ };
2180
+ this.onGroupRowMouseLeave = (event) => {
2181
+ const group = this.groupFromEvent(event);
2182
+ if (group !== null)
2183
+ this.flyout.leave(group);
2184
+ };
2185
+ // The pointer highlights a group's row as it does an option, so the keys carry on from there.
2186
+ this.onGroupRowTriggerMouseEnter = (event) => {
2187
+ const group = this.groupFromEvent(event);
2188
+ if (group !== null)
2189
+ this.highlightGroupRowByPointer(group);
2190
+ };
2191
+ this.onGroupBackMouseEnter = () => {
2192
+ if (this.openGroup !== null)
2193
+ this.highlightGroupRowByPointer(this.openGroup);
2194
+ };
2195
+ this.onGroupRowClick = (event) => {
2196
+ var _a;
2197
+ const group = this.groupFromEvent(event);
2198
+ if (group === null)
2199
+ return;
2200
+ this.flyout.open(group);
2201
+ // Highlight the group's first option, so the arrow keys carry on from the group just opened
2202
+ // rather than from wherever the highlight was before.
2203
+ const first = (_a = this.renderedGroups.find(entry => entry.optgroup === group)) === null || _a === void 0 ? void 0 : _a.options[0];
2204
+ if (first !== undefined) {
2205
+ this.highlightedIndex = first.index;
2206
+ this.updateAriaActiveDescendant();
2207
+ }
2208
+ };
2209
+ // Prevent blur on mousedown
2210
+ this.onOptionMouseDown = (event) => {
2211
+ event.preventDefault();
2212
+ };
2213
+ // Event handler for option keyboard events
2214
+ this.onOptionKeyDown = (event) => {
2215
+ // Delegate to main keyboard handler
2216
+ this.handleKeyDown(event);
2217
+ };
2218
+ // Handler for button trigger click
2219
+ this.onButtonTriggerClick = () => {
2220
+ // The button and chip triggers are divs, so a click reaches them even while disabled.
2221
+ if (this.disabled)
2222
+ return;
2223
+ this.isOpen = !this.isOpen;
2224
+ if (this.isOpen) {
2225
+ this.prepareExpandFilterListOnOpen();
2226
+ this.filterOptions();
2227
+ this.fetchAsyncOptionsOnOpen();
2228
+ // Set highlighted index and prepare for keyboard navigation
2229
+ this.setInitialHighlightedIndex();
2230
+ // For button trigger, prepare for arrow-key navigation mode
2231
+ this.isArrowKeyNavigationMode = true;
2232
+ setTimeout(() => this.openDropdownPositioning(), 0);
2233
+ }
2234
+ else {
2235
+ // Reset navigation mode when closing
2236
+ this.clearExpandFilterList();
2237
+ this.isArrowKeyNavigationMode = false;
2238
+ }
2239
+ };
2240
+ // Handler for button trigger keyboard events
2241
+ this.onButtonTriggerKeyDown = (e) => {
2242
+ // Disabled takes it out of the tab order, but setFocus() or a click can still focus it.
2243
+ if (this.disabled) {
2244
+ // Keep Space from scrolling the page, as on a native disabled button.
2245
+ if (e.key === ' ')
2246
+ e.preventDefault();
2247
+ return;
2248
+ }
2249
+ // Escape closes an open group before the dropdown. Other keys reach the tree through handleKeyDown.
2250
+ if (this.isOpen && e.key === 'Escape' && this.handleGroupedPanelKey(e))
2251
+ return;
2252
+ if ((e.key === 'Enter' || e.key === ' ' || e.key === 'ArrowDown' || e.key === 'ArrowUp') && !this.isOpen) {
2253
+ e.preventDefault();
2254
+ e.stopPropagation(); // Prevent the event from bubbling and triggering click
2255
+ this.keyboardNavigating = true;
2256
+ this.isOpen = true;
2257
+ this.prepareExpandFilterListOnOpen();
2258
+ this.filterOptions();
2259
+ this.fetchAsyncOptionsOnOpen();
2260
+ // Set highlighted index immediately
2261
+ this.setInitialHighlightedIndex();
2262
+ setTimeout(() => {
2263
+ this.openDropdownPositioning();
2264
+ // For all button trigger keyboard opening, focus the first option so subsequent navigation works
2265
+ this.focusFirstOptionForArrowKeys();
2266
+ }, 0);
2267
+ }
2268
+ else if (e.key === 'Escape') {
2269
+ // Only an open dropdown claims Escape; a closed one leaves it to a modal or popover around it.
2270
+ if (this.isOpen) {
2271
+ e.preventDefault();
2272
+ this.isOpen = false;
2273
+ this.highlightedIndex = -1;
2274
+ this.clearExpandFilterList();
2275
+ this.updateAriaActiveDescendant(); // Clear aria-activedescendant
2276
+ this.restoreFocusToTrigger();
2277
+ }
2278
+ }
2279
+ else if (this.isOpen) {
2280
+ // Delegate other keys to main keyboard handler when dropdown is open
2281
+ this.handleKeyDown(e);
2282
+ }
2283
+ };
2284
+ // Handler for button trigger keyup events - prevents space key from triggering synthetic click
2285
+ this.onButtonTriggerKeyUp = (e) => {
2286
+ if (e.key === ' ') {
2287
+ e.preventDefault();
2288
+ e.stopPropagation();
2289
+ }
2290
+ };
2291
+ // Close dropdown when focus leaves the combobox
2292
+ this.onComboboxFocusOut = (event) => {
2293
+ var _a, _b, _c;
2294
+ const relatedTarget = event.relatedTarget;
2295
+ const isRelatedTargetInListbox = relatedTarget &&
2296
+ (((_a = this.listboxEl) === null || _a === void 0 ? void 0 : _a.contains(relatedTarget)) || ((_b = this.portalEl) === null || _b === void 0 ? void 0 : _b.contains(relatedTarget)));
2297
+ // `contains` doesn't cross into the shadow root, where the trigger lives; with panel search,
2298
+ // focus leaves the search field for the trigger whenever it's clicked to close.
2299
+ const isRelatedTargetInCombobox = relatedTarget !== null && (this.el.contains(relatedTarget) || !!((_c = this.el.shadowRoot) === null || _c === void 0 ? void 0 : _c.contains(relatedTarget)));
2300
+ // Don't close if focus is moving to an option in the listbox or staying within the combobox
2301
+ if (!isRelatedTargetInCombobox && !isRelatedTargetInListbox) {
2302
+ this.isOpen = false;
2303
+ this.highlightedIndex = -1;
2304
+ this.clearExpandFilterList();
2305
+ this.isArrowKeyNavigationMode = false; // Reset arrow-key navigation mode
2306
+ this.updateAriaActiveDescendant(); // Clear aria-activedescendant
2307
+ // If there's a selected option but the display text doesn't match, restore the selected option's display text
2308
+ if (this.selectedOption && this.displayText !== this.getOptionLabel(this.selectedOption)) {
2309
+ this.displayText = this.getOptionLabel(this.selectedOption);
2310
+ // The @Watch('selectedOption') will handle value and form internals if needed
2311
+ }
2312
+ }
2313
+ };
2314
+ /** A pick that fills the field from its placeholder fades in; a value it loads with doesn't. */
2315
+ this.fadesValueIn = false;
2316
+ this.handleScroll = (e) => {
2317
+ if (!this.asyncUrl || !this.hasMore || this.loading)
2318
+ return;
2319
+ const target = e.target;
2320
+ const scrollBottom = target.scrollHeight - target.scrollTop - target.clientHeight;
2321
+ // Load more when near bottom (within 50px)
2322
+ if (scrollBottom < 50) {
2323
+ this.pdsComboboxLoadOptions.emit({
2324
+ query: this.activeQuery,
2325
+ page: this.currentPage + 1,
2326
+ });
2327
+ this.debouncedFetchAsyncOptions(this.activeQuery, this.currentPage + 1);
2328
+ }
2329
+ };
2330
+ // A press on the panel's padding, captions or status rows keeps focus in the search field;
2331
+ // otherwise it would blur the field, closing a portaled panel or stranding the keys.
2332
+ this.onPanelMouseDown = (event) => {
2333
+ if (event.target !== this.panelSearchEl)
2334
+ event.preventDefault();
2335
+ };
2336
+ this.onPanelSearchInput = (event) => {
2337
+ this.setPanelQuery(event.target.value);
2338
+ };
2339
+ // Space, Home and End edit the search text rather than moving through the options.
2340
+ this.onPanelSearchKeyDown = (event) => {
2341
+ if (event.key === ' ' || event.key === 'Home' || event.key === 'End')
2342
+ return;
2343
+ if (this.handlePanelTab(event))
2344
+ return;
2345
+ this.handleKeyDown(event);
2346
+ };
2347
+ /**
2348
+ * Keys in the list while a drilled-in group hides the search field. Backspace, like ArrowLeft,
2349
+ * steps back to the groups; a character starts a search of the whole list. Characters typed
2350
+ * before the search field renders and takes focus still land on the list, so they add to the
2351
+ * query rather than starting it again.
2352
+ */
2353
+ this.onPanelTreeKeyDown = (event) => {
2354
+ if (this.handlePanelTab(event))
2355
+ return;
2356
+ if (event.key === 'Backspace') {
2357
+ event.preventDefault();
2358
+ if (!this.leaveDrilledInGroup() && this.panelQuery !== '')
2359
+ this.setPanelQuery(this.panelQuery.slice(0, -1));
2360
+ return;
2361
+ }
2362
+ // AltGr (Ctrl+Alt on Windows) and Option on macOS type characters too; Meta and Ctrl alone are
2363
+ // shortcuts.
2364
+ if (event.key.length === 1 && event.key !== ' ' && !event.metaKey && (!event.ctrlKey || event.altKey)) {
2365
+ event.preventDefault();
2366
+ this.flyout.reset();
2367
+ // The query first, so leaving the group reads as search results, not a slide back.
2368
+ this.setPanelQuery(this.panelQuery + event.key);
2369
+ this.openGroup = null;
2370
+ return;
2371
+ }
2372
+ this.handleKeyDown(event);
2373
+ };
2374
+ this.onGroupBackClick = () => {
2375
+ this.leaveDrilledInGroup();
2376
+ };
2377
+ }
2378
+ connectedCallback() {
2379
+ // Initialize ElementInternals for form association (only once per element instance)
2380
+ if (this.el.attachInternals && !this.internals) {
2381
+ this.internals = this.el.attachInternals();
2382
+ }
2383
+ }
2384
+ /**
2385
+ * Form Associated Custom Elements API: Called when the form is disabled
2386
+ */
2387
+ formDisabledCallback(disabled) {
2388
+ // Also fires when this element's own `disabled` attribute is merely present, even as the
2389
+ // literal string "false" (a consumer's or React's attribute serialization can write that) —
2390
+ // the platform treats any value as disabled, independent of fieldset state. A real disabled
2391
+ // fieldset ancestor confirms this is genuinely that, not this element's own attribute.
2392
+ if (disabled && !this.el.closest('fieldset[disabled]'))
2393
+ return;
2394
+ this.disabled = disabled;
2395
+ }
2396
+ componentWillLoad() {
2397
+ this.originalSearchEmitter = this.pdsComboboxSearch;
2398
+ this.updateOptions();
2399
+ }
2400
+ componentDidLoad() {
2401
+ var _a, _b, _c;
2402
+ this.setupDebounce();
2403
+ // Check for value-based preselection if no option is selected yet
2404
+ if (!this.selectedOption && this.value && this.optionEls.length > 0) {
2405
+ const matchingOption = this.optionEls.find(opt => opt.value === this.value);
2406
+ if (matchingOption) {
2407
+ this.setSelectedOption(matchingOption);
2408
+ // Update the display text to show the option's text content
2409
+ this.displayText = this.getOptionLabel(matchingOption);
2410
+ // Keep this.value as the actual option value
2411
+ // this.value remains unchanged (already matches matchingOption.value)
2412
+ }
2413
+ }
2414
+ // Initialize form value with current value
2415
+ this.updateFormValue((_c = (_b = (_a = this.selectedOption) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : this.value) !== null && _c !== void 0 ? _c : '');
2416
+ }
2417
+ disconnectedCallback() {
2418
+ var _a;
2419
+ if (this.deferredPortalTeardownId !== undefined) {
2420
+ clearTimeout(this.deferredPortalTeardownId);
2421
+ this.deferredPortalTeardownId = undefined;
2422
+ }
2423
+ (_a = this.observer) === null || _a === void 0 ? void 0 : _a.disconnect();
2424
+ utils.cancelDebouncedEvent(this.pdsComboboxSearch);
2425
+ this.clearAsyncFetchState();
2426
+ this.removeBodyPortal();
2427
+ this.flyout.reset();
2428
+ }
2429
+ componentDidRender() {
2430
+ var _a;
2431
+ if (this.usesBodyPortal && this.isOpen) {
2432
+ this.syncBodyPortal();
2433
+ }
2434
+ // Opening places the dropdown a tick later, which can run before the dropdown has rendered and
2435
+ // then skips it, leaving it without its dropdown-width and max-height. Place a newly rendered
2436
+ // dropdown here too.
2437
+ if (this.isOpen && this.triggerEl && this.listboxEl && this.listboxEl !== this.placedListboxEl) {
2438
+ this.placedListboxEl = this.listboxEl;
2439
+ void this.positionDropdown();
2440
+ }
2441
+ this.glideDrillHeight();
2442
+ const row = (_a = this.listboxEl) === null || _a === void 0 ? void 0 : _a.querySelector('.pds-combobox__group-row--open');
2443
+ const flyoutEl = row === null || row === void 0 ? void 0 : row.querySelector('.pds-combobox__flyout');
2444
+ if (this.isOpen && this.listboxEl && row && flyoutEl) {
2445
+ this.flyout.position(row, this.listboxEl, flyoutEl);
2446
+ }
2447
+ else {
2448
+ this.flyout.stopPositioning();
2449
+ }
2450
+ if (this.pendingOptionFocus) {
2451
+ this.pendingOptionFocus = false;
2452
+ this.updateOptionFocus();
2453
+ }
2454
+ // Panel search keeps focus in the search field, or in the list while a group hides the field.
2455
+ const panelFocusEl = this.hidesPanelSearch ? this.panelTreeEl : this.panelSearchEl;
2456
+ if (this.isOpen && this.usesPanelSearch && panelFocusEl && panelFocusEl !== this.panelFocusEl) {
2457
+ this.focusPanel(panelFocusEl);
2458
+ }
2459
+ }
2460
+ // A `title` only while the text is cut, measured on hover. On the span, not the option or trigger,
2461
+ // so it isn't read again as their description.
2462
+ syncTitle(el, selector) {
2463
+ const text = el.querySelector(selector);
2464
+ if (!text)
2465
+ return;
2466
+ if (text.scrollWidth > text.clientWidth) {
2467
+ text.title = text.textContent || '';
2468
+ }
2469
+ else {
2470
+ text.removeAttribute('title');
2471
+ }
2472
+ }
2473
+ /**
2474
+ * Scrolls just enough to show `el`, as `scrollIntoView({ block: 'nearest' })` does. In the drill-in
2475
+ * panel it scrolls the list alone, and never sideways: while a drill-in slide offsets a row past
2476
+ * the list's edge, `scrollIntoView` also scrolls the list horizontally to reach it, which eats most
2477
+ * of the slide. It doesn't scroll the page or a scrolling ancestor.
2478
+ */
2479
+ scrollIntoViewNearest(el, smooth) {
2480
+ const behavior = smooth ? 'smooth' : 'auto';
2481
+ if (!this.showsGroupedPanel || this.effectiveGroupDisplay !== 'drill-in') {
2482
+ el.scrollIntoView({ block: 'nearest', behavior });
2483
+ return;
2484
+ }
2485
+ // The row back is the drilled-in header, above the scrolling options: always in view.
2486
+ if (el.classList.contains('pds-combobox__group-back-trigger'))
2487
+ return;
2488
+ const list = this.scrollListEl;
2489
+ if (!list)
2490
+ return;
2491
+ const offset = el.getBoundingClientRect().top - list.getBoundingClientRect().top - list.clientTop;
2492
+ const top = list.scrollTop + offset;
2493
+ const bottom = list.scrollTop + offset + el.offsetHeight - list.clientHeight;
2494
+ const target = top < list.scrollTop ? top : bottom > list.scrollTop ? bottom : null;
2495
+ if (target !== null)
2496
+ list.scrollTo({ top: target, behavior });
2497
+ }
2498
+ /**
2499
+ * The element that scrolls the panel's rows. Every layer is a header (the search field, or a
2500
+ * drilled-in group's row back) above the rows that scroll: drilled in, the group's options;
2501
+ * otherwise the list under the search field, or the panel itself.
2502
+ */
2503
+ get scrollListEl() {
2504
+ var _a;
2505
+ const list = this.usesPanelSearch ? this.panelTreeEl : this.listboxEl;
2506
+ return (_a = list === null || list === void 0 ? void 0 : list.querySelector('.pds-combobox__group-back > .pds-combobox__drill-in-options')) !== null && _a !== void 0 ? _a : list;
2507
+ }
2508
+ focusPanel(el) {
2509
+ var _a, _b;
2510
+ this.panelFocusEl = el;
2511
+ // Before the dropdown is positioned it sits in the page's flow; don't scroll to it.
2512
+ el.focus({ preventScroll: true });
2513
+ // A search started by typing in the list carries its first character; type on after it.
2514
+ if (el === this.panelSearchEl && this.panelQuery !== '') {
2515
+ (_b = (_a = this.panelSearchEl).setSelectionRange) === null || _b === void 0 ? void 0 : _b.call(_a, this.panelQuery.length, this.panelQuery.length);
2516
+ }
2517
+ this.updateAriaActiveDescendant();
2518
+ }
2519
+ /** Switching display mode leaves no flyout or hover timer from the last one. */
2520
+ groupDisplayChanged() {
2521
+ this.flyout.reset();
2522
+ this.openGroup = null;
2523
+ // The reset isn't a drill-out, so it doesn't slide either.
2524
+ this.drillDirection = null;
2525
+ this.endHeightGlide();
2526
+ }
2527
+ openGroupChanged(next, previous) {
2528
+ this.handPanelFocusToList();
2529
+ this.revealedGroupLabel = null;
2530
+ // Only moves between the drill-in panel's views slide; search results don't.
2531
+ if (!this.isOpen || this.effectiveGroupDisplay !== 'drill-in' || !this.showsGroupedPanel)
2532
+ return;
2533
+ if (next !== null && previous === null)
2534
+ this.drillDirection = 'in';
2535
+ else if (next === null && previous !== null)
2536
+ this.drillDirection = 'out';
2537
+ else
2538
+ return;
2539
+ // The views differ in height; measured now, before the next one renders, so it can glide.
2540
+ const panel = this.listboxEl;
2541
+ if (!panel)
2542
+ return;
2543
+ const from = panel.getBoundingClientRect().height;
2544
+ this.drillFromHeight = from;
2545
+ // Pinned there until componentDidRender measures the new view, however late: a child component
2546
+ // that renders late could otherwise let the browser paint the new view at its full height first.
2547
+ panel.style.height = `${from}px`;
2548
+ panel.classList.add('pds-combobox__listbox--height-hold');
2549
+ this.syncPanelOverflow();
2550
+ }
2551
+ releaseHeightHold() {
2552
+ const panel = this.listboxEl;
2553
+ panel === null || panel === void 0 ? void 0 : panel.style.removeProperty('height');
2554
+ panel === null || panel === void 0 ? void 0 : panel.classList.remove('pds-combobox__listbox--height-hold');
2555
+ }
2556
+ /**
2557
+ * Hands the dropdown's height before and after a drill to the SCSS glide. Neither is known ahead,
2558
+ * so they're measured: CSS can't animate to the height its content turns out to be.
2559
+ */
2560
+ glideDrillHeight() {
2561
+ const from = this.drillFromHeight;
2562
+ this.drillFromHeight = undefined;
2563
+ const panel = this.listboxEl;
2564
+ if (from === undefined || !panel)
2565
+ return;
2566
+ // A drill back mid-glide starts from where the last one is now, then measures the real height.
2567
+ this.releaseHeightHold();
2568
+ panel.classList.remove('pds-combobox__listbox--height-glide');
2569
+ this.syncPanelOverflow();
2570
+ const to = panel.getBoundingClientRect().height;
2571
+ if (Math.abs(to - from) < 1) {
2572
+ this.endHeightGlide();
2573
+ return;
2574
+ }
2575
+ panel.style.setProperty('--pds-combobox-glide-from', `${from}px`);
2576
+ panel.style.setProperty('--pds-combobox-glide-to', `${to}px`);
2577
+ panel.classList.add('pds-combobox__listbox--height-glide');
2578
+ this.syncPanelOverflow();
2579
+ // A glide cut short without ending (the panel hidden mid-way) still cleans up. JSX has no
2580
+ // `onAnimationCancel`; adding the same listener again is a no-op.
2581
+ panel.addEventListener('animationcancel', this.onHeightGlideCancel);
2582
+ }
2583
+ /** Ends a glide, and a drill still waiting to glide, so nothing starts once it renders. */
2584
+ endHeightGlide() {
2585
+ this.drillFromHeight = undefined;
2586
+ this.releaseHeightHold();
2587
+ const panel = this.listboxEl;
2588
+ panel === null || panel === void 0 ? void 0 : panel.classList.remove('pds-combobox__listbox--height-glide');
2589
+ this.syncPanelOverflow();
2590
+ panel === null || panel === void 0 ? void 0 : panel.style.removeProperty('--pds-combobox-glide-from');
2591
+ panel === null || panel === void 0 ? void 0 : panel.style.removeProperty('--pds-combobox-glide-to');
2592
+ panel === null || panel === void 0 ? void 0 : panel.removeEventListener('animationcancel', this.onHeightGlideCancel);
2593
+ }
2594
+ /**
2595
+ * With `max-height`, the panel's own scroll, set inline so it outranks the stylesheet: hidden under a
2596
+ * fixed search field, and while the height glides (so no scrollbar flashes), otherwise auto.
2597
+ */
2598
+ syncPanelOverflow() {
2599
+ var _a;
2600
+ if (((_a = this.maxHeight) !== null && _a !== void 0 ? _a : '') === '' || !this.listboxEl)
2601
+ return;
2602
+ const gliding = this.listboxEl.classList.contains('pds-combobox__listbox--height-glide') ||
2603
+ this.listboxEl.classList.contains('pds-combobox__listbox--height-hold');
2604
+ this.listboxEl.style.overflowY = this.usesPanelSearch || gliding ? 'hidden' : 'auto';
2605
+ }
2606
+ /** A flyout with no room beside the dropdown drills in, which can hide the focused search field too. */
2607
+ flyoutFallbackChanged() {
2608
+ this.handPanelFocusToList();
2609
+ }
2610
+ /**
2611
+ * Drilling into a group hides the search field, so focus moves to the list before the field
2612
+ * unmounts: focus lost with it would leave the combobox and close the dropdown.
2613
+ */
2614
+ handPanelFocusToList() {
2615
+ if (this.isOpen && this.hidesPanelSearch && this.panelTreeEl)
2616
+ this.focusPanel(this.panelTreeEl);
2617
+ }
2618
+ disabledChanged(disabled) {
2619
+ var _a, _b, _c, _d, _e;
2620
+ if (!disabled || !this.isOpen)
2621
+ return;
2622
+ const shadowActive = (_b = (_a = this.el.shadowRoot) === null || _a === void 0 ? void 0 : _a.activeElement) !== null && _b !== void 0 ? _b : null;
2623
+ const focusInDropdown = !!((_d = (_c = this.portalEl) === null || _c === void 0 ? void 0 : _c.shadowRoot) === null || _d === void 0 ? void 0 : _d.activeElement) || (!!shadowActive && !!((_e = this.listboxEl) === null || _e === void 0 ? void 0 : _e.contains(shadowActive)));
2624
+ this.isOpen = false;
2625
+ this.highlightedIndex = -1;
2626
+ this.isArrowKeyNavigationMode = false;
2627
+ this.clearExpandFilterList();
2628
+ this.updateAriaActiveDescendant();
2629
+ // Closing removes the search field or option that held focus. A button or chip trigger can still
2630
+ // take it (aria-disabled), so focus doesn't fall to the page; a disabled input can't, as natively.
2631
+ if (focusInDropdown && this.trigger !== 'input')
2632
+ this.restoreFocusToTrigger();
2633
+ }
2634
+ isOpenChanged(isOpen) {
2635
+ if (!isOpen) {
2636
+ this.endHeightGlide();
2637
+ this.revealedGroupLabel = null;
2638
+ this.drillDirection = null;
2639
+ this.openGroup = null;
2640
+ this.highlightedGroup = null;
2641
+ this.keyboardNavigating = false;
2642
+ this.flyout.reset();
2643
+ if (this.panelQuery !== '') {
2644
+ // The field reopens empty, so tell consumers who filter `options` from this event.
2645
+ this.panelQuery = '';
2646
+ this.pdsComboboxSearch.emit({ query: '' });
2647
+ }
2648
+ // And with `async-url`, start loading the unsearched list now, so it's ready by the reopen.
2649
+ if (this.usesPanelSearch && this.asyncUrl && this.lastFetchedQuery !== '') {
2650
+ this.debouncedFetchAsyncOptions('', 1);
2651
+ }
2652
+ this.panelFocusEl = undefined;
2653
+ this.flyoutRoomChecked = false;
2654
+ this.flyoutFallback = false;
2655
+ }
2656
+ if (isOpen && this.deferredPortalTeardownId !== undefined) {
2657
+ clearTimeout(this.deferredPortalTeardownId);
2658
+ this.deferredPortalTeardownId = undefined;
2659
+ }
2660
+ if (isOpen && this.usesBodyPortal) {
2661
+ // Rapid reopen can cancel deferred teardown while the portal still holds the previous
2662
+ // listbox node; clear portal state before the next render attaches the new listbox, and
2663
+ // reset Floating UI autoUpdate bookkeeping.
2664
+ this.removeBodyPortal();
2665
+ }
2666
+ if (!isOpen && this.usesBodyPortal) {
2667
+ if (this.deferredPortalTeardownId !== undefined) {
2668
+ clearTimeout(this.deferredPortalTeardownId);
2669
+ }
2670
+ this.deferredPortalTeardownId = setTimeout(() => {
2671
+ this.deferredPortalTeardownId = undefined;
2672
+ if (!this.el.isConnected) {
2673
+ return;
2674
+ }
2675
+ if (!this.isOpen) {
2676
+ this.removeBodyPortal();
2677
+ }
2678
+ }, 0);
2679
+ return;
2680
+ }
2681
+ if (!isOpen) {
2682
+ this.removeBodyPortal();
2683
+ }
2684
+ }
2685
+ get usesBodyPortal() {
2686
+ return this.dropdownMount === 'body';
2687
+ }
2688
+ get labelId() {
2689
+ return `${this.componentId}-label`;
2690
+ }
2691
+ /** One check for "the `<label>` is rendered", so the label and the reference to it can't disagree. */
2692
+ get hasVisibleLabel() {
2693
+ return Boolean(this.label) && !this.hideLabel;
2694
+ }
2695
+ /**
2696
+ * The button and chip triggers are `div`s, which `<label for>` can't name, so they point at the
2697
+ * visible label instead. With `hide-label` there is no visible label and `aria-label` names them.
2698
+ * With panel search the trigger is a button, which has no value, so its own text (the selection
2699
+ * or placeholder) joins the label in its name.
2700
+ */
2701
+ get triggerLabelledBy() {
2702
+ if (!this.hasVisibleLabel)
2703
+ return undefined;
2704
+ return this.usesPanelSearch ? `${this.labelId} ${this.componentId}` : this.labelId;
2705
+ }
2706
+ /** The div triggers' `aria-label` when the label is hidden; with panel search it names the selection too. */
2707
+ get triggerAriaLabel() {
2708
+ if (!this.hideLabel)
2709
+ return undefined;
2710
+ const shown = this.selectedLabel || this.placeholder;
2711
+ return this.usesPanelSearch && shown ? `${this.label}, ${shown}` : this.label;
2712
+ }
2713
+ get listboxId() {
2714
+ return `${this.componentId}-listbox`;
2715
+ }
2716
+ optionDomId(optionIndex) {
2717
+ return `${this.componentId}-option-${optionIndex}`;
2718
+ }
2719
+ groupDomId(optgroup) {
2720
+ let id = this.groupIds.get(optgroup);
2721
+ if (id === undefined) {
2722
+ id = `${this.componentId}-group-${this.groupIdCount++}`;
2723
+ this.groupIds.set(optgroup, id);
2724
+ }
2725
+ return id;
2726
+ }
2727
+ setupDebounce() {
2728
+ const { pdsComboboxSearch, debounce, originalSearchEmitter } = this;
2729
+ this.pdsComboboxSearch = debounce === undefined
2730
+ ? originalSearchEmitter !== null && originalSearchEmitter !== void 0 ? originalSearchEmitter : pdsComboboxSearch
2731
+ : utils.debounceEvent(pdsComboboxSearch, debounce);
2732
+ // After the swap, so an emit made while flushing goes to the new emitter, not the old one.
2733
+ utils.flushDebouncedEvent(pdsComboboxSearch);
2734
+ }
2735
+ optionsChanged() {
2736
+ if (this.options) {
2737
+ this.internalOptions = [...this.options];
2738
+ this.updateOptionsFromAsync();
2739
+ }
2740
+ }
2741
+ handleValueChange() {
2742
+ this.filterOptions();
2743
+ // Sync with form internals for form association
2744
+ this.updateFormValue(this.value);
2745
+ // Find and select option that matches the value (for external value changes)
2746
+ // Only do this if we're not already updating from a selection
2747
+ if (!this.isUpdatingFromSelection && this.value && this.optionEls.length > 0) {
2748
+ const currentSelectedValue = this.selectedOption ? this.selectedOption.value : null;
2749
+ // If the value doesn't match the currently selected option's value, we need to update
2750
+ if (this.value !== currentSelectedValue) {
2751
+ const matchingOption = this.optionEls.find(opt => opt.value === this.value);
2752
+ if (matchingOption) {
2753
+ this.isUpdatingFromSelection = true;
2754
+ this.setSelectedOption(matchingOption);
2755
+ // Update the display text to show the option's text content
2756
+ this.displayText = this.getOptionLabel(matchingOption);
2757
+ // Keep this.value as the actual option value (already correct)
2758
+ this.isUpdatingFromSelection = false;
2759
+ }
2760
+ }
2761
+ }
2762
+ }
2763
+ handleSelectedOptionChange() {
2764
+ // Update the layout content when selected option changes
2765
+ this.selectedOptionLayoutContent = this.selectedOption && this.isOptionLayout(this.selectedOption)
2766
+ ? this.getOptionLayoutContent(this.selectedOption)
2767
+ : '';
2768
+ // Update chip properties for automatic rendering when selected option changes
2769
+ this.selectedOptionChipProps = this.selectedOption && this.isOptionChip(this.selectedOption)
2770
+ ? this.getOptionChipProps(this.selectedOption)
2771
+ : null;
2772
+ // Update display text when selected option changes
2773
+ if (this.selectedOption) {
2774
+ this.displayText = this.getOptionLabel(this.selectedOption);
2775
+ this.value = this.selectedOption.value;
2776
+ // Update form internals with the actual option value
2777
+ this.updateFormValue(this.selectedOption.value);
2778
+ }
2779
+ else {
2780
+ this.displayText = '';
2781
+ this.value = '';
2782
+ this.updateFormValue('');
2783
+ }
2784
+ }
2785
+ updateFormValue(value) {
2786
+ if (form.isSpecTest())
2787
+ return;
2788
+ if (this.internals && this.internals.setFormValue) {
2789
+ this.internals.setFormValue(value);
2790
+ }
2791
+ }
2792
+ clearAsyncFetchState() {
2793
+ var _a;
2794
+ if (this.fetchDebounceTimer !== undefined) {
2795
+ window.clearTimeout(this.fetchDebounceTimer);
2796
+ this.fetchDebounceTimer = undefined;
2797
+ }
2798
+ if (this.fetchTimeoutTimer !== undefined) {
2799
+ window.clearTimeout(this.fetchTimeoutTimer);
2800
+ this.fetchTimeoutTimer = undefined;
2801
+ }
2802
+ (_a = this.abortController) === null || _a === void 0 ? void 0 : _a.abort();
2803
+ this.abortController = undefined;
2804
+ }
2805
+ debouncedFetchAsyncOptions(query, page = 1) {
2806
+ var _a;
2807
+ if (!this.asyncUrl)
2808
+ return;
2809
+ if (this.fetchDebounceTimer !== undefined) {
2810
+ window.clearTimeout(this.fetchDebounceTimer);
2811
+ }
2812
+ const delay = Math.max(0, (_a = this.debounce) !== null && _a !== void 0 ? _a : 0);
2813
+ this.fetchDebounceTimer = window.setTimeout(() => {
2814
+ this.fetchDebounceTimer = undefined;
2815
+ this.fetchOptions(query, page);
2816
+ }, delay);
2817
+ }
2818
+ async fetchOptions(query, page = 1) {
2819
+ var _a;
2820
+ if (!this.asyncUrl)
2821
+ return;
2822
+ // Abort any pending request and clear existing timeout
2823
+ (_a = this.abortController) === null || _a === void 0 ? void 0 : _a.abort();
2824
+ if (this.fetchTimeoutTimer !== undefined) {
2825
+ window.clearTimeout(this.fetchTimeoutTimer);
2826
+ this.fetchTimeoutTimer = undefined;
2827
+ }
2828
+ this.abortController = new AbortController();
2829
+ this.loading = true;
2830
+ // Set up timeout for fetch request
2831
+ this.fetchTimeoutTimer = window.setTimeout(() => {
2832
+ var _a;
2833
+ (_a = this.abortController) === null || _a === void 0 ? void 0 : _a.abort();
2834
+ this.fetchTimeoutTimer = undefined;
2835
+ }, this.fetchTimeout);
2836
+ try {
2837
+ // Guard against malformed asyncUrl
2838
+ let url;
2839
+ try {
2840
+ url = new URL(this.asyncUrl, window.location.origin);
2841
+ }
2842
+ catch (urlError) {
2843
+ throw new TypeError(`Invalid asyncUrl: ${this.asyncUrl}`);
2844
+ }
2845
+ if (this.asyncMethod === 'GET') {
2846
+ url.searchParams.set('search', query);
2847
+ url.searchParams.set('page', String(page));
2848
+ }
2849
+ const response = await fetch(url.toString(), Object.assign({ method: this.asyncMethod, signal: this.abortController.signal, headers: {
2850
+ 'Content-Type': 'application/json',
2851
+ 'Accept': 'application/json',
2852
+ } }, (this.asyncMethod === 'POST' && {
2853
+ body: JSON.stringify({ search: query, page }),
2854
+ })));
2855
+ // Clear timeout on successful response
2856
+ if (this.fetchTimeoutTimer !== undefined) {
2857
+ window.clearTimeout(this.fetchTimeoutTimer);
2858
+ this.fetchTimeoutTimer = undefined;
2859
+ }
2860
+ if (!response.ok)
2861
+ throw new Error('Failed to fetch options');
2862
+ const data = await response.json();
2863
+ const formattedResults = data.results.map(item => {
2864
+ // If formatResult is provided, use it
2865
+ if (this.formatResult) {
2866
+ return this.formatResult(item);
2867
+ }
2868
+ // Defensive check: ensure item is an object before spreading
2869
+ if (typeof item === 'object' && item !== null) {
2870
+ return Object.assign({ id: item.id, text: item.text }, item);
2871
+ }
2872
+ // Handle primitives by converting to safe shape
2873
+ return {
2874
+ id: String(item),
2875
+ text: String(item),
2876
+ };
2877
+ });
2878
+ if (page === 1) {
2879
+ this.internalOptions = formattedResults;
2880
+ // Only once its results have loaded: a failed or aborted fetch leaves the last query's.
2881
+ this.lastFetchedQuery = query;
2882
+ }
2883
+ else {
2884
+ this.internalOptions = [...this.internalOptions, ...formattedResults];
2885
+ }
2886
+ this.hasMore = data.totalCount ? this.internalOptions.length < data.totalCount : false;
2887
+ this.currentPage = page;
2888
+ // Update DOM options from async data
2889
+ this.updateOptionsFromAsync();
2890
+ }
2891
+ catch (error) {
2892
+ // Clear timeout on error
2893
+ if (this.fetchTimeoutTimer !== undefined) {
2894
+ window.clearTimeout(this.fetchTimeoutTimer);
2895
+ this.fetchTimeoutTimer = undefined;
2896
+ }
2897
+ if (error.name !== 'AbortError') {
2898
+ console.error('PdsCombobox: Failed to fetch options', error);
2899
+ }
2900
+ }
2901
+ finally {
2902
+ this.loading = false;
2903
+ }
2904
+ }
2905
+ updateOptionsFromAsync() {
2906
+ var _a;
2907
+ if (!this.asyncUrl && !this.options)
2908
+ return;
2909
+ // Clear existing slot-based options when using async
2910
+ this.optionEls = [];
2911
+ this.allItems = [];
2912
+ // Create option elements from async data. Grouped options are nested in an optgroup, as
2913
+ // slotted markup would be, so grouping, filtering and labels work the same either way. Each
2914
+ // group is listed where it first appears with all of its options, even when the data
2915
+ // interleaves groups, so an option never renders under another group's label. Ungrouped
2916
+ // options come first, so none reads as part of the group above it. The flyout and drill-in
2917
+ // panels draw groups as rows, where that can't happen, so they keep the data's order instead.
2918
+ const asyncOptions = this.options || this.internalOptions;
2919
+ const groups = new Map();
2920
+ const ungrouped = [];
2921
+ const groupEntries = [];
2922
+ this.panelPositions = new WeakMap();
2923
+ asyncOptions.forEach((opt, position) => {
2924
+ const optionEl = document.createElement('option');
2925
+ optionEl.value = String(opt.id);
2926
+ optionEl.textContent = opt.text;
2927
+ if (opt.disabled === true)
2928
+ optionEl.setAttribute('disabled', '');
2929
+ // Only strings group an option or name an icon; anything else from JS is ignored, not coerced.
2930
+ if (typeof opt.icon === 'string' && opt.icon !== '')
2931
+ optionEl.setAttribute('data-icon', opt.icon);
2932
+ this.setBadgeAttributes(optionEl, opt.badge);
2933
+ if (typeof opt.group !== 'string' || opt.group === '') {
2934
+ ungrouped.push(optionEl);
2935
+ this.panelPositions.set(optionEl, position);
2936
+ return;
2937
+ }
2938
+ let optgroup = groups.get(opt.group);
2939
+ if (!optgroup) {
2940
+ optgroup = document.createElement('optgroup');
2941
+ optgroup.label = opt.group;
2942
+ groups.set(opt.group, optgroup);
2943
+ groupEntries.push(optgroup);
2944
+ this.panelPositions.set(optgroup, position);
2945
+ }
2946
+ if (!optgroup.hasAttribute('data-icon') && typeof opt.groupIcon === 'string' && opt.groupIcon !== '') {
2947
+ optgroup.setAttribute('data-icon', opt.groupIcon);
2948
+ }
2949
+ if (!optgroup.hasAttribute('data-badge'))
2950
+ this.setBadgeAttributes(optgroup, opt.groupBadge);
2951
+ optgroup.appendChild(optionEl);
2952
+ });
2953
+ [...ungrouped, ...groupEntries].forEach(entry => {
2954
+ if (entry.tagName === 'OPTGROUP') {
2955
+ this.allItems.push(entry);
2956
+ Array.from(entry.children).forEach(child => {
2957
+ this.optionEls.push(child);
2958
+ this.allItems.push(child);
2959
+ });
2960
+ }
2961
+ else {
2962
+ this.optionEls.push(entry);
2963
+ this.allItems.push(entry);
2964
+ }
2965
+ });
2966
+ // A rebuild replaces every optgroup. Follow the open group to its new element by label, so the
2967
+ // flyout stays open across reloads and pagination, or close it if the group is gone. The hover
2968
+ // timers still hold the old element, so they're cleared either way. filterOptions, below,
2969
+ // resets the highlight.
2970
+ if (this.openGroup !== null && !groupEntries.includes(this.openGroup)) {
2971
+ this.flyout.reset();
2972
+ this.openGroup = (_a = groups.get(this.openGroup.label)) !== null && _a !== void 0 ? _a : null;
2973
+ }
2974
+ // Re-apply the selection to the rebuilt options: when `value` is set before async options have
2975
+ // loaded, and after any rebuild, which detaches the previously selected option element.
2976
+ if (this.value && (!this.selectedOption || !this.optionEls.includes(this.selectedOption))) {
2977
+ const matchingOption = this.optionEls.find(opt => opt.value === this.value);
2978
+ if (matchingOption) {
2979
+ // Relinking a selection keeps the same value, so it keeps any text being typed too, which
2980
+ // the selectedOption watcher would otherwise reset to the label.
2981
+ const typed = this.selectedOption ? this.displayText : undefined;
2982
+ this.setSelectedOption(matchingOption);
2983
+ if (typed !== undefined)
2984
+ this.displayText = typed;
2985
+ }
2986
+ }
2987
+ this.filterOptions();
2988
+ }
2989
+ updateOptions() {
2990
+ var _a;
2991
+ // Skip slot-based options if using async
2992
+ if (this.asyncUrl || this.options) {
2993
+ this.updateOptionsFromAsync();
2994
+ return;
2995
+ }
2996
+ // Get all elements from the slot. Before the first render there's no slot yet, so read the
2997
+ // host's own children that it will hold (through any slot passing options on): otherwise a
2998
+ // combobox created with a `value`, such as a form re-rendered after a pick, paints its
2999
+ // placeholder for a frame, until `slotchange` finds the selected option.
3000
+ const slot = (_a = this.el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('slot[name="option"], slot:not([name])');
3001
+ const allElements = slot
3002
+ ? slot.assignedElements({ flatten: true })
3003
+ : Array.from(this.el.children)
3004
+ .filter(el => !el.getAttribute('slot'))
3005
+ .flatMap(el => (el.tagName === 'SLOT' ? el.assignedElements({ flatten: true }) : [el]));
3006
+ // Separate options from group labels and flatten optgroups
3007
+ this.allItems = [];
3008
+ this.optionEls = [];
3009
+ allElements.forEach(el => {
3010
+ if (el.tagName === 'OPTION') {
3011
+ this.optionEls.push(el);
3012
+ this.allItems.push(el);
3013
+ }
3014
+ else if (el.tagName === 'OPTGROUP') {
3015
+ const optgroup = el;
3016
+ this.allItems.push(optgroup);
3017
+ // Add optgroup children (options)
3018
+ Array.from(optgroup.children).forEach(child => {
3019
+ if (child.tagName === 'OPTION') {
3020
+ this.optionEls.push(child);
3021
+ this.allItems.push(child);
3022
+ }
3023
+ });
3024
+ }
3025
+ else if (el.tagName === 'PDS-TEXT') {
3026
+ this.allItems.push(el);
3027
+ }
3028
+ });
3029
+ // Set initial selected option based on value property
3030
+ let initialSelected = null;
3031
+ // Check if value property matches any option
3032
+ if (this.value) {
3033
+ initialSelected = this.optionEls.find(opt => opt.value === this.value) || null;
3034
+ if (initialSelected) {
3035
+ // Update the display text to show the option's text content
3036
+ this.displayText = this.getOptionLabel(initialSelected);
3037
+ // Keep this.value as the actual option value (already correct)
3038
+ }
3039
+ }
3040
+ // For chip triggers, ensure we always have a selected option
3041
+ const firstEnabled = this.optionEls.find(opt => !isOptionDisabled(opt));
3042
+ if (initialSelected === null && this.trigger === 'chip' && firstEnabled !== undefined) {
3043
+ initialSelected = firstEnabled;
3044
+ this.value = initialSelected.value;
3045
+ this.displayText = this.getOptionLabel(initialSelected);
3046
+ console.warn('PDS Combobox: Chip triggers should always have a selected option. Automatically selected the first enabled option.');
3047
+ }
3048
+ // Update selection if we found a different selected option or if we don't have one
3049
+ if (initialSelected && initialSelected !== this.selectedOption) {
3050
+ this.setSelectedOption(initialSelected);
3051
+ }
3052
+ else if (!this.selectedOption && initialSelected) {
3053
+ this.setSelectedOption(initialSelected);
3054
+ }
3055
+ this.filterOptions();
3056
+ }
3057
+ // Helper method to get option label, falling back to text content if no label attribute
3058
+ getOptionLabel(option) {
3059
+ return option.label || option.textContent || '';
3060
+ }
3061
+ // Helper method to get option layout content
3062
+ getOptionLayoutContent(option) {
3063
+ return this.sanitizeHtml(option.innerHTML || '');
3064
+ }
3065
+ // HTML sanitization using DOMPurify library to prevent XSS attacks
3066
+ sanitizeHtml(html) {
3067
+ // Configure DOMPurify to allow Pine Design System components while removing dangerous content
3068
+ const config = {
3069
+ // Allow all custom elements (including pds-* components)
3070
+ CUSTOM_ELEMENT_HANDLING: {
3071
+ tagNameCheck: (tagName) => {
3072
+ // Allow all pds-* tags and standard safe HTML tags
3073
+ return tagName.startsWith('pds-') || /^[a-z]+$/i.test(tagName);
3074
+ },
3075
+ attributeNameCheck: (attr) => {
3076
+ // Allow standard HTML attributes, data-* attributes, and Pine component attributes
3077
+ return /^[a-zA-Z][a-zA-Z0-9-]*$/.test(attr) || attr.startsWith('data-') || attr.startsWith('aria-');
3078
+ },
3079
+ allowCustomizedBuiltInElements: false,
3080
+ },
3081
+ // Allow standard safe attributes
3082
+ ALLOW_DATA_ATTR: true,
3083
+ ALLOW_ARIA_ATTR: true,
3084
+ // Specifically forbid dangerous tags
3085
+ FORBID_TAGS: ['script', 'iframe', 'object', 'embed', 'form', 'input', 'textarea', 'select', 'button', 'style'],
3086
+ // Forbid all event handler attributes
3087
+ FORBID_ATTR: [
3088
+ 'onerror', 'onload', 'onclick', 'onmouseover', 'onmouseout', 'onmousemove',
3089
+ 'onfocus', 'onblur', 'onchange', 'onsubmit', 'onkeydown', 'onkeyup', 'onkeypress',
3090
+ 'onmousedown', 'onmouseup', 'ondblclick', 'oncontextmenu', 'onscroll'
3091
+ ],
3092
+ // Safe protocol whitelist
3093
+ ALLOWED_URI_REGEXP: /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,
3094
+ };
3095
+ return purify.sanitize(html, config);
3096
+ }
3097
+ // Helper method to check if option should render as layout
3098
+ isOptionLayout(option) {
3099
+ return this.customOptionLayouts && option.hasAttribute('data-layout');
3100
+ }
3101
+ // Helper method to check if option has chip attributes (new automatic approach)
3102
+ isOptionChip(option) {
3103
+ return option.hasAttribute('chip-sentiment') ||
3104
+ option.hasAttribute('chip-large') ||
3105
+ option.hasAttribute('chip-icon') ||
3106
+ option.hasAttribute('chip-dot');
3107
+ }
3108
+ // Helper method to get chip properties from option attributes
3109
+ getOptionChipProps(option) {
3110
+ return {
3111
+ sentiment: option.getAttribute('chip-sentiment') || 'neutral',
3112
+ large: option.hasAttribute('chip-large'),
3113
+ icon: option.getAttribute('chip-icon') || undefined,
3114
+ dot: option.hasAttribute('chip-dot')
3115
+ };
3116
+ }
3117
+ // Helper method to check if option is selected (single source of truth)
3118
+ isOptionSelected(option) {
3119
+ return this.selectedOption === option;
3120
+ }
3121
+ // Helper method to set selected option (centralized state management)
3122
+ setSelectedOption(option) {
3123
+ this.selectedOption = option;
3124
+ // Immediately update chip properties for automatic rendering to ensure reactivity
3125
+ if (option && this.isOptionChip(option)) {
3126
+ this.selectedOptionChipProps = this.getOptionChipProps(option);
3127
+ }
3128
+ else {
3129
+ this.selectedOptionChipProps = null;
3130
+ }
3131
+ // Immediately update layout content too, the same way: the @Watch('selectedOption') below
3132
+ // isn't active yet the first time this runs, during componentWillLoad's initial selection,
3133
+ // so a preselected layout option would otherwise show its plain label until some later change
3134
+ // triggers the watcher.
3135
+ this.selectedOptionLayoutContent = option && this.isOptionLayout(option)
3136
+ ? this.getOptionLayoutContent(option)
3137
+ : '';
3138
+ }
3139
+ filterOptions() {
3140
+ // A new list replaces the rows a slide or height glide was animating, so their end events may
3141
+ // never come.
3142
+ this.drillDirection = null;
3143
+ this.endHeightGlide();
3144
+ // Ensure allItems includes optionEls if not already populated (for edge cases)
3145
+ if (this.allItems.length === 0 && this.optionEls.length > 0) {
3146
+ this.allItems = [...this.optionEls];
3147
+ }
3148
+ const searchesPanel = this.usesPanelSearch;
3149
+ if ((this.mode === 'select-only' && !searchesPanel) || this.expandFilterListWhileOpen || (searchesPanel && this.panelQuery === '')) {
3150
+ this.filteredItems = [...this.allItems];
3151
+ }
3152
+ else {
3153
+ const val = (searchesPanel ? this.panelQuery : this.displayText).toLowerCase();
3154
+ const filteredOptions = this.optionEls.filter(option => {
3155
+ // Outside inline mode a group's label is part of what search matches, so "tag" finds
3156
+ // every option in the Tag group.
3157
+ if (this.groupDisplay !== 'inline') {
3158
+ const groupLabel = groupLabelOf(option);
3159
+ if (groupLabel !== null && groupLabel.toLowerCase().includes(val))
3160
+ return true;
3161
+ }
3162
+ // `data-search-text`, when set, is what search matches, so an option can be found by more
3163
+ // than its label without a custom layout. A layout option otherwise matches its text.
3164
+ const searchText = option.getAttribute('data-search-text');
3165
+ if (searchText)
3166
+ return searchText.toLowerCase().includes(val);
3167
+ if (this.isOptionLayout(option))
3168
+ return (option.textContent || '').toLowerCase().includes(val);
3169
+ return this.getOptionLabel(option).toLowerCase().includes(val);
3170
+ });
3171
+ // Rebuild filtered items maintaining group structure - simplified approach
3172
+ this.filteredItems = [];
3173
+ let currentGroupLabel = null;
3174
+ this.allItems.forEach(item => {
3175
+ if (item.tagName === 'OPTGROUP' || item.tagName === 'PDS-TEXT') {
3176
+ currentGroupLabel = item;
3177
+ }
3178
+ else if (item.tagName === 'OPTION' && filteredOptions.includes(item)) {
3179
+ const optionEl = item;
3180
+ const parent = optionEl.parentElement;
3181
+ let labelToUse = null;
3182
+ if (parent && parent.tagName === 'OPTGROUP') {
3183
+ // Only use the actual parent optgroup as label
3184
+ labelToUse = parent;
3185
+ }
3186
+ else if (currentGroupLabel && currentGroupLabel.tagName === 'PDS-TEXT') {
3187
+ // Allow pds-text to label subsequent top-level options until another label appears
3188
+ labelToUse = currentGroupLabel;
3189
+ }
3190
+ if (labelToUse && !this.filteredItems.includes(labelToUse)) {
3191
+ this.filteredItems.push(labelToUse);
3192
+ }
3193
+ this.filteredItems.push(optionEl);
3194
+ }
3195
+ });
3196
+ }
3197
+ this.highlightedIndex = -1;
3198
+ this.highlightedGroup = null;
3199
+ }
3200
+ clearExpandFilterList() {
3201
+ this.expandFilterListWhileOpen = false;
3202
+ }
3203
+ /**
3204
+ * When reopening the dropdown in filter mode with the input still showing the
3205
+ * committed selection label, show the full option list until the user edits the query.
3206
+ */
3207
+ prepareExpandFilterListOnOpen() {
3208
+ if (this.mode === 'filter' &&
3209
+ this.selectedOption &&
3210
+ this.displayText === this.getOptionLabel(this.selectedOption)) {
3211
+ this.expandFilterListWhileOpen = true;
3212
+ }
3213
+ else {
3214
+ this.expandFilterListWhileOpen = false;
3215
+ }
3216
+ }
3217
+ positionDropdown() {
3218
+ var _a;
3219
+ if (!this.triggerEl || !this.listboxEl) {
3220
+ return;
3221
+ }
3222
+ const strategy = this.usesBodyPortal ? 'fixed' : 'absolute';
3223
+ const zIndex = this.usesBodyPortal
3224
+ ? 'var(--pine-z-index-priority)'
3225
+ : 'var(--pine-z-index-raised)';
3226
+ // Unset, the panel's own width applies, which differs with its padding (see the dropdown panel styles).
3227
+ this.listboxEl.style.width = (_a = this.dropdownWidth) !== null && _a !== void 0 ? _a : '';
3228
+ if (this.maxHeight) {
3229
+ this.listboxEl.style.maxHeight = this.maxHeight;
3230
+ // With panel search, the options list scrolls under a fixed search field.
3231
+ this.syncPanelOverflow();
3232
+ }
3233
+ return floatingUi_dom.computePosition(this.triggerEl, this.listboxEl, {
3234
+ placement: this.dropdownPlacement,
3235
+ strategy,
3236
+ middleware: [floatingUi_dom.offset(8), floatingUi_dom.flip(), floatingUi_dom.shift({ padding: 5 })],
3237
+ }).then(({ x, y, placement }) => {
3238
+ if (!this.listboxEl) {
3239
+ return;
3240
+ }
3241
+ // Where it landed after flipping, so the opening motion moves away from the field.
3242
+ this.listboxEl.dataset.placement = placement;
3243
+ Object.assign(this.listboxEl.style, {
3244
+ left: `${x}px`,
3245
+ top: `${y}px`,
3246
+ position: strategy,
3247
+ zIndex,
3248
+ });
3249
+ this.checkFlyoutRoom();
3250
+ });
3251
+ }
3252
+ /**
3253
+ * Once per open, after the dropdown is placed: with no room for a flyout on either side of it,
3254
+ * `flyout` drills in instead. `flyout-min-width` is resolved through CSS, so any length works.
3255
+ */
3256
+ checkFlyoutRoom() {
3257
+ if (!this.isOpen || this.groupDisplay !== 'flyout' || this.flyoutRoomChecked || !this.listboxEl)
3258
+ return;
3259
+ this.flyoutRoomChecked = true;
3260
+ const probe = document.createElement('div');
3261
+ // Fixed, like the flyout, so a percentage resolves against the viewport as the flyout's does.
3262
+ probe.style.cssText = 'position:fixed;visibility:hidden;width:0;';
3263
+ probe.style.minWidth = this.flyoutMinWidth;
3264
+ this.listboxEl.appendChild(probe);
3265
+ const needed = parseFloat(getComputedStyle(probe).minWidth);
3266
+ probe.remove();
3267
+ const rect = this.listboxEl.getBoundingClientRect();
3268
+ const room = Math.max(window.innerWidth - rect.right, rect.left);
3269
+ const fallback = Number.isFinite(needed) && needed > 0 && rect.width > 0 && room < needed;
3270
+ if (fallback !== this.flyoutFallback)
3271
+ this.flyoutFallback = fallback;
3272
+ }
3273
+ openDropdownPositioning() {
3274
+ if (!this.triggerEl || !this.listboxEl) {
3275
+ return;
3276
+ }
3277
+ void this.positionDropdown();
3278
+ }
3279
+ startBodyPortalAutoUpdate() {
3280
+ if (this.bodyPortalAutoUpdateActive || !this.triggerEl || !this.listboxEl) {
3281
+ return;
3282
+ }
3283
+ this.cleanupPositionAutoUpdate = floatingUi_dom.autoUpdate(this.triggerEl, this.listboxEl, () => {
3284
+ void this.positionDropdown();
3285
+ });
3286
+ this.bodyPortalAutoUpdateActive = true;
3287
+ }
3288
+ stopBodyPortalAutoUpdate() {
3289
+ var _a;
3290
+ (_a = this.cleanupPositionAutoUpdate) === null || _a === void 0 ? void 0 : _a.call(this);
3291
+ this.cleanupPositionAutoUpdate = undefined;
3292
+ this.bodyPortalAutoUpdateActive = false;
3293
+ }
3294
+ getPortalMountRoot() {
3295
+ var _a;
3296
+ return (_a = this.findNearestDialogForPortal(this.el)) !== null && _a !== void 0 ? _a : document.body;
3297
+ }
3298
+ /**
3299
+ * Resolves the native `<dialog>` to host the portaled listbox so it stays in the same top layer
3300
+ * as `showModal()`. `Element.closest('dialog')` stops at shadow boundaries and can miss a
3301
+ * dialog that only wraps slotted content; this walks assigned slots and shadow hosts, and
3302
+ * falls back to `pds-modal`'s dialog when the combobox lives inside that subtree.
3303
+ */
3304
+ findNearestDialogForPortal(from) {
3305
+ const seen = new Set();
3306
+ let current = from;
3307
+ while (current && !seen.has(current)) {
3308
+ seen.add(current);
3309
+ if (current.nodeType === Node.ELEMENT_NODE && current.localName === 'dialog') {
3310
+ return current;
3311
+ }
3312
+ if (current.nodeType === Node.ELEMENT_NODE) {
3313
+ const assigned = current.assignedSlot;
3314
+ if (assigned) {
3315
+ current = assigned;
3316
+ continue;
3317
+ }
3318
+ }
3319
+ const parent = current.parentNode;
3320
+ if (parent) {
3321
+ current = parent instanceof ShadowRoot ? parent.host : parent;
3322
+ continue;
3323
+ }
3324
+ break;
3325
+ }
3326
+ const pineModal = from.closest('pds-modal');
3327
+ if (pineModal) {
3328
+ const pineDialog = pineModal.querySelector('dialog');
3329
+ if (pineDialog) {
3330
+ return pineDialog;
3331
+ }
3332
+ }
3333
+ return null;
3334
+ }
3335
+ ensureBodyPortal() {
3336
+ if (this.portalEl !== null) {
3337
+ const target = this.getPortalMountRoot();
3338
+ if (this.portalEl.parentElement !== target) {
3339
+ target.appendChild(this.portalEl);
3340
+ // What differs from the new parent may not be what differed from the old one.
3341
+ this.copyPortalContext();
3342
+ }
3343
+ return this.portalEl;
3344
+ }
3345
+ this.portalEl = document.createElement('div');
3346
+ this.portalEl.className = 'pds-combobox-dropdown-portal';
3347
+ // The copied stylesheet's `:host` rules match this div too; keep it out of layout. It still
3348
+ // passes `dir` and the theme down.
3349
+ this.portalEl.style.display = 'contents';
3350
+ this.portalRoot = this.portalEl.attachShadow({ mode: 'open' });
3351
+ this.getPortalMountRoot().appendChild(this.portalEl);
3352
+ this.copyPortalContext();
3353
+ return this.portalEl;
3354
+ }
3355
+ /**
3356
+ * Gives the portal what the dropdown would otherwise get inside the combobox: its styles (so it
3357
+ * needs no global CSS), the reading direction and language, a theme set on an ancestor, and
3358
+ * custom properties set between the combobox and where the portal mounts. A snapshot: the portal
3359
+ * is rebuilt on every open, so a theme switched while it's open applies from the next open.
3360
+ */
3361
+ copyPortalContext() {
3362
+ var _a, _b, _c;
3363
+ const portal = this.portalEl;
3364
+ const root = this.portalRoot;
3365
+ const source = this.el.shadowRoot;
3366
+ if (!portal || !root)
3367
+ return;
3368
+ if ((_a = source === null || source === void 0 ? void 0 : source.adoptedStyleSheets) === null || _a === void 0 ? void 0 : _a.length) {
3369
+ root.adoptedStyleSheets = source.adoptedStyleSheets;
3370
+ }
3371
+ else if (source && !root.querySelector('style')) {
3372
+ source.querySelectorAll('style').forEach(style => root.appendChild(style.cloneNode(true)));
3373
+ }
3374
+ const computed = getComputedStyle(this.el);
3375
+ portal.dir = computed.direction || 'ltr';
3376
+ const lang = (_b = closest.closest('[lang]', this.el)) === null || _b === void 0 ? void 0 : _b.getAttribute('lang');
3377
+ if (lang)
3378
+ portal.lang = lang;
3379
+ const theme = (_c = closest.closest('[data-theme]', this.el)) === null || _c === void 0 ? void 0 : _c.getAttribute('data-theme');
3380
+ if (theme)
3381
+ portal.setAttribute('data-theme', theme);
3382
+ const outside = portal.parentElement ? getComputedStyle(portal.parentElement) : null;
3383
+ for (let i = 0; i < computed.length; i++) {
3384
+ const property = computed[i];
3385
+ if (!property.startsWith('--'))
3386
+ continue;
3387
+ const value = computed.getPropertyValue(property);
3388
+ if (outside && value === outside.getPropertyValue(property))
3389
+ continue;
3390
+ portal.style.setProperty(property, value.trim());
3391
+ }
3392
+ }
3393
+ syncBodyPortal() {
3394
+ if (!this.listboxEl) {
3395
+ return;
3396
+ }
3397
+ this.ensureBodyPortal();
3398
+ const root = this.portalRoot;
3399
+ for (const stale of Array.from(root.children)) {
3400
+ if (stale !== this.listboxEl && stale.tagName !== 'STYLE') {
3401
+ stale.remove();
3402
+ }
3403
+ }
3404
+ if (this.listboxEl.parentNode !== root) {
3405
+ root.appendChild(this.listboxEl);
3406
+ void this.positionDropdown();
3407
+ this.startBodyPortalAutoUpdate();
3408
+ }
3409
+ }
3410
+ removeBodyPortal() {
3411
+ var _a;
3412
+ this.stopBodyPortalAutoUpdate();
3413
+ if ((_a = this.portalEl) === null || _a === void 0 ? void 0 : _a.parentNode) {
3414
+ this.portalEl.parentNode.removeChild(this.portalEl);
3415
+ }
3416
+ this.portalEl = null;
3417
+ this.portalRoot = null;
3418
+ if (this.listboxEl && !this.listboxEl.isConnected) {
3419
+ this.listboxEl = undefined;
3420
+ }
3421
+ }
3422
+ /**
3423
+ * The tree keys in the grouped panel. Up, Down, Home, End, PageUp and PageDown move within one
3424
+ * level; Right, Enter or Space opens a group at its first option; Left, or Escape, closes the
3425
+ * open group back to its row. Returns false for keys the listbox handling covers, such as
3426
+ * Enter on an option.
3427
+ */
3428
+ handleGroupedPanelKey(e) {
3429
+ if (!this.showsGroupedPanel)
3430
+ return false;
3431
+ const highlightShown = this.keyboardNavigating;
3432
+ this.keyboardNavigating = true;
3433
+ // In the input trigger, Left and Right still move the caret through typed text, and Space,
3434
+ // Home and End edit it, as they do in the panel's search field.
3435
+ if (this.trigger === 'input') {
3436
+ if ((e.key === 'ArrowLeft' || e.key === 'ArrowRight') && this.displayText !== '')
3437
+ return false;
3438
+ if (e.key === ' ' || e.key === 'Home' || e.key === 'End')
3439
+ return false;
3440
+ }
3441
+ const entries = this.panelEntries();
3442
+ const drilledIn = this.effectiveGroupDisplay === 'drill-in' && this.openGroup !== null;
3443
+ const current = this.currentPanelItem();
3444
+ const column = panelColumn(entries, this.openGroup, current, drilledIn);
3445
+ if (column.length === 0)
3446
+ return false;
3447
+ const position = current === null ? -1 : column.indexOf(current);
3448
+ // Drill-in doesn't shade a group row the pointer or a click-open highlighted, so the first Up or
3449
+ // Down shows that row rather than moving past one the user never saw.
3450
+ const unseenRow = !highlightShown && this.effectiveGroupDisplay === 'drill-in' && current !== null && typeof current !== 'number' && current !== this.openGroup;
3451
+ const moveTo = (to) => {
3452
+ e.preventDefault();
3453
+ this.highlightPanelItem(column[Math.max(0, Math.min(column.length - 1, to))]);
3454
+ this.revealedGroupLabel = null;
3455
+ return true;
3456
+ };
3457
+ const reveal = () => {
3458
+ e.preventDefault();
3459
+ // The row's name, badge and all, as the row itself is named.
3460
+ const optgroup = current;
3461
+ const badge = groupBadgeOf(optgroup);
3462
+ this.revealedGroupLabel = badge === null ? optgroup.label : `${optgroup.label}, ${badge.label}`;
3463
+ return true;
3464
+ };
3465
+ switch (e.key) {
3466
+ case 'ArrowDown':
3467
+ return unseenRow ? reveal() : moveTo(position < 0 ? 0 : position + 1);
3468
+ case 'ArrowUp':
3469
+ return unseenRow ? reveal() : moveTo(position < 0 ? column.length - 1 : position - 1);
3470
+ case 'Home':
3471
+ return moveTo(0);
3472
+ case 'End':
3473
+ return moveTo(column.length - 1);
3474
+ case 'PageDown':
3475
+ return moveTo(position < 0 ? 0 : position + 10);
3476
+ case 'PageUp':
3477
+ return moveTo(position < 0 ? column.length - 1 : position - 10);
3478
+ case 'ArrowRight':
3479
+ case 'Enter':
3480
+ case ' ': {
3481
+ if (current === null || typeof current === 'number')
3482
+ return false;
3483
+ e.preventDefault();
3484
+ if (!drilledIn || current !== this.openGroup) {
3485
+ this.expandGroup(entries, current);
3486
+ }
3487
+ else if (e.key === 'ArrowRight') {
3488
+ // On the row back of a drilled-in group: down into its options.
3489
+ if (column.length > 1)
3490
+ this.highlightPanelItem(column[1]);
3491
+ }
3492
+ else {
3493
+ this.leaveDrilledInGroup();
3494
+ }
3495
+ return true;
3496
+ }
3497
+ case 'ArrowLeft':
3498
+ case 'Escape': {
3499
+ // Escape with no group open closes the panel, through the listbox handling.
3500
+ if (this.openGroup === null)
3501
+ return false;
3502
+ e.preventDefault();
3503
+ this.collapseToGroup(this.openGroup);
3504
+ return true;
3505
+ }
3506
+ }
3507
+ return false;
3508
+ }
3509
+ /**
3510
+ * Where the keyboard is in the grouped panel. An option highlighted in a group that has since
3511
+ * closed (the pointer left its flyout) counts as its group's row, so the keys carry on from
3512
+ * what's showing rather than from an option that isn't.
3513
+ */
3514
+ currentPanelItem() {
3515
+ if (this.highlightedIndex < 0)
3516
+ return this.highlightedGroup;
3517
+ const selectable = this.filteredItems.filter(item => item.tagName === 'OPTION');
3518
+ const group = parentOptgroupOf(selectable[this.highlightedIndex]);
3519
+ return group !== null && group !== this.openGroup ? group : this.highlightedIndex;
3520
+ }
3521
+ /**
3522
+ * Highlights the option at `index`, kept within the list. Disabled options can be highlighted,
3523
+ * so assistive tech announces them as unavailable, but not chosen.
3524
+ */
3525
+ highlightOptionAt(options, index) {
3526
+ if (options.length === 0)
3527
+ return;
3528
+ // Only the keys move it, so it shows the keyboard's ring, as in the grouped panel.
3529
+ this.keyboardNavigating = true;
3530
+ this.highlightedIndex = Math.max(0, Math.min(options.length - 1, index));
3531
+ this.updateOptionFocus();
3532
+ }
3533
+ /** Highlights a group row or an option, opening or closing flyouts to match. */
3534
+ highlightPanelItem(item) {
3535
+ if (typeof item === 'number') {
3536
+ this.highlightedIndex = item;
3537
+ }
3538
+ else {
3539
+ this.highlightedIndex = -1;
3540
+ this.highlightedGroup = item;
3541
+ }
3542
+ this.updateOptionFocus();
3543
+ }
3544
+ expandGroup(entries, optgroup) {
3545
+ var _a;
3546
+ this.flyout.open(optgroup);
3547
+ const first = (_a = findGroup(entries, optgroup)) === null || _a === void 0 ? void 0 : _a.options[0];
3548
+ if (first !== undefined)
3549
+ this.highlightPanelItem(first.index);
3550
+ // Its options render after this change; scroll to the first one then.
3551
+ this.pendingOptionFocus = true;
3552
+ }
3553
+ /** Closes the open group and highlights its row, as a tree's Left does from a child. */
3554
+ collapseToGroup(optgroup) {
3555
+ this.flyout.reset();
3556
+ this.openGroup = null;
3557
+ this.highlightPanelItem(optgroup);
3558
+ // The row renders after this change (in drill-in it replaces the row back); scroll to it then.
3559
+ this.pendingOptionFocus = true;
3560
+ }
3561
+ /**
3562
+ * Sets focus on the native input element.
3563
+ */
3564
+ async setFocus() {
3565
+ var _a;
3566
+ if (this.inputEl) {
3567
+ this.inputEl.focus();
3568
+ }
3569
+ else {
3570
+ (_a = this.triggerEl) === null || _a === void 0 ? void 0 : _a.focus();
3571
+ }
3572
+ }
3573
+ /**
3574
+ * Sets the initial highlighted index when dropdown opens. Highlights the selected option unless
3575
+ * it's disabled. Otherwise highlights the first enabled option, or, in the grouped panel, the
3576
+ * first row with something to choose, or nothing when every option is disabled.
3577
+ */
3578
+ setInitialHighlightedIndex() {
3579
+ const selectableOptions = this.filteredItems.filter(item => item.tagName === 'OPTION');
3580
+ if (selectableOptions.length === 0) {
3581
+ this.highlightedIndex = -1;
3582
+ return;
3583
+ }
3584
+ // If there's a selected option, find its index in the filtered options. A disabled one can be
3585
+ // the value, as in a native select, but it isn't highlighted.
3586
+ if (this.selectedOption && !isOptionDisabled(this.selectedOption)) {
3587
+ const selectedIndex = selectableOptions.findIndex(option => option === this.selectedOption);
3588
+ if (selectedIndex >= 0) {
3589
+ this.highlightedIndex = selectedIndex;
3590
+ // In the grouped panel, open on the selection's group, however the dropdown was opened, and
3591
+ // scroll the selection into view once its group has rendered.
3592
+ if (this.showsGroupedPanel) {
3593
+ this.openGroup = parentOptgroupOf(this.selectedOption);
3594
+ // Opening on the selection isn't drilling in, so it doesn't slide.
3595
+ this.drillDirection = null;
3596
+ this.pendingOptionFocus = true;
3597
+ }
3598
+ return;
3599
+ }
3600
+ }
3601
+ // In the grouped panel, the first row with something to choose: a group stays closed until
3602
+ // it's opened.
3603
+ if (this.showsGroupedPanel) {
3604
+ const first = this.panelEntries().find(entry => entry.kind === 'group' ? !isGroupDisabled(entry.group) : !isOptionDisabled(entry.option));
3605
+ this.highlightedIndex = (first === null || first === void 0 ? void 0 : first.kind) === 'option' ? first.index : -1;
3606
+ this.highlightedGroup = (first === null || first === void 0 ? void 0 : first.kind) === 'group' ? first.group.optgroup : null;
3607
+ return;
3608
+ }
3609
+ // No selected option or selected option not in filtered results, highlight the first enabled option
3610
+ this.highlightedIndex = selectableOptions.findIndex(option => !isOptionDisabled(option));
3611
+ }
3612
+ /**
3613
+ * Focus management helper - moves focus to the first option when dropdown opens
3614
+ */
3615
+ focusFirstOption() {
3616
+ if (this.isOpen) {
3617
+ const selectableOptions = this.filteredItems.filter(item => item.tagName === 'OPTION');
3618
+ if (selectableOptions.length > 0) {
3619
+ this.setInitialHighlightedIndex();
3620
+ // DON'T focus the option elements - keep focus on trigger and use aria-activedescendant
3621
+ // This prevents the focusout event that was closing the dropdown
3622
+ // But still call updateOptionFocus for scrolling
3623
+ if (this.listboxEl) {
3624
+ this.updateOptionFocus();
3625
+ }
3626
+ }
3627
+ }
3628
+ }
3629
+ /**
3630
+ * Focus management helper - actually focuses the first option when opened via arrow keys
3631
+ */
3632
+ focusFirstOptionForArrowKeys() {
3633
+ if (!this.isOpen) {
3634
+ return;
3635
+ }
3636
+ // Body-mounted listboxes stay outside modal focus traps; keep focus on the trigger.
3637
+ if (this.usesBodyPortal) {
3638
+ this.isArrowKeyNavigationMode = true;
3639
+ this.focusFirstOption();
3640
+ return;
3641
+ }
3642
+ this.isArrowKeyNavigationMode = true;
3643
+ const selectableOptions = this.filteredItems.filter(item => item.tagName === 'OPTION');
3644
+ if (selectableOptions.length > 0) {
3645
+ this.setInitialHighlightedIndex();
3646
+ // By index, through the same path as arrowing: it opens the option's flyout group first
3647
+ // when it isn't rendered, and highlights it once it is.
3648
+ this.updateOptionFocus();
3649
+ }
3650
+ }
3651
+ /**
3652
+ * Focus management helper - updates visual state and scrolling for the currently highlighted option
3653
+ * Note: We don't actually focus the option to prevent focusout events that close the dropdown
3654
+ */
3655
+ updateOptionFocus() {
3656
+ var _a;
3657
+ if (this.listboxEl === undefined || this.listboxEl === null)
3658
+ return;
3659
+ // A row highlighted outright; an option highlighted in a closed group opens it below instead.
3660
+ const groupRow = this.showsGroupedPanel && this.highlightedIndex < 0 ? this.highlightedGroup : null;
3661
+ if (groupRow !== null) {
3662
+ // Arrowing onto another row closes a flyout that hover left open.
3663
+ if (this.effectiveGroupDisplay === 'flyout' && this.openGroup !== null && this.openGroup !== groupRow) {
3664
+ this.flyout.reset();
3665
+ this.openGroup = null;
3666
+ }
3667
+ // Matched by id, not a selector: componentId is consumer text and may not be selector-safe.
3668
+ const id = this.groupDomId(groupRow);
3669
+ const row = Array.from(this.listboxEl.querySelectorAll('[role="treeitem"]'))
3670
+ .find(item => item.id === id);
3671
+ // The row's trigger, not its item: the row back's item wraps the group's options, and showing
3672
+ // all of a group taller than the list would scroll the row back itself out of view.
3673
+ const trigger = Array.from((_a = row === null || row === void 0 ? void 0 : row.children) !== null && _a !== void 0 ? _a : []).find(child => child.classList.contains('pds-combobox__group-row-trigger'));
3674
+ if (trigger)
3675
+ this.scrollIntoViewNearest(trigger, false);
3676
+ this.updateAriaActiveDescendant();
3677
+ return;
3678
+ }
3679
+ if (this.highlightedIndex < 0)
3680
+ return;
3681
+ // In the flyout panel only the open group's options are rendered: open the highlighted
3682
+ // option's group, and finish once it has rendered. Through the controller, so a hover timer
3683
+ // left running by the pointer can't close or switch the group the keys just moved into.
3684
+ if (this.showsGroupedPanel) {
3685
+ const selectable = this.filteredItems.filter(item => item.tagName === 'OPTION');
3686
+ const group = parentOptgroupOf(selectable[this.highlightedIndex]);
3687
+ const changed = group !== this.openGroup;
3688
+ if (group !== null) {
3689
+ this.flyout.open(group);
3690
+ }
3691
+ else {
3692
+ this.flyout.reset();
3693
+ this.openGroup = null;
3694
+ }
3695
+ if (changed) {
3696
+ this.pendingOptionFocus = true;
3697
+ return;
3698
+ }
3699
+ }
3700
+ const optionElements = this.listboxEl.querySelectorAll('[role="option"]');
3701
+ // By index, not position: the flyout panel renders only some options.
3702
+ const currentOption = this.listboxEl.querySelector(`[data-option-index="${this.highlightedIndex}"]`);
3703
+ if (currentOption) {
3704
+ // Check if any option currently has focus OR if we're in arrow-key navigation mode
3705
+ const hasOptionFocus = Array.from(optionElements).some(el => el === document.activeElement);
3706
+ // The panel's search field keeps focus and points at the option with aria-activedescendant,
3707
+ // and so does the trigger over the grouped panel, whose group rows can't take focus and
3708
+ // whose options are hidden while a flyout is placed.
3709
+ const shouldFocusOption = !this.usesBodyPortal &&
3710
+ !this.usesPanelSearch &&
3711
+ !this.showsGroupedPanel &&
3712
+ (hasOptionFocus || this.isArrowKeyNavigationMode);
3713
+ if (shouldFocusOption) {
3714
+ optionElements.forEach(option => {
3715
+ option.setAttribute('tabindex', '-1');
3716
+ });
3717
+ currentOption.setAttribute('tabindex', '0');
3718
+ currentOption.focus();
3719
+ }
3720
+ // Always scroll the option into view; in a flyout, by scrolling the flyout alone.
3721
+ const flyout = currentOption.closest('.pds-combobox__flyout');
3722
+ if (flyout) {
3723
+ this.flyout.reveal(flyout, currentOption);
3724
+ }
3725
+ else {
3726
+ this.scrollIntoViewNearest(currentOption, true);
3727
+ }
3728
+ }
3729
+ // Always update aria-activedescendant on the trigger element
3730
+ this.updateAriaActiveDescendant();
3731
+ }
3732
+ /** The highlighted group row in the grouped panel, or null while an option is highlighted. */
3733
+ get highlightedGroupRow() {
3734
+ if (!this.showsGroupedPanel)
3735
+ return null;
3736
+ if (this.highlightedIndex < 0)
3737
+ return this.highlightedGroup;
3738
+ // An option left highlighted in a flyout that has since closed shows as its group's row.
3739
+ const current = this.currentPanelItem();
3740
+ return typeof current === 'number' ? null : current;
3741
+ }
3742
+ /**
3743
+ * The id of the highlighted option or group row, only while it's rendered. In the flyout panel
3744
+ * an option in a closed group isn't in the DOM, and drilled into a group the other groups' rows
3745
+ * aren't; `aria-activedescendant` must not point at a missing element.
3746
+ */
3747
+ get activeDescendantId() {
3748
+ if (!this.isOpen)
3749
+ return undefined;
3750
+ const groupRow = this.highlightedGroupRow;
3751
+ if (groupRow !== null) {
3752
+ const drilledIntoAnother = this.effectiveGroupDisplay === 'drill-in' && this.openGroup !== null && this.openGroup !== groupRow;
3753
+ return drilledIntoAnother ? undefined : this.groupDomId(groupRow);
3754
+ }
3755
+ if (this.highlightedIndex < 0)
3756
+ return undefined;
3757
+ if (this.showsGroupedPanel) {
3758
+ const selectable = this.filteredItems.filter(item => item.tagName === 'OPTION');
3759
+ const group = parentOptgroupOf(selectable[this.highlightedIndex]);
3760
+ if (group !== null && group !== this.openGroup)
3761
+ return undefined;
3762
+ }
3763
+ return this.optionDomId(this.highlightedIndex);
3764
+ }
3765
+ /** Points the focused element's aria-activedescendant at the highlighted option, or clears it. */
3766
+ updateAriaActiveDescendant() {
3767
+ // With panel search, the element with focus owns it, not the trigger: the search field, or
3768
+ // the list while a drilled-in group hides the field.
3769
+ const target = this.usesPanelSearch ? (this.hidesPanelSearch ? this.panelTreeEl : this.panelSearchEl) : this.triggerEl;
3770
+ if (!target)
3771
+ return;
3772
+ const id = this.activeDescendantId;
3773
+ if (id !== undefined) {
3774
+ target.setAttribute('aria-activedescendant', id);
3775
+ }
3776
+ else {
3777
+ target.removeAttribute('aria-activedescendant');
3778
+ }
3779
+ }
3780
+ /**
3781
+ * Focus management helper - restores focus to the trigger element
3782
+ */
3783
+ restoreFocusToTrigger() {
3784
+ setTimeout(() => {
3785
+ if (this.inputEl) {
3786
+ this.inputEl.focus();
3787
+ }
3788
+ else if (this.triggerEl) {
3789
+ this.triggerEl.focus();
3790
+ }
3791
+ }, 0);
3792
+ }
3793
+ /**
3794
+ * Gets the value of the currently selected option.
3795
+ */
3796
+ async getSelectedValue() {
3797
+ return this.selectedOption ? this.selectedOption.value : null;
3798
+ }
3799
+ /**
3800
+ * Clears the selected value and resets the component. Works while disabled too, as setting a
3801
+ * native control's value from script does.
3802
+ */
3803
+ async clear() {
3804
+ const hadValue = this.value !== '' || this.displayText !== '';
3805
+ this.displayText = '';
3806
+ this.setSelectedOption(null);
3807
+ this.value = '';
3808
+ this.filterOptions();
3809
+ this.updateFormValue('');
3810
+ if (hadValue) {
3811
+ this.pdsComboboxChange.emit({ value: '' });
3812
+ }
3813
+ }
3814
+ // Group rows in the flyout panel carry their group's index, as options carry theirs.
3815
+ groupFromEvent(event) {
3816
+ var _a, _b;
3817
+ const index = Number(event.currentTarget.getAttribute('data-group-index'));
3818
+ return (_b = (_a = this.renderedGroups[index]) === null || _a === void 0 ? void 0 : _a.optgroup) !== null && _b !== void 0 ? _b : null;
3819
+ }
3820
+ highlightGroupRowByPointer(group) {
3821
+ this.highlightedIndex = -1;
3822
+ this.highlightedGroup = group;
3823
+ this.keyboardNavigating = false;
3824
+ // So revealing this row again later is announced again.
3825
+ this.revealedGroupLabel = null;
3826
+ }
3827
+ // Get the label of the selected option
3828
+ get selectedLabel() {
3829
+ return this.displayText || '';
3830
+ }
3831
+ // Get the layout content of the selected option for button trigger
3832
+ get selectedLayoutContent() {
3833
+ return this.selectedOptionLayoutContent;
3834
+ }
3835
+ // Check if selected option has layout
3836
+ get selectedHasLayout() {
3837
+ return this.selectedOption ? this.isOptionLayout(this.selectedOption) : false;
3838
+ }
3839
+ // Extract chip sentiment from selected option's attributes, layout content, or slotted trigger content
3840
+ get selectedChipSentiment() {
3841
+ // First priority: Check selected option's chip attributes (new automatic approach)
3842
+ if (this.selectedOption && this.isOptionChip(this.selectedOption)) {
3843
+ const sentiment = this.selectedOption.getAttribute('chip-sentiment');
3844
+ if (sentiment)
3845
+ return sentiment;
3846
+ }
3847
+ // Second priority: Check selected option's layout content (existing custom layout approach)
3848
+ if (this.selectedOption && this.isOptionLayout(this.selectedOption)) {
3849
+ const chipElement = this.selectedOption.querySelector('pds-chip');
3850
+ const sentiment = chipElement === null || chipElement === void 0 ? void 0 : chipElement.getAttribute('sentiment');
3851
+ if (sentiment)
3852
+ return sentiment;
3853
+ }
3854
+ // Third priority: Check if we have custom trigger content with a chip (initial state)
3855
+ if (this.customTriggerContent) {
3856
+ const slottedChip = this.el.querySelector('pds-chip[slot="trigger-content"]');
3857
+ if (slottedChip) {
3858
+ const sentiment = slottedChip.getAttribute('sentiment');
3859
+ if (sentiment)
3860
+ return sentiment;
3861
+ }
3862
+ }
3863
+ // Fallback: Use component props
3864
+ return this.chipSentiment;
3865
+ }
3866
+ // Extract chip large from selected option's attributes, layout content, or slotted trigger content
3867
+ get selectedChipLarge() {
3868
+ // First priority: Check selected option's chip attributes (new automatic approach)
3869
+ if (this.selectedOption && this.isOptionChip(this.selectedOption)) {
3870
+ if (this.selectedOption.hasAttribute('chip-large'))
3871
+ return true;
3872
+ }
3873
+ // Second priority: Check selected option's layout content (existing custom layout approach)
3874
+ if (this.selectedOption && this.isOptionLayout(this.selectedOption)) {
3875
+ const chipElement = this.selectedOption.querySelector('pds-chip');
3876
+ if ((chipElement === null || chipElement === void 0 ? void 0 : chipElement.getAttribute('size')) === 'lg')
3877
+ return true;
3878
+ }
3879
+ // Third priority: Check if we have custom trigger content with a chip (initial state)
3880
+ if (this.customTriggerContent) {
3881
+ const slottedChip = this.el.querySelector('pds-chip[slot="trigger-content"]');
3882
+ if (slottedChip && slottedChip.getAttribute('size') === 'lg') {
3883
+ return true;
3884
+ }
3885
+ }
3886
+ // Fallback: Use component props
3887
+ return this.chipLarge;
3888
+ }
3889
+ // Extract chip icon from selected option's attributes, layout content, or slotted trigger content
3890
+ get selectedChipIcon() {
3891
+ // First priority: Check selected option's chip attributes (new automatic approach)
3892
+ if (this.selectedOption && this.isOptionChip(this.selectedOption)) {
3893
+ const icon = this.selectedOption.getAttribute('chip-icon');
3894
+ if (icon)
3895
+ return icon;
3896
+ }
3897
+ // Second priority: Check selected option's layout content (existing custom layout approach)
3898
+ if (this.selectedOption && this.isOptionLayout(this.selectedOption)) {
3899
+ const chipElement = this.selectedOption.querySelector('pds-chip');
3900
+ const icon = chipElement === null || chipElement === void 0 ? void 0 : chipElement.getAttribute('icon');
3901
+ if (icon)
3902
+ return icon;
3903
+ }
3904
+ // Third priority: Check if we have custom trigger content with a chip (initial state)
3905
+ if (this.customTriggerContent) {
3906
+ const slottedChip = this.el.querySelector('pds-chip[slot="trigger-content"]');
3907
+ if (slottedChip) {
3908
+ const icon = slottedChip.getAttribute('icon');
3909
+ if (icon)
3910
+ return icon;
3911
+ }
3912
+ }
3913
+ // Fallback: Use component props
3914
+ return this.chipIcon;
3915
+ }
3916
+ // Extract chip dot from selected option's attributes, layout content, or slotted trigger content
3917
+ get selectedChipDot() {
3918
+ // First priority: Check selected option's chip attributes (new automatic approach)
3919
+ if (this.selectedOption && this.isOptionChip(this.selectedOption)) {
3920
+ if (this.selectedOption.hasAttribute('chip-dot'))
3921
+ return true;
3922
+ }
3923
+ // Second priority: Check selected option's layout content (existing custom layout approach)
3924
+ if (this.selectedOption && this.isOptionLayout(this.selectedOption)) {
3925
+ const chipElement = this.selectedOption.querySelector('pds-chip');
3926
+ if (chipElement === null || chipElement === void 0 ? void 0 : chipElement.hasAttribute('dot'))
3927
+ return true;
3928
+ }
3929
+ // Third priority: Check if we have custom trigger content with a chip (initial state)
3930
+ if (this.customTriggerContent) {
3931
+ const slottedChip = this.el.querySelector('pds-chip[slot="trigger-content"]');
3932
+ if (slottedChip && slottedChip.hasAttribute('dot')) {
3933
+ return true;
3934
+ }
3935
+ }
3936
+ // Fallback: Use component props
3937
+ return this.chipDot;
3938
+ }
3939
+ /**
3940
+ * With `async-url`, fetches when the button trigger opens: the first page if nothing has loaded.
3941
+ * The panel's search field opens empty, so results left from the last search are refetched for
3942
+ * an empty query.
3943
+ */
3944
+ fetchAsyncOptionsOnOpen() {
3945
+ if (!this.asyncUrl)
3946
+ return;
3947
+ if (this.usesPanelSearch && (this.internalOptions.length === 0 || this.lastFetchedQuery !== '')) {
3948
+ this.debouncedFetchAsyncOptions('', 1);
3949
+ }
3950
+ else if (this.internalOptions.length === 0) {
3951
+ this.debouncedFetchAsyncOptions(this.displayText, 1);
3952
+ }
3953
+ }
3954
+ handleOptionClick(option) {
3955
+ if (isOptionDisabled(option))
3956
+ return;
3957
+ if (this.selectedIcon === null)
3958
+ this.fadesValueIn = true;
3959
+ // Update reactive state - single source of truth
3960
+ // The @Watch('selectedOption') will handle displayText, value, and form internals
3961
+ this.setSelectedOption(option);
3962
+ this.isOpen = false;
3963
+ this.clearExpandFilterList();
3964
+ this.pdsComboboxChange.emit({ value: option.value });
3965
+ }
3966
+ /** The row shown while options load: at the top of the list, or of a drilled-in group's options. */
3967
+ renderLoadingRow() {
3968
+ if (!this.loading)
3969
+ return null;
3970
+ const hasSlottedLoading = !this.usesBodyPortal && !!this.el.querySelector('[slot="loading"]');
3971
+ return (index.h("li", { class: "pds-combobox__loading", role: "presentation" }, hasSlottedLoading ? index.h("slot", { name: "loading" }) : index.h("pds-loader", { size: "small" })));
3972
+ }
3973
+ /** The row after the last option while more can load, inside whatever scrolls them. */
3974
+ renderLoadMoreRow() {
3975
+ if (!this.hasMore || this.loading)
3976
+ return null;
3977
+ return (index.h("li", { class: "pds-combobox__load-more", role: "presentation" }, index.h("pds-loader", { size: "small" })));
3978
+ }
3979
+ /** Drilled into a group: the group and its place among the panel's entries; otherwise null. */
3980
+ drilledInEntry(entries) {
3981
+ if (this.effectiveGroupDisplay !== 'drill-in' || this.openGroup === null)
3982
+ return null;
3983
+ const position = entries.findIndex(entry => entry.kind === 'group' && entry.group.optgroup === this.openGroup);
3984
+ const open = entries[position];
3985
+ return (open === null || open === void 0 ? void 0 : open.kind) === 'group' ? { group: open.group, position } : null;
3986
+ }
3987
+ renderDropdown() {
3988
+ if (!this.isOpen) {
3989
+ return null;
3990
+ }
3991
+ const hasSlottedEmpty = !this.usesBodyPortal && !!this.el.querySelector('[slot="empty"]');
3992
+ // Drilled in, the group's options scroll under the row back, so their loading rows go with them.
3993
+ const drilledIn = this.showsGroupedPanel && this.drilledInEntry(this.panelEntries()) !== null;
3994
+ const selectableOptions = this.filteredItems.filter(item => item.tagName === 'OPTION');
3995
+ const withSearch = this.usesPanelSearch;
3996
+ // While a drilled-in group hides the search field, the list takes focus in its place.
3997
+ const listTakesFocus = this.hidesPanelSearch;
3998
+ const list = (index.h("ul", { key: "panel-list", class: {
3999
+ 'pds-combobox__listbox': !withSearch,
4000
+ 'pds-combobox__listbox-options': withSearch,
4001
+ 'pds-combobox__listbox-options--drilled-in': listTakesFocus,
4002
+ 'pds-combobox__listbox--grouped': this.groupDisplay !== 'inline',
4003
+ 'pds-combobox__listbox--drill-in': this.drillDirection === 'in',
4004
+ 'pds-combobox__listbox--drill-out': this.drillDirection === 'out',
4005
+ 'pds-combobox__listbox--pointer-hover': this.pointerCanHover,
4006
+ 'pds-combobox__listbox--truncate': this.truncate,
4007
+ }, onAnimationEnd: this.onDrillAnimationEnd, onPointerMove: this.onPanelPointer, onPointerDown: this.onPanelPointer, role: this.showsGroupedPanel ? 'tree' : 'listbox', id: this.listboxId, "aria-label": this.label || 'Options', "aria-multiselectable": "false",
4008
+ // Focusable but out of the tab order with panel search, so it can take focus when a
4009
+ // drilled-in group hides the field. Dropping it while focused would blur the list and close.
4010
+ tabIndex: withSearch ? -1 : undefined, "aria-activedescendant": listTakesFocus ? this.activeDescendantId : undefined, onKeyDown: withSearch ? this.onPanelTreeKeyDown : undefined, ref: el => {
4011
+ if (withSearch)
4012
+ this.panelTreeEl = el;
4013
+ else
4014
+ this.listboxEl = el;
4015
+ }, onScroll: this.handleScroll }, !drilledIn && this.renderLoadingRow(), !this.loading && this.filteredItems.length === 0 && (index.h("li", { class: "pds-combobox__empty", role: "presentation" }, hasSlottedEmpty ? (index.h("slot", { name: "empty" })) : (index.h("span", null, this.noOptionsFoundLabel)))), this.showsGroupedPanel ? this.renderGroupedPanel() : this.renderListboxItems(selectableOptions.length), !drilledIn && this.renderLoadMoreRow()));
4016
+ if (!withSearch)
4017
+ return list;
4018
+ // The search field sits above the list; the wrapper is what's positioned and portaled.
4019
+ return (index.h("div", { class: "pds-combobox__listbox pds-combobox__listbox--with-search", ref: el => (this.listboxEl = el), onAnimationEnd: this.onDrillAnimationEnd, onMouseDown: this.onPanelMouseDown,
4020
+ // Portaled, the panel sits outside .pds-combobox, so its focusout wouldn't reach that handler.
4021
+ onFocusout: this.usesBodyPortal ? this.onComboboxFocusOut : undefined }, !listTakesFocus && this.renderPanelSearch(), list));
4022
+ }
4023
+ /**
4024
+ * The listbox's items. Each optgroup's options sit in a `group` named for it, as in
4025
+ * `pds-multiselect`, so assistive tech announces the group on entering it; a `pds-text` label
4026
+ * stays a caption above the options that follow it.
4027
+ */
4028
+ renderListboxItems(setSize) {
4029
+ const rendered = [];
4030
+ let optionIndex = 0;
4031
+ let group = null;
4032
+ const closeGroup = () => {
4033
+ if (group === null)
4034
+ return;
4035
+ const { optgroup, key, options, members } = group;
4036
+ const groupIcon = groupIconOf(optgroup);
4037
+ const badge = groupBadgeOf(optgroup);
4038
+ // As in the grouped displays: disabled when there's nothing left in it to choose.
4039
+ const disabled = members.length > 0 && members.every(member => isOptionDisabled(member));
4040
+ rendered.push(index.h("li", { key: key, class: { 'pds-combobox__group': true, 'pds-combobox__group--disabled': disabled }, role: "group", "aria-label": badge === null ? optgroup.label : `${optgroup.label}, ${badge.label}`, "aria-disabled": disabled ? 'true' : undefined }, index.h("div", { class: {
4041
+ 'pds-combobox__group-label': true,
4042
+ 'pds-combobox__group-label--with-icon': groupIcon !== null,
4043
+ 'pds-combobox__group-label--with-badge': badge !== null,
4044
+ }, "aria-hidden": "true" }, groupIcon !== null && (
4045
+ // `name`, not `icon`: `icon` also loads URLs and data: SVGs, unsanitized.
4046
+ index.h("pds-icon", { name: groupIcon, size: "small", "aria-hidden": "true", class: "pds-combobox__group-icon" })), badge === null ? optgroup.label : index.h("span", { class: "pds-combobox__group-label-text" }, optgroup.label), this.renderBadge(badge, 'pds-combobox__group-badge')), index.h("ul", { class: "pds-combobox__group-list", role: "presentation" }, options)));
4047
+ group = null;
4048
+ };
4049
+ this.filteredItems.forEach((item, itemIdx) => {
4050
+ if (item.tagName === 'OPTGROUP') {
4051
+ closeGroup();
4052
+ group = { optgroup: item, key: `optgroup-${itemIdx}`, options: [], members: [] };
4053
+ }
4054
+ else if (item.tagName === 'PDS-TEXT') {
4055
+ closeGroup();
4056
+ rendered.push(index.h("li", { key: `pds-text-${itemIdx}`, class: "pds-combobox__group-label", role: "presentation" }, item.textContent));
4057
+ }
4058
+ else if (item.tagName === 'OPTION') {
4059
+ const option = item;
4060
+ if (group !== null && parentOptgroupOf(option) !== group.optgroup)
4061
+ closeGroup();
4062
+ const rendering = this.renderOption(option, optionIndex, { posinset: optionIndex + 1, setsize: setSize });
4063
+ optionIndex++;
4064
+ if (group !== null) {
4065
+ group.options.push(rendering);
4066
+ group.members.push(option);
4067
+ }
4068
+ else {
4069
+ rendered.push(rendering);
4070
+ }
4071
+ }
4072
+ });
4073
+ closeGroup();
4074
+ return rendered;
4075
+ }
4076
+ /** `panelSearch` applies to the triggers that can't be typed into. */
4077
+ get usesPanelSearch() {
4078
+ return this.panelSearch && this.trigger !== 'input';
4079
+ }
4080
+ /** `groupDisplay`, with `flyout` drilling in when there's no room beside the dropdown. */
4081
+ get effectiveGroupDisplay() {
4082
+ return this.groupDisplay === 'flyout' && this.flyoutFallback ? 'drill-in' : this.groupDisplay;
4083
+ }
4084
+ /**
4085
+ * The popup's role, for the triggers' `aria-haspopup`: a `tree` while the grouped panel shows
4086
+ * groups, and a `listbox` of options otherwise, search results included.
4087
+ */
4088
+ get popupRole() {
4089
+ return this.showsGroupedPanel ? 'tree' : 'listbox';
4090
+ }
4091
+ /**
4092
+ * The input trigger's `aria-haspopup`. While closed it names what opening shows: the full list,
4093
+ * so the grouped panel in a grouped display, even though the input still holds the selection's
4094
+ * label.
4095
+ */
4096
+ get inputPopupRole() {
4097
+ if (this.isOpen)
4098
+ return this.popupRole;
4099
+ return this.effectiveGroupDisplay === 'inline' ? 'listbox' : 'tree';
4100
+ }
4101
+ /**
4102
+ * The button and chip triggers' `aria-haspopup`. With panel search the trigger opens the panel,
4103
+ * which starts as a tree in a grouped display, so typing in the panel doesn't change it.
4104
+ */
4105
+ get triggerPopupRole() {
4106
+ if (!this.usesPanelSearch)
4107
+ return this.popupRole;
4108
+ return this.groupDisplay === 'inline' ? 'listbox' : 'tree';
4109
+ }
4110
+ /**
4111
+ * Drilled into a group with panel search: the group's row back takes the search field's place,
4112
+ * since one group's options don't need searching. Typing searches the whole list again.
4113
+ */
4114
+ get hidesPanelSearch() {
4115
+ return this.usesPanelSearch && this.showsGroupedPanel && this.effectiveGroupDisplay === 'drill-in' && this.openGroup !== null;
4116
+ }
4117
+ /** The grouped panel is showing groups rather than search results. */
4118
+ get showsGroupedPanel() {
4119
+ if (this.effectiveGroupDisplay === 'inline')
4120
+ return false;
4121
+ const searching = this.usesPanelSearch
4122
+ ? this.panelQuery !== ''
4123
+ : this.mode === 'filter' && !this.expandFilterListWhileOpen && this.displayText !== '';
4124
+ return !searching;
4125
+ }
4126
+ setPanelQuery(query) {
4127
+ this.panelQuery = query;
4128
+ this.clearExpandFilterList();
4129
+ this.filterOptions();
4130
+ this.pdsComboboxSearch.emit({ query: this.panelQuery });
4131
+ if (this.asyncUrl !== undefined && this.asyncUrl !== '') {
4132
+ this.debouncedFetchAsyncOptions(this.panelQuery, 1);
4133
+ }
4134
+ // The list changes size, so place the dropdown again, as typing in the input trigger does.
4135
+ setTimeout(() => this.openDropdownPositioning(), 0);
4136
+ }
4137
+ /** What's being searched: the panel's field, or the input trigger's text. */
4138
+ get activeQuery() {
4139
+ return this.usesPanelSearch ? this.panelQuery : this.displayText;
4140
+ }
4141
+ // Tab closes the dropdown and lands on the trigger, as Escape does: the focused field or list is
4142
+ // about to unmount, so the browser can't tab on from it. The next Tab continues from the trigger.
4143
+ handlePanelTab(event) {
4144
+ if (event.key !== 'Tab')
4145
+ return false;
4146
+ event.preventDefault();
4147
+ this.handleKeyDown(event);
4148
+ this.restoreFocusToTrigger();
4149
+ return true;
4150
+ }
4151
+ /** Returns from a drilled-in group to the group list; false when not drilled in. */
4152
+ leaveDrilledInGroup() {
4153
+ if (!this.showsGroupedPanel || this.effectiveGroupDisplay !== 'drill-in' || this.openGroup === null)
4154
+ return false;
4155
+ this.collapseToGroup(this.openGroup);
4156
+ return true;
4157
+ }
4158
+ renderPanelSearch() {
4159
+ return (index.h("div", { key: "panel-search", class: {
4160
+ 'pds-combobox__panel-search': true,
4161
+ // Coming back from a group, the search field slides in with the groups.
4162
+ 'pds-combobox__panel-search--drill-out': this.drillDirection === 'out',
4163
+ } }, index.h("pds-icon", { name: "search", size: "regular", "aria-hidden": "true" }), index.h("input", { ref: el => (this.panelSearchEl = el), type: "text", class: "pds-combobox__panel-search-input", placeholder: this.searchPlaceholder, value: this.panelQuery, role: "combobox", "aria-label": this.searchOptionsLabel, "aria-haspopup": this.popupRole, "aria-controls": this.listboxId, "aria-autocomplete": "list", "aria-expanded": "true", "aria-activedescendant": this.activeDescendantId, autocomplete: "off", onInput: this.onPanelSearchInput, onKeyDown: this.onPanelSearchKeyDown })));
4164
+ }
4165
+ /**
4166
+ * An option, as a listbox `option` or, given a tree `level`, a `treeitem`. `posinset` and
4167
+ * `setsize` place it among its siblings.
4168
+ */
4169
+ renderOption(option, index$1, { posinset, setsize, level }) {
4170
+ const isSelected = this.isOptionSelected(option);
4171
+ const isHighlighted = this.highlightedIndex === index$1;
4172
+ const isLayout = this.isOptionLayout(option);
4173
+ const isChip = this.isOptionChip(option);
4174
+ const isDisabled = isOptionDisabled(option);
4175
+ const tree = level !== undefined;
4176
+ const badge = isLayout || isChip ? null : optionBadgeOf(option);
4177
+ return (index.h("li", { key: option.value, id: this.optionDomId(index$1), role: tree ? 'treeitem' : 'option', "aria-selected": isSelected ? 'true' : tree ? undefined : 'false', "aria-disabled": isDisabled ? 'true' : undefined, "aria-level": level, "aria-setsize": setsize, "aria-posinset": posinset, "aria-label": isLayout || isChip
4178
+ ? option.getAttribute('aria-label') || this.getOptionLabel(option)
4179
+ : badge && `${this.getOptionLabel(option)}, ${badge.label}`, tabindex: this.usesBodyPortal || this.usesPanelSearch || tree ? '-1' : isHighlighted ? '0' : '-1', class: {
4180
+ 'pds-combobox__option': true,
4181
+ 'pds-combobox__option--highlighted': isHighlighted,
4182
+ // The keyboard's place, as on the group rows (`--keyboard`).
4183
+ 'pds-combobox__option--keyboard': isHighlighted && this.keyboardNavigating,
4184
+ 'pds-combobox__option--layout': isLayout,
4185
+ 'pds-combobox__option--chip': isChip,
4186
+ 'pds-combobox__option--disabled': isDisabled,
4187
+ 'pds-combobox__option--with-badge': badge !== null,
4188
+ }, "data-option-index": index$1, onMouseDown: this.onOptionMouseDown, onClick: this.onOptionClick, onMouseEnter: this.onOptionMouseEnter, onKeyDown: this.onOptionKeyDown }, isLayout ? (index.h("pds-box", { class: "pds-combobox__option-layout-wrapper", innerHTML: this.getOptionLayoutContent(option) })) : isChip ? (this.renderOptionChip(option)) : ([this.renderOptionLabel(option), this.renderOptionBadge(option)]), isSelected && index.h("pds-icon", { icon: "check", size: "regular", "aria-hidden": "true", class: "pds-combobox__option-check" })));
4189
+ }
4190
+ /** Copies an `options` badge to an option's or optgroup's `data-badge*` attributes; only strings count. */
4191
+ setBadgeAttributes(element, badge) {
4192
+ if (typeof badge !== 'object' || badge === null)
4193
+ return;
4194
+ const { label, sentiment, icon } = badge;
4195
+ if (typeof label !== 'string' || label.trim() === '')
4196
+ return;
4197
+ element.setAttribute('data-badge', label);
4198
+ if (typeof sentiment === 'string')
4199
+ element.setAttribute('data-badge-sentiment', sentiment);
4200
+ if (typeof icon === 'string')
4201
+ element.setAttribute('data-badge-icon', icon);
4202
+ }
4203
+ /** An option's badge, after its text. */
4204
+ renderOptionBadge(option) {
4205
+ return this.renderBadge(optionBadgeOf(option), 'pds-combobox__option-badge');
4206
+ }
4207
+ /** A badge as a `pds-chip`: after an option's text, or a group's label. */
4208
+ renderBadge(badge, className) {
4209
+ var _a;
4210
+ if (badge === null)
4211
+ return null;
4212
+ return (index.h("pds-chip", { size: "sm", sentiment: badge.sentiment,
4213
+ // A Pine icon name only, checked by optionBadgeOf; pds-chip's `icon` also loads URLs.
4214
+ icon: (_a = badge.icon) !== null && _a !== void 0 ? _a : undefined,
4215
+ // A long label, often a translated one, truncates rather than squeezing the option's text.
4216
+ maxWidth: "50%", class: className }, badge.label));
4217
+ }
4218
+ /**
4219
+ * An option's text, after its `data-icon` when it has one. Beside a badge the text is always
4220
+ * wrapped, so it can shrink and wrap rather than push the badge out of the row.
4221
+ */
4222
+ renderOptionLabel(option) {
4223
+ const icon = optionIconOf(option);
4224
+ const label = this.truncate ? (index.h("span", { key: this.getOptionLabel(option), class: "pds-combobox__option-text" }, this.getOptionLabel(option))) : this.getOptionLabel(option);
4225
+ if (icon === null) {
4226
+ return optionBadgeOf(option) === null ? label : index.h("span", { class: "pds-combobox__option-label" }, label);
4227
+ }
4228
+ return (index.h("span", { class: "pds-combobox__option-label" }, index.h("pds-icon", { name: icon, size: "regular", "aria-hidden": "true", class: "pds-combobox__option-icon" }), label));
4229
+ }
4230
+ /** The grouped panel's rows, in the order the panel draws them and the keyboard moves through. */
4231
+ panelEntries() {
4232
+ // Slotted markup is already in order; only options from data record positions.
4233
+ if (this.options === undefined && !this.asyncUrl)
4234
+ return buildPanelEntries(this.filteredItems);
4235
+ return buildPanelEntries(this.filteredItems, element => this.panelPositions.get(element));
4236
+ }
4237
+ /**
4238
+ * `flyout`: one row per group, its options in a flyout beside it. `drill-in`: the same rows, and
4239
+ * an opened group replaces them with its row, drawn as a row back, above its options. Either way
4240
+ * it's a tree: the rows and ungrouped options are level 1, a group's options level 2.
4241
+ */
4242
+ renderGroupedPanel() {
4243
+ const entries = this.panelEntries();
4244
+ const setsize = entries.length;
4245
+ const drilled = this.drilledInEntry(entries);
4246
+ if (drilled)
4247
+ return this.renderGroupBackRow(drilled.group, { posinset: drilled.position + 1, setsize });
4248
+ this.renderedGroups = [];
4249
+ return entries.map((entry, position) => {
4250
+ const placement = { posinset: position + 1, setsize };
4251
+ if (entry.kind === 'option')
4252
+ return this.renderOption(entry.option, entry.index, Object.assign(Object.assign({}, placement), { level: 1 }));
4253
+ this.renderedGroups.push(entry.group);
4254
+ return this.renderGroupRow(entry.group, this.renderedGroups.length - 1, placement);
4255
+ });
4256
+ }
4257
+ /** A group's options, as its children in the tree. */
4258
+ renderGroupOptions(group) {
4259
+ return group.options.map(({ option, index }, position) => this.renderOption(option, index, { posinset: position + 1, setsize: group.options.length, level: 2 }));
4260
+ }
4261
+ /**
4262
+ * Drilled into a group: its treeitem, expanded. Its row reads as a way back ("Back: Tag") and
4263
+ * leads its options. It leaves out the group's badge: the row is a way back, not a group to
4264
+ * choose, and the badge was on the row that opened it. An option's own badge still shows.
4265
+ */
4266
+ renderGroupBackRow(group, { posinset, setsize }) {
4267
+ const id = this.groupDomId(group.optgroup);
4268
+ const disabled = isGroupDisabled(group);
4269
+ return (index.h("li", { key: "group-back", id: id, class: {
4270
+ 'pds-combobox__group-back': true,
4271
+ 'pds-combobox__group-back--disabled': disabled,
4272
+ // As the group rows: shaded for the keys, and by `:hover` for the pointer.
4273
+ 'pds-combobox__group-back--highlighted': this.keyboardNavigating && this.highlightedGroupRow === group.optgroup,
4274
+ 'pds-combobox__group-back--keyboard': this.keyboardNavigating && this.highlightedGroupRow === group.optgroup,
4275
+ }, role: "treeitem", "aria-expanded": "true", "aria-disabled": disabled ? 'true' : undefined, "aria-level": 1, "aria-posinset": posinset, "aria-setsize": setsize, "aria-labelledby": `${id}-label` }, index.h("div", { class: "pds-combobox__group-row-trigger pds-combobox__group-back-trigger", onMouseDown: this.onOptionMouseDown, onMouseEnter: this.onGroupBackMouseEnter, onClick: this.onGroupBackClick }, index.h("span", { class: "pds-combobox__group-row-label", id: `${id}-label` }, index.h("pds-icon", { name: "caret-left", size: "regular", "aria-hidden": "true", class: "pds-combobox__group-row-caret" }), index.h("span", { class: "visually-hidden" }, this.drillInBackLabel, ": "), group.label)), index.h("ul", { class: "pds-combobox__drill-in-options", role: "group", "aria-label": group.label, onScroll: this.handleScroll }, this.renderLoadingRow(), this.renderGroupOptions(group), this.renderLoadMoreRow())));
4276
+ }
4277
+ renderGroupRow(group, groupIndex, { posinset, setsize }) {
4278
+ const flyout = this.effectiveGroupDisplay === 'flyout';
4279
+ const isOpen = flyout && this.openGroup === group.optgroup;
4280
+ // `--has-selection` is a state hook only (tests read it), not styled. The fill follows
4281
+ // `--highlighted` (always in flyout, in drill-in only for the keys) and a flyout's `--open` row.
4282
+ const hasSelection = flyout && group.options.some(({ option }) => this.isOptionSelected(option));
4283
+ const isCurrent = this.highlightedGroupRow === group.optgroup;
4284
+ const disabled = isGroupDisabled(group);
4285
+ const id = this.groupDomId(group.optgroup);
4286
+ return (index.h("li", { key: `group-${groupIndex}`, id: id, class: {
4287
+ 'pds-combobox__group-row': true,
4288
+ 'pds-combobox__group-row--open': isOpen,
4289
+ 'pds-combobox__group-row--has-selection': hasSelection,
4290
+ 'pds-combobox__group-row--highlighted': isCurrent && (flyout || this.keyboardNavigating),
4291
+ 'pds-combobox__group-row--keyboard': isCurrent && this.keyboardNavigating,
4292
+ 'pds-combobox__group-row--disabled': disabled,
4293
+ }, role: "treeitem", "aria-expanded": isOpen ? 'true' : 'false', "aria-disabled": disabled ? 'true' : undefined, "aria-level": 1, "aria-posinset": posinset, "aria-setsize": setsize, "aria-labelledby": group.badge === null ? `${id}-label` : undefined, "aria-label": group.badge === null ? undefined : `${group.label}, ${group.badge.label}`, "data-group-index": groupIndex, onMouseEnter: flyout ? this.onGroupRowMouseEnter : undefined, onMouseLeave: flyout ? this.onGroupRowMouseLeave : undefined }, index.h("div", { class: "pds-combobox__group-row-trigger", "data-group-index": groupIndex, onMouseDown: this.onOptionMouseDown, onMouseEnter: this.onGroupRowTriggerMouseEnter, onClick: this.onGroupRowClick }, index.h("span", { class: "pds-combobox__group-row-label", id: `${id}-label` }, group.icon !== null && (
4294
+ // `name`, not `icon`: `icon` also loads URLs and data: SVGs, unsanitized.
4295
+ index.h("pds-icon", { name: group.icon, size: "regular", "aria-hidden": "true", class: "pds-combobox__group-icon" })), group.label), this.renderBadge(group.badge, 'pds-combobox__group-badge'), index.h("pds-icon", { name: "caret-right", size: "regular", "aria-hidden": "true", class: "pds-combobox__group-row-caret" })), isOpen && (index.h("ul", { class: "pds-combobox__flyout", role: "group", "aria-label": group.label, style: { minWidth: this.flyoutMinWidth, maxWidth: this.flyoutMaxWidth } }, this.renderGroupOptions(group)))));
4296
+ }
4297
+ // Helper method to render the caret icon
4298
+ renderCaretIcon() {
4299
+ return index.h("pds-icon", { icon: "caret-down", "aria-hidden": "true", class: "pds-combobox__button-trigger-chevron" });
4300
+ }
4301
+ // Helper method to render layout content
4302
+ renderLayoutContent() {
4303
+ return (index.h("div", { class: "pds-combobox__button-trigger-layout-wrapper", innerHTML: this.selectedLayoutContent }));
4304
+ }
4305
+ // Helper method to render default text content
4306
+ renderDefaultContent() {
4307
+ const icon = this.selectedIcon;
4308
+ return (index.h("span", { class: {
4309
+ 'pds-combobox__button-trigger-label': true,
4310
+ 'pds-combobox__button-trigger-label--placeholder': !this.selectedLabel,
4311
+ 'pds-combobox__button-trigger-label--with-icon': icon !== null,
4312
+ 'pds-combobox__button-trigger-label--value-in': icon !== null && this.fadesValueIn,
4313
+ } }, icon !== null && (
4314
+ // `name`, not `icon`: `icon` also loads URLs and data: SVGs, unsanitized.
4315
+ index.h("pds-icon", { name: icon, size: "regular", "aria-hidden": "true", class: "pds-combobox__button-trigger-icon" })), this.truncate ? (
4316
+ // Keyed so a new label drops a stale `title`.
4317
+ index.h("span", { key: this.selectedLabel || this.placeholder, class: "pds-combobox__button-trigger-text" }, this.selectedLabel || this.placeholder)) : (this.selectedLabel || this.placeholder)));
4318
+ }
4319
+ /** The selection's icon for the button trigger: the option's own, or else its group's. */
4320
+ get selectedIcon() {
4321
+ var _a;
4322
+ const option = this.selectedOption;
4323
+ if (!option)
4324
+ return null;
4325
+ const optgroup = parentOptgroupOf(option);
4326
+ return (_a = optionIconOf(option)) !== null && _a !== void 0 ? _a : (optgroup !== null ? groupIconOf(optgroup) : null);
4327
+ }
4328
+ // Helper method to check if we should show layout content
4329
+ shouldShowLayoutContent() {
4330
+ return this.selectedHasLayout && !!this.selectedLayoutContent;
4331
+ }
4332
+ // Helper method to build chip trigger CSS classes
4333
+ getChipTriggerClass() {
4334
+ const classes = ['pds-combobox__chip-trigger'];
4335
+ // Add sentiment class
4336
+ classes.push(`pds-combobox__chip-trigger--${this.selectedChipSentiment}`);
4337
+ // Always use dropdown variant for chip triggers
4338
+ classes.push('pds-combobox__chip-trigger--dropdown');
4339
+ // Add large class if needed
4340
+ if (this.selectedChipLarge) {
4341
+ classes.push('pds-combobox__chip-trigger--large');
4342
+ }
4343
+ // Add dot class if needed
4344
+ if (this.selectedChipDot) {
4345
+ classes.push('pds-combobox__chip-trigger--dot');
4346
+ }
4347
+ return classes.join(' ');
4348
+ }
4349
+ renderButtonTriggerContent() {
4350
+ // Case 1: Custom trigger content with layout priority
4351
+ if (this.customTriggerContent) {
4352
+ if (this.shouldShowLayoutContent()) {
4353
+ return [this.renderLayoutContent(), this.renderCaretIcon()];
4354
+ }
4355
+ // Fall back to slot content when no layout is available
4356
+ return index.h("slot", { name: "trigger-content" });
4357
+ }
4358
+ // Case 2: Standard mode with layout content
4359
+ if (this.shouldShowLayoutContent()) {
4360
+ return [this.renderLayoutContent(), this.renderCaretIcon()];
4361
+ }
4362
+ // Case 3: Standard mode with default text content
4363
+ return [this.renderDefaultContent(), this.renderCaretIcon()];
4364
+ }
4365
+ renderChipTriggerContent() {
4366
+ // Case 1: Custom trigger content with layout priority
4367
+ if (this.customTriggerContent) {
4368
+ if (this.shouldShowLayoutContent()) {
4369
+ // When using custom layouts, the chip handles its own dropdown arrow
4370
+ return this.renderChipTriggerLayoutContent();
4371
+ }
4372
+ // Fall back to slot content when no layout is available - chip handles its own dropdown arrow
4373
+ return index.h("slot", { name: "trigger-content" });
4374
+ }
4375
+ // Case 2: Standard mode with layout content
4376
+ if (this.shouldShowLayoutContent()) {
4377
+ // When using custom layouts, the chip handles its own dropdown arrow
4378
+ return this.renderChipTriggerLayoutContent();
4379
+ }
4380
+ // Case 3: Automatic chip mode - selected option has chip attributes
4381
+ if (this.selectedOption && this.selectedOptionChipProps) {
4382
+ // Render as chip automatically - chip handles its own dropdown arrow
4383
+ return this.renderSelectedOptionAsChip();
4384
+ }
4385
+ // Case 4: Standard mode with default text content
4386
+ return [
4387
+ this.renderChipTriggerDefaultContent(),
4388
+ this.renderCaretIcon()
4389
+ ];
4390
+ }
4391
+ // Helper method to render selected option as chip for trigger (automatic approach)
4392
+ renderSelectedOptionAsChip() {
4393
+ if (!this.selectedOption || !this.selectedOptionChipProps)
4394
+ return null;
4395
+ return (index.h("pds-chip", { sentiment: this.selectedOptionChipProps.sentiment, variant: "dropdown" // Always use dropdown variant for triggers
4396
+ ,
4397
+ size: this.selectedOptionChipProps.large ? 'lg' : undefined, icon: this.selectedOptionChipProps.icon, dot: this.selectedOptionChipProps.dot, class: "pds-combobox__chip-trigger-auto" }, this.getOptionLabel(this.selectedOption)));
4398
+ }
4399
+ // Helper method to render chip trigger layout content
4400
+ renderChipTriggerLayoutContent() {
4401
+ return (index.h("div", { class: "pds-combobox__chip-trigger-layout-wrapper", innerHTML: this.getModifiedLayoutContentForTrigger() }));
4402
+ }
4403
+ // Helper method to modify layout content for trigger use (ensure dropdown variant)
4404
+ getModifiedLayoutContentForTrigger() {
4405
+ let content = this.selectedLayoutContent;
4406
+ // If the content contains a pds-chip, ensure it has variant="dropdown"
4407
+ if (content.includes('<pds-chip')) {
4408
+ // Use a temporary div to parse and modify the HTML
4409
+ const tempDiv = document.createElement('div');
4410
+ tempDiv.innerHTML = content;
4411
+ const chipElement = tempDiv.querySelector('pds-chip');
4412
+ if (chipElement) {
4413
+ chipElement.setAttribute('variant', 'dropdown');
4414
+ content = tempDiv.innerHTML;
4415
+ }
4416
+ }
4417
+ return content;
4418
+ }
4419
+ // Helper method to render chip trigger default content
4420
+ renderChipTriggerDefaultContent() {
4421
+ return (index.h("span", { class: "pds-combobox__chip-trigger-label" }, this.selectedChipIcon && index.h("pds-icon", { icon: this.selectedChipIcon, "aria-hidden": "true", class: "pds-combobox__chip-trigger-icon" }), this.selectedLabel || this.placeholder));
4422
+ }
4423
+ // Helper method to render option as chip (new automatic approach)
4424
+ renderOptionChip(option) {
4425
+ const chipProps = this.getOptionChipProps(option);
4426
+ return (index.h("pds-chip", { sentiment: chipProps.sentiment, variant: "text" // Dropdown options use text variant, not dropdown
4427
+ ,
4428
+ size: chipProps.large ? 'lg' : undefined, icon: chipProps.icon, dot: chipProps.dot, class: "pds-combobox__option-chip" }, this.getOptionLabel(option)));
4429
+ }
4430
+ // Mirrors pds-multiselect and pds-select: an error message on its own puts the
4431
+ // field in an invalid state, so assistive tech agrees with the visual treatment.
4432
+ isInvalid() {
4433
+ return Boolean(this.invalid) || Boolean(this.errorMessage);
4434
+ }
4435
+ renderMessages() {
4436
+ const hasErrorMessage = Boolean(this.errorMessage);
4437
+ const showHelperMessage = Boolean(this.helperMessage) && !hasErrorMessage;
4438
+ return [
4439
+ showHelperMessage && (index.h("p", { class: "pds-combobox__helper", id: form.messageId(this.componentId, 'helper') }, this.helperMessage)),
4440
+ hasErrorMessage && (index.h("p", { class: "pds-combobox__error", id: form.messageId(this.componentId, 'error'), "aria-live": "assertive" }, index.h("pds-icon", { icon: "danger", size: "small", "aria-hidden": "true" }), this.errorMessage)),
4441
+ ];
4442
+ }
4443
+ render() {
4444
+ var _a;
4445
+ const triggerClass = [
4446
+ 'pds-combobox__button-trigger',
4447
+ `pds-combobox__button-trigger--${this.triggerVariant}`,
4448
+ this.triggerShape === 'input' && 'pds-combobox__button-trigger--input-shape',
4449
+ this.truncate && 'pds-combobox__button-trigger--truncate',
4450
+ ]
4451
+ .filter(Boolean)
4452
+ .join(' ');
4453
+ return (index.h(index.Host, { key: '3a7f09752d2dff0fbf653852cd9ea474a44c61d5', "aria-disabled": this.disabled ? 'true' : null }, index.h("div", { key: '56d3bf86655abfd945228ee0bc3a556a6ad766b3', class: "pds-combobox", tabIndex: -1, onFocusout: this.onComboboxFocusOut, part: "combobox" }, this.hasVisibleLabel && (index.h("label", { key: 'a07f37d62bca1b15df3aa258d94c0df4609b93b3', htmlFor: this.trigger === 'input' ? this.componentId : undefined, id: this.labelId, class: "pds-combobox__label", onClick: this.onLabelClick }, this.label)), this.trigger === 'input' ? (index.h("div", { class: "pds-combobox__input-wrapper", style: { width: this.triggerWidth } }, index.h("input", { ref: el => {
4454
+ this.inputEl = el;
4455
+ this.triggerEl = el;
4456
+ }, class: {
4457
+ 'pds-combobox__input': true,
4458
+ 'pds-combobox__input--invalid': this.isInvalid(),
4459
+ }, type: "text", role: "combobox", "aria-autocomplete": "list", "aria-haspopup": this.inputPopupRole === 'tree' ? 'tree' : undefined, "aria-controls": this.listboxId, "aria-describedby": form.assignDescription(this.componentId, this.isInvalid(), this.helperMessage, this.errorMessage), "aria-invalid": this.isInvalid() ? 'true' : undefined, "aria-activedescendant": this.usesPanelSearch ? undefined : this.activeDescendantId, "aria-expanded": this.isOpen ? 'true' : 'false', "aria-disabled": this.disabled ? 'true' : 'false', "aria-label": this.hideLabel ? this.label : undefined, id: this.componentId, value: this.displayText, placeholder: this.placeholder, disabled: this.disabled, onInput: this.handleInput, onClick: this.handleInputClick, onKeyDown: this.handleKeyDown, autocomplete: "off", part: "input" }), index.h("pds-icon", { icon: "enlarge", "aria-hidden": "true", class: "pds-combobox__input-icon" }))) : this.trigger === 'chip' ? (index.h("div", { class: this.getChipTriggerClass(), style: { width: this.triggerWidth }, role: this.usesPanelSearch ? 'button' : 'combobox', "aria-haspopup": this.triggerPopupRole, "aria-controls": this.listboxId, "aria-describedby": form.assignDescription(this.componentId, this.isInvalid(), this.helperMessage, this.errorMessage), "aria-invalid": this.isInvalid() ? 'true' : undefined, "aria-activedescendant": this.usesPanelSearch ? undefined : this.activeDescendantId, "aria-expanded": this.isOpen ? 'true' : 'false', "aria-disabled": this.disabled ? 'true' : 'false', "aria-label": this.triggerAriaLabel, "aria-labelledby": this.triggerLabelledBy, id: this.componentId, tabIndex: this.disabled ? -1 : 0, onClick: this.onButtonTriggerClick, "data-layout": this.customTriggerContent, onKeyDown: this.onButtonTriggerKeyDown, onKeyUp: this.onButtonTriggerKeyUp, ref: el => (this.triggerEl = el), part: "chip-trigger" }, this.renderChipTriggerContent())) : (index.h("div", { class: triggerClass, style: { width: this.triggerWidth }, role: this.usesPanelSearch ? 'button' : 'combobox', "aria-haspopup": this.triggerPopupRole, "aria-controls": this.listboxId, "aria-describedby": form.assignDescription(this.componentId, this.isInvalid(), this.helperMessage, this.errorMessage), "aria-invalid": this.isInvalid() ? 'true' : undefined, "aria-activedescendant": this.usesPanelSearch ? undefined : this.activeDescendantId, "aria-expanded": this.isOpen ? 'true' : 'false', "aria-disabled": this.disabled ? 'true' : 'false', "aria-label": this.triggerAriaLabel, "aria-labelledby": this.triggerLabelledBy, id: this.componentId, tabIndex: this.disabled ? -1 : 0, onClick: this.onButtonTriggerClick, "data-layout": this.customTriggerContent, onKeyDown: this.onButtonTriggerKeyDown, onKeyUp: this.onButtonTriggerKeyUp, onMouseEnter: this.truncate ? this.onButtonTriggerMouseEnter : undefined, ref: el => (this.triggerEl = el), part: "button-trigger" }, this.renderButtonTriggerContent())), this.renderMessages(), index.h("div", { key: '0c0accd76b79aba9fa3072eb68800102d458d0a7', style: { display: 'none' } }, index.h("slot", { key: 'be9cc4c897788342bbc96321f033ed4fd97e80ff', onSlotchange: () => this.updateOptions() })), this.renderDropdown(), this.groupDisplay !== 'inline' && [
4460
+ index.h("span", { key: "drill-status", class: "visually-hidden", role: "status", "aria-live": "polite" }, this.isOpen && this.effectiveGroupDisplay === 'drill-in' && this.openGroup !== null ? this.openGroup.label : ''),
4461
+ // Its own region: sharing one, revealing a row then opening it would leave the text the
4462
+ // same, and opening the group would go unannounced.
4463
+ index.h("span", { key: "reveal-status", class: "visually-hidden", role: "status", "aria-live": "polite" }, this.isOpen ? (_a = this.revealedGroupLabel) !== null && _a !== void 0 ? _a : '' : ''),
4464
+ ])));
4465
+ }
4466
+ static get formAssociated() { return true; }
4467
+ get el() { return index.getElement(this); }
4468
+ static get watchers() { return {
4469
+ "groupDisplay": [{
4470
+ "groupDisplayChanged": 0
4471
+ }],
4472
+ "openGroup": [{
4473
+ "openGroupChanged": 0
4474
+ }],
4475
+ "flyoutFallback": [{
4476
+ "flyoutFallbackChanged": 0
4477
+ }],
4478
+ "disabled": [{
4479
+ "disabledChanged": 0
4480
+ }],
4481
+ "isOpen": [{
4482
+ "isOpenChanged": 0
4483
+ }],
4484
+ "debounce": [{
4485
+ "setupDebounce": 0
4486
+ }],
4487
+ "options": [{
4488
+ "optionsChanged": 0
4489
+ }],
4490
+ "value": [{
4491
+ "handleValueChange": 0
4492
+ }],
4493
+ "selectedOption": [{
4494
+ "handleSelectedOptionChange": 0
4495
+ }]
4496
+ }; }
4497
+ };
4498
+ PdsCombobox.style = pdsComboboxCss();
4499
+
4500
+ exports.pds_combobox = PdsCombobox;