vviinn-widgets 2.1.0 → 2.2.2

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 (307) hide show
  1. package/dist/cjs/Handler-d1a8a86a.js +329 -0
  2. package/dist/{vviinn-widgets/app-globals-e0943e34.js → cjs/app-globals-30781f30.js} +15 -925
  3. package/{www/build/cropper-handler.entry.js → dist/cjs/cropper-handler.cjs.entry.js} +11 -7
  4. package/dist/{vviinn-widgets/customized-slots-f3449695.js → cjs/customized-slots-5d904d8e.js} +6 -3
  5. package/dist/cjs/highlight-box_22.cjs.entry.js +737 -0
  6. package/{www/build/imageSearch.store-407f49f0.js → dist/cjs/imageSearch.store-128957a4.js} +11573 -11902
  7. package/dist/cjs/index-741a970d.js +1354 -0
  8. package/dist/cjs/index-c493804d.js +41 -0
  9. package/dist/cjs/index.cjs.js +2 -0
  10. package/dist/cjs/loader.cjs.js +23 -0
  11. package/dist/cjs/vviinn-carousel_5.cjs.entry.js +1232 -0
  12. package/dist/{vviinn-widgets/vviinn-error.entry.js → cjs/vviinn-error.cjs.entry.js} +8 -4
  13. package/{www/build/vviinn-preloader.entry.js → dist/cjs/vviinn-preloader.cjs.entry.js} +11 -10
  14. package/dist/cjs/vviinn-vps-button.cjs.entry.js +43 -0
  15. package/{www/build/vviinn-vps-widget.entry.js → dist/cjs/vviinn-vps-widget.cjs.entry.js} +31 -30
  16. package/dist/cjs/vviinn-widgets.cjs.js +21 -0
  17. package/dist/collection/Image/error.js +14 -0
  18. package/dist/collection/Image/form.js +5 -0
  19. package/dist/collection/Image/fromFile.js +18 -0
  20. package/dist/collection/Image/imageToB64.js +9 -0
  21. package/dist/collection/Image/index.js +0 -0
  22. package/dist/collection/Image/renderPromise.js +6 -0
  23. package/dist/collection/Image/resizeImage.js +28 -0
  24. package/dist/collection/Image/sizing.js +39 -0
  25. package/dist/collection/Image/toFile.js +17 -0
  26. package/dist/collection/analytics/GAnalytics.js +32 -0
  27. package/dist/collection/analytics/GeneralAnalytics.js +9 -0
  28. package/dist/collection/analytics/GtagAnalytics.js +35 -0
  29. package/dist/collection/analytics/ProductAnalytics.js +1 -0
  30. package/dist/collection/campaign/Campaign.js +8 -0
  31. package/dist/collection/campaign/CampaignService.js +5 -0
  32. package/dist/collection/campaign/VCSCampaign.js +1 -0
  33. package/dist/collection/campaign/VCSCampaignResponse.js +1 -0
  34. package/dist/collection/campaign/VCSCampaignService.js +5 -0
  35. package/dist/collection/campaign/VPRCampaignResponse.js +1 -0
  36. package/dist/collection/campaign/VPRCampaignService.js +5 -0
  37. package/dist/collection/collection-manifest.json +43 -0
  38. package/dist/collection/components/customized-slots.js +47 -0
  39. package/dist/collection/components/image-search/image-view/highlight-box/highlight-box.css +71 -0
  40. package/dist/collection/components/image-search/image-view/highlight-box/highlight-box.js +25 -0
  41. package/dist/collection/components/image-search/image-view/image-cropper/cropper-handler/cropper-handler.css +49 -0
  42. package/dist/collection/components/image-search/image-view/image-cropper/cropper-handler/cropper-handler.js +64 -0
  43. package/dist/collection/components/image-search/image-view/image-cropper/image-cropper.css +33 -0
  44. package/dist/{vviinn-widgets/image-cropper.entry.js → collection/components/image-search/image-view/image-cropper/image-cropper.js} +54 -32
  45. package/dist/collection/components/image-search/search-filters/search-filters.css +120 -0
  46. package/dist/collection/components/image-search/search-filters/search-filters.js +102 -0
  47. package/dist/collection/components/vviinn-carousel/vviinn-carousel.css +138 -0
  48. package/{www/build/vviinn-carousel.entry.js → dist/collection/components/vviinn-carousel/vviinn-carousel.js} +115 -18
  49. package/dist/collection/components/vviinn-error/vviinn-empty-results/vviinn-empty-results.css +7 -0
  50. package/dist/collection/components/vviinn-error/vviinn-empty-results/vviinn-empty-results.js +36 -0
  51. package/dist/collection/components/vviinn-error/vviinn-error.css +38 -0
  52. package/dist/collection/components/vviinn-error/vviinn-error.js +18 -0
  53. package/dist/collection/components/vviinn-error/vviinn-server-error/vviinn-server-error.css +3 -0
  54. package/dist/collection/components/vviinn-error/vviinn-server-error/vviinn-server-error.js +34 -0
  55. package/dist/collection/components/vviinn-error/vviinn-wrong-format/vviinn-wrong-format.css +3 -0
  56. package/dist/collection/components/vviinn-error/vviinn-wrong-format/vviinn-wrong-format.js +34 -0
  57. package/dist/collection/components/vviinn-example-images/vviinn-example-image/vviinn-example-image.css +34 -0
  58. package/dist/collection/components/vviinn-example-images/vviinn-example-image/vviinn-example-image.js +129 -0
  59. package/dist/collection/components/vviinn-example-images/vviinn-example-images.css +19 -0
  60. package/dist/collection/components/vviinn-example-images/vviinn-example-images.js +80 -0
  61. package/dist/{vviinn-widgets/index-c9483145.js → collection/components/vviinn-icons/index.js} +13 -12
  62. package/dist/collection/components/vviinn-image-selector/vviinn-image-selector.css +25 -0
  63. package/dist/collection/components/vviinn-image-selector/vviinn-image-selector.js +64 -0
  64. package/dist/collection/components/vviinn-image-view/vviinn-detected-object/vviinn-detected-object.css +47 -0
  65. package/dist/collection/components/vviinn-image-view/vviinn-detected-object/vviinn-detected-object.js +83 -0
  66. package/dist/collection/components/vviinn-image-view/vviinn-image-view.css +31 -0
  67. package/dist/collection/components/vviinn-image-view/vviinn-image-view.js +61 -0
  68. package/dist/collection/components/vviinn-modal/vviinn-modal.css +105 -0
  69. package/dist/collection/components/vviinn-modal/vviinn-modal.js +98 -0
  70. package/dist/collection/components/vviinn-onboarding/onboarding-cards/onboarding-card.css +41 -0
  71. package/dist/collection/components/vviinn-onboarding/onboarding-cards/vviinn-onboarding-card-1/vviinn-onboarding-card-1.js +26 -0
  72. package/dist/collection/components/vviinn-onboarding/onboarding-cards/vviinn-onboarding-card-2/vviinn-onboarding-card-2.js +26 -0
  73. package/dist/collection/components/vviinn-onboarding/onboarding-cards/vviinn-onboarding-card-3/vviinn-onboarding-card-3.js +26 -0
  74. package/dist/collection/components/vviinn-onboarding/vviinn-onboarding.css +58 -0
  75. package/dist/collection/components/vviinn-onboarding/vviinn-onboarding.js +28 -0
  76. package/dist/collection/components/vviinn-overlay/vviinn-overlay.css +33 -0
  77. package/dist/collection/components/vviinn-overlay/vviinn-overlay.js +15 -0
  78. package/dist/collection/components/vviinn-overlayed-modal/vviinn-overlayed-modal.css +29 -0
  79. package/dist/collection/components/vviinn-overlayed-modal/vviinn-overlayed-modal.js +71 -0
  80. package/dist/collection/components/vviinn-preloader/vviinn-preloader.css +37 -0
  81. package/dist/collection/components/vviinn-preloader/vviinn-preloader.js +20 -0
  82. package/dist/collection/components/vviinn-privacy-badge/vviinn-privacy-badge.css +19 -0
  83. package/dist/collection/components/vviinn-privacy-badge/vviinn-privacy-badge.js +27 -0
  84. package/dist/collection/components/vviinn-product-card/render-helpers.js +32 -0
  85. package/dist/collection/components/vviinn-product-card/vviinn-product-card.css +95 -0
  86. package/dist/collection/components/vviinn-product-card/vviinn-product-card.js +425 -0
  87. package/dist/collection/components/vviinn-slider/arrow.js +11 -0
  88. package/dist/collection/components/vviinn-slider/vviinn-slide/vviinn-slide.css +4 -0
  89. package/dist/collection/components/vviinn-slider/vviinn-slide/vviinn-slide.js +15 -0
  90. package/dist/collection/components/vviinn-slider/vviinn-slider.css +109 -0
  91. package/dist/collection/components/vviinn-slider/vviinn-slider.js +181 -0
  92. package/dist/collection/components/vviinn-teaser/vviinn-teaser.css +14 -0
  93. package/dist/collection/components/vviinn-teaser/vviinn-teaser.js +29 -0
  94. package/dist/collection/components/vviinn-vpr-button/recommendations-sidebar/recommendations-sidebar.css +238 -0
  95. package/dist/collection/components/vviinn-vpr-button/recommendations-sidebar/recommendations-sidebar.js +200 -0
  96. package/dist/collection/components/vviinn-vpr-button/stories/kek.stories.js +18 -0
  97. package/dist/collection/components/vviinn-vpr-button/vviinn-vpr-button.css +35 -0
  98. package/dist/collection/components/vviinn-vpr-button/vviinn-vpr-button.js +149 -0
  99. package/dist/collection/components/vviinn-vpr-widget/GridMode.js +1 -0
  100. package/dist/collection/components/vviinn-vpr-widget/token-helpers.js +11 -0
  101. package/dist/collection/components/vviinn-vpr-widget/vviinn-vpr-vidget.js +441 -0
  102. package/dist/collection/components/vviinn-vpr-widget/vviinn-vpr-widget.css +74 -0
  103. package/dist/collection/components/vviinn-vps-button/vviinn-vps-button.css +0 -0
  104. package/dist/collection/components/vviinn-vps-button/vviinn-vps-button.js +177 -0
  105. package/dist/collection/components/vviinn-vps-widget/vviinn-vps-widget.css +350 -0
  106. package/dist/collection/components/vviinn-vps-widget/vviinn-vps-widget.js +247 -0
  107. package/dist/collection/cropper/Cropper.js +1 -0
  108. package/dist/collection/cropper/Handler.js +61 -0
  109. package/dist/collection/dom/index.js +3 -0
  110. package/dist/collection/error.js +14 -0
  111. package/dist/collection/file/index.js +4 -0
  112. package/dist/collection/geometry/Clip.js +14 -0
  113. package/dist/collection/geometry/Point.js +32 -0
  114. package/dist/collection/geometry/Rectangle.js +95 -0
  115. package/dist/collection/geometry/RectangleAlt.js +1 -0
  116. package/dist/collection/geometry/Sized.js +8 -0
  117. package/dist/collection/global.js +19 -0
  118. package/dist/collection/index.js +1 -0
  119. package/dist/collection/interfaces/generated.js +5 -0
  120. package/dist/collection/interfaces/recommendation.js +1 -0
  121. package/dist/collection/network/apiClient.js +9 -0
  122. package/dist/collection/network/ion/File.js +14 -0
  123. package/dist/collection/network/ion/Form.js +64 -0
  124. package/dist/collection/network/ion/Link.js +8 -0
  125. package/dist/collection/network/ion/ValueObject.js +23 -0
  126. package/dist/collection/network/request.js +19 -0
  127. package/dist/collection/network/utils.js +37 -0
  128. package/dist/collection/recommendation/recommendation.js +1 -0
  129. package/dist/collection/searchSession/searchSession.js +26 -0
  130. package/dist/collection/sentry.js +14 -0
  131. package/dist/collection/slider/GridMode.js +1 -0
  132. package/dist/collection/store/file-processing.js +13 -0
  133. package/dist/collection/store/imageSearch.store.js +138 -0
  134. package/dist/collection/store/store.js +11 -0
  135. package/dist/collection/stories/Button.js +21 -0
  136. package/dist/collection/stories/Button.stories.js +42 -0
  137. package/dist/collection/stories/Header.js +45 -0
  138. package/dist/collection/stories/Header.stories.js +15 -0
  139. package/dist/collection/stories/Page.js +61 -0
  140. package/dist/collection/stories/Page.stories.js +19 -0
  141. package/dist/collection/stories/assets/code-brackets.svg +1 -0
  142. package/dist/collection/stories/assets/colors.svg +1 -0
  143. package/dist/collection/stories/assets/comments.svg +1 -0
  144. package/dist/collection/stories/assets/direction.svg +1 -0
  145. package/dist/collection/stories/assets/flow.svg +1 -0
  146. package/dist/collection/stories/assets/plugin.svg +1 -0
  147. package/dist/collection/stories/assets/repo.svg +1 -0
  148. package/dist/collection/stories/assets/stackalt.svg +1 -0
  149. package/dist/collection/stories/image-selector.stories.js +6 -0
  150. package/dist/collection/stories/image-view.stories.js +6 -0
  151. package/dist/collection/stories/modal.stories.js +12 -0
  152. package/dist/collection/stories/onboarding.stories.js +11 -0
  153. package/dist/collection/stories/overlay.stories.js +5 -0
  154. package/dist/collection/stories/overlayedModal.stories.js +8 -0
  155. package/dist/collection/stories/privacy-badge.stories.js +11 -0
  156. package/dist/collection/stories/slider.stories.js +17 -0
  157. package/dist/collection/stories/teaser.stories.js +5 -0
  158. package/dist/collection/stories/vps-widget.stories.js +47 -0
  159. package/dist/collection/stories/vviinn-product.stories.js +19 -0
  160. package/dist/collection/utils/collections/collectionsUtils.js +5 -0
  161. package/dist/collection/utils/either.js +3 -0
  162. package/dist/collection/utils/enum/enumUtils.js +3 -0
  163. package/dist/collection/utils/event/Events.js +1 -0
  164. package/dist/collection/utils/number/index.js +4 -0
  165. package/dist/collection/utils/option/option.js +4 -0
  166. package/dist/collection/utils/semigroup/semigroupDiff.js +6 -0
  167. package/dist/collection/utils/token/tokenUtils.js +9 -0
  168. package/dist/esm/Handler-639a4cb3.js +308 -0
  169. package/{www/build/app-globals-e0943e34.js → dist/esm/app-globals-345e497d.js} +10 -922
  170. package/dist/{vviinn-widgets → esm}/cropper-handler.entry.js +2 -2
  171. package/{www/build/customized-slots-f3449695.js → dist/esm/customized-slots-a76a8d41.js} +1 -1
  172. package/dist/esm/highlight-box_22.entry.js +712 -0
  173. package/dist/{vviinn-widgets/imageSearch.store-407f49f0.js → esm/imageSearch.store-8eab0da1.js} +11510 -11872
  174. package/dist/esm/index-6fa21e24.js +1323 -0
  175. package/{www/build/index-c9483145.js → dist/esm/index-8cb063df.js} +6 -4
  176. package/dist/esm/index.js +1 -0
  177. package/dist/esm/loader.js +19 -0
  178. package/dist/esm/polyfills/core-js.js +11 -0
  179. package/dist/esm/polyfills/css-shim.js +1 -0
  180. package/dist/esm/polyfills/dom.js +79 -0
  181. package/dist/esm/polyfills/es5-html-element.js +1 -0
  182. package/dist/esm/polyfills/index.js +34 -0
  183. package/dist/esm/polyfills/system.js +6 -0
  184. package/dist/esm/vviinn-carousel_5.entry.js +1224 -0
  185. package/{www/build → dist/esm}/vviinn-error.entry.js +1 -1
  186. package/dist/{vviinn-widgets → esm}/vviinn-preloader.entry.js +3 -6
  187. package/dist/{vviinn-widgets → esm}/vviinn-vps-button.entry.js +3 -3
  188. package/dist/{vviinn-widgets → esm}/vviinn-vps-widget.entry.js +4 -7
  189. package/dist/esm/vviinn-widgets.js +19 -0
  190. package/dist/index.cjs.js +1 -0
  191. package/dist/index.js +1 -0
  192. package/dist/loader/cdn.js +3 -0
  193. package/dist/loader/index.cjs.js +3 -0
  194. package/dist/loader/index.d.ts +12 -0
  195. package/dist/loader/index.es2017.js +3 -0
  196. package/dist/loader/index.js +4 -0
  197. package/dist/loader/package.json +10 -0
  198. package/dist/types/components/vviinn-carousel/vviinn-carousel.d.ts +1 -0
  199. package/dist/types/components/vviinn-icons/index.d.ts +2 -0
  200. package/dist/types/components/vviinn-product-card/render-helpers.d.ts +3 -2
  201. package/dist/types/components/vviinn-product-card/vviinn-product-card.d.ts +2 -0
  202. package/dist/types/components/vviinn-vpr-button/recommendations-sidebar/recommendations-sidebar.d.ts +25 -0
  203. package/dist/types/components/vviinn-vpr-button/stories/kek.stories.d.ts +7 -0
  204. package/dist/types/components/vviinn-vpr-button/vviinn-vpr-button.d.ts +14 -0
  205. package/dist/types/components/vviinn-vpr-widget/vviinn-vpr-vidget.d.ts +13 -3
  206. package/dist/types/components.d.ts +54 -0
  207. package/dist/vviinn-widgets/index.esm.js +0 -1
  208. package/dist/vviinn-widgets/p-04b06ea9.entry.js +1 -0
  209. package/dist/vviinn-widgets/p-400eb62f.entry.js +1 -0
  210. package/dist/vviinn-widgets/p-56fc949a.js +1 -0
  211. package/dist/vviinn-widgets/p-59edfbe2.js +1 -0
  212. package/dist/vviinn-widgets/p-78ccc9eb.js +15 -0
  213. package/dist/vviinn-widgets/p-9d24f51e.entry.js +1 -0
  214. package/dist/vviinn-widgets/p-d085199d.entry.js +1 -0
  215. package/dist/vviinn-widgets/p-e1ba8626.js +1 -0
  216. package/dist/vviinn-widgets/p-e38f4aa2.entry.js +1 -0
  217. package/dist/vviinn-widgets/p-e67cae57.js +1 -0
  218. package/dist/vviinn-widgets/p-f47e82b2.entry.js +1 -0
  219. package/dist/vviinn-widgets/p-f582db5c.js +1 -0
  220. package/dist/vviinn-widgets/p-fb14e3cc.entry.js +1 -0
  221. package/dist/vviinn-widgets/vviinn-widgets.css +1 -6
  222. package/dist/vviinn-widgets/vviinn-widgets.esm.js +1 -125
  223. package/package.json +3 -1
  224. package/www/build/index.esm.js +0 -1
  225. package/www/build/p-04b06ea9.entry.js +1 -0
  226. package/www/build/p-400eb62f.entry.js +1 -0
  227. package/www/build/p-56fc949a.js +1 -0
  228. package/www/build/p-59edfbe2.js +1 -0
  229. package/www/build/p-78ccc9eb.js +15 -0
  230. package/www/build/p-7e4978d5.js +1 -0
  231. package/www/build/p-9d24f51e.entry.js +1 -0
  232. package/www/build/p-a67898be.css +1 -0
  233. package/www/build/p-d085199d.entry.js +1 -0
  234. package/www/build/p-e1ba8626.js +1 -0
  235. package/www/build/p-e38f4aa2.entry.js +1 -0
  236. package/www/build/p-e67cae57.js +1 -0
  237. package/www/build/p-f47e82b2.entry.js +1 -0
  238. package/www/build/p-f582db5c.js +1 -0
  239. package/www/build/p-fb14e3cc.entry.js +1 -0
  240. package/www/build/vviinn-widgets.css +1 -6
  241. package/www/build/vviinn-widgets.esm.js +1 -125
  242. package/www/index.html +6 -13
  243. package/dist/vviinn-widgets/Array-4b9f84cf.js +0 -4295
  244. package/dist/vviinn-widgets/Handler-47db9890.js +0 -1428
  245. package/dist/vviinn-widgets/NonEmptyArray-6ef0d207.js +0 -4370
  246. package/dist/vviinn-widgets/css-shim-f0027935.js +0 -4
  247. package/dist/vviinn-widgets/dom-db0073f0.js +0 -73
  248. package/dist/vviinn-widgets/highlight-box.entry.js +0 -41
  249. package/dist/vviinn-widgets/index-b6d739a9.js +0 -3010
  250. package/dist/vviinn-widgets/number-98d54dd6.js +0 -1533
  251. package/dist/vviinn-widgets/search-filters.entry.js +0 -73
  252. package/dist/vviinn-widgets/shadow-css-c1fdfa9f.js +0 -389
  253. package/dist/vviinn-widgets/vviinn-carousel.entry.js +0 -205
  254. package/dist/vviinn-widgets/vviinn-detected-object.entry.js +0 -52
  255. package/dist/vviinn-widgets/vviinn-empty-results.entry.js +0 -16
  256. package/dist/vviinn-widgets/vviinn-example-image.entry.js +0 -38
  257. package/dist/vviinn-widgets/vviinn-example-images.entry.js +0 -28
  258. package/dist/vviinn-widgets/vviinn-image-selector.entry.js +0 -31
  259. package/dist/vviinn-widgets/vviinn-image-view.entry.js +0 -55
  260. package/dist/vviinn-widgets/vviinn-modal.entry.js +0 -30
  261. package/dist/vviinn-widgets/vviinn-onboarding-card-1.entry.js +0 -21
  262. package/dist/vviinn-widgets/vviinn-onboarding-card-2.entry.js +0 -21
  263. package/dist/vviinn-widgets/vviinn-onboarding-card-3.entry.js +0 -21
  264. package/dist/vviinn-widgets/vviinn-onboarding.entry.js +0 -20
  265. package/dist/vviinn-widgets/vviinn-overlay.entry.js +0 -15
  266. package/dist/vviinn-widgets/vviinn-overlayed-modal.entry.js +0 -18
  267. package/dist/vviinn-widgets/vviinn-privacy-badge.entry.js +0 -20
  268. package/dist/vviinn-widgets/vviinn-product-card.entry.js +0 -176
  269. package/dist/vviinn-widgets/vviinn-server-error.entry.js +0 -16
  270. package/dist/vviinn-widgets/vviinn-slide.entry.js +0 -15
  271. package/dist/vviinn-widgets/vviinn-slider.entry.js +0 -120
  272. package/dist/vviinn-widgets/vviinn-teaser.entry.js +0 -20
  273. package/dist/vviinn-widgets/vviinn-vpr-widget.entry.js +0 -128
  274. package/dist/vviinn-widgets/vviinn-wrong-format.entry.js +0 -16
  275. package/www/build/Array-4b9f84cf.js +0 -4295
  276. package/www/build/Handler-47db9890.js +0 -1428
  277. package/www/build/NonEmptyArray-6ef0d207.js +0 -4370
  278. package/www/build/css-shim-f0027935.js +0 -4
  279. package/www/build/dom-db0073f0.js +0 -73
  280. package/www/build/highlight-box.entry.js +0 -41
  281. package/www/build/image-cropper.entry.js +0 -113
  282. package/www/build/index-b6d739a9.js +0 -3010
  283. package/www/build/number-98d54dd6.js +0 -1533
  284. package/www/build/search-filters.entry.js +0 -73
  285. package/www/build/shadow-css-c1fdfa9f.js +0 -389
  286. package/www/build/vviinn-detected-object.entry.js +0 -52
  287. package/www/build/vviinn-empty-results.entry.js +0 -16
  288. package/www/build/vviinn-example-image.entry.js +0 -38
  289. package/www/build/vviinn-example-images.entry.js +0 -28
  290. package/www/build/vviinn-image-selector.entry.js +0 -31
  291. package/www/build/vviinn-image-view.entry.js +0 -55
  292. package/www/build/vviinn-modal.entry.js +0 -30
  293. package/www/build/vviinn-onboarding-card-1.entry.js +0 -21
  294. package/www/build/vviinn-onboarding-card-2.entry.js +0 -21
  295. package/www/build/vviinn-onboarding-card-3.entry.js +0 -21
  296. package/www/build/vviinn-onboarding.entry.js +0 -20
  297. package/www/build/vviinn-overlay.entry.js +0 -15
  298. package/www/build/vviinn-overlayed-modal.entry.js +0 -18
  299. package/www/build/vviinn-privacy-badge.entry.js +0 -20
  300. package/www/build/vviinn-product-card.entry.js +0 -176
  301. package/www/build/vviinn-server-error.entry.js +0 -16
  302. package/www/build/vviinn-slide.entry.js +0 -15
  303. package/www/build/vviinn-slider.entry.js +0 -120
  304. package/www/build/vviinn-teaser.entry.js +0 -20
  305. package/www/build/vviinn-vpr-widget.entry.js +0 -128
  306. package/www/build/vviinn-vps-button.entry.js +0 -39
  307. package/www/build/vviinn-wrong-format.entry.js +0 -16
@@ -0,0 +1,1354 @@
1
+ 'use strict';
2
+
3
+ function _interopNamespace(e) {
4
+ if (e && e.__esModule) return e;
5
+ var n = Object.create(null);
6
+ if (e) {
7
+ Object.keys(e).forEach(function (k) {
8
+ if (k !== 'default') {
9
+ var d = Object.getOwnPropertyDescriptor(e, k);
10
+ Object.defineProperty(n, k, d.get ? d : {
11
+ enumerable: true,
12
+ get: function () {
13
+ return e[k];
14
+ }
15
+ });
16
+ }
17
+ });
18
+ }
19
+ n['default'] = e;
20
+ return Object.freeze(n);
21
+ }
22
+
23
+ const NAMESPACE = 'vviinn-widgets';
24
+ const Env = /* vviinn-widgets */ {"packageVersion":"2.2.2","packageName":"vviinn-widgets","environment":"local"};
25
+
26
+ let scopeId;
27
+ let hostTagName;
28
+ let isSvgMode = false;
29
+ let renderingRef = null;
30
+ let queuePending = false;
31
+ const win = typeof window !== 'undefined' ? window : {};
32
+ const doc = win.document || { head: {} };
33
+ const plt = {
34
+ $flags$: 0,
35
+ $resourcesUrl$: '',
36
+ jmp: (h) => h(),
37
+ raf: (h) => requestAnimationFrame(h),
38
+ ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
39
+ rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
40
+ ce: (eventName, opts) => new CustomEvent(eventName, opts),
41
+ };
42
+ const promiseResolve = (v) => Promise.resolve(v);
43
+ const supportsConstructibleStylesheets = /*@__PURE__*/ (() => {
44
+ try {
45
+ new CSSStyleSheet();
46
+ return typeof new CSSStyleSheet().replace === 'function';
47
+ }
48
+ catch (e) { }
49
+ return false;
50
+ })()
51
+ ;
52
+ const addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
53
+ if (listeners) {
54
+ listeners.map(([flags, name, method]) => {
55
+ const target = getHostListenerTarget(elm, flags) ;
56
+ const handler = hostListenerProxy(hostRef, method);
57
+ const opts = hostListenerOpts(flags);
58
+ plt.ael(target, name, handler, opts);
59
+ (hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
60
+ });
61
+ }
62
+ };
63
+ const hostListenerProxy = (hostRef, methodName) => (ev) => {
64
+ try {
65
+ {
66
+ if (hostRef.$flags$ & 256 /* isListenReady */) {
67
+ // instance is ready, let's call it's member method for this event
68
+ hostRef.$lazyInstance$[methodName](ev);
69
+ }
70
+ else {
71
+ (hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
72
+ }
73
+ }
74
+ }
75
+ catch (e) {
76
+ consoleError(e);
77
+ }
78
+ };
79
+ const getHostListenerTarget = (elm, flags) => {
80
+ if (flags & 16 /* TargetBody */)
81
+ return doc.body;
82
+ return elm;
83
+ };
84
+ // prettier-ignore
85
+ const hostListenerOpts = (flags) => (flags & 2 /* Capture */) !== 0;
86
+ const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
87
+ const createTime = (fnName, tagName = '') => {
88
+ {
89
+ return () => {
90
+ return;
91
+ };
92
+ }
93
+ };
94
+ const uniqueTime = (key, measureText) => {
95
+ {
96
+ return () => {
97
+ return;
98
+ };
99
+ }
100
+ };
101
+ const rootAppliedStyles = new WeakMap();
102
+ const registerStyle = (scopeId, cssText, allowCS) => {
103
+ let style = styles.get(scopeId);
104
+ if (supportsConstructibleStylesheets && allowCS) {
105
+ style = (style || new CSSStyleSheet());
106
+ style.replace(cssText);
107
+ }
108
+ else {
109
+ style = cssText;
110
+ }
111
+ styles.set(scopeId, style);
112
+ };
113
+ const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
114
+ let scopeId = getScopeId(cmpMeta);
115
+ let style = styles.get(scopeId);
116
+ // if an element is NOT connected then getRootNode() will return the wrong root node
117
+ // so the fallback is to always use the document for the root node in those cases
118
+ styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc;
119
+ if (style) {
120
+ if (typeof style === 'string') {
121
+ styleContainerNode = styleContainerNode.head || styleContainerNode;
122
+ let appliedStyles = rootAppliedStyles.get(styleContainerNode);
123
+ let styleElm;
124
+ if (!appliedStyles) {
125
+ rootAppliedStyles.set(styleContainerNode, (appliedStyles = new Set()));
126
+ }
127
+ if (!appliedStyles.has(scopeId)) {
128
+ {
129
+ {
130
+ styleElm = doc.createElement('style');
131
+ styleElm.innerHTML = style;
132
+ }
133
+ styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
134
+ }
135
+ if (appliedStyles) {
136
+ appliedStyles.add(scopeId);
137
+ }
138
+ }
139
+ }
140
+ else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
141
+ styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
142
+ }
143
+ }
144
+ return scopeId;
145
+ };
146
+ const attachStyles = (hostRef) => {
147
+ const cmpMeta = hostRef.$cmpMeta$;
148
+ const elm = hostRef.$hostElement$;
149
+ const flags = cmpMeta.$flags$;
150
+ const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
151
+ const scopeId = addStyle(elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta);
152
+ if (flags & 10 /* needsScopedEncapsulation */) {
153
+ // only required when we're NOT using native shadow dom (slot)
154
+ // or this browser doesn't support native shadow dom
155
+ // and this host element was NOT created with SSR
156
+ // let's pick out the inner content for slot projection
157
+ // create a node to represent where the original
158
+ // content was first placed, which is useful later on
159
+ // DOM WRITE!!
160
+ elm['s-sc'] = scopeId;
161
+ elm.classList.add(scopeId + '-h');
162
+ }
163
+ endAttachStyles();
164
+ };
165
+ const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
166
+ /**
167
+ * Default style mode id
168
+ */
169
+ /**
170
+ * Reusable empty obj/array
171
+ * Don't add values to these!!
172
+ */
173
+ const EMPTY_OBJ = {};
174
+ /**
175
+ * Namespaces
176
+ */
177
+ const SVG_NS = 'http://www.w3.org/2000/svg';
178
+ const HTML_NS = 'http://www.w3.org/1999/xhtml';
179
+ const isDef = (v) => v != null;
180
+ const isComplexType = (o) => {
181
+ // https://jsperf.com/typeof-fn-object/5
182
+ o = typeof o;
183
+ return o === 'object' || o === 'function';
184
+ };
185
+ /**
186
+ * Production h() function based on Preact by
187
+ * Jason Miller (@developit)
188
+ * Licensed under the MIT License
189
+ * https://github.com/developit/preact/blob/master/LICENSE
190
+ *
191
+ * Modified for Stencil's compiler and vdom
192
+ */
193
+ // const stack: any[] = [];
194
+ // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, child?: d.ChildType): d.VNode;
195
+ // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;
196
+ const h = (nodeName, vnodeData, ...children) => {
197
+ let child = null;
198
+ let simple = false;
199
+ let lastSimple = false;
200
+ let vNodeChildren = [];
201
+ const walk = (c) => {
202
+ for (let i = 0; i < c.length; i++) {
203
+ child = c[i];
204
+ if (Array.isArray(child)) {
205
+ walk(child);
206
+ }
207
+ else if (child != null && typeof child !== 'boolean') {
208
+ if ((simple = typeof nodeName !== 'function' && !isComplexType(child))) {
209
+ child = String(child);
210
+ }
211
+ if (simple && lastSimple) {
212
+ // If the previous child was simple (string), we merge both
213
+ vNodeChildren[vNodeChildren.length - 1].$text$ += child;
214
+ }
215
+ else {
216
+ // Append a new vNode, if it's text, we create a text vNode
217
+ vNodeChildren.push(simple ? newVNode(null, child) : child);
218
+ }
219
+ lastSimple = simple;
220
+ }
221
+ }
222
+ };
223
+ walk(children);
224
+ if (vnodeData) {
225
+ {
226
+ const classData = vnodeData.className || vnodeData.class;
227
+ if (classData) {
228
+ vnodeData.class =
229
+ typeof classData !== 'object'
230
+ ? classData
231
+ : Object.keys(classData)
232
+ .filter((k) => classData[k])
233
+ .join(' ');
234
+ }
235
+ }
236
+ }
237
+ if (typeof nodeName === 'function') {
238
+ // nodeName is a functional component
239
+ return nodeName(vnodeData === null ? {} : vnodeData, vNodeChildren, vdomFnUtils);
240
+ }
241
+ const vnode = newVNode(nodeName, null);
242
+ vnode.$attrs$ = vnodeData;
243
+ if (vNodeChildren.length > 0) {
244
+ vnode.$children$ = vNodeChildren;
245
+ }
246
+ return vnode;
247
+ };
248
+ const newVNode = (tag, text) => {
249
+ const vnode = {
250
+ $flags$: 0,
251
+ $tag$: tag,
252
+ $text$: text,
253
+ $elm$: null,
254
+ $children$: null,
255
+ };
256
+ {
257
+ vnode.$attrs$ = null;
258
+ }
259
+ return vnode;
260
+ };
261
+ const Host = {};
262
+ const isHost = (node) => node && node.$tag$ === Host;
263
+ const vdomFnUtils = {
264
+ forEach: (children, cb) => children.map(convertToPublic).forEach(cb),
265
+ map: (children, cb) => children.map(convertToPublic).map(cb).map(convertToPrivate),
266
+ };
267
+ const convertToPublic = (node) => ({
268
+ vattrs: node.$attrs$,
269
+ vchildren: node.$children$,
270
+ vkey: node.$key$,
271
+ vname: node.$name$,
272
+ vtag: node.$tag$,
273
+ vtext: node.$text$,
274
+ });
275
+ const convertToPrivate = (node) => {
276
+ if (typeof node.vtag === 'function') {
277
+ const vnodeData = Object.assign({}, node.vattrs);
278
+ if (node.vkey) {
279
+ vnodeData.key = node.vkey;
280
+ }
281
+ if (node.vname) {
282
+ vnodeData.name = node.vname;
283
+ }
284
+ return h(node.vtag, vnodeData, ...(node.vchildren || []));
285
+ }
286
+ const vnode = newVNode(node.vtag, node.vtext);
287
+ vnode.$attrs$ = node.vattrs;
288
+ vnode.$children$ = node.vchildren;
289
+ vnode.$key$ = node.vkey;
290
+ vnode.$name$ = node.vname;
291
+ return vnode;
292
+ };
293
+ /**
294
+ * Production setAccessor() function based on Preact by
295
+ * Jason Miller (@developit)
296
+ * Licensed under the MIT License
297
+ * https://github.com/developit/preact/blob/master/LICENSE
298
+ *
299
+ * Modified for Stencil's compiler and vdom
300
+ */
301
+ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
302
+ if (oldValue !== newValue) {
303
+ let isProp = isMemberInElement(elm, memberName);
304
+ let ln = memberName.toLowerCase();
305
+ if (memberName === 'class') {
306
+ const classList = elm.classList;
307
+ const oldClasses = parseClassList(oldValue);
308
+ const newClasses = parseClassList(newValue);
309
+ classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
310
+ classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
311
+ }
312
+ else if (memberName === 'style') {
313
+ // update style attribute, css properties and values
314
+ {
315
+ for (const prop in oldValue) {
316
+ if (!newValue || newValue[prop] == null) {
317
+ if (prop.includes('-')) {
318
+ elm.style.removeProperty(prop);
319
+ }
320
+ else {
321
+ elm.style[prop] = '';
322
+ }
323
+ }
324
+ }
325
+ }
326
+ for (const prop in newValue) {
327
+ if (!oldValue || newValue[prop] !== oldValue[prop]) {
328
+ if (prop.includes('-')) {
329
+ elm.style.setProperty(prop, newValue[prop]);
330
+ }
331
+ else {
332
+ elm.style[prop] = newValue[prop];
333
+ }
334
+ }
335
+ }
336
+ }
337
+ else if ((!isProp ) &&
338
+ memberName[0] === 'o' &&
339
+ memberName[1] === 'n') {
340
+ // Event Handlers
341
+ // so if the member name starts with "on" and the 3rd characters is
342
+ // a capital letter, and it's not already a member on the element,
343
+ // then we're assuming it's an event listener
344
+ if (memberName[2] === '-') {
345
+ // on- prefixed events
346
+ // allows to be explicit about the dom event to listen without any magic
347
+ // under the hood:
348
+ // <my-cmp on-click> // listens for "click"
349
+ // <my-cmp on-Click> // listens for "Click"
350
+ // <my-cmp on-ionChange> // listens for "ionChange"
351
+ // <my-cmp on-EVENTS> // listens for "EVENTS"
352
+ memberName = memberName.slice(3);
353
+ }
354
+ else if (isMemberInElement(win, ln)) {
355
+ // standard event
356
+ // the JSX attribute could have been "onMouseOver" and the
357
+ // member name "onmouseover" is on the window's prototype
358
+ // so let's add the listener "mouseover", which is all lowercased
359
+ memberName = ln.slice(2);
360
+ }
361
+ else {
362
+ // custom event
363
+ // the JSX attribute could have been "onMyCustomEvent"
364
+ // so let's trim off the "on" prefix and lowercase the first character
365
+ // and add the listener "myCustomEvent"
366
+ // except for the first character, we keep the event name case
367
+ memberName = ln[2] + memberName.slice(3);
368
+ }
369
+ if (oldValue) {
370
+ plt.rel(elm, memberName, oldValue, false);
371
+ }
372
+ if (newValue) {
373
+ plt.ael(elm, memberName, newValue, false);
374
+ }
375
+ }
376
+ else {
377
+ // Set property if it exists and it's not a SVG
378
+ const isComplex = isComplexType(newValue);
379
+ if ((isProp || (isComplex && newValue !== null)) && !isSvg) {
380
+ try {
381
+ if (!elm.tagName.includes('-')) {
382
+ let n = newValue == null ? '' : newValue;
383
+ // Workaround for Safari, moving the <input> caret when re-assigning the same valued
384
+ if (memberName === 'list') {
385
+ isProp = false;
386
+ // tslint:disable-next-line: triple-equals
387
+ }
388
+ else if (oldValue == null || elm[memberName] != n) {
389
+ elm[memberName] = n;
390
+ }
391
+ }
392
+ else {
393
+ elm[memberName] = newValue;
394
+ }
395
+ }
396
+ catch (e) { }
397
+ }
398
+ if (newValue == null || newValue === false) {
399
+ if (newValue !== false || elm.getAttribute(memberName) === '') {
400
+ {
401
+ elm.removeAttribute(memberName);
402
+ }
403
+ }
404
+ }
405
+ else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) {
406
+ newValue = newValue === true ? '' : newValue;
407
+ {
408
+ elm.setAttribute(memberName, newValue);
409
+ }
410
+ }
411
+ }
412
+ }
413
+ };
414
+ const parseClassListRegex = /\s/;
415
+ const parseClassList = (value) => (!value ? [] : value.split(parseClassListRegex));
416
+ const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
417
+ // if the element passed in is a shadow root, which is a document fragment
418
+ // then we want to be adding attrs/props to the shadow root's "host" element
419
+ // if it's not a shadow root, then we add attrs/props to the same element
420
+ const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host
421
+ ? newVnode.$elm$.host
422
+ : newVnode.$elm$;
423
+ const oldVnodeAttrs = (oldVnode && oldVnode.$attrs$) || EMPTY_OBJ;
424
+ const newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ;
425
+ {
426
+ // remove attributes no longer present on the vnode by setting them to undefined
427
+ for (memberName in oldVnodeAttrs) {
428
+ if (!(memberName in newVnodeAttrs)) {
429
+ setAccessor(elm, memberName, oldVnodeAttrs[memberName], undefined, isSvgMode, newVnode.$flags$);
430
+ }
431
+ }
432
+ }
433
+ // add new & update changed attributes
434
+ for (memberName in newVnodeAttrs) {
435
+ setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode, newVnode.$flags$);
436
+ }
437
+ };
438
+ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
439
+ // tslint:disable-next-line: prefer-const
440
+ let newVNode = newParentVNode.$children$[childIndex];
441
+ let i = 0;
442
+ let elm;
443
+ let childNode;
444
+ if (newVNode.$text$ !== null) {
445
+ // create text node
446
+ elm = newVNode.$elm$ = doc.createTextNode(newVNode.$text$);
447
+ }
448
+ else {
449
+ if (!isSvgMode) {
450
+ isSvgMode = newVNode.$tag$ === 'svg';
451
+ }
452
+ // create element
453
+ elm = newVNode.$elm$ = (doc.createElementNS(isSvgMode ? SVG_NS : HTML_NS, newVNode.$tag$)
454
+ );
455
+ if (isSvgMode && newVNode.$tag$ === 'foreignObject') {
456
+ isSvgMode = false;
457
+ }
458
+ // add css classes, attrs, props, listeners, etc.
459
+ {
460
+ updateElement(null, newVNode, isSvgMode);
461
+ }
462
+ if (isDef(scopeId) && elm['s-si'] !== scopeId) {
463
+ // if there is a scopeId and this is the initial render
464
+ // then let's add the scopeId as a css class
465
+ elm.classList.add((elm['s-si'] = scopeId));
466
+ }
467
+ if (newVNode.$children$) {
468
+ for (i = 0; i < newVNode.$children$.length; ++i) {
469
+ // create the node
470
+ childNode = createElm(oldParentVNode, newVNode, i);
471
+ // return node could have been null
472
+ if (childNode) {
473
+ // append our new node
474
+ elm.appendChild(childNode);
475
+ }
476
+ }
477
+ }
478
+ {
479
+ if (newVNode.$tag$ === 'svg') {
480
+ // Only reset the SVG context when we're exiting <svg> element
481
+ isSvgMode = false;
482
+ }
483
+ else if (elm.tagName === 'foreignObject') {
484
+ // Reenter SVG context when we're exiting <foreignObject> element
485
+ isSvgMode = true;
486
+ }
487
+ }
488
+ }
489
+ return elm;
490
+ };
491
+ const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
492
+ let containerElm = (parentElm);
493
+ let childNode;
494
+ if (containerElm.shadowRoot && containerElm.tagName === hostTagName) {
495
+ containerElm = containerElm.shadowRoot;
496
+ }
497
+ for (; startIdx <= endIdx; ++startIdx) {
498
+ if (vnodes[startIdx]) {
499
+ childNode = createElm(null, parentVNode, startIdx);
500
+ if (childNode) {
501
+ vnodes[startIdx].$elm$ = childNode;
502
+ containerElm.insertBefore(childNode, before);
503
+ }
504
+ }
505
+ }
506
+ };
507
+ const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
508
+ for (; startIdx <= endIdx; ++startIdx) {
509
+ if ((vnode = vnodes[startIdx])) {
510
+ elm = vnode.$elm$;
511
+ // remove the vnode's element from the dom
512
+ elm.remove();
513
+ }
514
+ }
515
+ };
516
+ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
517
+ let oldStartIdx = 0;
518
+ let newStartIdx = 0;
519
+ let oldEndIdx = oldCh.length - 1;
520
+ let oldStartVnode = oldCh[0];
521
+ let oldEndVnode = oldCh[oldEndIdx];
522
+ let newEndIdx = newCh.length - 1;
523
+ let newStartVnode = newCh[0];
524
+ let newEndVnode = newCh[newEndIdx];
525
+ let node;
526
+ while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
527
+ if (oldStartVnode == null) {
528
+ // Vnode might have been moved left
529
+ oldStartVnode = oldCh[++oldStartIdx];
530
+ }
531
+ else if (oldEndVnode == null) {
532
+ oldEndVnode = oldCh[--oldEndIdx];
533
+ }
534
+ else if (newStartVnode == null) {
535
+ newStartVnode = newCh[++newStartIdx];
536
+ }
537
+ else if (newEndVnode == null) {
538
+ newEndVnode = newCh[--newEndIdx];
539
+ }
540
+ else if (isSameVnode(oldStartVnode, newStartVnode)) {
541
+ patch(oldStartVnode, newStartVnode);
542
+ oldStartVnode = oldCh[++oldStartIdx];
543
+ newStartVnode = newCh[++newStartIdx];
544
+ }
545
+ else if (isSameVnode(oldEndVnode, newEndVnode)) {
546
+ patch(oldEndVnode, newEndVnode);
547
+ oldEndVnode = oldCh[--oldEndIdx];
548
+ newEndVnode = newCh[--newEndIdx];
549
+ }
550
+ else if (isSameVnode(oldStartVnode, newEndVnode)) {
551
+ patch(oldStartVnode, newEndVnode);
552
+ parentElm.insertBefore(oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
553
+ oldStartVnode = oldCh[++oldStartIdx];
554
+ newEndVnode = newCh[--newEndIdx];
555
+ }
556
+ else if (isSameVnode(oldEndVnode, newStartVnode)) {
557
+ patch(oldEndVnode, newStartVnode);
558
+ parentElm.insertBefore(oldEndVnode.$elm$, oldStartVnode.$elm$);
559
+ oldEndVnode = oldCh[--oldEndIdx];
560
+ newStartVnode = newCh[++newStartIdx];
561
+ }
562
+ else {
563
+ {
564
+ // new element
565
+ node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx);
566
+ newStartVnode = newCh[++newStartIdx];
567
+ }
568
+ if (node) {
569
+ {
570
+ oldStartVnode.$elm$.parentNode.insertBefore(node, oldStartVnode.$elm$);
571
+ }
572
+ }
573
+ }
574
+ }
575
+ if (oldStartIdx > oldEndIdx) {
576
+ addVnodes(parentElm, newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$, newVNode, newCh, newStartIdx, newEndIdx);
577
+ }
578
+ else if (newStartIdx > newEndIdx) {
579
+ removeVnodes(oldCh, oldStartIdx, oldEndIdx);
580
+ }
581
+ };
582
+ const isSameVnode = (vnode1, vnode2) => {
583
+ // compare if two vnode to see if they're "technically" the same
584
+ // need to have the same element tag, and same key to be the same
585
+ if (vnode1.$tag$ === vnode2.$tag$) {
586
+ return true;
587
+ }
588
+ return false;
589
+ };
590
+ const patch = (oldVNode, newVNode) => {
591
+ const elm = (newVNode.$elm$ = oldVNode.$elm$);
592
+ const oldChildren = oldVNode.$children$;
593
+ const newChildren = newVNode.$children$;
594
+ const tag = newVNode.$tag$;
595
+ const text = newVNode.$text$;
596
+ if (text === null) {
597
+ {
598
+ // test if we're rendering an svg element, or still rendering nodes inside of one
599
+ // only add this to the when the compiler sees we're using an svg somewhere
600
+ isSvgMode = tag === 'svg' ? true : tag === 'foreignObject' ? false : isSvgMode;
601
+ }
602
+ // element node
603
+ {
604
+ if (tag === 'slot')
605
+ ;
606
+ else {
607
+ // either this is the first render of an element OR it's an update
608
+ // AND we already know it's possible it could have changed
609
+ // this updates the element's css classes, attrs, props, listeners, etc.
610
+ updateElement(oldVNode, newVNode, isSvgMode);
611
+ }
612
+ }
613
+ if (oldChildren !== null && newChildren !== null) {
614
+ // looks like there's child vnodes for both the old and new vnodes
615
+ updateChildren(elm, oldChildren, newVNode, newChildren);
616
+ }
617
+ else if (newChildren !== null) {
618
+ // no old child vnodes, but there are new child vnodes to add
619
+ if (oldVNode.$text$ !== null) {
620
+ // the old vnode was text, so be sure to clear it out
621
+ elm.textContent = '';
622
+ }
623
+ // add the new vnode children
624
+ addVnodes(elm, null, newVNode, newChildren, 0, newChildren.length - 1);
625
+ }
626
+ else if (oldChildren !== null) {
627
+ // no new child vnodes, but there are old child vnodes to remove
628
+ removeVnodes(oldChildren, 0, oldChildren.length - 1);
629
+ }
630
+ if (isSvgMode && tag === 'svg') {
631
+ isSvgMode = false;
632
+ }
633
+ }
634
+ else if (oldVNode.$text$ !== text) {
635
+ // update the text content for the text only vnode
636
+ // and also only if the text is different than before
637
+ elm.data = text;
638
+ }
639
+ };
640
+ const renderVdom = (hostRef, renderFnResults) => {
641
+ const hostElm = hostRef.$hostElement$;
642
+ const cmpMeta = hostRef.$cmpMeta$;
643
+ const oldVNode = hostRef.$vnode$ || newVNode(null, null);
644
+ const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
645
+ hostTagName = hostElm.tagName;
646
+ if (cmpMeta.$attrsToReflect$) {
647
+ rootVnode.$attrs$ = rootVnode.$attrs$ || {};
648
+ cmpMeta.$attrsToReflect$.map(([propName, attribute]) => (rootVnode.$attrs$[attribute] = hostElm[propName]));
649
+ }
650
+ rootVnode.$tag$ = null;
651
+ rootVnode.$flags$ |= 4 /* isHost */;
652
+ hostRef.$vnode$ = rootVnode;
653
+ rootVnode.$elm$ = oldVNode.$elm$ = (hostElm.shadowRoot || hostElm );
654
+ {
655
+ scopeId = hostElm['s-sc'];
656
+ }
657
+ // synchronous patch
658
+ patch(oldVNode, rootVnode);
659
+ };
660
+ const getElement = (ref) => (getHostRef(ref).$hostElement$ );
661
+ const createEvent = (ref, name, flags) => {
662
+ const elm = getElement(ref);
663
+ return {
664
+ emit: (detail) => {
665
+ return emitEvent(elm, name, {
666
+ bubbles: !!(flags & 4 /* Bubbles */),
667
+ composed: !!(flags & 2 /* Composed */),
668
+ cancelable: !!(flags & 1 /* Cancellable */),
669
+ detail,
670
+ });
671
+ },
672
+ };
673
+ };
674
+ /**
675
+ * Helper function to create & dispatch a custom Event on a provided target
676
+ * @param elm the target of the Event
677
+ * @param name the name to give the custom Event
678
+ * @param opts options for configuring a custom Event
679
+ * @returns the custom Event
680
+ */
681
+ const emitEvent = (elm, name, opts) => {
682
+ const ev = plt.ce(name, opts);
683
+ elm.dispatchEvent(ev);
684
+ return ev;
685
+ };
686
+ const attachToAncestor = (hostRef, ancestorComponent) => {
687
+ if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) {
688
+ ancestorComponent['s-p'].push(new Promise((r) => (hostRef.$onRenderResolve$ = r)));
689
+ }
690
+ };
691
+ const scheduleUpdate = (hostRef, isInitialLoad) => {
692
+ {
693
+ hostRef.$flags$ |= 16 /* isQueuedForUpdate */;
694
+ }
695
+ if (hostRef.$flags$ & 4 /* isWaitingForChildren */) {
696
+ hostRef.$flags$ |= 512 /* needsRerender */;
697
+ return;
698
+ }
699
+ attachToAncestor(hostRef, hostRef.$ancestorComponent$);
700
+ // there is no ancestor component or the ancestor component
701
+ // has already fired off its lifecycle update then
702
+ // fire off the initial update
703
+ const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
704
+ return writeTask(dispatch) ;
705
+ };
706
+ const dispatchHooks = (hostRef, isInitialLoad) => {
707
+ const endSchedule = createTime('scheduleUpdate', hostRef.$cmpMeta$.$tagName$);
708
+ const instance = hostRef.$lazyInstance$ ;
709
+ let promise;
710
+ if (isInitialLoad) {
711
+ {
712
+ hostRef.$flags$ |= 256 /* isListenReady */;
713
+ if (hostRef.$queuedListeners$) {
714
+ hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
715
+ hostRef.$queuedListeners$ = null;
716
+ }
717
+ }
718
+ {
719
+ promise = safeCall(instance, 'componentWillLoad');
720
+ }
721
+ }
722
+ endSchedule();
723
+ return then(promise, () => updateComponent(hostRef, instance, isInitialLoad));
724
+ };
725
+ const updateComponent = async (hostRef, instance, isInitialLoad) => {
726
+ // updateComponent
727
+ const elm = hostRef.$hostElement$;
728
+ const endUpdate = createTime('update', hostRef.$cmpMeta$.$tagName$);
729
+ const rc = elm['s-rc'];
730
+ if (isInitialLoad) {
731
+ // DOM WRITE!
732
+ attachStyles(hostRef);
733
+ }
734
+ const endRender = createTime('render', hostRef.$cmpMeta$.$tagName$);
735
+ {
736
+ callRender(hostRef, instance);
737
+ }
738
+ if (rc) {
739
+ // ok, so turns out there are some child host elements
740
+ // waiting on this parent element to load
741
+ // let's fire off all update callbacks waiting
742
+ rc.map((cb) => cb());
743
+ elm['s-rc'] = undefined;
744
+ }
745
+ endRender();
746
+ endUpdate();
747
+ {
748
+ const childrenPromises = elm['s-p'];
749
+ const postUpdate = () => postUpdateComponent(hostRef);
750
+ if (childrenPromises.length === 0) {
751
+ postUpdate();
752
+ }
753
+ else {
754
+ Promise.all(childrenPromises).then(postUpdate);
755
+ hostRef.$flags$ |= 4 /* isWaitingForChildren */;
756
+ childrenPromises.length = 0;
757
+ }
758
+ }
759
+ };
760
+ const callRender = (hostRef, instance, elm) => {
761
+ try {
762
+ renderingRef = instance;
763
+ instance = instance.render() ;
764
+ {
765
+ hostRef.$flags$ &= ~16 /* isQueuedForUpdate */;
766
+ }
767
+ {
768
+ hostRef.$flags$ |= 2 /* hasRendered */;
769
+ }
770
+ {
771
+ {
772
+ // looks like we've got child nodes to render into this host element
773
+ // or we need to update the css class/attrs on the host element
774
+ // DOM WRITE!
775
+ {
776
+ renderVdom(hostRef, instance);
777
+ }
778
+ }
779
+ }
780
+ }
781
+ catch (e) {
782
+ consoleError(e, hostRef.$hostElement$);
783
+ }
784
+ renderingRef = null;
785
+ return null;
786
+ };
787
+ const getRenderingRef = () => renderingRef;
788
+ const postUpdateComponent = (hostRef) => {
789
+ const tagName = hostRef.$cmpMeta$.$tagName$;
790
+ const elm = hostRef.$hostElement$;
791
+ const endPostUpdate = createTime('postUpdate', tagName);
792
+ const instance = hostRef.$lazyInstance$ ;
793
+ const ancestorComponent = hostRef.$ancestorComponent$;
794
+ if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
795
+ hostRef.$flags$ |= 64 /* hasLoadedComponent */;
796
+ {
797
+ // DOM WRITE!
798
+ addHydratedFlag(elm);
799
+ }
800
+ {
801
+ safeCall(instance, 'componentDidLoad');
802
+ }
803
+ endPostUpdate();
804
+ {
805
+ hostRef.$onReadyResolve$(elm);
806
+ if (!ancestorComponent) {
807
+ appDidLoad();
808
+ }
809
+ }
810
+ }
811
+ else {
812
+ endPostUpdate();
813
+ }
814
+ // load events fire from bottom to top
815
+ // the deepest elements load first then bubbles up
816
+ {
817
+ if (hostRef.$onRenderResolve$) {
818
+ hostRef.$onRenderResolve$();
819
+ hostRef.$onRenderResolve$ = undefined;
820
+ }
821
+ if (hostRef.$flags$ & 512 /* needsRerender */) {
822
+ nextTick(() => scheduleUpdate(hostRef, false));
823
+ }
824
+ hostRef.$flags$ &= ~(4 /* isWaitingForChildren */ | 512 /* needsRerender */);
825
+ }
826
+ // ( •_•)
827
+ // ( •_•)>⌐■-■
828
+ // (⌐■_■)
829
+ };
830
+ const forceUpdate = (ref) => {
831
+ {
832
+ const hostRef = getHostRef(ref);
833
+ const isConnected = hostRef.$hostElement$.isConnected;
834
+ if (isConnected &&
835
+ (hostRef.$flags$ & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
836
+ scheduleUpdate(hostRef, false);
837
+ }
838
+ // Returns "true" when the forced update was successfully scheduled
839
+ return isConnected;
840
+ }
841
+ };
842
+ const appDidLoad = (who) => {
843
+ // on appload
844
+ // we have finish the first big initial render
845
+ {
846
+ addHydratedFlag(doc.documentElement);
847
+ }
848
+ nextTick(() => emitEvent(win, 'appload', { detail: { namespace: NAMESPACE } }));
849
+ };
850
+ const safeCall = (instance, method, arg) => {
851
+ if (instance && instance[method]) {
852
+ try {
853
+ return instance[method](arg);
854
+ }
855
+ catch (e) {
856
+ consoleError(e);
857
+ }
858
+ }
859
+ return undefined;
860
+ };
861
+ const then = (promise, thenFn) => {
862
+ return promise && promise.then ? promise.then(thenFn) : thenFn();
863
+ };
864
+ const addHydratedFlag = (elm) => elm.classList.add('hydrated')
865
+ ;
866
+ const parsePropertyValue = (propValue, propType) => {
867
+ // ensure this value is of the correct prop type
868
+ if (propValue != null && !isComplexType(propValue)) {
869
+ if (propType & 4 /* Boolean */) {
870
+ // per the HTML spec, any string value means it is a boolean true value
871
+ // but we'll cheat here and say that the string "false" is the boolean false
872
+ return propValue === 'false' ? false : propValue === '' || !!propValue;
873
+ }
874
+ if (propType & 2 /* Number */) {
875
+ // force it to be a number
876
+ return parseFloat(propValue);
877
+ }
878
+ if (propType & 1 /* String */) {
879
+ // could have been passed as a number or boolean
880
+ // but we still want it as a string
881
+ return String(propValue);
882
+ }
883
+ // redundant return here for better minification
884
+ return propValue;
885
+ }
886
+ // not sure exactly what type we want
887
+ // so no need to change to a different type
888
+ return propValue;
889
+ };
890
+ const getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
891
+ const setValue = (ref, propName, newVal, cmpMeta) => {
892
+ // check our new property value against our internal value
893
+ const hostRef = getHostRef(ref);
894
+ const elm = hostRef.$hostElement$ ;
895
+ const oldVal = hostRef.$instanceValues$.get(propName);
896
+ const flags = hostRef.$flags$;
897
+ const instance = hostRef.$lazyInstance$ ;
898
+ newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]);
899
+ if ((!(flags & 8 /* isConstructingInstance */) || oldVal === undefined) && newVal !== oldVal) {
900
+ // gadzooks! the property's value has changed!!
901
+ // set our new value!
902
+ hostRef.$instanceValues$.set(propName, newVal);
903
+ if (instance) {
904
+ // get an array of method names of watch functions to call
905
+ if (cmpMeta.$watchers$ && flags & 128 /* isWatchReady */) {
906
+ const watchMethods = cmpMeta.$watchers$[propName];
907
+ if (watchMethods) {
908
+ // this instance is watching for when this property changed
909
+ watchMethods.map((watchMethodName) => {
910
+ try {
911
+ // fire off each of the watch methods that are watching this property
912
+ instance[watchMethodName](newVal, oldVal, propName);
913
+ }
914
+ catch (e) {
915
+ consoleError(e, elm);
916
+ }
917
+ });
918
+ }
919
+ }
920
+ if ((flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
921
+ // looks like this value actually changed, so we've got work to do!
922
+ // but only if we've already rendered, otherwise just chill out
923
+ // queue that we need to do an update, but don't worry about queuing
924
+ // up millions cuz this function ensures it only runs once
925
+ scheduleUpdate(hostRef, false);
926
+ }
927
+ }
928
+ }
929
+ };
930
+ const proxyComponent = (Cstr, cmpMeta, flags) => {
931
+ if (cmpMeta.$members$) {
932
+ if (Cstr.watchers) {
933
+ cmpMeta.$watchers$ = Cstr.watchers;
934
+ }
935
+ // It's better to have a const than two Object.entries()
936
+ const members = Object.entries(cmpMeta.$members$);
937
+ const prototype = Cstr.prototype;
938
+ members.map(([memberName, [memberFlags]]) => {
939
+ if ((memberFlags & 31 /* Prop */ ||
940
+ ((flags & 2 /* proxyState */) && memberFlags & 32 /* State */))) {
941
+ // proxyComponent - prop
942
+ Object.defineProperty(prototype, memberName, {
943
+ get() {
944
+ // proxyComponent, get value
945
+ return getValue(this, memberName);
946
+ },
947
+ set(newValue) {
948
+ // proxyComponent, set value
949
+ setValue(this, memberName, newValue, cmpMeta);
950
+ },
951
+ configurable: true,
952
+ enumerable: true,
953
+ });
954
+ }
955
+ });
956
+ if ((flags & 1 /* isElementConstructor */)) {
957
+ const attrNameToPropName = new Map();
958
+ prototype.attributeChangedCallback = function (attrName, _oldValue, newValue) {
959
+ plt.jmp(() => {
960
+ const propName = attrNameToPropName.get(attrName);
961
+ // In a webcomponent lifecyle the attributeChangedCallback runs prior to connectedCallback
962
+ // in the case where an attribute was set inline.
963
+ // ```html
964
+ // <my-component some-attribute="some-value"></my-component>
965
+ // ```
966
+ //
967
+ // There is an edge case where a developer sets the attribute inline on a custom element and then programatically
968
+ // changes it before it has been upgraded as shown below:
969
+ //
970
+ // ```html
971
+ // <!-- this component has _not_ been upgraded yet -->
972
+ // <my-component id="test" some-attribute="some-value"></my-component>
973
+ // <script>
974
+ // // grab non-upgraded component
975
+ // el = document.querySelector("#test");
976
+ // el.someAttribute = "another-value";
977
+ // // upgrade component
978
+ // cutsomElements.define('my-component', MyComponent);
979
+ // </script>
980
+ // ```
981
+ // In this case if we do not unshadow here and use the value of the shadowing property, attributeChangedCallback
982
+ // will be called with `newValue = "some-value"` and will set the shadowed property (this.someAttribute = "another-value")
983
+ // to the value that was set inline i.e. "some-value" from above example. When
984
+ // the connectedCallback attempts to unshadow it will use "some-value" as the intial value rather than "another-value"
985
+ //
986
+ // The case where the attribute was NOT set inline but was not set programmatically shall be handled/unshadowed
987
+ // by connectedCallback as this attributeChangedCallback will not fire.
988
+ //
989
+ // https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
990
+ //
991
+ // TODO(STENCIL-16) we should think about whether or not we actually want to be reflecting the attributes to
992
+ // properties here given that this goes against best practices outlined here
993
+ // https://developers.google.com/web/fundamentals/web-components/best-practices#avoid-reentrancy
994
+ if (this.hasOwnProperty(propName)) {
995
+ newValue = this[propName];
996
+ delete this[propName];
997
+ }
998
+ this[propName] = newValue === null && typeof this[propName] === 'boolean' ? false : newValue;
999
+ });
1000
+ };
1001
+ // create an array of attributes to observe
1002
+ // and also create a map of html attribute name to js property name
1003
+ Cstr.observedAttributes = members
1004
+ .filter(([_, m]) => m[0] & 15 /* HasAttribute */) // filter to only keep props that should match attributes
1005
+ .map(([propName, m]) => {
1006
+ const attrName = m[1] || propName;
1007
+ attrNameToPropName.set(attrName, propName);
1008
+ if (m[0] & 512 /* ReflectAttr */) {
1009
+ cmpMeta.$attrsToReflect$.push([propName, attrName]);
1010
+ }
1011
+ return attrName;
1012
+ });
1013
+ }
1014
+ }
1015
+ return Cstr;
1016
+ };
1017
+ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) => {
1018
+ // initializeComponent
1019
+ if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
1020
+ {
1021
+ // we haven't initialized this element yet
1022
+ hostRef.$flags$ |= 32 /* hasInitializedComponent */;
1023
+ // lazy loaded components
1024
+ // request the component's implementation to be
1025
+ // wired up with the host element
1026
+ Cstr = loadModule(cmpMeta);
1027
+ if (Cstr.then) {
1028
+ // Await creates a micro-task avoid if possible
1029
+ const endLoad = uniqueTime();
1030
+ Cstr = await Cstr;
1031
+ endLoad();
1032
+ }
1033
+ if (!Cstr.isProxied) {
1034
+ // we've never proxied this Constructor before
1035
+ // let's add the getters/setters to its prototype before
1036
+ // the first time we create an instance of the implementation
1037
+ {
1038
+ cmpMeta.$watchers$ = Cstr.watchers;
1039
+ }
1040
+ proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
1041
+ Cstr.isProxied = true;
1042
+ }
1043
+ const endNewInstance = createTime('createInstance', cmpMeta.$tagName$);
1044
+ // ok, time to construct the instance
1045
+ // but let's keep track of when we start and stop
1046
+ // so that the getters/setters don't incorrectly step on data
1047
+ {
1048
+ hostRef.$flags$ |= 8 /* isConstructingInstance */;
1049
+ }
1050
+ // construct the lazy-loaded component implementation
1051
+ // passing the hostRef is very important during
1052
+ // construction in order to directly wire together the
1053
+ // host element and the lazy-loaded instance
1054
+ try {
1055
+ new Cstr(hostRef);
1056
+ }
1057
+ catch (e) {
1058
+ consoleError(e);
1059
+ }
1060
+ {
1061
+ hostRef.$flags$ &= ~8 /* isConstructingInstance */;
1062
+ }
1063
+ {
1064
+ hostRef.$flags$ |= 128 /* isWatchReady */;
1065
+ }
1066
+ endNewInstance();
1067
+ fireConnectedCallback(hostRef.$lazyInstance$);
1068
+ }
1069
+ if (Cstr.style) {
1070
+ // this component has styles but we haven't registered them yet
1071
+ let style = Cstr.style;
1072
+ const scopeId = getScopeId(cmpMeta);
1073
+ if (!styles.has(scopeId)) {
1074
+ const endRegisterStyles = createTime('registerStyles', cmpMeta.$tagName$);
1075
+ registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
1076
+ endRegisterStyles();
1077
+ }
1078
+ }
1079
+ }
1080
+ // we've successfully created a lazy instance
1081
+ const ancestorComponent = hostRef.$ancestorComponent$;
1082
+ const schedule = () => scheduleUpdate(hostRef, true);
1083
+ if (ancestorComponent && ancestorComponent['s-rc']) {
1084
+ // this is the intial load and this component it has an ancestor component
1085
+ // but the ancestor component has NOT fired its will update lifecycle yet
1086
+ // so let's just cool our jets and wait for the ancestor to continue first
1087
+ // this will get fired off when the ancestor component
1088
+ // finally gets around to rendering its lazy self
1089
+ // fire off the initial update
1090
+ ancestorComponent['s-rc'].push(schedule);
1091
+ }
1092
+ else {
1093
+ schedule();
1094
+ }
1095
+ };
1096
+ const fireConnectedCallback = (instance) => {
1097
+ {
1098
+ safeCall(instance, 'connectedCallback');
1099
+ }
1100
+ };
1101
+ const connectedCallback = (elm) => {
1102
+ if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
1103
+ const hostRef = getHostRef(elm);
1104
+ const cmpMeta = hostRef.$cmpMeta$;
1105
+ const endConnected = createTime('connectedCallback', cmpMeta.$tagName$);
1106
+ if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
1107
+ // first time this component has connected
1108
+ hostRef.$flags$ |= 1 /* hasConnected */;
1109
+ {
1110
+ // find the first ancestor component (if there is one) and register
1111
+ // this component as one of the actively loading child components for its ancestor
1112
+ let ancestorComponent = elm;
1113
+ while ((ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host)) {
1114
+ // climb up the ancestors looking for the first
1115
+ // component that hasn't finished its lifecycle update yet
1116
+ if (ancestorComponent['s-p']) {
1117
+ // we found this components first ancestor component
1118
+ // keep a reference to this component's ancestor component
1119
+ attachToAncestor(hostRef, (hostRef.$ancestorComponent$ = ancestorComponent));
1120
+ break;
1121
+ }
1122
+ }
1123
+ }
1124
+ // Lazy properties
1125
+ // https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
1126
+ if (cmpMeta.$members$) {
1127
+ Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
1128
+ if (memberFlags & 31 /* Prop */ && elm.hasOwnProperty(memberName)) {
1129
+ const value = elm[memberName];
1130
+ delete elm[memberName];
1131
+ elm[memberName] = value;
1132
+ }
1133
+ });
1134
+ }
1135
+ {
1136
+ initializeComponent(elm, hostRef, cmpMeta);
1137
+ }
1138
+ }
1139
+ else {
1140
+ // not the first time this has connected
1141
+ // reattach any event listeners to the host
1142
+ // since they would have been removed when disconnected
1143
+ addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
1144
+ // fire off connectedCallback() on component instance
1145
+ fireConnectedCallback(hostRef.$lazyInstance$);
1146
+ }
1147
+ endConnected();
1148
+ }
1149
+ };
1150
+ const disconnectedCallback = (elm) => {
1151
+ if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
1152
+ const hostRef = getHostRef(elm);
1153
+ const instance = hostRef.$lazyInstance$ ;
1154
+ {
1155
+ if (hostRef.$rmListeners$) {
1156
+ hostRef.$rmListeners$.map((rmListener) => rmListener());
1157
+ hostRef.$rmListeners$ = undefined;
1158
+ }
1159
+ }
1160
+ {
1161
+ safeCall(instance, 'disconnectedCallback');
1162
+ }
1163
+ }
1164
+ };
1165
+ const bootstrapLazy = (lazyBundles, options = {}) => {
1166
+ const endBootstrap = createTime();
1167
+ const cmpTags = [];
1168
+ const exclude = options.exclude || [];
1169
+ const customElements = win.customElements;
1170
+ const head = doc.head;
1171
+ const metaCharset = /*@__PURE__*/ head.querySelector('meta[charset]');
1172
+ const visibilityStyle = /*@__PURE__*/ doc.createElement('style');
1173
+ const deferredConnectedCallbacks = [];
1174
+ let appLoadFallback;
1175
+ let isBootstrapping = true;
1176
+ Object.assign(plt, options);
1177
+ plt.$resourcesUrl$ = new URL(options.resourcesUrl || './', doc.baseURI).href;
1178
+ lazyBundles.map((lazyBundle) => lazyBundle[1].map((compactMeta) => {
1179
+ const cmpMeta = {
1180
+ $flags$: compactMeta[0],
1181
+ $tagName$: compactMeta[1],
1182
+ $members$: compactMeta[2],
1183
+ $listeners$: compactMeta[3],
1184
+ };
1185
+ {
1186
+ cmpMeta.$members$ = compactMeta[2];
1187
+ }
1188
+ {
1189
+ cmpMeta.$listeners$ = compactMeta[3];
1190
+ }
1191
+ {
1192
+ cmpMeta.$attrsToReflect$ = [];
1193
+ }
1194
+ {
1195
+ cmpMeta.$watchers$ = {};
1196
+ }
1197
+ const tagName = cmpMeta.$tagName$;
1198
+ const HostElement = class extends HTMLElement {
1199
+ // StencilLazyHost
1200
+ constructor(self) {
1201
+ // @ts-ignore
1202
+ super(self);
1203
+ self = this;
1204
+ registerHost(self, cmpMeta);
1205
+ if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
1206
+ // this component is using shadow dom
1207
+ // and this browser supports shadow dom
1208
+ // add the read-only property "shadowRoot" to the host element
1209
+ // adding the shadow root build conditionals to minimize runtime
1210
+ {
1211
+ {
1212
+ self.attachShadow({ mode: 'open' });
1213
+ }
1214
+ }
1215
+ }
1216
+ }
1217
+ connectedCallback() {
1218
+ if (appLoadFallback) {
1219
+ clearTimeout(appLoadFallback);
1220
+ appLoadFallback = null;
1221
+ }
1222
+ if (isBootstrapping) {
1223
+ // connectedCallback will be processed once all components have been registered
1224
+ deferredConnectedCallbacks.push(this);
1225
+ }
1226
+ else {
1227
+ plt.jmp(() => connectedCallback(this));
1228
+ }
1229
+ }
1230
+ disconnectedCallback() {
1231
+ plt.jmp(() => disconnectedCallback(this));
1232
+ }
1233
+ componentOnReady() {
1234
+ return getHostRef(this).$onReadyPromise$;
1235
+ }
1236
+ };
1237
+ cmpMeta.$lazyBundleId$ = lazyBundle[0];
1238
+ if (!exclude.includes(tagName) && !customElements.get(tagName)) {
1239
+ cmpTags.push(tagName);
1240
+ customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* isElementConstructor */));
1241
+ }
1242
+ }));
1243
+ {
1244
+ visibilityStyle.innerHTML = cmpTags + HYDRATED_CSS;
1245
+ visibilityStyle.setAttribute('data-styles', '');
1246
+ head.insertBefore(visibilityStyle, metaCharset ? metaCharset.nextSibling : head.firstChild);
1247
+ }
1248
+ // Process deferred connectedCallbacks now all components have been registered
1249
+ isBootstrapping = false;
1250
+ if (deferredConnectedCallbacks.length) {
1251
+ deferredConnectedCallbacks.map((host) => host.connectedCallback());
1252
+ }
1253
+ else {
1254
+ {
1255
+ plt.jmp(() => (appLoadFallback = setTimeout(appDidLoad, 30)));
1256
+ }
1257
+ }
1258
+ // Fallback appLoad event
1259
+ endBootstrap();
1260
+ };
1261
+ const hostRefs = new WeakMap();
1262
+ const getHostRef = (ref) => hostRefs.get(ref);
1263
+ const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
1264
+ const registerHost = (elm, cmpMeta) => {
1265
+ const hostRef = {
1266
+ $flags$: 0,
1267
+ $hostElement$: elm,
1268
+ $cmpMeta$: cmpMeta,
1269
+ $instanceValues$: new Map(),
1270
+ };
1271
+ {
1272
+ hostRef.$onReadyPromise$ = new Promise((r) => (hostRef.$onReadyResolve$ = r));
1273
+ elm['s-p'] = [];
1274
+ elm['s-rc'] = [];
1275
+ }
1276
+ addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
1277
+ return hostRefs.set(elm, hostRef);
1278
+ };
1279
+ const isMemberInElement = (elm, memberName) => memberName in elm;
1280
+ const consoleError = (e, el) => (0, console.error)(e, el);
1281
+ const cmpModules = /*@__PURE__*/ new Map();
1282
+ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
1283
+ // loadModuleImport
1284
+ const exportName = cmpMeta.$tagName$.replace(/-/g, '_');
1285
+ const bundleId = cmpMeta.$lazyBundleId$;
1286
+ const module = cmpModules.get(bundleId) ;
1287
+ if (module) {
1288
+ return module[exportName];
1289
+ }
1290
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
1291
+ /* webpackInclude: /\.entry\.js$/ */
1292
+ /* webpackExclude: /\.system\.entry\.js$/ */
1293
+ /* webpackMode: "lazy" */
1294
+ `./${bundleId}.entry.js${''}`)); }).then((importedModule) => {
1295
+ {
1296
+ cmpModules.set(bundleId, importedModule);
1297
+ }
1298
+ return importedModule[exportName];
1299
+ }, consoleError);
1300
+ };
1301
+ const styles = new Map();
1302
+ const queueDomReads = [];
1303
+ const queueDomWrites = [];
1304
+ const queueTask = (queue, write) => (cb) => {
1305
+ queue.push(cb);
1306
+ if (!queuePending) {
1307
+ queuePending = true;
1308
+ if (write && plt.$flags$ & 4 /* queueSync */) {
1309
+ nextTick(flush);
1310
+ }
1311
+ else {
1312
+ plt.raf(flush);
1313
+ }
1314
+ }
1315
+ };
1316
+ const consume = (queue) => {
1317
+ for (let i = 0; i < queue.length; i++) {
1318
+ try {
1319
+ queue[i](performance.now());
1320
+ }
1321
+ catch (e) {
1322
+ consoleError(e);
1323
+ }
1324
+ }
1325
+ queue.length = 0;
1326
+ };
1327
+ const flush = () => {
1328
+ // always force a bunch of medium callbacks to run, but still have
1329
+ // a throttle on how many can run in a certain time
1330
+ // DOM READS!!!
1331
+ consume(queueDomReads);
1332
+ // DOM WRITES!!!
1333
+ {
1334
+ consume(queueDomWrites);
1335
+ if ((queuePending = queueDomReads.length > 0)) {
1336
+ // still more to do yet, but we've run out of time
1337
+ // let's let this thing cool off and try again in the next tick
1338
+ plt.raf(flush);
1339
+ }
1340
+ }
1341
+ };
1342
+ const nextTick = /*@__PURE__*/ (cb) => promiseResolve().then(cb);
1343
+ const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
1344
+
1345
+ exports.Env = Env;
1346
+ exports.Host = Host;
1347
+ exports.bootstrapLazy = bootstrapLazy;
1348
+ exports.createEvent = createEvent;
1349
+ exports.forceUpdate = forceUpdate;
1350
+ exports.getElement = getElement;
1351
+ exports.getRenderingRef = getRenderingRef;
1352
+ exports.h = h;
1353
+ exports.promiseResolve = promiseResolve;
1354
+ exports.registerInstance = registerInstance;