stripe-pwa-elements 3.2.0 → 4.0.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 (237) hide show
  1. package/dist/cjs/app-globals-V2Kpy_OQ.js +0 -3
  2. package/dist/cjs/error-FFC4kSs5.js +0 -3
  3. package/dist/cjs/{factory-CbbbSvkg.js → factory-Cd2VI_N2.js} +216 -77
  4. package/dist/cjs/{index-Ba1pBePA.js → index-CYbA1N_k.js} +24 -6
  5. package/dist/cjs/index-Dkb0SxZc.js +4694 -0
  6. package/dist/cjs/index.cjs.js +0 -1
  7. package/dist/cjs/ion-icon.cjs.entry.js +22 -13
  8. package/dist/cjs/loader.cjs.js +2 -3
  9. package/dist/cjs/stripe-address-element.cjs.entry.js +41 -26
  10. package/dist/cjs/stripe-card-element-modal.cjs.entry.js +6 -7
  11. package/dist/cjs/stripe-card-element_2.cjs.entry.js +129 -72
  12. package/dist/cjs/stripe-currency-selector.cjs.entry.js +20 -10
  13. package/dist/cjs/stripe-elements.cjs.js +31 -5
  14. package/dist/cjs/stripe-express-checkout-element.cjs.entry.js +32 -22
  15. package/dist/cjs/stripe-link-authentication-element.cjs.entry.js +20 -10
  16. package/dist/cjs/stripe-payment-element.cjs.entry.js +283 -167
  17. package/dist/cjs/stripe-payment-request-button.cjs.entry.js +30 -18
  18. package/dist/collection/collection-manifest.json +6 -5
  19. package/dist/collection/components/stripe-address-element/stripe-address-element.js +36 -21
  20. package/dist/collection/components/stripe-card-element/stripe-card-element.helpers.js +57 -0
  21. package/dist/collection/components/stripe-card-element/stripe-card-element.js +62 -68
  22. package/dist/collection/components/stripe-card-element-modal/stripe-card-element-modal.js +15 -11
  23. package/dist/collection/components/stripe-currency-selector/stripe-currency-selector.js +17 -6
  24. package/dist/collection/components/stripe-express-checkout-element/stripe-express-checkout-element.js +35 -20
  25. package/dist/collection/components/stripe-link-authentication-element/stripe-link-authentication-element.js +19 -7
  26. package/dist/collection/components/stripe-modal/stripe-modal.js +18 -7
  27. package/dist/collection/components/stripe-payment-element/stripe-payment-element.helpers.js +114 -0
  28. package/dist/collection/components/stripe-payment-element/stripe-payment-element.js +162 -162
  29. package/dist/collection/components/stripe-payment-request-button/stripe-payment-request-button.js +48 -19
  30. package/dist/collection/index.js +0 -1
  31. package/dist/collection/interfaces.js +0 -1
  32. package/dist/collection/services/address-element-manager.js +3 -4
  33. package/dist/collection/services/card-element-manager.js +3 -4
  34. package/dist/collection/services/currency-selector-element-manager.js +3 -4
  35. package/dist/collection/services/express-checkout-element-manager.js +9 -10
  36. package/dist/collection/services/factory.js +0 -1
  37. package/dist/collection/services/interfaces.js +0 -1
  38. package/dist/collection/services/link-authentication-element-manager.js +3 -4
  39. package/dist/collection/services/payment-element-manager.js +4 -5
  40. package/dist/collection/services/stripe-service.js +27 -10
  41. package/dist/collection/utils/element-finder.js +2 -3
  42. package/dist/collection/utils/error.js +0 -1
  43. package/dist/collection/utils/i18n.js +0 -1
  44. package/dist/collection/utils/platform.js +0 -1
  45. package/dist/collection/utils/test-setup.js +0 -1
  46. package/dist/collection/utils/utils.js +2 -3
  47. package/dist/components/error.js +1 -16
  48. package/dist/components/factory.js +1 -3736
  49. package/dist/components/icon.js +1 -459
  50. package/dist/components/index.d.ts +2 -0
  51. package/dist/components/index.js +1 -4
  52. package/dist/components/index2.js +1 -192
  53. package/dist/components/ion-icon.js +1 -9
  54. package/dist/components/stripe-address-element.js +1 -327
  55. package/dist/components/stripe-card-element-modal.js +1 -174
  56. package/dist/components/stripe-card-element.js +1 -9
  57. package/dist/components/stripe-card-element2.js +1 -440
  58. package/dist/components/stripe-currency-selector.js +1 -218
  59. package/dist/components/stripe-express-checkout-element.js +1 -332
  60. package/dist/components/stripe-link-authentication-element.js +1 -256
  61. package/dist/components/stripe-modal.js +1 -9
  62. package/dist/components/stripe-modal2.js +1 -112
  63. package/dist/components/stripe-payment-element.js +1 -510
  64. package/dist/components/stripe-payment-request-button.js +1 -9
  65. package/dist/components/stripe-payment-request-button2.js +1 -224
  66. package/dist/components/utils.js +1 -89
  67. package/dist/esm/app-globals-DQuL1Twl.js +0 -3
  68. package/dist/esm/error-XRfh5Wrs.js +0 -3
  69. package/dist/esm/{factory-Drde6-y7.js → factory-VTa1Gc94.js} +216 -77
  70. package/dist/esm/index-C6bbmyga.js +4677 -0
  71. package/dist/esm/{index-BHDCxQOb.js → index-CBXaOfXU.js} +24 -6
  72. package/dist/esm/index.js +0 -1
  73. package/dist/esm/ion-icon.entry.js +22 -13
  74. package/dist/esm/loader.js +3 -4
  75. package/dist/esm/stripe-address-element.entry.js +41 -26
  76. package/dist/esm/stripe-card-element-modal.entry.js +6 -7
  77. package/dist/esm/stripe-card-element_2.entry.js +129 -72
  78. package/dist/esm/stripe-currency-selector.entry.js +20 -10
  79. package/dist/esm/stripe-elements.js +32 -6
  80. package/dist/esm/stripe-express-checkout-element.entry.js +32 -22
  81. package/dist/esm/stripe-link-authentication-element.entry.js +20 -10
  82. package/dist/esm/stripe-payment-element.entry.js +283 -167
  83. package/dist/esm/stripe-payment-request-button.entry.js +27 -15
  84. package/dist/stripe-elements/index.esm.js +0 -2
  85. package/dist/stripe-elements/p-1bd46766.entry.js +1 -0
  86. package/dist/stripe-elements/p-1c6e0a45.entry.js +1 -0
  87. package/dist/stripe-elements/p-3f42ca0c.entry.js +1 -0
  88. package/dist/stripe-elements/p-5cf62945.entry.js +1 -0
  89. package/dist/stripe-elements/p-74de1556.entry.js +1 -0
  90. package/dist/stripe-elements/p-76e57d78.entry.js +1 -0
  91. package/dist/stripe-elements/p-840d499f.entry.js +1 -0
  92. package/dist/stripe-elements/p-C6bbmyga.js +2 -0
  93. package/dist/stripe-elements/p-CBXaOfXU.js +1 -0
  94. package/dist/stripe-elements/p-CrjrbGJ3.js +1 -0
  95. package/dist/stripe-elements/p-DQuL1Twl.js +1 -2
  96. package/dist/stripe-elements/p-XRfh5Wrs.js +1 -2
  97. package/dist/stripe-elements/p-ae0c336e.entry.js +1 -0
  98. package/dist/stripe-elements/p-cfd8e081.entry.js +1 -0
  99. package/dist/stripe-elements/stripe-elements.esm.js +1 -2
  100. package/dist/stripe-elements/svg/.gitignore +4 -0
  101. package/dist/types/components/stripe-address-element/stripe-address-element.d.ts +6 -0
  102. package/dist/types/components/stripe-card-element/stripe-card-element.d.ts +11 -1
  103. package/dist/types/components/stripe-card-element/stripe-card-element.helpers.d.ts +29 -0
  104. package/dist/types/components/stripe-card-element-modal/stripe-card-element-modal.d.ts +4 -4
  105. package/dist/types/components/stripe-currency-selector/stripe-currency-selector.d.ts +6 -0
  106. package/dist/types/components/stripe-express-checkout-element/stripe-express-checkout-element.d.ts +6 -0
  107. package/dist/types/components/stripe-link-authentication-element/stripe-link-authentication-element.d.ts +6 -0
  108. package/dist/types/components/stripe-modal/stripe-modal.d.ts +1 -0
  109. package/dist/types/components/stripe-payment-element/stripe-payment-element.d.ts +20 -2
  110. package/dist/types/components/stripe-payment-element/stripe-payment-element.helpers.d.ts +54 -0
  111. package/dist/types/components/stripe-payment-request-button/stripe-payment-request-button.d.ts +14 -1
  112. package/dist/types/components.d.ts +139 -29
  113. package/dist/types/index.d.ts +1 -0
  114. package/dist/types/services/interfaces.d.ts +4 -3
  115. package/dist/types/services/stripe-service.d.ts +8 -4
  116. package/dist/types/stencil-public-runtime.d.ts +110 -5
  117. package/package.json +50 -30
  118. package/readme.md +386 -133
  119. package/dist/cjs/app-globals-V2Kpy_OQ.js.map +0 -1
  120. package/dist/cjs/error-FFC4kSs5.js.map +0 -1
  121. package/dist/cjs/factory-CbbbSvkg.js.map +0 -1
  122. package/dist/cjs/index-BXVW_rzh.js +0 -1932
  123. package/dist/cjs/index-BXVW_rzh.js.map +0 -1
  124. package/dist/cjs/index-Ba1pBePA.js.map +0 -1
  125. package/dist/cjs/index.cjs.js.map +0 -1
  126. package/dist/cjs/ion-icon.entry.cjs.js.map +0 -1
  127. package/dist/cjs/loader.cjs.js.map +0 -1
  128. package/dist/cjs/stripe-address-element.entry.cjs.js.map +0 -1
  129. package/dist/cjs/stripe-card-element-modal.entry.cjs.js.map +0 -1
  130. package/dist/cjs/stripe-card-element.stripe-modal.entry.cjs.js.map +0 -1
  131. package/dist/cjs/stripe-currency-selector.entry.cjs.js.map +0 -1
  132. package/dist/cjs/stripe-elements.cjs.js.map +0 -1
  133. package/dist/cjs/stripe-express-checkout-element.entry.cjs.js.map +0 -1
  134. package/dist/cjs/stripe-link-authentication-element.entry.cjs.js.map +0 -1
  135. package/dist/cjs/stripe-payment-element.entry.cjs.js.map +0 -1
  136. package/dist/cjs/stripe-payment-request-button.entry.cjs.js.map +0 -1
  137. package/dist/collection/components/stripe-address-element/stripe-address-element.js.map +0 -1
  138. package/dist/collection/components/stripe-card-element/stripe-card-element.js.map +0 -1
  139. package/dist/collection/components/stripe-card-element-modal/stripe-card-element-modal.js.map +0 -1
  140. package/dist/collection/components/stripe-currency-selector/stripe-currency-selector.js.map +0 -1
  141. package/dist/collection/components/stripe-express-checkout-element/stripe-express-checkout-element.js.map +0 -1
  142. package/dist/collection/components/stripe-link-authentication-element/stripe-link-authentication-element.js.map +0 -1
  143. package/dist/collection/components/stripe-modal/stripe-modal.js.map +0 -1
  144. package/dist/collection/components/stripe-payment-element/stripe-payment-element.js.map +0 -1
  145. package/dist/collection/components/stripe-payment-request-button/stripe-payment-request-button.js.map +0 -1
  146. package/dist/collection/index.js.map +0 -1
  147. package/dist/collection/interfaces.js.map +0 -1
  148. package/dist/collection/services/address-element-manager.js.map +0 -1
  149. package/dist/collection/services/card-element-manager.js.map +0 -1
  150. package/dist/collection/services/currency-selector-element-manager.js.map +0 -1
  151. package/dist/collection/services/express-checkout-element-manager.js.map +0 -1
  152. package/dist/collection/services/factory.js.map +0 -1
  153. package/dist/collection/services/interfaces.js.map +0 -1
  154. package/dist/collection/services/link-authentication-element-manager.js.map +0 -1
  155. package/dist/collection/services/payment-element-manager.js.map +0 -1
  156. package/dist/collection/services/stripe-service.js.map +0 -1
  157. package/dist/collection/utils/element-finder.js.map +0 -1
  158. package/dist/collection/utils/error.js.map +0 -1
  159. package/dist/collection/utils/i18n.js.map +0 -1
  160. package/dist/collection/utils/platform.js.map +0 -1
  161. package/dist/collection/utils/test-setup.js.map +0 -1
  162. package/dist/collection/utils/utils.js.map +0 -1
  163. package/dist/components/error.js.map +0 -1
  164. package/dist/components/factory.js.map +0 -1
  165. package/dist/components/icon.js.map +0 -1
  166. package/dist/components/index.js.map +0 -1
  167. package/dist/components/index2.js.map +0 -1
  168. package/dist/components/ion-icon.js.map +0 -1
  169. package/dist/components/stripe-address-element.js.map +0 -1
  170. package/dist/components/stripe-card-element-modal.js.map +0 -1
  171. package/dist/components/stripe-card-element.js.map +0 -1
  172. package/dist/components/stripe-card-element2.js.map +0 -1
  173. package/dist/components/stripe-currency-selector.js.map +0 -1
  174. package/dist/components/stripe-express-checkout-element.js.map +0 -1
  175. package/dist/components/stripe-link-authentication-element.js.map +0 -1
  176. package/dist/components/stripe-modal.js.map +0 -1
  177. package/dist/components/stripe-modal2.js.map +0 -1
  178. package/dist/components/stripe-payment-element.js.map +0 -1
  179. package/dist/components/stripe-payment-request-button.js.map +0 -1
  180. package/dist/components/stripe-payment-request-button2.js.map +0 -1
  181. package/dist/components/utils.js.map +0 -1
  182. package/dist/esm/app-globals-DQuL1Twl.js.map +0 -1
  183. package/dist/esm/error-XRfh5Wrs.js.map +0 -1
  184. package/dist/esm/factory-Drde6-y7.js.map +0 -1
  185. package/dist/esm/index-BHDCxQOb.js.map +0 -1
  186. package/dist/esm/index-DJwTOfxZ.js +0 -1920
  187. package/dist/esm/index-DJwTOfxZ.js.map +0 -1
  188. package/dist/esm/index.js.map +0 -1
  189. package/dist/esm/ion-icon.entry.js.map +0 -1
  190. package/dist/esm/loader.js.map +0 -1
  191. package/dist/esm/stripe-address-element.entry.js.map +0 -1
  192. package/dist/esm/stripe-card-element-modal.entry.js.map +0 -1
  193. package/dist/esm/stripe-card-element.stripe-modal.entry.js.map +0 -1
  194. package/dist/esm/stripe-currency-selector.entry.js.map +0 -1
  195. package/dist/esm/stripe-elements.js.map +0 -1
  196. package/dist/esm/stripe-express-checkout-element.entry.js.map +0 -1
  197. package/dist/esm/stripe-link-authentication-element.entry.js.map +0 -1
  198. package/dist/esm/stripe-payment-element.entry.js.map +0 -1
  199. package/dist/esm/stripe-payment-request-button.entry.js.map +0 -1
  200. package/dist/stripe-elements/index.esm.js.map +0 -1
  201. package/dist/stripe-elements/ion-icon.entry.esm.js.map +0 -1
  202. package/dist/stripe-elements/loader.esm.js.map +0 -1
  203. package/dist/stripe-elements/p-02f6e421.entry.js +0 -2
  204. package/dist/stripe-elements/p-02f6e421.entry.js.map +0 -1
  205. package/dist/stripe-elements/p-19888fa6.entry.js +0 -2
  206. package/dist/stripe-elements/p-19888fa6.entry.js.map +0 -1
  207. package/dist/stripe-elements/p-4d505729.entry.js +0 -2
  208. package/dist/stripe-elements/p-4d505729.entry.js.map +0 -1
  209. package/dist/stripe-elements/p-7e7ad92a.entry.js +0 -2
  210. package/dist/stripe-elements/p-7e7ad92a.entry.js.map +0 -1
  211. package/dist/stripe-elements/p-8bb4212c.entry.js +0 -2
  212. package/dist/stripe-elements/p-8bb4212c.entry.js.map +0 -1
  213. package/dist/stripe-elements/p-9aee2b6b.entry.js +0 -2
  214. package/dist/stripe-elements/p-9aee2b6b.entry.js.map +0 -1
  215. package/dist/stripe-elements/p-BHDCxQOb.js +0 -2
  216. package/dist/stripe-elements/p-BHDCxQOb.js.map +0 -1
  217. package/dist/stripe-elements/p-DI2vmGaI.js +0 -2
  218. package/dist/stripe-elements/p-DI2vmGaI.js.map +0 -1
  219. package/dist/stripe-elements/p-DJwTOfxZ.js +0 -3
  220. package/dist/stripe-elements/p-DJwTOfxZ.js.map +0 -1
  221. package/dist/stripe-elements/p-DQuL1Twl.js.map +0 -1
  222. package/dist/stripe-elements/p-XRfh5Wrs.js.map +0 -1
  223. package/dist/stripe-elements/p-ba251393.entry.js +0 -2
  224. package/dist/stripe-elements/p-ba251393.entry.js.map +0 -1
  225. package/dist/stripe-elements/p-c649edfc.entry.js +0 -2
  226. package/dist/stripe-elements/p-c649edfc.entry.js.map +0 -1
  227. package/dist/stripe-elements/p-e8bb43ae.entry.js +0 -2
  228. package/dist/stripe-elements/p-e8bb43ae.entry.js.map +0 -1
  229. package/dist/stripe-elements/stripe-address-element.entry.esm.js.map +0 -1
  230. package/dist/stripe-elements/stripe-card-element-modal.entry.esm.js.map +0 -1
  231. package/dist/stripe-elements/stripe-card-element.stripe-modal.entry.esm.js.map +0 -1
  232. package/dist/stripe-elements/stripe-currency-selector.entry.esm.js.map +0 -1
  233. package/dist/stripe-elements/stripe-elements.esm.js.map +0 -1
  234. package/dist/stripe-elements/stripe-express-checkout-element.entry.esm.js.map +0 -1
  235. package/dist/stripe-elements/stripe-link-authentication-element.entry.esm.js.map +0 -1
  236. package/dist/stripe-elements/stripe-payment-element.entry.esm.js.map +0 -1
  237. package/dist/stripe-elements/stripe-payment-request-button.entry.esm.js.map +0 -1
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-BXVW_rzh.js');
4
- var index$1 = require('./index-Ba1pBePA.js');
3
+ var index = require('./index-Dkb0SxZc.js');
4
+ var index$1 = require('./index-CYbA1N_k.js');
5
5
 
6
6
  const getPlatforms = (win) => setupPlatforms(win);
7
7
  const setupPlatforms = (win = window) => {
@@ -278,7 +278,7 @@ const deepFind = (obj, path, keySeparator = '.') => {
278
278
  }
279
279
  return current;
280
280
  };
281
- const getCleanedCode = code => code?.replace('_', '-');
281
+ const getCleanedCode = code => code?.replace(/_/g, '-');
282
282
 
283
283
  const consoleLogger = {
284
284
  type: 'logger',
@@ -539,7 +539,16 @@ function keysFromSelector(selector, opts) {
539
539
  const {
540
540
  [PATH_KEY]: path
541
541
  } = selector(createProxy());
542
- return path.join(opts?.keySeparator ?? '.');
542
+ const keySeparator = opts?.keySeparator ?? '.';
543
+ const nsSeparator = opts?.nsSeparator ?? ':';
544
+ if (path.length > 1 && nsSeparator) {
545
+ const ns = opts?.ns;
546
+ const nsArray = Array.isArray(ns) ? ns : null;
547
+ if (nsArray && nsArray.length > 1 && nsArray.slice(1).includes(path[0])) {
548
+ return `${path[0]}${nsSeparator}${path.slice(1).join(keySeparator)}`;
549
+ }
550
+ }
551
+ return path.join(keySeparator);
543
552
  }
544
553
 
545
554
  const checkedLoadedFor = {};
@@ -613,6 +622,10 @@ class Translator extends EventEmitter {
613
622
  ...opt
614
623
  });
615
624
  if (!Array.isArray(keys)) keys = [String(keys)];
625
+ keys = keys.map(k => typeof k === 'function' ? keysFromSelector(k, {
626
+ ...this.options,
627
+ ...opt
628
+ }) : String(k));
616
629
  const returnDetails = opt.returnDetails !== undefined ? opt.returnDetails : this.options.returnDetails;
617
630
  const keySeparator = opt.keySeparator !== undefined ? opt.keySeparator : this.options.keySeparator;
618
631
  const {
@@ -859,6 +872,10 @@ class Translator extends EventEmitter {
859
872
  let usedLng;
860
873
  let usedNS;
861
874
  if (isString(keys)) keys = [keys];
875
+ if (Array.isArray(keys)) keys = keys.map(k => typeof k === 'function' ? keysFromSelector(k, {
876
+ ...this.options,
877
+ ...opt
878
+ }) : k);
862
879
  keys.forEach(k => {
863
880
  if (this.isValidLookup(found)) return;
864
881
  const extracted = this.extractFromKey(k, opt);
@@ -1099,9 +1116,6 @@ class PluralResolver {
1099
1116
  this.logger = baseLogger.create('pluralResolver');
1100
1117
  this.pluralRulesCache = {};
1101
1118
  }
1102
- addRule(lng, obj) {
1103
- this.rules[lng] = obj;
1104
- }
1105
1119
  clearCache() {
1106
1120
  this.pluralRulesCache = {};
1107
1121
  }
@@ -1121,7 +1135,7 @@ class PluralResolver {
1121
1135
  type
1122
1136
  });
1123
1137
  } catch (err) {
1124
- if (!Intl) {
1138
+ if (typeof Intl === 'undefined') {
1125
1139
  this.logger.error('No Intl support, please use an Intl polyfill!');
1126
1140
  return dummyRule;
1127
1141
  }
@@ -1302,13 +1316,13 @@ class Interpolator {
1302
1316
  const handleHasOptions = (key, inheritedOptions) => {
1303
1317
  const sep = this.nestingOptionsSeparator;
1304
1318
  if (key.indexOf(sep) < 0) return key;
1305
- const c = key.split(new RegExp(`${sep}[ ]*{`));
1319
+ const c = key.split(new RegExp(`${regexEscape(sep)}[ ]*{`));
1306
1320
  let optionsString = `{${c[1]}`;
1307
1321
  key = c[0];
1308
1322
  optionsString = this.interpolate(optionsString, clonedOptions);
1309
1323
  const matchedSingleQuotes = optionsString.match(/'/g);
1310
1324
  const matchedDoubleQuotes = optionsString.match(/"/g);
1311
- if ((matchedSingleQuotes?.length ?? 0) % 2 === 0 && !matchedDoubleQuotes || matchedDoubleQuotes.length % 2 !== 0) {
1325
+ if ((matchedSingleQuotes?.length ?? 0) % 2 === 0 && !matchedDoubleQuotes || (matchedDoubleQuotes?.length ?? 0) % 2 !== 0) {
1312
1326
  optionsString = optionsString.replace(/'/g, '"');
1313
1327
  }
1314
1328
  try {
@@ -1790,6 +1804,28 @@ const bindMemberFunctions = inst => {
1790
1804
  }
1791
1805
  });
1792
1806
  };
1807
+ const SUPPORT_NOTICE_KEY = '__i18next_supportNoticeShown';
1808
+ const getSupportNoticeShown = () => {
1809
+ if (typeof globalThis !== 'undefined' && !!globalThis[SUPPORT_NOTICE_KEY]) return true;
1810
+ if (typeof process !== 'undefined' && process.env && process.env.I18NEXT_NO_SUPPORT_NOTICE) return true;
1811
+ if (typeof process !== 'undefined' && process.env && "production" === 'production') return true;
1812
+ return false;
1813
+ };
1814
+ const setSupportNoticeShown = () => {
1815
+ if (typeof globalThis !== 'undefined') globalThis[SUPPORT_NOTICE_KEY] = true;
1816
+ };
1817
+ const usesLocize = inst => {
1818
+ if (inst?.modules?.backend?.name?.indexOf('Locize') > 0) return true;
1819
+ if (inst?.modules?.backend?.constructor?.name?.indexOf('Locize') > 0) return true;
1820
+ if (inst?.options?.backend?.backends) {
1821
+ if (inst.options.backend.backends.some(b => b?.name?.indexOf('Locize') > 0 || b?.constructor?.name?.indexOf('Locize') > 0)) return true;
1822
+ }
1823
+ if (inst?.options?.backend?.projectId) return true;
1824
+ if (inst?.options?.backend?.backendOptions) {
1825
+ if (inst.options.backend.backendOptions.some(b => b?.projectId)) return true;
1826
+ }
1827
+ return false;
1828
+ };
1793
1829
  class I18n extends EventEmitter {
1794
1830
  constructor(options = {}, callback) {
1795
1831
  super();
@@ -1839,6 +1875,13 @@ class I18n extends EventEmitter {
1839
1875
  if (options.nsSeparator !== undefined) {
1840
1876
  this.options.userDefinedNsSeparator = options.nsSeparator;
1841
1877
  }
1878
+ if (typeof this.options.overloadTranslationOptionHandler !== 'function') {
1879
+ this.options.overloadTranslationOptionHandler = defOpts.overloadTranslationOptionHandler;
1880
+ }
1881
+ if (this.options.showSupportNotice !== false && !usesLocize(this) && !getSupportNoticeShown()) {
1882
+ if (typeof console !== 'undefined' && typeof console.info !== 'undefined') console.info('🌐 i18next is made possible by our own product, Locize — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙');
1883
+ setSupportNoticeShown();
1884
+ }
1842
1885
  const createClassOnDemand = ClassOrObject => {
1843
1886
  if (!ClassOrObject) return null;
1844
1887
  if (typeof ClassOrObject === 'function') return new ClassOrObject();
@@ -2099,21 +2142,20 @@ class I18n extends EventEmitter {
2099
2142
  o.lngs = o.lngs || fixedT.lngs;
2100
2143
  o.ns = o.ns || fixedT.ns;
2101
2144
  if (o.keyPrefix !== '') o.keyPrefix = o.keyPrefix || keyPrefix || fixedT.keyPrefix;
2145
+ const selectorOpts = {
2146
+ ...this.options,
2147
+ ...o
2148
+ };
2149
+ if (typeof o.keyPrefix === 'function') o.keyPrefix = keysFromSelector(o.keyPrefix, selectorOpts);
2102
2150
  const keySeparator = this.options.keySeparator || '.';
2103
2151
  let resultKey;
2104
2152
  if (o.keyPrefix && Array.isArray(key)) {
2105
2153
  resultKey = key.map(k => {
2106
- if (typeof k === 'function') k = keysFromSelector(k, {
2107
- ...this.options,
2108
- ...opts
2109
- });
2154
+ if (typeof k === 'function') k = keysFromSelector(k, selectorOpts);
2110
2155
  return `${o.keyPrefix}${keySeparator}${k}`;
2111
2156
  });
2112
2157
  } else {
2113
- if (typeof key === 'function') key = keysFromSelector(key, {
2114
- ...this.options,
2115
- ...opts
2116
- });
2158
+ if (typeof key === 'function') key = keysFromSelector(key, selectorOpts);
2117
2159
  resultKey = o.keyPrefix ? `${o.keyPrefix}${keySeparator}${key}` : key;
2118
2160
  }
2119
2161
  return this.t(resultKey, o);
@@ -2254,6 +2296,19 @@ class I18n extends EventEmitter {
2254
2296
  clone.store = new ResourceStore(clonedData, mergedOptions);
2255
2297
  clone.services.resourceStore = clone.store;
2256
2298
  }
2299
+ if (options.interpolation) {
2300
+ const defOpts = get();
2301
+ const mergedInterpolation = {
2302
+ ...defOpts.interpolation,
2303
+ ...this.options.interpolation,
2304
+ ...options.interpolation
2305
+ };
2306
+ const mergedForInterpolator = {
2307
+ ...mergedOptions,
2308
+ interpolation: mergedInterpolation
2309
+ };
2310
+ clone.services.interpolator = new Interpolator(mergedForInterpolator);
2311
+ }
2257
2312
  clone.translator = new Translator(clone.services, mergedOptions);
2258
2313
  clone.translator.on('*', (event, ...args) => {
2259
2314
  clone.emit(event, ...args);
@@ -2760,12 +2815,13 @@ instance.use(Browser).init({
2760
2815
  const i18n = instance;
2761
2816
 
2762
2817
  const appendToMap = (map, propName, value) => {
2763
- const items = map.get(propName);
2764
- if (!items) {
2765
- map.set(propName, [value]);
2818
+ let refs = map.get(propName);
2819
+ if (!refs) {
2820
+ refs = [];
2821
+ map.set(propName, refs);
2766
2822
  }
2767
- else if (!items.includes(value)) {
2768
- items.push(value);
2823
+ if (!refs.some((ref) => ref.deref() === value)) {
2824
+ refs.push(new WeakRef(value));
2769
2825
  }
2770
2826
  };
2771
2827
  const debounce = (fn, ms) => {
@@ -2793,33 +2849,54 @@ const debounce = (fn, ms) => {
2793
2849
  const isConnected = (maybeElement) => !('isConnected' in maybeElement) || maybeElement.isConnected;
2794
2850
  const cleanupElements = debounce((map) => {
2795
2851
  for (let key of map.keys()) {
2796
- map.set(key, map.get(key).filter(isConnected));
2852
+ const refs = map.get(key).filter((ref) => {
2853
+ const elm = ref.deref();
2854
+ return elm && isConnected(elm);
2855
+ });
2856
+ map.set(key, refs);
2797
2857
  }
2798
2858
  }, 2_000);
2859
+ const core = index.StencilCore;
2860
+ const forceUpdate = core.forceUpdate;
2861
+ const getRenderingRef = core.getRenderingRef;
2799
2862
  const stencilSubscription = () => {
2800
- if (typeof index.getRenderingRef !== 'function') {
2863
+ if (typeof getRenderingRef !== 'function' || typeof forceUpdate !== 'function') {
2801
2864
  // If we are not in a stencil project, we do nothing.
2802
2865
  // This function is not really exported by @stencil/core.
2803
2866
  return {};
2804
2867
  }
2868
+ const ensureForceUpdate = forceUpdate;
2869
+ const ensureGetRenderingRef = getRenderingRef;
2805
2870
  const elmsToUpdate = new Map();
2806
2871
  return {
2807
2872
  dispose: () => elmsToUpdate.clear(),
2808
2873
  get: (propName) => {
2809
- const elm = index.getRenderingRef();
2874
+ const elm = ensureGetRenderingRef();
2810
2875
  if (elm) {
2811
2876
  appendToMap(elmsToUpdate, propName, elm);
2812
2877
  }
2813
2878
  },
2814
2879
  set: (propName) => {
2815
- const elements = elmsToUpdate.get(propName);
2816
- if (elements) {
2817
- elmsToUpdate.set(propName, elements.filter(index.forceUpdate));
2880
+ const refs = elmsToUpdate.get(propName);
2881
+ if (refs) {
2882
+ const nextRefs = refs.filter((ref) => {
2883
+ const elm = ref.deref();
2884
+ if (!elm)
2885
+ return false;
2886
+ return ensureForceUpdate(elm);
2887
+ });
2888
+ elmsToUpdate.set(propName, nextRefs);
2818
2889
  }
2819
2890
  cleanupElements(elmsToUpdate);
2820
2891
  },
2821
2892
  reset: () => {
2822
- elmsToUpdate.forEach((elms) => elms.forEach(index.forceUpdate));
2893
+ elmsToUpdate.forEach((refs) => {
2894
+ refs.forEach((ref) => {
2895
+ const elm = ref.deref();
2896
+ if (elm)
2897
+ ensureForceUpdate(elm);
2898
+ });
2899
+ });
2823
2900
  cleanupElements(elmsToUpdate);
2824
2901
  },
2825
2902
  };
@@ -2827,8 +2904,11 @@ const stencilSubscription = () => {
2827
2904
 
2828
2905
  const unwrap = (val) => (typeof val === 'function' ? val() : val);
2829
2906
  const createObservableMap = (defaultState, shouldUpdate = (a, b) => a !== b) => {
2830
- const unwrappedState = unwrap(defaultState);
2831
- let states = new Map(Object.entries(unwrappedState ?? {}));
2907
+ const resolveDefaultState = () => (unwrap(defaultState) ?? {});
2908
+ const initialState = resolveDefaultState();
2909
+ let states = new Map(Object.entries(initialState));
2910
+ const proxyAvailable = typeof Proxy !== 'undefined';
2911
+ const plainState = proxyAvailable ? null : {};
2832
2912
  const handlers = {
2833
2913
  dispose: [],
2834
2914
  get: [],
@@ -2840,7 +2920,10 @@ const createObservableMap = (defaultState, shouldUpdate = (a, b) => a !== b) =>
2840
2920
  const reset = () => {
2841
2921
  // When resetting the state, the default state may be a function - unwrap it to invoke it.
2842
2922
  // otherwise, the state won't be properly reset
2843
- states = new Map(Object.entries(unwrap(defaultState) ?? {}));
2923
+ states = new Map(Object.entries(resolveDefaultState()));
2924
+ if (!proxyAvailable) {
2925
+ syncPlainStateKeys();
2926
+ }
2844
2927
  handlers.reset.forEach((cb) => cb());
2845
2928
  };
2846
2929
  const dispose = () => {
@@ -2857,12 +2940,14 @@ const createObservableMap = (defaultState, shouldUpdate = (a, b) => a !== b) =>
2857
2940
  const oldValue = states.get(propName);
2858
2941
  if (shouldUpdate(value, oldValue, propName)) {
2859
2942
  states.set(propName, value);
2943
+ if (!proxyAvailable) {
2944
+ ensurePlainProperty(propName);
2945
+ }
2860
2946
  handlers.set.forEach((cb) => cb(propName, value, oldValue));
2861
2947
  }
2862
2948
  };
2863
- const state = (typeof Proxy === 'undefined'
2864
- ? {}
2865
- : new Proxy(unwrappedState, {
2949
+ const state = (proxyAvailable
2950
+ ? new Proxy(initialState, {
2866
2951
  get(_, propName) {
2867
2952
  return get(propName);
2868
2953
  },
@@ -2882,7 +2967,11 @@ const createObservableMap = (defaultState, shouldUpdate = (a, b) => a !== b) =>
2882
2967
  set(propName, value);
2883
2968
  return true;
2884
2969
  },
2885
- }));
2970
+ })
2971
+ : (() => {
2972
+ syncPlainStateKeys();
2973
+ return plainState;
2974
+ })());
2886
2975
  const on = (eventName, callback) => {
2887
2976
  handlers[eventName].push(callback);
2888
2977
  return () => {
@@ -2895,7 +2984,10 @@ const createObservableMap = (defaultState, shouldUpdate = (a, b) => a !== b) =>
2895
2984
  cb(newValue);
2896
2985
  }
2897
2986
  };
2898
- const resetHandler = () => cb(unwrap(defaultState)[propName]);
2987
+ const resetHandler = () => {
2988
+ const snapshot = resolveDefaultState();
2989
+ cb(snapshot[propName]);
2990
+ };
2899
2991
  // Register the handlers
2900
2992
  const unSet = on('set', setHandler);
2901
2993
  const unReset = on('reset', resetHandler);
@@ -2938,6 +3030,38 @@ const createObservableMap = (defaultState, shouldUpdate = (a, b) => a !== b) =>
2938
3030
  changeListeners.delete(listener);
2939
3031
  }
2940
3032
  };
3033
+ function ensurePlainProperty(key) {
3034
+ if (proxyAvailable || !plainState) {
3035
+ return;
3036
+ }
3037
+ if (Object.prototype.hasOwnProperty.call(plainState, key)) {
3038
+ return;
3039
+ }
3040
+ Object.defineProperty(plainState, key, {
3041
+ configurable: true,
3042
+ enumerable: true,
3043
+ get() {
3044
+ return get(key);
3045
+ },
3046
+ set(value) {
3047
+ set(key, value);
3048
+ },
3049
+ });
3050
+ }
3051
+ function syncPlainStateKeys() {
3052
+ if (proxyAvailable || !plainState) {
3053
+ return;
3054
+ }
3055
+ const knownKeys = new Set(states.keys());
3056
+ for (const key of Object.keys(plainState)) {
3057
+ if (!knownKeys.has(key)) {
3058
+ delete plainState[key];
3059
+ }
3060
+ }
3061
+ for (const key of knownKeys) {
3062
+ ensurePlainProperty(key);
3063
+ }
3064
+ }
2941
3065
  return {
2942
3066
  state,
2943
3067
  get,
@@ -2977,6 +3101,8 @@ class StripeServiceClass {
2977
3101
  applicationName: 'stripe-pwa-elements',
2978
3102
  isCheckoutSession: false,
2979
3103
  });
3104
+ /** Incremented on every init so that a slower, older call cannot overwrite newer state */
3105
+ this.initGeneration = 0;
2980
3106
  this.changeListeners = new Map();
2981
3107
  }
2982
3108
  /**
@@ -3004,20 +3130,28 @@ class StripeServiceClass {
3004
3130
  /**
3005
3131
  * Initialize Stripe.js client with Payment Intent mode
3006
3132
  * @param publishableKey - Your Stripe publishable API key
3007
- * @param options - Optional configuration
3133
+ * @param options - Optional configuration (`clientSecret` is the PaymentIntent / SetupIntent client secret)
3008
3134
  */
3009
3135
  async initialize(publishableKey, options) {
3136
+ const generation = ++this.initGeneration;
3137
+ // Capture the previous config before overwriting it, so we can detect real changes
3138
+ const isUpToDate = this.store.state.stripe != null &&
3139
+ !this.store.state.isCheckoutSession &&
3140
+ this.store.state.publishableKey === publishableKey &&
3141
+ this.store.state.stripeAccount === (options === null || options === void 0 ? void 0 : options.stripeAccount) &&
3142
+ this.intentClientSecret === (options === null || options === void 0 ? void 0 : options.clientSecret);
3010
3143
  // Update configuration
3011
3144
  this.store.state.publishableKey = publishableKey;
3012
3145
  this.store.state.isCheckoutSession = false;
3013
- if (options === null || options === void 0 ? void 0 : options.stripeAccount) {
3146
+ this.intentClientSecret = options === null || options === void 0 ? void 0 : options.clientSecret;
3147
+ if ((options === null || options === void 0 ? void 0 : options.stripeAccount) != null && (options === null || options === void 0 ? void 0 : options.stripeAccount) !== '') {
3014
3148
  this.store.state.stripeAccount = options.stripeAccount;
3015
3149
  }
3016
- if (options === null || options === void 0 ? void 0 : options.applicationName) {
3150
+ if ((options === null || options === void 0 ? void 0 : options.applicationName) != null && (options === null || options === void 0 ? void 0 : options.applicationName) !== '') {
3017
3151
  this.store.state.applicationName = options.applicationName;
3018
3152
  }
3019
3153
  // If Stripe.js already loaded with same config, do nothing
3020
- if (this.store.state.stripe && this.store.state.publishableKey === publishableKey && this.store.state.stripeAccount === (options === null || options === void 0 ? void 0 : options.stripeAccount) && !this.store.state.isCheckoutSession) {
3154
+ if (isUpToDate) {
3021
3155
  return;
3022
3156
  }
3023
3157
  this.store.state.loadStripeStatus = 'loading';
@@ -3025,12 +3159,16 @@ class StripeServiceClass {
3025
3159
  const stripe = await index$1.loadStripe(publishableKey, {
3026
3160
  stripeAccount: options === null || options === void 0 ? void 0 : options.stripeAccount,
3027
3161
  });
3162
+ if (generation !== this.initGeneration) {
3163
+ return;
3164
+ }
3028
3165
  // Register app info
3029
3166
  stripe.registerAppInfo({
3030
3167
  name: this.store.state.applicationName,
3031
3168
  });
3032
3169
  this.store.state.stripe = stripe;
3033
- this.store.state.elements = stripe.elements();
3170
+ // Payment Element requires the client secret at Elements creation time
3171
+ this.store.state.elements = (options === null || options === void 0 ? void 0 : options.clientSecret) != null && options.clientSecret !== '' ? stripe.elements({ clientSecret: options.clientSecret }) : stripe.elements();
3034
3172
  this.store.state.checkout = undefined;
3035
3173
  this.store.state.loadStripeStatus = 'success';
3036
3174
  }
@@ -3043,16 +3181,17 @@ class StripeServiceClass {
3043
3181
  * Initialize Stripe.js client with Checkout Session mode
3044
3182
  * @param publishableKey - Your Stripe publishable API key
3045
3183
  * @param checkoutSessionClientSecret - The client secret from Checkout Session
3046
- * @param options - Optional configuration
3184
+ * @param options - Optional configuration (`clientSecret` is the PaymentIntent / SetupIntent client secret)
3047
3185
  */
3048
3186
  async initializeWithCheckoutSession(publishableKey, checkoutSessionClientSecret, options) {
3187
+ const generation = ++this.initGeneration;
3049
3188
  // Update configuration
3050
3189
  this.store.state.publishableKey = publishableKey;
3051
3190
  this.store.state.isCheckoutSession = true;
3052
- if (options === null || options === void 0 ? void 0 : options.stripeAccount) {
3191
+ if ((options === null || options === void 0 ? void 0 : options.stripeAccount) != null && (options === null || options === void 0 ? void 0 : options.stripeAccount) !== '') {
3053
3192
  this.store.state.stripeAccount = options.stripeAccount;
3054
3193
  }
3055
- if (options === null || options === void 0 ? void 0 : options.applicationName) {
3194
+ if ((options === null || options === void 0 ? void 0 : options.applicationName) != null && (options === null || options === void 0 ? void 0 : options.applicationName) !== '') {
3056
3195
  this.store.state.applicationName = options.applicationName;
3057
3196
  }
3058
3197
  this.store.state.loadStripeStatus = 'loading';
@@ -3060,13 +3199,16 @@ class StripeServiceClass {
3060
3199
  const stripe = await index$1.loadStripe(publishableKey, {
3061
3200
  stripeAccount: options === null || options === void 0 ? void 0 : options.stripeAccount,
3062
3201
  });
3202
+ if (generation !== this.initGeneration) {
3203
+ return;
3204
+ }
3063
3205
  // Register app info
3064
3206
  stripe.registerAppInfo({
3065
3207
  name: this.store.state.applicationName,
3066
3208
  });
3067
3209
  this.store.state.stripe = stripe;
3068
3210
  // Initialize Checkout instance instead of Elements
3069
- const checkout = stripe.initCheckout({
3211
+ const checkout = stripe.initCheckoutElementsSdk({
3070
3212
  clientSecret: checkoutSessionClientSecret,
3071
3213
  elementsOptions: options === null || options === void 0 ? void 0 : options.elementsOptions,
3072
3214
  });
@@ -3136,7 +3278,7 @@ new StripeServiceClass();
3136
3278
  function findElement(containerElement, selector, timeout = 5000) {
3137
3279
  return new Promise((resolve, reject) => {
3138
3280
  const elem = containerElement.querySelector(selector);
3139
- if (elem) {
3281
+ if (elem != null) {
3140
3282
  return resolve(elem);
3141
3283
  }
3142
3284
  const timeoutId = setTimeout(() => {
@@ -3145,7 +3287,7 @@ function findElement(containerElement, selector, timeout = 5000) {
3145
3287
  }, timeout);
3146
3288
  const observer = new MutationObserver(() => {
3147
3289
  const elem = containerElement.querySelector(selector);
3148
- if (elem) {
3290
+ if (elem != null) {
3149
3291
  clearTimeout(timeoutId);
3150
3292
  observer.disconnect();
3151
3293
  resolve(elem);
@@ -3188,11 +3330,11 @@ class CardElementManager {
3188
3330
  */
3189
3331
  async initialize(containerElement) {
3190
3332
  const elements = this.stripeService.getElements();
3191
- if (!elements) {
3333
+ if (elements == null) {
3192
3334
  throw new Error('StripeService not initialized. Call StripeService.initialize() first.');
3193
3335
  }
3194
3336
  // Unmount if already initialized
3195
- if (this.cardElements) {
3337
+ if (this.cardElements != null) {
3196
3338
  this.unmount();
3197
3339
  }
3198
3340
  // Create and mount card number element
@@ -3243,7 +3385,7 @@ class CardElementManager {
3243
3385
  */
3244
3386
  unmount() {
3245
3387
  var _a, _b, _c;
3246
- if (!this.cardElements) {
3388
+ if (this.cardElements == null) {
3247
3389
  return;
3248
3390
  }
3249
3391
  (_a = this.cardElements.cardNumber) === null || _a === void 0 ? void 0 : _a.unmount();
@@ -3305,13 +3447,13 @@ class PaymentElementManager {
3305
3447
  async initialize(containerElement, options) {
3306
3448
  const isCheckoutSession = this.stripeService.state.isCheckoutSession;
3307
3449
  // Unmount if already initialized
3308
- if (this.paymentElement) {
3450
+ if (this.paymentElement != null) {
3309
3451
  this.unmount();
3310
3452
  }
3311
3453
  if (isCheckoutSession) {
3312
3454
  // Checkout Session mode: use checkout.createPaymentElement()
3313
3455
  const checkout = this.stripeService.getCheckout();
3314
- if (!checkout) {
3456
+ if (checkout == null) {
3315
3457
  throw new Error('StripeService not initialized with Checkout Session. Call StripeService.initializeWithCheckoutSession() first.');
3316
3458
  }
3317
3459
  // Create payment element using Checkout instance
@@ -3320,7 +3462,7 @@ class PaymentElementManager {
3320
3462
  else {
3321
3463
  // Payment Intent mode: use elements.create('payment')
3322
3464
  const elements = this.stripeService.getElements();
3323
- if (!elements) {
3465
+ if (elements == null) {
3324
3466
  throw new Error('StripeService not initialized. Call StripeService.initialize() first.');
3325
3467
  }
3326
3468
  // Create payment element with options
@@ -3357,7 +3499,7 @@ class PaymentElementManager {
3357
3499
  * Unmount payment element
3358
3500
  */
3359
3501
  unmount() {
3360
- if (!this.paymentElement) {
3502
+ if (this.paymentElement == null) {
3361
3503
  return;
3362
3504
  }
3363
3505
  this.paymentElement.unmount();
@@ -3396,11 +3538,11 @@ class AddressElementManager {
3396
3538
  */
3397
3539
  async initialize(containerElement, options) {
3398
3540
  const elements = this.stripeService.getElements();
3399
- if (!elements) {
3541
+ if (elements == null) {
3400
3542
  throw new Error('StripeService not initialized. Call StripeService.initialize() first.');
3401
3543
  }
3402
3544
  // Unmount if already initialized
3403
- if (this.addressElement) {
3545
+ if (this.addressElement != null) {
3404
3546
  this.unmount();
3405
3547
  }
3406
3548
  // Create and mount address element
@@ -3438,7 +3580,7 @@ class AddressElementManager {
3438
3580
  * Unmount address element
3439
3581
  */
3440
3582
  unmount() {
3441
- if (!this.addressElement) {
3583
+ if (this.addressElement == null) {
3442
3584
  return;
3443
3585
  }
3444
3586
  this.addressElement.unmount();
@@ -3486,11 +3628,11 @@ class LinkAuthenticationElementManager {
3486
3628
  */
3487
3629
  async initialize(containerElement, options) {
3488
3630
  const elements = this.stripeService.getElements();
3489
- if (!elements) {
3631
+ if (elements == null) {
3490
3632
  throw new Error('StripeService not initialized. Call StripeService.initialize() first.');
3491
3633
  }
3492
3634
  // Unmount if already initialized
3493
- if (this.linkAuthenticationElement) {
3635
+ if (this.linkAuthenticationElement != null) {
3494
3636
  this.unmount();
3495
3637
  }
3496
3638
  // Create link authentication element
@@ -3529,7 +3671,7 @@ class LinkAuthenticationElementManager {
3529
3671
  * Unmount link authentication element
3530
3672
  */
3531
3673
  unmount() {
3532
- if (!this.linkAuthenticationElement) {
3674
+ if (this.linkAuthenticationElement == null) {
3533
3675
  return;
3534
3676
  }
3535
3677
  this.linkAuthenticationElement.unmount();
@@ -3569,11 +3711,11 @@ class CurrencySelectorElementManager {
3569
3711
  */
3570
3712
  async initialize(containerElement, options) {
3571
3713
  const elements = this.stripeService.getElements();
3572
- if (!elements) {
3714
+ if (elements == null) {
3573
3715
  throw new Error('StripeService not initialized. Call StripeService.initialize() first.');
3574
3716
  }
3575
3717
  // Unmount if already initialized
3576
- if (this.currencySelectorElement) {
3718
+ if (this.currencySelectorElement != null) {
3577
3719
  this.unmount();
3578
3720
  }
3579
3721
  // Find mount point first to avoid element leak if findElement throws
@@ -3619,7 +3761,7 @@ class CurrencySelectorElementManager {
3619
3761
  * Unmount currency selector element
3620
3762
  */
3621
3763
  unmount() {
3622
- if (!this.currencySelectorElement) {
3764
+ if (this.currencySelectorElement == null) {
3623
3765
  return;
3624
3766
  }
3625
3767
  this.currencySelectorElement.unmount();
@@ -3659,11 +3801,11 @@ class ExpressCheckoutElementManager {
3659
3801
  */
3660
3802
  async initialize(containerElement, options, eventHandlers) {
3661
3803
  const elements = this.stripeService.getElements();
3662
- if (!elements) {
3804
+ if (elements == null) {
3663
3805
  throw new Error('StripeService not initialized. Call StripeService.initialize() first.');
3664
3806
  }
3665
3807
  // Unmount if already initialized
3666
- if (this.expressCheckoutElement) {
3808
+ if (this.expressCheckoutElement != null) {
3667
3809
  this.unmount();
3668
3810
  }
3669
3811
  // Convert buttonHeight from string to number if present
@@ -3681,19 +3823,19 @@ class ExpressCheckoutElementManager {
3681
3823
  // Find the mount point
3682
3824
  const mountPoint = await findElement(containerElement, '#express-checkout-element');
3683
3825
  // Set up event handlers before mounting
3684
- if (eventHandlers === null || eventHandlers === void 0 ? void 0 : eventHandlers.onConfirm) {
3826
+ if ((eventHandlers === null || eventHandlers === void 0 ? void 0 : eventHandlers.onConfirm) != null) {
3685
3827
  expressCheckout.on('confirm', eventHandlers.onConfirm);
3686
3828
  }
3687
- if (eventHandlers === null || eventHandlers === void 0 ? void 0 : eventHandlers.onClick) {
3829
+ if ((eventHandlers === null || eventHandlers === void 0 ? void 0 : eventHandlers.onClick) != null) {
3688
3830
  expressCheckout.on('click', eventHandlers.onClick);
3689
3831
  }
3690
- if (eventHandlers === null || eventHandlers === void 0 ? void 0 : eventHandlers.onCancel) {
3832
+ if ((eventHandlers === null || eventHandlers === void 0 ? void 0 : eventHandlers.onCancel) != null) {
3691
3833
  expressCheckout.on('cancel', eventHandlers.onCancel);
3692
3834
  }
3693
- if (eventHandlers === null || eventHandlers === void 0 ? void 0 : eventHandlers.onShippingAddressChange) {
3835
+ if ((eventHandlers === null || eventHandlers === void 0 ? void 0 : eventHandlers.onShippingAddressChange) != null) {
3694
3836
  expressCheckout.on('shippingaddresschange', eventHandlers.onShippingAddressChange);
3695
3837
  }
3696
- if (eventHandlers === null || eventHandlers === void 0 ? void 0 : eventHandlers.onShippingRateChange) {
3838
+ if ((eventHandlers === null || eventHandlers === void 0 ? void 0 : eventHandlers.onShippingRateChange) != null) {
3697
3839
  expressCheckout.on('shippingratechange', eventHandlers.onShippingRateChange);
3698
3840
  }
3699
3841
  // Add ready event handler
@@ -3716,7 +3858,7 @@ class ExpressCheckoutElementManager {
3716
3858
  * @param options - Partial options to update
3717
3859
  */
3718
3860
  update(options) {
3719
- if (!this.expressCheckoutElement) {
3861
+ if (this.expressCheckoutElement == null) {
3720
3862
  console.warn('Express Checkout Element not initialized. Cannot update options.');
3721
3863
  return;
3722
3864
  }
@@ -3747,7 +3889,7 @@ class ExpressCheckoutElementManager {
3747
3889
  * Unmount express checkout element
3748
3890
  */
3749
3891
  unmount() {
3750
- if (!this.expressCheckoutElement) {
3892
+ if (this.expressCheckoutElement == null) {
3751
3893
  return;
3752
3894
  }
3753
3895
  this.expressCheckoutElement.unmount();
@@ -3820,6 +3962,3 @@ const serviceFactory = new ServiceFactory();
3820
3962
  exports.checkPlatform = checkPlatform;
3821
3963
  exports.i18n = i18n;
3822
3964
  exports.serviceFactory = serviceFactory;
3823
- //# sourceMappingURL=factory-CbbbSvkg.js.map
3824
-
3825
- //# sourceMappingURL=factory-CbbbSvkg.js.map