blue-chestnut-solar-expert 0.0.67 → 0.0.68

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 (333) hide show
  1. package/dist/stencil-library/assets/tutorial4.mp4 +0 -0
  2. package/dist/{collection/config.js → stencil-library/config-CWfV1nKn.js} +10 -4
  3. package/dist/stencil-library/config-CWfV1nKn.js.map +1 -0
  4. package/dist/stencil-library/constants-hboFofU4.js +1522 -0
  5. package/dist/stencil-library/constants-hboFofU4.js.map +1 -0
  6. package/dist/stencil-library/decoder-DNOvLSaS.js +39 -0
  7. package/dist/stencil-library/decoder-DNOvLSaS.js.map +1 -0
  8. package/dist/stencil-library/deflate-0Vdd6-55.js +21 -0
  9. package/dist/{esm/deflate-DHgPf9CO.js.map → stencil-library/deflate-0Vdd6-55.js.map} +1 -1
  10. package/dist/stencil-library/eraser-icon.entry.esm.js.map +1 -0
  11. package/dist/{components/p-CL74Q4VR.js → stencil-library/eraser-icon.entry.js} +9 -27
  12. package/dist/stencil-library/eraser-icon.entry.js.map +1 -0
  13. package/dist/stencil-library/house-icon.entry.esm.js.map +1 -0
  14. package/dist/{components/p-D8w3bTPO.js → stencil-library/house-icon.entry.js} +9 -27
  15. package/dist/stencil-library/house-icon.entry.js.map +1 -0
  16. package/dist/{components/loading-widget.js → stencil-library/icon-selector.entry.esm.js.map} +1 -38
  17. package/dist/stencil-library/icon-selector.entry.js +47 -0
  18. package/dist/stencil-library/icon-selector.entry.js.map +1 -0
  19. package/dist/stencil-library/index-CChkgM3J.js +414 -0
  20. package/dist/stencil-library/index-CChkgM3J.js.map +1 -0
  21. package/dist/stencil-library/index-ICfDNUMe.js +4172 -0
  22. package/dist/stencil-library/index-ICfDNUMe.js.map +1 -0
  23. package/dist/stencil-library/index.esm.js +13 -1
  24. package/dist/stencil-library/index.esm.js.map +1 -1
  25. package/dist/{esm/jpeg-CJLm1GkA.js → stencil-library/jpeg-Dd5nnHR5.js} +11 -3
  26. package/dist/stencil-library/jpeg-Dd5nnHR5.js.map +1 -0
  27. package/dist/{components/p-BcVa4_YP.js → stencil-library/lerc-7W4E8EBs.js} +27 -1981
  28. package/dist/stencil-library/lerc-7W4E8EBs.js.map +1 -0
  29. package/dist/{esm → stencil-library}/loading-widget.entry.js +3 -3
  30. package/dist/{components/p-P28NBglk.js.map → stencil-library/loading-widget.entry.js.map} +1 -1
  31. package/dist/{esm/lzw-DaOzWJUD.js → stencil-library/lzw--P4c0ZHH.js} +10 -4
  32. package/dist/stencil-library/lzw--P4c0ZHH.js.map +1 -0
  33. package/dist/stencil-library/map-draw-Cx9WZoKH.js +25567 -0
  34. package/dist/stencil-library/map-draw-Cx9WZoKH.js.map +1 -0
  35. package/dist/stencil-library/map-draw.entry.esm.js.map +1 -0
  36. package/dist/stencil-library/map-draw.entry.js +12 -0
  37. package/dist/stencil-library/map-draw.entry.js.map +1 -0
  38. package/dist/stencil-library/map-selector.entry.esm.js.map +1 -0
  39. package/dist/{components/p-C5QieOat.js → stencil-library/map-selector.entry.js} +164 -96
  40. package/dist/stencil-library/map-selector.entry.js.map +1 -0
  41. package/dist/{components/loading-widget.js.map → stencil-library/marker-icon.entry.esm.js.map} +1 -1
  42. package/dist/{components/p-Umz6nJIv.js → stencil-library/marker-icon.entry.js} +9 -27
  43. package/dist/stencil-library/marker-icon.entry.js.map +1 -0
  44. package/dist/stencil-library/move-icon.entry.esm.js.map +1 -0
  45. package/dist/{components/p-FdEV2qPo.js → stencil-library/move-icon.entry.js} +9 -27
  46. package/dist/stencil-library/move-icon.entry.js.map +1 -0
  47. package/dist/{components/p-DTXeHbuh.js.map → stencil-library/octagon-minus-icon.entry.esm.js.map} +1 -1
  48. package/dist/{components/p-BJLO76Yi.js → stencil-library/octagon-minus-icon.entry.js} +9 -27
  49. package/dist/stencil-library/octagon-minus-icon.entry.js.map +1 -0
  50. package/dist/{components/p-ByX6QP-E.js → stencil-library/packbits-X3R_utTs.js} +9 -3
  51. package/dist/stencil-library/packbits-X3R_utTs.js.map +1 -0
  52. package/dist/stencil-library/pako.esm-CPorU236.js +6881 -0
  53. package/dist/{esm/pako.esm-B5WTRCh8.js.map → stencil-library/pako.esm-CPorU236.js.map} +1 -1
  54. package/dist/{components/p-B4X-RCW0.js.map → stencil-library/polygon-buttons.entry.esm.js.map} +1 -1
  55. package/dist/{cjs/loading-widget.cjs.entry.js → stencil-library/polygon-buttons.entry.js} +16 -10
  56. package/dist/stencil-library/polygon-buttons.entry.js.map +1 -0
  57. package/dist/{cjs/loading-widget.cjs.entry.js.map → stencil-library/polygon-information.entry.esm.js.map} +1 -1
  58. package/dist/{components/p-BFJHTJPM.js → stencil-library/polygon-information.entry.js} +13 -70
  59. package/dist/stencil-library/polygon-information.entry.js.map +1 -0
  60. package/dist/stencil-library/raw-BxukYehy.js +20 -0
  61. package/dist/stencil-library/raw-BxukYehy.js.map +1 -0
  62. package/dist/stencil-library/search-icon.entry.esm.js.map +1 -0
  63. package/dist/{components/p-DBwr8xSB.js → stencil-library/search-icon.entry.js} +9 -27
  64. package/dist/stencil-library/{p-ab0f2031.entry.js → search-icon.entry.js.map} +1 -2
  65. package/dist/stencil-library/settings-icon.entry.esm.js.map +1 -0
  66. package/dist/{components/p-DTXeHbuh.js → stencil-library/settings-icon.entry.js} +9 -27
  67. package/dist/stencil-library/settings-icon.entry.js.map +1 -0
  68. package/dist/stencil-library/settings-modal.entry.esm.js.map +1 -0
  69. package/dist/{components/p-B4X-RCW0.js → stencil-library/settings-modal.entry.js} +20 -38
  70. package/dist/stencil-library/settings-modal.entry.js.map +1 -0
  71. package/dist/stencil-library/solar-expert.entry.esm.js.map +1 -0
  72. package/dist/{components/solar-expert.js → stencil-library/solar-expert.entry.js} +14 -150
  73. package/dist/{components/p-i1uLweD0.js.map → stencil-library/solar-expert.entry.js.map} +1 -1
  74. package/dist/stencil-library/solar-system-form.entry.esm.js.map +1 -0
  75. package/dist/stencil-library/solar-system-form.entry.js +553 -0
  76. package/dist/stencil-library/solar-system-form.entry.js.map +1 -0
  77. package/dist/stencil-library/stencil-library.esm.js +52 -1
  78. package/dist/stencil-library/stencil-library.esm.js.map +1 -1
  79. package/dist/{components/p-eDwaXClX.js → stencil-library/store-CcqrFuBK.js} +24 -3
  80. package/dist/stencil-library/store-CcqrFuBK.js.map +1 -0
  81. package/dist/stencil-library/toast-notification.entry.esm.js.map +1 -0
  82. package/dist/{components/p-P28NBglk.js → stencil-library/toast-notification.entry.js} +9 -30
  83. package/dist/stencil-library/toast-notification.entry.js.map +1 -0
  84. package/dist/stencil-library/tool-box.entry.esm.js.map +1 -0
  85. package/dist/{components/p-i1uLweD0.js → stencil-library/tool-box.entry.js} +27 -35
  86. package/dist/stencil-library/tool-box.entry.js.map +1 -0
  87. package/dist/{collection/utils/render/tools.js → stencil-library/tools-BNYKV5H5.js} +14 -8
  88. package/dist/stencil-library/tools-BNYKV5H5.js.map +1 -0
  89. package/dist/stencil-library/tutorial-component.entry.esm.js.map +1 -0
  90. package/dist/{components/p-Dzl6kfPI.js → stencil-library/tutorial-component.entry.js} +42 -35
  91. package/dist/stencil-library/tutorial-component.entry.js.map +1 -0
  92. package/dist/stencil-library/undo-icon.entry.esm.js.map +1 -0
  93. package/dist/{components/p-waOPoUcA.js → stencil-library/undo-icon.entry.js} +9 -27
  94. package/dist/stencil-library/undo-icon.entry.js.map +1 -0
  95. package/dist/{collection/utils/utils.js → stencil-library/utils-BCUZxI9u.js} +9 -3
  96. package/dist/stencil-library/utils-BCUZxI9u.js.map +1 -0
  97. package/dist/{esm/webimage-BiHardhv.js → stencil-library/webimage-CBrfoxHM.js} +9 -3
  98. package/dist/{esm/webimage-BiHardhv.js.map → stencil-library/webimage-CBrfoxHM.js.map} +1 -1
  99. package/dist/types/components/map-draw/map-draw.d.ts +5 -0
  100. package/dist/types/components/map-draw/tutorial-component.d.ts +7 -0
  101. package/dist/types/components.d.ts +4 -0
  102. package/dist/types/types/lang.d.ts +7 -0
  103. package/package.json +1 -1
  104. package/dist/cjs/app-globals-I24yU8do.js +0 -10
  105. package/dist/cjs/app-globals-I24yU8do.js.map +0 -1
  106. package/dist/cjs/basedecoder-CQuzfSgz.js +0 -116
  107. package/dist/cjs/basedecoder-CQuzfSgz.js.map +0 -1
  108. package/dist/cjs/deflate-AzGzQSW2.js +0 -17
  109. package/dist/cjs/deflate-AzGzQSW2.js.map +0 -1
  110. package/dist/cjs/eraser-icon_19.cjs.entry.js +0 -31
  111. package/dist/cjs/eraser-icon_19.cjs.entry.js.map +0 -1
  112. package/dist/cjs/index-HgRXF6kp.js +0 -1470
  113. package/dist/cjs/index-HgRXF6kp.js.map +0 -1
  114. package/dist/cjs/index.cjs.js +0 -7
  115. package/dist/cjs/index.cjs.js.map +0 -1
  116. package/dist/cjs/jpeg-Bx3bTm32.js +0 -904
  117. package/dist/cjs/jpeg-Bx3bTm32.js.map +0 -1
  118. package/dist/cjs/lerc-v64rYVDy.js +0 -4427
  119. package/dist/cjs/lerc-v64rYVDy.js.map +0 -1
  120. package/dist/cjs/loader.cjs.js +0 -18
  121. package/dist/cjs/loader.cjs.js.map +0 -1
  122. package/dist/cjs/loading-widget.entry.cjs.js.map +0 -1
  123. package/dist/cjs/lzw-BmFug486.js +0 -140
  124. package/dist/cjs/lzw-BmFug486.js.map +0 -1
  125. package/dist/cjs/packbits-CYx9fB0v.js +0 -35
  126. package/dist/cjs/packbits-CYx9fB0v.js.map +0 -1
  127. package/dist/cjs/pako.esm-0mKI6Jik.js +0 -3243
  128. package/dist/cjs/pako.esm-0mKI6Jik.js.map +0 -1
  129. package/dist/cjs/raw-DC82yoyr.js +0 -16
  130. package/dist/cjs/raw-DC82yoyr.js.map +0 -1
  131. package/dist/cjs/stencil-library.cjs.js +0 -30
  132. package/dist/cjs/stencil-library.cjs.js.map +0 -1
  133. package/dist/cjs/webimage-Dc0t2xAB.js +0 -49
  134. package/dist/cjs/webimage-Dc0t2xAB.js.map +0 -1
  135. package/dist/collection/collection-manifest.json +0 -31
  136. package/dist/collection/components/icons/eraser.js +0 -64
  137. package/dist/collection/components/icons/eraser.js.map +0 -1
  138. package/dist/collection/components/icons/house.js +0 -64
  139. package/dist/collection/components/icons/house.js.map +0 -1
  140. package/dist/collection/components/icons/icon.js +0 -108
  141. package/dist/collection/components/icons/icon.js.map +0 -1
  142. package/dist/collection/components/icons/marker.js +0 -64
  143. package/dist/collection/components/icons/marker.js.map +0 -1
  144. package/dist/collection/components/icons/move.js +0 -64
  145. package/dist/collection/components/icons/move.js.map +0 -1
  146. package/dist/collection/components/icons/octagonMinus.js +0 -64
  147. package/dist/collection/components/icons/octagonMinus.js.map +0 -1
  148. package/dist/collection/components/icons/search.js +0 -64
  149. package/dist/collection/components/icons/search.js.map +0 -1
  150. package/dist/collection/components/icons/settings.js +0 -64
  151. package/dist/collection/components/icons/settings.js.map +0 -1
  152. package/dist/collection/components/icons/undo.js +0 -64
  153. package/dist/collection/components/icons/undo.js.map +0 -1
  154. package/dist/collection/components/map-draw/map-draw.js +0 -795
  155. package/dist/collection/components/map-draw/map-draw.js.map +0 -1
  156. package/dist/collection/components/map-draw/map-selector.js +0 -246
  157. package/dist/collection/components/map-draw/map-selector.js.map +0 -1
  158. package/dist/collection/components/map-draw/polygon-buttons.js +0 -86
  159. package/dist/collection/components/map-draw/polygon-buttons.js.map +0 -1
  160. package/dist/collection/components/map-draw/polygon-information.js +0 -211
  161. package/dist/collection/components/map-draw/polygon-information.js.map +0 -1
  162. package/dist/collection/components/map-draw/tool-box.js +0 -108
  163. package/dist/collection/components/map-draw/tool-box.js.map +0 -1
  164. package/dist/collection/components/map-draw/tutorial-component.js +0 -151
  165. package/dist/collection/components/map-draw/tutorial-component.js.map +0 -1
  166. package/dist/collection/components/settings/settings.js +0 -127
  167. package/dist/collection/components/settings/settings.js.map +0 -1
  168. package/dist/collection/components/solar-expert/solar-expert.js +0 -241
  169. package/dist/collection/components/solar-expert/solar-expert.js.map +0 -1
  170. package/dist/collection/components/solar-system-form/solar-system-form.js +0 -596
  171. package/dist/collection/components/solar-system-form/solar-system-form.js.map +0 -1
  172. package/dist/collection/components/widgets/loading-widget.js +0 -18
  173. package/dist/collection/components/widgets/loading-widget.js.map +0 -1
  174. package/dist/collection/components/widgets/toast-notification.js +0 -133
  175. package/dist/collection/components/widgets/toast-notification.js.map +0 -1
  176. package/dist/collection/config.js.map +0 -1
  177. package/dist/collection/constants.js +0 -90
  178. package/dist/collection/constants.js.map +0 -1
  179. package/dist/collection/index.js +0 -2
  180. package/dist/collection/index.js.map +0 -1
  181. package/dist/collection/output.css +0 -1126
  182. package/dist/collection/store.js +0 -43
  183. package/dist/collection/store.js.map +0 -1
  184. package/dist/collection/types/lang.js +0 -2
  185. package/dist/collection/types/lang.js.map +0 -1
  186. package/dist/collection/types/shapes.js +0 -2
  187. package/dist/collection/types/shapes.js.map +0 -1
  188. package/dist/collection/utils/api.js +0 -93
  189. package/dist/collection/utils/api.js.map +0 -1
  190. package/dist/collection/utils/images.js +0 -2
  191. package/dist/collection/utils/images.js.map +0 -1
  192. package/dist/collection/utils/lang/english.js +0 -157
  193. package/dist/collection/utils/lang/english.js.map +0 -1
  194. package/dist/collection/utils/lang/general.js +0 -30
  195. package/dist/collection/utils/lang/general.js.map +0 -1
  196. package/dist/collection/utils/lang/german.js +0 -157
  197. package/dist/collection/utils/lang/german.js.map +0 -1
  198. package/dist/collection/utils/lang/spanish.js +0 -157
  199. package/dist/collection/utils/lang/spanish.js.map +0 -1
  200. package/dist/collection/utils/render/tools.js.map +0 -1
  201. package/dist/collection/utils/solar.js +0 -136
  202. package/dist/collection/utils/solar.js.map +0 -1
  203. package/dist/collection/utils/theme.js +0 -97
  204. package/dist/collection/utils/theme.js.map +0 -1
  205. package/dist/collection/utils/utils.js.map +0 -1
  206. package/dist/components/eraser-icon.js +0 -11
  207. package/dist/components/eraser-icon.js.map +0 -1
  208. package/dist/components/house-icon.js +0 -11
  209. package/dist/components/house-icon.js.map +0 -1
  210. package/dist/components/icon-selector.js +0 -11
  211. package/dist/components/icon-selector.js.map +0 -1
  212. package/dist/components/index.js +0 -1269
  213. package/dist/components/index.js.map +0 -1
  214. package/dist/components/map-draw.js +0 -11
  215. package/dist/components/map-draw.js.map +0 -1
  216. package/dist/components/map-selector.js +0 -11
  217. package/dist/components/map-selector.js.map +0 -1
  218. package/dist/components/marker-icon.js +0 -11
  219. package/dist/components/marker-icon.js.map +0 -1
  220. package/dist/components/move-icon.js +0 -11
  221. package/dist/components/move-icon.js.map +0 -1
  222. package/dist/components/octagon-minus-icon.js +0 -11
  223. package/dist/components/octagon-minus-icon.js.map +0 -1
  224. package/dist/components/p-B54Ul0nf.js +0 -15
  225. package/dist/components/p-B54Ul0nf.js.map +0 -1
  226. package/dist/components/p-B5WTRCh8.js +0 -3241
  227. package/dist/components/p-B5WTRCh8.js.map +0 -1
  228. package/dist/components/p-BFJHTJPM.js.map +0 -1
  229. package/dist/components/p-BGoSj_DR.js +0 -902
  230. package/dist/components/p-BGoSj_DR.js.map +0 -1
  231. package/dist/components/p-BJLO76Yi.js.map +0 -1
  232. package/dist/components/p-BcVa4_YP.js.map +0 -1
  233. package/dist/components/p-Bopprtc7.js +0 -623
  234. package/dist/components/p-Bopprtc7.js.map +0 -1
  235. package/dist/components/p-ByX6QP-E.js.map +0 -1
  236. package/dist/components/p-C5QieOat.js.map +0 -1
  237. package/dist/components/p-CL74Q4VR.js.map +0 -1
  238. package/dist/components/p-Cgchl6bA.js +0 -47
  239. package/dist/components/p-Cgchl6bA.js.map +0 -1
  240. package/dist/components/p-D8w3bTPO.js.map +0 -1
  241. package/dist/components/p-DBwr8xSB.js.map +0 -1
  242. package/dist/components/p-DWirjxpO.js +0 -163
  243. package/dist/components/p-DWirjxpO.js.map +0 -1
  244. package/dist/components/p-DlNHVTGB.js +0 -15949
  245. package/dist/components/p-DlNHVTGB.js.map +0 -1
  246. package/dist/components/p-Dzl6kfPI.js.map +0 -1
  247. package/dist/components/p-FdEV2qPo.js.map +0 -1
  248. package/dist/components/p-PkMjF2if.js +0 -1985
  249. package/dist/components/p-PkMjF2if.js.map +0 -1
  250. package/dist/components/p-Umz6nJIv.js.map +0 -1
  251. package/dist/components/p-WmcSqXD8.js +0 -14
  252. package/dist/components/p-WmcSqXD8.js.map +0 -1
  253. package/dist/components/p-eDwaXClX.js.map +0 -1
  254. package/dist/components/p-j-vOrhhh.js +0 -114
  255. package/dist/components/p-j-vOrhhh.js.map +0 -1
  256. package/dist/components/p-q8auDIJ2.js +0 -138
  257. package/dist/components/p-q8auDIJ2.js.map +0 -1
  258. package/dist/components/p-waOPoUcA.js.map +0 -1
  259. package/dist/components/polygon-buttons.js +0 -11
  260. package/dist/components/polygon-buttons.js.map +0 -1
  261. package/dist/components/polygon-information.js +0 -11
  262. package/dist/components/polygon-information.js.map +0 -1
  263. package/dist/components/search-icon.js +0 -11
  264. package/dist/components/search-icon.js.map +0 -1
  265. package/dist/components/settings-icon.js +0 -11
  266. package/dist/components/settings-icon.js.map +0 -1
  267. package/dist/components/settings-modal.js +0 -11
  268. package/dist/components/settings-modal.js.map +0 -1
  269. package/dist/components/solar-expert.js.map +0 -1
  270. package/dist/components/solar-system-form.js +0 -11
  271. package/dist/components/solar-system-form.js.map +0 -1
  272. package/dist/components/toast-notification.js +0 -11
  273. package/dist/components/toast-notification.js.map +0 -1
  274. package/dist/components/tool-box.js +0 -11
  275. package/dist/components/tool-box.js.map +0 -1
  276. package/dist/components/tutorial-component.js +0 -11
  277. package/dist/components/tutorial-component.js.map +0 -1
  278. package/dist/components/undo-icon.js +0 -11
  279. package/dist/components/undo-icon.js.map +0 -1
  280. package/dist/esm/basedecoder-j-vOrhhh.js +0 -114
  281. package/dist/esm/basedecoder-j-vOrhhh.js.map +0 -1
  282. package/dist/esm/deflate-DHgPf9CO.js +0 -15
  283. package/dist/esm/eraser-icon_19.entry.js +0 -7
  284. package/dist/esm/eraser-icon_19.entry.js.map +0 -1
  285. package/dist/esm/index-C2JRBB5c.js +0 -1458
  286. package/dist/esm/index-C2JRBB5c.js.map +0 -1
  287. package/dist/esm/index.js +0 -5
  288. package/dist/esm/index.js.map +0 -1
  289. package/dist/esm/jpeg-CJLm1GkA.js.map +0 -1
  290. package/dist/esm/lerc-CAiDQjTu.js +0 -4424
  291. package/dist/esm/lerc-CAiDQjTu.js.map +0 -1
  292. package/dist/esm/loader.js +0 -16
  293. package/dist/esm/loader.js.map +0 -1
  294. package/dist/esm/loading-widget.entry.js.map +0 -1
  295. package/dist/esm/lzw-DaOzWJUD.js.map +0 -1
  296. package/dist/esm/packbits-CZPyx9kx.js +0 -33
  297. package/dist/esm/packbits-CZPyx9kx.js.map +0 -1
  298. package/dist/esm/pako.esm-B5WTRCh8.js +0 -3241
  299. package/dist/esm/raw-pqeeWc2_.js +0 -14
  300. package/dist/esm/raw-pqeeWc2_.js.map +0 -1
  301. package/dist/esm/stencil-library.js +0 -26
  302. package/dist/esm/stencil-library.js.map +0 -1
  303. package/dist/index.cjs.js +0 -1
  304. package/dist/index.js +0 -1
  305. package/dist/stencil-library/p-B54Ul0nf.js +0 -2
  306. package/dist/stencil-library/p-B54Ul0nf.js.map +0 -1
  307. package/dist/stencil-library/p-B5WTRCh8.js +0 -2
  308. package/dist/stencil-library/p-B5WTRCh8.js.map +0 -1
  309. package/dist/stencil-library/p-BBtmpSUK.js +0 -2
  310. package/dist/stencil-library/p-BBtmpSUK.js.map +0 -1
  311. package/dist/stencil-library/p-BGoSj_DR.js +0 -2
  312. package/dist/stencil-library/p-BGoSj_DR.js.map +0 -1
  313. package/dist/stencil-library/p-ByX6QP-E.js +0 -2
  314. package/dist/stencil-library/p-ByX6QP-E.js.map +0 -1
  315. package/dist/stencil-library/p-C2JRBB5c.js +0 -3
  316. package/dist/stencil-library/p-C2JRBB5c.js.map +0 -1
  317. package/dist/stencil-library/p-CX8V3eiN.js +0 -2
  318. package/dist/stencil-library/p-CX8V3eiN.js.map +0 -1
  319. package/dist/stencil-library/p-Cgchl6bA.js +0 -2
  320. package/dist/stencil-library/p-Cgchl6bA.js.map +0 -1
  321. package/dist/stencil-library/p-WmcSqXD8.js +0 -2
  322. package/dist/stencil-library/p-WmcSqXD8.js.map +0 -1
  323. package/dist/stencil-library/p-ab0f2031.entry.js.map +0 -1
  324. package/dist/stencil-library/p-cAuhy_jT.js +0 -10
  325. package/dist/stencil-library/p-cAuhy_jT.js.map +0 -1
  326. package/dist/stencil-library/p-e7b94dbb.entry.js +0 -2
  327. package/dist/stencil-library/p-e7b94dbb.entry.js.map +0 -1
  328. package/dist/stencil-library/p-j-vOrhhh.js +0 -2
  329. package/dist/stencil-library/p-j-vOrhhh.js.map +0 -1
  330. package/dist/stencil-library/p-q8auDIJ2.js +0 -2
  331. package/dist/stencil-library/p-q8auDIJ2.js.map +0 -1
  332. /package/dist/{esm → stencil-library}/app-globals-CX8V3eiN.js +0 -0
  333. /package/dist/{esm → stencil-library}/app-globals-CX8V3eiN.js.map +0 -0
@@ -0,0 +1,4172 @@
1
+
2
+ if (typeof global === "undefined") { var global = globalThis || window || self; }
3
+ const NAMESPACE = 'stencil-library';
4
+ const BUILD = /* stencil-library */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, constructableCSS: false, cssAnnotations: true, devTools: true, element: false, event: true, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: false, hostListenerTarget: false, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: false, hotModuleReplacement: true, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: true, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: false, mode: false, modernPropertyDecls: true, observeAttribute: true, profile: true, prop: true, propBoolean: true, propMutable: false, propNumber: true, propString: true, reflect: false, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: false, slot: false, slotChildNodesFix: false, slotRelocation: false, state: true, style: true, svg: true, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: true, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: true, vdomText: true, vdomXlink: false, watchCallback: true };
5
+ const Env = /* stencil-library */ {"GOOGLE_MAPS_API_KEY":"AIzaSyBAXSsmO_QaiP3Z-M7pj5WVG2uQ97O6c-c"};
6
+
7
+ /*
8
+ Stencil Client Platform v4.31.0 | MIT Licensed | https://stenciljs.com
9
+ */
10
+ var __defProp = Object.defineProperty;
11
+ var __export = (target, all) => {
12
+ for (var name in all)
13
+ __defProp(target, name, { get: all[name], enumerable: true });
14
+ };
15
+ var Build = {
16
+ isDev: BUILD.isDev ? true : false,
17
+ isBrowser: true,
18
+ isServer: false,
19
+ isTesting: BUILD.isTesting ? true : false
20
+ };
21
+
22
+ // src/utils/constants.ts
23
+ var SVG_NS = "http://www.w3.org/2000/svg";
24
+ var HTML_NS = "http://www.w3.org/1999/xhtml";
25
+ var PrimitiveType = /* @__PURE__ */ ((PrimitiveType2) => {
26
+ PrimitiveType2["Undefined"] = "undefined";
27
+ PrimitiveType2["Null"] = "null";
28
+ PrimitiveType2["String"] = "string";
29
+ PrimitiveType2["Number"] = "number";
30
+ PrimitiveType2["SpecialNumber"] = "number";
31
+ PrimitiveType2["Boolean"] = "boolean";
32
+ PrimitiveType2["BigInt"] = "bigint";
33
+ return PrimitiveType2;
34
+ })(PrimitiveType || {});
35
+ var NonPrimitiveType = /* @__PURE__ */ ((NonPrimitiveType2) => {
36
+ NonPrimitiveType2["Array"] = "array";
37
+ NonPrimitiveType2["Date"] = "date";
38
+ NonPrimitiveType2["Map"] = "map";
39
+ NonPrimitiveType2["Object"] = "object";
40
+ NonPrimitiveType2["RegularExpression"] = "regexp";
41
+ NonPrimitiveType2["Set"] = "set";
42
+ NonPrimitiveType2["Channel"] = "channel";
43
+ NonPrimitiveType2["Symbol"] = "symbol";
44
+ return NonPrimitiveType2;
45
+ })(NonPrimitiveType || {});
46
+ var TYPE_CONSTANT = "type";
47
+ var VALUE_CONSTANT = "value";
48
+ var SERIALIZED_PREFIX = "serialized:";
49
+
50
+ // src/utils/es2022-rewire-class-members.ts
51
+ var reWireGetterSetter = (instance, hostRef) => {
52
+ var _a;
53
+ const cmpMeta = hostRef.$cmpMeta$;
54
+ const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
55
+ members.map(([memberName, [memberFlags]]) => {
56
+ if ((BUILD.state || BUILD.prop) && (memberFlags & 31 /* Prop */ || memberFlags & 32 /* State */)) {
57
+ const ogValue = instance[memberName];
58
+ const ogDescriptor = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(instance), memberName);
59
+ Object.defineProperty(instance, memberName, {
60
+ get() {
61
+ return ogDescriptor.get.call(this);
62
+ },
63
+ set(newValue) {
64
+ ogDescriptor.set.call(this, newValue);
65
+ },
66
+ configurable: true,
67
+ enumerable: true
68
+ });
69
+ instance[memberName] = hostRef.$instanceValues$.has(memberName) ? hostRef.$instanceValues$.get(memberName) : ogValue;
70
+ }
71
+ });
72
+ };
73
+
74
+ // src/client/client-host-ref.ts
75
+ var getHostRef = (ref) => {
76
+ if (ref.__stencil__getHostRef) {
77
+ return ref.__stencil__getHostRef();
78
+ }
79
+ return void 0;
80
+ };
81
+ var registerInstance = (lazyInstance, hostRef) => {
82
+ lazyInstance.__stencil__getHostRef = () => hostRef;
83
+ hostRef.$lazyInstance$ = lazyInstance;
84
+ if (BUILD.modernPropertyDecls && (BUILD.state || BUILD.prop)) {
85
+ reWireGetterSetter(lazyInstance, hostRef);
86
+ }
87
+ };
88
+ var registerHost = (hostElement, cmpMeta) => {
89
+ const hostRef = {
90
+ $flags$: 0,
91
+ $hostElement$: hostElement,
92
+ $cmpMeta$: cmpMeta,
93
+ $instanceValues$: /* @__PURE__ */ new Map()
94
+ };
95
+ if (BUILD.isDev) {
96
+ hostRef.$renderCount$ = 0;
97
+ }
98
+ if (BUILD.method && BUILD.lazyLoad) {
99
+ hostRef.$onInstancePromise$ = new Promise((r) => hostRef.$onInstanceResolve$ = r);
100
+ }
101
+ if (BUILD.asyncLoading) {
102
+ hostRef.$onReadyPromise$ = new Promise((r) => hostRef.$onReadyResolve$ = r);
103
+ hostElement["s-p"] = [];
104
+ hostElement["s-rc"] = [];
105
+ }
106
+ const ref = hostRef;
107
+ hostElement.__stencil__getHostRef = () => ref;
108
+ if (!BUILD.lazyLoad && BUILD.modernPropertyDecls && (BUILD.state || BUILD.prop)) {
109
+ reWireGetterSetter(hostElement, hostRef);
110
+ }
111
+ return ref;
112
+ };
113
+ var isMemberInElement = (elm, memberName) => memberName in elm;
114
+ var customError;
115
+ var consoleError = (e, el) => (customError || console.error)(e, el);
116
+ var STENCIL_DEV_MODE = BUILD.isTesting ? ["STENCIL:"] : [
117
+ "%cstencil",
118
+ "color: white;background:#4c47ff;font-weight: bold; font-size:10px; padding:2px 6px; border-radius: 5px"
119
+ ];
120
+ var consoleDevError = (...m) => console.error(...STENCIL_DEV_MODE, ...m);
121
+ var consoleDevWarn = (...m) => console.warn(...STENCIL_DEV_MODE, ...m);
122
+ var consoleDevInfo = (...m) => console.info(...STENCIL_DEV_MODE, ...m);
123
+ var setErrorHandler = (handler) => customError = handler;
124
+
125
+ // src/client/client-load-module.ts
126
+ var cmpModules = /* @__PURE__ */ new Map();
127
+ var MODULE_IMPORT_PREFIX = "./";
128
+ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
129
+ const exportName = cmpMeta.$tagName$.replace(/-/g, "_");
130
+ const bundleId = cmpMeta.$lazyBundleId$;
131
+ if (BUILD.isDev && typeof bundleId !== "string") {
132
+ consoleDevError(
133
+ `Trying to lazily load component <${cmpMeta.$tagName$}> with style mode "${hostRef.$modeName$}", but it does not exist.`
134
+ );
135
+ return void 0;
136
+ } else if (!bundleId) {
137
+ return void 0;
138
+ }
139
+ const module = !BUILD.hotModuleReplacement ? cmpModules.get(bundleId) : false;
140
+ if (module) {
141
+ return module[exportName];
142
+ }
143
+ /*!__STENCIL_STATIC_IMPORT_SWITCH__*/
144
+ return import(
145
+ /* @vite-ignore */
146
+ /* webpackInclude: /\.entry\.js$/ */
147
+ /* webpackExclude: /\.system\.entry\.js$/ */
148
+ /* webpackMode: "lazy" */
149
+ `./${bundleId}.entry.js${BUILD.hotModuleReplacement && hmrVersionId ? "?s-hmr=" + hmrVersionId : ""}`
150
+ ).then(
151
+ (importedModule) => {
152
+ if (!BUILD.hotModuleReplacement) {
153
+ cmpModules.set(bundleId, importedModule);
154
+ }
155
+ return importedModule[exportName];
156
+ },
157
+ (e) => {
158
+ consoleError(e, hostRef.$hostElement$);
159
+ }
160
+ );
161
+ };
162
+
163
+ // src/client/client-style.ts
164
+ var styles = /* @__PURE__ */ new Map();
165
+ var modeResolutionChain = [];
166
+
167
+ // src/runtime/runtime-constants.ts
168
+ var CONTENT_REF_ID = "r";
169
+ var ORG_LOCATION_ID = "o";
170
+ var SLOT_NODE_ID = "s";
171
+ var TEXT_NODE_ID = "t";
172
+ var COMMENT_NODE_ID = "c";
173
+ var HYDRATE_ID = "s-id";
174
+ var HYDRATED_STYLE_ID = "sty-id";
175
+ var HYDRATE_CHILD_ID = "c-id";
176
+ var HYDRATED_CSS = "{visibility:hidden}.hydrated{visibility:inherit}";
177
+ var STENCIL_DOC_DATA = "_stencilDocData";
178
+ var DEFAULT_DOC_DATA = {
179
+ hostIds: 0,
180
+ rootLevelIds: 0,
181
+ staticComponents: /* @__PURE__ */ new Set()
182
+ };
183
+ var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
184
+ var XLINK_NS = "http://www.w3.org/1999/xlink";
185
+ var FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS = [
186
+ "formAssociatedCallback",
187
+ "formResetCallback",
188
+ "formDisabledCallback",
189
+ "formStateRestoreCallback"
190
+ ];
191
+ var win = typeof window !== "undefined" ? window : {};
192
+ var H = win.HTMLElement || class {
193
+ };
194
+ var plt = {
195
+ $flags$: 0,
196
+ $resourcesUrl$: "",
197
+ jmp: (h2) => h2(),
198
+ raf: (h2) => requestAnimationFrame(h2),
199
+ ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
200
+ rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
201
+ ce: (eventName, opts) => new CustomEvent(eventName, opts)
202
+ };
203
+ var setPlatformHelpers = (helpers) => {
204
+ Object.assign(plt, helpers);
205
+ };
206
+ var supportsShadow = BUILD.shadowDom;
207
+ var supportsListenerOptions = /* @__PURE__ */ (() => {
208
+ var _a;
209
+ let supportsListenerOptions2 = false;
210
+ try {
211
+ (_a = win.document) == null ? void 0 : _a.addEventListener(
212
+ "e",
213
+ null,
214
+ Object.defineProperty({}, "passive", {
215
+ get() {
216
+ supportsListenerOptions2 = true;
217
+ }
218
+ })
219
+ );
220
+ } catch (e) {
221
+ }
222
+ return supportsListenerOptions2;
223
+ })();
224
+ var promiseResolve = (v) => Promise.resolve(v);
225
+ var supportsConstructableStylesheets = BUILD.constructableCSS ? /* @__PURE__ */ (() => {
226
+ try {
227
+ new CSSStyleSheet();
228
+ return typeof new CSSStyleSheet().replaceSync === "function";
229
+ } catch (e) {
230
+ }
231
+ return false;
232
+ })() : false;
233
+
234
+ // src/client/client-task-queue.ts
235
+ var queueCongestion = 0;
236
+ var queuePending = false;
237
+ var queueDomReads = [];
238
+ var queueDomWrites = [];
239
+ var queueDomWritesLow = [];
240
+ var queueTask = (queue, write) => (cb) => {
241
+ queue.push(cb);
242
+ if (!queuePending) {
243
+ queuePending = true;
244
+ if (write && plt.$flags$ & 4 /* queueSync */) {
245
+ nextTick(flush);
246
+ } else {
247
+ plt.raf(flush);
248
+ }
249
+ }
250
+ };
251
+ var consume = (queue) => {
252
+ for (let i2 = 0; i2 < queue.length; i2++) {
253
+ try {
254
+ queue[i2](performance.now());
255
+ } catch (e) {
256
+ consoleError(e);
257
+ }
258
+ }
259
+ queue.length = 0;
260
+ };
261
+ var consumeTimeout = (queue, timeout) => {
262
+ let i2 = 0;
263
+ let ts = 0;
264
+ while (i2 < queue.length && (ts = performance.now()) < timeout) {
265
+ try {
266
+ queue[i2++](ts);
267
+ } catch (e) {
268
+ consoleError(e);
269
+ }
270
+ }
271
+ if (i2 === queue.length) {
272
+ queue.length = 0;
273
+ } else if (i2 !== 0) {
274
+ queue.splice(0, i2);
275
+ }
276
+ };
277
+ var flush = () => {
278
+ if (BUILD.asyncQueue) {
279
+ queueCongestion++;
280
+ }
281
+ consume(queueDomReads);
282
+ if (BUILD.asyncQueue) {
283
+ const timeout = (plt.$flags$ & 6 /* queueMask */) === 2 /* appLoaded */ ? performance.now() + 14 * Math.ceil(queueCongestion * (1 / 10)) : Infinity;
284
+ consumeTimeout(queueDomWrites, timeout);
285
+ consumeTimeout(queueDomWritesLow, timeout);
286
+ if (queueDomWrites.length > 0) {
287
+ queueDomWritesLow.push(...queueDomWrites);
288
+ queueDomWrites.length = 0;
289
+ }
290
+ if (queuePending = queueDomReads.length + queueDomWrites.length + queueDomWritesLow.length > 0) {
291
+ plt.raf(flush);
292
+ } else {
293
+ queueCongestion = 0;
294
+ }
295
+ } else {
296
+ consume(queueDomWrites);
297
+ if (queuePending = queueDomReads.length > 0) {
298
+ plt.raf(flush);
299
+ }
300
+ }
301
+ };
302
+ var nextTick = (cb) => promiseResolve().then(cb);
303
+ var readTask = /* @__PURE__ */ queueTask(queueDomReads, false);
304
+ var writeTask = /* @__PURE__ */ queueTask(queueDomWrites, true);
305
+
306
+ // src/runtime/asset-path.ts
307
+ var getAssetPath = (path) => {
308
+ const assetUrl = new URL(path, plt.$resourcesUrl$);
309
+ return assetUrl.origin !== win.location.origin ? assetUrl.href : assetUrl.pathname;
310
+ };
311
+ var setAssetPath = (path) => plt.$resourcesUrl$ = path;
312
+
313
+ // src/utils/helpers.ts
314
+ var isDef = (v) => v != null && v !== void 0;
315
+ var isComplexType = (o) => {
316
+ o = typeof o;
317
+ return o === "object" || o === "function";
318
+ };
319
+
320
+ // src/utils/query-nonce-meta-tag-content.ts
321
+ function queryNonceMetaTagContent(doc) {
322
+ var _a, _b, _c;
323
+ return (_c = (_b = (_a = doc.head) == null ? void 0 : _a.querySelector('meta[name="csp-nonce"]')) == null ? void 0 : _b.getAttribute("content")) != null ? _c : void 0;
324
+ }
325
+
326
+ // src/utils/regular-expression.ts
327
+ var escapeRegExpSpecialCharacters = (text) => {
328
+ return text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
329
+ };
330
+
331
+ // src/utils/remote-value.ts
332
+ var RemoteValue = class _RemoteValue {
333
+ /**
334
+ * Deserializes a LocalValue serialized object back to its original JavaScript representation
335
+ *
336
+ * @param serialized The serialized LocalValue object
337
+ * @returns The original JavaScript value/object
338
+ */
339
+ static fromLocalValue(serialized) {
340
+ const type = serialized[TYPE_CONSTANT];
341
+ const value = VALUE_CONSTANT in serialized ? serialized[VALUE_CONSTANT] : void 0;
342
+ switch (type) {
343
+ case "string" /* String */:
344
+ return value;
345
+ case "boolean" /* Boolean */:
346
+ return value;
347
+ case "bigint" /* BigInt */:
348
+ return BigInt(value);
349
+ case "undefined" /* Undefined */:
350
+ return void 0;
351
+ case "null" /* Null */:
352
+ return null;
353
+ case "number" /* Number */:
354
+ if (value === "NaN") return NaN;
355
+ if (value === "-0") return -0;
356
+ if (value === "Infinity") return Infinity;
357
+ if (value === "-Infinity") return -Infinity;
358
+ return value;
359
+ case "array" /* Array */:
360
+ return value.map((item) => _RemoteValue.fromLocalValue(item));
361
+ case "date" /* Date */:
362
+ return new Date(value);
363
+ case "map" /* Map */:
364
+ const map2 = /* @__PURE__ */ new Map();
365
+ for (const [key, val] of value) {
366
+ const deserializedKey = typeof key === "object" && key !== null ? _RemoteValue.fromLocalValue(key) : key;
367
+ const deserializedValue = _RemoteValue.fromLocalValue(val);
368
+ map2.set(deserializedKey, deserializedValue);
369
+ }
370
+ return map2;
371
+ case "object" /* Object */:
372
+ const obj = {};
373
+ for (const [key, val] of value) {
374
+ obj[key] = _RemoteValue.fromLocalValue(val);
375
+ }
376
+ return obj;
377
+ case "regexp" /* RegularExpression */:
378
+ const { pattern, flags } = value;
379
+ return new RegExp(pattern, flags);
380
+ case "set" /* Set */:
381
+ const set = /* @__PURE__ */ new Set();
382
+ for (const item of value) {
383
+ set.add(_RemoteValue.fromLocalValue(item));
384
+ }
385
+ return set;
386
+ case "symbol" /* Symbol */:
387
+ return Symbol(value);
388
+ default:
389
+ throw new Error(`Unsupported type: ${type}`);
390
+ }
391
+ }
392
+ /**
393
+ * Utility method to deserialize multiple LocalValues at once
394
+ *
395
+ * @param serializedValues Array of serialized LocalValue objects
396
+ * @returns Array of deserialized JavaScript values
397
+ */
398
+ static fromLocalValueArray(serializedValues) {
399
+ return serializedValues.map((value) => _RemoteValue.fromLocalValue(value));
400
+ }
401
+ /**
402
+ * Verifies if the given object matches the structure of a serialized LocalValue
403
+ *
404
+ * @param obj Object to verify
405
+ * @returns boolean indicating if the object has LocalValue structure
406
+ */
407
+ static isLocalValueObject(obj) {
408
+ if (typeof obj !== "object" || obj === null) {
409
+ return false;
410
+ }
411
+ if (!obj.hasOwnProperty(TYPE_CONSTANT)) {
412
+ return false;
413
+ }
414
+ const type = obj[TYPE_CONSTANT];
415
+ const hasTypeProperty = Object.values({ ...PrimitiveType, ...NonPrimitiveType }).includes(type);
416
+ if (!hasTypeProperty) {
417
+ return false;
418
+ }
419
+ if (type !== "null" /* Null */ && type !== "undefined" /* Undefined */) {
420
+ return obj.hasOwnProperty(VALUE_CONSTANT);
421
+ }
422
+ return true;
423
+ }
424
+ };
425
+
426
+ // src/utils/result.ts
427
+ var result_exports = {};
428
+ __export(result_exports, {
429
+ err: () => err,
430
+ map: () => map,
431
+ ok: () => ok,
432
+ unwrap: () => unwrap,
433
+ unwrapErr: () => unwrapErr
434
+ });
435
+ var ok = (value) => ({
436
+ isOk: true,
437
+ isErr: false,
438
+ value
439
+ });
440
+ var err = (value) => ({
441
+ isOk: false,
442
+ isErr: true,
443
+ value
444
+ });
445
+ function map(result, fn) {
446
+ if (result.isOk) {
447
+ const val = fn(result.value);
448
+ if (val instanceof Promise) {
449
+ return val.then((newVal) => ok(newVal));
450
+ } else {
451
+ return ok(val);
452
+ }
453
+ }
454
+ if (result.isErr) {
455
+ const value = result.value;
456
+ return err(value);
457
+ }
458
+ throw "should never get here";
459
+ }
460
+ var unwrap = (result) => {
461
+ if (result.isOk) {
462
+ return result.value;
463
+ } else {
464
+ throw result.value;
465
+ }
466
+ };
467
+ var unwrapErr = (result) => {
468
+ if (result.isErr) {
469
+ return result.value;
470
+ } else {
471
+ throw result.value;
472
+ }
473
+ };
474
+
475
+ // src/utils/serialize.ts
476
+ function deserializeProperty(value) {
477
+ if (typeof value !== "string" || !value.startsWith(SERIALIZED_PREFIX)) {
478
+ return value;
479
+ }
480
+ return RemoteValue.fromLocalValue(JSON.parse(atob(value.slice(SERIALIZED_PREFIX.length))));
481
+ }
482
+
483
+ // src/utils/util.ts
484
+ var lowerPathParam = (fn) => (p) => fn(p.toLowerCase());
485
+ var isDtsFile = lowerPathParam((p) => p.endsWith(".d.ts") || p.endsWith(".d.mts") || p.endsWith(".d.cts"));
486
+ var isTsFile = lowerPathParam(
487
+ (p) => !isDtsFile(p) && (p.endsWith(".ts") || p.endsWith(".mts") || p.endsWith(".cts"))
488
+ );
489
+ var isTsxFile = lowerPathParam(
490
+ (p) => p.endsWith(".tsx") || p.endsWith(".mtsx") || p.endsWith(".ctsx")
491
+ );
492
+ var isJsxFile = lowerPathParam(
493
+ (p) => p.endsWith(".jsx") || p.endsWith(".mjsx") || p.endsWith(".cjsx")
494
+ );
495
+ var isJsFile = lowerPathParam((p) => p.endsWith(".js") || p.endsWith(".mjs") || p.endsWith(".cjs"));
496
+ var updateFallbackSlotVisibility = (elm) => {
497
+ const childNodes = internalCall(elm, "childNodes");
498
+ if (elm.tagName && elm.tagName.includes("-") && elm["s-cr"] && elm.tagName !== "SLOT-FB") {
499
+ getHostSlotNodes(childNodes, elm.tagName).forEach((slotNode) => {
500
+ if (slotNode.nodeType === 1 /* ElementNode */ && slotNode.tagName === "SLOT-FB") {
501
+ if (getSlotChildSiblings(slotNode, getSlotName(slotNode), false).length) {
502
+ slotNode.hidden = true;
503
+ } else {
504
+ slotNode.hidden = false;
505
+ }
506
+ }
507
+ });
508
+ }
509
+ let i2 = 0;
510
+ for (i2 = 0; i2 < childNodes.length; i2++) {
511
+ const childNode = childNodes[i2];
512
+ if (childNode.nodeType === 1 /* ElementNode */ && internalCall(childNode, "childNodes").length) {
513
+ updateFallbackSlotVisibility(childNode);
514
+ }
515
+ }
516
+ };
517
+ var getSlottedChildNodes = (childNodes) => {
518
+ const result = [];
519
+ for (let i2 = 0; i2 < childNodes.length; i2++) {
520
+ const slottedNode = childNodes[i2]["s-nr"] || void 0;
521
+ if (slottedNode && slottedNode.isConnected) {
522
+ result.push(slottedNode);
523
+ }
524
+ }
525
+ return result;
526
+ };
527
+ function getHostSlotNodes(childNodes, hostName, slotName) {
528
+ let i2 = 0;
529
+ let slottedNodes = [];
530
+ let childNode;
531
+ for (; i2 < childNodes.length; i2++) {
532
+ childNode = childNodes[i2];
533
+ if (childNode["s-sr"] && (!hostName || childNode["s-hn"] === hostName) && (slotName === void 0 || getSlotName(childNode) === slotName)) {
534
+ slottedNodes.push(childNode);
535
+ if (typeof slotName !== "undefined") return slottedNodes;
536
+ }
537
+ slottedNodes = [...slottedNodes, ...getHostSlotNodes(childNode.childNodes, hostName, slotName)];
538
+ }
539
+ return slottedNodes;
540
+ }
541
+ var getSlotChildSiblings = (slot, slotName, includeSlot = true) => {
542
+ const childNodes = [];
543
+ if (includeSlot && slot["s-sr"] || !slot["s-sr"]) childNodes.push(slot);
544
+ let node = slot;
545
+ while (node = node.nextSibling) {
546
+ if (getSlotName(node) === slotName && (includeSlot || !node["s-sr"])) childNodes.push(node);
547
+ }
548
+ return childNodes;
549
+ };
550
+ var isNodeLocatedInSlot = (nodeToRelocate, slotName) => {
551
+ if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
552
+ if (nodeToRelocate.getAttribute("slot") === null && slotName === "") {
553
+ return true;
554
+ }
555
+ if (nodeToRelocate.getAttribute("slot") === slotName) {
556
+ return true;
557
+ }
558
+ return false;
559
+ }
560
+ if (nodeToRelocate["s-sn"] === slotName) {
561
+ return true;
562
+ }
563
+ return slotName === "";
564
+ };
565
+ var addSlotRelocateNode = (newChild, slotNode, prepend, position) => {
566
+ if (newChild["s-ol"] && newChild["s-ol"].isConnected) {
567
+ return;
568
+ }
569
+ const slottedNodeLocation = document.createTextNode("");
570
+ slottedNodeLocation["s-nr"] = newChild;
571
+ if (!slotNode["s-cr"] || !slotNode["s-cr"].parentNode) return;
572
+ const parent = slotNode["s-cr"].parentNode;
573
+ const appendMethod = prepend ? internalCall(parent, "prepend") : internalCall(parent, "appendChild");
574
+ if (BUILD.hydrateClientSide && typeof position !== "undefined") {
575
+ slottedNodeLocation["s-oo"] = position;
576
+ const childNodes = internalCall(parent, "childNodes");
577
+ const slotRelocateNodes = [slottedNodeLocation];
578
+ childNodes.forEach((n) => {
579
+ if (n["s-nr"]) slotRelocateNodes.push(n);
580
+ });
581
+ slotRelocateNodes.sort((a, b) => {
582
+ if (!a["s-oo"] || a["s-oo"] < (b["s-oo"] || 0)) return -1;
583
+ else if (!b["s-oo"] || b["s-oo"] < a["s-oo"]) return 1;
584
+ return 0;
585
+ });
586
+ slotRelocateNodes.forEach((n) => appendMethod.call(parent, n));
587
+ } else {
588
+ appendMethod.call(parent, slottedNodeLocation);
589
+ }
590
+ newChild["s-ol"] = slottedNodeLocation;
591
+ newChild["s-sh"] = slotNode["s-hn"];
592
+ };
593
+ var getSlotName = (node) => typeof node["s-sn"] === "string" ? node["s-sn"] : node.nodeType === 1 && node.getAttribute("slot") || void 0;
594
+ function patchSlotNode(node) {
595
+ if (node.assignedElements || node.assignedNodes || !node["s-sr"]) return;
596
+ const assignedFactory = (elementsOnly) => (function(opts) {
597
+ const toReturn = [];
598
+ const slotName = this["s-sn"];
599
+ if (opts == null ? void 0 : opts.flatten) {
600
+ console.error(`
601
+ Flattening is not supported for Stencil non-shadow slots.
602
+ You can use \`.childNodes\` to nested slot fallback content.
603
+ If you have a particular use case, please open an issue on the Stencil repo.
604
+ `);
605
+ }
606
+ const parent = this["s-cr"].parentElement;
607
+ const slottedNodes = parent.__childNodes ? parent.childNodes : getSlottedChildNodes(parent.childNodes);
608
+ slottedNodes.forEach((n) => {
609
+ if (slotName === getSlotName(n)) {
610
+ toReturn.push(n);
611
+ }
612
+ });
613
+ if (elementsOnly) {
614
+ return toReturn.filter((n) => n.nodeType === 1 /* ElementNode */);
615
+ }
616
+ return toReturn;
617
+ }).bind(node);
618
+ node.assignedElements = assignedFactory(true);
619
+ node.assignedNodes = assignedFactory(false);
620
+ }
621
+ function dispatchSlotChangeEvent(elm) {
622
+ elm.dispatchEvent(new CustomEvent("slotchange", { bubbles: false, cancelable: false, composed: false }));
623
+ }
624
+ function findSlotFromSlottedNode(slottedNode, parentHost) {
625
+ var _a;
626
+ parentHost = parentHost || ((_a = slottedNode["s-ol"]) == null ? void 0 : _a.parentElement);
627
+ if (!parentHost) return { slotNode: null, slotName: "" };
628
+ const slotName = slottedNode["s-sn"] = getSlotName(slottedNode) || "";
629
+ const childNodes = internalCall(parentHost, "childNodes");
630
+ const slotNode = getHostSlotNodes(childNodes, parentHost.tagName, slotName)[0];
631
+ return { slotNode, slotName };
632
+ }
633
+
634
+ // src/runtime/dom-extras.ts
635
+ var patchPseudoShadowDom = (hostElementPrototype) => {
636
+ patchCloneNode(hostElementPrototype);
637
+ patchSlotAppendChild(hostElementPrototype);
638
+ patchSlotAppend(hostElementPrototype);
639
+ patchSlotPrepend(hostElementPrototype);
640
+ patchSlotInsertAdjacentElement(hostElementPrototype);
641
+ patchSlotInsertAdjacentHTML(hostElementPrototype);
642
+ patchSlotInsertAdjacentText(hostElementPrototype);
643
+ patchInsertBefore(hostElementPrototype);
644
+ patchTextContent(hostElementPrototype);
645
+ patchChildSlotNodes(hostElementPrototype);
646
+ patchSlotRemoveChild(hostElementPrototype);
647
+ };
648
+ var patchCloneNode = (HostElementPrototype) => {
649
+ const orgCloneNode = HostElementPrototype.cloneNode;
650
+ HostElementPrototype.cloneNode = function(deep) {
651
+ const srcNode = this;
652
+ const isShadowDom = BUILD.shadowDom ? srcNode.shadowRoot && supportsShadow : false;
653
+ const clonedNode = orgCloneNode.call(srcNode, isShadowDom ? deep : false);
654
+ if (BUILD.slot && !isShadowDom && deep) {
655
+ let i2 = 0;
656
+ let slotted, nonStencilNode;
657
+ const stencilPrivates = [
658
+ "s-id",
659
+ "s-cr",
660
+ "s-lr",
661
+ "s-rc",
662
+ "s-sc",
663
+ "s-p",
664
+ "s-cn",
665
+ "s-sr",
666
+ "s-sn",
667
+ "s-hn",
668
+ "s-ol",
669
+ "s-nr",
670
+ "s-si",
671
+ "s-rf",
672
+ "s-scs"
673
+ ];
674
+ const childNodes = this.__childNodes || this.childNodes;
675
+ for (; i2 < childNodes.length; i2++) {
676
+ slotted = childNodes[i2]["s-nr"];
677
+ nonStencilNode = stencilPrivates.every((privateField) => !childNodes[i2][privateField]);
678
+ if (slotted) {
679
+ if (BUILD.appendChildSlotFix && clonedNode.__appendChild) {
680
+ clonedNode.__appendChild(slotted.cloneNode(true));
681
+ } else {
682
+ clonedNode.appendChild(slotted.cloneNode(true));
683
+ }
684
+ }
685
+ if (nonStencilNode) {
686
+ clonedNode.appendChild(childNodes[i2].cloneNode(true));
687
+ }
688
+ }
689
+ }
690
+ return clonedNode;
691
+ };
692
+ };
693
+ var patchSlotAppendChild = (HostElementPrototype) => {
694
+ HostElementPrototype.__appendChild = HostElementPrototype.appendChild;
695
+ HostElementPrototype.appendChild = function(newChild) {
696
+ const { slotName, slotNode } = findSlotFromSlottedNode(newChild, this);
697
+ if (slotNode) {
698
+ addSlotRelocateNode(newChild, slotNode);
699
+ const slotChildNodes = getSlotChildSiblings(slotNode, slotName);
700
+ const appendAfter = slotChildNodes[slotChildNodes.length - 1];
701
+ const parent = internalCall(appendAfter, "parentNode");
702
+ const insertedNode = internalCall(parent, "insertBefore")(newChild, appendAfter.nextSibling);
703
+ dispatchSlotChangeEvent(slotNode);
704
+ updateFallbackSlotVisibility(this);
705
+ return insertedNode;
706
+ }
707
+ return this.__appendChild(newChild);
708
+ };
709
+ };
710
+ var patchSlotRemoveChild = (ElementPrototype) => {
711
+ ElementPrototype.__removeChild = ElementPrototype.removeChild;
712
+ ElementPrototype.removeChild = function(toRemove) {
713
+ if (toRemove && typeof toRemove["s-sn"] !== "undefined") {
714
+ const childNodes = this.__childNodes || this.childNodes;
715
+ const slotNode = getHostSlotNodes(childNodes, this.tagName, toRemove["s-sn"]);
716
+ if (slotNode && toRemove.isConnected) {
717
+ toRemove.remove();
718
+ updateFallbackSlotVisibility(this);
719
+ return;
720
+ }
721
+ }
722
+ return this.__removeChild(toRemove);
723
+ };
724
+ };
725
+ var patchSlotPrepend = (HostElementPrototype) => {
726
+ HostElementPrototype.__prepend = HostElementPrototype.prepend;
727
+ HostElementPrototype.prepend = function(...newChildren) {
728
+ newChildren.forEach((newChild) => {
729
+ if (typeof newChild === "string") {
730
+ newChild = this.ownerDocument.createTextNode(newChild);
731
+ }
732
+ const slotName = (newChild["s-sn"] = getSlotName(newChild)) || "";
733
+ const childNodes = internalCall(this, "childNodes");
734
+ const slotNode = getHostSlotNodes(childNodes, this.tagName, slotName)[0];
735
+ if (slotNode) {
736
+ addSlotRelocateNode(newChild, slotNode, true);
737
+ const slotChildNodes = getSlotChildSiblings(slotNode, slotName);
738
+ const appendAfter = slotChildNodes[0];
739
+ const parent = internalCall(appendAfter, "parentNode");
740
+ const toReturn = internalCall(parent, "insertBefore")(newChild, internalCall(appendAfter, "nextSibling"));
741
+ dispatchSlotChangeEvent(slotNode);
742
+ return toReturn;
743
+ }
744
+ if (newChild.nodeType === 1 && !!newChild.getAttribute("slot")) {
745
+ newChild.hidden = true;
746
+ }
747
+ return HostElementPrototype.__prepend(newChild);
748
+ });
749
+ };
750
+ };
751
+ var patchSlotAppend = (HostElementPrototype) => {
752
+ HostElementPrototype.__append = HostElementPrototype.append;
753
+ HostElementPrototype.append = function(...newChildren) {
754
+ newChildren.forEach((newChild) => {
755
+ if (typeof newChild === "string") {
756
+ newChild = this.ownerDocument.createTextNode(newChild);
757
+ }
758
+ this.appendChild(newChild);
759
+ });
760
+ };
761
+ };
762
+ var patchSlotInsertAdjacentHTML = (HostElementPrototype) => {
763
+ const originalInsertAdjacentHtml = HostElementPrototype.insertAdjacentHTML;
764
+ HostElementPrototype.insertAdjacentHTML = function(position, text) {
765
+ if (position !== "afterbegin" && position !== "beforeend") {
766
+ return originalInsertAdjacentHtml.call(this, position, text);
767
+ }
768
+ const container = this.ownerDocument.createElement("_");
769
+ let node;
770
+ container.innerHTML = text;
771
+ if (position === "afterbegin") {
772
+ while (node = container.firstChild) {
773
+ this.prepend(node);
774
+ }
775
+ } else if (position === "beforeend") {
776
+ while (node = container.firstChild) {
777
+ this.append(node);
778
+ }
779
+ }
780
+ };
781
+ };
782
+ var patchSlotInsertAdjacentText = (HostElementPrototype) => {
783
+ HostElementPrototype.insertAdjacentText = function(position, text) {
784
+ this.insertAdjacentHTML(position, text);
785
+ };
786
+ };
787
+ var patchInsertBefore = (HostElementPrototype) => {
788
+ const eleProto = HostElementPrototype;
789
+ if (eleProto.__insertBefore) return;
790
+ eleProto.__insertBefore = HostElementPrototype.insertBefore;
791
+ HostElementPrototype.insertBefore = function(newChild, currentChild) {
792
+ const { slotName, slotNode } = findSlotFromSlottedNode(newChild, this);
793
+ const slottedNodes = this.__childNodes ? this.childNodes : getSlottedChildNodes(this.childNodes);
794
+ if (slotNode) {
795
+ let found = false;
796
+ slottedNodes.forEach((childNode) => {
797
+ if (childNode === currentChild || currentChild === null) {
798
+ found = true;
799
+ if (currentChild === null || slotName !== currentChild["s-sn"]) {
800
+ this.appendChild(newChild);
801
+ return;
802
+ }
803
+ if (slotName === currentChild["s-sn"]) {
804
+ addSlotRelocateNode(newChild, slotNode);
805
+ const parent = internalCall(currentChild, "parentNode");
806
+ internalCall(parent, "insertBefore")(newChild, currentChild);
807
+ dispatchSlotChangeEvent(slotNode);
808
+ }
809
+ return;
810
+ }
811
+ });
812
+ if (found) return newChild;
813
+ }
814
+ const parentNode = currentChild == null ? void 0 : currentChild.__parentNode;
815
+ if (parentNode && !this.isSameNode(parentNode)) {
816
+ return this.appendChild(newChild);
817
+ }
818
+ return this.__insertBefore(newChild, currentChild);
819
+ };
820
+ };
821
+ var patchSlotInsertAdjacentElement = (HostElementPrototype) => {
822
+ const originalInsertAdjacentElement = HostElementPrototype.insertAdjacentElement;
823
+ HostElementPrototype.insertAdjacentElement = function(position, element) {
824
+ if (position !== "afterbegin" && position !== "beforeend") {
825
+ return originalInsertAdjacentElement.call(this, position, element);
826
+ }
827
+ if (position === "afterbegin") {
828
+ this.prepend(element);
829
+ return element;
830
+ } else if (position === "beforeend") {
831
+ this.append(element);
832
+ return element;
833
+ }
834
+ return element;
835
+ };
836
+ };
837
+ var patchTextContent = (hostElementPrototype) => {
838
+ patchHostOriginalAccessor("textContent", hostElementPrototype);
839
+ Object.defineProperty(hostElementPrototype, "textContent", {
840
+ get: function() {
841
+ let text = "";
842
+ const childNodes = this.__childNodes ? this.childNodes : getSlottedChildNodes(this.childNodes);
843
+ childNodes.forEach((node) => text += node.textContent || "");
844
+ return text;
845
+ },
846
+ set: function(value) {
847
+ const childNodes = this.__childNodes ? this.childNodes : getSlottedChildNodes(this.childNodes);
848
+ childNodes.forEach((node) => {
849
+ if (node["s-ol"]) node["s-ol"].remove();
850
+ node.remove();
851
+ });
852
+ this.insertAdjacentHTML("beforeend", value);
853
+ }
854
+ });
855
+ };
856
+ var patchChildSlotNodes = (elm) => {
857
+ class FakeNodeList extends Array {
858
+ item(n) {
859
+ return this[n];
860
+ }
861
+ }
862
+ patchHostOriginalAccessor("children", elm);
863
+ Object.defineProperty(elm, "children", {
864
+ get() {
865
+ return this.childNodes.filter((n) => n.nodeType === 1);
866
+ }
867
+ });
868
+ Object.defineProperty(elm, "childElementCount", {
869
+ get() {
870
+ return this.children.length;
871
+ }
872
+ });
873
+ patchHostOriginalAccessor("firstChild", elm);
874
+ Object.defineProperty(elm, "firstChild", {
875
+ get() {
876
+ return this.childNodes[0];
877
+ }
878
+ });
879
+ patchHostOriginalAccessor("lastChild", elm);
880
+ Object.defineProperty(elm, "lastChild", {
881
+ get() {
882
+ return this.childNodes[this.childNodes.length - 1];
883
+ }
884
+ });
885
+ patchHostOriginalAccessor("childNodes", elm);
886
+ Object.defineProperty(elm, "childNodes", {
887
+ get() {
888
+ const result = new FakeNodeList();
889
+ result.push(...getSlottedChildNodes(this.__childNodes));
890
+ return result;
891
+ }
892
+ });
893
+ };
894
+ var patchSlottedNode = (node) => {
895
+ if (!node || node.__nextSibling !== void 0 || !globalThis.Node) return;
896
+ patchNextSibling(node);
897
+ patchPreviousSibling(node);
898
+ patchParentNode(node);
899
+ if (node.nodeType === Node.ELEMENT_NODE) {
900
+ patchNextElementSibling(node);
901
+ patchPreviousElementSibling(node);
902
+ }
903
+ };
904
+ var patchNextSibling = (node) => {
905
+ if (!node || node.__nextSibling) return;
906
+ patchHostOriginalAccessor("nextSibling", node);
907
+ Object.defineProperty(node, "nextSibling", {
908
+ get: function() {
909
+ var _a;
910
+ const parentNodes = (_a = this["s-ol"]) == null ? void 0 : _a.parentNode.childNodes;
911
+ const index = parentNodes == null ? void 0 : parentNodes.indexOf(this);
912
+ if (parentNodes && index > -1) {
913
+ return parentNodes[index + 1];
914
+ }
915
+ return this.__nextSibling;
916
+ }
917
+ });
918
+ };
919
+ var patchNextElementSibling = (element) => {
920
+ if (!element || element.__nextElementSibling) return;
921
+ patchHostOriginalAccessor("nextElementSibling", element);
922
+ Object.defineProperty(element, "nextElementSibling", {
923
+ get: function() {
924
+ var _a;
925
+ const parentEles = (_a = this["s-ol"]) == null ? void 0 : _a.parentNode.children;
926
+ const index = parentEles == null ? void 0 : parentEles.indexOf(this);
927
+ if (parentEles && index > -1) {
928
+ return parentEles[index + 1];
929
+ }
930
+ return this.__nextElementSibling;
931
+ }
932
+ });
933
+ };
934
+ var patchPreviousSibling = (node) => {
935
+ if (!node || node.__previousSibling) return;
936
+ patchHostOriginalAccessor("previousSibling", node);
937
+ Object.defineProperty(node, "previousSibling", {
938
+ get: function() {
939
+ var _a;
940
+ const parentNodes = (_a = this["s-ol"]) == null ? void 0 : _a.parentNode.childNodes;
941
+ const index = parentNodes == null ? void 0 : parentNodes.indexOf(this);
942
+ if (parentNodes && index > -1) {
943
+ return parentNodes[index - 1];
944
+ }
945
+ return this.__previousSibling;
946
+ }
947
+ });
948
+ };
949
+ var patchPreviousElementSibling = (element) => {
950
+ if (!element || element.__previousElementSibling) return;
951
+ patchHostOriginalAccessor("previousElementSibling", element);
952
+ Object.defineProperty(element, "previousElementSibling", {
953
+ get: function() {
954
+ var _a;
955
+ const parentNodes = (_a = this["s-ol"]) == null ? void 0 : _a.parentNode.children;
956
+ const index = parentNodes == null ? void 0 : parentNodes.indexOf(this);
957
+ if (parentNodes && index > -1) {
958
+ return parentNodes[index - 1];
959
+ }
960
+ return this.__previousElementSibling;
961
+ }
962
+ });
963
+ };
964
+ var patchParentNode = (node) => {
965
+ if (!node || node.__parentNode) return;
966
+ patchHostOriginalAccessor("parentNode", node);
967
+ Object.defineProperty(node, "parentNode", {
968
+ get: function() {
969
+ var _a;
970
+ return ((_a = this["s-ol"]) == null ? void 0 : _a.parentNode) || this.__parentNode;
971
+ },
972
+ set: function(value) {
973
+ this.__parentNode = value;
974
+ }
975
+ });
976
+ };
977
+ var validElementPatches = ["children", "nextElementSibling", "previousElementSibling"];
978
+ var validNodesPatches = [
979
+ "childNodes",
980
+ "firstChild",
981
+ "lastChild",
982
+ "nextSibling",
983
+ "previousSibling",
984
+ "textContent",
985
+ "parentNode"
986
+ ];
987
+ function patchHostOriginalAccessor(accessorName, node) {
988
+ let accessor;
989
+ if (validElementPatches.includes(accessorName)) {
990
+ accessor = Object.getOwnPropertyDescriptor(Element.prototype, accessorName);
991
+ } else if (validNodesPatches.includes(accessorName)) {
992
+ accessor = Object.getOwnPropertyDescriptor(Node.prototype, accessorName);
993
+ }
994
+ if (!accessor) {
995
+ accessor = Object.getOwnPropertyDescriptor(node, accessorName);
996
+ }
997
+ if (accessor) Object.defineProperty(node, "__" + accessorName, accessor);
998
+ }
999
+ function internalCall(node, method) {
1000
+ if ("__" + method in node) {
1001
+ const toReturn = node["__" + method];
1002
+ if (typeof toReturn !== "function") return toReturn;
1003
+ return toReturn.bind(node);
1004
+ } else {
1005
+ if (typeof node[method] !== "function") return node[method];
1006
+ return node[method].bind(node);
1007
+ }
1008
+ }
1009
+ var i = 0;
1010
+ var createTime = (fnName, tagName = "") => {
1011
+ if (BUILD.profile && performance.mark) {
1012
+ const key = `st:${fnName}:${tagName}:${i++}`;
1013
+ performance.mark(key);
1014
+ return () => performance.measure(`[Stencil] ${fnName}() <${tagName}>`, key);
1015
+ } else {
1016
+ return () => {
1017
+ return;
1018
+ };
1019
+ }
1020
+ };
1021
+ var uniqueTime = (key, measureText) => {
1022
+ if (BUILD.profile && performance.mark) {
1023
+ if (performance.getEntriesByName(key, "mark").length === 0) {
1024
+ performance.mark(key);
1025
+ }
1026
+ return () => {
1027
+ if (performance.getEntriesByName(measureText, "measure").length === 0) {
1028
+ performance.measure(measureText, key);
1029
+ }
1030
+ };
1031
+ } else {
1032
+ return () => {
1033
+ return;
1034
+ };
1035
+ }
1036
+ };
1037
+ var inspect = (ref) => {
1038
+ const hostRef = getHostRef(ref);
1039
+ if (!hostRef) {
1040
+ return void 0;
1041
+ }
1042
+ const flags = hostRef.$flags$;
1043
+ const hostElement = hostRef.$hostElement$;
1044
+ return {
1045
+ renderCount: hostRef.$renderCount$,
1046
+ flags: {
1047
+ hasRendered: !!(flags & 2 /* hasRendered */),
1048
+ hasConnected: !!(flags & 1 /* hasConnected */),
1049
+ isWaitingForChildren: !!(flags & 4 /* isWaitingForChildren */),
1050
+ isConstructingInstance: !!(flags & 8 /* isConstructingInstance */),
1051
+ isQueuedForUpdate: !!(flags & 16 /* isQueuedForUpdate */),
1052
+ hasInitializedComponent: !!(flags & 32 /* hasInitializedComponent */),
1053
+ hasLoadedComponent: !!(flags & 64 /* hasLoadedComponent */),
1054
+ isWatchReady: !!(flags & 128 /* isWatchReady */),
1055
+ isListenReady: !!(flags & 256 /* isListenReady */),
1056
+ needsRerender: !!(flags & 512 /* needsRerender */)
1057
+ },
1058
+ instanceValues: hostRef.$instanceValues$,
1059
+ ancestorComponent: hostRef.$ancestorComponent$,
1060
+ hostElement,
1061
+ lazyInstance: hostRef.$lazyInstance$,
1062
+ vnode: hostRef.$vnode$,
1063
+ modeName: hostRef.$modeName$,
1064
+ onReadyPromise: hostRef.$onReadyPromise$,
1065
+ onReadyResolve: hostRef.$onReadyResolve$,
1066
+ onInstancePromise: hostRef.$onInstancePromise$,
1067
+ onInstanceResolve: hostRef.$onInstanceResolve$,
1068
+ onRenderResolve: hostRef.$onRenderResolve$,
1069
+ queuedListeners: hostRef.$queuedListeners$,
1070
+ rmListeners: hostRef.$rmListeners$,
1071
+ ["s-id"]: hostElement["s-id"],
1072
+ ["s-cr"]: hostElement["s-cr"],
1073
+ ["s-lr"]: hostElement["s-lr"],
1074
+ ["s-p"]: hostElement["s-p"],
1075
+ ["s-rc"]: hostElement["s-rc"],
1076
+ ["s-sc"]: hostElement["s-sc"]
1077
+ };
1078
+ };
1079
+ var installDevTools = () => {
1080
+ if (BUILD.devTools) {
1081
+ const stencil = win.stencil = win.stencil || {};
1082
+ const originalInspect = stencil.inspect;
1083
+ stencil.inspect = (ref) => {
1084
+ let result = inspect(ref);
1085
+ if (!result && typeof originalInspect === "function") {
1086
+ result = originalInspect(ref);
1087
+ }
1088
+ return result;
1089
+ };
1090
+ }
1091
+ };
1092
+ var h = (nodeName, vnodeData, ...children) => {
1093
+ let child = null;
1094
+ let key = null;
1095
+ let slotName = null;
1096
+ let simple = false;
1097
+ let lastSimple = false;
1098
+ const vNodeChildren = [];
1099
+ const walk = (c) => {
1100
+ for (let i2 = 0; i2 < c.length; i2++) {
1101
+ child = c[i2];
1102
+ if (Array.isArray(child)) {
1103
+ walk(child);
1104
+ } else if (child != null && typeof child !== "boolean") {
1105
+ if (simple = typeof nodeName !== "function" && !isComplexType(child)) {
1106
+ child = String(child);
1107
+ } else if (BUILD.isDev && typeof nodeName !== "function" && child.$flags$ === void 0) {
1108
+ consoleDevError(`vNode passed as children has unexpected type.
1109
+ Make sure it's using the correct h() function.
1110
+ Empty objects can also be the cause, look for JSX comments that became objects.`);
1111
+ }
1112
+ if (simple && lastSimple) {
1113
+ vNodeChildren[vNodeChildren.length - 1].$text$ += child;
1114
+ } else {
1115
+ vNodeChildren.push(simple ? newVNode(null, child) : child);
1116
+ }
1117
+ lastSimple = simple;
1118
+ }
1119
+ }
1120
+ };
1121
+ walk(children);
1122
+ if (vnodeData) {
1123
+ if (BUILD.isDev && nodeName === "input") {
1124
+ validateInputProperties(vnodeData);
1125
+ }
1126
+ if (BUILD.vdomKey && vnodeData.key) {
1127
+ key = vnodeData.key;
1128
+ }
1129
+ if (BUILD.slotRelocation && vnodeData.name) {
1130
+ slotName = vnodeData.name;
1131
+ }
1132
+ if (BUILD.vdomClass) {
1133
+ const classData = vnodeData.className || vnodeData.class;
1134
+ if (classData) {
1135
+ vnodeData.class = typeof classData !== "object" ? classData : Object.keys(classData).filter((k) => classData[k]).join(" ");
1136
+ }
1137
+ }
1138
+ }
1139
+ if (BUILD.isDev && vNodeChildren.some(isHost)) {
1140
+ consoleDevError(`The <Host> must be the single root component. Make sure:
1141
+ - You are NOT using hostData() and <Host> in the same component.
1142
+ - <Host> is used once, and it's the single root component of the render() function.`);
1143
+ }
1144
+ if (BUILD.vdomFunctional && typeof nodeName === "function") {
1145
+ return nodeName(
1146
+ vnodeData === null ? {} : vnodeData,
1147
+ vNodeChildren,
1148
+ vdomFnUtils
1149
+ );
1150
+ }
1151
+ const vnode = newVNode(nodeName, null);
1152
+ vnode.$attrs$ = vnodeData;
1153
+ if (vNodeChildren.length > 0) {
1154
+ vnode.$children$ = vNodeChildren;
1155
+ }
1156
+ if (BUILD.vdomKey) {
1157
+ vnode.$key$ = key;
1158
+ }
1159
+ if (BUILD.slotRelocation) {
1160
+ vnode.$name$ = slotName;
1161
+ }
1162
+ return vnode;
1163
+ };
1164
+ var newVNode = (tag, text) => {
1165
+ const vnode = {
1166
+ $flags$: 0,
1167
+ $tag$: tag,
1168
+ $text$: text,
1169
+ $elm$: null,
1170
+ $children$: null
1171
+ };
1172
+ if (BUILD.vdomAttribute) {
1173
+ vnode.$attrs$ = null;
1174
+ }
1175
+ if (BUILD.vdomKey) {
1176
+ vnode.$key$ = null;
1177
+ }
1178
+ if (BUILD.slotRelocation) {
1179
+ vnode.$name$ = null;
1180
+ }
1181
+ return vnode;
1182
+ };
1183
+ var Host = {};
1184
+ var isHost = (node) => node && node.$tag$ === Host;
1185
+ var vdomFnUtils = {
1186
+ forEach: (children, cb) => children.map(convertToPublic).forEach(cb),
1187
+ map: (children, cb) => children.map(convertToPublic).map(cb).map(convertToPrivate)
1188
+ };
1189
+ var convertToPublic = (node) => ({
1190
+ vattrs: node.$attrs$,
1191
+ vchildren: node.$children$,
1192
+ vkey: node.$key$,
1193
+ vname: node.$name$,
1194
+ vtag: node.$tag$,
1195
+ vtext: node.$text$
1196
+ });
1197
+ var convertToPrivate = (node) => {
1198
+ if (typeof node.vtag === "function") {
1199
+ const vnodeData = { ...node.vattrs };
1200
+ if (node.vkey) {
1201
+ vnodeData.key = node.vkey;
1202
+ }
1203
+ if (node.vname) {
1204
+ vnodeData.name = node.vname;
1205
+ }
1206
+ return h(node.vtag, vnodeData, ...node.vchildren || []);
1207
+ }
1208
+ const vnode = newVNode(node.vtag, node.vtext);
1209
+ vnode.$attrs$ = node.vattrs;
1210
+ vnode.$children$ = node.vchildren;
1211
+ vnode.$key$ = node.vkey;
1212
+ vnode.$name$ = node.vname;
1213
+ return vnode;
1214
+ };
1215
+ var validateInputProperties = (inputElm) => {
1216
+ const props = Object.keys(inputElm);
1217
+ const value = props.indexOf("value");
1218
+ if (value === -1) {
1219
+ return;
1220
+ }
1221
+ const typeIndex = props.indexOf("type");
1222
+ const minIndex = props.indexOf("min");
1223
+ const maxIndex = props.indexOf("max");
1224
+ const stepIndex = props.indexOf("step");
1225
+ if (value < typeIndex || value < minIndex || value < maxIndex || value < stepIndex) {
1226
+ consoleDevWarn(`The "value" prop of <input> should be set after "min", "max", "type" and "step"`);
1227
+ }
1228
+ };
1229
+
1230
+ // src/runtime/client-hydrate.ts
1231
+ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1232
+ var _a;
1233
+ const endHydrate = createTime("hydrateClient", tagName);
1234
+ const shadowRoot = hostElm.shadowRoot;
1235
+ const childRenderNodes = [];
1236
+ const slotNodes = [];
1237
+ const slottedNodes = [];
1238
+ const shadowRootNodes = BUILD.shadowDom && shadowRoot ? [] : null;
1239
+ const vnode = newVNode(tagName, null);
1240
+ vnode.$elm$ = hostElm;
1241
+ const members = Object.entries(((_a = hostRef.$cmpMeta$) == null ? void 0 : _a.$members$) || {});
1242
+ members.forEach(([memberName, [memberFlags, metaAttributeName]]) => {
1243
+ var _a2;
1244
+ if (!(memberFlags & 31 /* Prop */)) {
1245
+ return;
1246
+ }
1247
+ const attributeName = metaAttributeName || memberName;
1248
+ const attrVal = hostElm.getAttribute(attributeName);
1249
+ if (attrVal !== null) {
1250
+ const attrPropVal = parsePropertyValue(attrVal, memberFlags);
1251
+ (_a2 = hostRef == null ? void 0 : hostRef.$instanceValues$) == null ? void 0 : _a2.set(memberName, attrPropVal);
1252
+ }
1253
+ });
1254
+ let scopeId2;
1255
+ if (BUILD.scoped) {
1256
+ const cmpMeta = hostRef.$cmpMeta$;
1257
+ if (cmpMeta && cmpMeta.$flags$ & 10 /* needsScopedEncapsulation */ && hostElm["s-sc"]) {
1258
+ scopeId2 = hostElm["s-sc"];
1259
+ hostElm.classList.add(scopeId2 + "-h");
1260
+ } else if (hostElm["s-sc"]) {
1261
+ delete hostElm["s-sc"];
1262
+ }
1263
+ }
1264
+ if (win.document && (!plt.$orgLocNodes$ || !plt.$orgLocNodes$.size)) {
1265
+ initializeDocumentHydrate(win.document.body, plt.$orgLocNodes$ = /* @__PURE__ */ new Map());
1266
+ }
1267
+ hostElm[HYDRATE_ID] = hostId;
1268
+ hostElm.removeAttribute(HYDRATE_ID);
1269
+ hostRef.$vnode$ = clientHydrate(
1270
+ vnode,
1271
+ childRenderNodes,
1272
+ slotNodes,
1273
+ shadowRootNodes,
1274
+ hostElm,
1275
+ hostElm,
1276
+ hostId,
1277
+ slottedNodes
1278
+ );
1279
+ let crIndex = 0;
1280
+ const crLength = childRenderNodes.length;
1281
+ let childRenderNode;
1282
+ for (crIndex; crIndex < crLength; crIndex++) {
1283
+ childRenderNode = childRenderNodes[crIndex];
1284
+ const orgLocationId = childRenderNode.$hostId$ + "." + childRenderNode.$nodeId$;
1285
+ const orgLocationNode = plt.$orgLocNodes$.get(orgLocationId);
1286
+ const node = childRenderNode.$elm$;
1287
+ if (!shadowRoot) {
1288
+ node["s-hn"] = tagName.toUpperCase();
1289
+ if (childRenderNode.$tag$ === "slot") {
1290
+ node["s-cr"] = hostElm["s-cr"];
1291
+ }
1292
+ }
1293
+ if (childRenderNode.$tag$ === "slot") {
1294
+ childRenderNode.$name$ = childRenderNode.$elm$["s-sn"] || childRenderNode.$elm$["name"] || null;
1295
+ if (childRenderNode.$children$) {
1296
+ childRenderNode.$flags$ |= 2 /* isSlotFallback */;
1297
+ if (!childRenderNode.$elm$.childNodes.length) {
1298
+ childRenderNode.$children$.forEach((c) => {
1299
+ childRenderNode.$elm$.appendChild(c.$elm$);
1300
+ });
1301
+ }
1302
+ } else {
1303
+ childRenderNode.$flags$ |= 1 /* isSlotReference */;
1304
+ }
1305
+ }
1306
+ if (orgLocationNode && orgLocationNode.isConnected) {
1307
+ if (shadowRoot && orgLocationNode["s-en"] === "") {
1308
+ orgLocationNode.parentNode.insertBefore(node, orgLocationNode.nextSibling);
1309
+ }
1310
+ orgLocationNode.parentNode.removeChild(orgLocationNode);
1311
+ if (!shadowRoot) {
1312
+ node["s-oo"] = parseInt(childRenderNode.$nodeId$);
1313
+ }
1314
+ }
1315
+ plt.$orgLocNodes$.delete(orgLocationId);
1316
+ }
1317
+ const hosts = [];
1318
+ const snLen = slottedNodes.length;
1319
+ let snIndex = 0;
1320
+ let slotGroup;
1321
+ let snGroupIdx;
1322
+ let snGroupLen;
1323
+ let slottedItem;
1324
+ for (snIndex; snIndex < snLen; snIndex++) {
1325
+ slotGroup = slottedNodes[snIndex];
1326
+ if (!slotGroup || !slotGroup.length) continue;
1327
+ snGroupLen = slotGroup.length;
1328
+ snGroupIdx = 0;
1329
+ for (snGroupIdx; snGroupIdx < snGroupLen; snGroupIdx++) {
1330
+ slottedItem = slotGroup[snGroupIdx];
1331
+ if (!hosts[slottedItem.hostId]) {
1332
+ hosts[slottedItem.hostId] = plt.$orgLocNodes$.get(slottedItem.hostId);
1333
+ }
1334
+ if (!hosts[slottedItem.hostId]) continue;
1335
+ const hostEle = hosts[slottedItem.hostId];
1336
+ if (!hostEle.shadowRoot || !shadowRoot) {
1337
+ slottedItem.slot["s-cr"] = hostEle["s-cr"];
1338
+ if (!slottedItem.slot["s-cr"] && hostEle.shadowRoot) {
1339
+ slottedItem.slot["s-cr"] = hostEle;
1340
+ } else {
1341
+ slottedItem.slot["s-cr"] = (hostEle.__childNodes || hostEle.childNodes)[0];
1342
+ }
1343
+ addSlotRelocateNode(slottedItem.node, slottedItem.slot, false, slottedItem.node["s-oo"]);
1344
+ if (BUILD.experimentalSlotFixes) {
1345
+ patchSlottedNode(slottedItem.node);
1346
+ }
1347
+ }
1348
+ if (hostEle.shadowRoot && slottedItem.node.parentElement !== hostEle) {
1349
+ hostEle.appendChild(slottedItem.node);
1350
+ }
1351
+ }
1352
+ }
1353
+ if (BUILD.scoped && scopeId2 && slotNodes.length) {
1354
+ slotNodes.forEach((slot) => {
1355
+ slot.$elm$.parentElement.classList.add(scopeId2 + "-s");
1356
+ });
1357
+ }
1358
+ if (BUILD.shadowDom && shadowRoot && !shadowRoot.childNodes.length) {
1359
+ let rnIdex = 0;
1360
+ const rnLen = shadowRootNodes.length;
1361
+ if (rnLen) {
1362
+ for (rnIdex; rnIdex < rnLen; rnIdex++) {
1363
+ shadowRoot.appendChild(shadowRootNodes[rnIdex]);
1364
+ }
1365
+ Array.from(hostElm.childNodes).forEach((node) => {
1366
+ if (typeof node["s-sn"] !== "string") {
1367
+ if (node.nodeType === 1 /* ElementNode */ && node.slot && node.hidden) {
1368
+ node.removeAttribute("hidden");
1369
+ } else if (node.nodeType === 8 /* CommentNode */ || node.nodeType === 3 /* TextNode */ && !node.wholeText.trim()) {
1370
+ node.parentNode.removeChild(node);
1371
+ }
1372
+ }
1373
+ });
1374
+ }
1375
+ }
1376
+ plt.$orgLocNodes$.delete(hostElm["s-id"]);
1377
+ hostRef.$hostElement$ = hostElm;
1378
+ endHydrate();
1379
+ };
1380
+ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node, hostId, slottedNodes = []) => {
1381
+ let childNodeType;
1382
+ let childIdSplt;
1383
+ let childVNode;
1384
+ let i2;
1385
+ const scopeId2 = hostElm["s-sc"];
1386
+ if (node.nodeType === 1 /* ElementNode */) {
1387
+ childNodeType = node.getAttribute(HYDRATE_CHILD_ID);
1388
+ if (childNodeType) {
1389
+ childIdSplt = childNodeType.split(".");
1390
+ if (childIdSplt[0] === hostId || childIdSplt[0] === "0") {
1391
+ childVNode = createSimpleVNode({
1392
+ $flags$: 0,
1393
+ $hostId$: childIdSplt[0],
1394
+ $nodeId$: childIdSplt[1],
1395
+ $depth$: childIdSplt[2],
1396
+ $index$: childIdSplt[3],
1397
+ $tag$: node.tagName.toLowerCase(),
1398
+ $elm$: node,
1399
+ // If we don't add the initial classes to the VNode, the first `vdom-render.ts` patch
1400
+ // won't try to reconcile them. Classes set on the node will be blown away.
1401
+ $attrs$: { class: node.className || "" }
1402
+ });
1403
+ childRenderNodes.push(childVNode);
1404
+ node.removeAttribute(HYDRATE_CHILD_ID);
1405
+ if (!parentVNode.$children$) {
1406
+ parentVNode.$children$ = [];
1407
+ }
1408
+ if (BUILD.scoped && scopeId2) {
1409
+ node["s-si"] = scopeId2;
1410
+ childVNode.$attrs$.class += " " + scopeId2;
1411
+ }
1412
+ const slotName = childVNode.$elm$.getAttribute("s-sn");
1413
+ if (typeof slotName === "string") {
1414
+ if (childVNode.$tag$ === "slot-fb") {
1415
+ addSlot(
1416
+ slotName,
1417
+ childIdSplt[2],
1418
+ childVNode,
1419
+ node,
1420
+ parentVNode,
1421
+ childRenderNodes,
1422
+ slotNodes,
1423
+ shadowRootNodes,
1424
+ slottedNodes
1425
+ );
1426
+ if (BUILD.scoped && scopeId2) {
1427
+ node.classList.add(scopeId2);
1428
+ }
1429
+ }
1430
+ childVNode.$elm$["s-sn"] = slotName;
1431
+ childVNode.$elm$.removeAttribute("s-sn");
1432
+ }
1433
+ if (childVNode.$index$ !== void 0) {
1434
+ parentVNode.$children$[childVNode.$index$] = childVNode;
1435
+ }
1436
+ parentVNode = childVNode;
1437
+ if (shadowRootNodes && childVNode.$depth$ === "0") {
1438
+ shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
1439
+ }
1440
+ }
1441
+ }
1442
+ if (node.shadowRoot) {
1443
+ for (i2 = node.shadowRoot.childNodes.length - 1; i2 >= 0; i2--) {
1444
+ clientHydrate(
1445
+ parentVNode,
1446
+ childRenderNodes,
1447
+ slotNodes,
1448
+ shadowRootNodes,
1449
+ hostElm,
1450
+ node.shadowRoot.childNodes[i2],
1451
+ hostId,
1452
+ slottedNodes
1453
+ );
1454
+ }
1455
+ }
1456
+ const nonShadowNodes = node.__childNodes || node.childNodes;
1457
+ for (i2 = nonShadowNodes.length - 1; i2 >= 0; i2--) {
1458
+ clientHydrate(
1459
+ parentVNode,
1460
+ childRenderNodes,
1461
+ slotNodes,
1462
+ shadowRootNodes,
1463
+ hostElm,
1464
+ nonShadowNodes[i2],
1465
+ hostId,
1466
+ slottedNodes
1467
+ );
1468
+ }
1469
+ } else if (node.nodeType === 8 /* CommentNode */) {
1470
+ childIdSplt = node.nodeValue.split(".");
1471
+ if (childIdSplt[1] === hostId || childIdSplt[1] === "0") {
1472
+ childNodeType = childIdSplt[0];
1473
+ childVNode = createSimpleVNode({
1474
+ $hostId$: childIdSplt[1],
1475
+ $nodeId$: childIdSplt[2],
1476
+ $depth$: childIdSplt[3],
1477
+ $index$: childIdSplt[4] || "0",
1478
+ $elm$: node,
1479
+ $attrs$: null,
1480
+ $children$: null,
1481
+ $key$: null,
1482
+ $name$: null,
1483
+ $tag$: null,
1484
+ $text$: null
1485
+ });
1486
+ if (childNodeType === TEXT_NODE_ID) {
1487
+ childVNode.$elm$ = findCorrespondingNode(node, 3 /* TextNode */);
1488
+ if (childVNode.$elm$ && childVNode.$elm$.nodeType === 3 /* TextNode */) {
1489
+ childVNode.$text$ = childVNode.$elm$.textContent;
1490
+ childRenderNodes.push(childVNode);
1491
+ node.remove();
1492
+ if (hostId === childVNode.$hostId$) {
1493
+ if (!parentVNode.$children$) {
1494
+ parentVNode.$children$ = [];
1495
+ }
1496
+ parentVNode.$children$[childVNode.$index$] = childVNode;
1497
+ }
1498
+ if (shadowRootNodes && childVNode.$depth$ === "0") {
1499
+ shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
1500
+ }
1501
+ }
1502
+ } else if (childNodeType === COMMENT_NODE_ID) {
1503
+ childVNode.$elm$ = findCorrespondingNode(node, 8 /* CommentNode */);
1504
+ if (childVNode.$elm$ && childVNode.$elm$.nodeType === 8 /* CommentNode */) {
1505
+ childRenderNodes.push(childVNode);
1506
+ node.remove();
1507
+ }
1508
+ } else if (childVNode.$hostId$ === hostId) {
1509
+ if (childNodeType === SLOT_NODE_ID) {
1510
+ const slotName = node["s-sn"] = childIdSplt[5] || "";
1511
+ addSlot(
1512
+ slotName,
1513
+ childIdSplt[2],
1514
+ childVNode,
1515
+ node,
1516
+ parentVNode,
1517
+ childRenderNodes,
1518
+ slotNodes,
1519
+ shadowRootNodes,
1520
+ slottedNodes
1521
+ );
1522
+ } else if (childNodeType === CONTENT_REF_ID) {
1523
+ if (BUILD.shadowDom && shadowRootNodes) {
1524
+ node.remove();
1525
+ } else if (BUILD.slotRelocation) {
1526
+ hostElm["s-cr"] = node;
1527
+ node["s-cn"] = true;
1528
+ }
1529
+ }
1530
+ }
1531
+ }
1532
+ } else if (parentVNode && parentVNode.$tag$ === "style") {
1533
+ const vnode = newVNode(null, node.textContent);
1534
+ vnode.$elm$ = node;
1535
+ vnode.$index$ = "0";
1536
+ parentVNode.$children$ = [vnode];
1537
+ } else {
1538
+ if (node.nodeType === 3 /* TextNode */ && !node.wholeText.trim()) {
1539
+ node.remove();
1540
+ }
1541
+ }
1542
+ return parentVNode;
1543
+ };
1544
+ var initializeDocumentHydrate = (node, orgLocNodes) => {
1545
+ if (node.nodeType === 1 /* ElementNode */) {
1546
+ const componentId = node[HYDRATE_ID] || node.getAttribute(HYDRATE_ID);
1547
+ if (componentId) {
1548
+ orgLocNodes.set(componentId, node);
1549
+ }
1550
+ let i2 = 0;
1551
+ if (node.shadowRoot) {
1552
+ for (; i2 < node.shadowRoot.childNodes.length; i2++) {
1553
+ initializeDocumentHydrate(node.shadowRoot.childNodes[i2], orgLocNodes);
1554
+ }
1555
+ }
1556
+ const nonShadowNodes = node.__childNodes || node.childNodes;
1557
+ for (i2 = 0; i2 < nonShadowNodes.length; i2++) {
1558
+ initializeDocumentHydrate(nonShadowNodes[i2], orgLocNodes);
1559
+ }
1560
+ } else if (node.nodeType === 8 /* CommentNode */) {
1561
+ const childIdSplt = node.nodeValue.split(".");
1562
+ if (childIdSplt[0] === ORG_LOCATION_ID) {
1563
+ orgLocNodes.set(childIdSplt[1] + "." + childIdSplt[2], node);
1564
+ node.nodeValue = "";
1565
+ node["s-en"] = childIdSplt[3];
1566
+ }
1567
+ }
1568
+ };
1569
+ var createSimpleVNode = (vnode) => {
1570
+ const defaultVNode = {
1571
+ $flags$: 0,
1572
+ $hostId$: null,
1573
+ $nodeId$: null,
1574
+ $depth$: null,
1575
+ $index$: "0",
1576
+ $elm$: null,
1577
+ $attrs$: null,
1578
+ $children$: null,
1579
+ $key$: null,
1580
+ $name$: null,
1581
+ $tag$: null,
1582
+ $text$: null
1583
+ };
1584
+ return { ...defaultVNode, ...vnode };
1585
+ };
1586
+ function addSlot(slotName, slotId, childVNode, node, parentVNode, childRenderNodes, slotNodes, shadowRootNodes, slottedNodes) {
1587
+ node["s-sr"] = true;
1588
+ childVNode.$name$ = slotName || null;
1589
+ childVNode.$tag$ = "slot";
1590
+ const parentNodeId = (parentVNode == null ? void 0 : parentVNode.$elm$) ? parentVNode.$elm$["s-id"] || parentVNode.$elm$.getAttribute("s-id") : "";
1591
+ if (BUILD.shadowDom && shadowRootNodes && win.document) {
1592
+ const slot = childVNode.$elm$ = win.document.createElement(childVNode.$tag$);
1593
+ if (childVNode.$name$) {
1594
+ childVNode.$elm$.setAttribute("name", slotName);
1595
+ }
1596
+ if (parentNodeId && parentNodeId !== childVNode.$hostId$) {
1597
+ parentVNode.$elm$.insertBefore(slot, parentVNode.$elm$.children[0]);
1598
+ } else {
1599
+ node.parentNode.insertBefore(childVNode.$elm$, node);
1600
+ }
1601
+ addSlottedNodes(slottedNodes, slotId, slotName, node, childVNode.$hostId$);
1602
+ node.remove();
1603
+ if (childVNode.$depth$ === "0") {
1604
+ shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
1605
+ }
1606
+ } else {
1607
+ const slot = childVNode.$elm$;
1608
+ const shouldMove = parentNodeId && parentNodeId !== childVNode.$hostId$ && parentVNode.$elm$.shadowRoot;
1609
+ addSlottedNodes(slottedNodes, slotId, slotName, node, shouldMove ? parentNodeId : childVNode.$hostId$);
1610
+ patchSlotNode(node);
1611
+ if (shouldMove) {
1612
+ parentVNode.$elm$.insertBefore(slot, parentVNode.$elm$.children[0]);
1613
+ }
1614
+ childRenderNodes.push(childVNode);
1615
+ }
1616
+ slotNodes.push(childVNode);
1617
+ if (!parentVNode.$children$) {
1618
+ parentVNode.$children$ = [];
1619
+ }
1620
+ parentVNode.$children$[childVNode.$index$] = childVNode;
1621
+ }
1622
+ var addSlottedNodes = (slottedNodes, slotNodeId, slotName, slotNode, hostId) => {
1623
+ let slottedNode = slotNode.nextSibling;
1624
+ slottedNodes[slotNodeId] = slottedNodes[slotNodeId] || [];
1625
+ while (slottedNode && ((slottedNode["getAttribute"] && slottedNode.getAttribute("slot") || slottedNode["s-sn"]) === slotName || slotName === "" && !slottedNode["s-sn"] && (slottedNode.nodeType === 8 /* CommentNode */ && slottedNode.nodeValue.indexOf(".") !== 1 || slottedNode.nodeType === 3 /* TextNode */))) {
1626
+ slottedNode["s-sn"] = slotName;
1627
+ slottedNodes[slotNodeId].push({ slot: slotNode, node: slottedNode, hostId });
1628
+ slottedNode = slottedNode.nextSibling;
1629
+ }
1630
+ };
1631
+ var findCorrespondingNode = (node, type) => {
1632
+ let sibling = node;
1633
+ do {
1634
+ sibling = sibling.nextSibling;
1635
+ } while (sibling && (sibling.nodeType !== type || !sibling.nodeValue));
1636
+ return sibling;
1637
+ };
1638
+
1639
+ // src/utils/shadow-css.ts
1640
+ /**
1641
+ * @license
1642
+ * Copyright Google Inc. All Rights Reserved.
1643
+ *
1644
+ * Use of this source code is governed by an MIT-style license that can be
1645
+ * found in the LICENSE file at https://angular.io/license
1646
+ *
1647
+ * This file is a port of shadowCSS from `webcomponents.js` to TypeScript.
1648
+ * https://github.com/webcomponents/webcomponentsjs/blob/4efecd7e0e/src/ShadowCSS/ShadowCSS.js
1649
+ * https://github.com/angular/angular/blob/master/packages/compiler/src/shadow_css.ts
1650
+ */
1651
+ var safeSelector = (selector) => {
1652
+ const placeholders = [];
1653
+ let index = 0;
1654
+ selector = selector.replace(/(\[[^\]]*\])/g, (_, keep) => {
1655
+ const replaceBy = `__ph-${index}__`;
1656
+ placeholders.push(keep);
1657
+ index++;
1658
+ return replaceBy;
1659
+ });
1660
+ const content = selector.replace(/(:nth-[-\w]+)(\([^)]+\))/g, (_, pseudo, exp) => {
1661
+ const replaceBy = `__ph-${index}__`;
1662
+ placeholders.push(exp);
1663
+ index++;
1664
+ return pseudo + replaceBy;
1665
+ });
1666
+ const ss = {
1667
+ content,
1668
+ placeholders
1669
+ };
1670
+ return ss;
1671
+ };
1672
+ var restoreSafeSelector = (placeholders, content) => {
1673
+ return content.replace(/__ph-(\d+)__/g, (_, index) => placeholders[+index]);
1674
+ };
1675
+ var _polyfillHost = "-shadowcsshost";
1676
+ var _polyfillSlotted = "-shadowcssslotted";
1677
+ var _polyfillHostContext = "-shadowcsscontext";
1678
+ var _parenSuffix = ")(?:\\(((?:\\([^)(]*\\)|[^)(]*)+?)\\))?([^,{]*)";
1679
+ var _cssColonHostRe = new RegExp("(" + _polyfillHost + _parenSuffix, "gim");
1680
+ var _cssColonHostContextRe = new RegExp("(" + _polyfillHostContext + _parenSuffix, "gim");
1681
+ var _cssColonSlottedRe = new RegExp("(" + _polyfillSlotted + _parenSuffix, "gim");
1682
+ var _polyfillHostNoCombinator = _polyfillHost + "-no-combinator";
1683
+ var _polyfillHostNoCombinatorRe = /-shadowcsshost-no-combinator([^\s]*)/;
1684
+ var _shadowDOMSelectorsRe = [/::shadow/g, /::content/g];
1685
+ var _selectorReSuffix = "([>\\s~+[.,{:][\\s\\S]*)?$";
1686
+ var _polyfillHostRe = /-shadowcsshost/gim;
1687
+ var createSupportsRuleRe = (selector) => {
1688
+ const safeSelector2 = escapeRegExpSpecialCharacters(selector);
1689
+ return new RegExp(
1690
+ // First capture group: match any context before the selector that's not inside @supports selector()
1691
+ // Using negative lookahead to avoid matching inside @supports selector(...) condition
1692
+ `(^|[^@]|@(?!supports\\s+selector\\s*\\([^{]*?${safeSelector2}))(${safeSelector2}\\b)`,
1693
+ "g"
1694
+ );
1695
+ };
1696
+ var _colonSlottedRe = createSupportsRuleRe("::slotted");
1697
+ var _colonHostRe = createSupportsRuleRe(":host");
1698
+ var _colonHostContextRe = createSupportsRuleRe(":host-context");
1699
+ var _commentRe = /\/\*\s*[\s\S]*?\*\//g;
1700
+ var stripComments = (input) => {
1701
+ return input.replace(_commentRe, "");
1702
+ };
1703
+ var _commentWithHashRe = /\/\*\s*#\s*source(Mapping)?URL=[\s\S]+?\*\//g;
1704
+ var extractCommentsWithHash = (input) => {
1705
+ return input.match(_commentWithHashRe) || [];
1706
+ };
1707
+ var _ruleRe = /(\s*)([^;\{\}]+?)(\s*)((?:{%BLOCK%}?\s*;?)|(?:\s*;))/g;
1708
+ var _curlyRe = /([{}])/g;
1709
+ var _selectorPartsRe = /(^.*?[^\\])??((:+)(.*)|$)/;
1710
+ var OPEN_CURLY = "{";
1711
+ var CLOSE_CURLY = "}";
1712
+ var BLOCK_PLACEHOLDER = "%BLOCK%";
1713
+ var processRules = (input, ruleCallback) => {
1714
+ const inputWithEscapedBlocks = escapeBlocks(input);
1715
+ let nextBlockIndex = 0;
1716
+ return inputWithEscapedBlocks.escapedString.replace(_ruleRe, (...m) => {
1717
+ const selector = m[2];
1718
+ let content = "";
1719
+ let suffix = m[4];
1720
+ let contentPrefix = "";
1721
+ if (suffix && suffix.startsWith("{" + BLOCK_PLACEHOLDER)) {
1722
+ content = inputWithEscapedBlocks.blocks[nextBlockIndex++];
1723
+ suffix = suffix.substring(BLOCK_PLACEHOLDER.length + 1);
1724
+ contentPrefix = "{";
1725
+ }
1726
+ const cssRule = {
1727
+ selector,
1728
+ content
1729
+ };
1730
+ const rule = ruleCallback(cssRule);
1731
+ return `${m[1]}${rule.selector}${m[3]}${contentPrefix}${rule.content}${suffix}`;
1732
+ });
1733
+ };
1734
+ var escapeBlocks = (input) => {
1735
+ const inputParts = input.split(_curlyRe);
1736
+ const resultParts = [];
1737
+ const escapedBlocks = [];
1738
+ let bracketCount = 0;
1739
+ let currentBlockParts = [];
1740
+ for (let partIndex = 0; partIndex < inputParts.length; partIndex++) {
1741
+ const part = inputParts[partIndex];
1742
+ if (part === CLOSE_CURLY) {
1743
+ bracketCount--;
1744
+ }
1745
+ if (bracketCount > 0) {
1746
+ currentBlockParts.push(part);
1747
+ } else {
1748
+ if (currentBlockParts.length > 0) {
1749
+ escapedBlocks.push(currentBlockParts.join(""));
1750
+ resultParts.push(BLOCK_PLACEHOLDER);
1751
+ currentBlockParts = [];
1752
+ }
1753
+ resultParts.push(part);
1754
+ }
1755
+ if (part === OPEN_CURLY) {
1756
+ bracketCount++;
1757
+ }
1758
+ }
1759
+ if (currentBlockParts.length > 0) {
1760
+ escapedBlocks.push(currentBlockParts.join(""));
1761
+ resultParts.push(BLOCK_PLACEHOLDER);
1762
+ }
1763
+ const strEscapedBlocks = {
1764
+ escapedString: resultParts.join(""),
1765
+ blocks: escapedBlocks
1766
+ };
1767
+ return strEscapedBlocks;
1768
+ };
1769
+ var insertPolyfillHostInCssText = (cssText) => {
1770
+ const supportsBlocks = [];
1771
+ cssText = cssText.replace(/@supports\s+selector\s*\(\s*([^)]*)\s*\)/g, (_, selectorContent) => {
1772
+ const placeholder = `__supports_${supportsBlocks.length}__`;
1773
+ supportsBlocks.push(selectorContent);
1774
+ return `@supports selector(${placeholder})`;
1775
+ });
1776
+ cssText = cssText.replace(_colonHostContextRe, `$1${_polyfillHostContext}`).replace(_colonHostRe, `$1${_polyfillHost}`).replace(_colonSlottedRe, `$1${_polyfillSlotted}`);
1777
+ supportsBlocks.forEach((originalSelector, index) => {
1778
+ cssText = cssText.replace(`__supports_${index}__`, originalSelector);
1779
+ });
1780
+ return cssText;
1781
+ };
1782
+ var convertColonRule = (cssText, regExp, partReplacer) => {
1783
+ return cssText.replace(regExp, (...m) => {
1784
+ if (m[2]) {
1785
+ const parts = m[2].split(",");
1786
+ const r = [];
1787
+ for (let i2 = 0; i2 < parts.length; i2++) {
1788
+ const p = parts[i2].trim();
1789
+ if (!p) break;
1790
+ r.push(partReplacer(_polyfillHostNoCombinator, p, m[3]));
1791
+ }
1792
+ return r.join(",");
1793
+ } else {
1794
+ return _polyfillHostNoCombinator + m[3];
1795
+ }
1796
+ });
1797
+ };
1798
+ var colonHostPartReplacer = (host, part, suffix) => {
1799
+ return host + part.replace(_polyfillHost, "") + suffix;
1800
+ };
1801
+ var convertColonHost = (cssText) => {
1802
+ return convertColonRule(cssText, _cssColonHostRe, colonHostPartReplacer);
1803
+ };
1804
+ var colonHostContextPartReplacer = (host, part, suffix) => {
1805
+ if (part.indexOf(_polyfillHost) > -1) {
1806
+ return colonHostPartReplacer(host, part, suffix);
1807
+ } else {
1808
+ return host + part + suffix + ", " + part + " " + host + suffix;
1809
+ }
1810
+ };
1811
+ var convertColonSlotted = (cssText, slotScopeId) => {
1812
+ const slotClass = "." + slotScopeId + " > ";
1813
+ const selectors = [];
1814
+ cssText = cssText.replace(_cssColonSlottedRe, (...m) => {
1815
+ if (m[2]) {
1816
+ const compound = m[2].trim();
1817
+ const suffix = m[3];
1818
+ const slottedSelector = slotClass + compound + suffix;
1819
+ let prefixSelector = "";
1820
+ for (let i2 = m[4] - 1; i2 >= 0; i2--) {
1821
+ const char = m[5][i2];
1822
+ if (char === "}" || char === ",") {
1823
+ break;
1824
+ }
1825
+ prefixSelector = char + prefixSelector;
1826
+ }
1827
+ const orgSelector = (prefixSelector + slottedSelector).trim();
1828
+ const addedSelector = `${prefixSelector.trimEnd()}${slottedSelector.trim()}`.trim();
1829
+ if (orgSelector !== addedSelector) {
1830
+ const updatedSelector = `${addedSelector}, ${orgSelector}`;
1831
+ selectors.push({
1832
+ orgSelector,
1833
+ updatedSelector
1834
+ });
1835
+ }
1836
+ return slottedSelector;
1837
+ } else {
1838
+ return _polyfillHostNoCombinator + m[3];
1839
+ }
1840
+ });
1841
+ return {
1842
+ selectors,
1843
+ cssText
1844
+ };
1845
+ };
1846
+ var convertColonHostContext = (cssText) => {
1847
+ return convertColonRule(cssText, _cssColonHostContextRe, colonHostContextPartReplacer);
1848
+ };
1849
+ var convertShadowDOMSelectors = (cssText) => {
1850
+ return _shadowDOMSelectorsRe.reduce((result, pattern) => result.replace(pattern, " "), cssText);
1851
+ };
1852
+ var makeScopeMatcher = (scopeSelector2) => {
1853
+ const lre = /\[/g;
1854
+ const rre = /\]/g;
1855
+ scopeSelector2 = scopeSelector2.replace(lre, "\\[").replace(rre, "\\]");
1856
+ return new RegExp("^(" + scopeSelector2 + ")" + _selectorReSuffix, "m");
1857
+ };
1858
+ var selectorNeedsScoping = (selector, scopeSelector2) => {
1859
+ const re = makeScopeMatcher(scopeSelector2);
1860
+ return !re.test(selector);
1861
+ };
1862
+ var injectScopingSelector = (selector, scopingSelector) => {
1863
+ return selector.replace(_selectorPartsRe, (_, before = "", _colonGroup, colon = "", after = "") => {
1864
+ return before + scopingSelector + colon + after;
1865
+ });
1866
+ };
1867
+ var applySimpleSelectorScope = (selector, scopeSelector2, hostSelector) => {
1868
+ _polyfillHostRe.lastIndex = 0;
1869
+ if (_polyfillHostRe.test(selector)) {
1870
+ const replaceBy = `.${hostSelector}`;
1871
+ return selector.replace(_polyfillHostNoCombinatorRe, (_, selector2) => injectScopingSelector(selector2, replaceBy)).replace(_polyfillHostRe, replaceBy + " ");
1872
+ }
1873
+ return scopeSelector2 + " " + selector;
1874
+ };
1875
+ var applyStrictSelectorScope = (selector, scopeSelector2, hostSelector) => {
1876
+ const isRe = /\[is=([^\]]*)\]/g;
1877
+ scopeSelector2 = scopeSelector2.replace(isRe, (_, ...parts) => parts[0]);
1878
+ const className = "." + scopeSelector2;
1879
+ const _scopeSelectorPart = (p) => {
1880
+ let scopedP = p.trim();
1881
+ if (!scopedP) {
1882
+ return "";
1883
+ }
1884
+ if (p.indexOf(_polyfillHostNoCombinator) > -1) {
1885
+ scopedP = applySimpleSelectorScope(p, scopeSelector2, hostSelector);
1886
+ } else {
1887
+ const t = p.replace(_polyfillHostRe, "");
1888
+ if (t.length > 0) {
1889
+ scopedP = injectScopingSelector(t, className);
1890
+ }
1891
+ }
1892
+ return scopedP;
1893
+ };
1894
+ const safeContent = safeSelector(selector);
1895
+ selector = safeContent.content;
1896
+ let scopedSelector = "";
1897
+ let startIndex = 0;
1898
+ let res;
1899
+ const sep = /( |>|\+|~(?!=))\s*/g;
1900
+ const hasHost = selector.indexOf(_polyfillHostNoCombinator) > -1;
1901
+ let shouldScope = !hasHost;
1902
+ while ((res = sep.exec(selector)) !== null) {
1903
+ const separator = res[1];
1904
+ const part2 = selector.slice(startIndex, res.index).trim();
1905
+ shouldScope = shouldScope || part2.indexOf(_polyfillHostNoCombinator) > -1;
1906
+ const scopedPart = shouldScope ? _scopeSelectorPart(part2) : part2;
1907
+ scopedSelector += `${scopedPart} ${separator} `;
1908
+ startIndex = sep.lastIndex;
1909
+ }
1910
+ const part = selector.substring(startIndex);
1911
+ shouldScope = shouldScope || part.indexOf(_polyfillHostNoCombinator) > -1;
1912
+ scopedSelector += shouldScope ? _scopeSelectorPart(part) : part;
1913
+ return restoreSafeSelector(safeContent.placeholders, scopedSelector);
1914
+ };
1915
+ var scopeSelector = (selector, scopeSelectorText, hostSelector, slotSelector) => {
1916
+ return selector.split(",").map((shallowPart) => {
1917
+ if (slotSelector && shallowPart.indexOf("." + slotSelector) > -1) {
1918
+ return shallowPart.trim();
1919
+ }
1920
+ if (selectorNeedsScoping(shallowPart, scopeSelectorText)) {
1921
+ return applyStrictSelectorScope(shallowPart, scopeSelectorText, hostSelector).trim();
1922
+ } else {
1923
+ return shallowPart.trim();
1924
+ }
1925
+ }).join(", ");
1926
+ };
1927
+ var scopeSelectors = (cssText, scopeSelectorText, hostSelector, slotSelector, commentOriginalSelector) => {
1928
+ return processRules(cssText, (rule) => {
1929
+ let selector = rule.selector;
1930
+ let content = rule.content;
1931
+ if (rule.selector[0] !== "@") {
1932
+ selector = scopeSelector(rule.selector, scopeSelectorText, hostSelector, slotSelector);
1933
+ } else if (rule.selector.startsWith("@media") || rule.selector.startsWith("@supports") || rule.selector.startsWith("@page") || rule.selector.startsWith("@document")) {
1934
+ content = scopeSelectors(rule.content, scopeSelectorText, hostSelector, slotSelector, commentOriginalSelector);
1935
+ }
1936
+ const cssRule = {
1937
+ selector: selector.replace(/\s{2,}/g, " ").trim(),
1938
+ content
1939
+ };
1940
+ return cssRule;
1941
+ });
1942
+ };
1943
+ var scopeCssText = (cssText, scopeId2, hostScopeId, slotScopeId, commentOriginalSelector) => {
1944
+ cssText = insertPolyfillHostInCssText(cssText);
1945
+ cssText = convertColonHost(cssText);
1946
+ cssText = convertColonHostContext(cssText);
1947
+ const slotted = convertColonSlotted(cssText, slotScopeId);
1948
+ cssText = slotted.cssText;
1949
+ cssText = convertShadowDOMSelectors(cssText);
1950
+ if (scopeId2) {
1951
+ cssText = scopeSelectors(cssText, scopeId2, hostScopeId, slotScopeId, commentOriginalSelector);
1952
+ }
1953
+ cssText = replaceShadowCssHost(cssText, hostScopeId);
1954
+ cssText = cssText.replace(/>\s*\*\s+([^{, ]+)/gm, " $1 ");
1955
+ return {
1956
+ cssText: cssText.trim(),
1957
+ // We need to replace the shadow CSS host string in each of these selectors since we created
1958
+ // them prior to the replacement happening in the components CSS text.
1959
+ slottedSelectors: slotted.selectors.map((ref) => ({
1960
+ orgSelector: replaceShadowCssHost(ref.orgSelector, hostScopeId),
1961
+ updatedSelector: replaceShadowCssHost(ref.updatedSelector, hostScopeId)
1962
+ }))
1963
+ };
1964
+ };
1965
+ var replaceShadowCssHost = (cssText, hostScopeId) => {
1966
+ return cssText.replace(/-shadowcsshost-no-combinator/g, `.${hostScopeId}`);
1967
+ };
1968
+ var scopeCss = (cssText, scopeId2, commentOriginalSelector) => {
1969
+ const hostScopeId = scopeId2 + "-h";
1970
+ const slotScopeId = scopeId2 + "-s";
1971
+ const commentsWithHash = extractCommentsWithHash(cssText);
1972
+ cssText = stripComments(cssText);
1973
+ const orgSelectors = [];
1974
+ if (commentOriginalSelector) {
1975
+ const processCommentedSelector = (rule) => {
1976
+ const placeholder = `/*!@___${orgSelectors.length}___*/`;
1977
+ const comment = `/*!@${rule.selector}*/`;
1978
+ orgSelectors.push({ placeholder, comment });
1979
+ rule.selector = placeholder + rule.selector;
1980
+ return rule;
1981
+ };
1982
+ cssText = processRules(cssText, (rule) => {
1983
+ if (rule.selector[0] !== "@") {
1984
+ return processCommentedSelector(rule);
1985
+ } else if (rule.selector.startsWith("@media") || rule.selector.startsWith("@supports") || rule.selector.startsWith("@page") || rule.selector.startsWith("@document")) {
1986
+ rule.content = processRules(rule.content, processCommentedSelector);
1987
+ return rule;
1988
+ }
1989
+ return rule;
1990
+ });
1991
+ }
1992
+ const scoped = scopeCssText(cssText, scopeId2, hostScopeId, slotScopeId, commentOriginalSelector);
1993
+ cssText = [scoped.cssText, ...commentsWithHash].join("\n");
1994
+ if (commentOriginalSelector) {
1995
+ orgSelectors.forEach(({ placeholder, comment }) => {
1996
+ cssText = cssText.replace(placeholder, comment);
1997
+ });
1998
+ }
1999
+ scoped.slottedSelectors.forEach((slottedSelector) => {
2000
+ const regex = new RegExp(escapeRegExpSpecialCharacters(slottedSelector.orgSelector), "g");
2001
+ cssText = cssText.replace(regex, slottedSelector.updatedSelector);
2002
+ });
2003
+ return cssText;
2004
+ };
2005
+
2006
+ // src/runtime/mode.ts
2007
+ var computeMode = (elm) => modeResolutionChain.map((h2) => h2(elm)).find((m) => !!m);
2008
+ var setMode = (handler) => modeResolutionChain.push(handler);
2009
+ var getMode = (ref) => getHostRef(ref).$modeName$;
2010
+ var parsePropertyValue = (propValue, propType) => {
2011
+ if ((BUILD.hydrateClientSide || BUILD.hydrateServerSide) && typeof propValue === "string" && (propValue.startsWith("{") && propValue.endsWith("}") || propValue.startsWith("[") && propValue.endsWith("]"))) {
2012
+ try {
2013
+ propValue = JSON.parse(propValue);
2014
+ return propValue;
2015
+ } catch (e) {
2016
+ }
2017
+ }
2018
+ if ((BUILD.hydrateClientSide || BUILD.hydrateServerSide) && typeof propValue === "string" && propValue.startsWith(SERIALIZED_PREFIX)) {
2019
+ propValue = deserializeProperty(propValue);
2020
+ return propValue;
2021
+ }
2022
+ if (propValue != null && !isComplexType(propValue)) {
2023
+ if (BUILD.propBoolean && propType & 4 /* Boolean */) {
2024
+ return propValue === "false" ? false : propValue === "" || !!propValue;
2025
+ }
2026
+ if (BUILD.propNumber && propType & 2 /* Number */) {
2027
+ return typeof propValue === "string" ? parseFloat(propValue) : typeof propValue === "number" ? propValue : NaN;
2028
+ }
2029
+ if (BUILD.propString && propType & 1 /* String */) {
2030
+ return String(propValue);
2031
+ }
2032
+ return propValue;
2033
+ }
2034
+ return propValue;
2035
+ };
2036
+ var getElement = (ref) => BUILD.lazyLoad ? getHostRef(ref).$hostElement$ : ref;
2037
+
2038
+ // src/runtime/event-emitter.ts
2039
+ var createEvent = (ref, name, flags) => {
2040
+ const elm = getElement(ref);
2041
+ return {
2042
+ emit: (detail) => {
2043
+ if (BUILD.isDev && !elm.isConnected) {
2044
+ consoleDevWarn(`The "${name}" event was emitted, but the dispatcher node is no longer connected to the dom.`);
2045
+ }
2046
+ return emitEvent(elm, name, {
2047
+ bubbles: !!(flags & 4 /* Bubbles */),
2048
+ composed: !!(flags & 2 /* Composed */),
2049
+ cancelable: !!(flags & 1 /* Cancellable */),
2050
+ detail
2051
+ });
2052
+ }
2053
+ };
2054
+ };
2055
+ var emitEvent = (elm, name, opts) => {
2056
+ const ev = plt.ce(name, opts);
2057
+ elm.dispatchEvent(ev);
2058
+ return ev;
2059
+ };
2060
+ var rootAppliedStyles = /* @__PURE__ */ new WeakMap();
2061
+ var registerStyle = (scopeId2, cssText, allowCS) => {
2062
+ let style = styles.get(scopeId2);
2063
+ if (supportsConstructableStylesheets && allowCS) {
2064
+ style = style || new CSSStyleSheet();
2065
+ if (typeof style === "string") {
2066
+ style = cssText;
2067
+ } else {
2068
+ style.replaceSync(cssText);
2069
+ }
2070
+ } else {
2071
+ style = cssText;
2072
+ }
2073
+ styles.set(scopeId2, style);
2074
+ };
2075
+ var addStyle = (styleContainerNode, cmpMeta, mode) => {
2076
+ var _a;
2077
+ const scopeId2 = getScopeId(cmpMeta, mode);
2078
+ const style = styles.get(scopeId2);
2079
+ if (!BUILD.attachStyles || !win.document) {
2080
+ return scopeId2;
2081
+ }
2082
+ styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : win.document;
2083
+ if (style) {
2084
+ if (typeof style === "string") {
2085
+ styleContainerNode = styleContainerNode.head || styleContainerNode;
2086
+ let appliedStyles = rootAppliedStyles.get(styleContainerNode);
2087
+ let styleElm;
2088
+ if (!appliedStyles) {
2089
+ rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
2090
+ }
2091
+ if (!appliedStyles.has(scopeId2)) {
2092
+ if (BUILD.hydrateClientSide && styleContainerNode.host && (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`))) {
2093
+ styleElm.innerHTML = style;
2094
+ } else {
2095
+ styleElm = document.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`) || win.document.createElement("style");
2096
+ styleElm.innerHTML = style;
2097
+ const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
2098
+ if (nonce != null) {
2099
+ styleElm.setAttribute("nonce", nonce);
2100
+ }
2101
+ if ((BUILD.hydrateServerSide || BUILD.hotModuleReplacement) && (cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */ || cmpMeta.$flags$ & 128 /* shadowNeedsScopedCss */)) {
2102
+ styleElm.setAttribute(HYDRATED_STYLE_ID, scopeId2);
2103
+ }
2104
+ if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
2105
+ if (styleContainerNode.nodeName === "HEAD") {
2106
+ const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
2107
+ const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
2108
+ styleContainerNode.insertBefore(
2109
+ styleElm,
2110
+ (referenceNode2 == null ? void 0 : referenceNode2.parentNode) === styleContainerNode ? referenceNode2 : null
2111
+ );
2112
+ } else if ("host" in styleContainerNode) {
2113
+ if (supportsConstructableStylesheets) {
2114
+ const stylesheet = new CSSStyleSheet();
2115
+ stylesheet.replaceSync(style);
2116
+ styleContainerNode.adoptedStyleSheets = [stylesheet, ...styleContainerNode.adoptedStyleSheets];
2117
+ } else {
2118
+ const existingStyleContainer = styleContainerNode.querySelector("style");
2119
+ if (existingStyleContainer) {
2120
+ existingStyleContainer.innerHTML = style + existingStyleContainer.innerHTML;
2121
+ } else {
2122
+ styleContainerNode.prepend(styleElm);
2123
+ }
2124
+ }
2125
+ } else {
2126
+ styleContainerNode.append(styleElm);
2127
+ }
2128
+ }
2129
+ if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
2130
+ styleContainerNode.insertBefore(styleElm, null);
2131
+ }
2132
+ }
2133
+ if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
2134
+ styleElm.innerHTML += SLOT_FB_CSS;
2135
+ }
2136
+ if (appliedStyles) {
2137
+ appliedStyles.add(scopeId2);
2138
+ }
2139
+ }
2140
+ } else if (BUILD.constructableCSS && !styleContainerNode.adoptedStyleSheets.includes(style)) {
2141
+ styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
2142
+ }
2143
+ }
2144
+ return scopeId2;
2145
+ };
2146
+ var attachStyles = (hostRef) => {
2147
+ const cmpMeta = hostRef.$cmpMeta$;
2148
+ const elm = hostRef.$hostElement$;
2149
+ const flags = cmpMeta.$flags$;
2150
+ const endAttachStyles = createTime("attachStyles", cmpMeta.$tagName$);
2151
+ const scopeId2 = addStyle(
2152
+ BUILD.shadowDom && supportsShadow && elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
2153
+ cmpMeta,
2154
+ hostRef.$modeName$
2155
+ );
2156
+ if ((BUILD.shadowDom || BUILD.scoped) && BUILD.cssAnnotations && flags & 10 /* needsScopedEncapsulation */) {
2157
+ elm["s-sc"] = scopeId2;
2158
+ elm.classList.add(scopeId2 + "-h");
2159
+ }
2160
+ endAttachStyles();
2161
+ };
2162
+ var getScopeId = (cmp, mode) => "sc-" + (BUILD.mode && mode && cmp.$flags$ & 32 /* hasMode */ ? cmp.$tagName$ + "-" + mode : cmp.$tagName$);
2163
+ var convertScopedToShadow = (css) => css.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g, "$1{");
2164
+ var hydrateScopedToShadow = () => {
2165
+ if (!win.document) {
2166
+ return;
2167
+ }
2168
+ const styles2 = win.document.querySelectorAll(`[${HYDRATED_STYLE_ID}]`);
2169
+ let i2 = 0;
2170
+ for (; i2 < styles2.length; i2++) {
2171
+ registerStyle(styles2[i2].getAttribute(HYDRATED_STYLE_ID), convertScopedToShadow(styles2[i2].innerHTML), true);
2172
+ }
2173
+ };
2174
+ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRender) => {
2175
+ if (oldValue === newValue) {
2176
+ return;
2177
+ }
2178
+ let isProp = isMemberInElement(elm, memberName);
2179
+ let ln = memberName.toLowerCase();
2180
+ if (BUILD.vdomClass && memberName === "class") {
2181
+ const classList = elm.classList;
2182
+ const oldClasses = parseClassList(oldValue);
2183
+ let newClasses = parseClassList(newValue);
2184
+ if (BUILD.hydrateClientSide && elm["s-si"] && initialRender) {
2185
+ newClasses.push(elm["s-si"]);
2186
+ oldClasses.forEach((c) => {
2187
+ if (c.startsWith(elm["s-si"])) newClasses.push(c);
2188
+ });
2189
+ newClasses = [...new Set(newClasses)];
2190
+ classList.add(...newClasses);
2191
+ } else {
2192
+ classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
2193
+ classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
2194
+ }
2195
+ } else if (BUILD.vdomStyle && memberName === "style") {
2196
+ if (BUILD.updatable) {
2197
+ for (const prop in oldValue) {
2198
+ if (!newValue || newValue[prop] == null) {
2199
+ if (!BUILD.hydrateServerSide && prop.includes("-")) {
2200
+ elm.style.removeProperty(prop);
2201
+ } else {
2202
+ elm.style[prop] = "";
2203
+ }
2204
+ }
2205
+ }
2206
+ }
2207
+ for (const prop in newValue) {
2208
+ if (!oldValue || newValue[prop] !== oldValue[prop]) {
2209
+ if (!BUILD.hydrateServerSide && prop.includes("-")) {
2210
+ elm.style.setProperty(prop, newValue[prop]);
2211
+ } else {
2212
+ elm.style[prop] = newValue[prop];
2213
+ }
2214
+ }
2215
+ }
2216
+ } else if (BUILD.vdomKey && memberName === "key") {
2217
+ } else if (BUILD.vdomRef && memberName === "ref") {
2218
+ if (newValue) {
2219
+ newValue(elm);
2220
+ }
2221
+ } else if (BUILD.vdomListener && (BUILD.lazyLoad ? !isProp : !elm.__lookupSetter__(memberName)) && memberName[0] === "o" && memberName[1] === "n") {
2222
+ if (memberName[2] === "-") {
2223
+ memberName = memberName.slice(3);
2224
+ } else if (isMemberInElement(win, ln)) {
2225
+ memberName = ln.slice(2);
2226
+ } else {
2227
+ memberName = ln[2] + memberName.slice(3);
2228
+ }
2229
+ if (oldValue || newValue) {
2230
+ const capture = memberName.endsWith(CAPTURE_EVENT_SUFFIX);
2231
+ memberName = memberName.replace(CAPTURE_EVENT_REGEX, "");
2232
+ if (oldValue) {
2233
+ plt.rel(elm, memberName, oldValue, capture);
2234
+ }
2235
+ if (newValue) {
2236
+ plt.ael(elm, memberName, newValue, capture);
2237
+ }
2238
+ }
2239
+ } else if (BUILD.vdomPropOrAttr) {
2240
+ const isComplex = isComplexType(newValue);
2241
+ if ((isProp || isComplex && newValue !== null) && !isSvg) {
2242
+ try {
2243
+ if (!elm.tagName.includes("-")) {
2244
+ const n = newValue == null ? "" : newValue;
2245
+ if (memberName === "list") {
2246
+ isProp = false;
2247
+ } else if (oldValue == null || elm[memberName] != n) {
2248
+ if (typeof elm.__lookupSetter__(memberName) === "function") {
2249
+ elm[memberName] = n;
2250
+ } else {
2251
+ elm.setAttribute(memberName, n);
2252
+ }
2253
+ }
2254
+ } else if (elm[memberName] !== newValue) {
2255
+ elm[memberName] = newValue;
2256
+ }
2257
+ } catch (e) {
2258
+ }
2259
+ }
2260
+ let xlink = false;
2261
+ if (BUILD.vdomXlink) {
2262
+ if (ln !== (ln = ln.replace(/^xlink\:?/, ""))) {
2263
+ memberName = ln;
2264
+ xlink = true;
2265
+ }
2266
+ }
2267
+ if (newValue == null || newValue === false) {
2268
+ if (newValue !== false || elm.getAttribute(memberName) === "") {
2269
+ if (BUILD.vdomXlink && xlink) {
2270
+ elm.removeAttributeNS(XLINK_NS, memberName);
2271
+ } else {
2272
+ elm.removeAttribute(memberName);
2273
+ }
2274
+ }
2275
+ } else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex && elm.nodeType === 1 /* ElementNode */) {
2276
+ newValue = newValue === true ? "" : newValue;
2277
+ if (BUILD.vdomXlink && xlink) {
2278
+ elm.setAttributeNS(XLINK_NS, memberName, newValue);
2279
+ } else {
2280
+ elm.setAttribute(memberName, newValue);
2281
+ }
2282
+ }
2283
+ }
2284
+ };
2285
+ var parseClassListRegex = /\s/;
2286
+ var parseClassList = (value) => {
2287
+ if (typeof value === "object" && value && "baseVal" in value) {
2288
+ value = value.baseVal;
2289
+ }
2290
+ if (!value || typeof value !== "string") {
2291
+ return [];
2292
+ }
2293
+ return value.split(parseClassListRegex);
2294
+ };
2295
+ var CAPTURE_EVENT_SUFFIX = "Capture";
2296
+ var CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + "$");
2297
+
2298
+ // src/runtime/vdom/update-element.ts
2299
+ var updateElement = (oldVnode, newVnode, isSvgMode2, isInitialRender) => {
2300
+ const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;
2301
+ const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || {};
2302
+ const newVnodeAttrs = newVnode.$attrs$ || {};
2303
+ if (BUILD.updatable) {
2304
+ for (const memberName of sortedAttrNames(Object.keys(oldVnodeAttrs))) {
2305
+ if (!(memberName in newVnodeAttrs)) {
2306
+ setAccessor(
2307
+ elm,
2308
+ memberName,
2309
+ oldVnodeAttrs[memberName],
2310
+ void 0,
2311
+ isSvgMode2,
2312
+ newVnode.$flags$,
2313
+ isInitialRender
2314
+ );
2315
+ }
2316
+ }
2317
+ }
2318
+ for (const memberName of sortedAttrNames(Object.keys(newVnodeAttrs))) {
2319
+ setAccessor(
2320
+ elm,
2321
+ memberName,
2322
+ oldVnodeAttrs[memberName],
2323
+ newVnodeAttrs[memberName],
2324
+ isSvgMode2,
2325
+ newVnode.$flags$,
2326
+ isInitialRender
2327
+ );
2328
+ }
2329
+ };
2330
+ function sortedAttrNames(attrNames) {
2331
+ return attrNames.includes("ref") ? (
2332
+ // we need to sort these to ensure that `'ref'` is the last attr
2333
+ [...attrNames.filter((attr) => attr !== "ref"), "ref"]
2334
+ ) : (
2335
+ // no need to sort, return the original array
2336
+ attrNames
2337
+ );
2338
+ }
2339
+
2340
+ // src/runtime/vdom/vdom-render.ts
2341
+ var scopeId;
2342
+ var contentRef;
2343
+ var hostTagName;
2344
+ var useNativeShadowDom = false;
2345
+ var checkSlotFallbackVisibility = false;
2346
+ var checkSlotRelocate = false;
2347
+ var isSvgMode = false;
2348
+ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
2349
+ var _a;
2350
+ const newVNode2 = newParentVNode.$children$[childIndex];
2351
+ let i2 = 0;
2352
+ let elm;
2353
+ let childNode;
2354
+ let oldVNode;
2355
+ if (BUILD.slotRelocation && !useNativeShadowDom) {
2356
+ checkSlotRelocate = true;
2357
+ if (newVNode2.$tag$ === "slot") {
2358
+ newVNode2.$flags$ |= newVNode2.$children$ ? (
2359
+ // slot element has fallback content
2360
+ // still create an element that "mocks" the slot element
2361
+ 2 /* isSlotFallback */
2362
+ ) : (
2363
+ // slot element does not have fallback content
2364
+ // create an html comment we'll use to always reference
2365
+ // where actual slot content should sit next to
2366
+ 1 /* isSlotReference */
2367
+ );
2368
+ }
2369
+ }
2370
+ if (BUILD.isDev && newVNode2.$elm$) {
2371
+ consoleDevError(
2372
+ `The JSX ${newVNode2.$text$ !== null ? `"${newVNode2.$text$}" text` : `"${newVNode2.$tag$}" element`} node should not be shared within the same renderer. The renderer caches element lookups in order to improve performance. However, a side effect from this is that the exact same JSX node should not be reused. For more information please see https://stenciljs.com/docs/templating-jsx#avoid-shared-jsx-nodes`
2373
+ );
2374
+ }
2375
+ if (BUILD.vdomText && newVNode2.$text$ !== null) {
2376
+ elm = newVNode2.$elm$ = win.document.createTextNode(newVNode2.$text$);
2377
+ } else if (BUILD.slotRelocation && newVNode2.$flags$ & 1 /* isSlotReference */) {
2378
+ elm = newVNode2.$elm$ = BUILD.isDebug || BUILD.hydrateServerSide ? slotReferenceDebugNode(newVNode2) : win.document.createTextNode("");
2379
+ if (BUILD.vdomAttribute) {
2380
+ updateElement(null, newVNode2, isSvgMode);
2381
+ }
2382
+ } else {
2383
+ if (BUILD.svg && !isSvgMode) {
2384
+ isSvgMode = newVNode2.$tag$ === "svg";
2385
+ }
2386
+ if (!win.document) {
2387
+ throw new Error(
2388
+ "You are trying to render a Stencil component in an environment that doesn't support the DOM. Make sure to populate the [`window`](https://developer.mozilla.org/en-US/docs/Web/API/Window/window) object before rendering a component."
2389
+ );
2390
+ }
2391
+ elm = newVNode2.$elm$ = BUILD.svg ? win.document.createElementNS(
2392
+ isSvgMode ? SVG_NS : HTML_NS,
2393
+ !useNativeShadowDom && BUILD.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
2394
+ ) : win.document.createElement(
2395
+ !useNativeShadowDom && BUILD.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
2396
+ );
2397
+ if (BUILD.svg && isSvgMode && newVNode2.$tag$ === "foreignObject") {
2398
+ isSvgMode = false;
2399
+ }
2400
+ if (BUILD.vdomAttribute) {
2401
+ updateElement(null, newVNode2, isSvgMode);
2402
+ }
2403
+ if ((BUILD.scoped || BUILD.hydrateServerSide && 128 /* shadowNeedsScopedCss */) && isDef(scopeId) && elm["s-si"] !== scopeId) {
2404
+ elm.classList.add(elm["s-si"] = scopeId);
2405
+ }
2406
+ if (newVNode2.$children$) {
2407
+ for (i2 = 0; i2 < newVNode2.$children$.length; ++i2) {
2408
+ childNode = createElm(oldParentVNode, newVNode2, i2);
2409
+ if (childNode) {
2410
+ elm.appendChild(childNode);
2411
+ }
2412
+ }
2413
+ }
2414
+ if (BUILD.svg) {
2415
+ if (newVNode2.$tag$ === "svg") {
2416
+ isSvgMode = false;
2417
+ } else if (elm.tagName === "foreignObject") {
2418
+ isSvgMode = true;
2419
+ }
2420
+ }
2421
+ }
2422
+ elm["s-hn"] = hostTagName;
2423
+ if (BUILD.slotRelocation) {
2424
+ if (newVNode2.$flags$ & (2 /* isSlotFallback */ | 1 /* isSlotReference */)) {
2425
+ elm["s-sr"] = true;
2426
+ elm["s-cr"] = contentRef;
2427
+ elm["s-sn"] = newVNode2.$name$ || "";
2428
+ elm["s-rf"] = (_a = newVNode2.$attrs$) == null ? void 0 : _a.ref;
2429
+ patchSlotNode(elm);
2430
+ oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex];
2431
+ if (oldVNode && oldVNode.$tag$ === newVNode2.$tag$ && oldParentVNode.$elm$) {
2432
+ if (BUILD.experimentalSlotFixes) {
2433
+ relocateToHostRoot(oldParentVNode.$elm$);
2434
+ } else {
2435
+ putBackInOriginalLocation(oldParentVNode.$elm$, false);
2436
+ }
2437
+ }
2438
+ if (BUILD.scoped || BUILD.hydrateServerSide && 128 /* shadowNeedsScopedCss */) {
2439
+ addRemoveSlotScopedClass(contentRef, elm, newParentVNode.$elm$, oldParentVNode == null ? void 0 : oldParentVNode.$elm$);
2440
+ }
2441
+ }
2442
+ }
2443
+ return elm;
2444
+ };
2445
+ var relocateToHostRoot = (parentElm) => {
2446
+ plt.$flags$ |= 1 /* isTmpDisconnected */;
2447
+ const host = parentElm.closest(hostTagName.toLowerCase());
2448
+ if (host != null) {
2449
+ const contentRefNode = Array.from(host.__childNodes || host.childNodes).find(
2450
+ (ref) => ref["s-cr"]
2451
+ );
2452
+ const childNodeArray = Array.from(
2453
+ parentElm.__childNodes || parentElm.childNodes
2454
+ );
2455
+ for (const childNode of contentRefNode ? childNodeArray.reverse() : childNodeArray) {
2456
+ if (childNode["s-sh"] != null) {
2457
+ insertBefore(host, childNode, contentRefNode != null ? contentRefNode : null);
2458
+ childNode["s-sh"] = void 0;
2459
+ checkSlotRelocate = true;
2460
+ }
2461
+ }
2462
+ }
2463
+ plt.$flags$ &= ~1 /* isTmpDisconnected */;
2464
+ };
2465
+ var putBackInOriginalLocation = (parentElm, recursive) => {
2466
+ plt.$flags$ |= 1 /* isTmpDisconnected */;
2467
+ const oldSlotChildNodes = Array.from(parentElm.__childNodes || parentElm.childNodes);
2468
+ if (parentElm["s-sr"] && BUILD.experimentalSlotFixes) {
2469
+ let node = parentElm;
2470
+ while (node = node.nextSibling) {
2471
+ if (node && node["s-sn"] === parentElm["s-sn"] && node["s-sh"] === hostTagName) {
2472
+ oldSlotChildNodes.push(node);
2473
+ }
2474
+ }
2475
+ }
2476
+ for (let i2 = oldSlotChildNodes.length - 1; i2 >= 0; i2--) {
2477
+ const childNode = oldSlotChildNodes[i2];
2478
+ if (childNode["s-hn"] !== hostTagName && childNode["s-ol"]) {
2479
+ insertBefore(referenceNode(childNode).parentNode, childNode, referenceNode(childNode));
2480
+ childNode["s-ol"].remove();
2481
+ childNode["s-ol"] = void 0;
2482
+ childNode["s-sh"] = void 0;
2483
+ checkSlotRelocate = true;
2484
+ }
2485
+ if (recursive) {
2486
+ putBackInOriginalLocation(childNode, recursive);
2487
+ }
2488
+ }
2489
+ plt.$flags$ &= ~1 /* isTmpDisconnected */;
2490
+ };
2491
+ var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
2492
+ let containerElm = BUILD.slotRelocation && parentElm["s-cr"] && parentElm["s-cr"].parentNode || parentElm;
2493
+ let childNode;
2494
+ if (BUILD.shadowDom && containerElm.shadowRoot && containerElm.tagName === hostTagName) {
2495
+ containerElm = containerElm.shadowRoot;
2496
+ }
2497
+ for (; startIdx <= endIdx; ++startIdx) {
2498
+ if (vnodes[startIdx]) {
2499
+ childNode = createElm(null, parentVNode, startIdx);
2500
+ if (childNode) {
2501
+ vnodes[startIdx].$elm$ = childNode;
2502
+ insertBefore(containerElm, childNode, BUILD.slotRelocation ? referenceNode(before) : before);
2503
+ }
2504
+ }
2505
+ }
2506
+ };
2507
+ var removeVnodes = (vnodes, startIdx, endIdx) => {
2508
+ for (let index = startIdx; index <= endIdx; ++index) {
2509
+ const vnode = vnodes[index];
2510
+ if (vnode) {
2511
+ const elm = vnode.$elm$;
2512
+ nullifyVNodeRefs(vnode);
2513
+ if (elm) {
2514
+ if (BUILD.slotRelocation) {
2515
+ checkSlotFallbackVisibility = true;
2516
+ if (elm["s-ol"]) {
2517
+ elm["s-ol"].remove();
2518
+ } else {
2519
+ putBackInOriginalLocation(elm, true);
2520
+ }
2521
+ }
2522
+ elm.remove();
2523
+ }
2524
+ }
2525
+ }
2526
+ };
2527
+ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = false) => {
2528
+ let oldStartIdx = 0;
2529
+ let newStartIdx = 0;
2530
+ let idxInOld = 0;
2531
+ let i2 = 0;
2532
+ let oldEndIdx = oldCh.length - 1;
2533
+ let oldStartVnode = oldCh[0];
2534
+ let oldEndVnode = oldCh[oldEndIdx];
2535
+ let newEndIdx = newCh.length - 1;
2536
+ let newStartVnode = newCh[0];
2537
+ let newEndVnode = newCh[newEndIdx];
2538
+ let node;
2539
+ let elmToMove;
2540
+ while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
2541
+ if (oldStartVnode == null) {
2542
+ oldStartVnode = oldCh[++oldStartIdx];
2543
+ } else if (oldEndVnode == null) {
2544
+ oldEndVnode = oldCh[--oldEndIdx];
2545
+ } else if (newStartVnode == null) {
2546
+ newStartVnode = newCh[++newStartIdx];
2547
+ } else if (newEndVnode == null) {
2548
+ newEndVnode = newCh[--newEndIdx];
2549
+ } else if (isSameVnode(oldStartVnode, newStartVnode, isInitialRender)) {
2550
+ patch(oldStartVnode, newStartVnode, isInitialRender);
2551
+ oldStartVnode = oldCh[++oldStartIdx];
2552
+ newStartVnode = newCh[++newStartIdx];
2553
+ } else if (isSameVnode(oldEndVnode, newEndVnode, isInitialRender)) {
2554
+ patch(oldEndVnode, newEndVnode, isInitialRender);
2555
+ oldEndVnode = oldCh[--oldEndIdx];
2556
+ newEndVnode = newCh[--newEndIdx];
2557
+ } else if (isSameVnode(oldStartVnode, newEndVnode, isInitialRender)) {
2558
+ if (BUILD.slotRelocation && (oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
2559
+ putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
2560
+ }
2561
+ patch(oldStartVnode, newEndVnode, isInitialRender);
2562
+ insertBefore(parentElm, oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
2563
+ oldStartVnode = oldCh[++oldStartIdx];
2564
+ newEndVnode = newCh[--newEndIdx];
2565
+ } else if (isSameVnode(oldEndVnode, newStartVnode, isInitialRender)) {
2566
+ if (BUILD.slotRelocation && (oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
2567
+ putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
2568
+ }
2569
+ patch(oldEndVnode, newStartVnode, isInitialRender);
2570
+ insertBefore(parentElm, oldEndVnode.$elm$, oldStartVnode.$elm$);
2571
+ oldEndVnode = oldCh[--oldEndIdx];
2572
+ newStartVnode = newCh[++newStartIdx];
2573
+ } else {
2574
+ idxInOld = -1;
2575
+ if (BUILD.vdomKey) {
2576
+ for (i2 = oldStartIdx; i2 <= oldEndIdx; ++i2) {
2577
+ if (oldCh[i2] && oldCh[i2].$key$ !== null && oldCh[i2].$key$ === newStartVnode.$key$) {
2578
+ idxInOld = i2;
2579
+ break;
2580
+ }
2581
+ }
2582
+ }
2583
+ if (BUILD.vdomKey && idxInOld >= 0) {
2584
+ elmToMove = oldCh[idxInOld];
2585
+ if (elmToMove.$tag$ !== newStartVnode.$tag$) {
2586
+ node = createElm(oldCh && oldCh[newStartIdx], newVNode2, idxInOld);
2587
+ } else {
2588
+ patch(elmToMove, newStartVnode, isInitialRender);
2589
+ oldCh[idxInOld] = void 0;
2590
+ node = elmToMove.$elm$;
2591
+ }
2592
+ newStartVnode = newCh[++newStartIdx];
2593
+ } else {
2594
+ node = createElm(oldCh && oldCh[newStartIdx], newVNode2, newStartIdx);
2595
+ newStartVnode = newCh[++newStartIdx];
2596
+ }
2597
+ if (node) {
2598
+ if (BUILD.slotRelocation) {
2599
+ insertBefore(
2600
+ referenceNode(oldStartVnode.$elm$).parentNode,
2601
+ node,
2602
+ referenceNode(oldStartVnode.$elm$)
2603
+ );
2604
+ } else {
2605
+ insertBefore(oldStartVnode.$elm$.parentNode, node, oldStartVnode.$elm$);
2606
+ }
2607
+ }
2608
+ }
2609
+ }
2610
+ if (oldStartIdx > oldEndIdx) {
2611
+ addVnodes(
2612
+ parentElm,
2613
+ newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$,
2614
+ newVNode2,
2615
+ newCh,
2616
+ newStartIdx,
2617
+ newEndIdx
2618
+ );
2619
+ } else if (BUILD.updatable && newStartIdx > newEndIdx) {
2620
+ removeVnodes(oldCh, oldStartIdx, oldEndIdx);
2621
+ }
2622
+ };
2623
+ var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
2624
+ if (leftVNode.$tag$ === rightVNode.$tag$) {
2625
+ if (BUILD.slotRelocation && leftVNode.$tag$ === "slot") {
2626
+ return leftVNode.$name$ === rightVNode.$name$;
2627
+ }
2628
+ if (BUILD.vdomKey && !isInitialRender) {
2629
+ return leftVNode.$key$ === rightVNode.$key$;
2630
+ }
2631
+ if (isInitialRender && !leftVNode.$key$ && rightVNode.$key$) {
2632
+ leftVNode.$key$ = rightVNode.$key$;
2633
+ }
2634
+ return true;
2635
+ }
2636
+ return false;
2637
+ };
2638
+ var referenceNode = (node) => node && node["s-ol"] || node;
2639
+ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
2640
+ const elm = newVNode2.$elm$ = oldVNode.$elm$;
2641
+ const oldChildren = oldVNode.$children$;
2642
+ const newChildren = newVNode2.$children$;
2643
+ const tag = newVNode2.$tag$;
2644
+ const text = newVNode2.$text$;
2645
+ let defaultHolder;
2646
+ if (!BUILD.vdomText || text === null) {
2647
+ if (BUILD.svg) {
2648
+ isSvgMode = tag === "svg" ? true : tag === "foreignObject" ? false : isSvgMode;
2649
+ }
2650
+ if (BUILD.vdomAttribute || BUILD.reflect) {
2651
+ if (BUILD.slot && tag === "slot" && !useNativeShadowDom) {
2652
+ if (BUILD.experimentalSlotFixes && oldVNode.$name$ !== newVNode2.$name$) {
2653
+ newVNode2.$elm$["s-sn"] = newVNode2.$name$ || "";
2654
+ relocateToHostRoot(newVNode2.$elm$.parentElement);
2655
+ }
2656
+ }
2657
+ updateElement(oldVNode, newVNode2, isSvgMode, isInitialRender);
2658
+ }
2659
+ if (BUILD.updatable && oldChildren !== null && newChildren !== null) {
2660
+ updateChildren(elm, oldChildren, newVNode2, newChildren, isInitialRender);
2661
+ } else if (newChildren !== null) {
2662
+ if (BUILD.updatable && BUILD.vdomText && oldVNode.$text$ !== null) {
2663
+ elm.textContent = "";
2664
+ }
2665
+ addVnodes(elm, null, newVNode2, newChildren, 0, newChildren.length - 1);
2666
+ } else if (
2667
+ // don't do this on initial render as it can cause non-hydrated content to be removed
2668
+ !isInitialRender && BUILD.updatable && oldChildren !== null
2669
+ ) {
2670
+ removeVnodes(oldChildren, 0, oldChildren.length - 1);
2671
+ }
2672
+ if (BUILD.svg && isSvgMode && tag === "svg") {
2673
+ isSvgMode = false;
2674
+ }
2675
+ } else if (BUILD.vdomText && BUILD.slotRelocation && (defaultHolder = elm["s-cr"])) {
2676
+ defaultHolder.parentNode.textContent = text;
2677
+ } else if (BUILD.vdomText && oldVNode.$text$ !== text) {
2678
+ elm.data = text;
2679
+ }
2680
+ };
2681
+ var relocateNodes = [];
2682
+ var markSlotContentForRelocation = (elm) => {
2683
+ let node;
2684
+ let hostContentNodes;
2685
+ let j;
2686
+ const children = elm.__childNodes || elm.childNodes;
2687
+ for (const childNode of children) {
2688
+ if (childNode["s-sr"] && (node = childNode["s-cr"]) && node.parentNode) {
2689
+ hostContentNodes = node.parentNode.__childNodes || node.parentNode.childNodes;
2690
+ const slotName = childNode["s-sn"];
2691
+ for (j = hostContentNodes.length - 1; j >= 0; j--) {
2692
+ node = hostContentNodes[j];
2693
+ if (!node["s-cn"] && !node["s-nr"] && node["s-hn"] !== childNode["s-hn"] && (!BUILD.experimentalSlotFixes || !node["s-sh"] || node["s-sh"] !== childNode["s-hn"])) {
2694
+ if (isNodeLocatedInSlot(node, slotName)) {
2695
+ let relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
2696
+ checkSlotFallbackVisibility = true;
2697
+ node["s-sn"] = node["s-sn"] || slotName;
2698
+ if (relocateNodeData) {
2699
+ relocateNodeData.$nodeToRelocate$["s-sh"] = childNode["s-hn"];
2700
+ relocateNodeData.$slotRefNode$ = childNode;
2701
+ } else {
2702
+ node["s-sh"] = childNode["s-hn"];
2703
+ relocateNodes.push({
2704
+ $slotRefNode$: childNode,
2705
+ $nodeToRelocate$: node
2706
+ });
2707
+ }
2708
+ if (node["s-sr"]) {
2709
+ relocateNodes.map((relocateNode) => {
2710
+ if (isNodeLocatedInSlot(relocateNode.$nodeToRelocate$, node["s-sn"])) {
2711
+ relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
2712
+ if (relocateNodeData && !relocateNode.$slotRefNode$) {
2713
+ relocateNode.$slotRefNode$ = relocateNodeData.$slotRefNode$;
2714
+ }
2715
+ }
2716
+ });
2717
+ }
2718
+ } else if (!relocateNodes.some((r) => r.$nodeToRelocate$ === node)) {
2719
+ relocateNodes.push({
2720
+ $nodeToRelocate$: node
2721
+ });
2722
+ }
2723
+ }
2724
+ }
2725
+ }
2726
+ if (childNode.nodeType === 1 /* ElementNode */) {
2727
+ markSlotContentForRelocation(childNode);
2728
+ }
2729
+ }
2730
+ };
2731
+ var nullifyVNodeRefs = (vNode) => {
2732
+ if (BUILD.vdomRef) {
2733
+ vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
2734
+ vNode.$children$ && vNode.$children$.map(nullifyVNodeRefs);
2735
+ }
2736
+ };
2737
+ var insertBefore = (parent, newNode, reference) => {
2738
+ if (BUILD.scoped && typeof newNode["s-sn"] === "string" && !!newNode["s-sr"] && !!newNode["s-cr"]) {
2739
+ addRemoveSlotScopedClass(newNode["s-cr"], newNode, parent, newNode.parentElement);
2740
+ } else if (BUILD.experimentalSlotFixes && typeof newNode["s-sn"] === "string") {
2741
+ if (parent.getRootNode().nodeType !== 11 /* DOCUMENT_FRAGMENT_NODE */) {
2742
+ patchParentNode(newNode);
2743
+ }
2744
+ parent.insertBefore(newNode, reference);
2745
+ const { slotNode } = findSlotFromSlottedNode(newNode);
2746
+ if (slotNode) dispatchSlotChangeEvent(slotNode);
2747
+ return newNode;
2748
+ }
2749
+ if (BUILD.experimentalSlotFixes && parent.__insertBefore) {
2750
+ return parent.__insertBefore(newNode, reference);
2751
+ } else {
2752
+ return parent == null ? void 0 : parent.insertBefore(newNode, reference);
2753
+ }
2754
+ };
2755
+ function addRemoveSlotScopedClass(reference, slotNode, newParent, oldParent) {
2756
+ var _a, _b;
2757
+ let scopeId2;
2758
+ if (reference && typeof slotNode["s-sn"] === "string" && !!slotNode["s-sr"] && reference.parentNode && reference.parentNode["s-sc"] && (scopeId2 = slotNode["s-si"] || reference.parentNode["s-sc"])) {
2759
+ const scopeName = slotNode["s-sn"];
2760
+ const hostName = slotNode["s-hn"];
2761
+ (_a = newParent.classList) == null ? void 0 : _a.add(scopeId2 + "-s");
2762
+ if (oldParent && ((_b = oldParent.classList) == null ? void 0 : _b.contains(scopeId2 + "-s"))) {
2763
+ let child = (oldParent.__childNodes || oldParent.childNodes)[0];
2764
+ let found = false;
2765
+ while (child) {
2766
+ if (child["s-sn"] !== scopeName && child["s-hn"] === hostName && !!child["s-sr"]) {
2767
+ found = true;
2768
+ break;
2769
+ }
2770
+ child = child.nextSibling;
2771
+ }
2772
+ if (!found) oldParent.classList.remove(scopeId2 + "-s");
2773
+ }
2774
+ }
2775
+ }
2776
+ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
2777
+ var _a, _b, _c, _d, _e;
2778
+ const hostElm = hostRef.$hostElement$;
2779
+ const cmpMeta = hostRef.$cmpMeta$;
2780
+ const oldVNode = hostRef.$vnode$ || newVNode(null, null);
2781
+ const isHostElement = isHost(renderFnResults);
2782
+ const rootVnode = isHostElement ? renderFnResults : h(null, null, renderFnResults);
2783
+ hostTagName = hostElm.tagName;
2784
+ if (BUILD.isDev && Array.isArray(renderFnResults) && renderFnResults.some(isHost)) {
2785
+ throw new Error(`The <Host> must be the single root component.
2786
+ Looks like the render() function of "${hostTagName.toLowerCase()}" is returning an array that contains the <Host>.
2787
+
2788
+ The render() function should look like this instead:
2789
+
2790
+ render() {
2791
+ // Do not return an array
2792
+ return (
2793
+ <Host>{content}</Host>
2794
+ );
2795
+ }
2796
+ `);
2797
+ }
2798
+ if (BUILD.reflect && cmpMeta.$attrsToReflect$) {
2799
+ rootVnode.$attrs$ = rootVnode.$attrs$ || {};
2800
+ cmpMeta.$attrsToReflect$.map(
2801
+ ([propName, attribute]) => rootVnode.$attrs$[attribute] = hostElm[propName]
2802
+ );
2803
+ }
2804
+ if (isInitialLoad && rootVnode.$attrs$) {
2805
+ for (const key of Object.keys(rootVnode.$attrs$)) {
2806
+ if (hostElm.hasAttribute(key) && !["key", "ref", "style", "class"].includes(key)) {
2807
+ rootVnode.$attrs$[key] = hostElm[key];
2808
+ }
2809
+ }
2810
+ }
2811
+ rootVnode.$tag$ = null;
2812
+ rootVnode.$flags$ |= 4 /* isHost */;
2813
+ hostRef.$vnode$ = rootVnode;
2814
+ rootVnode.$elm$ = oldVNode.$elm$ = BUILD.shadowDom ? hostElm.shadowRoot || hostElm : hostElm;
2815
+ if (BUILD.scoped || BUILD.shadowDom) {
2816
+ scopeId = hostElm["s-sc"];
2817
+ }
2818
+ useNativeShadowDom = supportsShadow && !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) && !(cmpMeta.$flags$ & 128 /* shadowNeedsScopedCss */);
2819
+ if (BUILD.slotRelocation) {
2820
+ contentRef = hostElm["s-cr"];
2821
+ checkSlotFallbackVisibility = false;
2822
+ }
2823
+ patch(oldVNode, rootVnode, isInitialLoad);
2824
+ if (BUILD.slotRelocation) {
2825
+ plt.$flags$ |= 1 /* isTmpDisconnected */;
2826
+ if (checkSlotRelocate) {
2827
+ markSlotContentForRelocation(rootVnode.$elm$);
2828
+ for (const relocateData of relocateNodes) {
2829
+ const nodeToRelocate = relocateData.$nodeToRelocate$;
2830
+ if (!nodeToRelocate["s-ol"] && win.document) {
2831
+ const orgLocationNode = BUILD.isDebug || BUILD.hydrateServerSide ? originalLocationDebugNode(nodeToRelocate) : win.document.createTextNode("");
2832
+ orgLocationNode["s-nr"] = nodeToRelocate;
2833
+ insertBefore(nodeToRelocate.parentNode, nodeToRelocate["s-ol"] = orgLocationNode, nodeToRelocate);
2834
+ }
2835
+ }
2836
+ for (const relocateData of relocateNodes) {
2837
+ const nodeToRelocate = relocateData.$nodeToRelocate$;
2838
+ const slotRefNode = relocateData.$slotRefNode$;
2839
+ if (slotRefNode) {
2840
+ const parentNodeRef = slotRefNode.parentNode;
2841
+ let insertBeforeNode = slotRefNode.nextSibling;
2842
+ if (!BUILD.hydrateServerSide && (!BUILD.experimentalSlotFixes || insertBeforeNode && insertBeforeNode.nodeType === 1 /* ElementNode */)) {
2843
+ let orgLocationNode = (_a = nodeToRelocate["s-ol"]) == null ? void 0 : _a.previousSibling;
2844
+ while (orgLocationNode) {
2845
+ let refNode = (_b = orgLocationNode["s-nr"]) != null ? _b : null;
2846
+ if (refNode && refNode["s-sn"] === nodeToRelocate["s-sn"] && parentNodeRef === (refNode.__parentNode || refNode.parentNode)) {
2847
+ refNode = refNode.nextSibling;
2848
+ while (refNode === nodeToRelocate || (refNode == null ? void 0 : refNode["s-sr"])) {
2849
+ refNode = refNode == null ? void 0 : refNode.nextSibling;
2850
+ }
2851
+ if (!refNode || !refNode["s-nr"]) {
2852
+ insertBeforeNode = refNode;
2853
+ break;
2854
+ }
2855
+ }
2856
+ orgLocationNode = orgLocationNode.previousSibling;
2857
+ }
2858
+ }
2859
+ const parent = nodeToRelocate.__parentNode || nodeToRelocate.parentNode;
2860
+ const nextSibling = nodeToRelocate.__nextSibling || nodeToRelocate.nextSibling;
2861
+ if (!insertBeforeNode && parentNodeRef !== parent || nextSibling !== insertBeforeNode) {
2862
+ if (nodeToRelocate !== insertBeforeNode) {
2863
+ if (!BUILD.experimentalSlotFixes && !nodeToRelocate["s-hn"] && nodeToRelocate["s-ol"]) {
2864
+ nodeToRelocate["s-hn"] = nodeToRelocate["s-ol"].parentNode.nodeName;
2865
+ }
2866
+ insertBefore(parentNodeRef, nodeToRelocate, insertBeforeNode);
2867
+ if (nodeToRelocate.nodeType === 1 /* ElementNode */ && nodeToRelocate.tagName !== "SLOT-FB") {
2868
+ nodeToRelocate.hidden = (_c = nodeToRelocate["s-ih"]) != null ? _c : false;
2869
+ }
2870
+ }
2871
+ }
2872
+ nodeToRelocate && typeof slotRefNode["s-rf"] === "function" && slotRefNode["s-rf"](slotRefNode);
2873
+ } else {
2874
+ if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
2875
+ if (isInitialLoad) {
2876
+ nodeToRelocate["s-ih"] = (_d = nodeToRelocate.hidden) != null ? _d : false;
2877
+ }
2878
+ nodeToRelocate.hidden = true;
2879
+ }
2880
+ }
2881
+ }
2882
+ }
2883
+ if (checkSlotFallbackVisibility) {
2884
+ updateFallbackSlotVisibility(rootVnode.$elm$);
2885
+ }
2886
+ plt.$flags$ &= ~1 /* isTmpDisconnected */;
2887
+ relocateNodes.length = 0;
2888
+ }
2889
+ if (BUILD.experimentalScopedSlotChanges && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
2890
+ const children = rootVnode.$elm$.__childNodes || rootVnode.$elm$.childNodes;
2891
+ for (const childNode of children) {
2892
+ if (childNode["s-hn"] !== hostTagName && !childNode["s-sh"]) {
2893
+ if (isInitialLoad && childNode["s-ih"] == null) {
2894
+ childNode["s-ih"] = (_e = childNode.hidden) != null ? _e : false;
2895
+ }
2896
+ childNode.hidden = true;
2897
+ }
2898
+ }
2899
+ }
2900
+ contentRef = void 0;
2901
+ };
2902
+ var slotReferenceDebugNode = (slotVNode) => {
2903
+ var _a;
2904
+ return (_a = win.document) == null ? void 0 : _a.createComment(
2905
+ `<slot${slotVNode.$name$ ? ' name="' + slotVNode.$name$ + '"' : ""}> (host=${hostTagName.toLowerCase()})`
2906
+ );
2907
+ };
2908
+ var originalLocationDebugNode = (nodeToRelocate) => {
2909
+ var _a;
2910
+ return (_a = win.document) == null ? void 0 : _a.createComment(
2911
+ `org-location for ` + (nodeToRelocate.localName ? `<${nodeToRelocate.localName}> (host=${nodeToRelocate["s-hn"]})` : `[${nodeToRelocate.textContent}]`)
2912
+ );
2913
+ };
2914
+
2915
+ // src/runtime/update-component.ts
2916
+ var attachToAncestor = (hostRef, ancestorComponent) => {
2917
+ if (BUILD.asyncLoading && ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent["s-p"]) {
2918
+ const index = ancestorComponent["s-p"].push(
2919
+ new Promise(
2920
+ (r) => hostRef.$onRenderResolve$ = () => {
2921
+ ancestorComponent["s-p"].splice(index - 1, 1);
2922
+ r();
2923
+ }
2924
+ )
2925
+ );
2926
+ }
2927
+ };
2928
+ var scheduleUpdate = (hostRef, isInitialLoad) => {
2929
+ if (BUILD.taskQueue && BUILD.updatable) {
2930
+ hostRef.$flags$ |= 16 /* isQueuedForUpdate */;
2931
+ }
2932
+ if (BUILD.asyncLoading && hostRef.$flags$ & 4 /* isWaitingForChildren */) {
2933
+ hostRef.$flags$ |= 512 /* needsRerender */;
2934
+ return;
2935
+ }
2936
+ attachToAncestor(hostRef, hostRef.$ancestorComponent$);
2937
+ const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
2938
+ return BUILD.taskQueue ? writeTask(dispatch) : dispatch();
2939
+ };
2940
+ var dispatchHooks = (hostRef, isInitialLoad) => {
2941
+ const elm = hostRef.$hostElement$;
2942
+ const endSchedule = createTime("scheduleUpdate", hostRef.$cmpMeta$.$tagName$);
2943
+ const instance = BUILD.lazyLoad ? hostRef.$lazyInstance$ : elm;
2944
+ if (!instance) {
2945
+ throw new Error(
2946
+ `Can't render component <${elm.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`
2947
+ );
2948
+ }
2949
+ let maybePromise;
2950
+ if (isInitialLoad) {
2951
+ if (BUILD.lazyLoad && BUILD.hostListener) {
2952
+ hostRef.$flags$ |= 256 /* isListenReady */;
2953
+ if (hostRef.$queuedListeners$) {
2954
+ hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event, elm));
2955
+ hostRef.$queuedListeners$ = void 0;
2956
+ }
2957
+ }
2958
+ emitLifecycleEvent(elm, "componentWillLoad");
2959
+ maybePromise = safeCall(instance, "componentWillLoad", void 0, elm);
2960
+ } else {
2961
+ emitLifecycleEvent(elm, "componentWillUpdate");
2962
+ maybePromise = safeCall(instance, "componentWillUpdate", void 0, elm);
2963
+ }
2964
+ emitLifecycleEvent(elm, "componentWillRender");
2965
+ maybePromise = enqueue(maybePromise, () => safeCall(instance, "componentWillRender", void 0, elm));
2966
+ endSchedule();
2967
+ return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));
2968
+ };
2969
+ var enqueue = (maybePromise, fn) => isPromisey(maybePromise) ? maybePromise.then(fn).catch((err2) => {
2970
+ console.error(err2);
2971
+ fn();
2972
+ }) : fn();
2973
+ var isPromisey = (maybePromise) => maybePromise instanceof Promise || maybePromise && maybePromise.then && typeof maybePromise.then === "function";
2974
+ var updateComponent = async (hostRef, instance, isInitialLoad) => {
2975
+ var _a;
2976
+ const elm = hostRef.$hostElement$;
2977
+ const endUpdate = createTime("update", hostRef.$cmpMeta$.$tagName$);
2978
+ const rc = elm["s-rc"];
2979
+ if (BUILD.style && isInitialLoad) {
2980
+ attachStyles(hostRef);
2981
+ }
2982
+ const endRender = createTime("render", hostRef.$cmpMeta$.$tagName$);
2983
+ if (BUILD.isDev) {
2984
+ hostRef.$flags$ |= 1024 /* devOnRender */;
2985
+ }
2986
+ if (BUILD.hydrateServerSide) {
2987
+ await callRender(hostRef, instance, elm, isInitialLoad);
2988
+ } else {
2989
+ callRender(hostRef, instance, elm, isInitialLoad);
2990
+ }
2991
+ if (BUILD.isDev) {
2992
+ hostRef.$renderCount$ = hostRef.$renderCount$ === void 0 ? 1 : hostRef.$renderCount$ + 1;
2993
+ hostRef.$flags$ &= ~1024 /* devOnRender */;
2994
+ }
2995
+ if (BUILD.hydrateServerSide) {
2996
+ try {
2997
+ serverSideConnected(elm);
2998
+ if (isInitialLoad) {
2999
+ if (hostRef.$cmpMeta$.$flags$ & 1 /* shadowDomEncapsulation */) {
3000
+ elm["s-en"] = "";
3001
+ } else if (hostRef.$cmpMeta$.$flags$ & 2 /* scopedCssEncapsulation */) {
3002
+ elm["s-en"] = "c";
3003
+ }
3004
+ }
3005
+ } catch (e) {
3006
+ consoleError(e, elm);
3007
+ }
3008
+ }
3009
+ if (BUILD.asyncLoading && rc) {
3010
+ rc.map((cb) => cb());
3011
+ elm["s-rc"] = void 0;
3012
+ }
3013
+ endRender();
3014
+ endUpdate();
3015
+ if (BUILD.asyncLoading) {
3016
+ const childrenPromises = (_a = elm["s-p"]) != null ? _a : [];
3017
+ const postUpdate = () => postUpdateComponent(hostRef);
3018
+ if (childrenPromises.length === 0) {
3019
+ postUpdate();
3020
+ } else {
3021
+ Promise.all(childrenPromises).then(postUpdate);
3022
+ hostRef.$flags$ |= 4 /* isWaitingForChildren */;
3023
+ childrenPromises.length = 0;
3024
+ }
3025
+ } else {
3026
+ postUpdateComponent(hostRef);
3027
+ }
3028
+ };
3029
+ var renderingRef = null;
3030
+ var callRender = (hostRef, instance, elm, isInitialLoad) => {
3031
+ const allRenderFn = BUILD.allRenderFn ? true : false;
3032
+ const lazyLoad = BUILD.lazyLoad ? true : false;
3033
+ const taskQueue = BUILD.taskQueue ? true : false;
3034
+ const updatable = BUILD.updatable ? true : false;
3035
+ try {
3036
+ renderingRef = instance;
3037
+ instance = allRenderFn ? instance.render() : instance.render && instance.render();
3038
+ if (updatable && taskQueue) {
3039
+ hostRef.$flags$ &= ~16 /* isQueuedForUpdate */;
3040
+ }
3041
+ if (updatable || lazyLoad) {
3042
+ hostRef.$flags$ |= 2 /* hasRendered */;
3043
+ }
3044
+ if (BUILD.hasRenderFn || BUILD.reflect) {
3045
+ if (BUILD.vdomRender || BUILD.reflect) {
3046
+ if (BUILD.hydrateServerSide) {
3047
+ return Promise.resolve(instance).then((value) => renderVdom(hostRef, value, isInitialLoad));
3048
+ } else {
3049
+ renderVdom(hostRef, instance, isInitialLoad);
3050
+ }
3051
+ } else {
3052
+ const shadowRoot = elm.shadowRoot;
3053
+ if (hostRef.$cmpMeta$.$flags$ & 1 /* shadowDomEncapsulation */) {
3054
+ shadowRoot.textContent = instance;
3055
+ } else {
3056
+ elm.textContent = instance;
3057
+ }
3058
+ }
3059
+ }
3060
+ } catch (e) {
3061
+ consoleError(e, hostRef.$hostElement$);
3062
+ }
3063
+ renderingRef = null;
3064
+ return null;
3065
+ };
3066
+ var getRenderingRef = () => renderingRef;
3067
+ var postUpdateComponent = (hostRef) => {
3068
+ const tagName = hostRef.$cmpMeta$.$tagName$;
3069
+ const elm = hostRef.$hostElement$;
3070
+ const endPostUpdate = createTime("postUpdate", tagName);
3071
+ const instance = BUILD.lazyLoad ? hostRef.$lazyInstance$ : elm;
3072
+ const ancestorComponent = hostRef.$ancestorComponent$;
3073
+ if (BUILD.isDev) {
3074
+ hostRef.$flags$ |= 1024 /* devOnRender */;
3075
+ }
3076
+ safeCall(instance, "componentDidRender", void 0, elm);
3077
+ if (BUILD.isDev) {
3078
+ hostRef.$flags$ &= ~1024 /* devOnRender */;
3079
+ }
3080
+ emitLifecycleEvent(elm, "componentDidRender");
3081
+ if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
3082
+ hostRef.$flags$ |= 64 /* hasLoadedComponent */;
3083
+ if (BUILD.asyncLoading && BUILD.cssAnnotations) {
3084
+ addHydratedFlag(elm);
3085
+ }
3086
+ if (BUILD.isDev) {
3087
+ hostRef.$flags$ |= 2048 /* devOnDidLoad */;
3088
+ }
3089
+ safeCall(instance, "componentDidLoad", void 0, elm);
3090
+ if (BUILD.isDev) {
3091
+ hostRef.$flags$ &= ~2048 /* devOnDidLoad */;
3092
+ }
3093
+ emitLifecycleEvent(elm, "componentDidLoad");
3094
+ endPostUpdate();
3095
+ if (BUILD.asyncLoading) {
3096
+ hostRef.$onReadyResolve$(elm);
3097
+ if (!ancestorComponent) {
3098
+ appDidLoad(tagName);
3099
+ }
3100
+ }
3101
+ } else {
3102
+ if (BUILD.isDev) {
3103
+ hostRef.$flags$ |= 1024 /* devOnRender */;
3104
+ }
3105
+ safeCall(instance, "componentDidUpdate", void 0, elm);
3106
+ if (BUILD.isDev) {
3107
+ hostRef.$flags$ &= ~1024 /* devOnRender */;
3108
+ }
3109
+ emitLifecycleEvent(elm, "componentDidUpdate");
3110
+ endPostUpdate();
3111
+ }
3112
+ if (BUILD.method && BUILD.lazyLoad) {
3113
+ hostRef.$onInstanceResolve$(elm);
3114
+ }
3115
+ if (BUILD.asyncLoading) {
3116
+ if (hostRef.$onRenderResolve$) {
3117
+ hostRef.$onRenderResolve$();
3118
+ hostRef.$onRenderResolve$ = void 0;
3119
+ }
3120
+ if (hostRef.$flags$ & 512 /* needsRerender */) {
3121
+ nextTick(() => scheduleUpdate(hostRef, false));
3122
+ }
3123
+ hostRef.$flags$ &= ~(4 /* isWaitingForChildren */ | 512 /* needsRerender */);
3124
+ }
3125
+ };
3126
+ var forceUpdate = (ref) => {
3127
+ if (BUILD.updatable && (Build.isBrowser || Build.isTesting)) {
3128
+ const hostRef = getHostRef(ref);
3129
+ const isConnected = hostRef.$hostElement$.isConnected;
3130
+ if (isConnected && (hostRef.$flags$ & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
3131
+ scheduleUpdate(hostRef, false);
3132
+ }
3133
+ return isConnected;
3134
+ }
3135
+ return false;
3136
+ };
3137
+ var appDidLoad = (who) => {
3138
+ if (BUILD.asyncQueue) {
3139
+ plt.$flags$ |= 2 /* appLoaded */;
3140
+ }
3141
+ nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
3142
+ if (BUILD.profile && performance.measure) {
3143
+ performance.measure(`[Stencil] ${NAMESPACE} initial load (by ${who})`, "st:app:start");
3144
+ }
3145
+ };
3146
+ var safeCall = (instance, method, arg, elm) => {
3147
+ if (instance && instance[method]) {
3148
+ try {
3149
+ return instance[method](arg);
3150
+ } catch (e) {
3151
+ consoleError(e, elm);
3152
+ }
3153
+ }
3154
+ return void 0;
3155
+ };
3156
+ var emitLifecycleEvent = (elm, lifecycleName) => {
3157
+ if (BUILD.lifecycleDOMEvents) {
3158
+ emitEvent(elm, "stencil_" + lifecycleName, {
3159
+ bubbles: true,
3160
+ composed: true,
3161
+ detail: {
3162
+ namespace: NAMESPACE
3163
+ }
3164
+ });
3165
+ }
3166
+ };
3167
+ var addHydratedFlag = (elm) => {
3168
+ var _a, _b;
3169
+ return BUILD.hydratedClass ? elm.classList.add((_a = BUILD.hydratedSelectorName) != null ? _a : "hydrated") : BUILD.hydratedAttribute ? elm.setAttribute((_b = BUILD.hydratedSelectorName) != null ? _b : "hydrated", "") : void 0;
3170
+ };
3171
+ var serverSideConnected = (elm) => {
3172
+ const children = elm.children;
3173
+ if (children != null) {
3174
+ for (let i2 = 0, ii = children.length; i2 < ii; i2++) {
3175
+ const childElm = children[i2];
3176
+ if (typeof childElm.connectedCallback === "function") {
3177
+ childElm.connectedCallback();
3178
+ }
3179
+ serverSideConnected(childElm);
3180
+ }
3181
+ }
3182
+ };
3183
+
3184
+ // src/runtime/set-value.ts
3185
+ var getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
3186
+ var setValue = (ref, propName, newVal, cmpMeta) => {
3187
+ const hostRef = getHostRef(ref);
3188
+ if (BUILD.lazyLoad && !hostRef) {
3189
+ throw new Error(
3190
+ `Couldn't find host element for "${cmpMeta.$tagName$}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/stenciljs/core/issues/5457).`
3191
+ );
3192
+ }
3193
+ const elm = BUILD.lazyLoad ? hostRef.$hostElement$ : ref;
3194
+ const oldVal = hostRef.$instanceValues$.get(propName);
3195
+ const flags = hostRef.$flags$;
3196
+ const instance = BUILD.lazyLoad ? hostRef.$lazyInstance$ : elm;
3197
+ newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]);
3198
+ const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
3199
+ const didValueChange = newVal !== oldVal && !areBothNaN;
3200
+ if ((!BUILD.lazyLoad || !(flags & 8 /* isConstructingInstance */) || oldVal === void 0) && didValueChange) {
3201
+ hostRef.$instanceValues$.set(propName, newVal);
3202
+ if (BUILD.isDev) {
3203
+ if (hostRef.$flags$ & 1024 /* devOnRender */) {
3204
+ consoleDevWarn(
3205
+ `The state/prop "${propName}" changed during rendering. This can potentially lead to infinite-loops and other bugs.`,
3206
+ "\nElement",
3207
+ elm,
3208
+ "\nNew value",
3209
+ newVal,
3210
+ "\nOld value",
3211
+ oldVal
3212
+ );
3213
+ } else if (hostRef.$flags$ & 2048 /* devOnDidLoad */) {
3214
+ consoleDevWarn(
3215
+ `The state/prop "${propName}" changed during "componentDidLoad()", this triggers extra re-renders, try to setup on "componentWillLoad()"`,
3216
+ "\nElement",
3217
+ elm,
3218
+ "\nNew value",
3219
+ newVal,
3220
+ "\nOld value",
3221
+ oldVal
3222
+ );
3223
+ }
3224
+ }
3225
+ if (!BUILD.lazyLoad || instance) {
3226
+ if (BUILD.watchCallback && cmpMeta.$watchers$ && flags & 128 /* isWatchReady */) {
3227
+ const watchMethods = cmpMeta.$watchers$[propName];
3228
+ if (watchMethods) {
3229
+ watchMethods.map((watchMethodName) => {
3230
+ try {
3231
+ instance[watchMethodName](newVal, oldVal, propName);
3232
+ } catch (e) {
3233
+ consoleError(e, elm);
3234
+ }
3235
+ });
3236
+ }
3237
+ }
3238
+ if (BUILD.updatable && (flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
3239
+ if (instance.componentShouldUpdate) {
3240
+ if (instance.componentShouldUpdate(newVal, oldVal, propName) === false) {
3241
+ return;
3242
+ }
3243
+ }
3244
+ scheduleUpdate(hostRef, false);
3245
+ }
3246
+ }
3247
+ }
3248
+ };
3249
+
3250
+ // src/runtime/proxy-component.ts
3251
+ var proxyComponent = (Cstr, cmpMeta, flags) => {
3252
+ var _a, _b;
3253
+ const prototype = Cstr.prototype;
3254
+ if (BUILD.isTesting) {
3255
+ if (prototype.__stencilAugmented) {
3256
+ return;
3257
+ }
3258
+ prototype.__stencilAugmented = true;
3259
+ }
3260
+ if (BUILD.formAssociated && cmpMeta.$flags$ & 64 /* formAssociated */ && flags & 1 /* isElementConstructor */) {
3261
+ FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS.forEach((cbName) => {
3262
+ const originalFormAssociatedCallback = prototype[cbName];
3263
+ Object.defineProperty(prototype, cbName, {
3264
+ value(...args) {
3265
+ const hostRef = getHostRef(this);
3266
+ const instance = BUILD.lazyLoad ? hostRef.$lazyInstance$ : this;
3267
+ if (!instance) {
3268
+ hostRef.$onReadyPromise$.then((asyncInstance) => {
3269
+ const cb = asyncInstance[cbName];
3270
+ typeof cb === "function" && cb.call(asyncInstance, ...args);
3271
+ });
3272
+ } else {
3273
+ const cb = BUILD.lazyLoad ? instance[cbName] : originalFormAssociatedCallback;
3274
+ typeof cb === "function" && cb.call(instance, ...args);
3275
+ }
3276
+ }
3277
+ });
3278
+ });
3279
+ }
3280
+ if (BUILD.member && cmpMeta.$members$ || BUILD.watchCallback && (cmpMeta.$watchers$ || Cstr.watchers)) {
3281
+ if (BUILD.watchCallback && Cstr.watchers && !cmpMeta.$watchers$) {
3282
+ cmpMeta.$watchers$ = Cstr.watchers;
3283
+ }
3284
+ const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
3285
+ members.map(([memberName, [memberFlags]]) => {
3286
+ if ((BUILD.prop || BUILD.state) && (memberFlags & 31 /* Prop */ || (!BUILD.lazyLoad || flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
3287
+ const { get: origGetter, set: origSetter } = Object.getOwnPropertyDescriptor(prototype, memberName) || {};
3288
+ if (origGetter) cmpMeta.$members$[memberName][0] |= 2048 /* Getter */;
3289
+ if (origSetter) cmpMeta.$members$[memberName][0] |= 4096 /* Setter */;
3290
+ if (flags & 1 /* isElementConstructor */ || !origGetter) {
3291
+ Object.defineProperty(prototype, memberName, {
3292
+ get() {
3293
+ if (BUILD.lazyLoad) {
3294
+ if ((cmpMeta.$members$[memberName][0] & 2048 /* Getter */) === 0) {
3295
+ return getValue(this, memberName);
3296
+ }
3297
+ const ref = getHostRef(this);
3298
+ const instance = ref ? ref.$lazyInstance$ : prototype;
3299
+ if (!instance) return;
3300
+ return instance[memberName];
3301
+ }
3302
+ if (!BUILD.lazyLoad) {
3303
+ return origGetter ? origGetter.apply(this) : getValue(this, memberName);
3304
+ }
3305
+ },
3306
+ configurable: true,
3307
+ enumerable: true
3308
+ });
3309
+ }
3310
+ Object.defineProperty(prototype, memberName, {
3311
+ set(newValue) {
3312
+ const ref = getHostRef(this);
3313
+ if (BUILD.isDev) {
3314
+ if (
3315
+ // we are proxying the instance (not element)
3316
+ (flags & 1 /* isElementConstructor */) === 0 && // if the class has a setter, then the Element can update instance values, so ignore
3317
+ (cmpMeta.$members$[memberName][0] & 4096 /* Setter */) === 0 && // the element is not constructing
3318
+ (ref && ref.$flags$ & 8 /* isConstructingInstance */) === 0 && // the member is a prop
3319
+ (memberFlags & 31 /* Prop */) !== 0 && // the member is not mutable
3320
+ (memberFlags & 1024 /* Mutable */) === 0
3321
+ ) {
3322
+ consoleDevWarn(
3323
+ `@Prop() "${memberName}" on <${cmpMeta.$tagName$}> is immutable but was modified from within the component.
3324
+ More information: https://stenciljs.com/docs/properties#prop-mutability`
3325
+ );
3326
+ }
3327
+ }
3328
+ if (origSetter) {
3329
+ const currentValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
3330
+ if (typeof currentValue === "undefined" && ref.$instanceValues$.get(memberName)) {
3331
+ newValue = ref.$instanceValues$.get(memberName);
3332
+ } else if (!ref.$instanceValues$.get(memberName) && currentValue) {
3333
+ ref.$instanceValues$.set(memberName, currentValue);
3334
+ }
3335
+ origSetter.apply(this, [parsePropertyValue(newValue, memberFlags)]);
3336
+ newValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
3337
+ setValue(this, memberName, newValue, cmpMeta);
3338
+ return;
3339
+ }
3340
+ if (!BUILD.lazyLoad) {
3341
+ setValue(this, memberName, newValue, cmpMeta);
3342
+ return;
3343
+ }
3344
+ if (BUILD.lazyLoad) {
3345
+ if ((flags & 1 /* isElementConstructor */) === 0 || (cmpMeta.$members$[memberName][0] & 4096 /* Setter */) === 0) {
3346
+ setValue(this, memberName, newValue, cmpMeta);
3347
+ if (flags & 1 /* isElementConstructor */ && !ref.$lazyInstance$) {
3348
+ ref.$onReadyPromise$.then(() => {
3349
+ if (cmpMeta.$members$[memberName][0] & 4096 /* Setter */ && ref.$lazyInstance$[memberName] !== ref.$instanceValues$.get(memberName)) {
3350
+ ref.$lazyInstance$[memberName] = newValue;
3351
+ }
3352
+ });
3353
+ }
3354
+ return;
3355
+ }
3356
+ const setterSetVal = () => {
3357
+ const currentValue = ref.$lazyInstance$[memberName];
3358
+ if (!ref.$instanceValues$.get(memberName) && currentValue) {
3359
+ ref.$instanceValues$.set(memberName, currentValue);
3360
+ }
3361
+ ref.$lazyInstance$[memberName] = parsePropertyValue(newValue, memberFlags);
3362
+ setValue(this, memberName, ref.$lazyInstance$[memberName], cmpMeta);
3363
+ };
3364
+ if (ref.$lazyInstance$) {
3365
+ setterSetVal();
3366
+ } else {
3367
+ ref.$onReadyPromise$.then(() => setterSetVal());
3368
+ }
3369
+ }
3370
+ }
3371
+ });
3372
+ } else if (BUILD.lazyLoad && BUILD.method && flags & 1 /* isElementConstructor */ && memberFlags & 64 /* Method */) {
3373
+ Object.defineProperty(prototype, memberName, {
3374
+ value(...args) {
3375
+ var _a2;
3376
+ const ref = getHostRef(this);
3377
+ return (_a2 = ref == null ? void 0 : ref.$onInstancePromise$) == null ? void 0 : _a2.then(() => {
3378
+ var _a3;
3379
+ return (_a3 = ref.$lazyInstance$) == null ? void 0 : _a3[memberName](...args);
3380
+ });
3381
+ }
3382
+ });
3383
+ }
3384
+ });
3385
+ if (BUILD.observeAttribute && (!BUILD.lazyLoad || flags & 1 /* isElementConstructor */)) {
3386
+ const attrNameToPropName = /* @__PURE__ */ new Map();
3387
+ prototype.attributeChangedCallback = function(attrName, oldValue, newValue) {
3388
+ plt.jmp(() => {
3389
+ var _a2;
3390
+ const propName = attrNameToPropName.get(attrName);
3391
+ if (this.hasOwnProperty(propName) && BUILD.lazyLoad) {
3392
+ newValue = this[propName];
3393
+ delete this[propName];
3394
+ } else if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" && // cast type to number to avoid TS compiler issues
3395
+ this[propName] == newValue) {
3396
+ return;
3397
+ } else if (propName == null) {
3398
+ const hostRef = getHostRef(this);
3399
+ const flags2 = hostRef == null ? void 0 : hostRef.$flags$;
3400
+ if (flags2 && !(flags2 & 8 /* isConstructingInstance */) && flags2 & 128 /* isWatchReady */ && newValue !== oldValue) {
3401
+ const elm = BUILD.lazyLoad ? hostRef.$hostElement$ : this;
3402
+ const instance = BUILD.lazyLoad ? hostRef.$lazyInstance$ : elm;
3403
+ const entry = (_a2 = cmpMeta.$watchers$) == null ? void 0 : _a2[attrName];
3404
+ entry == null ? void 0 : entry.forEach((callbackName) => {
3405
+ if (instance[callbackName] != null) {
3406
+ instance[callbackName].call(instance, newValue, oldValue, attrName);
3407
+ }
3408
+ });
3409
+ }
3410
+ return;
3411
+ }
3412
+ const propDesc = Object.getOwnPropertyDescriptor(prototype, propName);
3413
+ newValue = newValue === null && typeof this[propName] === "boolean" ? false : newValue;
3414
+ if (newValue !== this[propName] && (!propDesc.get || !!propDesc.set)) {
3415
+ this[propName] = newValue;
3416
+ }
3417
+ });
3418
+ };
3419
+ Cstr.observedAttributes = Array.from(
3420
+ /* @__PURE__ */ new Set([
3421
+ ...Object.keys((_b = cmpMeta.$watchers$) != null ? _b : {}),
3422
+ ...members.filter(([_, m]) => m[0] & 15 /* HasAttribute */).map(([propName, m]) => {
3423
+ var _a2;
3424
+ const attrName = m[1] || propName;
3425
+ attrNameToPropName.set(attrName, propName);
3426
+ if (BUILD.reflect && m[0] & 512 /* ReflectAttr */) {
3427
+ (_a2 = cmpMeta.$attrsToReflect$) == null ? void 0 : _a2.push([propName, attrName]);
3428
+ }
3429
+ return attrName;
3430
+ })
3431
+ ])
3432
+ );
3433
+ }
3434
+ }
3435
+ return Cstr;
3436
+ };
3437
+
3438
+ // src/runtime/initialize-component.ts
3439
+ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
3440
+ let Cstr;
3441
+ if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
3442
+ hostRef.$flags$ |= 32 /* hasInitializedComponent */;
3443
+ const bundleId = cmpMeta.$lazyBundleId$;
3444
+ if (BUILD.lazyLoad && bundleId) {
3445
+ const CstrImport = loadModule(cmpMeta, hostRef, hmrVersionId);
3446
+ if (CstrImport && "then" in CstrImport) {
3447
+ const endLoad = uniqueTime(
3448
+ `st:load:${cmpMeta.$tagName$}:${hostRef.$modeName$}`,
3449
+ `[Stencil] Load module for <${cmpMeta.$tagName$}>`
3450
+ );
3451
+ Cstr = await CstrImport;
3452
+ endLoad();
3453
+ } else {
3454
+ Cstr = CstrImport;
3455
+ }
3456
+ if (!Cstr) {
3457
+ throw new Error(`Constructor for "${cmpMeta.$tagName$}#${hostRef.$modeName$}" was not found`);
3458
+ }
3459
+ if (BUILD.member && !Cstr.isProxied) {
3460
+ if (BUILD.watchCallback) {
3461
+ cmpMeta.$watchers$ = Cstr.watchers;
3462
+ }
3463
+ proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
3464
+ Cstr.isProxied = true;
3465
+ }
3466
+ const endNewInstance = createTime("createInstance", cmpMeta.$tagName$);
3467
+ if (BUILD.member) {
3468
+ hostRef.$flags$ |= 8 /* isConstructingInstance */;
3469
+ }
3470
+ try {
3471
+ new Cstr(hostRef);
3472
+ } catch (e) {
3473
+ consoleError(e, elm);
3474
+ }
3475
+ if (BUILD.member) {
3476
+ hostRef.$flags$ &= ~8 /* isConstructingInstance */;
3477
+ }
3478
+ if (BUILD.watchCallback) {
3479
+ hostRef.$flags$ |= 128 /* isWatchReady */;
3480
+ }
3481
+ endNewInstance();
3482
+ fireConnectedCallback(hostRef.$lazyInstance$, elm);
3483
+ } else {
3484
+ Cstr = elm.constructor;
3485
+ const cmpTag = elm.localName;
3486
+ customElements.whenDefined(cmpTag).then(() => hostRef.$flags$ |= 128 /* isWatchReady */);
3487
+ }
3488
+ if (BUILD.style && Cstr && Cstr.style) {
3489
+ let style;
3490
+ if (typeof Cstr.style === "string") {
3491
+ style = Cstr.style;
3492
+ } else if (BUILD.mode && typeof Cstr.style !== "string") {
3493
+ hostRef.$modeName$ = computeMode(elm);
3494
+ if (hostRef.$modeName$) {
3495
+ style = Cstr.style[hostRef.$modeName$];
3496
+ }
3497
+ if (BUILD.hydrateServerSide && hostRef.$modeName$) {
3498
+ elm.setAttribute("s-mode", hostRef.$modeName$);
3499
+ }
3500
+ }
3501
+ const scopeId2 = getScopeId(cmpMeta, hostRef.$modeName$);
3502
+ if (!styles.has(scopeId2)) {
3503
+ const endRegisterStyles = createTime("registerStyles", cmpMeta.$tagName$);
3504
+ if (BUILD.hydrateServerSide && BUILD.shadowDom && cmpMeta.$flags$ & 128 /* shadowNeedsScopedCss */) {
3505
+ style = scopeCss(style, scopeId2, true);
3506
+ }
3507
+ registerStyle(scopeId2, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
3508
+ endRegisterStyles();
3509
+ }
3510
+ }
3511
+ }
3512
+ const ancestorComponent = hostRef.$ancestorComponent$;
3513
+ const schedule = () => scheduleUpdate(hostRef, true);
3514
+ if (BUILD.asyncLoading && ancestorComponent && ancestorComponent["s-rc"]) {
3515
+ ancestorComponent["s-rc"].push(schedule);
3516
+ } else {
3517
+ schedule();
3518
+ }
3519
+ };
3520
+ var fireConnectedCallback = (instance, elm) => {
3521
+ if (BUILD.lazyLoad) {
3522
+ safeCall(instance, "connectedCallback", void 0, elm);
3523
+ }
3524
+ };
3525
+
3526
+ // src/runtime/connected-callback.ts
3527
+ var connectedCallback = (elm) => {
3528
+ if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
3529
+ const hostRef = getHostRef(elm);
3530
+ const cmpMeta = hostRef.$cmpMeta$;
3531
+ const endConnected = createTime("connectedCallback", cmpMeta.$tagName$);
3532
+ if (BUILD.hostListenerTargetParent) {
3533
+ addHostEventListeners(elm, hostRef, cmpMeta.$listeners$, true);
3534
+ }
3535
+ if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
3536
+ hostRef.$flags$ |= 1 /* hasConnected */;
3537
+ let hostId;
3538
+ if (BUILD.hydrateClientSide) {
3539
+ hostId = elm.getAttribute(HYDRATE_ID);
3540
+ if (hostId) {
3541
+ if (BUILD.shadowDom && supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
3542
+ const scopeId2 = BUILD.mode ? addStyle(elm.shadowRoot, cmpMeta, elm.getAttribute("s-mode")) : addStyle(elm.shadowRoot, cmpMeta);
3543
+ elm.classList.remove(scopeId2 + "-h", scopeId2 + "-s");
3544
+ } else if (BUILD.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
3545
+ const scopeId2 = getScopeId(cmpMeta, BUILD.mode ? elm.getAttribute("s-mode") : void 0);
3546
+ elm["s-sc"] = scopeId2;
3547
+ }
3548
+ initializeClientHydrate(elm, cmpMeta.$tagName$, hostId, hostRef);
3549
+ }
3550
+ }
3551
+ if (BUILD.slotRelocation && !hostId) {
3552
+ if (BUILD.hydrateServerSide || (BUILD.slot || BUILD.shadowDom) && // TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
3553
+ cmpMeta.$flags$ & (4 /* hasSlotRelocation */ | 8 /* needsShadowDomShim */)) {
3554
+ setContentReference(elm);
3555
+ }
3556
+ }
3557
+ if (BUILD.asyncLoading) {
3558
+ let ancestorComponent = elm;
3559
+ while (ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host) {
3560
+ if (BUILD.hydrateClientSide && ancestorComponent.nodeType === 1 /* ElementNode */ && ancestorComponent.hasAttribute("s-id") && ancestorComponent["s-p"] || ancestorComponent["s-p"]) {
3561
+ attachToAncestor(hostRef, hostRef.$ancestorComponent$ = ancestorComponent);
3562
+ break;
3563
+ }
3564
+ }
3565
+ }
3566
+ if (BUILD.prop && !BUILD.hydrateServerSide && cmpMeta.$members$) {
3567
+ Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
3568
+ if (memberFlags & 31 /* Prop */ && elm.hasOwnProperty(memberName)) {
3569
+ const value = elm[memberName];
3570
+ delete elm[memberName];
3571
+ elm[memberName] = value;
3572
+ }
3573
+ });
3574
+ }
3575
+ if (BUILD.initializeNextTick) {
3576
+ nextTick(() => initializeComponent(elm, hostRef, cmpMeta));
3577
+ } else {
3578
+ initializeComponent(elm, hostRef, cmpMeta);
3579
+ }
3580
+ } else {
3581
+ addHostEventListeners(elm, hostRef, cmpMeta.$listeners$, false);
3582
+ if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
3583
+ fireConnectedCallback(hostRef.$lazyInstance$, elm);
3584
+ } else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
3585
+ hostRef.$onReadyPromise$.then(() => fireConnectedCallback(hostRef.$lazyInstance$, elm));
3586
+ }
3587
+ }
3588
+ endConnected();
3589
+ }
3590
+ };
3591
+ var setContentReference = (elm) => {
3592
+ if (!win.document) {
3593
+ return;
3594
+ }
3595
+ const contentRefElm = elm["s-cr"] = win.document.createComment(
3596
+ BUILD.isDebug ? `content-ref (host=${elm.localName})` : ""
3597
+ );
3598
+ contentRefElm["s-cn"] = true;
3599
+ insertBefore(elm, contentRefElm, elm.firstChild);
3600
+ };
3601
+ var disconnectInstance = (instance, elm) => {
3602
+ if (BUILD.lazyLoad) {
3603
+ safeCall(instance, "disconnectedCallback", void 0, elm || instance);
3604
+ }
3605
+ };
3606
+ var disconnectedCallback = async (elm) => {
3607
+ if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
3608
+ const hostRef = getHostRef(elm);
3609
+ if (BUILD.hostListener) {
3610
+ if (hostRef.$rmListeners$) {
3611
+ hostRef.$rmListeners$.map((rmListener) => rmListener());
3612
+ hostRef.$rmListeners$ = void 0;
3613
+ }
3614
+ }
3615
+ if (!BUILD.lazyLoad) {
3616
+ disconnectInstance(elm);
3617
+ } else if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
3618
+ disconnectInstance(hostRef.$lazyInstance$, elm);
3619
+ } else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
3620
+ hostRef.$onReadyPromise$.then(() => disconnectInstance(hostRef.$lazyInstance$, elm));
3621
+ }
3622
+ }
3623
+ if (rootAppliedStyles.has(elm)) {
3624
+ rootAppliedStyles.delete(elm);
3625
+ }
3626
+ if (elm.shadowRoot && rootAppliedStyles.has(elm.shadowRoot)) {
3627
+ rootAppliedStyles.delete(elm.shadowRoot);
3628
+ }
3629
+ };
3630
+
3631
+ // src/runtime/bootstrap-custom-element.ts
3632
+ var defineCustomElement = (Cstr, compactMeta) => {
3633
+ customElements.define(compactMeta[1], proxyCustomElement(Cstr, compactMeta));
3634
+ };
3635
+ var proxyCustomElement = (Cstr, compactMeta) => {
3636
+ const cmpMeta = {
3637
+ $flags$: compactMeta[0],
3638
+ $tagName$: compactMeta[1]
3639
+ };
3640
+ if (BUILD.member) {
3641
+ cmpMeta.$members$ = compactMeta[2];
3642
+ }
3643
+ if (BUILD.hostListener) {
3644
+ cmpMeta.$listeners$ = compactMeta[3];
3645
+ }
3646
+ if (BUILD.watchCallback) {
3647
+ cmpMeta.$watchers$ = Cstr.$watchers$;
3648
+ }
3649
+ if (BUILD.reflect) {
3650
+ cmpMeta.$attrsToReflect$ = [];
3651
+ }
3652
+ if (BUILD.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
3653
+ cmpMeta.$flags$ |= 8 /* needsShadowDomShim */;
3654
+ }
3655
+ if (BUILD.experimentalSlotFixes) {
3656
+ if (BUILD.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
3657
+ patchPseudoShadowDom(Cstr.prototype);
3658
+ }
3659
+ } else {
3660
+ if (BUILD.slotChildNodesFix) {
3661
+ patchChildSlotNodes(Cstr.prototype);
3662
+ }
3663
+ if (BUILD.cloneNodeFix) {
3664
+ patchCloneNode(Cstr.prototype);
3665
+ }
3666
+ if (BUILD.appendChildSlotFix) {
3667
+ patchSlotAppendChild(Cstr.prototype);
3668
+ }
3669
+ if (BUILD.scopedSlotTextContentFix && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
3670
+ patchTextContent(Cstr.prototype);
3671
+ }
3672
+ }
3673
+ if (BUILD.hydrateClientSide && BUILD.shadowDom) {
3674
+ hydrateScopedToShadow();
3675
+ }
3676
+ const originalConnectedCallback = Cstr.prototype.connectedCallback;
3677
+ const originalDisconnectedCallback = Cstr.prototype.disconnectedCallback;
3678
+ Object.assign(Cstr.prototype, {
3679
+ __hasHostListenerAttached: false,
3680
+ __registerHost() {
3681
+ registerHost(this, cmpMeta);
3682
+ },
3683
+ connectedCallback() {
3684
+ if (!this.__hasHostListenerAttached) {
3685
+ const hostRef = getHostRef(this);
3686
+ addHostEventListeners(this, hostRef, cmpMeta.$listeners$, false);
3687
+ this.__hasHostListenerAttached = true;
3688
+ }
3689
+ connectedCallback(this);
3690
+ if (originalConnectedCallback) {
3691
+ originalConnectedCallback.call(this);
3692
+ }
3693
+ },
3694
+ disconnectedCallback() {
3695
+ disconnectedCallback(this);
3696
+ if (originalDisconnectedCallback) {
3697
+ originalDisconnectedCallback.call(this);
3698
+ }
3699
+ },
3700
+ __attachShadow() {
3701
+ if (supportsShadow) {
3702
+ if (!this.shadowRoot) {
3703
+ if (BUILD.shadowDelegatesFocus) {
3704
+ this.attachShadow({
3705
+ mode: "open",
3706
+ delegatesFocus: !!(cmpMeta.$flags$ & 16 /* shadowDelegatesFocus */)
3707
+ });
3708
+ } else {
3709
+ this.attachShadow({ mode: "open" });
3710
+ }
3711
+ } else {
3712
+ if (this.shadowRoot.mode !== "open") {
3713
+ throw new Error(
3714
+ `Unable to re-use existing shadow root for ${cmpMeta.$tagName$}! Mode is set to ${this.shadowRoot.mode} but Stencil only supports open shadow roots.`
3715
+ );
3716
+ }
3717
+ }
3718
+ } else {
3719
+ this.shadowRoot = this;
3720
+ }
3721
+ }
3722
+ });
3723
+ Cstr.is = cmpMeta.$tagName$;
3724
+ return proxyComponent(Cstr, cmpMeta, 1 /* isElementConstructor */ | 2 /* proxyState */);
3725
+ };
3726
+ var forceModeUpdate = (elm) => {
3727
+ if (BUILD.style && BUILD.mode && !BUILD.lazyLoad) {
3728
+ const mode = computeMode(elm);
3729
+ const hostRef = getHostRef(elm);
3730
+ if (hostRef.$modeName$ !== mode) {
3731
+ const cmpMeta = hostRef.$cmpMeta$;
3732
+ const oldScopeId = elm["s-sc"];
3733
+ const scopeId2 = getScopeId(cmpMeta, mode);
3734
+ const style = elm.constructor.style[mode];
3735
+ const flags = cmpMeta.$flags$;
3736
+ if (style) {
3737
+ if (!styles.has(scopeId2)) {
3738
+ registerStyle(scopeId2, style, !!(flags & 1 /* shadowDomEncapsulation */));
3739
+ }
3740
+ hostRef.$modeName$ = mode;
3741
+ elm.classList.remove(oldScopeId + "-h", oldScopeId + "-s");
3742
+ attachStyles(hostRef);
3743
+ forceUpdate(elm);
3744
+ }
3745
+ }
3746
+ }
3747
+ };
3748
+
3749
+ // src/runtime/hmr-component.ts
3750
+ var hmrStart = (hostElement, cmpMeta, hmrVersionId) => {
3751
+ const hostRef = getHostRef(hostElement);
3752
+ hostRef.$flags$ = 1 /* hasConnected */;
3753
+ initializeComponent(hostElement, hostRef, cmpMeta, hmrVersionId);
3754
+ };
3755
+
3756
+ // src/runtime/bootstrap-lazy.ts
3757
+ var bootstrapLazy = (lazyBundles, options = {}) => {
3758
+ var _a;
3759
+ if (BUILD.profile && performance.mark) {
3760
+ performance.mark("st:app:start");
3761
+ }
3762
+ installDevTools();
3763
+ if (!win.document) {
3764
+ console.warn("Stencil: No document found. Skipping bootstrapping lazy components.");
3765
+ return;
3766
+ }
3767
+ const endBootstrap = createTime("bootstrapLazy");
3768
+ const cmpTags = [];
3769
+ const exclude = options.exclude || [];
3770
+ const customElements2 = win.customElements;
3771
+ const head = win.document.head;
3772
+ const metaCharset = /* @__PURE__ */ head.querySelector("meta[charset]");
3773
+ const dataStyles = /* @__PURE__ */ win.document.createElement("style");
3774
+ const deferredConnectedCallbacks = [];
3775
+ let appLoadFallback;
3776
+ let isBootstrapping = true;
3777
+ Object.assign(plt, options);
3778
+ plt.$resourcesUrl$ = new URL(options.resourcesUrl || "./", win.document.baseURI).href;
3779
+ if (BUILD.asyncQueue) {
3780
+ if (options.syncQueue) {
3781
+ plt.$flags$ |= 4 /* queueSync */;
3782
+ }
3783
+ }
3784
+ if (BUILD.hydrateClientSide) {
3785
+ plt.$flags$ |= 2 /* appLoaded */;
3786
+ }
3787
+ if (BUILD.hydrateClientSide && BUILD.shadowDom) {
3788
+ hydrateScopedToShadow();
3789
+ }
3790
+ let hasSlotRelocation = false;
3791
+ lazyBundles.map((lazyBundle) => {
3792
+ lazyBundle[1].map((compactMeta) => {
3793
+ var _a2;
3794
+ const cmpMeta = {
3795
+ $flags$: compactMeta[0],
3796
+ $tagName$: compactMeta[1],
3797
+ $members$: compactMeta[2],
3798
+ $listeners$: compactMeta[3]
3799
+ };
3800
+ if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
3801
+ hasSlotRelocation = true;
3802
+ }
3803
+ if (BUILD.member) {
3804
+ cmpMeta.$members$ = compactMeta[2];
3805
+ }
3806
+ if (BUILD.hostListener) {
3807
+ cmpMeta.$listeners$ = compactMeta[3];
3808
+ }
3809
+ if (BUILD.reflect) {
3810
+ cmpMeta.$attrsToReflect$ = [];
3811
+ }
3812
+ if (BUILD.watchCallback) {
3813
+ cmpMeta.$watchers$ = (_a2 = compactMeta[4]) != null ? _a2 : {};
3814
+ }
3815
+ if (BUILD.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
3816
+ cmpMeta.$flags$ |= 8 /* needsShadowDomShim */;
3817
+ }
3818
+ const tagName = BUILD.transformTagName && options.transformTagName ? options.transformTagName(cmpMeta.$tagName$) : cmpMeta.$tagName$;
3819
+ const HostElement = class extends HTMLElement {
3820
+ // StencilLazyHost
3821
+ constructor(self) {
3822
+ super(self);
3823
+ this.hasRegisteredEventListeners = false;
3824
+ self = this;
3825
+ registerHost(self, cmpMeta);
3826
+ if (BUILD.shadowDom && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
3827
+ if (supportsShadow) {
3828
+ if (!self.shadowRoot) {
3829
+ if (BUILD.shadowDelegatesFocus) {
3830
+ self.attachShadow({
3831
+ mode: "open",
3832
+ delegatesFocus: !!(cmpMeta.$flags$ & 16 /* shadowDelegatesFocus */)
3833
+ });
3834
+ } else {
3835
+ self.attachShadow({ mode: "open" });
3836
+ }
3837
+ } else {
3838
+ if (self.shadowRoot.mode !== "open") {
3839
+ throw new Error(
3840
+ `Unable to re-use existing shadow root for ${cmpMeta.$tagName$}! Mode is set to ${self.shadowRoot.mode} but Stencil only supports open shadow roots.`
3841
+ );
3842
+ }
3843
+ }
3844
+ } else if (!BUILD.hydrateServerSide && !("shadowRoot" in self)) {
3845
+ self.shadowRoot = self;
3846
+ }
3847
+ }
3848
+ }
3849
+ connectedCallback() {
3850
+ const hostRef = getHostRef(this);
3851
+ if (!this.hasRegisteredEventListeners) {
3852
+ this.hasRegisteredEventListeners = true;
3853
+ addHostEventListeners(this, hostRef, cmpMeta.$listeners$, false);
3854
+ }
3855
+ if (appLoadFallback) {
3856
+ clearTimeout(appLoadFallback);
3857
+ appLoadFallback = null;
3858
+ }
3859
+ if (isBootstrapping) {
3860
+ deferredConnectedCallbacks.push(this);
3861
+ } else {
3862
+ plt.jmp(() => connectedCallback(this));
3863
+ }
3864
+ }
3865
+ disconnectedCallback() {
3866
+ plt.jmp(() => disconnectedCallback(this));
3867
+ plt.raf(() => {
3868
+ var _a3;
3869
+ const hostRef = getHostRef(this);
3870
+ const i2 = deferredConnectedCallbacks.findIndex((host) => host === this);
3871
+ if (i2 > -1) {
3872
+ deferredConnectedCallbacks.splice(i2, 1);
3873
+ }
3874
+ if (((_a3 = hostRef == null ? void 0 : hostRef.$vnode$) == null ? void 0 : _a3.$elm$) instanceof Node && !hostRef.$vnode$.$elm$.isConnected) {
3875
+ delete hostRef.$vnode$.$elm$;
3876
+ }
3877
+ });
3878
+ }
3879
+ componentOnReady() {
3880
+ return getHostRef(this).$onReadyPromise$;
3881
+ }
3882
+ };
3883
+ if (BUILD.experimentalSlotFixes) {
3884
+ if (BUILD.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
3885
+ patchPseudoShadowDom(HostElement.prototype);
3886
+ }
3887
+ } else {
3888
+ if (BUILD.slotChildNodesFix) {
3889
+ patchChildSlotNodes(HostElement.prototype);
3890
+ }
3891
+ if (BUILD.cloneNodeFix) {
3892
+ patchCloneNode(HostElement.prototype);
3893
+ }
3894
+ if (BUILD.appendChildSlotFix) {
3895
+ patchSlotAppendChild(HostElement.prototype);
3896
+ }
3897
+ if (BUILD.scopedSlotTextContentFix && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
3898
+ patchTextContent(HostElement.prototype);
3899
+ }
3900
+ }
3901
+ if (BUILD.formAssociated && cmpMeta.$flags$ & 64 /* formAssociated */) {
3902
+ HostElement.formAssociated = true;
3903
+ }
3904
+ if (BUILD.hotModuleReplacement) {
3905
+ HostElement.prototype["s-hmr"] = function(hmrVersionId) {
3906
+ hmrStart(this, cmpMeta, hmrVersionId);
3907
+ };
3908
+ }
3909
+ cmpMeta.$lazyBundleId$ = lazyBundle[0];
3910
+ if (!exclude.includes(tagName) && !customElements2.get(tagName)) {
3911
+ cmpTags.push(tagName);
3912
+ customElements2.define(
3913
+ tagName,
3914
+ proxyComponent(HostElement, cmpMeta, 1 /* isElementConstructor */)
3915
+ );
3916
+ }
3917
+ });
3918
+ });
3919
+ if (cmpTags.length > 0) {
3920
+ if (hasSlotRelocation) {
3921
+ dataStyles.textContent += SLOT_FB_CSS;
3922
+ }
3923
+ if (BUILD.invisiblePrehydration && (BUILD.hydratedClass || BUILD.hydratedAttribute)) {
3924
+ dataStyles.textContent += cmpTags.sort() + HYDRATED_CSS;
3925
+ }
3926
+ if (dataStyles.innerHTML.length) {
3927
+ dataStyles.setAttribute("data-styles", "");
3928
+ const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
3929
+ if (nonce != null) {
3930
+ dataStyles.setAttribute("nonce", nonce);
3931
+ }
3932
+ head.insertBefore(dataStyles, metaCharset ? metaCharset.nextSibling : head.firstChild);
3933
+ }
3934
+ }
3935
+ isBootstrapping = false;
3936
+ if (deferredConnectedCallbacks.length) {
3937
+ deferredConnectedCallbacks.map((host) => host.connectedCallback());
3938
+ } else {
3939
+ if (BUILD.profile) {
3940
+ plt.jmp(() => appLoadFallback = setTimeout(appDidLoad, 30, "timeout"));
3941
+ } else {
3942
+ plt.jmp(() => appLoadFallback = setTimeout(appDidLoad, 30));
3943
+ }
3944
+ }
3945
+ endBootstrap();
3946
+ };
3947
+
3948
+ // src/runtime/fragment.ts
3949
+ var Fragment = (_, children) => children;
3950
+ var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
3951
+ if (BUILD.hostListener && listeners && win.document) {
3952
+ if (BUILD.hostListenerTargetParent) {
3953
+ if (attachParentListeners) {
3954
+ listeners = listeners.filter(([flags]) => flags & 32 /* TargetParent */);
3955
+ } else {
3956
+ listeners = listeners.filter(([flags]) => !(flags & 32 /* TargetParent */));
3957
+ }
3958
+ }
3959
+ listeners.map(([flags, name, method]) => {
3960
+ const target = BUILD.hostListenerTarget ? getHostListenerTarget(win.document, elm, flags) : elm;
3961
+ const handler = hostListenerProxy(hostRef, method);
3962
+ const opts = hostListenerOpts(flags);
3963
+ plt.ael(target, name, handler, opts);
3964
+ (hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
3965
+ });
3966
+ }
3967
+ };
3968
+ var hostListenerProxy = (hostRef, methodName) => (ev) => {
3969
+ var _a;
3970
+ try {
3971
+ if (BUILD.lazyLoad) {
3972
+ if (hostRef.$flags$ & 256 /* isListenReady */) {
3973
+ (_a = hostRef.$lazyInstance$) == null ? void 0 : _a[methodName](ev);
3974
+ } else {
3975
+ (hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
3976
+ }
3977
+ } else {
3978
+ hostRef.$hostElement$[methodName](ev);
3979
+ }
3980
+ } catch (e) {
3981
+ consoleError(e, hostRef.$hostElement$);
3982
+ }
3983
+ };
3984
+ var getHostListenerTarget = (doc, elm, flags) => {
3985
+ if (BUILD.hostListenerTargetDocument && flags & 4 /* TargetDocument */) {
3986
+ return doc;
3987
+ }
3988
+ if (BUILD.hostListenerTargetWindow && flags & 8 /* TargetWindow */) {
3989
+ return win;
3990
+ }
3991
+ if (BUILD.hostListenerTargetBody && flags & 16 /* TargetBody */) {
3992
+ return doc.body;
3993
+ }
3994
+ if (BUILD.hostListenerTargetParent && flags & 32 /* TargetParent */ && elm.parentElement) {
3995
+ return elm.parentElement;
3996
+ }
3997
+ return elm;
3998
+ };
3999
+ var hostListenerOpts = (flags) => supportsListenerOptions ? {
4000
+ passive: (flags & 1 /* Passive */) !== 0,
4001
+ capture: (flags & 2 /* Capture */) !== 0
4002
+ } : (flags & 2 /* Capture */) !== 0;
4003
+
4004
+ // src/runtime/nonce.ts
4005
+ var setNonce = (nonce) => plt.$nonce$ = nonce;
4006
+
4007
+ // src/runtime/platform-options.ts
4008
+ var setPlatformOptions = (opts) => Object.assign(plt, opts);
4009
+
4010
+ // src/runtime/render.ts
4011
+ function render(vnode, container) {
4012
+ const cmpMeta = {
4013
+ $flags$: 0,
4014
+ $tagName$: container.tagName
4015
+ };
4016
+ const ref = {
4017
+ $flags$: 0,
4018
+ $cmpMeta$: cmpMeta,
4019
+ $hostElement$: container
4020
+ };
4021
+ renderVdom(ref, vnode);
4022
+ }
4023
+
4024
+ // src/runtime/vdom/vdom-annotations.ts
4025
+ var insertVdomAnnotations = (doc, staticComponents) => {
4026
+ if (doc != null) {
4027
+ const docData = STENCIL_DOC_DATA in doc ? doc[STENCIL_DOC_DATA] : { ...DEFAULT_DOC_DATA };
4028
+ docData.staticComponents = new Set(staticComponents);
4029
+ const orgLocationNodes = [];
4030
+ parseVNodeAnnotations(doc, doc.body, docData, orgLocationNodes);
4031
+ orgLocationNodes.forEach((orgLocationNode) => {
4032
+ var _a;
4033
+ if (orgLocationNode != null && orgLocationNode["s-nr"]) {
4034
+ const nodeRef = orgLocationNode["s-nr"];
4035
+ let hostId = nodeRef["s-host-id"];
4036
+ let nodeId = nodeRef["s-node-id"];
4037
+ let childId = `${hostId}.${nodeId}`;
4038
+ if (hostId == null) {
4039
+ hostId = 0;
4040
+ docData.rootLevelIds++;
4041
+ nodeId = docData.rootLevelIds;
4042
+ childId = `${hostId}.${nodeId}`;
4043
+ if (nodeRef.nodeType === 1 /* ElementNode */) {
4044
+ nodeRef.setAttribute(HYDRATE_CHILD_ID, childId);
4045
+ if (typeof nodeRef["s-sn"] === "string" && !nodeRef.getAttribute("slot")) {
4046
+ nodeRef.setAttribute("s-sn", nodeRef["s-sn"]);
4047
+ }
4048
+ } else if (nodeRef.nodeType === 3 /* TextNode */) {
4049
+ if (hostId === 0) {
4050
+ const textContent = (_a = nodeRef.nodeValue) == null ? void 0 : _a.trim();
4051
+ if (textContent === "") {
4052
+ orgLocationNode.remove();
4053
+ return;
4054
+ }
4055
+ }
4056
+ const commentBeforeTextNode = doc.createComment(childId);
4057
+ commentBeforeTextNode.nodeValue = `${TEXT_NODE_ID}.${childId}`;
4058
+ insertBefore(nodeRef.parentNode, commentBeforeTextNode, nodeRef);
4059
+ } else if (nodeRef.nodeType === 8 /* CommentNode */) {
4060
+ const commentBeforeTextNode = doc.createComment(childId);
4061
+ commentBeforeTextNode.nodeValue = `${COMMENT_NODE_ID}.${childId}`;
4062
+ nodeRef.parentNode.insertBefore(commentBeforeTextNode, nodeRef);
4063
+ }
4064
+ }
4065
+ let orgLocationNodeId = `${ORG_LOCATION_ID}.${childId}`;
4066
+ const orgLocationParentNode = orgLocationNode.parentElement;
4067
+ if (orgLocationParentNode) {
4068
+ if (orgLocationParentNode["s-en"] === "") {
4069
+ orgLocationNodeId += `.`;
4070
+ } else if (orgLocationParentNode["s-en"] === "c") {
4071
+ orgLocationNodeId += `.c`;
4072
+ }
4073
+ }
4074
+ orgLocationNode.nodeValue = orgLocationNodeId;
4075
+ }
4076
+ });
4077
+ }
4078
+ };
4079
+ var parseVNodeAnnotations = (doc, node, docData, orgLocationNodes) => {
4080
+ var _a;
4081
+ if (node == null) {
4082
+ return;
4083
+ }
4084
+ if (node["s-nr"] != null) {
4085
+ orgLocationNodes.push(node);
4086
+ }
4087
+ if (node.nodeType === 1 /* ElementNode */) {
4088
+ const childNodes = [...Array.from(node.childNodes), ...Array.from(((_a = node.shadowRoot) == null ? void 0 : _a.childNodes) || [])];
4089
+ childNodes.forEach((childNode) => {
4090
+ const hostRef = getHostRef(childNode);
4091
+ if (hostRef != null && !docData.staticComponents.has(childNode.nodeName.toLowerCase())) {
4092
+ const cmpData = {
4093
+ nodeIds: 0
4094
+ };
4095
+ insertVNodeAnnotations(doc, childNode, hostRef.$vnode$, docData, cmpData);
4096
+ }
4097
+ parseVNodeAnnotations(doc, childNode, docData, orgLocationNodes);
4098
+ });
4099
+ }
4100
+ };
4101
+ var insertVNodeAnnotations = (doc, hostElm, vnode, docData, cmpData) => {
4102
+ if (vnode != null) {
4103
+ const hostId = ++docData.hostIds;
4104
+ hostElm.setAttribute(HYDRATE_ID, hostId);
4105
+ if (hostElm["s-cr"] != null) {
4106
+ hostElm["s-cr"].nodeValue = `${CONTENT_REF_ID}.${hostId}`;
4107
+ }
4108
+ if (vnode.$children$ != null) {
4109
+ const depth = 0;
4110
+ vnode.$children$.forEach((vnodeChild, index) => {
4111
+ insertChildVNodeAnnotations(doc, vnodeChild, cmpData, hostId, depth, index);
4112
+ });
4113
+ }
4114
+ if (hostElm && vnode && vnode.$elm$ && !hostElm.hasAttribute(HYDRATE_CHILD_ID)) {
4115
+ const parent = hostElm.parentElement;
4116
+ if (parent && parent.childNodes) {
4117
+ const parentChildNodes = Array.from(parent.childNodes);
4118
+ const comment = parentChildNodes.find(
4119
+ (node) => node.nodeType === 8 /* CommentNode */ && node["s-sr"]
4120
+ );
4121
+ if (comment) {
4122
+ const index = parentChildNodes.indexOf(hostElm) - 1;
4123
+ vnode.$elm$.setAttribute(
4124
+ HYDRATE_CHILD_ID,
4125
+ `${comment["s-host-id"]}.${comment["s-node-id"]}.0.${index}`
4126
+ );
4127
+ }
4128
+ }
4129
+ }
4130
+ }
4131
+ };
4132
+ var insertChildVNodeAnnotations = (doc, vnodeChild, cmpData, hostId, depth, index) => {
4133
+ const childElm = vnodeChild.$elm$;
4134
+ if (childElm == null) {
4135
+ return;
4136
+ }
4137
+ const nodeId = cmpData.nodeIds++;
4138
+ const childId = `${hostId}.${nodeId}.${depth}.${index}`;
4139
+ childElm["s-host-id"] = hostId;
4140
+ childElm["s-node-id"] = nodeId;
4141
+ if (childElm.nodeType === 1 /* ElementNode */) {
4142
+ childElm.setAttribute(HYDRATE_CHILD_ID, childId);
4143
+ if (typeof childElm["s-sn"] === "string" && !childElm.getAttribute("slot")) {
4144
+ childElm.setAttribute("s-sn", childElm["s-sn"]);
4145
+ }
4146
+ } else if (childElm.nodeType === 3 /* TextNode */) {
4147
+ const parentNode = childElm.parentNode;
4148
+ const nodeName = parentNode == null ? void 0 : parentNode.nodeName;
4149
+ if (nodeName !== "STYLE" && nodeName !== "SCRIPT") {
4150
+ const textNodeId = `${TEXT_NODE_ID}.${childId}`;
4151
+ const commentBeforeTextNode = doc.createComment(textNodeId);
4152
+ insertBefore(parentNode, commentBeforeTextNode, childElm);
4153
+ }
4154
+ } else if (childElm.nodeType === 8 /* CommentNode */) {
4155
+ if (childElm["s-sr"]) {
4156
+ const slotName = childElm["s-sn"] || "";
4157
+ const slotNodeId = `${SLOT_NODE_ID}.${childId}.${slotName}`;
4158
+ childElm.nodeValue = slotNodeId;
4159
+ }
4160
+ }
4161
+ if (vnodeChild.$children$ != null) {
4162
+ const childDepth = depth + 1;
4163
+ vnodeChild.$children$.forEach((vnode, index2) => {
4164
+ insertChildVNodeAnnotations(doc, vnode, cmpData, hostId, childDepth, index2);
4165
+ });
4166
+ }
4167
+ };
4168
+
4169
+ export { BUILD as B, Env as E, H, NAMESPACE as N, getAssetPath as a, bootstrapLazy as b, consoleDevInfo as c, createEvent as d, getRenderingRef as e, forceUpdate as f, getElement as g, h, promiseResolve as p, registerInstance as r, setNonce as s, win as w };
4170
+ //# sourceMappingURL=index-ICfDNUMe.js.map
4171
+
4172
+ //# sourceMappingURL=index-ICfDNUMe.js.map