@paykka/card-checkout-ui 0.13.8 → 0.13.13

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 (175) hide show
  1. package/dist/card-checkout-ui.js +20 -20
  2. package/dist/card-checkout-ui.umd.cjs +21 -21
  3. package/dist/es/_commonjsHelpers.js +1 -82
  4. package/dist/es/api/index.js +2 -1
  5. package/dist/es/api/modules/checkout/map.js +1 -0
  6. package/dist/es/api/modules/get-browser-params.js +20 -8
  7. package/dist/es/api/modules/index.js +2 -1
  8. package/dist/es/api/modules/map.js +2 -1
  9. package/dist/es/api/modules/risk/index.js +21 -18
  10. package/dist/es/api/modules/threeDS/index.js +2 -1
  11. package/dist/es/api/modules/vietqr/index.js +2 -1
  12. package/dist/es/api/utils/index.js +4 -1
  13. package/dist/es/components/AccordionItem/AccordionItem.js +0 -1
  14. package/dist/es/components/AccountNameField/index.js +1 -1
  15. package/dist/es/components/AddressField/index.js +1 -2
  16. package/dist/es/components/AliPay/index.js +4 -2
  17. package/dist/es/components/ApplePay/index.js +201 -135
  18. package/dist/es/components/Boost/index.js +4 -2
  19. package/dist/es/components/CPFField/index.js +88 -0
  20. package/dist/es/components/Card/index.js +5 -11
  21. package/dist/es/components/CardBrands/index.js +0 -1
  22. package/dist/es/components/CardExpireDateField/index.js +1 -1
  23. package/dist/es/components/CardHolderNameField/index.js +1 -1
  24. package/dist/es/components/CardIBANField/index.js +1 -1
  25. package/dist/es/components/CardNo/index.js +0 -1
  26. package/dist/es/components/CardNumberField/index.js +1 -1
  27. package/dist/es/components/CardSecurityCodeField/index.js +1 -1
  28. package/dist/es/components/CardSelector/index.js +1 -1
  29. package/dist/es/components/CombinedCardInfo/index.js +1 -1
  30. package/dist/es/components/DropIn/index.js +0 -1
  31. package/dist/es/components/EmailField/EmailField.js +1 -1
  32. package/dist/es/components/EncryptedCard/index.js +12 -11
  33. package/dist/es/components/GooglePay/index.js +1 -0
  34. package/dist/es/components/GrabPay/index.js +4 -2
  35. package/dist/es/components/GuideCard/index.js +1 -1
  36. package/dist/es/components/LinePay/index.js +4 -2
  37. package/dist/es/components/MayBankQRPay/index.js +4 -2
  38. package/dist/es/components/NinePay/index.js +4 -2
  39. package/dist/es/components/RecurringTip/index.js +1 -2
  40. package/dist/es/components/SecuredFieldsProvider/index.js +20 -3
  41. package/dist/es/components/SecuredIframe/index.js +50 -22
  42. package/dist/es/components/Sepa/index.js +4 -2
  43. package/dist/es/components/ShopeePay/index.js +4 -2
  44. package/dist/es/components/SubmitButton/index.js +1 -1
  45. package/dist/es/components/TNGWallet/index.js +4 -2
  46. package/dist/es/components/ThreeDS/index.js +1 -2
  47. package/dist/es/components/Tip/index.js +18 -0
  48. package/dist/es/components/WechatPay/index.js +4 -2
  49. package/dist/es/components/business/QRCodeModal/QRCodeModal.js +1 -1
  50. package/dist/es/components/business/QRCodeModal/index.js +0 -1
  51. package/dist/es/components/business/index.js +0 -1
  52. package/dist/es/components/index.js +0 -1
  53. package/dist/es/components/internal/Accordion/index.js +0 -1
  54. package/dist/es/components/internal/Button/Button.js +0 -1
  55. package/dist/es/components/internal/Button/index.js +0 -1
  56. package/dist/es/components/internal/CheckBox/CheckBox.js +0 -1
  57. package/dist/es/components/internal/CheckBox/index.js +0 -1
  58. package/dist/es/components/internal/Form/type.js +0 -1
  59. package/dist/es/components/internal/Info/Info.js +0 -1
  60. package/dist/es/components/internal/Info/index.js +0 -1
  61. package/dist/es/components/internal/Input/Input.js +1 -1
  62. package/dist/es/components/internal/Input/type.js +0 -1
  63. package/dist/es/components/internal/LoadingCheck/LoadingCheck.js +0 -1
  64. package/dist/es/components/internal/LoadingCheck/index.js +0 -1
  65. package/dist/es/components/internal/Modal/Modal.js +1 -1
  66. package/dist/es/components/internal/QRCode/QRCode.js +0 -1
  67. package/dist/es/components/internal/QRCode/index.js +0 -1
  68. package/dist/es/components/internal/Select/Select.js +14 -17
  69. package/dist/es/components/internal/Select/SelectMenu.js +2 -3
  70. package/dist/es/components/internal/Select/SelectMenuItem.js +0 -1
  71. package/dist/es/components/wallets/GCash/GCash.js +4 -2
  72. package/dist/es/components/wallets/OpayWallet/OpayWallet.js +8 -9
  73. package/dist/es/components/wallets/PagaWallet/PagaWallet.js +8 -9
  74. package/dist/es/components/wallets/Paymaya/Paymaya.js +4 -2
  75. package/dist/es/components/wallets/PicPay/PicPay.js +136 -72
  76. package/dist/es/components/wallets/Pix/Pix.js +136 -72
  77. package/dist/es/components/wallets/Vietqr/Vietqr.js +4 -2
  78. package/dist/es/components/wallets/Zalopay/Zalopay.js +4 -2
  79. package/dist/es/config.js +1 -1
  80. package/dist/es/constant.js +2 -0
  81. package/dist/es/core/checkout.js +15 -3
  82. package/dist/es/core/environment.js +10 -2
  83. package/dist/es/core/index.js +0 -1
  84. package/dist/es/core/query.js +2 -1
  85. package/dist/es/core/session.js +6 -2
  86. package/dist/es/core/theme.js +0 -1
  87. package/dist/es/core.js +585 -4
  88. package/dist/es/hooks/index.js +0 -1
  89. package/dist/es/hooks/useI18n.js +0 -1
  90. package/dist/es/hooks/usePayState.js +13 -6
  91. package/dist/es/i18n/locales/de-DE.js +6 -1
  92. package/dist/es/i18n/locales/en-GB.js +6 -1
  93. package/dist/es/i18n/locales/es-ES.js +6 -1
  94. package/dist/es/i18n/locales/fr-FR.js +7 -2
  95. package/dist/es/i18n/locales/ja-JP.js +6 -1
  96. package/dist/es/i18n/locales/ko-KR.js +6 -1
  97. package/dist/es/i18n/locales/nl-NL.js +6 -1
  98. package/dist/es/i18n/locales/pt-PT.js +6 -1
  99. package/dist/es/i18n/locales/ru-RU.js +6 -1
  100. package/dist/es/i18n/locales/zh-CN.js +6 -1
  101. package/dist/es/i18n/locales/zh-HK.js +7 -2
  102. package/dist/es/i18n/locales/zh-TW.js +7 -2
  103. package/dist/es/index.js +6 -3
  104. package/dist/es/out/base-fraud-detection.js +134 -0
  105. package/dist/es/out/config.js +16 -0
  106. package/dist/es/out/fraud-detection.js +118 -27
  107. package/dist/es/out/paykka-detection.js +63 -0
  108. package/dist/es/out/stripe-radar.js +25 -51
  109. package/dist/es/out/worldpay-ddc.js +52 -99
  110. package/dist/es/out/worldpay-jsc-origin.js +0 -1
  111. package/dist/es/out/worldpay-jsc.js +21 -43
  112. package/dist/es/style.css +1 -1
  113. package/dist/es/types/event.js +33 -13
  114. package/dist/es/types/index.js +14 -0
  115. package/dist/es/utils/cpf.js +48 -0
  116. package/dist/es/utils/encrypt.js +18 -0
  117. package/dist/es/utils/iframe.js +1 -1
  118. package/dist/es/utils/location.js +4 -2
  119. package/dist/es/utils/redirect.js +8 -5
  120. package/dist/es/utils/system-info/index.js +1 -3
  121. package/dist/style.css +1 -1
  122. package/dist/types/api/modules/checkout/type.d.ts +2 -0
  123. package/dist/types/api/modules/get-browser-params.d.ts +25 -1
  124. package/dist/types/api/modules/risk/index.d.ts +28 -12
  125. package/dist/types/api/modules/type.d.ts +5 -0
  126. package/dist/types/api/utils/index.d.ts +3 -0
  127. package/dist/types/components/ApplePay/config.d.ts +9 -0
  128. package/dist/types/components/ApplePay/hooks/useApplePay.d.ts +15 -0
  129. package/dist/types/components/ApplePay/type.d.ts +53 -10
  130. package/dist/types/components/ApplePay/utils.d.ts +8 -2
  131. package/dist/types/components/CPFField/CPFField.d.ts +4 -0
  132. package/dist/types/components/CPFField/index.d.ts +2 -0
  133. package/dist/types/components/CPFField/type.d.ts +21 -0
  134. package/dist/types/components/SecuredFieldsProvider/type.d.ts +8 -3
  135. package/dist/types/components/SecuredIframe/useSecuredInput.d.ts +2 -5
  136. package/dist/types/components/ThreeDS/components/ThreeDSIframe/ThreeDSIframe.d.ts +6 -0
  137. package/dist/types/components/Tip/Tip.d.ts +3 -0
  138. package/dist/types/components/Tip/index.d.ts +2 -0
  139. package/dist/types/components/Tip/type.d.ts +12 -0
  140. package/dist/types/constant.d.ts +3 -1
  141. package/dist/types/core/checkout.d.ts +1 -1
  142. package/dist/types/core/environment.d.ts +12 -0
  143. package/dist/types/core/session.d.ts +1 -0
  144. package/dist/types/i18n/locales/de-DE.d.ts +4 -0
  145. package/dist/types/i18n/locales/en-GB.d.ts +4 -0
  146. package/dist/types/i18n/locales/es-ES.d.ts +4 -0
  147. package/dist/types/i18n/locales/fr-FR.d.ts +4 -0
  148. package/dist/types/i18n/locales/ja-JP.d.ts +4 -0
  149. package/dist/types/i18n/locales/ko-KR.d.ts +4 -0
  150. package/dist/types/i18n/locales/nl-NL.d.ts +4 -0
  151. package/dist/types/i18n/locales/pt-PT.d.ts +4 -0
  152. package/dist/types/i18n/locales/ru-RU.d.ts +4 -0
  153. package/dist/types/i18n/locales/zh-CN.d.ts +4 -0
  154. package/dist/types/i18n/locales/zh-HK.d.ts +4 -0
  155. package/dist/types/i18n/locales/zh-TW.d.ts +4 -0
  156. package/dist/types/out/base-fraud-detection.d.ts +53 -0
  157. package/dist/types/out/config.d.ts +11 -0
  158. package/dist/types/out/fraud-detection.d.ts +14 -3
  159. package/dist/types/out/paykka-detection.d.ts +20 -0
  160. package/dist/types/out/stripe-radar.d.ts +7 -9
  161. package/dist/types/out/types.d.ts +8 -2
  162. package/dist/types/out/worldpay-ddc.d.ts +7 -19
  163. package/dist/types/out/worldpay-jsc.d.ts +8 -18
  164. package/dist/types/types/event.d.ts +86 -39
  165. package/dist/types/types/fraud-detection.d.ts +1 -1
  166. package/dist/types/types/index.d.ts +22 -2
  167. package/dist/types/types/message.d.ts +12 -12
  168. package/dist/types/utils/app-payment.d.ts +2 -0
  169. package/dist/types/utils/cpf.d.ts +32 -0
  170. package/dist/types/utils/encrypt.d.ts +9 -0
  171. package/dist/types/utils/location.d.ts +1 -0
  172. package/dist/types/utils/system-info/index.d.ts +0 -1
  173. package/package.json +5 -4
  174. package/dist/types/components/ThreeDS/components/ThreeDSStatus/ThreeDSStatus.d.ts +0 -3
  175. package/dist/types/components/ThreeDS/components/ThreeDSStatus/type.d.ts +0 -6
package/dist/es/core.js CHANGED
@@ -1,3 +1,9 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
+ var __publicField = (obj, key, value) => {
4
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
+ return value;
6
+ };
1
7
  var n, l$3, u$3, t$2, i$2, o$2, r$1, f$3, e$3, c$2, s$3, a$2, h$2 = {}, v$2 = [], p$3 = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, y$2 = Array.isArray;
2
8
  function d$3(n2, l2) {
3
9
  for (var u2 in l2)
@@ -2992,10 +2998,10 @@ function isPdfViewerEnabled() {
2992
2998
  }
2993
2999
  function getArchitecture() {
2994
3000
  var f2 = new Float32Array(1);
2995
- var u8 = new Uint8Array(f2.buffer);
3001
+ var u82 = new Uint8Array(f2.buffer);
2996
3002
  f2[0] = Infinity;
2997
3003
  f2[0] = f2[0] - f2[0];
2998
- return u8[3];
3004
+ return u82[3];
2999
3005
  }
3000
3006
  function getApplePayState() {
3001
3007
  var ApplePaySession = window.ApplePaySession;
@@ -4442,6 +4448,579 @@ function useSignal(n2) {
4442
4448
  return d$1(n2);
4443
4449
  }, []);
4444
4450
  }
4451
+ /*! noble-ciphers - MIT License (c) 2023 Paul Miller (paulmillr.com) */
4452
+ function isBytes(a2) {
4453
+ return a2 instanceof Uint8Array || ArrayBuffer.isView(a2) && a2.constructor.name === "Uint8Array";
4454
+ }
4455
+ function anumber(n2) {
4456
+ if (!Number.isSafeInteger(n2) || n2 < 0)
4457
+ throw new Error("positive integer expected, got " + n2);
4458
+ }
4459
+ function abytes(value, length, title = "") {
4460
+ const bytes = isBytes(value);
4461
+ const len = value == null ? void 0 : value.length;
4462
+ const needsLen = length !== void 0;
4463
+ if (!bytes || needsLen && len !== length) {
4464
+ const prefix = title && `"${title}" `;
4465
+ const ofLen = needsLen ? ` of length ${length}` : "";
4466
+ const got = bytes ? `length=${len}` : `type=${typeof value}`;
4467
+ throw new Error(prefix + "expected Uint8Array" + ofLen + ", got " + got);
4468
+ }
4469
+ return value;
4470
+ }
4471
+ function aexists(instance, checkFinished = true) {
4472
+ if (instance.destroyed)
4473
+ throw new Error("Hash instance has been destroyed");
4474
+ if (checkFinished && instance.finished)
4475
+ throw new Error("Hash#digest() has already been called");
4476
+ }
4477
+ function aoutput(out, instance) {
4478
+ abytes(out, void 0, "output");
4479
+ const min = instance.outputLen;
4480
+ if (out.length < min) {
4481
+ throw new Error("digestInto() expects output buffer of length at least " + min);
4482
+ }
4483
+ }
4484
+ function u8(arr) {
4485
+ return new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength);
4486
+ }
4487
+ function u32(arr) {
4488
+ return new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));
4489
+ }
4490
+ function clean(...arrays) {
4491
+ for (let i2 = 0; i2 < arrays.length; i2++) {
4492
+ arrays[i2].fill(0);
4493
+ }
4494
+ }
4495
+ function createView(arr) {
4496
+ return new DataView(arr.buffer, arr.byteOffset, arr.byteLength);
4497
+ }
4498
+ const isLE = /* @__PURE__ */ (() => new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68)();
4499
+ function concatBytes(...arrays) {
4500
+ let sum = 0;
4501
+ for (let i2 = 0; i2 < arrays.length; i2++) {
4502
+ const a2 = arrays[i2];
4503
+ abytes(a2);
4504
+ sum += a2.length;
4505
+ }
4506
+ const res = new Uint8Array(sum);
4507
+ for (let i2 = 0, pad = 0; i2 < arrays.length; i2++) {
4508
+ const a2 = arrays[i2];
4509
+ res.set(a2, pad);
4510
+ pad += a2.length;
4511
+ }
4512
+ return res;
4513
+ }
4514
+ function equalBytes(a2, b2) {
4515
+ if (a2.length !== b2.length)
4516
+ return false;
4517
+ let diff = 0;
4518
+ for (let i2 = 0; i2 < a2.length; i2++)
4519
+ diff |= a2[i2] ^ b2[i2];
4520
+ return diff === 0;
4521
+ }
4522
+ const wrapCipher = /* @__NO_SIDE_EFFECTS__ */ (params, constructor) => {
4523
+ function wrappedCipher(key, ...args) {
4524
+ abytes(key, void 0, "key");
4525
+ if (!isLE)
4526
+ throw new Error("Non little-endian hardware is not yet supported");
4527
+ if (params.nonceLength !== void 0) {
4528
+ const nonce = args[0];
4529
+ abytes(nonce, params.varSizeNonce ? void 0 : params.nonceLength, "nonce");
4530
+ }
4531
+ const tagl = params.tagLength;
4532
+ if (tagl && args[1] !== void 0)
4533
+ abytes(args[1], void 0, "AAD");
4534
+ const cipher = constructor(key, ...args);
4535
+ const checkOutput = (fnLength, output) => {
4536
+ if (output !== void 0) {
4537
+ if (fnLength !== 2)
4538
+ throw new Error("cipher output not supported");
4539
+ abytes(output, void 0, "output");
4540
+ }
4541
+ };
4542
+ let called = false;
4543
+ const wrCipher = {
4544
+ encrypt(data, output) {
4545
+ if (called)
4546
+ throw new Error("cannot encrypt() twice with same key + nonce");
4547
+ called = true;
4548
+ abytes(data);
4549
+ checkOutput(cipher.encrypt.length, output);
4550
+ return cipher.encrypt(data, output);
4551
+ },
4552
+ decrypt(data, output) {
4553
+ abytes(data);
4554
+ if (tagl && data.length < tagl)
4555
+ throw new Error('"ciphertext" expected length bigger than tagLength=' + tagl);
4556
+ checkOutput(cipher.decrypt.length, output);
4557
+ return cipher.decrypt(data, output);
4558
+ }
4559
+ };
4560
+ return wrCipher;
4561
+ }
4562
+ Object.assign(wrappedCipher, params);
4563
+ return wrappedCipher;
4564
+ };
4565
+ function getOutput(expectedLength, out, onlyAligned = true) {
4566
+ if (out === void 0)
4567
+ return new Uint8Array(expectedLength);
4568
+ if (out.length !== expectedLength)
4569
+ throw new Error('"output" expected Uint8Array of length ' + expectedLength + ", got: " + out.length);
4570
+ if (onlyAligned && !isAligned32(out))
4571
+ throw new Error("invalid output, must be aligned");
4572
+ return out;
4573
+ }
4574
+ function u64Lengths(dataLength, aadLength, isLE2) {
4575
+ const num = new Uint8Array(16);
4576
+ const view = createView(num);
4577
+ view.setBigUint64(0, BigInt(aadLength), isLE2);
4578
+ view.setBigUint64(8, BigInt(dataLength), isLE2);
4579
+ return num;
4580
+ }
4581
+ function isAligned32(bytes) {
4582
+ return bytes.byteOffset % 4 === 0;
4583
+ }
4584
+ function copyBytes(bytes) {
4585
+ return Uint8Array.from(bytes);
4586
+ }
4587
+ function randomBytes(bytesLength = 32) {
4588
+ const cr = typeof globalThis === "object" ? globalThis.crypto : null;
4589
+ if (typeof (cr == null ? void 0 : cr.getRandomValues) !== "function")
4590
+ throw new Error("crypto.getRandomValues must be defined");
4591
+ return cr.getRandomValues(new Uint8Array(bytesLength));
4592
+ }
4593
+ function managedNonce(fn, randomBytes_ = randomBytes) {
4594
+ const { nonceLength } = fn;
4595
+ anumber(nonceLength);
4596
+ const addNonce = (nonce, ciphertext) => {
4597
+ const out = concatBytes(nonce, ciphertext);
4598
+ ciphertext.fill(0);
4599
+ return out;
4600
+ };
4601
+ return (key, ...args) => ({
4602
+ encrypt(plaintext) {
4603
+ abytes(plaintext);
4604
+ const nonce = randomBytes_(nonceLength);
4605
+ const encrypted = fn(key, nonce, ...args).encrypt(plaintext);
4606
+ if (encrypted instanceof Promise)
4607
+ return encrypted.then((ct) => addNonce(nonce, ct));
4608
+ return addNonce(nonce, encrypted);
4609
+ },
4610
+ decrypt(ciphertext) {
4611
+ abytes(ciphertext);
4612
+ const nonce = ciphertext.subarray(0, nonceLength);
4613
+ const decrypted = ciphertext.subarray(nonceLength);
4614
+ return fn(key, nonce, ...args).decrypt(decrypted);
4615
+ }
4616
+ });
4617
+ }
4618
+ const BLOCK_SIZE$1 = 16;
4619
+ const ZEROS16 = /* @__PURE__ */ new Uint8Array(16);
4620
+ const ZEROS32 = u32(ZEROS16);
4621
+ const POLY$1 = 225;
4622
+ const mul2$1 = (s0, s1, s2, s3) => {
4623
+ const hiBit = s3 & 1;
4624
+ return {
4625
+ s3: s2 << 31 | s3 >>> 1,
4626
+ s2: s1 << 31 | s2 >>> 1,
4627
+ s1: s0 << 31 | s1 >>> 1,
4628
+ s0: s0 >>> 1 ^ POLY$1 << 24 & -(hiBit & 1)
4629
+ // reduce % poly
4630
+ };
4631
+ };
4632
+ const swapLE = (n2) => (n2 >>> 0 & 255) << 24 | (n2 >>> 8 & 255) << 16 | (n2 >>> 16 & 255) << 8 | n2 >>> 24 & 255 | 0;
4633
+ function _toGHASHKey(k2) {
4634
+ k2.reverse();
4635
+ const hiBit = k2[15] & 1;
4636
+ let carry = 0;
4637
+ for (let i2 = 0; i2 < k2.length; i2++) {
4638
+ const t2 = k2[i2];
4639
+ k2[i2] = t2 >>> 1 | carry;
4640
+ carry = (t2 & 1) << 7;
4641
+ }
4642
+ k2[0] ^= -hiBit & 225;
4643
+ return k2;
4644
+ }
4645
+ const estimateWindow = (bytes) => {
4646
+ if (bytes > 64 * 1024)
4647
+ return 8;
4648
+ if (bytes > 1024)
4649
+ return 4;
4650
+ return 2;
4651
+ };
4652
+ class GHASH {
4653
+ // We select bits per window adaptively based on expectedLength
4654
+ constructor(key, expectedLength) {
4655
+ __publicField(this, "blockLen", BLOCK_SIZE$1);
4656
+ __publicField(this, "outputLen", BLOCK_SIZE$1);
4657
+ __publicField(this, "s0", 0);
4658
+ __publicField(this, "s1", 0);
4659
+ __publicField(this, "s2", 0);
4660
+ __publicField(this, "s3", 0);
4661
+ __publicField(this, "finished", false);
4662
+ __publicField(this, "t");
4663
+ __publicField(this, "W");
4664
+ __publicField(this, "windowSize");
4665
+ abytes(key, 16, "key");
4666
+ key = copyBytes(key);
4667
+ const kView = createView(key);
4668
+ let k0 = kView.getUint32(0, false);
4669
+ let k1 = kView.getUint32(4, false);
4670
+ let k2 = kView.getUint32(8, false);
4671
+ let k3 = kView.getUint32(12, false);
4672
+ const doubles = [];
4673
+ for (let i2 = 0; i2 < 128; i2++) {
4674
+ doubles.push({ s0: swapLE(k0), s1: swapLE(k1), s2: swapLE(k2), s3: swapLE(k3) });
4675
+ ({ s0: k0, s1: k1, s2: k2, s3: k3 } = mul2$1(k0, k1, k2, k3));
4676
+ }
4677
+ const W2 = estimateWindow(expectedLength || 1024);
4678
+ if (![1, 2, 4, 8].includes(W2))
4679
+ throw new Error("ghash: invalid window size, expected 2, 4 or 8");
4680
+ this.W = W2;
4681
+ const bits = 128;
4682
+ const windows = bits / W2;
4683
+ const windowSize = this.windowSize = 2 ** W2;
4684
+ const items = [];
4685
+ for (let w2 = 0; w2 < windows; w2++) {
4686
+ for (let byte2 = 0; byte2 < windowSize; byte2++) {
4687
+ let s0 = 0, s1 = 0, s2 = 0, s3 = 0;
4688
+ for (let j2 = 0; j2 < W2; j2++) {
4689
+ const bit = byte2 >>> W2 - j2 - 1 & 1;
4690
+ if (!bit)
4691
+ continue;
4692
+ const { s0: d0, s1: d1, s2: d2, s3: d3 } = doubles[W2 * w2 + j2];
4693
+ s0 ^= d0, s1 ^= d1, s2 ^= d2, s3 ^= d3;
4694
+ }
4695
+ items.push({ s0, s1, s2, s3 });
4696
+ }
4697
+ }
4698
+ this.t = items;
4699
+ }
4700
+ _updateBlock(s0, s1, s2, s3) {
4701
+ s0 ^= this.s0, s1 ^= this.s1, s2 ^= this.s2, s3 ^= this.s3;
4702
+ const { W: W2, t: t2, windowSize } = this;
4703
+ let o0 = 0, o1 = 0, o2 = 0, o3 = 0;
4704
+ const mask = (1 << W2) - 1;
4705
+ let w2 = 0;
4706
+ for (const num of [s0, s1, s2, s3]) {
4707
+ for (let bytePos = 0; bytePos < 4; bytePos++) {
4708
+ const byte2 = num >>> 8 * bytePos & 255;
4709
+ for (let bitPos = 8 / W2 - 1; bitPos >= 0; bitPos--) {
4710
+ const bit = byte2 >>> W2 * bitPos & mask;
4711
+ const { s0: e0, s1: e1, s2: e2, s3: e3 } = t2[w2 * windowSize + bit];
4712
+ o0 ^= e0, o1 ^= e1, o2 ^= e2, o3 ^= e3;
4713
+ w2 += 1;
4714
+ }
4715
+ }
4716
+ }
4717
+ this.s0 = o0;
4718
+ this.s1 = o1;
4719
+ this.s2 = o2;
4720
+ this.s3 = o3;
4721
+ }
4722
+ update(data) {
4723
+ aexists(this);
4724
+ abytes(data);
4725
+ data = copyBytes(data);
4726
+ const b32 = u32(data);
4727
+ const blocks = Math.floor(data.length / BLOCK_SIZE$1);
4728
+ const left = data.length % BLOCK_SIZE$1;
4729
+ for (let i2 = 0; i2 < blocks; i2++) {
4730
+ this._updateBlock(b32[i2 * 4 + 0], b32[i2 * 4 + 1], b32[i2 * 4 + 2], b32[i2 * 4 + 3]);
4731
+ }
4732
+ if (left) {
4733
+ ZEROS16.set(data.subarray(blocks * BLOCK_SIZE$1));
4734
+ this._updateBlock(ZEROS32[0], ZEROS32[1], ZEROS32[2], ZEROS32[3]);
4735
+ clean(ZEROS32);
4736
+ }
4737
+ return this;
4738
+ }
4739
+ destroy() {
4740
+ const { t: t2 } = this;
4741
+ for (const elm of t2) {
4742
+ elm.s0 = 0, elm.s1 = 0, elm.s2 = 0, elm.s3 = 0;
4743
+ }
4744
+ }
4745
+ digestInto(out) {
4746
+ aexists(this);
4747
+ aoutput(out, this);
4748
+ this.finished = true;
4749
+ const { s0, s1, s2, s3 } = this;
4750
+ const o32 = u32(out);
4751
+ o32[0] = s0;
4752
+ o32[1] = s1;
4753
+ o32[2] = s2;
4754
+ o32[3] = s3;
4755
+ return out;
4756
+ }
4757
+ digest() {
4758
+ const res = new Uint8Array(BLOCK_SIZE$1);
4759
+ this.digestInto(res);
4760
+ this.destroy();
4761
+ return res;
4762
+ }
4763
+ }
4764
+ class Polyval extends GHASH {
4765
+ constructor(key, expectedLength) {
4766
+ abytes(key);
4767
+ const ghKey = _toGHASHKey(copyBytes(key));
4768
+ super(ghKey, expectedLength);
4769
+ clean(ghKey);
4770
+ }
4771
+ update(data) {
4772
+ aexists(this);
4773
+ abytes(data);
4774
+ data = copyBytes(data);
4775
+ const b32 = u32(data);
4776
+ const left = data.length % BLOCK_SIZE$1;
4777
+ const blocks = Math.floor(data.length / BLOCK_SIZE$1);
4778
+ for (let i2 = 0; i2 < blocks; i2++) {
4779
+ this._updateBlock(swapLE(b32[i2 * 4 + 3]), swapLE(b32[i2 * 4 + 2]), swapLE(b32[i2 * 4 + 1]), swapLE(b32[i2 * 4 + 0]));
4780
+ }
4781
+ if (left) {
4782
+ ZEROS16.set(data.subarray(blocks * BLOCK_SIZE$1));
4783
+ this._updateBlock(swapLE(ZEROS32[3]), swapLE(ZEROS32[2]), swapLE(ZEROS32[1]), swapLE(ZEROS32[0]));
4784
+ clean(ZEROS32);
4785
+ }
4786
+ return this;
4787
+ }
4788
+ digestInto(out) {
4789
+ aexists(this);
4790
+ aoutput(out, this);
4791
+ this.finished = true;
4792
+ const { s0, s1, s2, s3 } = this;
4793
+ const o32 = u32(out);
4794
+ o32[0] = s0;
4795
+ o32[1] = s1;
4796
+ o32[2] = s2;
4797
+ o32[3] = s3;
4798
+ return out.reverse();
4799
+ }
4800
+ }
4801
+ function wrapConstructorWithKey(hashCons) {
4802
+ const hashC = (msg, key) => hashCons(key, msg.length).update(msg).digest();
4803
+ const tmp = hashCons(new Uint8Array(16), 0);
4804
+ hashC.outputLen = tmp.outputLen;
4805
+ hashC.blockLen = tmp.blockLen;
4806
+ hashC.create = (key, expectedLength) => hashCons(key, expectedLength);
4807
+ return hashC;
4808
+ }
4809
+ const ghash = wrapConstructorWithKey((key, expectedLength) => new GHASH(key, expectedLength));
4810
+ wrapConstructorWithKey((key, expectedLength) => new Polyval(key, expectedLength));
4811
+ const BLOCK_SIZE = 16;
4812
+ const BLOCK_SIZE32 = 4;
4813
+ const EMPTY_BLOCK = /* @__PURE__ */ new Uint8Array(BLOCK_SIZE);
4814
+ const POLY = 283;
4815
+ function validateKeyLength(key) {
4816
+ if (![16, 24, 32].includes(key.length))
4817
+ throw new Error('"aes key" expected Uint8Array of length 16/24/32, got length=' + key.length);
4818
+ }
4819
+ function mul2(n2) {
4820
+ return n2 << 1 ^ POLY & -(n2 >> 7);
4821
+ }
4822
+ function mul(a2, b2) {
4823
+ let res = 0;
4824
+ for (; b2 > 0; b2 >>= 1) {
4825
+ res ^= a2 & -(b2 & 1);
4826
+ a2 = mul2(a2);
4827
+ }
4828
+ return res;
4829
+ }
4830
+ const sbox = /* @__PURE__ */ (() => {
4831
+ const t2 = new Uint8Array(256);
4832
+ for (let i2 = 0, x2 = 1; i2 < 256; i2++, x2 ^= mul2(x2))
4833
+ t2[i2] = x2;
4834
+ const box = new Uint8Array(256);
4835
+ box[0] = 99;
4836
+ for (let i2 = 0; i2 < 255; i2++) {
4837
+ let x2 = t2[255 - i2];
4838
+ x2 |= x2 << 8;
4839
+ box[t2[i2]] = (x2 ^ x2 >> 4 ^ x2 >> 5 ^ x2 >> 6 ^ x2 >> 7 ^ 99) & 255;
4840
+ }
4841
+ clean(t2);
4842
+ return box;
4843
+ })();
4844
+ const rotr32_8 = (n2) => n2 << 24 | n2 >>> 8;
4845
+ const rotl32_8 = (n2) => n2 << 8 | n2 >>> 24;
4846
+ function genTtable(sbox2, fn) {
4847
+ if (sbox2.length !== 256)
4848
+ throw new Error("Wrong sbox length");
4849
+ const T0 = new Uint32Array(256).map((_2, j2) => fn(sbox2[j2]));
4850
+ const T1 = T0.map(rotl32_8);
4851
+ const T2 = T1.map(rotl32_8);
4852
+ const T3 = T2.map(rotl32_8);
4853
+ const T01 = new Uint32Array(256 * 256);
4854
+ const T23 = new Uint32Array(256 * 256);
4855
+ const sbox22 = new Uint16Array(256 * 256);
4856
+ for (let i2 = 0; i2 < 256; i2++) {
4857
+ for (let j2 = 0; j2 < 256; j2++) {
4858
+ const idx = i2 * 256 + j2;
4859
+ T01[idx] = T0[i2] ^ T1[j2];
4860
+ T23[idx] = T2[i2] ^ T3[j2];
4861
+ sbox22[idx] = sbox2[i2] << 8 | sbox2[j2];
4862
+ }
4863
+ }
4864
+ return { sbox: sbox2, sbox2: sbox22, T0, T1, T2, T3, T01, T23 };
4865
+ }
4866
+ const tableEncoding = /* @__PURE__ */ genTtable(sbox, (s2) => mul(s2, 3) << 24 | s2 << 16 | s2 << 8 | mul(s2, 2));
4867
+ const xPowers = /* @__PURE__ */ (() => {
4868
+ const p2 = new Uint8Array(16);
4869
+ for (let i2 = 0, x2 = 1; i2 < 16; i2++, x2 = mul2(x2))
4870
+ p2[i2] = x2;
4871
+ return p2;
4872
+ })();
4873
+ function expandKeyLE(key) {
4874
+ abytes(key);
4875
+ const len = key.length;
4876
+ validateKeyLength(key);
4877
+ const { sbox2 } = tableEncoding;
4878
+ const toClean = [];
4879
+ if (!isAligned32(key))
4880
+ toClean.push(key = copyBytes(key));
4881
+ const k32 = u32(key);
4882
+ const Nk = k32.length;
4883
+ const subByte = (n2) => applySbox(sbox2, n2, n2, n2, n2);
4884
+ const xk = new Uint32Array(len + 28);
4885
+ xk.set(k32);
4886
+ for (let i2 = Nk; i2 < xk.length; i2++) {
4887
+ let t2 = xk[i2 - 1];
4888
+ if (i2 % Nk === 0)
4889
+ t2 = subByte(rotr32_8(t2)) ^ xPowers[i2 / Nk - 1];
4890
+ else if (Nk > 6 && i2 % Nk === 4)
4891
+ t2 = subByte(t2);
4892
+ xk[i2] = xk[i2 - Nk] ^ t2;
4893
+ }
4894
+ clean(...toClean);
4895
+ return xk;
4896
+ }
4897
+ function apply0123(T01, T23, s0, s1, s2, s3) {
4898
+ return T01[s0 << 8 & 65280 | s1 >>> 8 & 255] ^ T23[s2 >>> 8 & 65280 | s3 >>> 24 & 255];
4899
+ }
4900
+ function applySbox(sbox2, s0, s1, s2, s3) {
4901
+ return sbox2[s0 & 255 | s1 & 65280] | sbox2[s2 >>> 16 & 255 | s3 >>> 16 & 65280] << 16;
4902
+ }
4903
+ function encrypt(xk, s0, s1, s2, s3) {
4904
+ const { sbox2, T01, T23 } = tableEncoding;
4905
+ let k2 = 0;
4906
+ s0 ^= xk[k2++], s1 ^= xk[k2++], s2 ^= xk[k2++], s3 ^= xk[k2++];
4907
+ const rounds = xk.length / 4 - 2;
4908
+ for (let i2 = 0; i2 < rounds; i2++) {
4909
+ const t02 = xk[k2++] ^ apply0123(T01, T23, s0, s1, s2, s3);
4910
+ const t12 = xk[k2++] ^ apply0123(T01, T23, s1, s2, s3, s0);
4911
+ const t22 = xk[k2++] ^ apply0123(T01, T23, s2, s3, s0, s1);
4912
+ const t32 = xk[k2++] ^ apply0123(T01, T23, s3, s0, s1, s2);
4913
+ s0 = t02, s1 = t12, s2 = t22, s3 = t32;
4914
+ }
4915
+ const t0 = xk[k2++] ^ applySbox(sbox2, s0, s1, s2, s3);
4916
+ const t1 = xk[k2++] ^ applySbox(sbox2, s1, s2, s3, s0);
4917
+ const t2 = xk[k2++] ^ applySbox(sbox2, s2, s3, s0, s1);
4918
+ const t3 = xk[k2++] ^ applySbox(sbox2, s3, s0, s1, s2);
4919
+ return { s0: t0, s1: t1, s2: t2, s3: t3 };
4920
+ }
4921
+ function ctr32(xk, isLE2, nonce, src, dst) {
4922
+ abytes(nonce, BLOCK_SIZE, "nonce");
4923
+ abytes(src);
4924
+ dst = getOutput(src.length, dst);
4925
+ const ctr = nonce;
4926
+ const c32 = u32(ctr);
4927
+ const view = createView(ctr);
4928
+ const src32 = u32(src);
4929
+ const dst32 = u32(dst);
4930
+ const ctrPos = isLE2 ? 0 : 12;
4931
+ const srcLen = src.length;
4932
+ let ctrNum = view.getUint32(ctrPos, isLE2);
4933
+ let { s0, s1, s2, s3 } = encrypt(xk, c32[0], c32[1], c32[2], c32[3]);
4934
+ for (let i2 = 0; i2 + 4 <= src32.length; i2 += 4) {
4935
+ dst32[i2 + 0] = src32[i2 + 0] ^ s0;
4936
+ dst32[i2 + 1] = src32[i2 + 1] ^ s1;
4937
+ dst32[i2 + 2] = src32[i2 + 2] ^ s2;
4938
+ dst32[i2 + 3] = src32[i2 + 3] ^ s3;
4939
+ ctrNum = ctrNum + 1 >>> 0;
4940
+ view.setUint32(ctrPos, ctrNum, isLE2);
4941
+ ({ s0, s1, s2, s3 } = encrypt(xk, c32[0], c32[1], c32[2], c32[3]));
4942
+ }
4943
+ const start = BLOCK_SIZE * Math.floor(src32.length / BLOCK_SIZE32);
4944
+ if (start < srcLen) {
4945
+ const b32 = new Uint32Array([s0, s1, s2, s3]);
4946
+ const buf = u8(b32);
4947
+ for (let i2 = start, pos = 0; i2 < srcLen; i2++, pos++)
4948
+ dst[i2] = src[i2] ^ buf[pos];
4949
+ clean(b32);
4950
+ }
4951
+ return dst;
4952
+ }
4953
+ function computeTag(fn, isLE2, key, data, AAD) {
4954
+ const aadLength = AAD ? AAD.length : 0;
4955
+ const h2 = fn.create(key, data.length + aadLength);
4956
+ if (AAD)
4957
+ h2.update(AAD);
4958
+ const num = u64Lengths(8 * data.length, 8 * aadLength, isLE2);
4959
+ h2.update(data);
4960
+ h2.update(num);
4961
+ const res = h2.digest();
4962
+ clean(num);
4963
+ return res;
4964
+ }
4965
+ const gcm = /* @__PURE__ */ wrapCipher({ blockSize: 16, nonceLength: 12, tagLength: 16, varSizeNonce: true }, function aesgcm(key, nonce, AAD) {
4966
+ if (nonce.length < 8)
4967
+ throw new Error("aes/gcm: invalid nonce length");
4968
+ const tagLength = 16;
4969
+ function _computeTag(authKey, tagMask, data) {
4970
+ const tag = computeTag(ghash, false, authKey, data, AAD);
4971
+ for (let i2 = 0; i2 < tagMask.length; i2++)
4972
+ tag[i2] ^= tagMask[i2];
4973
+ return tag;
4974
+ }
4975
+ function deriveKeys() {
4976
+ const xk = expandKeyLE(key);
4977
+ const authKey = EMPTY_BLOCK.slice();
4978
+ const counter = EMPTY_BLOCK.slice();
4979
+ ctr32(xk, false, counter, counter, authKey);
4980
+ if (nonce.length === 12) {
4981
+ counter.set(nonce);
4982
+ } else {
4983
+ const nonceLen = EMPTY_BLOCK.slice();
4984
+ const view = createView(nonceLen);
4985
+ view.setBigUint64(8, BigInt(nonce.length * 8), false);
4986
+ const g2 = ghash.create(authKey).update(nonce).update(nonceLen);
4987
+ g2.digestInto(counter);
4988
+ g2.destroy();
4989
+ }
4990
+ const tagMask = ctr32(xk, false, counter, EMPTY_BLOCK);
4991
+ return { xk, authKey, counter, tagMask };
4992
+ }
4993
+ return {
4994
+ encrypt(plaintext) {
4995
+ const { xk, authKey, counter, tagMask } = deriveKeys();
4996
+ const out = new Uint8Array(plaintext.length + tagLength);
4997
+ const toClean = [xk, authKey, counter, tagMask];
4998
+ if (!isAligned32(plaintext))
4999
+ toClean.push(plaintext = copyBytes(plaintext));
5000
+ ctr32(xk, false, counter, plaintext, out.subarray(0, plaintext.length));
5001
+ const tag = _computeTag(authKey, tagMask, out.subarray(0, out.length - tagLength));
5002
+ toClean.push(tag);
5003
+ out.set(tag, plaintext.length);
5004
+ clean(...toClean);
5005
+ return out;
5006
+ },
5007
+ decrypt(ciphertext) {
5008
+ const { xk, authKey, counter, tagMask } = deriveKeys();
5009
+ const toClean = [xk, authKey, tagMask, counter];
5010
+ if (!isAligned32(ciphertext))
5011
+ toClean.push(ciphertext = copyBytes(ciphertext));
5012
+ const data = ciphertext.subarray(0, -tagLength);
5013
+ const passedTag = ciphertext.subarray(-tagLength);
5014
+ const tag = _computeTag(authKey, tagMask, data);
5015
+ toClean.push(tag);
5016
+ if (!equalBytes(tag, passedTag))
5017
+ throw new Error("aes/gcm: invalid ghash tag");
5018
+ const out = ctr32(xk, false, counter, data);
5019
+ clean(...toClean);
5020
+ return out;
5021
+ }
5022
+ };
5023
+ });
4445
5024
  var browser = {};
4446
5025
  var canPromise$1 = function() {
4447
5026
  return typeof Promise === "function" && Promise.prototype && Promise.prototype.then;
@@ -5195,14 +5774,14 @@ galoisField.log = function log(n2) {
5195
5774
  galoisField.exp = function exp(n2) {
5196
5775
  return EXP_TABLE[n2];
5197
5776
  };
5198
- galoisField.mul = function mul(x2, y2) {
5777
+ galoisField.mul = function mul3(x2, y2) {
5199
5778
  if (x2 === 0 || y2 === 0)
5200
5779
  return 0;
5201
5780
  return EXP_TABLE[LOG_TABLE[x2] + LOG_TABLE[y2]];
5202
5781
  };
5203
5782
  (function(exports) {
5204
5783
  const GF = galoisField;
5205
- exports.mul = function mul2(p1, p2) {
5784
+ exports.mul = function mul4(p1, p2) {
5206
5785
  const coeff = new Uint8Array(p1.length + p2.length - 1);
5207
5786
  for (let i2 = 0; i2 < p1.length; i2++) {
5208
5787
  for (let j2 = 0; j2 < p2.length; j2++) {
@@ -6441,9 +7020,11 @@ export {
6441
7020
  browser,
6442
7021
  d$1 as d,
6443
7022
  e$1 as e,
7023
+ gcm,
6444
7024
  h$1 as h,
6445
7025
  index,
6446
7026
  inputToRGB,
7027
+ managedNonce,
6447
7028
  q,
6448
7029
  rgbToHex,
6449
7030
  rgbToHsv,
@@ -2,5 +2,4 @@ import "../utils/card-brand/brands.js";
2
2
  import "../utils/system-info/get-browser-info.js";
3
3
  import "../core.js";
4
4
  import "../core/context.js";
5
- import "../api/http.js";
6
5
  import "../out/worldpay-jsc-origin.js";
@@ -2,7 +2,6 @@ import { x, h } from "../core.js";
2
2
  import { CoreContext } from "../core/context.js";
3
3
  import "../utils/card-brand/brands.js";
4
4
  import "../utils/system-info/get-browser-info.js";
5
- import "../api/http.js";
6
5
  import { I18n } from "../i18n/I18n.js";
7
6
  import "../out/worldpay-jsc-origin.js";
8
7
  function useI18n(locale) {
@@ -13,18 +13,25 @@ function usePayState(session, core) {
13
13
  const { i18n } = useI18n();
14
14
  y(() => {
15
15
  session.ready().then(() => {
16
- var _a;
16
+ var _a, _b;
17
17
  setSessionReady(true);
18
18
  const locale = getRealLocale(
19
19
  customLocale || ((_a = session.checkout) == null ? void 0 : _a.locale) || getBrowserInfo().language
20
20
  );
21
21
  i18n.load(locale);
22
- const fraudDetection2 = getFraudDetectionInstance(fraudDetectionEnv, void 0, {
23
- onEvent: (type, data) => {
24
- var _a2, _b;
25
- (_b = core == null ? void 0 : (_a2 = core.config).onEvent) == null ? void 0 : _b.call(_a2, type, data);
22
+ const fraudDetection2 = getFraudDetectionInstance(
23
+ {
24
+ clientKey: session.paykkaDetectionKey,
25
+ env: fraudDetectionEnv
26
+ },
27
+ {
28
+ sessionMode: (_b = session.checkout) == null ? void 0 : _b.sessionMode,
29
+ onEvent: (type, data) => {
30
+ var _a2, _b2;
31
+ (_b2 = core == null ? void 0 : (_a2 = core.config).onEvent) == null ? void 0 : _b2.call(_a2, type, data);
32
+ }
26
33
  }
27
- });
34
+ );
28
35
  setFraudDetection(fraudDetection2);
29
36
  fraudDetection2 == null ? void 0 : fraudDetection2.createFraudDetection();
30
37
  });
@@ -89,7 +89,12 @@ const deDE = {
89
89
  "qrCode.expired": "Der QR-Code ist abgelaufen.",
90
90
  "qrCode.scanByGcash": "QR-Code mit GCash scannen",
91
91
  "qrCode.scanByZalopay": "QR-Code mit Zalopay scannen",
92
- "qrCode.scanByVietqr": "QR-Code mit VietQR scannen"
92
+ "qrCode.scanByVietqr": "QR-Code mit VietQR scannen",
93
+ // cpf
94
+ "cpf.label": "CPF/CNPJ",
95
+ "cpf.incomplete": "Ihr CPF/CNPJ ist unvollständig",
96
+ "cpf.placeholder": "123.456.789-00",
97
+ "iofTip": "Dies ist ein internationaler Kauf, ohne mögliche IOF-Gebühren. Diese Gebühren werden von Ihrem Kartenaussteller erhoben und können von uns weder geschätzt noch erstattet werden. Der endgültige Betrag hängt von Ihrem Kontoauszug ab."
93
98
  };
94
99
  export {
95
100
  deDE as default