@pine-ds/core 4.11.0 → 4.12.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 (506) hide show
  1. package/components/aria-references.js +1 -0
  2. package/components/attributes.js +1 -1
  3. package/components/index2.js +1 -1
  4. package/components/pds-alert.js +1 -1
  5. package/components/pds-avatar.js +1 -1
  6. package/components/pds-box2.js +1 -1
  7. package/components/pds-button2.js +1 -1
  8. package/components/pds-checkbox2.js +1 -1
  9. package/components/pds-chip2.js +1 -1
  10. package/components/pds-combobox.js +2 -2
  11. package/components/pds-copytext.js +1 -1
  12. package/components/pds-datepicker.js +1 -1
  13. package/components/pds-drawer-content.js +1 -1
  14. package/components/pds-drawer-footer.js +1 -1
  15. package/components/pds-drawer-header.js +1 -1
  16. package/components/pds-drawer.js +1 -1
  17. package/components/pds-dropdown-menu-item.js +1 -1
  18. package/components/pds-dropdown-menu-separator.js +1 -1
  19. package/components/pds-dropdown-menu.js +1 -1
  20. package/components/pds-filter.js +1 -1
  21. package/components/pds-image.js +1 -1
  22. package/components/pds-input2.js +1 -1
  23. package/components/pds-link2.js +1 -1
  24. package/components/pds-loader2.js +1 -1
  25. package/components/pds-modal-footer.js +1 -1
  26. package/components/pds-modal-header.js +1 -1
  27. package/components/pds-modal2.js +1 -1
  28. package/components/pds-multiselect.js +1 -1
  29. package/components/pds-popover.js +1 -1
  30. package/components/pds-progress.js +1 -1
  31. package/components/pds-radio-group.js +1 -1
  32. package/components/pds-radio.js +1 -1
  33. package/components/pds-select.js +1 -1
  34. package/components/pds-sortable-item.js +1 -1
  35. package/components/pds-sortable.js +2 -2
  36. package/components/pds-switch.js +1 -1
  37. package/components/pds-table-body.js +1 -1
  38. package/components/pds-table-cell2.js +1 -1
  39. package/components/pds-table-head-cell2.js +1 -1
  40. package/components/pds-table-head.js +1 -1
  41. package/components/pds-table-row.js +1 -1
  42. package/components/pds-table.js +1 -1
  43. package/components/pds-tabs.js +1 -1
  44. package/components/pds-text2.js +1 -1
  45. package/components/pds-textarea.js +1 -1
  46. package/components/pds-toast.js +1 -1
  47. package/components/pds-tooltip.js +1 -1
  48. package/components/sortable-label.js +1 -0
  49. package/components/truncation-tooltip.js +1 -1
  50. package/dist/cjs/aria-references-CUmqibnO.js +54 -0
  51. package/dist/cjs/{attributes-CW49XqaL.js → attributes-Cgbkw6gO.js} +3 -0
  52. package/dist/cjs/loader.cjs.js +1 -1
  53. package/dist/cjs/pds-alert.cjs.entry.js +2 -2
  54. package/dist/cjs/pds-avatar.cjs.entry.js +3 -2
  55. package/dist/cjs/pds-box.cjs.entry.js +4 -3
  56. package/dist/cjs/pds-button.cjs.entry.js +25 -45
  57. package/dist/cjs/pds-checkbox.cjs.entry.js +4 -4
  58. package/dist/cjs/pds-chip.cjs.entry.js +3 -3
  59. package/dist/cjs/pds-combobox.cjs.entry.js +246 -106
  60. package/dist/cjs/pds-copytext.cjs.entry.js +3 -3
  61. package/dist/cjs/pds-datepicker.cjs.entry.js +44 -9
  62. package/dist/cjs/pds-drawer-content.cjs.entry.js +1 -1
  63. package/dist/cjs/pds-drawer-footer.cjs.entry.js +1 -1
  64. package/dist/cjs/pds-drawer-header.cjs.entry.js +1 -1
  65. package/dist/cjs/pds-drawer.cjs.entry.js +5 -7
  66. package/dist/cjs/pds-dropdown-menu-item.cjs.entry.js +85 -49
  67. package/dist/cjs/pds-dropdown-menu-separator.cjs.entry.js +2 -2
  68. package/dist/cjs/pds-dropdown-menu.cjs.entry.js +83 -10
  69. package/dist/cjs/pds-filter.cjs.entry.js +24 -2
  70. package/dist/cjs/pds-image.cjs.entry.js +148 -6
  71. package/dist/cjs/pds-input.cjs.entry.js +4 -4
  72. package/dist/cjs/pds-link.cjs.entry.js +4 -5
  73. package/dist/cjs/pds-loader.cjs.entry.js +4 -3
  74. package/dist/cjs/pds-modal-footer.cjs.entry.js +1 -1
  75. package/dist/cjs/pds-modal-header.cjs.entry.js +1 -1
  76. package/dist/cjs/pds-modal.cjs.entry.js +9 -12
  77. package/dist/cjs/pds-multiselect.cjs.entry.js +64 -18
  78. package/dist/cjs/pds-popover.cjs.entry.js +8 -6
  79. package/dist/cjs/pds-progress.cjs.entry.js +3 -3
  80. package/dist/cjs/pds-radio-group.cjs.entry.js +4 -4
  81. package/dist/cjs/pds-radio.cjs.entry.js +6 -6
  82. package/dist/cjs/pds-row.cjs.entry.js +1 -1
  83. package/dist/cjs/pds-select.cjs.entry.js +2 -2
  84. package/dist/cjs/pds-sortable-item.cjs.entry.js +28 -5
  85. package/dist/cjs/pds-sortable.cjs.entry.js +356 -4
  86. package/dist/cjs/pds-switch.cjs.entry.js +92 -15
  87. package/dist/cjs/pds-tab.cjs.entry.js +1 -1
  88. package/dist/cjs/pds-table-body.cjs.entry.js +1 -1
  89. package/dist/cjs/pds-table-cell.cjs.entry.js +24 -5
  90. package/dist/cjs/pds-table-head-cell.cjs.entry.js +59 -11
  91. package/dist/cjs/pds-table-head.cjs.entry.js +1 -1
  92. package/dist/cjs/pds-table-row.cjs.entry.js +1 -1
  93. package/dist/cjs/pds-table.cjs.entry.js +260 -5
  94. package/dist/cjs/pds-tabpanel.cjs.entry.js +1 -1
  95. package/dist/cjs/pds-tabs.cjs.entry.js +3 -3
  96. package/dist/cjs/pds-text.cjs.entry.js +5 -3
  97. package/dist/cjs/pds-textarea.cjs.entry.js +8 -7
  98. package/dist/cjs/pds-toast.cjs.entry.js +8 -4
  99. package/dist/cjs/pds-tooltip.cjs.entry.js +1 -1
  100. package/dist/cjs/pine-core.cjs.js +1 -1
  101. package/dist/cjs/sortable-label-DOcJrHvA.js +37 -0
  102. package/dist/cjs/{truncation-tooltip-Bikp7n9I.js → truncation-tooltip-CM5HgRHh.js} +69 -0
  103. package/dist/collection/components/pds-alert/pds-alert.css +0 -3
  104. package/dist/collection/components/pds-alert/pds-alert.js +3 -2
  105. package/dist/collection/components/pds-avatar/pds-avatar.js +7 -6
  106. package/dist/collection/components/pds-avatar/stories/pds-avatar.stories.js +1 -1
  107. package/dist/collection/components/pds-box/pds-box.css +1273 -1189
  108. package/dist/collection/components/pds-box/pds-box.js +180 -156
  109. package/dist/collection/components/pds-box/stories/pds-box.stories.js +79 -37
  110. package/dist/collection/components/pds-button/pds-button.js +26 -4
  111. package/dist/collection/components/pds-button/stories/pds-button.stories.js +25 -11
  112. package/dist/collection/components/pds-checkbox/pds-checkbox.js +10 -10
  113. package/dist/collection/components/pds-chip/pds-chip.js +3 -3
  114. package/dist/collection/components/pds-combobox/pds-combobox.css +162 -53
  115. package/dist/collection/components/pds-combobox/pds-combobox.js +261 -121
  116. package/dist/collection/components/pds-combobox/stories/pds-combobox.stories.js +35 -4
  117. package/dist/collection/components/pds-copytext/pds-copytext.js +2 -2
  118. package/dist/collection/components/pds-datepicker/pds-datepicker.js +3 -3
  119. package/dist/collection/components/pds-datepicker/presets.js +42 -7
  120. package/dist/collection/components/pds-drawer/pds-drawer-content/pds-drawer-content.js +2 -5
  121. package/dist/collection/components/pds-drawer/pds-drawer-footer/pds-drawer-footer.js +2 -1
  122. package/dist/collection/components/pds-drawer/pds-drawer-header/pds-drawer-header.js +2 -1
  123. package/dist/collection/components/pds-drawer/pds-drawer.js +8 -10
  124. package/dist/collection/components/pds-dropdown-menu/pds-dropdown-menu-item/pds-dropdown-menu-item.css +17 -8
  125. package/dist/collection/components/pds-dropdown-menu/pds-dropdown-menu-item/pds-dropdown-menu-item.js +95 -62
  126. package/dist/collection/components/pds-dropdown-menu/pds-dropdown-menu-separator/pds-dropdown-menu-separator.js +3 -3
  127. package/dist/collection/components/pds-dropdown-menu/pds-dropdown-menu.css +2 -0
  128. package/dist/collection/components/pds-dropdown-menu/pds-dropdown-menu.js +84 -9
  129. package/dist/collection/components/pds-dropdown-menu/stories/pds-dropdown-menu.stories.js +24 -1
  130. package/dist/collection/components/pds-filters/pds-filter/pds-filter.css +2 -1
  131. package/dist/collection/components/pds-filters/pds-filter/pds-filter.js +24 -7
  132. package/dist/collection/components/pds-image/image-interface.js +1 -0
  133. package/dist/collection/components/pds-image/pds-image.css +11 -0
  134. package/dist/collection/components/pds-image/pds-image.js +249 -8
  135. package/dist/collection/components/pds-image/stories/pds-image.stories.js +117 -1
  136. package/dist/collection/components/pds-input/pds-input.js +14 -9
  137. package/dist/collection/components/pds-link/pds-link.js +10 -14
  138. package/dist/collection/components/pds-link/stories/pds-link.stories.js +6 -2
  139. package/dist/collection/components/pds-loader/pds-loader.js +5 -4
  140. package/dist/collection/components/pds-modal/pds-modal-footer/pds-modal-footer.js +2 -1
  141. package/dist/collection/components/pds-modal/pds-modal-header/pds-modal-header.js +2 -1
  142. package/dist/collection/components/pds-modal/pds-modal.js +11 -13
  143. package/dist/collection/components/pds-modal/stories/pds-modal.stories.js +7 -7
  144. package/dist/collection/components/pds-multiselect/pds-multiselect.css +2 -2
  145. package/dist/collection/components/pds-multiselect/pds-multiselect.js +63 -18
  146. package/dist/collection/components/pds-popover/pds-popover.css +1 -1
  147. package/dist/collection/components/pds-popover/pds-popover.js +9 -7
  148. package/dist/collection/components/pds-progress/pds-progress.js +4 -4
  149. package/dist/collection/components/pds-radio/pds-radio.css +5 -1
  150. package/dist/collection/components/pds-radio/pds-radio.js +9 -9
  151. package/dist/collection/components/pds-radio/stories/pds-radio.stories.js +9 -9
  152. package/dist/collection/components/pds-radio-group/pds-radio-group.js +7 -7
  153. package/dist/collection/components/pds-radio-group/stories/pds-radio-group.stories.js +3 -3
  154. package/dist/collection/components/pds-row/stories/pds-row.stories.js +15 -14
  155. package/dist/collection/components/pds-select/pds-select.js +7 -4
  156. package/dist/collection/components/pds-sortable/pds-sortable-item/pds-sortable-item.css +38 -0
  157. package/dist/collection/components/pds-sortable/pds-sortable-item/pds-sortable-item.js +47 -5
  158. package/dist/collection/components/pds-sortable/pds-sortable.js +481 -5
  159. package/dist/collection/components/pds-sortable/sortable-label.js +33 -0
  160. package/dist/collection/components/pds-sortable/stories/pds-sortable.stories.js +27 -0
  161. package/dist/collection/components/pds-switch/pds-switch.js +114 -17
  162. package/dist/collection/components/pds-switch/stories/pds-switch.stories.js +79 -0
  163. package/dist/collection/components/pds-table/pds-table-body/pds-table-body.js +4 -1
  164. package/dist/collection/components/pds-table/pds-table-cell/pds-table-cell.js +47 -4
  165. package/dist/collection/components/pds-table/pds-table-head/pds-table-head.js +6 -2
  166. package/dist/collection/components/pds-table/pds-table-head-cell/pds-table-head-cell.css +11 -0
  167. package/dist/collection/components/pds-table/pds-table-head-cell/pds-table-head-cell.js +98 -10
  168. package/dist/collection/components/pds-table/pds-table-row/pds-table-row.js +5 -1
  169. package/dist/collection/components/pds-table/pds-table.css +8 -0
  170. package/dist/collection/components/pds-table/pds-table.js +295 -7
  171. package/dist/collection/components/pds-table/stories/pds-table.stories.js +131 -6
  172. package/dist/collection/components/pds-tabs/pds-tabs.js +3 -3
  173. package/dist/collection/components/pds-tabs/stories/pds-tabs.stories.js +1 -1
  174. package/dist/collection/components/pds-text/pds-text.js +5 -3
  175. package/dist/collection/components/pds-textarea/pds-textarea.js +16 -14
  176. package/dist/collection/components/pds-textarea/stories/pds-textarea.stories.js +2 -13
  177. package/dist/collection/components/pds-toast/pds-toast.css +4 -3
  178. package/dist/collection/components/pds-toast/pds-toast.js +9 -5
  179. package/dist/collection/components/pds-toast/stories/pds-toast.stories.js +2 -2
  180. package/dist/collection/components/pds-tooltip/pds-tooltip.css +2 -1
  181. package/dist/collection/components/pds-tooltip/stories/pds-tooltip.stories.js +17 -17
  182. package/dist/collection/utils/aria-references.js +9 -3
  183. package/dist/collection/utils/truncation-tooltip.js +67 -0
  184. package/dist/docs.json +1124 -374
  185. package/dist/esm/aria-references-CNn1lObg.js +50 -0
  186. package/dist/esm/{attributes-DkeVeN0g.js → attributes-CD8knu3a.js} +3 -0
  187. package/dist/esm/{index-DvN3tyZp.js → index-B0DXTeeV.js} +1 -1
  188. package/dist/esm/loader.js +1 -1
  189. package/dist/esm/pds-accordion.entry.js +1 -1
  190. package/dist/esm/pds-alert.entry.js +2 -2
  191. package/dist/esm/pds-avatar.entry.js +4 -3
  192. package/dist/esm/pds-box.entry.js +4 -3
  193. package/dist/esm/pds-button.entry.js +24 -44
  194. package/dist/esm/pds-checkbox.entry.js +5 -5
  195. package/dist/esm/pds-chip.entry.js +4 -4
  196. package/dist/esm/pds-combobox.entry.js +246 -106
  197. package/dist/esm/pds-copytext.entry.js +4 -4
  198. package/dist/esm/pds-datepicker.entry.js +45 -10
  199. package/dist/esm/pds-drawer-content.entry.js +1 -1
  200. package/dist/esm/pds-drawer-footer.entry.js +1 -1
  201. package/dist/esm/pds-drawer-header.entry.js +1 -1
  202. package/dist/esm/pds-drawer.entry.js +5 -7
  203. package/dist/esm/pds-dropdown-menu-item.entry.js +85 -49
  204. package/dist/esm/pds-dropdown-menu-separator.entry.js +2 -2
  205. package/dist/esm/pds-dropdown-menu.entry.js +84 -11
  206. package/dist/esm/pds-filter.entry.js +25 -3
  207. package/dist/esm/pds-image.entry.js +149 -7
  208. package/dist/esm/pds-input.entry.js +5 -5
  209. package/dist/esm/pds-link.entry.js +5 -6
  210. package/dist/esm/pds-loader.entry.js +4 -3
  211. package/dist/esm/pds-modal-footer.entry.js +1 -1
  212. package/dist/esm/pds-modal-header.entry.js +1 -1
  213. package/dist/esm/pds-modal.entry.js +9 -12
  214. package/dist/esm/pds-multiselect.entry.js +65 -19
  215. package/dist/esm/pds-popover.entry.js +8 -6
  216. package/dist/esm/pds-progress.entry.js +3 -3
  217. package/dist/esm/pds-radio-group.entry.js +5 -5
  218. package/dist/esm/pds-radio.entry.js +7 -7
  219. package/dist/esm/pds-row.entry.js +1 -1
  220. package/dist/esm/pds-select.entry.js +3 -3
  221. package/dist/esm/pds-sortable-item.entry.js +29 -6
  222. package/dist/esm/pds-sortable.entry.js +357 -5
  223. package/dist/esm/pds-switch.entry.js +94 -17
  224. package/dist/esm/pds-tab.entry.js +1 -1
  225. package/dist/esm/pds-table-body.entry.js +1 -1
  226. package/dist/esm/pds-table-cell.entry.js +24 -5
  227. package/dist/esm/pds-table-head-cell.entry.js +60 -12
  228. package/dist/esm/pds-table-head.entry.js +1 -1
  229. package/dist/esm/pds-table-row.entry.js +1 -1
  230. package/dist/esm/pds-table.entry.js +261 -6
  231. package/dist/esm/pds-tabpanel.entry.js +1 -1
  232. package/dist/esm/pds-tabs.entry.js +3 -3
  233. package/dist/esm/pds-text.entry.js +5 -3
  234. package/dist/esm/pds-textarea.entry.js +9 -8
  235. package/dist/esm/pds-toast.entry.js +8 -4
  236. package/dist/esm/pds-tooltip.entry.js +1 -1
  237. package/dist/esm/pine-core.js +1 -1
  238. package/dist/esm/sortable-label-PItnzVVR.js +35 -0
  239. package/dist/esm/{truncation-tooltip-DBcPipr9.js → truncation-tooltip-CkIWm6Z-.js} +68 -1
  240. package/dist/esm-es5/aria-references-CNn1lObg.js +1 -0
  241. package/dist/esm-es5/{attributes-DkeVeN0g.js → attributes-CD8knu3a.js} +1 -1
  242. package/dist/esm-es5/{index-DvN3tyZp.js → index-B0DXTeeV.js} +1 -1
  243. package/dist/esm-es5/loader.js +1 -1
  244. package/dist/esm-es5/pds-accordion.entry.js +1 -1
  245. package/dist/esm-es5/pds-alert.entry.js +1 -1
  246. package/dist/esm-es5/pds-avatar.entry.js +1 -1
  247. package/dist/esm-es5/pds-box.entry.js +1 -1
  248. package/dist/esm-es5/pds-button.entry.js +1 -1
  249. package/dist/esm-es5/pds-checkbox.entry.js +1 -1
  250. package/dist/esm-es5/pds-chip.entry.js +1 -1
  251. package/dist/esm-es5/pds-combobox.entry.js +1 -1
  252. package/dist/esm-es5/pds-copytext.entry.js +1 -1
  253. package/dist/esm-es5/pds-datepicker.entry.js +1 -1
  254. package/dist/esm-es5/pds-drawer-content.entry.js +1 -1
  255. package/dist/esm-es5/pds-drawer-footer.entry.js +1 -1
  256. package/dist/esm-es5/pds-drawer-header.entry.js +1 -1
  257. package/dist/esm-es5/pds-drawer.entry.js +1 -1
  258. package/dist/esm-es5/pds-dropdown-menu-item.entry.js +1 -1
  259. package/dist/esm-es5/pds-dropdown-menu-separator.entry.js +1 -1
  260. package/dist/esm-es5/pds-dropdown-menu.entry.js +1 -1
  261. package/dist/esm-es5/pds-filter.entry.js +1 -1
  262. package/dist/esm-es5/pds-image.entry.js +1 -1
  263. package/dist/esm-es5/pds-input.entry.js +1 -1
  264. package/dist/esm-es5/pds-link.entry.js +1 -1
  265. package/dist/esm-es5/pds-loader.entry.js +1 -1
  266. package/dist/esm-es5/pds-modal-footer.entry.js +1 -1
  267. package/dist/esm-es5/pds-modal-header.entry.js +1 -1
  268. package/dist/esm-es5/pds-modal.entry.js +1 -1
  269. package/dist/esm-es5/pds-multiselect.entry.js +1 -1
  270. package/dist/esm-es5/pds-popover.entry.js +1 -1
  271. package/dist/esm-es5/pds-progress.entry.js +1 -1
  272. package/dist/esm-es5/pds-radio-group.entry.js +1 -1
  273. package/dist/esm-es5/pds-radio.entry.js +1 -1
  274. package/dist/esm-es5/pds-row.entry.js +1 -1
  275. package/dist/esm-es5/pds-select.entry.js +1 -1
  276. package/dist/esm-es5/pds-sortable-item.entry.js +1 -1
  277. package/dist/esm-es5/pds-sortable.entry.js +2 -2
  278. package/dist/esm-es5/pds-switch.entry.js +1 -1
  279. package/dist/esm-es5/pds-tab.entry.js +1 -1
  280. package/dist/esm-es5/pds-table-body.entry.js +1 -1
  281. package/dist/esm-es5/pds-table-cell.entry.js +1 -1
  282. package/dist/esm-es5/pds-table-head-cell.entry.js +1 -1
  283. package/dist/esm-es5/pds-table-head.entry.js +1 -1
  284. package/dist/esm-es5/pds-table-row.entry.js +1 -1
  285. package/dist/esm-es5/pds-table.entry.js +1 -1
  286. package/dist/esm-es5/pds-tabpanel.entry.js +1 -1
  287. package/dist/esm-es5/pds-tabs.entry.js +1 -1
  288. package/dist/esm-es5/pds-text.entry.js +1 -1
  289. package/dist/esm-es5/pds-textarea.entry.js +1 -1
  290. package/dist/esm-es5/pds-toast.entry.js +1 -1
  291. package/dist/esm-es5/pds-tooltip.entry.js +1 -1
  292. package/dist/esm-es5/pine-core.js +1 -1
  293. package/dist/esm-es5/sortable-label-PItnzVVR.js +1 -0
  294. package/dist/esm-es5/truncation-tooltip-CkIWm6Z-.js +1 -0
  295. package/dist/pine-core/{p-f834cb07.system.entry.js → p-00891b8d.system.entry.js} +1 -1
  296. package/dist/pine-core/{p-3f8bd3fb.system.entry.js → p-053ff8eb.system.entry.js} +1 -1
  297. package/dist/pine-core/p-08b9e3ad.entry.js +1 -0
  298. package/dist/pine-core/{p-4d98bc0c.system.entry.js → p-0a7570dd.system.entry.js} +1 -1
  299. package/dist/pine-core/{p-d018dc60.system.entry.js → p-0ac4262e.system.entry.js} +1 -1
  300. package/dist/pine-core/{p-89d38a82.system.entry.js → p-0e1b8bd1.system.entry.js} +1 -1
  301. package/dist/pine-core/{p-e1d1b5d8.entry.js → p-12fdc65f.entry.js} +1 -1
  302. package/dist/pine-core/{p-d48fe5a0.system.entry.js → p-16fceef6.system.entry.js} +1 -1
  303. package/dist/pine-core/p-1765a41b.system.entry.js +1 -0
  304. package/dist/pine-core/{p-a594c41f.entry.js → p-18524c25.entry.js} +1 -1
  305. package/dist/pine-core/p-1a013a5c.system.entry.js +1 -0
  306. package/dist/pine-core/{p-2b9622c1.system.entry.js → p-1ab52531.system.entry.js} +1 -1
  307. package/dist/pine-core/p-1c584a20.entry.js +1 -0
  308. package/dist/pine-core/p-1edef412.entry.js +1 -0
  309. package/dist/pine-core/{p-5946203c.entry.js → p-1f998e3e.entry.js} +1 -1
  310. package/dist/pine-core/{p-39e57657.entry.js → p-1fb1ca3d.entry.js} +1 -1
  311. package/dist/pine-core/p-2b6becc2.entry.js +1 -0
  312. package/dist/pine-core/p-2cc7c682.entry.js +1 -0
  313. package/dist/pine-core/{p-639acef8.system.entry.js → p-2ddcd845.system.entry.js} +1 -1
  314. package/dist/pine-core/{p-6a1aa8d3.entry.js → p-2f15e85f.entry.js} +1 -1
  315. package/dist/pine-core/{p-67f795d5.system.entry.js → p-33da254f.system.entry.js} +1 -1
  316. package/dist/pine-core/{p-c6a9e62c.system.entry.js → p-3fc9ef80.system.entry.js} +1 -1
  317. package/dist/pine-core/p-4125a4a6.system.entry.js +1 -0
  318. package/dist/pine-core/p-47df9e9f.system.entry.js +3 -0
  319. package/dist/pine-core/p-51680c9c.system.entry.js +1 -0
  320. package/dist/pine-core/p-55535481.system.entry.js +1 -0
  321. package/dist/pine-core/p-55a4659a.system.entry.js +1 -0
  322. package/dist/pine-core/{p-c5e1eb3c.system.entry.js → p-57af5c29.system.entry.js} +1 -1
  323. package/dist/pine-core/p-57edd301.system.entry.js +1 -0
  324. package/dist/pine-core/{p-bfa34194.entry.js → p-5d582798.entry.js} +1 -1
  325. package/dist/pine-core/p-5db87fda.system.entry.js +1 -0
  326. package/dist/pine-core/{p-19cf1d91.system.entry.js → p-5eb0c78c.system.entry.js} +1 -1
  327. package/dist/pine-core/{p-42f70f93.system.entry.js → p-6017afb5.system.entry.js} +1 -1
  328. package/dist/pine-core/{p-63f85859.system.entry.js → p-60e65fe0.system.entry.js} +1 -1
  329. package/dist/pine-core/{p-973c3ac0.entry.js → p-627a94da.entry.js} +1 -1
  330. package/dist/pine-core/{p-a9d96e22.entry.js → p-68328afc.entry.js} +1 -1
  331. package/dist/pine-core/{p-bd7dc317.system.entry.js → p-72668673.system.entry.js} +1 -1
  332. package/dist/pine-core/p-72ff5ad2.system.entry.js +1 -0
  333. package/dist/pine-core/p-736ea7dd.entry.js +7 -0
  334. package/dist/pine-core/p-765f4207.entry.js +1 -0
  335. package/dist/pine-core/{p-2a18852f.entry.js → p-77530cf2.entry.js} +1 -1
  336. package/dist/pine-core/p-77a22399.entry.js +1 -0
  337. package/dist/pine-core/p-783127bf.entry.js +1 -0
  338. package/dist/pine-core/{p-d9719e37.entry.js → p-82f7eed1.entry.js} +1 -1
  339. package/dist/pine-core/{p-124a0a24.entry.js → p-84d4ae26.entry.js} +1 -1
  340. package/dist/pine-core/p-8deeda07.entry.js +1 -0
  341. package/dist/pine-core/{p-849ec281.system.entry.js → p-8e17a6d8.system.entry.js} +1 -1
  342. package/dist/pine-core/p-8e7e7bba.entry.js +1 -0
  343. package/dist/pine-core/{p-e82f758f.system.entry.js → p-907c69e9.system.entry.js} +1 -1
  344. package/dist/pine-core/{p-1415c988.system.entry.js → p-90f83a5b.system.entry.js} +1 -1
  345. package/dist/pine-core/p-97145eee.system.entry.js +1 -0
  346. package/dist/pine-core/{p-a09c9c5e.system.entry.js → p-9d983e09.system.entry.js} +1 -1
  347. package/dist/pine-core/{p-1e3ef425.entry.js → p-9e005996.entry.js} +1 -1
  348. package/dist/pine-core/{p-DvN3tyZp.js → p-B0DXTeeV.js} +1 -1
  349. package/dist/pine-core/{p-CNXspDYs.system.js → p-BlJQebvG.system.js} +1 -1
  350. package/dist/pine-core/p-C35-349-.system.js +1 -0
  351. package/dist/pine-core/{p-vFsJv75D.system.js → p-CIe1DGXa.system.js} +1 -1
  352. package/dist/pine-core/p-CNn1lObg.js +1 -0
  353. package/dist/pine-core/p-CQJ44c6o.system.js +1 -0
  354. package/dist/pine-core/p-Dv9QBmIF.js +1 -0
  355. package/dist/pine-core/p-PItnzVVR.js +1 -0
  356. package/dist/pine-core/p-VPGVqK3P.system.js +1 -0
  357. package/dist/pine-core/p-XK45dzWR.system.js +1 -1
  358. package/dist/pine-core/p-a149af29.entry.js +1 -0
  359. package/dist/pine-core/p-a20d9eca.system.entry.js +1 -0
  360. package/dist/pine-core/{p-f6f4fd42.entry.js → p-a5782d99.entry.js} +1 -1
  361. package/dist/pine-core/p-a5e9c583.entry.js +1 -0
  362. package/dist/pine-core/{p-4d47023c.system.entry.js → p-a9eaf160.system.entry.js} +1 -1
  363. package/dist/pine-core/{p-143b33a6.entry.js → p-b00b07e3.entry.js} +1 -1
  364. package/dist/pine-core/{p-c7a53c4f.entry.js → p-b7b29392.entry.js} +1 -1
  365. package/dist/pine-core/p-b96bdff6.entry.js +1 -0
  366. package/dist/pine-core/{p-f71d71ca.entry.js → p-bbd9ab75.entry.js} +1 -1
  367. package/dist/pine-core/p-bdab6c9f.entry.js +1 -0
  368. package/dist/pine-core/p-biShcgLI.js +1 -0
  369. package/dist/pine-core/{p-548bce53.system.entry.js → p-c12b5cd7.system.entry.js} +1 -1
  370. package/dist/pine-core/p-c1dc7692.entry.js +1 -0
  371. package/dist/pine-core/p-c76d8b9e.system.entry.js +1 -0
  372. package/dist/pine-core/{p-590df41a.entry.js → p-c89ea2d3.entry.js} +1 -1
  373. package/dist/pine-core/{p-d920d759.system.entry.js → p-c9630934.system.entry.js} +1 -1
  374. package/dist/pine-core/{p-6f4ab1ea.system.entry.js → p-cb9227f6.system.entry.js} +1 -1
  375. package/dist/pine-core/p-ceef0eb1.entry.js +1 -0
  376. package/dist/pine-core/p-d1283e8d.entry.js +1 -0
  377. package/dist/pine-core/p-d676926d.system.entry.js +1 -0
  378. package/dist/pine-core/{p-61cfdbb2.entry.js → p-d7d7a4e1.entry.js} +1 -1
  379. package/dist/pine-core/p-d85d50cb.entry.js +1 -0
  380. package/dist/pine-core/p-daa802f1.entry.js +2 -0
  381. package/dist/pine-core/p-ddf4b9b5.system.entry.js +1 -0
  382. package/dist/pine-core/p-de3b319e.system.entry.js +8 -0
  383. package/dist/pine-core/{p-cb9baf78.system.entry.js → p-e00777da.system.entry.js} +1 -1
  384. package/dist/pine-core/p-e2541eeb.entry.js +1 -0
  385. package/dist/pine-core/{p-01f1cdaf.system.entry.js → p-e2a1a49a.system.entry.js} +1 -1
  386. package/dist/pine-core/p-e4ebea88.system.entry.js +1 -0
  387. package/dist/pine-core/{p-947582e1.entry.js → p-e554bd64.entry.js} +1 -1
  388. package/dist/pine-core/{p-dd7ded84.entry.js → p-e6427c87.entry.js} +1 -1
  389. package/dist/pine-core/{p-50ddadbf.entry.js → p-e72e8b8f.entry.js} +1 -1
  390. package/dist/pine-core/p-e92d0f0f.system.entry.js +1 -0
  391. package/dist/pine-core/{p-9b32727a.system.entry.js → p-eab165b9.system.entry.js} +1 -1
  392. package/dist/pine-core/p-eabc4bd8.entry.js +1 -0
  393. package/dist/pine-core/p-ef9f84f2.system.entry.js +1 -0
  394. package/dist/pine-core/{p-c9ae7964.entry.js → p-f026af73.entry.js} +1 -1
  395. package/dist/pine-core/{p-99530cb5.entry.js → p-f0509c8e.entry.js} +1 -1
  396. package/dist/pine-core/p-f1252e72.system.entry.js +1 -0
  397. package/dist/pine-core/p-f3496fd1.entry.js +1 -0
  398. package/dist/pine-core/{p-eecd9ad8.system.entry.js → p-f90f4be7.system.entry.js} +1 -1
  399. package/dist/pine-core/p-f9bdaadd.system.entry.js +1 -0
  400. package/dist/pine-core/{p-128c04e7.entry.js → p-fda791df.entry.js} +1 -1
  401. package/dist/pine-core/p-fea4296d.entry.js +1 -0
  402. package/dist/pine-core/pine-core.esm.js +1 -1
  403. package/dist/types/components/pds-alert/pds-alert.d.ts +2 -1
  404. package/dist/types/components/pds-avatar/pds-avatar.d.ts +5 -4
  405. package/dist/types/components/pds-box/pds-box.d.ts +68 -57
  406. package/dist/types/components/pds-button/pds-button.d.ts +14 -3
  407. package/dist/types/components/pds-checkbox/pds-checkbox.d.ts +15 -8
  408. package/dist/types/components/pds-chip/pds-chip.d.ts +2 -2
  409. package/dist/types/components/pds-combobox/pds-combobox.d.ts +48 -11
  410. package/dist/types/components/pds-copytext/pds-copytext.d.ts +3 -1
  411. package/dist/types/components/pds-datepicker/datepicker-interface.d.ts +20 -4
  412. package/dist/types/components/pds-datepicker/pds-datepicker.d.ts +3 -2
  413. package/dist/types/components/pds-datepicker/presets.d.ts +3 -2
  414. package/dist/types/components/pds-drawer/pds-drawer-content/pds-drawer-content.d.ts +1 -4
  415. package/dist/types/components/pds-drawer/pds-drawer-footer/pds-drawer-footer.d.ts +1 -0
  416. package/dist/types/components/pds-drawer/pds-drawer-header/pds-drawer-header.d.ts +1 -0
  417. package/dist/types/components/pds-drawer/pds-drawer.d.ts +4 -6
  418. package/dist/types/components/pds-dropdown-menu/pds-dropdown-menu-item/pds-dropdown-menu-item.d.ts +20 -16
  419. package/dist/types/components/pds-dropdown-menu/pds-dropdown-menu-separator/pds-dropdown-menu-separator.d.ts +1 -1
  420. package/dist/types/components/pds-dropdown-menu/pds-dropdown-menu.d.ts +7 -0
  421. package/dist/types/components/pds-filters/pds-filter/pds-filter.d.ts +6 -5
  422. package/dist/types/components/pds-image/image-interface.d.ts +12 -0
  423. package/dist/types/components/pds-image/pds-image.d.ts +69 -9
  424. package/dist/types/components/pds-input/pds-input.d.ts +17 -7
  425. package/dist/types/components/pds-link/pds-link.d.ts +8 -8
  426. package/dist/types/components/pds-loader/pds-loader.d.ts +3 -2
  427. package/dist/types/components/pds-modal/pds-modal-footer/pds-modal-footer.d.ts +1 -0
  428. package/dist/types/components/pds-modal/pds-modal-header/pds-modal-header.d.ts +1 -0
  429. package/dist/types/components/pds-modal/pds-modal.d.ts +7 -9
  430. package/dist/types/components/pds-multiselect/pds-multiselect.d.ts +14 -8
  431. package/dist/types/components/pds-popover/pds-popover.d.ts +2 -2
  432. package/dist/types/components/pds-progress/pds-progress.d.ts +2 -2
  433. package/dist/types/components/pds-radio/pds-radio.d.ts +6 -5
  434. package/dist/types/components/pds-radio-group/pds-radio-group.d.ts +5 -4
  435. package/dist/types/components/pds-select/pds-select.d.ts +9 -3
  436. package/dist/types/components/pds-sortable/pds-sortable-item/pds-sortable-item.d.ts +8 -2
  437. package/dist/types/components/pds-sortable/pds-sortable.d.ts +82 -1
  438. package/dist/types/components/pds-sortable/sortable-label.d.ts +7 -0
  439. package/dist/types/components/pds-switch/pds-switch.d.ts +17 -2
  440. package/dist/types/components/pds-table/pds-table-body/pds-table-body.d.ts +3 -0
  441. package/dist/types/components/pds-table/pds-table-cell/pds-table-cell.d.ts +10 -0
  442. package/dist/types/components/pds-table/pds-table-head/pds-table-head.d.ts +5 -1
  443. package/dist/types/components/pds-table/pds-table-head-cell/pds-table-head-cell.d.ts +21 -0
  444. package/dist/types/components/pds-table/pds-table-row/pds-table-row.d.ts +4 -0
  445. package/dist/types/components/pds-table/pds-table.d.ts +76 -2
  446. package/dist/types/components/pds-tabs/pds-tabs.d.ts +1 -1
  447. package/dist/types/components/pds-textarea/pds-textarea.d.ts +15 -13
  448. package/dist/types/components/pds-toast/pds-toast.d.ts +5 -1
  449. package/dist/types/components.d.ts +480 -325
  450. package/dist/types/utils/aria-references.d.ts +4 -0
  451. package/dist/types/utils/truncation-tooltip.d.ts +39 -0
  452. package/dist/types/utils/types.d.ts +3 -0
  453. package/dist/vscode.html-data.json +340 -134
  454. package/hydrate/index.js +1800 -353
  455. package/hydrate/index.mjs +1800 -353
  456. package/package.json +3 -3
  457. package/readme.md +26 -55
  458. package/dist/esm-es5/truncation-tooltip-DBcPipr9.js +0 -1
  459. package/dist/pine-core/p-07323107.entry.js +0 -1
  460. package/dist/pine-core/p-08b8e941.entry.js +0 -1
  461. package/dist/pine-core/p-0b7b3fc2.system.entry.js +0 -3
  462. package/dist/pine-core/p-0d5f0ab5.system.entry.js +0 -1
  463. package/dist/pine-core/p-14dedf01.system.entry.js +0 -1
  464. package/dist/pine-core/p-1ca8d183.entry.js +0 -1
  465. package/dist/pine-core/p-1f62bb71.entry.js +0 -7
  466. package/dist/pine-core/p-2dd30d12.entry.js +0 -1
  467. package/dist/pine-core/p-3359a935.entry.js +0 -1
  468. package/dist/pine-core/p-35s7h-dk.js +0 -1
  469. package/dist/pine-core/p-3610cb3b.entry.js +0 -1
  470. package/dist/pine-core/p-39276663.entry.js +0 -1
  471. package/dist/pine-core/p-3a1dc752.system.entry.js +0 -1
  472. package/dist/pine-core/p-42d43c3f.system.entry.js +0 -1
  473. package/dist/pine-core/p-4a90b9c8.system.entry.js +0 -1
  474. package/dist/pine-core/p-4cfe922b.entry.js +0 -1
  475. package/dist/pine-core/p-5f181694.system.entry.js +0 -1
  476. package/dist/pine-core/p-60a30975.system.entry.js +0 -1
  477. package/dist/pine-core/p-62aa6a78.system.entry.js +0 -1
  478. package/dist/pine-core/p-64bcb378.entry.js +0 -1
  479. package/dist/pine-core/p-724baba3.system.entry.js +0 -1
  480. package/dist/pine-core/p-72659a0e.system.entry.js +0 -1
  481. package/dist/pine-core/p-8ade17ce.entry.js +0 -1
  482. package/dist/pine-core/p-8e7f75e6.entry.js +0 -1
  483. package/dist/pine-core/p-8fb520df.entry.js +0 -1
  484. package/dist/pine-core/p-92115e88.entry.js +0 -1
  485. package/dist/pine-core/p-94c9b7d1.system.entry.js +0 -1
  486. package/dist/pine-core/p-97356d4b.entry.js +0 -1
  487. package/dist/pine-core/p-97653e60.entry.js +0 -1
  488. package/dist/pine-core/p-97b73359.entry.js +0 -1
  489. package/dist/pine-core/p-BZVUD2on.js +0 -1
  490. package/dist/pine-core/p-Dj-z_ugg.system.js +0 -1
  491. package/dist/pine-core/p-ad5208a4.system.entry.js +0 -1
  492. package/dist/pine-core/p-afc2f165.entry.js +0 -1
  493. package/dist/pine-core/p-bcc378ba.system.entry.js +0 -8
  494. package/dist/pine-core/p-c8a0b562.system.entry.js +0 -1
  495. package/dist/pine-core/p-d4968f9d.system.entry.js +0 -1
  496. package/dist/pine-core/p-d6f338e0.entry.js +0 -1
  497. package/dist/pine-core/p-da8b864a.entry.js +0 -2
  498. package/dist/pine-core/p-db7fb5a3.entry.js +0 -1
  499. package/dist/pine-core/p-de455073.system.entry.js +0 -1
  500. package/dist/pine-core/p-e3de6a1d.entry.js +0 -1
  501. package/dist/pine-core/p-e84fa9ed.entry.js +0 -1
  502. package/dist/pine-core/p-eb4f0daa.system.entry.js +0 -1
  503. package/dist/pine-core/p-eb56af4a.system.entry.js +0 -1
  504. package/dist/pine-core/p-ef0eba9b.system.entry.js +0 -1
  505. package/dist/pine-core/p-f11cce27.system.entry.js +0 -1
  506. package/dist/pine-core/p-f354dbac.entry.js +0 -1
@@ -1 +1 @@
1
- import{proxyCustomElement as t,HTMLElement as e,createEvent as o,h as s,Host as n,transformTag as i}from"@stencil/core/internal/client";import{H as d}from"./attributes.js";import{b as p}from"./index2.js";import{r}from"./reflected-attribute-default.js";import{s as a}from"./truncation-tooltip.js";import{d as c}from"./pds-button2.js";import{d as h}from"./pds-icon2.js";import{d as l}from"./pds-loader2.js";const u=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.pdsCopyTextClick=o(this,"pdsCopyTextClick",7),this.hostKeeper=new d,this.truncationCleanup=null,this.border=!0,this.fullWidth=!1,this.truncate=!1,this.copyToClipboard=async t=>{try{void 0!==navigator.clipboard&&(await navigator.clipboard.writeText(t),this.pdsCopyTextClick.emit("Copied to clipboard"))}catch(t){this.pdsCopyTextClick.emit("Error writing text to clipboard: "+t)}},this.handleClick=()=>{this.copyToClipboard(this.value)}}connectedCallback(){this.hostKeeper.connect(this.el),this.truncate&&this.valueSpanEl&&this.initTruncationTooltip()}restoreBorderDefault(t){this.border=r(this.el,"border",t,!0)}handleTruncateChange(t){t?this.initTruncationTooltip():this.destroyTruncationTooltip()}handleValueChange(){this.truncate&&this.initTruncationTooltip()}componentDidLoad(){this.truncate&&this.initTruncationTooltip()}disconnectedCallback(){this.hostKeeper.disconnect(),this.destroyTruncationTooltip()}initTruncationTooltip(){this.destroyTruncationTooltip(),this.valueSpanEl&&(this.truncationCleanup=a({hostEl:this.el,contentEl:this.valueSpanEl,getTooltipText:()=>this.value||"",manageTabIndex:!1}))}destroyTruncationTooltip(){this.truncationCleanup&&(this.truncationCleanup(),this.truncationCleanup=null)}classNames(){const t=["pds-copytext"];return this.border&&t.push("pds-copytext--bordered"),this.fullWidth&&t.push("pds-copytext--full-width"),this.truncate&&t.push("pds-copytext--truncated"),t.join(" ")}render(){const t=this.classNames();return this.hostKeeper.record(t),s(n,{key:"35d74eaecedd432f7852545522f9ce72396f9ab9",class:t,id:this.componentId},s("pds-button",{key:"9550ce2fb21166e9726b08b5928036244c7b729e",type:"button",variant:"unstyled",onClick:this.handleClick},s("span",{key:"47af45448759c911ca4ca03d0158088289b622e0",ref:t=>this.valueSpanEl=t},this.value),s("pds-icon",{key:"3ddab7c3e7063843cd606ffb19481cae3792db43","aria-hidden":"true",icon:p,size:"16px"})))}get el(){return this}static get watchers(){return{border:[{restoreBorderDefault:0}],truncate:[{handleTruncateChange:0}],value:[{handleValueChange:0}]}}static get style(){return":host(.pds-copytext){--copytext-color-background-hover:var(--pine-color-background-inset)}:host(.pds-copytext) pds-button{-ms-flex-align:center;align-items:center;border-radius:var(--pine-border-radius-full);border-width:var(--pine-dimension-none);display:-ms-inline-flexbox;display:inline-flex;font-family:var(--pine-font-family-heading);font-size:var(--pine-font-size-body-md);font-weight:var(--pine-font-weight-body-medium);letter-spacing:var(--pine-letter-spacing);line-height:var(--pine-line-height-body);max-width:100%}:host(.pds-copytext) pds-button::part(button){padding-block:var(--pine-dimension-2xs);padding-inline:var(--pine-dimension-xs)}:host(.pds-copytext) pds-button::part(button):hover{background-color:var(--copytext-color-background-hover);color:var(--pine-color-text-secondary-hover)}:host(.pds-copytext) pds-button span{font-weight:var(--pine-font-weight-medium);-webkit-margin-end:var(--pine-dimension-xs);margin-inline-end:var(--pine-dimension-xs);white-space:nowrap}:host(.pds-copytext) pds-button :nth-child(2){-ms-flex-negative:0;flex-shrink:0}:host(.pds-copytext):host(.pds-copytext--bordered){border-width:var(--pine-dimension-none);padding:var(--pine-dimension-none)}:host(.pds-copytext):host(.pds-copytext--bordered) pds-button{padding:var(--pine-dimension-none)}:host(.pds-copytext):host(.pds-copytext--bordered) pds-button::part(button){padding:var(--pine-dimension-none)}:host(.pds-copytext):host(.pds-copytext--bordered) pds-button::part(button):hover{background-color:transparent}:host(.pds-copytext):host(.pds-copytext--bordered) span{background:var(--pine-color-secondary);border:var(--pine-border);border-radius:var(--pine-border-radius-full);-webkit-margin-end:var(--pine-dimension-sm);margin-inline-end:var(--pine-dimension-sm);padding-block:var(--pine-dimension-xs);padding-inline:var(--pine-dimension-sm)}:host(.pds-copytext):host(.pds-copytext--bordered) :hover span{border:var(--pine-border-hover)}:host(.pds-copytext):host(.pds-copytext--full-width) pds-button,:host(.pds-copytext):host(.pds-copytext--truncated) pds-button{display:-ms-inline-flexbox;display:inline-flex;min-width:auto;width:100%}:host(.pds-copytext):host(.pds-copytext--full-width) pds-button::part(button-content),:host(.pds-copytext):host(.pds-copytext--full-width) pds-button::part(button-text),:host(.pds-copytext):host(.pds-copytext--truncated) pds-button::part(button-content),:host(.pds-copytext):host(.pds-copytext--truncated) pds-button::part(button-text){-ms-flex-negative:1;flex-shrink:1;width:100%}:host(.pds-copytext):host(.pds-copytext--full-width) pds-button span,:host(.pds-copytext):host(.pds-copytext--truncated) pds-button span{text-align:start;width:100%}:host(.pds-copytext):host(.pds-copytext--full-width) pds-button{-ms-flex-pack:justify;justify-content:space-between}:host(.pds-copytext):host(.pds-copytext--truncated) pds-button span{overflow:hidden;text-overflow:ellipsis}"}},[1,"pds-copytext",{border:[1540],componentId:[1,"component-id"],fullWidth:[4,"full-width"],truncate:[4],value:[1]},void 0,{border:[{restoreBorderDefault:0}],truncate:[{handleTruncateChange:0}],value:[{handleValueChange:0}]}]),b=u,x=function(){"undefined"!=typeof customElements&&["pds-copytext","pds-button","pds-icon","pds-loader"].forEach((t=>{switch(t){case"pds-copytext":customElements.get(i(t))||customElements.define(i(t),u);break;case"pds-button":customElements.get(i(t))||c();break;case"pds-icon":customElements.get(i(t))||h();break;case"pds-loader":customElements.get(i(t))||l()}}))};export{b as PdsCopytext,x as defineCustomElement}
1
+ import{proxyCustomElement as t,HTMLElement as e,createEvent as o,h as s,Host as n,transformTag as i}from"@stencil/core/internal/client";import{H as d}from"./attributes.js";import{f as p}from"./index2.js";import{r}from"./reflected-attribute-default.js";import{s as a}from"./truncation-tooltip.js";import{d as c}from"./pds-button2.js";import{d as h}from"./pds-icon2.js";import{d as l}from"./pds-loader2.js";const u=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.pdsCopyTextClick=o(this,"pdsCopyTextClick",7),this.hostKeeper=new d,this.truncationCleanup=null,this.border=!0,this.fullWidth=!1,this.truncate=!1,this.copyToClipboard=async t=>{try{void 0!==navigator.clipboard&&(await navigator.clipboard.writeText(t),this.pdsCopyTextClick.emit("Copied to clipboard"))}catch(t){this.pdsCopyTextClick.emit("Error writing text to clipboard: "+t)}},this.handleClick=()=>{this.copyToClipboard(this.value)}}connectedCallback(){this.hostKeeper.connect(this.el),this.truncate&&this.valueSpanEl&&this.initTruncationTooltip()}restoreBorderDefault(t){this.border=r(this.el,"border",t,!0)}handleTruncateChange(t){t?this.initTruncationTooltip():this.destroyTruncationTooltip()}handleValueChange(){this.truncate&&this.initTruncationTooltip()}componentDidLoad(){this.truncate&&this.initTruncationTooltip()}disconnectedCallback(){this.hostKeeper.disconnect(),this.destroyTruncationTooltip()}initTruncationTooltip(){this.destroyTruncationTooltip(),this.valueSpanEl&&(this.truncationCleanup=a({hostEl:this.el,contentEl:this.valueSpanEl,getTooltipText:()=>this.value||"",manageTabIndex:!1}))}destroyTruncationTooltip(){this.truncationCleanup&&(this.truncationCleanup(),this.truncationCleanup=null)}classNames(){const t=["pds-copytext"];return this.border&&t.push("pds-copytext--bordered"),this.fullWidth&&t.push("pds-copytext--full-width"),this.truncate&&t.push("pds-copytext--truncated"),t.join(" ")}render(){const t=this.classNames();return this.hostKeeper.record(t),s(n,{key:"2c3bf9cd49adf9a68be5f6cf3bdf0bb29aab956a",class:t,id:this.componentId},s("pds-button",{key:"88ff5d9b7071583c76c8875834b9d4fda274d711",type:"button",variant:"unstyled",onClick:this.handleClick},s("span",{key:"5dee0ec40cbabf3d781037a785ec7c5aa7621121",ref:t=>this.valueSpanEl=t},this.value),s("pds-icon",{key:"3399b3573670f32f6a70f78f1ae60c9cba031955","aria-hidden":"true",icon:p,size:"16px"})))}get el(){return this}static get watchers(){return{border:[{restoreBorderDefault:0}],truncate:[{handleTruncateChange:0}],value:[{handleValueChange:0}]}}static get style(){return":host(.pds-copytext){--copytext-color-background-hover:var(--pine-color-background-inset)}:host(.pds-copytext) pds-button{-ms-flex-align:center;align-items:center;border-radius:var(--pine-border-radius-full);border-width:var(--pine-dimension-none);display:-ms-inline-flexbox;display:inline-flex;font-family:var(--pine-font-family-heading);font-size:var(--pine-font-size-body-md);font-weight:var(--pine-font-weight-body-medium);letter-spacing:var(--pine-letter-spacing);line-height:var(--pine-line-height-body);max-width:100%}:host(.pds-copytext) pds-button::part(button){padding-block:var(--pine-dimension-2xs);padding-inline:var(--pine-dimension-xs)}:host(.pds-copytext) pds-button::part(button):hover{background-color:var(--copytext-color-background-hover);color:var(--pine-color-text-secondary-hover)}:host(.pds-copytext) pds-button span{font-weight:var(--pine-font-weight-medium);-webkit-margin-end:var(--pine-dimension-xs);margin-inline-end:var(--pine-dimension-xs);white-space:nowrap}:host(.pds-copytext) pds-button :nth-child(2){-ms-flex-negative:0;flex-shrink:0}:host(.pds-copytext):host(.pds-copytext--bordered){border-width:var(--pine-dimension-none);padding:var(--pine-dimension-none)}:host(.pds-copytext):host(.pds-copytext--bordered) pds-button{padding:var(--pine-dimension-none)}:host(.pds-copytext):host(.pds-copytext--bordered) pds-button::part(button){padding:var(--pine-dimension-none)}:host(.pds-copytext):host(.pds-copytext--bordered) pds-button::part(button):hover{background-color:transparent}:host(.pds-copytext):host(.pds-copytext--bordered) span{background:var(--pine-color-secondary);border:var(--pine-border);border-radius:var(--pine-border-radius-full);-webkit-margin-end:var(--pine-dimension-sm);margin-inline-end:var(--pine-dimension-sm);padding-block:var(--pine-dimension-xs);padding-inline:var(--pine-dimension-sm)}:host(.pds-copytext):host(.pds-copytext--bordered) :hover span{border:var(--pine-border-hover)}:host(.pds-copytext):host(.pds-copytext--full-width) pds-button,:host(.pds-copytext):host(.pds-copytext--truncated) pds-button{display:-ms-inline-flexbox;display:inline-flex;min-width:auto;width:100%}:host(.pds-copytext):host(.pds-copytext--full-width) pds-button::part(button-content),:host(.pds-copytext):host(.pds-copytext--full-width) pds-button::part(button-text),:host(.pds-copytext):host(.pds-copytext--truncated) pds-button::part(button-content),:host(.pds-copytext):host(.pds-copytext--truncated) pds-button::part(button-text){-ms-flex-negative:1;flex-shrink:1;width:100%}:host(.pds-copytext):host(.pds-copytext--full-width) pds-button span,:host(.pds-copytext):host(.pds-copytext--truncated) pds-button span{text-align:start;width:100%}:host(.pds-copytext):host(.pds-copytext--full-width) pds-button{-ms-flex-pack:justify;justify-content:space-between}:host(.pds-copytext):host(.pds-copytext--truncated) pds-button span{overflow:hidden;text-overflow:ellipsis}"}},[1,"pds-copytext",{border:[1540],componentId:[1,"component-id"],fullWidth:[4,"full-width"],truncate:[4],value:[1]},void 0,{border:[{restoreBorderDefault:0}],truncate:[{handleTruncateChange:0}],value:[{handleValueChange:0}]}]),b=u,x=function(){"undefined"!=typeof customElements&&["pds-copytext","pds-button","pds-icon","pds-loader"].forEach((t=>{switch(t){case"pds-copytext":customElements.get(i(t))||customElements.define(i(t),u);break;case"pds-button":customElements.get(i(t))||c();break;case"pds-icon":customElements.get(i(t))||h();break;case"pds-loader":customElements.get(i(t))||l()}}))};export{b as PdsCopytext,x as defineCustomElement}
@@ -1 +1 @@
1
- import{proxyCustomElement as e,HTMLElement as t,createEvent as i,h as s,Host as r,transformTag as n}from"@stencil/core/internal/client";import{a,c as o,o as d,f as l,b as h,s as c,h as p}from"./floating-ui.dom.js";import{f as u,j as v,k as m,m as b,r as f,n as g}from"./index2.js";import{i as k}from"./form.js";import{r as _,f as y}from"./i18n-format.js";import{c as x}from"./closest.js";import{f as w}from"./portal-target.js";import{d as D}from"./pds-icon2.js";import{d as M}from"./pds-input2.js";const C=/^(\d{4})-(\d{2})-(\d{2})$/;function $(e){const t=C.exec((null!=e?e:"").trim());if(!t)return null;const[,i,s,r]=t.map(Number),n=new Date(Date.UTC(i,s-1,r));return n.getUTCFullYear()===i&&n.getUTCMonth()===s-1&&n.getUTCDate()===r?n:null}function A(e){return e.toISOString().slice(0,10)}function T(){const e=new Date;return new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()))}function j(e,t){return new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()+t))}function L(e,t){const i=new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth()+t,1)),s=P(i.getUTCFullYear(),i.getUTCMonth());return new Date(Date.UTC(i.getUTCFullYear(),i.getUTCMonth(),Math.min(e.getUTCDate(),s)))}function P(e,t){return new Date(Date.UTC(e,t+1,0)).getUTCDate()}function Y(e,t){return!!e&&!!t&&e.getTime()===t.getTime()}function H(e,t,i){return t&&e<t?t:i&&e>i?i:e}function z(e,t,i){return!!t&&e<t||!!i&&e>i}function E(e,t){return(e.getUTCDay()-t+7)%7}function S(e,t){return new Intl.DateTimeFormat(e,Object.assign(Object.assign({},t),{timeZone:"UTC",calendar:"gregory"}))}function U(e,t,i){return S(t,i).format(e)}const F=2e3,N=/^--(\d{2})-(\d{2})$/;function O(e){return new Date(Date.UTC(F,e.getUTCMonth(),e.getUTCDate()))}function q(e){const t=(null!=e?e:"").trim(),i=N.exec(t);if(i)return $(`2000-${i[1]}-${i[2]}`);const s=$(t);return s&&O(s)}function I(e){return"-"+A(e).slice(4)}class R{constructor(e){this.datepicker=e,this.copiedProperties=[],this.host=document.createElement("div"),this.host.className=R.className,this.host.pdsDatepicker=e,this.host.style.display="contents",this.root=this.host.attachShadow({mode:"open"})}mount(e,t){this.host.isConnected?t!==this.locale&&this.copyContext(t):(w(this.datepicker).appendChild(this.host),this.copyContext(t)),e.parentNode!==this.root&&this.root.appendChild(e)}remove(){this.host.remove()}contains(e){return!!e&&(e===this.host||this.root.contains(e))}copyContext(e){var t,i;this.locale=e;const s=this.datepicker.shadowRoot;s&&((null===(t=s.adoptedStyleSheets)||void 0===t?void 0:t.length)?this.root.adoptedStyleSheets=s.adoptedStyleSheets:this.root.querySelector("style")||s.querySelectorAll("style").forEach((e=>this.root.appendChild(e.cloneNode(!0)))));const r=getComputedStyle(this.datepicker);this.host.dir=r.direction||"ltr",this.host.lang=e,this.copyCustomProperties(r);const n=null===(i=x("[data-theme]",this.datepicker)||null)||void 0===i?void 0:i.getAttribute("data-theme");n?this.host.setAttribute("data-theme",n):this.host.removeAttribute("data-theme")}copyCustomProperties(e){for(const e of this.copiedProperties)this.host.style.removeProperty(e);this.copiedProperties=[];const t=this.host.parentElement,i=t?getComputedStyle(t):null;for(let t=0;t<e.length;t++){const s=e[t];if(!s.startsWith("--"))continue;const r=e.getPropertyValue(s);i&&r===i.getPropertyValue(s)||(this.host.style.setProperty(s,r.trim()),this.copiedProperties.push(s))}}}R.className="pds-datepicker-calendar-portal";const W={today:"Today",yesterday:"Yesterday","last-7-days":"Last 7 days","last-30-days":"Last 30 days","last-90-days":"Last 90 days","this-month":"This month","last-month":"Last month","this-quarter":"This quarter","last-quarter":"Last quarter","this-year":"This year","last-year":"Last year","year-to-date":"Year to date","last-12-months":"Last 12 months"},V=(e,t,i)=>new Date(Date.UTC(e,t,i));function K(e,t){const i=t.getUTCFullYear(),s=t.getUTCMonth(),r=s-s%3;switch(e){case"today":return[t,t];case"yesterday":return[j(t,-1),j(t,-1)];case"last-7-days":return[j(t,-6),t];case"last-30-days":return[j(t,-29),t];case"last-90-days":return[j(t,-89),t];case"this-month":return[V(i,s,1),V(i,s+1,0)];case"last-month":return[V(i,s-1,1),V(i,s,0)];case"this-quarter":return[V(i,r,1),V(i,r+3,0)];case"last-quarter":return[V(i,r-3,1),V(i,r,0)];case"this-year":return[V(i,0,1),V(i,11,31)];case"last-year":return[V(i-1,0,1),V(i-1,11,31)];case"year-to-date":return[V(i,0,1),t];case"last-12-months":return[L(t,-12),t];default:return null}}function Z(e,t,i){if(t&&i)return e.find((e=>e.start.getTime()===t.getTime()&&e.end.getTime()===i.getTime()))}function X(e,t,i){return!z(e.start,t,i)&&!z(e.end,t,i)}const B=/^(\d{4}-\d{2}-\d{2})(?:[T ](\d{2}):(\d{2}))?$/;function G(e){const t=B.exec((null!=e?e:"").trim());if(!t)return null;const i=$(t[1]);return i?void 0===t[2]?{date:i,time:null}:Number(t[2])<24&&Number(t[3])<60?{date:i,time:`${t[2]}:${t[3]}`}:null:null}const J="YYYY-MM-DD",Q=/\[([^\]]*)\]|YYYY|MMMM|MMM|MM|M|DD|D|HH|H|hh|h|mm|A|a/g,ee=/HH|H|hh|h/,te=/hh|h/,ie=/A|a/,se=e=>e.replace(/\[[^\]]*\]/g,"");function re(e,t,i=!1){const s=(null==e?void 0:e.trim())||J,r=se(s);return te.test(r)&&!ie.test(r)?s+" A":!t||ee.test(r)?s:`${s} ${i?"h:mm A":"HH:mm"}`}const ne=(e,t=2)=>(e+"").padStart(t,"0"),ae=new Map;function oe(e){let t=ae.get(e);if(!t){const i=(t,i)=>{const s=new Intl.DateTimeFormat(e,Object.assign(Object.assign({month:t},i?{day:"numeric"}:{}),{timeZone:"UTC",calendar:"gregory"}));return Array.from({length:12},((e,t)=>{const r=new Date(Date.UTC(2023,t,1));if(!i)return s.format(r);const n=s.formatToParts(r),a=n.findIndex((e=>"month"===e.type));if(-1===a)return s.format(r);const o=n[a+1];return"literal"!==(null==o?void 0:o.type)||/\s/.test(o.value)?n[a].value:n[a].value+o.value}))},s=De(e);t={months:i("long",!1),shortMonths:i("short",!1),monthsWithDay:i("long",!0),shortMonthsWithDay:i("short",!0),am:s.am,pm:s.pm},ae.set(e,t)}return t}const de=e=>/D/.test(e);function le(e,t,i="en-US"){var s;const r=oe(i),n=de(se(t)),[a,o]=xe(null!==(s=e.time)&&void 0!==s?s:"00:00"),d=a%12||12,l=e.date.getUTCMonth(),h=a<12?r.am:r.pm,c={YYYY:ne(e.date.getUTCFullYear(),4),MMMM:n?r.monthsWithDay[l]:r.months[l],MMM:n?r.shortMonthsWithDay[l]:r.shortMonths[l],MM:ne(l+1),M:l+1+"",DD:ne(e.date.getUTCDate()),D:e.date.getUTCDate()+"",HH:ne(a),H:a+"",hh:ne(d),h:d+"",mm:ne(o),A:h,a:h.toLowerCase()};return t.replace(Q,((e,t)=>null!=t?t:c[e]))}const he=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),ce=e=>he(e).replace(/\s+/g,"\\s*"),pe=e=>`(${e.map(he).join("|")})`;function ue(e,t,i="en-US",s){var r,n,a,o,d,l,h,c,p,u;const v=oe(i),m=oe("en-US"),b=de(se(t)),f=b?v.monthsWithDay:v.months,g=b?v.shortMonthsWithDay:v.shortMonths,k=b?m.monthsWithDay:m.months,_=b?m.shortMonthsWithDay:m.shortMonths,y=[v.am,v.pm,m.am,m.pm],x={YYYY:"(\\d{4})",MMMM:pe([...f,...k]),MMM:pe([...g,..._]),MM:"(\\d{1,2})",M:"(\\d{1,2})",DD:"(\\d{1,2})",D:"(\\d{1,2})",HH:"(\\d{1,2})",H:"(\\d{1,2})",hh:"(\\d{1,2})",h:"(\\d{1,2})",mm:"(\\d{2})",A:pe(y),a:pe(y)},w=[],D=()=>{w.length=0;let e="",i=0;return t.replace(Q,((s,r,n)=>(e+=ce(t.slice(i,n)),void 0!==r?e+=ce(r):(e+=x[s],w.push(s)),i=n+s.length,s))),RegExp(`^\\s*${e}${ce(t.slice(i))}\\s*$`,"i")};let M=D().exec(null!=e?e:"");if(M||(x.mm="(\\d{1,2})",M=D().exec(null!=e?e:"")),!M)return null;const C=M,A={};w.forEach(((e,t)=>A[e]=C[t+1]));const T=(e,t)=>{if(void 0===e)return;const i=t?[f,k]:[g,_];for(const t of i){const i=t.findIndex((t=>t.toLowerCase()===e.toLowerCase()));if(i>=0)return i+1}},j=A.YYYY?Number(A.YYYY):s,L=null!==(n=null!==(r=T(A.MMMM,!0))&&void 0!==r?r:T(A.MMM,!1))&&void 0!==n?n:Number(null!==(a=A.MM)&&void 0!==a?a:A.M),P=Number(null!==(o=A.DD)&&void 0!==o?o:A.D);if(void 0===j||!L||!P)return null;const Y=$(`${ne(j,4)}-${ne(L)}-${ne(P)}`);if(!Y)return null;const H=null!==(h=null!==(l=null!==(d=A.HH)&&void 0!==d?d:A.H)&&void 0!==l?l:A.hh)&&void 0!==h?h:A.h;if(void 0===H)return{date:Y,time:null};let z=Number(H);const E=Number(null!==(c=A.mm)&&void 0!==c?c:0),S=null===(u=null!==(p=A.A)&&void 0!==p?p:A.a)||void 0===u?void 0:u.toLowerCase();if(void 0!==A.hh||void 0!==A.h){if(z<1||z>12)return null;z=z%12+(S===v.pm.toLowerCase()||S===m.pm.toLowerCase()?12:0)}return z<24&&E<60?{date:Y,time:we(z,E)}:null}function ve(e,t=J,i="en-US"){var s;return null!==(s=ue(e,t,i))&&void 0!==s?s:G(e)}function me(e="en-US",t="long"){return S(e,{month:t,day:"numeric"}).formatToParts(new Date(Date.UTC(F,11,31))).map((e=>"month"===e.type?/^\d+$/.test(e.value)?"M":"MMMM":"day"===e.type?"D":/[A-Za-z]/.test(e.value)?`[${e.value}]`:e.value)).join("")}function be(e,t,i="en-US"){const s=[t,me(i),me(i,"numeric"),"MMMM D","D MMMM","MMM D","D MMM"];for(const t of s){const s=ue(e,t,i,F);if(s)return{date:O(s.date),time:null}}const r=q(e);return r?{date:r,time:null}:null}function fe(e,t=J,i="en-US"){const s=(null!=e?e:"").trim(),r=RegExp(`${he(ye)}|\\s+(?:–|—|-|to)\\s+${t.includes("/")?"":"|\\s*/\\s*"}`,"gi");let n;for(;null!==(n=r.exec(s));){const e=ve(s.slice(0,n.index),t,i),r=ve(s.slice(n.index+n[0].length),t,i);if(e&&r)return ge(e,r)<=0?[e,r]:null}return null}function ge(e,t){var i,s;const r=e.date.getTime()-t.date.getTime();return 0!==r?r:(null!==(i=e.time)&&void 0!==i?i:"00:00").localeCompare(null!==(s=t.time)&&void 0!==s?s:"00:00")}function ke(e){return e.time?`${A(e.date)}T${e.time}`:A(e.date)}function _e(e,t,i="en-US"){return le(e,null!=t?t:re(J,!!e.time),i)}const ye=" – ";function xe(e){const[t,i]=e.split(":").map(Number);return[t||0,i||0]}function we(e,t){return`${(e+"").padStart(2,"0")}:${(t+"").padStart(2,"0")}`}function De(e){var t,i;const s=new Intl.DateTimeFormat(e,{hour:"numeric",timeZone:"UTC"}),r=e=>{var t;return null===(t=s.formatToParts(new Date(Date.UTC(2023,0,1,e))).find((e=>"dayPeriod"===e.type)))||void 0===t?void 0:t.value};return{hour12:!!s.resolvedOptions().hour12,am:null!==(t=r(1))&&void 0!==t?t:"AM",pm:null!==(i=r(13))&&void 0!==i?i:"PM"}}const Me={weekday:"long",year:"numeric",month:"long",day:"numeric"},Ce={month:"long",day:"numeric"},$e="00:00",Ae="23:59";let Te=0;const je=e=>new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),1)),Le=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.pdsDatepickerChange=i(this,"pdsDatepickerChange",7),this.pdsBlur=i(this,"pdsBlur",7),this.pdsFocus=i(this,"pdsFocus",7),this.focusActiveDay=!1,this.fallbackId="pds-datepicker-"+ ++Te,this.skipForwardedClick=!1,this.presetByArrow=!1,this.valueAtOpen="",this.committing=!1,this.hasFocus=!1,this.applyLabel="Apply",this.autoApply=!1,this.cancelLabel="Cancel",this.clearable=!1,this.clearLabel="Clear",this.customRangeLabel="Custom range",this.endTimeLabel="End time",this.format="YYYY-MM-DD",this.hourLabel="Hour",this.invalidDateMessage="Enter a date in the format shown.",this.maxDateMessage="Choose {date} or earlier.",this.minDateMessage="Choose {date} or later.",this.minuteIncrement=1,this.minuteLabel="Minute",this.monthLabel="Month",this.monthDay=!1,this.nextMonthLabel="Next month",this.periodLabel="AM or PM",this.placement="bottom-start",this.presetsLabel="Presets",this.previousMonthLabel="Previous month",this.range=!1,this.showDropdowns=!1,this.startTimeLabel="Start time",this.timePicker=!1,this.timeLabel="Time",this.triggerLabel="Choose date",this.value="",this.yearLabel="Year",this.isOpen=!1,this.text="",this.textError="",this.activeDate="",this.viewMonth="",this.draftStart="",this.draftEnd="",this.startTime=$e,this.endTime=Ae,this.previewDate="",this.onApply=()=>{const e=this.draftParts();e&&(this.commitParts(e),this.closeCalendar(!0))},this.onCancel=()=>{this.clearable?this.commitValue(""):this.restoreValueAtOpen(),this.closeCalendar(!0)},this.onPresetClick=(e,t)=>{this.draftStart=A(t.start),this.draftEnd=A(t.end),this.previewDate="",!this.appliesOnPick||this.presetByArrow?(this.showDate(t.end,!0),e.currentTarget.focus()):this.onApply()},this.onPresetsKeyDown=e=>{const t={ArrowDown:1,ArrowRight:1,ArrowUp:-1,ArrowLeft:-1}[e.key],i={Home:"first",End:"last"}[e.key];if(!t&&!i)return;const s=Array.from(e.currentTarget.querySelectorAll('[role="radio"]:not([disabled])')),r=s.indexOf(e.target),n="first"===i?s[0]:"last"===i?s[s.length-1]:s[(r+t+s.length)%s.length];n&&(e.preventDefault(),n.focus(),n.classList.contains("pds-datepicker__preset")&&n!==s[s.length-1]&&(this.presetByArrow=!0,n.click(),this.presetByArrow=!1))},this.onClearMouseDown=e=>{e.preventDefault()},this.onClearClick=()=>{var e;this.commitValue(""),this.closeCalendar(!1),null===(e=this.inputEl)||void 0===e||e.setFocus()},this.onCustomRangeClick=()=>{var e,t;null===(t=null===(e=this.dialogEl)||void 0===e?void 0:e.querySelector('[data-date][tabindex="0"]'))||void 0===t||t.focus()},this.onDocumentPointerDown=e=>{var t;const i=e.composedPath();i.includes(this.el)||this.portal&&i.includes(this.portal.host)||(this.closeCalendar(!1),"dialog"===(null===(t=i[0])||void 0===t?void 0:t.localName)&&function(){const e=e=>{e.stopPropagation(),e.preventDefault()};document.addEventListener("click",e,{capture:!0,once:!0}),window.setTimeout((()=>document.removeEventListener("click",e,{capture:!0})),500)}())},this.onHostFocusIn=e=>{this.focusEntered(e)},this.onCalendarFocusIn=e=>{var t,i;this.focusEntered(e),null===(t=this.dialogEl)||void 0===t||t.setAttribute("aria-modal","true"),e.target===this.dialogEl&&(null===(i=this.dialogEl.querySelector(`[data-date="${this.activeDate}"]`))||void 0===i||i.focus({preventScroll:!0}))},this.onCalendarFocusOut=e=>{var t,i;const s=e.relatedTarget;s&&(null===(t=this.dialogEl)||void 0===t?void 0:t.contains(s))||null===(i=this.dialogEl)||void 0===i||i.removeAttribute("aria-modal"),this.checkFocusLeft(e,null!==s)},this.onHostFocusOut=e=>{const t=e.relatedTarget;t&&this.isInside(t)||this.checkFocusLeft(e,null!==t)},this.stopInnerEvent=e=>e.stopPropagation(),this.onFieldClick=e=>{var t,i;const s=e.composedPath();if(this.triggerEl&&s.includes(this.triggerEl)||this.clearEl&&s.includes(this.clearEl))return;const r=null===(i=null===(t=this.inputEl)||void 0===t?void 0:t.shadowRoot)||void 0===i?void 0:i.querySelector("label");if(r&&s.includes(r))return this.skipForwardedClick=!0,void window.setTimeout((()=>this.skipForwardedClick=!1));if(this.skipForwardedClick)return void(this.skipForwardedClick=!1);const n=this.fieldReference();n&&n!==this.inputEl&&!s.includes(n)||this.openCalendar(!1)},this.onTextInput=e=>{var t,i;if(e.stopPropagation(),this.text=(null!==(t=e.detail.value)&&void 0!==t?t:"")+"",!this.isOpen)return;const s=this.parseText(this.text);if(!s)return;const[r,n]=[this.startTime,this.endTime];if(null!==(i=this.timesBeforeTyping)&&void 0!==i||(this.timesBeforeTyping=[r,n]),this.loadDraft(s),this.hasTime){const e=this.resolvedFormat,t=this.resolvedLocale,i=this.isRange?fe(this.text,e,t):[ve(this.text,e,t)],s=this.parsedValue(),a=e=>{var t,r,n;return!(null===(t=null==i?void 0:i[e])||void 0===t?void 0:t.time)||(null===(r=i[e])||void 0===r?void 0:r.time)===(null===(n=null==s?void 0:s[e])||void 0===n?void 0:n.time)};a(0)&&(this.startTime=r),this.isRange&&a(1)&&(this.endTime=n)}this.showDate(s[s.length-1].date)},this.onTextChange=e=>{e.stopPropagation(),this.isOpen&&this.hasFooter?window.setTimeout((()=>{var e;this.isOpen&&(this.el.matches(":focus-within")||(null===(e=this.portal)||void 0===e?void 0:e.host.matches(":focus-within")))||this.commitPendingText()})):this.commitText()},this.onTextKeyDown=e=>{e.stopPropagation();const t=e.detail;if(t.altKey&&"ArrowDown"===t.key)t.preventDefault(),this.isOpen?(this.focusActiveDay=!0,this.flushActiveDayFocus()):this.openCalendar(!0);else if("Enter"===t.key&&this.isOpen){if(!this.hasFooter||this.text!==this.fieldText()&&!this.parseText(this.text))this.commitText();else{const e=this.draftParts();e&&this.commitParts(e)}this.textError||this.closeCalendar(!1)}else"Escape"===t.key&&this.isOpen&&(t.preventDefault(),t.stopPropagation(),this.restoreValueAtOpen(),this.closeCalendar(!1))},this.onTriggerKeyDown=e=>{var t;if(this.isOpen)return"Escape"===e.key?(e.preventDefault(),e.stopPropagation(),this.restoreValueAtOpen(),void this.closeCalendar(!1)):void("Tab"!==e.key||e.shiftKey||"visible"!==(null===(t=this.dialogEl)||void 0===t?void 0:t.style.visibility)||(e.preventDefault(),this.focusActiveDay=!0,this.flushActiveDayFocus()))},this.onTriggerClick=()=>{this.isOpen?this.closeCalendar(!0):this.openCalendar(!0)},this.onDialogKeyDown=e=>{"Escape"===e.key?(e.preventDefault(),e.stopPropagation(),this.restoreValueAtOpen(),this.closeCalendar(!0)):"Tab"===e.key&&this.trapTab(e)},this.onGridKeyDown=e=>{const t=$(this.activeDate);if(!t)return;const i="rtl"===getComputedStyle(this.el).direction,s=this.monthDay?(t.getUTCDate()-1)%7:E(t,this.weekStart);let r=null;switch(e.key){case"ArrowLeft":r=j(t,i?1:-1);break;case"ArrowRight":r=j(t,i?-1:1);break;case"ArrowUp":r=j(t,-7);break;case"ArrowDown":r=j(t,7);break;case"Home":r=j(t,-s);break;case"End":{const e=this.monthDay?Math.min(6,P(t.getUTCFullYear(),t.getUTCMonth())-t.getUTCDate()+s):6;r=j(t,e-s);break}case"PageUp":r=e.shiftKey&&this.monthDay?t:L(t,e.shiftKey?-12:-1);break;case"PageDown":r=e.shiftKey&&this.monthDay?t:L(t,e.shiftKey?12:1);break;case"Enter":case" ":return e.preventDefault(),this.pickDate(t),void(this.hasFooter&&(this.focusActiveDay=!0));default:return}e.preventDefault();const n=H(this.inView(r),this.minDate,this.maxDate);this.showDate(n),this.isRange&&(this.previewDate=A(n)),this.focusActiveDay=!0},this.onGridClick=e=>{const t=this.dayFromEvent(e);t&&this.pickDate(t)},this.onGridPointerOver=e=>{if(!this.isRange||!this.draftStart||this.draftEnd)return;const t=this.dayFromEvent(e),i=t&&A(t);i&&i!==this.previewDate&&(this.previewDate=i)}}async open(){this.openCalendar(!0)}async close(){this.closeCalendar(!1)}async setFocus(){var e;await(null===(e=this.inputEl)||void 0===e?void 0:e.setFocus())}valueChanged(){var e;this.committing||(this.valueAtOpen=null!==(e=this.value)&&void 0!==e?e:""),this.refreshFromValue()}contextChanged(){this.refreshFromValue()}placementChanged(){this.stopPositioning()}refreshFromValue(){var e;this.text=this.fieldText(),this.textError="";const t=this.parsedValue();if(this.monthDay&&t){const e=this.dayValue(t[0].date);this.value!==e&&(this.value=e)}if(this.updateFormValue(),!this.isOpen)return;this.loadDraft(t);const i=null!==(e=t&&t[t.length-1].date)&&void 0!==e?e:this.now;this.showDate(H(i,this.minDate,this.maxDate),!0)}requiredChanged(){this.updateFormValue()}componentWillLoad(){this.refreshFromValue()}connectedCallback(){this.el.attachInternals&&!this.internals&&(this.internals=this.el.attachInternals())}componentDidLoad(){this.updateFormValue()}disconnectedCallback(){var e;this.closeCalendar(!1),null===(e=this.portal)||void 0===e||e.remove()}componentDidRender(){var e,t;this.isOpen&&this.dialogEl?(null!==(t=this.portal)&&void 0!==t||(this.portal=new R(this.el)),this.portal.mount(this.dialogEl,this.resolvedLocale),this.cleanupAutoUpdate||this.startPositioning(),this.flushActiveDayFocus()):null===(e=this.portal)||void 0===e||e.remove()}flushActiveDayFocus(){var e,t;this.focusActiveDay&&"visible"===(null===(e=this.dialogEl)||void 0===e?void 0:e.style.visibility)&&(this.focusActiveDay=!1,null===(t=this.dialogEl.querySelector(`[data-date="${this.activeDate}"]`))||void 0===t||t.focus())}get baseId(){return this.componentId||this.fallbackId}get resolvedLocale(){return function(e){var t;try{return null!==(t=Intl.DateTimeFormat.supportedLocalesOf(e)[0])&&void 0!==t?t:"en-US"}catch(e){return"en-US"}}(this.locale||_(this.el))}get weekStart(){const e=this.firstDayOfWeek;return"number"==typeof e&&Number.isInteger(e)&&e>=0&&e<=6?e:function(e){var t,i,s;const r=Intl.Locale;if(!r)return 0;try{const n=new r(e),a=null!==(i=null===(t=n.getWeekInfo)||void 0===t?void 0:t.call(n).firstDay)&&void 0!==i?i:null===(s=n.weekInfo)||void 0===s?void 0:s.firstDay;return"number"==typeof a?a%7:0}catch(e){return 0}}(this.resolvedLocale)}get minDate(){return this.monthDay?null:$(this.min)}get maxDate(){return this.monthDay?null:$(this.max)}get isRange(){return this.range&&!this.monthDay}get hasTime(){return this.timePicker&&!this.monthDay}get now(){return this.monthDay?O(T()):T()}inView(e){return this.monthDay?O(e):e}dayValue(e){return this.monthDay?I(e):A(e)}get isInteractive(){return!this.disabled&&!this.readonly}get monthCount(){const e="undefined"!=typeof window&&window.innerWidth<640;return this.isRange&&!e?2:1}get appliesOnPick(){return this.isRange&&this.autoApply&&!this.hasTime}get hasFooter(){return(this.isRange||this.hasTime)&&!this.appliesOnPick}get resolvedPresets(){return this.isRange?function(e,t){const i="string"==typeof e?e.split(",").map((e=>e.trim())).filter(Boolean).map((e=>({key:e}))):Array.isArray(e)?e:[],s=[];for(const e of i){if(!e||"string"!=typeof e.key)continue;const i="string"==typeof e.start?$(e.start):null,r="string"==typeof e.end?$(e.end):null,n=i&&r&&i<=r?[i,r]:K(e.key,t),a="string"==typeof e.label?e.label:W[e.key];n&&a&&s.push({key:e.key,label:a,start:n[0],end:n[1]})}return s}(this.presets,T()):[]}parsedValue(e=this.value){if(this.isRange){const[t,i,s]=(null!=e?e:"").split("/"),r=G(t),n=G(i);return void 0===s&&r&&n&&ge(r,n)<=0?[r,n]:null}if(this.monthDay){const t=q(e);return t?[{date:t,time:null}]:null}const t=G(e);return t?[t]:null}get resolvedFormat(){var e,t;if(this.monthDay){const i=null!==(t=null===(e=this.format)||void 0===e?void 0:e.trim())&&void 0!==t?t:"";return""===i||/YYYY/.test(i.replace(/\[[^\]]*\]/g,""))?me(this.resolvedLocale):i}return re(this.format,this.hasTime,this.hasTime&&De(this.resolvedLocale).hour12)}fieldText(){var e;const t=this.parsedValue();return t?t.map((e=>_e(this.withTimePicker(e),this.resolvedFormat,this.resolvedLocale))).join(ye):null!==(e=this.value)&&void 0!==e?e:""}withTimePicker(e,t=$e){var i;return{date:e.date,time:this.hasTime?null!==(i=e.time)&&void 0!==i?i:t:null}}get fieldPlaceholder(){if(this.placeholder)return this.placeholder;if(this.monthDay)return le({date:q("--12-31"),time:null},this.resolvedFormat,this.resolvedLocale);const e=this.resolvedFormat;return this.isRange?`${e}${ye}${e}`:e}loadDraft(e){var t,i;const[s,r]=null!=e?e:[];this.draftStart=s?A(s.date):"",this.draftEnd=this.isRange&&r?A(r.date):"",this.startTime=null!==(t=null==s?void 0:s.time)&&void 0!==t?t:$e,this.endTime=null!==(i=null==r?void 0:r.time)&&void 0!==i?i:Ae,this.previewDate=""}openCalendar(e){var t,i;if(!this.isInteractive||this.isOpen)return;const s=this.parsedValue();this.loadDraft(s),this.valueAtOpen=null!==(t=this.value)&&void 0!==t?t:"";const r=null!==(i=s&&s[s.length-1].date)&&void 0!==i?i:this.now;this.showDate(H(r,this.minDate,this.maxDate),!0),this.focusActiveDay=e,this.isOpen=!0,document.addEventListener("pointerdown",this.onDocumentPointerDown,!0)}closeCalendar(e){var t;this.isOpen&&(this.commitPendingText(),this.timesBeforeTyping=void 0,this.isOpen=!1,this.stopPositioning(),document.removeEventListener("pointerdown",this.onDocumentPointerDown,!0),e&&(null===(t=this.triggerEl)||void 0===t||t.focus()))}showDate(e,t=!1){const i=this.inView(e),s=je(i),r=$(this.viewMonth),n=r&&L(r,this.monthCount-1);t||!r||s<r?this.viewMonth=A(t?L(s,1-this.monthCount):s):n&&s>n&&(this.viewMonth=A(L(s,1-this.monthCount))),this.activeDate=A(i)}pickDate(e){z(e,this.minDate,this.maxDate)||(this.dropTypedText(),this.isRange?this.pickRangeDay(e):this.hasTime?(this.draftStart=A(e),this.activeDate=this.draftStart):(this.commitValue(this.dayValue(e)),this.closeCalendar(!0)))}pickRangeDay(e){const t=$(this.draftStart),i=A(e);!t||this.draftEnd?(this.draftStart=i,this.draftEnd=""):e<t?this.draftStart=i:this.draftEnd=i,this.previewDate="",this.activeDate=i,this.draftEnd&&this.appliesOnPick&&this.onApply()}commitValue(e,t={}){var i;const s=e!==(null!==(i=this.value)&&void 0!==i?i:"");this.timesBeforeTyping=void 0,this.committing=!0,this.value=e,this.committing=!1,this.text=this.fieldText(),this.textError="",this.updateFormValue(),s&&this.pdsDatepickerChange.emit(Object.assign({value:e},t))}commitParts(e){if(this.monthDay)return void this.commitValue(I(e[0].date));if(!this.isRange)return void this.commitValue(ke(e[0]));const[t,i]=e,s=Z(this.resolvedPresets,t.date,i.date);this.commitValue(`${ke(t)}/${ke(i)}`,Object.assign({start:ke(t),end:ke(i)},s?{preset:s.key}:{}))}draftParts(){var e;const t=$(this.draftStart);if(!t)return null;const i=this.withTimePicker({date:t,time:this.startTime});if(!this.isRange)return[i];const s=this.withTimePicker({date:null!==(e=$(this.draftEnd))&&void 0!==e?e:t,time:this.endTime});return[i,ge(s,i)<0?Object.assign(Object.assign({},s),{time:i.time}):s]}restoreValueAtOpen(){var e;if(this.valueAtOpen===(null!==(e=this.value)&&void 0!==e?e:""))return void this.dropTypedText();const t=this.parsedValue(this.valueAtOpen);t?this.commitParts(t):this.commitValue(this.valueAtOpen)}isInside(e){var t,i;return!!e&&(e===this.el||this.el.contains(e)||!!(null===(t=this.el.shadowRoot)||void 0===t?void 0:t.contains(e))||!!(null===(i=this.portal)||void 0===i?void 0:i.contains(e)))}focusEntered(e){this.hasFocus||(this.hasFocus=!0,this.pdsFocus.emit(e))}checkFocusLeft(e,t){window.setTimeout((()=>{var i;this.el.matches(":focus-within")||(null===(i=this.portal)||void 0===i?void 0:i.host.matches(":focus-within"))||(t&&this.closeCalendar(!1),this.hasFocus&&(this.hasFocus=!1,this.pdsBlur.emit(e)))}))}startPositioning(){const e=this.fieldReference(),t=this.dialogEl;e&&t&&(this.cleanupAutoUpdate=a(e,t,(()=>{o(e,t,{placement:this.placement,strategy:"fixed",middleware:[d(4),l({padding:8}),h({padding:8,apply({availableWidth:e,availableHeight:t,elements:i}){const s=window.innerHeight-16;Object.assign(i.floating.style,{maxHeight:Math.max(0,Math.max(t,Math.min(s,480)))+"px",maxWidth:Math.max(0,e)+"px"})}}),c({padding:8,crossAxis:!0}),p()]}).then((({x:e,y:i,middlewareData:s})=>{var r;const n=!!(null===(r=s.hide)||void 0===r?void 0:r.referenceHidden);Object.assign(t.style,{left:e+"px",top:i+"px",visibility:n?"hidden":"visible"}),this.flushActiveDayFocus()}))})))}stopPositioning(){var e;null===(e=this.cleanupAutoUpdate)||void 0===e||e.call(this),this.cleanupAutoUpdate=void 0}fieldReference(){var e,t,i;return null!==(i=null===(t=null===(e=this.inputEl)||void 0===e?void 0:e.shadowRoot)||void 0===t?void 0:t.querySelector(".pds-input__field-wrapper"))&&void 0!==i?i:this.inputEl}commitPendingText(){if(this.text===this.fieldText())return;const e=this.parseText(this.text)?this.draftParts():null;e?this.commitParts(e):this.commitText()}readText(e){const t=this.resolvedFormat,i=this.resolvedLocale,s=this.monthDay?[be(e,t,i)]:this.isRange?fe(e,t,i):[ve(e,t,i)];return!s||s.some((e=>!e))?null:s.map(((e,t)=>this.withTimePicker(e,1===t?Ae:$e)))}parseText(e){const t=this.readText(e);return t&&!this.rangeError(t)?t:null}rangeError(e){return this.minDate&&e.some((e=>e.date<this.minDate))?"min":this.maxDate&&e.some((e=>e.date>this.maxDate))?"max":""}valueError(){if(!this.value)return"";const e=this.parsedValue();return e?this.rangeError(e):"format"}commitText(){const e=this.text.trim();if(""===e)return void this.commitValue("");const t=this.readText(e),i=t?this.rangeError(t):"format";t&&!i?this.commitParts(t):(this.textError=i,this.updateFormValue())}canShowMonth(e){var t;const i=null!==(t=$(this.viewMonth))&&void 0!==t?t:this.now;return e<0?!this.minDate||j(i,-1)>=this.minDate:!this.maxDate||L(i,this.monthCount)<=this.maxDate}showMonth(e,t){var i,s;const r=null!==(i=$(this.viewMonth))&&void 0!==i?i:this.now,n=null!==(s=$(this.activeDate))&&void 0!==s?s:this.now;this.viewMonth=A(this.inView(L(r,t))),this.activeDate=A(H(this.inView(L(n,t)),this.minDate,this.maxDate)),this.canShowMonth(t)?e.currentTarget.focus():this.focusActiveDay=!0}jumpTo(e,t,i){var s;const r=H(new Date(Date.UTC(t,i,1)),this.minDate,this.maxDate);this.viewMonth=A(L(je(r),-e));const n=null!==(s=$(this.activeDate))&&void 0!==s?s:r,a=Math.min(n.getUTCDate(),new Date(Date.UTC(t,i+1,0)).getUTCDate());this.activeDate=A(H(new Date(Date.UTC(t,i,a)),this.minDate,this.maxDate))}dropTypedText(){this.timesBeforeTyping&&([this.startTime,this.endTime]=this.timesBeforeTyping),this.timesBeforeTyping=void 0,(this.text!==this.fieldText()||this.textError)&&(this.text=this.fieldText(),this.inputEl&&(this.inputEl.value=this.text),this.textError="",this.updateFormValue())}trapTab(e){var t,i,s,r;const n=Array.from(null!==(i=null===(t=this.dialogEl)||void 0===t?void 0:t.querySelectorAll('button:not([disabled]):not([tabindex="-1"]), select:not([disabled]), [data-date][tabindex="0"]'))&&void 0!==i?i:[]);if(0===n.length)return;const a=null===(r=null===(s=this.dialogEl)||void 0===s?void 0:s.getRootNode())||void 0===r?void 0:r.activeElement,o=n[0],d=n[n.length-1];e.shiftKey&&a===o?(e.preventDefault(),d.focus()):e.shiftKey||a!==d||(e.preventDefault(),o.focus())}dayFromEvent(e){var t,i;const s=null===(i=null===(t=e.target)||void 0===t?void 0:t.closest)||void 0===i?void 0:i.call(t,"[data-date]");return $(null==s?void 0:s.dataset.date)}updateFormValue(){var e,t,i,s;if(k()||!(null===(e=this.internals)||void 0===e?void 0:e.setFormValue))return;if(this.internals.setFormValue(this.value||null),!this.internals.setValidity)return;const r=null!==(s=null===(i=null===(t=this.inputEl)||void 0===t?void 0:t.shadowRoot)||void 0===i?void 0:i.querySelector("input"))&&void 0!==s?s:void 0,n=this.textError||this.valueError();"format"===n?this.internals.setValidity({badInput:!0},this.invalidDateMessage,r):"min"===n?this.internals.setValidity({rangeUnderflow:!0},this.boundMessage(this.minDateMessage,this.minDate),r):"max"===n?this.internals.setValidity({rangeOverflow:!0},this.boundMessage(this.maxDateMessage,this.maxDate),r):this.required&&!this.value?this.internals.setValidity({valueMissing:!0},(null==r?void 0:r.validationMessage)||this.invalidDateMessage,r):this.internals.setValidity({})}boundMessage(e,t){const i=t?_e({date:t,time:null},this.format||void 0,this.resolvedLocale):"";return y(e,{date:i})}formResetCallback(){this.value="",this.text="",this.textError="",this.closeCalendar(!1),this.updateFormValue()}interactivityChanged(){this.isInteractive||this.closeCalendar(!1)}formDisabledCallback(e){this.disabled=e,e&&this.closeCalendar(!1)}formStateRestoreCallback(e){"string"==typeof e&&(this.value=e)}triggerAccessibleName(e){const t=this.parsedValue();if(!t)return this.triggerLabel;const i=t.map((t=>U(t.date,e,this.monthDay?Ce:Me)));return`${this.triggerLabel}, ${i.join(ye)}`}highlightedRange(){const e=$(this.draftStart),t=$(this.draftEnd);if(!e||t)return[e,t];const i=$(this.previewDate);return[e,i&&i>e?i:null]}selectedDay(){return this.isRange?null:$(this.draftStart)}renderMonthHeading(e,t,i,r){const n=U(e,i,this.monthDay?{month:"long"}:{month:"long",year:"numeric"}),a=0===t?"polite":null;if(!this.showDropdowns||this.monthDay)return s("div",{class:"pds-datepicker__heading",id:r,"aria-live":a},n);const o=e.getUTCFullYear(),d=e.getUTCMonth(),l=this.minDate,h=this.maxDate,c=T().getUTCFullYear(),p=l?l.getUTCFullYear():c-100,v=h?h.getUTCFullYear():c+100,m=S(i,{month:"long"}),b=S(i,{year:"numeric"});return s("div",{class:"pds-datepicker__dropdowns"},s("span",{class:"visually-hidden",id:r,"aria-live":a},n),s("span",{class:"pds-datepicker__select-wrap"},s("select",{class:"pds-datepicker__heading-select","aria-label":this.monthLabel,onChange:e=>this.jumpTo(t,o,Number(e.target.value))},Array.from({length:12},((e,t)=>{const i=!!l&&new Date(Date.UTC(o,t+1,0))<l||!!h&&new Date(Date.UTC(o,t,1))>h;return s("option",{value:t+"",selected:t===d,disabled:i},m.format(new Date(Date.UTC(o,t,1))))}))),s("pds-icon",{class:"pds-datepicker__select-caret",icon:u,size:"small","aria-hidden":"true"})),s("span",{class:"pds-datepicker__select-wrap"},s("select",{class:"pds-datepicker__heading-select","aria-label":this.yearLabel,onChange:e=>this.jumpTo(t,Number(e.target.value),d)},Array.from({length:Math.max(v,o)-Math.min(p,o)+1},((e,t)=>{const i=Math.min(p,o)+t;return s("option",{value:i+"",selected:i===o},b.format(new Date(Date.UTC(i,0,1))))}))),s("pds-icon",{class:"pds-datepicker__select-caret",icon:u,size:"small","aria-hidden":"true"})))}renderMonth(e,t,i){const r=e.getUTCFullYear(),n=e.getUTCMonth(),a=this.minDate,o=this.maxDate,d=this.selectedDay(),[l,h]=this.isRange?this.highlightedRange():[null,null],c=this.now,p=S(i,this.monthDay?Ce:Me),u=S(i,{day:"numeric"}),b=`${this.baseId}-calendar-heading-${t}`,f=t===this.monthCount-1;return s("div",{class:"pds-datepicker__month"},s("div",{class:"pds-datepicker__header"},0===t?s("button",{type:"button",class:"pds-datepicker__nav pds-datepicker__nav--previous","aria-label":this.previousMonthLabel,disabled:!this.canShowMonth(-1),onClick:e=>this.showMonth(e,-1)},s("pds-icon",{icon:v,"aria-hidden":"true"})):s("span",{class:"pds-datepicker__nav-spacer"}),this.renderMonthHeading(e,t,i,b),f?s("button",{type:"button",class:"pds-datepicker__nav pds-datepicker__nav--next","aria-label":this.nextMonthLabel,disabled:!this.canShowMonth(1),onClick:e=>this.showMonth(e,1)},s("pds-icon",{icon:m,"aria-hidden":"true"})):s("span",{class:"pds-datepicker__nav-spacer"})),s("table",{class:"pds-datepicker__grid",role:"grid","aria-labelledby":b,"aria-multiselectable":this.isRange?"true":null,onKeyDown:this.onGridKeyDown,onClick:this.onGridClick,onPointerOver:this.onGridPointerOver},!this.monthDay&&s("thead",null,s("tr",null,function(e,t){const i=S(e,{weekday:"short"}),s=S(e,{weekday:"long"}),r=Array.from({length:7},((e,i)=>new Date(Date.UTC(2023,0,1+(t+i)%7)))),n=r.map((e=>i.format(e).replace(/\.$/,""))),a=n.every((e=>/^[A-Za-z\u00C0-\u024F]+$/.test(e))),o=n.map((e=>e.slice(0,2))),d=a&&7===new Set(o.map((e=>e.toLowerCase()))).size;return r.map(((e,t)=>({short:d?o[t]:i.format(e),long:s.format(e)})))}(i,this.weekStart).map((e=>s("th",{scope:"col",class:"pds-datepicker__weekday"},s("span",{"aria-hidden":"true"},e.short),s("span",{class:"visually-hidden"},e.long)))))),s("tbody",null,(this.monthDay?function(e){const t=[];for(let i=1;i<=P(F,e);i++)t.push(new Date(Date.UTC(F,e,i)));for(;t.length%7!=0;)t.push(null);const i=[];for(let e=0;e<t.length;e+=7)i.push(t.slice(e,e+7));return i}(n):function(e,t,i){const s=new Date(Date.UTC(e,t,1)),r=Array(E(s,i)).fill(null);for(let i=1;i<=P(e,t);i++)r.push(new Date(Date.UTC(e,t,i)));for(;r.length%7!=0;)r.push(null);const n=[];for(let e=0;e<r.length;e+=7)n.push(r.slice(e,e+7));return n}(r,n,this.weekStart)).map((e=>s("tr",null,e.map(((e,t)=>{if(!e)return s("td",{class:"pds-datepicker__day pds-datepicker__day--empty"});const i=A(e),r=z(e,a,o),n=Y(e,l)||Y(e,h),v=!!l&&!!h&&!Y(l,h),m=!!l&&!!h&&e>=l&&e<=h,b=Y(e,d)||n||m,f=Y(e,c);return s("td",{class:{"pds-datepicker__day":!0,"pds-datepicker__day--selected":Y(e,d)||n,"pds-datepicker__day--in-range":m&&!n,"pds-datepicker__day--range-start":v&&Y(e,l),"pds-datepicker__day--range-end":v&&Y(e,h),"pds-datepicker__day--row-start":m&&0===t,"pds-datepicker__day--row-end":m&&6===t,"pds-datepicker__day--today":f,"pds-datepicker__day--disabled":r},"data-date":i,tabindex:i===this.activeDate?"0":"-1","aria-label":p.format(e),"aria-selected":b?"true":null,"aria-current":f?"date":null,"aria-disabled":r?"true":null},((e,t)=>{var i,s;return null!==(s=null===(i=e.formatToParts(t).find((e=>"day"===e.type)))||void 0===i?void 0:i.value)&&void 0!==s?s:e.format(t)})(u,e))}))))))),this.hasTime&&this.timesUnderMonth(t).map((e=>this.renderTime(e,i))))}timesUnderMonth(e){return this.isRange?1===this.monthCount?["start","end"]:[0===e?"start":"end"]:["start"]}renderTime(e,t){var i,r,n;const a="start"===e?this.startTime:null!==(n=null===(r=null===(i=this.draftParts())||void 0===i?void 0:i[1])||void 0===r?void 0:r.time)&&void 0!==n?n:this.endTime,[o,d]=xe(a),l=De(t),h=Math.max(1,Math.min(60,Math.floor(this.minuteIncrement)||1)),c=(t,i)=>{const s=we(t,i);"start"===e?this.startTime=s:this.endTime=s,this.timesBeforeTyping&&(this.timesBeforeTyping["start"===e?0:1]=s)},p=this.isRange?"start"===e?this.startTimeLabel:this.endTimeLabel:this.timeLabel,u=o>=12,v=l.hour12?Array.from({length:12},((e,t)=>t+1)):Array.from({length:24},((e,t)=>t)),m=l.hour12?o%12||12:o,b=Array.from({length:Math.ceil(60/h)},((e,t)=>t*h));b.includes(d)||b.push(d),b.sort(((e,t)=>e-t));const f=`${this.baseId}-time-${e}`;return s("div",{class:"pds-datepicker__time",role:"group","aria-labelledby":f},s("span",{class:"pds-datepicker__time-label",id:f},p),s("span",{class:"pds-datepicker__time-field"},s("select",{class:"pds-datepicker__time-select","aria-label":this.hourLabel,onChange:e=>{const t=Number(e.target.value);c(l.hour12?t%12+(u?12:0):t,d)}},v.map((e=>s("option",{value:e+"",selected:e===m},l.hour12?e+"":(e+"").padStart(2,"0"))))),s("span",{class:"pds-datepicker__time-separator","aria-hidden":"true"},":"),s("select",{class:"pds-datepicker__time-select","aria-label":this.minuteLabel,onChange:e=>c(o,Number(e.target.value))},b.map((e=>s("option",{value:e+"",selected:e===d},(e+"").padStart(2,"0"))))),l.hour12&&s("select",{class:"pds-datepicker__time-select pds-datepicker__time-select--period","aria-label":this.periodLabel,onChange:e=>{c(o%12+("pm"===e.target.value?12:0),d)}},s("option",{value:"am",selected:!u},l.am),s("option",{value:"pm",selected:u},l.pm))))}renderPresets(){var e;const t=this.resolvedPresets;if(0===t.length)return null;const i=Z(t,$(this.draftStart),$(this.draftEnd)),r=!i&&!!this.draftStart,n=e=>X(e,this.minDate,this.maxDate),a=i&&n(i)?i:r?"custom":null!==(e=t.find(n))&&void 0!==e?e:"custom";return s("div",{class:"pds-datepicker__presets-column"},s("ul",{class:"pds-datepicker__presets",part:"presets",role:"radiogroup","aria-label":this.presetsLabel,onKeyDown:this.onPresetsKeyDown},t.map((e=>{const t=e===i;return s("li",{role:"none"},s("button",{type:"button",role:"radio",class:{"pds-datepicker__preset":!0,"pds-datepicker__preset--selected":t},"aria-checked":t?"true":"false",tabindex:e===a?"0":"-1",disabled:!X(e,this.minDate,this.maxDate),onClick:t=>this.onPresetClick(t,e)},s("span",null,e.label),t&&s("pds-icon",{icon:b,"aria-hidden":"true"})))})),s("li",{role:"none"},s("button",{type:"button",role:"radio",class:{"pds-datepicker__preset":!0,"pds-datepicker__preset--selected":r},"aria-checked":r?"true":"false",tabindex:"custom"===a?"0":"-1",onClick:this.onCustomRangeClick},s("span",null,this.customRangeLabel),r&&s("pds-icon",{icon:b,"aria-hidden":"true"})))))}selectionText(){const e=this.draftParts();if(!e)return"";const t=this.resolvedFormat,i=this.resolvedLocale;return this.isRange&&!this.draftEnd?`${_e(e[0],t,i)}${ye}`:e.map((e=>_e(e,t,i))).join(ye)}renderFooter(){const e=this.draftParts(),t=this.selectionText();return s("div",{class:"pds-datepicker__footer"},s("span",{class:"pds-datepicker__selection","aria-live":"polite"},t),s("button",{type:"button",class:"pds-datepicker__action",onClick:this.onCancel},this.clearable?this.clearLabel:this.cancelLabel),s("button",{type:"button",class:"pds-datepicker__action pds-datepicker__action--primary",disabled:!e,onClick:this.onApply},this.applyLabel))}renderCalendar(e){var t;const i=null!==(t=$(this.viewMonth))&&void 0!==t?t:this.now,r=Array.from({length:this.monthCount},((e,t)=>L(i,t)));return s("div",{class:{"pds-datepicker__dialog":!0,"pds-datepicker__dialog--range":this.isRange},id:this.baseId+"-calendar",role:"dialog",tabindex:"-1","aria-labelledby":this.isRange?null:this.baseId+"-calendar-heading-0","aria-label":this.isRange?this.label||this.triggerLabel:null,part:"calendar",ref:e=>this.dialogEl=e,onKeyDown:this.onDialogKeyDown,onFocusin:this.onCalendarFocusIn,onFocusout:this.onCalendarFocusOut},this.isRange&&this.renderPresets(),s("div",{class:"pds-datepicker__panel"},s("div",{class:"pds-datepicker__months"},r.map(((t,i)=>this.renderMonth(t,i,e)))),this.hasFooter&&this.renderFooter(),this.appliesOnPick&&s("span",{class:"visually-hidden","aria-live":"polite"},this.selectionText())))}render(){const e=this.resolvedLocale;return s(r,{key:"7c5388369fe78becfd26b0807f1c6cb54c7934a1",class:{"pds-datepicker--range":this.isRange,"pds-datepicker--time":this.hasTime},"full-width":this.fullWidth?"true":null,onFocusin:this.onHostFocusIn,onFocusout:this.onHostFocusOut},s("pds-input",{key:"fc565c99359715415886ae63ef1bcbf8671569c9",ref:e=>this.inputEl=e,componentId:this.baseId,label:this.label,hideLabel:this.hideLabel,helperMessage:this.helperMessage,errorMessage:this.errorMessage,invalid:this.invalid||!!this.textError||!!this.valueError(),disabled:this.disabled,readonly:this.readonly,required:this.required,placeholder:this.fieldPlaceholder,fullWidth:this.fullWidth,autocomplete:"off",value:this.text,onClick:this.onFieldClick,onPdsInput:this.onTextInput,onPdsChange:this.onTextChange,onPdsKeyDown:this.onTextKeyDown,onPdsFocus:this.stopInnerEvent,onPdsBlur:this.stopInnerEvent},this.clearable&&!!this.value&&this.isInteractive&&s("button",{key:"clear",slot:"suffix",type:"button",class:"pds-datepicker__clear",ref:e=>this.clearEl=e,"aria-label":this.label?`${this.clearLabel} ${this.label}`:this.clearLabel,tabindex:"-1",onMouseDown:this.onClearMouseDown,onClick:this.onClearClick},s("pds-icon",{key:"6a7da726d86654d3598f84b8ea7a8ed244a8e5da",icon:f,"aria-hidden":"true"})),s("button",{key:"trigger",slot:"suffix",type:"button",class:"pds-datepicker__trigger",ref:e=>this.triggerEl=e,"aria-label":this.triggerAccessibleName(e),"aria-haspopup":"dialog","aria-expanded":this.isOpen?"true":"false",disabled:!this.isInteractive,onClick:this.onTriggerClick,onKeyDown:this.onTriggerKeyDown},s("pds-icon",{key:"92af87e66b7bb2e95861b873077a7bfb0268c2e0",icon:g,"aria-hidden":"true"}))),this.isOpen&&this.renderCalendar(e))}static get formAssociated(){return!0}get el(){return this}static get watchers(){return{value:[{valueChanged:0}],format:[{contextChanged:0}],locale:[{contextChanged:0}],timePicker:[{contextChanged:0}],range:[{contextChanged:0}],monthDay:[{contextChanged:0}],min:[{contextChanged:0}],max:[{contextChanged:0}],placement:[{placementChanged:0}],required:[{requiredChanged:0}],disabled:[{interactivityChanged:0}],readonly:[{interactivityChanged:0}]}}static get style(){return':host{--pds-datepicker-day-size:var(--pine-dimension-500);--pds-datepicker-presets-width:200px;display:inline-block}:host([full-width]){display:block}pds-input{display:block}:host(.pds-datepicker--time) pds-input{min-width:220px}:host(.pds-datepicker--range) pds-input{min-width:260px}:host(.pds-datepicker--range.pds-datepicker--time) pds-input{min-width:min(380px, 100%)}.pds-datepicker__trigger,.pds-datepicker__clear{-ms-flex-align:center;align-items:center;background:transparent;border:0;border-radius:var(--pine-border-radius-sm);color:var(--pine-color-text-secondary);cursor:pointer;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-pack:center;justify-content:center;padding:var(--pine-dimension-2xs)}.pds-datepicker__trigger:hover:not(:disabled),.pds-datepicker__clear:hover:not(:disabled){background:var(--pine-color-background-muted);color:var(--pine-color-text-strong)}.pds-datepicker__trigger:focus-visible,.pds-datepicker__clear:focus-visible{outline:var(--pine-outline-focus)}.pds-datepicker__trigger:disabled,.pds-datepicker__clear:disabled{color:var(--pine-color-text-disabled);cursor:not-allowed}.pds-datepicker__clear{-webkit-margin-end:var(--pine-dimension-2xs);margin-inline-end:var(--pine-dimension-2xs)}.pds-datepicker__nav{-ms-flex-align:center;align-items:center;background: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(--pine-color-text-secondary);cursor:pointer;display:-ms-inline-flexbox;display:inline-flex;height:var(--pine-dimension-400);-ms-flex-pack:center;justify-content:center;padding:0;width:var(--pine-dimension-400)}.pds-datepicker__nav:hover:not(:disabled){background:var(--pine-color-secondary-hover);border-color:var(--pine-color-border-hover)}.pds-datepicker__nav:focus-visible{outline:var(--pine-outline-focus);outline-offset:var(--pine-border-width)}.pds-datepicker__nav:disabled{border-color:var(--pine-color-border-disabled);color:var(--pine-color-text-secondary-disabled);cursor:not-allowed}.pds-datepicker__nav:dir(rtl) pds-icon{-webkit-transform:scaleX(-1);transform:scaleX(-1)}.pds-datepicker__dialog:focus{outline:none}.pds-datepicker__dialog{background:var(--pine-color-background-overlay);border-radius:var(--pine-dimension-150);-webkit-box-shadow:var(--pine-box-shadow-200);box-shadow:var(--pine-box-shadow-200);-webkit-box-sizing:border-box;box-sizing:border-box;left:0;max-height:calc(100vh - var(--pine-dimension-sm));max-height:calc(100dvh - var(--pine-dimension-sm));max-width:calc(100vw - var(--pine-dimension-sm));overflow:auto;-ms-scroll-chaining:none;overscroll-behavior:contain;padding:var(--pine-dimension-sm);pointer-events:auto;position:fixed;top:0;visibility:hidden;z-index:var(--pine-z-index-priority)}:host-context([data-theme=dark]) .pds-datepicker__dialog{border:var(--pine-border)}.pds-datepicker__header{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-webkit-margin-after:var(--pine-dimension-sm);margin-block-end:var(--pine-dimension-sm)}.pds-datepicker__nav-spacer{-ms-flex:none;flex:none;width:var(--pine-dimension-400)}.pds-datepicker__heading{color:var(--pine-color-text);font:var(--pine-typography-heading-5);font-weight:var(--pine-font-weight-semi-bold)}.pds-datepicker__grid{border-collapse:collapse;border-spacing:0}.pds-datepicker__weekday{color:var(--pine-color-text-muted);font:var(--pine-typography-body-sm);height:var(--pds-datepicker-day-size);padding:0;text-align:center;width:var(--pds-datepicker-day-size)}.pds-datepicker__day{border-radius:var(--pine-border-radius-full);color:var(--pine-color-text-secondary);cursor:pointer;font:var(--pine-typography-body);height:var(--pds-datepicker-day-size);padding:0;position:relative;text-align:center;-webkit-transition:background var(--pine-motion-duration-fast) var(--pine-motion-easing-in);transition:background var(--pine-motion-duration-fast) var(--pine-motion-easing-in);width:var(--pds-datepicker-day-size)}.pds-datepicker__day:hover{background:var(--pine-color-background-muted)}.pds-datepicker__day:focus-visible{outline:var(--pine-outline-focus);outline-offset:calc(var(--pine-border-width-thick) * -1)}.pds-datepicker__day--empty{cursor:default;pointer-events:none}.pds-datepicker__day--today::after{background:var(--pine-color-primary);border-radius:var(--pine-border-radius-full);content:"";height:var(--pine-dimension-050);inset-block-end:var(--pine-dimension-050);inset-inline-start:50%;position:absolute;-webkit-transform:translateX(-50%);transform:translateX(-50%);width:var(--pine-dimension-050)}.pds-datepicker__day--selected,.pds-datepicker__day--selected:hover{background:var(--pine-color-primary);color:var(--pine-color-text-primary)}.pds-datepicker__day--selected:focus-visible{outline-offset:var(--pine-border-width)}.pds-datepicker__day--range-start{border-end-end-radius:0;border-start-end-radius:0}.pds-datepicker__day--range-end{border-end-start-radius:0;border-start-start-radius:0}.pds-datepicker__day--range-start.pds-datepicker__day--row-end{border-end-end-radius:var(--pine-border-radius-full);border-start-end-radius:var(--pine-border-radius-full)}.pds-datepicker__day--range-end.pds-datepicker__day--row-start{border-end-start-radius:var(--pine-border-radius-full);border-start-start-radius:var(--pine-border-radius-full)}.pds-datepicker__day--selected.pds-datepicker__day--today::after{background:var(--pine-color-text-primary)}.pds-datepicker__day--in-range{border-radius:0}.pds-datepicker__day--in-range,.pds-datepicker__day--in-range:hover{background:var(--pine-color-background-muted);color:var(--pine-color-text-secondary)}.pds-datepicker__day--row-start{border-end-start-radius:var(--pine-border-radius-full);border-start-start-radius:var(--pine-border-radius-full)}.pds-datepicker__day--row-end{border-end-end-radius:var(--pine-border-radius-full);border-start-end-radius:var(--pine-border-radius-full)}.pds-datepicker__day--disabled,.pds-datepicker__day--disabled:hover{background:transparent;color:var(--pine-color-text-disabled);cursor:not-allowed;text-decoration:line-through}.pds-datepicker__day--in-range:hover{background:var(--pine-color-background-inset)}.pds-datepicker__dialog--range{display:-ms-flexbox;display:flex;padding:0}.pds-datepicker__panel{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;min-width:0}.pds-datepicker__dialog--range .pds-datepicker__panel{padding:var(--pine-dimension-sm)}.pds-datepicker__months{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:var(--pine-dimension-lg)}.pds-datepicker__presets-column{-webkit-border-end:var(--pine-border-width-thin) solid var(--pine-color-border-subtle);border-inline-end:var(--pine-border-width-thin) solid var(--pine-color-border-subtle);-ms-flex:none;flex:none;position:relative;width:var(--pds-datepicker-presets-width)}.pds-datepicker__presets{-webkit-box-sizing:border-box;box-sizing:border-box;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--pine-dimension-2xs);inset:0;list-style:none;margin:0;overflow-y:auto;padding:var(--pine-dimension-150);position:absolute}.pds-datepicker__preset{-ms-flex-align:center;align-items:center;background:transparent;border:0;border-radius:var(--pine-border-radius-md);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-sm);text-align:start;-webkit-transition:background var(--pine-motion-duration-fast) var(--pine-motion-easing-in);transition:background var(--pine-motion-duration-fast) var(--pine-motion-easing-in);width:100%}.pds-datepicker__preset:hover:not(:disabled){background:var(--pine-color-background-muted)}.pds-datepicker__preset:focus-visible{outline:var(--pine-outline-focus)}.pds-datepicker__preset:disabled{color:var(--pine-color-text-disabled);cursor:not-allowed}.pds-datepicker__preset--selected{background:var(--pine-color-background-muted);color:var(--pine-color-text-active)}.pds-datepicker__footer{-ms-flex-align:center;align-items:center;background:var(--pine-color-background-overlay);-webkit-border-before:var(--pine-border-width-thin) solid var(--pine-color-border-subtle);border-block-start:var(--pine-border-width-thin) solid var(--pine-color-border-subtle);display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:var(--pine-dimension-xs);inset-block-end:calc(var(--pine-dimension-sm) * -1);-ms-flex-pack:end;justify-content:flex-end;margin-block:var(--pine-dimension-sm) calc(var(--pine-dimension-sm) * -1);padding-block:var(--pine-dimension-sm);position:-webkit-sticky;position:sticky}.pds-datepicker__selection{color:var(--pine-color-text-muted);font:var(--pine-typography-body-sm-medium);-webkit-margin-end:auto;margin-inline-end:auto}.pds-datepicker__dropdowns{display:-ms-flexbox;display:flex;gap:var(--pine-dimension-2xs)}.pds-datepicker__select-wrap{-ms-flex-align:center;align-items:center;display:-ms-inline-flexbox;display:inline-flex;position:relative}.pds-datepicker__heading-select{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;border:0;border-radius:var(--pine-border-radius-md);color:var(--pine-color-text);cursor:pointer;field-sizing:content;font:var(--pine-typography-heading-5);font-weight:var(--pine-font-weight-semi-bold);padding-block:var(--pine-dimension-2xs);padding-inline:var(--pine-dimension-xs) calc(var(--pine-dimension-xs) + var(--pine-dimension-sm))}.pds-datepicker__heading-select:hover{background:var(--pine-color-background-muted)}.pds-datepicker__heading-select:focus-visible{outline:var(--pine-outline-focus)}.pds-datepicker__select-caret{color:var(--pine-color-text-secondary);inset-inline-end:var(--pine-dimension-xs);pointer-events:none;position:absolute}.pds-datepicker__time{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;gap:var(--pine-dimension-xs);-ms-flex-pack:justify;justify-content:space-between;-webkit-margin-before:var(--pine-dimension-sm);margin-block-start:var(--pine-dimension-sm);padding-inline:var(--pine-dimension-xs)}.pds-datepicker__time-label{color:var(--pine-color-text-label);font:var(--pine-typography-body-medium)}.pds-datepicker__time-field{-ms-flex-align:center;align-items:center;background:var(--pine-color-background-container);border:var(--pine-border);border-radius:var(--pine-border-radius-md);display:-ms-inline-flexbox;display:inline-flex;min-height:var(--pine-dimension-400);padding-inline:var(--pine-dimension-2xs)}.pds-datepicker__time-field:hover{border-color:var(--pine-color-border-hover)}.pds-datepicker__time-field:focus-within{outline:var(--pine-outline-focus);outline-offset:var(--pine-border-width)}.pds-datepicker__time-select{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;border:0;border-radius:var(--pine-border-radius-sm);color:var(--pine-color-text-strong);cursor:pointer;font:var(--pine-typography-body);font-variant-numeric:tabular-nums;padding:var(--pine-dimension-2xs);text-align:center}.pds-datepicker__time-select:focus-visible{background:var(--pine-color-background-muted);outline:none}.pds-datepicker__time-select--period{-webkit-margin-start:var(--pine-dimension-2xs);margin-inline-start:var(--pine-dimension-2xs)}.pds-datepicker__time-separator{color:var(--pine-color-text-secondary)}:host-context([data-theme=dark]) select{color-scheme:dark}.pds-datepicker__action{background:var(--pine-color-secondary);border:var(--pine-border);border-radius:var(--pine-border-radius-full);color:var(--pine-color-text-secondary);cursor:pointer;font:var(--pine-typography-body-medium);padding:calc(var(--pine-dimension-xs) - var(--pine-border-width)) var(--pine-dimension-sm)}.pds-datepicker__action:hover:not(:disabled){background:var(--pine-color-secondary-hover);border-color:var(--pine-color-border-hover)}.pds-datepicker__action:focus-visible{outline:var(--pine-outline-focus);outline-offset:var(--pine-border-width)}.pds-datepicker__action:disabled{background:var(--pine-color-secondary-disabled);border-color:var(--pine-color-border-disabled);color:var(--pine-color-text-secondary-disabled);cursor:not-allowed}.pds-datepicker__action--primary{background:var(--pine-color-primary);border-color:var(--pine-color-primary);color:var(--pine-color-text-primary)}.pds-datepicker__action--primary:hover:not(:disabled){background:var(--pine-color-primary-hover);border-color:var(--pine-color-primary-hover)}.pds-datepicker__action--primary:disabled{background:var(--pine-color-primary-disabled);border-color:var(--pine-color-primary-disabled);color:var(--pine-color-text-primary-disabled)}@media (max-width: 600px){.pds-datepicker__dialog--range{-ms-flex-direction:column;flex-direction:column}.pds-datepicker__presets-column{-webkit-border-after:var(--pine-border-width-thin) solid var(--pine-color-border-subtle);border-block-end:var(--pine-border-width-thin) solid var(--pine-color-border-subtle);-webkit-border-end:0;border-inline-end:0;width:auto}.pds-datepicker__presets{-ms-flex-direction:row;flex-direction:row;overflow-x:auto;position:static}.pds-datepicker__preset{white-space:nowrap}.pds-datepicker__selection{-ms-flex-preferred-size:100%;flex-basis:100%}}.pds-datepicker__trigger,.pds-datepicker__clear,.pds-datepicker__nav,.pds-datepicker__weekday,.pds-datepicker__day,.pds-datepicker__preset,.pds-datepicker__action{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}@media (forced-colors: active){.pds-datepicker__day--selected,.pds-datepicker__day--selected:hover{background:Highlight;color:HighlightText;forced-color-adjust:none}.pds-datepicker__day--in-range,.pds-datepicker__day--in-range:hover{border-block:var(--pine-border-width-thin) solid Highlight}.pds-datepicker__day--today::after{background:CanvasText;forced-color-adjust:none}.pds-datepicker__day--selected.pds-datepicker__day--today::after{background:HighlightText}.pds-datepicker__day--disabled{color:GrayText}}.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}'}},[65,"pds-datepicker",{applyLabel:[1,"apply-label"],autoApply:[4,"auto-apply"],cancelLabel:[1,"cancel-label"],clearable:[4],clearLabel:[1,"clear-label"],componentId:[1,"component-id"],customRangeLabel:[1,"custom-range-label"],disabled:[4],endTimeLabel:[1,"end-time-label"],errorMessage:[1,"error-message"],firstDayOfWeek:[2,"first-day-of-week"],format:[1],fullWidth:[4,"full-width"],helperMessage:[1,"helper-message"],hideLabel:[4,"hide-label"],hourLabel:[1,"hour-label"],invalid:[4],invalidDateMessage:[1,"invalid-date-message"],maxDateMessage:[1,"max-date-message"],minDateMessage:[1,"min-date-message"],label:[1],locale:[1],max:[1],min:[1],minuteIncrement:[2,"minute-increment"],minuteLabel:[1,"minute-label"],monthLabel:[1,"month-label"],monthDay:[4,"month-day"],name:[1],nextMonthLabel:[1,"next-month-label"],periodLabel:[1,"period-label"],placeholder:[1],placement:[1],presets:[1],presetsLabel:[1,"presets-label"],previousMonthLabel:[1,"previous-month-label"],range:[4],readonly:[4],required:[4],showDropdowns:[4,"show-dropdowns"],startTimeLabel:[1,"start-time-label"],timePicker:[4,"time-picker"],timeLabel:[1,"time-label"],triggerLabel:[1,"trigger-label"],value:[1025],yearLabel:[1,"year-label"],isOpen:[32],text:[32],textError:[32],activeDate:[32],viewMonth:[32],draftStart:[32],draftEnd:[32],startTime:[32],endTime:[32],previewDate:[32],open:[64],close:[64],setFocus:[64]},void 0,{value:[{valueChanged:0}],format:[{contextChanged:0}],locale:[{contextChanged:0}],timePicker:[{contextChanged:0}],range:[{contextChanged:0}],monthDay:[{contextChanged:0}],min:[{contextChanged:0}],max:[{contextChanged:0}],placement:[{placementChanged:0}],required:[{requiredChanged:0}],disabled:[{interactivityChanged:0}],readonly:[{interactivityChanged:0}]}]),Pe=Le,Ye=function(){"undefined"!=typeof customElements&&["pds-datepicker","pds-icon","pds-input"].forEach((e=>{switch(e){case"pds-datepicker":customElements.get(n(e))||customElements.define(n(e),Le);break;case"pds-icon":customElements.get(n(e))||D();break;case"pds-input":customElements.get(n(e))||M()}}))};export{Pe as PdsDatepicker,Ye as defineCustomElement}
1
+ import{proxyCustomElement as e,HTMLElement as t,createEvent as i,h as s,Host as r,transformTag as n}from"@stencil/core/internal/client";import{a,c as o,o as d,f as l,b as h,s as c,h as p}from"./floating-ui.dom.js";import{c as u,j as v,k as m,m as b,r as f,n as g}from"./index2.js";import{i as k}from"./form.js";import{r as _,f as y}from"./i18n-format.js";import{c as x}from"./closest.js";import{f as w}from"./portal-target.js";import{d as D}from"./pds-icon2.js";import{d as M}from"./pds-input2.js";const C=/^(\d{4})-(\d{2})-(\d{2})$/;function $(e){const t=C.exec((null!=e?e:"").trim());if(!t)return null;const[,i,s,r]=t.map(Number),n=new Date(Date.UTC(i,s-1,r));return n.getUTCFullYear()===i&&n.getUTCMonth()===s-1&&n.getUTCDate()===r?n:null}function A(e){return e.toISOString().slice(0,10)}function T(){const e=new Date;return new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()))}function j(e,t){return new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()+t))}function L(e,t){const i=new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth()+t,1)),s=Y(i.getUTCFullYear(),i.getUTCMonth());return new Date(Date.UTC(i.getUTCFullYear(),i.getUTCMonth(),Math.min(e.getUTCDate(),s)))}function Y(e,t){return new Date(Date.UTC(e,t+1,0)).getUTCDate()}function P(e,t){return!!e&&!!t&&e.getTime()===t.getTime()}function H(e,t,i){return t&&e<t?t:i&&e>i?i:e}function z(e,t,i){return!!t&&e<t||!!i&&e>i}function E(e,t){return(e.getUTCDay()-t+7)%7}function S(e,t){return new Intl.DateTimeFormat(e,Object.assign(Object.assign({},t),{timeZone:"UTC",calendar:"gregory"}))}function O(e,t,i){return S(t,i).format(e)}const U=2e3,F=/^--(\d{2})-(\d{2})$/;function N(e){return new Date(Date.UTC(U,e.getUTCMonth(),e.getUTCDate()))}function q(e){const t=(null!=e?e:"").trim(),i=F.exec(t);if(i)return $(`2000-${i[1]}-${i[2]}`);const s=$(t);return s&&N(s)}function I(e){return"-"+A(e).slice(4)}class R{constructor(e){this.datepicker=e,this.copiedProperties=[],this.host=document.createElement("div"),this.host.className=R.className,this.host.pdsDatepicker=e,this.host.style.display="contents",this.root=this.host.attachShadow({mode:"open"})}mount(e,t){this.host.isConnected?t!==this.locale&&this.copyContext(t):(w(this.datepicker).appendChild(this.host),this.copyContext(t)),e.parentNode!==this.root&&this.root.appendChild(e)}remove(){this.host.remove()}contains(e){return!!e&&(e===this.host||this.root.contains(e))}copyContext(e){var t,i;this.locale=e;const s=this.datepicker.shadowRoot;s&&((null===(t=s.adoptedStyleSheets)||void 0===t?void 0:t.length)?this.root.adoptedStyleSheets=s.adoptedStyleSheets:this.root.querySelector("style")||s.querySelectorAll("style").forEach((e=>this.root.appendChild(e.cloneNode(!0)))));const r=getComputedStyle(this.datepicker);this.host.dir=r.direction||"ltr",this.host.lang=e,this.copyCustomProperties(r);const n=null===(i=x("[data-theme]",this.datepicker)||null)||void 0===i?void 0:i.getAttribute("data-theme");n?this.host.setAttribute("data-theme",n):this.host.removeAttribute("data-theme")}copyCustomProperties(e){for(const e of this.copiedProperties)this.host.style.removeProperty(e);this.copiedProperties=[];const t=this.host.parentElement,i=t?getComputedStyle(t):null;for(let t=0;t<e.length;t++){const s=e[t];if(!s.startsWith("--"))continue;const r=e.getPropertyValue(s);i&&r===i.getPropertyValue(s)||(this.host.style.setProperty(s,r.trim()),this.copiedProperties.push(s))}}}R.className="pds-datepicker-calendar-portal";const W={today:"Today",yesterday:"Yesterday","last-7-days":"Last 7 days","last-30-days":"Last 30 days","last-90-days":"Last 90 days","this-month":"This month","last-month":"Last month","this-quarter":"This quarter","last-quarter":"Last quarter","this-year":"This year","last-year":"Last year","year-to-date":"Year to date","last-12-months":"Last 12 months"},V=(e,t,i)=>new Date(Date.UTC(e,t,i));function K(e,t){const i=t.getUTCFullYear(),s=t.getUTCMonth(),r=s-s%3;switch(e){case"today":return[t,t];case"yesterday":return[j(t,-1),j(t,-1)];case"last-7-days":return[j(t,-6),t];case"last-30-days":return[j(t,-29),t];case"last-90-days":return[j(t,-89),t];case"this-month":return[V(i,s,1),V(i,s+1,0)];case"last-month":return[V(i,s-1,1),V(i,s,0)];case"this-quarter":return[V(i,r,1),V(i,r+3,0)];case"last-quarter":return[V(i,r-3,1),V(i,r,0)];case"this-year":return[V(i,0,1),V(i,11,31)];case"last-year":return[V(i-1,0,1),V(i-1,11,31)];case"year-to-date":return[V(i,0,1),t];case"last-12-months":return[L(t,-12),t];default:return null}}const Z=e=>"number"==typeof e&&Number.isInteger(e);function X(e,t){const{startOffset:i,endOffset:s}=e;if(null==i&&null==s)return null;if(null!=i&&!Z(i))return null;if(null!=s&&!Z(s))return null;const r=j(t,null!=i?i:0),n=j(t,null!=s?s:0);return r<=n?[r,n]:null}const B=new Set;function G(e){B.has(e)||(B.add(e),console.warn("PDS Datepicker: "+e))}function J(e,t,i){if(t&&i)return e.find((e=>e.start.getTime()===t.getTime()&&e.end.getTime()===i.getTime()))}function Q(e,t,i){return!z(e.start,t,i)&&!z(e.end,t,i)}const ee=/^(\d{4}-\d{2}-\d{2})(?:[T ](\d{2}):(\d{2}))?$/;function te(e){const t=ee.exec((null!=e?e:"").trim());if(!t)return null;const i=$(t[1]);return i?void 0===t[2]?{date:i,time:null}:Number(t[2])<24&&Number(t[3])<60?{date:i,time:`${t[2]}:${t[3]}`}:null:null}const ie="YYYY-MM-DD",se=/\[([^\]]*)\]|YYYY|MMMM|MMM|MM|M|DD|D|HH|H|hh|h|mm|A|a/g,re=/HH|H|hh|h/,ne=/hh|h/,ae=/A|a/,oe=e=>e.replace(/\[[^\]]*\]/g,"");function de(e,t,i=!1){const s=(null==e?void 0:e.trim())||ie,r=oe(s);return ne.test(r)&&!ae.test(r)?s+" A":!t||re.test(r)?s:`${s} ${i?"h:mm A":"HH:mm"}`}const le=(e,t=2)=>(e+"").padStart(t,"0"),he=new Map;function ce(e){let t=he.get(e);if(!t){const i=(t,i)=>{const s=new Intl.DateTimeFormat(e,Object.assign(Object.assign({month:t},i?{day:"numeric"}:{}),{timeZone:"UTC",calendar:"gregory"}));return Array.from({length:12},((e,t)=>{const r=new Date(Date.UTC(2023,t,1));if(!i)return s.format(r);const n=s.formatToParts(r),a=n.findIndex((e=>"month"===e.type));if(-1===a)return s.format(r);const o=n[a+1];return"literal"!==(null==o?void 0:o.type)||/\s/.test(o.value)?n[a].value:n[a].value+o.value}))},s=Ae(e);t={months:i("long",!1),shortMonths:i("short",!1),monthsWithDay:i("long",!0),shortMonthsWithDay:i("short",!0),am:s.am,pm:s.pm},he.set(e,t)}return t}const pe=e=>/D/.test(e);function ue(e,t,i="en-US"){var s;const r=ce(i),n=pe(oe(t)),[a,o]=Ce(null!==(s=e.time)&&void 0!==s?s:"00:00"),d=a%12||12,l=e.date.getUTCMonth(),h=a<12?r.am:r.pm,c={YYYY:le(e.date.getUTCFullYear(),4),MMMM:n?r.monthsWithDay[l]:r.months[l],MMM:n?r.shortMonthsWithDay[l]:r.shortMonths[l],MM:le(l+1),M:l+1+"",DD:le(e.date.getUTCDate()),D:e.date.getUTCDate()+"",HH:le(a),H:a+"",hh:le(d),h:d+"",mm:le(o),A:h,a:h.toLowerCase()};return t.replace(se,((e,t)=>null!=t?t:c[e]))}const ve=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),me=e=>ve(e).replace(/\s+/g,"\\s*"),be=e=>`(${e.map(ve).join("|")})`;function fe(e,t,i="en-US",s){var r,n,a,o,d,l,h,c,p,u;const v=ce(i),m=ce("en-US"),b=pe(oe(t)),f=b?v.monthsWithDay:v.months,g=b?v.shortMonthsWithDay:v.shortMonths,k=b?m.monthsWithDay:m.months,_=b?m.shortMonthsWithDay:m.shortMonths,y=[v.am,v.pm,m.am,m.pm],x={YYYY:"(\\d{4})",MMMM:be([...f,...k]),MMM:be([...g,..._]),MM:"(\\d{1,2})",M:"(\\d{1,2})",DD:"(\\d{1,2})",D:"(\\d{1,2})",HH:"(\\d{1,2})",H:"(\\d{1,2})",hh:"(\\d{1,2})",h:"(\\d{1,2})",mm:"(\\d{2})",A:be(y),a:be(y)},w=[],D=()=>{w.length=0;let e="",i=0;return t.replace(se,((s,r,n)=>(e+=me(t.slice(i,n)),void 0!==r?e+=me(r):(e+=x[s],w.push(s)),i=n+s.length,s))),RegExp(`^\\s*${e}${me(t.slice(i))}\\s*$`,"i")};let M=D().exec(null!=e?e:"");if(M||(x.mm="(\\d{1,2})",M=D().exec(null!=e?e:"")),!M)return null;const C=M,A={};w.forEach(((e,t)=>A[e]=C[t+1]));const T=(e,t)=>{if(void 0===e)return;const i=t?[f,k]:[g,_];for(const t of i){const i=t.findIndex((t=>t.toLowerCase()===e.toLowerCase()));if(i>=0)return i+1}},j=A.YYYY?Number(A.YYYY):s,L=null!==(n=null!==(r=T(A.MMMM,!0))&&void 0!==r?r:T(A.MMM,!1))&&void 0!==n?n:Number(null!==(a=A.MM)&&void 0!==a?a:A.M),Y=Number(null!==(o=A.DD)&&void 0!==o?o:A.D);if(void 0===j||!L||!Y)return null;const P=$(`${le(j,4)}-${le(L)}-${le(Y)}`);if(!P)return null;const H=null!==(h=null!==(l=null!==(d=A.HH)&&void 0!==d?d:A.H)&&void 0!==l?l:A.hh)&&void 0!==h?h:A.h;if(void 0===H)return{date:P,time:null};let z=Number(H);const E=Number(null!==(c=A.mm)&&void 0!==c?c:0),S=null===(u=null!==(p=A.A)&&void 0!==p?p:A.a)||void 0===u?void 0:u.toLowerCase();if(void 0!==A.hh||void 0!==A.h){if(z<1||z>12)return null;z=z%12+(S===v.pm.toLowerCase()||S===m.pm.toLowerCase()?12:0)}return z<24&&E<60?{date:P,time:$e(z,E)}:null}function ge(e,t=ie,i="en-US"){var s;return null!==(s=fe(e,t,i))&&void 0!==s?s:te(e)}function ke(e="en-US",t="long"){return S(e,{month:t,day:"numeric"}).formatToParts(new Date(Date.UTC(U,11,31))).map((e=>"month"===e.type?/^\d+$/.test(e.value)?"M":"MMMM":"day"===e.type?"D":/[A-Za-z]/.test(e.value)?`[${e.value}]`:e.value)).join("")}function _e(e,t,i="en-US"){const s=[t,ke(i),ke(i,"numeric"),"MMMM D","D MMMM","MMM D","D MMM"];for(const t of s){const s=fe(e,t,i,U);if(s)return{date:N(s.date),time:null}}const r=q(e);return r?{date:r,time:null}:null}function ye(e,t=ie,i="en-US"){const s=(null!=e?e:"").trim(),r=RegExp(`${ve(Me)}|\\s+(?:–|—|-|to)\\s+${t.includes("/")?"":"|\\s*/\\s*"}`,"gi");let n;for(;null!==(n=r.exec(s));){const e=ge(s.slice(0,n.index),t,i),r=ge(s.slice(n.index+n[0].length),t,i);if(e&&r)return xe(e,r)<=0?[e,r]:null}return null}function xe(e,t){var i,s;const r=e.date.getTime()-t.date.getTime();return 0!==r?r:(null!==(i=e.time)&&void 0!==i?i:"00:00").localeCompare(null!==(s=t.time)&&void 0!==s?s:"00:00")}function we(e){return e.time?`${A(e.date)}T${e.time}`:A(e.date)}function De(e,t,i="en-US"){return ue(e,null!=t?t:de(ie,!!e.time),i)}const Me=" – ";function Ce(e){const[t,i]=e.split(":").map(Number);return[t||0,i||0]}function $e(e,t){return`${(e+"").padStart(2,"0")}:${(t+"").padStart(2,"0")}`}function Ae(e){var t,i;const s=new Intl.DateTimeFormat(e,{hour:"numeric",timeZone:"UTC"}),r=e=>{var t;return null===(t=s.formatToParts(new Date(Date.UTC(2023,0,1,e))).find((e=>"dayPeriod"===e.type)))||void 0===t?void 0:t.value};return{hour12:!!s.resolvedOptions().hour12,am:null!==(t=r(1))&&void 0!==t?t:"AM",pm:null!==(i=r(13))&&void 0!==i?i:"PM"}}const Te={weekday:"long",year:"numeric",month:"long",day:"numeric"},je={month:"long",day:"numeric"},Le="00:00",Ye="23:59";let Pe=0;const He=e=>new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),1)),ze=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.pdsDatepickerChange=i(this,"pdsDatepickerChange",7),this.pdsBlur=i(this,"pdsBlur",7),this.pdsFocus=i(this,"pdsFocus",7),this.focusActiveDay=!1,this.fallbackId="pds-datepicker-"+ ++Pe,this.skipForwardedClick=!1,this.presetByArrow=!1,this.valueAtOpen="",this.committing=!1,this.hasFocus=!1,this.applyLabel="Apply",this.autoApply=!1,this.cancelLabel="Cancel",this.clearable=!1,this.clearLabel="Clear",this.customRangeLabel="Custom range",this.endTimeLabel="End time",this.format="YYYY-MM-DD",this.hourLabel="Hour",this.invalidDateMessage="Enter a date in the format shown.",this.maxDateMessage="Choose {date} or earlier.",this.minDateMessage="Choose {date} or later.",this.minuteIncrement=1,this.minuteLabel="Minute",this.monthLabel="Month",this.monthDay=!1,this.nextMonthLabel="Next month",this.periodLabel="AM or PM",this.placement="bottom-start",this.presetsLabel="Presets",this.previousMonthLabel="Previous month",this.range=!1,this.showDropdowns=!1,this.startTimeLabel="Start time",this.timePicker=!1,this.timeLabel="Time",this.triggerLabel="Choose date",this.value="",this.yearLabel="Year",this.isOpen=!1,this.text="",this.textError="",this.activeDate="",this.viewMonth="",this.draftStart="",this.draftEnd="",this.startTime=Le,this.endTime=Ye,this.previewDate="",this.onApply=()=>{const e=this.draftParts();e&&(this.commitParts(e),this.closeCalendar(!0))},this.onCancel=()=>{this.clearable?this.commitValue(""):this.restoreValueAtOpen(),this.closeCalendar(!0)},this.onPresetClick=(e,t)=>{this.draftStart=A(t.start),this.draftEnd=A(t.end),this.previewDate="",!this.appliesOnPick||this.presetByArrow?(this.showDate(t.end,!0),e.currentTarget.focus()):this.onApply()},this.onPresetsKeyDown=e=>{const t={ArrowDown:1,ArrowRight:1,ArrowUp:-1,ArrowLeft:-1}[e.key],i={Home:"first",End:"last"}[e.key];if(!t&&!i)return;const s=Array.from(e.currentTarget.querySelectorAll('[role="radio"]:not([disabled])')),r=s.indexOf(e.target),n="first"===i?s[0]:"last"===i?s[s.length-1]:s[(r+t+s.length)%s.length];n&&(e.preventDefault(),n.focus(),n.classList.contains("pds-datepicker__preset")&&n!==s[s.length-1]&&(this.presetByArrow=!0,n.click(),this.presetByArrow=!1))},this.onClearMouseDown=e=>{e.preventDefault()},this.onClearClick=()=>{var e;this.commitValue(""),this.closeCalendar(!1),null===(e=this.inputEl)||void 0===e||e.setFocus()},this.onCustomRangeClick=()=>{var e,t;null===(t=null===(e=this.dialogEl)||void 0===e?void 0:e.querySelector('[data-date][tabindex="0"]'))||void 0===t||t.focus()},this.onDocumentPointerDown=e=>{var t;const i=e.composedPath();i.includes(this.el)||this.portal&&i.includes(this.portal.host)||(this.closeCalendar(!1),"dialog"===(null===(t=i[0])||void 0===t?void 0:t.localName)&&function(){const e=e=>{e.stopPropagation(),e.preventDefault()};document.addEventListener("click",e,{capture:!0,once:!0}),window.setTimeout((()=>document.removeEventListener("click",e,{capture:!0})),500)}())},this.onHostFocusIn=e=>{this.focusEntered(e)},this.onCalendarFocusIn=e=>{var t,i;this.focusEntered(e),null===(t=this.dialogEl)||void 0===t||t.setAttribute("aria-modal","true"),e.target===this.dialogEl&&(null===(i=this.dialogEl.querySelector(`[data-date="${this.activeDate}"]`))||void 0===i||i.focus({preventScroll:!0}))},this.onCalendarFocusOut=e=>{var t,i;const s=e.relatedTarget;s&&(null===(t=this.dialogEl)||void 0===t?void 0:t.contains(s))||null===(i=this.dialogEl)||void 0===i||i.removeAttribute("aria-modal"),this.checkFocusLeft(e,null!==s)},this.onHostFocusOut=e=>{const t=e.relatedTarget;t&&this.isInside(t)||this.checkFocusLeft(e,null!==t)},this.stopInnerEvent=e=>e.stopPropagation(),this.onFieldClick=e=>{var t,i;const s=e.composedPath();if(this.triggerEl&&s.includes(this.triggerEl)||this.clearEl&&s.includes(this.clearEl))return;const r=null===(i=null===(t=this.inputEl)||void 0===t?void 0:t.shadowRoot)||void 0===i?void 0:i.querySelector("label");if(r&&s.includes(r))return this.skipForwardedClick=!0,void window.setTimeout((()=>this.skipForwardedClick=!1));if(this.skipForwardedClick)return void(this.skipForwardedClick=!1);const n=this.fieldReference();n&&n!==this.inputEl&&!s.includes(n)||this.openCalendar(!1)},this.onTextInput=e=>{var t,i;if(e.stopPropagation(),this.text=(null!==(t=e.detail.value)&&void 0!==t?t:"")+"",!this.isOpen)return;const s=this.parseText(this.text);if(!s)return;const[r,n]=[this.startTime,this.endTime];if(null!==(i=this.timesBeforeTyping)&&void 0!==i||(this.timesBeforeTyping=[r,n]),this.loadDraft(s),this.hasTime){const e=this.resolvedFormat,t=this.resolvedLocale,i=this.isRange?ye(this.text,e,t):[ge(this.text,e,t)],s=this.parsedValue(),a=e=>{var t,r,n;return!(null===(t=null==i?void 0:i[e])||void 0===t?void 0:t.time)||(null===(r=i[e])||void 0===r?void 0:r.time)===(null===(n=null==s?void 0:s[e])||void 0===n?void 0:n.time)};a(0)&&(this.startTime=r),this.isRange&&a(1)&&(this.endTime=n)}this.showDate(s[s.length-1].date)},this.onTextChange=e=>{e.stopPropagation(),this.isOpen&&this.hasFooter?window.setTimeout((()=>{var e;this.isOpen&&(this.el.matches(":focus-within")||(null===(e=this.portal)||void 0===e?void 0:e.host.matches(":focus-within")))||this.commitPendingText()})):this.commitText()},this.onTextKeyDown=e=>{e.stopPropagation();const t=e.detail;if(t.altKey&&"ArrowDown"===t.key)t.preventDefault(),this.isOpen?(this.focusActiveDay=!0,this.flushActiveDayFocus()):this.openCalendar(!0);else if("Enter"===t.key&&this.isOpen){if(!this.hasFooter||this.text!==this.fieldText()&&!this.parseText(this.text))this.commitText();else{const e=this.draftParts();e&&this.commitParts(e)}this.textError||this.closeCalendar(!1)}else"Escape"===t.key&&this.isOpen&&(t.preventDefault(),t.stopPropagation(),this.restoreValueAtOpen(),this.closeCalendar(!1))},this.onTriggerKeyDown=e=>{var t;if(this.isOpen)return"Escape"===e.key?(e.preventDefault(),e.stopPropagation(),this.restoreValueAtOpen(),void this.closeCalendar(!1)):void("Tab"!==e.key||e.shiftKey||"visible"!==(null===(t=this.dialogEl)||void 0===t?void 0:t.style.visibility)||(e.preventDefault(),this.focusActiveDay=!0,this.flushActiveDayFocus()))},this.onTriggerClick=()=>{this.isOpen?this.closeCalendar(!0):this.openCalendar(!0)},this.onDialogKeyDown=e=>{"Escape"===e.key?(e.preventDefault(),e.stopPropagation(),this.restoreValueAtOpen(),this.closeCalendar(!0)):"Tab"===e.key&&this.trapTab(e)},this.onGridKeyDown=e=>{const t=$(this.activeDate);if(!t)return;const i="rtl"===getComputedStyle(this.el).direction,s=this.monthDay?(t.getUTCDate()-1)%7:E(t,this.weekStart);let r=null;switch(e.key){case"ArrowLeft":r=j(t,i?1:-1);break;case"ArrowRight":r=j(t,i?-1:1);break;case"ArrowUp":r=j(t,-7);break;case"ArrowDown":r=j(t,7);break;case"Home":r=j(t,-s);break;case"End":{const e=this.monthDay?Math.min(6,Y(t.getUTCFullYear(),t.getUTCMonth())-t.getUTCDate()+s):6;r=j(t,e-s);break}case"PageUp":r=e.shiftKey&&this.monthDay?t:L(t,e.shiftKey?-12:-1);break;case"PageDown":r=e.shiftKey&&this.monthDay?t:L(t,e.shiftKey?12:1);break;case"Enter":case" ":return e.preventDefault(),this.pickDate(t),void(this.hasFooter&&(this.focusActiveDay=!0));default:return}e.preventDefault();const n=H(this.inView(r),this.minDate,this.maxDate);this.showDate(n),this.isRange&&(this.previewDate=A(n)),this.focusActiveDay=!0},this.onGridClick=e=>{const t=this.dayFromEvent(e);t&&this.pickDate(t)},this.onGridPointerOver=e=>{if(!this.isRange||!this.draftStart||this.draftEnd)return;const t=this.dayFromEvent(e),i=t&&A(t);i&&i!==this.previewDate&&(this.previewDate=i)}}async open(){this.openCalendar(!0)}async close(){this.closeCalendar(!1)}async setFocus(){var e;await(null===(e=this.inputEl)||void 0===e?void 0:e.setFocus())}valueChanged(){var e;this.committing||(this.valueAtOpen=null!==(e=this.value)&&void 0!==e?e:""),this.refreshFromValue()}contextChanged(){this.refreshFromValue()}placementChanged(){this.stopPositioning()}refreshFromValue(){var e;this.text=this.fieldText(),this.textError="";const t=this.parsedValue();if(this.monthDay&&t){const e=this.dayValue(t[0].date);this.value!==e&&(this.value=e)}if(this.updateFormValue(),!this.isOpen)return;this.loadDraft(t);const i=null!==(e=t&&t[t.length-1].date)&&void 0!==e?e:this.now;this.showDate(H(i,this.minDate,this.maxDate),!0)}requiredChanged(){this.updateFormValue()}componentWillLoad(){this.refreshFromValue()}connectedCallback(){this.el.attachInternals&&!this.internals&&(this.internals=this.el.attachInternals())}componentDidLoad(){this.updateFormValue()}disconnectedCallback(){var e;this.closeCalendar(!1),null===(e=this.portal)||void 0===e||e.remove()}componentDidRender(){var e,t;this.isOpen&&this.dialogEl?(null!==(t=this.portal)&&void 0!==t||(this.portal=new R(this.el)),this.portal.mount(this.dialogEl,this.resolvedLocale),this.cleanupAutoUpdate||this.startPositioning(),this.flushActiveDayFocus()):null===(e=this.portal)||void 0===e||e.remove()}flushActiveDayFocus(){var e,t;this.focusActiveDay&&"visible"===(null===(e=this.dialogEl)||void 0===e?void 0:e.style.visibility)&&(this.focusActiveDay=!1,null===(t=this.dialogEl.querySelector(`[data-date="${this.activeDate}"]`))||void 0===t||t.focus())}get baseId(){return this.componentId||this.fallbackId}get resolvedLocale(){return function(e){var t;try{return null!==(t=Intl.DateTimeFormat.supportedLocalesOf(e)[0])&&void 0!==t?t:"en-US"}catch(e){return"en-US"}}(this.locale||_(this.el))}get weekStart(){const e=this.firstDayOfWeek;return"number"==typeof e&&Number.isInteger(e)&&e>=0&&e<=6?e:function(e){var t,i,s;const r=Intl.Locale;if(!r)return 0;try{const n=new r(e),a=null!==(i=null===(t=n.getWeekInfo)||void 0===t?void 0:t.call(n).firstDay)&&void 0!==i?i:null===(s=n.weekInfo)||void 0===s?void 0:s.firstDay;return"number"==typeof a?a%7:0}catch(e){return 0}}(this.resolvedLocale)}get minDate(){return this.monthDay?null:$(this.min)}get maxDate(){return this.monthDay?null:$(this.max)}get isRange(){return this.range&&!this.monthDay}get hasTime(){return this.timePicker&&!this.monthDay}get now(){return this.monthDay?N(T()):T()}inView(e){return this.monthDay?N(e):e}dayValue(e){return this.monthDay?I(e):A(e)}get isInteractive(){return!this.disabled&&!this.readonly}get monthCount(){const e="undefined"!=typeof window&&window.innerWidth<640;return this.isRange&&!e?2:1}get appliesOnPick(){return this.isRange&&this.autoApply&&!this.hasTime}get hasFooter(){return(this.isRange||this.hasTime)&&!this.appliesOnPick}get resolvedPresets(){return this.isRange?function(e,t){var i;const s="string"==typeof e?e.split(",").map((e=>e.trim())).filter(Boolean).map((e=>({key:e}))):Array.isArray(e)?e:[],r=[];for(const e of s){if(!e||"string"!=typeof e.key){G("a preset with no string key was left out.");continue}const s="string"==typeof e.start?$(e.start):null,n="string"==typeof e.end?$(e.end):null,a=null!==s&&null!==n&&s<=n?[s,n]:null,o=null!==(i=null!=a?a:X(e,t))&&void 0!==i?i:K(e.key,t),d="string"==typeof e.label&&""!==e.label.trim()?e.label:W[e.key];null!==o?void 0!==d?r.push({key:e.key,label:d,start:o[0],end:o[1]}):G(`preset "${e.key}" has no label and was left out.`):G(`preset "${e.key}" has no usable range and was left out. Give it whole-day startOffset/endOffset or YYYY-MM-DD start/end, start first.`)}return r}(this.presets,T()):[]}parsedValue(e=this.value){if(this.isRange){const[t,i,s]=(null!=e?e:"").split("/"),r=te(t),n=te(i);return void 0===s&&r&&n&&xe(r,n)<=0?[r,n]:null}if(this.monthDay){const t=q(e);return t?[{date:t,time:null}]:null}const t=te(e);return t?[t]:null}get resolvedFormat(){var e,t;if(this.monthDay){const i=null!==(t=null===(e=this.format)||void 0===e?void 0:e.trim())&&void 0!==t?t:"";return""===i||/YYYY/.test(i.replace(/\[[^\]]*\]/g,""))?ke(this.resolvedLocale):i}return de(this.format,this.hasTime,this.hasTime&&Ae(this.resolvedLocale).hour12)}fieldText(){var e;const t=this.parsedValue();return t?t.map((e=>De(this.withTimePicker(e),this.resolvedFormat,this.resolvedLocale))).join(Me):null!==(e=this.value)&&void 0!==e?e:""}withTimePicker(e,t=Le){var i;return{date:e.date,time:this.hasTime?null!==(i=e.time)&&void 0!==i?i:t:null}}get fieldPlaceholder(){if(this.placeholder)return this.placeholder;if(this.monthDay)return ue({date:q("--12-31"),time:null},this.resolvedFormat,this.resolvedLocale);const e=this.resolvedFormat;return this.isRange?`${e}${Me}${e}`:e}loadDraft(e){var t,i;const[s,r]=null!=e?e:[];this.draftStart=s?A(s.date):"",this.draftEnd=this.isRange&&r?A(r.date):"",this.startTime=null!==(t=null==s?void 0:s.time)&&void 0!==t?t:Le,this.endTime=null!==(i=null==r?void 0:r.time)&&void 0!==i?i:Ye,this.previewDate=""}openCalendar(e){var t,i;if(!this.isInteractive||this.isOpen)return;const s=this.parsedValue();this.loadDraft(s),this.valueAtOpen=null!==(t=this.value)&&void 0!==t?t:"";const r=null!==(i=s&&s[s.length-1].date)&&void 0!==i?i:this.now;this.showDate(H(r,this.minDate,this.maxDate),!0),this.focusActiveDay=e,this.isOpen=!0,document.addEventListener("pointerdown",this.onDocumentPointerDown,!0)}closeCalendar(e){var t;this.isOpen&&(this.commitPendingText(),this.timesBeforeTyping=void 0,this.isOpen=!1,this.stopPositioning(),document.removeEventListener("pointerdown",this.onDocumentPointerDown,!0),e&&(null===(t=this.triggerEl)||void 0===t||t.focus()))}showDate(e,t=!1){const i=this.inView(e),s=He(i),r=$(this.viewMonth),n=r&&L(r,this.monthCount-1);t||!r||s<r?this.viewMonth=A(t?L(s,1-this.monthCount):s):n&&s>n&&(this.viewMonth=A(L(s,1-this.monthCount))),this.activeDate=A(i)}pickDate(e){z(e,this.minDate,this.maxDate)||(this.dropTypedText(),this.isRange?this.pickRangeDay(e):this.hasTime?(this.draftStart=A(e),this.activeDate=this.draftStart):(this.commitValue(this.dayValue(e)),this.closeCalendar(!0)))}pickRangeDay(e){const t=$(this.draftStart),i=A(e);!t||this.draftEnd?(this.draftStart=i,this.draftEnd=""):e<t?this.draftStart=i:this.draftEnd=i,this.previewDate="",this.activeDate=i,this.draftEnd&&this.appliesOnPick&&this.onApply()}commitValue(e,t={}){var i;const s=e!==(null!==(i=this.value)&&void 0!==i?i:"");this.timesBeforeTyping=void 0,this.committing=!0,this.value=e,this.committing=!1,this.text=this.fieldText(),this.textError="",this.updateFormValue(),s&&this.pdsDatepickerChange.emit(Object.assign({value:e},t))}commitParts(e){if(this.monthDay)return void this.commitValue(I(e[0].date));if(!this.isRange)return void this.commitValue(we(e[0]));const[t,i]=e,s=J(this.resolvedPresets,t.date,i.date);this.commitValue(`${we(t)}/${we(i)}`,Object.assign({start:we(t),end:we(i)},s?{preset:s.key}:{}))}draftParts(){var e;const t=$(this.draftStart);if(!t)return null;const i=this.withTimePicker({date:t,time:this.startTime});if(!this.isRange)return[i];const s=this.withTimePicker({date:null!==(e=$(this.draftEnd))&&void 0!==e?e:t,time:this.endTime});return[i,xe(s,i)<0?Object.assign(Object.assign({},s),{time:i.time}):s]}restoreValueAtOpen(){var e;if(this.valueAtOpen===(null!==(e=this.value)&&void 0!==e?e:""))return void this.dropTypedText();const t=this.parsedValue(this.valueAtOpen);t?this.commitParts(t):this.commitValue(this.valueAtOpen)}isInside(e){var t,i;return!!e&&(e===this.el||this.el.contains(e)||!!(null===(t=this.el.shadowRoot)||void 0===t?void 0:t.contains(e))||!!(null===(i=this.portal)||void 0===i?void 0:i.contains(e)))}focusEntered(e){this.hasFocus||(this.hasFocus=!0,this.pdsFocus.emit(e))}checkFocusLeft(e,t){window.setTimeout((()=>{var i;this.el.matches(":focus-within")||(null===(i=this.portal)||void 0===i?void 0:i.host.matches(":focus-within"))||(t&&this.closeCalendar(!1),this.hasFocus&&(this.hasFocus=!1,this.pdsBlur.emit(e)))}))}startPositioning(){const e=this.fieldReference(),t=this.dialogEl;e&&t&&(this.cleanupAutoUpdate=a(e,t,(()=>{o(e,t,{placement:this.placement,strategy:"fixed",middleware:[d(4),l({padding:8}),h({padding:8,apply({availableWidth:e,availableHeight:t,elements:i}){const s=window.innerHeight-16;Object.assign(i.floating.style,{maxHeight:Math.max(0,Math.max(t,Math.min(s,480)))+"px",maxWidth:Math.max(0,e)+"px"})}}),c({padding:8,crossAxis:!0}),p()]}).then((({x:e,y:i,middlewareData:s})=>{var r;const n=!!(null===(r=s.hide)||void 0===r?void 0:r.referenceHidden);Object.assign(t.style,{left:e+"px",top:i+"px",visibility:n?"hidden":"visible"}),this.flushActiveDayFocus()}))})))}stopPositioning(){var e;null===(e=this.cleanupAutoUpdate)||void 0===e||e.call(this),this.cleanupAutoUpdate=void 0}fieldReference(){var e,t,i;return null!==(i=null===(t=null===(e=this.inputEl)||void 0===e?void 0:e.shadowRoot)||void 0===t?void 0:t.querySelector(".pds-input__field-wrapper"))&&void 0!==i?i:this.inputEl}commitPendingText(){if(this.text===this.fieldText())return;const e=this.parseText(this.text)?this.draftParts():null;e?this.commitParts(e):this.commitText()}readText(e){const t=this.resolvedFormat,i=this.resolvedLocale,s=this.monthDay?[_e(e,t,i)]:this.isRange?ye(e,t,i):[ge(e,t,i)];return!s||s.some((e=>!e))?null:s.map(((e,t)=>this.withTimePicker(e,1===t?Ye:Le)))}parseText(e){const t=this.readText(e);return t&&!this.rangeError(t)?t:null}rangeError(e){return this.minDate&&e.some((e=>e.date<this.minDate))?"min":this.maxDate&&e.some((e=>e.date>this.maxDate))?"max":""}valueError(){if(!this.value)return"";const e=this.parsedValue();return e?this.rangeError(e):"format"}commitText(){const e=this.text.trim();if(""===e)return void this.commitValue("");const t=this.readText(e),i=t?this.rangeError(t):"format";t&&!i?this.commitParts(t):(this.textError=i,this.updateFormValue())}canShowMonth(e){var t;const i=null!==(t=$(this.viewMonth))&&void 0!==t?t:this.now;return e<0?!this.minDate||j(i,-1)>=this.minDate:!this.maxDate||L(i,this.monthCount)<=this.maxDate}showMonth(e,t){var i,s;const r=null!==(i=$(this.viewMonth))&&void 0!==i?i:this.now,n=null!==(s=$(this.activeDate))&&void 0!==s?s:this.now;this.viewMonth=A(this.inView(L(r,t))),this.activeDate=A(H(this.inView(L(n,t)),this.minDate,this.maxDate)),this.canShowMonth(t)?e.currentTarget.focus():this.focusActiveDay=!0}jumpTo(e,t,i){var s;const r=H(new Date(Date.UTC(t,i,1)),this.minDate,this.maxDate);this.viewMonth=A(L(He(r),-e));const n=null!==(s=$(this.activeDate))&&void 0!==s?s:r,a=Math.min(n.getUTCDate(),new Date(Date.UTC(t,i+1,0)).getUTCDate());this.activeDate=A(H(new Date(Date.UTC(t,i,a)),this.minDate,this.maxDate))}dropTypedText(){this.timesBeforeTyping&&([this.startTime,this.endTime]=this.timesBeforeTyping),this.timesBeforeTyping=void 0,(this.text!==this.fieldText()||this.textError)&&(this.text=this.fieldText(),this.inputEl&&(this.inputEl.value=this.text),this.textError="",this.updateFormValue())}trapTab(e){var t,i,s,r;const n=Array.from(null!==(i=null===(t=this.dialogEl)||void 0===t?void 0:t.querySelectorAll('button:not([disabled]):not([tabindex="-1"]), select:not([disabled]), [data-date][tabindex="0"]'))&&void 0!==i?i:[]);if(0===n.length)return;const a=null===(r=null===(s=this.dialogEl)||void 0===s?void 0:s.getRootNode())||void 0===r?void 0:r.activeElement,o=n[0],d=n[n.length-1];e.shiftKey&&a===o?(e.preventDefault(),d.focus()):e.shiftKey||a!==d||(e.preventDefault(),o.focus())}dayFromEvent(e){var t,i;const s=null===(i=null===(t=e.target)||void 0===t?void 0:t.closest)||void 0===i?void 0:i.call(t,"[data-date]");return $(null==s?void 0:s.dataset.date)}updateFormValue(){var e,t,i,s;if(k()||!(null===(e=this.internals)||void 0===e?void 0:e.setFormValue))return;if(this.internals.setFormValue(this.value||null),!this.internals.setValidity)return;const r=null!==(s=null===(i=null===(t=this.inputEl)||void 0===t?void 0:t.shadowRoot)||void 0===i?void 0:i.querySelector("input"))&&void 0!==s?s:void 0,n=this.textError||this.valueError();"format"===n?this.internals.setValidity({badInput:!0},this.invalidDateMessage,r):"min"===n?this.internals.setValidity({rangeUnderflow:!0},this.boundMessage(this.minDateMessage,this.minDate),r):"max"===n?this.internals.setValidity({rangeOverflow:!0},this.boundMessage(this.maxDateMessage,this.maxDate),r):this.required&&!this.value?this.internals.setValidity({valueMissing:!0},(null==r?void 0:r.validationMessage)||this.invalidDateMessage,r):this.internals.setValidity({})}boundMessage(e,t){const i=t?De({date:t,time:null},this.format||void 0,this.resolvedLocale):"";return y(e,{date:i})}formResetCallback(){this.value="",this.text="",this.textError="",this.closeCalendar(!1),this.updateFormValue()}interactivityChanged(){this.isInteractive||this.closeCalendar(!1)}formDisabledCallback(e){this.disabled=e,e&&this.closeCalendar(!1)}formStateRestoreCallback(e){"string"==typeof e&&(this.value=e)}triggerAccessibleName(e){const t=this.parsedValue();if(!t)return this.triggerLabel;const i=t.map((t=>O(t.date,e,this.monthDay?je:Te)));return`${this.triggerLabel}, ${i.join(Me)}`}highlightedRange(){const e=$(this.draftStart),t=$(this.draftEnd);if(!e||t)return[e,t];const i=$(this.previewDate);return[e,i&&i>e?i:null]}selectedDay(){return this.isRange?null:$(this.draftStart)}renderMonthHeading(e,t,i,r){const n=O(e,i,this.monthDay?{month:"long"}:{month:"long",year:"numeric"}),a=0===t?"polite":null;if(!this.showDropdowns||this.monthDay)return s("div",{class:"pds-datepicker__heading",id:r,"aria-live":a},n);const o=e.getUTCFullYear(),d=e.getUTCMonth(),l=this.minDate,h=this.maxDate,c=T().getUTCFullYear(),p=l?l.getUTCFullYear():c-100,v=h?h.getUTCFullYear():c+100,m=S(i,{month:"long"}),b=S(i,{year:"numeric"});return s("div",{class:"pds-datepicker__dropdowns"},s("span",{class:"visually-hidden",id:r,"aria-live":a},n),s("span",{class:"pds-datepicker__select-wrap"},s("select",{class:"pds-datepicker__heading-select","aria-label":this.monthLabel,onChange:e=>this.jumpTo(t,o,Number(e.target.value))},Array.from({length:12},((e,t)=>{const i=!!l&&new Date(Date.UTC(o,t+1,0))<l||!!h&&new Date(Date.UTC(o,t,1))>h;return s("option",{value:t+"",selected:t===d,disabled:i},m.format(new Date(Date.UTC(o,t,1))))}))),s("pds-icon",{class:"pds-datepicker__select-caret",icon:u,size:"small","aria-hidden":"true"})),s("span",{class:"pds-datepicker__select-wrap"},s("select",{class:"pds-datepicker__heading-select","aria-label":this.yearLabel,onChange:e=>this.jumpTo(t,Number(e.target.value),d)},Array.from({length:Math.max(v,o)-Math.min(p,o)+1},((e,t)=>{const i=Math.min(p,o)+t;return s("option",{value:i+"",selected:i===o},b.format(new Date(Date.UTC(i,0,1))))}))),s("pds-icon",{class:"pds-datepicker__select-caret",icon:u,size:"small","aria-hidden":"true"})))}renderMonth(e,t,i){const r=e.getUTCFullYear(),n=e.getUTCMonth(),a=this.minDate,o=this.maxDate,d=this.selectedDay(),[l,h]=this.isRange?this.highlightedRange():[null,null],c=this.now,p=S(i,this.monthDay?je:Te),u=S(i,{day:"numeric"}),b=`${this.baseId}-calendar-heading-${t}`,f=t===this.monthCount-1;return s("div",{class:"pds-datepicker__month"},s("div",{class:"pds-datepicker__header"},0===t?s("button",{type:"button",class:"pds-datepicker__nav pds-datepicker__nav--previous","aria-label":this.previousMonthLabel,disabled:!this.canShowMonth(-1),onClick:e=>this.showMonth(e,-1)},s("pds-icon",{icon:v,"aria-hidden":"true"})):s("span",{class:"pds-datepicker__nav-spacer"}),this.renderMonthHeading(e,t,i,b),f?s("button",{type:"button",class:"pds-datepicker__nav pds-datepicker__nav--next","aria-label":this.nextMonthLabel,disabled:!this.canShowMonth(1),onClick:e=>this.showMonth(e,1)},s("pds-icon",{icon:m,"aria-hidden":"true"})):s("span",{class:"pds-datepicker__nav-spacer"})),s("table",{class:"pds-datepicker__grid",role:"grid","aria-labelledby":b,"aria-multiselectable":this.isRange?"true":null,onKeyDown:this.onGridKeyDown,onClick:this.onGridClick,onPointerOver:this.onGridPointerOver},!this.monthDay&&s("thead",null,s("tr",null,function(e,t){const i=S(e,{weekday:"short"}),s=S(e,{weekday:"long"}),r=Array.from({length:7},((e,i)=>new Date(Date.UTC(2023,0,1+(t+i)%7)))),n=r.map((e=>i.format(e).replace(/\.$/,""))),a=n.every((e=>/^[A-Za-z\u00C0-\u024F]+$/.test(e))),o=n.map((e=>e.slice(0,2))),d=a&&7===new Set(o.map((e=>e.toLowerCase()))).size;return r.map(((e,t)=>({short:d?o[t]:i.format(e),long:s.format(e)})))}(i,this.weekStart).map((e=>s("th",{scope:"col",class:"pds-datepicker__weekday"},s("span",{"aria-hidden":"true"},e.short),s("span",{class:"visually-hidden"},e.long)))))),s("tbody",null,(this.monthDay?function(e){const t=[];for(let i=1;i<=Y(U,e);i++)t.push(new Date(Date.UTC(U,e,i)));for(;t.length%7!=0;)t.push(null);const i=[];for(let e=0;e<t.length;e+=7)i.push(t.slice(e,e+7));return i}(n):function(e,t,i){const s=new Date(Date.UTC(e,t,1)),r=Array(E(s,i)).fill(null);for(let i=1;i<=Y(e,t);i++)r.push(new Date(Date.UTC(e,t,i)));for(;r.length%7!=0;)r.push(null);const n=[];for(let e=0;e<r.length;e+=7)n.push(r.slice(e,e+7));return n}(r,n,this.weekStart)).map((e=>s("tr",null,e.map(((e,t)=>{if(!e)return s("td",{class:"pds-datepicker__day pds-datepicker__day--empty"});const i=A(e),r=z(e,a,o),n=P(e,l)||P(e,h),v=!!l&&!!h&&!P(l,h),m=!!l&&!!h&&e>=l&&e<=h,b=P(e,d)||n||m,f=P(e,c);return s("td",{class:{"pds-datepicker__day":!0,"pds-datepicker__day--selected":P(e,d)||n,"pds-datepicker__day--in-range":m&&!n,"pds-datepicker__day--range-start":v&&P(e,l),"pds-datepicker__day--range-end":v&&P(e,h),"pds-datepicker__day--row-start":m&&0===t,"pds-datepicker__day--row-end":m&&6===t,"pds-datepicker__day--today":f,"pds-datepicker__day--disabled":r},"data-date":i,tabindex:i===this.activeDate?"0":"-1","aria-label":p.format(e),"aria-selected":b?"true":null,"aria-current":f?"date":null,"aria-disabled":r?"true":null},((e,t)=>{var i,s;return null!==(s=null===(i=e.formatToParts(t).find((e=>"day"===e.type)))||void 0===i?void 0:i.value)&&void 0!==s?s:e.format(t)})(u,e))}))))))),this.hasTime&&this.timesUnderMonth(t).map((e=>this.renderTime(e,i))))}timesUnderMonth(e){return this.isRange?1===this.monthCount?["start","end"]:[0===e?"start":"end"]:["start"]}renderTime(e,t){var i,r,n;const a="start"===e?this.startTime:null!==(n=null===(r=null===(i=this.draftParts())||void 0===i?void 0:i[1])||void 0===r?void 0:r.time)&&void 0!==n?n:this.endTime,[o,d]=Ce(a),l=Ae(t),h=Math.max(1,Math.min(60,Math.floor(this.minuteIncrement)||1)),c=(t,i)=>{const s=$e(t,i);"start"===e?this.startTime=s:this.endTime=s,this.timesBeforeTyping&&(this.timesBeforeTyping["start"===e?0:1]=s)},p=this.isRange?"start"===e?this.startTimeLabel:this.endTimeLabel:this.timeLabel,u=o>=12,v=l.hour12?Array.from({length:12},((e,t)=>t+1)):Array.from({length:24},((e,t)=>t)),m=l.hour12?o%12||12:o,b=Array.from({length:Math.ceil(60/h)},((e,t)=>t*h));b.includes(d)||b.push(d),b.sort(((e,t)=>e-t));const f=`${this.baseId}-time-${e}`;return s("div",{class:"pds-datepicker__time",role:"group","aria-labelledby":f},s("span",{class:"pds-datepicker__time-label",id:f},p),s("span",{class:"pds-datepicker__time-field"},s("select",{class:"pds-datepicker__time-select","aria-label":this.hourLabel,onChange:e=>{const t=Number(e.target.value);c(l.hour12?t%12+(u?12:0):t,d)}},v.map((e=>s("option",{value:e+"",selected:e===m},l.hour12?e+"":(e+"").padStart(2,"0"))))),s("span",{class:"pds-datepicker__time-separator","aria-hidden":"true"},":"),s("select",{class:"pds-datepicker__time-select","aria-label":this.minuteLabel,onChange:e=>c(o,Number(e.target.value))},b.map((e=>s("option",{value:e+"",selected:e===d},(e+"").padStart(2,"0"))))),l.hour12&&s("select",{class:"pds-datepicker__time-select pds-datepicker__time-select--period","aria-label":this.periodLabel,onChange:e=>{c(o%12+("pm"===e.target.value?12:0),d)}},s("option",{value:"am",selected:!u},l.am),s("option",{value:"pm",selected:u},l.pm))))}renderPresets(){var e;const t=this.resolvedPresets;if(0===t.length)return null;const i=J(t,$(this.draftStart),$(this.draftEnd)),r=!i&&!!this.draftStart,n=e=>Q(e,this.minDate,this.maxDate),a=i&&n(i)?i:r?"custom":null!==(e=t.find(n))&&void 0!==e?e:"custom";return s("div",{class:"pds-datepicker__presets-column"},s("ul",{class:"pds-datepicker__presets",part:"presets",role:"radiogroup","aria-label":this.presetsLabel,onKeyDown:this.onPresetsKeyDown},t.map((e=>{const t=e===i;return s("li",{role:"none"},s("button",{type:"button",role:"radio",class:{"pds-datepicker__preset":!0,"pds-datepicker__preset--selected":t},"aria-checked":t?"true":"false",tabindex:e===a?"0":"-1",disabled:!Q(e,this.minDate,this.maxDate),onClick:t=>this.onPresetClick(t,e)},s("span",null,e.label),t&&s("pds-icon",{icon:b,"aria-hidden":"true"})))})),s("li",{role:"none"},s("button",{type:"button",role:"radio",class:{"pds-datepicker__preset":!0,"pds-datepicker__preset--selected":r},"aria-checked":r?"true":"false",tabindex:"custom"===a?"0":"-1",onClick:this.onCustomRangeClick},s("span",null,this.customRangeLabel),r&&s("pds-icon",{icon:b,"aria-hidden":"true"})))))}selectionText(){const e=this.draftParts();if(!e)return"";const t=this.resolvedFormat,i=this.resolvedLocale;return this.isRange&&!this.draftEnd?`${De(e[0],t,i)}${Me}`:e.map((e=>De(e,t,i))).join(Me)}renderFooter(){const e=this.draftParts(),t=this.selectionText();return s("div",{class:"pds-datepicker__footer"},s("span",{class:"pds-datepicker__selection","aria-live":"polite"},t),s("button",{type:"button",class:"pds-datepicker__action",onClick:this.onCancel},this.clearable?this.clearLabel:this.cancelLabel),s("button",{type:"button",class:"pds-datepicker__action pds-datepicker__action--primary",disabled:!e,onClick:this.onApply},this.applyLabel))}renderCalendar(e){var t;const i=null!==(t=$(this.viewMonth))&&void 0!==t?t:this.now,r=Array.from({length:this.monthCount},((e,t)=>L(i,t)));return s("div",{class:{"pds-datepicker__dialog":!0,"pds-datepicker__dialog--range":this.isRange},id:this.baseId+"-calendar",role:"dialog",tabindex:"-1","aria-labelledby":this.isRange?null:this.baseId+"-calendar-heading-0","aria-label":this.isRange?this.label||this.triggerLabel:null,part:"calendar",ref:e=>this.dialogEl=e,onKeyDown:this.onDialogKeyDown,onFocusin:this.onCalendarFocusIn,onFocusout:this.onCalendarFocusOut},this.isRange&&this.renderPresets(),s("div",{class:"pds-datepicker__panel"},s("div",{class:"pds-datepicker__months"},r.map(((t,i)=>this.renderMonth(t,i,e)))),this.hasFooter&&this.renderFooter(),this.appliesOnPick&&s("span",{class:"visually-hidden","aria-live":"polite"},this.selectionText())))}render(){const e=this.resolvedLocale;return s(r,{key:"d40bce6136eca084b23d38d995010592bfd702bd",class:{"pds-datepicker--range":this.isRange,"pds-datepicker--time":this.hasTime},"full-width":this.fullWidth?"true":null,onFocusin:this.onHostFocusIn,onFocusout:this.onHostFocusOut},s("pds-input",{key:"a047df90ca3e013a2eeb1f88e8fb033b24754f0d",ref:e=>this.inputEl=e,componentId:this.baseId,label:this.label,hideLabel:this.hideLabel,helperMessage:this.helperMessage,errorMessage:this.errorMessage,invalid:this.invalid||!!this.textError||!!this.valueError(),disabled:this.disabled,readonly:this.readonly,required:this.required,placeholder:this.fieldPlaceholder,fullWidth:this.fullWidth,autocomplete:"off",value:this.text,onClick:this.onFieldClick,onPdsInput:this.onTextInput,onPdsChange:this.onTextChange,onPdsKeyDown:this.onTextKeyDown,onPdsFocus:this.stopInnerEvent,onPdsBlur:this.stopInnerEvent},this.clearable&&!!this.value&&this.isInteractive&&s("button",{key:"clear",slot:"suffix",type:"button",class:"pds-datepicker__clear",ref:e=>this.clearEl=e,"aria-label":this.label?`${this.clearLabel} ${this.label}`:this.clearLabel,tabindex:"-1",onMouseDown:this.onClearMouseDown,onClick:this.onClearClick},s("pds-icon",{key:"934fc6303da1dca04cb073c5875a0f9fc286fdd1",icon:f,"aria-hidden":"true"})),s("button",{key:"trigger",slot:"suffix",type:"button",class:"pds-datepicker__trigger",ref:e=>this.triggerEl=e,"aria-label":this.triggerAccessibleName(e),"aria-haspopup":"dialog","aria-expanded":this.isOpen?"true":"false",disabled:!this.isInteractive,onClick:this.onTriggerClick,onKeyDown:this.onTriggerKeyDown},s("pds-icon",{key:"75ab4fc79ce9f95e7ee6555763166d800a2f1135",icon:g,"aria-hidden":"true"}))),this.isOpen&&this.renderCalendar(e))}static get formAssociated(){return!0}get el(){return this}static get watchers(){return{value:[{valueChanged:0}],format:[{contextChanged:0}],locale:[{contextChanged:0}],timePicker:[{contextChanged:0}],range:[{contextChanged:0}],monthDay:[{contextChanged:0}],min:[{contextChanged:0}],max:[{contextChanged:0}],placement:[{placementChanged:0}],required:[{requiredChanged:0}],disabled:[{interactivityChanged:0}],readonly:[{interactivityChanged:0}]}}static get style(){return':host{--pds-datepicker-day-size:var(--pine-dimension-500);--pds-datepicker-presets-width:200px;display:inline-block}:host([full-width]){display:block}pds-input{display:block}:host(.pds-datepicker--time) pds-input{min-width:220px}:host(.pds-datepicker--range) pds-input{min-width:260px}:host(.pds-datepicker--range.pds-datepicker--time) pds-input{min-width:min(380px, 100%)}.pds-datepicker__trigger,.pds-datepicker__clear{-ms-flex-align:center;align-items:center;background:transparent;border:0;border-radius:var(--pine-border-radius-sm);color:var(--pine-color-text-secondary);cursor:pointer;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-pack:center;justify-content:center;padding:var(--pine-dimension-2xs)}.pds-datepicker__trigger:hover:not(:disabled),.pds-datepicker__clear:hover:not(:disabled){background:var(--pine-color-background-muted);color:var(--pine-color-text-strong)}.pds-datepicker__trigger:focus-visible,.pds-datepicker__clear:focus-visible{outline:var(--pine-outline-focus)}.pds-datepicker__trigger:disabled,.pds-datepicker__clear:disabled{color:var(--pine-color-text-disabled);cursor:not-allowed}.pds-datepicker__clear{-webkit-margin-end:var(--pine-dimension-2xs);margin-inline-end:var(--pine-dimension-2xs)}.pds-datepicker__nav{-ms-flex-align:center;align-items:center;background: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(--pine-color-text-secondary);cursor:pointer;display:-ms-inline-flexbox;display:inline-flex;height:var(--pine-dimension-400);-ms-flex-pack:center;justify-content:center;padding:0;width:var(--pine-dimension-400)}.pds-datepicker__nav:hover:not(:disabled){background:var(--pine-color-secondary-hover);border-color:var(--pine-color-border-hover)}.pds-datepicker__nav:focus-visible{outline:var(--pine-outline-focus);outline-offset:var(--pine-border-width)}.pds-datepicker__nav:disabled{border-color:var(--pine-color-border-disabled);color:var(--pine-color-text-secondary-disabled);cursor:not-allowed}.pds-datepicker__nav:dir(rtl) pds-icon{-webkit-transform:scaleX(-1);transform:scaleX(-1)}.pds-datepicker__dialog:focus{outline:none}.pds-datepicker__dialog{background:var(--pine-color-background-overlay);border-radius:var(--pine-dimension-150);-webkit-box-shadow:var(--pine-box-shadow-200);box-shadow:var(--pine-box-shadow-200);-webkit-box-sizing:border-box;box-sizing:border-box;left:0;max-height:calc(100vh - var(--pine-dimension-sm));max-height:calc(100dvh - var(--pine-dimension-sm));max-width:calc(100vw - var(--pine-dimension-sm));overflow:auto;-ms-scroll-chaining:none;overscroll-behavior:contain;padding:var(--pine-dimension-sm);pointer-events:auto;position:fixed;top:0;visibility:hidden;z-index:var(--pine-z-index-priority)}:host-context([data-theme=dark]) .pds-datepicker__dialog{border:var(--pine-border)}.pds-datepicker__header{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-webkit-margin-after:var(--pine-dimension-sm);margin-block-end:var(--pine-dimension-sm)}.pds-datepicker__nav-spacer{-ms-flex:none;flex:none;width:var(--pine-dimension-400)}.pds-datepicker__heading{color:var(--pine-color-text);font:var(--pine-typography-heading-5);font-weight:var(--pine-font-weight-semi-bold)}.pds-datepicker__grid{border-collapse:collapse;border-spacing:0}.pds-datepicker__weekday{color:var(--pine-color-text-muted);font:var(--pine-typography-body-sm);height:var(--pds-datepicker-day-size);padding:0;text-align:center;width:var(--pds-datepicker-day-size)}.pds-datepicker__day{border-radius:var(--pine-border-radius-full);color:var(--pine-color-text-secondary);cursor:pointer;font:var(--pine-typography-body);height:var(--pds-datepicker-day-size);padding:0;position:relative;text-align:center;-webkit-transition:background var(--pine-motion-duration-fast) var(--pine-motion-easing-in);transition:background var(--pine-motion-duration-fast) var(--pine-motion-easing-in);width:var(--pds-datepicker-day-size)}.pds-datepicker__day:hover{background:var(--pine-color-background-muted)}.pds-datepicker__day:focus-visible{outline:var(--pine-outline-focus);outline-offset:calc(var(--pine-border-width-thick) * -1)}.pds-datepicker__day--empty{cursor:default;pointer-events:none}.pds-datepicker__day--today::after{background:var(--pine-color-primary);border-radius:var(--pine-border-radius-full);content:"";height:var(--pine-dimension-050);inset-block-end:var(--pine-dimension-050);inset-inline-start:50%;position:absolute;-webkit-transform:translateX(-50%);transform:translateX(-50%);width:var(--pine-dimension-050)}.pds-datepicker__day--selected,.pds-datepicker__day--selected:hover{background:var(--pine-color-primary);color:var(--pine-color-text-primary)}.pds-datepicker__day--selected:focus-visible{outline-offset:var(--pine-border-width)}.pds-datepicker__day--range-start{border-end-end-radius:0;border-start-end-radius:0}.pds-datepicker__day--range-end{border-end-start-radius:0;border-start-start-radius:0}.pds-datepicker__day--range-start.pds-datepicker__day--row-end{border-end-end-radius:var(--pine-border-radius-full);border-start-end-radius:var(--pine-border-radius-full)}.pds-datepicker__day--range-end.pds-datepicker__day--row-start{border-end-start-radius:var(--pine-border-radius-full);border-start-start-radius:var(--pine-border-radius-full)}.pds-datepicker__day--selected.pds-datepicker__day--today::after{background:var(--pine-color-text-primary)}.pds-datepicker__day--in-range{border-radius:0}.pds-datepicker__day--in-range,.pds-datepicker__day--in-range:hover{background:var(--pine-color-background-muted);color:var(--pine-color-text-secondary)}.pds-datepicker__day--row-start{border-end-start-radius:var(--pine-border-radius-full);border-start-start-radius:var(--pine-border-radius-full)}.pds-datepicker__day--row-end{border-end-end-radius:var(--pine-border-radius-full);border-start-end-radius:var(--pine-border-radius-full)}.pds-datepicker__day--disabled,.pds-datepicker__day--disabled:hover{background:transparent;color:var(--pine-color-text-disabled);cursor:not-allowed;text-decoration:line-through}.pds-datepicker__day--in-range:hover{background:var(--pine-color-background-inset)}.pds-datepicker__dialog--range{display:-ms-flexbox;display:flex;padding:0}.pds-datepicker__panel{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;min-width:0}.pds-datepicker__dialog--range .pds-datepicker__panel{padding:var(--pine-dimension-sm)}.pds-datepicker__months{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:var(--pine-dimension-lg)}.pds-datepicker__presets-column{-webkit-border-end:var(--pine-border-width-thin) solid var(--pine-color-border-subtle);border-inline-end:var(--pine-border-width-thin) solid var(--pine-color-border-subtle);-ms-flex:none;flex:none;position:relative;width:var(--pds-datepicker-presets-width)}.pds-datepicker__presets{-webkit-box-sizing:border-box;box-sizing:border-box;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--pine-dimension-2xs);inset:0;list-style:none;margin:0;overflow-y:auto;padding:var(--pine-dimension-150);position:absolute}.pds-datepicker__preset{-ms-flex-align:center;align-items:center;background:transparent;border:0;border-radius:var(--pine-border-radius-md);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-sm);text-align:start;-webkit-transition:background var(--pine-motion-duration-fast) var(--pine-motion-easing-in);transition:background var(--pine-motion-duration-fast) var(--pine-motion-easing-in);width:100%}.pds-datepicker__preset:hover:not(:disabled){background:var(--pine-color-background-muted)}.pds-datepicker__preset:focus-visible{outline:var(--pine-outline-focus)}.pds-datepicker__preset:disabled{color:var(--pine-color-text-disabled);cursor:not-allowed}.pds-datepicker__preset--selected{background:var(--pine-color-background-muted);color:var(--pine-color-text-active)}.pds-datepicker__footer{-ms-flex-align:center;align-items:center;background:var(--pine-color-background-overlay);-webkit-border-before:var(--pine-border-width-thin) solid var(--pine-color-border-subtle);border-block-start:var(--pine-border-width-thin) solid var(--pine-color-border-subtle);display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:var(--pine-dimension-xs);inset-block-end:calc(var(--pine-dimension-sm) * -1);-ms-flex-pack:end;justify-content:flex-end;margin-block:var(--pine-dimension-sm) calc(var(--pine-dimension-sm) * -1);padding-block:var(--pine-dimension-sm);position:-webkit-sticky;position:sticky}.pds-datepicker__selection{color:var(--pine-color-text-muted);font:var(--pine-typography-body-sm-medium);-webkit-margin-end:auto;margin-inline-end:auto}.pds-datepicker__dropdowns{display:-ms-flexbox;display:flex;gap:var(--pine-dimension-2xs)}.pds-datepicker__select-wrap{-ms-flex-align:center;align-items:center;display:-ms-inline-flexbox;display:inline-flex;position:relative}.pds-datepicker__heading-select{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;border:0;border-radius:var(--pine-border-radius-md);color:var(--pine-color-text);cursor:pointer;field-sizing:content;font:var(--pine-typography-heading-5);font-weight:var(--pine-font-weight-semi-bold);padding-block:var(--pine-dimension-2xs);padding-inline:var(--pine-dimension-xs) calc(var(--pine-dimension-xs) + var(--pine-dimension-sm))}.pds-datepicker__heading-select:hover{background:var(--pine-color-background-muted)}.pds-datepicker__heading-select:focus-visible{outline:var(--pine-outline-focus)}.pds-datepicker__select-caret{color:var(--pine-color-text-secondary);inset-inline-end:var(--pine-dimension-xs);pointer-events:none;position:absolute}.pds-datepicker__time{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;gap:var(--pine-dimension-xs);-ms-flex-pack:justify;justify-content:space-between;-webkit-margin-before:var(--pine-dimension-sm);margin-block-start:var(--pine-dimension-sm);padding-inline:var(--pine-dimension-xs)}.pds-datepicker__time-label{color:var(--pine-color-text-label);font:var(--pine-typography-body-medium)}.pds-datepicker__time-field{-ms-flex-align:center;align-items:center;background:var(--pine-color-background-container);border:var(--pine-border);border-radius:var(--pine-border-radius-md);display:-ms-inline-flexbox;display:inline-flex;min-height:var(--pine-dimension-400);padding-inline:var(--pine-dimension-2xs)}.pds-datepicker__time-field:hover{border-color:var(--pine-color-border-hover)}.pds-datepicker__time-field:focus-within{outline:var(--pine-outline-focus);outline-offset:var(--pine-border-width)}.pds-datepicker__time-select{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;border:0;border-radius:var(--pine-border-radius-sm);color:var(--pine-color-text-strong);cursor:pointer;font:var(--pine-typography-body);font-variant-numeric:tabular-nums;padding:var(--pine-dimension-2xs);text-align:center}.pds-datepicker__time-select:focus-visible{background:var(--pine-color-background-muted);outline:none}.pds-datepicker__time-select--period{-webkit-margin-start:var(--pine-dimension-2xs);margin-inline-start:var(--pine-dimension-2xs)}.pds-datepicker__time-separator{color:var(--pine-color-text-secondary)}:host-context([data-theme=dark]) select{color-scheme:dark}.pds-datepicker__action{background:var(--pine-color-secondary);border:var(--pine-border);border-radius:var(--pine-border-radius-full);color:var(--pine-color-text-secondary);cursor:pointer;font:var(--pine-typography-body-medium);padding:calc(var(--pine-dimension-xs) - var(--pine-border-width)) var(--pine-dimension-sm)}.pds-datepicker__action:hover:not(:disabled){background:var(--pine-color-secondary-hover);border-color:var(--pine-color-border-hover)}.pds-datepicker__action:focus-visible{outline:var(--pine-outline-focus);outline-offset:var(--pine-border-width)}.pds-datepicker__action:disabled{background:var(--pine-color-secondary-disabled);border-color:var(--pine-color-border-disabled);color:var(--pine-color-text-secondary-disabled);cursor:not-allowed}.pds-datepicker__action--primary{background:var(--pine-color-primary);border-color:var(--pine-color-primary);color:var(--pine-color-text-primary)}.pds-datepicker__action--primary:hover:not(:disabled){background:var(--pine-color-primary-hover);border-color:var(--pine-color-primary-hover)}.pds-datepicker__action--primary:disabled{background:var(--pine-color-primary-disabled);border-color:var(--pine-color-primary-disabled);color:var(--pine-color-text-primary-disabled)}@media (max-width: 600px){.pds-datepicker__dialog--range{-ms-flex-direction:column;flex-direction:column}.pds-datepicker__presets-column{-webkit-border-after:var(--pine-border-width-thin) solid var(--pine-color-border-subtle);border-block-end:var(--pine-border-width-thin) solid var(--pine-color-border-subtle);-webkit-border-end:0;border-inline-end:0;width:auto}.pds-datepicker__presets{-ms-flex-direction:row;flex-direction:row;overflow-x:auto;position:static}.pds-datepicker__preset{white-space:nowrap}.pds-datepicker__selection{-ms-flex-preferred-size:100%;flex-basis:100%}}.pds-datepicker__trigger,.pds-datepicker__clear,.pds-datepicker__nav,.pds-datepicker__weekday,.pds-datepicker__day,.pds-datepicker__preset,.pds-datepicker__action{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}@media (forced-colors: active){.pds-datepicker__day--selected,.pds-datepicker__day--selected:hover{background:Highlight;color:HighlightText;forced-color-adjust:none}.pds-datepicker__day--in-range,.pds-datepicker__day--in-range:hover{border-block:var(--pine-border-width-thin) solid Highlight}.pds-datepicker__day--today::after{background:CanvasText;forced-color-adjust:none}.pds-datepicker__day--selected.pds-datepicker__day--today::after{background:HighlightText}.pds-datepicker__day--disabled{color:GrayText}}.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}'}},[65,"pds-datepicker",{applyLabel:[1,"apply-label"],autoApply:[4,"auto-apply"],cancelLabel:[1,"cancel-label"],clearable:[4],clearLabel:[1,"clear-label"],componentId:[1,"component-id"],customRangeLabel:[1,"custom-range-label"],disabled:[4],endTimeLabel:[1,"end-time-label"],errorMessage:[1,"error-message"],firstDayOfWeek:[2,"first-day-of-week"],format:[1],fullWidth:[4,"full-width"],helperMessage:[1,"helper-message"],hideLabel:[4,"hide-label"],hourLabel:[1,"hour-label"],invalid:[4],invalidDateMessage:[1,"invalid-date-message"],maxDateMessage:[1,"max-date-message"],minDateMessage:[1,"min-date-message"],label:[1],locale:[1],max:[1],min:[1],minuteIncrement:[2,"minute-increment"],minuteLabel:[1,"minute-label"],monthLabel:[1,"month-label"],monthDay:[4,"month-day"],name:[1],nextMonthLabel:[1,"next-month-label"],periodLabel:[1,"period-label"],placeholder:[1],placement:[1],presets:[1],presetsLabel:[1,"presets-label"],previousMonthLabel:[1,"previous-month-label"],range:[4],readonly:[4],required:[4],showDropdowns:[4,"show-dropdowns"],startTimeLabel:[1,"start-time-label"],timePicker:[4,"time-picker"],timeLabel:[1,"time-label"],triggerLabel:[1,"trigger-label"],value:[1025],yearLabel:[1,"year-label"],isOpen:[32],text:[32],textError:[32],activeDate:[32],viewMonth:[32],draftStart:[32],draftEnd:[32],startTime:[32],endTime:[32],previewDate:[32],open:[64],close:[64],setFocus:[64]},void 0,{value:[{valueChanged:0}],format:[{contextChanged:0}],locale:[{contextChanged:0}],timePicker:[{contextChanged:0}],range:[{contextChanged:0}],monthDay:[{contextChanged:0}],min:[{contextChanged:0}],max:[{contextChanged:0}],placement:[{placementChanged:0}],required:[{requiredChanged:0}],disabled:[{interactivityChanged:0}],readonly:[{interactivityChanged:0}]}]),Ee=ze,Se=function(){"undefined"!=typeof customElements&&["pds-datepicker","pds-icon","pds-input"].forEach((e=>{switch(e){case"pds-datepicker":customElements.get(n(e))||customElements.define(n(e),ze);break;case"pds-icon":customElements.get(n(e))||D();break;case"pds-input":customElements.get(n(e))||M()}}))};export{Ee as PdsDatepicker,Se as defineCustomElement}
@@ -1 +1 @@
1
- import{proxyCustomElement as e,HTMLElement as t,h as n,transformTag as o}from"@stencil/core/internal/client";import{u as r}from"./reconnected-content.js";const d=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost()}componentDidRender(){r(this.el.querySelector(".pds-drawer-content"),".pds-drawer-content")}render(){return n("div",{key:"b15b087506c1292f9d67e531e8d935069749c09d",class:"pds-drawer-content"},n("slot",{key:"9c60ca75c7905e7e994f9c41eee213b962afb833"}))}get el(){return this}static get style(){return"pds-drawer-content{display:block;-ms-flex:1 1 auto;flex:1 1 auto;min-height:0;width:100%}.pds-drawer-content{-webkit-box-sizing:border-box;box-sizing:border-box;display:block;height:100%;padding:var(--pine-dimension-md);width:100%}.pds-modal--scrollable pds-drawer-content{overflow-y:auto}.pds-modal:not(.pds-modal--scrollable) pds-drawer-content{overflow-y:visible}"}},[260,"pds-drawer-content"]),s=d,c=function(){"undefined"!=typeof customElements&&["pds-drawer-content"].forEach((e=>{"pds-drawer-content"===e&&(customElements.get(o(e))||customElements.define(o(e),d))}))};export{s as PdsDrawerContent,c as defineCustomElement}
1
+ import{proxyCustomElement as e,HTMLElement as t,h as n,transformTag as o}from"@stencil/core/internal/client";import{u as d}from"./reconnected-content.js";const r=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost()}componentDidRender(){d(this.el.querySelector(".pds-drawer-content"),".pds-drawer-content")}render(){return n("div",{key:"0d59724de849bc2364d88c4460f70f8b1efa5d1b",class:"pds-drawer-content"},n("slot",{key:"83782b9b4ad99f8075809c9e63d8351fa6109b11"}))}get el(){return this}static get style(){return"pds-drawer-content{display:block;-ms-flex:1 1 auto;flex:1 1 auto;min-height:0;width:100%}.pds-drawer-content{-webkit-box-sizing:border-box;box-sizing:border-box;display:block;height:100%;padding:var(--pine-dimension-md);width:100%}.pds-modal--scrollable pds-drawer-content{overflow-y:auto}.pds-modal:not(.pds-modal--scrollable) pds-drawer-content{overflow-y:visible}"}},[260,"pds-drawer-content"]),s=r,c=function(){"undefined"!=typeof customElements&&["pds-drawer-content"].forEach((e=>{"pds-drawer-content"===e&&(customElements.get(o(e))||customElements.define(o(e),r))}))};export{s as PdsDrawerContent,c as defineCustomElement}
@@ -1 +1 @@
1
- import{proxyCustomElement as e,HTMLElement as r,h as o,transformTag as t}from"@stencil/core/internal/client";import{u as d}from"./reconnected-content.js";const s=e(class extends r{constructor(e){super(),!1!==e&&this.__registerHost()}componentDidRender(){d(this.el.querySelector(".pds-drawer__footer"),".pds-drawer__footer")}render(){return o("footer",{key:"a4eec0aff617c605b94f8d3b9ec1e2d98cded6fb",class:"pds-drawer__footer"},o("slot",{key:"6dc379c940e37edfd05d99728be9dff58ca1d717"}))}get el(){return this}static get style(){return"pds-drawer-footer{display:block;-ms-flex:0 0 auto;flex:0 0 auto;width:100%}.pds-drawer__footer{-webkit-border-before:1px solid var(--pine-color-border-subtle);border-block-start:1px solid var(--pine-color-border-subtle);-webkit-box-sizing:border-box;box-sizing:border-box;display:-ms-flexbox;display:flex;gap:var(--pine-dimension-sm);-ms-flex-pack:end;justify-content:flex-end;padding:var(--pine-dimension-md);width:100%}"}},[260,"pds-drawer-footer"]),n=s,i=function(){"undefined"!=typeof customElements&&["pds-drawer-footer"].forEach((e=>{"pds-drawer-footer"===e&&(customElements.get(t(e))||customElements.define(t(e),s))}))};export{n as PdsDrawerFooter,i as defineCustomElement}
1
+ import{proxyCustomElement as e,HTMLElement as r,h as o,transformTag as t}from"@stencil/core/internal/client";import{u as d}from"./reconnected-content.js";const s=e(class extends r{constructor(e){super(),!1!==e&&this.__registerHost()}componentDidRender(){d(this.el.querySelector(".pds-drawer__footer"),".pds-drawer__footer")}render(){return o("footer",{key:"1345b87580b1931d7c541fac71c0dff33b6cfbf9",class:"pds-drawer__footer"},o("slot",{key:"638fa6bd14d28e814e0e40b02efb1b74f89f51dd"}))}get el(){return this}static get style(){return"pds-drawer-footer{display:block;-ms-flex:0 0 auto;flex:0 0 auto;width:100%}.pds-drawer__footer{-webkit-border-before:1px solid var(--pine-color-border-subtle);border-block-start:1px solid var(--pine-color-border-subtle);-webkit-box-sizing:border-box;box-sizing:border-box;display:-ms-flexbox;display:flex;gap:var(--pine-dimension-sm);-ms-flex-pack:end;justify-content:flex-end;padding:var(--pine-dimension-md);width:100%}"}},[260,"pds-drawer-footer"]),n=s,i=function(){"undefined"!=typeof customElements&&["pds-drawer-footer"].forEach((e=>{"pds-drawer-footer"===e&&(customElements.get(t(e))||customElements.define(t(e),s))}))};export{n as PdsDrawerFooter,i as defineCustomElement}
@@ -1 +1 @@
1
- import{proxyCustomElement as e,HTMLElement as r,h as d,transformTag as t}from"@stencil/core/internal/client";import{u as s}from"./reconnected-content.js";const o=e(class extends r{constructor(e){super(),!1!==e&&this.__registerHost()}componentDidRender(){s(this.el.querySelector(".pds-drawer__header"),".pds-drawer__header")}render(){return d("header",{key:"6b9338e5dbf7a7e580c11b28c95ca53693528382",class:"pds-drawer__header"},d("slot",{key:"0990fbcf94c0c438b98cf1e8945f1e2fd9aa33dc"}))}get el(){return this}static get style(){return"pds-drawer-header{display:block;-ms-flex:0 0 auto;flex:0 0 auto;width:100%}.pds-drawer__header{-ms-flex-align:center;align-items:center;-webkit-border-after:1px solid var(--pine-color-border-subtle);border-block-end:1px solid var(--pine-color-border-subtle);-webkit-box-sizing:border-box;box-sizing:border-box;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;padding:var(--pine-dimension-md);width:100%}"}},[260,"pds-drawer-header"]),n=o,a=function(){"undefined"!=typeof customElements&&["pds-drawer-header"].forEach((e=>{"pds-drawer-header"===e&&(customElements.get(t(e))||customElements.define(t(e),o))}))};export{n as PdsDrawerHeader,a as defineCustomElement}
1
+ import{proxyCustomElement as e,HTMLElement as r,h as d,transformTag as t}from"@stencil/core/internal/client";import{u as s}from"./reconnected-content.js";const o=e(class extends r{constructor(e){super(),!1!==e&&this.__registerHost()}componentDidRender(){s(this.el.querySelector(".pds-drawer__header"),".pds-drawer__header")}render(){return d("header",{key:"6354f36d59e608a85c3cb75d1e5cf04c48dd7045",class:"pds-drawer__header"},d("slot",{key:"2c9d8a405c8850588377553f3d9a19790828cba7"}))}get el(){return this}static get style(){return"pds-drawer-header{display:block;-ms-flex:0 0 auto;flex:0 0 auto;width:100%}.pds-drawer__header{-ms-flex-align:center;align-items:center;-webkit-border-after:1px solid var(--pine-color-border-subtle);border-block-end:1px solid var(--pine-color-border-subtle);-webkit-box-sizing:border-box;box-sizing:border-box;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;padding:var(--pine-dimension-md);width:100%}"}},[260,"pds-drawer-header"]),n=o,a=function(){"undefined"!=typeof customElements&&["pds-drawer-header"].forEach((e=>{"pds-drawer-header"===e&&(customElements.get(t(e))||customElements.define(t(e),o))}))};export{n as PdsDrawerHeader,a as defineCustomElement}
@@ -1 +1 @@
1
- import{proxyCustomElement as d,HTMLElement as s,createEvent as e,h as r,Host as a,transformTag as o}from"@stencil/core/internal/client";import{a as t,c as p}from"./closest.js";import{u as i}from"./reconnected-content.js";import{d as l}from"./pds-modal2.js";const n=".pds-popover, .pds-tooltip, .pds-combobox-dropdown-portal",m=d(class extends s{constructor(d){super(),!1!==d&&this.__registerHost(),this.pdsDrawerOpen=e(this,"pdsDrawerOpen",7),this.pdsDrawerClose=e(this,"pdsDrawerClose",7),this.open=!1,this.side="end",this.size="md",this.scrollable=!0,this.modal=!1,this.lightDismiss=!0,this.initialFocus="auto"}componentDidRender(){i(this.el.querySelector("pds-modal.pds-drawer__modal .pds-modal"),"pds-modal.pds-drawer__modal",".pds-modal")}handleModalClose(d){d.target===this.modalEl&&(this.open=!1,this.pdsDrawerClose.emit())}handleModalOpen(d){d.target===this.modalEl&&this.pdsDrawerOpen.emit()}handleOutsidePointerDown(d){if(this.modal||!this.lightDismiss||!this.open)return;const s=d.target;if(!s)return;if(this.el.contains(s))return;if(s.closest(n))return;const e=s.closest(".pds-datepicker-calendar-portal"),r=null==e?void 0:e.pdsDatepicker;r&&(t(this.el,r)||p(n,r))||s.closest("pds-modal")||(this.open=!1)}render(){return r(a,{key:"7cf13256457914e48e8fde422832a2a52ee0c13b",class:{"pds-drawer":!0,["pds-drawer--"+this.side]:!0,["pds-drawer--"+this.size]:!0}},r("pds-modal",{key:"d4ceb5b4c0b03930aa3d001ae1bbbfbf449bde33",class:{"pds-drawer__modal":!0,"pds-drawer__modal--modal":this.modal},ref:d=>this.modalEl=d,componentId:this.componentId,open:this.open,scrollable:this.scrollable,disableTopLayer:!this.modal,backdropDismiss:this.lightDismiss,disableInitialFocus:!this.modal&&"none"===this.initialFocus},r("slot",{key:"41bfdea76282b333ca6950048999cb9d94e69438"})))}get el(){return this}static get style(){return".pds-drawer__modal>.pds-modal__backdrop{-ms-flex-align:stretch;align-items:stretch}.pds-drawer__modal:not(.pds-drawer__modal--modal)>.pds-modal__backdrop{background-color:transparent;pointer-events:none}@supports ((-webkit-backdrop-filter: blur(3px)) or (backdrop-filter: blur(3px))){.pds-drawer__modal:not(.pds-drawer__modal--modal)>.pds-modal__backdrop{-webkit-backdrop-filter:none;backdrop-filter:none}}.pds-drawer__modal:not(.pds-drawer__modal--modal)>.pds-modal__backdrop>*{pointer-events:auto}.pds-drawer__modal>.pds-modal__backdrop[aria-modal]::before{content:none}.pds-drawer__modal>.pds-modal__backdrop>.pds-modal{border-radius:0;height:100%;margin:0;max-height:100%;max-width:100%;pointer-events:auto;width:var(--pds-drawer-width, 500px)}.pds-drawer{display:contents}.pds-drawer.pds-drawer--end .pds-drawer__modal>.pds-modal__backdrop{-ms-flex-pack:end;justify-content:flex-end}.pds-drawer.pds-drawer--start .pds-drawer__modal>.pds-modal__backdrop{-ms-flex-pack:start;justify-content:flex-start}.pds-drawer.pds-drawer--sm{--pds-drawer-width:360px}.pds-drawer.pds-drawer--md{--pds-drawer-width:500px}"}},[260,"pds-drawer",{componentId:[1,"component-id"],open:[1028],side:[1],size:[1],scrollable:[4],modal:[4],lightDismiss:[4,"light-dismiss"],initialFocus:[1,"initial-focus"]},[[0,"pdsModalClose","handleModalClose"],[0,"pdsModalOpen","handleModalOpen"],[5,"pointerdown","handleOutsidePointerDown"]]]),c=m,h=function(){"undefined"!=typeof customElements&&["pds-drawer","pds-modal"].forEach((d=>{switch(d){case"pds-drawer":customElements.get(o(d))||customElements.define(o(d),m);break;case"pds-modal":customElements.get(o(d))||l()}}))};export{c as PdsDrawer,h as defineCustomElement}
1
+ import{proxyCustomElement as d,HTMLElement as s,createEvent as e,h as r,Host as a,transformTag as o}from"@stencil/core/internal/client";import{a as t,c as p}from"./closest.js";import{u as i}from"./reconnected-content.js";import{d as l}from"./pds-modal2.js";const n=".pds-popover, .pds-tooltip, .pds-combobox-dropdown-portal",m=d(class extends s{constructor(d){super(),!1!==d&&this.__registerHost(),this.pdsDrawerOpen=e(this,"pdsDrawerOpen",7),this.pdsDrawerClose=e(this,"pdsDrawerClose",7),this.open=!1,this.side="end",this.size="md",this.scrollable=!0,this.modal=!1,this.lightDismiss=!0,this.initialFocus="auto"}componentDidRender(){i(this.el.querySelector("pds-modal.pds-drawer__modal .pds-modal"),"pds-modal.pds-drawer__modal",".pds-modal")}handleModalClose(d){d.target===this.modalEl&&(this.open=!1,this.pdsDrawerClose.emit())}handleModalOpen(d){d.target===this.modalEl&&this.pdsDrawerOpen.emit()}handleOutsidePointerDown(d){if(this.modal||!this.lightDismiss||!this.open)return;const s=d.target;if(!s)return;if(this.el.contains(s))return;if(s.closest(n))return;const e=s.closest(".pds-datepicker-calendar-portal"),r=null==e?void 0:e.pdsDatepicker;r&&(t(this.el,r)||p(n,r))||s.closest("pds-modal")||(this.open=!1)}render(){return r(a,{key:"dda3f1dc3013f28a3fc8d1894609dd4b14d227ee",class:{"pds-drawer":!0,["pds-drawer--"+this.side]:!0,["pds-drawer--"+this.size]:!0}},r("pds-modal",{key:"3188b99ffb9b3ecb3eeb42fd3ba808d71c652b4f",class:{"pds-drawer__modal":!0,"pds-drawer__modal--modal":this.modal},ref:d=>this.modalEl=d,componentId:this.componentId,open:this.open,scrollable:this.scrollable,disableTopLayer:!this.modal,backdropDismiss:this.lightDismiss,disableInitialFocus:!this.modal&&"none"===this.initialFocus},r("slot",{key:"ca4cd34297b4580d554edb45bfbec5b44d7d1fb0"})))}get el(){return this}static get style(){return".pds-drawer__modal>.pds-modal__backdrop{-ms-flex-align:stretch;align-items:stretch}.pds-drawer__modal:not(.pds-drawer__modal--modal)>.pds-modal__backdrop{background-color:transparent;pointer-events:none}@supports ((-webkit-backdrop-filter: blur(3px)) or (backdrop-filter: blur(3px))){.pds-drawer__modal:not(.pds-drawer__modal--modal)>.pds-modal__backdrop{-webkit-backdrop-filter:none;backdrop-filter:none}}.pds-drawer__modal:not(.pds-drawer__modal--modal)>.pds-modal__backdrop>*{pointer-events:auto}.pds-drawer__modal>.pds-modal__backdrop[aria-modal]::before{content:none}.pds-drawer__modal>.pds-modal__backdrop>.pds-modal{border-radius:0;height:100%;margin:0;max-height:100%;max-width:100%;pointer-events:auto;width:var(--pds-drawer-width, 500px)}.pds-drawer{display:contents}.pds-drawer.pds-drawer--end .pds-drawer__modal>.pds-modal__backdrop{-ms-flex-pack:end;justify-content:flex-end}.pds-drawer.pds-drawer--start .pds-drawer__modal>.pds-modal__backdrop{-ms-flex-pack:start;justify-content:flex-start}.pds-drawer.pds-drawer--sm{--pds-drawer-width:360px}.pds-drawer.pds-drawer--md{--pds-drawer-width:500px}"}},[260,"pds-drawer",{componentId:[1,"component-id"],open:[1028],side:[1],size:[1],scrollable:[4],modal:[4],lightDismiss:[4,"light-dismiss"],initialFocus:[1,"initial-focus"]},[[0,"pdsModalClose","handleModalClose"],[0,"pdsModalOpen","handleModalOpen"],[5,"pointerdown","handleOutsidePointerDown"]]]),c=m,h=function(){"undefined"!=typeof customElements&&["pds-drawer","pds-modal"].forEach((d=>{switch(d){case"pds-drawer":customElements.get(o(d))||customElements.define(o(d),m);break;case"pds-modal":customElements.get(o(d))||l()}}))};export{c as PdsDrawer,h as defineCustomElement}
@@ -1 +1 @@
1
- import{proxyCustomElement as t,HTMLElement as e,createEvent as n,h as o,Host as i,transformTag as s}from"@stencil/core/internal/client";import{d as r}from"./pds-icon2.js";import{d}from"./pds-link2.js";const a=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.pdsClick=n(this,"pdsClick",7),this.destructive=!1,this.disabled=!1,this.informational=!1,this.external=!1,this.hasFocus=!1,this.handleFocus=()=>{this.hasFocus=!0},this.handleBlur=()=>{this.hasFocus=!1},this.handleInformationalKeyDown=t=>{" "===t.key&&t.preventDefault()},this.handleKeyDown=t=>{this.disabled||"Enter"!==t.key||(this.href||t.preventDefault(),this.handleClick())}}async clickItem(){this.handleClick()}handleClick(){var t;if(this.informational)return;const e=Array.from(this.host.parentNode.children).filter((t=>"pds-dropdown-menu-item"===t.tagName.toLowerCase())).indexOf(this.host),n=(null===(t=this.host.textContent)||void 0===t?void 0:t.trim())||"";this.pdsClick.emit({itemIndex:e,item:this.host,content:n})}renderElement(){return this.informational?o("div",{class:{"pds-dropdown-menu-item__content":!0,"has-focus":this.hasFocus},role:"menuitem","aria-disabled":"true",part:"button",tabIndex:this.disabled?-1:0,onKeyDown:this.handleInformationalKeyDown,onFocus:this.handleFocus,onBlur:this.handleBlur},o("slot",null)):null!=this.href?o("pds-link",{download:this.download,href:this.disabled?null:this.href,external:this.external,externalLabel:this.externalLabel,target:this.target,class:{"pds-dropdown-menu-item__content":!0,"has-focus":this.hasFocus},tabIndex:this.disabled?-1:0,onKeyDown:this.handleKeyDown,onFocus:this.handleFocus,onBlur:this.handleBlur,"aria-disabled":this.disabled?"true":null},o("slot",null)):o("button",{class:{"pds-dropdown-menu-item__content":!0,"has-focus":this.hasFocus},tabIndex:this.disabled?-1:0,type:"button",part:"button",onKeyDown:this.handleKeyDown,onFocus:this.handleFocus,onBlur:this.handleBlur,disabled:this.disabled,"aria-disabled":this.disabled?"true":null},o("slot",null))}render(){return o(i,{key:"a69947d99160783919f711d7c53e0592694f9565",id:this.componentId,class:{"is-disabled":this.disabled,"is-informational":this.informational,destructive:!this.disabled&&!this.informational&&this.destructive},onClick:()=>!this.disabled&&this.handleClick(),role:"none",tabIndex:this.informational?null:-1,"aria-disabled":this.disabled&&!this.informational?"true":null},this.renderElement())}get host(){return this}static get style(){return":host{cursor:pointer;display:-ms-flexbox;display:flex;width:100%;}:host(.is-disabled){cursor:not-allowed !important;opacity:0.5 !important}:host(.is-disabled) .pds-dropdown-menu-item__content{cursor:not-allowed !important;pointer-events:none !important}.pds-dropdown-menu-item__content{-ms-flex-align:center;align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;border:0;border-radius:var(--pine-dimension-xs);color:var(--pine-color-text);display:-ms-flexbox;display:flex;-ms-flex-positive:1;flex-grow:1;font:var(--pine-typography-body-medium);gap:var(--pine-dimension-xs);margin:calc(var(--pine-border-width) + 2px);padding:var(--pine-dimension-xs);text-align:start;width:100%;}.pds-dropdown-menu-item__content:hover{background-color:var(--pine-color-background-muted);color:var(--pine-color-text-hover)}.pds-dropdown-menu-item__content{}.pds-dropdown-menu-item__content:focus,.pds-dropdown-menu-item__content:focus-visible,.pds-dropdown-menu-item__content.has-focus{outline:var(--pine-outline-focus);outline-offset:var(--pine-border-width)}:host(.is-informational){cursor:default}:host(.is-informational) .pds-dropdown-menu-item__content:hover{background-color:transparent;color:var(--pine-color-text)}:host(.destructive) .pds-dropdown-menu-item__content{--pds-context-link-color:var(--pine-color-danger);--pds-context-link-color-hover:var(--pine-color-danger-hover);-ms-flex-align:center;align-items:center;color:var(--pine-color-danger)}:host(.destructive) .pds-dropdown-menu-item__content:hover{background-color:var(--pine-color-danger-disabled);color:var(--pine-color-danger-hover)}:host(.destructive) .pds-dropdown-menu-item__content:focus,:host(.destructive) .pds-dropdown-menu-item__content:focus-visible,:host(.destructive) .pds-dropdown-menu-item__content.has-focus{background-color:var(--pine-color-danger-disabled);outline:var(--pine-outline-focus-danger);outline-offset:var(--pine-border-width)}pds-link::part(link):focus,pds-link::part(link):focus-visible{-webkit-box-shadow:none;box-shadow:none;outline:none}pds-link::part(link){-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;gap:var(--pine-dimension-xs);margin:calc(var(--pine-dimension-xs) * -1);padding:var(--pine-dimension-xs);text-decoration:none;width:calc(100% + var(--pine-dimension-xs) * 2)}"}},[257,"pds-dropdown-menu-item",{componentId:[1,"component-id"],destructive:[4],disabled:[516],download:[1],href:[1],informational:[516],external:[516],externalLabel:[1,"external-label"],target:[513],hasFocus:[32],clickItem:[64]}]),l=a,c=function(){"undefined"!=typeof customElements&&["pds-dropdown-menu-item","pds-icon","pds-link"].forEach((t=>{switch(t){case"pds-dropdown-menu-item":customElements.get(s(t))||customElements.define(s(t),a);break;case"pds-icon":customElements.get(s(t))||r();break;case"pds-link":customElements.get(s(t))||d()}}))};export{l as PdsDropdownMenuItem,c as defineCustomElement}
1
+ import{proxyCustomElement as e,HTMLElement as t,createEvent as n,h as i,Host as o,transformTag as s}from"@stencil/core/internal/client";import{d as r}from"./pds-icon2.js";import{d}from"./pds-link2.js";const a=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.pdsClick=n(this,"pdsClick",7),this.destructive=!1,this.disabled=!1,this.informational=!1,this.external=!1,this.handleClick=()=>{var e,t;if(this.disabled||this.informational)return;const n=Array.from(null!==(t=null===(e=this.host.parentElement)||void 0===e?void 0:e.children)&&void 0!==t?t:[]).filter((e=>"pds-dropdown-menu-item"===e.tagName.toLowerCase())).indexOf(this.host),i=Array.from(this.host.childNodes).filter((e=>e.nodeType===Node.TEXT_NODE||e.nodeType===Node.ELEMENT_NODE&&!e.getAttribute("slot"))).map((e=>e.textContent)).join("").trim();this.pdsClick.emit({itemIndex:n,item:this.host,content:i})},this.updateStartSlotEmpty=()=>{var e,t;Array.from(this.host.children).some((e=>"start"===e.getAttribute("slot")))?null===(e=this.startSlotEl)||void 0===e||e.classList.remove("pds-dropdown-menu-item__start--empty"):null===(t=this.startSlotEl)||void 0===t||t.classList.add("pds-dropdown-menu-item__start--empty")},this.handleInformationalKeyDown=e=>{" "===e.key&&e.preventDefault()},this.handleKeyDown=e=>{var t;this.disabled||"Enter"!==e.key||(null==this.href?(e.preventDefault(),this.handleClick()):e.composedPath()[0]!==this.innerAnchor()&&(null===(t=this.innerAnchor())||void 0===t||t.click()))}}async clickItem(){this.handleClick()}renderContent(){return[i("slot",{name:"start",onSlotchange:this.updateStartSlotEmpty,ref:e=>{this.startSlotEl=e,e&&(e.classList.add("pds-dropdown-menu-item__start"),this.updateStartSlotEmpty())}}),i("slot",null)]}renderElement(){return this.informational?i("div",{class:"pds-dropdown-menu-item__content",role:"menuitem","aria-disabled":"true",part:"button",tabIndex:this.disabled?-1:0,onKeyDown:this.handleInformationalKeyDown},this.renderContent()):null!=this.href?i("pds-link",{download:this.download,href:this.disabled?null:this.href,external:this.external,externalLabel:this.externalLabel,target:this.target,class:"pds-dropdown-menu-item__content",tabIndex:this.disabled?-1:0,onKeyDown:this.handleKeyDown,"aria-disabled":this.disabled?"true":null},this.renderContent()):i("button",{class:"pds-dropdown-menu-item__content",tabIndex:this.disabled?-1:0,type:"button",part:"button",onKeyDown:this.handleKeyDown,disabled:this.disabled,"aria-disabled":this.disabled?"true":null},this.renderContent())}innerAnchor(){var e,t,n,i;return null!==(i=null===(n=null===(t=null===(e=this.host.shadowRoot)||void 0===e?void 0:e.querySelector("pds-link"))||void 0===t?void 0:t.shadowRoot)||void 0===n?void 0:n.querySelector("a"))&&void 0!==i?i:null}render(){return i(o,{key:"139943faad1c0047bb0363e0eaa0cde9efb2f957",id:this.componentId,class:{"is-disabled":this.disabled,"is-informational":this.informational,destructive:!this.disabled&&!this.informational&&this.destructive},onClick:this.handleClick,role:"none",tabIndex:this.informational?null:-1,"aria-disabled":this.disabled&&!this.informational?"true":null},this.renderElement())}get host(){return this}static get style(){return":host{cursor:pointer;display:-ms-flexbox;display:flex;width:100%;}:host(.is-disabled){cursor:not-allowed !important;opacity:0.5 !important}:host(.is-disabled) .pds-dropdown-menu-item__content{cursor:not-allowed !important;pointer-events:none !important}.pds-dropdown-menu-item__content{-ms-flex-align:center;align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;border:0;border-radius:var(--pine-dimension-xs);color:var(--pine-color-text);display:-ms-flexbox;display:flex;-ms-flex-positive:1;flex-grow:1;font:var(--pine-typography-body-medium);gap:var(--pine-dimension-xs);margin:calc(var(--pine-border-width) + 2px);padding:var(--pine-dimension-xs);text-align:start;width:100%;}.pds-dropdown-menu-item__content:hover{background-color:var(--pine-color-background-muted);color:var(--pine-color-text-hover)}.pds-dropdown-menu-item__content:focus-visible{outline:var(--pine-outline-focus);outline-offset:var(--pine-border-width)}.pds-dropdown-menu-item__start{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-negative:0;flex-shrink:0}.pds-dropdown-menu-item__start--empty{display:none}:host(.is-informational){cursor:default}:host(.is-informational) .pds-dropdown-menu-item__content:hover{background-color:transparent;color:var(--pine-color-text)}:host(.destructive) .pds-dropdown-menu-item__content{--pds-context-link-color:var(--pine-color-danger);--pds-context-link-color-hover:var(--pine-color-danger-hover);-ms-flex-align:center;align-items:center;color:var(--pine-color-danger)}:host(.destructive) .pds-dropdown-menu-item__content:hover{background-color:var(--pine-color-danger-disabled);color:var(--pine-color-danger-hover)}:host(.destructive) .pds-dropdown-menu-item__content:focus-visible{background-color:var(--pine-color-danger-disabled);outline:var(--pine-outline-focus-danger);outline-offset:var(--pine-border-width)}:host(.destructive) pds-link::part(link):focus-visible{background-color:var(--pine-color-danger-disabled);outline:var(--pine-outline-focus-danger)}pds-link::part(link):focus-visible{border-radius:var(--pine-dimension-xs);-webkit-box-shadow:none;box-shadow:none;outline:var(--pine-outline-focus);outline-offset:var(--pine-border-width)}pds-link::part(link){-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;gap:var(--pine-dimension-xs);margin:calc(var(--pine-dimension-xs) * -1);padding:var(--pine-dimension-xs);text-decoration:none;width:calc(100% + var(--pine-dimension-xs) * 2)}"}},[257,"pds-dropdown-menu-item",{componentId:[1,"component-id"],destructive:[4],disabled:[516],download:[1],href:[1],informational:[516],external:[516],externalLabel:[1,"external-label"],target:[513],clickItem:[64]}]),l=a,p=function(){"undefined"!=typeof customElements&&["pds-dropdown-menu-item","pds-icon","pds-link"].forEach((e=>{switch(e){case"pds-dropdown-menu-item":customElements.get(s(e))||customElements.define(s(e),a);break;case"pds-icon":customElements.get(s(e))||r();break;case"pds-link":customElements.get(s(e))||d()}}))};export{l as PdsDropdownMenuItem,p as defineCustomElement}
@@ -1 +1 @@
1
- import{proxyCustomElement as e,HTMLElement as n,h as r,Host as o,transformTag as t}from"@stencil/core/internal/client";const s=e(class extends n{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.disabled=!1}render(){return r(o,{key:"72f29c5015d2379d9986c90ec966f34f41298226",id:this.componentId},r("hr",{key:"72c2155d0fbee6346f3f38997009a7d9e14ad0c8"}))}static get style(){return":host hr{border:0;border-top:var(--pine-border-width-thin) solid var(--pine-color-border);height:0;margin-block:var(--pine-dimension-xs);margin-inline:calc(var(--pine-dimension-xs) * -1)}"}},[1,"pds-dropdown-menu-separator",{componentId:[1,"component-id"],disabled:[4]}]),d=s,i=function(){"undefined"!=typeof customElements&&["pds-dropdown-menu-separator"].forEach((e=>{"pds-dropdown-menu-separator"===e&&(customElements.get(t(e))||customElements.define(t(e),s))}))};export{d as PdsDropdownMenuSeparator,i as defineCustomElement}
1
+ import{proxyCustomElement as e,HTMLElement as n,h as r,Host as o,transformTag as t}from"@stencil/core/internal/client";const d=e(class extends n{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.disabled=!1}render(){return r(o,{key:"74a214d61042d5759af5aef9d6410ed1a267083c",id:this.componentId},r("hr",{key:"c521eda51523fce09bd408af2586645fc9a9cd03"}))}static get style(){return":host hr{border:0;border-top:var(--pine-border-width-thin) solid var(--pine-color-border);height:0;margin-block:var(--pine-dimension-xs);margin-inline:calc(var(--pine-dimension-xs) * -1)}"}},[1,"pds-dropdown-menu-separator",{componentId:[1,"component-id"],disabled:[4]}]),s=d,i=function(){"undefined"!=typeof customElements&&["pds-dropdown-menu-separator"].forEach((e=>{"pds-dropdown-menu-separator"===e&&(customElements.get(t(e))||customElements.define(t(e),d))}))};export{s as PdsDropdownMenuSeparator,i as defineCustomElement}
@@ -1 +1 @@
1
- import{proxyCustomElement as e,HTMLElement as t,h as i,Host as s,transformTag as n}from"@stencil/core/internal/client";import{s as o}from"./attributes.js";import{l as d}from"./keep-hydrated.js";import{a as r,c as a,o as h,f as l,s as p}from"./floating-ui.dom.js";import{d as c}from"./pds-box2.js";const u=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.isOpen=!1,this.menuItems=[],this.cleanupAutoUpdate=null,this.triggerObserver=null,this.currentFocusIndex=-1,this.hasHeader=!1,this.placement="bottom-start",this.handleTriggerSlotChange=e=>{this.slotEl=e.target;const t=this.slotEl.assignedElements();this.triggerEl=t[0],this.triggerEl&&(this.triggerEl.onclick=this.handleClick,this.syncTriggerAria()),this.observeTrigger()},this.syncTriggerAria=()=>!!this.triggerEl&&o(this.triggerEl,{"aria-haspopup":"menu","aria-expanded":this.isOpen+""}),this.handleHeaderSlotChange=e=>{this.hasHeader=e.target.assignedElements().length>0},this.handleSlotChange=e=>{this.slotEl=e.target;const t=this.slotEl.assignedElements(),i=["pds-dropdown-menu-item","pds-dropdown-menu-separator","a","button"],s=t.filter((e=>!i.includes(e.tagName.toLowerCase())));if(s.length>0){const e=s.map((e=>e.tagName.toLowerCase())).join(", ");console.warn(`pds-dropdown-menu: Unexpected element(s) found: ${e}. Expected: `+i.join(", "))}this.menuItems=t.filter((e=>{const t=e.tagName.toLowerCase();return"pds-dropdown-menu-item"===t||"a"===t||"button"===t}))},this.toggleDropdown=()=>{this.isOpen=!this.isOpen,this.isOpen?this.openDropdown():this.closeDropdown()},this.openDropdown=()=>{var e;const t=()=>{a(this.triggerEl,this.panelEl,{placement:this.placement,strategy:"fixed",middleware:[h(6),l(),p({padding:5})]}).then((({x:e,y:t})=>{Object.assign(this.panelEl.style,{left:e+"px",top:t+"px"})}))};t(),this.cleanupAutoUpdate=r(this.triggerEl,this.panelEl,t),null===(e=this.host.shadowRoot)||void 0===e||e.querySelector("pds-box").classList.remove("is-hidden"),this.isOpen=!0,this.syncTriggerAria()},this.closeDropdown=()=>{var e;null===(e=this.host.shadowRoot)||void 0===e||e.querySelector("pds-box").classList.add("is-hidden"),this.isOpen=!1,this.cleanupAutoUpdate&&(this.cleanupAutoUpdate(),this.cleanupAutoUpdate=null),this.syncTriggerAria(),this.currentFocusIndex=-1,this.isFocusInMenu()&&this.focusTrigger()},this.handleClick=()=>{this.toggleDropdown()}}componentWillLoad(){this.hasHeader=Array.from(this.host.children).some((e=>"header"===e.getAttribute("slot")))}componentDidRender(){var e;this.panelEl=null===(e=this.host.shadowRoot)||void 0===e?void 0:e.querySelector("pds-box")}connectedCallback(){this.observeTrigger(),this.syncTriggerAria()}disconnectedCallback(){var e;this.cleanupAutoUpdate&&(this.cleanupAutoUpdate(),this.cleanupAutoUpdate=null),null===(e=this.triggerObserver)||void 0===e||e.disconnect(),this.triggerObserver=null}observeTrigger(){var e;null===(e=this.triggerObserver)||void 0===e||e.disconnect(),this.triggerObserver=null,this.triggerEl&&"undefined"!=typeof MutationObserver&&(this.triggerObserver=new MutationObserver(d(this.syncTriggerAria,"pds-dropdown-menu: stopped restoring its trigger ARIA, as another script keeps changing it. It may be wrong until the menu opens or closes.",this.triggerEl)),this.triggerObserver.observe(this.triggerEl,{attributes:!0,attributeFilter:["aria-haspopup","aria-expanded"]}))}isFocusInMenu(){const e=this.host.getRootNode().activeElement;return null!=e&&this.host.contains(e)}focusTrigger(){var e,t;this.triggerEl.focus(),this.host.getRootNode().activeElement!==this.triggerEl&&(null===(t=null===(e=this.triggerEl.shadowRoot)||void 0===e?void 0:e.querySelector('button, [href], [tabindex]:not([tabindex="-1"])'))||void 0===t||t.focus())}isItemDisabled(e){const t=e.tagName.toLowerCase();return"pds-dropdown-menu-item"===t||"button"===t?e.disabled:"a"===t&&"true"===e.getAttribute("aria-disabled")}getFocusedItemIndex(){const e=document.activeElement;return e?this.menuItems.findIndex((t=>{if(t===e)return!0;if("pds-dropdown-menu-item"===t.tagName.toLowerCase()){const i=t.shadowRoot;if(null==i?void 0:i.contains(e))return!0}return!1})):-1}focusItemByIndex(e){var t,i,s,n,o;if(e>=0&&e<this.menuItems.length){this.currentFocusIndex=e;const d=this.menuItems[e];if("pds-dropdown-menu-item"===d.tagName.toLowerCase()){const e=d,r=null===(t=e.shadowRoot)||void 0===t?void 0:t.querySelector('button, [role="menuitem"]'),a=(null===(n=null===(s=null===(i=e.shadowRoot)||void 0===i?void 0:i.querySelector("pds-link"))||void 0===s?void 0:s.shadowRoot)||void 0===n?void 0:n.querySelector("a"))||(null===(o=e.shadowRoot)||void 0===o?void 0:o.querySelector("a"));r?r.focus():a?a.focus():e.focus()}else d.focus()}}focusNextItem(){let e=(this.currentFocusIndex+1)%this.menuItems.length,t=0;const i=this.menuItems.length;for(;t<i&&this.isItemDisabled(this.menuItems[e]);)e=(e+1)%this.menuItems.length,t++;t<i&&this.focusItemByIndex(e)}focusPreviousItem(){let e=this.currentFocusIndex<=0?this.menuItems.length-1:this.currentFocusIndex-1,t=0;const i=this.menuItems.length;for(;t<i&&this.isItemDisabled(this.menuItems[e]);)e=e<=0?this.menuItems.length-1:e-1,t++;t<i&&this.focusItemByIndex(e)}adjacentEnabledIndex(e,t){for(let i=e+t;i>=0&&i<this.menuItems.length;i+=t)if(!this.isItemDisabled(this.menuItems[i]))return i;return-1}focusAdjacentItem(e,t){for(let i=this.adjacentEnabledIndex(e,t);-1!==i;i=this.adjacentEnabledIndex(i,t))if(this.focusItemByIndex(i),this.getFocusedItemIndex()===i)return!0;return!1}handleEscapeKeyDown(e){this.isOpen&&"Escape"===e.key&&!e.defaultPrevented&&(e.preventDefault(),this.closeDropdown())}handleTabKeyDown(e){if(!this.isOpen||"Tab"!==e.key||e.defaultPrevented)return;const t=this.getFocusedItemIndex();-1!==t?this.focusAdjacentItem(t,e.shiftKey?-1:1)?e.preventDefault():(e.shiftKey&&e.preventDefault(),this.closeDropdown()):!e.shiftKey||document.activeElement!==this.triggerEl&&this.isFocusInMenu()||this.closeDropdown()}handleKeyDown(e){if(this.isOpen)switch(e.key){case"ArrowDown":e.preventDefault(),this.focusNextItem();break;case"ArrowUp":e.preventDefault(),this.focusPreviousItem();break;case"Home":if(e.preventDefault(),this.menuItems.length>0){let e=0;for(;e<this.menuItems.length&&this.isItemDisabled(this.menuItems[e]);)e++;e<this.menuItems.length&&this.focusItemByIndex(e)}break;case"End":if(e.preventDefault(),this.menuItems.length>0){let e=this.menuItems.length-1;for(;e>=0&&this.isItemDisabled(this.menuItems[e]);)e--;e>=0&&this.focusItemByIndex(e)}break;case"Tab":if(e.shiftKey||-1!==this.getFocusedItemIndex())break;this.focusAdjacentItem(-1,1)?e.preventDefault():this.closeDropdown()}}handleWindowClick(e){this.isOpen&&!this.host.contains(e.target)&&e.target!==this.triggerEl&&this.closeDropdown()}render(){return i(s,{key:"aa4ce84354cf87638ee46fd7ed69520228b7e656",id:this.componentId},i("slot",{key:"948800e67d18c8c6cc9e77ef3aeab635c5035453",name:"trigger",onSlotchange:this.handleTriggerSlotChange}),i("pds-box",{key:"3ce2a2879b14aad975cea8ae72fcbf8c3abcf20c","border-radius":"sm",display:"flex",direction:"column",class:"pds-dropdown-menu--panel is-hidden",shadow:"100",part:"menu-panel"},i("div",{key:"ad25fbf4f3c7a24653c229e64fe2ce893a92e4c8",class:{"pds-dropdown-menu__header":!0,"is-hidden":!this.hasHeader}},i("slot",{key:"35a5903543e08577997b456bcd312bdd009fd8fc",name:"header",onSlotchange:this.handleHeaderSlotChange})),i("div",{key:"a9593adacf047918c1d87494f8c951a2a4a5f76f",class:"pds-dropdown-menu__items",role:"menu","aria-orientation":"vertical"},i("slot",{key:"8d2def1cc7020608220099f4ced0f44e9838cce8",onSlotchange:this.handleSlotChange}))))}get host(){return this}static get style(){return":host{display:block}.is-hidden{display:none}.pds-dropdown-menu--panel{background-color:var(--pine-color-background-overlay);border-radius:var(--pine-dimension-xs);left:var(--pine-dimension-none);min-width:170px;padding:var(--pine-dimension-xs);position:fixed;z-index:var(--pine-z-index-overlay)}:host-context([data-theme=dark]) .pds-dropdown-menu--panel{border:var(--pine-border)}.pds-dropdown-menu__header{-webkit-border-after:var(--pine-border-width-thin) solid var(--pine-color-border);border-block-end:var(--pine-border-width-thin) solid var(--pine-color-border);-webkit-margin-after:var(--pine-dimension-xs);margin-block-end:var(--pine-dimension-xs);margin-inline:calc(var(--pine-dimension-xs) * -1);-webkit-padding-after:var(--pine-dimension-xs);padding-block-end:var(--pine-dimension-xs);padding-inline:calc(var(--pine-dimension-xs) * 2 + var(--pine-border-width) + 2px);text-align:start}.pds-dropdown-menu__items{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}::slotted(a:not([slot=header])),::slotted(button:not([slot=header])){-ms-flex-align:center;align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;border:0;border-radius:var(--pine-dimension-xs) !important;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--pine-color-text) !important;cursor:pointer;display:-ms-flexbox;display:flex;-ms-flex-positive:1;flex-grow:1;font:var(--pine-typography-body-medium) !important;gap:var(--pine-dimension-xs);margin:calc(var(--pine-border-width) + 2px) !important;padding:var(--pine-dimension-xs) !important;text-align:start;text-decoration:none !important;width:calc(100% - (var(--pine-border-width) + 2px) * 2)}::slotted(.destructive:not([slot=header])){color:var(--pine-color-danger) !important}::slotted([aria-disabled=true]:not([slot=header])),::slotted([disabled]:not([disabled=false]):not([slot=header])){cursor:not-allowed;opacity:0.5;pointer-events:none}"}},[257,"pds-dropdown-menu",{componentId:[1,"component-id"],placement:[1],currentFocusIndex:[32],hasHeader:[32]},[[6,"keydown","handleEscapeKeyDown"],[6,"keydown","handleTabKeyDown"],[8,"keydown","handleKeyDown"],[8,"click","handleWindowClick"]]]),m=u,b=function(){"undefined"!=typeof customElements&&["pds-dropdown-menu","pds-box"].forEach((e=>{switch(e){case"pds-dropdown-menu":customElements.get(n(e))||customElements.define(n(e),u);break;case"pds-box":customElements.get(n(e))||c()}}))};export{m as PdsDropdownMenu,b as defineCustomElement}
1
+ import{proxyCustomElement as t,HTMLElement as e,h as i,Host as s,transformTag as n}from"@stencil/core/internal/client";import{s as o}from"./attributes.js";import{l as r}from"./keep-hydrated.js";import{a as d,c as a,o as h,f as l,s as p,b as c}from"./floating-ui.dom.js";import{d as u}from"./pds-box2.js";const m=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.isOpen=!1,this.menuItems=[],this.cleanupAutoUpdate=null,this.openCount=0,this.triggerObserver=null,this.triggerVisibility=null,this.currentFocusIndex=-1,this.hasHeader=!1,this.placement="bottom-start",this.handleTriggerSlotChange=t=>{this.slotEl=t.target;const e=this.slotEl.assignedElements();this.triggerEl=e[0],this.triggerEl&&(this.triggerEl.onclick=this.handleClick,this.syncTriggerAria()),this.observeTrigger()},this.syncTriggerAria=()=>!!this.triggerEl&&o(this.triggerEl,{"aria-haspopup":"menu","aria-expanded":this.isOpen+""}),this.handleHeaderSlotChange=t=>{this.hasHeader=t.target.assignedElements().length>0},this.handleSlotChange=t=>{this.slotEl=t.target;const e=this.slotEl.assignedElements(),i=["pds-dropdown-menu-item","pds-dropdown-menu-separator","a","button"],s=e.filter((t=>!i.includes(t.tagName.toLowerCase())));if(s.length>0){const t=s.map((t=>t.tagName.toLowerCase())).join(", ");console.warn(`pds-dropdown-menu: Unexpected element(s) found: ${t}. Expected: `+i.join(", "))}this.menuItems=e.filter((t=>{const e=t.tagName.toLowerCase();return"pds-dropdown-menu-item"===e||"a"===e||"button"===e}))},this.toggleDropdown=()=>{this.isOpen=!this.isOpen,this.isOpen?this.openDropdown():this.closeDropdown()},this.openDropdown=()=>{var t;const e=++this.openCount,i=()=>{a(this.triggerEl,this.panelEl,{placement:this.placement,strategy:"fixed",middleware:[h(6),l(),p({padding:5}),c({padding:5,apply:({availableHeight:t,elements:e})=>this.capPanelHeight(e.floating,t)})]}).then((({x:t,y:i})=>{this.isOpen&&e===this.openCount&&Object.assign(this.panelEl.style,{left:t+"px",top:i+"px"})}))};i(),this.cleanupAutoUpdate=d(this.triggerEl,this.panelEl,i),this.watchTriggerVisibility(),null===(t=this.host.shadowRoot)||void 0===t||t.querySelector("pds-box").classList.remove("is-hidden"),this.isOpen=!0,this.syncTriggerAria()},this.closeDropdown=({preventScroll:t=!1}={})=>{var e;null===(e=this.host.shadowRoot)||void 0===e||e.querySelector("pds-box").classList.add("is-hidden"),this.isOpen=!1,this.cleanupAutoUpdate&&(this.cleanupAutoUpdate(),this.cleanupAutoUpdate=null),this.stopWatchingTriggerVisibility(),this.syncTriggerAria(),this.currentFocusIndex=-1,this.isFocusInMenu()&&this.focusTrigger(t)},this.handleClick=()=>{this.toggleDropdown()}}componentWillLoad(){this.hasHeader=Array.from(this.host.children).some((t=>"header"===t.getAttribute("slot")))}componentDidRender(){var t;this.panelEl=null===(t=this.host.shadowRoot)||void 0===t?void 0:t.querySelector("pds-box")}connectedCallback(){this.observeTrigger(),this.syncTriggerAria()}disconnectedCallback(){var t;this.cleanupAutoUpdate&&(this.cleanupAutoUpdate(),this.cleanupAutoUpdate=null),null===(t=this.triggerObserver)||void 0===t||t.disconnect(),this.triggerObserver=null,this.stopWatchingTriggerVisibility(),this.openCount++}observeTrigger(){var t;null===(t=this.triggerObserver)||void 0===t||t.disconnect(),this.triggerObserver=null,this.triggerEl&&"undefined"!=typeof MutationObserver&&(this.triggerObserver=new MutationObserver(r(this.syncTriggerAria,"pds-dropdown-menu: stopped restoring its trigger ARIA, as another script keeps changing it. It may be wrong until the menu opens or closes.",this.triggerEl)),this.triggerObserver.observe(this.triggerEl,{attributes:!0,attributeFilter:["aria-haspopup","aria-expanded"]}))}capPanelHeight(t,e){const{scrollTop:i}=t;t.style.removeProperty("max-height");const s=getComputedStyle(t).maxHeight,n=Math.max(0,e)+"px";t.style.setProperty("max-height","none"===s?n:`min(${s}, ${n})`,"important"),t.scrollTop=i}watchTriggerVisibility(){if(this.stopWatchingTriggerVisibility(),"undefined"==typeof IntersectionObserver)return;let t=!1,e=!1;this.triggerVisibility=new IntersectionObserver((i=>{this.isOpen&&(i[i.length-1].isIntersecting?t=!0:t?this.closeDropdown({preventScroll:!0}):e||(e=!0,this.triggerEl.scrollIntoView({block:"nearest",inline:"nearest"})))})),this.triggerVisibility.observe(this.triggerEl)}stopWatchingTriggerVisibility(){var t;null===(t=this.triggerVisibility)||void 0===t||t.disconnect(),this.triggerVisibility=null}isFocusInMenu(){const t=this.host.getRootNode().activeElement;return null!=t&&this.host.contains(t)}focusTrigger(t=!1){var e,i;this.triggerEl.focus({preventScroll:t}),this.host.getRootNode().activeElement!==this.triggerEl&&(null===(i=null===(e=this.triggerEl.shadowRoot)||void 0===e?void 0:e.querySelector('button, [href], [tabindex]:not([tabindex="-1"])'))||void 0===i||i.focus({preventScroll:t}))}isItemDisabled(t){const e=t.tagName.toLowerCase();return"pds-dropdown-menu-item"===e||"button"===e?t.disabled:"a"===e&&"true"===t.getAttribute("aria-disabled")}getFocusedItemIndex(){const t=document.activeElement;return t?this.menuItems.findIndex((e=>{if(e===t)return!0;if("pds-dropdown-menu-item"===e.tagName.toLowerCase()){const i=e.shadowRoot;if(null==i?void 0:i.contains(t))return!0}return!1})):-1}focusItemByIndex(t){var e,i,s,n,o;if(t>=0&&t<this.menuItems.length){this.currentFocusIndex=t;const r=this.menuItems[t];if("pds-dropdown-menu-item"===r.tagName.toLowerCase()){const t=r,d=null===(e=t.shadowRoot)||void 0===e?void 0:e.querySelector('button, [role="menuitem"]'),a=(null===(n=null===(s=null===(i=t.shadowRoot)||void 0===i?void 0:i.querySelector("pds-link"))||void 0===s?void 0:s.shadowRoot)||void 0===n?void 0:n.querySelector("a"))||(null===(o=t.shadowRoot)||void 0===o?void 0:o.querySelector("a"));d?d.focus():a?a.focus():t.focus()}else r.focus()}}focusNextItem(){let t=(this.currentFocusIndex+1)%this.menuItems.length,e=0;const i=this.menuItems.length;for(;e<i&&this.isItemDisabled(this.menuItems[t]);)t=(t+1)%this.menuItems.length,e++;e<i&&this.focusItemByIndex(t)}focusPreviousItem(){let t=this.currentFocusIndex<=0?this.menuItems.length-1:this.currentFocusIndex-1,e=0;const i=this.menuItems.length;for(;e<i&&this.isItemDisabled(this.menuItems[t]);)t=t<=0?this.menuItems.length-1:t-1,e++;e<i&&this.focusItemByIndex(t)}adjacentEnabledIndex(t,e){for(let i=t+e;i>=0&&i<this.menuItems.length;i+=e)if(!this.isItemDisabled(this.menuItems[i]))return i;return-1}focusAdjacentItem(t,e){for(let i=this.adjacentEnabledIndex(t,e);-1!==i;i=this.adjacentEnabledIndex(i,e))if(this.focusItemByIndex(i),this.getFocusedItemIndex()===i)return!0;return!1}handleEscapeKeyDown(t){this.isOpen&&"Escape"===t.key&&!t.defaultPrevented&&(t.preventDefault(),this.closeDropdown())}handleTabKeyDown(t){if(!this.isOpen||"Tab"!==t.key||t.defaultPrevented)return;const e=this.getFocusedItemIndex();-1!==e?this.focusAdjacentItem(e,t.shiftKey?-1:1)?t.preventDefault():(t.shiftKey&&t.preventDefault(),this.closeDropdown()):!t.shiftKey||document.activeElement!==this.triggerEl&&this.isFocusInMenu()||this.closeDropdown()}handleKeyDown(t){if(this.isOpen)switch(t.key){case"ArrowDown":t.preventDefault(),this.focusNextItem();break;case"ArrowUp":t.preventDefault(),this.focusPreviousItem();break;case"Home":if(t.preventDefault(),this.menuItems.length>0){let t=0;for(;t<this.menuItems.length&&this.isItemDisabled(this.menuItems[t]);)t++;t<this.menuItems.length&&this.focusItemByIndex(t)}break;case"End":if(t.preventDefault(),this.menuItems.length>0){let t=this.menuItems.length-1;for(;t>=0&&this.isItemDisabled(this.menuItems[t]);)t--;t>=0&&this.focusItemByIndex(t)}break;case"Tab":if(t.shiftKey||-1!==this.getFocusedItemIndex())break;this.focusAdjacentItem(-1,1)?t.preventDefault():this.closeDropdown()}}handleWindowClick(t){this.isOpen&&!this.host.contains(t.target)&&t.target!==this.triggerEl&&this.closeDropdown()}render(){return i(s,{key:"1776921b263178df0de2cdf07a9fb81c668381b6",id:this.componentId},i("slot",{key:"952fdc2b6bb3f1fca5a17dc1962af0e4c38f92e2",name:"trigger",onSlotchange:this.handleTriggerSlotChange}),i("pds-box",{key:"f5f95cebdcf4a4d78d0e4bc47b99c681045f8d38","border-radius":"sm",display:"flex",direction:"column",class:"pds-dropdown-menu--panel is-hidden",shadow:"100",part:"menu-panel"},i("div",{key:"8bff8a8dd06fe1f433bc512bc0ac9030fc9714e7",class:{"pds-dropdown-menu__header":!0,"is-hidden":!this.hasHeader}},i("slot",{key:"1c248f137414dd00037d333b1e07c6b04a7b079d",name:"header",onSlotchange:this.handleHeaderSlotChange})),i("div",{key:"db9954f26762a65e762f8c7b3dfd60e363ff8573",class:"pds-dropdown-menu__items",role:"menu","aria-orientation":"vertical"},i("slot",{key:"d5cb929db03966d673b23de150970744936cf26d",onSlotchange:this.handleSlotChange}))))}get host(){return this}static get style(){return":host{display:block}.is-hidden{display:none}.pds-dropdown-menu--panel{background-color:var(--pine-color-background-overlay);border-radius:var(--pine-dimension-xs);left:var(--pine-dimension-none);min-width:170px;overflow-y:auto;-ms-scroll-chaining:none;overscroll-behavior:contain;padding:var(--pine-dimension-xs);position:fixed;z-index:var(--pine-z-index-overlay)}:host-context([data-theme=dark]) .pds-dropdown-menu--panel{border:var(--pine-border)}.pds-dropdown-menu__header{-webkit-border-after:var(--pine-border-width-thin) solid var(--pine-color-border);border-block-end:var(--pine-border-width-thin) solid var(--pine-color-border);-webkit-margin-after:var(--pine-dimension-xs);margin-block-end:var(--pine-dimension-xs);margin-inline:calc(var(--pine-dimension-xs) * -1);-webkit-padding-after:var(--pine-dimension-xs);padding-block-end:var(--pine-dimension-xs);padding-inline:calc(var(--pine-dimension-xs) * 2 + var(--pine-border-width) + 2px);text-align:start}.pds-dropdown-menu__items{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}::slotted(a:not([slot=header])),::slotted(button:not([slot=header])){-ms-flex-align:center;align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;border:0;border-radius:var(--pine-dimension-xs) !important;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--pine-color-text) !important;cursor:pointer;display:-ms-flexbox;display:flex;-ms-flex-positive:1;flex-grow:1;font:var(--pine-typography-body-medium) !important;gap:var(--pine-dimension-xs);margin:calc(var(--pine-border-width) + 2px) !important;padding:var(--pine-dimension-xs) !important;text-align:start;text-decoration:none !important;width:calc(100% - (var(--pine-border-width) + 2px) * 2)}::slotted(.destructive:not([slot=header])){color:var(--pine-color-danger) !important}::slotted([aria-disabled=true]:not([slot=header])),::slotted([disabled]:not([disabled=false]):not([slot=header])){cursor:not-allowed;opacity:0.5;pointer-events:none}"}},[257,"pds-dropdown-menu",{componentId:[1,"component-id"],placement:[1],currentFocusIndex:[32],hasHeader:[32]},[[6,"keydown","handleEscapeKeyDown"],[6,"keydown","handleTabKeyDown"],[8,"keydown","handleKeyDown"],[8,"click","handleWindowClick"]]]),b=m,f=function(){"undefined"!=typeof customElements&&["pds-dropdown-menu","pds-box"].forEach((t=>{switch(t){case"pds-dropdown-menu":customElements.get(n(t))||customElements.define(n(t),m);break;case"pds-box":customElements.get(n(t))||u()}}))};export{b as PdsDropdownMenu,f as defineCustomElement}
@@ -1 +1 @@
1
- import{proxyCustomElement as e,HTMLElement as i,createEvent as t,h as r,Host as o,transformTag as n}from"@stencil/core/internal/client";import{a as s}from"./scroll.js";import{t as a,g as l}from"./index2.js";import{d as p}from"./pds-icon2.js";const c=e(class extends i{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.pdsFilterOpen=t(this,"pdsFilterOpen",7),this.pdsFilterClose=t(this,"pdsFilterClose",7),this.pdsFilterClear=t(this,"pdsFilterClear",7),this.scrollRAF=null,this.lastScrollTime=0,this.variant="default",this.isOpen=!1,this.handleNativePopoverToggle=e=>{const i=e.target;if(i&&i.id===this.componentId+"-popover"){let e=!1;try{e=i.matches(":popover-open")}catch(t){e="block"===i.style.display}this.isOpen=e,this.isOpen?(setTimeout((()=>this.adjustPopoverPosition()),0),this.pdsFilterOpen.emit({componentId:this.componentId,variant:this.variant,text:this.text})):this.pdsFilterClose.emit({componentId:this.componentId,variant:this.variant,text:this.text})}},this.handleKeyDown=e=>{"clear"!==this.variant||"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.handleClick())},this.handleClick=e=>{"clear"!==this.variant?(this.closeOtherPopovers(),i.prototype.showPopover&&!navigator.userAgent.includes("Firefox")||(e&&e.preventDefault(),setTimeout((()=>{null!=this.popoverEl&&(this.isOpen=!this.isOpen,this.isOpen?(this.popoverEl.style.display="block",this.popoverEl.classList.add("is-open"),this.adjustPopoverPosition(),this.pdsFilterOpen.emit({componentId:this.componentId,variant:this.variant,text:this.text})):(this.popoverEl.style.display="none",this.popoverEl.classList.remove("is-open"),this.pdsFilterClose.emit({componentId:this.componentId,variant:this.variant,text:this.text})))}),0))):this.pdsFilterClear.emit({componentId:this.componentId,text:this.text})}}disconnectedCallback(){if(this.scrollRAF&&(cancelAnimationFrame(this.scrollRAF),this.scrollRAF=null),this.lastScrollTime=0,this.popoverEl&&i.prototype.showPopover&&!navigator.userAgent.includes("Firefox")&&this.popoverEl.removeEventListener("toggle",this.handleNativePopoverToggle),this.isOpen&&this.popoverEl)try{this.popoverEl.hidePopover()}catch(e){this.popoverEl.style.display="none",this.popoverEl.classList.remove("is-open")}}componentDidRender(){this.popoverEl&&i.prototype.showPopover&&!navigator.userAgent.includes("Firefox")&&(this.popoverEl.removeEventListener("toggle",this.handleNativePopoverToggle),this.popoverEl.addEventListener("toggle",this.handleNativePopoverToggle))}handleWindowResize(){this.isOpen&&setTimeout((()=>this.adjustPopoverPosition()),16)}handleWindowScroll(){if(this.isOpen){const e="anchorName"in document.documentElement.style,i=performance.now();if(i-this.lastScrollTime<(e?66:33))return;this.lastScrollTime=i,this.scrollRAF&&cancelAnimationFrame(this.scrollRAF),this.scrollRAF=requestAnimationFrame((()=>{this.isOpen&&this.popoverEl&&this.el.isConnected&&this.adjustPopoverPosition(),this.scrollRAF=null}))}}closeOtherPopovers(){document.querySelectorAll("pds-filter").forEach((e=>{var i;if(e===this.el)return;const t=null===(i=e.shadowRoot)||void 0===i?void 0:i.querySelector(".pds-filter__popover");if(t){let e=!1;try{e=t.matches(":popover-open")}catch(i){e="block"===t.style.display}if(e)try{t.hidePopover()}catch(e){t.style.display="none",t.classList.remove("is-open")}}}))}adjustPopoverPosition(){var e;if(!this.popoverEl||"clear"===this.variant)return;const i=null===(e=this.el.shadowRoot)||void 0===e?void 0:e.querySelector(".pds-filter__trigger");if(!i)return;const t=i.getBoundingClientRect(),r=window.innerWidth,o=window.innerHeight,n="anchorName"in document.documentElement.style,a=228,l=this.popoverEl.getBoundingClientRect().height||200,p=s(this.el),c=p?t.right-a-20<0:t.left+a+20>r,d=t.bottom+8+l+20>o;if(n)this.popoverEl.classList.remove("popover-flip-horizontal","popover-flip-vertical"),c&&this.popoverEl.classList.add("popover-flip-horizontal"),d&&this.popoverEl.classList.add("popover-flip-vertical");else{let e=p?t.right-a:t.left,i=t.bottom+8,r=p?"top right":"top left";if(c){const i=this.popoverEl.getBoundingClientRect().width||a;e=p?t.left:t.right-i,r=p?"top left":"top right"}d&&(i=t.top-l-8,r=r.replace("top","bottom")),this.popoverEl.style.cssText=`\n position: fixed;\n left: ${e}px;\n top: ${i}px;\n z-index: var(--pine-z-index-overlay);\n transform-origin: ${r};\n `}}async showFilter(){if("clear"!==this.variant){if(null!=this.popoverEl)try{this.popoverEl.showPopover()}catch(e){this.popoverEl.style.display="block",this.popoverEl.classList.add("is-open")}}else console.warn("Clear variant does not support showFilter method")}async hideFilter(){if("clear"!==this.variant){if(null!=this.popoverEl)try{this.popoverEl.hidePopover()}catch(e){this.popoverEl.style.display="none",this.popoverEl.classList.remove("is-open")}}else console.warn("Clear variant does not support hideFilter method")}handlePopoverToggle(e){const t=e.target;if((!i.prototype.showPopover||navigator.userAgent.includes("Firefox"))&&t&&t.id===this.componentId+"-popover"){let e=!1;try{e=t.matches(":popover-open")}catch(i){e="block"===t.style.display}this.isOpen=e,this.isOpen?(setTimeout((()=>this.adjustPopoverPosition()),0),this.pdsFilterOpen.emit({componentId:this.componentId,variant:this.variant,text:this.text})):this.pdsFilterClose.emit({componentId:this.componentId,variant:this.variant,text:this.text})}}handleDocumentClick(e){!this.el.contains(e.target)&&this.isOpen&&"clear"!==this.variant&&setTimeout((()=>{if(this.popoverEl&&this.isOpen){const e=i.prototype.showPopover&&!navigator.userAgent.includes("Firefox");let t=!1;if(e)try{t=!this.popoverEl.matches(":popover-open")}catch(e){t="block"!==this.popoverEl.style.display}else t=!0;t&&(this.isOpen=!1,e||(this.popoverEl.style.display="none",this.popoverEl.classList.remove("is-open")),this.pdsFilterClose.emit({componentId:this.componentId,variant:this.variant,text:this.text}))}}),0)}handleEscapeKey(e){"Escape"===e.key&&this.isOpen&&"clear"!==this.variant&&setTimeout((()=>{if(this.popoverEl&&this.isOpen){const e=i.prototype.showPopover&&!navigator.userAgent.includes("Firefox");let t=!1;if(e)try{t=!this.popoverEl.matches(":popover-open")}catch(e){t="block"!==this.popoverEl.style.display}else t=!0;t&&(this.isOpen=!1,e||(this.popoverEl.style.display="none",this.popoverEl.classList.remove("is-open")),this.pdsFilterClose.emit({componentId:this.componentId,variant:this.variant,text:this.text}))}}),0)}getIcon(){return"clear"===this.variant?a:this.icon}getTriggerClasses(){const e=["pds-filter__trigger"];return e.push("pds-filter__trigger--"+this.variant),this.isOpen&&"clear"!==this.variant&&e.push("pds-filter__trigger--open"),e.join(" ")}renderIcon(){const e=this.getIcon();return null==e||""===e?null:r("pds-icon",{icon:e,size:"var(--pine-font-size-100)","aria-hidden":"true",part:"icon"})}renderDropdownIcon(){return"selected"===this.variant?r("pds-icon",{icon:l,size:"var(--pine-dimension-200)","aria-hidden":"true",class:"pds-filter__dropdown-icon",part:"icon"}):null}render(){return r(o,{key:"9b2286e9a0d7f88b7f6bc90f8444185cfec832c8",id:this.componentId},r("button",{key:"968953600d615f2739757a91422dafdb817c9a6f",class:this.getTriggerClasses(),type:"button",popoverTarget:"clear"!==this.variant?this.componentId+"-popover":void 0,popoverTargetAction:"clear"!==this.variant?"toggle":void 0,onKeyDown:"clear"===this.variant?this.handleKeyDown:void 0,onClick:e=>this.handleClick(e),part:"button","aria-expanded":this.isOpen?"true":"false","aria-haspopup":"clear"!==this.variant?"true":void 0,"aria-controls":"clear"!==this.variant?this.componentId+"-popover":void 0},r("span",{key:"ee479f7e510ffcb54f7857cb7d1345f2a5c1d76a",class:"pds-filter__button-content",part:"button-content"},this.renderIcon(),this.text&&r("span",{key:"e98aa8b915a2460f3c7d49e20ec7d43853ee5f9f",class:"pds-filter__button-text",part:"button-text"},this.text),this.renderDropdownIcon())),"clear"!==this.variant&&r("div",{key:"3084babfba2d96880b2829a60d2ef00140a6813b",ref:e=>this.popoverEl=e,id:this.componentId+"-popover",class:"pds-filter__popover",popover:"auto",part:"popover"},r("slot",{key:"e901488be75a18bedc6b2c42be5c398fd2cf2a29"})))}get el(){return this}static get style(){return":host{--box-shadow-focus:0 0 0 1px var(--pine-color-background-container), 0 0 0 3px var(--pine-color-focus-ring);display:inline-block;position:relative}.pds-filter__trigger{-ms-flex-align:center;align-items:center;anchor-name:--filter-trigger;background:var(--pine-color-background-container);border:var(--pine-border);border-radius:var(--pine-dimension-100);-webkit-box-shadow:var(--pine-box-shadow-050);box-shadow:var(--pine-box-shadow-050);-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--pine-color-text-tertiary);cursor:pointer;display:-ms-inline-flexbox;display:inline-flex;font-family:var(--pine-font-family-inter);font-size:var(--pine-font-size-100);font-weight:var(--pine-font-weight-400);gap:var(--pine-dimension-050);letter-spacing:var(--pine-letter-spacing-114);line-height:var(--pine-line-height-150);padding:var(--pine-dimension-025) var(--pine-dimension-125);position:relative;-webkit-transition:all var(--pine-motion-duration-base) ease;transition:all var(--pine-motion-duration-base) ease}.pds-filter__trigger pds-icon{block-size:var(--pine-font-size-100);color:var(--pine-color-text-secondary);-ms-flex-negative:0;flex-shrink:0;inline-size:var(--pine-font-size-100)}.pds-filter__trigger:hover,.pds-filter__trigger.pds-filter__trigger--open{background-color:var(--pine-color-background-subtle);border-color:var(--pine-color-border-hover);color:var(--pine-color-text-hover)}.pds-filter__trigger:hover pds-icon,.pds-filter__trigger.pds-filter__trigger--open pds-icon{color:var(--pine-color-text-secondary)}.pds-filter__trigger:focus-visible{-webkit-box-shadow:var(--box-shadow-focus);box-shadow:var(--box-shadow-focus);outline:none}.pds-filter__trigger:disabled{cursor:not-allowed;opacity:0.5}.pds-filter__trigger--selected{background-color:var(--pine-color-purple-050);border-color:var(--pine-color-purple-500);color:var(--pine-color-purple-600)}.pds-filter__trigger--selected pds-icon{color:var(--pine-color-purple-600)}.pds-filter__trigger--selected:hover,.pds-filter__trigger--selected.pds-filter__trigger--open{background-color:var(--pine-color-purple-100);border-color:var(--pine-color-purple-500);color:var(--pine-color-purple-600)}.pds-filter__trigger--selected:hover pds-icon,.pds-filter__trigger--selected.pds-filter__trigger--open pds-icon{color:var(--pine-color-purple-600)}.pds-filter__trigger--selected:focus-visible{-webkit-box-shadow:var(--box-shadow-focus);box-shadow:var(--box-shadow-focus);outline:none}.pds-filter__trigger--more{background-color:var(--pine-color-background-container-hover);border:var(--pine-border-width-thin) dashed var(--pine-color-border);color:var(--pine-color-text-tertiary)}.pds-filter__trigger--more pds-icon{color:var(--pine-color-text-secondary)}.pds-filter__trigger--more:hover,.pds-filter__trigger--more.pds-filter__trigger--open{background-color:var(--pine-color-background-subtle);border-color:var(--pine-color-border-hover);color:var(--pine-color-text-hover)}.pds-filter__trigger--more:hover pds-icon,.pds-filter__trigger--more.pds-filter__trigger--open pds-icon{color:var(--pine-color-text-secondary)}.pds-filter__trigger--more:focus-visible{-webkit-box-shadow:var(--box-shadow-focus);box-shadow:var(--box-shadow-focus);outline:none}.pds-filter__trigger--clear{background:transparent;border:var(--pine-border-width-thin) solid transparent;border-radius:var(--pine-dimension-100);-webkit-box-shadow:none;box-shadow:none;color:var(--pine-color-purple-600)}.pds-filter__trigger--clear pds-icon{color:var(--pine-color-purple-600)}.pds-filter__trigger--clear:hover{background-color:var(--pine-color-purple-100);border-color:var(--pine-color-purple-100);color:var(--pine-color-purple-600)}.pds-filter__trigger--clear:hover pds-icon{color:var(--pine-color-purple-600)}.pds-filter__trigger--clear:focus-visible{-webkit-box-shadow:var(--box-shadow-focus);box-shadow:var(--box-shadow-focus);outline:none}.pds-filter__button-content{-ms-flex-align:center;align-items:center;display:-ms-inline-flexbox;display:inline-flex;gap:var(--pine-dimension-050);max-inline-size:148px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pds-filter__button-text{line-height:var(--pine-line-height-150);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pds-filter__dropdown-icon{block-size:var(--pine-dimension-200);-ms-flex-negative:0;flex-shrink:0;inline-size:var(--pine-dimension-200)}.pds-filter__popover{background-color:var(--pine-color-background-overlay);border:0;border-radius:var(--pine-dimension-100);-webkit-box-shadow:var(--pine-box-shadow-100);box-shadow:var(--pine-box-shadow-100);display:none;inline-size:228px;inset:unset;padding:var(--pine-dimension-100);z-index:var(--pine-z-index-overlay);}.pds-filter__popover:popover-open,.pds-filter__popover.is-open{display:block}.pds-filter__popover{}@supports (anchor-name: --test){.pds-filter__popover{inset-block-start:calc(anchor(--filter-trigger bottom) + var(--pine-dimension-100));inset-inline-start:anchor(--filter-trigger start);position:fixed;position-anchor:--filter-trigger;}.pds-filter__popover.popover-flip-horizontal{inset-inline-end:anchor(--filter-trigger end);inset-inline-start:auto}.pds-filter__popover.popover-flip-vertical{inset-block-start:anchor(--filter-trigger top);-webkit-transform:translateY(calc(-100% - var(--pine-dimension-100)));transform:translateY(calc(-100% - var(--pine-dimension-100)))}.pds-filter__popover.popover-flip-horizontal.popover-flip-vertical{inset-block-start:anchor(--filter-trigger top);inset-inline-end:anchor(--filter-trigger end);inset-inline-start:auto;-webkit-transform:translateY(calc(-100% - var(--pine-dimension-100)));transform:translateY(calc(-100% - var(--pine-dimension-100)))}.pds-filter__popover{}.pds-filter__popover.is-open.popover-flip-horizontal{inset-inline-end:anchor(--filter-trigger end);inset-inline-start:auto}.pds-filter__popover.is-open.popover-flip-vertical{inset-block-start:anchor(--filter-trigger top);-webkit-transform:translateY(calc(-100% - var(--pine-dimension-100)));transform:translateY(calc(-100% - var(--pine-dimension-100)))}.pds-filter__popover.is-open.popover-flip-horizontal.popover-flip-vertical{inset-block-start:anchor(--filter-trigger top);inset-inline-end:anchor(--filter-trigger end);inset-inline-start:auto;-webkit-transform:translateY(calc(-100% - var(--pine-dimension-100)));transform:translateY(calc(-100% - var(--pine-dimension-100)))}}"}},[257,"pds-filter",{componentId:[1,"component-id"],variant:[1],icon:[1],text:[1],isOpen:[32],showFilter:[64],hideFilter:[64]},[[9,"resize","handleWindowResize"],[9,"scroll","handleWindowScroll"],[4,"toggle","handlePopoverToggle"],[4,"click","handleDocumentClick"],[4,"keydown","handleEscapeKey"]]]),d=c,h=function(){"undefined"!=typeof customElements&&["pds-filter","pds-icon"].forEach((e=>{switch(e){case"pds-filter":customElements.get(n(e))||customElements.define(n(e),c);break;case"pds-icon":customElements.get(n(e))||p()}}))};export{d as PdsFilter,h as defineCustomElement}
1
+ import{proxyCustomElement as e,HTMLElement as i,createEvent as t,h as o,Host as r,transformTag as n}from"@stencil/core/internal/client";import{a as s}from"./scroll.js";import{t as l,g as a}from"./index2.js";import{b as p}from"./truncation-tooltip.js";import{d as c}from"./pds-icon2.js";const d=e(class extends i{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.pdsFilterOpen=t(this,"pdsFilterOpen",7),this.pdsFilterClose=t(this,"pdsFilterClose",7),this.pdsFilterClear=t(this,"pdsFilterClear",7),this.scrollRAF=null,this.lastScrollTime=0,this.truncationTooltip=p((e=>{var i;return{hostEl:null!==(i=e.closest("button"))&&void 0!==i?i:e,contentEl:e,getTooltipText:()=>{var e;return null!==(e=this.text)&&void 0!==e?e:""},manageTabIndex:!1}})),this.variant="default",this.isOpen=!1,this.handleNativePopoverToggle=e=>{const i=e.target;if(i&&i.id===this.componentId+"-popover"){let e=!1;try{e=i.matches(":popover-open")}catch(t){e="block"===i.style.display}this.isOpen=e,this.isOpen?(setTimeout((()=>this.adjustPopoverPosition()),0),this.pdsFilterOpen.emit({componentId:this.componentId,variant:this.variant,text:this.text})):this.pdsFilterClose.emit({componentId:this.componentId,variant:this.variant,text:this.text})}},this.handleKeyDown=e=>{"clear"!==this.variant||"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.handleClick())},this.handleClick=e=>{"clear"!==this.variant?(this.closeOtherPopovers(),i.prototype.showPopover&&!navigator.userAgent.includes("Firefox")||(e&&e.preventDefault(),setTimeout((()=>{null!=this.popoverEl&&(this.isOpen=!this.isOpen,this.isOpen?(this.popoverEl.style.display="block",this.popoverEl.classList.add("is-open"),this.adjustPopoverPosition(),this.pdsFilterOpen.emit({componentId:this.componentId,variant:this.variant,text:this.text})):(this.popoverEl.style.display="none",this.popoverEl.classList.remove("is-open"),this.pdsFilterClose.emit({componentId:this.componentId,variant:this.variant,text:this.text})))}),0))):this.pdsFilterClear.emit({componentId:this.componentId,text:this.text})}}connectedCallback(){this.syncTruncationTooltip()}disconnectedCallback(){if(this.truncationTooltip.destroy(),this.scrollRAF&&(cancelAnimationFrame(this.scrollRAF),this.scrollRAF=null),this.lastScrollTime=0,this.popoverEl&&i.prototype.showPopover&&!navigator.userAgent.includes("Firefox")&&this.popoverEl.removeEventListener("toggle",this.handleNativePopoverToggle),this.isOpen&&this.popoverEl)try{this.popoverEl.hidePopover()}catch(e){this.popoverEl.style.display="none",this.popoverEl.classList.remove("is-open")}}componentDidRender(){this.syncTruncationTooltip(),this.popoverEl&&i.prototype.showPopover&&!navigator.userAgent.includes("Firefox")&&(this.popoverEl.removeEventListener("toggle",this.handleNativePopoverToggle),this.popoverEl.addEventListener("toggle",this.handleNativePopoverToggle))}syncTruncationTooltip(){var e;this.truncationTooltip.sync([null===(e=this.el.shadowRoot)||void 0===e?void 0:e.querySelector(".pds-filter__button-text")])}handleWindowResize(){this.isOpen&&setTimeout((()=>this.adjustPopoverPosition()),16)}handleWindowScroll(){if(this.isOpen){const e="anchorName"in document.documentElement.style,i=performance.now();if(i-this.lastScrollTime<(e?66:33))return;this.lastScrollTime=i,this.scrollRAF&&cancelAnimationFrame(this.scrollRAF),this.scrollRAF=requestAnimationFrame((()=>{this.isOpen&&this.popoverEl&&this.el.isConnected&&this.adjustPopoverPosition(),this.scrollRAF=null}))}}closeOtherPopovers(){document.querySelectorAll("pds-filter").forEach((e=>{var i;if(e===this.el)return;const t=null===(i=e.shadowRoot)||void 0===i?void 0:i.querySelector(".pds-filter__popover");if(t){let e=!1;try{e=t.matches(":popover-open")}catch(i){e="block"===t.style.display}if(e)try{t.hidePopover()}catch(e){t.style.display="none",t.classList.remove("is-open")}}}))}adjustPopoverPosition(){var e;if(!this.popoverEl||"clear"===this.variant)return;const i=null===(e=this.el.shadowRoot)||void 0===e?void 0:e.querySelector(".pds-filter__trigger");if(!i)return;const t=i.getBoundingClientRect(),o=window.innerWidth,r=window.innerHeight,n="anchorName"in document.documentElement.style,l=228,a=this.popoverEl.getBoundingClientRect().height||200,p=s(this.el),c=p?t.right-l-20<0:t.left+l+20>o,d=t.bottom+8+a+20>r;if(n)this.popoverEl.classList.remove("popover-flip-horizontal","popover-flip-vertical"),c&&this.popoverEl.classList.add("popover-flip-horizontal"),d&&this.popoverEl.classList.add("popover-flip-vertical");else{let e=p?t.right-l:t.left,i=t.bottom+8,o=p?"top right":"top left";if(c){const i=this.popoverEl.getBoundingClientRect().width||l;e=p?t.left:t.right-i,o=p?"top left":"top right"}d&&(i=t.top-a-8,o=o.replace("top","bottom")),this.popoverEl.style.cssText=`\n position: fixed;\n left: ${e}px;\n top: ${i}px;\n z-index: var(--pine-z-index-overlay);\n transform-origin: ${o};\n `}}async showFilter(){if("clear"!==this.variant){if(null!=this.popoverEl)try{this.popoverEl.showPopover()}catch(e){this.popoverEl.style.display="block",this.popoverEl.classList.add("is-open")}}else console.warn("Clear variant does not support showFilter method")}async hideFilter(){if("clear"!==this.variant){if(null!=this.popoverEl)try{this.popoverEl.hidePopover()}catch(e){this.popoverEl.style.display="none",this.popoverEl.classList.remove("is-open")}}else console.warn("Clear variant does not support hideFilter method")}handlePopoverToggle(e){const t=e.target;if((!i.prototype.showPopover||navigator.userAgent.includes("Firefox"))&&t&&t.id===this.componentId+"-popover"){let e=!1;try{e=t.matches(":popover-open")}catch(i){e="block"===t.style.display}this.isOpen=e,this.isOpen?(setTimeout((()=>this.adjustPopoverPosition()),0),this.pdsFilterOpen.emit({componentId:this.componentId,variant:this.variant,text:this.text})):this.pdsFilterClose.emit({componentId:this.componentId,variant:this.variant,text:this.text})}}handleDocumentClick(e){!this.el.contains(e.target)&&this.isOpen&&"clear"!==this.variant&&setTimeout((()=>{if(this.popoverEl&&this.isOpen){const e=i.prototype.showPopover&&!navigator.userAgent.includes("Firefox");let t=!1;if(e)try{t=!this.popoverEl.matches(":popover-open")}catch(e){t="block"!==this.popoverEl.style.display}else t=!0;t&&(this.isOpen=!1,e||(this.popoverEl.style.display="none",this.popoverEl.classList.remove("is-open")),this.pdsFilterClose.emit({componentId:this.componentId,variant:this.variant,text:this.text}))}}),0)}handleEscapeKey(e){"Escape"===e.key&&this.isOpen&&"clear"!==this.variant&&setTimeout((()=>{if(this.popoverEl&&this.isOpen){const e=i.prototype.showPopover&&!navigator.userAgent.includes("Firefox");let t=!1;if(e)try{t=!this.popoverEl.matches(":popover-open")}catch(e){t="block"!==this.popoverEl.style.display}else t=!0;t&&(this.isOpen=!1,e||(this.popoverEl.style.display="none",this.popoverEl.classList.remove("is-open")),this.pdsFilterClose.emit({componentId:this.componentId,variant:this.variant,text:this.text}))}}),0)}getIcon(){return"clear"===this.variant?l:this.icon}getTriggerClasses(){const e=["pds-filter__trigger"];return e.push("pds-filter__trigger--"+this.variant),this.isOpen&&"clear"!==this.variant&&e.push("pds-filter__trigger--open"),e.join(" ")}renderIcon(){const e=this.getIcon();return null==e||""===e?null:o("pds-icon",{icon:e,size:"var(--pine-font-size-100)","aria-hidden":"true",part:"icon"})}renderDropdownIcon(){return"selected"===this.variant?o("pds-icon",{icon:a,size:"var(--pine-dimension-200)","aria-hidden":"true",class:"pds-filter__dropdown-icon",part:"icon"}):null}render(){return o(r,{key:"0876855dacf0172f83a6e1afcc8b9b1b6acf1251",id:this.componentId},o("button",{key:"e20b93644a520ed3351fb5802d1e6f0cb2465248",class:this.getTriggerClasses(),type:"button",popoverTarget:"clear"!==this.variant?this.componentId+"-popover":void 0,popoverTargetAction:"clear"!==this.variant?"toggle":void 0,onKeyDown:"clear"===this.variant?this.handleKeyDown:void 0,onClick:e=>this.handleClick(e),part:"button","aria-expanded":this.isOpen?"true":"false","aria-haspopup":"clear"!==this.variant?"true":void 0,"aria-controls":"clear"!==this.variant?this.componentId+"-popover":void 0},o("span",{key:"075e2f221d297ede0a52185853acbd3e74b99339",class:"pds-filter__button-content",part:"button-content"},this.renderIcon(),this.text&&o("span",{key:"cd1d3a15e0969c3d960786a7fd7fd7b3195dd4de",class:"pds-filter__button-text",part:"button-text"},this.text),this.renderDropdownIcon())),"clear"!==this.variant&&o("div",{key:"6524cb11b96f03ef5c528325a950c9f80f5ae9fa",ref:e=>this.popoverEl=e,id:this.componentId+"-popover",class:"pds-filter__popover",popover:"auto",part:"popover"},o("slot",{key:"06cc2ca22068ccedbddf3ff69ce4a352fd01d142"})))}get el(){return this}static get style(){return":host{--box-shadow-focus:0 0 0 1px var(--pine-color-background-container), 0 0 0 3px var(--pine-color-focus-ring);display:inline-block;position:relative}.pds-filter__trigger{-ms-flex-align:center;align-items:center;anchor-name:--filter-trigger;background:var(--pine-color-background-container);border:var(--pine-border);border-radius:var(--pine-dimension-100);-webkit-box-shadow:var(--pine-box-shadow-050);box-shadow:var(--pine-box-shadow-050);-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--pine-color-text-tertiary);cursor:pointer;display:-ms-inline-flexbox;display:inline-flex;font-family:var(--pine-font-family-inter);font-size:var(--pine-font-size-100);font-weight:var(--pine-font-weight-400);gap:var(--pine-dimension-050);letter-spacing:var(--pine-letter-spacing-114);line-height:var(--pine-line-height-150);padding:var(--pine-dimension-025) var(--pine-dimension-125);position:relative;-webkit-transition:all var(--pine-motion-duration-base) ease;transition:all var(--pine-motion-duration-base) ease}.pds-filter__trigger pds-icon{block-size:var(--pine-font-size-100);color:var(--pine-color-text-secondary);-ms-flex-negative:0;flex-shrink:0;inline-size:var(--pine-font-size-100)}.pds-filter__trigger:hover,.pds-filter__trigger.pds-filter__trigger--open{background-color:var(--pine-color-background-subtle);border-color:var(--pine-color-border-hover);color:var(--pine-color-text-hover)}.pds-filter__trigger:hover pds-icon,.pds-filter__trigger.pds-filter__trigger--open pds-icon{color:var(--pine-color-text-secondary)}.pds-filter__trigger:focus-visible{-webkit-box-shadow:var(--box-shadow-focus);box-shadow:var(--box-shadow-focus);outline:none}.pds-filter__trigger:disabled{cursor:not-allowed;opacity:0.5}.pds-filter__trigger--selected{background-color:var(--pine-color-purple-050);border-color:var(--pine-color-purple-500);color:var(--pine-color-purple-600)}.pds-filter__trigger--selected pds-icon{color:var(--pine-color-purple-600)}.pds-filter__trigger--selected:hover,.pds-filter__trigger--selected.pds-filter__trigger--open{background-color:var(--pine-color-purple-100);border-color:var(--pine-color-purple-500);color:var(--pine-color-purple-600)}.pds-filter__trigger--selected:hover pds-icon,.pds-filter__trigger--selected.pds-filter__trigger--open pds-icon{color:var(--pine-color-purple-600)}.pds-filter__trigger--selected:focus-visible{-webkit-box-shadow:var(--box-shadow-focus);box-shadow:var(--box-shadow-focus);outline:none}.pds-filter__trigger--more{background-color:var(--pine-color-background-container-hover);border:var(--pine-border-width-thin) dashed var(--pine-color-border);color:var(--pine-color-text-tertiary)}.pds-filter__trigger--more pds-icon{color:var(--pine-color-text-secondary)}.pds-filter__trigger--more:hover,.pds-filter__trigger--more.pds-filter__trigger--open{background-color:var(--pine-color-background-subtle);border-color:var(--pine-color-border-hover);color:var(--pine-color-text-hover)}.pds-filter__trigger--more:hover pds-icon,.pds-filter__trigger--more.pds-filter__trigger--open pds-icon{color:var(--pine-color-text-secondary)}.pds-filter__trigger--more:focus-visible{-webkit-box-shadow:var(--box-shadow-focus);box-shadow:var(--box-shadow-focus);outline:none}.pds-filter__trigger--clear{background:transparent;border:var(--pine-border-width-thin) solid transparent;border-radius:var(--pine-dimension-100);-webkit-box-shadow:none;box-shadow:none;color:var(--pine-color-purple-600)}.pds-filter__trigger--clear pds-icon{color:var(--pine-color-purple-600)}.pds-filter__trigger--clear:hover{background-color:var(--pine-color-purple-100);border-color:var(--pine-color-purple-100);color:var(--pine-color-purple-600)}.pds-filter__trigger--clear:hover pds-icon{color:var(--pine-color-purple-600)}.pds-filter__trigger--clear:focus-visible{-webkit-box-shadow:var(--box-shadow-focus);box-shadow:var(--box-shadow-focus);outline:none}.pds-filter__button-content{-ms-flex-align:center;align-items:center;display:-ms-inline-flexbox;display:inline-flex;gap:var(--pine-dimension-050);max-inline-size:148px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pds-filter__button-text{line-height:var(--pine-line-height-150);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pds-filter__dropdown-icon{block-size:var(--pine-dimension-200);-ms-flex-negative:0;flex-shrink:0;inline-size:var(--pine-dimension-200)}.pds-filter__popover{background-color:var(--pine-color-background-overlay);border:0;border-radius:var(--pine-dimension-100);-webkit-box-shadow:var(--pine-box-shadow-100);box-shadow:var(--pine-box-shadow-100);-webkit-box-sizing:border-box;box-sizing:border-box;display:none;inline-size:244px;inset:unset;padding:var(--pine-dimension-100);z-index:var(--pine-z-index-overlay);}.pds-filter__popover:popover-open,.pds-filter__popover.is-open{display:block}.pds-filter__popover{}@supports (anchor-name: --test){.pds-filter__popover{inset-block-start:calc(anchor(--filter-trigger bottom) + var(--pine-dimension-100));inset-inline-start:anchor(--filter-trigger start);position:fixed;position-anchor:--filter-trigger;}.pds-filter__popover.popover-flip-horizontal{inset-inline-end:anchor(--filter-trigger end);inset-inline-start:auto}.pds-filter__popover.popover-flip-vertical{inset-block-start:anchor(--filter-trigger top);-webkit-transform:translateY(calc(-100% - var(--pine-dimension-100)));transform:translateY(calc(-100% - var(--pine-dimension-100)))}.pds-filter__popover.popover-flip-horizontal.popover-flip-vertical{inset-block-start:anchor(--filter-trigger top);inset-inline-end:anchor(--filter-trigger end);inset-inline-start:auto;-webkit-transform:translateY(calc(-100% - var(--pine-dimension-100)));transform:translateY(calc(-100% - var(--pine-dimension-100)))}.pds-filter__popover{}.pds-filter__popover.is-open.popover-flip-horizontal{inset-inline-end:anchor(--filter-trigger end);inset-inline-start:auto}.pds-filter__popover.is-open.popover-flip-vertical{inset-block-start:anchor(--filter-trigger top);-webkit-transform:translateY(calc(-100% - var(--pine-dimension-100)));transform:translateY(calc(-100% - var(--pine-dimension-100)))}.pds-filter__popover.is-open.popover-flip-horizontal.popover-flip-vertical{inset-block-start:anchor(--filter-trigger top);inset-inline-end:anchor(--filter-trigger end);inset-inline-start:auto;-webkit-transform:translateY(calc(-100% - var(--pine-dimension-100)));transform:translateY(calc(-100% - var(--pine-dimension-100)))}}"}},[257,"pds-filter",{componentId:[1,"component-id"],variant:[1],icon:[1],text:[1],isOpen:[32],showFilter:[64],hideFilter:[64]},[[9,"resize","handleWindowResize"],[9,"scroll","handleWindowScroll"],[4,"toggle","handlePopoverToggle"],[4,"click","handleDocumentClick"],[4,"keydown","handleEscapeKey"]]]),h=d,f=function(){"undefined"!=typeof customElements&&["pds-filter","pds-icon"].forEach((e=>{switch(e){case"pds-filter":customElements.get(n(e))||customElements.define(n(e),d);break;case"pds-icon":customElements.get(n(e))||c()}}))};export{h as PdsFilter,f as defineCustomElement}