@pine-ds/core 0.0.2-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (665) hide show
  1. package/LICENSE +21 -0
  2. package/dist/cjs/index-13500e25.js +2468 -0
  3. package/dist/cjs/index-13500e25.js.map +1 -0
  4. package/dist/cjs/index.cjs.js +4 -0
  5. package/dist/cjs/index.cjs.js.map +1 -0
  6. package/dist/cjs/loader.cjs.js +15 -0
  7. package/dist/cjs/loader.cjs.js.map +1 -0
  8. package/dist/cjs/pds-avatar.cjs.entry.js +70 -0
  9. package/dist/cjs/pds-avatar.cjs.entry.js.map +1 -0
  10. package/dist/cjs/pds-button.cjs.entry.js +57 -0
  11. package/dist/cjs/pds-button.cjs.entry.js.map +1 -0
  12. package/dist/cjs/pds-checkbox.cjs.entry.js +57 -0
  13. package/dist/cjs/pds-checkbox.cjs.entry.js.map +1 -0
  14. package/dist/cjs/pds-chip.cjs.entry.js +49 -0
  15. package/dist/cjs/pds-chip.cjs.entry.js.map +1 -0
  16. package/dist/cjs/pds-copytext.cjs.entry.js +68 -0
  17. package/dist/cjs/pds-copytext.cjs.entry.js.map +1 -0
  18. package/dist/cjs/pds-divider.cjs.entry.js +35 -0
  19. package/dist/cjs/pds-divider.cjs.entry.js.map +1 -0
  20. package/dist/cjs/pds-icon.cjs.entry.js +277 -0
  21. package/dist/cjs/pds-icon.cjs.entry.js.map +1 -0
  22. package/dist/cjs/pds-image.cjs.entry.js +31 -0
  23. package/dist/cjs/pds-image.cjs.entry.js.map +1 -0
  24. package/dist/cjs/pds-input.cjs.entry.js +44 -0
  25. package/dist/cjs/pds-input.cjs.entry.js.map +1 -0
  26. package/dist/cjs/pds-label-71ea2cad.js +44 -0
  27. package/dist/cjs/pds-label-71ea2cad.js.map +1 -0
  28. package/dist/cjs/pds-link.cjs.entry.js +37 -0
  29. package/dist/cjs/pds-link.cjs.entry.js.map +1 -0
  30. package/dist/cjs/pds-progress.cjs.entry.js +27 -0
  31. package/dist/cjs/pds-progress.cjs.entry.js.map +1 -0
  32. package/dist/cjs/pds-radio.cjs.entry.js +53 -0
  33. package/dist/cjs/pds-radio.cjs.entry.js.map +1 -0
  34. package/dist/cjs/pds-sortable-item.cjs.entry.js +24 -0
  35. package/dist/cjs/pds-sortable-item.cjs.entry.js.map +1 -0
  36. package/dist/cjs/pds-sortable.cjs.entry.js +2706 -0
  37. package/dist/cjs/pds-sortable.cjs.entry.js.map +1 -0
  38. package/dist/cjs/pds-switch.cjs.entry.js +55 -0
  39. package/dist/cjs/pds-switch.cjs.entry.js.map +1 -0
  40. package/dist/cjs/pds-tab.cjs.entry.js +33 -0
  41. package/dist/cjs/pds-tab.cjs.entry.js.map +1 -0
  42. package/dist/cjs/pds-tabpanel.cjs.entry.js +26 -0
  43. package/dist/cjs/pds-tabpanel.cjs.entry.js.map +1 -0
  44. package/dist/cjs/pds-tabs.cjs.entry.js +98 -0
  45. package/dist/cjs/pds-tabs.cjs.entry.js.map +1 -0
  46. package/dist/cjs/pds-textarea.cjs.entry.js +54 -0
  47. package/dist/cjs/pds-textarea.cjs.entry.js.map +1 -0
  48. package/dist/cjs/pds-tooltip.cjs.entry.js +151 -0
  49. package/dist/cjs/pds-tooltip.cjs.entry.js.map +1 -0
  50. package/dist/cjs/pine-core.cjs.js +25 -0
  51. package/dist/cjs/pine-core.cjs.js.map +1 -0
  52. package/dist/collection/collection-manifest.json +37 -0
  53. package/dist/collection/components/_internal/pds-label/pds-label.js +7 -0
  54. package/dist/collection/components/_internal/pds-label/pds-label.js.map +1 -0
  55. package/dist/collection/components/pds-avatar/pds-avatar.css +59 -0
  56. package/dist/collection/components/pds-avatar/pds-avatar.js +217 -0
  57. package/dist/collection/components/pds-avatar/pds-avatar.js.map +1 -0
  58. package/dist/collection/components/pds-avatar/stories/pds-avatar.stories.js +65 -0
  59. package/dist/collection/components/pds-button/pds-button.css +122 -0
  60. package/dist/collection/components/pds-button/pds-button.js +187 -0
  61. package/dist/collection/components/pds-button/pds-button.js.map +1 -0
  62. package/dist/collection/components/pds-button/stories/pds-button.stories.js +65 -0
  63. package/dist/collection/components/pds-checkbox/pds-checkbox.css +106 -0
  64. package/dist/collection/components/pds-checkbox/pds-checkbox.js +266 -0
  65. package/dist/collection/components/pds-checkbox/pds-checkbox.js.map +1 -0
  66. package/dist/collection/components/pds-checkbox/stories/pds-checkbox.stories.js +80 -0
  67. package/dist/collection/components/pds-chip/pds-chip.css +245 -0
  68. package/dist/collection/components/pds-chip/pds-chip.js +188 -0
  69. package/dist/collection/components/pds-chip/pds-chip.js.map +1 -0
  70. package/dist/collection/components/pds-chip/stories/pds-chip.stories.js +79 -0
  71. package/dist/collection/components/pds-copytext/pds-copytext.css +85 -0
  72. package/dist/collection/components/pds-copytext/pds-copytext.js +186 -0
  73. package/dist/collection/components/pds-copytext/pds-copytext.js.map +1 -0
  74. package/dist/collection/components/pds-copytext/stories/pds-copytext.stories.js +57 -0
  75. package/dist/collection/components/pds-divider/pds-divider.css +92 -0
  76. package/dist/collection/components/pds-divider/pds-divider.js +94 -0
  77. package/dist/collection/components/pds-divider/pds-divider.js.map +1 -0
  78. package/dist/collection/components/pds-divider/stories/pds-divider.stories.js +25 -0
  79. package/dist/collection/components/pds-icon/stories/pds-icon.stories.js +16 -0
  80. package/dist/collection/components/pds-image/pds-image.css +13 -0
  81. package/dist/collection/components/pds-image/pds-image.js +173 -0
  82. package/dist/collection/components/pds-image/pds-image.js.map +1 -0
  83. package/dist/collection/components/pds-image/stories/pds-image.stories.js +35 -0
  84. package/dist/collection/components/pds-input/pds-input.css +88 -0
  85. package/dist/collection/components/pds-input/pds-input.js +279 -0
  86. package/dist/collection/components/pds-input/pds-input.js.map +1 -0
  87. package/dist/collection/components/pds-input/stories/pds-input.stories.js +110 -0
  88. package/dist/collection/components/pds-link/pds-link.css +67 -0
  89. package/dist/collection/components/pds-link/pds-link.js +138 -0
  90. package/dist/collection/components/pds-link/pds-link.js.map +1 -0
  91. package/dist/collection/components/pds-link/stories/pds-link.stories.js +49 -0
  92. package/dist/collection/components/pds-progress/pds-progress.css +77 -0
  93. package/dist/collection/components/pds-progress/pds-progress.js +148 -0
  94. package/dist/collection/components/pds-progress/pds-progress.js.map +1 -0
  95. package/dist/collection/components/pds-progress/stories/pds-progress.stories.js +65 -0
  96. package/dist/collection/components/pds-radio/pds-radio.css +101 -0
  97. package/dist/collection/components/pds-radio/pds-radio.js +261 -0
  98. package/dist/collection/components/pds-radio/pds-radio.js.map +1 -0
  99. package/dist/collection/components/pds-radio/stories/pds-radio.stories.js +71 -0
  100. package/dist/collection/components/pds-sortable/pds-sortable-item/pds-sortable-item.css +63 -0
  101. package/dist/collection/components/pds-sortable/pds-sortable-item/pds-sortable-item.js +90 -0
  102. package/dist/collection/components/pds-sortable/pds-sortable-item/pds-sortable-item.js.map +1 -0
  103. package/dist/collection/components/pds-sortable/pds-sortable-item/stories/pds-sortable-item.stories.js +24 -0
  104. package/dist/collection/components/pds-sortable/pds-sortable.css +10 -0
  105. package/dist/collection/components/pds-sortable/pds-sortable.js +150 -0
  106. package/dist/collection/components/pds-sortable/pds-sortable.js.map +1 -0
  107. package/dist/collection/components/pds-sortable/stories/pds-sortable.stories.js +130 -0
  108. package/dist/collection/components/pds-switch/pds-switch.css +134 -0
  109. package/dist/collection/components/pds-switch/pds-switch.js +277 -0
  110. package/dist/collection/components/pds-switch/pds-switch.js.map +1 -0
  111. package/dist/collection/components/pds-switch/stories/pds-switch.stories.js +102 -0
  112. package/dist/collection/components/pds-tabs/pds-tab/pds-tab.css +158 -0
  113. package/dist/collection/components/pds-tabs/pds-tab/pds-tab.js +154 -0
  114. package/dist/collection/components/pds-tabs/pds-tab/pds-tab.js.map +1 -0
  115. package/dist/collection/components/pds-tabs/pds-tabpanel/pds-tabpanel.css +12 -0
  116. package/dist/collection/components/pds-tabs/pds-tabpanel/pds-tabpanel.js +107 -0
  117. package/dist/collection/components/pds-tabs/pds-tabpanel/pds-tabpanel.js.map +1 -0
  118. package/dist/collection/components/pds-tabs/pds-tabs.css +33 -0
  119. package/dist/collection/components/pds-tabs/pds-tabs.js +209 -0
  120. package/dist/collection/components/pds-tabs/pds-tabs.js.map +1 -0
  121. package/dist/collection/components/pds-tabs/stories/pds-tabs.stories.js +63 -0
  122. package/dist/collection/components/pds-textarea/pds-textarea.css +84 -0
  123. package/dist/collection/components/pds-textarea/pds-textarea.js +303 -0
  124. package/dist/collection/components/pds-textarea/pds-textarea.js.map +1 -0
  125. package/dist/collection/components/pds-textarea/stories/pds-textarea.stories.js +111 -0
  126. package/dist/collection/components/pds-textarea/textarea-interface.js +2 -0
  127. package/dist/collection/components/pds-textarea/textarea-interface.js.map +1 -0
  128. package/dist/collection/components/pds-tooltip/pds-tooltip.css +143 -0
  129. package/dist/collection/components/pds-tooltip/pds-tooltip.js +287 -0
  130. package/dist/collection/components/pds-tooltip/pds-tooltip.js.map +1 -0
  131. package/dist/collection/components/pds-tooltip/stories/pds-tooltip.stories.js +114 -0
  132. package/dist/collection/global/pine-ui-global.js +2 -0
  133. package/dist/collection/global/pine-ui-global.js.map +1 -0
  134. package/dist/collection/index.js +2 -0
  135. package/dist/collection/index.js.map +1 -0
  136. package/dist/collection/stories/_helpers/index.js +15 -0
  137. package/dist/collection/stories/_helpers/index.js.map +1 -0
  138. package/dist/collection/utils/form.js +28 -0
  139. package/dist/collection/utils/form.js.map +1 -0
  140. package/dist/collection/utils/overlay.js +68 -0
  141. package/dist/collection/utils/overlay.js.map +1 -0
  142. package/dist/collection/utils/types.js +2 -0
  143. package/dist/collection/utils/types.js.map +1 -0
  144. package/dist/collection/utils/utils.js +7 -0
  145. package/dist/collection/utils/utils.js.map +1 -0
  146. package/dist/docs.d.ts +421 -0
  147. package/dist/docs.json +3718 -0
  148. package/dist/esm/index-a58668b3.js +2438 -0
  149. package/dist/esm/index-a58668b3.js.map +1 -0
  150. package/dist/esm/index.js +3 -0
  151. package/dist/esm/index.js.map +1 -0
  152. package/dist/esm/loader.js +11 -0
  153. package/dist/esm/loader.js.map +1 -0
  154. package/dist/esm/pds-avatar.entry.js +66 -0
  155. package/dist/esm/pds-avatar.entry.js.map +1 -0
  156. package/dist/esm/pds-button.entry.js +53 -0
  157. package/dist/esm/pds-button.entry.js.map +1 -0
  158. package/dist/esm/pds-checkbox.entry.js +53 -0
  159. package/dist/esm/pds-checkbox.entry.js.map +1 -0
  160. package/dist/esm/pds-chip.entry.js +45 -0
  161. package/dist/esm/pds-chip.entry.js.map +1 -0
  162. package/dist/esm/pds-copytext.entry.js +64 -0
  163. package/dist/esm/pds-copytext.entry.js.map +1 -0
  164. package/dist/esm/pds-divider.entry.js +31 -0
  165. package/dist/esm/pds-divider.entry.js.map +1 -0
  166. package/dist/esm/pds-icon.entry.js +273 -0
  167. package/dist/esm/pds-icon.entry.js.map +1 -0
  168. package/dist/esm/pds-image.entry.js +27 -0
  169. package/dist/esm/pds-image.entry.js.map +1 -0
  170. package/dist/esm/pds-input.entry.js +40 -0
  171. package/dist/esm/pds-input.entry.js.map +1 -0
  172. package/dist/esm/pds-label-a26dd876.js +39 -0
  173. package/dist/esm/pds-label-a26dd876.js.map +1 -0
  174. package/dist/esm/pds-link.entry.js +33 -0
  175. package/dist/esm/pds-link.entry.js.map +1 -0
  176. package/dist/esm/pds-progress.entry.js +23 -0
  177. package/dist/esm/pds-progress.entry.js.map +1 -0
  178. package/dist/esm/pds-radio.entry.js +49 -0
  179. package/dist/esm/pds-radio.entry.js.map +1 -0
  180. package/dist/esm/pds-sortable-item.entry.js +20 -0
  181. package/dist/esm/pds-sortable-item.entry.js.map +1 -0
  182. package/dist/esm/pds-sortable.entry.js +2702 -0
  183. package/dist/esm/pds-sortable.entry.js.map +1 -0
  184. package/dist/esm/pds-switch.entry.js +51 -0
  185. package/dist/esm/pds-switch.entry.js.map +1 -0
  186. package/dist/esm/pds-tab.entry.js +29 -0
  187. package/dist/esm/pds-tab.entry.js.map +1 -0
  188. package/dist/esm/pds-tabpanel.entry.js +22 -0
  189. package/dist/esm/pds-tabpanel.entry.js.map +1 -0
  190. package/dist/esm/pds-tabs.entry.js +94 -0
  191. package/dist/esm/pds-tabs.entry.js.map +1 -0
  192. package/dist/esm/pds-textarea.entry.js +50 -0
  193. package/dist/esm/pds-textarea.entry.js.map +1 -0
  194. package/dist/esm/pds-tooltip.entry.js +147 -0
  195. package/dist/esm/pds-tooltip.entry.js.map +1 -0
  196. package/dist/esm/pine-core.js +20 -0
  197. package/dist/esm/pine-core.js.map +1 -0
  198. package/dist/esm/polyfills/core-js.js +11 -0
  199. package/dist/esm/polyfills/dom.js +79 -0
  200. package/dist/esm/polyfills/es5-html-element.js +1 -0
  201. package/dist/esm/polyfills/index.js +34 -0
  202. package/dist/esm/polyfills/system.js +6 -0
  203. package/dist/esm-es5/index-a58668b3.js +3 -0
  204. package/dist/esm-es5/index-a58668b3.js.map +1 -0
  205. package/dist/esm-es5/index.js +2 -0
  206. package/dist/esm-es5/index.js.map +1 -0
  207. package/dist/esm-es5/loader.js +2 -0
  208. package/dist/esm-es5/loader.js.map +1 -0
  209. package/dist/esm-es5/pds-avatar.entry.js +2 -0
  210. package/dist/esm-es5/pds-avatar.entry.js.map +1 -0
  211. package/dist/esm-es5/pds-button.entry.js +2 -0
  212. package/dist/esm-es5/pds-button.entry.js.map +1 -0
  213. package/dist/esm-es5/pds-checkbox.entry.js +2 -0
  214. package/dist/esm-es5/pds-checkbox.entry.js.map +1 -0
  215. package/dist/esm-es5/pds-chip.entry.js +2 -0
  216. package/dist/esm-es5/pds-chip.entry.js.map +1 -0
  217. package/dist/esm-es5/pds-copytext.entry.js +2 -0
  218. package/dist/esm-es5/pds-copytext.entry.js.map +1 -0
  219. package/dist/esm-es5/pds-divider.entry.js +2 -0
  220. package/dist/esm-es5/pds-divider.entry.js.map +1 -0
  221. package/dist/esm-es5/pds-icon.entry.js +2 -0
  222. package/dist/esm-es5/pds-icon.entry.js.map +1 -0
  223. package/dist/esm-es5/pds-image.entry.js +2 -0
  224. package/dist/esm-es5/pds-image.entry.js.map +1 -0
  225. package/dist/esm-es5/pds-input.entry.js +2 -0
  226. package/dist/esm-es5/pds-input.entry.js.map +1 -0
  227. package/dist/esm-es5/pds-label-a26dd876.js +2 -0
  228. package/dist/esm-es5/pds-label-a26dd876.js.map +1 -0
  229. package/dist/esm-es5/pds-link.entry.js +2 -0
  230. package/dist/esm-es5/pds-link.entry.js.map +1 -0
  231. package/dist/esm-es5/pds-progress.entry.js +2 -0
  232. package/dist/esm-es5/pds-progress.entry.js.map +1 -0
  233. package/dist/esm-es5/pds-radio.entry.js +2 -0
  234. package/dist/esm-es5/pds-radio.entry.js.map +1 -0
  235. package/dist/esm-es5/pds-sortable-item.entry.js +2 -0
  236. package/dist/esm-es5/pds-sortable-item.entry.js.map +1 -0
  237. package/dist/esm-es5/pds-sortable.entry.js +8 -0
  238. package/dist/esm-es5/pds-sortable.entry.js.map +1 -0
  239. package/dist/esm-es5/pds-switch.entry.js +2 -0
  240. package/dist/esm-es5/pds-switch.entry.js.map +1 -0
  241. package/dist/esm-es5/pds-tab.entry.js +2 -0
  242. package/dist/esm-es5/pds-tab.entry.js.map +1 -0
  243. package/dist/esm-es5/pds-tabpanel.entry.js +2 -0
  244. package/dist/esm-es5/pds-tabpanel.entry.js.map +1 -0
  245. package/dist/esm-es5/pds-tabs.entry.js +2 -0
  246. package/dist/esm-es5/pds-tabs.entry.js.map +1 -0
  247. package/dist/esm-es5/pds-textarea.entry.js +2 -0
  248. package/dist/esm-es5/pds-textarea.entry.js.map +1 -0
  249. package/dist/esm-es5/pds-tooltip.entry.js +2 -0
  250. package/dist/esm-es5/pds-tooltip.entry.js.map +1 -0
  251. package/dist/esm-es5/pine-core.js +2 -0
  252. package/dist/esm-es5/pine-core.js.map +1 -0
  253. package/dist/index.cjs.js +1 -0
  254. package/dist/index.js +1 -0
  255. package/dist/pine-core/index.esm.js +2 -0
  256. package/dist/pine-core/index.esm.js.map +1 -0
  257. package/dist/pine-core/p-0a776a7b.entry.js +2 -0
  258. package/dist/pine-core/p-0a776a7b.entry.js.map +1 -0
  259. package/dist/pine-core/p-0adb4b48.entry.js +2 -0
  260. package/dist/pine-core/p-0adb4b48.entry.js.map +1 -0
  261. package/dist/pine-core/p-0c26a00d.entry.js +2 -0
  262. package/dist/pine-core/p-0c26a00d.entry.js.map +1 -0
  263. package/dist/pine-core/p-1c0ffcab.entry.js +2 -0
  264. package/dist/pine-core/p-1c0ffcab.entry.js.map +1 -0
  265. package/dist/pine-core/p-22bd3102.system.entry.js +9 -0
  266. package/dist/pine-core/p-22bd3102.system.entry.js.map +1 -0
  267. package/dist/pine-core/p-22dd8116.entry.js +2 -0
  268. package/dist/pine-core/p-22dd8116.entry.js.map +1 -0
  269. package/dist/pine-core/p-23fb6af2.system.entry.js +2 -0
  270. package/dist/pine-core/p-23fb6af2.system.entry.js.map +1 -0
  271. package/dist/pine-core/p-24077dcd.entry.js +2 -0
  272. package/dist/pine-core/p-24077dcd.entry.js.map +1 -0
  273. package/dist/pine-core/p-27fd7f08.system.entry.js +2 -0
  274. package/dist/pine-core/p-27fd7f08.system.entry.js.map +1 -0
  275. package/dist/pine-core/p-331cbf1d.entry.js +2 -0
  276. package/dist/pine-core/p-331cbf1d.entry.js.map +1 -0
  277. package/dist/pine-core/p-3386bfe1.system.entry.js +2 -0
  278. package/dist/pine-core/p-3386bfe1.system.entry.js.map +1 -0
  279. package/dist/pine-core/p-401cd4bc.entry.js +2 -0
  280. package/dist/pine-core/p-401cd4bc.entry.js.map +1 -0
  281. package/dist/pine-core/p-4a804680.entry.js +2 -0
  282. package/dist/pine-core/p-4a804680.entry.js.map +1 -0
  283. package/dist/pine-core/p-4fc42ff3.system.entry.js +2 -0
  284. package/dist/pine-core/p-4fc42ff3.system.entry.js.map +1 -0
  285. package/dist/pine-core/p-50ea2036.system.js +2 -0
  286. package/dist/pine-core/p-50ea2036.system.js.map +1 -0
  287. package/dist/pine-core/p-5b37a4a2.system.entry.js +2 -0
  288. package/dist/pine-core/p-5b37a4a2.system.entry.js.map +1 -0
  289. package/dist/pine-core/p-643f5378.entry.js +2 -0
  290. package/dist/pine-core/p-643f5378.entry.js.map +1 -0
  291. package/dist/pine-core/p-669d948a.system.entry.js +2 -0
  292. package/dist/pine-core/p-669d948a.system.entry.js.map +1 -0
  293. package/dist/pine-core/p-73262287.system.entry.js +2 -0
  294. package/dist/pine-core/p-73262287.system.entry.js.map +1 -0
  295. package/dist/pine-core/p-79d7e0b1.system.entry.js +2 -0
  296. package/dist/pine-core/p-79d7e0b1.system.entry.js.map +1 -0
  297. package/dist/pine-core/p-7bc01826.entry.js +2 -0
  298. package/dist/pine-core/p-7bc01826.entry.js.map +1 -0
  299. package/dist/pine-core/p-7fcd5f0b.entry.js +8 -0
  300. package/dist/pine-core/p-7fcd5f0b.entry.js.map +1 -0
  301. package/dist/pine-core/p-85f6a94e.system.entry.js +2 -0
  302. package/dist/pine-core/p-85f6a94e.system.entry.js.map +1 -0
  303. package/dist/pine-core/p-8f62c812.entry.js +2 -0
  304. package/dist/pine-core/p-8f62c812.entry.js.map +1 -0
  305. package/dist/pine-core/p-930ab8a3.system.entry.js +2 -0
  306. package/dist/pine-core/p-930ab8a3.system.entry.js.map +1 -0
  307. package/dist/pine-core/p-938886d8.system.entry.js +2 -0
  308. package/dist/pine-core/p-938886d8.system.entry.js.map +1 -0
  309. package/dist/pine-core/p-97cb4285.entry.js +2 -0
  310. package/dist/pine-core/p-97cb4285.entry.js.map +1 -0
  311. package/dist/pine-core/p-abdca153.js +3 -0
  312. package/dist/pine-core/p-abdca153.js.map +1 -0
  313. package/dist/pine-core/p-ac31a7c8.system.entry.js +2 -0
  314. package/dist/pine-core/p-ac31a7c8.system.entry.js.map +1 -0
  315. package/dist/pine-core/p-af75cc15.entry.js +2 -0
  316. package/dist/pine-core/p-af75cc15.entry.js.map +1 -0
  317. package/dist/pine-core/p-b17b818b.entry.js +2 -0
  318. package/dist/pine-core/p-b17b818b.entry.js.map +1 -0
  319. package/dist/pine-core/p-b79a8b07.entry.js +2 -0
  320. package/dist/pine-core/p-b79a8b07.entry.js.map +1 -0
  321. package/dist/pine-core/p-bce2d5b5.system.entry.js +2 -0
  322. package/dist/pine-core/p-bce2d5b5.system.entry.js.map +1 -0
  323. package/dist/pine-core/p-bff583bd.system.js +2 -0
  324. package/dist/pine-core/p-bff583bd.system.js.map +1 -0
  325. package/dist/pine-core/p-c0f9dbe1.system.entry.js +2 -0
  326. package/dist/pine-core/p-c0f9dbe1.system.entry.js.map +1 -0
  327. package/dist/pine-core/p-c4dbae0e.system.js +2 -0
  328. package/dist/pine-core/p-c4dbae0e.system.js.map +1 -0
  329. package/dist/pine-core/p-c6d878f8.entry.js +2 -0
  330. package/dist/pine-core/p-c6d878f8.entry.js.map +1 -0
  331. package/dist/pine-core/p-c8a41b43.system.entry.js +2 -0
  332. package/dist/pine-core/p-c8a41b43.system.entry.js.map +1 -0
  333. package/dist/pine-core/p-d3e173ea.system.entry.js +2 -0
  334. package/dist/pine-core/p-d3e173ea.system.entry.js.map +1 -0
  335. package/dist/pine-core/p-f09892d3.system.entry.js +2 -0
  336. package/dist/pine-core/p-f09892d3.system.entry.js.map +1 -0
  337. package/dist/pine-core/p-f168654a.entry.js +2 -0
  338. package/dist/pine-core/p-f168654a.entry.js.map +1 -0
  339. package/dist/pine-core/p-f1d7f16f.js +2 -0
  340. package/dist/pine-core/p-f1d7f16f.js.map +1 -0
  341. package/dist/pine-core/p-f2c3035d.system.entry.js +2 -0
  342. package/dist/pine-core/p-f2c3035d.system.entry.js.map +1 -0
  343. package/dist/pine-core/p-f3af6d74.system.entry.js +2 -0
  344. package/dist/pine-core/p-f3af6d74.system.entry.js.map +1 -0
  345. package/dist/pine-core/p-fa5d4e73.system.js +3 -0
  346. package/dist/pine-core/p-fa5d4e73.system.js.map +1 -0
  347. package/dist/pine-core/p-fba29e90.entry.js +2 -0
  348. package/dist/pine-core/p-fba29e90.entry.js.map +1 -0
  349. package/dist/pine-core/pine-core.css +1 -0
  350. package/dist/pine-core/pine-core.esm.js +2 -0
  351. package/dist/pine-core/pine-core.esm.js.map +1 -0
  352. package/dist/pine-core/pine-core.js +127 -0
  353. package/dist/pine-core/svg/access-key.svg +1 -0
  354. package/dist/pine-core/svg/add-circle.svg +1 -0
  355. package/dist/pine-core/svg/add-image.svg +1 -0
  356. package/dist/pine-core/svg/add-small.svg +1 -0
  357. package/dist/pine-core/svg/add.svg +1 -0
  358. package/dist/pine-core/svg/ai-sparkle.svg +1 -0
  359. package/dist/pine-core/svg/ai-writer-filled.svg +1 -0
  360. package/dist/pine-core/svg/ai-writer.svg +1 -0
  361. package/dist/pine-core/svg/align-center.svg +1 -0
  362. package/dist/pine-core/svg/align-justify.svg +1 -0
  363. package/dist/pine-core/svg/align-left.svg +1 -0
  364. package/dist/pine-core/svg/align-right.svg +1 -0
  365. package/dist/pine-core/svg/analytics-filled.svg +1 -0
  366. package/dist/pine-core/svg/analytics-outline.svg +1 -0
  367. package/dist/pine-core/svg/app-store.svg +1 -0
  368. package/dist/pine-core/svg/archive.svg +1 -0
  369. package/dist/pine-core/svg/arrow-corner.svg +1 -0
  370. package/dist/pine-core/svg/arrow-down.svg +1 -0
  371. package/dist/pine-core/svg/arrow-left.svg +1 -0
  372. package/dist/pine-core/svg/arrow-right.svg +1 -0
  373. package/dist/pine-core/svg/arrow-up.svg +1 -0
  374. package/dist/pine-core/svg/assessment.svg +1 -0
  375. package/dist/pine-core/svg/at-sign.svg +1 -0
  376. package/dist/pine-core/svg/attach.svg +1 -0
  377. package/dist/pine-core/svg/automations.svg +1 -0
  378. package/dist/pine-core/svg/ban.svg +1 -0
  379. package/dist/pine-core/svg/bank.svg +1 -0
  380. package/dist/pine-core/svg/bell.svg +1 -0
  381. package/dist/pine-core/svg/blog-filled.svg +1 -0
  382. package/dist/pine-core/svg/blog.svg +1 -0
  383. package/dist/pine-core/svg/bold.svg +1 -0
  384. package/dist/pine-core/svg/broadcast.svg +1 -0
  385. package/dist/pine-core/svg/calendar-date.svg +1 -0
  386. package/dist/pine-core/svg/calendar-schedule.svg +1 -0
  387. package/dist/pine-core/svg/calendar-simple.svg +1 -0
  388. package/dist/pine-core/svg/card-bw-amex.svg +1 -0
  389. package/dist/pine-core/svg/card-bw-apple-card.svg +1 -0
  390. package/dist/pine-core/svg/card-bw-diners-club.svg +1 -0
  391. package/dist/pine-core/svg/card-bw-discover.svg +1 -0
  392. package/dist/pine-core/svg/card-bw-gpay-card.svg +1 -0
  393. package/dist/pine-core/svg/card-bw-mastercard.svg +1 -0
  394. package/dist/pine-core/svg/card-bw-paypal.svg +1 -0
  395. package/dist/pine-core/svg/card-bw-stripe.svg +1 -0
  396. package/dist/pine-core/svg/card-bw-visa.svg +1 -0
  397. package/dist/pine-core/svg/card-update.svg +1 -0
  398. package/dist/pine-core/svg/caret-down.svg +1 -0
  399. package/dist/pine-core/svg/caret-left.svg +1 -0
  400. package/dist/pine-core/svg/caret-right.svg +1 -0
  401. package/dist/pine-core/svg/caret-up.svg +1 -0
  402. package/dist/pine-core/svg/cart-add.svg +1 -0
  403. package/dist/pine-core/svg/cart.svg +1 -0
  404. package/dist/pine-core/svg/certificate.svg +1 -0
  405. package/dist/pine-core/svg/check-circle-filled.svg +1 -0
  406. package/dist/pine-core/svg/check-circle.svg +1 -0
  407. package/dist/pine-core/svg/check.svg +1 -0
  408. package/dist/pine-core/svg/circle-1.svg +1 -0
  409. package/dist/pine-core/svg/circle-2.svg +1 -0
  410. package/dist/pine-core/svg/circle-3.svg +1 -0
  411. package/dist/pine-core/svg/circle-4.svg +1 -0
  412. package/dist/pine-core/svg/circle-5.svg +1 -0
  413. package/dist/pine-core/svg/circle-6.svg +1 -0
  414. package/dist/pine-core/svg/circle-7.svg +1 -0
  415. package/dist/pine-core/svg/circle-8.svg +1 -0
  416. package/dist/pine-core/svg/circle-9.svg +1 -0
  417. package/dist/pine-core/svg/clock.svg +1 -0
  418. package/dist/pine-core/svg/closed-captions.svg +1 -0
  419. package/dist/pine-core/svg/cloud-upload.svg +1 -0
  420. package/dist/pine-core/svg/code.svg +1 -0
  421. package/dist/pine-core/svg/color.svg +1 -0
  422. package/dist/pine-core/svg/columns.svg +1 -0
  423. package/dist/pine-core/svg/comment.svg +1 -0
  424. package/dist/pine-core/svg/connect.svg +1 -0
  425. package/dist/pine-core/svg/contact.svg +1 -0
  426. package/dist/pine-core/svg/contacts-filled.svg +1 -0
  427. package/dist/pine-core/svg/contacts-outline.svg +1 -0
  428. package/dist/pine-core/svg/conversation.svg +1 -0
  429. package/dist/pine-core/svg/copy.svg +1 -0
  430. package/dist/pine-core/svg/coupon.svg +1 -0
  431. package/dist/pine-core/svg/course.svg +1 -0
  432. package/dist/pine-core/svg/creator-studio-filled.svg +1 -0
  433. package/dist/pine-core/svg/creator-studio.svg +1 -0
  434. package/dist/pine-core/svg/credit-card.svg +1 -0
  435. package/dist/pine-core/svg/custom-field.svg +1 -0
  436. package/dist/pine-core/svg/customize.svg +1 -0
  437. package/dist/pine-core/svg/danger-filled.svg +1 -0
  438. package/dist/pine-core/svg/danger.svg +1 -0
  439. package/dist/pine-core/svg/dashboard-filled.svg +1 -0
  440. package/dist/pine-core/svg/dashboard-outline.svg +1 -0
  441. package/dist/pine-core/svg/delete-circle.svg +1 -0
  442. package/dist/pine-core/svg/delete-key.svg +1 -0
  443. package/dist/pine-core/svg/delete-x.svg +1 -0
  444. package/dist/pine-core/svg/dollar-sign.svg +1 -0
  445. package/dist/pine-core/svg/dot-menu-horizontal.svg +1 -0
  446. package/dist/pine-core/svg/down-small.svg +1 -0
  447. package/dist/pine-core/svg/download.svg +1 -0
  448. package/dist/pine-core/svg/downsell.svg +1 -0
  449. package/dist/pine-core/svg/draft.svg +1 -0
  450. package/dist/pine-core/svg/drop.svg +1 -0
  451. package/dist/pine-core/svg/duplicate.svg +1 -0
  452. package/dist/pine-core/svg/email-activity.svg +1 -0
  453. package/dist/pine-core/svg/emoji.svg +1 -0
  454. package/dist/pine-core/svg/enlarge-vertical.svg +1 -0
  455. package/dist/pine-core/svg/enlarge.svg +1 -0
  456. package/dist/pine-core/svg/expand.svg +1 -0
  457. package/dist/pine-core/svg/facebook-2.svg +1 -0
  458. package/dist/pine-core/svg/facebook.svg +1 -0
  459. package/dist/pine-core/svg/favorite.svg +1 -0
  460. package/dist/pine-core/svg/feedback.svg +1 -0
  461. package/dist/pine-core/svg/file-money.svg +1 -0
  462. package/dist/pine-core/svg/file.svg +1 -0
  463. package/dist/pine-core/svg/filter.svg +1 -0
  464. package/dist/pine-core/svg/flag.svg +1 -0
  465. package/dist/pine-core/svg/flash-filled.svg +1 -0
  466. package/dist/pine-core/svg/flash.svg +1 -0
  467. package/dist/pine-core/svg/folder-group.svg +1 -0
  468. package/dist/pine-core/svg/folder.svg +1 -0
  469. package/dist/pine-core/svg/form-field.svg +1 -0
  470. package/dist/pine-core/svg/form-filled.svg +1 -0
  471. package/dist/pine-core/svg/form.svg +1 -0
  472. package/dist/pine-core/svg/fullscreen.svg +1 -0
  473. package/dist/pine-core/svg/funnel.svg +1 -0
  474. package/dist/pine-core/svg/grant-offer.svg +1 -0
  475. package/dist/pine-core/svg/handle-2-vertical.svg +1 -0
  476. package/dist/pine-core/svg/handle-2.svg +1 -0
  477. package/dist/pine-core/svg/handle.svg +1 -0
  478. package/dist/pine-core/svg/hashtag.svg +1 -0
  479. package/dist/pine-core/svg/hd-video.svg +1 -0
  480. package/dist/pine-core/svg/heading-large.svg +1 -0
  481. package/dist/pine-core/svg/heading-small.svg +1 -0
  482. package/dist/pine-core/svg/headset.svg +1 -0
  483. package/dist/pine-core/svg/help-filled.svg +1 -0
  484. package/dist/pine-core/svg/help-outline.svg +1 -0
  485. package/dist/pine-core/svg/home-alt.svg +1 -0
  486. package/dist/pine-core/svg/horizontal-line.svg +1 -0
  487. package/dist/pine-core/svg/image.svg +1 -0
  488. package/dist/pine-core/svg/info-circle-filled.svg +1 -0
  489. package/dist/pine-core/svg/info-circle.svg +1 -0
  490. package/dist/pine-core/svg/instagram.svg +1 -0
  491. package/dist/pine-core/svg/ios-battery.svg +1 -0
  492. package/dist/pine-core/svg/ios-data.svg +1 -0
  493. package/dist/pine-core/svg/ios-wifi.svg +1 -0
  494. package/dist/pine-core/svg/italic.svg +1 -0
  495. package/dist/pine-core/svg/kajabi-filled.svg +1 -0
  496. package/dist/pine-core/svg/kajabi-outlined.svg +1 -0
  497. package/dist/pine-core/svg/lab.svg +1 -0
  498. package/dist/pine-core/svg/launch.svg +1 -0
  499. package/dist/pine-core/svg/layout-grid.svg +1 -0
  500. package/dist/pine-core/svg/layout-list.svg +1 -0
  501. package/dist/pine-core/svg/left-small.svg +1 -0
  502. package/dist/pine-core/svg/linkedin.svg +1 -0
  503. package/dist/pine-core/svg/list-bullet.svg +1 -0
  504. package/dist/pine-core/svg/list-numbers.svg +1 -0
  505. package/dist/pine-core/svg/location.svg +1 -0
  506. package/dist/pine-core/svg/lock-alt.svg +1 -0
  507. package/dist/pine-core/svg/lock.svg +1 -0
  508. package/dist/pine-core/svg/logo-afterpay.svg +1 -0
  509. package/dist/pine-core/svg/loop.svg +1 -0
  510. package/dist/pine-core/svg/mail-filled.svg +1 -0
  511. package/dist/pine-core/svg/mail.svg +1 -0
  512. package/dist/pine-core/svg/map.svg +1 -0
  513. package/dist/pine-core/svg/mapped.svg +1 -0
  514. package/dist/pine-core/svg/margin-left.svg +1 -0
  515. package/dist/pine-core/svg/margin-right.svg +1 -0
  516. package/dist/pine-core/svg/marker-filled.svg +1 -0
  517. package/dist/pine-core/svg/marker.svg +1 -0
  518. package/dist/pine-core/svg/marketing-filled.svg +1 -0
  519. package/dist/pine-core/svg/marketing-outline.svg +1 -0
  520. package/dist/pine-core/svg/menu-2.svg +1 -0
  521. package/dist/pine-core/svg/menu-alt.svg +1 -0
  522. package/dist/pine-core/svg/menu.svg +1 -0
  523. package/dist/pine-core/svg/merge.svg +1 -0
  524. package/dist/pine-core/svg/microphone-off.svg +1 -0
  525. package/dist/pine-core/svg/microphone.svg +1 -0
  526. package/dist/pine-core/svg/move-left.svg +1 -0
  527. package/dist/pine-core/svg/move-right.svg +1 -0
  528. package/dist/pine-core/svg/multi-pay.svg +1 -0
  529. package/dist/pine-core/svg/newsletter.svg +1 -0
  530. package/dist/pine-core/svg/one-off-session.svg +1 -0
  531. package/dist/pine-core/svg/one-time.svg +1 -0
  532. package/dist/pine-core/svg/partners-filled.svg +1 -0
  533. package/dist/pine-core/svg/partners-outline.svg +1 -0
  534. package/dist/pine-core/svg/pause-circle.svg +1 -0
  535. package/dist/pine-core/svg/pause.svg +1 -0
  536. package/dist/pine-core/svg/payout.svg +1 -0
  537. package/dist/pine-core/svg/pen.svg +1 -0
  538. package/dist/pine-core/svg/phone-portrait.svg +1 -0
  539. package/dist/pine-core/svg/phone-toolbar.svg +1 -0
  540. package/dist/pine-core/svg/play-circle.svg +1 -0
  541. package/dist/pine-core/svg/play-outline.svg +1 -0
  542. package/dist/pine-core/svg/play-store.svg +1 -0
  543. package/dist/pine-core/svg/play.svg +1 -0
  544. package/dist/pine-core/svg/plug.svg +1 -0
  545. package/dist/pine-core/svg/premium.svg +1 -0
  546. package/dist/pine-core/svg/present.svg +1 -0
  547. package/dist/pine-core/svg/preview-off.svg +1 -0
  548. package/dist/pine-core/svg/preview-on.svg +1 -0
  549. package/dist/pine-core/svg/products-filled.svg +1 -0
  550. package/dist/pine-core/svg/products-outline.svg +1 -0
  551. package/dist/pine-core/svg/question-circle.svg +1 -0
  552. package/dist/pine-core/svg/quote.svg +1 -0
  553. package/dist/pine-core/svg/redo.svg +1 -0
  554. package/dist/pine-core/svg/refresh.svg +1 -0
  555. package/dist/pine-core/svg/remove-circle.svg +1 -0
  556. package/dist/pine-core/svg/remove.svg +1 -0
  557. package/dist/pine-core/svg/rename.svg +1 -0
  558. package/dist/pine-core/svg/reset-password.svg +1 -0
  559. package/dist/pine-core/svg/restore.svg +1 -0
  560. package/dist/pine-core/svg/right-small.svg +1 -0
  561. package/dist/pine-core/svg/round-dollar.svg +1 -0
  562. package/dist/pine-core/svg/rows.svg +1 -0
  563. package/dist/pine-core/svg/sales-filled.svg +1 -0
  564. package/dist/pine-core/svg/sales-outline.svg +1 -0
  565. package/dist/pine-core/svg/scissor.svg +1 -0
  566. package/dist/pine-core/svg/screen-share-off.svg +1 -0
  567. package/dist/pine-core/svg/screen-share-on.svg +1 -0
  568. package/dist/pine-core/svg/search-small.svg +1 -0
  569. package/dist/pine-core/svg/search.svg +1 -0
  570. package/dist/pine-core/svg/send-message.svg +1 -0
  571. package/dist/pine-core/svg/sequences.svg +1 -0
  572. package/dist/pine-core/svg/series.svg +1 -0
  573. package/dist/pine-core/svg/settings-filled.svg +1 -0
  574. package/dist/pine-core/svg/settings-outline.svg +1 -0
  575. package/dist/pine-core/svg/share.svg +1 -0
  576. package/dist/pine-core/svg/skipped.svg +1 -0
  577. package/dist/pine-core/svg/slash-divider.svg +1 -0
  578. package/dist/pine-core/svg/sparkle-filled.svg +1 -0
  579. package/dist/pine-core/svg/sparkle.svg +1 -0
  580. package/dist/pine-core/svg/speaker.svg +1 -0
  581. package/dist/pine-core/svg/stack.svg +1 -0
  582. package/dist/pine-core/svg/star.svg +1 -0
  583. package/dist/pine-core/svg/stop.svg +1 -0
  584. package/dist/pine-core/svg/stopwatch.svg +1 -0
  585. package/dist/pine-core/svg/strikethrough.svg +1 -0
  586. package/dist/pine-core/svg/subscript.svg +1 -0
  587. package/dist/pine-core/svg/subscriptions.svg +1 -0
  588. package/dist/pine-core/svg/super-admin.svg +1 -0
  589. package/dist/pine-core/svg/superscript.svg +1 -0
  590. package/dist/pine-core/svg/sync.svg +1 -0
  591. package/dist/pine-core/svg/tablet-landscape.svg +1 -0
  592. package/dist/pine-core/svg/tablet-portrait.svg +1 -0
  593. package/dist/pine-core/svg/text-styles.svg +1 -0
  594. package/dist/pine-core/svg/theme-store-filled.svg +1 -0
  595. package/dist/pine-core/svg/theme-store.svg +1 -0
  596. package/dist/pine-core/svg/thumbs-down-filled.svg +1 -0
  597. package/dist/pine-core/svg/thumbs-down.svg +1 -0
  598. package/dist/pine-core/svg/thumbs-up-filled.svg +1 -0
  599. package/dist/pine-core/svg/thumbs-up.svg +1 -0
  600. package/dist/pine-core/svg/tiktok.svg +1 -0
  601. package/dist/pine-core/svg/trash.svg +1 -0
  602. package/dist/pine-core/svg/twitter.svg +1 -0
  603. package/dist/pine-core/svg/underline.svg +1 -0
  604. package/dist/pine-core/svg/undo.svg +1 -0
  605. package/dist/pine-core/svg/unlock.svg +1 -0
  606. package/dist/pine-core/svg/unmapped.svg +1 -0
  607. package/dist/pine-core/svg/up-small.svg +1 -0
  608. package/dist/pine-core/svg/upload.svg +1 -0
  609. package/dist/pine-core/svg/url.svg +1 -0
  610. package/dist/pine-core/svg/user-filled.svg +1 -0
  611. package/dist/pine-core/svg/user.svg +1 -0
  612. package/dist/pine-core/svg/users-wm.svg +1 -0
  613. package/dist/pine-core/svg/users.svg +1 -0
  614. package/dist/pine-core/svg/video-off.svg +1 -0
  615. package/dist/pine-core/svg/video-on.svg +1 -0
  616. package/dist/pine-core/svg/warning-filled.svg +1 -0
  617. package/dist/pine-core/svg/warning.svg +1 -0
  618. package/dist/pine-core/svg/website-filled.svg +1 -0
  619. package/dist/pine-core/svg/website-outline.svg +1 -0
  620. package/dist/pine-core/svg/window-paragraph.svg +1 -0
  621. package/dist/pine-core/svg/world.svg +1 -0
  622. package/dist/pine-core/svg/wrench.svg +1 -0
  623. package/dist/pine-core/svg/youtube.svg +1 -0
  624. package/dist/scripts/build-tokens.js +160 -0
  625. package/dist/scripts/build-tokens.js.map +1 -0
  626. package/dist/types/components/_internal/pds-label/pds-label.d.ts +22 -0
  627. package/dist/types/components/pds-avatar/pds-avatar.d.ts +42 -0
  628. package/dist/types/components/pds-button/pds-button.d.ts +36 -0
  629. package/dist/types/components/pds-checkbox/pds-checkbox.d.ts +55 -0
  630. package/dist/types/components/pds-chip/pds-chip.d.ts +39 -0
  631. package/dist/types/components/pds-copytext/pds-copytext.d.ts +34 -0
  632. package/dist/types/components/pds-divider/pds-divider.d.ts +17 -0
  633. package/dist/types/components/pds-image/pds-image.d.ts +42 -0
  634. package/dist/types/components/pds-input/pds-input.d.ts +59 -0
  635. package/dist/types/components/pds-link/pds-link.d.ts +34 -0
  636. package/dist/types/components/pds-progress/pds-progress.d.ts +31 -0
  637. package/dist/types/components/pds-radio/pds-radio.d.ts +54 -0
  638. package/dist/types/components/pds-sortable/pds-sortable-item/pds-sortable-item.d.ts +20 -0
  639. package/dist/types/components/pds-sortable/pds-sortable.d.ts +28 -0
  640. package/dist/types/components/pds-switch/pds-switch.d.ts +59 -0
  641. package/dist/types/components/pds-tabs/pds-tab/pds-tab.d.ts +35 -0
  642. package/dist/types/components/pds-tabs/pds-tabpanel/pds-tabpanel.d.ts +23 -0
  643. package/dist/types/components/pds-tabs/pds-tabs.d.ts +40 -0
  644. package/dist/types/components/pds-textarea/pds-textarea.d.ts +64 -0
  645. package/dist/types/components/pds-textarea/textarea-interface.d.ts +8 -0
  646. package/dist/types/components/pds-tooltip/pds-tooltip.d.ts +68 -0
  647. package/dist/types/components.d.ts +1566 -0
  648. package/dist/types/global/pine-ui-global.d.ts +1 -0
  649. package/dist/types/home/runner/work/pine/pine/libs/core/.stencil/scripts/build-tokens.d.ts +1 -0
  650. package/dist/types/index.d.ts +1 -0
  651. package/dist/types/interface.d.ts +17 -0
  652. package/dist/types/stencil-public-runtime.d.ts +1681 -0
  653. package/dist/types/stories/_helpers/index.d.ts +12 -0
  654. package/dist/types/utils/form.d.ts +12 -0
  655. package/dist/types/utils/overlay.d.ts +8 -0
  656. package/dist/types/utils/types.d.ts +1 -0
  657. package/dist/types/utils/utils.d.ts +2 -0
  658. package/loader/cdn.js +3 -0
  659. package/loader/index.cjs.js +3 -0
  660. package/loader/index.d.ts +21 -0
  661. package/loader/index.es2017.js +3 -0
  662. package/loader/index.js +4 -0
  663. package/loader/package.json +11 -0
  664. package/package.json +115 -0
  665. package/readme.md +75 -0
@@ -0,0 +1,2468 @@
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 = 'pine-core';
24
+ const BUILD = /* pine-core */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: true, cmpDidUnload: false, cmpDidUpdate: true, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: true, cmpWillUpdate: false, connectedCallback: true, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: true, element: false, event: true, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: true, hostListenerTarget: true, hostListenerTargetBody: true, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: false, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: true, mode: false, observeAttribute: true, profile: false, prop: true, propBoolean: true, propMutable: true, propNumber: true, propString: true, reflect: true, scoped: true, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, slot: true, slotChildNodesFix: false, slotRelocation: true, state: true, style: true, svg: false, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: true, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: true, vdomText: true, vdomXlink: true, watchCallback: true };
25
+
26
+ /**
27
+ * Virtual DOM patching algorithm based on Snabbdom by
28
+ * Simon Friis Vindum (@paldepind)
29
+ * Licensed under the MIT License
30
+ * https://github.com/snabbdom/snabbdom/blob/master/LICENSE
31
+ *
32
+ * Modified for Stencil's renderer and slot projection
33
+ */
34
+ let scopeId;
35
+ let contentRef;
36
+ let hostTagName;
37
+ let useNativeShadowDom = false;
38
+ let checkSlotFallbackVisibility = false;
39
+ let checkSlotRelocate = false;
40
+ let isSvgMode = false;
41
+ let queuePending = false;
42
+ const getAssetPath = (path) => {
43
+ const assetUrl = new URL(path, plt.$resourcesUrl$);
44
+ return assetUrl.origin !== win.location.origin ? assetUrl.href : assetUrl.pathname;
45
+ };
46
+ const createTime = (fnName, tagName = '') => {
47
+ {
48
+ return () => {
49
+ return;
50
+ };
51
+ }
52
+ };
53
+ const uniqueTime = (key, measureText) => {
54
+ {
55
+ return () => {
56
+ return;
57
+ };
58
+ }
59
+ };
60
+ const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
61
+ /**
62
+ * Constant for styles to be globally applied to `slot-fb` elements for pseudo-slot behavior.
63
+ *
64
+ * Two cascading rules must be used instead of a `:not()` selector due to Stencil browser
65
+ * support as of Stencil v4.
66
+ */
67
+ const SLOT_FB_CSS = 'slot-fb{display:contents}slot-fb[hidden]{display:none}';
68
+ const XLINK_NS = 'http://www.w3.org/1999/xlink';
69
+ /**
70
+ * Default style mode id
71
+ */
72
+ /**
73
+ * Reusable empty obj/array
74
+ * Don't add values to these!!
75
+ */
76
+ const EMPTY_OBJ = {};
77
+ const isDef = (v) => v != null;
78
+ /**
79
+ * Check whether a value is a 'complex type', defined here as an object or a
80
+ * function.
81
+ *
82
+ * @param o the value to check
83
+ * @returns whether it's a complex type or not
84
+ */
85
+ const isComplexType = (o) => {
86
+ // https://jsperf.com/typeof-fn-object/5
87
+ o = typeof o;
88
+ return o === 'object' || o === 'function';
89
+ };
90
+ /**
91
+ * Helper method for querying a `meta` tag that contains a nonce value
92
+ * out of a DOM's head.
93
+ *
94
+ * @param doc The DOM containing the `head` to query against
95
+ * @returns The content of the meta tag representing the nonce value, or `undefined` if no tag
96
+ * exists or the tag has no content.
97
+ */
98
+ function queryNonceMetaTagContent(doc) {
99
+ var _a, _b, _c;
100
+ 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;
101
+ }
102
+ /**
103
+ * Production h() function based on Preact by
104
+ * Jason Miller (@developit)
105
+ * Licensed under the MIT License
106
+ * https://github.com/developit/preact/blob/master/LICENSE
107
+ *
108
+ * Modified for Stencil's compiler and vdom
109
+ */
110
+ // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, child?: d.ChildType): d.VNode;
111
+ // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;
112
+ const h = (nodeName, vnodeData, ...children) => {
113
+ let child = null;
114
+ let key = null;
115
+ let slotName = null;
116
+ let simple = false;
117
+ let lastSimple = false;
118
+ const vNodeChildren = [];
119
+ const walk = (c) => {
120
+ for (let i = 0; i < c.length; i++) {
121
+ child = c[i];
122
+ if (Array.isArray(child)) {
123
+ walk(child);
124
+ }
125
+ else if (child != null && typeof child !== 'boolean') {
126
+ if ((simple = typeof nodeName !== 'function' && !isComplexType(child))) {
127
+ child = String(child);
128
+ }
129
+ if (simple && lastSimple) {
130
+ // If the previous child was simple (string), we merge both
131
+ vNodeChildren[vNodeChildren.length - 1].$text$ += child;
132
+ }
133
+ else {
134
+ // Append a new vNode, if it's text, we create a text vNode
135
+ vNodeChildren.push(simple ? newVNode(null, child) : child);
136
+ }
137
+ lastSimple = simple;
138
+ }
139
+ }
140
+ };
141
+ walk(children);
142
+ if (vnodeData) {
143
+ if (vnodeData.key) {
144
+ key = vnodeData.key;
145
+ }
146
+ if (vnodeData.name) {
147
+ slotName = vnodeData.name;
148
+ }
149
+ // normalize class / className attributes
150
+ {
151
+ const classData = vnodeData.className || vnodeData.class;
152
+ if (classData) {
153
+ vnodeData.class =
154
+ typeof classData !== 'object'
155
+ ? classData
156
+ : Object.keys(classData)
157
+ .filter((k) => classData[k])
158
+ .join(' ');
159
+ }
160
+ }
161
+ }
162
+ if (typeof nodeName === 'function') {
163
+ // nodeName is a functional component
164
+ return nodeName(vnodeData === null ? {} : vnodeData, vNodeChildren, vdomFnUtils);
165
+ }
166
+ const vnode = newVNode(nodeName, null);
167
+ vnode.$attrs$ = vnodeData;
168
+ if (vNodeChildren.length > 0) {
169
+ vnode.$children$ = vNodeChildren;
170
+ }
171
+ {
172
+ vnode.$key$ = key;
173
+ }
174
+ {
175
+ vnode.$name$ = slotName;
176
+ }
177
+ return vnode;
178
+ };
179
+ /**
180
+ * A utility function for creating a virtual DOM node from a tag and some
181
+ * possible text content.
182
+ *
183
+ * @param tag the tag for this element
184
+ * @param text possible text content for the node
185
+ * @returns a newly-minted virtual DOM node
186
+ */
187
+ const newVNode = (tag, text) => {
188
+ const vnode = {
189
+ $flags$: 0,
190
+ $tag$: tag,
191
+ $text$: text,
192
+ $elm$: null,
193
+ $children$: null,
194
+ };
195
+ {
196
+ vnode.$attrs$ = null;
197
+ }
198
+ {
199
+ vnode.$key$ = null;
200
+ }
201
+ {
202
+ vnode.$name$ = null;
203
+ }
204
+ return vnode;
205
+ };
206
+ const Host = {};
207
+ /**
208
+ * Check whether a given node is a Host node or not
209
+ *
210
+ * @param node the virtual DOM node to check
211
+ * @returns whether it's a Host node or not
212
+ */
213
+ const isHost = (node) => node && node.$tag$ === Host;
214
+ /**
215
+ * Implementation of {@link d.FunctionalUtilities} for Stencil's VDom.
216
+ *
217
+ * Note that these functions convert from {@link d.VNode} to
218
+ * {@link d.ChildNode} to give functional component developers a friendly
219
+ * interface.
220
+ */
221
+ const vdomFnUtils = {
222
+ forEach: (children, cb) => children.map(convertToPublic).forEach(cb),
223
+ map: (children, cb) => children.map(convertToPublic).map(cb).map(convertToPrivate),
224
+ };
225
+ /**
226
+ * Convert a {@link d.VNode} to a {@link d.ChildNode} in order to present a
227
+ * friendlier public interface (hence, 'convertToPublic').
228
+ *
229
+ * @param node the virtual DOM node to convert
230
+ * @returns a converted child node
231
+ */
232
+ const convertToPublic = (node) => ({
233
+ vattrs: node.$attrs$,
234
+ vchildren: node.$children$,
235
+ vkey: node.$key$,
236
+ vname: node.$name$,
237
+ vtag: node.$tag$,
238
+ vtext: node.$text$,
239
+ });
240
+ /**
241
+ * Convert a {@link d.ChildNode} back to an equivalent {@link d.VNode} in
242
+ * order to use the resulting object in the virtual DOM. The initial object was
243
+ * likely created as part of presenting a public API, so converting it back
244
+ * involved making it 'private' again (hence, `convertToPrivate`).
245
+ *
246
+ * @param node the child node to convert
247
+ * @returns a converted virtual DOM node
248
+ */
249
+ const convertToPrivate = (node) => {
250
+ if (typeof node.vtag === 'function') {
251
+ const vnodeData = Object.assign({}, node.vattrs);
252
+ if (node.vkey) {
253
+ vnodeData.key = node.vkey;
254
+ }
255
+ if (node.vname) {
256
+ vnodeData.name = node.vname;
257
+ }
258
+ return h(node.vtag, vnodeData, ...(node.vchildren || []));
259
+ }
260
+ const vnode = newVNode(node.vtag, node.vtext);
261
+ vnode.$attrs$ = node.vattrs;
262
+ vnode.$children$ = node.vchildren;
263
+ vnode.$key$ = node.vkey;
264
+ vnode.$name$ = node.vname;
265
+ return vnode;
266
+ };
267
+ /**
268
+ * Parse a new property value for a given property type.
269
+ *
270
+ * While the prop value can reasonably be expected to be of `any` type as far as TypeScript's type checker is concerned,
271
+ * it is not safe to assume that the string returned by evaluating `typeof propValue` matches:
272
+ * 1. `any`, the type given to `propValue` in the function signature
273
+ * 2. the type stored from `propType`.
274
+ *
275
+ * This function provides the capability to parse/coerce a property's value to potentially any other JavaScript type.
276
+ *
277
+ * Property values represented in TSX preserve their type information. In the example below, the number 0 is passed to
278
+ * a component. This `propValue` will preserve its type information (`typeof propValue === 'number'`). Note that is
279
+ * based on the type of the value being passed in, not the type declared of the class member decorated with `@Prop`.
280
+ * ```tsx
281
+ * <my-cmp prop-val={0}></my-cmp>
282
+ * ```
283
+ *
284
+ * HTML prop values on the other hand, will always a string
285
+ *
286
+ * @param propValue the new value to coerce to some type
287
+ * @param propType the type of the prop, expressed as a binary number
288
+ * @returns the parsed/coerced value
289
+ */
290
+ const parsePropertyValue = (propValue, propType) => {
291
+ // ensure this value is of the correct prop type
292
+ if (propValue != null && !isComplexType(propValue)) {
293
+ if (propType & 4 /* MEMBER_FLAGS.Boolean */) {
294
+ // per the HTML spec, any string value means it is a boolean true value
295
+ // but we'll cheat here and say that the string "false" is the boolean false
296
+ return propValue === 'false' ? false : propValue === '' || !!propValue;
297
+ }
298
+ if (propType & 2 /* MEMBER_FLAGS.Number */) {
299
+ // force it to be a number
300
+ return parseFloat(propValue);
301
+ }
302
+ if (propType & 1 /* MEMBER_FLAGS.String */) {
303
+ // could have been passed as a number or boolean
304
+ // but we still want it as a string
305
+ return String(propValue);
306
+ }
307
+ // redundant return here for better minification
308
+ return propValue;
309
+ }
310
+ // not sure exactly what type we want
311
+ // so no need to change to a different type
312
+ return propValue;
313
+ };
314
+ const getElement = (ref) => (getHostRef(ref).$hostElement$ );
315
+ const createEvent = (ref, name, flags) => {
316
+ const elm = getElement(ref);
317
+ return {
318
+ emit: (detail) => {
319
+ return emitEvent(elm, name, {
320
+ bubbles: !!(flags & 4 /* EVENT_FLAGS.Bubbles */),
321
+ composed: !!(flags & 2 /* EVENT_FLAGS.Composed */),
322
+ cancelable: !!(flags & 1 /* EVENT_FLAGS.Cancellable */),
323
+ detail,
324
+ });
325
+ },
326
+ };
327
+ };
328
+ /**
329
+ * Helper function to create & dispatch a custom Event on a provided target
330
+ * @param elm the target of the Event
331
+ * @param name the name to give the custom Event
332
+ * @param opts options for configuring a custom Event
333
+ * @returns the custom Event
334
+ */
335
+ const emitEvent = (elm, name, opts) => {
336
+ const ev = plt.ce(name, opts);
337
+ elm.dispatchEvent(ev);
338
+ return ev;
339
+ };
340
+ const rootAppliedStyles = /*@__PURE__*/ new WeakMap();
341
+ const registerStyle = (scopeId, cssText, allowCS) => {
342
+ let style = styles.get(scopeId);
343
+ if (supportsConstructableStylesheets && allowCS) {
344
+ style = (style || new CSSStyleSheet());
345
+ if (typeof style === 'string') {
346
+ style = cssText;
347
+ }
348
+ else {
349
+ style.replaceSync(cssText);
350
+ }
351
+ }
352
+ else {
353
+ style = cssText;
354
+ }
355
+ styles.set(scopeId, style);
356
+ };
357
+ const addStyle = (styleContainerNode, cmpMeta, mode) => {
358
+ var _a;
359
+ const scopeId = getScopeId(cmpMeta);
360
+ const style = styles.get(scopeId);
361
+ // if an element is NOT connected then getRootNode() will return the wrong root node
362
+ // so the fallback is to always use the document for the root node in those cases
363
+ styleContainerNode = styleContainerNode.nodeType === 11 /* NODE_TYPE.DocumentFragment */ ? styleContainerNode : doc;
364
+ if (style) {
365
+ if (typeof style === 'string') {
366
+ styleContainerNode = styleContainerNode.head || styleContainerNode;
367
+ let appliedStyles = rootAppliedStyles.get(styleContainerNode);
368
+ let styleElm;
369
+ if (!appliedStyles) {
370
+ rootAppliedStyles.set(styleContainerNode, (appliedStyles = new Set()));
371
+ }
372
+ if (!appliedStyles.has(scopeId)) {
373
+ {
374
+ styleElm = doc.createElement('style');
375
+ styleElm.innerHTML = style;
376
+ // Apply CSP nonce to the style tag if it exists
377
+ const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
378
+ if (nonce != null) {
379
+ styleElm.setAttribute('nonce', nonce);
380
+ }
381
+ styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
382
+ }
383
+ // Add styles for `slot-fb` elements if we're using slots outside the Shadow DOM
384
+ if (cmpMeta.$flags$ & 4 /* CMP_FLAGS.hasSlotRelocation */) {
385
+ styleElm.innerHTML += SLOT_FB_CSS;
386
+ }
387
+ if (appliedStyles) {
388
+ appliedStyles.add(scopeId);
389
+ }
390
+ }
391
+ }
392
+ else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
393
+ styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
394
+ }
395
+ }
396
+ return scopeId;
397
+ };
398
+ const attachStyles = (hostRef) => {
399
+ const cmpMeta = hostRef.$cmpMeta$;
400
+ const elm = hostRef.$hostElement$;
401
+ const flags = cmpMeta.$flags$;
402
+ const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
403
+ const scopeId = addStyle(elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta);
404
+ if (flags & 10 /* CMP_FLAGS.needsScopedEncapsulation */) {
405
+ // only required when we're NOT using native shadow dom (slot)
406
+ // or this browser doesn't support native shadow dom
407
+ // and this host element was NOT created with SSR
408
+ // let's pick out the inner content for slot projection
409
+ // create a node to represent where the original
410
+ // content was first placed, which is useful later on
411
+ // DOM WRITE!!
412
+ elm['s-sc'] = scopeId;
413
+ elm.classList.add(scopeId + '-h');
414
+ if (flags & 2 /* CMP_FLAGS.scopedCssEncapsulation */) {
415
+ elm.classList.add(scopeId + '-s');
416
+ }
417
+ }
418
+ endAttachStyles();
419
+ };
420
+ const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
421
+ /**
422
+ * Production setAccessor() function based on Preact by
423
+ * Jason Miller (@developit)
424
+ * Licensed under the MIT License
425
+ * https://github.com/developit/preact/blob/master/LICENSE
426
+ *
427
+ * Modified for Stencil's compiler and vdom
428
+ */
429
+ /**
430
+ * When running a VDom render set properties present on a VDom node onto the
431
+ * corresponding HTML element.
432
+ *
433
+ * Note that this function has special functionality for the `class`,
434
+ * `style`, `key`, and `ref` attributes, as well as event handlers (like
435
+ * `onClick`, etc). All others are just passed through as-is.
436
+ *
437
+ * @param elm the HTMLElement onto which attributes should be set
438
+ * @param memberName the name of the attribute to set
439
+ * @param oldValue the old value for the attribute
440
+ * @param newValue the new value for the attribute
441
+ * @param isSvg whether we're in an svg context or not
442
+ * @param flags bitflags for Vdom variables
443
+ */
444
+ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
445
+ if (oldValue !== newValue) {
446
+ let isProp = isMemberInElement(elm, memberName);
447
+ let ln = memberName.toLowerCase();
448
+ if (memberName === 'class') {
449
+ const classList = elm.classList;
450
+ const oldClasses = parseClassList(oldValue);
451
+ const newClasses = parseClassList(newValue);
452
+ classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
453
+ classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
454
+ }
455
+ else if (memberName === 'style') {
456
+ // update style attribute, css properties and values
457
+ {
458
+ for (const prop in oldValue) {
459
+ if (!newValue || newValue[prop] == null) {
460
+ if (prop.includes('-')) {
461
+ elm.style.removeProperty(prop);
462
+ }
463
+ else {
464
+ elm.style[prop] = '';
465
+ }
466
+ }
467
+ }
468
+ }
469
+ for (const prop in newValue) {
470
+ if (!oldValue || newValue[prop] !== oldValue[prop]) {
471
+ if (prop.includes('-')) {
472
+ elm.style.setProperty(prop, newValue[prop]);
473
+ }
474
+ else {
475
+ elm.style[prop] = newValue[prop];
476
+ }
477
+ }
478
+ }
479
+ }
480
+ else if (memberName === 'key')
481
+ ;
482
+ else if (memberName === 'ref') {
483
+ // minifier will clean this up
484
+ if (newValue) {
485
+ newValue(elm);
486
+ }
487
+ }
488
+ else if ((!isProp ) &&
489
+ memberName[0] === 'o' &&
490
+ memberName[1] === 'n') {
491
+ // Event Handlers
492
+ // so if the member name starts with "on" and the 3rd characters is
493
+ // a capital letter, and it's not already a member on the element,
494
+ // then we're assuming it's an event listener
495
+ if (memberName[2] === '-') {
496
+ // on- prefixed events
497
+ // allows to be explicit about the dom event to listen without any magic
498
+ // under the hood:
499
+ // <my-cmp on-click> // listens for "click"
500
+ // <my-cmp on-Click> // listens for "Click"
501
+ // <my-cmp on-ionChange> // listens for "ionChange"
502
+ // <my-cmp on-EVENTS> // listens for "EVENTS"
503
+ memberName = memberName.slice(3);
504
+ }
505
+ else if (isMemberInElement(win, ln)) {
506
+ // standard event
507
+ // the JSX attribute could have been "onMouseOver" and the
508
+ // member name "onmouseover" is on the window's prototype
509
+ // so let's add the listener "mouseover", which is all lowercased
510
+ memberName = ln.slice(2);
511
+ }
512
+ else {
513
+ // custom event
514
+ // the JSX attribute could have been "onMyCustomEvent"
515
+ // so let's trim off the "on" prefix and lowercase the first character
516
+ // and add the listener "myCustomEvent"
517
+ // except for the first character, we keep the event name case
518
+ memberName = ln[2] + memberName.slice(3);
519
+ }
520
+ if (oldValue || newValue) {
521
+ // Need to account for "capture" events.
522
+ // If the event name ends with "Capture", we'll update the name to remove
523
+ // the "Capture" suffix and make sure the event listener is setup to handle the capture event.
524
+ const capture = memberName.endsWith(CAPTURE_EVENT_SUFFIX);
525
+ // Make sure we only replace the last instance of "Capture"
526
+ memberName = memberName.replace(CAPTURE_EVENT_REGEX, '');
527
+ if (oldValue) {
528
+ plt.rel(elm, memberName, oldValue, capture);
529
+ }
530
+ if (newValue) {
531
+ plt.ael(elm, memberName, newValue, capture);
532
+ }
533
+ }
534
+ }
535
+ else {
536
+ // Set property if it exists and it's not a SVG
537
+ const isComplex = isComplexType(newValue);
538
+ if ((isProp || (isComplex && newValue !== null)) && !isSvg) {
539
+ try {
540
+ if (!elm.tagName.includes('-')) {
541
+ const n = newValue == null ? '' : newValue;
542
+ // Workaround for Safari, moving the <input> caret when re-assigning the same valued
543
+ if (memberName === 'list') {
544
+ isProp = false;
545
+ }
546
+ else if (oldValue == null || elm[memberName] != n) {
547
+ elm[memberName] = n;
548
+ }
549
+ }
550
+ else {
551
+ elm[memberName] = newValue;
552
+ }
553
+ }
554
+ catch (e) {
555
+ /**
556
+ * in case someone tries to set a read-only property, e.g. "namespaceURI", we just ignore it
557
+ */
558
+ }
559
+ }
560
+ /**
561
+ * Need to manually update attribute if:
562
+ * - memberName is not an attribute
563
+ * - if we are rendering the host element in order to reflect attribute
564
+ * - if it's a SVG, since properties might not work in <svg>
565
+ * - if the newValue is null/undefined or 'false'.
566
+ */
567
+ let xlink = false;
568
+ {
569
+ if (ln !== (ln = ln.replace(/^xlink\:?/, ''))) {
570
+ memberName = ln;
571
+ xlink = true;
572
+ }
573
+ }
574
+ if (newValue == null || newValue === false) {
575
+ if (newValue !== false || elm.getAttribute(memberName) === '') {
576
+ if (xlink) {
577
+ elm.removeAttributeNS(XLINK_NS, memberName);
578
+ }
579
+ else {
580
+ elm.removeAttribute(memberName);
581
+ }
582
+ }
583
+ }
584
+ else if ((!isProp || flags & 4 /* VNODE_FLAGS.isHost */ || isSvg) && !isComplex) {
585
+ newValue = newValue === true ? '' : newValue;
586
+ if (xlink) {
587
+ elm.setAttributeNS(XLINK_NS, memberName, newValue);
588
+ }
589
+ else {
590
+ elm.setAttribute(memberName, newValue);
591
+ }
592
+ }
593
+ }
594
+ }
595
+ };
596
+ const parseClassListRegex = /\s/;
597
+ /**
598
+ * Parsed a string of classnames into an array
599
+ * @param value className string, e.g. "foo bar baz"
600
+ * @returns list of classes, e.g. ["foo", "bar", "baz"]
601
+ */
602
+ const parseClassList = (value) => (!value ? [] : value.split(parseClassListRegex));
603
+ const CAPTURE_EVENT_SUFFIX = 'Capture';
604
+ const CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + '$');
605
+ const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
606
+ // if the element passed in is a shadow root, which is a document fragment
607
+ // then we want to be adding attrs/props to the shadow root's "host" element
608
+ // if it's not a shadow root, then we add attrs/props to the same element
609
+ const elm = newVnode.$elm$.nodeType === 11 /* NODE_TYPE.DocumentFragment */ && newVnode.$elm$.host
610
+ ? newVnode.$elm$.host
611
+ : newVnode.$elm$;
612
+ const oldVnodeAttrs = (oldVnode && oldVnode.$attrs$) || EMPTY_OBJ;
613
+ const newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ;
614
+ {
615
+ // remove attributes no longer present on the vnode by setting them to undefined
616
+ for (memberName in oldVnodeAttrs) {
617
+ if (!(memberName in newVnodeAttrs)) {
618
+ setAccessor(elm, memberName, oldVnodeAttrs[memberName], undefined, isSvgMode, newVnode.$flags$);
619
+ }
620
+ }
621
+ }
622
+ // add new & update changed attributes
623
+ for (memberName in newVnodeAttrs) {
624
+ setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode, newVnode.$flags$);
625
+ }
626
+ };
627
+ /**
628
+ * Create a DOM Node corresponding to one of the children of a given VNode.
629
+ *
630
+ * @param oldParentVNode the parent VNode from the previous render
631
+ * @param newParentVNode the parent VNode from the current render
632
+ * @param childIndex the index of the VNode, in the _new_ parent node's
633
+ * children, for which we will create a new DOM node
634
+ * @param parentElm the parent DOM node which our new node will be a child of
635
+ * @returns the newly created node
636
+ */
637
+ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
638
+ var _a;
639
+ // tslint:disable-next-line: prefer-const
640
+ const newVNode = newParentVNode.$children$[childIndex];
641
+ let i = 0;
642
+ let elm;
643
+ let childNode;
644
+ let oldVNode;
645
+ if (!useNativeShadowDom) {
646
+ // remember for later we need to check to relocate nodes
647
+ checkSlotRelocate = true;
648
+ if (newVNode.$tag$ === 'slot') {
649
+ if (scopeId) {
650
+ // scoped css needs to add its scoped id to the parent element
651
+ parentElm.classList.add(scopeId + '-s');
652
+ }
653
+ newVNode.$flags$ |= newVNode.$children$
654
+ ? // slot element has fallback content
655
+ 2 /* VNODE_FLAGS.isSlotFallback */
656
+ : // slot element does not have fallback content
657
+ 1 /* VNODE_FLAGS.isSlotReference */;
658
+ }
659
+ }
660
+ if (newVNode.$text$ !== null) {
661
+ // create text node
662
+ elm = newVNode.$elm$ = doc.createTextNode(newVNode.$text$);
663
+ }
664
+ else if (newVNode.$flags$ & 1 /* VNODE_FLAGS.isSlotReference */) {
665
+ // create a slot reference node
666
+ elm = newVNode.$elm$ =
667
+ doc.createTextNode('');
668
+ }
669
+ else {
670
+ // create element
671
+ elm = newVNode.$elm$ = (doc.createElement(newVNode.$flags$ & 2 /* VNODE_FLAGS.isSlotFallback */
672
+ ? 'slot-fb'
673
+ : newVNode.$tag$));
674
+ // add css classes, attrs, props, listeners, etc.
675
+ {
676
+ updateElement(null, newVNode, isSvgMode);
677
+ }
678
+ if (isDef(scopeId) && elm['s-si'] !== scopeId) {
679
+ // if there is a scopeId and this is the initial render
680
+ // then let's add the scopeId as a css class
681
+ elm.classList.add((elm['s-si'] = scopeId));
682
+ }
683
+ if (newVNode.$children$) {
684
+ for (i = 0; i < newVNode.$children$.length; ++i) {
685
+ // create the node
686
+ childNode = createElm(oldParentVNode, newVNode, i, elm);
687
+ // return node could have been null
688
+ if (childNode) {
689
+ // append our new node
690
+ elm.appendChild(childNode);
691
+ }
692
+ }
693
+ }
694
+ }
695
+ // This needs to always happen so we can hide nodes that are projected
696
+ // to another component but don't end up in a slot
697
+ elm['s-hn'] = hostTagName;
698
+ {
699
+ if (newVNode.$flags$ & (2 /* VNODE_FLAGS.isSlotFallback */ | 1 /* VNODE_FLAGS.isSlotReference */)) {
700
+ // remember the content reference comment
701
+ elm['s-sr'] = true;
702
+ // Persist the name of the slot that this slot was going to be projected into.
703
+ elm['s-fs'] = (_a = newVNode.$attrs$) === null || _a === void 0 ? void 0 : _a.slot;
704
+ // remember the content reference comment
705
+ elm['s-cr'] = contentRef;
706
+ // remember the slot name, or empty string for default slot
707
+ elm['s-sn'] = newVNode.$name$ || '';
708
+ // check if we've got an old vnode for this slot
709
+ oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex];
710
+ if (oldVNode && oldVNode.$tag$ === newVNode.$tag$ && oldParentVNode.$elm$) {
711
+ {
712
+ // we've got an old slot vnode and the wrapper is being replaced
713
+ // so let's move the old slot content back to its original location
714
+ putBackInOriginalLocation(oldParentVNode.$elm$, false);
715
+ }
716
+ }
717
+ }
718
+ }
719
+ return elm;
720
+ };
721
+ const putBackInOriginalLocation = (parentElm, recursive) => {
722
+ var _a;
723
+ plt.$flags$ |= 1 /* PLATFORM_FLAGS.isTmpDisconnected */;
724
+ const oldSlotChildNodes = parentElm.childNodes;
725
+ for (let i = oldSlotChildNodes.length - 1; i >= 0; i--) {
726
+ const childNode = oldSlotChildNodes[i];
727
+ if (childNode['s-hn'] !== hostTagName && childNode['s-ol']) {
728
+ // and relocate it back to it's original location
729
+ parentReferenceNode(childNode).insertBefore(childNode, referenceNode(childNode));
730
+ // remove the old original location comment entirely
731
+ // later on the patch function will know what to do
732
+ // and move this to the correct spot if need be
733
+ childNode['s-ol'].remove();
734
+ childNode['s-ol'] = undefined;
735
+ // Reset so we can correctly move the node around again.
736
+ childNode['s-sh'] = undefined;
737
+ // When putting an element node back in its original location,
738
+ // we need to reset the `slot` attribute back to the value it originally had
739
+ // so we can correctly relocate it again in the future
740
+ if (childNode.nodeType === 1 /* NODE_TYPE.ElementNode */) {
741
+ childNode.setAttribute('slot', (_a = childNode['s-sn']) !== null && _a !== void 0 ? _a : '');
742
+ }
743
+ checkSlotRelocate = true;
744
+ }
745
+ if (recursive) {
746
+ putBackInOriginalLocation(childNode, recursive);
747
+ }
748
+ }
749
+ plt.$flags$ &= ~1 /* PLATFORM_FLAGS.isTmpDisconnected */;
750
+ };
751
+ /**
752
+ * Create DOM nodes corresponding to a list of {@link d.Vnode} objects and
753
+ * add them to the DOM in the appropriate place.
754
+ *
755
+ * @param parentElm the DOM node which should be used as a parent for the new
756
+ * DOM nodes
757
+ * @param before a child of the `parentElm` which the new children should be
758
+ * inserted before (optional)
759
+ * @param parentVNode the parent virtual DOM node
760
+ * @param vnodes the new child virtual DOM nodes to produce DOM nodes for
761
+ * @param startIdx the index in the child virtual DOM nodes at which to start
762
+ * creating DOM nodes (inclusive)
763
+ * @param endIdx the index in the child virtual DOM nodes at which to stop
764
+ * creating DOM nodes (inclusive)
765
+ */
766
+ const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
767
+ let containerElm = ((parentElm['s-cr'] && parentElm['s-cr'].parentNode) || parentElm);
768
+ let childNode;
769
+ if (containerElm.shadowRoot && containerElm.tagName === hostTagName) {
770
+ containerElm = containerElm.shadowRoot;
771
+ }
772
+ for (; startIdx <= endIdx; ++startIdx) {
773
+ if (vnodes[startIdx]) {
774
+ childNode = createElm(null, parentVNode, startIdx, parentElm);
775
+ if (childNode) {
776
+ vnodes[startIdx].$elm$ = childNode;
777
+ containerElm.insertBefore(childNode, referenceNode(before) );
778
+ }
779
+ }
780
+ }
781
+ };
782
+ /**
783
+ * Remove the DOM elements corresponding to a list of {@link d.VNode} objects.
784
+ * This can be used to, for instance, clean up after a list of children which
785
+ * should no longer be shown.
786
+ *
787
+ * This function also handles some of Stencil's slot relocation logic.
788
+ *
789
+ * @param vnodes a list of virtual DOM nodes to remove
790
+ * @param startIdx the index at which to start removing nodes (inclusive)
791
+ * @param endIdx the index at which to stop removing nodes (inclusive)
792
+ */
793
+ const removeVnodes = (vnodes, startIdx, endIdx) => {
794
+ for (let index = startIdx; index <= endIdx; ++index) {
795
+ const vnode = vnodes[index];
796
+ if (vnode) {
797
+ const elm = vnode.$elm$;
798
+ nullifyVNodeRefs(vnode);
799
+ if (elm) {
800
+ {
801
+ // we're removing this element
802
+ // so it's possible we need to show slot fallback content now
803
+ checkSlotFallbackVisibility = true;
804
+ if (elm['s-ol']) {
805
+ // remove the original location comment
806
+ elm['s-ol'].remove();
807
+ }
808
+ else {
809
+ // it's possible that child nodes of the node
810
+ // that's being removed are slot nodes
811
+ putBackInOriginalLocation(elm, true);
812
+ }
813
+ }
814
+ // remove the vnode's element from the dom
815
+ elm.remove();
816
+ }
817
+ }
818
+ }
819
+ };
820
+ /**
821
+ * Reconcile the children of a new VNode with the children of an old VNode by
822
+ * traversing the two collections of children, identifying nodes that are
823
+ * conserved or changed, calling out to `patch` to make any necessary
824
+ * updates to the DOM, and rearranging DOM nodes as needed.
825
+ *
826
+ * The algorithm for reconciling children works by analyzing two 'windows' onto
827
+ * the two arrays of children (`oldCh` and `newCh`). We keep track of the
828
+ * 'windows' by storing start and end indices and references to the
829
+ * corresponding array entries. Initially the two 'windows' are basically equal
830
+ * to the entire array, but we progressively narrow the windows until there are
831
+ * no children left to update by doing the following:
832
+ *
833
+ * 1. Skip any `null` entries at the beginning or end of the two arrays, so
834
+ * that if we have an initial array like the following we'll end up dealing
835
+ * only with a window bounded by the highlighted elements:
836
+ *
837
+ * [null, null, VNode1 , ... , VNode2, null, null]
838
+ * ^^^^^^ ^^^^^^
839
+ *
840
+ * 2. Check to see if the elements at the head and tail positions are equal
841
+ * across the windows. This will basically detect elements which haven't
842
+ * been added, removed, or changed position, i.e. if you had the following
843
+ * VNode elements (represented as HTML):
844
+ *
845
+ * oldVNode: `<div><p><span>HEY</span></p></div>`
846
+ * newVNode: `<div><p><span>THERE</span></p></div>`
847
+ *
848
+ * Then when comparing the children of the `<div>` tag we check the equality
849
+ * of the VNodes corresponding to the `<p>` tags and, since they are the
850
+ * same tag in the same position, we'd be able to avoid completely
851
+ * re-rendering the subtree under them with a new DOM element and would just
852
+ * call out to `patch` to handle reconciling their children and so on.
853
+ *
854
+ * 3. Check, for both windows, to see if the element at the beginning of the
855
+ * window corresponds to the element at the end of the other window. This is
856
+ * a heuristic which will let us identify _some_ situations in which
857
+ * elements have changed position, for instance it _should_ detect that the
858
+ * children nodes themselves have not changed but merely moved in the
859
+ * following example:
860
+ *
861
+ * oldVNode: `<div><element-one /><element-two /></div>`
862
+ * newVNode: `<div><element-two /><element-one /></div>`
863
+ *
864
+ * If we find cases like this then we also need to move the concrete DOM
865
+ * elements corresponding to the moved children to write the re-order to the
866
+ * DOM.
867
+ *
868
+ * 4. Finally, if VNodes have the `key` attribute set on them we check for any
869
+ * nodes in the old children which have the same key as the first element in
870
+ * our window on the new children. If we find such a node we handle calling
871
+ * out to `patch`, moving relevant DOM nodes, and so on, in accordance with
872
+ * what we find.
873
+ *
874
+ * Finally, once we've narrowed our 'windows' to the point that either of them
875
+ * collapse (i.e. they have length 0) we then handle any remaining VNode
876
+ * insertion or deletion that needs to happen to get a DOM state that correctly
877
+ * reflects the new child VNodes. If, for instance, after our window on the old
878
+ * children has collapsed we still have more nodes on the new children that
879
+ * we haven't dealt with yet then we need to add them, or if the new children
880
+ * collapse but we still have unhandled _old_ children then we need to make
881
+ * sure the corresponding DOM nodes are removed.
882
+ *
883
+ * @param parentElm the node into which the parent VNode is rendered
884
+ * @param oldCh the old children of the parent node
885
+ * @param newVNode the new VNode which will replace the parent
886
+ * @param newCh the new children of the parent node
887
+ */
888
+ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
889
+ let oldStartIdx = 0;
890
+ let newStartIdx = 0;
891
+ let idxInOld = 0;
892
+ let i = 0;
893
+ let oldEndIdx = oldCh.length - 1;
894
+ let oldStartVnode = oldCh[0];
895
+ let oldEndVnode = oldCh[oldEndIdx];
896
+ let newEndIdx = newCh.length - 1;
897
+ let newStartVnode = newCh[0];
898
+ let newEndVnode = newCh[newEndIdx];
899
+ let node;
900
+ let elmToMove;
901
+ while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
902
+ if (oldStartVnode == null) {
903
+ // VNode might have been moved left
904
+ oldStartVnode = oldCh[++oldStartIdx];
905
+ }
906
+ else if (oldEndVnode == null) {
907
+ oldEndVnode = oldCh[--oldEndIdx];
908
+ }
909
+ else if (newStartVnode == null) {
910
+ newStartVnode = newCh[++newStartIdx];
911
+ }
912
+ else if (newEndVnode == null) {
913
+ newEndVnode = newCh[--newEndIdx];
914
+ }
915
+ else if (isSameVnode(oldStartVnode, newStartVnode)) {
916
+ // if the start nodes are the same then we should patch the new VNode
917
+ // onto the old one, and increment our `newStartIdx` and `oldStartIdx`
918
+ // indices to reflect that. We don't need to move any DOM Nodes around
919
+ // since things are matched up in order.
920
+ patch(oldStartVnode, newStartVnode);
921
+ oldStartVnode = oldCh[++oldStartIdx];
922
+ newStartVnode = newCh[++newStartIdx];
923
+ }
924
+ else if (isSameVnode(oldEndVnode, newEndVnode)) {
925
+ // likewise, if the end nodes are the same we patch new onto old and
926
+ // decrement our end indices, and also likewise in this case we don't
927
+ // need to move any DOM Nodes.
928
+ patch(oldEndVnode, newEndVnode);
929
+ oldEndVnode = oldCh[--oldEndIdx];
930
+ newEndVnode = newCh[--newEndIdx];
931
+ }
932
+ else if (isSameVnode(oldStartVnode, newEndVnode)) {
933
+ // case: "Vnode moved right"
934
+ //
935
+ // We've found that the last node in our window on the new children is
936
+ // the same VNode as the _first_ node in our window on the old children
937
+ // we're dealing with now. Visually, this is the layout of these two
938
+ // nodes:
939
+ //
940
+ // newCh: [..., newStartVnode , ... , newEndVnode , ...]
941
+ // ^^^^^^^^^^^
942
+ // oldCh: [..., oldStartVnode , ... , oldEndVnode , ...]
943
+ // ^^^^^^^^^^^^^
944
+ //
945
+ // In this situation we need to patch `newEndVnode` onto `oldStartVnode`
946
+ // and move the DOM element for `oldStartVnode`.
947
+ if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
948
+ putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
949
+ }
950
+ patch(oldStartVnode, newEndVnode);
951
+ // We need to move the element for `oldStartVnode` into a position which
952
+ // will be appropriate for `newEndVnode`. For this we can use
953
+ // `.insertBefore` and `oldEndVnode.$elm$.nextSibling`. If there is a
954
+ // sibling for `oldEndVnode.$elm$` then we want to move the DOM node for
955
+ // `oldStartVnode` between `oldEndVnode` and it's sibling, like so:
956
+ //
957
+ // <old-start-node />
958
+ // <some-intervening-node />
959
+ // <old-end-node />
960
+ // <!-- -> <-- `oldStartVnode.$elm$` should be inserted here
961
+ // <next-sibling />
962
+ //
963
+ // If instead `oldEndVnode.$elm$` has no sibling then we just want to put
964
+ // the node for `oldStartVnode` at the end of the children of
965
+ // `parentElm`. Luckily, `Node.nextSibling` will return `null` if there
966
+ // aren't any siblings, and passing `null` to `Node.insertBefore` will
967
+ // append it to the children of the parent element.
968
+ parentElm.insertBefore(oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
969
+ oldStartVnode = oldCh[++oldStartIdx];
970
+ newEndVnode = newCh[--newEndIdx];
971
+ }
972
+ else if (isSameVnode(oldEndVnode, newStartVnode)) {
973
+ // case: "Vnode moved left"
974
+ //
975
+ // We've found that the first node in our window on the new children is
976
+ // the same VNode as the _last_ node in our window on the old children.
977
+ // Visually, this is the layout of these two nodes:
978
+ //
979
+ // newCh: [..., newStartVnode , ... , newEndVnode , ...]
980
+ // ^^^^^^^^^^^^^
981
+ // oldCh: [..., oldStartVnode , ... , oldEndVnode , ...]
982
+ // ^^^^^^^^^^^
983
+ //
984
+ // In this situation we need to patch `newStartVnode` onto `oldEndVnode`
985
+ // (which will handle updating any changed attributes, reconciling their
986
+ // children etc) but we also need to move the DOM node to which
987
+ // `oldEndVnode` corresponds.
988
+ if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
989
+ putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
990
+ }
991
+ patch(oldEndVnode, newStartVnode);
992
+ // We've already checked above if `oldStartVnode` and `newStartVnode` are
993
+ // the same node, so since we're here we know that they are not. Thus we
994
+ // can move the element for `oldEndVnode` _before_ the element for
995
+ // `oldStartVnode`, leaving `oldStartVnode` to be reconciled in the
996
+ // future.
997
+ parentElm.insertBefore(oldEndVnode.$elm$, oldStartVnode.$elm$);
998
+ oldEndVnode = oldCh[--oldEndIdx];
999
+ newStartVnode = newCh[++newStartIdx];
1000
+ }
1001
+ else {
1002
+ // Here we do some checks to match up old and new nodes based on the
1003
+ // `$key$` attribute, which is set by putting a `key="my-key"` attribute
1004
+ // in the JSX for a DOM element in the implementation of a Stencil
1005
+ // component.
1006
+ //
1007
+ // First we check to see if there are any nodes in the array of old
1008
+ // children which have the same key as the first node in the new
1009
+ // children.
1010
+ idxInOld = -1;
1011
+ {
1012
+ for (i = oldStartIdx; i <= oldEndIdx; ++i) {
1013
+ if (oldCh[i] && oldCh[i].$key$ !== null && oldCh[i].$key$ === newStartVnode.$key$) {
1014
+ idxInOld = i;
1015
+ break;
1016
+ }
1017
+ }
1018
+ }
1019
+ if (idxInOld >= 0) {
1020
+ // We found a node in the old children which matches up with the first
1021
+ // node in the new children! So let's deal with that
1022
+ elmToMove = oldCh[idxInOld];
1023
+ if (elmToMove.$tag$ !== newStartVnode.$tag$) {
1024
+ // the tag doesn't match so we'll need a new DOM element
1025
+ node = createElm(oldCh && oldCh[newStartIdx], newVNode, idxInOld, parentElm);
1026
+ }
1027
+ else {
1028
+ patch(elmToMove, newStartVnode);
1029
+ // invalidate the matching old node so that we won't try to update it
1030
+ // again later on
1031
+ oldCh[idxInOld] = undefined;
1032
+ node = elmToMove.$elm$;
1033
+ }
1034
+ newStartVnode = newCh[++newStartIdx];
1035
+ }
1036
+ else {
1037
+ // We either didn't find an element in the old children that matches
1038
+ // the key of the first new child OR the build is not using `key`
1039
+ // attributes at all. In either case we need to create a new element
1040
+ // for the new node.
1041
+ node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx, parentElm);
1042
+ newStartVnode = newCh[++newStartIdx];
1043
+ }
1044
+ if (node) {
1045
+ // if we created a new node then handle inserting it to the DOM
1046
+ {
1047
+ parentReferenceNode(oldStartVnode.$elm$).insertBefore(node, referenceNode(oldStartVnode.$elm$));
1048
+ }
1049
+ }
1050
+ }
1051
+ }
1052
+ if (oldStartIdx > oldEndIdx) {
1053
+ // we have some more new nodes to add which don't match up with old nodes
1054
+ addVnodes(parentElm, newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$, newVNode, newCh, newStartIdx, newEndIdx);
1055
+ }
1056
+ else if (newStartIdx > newEndIdx) {
1057
+ // there are nodes in the `oldCh` array which no longer correspond to nodes
1058
+ // in the new array, so lets remove them (which entails cleaning up the
1059
+ // relevant DOM nodes)
1060
+ removeVnodes(oldCh, oldStartIdx, oldEndIdx);
1061
+ }
1062
+ };
1063
+ /**
1064
+ * Compare two VNodes to determine if they are the same
1065
+ *
1066
+ * **NB**: This function is an equality _heuristic_ based on the available
1067
+ * information set on the two VNodes and can be misleading under certain
1068
+ * circumstances. In particular, if the two nodes do not have `key` attrs
1069
+ * (available under `$key$` on VNodes) then the function falls back on merely
1070
+ * checking that they have the same tag.
1071
+ *
1072
+ * So, in other words, if `key` attrs are not set on VNodes which may be
1073
+ * changing order within a `children` array or something along those lines then
1074
+ * we could obtain a false negative and then have to do needless re-rendering
1075
+ * (i.e. we'd say two VNodes aren't equal when in fact they should be).
1076
+ *
1077
+ * @param leftVNode the first VNode to check
1078
+ * @param rightVNode the second VNode to check
1079
+ * @returns whether they're equal or not
1080
+ */
1081
+ const isSameVnode = (leftVNode, rightVNode) => {
1082
+ // compare if two vnode to see if they're "technically" the same
1083
+ // need to have the same element tag, and same key to be the same
1084
+ if (leftVNode.$tag$ === rightVNode.$tag$) {
1085
+ if (leftVNode.$tag$ === 'slot') {
1086
+ return leftVNode.$name$ === rightVNode.$name$;
1087
+ }
1088
+ // this will be set if components in the build have `key` attrs set on them
1089
+ {
1090
+ return leftVNode.$key$ === rightVNode.$key$;
1091
+ }
1092
+ }
1093
+ return false;
1094
+ };
1095
+ const referenceNode = (node) => {
1096
+ // this node was relocated to a new location in the dom
1097
+ // because of some other component's slot
1098
+ // but we still have an html comment in place of where
1099
+ // it's original location was according to it's original vdom
1100
+ return (node && node['s-ol']) || node;
1101
+ };
1102
+ const parentReferenceNode = (node) => (node['s-ol'] ? node['s-ol'] : node).parentNode;
1103
+ /**
1104
+ * Handle reconciling an outdated VNode with a new one which corresponds to
1105
+ * it. This function handles flushing updates to the DOM and reconciling the
1106
+ * children of the two nodes (if any).
1107
+ *
1108
+ * @param oldVNode an old VNode whose DOM element and children we want to update
1109
+ * @param newVNode a new VNode representing an updated version of the old one
1110
+ */
1111
+ const patch = (oldVNode, newVNode) => {
1112
+ const elm = (newVNode.$elm$ = oldVNode.$elm$);
1113
+ const oldChildren = oldVNode.$children$;
1114
+ const newChildren = newVNode.$children$;
1115
+ const tag = newVNode.$tag$;
1116
+ const text = newVNode.$text$;
1117
+ let defaultHolder;
1118
+ if (text === null) {
1119
+ {
1120
+ if (tag === 'slot')
1121
+ ;
1122
+ else {
1123
+ // either this is the first render of an element OR it's an update
1124
+ // AND we already know it's possible it could have changed
1125
+ // this updates the element's css classes, attrs, props, listeners, etc.
1126
+ updateElement(oldVNode, newVNode, isSvgMode);
1127
+ }
1128
+ }
1129
+ if (oldChildren !== null && newChildren !== null) {
1130
+ // looks like there's child vnodes for both the old and new vnodes
1131
+ // so we need to call `updateChildren` to reconcile them
1132
+ updateChildren(elm, oldChildren, newVNode, newChildren);
1133
+ }
1134
+ else if (newChildren !== null) {
1135
+ // no old child vnodes, but there are new child vnodes to add
1136
+ if (oldVNode.$text$ !== null) {
1137
+ // the old vnode was text, so be sure to clear it out
1138
+ elm.textContent = '';
1139
+ }
1140
+ // add the new vnode children
1141
+ addVnodes(elm, null, newVNode, newChildren, 0, newChildren.length - 1);
1142
+ }
1143
+ else if (oldChildren !== null) {
1144
+ // no new child vnodes, but there are old child vnodes to remove
1145
+ removeVnodes(oldChildren, 0, oldChildren.length - 1);
1146
+ }
1147
+ }
1148
+ else if ((defaultHolder = elm['s-cr'])) {
1149
+ // this element has slotted content
1150
+ defaultHolder.parentNode.textContent = text;
1151
+ }
1152
+ else if (oldVNode.$text$ !== text) {
1153
+ // update the text content for the text only vnode
1154
+ // and also only if the text is different than before
1155
+ elm.data = text;
1156
+ }
1157
+ };
1158
+ /**
1159
+ * Adjust the `.hidden` property as-needed on any nodes in a DOM subtree which
1160
+ * are slot fallbacks nodes.
1161
+ *
1162
+ * A slot fallback node should be visible by default. Then, it should be
1163
+ * conditionally hidden if:
1164
+ *
1165
+ * - it has a sibling with a `slot` property set to its slot name or if
1166
+ * - it is a default fallback slot node, in which case we hide if it has any
1167
+ * content
1168
+ *
1169
+ * @param elm the element of interest
1170
+ */
1171
+ const updateFallbackSlotVisibility = (elm) => {
1172
+ const childNodes = elm.childNodes;
1173
+ for (const childNode of childNodes) {
1174
+ if (childNode.nodeType === 1 /* NODE_TYPE.ElementNode */) {
1175
+ if (childNode['s-sr']) {
1176
+ // this is a slot fallback node
1177
+ // get the slot name for this slot reference node
1178
+ const slotName = childNode['s-sn'];
1179
+ // by default always show a fallback slot node
1180
+ // then hide it if there are other slots in the light dom
1181
+ childNode.hidden = false;
1182
+ // we need to check all of its sibling nodes in order to see if
1183
+ // `childNode` should be hidden
1184
+ for (const siblingNode of childNodes) {
1185
+ // Don't check the node against itself
1186
+ if (siblingNode !== childNode) {
1187
+ if (siblingNode['s-hn'] !== childNode['s-hn'] || slotName !== '') {
1188
+ // this sibling node is from a different component OR is a named
1189
+ // fallback slot node
1190
+ if (siblingNode.nodeType === 1 /* NODE_TYPE.ElementNode */ &&
1191
+ (slotName === siblingNode.getAttribute('slot') || slotName === siblingNode['s-sn'])) {
1192
+ childNode.hidden = true;
1193
+ break;
1194
+ }
1195
+ }
1196
+ else {
1197
+ // this is a default fallback slot node
1198
+ // any element or text node (with content)
1199
+ // should hide the default fallback slot node
1200
+ if (siblingNode.nodeType === 1 /* NODE_TYPE.ElementNode */ ||
1201
+ (siblingNode.nodeType === 3 /* NODE_TYPE.TextNode */ && siblingNode.textContent.trim() !== '')) {
1202
+ childNode.hidden = true;
1203
+ break;
1204
+ }
1205
+ }
1206
+ }
1207
+ }
1208
+ }
1209
+ // keep drilling down
1210
+ updateFallbackSlotVisibility(childNode);
1211
+ }
1212
+ }
1213
+ };
1214
+ /**
1215
+ * Component-global information about nodes which are either currently being
1216
+ * relocated or will be shortly.
1217
+ */
1218
+ const relocateNodes = [];
1219
+ /**
1220
+ * Mark the contents of a slot for relocation via adding references to them to
1221
+ * the {@link relocateNodes} data structure. The actual work of relocating them
1222
+ * will then be handled in {@link renderVdom}.
1223
+ *
1224
+ * @param elm a render node whose child nodes need to be relocated
1225
+ */
1226
+ const markSlotContentForRelocation = (elm) => {
1227
+ // tslint:disable-next-line: prefer-const
1228
+ let node;
1229
+ let hostContentNodes;
1230
+ let j;
1231
+ for (const childNode of elm.childNodes) {
1232
+ // we need to find child nodes which are slot references so we can then try
1233
+ // to match them up with nodes that need to be relocated
1234
+ if (childNode['s-sr'] && (node = childNode['s-cr']) && node.parentNode) {
1235
+ // first get the content reference comment node ('s-cr'), then we get
1236
+ // its parent, which is where all the host content is now
1237
+ hostContentNodes = node.parentNode.childNodes;
1238
+ const slotName = childNode['s-sn'];
1239
+ // iterate through all the nodes under the location where the host was
1240
+ // originally rendered
1241
+ for (j = hostContentNodes.length - 1; j >= 0; j--) {
1242
+ node = hostContentNodes[j];
1243
+ // check that the node is not a content reference node or a node
1244
+ // reference and then check that the host name does not match that of
1245
+ // childNode.
1246
+ // In addition, check that the slot either has not already been relocated, or
1247
+ // that its current location's host is not childNode's host. This is essentially
1248
+ // a check so that we don't try to relocate (and then hide) a node that is already
1249
+ // where it should be.
1250
+ if (!node['s-cn'] &&
1251
+ !node['s-nr'] &&
1252
+ node['s-hn'] !== childNode['s-hn'] &&
1253
+ (!BUILD.experimentalSlotFixes )) {
1254
+ // if `node` is located in the slot that `childNode` refers to (via the
1255
+ // `'s-sn'` property) then we need to relocate it from it's current spot
1256
+ // (under the host element parent) to the right slot location
1257
+ if (isNodeLocatedInSlot(node, slotName)) {
1258
+ // it's possible we've already decided to relocate this node
1259
+ let relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
1260
+ // made some changes to slots
1261
+ // let's make sure we also double check
1262
+ // fallbacks are correctly hidden or shown
1263
+ checkSlotFallbackVisibility = true;
1264
+ // ensure that the slot-name attr is correct
1265
+ node['s-sn'] = node['s-sn'] || slotName;
1266
+ if (relocateNodeData) {
1267
+ relocateNodeData.$nodeToRelocate$['s-sh'] = childNode['s-hn'];
1268
+ // we marked this node for relocation previously but didn't find
1269
+ // out the slot reference node to which it needs to be relocated
1270
+ // so write it down now!
1271
+ relocateNodeData.$slotRefNode$ = childNode;
1272
+ }
1273
+ else {
1274
+ node['s-sh'] = childNode['s-hn'];
1275
+ // add to our list of nodes to relocate
1276
+ relocateNodes.push({
1277
+ $slotRefNode$: childNode,
1278
+ $nodeToRelocate$: node,
1279
+ });
1280
+ }
1281
+ if (node['s-sr']) {
1282
+ relocateNodes.map((relocateNode) => {
1283
+ if (isNodeLocatedInSlot(relocateNode.$nodeToRelocate$, node['s-sn'])) {
1284
+ relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
1285
+ if (relocateNodeData && !relocateNode.$slotRefNode$) {
1286
+ relocateNode.$slotRefNode$ = relocateNodeData.$slotRefNode$;
1287
+ }
1288
+ }
1289
+ });
1290
+ }
1291
+ }
1292
+ else if (!relocateNodes.some((r) => r.$nodeToRelocate$ === node)) {
1293
+ // the node is not found within the slot (`childNode`) that we're
1294
+ // currently looking at, so we stick it into `relocateNodes` to
1295
+ // handle later. If we never find a home for this element then
1296
+ // we'll need to hide it
1297
+ relocateNodes.push({
1298
+ $nodeToRelocate$: node,
1299
+ });
1300
+ }
1301
+ }
1302
+ }
1303
+ }
1304
+ // if we're dealing with any type of element (capable of itself being a
1305
+ // slot reference or containing one) then we recur
1306
+ if (childNode.nodeType === 1 /* NODE_TYPE.ElementNode */) {
1307
+ markSlotContentForRelocation(childNode);
1308
+ }
1309
+ }
1310
+ };
1311
+ /**
1312
+ * Check whether a node is located in a given named slot.
1313
+ *
1314
+ * @param nodeToRelocate the node of interest
1315
+ * @param slotName the slot name to check
1316
+ * @returns whether the node is located in the slot or not
1317
+ */
1318
+ const isNodeLocatedInSlot = (nodeToRelocate, slotName) => {
1319
+ if (nodeToRelocate.nodeType === 1 /* NODE_TYPE.ElementNode */) {
1320
+ if (nodeToRelocate.getAttribute('slot') === null && slotName === '') {
1321
+ // if the node doesn't have a slot attribute, and the slot we're checking
1322
+ // is not a named slot, then we assume the node should be within the slot
1323
+ return true;
1324
+ }
1325
+ if (nodeToRelocate.getAttribute('slot') === slotName) {
1326
+ return true;
1327
+ }
1328
+ return false;
1329
+ }
1330
+ if (nodeToRelocate['s-sn'] === slotName) {
1331
+ return true;
1332
+ }
1333
+ return slotName === '';
1334
+ };
1335
+ /**
1336
+ * 'Nullify' any VDom `ref` callbacks on a VDom node or its children by calling
1337
+ * them with `null`. This signals that the DOM element corresponding to the VDom
1338
+ * node has been removed from the DOM.
1339
+ *
1340
+ * @param vNode a virtual DOM node
1341
+ */
1342
+ const nullifyVNodeRefs = (vNode) => {
1343
+ {
1344
+ vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
1345
+ vNode.$children$ && vNode.$children$.map(nullifyVNodeRefs);
1346
+ }
1347
+ };
1348
+ /**
1349
+ * The main entry point for Stencil's virtual DOM-based rendering engine
1350
+ *
1351
+ * Given a {@link d.HostRef} container and some virtual DOM nodes, this
1352
+ * function will handle creating a virtual DOM tree with a single root, patching
1353
+ * the current virtual DOM tree onto an old one (if any), dealing with slot
1354
+ * relocation, and reflecting attributes.
1355
+ *
1356
+ * @param hostRef data needed to root and render the virtual DOM tree, such as
1357
+ * the DOM node into which it should be rendered.
1358
+ * @param renderFnResults the virtual DOM nodes to be rendered
1359
+ * @param isInitialLoad whether or not this is the first call after page load
1360
+ */
1361
+ const renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
1362
+ var _a, _b, _c, _d;
1363
+ const hostElm = hostRef.$hostElement$;
1364
+ const cmpMeta = hostRef.$cmpMeta$;
1365
+ const oldVNode = hostRef.$vnode$ || newVNode(null, null);
1366
+ // if `renderFnResults` is a Host node then we can use it directly. If not,
1367
+ // we need to call `h` again to wrap the children of our component in a
1368
+ // 'dummy' Host node (well, an empty vnode) since `renderVdom` assumes
1369
+ // implicitly that the top-level vdom node is 1) an only child and 2)
1370
+ // contains attrs that need to be set on the host element.
1371
+ const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
1372
+ hostTagName = hostElm.tagName;
1373
+ if (cmpMeta.$attrsToReflect$) {
1374
+ rootVnode.$attrs$ = rootVnode.$attrs$ || {};
1375
+ cmpMeta.$attrsToReflect$.map(([propName, attribute]) => (rootVnode.$attrs$[attribute] = hostElm[propName]));
1376
+ }
1377
+ // On the first render and *only* on the first render we want to check for
1378
+ // any attributes set on the host element which are also set on the vdom
1379
+ // node. If we find them, we override the value on the VDom node attrs with
1380
+ // the value from the host element, which allows developers building apps
1381
+ // with Stencil components to override e.g. the `role` attribute on a
1382
+ // component even if it's already set on the `Host`.
1383
+ if (isInitialLoad && rootVnode.$attrs$) {
1384
+ for (const key of Object.keys(rootVnode.$attrs$)) {
1385
+ // We have a special implementation in `setAccessor` for `style` and
1386
+ // `class` which reconciles values coming from the VDom with values
1387
+ // already present on the DOM element, so we don't want to override those
1388
+ // attributes on the VDom tree with values from the host element if they
1389
+ // are present.
1390
+ //
1391
+ // Likewise, `ref` and `key` are special internal values for the Stencil
1392
+ // runtime and we don't want to override those either.
1393
+ if (hostElm.hasAttribute(key) && !['key', 'ref', 'style', 'class'].includes(key)) {
1394
+ rootVnode.$attrs$[key] = hostElm[key];
1395
+ }
1396
+ }
1397
+ }
1398
+ rootVnode.$tag$ = null;
1399
+ rootVnode.$flags$ |= 4 /* VNODE_FLAGS.isHost */;
1400
+ hostRef.$vnode$ = rootVnode;
1401
+ rootVnode.$elm$ = oldVNode.$elm$ = (hostElm.shadowRoot || hostElm );
1402
+ {
1403
+ scopeId = hostElm['s-sc'];
1404
+ }
1405
+ {
1406
+ contentRef = hostElm['s-cr'];
1407
+ useNativeShadowDom = (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) !== 0;
1408
+ // always reset
1409
+ checkSlotFallbackVisibility = false;
1410
+ }
1411
+ // synchronous patch
1412
+ patch(oldVNode, rootVnode);
1413
+ {
1414
+ // while we're moving nodes around existing nodes, temporarily disable
1415
+ // the disconnectCallback from working
1416
+ plt.$flags$ |= 1 /* PLATFORM_FLAGS.isTmpDisconnected */;
1417
+ if (checkSlotRelocate) {
1418
+ markSlotContentForRelocation(rootVnode.$elm$);
1419
+ for (const relocateData of relocateNodes) {
1420
+ const nodeToRelocate = relocateData.$nodeToRelocate$;
1421
+ if (!nodeToRelocate['s-ol']) {
1422
+ // add a reference node marking this node's original location
1423
+ // keep a reference to this node for later lookups
1424
+ const orgLocationNode = doc.createTextNode('');
1425
+ orgLocationNode['s-nr'] = nodeToRelocate;
1426
+ nodeToRelocate.parentNode.insertBefore((nodeToRelocate['s-ol'] = orgLocationNode), nodeToRelocate);
1427
+ }
1428
+ }
1429
+ for (const relocateData of relocateNodes) {
1430
+ const nodeToRelocate = relocateData.$nodeToRelocate$;
1431
+ const slotRefNode = relocateData.$slotRefNode$;
1432
+ if (slotRefNode) {
1433
+ const parentNodeRef = slotRefNode.parentNode;
1434
+ // When determining where to insert content, the most simple case would be
1435
+ // to relocate the node immediately following the slot reference node. We do this
1436
+ // by getting a reference to the node immediately following the slot reference node
1437
+ // since we will use `insertBefore` to manipulate the DOM.
1438
+ //
1439
+ // If there is no node immediately following the slot reference node, then we will just
1440
+ // end up appending the node as the last child of the parent.
1441
+ let insertBeforeNode = slotRefNode.nextSibling;
1442
+ // If the node we're currently planning on inserting the new node before is an element,
1443
+ // we need to do some additional checks to make sure we're inserting the node in the correct order.
1444
+ // The use case here would be that we have multiple nodes being relocated to the same slot. So, we want
1445
+ // to make sure they get inserted into their new how in the same order they were declared in their original location.
1446
+ //
1447
+ // TODO(STENCIL-914): Remove `experimentalSlotFixes` check
1448
+ {
1449
+ let orgLocationNode = (_a = nodeToRelocate['s-ol']) === null || _a === void 0 ? void 0 : _a.previousSibling;
1450
+ while (orgLocationNode) {
1451
+ let refNode = (_b = orgLocationNode['s-nr']) !== null && _b !== void 0 ? _b : null;
1452
+ if (refNode && refNode['s-sn'] === nodeToRelocate['s-sn'] && parentNodeRef === refNode.parentNode) {
1453
+ refNode = refNode.nextSibling;
1454
+ if (!refNode || !refNode['s-nr']) {
1455
+ insertBeforeNode = refNode;
1456
+ break;
1457
+ }
1458
+ }
1459
+ orgLocationNode = orgLocationNode.previousSibling;
1460
+ }
1461
+ }
1462
+ if ((!insertBeforeNode && parentNodeRef !== nodeToRelocate.parentNode) ||
1463
+ nodeToRelocate.nextSibling !== insertBeforeNode) {
1464
+ // we've checked that it's worth while to relocate
1465
+ // since that the node to relocate
1466
+ // has a different next sibling or parent relocated
1467
+ if (nodeToRelocate !== insertBeforeNode) {
1468
+ if (!nodeToRelocate['s-hn'] && nodeToRelocate['s-ol']) {
1469
+ // probably a component in the index.html that doesn't have its hostname set
1470
+ nodeToRelocate['s-hn'] = nodeToRelocate['s-ol'].parentNode.nodeName;
1471
+ }
1472
+ // Add it back to the dom but in its new home
1473
+ // If we get to this point and `insertBeforeNode` is `null`, that means
1474
+ // we're just going to append the node as the last child of the parent. Passing
1475
+ // `null` as the second arg here will trigger that behavior.
1476
+ parentNodeRef.insertBefore(nodeToRelocate, insertBeforeNode);
1477
+ // Reset the `hidden` value back to what it was defined as originally
1478
+ // This solves a problem where a `slot` is dynamically rendered and `hidden` may have
1479
+ // been set on content originally, but now it has a slot to go to so it should have
1480
+ // the value it was defined as having in the DOM, not what we overrode it to.
1481
+ if (nodeToRelocate.nodeType === 1 /* NODE_TYPE.ElementNode */) {
1482
+ nodeToRelocate.hidden = (_c = nodeToRelocate['s-ih']) !== null && _c !== void 0 ? _c : false;
1483
+ }
1484
+ }
1485
+ }
1486
+ }
1487
+ else {
1488
+ // this node doesn't have a slot home to go to, so let's hide it
1489
+ if (nodeToRelocate.nodeType === 1 /* NODE_TYPE.ElementNode */) {
1490
+ // Store the initial value of `hidden` so we can reset it later when
1491
+ // moving nodes around.
1492
+ if (isInitialLoad) {
1493
+ nodeToRelocate['s-ih'] = (_d = nodeToRelocate.hidden) !== null && _d !== void 0 ? _d : false;
1494
+ }
1495
+ nodeToRelocate.hidden = true;
1496
+ }
1497
+ }
1498
+ }
1499
+ }
1500
+ if (checkSlotFallbackVisibility) {
1501
+ updateFallbackSlotVisibility(rootVnode.$elm$);
1502
+ }
1503
+ // done moving nodes around
1504
+ // allow the disconnect callback to work again
1505
+ plt.$flags$ &= ~1 /* PLATFORM_FLAGS.isTmpDisconnected */;
1506
+ // always reset
1507
+ relocateNodes.length = 0;
1508
+ }
1509
+ };
1510
+ const attachToAncestor = (hostRef, ancestorComponent) => {
1511
+ if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) {
1512
+ ancestorComponent['s-p'].push(new Promise((r) => (hostRef.$onRenderResolve$ = r)));
1513
+ }
1514
+ };
1515
+ const scheduleUpdate = (hostRef, isInitialLoad) => {
1516
+ {
1517
+ hostRef.$flags$ |= 16 /* HOST_FLAGS.isQueuedForUpdate */;
1518
+ }
1519
+ if (hostRef.$flags$ & 4 /* HOST_FLAGS.isWaitingForChildren */) {
1520
+ hostRef.$flags$ |= 512 /* HOST_FLAGS.needsRerender */;
1521
+ return;
1522
+ }
1523
+ attachToAncestor(hostRef, hostRef.$ancestorComponent$);
1524
+ // there is no ancestor component or the ancestor component
1525
+ // has already fired off its lifecycle update then
1526
+ // fire off the initial update
1527
+ const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
1528
+ return writeTask(dispatch) ;
1529
+ };
1530
+ /**
1531
+ * Dispatch initial-render and update lifecycle hooks, enqueuing calls to
1532
+ * component lifecycle methods like `componentWillLoad` as well as
1533
+ * {@link updateComponent}, which will kick off the virtual DOM re-render.
1534
+ *
1535
+ * @param hostRef a reference to a host DOM node
1536
+ * @param isInitialLoad whether we're on the initial load or not
1537
+ * @returns an empty Promise which is used to enqueue a series of operations for
1538
+ * the component
1539
+ */
1540
+ const dispatchHooks = (hostRef, isInitialLoad) => {
1541
+ const endSchedule = createTime('scheduleUpdate', hostRef.$cmpMeta$.$tagName$);
1542
+ const instance = hostRef.$lazyInstance$ ;
1543
+ // We're going to use this variable together with `enqueue` to implement a
1544
+ // little promise-based queue. We start out with it `undefined`. When we add
1545
+ // the first function to the queue we'll set this variable to be that
1546
+ // function's return value. When we attempt to add subsequent values to the
1547
+ // queue we'll check that value and, if it was a `Promise`, we'll then chain
1548
+ // the new function off of that `Promise` using `.then()`. This will give our
1549
+ // queue two nice properties:
1550
+ //
1551
+ // 1. If all functions added to the queue are synchronous they'll be called
1552
+ // synchronously right away.
1553
+ // 2. If all functions added to the queue are asynchronous they'll all be
1554
+ // called in order after `dispatchHooks` exits.
1555
+ let maybePromise;
1556
+ if (isInitialLoad) {
1557
+ {
1558
+ hostRef.$flags$ |= 256 /* HOST_FLAGS.isListenReady */;
1559
+ if (hostRef.$queuedListeners$) {
1560
+ hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
1561
+ hostRef.$queuedListeners$ = undefined;
1562
+ }
1563
+ }
1564
+ {
1565
+ // If `componentWillLoad` returns a `Promise` then we want to wait on
1566
+ // whatever's going on in that `Promise` before we launch into
1567
+ // rendering the component, doing other lifecycle stuff, etc. So
1568
+ // in that case we assign the returned promise to the variable we
1569
+ // declared above to hold a possible 'queueing' Promise
1570
+ maybePromise = safeCall(instance, 'componentWillLoad');
1571
+ }
1572
+ }
1573
+ {
1574
+ maybePromise = enqueue(maybePromise, () => safeCall(instance, 'componentWillRender'));
1575
+ }
1576
+ endSchedule();
1577
+ return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));
1578
+ };
1579
+ /**
1580
+ * This function uses a Promise to implement a simple first-in, first-out queue
1581
+ * of functions to be called.
1582
+ *
1583
+ * The queue is ordered on the basis of the first argument. If it's
1584
+ * `undefined`, then nothing is on the queue yet, so the provided function can
1585
+ * be called synchronously (although note that this function may return a
1586
+ * `Promise`). The idea is that then the return value of that enqueueing
1587
+ * operation is kept around, so that if it was a `Promise` then subsequent
1588
+ * functions can be enqueued by calling this function again with that `Promise`
1589
+ * as the first argument.
1590
+ *
1591
+ * @param maybePromise either a `Promise` which should resolve before the next function is called or an 'empty' sentinel
1592
+ * @param fn a function to enqueue
1593
+ * @returns either a `Promise` or the return value of the provided function
1594
+ */
1595
+ const enqueue = (maybePromise, fn) => isPromisey(maybePromise) ? maybePromise.then(fn) : fn();
1596
+ /**
1597
+ * Check that a value is a `Promise`. To check, we first see if the value is an
1598
+ * instance of the `Promise` global. In a few circumstances, in particular if
1599
+ * the global has been overwritten, this is could be misleading, so we also do
1600
+ * a little 'duck typing' check to see if the `.then` property of the value is
1601
+ * defined and a function.
1602
+ *
1603
+ * @param maybePromise it might be a promise!
1604
+ * @returns whether it is or not
1605
+ */
1606
+ const isPromisey = (maybePromise) => maybePromise instanceof Promise ||
1607
+ (maybePromise && maybePromise.then && typeof maybePromise.then === 'function');
1608
+ /**
1609
+ * Update a component given reference to its host elements and so on.
1610
+ *
1611
+ * @param hostRef an object containing references to the element's host node,
1612
+ * VDom nodes, and other metadata
1613
+ * @param instance a reference to the underlying host element where it will be
1614
+ * rendered
1615
+ * @param isInitialLoad whether or not this function is being called as part of
1616
+ * the first render cycle
1617
+ */
1618
+ const updateComponent = async (hostRef, instance, isInitialLoad) => {
1619
+ var _a;
1620
+ const elm = hostRef.$hostElement$;
1621
+ const endUpdate = createTime('update', hostRef.$cmpMeta$.$tagName$);
1622
+ const rc = elm['s-rc'];
1623
+ if (isInitialLoad) {
1624
+ // DOM WRITE!
1625
+ attachStyles(hostRef);
1626
+ }
1627
+ const endRender = createTime('render', hostRef.$cmpMeta$.$tagName$);
1628
+ {
1629
+ callRender(hostRef, instance, elm, isInitialLoad);
1630
+ }
1631
+ if (rc) {
1632
+ // ok, so turns out there are some child host elements
1633
+ // waiting on this parent element to load
1634
+ // let's fire off all update callbacks waiting
1635
+ rc.map((cb) => cb());
1636
+ elm['s-rc'] = undefined;
1637
+ }
1638
+ endRender();
1639
+ endUpdate();
1640
+ {
1641
+ const childrenPromises = (_a = elm['s-p']) !== null && _a !== void 0 ? _a : [];
1642
+ const postUpdate = () => postUpdateComponent(hostRef);
1643
+ if (childrenPromises.length === 0) {
1644
+ postUpdate();
1645
+ }
1646
+ else {
1647
+ Promise.all(childrenPromises).then(postUpdate);
1648
+ hostRef.$flags$ |= 4 /* HOST_FLAGS.isWaitingForChildren */;
1649
+ childrenPromises.length = 0;
1650
+ }
1651
+ }
1652
+ };
1653
+ /**
1654
+ * Handle making the call to the VDom renderer with the proper context given
1655
+ * various build variables
1656
+ *
1657
+ * @param hostRef an object containing references to the element's host node,
1658
+ * VDom nodes, and other metadata
1659
+ * @param instance a reference to the underlying host element where it will be
1660
+ * rendered
1661
+ * @param elm the Host element for the component
1662
+ * @param isInitialLoad whether or not this function is being called as part of
1663
+ * @returns an empty promise
1664
+ */
1665
+ const callRender = (hostRef, instance, elm, isInitialLoad) => {
1666
+ try {
1667
+ /**
1668
+ * minification optimization: `allRenderFn` is `true` if all components have a `render`
1669
+ * method, so we can call the method immediately. If not, check before calling it.
1670
+ */
1671
+ instance = instance.render() ;
1672
+ {
1673
+ hostRef.$flags$ &= ~16 /* HOST_FLAGS.isQueuedForUpdate */;
1674
+ }
1675
+ {
1676
+ hostRef.$flags$ |= 2 /* HOST_FLAGS.hasRendered */;
1677
+ }
1678
+ {
1679
+ {
1680
+ // looks like we've got child nodes to render into this host element
1681
+ // or we need to update the css class/attrs on the host element
1682
+ // DOM WRITE!
1683
+ {
1684
+ renderVdom(hostRef, instance, isInitialLoad);
1685
+ }
1686
+ }
1687
+ }
1688
+ }
1689
+ catch (e) {
1690
+ consoleError(e, hostRef.$hostElement$);
1691
+ }
1692
+ return null;
1693
+ };
1694
+ const postUpdateComponent = (hostRef) => {
1695
+ const tagName = hostRef.$cmpMeta$.$tagName$;
1696
+ const elm = hostRef.$hostElement$;
1697
+ const endPostUpdate = createTime('postUpdate', tagName);
1698
+ const instance = hostRef.$lazyInstance$ ;
1699
+ const ancestorComponent = hostRef.$ancestorComponent$;
1700
+ {
1701
+ safeCall(instance, 'componentDidRender');
1702
+ }
1703
+ if (!(hostRef.$flags$ & 64 /* HOST_FLAGS.hasLoadedComponent */)) {
1704
+ hostRef.$flags$ |= 64 /* HOST_FLAGS.hasLoadedComponent */;
1705
+ {
1706
+ // DOM WRITE!
1707
+ addHydratedFlag(elm);
1708
+ }
1709
+ {
1710
+ safeCall(instance, 'componentDidLoad');
1711
+ }
1712
+ endPostUpdate();
1713
+ {
1714
+ hostRef.$onReadyResolve$(elm);
1715
+ if (!ancestorComponent) {
1716
+ appDidLoad();
1717
+ }
1718
+ }
1719
+ }
1720
+ else {
1721
+ {
1722
+ safeCall(instance, 'componentDidUpdate');
1723
+ }
1724
+ endPostUpdate();
1725
+ }
1726
+ {
1727
+ hostRef.$onInstanceResolve$(elm);
1728
+ }
1729
+ // load events fire from bottom to top
1730
+ // the deepest elements load first then bubbles up
1731
+ {
1732
+ if (hostRef.$onRenderResolve$) {
1733
+ hostRef.$onRenderResolve$();
1734
+ hostRef.$onRenderResolve$ = undefined;
1735
+ }
1736
+ if (hostRef.$flags$ & 512 /* HOST_FLAGS.needsRerender */) {
1737
+ nextTick(() => scheduleUpdate(hostRef, false));
1738
+ }
1739
+ hostRef.$flags$ &= ~(4 /* HOST_FLAGS.isWaitingForChildren */ | 512 /* HOST_FLAGS.needsRerender */);
1740
+ }
1741
+ // ( •_•)
1742
+ // ( •_•)>⌐■-■
1743
+ // (⌐■_■)
1744
+ };
1745
+ const appDidLoad = (who) => {
1746
+ // on appload
1747
+ // we have finish the first big initial render
1748
+ {
1749
+ addHydratedFlag(doc.documentElement);
1750
+ }
1751
+ nextTick(() => emitEvent(win, 'appload', { detail: { namespace: NAMESPACE } }));
1752
+ };
1753
+ /**
1754
+ * Allows to safely call a method, e.g. `componentDidLoad`, on an instance,
1755
+ * e.g. custom element node. If a build figures out that e.g. no component
1756
+ * has a `componentDidLoad` method, the instance method gets removed from the
1757
+ * output bundle and this function returns `undefined`.
1758
+ * @param instance any object that may or may not contain methods
1759
+ * @param method method name
1760
+ * @param arg single arbitrary argument
1761
+ * @returns result of method call if it exists, otherwise `undefined`
1762
+ */
1763
+ const safeCall = (instance, method, arg) => {
1764
+ if (instance && instance[method]) {
1765
+ try {
1766
+ return instance[method](arg);
1767
+ }
1768
+ catch (e) {
1769
+ consoleError(e);
1770
+ }
1771
+ }
1772
+ return undefined;
1773
+ };
1774
+ const addHydratedFlag = (elm) => elm.classList.add('hydrated')
1775
+ ;
1776
+ const getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
1777
+ const setValue = (ref, propName, newVal, cmpMeta) => {
1778
+ // check our new property value against our internal value
1779
+ const hostRef = getHostRef(ref);
1780
+ const elm = hostRef.$hostElement$ ;
1781
+ const oldVal = hostRef.$instanceValues$.get(propName);
1782
+ const flags = hostRef.$flags$;
1783
+ const instance = hostRef.$lazyInstance$ ;
1784
+ newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]);
1785
+ // explicitly check for NaN on both sides, as `NaN === NaN` is always false
1786
+ const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
1787
+ const didValueChange = newVal !== oldVal && !areBothNaN;
1788
+ if ((!(flags & 8 /* HOST_FLAGS.isConstructingInstance */) || oldVal === undefined) && didValueChange) {
1789
+ // gadzooks! the property's value has changed!!
1790
+ // set our new value!
1791
+ hostRef.$instanceValues$.set(propName, newVal);
1792
+ if (instance) {
1793
+ // get an array of method names of watch functions to call
1794
+ if (cmpMeta.$watchers$ && flags & 128 /* HOST_FLAGS.isWatchReady */) {
1795
+ const watchMethods = cmpMeta.$watchers$[propName];
1796
+ if (watchMethods) {
1797
+ // this instance is watching for when this property changed
1798
+ watchMethods.map((watchMethodName) => {
1799
+ try {
1800
+ // fire off each of the watch methods that are watching this property
1801
+ instance[watchMethodName](newVal, oldVal, propName);
1802
+ }
1803
+ catch (e) {
1804
+ consoleError(e, elm);
1805
+ }
1806
+ });
1807
+ }
1808
+ }
1809
+ if ((flags & (2 /* HOST_FLAGS.hasRendered */ | 16 /* HOST_FLAGS.isQueuedForUpdate */)) === 2 /* HOST_FLAGS.hasRendered */) {
1810
+ // looks like this value actually changed, so we've got work to do!
1811
+ // but only if we've already rendered, otherwise just chill out
1812
+ // queue that we need to do an update, but don't worry about queuing
1813
+ // up millions cuz this function ensures it only runs once
1814
+ scheduleUpdate(hostRef, false);
1815
+ }
1816
+ }
1817
+ }
1818
+ };
1819
+ /**
1820
+ * Attach a series of runtime constructs to a compiled Stencil component
1821
+ * constructor, including getters and setters for the `@Prop` and `@State`
1822
+ * decorators, callbacks for when attributes change, and so on.
1823
+ *
1824
+ * @param Cstr the constructor for a component that we need to process
1825
+ * @param cmpMeta metadata collected previously about the component
1826
+ * @param flags a number used to store a series of bit flags
1827
+ * @returns a reference to the same constructor passed in (but now mutated)
1828
+ */
1829
+ const proxyComponent = (Cstr, cmpMeta, flags) => {
1830
+ var _a;
1831
+ const prototype = Cstr.prototype;
1832
+ if (cmpMeta.$members$) {
1833
+ if (Cstr.watchers) {
1834
+ cmpMeta.$watchers$ = Cstr.watchers;
1835
+ }
1836
+ // It's better to have a const than two Object.entries()
1837
+ const members = Object.entries(cmpMeta.$members$);
1838
+ members.map(([memberName, [memberFlags]]) => {
1839
+ if ((memberFlags & 31 /* MEMBER_FLAGS.Prop */ ||
1840
+ ((flags & 2 /* PROXY_FLAGS.proxyState */) && memberFlags & 32 /* MEMBER_FLAGS.State */))) {
1841
+ // proxyComponent - prop
1842
+ Object.defineProperty(prototype, memberName, {
1843
+ get() {
1844
+ // proxyComponent, get value
1845
+ return getValue(this, memberName);
1846
+ },
1847
+ set(newValue) {
1848
+ // proxyComponent, set value
1849
+ setValue(this, memberName, newValue, cmpMeta);
1850
+ },
1851
+ configurable: true,
1852
+ enumerable: true,
1853
+ });
1854
+ }
1855
+ else if (flags & 1 /* PROXY_FLAGS.isElementConstructor */ &&
1856
+ memberFlags & 64 /* MEMBER_FLAGS.Method */) {
1857
+ // proxyComponent - method
1858
+ Object.defineProperty(prototype, memberName, {
1859
+ value(...args) {
1860
+ var _a;
1861
+ const ref = getHostRef(this);
1862
+ return (_a = ref === null || ref === void 0 ? void 0 : ref.$onInstancePromise$) === null || _a === void 0 ? void 0 : _a.then(() => { var _a; return (_a = ref.$lazyInstance$) === null || _a === void 0 ? void 0 : _a[memberName](...args); });
1863
+ },
1864
+ });
1865
+ }
1866
+ });
1867
+ if ((flags & 1 /* PROXY_FLAGS.isElementConstructor */)) {
1868
+ const attrNameToPropName = new Map();
1869
+ prototype.attributeChangedCallback = function (attrName, oldValue, newValue) {
1870
+ plt.jmp(() => {
1871
+ var _a;
1872
+ const propName = attrNameToPropName.get(attrName);
1873
+ // In a web component lifecycle the attributeChangedCallback runs prior to connectedCallback
1874
+ // in the case where an attribute was set inline.
1875
+ // ```html
1876
+ // <my-component some-attribute="some-value"></my-component>
1877
+ // ```
1878
+ //
1879
+ // There is an edge case where a developer sets the attribute inline on a custom element and then
1880
+ // programmatically changes it before it has been upgraded as shown below:
1881
+ //
1882
+ // ```html
1883
+ // <!-- this component has _not_ been upgraded yet -->
1884
+ // <my-component id="test" some-attribute="some-value"></my-component>
1885
+ // <script>
1886
+ // // grab non-upgraded component
1887
+ // el = document.querySelector("#test");
1888
+ // el.someAttribute = "another-value";
1889
+ // // upgrade component
1890
+ // customElements.define('my-component', MyComponent);
1891
+ // </script>
1892
+ // ```
1893
+ // In this case if we do not un-shadow here and use the value of the shadowing property, attributeChangedCallback
1894
+ // will be called with `newValue = "some-value"` and will set the shadowed property (this.someAttribute = "another-value")
1895
+ // to the value that was set inline i.e. "some-value" from above example. When
1896
+ // the connectedCallback attempts to un-shadow it will use "some-value" as the initial value rather than "another-value"
1897
+ //
1898
+ // The case where the attribute was NOT set inline but was not set programmatically shall be handled/un-shadowed
1899
+ // by connectedCallback as this attributeChangedCallback will not fire.
1900
+ //
1901
+ // https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
1902
+ //
1903
+ // TODO(STENCIL-16) we should think about whether or not we actually want to be reflecting the attributes to
1904
+ // properties here given that this goes against best practices outlined here
1905
+ // https://developers.google.com/web/fundamentals/web-components/best-practices#avoid-reentrancy
1906
+ if (this.hasOwnProperty(propName)) {
1907
+ newValue = this[propName];
1908
+ delete this[propName];
1909
+ }
1910
+ else if (prototype.hasOwnProperty(propName) &&
1911
+ typeof this[propName] === 'number' &&
1912
+ this[propName] == newValue) {
1913
+ // if the propName exists on the prototype of `Cstr`, this update may be a result of Stencil using native
1914
+ // APIs to reflect props as attributes. Calls to `setAttribute(someElement, propName)` will result in
1915
+ // `propName` to be converted to a `DOMString`, which may not be what we want for other primitive props.
1916
+ return;
1917
+ }
1918
+ else if (propName == null) {
1919
+ // At this point we should know this is not a "member", so we can treat it like watching an attribute
1920
+ // on a vanilla web component
1921
+ const hostRef = getHostRef(this);
1922
+ const flags = hostRef === null || hostRef === void 0 ? void 0 : hostRef.$flags$;
1923
+ // We only want to trigger the callback(s) if:
1924
+ // 1. The instance is ready
1925
+ // 2. The watchers are ready
1926
+ // 3. The value has changed
1927
+ if (flags &&
1928
+ !(flags & 8 /* HOST_FLAGS.isConstructingInstance */) &&
1929
+ flags & 128 /* HOST_FLAGS.isWatchReady */ &&
1930
+ newValue !== oldValue) {
1931
+ const instance = hostRef.$lazyInstance$ ;
1932
+ const entry = (_a = cmpMeta.$watchers$) === null || _a === void 0 ? void 0 : _a[attrName];
1933
+ entry === null || entry === void 0 ? void 0 : entry.forEach((callbackName) => {
1934
+ if (instance[callbackName] != null) {
1935
+ instance[callbackName].call(instance, newValue, oldValue, attrName);
1936
+ }
1937
+ });
1938
+ }
1939
+ return;
1940
+ }
1941
+ this[propName] = newValue === null && typeof this[propName] === 'boolean' ? false : newValue;
1942
+ });
1943
+ };
1944
+ // Create an array of attributes to observe
1945
+ // This list in comprised of all strings used within a `@Watch()` decorator
1946
+ // on a component as well as any Stencil-specific "members" (`@Prop()`s and `@State()`s).
1947
+ // As such, there is no way to guarantee type-safety here that a user hasn't entered
1948
+ // an invalid attribute.
1949
+ Cstr.observedAttributes = Array.from(new Set([
1950
+ ...Object.keys((_a = cmpMeta.$watchers$) !== null && _a !== void 0 ? _a : {}),
1951
+ ...members
1952
+ .filter(([_, m]) => m[0] & 15 /* MEMBER_FLAGS.HasAttribute */)
1953
+ .map(([propName, m]) => {
1954
+ var _a;
1955
+ const attrName = m[1] || propName;
1956
+ attrNameToPropName.set(attrName, propName);
1957
+ if (m[0] & 512 /* MEMBER_FLAGS.ReflectAttr */) {
1958
+ (_a = cmpMeta.$attrsToReflect$) === null || _a === void 0 ? void 0 : _a.push([propName, attrName]);
1959
+ }
1960
+ return attrName;
1961
+ }),
1962
+ ]));
1963
+ }
1964
+ }
1965
+ return Cstr;
1966
+ };
1967
+ /**
1968
+ * Initialize a Stencil component given a reference to its host element, its
1969
+ * runtime bookkeeping data structure, runtime metadata about the component,
1970
+ * and (optionally) an HMR version ID.
1971
+ *
1972
+ * @param elm a host element
1973
+ * @param hostRef the element's runtime bookkeeping object
1974
+ * @param cmpMeta runtime metadata for the Stencil component
1975
+ * @param hmrVersionId an (optional) HMR version ID
1976
+ */
1977
+ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1978
+ let Cstr;
1979
+ // initializeComponent
1980
+ if ((hostRef.$flags$ & 32 /* HOST_FLAGS.hasInitializedComponent */) === 0) {
1981
+ // Let the runtime know that the component has been initialized
1982
+ hostRef.$flags$ |= 32 /* HOST_FLAGS.hasInitializedComponent */;
1983
+ {
1984
+ // lazy loaded components
1985
+ // request the component's implementation to be
1986
+ // wired up with the host element
1987
+ Cstr = loadModule(cmpMeta);
1988
+ if (Cstr.then) {
1989
+ // Await creates a micro-task avoid if possible
1990
+ const endLoad = uniqueTime();
1991
+ Cstr = await Cstr;
1992
+ endLoad();
1993
+ }
1994
+ if (!Cstr.isProxied) {
1995
+ // we've never proxied this Constructor before
1996
+ // let's add the getters/setters to its prototype before
1997
+ // the first time we create an instance of the implementation
1998
+ {
1999
+ cmpMeta.$watchers$ = Cstr.watchers;
2000
+ }
2001
+ proxyComponent(Cstr, cmpMeta, 2 /* PROXY_FLAGS.proxyState */);
2002
+ Cstr.isProxied = true;
2003
+ }
2004
+ const endNewInstance = createTime('createInstance', cmpMeta.$tagName$);
2005
+ // ok, time to construct the instance
2006
+ // but let's keep track of when we start and stop
2007
+ // so that the getters/setters don't incorrectly step on data
2008
+ {
2009
+ hostRef.$flags$ |= 8 /* HOST_FLAGS.isConstructingInstance */;
2010
+ }
2011
+ // construct the lazy-loaded component implementation
2012
+ // passing the hostRef is very important during
2013
+ // construction in order to directly wire together the
2014
+ // host element and the lazy-loaded instance
2015
+ try {
2016
+ new Cstr(hostRef);
2017
+ }
2018
+ catch (e) {
2019
+ consoleError(e);
2020
+ }
2021
+ {
2022
+ hostRef.$flags$ &= ~8 /* HOST_FLAGS.isConstructingInstance */;
2023
+ }
2024
+ {
2025
+ hostRef.$flags$ |= 128 /* HOST_FLAGS.isWatchReady */;
2026
+ }
2027
+ endNewInstance();
2028
+ fireConnectedCallback(hostRef.$lazyInstance$);
2029
+ }
2030
+ if (Cstr.style) {
2031
+ // this component has styles but we haven't registered them yet
2032
+ let style = Cstr.style;
2033
+ const scopeId = getScopeId(cmpMeta);
2034
+ if (!styles.has(scopeId)) {
2035
+ const endRegisterStyles = createTime('registerStyles', cmpMeta.$tagName$);
2036
+ registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */));
2037
+ endRegisterStyles();
2038
+ }
2039
+ }
2040
+ }
2041
+ // we've successfully created a lazy instance
2042
+ const ancestorComponent = hostRef.$ancestorComponent$;
2043
+ const schedule = () => scheduleUpdate(hostRef, true);
2044
+ if (ancestorComponent && ancestorComponent['s-rc']) {
2045
+ // this is the initial load and this component it has an ancestor component
2046
+ // but the ancestor component has NOT fired its will update lifecycle yet
2047
+ // so let's just cool our jets and wait for the ancestor to continue first
2048
+ // this will get fired off when the ancestor component
2049
+ // finally gets around to rendering its lazy self
2050
+ // fire off the initial update
2051
+ ancestorComponent['s-rc'].push(schedule);
2052
+ }
2053
+ else {
2054
+ schedule();
2055
+ }
2056
+ };
2057
+ const fireConnectedCallback = (instance) => {
2058
+ {
2059
+ safeCall(instance, 'connectedCallback');
2060
+ }
2061
+ };
2062
+ const connectedCallback = (elm) => {
2063
+ if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
2064
+ const hostRef = getHostRef(elm);
2065
+ const cmpMeta = hostRef.$cmpMeta$;
2066
+ const endConnected = createTime('connectedCallback', cmpMeta.$tagName$);
2067
+ if (!(hostRef.$flags$ & 1 /* HOST_FLAGS.hasConnected */)) {
2068
+ // first time this component has connected
2069
+ hostRef.$flags$ |= 1 /* HOST_FLAGS.hasConnected */;
2070
+ {
2071
+ // initUpdate
2072
+ // if the slot polyfill is required we'll need to put some nodes
2073
+ // in here to act as original content anchors as we move nodes around
2074
+ // host element has been connected to the DOM
2075
+ if ((// TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
2076
+ cmpMeta.$flags$ & (4 /* CMP_FLAGS.hasSlotRelocation */ | 8 /* CMP_FLAGS.needsShadowDomShim */))) {
2077
+ setContentReference(elm);
2078
+ }
2079
+ }
2080
+ {
2081
+ // find the first ancestor component (if there is one) and register
2082
+ // this component as one of the actively loading child components for its ancestor
2083
+ let ancestorComponent = elm;
2084
+ while ((ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host)) {
2085
+ // climb up the ancestors looking for the first
2086
+ // component that hasn't finished its lifecycle update yet
2087
+ if (ancestorComponent['s-p']) {
2088
+ // we found this components first ancestor component
2089
+ // keep a reference to this component's ancestor component
2090
+ attachToAncestor(hostRef, (hostRef.$ancestorComponent$ = ancestorComponent));
2091
+ break;
2092
+ }
2093
+ }
2094
+ }
2095
+ // Lazy properties
2096
+ // https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
2097
+ if (cmpMeta.$members$) {
2098
+ Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
2099
+ if (memberFlags & 31 /* MEMBER_FLAGS.Prop */ && elm.hasOwnProperty(memberName)) {
2100
+ const value = elm[memberName];
2101
+ delete elm[memberName];
2102
+ elm[memberName] = value;
2103
+ }
2104
+ });
2105
+ }
2106
+ {
2107
+ initializeComponent(elm, hostRef, cmpMeta);
2108
+ }
2109
+ }
2110
+ else {
2111
+ // not the first time this has connected
2112
+ // reattach any event listeners to the host
2113
+ // since they would have been removed when disconnected
2114
+ addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
2115
+ // fire off connectedCallback() on component instance
2116
+ if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$lazyInstance$) {
2117
+ fireConnectedCallback(hostRef.$lazyInstance$);
2118
+ }
2119
+ else if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$onReadyPromise$) {
2120
+ hostRef.$onReadyPromise$.then(() => fireConnectedCallback(hostRef.$lazyInstance$));
2121
+ }
2122
+ }
2123
+ endConnected();
2124
+ }
2125
+ };
2126
+ const setContentReference = (elm) => {
2127
+ // only required when we're NOT using native shadow dom (slot)
2128
+ // or this browser doesn't support native shadow dom
2129
+ // and this host element was NOT created with SSR
2130
+ // let's pick out the inner content for slot projection
2131
+ // create a node to represent where the original
2132
+ // content was first placed, which is useful later on
2133
+ const contentRefElm = (elm['s-cr'] = doc.createComment(''));
2134
+ contentRefElm['s-cn'] = true;
2135
+ elm.insertBefore(contentRefElm, elm.firstChild);
2136
+ };
2137
+ const disconnectInstance = (instance) => {
2138
+ {
2139
+ safeCall(instance, 'disconnectedCallback');
2140
+ }
2141
+ };
2142
+ const disconnectedCallback = async (elm) => {
2143
+ if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
2144
+ const hostRef = getHostRef(elm);
2145
+ {
2146
+ if (hostRef.$rmListeners$) {
2147
+ hostRef.$rmListeners$.map((rmListener) => rmListener());
2148
+ hostRef.$rmListeners$ = undefined;
2149
+ }
2150
+ }
2151
+ if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$lazyInstance$) {
2152
+ disconnectInstance(hostRef.$lazyInstance$);
2153
+ }
2154
+ else if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$onReadyPromise$) {
2155
+ hostRef.$onReadyPromise$.then(() => disconnectInstance(hostRef.$lazyInstance$));
2156
+ }
2157
+ }
2158
+ };
2159
+ const bootstrapLazy = (lazyBundles, options = {}) => {
2160
+ var _a;
2161
+ const endBootstrap = createTime();
2162
+ const cmpTags = [];
2163
+ const exclude = options.exclude || [];
2164
+ const customElements = win.customElements;
2165
+ const head = doc.head;
2166
+ const metaCharset = /*@__PURE__*/ head.querySelector('meta[charset]');
2167
+ const dataStyles = /*@__PURE__*/ doc.createElement('style');
2168
+ const deferredConnectedCallbacks = [];
2169
+ let appLoadFallback;
2170
+ let isBootstrapping = true;
2171
+ Object.assign(plt, options);
2172
+ plt.$resourcesUrl$ = new URL(options.resourcesUrl || './', doc.baseURI).href;
2173
+ let hasSlotRelocation = false;
2174
+ lazyBundles.map((lazyBundle) => {
2175
+ lazyBundle[1].map((compactMeta) => {
2176
+ var _a;
2177
+ const cmpMeta = {
2178
+ $flags$: compactMeta[0],
2179
+ $tagName$: compactMeta[1],
2180
+ $members$: compactMeta[2],
2181
+ $listeners$: compactMeta[3],
2182
+ };
2183
+ // Check if we are using slots outside the shadow DOM in this component.
2184
+ // We'll use this information later to add styles for `slot-fb` elements
2185
+ if (cmpMeta.$flags$ & 4 /* CMP_FLAGS.hasSlotRelocation */) {
2186
+ hasSlotRelocation = true;
2187
+ }
2188
+ {
2189
+ cmpMeta.$members$ = compactMeta[2];
2190
+ }
2191
+ {
2192
+ cmpMeta.$listeners$ = compactMeta[3];
2193
+ }
2194
+ {
2195
+ cmpMeta.$attrsToReflect$ = [];
2196
+ }
2197
+ {
2198
+ cmpMeta.$watchers$ = (_a = compactMeta[4]) !== null && _a !== void 0 ? _a : {};
2199
+ }
2200
+ const tagName = cmpMeta.$tagName$;
2201
+ const HostElement = class extends HTMLElement {
2202
+ // StencilLazyHost
2203
+ constructor(self) {
2204
+ // @ts-ignore
2205
+ super(self);
2206
+ self = this;
2207
+ registerHost(self, cmpMeta);
2208
+ if (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
2209
+ // this component is using shadow dom
2210
+ // and this browser supports shadow dom
2211
+ // add the read-only property "shadowRoot" to the host element
2212
+ // adding the shadow root build conditionals to minimize runtime
2213
+ {
2214
+ {
2215
+ self.attachShadow({ mode: 'open' });
2216
+ }
2217
+ }
2218
+ }
2219
+ }
2220
+ connectedCallback() {
2221
+ if (appLoadFallback) {
2222
+ clearTimeout(appLoadFallback);
2223
+ appLoadFallback = null;
2224
+ }
2225
+ if (isBootstrapping) {
2226
+ // connectedCallback will be processed once all components have been registered
2227
+ deferredConnectedCallbacks.push(this);
2228
+ }
2229
+ else {
2230
+ plt.jmp(() => connectedCallback(this));
2231
+ }
2232
+ }
2233
+ disconnectedCallback() {
2234
+ plt.jmp(() => disconnectedCallback(this));
2235
+ }
2236
+ componentOnReady() {
2237
+ return getHostRef(this).$onReadyPromise$;
2238
+ }
2239
+ };
2240
+ cmpMeta.$lazyBundleId$ = lazyBundle[0];
2241
+ if (!exclude.includes(tagName) && !customElements.get(tagName)) {
2242
+ cmpTags.push(tagName);
2243
+ customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* PROXY_FLAGS.isElementConstructor */));
2244
+ }
2245
+ });
2246
+ });
2247
+ // Add styles for `slot-fb` elements if any of our components are using slots outside the Shadow DOM
2248
+ if (hasSlotRelocation) {
2249
+ dataStyles.innerHTML += SLOT_FB_CSS;
2250
+ }
2251
+ // Add hydration styles
2252
+ {
2253
+ dataStyles.innerHTML += cmpTags + HYDRATED_CSS;
2254
+ }
2255
+ // If we have styles, add them to the DOM
2256
+ if (dataStyles.innerHTML.length) {
2257
+ dataStyles.setAttribute('data-styles', '');
2258
+ // Apply CSP nonce to the style tag if it exists
2259
+ const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
2260
+ if (nonce != null) {
2261
+ dataStyles.setAttribute('nonce', nonce);
2262
+ }
2263
+ // Insert the styles into the document head
2264
+ // NOTE: this _needs_ to happen last so we can ensure the nonce (and other attributes) are applied
2265
+ head.insertBefore(dataStyles, metaCharset ? metaCharset.nextSibling : head.firstChild);
2266
+ }
2267
+ // Process deferred connectedCallbacks now all components have been registered
2268
+ isBootstrapping = false;
2269
+ if (deferredConnectedCallbacks.length) {
2270
+ deferredConnectedCallbacks.map((host) => host.connectedCallback());
2271
+ }
2272
+ else {
2273
+ {
2274
+ plt.jmp(() => (appLoadFallback = setTimeout(appDidLoad, 30)));
2275
+ }
2276
+ }
2277
+ // Fallback appLoad event
2278
+ endBootstrap();
2279
+ };
2280
+ const addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
2281
+ if (listeners) {
2282
+ listeners.map(([flags, name, method]) => {
2283
+ const target = getHostListenerTarget(elm, flags) ;
2284
+ const handler = hostListenerProxy(hostRef, method);
2285
+ const opts = hostListenerOpts(flags);
2286
+ plt.ael(target, name, handler, opts);
2287
+ (hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
2288
+ });
2289
+ }
2290
+ };
2291
+ const hostListenerProxy = (hostRef, methodName) => (ev) => {
2292
+ try {
2293
+ {
2294
+ if (hostRef.$flags$ & 256 /* HOST_FLAGS.isListenReady */) {
2295
+ // instance is ready, let's call it's member method for this event
2296
+ hostRef.$lazyInstance$[methodName](ev);
2297
+ }
2298
+ else {
2299
+ (hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
2300
+ }
2301
+ }
2302
+ }
2303
+ catch (e) {
2304
+ consoleError(e);
2305
+ }
2306
+ };
2307
+ const getHostListenerTarget = (elm, flags) => {
2308
+ if (flags & 16 /* LISTENER_FLAGS.TargetBody */)
2309
+ return doc.body;
2310
+ return elm;
2311
+ };
2312
+ // prettier-ignore
2313
+ const hostListenerOpts = (flags) => (flags & 2 /* LISTENER_FLAGS.Capture */) !== 0;
2314
+ /**
2315
+ * Assigns the given value to the nonce property on the runtime platform object.
2316
+ * During runtime, this value is used to set the nonce attribute on all dynamically created script and style tags.
2317
+ * @param nonce The value to be assigned to the platform nonce property.
2318
+ * @returns void
2319
+ */
2320
+ const setNonce = (nonce) => (plt.$nonce$ = nonce);
2321
+ /**
2322
+ * A WeakMap mapping runtime component references to their corresponding host reference
2323
+ * instances.
2324
+ */
2325
+ const hostRefs = /*@__PURE__*/ new WeakMap();
2326
+ /**
2327
+ * Given a {@link d.RuntimeRef} retrieve the corresponding {@link d.HostRef}
2328
+ *
2329
+ * @param ref the runtime ref of interest
2330
+ * @returns the Host reference (if found) or undefined
2331
+ */
2332
+ const getHostRef = (ref) => hostRefs.get(ref);
2333
+ /**
2334
+ * Register a lazy instance with the {@link hostRefs} object so it's
2335
+ * corresponding {@link d.HostRef} can be retrieved later.
2336
+ *
2337
+ * @param lazyInstance the lazy instance of interest
2338
+ * @param hostRef that instances `HostRef` object
2339
+ * @returns a reference to the host ref WeakMap
2340
+ */
2341
+ const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
2342
+ /**
2343
+ * Register a host element for a Stencil component, setting up various metadata
2344
+ * and callbacks based on {@link BUILD} flags as well as the component's runtime
2345
+ * metadata.
2346
+ *
2347
+ * @param hostElement the host element to register
2348
+ * @param cmpMeta runtime metadata for that component
2349
+ * @returns a reference to the host ref WeakMap
2350
+ */
2351
+ const registerHost = (hostElement, cmpMeta) => {
2352
+ const hostRef = {
2353
+ $flags$: 0,
2354
+ $hostElement$: hostElement,
2355
+ $cmpMeta$: cmpMeta,
2356
+ $instanceValues$: new Map(),
2357
+ };
2358
+ {
2359
+ hostRef.$onInstancePromise$ = new Promise((r) => (hostRef.$onInstanceResolve$ = r));
2360
+ }
2361
+ {
2362
+ hostRef.$onReadyPromise$ = new Promise((r) => (hostRef.$onReadyResolve$ = r));
2363
+ hostElement['s-p'] = [];
2364
+ hostElement['s-rc'] = [];
2365
+ }
2366
+ addHostEventListeners(hostElement, hostRef, cmpMeta.$listeners$);
2367
+ return hostRefs.set(hostElement, hostRef);
2368
+ };
2369
+ const isMemberInElement = (elm, memberName) => memberName in elm;
2370
+ const consoleError = (e, el) => (0, console.error)(e, el);
2371
+ const cmpModules = /*@__PURE__*/ new Map();
2372
+ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
2373
+ // loadModuleImport
2374
+ const exportName = cmpMeta.$tagName$.replace(/-/g, '_');
2375
+ const bundleId = cmpMeta.$lazyBundleId$;
2376
+ const module = cmpModules.get(bundleId) ;
2377
+ if (module) {
2378
+ return module[exportName];
2379
+ }
2380
+ /*!__STENCIL_STATIC_IMPORT_SWITCH__*/
2381
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2382
+ /* @vite-ignore */
2383
+ /* webpackInclude: /\.entry\.js$/ */
2384
+ /* webpackExclude: /\.system\.entry\.js$/ */
2385
+ /* webpackMode: "lazy" */
2386
+ `./${bundleId}.entry.js${''}`)); }).then((importedModule) => {
2387
+ {
2388
+ cmpModules.set(bundleId, importedModule);
2389
+ }
2390
+ return importedModule[exportName];
2391
+ }, consoleError);
2392
+ };
2393
+ const styles = /*@__PURE__*/ new Map();
2394
+ const win = typeof window !== 'undefined' ? window : {};
2395
+ const doc = win.document || { head: {} };
2396
+ const plt = {
2397
+ $flags$: 0,
2398
+ $resourcesUrl$: '',
2399
+ jmp: (h) => h(),
2400
+ raf: (h) => requestAnimationFrame(h),
2401
+ ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
2402
+ rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
2403
+ ce: (eventName, opts) => new CustomEvent(eventName, opts),
2404
+ };
2405
+ const promiseResolve = (v) => Promise.resolve(v);
2406
+ const supportsConstructableStylesheets = /*@__PURE__*/ (() => {
2407
+ try {
2408
+ new CSSStyleSheet();
2409
+ return typeof new CSSStyleSheet().replaceSync === 'function';
2410
+ }
2411
+ catch (e) { }
2412
+ return false;
2413
+ })()
2414
+ ;
2415
+ const queueDomReads = [];
2416
+ const queueDomWrites = [];
2417
+ const queueTask = (queue, write) => (cb) => {
2418
+ queue.push(cb);
2419
+ if (!queuePending) {
2420
+ queuePending = true;
2421
+ if (write && plt.$flags$ & 4 /* PLATFORM_FLAGS.queueSync */) {
2422
+ nextTick(flush);
2423
+ }
2424
+ else {
2425
+ plt.raf(flush);
2426
+ }
2427
+ }
2428
+ };
2429
+ const consume = (queue) => {
2430
+ for (let i = 0; i < queue.length; i++) {
2431
+ try {
2432
+ queue[i](performance.now());
2433
+ }
2434
+ catch (e) {
2435
+ consoleError(e);
2436
+ }
2437
+ }
2438
+ queue.length = 0;
2439
+ };
2440
+ const flush = () => {
2441
+ // always force a bunch of medium callbacks to run, but still have
2442
+ // a throttle on how many can run in a certain time
2443
+ // DOM READS!!!
2444
+ consume(queueDomReads);
2445
+ // DOM WRITES!!!
2446
+ {
2447
+ consume(queueDomWrites);
2448
+ if ((queuePending = queueDomReads.length > 0)) {
2449
+ // still more to do yet, but we've run out of time
2450
+ // let's let this thing cool off and try again in the next tick
2451
+ plt.raf(flush);
2452
+ }
2453
+ }
2454
+ };
2455
+ const nextTick = (cb) => promiseResolve().then(cb);
2456
+ const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
2457
+
2458
+ exports.Host = Host;
2459
+ exports.bootstrapLazy = bootstrapLazy;
2460
+ exports.createEvent = createEvent;
2461
+ exports.getAssetPath = getAssetPath;
2462
+ exports.getElement = getElement;
2463
+ exports.h = h;
2464
+ exports.promiseResolve = promiseResolve;
2465
+ exports.registerInstance = registerInstance;
2466
+ exports.setNonce = setNonce;
2467
+
2468
+ //# sourceMappingURL=index-13500e25.js.map