@otto-de/b2b-core-components 1.7.0 → 1.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1066) hide show
  1. package/README.md +8 -8
  2. package/dist/b2b-core-components/app-globals-0f993ce5.js +3 -0
  3. package/dist/b2b-core-components/b2b-alert.entry.js +48 -0
  4. package/dist/b2b-core-components/b2b-anchor.entry.js +22 -0
  5. package/dist/b2b-core-components/b2b-breadcrumb-item.entry.js +36 -0
  6. package/dist/b2b-core-components/b2b-breadcrumb.entry.js +30 -0
  7. package/dist/b2b-core-components/b2b-button.entry.js +79 -0
  8. package/dist/b2b-core-components/b2b-card.entry.js +43 -0
  9. package/dist/b2b-core-components/b2b-checkbox-group.entry.js +88 -0
  10. package/dist/b2b-core-components/b2b-checkbox.entry.js +89 -0
  11. package/dist/b2b-core-components/b2b-chip-component.entry.js +36 -0
  12. package/dist/b2b-core-components/b2b-core-components.css +215 -1
  13. package/dist/b2b-core-components/b2b-core-components.esm.js +51 -1
  14. package/dist/b2b-core-components/b2b-dropdown.entry.js +64 -0
  15. package/dist/b2b-core-components/b2b-grid-col.entry.js +34 -0
  16. package/dist/b2b-core-components/b2b-grid-row.entry.js +25 -0
  17. package/dist/b2b-core-components/b2b-grid.entry.js +17 -0
  18. package/dist/b2b-core-components/b2b-headline.entry.js +31 -0
  19. package/dist/b2b-core-components/b2b-icon.entry.js +415 -0
  20. package/dist/b2b-core-components/b2b-input-group.entry.js +76 -0
  21. package/dist/b2b-core-components/b2b-input-label.entry.js +22 -0
  22. package/dist/b2b-core-components/b2b-input-list-option.entry.js +25 -0
  23. package/dist/b2b-core-components/b2b-input-list.entry.js +165 -0
  24. package/dist/b2b-core-components/b2b-input.entry.js +96 -0
  25. package/dist/b2b-core-components/b2b-label.entry.js +19 -0
  26. package/dist/b2b-core-components/b2b-modal.entry.js +220 -0
  27. package/dist/b2b-core-components/b2b-pagination.entry.js +118 -0
  28. package/dist/b2b-core-components/b2b-paragraph.entry.js +23 -0
  29. package/dist/b2b-core-components/b2b-radio-button.entry.js +74 -0
  30. package/dist/b2b-core-components/b2b-radio-group.entry.js +89 -0
  31. package/dist/b2b-core-components/b2b-required-separator.entry.js +16 -0
  32. package/dist/b2b-core-components/b2b-rounded-icon.entry.js +27 -0
  33. package/dist/b2b-core-components/b2b-scrollable-container.entry.js +16 -0
  34. package/dist/b2b-core-components/b2b-search.entry.js +33 -0
  35. package/dist/b2b-core-components/b2b-separator.entry.js +18 -0
  36. package/dist/b2b-core-components/b2b-spinner.entry.js +21 -0
  37. package/dist/b2b-core-components/b2b-tab-group.entry.js +132 -0
  38. package/dist/b2b-core-components/b2b-tab-panel.entry.js +17 -0
  39. package/dist/b2b-core-components/b2b-tab.entry.js +39 -0
  40. package/dist/b2b-core-components/b2b-table-cell.entry.js +48 -0
  41. package/dist/b2b-core-components/b2b-table-header.entry.js +88 -0
  42. package/dist/b2b-core-components/b2b-table-row.entry.js +112 -0
  43. package/dist/b2b-core-components/b2b-table-rowgroup.entry.js +144 -0
  44. package/dist/b2b-core-components/b2b-table.entry.js +55 -0
  45. package/dist/b2b-core-components/b2b-textarea.entry.js +62 -0
  46. package/dist/b2b-core-components/b2b-toggle-button.entry.js +55 -0
  47. package/dist/b2b-core-components/b2b-toggle-group.entry.js +65 -0
  48. package/dist/b2b-core-components/b2b-tooltip.entry.js +75 -0
  49. package/dist/b2b-core-components/b2b-wizard-icon.entry.js +21 -0
  50. package/dist/b2b-core-components/b2b-wizard-step.entry.js +22 -0
  51. package/dist/b2b-core-components/b2b-wizard.entry.js +57 -0
  52. package/dist/b2b-core-components/icons/b2b_icon-360-degree.svg +6 -6
  53. package/dist/b2b-core-components/icons/b2b_icon-advice.svg +7 -7
  54. package/dist/b2b-core-components/icons/b2b_icon-allergen-sulfur-dioxide-sulfite.svg +3 -3
  55. package/dist/b2b-core-components/icons/b2b_icon-almond.svg +3 -3
  56. package/dist/b2b-core-components/icons/b2b_icon-archive.svg +3 -3
  57. package/dist/b2b-core-components/icons/b2b_icon-armchair.svg +3 -3
  58. package/dist/b2b-core-components/icons/b2b_icon-arrow-down.svg +3 -3
  59. package/dist/b2b-core-components/icons/b2b_icon-arrow-graph.svg +3 -3
  60. package/dist/b2b-core-components/icons/b2b_icon-arrow-left.svg +3 -3
  61. package/dist/b2b-core-components/icons/b2b_icon-arrow-right.svg +3 -3
  62. package/dist/b2b-core-components/icons/b2b_icon-arrow-up.svg +3 -3
  63. package/dist/b2b-core-components/icons/b2b_icon-assembly.svg +4 -4
  64. package/dist/b2b-core-components/icons/b2b_icon-assortment.svg +3 -3
  65. package/dist/b2b-core-components/icons/b2b_icon-attachment.svg +3 -3
  66. package/dist/b2b-core-components/icons/b2b_icon-augmented-reality.svg +9 -9
  67. package/dist/b2b-core-components/icons/b2b_icon-autonomous-team.svg +4 -4
  68. package/dist/b2b-core-components/icons/b2b_icon-bank-details.svg +3 -3
  69. package/dist/b2b-core-components/icons/b2b_icon-bar-graph-ascending.svg +5 -5
  70. package/dist/b2b-core-components/icons/b2b_icon-bar-graph-axis.svg +6 -6
  71. package/dist/b2b-core-components/icons/b2b_icon-barley.svg +3 -3
  72. package/dist/b2b-core-components/icons/b2b_icon-basket-sale.svg +3 -3
  73. package/dist/b2b-core-components/icons/b2b_icon-basket.svg +4 -4
  74. package/dist/b2b-core-components/icons/b2b_icon-basketball.svg +3 -3
  75. package/dist/b2b-core-components/icons/b2b_icon-bikini.svg +4 -4
  76. package/dist/b2b-core-components/icons/b2b_icon-blogs.svg +6 -6
  77. package/dist/b2b-core-components/icons/b2b_icon-brandshop.svg +8 -8
  78. package/dist/b2b-core-components/icons/b2b_icon-brazil-nut.svg +3 -3
  79. package/dist/b2b-core-components/icons/b2b_icon-browser-click.svg +7 -7
  80. package/dist/b2b-core-components/icons/b2b_icon-browser-content.svg +9 -9
  81. package/dist/b2b-core-components/icons/b2b_icon-browser-psm.svg +3 -3
  82. package/dist/b2b-core-components/icons/b2b_icon-burger.svg +5 -5
  83. package/dist/b2b-core-components/icons/b2b_icon-bus.svg +5 -5
  84. package/dist/b2b-core-components/icons/b2b_icon-callback.svg +6 -6
  85. package/dist/b2b-core-components/icons/b2b_icon-camera.svg +4 -4
  86. package/dist/b2b-core-components/icons/b2b_icon-cashback.svg +5 -5
  87. package/dist/b2b-core-components/icons/b2b_icon-cashew-nut.svg +3 -3
  88. package/dist/b2b-core-components/icons/b2b_icon-catalogue.svg +4 -4
  89. package/dist/b2b-core-components/icons/b2b_icon-categories.svg +3 -3
  90. package/dist/b2b-core-components/icons/b2b_icon-celery.svg +3 -3
  91. package/dist/b2b-core-components/icons/b2b_icon-certificate.svg +6 -6
  92. package/dist/b2b-core-components/icons/b2b_icon-chair.svg +3 -3
  93. package/dist/b2b-core-components/icons/b2b_icon-chat.svg +5 -5
  94. package/dist/b2b-core-components/icons/b2b_icon-check-bold.svg +1 -1
  95. package/dist/b2b-core-components/icons/b2b_icon-check.svg +3 -3
  96. package/dist/b2b-core-components/icons/b2b_icon-chicken.svg +3 -3
  97. package/dist/b2b-core-components/icons/b2b_icon-city.svg +9 -9
  98. package/dist/b2b-core-components/icons/b2b_icon-clear.svg +3 -3
  99. package/dist/b2b-core-components/icons/b2b_icon-close.svg +3 -3
  100. package/dist/b2b-core-components/icons/b2b_icon-code-management.svg +7 -7
  101. package/dist/b2b-core-components/icons/b2b_icon-contact-mail.svg +3 -3
  102. package/dist/b2b-core-components/icons/b2b_icon-copy.svg +3 -3
  103. package/dist/b2b-core-components/icons/b2b_icon-cow.svg +3 -3
  104. package/dist/b2b-core-components/icons/b2b_icon-crab.svg +3 -3
  105. package/dist/b2b-core-components/icons/b2b_icon-critique.svg +5 -5
  106. package/dist/b2b-core-components/icons/b2b_icon-curtain.svg +3 -3
  107. package/dist/b2b-core-components/icons/b2b_icon-cut-out.svg +6 -6
  108. package/dist/b2b-core-components/icons/b2b_icon-dashboard.svg +3 -3
  109. package/dist/b2b-core-components/icons/b2b_icon-deer.svg +3 -3
  110. package/dist/b2b-core-components/icons/b2b_icon-delete.svg +6 -6
  111. package/dist/b2b-core-components/icons/b2b_icon-delivery-24h.svg +4 -4
  112. package/dist/b2b-core-components/icons/b2b_icon-delivery-desired-date-selection.svg +4 -4
  113. package/dist/b2b-core-components/icons/b2b_icon-delivery-desired-date.svg +3 -3
  114. package/dist/b2b-core-components/icons/b2b_icon-delivery-express.svg +6 -6
  115. package/dist/b2b-core-components/icons/b2b_icon-delivery-flat.svg +4 -4
  116. package/dist/b2b-core-components/icons/b2b_icon-delivery-on-hangers.svg +3 -3
  117. package/dist/b2b-core-components/icons/b2b_icon-delivery-preferred-place.svg +6 -6
  118. package/dist/b2b-core-components/icons/b2b_icon-desktop-phone-ads-click.svg +5 -5
  119. package/dist/b2b-core-components/icons/b2b_icon-desktop-phone-ads.svg +6 -6
  120. package/dist/b2b-core-components/icons/b2b_icon-desktop-phone.svg +4 -4
  121. package/dist/b2b-core-components/icons/b2b_icon-desktop.svg +3 -3
  122. package/dist/b2b-core-components/icons/b2b_icon-devices-monitor-laptop-tablet.svg +4 -4
  123. package/dist/b2b-core-components/icons/b2b_icon-dish-feature-lactose-free.svg +3 -3
  124. package/dist/b2b-core-components/icons/b2b_icon-dislike.svg +3 -3
  125. package/dist/b2b-core-components/icons/b2b_icon-disposal.svg +3 -3
  126. package/dist/b2b-core-components/icons/b2b_icon-document-sign.svg +3 -3
  127. package/dist/b2b-core-components/icons/b2b_icon-downloads.svg +3 -3
  128. package/dist/b2b-core-components/icons/b2b_icon-dress.svg +3 -3
  129. package/dist/b2b-core-components/icons/b2b_icon-dungarees.svg +4 -4
  130. package/dist/b2b-core-components/icons/b2b_icon-duration.svg +3 -3
  131. package/dist/b2b-core-components/icons/b2b_icon-e-invoice.svg +3 -3
  132. package/dist/b2b-core-components/icons/b2b_icon-edit-pad.svg +3 -3
  133. package/dist/b2b-core-components/icons/b2b_icon-edit.svg +3 -3
  134. package/dist/b2b-core-components/icons/b2b_icon-egg.svg +3 -3
  135. package/dist/b2b-core-components/icons/b2b_icon-ellipsis.svg +3 -3
  136. package/dist/b2b-core-components/icons/b2b_icon-email-verification-confirmed-safe.svg +3 -3
  137. package/dist/b2b-core-components/icons/b2b_icon-email-verification-confirmed.svg +3 -3
  138. package/dist/b2b-core-components/icons/b2b_icon-email-verification-sent-safe.svg +3 -3
  139. package/dist/b2b-core-components/icons/b2b_icon-email-verification-sent.svg +3 -3
  140. package/dist/b2b-core-components/icons/b2b_icon-empty-hint.svg +3 -3
  141. package/dist/b2b-core-components/icons/b2b_icon-end-to-end.svg +3 -3
  142. package/dist/b2b-core-components/icons/b2b_icon-error-article-image.svg +4 -4
  143. package/dist/b2b-core-components/icons/b2b_icon-error-hint.svg +3 -3
  144. package/dist/b2b-core-components/icons/b2b_icon-error.svg +3 -3
  145. package/dist/b2b-core-components/icons/b2b_icon-euro.svg +3 -3
  146. package/dist/b2b-core-components/icons/b2b_icon-event.svg +15 -15
  147. package/dist/b2b-core-components/icons/b2b_icon-events.svg +15 -15
  148. package/dist/b2b-core-components/icons/b2b_icon-faq.svg +5 -5
  149. package/dist/b2b-core-components/icons/b2b_icon-feedback.svg +5 -5
  150. package/dist/b2b-core-components/icons/b2b_icon-filter.svg +3 -3
  151. package/dist/b2b-core-components/icons/b2b_icon-fish.svg +3 -3
  152. package/dist/b2b-core-components/icons/b2b_icon-fitness.svg +5 -5
  153. package/dist/b2b-core-components/icons/b2b_icon-flag-chequered.svg +7 -7
  154. package/dist/b2b-core-components/icons/b2b_icon-flexible-work.svg +9 -9
  155. package/dist/b2b-core-components/icons/b2b_icon-flip.svg +4 -4
  156. package/dist/b2b-core-components/icons/b2b_icon-food-processor.svg +4 -4
  157. package/dist/b2b-core-components/icons/b2b_icon-fullscreen.svg +4 -4
  158. package/dist/b2b-core-components/icons/b2b_icon-gallery-view.svg +3 -3
  159. package/dist/b2b-core-components/icons/b2b_icon-gamepad.svg +8 -8
  160. package/dist/b2b-core-components/icons/b2b_icon-garlic.svg +3 -3
  161. package/dist/b2b-core-components/icons/b2b_icon-gender-intersex.svg +3 -3
  162. package/dist/b2b-core-components/icons/b2b_icon-globe.svg +4 -4
  163. package/dist/b2b-core-components/icons/b2b_icon-gluten.svg +3 -3
  164. package/dist/b2b-core-components/icons/b2b_icon-glutenfree.svg +3 -3
  165. package/dist/b2b-core-components/icons/b2b_icon-handshake.svg +3 -3
  166. package/dist/b2b-core-components/icons/b2b_icon-hashtag.svg +3 -3
  167. package/dist/b2b-core-components/icons/b2b_icon-hazelnut.svg +3 -3
  168. package/dist/b2b-core-components/icons/b2b_icon-hide.svg +3 -3
  169. package/dist/b2b-core-components/icons/b2b_icon-high-heels.svg +3 -3
  170. package/dist/b2b-core-components/icons/b2b_icon-home.svg +3 -3
  171. package/dist/b2b-core-components/icons/b2b_icon-info-small.svg +3 -3
  172. package/dist/b2b-core-components/icons/b2b_icon-info.svg +5 -5
  173. package/dist/b2b-core-components/icons/b2b_icon-inplace-zoom-reverse.svg +6 -6
  174. package/dist/b2b-core-components/icons/b2b_icon-inplace-zoom.svg +3 -3
  175. package/dist/b2b-core-components/icons/b2b_icon-insurance.svg +4 -4
  176. package/dist/b2b-core-components/icons/b2b_icon-kamut.svg +3 -3
  177. package/dist/b2b-core-components/icons/b2b_icon-laptop-os.svg +5 -5
  178. package/dist/b2b-core-components/icons/b2b_icon-laptop.svg +3 -3
  179. package/dist/b2b-core-components/icons/b2b_icon-leaving-page.svg +4 -4
  180. package/dist/b2b-core-components/icons/b2b_icon-light-bulb.svg +3 -3
  181. package/dist/b2b-core-components/icons/b2b_icon-like-fingers.svg +3 -3
  182. package/dist/b2b-core-components/icons/b2b_icon-like-product.svg +4 -4
  183. package/dist/b2b-core-components/icons/b2b_icon-like.svg +3 -3
  184. package/dist/b2b-core-components/icons/b2b_icon-line-graph.svg +3 -3
  185. package/dist/b2b-core-components/icons/b2b_icon-list-view.svg +3 -3
  186. package/dist/b2b-core-components/icons/b2b_icon-location.svg +4 -4
  187. package/dist/b2b-core-components/icons/b2b_icon-lupine.svg +3 -3
  188. package/dist/b2b-core-components/icons/b2b_icon-macadamia.svg +3 -3
  189. package/dist/b2b-core-components/icons/b2b_icon-material-samples.svg +4 -4
  190. package/dist/b2b-core-components/icons/b2b_icon-measurement.svg +4 -4
  191. package/dist/b2b-core-components/icons/b2b_icon-megaphone.svg +6 -6
  192. package/dist/b2b-core-components/icons/b2b_icon-mic.svg +4 -4
  193. package/dist/b2b-core-components/icons/b2b_icon-milk.svg +3 -3
  194. package/dist/b2b-core-components/icons/b2b_icon-minus.svg +3 -3
  195. package/dist/b2b-core-components/icons/b2b_icon-money-coins.svg +3 -3
  196. package/dist/b2b-core-components/icons/b2b_icon-money-document.svg +3 -3
  197. package/dist/b2b-core-components/icons/b2b_icon-money-plus.svg +3 -3
  198. package/dist/b2b-core-components/icons/b2b_icon-money-stack.svg +3 -3
  199. package/dist/b2b-core-components/icons/b2b_icon-money.svg +3 -3
  200. package/dist/b2b-core-components/icons/b2b_icon-move.svg +3 -3
  201. package/dist/b2b-core-components/icons/b2b_icon-mustard.svg +3 -3
  202. package/dist/b2b-core-components/icons/b2b_icon-nav.svg +3 -3
  203. package/dist/b2b-core-components/icons/b2b_icon-new.svg +6 -6
  204. package/dist/b2b-core-components/icons/b2b_icon-newsletter-sign-up.svg +3 -3
  205. package/dist/b2b-core-components/icons/b2b_icon-notification.svg +3 -3
  206. package/dist/b2b-core-components/icons/b2b_icon-nuts.svg +3 -3
  207. package/dist/b2b-core-components/icons/b2b_icon-oat.svg +3 -3
  208. package/dist/b2b-core-components/icons/b2b_icon-order-cancelled.svg +3 -3
  209. package/dist/b2b-core-components/icons/b2b_icon-order-delivered.svg +3 -3
  210. package/dist/b2b-core-components/icons/b2b_icon-order-form.svg +6 -6
  211. package/dist/b2b-core-components/icons/b2b_icon-order-management.svg +4 -4
  212. package/dist/b2b-core-components/icons/b2b_icon-order-misdirected.svg +3 -3
  213. package/dist/b2b-core-components/icons/b2b_icon-order-on-road.svg +4 -4
  214. package/dist/b2b-core-components/icons/b2b_icon-order-packed.svg +4 -4
  215. package/dist/b2b-core-components/icons/b2b_icon-order-payment.svg +3 -3
  216. package/dist/b2b-core-components/icons/b2b_icon-order-received.svg +3 -3
  217. package/dist/b2b-core-components/icons/b2b_icon-order-return.svg +4 -4
  218. package/dist/b2b-core-components/icons/b2b_icon-order-shipped.svg +3 -3
  219. package/dist/b2b-core-components/icons/b2b_icon-order-state-unknown.svg +3 -3
  220. package/dist/b2b-core-components/icons/b2b_icon-order-stored.svg +3 -3
  221. package/dist/b2b-core-components/icons/b2b_icon-order.svg +3 -3
  222. package/dist/b2b-core-components/icons/b2b_icon-otto-app.svg +4 -4
  223. package/dist/b2b-core-components/icons/b2b_icon-otto-campus.svg +16 -16
  224. package/dist/b2b-core-components/icons/b2b_icon-otto-company.svg +19 -19
  225. package/dist/b2b-core-components/icons/b2b_icon-otto-laptop.svg +4 -4
  226. package/dist/b2b-core-components/icons/b2b_icon-otto-logo.svg +3 -3
  227. package/dist/b2b-core-components/icons/b2b_icon-otto-up-points.svg +3 -3
  228. package/dist/b2b-core-components/icons/b2b_icon-otto-up.svg +3 -3
  229. package/dist/b2b-core-components/icons/b2b_icon-paper-plane.svg +3 -3
  230. package/dist/b2b-core-components/icons/b2b_icon-pause.svg +3 -3
  231. package/dist/b2b-core-components/icons/b2b_icon-payment-credit-card.svg +7 -7
  232. package/dist/b2b-core-components/icons/b2b_icon-payment-invoice.svg +3 -3
  233. package/dist/b2b-core-components/icons/b2b_icon-payment-pause.svg +9 -9
  234. package/dist/b2b-core-components/icons/b2b_icon-payment-plan-protection.svg +3 -3
  235. package/dist/b2b-core-components/icons/b2b_icon-payment-plan.svg +3 -3
  236. package/dist/b2b-core-components/icons/b2b_icon-pdf.svg +6 -6
  237. package/dist/b2b-core-components/icons/b2b_icon-peanut.svg +3 -3
  238. package/dist/b2b-core-components/icons/b2b_icon-pecan-nut.svg +3 -3
  239. package/dist/b2b-core-components/icons/b2b_icon-pending.svg +3 -3
  240. package/dist/b2b-core-components/icons/b2b_icon-person-access.svg +5 -5
  241. package/dist/b2b-core-components/icons/b2b_icon-person-callcenter.svg +3 -3
  242. package/dist/b2b-core-components/icons/b2b_icon-person-check.svg +5 -5
  243. package/dist/b2b-core-components/icons/b2b_icon-person-colleagues.svg +6 -6
  244. package/dist/b2b-core-components/icons/b2b_icon-person-community.svg +9 -9
  245. package/dist/b2b-core-components/icons/b2b_icon-person-development.svg +9 -9
  246. package/dist/b2b-core-components/icons/b2b_icon-person-female.svg +3 -3
  247. package/dist/b2b-core-components/icons/b2b_icon-person-info.svg +6 -6
  248. package/dist/b2b-core-components/icons/b2b_icon-person-male.svg +3 -3
  249. package/dist/b2b-core-components/icons/b2b_icon-person-rating.svg +5 -5
  250. package/dist/b2b-core-components/icons/b2b_icon-person-support.svg +4 -4
  251. package/dist/b2b-core-components/icons/b2b_icon-person-switch.svg +3 -3
  252. package/dist/b2b-core-components/icons/b2b_icon-person-workshop.svg +8 -8
  253. package/dist/b2b-core-components/icons/b2b_icon-person.svg +3 -3
  254. package/dist/b2b-core-components/icons/b2b_icon-phone-permission.svg +9 -9
  255. package/dist/b2b-core-components/icons/b2b_icon-phone.svg +5 -5
  256. package/dist/b2b-core-components/icons/b2b_icon-pig.svg +3 -3
  257. package/dist/b2b-core-components/icons/b2b_icon-pin.svg +3 -3
  258. package/dist/b2b-core-components/icons/b2b_icon-pinch-gesture.svg +5 -5
  259. package/dist/b2b-core-components/icons/b2b_icon-pinch.svg +3 -3
  260. package/dist/b2b-core-components/icons/b2b_icon-pistachio.svg +3 -3
  261. package/dist/b2b-core-components/icons/b2b_icon-plant.svg +3 -3
  262. package/dist/b2b-core-components/icons/b2b_icon-play-1.svg +3 -3
  263. package/dist/b2b-core-components/icons/b2b_icon-play.svg +3 -3
  264. package/dist/b2b-core-components/icons/b2b_icon-plus.svg +3 -3
  265. package/dist/b2b-core-components/icons/b2b_icon-price-alert.svg +6 -6
  266. package/dist/b2b-core-components/icons/b2b_icon-price-tag.svg +3 -3
  267. package/dist/b2b-core-components/icons/b2b_icon-print.svg +3 -3
  268. package/dist/b2b-core-components/icons/b2b_icon-puzzle.svg +4 -4
  269. package/dist/b2b-core-components/icons/b2b_icon-qr-code.svg +3 -3
  270. package/dist/b2b-core-components/icons/b2b_icon-question-hint.svg +3 -3
  271. package/dist/b2b-core-components/icons/b2b_icon-question.svg +3 -3
  272. package/dist/b2b-core-components/icons/b2b_icon-rating-empty.svg +3 -3
  273. package/dist/b2b-core-components/icons/b2b_icon-rating-filled.svg +3 -3
  274. package/dist/b2b-core-components/icons/b2b_icon-rating-half.svg +3 -3
  275. package/dist/b2b-core-components/icons/b2b_icon-rating-order.svg +4 -4
  276. package/dist/b2b-core-components/icons/b2b_icon-rating-payment.svg +3 -3
  277. package/dist/b2b-core-components/icons/b2b_icon-remote-work.svg +4 -4
  278. package/dist/b2b-core-components/icons/b2b_icon-repair.svg +3 -3
  279. package/dist/b2b-core-components/icons/b2b_icon-reply.svg +3 -3
  280. package/dist/b2b-core-components/icons/b2b_icon-retirement-provision.svg +3 -3
  281. package/dist/b2b-core-components/icons/b2b_icon-rocket.svg +5 -5
  282. package/dist/b2b-core-components/icons/b2b_icon-rye.svg +3 -3
  283. package/dist/b2b-core-components/icons/b2b_icon-sabbatical.svg +19 -19
  284. package/dist/b2b-core-components/icons/b2b_icon-sale.svg +3 -3
  285. package/dist/b2b-core-components/icons/b2b_icon-save.svg +4 -4
  286. package/dist/b2b-core-components/icons/b2b_icon-sea.svg +4 -4
  287. package/dist/b2b-core-components/icons/b2b_icon-search-enter.svg +3 -3
  288. package/dist/b2b-core-components/icons/b2b_icon-search.svg +3 -3
  289. package/dist/b2b-core-components/icons/b2b_icon-seo.svg +4 -4
  290. package/dist/b2b-core-components/icons/b2b_icon-service-info.svg +5 -5
  291. package/dist/b2b-core-components/icons/b2b_icon-sesame.svg +3 -3
  292. package/dist/b2b-core-components/icons/b2b_icon-settings.svg +4 -4
  293. package/dist/b2b-core-components/icons/b2b_icon-share-ios.svg +4 -4
  294. package/dist/b2b-core-components/icons/b2b_icon-share.svg +3 -3
  295. package/dist/b2b-core-components/icons/b2b_icon-sheep.svg +3 -3
  296. package/dist/b2b-core-components/icons/b2b_icon-shell.svg +3 -3
  297. package/dist/b2b-core-components/icons/b2b_icon-shirt.svg +3 -3
  298. package/dist/b2b-core-components/icons/b2b_icon-shopping-cart-euro.svg +3 -3
  299. package/dist/b2b-core-components/icons/b2b_icon-shopping-cart.svg +3 -3
  300. package/dist/b2b-core-components/icons/b2b_icon-show.svg +3 -3
  301. package/dist/b2b-core-components/icons/b2b_icon-smiley-angry.svg +3 -3
  302. package/dist/b2b-core-components/icons/b2b_icon-smiley-happy.svg +3 -3
  303. package/dist/b2b-core-components/icons/b2b_icon-smiley-negative.svg +6 -6
  304. package/dist/b2b-core-components/icons/b2b_icon-smiley-neutral.svg +6 -6
  305. package/dist/b2b-core-components/icons/b2b_icon-smiley-positive.svg +6 -6
  306. package/dist/b2b-core-components/icons/b2b_icon-sms-info.svg +7 -7
  307. package/dist/b2b-core-components/icons/b2b_icon-sneaker.svg +3 -3
  308. package/dist/b2b-core-components/icons/b2b_icon-sort-ascending.svg +3 -3
  309. package/dist/b2b-core-components/icons/b2b_icon-sort-descending.svg +3 -3
  310. package/dist/b2b-core-components/icons/b2b_icon-sort.svg +7 -7
  311. package/dist/b2b-core-components/icons/b2b_icon-soy.svg +3 -3
  312. package/dist/b2b-core-components/icons/b2b_icon-spelt.svg +3 -3
  313. package/dist/b2b-core-components/icons/b2b_icon-stationary.svg +4 -4
  314. package/dist/b2b-core-components/icons/b2b_icon-studies.svg +3 -3
  315. package/dist/b2b-core-components/icons/b2b_icon-success.svg +4 -4
  316. package/dist/b2b-core-components/icons/b2b_icon-sustainable-delivery.svg +3 -3
  317. package/dist/b2b-core-components/icons/b2b_icon-sustainable-energy-efficient.svg +3 -3
  318. package/dist/b2b-core-components/icons/b2b_icon-sustainable-production.svg +3 -3
  319. package/dist/b2b-core-components/icons/b2b_icon-sustainable-recycling.svg +3 -3
  320. package/dist/b2b-core-components/icons/b2b_icon-sustainable-resource.svg +3 -3
  321. package/dist/b2b-core-components/icons/b2b_icon-swipe-gesture.svg +3 -3
  322. package/dist/b2b-core-components/icons/b2b_icon-sync-device.svg +6 -6
  323. package/dist/b2b-core-components/icons/b2b_icon-t-shirt.svg +3 -3
  324. package/dist/b2b-core-components/icons/b2b_icon-tablet.svg +4 -4
  325. package/dist/b2b-core-components/icons/b2b_icon-tableware.svg +6 -6
  326. package/dist/b2b-core-components/icons/b2b_icon-target-group.svg +3 -3
  327. package/dist/b2b-core-components/icons/b2b_icon-teddy.svg +5 -5
  328. package/dist/b2b-core-components/icons/b2b_icon-test-result.svg +4 -4
  329. package/dist/b2b-core-components/icons/b2b_icon-town.svg +3 -3
  330. package/dist/b2b-core-components/icons/b2b_icon-trend-down.svg +3 -3
  331. package/dist/b2b-core-components/icons/b2b_icon-trend-up.svg +3 -3
  332. package/dist/b2b-core-components/icons/b2b_icon-trousers.svg +4 -4
  333. package/dist/b2b-core-components/icons/b2b_icon-trusted.svg +3 -3
  334. package/dist/b2b-core-components/icons/b2b_icon-unpin.svg +3 -3
  335. package/dist/b2b-core-components/icons/b2b_icon-upload.svg +3 -3
  336. package/dist/b2b-core-components/icons/b2b_icon-vacation.svg +3 -3
  337. package/dist/b2b-core-components/icons/b2b_icon-variant-content.svg +3 -3
  338. package/dist/b2b-core-components/icons/b2b_icon-vegan.svg +3 -3
  339. package/dist/b2b-core-components/icons/b2b_icon-vegetarian.svg +3 -3
  340. package/dist/b2b-core-components/icons/b2b_icon-village.svg +10 -10
  341. package/dist/b2b-core-components/icons/b2b_icon-volume-off.svg +3 -3
  342. package/dist/b2b-core-components/icons/b2b_icon-volume-on.svg +3 -3
  343. package/dist/b2b-core-components/icons/b2b_icon-voucher.svg +3 -3
  344. package/dist/b2b-core-components/icons/b2b_icon-walnut.svg +3 -3
  345. package/dist/b2b-core-components/icons/b2b_icon-warning.svg +5 -5
  346. package/dist/b2b-core-components/icons/b2b_icon-warranty.svg +4 -4
  347. package/dist/b2b-core-components/icons/b2b_icon-washing-machine.svg +7 -7
  348. package/dist/b2b-core-components/icons/b2b_icon-whatsapp.svg +4 -4
  349. package/dist/b2b-core-components/icons/b2b_icon-wheat.svg +3 -3
  350. package/dist/b2b-core-components/icons/b2b_icon-wifi.svg +3 -3
  351. package/dist/b2b-core-components/icons/b2b_icon-wishlist-active.svg +3 -3
  352. package/dist/b2b-core-components/icons/b2b_icon-wishlist.svg +3 -3
  353. package/dist/b2b-core-components/icons/b2b_icon-work-life.svg +6 -6
  354. package/dist/b2b-core-components/icons/b2b_icon-workshop.svg +7 -7
  355. package/dist/b2b-core-components/icons/b2b_icon-zoom-in.svg +4 -4
  356. package/dist/b2b-core-components/icons/b2b_icon-zoom-out.svg +4 -4
  357. package/dist/b2b-core-components/icons/b2b_logo-carrier-dhl.svg +23 -0
  358. package/dist/b2b-core-components/icons/b2b_logo-carrier-gls.svg +17 -0
  359. package/dist/b2b-core-components/icons/b2b_logo-carrier-hermes.svg +9 -0
  360. package/dist/b2b-core-components/icons/b2b_logo-carrier-ups.svg +14 -0
  361. package/dist/b2b-core-components/index-7788f606.js +3804 -0
  362. package/dist/b2b-core-components/index.esm.js +1 -0
  363. package/dist/b2b-core-components/{p-d83c2084.entry.js → p-0034d167.entry.js} +1 -1
  364. package/dist/b2b-core-components/{p-2ad8bdb6.entry.js → p-024220fb.entry.js} +1 -1
  365. package/dist/b2b-core-components/{p-7a879329.entry.js → p-0354d337.entry.js} +1 -1
  366. package/dist/b2b-core-components/{p-197c1a6d.entry.js → p-068eb8ba.entry.js} +1 -1
  367. package/dist/b2b-core-components/{p-03e21565.entry.js → p-0f60ff5a.entry.js} +1 -1
  368. package/dist/b2b-core-components/{p-f190bf79.entry.js → p-220d5f79.entry.js} +1 -1
  369. package/dist/b2b-core-components/{p-f24515bf.entry.js → p-299d5c71.entry.js} +1 -1
  370. package/dist/b2b-core-components/{p-e31915cf.entry.js → p-2ad195d3.entry.js} +1 -1
  371. package/dist/b2b-core-components/{p-33e66446.entry.js → p-2b0b7edf.entry.js} +1 -1
  372. package/dist/b2b-core-components/p-328f253e.entry.js +1 -0
  373. package/dist/b2b-core-components/{p-cf0999e2.entry.js → p-381bd00a.entry.js} +1 -1
  374. package/dist/b2b-core-components/{p-c60253d2.entry.js → p-39f965f2.entry.js} +1 -1
  375. package/dist/b2b-core-components/{p-54fd68eb.entry.js → p-46f1d12d.entry.js} +1 -1
  376. package/dist/b2b-core-components/{p-c294dd0c.entry.js → p-50633227.entry.js} +1 -1
  377. package/dist/b2b-core-components/p-54ecee35.entry.js +1 -0
  378. package/dist/b2b-core-components/{p-e5b78075.entry.js → p-57a842ba.entry.js} +1 -1
  379. package/dist/b2b-core-components/p-5c18c291.js +2 -0
  380. package/dist/b2b-core-components/{p-e811411a.entry.js → p-6463d394.entry.js} +1 -1
  381. package/dist/b2b-core-components/{p-b6a8a06f.entry.js → p-66048f63.entry.js} +1 -1
  382. package/dist/b2b-core-components/{p-8ad1bb92.entry.js → p-6814fed4.entry.js} +1 -1
  383. package/dist/b2b-core-components/{p-6140304e.entry.js → p-71bcb908.entry.js} +1 -1
  384. package/dist/b2b-core-components/{p-1d007eea.entry.js → p-75cff1be.entry.js} +1 -1
  385. package/dist/b2b-core-components/{p-04fc18cd.entry.js → p-7a1e9ef2.entry.js} +1 -1
  386. package/dist/b2b-core-components/{p-0965b990.entry.js → p-7d05e787.entry.js} +1 -1
  387. package/dist/b2b-core-components/{p-f8ed569f.entry.js → p-89dc58cc.entry.js} +1 -1
  388. package/dist/b2b-core-components/{p-97ef9805.entry.js → p-8fb5f715.entry.js} +1 -1
  389. package/dist/b2b-core-components/{p-c885a630.entry.js → p-a4ba259c.entry.js} +1 -1
  390. package/dist/b2b-core-components/{p-42e7f397.entry.js → p-a4c859d6.entry.js} +1 -1
  391. package/dist/b2b-core-components/{p-681d6880.entry.js → p-a635b768.entry.js} +1 -1
  392. package/dist/b2b-core-components/{p-b3ccfc58.entry.js → p-a7d829d8.entry.js} +1 -1
  393. package/dist/b2b-core-components/{p-1e2752b2.entry.js → p-a8043eb7.entry.js} +1 -1
  394. package/dist/b2b-core-components/{p-dd79ab5b.entry.js → p-af7e9d0b.entry.js} +1 -1
  395. package/dist/b2b-core-components/{p-2328144b.entry.js → p-c59bffbe.entry.js} +1 -1
  396. package/dist/b2b-core-components/{p-60badad5.entry.js → p-c93fc43f.entry.js} +1 -1
  397. package/dist/b2b-core-components/{p-f7e9f889.entry.js → p-cfd92648.entry.js} +1 -1
  398. package/dist/b2b-core-components/{p-44ccd8f4.entry.js → p-d92add70.entry.js} +1 -1
  399. package/dist/b2b-core-components/{p-b8049234.entry.js → p-da2823f1.entry.js} +1 -1
  400. package/dist/b2b-core-components/{p-98b563a9.entry.js → p-e8d1236b.entry.js} +1 -1
  401. package/dist/b2b-core-components/{p-542a358a.entry.js → p-e9f3a7af.entry.js} +1 -1
  402. package/dist/b2b-core-components/{p-3c0671ef.entry.js → p-edbe9fc0.entry.js} +1 -1
  403. package/dist/b2b-core-components/{p-2d01e68a.entry.js → p-f1625da0.entry.js} +1 -1
  404. package/dist/b2b-core-components/{p-8bad814b.entry.js → p-f6f7c598.entry.js} +1 -1
  405. package/dist/b2b-core-components/{p-d07210e2.entry.js → p-ff36af9f.entry.js} +1 -1
  406. package/dist/b2b-core-components/shadow-css-3392baef.js +449 -0
  407. package/dist/b2b-core-components/table.types-7607e721.js +40 -0
  408. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  409. package/dist/cjs/b2b-alert.cjs.entry.js +2 -2
  410. package/dist/cjs/b2b-anchor.cjs.entry.js +1 -1
  411. package/dist/cjs/b2b-breadcrumb-item.cjs.entry.js +1 -1
  412. package/dist/cjs/b2b-breadcrumb.cjs.entry.js +1 -1
  413. package/dist/cjs/b2b-button.cjs.entry.js +83 -0
  414. package/dist/cjs/b2b-button_2.cjs.entry.js +1 -1
  415. package/dist/cjs/b2b-card.cjs.entry.js +1 -1
  416. package/dist/cjs/b2b-checkbox-group.cjs.entry.js +1 -1
  417. package/dist/cjs/b2b-checkbox.cjs.entry.js +93 -0
  418. package/dist/cjs/b2b-checkbox_3.cjs.entry.js +2 -2
  419. package/dist/cjs/b2b-chip-component.cjs.entry.js +6 -3
  420. package/dist/cjs/b2b-core-components.cjs.js +37 -7
  421. package/dist/cjs/b2b-dropdown.cjs.entry.js +1 -1
  422. package/dist/cjs/b2b-grid-col.cjs.entry.js +1 -1
  423. package/dist/cjs/b2b-grid-row.cjs.entry.js +1 -1
  424. package/dist/cjs/b2b-grid.cjs.entry.js +1 -1
  425. package/dist/cjs/b2b-headline.cjs.entry.js +1 -1
  426. package/dist/cjs/b2b-icon.cjs.entry.js +17 -6
  427. package/dist/cjs/b2b-input-group.cjs.entry.js +80 -0
  428. package/dist/cjs/b2b-input-group_2.cjs.entry.js +1 -1
  429. package/dist/cjs/b2b-input-label.cjs.entry.js +1 -1
  430. package/dist/cjs/b2b-input-list-option.cjs.entry.js +29 -0
  431. package/dist/cjs/b2b-input-list.cjs.entry.js +169 -0
  432. package/dist/cjs/b2b-input.cjs.entry.js +100 -0
  433. package/dist/cjs/b2b-input_2.cjs.entry.js +1 -1
  434. package/dist/cjs/b2b-label.cjs.entry.js +1 -1
  435. package/dist/cjs/b2b-modal.cjs.entry.js +1 -1
  436. package/dist/cjs/b2b-pagination.cjs.entry.js +1 -1
  437. package/dist/cjs/b2b-paragraph.cjs.entry.js +1 -1
  438. package/dist/cjs/b2b-radio-button.cjs.entry.js +1 -1
  439. package/dist/cjs/b2b-radio-group.cjs.entry.js +1 -1
  440. package/dist/cjs/b2b-required-separator.cjs.entry.js +1 -1
  441. package/dist/cjs/b2b-rounded-icon.cjs.entry.js +1 -1
  442. package/dist/cjs/b2b-scrollable-container.cjs.entry.js +1 -1
  443. package/dist/cjs/b2b-search.cjs.entry.js +1 -1
  444. package/dist/cjs/b2b-separator.cjs.entry.js +1 -1
  445. package/dist/cjs/b2b-spinner.cjs.entry.js +25 -0
  446. package/dist/cjs/b2b-tab-group.cjs.entry.js +1 -1
  447. package/dist/cjs/b2b-tab-panel.cjs.entry.js +1 -1
  448. package/dist/cjs/b2b-tab.cjs.entry.js +1 -1
  449. package/dist/cjs/b2b-table-cell.cjs.entry.js +52 -0
  450. package/dist/cjs/b2b-table-header.cjs.entry.js +92 -0
  451. package/dist/cjs/b2b-table-row.cjs.entry.js +2 -2
  452. package/dist/cjs/b2b-table-rowgroup.cjs.entry.js +2 -2
  453. package/dist/cjs/b2b-table.cjs.entry.js +2 -2
  454. package/dist/cjs/b2b-textarea.cjs.entry.js +2 -2
  455. package/dist/cjs/b2b-toggle-button.cjs.entry.js +1 -1
  456. package/dist/cjs/b2b-toggle-group.cjs.entry.js +1 -1
  457. package/dist/cjs/b2b-tooltip.cjs.entry.js +1 -1
  458. package/dist/cjs/b2b-wizard-icon.cjs.entry.js +2 -2
  459. package/dist/cjs/b2b-wizard-step.cjs.entry.js +2 -2
  460. package/dist/cjs/b2b-wizard.cjs.entry.js +2 -2
  461. package/dist/cjs/index-7f7a006f.js +4038 -0
  462. package/dist/cjs/{index-04e07a00.js → index-ceb9958a.js} +216 -51
  463. package/dist/cjs/loader.cjs.js +5 -12
  464. package/dist/cjs/shadow-css-163d1bb0.js +451 -0
  465. package/dist/cjs/table.types-308923fc.js +48 -0
  466. package/dist/collection/collection-manifest.json +49 -49
  467. package/dist/collection/components/alert/alert.css +3 -3
  468. package/dist/collection/components/alert/alert.e2e.js +1 -1
  469. package/dist/collection/components/alert/alert.js +1 -1
  470. package/dist/collection/components/alert/alert.stories.js +18 -18
  471. package/dist/collection/components/anchor/anchor.css +2 -2
  472. package/dist/collection/components/anchor/anchor.js +2 -2
  473. package/dist/collection/components/anchor/anchor.spec.js +39 -39
  474. package/dist/collection/components/anchor/anchor.stories.js +8 -8
  475. package/dist/collection/components/breadcrumb/breadcrumb-item.js +3 -2
  476. package/dist/collection/components/breadcrumb/breadcrumb.css +2 -2
  477. package/dist/collection/components/breadcrumb/breadcrumb.e2e.js +5 -5
  478. package/dist/collection/components/breadcrumb/breadcrumb.js +3 -2
  479. package/dist/collection/components/breadcrumb/breadcrumb.stories.js +6 -6
  480. package/dist/collection/components/button/button.css +2 -2
  481. package/dist/collection/components/button/button.e2e.js +14 -14
  482. package/dist/collection/components/button/button.js +4 -3
  483. package/dist/collection/components/button/button.stories.js +58 -58
  484. package/dist/collection/components/card/card.css +2 -2
  485. package/dist/collection/components/card/card.e2e.js +4 -4
  486. package/dist/collection/components/card/card.js +1 -1
  487. package/dist/collection/components/card/card.spec.js +18 -18
  488. package/dist/collection/components/card/card.stories.js +9 -9
  489. package/dist/collection/components/checkbox/checkbox.css +2 -2
  490. package/dist/collection/components/checkbox/checkbox.e2e.js +1 -1
  491. package/dist/collection/components/checkbox/checkbox.js +7 -4
  492. package/dist/collection/components/checkbox/checkbox.spec.js +3 -3
  493. package/dist/collection/components/checkbox/checkbox.stories.js +11 -11
  494. package/dist/collection/components/checkbox-group/checkbox-group.css +2 -2
  495. package/dist/collection/components/checkbox-group/checkbox-group.e2e.js +6 -6
  496. package/dist/collection/components/checkbox-group/checkbox-group.js +3 -2
  497. package/dist/collection/components/checkbox-group/checkbox-group.spec.js +3 -3
  498. package/dist/collection/components/checkbox-group/checkbox-group.stories.js +12 -12
  499. package/dist/collection/components/chip/chip.css +27 -10
  500. package/dist/collection/components/chip/chip.e2e.js +3 -3
  501. package/dist/collection/components/chip/chip.js +7 -3
  502. package/dist/collection/components/chip/chip.stories.js +20 -6
  503. package/dist/collection/components/dropdown/dropdown.css +2 -2
  504. package/dist/collection/components/dropdown/dropdown.e2e.js +6 -6
  505. package/dist/collection/components/dropdown/dropdown.js +5 -3
  506. package/dist/collection/components/dropdown/dropdown.spec.js +3 -3
  507. package/dist/collection/components/dropdown/dropdown.stories.js +15 -15
  508. package/dist/collection/components/grid/column.js +2 -2
  509. package/dist/collection/components/grid/grid.e2e.js +5 -5
  510. package/dist/collection/components/grid/grid.js +1 -1
  511. package/dist/collection/components/grid/grid.stories.js +153 -153
  512. package/dist/collection/components/grid/row.js +2 -2
  513. package/dist/collection/components/headline/headline.css +2 -2
  514. package/dist/collection/components/headline/headline.e2e.js +1 -1
  515. package/dist/collection/components/headline/headline.js +1 -1
  516. package/dist/collection/components/headline/headline.spec.js +39 -39
  517. package/dist/collection/components/headline/headline.stories.js +4 -4
  518. package/dist/collection/components/icon/icon.css +2 -2
  519. package/dist/collection/components/icon/icon.js +7 -6
  520. package/dist/collection/components/icon/icon.spec.js +3 -3
  521. package/dist/collection/components/icon/icon.stories.js +14 -14
  522. package/dist/collection/components/icon/icons/b2b_icon-360-degree.svg +6 -6
  523. package/dist/collection/components/icon/icons/b2b_icon-advice.svg +7 -7
  524. package/dist/collection/components/icon/icons/b2b_icon-allergen-sulfur-dioxide-sulfite.svg +3 -3
  525. package/dist/collection/components/icon/icons/b2b_icon-almond.svg +3 -3
  526. package/dist/collection/components/icon/icons/b2b_icon-archive.svg +3 -3
  527. package/dist/collection/components/icon/icons/b2b_icon-armchair.svg +3 -3
  528. package/dist/collection/components/icon/icons/b2b_icon-arrow-down.svg +3 -3
  529. package/dist/collection/components/icon/icons/b2b_icon-arrow-graph.svg +3 -3
  530. package/dist/collection/components/icon/icons/b2b_icon-arrow-left.svg +3 -3
  531. package/dist/collection/components/icon/icons/b2b_icon-arrow-right.svg +3 -3
  532. package/dist/collection/components/icon/icons/b2b_icon-arrow-up.svg +3 -3
  533. package/dist/collection/components/icon/icons/b2b_icon-assembly.svg +4 -4
  534. package/dist/collection/components/icon/icons/b2b_icon-assortment.svg +3 -3
  535. package/dist/collection/components/icon/icons/b2b_icon-attachment.svg +3 -3
  536. package/dist/collection/components/icon/icons/b2b_icon-augmented-reality.svg +9 -9
  537. package/dist/collection/components/icon/icons/b2b_icon-autonomous-team.svg +4 -4
  538. package/dist/collection/components/icon/icons/b2b_icon-bank-details.svg +3 -3
  539. package/dist/collection/components/icon/icons/b2b_icon-bar-graph-ascending.svg +5 -5
  540. package/dist/collection/components/icon/icons/b2b_icon-bar-graph-axis.svg +6 -6
  541. package/dist/collection/components/icon/icons/b2b_icon-barley.svg +3 -3
  542. package/dist/collection/components/icon/icons/b2b_icon-basket-sale.svg +3 -3
  543. package/dist/collection/components/icon/icons/b2b_icon-basket.svg +4 -4
  544. package/dist/collection/components/icon/icons/b2b_icon-basketball.svg +3 -3
  545. package/dist/collection/components/icon/icons/b2b_icon-bikini.svg +4 -4
  546. package/dist/collection/components/icon/icons/b2b_icon-blogs.svg +6 -6
  547. package/dist/collection/components/icon/icons/b2b_icon-brandshop.svg +8 -8
  548. package/dist/collection/components/icon/icons/b2b_icon-brazil-nut.svg +3 -3
  549. package/dist/collection/components/icon/icons/b2b_icon-browser-click.svg +7 -7
  550. package/dist/collection/components/icon/icons/b2b_icon-browser-content.svg +9 -9
  551. package/dist/collection/components/icon/icons/b2b_icon-browser-psm.svg +3 -3
  552. package/dist/collection/components/icon/icons/b2b_icon-burger.svg +5 -5
  553. package/dist/collection/components/icon/icons/b2b_icon-bus.svg +5 -5
  554. package/dist/collection/components/icon/icons/b2b_icon-callback.svg +6 -6
  555. package/dist/collection/components/icon/icons/b2b_icon-camera.svg +4 -4
  556. package/dist/collection/components/icon/icons/b2b_icon-cashback.svg +5 -5
  557. package/dist/collection/components/icon/icons/b2b_icon-cashew-nut.svg +3 -3
  558. package/dist/collection/components/icon/icons/b2b_icon-catalogue.svg +4 -4
  559. package/dist/collection/components/icon/icons/b2b_icon-categories.svg +3 -3
  560. package/dist/collection/components/icon/icons/b2b_icon-celery.svg +3 -3
  561. package/dist/collection/components/icon/icons/b2b_icon-certificate.svg +6 -6
  562. package/dist/collection/components/icon/icons/b2b_icon-chair.svg +3 -3
  563. package/dist/collection/components/icon/icons/b2b_icon-chat.svg +5 -5
  564. package/dist/collection/components/icon/icons/b2b_icon-check-bold.svg +1 -1
  565. package/dist/collection/components/icon/icons/b2b_icon-check.svg +3 -3
  566. package/dist/collection/components/icon/icons/b2b_icon-chicken.svg +3 -3
  567. package/dist/collection/components/icon/icons/b2b_icon-city.svg +9 -9
  568. package/dist/collection/components/icon/icons/b2b_icon-clear.svg +3 -3
  569. package/dist/collection/components/icon/icons/b2b_icon-close.svg +3 -3
  570. package/dist/collection/components/icon/icons/b2b_icon-code-management.svg +7 -7
  571. package/dist/collection/components/icon/icons/b2b_icon-contact-mail.svg +3 -3
  572. package/dist/collection/components/icon/icons/b2b_icon-copy.svg +3 -3
  573. package/dist/collection/components/icon/icons/b2b_icon-cow.svg +3 -3
  574. package/dist/collection/components/icon/icons/b2b_icon-crab.svg +3 -3
  575. package/dist/collection/components/icon/icons/b2b_icon-critique.svg +5 -5
  576. package/dist/collection/components/icon/icons/b2b_icon-curtain.svg +3 -3
  577. package/dist/collection/components/icon/icons/b2b_icon-cut-out.svg +6 -6
  578. package/dist/collection/components/icon/icons/b2b_icon-dashboard.svg +3 -3
  579. package/dist/collection/components/icon/icons/b2b_icon-deer.svg +3 -3
  580. package/dist/collection/components/icon/icons/b2b_icon-delete.svg +6 -6
  581. package/dist/collection/components/icon/icons/b2b_icon-delivery-24h.svg +4 -4
  582. package/dist/collection/components/icon/icons/b2b_icon-delivery-desired-date-selection.svg +4 -4
  583. package/dist/collection/components/icon/icons/b2b_icon-delivery-desired-date.svg +3 -3
  584. package/dist/collection/components/icon/icons/b2b_icon-delivery-express.svg +6 -6
  585. package/dist/collection/components/icon/icons/b2b_icon-delivery-flat.svg +4 -4
  586. package/dist/collection/components/icon/icons/b2b_icon-delivery-on-hangers.svg +3 -3
  587. package/dist/collection/components/icon/icons/b2b_icon-delivery-preferred-place.svg +6 -6
  588. package/dist/collection/components/icon/icons/b2b_icon-desktop-phone-ads-click.svg +5 -5
  589. package/dist/collection/components/icon/icons/b2b_icon-desktop-phone-ads.svg +6 -6
  590. package/dist/collection/components/icon/icons/b2b_icon-desktop-phone.svg +4 -4
  591. package/dist/collection/components/icon/icons/b2b_icon-desktop.svg +3 -3
  592. package/dist/collection/components/icon/icons/b2b_icon-devices-monitor-laptop-tablet.svg +4 -4
  593. package/dist/collection/components/icon/icons/b2b_icon-dish-feature-lactose-free.svg +3 -3
  594. package/dist/collection/components/icon/icons/b2b_icon-dislike.svg +3 -3
  595. package/dist/collection/components/icon/icons/b2b_icon-disposal.svg +3 -3
  596. package/dist/collection/components/icon/icons/b2b_icon-document-sign.svg +3 -3
  597. package/dist/collection/components/icon/icons/b2b_icon-downloads.svg +3 -3
  598. package/dist/collection/components/icon/icons/b2b_icon-dress.svg +3 -3
  599. package/dist/collection/components/icon/icons/b2b_icon-dungarees.svg +4 -4
  600. package/dist/collection/components/icon/icons/b2b_icon-duration.svg +3 -3
  601. package/dist/collection/components/icon/icons/b2b_icon-e-invoice.svg +3 -3
  602. package/dist/collection/components/icon/icons/b2b_icon-edit-pad.svg +3 -3
  603. package/dist/collection/components/icon/icons/b2b_icon-edit.svg +3 -3
  604. package/dist/collection/components/icon/icons/b2b_icon-egg.svg +3 -3
  605. package/dist/collection/components/icon/icons/b2b_icon-ellipsis.svg +3 -3
  606. package/dist/collection/components/icon/icons/b2b_icon-email-verification-confirmed-safe.svg +3 -3
  607. package/dist/collection/components/icon/icons/b2b_icon-email-verification-confirmed.svg +3 -3
  608. package/dist/collection/components/icon/icons/b2b_icon-email-verification-sent-safe.svg +3 -3
  609. package/dist/collection/components/icon/icons/b2b_icon-email-verification-sent.svg +3 -3
  610. package/dist/collection/components/icon/icons/b2b_icon-empty-hint.svg +3 -3
  611. package/dist/collection/components/icon/icons/b2b_icon-end-to-end.svg +3 -3
  612. package/dist/collection/components/icon/icons/b2b_icon-error-article-image.svg +4 -4
  613. package/dist/collection/components/icon/icons/b2b_icon-error-hint.svg +3 -3
  614. package/dist/collection/components/icon/icons/b2b_icon-error.svg +3 -3
  615. package/dist/collection/components/icon/icons/b2b_icon-euro.svg +3 -3
  616. package/dist/collection/components/icon/icons/b2b_icon-event.svg +15 -15
  617. package/dist/collection/components/icon/icons/b2b_icon-events.svg +15 -15
  618. package/dist/collection/components/icon/icons/b2b_icon-faq.svg +5 -5
  619. package/dist/collection/components/icon/icons/b2b_icon-feedback.svg +5 -5
  620. package/dist/collection/components/icon/icons/b2b_icon-filter.svg +3 -3
  621. package/dist/collection/components/icon/icons/b2b_icon-fish.svg +3 -3
  622. package/dist/collection/components/icon/icons/b2b_icon-fitness.svg +5 -5
  623. package/dist/collection/components/icon/icons/b2b_icon-flag-chequered.svg +7 -7
  624. package/dist/collection/components/icon/icons/b2b_icon-flexible-work.svg +9 -9
  625. package/dist/collection/components/icon/icons/b2b_icon-flip.svg +4 -4
  626. package/dist/collection/components/icon/icons/b2b_icon-food-processor.svg +4 -4
  627. package/dist/collection/components/icon/icons/b2b_icon-fullscreen.svg +4 -4
  628. package/dist/collection/components/icon/icons/b2b_icon-gallery-view.svg +3 -3
  629. package/dist/collection/components/icon/icons/b2b_icon-gamepad.svg +8 -8
  630. package/dist/collection/components/icon/icons/b2b_icon-garlic.svg +3 -3
  631. package/dist/collection/components/icon/icons/b2b_icon-gender-intersex.svg +3 -3
  632. package/dist/collection/components/icon/icons/b2b_icon-globe.svg +4 -4
  633. package/dist/collection/components/icon/icons/b2b_icon-gluten.svg +3 -3
  634. package/dist/collection/components/icon/icons/b2b_icon-glutenfree.svg +3 -3
  635. package/dist/collection/components/icon/icons/b2b_icon-handshake.svg +3 -3
  636. package/dist/collection/components/icon/icons/b2b_icon-hashtag.svg +3 -3
  637. package/dist/collection/components/icon/icons/b2b_icon-hazelnut.svg +3 -3
  638. package/dist/collection/components/icon/icons/b2b_icon-hide.svg +3 -3
  639. package/dist/collection/components/icon/icons/b2b_icon-high-heels.svg +3 -3
  640. package/dist/collection/components/icon/icons/b2b_icon-home.svg +3 -3
  641. package/dist/collection/components/icon/icons/b2b_icon-info-small.svg +3 -3
  642. package/dist/collection/components/icon/icons/b2b_icon-info.svg +5 -5
  643. package/dist/collection/components/icon/icons/b2b_icon-inplace-zoom-reverse.svg +6 -6
  644. package/dist/collection/components/icon/icons/b2b_icon-inplace-zoom.svg +3 -3
  645. package/dist/collection/components/icon/icons/b2b_icon-insurance.svg +4 -4
  646. package/dist/collection/components/icon/icons/b2b_icon-kamut.svg +3 -3
  647. package/dist/collection/components/icon/icons/b2b_icon-laptop-os.svg +5 -5
  648. package/dist/collection/components/icon/icons/b2b_icon-laptop.svg +3 -3
  649. package/dist/collection/components/icon/icons/b2b_icon-leaving-page.svg +4 -4
  650. package/dist/collection/components/icon/icons/b2b_icon-light-bulb.svg +3 -3
  651. package/dist/collection/components/icon/icons/b2b_icon-like-fingers.svg +3 -3
  652. package/dist/collection/components/icon/icons/b2b_icon-like-product.svg +4 -4
  653. package/dist/collection/components/icon/icons/b2b_icon-like.svg +3 -3
  654. package/dist/collection/components/icon/icons/b2b_icon-line-graph.svg +3 -3
  655. package/dist/collection/components/icon/icons/b2b_icon-list-view.svg +3 -3
  656. package/dist/collection/components/icon/icons/b2b_icon-location.svg +4 -4
  657. package/dist/collection/components/icon/icons/b2b_icon-lupine.svg +3 -3
  658. package/dist/collection/components/icon/icons/b2b_icon-macadamia.svg +3 -3
  659. package/dist/collection/components/icon/icons/b2b_icon-material-samples.svg +4 -4
  660. package/dist/collection/components/icon/icons/b2b_icon-measurement.svg +4 -4
  661. package/dist/collection/components/icon/icons/b2b_icon-megaphone.svg +6 -6
  662. package/dist/collection/components/icon/icons/b2b_icon-mic.svg +4 -4
  663. package/dist/collection/components/icon/icons/b2b_icon-milk.svg +3 -3
  664. package/dist/collection/components/icon/icons/b2b_icon-minus.svg +3 -3
  665. package/dist/collection/components/icon/icons/b2b_icon-money-coins.svg +3 -3
  666. package/dist/collection/components/icon/icons/b2b_icon-money-document.svg +3 -3
  667. package/dist/collection/components/icon/icons/b2b_icon-money-plus.svg +3 -3
  668. package/dist/collection/components/icon/icons/b2b_icon-money-stack.svg +3 -3
  669. package/dist/collection/components/icon/icons/b2b_icon-money.svg +3 -3
  670. package/dist/collection/components/icon/icons/b2b_icon-move.svg +3 -3
  671. package/dist/collection/components/icon/icons/b2b_icon-mustard.svg +3 -3
  672. package/dist/collection/components/icon/icons/b2b_icon-nav.svg +3 -3
  673. package/dist/collection/components/icon/icons/b2b_icon-new.svg +6 -6
  674. package/dist/collection/components/icon/icons/b2b_icon-newsletter-sign-up.svg +3 -3
  675. package/dist/collection/components/icon/icons/b2b_icon-notification.svg +3 -3
  676. package/dist/collection/components/icon/icons/b2b_icon-nuts.svg +3 -3
  677. package/dist/collection/components/icon/icons/b2b_icon-oat.svg +3 -3
  678. package/dist/collection/components/icon/icons/b2b_icon-order-cancelled.svg +3 -3
  679. package/dist/collection/components/icon/icons/b2b_icon-order-delivered.svg +3 -3
  680. package/dist/collection/components/icon/icons/b2b_icon-order-form.svg +6 -6
  681. package/dist/collection/components/icon/icons/b2b_icon-order-management.svg +4 -4
  682. package/dist/collection/components/icon/icons/b2b_icon-order-misdirected.svg +3 -3
  683. package/dist/collection/components/icon/icons/b2b_icon-order-on-road.svg +4 -4
  684. package/dist/collection/components/icon/icons/b2b_icon-order-packed.svg +4 -4
  685. package/dist/collection/components/icon/icons/b2b_icon-order-payment.svg +3 -3
  686. package/dist/collection/components/icon/icons/b2b_icon-order-received.svg +3 -3
  687. package/dist/collection/components/icon/icons/b2b_icon-order-return.svg +4 -4
  688. package/dist/collection/components/icon/icons/b2b_icon-order-shipped.svg +3 -3
  689. package/dist/collection/components/icon/icons/b2b_icon-order-state-unknown.svg +3 -3
  690. package/dist/collection/components/icon/icons/b2b_icon-order-stored.svg +3 -3
  691. package/dist/collection/components/icon/icons/b2b_icon-order.svg +3 -3
  692. package/dist/collection/components/icon/icons/b2b_icon-otto-app.svg +4 -4
  693. package/dist/collection/components/icon/icons/b2b_icon-otto-campus.svg +16 -16
  694. package/dist/collection/components/icon/icons/b2b_icon-otto-company.svg +19 -19
  695. package/dist/collection/components/icon/icons/b2b_icon-otto-laptop.svg +4 -4
  696. package/dist/collection/components/icon/icons/b2b_icon-otto-logo.svg +3 -3
  697. package/dist/collection/components/icon/icons/b2b_icon-otto-up-points.svg +3 -3
  698. package/dist/collection/components/icon/icons/b2b_icon-otto-up.svg +3 -3
  699. package/dist/collection/components/icon/icons/b2b_icon-paper-plane.svg +3 -3
  700. package/dist/collection/components/icon/icons/b2b_icon-pause.svg +3 -3
  701. package/dist/collection/components/icon/icons/b2b_icon-payment-credit-card.svg +7 -7
  702. package/dist/collection/components/icon/icons/b2b_icon-payment-invoice.svg +3 -3
  703. package/dist/collection/components/icon/icons/b2b_icon-payment-pause.svg +9 -9
  704. package/dist/collection/components/icon/icons/b2b_icon-payment-plan-protection.svg +3 -3
  705. package/dist/collection/components/icon/icons/b2b_icon-payment-plan.svg +3 -3
  706. package/dist/collection/components/icon/icons/b2b_icon-pdf.svg +6 -6
  707. package/dist/collection/components/icon/icons/b2b_icon-peanut.svg +3 -3
  708. package/dist/collection/components/icon/icons/b2b_icon-pecan-nut.svg +3 -3
  709. package/dist/collection/components/icon/icons/b2b_icon-pending.svg +3 -3
  710. package/dist/collection/components/icon/icons/b2b_icon-person-access.svg +5 -5
  711. package/dist/collection/components/icon/icons/b2b_icon-person-callcenter.svg +3 -3
  712. package/dist/collection/components/icon/icons/b2b_icon-person-check.svg +5 -5
  713. package/dist/collection/components/icon/icons/b2b_icon-person-colleagues.svg +6 -6
  714. package/dist/collection/components/icon/icons/b2b_icon-person-community.svg +9 -9
  715. package/dist/collection/components/icon/icons/b2b_icon-person-development.svg +9 -9
  716. package/dist/collection/components/icon/icons/b2b_icon-person-female.svg +3 -3
  717. package/dist/collection/components/icon/icons/b2b_icon-person-info.svg +6 -6
  718. package/dist/collection/components/icon/icons/b2b_icon-person-male.svg +3 -3
  719. package/dist/collection/components/icon/icons/b2b_icon-person-rating.svg +5 -5
  720. package/dist/collection/components/icon/icons/b2b_icon-person-support.svg +4 -4
  721. package/dist/collection/components/icon/icons/b2b_icon-person-switch.svg +3 -3
  722. package/dist/collection/components/icon/icons/b2b_icon-person-workshop.svg +8 -8
  723. package/dist/collection/components/icon/icons/b2b_icon-person.svg +3 -3
  724. package/dist/collection/components/icon/icons/b2b_icon-phone-permission.svg +9 -9
  725. package/dist/collection/components/icon/icons/b2b_icon-phone.svg +5 -5
  726. package/dist/collection/components/icon/icons/b2b_icon-pig.svg +3 -3
  727. package/dist/collection/components/icon/icons/b2b_icon-pin.svg +3 -3
  728. package/dist/collection/components/icon/icons/b2b_icon-pinch-gesture.svg +5 -5
  729. package/dist/collection/components/icon/icons/b2b_icon-pinch.svg +3 -3
  730. package/dist/collection/components/icon/icons/b2b_icon-pistachio.svg +3 -3
  731. package/dist/collection/components/icon/icons/b2b_icon-plant.svg +3 -3
  732. package/dist/collection/components/icon/icons/b2b_icon-play-1.svg +3 -3
  733. package/dist/collection/components/icon/icons/b2b_icon-play.svg +3 -3
  734. package/dist/collection/components/icon/icons/b2b_icon-plus.svg +3 -3
  735. package/dist/collection/components/icon/icons/b2b_icon-price-alert.svg +6 -6
  736. package/dist/collection/components/icon/icons/b2b_icon-price-tag.svg +3 -3
  737. package/dist/collection/components/icon/icons/b2b_icon-print.svg +3 -3
  738. package/dist/collection/components/icon/icons/b2b_icon-puzzle.svg +4 -4
  739. package/dist/collection/components/icon/icons/b2b_icon-qr-code.svg +3 -3
  740. package/dist/collection/components/icon/icons/b2b_icon-question-hint.svg +3 -3
  741. package/dist/collection/components/icon/icons/b2b_icon-question.svg +3 -3
  742. package/dist/collection/components/icon/icons/b2b_icon-rating-empty.svg +3 -3
  743. package/dist/collection/components/icon/icons/b2b_icon-rating-filled.svg +3 -3
  744. package/dist/collection/components/icon/icons/b2b_icon-rating-half.svg +3 -3
  745. package/dist/collection/components/icon/icons/b2b_icon-rating-order.svg +4 -4
  746. package/dist/collection/components/icon/icons/b2b_icon-rating-payment.svg +3 -3
  747. package/dist/collection/components/icon/icons/b2b_icon-remote-work.svg +4 -4
  748. package/dist/collection/components/icon/icons/b2b_icon-repair.svg +3 -3
  749. package/dist/collection/components/icon/icons/b2b_icon-reply.svg +3 -3
  750. package/dist/collection/components/icon/icons/b2b_icon-retirement-provision.svg +3 -3
  751. package/dist/collection/components/icon/icons/b2b_icon-rocket.svg +5 -5
  752. package/dist/collection/components/icon/icons/b2b_icon-rye.svg +3 -3
  753. package/dist/collection/components/icon/icons/b2b_icon-sabbatical.svg +19 -19
  754. package/dist/collection/components/icon/icons/b2b_icon-sale.svg +3 -3
  755. package/dist/collection/components/icon/icons/b2b_icon-save.svg +4 -4
  756. package/dist/collection/components/icon/icons/b2b_icon-sea.svg +4 -4
  757. package/dist/collection/components/icon/icons/b2b_icon-search-enter.svg +3 -3
  758. package/dist/collection/components/icon/icons/b2b_icon-search.svg +3 -3
  759. package/dist/collection/components/icon/icons/b2b_icon-seo.svg +4 -4
  760. package/dist/collection/components/icon/icons/b2b_icon-service-info.svg +5 -5
  761. package/dist/collection/components/icon/icons/b2b_icon-sesame.svg +3 -3
  762. package/dist/collection/components/icon/icons/b2b_icon-settings.svg +4 -4
  763. package/dist/collection/components/icon/icons/b2b_icon-share-ios.svg +4 -4
  764. package/dist/collection/components/icon/icons/b2b_icon-share.svg +3 -3
  765. package/dist/collection/components/icon/icons/b2b_icon-sheep.svg +3 -3
  766. package/dist/collection/components/icon/icons/b2b_icon-shell.svg +3 -3
  767. package/dist/collection/components/icon/icons/b2b_icon-shirt.svg +3 -3
  768. package/dist/collection/components/icon/icons/b2b_icon-shopping-cart-euro.svg +3 -3
  769. package/dist/collection/components/icon/icons/b2b_icon-shopping-cart.svg +3 -3
  770. package/dist/collection/components/icon/icons/b2b_icon-show.svg +3 -3
  771. package/dist/collection/components/icon/icons/b2b_icon-smiley-angry.svg +3 -3
  772. package/dist/collection/components/icon/icons/b2b_icon-smiley-happy.svg +3 -3
  773. package/dist/collection/components/icon/icons/b2b_icon-smiley-negative.svg +6 -6
  774. package/dist/collection/components/icon/icons/b2b_icon-smiley-neutral.svg +6 -6
  775. package/dist/collection/components/icon/icons/b2b_icon-smiley-positive.svg +6 -6
  776. package/dist/collection/components/icon/icons/b2b_icon-sms-info.svg +7 -7
  777. package/dist/collection/components/icon/icons/b2b_icon-sneaker.svg +3 -3
  778. package/dist/collection/components/icon/icons/b2b_icon-sort-ascending.svg +3 -3
  779. package/dist/collection/components/icon/icons/b2b_icon-sort-descending.svg +3 -3
  780. package/dist/collection/components/icon/icons/b2b_icon-sort.svg +7 -7
  781. package/dist/collection/components/icon/icons/b2b_icon-soy.svg +3 -3
  782. package/dist/collection/components/icon/icons/b2b_icon-spelt.svg +3 -3
  783. package/dist/collection/components/icon/icons/b2b_icon-stationary.svg +4 -4
  784. package/dist/collection/components/icon/icons/b2b_icon-studies.svg +3 -3
  785. package/dist/collection/components/icon/icons/b2b_icon-success.svg +4 -4
  786. package/dist/collection/components/icon/icons/b2b_icon-sustainable-delivery.svg +3 -3
  787. package/dist/collection/components/icon/icons/b2b_icon-sustainable-energy-efficient.svg +3 -3
  788. package/dist/collection/components/icon/icons/b2b_icon-sustainable-production.svg +3 -3
  789. package/dist/collection/components/icon/icons/b2b_icon-sustainable-recycling.svg +3 -3
  790. package/dist/collection/components/icon/icons/b2b_icon-sustainable-resource.svg +3 -3
  791. package/dist/collection/components/icon/icons/b2b_icon-swipe-gesture.svg +3 -3
  792. package/dist/collection/components/icon/icons/b2b_icon-sync-device.svg +6 -6
  793. package/dist/collection/components/icon/icons/b2b_icon-t-shirt.svg +3 -3
  794. package/dist/collection/components/icon/icons/b2b_icon-tablet.svg +4 -4
  795. package/dist/collection/components/icon/icons/b2b_icon-tableware.svg +6 -6
  796. package/dist/collection/components/icon/icons/b2b_icon-target-group.svg +3 -3
  797. package/dist/collection/components/icon/icons/b2b_icon-teddy.svg +5 -5
  798. package/dist/collection/components/icon/icons/b2b_icon-test-result.svg +4 -4
  799. package/dist/collection/components/icon/icons/b2b_icon-town.svg +3 -3
  800. package/dist/collection/components/icon/icons/b2b_icon-trend-down.svg +3 -3
  801. package/dist/collection/components/icon/icons/b2b_icon-trend-up.svg +3 -3
  802. package/dist/collection/components/icon/icons/b2b_icon-trousers.svg +4 -4
  803. package/dist/collection/components/icon/icons/b2b_icon-trusted.svg +3 -3
  804. package/dist/collection/components/icon/icons/b2b_icon-unpin.svg +3 -3
  805. package/dist/collection/components/icon/icons/b2b_icon-upload.svg +3 -3
  806. package/dist/collection/components/icon/icons/b2b_icon-vacation.svg +3 -3
  807. package/dist/collection/components/icon/icons/b2b_icon-variant-content.svg +3 -3
  808. package/dist/collection/components/icon/icons/b2b_icon-vegan.svg +3 -3
  809. package/dist/collection/components/icon/icons/b2b_icon-vegetarian.svg +3 -3
  810. package/dist/collection/components/icon/icons/b2b_icon-village.svg +10 -10
  811. package/dist/collection/components/icon/icons/b2b_icon-volume-off.svg +3 -3
  812. package/dist/collection/components/icon/icons/b2b_icon-volume-on.svg +3 -3
  813. package/dist/collection/components/icon/icons/b2b_icon-voucher.svg +3 -3
  814. package/dist/collection/components/icon/icons/b2b_icon-walnut.svg +3 -3
  815. package/dist/collection/components/icon/icons/b2b_icon-warning.svg +5 -5
  816. package/dist/collection/components/icon/icons/b2b_icon-warranty.svg +4 -4
  817. package/dist/collection/components/icon/icons/b2b_icon-washing-machine.svg +7 -7
  818. package/dist/collection/components/icon/icons/b2b_icon-whatsapp.svg +4 -4
  819. package/dist/collection/components/icon/icons/b2b_icon-wheat.svg +3 -3
  820. package/dist/collection/components/icon/icons/b2b_icon-wifi.svg +3 -3
  821. package/dist/collection/components/icon/icons/b2b_icon-wishlist-active.svg +3 -3
  822. package/dist/collection/components/icon/icons/b2b_icon-wishlist.svg +3 -3
  823. package/dist/collection/components/icon/icons/b2b_icon-work-life.svg +6 -6
  824. package/dist/collection/components/icon/icons/b2b_icon-workshop.svg +7 -7
  825. package/dist/collection/components/icon/icons/b2b_icon-zoom-in.svg +4 -4
  826. package/dist/collection/components/icon/icons/b2b_icon-zoom-out.svg +4 -4
  827. package/dist/collection/components/icon/icons/b2b_logo-carrier-dhl.svg +23 -0
  828. package/dist/collection/components/icon/icons/b2b_logo-carrier-gls.svg +17 -0
  829. package/dist/collection/components/icon/icons/b2b_logo-carrier-hermes.svg +9 -0
  830. package/dist/collection/components/icon/icons/b2b_logo-carrier-ups.svg +14 -0
  831. package/dist/collection/components/icon/request.js +2 -2
  832. package/dist/collection/components/icon/types.js +5 -1
  833. package/dist/collection/components/input/input.css +2 -2
  834. package/dist/collection/components/input/input.e2e.js +3 -3
  835. package/dist/collection/components/input/input.js +12 -7
  836. package/dist/collection/components/input/input.spec.js +3 -3
  837. package/dist/collection/components/input/input.stories.js +57 -57
  838. package/dist/collection/components/input-group/input-group.css +2 -2
  839. package/dist/collection/components/input-group/input-group.e2e.js +14 -14
  840. package/dist/collection/components/input-group/input-group.js +1 -1
  841. package/dist/collection/components/input-group/input-group.spec.js +6 -6
  842. package/dist/collection/components/input-group/input-group.stories.js +26 -26
  843. package/dist/collection/components/input-label/input-label.e2e.js +1 -1
  844. package/dist/collection/components/input-label/input-label.js +1 -1
  845. package/dist/collection/components/input-list/input-list-option.js +3 -2
  846. package/dist/collection/components/input-list/input-list.css +2 -2
  847. package/dist/collection/components/input-list/input-list.e2e.js +3 -3
  848. package/dist/collection/components/input-list/input-list.js +3 -2
  849. package/dist/collection/components/input-list/input-list.stories.js +31 -31
  850. package/dist/collection/components/label/label.css +2 -2
  851. package/dist/collection/components/label/label.e2e.js +1 -1
  852. package/dist/collection/components/label/label.js +1 -1
  853. package/dist/collection/components/label/label.spec.js +23 -23
  854. package/dist/collection/components/label/label.stories.js +2 -2
  855. package/dist/collection/components/modal/modal.css +2 -2
  856. package/dist/collection/components/modal/modal.e2e.js +1 -1
  857. package/dist/collection/components/modal/modal.js +6 -5
  858. package/dist/collection/components/modal/modal.stories.js +20 -20
  859. package/dist/collection/components/pagination/pagination.css +2 -2
  860. package/dist/collection/components/pagination/pagination.e2e.js +2 -2
  861. package/dist/collection/components/pagination/pagination.js +5 -4
  862. package/dist/collection/components/pagination/pagination.spec.js +3 -3
  863. package/dist/collection/components/pagination/pagination.stories.js +4 -4
  864. package/dist/collection/components/paragraph/paragraph.css +2 -2
  865. package/dist/collection/components/paragraph/paragraph.e2e.js +1 -1
  866. package/dist/collection/components/paragraph/paragraph.js +1 -1
  867. package/dist/collection/components/paragraph/paragraph.stories.js +14 -14
  868. package/dist/collection/components/radio/radio.css +2 -2
  869. package/dist/collection/components/radio/radio.e2e.js +1 -1
  870. package/dist/collection/components/radio/radio.js +7 -4
  871. package/dist/collection/components/radio/radio.spec.js +3 -3
  872. package/dist/collection/components/radio/radio.stories.js +11 -11
  873. package/dist/collection/components/radio-group/radio-group.css +2 -2
  874. package/dist/collection/components/radio-group/radio-group.e2e.js +6 -6
  875. package/dist/collection/components/radio-group/radio-group.js +3 -2
  876. package/dist/collection/components/radio-group/radio-group.spec.js +3 -3
  877. package/dist/collection/components/radio-group/radio-group.stories.js +19 -19
  878. package/dist/collection/components/required-separator/required-separator.css +2 -2
  879. package/dist/collection/components/required-separator/required-separator.e2e.js +1 -1
  880. package/dist/collection/components/required-separator/required-separator.js +1 -1
  881. package/dist/collection/components/required-separator/required-separator.stories.js +5 -5
  882. package/dist/collection/components/rounded-icon/rounded-icon.css +2 -2
  883. package/dist/collection/components/rounded-icon/rounded-icon.js +4 -4
  884. package/dist/collection/components/rounded-icon/rounded-icon.stories.js +10 -10
  885. package/dist/collection/components/scrollable-container/scrollable-container.css +2 -2
  886. package/dist/collection/components/scrollable-container/scrollable-container.js +1 -1
  887. package/dist/collection/components/scrollable-container/scrollable-container.stories.js +20 -20
  888. package/dist/collection/components/search/search.e2e.js +3 -3
  889. package/dist/collection/components/search/search.js +3 -2
  890. package/dist/collection/components/search/search.stories.js +34 -34
  891. package/dist/collection/components/separator/separator.css +2 -2
  892. package/dist/collection/components/separator/separator.e2e.js +1 -1
  893. package/dist/collection/components/separator/separator.js +1 -1
  894. package/dist/collection/components/separator/separator.stories.js +6 -6
  895. package/dist/collection/components/spinner/spinner.css +2 -2
  896. package/dist/collection/components/spinner/spinner.e2e.js +1 -1
  897. package/dist/collection/components/spinner/spinner.js +1 -1
  898. package/dist/collection/components/spinner/spinner.spec.js +21 -21
  899. package/dist/collection/components/spinner/spinner.stories.js +2 -2
  900. package/dist/collection/components/tab/tab.css +2 -2
  901. package/dist/collection/components/tab/tab.e2e.js +1 -1
  902. package/dist/collection/components/tab/tab.js +1 -1
  903. package/dist/collection/components/tab/tab.spec.js +3 -3
  904. package/dist/collection/components/tab-group/tab-group.e2e.js +22 -22
  905. package/dist/collection/components/tab-group/tab-group.js +4 -3
  906. package/dist/collection/components/tab-group/tab-group.stories.js +37 -37
  907. package/dist/collection/components/tab-panel/tab-panel.css +2 -2
  908. package/dist/collection/components/tab-panel/tab-panel.e2e.js +1 -1
  909. package/dist/collection/components/tab-panel/tab-panel.js +1 -1
  910. package/dist/collection/components/tab-panel/tab-panel.spec.js +3 -3
  911. package/dist/collection/components/table/table-cell/table-cell.css +2 -2
  912. package/dist/collection/components/table/table-cell/table-cell.js +10 -7
  913. package/dist/collection/components/table/table-header/table-header.css +2 -2
  914. package/dist/collection/components/table/table-header/table-header.js +8 -5
  915. package/dist/collection/components/table/table-row/table-row.css +2 -2
  916. package/dist/collection/components/table/table-row/table-row.js +10 -6
  917. package/dist/collection/components/table/table-rowgroup/table-rowgroup.css +2 -2
  918. package/dist/collection/components/table/table-rowgroup/table-rowgroup.js +10 -8
  919. package/dist/collection/components/table/table.css +2 -2
  920. package/dist/collection/components/table/table.e2e.js +85 -85
  921. package/dist/collection/components/table/table.js +7 -5
  922. package/dist/collection/components/table/table.stories.js +169 -169
  923. package/dist/collection/components/textarea/textarea.css +2 -2
  924. package/dist/collection/components/textarea/textarea.e2e.js +4 -4
  925. package/dist/collection/components/textarea/textarea.js +8 -5
  926. package/dist/collection/components/textarea/textarea.stories.js +14 -14
  927. package/dist/collection/components/toggle-button/toggle-button.css +2 -2
  928. package/dist/collection/components/toggle-button/toggle-button.e2e.js +1 -1
  929. package/dist/collection/components/toggle-button/toggle-button.js +3 -2
  930. package/dist/collection/components/toggle-group/toggle-group.css +2 -2
  931. package/dist/collection/components/toggle-group/toggle-group.e2e.js +7 -7
  932. package/dist/collection/components/toggle-group/toggle-group.js +3 -2
  933. package/dist/collection/components/toggle-group/toggle-group.stories.js +22 -22
  934. package/dist/collection/components/tooltip/tooltip.css +2 -2
  935. package/dist/collection/components/tooltip/tooltip.e2e.js +1 -1
  936. package/dist/collection/components/tooltip/tooltip.js +1 -1
  937. package/dist/collection/components/tooltip/tooltip.stories.js +26 -26
  938. package/dist/collection/components/wizard/wizard-step.js +7 -5
  939. package/dist/collection/components/wizard/wizard.css +2 -2
  940. package/dist/collection/components/wizard/wizard.e2e.js +67 -67
  941. package/dist/collection/components/wizard/wizard.js +6 -5
  942. package/dist/collection/components/wizard/wizard.stories.js +17 -17
  943. package/dist/collection/components/wizard-icon/wizard-icon.css +2 -2
  944. package/dist/collection/components/wizard-icon/wizard-icon.js +7 -5
  945. package/dist/collection/components/wizard-icon/wizard-icon.stories.js +5 -5
  946. package/dist/collection/docs/config/replace-prop-controls.spec.js +1 -1
  947. package/dist/collection/docs/config/utils.js +2 -2
  948. package/dist/collection/docs/tokens/color.stories.js +35 -35
  949. package/dist/collection/docs/tokens/font.stories.js +51 -51
  950. package/dist/collection/docs/tokens/size.stories.js +40 -40
  951. package/dist/collection/static/assets/fonts/otto-sans-bold.svg +18 -18
  952. package/dist/collection/static/assets/fonts/otto-sans-thin.svg +18 -18
  953. package/dist/collection/static/assets/fonts/otto-sans.svg +18 -18
  954. package/dist/collection/utils/resources.js +1 -1
  955. package/dist/collection/utils/utils.spec.js +1 -1
  956. package/dist/components/b2b-alert.js +3 -1
  957. package/dist/components/b2b-checkbox-group.js +4 -1
  958. package/dist/components/b2b-chip-component.js +5 -2
  959. package/dist/components/b2b-modal.js +3 -1
  960. package/dist/components/b2b-pagination.js +3 -0
  961. package/dist/components/b2b-radio-group.js +4 -1
  962. package/dist/components/b2b-tab.js +2 -0
  963. package/dist/components/b2b-textarea.js +1 -1
  964. package/dist/components/b2b-toggle-group.js +3 -1
  965. package/dist/components/b2b-tooltip.js +2 -0
  966. package/dist/components/icon.js +9 -3
  967. package/dist/components/index.d.ts +6 -0
  968. package/dist/components/index.js +5 -1
  969. package/dist/components/input-group.js +3 -0
  970. package/dist/components/input-list.js +3 -1
  971. package/dist/components/input.js +1 -1
  972. package/dist/components/table-header.js +2 -0
  973. package/dist/components/table.types.js +4 -0
  974. package/dist/custom-elements.json +37 -25
  975. package/dist/esm/app-globals-0f993ce5.js +3 -0
  976. package/dist/esm/b2b-alert.entry.js +2 -2
  977. package/dist/esm/b2b-anchor.entry.js +1 -1
  978. package/dist/esm/b2b-breadcrumb-item.entry.js +1 -1
  979. package/dist/esm/b2b-breadcrumb.entry.js +1 -1
  980. package/dist/esm/b2b-button.entry.js +79 -0
  981. package/dist/esm/b2b-button_2.entry.js +1 -1
  982. package/dist/esm/b2b-card.entry.js +1 -1
  983. package/dist/esm/b2b-checkbox-group.entry.js +1 -1
  984. package/dist/esm/b2b-checkbox.entry.js +89 -0
  985. package/dist/esm/b2b-checkbox_3.entry.js +2 -2
  986. package/dist/esm/b2b-chip-component.entry.js +6 -3
  987. package/dist/esm/b2b-core-components.js +38 -8
  988. package/dist/esm/b2b-dropdown.entry.js +1 -1
  989. package/dist/esm/b2b-grid-col.entry.js +1 -1
  990. package/dist/esm/b2b-grid-row.entry.js +1 -1
  991. package/dist/esm/b2b-grid.entry.js +1 -1
  992. package/dist/esm/b2b-headline.entry.js +1 -1
  993. package/dist/esm/b2b-icon.entry.js +17 -6
  994. package/dist/esm/b2b-input-group.entry.js +76 -0
  995. package/dist/esm/b2b-input-group_2.entry.js +1 -1
  996. package/dist/esm/b2b-input-label.entry.js +1 -1
  997. package/dist/esm/b2b-input-list-option.entry.js +25 -0
  998. package/dist/esm/b2b-input-list.entry.js +165 -0
  999. package/dist/esm/b2b-input.entry.js +96 -0
  1000. package/dist/esm/b2b-input_2.entry.js +1 -1
  1001. package/dist/esm/b2b-label.entry.js +1 -1
  1002. package/dist/esm/b2b-modal.entry.js +1 -1
  1003. package/dist/esm/b2b-pagination.entry.js +1 -1
  1004. package/dist/esm/b2b-paragraph.entry.js +1 -1
  1005. package/dist/esm/b2b-radio-button.entry.js +1 -1
  1006. package/dist/esm/b2b-radio-group.entry.js +1 -1
  1007. package/dist/esm/b2b-required-separator.entry.js +1 -1
  1008. package/dist/esm/b2b-rounded-icon.entry.js +1 -1
  1009. package/dist/esm/b2b-scrollable-container.entry.js +1 -1
  1010. package/dist/esm/b2b-search.entry.js +1 -1
  1011. package/dist/esm/b2b-separator.entry.js +1 -1
  1012. package/dist/esm/b2b-spinner.entry.js +21 -0
  1013. package/dist/esm/b2b-tab-group.entry.js +1 -1
  1014. package/dist/esm/b2b-tab-panel.entry.js +1 -1
  1015. package/dist/esm/b2b-tab.entry.js +1 -1
  1016. package/dist/esm/b2b-table-cell.entry.js +48 -0
  1017. package/dist/esm/b2b-table-header.entry.js +88 -0
  1018. package/dist/esm/b2b-table-row.entry.js +2 -2
  1019. package/dist/esm/b2b-table-rowgroup.entry.js +2 -2
  1020. package/dist/esm/b2b-table.entry.js +2 -2
  1021. package/dist/esm/b2b-textarea.entry.js +2 -2
  1022. package/dist/esm/b2b-toggle-button.entry.js +1 -1
  1023. package/dist/esm/b2b-toggle-group.entry.js +1 -1
  1024. package/dist/esm/b2b-tooltip.entry.js +1 -1
  1025. package/dist/esm/b2b-wizard-icon.entry.js +2 -2
  1026. package/dist/esm/b2b-wizard-step.entry.js +2 -2
  1027. package/dist/esm/b2b-wizard.entry.js +2 -2
  1028. package/dist/esm/index-7788f606.js +4001 -0
  1029. package/dist/esm/{index-dfdbf4b9.js → index-f0a4762b.js} +216 -51
  1030. package/dist/esm/loader.js +6 -13
  1031. package/dist/esm/polyfills/core-js.js +0 -0
  1032. package/dist/esm/polyfills/dom.js +0 -0
  1033. package/dist/esm/polyfills/es5-html-element.js +0 -0
  1034. package/dist/esm/polyfills/index.js +0 -0
  1035. package/dist/esm/polyfills/system.js +0 -0
  1036. package/dist/esm/shadow-css-3392baef.js +449 -0
  1037. package/dist/esm/table.types-7607e721.js +40 -0
  1038. package/dist/esm/wizard.types-f1a7c73a.js +8 -0
  1039. package/dist/loader/index.d.ts +1 -1
  1040. package/dist/scripts/stencil/generate-storybook-args.js +1 -1
  1041. package/dist/scripts/stencil/generate-vue-web-types.js +1 -1
  1042. package/dist/types/components/chip/chip.d.ts +1 -0
  1043. package/dist/types/components/chip/chip.stories.d.ts +1 -0
  1044. package/dist/types/components/icon/types.d.ts +1 -1
  1045. package/dist/types/components.d.ts +337 -50
  1046. package/dist/types/stencil-public-runtime.d.ts +38 -5
  1047. package/dist/types/utils/interfaces/content.interface.d.ts +4 -4
  1048. package/dist/types/utils/interfaces/form.interface.d.ts +38 -38
  1049. package/dist/types/utils/interfaces/interaction.interface.d.ts +21 -21
  1050. package/dist/types/utils/interfaces/interface.d.ts +5 -5
  1051. package/dist/types/utils/interfaces/status.interface.d.ts +5 -5
  1052. package/dist/types/utils/resources.d.ts +1 -1
  1053. package/dist/web-types.json +76 -76
  1054. package/package.json +94 -94
  1055. package/dist/b2b-core-components/p-1c0df04b.entry.js +0 -1
  1056. package/dist/b2b-core-components/p-9c0e419e.entry.js +0 -1
  1057. package/dist/b2b-core-components/p-f3ce95bf.js +0 -2
  1058. package/dist/esm/polyfills/css-shim.js +0 -1
  1059. /package/dist/b2b-core-components/{p-bb5e7c53.js → p-5b4639bc.js} +0 -0
  1060. /package/dist/b2b-core-components/{p-1dc70300.js → p-b1064afb.js} +0 -0
  1061. /package/dist/{esm/wizard.types-2a03b8e0.js → b2b-core-components/wizard.types-f1a7c73a.js} +0 -0
  1062. /package/dist/cjs/{table.types-196dc690.js → table.types-679aefd5.js} +0 -0
  1063. /package/dist/cjs/{wizard.types-690c64bb.js → wizard.types-41d38f1a.js} +0 -0
  1064. /package/dist/esm/{table.types-46c5a83a.js → table.types-c4d9046e.js} +0 -0
  1065. /package/dist/types/{home/runner/work/b2b-design-system → Users/AHOEGE/Projects/otto-de}/b2b-design-system/packages/core-components/.stencil/scripts/stencil/generate-storybook-args.d.ts +0 -0
  1066. /package/dist/types/{home/runner/work/b2b-design-system → Users/AHOEGE/Projects/otto-de}/b2b-design-system/packages/core-components/.stencil/scripts/stencil/generate-vue-web-types.d.ts +0 -0
@@ -0,0 +1,4038 @@
1
+ 'use strict';
2
+
3
+ function _interopNamespace(e) {
4
+ if (e && e.__esModule) return e;
5
+ var n = Object.create(null);
6
+ if (e) {
7
+ Object.keys(e).forEach(function (k) {
8
+ if (k !== 'default') {
9
+ var d = Object.getOwnPropertyDescriptor(e, k);
10
+ Object.defineProperty(n, k, d.get ? d : {
11
+ enumerable: true,
12
+ get: function () {
13
+ return e[k];
14
+ }
15
+ });
16
+ }
17
+ });
18
+ }
19
+ n['default'] = e;
20
+ return Object.freeze(n);
21
+ }
22
+
23
+ const NAMESPACE = 'b2b-core-components';
24
+ const BUILD = /* b2b-core-components */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: true, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: true, cmpWillUpdate: false, connectedCallback: true, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: true, element: false, event: true, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: true, hostListenerTarget: false, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: false, hotModuleReplacement: false, hydrateClientSide: true, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: true, isTesting: true, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: true, member: true, method: true, mode: false, observeAttribute: true, profile: false, prop: true, propBoolean: true, propMutable: true, propNumber: true, propString: true, reflect: true, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, slot: true, slotChildNodesFix: false, slotRelocation: false, state: true, style: true, svg: true, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: false, vdomKey: false, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: true, vdomText: true, vdomXlink: false, watchCallback: true };
25
+ const Env = /* b2b-core-components */ {"env":"prod"};
26
+
27
+ /**
28
+ * Virtual DOM patching algorithm based on Snabbdom by
29
+ * Simon Friis Vindum (@paldepind)
30
+ * Licensed under the MIT License
31
+ * https://github.com/snabbdom/snabbdom/blob/master/LICENSE
32
+ *
33
+ * Modified for Stencil's renderer and slot projection
34
+ */
35
+ let scopeId;
36
+ let contentRef;
37
+ let hostTagName;
38
+ let customError;
39
+ let i = 0;
40
+ let useNativeShadowDom = false;
41
+ let checkSlotFallbackVisibility = false;
42
+ let checkSlotRelocate = false;
43
+ let isSvgMode = false;
44
+ let renderingRef = null;
45
+ let queueCongestion = 0;
46
+ let queuePending = false;
47
+ const Build = {
48
+ isDev: BUILD.isDev ? true : false,
49
+ isBrowser: true,
50
+ isServer: false,
51
+ isTesting: BUILD.isTesting ? true : false,
52
+ };
53
+ const getAssetPath = (path) => {
54
+ const assetUrl = new URL(path, plt.$resourcesUrl$);
55
+ return assetUrl.origin !== win.location.origin ? assetUrl.href : assetUrl.pathname;
56
+ };
57
+ const setAssetPath = (path) => (plt.$resourcesUrl$ = path);
58
+ const createTime = (fnName, tagName = '') => {
59
+ if (BUILD.profile && performance.mark) {
60
+ const key = `st:${fnName}:${tagName}:${i++}`;
61
+ // Start
62
+ performance.mark(key);
63
+ // End
64
+ return () => performance.measure(`[Stencil] ${fnName}() <${tagName}>`, key);
65
+ }
66
+ else {
67
+ return () => {
68
+ return;
69
+ };
70
+ }
71
+ };
72
+ const uniqueTime = (key, measureText) => {
73
+ if (BUILD.profile && performance.mark) {
74
+ if (performance.getEntriesByName(key, 'mark').length === 0) {
75
+ performance.mark(key);
76
+ }
77
+ return () => {
78
+ if (performance.getEntriesByName(measureText, 'measure').length === 0) {
79
+ performance.measure(measureText, key);
80
+ }
81
+ };
82
+ }
83
+ else {
84
+ return () => {
85
+ return;
86
+ };
87
+ }
88
+ };
89
+ const inspect = (ref) => {
90
+ const hostRef = getHostRef(ref);
91
+ if (!hostRef) {
92
+ return undefined;
93
+ }
94
+ const flags = hostRef.$flags$;
95
+ const hostElement = hostRef.$hostElement$;
96
+ return {
97
+ renderCount: hostRef.$renderCount$,
98
+ flags: {
99
+ hasRendered: !!(flags & 2 /* HOST_FLAGS.hasRendered */),
100
+ hasConnected: !!(flags & 1 /* HOST_FLAGS.hasConnected */),
101
+ isWaitingForChildren: !!(flags & 4 /* HOST_FLAGS.isWaitingForChildren */),
102
+ isConstructingInstance: !!(flags & 8 /* HOST_FLAGS.isConstructingInstance */),
103
+ isQueuedForUpdate: !!(flags & 16 /* HOST_FLAGS.isQueuedForUpdate */),
104
+ hasInitializedComponent: !!(flags & 32 /* HOST_FLAGS.hasInitializedComponent */),
105
+ hasLoadedComponent: !!(flags & 64 /* HOST_FLAGS.hasLoadedComponent */),
106
+ isWatchReady: !!(flags & 128 /* HOST_FLAGS.isWatchReady */),
107
+ isListenReady: !!(flags & 256 /* HOST_FLAGS.isListenReady */),
108
+ needsRerender: !!(flags & 512 /* HOST_FLAGS.needsRerender */),
109
+ },
110
+ instanceValues: hostRef.$instanceValues$,
111
+ ancestorComponent: hostRef.$ancestorComponent$,
112
+ hostElement,
113
+ lazyInstance: hostRef.$lazyInstance$,
114
+ vnode: hostRef.$vnode$,
115
+ modeName: hostRef.$modeName$,
116
+ onReadyPromise: hostRef.$onReadyPromise$,
117
+ onReadyResolve: hostRef.$onReadyResolve$,
118
+ onInstancePromise: hostRef.$onInstancePromise$,
119
+ onInstanceResolve: hostRef.$onInstanceResolve$,
120
+ onRenderResolve: hostRef.$onRenderResolve$,
121
+ queuedListeners: hostRef.$queuedListeners$,
122
+ rmListeners: hostRef.$rmListeners$,
123
+ ['s-id']: hostElement['s-id'],
124
+ ['s-cr']: hostElement['s-cr'],
125
+ ['s-lr']: hostElement['s-lr'],
126
+ ['s-p']: hostElement['s-p'],
127
+ ['s-rc']: hostElement['s-rc'],
128
+ ['s-sc']: hostElement['s-sc'],
129
+ };
130
+ };
131
+ const installDevTools = () => {
132
+ if (BUILD.devTools) {
133
+ const stencil = (win.stencil = win.stencil || {});
134
+ const originalInspect = stencil.inspect;
135
+ stencil.inspect = (ref) => {
136
+ let result = inspect(ref);
137
+ if (!result && typeof originalInspect === 'function') {
138
+ result = originalInspect(ref);
139
+ }
140
+ return result;
141
+ };
142
+ }
143
+ };
144
+ const CONTENT_REF_ID = 'r';
145
+ const ORG_LOCATION_ID = 'o';
146
+ const SLOT_NODE_ID = 's';
147
+ const TEXT_NODE_ID = 't';
148
+ const HYDRATE_ID = 's-id';
149
+ const HYDRATED_STYLE_ID = 'sty-id';
150
+ const HYDRATE_CHILD_ID = 'c-id';
151
+ const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
152
+ const XLINK_NS = 'http://www.w3.org/1999/xlink';
153
+ /**
154
+ * Default style mode id
155
+ */
156
+ /**
157
+ * Reusable empty obj/array
158
+ * Don't add values to these!!
159
+ */
160
+ const EMPTY_OBJ = {};
161
+ /**
162
+ * Namespaces
163
+ */
164
+ const SVG_NS = 'http://www.w3.org/2000/svg';
165
+ const HTML_NS = 'http://www.w3.org/1999/xhtml';
166
+ const isDef = (v) => v != null;
167
+ /**
168
+ * Check whether a value is a 'complex type', defined here as an object or a
169
+ * function.
170
+ *
171
+ * @param o the value to check
172
+ * @returns whether it's a complex type or not
173
+ */
174
+ const isComplexType = (o) => {
175
+ // https://jsperf.com/typeof-fn-object/5
176
+ o = typeof o;
177
+ return o === 'object' || o === 'function';
178
+ };
179
+ /**
180
+ * Helper method for querying a `meta` tag that contains a nonce value
181
+ * out of a DOM's head.
182
+ *
183
+ * @param doc The DOM containing the `head` to query against
184
+ * @returns The content of the meta tag representing the nonce value, or `undefined` if no tag
185
+ * exists or the tag has no content.
186
+ */
187
+ function queryNonceMetaTagContent(doc) {
188
+ var _a, _b, _c;
189
+ 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;
190
+ }
191
+ /**
192
+ * Production h() function based on Preact by
193
+ * Jason Miller (@developit)
194
+ * Licensed under the MIT License
195
+ * https://github.com/developit/preact/blob/master/LICENSE
196
+ *
197
+ * Modified for Stencil's compiler and vdom
198
+ */
199
+ // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, child?: d.ChildType): d.VNode;
200
+ // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;
201
+ const h = (nodeName, vnodeData, ...children) => {
202
+ let child = null;
203
+ let key = null;
204
+ let slotName = null;
205
+ let simple = false;
206
+ let lastSimple = false;
207
+ const vNodeChildren = [];
208
+ const walk = (c) => {
209
+ for (let i = 0; i < c.length; i++) {
210
+ child = c[i];
211
+ if (Array.isArray(child)) {
212
+ walk(child);
213
+ }
214
+ else if (child != null && typeof child !== 'boolean') {
215
+ if ((simple = typeof nodeName !== 'function' && !isComplexType(child))) {
216
+ child = String(child);
217
+ }
218
+ else if (BUILD.isDev && typeof nodeName !== 'function' && child.$flags$ === undefined) {
219
+ consoleDevError(`vNode passed as children has unexpected type.
220
+ Make sure it's using the correct h() function.
221
+ Empty objects can also be the cause, look for JSX comments that became objects.`);
222
+ }
223
+ if (simple && lastSimple) {
224
+ // If the previous child was simple (string), we merge both
225
+ vNodeChildren[vNodeChildren.length - 1].$text$ += child;
226
+ }
227
+ else {
228
+ // Append a new vNode, if it's text, we create a text vNode
229
+ vNodeChildren.push(simple ? newVNode(null, child) : child);
230
+ }
231
+ lastSimple = simple;
232
+ }
233
+ }
234
+ };
235
+ walk(children);
236
+ if (vnodeData) {
237
+ if (BUILD.isDev && nodeName === 'input') {
238
+ validateInputProperties(vnodeData);
239
+ }
240
+ if (BUILD.vdomKey && vnodeData.key) {
241
+ key = vnodeData.key;
242
+ }
243
+ if (BUILD.slotRelocation && vnodeData.name) {
244
+ slotName = vnodeData.name;
245
+ }
246
+ // normalize class / className attributes
247
+ if (BUILD.vdomClass) {
248
+ const classData = vnodeData.className || vnodeData.class;
249
+ if (classData) {
250
+ vnodeData.class =
251
+ typeof classData !== 'object'
252
+ ? classData
253
+ : Object.keys(classData)
254
+ .filter((k) => classData[k])
255
+ .join(' ');
256
+ }
257
+ }
258
+ }
259
+ if (BUILD.isDev && vNodeChildren.some(isHost)) {
260
+ consoleDevError(`The <Host> must be the single root component. Make sure:
261
+ - You are NOT using hostData() and <Host> in the same component.
262
+ - <Host> is used once, and it's the single root component of the render() function.`);
263
+ }
264
+ if (BUILD.vdomFunctional && typeof nodeName === 'function') {
265
+ // nodeName is a functional component
266
+ return nodeName(vnodeData === null ? {} : vnodeData, vNodeChildren, vdomFnUtils);
267
+ }
268
+ const vnode = newVNode(nodeName, null);
269
+ vnode.$attrs$ = vnodeData;
270
+ if (vNodeChildren.length > 0) {
271
+ vnode.$children$ = vNodeChildren;
272
+ }
273
+ if (BUILD.vdomKey) {
274
+ vnode.$key$ = key;
275
+ }
276
+ if (BUILD.slotRelocation) {
277
+ vnode.$name$ = slotName;
278
+ }
279
+ return vnode;
280
+ };
281
+ /**
282
+ * A utility function for creating a virtual DOM node from a tag and some
283
+ * possible text content.
284
+ *
285
+ * @param tag the tag for this element
286
+ * @param text possible text content for the node
287
+ * @returns a newly-minted virtual DOM node
288
+ */
289
+ const newVNode = (tag, text) => {
290
+ const vnode = {
291
+ $flags$: 0,
292
+ $tag$: tag,
293
+ $text$: text,
294
+ $elm$: null,
295
+ $children$: null,
296
+ };
297
+ if (BUILD.vdomAttribute) {
298
+ vnode.$attrs$ = null;
299
+ }
300
+ if (BUILD.vdomKey) {
301
+ vnode.$key$ = null;
302
+ }
303
+ if (BUILD.slotRelocation) {
304
+ vnode.$name$ = null;
305
+ }
306
+ return vnode;
307
+ };
308
+ const Host = {};
309
+ /**
310
+ * Check whether a given node is a Host node or not
311
+ *
312
+ * @param node the virtual DOM node to check
313
+ * @returns whether it's a Host node or not
314
+ */
315
+ const isHost = (node) => node && node.$tag$ === Host;
316
+ /**
317
+ * Implementation of {@link d.FunctionalUtilities} for Stencil's VDom.
318
+ *
319
+ * Note that these functions convert from {@link d.VNode} to
320
+ * {@link d.ChildNode} to give functional component developers a friendly
321
+ * interface.
322
+ */
323
+ const vdomFnUtils = {
324
+ forEach: (children, cb) => children.map(convertToPublic).forEach(cb),
325
+ map: (children, cb) => children.map(convertToPublic).map(cb).map(convertToPrivate),
326
+ };
327
+ /**
328
+ * Convert a {@link d.VNode} to a {@link d.ChildNode} in order to present a
329
+ * friendlier public interface (hence, 'convertToPublic').
330
+ *
331
+ * @param node the virtual DOM node to convert
332
+ * @returns a converted child node
333
+ */
334
+ const convertToPublic = (node) => ({
335
+ vattrs: node.$attrs$,
336
+ vchildren: node.$children$,
337
+ vkey: node.$key$,
338
+ vname: node.$name$,
339
+ vtag: node.$tag$,
340
+ vtext: node.$text$,
341
+ });
342
+ /**
343
+ * Convert a {@link d.ChildNode} back to an equivalent {@link d.VNode} in
344
+ * order to use the resulting object in the virtual DOM. The initial object was
345
+ * likely created as part of presenting a public API, so converting it back
346
+ * involved making it 'private' again (hence, `convertToPrivate`).
347
+ *
348
+ * @param node the child node to convert
349
+ * @returns a converted virtual DOM node
350
+ */
351
+ const convertToPrivate = (node) => {
352
+ if (typeof node.vtag === 'function') {
353
+ const vnodeData = Object.assign({}, node.vattrs);
354
+ if (node.vkey) {
355
+ vnodeData.key = node.vkey;
356
+ }
357
+ if (node.vname) {
358
+ vnodeData.name = node.vname;
359
+ }
360
+ return h(node.vtag, vnodeData, ...(node.vchildren || []));
361
+ }
362
+ const vnode = newVNode(node.vtag, node.vtext);
363
+ vnode.$attrs$ = node.vattrs;
364
+ vnode.$children$ = node.vchildren;
365
+ vnode.$key$ = node.vkey;
366
+ vnode.$name$ = node.vname;
367
+ return vnode;
368
+ };
369
+ /**
370
+ * Validates the ordering of attributes on an input element
371
+ *
372
+ * @param inputElm the element to validate
373
+ */
374
+ const validateInputProperties = (inputElm) => {
375
+ const props = Object.keys(inputElm);
376
+ const value = props.indexOf('value');
377
+ if (value === -1) {
378
+ return;
379
+ }
380
+ const typeIndex = props.indexOf('type');
381
+ const minIndex = props.indexOf('min');
382
+ const maxIndex = props.indexOf('max');
383
+ const stepIndex = props.indexOf('step');
384
+ if (value < typeIndex || value < minIndex || value < maxIndex || value < stepIndex) {
385
+ consoleDevWarn(`The "value" prop of <input> should be set after "min", "max", "type" and "step"`);
386
+ }
387
+ };
388
+ const initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
389
+ const endHydrate = createTime('hydrateClient', tagName);
390
+ const shadowRoot = hostElm.shadowRoot;
391
+ const childRenderNodes = [];
392
+ const slotNodes = [];
393
+ const shadowRootNodes = BUILD.shadowDom && shadowRoot ? [] : null;
394
+ const vnode = (hostRef.$vnode$ = newVNode(tagName, null));
395
+ if (!plt.$orgLocNodes$) {
396
+ initializeDocumentHydrate(doc.body, (plt.$orgLocNodes$ = new Map()));
397
+ }
398
+ hostElm[HYDRATE_ID] = hostId;
399
+ hostElm.removeAttribute(HYDRATE_ID);
400
+ clientHydrate(vnode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, hostElm, hostId);
401
+ childRenderNodes.map((c) => {
402
+ const orgLocationId = c.$hostId$ + '.' + c.$nodeId$;
403
+ const orgLocationNode = plt.$orgLocNodes$.get(orgLocationId);
404
+ const node = c.$elm$;
405
+ if (orgLocationNode && supportsShadow && orgLocationNode['s-en'] === '') {
406
+ orgLocationNode.parentNode.insertBefore(node, orgLocationNode.nextSibling);
407
+ }
408
+ if (!shadowRoot) {
409
+ node['s-hn'] = tagName;
410
+ if (orgLocationNode) {
411
+ node['s-ol'] = orgLocationNode;
412
+ node['s-ol']['s-nr'] = node;
413
+ }
414
+ }
415
+ plt.$orgLocNodes$.delete(orgLocationId);
416
+ });
417
+ if (BUILD.shadowDom && shadowRoot) {
418
+ shadowRootNodes.map((shadowRootNode) => {
419
+ if (shadowRootNode) {
420
+ shadowRoot.appendChild(shadowRootNode);
421
+ }
422
+ });
423
+ }
424
+ endHydrate();
425
+ };
426
+ const clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node, hostId) => {
427
+ let childNodeType;
428
+ let childIdSplt;
429
+ let childVNode;
430
+ let i;
431
+ if (node.nodeType === 1 /* NODE_TYPE.ElementNode */) {
432
+ childNodeType = node.getAttribute(HYDRATE_CHILD_ID);
433
+ if (childNodeType) {
434
+ // got the node data from the element's attribute
435
+ // `${hostId}.${nodeId}.${depth}.${index}`
436
+ childIdSplt = childNodeType.split('.');
437
+ if (childIdSplt[0] === hostId || childIdSplt[0] === '0') {
438
+ childVNode = {
439
+ $flags$: 0,
440
+ $hostId$: childIdSplt[0],
441
+ $nodeId$: childIdSplt[1],
442
+ $depth$: childIdSplt[2],
443
+ $index$: childIdSplt[3],
444
+ $tag$: node.tagName.toLowerCase(),
445
+ $elm$: node,
446
+ $attrs$: null,
447
+ $children$: null,
448
+ $key$: null,
449
+ $name$: null,
450
+ $text$: null,
451
+ };
452
+ childRenderNodes.push(childVNode);
453
+ node.removeAttribute(HYDRATE_CHILD_ID);
454
+ // this is a new child vnode
455
+ // so ensure its parent vnode has the vchildren array
456
+ if (!parentVNode.$children$) {
457
+ parentVNode.$children$ = [];
458
+ }
459
+ // add our child vnode to a specific index of the vnode's children
460
+ parentVNode.$children$[childVNode.$index$] = childVNode;
461
+ // this is now the new parent vnode for all the next child checks
462
+ parentVNode = childVNode;
463
+ if (shadowRootNodes && childVNode.$depth$ === '0') {
464
+ shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
465
+ }
466
+ }
467
+ }
468
+ // recursively drill down, end to start so we can remove nodes
469
+ for (i = node.childNodes.length - 1; i >= 0; i--) {
470
+ clientHydrate(parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node.childNodes[i], hostId);
471
+ }
472
+ if (node.shadowRoot) {
473
+ // keep drilling down through the shadow root nodes
474
+ for (i = node.shadowRoot.childNodes.length - 1; i >= 0; i--) {
475
+ clientHydrate(parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node.shadowRoot.childNodes[i], hostId);
476
+ }
477
+ }
478
+ }
479
+ else if (node.nodeType === 8 /* NODE_TYPE.CommentNode */) {
480
+ // `${COMMENT_TYPE}.${hostId}.${nodeId}.${depth}.${index}`
481
+ childIdSplt = node.nodeValue.split('.');
482
+ if (childIdSplt[1] === hostId || childIdSplt[1] === '0') {
483
+ // comment node for either the host id or a 0 host id
484
+ childNodeType = childIdSplt[0];
485
+ childVNode = {
486
+ $flags$: 0,
487
+ $hostId$: childIdSplt[1],
488
+ $nodeId$: childIdSplt[2],
489
+ $depth$: childIdSplt[3],
490
+ $index$: childIdSplt[4],
491
+ $elm$: node,
492
+ $attrs$: null,
493
+ $children$: null,
494
+ $key$: null,
495
+ $name$: null,
496
+ $tag$: null,
497
+ $text$: null,
498
+ };
499
+ if (childNodeType === TEXT_NODE_ID) {
500
+ childVNode.$elm$ = node.nextSibling;
501
+ if (childVNode.$elm$ && childVNode.$elm$.nodeType === 3 /* NODE_TYPE.TextNode */) {
502
+ childVNode.$text$ = childVNode.$elm$.textContent;
503
+ childRenderNodes.push(childVNode);
504
+ // remove the text comment since it's no longer needed
505
+ node.remove();
506
+ if (!parentVNode.$children$) {
507
+ parentVNode.$children$ = [];
508
+ }
509
+ parentVNode.$children$[childVNode.$index$] = childVNode;
510
+ if (shadowRootNodes && childVNode.$depth$ === '0') {
511
+ shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
512
+ }
513
+ }
514
+ }
515
+ else if (childVNode.$hostId$ === hostId) {
516
+ // this comment node is specifically for this host id
517
+ if (childNodeType === SLOT_NODE_ID) {
518
+ // `${SLOT_NODE_ID}.${hostId}.${nodeId}.${depth}.${index}.${slotName}`;
519
+ childVNode.$tag$ = 'slot';
520
+ if (childIdSplt[5]) {
521
+ node['s-sn'] = childVNode.$name$ = childIdSplt[5];
522
+ }
523
+ else {
524
+ node['s-sn'] = '';
525
+ }
526
+ node['s-sr'] = true;
527
+ if (BUILD.shadowDom && shadowRootNodes) {
528
+ // browser support shadowRoot and this is a shadow dom component
529
+ // create an actual slot element
530
+ childVNode.$elm$ = doc.createElement(childVNode.$tag$);
531
+ if (childVNode.$name$) {
532
+ // add the slot name attribute
533
+ childVNode.$elm$.setAttribute('name', childVNode.$name$);
534
+ }
535
+ // insert the new slot element before the slot comment
536
+ node.parentNode.insertBefore(childVNode.$elm$, node);
537
+ // remove the slot comment since it's not needed for shadow
538
+ node.remove();
539
+ if (childVNode.$depth$ === '0') {
540
+ shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
541
+ }
542
+ }
543
+ slotNodes.push(childVNode);
544
+ if (!parentVNode.$children$) {
545
+ parentVNode.$children$ = [];
546
+ }
547
+ parentVNode.$children$[childVNode.$index$] = childVNode;
548
+ }
549
+ else if (childNodeType === CONTENT_REF_ID) {
550
+ // `${CONTENT_REF_ID}.${hostId}`;
551
+ if (BUILD.shadowDom && shadowRootNodes) {
552
+ // remove the content ref comment since it's not needed for shadow
553
+ node.remove();
554
+ }
555
+ else if (BUILD.slotRelocation) {
556
+ hostElm['s-cr'] = node;
557
+ node['s-cn'] = true;
558
+ }
559
+ }
560
+ }
561
+ }
562
+ }
563
+ else if (parentVNode && parentVNode.$tag$ === 'style') {
564
+ const vnode = newVNode(null, node.textContent);
565
+ vnode.$elm$ = node;
566
+ vnode.$index$ = '0';
567
+ parentVNode.$children$ = [vnode];
568
+ }
569
+ };
570
+ const initializeDocumentHydrate = (node, orgLocNodes) => {
571
+ if (node.nodeType === 1 /* NODE_TYPE.ElementNode */) {
572
+ let i = 0;
573
+ for (; i < node.childNodes.length; i++) {
574
+ initializeDocumentHydrate(node.childNodes[i], orgLocNodes);
575
+ }
576
+ if (node.shadowRoot) {
577
+ for (i = 0; i < node.shadowRoot.childNodes.length; i++) {
578
+ initializeDocumentHydrate(node.shadowRoot.childNodes[i], orgLocNodes);
579
+ }
580
+ }
581
+ }
582
+ else if (node.nodeType === 8 /* NODE_TYPE.CommentNode */) {
583
+ const childIdSplt = node.nodeValue.split('.');
584
+ if (childIdSplt[0] === ORG_LOCATION_ID) {
585
+ orgLocNodes.set(childIdSplt[1] + '.' + childIdSplt[2], node);
586
+ node.nodeValue = '';
587
+ // useful to know if the original location is
588
+ // the root light-dom of a shadow dom component
589
+ node['s-en'] = childIdSplt[3];
590
+ }
591
+ }
592
+ };
593
+ // Private
594
+ const computeMode = (elm) => modeResolutionChain.map((h) => h(elm)).find((m) => !!m);
595
+ // Public
596
+ const setMode = (handler) => modeResolutionChain.push(handler);
597
+ const getMode = (ref) => getHostRef(ref).$modeName$;
598
+ /**
599
+ * Parse a new property value for a given property type.
600
+ *
601
+ * While the prop value can reasonably be expected to be of `any` type as far as TypeScript's type checker is concerned,
602
+ * it is not safe to assume that the string returned by evaluating `typeof propValue` matches:
603
+ * 1. `any`, the type given to `propValue` in the function signature
604
+ * 2. the type stored from `propType`.
605
+ *
606
+ * This function provides the capability to parse/coerce a property's value to potentially any other JavaScript type.
607
+ *
608
+ * Property values represented in TSX preserve their type information. In the example below, the number 0 is passed to
609
+ * a component. This `propValue` will preserve its type information (`typeof propValue === 'number'`). Note that is
610
+ * based on the type of the value being passed in, not the type declared of the class member decorated with `@Prop`.
611
+ * ```tsx
612
+ * <my-cmp prop-val={0}></my-cmp>
613
+ * ```
614
+ *
615
+ * HTML prop values on the other hand, will always a string
616
+ *
617
+ * @param propValue the new value to coerce to some type
618
+ * @param propType the type of the prop, expressed as a binary number
619
+ * @returns the parsed/coerced value
620
+ */
621
+ const parsePropertyValue = (propValue, propType) => {
622
+ // ensure this value is of the correct prop type
623
+ if (propValue != null && !isComplexType(propValue)) {
624
+ if (BUILD.propBoolean && propType & 4 /* MEMBER_FLAGS.Boolean */) {
625
+ // per the HTML spec, any string value means it is a boolean true value
626
+ // but we'll cheat here and say that the string "false" is the boolean false
627
+ return propValue === 'false' ? false : propValue === '' || !!propValue;
628
+ }
629
+ if (BUILD.propNumber && propType & 2 /* MEMBER_FLAGS.Number */) {
630
+ // force it to be a number
631
+ return parseFloat(propValue);
632
+ }
633
+ if (BUILD.propString && propType & 1 /* MEMBER_FLAGS.String */) {
634
+ // could have been passed as a number or boolean
635
+ // but we still want it as a string
636
+ return String(propValue);
637
+ }
638
+ // redundant return here for better minification
639
+ return propValue;
640
+ }
641
+ // not sure exactly what type we want
642
+ // so no need to change to a different type
643
+ return propValue;
644
+ };
645
+ const getElement = (ref) => (BUILD.lazyLoad ? getHostRef(ref).$hostElement$ : ref);
646
+ const createEvent = (ref, name, flags) => {
647
+ const elm = getElement(ref);
648
+ return {
649
+ emit: (detail) => {
650
+ if (BUILD.isDev && !elm.isConnected) {
651
+ consoleDevWarn(`The "${name}" event was emitted, but the dispatcher node is no longer connected to the dom.`);
652
+ }
653
+ return emitEvent(elm, name, {
654
+ bubbles: !!(flags & 4 /* EVENT_FLAGS.Bubbles */),
655
+ composed: !!(flags & 2 /* EVENT_FLAGS.Composed */),
656
+ cancelable: !!(flags & 1 /* EVENT_FLAGS.Cancellable */),
657
+ detail,
658
+ });
659
+ },
660
+ };
661
+ };
662
+ /**
663
+ * Helper function to create & dispatch a custom Event on a provided target
664
+ * @param elm the target of the Event
665
+ * @param name the name to give the custom Event
666
+ * @param opts options for configuring a custom Event
667
+ * @returns the custom Event
668
+ */
669
+ const emitEvent = (elm, name, opts) => {
670
+ const ev = plt.ce(name, opts);
671
+ elm.dispatchEvent(ev);
672
+ return ev;
673
+ };
674
+ const rootAppliedStyles = /*@__PURE__*/ new WeakMap();
675
+ const registerStyle = (scopeId, cssText, allowCS) => {
676
+ let style = styles.get(scopeId);
677
+ if (supportsConstructableStylesheets && allowCS) {
678
+ style = (style || new CSSStyleSheet());
679
+ if (typeof style === 'string') {
680
+ style = cssText;
681
+ }
682
+ else {
683
+ style.replaceSync(cssText);
684
+ }
685
+ }
686
+ else {
687
+ style = cssText;
688
+ }
689
+ styles.set(scopeId, style);
690
+ };
691
+ const addStyle = (styleContainerNode, cmpMeta, mode) => {
692
+ var _a;
693
+ const scopeId = getScopeId(cmpMeta, mode);
694
+ const style = styles.get(scopeId);
695
+ if (!BUILD.attachStyles) {
696
+ return scopeId;
697
+ }
698
+ // if an element is NOT connected then getRootNode() will return the wrong root node
699
+ // so the fallback is to always use the document for the root node in those cases
700
+ styleContainerNode = styleContainerNode.nodeType === 11 /* NODE_TYPE.DocumentFragment */ ? styleContainerNode : doc;
701
+ if (style) {
702
+ if (typeof style === 'string') {
703
+ styleContainerNode = styleContainerNode.head || styleContainerNode;
704
+ let appliedStyles = rootAppliedStyles.get(styleContainerNode);
705
+ let styleElm;
706
+ if (!appliedStyles) {
707
+ rootAppliedStyles.set(styleContainerNode, (appliedStyles = new Set()));
708
+ }
709
+ if (!appliedStyles.has(scopeId)) {
710
+ if (BUILD.hydrateClientSide &&
711
+ styleContainerNode.host &&
712
+ (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId}"]`))) {
713
+ // This is only happening on native shadow-dom, do not needs CSS var shim
714
+ styleElm.innerHTML = style;
715
+ }
716
+ else {
717
+ styleElm = doc.createElement('style');
718
+ styleElm.innerHTML = style;
719
+ // Apply CSP nonce to the style tag if it exists
720
+ const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
721
+ if (nonce != null) {
722
+ styleElm.setAttribute('nonce', nonce);
723
+ }
724
+ if (BUILD.hydrateServerSide || BUILD.hotModuleReplacement) {
725
+ styleElm.setAttribute(HYDRATED_STYLE_ID, scopeId);
726
+ }
727
+ styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
728
+ }
729
+ if (appliedStyles) {
730
+ appliedStyles.add(scopeId);
731
+ }
732
+ }
733
+ }
734
+ else if (BUILD.constructableCSS && !styleContainerNode.adoptedStyleSheets.includes(style)) {
735
+ styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
736
+ }
737
+ }
738
+ return scopeId;
739
+ };
740
+ const attachStyles = (hostRef) => {
741
+ const cmpMeta = hostRef.$cmpMeta$;
742
+ const elm = hostRef.$hostElement$;
743
+ const flags = cmpMeta.$flags$;
744
+ const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
745
+ const scopeId = addStyle(BUILD.shadowDom && supportsShadow && elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta, hostRef.$modeName$);
746
+ if ((BUILD.shadowDom || BUILD.scoped) && BUILD.cssAnnotations && flags & 10 /* CMP_FLAGS.needsScopedEncapsulation */) {
747
+ // only required when we're NOT using native shadow dom (slot)
748
+ // or this browser doesn't support native shadow dom
749
+ // and this host element was NOT created with SSR
750
+ // let's pick out the inner content for slot projection
751
+ // create a node to represent where the original
752
+ // content was first placed, which is useful later on
753
+ // DOM WRITE!!
754
+ elm['s-sc'] = scopeId;
755
+ elm.classList.add(scopeId + '-h');
756
+ if (BUILD.scoped && flags & 2 /* CMP_FLAGS.scopedCssEncapsulation */) {
757
+ elm.classList.add(scopeId + '-s');
758
+ }
759
+ }
760
+ endAttachStyles();
761
+ };
762
+ const getScopeId = (cmp, mode) => 'sc-' + (BUILD.mode && mode && cmp.$flags$ & 32 /* CMP_FLAGS.hasMode */ ? cmp.$tagName$ + '-' + mode : cmp.$tagName$);
763
+ const convertScopedToShadow = (css) => css.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g, '$1{');
764
+ /**
765
+ * Production setAccessor() function based on Preact by
766
+ * Jason Miller (@developit)
767
+ * Licensed under the MIT License
768
+ * https://github.com/developit/preact/blob/master/LICENSE
769
+ *
770
+ * Modified for Stencil's compiler and vdom
771
+ */
772
+ /**
773
+ * When running a VDom render set properties present on a VDom node onto the
774
+ * corresponding HTML element.
775
+ *
776
+ * Note that this function has special functionality for the `class`,
777
+ * `style`, `key`, and `ref` attributes, as well as event handlers (like
778
+ * `onClick`, etc). All others are just passed through as-is.
779
+ *
780
+ * @param elm the HTMLElement onto which attributes should be set
781
+ * @param memberName the name of the attribute to set
782
+ * @param oldValue the old value for the attribute
783
+ * @param newValue the new value for the attribute
784
+ * @param isSvg whether we're in an svg context or not
785
+ * @param flags bitflags for Vdom variables
786
+ */
787
+ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
788
+ if (oldValue !== newValue) {
789
+ let isProp = isMemberInElement(elm, memberName);
790
+ let ln = memberName.toLowerCase();
791
+ if (BUILD.vdomClass && memberName === 'class') {
792
+ const classList = elm.classList;
793
+ const oldClasses = parseClassList(oldValue);
794
+ const newClasses = parseClassList(newValue);
795
+ classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
796
+ classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
797
+ }
798
+ else if (BUILD.vdomStyle && memberName === 'style') {
799
+ // update style attribute, css properties and values
800
+ if (BUILD.updatable) {
801
+ for (const prop in oldValue) {
802
+ if (!newValue || newValue[prop] == null) {
803
+ if (!BUILD.hydrateServerSide && prop.includes('-')) {
804
+ elm.style.removeProperty(prop);
805
+ }
806
+ else {
807
+ elm.style[prop] = '';
808
+ }
809
+ }
810
+ }
811
+ }
812
+ for (const prop in newValue) {
813
+ if (!oldValue || newValue[prop] !== oldValue[prop]) {
814
+ if (!BUILD.hydrateServerSide && prop.includes('-')) {
815
+ elm.style.setProperty(prop, newValue[prop]);
816
+ }
817
+ else {
818
+ elm.style[prop] = newValue[prop];
819
+ }
820
+ }
821
+ }
822
+ }
823
+ else if (BUILD.vdomKey && memberName === 'key')
824
+ ;
825
+ else if (BUILD.vdomRef && memberName === 'ref') {
826
+ // minifier will clean this up
827
+ if (newValue) {
828
+ newValue(elm);
829
+ }
830
+ }
831
+ else if (BUILD.vdomListener &&
832
+ (BUILD.lazyLoad ? !isProp : !elm.__lookupSetter__(memberName)) &&
833
+ memberName[0] === 'o' &&
834
+ memberName[1] === 'n') {
835
+ // Event Handlers
836
+ // so if the member name starts with "on" and the 3rd characters is
837
+ // a capital letter, and it's not already a member on the element,
838
+ // then we're assuming it's an event listener
839
+ if (memberName[2] === '-') {
840
+ // on- prefixed events
841
+ // allows to be explicit about the dom event to listen without any magic
842
+ // under the hood:
843
+ // <my-cmp on-click> // listens for "click"
844
+ // <my-cmp on-Click> // listens for "Click"
845
+ // <my-cmp on-ionChange> // listens for "ionChange"
846
+ // <my-cmp on-EVENTS> // listens for "EVENTS"
847
+ memberName = memberName.slice(3);
848
+ }
849
+ else if (isMemberInElement(win, ln)) {
850
+ // standard event
851
+ // the JSX attribute could have been "onMouseOver" and the
852
+ // member name "onmouseover" is on the window's prototype
853
+ // so let's add the listener "mouseover", which is all lowercased
854
+ memberName = ln.slice(2);
855
+ }
856
+ else {
857
+ // custom event
858
+ // the JSX attribute could have been "onMyCustomEvent"
859
+ // so let's trim off the "on" prefix and lowercase the first character
860
+ // and add the listener "myCustomEvent"
861
+ // except for the first character, we keep the event name case
862
+ memberName = ln[2] + memberName.slice(3);
863
+ }
864
+ if (oldValue || newValue) {
865
+ // Need to account for "capture" events.
866
+ // If the event name ends with "Capture", we'll update the name to remove
867
+ // the "Capture" suffix and make sure the event listener is setup to handle the capture event.
868
+ const capture = memberName.endsWith(CAPTURE_EVENT_SUFFIX);
869
+ // Make sure we only replace the last instance of "Capture"
870
+ memberName = memberName.replace(CAPTURE_EVENT_REGEX, '');
871
+ if (oldValue) {
872
+ plt.rel(elm, memberName, oldValue, capture);
873
+ }
874
+ if (newValue) {
875
+ plt.ael(elm, memberName, newValue, capture);
876
+ }
877
+ }
878
+ }
879
+ else if (BUILD.vdomPropOrAttr) {
880
+ // Set property if it exists and it's not a SVG
881
+ const isComplex = isComplexType(newValue);
882
+ if ((isProp || (isComplex && newValue !== null)) && !isSvg) {
883
+ try {
884
+ if (!elm.tagName.includes('-')) {
885
+ const n = newValue == null ? '' : newValue;
886
+ // Workaround for Safari, moving the <input> caret when re-assigning the same valued
887
+ if (memberName === 'list') {
888
+ isProp = false;
889
+ }
890
+ else if (oldValue == null || elm[memberName] != n) {
891
+ elm[memberName] = n;
892
+ }
893
+ }
894
+ else {
895
+ elm[memberName] = newValue;
896
+ }
897
+ }
898
+ catch (e) { }
899
+ }
900
+ /**
901
+ * Need to manually update attribute if:
902
+ * - memberName is not an attribute
903
+ * - if we are rendering the host element in order to reflect attribute
904
+ * - if it's a SVG, since properties might not work in <svg>
905
+ * - if the newValue is null/undefined or 'false'.
906
+ */
907
+ let xlink = false;
908
+ if (BUILD.vdomXlink) {
909
+ if (ln !== (ln = ln.replace(/^xlink\:?/, ''))) {
910
+ memberName = ln;
911
+ xlink = true;
912
+ }
913
+ }
914
+ if (newValue == null || newValue === false) {
915
+ if (newValue !== false || elm.getAttribute(memberName) === '') {
916
+ if (BUILD.vdomXlink && xlink) {
917
+ elm.removeAttributeNS(XLINK_NS, memberName);
918
+ }
919
+ else {
920
+ elm.removeAttribute(memberName);
921
+ }
922
+ }
923
+ }
924
+ else if ((!isProp || flags & 4 /* VNODE_FLAGS.isHost */ || isSvg) && !isComplex) {
925
+ newValue = newValue === true ? '' : newValue;
926
+ if (BUILD.vdomXlink && xlink) {
927
+ elm.setAttributeNS(XLINK_NS, memberName, newValue);
928
+ }
929
+ else {
930
+ elm.setAttribute(memberName, newValue);
931
+ }
932
+ }
933
+ }
934
+ }
935
+ };
936
+ const parseClassListRegex = /\s/;
937
+ const parseClassList = (value) => (!value ? [] : value.split(parseClassListRegex));
938
+ const CAPTURE_EVENT_SUFFIX = 'Capture';
939
+ const CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + '$');
940
+ const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
941
+ // if the element passed in is a shadow root, which is a document fragment
942
+ // then we want to be adding attrs/props to the shadow root's "host" element
943
+ // if it's not a shadow root, then we add attrs/props to the same element
944
+ const elm = newVnode.$elm$.nodeType === 11 /* NODE_TYPE.DocumentFragment */ && newVnode.$elm$.host
945
+ ? newVnode.$elm$.host
946
+ : newVnode.$elm$;
947
+ const oldVnodeAttrs = (oldVnode && oldVnode.$attrs$) || EMPTY_OBJ;
948
+ const newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ;
949
+ if (BUILD.updatable) {
950
+ // remove attributes no longer present on the vnode by setting them to undefined
951
+ for (memberName in oldVnodeAttrs) {
952
+ if (!(memberName in newVnodeAttrs)) {
953
+ setAccessor(elm, memberName, oldVnodeAttrs[memberName], undefined, isSvgMode, newVnode.$flags$);
954
+ }
955
+ }
956
+ }
957
+ // add new & update changed attributes
958
+ for (memberName in newVnodeAttrs) {
959
+ setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode, newVnode.$flags$);
960
+ }
961
+ };
962
+ /**
963
+ * Create a DOM Node corresponding to one of the children of a given VNode.
964
+ *
965
+ * @param oldParentVNode the parent VNode from the previous render
966
+ * @param newParentVNode the parent VNode from the current render
967
+ * @param childIndex the index of the VNode, in the _new_ parent node's
968
+ * children, for which we will create a new DOM node
969
+ * @param parentElm the parent DOM node which our new node will be a child of
970
+ * @returns the newly created node
971
+ */
972
+ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
973
+ var _a;
974
+ // tslint:disable-next-line: prefer-const
975
+ const newVNode = newParentVNode.$children$[childIndex];
976
+ let i = 0;
977
+ let elm;
978
+ let childNode;
979
+ let oldVNode;
980
+ if (BUILD.slotRelocation && !useNativeShadowDom) {
981
+ // remember for later we need to check to relocate nodes
982
+ checkSlotRelocate = true;
983
+ if (newVNode.$tag$ === 'slot') {
984
+ if (scopeId) {
985
+ // scoped css needs to add its scoped id to the parent element
986
+ parentElm.classList.add(scopeId + '-s');
987
+ }
988
+ newVNode.$flags$ |= newVNode.$children$
989
+ ? // slot element has fallback content
990
+ 2 /* VNODE_FLAGS.isSlotFallback */
991
+ : // slot element does not have fallback content
992
+ 1 /* VNODE_FLAGS.isSlotReference */;
993
+ }
994
+ }
995
+ if (BUILD.isDev && newVNode.$elm$) {
996
+ consoleDevError(`The JSX ${newVNode.$text$ !== null ? `"${newVNode.$text$}" text` : `"${newVNode.$tag$}" element`} node should not be shared within the same renderer. The renderer caches element lookups in order to improve performance. However, a side effect from this is that the exact same JSX node should not be reused. For more information please see https://stenciljs.com/docs/templating-jsx#avoid-shared-jsx-nodes`);
997
+ }
998
+ if (BUILD.vdomText && newVNode.$text$ !== null) {
999
+ // create text node
1000
+ elm = newVNode.$elm$ = doc.createTextNode(newVNode.$text$);
1001
+ }
1002
+ else if (BUILD.slotRelocation && newVNode.$flags$ & 1 /* VNODE_FLAGS.isSlotReference */) {
1003
+ // create a slot reference node
1004
+ elm = newVNode.$elm$ =
1005
+ BUILD.isDebug || BUILD.hydrateServerSide ? slotReferenceDebugNode(newVNode) : doc.createTextNode('');
1006
+ }
1007
+ else {
1008
+ if (BUILD.svg && !isSvgMode) {
1009
+ isSvgMode = newVNode.$tag$ === 'svg';
1010
+ }
1011
+ // create element
1012
+ elm = newVNode.$elm$ = (BUILD.svg
1013
+ ? doc.createElementNS(isSvgMode ? SVG_NS : HTML_NS, BUILD.slotRelocation && newVNode.$flags$ & 2 /* VNODE_FLAGS.isSlotFallback */
1014
+ ? 'slot-fb'
1015
+ : newVNode.$tag$)
1016
+ : doc.createElement(BUILD.slotRelocation && newVNode.$flags$ & 2 /* VNODE_FLAGS.isSlotFallback */
1017
+ ? 'slot-fb'
1018
+ : newVNode.$tag$));
1019
+ if (BUILD.svg && isSvgMode && newVNode.$tag$ === 'foreignObject') {
1020
+ isSvgMode = false;
1021
+ }
1022
+ // add css classes, attrs, props, listeners, etc.
1023
+ if (BUILD.vdomAttribute) {
1024
+ updateElement(null, newVNode, isSvgMode);
1025
+ }
1026
+ if ((BUILD.shadowDom || BUILD.scoped) && isDef(scopeId) && elm['s-si'] !== scopeId) {
1027
+ // if there is a scopeId and this is the initial render
1028
+ // then let's add the scopeId as a css class
1029
+ elm.classList.add((elm['s-si'] = scopeId));
1030
+ }
1031
+ if (newVNode.$children$) {
1032
+ for (i = 0; i < newVNode.$children$.length; ++i) {
1033
+ // create the node
1034
+ childNode = createElm(oldParentVNode, newVNode, i, elm);
1035
+ // return node could have been null
1036
+ if (childNode) {
1037
+ // append our new node
1038
+ elm.appendChild(childNode);
1039
+ }
1040
+ }
1041
+ }
1042
+ if (BUILD.svg) {
1043
+ if (newVNode.$tag$ === 'svg') {
1044
+ // Only reset the SVG context when we're exiting <svg> element
1045
+ isSvgMode = false;
1046
+ }
1047
+ else if (elm.tagName === 'foreignObject') {
1048
+ // Reenter SVG context when we're exiting <foreignObject> element
1049
+ isSvgMode = true;
1050
+ }
1051
+ }
1052
+ }
1053
+ if (BUILD.slotRelocation) {
1054
+ elm['s-hn'] = hostTagName;
1055
+ if (newVNode.$flags$ & (2 /* VNODE_FLAGS.isSlotFallback */ | 1 /* VNODE_FLAGS.isSlotReference */)) {
1056
+ // remember the content reference comment
1057
+ elm['s-sr'] = true;
1058
+ // Persist the name of the slot that this slot was going to be projected into.
1059
+ elm['s-fs'] = (_a = newVNode.$attrs$) === null || _a === void 0 ? void 0 : _a.slot;
1060
+ // remember the content reference comment
1061
+ elm['s-cr'] = contentRef;
1062
+ // remember the slot name, or empty string for default slot
1063
+ elm['s-sn'] = newVNode.$name$ || '';
1064
+ // check if we've got an old vnode for this slot
1065
+ oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex];
1066
+ if (oldVNode && oldVNode.$tag$ === newVNode.$tag$ && oldParentVNode.$elm$) {
1067
+ // we've got an old slot vnode and the wrapper is being replaced
1068
+ // so let's move the old slot content back to it's original location
1069
+ putBackInOriginalLocation(oldParentVNode.$elm$, false);
1070
+ }
1071
+ }
1072
+ }
1073
+ return elm;
1074
+ };
1075
+ const putBackInOriginalLocation = (parentElm, recursive) => {
1076
+ var _a;
1077
+ plt.$flags$ |= 1 /* PLATFORM_FLAGS.isTmpDisconnected */;
1078
+ const oldSlotChildNodes = parentElm.childNodes;
1079
+ for (let i = oldSlotChildNodes.length - 1; i >= 0; i--) {
1080
+ const childNode = oldSlotChildNodes[i];
1081
+ if (childNode['s-hn'] !== hostTagName && childNode['s-ol']) {
1082
+ // // this child node in the old element is from another component
1083
+ // // remove this node from the old slot's parent
1084
+ // childNode.remove();
1085
+ // and relocate it back to it's original location
1086
+ parentReferenceNode(childNode).insertBefore(childNode, referenceNode(childNode));
1087
+ // remove the old original location comment entirely
1088
+ // later on the patch function will know what to do
1089
+ // and move this to the correct spot if need be
1090
+ childNode['s-ol'].remove();
1091
+ childNode['s-ol'] = undefined;
1092
+ // Reset so we can correctly move the node around again.
1093
+ childNode['s-sh'] = undefined;
1094
+ // When putting an element node back in its original location,
1095
+ // we need to reset the `slot` attribute back to the value it originally had
1096
+ // so we can correctly relocate it again in the future
1097
+ if (childNode.nodeType === 1 /* NODE_TYPE.ElementNode */) {
1098
+ childNode.setAttribute('slot', (_a = childNode['s-sn']) !== null && _a !== void 0 ? _a : '');
1099
+ }
1100
+ checkSlotRelocate = true;
1101
+ }
1102
+ if (recursive) {
1103
+ putBackInOriginalLocation(childNode, recursive);
1104
+ }
1105
+ }
1106
+ plt.$flags$ &= ~1 /* PLATFORM_FLAGS.isTmpDisconnected */;
1107
+ };
1108
+ /**
1109
+ * Create DOM nodes corresponding to a list of {@link d.Vnode} objects and
1110
+ * add them to the DOM in the appropriate place.
1111
+ *
1112
+ * @param parentElm the DOM node which should be used as a parent for the new
1113
+ * DOM nodes
1114
+ * @param before a child of the `parentElm` which the new children should be
1115
+ * inserted before (optional)
1116
+ * @param parentVNode the parent virtual DOM node
1117
+ * @param vnodes the new child virtual DOM nodes to produce DOM nodes for
1118
+ * @param startIdx the index in the child virtual DOM nodes at which to start
1119
+ * creating DOM nodes (inclusive)
1120
+ * @param endIdx the index in the child virtual DOM nodes at which to stop
1121
+ * creating DOM nodes (inclusive)
1122
+ */
1123
+ const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
1124
+ let containerElm = ((BUILD.slotRelocation && parentElm['s-cr'] && parentElm['s-cr'].parentNode) || parentElm);
1125
+ let childNode;
1126
+ if (BUILD.shadowDom && containerElm.shadowRoot && containerElm.tagName === hostTagName) {
1127
+ containerElm = containerElm.shadowRoot;
1128
+ }
1129
+ for (; startIdx <= endIdx; ++startIdx) {
1130
+ if (vnodes[startIdx]) {
1131
+ childNode = createElm(null, parentVNode, startIdx, parentElm);
1132
+ if (childNode) {
1133
+ vnodes[startIdx].$elm$ = childNode;
1134
+ containerElm.insertBefore(childNode, BUILD.slotRelocation ? referenceNode(before) : before);
1135
+ }
1136
+ }
1137
+ }
1138
+ };
1139
+ /**
1140
+ * Remove the DOM elements corresponding to a list of {@link d.VNode} objects.
1141
+ * This can be used to, for instance, clean up after a list of children which
1142
+ * should no longer be shown.
1143
+ *
1144
+ * This function also handles some of Stencil's slot relocation logic.
1145
+ *
1146
+ * @param vnodes a list of virtual DOM nodes to remove
1147
+ * @param startIdx the index at which to start removing nodes (inclusive)
1148
+ * @param endIdx the index at which to stop removing nodes (inclusive)
1149
+ */
1150
+ const removeVnodes = (vnodes, startIdx, endIdx) => {
1151
+ for (let index = startIdx; index <= endIdx; ++index) {
1152
+ const vnode = vnodes[index];
1153
+ if (vnode) {
1154
+ const elm = vnode.$elm$;
1155
+ nullifyVNodeRefs(vnode);
1156
+ if (elm) {
1157
+ if (BUILD.slotRelocation) {
1158
+ // we're removing this element
1159
+ // so it's possible we need to show slot fallback content now
1160
+ checkSlotFallbackVisibility = true;
1161
+ if (elm['s-ol']) {
1162
+ // remove the original location comment
1163
+ elm['s-ol'].remove();
1164
+ }
1165
+ else {
1166
+ // it's possible that child nodes of the node
1167
+ // that's being removed are slot nodes
1168
+ putBackInOriginalLocation(elm, true);
1169
+ }
1170
+ }
1171
+ // remove the vnode's element from the dom
1172
+ elm.remove();
1173
+ }
1174
+ }
1175
+ }
1176
+ };
1177
+ /**
1178
+ * Reconcile the children of a new VNode with the children of an old VNode by
1179
+ * traversing the two collections of children, identifying nodes that are
1180
+ * conserved or changed, calling out to `patch` to make any necessary
1181
+ * updates to the DOM, and rearranging DOM nodes as needed.
1182
+ *
1183
+ * The algorithm for reconciling children works by analyzing two 'windows' onto
1184
+ * the two arrays of children (`oldCh` and `newCh`). We keep track of the
1185
+ * 'windows' by storing start and end indices and references to the
1186
+ * corresponding array entries. Initially the two 'windows' are basically equal
1187
+ * to the entire array, but we progressively narrow the windows until there are
1188
+ * no children left to update by doing the following:
1189
+ *
1190
+ * 1. Skip any `null` entries at the beginning or end of the two arrays, so
1191
+ * that if we have an initial array like the following we'll end up dealing
1192
+ * only with a window bounded by the highlighted elements:
1193
+ *
1194
+ * [null, null, VNode1 , ... , VNode2, null, null]
1195
+ * ^^^^^^ ^^^^^^
1196
+ *
1197
+ * 2. Check to see if the elements at the head and tail positions are equal
1198
+ * across the windows. This will basically detect elements which haven't
1199
+ * been added, removed, or changed position, i.e. if you had the following
1200
+ * VNode elements (represented as HTML):
1201
+ *
1202
+ * oldVNode: `<div><p><span>HEY</span></p></div>`
1203
+ * newVNode: `<div><p><span>THERE</span></p></div>`
1204
+ *
1205
+ * Then when comparing the children of the `<div>` tag we check the equality
1206
+ * of the VNodes corresponding to the `<p>` tags and, since they are the
1207
+ * same tag in the same position, we'd be able to avoid completely
1208
+ * re-rendering the subtree under them with a new DOM element and would just
1209
+ * call out to `patch` to handle reconciling their children and so on.
1210
+ *
1211
+ * 3. Check, for both windows, to see if the element at the beginning of the
1212
+ * window corresponds to the element at the end of the other window. This is
1213
+ * a heuristic which will let us identify _some_ situations in which
1214
+ * elements have changed position, for instance it _should_ detect that the
1215
+ * children nodes themselves have not changed but merely moved in the
1216
+ * following example:
1217
+ *
1218
+ * oldVNode: `<div><element-one /><element-two /></div>`
1219
+ * newVNode: `<div><element-two /><element-one /></div>`
1220
+ *
1221
+ * If we find cases like this then we also need to move the concrete DOM
1222
+ * elements corresponding to the moved children to write the re-order to the
1223
+ * DOM.
1224
+ *
1225
+ * 4. Finally, if VNodes have the `key` attribute set on them we check for any
1226
+ * nodes in the old children which have the same key as the first element in
1227
+ * our window on the new children. If we find such a node we handle calling
1228
+ * out to `patch`, moving relevant DOM nodes, and so on, in accordance with
1229
+ * what we find.
1230
+ *
1231
+ * Finally, once we've narrowed our 'windows' to the point that either of them
1232
+ * collapse (i.e. they have length 0) we then handle any remaining VNode
1233
+ * insertion or deletion that needs to happen to get a DOM state that correctly
1234
+ * reflects the new child VNodes. If, for instance, after our window on the old
1235
+ * children has collapsed we still have more nodes on the new children that
1236
+ * we haven't dealt with yet then we need to add them, or if the new children
1237
+ * collapse but we still have unhandled _old_ children then we need to make
1238
+ * sure the corresponding DOM nodes are removed.
1239
+ *
1240
+ * @param parentElm the node into which the parent VNode is rendered
1241
+ * @param oldCh the old children of the parent node
1242
+ * @param newVNode the new VNode which will replace the parent
1243
+ * @param newCh the new children of the parent node
1244
+ */
1245
+ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
1246
+ let oldStartIdx = 0;
1247
+ let newStartIdx = 0;
1248
+ let idxInOld = 0;
1249
+ let i = 0;
1250
+ let oldEndIdx = oldCh.length - 1;
1251
+ let oldStartVnode = oldCh[0];
1252
+ let oldEndVnode = oldCh[oldEndIdx];
1253
+ let newEndIdx = newCh.length - 1;
1254
+ let newStartVnode = newCh[0];
1255
+ let newEndVnode = newCh[newEndIdx];
1256
+ let node;
1257
+ let elmToMove;
1258
+ while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
1259
+ if (oldStartVnode == null) {
1260
+ // VNode might have been moved left
1261
+ oldStartVnode = oldCh[++oldStartIdx];
1262
+ }
1263
+ else if (oldEndVnode == null) {
1264
+ oldEndVnode = oldCh[--oldEndIdx];
1265
+ }
1266
+ else if (newStartVnode == null) {
1267
+ newStartVnode = newCh[++newStartIdx];
1268
+ }
1269
+ else if (newEndVnode == null) {
1270
+ newEndVnode = newCh[--newEndIdx];
1271
+ }
1272
+ else if (isSameVnode(oldStartVnode, newStartVnode)) {
1273
+ // if the start nodes are the same then we should patch the new VNode
1274
+ // onto the old one, and increment our `newStartIdx` and `oldStartIdx`
1275
+ // indices to reflect that. We don't need to move any DOM Nodes around
1276
+ // since things are matched up in order.
1277
+ patch(oldStartVnode, newStartVnode);
1278
+ oldStartVnode = oldCh[++oldStartIdx];
1279
+ newStartVnode = newCh[++newStartIdx];
1280
+ }
1281
+ else if (isSameVnode(oldEndVnode, newEndVnode)) {
1282
+ // likewise, if the end nodes are the same we patch new onto old and
1283
+ // decrement our end indices, and also likewise in this case we don't
1284
+ // need to move any DOM Nodes.
1285
+ patch(oldEndVnode, newEndVnode);
1286
+ oldEndVnode = oldCh[--oldEndIdx];
1287
+ newEndVnode = newCh[--newEndIdx];
1288
+ }
1289
+ else if (isSameVnode(oldStartVnode, newEndVnode)) {
1290
+ // case: "Vnode moved right"
1291
+ //
1292
+ // We've found that the last node in our window on the new children is
1293
+ // the same VNode as the _first_ node in our window on the old children
1294
+ // we're dealing with now. Visually, this is the layout of these two
1295
+ // nodes:
1296
+ //
1297
+ // newCh: [..., newStartVnode , ... , newEndVnode , ...]
1298
+ // ^^^^^^^^^^^
1299
+ // oldCh: [..., oldStartVnode , ... , oldEndVnode , ...]
1300
+ // ^^^^^^^^^^^^^
1301
+ //
1302
+ // In this situation we need to patch `newEndVnode` onto `oldStartVnode`
1303
+ // and move the DOM element for `oldStartVnode`.
1304
+ if (BUILD.slotRelocation && (oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
1305
+ putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
1306
+ }
1307
+ patch(oldStartVnode, newEndVnode);
1308
+ // We need to move the element for `oldStartVnode` into a position which
1309
+ // will be appropriate for `newEndVnode`. For this we can use
1310
+ // `.insertBefore` and `oldEndVnode.$elm$.nextSibling`. If there is a
1311
+ // sibling for `oldEndVnode.$elm$` then we want to move the DOM node for
1312
+ // `oldStartVnode` between `oldEndVnode` and it's sibling, like so:
1313
+ //
1314
+ // <old-start-node />
1315
+ // <some-intervening-node />
1316
+ // <old-end-node />
1317
+ // <!-- -> <-- `oldStartVnode.$elm$` should be inserted here
1318
+ // <next-sibling />
1319
+ //
1320
+ // If instead `oldEndVnode.$elm$` has no sibling then we just want to put
1321
+ // the node for `oldStartVnode` at the end of the children of
1322
+ // `parentElm`. Luckily, `Node.nextSibling` will return `null` if there
1323
+ // aren't any siblings, and passing `null` to `Node.insertBefore` will
1324
+ // append it to the children of the parent element.
1325
+ parentElm.insertBefore(oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
1326
+ oldStartVnode = oldCh[++oldStartIdx];
1327
+ newEndVnode = newCh[--newEndIdx];
1328
+ }
1329
+ else if (isSameVnode(oldEndVnode, newStartVnode)) {
1330
+ // case: "Vnode moved left"
1331
+ //
1332
+ // We've found that the first node in our window on the new children is
1333
+ // the same VNode as the _last_ node in our window on the old children.
1334
+ // Visually, this is the layout of these two nodes:
1335
+ //
1336
+ // newCh: [..., newStartVnode , ... , newEndVnode , ...]
1337
+ // ^^^^^^^^^^^^^
1338
+ // oldCh: [..., oldStartVnode , ... , oldEndVnode , ...]
1339
+ // ^^^^^^^^^^^
1340
+ //
1341
+ // In this situation we need to patch `newStartVnode` onto `oldEndVnode`
1342
+ // (which will handle updating any changed attributes, reconciling their
1343
+ // children etc) but we also need to move the DOM node to which
1344
+ // `oldEndVnode` corresponds.
1345
+ if (BUILD.slotRelocation && (oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
1346
+ putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
1347
+ }
1348
+ patch(oldEndVnode, newStartVnode);
1349
+ // We've already checked above if `oldStartVnode` and `newStartVnode` are
1350
+ // the same node, so since we're here we know that they are not. Thus we
1351
+ // can move the element for `oldEndVnode` _before_ the element for
1352
+ // `oldStartVnode`, leaving `oldStartVnode` to be reconciled in the
1353
+ // future.
1354
+ parentElm.insertBefore(oldEndVnode.$elm$, oldStartVnode.$elm$);
1355
+ oldEndVnode = oldCh[--oldEndIdx];
1356
+ newStartVnode = newCh[++newStartIdx];
1357
+ }
1358
+ else {
1359
+ // Here we do some checks to match up old and new nodes based on the
1360
+ // `$key$` attribute, which is set by putting a `key="my-key"` attribute
1361
+ // in the JSX for a DOM element in the implementation of a Stencil
1362
+ // component.
1363
+ //
1364
+ // First we check to see if there are any nodes in the array of old
1365
+ // children which have the same key as the first node in the new
1366
+ // children.
1367
+ idxInOld = -1;
1368
+ if (BUILD.vdomKey) {
1369
+ for (i = oldStartIdx; i <= oldEndIdx; ++i) {
1370
+ if (oldCh[i] && oldCh[i].$key$ !== null && oldCh[i].$key$ === newStartVnode.$key$) {
1371
+ idxInOld = i;
1372
+ break;
1373
+ }
1374
+ }
1375
+ }
1376
+ if (BUILD.vdomKey && idxInOld >= 0) {
1377
+ // We found a node in the old children which matches up with the first
1378
+ // node in the new children! So let's deal with that
1379
+ elmToMove = oldCh[idxInOld];
1380
+ if (elmToMove.$tag$ !== newStartVnode.$tag$) {
1381
+ // the tag doesn't match so we'll need a new DOM element
1382
+ node = createElm(oldCh && oldCh[newStartIdx], newVNode, idxInOld, parentElm);
1383
+ }
1384
+ else {
1385
+ patch(elmToMove, newStartVnode);
1386
+ // invalidate the matching old node so that we won't try to update it
1387
+ // again later on
1388
+ oldCh[idxInOld] = undefined;
1389
+ node = elmToMove.$elm$;
1390
+ }
1391
+ newStartVnode = newCh[++newStartIdx];
1392
+ }
1393
+ else {
1394
+ // We either didn't find an element in the old children that matches
1395
+ // the key of the first new child OR the build is not using `key`
1396
+ // attributes at all. In either case we need to create a new element
1397
+ // for the new node.
1398
+ node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx, parentElm);
1399
+ newStartVnode = newCh[++newStartIdx];
1400
+ }
1401
+ if (node) {
1402
+ // if we created a new node then handle inserting it to the DOM
1403
+ if (BUILD.slotRelocation) {
1404
+ parentReferenceNode(oldStartVnode.$elm$).insertBefore(node, referenceNode(oldStartVnode.$elm$));
1405
+ }
1406
+ else {
1407
+ oldStartVnode.$elm$.parentNode.insertBefore(node, oldStartVnode.$elm$);
1408
+ }
1409
+ }
1410
+ }
1411
+ }
1412
+ if (oldStartIdx > oldEndIdx) {
1413
+ // we have some more new nodes to add which don't match up with old nodes
1414
+ addVnodes(parentElm, newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$, newVNode, newCh, newStartIdx, newEndIdx);
1415
+ }
1416
+ else if (BUILD.updatable && newStartIdx > newEndIdx) {
1417
+ // there are nodes in the `oldCh` array which no longer correspond to nodes
1418
+ // in the new array, so lets remove them (which entails cleaning up the
1419
+ // relevant DOM nodes)
1420
+ removeVnodes(oldCh, oldStartIdx, oldEndIdx);
1421
+ }
1422
+ };
1423
+ /**
1424
+ * Compare two VNodes to determine if they are the same
1425
+ *
1426
+ * **NB**: This function is an equality _heuristic_ based on the available
1427
+ * information set on the two VNodes and can be misleading under certain
1428
+ * circumstances. In particular, if the two nodes do not have `key` attrs
1429
+ * (available under `$key$` on VNodes) then the function falls back on merely
1430
+ * checking that they have the same tag.
1431
+ *
1432
+ * So, in other words, if `key` attrs are not set on VNodes which may be
1433
+ * changing order within a `children` array or something along those lines then
1434
+ * we could obtain a false negative and then have to do needless re-rendering
1435
+ * (i.e. we'd say two VNodes aren't equal when in fact they should be).
1436
+ *
1437
+ * @param leftVNode the first VNode to check
1438
+ * @param rightVNode the second VNode to check
1439
+ * @returns whether they're equal or not
1440
+ */
1441
+ const isSameVnode = (leftVNode, rightVNode) => {
1442
+ // compare if two vnode to see if they're "technically" the same
1443
+ // need to have the same element tag, and same key to be the same
1444
+ if (leftVNode.$tag$ === rightVNode.$tag$) {
1445
+ if (BUILD.slotRelocation && leftVNode.$tag$ === 'slot') {
1446
+ return leftVNode.$name$ === rightVNode.$name$;
1447
+ }
1448
+ // this will be set if components in the build have `key` attrs set on them
1449
+ if (BUILD.vdomKey) {
1450
+ return leftVNode.$key$ === rightVNode.$key$;
1451
+ }
1452
+ return true;
1453
+ }
1454
+ return false;
1455
+ };
1456
+ const referenceNode = (node) => {
1457
+ // this node was relocated to a new location in the dom
1458
+ // because of some other component's slot
1459
+ // but we still have an html comment in place of where
1460
+ // it's original location was according to it's original vdom
1461
+ return (node && node['s-ol']) || node;
1462
+ };
1463
+ const parentReferenceNode = (node) => (node['s-ol'] ? node['s-ol'] : node).parentNode;
1464
+ /**
1465
+ * Handle reconciling an outdated VNode with a new one which corresponds to
1466
+ * it. This function handles flushing updates to the DOM and reconciling the
1467
+ * children of the two nodes (if any).
1468
+ *
1469
+ * @param oldVNode an old VNode whose DOM element and children we want to update
1470
+ * @param newVNode a new VNode representing an updated version of the old one
1471
+ */
1472
+ const patch = (oldVNode, newVNode) => {
1473
+ const elm = (newVNode.$elm$ = oldVNode.$elm$);
1474
+ const oldChildren = oldVNode.$children$;
1475
+ const newChildren = newVNode.$children$;
1476
+ const tag = newVNode.$tag$;
1477
+ const text = newVNode.$text$;
1478
+ let defaultHolder;
1479
+ if (!BUILD.vdomText || text === null) {
1480
+ if (BUILD.svg) {
1481
+ // test if we're rendering an svg element, or still rendering nodes inside of one
1482
+ // only add this to the when the compiler sees we're using an svg somewhere
1483
+ isSvgMode = tag === 'svg' ? true : tag === 'foreignObject' ? false : isSvgMode;
1484
+ }
1485
+ if (BUILD.vdomAttribute || BUILD.reflect) {
1486
+ if (BUILD.slot && tag === 'slot')
1487
+ ;
1488
+ else {
1489
+ // either this is the first render of an element OR it's an update
1490
+ // AND we already know it's possible it could have changed
1491
+ // this updates the element's css classes, attrs, props, listeners, etc.
1492
+ updateElement(oldVNode, newVNode, isSvgMode);
1493
+ }
1494
+ }
1495
+ if (BUILD.updatable && oldChildren !== null && newChildren !== null) {
1496
+ // looks like there's child vnodes for both the old and new vnodes
1497
+ // so we need to call `updateChildren` to reconcile them
1498
+ updateChildren(elm, oldChildren, newVNode, newChildren);
1499
+ }
1500
+ else if (newChildren !== null) {
1501
+ // no old child vnodes, but there are new child vnodes to add
1502
+ if (BUILD.updatable && BUILD.vdomText && oldVNode.$text$ !== null) {
1503
+ // the old vnode was text, so be sure to clear it out
1504
+ elm.textContent = '';
1505
+ }
1506
+ // add the new vnode children
1507
+ addVnodes(elm, null, newVNode, newChildren, 0, newChildren.length - 1);
1508
+ }
1509
+ else if (BUILD.updatable && oldChildren !== null) {
1510
+ // no new child vnodes, but there are old child vnodes to remove
1511
+ removeVnodes(oldChildren, 0, oldChildren.length - 1);
1512
+ }
1513
+ if (BUILD.svg && isSvgMode && tag === 'svg') {
1514
+ isSvgMode = false;
1515
+ }
1516
+ }
1517
+ else if (BUILD.vdomText && BUILD.slotRelocation && (defaultHolder = elm['s-cr'])) {
1518
+ // this element has slotted content
1519
+ defaultHolder.parentNode.textContent = text;
1520
+ }
1521
+ else if (BUILD.vdomText && oldVNode.$text$ !== text) {
1522
+ // update the text content for the text only vnode
1523
+ // and also only if the text is different than before
1524
+ elm.data = text;
1525
+ }
1526
+ };
1527
+ /**
1528
+ * Adjust the `.hidden` property as-needed on any nodes in a DOM subtree which
1529
+ * are slot fallbacks nodes.
1530
+ *
1531
+ * A slot fallback node should be visible by default. Then, it should be
1532
+ * conditionally hidden if:
1533
+ *
1534
+ * - it has a sibling with a `slot` property set to its slot name or if
1535
+ * - it is a default fallback slot node, in which case we hide if it has any
1536
+ * content
1537
+ *
1538
+ * @param elm the element of interest
1539
+ */
1540
+ const updateFallbackSlotVisibility = (elm) => {
1541
+ const childNodes = elm.childNodes;
1542
+ for (const childNode of childNodes) {
1543
+ if (childNode.nodeType === 1 /* NODE_TYPE.ElementNode */) {
1544
+ if (childNode['s-sr']) {
1545
+ // this is a slot fallback node
1546
+ // get the slot name for this slot reference node
1547
+ const slotName = childNode['s-sn'];
1548
+ // by default always show a fallback slot node
1549
+ // then hide it if there are other slots in the light dom
1550
+ childNode.hidden = false;
1551
+ // we need to check all of its sibling nodes in order to see if
1552
+ // `childNode` should be hidden
1553
+ for (const siblingNode of childNodes) {
1554
+ // Don't check the node against itself
1555
+ if (siblingNode !== childNode) {
1556
+ if (siblingNode['s-hn'] !== childNode['s-hn'] || slotName !== '') {
1557
+ // this sibling node is from a different component OR is a named
1558
+ // fallback slot node
1559
+ if (siblingNode.nodeType === 1 /* NODE_TYPE.ElementNode */ &&
1560
+ (slotName === siblingNode.getAttribute('slot') || slotName === siblingNode['s-sn'])) {
1561
+ childNode.hidden = true;
1562
+ break;
1563
+ }
1564
+ }
1565
+ else {
1566
+ // this is a default fallback slot node
1567
+ // any element or text node (with content)
1568
+ // should hide the default fallback slot node
1569
+ if (siblingNode.nodeType === 1 /* NODE_TYPE.ElementNode */ ||
1570
+ (siblingNode.nodeType === 3 /* NODE_TYPE.TextNode */ && siblingNode.textContent.trim() !== '')) {
1571
+ childNode.hidden = true;
1572
+ break;
1573
+ }
1574
+ }
1575
+ }
1576
+ }
1577
+ }
1578
+ // keep drilling down
1579
+ updateFallbackSlotVisibility(childNode);
1580
+ }
1581
+ }
1582
+ };
1583
+ /**
1584
+ * Component-global information about nodes which are either currently being
1585
+ * relocated or will be shortly.
1586
+ */
1587
+ const relocateNodes = [];
1588
+ /**
1589
+ * Mark the contents of a slot for relocation via adding references to them to
1590
+ * the {@link relocateNodes} data structure. The actual work of relocating them
1591
+ * will then be handled in {@link renderVdom}.
1592
+ *
1593
+ * @param elm a render node whose child nodes need to be relocated
1594
+ */
1595
+ const markSlotContentForRelocation = (elm) => {
1596
+ // tslint:disable-next-line: prefer-const
1597
+ let node;
1598
+ let hostContentNodes;
1599
+ let j;
1600
+ for (const childNode of elm.childNodes) {
1601
+ // we need to find child nodes which are slot references so we can then try
1602
+ // to match them up with nodes that need to be relocated
1603
+ if (childNode['s-sr'] && (node = childNode['s-cr']) && node.parentNode) {
1604
+ // first get the content reference comment node ('s-cr'), then we get
1605
+ // its parent, which is where all the host content is now
1606
+ hostContentNodes = node.parentNode.childNodes;
1607
+ const slotName = childNode['s-sn'];
1608
+ // iterate through all the nodes under the location where the host was
1609
+ // originally rendered
1610
+ for (j = hostContentNodes.length - 1; j >= 0; j--) {
1611
+ node = hostContentNodes[j];
1612
+ // check that the node is not a content reference node or a node
1613
+ // reference and then check that the host name does not match that of
1614
+ // childNode.
1615
+ // In addition, check that the slot either has not already been relocated, or
1616
+ // that its current location's host is not childNode's host. This is essentially
1617
+ // a check so that we don't try to relocate (and then hide) a node that is already
1618
+ // where it should be.
1619
+ if (!node['s-cn'] &&
1620
+ !node['s-nr'] &&
1621
+ node['s-hn'] !== childNode['s-hn'] &&
1622
+ (!BUILD.experimentalSlotFixes || !node['s-sh'] || node['s-sh'] !== childNode['s-hn'])) {
1623
+ // if `node` is located in the slot that `childNode` refers to (via the
1624
+ // `'s-sn'` property) then we need to relocate it from it's current spot
1625
+ // (under the host element parent) to the right slot location
1626
+ if (isNodeLocatedInSlot(node, slotName)) {
1627
+ // it's possible we've already decided to relocate this node
1628
+ let relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
1629
+ // made some changes to slots
1630
+ // let's make sure we also double check
1631
+ // fallbacks are correctly hidden or shown
1632
+ checkSlotFallbackVisibility = true;
1633
+ // ensure that the slot-name attr is correct
1634
+ node['s-sn'] = node['s-sn'] || slotName;
1635
+ if (relocateNodeData) {
1636
+ relocateNodeData.$nodeToRelocate$['s-sh'] = childNode['s-hn'];
1637
+ // we marked this node for relocation previously but didn't find
1638
+ // out the slot reference node to which it needs to be relocated
1639
+ // so write it down now!
1640
+ relocateNodeData.$slotRefNode$ = childNode;
1641
+ }
1642
+ else {
1643
+ node['s-sh'] = childNode['s-hn'];
1644
+ // add to our list of nodes to relocate
1645
+ relocateNodes.push({
1646
+ $slotRefNode$: childNode,
1647
+ $nodeToRelocate$: node,
1648
+ });
1649
+ }
1650
+ if (node['s-sr']) {
1651
+ relocateNodes.map((relocateNode) => {
1652
+ if (isNodeLocatedInSlot(relocateNode.$nodeToRelocate$, node['s-sn'])) {
1653
+ relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
1654
+ if (relocateNodeData && !relocateNode.$slotRefNode$) {
1655
+ relocateNode.$slotRefNode$ = relocateNodeData.$slotRefNode$;
1656
+ }
1657
+ }
1658
+ });
1659
+ }
1660
+ }
1661
+ else if (!relocateNodes.some((r) => r.$nodeToRelocate$ === node)) {
1662
+ // the node is not found within the slot (`childNode`) that we're
1663
+ // currently looking at, so we stick it into `relocateNodes` to
1664
+ // handle later. If we never find a home for this element then
1665
+ // we'll need to hide it
1666
+ relocateNodes.push({
1667
+ $nodeToRelocate$: node,
1668
+ });
1669
+ }
1670
+ }
1671
+ }
1672
+ }
1673
+ // if we're dealing with any type of element (capable of itself being a
1674
+ // slot reference or containing one) then we recur
1675
+ if (childNode.nodeType === 1 /* NODE_TYPE.ElementNode */) {
1676
+ markSlotContentForRelocation(childNode);
1677
+ }
1678
+ }
1679
+ };
1680
+ /**
1681
+ * Check whether a node is located in a given named slot.
1682
+ *
1683
+ * @param nodeToRelocate the node of interest
1684
+ * @param slotName the slot name to check
1685
+ * @returns whether the node is located in the slot or not
1686
+ */
1687
+ const isNodeLocatedInSlot = (nodeToRelocate, slotName) => {
1688
+ if (nodeToRelocate.nodeType === 1 /* NODE_TYPE.ElementNode */) {
1689
+ if (nodeToRelocate.getAttribute('slot') === null && slotName === '') {
1690
+ // if the node doesn't have a slot attribute, and the slot we're checking
1691
+ // is not a named slot, then we assume the node should be within the slot
1692
+ return true;
1693
+ }
1694
+ if (nodeToRelocate.getAttribute('slot') === slotName) {
1695
+ return true;
1696
+ }
1697
+ return false;
1698
+ }
1699
+ if (nodeToRelocate['s-sn'] === slotName) {
1700
+ return true;
1701
+ }
1702
+ return slotName === '';
1703
+ };
1704
+ /**
1705
+ * 'Nullify' any VDom `ref` callbacks on a VDom node or its children by calling
1706
+ * them with `null`. This signals that the DOM element corresponding to the VDom
1707
+ * node has been removed from the DOM.
1708
+ *
1709
+ * @param vNode a virtual DOM node
1710
+ */
1711
+ const nullifyVNodeRefs = (vNode) => {
1712
+ if (BUILD.vdomRef) {
1713
+ vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
1714
+ vNode.$children$ && vNode.$children$.map(nullifyVNodeRefs);
1715
+ }
1716
+ };
1717
+ /**
1718
+ * The main entry point for Stencil's virtual DOM-based rendering engine
1719
+ *
1720
+ * Given a {@link d.HostRef} container and some virtual DOM nodes, this
1721
+ * function will handle creating a virtual DOM tree with a single root, patching
1722
+ * the current virtual DOM tree onto an old one (if any), dealing with slot
1723
+ * relocation, and reflecting attributes.
1724
+ *
1725
+ * @param hostRef data needed to root and render the virtual DOM tree, such as
1726
+ * the DOM node into which it should be rendered.
1727
+ * @param renderFnResults the virtual DOM nodes to be rendered
1728
+ * @param isInitialLoad whether or not this is the first call after page load
1729
+ */
1730
+ const renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
1731
+ var _a, _b;
1732
+ const hostElm = hostRef.$hostElement$;
1733
+ const cmpMeta = hostRef.$cmpMeta$;
1734
+ const oldVNode = hostRef.$vnode$ || newVNode(null, null);
1735
+ // if `renderFnResults` is a Host node then we can use it directly. If not,
1736
+ // we need to call `h` again to wrap the children of our component in a
1737
+ // 'dummy' Host node (well, an empty vnode) since `renderVdom` assumes
1738
+ // implicitly that the top-level vdom node is 1) an only child and 2)
1739
+ // contains attrs that need to be set on the host element.
1740
+ const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
1741
+ hostTagName = hostElm.tagName;
1742
+ // <Host> runtime check
1743
+ if (BUILD.isDev && Array.isArray(renderFnResults) && renderFnResults.some(isHost)) {
1744
+ throw new Error(`The <Host> must be the single root component.
1745
+ Looks like the render() function of "${hostTagName.toLowerCase()}" is returning an array that contains the <Host>.
1746
+
1747
+ The render() function should look like this instead:
1748
+
1749
+ render() {
1750
+ // Do not return an array
1751
+ return (
1752
+ <Host>{content}</Host>
1753
+ );
1754
+ }
1755
+ `);
1756
+ }
1757
+ if (BUILD.reflect && cmpMeta.$attrsToReflect$) {
1758
+ rootVnode.$attrs$ = rootVnode.$attrs$ || {};
1759
+ cmpMeta.$attrsToReflect$.map(([propName, attribute]) => (rootVnode.$attrs$[attribute] = hostElm[propName]));
1760
+ }
1761
+ // On the first render and *only* on the first render we want to check for
1762
+ // any attributes set on the host element which are also set on the vdom
1763
+ // node. If we find them, we override the value on the VDom node attrs with
1764
+ // the value from the host element, which allows developers building apps
1765
+ // with Stencil components to override e.g. the `role` attribute on a
1766
+ // component even if it's already set on the `Host`.
1767
+ if (isInitialLoad && rootVnode.$attrs$) {
1768
+ for (const key of Object.keys(rootVnode.$attrs$)) {
1769
+ // We have a special implementation in `setAccessor` for `style` and
1770
+ // `class` which reconciles values coming from the VDom with values
1771
+ // already present on the DOM element, so we don't want to override those
1772
+ // attributes on the VDom tree with values from the host element if they
1773
+ // are present.
1774
+ //
1775
+ // Likewise, `ref` and `key` are special internal values for the Stencil
1776
+ // runtime and we don't want to override those either.
1777
+ if (hostElm.hasAttribute(key) && !['key', 'ref', 'style', 'class'].includes(key)) {
1778
+ rootVnode.$attrs$[key] = hostElm[key];
1779
+ }
1780
+ }
1781
+ }
1782
+ rootVnode.$tag$ = null;
1783
+ rootVnode.$flags$ |= 4 /* VNODE_FLAGS.isHost */;
1784
+ hostRef.$vnode$ = rootVnode;
1785
+ rootVnode.$elm$ = oldVNode.$elm$ = (BUILD.shadowDom ? hostElm.shadowRoot || hostElm : hostElm);
1786
+ if (BUILD.scoped || BUILD.shadowDom) {
1787
+ scopeId = hostElm['s-sc'];
1788
+ }
1789
+ if (BUILD.slotRelocation) {
1790
+ contentRef = hostElm['s-cr'];
1791
+ useNativeShadowDom = supportsShadow && (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) !== 0;
1792
+ // always reset
1793
+ checkSlotFallbackVisibility = false;
1794
+ }
1795
+ // synchronous patch
1796
+ patch(oldVNode, rootVnode);
1797
+ if (BUILD.slotRelocation) {
1798
+ // while we're moving nodes around existing nodes, temporarily disable
1799
+ // the disconnectCallback from working
1800
+ plt.$flags$ |= 1 /* PLATFORM_FLAGS.isTmpDisconnected */;
1801
+ if (checkSlotRelocate) {
1802
+ markSlotContentForRelocation(rootVnode.$elm$);
1803
+ for (const relocateData of relocateNodes) {
1804
+ const nodeToRelocate = relocateData.$nodeToRelocate$;
1805
+ if (!nodeToRelocate['s-ol']) {
1806
+ // add a reference node marking this node's original location
1807
+ // keep a reference to this node for later lookups
1808
+ const orgLocationNode = BUILD.isDebug || BUILD.hydrateServerSide
1809
+ ? originalLocationDebugNode(nodeToRelocate)
1810
+ : doc.createTextNode('');
1811
+ orgLocationNode['s-nr'] = nodeToRelocate;
1812
+ nodeToRelocate.parentNode.insertBefore((nodeToRelocate['s-ol'] = orgLocationNode), nodeToRelocate);
1813
+ }
1814
+ }
1815
+ for (const relocateData of relocateNodes) {
1816
+ const nodeToRelocate = relocateData.$nodeToRelocate$;
1817
+ const slotRefNode = relocateData.$slotRefNode$;
1818
+ if (slotRefNode) {
1819
+ const parentNodeRef = slotRefNode.parentNode;
1820
+ // When determining where to insert content, the most simple case would be
1821
+ // to relocate the node immediately following the slot reference node. We do this
1822
+ // by getting a reference to the node immediately following the slot reference node
1823
+ // since we will use `insertBefore` to manipulate the DOM.
1824
+ //
1825
+ // If there is no node immediately following the slot reference node, then we will just
1826
+ // end up appending the node as the last child of the parent.
1827
+ let insertBeforeNode = slotRefNode.nextSibling;
1828
+ // If the node we're currently planning on inserting the new node before is an element,
1829
+ // we need to do some additional checks to make sure we're inserting the node in the correct order.
1830
+ // The use case here would be that we have multiple nodes being relocated to the same slot. So, we want
1831
+ // to make sure they get inserted into their new how in the same order they were declared in their original location.
1832
+ //
1833
+ // TODO(STENCIL-914): Remove `experimentalSlotFixes` check
1834
+ if (!BUILD.experimentalSlotFixes ||
1835
+ (insertBeforeNode && insertBeforeNode.nodeType === 1 /* NODE_TYPE.ElementNode */)) {
1836
+ let orgLocationNode = (_a = nodeToRelocate['s-ol']) === null || _a === void 0 ? void 0 : _a.previousSibling;
1837
+ while (orgLocationNode) {
1838
+ let refNode = (_b = orgLocationNode['s-nr']) !== null && _b !== void 0 ? _b : null;
1839
+ if (refNode && refNode['s-sn'] === nodeToRelocate['s-sn'] && parentNodeRef === refNode.parentNode) {
1840
+ refNode = refNode.nextSibling;
1841
+ if (!refNode || !refNode['s-nr']) {
1842
+ insertBeforeNode = refNode;
1843
+ break;
1844
+ }
1845
+ }
1846
+ orgLocationNode = orgLocationNode.previousSibling;
1847
+ }
1848
+ }
1849
+ if ((!insertBeforeNode && parentNodeRef !== nodeToRelocate.parentNode) ||
1850
+ nodeToRelocate.nextSibling !== insertBeforeNode) {
1851
+ // we've checked that it's worth while to relocate
1852
+ // since that the node to relocate
1853
+ // has a different next sibling or parent relocated
1854
+ if (nodeToRelocate !== insertBeforeNode) {
1855
+ if (!nodeToRelocate['s-hn'] && nodeToRelocate['s-ol']) {
1856
+ // probably a component in the index.html that doesn't have its hostname set
1857
+ nodeToRelocate['s-hn'] = nodeToRelocate['s-ol'].parentNode.nodeName;
1858
+ }
1859
+ // Handle a use-case where we relocate a slot where
1860
+ // the slot name changes along the way (for instance, a default to a named slot).
1861
+ // In this case, we need to update the relocated node's slot attribute to match
1862
+ // the slot name it is being relocated into.
1863
+ //
1864
+ // There is a very niche use case where we may be relocating a text node. For now,
1865
+ // we ignore anything that is not an element node since non-element nodes cannot have
1866
+ // attributes to specify the slot. We'll deal with this if it becomes a problem... but super edge-case-y
1867
+ if (BUILD.experimentalSlotFixes &&
1868
+ nodeToRelocate.nodeType === 1 /* NODE_TYPE.ElementNode */ &&
1869
+ slotRefNode['s-fs'] !== nodeToRelocate.getAttribute('slot')) {
1870
+ if (!slotRefNode['s-fs']) {
1871
+ nodeToRelocate.removeAttribute('slot');
1872
+ }
1873
+ else {
1874
+ nodeToRelocate.setAttribute('slot', slotRefNode['s-fs']);
1875
+ }
1876
+ }
1877
+ // Add it back to the dom but in its new home
1878
+ // If we get to this point and `insertBeforeNode` is `null`, that means
1879
+ // we're just going to append the node as the last child of the parent. Passing
1880
+ // `null` as the second arg here will trigger that behavior.
1881
+ parentNodeRef.insertBefore(nodeToRelocate, insertBeforeNode);
1882
+ }
1883
+ }
1884
+ }
1885
+ else {
1886
+ // this node doesn't have a slot home to go to, so let's hide it
1887
+ if (nodeToRelocate.nodeType === 1 /* NODE_TYPE.ElementNode */) {
1888
+ nodeToRelocate.hidden = true;
1889
+ }
1890
+ }
1891
+ }
1892
+ }
1893
+ if (checkSlotFallbackVisibility) {
1894
+ updateFallbackSlotVisibility(rootVnode.$elm$);
1895
+ }
1896
+ // done moving nodes around
1897
+ // allow the disconnect callback to work again
1898
+ plt.$flags$ &= ~1 /* PLATFORM_FLAGS.isTmpDisconnected */;
1899
+ // always reset
1900
+ relocateNodes.length = 0;
1901
+ }
1902
+ };
1903
+ // slot comment debug nodes only created with the `--debug` flag
1904
+ // otherwise these nodes are text nodes w/out content
1905
+ const slotReferenceDebugNode = (slotVNode) => doc.createComment(`<slot${slotVNode.$name$ ? ' name="' + slotVNode.$name$ + '"' : ''}> (host=${hostTagName.toLowerCase()})`);
1906
+ const originalLocationDebugNode = (nodeToRelocate) => doc.createComment(`org-location for ` +
1907
+ (nodeToRelocate.localName
1908
+ ? `<${nodeToRelocate.localName}> (host=${nodeToRelocate['s-hn']})`
1909
+ : `[${nodeToRelocate.textContent}]`));
1910
+ const attachToAncestor = (hostRef, ancestorComponent) => {
1911
+ if (BUILD.asyncLoading && ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) {
1912
+ ancestorComponent['s-p'].push(new Promise((r) => (hostRef.$onRenderResolve$ = r)));
1913
+ }
1914
+ };
1915
+ const scheduleUpdate = (hostRef, isInitialLoad) => {
1916
+ if (BUILD.taskQueue && BUILD.updatable) {
1917
+ hostRef.$flags$ |= 16 /* HOST_FLAGS.isQueuedForUpdate */;
1918
+ }
1919
+ if (BUILD.asyncLoading && hostRef.$flags$ & 4 /* HOST_FLAGS.isWaitingForChildren */) {
1920
+ hostRef.$flags$ |= 512 /* HOST_FLAGS.needsRerender */;
1921
+ return;
1922
+ }
1923
+ attachToAncestor(hostRef, hostRef.$ancestorComponent$);
1924
+ // there is no ancestor component or the ancestor component
1925
+ // has already fired off its lifecycle update then
1926
+ // fire off the initial update
1927
+ const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
1928
+ return BUILD.taskQueue ? writeTask(dispatch) : dispatch();
1929
+ };
1930
+ /**
1931
+ * Dispatch initial-render and update lifecycle hooks, enqueuing calls to
1932
+ * component lifecycle methods like `componentWillLoad` as well as
1933
+ * {@link updateComponent}, which will kick off the virtual DOM re-render.
1934
+ *
1935
+ * @param hostRef a reference to a host DOM node
1936
+ * @param isInitialLoad whether we're on the initial load or not
1937
+ * @returns an empty Promise which is used to enqueue a series of operations for
1938
+ * the component
1939
+ */
1940
+ const dispatchHooks = (hostRef, isInitialLoad) => {
1941
+ const elm = hostRef.$hostElement$;
1942
+ const endSchedule = createTime('scheduleUpdate', hostRef.$cmpMeta$.$tagName$);
1943
+ const instance = BUILD.lazyLoad ? hostRef.$lazyInstance$ : elm;
1944
+ // We're going to use this variable together with `enqueue` to implement a
1945
+ // little promise-based queue. We start out with it `undefined`. When we add
1946
+ // the first function to the queue we'll set this variable to be that
1947
+ // function's return value. When we attempt to add subsequent values to the
1948
+ // queue we'll check that value and, if it was a `Promise`, we'll then chain
1949
+ // the new function off of that `Promise` using `.then()`. This will give our
1950
+ // queue two nice properties:
1951
+ //
1952
+ // 1. If all functions added to the queue are synchronous they'll be called
1953
+ // synchronously right away.
1954
+ // 2. If all functions added to the queue are asynchronous they'll all be
1955
+ // called in order after `dispatchHooks` exits.
1956
+ let maybePromise;
1957
+ if (isInitialLoad) {
1958
+ if (BUILD.lazyLoad && BUILD.hostListener) {
1959
+ hostRef.$flags$ |= 256 /* HOST_FLAGS.isListenReady */;
1960
+ if (hostRef.$queuedListeners$) {
1961
+ hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
1962
+ hostRef.$queuedListeners$ = undefined;
1963
+ }
1964
+ }
1965
+ emitLifecycleEvent(elm, 'componentWillLoad');
1966
+ if (BUILD.cmpWillLoad) {
1967
+ // If `componentWillLoad` returns a `Promise` then we want to wait on
1968
+ // whatever's going on in that `Promise` before we launch into
1969
+ // rendering the component, doing other lifecycle stuff, etc. So
1970
+ // in that case we assign the returned promise to the variable we
1971
+ // declared above to hold a possible 'queueing' Promise
1972
+ maybePromise = safeCall(instance, 'componentWillLoad');
1973
+ }
1974
+ }
1975
+ else {
1976
+ emitLifecycleEvent(elm, 'componentWillUpdate');
1977
+ if (BUILD.cmpWillUpdate) {
1978
+ // Like `componentWillLoad` above, we allow Stencil component
1979
+ // authors to return a `Promise` from this lifecycle callback, and
1980
+ // we specify that our runtime will wait for that `Promise` to
1981
+ // resolve before the component re-renders. So if the method
1982
+ // returns a `Promise` we need to keep it around!
1983
+ maybePromise = safeCall(instance, 'componentWillUpdate');
1984
+ }
1985
+ }
1986
+ emitLifecycleEvent(elm, 'componentWillRender');
1987
+ if (BUILD.cmpWillRender) {
1988
+ maybePromise = enqueue(maybePromise, () => safeCall(instance, 'componentWillRender'));
1989
+ }
1990
+ endSchedule();
1991
+ return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));
1992
+ };
1993
+ /**
1994
+ * This function uses a Promise to implement a simple first-in, first-out queue
1995
+ * of functions to be called.
1996
+ *
1997
+ * The queue is ordered on the basis of the first argument. If it's
1998
+ * `undefined`, then nothing is on the queue yet, so the provided function can
1999
+ * be called synchronously (although note that this function may return a
2000
+ * `Promise`). The idea is that then the return value of that enqueueing
2001
+ * operation is kept around, so that if it was a `Promise` then subsequent
2002
+ * functions can be enqueued by calling this function again with that `Promise`
2003
+ * as the first argument.
2004
+ *
2005
+ * @param maybePromise either a `Promise` which should resolve before the next function is called or an 'empty' sentinel
2006
+ * @param fn a function to enqueue
2007
+ * @returns either a `Promise` or the return value of the provided function
2008
+ */
2009
+ const enqueue = (maybePromise, fn) => isPromisey(maybePromise) ? maybePromise.then(fn) : fn();
2010
+ /**
2011
+ * Check that a value is a `Promise`. To check, we first see if the value is an
2012
+ * instance of the `Promise` global. In a few circumstances, in particular if
2013
+ * the global has been overwritten, this is could be misleading, so we also do
2014
+ * a little 'duck typing' check to see if the `.then` property of the value is
2015
+ * defined and a function.
2016
+ *
2017
+ * @param maybePromise it might be a promise!
2018
+ * @returns whether it is or not
2019
+ */
2020
+ const isPromisey = (maybePromise) => maybePromise instanceof Promise ||
2021
+ (maybePromise && maybePromise.then && typeof maybePromise.then === 'function');
2022
+ /**
2023
+ * Update a component given reference to its host elements and so on.
2024
+ *
2025
+ * @param hostRef an object containing references to the element's host node,
2026
+ * VDom nodes, and other metadata
2027
+ * @param instance a reference to the underlying host element where it will be
2028
+ * rendered
2029
+ * @param isInitialLoad whether or not this function is being called as part of
2030
+ * the first render cycle
2031
+ */
2032
+ const updateComponent = async (hostRef, instance, isInitialLoad) => {
2033
+ var _a;
2034
+ const elm = hostRef.$hostElement$;
2035
+ const endUpdate = createTime('update', hostRef.$cmpMeta$.$tagName$);
2036
+ const rc = elm['s-rc'];
2037
+ if (BUILD.style && isInitialLoad) {
2038
+ // DOM WRITE!
2039
+ attachStyles(hostRef);
2040
+ }
2041
+ const endRender = createTime('render', hostRef.$cmpMeta$.$tagName$);
2042
+ if (BUILD.isDev) {
2043
+ hostRef.$flags$ |= 1024 /* HOST_FLAGS.devOnRender */;
2044
+ }
2045
+ if (BUILD.hydrateServerSide) {
2046
+ await callRender(hostRef, instance, elm, isInitialLoad);
2047
+ }
2048
+ else {
2049
+ callRender(hostRef, instance, elm, isInitialLoad);
2050
+ }
2051
+ if (BUILD.isDev) {
2052
+ hostRef.$renderCount$ = hostRef.$renderCount$ === undefined ? 1 : hostRef.$renderCount$ + 1;
2053
+ hostRef.$flags$ &= ~1024 /* HOST_FLAGS.devOnRender */;
2054
+ }
2055
+ if (BUILD.hydrateServerSide) {
2056
+ try {
2057
+ // manually connected child components during server-side hydrate
2058
+ serverSideConnected(elm);
2059
+ if (isInitialLoad) {
2060
+ // using only during server-side hydrate
2061
+ if (hostRef.$cmpMeta$.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
2062
+ elm['s-en'] = '';
2063
+ }
2064
+ else if (hostRef.$cmpMeta$.$flags$ & 2 /* CMP_FLAGS.scopedCssEncapsulation */) {
2065
+ elm['s-en'] = 'c';
2066
+ }
2067
+ }
2068
+ }
2069
+ catch (e) {
2070
+ consoleError(e, elm);
2071
+ }
2072
+ }
2073
+ if (BUILD.asyncLoading && rc) {
2074
+ // ok, so turns out there are some child host elements
2075
+ // waiting on this parent element to load
2076
+ // let's fire off all update callbacks waiting
2077
+ rc.map((cb) => cb());
2078
+ elm['s-rc'] = undefined;
2079
+ }
2080
+ endRender();
2081
+ endUpdate();
2082
+ if (BUILD.asyncLoading) {
2083
+ const childrenPromises = (_a = elm['s-p']) !== null && _a !== void 0 ? _a : [];
2084
+ const postUpdate = () => postUpdateComponent(hostRef);
2085
+ if (childrenPromises.length === 0) {
2086
+ postUpdate();
2087
+ }
2088
+ else {
2089
+ Promise.all(childrenPromises).then(postUpdate);
2090
+ hostRef.$flags$ |= 4 /* HOST_FLAGS.isWaitingForChildren */;
2091
+ childrenPromises.length = 0;
2092
+ }
2093
+ }
2094
+ else {
2095
+ postUpdateComponent(hostRef);
2096
+ }
2097
+ };
2098
+ /**
2099
+ * Handle making the call to the VDom renderer with the proper context given
2100
+ * various build variables
2101
+ *
2102
+ * @param hostRef an object containing references to the element's host node,
2103
+ * VDom nodes, and other metadata
2104
+ * @param instance a reference to the underlying host element where it will be
2105
+ * rendered
2106
+ * @param elm the Host element for the component
2107
+ * @param isInitialLoad whether or not this function is being called as part of
2108
+ * @returns an empty promise
2109
+ */
2110
+ const callRender = (hostRef, instance, elm, isInitialLoad) => {
2111
+ // in order for bundlers to correctly tree-shake the BUILD object
2112
+ // we need to ensure BUILD is not deoptimized within a try/catch
2113
+ // https://rollupjs.org/guide/en/#treeshake tryCatchDeoptimization
2114
+ const allRenderFn = BUILD.allRenderFn ? true : false;
2115
+ const lazyLoad = BUILD.lazyLoad ? true : false;
2116
+ const taskQueue = BUILD.taskQueue ? true : false;
2117
+ const updatable = BUILD.updatable ? true : false;
2118
+ try {
2119
+ renderingRef = instance;
2120
+ /**
2121
+ * minification optimization: `allRenderFn` is `true` if all components have a `render`
2122
+ * method, so we can call the method immediately. If not, check before calling it.
2123
+ */
2124
+ instance = allRenderFn ? instance.render() : instance.render && instance.render();
2125
+ if (updatable && taskQueue) {
2126
+ hostRef.$flags$ &= ~16 /* HOST_FLAGS.isQueuedForUpdate */;
2127
+ }
2128
+ if (updatable || lazyLoad) {
2129
+ hostRef.$flags$ |= 2 /* HOST_FLAGS.hasRendered */;
2130
+ }
2131
+ if (BUILD.hasRenderFn || BUILD.reflect) {
2132
+ if (BUILD.vdomRender || BUILD.reflect) {
2133
+ // looks like we've got child nodes to render into this host element
2134
+ // or we need to update the css class/attrs on the host element
2135
+ // DOM WRITE!
2136
+ if (BUILD.hydrateServerSide) {
2137
+ return Promise.resolve(instance).then((value) => renderVdom(hostRef, value, isInitialLoad));
2138
+ }
2139
+ else {
2140
+ renderVdom(hostRef, instance, isInitialLoad);
2141
+ }
2142
+ }
2143
+ else {
2144
+ elm.textContent = instance;
2145
+ }
2146
+ }
2147
+ }
2148
+ catch (e) {
2149
+ consoleError(e, hostRef.$hostElement$);
2150
+ }
2151
+ renderingRef = null;
2152
+ return null;
2153
+ };
2154
+ const getRenderingRef = () => renderingRef;
2155
+ const postUpdateComponent = (hostRef) => {
2156
+ const tagName = hostRef.$cmpMeta$.$tagName$;
2157
+ const elm = hostRef.$hostElement$;
2158
+ const endPostUpdate = createTime('postUpdate', tagName);
2159
+ const instance = BUILD.lazyLoad ? hostRef.$lazyInstance$ : elm;
2160
+ const ancestorComponent = hostRef.$ancestorComponent$;
2161
+ if (BUILD.cmpDidRender) {
2162
+ if (BUILD.isDev) {
2163
+ hostRef.$flags$ |= 1024 /* HOST_FLAGS.devOnRender */;
2164
+ }
2165
+ safeCall(instance, 'componentDidRender');
2166
+ if (BUILD.isDev) {
2167
+ hostRef.$flags$ &= ~1024 /* HOST_FLAGS.devOnRender */;
2168
+ }
2169
+ }
2170
+ emitLifecycleEvent(elm, 'componentDidRender');
2171
+ if (!(hostRef.$flags$ & 64 /* HOST_FLAGS.hasLoadedComponent */)) {
2172
+ hostRef.$flags$ |= 64 /* HOST_FLAGS.hasLoadedComponent */;
2173
+ if (BUILD.asyncLoading && BUILD.cssAnnotations) {
2174
+ // DOM WRITE!
2175
+ addHydratedFlag(elm);
2176
+ }
2177
+ if (BUILD.cmpDidLoad) {
2178
+ if (BUILD.isDev) {
2179
+ hostRef.$flags$ |= 2048 /* HOST_FLAGS.devOnDidLoad */;
2180
+ }
2181
+ safeCall(instance, 'componentDidLoad');
2182
+ if (BUILD.isDev) {
2183
+ hostRef.$flags$ &= ~2048 /* HOST_FLAGS.devOnDidLoad */;
2184
+ }
2185
+ }
2186
+ emitLifecycleEvent(elm, 'componentDidLoad');
2187
+ endPostUpdate();
2188
+ if (BUILD.asyncLoading) {
2189
+ hostRef.$onReadyResolve$(elm);
2190
+ if (!ancestorComponent) {
2191
+ appDidLoad(tagName);
2192
+ }
2193
+ }
2194
+ }
2195
+ else {
2196
+ if (BUILD.cmpDidUpdate) {
2197
+ // we've already loaded this component
2198
+ // fire off the user's componentDidUpdate method (if one was provided)
2199
+ // componentDidUpdate runs AFTER render() has been called
2200
+ // and all child components have finished updating
2201
+ if (BUILD.isDev) {
2202
+ hostRef.$flags$ |= 1024 /* HOST_FLAGS.devOnRender */;
2203
+ }
2204
+ safeCall(instance, 'componentDidUpdate');
2205
+ if (BUILD.isDev) {
2206
+ hostRef.$flags$ &= ~1024 /* HOST_FLAGS.devOnRender */;
2207
+ }
2208
+ }
2209
+ emitLifecycleEvent(elm, 'componentDidUpdate');
2210
+ endPostUpdate();
2211
+ }
2212
+ if (BUILD.method && BUILD.lazyLoad) {
2213
+ hostRef.$onInstanceResolve$(elm);
2214
+ }
2215
+ // load events fire from bottom to top
2216
+ // the deepest elements load first then bubbles up
2217
+ if (BUILD.asyncLoading) {
2218
+ if (hostRef.$onRenderResolve$) {
2219
+ hostRef.$onRenderResolve$();
2220
+ hostRef.$onRenderResolve$ = undefined;
2221
+ }
2222
+ if (hostRef.$flags$ & 512 /* HOST_FLAGS.needsRerender */) {
2223
+ nextTick(() => scheduleUpdate(hostRef, false));
2224
+ }
2225
+ hostRef.$flags$ &= ~(4 /* HOST_FLAGS.isWaitingForChildren */ | 512 /* HOST_FLAGS.needsRerender */);
2226
+ }
2227
+ // ( •_•)
2228
+ // ( •_•)>⌐■-■
2229
+ // (⌐■_■)
2230
+ };
2231
+ const forceUpdate = (ref) => {
2232
+ if (BUILD.updatable && (Build.isBrowser || Build.isTesting)) {
2233
+ const hostRef = getHostRef(ref);
2234
+ const isConnected = hostRef.$hostElement$.isConnected;
2235
+ if (isConnected &&
2236
+ (hostRef.$flags$ & (2 /* HOST_FLAGS.hasRendered */ | 16 /* HOST_FLAGS.isQueuedForUpdate */)) === 2 /* HOST_FLAGS.hasRendered */) {
2237
+ scheduleUpdate(hostRef, false);
2238
+ }
2239
+ // Returns "true" when the forced update was successfully scheduled
2240
+ return isConnected;
2241
+ }
2242
+ return false;
2243
+ };
2244
+ const appDidLoad = (who) => {
2245
+ // on appload
2246
+ // we have finish the first big initial render
2247
+ if (BUILD.cssAnnotations) {
2248
+ addHydratedFlag(doc.documentElement);
2249
+ }
2250
+ if (BUILD.asyncQueue) {
2251
+ plt.$flags$ |= 2 /* PLATFORM_FLAGS.appLoaded */;
2252
+ }
2253
+ nextTick(() => emitEvent(win, 'appload', { detail: { namespace: NAMESPACE } }));
2254
+ if (BUILD.profile && performance.measure) {
2255
+ performance.measure(`[Stencil] ${NAMESPACE} initial load (by ${who})`, 'st:app:start');
2256
+ }
2257
+ };
2258
+ /**
2259
+ * Allows to safely call a method, e.g. `componentDidLoad`, on an instance,
2260
+ * e.g. custom element node. If a build figures out that e.g. no component
2261
+ * has a `componentDidLoad` method, the instance method gets removed from the
2262
+ * output bundle and this function returns `undefined`.
2263
+ * @param instance any object that may or may not contain methods
2264
+ * @param method method name
2265
+ * @param arg single arbitrary argument
2266
+ * @returns result of method call if it exists, otherwise `undefined`
2267
+ */
2268
+ const safeCall = (instance, method, arg) => {
2269
+ if (instance && instance[method]) {
2270
+ try {
2271
+ return instance[method](arg);
2272
+ }
2273
+ catch (e) {
2274
+ consoleError(e);
2275
+ }
2276
+ }
2277
+ return undefined;
2278
+ };
2279
+ /**
2280
+ * For debugging purposes as `BUILD.lifecycleDOMEvents` is `false` by default and will
2281
+ * get removed by the compiler. Used for timing events to see how long they take.
2282
+ * @param elm the target of the Event
2283
+ * @param lifecycleName name of the event
2284
+ */
2285
+ const emitLifecycleEvent = (elm, lifecycleName) => {
2286
+ if (BUILD.lifecycleDOMEvents) {
2287
+ emitEvent(elm, 'stencil_' + lifecycleName, {
2288
+ bubbles: true,
2289
+ composed: true,
2290
+ detail: {
2291
+ namespace: NAMESPACE,
2292
+ },
2293
+ });
2294
+ }
2295
+ };
2296
+ const addHydratedFlag = (elm) => BUILD.hydratedClass
2297
+ ? elm.classList.add('hydrated')
2298
+ : BUILD.hydratedAttribute
2299
+ ? elm.setAttribute('hydrated', '')
2300
+ : undefined;
2301
+ const serverSideConnected = (elm) => {
2302
+ const children = elm.children;
2303
+ if (children != null) {
2304
+ for (let i = 0, ii = children.length; i < ii; i++) {
2305
+ const childElm = children[i];
2306
+ if (typeof childElm.connectedCallback === 'function') {
2307
+ childElm.connectedCallback();
2308
+ }
2309
+ serverSideConnected(childElm);
2310
+ }
2311
+ }
2312
+ };
2313
+ const getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
2314
+ const setValue = (ref, propName, newVal, cmpMeta) => {
2315
+ // check our new property value against our internal value
2316
+ const hostRef = getHostRef(ref);
2317
+ const elm = BUILD.lazyLoad ? hostRef.$hostElement$ : ref;
2318
+ const oldVal = hostRef.$instanceValues$.get(propName);
2319
+ const flags = hostRef.$flags$;
2320
+ const instance = BUILD.lazyLoad ? hostRef.$lazyInstance$ : elm;
2321
+ newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]);
2322
+ // explicitly check for NaN on both sides, as `NaN === NaN` is always false
2323
+ const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
2324
+ const didValueChange = newVal !== oldVal && !areBothNaN;
2325
+ if ((!BUILD.lazyLoad || !(flags & 8 /* HOST_FLAGS.isConstructingInstance */) || oldVal === undefined) && didValueChange) {
2326
+ // gadzooks! the property's value has changed!!
2327
+ // set our new value!
2328
+ hostRef.$instanceValues$.set(propName, newVal);
2329
+ if (BUILD.isDev) {
2330
+ if (hostRef.$flags$ & 1024 /* HOST_FLAGS.devOnRender */) {
2331
+ consoleDevWarn(`The state/prop "${propName}" changed during rendering. This can potentially lead to infinite-loops and other bugs.`, '\nElement', elm, '\nNew value', newVal, '\nOld value', oldVal);
2332
+ }
2333
+ else if (hostRef.$flags$ & 2048 /* HOST_FLAGS.devOnDidLoad */) {
2334
+ consoleDevWarn(`The state/prop "${propName}" changed during "componentDidLoad()", this triggers extra re-renders, try to setup on "componentWillLoad()"`, '\nElement', elm, '\nNew value', newVal, '\nOld value', oldVal);
2335
+ }
2336
+ }
2337
+ if (!BUILD.lazyLoad || instance) {
2338
+ // get an array of method names of watch functions to call
2339
+ if (BUILD.watchCallback && cmpMeta.$watchers$ && flags & 128 /* HOST_FLAGS.isWatchReady */) {
2340
+ const watchMethods = cmpMeta.$watchers$[propName];
2341
+ if (watchMethods) {
2342
+ // this instance is watching for when this property changed
2343
+ watchMethods.map((watchMethodName) => {
2344
+ try {
2345
+ // fire off each of the watch methods that are watching this property
2346
+ instance[watchMethodName](newVal, oldVal, propName);
2347
+ }
2348
+ catch (e) {
2349
+ consoleError(e, elm);
2350
+ }
2351
+ });
2352
+ }
2353
+ }
2354
+ if (BUILD.updatable &&
2355
+ (flags & (2 /* HOST_FLAGS.hasRendered */ | 16 /* HOST_FLAGS.isQueuedForUpdate */)) === 2 /* HOST_FLAGS.hasRendered */) {
2356
+ if (BUILD.cmpShouldUpdate && instance.componentShouldUpdate) {
2357
+ if (instance.componentShouldUpdate(newVal, oldVal, propName) === false) {
2358
+ return;
2359
+ }
2360
+ }
2361
+ // looks like this value actually changed, so we've got work to do!
2362
+ // but only if we've already rendered, otherwise just chill out
2363
+ // queue that we need to do an update, but don't worry about queuing
2364
+ // up millions cuz this function ensures it only runs once
2365
+ scheduleUpdate(hostRef, false);
2366
+ }
2367
+ }
2368
+ }
2369
+ };
2370
+ /**
2371
+ * Attach a series of runtime constructs to a compiled Stencil component
2372
+ * constructor, including getters and setters for the `@Prop` and `@State`
2373
+ * decorators, callbacks for when attributes change, and so on.
2374
+ *
2375
+ * @param Cstr the constructor for a component that we need to process
2376
+ * @param cmpMeta metadata collected previously about the component
2377
+ * @param flags a number used to store a series of bit flags
2378
+ * @returns a reference to the same constructor passed in (but now mutated)
2379
+ */
2380
+ const proxyComponent = (Cstr, cmpMeta, flags) => {
2381
+ var _a;
2382
+ if (BUILD.member && cmpMeta.$members$) {
2383
+ if (BUILD.watchCallback && Cstr.watchers) {
2384
+ cmpMeta.$watchers$ = Cstr.watchers;
2385
+ }
2386
+ // It's better to have a const than two Object.entries()
2387
+ const members = Object.entries(cmpMeta.$members$);
2388
+ const prototype = Cstr.prototype;
2389
+ members.map(([memberName, [memberFlags]]) => {
2390
+ if ((BUILD.prop || BUILD.state) &&
2391
+ (memberFlags & 31 /* MEMBER_FLAGS.Prop */ ||
2392
+ ((!BUILD.lazyLoad || flags & 2 /* PROXY_FLAGS.proxyState */) && memberFlags & 32 /* MEMBER_FLAGS.State */))) {
2393
+ // proxyComponent - prop
2394
+ Object.defineProperty(prototype, memberName, {
2395
+ get() {
2396
+ // proxyComponent, get value
2397
+ return getValue(this, memberName);
2398
+ },
2399
+ set(newValue) {
2400
+ // only during dev time
2401
+ if (BUILD.isDev) {
2402
+ const ref = getHostRef(this);
2403
+ if (
2404
+ // we are proxying the instance (not element)
2405
+ (flags & 1 /* PROXY_FLAGS.isElementConstructor */) === 0 &&
2406
+ // the element is not constructing
2407
+ (ref.$flags$ & 8 /* HOST_FLAGS.isConstructingInstance */) === 0 &&
2408
+ // the member is a prop
2409
+ (memberFlags & 31 /* MEMBER_FLAGS.Prop */) !== 0 &&
2410
+ // the member is not mutable
2411
+ (memberFlags & 1024 /* MEMBER_FLAGS.Mutable */) === 0) {
2412
+ consoleDevWarn(`@Prop() "${memberName}" on <${cmpMeta.$tagName$}> is immutable but was modified from within the component.\nMore information: https://stenciljs.com/docs/properties#prop-mutability`);
2413
+ }
2414
+ }
2415
+ // proxyComponent, set value
2416
+ setValue(this, memberName, newValue, cmpMeta);
2417
+ },
2418
+ configurable: true,
2419
+ enumerable: true,
2420
+ });
2421
+ }
2422
+ else if (BUILD.lazyLoad &&
2423
+ BUILD.method &&
2424
+ flags & 1 /* PROXY_FLAGS.isElementConstructor */ &&
2425
+ memberFlags & 64 /* MEMBER_FLAGS.Method */) {
2426
+ // proxyComponent - method
2427
+ Object.defineProperty(prototype, memberName, {
2428
+ value(...args) {
2429
+ const ref = getHostRef(this);
2430
+ return ref.$onInstancePromise$.then(() => ref.$lazyInstance$[memberName](...args));
2431
+ },
2432
+ });
2433
+ }
2434
+ });
2435
+ if (BUILD.observeAttribute && (!BUILD.lazyLoad || flags & 1 /* PROXY_FLAGS.isElementConstructor */)) {
2436
+ const attrNameToPropName = new Map();
2437
+ prototype.attributeChangedCallback = function (attrName, oldValue, newValue) {
2438
+ plt.jmp(() => {
2439
+ const propName = attrNameToPropName.get(attrName);
2440
+ // In a web component lifecycle the attributeChangedCallback runs prior to connectedCallback
2441
+ // in the case where an attribute was set inline.
2442
+ // ```html
2443
+ // <my-component some-attribute="some-value"></my-component>
2444
+ // ```
2445
+ //
2446
+ // There is an edge case where a developer sets the attribute inline on a custom element and then
2447
+ // programmatically changes it before it has been upgraded as shown below:
2448
+ //
2449
+ // ```html
2450
+ // <!-- this component has _not_ been upgraded yet -->
2451
+ // <my-component id="test" some-attribute="some-value"></my-component>
2452
+ // <script>
2453
+ // // grab non-upgraded component
2454
+ // el = document.querySelector("#test");
2455
+ // el.someAttribute = "another-value";
2456
+ // // upgrade component
2457
+ // customElements.define('my-component', MyComponent);
2458
+ // </script>
2459
+ // ```
2460
+ // In this case if we do not un-shadow here and use the value of the shadowing property, attributeChangedCallback
2461
+ // will be called with `newValue = "some-value"` and will set the shadowed property (this.someAttribute = "another-value")
2462
+ // to the value that was set inline i.e. "some-value" from above example. When
2463
+ // the connectedCallback attempts to un-shadow it will use "some-value" as the initial value rather than "another-value"
2464
+ //
2465
+ // The case where the attribute was NOT set inline but was not set programmatically shall be handled/un-shadowed
2466
+ // by connectedCallback as this attributeChangedCallback will not fire.
2467
+ //
2468
+ // https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
2469
+ //
2470
+ // TODO(STENCIL-16) we should think about whether or not we actually want to be reflecting the attributes to
2471
+ // properties here given that this goes against best practices outlined here
2472
+ // https://developers.google.com/web/fundamentals/web-components/best-practices#avoid-reentrancy
2473
+ if (this.hasOwnProperty(propName)) {
2474
+ newValue = this[propName];
2475
+ delete this[propName];
2476
+ }
2477
+ else if (prototype.hasOwnProperty(propName) &&
2478
+ typeof this[propName] === 'number' &&
2479
+ this[propName] == newValue) {
2480
+ // if the propName exists on the prototype of `Cstr`, this update may be a result of Stencil using native
2481
+ // APIs to reflect props as attributes. Calls to `setAttribute(someElement, propName)` will result in
2482
+ // `propName` to be converted to a `DOMString`, which may not be what we want for other primitive props.
2483
+ return;
2484
+ }
2485
+ else if (propName == null) {
2486
+ // At this point we should know this is not a "member", so we can treat it like watching an attribute
2487
+ // on a vanilla web component
2488
+ const hostRef = getHostRef(this);
2489
+ const flags = hostRef === null || hostRef === void 0 ? void 0 : hostRef.$flags$;
2490
+ // We only want to trigger the callback(s) if:
2491
+ // 1. The instance is ready
2492
+ // 2. The watchers are ready
2493
+ // 3. The value has changed
2494
+ if (!(flags & 8 /* HOST_FLAGS.isConstructingInstance */) &&
2495
+ flags & 128 /* HOST_FLAGS.isWatchReady */ &&
2496
+ newValue !== oldValue) {
2497
+ const elm = BUILD.lazyLoad ? hostRef.$hostElement$ : this;
2498
+ const instance = BUILD.lazyLoad ? hostRef.$lazyInstance$ : elm;
2499
+ const entry = cmpMeta.$watchers$[attrName];
2500
+ entry === null || entry === void 0 ? void 0 : entry.forEach((callbackName) => {
2501
+ if (instance[callbackName] != null) {
2502
+ instance[callbackName].call(instance, newValue, oldValue, attrName);
2503
+ }
2504
+ });
2505
+ }
2506
+ return;
2507
+ }
2508
+ this[propName] = newValue === null && typeof this[propName] === 'boolean' ? false : newValue;
2509
+ });
2510
+ };
2511
+ // Create an array of attributes to observe
2512
+ // This list in comprised of all strings used within a `@Watch()` decorator
2513
+ // on a component as well as any Stencil-specific "members" (`@Prop()`s and `@State()`s).
2514
+ // As such, there is no way to guarantee type-safety here that a user hasn't entered
2515
+ // an invalid attribute.
2516
+ Cstr.observedAttributes = Array.from(new Set([
2517
+ ...Object.keys((_a = cmpMeta.$watchers$) !== null && _a !== void 0 ? _a : {}),
2518
+ ...members
2519
+ .filter(([_, m]) => m[0] & 15 /* MEMBER_FLAGS.HasAttribute */)
2520
+ .map(([propName, m]) => {
2521
+ const attrName = m[1] || propName;
2522
+ attrNameToPropName.set(attrName, propName);
2523
+ if (BUILD.reflect && m[0] & 512 /* MEMBER_FLAGS.ReflectAttr */) {
2524
+ cmpMeta.$attrsToReflect$.push([propName, attrName]);
2525
+ }
2526
+ return attrName;
2527
+ }),
2528
+ ]));
2529
+ }
2530
+ }
2531
+ return Cstr;
2532
+ };
2533
+ /**
2534
+ * Initialize a Stencil component given a reference to its host element, its
2535
+ * runtime bookkeeping data structure, runtime metadata about the component,
2536
+ * and (optionally) an HMR version ID.
2537
+ *
2538
+ * @param elm a host element
2539
+ * @param hostRef the element's runtime bookkeeping object
2540
+ * @param cmpMeta runtime metadata for the Stencil component
2541
+ * @param hmrVersionId an (optional) HMR version ID
2542
+ */
2543
+ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
2544
+ let Cstr;
2545
+ // initializeComponent
2546
+ if ((hostRef.$flags$ & 32 /* HOST_FLAGS.hasInitializedComponent */) === 0) {
2547
+ // Let the runtime know that the component has been initialized
2548
+ hostRef.$flags$ |= 32 /* HOST_FLAGS.hasInitializedComponent */;
2549
+ if (BUILD.lazyLoad || BUILD.hydrateClientSide) {
2550
+ // lazy loaded components
2551
+ // request the component's implementation to be
2552
+ // wired up with the host element
2553
+ Cstr = loadModule(cmpMeta, hostRef, hmrVersionId);
2554
+ if (Cstr.then) {
2555
+ // Await creates a micro-task avoid if possible
2556
+ const endLoad = uniqueTime(`st:load:${cmpMeta.$tagName$}:${hostRef.$modeName$}`, `[Stencil] Load module for <${cmpMeta.$tagName$}>`);
2557
+ Cstr = await Cstr;
2558
+ endLoad();
2559
+ }
2560
+ if ((BUILD.isDev || BUILD.isDebug) && !Cstr) {
2561
+ throw new Error(`Constructor for "${cmpMeta.$tagName$}#${hostRef.$modeName$}" was not found`);
2562
+ }
2563
+ if (BUILD.member && !Cstr.isProxied) {
2564
+ // we've never proxied this Constructor before
2565
+ // let's add the getters/setters to its prototype before
2566
+ // the first time we create an instance of the implementation
2567
+ if (BUILD.watchCallback) {
2568
+ cmpMeta.$watchers$ = Cstr.watchers;
2569
+ }
2570
+ proxyComponent(Cstr, cmpMeta, 2 /* PROXY_FLAGS.proxyState */);
2571
+ Cstr.isProxied = true;
2572
+ }
2573
+ const endNewInstance = createTime('createInstance', cmpMeta.$tagName$);
2574
+ // ok, time to construct the instance
2575
+ // but let's keep track of when we start and stop
2576
+ // so that the getters/setters don't incorrectly step on data
2577
+ if (BUILD.member) {
2578
+ hostRef.$flags$ |= 8 /* HOST_FLAGS.isConstructingInstance */;
2579
+ }
2580
+ // construct the lazy-loaded component implementation
2581
+ // passing the hostRef is very important during
2582
+ // construction in order to directly wire together the
2583
+ // host element and the lazy-loaded instance
2584
+ try {
2585
+ new Cstr(hostRef);
2586
+ }
2587
+ catch (e) {
2588
+ consoleError(e);
2589
+ }
2590
+ if (BUILD.member) {
2591
+ hostRef.$flags$ &= ~8 /* HOST_FLAGS.isConstructingInstance */;
2592
+ }
2593
+ if (BUILD.watchCallback) {
2594
+ hostRef.$flags$ |= 128 /* HOST_FLAGS.isWatchReady */;
2595
+ }
2596
+ endNewInstance();
2597
+ fireConnectedCallback(hostRef.$lazyInstance$);
2598
+ }
2599
+ else {
2600
+ // sync constructor component
2601
+ Cstr = elm.constructor;
2602
+ // wait for the CustomElementRegistry to mark the component as ready before setting `isWatchReady`. Otherwise,
2603
+ // watchers may fire prematurely if `customElements.get()`/`customElements.whenDefined()` resolves _before_
2604
+ // Stencil has completed instantiating the component.
2605
+ customElements.whenDefined(cmpMeta.$tagName$).then(() => (hostRef.$flags$ |= 128 /* HOST_FLAGS.isWatchReady */));
2606
+ }
2607
+ if (BUILD.style && Cstr.style) {
2608
+ // this component has styles but we haven't registered them yet
2609
+ let style = Cstr.style;
2610
+ if (BUILD.mode && typeof style !== 'string') {
2611
+ style = style[(hostRef.$modeName$ = computeMode(elm))];
2612
+ if (BUILD.hydrateServerSide && hostRef.$modeName$) {
2613
+ elm.setAttribute('s-mode', hostRef.$modeName$);
2614
+ }
2615
+ }
2616
+ const scopeId = getScopeId(cmpMeta, hostRef.$modeName$);
2617
+ if (!styles.has(scopeId)) {
2618
+ const endRegisterStyles = createTime('registerStyles', cmpMeta.$tagName$);
2619
+ if (!BUILD.hydrateServerSide &&
2620
+ BUILD.shadowDom &&
2621
+ // TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
2622
+ BUILD.shadowDomShim &&
2623
+ cmpMeta.$flags$ & 8 /* CMP_FLAGS.needsShadowDomShim */) {
2624
+ style = await Promise.resolve().then(function () { return require('./shadow-css-163d1bb0.js'); }).then((m) => m.scopeCss(style, scopeId, false));
2625
+ }
2626
+ registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */));
2627
+ endRegisterStyles();
2628
+ }
2629
+ }
2630
+ }
2631
+ // we've successfully created a lazy instance
2632
+ const ancestorComponent = hostRef.$ancestorComponent$;
2633
+ const schedule = () => scheduleUpdate(hostRef, true);
2634
+ if (BUILD.asyncLoading && ancestorComponent && ancestorComponent['s-rc']) {
2635
+ // this is the initial load and this component it has an ancestor component
2636
+ // but the ancestor component has NOT fired its will update lifecycle yet
2637
+ // so let's just cool our jets and wait for the ancestor to continue first
2638
+ // this will get fired off when the ancestor component
2639
+ // finally gets around to rendering its lazy self
2640
+ // fire off the initial update
2641
+ ancestorComponent['s-rc'].push(schedule);
2642
+ }
2643
+ else {
2644
+ schedule();
2645
+ }
2646
+ };
2647
+ const fireConnectedCallback = (instance) => {
2648
+ if (BUILD.lazyLoad && BUILD.connectedCallback) {
2649
+ safeCall(instance, 'connectedCallback');
2650
+ }
2651
+ };
2652
+ const connectedCallback = (elm) => {
2653
+ if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
2654
+ const hostRef = getHostRef(elm);
2655
+ const cmpMeta = hostRef.$cmpMeta$;
2656
+ const endConnected = createTime('connectedCallback', cmpMeta.$tagName$);
2657
+ if (BUILD.hostListenerTargetParent) {
2658
+ // only run if we have listeners being attached to a parent
2659
+ addHostEventListeners(elm, hostRef, cmpMeta.$listeners$, true);
2660
+ }
2661
+ if (!(hostRef.$flags$ & 1 /* HOST_FLAGS.hasConnected */)) {
2662
+ // first time this component has connected
2663
+ hostRef.$flags$ |= 1 /* HOST_FLAGS.hasConnected */;
2664
+ let hostId;
2665
+ if (BUILD.hydrateClientSide) {
2666
+ hostId = elm.getAttribute(HYDRATE_ID);
2667
+ if (hostId) {
2668
+ if (BUILD.shadowDom && supportsShadow && cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
2669
+ const scopeId = BUILD.mode
2670
+ ? addStyle(elm.shadowRoot, cmpMeta, elm.getAttribute('s-mode'))
2671
+ : addStyle(elm.shadowRoot, cmpMeta);
2672
+ elm.classList.remove(scopeId + '-h', scopeId + '-s');
2673
+ }
2674
+ initializeClientHydrate(elm, cmpMeta.$tagName$, hostId, hostRef);
2675
+ }
2676
+ }
2677
+ if (BUILD.slotRelocation && !hostId) {
2678
+ // initUpdate
2679
+ // if the slot polyfill is required we'll need to put some nodes
2680
+ // in here to act as original content anchors as we move nodes around
2681
+ // host element has been connected to the DOM
2682
+ if (BUILD.hydrateServerSide ||
2683
+ ((BUILD.slot || BUILD.shadowDom) &&
2684
+ // TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
2685
+ cmpMeta.$flags$ & (4 /* CMP_FLAGS.hasSlotRelocation */ | 8 /* CMP_FLAGS.needsShadowDomShim */))) {
2686
+ setContentReference(elm);
2687
+ }
2688
+ }
2689
+ if (BUILD.asyncLoading) {
2690
+ // find the first ancestor component (if there is one) and register
2691
+ // this component as one of the actively loading child components for its ancestor
2692
+ let ancestorComponent = elm;
2693
+ while ((ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host)) {
2694
+ // climb up the ancestors looking for the first
2695
+ // component that hasn't finished its lifecycle update yet
2696
+ if ((BUILD.hydrateClientSide &&
2697
+ ancestorComponent.nodeType === 1 /* NODE_TYPE.ElementNode */ &&
2698
+ ancestorComponent.hasAttribute('s-id') &&
2699
+ ancestorComponent['s-p']) ||
2700
+ ancestorComponent['s-p']) {
2701
+ // we found this components first ancestor component
2702
+ // keep a reference to this component's ancestor component
2703
+ attachToAncestor(hostRef, (hostRef.$ancestorComponent$ = ancestorComponent));
2704
+ break;
2705
+ }
2706
+ }
2707
+ }
2708
+ // Lazy properties
2709
+ // https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
2710
+ if (BUILD.prop && !BUILD.hydrateServerSide && cmpMeta.$members$) {
2711
+ Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
2712
+ if (memberFlags & 31 /* MEMBER_FLAGS.Prop */ && elm.hasOwnProperty(memberName)) {
2713
+ const value = elm[memberName];
2714
+ delete elm[memberName];
2715
+ elm[memberName] = value;
2716
+ }
2717
+ });
2718
+ }
2719
+ if (BUILD.initializeNextTick) {
2720
+ // connectedCallback, taskQueue, initialLoad
2721
+ // angular sets attribute AFTER connectCallback
2722
+ // https://github.com/angular/angular/issues/18909
2723
+ // https://github.com/angular/angular/issues/19940
2724
+ nextTick(() => initializeComponent(elm, hostRef, cmpMeta));
2725
+ }
2726
+ else {
2727
+ initializeComponent(elm, hostRef, cmpMeta);
2728
+ }
2729
+ }
2730
+ else {
2731
+ // not the first time this has connected
2732
+ // reattach any event listeners to the host
2733
+ // since they would have been removed when disconnected
2734
+ addHostEventListeners(elm, hostRef, cmpMeta.$listeners$, false);
2735
+ // fire off connectedCallback() on component instance
2736
+ if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$lazyInstance$) {
2737
+ fireConnectedCallback(hostRef.$lazyInstance$);
2738
+ }
2739
+ else if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$onReadyPromise$) {
2740
+ hostRef.$onReadyPromise$.then(() => fireConnectedCallback(hostRef.$lazyInstance$));
2741
+ }
2742
+ }
2743
+ endConnected();
2744
+ }
2745
+ };
2746
+ const setContentReference = (elm) => {
2747
+ // only required when we're NOT using native shadow dom (slot)
2748
+ // or this browser doesn't support native shadow dom
2749
+ // and this host element was NOT created with SSR
2750
+ // let's pick out the inner content for slot projection
2751
+ // create a node to represent where the original
2752
+ // content was first placed, which is useful later on
2753
+ const contentRefElm = (elm['s-cr'] = doc.createComment(BUILD.isDebug ? `content-ref (host=${elm.localName})` : ''));
2754
+ contentRefElm['s-cn'] = true;
2755
+ elm.insertBefore(contentRefElm, elm.firstChild);
2756
+ };
2757
+ const disconnectInstance = (instance) => {
2758
+ if (BUILD.lazyLoad && BUILD.disconnectedCallback) {
2759
+ safeCall(instance, 'disconnectedCallback');
2760
+ }
2761
+ if (BUILD.cmpDidUnload) {
2762
+ safeCall(instance, 'componentDidUnload');
2763
+ }
2764
+ };
2765
+ const disconnectedCallback = async (elm) => {
2766
+ if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
2767
+ const hostRef = getHostRef(elm);
2768
+ if (BUILD.hostListener) {
2769
+ if (hostRef.$rmListeners$) {
2770
+ hostRef.$rmListeners$.map((rmListener) => rmListener());
2771
+ hostRef.$rmListeners$ = undefined;
2772
+ }
2773
+ }
2774
+ if (!BUILD.lazyLoad) {
2775
+ disconnectInstance(elm);
2776
+ }
2777
+ else if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$lazyInstance$) {
2778
+ disconnectInstance(hostRef.$lazyInstance$);
2779
+ }
2780
+ else if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$onReadyPromise$) {
2781
+ hostRef.$onReadyPromise$.then(() => disconnectInstance(hostRef.$lazyInstance$));
2782
+ }
2783
+ }
2784
+ };
2785
+ const patchPseudoShadowDom = (hostElementPrototype, descriptorPrototype) => {
2786
+ patchCloneNode(hostElementPrototype);
2787
+ patchSlotAppendChild(hostElementPrototype);
2788
+ patchSlotAppend(hostElementPrototype);
2789
+ patchSlotPrepend(hostElementPrototype);
2790
+ patchSlotInsertAdjacentElement(hostElementPrototype);
2791
+ patchSlotInsertAdjacentHTML(hostElementPrototype);
2792
+ patchSlotInsertAdjacentText(hostElementPrototype);
2793
+ patchTextContent(hostElementPrototype, descriptorPrototype);
2794
+ patchChildSlotNodes(hostElementPrototype, descriptorPrototype);
2795
+ };
2796
+ const patchCloneNode = (HostElementPrototype) => {
2797
+ const orgCloneNode = HostElementPrototype.cloneNode;
2798
+ HostElementPrototype.cloneNode = function (deep) {
2799
+ const srcNode = this;
2800
+ const isShadowDom = BUILD.shadowDom ? srcNode.shadowRoot && supportsShadow : false;
2801
+ const clonedNode = orgCloneNode.call(srcNode, isShadowDom ? deep : false);
2802
+ if (BUILD.slot && !isShadowDom && deep) {
2803
+ let i = 0;
2804
+ let slotted, nonStencilNode;
2805
+ const stencilPrivates = [
2806
+ 's-id',
2807
+ 's-cr',
2808
+ 's-lr',
2809
+ 's-rc',
2810
+ 's-sc',
2811
+ 's-p',
2812
+ 's-cn',
2813
+ 's-sr',
2814
+ 's-sn',
2815
+ 's-hn',
2816
+ 's-ol',
2817
+ 's-nr',
2818
+ 's-si',
2819
+ ];
2820
+ for (; i < srcNode.childNodes.length; i++) {
2821
+ slotted = srcNode.childNodes[i]['s-nr'];
2822
+ nonStencilNode = stencilPrivates.every((privateField) => !srcNode.childNodes[i][privateField]);
2823
+ if (slotted) {
2824
+ if (BUILD.appendChildSlotFix && clonedNode.__appendChild) {
2825
+ clonedNode.__appendChild(slotted.cloneNode(true));
2826
+ }
2827
+ else {
2828
+ clonedNode.appendChild(slotted.cloneNode(true));
2829
+ }
2830
+ }
2831
+ if (nonStencilNode) {
2832
+ clonedNode.appendChild(srcNode.childNodes[i].cloneNode(true));
2833
+ }
2834
+ }
2835
+ }
2836
+ return clonedNode;
2837
+ };
2838
+ };
2839
+ const patchSlotAppendChild = (HostElementPrototype) => {
2840
+ HostElementPrototype.__appendChild = HostElementPrototype.appendChild;
2841
+ HostElementPrototype.appendChild = function (newChild) {
2842
+ const slotName = (newChild['s-sn'] = getSlotName(newChild));
2843
+ const slotNode = getHostSlotNode(this.childNodes, slotName);
2844
+ if (slotNode) {
2845
+ const slotChildNodes = getHostSlotChildNodes(slotNode, slotName);
2846
+ const appendAfter = slotChildNodes[slotChildNodes.length - 1];
2847
+ return appendAfter.parentNode.insertBefore(newChild, appendAfter.nextSibling);
2848
+ }
2849
+ return this.__appendChild(newChild);
2850
+ };
2851
+ };
2852
+ /**
2853
+ * Patches the `prepend` method for a slotted node inside a scoped component.
2854
+ *
2855
+ * @param HostElementPrototype the `Element` to be patched
2856
+ */
2857
+ const patchSlotPrepend = (HostElementPrototype) => {
2858
+ const originalPrepend = HostElementPrototype.prepend;
2859
+ HostElementPrototype.prepend = function (...newChildren) {
2860
+ newChildren.forEach((newChild) => {
2861
+ if (typeof newChild === 'string') {
2862
+ newChild = this.ownerDocument.createTextNode(newChild);
2863
+ }
2864
+ const slotName = (newChild['s-sn'] = getSlotName(newChild));
2865
+ const slotNode = getHostSlotNode(this.childNodes, slotName);
2866
+ if (slotNode) {
2867
+ const slotPlaceholder = document.createTextNode('');
2868
+ slotPlaceholder['s-nr'] = newChild;
2869
+ slotNode['s-cr'].parentNode.__appendChild(slotPlaceholder);
2870
+ newChild['s-ol'] = slotPlaceholder;
2871
+ const slotChildNodes = getHostSlotChildNodes(slotNode, slotName);
2872
+ const appendAfter = slotChildNodes[0];
2873
+ return appendAfter.parentNode.insertBefore(newChild, appendAfter.nextSibling);
2874
+ }
2875
+ if (newChild.nodeType === 1 && !!newChild.getAttribute('slot')) {
2876
+ newChild.hidden = true;
2877
+ }
2878
+ return originalPrepend.call(this, newChild);
2879
+ });
2880
+ };
2881
+ };
2882
+ /**
2883
+ * Patches the `append` method for a slotted node inside a scoped component. The patched method uses
2884
+ * `appendChild` under-the-hood while creating text nodes for any new children that passed as bare strings.
2885
+ *
2886
+ * @param HostElementPrototype the `Element` to be patched
2887
+ */
2888
+ const patchSlotAppend = (HostElementPrototype) => {
2889
+ HostElementPrototype.append = function (...newChildren) {
2890
+ newChildren.forEach((newChild) => {
2891
+ if (typeof newChild === 'string') {
2892
+ newChild = this.ownerDocument.createTextNode(newChild);
2893
+ }
2894
+ this.appendChild(newChild);
2895
+ });
2896
+ };
2897
+ };
2898
+ /**
2899
+ * Patches the `insertAdjacentHTML` method for a slotted node inside a scoped component. Specifically,
2900
+ * we only need to patch the behavior for the specific `beforeend` and `afterbegin` positions so the element
2901
+ * gets inserted into the DOM in the correct location.
2902
+ *
2903
+ * @param HostElementPrototype the `Element` to be patched
2904
+ */
2905
+ const patchSlotInsertAdjacentHTML = (HostElementPrototype) => {
2906
+ const originalInsertAdjacentHtml = HostElementPrototype.insertAdjacentHTML;
2907
+ HostElementPrototype.insertAdjacentHTML = function (position, text) {
2908
+ if (position !== 'afterbegin' && position !== 'beforeend') {
2909
+ return originalInsertAdjacentHtml.call(this, position, text);
2910
+ }
2911
+ const container = this.ownerDocument.createElement('_');
2912
+ let node;
2913
+ container.innerHTML = text;
2914
+ if (position === 'afterbegin') {
2915
+ while ((node = container.firstChild)) {
2916
+ this.prepend(node);
2917
+ }
2918
+ }
2919
+ else if (position === 'beforeend') {
2920
+ while ((node = container.firstChild)) {
2921
+ this.append(node);
2922
+ }
2923
+ }
2924
+ };
2925
+ };
2926
+ /**
2927
+ * Patches the `insertAdjacentText` method for a slotted node inside a scoped component. Specifically,
2928
+ * we only need to patch the behavior for the specific `beforeend` and `afterbegin` positions so the text node
2929
+ * gets inserted into the DOM in the correct location.
2930
+ *
2931
+ * @param HostElementPrototype the `Element` to be patched
2932
+ */
2933
+ const patchSlotInsertAdjacentText = (HostElementPrototype) => {
2934
+ HostElementPrototype.insertAdjacentText = function (position, text) {
2935
+ this.insertAdjacentHTML(position, text);
2936
+ };
2937
+ };
2938
+ /**
2939
+ * Patches the `insertAdjacentElement` method for a slotted node inside a scoped component. Specifically,
2940
+ * we only need to patch the behavior for the specific `beforeend` and `afterbegin` positions so the element
2941
+ * gets inserted into the DOM in the correct location.
2942
+ *
2943
+ * @param HostElementPrototype the `Element` to be patched
2944
+ */
2945
+ const patchSlotInsertAdjacentElement = (HostElementPrototype) => {
2946
+ const originalInsertAdjacentElement = HostElementPrototype.insertAdjacentElement;
2947
+ HostElementPrototype.insertAdjacentElement = function (position, element) {
2948
+ if (position !== 'afterbegin' && position !== 'beforeend') {
2949
+ return originalInsertAdjacentElement.call(this, position, element);
2950
+ }
2951
+ if (position === 'afterbegin') {
2952
+ this.prepend(element);
2953
+ return element;
2954
+ }
2955
+ else if (position === 'beforeend') {
2956
+ this.append(element);
2957
+ return element;
2958
+ }
2959
+ return element;
2960
+ };
2961
+ };
2962
+ /**
2963
+ * Patches the text content of an unnamed slotted node inside a scoped component
2964
+ * @param hostElementPrototype the `Element` to be patched
2965
+ * @param cmpMeta component runtime metadata used to determine if the component should be patched or not
2966
+ */
2967
+ const patchTextContent = (hostElementPrototype, cmpMeta) => {
2968
+ if (BUILD.scoped && cmpMeta.$flags$ & 2 /* CMP_FLAGS.scopedCssEncapsulation */) {
2969
+ const descriptor = Object.getOwnPropertyDescriptor(Node.prototype, 'textContent');
2970
+ Object.defineProperty(hostElementPrototype, '__textContent', descriptor);
2971
+ Object.defineProperty(hostElementPrototype, 'textContent', {
2972
+ get() {
2973
+ var _a;
2974
+ // get the 'default slot', which would be the first slot in a shadow tree (if we were using one), whose name is
2975
+ // the empty string
2976
+ const slotNode = getHostSlotNode(this.childNodes, '');
2977
+ // when a slot node is found, the textContent _may_ be found in the next sibling (text) node, depending on how
2978
+ // nodes were reordered during the vdom render. first try to get the text content from the sibling.
2979
+ if (((_a = slotNode === null || slotNode === void 0 ? void 0 : slotNode.nextSibling) === null || _a === void 0 ? void 0 : _a.nodeType) === 3 /* NODE_TYPES.TEXT_NODE */) {
2980
+ return slotNode.nextSibling.textContent;
2981
+ }
2982
+ else if (slotNode) {
2983
+ return slotNode.textContent;
2984
+ }
2985
+ else {
2986
+ // fallback to the original implementation
2987
+ return this.__textContent;
2988
+ }
2989
+ },
2990
+ set(value) {
2991
+ var _a;
2992
+ // get the 'default slot', which would be the first slot in a shadow tree (if we were using one), whose name is
2993
+ // the empty string
2994
+ const slotNode = getHostSlotNode(this.childNodes, '');
2995
+ // when a slot node is found, the textContent _may_ need to be placed in the next sibling (text) node,
2996
+ // depending on how nodes were reordered during the vdom render. first try to set the text content on the
2997
+ // sibling.
2998
+ if (((_a = slotNode === null || slotNode === void 0 ? void 0 : slotNode.nextSibling) === null || _a === void 0 ? void 0 : _a.nodeType) === 3 /* NODE_TYPES.TEXT_NODE */) {
2999
+ slotNode.nextSibling.textContent = value;
3000
+ }
3001
+ else if (slotNode) {
3002
+ slotNode.textContent = value;
3003
+ }
3004
+ else {
3005
+ // we couldn't find a slot, but that doesn't mean that there isn't one. if this check ran before the DOM
3006
+ // loaded, we could have missed it. check for a content reference element on the scoped component and insert
3007
+ // it there
3008
+ this.__textContent = value;
3009
+ const contentRefElm = this['s-cr'];
3010
+ if (contentRefElm) {
3011
+ this.insertBefore(contentRefElm, this.firstChild);
3012
+ }
3013
+ }
3014
+ },
3015
+ });
3016
+ }
3017
+ };
3018
+ const patchChildSlotNodes = (elm, cmpMeta) => {
3019
+ class FakeNodeList extends Array {
3020
+ item(n) {
3021
+ return this[n];
3022
+ }
3023
+ }
3024
+ // TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
3025
+ if (cmpMeta.$flags$ & 8 /* CMP_FLAGS.needsShadowDomShim */) {
3026
+ const childNodesFn = elm.__lookupGetter__('childNodes');
3027
+ Object.defineProperty(elm, 'children', {
3028
+ get() {
3029
+ return this.childNodes.map((n) => n.nodeType === 1);
3030
+ },
3031
+ });
3032
+ Object.defineProperty(elm, 'childElementCount', {
3033
+ get() {
3034
+ return elm.children.length;
3035
+ },
3036
+ });
3037
+ Object.defineProperty(elm, 'childNodes', {
3038
+ get() {
3039
+ const childNodes = childNodesFn.call(this);
3040
+ if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0 &&
3041
+ getHostRef(this).$flags$ & 2 /* HOST_FLAGS.hasRendered */) {
3042
+ const result = new FakeNodeList();
3043
+ for (let i = 0; i < childNodes.length; i++) {
3044
+ const slot = childNodes[i]['s-nr'];
3045
+ if (slot) {
3046
+ result.push(slot);
3047
+ }
3048
+ }
3049
+ return result;
3050
+ }
3051
+ return FakeNodeList.from(childNodes);
3052
+ },
3053
+ });
3054
+ }
3055
+ };
3056
+ const getSlotName = (node) => node['s-sn'] || (node.nodeType === 1 && node.getAttribute('slot')) || '';
3057
+ /**
3058
+ * Recursively searches a series of child nodes for a slot with the provided name.
3059
+ * @param childNodes the nodes to search for a slot with a specific name.
3060
+ * @param slotName the name of the slot to match on.
3061
+ * @returns a reference to the slot node that matches the provided name, `null` otherwise
3062
+ */
3063
+ const getHostSlotNode = (childNodes, slotName) => {
3064
+ let i = 0;
3065
+ let childNode;
3066
+ for (; i < childNodes.length; i++) {
3067
+ childNode = childNodes[i];
3068
+ if (childNode['s-sr'] && childNode['s-sn'] === slotName) {
3069
+ return childNode;
3070
+ }
3071
+ childNode = getHostSlotNode(childNode.childNodes, slotName);
3072
+ if (childNode) {
3073
+ return childNode;
3074
+ }
3075
+ }
3076
+ return null;
3077
+ };
3078
+ const getHostSlotChildNodes = (n, slotName) => {
3079
+ const childNodes = [n];
3080
+ while ((n = n.nextSibling) && n['s-sn'] === slotName) {
3081
+ childNodes.push(n);
3082
+ }
3083
+ return childNodes;
3084
+ };
3085
+ const defineCustomElement = (Cstr, compactMeta) => {
3086
+ customElements.define(compactMeta[1], proxyCustomElement(Cstr, compactMeta));
3087
+ };
3088
+ const proxyCustomElement = (Cstr, compactMeta) => {
3089
+ const cmpMeta = {
3090
+ $flags$: compactMeta[0],
3091
+ $tagName$: compactMeta[1],
3092
+ };
3093
+ if (BUILD.member) {
3094
+ cmpMeta.$members$ = compactMeta[2];
3095
+ }
3096
+ if (BUILD.hostListener) {
3097
+ cmpMeta.$listeners$ = compactMeta[3];
3098
+ }
3099
+ if (BUILD.watchCallback) {
3100
+ cmpMeta.$watchers$ = Cstr.$watchers$;
3101
+ }
3102
+ if (BUILD.reflect) {
3103
+ cmpMeta.$attrsToReflect$ = [];
3104
+ }
3105
+ if (BUILD.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
3106
+ // TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
3107
+ cmpMeta.$flags$ |= 8 /* CMP_FLAGS.needsShadowDomShim */;
3108
+ }
3109
+ // TODO(STENCIL-914): this check and `else` block can go away and be replaced by just `BUILD.scoped` once we
3110
+ // default our pseudo-slot behavior
3111
+ if (BUILD.experimentalSlotFixes && BUILD.scoped) {
3112
+ patchPseudoShadowDom(Cstr.prototype, cmpMeta);
3113
+ }
3114
+ else {
3115
+ if (BUILD.slotChildNodesFix) {
3116
+ patchChildSlotNodes(Cstr.prototype, cmpMeta);
3117
+ }
3118
+ if (BUILD.cloneNodeFix) {
3119
+ patchCloneNode(Cstr.prototype);
3120
+ }
3121
+ if (BUILD.appendChildSlotFix) {
3122
+ patchSlotAppendChild(Cstr.prototype);
3123
+ }
3124
+ if (BUILD.scopedSlotTextContentFix) {
3125
+ patchTextContent(Cstr.prototype, cmpMeta);
3126
+ }
3127
+ }
3128
+ const originalConnectedCallback = Cstr.prototype.connectedCallback;
3129
+ const originalDisconnectedCallback = Cstr.prototype.disconnectedCallback;
3130
+ Object.assign(Cstr.prototype, {
3131
+ __registerHost() {
3132
+ registerHost(this, cmpMeta);
3133
+ },
3134
+ connectedCallback() {
3135
+ connectedCallback(this);
3136
+ if (BUILD.connectedCallback && originalConnectedCallback) {
3137
+ originalConnectedCallback.call(this);
3138
+ }
3139
+ },
3140
+ disconnectedCallback() {
3141
+ disconnectedCallback(this);
3142
+ if (BUILD.disconnectedCallback && originalDisconnectedCallback) {
3143
+ originalDisconnectedCallback.call(this);
3144
+ }
3145
+ },
3146
+ __attachShadow() {
3147
+ if (supportsShadow) {
3148
+ if (BUILD.shadowDelegatesFocus) {
3149
+ this.attachShadow({
3150
+ mode: 'open',
3151
+ delegatesFocus: !!(cmpMeta.$flags$ & 16 /* CMP_FLAGS.shadowDelegatesFocus */),
3152
+ });
3153
+ }
3154
+ else {
3155
+ this.attachShadow({ mode: 'open' });
3156
+ }
3157
+ }
3158
+ else {
3159
+ this.shadowRoot = this;
3160
+ }
3161
+ },
3162
+ });
3163
+ Cstr.is = cmpMeta.$tagName$;
3164
+ return proxyComponent(Cstr, cmpMeta, 1 /* PROXY_FLAGS.isElementConstructor */ | 2 /* PROXY_FLAGS.proxyState */);
3165
+ };
3166
+ const forceModeUpdate = (elm) => {
3167
+ if (BUILD.style && BUILD.mode && !BUILD.lazyLoad) {
3168
+ const mode = computeMode(elm);
3169
+ const hostRef = getHostRef(elm);
3170
+ if (hostRef.$modeName$ !== mode) {
3171
+ const cmpMeta = hostRef.$cmpMeta$;
3172
+ const oldScopeId = elm['s-sc'];
3173
+ const scopeId = getScopeId(cmpMeta, mode);
3174
+ const style = elm.constructor.style[mode];
3175
+ const flags = cmpMeta.$flags$;
3176
+ if (style) {
3177
+ if (!styles.has(scopeId)) {
3178
+ registerStyle(scopeId, style, !!(flags & 1 /* CMP_FLAGS.shadowDomEncapsulation */));
3179
+ }
3180
+ hostRef.$modeName$ = mode;
3181
+ elm.classList.remove(oldScopeId + '-h', oldScopeId + '-s');
3182
+ attachStyles(hostRef);
3183
+ forceUpdate(elm);
3184
+ }
3185
+ }
3186
+ }
3187
+ };
3188
+ /**
3189
+ * Kick off hot-module-replacement for a component. In order to replace the
3190
+ * component in-place we:
3191
+ *
3192
+ * 1. get a reference to the {@link d.HostRef} for the element
3193
+ * 2. reset the element's runtime flags
3194
+ * 3. re-run the initialization logic for the element (via
3195
+ * {@link initializeComponent})
3196
+ *
3197
+ * @param hostElement the host element for the component which we want to start
3198
+ * doing HMR
3199
+ * @param cmpMeta runtime metadata for the component
3200
+ * @param hmrVersionId the current HMR version ID
3201
+ */
3202
+ const hmrStart = (hostElement, cmpMeta, hmrVersionId) => {
3203
+ // ¯\_(ツ)_/¯
3204
+ const hostRef = getHostRef(hostElement);
3205
+ // reset state flags to only have been connected
3206
+ hostRef.$flags$ = 1 /* HOST_FLAGS.hasConnected */;
3207
+ // TODO
3208
+ // detach any event listeners that may have been added
3209
+ // because we're not passing an exact event name it'll
3210
+ // remove all of this element's event, which is good
3211
+ // re-initialize the component
3212
+ initializeComponent(hostElement, hostRef, cmpMeta, hmrVersionId);
3213
+ };
3214
+ const bootstrapLazy = (lazyBundles, options = {}) => {
3215
+ var _a;
3216
+ if (BUILD.profile && performance.mark) {
3217
+ performance.mark('st:app:start');
3218
+ }
3219
+ installDevTools();
3220
+ const endBootstrap = createTime('bootstrapLazy');
3221
+ const cmpTags = [];
3222
+ const exclude = options.exclude || [];
3223
+ const customElements = win.customElements;
3224
+ const head = doc.head;
3225
+ const metaCharset = /*@__PURE__*/ head.querySelector('meta[charset]');
3226
+ const visibilityStyle = /*@__PURE__*/ doc.createElement('style');
3227
+ const deferredConnectedCallbacks = [];
3228
+ const styles = /*@__PURE__*/ doc.querySelectorAll(`[${HYDRATED_STYLE_ID}]`);
3229
+ let appLoadFallback;
3230
+ let isBootstrapping = true;
3231
+ let i = 0;
3232
+ Object.assign(plt, options);
3233
+ plt.$resourcesUrl$ = new URL(options.resourcesUrl || './', doc.baseURI).href;
3234
+ if (BUILD.asyncQueue) {
3235
+ if (options.syncQueue) {
3236
+ plt.$flags$ |= 4 /* PLATFORM_FLAGS.queueSync */;
3237
+ }
3238
+ }
3239
+ if (BUILD.hydrateClientSide) {
3240
+ // If the app is already hydrated there is not point to disable the
3241
+ // async queue. This will improve the first input delay
3242
+ plt.$flags$ |= 2 /* PLATFORM_FLAGS.appLoaded */;
3243
+ }
3244
+ if (BUILD.hydrateClientSide && BUILD.shadowDom) {
3245
+ for (; i < styles.length; i++) {
3246
+ registerStyle(styles[i].getAttribute(HYDRATED_STYLE_ID), convertScopedToShadow(styles[i].innerHTML), true);
3247
+ }
3248
+ }
3249
+ lazyBundles.map((lazyBundle) => {
3250
+ lazyBundle[1].map((compactMeta) => {
3251
+ var _a;
3252
+ const cmpMeta = {
3253
+ $flags$: compactMeta[0],
3254
+ $tagName$: compactMeta[1],
3255
+ $members$: compactMeta[2],
3256
+ $listeners$: compactMeta[3],
3257
+ };
3258
+ if (BUILD.member) {
3259
+ cmpMeta.$members$ = compactMeta[2];
3260
+ }
3261
+ if (BUILD.hostListener) {
3262
+ cmpMeta.$listeners$ = compactMeta[3];
3263
+ }
3264
+ if (BUILD.reflect) {
3265
+ cmpMeta.$attrsToReflect$ = [];
3266
+ }
3267
+ if (BUILD.watchCallback) {
3268
+ cmpMeta.$watchers$ = (_a = compactMeta[4]) !== null && _a !== void 0 ? _a : {};
3269
+ }
3270
+ if (BUILD.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
3271
+ // TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
3272
+ cmpMeta.$flags$ |= 8 /* CMP_FLAGS.needsShadowDomShim */;
3273
+ }
3274
+ const tagName = BUILD.transformTagName && options.transformTagName
3275
+ ? options.transformTagName(cmpMeta.$tagName$)
3276
+ : cmpMeta.$tagName$;
3277
+ const HostElement = class extends HTMLElement {
3278
+ // StencilLazyHost
3279
+ constructor(self) {
3280
+ // @ts-ignore
3281
+ super(self);
3282
+ self = this;
3283
+ registerHost(self, cmpMeta);
3284
+ if (BUILD.shadowDom && cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
3285
+ // this component is using shadow dom
3286
+ // and this browser supports shadow dom
3287
+ // add the read-only property "shadowRoot" to the host element
3288
+ // adding the shadow root build conditionals to minimize runtime
3289
+ if (supportsShadow) {
3290
+ if (BUILD.shadowDelegatesFocus) {
3291
+ self.attachShadow({
3292
+ mode: 'open',
3293
+ delegatesFocus: !!(cmpMeta.$flags$ & 16 /* CMP_FLAGS.shadowDelegatesFocus */),
3294
+ });
3295
+ }
3296
+ else {
3297
+ self.attachShadow({ mode: 'open' });
3298
+ }
3299
+ }
3300
+ else if (!BUILD.hydrateServerSide && !('shadowRoot' in self)) {
3301
+ self.shadowRoot = self;
3302
+ }
3303
+ }
3304
+ }
3305
+ connectedCallback() {
3306
+ if (appLoadFallback) {
3307
+ clearTimeout(appLoadFallback);
3308
+ appLoadFallback = null;
3309
+ }
3310
+ if (isBootstrapping) {
3311
+ // connectedCallback will be processed once all components have been registered
3312
+ deferredConnectedCallbacks.push(this);
3313
+ }
3314
+ else {
3315
+ plt.jmp(() => connectedCallback(this));
3316
+ }
3317
+ }
3318
+ disconnectedCallback() {
3319
+ plt.jmp(() => disconnectedCallback(this));
3320
+ }
3321
+ componentOnReady() {
3322
+ return getHostRef(this).$onReadyPromise$;
3323
+ }
3324
+ };
3325
+ // TODO(STENCIL-914): this check and `else` block can go away and be replaced by just `BUILD.scoped` once we
3326
+ // default our pseudo-slot behavior
3327
+ if (BUILD.experimentalSlotFixes && BUILD.scoped) {
3328
+ patchPseudoShadowDom(HostElement.prototype, cmpMeta);
3329
+ }
3330
+ else {
3331
+ if (BUILD.slotChildNodesFix) {
3332
+ patchChildSlotNodes(HostElement.prototype, cmpMeta);
3333
+ }
3334
+ if (BUILD.cloneNodeFix) {
3335
+ patchCloneNode(HostElement.prototype);
3336
+ }
3337
+ if (BUILD.appendChildSlotFix) {
3338
+ patchSlotAppendChild(HostElement.prototype);
3339
+ }
3340
+ if (BUILD.scopedSlotTextContentFix) {
3341
+ patchTextContent(HostElement.prototype, cmpMeta);
3342
+ }
3343
+ }
3344
+ // if the component is formAssociated we need to set that on the host
3345
+ // element so that it will be ready for `attachInternals` to be called on
3346
+ // it later on
3347
+ if (BUILD.formAssociated && cmpMeta.$flags$ & 64 /* CMP_FLAGS.formAssociated */) {
3348
+ HostElement.formAssociated = true;
3349
+ }
3350
+ if (BUILD.hotModuleReplacement) {
3351
+ // if we're in an HMR dev build then we need to set up the callback
3352
+ // which will carry out the work of actually replacing the module for
3353
+ // this particular component
3354
+ HostElement.prototype['s-hmr'] = function (hmrVersionId) {
3355
+ hmrStart(this, cmpMeta, hmrVersionId);
3356
+ };
3357
+ }
3358
+ cmpMeta.$lazyBundleId$ = lazyBundle[0];
3359
+ if (!exclude.includes(tagName) && !customElements.get(tagName)) {
3360
+ cmpTags.push(tagName);
3361
+ customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* PROXY_FLAGS.isElementConstructor */));
3362
+ }
3363
+ });
3364
+ });
3365
+ if (BUILD.invisiblePrehydration && (BUILD.hydratedClass || BUILD.hydratedAttribute)) {
3366
+ visibilityStyle.innerHTML = cmpTags + HYDRATED_CSS;
3367
+ visibilityStyle.setAttribute('data-styles', '');
3368
+ // Apply CSP nonce to the style tag if it exists
3369
+ const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
3370
+ if (nonce != null) {
3371
+ visibilityStyle.setAttribute('nonce', nonce);
3372
+ }
3373
+ head.insertBefore(visibilityStyle, metaCharset ? metaCharset.nextSibling : head.firstChild);
3374
+ }
3375
+ // Process deferred connectedCallbacks now all components have been registered
3376
+ isBootstrapping = false;
3377
+ if (deferredConnectedCallbacks.length) {
3378
+ deferredConnectedCallbacks.map((host) => host.connectedCallback());
3379
+ }
3380
+ else {
3381
+ if (BUILD.profile) {
3382
+ plt.jmp(() => (appLoadFallback = setTimeout(appDidLoad, 30, 'timeout')));
3383
+ }
3384
+ else {
3385
+ plt.jmp(() => (appLoadFallback = setTimeout(appDidLoad, 30)));
3386
+ }
3387
+ }
3388
+ // Fallback appLoad event
3389
+ endBootstrap();
3390
+ };
3391
+ const Fragment = (_, children) => children;
3392
+ const addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
3393
+ if (BUILD.hostListener && listeners) {
3394
+ // this is called immediately within the element's constructor
3395
+ // initialize our event listeners on the host element
3396
+ // we do this now so that we can listen to events that may
3397
+ // have fired even before the instance is ready
3398
+ if (BUILD.hostListenerTargetParent) {
3399
+ // this component may have event listeners that should be attached to the parent
3400
+ if (attachParentListeners) {
3401
+ // this is being ran from within the connectedCallback
3402
+ // which is important so that we know the host element actually has a parent element
3403
+ // filter out the listeners to only have the ones that ARE being attached to the parent
3404
+ listeners = listeners.filter(([flags]) => flags & 32 /* LISTENER_FLAGS.TargetParent */);
3405
+ }
3406
+ else {
3407
+ // this is being ran from within the component constructor
3408
+ // everything BUT the parent element listeners should be attached at this time
3409
+ // filter out the listeners that are NOT being attached to the parent
3410
+ listeners = listeners.filter(([flags]) => !(flags & 32 /* LISTENER_FLAGS.TargetParent */));
3411
+ }
3412
+ }
3413
+ listeners.map(([flags, name, method]) => {
3414
+ const target = BUILD.hostListenerTarget ? getHostListenerTarget(elm, flags) : elm;
3415
+ const handler = hostListenerProxy(hostRef, method);
3416
+ const opts = hostListenerOpts(flags);
3417
+ plt.ael(target, name, handler, opts);
3418
+ (hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
3419
+ });
3420
+ }
3421
+ };
3422
+ const hostListenerProxy = (hostRef, methodName) => (ev) => {
3423
+ try {
3424
+ if (BUILD.lazyLoad) {
3425
+ if (hostRef.$flags$ & 256 /* HOST_FLAGS.isListenReady */) {
3426
+ // instance is ready, let's call it's member method for this event
3427
+ hostRef.$lazyInstance$[methodName](ev);
3428
+ }
3429
+ else {
3430
+ (hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
3431
+ }
3432
+ }
3433
+ else {
3434
+ hostRef.$hostElement$[methodName](ev);
3435
+ }
3436
+ }
3437
+ catch (e) {
3438
+ consoleError(e);
3439
+ }
3440
+ };
3441
+ const getHostListenerTarget = (elm, flags) => {
3442
+ if (BUILD.hostListenerTargetDocument && flags & 4 /* LISTENER_FLAGS.TargetDocument */)
3443
+ return doc;
3444
+ if (BUILD.hostListenerTargetWindow && flags & 8 /* LISTENER_FLAGS.TargetWindow */)
3445
+ return win;
3446
+ if (BUILD.hostListenerTargetBody && flags & 16 /* LISTENER_FLAGS.TargetBody */)
3447
+ return doc.body;
3448
+ if (BUILD.hostListenerTargetParent && flags & 32 /* LISTENER_FLAGS.TargetParent */)
3449
+ return elm.parentElement;
3450
+ return elm;
3451
+ };
3452
+ // prettier-ignore
3453
+ const hostListenerOpts = (flags) => supportsListenerOptions
3454
+ ? ({
3455
+ passive: (flags & 1 /* LISTENER_FLAGS.Passive */) !== 0,
3456
+ capture: (flags & 2 /* LISTENER_FLAGS.Capture */) !== 0,
3457
+ })
3458
+ : (flags & 2 /* LISTENER_FLAGS.Capture */) !== 0;
3459
+ /**
3460
+ * Assigns the given value to the nonce property on the runtime platform object.
3461
+ * During runtime, this value is used to set the nonce attribute on all dynamically created script and style tags.
3462
+ * @param nonce The value to be assigned to the platform nonce property.
3463
+ * @returns void
3464
+ */
3465
+ const setNonce = (nonce) => (plt.$nonce$ = nonce);
3466
+ const setPlatformOptions = (opts) => Object.assign(plt, opts);
3467
+ const insertVdomAnnotations = (doc, staticComponents) => {
3468
+ if (doc != null) {
3469
+ const docData = {
3470
+ hostIds: 0,
3471
+ rootLevelIds: 0,
3472
+ staticComponents: new Set(staticComponents),
3473
+ };
3474
+ const orgLocationNodes = [];
3475
+ parseVNodeAnnotations(doc, doc.body, docData, orgLocationNodes);
3476
+ orgLocationNodes.forEach((orgLocationNode) => {
3477
+ if (orgLocationNode != null) {
3478
+ const nodeRef = orgLocationNode['s-nr'];
3479
+ let hostId = nodeRef['s-host-id'];
3480
+ let nodeId = nodeRef['s-node-id'];
3481
+ let childId = `${hostId}.${nodeId}`;
3482
+ if (hostId == null) {
3483
+ hostId = 0;
3484
+ docData.rootLevelIds++;
3485
+ nodeId = docData.rootLevelIds;
3486
+ childId = `${hostId}.${nodeId}`;
3487
+ if (nodeRef.nodeType === 1 /* NODE_TYPE.ElementNode */) {
3488
+ nodeRef.setAttribute(HYDRATE_CHILD_ID, childId);
3489
+ }
3490
+ else if (nodeRef.nodeType === 3 /* NODE_TYPE.TextNode */) {
3491
+ if (hostId === 0) {
3492
+ const textContent = nodeRef.nodeValue.trim();
3493
+ if (textContent === '') {
3494
+ // useless whitespace node at the document root
3495
+ orgLocationNode.remove();
3496
+ return;
3497
+ }
3498
+ }
3499
+ const commentBeforeTextNode = doc.createComment(childId);
3500
+ commentBeforeTextNode.nodeValue = `${TEXT_NODE_ID}.${childId}`;
3501
+ nodeRef.parentNode.insertBefore(commentBeforeTextNode, nodeRef);
3502
+ }
3503
+ }
3504
+ let orgLocationNodeId = `${ORG_LOCATION_ID}.${childId}`;
3505
+ const orgLocationParentNode = orgLocationNode.parentElement;
3506
+ if (orgLocationParentNode) {
3507
+ if (orgLocationParentNode['s-en'] === '') {
3508
+ // ending with a "." means that the parent element
3509
+ // of this node's original location is a SHADOW dom element
3510
+ // and this node is apart of the root level light dom
3511
+ orgLocationNodeId += `.`;
3512
+ }
3513
+ else if (orgLocationParentNode['s-en'] === 'c') {
3514
+ // ending with a ".c" means that the parent element
3515
+ // of this node's original location is a SCOPED element
3516
+ // and this node is apart of the root level light dom
3517
+ orgLocationNodeId += `.c`;
3518
+ }
3519
+ }
3520
+ orgLocationNode.nodeValue = orgLocationNodeId;
3521
+ }
3522
+ });
3523
+ }
3524
+ };
3525
+ const parseVNodeAnnotations = (doc, node, docData, orgLocationNodes) => {
3526
+ if (node == null) {
3527
+ return;
3528
+ }
3529
+ if (node['s-nr'] != null) {
3530
+ orgLocationNodes.push(node);
3531
+ }
3532
+ if (node.nodeType === 1 /* NODE_TYPE.ElementNode */) {
3533
+ node.childNodes.forEach((childNode) => {
3534
+ const hostRef = getHostRef(childNode);
3535
+ if (hostRef != null && !docData.staticComponents.has(childNode.nodeName.toLowerCase())) {
3536
+ const cmpData = {
3537
+ nodeIds: 0,
3538
+ };
3539
+ insertVNodeAnnotations(doc, childNode, hostRef.$vnode$, docData, cmpData);
3540
+ }
3541
+ parseVNodeAnnotations(doc, childNode, docData, orgLocationNodes);
3542
+ });
3543
+ }
3544
+ };
3545
+ const insertVNodeAnnotations = (doc, hostElm, vnode, docData, cmpData) => {
3546
+ if (vnode != null) {
3547
+ const hostId = ++docData.hostIds;
3548
+ hostElm.setAttribute(HYDRATE_ID, hostId);
3549
+ if (hostElm['s-cr'] != null) {
3550
+ hostElm['s-cr'].nodeValue = `${CONTENT_REF_ID}.${hostId}`;
3551
+ }
3552
+ if (vnode.$children$ != null) {
3553
+ const depth = 0;
3554
+ vnode.$children$.forEach((vnodeChild, index) => {
3555
+ insertChildVNodeAnnotations(doc, vnodeChild, cmpData, hostId, depth, index);
3556
+ });
3557
+ }
3558
+ if (hostElm && vnode && vnode.$elm$ && !hostElm.hasAttribute('c-id')) {
3559
+ const parent = hostElm.parentElement;
3560
+ if (parent && parent.childNodes) {
3561
+ const parentChildNodes = Array.from(parent.childNodes);
3562
+ const comment = parentChildNodes.find((node) => node.nodeType === 8 /* NODE_TYPE.CommentNode */ && node['s-sr']);
3563
+ if (comment) {
3564
+ const index = parentChildNodes.indexOf(hostElm) - 1;
3565
+ vnode.$elm$.setAttribute(HYDRATE_CHILD_ID, `${comment['s-host-id']}.${comment['s-node-id']}.0.${index}`);
3566
+ }
3567
+ }
3568
+ }
3569
+ }
3570
+ };
3571
+ const insertChildVNodeAnnotations = (doc, vnodeChild, cmpData, hostId, depth, index) => {
3572
+ const childElm = vnodeChild.$elm$;
3573
+ if (childElm == null) {
3574
+ return;
3575
+ }
3576
+ const nodeId = cmpData.nodeIds++;
3577
+ const childId = `${hostId}.${nodeId}.${depth}.${index}`;
3578
+ childElm['s-host-id'] = hostId;
3579
+ childElm['s-node-id'] = nodeId;
3580
+ if (childElm.nodeType === 1 /* NODE_TYPE.ElementNode */) {
3581
+ childElm.setAttribute(HYDRATE_CHILD_ID, childId);
3582
+ }
3583
+ else if (childElm.nodeType === 3 /* NODE_TYPE.TextNode */) {
3584
+ const parentNode = childElm.parentNode;
3585
+ const nodeName = parentNode.nodeName;
3586
+ if (nodeName !== 'STYLE' && nodeName !== 'SCRIPT') {
3587
+ const textNodeId = `${TEXT_NODE_ID}.${childId}`;
3588
+ const commentBeforeTextNode = doc.createComment(textNodeId);
3589
+ parentNode.insertBefore(commentBeforeTextNode, childElm);
3590
+ }
3591
+ }
3592
+ else if (childElm.nodeType === 8 /* NODE_TYPE.CommentNode */) {
3593
+ if (childElm['s-sr']) {
3594
+ const slotName = childElm['s-sn'] || '';
3595
+ const slotNodeId = `${SLOT_NODE_ID}.${childId}.${slotName}`;
3596
+ childElm.nodeValue = slotNodeId;
3597
+ }
3598
+ }
3599
+ if (vnodeChild.$children$ != null) {
3600
+ const childDepth = depth + 1;
3601
+ vnodeChild.$children$.forEach((vnode, index) => {
3602
+ insertChildVNodeAnnotations(doc, vnode, cmpData, hostId, childDepth, index);
3603
+ });
3604
+ }
3605
+ };
3606
+ /**
3607
+ * A WeakMap mapping runtime component references to their corresponding host reference
3608
+ * instances.
3609
+ */
3610
+ const hostRefs = /*@__PURE__*/ new WeakMap();
3611
+ /**
3612
+ * Given a {@link d.RuntimeRef} retrieve the corresponding {@link d.HostRef}
3613
+ *
3614
+ * @param ref the runtime ref of interest
3615
+ * @returns the Host reference (if found) or undefined
3616
+ */
3617
+ const getHostRef = (ref) => hostRefs.get(ref);
3618
+ /**
3619
+ * Register a lazy instance with the {@link hostRefs} object so it's
3620
+ * corresponding {@link d.HostRef} can be retrieved later.
3621
+ *
3622
+ * @param lazyInstance the lazy instance of interest
3623
+ * @param hostRef that instances `HostRef` object
3624
+ * @returns a reference to the host ref WeakMap
3625
+ */
3626
+ const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
3627
+ /**
3628
+ * Register a host element for a Stencil component, setting up various metadata
3629
+ * and callbacks based on {@link BUILD} flags as well as the component's runtime
3630
+ * metadata.
3631
+ *
3632
+ * @param hostElement the host element to register
3633
+ * @param cmpMeta runtime metadata for that component
3634
+ * @returns a reference to the host ref WeakMap
3635
+ */
3636
+ const registerHost = (hostElement, cmpMeta) => {
3637
+ const hostRef = {
3638
+ $flags$: 0,
3639
+ $hostElement$: hostElement,
3640
+ $cmpMeta$: cmpMeta,
3641
+ $instanceValues$: new Map(),
3642
+ };
3643
+ if (BUILD.isDev) {
3644
+ hostRef.$renderCount$ = 0;
3645
+ }
3646
+ if (BUILD.method && BUILD.lazyLoad) {
3647
+ hostRef.$onInstancePromise$ = new Promise((r) => (hostRef.$onInstanceResolve$ = r));
3648
+ }
3649
+ if (BUILD.asyncLoading) {
3650
+ hostRef.$onReadyPromise$ = new Promise((r) => (hostRef.$onReadyResolve$ = r));
3651
+ hostElement['s-p'] = [];
3652
+ hostElement['s-rc'] = [];
3653
+ }
3654
+ addHostEventListeners(hostElement, hostRef, cmpMeta.$listeners$, false);
3655
+ return hostRefs.set(hostElement, hostRef);
3656
+ };
3657
+ const isMemberInElement = (elm, memberName) => memberName in elm;
3658
+ const consoleError = (e, el) => (customError || console.error)(e, el);
3659
+ const STENCIL_DEV_MODE = BUILD.isTesting
3660
+ ? ['STENCIL:'] // E2E testing
3661
+ : [
3662
+ '%cstencil',
3663
+ 'color: white;background:#4c47ff;font-weight: bold; font-size:10px; padding:2px 6px; border-radius: 5px',
3664
+ ];
3665
+ const consoleDevError = (...m) => console.error(...STENCIL_DEV_MODE, ...m);
3666
+ const consoleDevWarn = (...m) => console.warn(...STENCIL_DEV_MODE, ...m);
3667
+ const consoleDevInfo = (...m) => console.info(...STENCIL_DEV_MODE, ...m);
3668
+ const setErrorHandler = (handler) => (customError = handler);
3669
+ const cmpModules = /*@__PURE__*/ new Map();
3670
+ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
3671
+ // loadModuleImport
3672
+ const exportName = cmpMeta.$tagName$.replace(/-/g, '_');
3673
+ const bundleId = cmpMeta.$lazyBundleId$;
3674
+ if (BUILD.isDev && typeof bundleId !== 'string') {
3675
+ consoleDevError(`Trying to lazily load component <${cmpMeta.$tagName$}> with style mode "${hostRef.$modeName$}", but it does not exist.`);
3676
+ return undefined;
3677
+ }
3678
+ const module = !BUILD.hotModuleReplacement ? cmpModules.get(bundleId) : false;
3679
+ if (module) {
3680
+ return module[exportName];
3681
+ }
3682
+
3683
+ if (!hmrVersionId || !BUILD.hotModuleReplacement) {
3684
+ const processMod = importedModule => {
3685
+ cmpModules.set(bundleId, importedModule);
3686
+ return importedModule[exportName];
3687
+ }
3688
+ switch(bundleId) {
3689
+
3690
+ case 'b2b-alert.cjs':
3691
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
3692
+ /* webpackMode: "lazy" */
3693
+ './b2b-alert.cjs.entry.js')); }).then(processMod, consoleError);
3694
+ case 'b2b-anchor.cjs':
3695
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
3696
+ /* webpackMode: "lazy" */
3697
+ './b2b-anchor.cjs.entry.js')); }).then(processMod, consoleError);
3698
+ case 'b2b-breadcrumb.cjs':
3699
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
3700
+ /* webpackMode: "lazy" */
3701
+ './b2b-breadcrumb.cjs.entry.js')); }).then(processMod, consoleError);
3702
+ case 'b2b-breadcrumb-item.cjs':
3703
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
3704
+ /* webpackMode: "lazy" */
3705
+ './b2b-breadcrumb-item.cjs.entry.js')); }).then(processMod, consoleError);
3706
+ case 'b2b-card.cjs':
3707
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
3708
+ /* webpackMode: "lazy" */
3709
+ './b2b-card.cjs.entry.js')); }).then(processMod, consoleError);
3710
+ case 'b2b-checkbox-group.cjs':
3711
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
3712
+ /* webpackMode: "lazy" */
3713
+ './b2b-checkbox-group.cjs.entry.js')); }).then(processMod, consoleError);
3714
+ case 'b2b-chip-component.cjs':
3715
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
3716
+ /* webpackMode: "lazy" */
3717
+ './b2b-chip-component.cjs.entry.js')); }).then(processMod, consoleError);
3718
+ case 'b2b-dropdown.cjs':
3719
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
3720
+ /* webpackMode: "lazy" */
3721
+ './b2b-dropdown.cjs.entry.js')); }).then(processMod, consoleError);
3722
+ case 'b2b-grid.cjs':
3723
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
3724
+ /* webpackMode: "lazy" */
3725
+ './b2b-grid.cjs.entry.js')); }).then(processMod, consoleError);
3726
+ case 'b2b-grid-col.cjs':
3727
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
3728
+ /* webpackMode: "lazy" */
3729
+ './b2b-grid-col.cjs.entry.js')); }).then(processMod, consoleError);
3730
+ case 'b2b-grid-row.cjs':
3731
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
3732
+ /* webpackMode: "lazy" */
3733
+ './b2b-grid-row.cjs.entry.js')); }).then(processMod, consoleError);
3734
+ case 'b2b-label.cjs':
3735
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
3736
+ /* webpackMode: "lazy" */
3737
+ './b2b-label.cjs.entry.js')); }).then(processMod, consoleError);
3738
+ case 'b2b-modal.cjs':
3739
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
3740
+ /* webpackMode: "lazy" */
3741
+ './b2b-modal.cjs.entry.js')); }).then(processMod, consoleError);
3742
+ case 'b2b-pagination.cjs':
3743
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
3744
+ /* webpackMode: "lazy" */
3745
+ './b2b-pagination.cjs.entry.js')); }).then(processMod, consoleError);
3746
+ case 'b2b-paragraph.cjs':
3747
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
3748
+ /* webpackMode: "lazy" */
3749
+ './b2b-paragraph.cjs.entry.js')); }).then(processMod, consoleError);
3750
+ case 'b2b-radio-button.cjs':
3751
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
3752
+ /* webpackMode: "lazy" */
3753
+ './b2b-radio-button.cjs.entry.js')); }).then(processMod, consoleError);
3754
+ case 'b2b-radio-group.cjs':
3755
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
3756
+ /* webpackMode: "lazy" */
3757
+ './b2b-radio-group.cjs.entry.js')); }).then(processMod, consoleError);
3758
+ case 'b2b-required-separator.cjs':
3759
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
3760
+ /* webpackMode: "lazy" */
3761
+ './b2b-required-separator.cjs.entry.js')); }).then(processMod, consoleError);
3762
+ case 'b2b-scrollable-container.cjs':
3763
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
3764
+ /* webpackMode: "lazy" */
3765
+ './b2b-scrollable-container.cjs.entry.js')); }).then(processMod, consoleError);
3766
+ case 'b2b-search.cjs':
3767
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
3768
+ /* webpackMode: "lazy" */
3769
+ './b2b-search.cjs.entry.js')); }).then(processMod, consoleError);
3770
+ case 'b2b-tab.cjs':
3771
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
3772
+ /* webpackMode: "lazy" */
3773
+ './b2b-tab.cjs.entry.js')); }).then(processMod, consoleError);
3774
+ case 'b2b-tab-group.cjs':
3775
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
3776
+ /* webpackMode: "lazy" */
3777
+ './b2b-tab-group.cjs.entry.js')); }).then(processMod, consoleError);
3778
+ case 'b2b-tab-panel.cjs':
3779
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
3780
+ /* webpackMode: "lazy" */
3781
+ './b2b-tab-panel.cjs.entry.js')); }).then(processMod, consoleError);
3782
+ case 'b2b-table.cjs':
3783
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
3784
+ /* webpackMode: "lazy" */
3785
+ './b2b-table.cjs.entry.js')); }).then(processMod, consoleError);
3786
+ case 'b2b-table-row.cjs':
3787
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
3788
+ /* webpackMode: "lazy" */
3789
+ './b2b-table-row.cjs.entry.js')); }).then(processMod, consoleError);
3790
+ case 'b2b-table-rowgroup.cjs':
3791
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
3792
+ /* webpackMode: "lazy" */
3793
+ './b2b-table-rowgroup.cjs.entry.js')); }).then(processMod, consoleError);
3794
+ case 'b2b-textarea.cjs':
3795
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
3796
+ /* webpackMode: "lazy" */
3797
+ './b2b-textarea.cjs.entry.js')); }).then(processMod, consoleError);
3798
+ case 'b2b-toggle-button.cjs':
3799
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
3800
+ /* webpackMode: "lazy" */
3801
+ './b2b-toggle-button.cjs.entry.js')); }).then(processMod, consoleError);
3802
+ case 'b2b-toggle-group.cjs':
3803
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
3804
+ /* webpackMode: "lazy" */
3805
+ './b2b-toggle-group.cjs.entry.js')); }).then(processMod, consoleError);
3806
+ case 'b2b-tooltip.cjs':
3807
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
3808
+ /* webpackMode: "lazy" */
3809
+ './b2b-tooltip.cjs.entry.js')); }).then(processMod, consoleError);
3810
+ case 'b2b-wizard.cjs':
3811
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
3812
+ /* webpackMode: "lazy" */
3813
+ './b2b-wizard.cjs.entry.js')); }).then(processMod, consoleError);
3814
+ case 'b2b-wizard-step.cjs':
3815
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
3816
+ /* webpackMode: "lazy" */
3817
+ './b2b-wizard-step.cjs.entry.js')); }).then(processMod, consoleError);
3818
+ case 'b2b-checkbox.cjs':
3819
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
3820
+ /* webpackMode: "lazy" */
3821
+ './b2b-checkbox.cjs.entry.js')); }).then(processMod, consoleError);
3822
+ case 'b2b-headline.cjs':
3823
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
3824
+ /* webpackMode: "lazy" */
3825
+ './b2b-headline.cjs.entry.js')); }).then(processMod, consoleError);
3826
+ case 'b2b-input-group.cjs':
3827
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
3828
+ /* webpackMode: "lazy" */
3829
+ './b2b-input-group.cjs.entry.js')); }).then(processMod, consoleError);
3830
+ case 'b2b-input-list.cjs':
3831
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
3832
+ /* webpackMode: "lazy" */
3833
+ './b2b-input-list.cjs.entry.js')); }).then(processMod, consoleError);
3834
+ case 'b2b-table-cell.cjs':
3835
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
3836
+ /* webpackMode: "lazy" */
3837
+ './b2b-table-cell.cjs.entry.js')); }).then(processMod, consoleError);
3838
+ case 'b2b-table-header.cjs':
3839
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
3840
+ /* webpackMode: "lazy" */
3841
+ './b2b-table-header.cjs.entry.js')); }).then(processMod, consoleError);
3842
+ case 'b2b-wizard-icon.cjs':
3843
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
3844
+ /* webpackMode: "lazy" */
3845
+ './b2b-wizard-icon.cjs.entry.js')); }).then(processMod, consoleError);
3846
+ case 'b2b-button.cjs':
3847
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
3848
+ /* webpackMode: "lazy" */
3849
+ './b2b-button.cjs.entry.js')); }).then(processMod, consoleError);
3850
+ case 'b2b-input.cjs':
3851
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
3852
+ /* webpackMode: "lazy" */
3853
+ './b2b-input.cjs.entry.js')); }).then(processMod, consoleError);
3854
+ case 'b2b-input-list-option.cjs':
3855
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
3856
+ /* webpackMode: "lazy" */
3857
+ './b2b-input-list-option.cjs.entry.js')); }).then(processMod, consoleError);
3858
+ case 'b2b-rounded-icon.cjs':
3859
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
3860
+ /* webpackMode: "lazy" */
3861
+ './b2b-rounded-icon.cjs.entry.js')); }).then(processMod, consoleError);
3862
+ case 'b2b-separator.cjs':
3863
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
3864
+ /* webpackMode: "lazy" */
3865
+ './b2b-separator.cjs.entry.js')); }).then(processMod, consoleError);
3866
+ case 'b2b-spinner.cjs':
3867
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
3868
+ /* webpackMode: "lazy" */
3869
+ './b2b-spinner.cjs.entry.js')); }).then(processMod, consoleError);
3870
+ case 'b2b-icon.cjs':
3871
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
3872
+ /* webpackMode: "lazy" */
3873
+ './b2b-icon.cjs.entry.js')); }).then(processMod, consoleError);
3874
+ case 'b2b-input-label.cjs':
3875
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
3876
+ /* webpackMode: "lazy" */
3877
+ './b2b-input-label.cjs.entry.js')); }).then(processMod, consoleError);
3878
+ }
3879
+ }
3880
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
3881
+ /* @vite-ignore */
3882
+ /* webpackInclude: /\.entry\.js$/ */
3883
+ /* webpackExclude: /\.system\.entry\.js$/ */
3884
+ /* webpackMode: "lazy" */
3885
+ `./${bundleId}.entry.js${BUILD.hotModuleReplacement && hmrVersionId ? '?s-hmr=' + hmrVersionId : ''}`)); }).then((importedModule) => {
3886
+ if (!BUILD.hotModuleReplacement) {
3887
+ cmpModules.set(bundleId, importedModule);
3888
+ }
3889
+ return importedModule[exportName];
3890
+ }, consoleError);
3891
+ };
3892
+ const styles = /*@__PURE__*/ new Map();
3893
+ const modeResolutionChain = [];
3894
+ const win = typeof window !== 'undefined' ? window : {};
3895
+ const doc = win.document || { head: {} };
3896
+ const H = (win.HTMLElement || class {
3897
+ });
3898
+ const plt = {
3899
+ $flags$: 0,
3900
+ $resourcesUrl$: '',
3901
+ jmp: (h) => h(),
3902
+ raf: (h) => requestAnimationFrame(h),
3903
+ ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
3904
+ rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
3905
+ ce: (eventName, opts) => new CustomEvent(eventName, opts),
3906
+ };
3907
+ const setPlatformHelpers = (helpers) => {
3908
+ Object.assign(plt, helpers);
3909
+ };
3910
+ const supportsShadow =
3911
+ // TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
3912
+ BUILD.shadowDomShim && BUILD.shadowDom
3913
+ ? /*@__PURE__*/ (() => (doc.head.attachShadow + '').indexOf('[native') > -1)()
3914
+ : true;
3915
+ const supportsListenerOptions = /*@__PURE__*/ (() => {
3916
+ let supportsListenerOptions = false;
3917
+ try {
3918
+ doc.addEventListener('e', null, Object.defineProperty({}, 'passive', {
3919
+ get() {
3920
+ supportsListenerOptions = true;
3921
+ },
3922
+ }));
3923
+ }
3924
+ catch (e) { }
3925
+ return supportsListenerOptions;
3926
+ })();
3927
+ const promiseResolve = (v) => Promise.resolve(v);
3928
+ const supportsConstructableStylesheets = BUILD.constructableCSS
3929
+ ? /*@__PURE__*/ (() => {
3930
+ try {
3931
+ new CSSStyleSheet();
3932
+ return typeof new CSSStyleSheet().replaceSync === 'function';
3933
+ }
3934
+ catch (e) { }
3935
+ return false;
3936
+ })()
3937
+ : false;
3938
+ const queueDomReads = [];
3939
+ const queueDomWrites = [];
3940
+ const queueDomWritesLow = [];
3941
+ const queueTask = (queue, write) => (cb) => {
3942
+ queue.push(cb);
3943
+ if (!queuePending) {
3944
+ queuePending = true;
3945
+ if (write && plt.$flags$ & 4 /* PLATFORM_FLAGS.queueSync */) {
3946
+ nextTick(flush);
3947
+ }
3948
+ else {
3949
+ plt.raf(flush);
3950
+ }
3951
+ }
3952
+ };
3953
+ const consume = (queue) => {
3954
+ for (let i = 0; i < queue.length; i++) {
3955
+ try {
3956
+ queue[i](performance.now());
3957
+ }
3958
+ catch (e) {
3959
+ consoleError(e);
3960
+ }
3961
+ }
3962
+ queue.length = 0;
3963
+ };
3964
+ const consumeTimeout = (queue, timeout) => {
3965
+ let i = 0;
3966
+ let ts = 0;
3967
+ while (i < queue.length && (ts = performance.now()) < timeout) {
3968
+ try {
3969
+ queue[i++](ts);
3970
+ }
3971
+ catch (e) {
3972
+ consoleError(e);
3973
+ }
3974
+ }
3975
+ if (i === queue.length) {
3976
+ queue.length = 0;
3977
+ }
3978
+ else if (i !== 0) {
3979
+ queue.splice(0, i);
3980
+ }
3981
+ };
3982
+ const flush = () => {
3983
+ if (BUILD.asyncQueue) {
3984
+ queueCongestion++;
3985
+ }
3986
+ // always force a bunch of medium callbacks to run, but still have
3987
+ // a throttle on how many can run in a certain time
3988
+ // DOM READS!!!
3989
+ consume(queueDomReads);
3990
+ // DOM WRITES!!!
3991
+ if (BUILD.asyncQueue) {
3992
+ const timeout = (plt.$flags$ & 6 /* PLATFORM_FLAGS.queueMask */) === 2 /* PLATFORM_FLAGS.appLoaded */
3993
+ ? performance.now() + 14 * Math.ceil(queueCongestion * (1.0 / 10.0))
3994
+ : Infinity;
3995
+ consumeTimeout(queueDomWrites, timeout);
3996
+ consumeTimeout(queueDomWritesLow, timeout);
3997
+ if (queueDomWrites.length > 0) {
3998
+ queueDomWritesLow.push(...queueDomWrites);
3999
+ queueDomWrites.length = 0;
4000
+ }
4001
+ if ((queuePending = queueDomReads.length + queueDomWrites.length + queueDomWritesLow.length > 0)) {
4002
+ // still more to do yet, but we've run out of time
4003
+ // let's let this thing cool off and try again in the next tick
4004
+ plt.raf(flush);
4005
+ }
4006
+ else {
4007
+ queueCongestion = 0;
4008
+ }
4009
+ }
4010
+ else {
4011
+ consume(queueDomWrites);
4012
+ if ((queuePending = queueDomReads.length > 0)) {
4013
+ // still more to do yet, but we've run out of time
4014
+ // let's let this thing cool off and try again in the next tick
4015
+ plt.raf(flush);
4016
+ }
4017
+ }
4018
+ };
4019
+ const nextTick = /*@__PURE__*/ (cb) => promiseResolve().then(cb);
4020
+ const readTask = /*@__PURE__*/ queueTask(queueDomReads, false);
4021
+ const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
4022
+
4023
+ exports.BUILD = BUILD;
4024
+ exports.Build = Build;
4025
+ exports.Env = Env;
4026
+ exports.H = H;
4027
+ exports.Host = Host;
4028
+ exports.NAMESPACE = NAMESPACE;
4029
+ exports.bootstrapLazy = bootstrapLazy;
4030
+ exports.consoleDevInfo = consoleDevInfo;
4031
+ exports.createEvent = createEvent;
4032
+ exports.doc = doc;
4033
+ exports.getAssetPath = getAssetPath;
4034
+ exports.getElement = getElement;
4035
+ exports.h = h;
4036
+ exports.promiseResolve = promiseResolve;
4037
+ exports.registerInstance = registerInstance;
4038
+ exports.setNonce = setNonce;