@zonos/elements 1.1.2 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (780) hide show
  1. package/dist/cjs/{cart-a969ee0b.js → cart-7b70853c.js} +7 -15
  2. package/dist/cjs/classes-b7918f56.js +0 -2
  3. package/dist/cjs/{getBorderRadius-ae52cae1.js → getBorderRadius-fdd605c6.js} +1 -3
  4. package/dist/cjs/getHasMoreSpaceOnRight-2855491b.js +0 -2
  5. package/dist/cjs/index-9542d2e7.js +0 -2
  6. package/dist/cjs/index.cjs.js +20 -1
  7. package/dist/cjs/isColorVariable-c1ed7303.js +0 -2
  8. package/dist/cjs/{isDarkColor-e1a7bf45.js → isDarkColor-f3446afd.js} +1 -3
  9. package/dist/cjs/loader.cjs.js +1 -3
  10. package/dist/cjs/{localization-d510574c.js → localization-387a8a65.js} +11 -7
  11. package/dist/cjs/{submitGtag-4de4430f.js → submitGtag-bf6e7c5e.js} +2 -4
  12. package/dist/cjs/zonos-address_2.cjs.entry.js +5 -7
  13. package/dist/cjs/zonos-badge.cjs.entry.js +0 -2
  14. package/dist/cjs/zonos-banner.cjs.entry.js +0 -2
  15. package/dist/cjs/zonos-button_2.cjs.entry.js +3 -5
  16. package/dist/cjs/zonos-card_2.cjs.entry.js +0 -2
  17. package/dist/cjs/zonos-cart-items_10.cjs.entry.js +24 -18
  18. package/dist/cjs/zonos-checkout.cjs.entry.js +95 -48
  19. package/dist/cjs/zonos-component.cjs.entry.js +0 -2
  20. package/dist/cjs/zonos-controller.cjs.entry.js +17 -12
  21. package/dist/cjs/zonos-country-flag_4.cjs.entry.js +3 -5
  22. package/dist/cjs/zonos-elements.cjs.js +1 -3
  23. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +12 -5
  24. package/dist/cjs/zonos-hello.cjs.entry.js +25 -9
  25. package/dist/cjs/zonos-icon.cjs.entry.js +0 -2
  26. package/dist/cjs/zonos-notification.cjs.entry.js +0 -2
  27. package/dist/cjs/zonos-payment.cjs.entry.js +5 -7
  28. package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js +3 -5
  29. package/dist/cjs/zonos-text.cjs.entry.js +0 -2
  30. package/dist/cjs/{zonosStore-d9cdaec6.js → zonosStore-a430ec5b.js} +3 -2
  31. package/dist/collection/components/checkout/zonos-checkout/zonos-cart-items/zonos-cart-items.js +0 -1
  32. package/dist/collection/components/checkout/zonos-checkout/zonos-cart-subtotal/zonos-cart-subtotal.css +6 -0
  33. package/dist/collection/components/checkout/zonos-checkout/zonos-cart-subtotal/zonos-cart-subtotal.js +3 -3
  34. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.js +7 -1
  35. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.css +7 -3
  36. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.js +2 -3
  37. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +93 -62
  38. package/dist/collection/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.css +7 -3
  39. package/dist/collection/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.js +2 -3
  40. package/dist/collection/components/checkout/zonos-checkout/zonos-review/zonos-review.js +0 -1
  41. package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.css +7 -3
  42. package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.js +0 -1
  43. package/dist/collection/components/common/countries.js +0 -1
  44. package/dist/collection/components/common/zonos-badge/zonos-badge.js +0 -1
  45. package/dist/collection/components/common/zonos-banner/zonos-banner.js +0 -1
  46. package/dist/collection/components/common/zonos-button/zonos-button.js +0 -1
  47. package/dist/collection/components/common/zonos-card/zonos-card.js +0 -1
  48. package/dist/collection/components/common/zonos-collapse/zonos-collapse.js +0 -1
  49. package/dist/collection/components/common/zonos-country-flag/zonos-country-flag.js +0 -1
  50. package/dist/collection/components/common/zonos-country-select/zonos-country-select.js +0 -1
  51. package/dist/collection/components/common/zonos-custom-message/zonos-custom-message.js +0 -1
  52. package/dist/collection/components/common/zonos-dialog/zonos-dialog.js +0 -1
  53. package/dist/collection/components/common/zonos-icon/zonos-icon.js +0 -1
  54. package/dist/collection/components/common/zonos-logo/zonos-logo.js +0 -1
  55. package/dist/collection/components/common/zonos-notification/zonos-notification.js +0 -1
  56. package/dist/collection/components/common/zonos-shipping-rich-radio/zonos-shipping-rich-radio.css +5 -2
  57. package/dist/collection/components/common/zonos-shipping-rich-radio/zonos-shipping-rich-radio.js +0 -1
  58. package/dist/collection/components/common/zonos-spinner/zonos-spinner.js +0 -1
  59. package/dist/collection/components/common/zonos-text/zonos-text.js +0 -1
  60. package/dist/collection/components/common/zonos-v-stack/zonos-v-stack.js +0 -1
  61. package/dist/collection/components/component-template/zonos-component/zonos-component.js +0 -1
  62. package/dist/collection/components/hello/zonos-hello/zonos-hello.js +23 -6
  63. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog-footer/zonos-hello-dialog-footer.js +0 -1
  64. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog.css +8 -0
  65. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog.js +3 -1
  66. package/dist/collection/components/main/zonos-controller.js +10 -2
  67. package/dist/collection/components/store/checkout/cart.js +0 -1
  68. package/dist/collection/components/store/checkout/stripe.js +0 -1
  69. package/dist/collection/components/store/hello/localization.js +4 -1
  70. package/dist/collection/components/store/translationStore/strings.arabic.js +0 -1
  71. package/dist/collection/components/store/translationStore/strings.base.js +0 -1
  72. package/dist/collection/components/store/translationStore/strings.chinese.js +0 -1
  73. package/dist/collection/components/store/translationStore/strings.danish.js +0 -1
  74. package/dist/collection/components/store/translationStore/strings.dutch.js +0 -1
  75. package/dist/collection/components/store/translationStore/strings.french.js +0 -1
  76. package/dist/collection/components/store/translationStore/strings.german.js +0 -1
  77. package/dist/collection/components/store/translationStore/strings.hebrew.js +0 -1
  78. package/dist/collection/components/store/translationStore/strings.indonesian.js +0 -1
  79. package/dist/collection/components/store/translationStore/strings.italian.js +0 -1
  80. package/dist/collection/components/store/translationStore/strings.japanese.js +0 -1
  81. package/dist/collection/components/store/translationStore/strings.korean.js +0 -1
  82. package/dist/collection/components/store/translationStore/strings.norwegian.js +0 -1
  83. package/dist/collection/components/store/translationStore/strings.polish.js +0 -1
  84. package/dist/collection/components/store/translationStore/strings.portuguese.js +0 -1
  85. package/dist/collection/components/store/translationStore/strings.russian.js +0 -1
  86. package/dist/collection/components/store/translationStore/strings.spanish.js +0 -1
  87. package/dist/collection/components/store/translationStore/strings.swedish.js +0 -1
  88. package/dist/collection/components/store/translationStore/strings.turkish.js +0 -1
  89. package/dist/collection/components/store/translationStore/strings.vietnamese.js +0 -1
  90. package/dist/collection/components/store/translationStore.js +0 -1
  91. package/dist/collection/components/store/zonosStore.js +3 -1
  92. package/dist/collection/components/stripe/zonos-address/zonos-address.js +0 -1
  93. package/dist/collection/components/stripe/zonos-link-authentication/zonos-link-authentication.js +0 -1
  94. package/dist/collection/components/stripe/zonos-payment/zonos-payment.js +0 -1
  95. package/dist/collection/components/utils/addDays.js +0 -1
  96. package/dist/collection/components/utils/api/calculateLandedCost.js +0 -1
  97. package/dist/collection/components/utils/api/checkItemRestrictions.js +0 -1
  98. package/dist/collection/components/utils/api/getCountries.js +0 -1
  99. package/dist/collection/components/utils/api/getCountryLandedCost.js +0 -1
  100. package/dist/collection/components/utils/api/getExchangeRate.js +2 -3
  101. package/dist/collection/components/utils/api/getLocaleMessages.js +0 -1
  102. package/dist/collection/components/utils/api/getLocalization.js +3 -2
  103. package/dist/collection/components/utils/api/getShippingZones.js +0 -1
  104. package/dist/collection/components/utils/api/getZonosSetting.js +0 -1
  105. package/dist/collection/components/utils/api/prepCalculateLandedCost.js +1 -10
  106. package/dist/collection/components/utils/changeDeepProperty.js +0 -1
  107. package/dist/collection/components/utils/changeDeepPropertyAtIndex.js +0 -1
  108. package/dist/collection/components/utils/checkout/initCheckout.js +2 -5
  109. package/dist/collection/components/utils/checkout/isCheckoutMobile.js +0 -1
  110. package/dist/collection/components/utils/classes.js +0 -1
  111. package/dist/collection/components/utils/darkenColor.js +0 -1
  112. package/dist/collection/components/utils/formatCurrency.js +0 -1
  113. package/dist/collection/components/utils/formatDate.js +0 -1
  114. package/dist/collection/components/utils/getBorderRadius.js +0 -1
  115. package/dist/collection/components/utils/getButtonTheme.js +0 -1
  116. package/dist/collection/components/utils/getDaysDifference.js +0 -1
  117. package/dist/collection/components/utils/handleFetch.js +1 -2
  118. package/dist/collection/components/utils/hello/currencyConversion/currencyConvert.js +0 -1
  119. package/dist/collection/components/utils/hello/currencyConversion/currencyConvertAndFormat.js +0 -1
  120. package/dist/collection/components/utils/hello/currencyConversion/currencyDisplay.js +0 -1
  121. package/dist/collection/components/utils/hello/currencyConversion/currencyFormat.js +0 -1
  122. package/dist/collection/components/utils/hello/currencyConversion/defaultCurrencyConverter.js +0 -1
  123. package/dist/collection/components/utils/hello/currencyConversion/getCurrencyCode.js +0 -1
  124. package/dist/collection/components/utils/hello/currencyConversion/getCurrencyElements.js +0 -1
  125. package/dist/collection/components/utils/hello/currencyConversion/getInitialElementAmount.js +0 -1
  126. package/dist/collection/components/utils/hello/currencyConversion/getLanguageCode.js +0 -1
  127. package/dist/collection/components/utils/hello/detectItemRestrictions.js +0 -1
  128. package/dist/collection/components/utils/hello/getCurrentHelloLocalePage.js +0 -1
  129. package/dist/collection/components/utils/hello/getHasMoreSpaceAbove.js +9 -0
  130. package/dist/collection/components/utils/hello/getHasMoreSpaceOnRight.js +0 -1
  131. package/dist/collection/components/utils/hello/getProductsOnPage.js +0 -1
  132. package/dist/collection/components/utils/hello/initHello.js +0 -1
  133. package/dist/collection/components/utils/hello/setZonosCountryUrlParam.js +0 -1
  134. package/dist/collection/components/utils/isColorVariable.js +0 -1
  135. package/dist/collection/components/utils/isDarkColor.js +0 -1
  136. package/dist/collection/components/utils/isValidSelector.js +0 -1
  137. package/dist/collection/components/utils/jsonParse.js +0 -1
  138. package/dist/collection/components/utils/lightenColor.js +0 -1
  139. package/dist/collection/components/utils/logging/log.js +0 -1
  140. package/dist/collection/components/utils/logging/logError.js +0 -1
  141. package/dist/collection/components/utils/mergeConfig.js +0 -1
  142. package/dist/collection/components/utils/submitGtag.js +0 -1
  143. package/dist/collection/environment.js +60 -13
  144. package/dist/collection/index.js +0 -1
  145. package/dist/collection/scripts/loadStripe.js +0 -1
  146. package/dist/collection/scripts/stripe.js +0 -1
  147. package/dist/collection/scripts/zonos.js +4 -2
  148. package/dist/collection/styles/stripe/addressRuleStyle.js +0 -1
  149. package/dist/collection/styles/stripe/defaultVariable.js +0 -1
  150. package/dist/collection/types/ICountryJson.js +0 -1
  151. package/dist/collection/types/JsonError.js +0 -1
  152. package/dist/collection/types/NoInfer.js +0 -1
  153. package/dist/collection/types/Translation.js +0 -1
  154. package/dist/collection/types/checkout/CheckoutConfig.js +0 -1
  155. package/dist/collection/types/checkout/api/CalculateLandedCostRequest.js +0 -1
  156. package/dist/collection/types/generated/graphql.customer.types.js +61 -1
  157. package/dist/collection/types/generated/graphql.frontend.types.js +0 -1
  158. package/dist/collection/types/hello/HelloConfig.js +0 -1
  159. package/dist/collection/types/hello/Product.js +0 -1
  160. package/dist/collection/types/hello/RestrictedItem.js +0 -1
  161. package/dist/collection/types/index.js +1 -1
  162. package/dist/collection/types/online-store/OnlineStoreConfig.js +0 -1
  163. package/dist/collection/types/stripe/Apperance.js +0 -1
  164. package/dist/collection/types/styles/Color.js +0 -1
  165. package/dist/collection/types/styles/GridSpacing.js +0 -1
  166. package/dist/collection/types/styles/Text.js +0 -1
  167. package/dist/collection/types/utils/deep/IDeepKeyof.js +0 -1
  168. package/dist/collection/types/utils/deep/IDeepKeyofAtIndex.js +0 -1
  169. package/dist/collection/utils/format.js +0 -1
  170. package/dist/collection/utils/generateVercelDeployUrl.js +0 -1
  171. package/dist/{esm/cart-d00e1acb.js → components/cart.js} +6 -16
  172. package/dist/components/classes.js +0 -2
  173. package/dist/components/formatCurrency.js +0 -2
  174. package/dist/components/getBorderRadius.js +0 -2
  175. package/dist/components/index.js +1 -2
  176. package/dist/components/isColorVariable.js +0 -2
  177. package/dist/components/isDarkColor.js +0 -2
  178. package/dist/components/localization.js +11 -7
  179. package/dist/components/submitGtag.js +1 -3
  180. package/dist/components/zonos-address.js +0 -2
  181. package/dist/components/zonos-address2.js +2 -4
  182. package/dist/components/zonos-badge.js +0 -2
  183. package/dist/components/zonos-badge2.js +0 -2
  184. package/dist/components/zonos-banner.js +0 -2
  185. package/dist/components/zonos-banner2.js +0 -2
  186. package/dist/components/zonos-button.js +0 -2
  187. package/dist/components/zonos-button2.js +0 -2
  188. package/dist/components/zonos-card.js +0 -2
  189. package/dist/components/zonos-card2.js +0 -2
  190. package/dist/components/zonos-cart-items.js +0 -2
  191. package/dist/components/zonos-cart-items2.js +1 -3
  192. package/dist/components/zonos-cart-subtotal.js +0 -2
  193. package/dist/components/zonos-cart-subtotal2.js +5 -6
  194. package/dist/components/zonos-checkout-finish.js +0 -2
  195. package/dist/components/zonos-checkout-finish2.js +8 -3
  196. package/dist/components/zonos-checkout-payment.js +0 -2
  197. package/dist/components/zonos-checkout-payment2.js +4 -6
  198. package/dist/components/zonos-checkout.js +91 -45
  199. package/dist/components/zonos-collapse.js +0 -2
  200. package/dist/components/zonos-collapse2.js +0 -2
  201. package/dist/components/zonos-component.js +0 -2
  202. package/dist/components/zonos-controller.js +14 -9
  203. package/dist/components/zonos-country-flag.js +0 -2
  204. package/dist/components/zonos-country-flag2.js +1 -3
  205. package/dist/components/zonos-country-select.js +0 -2
  206. package/dist/components/zonos-country-select2.js +1 -3
  207. package/dist/components/zonos-custom-message.js +0 -2
  208. package/dist/components/zonos-custom-message2.js +0 -2
  209. package/dist/components/zonos-customer-info.js +0 -2
  210. package/dist/components/zonos-customer-info2.js +4 -6
  211. package/dist/components/zonos-dialog.js +0 -2
  212. package/dist/components/zonos-dialog2.js +0 -2
  213. package/dist/components/zonos-hello-dialog-footer.js +0 -2
  214. package/dist/components/zonos-hello-dialog-footer2.js +1 -3
  215. package/dist/components/zonos-hello-dialog.js +0 -2
  216. package/dist/components/zonos-hello-dialog2.js +11 -4
  217. package/dist/components/zonos-hello.js +24 -8
  218. package/dist/components/zonos-icon.js +0 -2
  219. package/dist/components/zonos-icon2.js +0 -2
  220. package/dist/components/zonos-link-authentication.js +0 -2
  221. package/dist/components/zonos-link-authentication2.js +1 -3
  222. package/dist/components/zonos-logo.js +0 -2
  223. package/dist/components/zonos-logo2.js +0 -2
  224. package/dist/components/zonos-notification.js +0 -2
  225. package/dist/components/zonos-notification2.js +0 -2
  226. package/dist/components/zonos-payment.js +0 -2
  227. package/dist/components/zonos-payment2.js +1 -3
  228. package/dist/components/zonos-review.js +0 -2
  229. package/dist/components/zonos-review2.js +1 -3
  230. package/dist/components/zonos-shipping-rich-radio.js +0 -2
  231. package/dist/components/zonos-shipping-rich-radio2.js +1 -3
  232. package/dist/components/zonos-shipping.js +0 -2
  233. package/dist/components/zonos-shipping2.js +2 -4
  234. package/dist/components/zonos-spinner.js +0 -2
  235. package/dist/components/zonos-spinner2.js +0 -2
  236. package/dist/components/zonos-text.js +0 -2
  237. package/dist/components/zonos-text2.js +0 -2
  238. package/dist/components/zonos-v-stack.js +0 -2
  239. package/dist/components/zonos-v-stack2.js +0 -2
  240. package/dist/components/zonosStore.js +3 -2
  241. package/dist/{zonos-elements/cart-d00e1acb.js → esm/cart-07091d2a.js} +6 -16
  242. package/dist/esm/classes-0d95c529.js +0 -2
  243. package/dist/esm/{getBorderRadius-e8ad5967.js → getBorderRadius-45764ad7.js} +1 -3
  244. package/dist/esm/getHasMoreSpaceOnRight-feba1ae2.js +0 -2
  245. package/dist/esm/index-d1aa9293.js +0 -2
  246. package/dist/esm/index.js +6 -3
  247. package/dist/esm/isColorVariable-4cda28c9.js +0 -2
  248. package/dist/{zonos-elements/isDarkColor-3bb345f4.js → esm/isDarkColor-6fbb9b14.js} +1 -3
  249. package/dist/esm/loader.js +1 -3
  250. package/dist/{zonos-elements/localization-1d92a557.js → esm/localization-b3c2a9a9.js} +11 -7
  251. package/dist/esm/{submitGtag-85914088.js → submitGtag-c0b655ad.js} +2 -4
  252. package/dist/esm/zonos-address_2.entry.js +5 -7
  253. package/dist/esm/zonos-badge.entry.js +0 -2
  254. package/dist/esm/zonos-banner.entry.js +0 -2
  255. package/dist/esm/zonos-button_2.entry.js +3 -5
  256. package/dist/esm/zonos-card_2.entry.js +0 -2
  257. package/dist/esm/zonos-cart-items_10.entry.js +24 -18
  258. package/dist/esm/zonos-checkout.entry.js +95 -48
  259. package/dist/esm/zonos-component.entry.js +0 -2
  260. package/dist/esm/zonos-controller.entry.js +17 -12
  261. package/dist/esm/zonos-country-flag_4.entry.js +3 -5
  262. package/dist/esm/zonos-elements.js +1 -3
  263. package/dist/esm/zonos-hello-dialog.entry.js +12 -5
  264. package/dist/esm/zonos-hello.entry.js +25 -9
  265. package/dist/esm/zonos-icon.entry.js +0 -2
  266. package/dist/esm/zonos-notification.entry.js +0 -2
  267. package/dist/esm/zonos-payment.entry.js +5 -7
  268. package/dist/esm/zonos-shipping-rich-radio.entry.js +3 -5
  269. package/dist/esm/zonos-text.entry.js +0 -2
  270. package/dist/{zonos-elements/zonosStore-1c9c7d76.js → esm/zonosStore-05a62104.js} +3 -2
  271. package/dist/esm-es5/cart-07091d2a.js +1 -0
  272. package/dist/esm-es5/classes-0d95c529.js +1 -2
  273. package/dist/esm-es5/getBorderRadius-45764ad7.js +1 -0
  274. package/dist/esm-es5/getHasMoreSpaceOnRight-feba1ae2.js +1 -2
  275. package/dist/esm-es5/index-d1aa9293.js +1 -2
  276. package/dist/esm-es5/index.js +1 -2
  277. package/dist/esm-es5/isColorVariable-4cda28c9.js +1 -2
  278. package/dist/esm-es5/{isDarkColor-3bb345f4.js → isDarkColor-6fbb9b14.js} +1 -2
  279. package/dist/esm-es5/loader.js +1 -2
  280. package/dist/esm-es5/{localization-1d92a557.js → localization-b3c2a9a9.js} +1 -2
  281. package/dist/esm-es5/{submitGtag-85914088.js → submitGtag-c0b655ad.js} +1 -2
  282. package/dist/esm-es5/zonos-address_2.entry.js +1 -2
  283. package/dist/esm-es5/zonos-badge.entry.js +1 -2
  284. package/dist/esm-es5/zonos-banner.entry.js +1 -2
  285. package/dist/esm-es5/zonos-button_2.entry.js +1 -2
  286. package/dist/esm-es5/zonos-card_2.entry.js +1 -2
  287. package/dist/esm-es5/zonos-cart-items_10.entry.js +1 -2
  288. package/dist/esm-es5/zonos-checkout.entry.js +1 -2
  289. package/dist/esm-es5/zonos-component.entry.js +1 -2
  290. package/dist/esm-es5/zonos-controller.entry.js +1 -2
  291. package/dist/esm-es5/zonos-country-flag_4.entry.js +1 -2
  292. package/dist/esm-es5/zonos-elements.js +1 -2
  293. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -2
  294. package/dist/esm-es5/zonos-hello.entry.js +1 -2
  295. package/dist/esm-es5/zonos-icon.entry.js +1 -2
  296. package/dist/esm-es5/zonos-notification.entry.js +1 -2
  297. package/dist/esm-es5/zonos-payment.entry.js +1 -2
  298. package/dist/esm-es5/zonos-shipping-rich-radio.entry.js +1 -2
  299. package/dist/esm-es5/zonos-text.entry.js +1 -2
  300. package/dist/esm-es5/{zonosStore-1c9c7d76.js → zonosStore-05a62104.js} +1 -2
  301. package/dist/scripts/loadZonos.js +6 -3
  302. package/dist/scripts/zonos.js +6 -3
  303. package/dist/types/components/checkout/zonos-checkout/zonos-checkout.d.ts +1 -4
  304. package/dist/types/components/hello/zonos-hello/zonos-hello.d.ts +1 -0
  305. package/dist/types/components/store/checkout/cart.d.ts +14 -1
  306. package/dist/types/components/utils/api/getExchangeRate.d.ts +2 -1
  307. package/dist/types/components/utils/hello/getHasMoreSpaceAbove.d.ts +1 -0
  308. package/dist/types/components.d.ts +0 -8
  309. package/dist/types/environment.d.ts +8 -0
  310. package/dist/types/scripts/zonos.d.ts +6 -0
  311. package/dist/types/types/checkout/CheckoutConfig.d.ts +3 -1
  312. package/dist/types/types/generated/graphql.customer.types.d.ts +104 -7
  313. package/dist/types/types/generated/graphql.customer.types.ts +138 -7
  314. package/dist/types/types/index.d.ts +1 -0
  315. package/dist/zonos-elements/assets/RemoveIcon.svg +1 -1
  316. package/dist/zonos-elements/index.esm.js +1 -3
  317. package/dist/zonos-elements/p-0190f7c4.entry.js +1 -0
  318. package/dist/zonos-elements/p-0636859b.js +1 -0
  319. package/dist/zonos-elements/p-08695f4e.js +1 -0
  320. package/dist/zonos-elements/p-0a788f68.entry.js +1 -0
  321. package/dist/zonos-elements/p-0e0b46a5.js +1 -0
  322. package/dist/zonos-elements/p-0f7233fd.system.entry.js +1 -0
  323. package/dist/zonos-elements/p-15b71f0b.system.entry.js +1 -0
  324. package/dist/zonos-elements/p-23204b78.system.entry.js +1 -0
  325. package/dist/zonos-elements/p-23b0b4a2.system.entry.js +1 -0
  326. package/dist/zonos-elements/{classes-ce25a814.system.js → p-23e7c655.system.js} +1 -2
  327. package/dist/zonos-elements/p-2b6325ab.entry.js +1 -0
  328. package/dist/zonos-elements/p-2c20c082.entry.js +1 -0
  329. package/dist/zonos-elements/p-30fd29fb.js +1 -0
  330. package/dist/zonos-elements/p-343071d5.entry.js +1 -0
  331. package/dist/zonos-elements/p-36425562.system.entry.js +1 -0
  332. package/dist/zonos-elements/p-37db3842.system.entry.js +1 -0
  333. package/dist/zonos-elements/p-37fc9f6b.entry.js +1 -0
  334. package/dist/zonos-elements/p-42ba069d.system.js +1 -0
  335. package/dist/zonos-elements/p-43a25dab.entry.js +1 -0
  336. package/dist/zonos-elements/p-4524a84f.system.entry.js +1 -0
  337. package/dist/zonos-elements/{getHasMoreSpaceOnRight-5a9efd60.system.js → p-4a5096d2.system.js} +1 -2
  338. package/dist/zonos-elements/{isColorVariable-be454101.system.js → p-64fdb7b6.system.js} +1 -2
  339. package/dist/zonos-elements/{index-87193773.system.js → p-68d06767.system.js} +1 -2
  340. package/dist/zonos-elements/p-6d82986c.system.entry.js +1 -0
  341. package/dist/zonos-elements/p-6dcd752e.system.js +1 -0
  342. package/dist/zonos-elements/p-6df1eaee.js +1 -0
  343. package/dist/zonos-elements/p-6e7cd3f7.entry.js +1 -0
  344. package/dist/zonos-elements/p-79f9e330.system.js +1 -0
  345. package/dist/zonos-elements/p-7bacecf7.entry.js +1 -0
  346. package/dist/zonos-elements/p-824395fd.system.entry.js +1 -0
  347. package/dist/zonos-elements/p-85ab35c9.system.js +1 -0
  348. package/dist/zonos-elements/p-87f324c5.entry.js +1 -0
  349. package/dist/zonos-elements/p-8a75b765.system.entry.js +1 -0
  350. package/dist/zonos-elements/p-8c867835.system.js +1 -0
  351. package/dist/zonos-elements/p-914ce305.system.entry.js +1 -0
  352. package/dist/zonos-elements/p-9688bb12.entry.js +1 -0
  353. package/dist/zonos-elements/p-96a3c767.entry.js +1 -0
  354. package/dist/zonos-elements/p-98105ede.entry.js +1 -0
  355. package/dist/zonos-elements/p-98a6e093.system.entry.js +1 -0
  356. package/dist/zonos-elements/p-9adf546f.system.entry.js +1 -0
  357. package/dist/zonos-elements/p-9b86e655.system.entry.js +1 -0
  358. package/dist/zonos-elements/p-9dc9cbc8.entry.js +1 -0
  359. package/dist/zonos-elements/p-a20b97e9.system.entry.js +1 -0
  360. package/dist/zonos-elements/p-b4b7f705.js +1 -0
  361. package/dist/zonos-elements/p-b618cf03.entry.js +1 -0
  362. package/dist/zonos-elements/p-b64bbf38.system.js +1 -0
  363. package/dist/zonos-elements/p-b6c499d4.js +1 -0
  364. package/dist/zonos-elements/p-b75ffe64.system.entry.js +1 -0
  365. package/dist/zonos-elements/p-bb36a9f8.js +1 -0
  366. package/dist/zonos-elements/p-bf070bf6.js +1 -0
  367. package/dist/zonos-elements/p-c28157ec.system.entry.js +1 -0
  368. package/dist/zonos-elements/p-d43749bd.entry.js +1 -0
  369. package/dist/zonos-elements/p-dc8d7000.js +2 -0
  370. package/dist/zonos-elements/p-f23749e4.system.js +1 -0
  371. package/dist/zonos-elements/p-f8491335.system.js +1 -0
  372. package/dist/zonos-elements/p-f868ed42.entry.js +1 -0
  373. package/dist/zonos-elements/zonos-elements.esm.js +1 -20
  374. package/dist/zonos-elements/zonos-elements.js +1 -1
  375. package/package.json +1 -1
  376. package/dist/cjs/cart-a969ee0b.js.map +0 -1
  377. package/dist/cjs/classes-b7918f56.js.map +0 -1
  378. package/dist/cjs/getBorderRadius-ae52cae1.js.map +0 -1
  379. package/dist/cjs/getHasMoreSpaceOnRight-2855491b.js.map +0 -1
  380. package/dist/cjs/index-9542d2e7.js.map +0 -1
  381. package/dist/cjs/index.cjs.js.map +0 -1
  382. package/dist/cjs/isColorVariable-c1ed7303.js.map +0 -1
  383. package/dist/cjs/isDarkColor-e1a7bf45.js.map +0 -1
  384. package/dist/cjs/loader.cjs.js.map +0 -1
  385. package/dist/cjs/localization-d510574c.js.map +0 -1
  386. package/dist/cjs/submitGtag-4de4430f.js.map +0 -1
  387. package/dist/cjs/zonos-address_2.cjs.entry.js.map +0 -1
  388. package/dist/cjs/zonos-badge.cjs.entry.js.map +0 -1
  389. package/dist/cjs/zonos-banner.cjs.entry.js.map +0 -1
  390. package/dist/cjs/zonos-button_2.cjs.entry.js.map +0 -1
  391. package/dist/cjs/zonos-card_2.cjs.entry.js.map +0 -1
  392. package/dist/cjs/zonos-cart-items_10.cjs.entry.js.map +0 -1
  393. package/dist/cjs/zonos-checkout.cjs.entry.js.map +0 -1
  394. package/dist/cjs/zonos-component.cjs.entry.js.map +0 -1
  395. package/dist/cjs/zonos-controller.cjs.entry.js.map +0 -1
  396. package/dist/cjs/zonos-country-flag_4.cjs.entry.js.map +0 -1
  397. package/dist/cjs/zonos-elements.cjs.js.map +0 -1
  398. package/dist/cjs/zonos-hello-dialog.cjs.entry.js.map +0 -1
  399. package/dist/cjs/zonos-hello.cjs.entry.js.map +0 -1
  400. package/dist/cjs/zonos-icon.cjs.entry.js.map +0 -1
  401. package/dist/cjs/zonos-notification.cjs.entry.js.map +0 -1
  402. package/dist/cjs/zonos-payment.cjs.entry.js.map +0 -1
  403. package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js.map +0 -1
  404. package/dist/cjs/zonos-text.cjs.entry.js.map +0 -1
  405. package/dist/cjs/zonosStore-d9cdaec6.js.map +0 -1
  406. package/dist/collection/components/checkout/zonos-checkout/zonos-cart-items/zonos-cart-items.js.map +0 -1
  407. package/dist/collection/components/checkout/zonos-checkout/zonos-cart-subtotal/zonos-cart-subtotal.js.map +0 -1
  408. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.js.map +0 -1
  409. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.js.map +0 -1
  410. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js.map +0 -1
  411. package/dist/collection/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.js.map +0 -1
  412. package/dist/collection/components/checkout/zonos-checkout/zonos-review/zonos-review.js.map +0 -1
  413. package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.js.map +0 -1
  414. package/dist/collection/components/common/countries.js.map +0 -1
  415. package/dist/collection/components/common/zonos-badge/zonos-badge.js.map +0 -1
  416. package/dist/collection/components/common/zonos-banner/zonos-banner.js.map +0 -1
  417. package/dist/collection/components/common/zonos-button/zonos-button.js.map +0 -1
  418. package/dist/collection/components/common/zonos-card/zonos-card.js.map +0 -1
  419. package/dist/collection/components/common/zonos-collapse/zonos-collapse.js.map +0 -1
  420. package/dist/collection/components/common/zonos-country-flag/zonos-country-flag.js.map +0 -1
  421. package/dist/collection/components/common/zonos-country-select/zonos-country-select.js.map +0 -1
  422. package/dist/collection/components/common/zonos-custom-message/zonos-custom-message.js.map +0 -1
  423. package/dist/collection/components/common/zonos-dialog/zonos-dialog.js.map +0 -1
  424. package/dist/collection/components/common/zonos-icon/zonos-icon.js.map +0 -1
  425. package/dist/collection/components/common/zonos-logo/zonos-logo.js.map +0 -1
  426. package/dist/collection/components/common/zonos-notification/zonos-notification.js.map +0 -1
  427. package/dist/collection/components/common/zonos-shipping-rich-radio/zonos-shipping-rich-radio.js.map +0 -1
  428. package/dist/collection/components/common/zonos-spinner/zonos-spinner.js.map +0 -1
  429. package/dist/collection/components/common/zonos-text/zonos-text.js.map +0 -1
  430. package/dist/collection/components/common/zonos-v-stack/zonos-v-stack.js.map +0 -1
  431. package/dist/collection/components/component-template/zonos-component/zonos-component.js.map +0 -1
  432. package/dist/collection/components/hello/zonos-hello/zonos-hello.js.map +0 -1
  433. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog-footer/zonos-hello-dialog-footer.js.map +0 -1
  434. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog.js.map +0 -1
  435. package/dist/collection/components/main/zonos-controller.js.map +0 -1
  436. package/dist/collection/components/store/checkout/cart.js.map +0 -1
  437. package/dist/collection/components/store/checkout/stripe.js.map +0 -1
  438. package/dist/collection/components/store/hello/localization.js.map +0 -1
  439. package/dist/collection/components/store/translationStore/strings.arabic.js.map +0 -1
  440. package/dist/collection/components/store/translationStore/strings.base.js.map +0 -1
  441. package/dist/collection/components/store/translationStore/strings.chinese.js.map +0 -1
  442. package/dist/collection/components/store/translationStore/strings.danish.js.map +0 -1
  443. package/dist/collection/components/store/translationStore/strings.dutch.js.map +0 -1
  444. package/dist/collection/components/store/translationStore/strings.french.js.map +0 -1
  445. package/dist/collection/components/store/translationStore/strings.german.js.map +0 -1
  446. package/dist/collection/components/store/translationStore/strings.hebrew.js.map +0 -1
  447. package/dist/collection/components/store/translationStore/strings.indonesian.js.map +0 -1
  448. package/dist/collection/components/store/translationStore/strings.italian.js.map +0 -1
  449. package/dist/collection/components/store/translationStore/strings.japanese.js.map +0 -1
  450. package/dist/collection/components/store/translationStore/strings.korean.js.map +0 -1
  451. package/dist/collection/components/store/translationStore/strings.norwegian.js.map +0 -1
  452. package/dist/collection/components/store/translationStore/strings.polish.js.map +0 -1
  453. package/dist/collection/components/store/translationStore/strings.portuguese.js.map +0 -1
  454. package/dist/collection/components/store/translationStore/strings.russian.js.map +0 -1
  455. package/dist/collection/components/store/translationStore/strings.spanish.js.map +0 -1
  456. package/dist/collection/components/store/translationStore/strings.swedish.js.map +0 -1
  457. package/dist/collection/components/store/translationStore/strings.turkish.js.map +0 -1
  458. package/dist/collection/components/store/translationStore/strings.vietnamese.js.map +0 -1
  459. package/dist/collection/components/store/translationStore.js.map +0 -1
  460. package/dist/collection/components/store/zonosStore.js.map +0 -1
  461. package/dist/collection/components/stripe/zonos-address/zonos-address.js.map +0 -1
  462. package/dist/collection/components/stripe/zonos-link-authentication/zonos-link-authentication.js.map +0 -1
  463. package/dist/collection/components/stripe/zonos-payment/zonos-payment.js.map +0 -1
  464. package/dist/collection/components/utils/addDays.js.map +0 -1
  465. package/dist/collection/components/utils/api/calculateLandedCost.js.map +0 -1
  466. package/dist/collection/components/utils/api/checkItemRestrictions.js.map +0 -1
  467. package/dist/collection/components/utils/api/getCountries.js.map +0 -1
  468. package/dist/collection/components/utils/api/getCountryLandedCost.js.map +0 -1
  469. package/dist/collection/components/utils/api/getExchangeRate.js.map +0 -1
  470. package/dist/collection/components/utils/api/getLocaleMessages.js.map +0 -1
  471. package/dist/collection/components/utils/api/getLocalization.js.map +0 -1
  472. package/dist/collection/components/utils/api/getShippingZones.js.map +0 -1
  473. package/dist/collection/components/utils/api/getZonosSetting.js.map +0 -1
  474. package/dist/collection/components/utils/api/prepCalculateLandedCost.js.map +0 -1
  475. package/dist/collection/components/utils/changeDeepProperty.js.map +0 -1
  476. package/dist/collection/components/utils/changeDeepPropertyAtIndex.js.map +0 -1
  477. package/dist/collection/components/utils/checkout/initCheckout.js.map +0 -1
  478. package/dist/collection/components/utils/checkout/isCheckoutMobile.js.map +0 -1
  479. package/dist/collection/components/utils/classes.js.map +0 -1
  480. package/dist/collection/components/utils/darkenColor.js.map +0 -1
  481. package/dist/collection/components/utils/formatCurrency.js.map +0 -1
  482. package/dist/collection/components/utils/formatDate.js.map +0 -1
  483. package/dist/collection/components/utils/getBorderRadius.js.map +0 -1
  484. package/dist/collection/components/utils/getButtonTheme.js.map +0 -1
  485. package/dist/collection/components/utils/getDaysDifference.js.map +0 -1
  486. package/dist/collection/components/utils/handleFetch.js.map +0 -1
  487. package/dist/collection/components/utils/hello/currencyConversion/currencyConvert.js.map +0 -1
  488. package/dist/collection/components/utils/hello/currencyConversion/currencyConvertAndFormat.js.map +0 -1
  489. package/dist/collection/components/utils/hello/currencyConversion/currencyDisplay.js.map +0 -1
  490. package/dist/collection/components/utils/hello/currencyConversion/currencyFormat.js.map +0 -1
  491. package/dist/collection/components/utils/hello/currencyConversion/defaultCurrencyConverter.js.map +0 -1
  492. package/dist/collection/components/utils/hello/currencyConversion/getCurrencyCode.js.map +0 -1
  493. package/dist/collection/components/utils/hello/currencyConversion/getCurrencyElements.js.map +0 -1
  494. package/dist/collection/components/utils/hello/currencyConversion/getInitialElementAmount.js.map +0 -1
  495. package/dist/collection/components/utils/hello/currencyConversion/getLanguageCode.js.map +0 -1
  496. package/dist/collection/components/utils/hello/detectItemRestrictions.js.map +0 -1
  497. package/dist/collection/components/utils/hello/getCurrentHelloLocalePage.js.map +0 -1
  498. package/dist/collection/components/utils/hello/getHasMoreSpaceOnRight.js.map +0 -1
  499. package/dist/collection/components/utils/hello/getProductsOnPage.js.map +0 -1
  500. package/dist/collection/components/utils/hello/initHello.js.map +0 -1
  501. package/dist/collection/components/utils/hello/setZonosCountryUrlParam.js.map +0 -1
  502. package/dist/collection/components/utils/isColorVariable.js.map +0 -1
  503. package/dist/collection/components/utils/isDarkColor.js.map +0 -1
  504. package/dist/collection/components/utils/isValidSelector.js.map +0 -1
  505. package/dist/collection/components/utils/jsonParse.js.map +0 -1
  506. package/dist/collection/components/utils/lightenColor.js.map +0 -1
  507. package/dist/collection/components/utils/logging/log.js.map +0 -1
  508. package/dist/collection/components/utils/logging/logError.js.map +0 -1
  509. package/dist/collection/components/utils/mergeConfig.js.map +0 -1
  510. package/dist/collection/components/utils/submitGtag.js.map +0 -1
  511. package/dist/collection/environment.js.map +0 -1
  512. package/dist/collection/index.js.map +0 -1
  513. package/dist/collection/scripts/loadStripe.js.map +0 -1
  514. package/dist/collection/scripts/stripe.js.map +0 -1
  515. package/dist/collection/scripts/zonos.js.map +0 -1
  516. package/dist/collection/styles/stripe/addressRuleStyle.js.map +0 -1
  517. package/dist/collection/styles/stripe/defaultVariable.js.map +0 -1
  518. package/dist/collection/types/ICountryJson.js.map +0 -1
  519. package/dist/collection/types/JsonError.js.map +0 -1
  520. package/dist/collection/types/NoInfer.js.map +0 -1
  521. package/dist/collection/types/Translation.js.map +0 -1
  522. package/dist/collection/types/checkout/CheckoutConfig.js.map +0 -1
  523. package/dist/collection/types/checkout/api/CalculateLandedCostRequest.js.map +0 -1
  524. package/dist/collection/types/generated/graphql.customer.types.js.map +0 -1
  525. package/dist/collection/types/generated/graphql.frontend.types.js.map +0 -1
  526. package/dist/collection/types/hello/HelloConfig.js.map +0 -1
  527. package/dist/collection/types/hello/Product.js.map +0 -1
  528. package/dist/collection/types/hello/RestrictedItem.js.map +0 -1
  529. package/dist/collection/types/index.js.map +0 -1
  530. package/dist/collection/types/online-store/OnlineStoreConfig.js.map +0 -1
  531. package/dist/collection/types/stripe/Apperance.js.map +0 -1
  532. package/dist/collection/types/styles/Color.js.map +0 -1
  533. package/dist/collection/types/styles/GridSpacing.js.map +0 -1
  534. package/dist/collection/types/styles/Text.js.map +0 -1
  535. package/dist/collection/types/utils/deep/IDeepKeyof.js.map +0 -1
  536. package/dist/collection/types/utils/deep/IDeepKeyofAtIndex.js.map +0 -1
  537. package/dist/collection/utils/format.js.map +0 -1
  538. package/dist/collection/utils/generateVercelDeployUrl.js.map +0 -1
  539. package/dist/components/classes.js.map +0 -1
  540. package/dist/components/formatCurrency.js.map +0 -1
  541. package/dist/components/getBorderRadius.js.map +0 -1
  542. package/dist/components/index.js.map +0 -1
  543. package/dist/components/isColorVariable.js.map +0 -1
  544. package/dist/components/isDarkColor.js.map +0 -1
  545. package/dist/components/localization.js.map +0 -1
  546. package/dist/components/stripe.js +0 -598
  547. package/dist/components/stripe.js.map +0 -1
  548. package/dist/components/submitGtag.js.map +0 -1
  549. package/dist/components/zonos-address.js.map +0 -1
  550. package/dist/components/zonos-address2.js.map +0 -1
  551. package/dist/components/zonos-badge.js.map +0 -1
  552. package/dist/components/zonos-badge2.js.map +0 -1
  553. package/dist/components/zonos-banner.js.map +0 -1
  554. package/dist/components/zonos-banner2.js.map +0 -1
  555. package/dist/components/zonos-button.js.map +0 -1
  556. package/dist/components/zonos-button2.js.map +0 -1
  557. package/dist/components/zonos-card.js.map +0 -1
  558. package/dist/components/zonos-card2.js.map +0 -1
  559. package/dist/components/zonos-cart-items.js.map +0 -1
  560. package/dist/components/zonos-cart-items2.js.map +0 -1
  561. package/dist/components/zonos-cart-subtotal.js.map +0 -1
  562. package/dist/components/zonos-cart-subtotal2.js.map +0 -1
  563. package/dist/components/zonos-checkout-finish.js.map +0 -1
  564. package/dist/components/zonos-checkout-finish2.js.map +0 -1
  565. package/dist/components/zonos-checkout-payment.js.map +0 -1
  566. package/dist/components/zonos-checkout-payment2.js.map +0 -1
  567. package/dist/components/zonos-checkout.js.map +0 -1
  568. package/dist/components/zonos-collapse.js.map +0 -1
  569. package/dist/components/zonos-collapse2.js.map +0 -1
  570. package/dist/components/zonos-component.js.map +0 -1
  571. package/dist/components/zonos-controller.js.map +0 -1
  572. package/dist/components/zonos-country-flag.js.map +0 -1
  573. package/dist/components/zonos-country-flag2.js.map +0 -1
  574. package/dist/components/zonos-country-select.js.map +0 -1
  575. package/dist/components/zonos-country-select2.js.map +0 -1
  576. package/dist/components/zonos-custom-message.js.map +0 -1
  577. package/dist/components/zonos-custom-message2.js.map +0 -1
  578. package/dist/components/zonos-customer-info.js.map +0 -1
  579. package/dist/components/zonos-customer-info2.js.map +0 -1
  580. package/dist/components/zonos-dialog.js.map +0 -1
  581. package/dist/components/zonos-dialog2.js.map +0 -1
  582. package/dist/components/zonos-hello-dialog-footer.js.map +0 -1
  583. package/dist/components/zonos-hello-dialog-footer2.js.map +0 -1
  584. package/dist/components/zonos-hello-dialog.js.map +0 -1
  585. package/dist/components/zonos-hello-dialog2.js.map +0 -1
  586. package/dist/components/zonos-hello.js.map +0 -1
  587. package/dist/components/zonos-icon.js.map +0 -1
  588. package/dist/components/zonos-icon2.js.map +0 -1
  589. package/dist/components/zonos-link-authentication.js.map +0 -1
  590. package/dist/components/zonos-link-authentication2.js.map +0 -1
  591. package/dist/components/zonos-logo.js.map +0 -1
  592. package/dist/components/zonos-logo2.js.map +0 -1
  593. package/dist/components/zonos-notification.js.map +0 -1
  594. package/dist/components/zonos-notification2.js.map +0 -1
  595. package/dist/components/zonos-payment.js.map +0 -1
  596. package/dist/components/zonos-payment2.js.map +0 -1
  597. package/dist/components/zonos-review.js.map +0 -1
  598. package/dist/components/zonos-review2.js.map +0 -1
  599. package/dist/components/zonos-shipping-rich-radio.js.map +0 -1
  600. package/dist/components/zonos-shipping-rich-radio2.js.map +0 -1
  601. package/dist/components/zonos-shipping.js.map +0 -1
  602. package/dist/components/zonos-shipping2.js.map +0 -1
  603. package/dist/components/zonos-spinner.js.map +0 -1
  604. package/dist/components/zonos-spinner2.js.map +0 -1
  605. package/dist/components/zonos-text.js.map +0 -1
  606. package/dist/components/zonos-text2.js.map +0 -1
  607. package/dist/components/zonos-v-stack.js.map +0 -1
  608. package/dist/components/zonos-v-stack2.js.map +0 -1
  609. package/dist/components/zonosStore.js.map +0 -1
  610. package/dist/esm/cart-d00e1acb.js.map +0 -1
  611. package/dist/esm/classes-0d95c529.js.map +0 -1
  612. package/dist/esm/getBorderRadius-e8ad5967.js.map +0 -1
  613. package/dist/esm/getHasMoreSpaceOnRight-feba1ae2.js.map +0 -1
  614. package/dist/esm/index-d1aa9293.js.map +0 -1
  615. package/dist/esm/index.js.map +0 -1
  616. package/dist/esm/isColorVariable-4cda28c9.js.map +0 -1
  617. package/dist/esm/isDarkColor-3bb345f4.js +0 -1197
  618. package/dist/esm/isDarkColor-3bb345f4.js.map +0 -1
  619. package/dist/esm/loader.js.map +0 -1
  620. package/dist/esm/localization-1d92a557.js +0 -3561
  621. package/dist/esm/localization-1d92a557.js.map +0 -1
  622. package/dist/esm/submitGtag-85914088.js.map +0 -1
  623. package/dist/esm/zonos-address_2.entry.js.map +0 -1
  624. package/dist/esm/zonos-badge.entry.js.map +0 -1
  625. package/dist/esm/zonos-banner.entry.js.map +0 -1
  626. package/dist/esm/zonos-button_2.entry.js.map +0 -1
  627. package/dist/esm/zonos-card_2.entry.js.map +0 -1
  628. package/dist/esm/zonos-cart-items_10.entry.js.map +0 -1
  629. package/dist/esm/zonos-checkout.entry.js.map +0 -1
  630. package/dist/esm/zonos-component.entry.js.map +0 -1
  631. package/dist/esm/zonos-controller.entry.js.map +0 -1
  632. package/dist/esm/zonos-country-flag_4.entry.js.map +0 -1
  633. package/dist/esm/zonos-elements.js.map +0 -1
  634. package/dist/esm/zonos-hello-dialog.entry.js.map +0 -1
  635. package/dist/esm/zonos-hello.entry.js.map +0 -1
  636. package/dist/esm/zonos-icon.entry.js.map +0 -1
  637. package/dist/esm/zonos-notification.entry.js.map +0 -1
  638. package/dist/esm/zonos-payment.entry.js.map +0 -1
  639. package/dist/esm/zonos-shipping-rich-radio.entry.js.map +0 -1
  640. package/dist/esm/zonos-text.entry.js.map +0 -1
  641. package/dist/esm/zonosStore-1c9c7d76.js +0 -2623
  642. package/dist/esm/zonosStore-1c9c7d76.js.map +0 -1
  643. package/dist/esm-es5/cart-d00e1acb.js +0 -2
  644. package/dist/esm-es5/cart-d00e1acb.js.map +0 -1
  645. package/dist/esm-es5/classes-0d95c529.js.map +0 -1
  646. package/dist/esm-es5/getBorderRadius-e8ad5967.js +0 -2
  647. package/dist/esm-es5/getBorderRadius-e8ad5967.js.map +0 -1
  648. package/dist/esm-es5/getHasMoreSpaceOnRight-feba1ae2.js.map +0 -1
  649. package/dist/esm-es5/index-d1aa9293.js.map +0 -1
  650. package/dist/esm-es5/index.js.map +0 -1
  651. package/dist/esm-es5/isColorVariable-4cda28c9.js.map +0 -1
  652. package/dist/esm-es5/isDarkColor-3bb345f4.js.map +0 -1
  653. package/dist/esm-es5/loader.js.map +0 -1
  654. package/dist/esm-es5/localization-1d92a557.js.map +0 -1
  655. package/dist/esm-es5/submitGtag-85914088.js.map +0 -1
  656. package/dist/esm-es5/zonos-address_2.entry.js.map +0 -1
  657. package/dist/esm-es5/zonos-badge.entry.js.map +0 -1
  658. package/dist/esm-es5/zonos-banner.entry.js.map +0 -1
  659. package/dist/esm-es5/zonos-button_2.entry.js.map +0 -1
  660. package/dist/esm-es5/zonos-card_2.entry.js.map +0 -1
  661. package/dist/esm-es5/zonos-cart-items_10.entry.js.map +0 -1
  662. package/dist/esm-es5/zonos-checkout.entry.js.map +0 -1
  663. package/dist/esm-es5/zonos-component.entry.js.map +0 -1
  664. package/dist/esm-es5/zonos-controller.entry.js.map +0 -1
  665. package/dist/esm-es5/zonos-country-flag_4.entry.js.map +0 -1
  666. package/dist/esm-es5/zonos-elements.js.map +0 -1
  667. package/dist/esm-es5/zonos-hello-dialog.entry.js.map +0 -1
  668. package/dist/esm-es5/zonos-hello.entry.js.map +0 -1
  669. package/dist/esm-es5/zonos-icon.entry.js.map +0 -1
  670. package/dist/esm-es5/zonos-notification.entry.js.map +0 -1
  671. package/dist/esm-es5/zonos-payment.entry.js.map +0 -1
  672. package/dist/esm-es5/zonos-shipping-rich-radio.entry.js.map +0 -1
  673. package/dist/esm-es5/zonos-text.entry.js.map +0 -1
  674. package/dist/esm-es5/zonosStore-1c9c7d76.js.map +0 -1
  675. package/dist/zonos-elements/cart-c641ddaf.system.js +0 -2
  676. package/dist/zonos-elements/cart-c641ddaf.system.js.map +0 -1
  677. package/dist/zonos-elements/cart-d00e1acb.js.map +0 -1
  678. package/dist/zonos-elements/classes-0d95c529.js +0 -14
  679. package/dist/zonos-elements/classes-0d95c529.js.map +0 -1
  680. package/dist/zonos-elements/classes-ce25a814.system.js.map +0 -1
  681. package/dist/zonos-elements/getBorderRadius-b59c3ada.system.js +0 -2
  682. package/dist/zonos-elements/getBorderRadius-b59c3ada.system.js.map +0 -1
  683. package/dist/zonos-elements/getBorderRadius-e8ad5967.js +0 -18
  684. package/dist/zonos-elements/getBorderRadius-e8ad5967.js.map +0 -1
  685. package/dist/zonos-elements/getHasMoreSpaceOnRight-5a9efd60.system.js.map +0 -1
  686. package/dist/zonos-elements/getHasMoreSpaceOnRight-feba1ae2.js +0 -10
  687. package/dist/zonos-elements/getHasMoreSpaceOnRight-feba1ae2.js.map +0 -1
  688. package/dist/zonos-elements/index-87193773.system.js.map +0 -1
  689. package/dist/zonos-elements/index-d1aa9293.js +0 -1884
  690. package/dist/zonos-elements/index-d1aa9293.js.map +0 -1
  691. package/dist/zonos-elements/index.esm.js.map +0 -1
  692. package/dist/zonos-elements/index.system.js +0 -2
  693. package/dist/zonos-elements/index.system.js.map +0 -1
  694. package/dist/zonos-elements/isColorVariable-4cda28c9.js +0 -16
  695. package/dist/zonos-elements/isColorVariable-4cda28c9.js.map +0 -1
  696. package/dist/zonos-elements/isColorVariable-be454101.system.js.map +0 -1
  697. package/dist/zonos-elements/isDarkColor-231502d4.system.js +0 -2
  698. package/dist/zonos-elements/isDarkColor-231502d4.system.js.map +0 -1
  699. package/dist/zonos-elements/isDarkColor-3bb345f4.js.map +0 -1
  700. package/dist/zonos-elements/localization-1d92a557.js.map +0 -1
  701. package/dist/zonos-elements/localization-a6b6a5a5.system.js +0 -2
  702. package/dist/zonos-elements/localization-a6b6a5a5.system.js.map +0 -1
  703. package/dist/zonos-elements/submitGtag-764af8c4.system.js +0 -2
  704. package/dist/zonos-elements/submitGtag-764af8c4.system.js.map +0 -1
  705. package/dist/zonos-elements/submitGtag-85914088.js +0 -26
  706. package/dist/zonos-elements/submitGtag-85914088.js.map +0 -1
  707. package/dist/zonos-elements/zonos-address_2.entry.js +0 -121
  708. package/dist/zonos-elements/zonos-address_2.entry.js.map +0 -1
  709. package/dist/zonos-elements/zonos-address_2.system.entry.js +0 -2
  710. package/dist/zonos-elements/zonos-address_2.system.entry.js.map +0 -1
  711. package/dist/zonos-elements/zonos-badge.entry.js +0 -32
  712. package/dist/zonos-elements/zonos-badge.entry.js.map +0 -1
  713. package/dist/zonos-elements/zonos-badge.system.entry.js +0 -2
  714. package/dist/zonos-elements/zonos-badge.system.entry.js.map +0 -1
  715. package/dist/zonos-elements/zonos-banner.entry.js +0 -64
  716. package/dist/zonos-elements/zonos-banner.entry.js.map +0 -1
  717. package/dist/zonos-elements/zonos-banner.system.entry.js +0 -2
  718. package/dist/zonos-elements/zonos-banner.system.entry.js.map +0 -1
  719. package/dist/zonos-elements/zonos-button_2.entry.js +0 -124
  720. package/dist/zonos-elements/zonos-button_2.entry.js.map +0 -1
  721. package/dist/zonos-elements/zonos-button_2.system.entry.js +0 -2
  722. package/dist/zonos-elements/zonos-button_2.system.entry.js.map +0 -1
  723. package/dist/zonos-elements/zonos-card_2.entry.js +0 -42
  724. package/dist/zonos-elements/zonos-card_2.entry.js.map +0 -1
  725. package/dist/zonos-elements/zonos-card_2.system.entry.js +0 -2
  726. package/dist/zonos-elements/zonos-card_2.system.entry.js.map +0 -1
  727. package/dist/zonos-elements/zonos-cart-items_10.entry.js +0 -494
  728. package/dist/zonos-elements/zonos-cart-items_10.entry.js.map +0 -1
  729. package/dist/zonos-elements/zonos-cart-items_10.system.entry.js +0 -2
  730. package/dist/zonos-elements/zonos-cart-items_10.system.entry.js.map +0 -1
  731. package/dist/zonos-elements/zonos-checkout.entry.js +0 -337
  732. package/dist/zonos-elements/zonos-checkout.entry.js.map +0 -1
  733. package/dist/zonos-elements/zonos-checkout.system.entry.js +0 -2
  734. package/dist/zonos-elements/zonos-checkout.system.entry.js.map +0 -1
  735. package/dist/zonos-elements/zonos-component.entry.js +0 -27
  736. package/dist/zonos-elements/zonos-component.entry.js.map +0 -1
  737. package/dist/zonos-elements/zonos-component.system.entry.js +0 -2
  738. package/dist/zonos-elements/zonos-component.system.entry.js.map +0 -1
  739. package/dist/zonos-elements/zonos-controller.entry.js +0 -165
  740. package/dist/zonos-elements/zonos-controller.entry.js.map +0 -1
  741. package/dist/zonos-elements/zonos-controller.system.entry.js +0 -2
  742. package/dist/zonos-elements/zonos-controller.system.entry.js.map +0 -1
  743. package/dist/zonos-elements/zonos-country-flag_4.entry.js +0 -1895
  744. package/dist/zonos-elements/zonos-country-flag_4.entry.js.map +0 -1
  745. package/dist/zonos-elements/zonos-country-flag_4.system.entry.js +0 -2
  746. package/dist/zonos-elements/zonos-country-flag_4.system.entry.js.map +0 -1
  747. package/dist/zonos-elements/zonos-elements.esm.js.map +0 -1
  748. package/dist/zonos-elements/zonos-elements.system.js +0 -2
  749. package/dist/zonos-elements/zonos-elements.system.js.map +0 -1
  750. package/dist/zonos-elements/zonos-hello-dialog.entry.js +0 -115
  751. package/dist/zonos-elements/zonos-hello-dialog.entry.js.map +0 -1
  752. package/dist/zonos-elements/zonos-hello-dialog.system.entry.js +0 -2
  753. package/dist/zonos-elements/zonos-hello-dialog.system.entry.js.map +0 -1
  754. package/dist/zonos-elements/zonos-hello.entry.js +0 -696
  755. package/dist/zonos-elements/zonos-hello.entry.js.map +0 -1
  756. package/dist/zonos-elements/zonos-hello.system.entry.js +0 -2
  757. package/dist/zonos-elements/zonos-hello.system.entry.js.map +0 -1
  758. package/dist/zonos-elements/zonos-icon.entry.js +0 -30
  759. package/dist/zonos-elements/zonos-icon.entry.js.map +0 -1
  760. package/dist/zonos-elements/zonos-icon.system.entry.js +0 -2
  761. package/dist/zonos-elements/zonos-icon.system.entry.js.map +0 -1
  762. package/dist/zonos-elements/zonos-notification.entry.js +0 -67
  763. package/dist/zonos-elements/zonos-notification.entry.js.map +0 -1
  764. package/dist/zonos-elements/zonos-notification.system.entry.js +0 -2
  765. package/dist/zonos-elements/zonos-notification.system.entry.js.map +0 -1
  766. package/dist/zonos-elements/zonos-payment.entry.js +0 -56
  767. package/dist/zonos-elements/zonos-payment.entry.js.map +0 -1
  768. package/dist/zonos-elements/zonos-payment.system.entry.js +0 -2
  769. package/dist/zonos-elements/zonos-payment.system.entry.js.map +0 -1
  770. package/dist/zonos-elements/zonos-shipping-rich-radio.entry.js +0 -50
  771. package/dist/zonos-elements/zonos-shipping-rich-radio.entry.js.map +0 -1
  772. package/dist/zonos-elements/zonos-shipping-rich-radio.system.entry.js +0 -2
  773. package/dist/zonos-elements/zonos-shipping-rich-radio.system.entry.js.map +0 -1
  774. package/dist/zonos-elements/zonos-text.entry.js +0 -156
  775. package/dist/zonos-elements/zonos-text.entry.js.map +0 -1
  776. package/dist/zonos-elements/zonos-text.system.entry.js +0 -2
  777. package/dist/zonos-elements/zonos-text.system.entry.js.map +0 -1
  778. package/dist/zonos-elements/zonosStore-1c9c7d76.js.map +0 -1
  779. package/dist/zonos-elements/zonosStore-e5c545ea.system.js +0 -2
  780. package/dist/zonos-elements/zonosStore-e5c545ea.system.js.map +0 -1
@@ -1,1884 +0,0 @@
1
- const NAMESPACE = 'zonos-elements';
2
-
3
- /**
4
- * Virtual DOM patching algorithm based on Snabbdom by
5
- * Simon Friis Vindum (@paldepind)
6
- * Licensed under the MIT License
7
- * https://github.com/snabbdom/snabbdom/blob/master/LICENSE
8
- *
9
- * Modified for Stencil's renderer and slot projection
10
- */
11
- let scopeId;
12
- let hostTagName;
13
- let isSvgMode = false;
14
- let renderingRef = null;
15
- let queuePending = false;
16
- const getAssetPath = (path) => {
17
- const assetUrl = new URL(path, plt.$resourcesUrl$);
18
- return assetUrl.origin !== win.location.origin ? assetUrl.href : assetUrl.pathname;
19
- };
20
- const createTime = (fnName, tagName = '') => {
21
- {
22
- return () => {
23
- return;
24
- };
25
- }
26
- };
27
- const uniqueTime = (key, measureText) => {
28
- {
29
- return () => {
30
- return;
31
- };
32
- }
33
- };
34
- const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
35
- /**
36
- * Default style mode id
37
- */
38
- /**
39
- * Reusable empty obj/array
40
- * Don't add values to these!!
41
- */
42
- const EMPTY_OBJ = {};
43
- /**
44
- * Namespaces
45
- */
46
- const SVG_NS = 'http://www.w3.org/2000/svg';
47
- const HTML_NS = 'http://www.w3.org/1999/xhtml';
48
- const isDef = (v) => v != null;
49
- /**
50
- * Check whether a value is a 'complex type', defined here as an object or a
51
- * function.
52
- *
53
- * @param o the value to check
54
- * @returns whether it's a complex type or not
55
- */
56
- const isComplexType = (o) => {
57
- // https://jsperf.com/typeof-fn-object/5
58
- o = typeof o;
59
- return o === 'object' || o === 'function';
60
- };
61
- /**
62
- * Helper method for querying a `meta` tag that contains a nonce value
63
- * out of a DOM's head.
64
- *
65
- * @param doc The DOM containing the `head` to query against
66
- * @returns The content of the meta tag representing the nonce value, or `undefined` if no tag
67
- * exists or the tag has no content.
68
- */
69
- function queryNonceMetaTagContent(doc) {
70
- var _a, _b, _c;
71
- return (_c = (_b = (_a = doc.head) === null || _a === void 0 ? void 0 : _a.querySelector('meta[name="csp-nonce"]')) === null || _b === void 0 ? void 0 : _b.getAttribute('content')) !== null && _c !== void 0 ? _c : undefined;
72
- }
73
- /**
74
- * Production h() function based on Preact by
75
- * Jason Miller (@developit)
76
- * Licensed under the MIT License
77
- * https://github.com/developit/preact/blob/master/LICENSE
78
- *
79
- * Modified for Stencil's compiler and vdom
80
- */
81
- // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, child?: d.ChildType): d.VNode;
82
- // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;
83
- const h = (nodeName, vnodeData, ...children) => {
84
- let child = null;
85
- let key = null;
86
- let simple = false;
87
- let lastSimple = false;
88
- const vNodeChildren = [];
89
- const walk = (c) => {
90
- for (let i = 0; i < c.length; i++) {
91
- child = c[i];
92
- if (Array.isArray(child)) {
93
- walk(child);
94
- }
95
- else if (child != null && typeof child !== 'boolean') {
96
- if ((simple = typeof nodeName !== 'function' && !isComplexType(child))) {
97
- child = String(child);
98
- }
99
- if (simple && lastSimple) {
100
- // If the previous child was simple (string), we merge both
101
- vNodeChildren[vNodeChildren.length - 1].$text$ += child;
102
- }
103
- else {
104
- // Append a new vNode, if it's text, we create a text vNode
105
- vNodeChildren.push(simple ? newVNode(null, child) : child);
106
- }
107
- lastSimple = simple;
108
- }
109
- }
110
- };
111
- walk(children);
112
- if (vnodeData) {
113
- if (vnodeData.key) {
114
- key = vnodeData.key;
115
- }
116
- // normalize class / className attributes
117
- {
118
- const classData = vnodeData.className || vnodeData.class;
119
- if (classData) {
120
- vnodeData.class =
121
- typeof classData !== 'object'
122
- ? classData
123
- : Object.keys(classData)
124
- .filter((k) => classData[k])
125
- .join(' ');
126
- }
127
- }
128
- }
129
- if (typeof nodeName === 'function') {
130
- // nodeName is a functional component
131
- return nodeName(vnodeData === null ? {} : vnodeData, vNodeChildren, vdomFnUtils);
132
- }
133
- const vnode = newVNode(nodeName, null);
134
- vnode.$attrs$ = vnodeData;
135
- if (vNodeChildren.length > 0) {
136
- vnode.$children$ = vNodeChildren;
137
- }
138
- {
139
- vnode.$key$ = key;
140
- }
141
- return vnode;
142
- };
143
- /**
144
- * A utility function for creating a virtual DOM node from a tag and some
145
- * possible text content.
146
- *
147
- * @param tag the tag for this element
148
- * @param text possible text content for the node
149
- * @returns a newly-minted virtual DOM node
150
- */
151
- const newVNode = (tag, text) => {
152
- const vnode = {
153
- $flags$: 0,
154
- $tag$: tag,
155
- $text$: text,
156
- $elm$: null,
157
- $children$: null,
158
- };
159
- {
160
- vnode.$attrs$ = null;
161
- }
162
- {
163
- vnode.$key$ = null;
164
- }
165
- return vnode;
166
- };
167
- const Host = {};
168
- /**
169
- * Check whether a given node is a Host node or not
170
- *
171
- * @param node the virtual DOM node to check
172
- * @returns whether it's a Host node or not
173
- */
174
- const isHost = (node) => node && node.$tag$ === Host;
175
- /**
176
- * Implementation of {@link d.FunctionalUtilities} for Stencil's VDom.
177
- *
178
- * Note that these functions convert from {@link d.VNode} to
179
- * {@link d.ChildNode} to give functional component developers a friendly
180
- * interface.
181
- */
182
- const vdomFnUtils = {
183
- forEach: (children, cb) => children.map(convertToPublic).forEach(cb),
184
- map: (children, cb) => children.map(convertToPublic).map(cb).map(convertToPrivate),
185
- };
186
- /**
187
- * Convert a {@link d.VNode} to a {@link d.ChildNode} in order to present a
188
- * friendlier public interface (hence, 'convertToPublic').
189
- *
190
- * @param node the virtual DOM node to convert
191
- * @returns a converted child node
192
- */
193
- const convertToPublic = (node) => ({
194
- vattrs: node.$attrs$,
195
- vchildren: node.$children$,
196
- vkey: node.$key$,
197
- vname: node.$name$,
198
- vtag: node.$tag$,
199
- vtext: node.$text$,
200
- });
201
- /**
202
- * Convert a {@link d.ChildNode} back to an equivalent {@link d.VNode} in
203
- * order to use the resulting object in the virtual DOM. The initial object was
204
- * likely created as part of presenting a public API, so converting it back
205
- * involved making it 'private' again (hence, `convertToPrivate`).
206
- *
207
- * @param node the child node to convert
208
- * @returns a converted virtual DOM node
209
- */
210
- const convertToPrivate = (node) => {
211
- if (typeof node.vtag === 'function') {
212
- const vnodeData = Object.assign({}, node.vattrs);
213
- if (node.vkey) {
214
- vnodeData.key = node.vkey;
215
- }
216
- if (node.vname) {
217
- vnodeData.name = node.vname;
218
- }
219
- return h(node.vtag, vnodeData, ...(node.vchildren || []));
220
- }
221
- const vnode = newVNode(node.vtag, node.vtext);
222
- vnode.$attrs$ = node.vattrs;
223
- vnode.$children$ = node.vchildren;
224
- vnode.$key$ = node.vkey;
225
- vnode.$name$ = node.vname;
226
- return vnode;
227
- };
228
- /**
229
- * Parse a new property value for a given property type.
230
- *
231
- * While the prop value can reasonably be expected to be of `any` type as far as TypeScript's type checker is concerned,
232
- * it is not safe to assume that the string returned by evaluating `typeof propValue` matches:
233
- * 1. `any`, the type given to `propValue` in the function signature
234
- * 2. the type stored from `propType`.
235
- *
236
- * This function provides the capability to parse/coerce a property's value to potentially any other JavaScript type.
237
- *
238
- * Property values represented in TSX preserve their type information. In the example below, the number 0 is passed to
239
- * a component. This `propValue` will preserve its type information (`typeof propValue === 'number'`). Note that is
240
- * based on the type of the value being passed in, not the type declared of the class member decorated with `@Prop`.
241
- * ```tsx
242
- * <my-cmp prop-val={0}></my-cmp>
243
- * ```
244
- *
245
- * HTML prop values on the other hand, will always a string
246
- *
247
- * @param propValue the new value to coerce to some type
248
- * @param propType the type of the prop, expressed as a binary number
249
- * @returns the parsed/coerced value
250
- */
251
- const parsePropertyValue = (propValue, propType) => {
252
- // ensure this value is of the correct prop type
253
- if (propValue != null && !isComplexType(propValue)) {
254
- if (propType & 4 /* MEMBER_FLAGS.Boolean */) {
255
- // per the HTML spec, any string value means it is a boolean true value
256
- // but we'll cheat here and say that the string "false" is the boolean false
257
- return propValue === 'false' ? false : propValue === '' || !!propValue;
258
- }
259
- if (propType & 2 /* MEMBER_FLAGS.Number */) {
260
- // force it to be a number
261
- return parseFloat(propValue);
262
- }
263
- if (propType & 1 /* MEMBER_FLAGS.String */) {
264
- // could have been passed as a number or boolean
265
- // but we still want it as a string
266
- return String(propValue);
267
- }
268
- // redundant return here for better minification
269
- return propValue;
270
- }
271
- // not sure exactly what type we want
272
- // so no need to change to a different type
273
- return propValue;
274
- };
275
- const getElement = (ref) => (getHostRef(ref).$hostElement$ );
276
- const createEvent = (ref, name, flags) => {
277
- const elm = getElement(ref);
278
- return {
279
- emit: (detail) => {
280
- return emitEvent(elm, name, {
281
- bubbles: !!(flags & 4 /* EVENT_FLAGS.Bubbles */),
282
- composed: !!(flags & 2 /* EVENT_FLAGS.Composed */),
283
- cancelable: !!(flags & 1 /* EVENT_FLAGS.Cancellable */),
284
- detail,
285
- });
286
- },
287
- };
288
- };
289
- /**
290
- * Helper function to create & dispatch a custom Event on a provided target
291
- * @param elm the target of the Event
292
- * @param name the name to give the custom Event
293
- * @param opts options for configuring a custom Event
294
- * @returns the custom Event
295
- */
296
- const emitEvent = (elm, name, opts) => {
297
- const ev = plt.ce(name, opts);
298
- elm.dispatchEvent(ev);
299
- return ev;
300
- };
301
- const rootAppliedStyles = /*@__PURE__*/ new WeakMap();
302
- const registerStyle = (scopeId, cssText, allowCS) => {
303
- let style = styles.get(scopeId);
304
- if (supportsConstructableStylesheets && allowCS) {
305
- style = (style || new CSSStyleSheet());
306
- if (typeof style === 'string') {
307
- style = cssText;
308
- }
309
- else {
310
- style.replaceSync(cssText);
311
- }
312
- }
313
- else {
314
- style = cssText;
315
- }
316
- styles.set(scopeId, style);
317
- };
318
- const addStyle = (styleContainerNode, cmpMeta, mode) => {
319
- var _a;
320
- const scopeId = getScopeId(cmpMeta);
321
- const style = styles.get(scopeId);
322
- // if an element is NOT connected then getRootNode() will return the wrong root node
323
- // so the fallback is to always use the document for the root node in those cases
324
- styleContainerNode = styleContainerNode.nodeType === 11 /* NODE_TYPE.DocumentFragment */ ? styleContainerNode : doc;
325
- if (style) {
326
- if (typeof style === 'string') {
327
- styleContainerNode = styleContainerNode.head || styleContainerNode;
328
- let appliedStyles = rootAppliedStyles.get(styleContainerNode);
329
- let styleElm;
330
- if (!appliedStyles) {
331
- rootAppliedStyles.set(styleContainerNode, (appliedStyles = new Set()));
332
- }
333
- if (!appliedStyles.has(scopeId)) {
334
- {
335
- styleElm = doc.createElement('style');
336
- styleElm.innerHTML = style;
337
- // Apply CSP nonce to the style tag if it exists
338
- const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
339
- if (nonce != null) {
340
- styleElm.setAttribute('nonce', nonce);
341
- }
342
- styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
343
- }
344
- if (appliedStyles) {
345
- appliedStyles.add(scopeId);
346
- }
347
- }
348
- }
349
- else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
350
- styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
351
- }
352
- }
353
- return scopeId;
354
- };
355
- const attachStyles = (hostRef) => {
356
- const cmpMeta = hostRef.$cmpMeta$;
357
- const elm = hostRef.$hostElement$;
358
- const flags = cmpMeta.$flags$;
359
- const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
360
- const scopeId = addStyle(elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta);
361
- if (flags & 10 /* CMP_FLAGS.needsScopedEncapsulation */) {
362
- // only required when we're NOT using native shadow dom (slot)
363
- // or this browser doesn't support native shadow dom
364
- // and this host element was NOT created with SSR
365
- // let's pick out the inner content for slot projection
366
- // create a node to represent where the original
367
- // content was first placed, which is useful later on
368
- // DOM WRITE!!
369
- elm['s-sc'] = scopeId;
370
- elm.classList.add(scopeId + '-h');
371
- if (flags & 2 /* CMP_FLAGS.scopedCssEncapsulation */) {
372
- elm.classList.add(scopeId + '-s');
373
- }
374
- }
375
- endAttachStyles();
376
- };
377
- const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
378
- /**
379
- * Production setAccessor() function based on Preact by
380
- * Jason Miller (@developit)
381
- * Licensed under the MIT License
382
- * https://github.com/developit/preact/blob/master/LICENSE
383
- *
384
- * Modified for Stencil's compiler and vdom
385
- */
386
- /**
387
- * When running a VDom render set properties present on a VDom node onto the
388
- * corresponding HTML element.
389
- *
390
- * Note that this function has special functionality for the `class`,
391
- * `style`, `key`, and `ref` attributes, as well as event handlers (like
392
- * `onClick`, etc). All others are just passed through as-is.
393
- *
394
- * @param elm the HTMLElement onto which attributes should be set
395
- * @param memberName the name of the attribute to set
396
- * @param oldValue the old value for the attribute
397
- * @param newValue the new value for the attribute
398
- * @param isSvg whether we're in an svg context or not
399
- * @param flags bitflags for Vdom variables
400
- */
401
- const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
402
- if (oldValue !== newValue) {
403
- let isProp = isMemberInElement(elm, memberName);
404
- let ln = memberName.toLowerCase();
405
- if (memberName === 'class') {
406
- const classList = elm.classList;
407
- const oldClasses = parseClassList(oldValue);
408
- const newClasses = parseClassList(newValue);
409
- classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
410
- classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
411
- }
412
- else if (memberName === 'style') {
413
- // update style attribute, css properties and values
414
- {
415
- for (const prop in oldValue) {
416
- if (!newValue || newValue[prop] == null) {
417
- if (prop.includes('-')) {
418
- elm.style.removeProperty(prop);
419
- }
420
- else {
421
- elm.style[prop] = '';
422
- }
423
- }
424
- }
425
- }
426
- for (const prop in newValue) {
427
- if (!oldValue || newValue[prop] !== oldValue[prop]) {
428
- if (prop.includes('-')) {
429
- elm.style.setProperty(prop, newValue[prop]);
430
- }
431
- else {
432
- elm.style[prop] = newValue[prop];
433
- }
434
- }
435
- }
436
- }
437
- else if (memberName === 'key')
438
- ;
439
- else if (memberName === 'ref') {
440
- // minifier will clean this up
441
- if (newValue) {
442
- newValue(elm);
443
- }
444
- }
445
- else if ((!isProp ) &&
446
- memberName[0] === 'o' &&
447
- memberName[1] === 'n') {
448
- // Event Handlers
449
- // so if the member name starts with "on" and the 3rd characters is
450
- // a capital letter, and it's not already a member on the element,
451
- // then we're assuming it's an event listener
452
- if (memberName[2] === '-') {
453
- // on- prefixed events
454
- // allows to be explicit about the dom event to listen without any magic
455
- // under the hood:
456
- // <my-cmp on-click> // listens for "click"
457
- // <my-cmp on-Click> // listens for "Click"
458
- // <my-cmp on-ionChange> // listens for "ionChange"
459
- // <my-cmp on-EVENTS> // listens for "EVENTS"
460
- memberName = memberName.slice(3);
461
- }
462
- else if (isMemberInElement(win, ln)) {
463
- // standard event
464
- // the JSX attribute could have been "onMouseOver" and the
465
- // member name "onmouseover" is on the window's prototype
466
- // so let's add the listener "mouseover", which is all lowercased
467
- memberName = ln.slice(2);
468
- }
469
- else {
470
- // custom event
471
- // the JSX attribute could have been "onMyCustomEvent"
472
- // so let's trim off the "on" prefix and lowercase the first character
473
- // and add the listener "myCustomEvent"
474
- // except for the first character, we keep the event name case
475
- memberName = ln[2] + memberName.slice(3);
476
- }
477
- if (oldValue) {
478
- plt.rel(elm, memberName, oldValue, false);
479
- }
480
- if (newValue) {
481
- plt.ael(elm, memberName, newValue, false);
482
- }
483
- }
484
- else {
485
- // Set property if it exists and it's not a SVG
486
- const isComplex = isComplexType(newValue);
487
- if ((isProp || (isComplex && newValue !== null)) && !isSvg) {
488
- try {
489
- if (!elm.tagName.includes('-')) {
490
- const n = newValue == null ? '' : newValue;
491
- // Workaround for Safari, moving the <input> caret when re-assigning the same valued
492
- if (memberName === 'list') {
493
- isProp = false;
494
- }
495
- else if (oldValue == null || elm[memberName] != n) {
496
- elm[memberName] = n;
497
- }
498
- }
499
- else {
500
- elm[memberName] = newValue;
501
- }
502
- }
503
- catch (e) { }
504
- }
505
- if (newValue == null || newValue === false) {
506
- if (newValue !== false || elm.getAttribute(memberName) === '') {
507
- {
508
- elm.removeAttribute(memberName);
509
- }
510
- }
511
- }
512
- else if ((!isProp || flags & 4 /* VNODE_FLAGS.isHost */ || isSvg) && !isComplex) {
513
- newValue = newValue === true ? '' : newValue;
514
- {
515
- elm.setAttribute(memberName, newValue);
516
- }
517
- }
518
- }
519
- }
520
- };
521
- const parseClassListRegex = /\s/;
522
- const parseClassList = (value) => (!value ? [] : value.split(parseClassListRegex));
523
- const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
524
- // if the element passed in is a shadow root, which is a document fragment
525
- // then we want to be adding attrs/props to the shadow root's "host" element
526
- // if it's not a shadow root, then we add attrs/props to the same element
527
- const elm = newVnode.$elm$.nodeType === 11 /* NODE_TYPE.DocumentFragment */ && newVnode.$elm$.host
528
- ? newVnode.$elm$.host
529
- : newVnode.$elm$;
530
- const oldVnodeAttrs = (oldVnode && oldVnode.$attrs$) || EMPTY_OBJ;
531
- const newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ;
532
- {
533
- // remove attributes no longer present on the vnode by setting them to undefined
534
- for (memberName in oldVnodeAttrs) {
535
- if (!(memberName in newVnodeAttrs)) {
536
- setAccessor(elm, memberName, oldVnodeAttrs[memberName], undefined, isSvgMode, newVnode.$flags$);
537
- }
538
- }
539
- }
540
- // add new & update changed attributes
541
- for (memberName in newVnodeAttrs) {
542
- setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode, newVnode.$flags$);
543
- }
544
- };
545
- /**
546
- * Create a DOM Node corresponding to one of the children of a given VNode.
547
- *
548
- * @param oldParentVNode the parent VNode from the previous render
549
- * @param newParentVNode the parent VNode from the current render
550
- * @param childIndex the index of the VNode, in the _new_ parent node's
551
- * children, for which we will create a new DOM node
552
- * @param parentElm the parent DOM node which our new node will be a child of
553
- * @returns the newly created node
554
- */
555
- const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
556
- // tslint:disable-next-line: prefer-const
557
- const newVNode = newParentVNode.$children$[childIndex];
558
- let i = 0;
559
- let elm;
560
- let childNode;
561
- if (newVNode.$text$ !== null) {
562
- // create text node
563
- elm = newVNode.$elm$ = doc.createTextNode(newVNode.$text$);
564
- }
565
- else {
566
- if (!isSvgMode) {
567
- isSvgMode = newVNode.$tag$ === 'svg';
568
- }
569
- // create element
570
- elm = newVNode.$elm$ = (doc.createElementNS(isSvgMode ? SVG_NS : HTML_NS, newVNode.$tag$)
571
- );
572
- if (isSvgMode && newVNode.$tag$ === 'foreignObject') {
573
- isSvgMode = false;
574
- }
575
- // add css classes, attrs, props, listeners, etc.
576
- {
577
- updateElement(null, newVNode, isSvgMode);
578
- }
579
- if (isDef(scopeId) && elm['s-si'] !== scopeId) {
580
- // if there is a scopeId and this is the initial render
581
- // then let's add the scopeId as a css class
582
- elm.classList.add((elm['s-si'] = scopeId));
583
- }
584
- if (newVNode.$children$) {
585
- for (i = 0; i < newVNode.$children$.length; ++i) {
586
- // create the node
587
- childNode = createElm(oldParentVNode, newVNode, i);
588
- // return node could have been null
589
- if (childNode) {
590
- // append our new node
591
- elm.appendChild(childNode);
592
- }
593
- }
594
- }
595
- {
596
- if (newVNode.$tag$ === 'svg') {
597
- // Only reset the SVG context when we're exiting <svg> element
598
- isSvgMode = false;
599
- }
600
- else if (elm.tagName === 'foreignObject') {
601
- // Reenter SVG context when we're exiting <foreignObject> element
602
- isSvgMode = true;
603
- }
604
- }
605
- }
606
- return elm;
607
- };
608
- /**
609
- * Create DOM nodes corresponding to a list of {@link d.Vnode} objects and
610
- * add them to the DOM in the appropriate place.
611
- *
612
- * @param parentElm the DOM node which should be used as a parent for the new
613
- * DOM nodes
614
- * @param before a child of the `parentElm` which the new children should be
615
- * inserted before (optional)
616
- * @param parentVNode the parent virtual DOM node
617
- * @param vnodes the new child virtual DOM nodes to produce DOM nodes for
618
- * @param startIdx the index in the child virtual DOM nodes at which to start
619
- * creating DOM nodes (inclusive)
620
- * @param endIdx the index in the child virtual DOM nodes at which to stop
621
- * creating DOM nodes (inclusive)
622
- */
623
- const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
624
- let containerElm = (parentElm);
625
- let childNode;
626
- if (containerElm.shadowRoot && containerElm.tagName === hostTagName) {
627
- containerElm = containerElm.shadowRoot;
628
- }
629
- for (; startIdx <= endIdx; ++startIdx) {
630
- if (vnodes[startIdx]) {
631
- childNode = createElm(null, parentVNode, startIdx);
632
- if (childNode) {
633
- vnodes[startIdx].$elm$ = childNode;
634
- containerElm.insertBefore(childNode, before);
635
- }
636
- }
637
- }
638
- };
639
- /**
640
- * Remove the DOM elements corresponding to a list of {@link d.VNode} objects.
641
- * This can be used to, for instance, clean up after a list of children which
642
- * should no longer be shown.
643
- *
644
- * This function also handles some of Stencil's slot relocation logic.
645
- *
646
- * @param vnodes a list of virtual DOM nodes to remove
647
- * @param startIdx the index at which to start removing nodes (inclusive)
648
- * @param endIdx the index at which to stop removing nodes (inclusive)
649
- */
650
- const removeVnodes = (vnodes, startIdx, endIdx) => {
651
- for (let index = startIdx; index <= endIdx; ++index) {
652
- const vnode = vnodes[index];
653
- if (vnode) {
654
- const elm = vnode.$elm$;
655
- nullifyVNodeRefs(vnode);
656
- if (elm) {
657
- // remove the vnode's element from the dom
658
- elm.remove();
659
- }
660
- }
661
- }
662
- };
663
- /**
664
- * Reconcile the children of a new VNode with the children of an old VNode by
665
- * traversing the two collections of children, identifying nodes that are
666
- * conserved or changed, calling out to `patch` to make any necessary
667
- * updates to the DOM, and rearranging DOM nodes as needed.
668
- *
669
- * The algorithm for reconciling children works by analyzing two 'windows' onto
670
- * the two arrays of children (`oldCh` and `newCh`). We keep track of the
671
- * 'windows' by storing start and end indices and references to the
672
- * corresponding array entries. Initially the two 'windows' are basically equal
673
- * to the entire array, but we progressively narrow the windows until there are
674
- * no children left to update by doing the following:
675
- *
676
- * 1. Skip any `null` entries at the beginning or end of the two arrays, so
677
- * that if we have an initial array like the following we'll end up dealing
678
- * only with a window bounded by the highlighted elements:
679
- *
680
- * [null, null, VNode1 , ... , VNode2, null, null]
681
- * ^^^^^^ ^^^^^^
682
- *
683
- * 2. Check to see if the elements at the head and tail positions are equal
684
- * across the windows. This will basically detect elements which haven't
685
- * been added, removed, or changed position, i.e. if you had the following
686
- * VNode elements (represented as HTML):
687
- *
688
- * oldVNode: `<div><p><span>HEY</span></p></div>`
689
- * newVNode: `<div><p><span>THERE</span></p></div>`
690
- *
691
- * Then when comparing the children of the `<div>` tag we check the equality
692
- * of the VNodes corresponding to the `<p>` tags and, since they are the
693
- * same tag in the same position, we'd be able to avoid completely
694
- * re-rendering the subtree under them with a new DOM element and would just
695
- * call out to `patch` to handle reconciling their children and so on.
696
- *
697
- * 3. Check, for both windows, to see if the element at the beginning of the
698
- * window corresponds to the element at the end of the other window. This is
699
- * a heuristic which will let us identify _some_ situations in which
700
- * elements have changed position, for instance it _should_ detect that the
701
- * children nodes themselves have not changed but merely moved in the
702
- * following example:
703
- *
704
- * oldVNode: `<div><element-one /><element-two /></div>`
705
- * newVNode: `<div><element-two /><element-one /></div>`
706
- *
707
- * If we find cases like this then we also need to move the concrete DOM
708
- * elements corresponding to the moved children to write the re-order to the
709
- * DOM.
710
- *
711
- * 4. Finally, if VNodes have the `key` attribute set on them we check for any
712
- * nodes in the old children which have the same key as the first element in
713
- * our window on the new children. If we find such a node we handle calling
714
- * out to `patch`, moving relevant DOM nodes, and so on, in accordance with
715
- * what we find.
716
- *
717
- * Finally, once we've narrowed our 'windows' to the point that either of them
718
- * collapse (i.e. they have length 0) we then handle any remaining VNode
719
- * insertion or deletion that needs to happen to get a DOM state that correctly
720
- * reflects the new child VNodes. If, for instance, after our window on the old
721
- * children has collapsed we still have more nodes on the new children that
722
- * we haven't dealt with yet then we need to add them, or if the new children
723
- * collapse but we still have unhandled _old_ children then we need to make
724
- * sure the corresponding DOM nodes are removed.
725
- *
726
- * @param parentElm the node into which the parent VNode is rendered
727
- * @param oldCh the old children of the parent node
728
- * @param newVNode the new VNode which will replace the parent
729
- * @param newCh the new children of the parent node
730
- */
731
- const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
732
- let oldStartIdx = 0;
733
- let newStartIdx = 0;
734
- let idxInOld = 0;
735
- let i = 0;
736
- let oldEndIdx = oldCh.length - 1;
737
- let oldStartVnode = oldCh[0];
738
- let oldEndVnode = oldCh[oldEndIdx];
739
- let newEndIdx = newCh.length - 1;
740
- let newStartVnode = newCh[0];
741
- let newEndVnode = newCh[newEndIdx];
742
- let node;
743
- let elmToMove;
744
- while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
745
- if (oldStartVnode == null) {
746
- // VNode might have been moved left
747
- oldStartVnode = oldCh[++oldStartIdx];
748
- }
749
- else if (oldEndVnode == null) {
750
- oldEndVnode = oldCh[--oldEndIdx];
751
- }
752
- else if (newStartVnode == null) {
753
- newStartVnode = newCh[++newStartIdx];
754
- }
755
- else if (newEndVnode == null) {
756
- newEndVnode = newCh[--newEndIdx];
757
- }
758
- else if (isSameVnode(oldStartVnode, newStartVnode)) {
759
- // if the start nodes are the same then we should patch the new VNode
760
- // onto the old one, and increment our `newStartIdx` and `oldStartIdx`
761
- // indices to reflect that. We don't need to move any DOM Nodes around
762
- // since things are matched up in order.
763
- patch(oldStartVnode, newStartVnode);
764
- oldStartVnode = oldCh[++oldStartIdx];
765
- newStartVnode = newCh[++newStartIdx];
766
- }
767
- else if (isSameVnode(oldEndVnode, newEndVnode)) {
768
- // likewise, if the end nodes are the same we patch new onto old and
769
- // decrement our end indices, and also likewise in this case we don't
770
- // need to move any DOM Nodes.
771
- patch(oldEndVnode, newEndVnode);
772
- oldEndVnode = oldCh[--oldEndIdx];
773
- newEndVnode = newCh[--newEndIdx];
774
- }
775
- else if (isSameVnode(oldStartVnode, newEndVnode)) {
776
- patch(oldStartVnode, newEndVnode);
777
- // We need to move the element for `oldStartVnode` into a position which
778
- // will be appropriate for `newEndVnode`. For this we can use
779
- // `.insertBefore` and `oldEndVnode.$elm$.nextSibling`. If there is a
780
- // sibling for `oldEndVnode.$elm$` then we want to move the DOM node for
781
- // `oldStartVnode` between `oldEndVnode` and it's sibling, like so:
782
- //
783
- // <old-start-node />
784
- // <some-intervening-node />
785
- // <old-end-node />
786
- // <!-- -> <-- `oldStartVnode.$elm$` should be inserted here
787
- // <next-sibling />
788
- //
789
- // If instead `oldEndVnode.$elm$` has no sibling then we just want to put
790
- // the node for `oldStartVnode` at the end of the children of
791
- // `parentElm`. Luckily, `Node.nextSibling` will return `null` if there
792
- // aren't any siblings, and passing `null` to `Node.insertBefore` will
793
- // append it to the children of the parent element.
794
- parentElm.insertBefore(oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
795
- oldStartVnode = oldCh[++oldStartIdx];
796
- newEndVnode = newCh[--newEndIdx];
797
- }
798
- else if (isSameVnode(oldEndVnode, newStartVnode)) {
799
- patch(oldEndVnode, newStartVnode);
800
- // We've already checked above if `oldStartVnode` and `newStartVnode` are
801
- // the same node, so since we're here we know that they are not. Thus we
802
- // can move the element for `oldEndVnode` _before_ the element for
803
- // `oldStartVnode`, leaving `oldStartVnode` to be reconciled in the
804
- // future.
805
- parentElm.insertBefore(oldEndVnode.$elm$, oldStartVnode.$elm$);
806
- oldEndVnode = oldCh[--oldEndIdx];
807
- newStartVnode = newCh[++newStartIdx];
808
- }
809
- else {
810
- // Here we do some checks to match up old and new nodes based on the
811
- // `$key$` attribute, which is set by putting a `key="my-key"` attribute
812
- // in the JSX for a DOM element in the implementation of a Stencil
813
- // component.
814
- //
815
- // First we check to see if there are any nodes in the array of old
816
- // children which have the same key as the first node in the new
817
- // children.
818
- idxInOld = -1;
819
- {
820
- for (i = oldStartIdx; i <= oldEndIdx; ++i) {
821
- if (oldCh[i] && oldCh[i].$key$ !== null && oldCh[i].$key$ === newStartVnode.$key$) {
822
- idxInOld = i;
823
- break;
824
- }
825
- }
826
- }
827
- if (idxInOld >= 0) {
828
- // We found a node in the old children which matches up with the first
829
- // node in the new children! So let's deal with that
830
- elmToMove = oldCh[idxInOld];
831
- if (elmToMove.$tag$ !== newStartVnode.$tag$) {
832
- // the tag doesn't match so we'll need a new DOM element
833
- node = createElm(oldCh && oldCh[newStartIdx], newVNode, idxInOld);
834
- }
835
- else {
836
- patch(elmToMove, newStartVnode);
837
- // invalidate the matching old node so that we won't try to update it
838
- // again later on
839
- oldCh[idxInOld] = undefined;
840
- node = elmToMove.$elm$;
841
- }
842
- newStartVnode = newCh[++newStartIdx];
843
- }
844
- else {
845
- // We either didn't find an element in the old children that matches
846
- // the key of the first new child OR the build is not using `key`
847
- // attributes at all. In either case we need to create a new element
848
- // for the new node.
849
- node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx);
850
- newStartVnode = newCh[++newStartIdx];
851
- }
852
- if (node) {
853
- // if we created a new node then handle inserting it to the DOM
854
- {
855
- oldStartVnode.$elm$.parentNode.insertBefore(node, oldStartVnode.$elm$);
856
- }
857
- }
858
- }
859
- }
860
- if (oldStartIdx > oldEndIdx) {
861
- // we have some more new nodes to add which don't match up with old nodes
862
- addVnodes(parentElm, newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$, newVNode, newCh, newStartIdx, newEndIdx);
863
- }
864
- else if (newStartIdx > newEndIdx) {
865
- // there are nodes in the `oldCh` array which no longer correspond to nodes
866
- // in the new array, so lets remove them (which entails cleaning up the
867
- // relevant DOM nodes)
868
- removeVnodes(oldCh, oldStartIdx, oldEndIdx);
869
- }
870
- };
871
- /**
872
- * Compare two VNodes to determine if they are the same
873
- *
874
- * **NB**: This function is an equality _heuristic_ based on the available
875
- * information set on the two VNodes and can be misleading under certain
876
- * circumstances. In particular, if the two nodes do not have `key` attrs
877
- * (available under `$key$` on VNodes) then the function falls back on merely
878
- * checking that they have the same tag.
879
- *
880
- * So, in other words, if `key` attrs are not set on VNodes which may be
881
- * changing order within a `children` array or something along those lines then
882
- * we could obtain a false negative and then have to do needless re-rendering
883
- * (i.e. we'd say two VNodes aren't equal when in fact they should be).
884
- *
885
- * @param leftVNode the first VNode to check
886
- * @param rightVNode the second VNode to check
887
- * @returns whether they're equal or not
888
- */
889
- const isSameVnode = (leftVNode, rightVNode) => {
890
- // compare if two vnode to see if they're "technically" the same
891
- // need to have the same element tag, and same key to be the same
892
- if (leftVNode.$tag$ === rightVNode.$tag$) {
893
- // this will be set if components in the build have `key` attrs set on them
894
- {
895
- return leftVNode.$key$ === rightVNode.$key$;
896
- }
897
- }
898
- return false;
899
- };
900
- /**
901
- * Handle reconciling an outdated VNode with a new one which corresponds to
902
- * it. This function handles flushing updates to the DOM and reconciling the
903
- * children of the two nodes (if any).
904
- *
905
- * @param oldVNode an old VNode whose DOM element and children we want to update
906
- * @param newVNode a new VNode representing an updated version of the old one
907
- */
908
- const patch = (oldVNode, newVNode) => {
909
- const elm = (newVNode.$elm$ = oldVNode.$elm$);
910
- const oldChildren = oldVNode.$children$;
911
- const newChildren = newVNode.$children$;
912
- const tag = newVNode.$tag$;
913
- const text = newVNode.$text$;
914
- if (text === null) {
915
- {
916
- // test if we're rendering an svg element, or still rendering nodes inside of one
917
- // only add this to the when the compiler sees we're using an svg somewhere
918
- isSvgMode = tag === 'svg' ? true : tag === 'foreignObject' ? false : isSvgMode;
919
- }
920
- {
921
- if (tag === 'slot')
922
- ;
923
- else {
924
- // either this is the first render of an element OR it's an update
925
- // AND we already know it's possible it could have changed
926
- // this updates the element's css classes, attrs, props, listeners, etc.
927
- updateElement(oldVNode, newVNode, isSvgMode);
928
- }
929
- }
930
- if (oldChildren !== null && newChildren !== null) {
931
- // looks like there's child vnodes for both the old and new vnodes
932
- // so we need to call `updateChildren` to reconcile them
933
- updateChildren(elm, oldChildren, newVNode, newChildren);
934
- }
935
- else if (newChildren !== null) {
936
- // no old child vnodes, but there are new child vnodes to add
937
- if (oldVNode.$text$ !== null) {
938
- // the old vnode was text, so be sure to clear it out
939
- elm.textContent = '';
940
- }
941
- // add the new vnode children
942
- addVnodes(elm, null, newVNode, newChildren, 0, newChildren.length - 1);
943
- }
944
- else if (oldChildren !== null) {
945
- // no new child vnodes, but there are old child vnodes to remove
946
- removeVnodes(oldChildren, 0, oldChildren.length - 1);
947
- }
948
- if (isSvgMode && tag === 'svg') {
949
- isSvgMode = false;
950
- }
951
- }
952
- else if (oldVNode.$text$ !== text) {
953
- // update the text content for the text only vnode
954
- // and also only if the text is different than before
955
- elm.data = text;
956
- }
957
- };
958
- /**
959
- * 'Nullify' any VDom `ref` callbacks on a VDom node or its children by
960
- * calling them with `null`. This signals that the DOM element corresponding to
961
- * the VDom node has been removed from the DOM.
962
- *
963
- * @param vNode a virtual DOM node
964
- */
965
- const nullifyVNodeRefs = (vNode) => {
966
- {
967
- vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
968
- vNode.$children$ && vNode.$children$.map(nullifyVNodeRefs);
969
- }
970
- };
971
- /**
972
- * The main entry point for Stencil's virtual DOM-based rendering engine
973
- *
974
- * Given a {@link d.HostRef} container and some virtual DOM nodes, this
975
- * function will handle creating a virtual DOM tree with a single root, patching
976
- * the current virtual DOM tree onto an old one (if any), dealing with slot
977
- * relocation, and reflecting attributes.
978
- *
979
- * @param hostRef data needed to root and render the virtual DOM tree, such as
980
- * the DOM node into which it should be rendered.
981
- * @param renderFnResults the virtual DOM nodes to be rendered
982
- * @param isInitialLoad whether or not this is the first call after page load
983
- */
984
- const renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
985
- const hostElm = hostRef.$hostElement$;
986
- const oldVNode = hostRef.$vnode$ || newVNode(null, null);
987
- // if `renderFnResults` is a Host node then we can use it directly. If not,
988
- // we need to call `h` again to wrap the children of our component in a
989
- // 'dummy' Host node (well, an empty vnode) since `renderVdom` assumes
990
- // implicitly that the top-level vdom node is 1) an only child and 2)
991
- // contains attrs that need to be set on the host element.
992
- const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
993
- hostTagName = hostElm.tagName;
994
- // On the first render and *only* on the first render we want to check for
995
- // any attributes set on the host element which are also set on the vdom
996
- // node. If we find them, we override the value on the VDom node attrs with
997
- // the value from the host element, which allows developers building apps
998
- // with Stencil components to override e.g. the `role` attribute on a
999
- // component even if it's already set on the `Host`.
1000
- if (isInitialLoad && rootVnode.$attrs$) {
1001
- for (const key of Object.keys(rootVnode.$attrs$)) {
1002
- // We have a special implementation in `setAccessor` for `style` and
1003
- // `class` which reconciles values coming from the VDom with values
1004
- // already present on the DOM element, so we don't want to override those
1005
- // attributes on the VDom tree with values from the host element if they
1006
- // are present.
1007
- //
1008
- // Likewise, `ref` and `key` are special internal values for the Stencil
1009
- // runtime and we don't want to override those either.
1010
- if (hostElm.hasAttribute(key) && !['key', 'ref', 'style', 'class'].includes(key)) {
1011
- rootVnode.$attrs$[key] = hostElm[key];
1012
- }
1013
- }
1014
- }
1015
- rootVnode.$tag$ = null;
1016
- rootVnode.$flags$ |= 4 /* VNODE_FLAGS.isHost */;
1017
- hostRef.$vnode$ = rootVnode;
1018
- rootVnode.$elm$ = oldVNode.$elm$ = (hostElm.shadowRoot || hostElm );
1019
- {
1020
- scopeId = hostElm['s-sc'];
1021
- }
1022
- // synchronous patch
1023
- patch(oldVNode, rootVnode);
1024
- };
1025
- const attachToAncestor = (hostRef, ancestorComponent) => {
1026
- if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) {
1027
- ancestorComponent['s-p'].push(new Promise((r) => (hostRef.$onRenderResolve$ = r)));
1028
- }
1029
- };
1030
- const scheduleUpdate = (hostRef, isInitialLoad) => {
1031
- {
1032
- hostRef.$flags$ |= 16 /* HOST_FLAGS.isQueuedForUpdate */;
1033
- }
1034
- if (hostRef.$flags$ & 4 /* HOST_FLAGS.isWaitingForChildren */) {
1035
- hostRef.$flags$ |= 512 /* HOST_FLAGS.needsRerender */;
1036
- return;
1037
- }
1038
- attachToAncestor(hostRef, hostRef.$ancestorComponent$);
1039
- // there is no ancestor component or the ancestor component
1040
- // has already fired off its lifecycle update then
1041
- // fire off the initial update
1042
- const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
1043
- return writeTask(dispatch) ;
1044
- };
1045
- /**
1046
- * Dispatch initial-render and update lifecycle hooks, enqueuing calls to
1047
- * component lifecycle methods like `componentWillLoad` as well as
1048
- * {@link updateComponent}, which will kick off the virtual DOM re-render.
1049
- *
1050
- * @param hostRef a reference to a host DOM node
1051
- * @param isInitialLoad whether we're on the initial load or not
1052
- * @returns an empty Promise which is used to enqueue a series of operations for
1053
- * the component
1054
- */
1055
- const dispatchHooks = (hostRef, isInitialLoad) => {
1056
- const endSchedule = createTime('scheduleUpdate', hostRef.$cmpMeta$.$tagName$);
1057
- const instance = hostRef.$lazyInstance$ ;
1058
- // We're going to use this variable together with `enqueue` to implement a
1059
- // little promise-based queue. We start out with it `undefined`. When we add
1060
- // the first function to the queue we'll set this variable to be that
1061
- // function's return value. When we attempt to add subsequent values to the
1062
- // queue we'll check that value and, if it was a `Promise`, we'll then chain
1063
- // the new function off of that `Promise` using `.then()`. This will give our
1064
- // queue two nice properties:
1065
- //
1066
- // 1. If all functions added to the queue are synchronous they'll be called
1067
- // synchronously right away.
1068
- // 2. If all functions added to the queue are asynchronous they'll all be
1069
- // called in order after `dispatchHooks` exits.
1070
- let maybePromise;
1071
- if (isInitialLoad) {
1072
- {
1073
- hostRef.$flags$ |= 256 /* HOST_FLAGS.isListenReady */;
1074
- if (hostRef.$queuedListeners$) {
1075
- hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
1076
- hostRef.$queuedListeners$ = undefined;
1077
- }
1078
- }
1079
- {
1080
- // If `componentWillLoad` returns a `Promise` then we want to wait on
1081
- // whatever's going on in that `Promise` before we launch into
1082
- // rendering the component, doing other lifecycle stuff, etc. So
1083
- // in that case we assign the returned promise to the variable we
1084
- // declared above to hold a possible 'queueing' Promise
1085
- maybePromise = safeCall(instance, 'componentWillLoad');
1086
- }
1087
- }
1088
- endSchedule();
1089
- return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));
1090
- };
1091
- /**
1092
- * This function uses a Promise to implement a simple first-in, first-out queue
1093
- * of functions to be called.
1094
- *
1095
- * The queue is ordered on the basis of the first argument. If it's
1096
- * `undefined`, then nothing is on the queue yet, so the provided function can
1097
- * be called synchronously (although note that this function may return a
1098
- * `Promise`). The idea is that then the return value of that enqueueing
1099
- * operation is kept around, so that if it was a `Promise` then subsequent
1100
- * functions can be enqueued by calling this function again with that `Promise`
1101
- * as the first argument.
1102
- *
1103
- * @param maybePromise either a `Promise` which should resolve before the next function is called or an 'empty' sentinel
1104
- * @param fn a function to enqueue
1105
- * @returns either a `Promise` or the return value of the provided function
1106
- */
1107
- const enqueue = (maybePromise, fn) => isPromisey(maybePromise) ? maybePromise.then(fn) : fn();
1108
- /**
1109
- * Check that a value is a `Promise`. To check, we first see if the value is an
1110
- * instance of the `Promise` global. In a few circumstances, in particular if
1111
- * the global has been overwritten, this is could be misleading, so we also do
1112
- * a little 'duck typing' check to see if the `.then` property of the value is
1113
- * defined and a function.
1114
- *
1115
- * @param maybePromise it might be a promise!
1116
- * @returns whether it is or not
1117
- */
1118
- const isPromisey = (maybePromise) => maybePromise instanceof Promise ||
1119
- (maybePromise && maybePromise.then && typeof maybePromise.then === 'function');
1120
- /**
1121
- * Update a component given reference to its host elements and so on.
1122
- *
1123
- * @param hostRef an object containing references to the element's host node,
1124
- * VDom nodes, and other metadata
1125
- * @param instance a reference to the underlying host element where it will be
1126
- * rendered
1127
- * @param isInitialLoad whether or not this function is being called as part of
1128
- * the first render cycle
1129
- */
1130
- const updateComponent = async (hostRef, instance, isInitialLoad) => {
1131
- var _a;
1132
- const elm = hostRef.$hostElement$;
1133
- const endUpdate = createTime('update', hostRef.$cmpMeta$.$tagName$);
1134
- const rc = elm['s-rc'];
1135
- if (isInitialLoad) {
1136
- // DOM WRITE!
1137
- attachStyles(hostRef);
1138
- }
1139
- const endRender = createTime('render', hostRef.$cmpMeta$.$tagName$);
1140
- {
1141
- callRender(hostRef, instance, elm, isInitialLoad);
1142
- }
1143
- if (rc) {
1144
- // ok, so turns out there are some child host elements
1145
- // waiting on this parent element to load
1146
- // let's fire off all update callbacks waiting
1147
- rc.map((cb) => cb());
1148
- elm['s-rc'] = undefined;
1149
- }
1150
- endRender();
1151
- endUpdate();
1152
- {
1153
- const childrenPromises = (_a = elm['s-p']) !== null && _a !== void 0 ? _a : [];
1154
- const postUpdate = () => postUpdateComponent(hostRef);
1155
- if (childrenPromises.length === 0) {
1156
- postUpdate();
1157
- }
1158
- else {
1159
- Promise.all(childrenPromises).then(postUpdate);
1160
- hostRef.$flags$ |= 4 /* HOST_FLAGS.isWaitingForChildren */;
1161
- childrenPromises.length = 0;
1162
- }
1163
- }
1164
- };
1165
- /**
1166
- * Handle making the call to the VDom renderer with the proper context given
1167
- * various build variables
1168
- *
1169
- * @param hostRef an object containing references to the element's host node,
1170
- * VDom nodes, and other metadata
1171
- * @param instance a reference to the underlying host element where it will be
1172
- * rendered
1173
- * @param elm the Host element for the component
1174
- * @param isInitialLoad whether or not this function is being called as part of
1175
- * @returns an empty promise
1176
- */
1177
- const callRender = (hostRef, instance, elm, isInitialLoad) => {
1178
- try {
1179
- renderingRef = instance;
1180
- instance = instance.render() ;
1181
- {
1182
- hostRef.$flags$ &= ~16 /* HOST_FLAGS.isQueuedForUpdate */;
1183
- }
1184
- {
1185
- hostRef.$flags$ |= 2 /* HOST_FLAGS.hasRendered */;
1186
- }
1187
- {
1188
- {
1189
- // looks like we've got child nodes to render into this host element
1190
- // or we need to update the css class/attrs on the host element
1191
- // DOM WRITE!
1192
- {
1193
- renderVdom(hostRef, instance, isInitialLoad);
1194
- }
1195
- }
1196
- }
1197
- }
1198
- catch (e) {
1199
- consoleError(e, hostRef.$hostElement$);
1200
- }
1201
- renderingRef = null;
1202
- return null;
1203
- };
1204
- const getRenderingRef = () => renderingRef;
1205
- const postUpdateComponent = (hostRef) => {
1206
- const tagName = hostRef.$cmpMeta$.$tagName$;
1207
- const elm = hostRef.$hostElement$;
1208
- const endPostUpdate = createTime('postUpdate', tagName);
1209
- const instance = hostRef.$lazyInstance$ ;
1210
- const ancestorComponent = hostRef.$ancestorComponent$;
1211
- {
1212
- safeCall(instance, 'componentDidRender');
1213
- }
1214
- if (!(hostRef.$flags$ & 64 /* HOST_FLAGS.hasLoadedComponent */)) {
1215
- hostRef.$flags$ |= 64 /* HOST_FLAGS.hasLoadedComponent */;
1216
- {
1217
- // DOM WRITE!
1218
- addHydratedFlag(elm);
1219
- }
1220
- {
1221
- safeCall(instance, 'componentDidLoad');
1222
- }
1223
- endPostUpdate();
1224
- {
1225
- hostRef.$onReadyResolve$(elm);
1226
- if (!ancestorComponent) {
1227
- appDidLoad();
1228
- }
1229
- }
1230
- }
1231
- else {
1232
- endPostUpdate();
1233
- }
1234
- {
1235
- hostRef.$onInstanceResolve$(elm);
1236
- }
1237
- // load events fire from bottom to top
1238
- // the deepest elements load first then bubbles up
1239
- {
1240
- if (hostRef.$onRenderResolve$) {
1241
- hostRef.$onRenderResolve$();
1242
- hostRef.$onRenderResolve$ = undefined;
1243
- }
1244
- if (hostRef.$flags$ & 512 /* HOST_FLAGS.needsRerender */) {
1245
- nextTick(() => scheduleUpdate(hostRef, false));
1246
- }
1247
- hostRef.$flags$ &= ~(4 /* HOST_FLAGS.isWaitingForChildren */ | 512 /* HOST_FLAGS.needsRerender */);
1248
- }
1249
- // ( •_•)
1250
- // ( •_•)>⌐■-■
1251
- // (⌐■_■)
1252
- };
1253
- const forceUpdate = (ref) => {
1254
- {
1255
- const hostRef = getHostRef(ref);
1256
- const isConnected = hostRef.$hostElement$.isConnected;
1257
- if (isConnected &&
1258
- (hostRef.$flags$ & (2 /* HOST_FLAGS.hasRendered */ | 16 /* HOST_FLAGS.isQueuedForUpdate */)) === 2 /* HOST_FLAGS.hasRendered */) {
1259
- scheduleUpdate(hostRef, false);
1260
- }
1261
- // Returns "true" when the forced update was successfully scheduled
1262
- return isConnected;
1263
- }
1264
- };
1265
- const appDidLoad = (who) => {
1266
- // on appload
1267
- // we have finish the first big initial render
1268
- {
1269
- addHydratedFlag(doc.documentElement);
1270
- }
1271
- nextTick(() => emitEvent(win, 'appload', { detail: { namespace: NAMESPACE } }));
1272
- };
1273
- const safeCall = (instance, method, arg) => {
1274
- if (instance && instance[method]) {
1275
- try {
1276
- return instance[method](arg);
1277
- }
1278
- catch (e) {
1279
- consoleError(e);
1280
- }
1281
- }
1282
- return undefined;
1283
- };
1284
- const addHydratedFlag = (elm) => elm.classList.add('hydrated')
1285
- ;
1286
- const getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
1287
- const setValue = (ref, propName, newVal, cmpMeta) => {
1288
- // check our new property value against our internal value
1289
- const hostRef = getHostRef(ref);
1290
- const elm = hostRef.$hostElement$ ;
1291
- const oldVal = hostRef.$instanceValues$.get(propName);
1292
- const flags = hostRef.$flags$;
1293
- const instance = hostRef.$lazyInstance$ ;
1294
- newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]);
1295
- // explicitly check for NaN on both sides, as `NaN === NaN` is always false
1296
- const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
1297
- const didValueChange = newVal !== oldVal && !areBothNaN;
1298
- if ((!(flags & 8 /* HOST_FLAGS.isConstructingInstance */) || oldVal === undefined) && didValueChange) {
1299
- // gadzooks! the property's value has changed!!
1300
- // set our new value!
1301
- hostRef.$instanceValues$.set(propName, newVal);
1302
- if (instance) {
1303
- // get an array of method names of watch functions to call
1304
- if (cmpMeta.$watchers$ && flags & 128 /* HOST_FLAGS.isWatchReady */) {
1305
- const watchMethods = cmpMeta.$watchers$[propName];
1306
- if (watchMethods) {
1307
- // this instance is watching for when this property changed
1308
- watchMethods.map((watchMethodName) => {
1309
- try {
1310
- // fire off each of the watch methods that are watching this property
1311
- instance[watchMethodName](newVal, oldVal, propName);
1312
- }
1313
- catch (e) {
1314
- consoleError(e, elm);
1315
- }
1316
- });
1317
- }
1318
- }
1319
- if ((flags & (2 /* HOST_FLAGS.hasRendered */ | 16 /* HOST_FLAGS.isQueuedForUpdate */)) === 2 /* HOST_FLAGS.hasRendered */) {
1320
- // looks like this value actually changed, so we've got work to do!
1321
- // but only if we've already rendered, otherwise just chill out
1322
- // queue that we need to do an update, but don't worry about queuing
1323
- // up millions cuz this function ensures it only runs once
1324
- scheduleUpdate(hostRef, false);
1325
- }
1326
- }
1327
- }
1328
- };
1329
- /**
1330
- * Attach a series of runtime constructs to a compiled Stencil component
1331
- * constructor, including getters and setters for the `@Prop` and `@State`
1332
- * decorators, callbacks for when attributes change, and so on.
1333
- *
1334
- * @param Cstr the constructor for a component that we need to process
1335
- * @param cmpMeta metadata collected previously about the component
1336
- * @param flags a number used to store a series of bit flags
1337
- * @returns a reference to the same constructor passed in (but now mutated)
1338
- */
1339
- const proxyComponent = (Cstr, cmpMeta, flags) => {
1340
- var _a;
1341
- if (cmpMeta.$members$) {
1342
- if (Cstr.watchers) {
1343
- cmpMeta.$watchers$ = Cstr.watchers;
1344
- }
1345
- // It's better to have a const than two Object.entries()
1346
- const members = Object.entries(cmpMeta.$members$);
1347
- const prototype = Cstr.prototype;
1348
- members.map(([memberName, [memberFlags]]) => {
1349
- if ((memberFlags & 31 /* MEMBER_FLAGS.Prop */ ||
1350
- ((flags & 2 /* PROXY_FLAGS.proxyState */) && memberFlags & 32 /* MEMBER_FLAGS.State */))) {
1351
- // proxyComponent - prop
1352
- Object.defineProperty(prototype, memberName, {
1353
- get() {
1354
- // proxyComponent, get value
1355
- return getValue(this, memberName);
1356
- },
1357
- set(newValue) {
1358
- // proxyComponent, set value
1359
- setValue(this, memberName, newValue, cmpMeta);
1360
- },
1361
- configurable: true,
1362
- enumerable: true,
1363
- });
1364
- }
1365
- else if (flags & 1 /* PROXY_FLAGS.isElementConstructor */ &&
1366
- memberFlags & 64 /* MEMBER_FLAGS.Method */) {
1367
- // proxyComponent - method
1368
- Object.defineProperty(prototype, memberName, {
1369
- value(...args) {
1370
- const ref = getHostRef(this);
1371
- return ref.$onInstancePromise$.then(() => ref.$lazyInstance$[memberName](...args));
1372
- },
1373
- });
1374
- }
1375
- });
1376
- if ((flags & 1 /* PROXY_FLAGS.isElementConstructor */)) {
1377
- const attrNameToPropName = new Map();
1378
- prototype.attributeChangedCallback = function (attrName, oldValue, newValue) {
1379
- plt.jmp(() => {
1380
- const propName = attrNameToPropName.get(attrName);
1381
- // In a web component lifecycle the attributeChangedCallback runs prior to connectedCallback
1382
- // in the case where an attribute was set inline.
1383
- // ```html
1384
- // <my-component some-attribute="some-value"></my-component>
1385
- // ```
1386
- //
1387
- // There is an edge case where a developer sets the attribute inline on a custom element and then
1388
- // programmatically changes it before it has been upgraded as shown below:
1389
- //
1390
- // ```html
1391
- // <!-- this component has _not_ been upgraded yet -->
1392
- // <my-component id="test" some-attribute="some-value"></my-component>
1393
- // <script>
1394
- // // grab non-upgraded component
1395
- // el = document.querySelector("#test");
1396
- // el.someAttribute = "another-value";
1397
- // // upgrade component
1398
- // customElements.define('my-component', MyComponent);
1399
- // </script>
1400
- // ```
1401
- // In this case if we do not un-shadow here and use the value of the shadowing property, attributeChangedCallback
1402
- // will be called with `newValue = "some-value"` and will set the shadowed property (this.someAttribute = "another-value")
1403
- // to the value that was set inline i.e. "some-value" from above example. When
1404
- // the connectedCallback attempts to un-shadow it will use "some-value" as the initial value rather than "another-value"
1405
- //
1406
- // The case where the attribute was NOT set inline but was not set programmatically shall be handled/un-shadowed
1407
- // by connectedCallback as this attributeChangedCallback will not fire.
1408
- //
1409
- // https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
1410
- //
1411
- // TODO(STENCIL-16) we should think about whether or not we actually want to be reflecting the attributes to
1412
- // properties here given that this goes against best practices outlined here
1413
- // https://developers.google.com/web/fundamentals/web-components/best-practices#avoid-reentrancy
1414
- if (this.hasOwnProperty(propName)) {
1415
- newValue = this[propName];
1416
- delete this[propName];
1417
- }
1418
- else if (prototype.hasOwnProperty(propName) &&
1419
- typeof this[propName] === 'number' &&
1420
- this[propName] == newValue) {
1421
- // if the propName exists on the prototype of `Cstr`, this update may be a result of Stencil using native
1422
- // APIs to reflect props as attributes. Calls to `setAttribute(someElement, propName)` will result in
1423
- // `propName` to be converted to a `DOMString`, which may not be what we want for other primitive props.
1424
- return;
1425
- }
1426
- else if (propName == null) {
1427
- // At this point we should know this is not a "member", so we can treat it like watching an attribute
1428
- // on a vanilla web component
1429
- const hostRef = getHostRef(this);
1430
- const flags = hostRef === null || hostRef === void 0 ? void 0 : hostRef.$flags$;
1431
- // We only want to trigger the callback(s) if:
1432
- // 1. The instance is ready
1433
- // 2. The watchers are ready
1434
- // 3. The value has changed
1435
- if (!(flags & 8 /* HOST_FLAGS.isConstructingInstance */) &&
1436
- flags & 128 /* HOST_FLAGS.isWatchReady */ &&
1437
- newValue !== oldValue) {
1438
- const instance = hostRef.$lazyInstance$ ;
1439
- const entry = cmpMeta.$watchers$[attrName];
1440
- entry === null || entry === void 0 ? void 0 : entry.forEach((callbackName) => {
1441
- if (instance[callbackName] != null) {
1442
- instance[callbackName].call(instance, newValue, oldValue, attrName);
1443
- }
1444
- });
1445
- }
1446
- return;
1447
- }
1448
- this[propName] = newValue === null && typeof this[propName] === 'boolean' ? false : newValue;
1449
- });
1450
- };
1451
- // Create an array of attributes to observe
1452
- // This list in comprised of all strings used within a `@Watch()` decorator
1453
- // on a component as well as any Stencil-specific "members" (`@Prop()`s and `@State()`s).
1454
- // As such, there is no way to guarantee type-safety here that a user hasn't entered
1455
- // an invalid attribute.
1456
- Cstr.observedAttributes = Array.from(new Set([
1457
- ...Object.keys((_a = cmpMeta.$watchers$) !== null && _a !== void 0 ? _a : {}),
1458
- ...members
1459
- .filter(([_, m]) => m[0] & 15 /* MEMBER_FLAGS.HasAttribute */)
1460
- .map(([propName, m]) => {
1461
- const attrName = m[1] || propName;
1462
- attrNameToPropName.set(attrName, propName);
1463
- return attrName;
1464
- }),
1465
- ]));
1466
- }
1467
- }
1468
- return Cstr;
1469
- };
1470
- const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) => {
1471
- // initializeComponent
1472
- if ((hostRef.$flags$ & 32 /* HOST_FLAGS.hasInitializedComponent */) === 0) {
1473
- // Let the runtime know that the component has been initialized
1474
- hostRef.$flags$ |= 32 /* HOST_FLAGS.hasInitializedComponent */;
1475
- {
1476
- // lazy loaded components
1477
- // request the component's implementation to be
1478
- // wired up with the host element
1479
- Cstr = loadModule(cmpMeta);
1480
- if (Cstr.then) {
1481
- // Await creates a micro-task avoid if possible
1482
- const endLoad = uniqueTime();
1483
- Cstr = await Cstr;
1484
- endLoad();
1485
- }
1486
- if (!Cstr.isProxied) {
1487
- // we've never proxied this Constructor before
1488
- // let's add the getters/setters to its prototype before
1489
- // the first time we create an instance of the implementation
1490
- {
1491
- cmpMeta.$watchers$ = Cstr.watchers;
1492
- }
1493
- proxyComponent(Cstr, cmpMeta, 2 /* PROXY_FLAGS.proxyState */);
1494
- Cstr.isProxied = true;
1495
- }
1496
- const endNewInstance = createTime('createInstance', cmpMeta.$tagName$);
1497
- // ok, time to construct the instance
1498
- // but let's keep track of when we start and stop
1499
- // so that the getters/setters don't incorrectly step on data
1500
- {
1501
- hostRef.$flags$ |= 8 /* HOST_FLAGS.isConstructingInstance */;
1502
- }
1503
- // construct the lazy-loaded component implementation
1504
- // passing the hostRef is very important during
1505
- // construction in order to directly wire together the
1506
- // host element and the lazy-loaded instance
1507
- try {
1508
- new Cstr(hostRef);
1509
- }
1510
- catch (e) {
1511
- consoleError(e);
1512
- }
1513
- {
1514
- hostRef.$flags$ &= ~8 /* HOST_FLAGS.isConstructingInstance */;
1515
- }
1516
- {
1517
- hostRef.$flags$ |= 128 /* HOST_FLAGS.isWatchReady */;
1518
- }
1519
- endNewInstance();
1520
- }
1521
- if (Cstr.style) {
1522
- // this component has styles but we haven't registered them yet
1523
- let style = Cstr.style;
1524
- const scopeId = getScopeId(cmpMeta);
1525
- if (!styles.has(scopeId)) {
1526
- const endRegisterStyles = createTime('registerStyles', cmpMeta.$tagName$);
1527
- registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */));
1528
- endRegisterStyles();
1529
- }
1530
- }
1531
- }
1532
- // we've successfully created a lazy instance
1533
- const ancestorComponent = hostRef.$ancestorComponent$;
1534
- const schedule = () => scheduleUpdate(hostRef, true);
1535
- if (ancestorComponent && ancestorComponent['s-rc']) {
1536
- // this is the initial load and this component it has an ancestor component
1537
- // but the ancestor component has NOT fired its will update lifecycle yet
1538
- // so let's just cool our jets and wait for the ancestor to continue first
1539
- // this will get fired off when the ancestor component
1540
- // finally gets around to rendering its lazy self
1541
- // fire off the initial update
1542
- ancestorComponent['s-rc'].push(schedule);
1543
- }
1544
- else {
1545
- schedule();
1546
- }
1547
- };
1548
- const fireConnectedCallback = (instance) => {
1549
- };
1550
- const connectedCallback = (elm) => {
1551
- if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
1552
- const hostRef = getHostRef(elm);
1553
- const cmpMeta = hostRef.$cmpMeta$;
1554
- const endConnected = createTime('connectedCallback', cmpMeta.$tagName$);
1555
- if (!(hostRef.$flags$ & 1 /* HOST_FLAGS.hasConnected */)) {
1556
- // first time this component has connected
1557
- hostRef.$flags$ |= 1 /* HOST_FLAGS.hasConnected */;
1558
- {
1559
- // find the first ancestor component (if there is one) and register
1560
- // this component as one of the actively loading child components for its ancestor
1561
- let ancestorComponent = elm;
1562
- while ((ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host)) {
1563
- // climb up the ancestors looking for the first
1564
- // component that hasn't finished its lifecycle update yet
1565
- if (ancestorComponent['s-p']) {
1566
- // we found this components first ancestor component
1567
- // keep a reference to this component's ancestor component
1568
- attachToAncestor(hostRef, (hostRef.$ancestorComponent$ = ancestorComponent));
1569
- break;
1570
- }
1571
- }
1572
- }
1573
- // Lazy properties
1574
- // https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
1575
- if (cmpMeta.$members$) {
1576
- Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
1577
- if (memberFlags & 31 /* MEMBER_FLAGS.Prop */ && elm.hasOwnProperty(memberName)) {
1578
- const value = elm[memberName];
1579
- delete elm[memberName];
1580
- elm[memberName] = value;
1581
- }
1582
- });
1583
- }
1584
- {
1585
- initializeComponent(elm, hostRef, cmpMeta);
1586
- }
1587
- }
1588
- else {
1589
- // not the first time this has connected
1590
- // reattach any event listeners to the host
1591
- // since they would have been removed when disconnected
1592
- addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
1593
- // fire off connectedCallback() on component instance
1594
- if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$lazyInstance$) ;
1595
- else if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$onReadyPromise$) {
1596
- hostRef.$onReadyPromise$.then(() => fireConnectedCallback());
1597
- }
1598
- }
1599
- endConnected();
1600
- }
1601
- };
1602
- const disconnectInstance = (instance) => {
1603
- {
1604
- safeCall(instance, 'disconnectedCallback');
1605
- }
1606
- };
1607
- const disconnectedCallback = async (elm) => {
1608
- if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
1609
- const hostRef = getHostRef(elm);
1610
- {
1611
- if (hostRef.$rmListeners$) {
1612
- hostRef.$rmListeners$.map((rmListener) => rmListener());
1613
- hostRef.$rmListeners$ = undefined;
1614
- }
1615
- }
1616
- if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$lazyInstance$) {
1617
- disconnectInstance(hostRef.$lazyInstance$);
1618
- }
1619
- else if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$onReadyPromise$) {
1620
- hostRef.$onReadyPromise$.then(() => disconnectInstance(hostRef.$lazyInstance$));
1621
- }
1622
- }
1623
- };
1624
- const bootstrapLazy = (lazyBundles, options = {}) => {
1625
- var _a;
1626
- const endBootstrap = createTime();
1627
- const cmpTags = [];
1628
- const exclude = options.exclude || [];
1629
- const customElements = win.customElements;
1630
- const head = doc.head;
1631
- const metaCharset = /*@__PURE__*/ head.querySelector('meta[charset]');
1632
- const visibilityStyle = /*@__PURE__*/ doc.createElement('style');
1633
- const deferredConnectedCallbacks = [];
1634
- let appLoadFallback;
1635
- let isBootstrapping = true;
1636
- Object.assign(plt, options);
1637
- plt.$resourcesUrl$ = new URL(options.resourcesUrl || './', doc.baseURI).href;
1638
- lazyBundles.map((lazyBundle) => {
1639
- lazyBundle[1].map((compactMeta) => {
1640
- var _a;
1641
- const cmpMeta = {
1642
- $flags$: compactMeta[0],
1643
- $tagName$: compactMeta[1],
1644
- $members$: compactMeta[2],
1645
- $listeners$: compactMeta[3],
1646
- };
1647
- {
1648
- cmpMeta.$members$ = compactMeta[2];
1649
- }
1650
- {
1651
- cmpMeta.$listeners$ = compactMeta[3];
1652
- }
1653
- {
1654
- cmpMeta.$watchers$ = (_a = compactMeta[4]) !== null && _a !== void 0 ? _a : {};
1655
- }
1656
- const tagName = cmpMeta.$tagName$;
1657
- const HostElement = class extends HTMLElement {
1658
- // StencilLazyHost
1659
- constructor(self) {
1660
- // @ts-ignore
1661
- super(self);
1662
- self = this;
1663
- registerHost(self, cmpMeta);
1664
- if (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
1665
- // this component is using shadow dom
1666
- // and this browser supports shadow dom
1667
- // add the read-only property "shadowRoot" to the host element
1668
- // adding the shadow root build conditionals to minimize runtime
1669
- {
1670
- {
1671
- self.attachShadow({ mode: 'open' });
1672
- }
1673
- }
1674
- }
1675
- }
1676
- connectedCallback() {
1677
- if (appLoadFallback) {
1678
- clearTimeout(appLoadFallback);
1679
- appLoadFallback = null;
1680
- }
1681
- if (isBootstrapping) {
1682
- // connectedCallback will be processed once all components have been registered
1683
- deferredConnectedCallbacks.push(this);
1684
- }
1685
- else {
1686
- plt.jmp(() => connectedCallback(this));
1687
- }
1688
- }
1689
- disconnectedCallback() {
1690
- plt.jmp(() => disconnectedCallback(this));
1691
- }
1692
- componentOnReady() {
1693
- return getHostRef(this).$onReadyPromise$;
1694
- }
1695
- };
1696
- cmpMeta.$lazyBundleId$ = lazyBundle[0];
1697
- if (!exclude.includes(tagName) && !customElements.get(tagName)) {
1698
- cmpTags.push(tagName);
1699
- customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* PROXY_FLAGS.isElementConstructor */));
1700
- }
1701
- });
1702
- });
1703
- {
1704
- visibilityStyle.innerHTML = cmpTags + HYDRATED_CSS;
1705
- visibilityStyle.setAttribute('data-styles', '');
1706
- // Apply CSP nonce to the style tag if it exists
1707
- const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
1708
- if (nonce != null) {
1709
- visibilityStyle.setAttribute('nonce', nonce);
1710
- }
1711
- head.insertBefore(visibilityStyle, metaCharset ? metaCharset.nextSibling : head.firstChild);
1712
- }
1713
- // Process deferred connectedCallbacks now all components have been registered
1714
- isBootstrapping = false;
1715
- if (deferredConnectedCallbacks.length) {
1716
- deferredConnectedCallbacks.map((host) => host.connectedCallback());
1717
- }
1718
- else {
1719
- {
1720
- plt.jmp(() => (appLoadFallback = setTimeout(appDidLoad, 30)));
1721
- }
1722
- }
1723
- // Fallback appLoad event
1724
- endBootstrap();
1725
- };
1726
- const Fragment = (_, children) => children;
1727
- const addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
1728
- if (listeners) {
1729
- listeners.map(([flags, name, method]) => {
1730
- const target = getHostListenerTarget(elm, flags) ;
1731
- const handler = hostListenerProxy(hostRef, method);
1732
- const opts = hostListenerOpts(flags);
1733
- plt.ael(target, name, handler, opts);
1734
- (hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
1735
- });
1736
- }
1737
- };
1738
- const hostListenerProxy = (hostRef, methodName) => (ev) => {
1739
- try {
1740
- {
1741
- if (hostRef.$flags$ & 256 /* HOST_FLAGS.isListenReady */) {
1742
- // instance is ready, let's call it's member method for this event
1743
- hostRef.$lazyInstance$[methodName](ev);
1744
- }
1745
- else {
1746
- (hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
1747
- }
1748
- }
1749
- }
1750
- catch (e) {
1751
- consoleError(e);
1752
- }
1753
- };
1754
- const getHostListenerTarget = (elm, flags) => {
1755
- if (flags & 4 /* LISTENER_FLAGS.TargetDocument */)
1756
- return doc;
1757
- if (flags & 8 /* LISTENER_FLAGS.TargetWindow */)
1758
- return win;
1759
- if (flags & 16 /* LISTENER_FLAGS.TargetBody */)
1760
- return doc.body;
1761
- return elm;
1762
- };
1763
- // prettier-ignore
1764
- const hostListenerOpts = (flags) => (flags & 2 /* LISTENER_FLAGS.Capture */) !== 0;
1765
- /**
1766
- * Assigns the given value to the nonce property on the runtime platform object.
1767
- * During runtime, this value is used to set the nonce attribute on all dynamically created script and style tags.
1768
- * @param nonce The value to be assigned to the platform nonce property.
1769
- * @returns void
1770
- */
1771
- const setNonce = (nonce) => (plt.$nonce$ = nonce);
1772
- const hostRefs = /*@__PURE__*/ new WeakMap();
1773
- const getHostRef = (ref) => hostRefs.get(ref);
1774
- const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
1775
- const registerHost = (elm, cmpMeta) => {
1776
- const hostRef = {
1777
- $flags$: 0,
1778
- $hostElement$: elm,
1779
- $cmpMeta$: cmpMeta,
1780
- $instanceValues$: new Map(),
1781
- };
1782
- {
1783
- hostRef.$onInstancePromise$ = new Promise((r) => (hostRef.$onInstanceResolve$ = r));
1784
- }
1785
- {
1786
- hostRef.$onReadyPromise$ = new Promise((r) => (hostRef.$onReadyResolve$ = r));
1787
- elm['s-p'] = [];
1788
- elm['s-rc'] = [];
1789
- }
1790
- addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
1791
- return hostRefs.set(elm, hostRef);
1792
- };
1793
- const isMemberInElement = (elm, memberName) => memberName in elm;
1794
- const consoleError = (e, el) => (0, console.error)(e, el);
1795
- const cmpModules = /*@__PURE__*/ new Map();
1796
- const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
1797
- // loadModuleImport
1798
- const exportName = cmpMeta.$tagName$.replace(/-/g, '_');
1799
- const bundleId = cmpMeta.$lazyBundleId$;
1800
- const module = cmpModules.get(bundleId) ;
1801
- if (module) {
1802
- return module[exportName];
1803
- }
1804
- /*!__STENCIL_STATIC_IMPORT_SWITCH__*/
1805
- return import(
1806
- /* @vite-ignore */
1807
- /* webpackInclude: /\.entry\.js$/ */
1808
- /* webpackExclude: /\.system\.entry\.js$/ */
1809
- /* webpackMode: "lazy" */
1810
- `./${bundleId}.entry.js${''}`).then((importedModule) => {
1811
- {
1812
- cmpModules.set(bundleId, importedModule);
1813
- }
1814
- return importedModule[exportName];
1815
- }, consoleError);
1816
- };
1817
- const styles = /*@__PURE__*/ new Map();
1818
- const win = typeof window !== 'undefined' ? window : {};
1819
- const doc = win.document || { head: {} };
1820
- const plt = {
1821
- $flags$: 0,
1822
- $resourcesUrl$: '',
1823
- jmp: (h) => h(),
1824
- raf: (h) => requestAnimationFrame(h),
1825
- ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
1826
- rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
1827
- ce: (eventName, opts) => new CustomEvent(eventName, opts),
1828
- };
1829
- const promiseResolve = (v) => Promise.resolve(v);
1830
- const supportsConstructableStylesheets = /*@__PURE__*/ (() => {
1831
- try {
1832
- new CSSStyleSheet();
1833
- return typeof new CSSStyleSheet().replaceSync === 'function';
1834
- }
1835
- catch (e) { }
1836
- return false;
1837
- })()
1838
- ;
1839
- const queueDomReads = [];
1840
- const queueDomWrites = [];
1841
- const queueTask = (queue, write) => (cb) => {
1842
- queue.push(cb);
1843
- if (!queuePending) {
1844
- queuePending = true;
1845
- if (write && plt.$flags$ & 4 /* PLATFORM_FLAGS.queueSync */) {
1846
- nextTick(flush);
1847
- }
1848
- else {
1849
- plt.raf(flush);
1850
- }
1851
- }
1852
- };
1853
- const consume = (queue) => {
1854
- for (let i = 0; i < queue.length; i++) {
1855
- try {
1856
- queue[i](performance.now());
1857
- }
1858
- catch (e) {
1859
- consoleError(e);
1860
- }
1861
- }
1862
- queue.length = 0;
1863
- };
1864
- const flush = () => {
1865
- // always force a bunch of medium callbacks to run, but still have
1866
- // a throttle on how many can run in a certain time
1867
- // DOM READS!!!
1868
- consume(queueDomReads);
1869
- // DOM WRITES!!!
1870
- {
1871
- consume(queueDomWrites);
1872
- if ((queuePending = queueDomReads.length > 0)) {
1873
- // still more to do yet, but we've run out of time
1874
- // let's let this thing cool off and try again in the next tick
1875
- plt.raf(flush);
1876
- }
1877
- }
1878
- };
1879
- const nextTick = /*@__PURE__*/ (cb) => promiseResolve().then(cb);
1880
- const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
1881
-
1882
- export { Fragment as F, Host as H, getAssetPath as a, bootstrapLazy as b, createEvent as c, getElement as d, forceUpdate as f, getRenderingRef as g, h, promiseResolve as p, registerInstance as r, setNonce as s };
1883
-
1884
- //# sourceMappingURL=index-d1aa9293.js.map