@duetds/components 8.6.8 → 8.7.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 (959) hide show
  1. package/hydrate/index.d.ts +30 -12
  2. package/hydrate/index.js +33069 -23517
  3. package/lib/cjs/{app-globals-aece069f.js → app-globals-44f2c7a3.js} +2 -0
  4. package/lib/cjs/duet-action-button.cjs.entry.js +5 -4
  5. package/lib/cjs/duet-alert.cjs.entry.js +10 -9
  6. package/lib/cjs/duet-badge.cjs.entry.js +5 -4
  7. package/lib/cjs/duet-banner.cjs.entry.js +6 -5
  8. package/lib/cjs/duet-breadcrumb.cjs.entry.js +8 -7
  9. package/lib/cjs/duet-breadcrumbs.cjs.entry.js +6 -5
  10. package/lib/cjs/duet-button_2.cjs.entry.js +13 -11
  11. package/lib/cjs/duet-callout.cjs.entry.js +6 -5
  12. package/lib/cjs/duet-caption_4.cjs.entry.js +18 -14
  13. package/lib/cjs/duet-card.cjs.entry.js +6 -5
  14. package/lib/cjs/duet-checkbox.cjs.entry.js +3 -2
  15. package/lib/cjs/duet-checkmark.cjs.entry.js +5 -4
  16. package/lib/cjs/duet-chip.cjs.entry.js +4 -3
  17. package/lib/cjs/duet-choice_2.cjs.entry.js +7 -5
  18. package/lib/cjs/duet-collapsible.cjs.entry.js +6 -5
  19. package/lib/cjs/duet-combobox.cjs.entry.js +5 -4
  20. package/lib/cjs/duet-contact-card.cjs.entry.js +6 -5
  21. package/lib/cjs/duet-cookie-consent.cjs.entry.js +4 -3
  22. package/lib/cjs/duet-date-picker.cjs.entry.js +6 -5
  23. package/lib/cjs/duet-divider_2.cjs.entry.js +7 -5
  24. package/lib/cjs/duet-editable-table_3.cjs.entry.js +13 -10
  25. package/lib/cjs/duet-empty-state.cjs.entry.js +5 -4
  26. package/lib/cjs/duet-fieldset.cjs.entry.js +7 -6
  27. package/lib/cjs/duet-file-chooser.cjs.entry.js +4 -3
  28. package/lib/cjs/duet-footer.cjs.entry.js +9 -8
  29. package/lib/cjs/duet-grid_2.cjs.entry.js +5 -3
  30. package/lib/cjs/duet-header_2.cjs.entry.js +7 -5
  31. package/lib/cjs/duet-hero.cjs.entry.js +10 -9
  32. package/lib/cjs/duet-icon.cjs.entry.js +6 -5
  33. package/lib/cjs/duet-input_2.cjs.entry.js +7 -5
  34. package/lib/cjs/duet-layout.cjs.entry.js +8 -7
  35. package/lib/cjs/duet-list_2.cjs.entry.js +8 -6
  36. package/lib/cjs/duet-menu-bar-button.cjs.entry.js +5 -4
  37. package/lib/cjs/duet-menu-bar-dropdown-link.cjs.entry.js +5 -4
  38. package/lib/cjs/duet-menu-bar-dropdown.cjs.entry.js +7 -6
  39. package/lib/cjs/duet-menu-bar-item.cjs.entry.js +5 -4
  40. package/lib/cjs/duet-menu-bar-link.cjs.entry.js +5 -4
  41. package/lib/cjs/duet-menu-bar.cjs.entry.js +5 -4
  42. package/lib/cjs/duet-modal.cjs.entry.js +17 -14
  43. package/lib/cjs/duet-multiselect.cjs.entry.js +11 -10
  44. package/lib/cjs/duet-nav.cjs.entry.js +4 -3
  45. package/lib/cjs/duet-notification_2.cjs.entry.js +10 -8
  46. package/lib/cjs/duet-number-input.cjs.entry.js +5 -4
  47. package/lib/cjs/duet-overlay.cjs.entry.js +4 -3
  48. package/lib/cjs/duet-page-heading.cjs.entry.js +5 -4
  49. package/lib/cjs/duet-pagination_2.cjs.entry.js +19 -17
  50. package/lib/cjs/duet-popup-menu-item.cjs.entry.js +4 -3
  51. package/lib/cjs/duet-popup-menu.cjs.entry.js +5 -4
  52. package/lib/cjs/duet-progress.cjs.entry.js +4 -3
  53. package/lib/cjs/duet-promo-card.cjs.entry.js +6 -5
  54. package/lib/cjs/duet-radio_2.cjs.entry.js +6 -4
  55. package/lib/cjs/duet-range-slider.cjs.entry.js +3 -2
  56. package/lib/cjs/duet-scrollable_3.cjs.entry.js +44 -23
  57. package/lib/cjs/duet-section-layout.cjs.entry.js +6 -5
  58. package/lib/cjs/duet-select.cjs.entry.js +4 -3
  59. package/lib/cjs/duet-shaped-image.cjs.entry.js +5 -4
  60. package/lib/cjs/duet-show-more.cjs.entry.js +6 -5
  61. package/lib/cjs/duet-slideout-lang.cjs.entry.js +5 -4
  62. package/lib/cjs/duet-slideout-link.cjs.entry.js +5 -4
  63. package/lib/cjs/duet-slideout-panel-dropdown.cjs.entry.js +7 -6
  64. package/lib/cjs/duet-slideout-panel.cjs.entry.js +12 -11
  65. package/lib/cjs/duet-slideout.cjs.entry.js +10 -9
  66. package/lib/cjs/duet-step_2.cjs.entry.js +6 -4
  67. package/lib/cjs/duet-submenu-bar-dropdown-link.cjs.entry.js +5 -4
  68. package/lib/cjs/duet-submenu-bar-dropdown.cjs.entry.js +7 -6
  69. package/lib/cjs/duet-submenu-bar-item.cjs.entry.js +4 -3
  70. package/lib/cjs/duet-submenu-bar-link.cjs.entry.js +4 -3
  71. package/lib/cjs/duet-submenu-bar.cjs.entry.js +7 -6
  72. package/lib/cjs/duet-textarea.cjs.entry.js +4 -3
  73. package/lib/cjs/duet-toggle.cjs.entry.js +3 -2
  74. package/lib/cjs/duet-toolbar-dropdown-link.cjs.entry.js +5 -4
  75. package/lib/cjs/duet-toolbar-dropdown.cjs.entry.js +7 -6
  76. package/lib/cjs/duet-toolbar-item.cjs.entry.js +5 -4
  77. package/lib/cjs/duet-toolbar-link.cjs.entry.js +5 -4
  78. package/lib/cjs/duet-toolbar.cjs.entry.js +4 -3
  79. package/lib/cjs/duet-tooltip-button_2.cjs.entry.js +10 -8
  80. package/lib/cjs/duet-tooltip.cjs.entry.js +4 -3
  81. package/lib/cjs/duet-tray.cjs.entry.js +6 -5
  82. package/lib/cjs/duet-upload-aria-status.cjs.entry.js +2 -2
  83. package/lib/cjs/duet-upload-item.cjs.entry.js +7 -6
  84. package/lib/cjs/duet-visually-hidden.cjs.entry.js +4 -3
  85. package/lib/cjs/duet.cjs.js +15 -15
  86. package/lib/cjs/{errorcodes.utils-a86b1f94.js → errorcodes.utils-d9f472df.js} +1 -1
  87. package/lib/cjs/{focus-utils-f04d6c12.js → focus-utils-2de8d5de.js} +1 -1
  88. package/lib/cjs/index-7efe7e19.js +1996 -0
  89. package/lib/cjs/{language-utils-e8a527e5.js → language-utils-1ed4b266.js} +1 -0
  90. package/lib/cjs/loader.cjs.js +4 -4
  91. package/lib/cjs/{slot-utils-03a40c78.js → slot-utils-0664e341.js} +2 -0
  92. package/lib/collection/collection-manifest.json +2 -2
  93. package/lib/collection/components/duet-action-button/duet-action-button.js +1 -1
  94. package/lib/collection/components/duet-alert/duet-alert.js +5 -5
  95. package/lib/collection/components/duet-badge/duet-badge.js +2 -2
  96. package/lib/collection/components/duet-banner/duet-banner.js +2 -2
  97. package/lib/collection/components/duet-breadcrumbs/duet-breadcrumb.js +4 -4
  98. package/lib/collection/components/duet-breadcrumbs/duet-breadcrumbs.js +2 -2
  99. package/lib/collection/components/duet-button/duet-button.js +5 -5
  100. package/lib/collection/components/duet-callout/duet-callout.js +2 -2
  101. package/lib/collection/components/duet-caption/duet-caption.js +2 -2
  102. package/lib/collection/components/duet-card/duet-card.js +3 -3
  103. package/lib/collection/components/duet-chip/duet-chip.js +1 -1
  104. package/lib/collection/components/duet-choice/duet-checkmark.js +2 -2
  105. package/lib/collection/components/duet-collapsible/duet-collapsible.js +2 -2
  106. package/lib/collection/components/duet-contact-card/duet-contact-card.js +2 -2
  107. package/lib/collection/components/duet-cookie-consent/duet-cookie-consent.js +1 -1
  108. package/lib/collection/components/duet-divider/duet-divider.js +1 -1
  109. package/lib/collection/components/duet-empty-state/duet-empty-state.js +2 -2
  110. package/lib/collection/components/duet-fieldset/duet-fieldset.js +3 -3
  111. package/lib/collection/components/duet-file-chooser/duet-file-chooser.js +1 -1
  112. package/lib/collection/components/duet-footer/duet-footer.js +4 -4
  113. package/lib/collection/components/duet-heading/duet-heading.js +2 -2
  114. package/lib/collection/components/duet-hero/duet-hero.js +5 -5
  115. package/lib/collection/components/duet-icon/duet-icon.js +3 -3
  116. package/lib/collection/components/duet-layout/duet-layout.js +5 -5
  117. package/lib/collection/components/duet-link/duet-link.js +2 -2
  118. package/lib/collection/components/duet-list/duet-list.js +1 -1
  119. package/lib/collection/components/duet-list-item/duet-list-item.js +2 -2
  120. package/lib/collection/components/duet-logo/duet-logo.js +1 -1
  121. package/lib/collection/components/duet-menu-bar/duet-menu-bar.js +2 -2
  122. package/lib/collection/components/duet-menu-bar-button/duet-menu-bar-button.js +2 -2
  123. package/lib/collection/components/duet-menu-bar-dropdown/duet-menu-bar-dropdown.js +4 -4
  124. package/lib/collection/components/duet-menu-bar-dropdown-link/duet-menu-bar-dropdown-link.js +2 -2
  125. package/lib/collection/components/duet-menu-bar-item/duet-menu-bar-item.js +2 -2
  126. package/lib/collection/components/duet-menu-bar-link/duet-menu-bar-link.js +2 -2
  127. package/lib/collection/components/duet-modal/duet-modal.css +6 -0
  128. package/lib/collection/components/duet-modal/duet-modal.js +10 -8
  129. package/lib/collection/components/duet-multiselect/duet-multiselect.js +6 -6
  130. package/lib/collection/components/duet-nav/duet-nav.js +1 -1
  131. package/lib/collection/components/duet-notification/duet-notification.js +2 -2
  132. package/lib/collection/components/duet-notification-drawer/duet-notification-drawer.js +2 -2
  133. package/lib/collection/components/duet-overlay/duet-overlay.js +1 -1
  134. package/lib/collection/components/duet-page-heading/duet-page-heading.js +2 -2
  135. package/lib/collection/components/duet-pagination/duet-pagination.js +11 -11
  136. package/lib/collection/components/duet-paragraph/duet-paragraph.js +2 -2
  137. package/lib/collection/components/duet-popup-menu/duet-popup-menu.js +1 -1
  138. package/lib/collection/components/duet-popup-menu-item/duet-popup-menu-item.js +1 -1
  139. package/lib/collection/components/duet-promo-card/duet-promo-card.js +2 -2
  140. package/lib/collection/components/duet-range-stepper/duet-range-stepper.js +2 -2
  141. package/lib/collection/components/duet-scrollable/duet-scrollable.css +39 -9
  142. package/lib/collection/components/duet-scrollable/duet-scrollable.js +29 -11
  143. package/lib/collection/components/duet-section-layout/duet-section-layout.js +3 -3
  144. package/lib/collection/components/duet-shaped-image/duet-shaped-image.js +2 -2
  145. package/lib/collection/components/duet-show-more/duet-show-more.js +2 -2
  146. package/lib/collection/components/duet-slideout/duet-slideout.js +4 -4
  147. package/lib/collection/components/duet-slideout-lang/duet-slideout-lang.js +1 -1
  148. package/lib/collection/components/duet-slideout-link/duet-slideout-link.js +2 -2
  149. package/lib/collection/components/duet-slideout-panel/duet-slideout-panel.js +6 -6
  150. package/lib/collection/components/duet-slideout-panel-dropdown/duet-slideout-panel-dropdown.js +4 -4
  151. package/lib/collection/components/duet-spacer/duet-spacer.js +1 -1
  152. package/lib/collection/components/duet-spinner/duet-spinner.js +2 -2
  153. package/lib/collection/components/duet-stepper/duet-stepper.js +1 -1
  154. package/lib/collection/components/duet-submenu-bar/duet-submenu-bar.js +4 -4
  155. package/lib/collection/components/duet-submenu-bar-dropdown/duet-submenu-bar-dropdown.js +4 -4
  156. package/lib/collection/components/duet-submenu-bar-dropdown-link/duet-submenu-bar-dropdown-link.js +2 -2
  157. package/lib/collection/components/duet-submenu-bar-item/duet-submenu-bar-item.js +1 -1
  158. package/lib/collection/components/duet-submenu-bar-link/duet-submenu-bar-link.js +1 -1
  159. package/lib/collection/components/duet-tab-group/duet-tab-group.js +5 -5
  160. package/lib/collection/components/duet-table/duet-table.js +2 -2
  161. package/lib/collection/components/duet-toolbar/duet-toolbar.js +1 -1
  162. package/lib/collection/components/duet-toolbar-dropdown/duet-toolbar-dropdown.js +4 -4
  163. package/lib/collection/components/duet-toolbar-dropdown-link/duet-toolbar-dropdown-link.js +2 -2
  164. package/lib/collection/components/duet-toolbar-item/duet-toolbar-item.js +2 -2
  165. package/lib/collection/components/duet-toolbar-link/duet-toolbar-link.js +2 -2
  166. package/lib/collection/components/duet-tooltip/duet-tooltip-button.js +2 -2
  167. package/lib/collection/components/duet-tooltip/duet-tooltip-popup.js +2 -2
  168. package/lib/collection/components/duet-tray/duet-tray.js +2 -2
  169. package/lib/collection/components/duet-upload/duet-upload.js +2 -2
  170. package/lib/collection/components/duet-upload/mock.helpers.js +6 -4
  171. package/lib/collection/components/duet-upload-aria-status/duet-upload-aria-status.js +1 -1
  172. package/lib/collection/components/duet-upload-item/duet-upload-item.js +3 -3
  173. package/lib/collection/components/duet-visually-hidden/duet-visually-hidden.js +1 -1
  174. package/lib/collection/utils/axe-core-utils.js +12 -4
  175. package/lib/collection/utils/test-utils.js +82 -32
  176. package/lib/dist-custom-elements/duet-action-button.js +1 -1
  177. package/lib/dist-custom-elements/duet-alert.js +1 -1
  178. package/lib/dist-custom-elements/duet-badge.js +1 -1
  179. package/lib/dist-custom-elements/duet-banner.js +9 -8
  180. package/lib/dist-custom-elements/duet-breadcrumb.js +10 -9
  181. package/lib/dist-custom-elements/duet-breadcrumbs.js +6 -5
  182. package/lib/dist-custom-elements/duet-button.js +1 -1
  183. package/lib/dist-custom-elements/duet-callout.js +7 -6
  184. package/lib/dist-custom-elements/duet-caption.js +1 -1
  185. package/lib/dist-custom-elements/duet-card.js +8 -7
  186. package/lib/dist-custom-elements/duet-checkbox.js +1 -1
  187. package/lib/dist-custom-elements/duet-checkmark.js +1 -1
  188. package/lib/dist-custom-elements/duet-chip.js +1 -1
  189. package/lib/dist-custom-elements/duet-choice-group.js +11 -10
  190. package/lib/dist-custom-elements/duet-choice.js +8 -7
  191. package/lib/dist-custom-elements/duet-collapsible.js +7 -6
  192. package/lib/dist-custom-elements/duet-combobox.js +17 -16
  193. package/lib/dist-custom-elements/duet-contact-card.js +13 -12
  194. package/lib/dist-custom-elements/duet-cookie-consent.js +9 -8
  195. package/lib/dist-custom-elements/duet-date-picker.js +19 -18
  196. package/lib/dist-custom-elements/duet-divider.js +1 -1
  197. package/lib/dist-custom-elements/duet-editable-table.js +11 -10
  198. package/lib/dist-custom-elements/duet-empty-state.js +1 -1
  199. package/lib/dist-custom-elements/duet-fieldset.js +1 -1
  200. package/lib/dist-custom-elements/duet-file-chooser.js +5 -4
  201. package/lib/dist-custom-elements/duet-footer.js +15 -14
  202. package/lib/dist-custom-elements/duet-grid-item.js +1 -1
  203. package/lib/dist-custom-elements/duet-grid.js +1 -1
  204. package/lib/dist-custom-elements/duet-header.js +12 -11
  205. package/lib/dist-custom-elements/duet-heading.js +1 -1
  206. package/lib/dist-custom-elements/duet-hero.js +18 -17
  207. package/lib/dist-custom-elements/duet-icon.js +1 -1
  208. package/lib/dist-custom-elements/duet-input.js +1 -1
  209. package/lib/dist-custom-elements/duet-label.js +1 -1
  210. package/lib/dist-custom-elements/duet-layout.js +8 -7
  211. package/lib/dist-custom-elements/duet-link.js +1 -1
  212. package/lib/dist-custom-elements/duet-list-item.js +1 -1
  213. package/lib/dist-custom-elements/duet-list.js +1 -1
  214. package/lib/dist-custom-elements/duet-logo.js +1 -1
  215. package/lib/dist-custom-elements/duet-menu-bar-button.js +6 -5
  216. package/lib/dist-custom-elements/duet-menu-bar-dropdown-link.js +6 -5
  217. package/lib/dist-custom-elements/duet-menu-bar-dropdown.js +8 -7
  218. package/lib/dist-custom-elements/duet-menu-bar-item.js +6 -5
  219. package/lib/dist-custom-elements/duet-menu-bar-link.js +6 -5
  220. package/lib/dist-custom-elements/duet-menu-bar.js +6 -5
  221. package/lib/dist-custom-elements/duet-modal.js +24 -21
  222. package/lib/dist-custom-elements/duet-multiselect.js +19 -18
  223. package/lib/dist-custom-elements/duet-nav.js +4 -3
  224. package/lib/dist-custom-elements/duet-notification-drawer.js +9 -8
  225. package/lib/dist-custom-elements/duet-notification.js +7 -6
  226. package/lib/dist-custom-elements/duet-number-input.js +15 -14
  227. package/lib/dist-custom-elements/duet-overlay.js +1 -1
  228. package/lib/dist-custom-elements/duet-page-heading.js +6 -5
  229. package/lib/dist-custom-elements/duet-pagination.js +27 -26
  230. package/lib/dist-custom-elements/duet-paragraph.js +1 -1
  231. package/lib/dist-custom-elements/duet-popup-menu-item.js +5 -4
  232. package/lib/dist-custom-elements/duet-popup-menu.js +6 -5
  233. package/lib/dist-custom-elements/duet-progress.js +1 -1
  234. package/lib/dist-custom-elements/duet-promo-card.js +8 -7
  235. package/lib/dist-custom-elements/duet-radio-group.js +11 -10
  236. package/lib/dist-custom-elements/duet-radio.js +3 -2
  237. package/lib/dist-custom-elements/duet-range-slider.js +4 -3
  238. package/lib/dist-custom-elements/duet-range-stepper.js +9 -8
  239. package/lib/dist-custom-elements/duet-scrollable.js +1 -1
  240. package/lib/dist-custom-elements/duet-section-layout.js +6 -5
  241. package/lib/dist-custom-elements/duet-select.js +1 -1
  242. package/lib/dist-custom-elements/duet-shaped-image.js +5 -4
  243. package/lib/dist-custom-elements/duet-show-more.js +1 -1
  244. package/lib/dist-custom-elements/duet-slideout-lang.js +6 -5
  245. package/lib/dist-custom-elements/duet-slideout-link.js +6 -5
  246. package/lib/dist-custom-elements/duet-slideout-panel-dropdown.js +8 -7
  247. package/lib/dist-custom-elements/duet-slideout-panel.js +13 -12
  248. package/lib/dist-custom-elements/duet-slideout.js +12 -11
  249. package/lib/dist-custom-elements/duet-spacer.js +1 -1
  250. package/lib/dist-custom-elements/duet-spinner.js +1 -1
  251. package/lib/dist-custom-elements/duet-step.js +6 -5
  252. package/lib/dist-custom-elements/duet-stepper.js +5 -4
  253. package/lib/dist-custom-elements/duet-submenu-bar-dropdown-link.js +6 -5
  254. package/lib/dist-custom-elements/duet-submenu-bar-dropdown.js +8 -7
  255. package/lib/dist-custom-elements/duet-submenu-bar-item.js +5 -4
  256. package/lib/dist-custom-elements/duet-submenu-bar-link.js +5 -4
  257. package/lib/dist-custom-elements/duet-submenu-bar.js +9 -8
  258. package/lib/dist-custom-elements/duet-tab-group.js +21 -20
  259. package/lib/dist-custom-elements/duet-tab.js +4 -3
  260. package/lib/dist-custom-elements/duet-table.js +1 -1
  261. package/lib/dist-custom-elements/duet-textarea.js +13 -12
  262. package/lib/dist-custom-elements/duet-toggle.js +4 -3
  263. package/lib/dist-custom-elements/duet-toolbar-dropdown-link.js +6 -5
  264. package/lib/dist-custom-elements/duet-toolbar-dropdown.js +8 -7
  265. package/lib/dist-custom-elements/duet-toolbar-item.js +6 -5
  266. package/lib/dist-custom-elements/duet-toolbar-link.js +6 -5
  267. package/lib/dist-custom-elements/duet-toolbar.js +4 -3
  268. package/lib/dist-custom-elements/duet-tooltip-button.js +1 -1
  269. package/lib/dist-custom-elements/duet-tooltip-popup.js +1 -1
  270. package/lib/dist-custom-elements/duet-tooltip.js +1 -1
  271. package/lib/dist-custom-elements/duet-tray.js +8 -7
  272. package/lib/dist-custom-elements/duet-upload-aria-status.js +1 -1
  273. package/lib/dist-custom-elements/duet-upload-item.js +1 -1
  274. package/lib/dist-custom-elements/duet-upload.js +25 -24
  275. package/lib/dist-custom-elements/duet-visually-hidden.js +1 -1
  276. package/lib/dist-custom-elements/index.js +2 -1
  277. package/lib/dist-custom-elements/{p-5d1b1309.js → p-00eccbc8.js} +5 -4
  278. package/lib/dist-custom-elements/{p-dcbd3217.js → p-0231ea20.js} +5 -4
  279. package/lib/dist-custom-elements/{p-2f74a80b.js → p-02911244.js} +3 -3
  280. package/lib/dist-custom-elements/{p-f010dbb0.js → p-03c64124.js} +5 -4
  281. package/lib/dist-custom-elements/{p-184196bf.js → p-12a09bbc.js} +5 -4
  282. package/lib/dist-custom-elements/{p-8806e54e.js → p-151934ce.js} +8 -7
  283. package/lib/dist-custom-elements/{p-8b931125.js → p-1c341405.js} +11 -10
  284. package/lib/dist-custom-elements/{p-0301d789.js → p-21e0af47.js} +38 -19
  285. package/lib/dist-custom-elements/{p-2e4d752a.js → p-26d4d49e.js} +3 -2
  286. package/lib/dist-custom-elements/{p-a1b81dbc.js → p-2a041992.js} +7 -6
  287. package/lib/dist-custom-elements/{p-2e36d5bf.js → p-2f5e2da8.js} +1 -0
  288. package/lib/dist-custom-elements/{p-3a3e990d.js → p-330bf2a1.js} +4 -3
  289. package/lib/dist-custom-elements/{p-ecb49066.js → p-37e44d89.js} +5 -4
  290. package/lib/dist-custom-elements/{p-aaf04b7b.js → p-384f880b.js} +6 -5
  291. package/lib/dist-custom-elements/{p-164f1743.js → p-3e74515a.js} +10 -9
  292. package/lib/dist-custom-elements/{p-a5b07a4c.js → p-401b6b1f.js} +5 -4
  293. package/lib/dist-custom-elements/{p-e4489c9c.js → p-45dd5240.js} +7 -6
  294. package/lib/dist-custom-elements/p-47c44289.js +178 -0
  295. package/lib/dist-custom-elements/{p-d4cc9e7f.js → p-48a3af88.js} +3 -2
  296. package/lib/dist-custom-elements/{p-b691a561.js → p-5ad5934d.js} +4 -3
  297. package/lib/dist-custom-elements/{p-188198bb.js → p-61ffea9e.js} +6 -5
  298. package/lib/dist-custom-elements/{p-f3fed1d1.js → p-6bd18890.js} +15 -14
  299. package/lib/dist-custom-elements/{p-9d2943a1.js → p-706daff4.js} +14 -13
  300. package/lib/dist-custom-elements/{p-fe0978ef.js → p-7666f1bc.js} +5 -4
  301. package/lib/dist-custom-elements/{p-e4f40301.js → p-7eef087e.js} +12 -11
  302. package/lib/{esm/floating-ui.dom.esm-01fcd83a.js → dist-custom-elements/p-81287261.js} +1 -1
  303. package/lib/dist-custom-elements/{p-06e608ae.js → p-895db398.js} +2 -0
  304. package/lib/dist-custom-elements/{p-45ce252d.js → p-8fb1d873.js} +15 -14
  305. package/lib/dist-custom-elements/{p-2933d260.js → p-955053f9.js} +7 -5
  306. package/lib/dist-custom-elements/p-955746f9.js +1848 -0
  307. package/lib/dist-custom-elements/{p-d1f8f9d9.js → p-9bda0343.js} +5 -4
  308. package/lib/dist-custom-elements/{p-674040a2.js → p-9d348a4b.js} +4 -3
  309. package/lib/dist-custom-elements/{p-f390637a.js → p-9dc74a9b.js} +8 -7
  310. package/lib/dist-custom-elements/{p-9a63d9a1.js → p-ad23e869.js} +6 -5
  311. package/lib/dist-custom-elements/{p-2a29afc3.js → p-b8bb3910.js} +5 -4
  312. package/lib/dist-custom-elements/{p-c6788c34.js → p-bb20326f.js} +4 -3
  313. package/lib/dist-custom-elements/{p-ee310f8e.js → p-c7a796da.js} +4 -3
  314. package/lib/dist-custom-elements/{p-4bd749d9.js → p-d2f0147b.js} +1 -1
  315. package/lib/dist-custom-elements/{p-3ee1ee19.js → p-d7ff39b6.js} +5 -4
  316. package/lib/dist-custom-elements/{p-1a167655.js → p-e091bb48.js} +3 -2
  317. package/lib/dist-custom-elements/{p-2d44ce95.js → p-f1938f1a.js} +3 -2
  318. package/lib/dist-custom-elements/{p-b59388e4.js → p-fd601808.js} +9 -8
  319. package/lib/duet/duet.esm.js +1 -1
  320. package/lib/duet/duet.js +1 -1
  321. package/lib/duet/p-01e99b47.system.entry.js +4 -0
  322. package/lib/duet/p-032d42d4.entry.js +4 -0
  323. package/lib/duet/p-06472b8c.entry.js +4 -0
  324. package/lib/duet/p-064b908b.entry.js +4 -0
  325. package/lib/duet/p-069aaf78.entry.js +4 -0
  326. package/lib/duet/{p-00638431.system.entry.js → p-077b9a06.system.entry.js} +1 -1
  327. package/lib/duet/p-08866b96.system.entry.js +4 -0
  328. package/lib/duet/{p-09f2162b.system.entry.js → p-08daf525.system.entry.js} +1 -1
  329. package/lib/duet/p-0a042569.entry.js +4 -0
  330. package/lib/duet/p-0c3a491b.system.entry.js +4 -0
  331. package/lib/duet/{p-f0a8edfa.system.entry.js → p-0cbdf836.system.entry.js} +1 -1
  332. package/lib/duet/{p-15d65ccc.system.js → p-0dc9089b.system.js} +1 -1
  333. package/lib/duet/{p-fabb616b.js → p-0f1980bc.js} +1 -1
  334. package/lib/duet/{p-bc99f838.system.entry.js → p-115a50f2.system.entry.js} +1 -1
  335. package/lib/duet/{p-c9c57249.system.entry.js → p-12b4df90.system.entry.js} +1 -1
  336. package/lib/duet/p-13ea970e.system.entry.js +4 -0
  337. package/lib/duet/{p-d537a47b.entry.js → p-155b7733.entry.js} +1 -1
  338. package/lib/duet/p-16be8ba9.entry.js +4 -0
  339. package/lib/duet/{p-b0d67f51.entry.js → p-16e63390.entry.js} +1 -1
  340. package/lib/duet/p-1784b1d2.js +1 -1
  341. package/lib/duet/{p-48e4b33e.system.entry.js → p-17eeb1cc.system.entry.js} +1 -1
  342. package/lib/duet/p-1801e2be.entry.js +4 -0
  343. package/lib/duet/p-18d8207e.entry.js +4 -0
  344. package/lib/duet/{p-a87c1819.entry.js → p-198b0f16.entry.js} +1 -1
  345. package/lib/duet/p-1a6ea3db.entry.js +4 -0
  346. package/lib/duet/p-1d1f8607.entry.js +4 -0
  347. package/lib/duet/p-23805ac9.entry.js +4 -0
  348. package/lib/duet/p-2383fbeb.entry.js +4 -0
  349. package/lib/duet/p-2504c504.entry.js +4 -0
  350. package/lib/duet/p-28106a87.system.entry.js +4 -0
  351. package/lib/duet/{p-322273ee.system.entry.js → p-2928c320.system.entry.js} +1 -1
  352. package/lib/duet/{p-1af39d2d.entry.js → p-29665476.entry.js} +1 -1
  353. package/lib/duet/p-2aa796b7.js +4 -0
  354. package/lib/duet/p-2b9defde.system.entry.js +4 -0
  355. package/lib/duet/p-2c78ff7b.system.entry.js +4 -0
  356. package/lib/duet/p-300c8dd9.entry.js +4 -0
  357. package/lib/duet/{p-b3f5fea3.entry.js → p-32be247b.entry.js} +1 -1
  358. package/lib/duet/p-32d698f2.system.entry.js +4 -0
  359. package/lib/duet/{p-d9800a64.entry.js → p-364d7058.entry.js} +1 -1
  360. package/lib/duet/p-3e1a0cb7.entry.js +4 -0
  361. package/lib/duet/p-41b6d132.entry.js +4 -0
  362. package/lib/duet/{p-15a018c2.entry.js → p-41d5039a.entry.js} +1 -1
  363. package/lib/duet/p-428f66d6.system.entry.js +4 -0
  364. package/lib/duet/p-42e31c87.entry.js +4 -0
  365. package/lib/duet/p-43417c63.entry.js +4 -0
  366. package/lib/duet/{p-d2082904.system.entry.js → p-4487736b.system.entry.js} +1 -1
  367. package/lib/duet/p-4520f63d.system.entry.js +4 -0
  368. package/lib/duet/p-46079f71.entry.js +4 -0
  369. package/lib/duet/p-48879a51.entry.js +4 -0
  370. package/lib/duet/{p-4083bda5.entry.js → p-4a8d2af0.entry.js} +1 -1
  371. package/lib/duet/{p-0204b3b0.js → p-4bc401c3.js} +1 -1
  372. package/lib/duet/p-50c0ea9c.system.entry.js +4 -0
  373. package/lib/duet/p-54351362.entry.js +4 -0
  374. package/lib/duet/p-54c28fa4.system.entry.js +4 -0
  375. package/lib/duet/p-55327462.entry.js +4 -0
  376. package/lib/duet/p-5672308b.entry.js +4 -0
  377. package/lib/duet/p-56d35ccf.system.entry.js +4 -0
  378. package/lib/duet/p-5776972c.entry.js +4 -0
  379. package/lib/duet/p-585ad67b.entry.js +4 -0
  380. package/lib/duet/p-5866eaea.entry.js +4 -0
  381. package/lib/duet/p-58cb8b0b.system.entry.js +4 -0
  382. package/lib/duet/p-5abdc5ab.entry.js +4 -0
  383. package/lib/duet/p-5cb08833.system.entry.js +4 -0
  384. package/lib/duet/p-5f3de870.system.entry.js +4 -0
  385. package/lib/duet/{p-da20db91.system.js → p-6084bf4c.system.js} +1 -1
  386. package/lib/duet/{p-e36d3c27.entry.js → p-60d43265.entry.js} +1 -1
  387. package/lib/duet/{p-4a65e996.system.entry.js → p-61a24bce.system.entry.js} +1 -1
  388. package/lib/duet/{p-f370f3c5.system.entry.js → p-66e3ce81.system.entry.js} +1 -1
  389. package/lib/duet/p-6892b798.system.entry.js +4 -0
  390. package/lib/duet/{p-36eb52a8.system.entry.js → p-68a9aeee.system.entry.js} +1 -1
  391. package/lib/duet/p-68f52c23.system.entry.js +4 -0
  392. package/lib/duet/p-693ad8aa.entry.js +4 -0
  393. package/lib/duet/{p-e67c546c.system.entry.js → p-6a496c70.system.entry.js} +1 -1
  394. package/lib/duet/{p-e1fb0446.entry.js → p-6a84bf93.entry.js} +1 -1
  395. package/lib/duet/p-6bb927f9.system.entry.js +4 -0
  396. package/lib/duet/p-6c76d396.entry.js +4 -0
  397. package/lib/duet/p-6cdd3596.entry.js +4 -0
  398. package/lib/duet/{p-a909fac2.system.entry.js → p-6d157e53.system.entry.js} +2 -2
  399. package/lib/duet/p-6d75cdf6.system.js +4 -0
  400. package/lib/duet/p-6db296a5.entry.js +4 -0
  401. package/lib/duet/{p-95d3a1c1.system.entry.js → p-6dfa9f0e.system.entry.js} +1 -1
  402. package/lib/duet/{p-d54716cb.system.entry.js → p-70ba1823.system.entry.js} +1 -1
  403. package/lib/duet/p-72affe21.system.entry.js +4 -0
  404. package/lib/duet/p-7340e2e2.entry.js +4 -0
  405. package/lib/duet/p-7344d97c.system.js +4 -0
  406. package/lib/duet/p-7a5dd34d.entry.js +4 -0
  407. package/lib/duet/p-7b0e681f.system.entry.js +4 -0
  408. package/lib/duet/{p-55ce0916.system.entry.js → p-7bfc6d05.system.entry.js} +1 -1
  409. package/lib/duet/p-7c3649ba.js +5 -0
  410. package/lib/duet/p-7c533802.entry.js +4 -0
  411. package/lib/duet/p-7d473104.system.entry.js +4 -0
  412. package/lib/duet/{p-22b1cabe.system.entry.js → p-7e4597c6.system.entry.js} +1 -1
  413. package/lib/duet/p-7f8fc279.entry.js +4 -0
  414. package/lib/duet/p-7ff17c05.system.entry.js +4 -0
  415. package/lib/duet/p-80d722bc.entry.js +4 -0
  416. package/lib/duet/{p-31ed51c3.js → p-81287261.js} +1 -1
  417. package/lib/duet/p-813c2271.entry.js +4 -0
  418. package/lib/duet/{p-71b71fae.system.entry.js → p-83b88e0d.system.entry.js} +1 -1
  419. package/lib/duet/{p-e240a248.system.entry.js → p-84c50c75.system.entry.js} +1 -1
  420. package/lib/duet/p-8589c504.system.entry.js +4 -0
  421. package/lib/duet/p-86361d66.system.entry.js +4 -0
  422. package/lib/duet/p-8aefdb36.entry.js +4 -0
  423. package/lib/duet/p-8d4fde72.entry.js +4 -0
  424. package/lib/duet/{p-49492752.system.entry.js → p-8dcb869d.system.entry.js} +2 -2
  425. package/lib/duet/p-933895d6.system.entry.js +4 -0
  426. package/lib/duet/p-93d9f454.system.js +4 -0
  427. package/lib/duet/{p-2ebe1ac5.system.entry.js → p-95778aca.system.entry.js} +2 -2
  428. package/lib/duet/{p-fd736af1.entry.js → p-97f74160.entry.js} +1 -1
  429. package/lib/duet/p-98ac1721.system.entry.js +4 -0
  430. package/lib/duet/{p-b0c801cc.system.entry.js → p-9b6cc90a.system.entry.js} +1 -1
  431. package/lib/duet/{p-56c629ed.entry.js → p-9bdec5df.entry.js} +1 -1
  432. package/lib/duet/p-9d4cd103.system.entry.js +4 -0
  433. package/lib/duet/p-9d5823eb.entry.js +4 -0
  434. package/lib/duet/{p-847bf63e.entry.js → p-9e60a58d.entry.js} +1 -1
  435. package/lib/duet/p-9ef799f8.js +4 -0
  436. package/lib/duet/p-9f850d18.system.entry.js +4 -0
  437. package/lib/duet/p-9f9e290a.system.entry.js +4 -0
  438. package/lib/duet/p-a168b3f5.system.js +4 -0
  439. package/lib/duet/p-a32dad7f.system.entry.js +4 -0
  440. package/lib/duet/p-a4d9c151.system.entry.js +4 -0
  441. package/lib/duet/p-a5d65d5f.entry.js +4 -0
  442. package/lib/duet/{p-ec9dbf7d.system.entry.js → p-a7768425.system.entry.js} +2 -2
  443. package/lib/duet/p-a7c62459.system.entry.js +4 -0
  444. package/lib/duet/{p-7fcbb429.system.entry.js → p-a8301a1a.system.entry.js} +1 -1
  445. package/lib/duet/{p-dd9e6250.system.entry.js → p-a9891098.system.entry.js} +1 -1
  446. package/lib/duet/p-aa1f6b55.entry.js +4 -0
  447. package/lib/duet/p-ac596f9f.entry.js +4 -0
  448. package/lib/duet/p-acd65ed7.entry.js +4 -0
  449. package/lib/duet/p-ad433963.system.entry.js +4 -0
  450. package/lib/duet/{p-87e7e6d8.entry.js → p-ae714885.entry.js} +1 -1
  451. package/lib/duet/p-aeaa9698.entry.js +4 -0
  452. package/lib/duet/{p-1dc415a6.system.entry.js → p-aface64d.system.entry.js} +1 -1
  453. package/lib/duet/p-afadf391.entry.js +4 -0
  454. package/lib/duet/p-b0be53ba.entry.js +4 -0
  455. package/lib/duet/p-b25d69bf.system.entry.js +4 -0
  456. package/lib/duet/p-b2b49d1a.entry.js +4 -0
  457. package/lib/duet/p-b3bff87d.entry.js +4 -0
  458. package/lib/duet/{p-6f74db7d.system.entry.js → p-b5e50220.system.entry.js} +2 -2
  459. package/lib/duet/{p-ec7dd416.system.entry.js → p-b70dd317.system.entry.js} +1 -1
  460. package/lib/duet/p-b8fc9725.system.entry.js +4 -0
  461. package/lib/duet/p-b9772bdf.entry.js +4 -0
  462. package/lib/duet/p-b9e27ff4.entry.js +4 -0
  463. package/lib/duet/{p-9ef3bc8d.system.entry.js → p-ba7fbd88.system.entry.js} +1 -1
  464. package/lib/duet/p-bd936407.js +4 -0
  465. package/lib/duet/{p-24046fe3.system.entry.js → p-bddc227d.system.entry.js} +1 -1
  466. package/lib/duet/{p-b3c24039.system.entry.js → p-bf5630d6.system.entry.js} +1 -1
  467. package/lib/duet/p-bfecf35c.entry.js +4 -0
  468. package/lib/duet/p-c1445714.system.js +1 -1
  469. package/lib/duet/p-c3de57c1.system.entry.js +4 -0
  470. package/lib/duet/{p-81e718f5.system.entry.js → p-c45a4823.system.entry.js} +1 -1
  471. package/lib/duet/p-c45c1cc8.entry.js +4 -0
  472. package/lib/duet/{p-29ef8ffc.system.entry.js → p-c5759522.system.entry.js} +1 -1
  473. package/lib/duet/p-c62ed778.entry.js +4 -0
  474. package/lib/duet/{p-81681caf.entry.js → p-cb4e6c86.entry.js} +1 -1
  475. package/lib/duet/p-cf83f662.entry.js +4 -0
  476. package/lib/duet/p-d0f3224e.entry.js +4 -0
  477. package/lib/duet/{p-bdd90cdd.system.entry.js → p-d52fa492.system.entry.js} +1 -1
  478. package/lib/duet/p-d6c95c73.system.entry.js +4 -0
  479. package/lib/duet/p-d920063d.entry.js +4 -0
  480. package/lib/duet/p-dde61943.system.js +4 -0
  481. package/lib/duet/p-e0db32fc.system.entry.js +4 -0
  482. package/lib/duet/p-e38064d5.entry.js +4 -0
  483. package/lib/duet/p-e4674cda.entry.js +4 -0
  484. package/lib/duet/p-e7d7928e.system.js +5 -0
  485. package/lib/duet/{p-8a9f7476.entry.js → p-e824a614.entry.js} +1 -1
  486. package/lib/duet/p-ec143606.entry.js +4 -0
  487. package/lib/duet/{p-aad5c506.system.entry.js → p-ee6f4bc1.system.entry.js} +2 -2
  488. package/lib/duet/p-ee8bcb1f.entry.js +4 -0
  489. package/lib/duet/{p-bc2af760.system.entry.js → p-ef9675f8.system.entry.js} +2 -2
  490. package/lib/duet/{p-ed7d1160.system.entry.js → p-ef9b2ced.system.entry.js} +1 -1
  491. package/lib/duet/p-f0eeebb5.entry.js +4 -0
  492. package/lib/duet/p-f1a726c9.entry.js +4 -0
  493. package/lib/duet/{p-b5bbe11d.system.entry.js → p-f2f1de65.system.entry.js} +2 -2
  494. package/lib/duet/{p-2936ccf3.system.entry.js → p-f6ea07d1.system.entry.js} +1 -1
  495. package/lib/duet/p-f6fc4754.system.entry.js +4 -0
  496. package/lib/duet/p-f9069050.system.entry.js +4 -0
  497. package/lib/duet/p-fbb2d1c4.system.entry.js +4 -0
  498. package/lib/duet/{p-47fa3bf9.entry.js → p-fc76bb60.entry.js} +1 -1
  499. package/lib/duet/p-fd1cbfc8.entry.js +4 -0
  500. package/lib/esm/{app-globals-45aa6d20.js → app-globals-21820dd0.js} +2 -0
  501. package/lib/esm/duet-action-button.entry.js +5 -4
  502. package/lib/esm/duet-alert.entry.js +10 -9
  503. package/lib/esm/duet-badge.entry.js +5 -4
  504. package/lib/esm/duet-banner.entry.js +6 -5
  505. package/lib/esm/duet-breadcrumb.entry.js +8 -7
  506. package/lib/esm/duet-breadcrumbs.entry.js +6 -5
  507. package/lib/esm/duet-button_2.entry.js +13 -11
  508. package/lib/esm/duet-callout.entry.js +6 -5
  509. package/lib/esm/duet-caption_4.entry.js +18 -14
  510. package/lib/esm/duet-card.entry.js +6 -5
  511. package/lib/esm/duet-checkbox.entry.js +3 -2
  512. package/lib/esm/duet-checkmark.entry.js +5 -4
  513. package/lib/esm/duet-chip.entry.js +4 -3
  514. package/lib/esm/duet-choice_2.entry.js +7 -5
  515. package/lib/esm/duet-collapsible.entry.js +6 -5
  516. package/lib/esm/duet-combobox.entry.js +5 -4
  517. package/lib/esm/duet-contact-card.entry.js +6 -5
  518. package/lib/esm/duet-cookie-consent.entry.js +4 -3
  519. package/lib/esm/duet-date-picker.entry.js +6 -5
  520. package/lib/esm/duet-divider_2.entry.js +7 -5
  521. package/lib/esm/duet-editable-table_3.entry.js +13 -10
  522. package/lib/esm/duet-empty-state.entry.js +5 -4
  523. package/lib/esm/duet-fieldset.entry.js +7 -6
  524. package/lib/esm/duet-file-chooser.entry.js +4 -3
  525. package/lib/esm/duet-footer.entry.js +9 -8
  526. package/lib/esm/duet-grid_2.entry.js +5 -3
  527. package/lib/esm/duet-header_2.entry.js +7 -5
  528. package/lib/esm/duet-hero.entry.js +10 -9
  529. package/lib/esm/duet-icon.entry.js +6 -5
  530. package/lib/esm/duet-input_2.entry.js +7 -5
  531. package/lib/esm/duet-layout.entry.js +8 -7
  532. package/lib/esm/duet-list_2.entry.js +8 -6
  533. package/lib/esm/duet-menu-bar-button.entry.js +5 -4
  534. package/lib/esm/duet-menu-bar-dropdown-link.entry.js +5 -4
  535. package/lib/esm/duet-menu-bar-dropdown.entry.js +7 -6
  536. package/lib/esm/duet-menu-bar-item.entry.js +5 -4
  537. package/lib/esm/duet-menu-bar-link.entry.js +5 -4
  538. package/lib/esm/duet-menu-bar.entry.js +5 -4
  539. package/lib/esm/duet-modal.entry.js +17 -14
  540. package/lib/esm/duet-multiselect.entry.js +11 -10
  541. package/lib/esm/duet-nav.entry.js +4 -3
  542. package/lib/esm/duet-notification_2.entry.js +10 -8
  543. package/lib/esm/duet-number-input.entry.js +5 -4
  544. package/lib/esm/duet-overlay.entry.js +4 -3
  545. package/lib/esm/duet-page-heading.entry.js +5 -4
  546. package/lib/esm/duet-pagination_2.entry.js +19 -17
  547. package/lib/esm/duet-popup-menu-item.entry.js +4 -3
  548. package/lib/esm/duet-popup-menu.entry.js +6 -5
  549. package/lib/esm/duet-progress.entry.js +4 -3
  550. package/lib/esm/duet-promo-card.entry.js +6 -5
  551. package/lib/esm/duet-radio_2.entry.js +6 -4
  552. package/lib/esm/duet-range-slider.entry.js +3 -2
  553. package/lib/esm/duet-scrollable_3.entry.js +44 -23
  554. package/lib/esm/duet-section-layout.entry.js +6 -5
  555. package/lib/esm/duet-select.entry.js +4 -3
  556. package/lib/esm/duet-shaped-image.entry.js +5 -4
  557. package/lib/esm/duet-show-more.entry.js +6 -5
  558. package/lib/esm/duet-slideout-lang.entry.js +5 -4
  559. package/lib/esm/duet-slideout-link.entry.js +5 -4
  560. package/lib/esm/duet-slideout-panel-dropdown.entry.js +7 -6
  561. package/lib/esm/duet-slideout-panel.entry.js +12 -11
  562. package/lib/esm/duet-slideout.entry.js +10 -9
  563. package/lib/esm/duet-step_2.entry.js +6 -4
  564. package/lib/esm/duet-submenu-bar-dropdown-link.entry.js +5 -4
  565. package/lib/esm/duet-submenu-bar-dropdown.entry.js +7 -6
  566. package/lib/esm/duet-submenu-bar-item.entry.js +4 -3
  567. package/lib/esm/duet-submenu-bar-link.entry.js +4 -3
  568. package/lib/esm/duet-submenu-bar.entry.js +7 -6
  569. package/lib/esm/duet-textarea.entry.js +4 -3
  570. package/lib/esm/duet-toggle.entry.js +3 -2
  571. package/lib/esm/duet-toolbar-dropdown-link.entry.js +5 -4
  572. package/lib/esm/duet-toolbar-dropdown.entry.js +7 -6
  573. package/lib/esm/duet-toolbar-item.entry.js +5 -4
  574. package/lib/esm/duet-toolbar-link.entry.js +5 -4
  575. package/lib/esm/duet-toolbar.entry.js +4 -3
  576. package/lib/esm/duet-tooltip-button_2.entry.js +10 -8
  577. package/lib/esm/duet-tooltip.entry.js +5 -4
  578. package/lib/esm/duet-tray.entry.js +6 -5
  579. package/lib/esm/duet-upload-aria-status.entry.js +2 -2
  580. package/lib/esm/duet-upload-item.entry.js +7 -6
  581. package/lib/esm/duet-visually-hidden.entry.js +4 -3
  582. package/lib/esm/duet.js +16 -16
  583. package/lib/esm/{errorcodes.utils-e681347c.js → errorcodes.utils-a4ae6efc.js} +1 -1
  584. package/lib/{dist-custom-elements/p-31ed51c3.js → esm/floating-ui.dom.esm-ebc91b33.js} +1 -1
  585. package/lib/esm/{focus-utils-f0e6853d.js → focus-utils-f583d4fb.js} +1 -1
  586. package/lib/esm/index-640026f0.js +1962 -0
  587. package/lib/esm/{language-utils-00ca4c55.js → language-utils-eda57343.js} +1 -0
  588. package/lib/esm/loader.js +5 -5
  589. package/lib/esm/{slot-utils-b50aaef5.js → slot-utils-00899492.js} +2 -0
  590. package/lib/esm/token-utils-1f843fb9.js +1 -1
  591. package/lib/esm-es5/app-globals-21820dd0.js +4 -0
  592. package/lib/esm-es5/duet-action-button.entry.js +1 -1
  593. package/lib/esm-es5/duet-alert.entry.js +2 -2
  594. package/lib/esm-es5/duet-badge.entry.js +1 -1
  595. package/lib/esm-es5/duet-banner.entry.js +1 -1
  596. package/lib/esm-es5/duet-breadcrumb.entry.js +1 -1
  597. package/lib/esm-es5/duet-breadcrumbs.entry.js +1 -1
  598. package/lib/esm-es5/duet-button_2.entry.js +1 -1
  599. package/lib/esm-es5/duet-callout.entry.js +1 -1
  600. package/lib/esm-es5/duet-caption_4.entry.js +2 -2
  601. package/lib/esm-es5/duet-card.entry.js +1 -1
  602. package/lib/esm-es5/duet-checkbox.entry.js +1 -1
  603. package/lib/esm-es5/duet-checkmark.entry.js +1 -1
  604. package/lib/esm-es5/duet-chip.entry.js +2 -2
  605. package/lib/esm-es5/duet-choice_2.entry.js +1 -1
  606. package/lib/esm-es5/duet-collapsible.entry.js +2 -2
  607. package/lib/esm-es5/duet-combobox.entry.js +1 -1
  608. package/lib/esm-es5/duet-contact-card.entry.js +1 -1
  609. package/lib/esm-es5/duet-cookie-consent.entry.js +1 -1
  610. package/lib/esm-es5/duet-date-picker.entry.js +1 -1
  611. package/lib/esm-es5/duet-divider_2.entry.js +1 -1
  612. package/lib/esm-es5/duet-editable-table_3.entry.js +2 -2
  613. package/lib/esm-es5/duet-empty-state.entry.js +1 -1
  614. package/lib/esm-es5/duet-fieldset.entry.js +1 -1
  615. package/lib/esm-es5/duet-file-chooser.entry.js +2 -2
  616. package/lib/esm-es5/duet-footer.entry.js +1 -1
  617. package/lib/esm-es5/duet-grid_2.entry.js +1 -1
  618. package/lib/esm-es5/duet-header_2.entry.js +1 -1
  619. package/lib/esm-es5/duet-hero.entry.js +2 -2
  620. package/lib/esm-es5/duet-icon.entry.js +2 -2
  621. package/lib/esm-es5/duet-input_2.entry.js +1 -1
  622. package/lib/esm-es5/duet-layout.entry.js +1 -1
  623. package/lib/esm-es5/duet-list_2.entry.js +2 -2
  624. package/lib/esm-es5/duet-menu-bar-button.entry.js +2 -2
  625. package/lib/esm-es5/duet-menu-bar-dropdown-link.entry.js +1 -1
  626. package/lib/esm-es5/duet-menu-bar-dropdown.entry.js +1 -1
  627. package/lib/esm-es5/duet-menu-bar-item.entry.js +2 -2
  628. package/lib/esm-es5/duet-menu-bar-link.entry.js +1 -1
  629. package/lib/esm-es5/duet-menu-bar.entry.js +1 -1
  630. package/lib/esm-es5/duet-modal.entry.js +2 -2
  631. package/lib/esm-es5/duet-multiselect.entry.js +2 -2
  632. package/lib/esm-es5/duet-nav.entry.js +1 -1
  633. package/lib/esm-es5/duet-notification_2.entry.js +2 -2
  634. package/lib/esm-es5/duet-number-input.entry.js +2 -2
  635. package/lib/esm-es5/duet-overlay.entry.js +1 -1
  636. package/lib/esm-es5/duet-page-heading.entry.js +1 -1
  637. package/lib/esm-es5/duet-pagination_2.entry.js +2 -2
  638. package/lib/esm-es5/duet-popup-menu-item.entry.js +2 -2
  639. package/lib/esm-es5/duet-popup-menu.entry.js +1 -1
  640. package/lib/esm-es5/duet-progress.entry.js +1 -1
  641. package/lib/esm-es5/duet-promo-card.entry.js +2 -2
  642. package/lib/esm-es5/duet-radio_2.entry.js +1 -1
  643. package/lib/esm-es5/duet-range-slider.entry.js +1 -1
  644. package/lib/esm-es5/duet-scrollable_3.entry.js +1 -1
  645. package/lib/esm-es5/duet-section-layout.entry.js +1 -1
  646. package/lib/esm-es5/duet-select.entry.js +1 -1
  647. package/lib/esm-es5/duet-shaped-image.entry.js +1 -1
  648. package/lib/esm-es5/duet-show-more.entry.js +1 -1
  649. package/lib/esm-es5/duet-slideout-lang.entry.js +1 -1
  650. package/lib/esm-es5/duet-slideout-link.entry.js +1 -1
  651. package/lib/esm-es5/duet-slideout-panel-dropdown.entry.js +1 -1
  652. package/lib/esm-es5/duet-slideout-panel.entry.js +2 -2
  653. package/lib/esm-es5/duet-slideout.entry.js +2 -2
  654. package/lib/esm-es5/duet-step_2.entry.js +1 -1
  655. package/lib/esm-es5/duet-submenu-bar-dropdown-link.entry.js +1 -1
  656. package/lib/esm-es5/duet-submenu-bar-dropdown.entry.js +1 -1
  657. package/lib/esm-es5/duet-submenu-bar-item.entry.js +2 -2
  658. package/lib/esm-es5/duet-submenu-bar-link.entry.js +1 -1
  659. package/lib/esm-es5/duet-submenu-bar.entry.js +2 -2
  660. package/lib/esm-es5/duet-textarea.entry.js +1 -1
  661. package/lib/esm-es5/duet-toggle.entry.js +1 -1
  662. package/lib/esm-es5/duet-toolbar-dropdown-link.entry.js +1 -1
  663. package/lib/esm-es5/duet-toolbar-dropdown.entry.js +2 -2
  664. package/lib/esm-es5/duet-toolbar-item.entry.js +2 -2
  665. package/lib/esm-es5/duet-toolbar-link.entry.js +1 -1
  666. package/lib/esm-es5/duet-toolbar.entry.js +1 -1
  667. package/lib/esm-es5/duet-tooltip-button_2.entry.js +2 -2
  668. package/lib/esm-es5/duet-tooltip.entry.js +1 -1
  669. package/lib/esm-es5/duet-tray.entry.js +1 -1
  670. package/lib/esm-es5/duet-upload-aria-status.entry.js +1 -1
  671. package/lib/esm-es5/duet-upload-item.entry.js +2 -2
  672. package/lib/esm-es5/duet-visually-hidden.entry.js +1 -1
  673. package/lib/esm-es5/duet.js +2 -2
  674. package/lib/esm-es5/{errorcodes.utils-e681347c.js → errorcodes.utils-a4ae6efc.js} +1 -1
  675. package/lib/esm-es5/{floating-ui.dom.esm-01fcd83a.js → floating-ui.dom.esm-ebc91b33.js} +1 -1
  676. package/lib/esm-es5/focus-utils-f583d4fb.js +4 -0
  677. package/lib/esm-es5/index-640026f0.js +5 -0
  678. package/lib/esm-es5/language-utils-eda57343.js +4 -0
  679. package/lib/esm-es5/loader.js +2 -2
  680. package/lib/esm-es5/slot-utils-00899492.js +4 -0
  681. package/lib/esm-es5/token-utils-1f843fb9.js +1 -1
  682. package/lib/loader/cdn.js +1 -1
  683. package/lib/loader/index.cjs.js +1 -1
  684. package/lib/loader/index.d.ts +3 -0
  685. package/lib/loader/index.es2017.js +1 -1
  686. package/lib/loader/index.js +1 -1
  687. package/lib/types/components/duet-modal/duet-modal.d.ts +1 -0
  688. package/lib/types/components/duet-upload/mock.helpers.d.ts +1 -0
  689. package/lib/types/stencil-public-runtime.d.ts +3 -10
  690. package/lib/types/utils/axe-core-utils.d.ts +2 -1
  691. package/lib/types/utils/test-utils.d.ts +22 -10
  692. package/lib/types/utils/watch-options.d.ts +2 -2
  693. package/package.json +17 -16
  694. package/lib/cjs/index-c3716ea8.js +0 -2836
  695. package/lib/collection/components/duet-action-button/duet-action-button.a11y.e2e.js +0 -13
  696. package/lib/collection/components/duet-alert/duet-alert.a11y.e2e.js +0 -20
  697. package/lib/collection/components/duet-alert/duet-alert.e2e.js +0 -53
  698. package/lib/collection/components/duet-badge/duet-badge.a11y.e2e.js +0 -20
  699. package/lib/collection/components/duet-badge/duet-badge.e2e.js +0 -28
  700. package/lib/collection/components/duet-banner/duet-banner.a11y.e2e.js +0 -34
  701. package/lib/collection/components/duet-banner/duet-banner.e2e.js +0 -23
  702. package/lib/collection/components/duet-breadcrumbs/duet-breadcrumbs.a11y.e2e.js +0 -17
  703. package/lib/collection/components/duet-breadcrumbs/duet-breadcrumbs.e2e.js +0 -18
  704. package/lib/collection/components/duet-button/duet-button.a11y.e2e.js +0 -48
  705. package/lib/collection/components/duet-button/duet-button.e2e.js +0 -212
  706. package/lib/collection/components/duet-callout/duet-callout.a11y.e2e.js +0 -17
  707. package/lib/collection/components/duet-callout/duet-callout.e2e.js +0 -21
  708. package/lib/collection/components/duet-caption/duet-caption.a11y.e2e.js +0 -13
  709. package/lib/collection/components/duet-caption/duet-caption.e2e.js +0 -26
  710. package/lib/collection/components/duet-card/duet-card.a11y.e2e.js +0 -29
  711. package/lib/collection/components/duet-card/duet-card.e2e.js +0 -91
  712. package/lib/collection/components/duet-checkbox/duet-checkbox.a11y.e2e.js +0 -20
  713. package/lib/collection/components/duet-checkbox/duet-checkbox.e2e.js +0 -112
  714. package/lib/collection/components/duet-chip/duet-chip.a11y.e2e.js +0 -25
  715. package/lib/collection/components/duet-chip/duet-chip.e2e.js +0 -56
  716. package/lib/collection/components/duet-choice/duet-choice.a11y.e2e.js +0 -79
  717. package/lib/collection/components/duet-choice/duet-choice.e2e.js +0 -184
  718. package/lib/collection/components/duet-choice-group/duet-choice-group.a11y.e2e.js +0 -17
  719. package/lib/collection/components/duet-choice-group/duet-choice-group.e2e.js +0 -102
  720. package/lib/collection/components/duet-collapsible/duet-collapsible.a11y.e2e.js +0 -24
  721. package/lib/collection/components/duet-collapsible/duet-collapsible.e2e.js +0 -123
  722. package/lib/collection/components/duet-combobox/duet-combobox.a11y.e2e.js +0 -17
  723. package/lib/collection/components/duet-combobox/duet-combobox.e2e.js +0 -153
  724. package/lib/collection/components/duet-contact-card/duet-contact-card.a11y.e2e.js +0 -36
  725. package/lib/collection/components/duet-cookie-consent/duet-cookie-consent.a11y.e2e.js +0 -16
  726. package/lib/collection/components/duet-cookie-consent/duet-cookie-consent.e2e.js +0 -27
  727. package/lib/collection/components/duet-date-picker/date-utils.spec.js +0 -330
  728. package/lib/collection/components/duet-date-picker/duet-date-picker.a11y.e2e.js +0 -13
  729. package/lib/collection/components/duet-date-picker/duet-date-picker.e2e.js +0 -693
  730. package/lib/collection/components/duet-divider/duet-divider.a11y.e2e.js +0 -13
  731. package/lib/collection/components/duet-divider/duet-divider.e2e.js +0 -32
  732. package/lib/collection/components/duet-editable-table/duet-editable-table.a11y.e2e.js +0 -202
  733. package/lib/collection/components/duet-editable-table/duet-editable-table.e2e.js +0 -29
  734. package/lib/collection/components/duet-empty-state/duet-empty-state.a11y.e2e.js +0 -15
  735. package/lib/collection/components/duet-empty-state/duet-empty-state.e2e.js +0 -16
  736. package/lib/collection/components/duet-fieldset/duet-fieldset.a11y.e2e.js +0 -17
  737. package/lib/collection/components/duet-fieldset/duet-fieldset.e2e.js +0 -13
  738. package/lib/collection/components/duet-footer/duet-footer.a11y.e2e.js +0 -22
  739. package/lib/collection/components/duet-footer/duet-footer.e2e.js +0 -186
  740. package/lib/collection/components/duet-grid/duet-grid.a11y.e2e.js +0 -17
  741. package/lib/collection/components/duet-grid/duet-grid.e2e.js +0 -42
  742. package/lib/collection/components/duet-header/duet-header.a11y.e2e.js +0 -42
  743. package/lib/collection/components/duet-header/duet-header.e2e.js +0 -470
  744. package/lib/collection/components/duet-heading/duet-heading.a11y.e2e.js +0 -13
  745. package/lib/collection/components/duet-heading/duet-heading.e2e.js +0 -27
  746. package/lib/collection/components/duet-hero/duet-hero.a11y.e2e.js +0 -70
  747. package/lib/collection/components/duet-hero/duet-hero.e2e.js +0 -172
  748. package/lib/collection/components/duet-icon/duet-icon.a11y.e2e.js +0 -13
  749. package/lib/collection/components/duet-icon/duet-icon.e2e.js +0 -27
  750. package/lib/collection/components/duet-icon/icon-utils.spec.js +0 -84
  751. package/lib/collection/components/duet-input/duet-input.a11y.e2e.js +0 -33
  752. package/lib/collection/components/duet-input/duet-input.e2e.js +0 -201
  753. package/lib/collection/components/duet-label/duet-label.a11y.e2e.js +0 -14
  754. package/lib/collection/components/duet-label/duet-label.e2e.js +0 -32
  755. package/lib/collection/components/duet-layout/duet-layout.a11y.e2e.js +0 -18
  756. package/lib/collection/components/duet-layout/duet-layout.e2e.js +0 -32
  757. package/lib/collection/components/duet-link/duet-link.a11y.e2e.js +0 -39
  758. package/lib/collection/components/duet-link/duet-link.e2e.js +0 -53
  759. package/lib/collection/components/duet-list/duet-list.a11y.e2e.js +0 -30
  760. package/lib/collection/components/duet-list/duet-list.e2e.js +0 -105
  761. package/lib/collection/components/duet-logo/duet-logo.a11y.e2e.js +0 -13
  762. package/lib/collection/components/duet-logo/duet-logo.e2e.js +0 -42
  763. package/lib/collection/components/duet-menu-bar/duet-menu-bar.a11y.e2e.js +0 -63
  764. package/lib/collection/components/duet-modal/duet-modal.a11y.e2e.js +0 -49
  765. package/lib/collection/components/duet-modal/duet-modal.e2e.js +0 -113
  766. package/lib/collection/components/duet-multiselect/duet-multiselect.a11y.e2e.js +0 -22
  767. package/lib/collection/components/duet-multiselect/duet-multiselect.e2e.js +0 -157
  768. package/lib/collection/components/duet-notification/duet-notification.a11y.e2e.js +0 -20
  769. package/lib/collection/components/duet-notification/duet-notification.e2e.js +0 -12
  770. package/lib/collection/components/duet-notification-drawer/duet-notification-drawer.a11y.e2e.js +0 -28
  771. package/lib/collection/components/duet-notification-drawer/duet-notification-drawer.e2e.js +0 -177
  772. package/lib/collection/components/duet-number-input/duet-number-input-negative.e2e.js +0 -32
  773. package/lib/collection/components/duet-number-input/duet-number-input.a11y.e2e.js +0 -14
  774. package/lib/collection/components/duet-number-input/duet-number-input.e2e.js +0 -242
  775. package/lib/collection/components/duet-page-heading/duet-page-heading.a11y.e2e.js +0 -15
  776. package/lib/collection/components/duet-pagination/duet-pagination.a11y.e2e.js +0 -36
  777. package/lib/collection/components/duet-pagination/duet-pagination.e2e.js +0 -101
  778. package/lib/collection/components/duet-paragraph/duet-paragraph.a11y.e2e.js +0 -18
  779. package/lib/collection/components/duet-paragraph/duet-paragraph.e2e.js +0 -27
  780. package/lib/collection/components/duet-popup-menu/duet-popup-menu.a11y.e2e.js +0 -27
  781. package/lib/collection/components/duet-progress/duet-progress.a11y.e2e.js +0 -17
  782. package/lib/collection/components/duet-progress/duet-progress.e2e.js +0 -12
  783. package/lib/collection/components/duet-promo-card/duet-promo-card.a11y.e2e.js +0 -43
  784. package/lib/collection/components/duet-promo-card/duet-promo-card.e2e.js +0 -23
  785. package/lib/collection/components/duet-radio/duet-radio.a11y.e2e.js +0 -13
  786. package/lib/collection/components/duet-radio/duet-radio.e2e.js +0 -135
  787. package/lib/collection/components/duet-radio-group/duet-radio-group.a11y.e2e.js +0 -36
  788. package/lib/collection/components/duet-radio-group/duet-radio-group.e2e.js +0 -57
  789. package/lib/collection/components/duet-range-slider/duet-range-slider.a11y.e2e.js +0 -14
  790. package/lib/collection/components/duet-range-slider/duet-range-slider.e2e.js +0 -57
  791. package/lib/collection/components/duet-range-stepper/duet-range-stepper.a11y.e2e.js +0 -13
  792. package/lib/collection/components/duet-range-stepper/duet-range-stepper.e2e.js +0 -52
  793. package/lib/collection/components/duet-range-stepper/duet-range-stepper.spec.js +0 -23
  794. package/lib/collection/components/duet-scrollable/duet-scrollable.a11y.e2e.js +0 -17
  795. package/lib/collection/components/duet-scrollable/duet-scrollable.e2e.js +0 -12
  796. package/lib/collection/components/duet-section-layout/duet-section-layout.a11y.e2e.js +0 -18
  797. package/lib/collection/components/duet-section-layout/duet-section-layout.e2e.js +0 -22
  798. package/lib/collection/components/duet-select/duet-select.a11y.e2e.js +0 -45
  799. package/lib/collection/components/duet-select/duet-select.e2e.js +0 -211
  800. package/lib/collection/components/duet-shaped-image/duet-shaped-image.a11y.e2e.js +0 -20
  801. package/lib/collection/components/duet-show-more/duet-show-more.a11y.e2e.js +0 -13
  802. package/lib/collection/components/duet-slideout/duet-slideout.a11y.e2e.js +0 -47
  803. package/lib/collection/components/duet-spacer/duet-spacer.a11y.e2e.js +0 -13
  804. package/lib/collection/components/duet-spacer/duet-spacer.e2e.js +0 -27
  805. package/lib/collection/components/duet-spinner/duet-spinner.a11y.e2e.js +0 -13
  806. package/lib/collection/components/duet-spinner/duet-spinner.e2e.js +0 -30
  807. package/lib/collection/components/duet-step/duet-step.e2e.js +0 -94
  808. package/lib/collection/components/duet-stepper/duet-stepper.a11y.e2e.js +0 -26
  809. package/lib/collection/components/duet-stepper/duet-stepper.e2e.js +0 -84
  810. package/lib/collection/components/duet-submenu-bar/duet-submenu-bar.a11y.e2e.js +0 -21
  811. package/lib/collection/components/duet-tab/duet-tab.e2e.js +0 -16
  812. package/lib/collection/components/duet-tab-group/duet-tab-group.a11y.e2e.js +0 -16
  813. package/lib/collection/components/duet-tab-group/duet-tab-group.e2e.js +0 -108
  814. package/lib/collection/components/duet-table/duet-table.a11y.e2e.js +0 -35
  815. package/lib/collection/components/duet-table/duet-table.e2e.js +0 -95
  816. package/lib/collection/components/duet-textarea/duet-textarea.a11y.e2e.js +0 -28
  817. package/lib/collection/components/duet-textarea/duet-textarea.e2e.js +0 -199
  818. package/lib/collection/components/duet-toggle/duet-toggle.a11y.e2e.js +0 -13
  819. package/lib/collection/components/duet-toggle/duet-toggle.e2e.js +0 -73
  820. package/lib/collection/components/duet-toolbar/duet-toolbar.a11y.e2e.js +0 -82
  821. package/lib/collection/components/duet-tooltip/duet-tooltip.a11y.e2e.js +0 -34
  822. package/lib/collection/components/duet-tooltip/duet-tooltip.e2e.js +0 -104
  823. package/lib/collection/components/duet-tray/duet-tray.a11y.e2e.js +0 -22
  824. package/lib/collection/components/duet-tray/duet-tray.e2e.js +0 -103
  825. package/lib/collection/components/duet-upload/duet-upload.e2e.js +0 -48
  826. package/lib/collection/components/duet-upload/upload-validators.spec.js +0 -41
  827. package/lib/collection/components/duet-visually-hidden/duet-visually-hidden.a11y.e2e.js +0 -15
  828. package/lib/collection/components/duet-visually-hidden/duet-visually-hidden.e2e.js +0 -12
  829. package/lib/collection/utils/create-id.spec.js +0 -12
  830. package/lib/collection/utils/js-utils.spec.js +0 -22
  831. package/lib/collection/utils/language-utils.spec.js +0 -159
  832. package/lib/collection/utils/math.utils.spec.js +0 -140
  833. package/lib/collection/utils/string-utils.spec.js +0 -39
  834. package/lib/collection/utils/template-utils.spec.js +0 -39
  835. package/lib/collection/utils/token-utils.spec.js +0 -178
  836. package/lib/dist-custom-elements/p-33937fd7.js +0 -183
  837. package/lib/dist-custom-elements/p-d160ca6a.js +0 -2333
  838. package/lib/duet/p-021968b7.system.entry.js +0 -4
  839. package/lib/duet/p-039f1ee1.system.entry.js +0 -4
  840. package/lib/duet/p-06e608ae.js +0 -4
  841. package/lib/duet/p-09fdd234.entry.js +0 -4
  842. package/lib/duet/p-0b515d0c.system.entry.js +0 -4
  843. package/lib/duet/p-0b7e7cdd.entry.js +0 -4
  844. package/lib/duet/p-12e97d2c.entry.js +0 -4
  845. package/lib/duet/p-17abbe45.system.entry.js +0 -4
  846. package/lib/duet/p-1a815d69.entry.js +0 -4
  847. package/lib/duet/p-1c90a161.system.entry.js +0 -4
  848. package/lib/duet/p-1f0c6aa9.entry.js +0 -4
  849. package/lib/duet/p-224f6c46.system.js +0 -4
  850. package/lib/duet/p-252c61f9.entry.js +0 -4
  851. package/lib/duet/p-259a297a.system.js +0 -4
  852. package/lib/duet/p-2757e1be.entry.js +0 -4
  853. package/lib/duet/p-286cbd79.system.entry.js +0 -4
  854. package/lib/duet/p-2a3b428e.entry.js +0 -4
  855. package/lib/duet/p-2e36d5bf.js +0 -4
  856. package/lib/duet/p-2e615f90.entry.js +0 -4
  857. package/lib/duet/p-2f1b5c7d.js +0 -5
  858. package/lib/duet/p-354e8617.entry.js +0 -4
  859. package/lib/duet/p-36340a70.entry.js +0 -4
  860. package/lib/duet/p-36a4e269.system.entry.js +0 -4
  861. package/lib/duet/p-37aab3fc.entry.js +0 -4
  862. package/lib/duet/p-3aca8b0e.entry.js +0 -4
  863. package/lib/duet/p-3eb18ea9.system.entry.js +0 -4
  864. package/lib/duet/p-45ec9edc.entry.js +0 -4
  865. package/lib/duet/p-47ba309d.system.entry.js +0 -4
  866. package/lib/duet/p-48de6532.entry.js +0 -4
  867. package/lib/duet/p-4918a89e.entry.js +0 -4
  868. package/lib/duet/p-4bbe62cc.system.entry.js +0 -4
  869. package/lib/duet/p-4c41c996.system.entry.js +0 -4
  870. package/lib/duet/p-4db9c3d9.entry.js +0 -4
  871. package/lib/duet/p-52899472.entry.js +0 -4
  872. package/lib/duet/p-5318851f.system.entry.js +0 -4
  873. package/lib/duet/p-57346eff.system.entry.js +0 -4
  874. package/lib/duet/p-5747dc4a.entry.js +0 -4
  875. package/lib/duet/p-5852bc10.system.entry.js +0 -4
  876. package/lib/duet/p-59923821.system.entry.js +0 -4
  877. package/lib/duet/p-5c1c9204.system.entry.js +0 -4
  878. package/lib/duet/p-5f07590d.entry.js +0 -4
  879. package/lib/duet/p-61a1045e.entry.js +0 -4
  880. package/lib/duet/p-647e7930.entry.js +0 -4
  881. package/lib/duet/p-68ff07cc.entry.js +0 -4
  882. package/lib/duet/p-694dc2b2.entry.js +0 -4
  883. package/lib/duet/p-69b8ad83.system.entry.js +0 -4
  884. package/lib/duet/p-6ae750db.system.entry.js +0 -4
  885. package/lib/duet/p-6d7602d0.system.entry.js +0 -4
  886. package/lib/duet/p-6d839458.js +0 -4
  887. package/lib/duet/p-6dd2833f.entry.js +0 -4
  888. package/lib/duet/p-6e788570.entry.js +0 -4
  889. package/lib/duet/p-7187fcdb.entry.js +0 -4
  890. package/lib/duet/p-72a9c332.entry.js +0 -4
  891. package/lib/duet/p-7bba0a5f.entry.js +0 -4
  892. package/lib/duet/p-8030ac7d.entry.js +0 -4
  893. package/lib/duet/p-808390ff.entry.js +0 -4
  894. package/lib/duet/p-80c37175.system.entry.js +0 -4
  895. package/lib/duet/p-81488a05.system.js +0 -4
  896. package/lib/duet/p-820439f1.system.entry.js +0 -4
  897. package/lib/duet/p-848fd377.system.entry.js +0 -4
  898. package/lib/duet/p-86bb5185.entry.js +0 -4
  899. package/lib/duet/p-8868aefd.system.entry.js +0 -4
  900. package/lib/duet/p-8aa74f9c.system.entry.js +0 -4
  901. package/lib/duet/p-8c610e96.system.entry.js +0 -4
  902. package/lib/duet/p-916d8f4e.system.entry.js +0 -4
  903. package/lib/duet/p-92dd9326.entry.js +0 -4
  904. package/lib/duet/p-93abcf6f.system.entry.js +0 -4
  905. package/lib/duet/p-95ba5b53.system.entry.js +0 -4
  906. package/lib/duet/p-95bba705.entry.js +0 -4
  907. package/lib/duet/p-9c102070.system.entry.js +0 -4
  908. package/lib/duet/p-9c5e5c04.entry.js +0 -4
  909. package/lib/duet/p-9cbcb120.entry.js +0 -4
  910. package/lib/duet/p-a072af11.entry.js +0 -4
  911. package/lib/duet/p-a0be10bb.entry.js +0 -4
  912. package/lib/duet/p-a2ebc336.entry.js +0 -4
  913. package/lib/duet/p-a3def4ae.entry.js +0 -4
  914. package/lib/duet/p-a42bd424.system.entry.js +0 -4
  915. package/lib/duet/p-a52cfc5a.entry.js +0 -4
  916. package/lib/duet/p-a532d984.entry.js +0 -4
  917. package/lib/duet/p-a58f39e3.entry.js +0 -4
  918. package/lib/duet/p-a74d3389.system.entry.js +0 -4
  919. package/lib/duet/p-a787f19b.system.entry.js +0 -4
  920. package/lib/duet/p-a7b5f7e2.system.entry.js +0 -4
  921. package/lib/duet/p-aab7c415.system.js +0 -5
  922. package/lib/duet/p-ac32b610.entry.js +0 -4
  923. package/lib/duet/p-adcab9d7.system.entry.js +0 -4
  924. package/lib/duet/p-ae21ad57.system.js +0 -4
  925. package/lib/duet/p-b3bb7acb.entry.js +0 -4
  926. package/lib/duet/p-b86e538f.system.entry.js +0 -4
  927. package/lib/duet/p-bbe8cb06.system.entry.js +0 -4
  928. package/lib/duet/p-bbf58838.entry.js +0 -4
  929. package/lib/duet/p-bda99d9b.entry.js +0 -4
  930. package/lib/duet/p-be1dc5c4.entry.js +0 -4
  931. package/lib/duet/p-c1cc3eeb.entry.js +0 -4
  932. package/lib/duet/p-c75f879a.entry.js +0 -4
  933. package/lib/duet/p-c7626b56.entry.js +0 -4
  934. package/lib/duet/p-c7d7a477.system.entry.js +0 -4
  935. package/lib/duet/p-c7e75e4b.entry.js +0 -4
  936. package/lib/duet/p-d3964acf.entry.js +0 -4
  937. package/lib/duet/p-d43d061f.entry.js +0 -4
  938. package/lib/duet/p-d4c16da7.system.entry.js +0 -4
  939. package/lib/duet/p-d5eff7a7.system.js +0 -4
  940. package/lib/duet/p-d778d2ac.entry.js +0 -4
  941. package/lib/duet/p-dade1b81.entry.js +0 -4
  942. package/lib/duet/p-de217be7.entry.js +0 -4
  943. package/lib/duet/p-dfdc8492.system.entry.js +0 -4
  944. package/lib/duet/p-e11847f2.entry.js +0 -4
  945. package/lib/duet/p-e2760c6f.system.entry.js +0 -4
  946. package/lib/duet/p-e5f76223.entry.js +0 -4
  947. package/lib/duet/p-e81fdc04.entry.js +0 -4
  948. package/lib/duet/p-ec29ee80.system.entry.js +0 -4
  949. package/lib/duet/p-f04ed9cd.entry.js +0 -4
  950. package/lib/duet/p-f2da4d8f.entry.js +0 -4
  951. package/lib/duet/p-f6d62e5a.system.entry.js +0 -4
  952. package/lib/duet/p-ff45b962.entry.js +0 -4
  953. package/lib/duet/p-ff7efd44.entry.js +0 -4
  954. package/lib/esm/index-0f5e92a8.js +0 -2802
  955. package/lib/esm-es5/app-globals-45aa6d20.js +0 -4
  956. package/lib/esm-es5/focus-utils-f0e6853d.js +0 -4
  957. package/lib/esm-es5/index-0f5e92a8.js +0 -5
  958. package/lib/esm-es5/language-utils-00ca4c55.js +0 -4
  959. package/lib/esm-es5/slot-utils-b50aaef5.js +0 -4
@@ -1,2836 +0,0 @@
1
- /*!
2
- * Built with Duet Design System
3
- */
4
- 'use strict';
5
-
6
- function _interopNamespace(e) {
7
- if (e && e.__esModule) return e;
8
- var n = Object.create(null);
9
- if (e) {
10
- Object.keys(e).forEach(function (k) {
11
- if (k !== 'default') {
12
- var d = Object.getOwnPropertyDescriptor(e, k);
13
- Object.defineProperty(n, k, d.get ? d : {
14
- enumerable: true,
15
- get: function () {
16
- return e[k];
17
- }
18
- });
19
- }
20
- });
21
- }
22
- n['default'] = e;
23
- return Object.freeze(n);
24
- }
25
-
26
- const NAMESPACE = 'duet';
27
- const BUILD = /* duet */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: true, cmpDidUnload: false, cmpDidUpdate: true, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: true, cmpWillUpdate: false, connectedCallback: true, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: true, element: false, event: true, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: true, hostListenerTarget: true, hostListenerTargetBody: true, hostListenerTargetDocument: true, hostListenerTargetParent: false, hostListenerTargetWindow: true, hotModuleReplacement: false, hydrateClientSide: true, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, initializeNextTick: true, invisiblePrehydration: false, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: true, mode: false, observeAttribute: true, profile: false, prop: true, propBoolean: true, propMutable: true, propNumber: true, propString: true, reflect: true, scoped: true, scopedSlotTextContentFix: false, scriptDataOpts: true, shadowDelegatesFocus: true, shadowDom: true, slot: true, slotChildNodesFix: true, slotRelocation: true, state: true, style: true, svg: true, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: true, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: true, vdomText: true, vdomXlink: true, watchCallback: true };
28
- const Env = /* duet */ {"cdnURILocal":"http://0.0.0.0:3334","cdnURIProd":"https://cdn.duetds.com/api","duetIconVersion":"4.0.54"};
29
-
30
- /**
31
- * Virtual DOM patching algorithm based on Snabbdom by
32
- * Simon Friis Vindum (@paldepind)
33
- * Licensed under the MIT License
34
- * https://github.com/snabbdom/snabbdom/blob/master/LICENSE
35
- *
36
- * Modified for Stencil's renderer and slot projection
37
- */
38
- let scopeId;
39
- let contentRef;
40
- let hostTagName;
41
- let useNativeShadowDom = false;
42
- let checkSlotFallbackVisibility = false;
43
- let checkSlotRelocate = false;
44
- let isSvgMode = false;
45
- let queuePending = false;
46
- const Build = {
47
- isDev: false,
48
- isBrowser: true,
49
- isServer: false,
50
- isTesting: false,
51
- };
52
- const createTime = (fnName, tagName = '') => {
53
- {
54
- return () => {
55
- return;
56
- };
57
- }
58
- };
59
- const uniqueTime = (key, measureText) => {
60
- {
61
- return () => {
62
- return;
63
- };
64
- }
65
- };
66
- const CONTENT_REF_ID = 'r';
67
- const ORG_LOCATION_ID = 'o';
68
- const SLOT_NODE_ID = 's';
69
- const TEXT_NODE_ID = 't';
70
- const HYDRATE_ID = 's-id';
71
- const HYDRATED_STYLE_ID = 'sty-id';
72
- const HYDRATE_CHILD_ID = 'c-id';
73
- /**
74
- * Constant for styles to be globally applied to `slot-fb` elements for pseudo-slot behavior.
75
- *
76
- * Two cascading rules must be used instead of a `:not()` selector due to Stencil browser
77
- * support as of Stencil v4.
78
- */
79
- const SLOT_FB_CSS = 'slot-fb{display:contents}slot-fb[hidden]{display:none}';
80
- const XLINK_NS = 'http://www.w3.org/1999/xlink';
81
- /**
82
- * Default style mode id
83
- */
84
- /**
85
- * Reusable empty obj/array
86
- * Don't add values to these!!
87
- */
88
- const EMPTY_OBJ = {};
89
- /**
90
- * Namespaces
91
- */
92
- const SVG_NS = 'http://www.w3.org/2000/svg';
93
- const HTML_NS = 'http://www.w3.org/1999/xhtml';
94
- const isDef = (v) => v != null;
95
- /**
96
- * Check whether a value is a 'complex type', defined here as an object or a
97
- * function.
98
- *
99
- * @param o the value to check
100
- * @returns whether it's a complex type or not
101
- */
102
- const isComplexType = (o) => {
103
- // https://jsperf.com/typeof-fn-object/5
104
- o = typeof o;
105
- return o === 'object' || o === 'function';
106
- };
107
- /**
108
- * Helper method for querying a `meta` tag that contains a nonce value
109
- * out of a DOM's head.
110
- *
111
- * @param doc The DOM containing the `head` to query against
112
- * @returns The content of the meta tag representing the nonce value, or `undefined` if no tag
113
- * exists or the tag has no content.
114
- */
115
- function queryNonceMetaTagContent(doc) {
116
- var _a, _b, _c;
117
- return (_c = (_b = (_a = doc.head) === null || _a === void 0 ? void 0 : _a.querySelector('meta[name="csp-nonce"]')) === null || _b === void 0 ? void 0 : _b.getAttribute('content')) !== null && _c !== void 0 ? _c : undefined;
118
- }
119
- /**
120
- * Production h() function based on Preact by
121
- * Jason Miller (@developit)
122
- * Licensed under the MIT License
123
- * https://github.com/developit/preact/blob/master/LICENSE
124
- *
125
- * Modified for Stencil's compiler and vdom
126
- */
127
- // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, child?: d.ChildType): d.VNode;
128
- // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;
129
- const h = (nodeName, vnodeData, ...children) => {
130
- let child = null;
131
- let key = null;
132
- let slotName = null;
133
- let simple = false;
134
- let lastSimple = false;
135
- const vNodeChildren = [];
136
- const walk = (c) => {
137
- for (let i = 0; i < c.length; i++) {
138
- child = c[i];
139
- if (Array.isArray(child)) {
140
- walk(child);
141
- }
142
- else if (child != null && typeof child !== 'boolean') {
143
- if ((simple = typeof nodeName !== 'function' && !isComplexType(child))) {
144
- child = String(child);
145
- }
146
- if (simple && lastSimple) {
147
- // If the previous child was simple (string), we merge both
148
- vNodeChildren[vNodeChildren.length - 1].$text$ += child;
149
- }
150
- else {
151
- // Append a new vNode, if it's text, we create a text vNode
152
- vNodeChildren.push(simple ? newVNode(null, child) : child);
153
- }
154
- lastSimple = simple;
155
- }
156
- }
157
- };
158
- walk(children);
159
- if (vnodeData) {
160
- if (vnodeData.key) {
161
- key = vnodeData.key;
162
- }
163
- if (vnodeData.name) {
164
- slotName = vnodeData.name;
165
- }
166
- // normalize class / className attributes
167
- {
168
- const classData = vnodeData.className || vnodeData.class;
169
- if (classData) {
170
- vnodeData.class =
171
- typeof classData !== 'object'
172
- ? classData
173
- : Object.keys(classData)
174
- .filter((k) => classData[k])
175
- .join(' ');
176
- }
177
- }
178
- }
179
- if (typeof nodeName === 'function') {
180
- // nodeName is a functional component
181
- return nodeName(vnodeData === null ? {} : vnodeData, vNodeChildren, vdomFnUtils);
182
- }
183
- const vnode = newVNode(nodeName, null);
184
- vnode.$attrs$ = vnodeData;
185
- if (vNodeChildren.length > 0) {
186
- vnode.$children$ = vNodeChildren;
187
- }
188
- {
189
- vnode.$key$ = key;
190
- }
191
- {
192
- vnode.$name$ = slotName;
193
- }
194
- return vnode;
195
- };
196
- /**
197
- * A utility function for creating a virtual DOM node from a tag and some
198
- * possible text content.
199
- *
200
- * @param tag the tag for this element
201
- * @param text possible text content for the node
202
- * @returns a newly-minted virtual DOM node
203
- */
204
- const newVNode = (tag, text) => {
205
- const vnode = {
206
- $flags$: 0,
207
- $tag$: tag,
208
- $text$: text,
209
- $elm$: null,
210
- $children$: null,
211
- };
212
- {
213
- vnode.$attrs$ = null;
214
- }
215
- {
216
- vnode.$key$ = null;
217
- }
218
- {
219
- vnode.$name$ = null;
220
- }
221
- return vnode;
222
- };
223
- const Host = {};
224
- /**
225
- * Check whether a given node is a Host node or not
226
- *
227
- * @param node the virtual DOM node to check
228
- * @returns whether it's a Host node or not
229
- */
230
- const isHost = (node) => node && node.$tag$ === Host;
231
- /**
232
- * Implementation of {@link d.FunctionalUtilities} for Stencil's VDom.
233
- *
234
- * Note that these functions convert from {@link d.VNode} to
235
- * {@link d.ChildNode} to give functional component developers a friendly
236
- * interface.
237
- */
238
- const vdomFnUtils = {
239
- forEach: (children, cb) => children.map(convertToPublic).forEach(cb),
240
- map: (children, cb) => children.map(convertToPublic).map(cb).map(convertToPrivate),
241
- };
242
- /**
243
- * Convert a {@link d.VNode} to a {@link d.ChildNode} in order to present a
244
- * friendlier public interface (hence, 'convertToPublic').
245
- *
246
- * @param node the virtual DOM node to convert
247
- * @returns a converted child node
248
- */
249
- const convertToPublic = (node) => ({
250
- vattrs: node.$attrs$,
251
- vchildren: node.$children$,
252
- vkey: node.$key$,
253
- vname: node.$name$,
254
- vtag: node.$tag$,
255
- vtext: node.$text$,
256
- });
257
- /**
258
- * Convert a {@link d.ChildNode} back to an equivalent {@link d.VNode} in
259
- * order to use the resulting object in the virtual DOM. The initial object was
260
- * likely created as part of presenting a public API, so converting it back
261
- * involved making it 'private' again (hence, `convertToPrivate`).
262
- *
263
- * @param node the child node to convert
264
- * @returns a converted virtual DOM node
265
- */
266
- const convertToPrivate = (node) => {
267
- if (typeof node.vtag === 'function') {
268
- const vnodeData = Object.assign({}, node.vattrs);
269
- if (node.vkey) {
270
- vnodeData.key = node.vkey;
271
- }
272
- if (node.vname) {
273
- vnodeData.name = node.vname;
274
- }
275
- return h(node.vtag, vnodeData, ...(node.vchildren || []));
276
- }
277
- const vnode = newVNode(node.vtag, node.vtext);
278
- vnode.$attrs$ = node.vattrs;
279
- vnode.$children$ = node.vchildren;
280
- vnode.$key$ = node.vkey;
281
- vnode.$name$ = node.vname;
282
- return vnode;
283
- };
284
- /**
285
- * Entrypoint of the client-side hydration process. Facilitates calls to hydrate the
286
- * document and all its nodes.
287
- *
288
- * This process will also reconstruct the shadow root and slot DOM nodes for components using shadow DOM.
289
- *
290
- * @param hostElm The element to hydrate.
291
- * @param tagName The element's tag name.
292
- * @param hostId The host ID assigned to the element by the server.
293
- * @param hostRef The host reference for the element.
294
- */
295
- const initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
296
- const endHydrate = createTime('hydrateClient', tagName);
297
- const shadowRoot = hostElm.shadowRoot;
298
- const childRenderNodes = [];
299
- const slotNodes = [];
300
- const shadowRootNodes = shadowRoot ? [] : null;
301
- const vnode = (hostRef.$vnode$ = newVNode(tagName, null));
302
- if (!plt.$orgLocNodes$) {
303
- initializeDocumentHydrate(doc.body, (plt.$orgLocNodes$ = new Map()));
304
- }
305
- hostElm[HYDRATE_ID] = hostId;
306
- hostElm.removeAttribute(HYDRATE_ID);
307
- clientHydrate(vnode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, hostElm, hostId);
308
- childRenderNodes.map((c) => {
309
- const orgLocationId = c.$hostId$ + '.' + c.$nodeId$;
310
- const orgLocationNode = plt.$orgLocNodes$.get(orgLocationId);
311
- const node = c.$elm$;
312
- // Put the node back in its original location since the native Shadow DOM
313
- // can handle rendering it its correct location now
314
- if (orgLocationNode && supportsShadow && orgLocationNode['s-en'] === '') {
315
- orgLocationNode.parentNode.insertBefore(node, orgLocationNode.nextSibling);
316
- }
317
- if (!shadowRoot) {
318
- node['s-hn'] = tagName;
319
- if (orgLocationNode) {
320
- node['s-ol'] = orgLocationNode;
321
- node['s-ol']['s-nr'] = node;
322
- }
323
- }
324
- plt.$orgLocNodes$.delete(orgLocationId);
325
- });
326
- if (shadowRoot) {
327
- shadowRootNodes.map((shadowRootNode) => {
328
- if (shadowRootNode) {
329
- shadowRoot.appendChild(shadowRootNode);
330
- }
331
- });
332
- }
333
- endHydrate();
334
- };
335
- /**
336
- * Recursively constructs the virtual node tree for a host element and its children.
337
- * The tree is constructed by parsing the annotations set on the nodes by the server.
338
- *
339
- * In addition to constructing the vNode tree, we also track information about the node's
340
- * descendants like which are slots, which should exist in the shadow root, and which
341
- * are nodes that should be rendered as children of the parent node.
342
- *
343
- * @param parentVNode The vNode representing the parent node.
344
- * @param childRenderNodes An array of all child nodes in the parent's node tree.
345
- * @param slotNodes An array of all slot nodes in the parent's node tree.
346
- * @param shadowRootNodes An array all nodes that should be rendered in the shadow root in the parent's node tree.
347
- * @param hostElm The parent element.
348
- * @param node The node to construct the vNode tree for.
349
- * @param hostId The host ID assigned to the element by the server.
350
- */
351
- const clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node, hostId) => {
352
- let childNodeType;
353
- let childIdSplt;
354
- let childVNode;
355
- let i;
356
- if (node.nodeType === 1 /* NODE_TYPE.ElementNode */) {
357
- childNodeType = node.getAttribute(HYDRATE_CHILD_ID);
358
- if (childNodeType) {
359
- // got the node data from the element's attribute
360
- // `${hostId}.${nodeId}.${depth}.${index}`
361
- childIdSplt = childNodeType.split('.');
362
- if (childIdSplt[0] === hostId || childIdSplt[0] === '0') {
363
- childVNode = {
364
- $flags$: 0,
365
- $hostId$: childIdSplt[0],
366
- $nodeId$: childIdSplt[1],
367
- $depth$: childIdSplt[2],
368
- $index$: childIdSplt[3],
369
- $tag$: node.tagName.toLowerCase(),
370
- $elm$: node,
371
- $attrs$: null,
372
- $children$: null,
373
- $key$: null,
374
- $name$: null,
375
- $text$: null,
376
- };
377
- childRenderNodes.push(childVNode);
378
- node.removeAttribute(HYDRATE_CHILD_ID);
379
- // this is a new child vnode
380
- // so ensure its parent vnode has the vchildren array
381
- if (!parentVNode.$children$) {
382
- parentVNode.$children$ = [];
383
- }
384
- // add our child vnode to a specific index of the vnode's children
385
- parentVNode.$children$[childVNode.$index$] = childVNode;
386
- // this is now the new parent vnode for all the next child checks
387
- parentVNode = childVNode;
388
- if (shadowRootNodes && childVNode.$depth$ === '0') {
389
- shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
390
- }
391
- }
392
- }
393
- // recursively drill down, end to start so we can remove nodes
394
- for (i = node.childNodes.length - 1; i >= 0; i--) {
395
- clientHydrate(parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node.childNodes[i], hostId);
396
- }
397
- if (node.shadowRoot) {
398
- // keep drilling down through the shadow root nodes
399
- for (i = node.shadowRoot.childNodes.length - 1; i >= 0; i--) {
400
- clientHydrate(parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node.shadowRoot.childNodes[i], hostId);
401
- }
402
- }
403
- }
404
- else if (node.nodeType === 8 /* NODE_TYPE.CommentNode */) {
405
- // `${COMMENT_TYPE}.${hostId}.${nodeId}.${depth}.${index}`
406
- childIdSplt = node.nodeValue.split('.');
407
- if (childIdSplt[1] === hostId || childIdSplt[1] === '0') {
408
- // comment node for either the host id or a 0 host id
409
- childNodeType = childIdSplt[0];
410
- childVNode = {
411
- $flags$: 0,
412
- $hostId$: childIdSplt[1],
413
- $nodeId$: childIdSplt[2],
414
- $depth$: childIdSplt[3],
415
- $index$: childIdSplt[4],
416
- $elm$: node,
417
- $attrs$: null,
418
- $children$: null,
419
- $key$: null,
420
- $name$: null,
421
- $tag$: null,
422
- $text$: null,
423
- };
424
- if (childNodeType === TEXT_NODE_ID) {
425
- childVNode.$elm$ = node.nextSibling;
426
- if (childVNode.$elm$ && childVNode.$elm$.nodeType === 3 /* NODE_TYPE.TextNode */) {
427
- childVNode.$text$ = childVNode.$elm$.textContent;
428
- childRenderNodes.push(childVNode);
429
- // remove the text comment since it's no longer needed
430
- node.remove();
431
- if (!parentVNode.$children$) {
432
- parentVNode.$children$ = [];
433
- }
434
- parentVNode.$children$[childVNode.$index$] = childVNode;
435
- if (shadowRootNodes && childVNode.$depth$ === '0') {
436
- shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
437
- }
438
- }
439
- }
440
- else if (childVNode.$hostId$ === hostId) {
441
- // this comment node is specifically for this host id
442
- if (childNodeType === SLOT_NODE_ID) {
443
- // `${SLOT_NODE_ID}.${hostId}.${nodeId}.${depth}.${index}.${slotName}`;
444
- childVNode.$tag$ = 'slot';
445
- if (childIdSplt[5]) {
446
- node['s-sn'] = childVNode.$name$ = childIdSplt[5];
447
- }
448
- else {
449
- node['s-sn'] = '';
450
- }
451
- node['s-sr'] = true;
452
- if (shadowRootNodes) {
453
- // browser support shadowRoot and this is a shadow dom component
454
- // create an actual slot element
455
- childVNode.$elm$ = doc.createElement(childVNode.$tag$);
456
- if (childVNode.$name$) {
457
- // add the slot name attribute
458
- childVNode.$elm$.setAttribute('name', childVNode.$name$);
459
- }
460
- // insert the new slot element before the slot comment
461
- node.parentNode.insertBefore(childVNode.$elm$, node);
462
- // remove the slot comment since it's not needed for shadow
463
- node.remove();
464
- if (childVNode.$depth$ === '0') {
465
- shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
466
- }
467
- }
468
- slotNodes.push(childVNode);
469
- if (!parentVNode.$children$) {
470
- parentVNode.$children$ = [];
471
- }
472
- parentVNode.$children$[childVNode.$index$] = childVNode;
473
- }
474
- else if (childNodeType === CONTENT_REF_ID) {
475
- // `${CONTENT_REF_ID}.${hostId}`;
476
- if (shadowRootNodes) {
477
- // remove the content ref comment since it's not needed for shadow
478
- node.remove();
479
- }
480
- else {
481
- hostElm['s-cr'] = node;
482
- node['s-cn'] = true;
483
- }
484
- }
485
- }
486
- }
487
- }
488
- else if (parentVNode && parentVNode.$tag$ === 'style') {
489
- const vnode = newVNode(null, node.textContent);
490
- vnode.$elm$ = node;
491
- vnode.$index$ = '0';
492
- parentVNode.$children$ = [vnode];
493
- }
494
- };
495
- /**
496
- * Recursively locate any comments representing an original location for a node in a node's
497
- * children or shadowRoot children.
498
- *
499
- * @param node The node to search.
500
- * @param orgLocNodes A map of the original location annotation and the current node being searched.
501
- */
502
- const initializeDocumentHydrate = (node, orgLocNodes) => {
503
- if (node.nodeType === 1 /* NODE_TYPE.ElementNode */) {
504
- let i = 0;
505
- for (; i < node.childNodes.length; i++) {
506
- initializeDocumentHydrate(node.childNodes[i], orgLocNodes);
507
- }
508
- if (node.shadowRoot) {
509
- for (i = 0; i < node.shadowRoot.childNodes.length; i++) {
510
- initializeDocumentHydrate(node.shadowRoot.childNodes[i], orgLocNodes);
511
- }
512
- }
513
- }
514
- else if (node.nodeType === 8 /* NODE_TYPE.CommentNode */) {
515
- const childIdSplt = node.nodeValue.split('.');
516
- if (childIdSplt[0] === ORG_LOCATION_ID) {
517
- orgLocNodes.set(childIdSplt[1] + '.' + childIdSplt[2], node);
518
- node.nodeValue = '';
519
- // useful to know if the original location is
520
- // the root light-dom of a shadow dom component
521
- node['s-en'] = childIdSplt[3];
522
- }
523
- }
524
- };
525
- /**
526
- * Parse a new property value for a given property type.
527
- *
528
- * While the prop value can reasonably be expected to be of `any` type as far as TypeScript's type checker is concerned,
529
- * it is not safe to assume that the string returned by evaluating `typeof propValue` matches:
530
- * 1. `any`, the type given to `propValue` in the function signature
531
- * 2. the type stored from `propType`.
532
- *
533
- * This function provides the capability to parse/coerce a property's value to potentially any other JavaScript type.
534
- *
535
- * Property values represented in TSX preserve their type information. In the example below, the number 0 is passed to
536
- * a component. This `propValue` will preserve its type information (`typeof propValue === 'number'`). Note that is
537
- * based on the type of the value being passed in, not the type declared of the class member decorated with `@Prop`.
538
- * ```tsx
539
- * <my-cmp prop-val={0}></my-cmp>
540
- * ```
541
- *
542
- * HTML prop values on the other hand, will always a string
543
- *
544
- * @param propValue the new value to coerce to some type
545
- * @param propType the type of the prop, expressed as a binary number
546
- * @returns the parsed/coerced value
547
- */
548
- const parsePropertyValue = (propValue, propType) => {
549
- // ensure this value is of the correct prop type
550
- if (propValue != null && !isComplexType(propValue)) {
551
- if (propType & 4 /* MEMBER_FLAGS.Boolean */) {
552
- // per the HTML spec, any string value means it is a boolean true value
553
- // but we'll cheat here and say that the string "false" is the boolean false
554
- return propValue === 'false' ? false : propValue === '' || !!propValue;
555
- }
556
- if (propType & 2 /* MEMBER_FLAGS.Number */) {
557
- // force it to be a number
558
- return parseFloat(propValue);
559
- }
560
- if (propType & 1 /* MEMBER_FLAGS.String */) {
561
- // could have been passed as a number or boolean
562
- // but we still want it as a string
563
- return String(propValue);
564
- }
565
- // redundant return here for better minification
566
- return propValue;
567
- }
568
- // not sure exactly what type we want
569
- // so no need to change to a different type
570
- return propValue;
571
- };
572
- const getElement = (ref) => (getHostRef(ref).$hostElement$ );
573
- const createEvent = (ref, name, flags) => {
574
- const elm = getElement(ref);
575
- return {
576
- emit: (detail) => {
577
- return emitEvent(elm, name, {
578
- bubbles: !!(flags & 4 /* EVENT_FLAGS.Bubbles */),
579
- composed: !!(flags & 2 /* EVENT_FLAGS.Composed */),
580
- cancelable: !!(flags & 1 /* EVENT_FLAGS.Cancellable */),
581
- detail,
582
- });
583
- },
584
- };
585
- };
586
- /**
587
- * Helper function to create & dispatch a custom Event on a provided target
588
- * @param elm the target of the Event
589
- * @param name the name to give the custom Event
590
- * @param opts options for configuring a custom Event
591
- * @returns the custom Event
592
- */
593
- const emitEvent = (elm, name, opts) => {
594
- const ev = plt.ce(name, opts);
595
- elm.dispatchEvent(ev);
596
- return ev;
597
- };
598
- const rootAppliedStyles = /*@__PURE__*/ new WeakMap();
599
- const registerStyle = (scopeId, cssText, allowCS) => {
600
- let style = styles.get(scopeId);
601
- if (supportsConstructableStylesheets && allowCS) {
602
- style = (style || new CSSStyleSheet());
603
- if (typeof style === 'string') {
604
- style = cssText;
605
- }
606
- else {
607
- style.replaceSync(cssText);
608
- }
609
- }
610
- else {
611
- style = cssText;
612
- }
613
- styles.set(scopeId, style);
614
- };
615
- const addStyle = (styleContainerNode, cmpMeta, mode) => {
616
- var _a;
617
- const scopeId = getScopeId(cmpMeta);
618
- const style = styles.get(scopeId);
619
- // if an element is NOT connected then getRootNode() will return the wrong root node
620
- // so the fallback is to always use the document for the root node in those cases
621
- styleContainerNode = styleContainerNode.nodeType === 11 /* NODE_TYPE.DocumentFragment */ ? styleContainerNode : doc;
622
- if (style) {
623
- if (typeof style === 'string') {
624
- styleContainerNode = styleContainerNode.head || styleContainerNode;
625
- let appliedStyles = rootAppliedStyles.get(styleContainerNode);
626
- let styleElm;
627
- if (!appliedStyles) {
628
- rootAppliedStyles.set(styleContainerNode, (appliedStyles = new Set()));
629
- }
630
- if (!appliedStyles.has(scopeId)) {
631
- if (styleContainerNode.host &&
632
- (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId}"]`))) {
633
- // This is only happening on native shadow-dom, do not needs CSS var shim
634
- styleElm.innerHTML = style;
635
- }
636
- else {
637
- styleElm = doc.createElement('style');
638
- styleElm.innerHTML = style;
639
- // Apply CSP nonce to the style tag if it exists
640
- const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
641
- if (nonce != null) {
642
- styleElm.setAttribute('nonce', nonce);
643
- }
644
- styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
645
- }
646
- // Add styles for `slot-fb` elements if we're using slots outside the Shadow DOM
647
- if (cmpMeta.$flags$ & 4 /* CMP_FLAGS.hasSlotRelocation */) {
648
- styleElm.innerHTML += SLOT_FB_CSS;
649
- }
650
- if (appliedStyles) {
651
- appliedStyles.add(scopeId);
652
- }
653
- }
654
- }
655
- else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
656
- styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
657
- }
658
- }
659
- return scopeId;
660
- };
661
- const attachStyles = (hostRef) => {
662
- const cmpMeta = hostRef.$cmpMeta$;
663
- const elm = hostRef.$hostElement$;
664
- const flags = cmpMeta.$flags$;
665
- const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
666
- const scopeId = addStyle(elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta);
667
- if (flags & 10 /* CMP_FLAGS.needsScopedEncapsulation */) {
668
- // only required when we're NOT using native shadow dom (slot)
669
- // or this browser doesn't support native shadow dom
670
- // and this host element was NOT created with SSR
671
- // let's pick out the inner content for slot projection
672
- // create a node to represent where the original
673
- // content was first placed, which is useful later on
674
- // DOM WRITE!!
675
- elm['s-sc'] = scopeId;
676
- elm.classList.add(scopeId + '-h');
677
- if (flags & 2 /* CMP_FLAGS.scopedCssEncapsulation */) {
678
- elm.classList.add(scopeId + '-s');
679
- }
680
- }
681
- endAttachStyles();
682
- };
683
- const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
684
- const convertScopedToShadow = (css) => css.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g, '$1{');
685
- /**
686
- * Production setAccessor() function based on Preact by
687
- * Jason Miller (@developit)
688
- * Licensed under the MIT License
689
- * https://github.com/developit/preact/blob/master/LICENSE
690
- *
691
- * Modified for Stencil's compiler and vdom
692
- */
693
- /**
694
- * When running a VDom render set properties present on a VDom node onto the
695
- * corresponding HTML element.
696
- *
697
- * Note that this function has special functionality for the `class`,
698
- * `style`, `key`, and `ref` attributes, as well as event handlers (like
699
- * `onClick`, etc). All others are just passed through as-is.
700
- *
701
- * @param elm the HTMLElement onto which attributes should be set
702
- * @param memberName the name of the attribute to set
703
- * @param oldValue the old value for the attribute
704
- * @param newValue the new value for the attribute
705
- * @param isSvg whether we're in an svg context or not
706
- * @param flags bitflags for Vdom variables
707
- */
708
- const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
709
- if (oldValue !== newValue) {
710
- let isProp = isMemberInElement(elm, memberName);
711
- let ln = memberName.toLowerCase();
712
- if (memberName === 'class') {
713
- const classList = elm.classList;
714
- const oldClasses = parseClassList(oldValue);
715
- const newClasses = parseClassList(newValue);
716
- classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
717
- classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
718
- }
719
- else if (memberName === 'style') {
720
- // update style attribute, css properties and values
721
- {
722
- for (const prop in oldValue) {
723
- if (!newValue || newValue[prop] == null) {
724
- if (prop.includes('-')) {
725
- elm.style.removeProperty(prop);
726
- }
727
- else {
728
- elm.style[prop] = '';
729
- }
730
- }
731
- }
732
- }
733
- for (const prop in newValue) {
734
- if (!oldValue || newValue[prop] !== oldValue[prop]) {
735
- if (prop.includes('-')) {
736
- elm.style.setProperty(prop, newValue[prop]);
737
- }
738
- else {
739
- elm.style[prop] = newValue[prop];
740
- }
741
- }
742
- }
743
- }
744
- else if (memberName === 'key')
745
- ;
746
- else if (memberName === 'ref') {
747
- // minifier will clean this up
748
- if (newValue) {
749
- newValue(elm);
750
- }
751
- }
752
- else if ((!isProp ) &&
753
- memberName[0] === 'o' &&
754
- memberName[1] === 'n') {
755
- // Event Handlers
756
- // so if the member name starts with "on" and the 3rd characters is
757
- // a capital letter, and it's not already a member on the element,
758
- // then we're assuming it's an event listener
759
- if (memberName[2] === '-') {
760
- // on- prefixed events
761
- // allows to be explicit about the dom event to listen without any magic
762
- // under the hood:
763
- // <my-cmp on-click> // listens for "click"
764
- // <my-cmp on-Click> // listens for "Click"
765
- // <my-cmp on-ionChange> // listens for "ionChange"
766
- // <my-cmp on-EVENTS> // listens for "EVENTS"
767
- memberName = memberName.slice(3);
768
- }
769
- else if (isMemberInElement(win, ln)) {
770
- // standard event
771
- // the JSX attribute could have been "onMouseOver" and the
772
- // member name "onmouseover" is on the window's prototype
773
- // so let's add the listener "mouseover", which is all lowercased
774
- memberName = ln.slice(2);
775
- }
776
- else {
777
- // custom event
778
- // the JSX attribute could have been "onMyCustomEvent"
779
- // so let's trim off the "on" prefix and lowercase the first character
780
- // and add the listener "myCustomEvent"
781
- // except for the first character, we keep the event name case
782
- memberName = ln[2] + memberName.slice(3);
783
- }
784
- if (oldValue || newValue) {
785
- // Need to account for "capture" events.
786
- // If the event name ends with "Capture", we'll update the name to remove
787
- // the "Capture" suffix and make sure the event listener is setup to handle the capture event.
788
- const capture = memberName.endsWith(CAPTURE_EVENT_SUFFIX);
789
- // Make sure we only replace the last instance of "Capture"
790
- memberName = memberName.replace(CAPTURE_EVENT_REGEX, '');
791
- if (oldValue) {
792
- plt.rel(elm, memberName, oldValue, capture);
793
- }
794
- if (newValue) {
795
- plt.ael(elm, memberName, newValue, capture);
796
- }
797
- }
798
- }
799
- else {
800
- // Set property if it exists and it's not a SVG
801
- const isComplex = isComplexType(newValue);
802
- if ((isProp || (isComplex && newValue !== null)) && !isSvg) {
803
- try {
804
- if (!elm.tagName.includes('-')) {
805
- const n = newValue == null ? '' : newValue;
806
- // Workaround for Safari, moving the <input> caret when re-assigning the same valued
807
- if (memberName === 'list') {
808
- isProp = false;
809
- }
810
- else if (oldValue == null || elm[memberName] != n) {
811
- elm[memberName] = n;
812
- }
813
- }
814
- else {
815
- elm[memberName] = newValue;
816
- }
817
- }
818
- catch (e) {
819
- /**
820
- * in case someone tries to set a read-only property, e.g. "namespaceURI", we just ignore it
821
- */
822
- }
823
- }
824
- /**
825
- * Need to manually update attribute if:
826
- * - memberName is not an attribute
827
- * - if we are rendering the host element in order to reflect attribute
828
- * - if it's a SVG, since properties might not work in <svg>
829
- * - if the newValue is null/undefined or 'false'.
830
- */
831
- let xlink = false;
832
- {
833
- if (ln !== (ln = ln.replace(/^xlink\:?/, ''))) {
834
- memberName = ln;
835
- xlink = true;
836
- }
837
- }
838
- if (newValue == null || newValue === false) {
839
- if (newValue !== false || elm.getAttribute(memberName) === '') {
840
- if (xlink) {
841
- elm.removeAttributeNS(XLINK_NS, memberName);
842
- }
843
- else {
844
- elm.removeAttribute(memberName);
845
- }
846
- }
847
- }
848
- else if ((!isProp || flags & 4 /* VNODE_FLAGS.isHost */ || isSvg) && !isComplex) {
849
- newValue = newValue === true ? '' : newValue;
850
- if (xlink) {
851
- elm.setAttributeNS(XLINK_NS, memberName, newValue);
852
- }
853
- else {
854
- elm.setAttribute(memberName, newValue);
855
- }
856
- }
857
- }
858
- }
859
- };
860
- const parseClassListRegex = /\s/;
861
- /**
862
- * Parsed a string of classnames into an array
863
- * @param value className string, e.g. "foo bar baz"
864
- * @returns list of classes, e.g. ["foo", "bar", "baz"]
865
- */
866
- const parseClassList = (value) => (!value ? [] : value.split(parseClassListRegex));
867
- const CAPTURE_EVENT_SUFFIX = 'Capture';
868
- const CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + '$');
869
- const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
870
- // if the element passed in is a shadow root, which is a document fragment
871
- // then we want to be adding attrs/props to the shadow root's "host" element
872
- // if it's not a shadow root, then we add attrs/props to the same element
873
- const elm = newVnode.$elm$.nodeType === 11 /* NODE_TYPE.DocumentFragment */ && newVnode.$elm$.host
874
- ? newVnode.$elm$.host
875
- : newVnode.$elm$;
876
- const oldVnodeAttrs = (oldVnode && oldVnode.$attrs$) || EMPTY_OBJ;
877
- const newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ;
878
- {
879
- // remove attributes no longer present on the vnode by setting them to undefined
880
- for (memberName in oldVnodeAttrs) {
881
- if (!(memberName in newVnodeAttrs)) {
882
- setAccessor(elm, memberName, oldVnodeAttrs[memberName], undefined, isSvgMode, newVnode.$flags$);
883
- }
884
- }
885
- }
886
- // add new & update changed attributes
887
- for (memberName in newVnodeAttrs) {
888
- setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode, newVnode.$flags$);
889
- }
890
- };
891
- /**
892
- * Create a DOM Node corresponding to one of the children of a given VNode.
893
- *
894
- * @param oldParentVNode the parent VNode from the previous render
895
- * @param newParentVNode the parent VNode from the current render
896
- * @param childIndex the index of the VNode, in the _new_ parent node's
897
- * children, for which we will create a new DOM node
898
- * @param parentElm the parent DOM node which our new node will be a child of
899
- * @returns the newly created node
900
- */
901
- const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
902
- // tslint:disable-next-line: prefer-const
903
- const newVNode = newParentVNode.$children$[childIndex];
904
- let i = 0;
905
- let elm;
906
- let childNode;
907
- let oldVNode;
908
- if (!useNativeShadowDom) {
909
- // remember for later we need to check to relocate nodes
910
- checkSlotRelocate = true;
911
- if (newVNode.$tag$ === 'slot') {
912
- if (scopeId) {
913
- // scoped css needs to add its scoped id to the parent element
914
- parentElm.classList.add(scopeId + '-s');
915
- }
916
- newVNode.$flags$ |= newVNode.$children$
917
- ? // slot element has fallback content
918
- 2 /* VNODE_FLAGS.isSlotFallback */
919
- : // slot element does not have fallback content
920
- 1 /* VNODE_FLAGS.isSlotReference */;
921
- }
922
- }
923
- if (newVNode.$text$ !== null) {
924
- // create text node
925
- elm = newVNode.$elm$ = doc.createTextNode(newVNode.$text$);
926
- }
927
- else if (newVNode.$flags$ & 1 /* VNODE_FLAGS.isSlotReference */) {
928
- // create a slot reference node
929
- elm = newVNode.$elm$ =
930
- doc.createTextNode('');
931
- }
932
- else {
933
- if (!isSvgMode) {
934
- isSvgMode = newVNode.$tag$ === 'svg';
935
- }
936
- // create element
937
- elm = newVNode.$elm$ = (doc.createElementNS(isSvgMode ? SVG_NS : HTML_NS, newVNode.$flags$ & 2 /* VNODE_FLAGS.isSlotFallback */
938
- ? 'slot-fb'
939
- : newVNode.$tag$)
940
- );
941
- if (isSvgMode && newVNode.$tag$ === 'foreignObject') {
942
- isSvgMode = false;
943
- }
944
- // add css classes, attrs, props, listeners, etc.
945
- {
946
- updateElement(null, newVNode, isSvgMode);
947
- }
948
- if (isDef(scopeId) && elm['s-si'] !== scopeId) {
949
- // if there is a scopeId and this is the initial render
950
- // then let's add the scopeId as a css class
951
- elm.classList.add((elm['s-si'] = scopeId));
952
- }
953
- if (newVNode.$children$) {
954
- for (i = 0; i < newVNode.$children$.length; ++i) {
955
- // create the node
956
- childNode = createElm(oldParentVNode, newVNode, i, elm);
957
- // return node could have been null
958
- if (childNode) {
959
- // append our new node
960
- elm.appendChild(childNode);
961
- }
962
- }
963
- }
964
- {
965
- if (newVNode.$tag$ === 'svg') {
966
- // Only reset the SVG context when we're exiting <svg> element
967
- isSvgMode = false;
968
- }
969
- else if (elm.tagName === 'foreignObject') {
970
- // Reenter SVG context when we're exiting <foreignObject> element
971
- isSvgMode = true;
972
- }
973
- }
974
- }
975
- // This needs to always happen so we can hide nodes that are projected
976
- // to another component but don't end up in a slot
977
- elm['s-hn'] = hostTagName;
978
- {
979
- if (newVNode.$flags$ & (2 /* VNODE_FLAGS.isSlotFallback */ | 1 /* VNODE_FLAGS.isSlotReference */)) {
980
- // remember the content reference comment
981
- elm['s-sr'] = true;
982
- // remember the content reference comment
983
- elm['s-cr'] = contentRef;
984
- // remember the slot name, or empty string for default slot
985
- elm['s-sn'] = newVNode.$name$ || '';
986
- // check if we've got an old vnode for this slot
987
- oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex];
988
- if (oldVNode && oldVNode.$tag$ === newVNode.$tag$ && oldParentVNode.$elm$) {
989
- {
990
- // we've got an old slot vnode and the wrapper is being replaced
991
- // so let's move the old slot content back to its original location
992
- putBackInOriginalLocation(oldParentVNode.$elm$, false);
993
- }
994
- }
995
- }
996
- }
997
- return elm;
998
- };
999
- const putBackInOriginalLocation = (parentElm, recursive) => {
1000
- plt.$flags$ |= 1 /* PLATFORM_FLAGS.isTmpDisconnected */;
1001
- const oldSlotChildNodes = parentElm.childNodes;
1002
- for (let i = oldSlotChildNodes.length - 1; i >= 0; i--) {
1003
- const childNode = oldSlotChildNodes[i];
1004
- if (childNode['s-hn'] !== hostTagName && childNode['s-ol']) {
1005
- // and relocate it back to it's original location
1006
- parentReferenceNode(childNode).insertBefore(childNode, referenceNode(childNode));
1007
- // remove the old original location comment entirely
1008
- // later on the patch function will know what to do
1009
- // and move this to the correct spot if need be
1010
- childNode['s-ol'].remove();
1011
- childNode['s-ol'] = undefined;
1012
- // Reset so we can correctly move the node around again.
1013
- childNode['s-sh'] = undefined;
1014
- checkSlotRelocate = true;
1015
- }
1016
- if (recursive) {
1017
- putBackInOriginalLocation(childNode, recursive);
1018
- }
1019
- }
1020
- plt.$flags$ &= ~1 /* PLATFORM_FLAGS.isTmpDisconnected */;
1021
- };
1022
- /**
1023
- * Create DOM nodes corresponding to a list of {@link d.Vnode} objects and
1024
- * add them to the DOM in the appropriate place.
1025
- *
1026
- * @param parentElm the DOM node which should be used as a parent for the new
1027
- * DOM nodes
1028
- * @param before a child of the `parentElm` which the new children should be
1029
- * inserted before (optional)
1030
- * @param parentVNode the parent virtual DOM node
1031
- * @param vnodes the new child virtual DOM nodes to produce DOM nodes for
1032
- * @param startIdx the index in the child virtual DOM nodes at which to start
1033
- * creating DOM nodes (inclusive)
1034
- * @param endIdx the index in the child virtual DOM nodes at which to stop
1035
- * creating DOM nodes (inclusive)
1036
- */
1037
- const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
1038
- let containerElm = ((parentElm['s-cr'] && parentElm['s-cr'].parentNode) || parentElm);
1039
- let childNode;
1040
- if (containerElm.shadowRoot && containerElm.tagName === hostTagName) {
1041
- containerElm = containerElm.shadowRoot;
1042
- }
1043
- for (; startIdx <= endIdx; ++startIdx) {
1044
- if (vnodes[startIdx]) {
1045
- childNode = createElm(null, parentVNode, startIdx, parentElm);
1046
- if (childNode) {
1047
- vnodes[startIdx].$elm$ = childNode;
1048
- containerElm.insertBefore(childNode, referenceNode(before) );
1049
- }
1050
- }
1051
- }
1052
- };
1053
- /**
1054
- * Remove the DOM elements corresponding to a list of {@link d.VNode} objects.
1055
- * This can be used to, for instance, clean up after a list of children which
1056
- * should no longer be shown.
1057
- *
1058
- * This function also handles some of Stencil's slot relocation logic.
1059
- *
1060
- * @param vnodes a list of virtual DOM nodes to remove
1061
- * @param startIdx the index at which to start removing nodes (inclusive)
1062
- * @param endIdx the index at which to stop removing nodes (inclusive)
1063
- */
1064
- const removeVnodes = (vnodes, startIdx, endIdx) => {
1065
- for (let index = startIdx; index <= endIdx; ++index) {
1066
- const vnode = vnodes[index];
1067
- if (vnode) {
1068
- const elm = vnode.$elm$;
1069
- nullifyVNodeRefs(vnode);
1070
- if (elm) {
1071
- {
1072
- // we're removing this element
1073
- // so it's possible we need to show slot fallback content now
1074
- checkSlotFallbackVisibility = true;
1075
- if (elm['s-ol']) {
1076
- // remove the original location comment
1077
- elm['s-ol'].remove();
1078
- }
1079
- else {
1080
- // it's possible that child nodes of the node
1081
- // that's being removed are slot nodes
1082
- putBackInOriginalLocation(elm, true);
1083
- }
1084
- }
1085
- // remove the vnode's element from the dom
1086
- elm.remove();
1087
- }
1088
- }
1089
- }
1090
- };
1091
- /**
1092
- * Reconcile the children of a new VNode with the children of an old VNode by
1093
- * traversing the two collections of children, identifying nodes that are
1094
- * conserved or changed, calling out to `patch` to make any necessary
1095
- * updates to the DOM, and rearranging DOM nodes as needed.
1096
- *
1097
- * The algorithm for reconciling children works by analyzing two 'windows' onto
1098
- * the two arrays of children (`oldCh` and `newCh`). We keep track of the
1099
- * 'windows' by storing start and end indices and references to the
1100
- * corresponding array entries. Initially the two 'windows' are basically equal
1101
- * to the entire array, but we progressively narrow the windows until there are
1102
- * no children left to update by doing the following:
1103
- *
1104
- * 1. Skip any `null` entries at the beginning or end of the two arrays, so
1105
- * that if we have an initial array like the following we'll end up dealing
1106
- * only with a window bounded by the highlighted elements:
1107
- *
1108
- * [null, null, VNode1 , ... , VNode2, null, null]
1109
- * ^^^^^^ ^^^^^^
1110
- *
1111
- * 2. Check to see if the elements at the head and tail positions are equal
1112
- * across the windows. This will basically detect elements which haven't
1113
- * been added, removed, or changed position, i.e. if you had the following
1114
- * VNode elements (represented as HTML):
1115
- *
1116
- * oldVNode: `<div><p><span>HEY</span></p></div>`
1117
- * newVNode: `<div><p><span>THERE</span></p></div>`
1118
- *
1119
- * Then when comparing the children of the `<div>` tag we check the equality
1120
- * of the VNodes corresponding to the `<p>` tags and, since they are the
1121
- * same tag in the same position, we'd be able to avoid completely
1122
- * re-rendering the subtree under them with a new DOM element and would just
1123
- * call out to `patch` to handle reconciling their children and so on.
1124
- *
1125
- * 3. Check, for both windows, to see if the element at the beginning of the
1126
- * window corresponds to the element at the end of the other window. This is
1127
- * a heuristic which will let us identify _some_ situations in which
1128
- * elements have changed position, for instance it _should_ detect that the
1129
- * children nodes themselves have not changed but merely moved in the
1130
- * following example:
1131
- *
1132
- * oldVNode: `<div><element-one /><element-two /></div>`
1133
- * newVNode: `<div><element-two /><element-one /></div>`
1134
- *
1135
- * If we find cases like this then we also need to move the concrete DOM
1136
- * elements corresponding to the moved children to write the re-order to the
1137
- * DOM.
1138
- *
1139
- * 4. Finally, if VNodes have the `key` attribute set on them we check for any
1140
- * nodes in the old children which have the same key as the first element in
1141
- * our window on the new children. If we find such a node we handle calling
1142
- * out to `patch`, moving relevant DOM nodes, and so on, in accordance with
1143
- * what we find.
1144
- *
1145
- * Finally, once we've narrowed our 'windows' to the point that either of them
1146
- * collapse (i.e. they have length 0) we then handle any remaining VNode
1147
- * insertion or deletion that needs to happen to get a DOM state that correctly
1148
- * reflects the new child VNodes. If, for instance, after our window on the old
1149
- * children has collapsed we still have more nodes on the new children that
1150
- * we haven't dealt with yet then we need to add them, or if the new children
1151
- * collapse but we still have unhandled _old_ children then we need to make
1152
- * sure the corresponding DOM nodes are removed.
1153
- *
1154
- * @param parentElm the node into which the parent VNode is rendered
1155
- * @param oldCh the old children of the parent node
1156
- * @param newVNode the new VNode which will replace the parent
1157
- * @param newCh the new children of the parent node
1158
- * @param isInitialRender whether or not this is the first render of the vdom
1159
- */
1160
- const updateChildren = (parentElm, oldCh, newVNode, newCh, isInitialRender = false) => {
1161
- let oldStartIdx = 0;
1162
- let newStartIdx = 0;
1163
- let idxInOld = 0;
1164
- let i = 0;
1165
- let oldEndIdx = oldCh.length - 1;
1166
- let oldStartVnode = oldCh[0];
1167
- let oldEndVnode = oldCh[oldEndIdx];
1168
- let newEndIdx = newCh.length - 1;
1169
- let newStartVnode = newCh[0];
1170
- let newEndVnode = newCh[newEndIdx];
1171
- let node;
1172
- let elmToMove;
1173
- while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
1174
- if (oldStartVnode == null) {
1175
- // VNode might have been moved left
1176
- oldStartVnode = oldCh[++oldStartIdx];
1177
- }
1178
- else if (oldEndVnode == null) {
1179
- oldEndVnode = oldCh[--oldEndIdx];
1180
- }
1181
- else if (newStartVnode == null) {
1182
- newStartVnode = newCh[++newStartIdx];
1183
- }
1184
- else if (newEndVnode == null) {
1185
- newEndVnode = newCh[--newEndIdx];
1186
- }
1187
- else if (isSameVnode(oldStartVnode, newStartVnode, isInitialRender)) {
1188
- // if the start nodes are the same then we should patch the new VNode
1189
- // onto the old one, and increment our `newStartIdx` and `oldStartIdx`
1190
- // indices to reflect that. We don't need to move any DOM Nodes around
1191
- // since things are matched up in order.
1192
- patch(oldStartVnode, newStartVnode, isInitialRender);
1193
- oldStartVnode = oldCh[++oldStartIdx];
1194
- newStartVnode = newCh[++newStartIdx];
1195
- }
1196
- else if (isSameVnode(oldEndVnode, newEndVnode, isInitialRender)) {
1197
- // likewise, if the end nodes are the same we patch new onto old and
1198
- // decrement our end indices, and also likewise in this case we don't
1199
- // need to move any DOM Nodes.
1200
- patch(oldEndVnode, newEndVnode, isInitialRender);
1201
- oldEndVnode = oldCh[--oldEndIdx];
1202
- newEndVnode = newCh[--newEndIdx];
1203
- }
1204
- else if (isSameVnode(oldStartVnode, newEndVnode, isInitialRender)) {
1205
- // case: "Vnode moved right"
1206
- //
1207
- // We've found that the last node in our window on the new children is
1208
- // the same VNode as the _first_ node in our window on the old children
1209
- // we're dealing with now. Visually, this is the layout of these two
1210
- // nodes:
1211
- //
1212
- // newCh: [..., newStartVnode , ... , newEndVnode , ...]
1213
- // ^^^^^^^^^^^
1214
- // oldCh: [..., oldStartVnode , ... , oldEndVnode , ...]
1215
- // ^^^^^^^^^^^^^
1216
- //
1217
- // In this situation we need to patch `newEndVnode` onto `oldStartVnode`
1218
- // and move the DOM element for `oldStartVnode`.
1219
- if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
1220
- putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
1221
- }
1222
- patch(oldStartVnode, newEndVnode, isInitialRender);
1223
- // We need to move the element for `oldStartVnode` into a position which
1224
- // will be appropriate for `newEndVnode`. For this we can use
1225
- // `.insertBefore` and `oldEndVnode.$elm$.nextSibling`. If there is a
1226
- // sibling for `oldEndVnode.$elm$` then we want to move the DOM node for
1227
- // `oldStartVnode` between `oldEndVnode` and it's sibling, like so:
1228
- //
1229
- // <old-start-node />
1230
- // <some-intervening-node />
1231
- // <old-end-node />
1232
- // <!-- -> <-- `oldStartVnode.$elm$` should be inserted here
1233
- // <next-sibling />
1234
- //
1235
- // If instead `oldEndVnode.$elm$` has no sibling then we just want to put
1236
- // the node for `oldStartVnode` at the end of the children of
1237
- // `parentElm`. Luckily, `Node.nextSibling` will return `null` if there
1238
- // aren't any siblings, and passing `null` to `Node.insertBefore` will
1239
- // append it to the children of the parent element.
1240
- parentElm.insertBefore(oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
1241
- oldStartVnode = oldCh[++oldStartIdx];
1242
- newEndVnode = newCh[--newEndIdx];
1243
- }
1244
- else if (isSameVnode(oldEndVnode, newStartVnode, isInitialRender)) {
1245
- // case: "Vnode moved left"
1246
- //
1247
- // We've found that the first node in our window on the new children is
1248
- // the same VNode as the _last_ node in our window on the old children.
1249
- // Visually, this is the layout of these two nodes:
1250
- //
1251
- // newCh: [..., newStartVnode , ... , newEndVnode , ...]
1252
- // ^^^^^^^^^^^^^
1253
- // oldCh: [..., oldStartVnode , ... , oldEndVnode , ...]
1254
- // ^^^^^^^^^^^
1255
- //
1256
- // In this situation we need to patch `newStartVnode` onto `oldEndVnode`
1257
- // (which will handle updating any changed attributes, reconciling their
1258
- // children etc) but we also need to move the DOM node to which
1259
- // `oldEndVnode` corresponds.
1260
- if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
1261
- putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
1262
- }
1263
- patch(oldEndVnode, newStartVnode, isInitialRender);
1264
- // We've already checked above if `oldStartVnode` and `newStartVnode` are
1265
- // the same node, so since we're here we know that they are not. Thus we
1266
- // can move the element for `oldEndVnode` _before_ the element for
1267
- // `oldStartVnode`, leaving `oldStartVnode` to be reconciled in the
1268
- // future.
1269
- parentElm.insertBefore(oldEndVnode.$elm$, oldStartVnode.$elm$);
1270
- oldEndVnode = oldCh[--oldEndIdx];
1271
- newStartVnode = newCh[++newStartIdx];
1272
- }
1273
- else {
1274
- // Here we do some checks to match up old and new nodes based on the
1275
- // `$key$` attribute, which is set by putting a `key="my-key"` attribute
1276
- // in the JSX for a DOM element in the implementation of a Stencil
1277
- // component.
1278
- //
1279
- // First we check to see if there are any nodes in the array of old
1280
- // children which have the same key as the first node in the new
1281
- // children.
1282
- idxInOld = -1;
1283
- {
1284
- for (i = oldStartIdx; i <= oldEndIdx; ++i) {
1285
- if (oldCh[i] && oldCh[i].$key$ !== null && oldCh[i].$key$ === newStartVnode.$key$) {
1286
- idxInOld = i;
1287
- break;
1288
- }
1289
- }
1290
- }
1291
- if (idxInOld >= 0) {
1292
- // We found a node in the old children which matches up with the first
1293
- // node in the new children! So let's deal with that
1294
- elmToMove = oldCh[idxInOld];
1295
- if (elmToMove.$tag$ !== newStartVnode.$tag$) {
1296
- // the tag doesn't match so we'll need a new DOM element
1297
- node = createElm(oldCh && oldCh[newStartIdx], newVNode, idxInOld, parentElm);
1298
- }
1299
- else {
1300
- patch(elmToMove, newStartVnode, isInitialRender);
1301
- // invalidate the matching old node so that we won't try to update it
1302
- // again later on
1303
- oldCh[idxInOld] = undefined;
1304
- node = elmToMove.$elm$;
1305
- }
1306
- newStartVnode = newCh[++newStartIdx];
1307
- }
1308
- else {
1309
- // We either didn't find an element in the old children that matches
1310
- // the key of the first new child OR the build is not using `key`
1311
- // attributes at all. In either case we need to create a new element
1312
- // for the new node.
1313
- node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx, parentElm);
1314
- newStartVnode = newCh[++newStartIdx];
1315
- }
1316
- if (node) {
1317
- // if we created a new node then handle inserting it to the DOM
1318
- {
1319
- parentReferenceNode(oldStartVnode.$elm$).insertBefore(node, referenceNode(oldStartVnode.$elm$));
1320
- }
1321
- }
1322
- }
1323
- }
1324
- if (oldStartIdx > oldEndIdx) {
1325
- // we have some more new nodes to add which don't match up with old nodes
1326
- addVnodes(parentElm, newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$, newVNode, newCh, newStartIdx, newEndIdx);
1327
- }
1328
- else if (newStartIdx > newEndIdx) {
1329
- // there are nodes in the `oldCh` array which no longer correspond to nodes
1330
- // in the new array, so lets remove them (which entails cleaning up the
1331
- // relevant DOM nodes)
1332
- removeVnodes(oldCh, oldStartIdx, oldEndIdx);
1333
- }
1334
- };
1335
- /**
1336
- * Compare two VNodes to determine if they are the same
1337
- *
1338
- * **NB**: This function is an equality _heuristic_ based on the available
1339
- * information set on the two VNodes and can be misleading under certain
1340
- * circumstances. In particular, if the two nodes do not have `key` attrs
1341
- * (available under `$key$` on VNodes) then the function falls back on merely
1342
- * checking that they have the same tag.
1343
- *
1344
- * So, in other words, if `key` attrs are not set on VNodes which may be
1345
- * changing order within a `children` array or something along those lines then
1346
- * we could obtain a false negative and then have to do needless re-rendering
1347
- * (i.e. we'd say two VNodes aren't equal when in fact they should be).
1348
- *
1349
- * @param leftVNode the first VNode to check
1350
- * @param rightVNode the second VNode to check
1351
- * @param isInitialRender whether or not this is the first render of the vdom
1352
- * @returns whether they're equal or not
1353
- */
1354
- const isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
1355
- // compare if two vnode to see if they're "technically" the same
1356
- // need to have the same element tag, and same key to be the same
1357
- if (leftVNode.$tag$ === rightVNode.$tag$) {
1358
- if (leftVNode.$tag$ === 'slot') {
1359
- return leftVNode.$name$ === rightVNode.$name$;
1360
- }
1361
- // this will be set if JSX tags in the build have `key` attrs set on them
1362
- // we only want to check this if we're not on the first render since on
1363
- // first render `leftVNode.$key$` will always be `null`, so we can be led
1364
- // astray and, for instance, accidentally delete a DOM node that we want to
1365
- // keep around.
1366
- if (!isInitialRender) {
1367
- return leftVNode.$key$ === rightVNode.$key$;
1368
- }
1369
- return true;
1370
- }
1371
- return false;
1372
- };
1373
- const referenceNode = (node) => {
1374
- // this node was relocated to a new location in the dom
1375
- // because of some other component's slot
1376
- // but we still have an html comment in place of where
1377
- // it's original location was according to it's original vdom
1378
- return (node && node['s-ol']) || node;
1379
- };
1380
- const parentReferenceNode = (node) => (node['s-ol'] ? node['s-ol'] : node).parentNode;
1381
- /**
1382
- * Handle reconciling an outdated VNode with a new one which corresponds to
1383
- * it. This function handles flushing updates to the DOM and reconciling the
1384
- * children of the two nodes (if any).
1385
- *
1386
- * @param oldVNode an old VNode whose DOM element and children we want to update
1387
- * @param newVNode a new VNode representing an updated version of the old one
1388
- * @param isInitialRender whether or not this is the first render of the vdom
1389
- */
1390
- const patch = (oldVNode, newVNode, isInitialRender = false) => {
1391
- const elm = (newVNode.$elm$ = oldVNode.$elm$);
1392
- const oldChildren = oldVNode.$children$;
1393
- const newChildren = newVNode.$children$;
1394
- const tag = newVNode.$tag$;
1395
- const text = newVNode.$text$;
1396
- let defaultHolder;
1397
- if (text === null) {
1398
- {
1399
- // test if we're rendering an svg element, or still rendering nodes inside of one
1400
- // only add this to the when the compiler sees we're using an svg somewhere
1401
- isSvgMode = tag === 'svg' ? true : tag === 'foreignObject' ? false : isSvgMode;
1402
- }
1403
- {
1404
- if (tag === 'slot')
1405
- ;
1406
- else {
1407
- // either this is the first render of an element OR it's an update
1408
- // AND we already know it's possible it could have changed
1409
- // this updates the element's css classes, attrs, props, listeners, etc.
1410
- updateElement(oldVNode, newVNode, isSvgMode);
1411
- }
1412
- }
1413
- if (oldChildren !== null && newChildren !== null) {
1414
- // looks like there's child vnodes for both the old and new vnodes
1415
- // so we need to call `updateChildren` to reconcile them
1416
- updateChildren(elm, oldChildren, newVNode, newChildren, isInitialRender);
1417
- }
1418
- else if (newChildren !== null) {
1419
- // no old child vnodes, but there are new child vnodes to add
1420
- if (oldVNode.$text$ !== null) {
1421
- // the old vnode was text, so be sure to clear it out
1422
- elm.textContent = '';
1423
- }
1424
- // add the new vnode children
1425
- addVnodes(elm, null, newVNode, newChildren, 0, newChildren.length - 1);
1426
- }
1427
- else if (oldChildren !== null) {
1428
- // no new child vnodes, but there are old child vnodes to remove
1429
- removeVnodes(oldChildren, 0, oldChildren.length - 1);
1430
- }
1431
- if (isSvgMode && tag === 'svg') {
1432
- isSvgMode = false;
1433
- }
1434
- }
1435
- else if ((defaultHolder = elm['s-cr'])) {
1436
- // this element has slotted content
1437
- defaultHolder.parentNode.textContent = text;
1438
- }
1439
- else if (oldVNode.$text$ !== text) {
1440
- // update the text content for the text only vnode
1441
- // and also only if the text is different than before
1442
- elm.data = text;
1443
- }
1444
- };
1445
- /**
1446
- * Adjust the `.hidden` property as-needed on any nodes in a DOM subtree which
1447
- * are slot fallbacks nodes.
1448
- *
1449
- * A slot fallback node should be visible by default. Then, it should be
1450
- * conditionally hidden if:
1451
- *
1452
- * - it has a sibling with a `slot` property set to its slot name or if
1453
- * - it is a default fallback slot node, in which case we hide if it has any
1454
- * content
1455
- *
1456
- * @param elm the element of interest
1457
- */
1458
- const updateFallbackSlotVisibility = (elm) => {
1459
- const childNodes = elm.childNodes;
1460
- for (const childNode of childNodes) {
1461
- if (childNode.nodeType === 1 /* NODE_TYPE.ElementNode */) {
1462
- if (childNode['s-sr']) {
1463
- // this is a slot fallback node
1464
- // get the slot name for this slot reference node
1465
- const slotName = childNode['s-sn'];
1466
- // by default always show a fallback slot node
1467
- // then hide it if there are other slots in the light dom
1468
- childNode.hidden = false;
1469
- // we need to check all of its sibling nodes in order to see if
1470
- // `childNode` should be hidden
1471
- for (const siblingNode of childNodes) {
1472
- // Don't check the node against itself
1473
- if (siblingNode !== childNode) {
1474
- if (siblingNode['s-hn'] !== childNode['s-hn'] || slotName !== '') {
1475
- // this sibling node is from a different component OR is a named
1476
- // fallback slot node
1477
- if (siblingNode.nodeType === 1 /* NODE_TYPE.ElementNode */ &&
1478
- (slotName === siblingNode.getAttribute('slot') || slotName === siblingNode['s-sn'])) {
1479
- childNode.hidden = true;
1480
- break;
1481
- }
1482
- }
1483
- else {
1484
- // this is a default fallback slot node
1485
- // any element or text node (with content)
1486
- // should hide the default fallback slot node
1487
- if (siblingNode.nodeType === 1 /* NODE_TYPE.ElementNode */ ||
1488
- (siblingNode.nodeType === 3 /* NODE_TYPE.TextNode */ && siblingNode.textContent.trim() !== '')) {
1489
- childNode.hidden = true;
1490
- break;
1491
- }
1492
- }
1493
- }
1494
- }
1495
- }
1496
- // keep drilling down
1497
- updateFallbackSlotVisibility(childNode);
1498
- }
1499
- }
1500
- };
1501
- /**
1502
- * Component-global information about nodes which are either currently being
1503
- * relocated or will be shortly.
1504
- */
1505
- const relocateNodes = [];
1506
- /**
1507
- * Mark the contents of a slot for relocation via adding references to them to
1508
- * the {@link relocateNodes} data structure. The actual work of relocating them
1509
- * will then be handled in {@link renderVdom}.
1510
- *
1511
- * @param elm a render node whose child nodes need to be relocated
1512
- */
1513
- const markSlotContentForRelocation = (elm) => {
1514
- // tslint:disable-next-line: prefer-const
1515
- let node;
1516
- let hostContentNodes;
1517
- let j;
1518
- for (const childNode of elm.childNodes) {
1519
- // we need to find child nodes which are slot references so we can then try
1520
- // to match them up with nodes that need to be relocated
1521
- if (childNode['s-sr'] && (node = childNode['s-cr']) && node.parentNode) {
1522
- // first get the content reference comment node ('s-cr'), then we get
1523
- // its parent, which is where all the host content is now
1524
- hostContentNodes = node.parentNode.childNodes;
1525
- const slotName = childNode['s-sn'];
1526
- // iterate through all the nodes under the location where the host was
1527
- // originally rendered
1528
- for (j = hostContentNodes.length - 1; j >= 0; j--) {
1529
- node = hostContentNodes[j];
1530
- // check that the node is not a content reference node or a node
1531
- // reference and then check that the host name does not match that of
1532
- // childNode.
1533
- // In addition, check that the slot either has not already been relocated, or
1534
- // that its current location's host is not childNode's host. This is essentially
1535
- // a check so that we don't try to relocate (and then hide) a node that is already
1536
- // where it should be.
1537
- if (!node['s-cn'] &&
1538
- !node['s-nr'] &&
1539
- node['s-hn'] !== childNode['s-hn'] &&
1540
- (!BUILD.experimentalSlotFixes )) {
1541
- // if `node` is located in the slot that `childNode` refers to (via the
1542
- // `'s-sn'` property) then we need to relocate it from it's current spot
1543
- // (under the host element parent) to the right slot location
1544
- if (isNodeLocatedInSlot(node, slotName)) {
1545
- // it's possible we've already decided to relocate this node
1546
- let relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
1547
- // made some changes to slots
1548
- // let's make sure we also double check
1549
- // fallbacks are correctly hidden or shown
1550
- checkSlotFallbackVisibility = true;
1551
- // ensure that the slot-name attr is correct
1552
- node['s-sn'] = node['s-sn'] || slotName;
1553
- if (relocateNodeData) {
1554
- relocateNodeData.$nodeToRelocate$['s-sh'] = childNode['s-hn'];
1555
- // we marked this node for relocation previously but didn't find
1556
- // out the slot reference node to which it needs to be relocated
1557
- // so write it down now!
1558
- relocateNodeData.$slotRefNode$ = childNode;
1559
- }
1560
- else {
1561
- node['s-sh'] = childNode['s-hn'];
1562
- // add to our list of nodes to relocate
1563
- relocateNodes.push({
1564
- $slotRefNode$: childNode,
1565
- $nodeToRelocate$: node,
1566
- });
1567
- }
1568
- if (node['s-sr']) {
1569
- relocateNodes.map((relocateNode) => {
1570
- if (isNodeLocatedInSlot(relocateNode.$nodeToRelocate$, node['s-sn'])) {
1571
- relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
1572
- if (relocateNodeData && !relocateNode.$slotRefNode$) {
1573
- relocateNode.$slotRefNode$ = relocateNodeData.$slotRefNode$;
1574
- }
1575
- }
1576
- });
1577
- }
1578
- }
1579
- else if (!relocateNodes.some((r) => r.$nodeToRelocate$ === node)) {
1580
- // the node is not found within the slot (`childNode`) that we're
1581
- // currently looking at, so we stick it into `relocateNodes` to
1582
- // handle later. If we never find a home for this element then
1583
- // we'll need to hide it
1584
- relocateNodes.push({
1585
- $nodeToRelocate$: node,
1586
- });
1587
- }
1588
- }
1589
- }
1590
- }
1591
- // if we're dealing with any type of element (capable of itself being a
1592
- // slot reference or containing one) then we recur
1593
- if (childNode.nodeType === 1 /* NODE_TYPE.ElementNode */) {
1594
- markSlotContentForRelocation(childNode);
1595
- }
1596
- }
1597
- };
1598
- /**
1599
- * Check whether a node is located in a given named slot.
1600
- *
1601
- * @param nodeToRelocate the node of interest
1602
- * @param slotName the slot name to check
1603
- * @returns whether the node is located in the slot or not
1604
- */
1605
- const isNodeLocatedInSlot = (nodeToRelocate, slotName) => {
1606
- if (nodeToRelocate.nodeType === 1 /* NODE_TYPE.ElementNode */) {
1607
- if (nodeToRelocate.getAttribute('slot') === null && slotName === '') {
1608
- // if the node doesn't have a slot attribute, and the slot we're checking
1609
- // is not a named slot, then we assume the node should be within the slot
1610
- return true;
1611
- }
1612
- if (nodeToRelocate.getAttribute('slot') === slotName) {
1613
- return true;
1614
- }
1615
- return false;
1616
- }
1617
- if (nodeToRelocate['s-sn'] === slotName) {
1618
- return true;
1619
- }
1620
- return slotName === '';
1621
- };
1622
- /**
1623
- * 'Nullify' any VDom `ref` callbacks on a VDom node or its children by calling
1624
- * them with `null`. This signals that the DOM element corresponding to the VDom
1625
- * node has been removed from the DOM.
1626
- *
1627
- * @param vNode a virtual DOM node
1628
- */
1629
- const nullifyVNodeRefs = (vNode) => {
1630
- {
1631
- vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
1632
- vNode.$children$ && vNode.$children$.map(nullifyVNodeRefs);
1633
- }
1634
- };
1635
- /**
1636
- * The main entry point for Stencil's virtual DOM-based rendering engine
1637
- *
1638
- * Given a {@link d.HostRef} container and some virtual DOM nodes, this
1639
- * function will handle creating a virtual DOM tree with a single root, patching
1640
- * the current virtual DOM tree onto an old one (if any), dealing with slot
1641
- * relocation, and reflecting attributes.
1642
- *
1643
- * @param hostRef data needed to root and render the virtual DOM tree, such as
1644
- * the DOM node into which it should be rendered.
1645
- * @param renderFnResults the virtual DOM nodes to be rendered
1646
- * @param isInitialLoad whether or not this is the first call after page load
1647
- */
1648
- const renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
1649
- var _a, _b, _c, _d;
1650
- const hostElm = hostRef.$hostElement$;
1651
- const cmpMeta = hostRef.$cmpMeta$;
1652
- const oldVNode = hostRef.$vnode$ || newVNode(null, null);
1653
- // if `renderFnResults` is a Host node then we can use it directly. If not,
1654
- // we need to call `h` again to wrap the children of our component in a
1655
- // 'dummy' Host node (well, an empty vnode) since `renderVdom` assumes
1656
- // implicitly that the top-level vdom node is 1) an only child and 2)
1657
- // contains attrs that need to be set on the host element.
1658
- const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
1659
- hostTagName = hostElm.tagName;
1660
- if (cmpMeta.$attrsToReflect$) {
1661
- rootVnode.$attrs$ = rootVnode.$attrs$ || {};
1662
- cmpMeta.$attrsToReflect$.map(([propName, attribute]) => (rootVnode.$attrs$[attribute] = hostElm[propName]));
1663
- }
1664
- // On the first render and *only* on the first render we want to check for
1665
- // any attributes set on the host element which are also set on the vdom
1666
- // node. If we find them, we override the value on the VDom node attrs with
1667
- // the value from the host element, which allows developers building apps
1668
- // with Stencil components to override e.g. the `role` attribute on a
1669
- // component even if it's already set on the `Host`.
1670
- if (isInitialLoad && rootVnode.$attrs$) {
1671
- for (const key of Object.keys(rootVnode.$attrs$)) {
1672
- // We have a special implementation in `setAccessor` for `style` and
1673
- // `class` which reconciles values coming from the VDom with values
1674
- // already present on the DOM element, so we don't want to override those
1675
- // attributes on the VDom tree with values from the host element if they
1676
- // are present.
1677
- //
1678
- // Likewise, `ref` and `key` are special internal values for the Stencil
1679
- // runtime and we don't want to override those either.
1680
- if (hostElm.hasAttribute(key) && !['key', 'ref', 'style', 'class'].includes(key)) {
1681
- rootVnode.$attrs$[key] = hostElm[key];
1682
- }
1683
- }
1684
- }
1685
- rootVnode.$tag$ = null;
1686
- rootVnode.$flags$ |= 4 /* VNODE_FLAGS.isHost */;
1687
- hostRef.$vnode$ = rootVnode;
1688
- rootVnode.$elm$ = oldVNode.$elm$ = (hostElm.shadowRoot || hostElm );
1689
- {
1690
- scopeId = hostElm['s-sc'];
1691
- }
1692
- {
1693
- contentRef = hostElm['s-cr'];
1694
- useNativeShadowDom = (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) !== 0;
1695
- // always reset
1696
- checkSlotFallbackVisibility = false;
1697
- }
1698
- // synchronous patch
1699
- patch(oldVNode, rootVnode, isInitialLoad);
1700
- {
1701
- // while we're moving nodes around existing nodes, temporarily disable
1702
- // the disconnectCallback from working
1703
- plt.$flags$ |= 1 /* PLATFORM_FLAGS.isTmpDisconnected */;
1704
- if (checkSlotRelocate) {
1705
- markSlotContentForRelocation(rootVnode.$elm$);
1706
- for (const relocateData of relocateNodes) {
1707
- const nodeToRelocate = relocateData.$nodeToRelocate$;
1708
- if (!nodeToRelocate['s-ol']) {
1709
- // add a reference node marking this node's original location
1710
- // keep a reference to this node for later lookups
1711
- const orgLocationNode = doc.createTextNode('');
1712
- orgLocationNode['s-nr'] = nodeToRelocate;
1713
- nodeToRelocate.parentNode.insertBefore((nodeToRelocate['s-ol'] = orgLocationNode), nodeToRelocate);
1714
- }
1715
- }
1716
- for (const relocateData of relocateNodes) {
1717
- const nodeToRelocate = relocateData.$nodeToRelocate$;
1718
- const slotRefNode = relocateData.$slotRefNode$;
1719
- if (slotRefNode) {
1720
- const parentNodeRef = slotRefNode.parentNode;
1721
- // When determining where to insert content, the most simple case would be
1722
- // to relocate the node immediately following the slot reference node. We do this
1723
- // by getting a reference to the node immediately following the slot reference node
1724
- // since we will use `insertBefore` to manipulate the DOM.
1725
- //
1726
- // If there is no node immediately following the slot reference node, then we will just
1727
- // end up appending the node as the last child of the parent.
1728
- let insertBeforeNode = slotRefNode.nextSibling;
1729
- // If the node we're currently planning on inserting the new node before is an element,
1730
- // we need to do some additional checks to make sure we're inserting the node in the correct order.
1731
- // The use case here would be that we have multiple nodes being relocated to the same slot. So, we want
1732
- // to make sure they get inserted into their new how in the same order they were declared in their original location.
1733
- //
1734
- // TODO(STENCIL-914): Remove `experimentalSlotFixes` check
1735
- {
1736
- let orgLocationNode = (_a = nodeToRelocate['s-ol']) === null || _a === void 0 ? void 0 : _a.previousSibling;
1737
- while (orgLocationNode) {
1738
- let refNode = (_b = orgLocationNode['s-nr']) !== null && _b !== void 0 ? _b : null;
1739
- if (refNode && refNode['s-sn'] === nodeToRelocate['s-sn'] && parentNodeRef === refNode.parentNode) {
1740
- refNode = refNode.nextSibling;
1741
- if (!refNode || !refNode['s-nr']) {
1742
- insertBeforeNode = refNode;
1743
- break;
1744
- }
1745
- }
1746
- orgLocationNode = orgLocationNode.previousSibling;
1747
- }
1748
- }
1749
- if ((!insertBeforeNode && parentNodeRef !== nodeToRelocate.parentNode) ||
1750
- nodeToRelocate.nextSibling !== insertBeforeNode) {
1751
- // we've checked that it's worth while to relocate
1752
- // since that the node to relocate
1753
- // has a different next sibling or parent relocated
1754
- if (nodeToRelocate !== insertBeforeNode) {
1755
- if (!nodeToRelocate['s-hn'] && nodeToRelocate['s-ol']) {
1756
- // probably a component in the index.html that doesn't have its hostname set
1757
- nodeToRelocate['s-hn'] = nodeToRelocate['s-ol'].parentNode.nodeName;
1758
- }
1759
- // Add it back to the dom but in its new home
1760
- // If we get to this point and `insertBeforeNode` is `null`, that means
1761
- // we're just going to append the node as the last child of the parent. Passing
1762
- // `null` as the second arg here will trigger that behavior.
1763
- parentNodeRef.insertBefore(nodeToRelocate, insertBeforeNode);
1764
- // Reset the `hidden` value back to what it was defined as originally
1765
- // This solves a problem where a `slot` is dynamically rendered and `hidden` may have
1766
- // been set on content originally, but now it has a slot to go to so it should have
1767
- // the value it was defined as having in the DOM, not what we overrode it to.
1768
- if (nodeToRelocate.nodeType === 1 /* NODE_TYPE.ElementNode */) {
1769
- nodeToRelocate.hidden = (_c = nodeToRelocate['s-ih']) !== null && _c !== void 0 ? _c : false;
1770
- }
1771
- }
1772
- }
1773
- }
1774
- else {
1775
- // this node doesn't have a slot home to go to, so let's hide it
1776
- if (nodeToRelocate.nodeType === 1 /* NODE_TYPE.ElementNode */) {
1777
- // Store the initial value of `hidden` so we can reset it later when
1778
- // moving nodes around.
1779
- if (isInitialLoad) {
1780
- nodeToRelocate['s-ih'] = (_d = nodeToRelocate.hidden) !== null && _d !== void 0 ? _d : false;
1781
- }
1782
- nodeToRelocate.hidden = true;
1783
- }
1784
- }
1785
- }
1786
- }
1787
- if (checkSlotFallbackVisibility) {
1788
- updateFallbackSlotVisibility(rootVnode.$elm$);
1789
- }
1790
- // done moving nodes around
1791
- // allow the disconnect callback to work again
1792
- plt.$flags$ &= ~1 /* PLATFORM_FLAGS.isTmpDisconnected */;
1793
- // always reset
1794
- relocateNodes.length = 0;
1795
- }
1796
- };
1797
- const attachToAncestor = (hostRef, ancestorComponent) => {
1798
- if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) {
1799
- ancestorComponent['s-p'].push(new Promise((r) => (hostRef.$onRenderResolve$ = r)));
1800
- }
1801
- };
1802
- const scheduleUpdate = (hostRef, isInitialLoad) => {
1803
- {
1804
- hostRef.$flags$ |= 16 /* HOST_FLAGS.isQueuedForUpdate */;
1805
- }
1806
- if (hostRef.$flags$ & 4 /* HOST_FLAGS.isWaitingForChildren */) {
1807
- hostRef.$flags$ |= 512 /* HOST_FLAGS.needsRerender */;
1808
- return;
1809
- }
1810
- attachToAncestor(hostRef, hostRef.$ancestorComponent$);
1811
- // there is no ancestor component or the ancestor component
1812
- // has already fired off its lifecycle update then
1813
- // fire off the initial update
1814
- const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
1815
- return writeTask(dispatch) ;
1816
- };
1817
- /**
1818
- * Dispatch initial-render and update lifecycle hooks, enqueuing calls to
1819
- * component lifecycle methods like `componentWillLoad` as well as
1820
- * {@link updateComponent}, which will kick off the virtual DOM re-render.
1821
- *
1822
- * @param hostRef a reference to a host DOM node
1823
- * @param isInitialLoad whether we're on the initial load or not
1824
- * @returns an empty Promise which is used to enqueue a series of operations for
1825
- * the component
1826
- */
1827
- const dispatchHooks = (hostRef, isInitialLoad) => {
1828
- const endSchedule = createTime('scheduleUpdate', hostRef.$cmpMeta$.$tagName$);
1829
- const instance = hostRef.$lazyInstance$ ;
1830
- // We're going to use this variable together with `enqueue` to implement a
1831
- // little promise-based queue. We start out with it `undefined`. When we add
1832
- // the first function to the queue we'll set this variable to be that
1833
- // function's return value. When we attempt to add subsequent values to the
1834
- // queue we'll check that value and, if it was a `Promise`, we'll then chain
1835
- // the new function off of that `Promise` using `.then()`. This will give our
1836
- // queue two nice properties:
1837
- //
1838
- // 1. If all functions added to the queue are synchronous they'll be called
1839
- // synchronously right away.
1840
- // 2. If all functions added to the queue are asynchronous they'll all be
1841
- // called in order after `dispatchHooks` exits.
1842
- let maybePromise;
1843
- if (isInitialLoad) {
1844
- {
1845
- hostRef.$flags$ |= 256 /* HOST_FLAGS.isListenReady */;
1846
- if (hostRef.$queuedListeners$) {
1847
- hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
1848
- hostRef.$queuedListeners$ = undefined;
1849
- }
1850
- }
1851
- {
1852
- // If `componentWillLoad` returns a `Promise` then we want to wait on
1853
- // whatever's going on in that `Promise` before we launch into
1854
- // rendering the component, doing other lifecycle stuff, etc. So
1855
- // in that case we assign the returned promise to the variable we
1856
- // declared above to hold a possible 'queueing' Promise
1857
- maybePromise = safeCall(instance, 'componentWillLoad');
1858
- }
1859
- }
1860
- {
1861
- maybePromise = enqueue(maybePromise, () => safeCall(instance, 'componentWillRender'));
1862
- }
1863
- endSchedule();
1864
- return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));
1865
- };
1866
- /**
1867
- * This function uses a Promise to implement a simple first-in, first-out queue
1868
- * of functions to be called.
1869
- *
1870
- * The queue is ordered on the basis of the first argument. If it's
1871
- * `undefined`, then nothing is on the queue yet, so the provided function can
1872
- * be called synchronously (although note that this function may return a
1873
- * `Promise`). The idea is that then the return value of that enqueueing
1874
- * operation is kept around, so that if it was a `Promise` then subsequent
1875
- * functions can be enqueued by calling this function again with that `Promise`
1876
- * as the first argument.
1877
- *
1878
- * @param maybePromise either a `Promise` which should resolve before the next function is called or an 'empty' sentinel
1879
- * @param fn a function to enqueue
1880
- * @returns either a `Promise` or the return value of the provided function
1881
- */
1882
- const enqueue = (maybePromise, fn) => isPromisey(maybePromise) ? maybePromise.then(fn) : fn();
1883
- /**
1884
- * Check that a value is a `Promise`. To check, we first see if the value is an
1885
- * instance of the `Promise` global. In a few circumstances, in particular if
1886
- * the global has been overwritten, this is could be misleading, so we also do
1887
- * a little 'duck typing' check to see if the `.then` property of the value is
1888
- * defined and a function.
1889
- *
1890
- * @param maybePromise it might be a promise!
1891
- * @returns whether it is or not
1892
- */
1893
- const isPromisey = (maybePromise) => maybePromise instanceof Promise ||
1894
- (maybePromise && maybePromise.then && typeof maybePromise.then === 'function');
1895
- /**
1896
- * Update a component given reference to its host elements and so on.
1897
- *
1898
- * @param hostRef an object containing references to the element's host node,
1899
- * VDom nodes, and other metadata
1900
- * @param instance a reference to the underlying host element where it will be
1901
- * rendered
1902
- * @param isInitialLoad whether or not this function is being called as part of
1903
- * the first render cycle
1904
- */
1905
- const updateComponent = async (hostRef, instance, isInitialLoad) => {
1906
- var _a;
1907
- const elm = hostRef.$hostElement$;
1908
- const endUpdate = createTime('update', hostRef.$cmpMeta$.$tagName$);
1909
- const rc = elm['s-rc'];
1910
- if (isInitialLoad) {
1911
- // DOM WRITE!
1912
- attachStyles(hostRef);
1913
- }
1914
- const endRender = createTime('render', hostRef.$cmpMeta$.$tagName$);
1915
- {
1916
- callRender(hostRef, instance, elm, isInitialLoad);
1917
- }
1918
- if (rc) {
1919
- // ok, so turns out there are some child host elements
1920
- // waiting on this parent element to load
1921
- // let's fire off all update callbacks waiting
1922
- rc.map((cb) => cb());
1923
- elm['s-rc'] = undefined;
1924
- }
1925
- endRender();
1926
- endUpdate();
1927
- {
1928
- const childrenPromises = (_a = elm['s-p']) !== null && _a !== void 0 ? _a : [];
1929
- const postUpdate = () => postUpdateComponent(hostRef);
1930
- if (childrenPromises.length === 0) {
1931
- postUpdate();
1932
- }
1933
- else {
1934
- Promise.all(childrenPromises).then(postUpdate);
1935
- hostRef.$flags$ |= 4 /* HOST_FLAGS.isWaitingForChildren */;
1936
- childrenPromises.length = 0;
1937
- }
1938
- }
1939
- };
1940
- /**
1941
- * Handle making the call to the VDom renderer with the proper context given
1942
- * various build variables
1943
- *
1944
- * @param hostRef an object containing references to the element's host node,
1945
- * VDom nodes, and other metadata
1946
- * @param instance a reference to the underlying host element where it will be
1947
- * rendered
1948
- * @param elm the Host element for the component
1949
- * @param isInitialLoad whether or not this function is being called as part of
1950
- * @returns an empty promise
1951
- */
1952
- const callRender = (hostRef, instance, elm, isInitialLoad) => {
1953
- try {
1954
- /**
1955
- * minification optimization: `allRenderFn` is `true` if all components have a `render`
1956
- * method, so we can call the method immediately. If not, check before calling it.
1957
- */
1958
- instance = instance.render() ;
1959
- {
1960
- hostRef.$flags$ &= ~16 /* HOST_FLAGS.isQueuedForUpdate */;
1961
- }
1962
- {
1963
- hostRef.$flags$ |= 2 /* HOST_FLAGS.hasRendered */;
1964
- }
1965
- {
1966
- {
1967
- // looks like we've got child nodes to render into this host element
1968
- // or we need to update the css class/attrs on the host element
1969
- // DOM WRITE!
1970
- {
1971
- renderVdom(hostRef, instance, isInitialLoad);
1972
- }
1973
- }
1974
- }
1975
- }
1976
- catch (e) {
1977
- consoleError(e, hostRef.$hostElement$);
1978
- }
1979
- return null;
1980
- };
1981
- const postUpdateComponent = (hostRef) => {
1982
- const tagName = hostRef.$cmpMeta$.$tagName$;
1983
- const elm = hostRef.$hostElement$;
1984
- const endPostUpdate = createTime('postUpdate', tagName);
1985
- const instance = hostRef.$lazyInstance$ ;
1986
- const ancestorComponent = hostRef.$ancestorComponent$;
1987
- {
1988
- safeCall(instance, 'componentDidRender');
1989
- }
1990
- if (!(hostRef.$flags$ & 64 /* HOST_FLAGS.hasLoadedComponent */)) {
1991
- hostRef.$flags$ |= 64 /* HOST_FLAGS.hasLoadedComponent */;
1992
- {
1993
- // DOM WRITE!
1994
- addHydratedFlag(elm);
1995
- }
1996
- {
1997
- safeCall(instance, 'componentDidLoad');
1998
- }
1999
- endPostUpdate();
2000
- {
2001
- hostRef.$onReadyResolve$(elm);
2002
- if (!ancestorComponent) {
2003
- appDidLoad();
2004
- }
2005
- }
2006
- }
2007
- else {
2008
- {
2009
- safeCall(instance, 'componentDidUpdate');
2010
- }
2011
- endPostUpdate();
2012
- }
2013
- {
2014
- hostRef.$onInstanceResolve$(elm);
2015
- }
2016
- // load events fire from bottom to top
2017
- // the deepest elements load first then bubbles up
2018
- {
2019
- if (hostRef.$onRenderResolve$) {
2020
- hostRef.$onRenderResolve$();
2021
- hostRef.$onRenderResolve$ = undefined;
2022
- }
2023
- if (hostRef.$flags$ & 512 /* HOST_FLAGS.needsRerender */) {
2024
- nextTick(() => scheduleUpdate(hostRef, false));
2025
- }
2026
- hostRef.$flags$ &= ~(4 /* HOST_FLAGS.isWaitingForChildren */ | 512 /* HOST_FLAGS.needsRerender */);
2027
- }
2028
- // ( •_•)
2029
- // ( •_•)>⌐■-■
2030
- // (⌐■_■)
2031
- };
2032
- const appDidLoad = (who) => {
2033
- // on appload
2034
- // we have finish the first big initial render
2035
- {
2036
- addHydratedFlag(doc.documentElement);
2037
- }
2038
- nextTick(() => emitEvent(win, 'appload', { detail: { namespace: NAMESPACE } }));
2039
- };
2040
- /**
2041
- * Allows to safely call a method, e.g. `componentDidLoad`, on an instance,
2042
- * e.g. custom element node. If a build figures out that e.g. no component
2043
- * has a `componentDidLoad` method, the instance method gets removed from the
2044
- * output bundle and this function returns `undefined`.
2045
- * @param instance any object that may or may not contain methods
2046
- * @param method method name
2047
- * @param arg single arbitrary argument
2048
- * @returns result of method call if it exists, otherwise `undefined`
2049
- */
2050
- const safeCall = (instance, method, arg) => {
2051
- if (instance && instance[method]) {
2052
- try {
2053
- return instance[method](arg);
2054
- }
2055
- catch (e) {
2056
- consoleError(e);
2057
- }
2058
- }
2059
- return undefined;
2060
- };
2061
- const addHydratedFlag = (elm) => elm.classList.add('hydrated')
2062
- ;
2063
- const getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
2064
- const setValue = (ref, propName, newVal, cmpMeta) => {
2065
- // check our new property value against our internal value
2066
- const hostRef = getHostRef(ref);
2067
- const elm = hostRef.$hostElement$ ;
2068
- const oldVal = hostRef.$instanceValues$.get(propName);
2069
- const flags = hostRef.$flags$;
2070
- const instance = hostRef.$lazyInstance$ ;
2071
- newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]);
2072
- // explicitly check for NaN on both sides, as `NaN === NaN` is always false
2073
- const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
2074
- const didValueChange = newVal !== oldVal && !areBothNaN;
2075
- if ((!(flags & 8 /* HOST_FLAGS.isConstructingInstance */) || oldVal === undefined) && didValueChange) {
2076
- // gadzooks! the property's value has changed!!
2077
- // set our new value!
2078
- hostRef.$instanceValues$.set(propName, newVal);
2079
- if (instance) {
2080
- // get an array of method names of watch functions to call
2081
- if (cmpMeta.$watchers$ && flags & 128 /* HOST_FLAGS.isWatchReady */) {
2082
- const watchMethods = cmpMeta.$watchers$[propName];
2083
- if (watchMethods) {
2084
- // this instance is watching for when this property changed
2085
- watchMethods.map((watchMethodName) => {
2086
- try {
2087
- // fire off each of the watch methods that are watching this property
2088
- instance[watchMethodName](newVal, oldVal, propName);
2089
- }
2090
- catch (e) {
2091
- consoleError(e, elm);
2092
- }
2093
- });
2094
- }
2095
- }
2096
- if ((flags & (2 /* HOST_FLAGS.hasRendered */ | 16 /* HOST_FLAGS.isQueuedForUpdate */)) === 2 /* HOST_FLAGS.hasRendered */) {
2097
- // looks like this value actually changed, so we've got work to do!
2098
- // but only if we've already rendered, otherwise just chill out
2099
- // queue that we need to do an update, but don't worry about queuing
2100
- // up millions cuz this function ensures it only runs once
2101
- scheduleUpdate(hostRef, false);
2102
- }
2103
- }
2104
- }
2105
- };
2106
- /**
2107
- * Attach a series of runtime constructs to a compiled Stencil component
2108
- * constructor, including getters and setters for the `@Prop` and `@State`
2109
- * decorators, callbacks for when attributes change, and so on.
2110
- *
2111
- * @param Cstr the constructor for a component that we need to process
2112
- * @param cmpMeta metadata collected previously about the component
2113
- * @param flags a number used to store a series of bit flags
2114
- * @returns a reference to the same constructor passed in (but now mutated)
2115
- */
2116
- const proxyComponent = (Cstr, cmpMeta, flags) => {
2117
- var _a;
2118
- const prototype = Cstr.prototype;
2119
- if (cmpMeta.$members$) {
2120
- if (Cstr.watchers) {
2121
- cmpMeta.$watchers$ = Cstr.watchers;
2122
- }
2123
- // It's better to have a const than two Object.entries()
2124
- const members = Object.entries(cmpMeta.$members$);
2125
- members.map(([memberName, [memberFlags]]) => {
2126
- if ((memberFlags & 31 /* MEMBER_FLAGS.Prop */ ||
2127
- ((flags & 2 /* PROXY_FLAGS.proxyState */) && memberFlags & 32 /* MEMBER_FLAGS.State */))) {
2128
- // proxyComponent - prop
2129
- Object.defineProperty(prototype, memberName, {
2130
- get() {
2131
- // proxyComponent, get value
2132
- return getValue(this, memberName);
2133
- },
2134
- set(newValue) {
2135
- // proxyComponent, set value
2136
- setValue(this, memberName, newValue, cmpMeta);
2137
- },
2138
- configurable: true,
2139
- enumerable: true,
2140
- });
2141
- }
2142
- else if (flags & 1 /* PROXY_FLAGS.isElementConstructor */ &&
2143
- memberFlags & 64 /* MEMBER_FLAGS.Method */) {
2144
- // proxyComponent - method
2145
- Object.defineProperty(prototype, memberName, {
2146
- value(...args) {
2147
- var _a;
2148
- const ref = getHostRef(this);
2149
- return (_a = ref === null || ref === void 0 ? void 0 : ref.$onInstancePromise$) === null || _a === void 0 ? void 0 : _a.then(() => { var _a; return (_a = ref.$lazyInstance$) === null || _a === void 0 ? void 0 : _a[memberName](...args); });
2150
- },
2151
- });
2152
- }
2153
- });
2154
- if ((flags & 1 /* PROXY_FLAGS.isElementConstructor */)) {
2155
- const attrNameToPropName = new Map();
2156
- prototype.attributeChangedCallback = function (attrName, oldValue, newValue) {
2157
- plt.jmp(() => {
2158
- var _a;
2159
- const propName = attrNameToPropName.get(attrName);
2160
- // In a web component lifecycle the attributeChangedCallback runs prior to connectedCallback
2161
- // in the case where an attribute was set inline.
2162
- // ```html
2163
- // <my-component some-attribute="some-value"></my-component>
2164
- // ```
2165
- //
2166
- // There is an edge case where a developer sets the attribute inline on a custom element and then
2167
- // programmatically changes it before it has been upgraded as shown below:
2168
- //
2169
- // ```html
2170
- // <!-- this component has _not_ been upgraded yet -->
2171
- // <my-component id="test" some-attribute="some-value"></my-component>
2172
- // <script>
2173
- // // grab non-upgraded component
2174
- // el = document.querySelector("#test");
2175
- // el.someAttribute = "another-value";
2176
- // // upgrade component
2177
- // customElements.define('my-component', MyComponent);
2178
- // </script>
2179
- // ```
2180
- // In this case if we do not un-shadow here and use the value of the shadowing property, attributeChangedCallback
2181
- // will be called with `newValue = "some-value"` and will set the shadowed property (this.someAttribute = "another-value")
2182
- // to the value that was set inline i.e. "some-value" from above example. When
2183
- // the connectedCallback attempts to un-shadow it will use "some-value" as the initial value rather than "another-value"
2184
- //
2185
- // The case where the attribute was NOT set inline but was not set programmatically shall be handled/un-shadowed
2186
- // by connectedCallback as this attributeChangedCallback will not fire.
2187
- //
2188
- // https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
2189
- //
2190
- // TODO(STENCIL-16) we should think about whether or not we actually want to be reflecting the attributes to
2191
- // properties here given that this goes against best practices outlined here
2192
- // https://developers.google.com/web/fundamentals/web-components/best-practices#avoid-reentrancy
2193
- if (this.hasOwnProperty(propName)) {
2194
- newValue = this[propName];
2195
- delete this[propName];
2196
- }
2197
- else if (prototype.hasOwnProperty(propName) &&
2198
- typeof this[propName] === 'number' &&
2199
- this[propName] == newValue) {
2200
- // if the propName exists on the prototype of `Cstr`, this update may be a result of Stencil using native
2201
- // APIs to reflect props as attributes. Calls to `setAttribute(someElement, propName)` will result in
2202
- // `propName` to be converted to a `DOMString`, which may not be what we want for other primitive props.
2203
- return;
2204
- }
2205
- else if (propName == null) {
2206
- // At this point we should know this is not a "member", so we can treat it like watching an attribute
2207
- // on a vanilla web component
2208
- const hostRef = getHostRef(this);
2209
- const flags = hostRef === null || hostRef === void 0 ? void 0 : hostRef.$flags$;
2210
- // We only want to trigger the callback(s) if:
2211
- // 1. The instance is ready
2212
- // 2. The watchers are ready
2213
- // 3. The value has changed
2214
- if (flags &&
2215
- !(flags & 8 /* HOST_FLAGS.isConstructingInstance */) &&
2216
- flags & 128 /* HOST_FLAGS.isWatchReady */ &&
2217
- newValue !== oldValue) {
2218
- const instance = hostRef.$lazyInstance$ ;
2219
- const entry = (_a = cmpMeta.$watchers$) === null || _a === void 0 ? void 0 : _a[attrName];
2220
- entry === null || entry === void 0 ? void 0 : entry.forEach((callbackName) => {
2221
- if (instance[callbackName] != null) {
2222
- instance[callbackName].call(instance, newValue, oldValue, attrName);
2223
- }
2224
- });
2225
- }
2226
- return;
2227
- }
2228
- this[propName] = newValue === null && typeof this[propName] === 'boolean' ? false : newValue;
2229
- });
2230
- };
2231
- // Create an array of attributes to observe
2232
- // This list in comprised of all strings used within a `@Watch()` decorator
2233
- // on a component as well as any Stencil-specific "members" (`@Prop()`s and `@State()`s).
2234
- // As such, there is no way to guarantee type-safety here that a user hasn't entered
2235
- // an invalid attribute.
2236
- Cstr.observedAttributes = Array.from(new Set([
2237
- ...Object.keys((_a = cmpMeta.$watchers$) !== null && _a !== void 0 ? _a : {}),
2238
- ...members
2239
- .filter(([_, m]) => m[0] & 15 /* MEMBER_FLAGS.HasAttribute */)
2240
- .map(([propName, m]) => {
2241
- var _a;
2242
- const attrName = m[1] || propName;
2243
- attrNameToPropName.set(attrName, propName);
2244
- if (m[0] & 512 /* MEMBER_FLAGS.ReflectAttr */) {
2245
- (_a = cmpMeta.$attrsToReflect$) === null || _a === void 0 ? void 0 : _a.push([propName, attrName]);
2246
- }
2247
- return attrName;
2248
- }),
2249
- ]));
2250
- }
2251
- }
2252
- return Cstr;
2253
- };
2254
- /**
2255
- * Initialize a Stencil component given a reference to its host element, its
2256
- * runtime bookkeeping data structure, runtime metadata about the component,
2257
- * and (optionally) an HMR version ID.
2258
- *
2259
- * @param elm a host element
2260
- * @param hostRef the element's runtime bookkeeping object
2261
- * @param cmpMeta runtime metadata for the Stencil component
2262
- * @param hmrVersionId an (optional) HMR version ID
2263
- */
2264
- const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
2265
- let Cstr;
2266
- // initializeComponent
2267
- if ((hostRef.$flags$ & 32 /* HOST_FLAGS.hasInitializedComponent */) === 0) {
2268
- // Let the runtime know that the component has been initialized
2269
- hostRef.$flags$ |= 32 /* HOST_FLAGS.hasInitializedComponent */;
2270
- {
2271
- // lazy loaded components
2272
- // request the component's implementation to be
2273
- // wired up with the host element
2274
- Cstr = loadModule(cmpMeta);
2275
- if (Cstr.then) {
2276
- // Await creates a micro-task avoid if possible
2277
- const endLoad = uniqueTime();
2278
- Cstr = await Cstr;
2279
- endLoad();
2280
- }
2281
- if (!Cstr.isProxied) {
2282
- // we've never proxied this Constructor before
2283
- // let's add the getters/setters to its prototype before
2284
- // the first time we create an instance of the implementation
2285
- {
2286
- cmpMeta.$watchers$ = Cstr.watchers;
2287
- }
2288
- proxyComponent(Cstr, cmpMeta, 2 /* PROXY_FLAGS.proxyState */);
2289
- Cstr.isProxied = true;
2290
- }
2291
- const endNewInstance = createTime('createInstance', cmpMeta.$tagName$);
2292
- // ok, time to construct the instance
2293
- // but let's keep track of when we start and stop
2294
- // so that the getters/setters don't incorrectly step on data
2295
- {
2296
- hostRef.$flags$ |= 8 /* HOST_FLAGS.isConstructingInstance */;
2297
- }
2298
- // construct the lazy-loaded component implementation
2299
- // passing the hostRef is very important during
2300
- // construction in order to directly wire together the
2301
- // host element and the lazy-loaded instance
2302
- try {
2303
- new Cstr(hostRef);
2304
- }
2305
- catch (e) {
2306
- consoleError(e);
2307
- }
2308
- {
2309
- hostRef.$flags$ &= ~8 /* HOST_FLAGS.isConstructingInstance */;
2310
- }
2311
- {
2312
- hostRef.$flags$ |= 128 /* HOST_FLAGS.isWatchReady */;
2313
- }
2314
- endNewInstance();
2315
- fireConnectedCallback(hostRef.$lazyInstance$);
2316
- }
2317
- if (Cstr.style) {
2318
- // this component has styles but we haven't registered them yet
2319
- let style = Cstr.style;
2320
- const scopeId = getScopeId(cmpMeta);
2321
- if (!styles.has(scopeId)) {
2322
- const endRegisterStyles = createTime('registerStyles', cmpMeta.$tagName$);
2323
- registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */));
2324
- endRegisterStyles();
2325
- }
2326
- }
2327
- }
2328
- // we've successfully created a lazy instance
2329
- const ancestorComponent = hostRef.$ancestorComponent$;
2330
- const schedule = () => scheduleUpdate(hostRef, true);
2331
- if (ancestorComponent && ancestorComponent['s-rc']) {
2332
- // this is the initial load and this component it has an ancestor component
2333
- // but the ancestor component has NOT fired its will update lifecycle yet
2334
- // so let's just cool our jets and wait for the ancestor to continue first
2335
- // this will get fired off when the ancestor component
2336
- // finally gets around to rendering its lazy self
2337
- // fire off the initial update
2338
- ancestorComponent['s-rc'].push(schedule);
2339
- }
2340
- else {
2341
- schedule();
2342
- }
2343
- };
2344
- const fireConnectedCallback = (instance) => {
2345
- {
2346
- safeCall(instance, 'connectedCallback');
2347
- }
2348
- };
2349
- const connectedCallback = (elm) => {
2350
- if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
2351
- const hostRef = getHostRef(elm);
2352
- const cmpMeta = hostRef.$cmpMeta$;
2353
- const endConnected = createTime('connectedCallback', cmpMeta.$tagName$);
2354
- if (!(hostRef.$flags$ & 1 /* HOST_FLAGS.hasConnected */)) {
2355
- // first time this component has connected
2356
- hostRef.$flags$ |= 1 /* HOST_FLAGS.hasConnected */;
2357
- let hostId;
2358
- {
2359
- hostId = elm.getAttribute(HYDRATE_ID);
2360
- if (hostId) {
2361
- if (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
2362
- const scopeId = addStyle(elm.shadowRoot, cmpMeta);
2363
- elm.classList.remove(scopeId + '-h', scopeId + '-s');
2364
- }
2365
- initializeClientHydrate(elm, cmpMeta.$tagName$, hostId, hostRef);
2366
- }
2367
- }
2368
- if (!hostId) {
2369
- // initUpdate
2370
- // if the slot polyfill is required we'll need to put some nodes
2371
- // in here to act as original content anchors as we move nodes around
2372
- // host element has been connected to the DOM
2373
- if ((// TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
2374
- cmpMeta.$flags$ & (4 /* CMP_FLAGS.hasSlotRelocation */ | 8 /* CMP_FLAGS.needsShadowDomShim */))) {
2375
- setContentReference(elm);
2376
- }
2377
- }
2378
- {
2379
- // find the first ancestor component (if there is one) and register
2380
- // this component as one of the actively loading child components for its ancestor
2381
- let ancestorComponent = elm;
2382
- while ((ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host)) {
2383
- // climb up the ancestors looking for the first
2384
- // component that hasn't finished its lifecycle update yet
2385
- if ((ancestorComponent.nodeType === 1 /* NODE_TYPE.ElementNode */ &&
2386
- ancestorComponent.hasAttribute('s-id') &&
2387
- ancestorComponent['s-p']) ||
2388
- ancestorComponent['s-p']) {
2389
- // we found this components first ancestor component
2390
- // keep a reference to this component's ancestor component
2391
- attachToAncestor(hostRef, (hostRef.$ancestorComponent$ = ancestorComponent));
2392
- break;
2393
- }
2394
- }
2395
- }
2396
- // Lazy properties
2397
- // https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
2398
- if (cmpMeta.$members$) {
2399
- Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
2400
- if (memberFlags & 31 /* MEMBER_FLAGS.Prop */ && elm.hasOwnProperty(memberName)) {
2401
- const value = elm[memberName];
2402
- delete elm[memberName];
2403
- elm[memberName] = value;
2404
- }
2405
- });
2406
- }
2407
- {
2408
- // connectedCallback, taskQueue, initialLoad
2409
- // angular sets attribute AFTER connectCallback
2410
- // https://github.com/angular/angular/issues/18909
2411
- // https://github.com/angular/angular/issues/19940
2412
- nextTick(() => initializeComponent(elm, hostRef, cmpMeta));
2413
- }
2414
- }
2415
- else {
2416
- // not the first time this has connected
2417
- // reattach any event listeners to the host
2418
- // since they would have been removed when disconnected
2419
- addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
2420
- // fire off connectedCallback() on component instance
2421
- if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$lazyInstance$) {
2422
- fireConnectedCallback(hostRef.$lazyInstance$);
2423
- }
2424
- else if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$onReadyPromise$) {
2425
- hostRef.$onReadyPromise$.then(() => fireConnectedCallback(hostRef.$lazyInstance$));
2426
- }
2427
- }
2428
- endConnected();
2429
- }
2430
- };
2431
- const setContentReference = (elm) => {
2432
- // only required when we're NOT using native shadow dom (slot)
2433
- // or this browser doesn't support native shadow dom
2434
- // and this host element was NOT created with SSR
2435
- // let's pick out the inner content for slot projection
2436
- // create a node to represent where the original
2437
- // content was first placed, which is useful later on
2438
- const contentRefElm = (elm['s-cr'] = doc.createComment(''));
2439
- contentRefElm['s-cn'] = true;
2440
- elm.insertBefore(contentRefElm, elm.firstChild);
2441
- };
2442
- const disconnectInstance = (instance) => {
2443
- {
2444
- safeCall(instance, 'disconnectedCallback');
2445
- }
2446
- };
2447
- const disconnectedCallback = async (elm) => {
2448
- if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
2449
- const hostRef = getHostRef(elm);
2450
- {
2451
- if (hostRef.$rmListeners$) {
2452
- hostRef.$rmListeners$.map((rmListener) => rmListener());
2453
- hostRef.$rmListeners$ = undefined;
2454
- }
2455
- }
2456
- if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$lazyInstance$) {
2457
- disconnectInstance(hostRef.$lazyInstance$);
2458
- }
2459
- else if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$onReadyPromise$) {
2460
- hostRef.$onReadyPromise$.then(() => disconnectInstance(hostRef.$lazyInstance$));
2461
- }
2462
- }
2463
- };
2464
- const patchChildSlotNodes = (elm, cmpMeta) => {
2465
- class FakeNodeList extends Array {
2466
- item(n) {
2467
- return this[n];
2468
- }
2469
- }
2470
- // TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
2471
- if (cmpMeta.$flags$ & 8 /* CMP_FLAGS.needsShadowDomShim */) {
2472
- const childNodesFn = elm.__lookupGetter__('childNodes');
2473
- Object.defineProperty(elm, 'children', {
2474
- get() {
2475
- return this.childNodes.map((n) => n.nodeType === 1);
2476
- },
2477
- });
2478
- Object.defineProperty(elm, 'childElementCount', {
2479
- get() {
2480
- return elm.children.length;
2481
- },
2482
- });
2483
- Object.defineProperty(elm, 'childNodes', {
2484
- get() {
2485
- const childNodes = childNodesFn.call(this);
2486
- if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0 &&
2487
- getHostRef(this).$flags$ & 2 /* HOST_FLAGS.hasRendered */) {
2488
- const result = new FakeNodeList();
2489
- for (let i = 0; i < childNodes.length; i++) {
2490
- const slot = childNodes[i]['s-nr'];
2491
- if (slot) {
2492
- result.push(slot);
2493
- }
2494
- }
2495
- return result;
2496
- }
2497
- return FakeNodeList.from(childNodes);
2498
- },
2499
- });
2500
- }
2501
- };
2502
- const bootstrapLazy = (lazyBundles, options = {}) => {
2503
- var _a;
2504
- const endBootstrap = createTime();
2505
- const exclude = options.exclude || [];
2506
- const customElements = win.customElements;
2507
- const head = doc.head;
2508
- const metaCharset = /*@__PURE__*/ head.querySelector('meta[charset]');
2509
- const dataStyles = /*@__PURE__*/ doc.createElement('style');
2510
- const deferredConnectedCallbacks = [];
2511
- const styles = /*@__PURE__*/ doc.querySelectorAll(`[${HYDRATED_STYLE_ID}]`);
2512
- let appLoadFallback;
2513
- let isBootstrapping = true;
2514
- let i = 0;
2515
- Object.assign(plt, options);
2516
- plt.$resourcesUrl$ = new URL(options.resourcesUrl || './', doc.baseURI).href;
2517
- {
2518
- // If the app is already hydrated there is not point to disable the
2519
- // async queue. This will improve the first input delay
2520
- plt.$flags$ |= 2 /* PLATFORM_FLAGS.appLoaded */;
2521
- }
2522
- {
2523
- for (; i < styles.length; i++) {
2524
- registerStyle(styles[i].getAttribute(HYDRATED_STYLE_ID), convertScopedToShadow(styles[i].innerHTML), true);
2525
- }
2526
- }
2527
- let hasSlotRelocation = false;
2528
- lazyBundles.map((lazyBundle) => {
2529
- lazyBundle[1].map((compactMeta) => {
2530
- var _a;
2531
- const cmpMeta = {
2532
- $flags$: compactMeta[0],
2533
- $tagName$: compactMeta[1],
2534
- $members$: compactMeta[2],
2535
- $listeners$: compactMeta[3],
2536
- };
2537
- // Check if we are using slots outside the shadow DOM in this component.
2538
- // We'll use this information later to add styles for `slot-fb` elements
2539
- if (cmpMeta.$flags$ & 4 /* CMP_FLAGS.hasSlotRelocation */) {
2540
- hasSlotRelocation = true;
2541
- }
2542
- {
2543
- cmpMeta.$members$ = compactMeta[2];
2544
- }
2545
- {
2546
- cmpMeta.$listeners$ = compactMeta[3];
2547
- }
2548
- {
2549
- cmpMeta.$attrsToReflect$ = [];
2550
- }
2551
- {
2552
- cmpMeta.$watchers$ = (_a = compactMeta[4]) !== null && _a !== void 0 ? _a : {};
2553
- }
2554
- const tagName = cmpMeta.$tagName$;
2555
- const HostElement = class extends HTMLElement {
2556
- // StencilLazyHost
2557
- constructor(self) {
2558
- // @ts-ignore
2559
- super(self);
2560
- self = this;
2561
- registerHost(self, cmpMeta);
2562
- if (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
2563
- // this component is using shadow dom
2564
- // and this browser supports shadow dom
2565
- // add the read-only property "shadowRoot" to the host element
2566
- // adding the shadow root build conditionals to minimize runtime
2567
- {
2568
- {
2569
- self.attachShadow({
2570
- mode: 'open',
2571
- delegatesFocus: !!(cmpMeta.$flags$ & 16 /* CMP_FLAGS.shadowDelegatesFocus */),
2572
- });
2573
- }
2574
- }
2575
- }
2576
- }
2577
- connectedCallback() {
2578
- if (appLoadFallback) {
2579
- clearTimeout(appLoadFallback);
2580
- appLoadFallback = null;
2581
- }
2582
- if (isBootstrapping) {
2583
- // connectedCallback will be processed once all components have been registered
2584
- deferredConnectedCallbacks.push(this);
2585
- }
2586
- else {
2587
- plt.jmp(() => connectedCallback(this));
2588
- }
2589
- }
2590
- disconnectedCallback() {
2591
- plt.jmp(() => disconnectedCallback(this));
2592
- }
2593
- componentOnReady() {
2594
- return getHostRef(this).$onReadyPromise$;
2595
- }
2596
- };
2597
- // TODO(STENCIL-914): this check and `else` block can go away and be replaced by just the `scoped` check
2598
- {
2599
- {
2600
- patchChildSlotNodes(HostElement.prototype, cmpMeta);
2601
- }
2602
- }
2603
- cmpMeta.$lazyBundleId$ = lazyBundle[0];
2604
- if (!exclude.includes(tagName) && !customElements.get(tagName)) {
2605
- customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* PROXY_FLAGS.isElementConstructor */));
2606
- }
2607
- });
2608
- });
2609
- // Add styles for `slot-fb` elements if any of our components are using slots outside the Shadow DOM
2610
- if (hasSlotRelocation) {
2611
- dataStyles.innerHTML += SLOT_FB_CSS;
2612
- }
2613
- // If we have styles, add them to the DOM
2614
- if (dataStyles.innerHTML.length) {
2615
- dataStyles.setAttribute('data-styles', '');
2616
- // Apply CSP nonce to the style tag if it exists
2617
- const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
2618
- if (nonce != null) {
2619
- dataStyles.setAttribute('nonce', nonce);
2620
- }
2621
- // Insert the styles into the document head
2622
- // NOTE: this _needs_ to happen last so we can ensure the nonce (and other attributes) are applied
2623
- head.insertBefore(dataStyles, metaCharset ? metaCharset.nextSibling : head.firstChild);
2624
- }
2625
- // Process deferred connectedCallbacks now all components have been registered
2626
- isBootstrapping = false;
2627
- if (deferredConnectedCallbacks.length) {
2628
- deferredConnectedCallbacks.map((host) => host.connectedCallback());
2629
- }
2630
- else {
2631
- {
2632
- plt.jmp(() => (appLoadFallback = setTimeout(appDidLoad, 30)));
2633
- }
2634
- }
2635
- // Fallback appLoad event
2636
- endBootstrap();
2637
- };
2638
- const Fragment = (_, children) => children;
2639
- const addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
2640
- if (listeners) {
2641
- listeners.map(([flags, name, method]) => {
2642
- const target = getHostListenerTarget(elm, flags) ;
2643
- const handler = hostListenerProxy(hostRef, method);
2644
- const opts = hostListenerOpts(flags);
2645
- plt.ael(target, name, handler, opts);
2646
- (hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
2647
- });
2648
- }
2649
- };
2650
- const hostListenerProxy = (hostRef, methodName) => (ev) => {
2651
- try {
2652
- {
2653
- if (hostRef.$flags$ & 256 /* HOST_FLAGS.isListenReady */) {
2654
- // instance is ready, let's call it's member method for this event
2655
- hostRef.$lazyInstance$[methodName](ev);
2656
- }
2657
- else {
2658
- (hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
2659
- }
2660
- }
2661
- }
2662
- catch (e) {
2663
- consoleError(e);
2664
- }
2665
- };
2666
- const getHostListenerTarget = (elm, flags) => {
2667
- if (flags & 4 /* LISTENER_FLAGS.TargetDocument */)
2668
- return doc;
2669
- if (flags & 8 /* LISTENER_FLAGS.TargetWindow */)
2670
- return win;
2671
- if (flags & 16 /* LISTENER_FLAGS.TargetBody */)
2672
- return doc.body;
2673
- return elm;
2674
- };
2675
- // prettier-ignore
2676
- const hostListenerOpts = (flags) => (flags & 2 /* LISTENER_FLAGS.Capture */) !== 0;
2677
- /**
2678
- * Assigns the given value to the nonce property on the runtime platform object.
2679
- * During runtime, this value is used to set the nonce attribute on all dynamically created script and style tags.
2680
- * @param nonce The value to be assigned to the platform nonce property.
2681
- * @returns void
2682
- */
2683
- const setNonce = (nonce) => (plt.$nonce$ = nonce);
2684
- /**
2685
- * A WeakMap mapping runtime component references to their corresponding host reference
2686
- * instances.
2687
- */
2688
- const hostRefs = /*@__PURE__*/ new WeakMap();
2689
- /**
2690
- * Given a {@link d.RuntimeRef} retrieve the corresponding {@link d.HostRef}
2691
- *
2692
- * @param ref the runtime ref of interest
2693
- * @returns the Host reference (if found) or undefined
2694
- */
2695
- const getHostRef = (ref) => hostRefs.get(ref);
2696
- /**
2697
- * Register a lazy instance with the {@link hostRefs} object so it's
2698
- * corresponding {@link d.HostRef} can be retrieved later.
2699
- *
2700
- * @param lazyInstance the lazy instance of interest
2701
- * @param hostRef that instances `HostRef` object
2702
- * @returns a reference to the host ref WeakMap
2703
- */
2704
- const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
2705
- /**
2706
- * Register a host element for a Stencil component, setting up various metadata
2707
- * and callbacks based on {@link BUILD} flags as well as the component's runtime
2708
- * metadata.
2709
- *
2710
- * @param hostElement the host element to register
2711
- * @param cmpMeta runtime metadata for that component
2712
- * @returns a reference to the host ref WeakMap
2713
- */
2714
- const registerHost = (hostElement, cmpMeta) => {
2715
- const hostRef = {
2716
- $flags$: 0,
2717
- $hostElement$: hostElement,
2718
- $cmpMeta$: cmpMeta,
2719
- $instanceValues$: new Map(),
2720
- };
2721
- {
2722
- hostRef.$onInstancePromise$ = new Promise((r) => (hostRef.$onInstanceResolve$ = r));
2723
- }
2724
- {
2725
- hostRef.$onReadyPromise$ = new Promise((r) => (hostRef.$onReadyResolve$ = r));
2726
- hostElement['s-p'] = [];
2727
- hostElement['s-rc'] = [];
2728
- }
2729
- addHostEventListeners(hostElement, hostRef, cmpMeta.$listeners$);
2730
- return hostRefs.set(hostElement, hostRef);
2731
- };
2732
- const isMemberInElement = (elm, memberName) => memberName in elm;
2733
- const consoleError = (e, el) => (0, console.error)(e, el);
2734
- const cmpModules = /*@__PURE__*/ new Map();
2735
- const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
2736
- // loadModuleImport
2737
- const exportName = cmpMeta.$tagName$.replace(/-/g, '_');
2738
- const bundleId = cmpMeta.$lazyBundleId$;
2739
- const module = cmpModules.get(bundleId) ;
2740
- if (module) {
2741
- return module[exportName];
2742
- }
2743
- /*!__STENCIL_STATIC_IMPORT_SWITCH__*/
2744
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2745
- /* @vite-ignore */
2746
- /* webpackInclude: /\.entry\.js$/ */
2747
- /* webpackExclude: /\.system\.entry\.js$/ */
2748
- /* webpackMode: "lazy" */
2749
- `./${bundleId}.entry.js${''}`)); }).then((importedModule) => {
2750
- {
2751
- cmpModules.set(bundleId, importedModule);
2752
- }
2753
- return importedModule[exportName];
2754
- }, consoleError);
2755
- };
2756
- const styles = /*@__PURE__*/ new Map();
2757
- const win = typeof window !== 'undefined' ? window : {};
2758
- const doc = win.document || { head: {} };
2759
- const plt = {
2760
- $flags$: 0,
2761
- $resourcesUrl$: '',
2762
- jmp: (h) => h(),
2763
- raf: (h) => requestAnimationFrame(h),
2764
- ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
2765
- rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
2766
- ce: (eventName, opts) => new CustomEvent(eventName, opts),
2767
- };
2768
- const supportsShadow =
2769
- // TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
2770
- true;
2771
- const promiseResolve = (v) => Promise.resolve(v);
2772
- const supportsConstructableStylesheets = /*@__PURE__*/ (() => {
2773
- try {
2774
- new CSSStyleSheet();
2775
- return typeof new CSSStyleSheet().replaceSync === 'function';
2776
- }
2777
- catch (e) { }
2778
- return false;
2779
- })()
2780
- ;
2781
- const queueDomReads = [];
2782
- const queueDomWrites = [];
2783
- const queueTask = (queue, write) => (cb) => {
2784
- queue.push(cb);
2785
- if (!queuePending) {
2786
- queuePending = true;
2787
- if (write && plt.$flags$ & 4 /* PLATFORM_FLAGS.queueSync */) {
2788
- nextTick(flush);
2789
- }
2790
- else {
2791
- plt.raf(flush);
2792
- }
2793
- }
2794
- };
2795
- const consume = (queue) => {
2796
- for (let i = 0; i < queue.length; i++) {
2797
- try {
2798
- queue[i](performance.now());
2799
- }
2800
- catch (e) {
2801
- consoleError(e);
2802
- }
2803
- }
2804
- queue.length = 0;
2805
- };
2806
- const flush = () => {
2807
- // always force a bunch of medium callbacks to run, but still have
2808
- // a throttle on how many can run in a certain time
2809
- // DOM READS!!!
2810
- consume(queueDomReads);
2811
- // DOM WRITES!!!
2812
- {
2813
- consume(queueDomWrites);
2814
- if ((queuePending = queueDomReads.length > 0)) {
2815
- // still more to do yet, but we've run out of time
2816
- // let's let this thing cool off and try again in the next tick
2817
- plt.raf(flush);
2818
- }
2819
- }
2820
- };
2821
- const nextTick = (cb) => promiseResolve().then(cb);
2822
- const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
2823
-
2824
- exports.Build = Build;
2825
- exports.Env = Env;
2826
- exports.Fragment = Fragment;
2827
- exports.Host = Host;
2828
- exports.NAMESPACE = NAMESPACE;
2829
- exports.bootstrapLazy = bootstrapLazy;
2830
- exports.createEvent = createEvent;
2831
- exports.doc = doc;
2832
- exports.getElement = getElement;
2833
- exports.h = h;
2834
- exports.promiseResolve = promiseResolve;
2835
- exports.registerInstance = registerInstance;
2836
- exports.setNonce = setNonce;