!function() {
function e(t) {
var n = i[t];
if (void 0 !== n)
return n.exports;
var r = i[t] = {
id: t,
loaded: !1,
exports: {}
};
return a[t](r, r.exports, e),
r.loaded = !0,
r.exports
}
var t, n, r, a = {
94184: function(e, t) {
var n;
!function() {
"use strict";
function r() {
for (var e = [], t = 0; t < arguments.length; t++) {
var n = arguments[t];
if (n) {
var i = typeof n;
if ("string" === i || "number" === i)
e.push(n);
else if (Array.isArray(n) && n.length) {
var o = r.apply(null, n);
o && e.push(o)
} else if ("object" === i)
for (var s in n)
a.call(n, s) && n[s] && e.push(s)
}
}
return e.join(" ")
}
var a = {}.hasOwnProperty;
e.exports ? (r.default = r,
e.exports = r) : void 0 === (n = function() {
return r
}
.apply(t, [])) || (e.exports = n)
}()
},
62322: function(e, t, n) {
e.exports = n.p + "fingerprinted/data/countryRanges-da252f255fed0fefce3e3b3c60707e3d.json"
},
8464: function(e, t, n) {
e.exports = n.p + "fingerprinted/data/countries_ar-7995ee218dfd37546f754bd73b67e2cc.json"
},
90342: function(e, t, n) {
e.exports = n.p + "fingerprinted/data/countries_bg-c9f7496faecf6cafdeb3cf831b179cc8.json"
},
32726: function(e, t, n) {
e.exports = n.p + "fingerprinted/data/countries_cs-915e85912aa04ad63a5584feb0fc8bb0.json"
},
3120: function(e, t, n) {
e.exports = n.p + "fingerprinted/data/countries_da-adb3ee60351423c264b632973d03ed53.json"
},
7689: function(e, t, n) {
e.exports = n.p + "fingerprinted/data/countries_de-2b6b5f5d41f3e43a04030cea94edb8d1.json"
},
96250: function(e, t, n) {
e.exports = n.p + "fingerprinted/data/countries_el-a04fc1046c60760d5f4db7cc854ae683.json"
},
96889: function(e, t, n) {
e.exports = n.p + "fingerprinted/data/countries_en-GB-919c91fad2788750937cae126d4af487.json"
},
23030: function(e, t, n) {
e.exports = n.p + "fingerprinted/data/countries_es-419-1582431feda14a4d627b0a371024d18e.json"
},
54613: function(e, t, n) {
e.exports = n.p + "fingerprinted/data/countries_es-0c588d4d6449e3a2b4d51f68184e2a79.json"
},
16973: function(e, t, n) {
e.exports = n.p + "fingerprinted/data/countries_et-8708475e6ad83fae45d078a2dbe65db0.json"
},
40724: function(e, t, n) {
e.exports = n.p + "fingerprinted/data/countries_fi-79b9d3b22bc927ff175a2b7789d1bc1b.json"
},
71060: function(e, t, n) {
e.exports = n.p + "fingerprinted/data/countries_fil-5a27be13ab8b8967120518414fa334a0.json"
},
12875: function(e, t, n) {
e.exports = n.p + "fingerprinted/data/countries_fr-CA-f6925dfb1246de74780941ee066dd4c4.json"
},
60919: function(e, t, n) {
e.exports = n.p + "fingerprinted/data/countries_fr-0e37ccdb379b2077b2778bc2b50c3d9a.json"
},
10378: function(e, t, n) {
e.exports = n.p + "fingerprinted/data/countries_he-383873fa83b3f0563818f2b4028efb2e.json"
},
5427: function(e, t, n) {
e.exports = n.p + "fingerprinted/data/countries_hr-e94ea4c33ce03cad056cdad9fac3fcd0.json"
},
59291: function(e, t, n) {
e.exports = n.p + "fingerprinted/data/countries_hu-c9ae651a44b2b8863e45d74c22cdb8a2.json"
},
41713: function(e, t, n) {
e.exports = n.p + "fingerprinted/data/countries_id-33a99764a59a0b733f2ff91e6205fa33.json"
},
48173: function(e, t, n) {
e.exports = n.p + "fingerprinted/data/countries_it-8db847e5ca071da136659bc0bb4fdbfc.json"
},
43596: function(e, t, n) {
e.exports = n.p + "fingerprinted/data/countries_ja-253b6ab1d15e7f2803f4a93763c9b478.json"
},
97750: function(e, t, n) {
e.exports = n.p + "fingerprinted/data/countries_ko-1650cc6afc15806adb8278fcc0b14638.json"
},
2901: function(e, t, n) {
e.exports = n.p + "fingerprinted/data/countries_lt-06e7da2f01df9bdbfacaf16888891655.json"
},
54581: function(e, t, n) {
e.exports = n.p + "fingerprinted/data/countries_lv-efe906c78e152688135b28b763767e35.json"
},
53763: function(e, t, n) {
e.exports = n.p + "fingerprinted/data/countries_ms-263f626611972c4aa3a61ddf3dc84807.json"
},
61685: function(e, t, n) {
e.exports = n.p + "fingerprinted/data/countries_mt-39127973b49fd7b047fda36bd20f78b2.json"
},
83389: function(e, t, n) {
e.exports = n.p + "fingerprinted/data/countries_nb-119c16f73621c459a1709635b23076f5.json"
},
39156: function(e, t, n) {
e.exports = n.p + "fingerprinted/data/countries_nl-000477773d66b87bd2934f8b2522e643.json"
},
53556: function(e, t, n) {
e.exports = n.p + "fingerprinted/data/countries_pl-4383dc0c911ce720674835b1bba58bf0.json"
},
47126: function(e, t, n) {
e.exports = n.p + "fingerprinted/data/countries_pt-BR-eddd788ff5214ba9e31e71093eaa9626.json"
},
527: function(e, t, n) {
e.exports = n.p + "fingerprinted/data/countries_pt-eddd788ff5214ba9e31e71093eaa9626.json"
},
60613: function(e, t, n) {
e.exports = n.p + "fingerprinted/data/countries_ro-213ccae4582f9f1e32053b8f374b54ca.json"
},
5563: function(e, t, n) {
e.exports = n.p + "fingerprinted/data/countries_ru-8e118e56fbb432ba12dc98528a763953.json"
},
65043: function(e, t, n) {
e.exports = n.p + "fingerprinted/data/countries_sk-b3c3e6c3852626d2171e781a02ab54a6.json"
},
83005: function(e, t, n) {
e.exports = n.p + "fingerprinted/data/countries_sl-7ca0853f2777837c5c31d652a5b52540.json"
},
34700: function(e, t, n) {
e.exports = n.p + "fingerprinted/data/countries_sv-5077d9af0d468732f2a27282bfc368f6.json"
},
75478: function(e, t, n) {
e.exports = n.p + "fingerprinted/data/countries_th-1e8a4c8dca0790bbdcc11bca9167ed15.json"
},
77918: function(e, t, n) {
e.exports = n.p + "fingerprinted/data/countries_tr-00d31366439767435294a8f0245444df.json"
},
99797: function(e, t, n) {
e.exports = n.p + "fingerprinted/data/countries_vi-59774d6a444189f3e0bad7fc1f0fb38e.json"
},
35300: function(e, t, n) {
e.exports = n.p + "fingerprinted/data/countries_zh-HK-f35106f3eb1089b5e02fa501884d391b.json"
},
3523: function(e, t, n) {
e.exports = n.p + "fingerprinted/data/countries_zh-TW-6a4624f1b98d781fb0299cfb1e57b6ff.json"
},
30265: function(e, t, n) {
e.exports = n.p + "fingerprinted/data/countries_zh-e858bf02fb850b7ff9ee3398d38af18c.json"
},
14657: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/amex-a49b82f46c5cd6a96a6e418a6ca1717c.svg"
},
86520: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/cartes_bancaires-4f58478f31a1195d2dee740e3a2d632a.svg"
},
5167: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/diners-fbcbd3360f8e3f629cdaa80e93abdb8b.svg"
},
15972: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/discover-ac52cd46f89fa40a29a0bfb954e33173.svg"
},
54504: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/elo-efe873e884e6c9eb817f23a120caaa3e.svg"
},
75979: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/jcb-271fd06e6e7a2c52692ffa91a95fb64f.svg"
},
53022: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/mastercard-4d8844094130711885b5e41b28c9848f.svg"
},
2919: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/unionpay-8a10aefc7295216c338ba4e1224627a1.svg"
},
94697: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/unknown-3efab5bbc66170a4d0d0fd59aa124626.svg"
},
94827: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/visa-729c05c240c4bdb47b03ac81d9945bfe.svg"
},
85923: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/arzteundapothekerbank-042c4229a5a7bb9f02d387d65dfc778b.svg"
},
3302: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/austriananadibankag-d11a66c07ab819f811640a7f990efe3a.svg"
},
87006: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/bankaustria-5426f6c1a90db852e74016cdfb2e0316.svg"
},
51063: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/bankhauscarlspangler-1a262f171ac5bba7416b9a811df5393b.svg"
},
32503: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/bankhausschelhammerundschatteraag-9cf553f8e8727ed61f4c0609b033baae.svg"
},
54098: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/bawagpskag-8fb73950e3d0274d94d6b792a5b07ff0.svg"
},
8683: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/bksbankag-058dd42c4c9f2394564c9ad66205062e.svg"
},
49696: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/brullkallmusbankag-982ab7a5cb05dca9546c83a6094d63e4.svg"
},
88187: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/btvvierlanderbank-cf60b97d6d19650d77b0fa057a4b4346.svg"
},
16747: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/capitalbankgrawegruppeag-f1e5e7849afcd37a5f491494c6f658ef.svg"
},
21846: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/dolomitenbank-38035a501a857ef861ac80822b32f8af.svg"
},
78487: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/easybankag-0c515c56825861a77650971655a7ddc4.svg"
},
15468: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/erstebankundsparkassen-1505bbb8d05b4649858ad0549049b5b6.svg"
},
24584: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/hypoalpeadriabankinternationalag-f63e65b9b2bd3b1f9c819dc201934ce0.svg"
},
51302: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/hypobankburgenlandaktiengesellschaft-4eb6b5af1d89ea93c00fd5ae11822d21.svg"
},
66146: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/hyponoelbfurniederosterreichuwien-14e79934df77ac09263a7643aac4a51f.svg"
},
76279: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/hypooberosterreichsalzburgsteiermark-62ec6a17ddf4c7cdd13310256925b922.svg"
},
58180: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/hypotirolbankag-e40b86e4f31e9aa822588f25cde35ca5.svg"
},
3648: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/hypovorarlbergbankag-0aefc74e5ea860564a52d28cb6f62ed4.svg"
},
874: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/marchfelderbank-f7612abf71f851354ce545c9713608ee.svg"
},
41359: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/oberbankag-c239ccd935b57cc7df753854c25ff148.svg"
},
36248: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/raiffeisenbankengruppeosterreich-ffa16cd3c86ddf5f3a7ef0212d2fed1e.svg"
},
97185: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/schoellerbankag-70d1b0150075ba7d8e9e919bd068eb73.svg"
},
73149: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/spardabankwien-4739adbdc2520d09539cff882e80562e.svg"
},
52801: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/volksbankgruppe-4101bc41d41d6da1bcea5b720d2112dd.svg"
},
70224: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/volkskreditbankag-12a2f08e971c6f448992772fca943b72.svg"
},
34237: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/vrbankbraunau-cd7d3c6ec2ed226632ae11350b1da7fe.svg"
},
5937: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/abnamro-4445e65420800f96f68cfc67a273f66b.svg"
},
21520: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/asn-3d9b1bbff2f8f12105510992dbb37ae8.svg"
},
3089: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/bunq-4b42e7fb68fac0c5abb7ba3492115d81.svg"
},
58256: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/ing-f4beb9f58834a82babe38427cec0ba95.svg"
},
94223: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/knab-dbdf61d58d3004c23573158cb91e9569.svg"
},
66863: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/n26-5ad3e0ae7677208c845a3b81e42bdd0e.svg"
},
36628: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/nn-ef0da4b36142c28718ad24baedc58453.svg"
},
69824: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/rabobank-dc5187e8413419975fda9a72a08c25a3.svg"
},
83260: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/regiobank-d3d9929a79d4e6a127e09ea8abe201b9.svg"
},
24975: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/revolut-bbd51dde92fa137e0060ac6210978827.svg"
},
54481: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/sns-bfdac0e49115f2f30c9fe978b5221531.svg"
},
73381: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/triodos-cf5d13d3dea9d1250d2b51a8eb0b53e8.svg"
},
83181: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/vanlanschot-2b1bf938febce9173fe10ff6265e9657.svg"
},
82142: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/yoursafe-c3cd00e5634e9c380c28ffe985359728.svg"
},
66485: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/aliorbank-c6789d09f9b192f7733721e2ba39ca4c.svg"
},
42844: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/bankmillennium-657833db0ec83857ce60a15f7886e011.svg"
},
39028: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/banknowybfg-1dfd1fd38291d8adb5df4313a69b3b63.svg"
},
59329: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/bankpekao-db8e0a14fa106488043c69471f9d9fc7.svg"
},
99213: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/bankspotdzielcze-79a94c9d70d891eb70d986bbc77419c0.svg"
},
47809: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/blik-687a27fdbf663a763d1e9f6fac79716d.svg"
},
95987: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/bnpparibas-bea4ae4dcbe8e0a8beedf8e667ba2a05.svg"
},
66323: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/bosbank-46bd3df394ed5922c192bc668c76ae7e.svg"
},
56909: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/citihandlowy-bb852ec837a50e63f6ea0f82ca4ae7de.svg"
},
9232: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/creditagricole-dd898a263a87b46365fa44efc7102cf2.svg"
},
32230: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/getinbank-755c014b9aa3f7eedee21126271fe834.svg"
},
70784: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/ideabank-bb23fb44e205a14391b31b83993c14b8.svg"
},
17349: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/ing-d63ea534e7d5db0a2b51ab1bfb9808b6.svg"
},
46262: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/inteligo-3f6d911ac96cb251aae6f90417af48a7.svg"
},
22408: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/ipko-e2711a810ea9c7de033e46edddaa81a2.svg"
},
51959: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/mbank-5e824f02166c74712cafca1e0e439835.svg"
},
27525: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/nestbank-08e13ab441077ac23da329d624585246.svg"
},
79695: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/noblebank-3114ddb9eb90481261a1e8fbabd6068b.svg"
},
59539: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/plusbank-fb844b3678b9fdd1e6e1416f044fe2aa.svg"
},
28824: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/pocztowy24-a74a0c4fa89949337653e69876d74121.svg"
},
27564: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/santander-361810b7f9ca2cd2140802d85e93ebf2.svg"
},
53691: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/toyotabank-df00c48caaf544f919c9fbb656906c68.svg"
},
58828: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/velobank-39aa411b719957c2c5f5d9de9cc01075.svg"
},
60804: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/volkswagenbank-dd2feaf1f7ccec00d17cdfae34896e81.svg"
},
74953: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/uk_bankofscotland-55ab0dc4e5e9a777595577aba205795e.svg"
},
33536: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/uk_barclays-15ae4dc8afe92e4f4b0cdc556ef442f5.svg"
},
52029: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/uk_coutts-4b07e251ae5148edd6536787c287711e.svg"
},
43650: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/uk_danskebank-b092087884ada6458498c50df6c7148d.svg"
},
65761: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/uk_firstdirect-7e3371c3c77eeb020397624e5321042f.svg"
},
39830: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/uk_halifax-3a6ed135ad0ac06b67f9a2f05a0b7e78.svg"
},
44109: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/uk_hsbc-84ace57feb36e7544d41f192ba2de3cc.svg"
},
232: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/uk_lloyds-0bbb338c0e6ce15df3e62f9709362c4f.svg"
},
23459: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/uk_monzo-6ddb9fdfa336b7f6a90d47f05b514a65.svg"
},
51304: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/uk_nationwide-24249ba5d5f323283092ffcea4fe734b.svg"
},
38305: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/uk_natwest-631cd6fef39c8c37133b9a9497543e2f.svg"
},
56544: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/uk_rbs-28822f4a733573a326c696fdaaf57573.svg"
},
53005: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/uk_revolut-e98261ed85e3c973f73a3532df0f059c.svg"
},
61287: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/uk_santander-0f48b69fe6d93484987acdf74361309f.svg"
},
75447: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/uk_tsb-fcf2ec84c69bbea5bb23730eefe4fdd3.svg"
},
5970: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/uk_ulster-28822f4a733573a326c696fdaaf57573.svg"
},
60341: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/GenericCardLogo-3f3bb5081c22dd3edb6072fbaa1be656.svg"
},
80527: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/HyundaiCardLogo-06c92cfe75ffd91056a79c52baa759ea.svg"
},
5550: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/KakaoPayLogo-5e18ecdb533b14c651709ad3c0c9dfe7.svg"
},
53226: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/KookminCardLogo-de259d729e77111256151d5d28aa226d.svg"
},
98685: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/NaverPayLogo-684df4317db2e96e27147bf67a5c7905.svg"
},
33179: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/SamsungPayLpaLogo-6ee0eab87ab6092884c061d7b690890b.svg"
},
56317: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/ShinhanCardLogo-6dd597065bf02f992a0a03aa9ea95eb3.svg"
},
85584: function(e, t, n) {
e.exports = n.p + "fingerprinted/img/CitibankLogo-78480c77462a60a4b947afa68103eeb2.svg"
},
62320: function(e, t) {
var n, r = {
domainThreshold: 2,
secondLevelThreshold: 2,
topLevelThreshold: 2,
defaultDomains: ["msn.com", "bellsouth.net", "telus.net", "comcast.net", "optusnet.com.au", "earthlink.net", "qq.com", "sky.com", "icloud.com", "mac.com", "sympatico.ca", "googlemail.com", "att.net", "xtra.co.nz", "web.de", "cox.net", "gmail.com", "ymail.com", "aim.com", "rogers.com", "verizon.net", "rocketmail.com", "google.com", "optonline.net", "sbcglobal.net", "aol.com", "me.com", "btinternet.com", "charter.net", "shaw.ca"],
defaultSecondLevelDomains: ["yahoo", "hotmail", "mail", "live", "outlook", "gmx"],
defaultTopLevelDomains: ["com", "com.au", "com.tw", "ca", "co.nz", "co.uk", "de", "fr", "it", "ru", "net", "org", "edu", "gov", "jp", "nl", "kr", "se", "eu", "ie", "co.il", "us", "at", "be", "dk", "hk", "es", "gr", "ch", "no", "cz", "in", "net", "net.au", "info", "biz", "mil", "co.jp", "sg", "hu"],
run: function(e) {
e.domains = e.domains || r.defaultDomains,
e.secondLevelDomains = e.secondLevelDomains || r.defaultSecondLevelDomains,
e.topLevelDomains = e.topLevelDomains || r.defaultTopLevelDomains,
e.distanceFunction = e.distanceFunction || r.sift3Distance;
var t = function(e) {
return e
}
, n = e.suggested || t
, a = e.empty || t
, i = r.suggest(r.encodeEmail(e.email), e.domains, e.secondLevelDomains, e.topLevelDomains, e.distanceFunction);
return i ? n(i) : a()
},
suggest: function(e, t, n, r, a) {
e = e.toLowerCase();
var i = this.splitEmail(e);
if (n && r && -1 !== n.indexOf(i.secondLevelDomain) && -1 !== r.indexOf(i.topLevelDomain))
return !1;
if (u = this.findClosestDomain(i.domain, t, a, this.domainThreshold))
return u != i.domain && {
address: i.address,
domain: u,
full: i.address + "@" + u
};
var o = this.findClosestDomain(i.secondLevelDomain, n, a, this.secondLevelThreshold)
, s = this.findClosestDomain(i.topLevelDomain, r, a, this.topLevelThreshold);
if (i.domain) {
var u = i.domain
, l = !1;
if (o && o != i.secondLevelDomain && (u = u.replace(i.secondLevelDomain, o),
l = !0),
s && s != i.topLevelDomain && (u = u.replace(i.topLevelDomain, s),
l = !0),
1 == l)
return {
address: i.address,
domain: u,
full: i.address + "@" + u
}
}
return !1
},
findClosestDomain: function(e, t, n, r) {
var a;
r = r || this.topLevelThreshold;
var i = 99
, o = null;
if (!e || !t)
return !1;
n || (n = this.sift3Distance);
for (var s = 0; s < t.length; s++) {
if (e === t[s])
return e;
(a = n(e, t[s])) < i && (i = a,
o = t[s])
}
return i <= r && null !== o && o
},
sift3Distance: function(e, t) {
if (null == e || 0 === e.length)
return null == t || 0 === t.length ? 0 : t.length;
if (null == t || 0 === t.length)
return e.length;
for (var n = 0, r = 0, a = 0, i = 0; n + r < e.length && n + a < t.length; ) {
if (e.charAt(n + r) == t.charAt(n + a))
i++;
else {
r = 0,
a = 0;
for (var o = 0; o < 5; o++) {
if (n + o < e.length && e.charAt(n + o) == t.charAt(n)) {
r = o;
break
}
if (n + o < t.length && e.charAt(n) == t.charAt(n + o)) {
a = o;
break
}
}
}
n++
}
return (e.length + t.length) / 2 - i
},
splitEmail: function(e) {
var t = e.trim().split("@");
if (t.length < 2)
return !1;
for (var n = 0; n < t.length; n++)
if ("" === t[n])
return !1;
var r = t.pop()
, a = r.split(".")
, i = ""
, o = "";
if (0 == a.length)
return !1;
if (1 == a.length)
o = a[0];
else {
i = a[0];
for (n = 1; n < a.length; n++)
o += a[n] + ".";
o = o.substring(0, o.length - 1)
}
return {
topLevelDomain: o,
secondLevelDomain: i,
domain: r,
address: t.join("@")
}
},
encodeEmail: function(e) {
var t = encodeURI(e);
return t = t.replace("%20", " ").replace("%25", "%").replace("%5E", "^").replace("%60", "`").replace("%7B", "{").replace("%7C", "|").replace("%7D", "}")
}
};
e.exports && (e.exports = r),
void 0 === (n = function() {
return r
}
.apply(t, [])) || (e.exports = n),
"undefined" != typeof window && window.jQuery && (jQuery.fn.mailcheck = function(e) {
var t = this;
if (e.suggested) {
var n = e.suggested;
e.suggested = function(e) {
n(t, e)
}
}
if (e.empty) {
var a = e.empty;
e.empty = function() {
a.call(null, t)
}
}
e.email = this.val(),
r.run(e)
}
)
},
27418: function(e) {
"use strict";
function t(e) {
if (null == e)
throw new TypeError("Object.assign cannot be called with null or undefined");
return Object(e)
}
var n = Object.getOwnPropertySymbols
, r = Object.prototype.hasOwnProperty
, a = Object.prototype.propertyIsEnumerable;
e.exports = function() {
try {
if (!Object.assign)
return !1;
var e = new String("abc");
if (e[5] = "de",
"5" === Object.getOwnPropertyNames(e)[0])
return !1;
for (var t = {}, n = 0; n < 10; n++)
t["_" + String.fromCharCode(n)] = n;
if ("0123456789" !== Object.getOwnPropertyNames(t).map((function(e) {
return t[e]
}
)).join(""))
return !1;
var r = {};
return "abcdefghijklmnopqrst".split("").forEach((function(e) {
r[e] = e
}
)),
"abcdefghijklmnopqrst" === Object.keys(Object.assign({}, r)).join("")
} catch (e) {
return !1
}
}() ? Object.assign : function(e) {
for (var i, o, s = t(e), u = 1; u < arguments.length; u++) {
for (var l in i = Object(arguments[u]))
r.call(i, l) && (s[l] = i[l]);
if (n) {
o = n(i);
for (var c = 0; c < o.length; c++)
a.call(i, o[c]) && (s[o[c]] = i[o[c]])
}
}
return s
}
},
72408: function(e, t, n) {
"use strict";
function r(e) {
for (var t = "https://reactjs.org/docs/error-decoder.html?invariant=" + e, n = 1; n < arguments.length; n++)
t += "&args[]=" + encodeURIComponent(arguments[n]);
return "Minified React error #" + e + "; visit " + t + " for the full message or use the non-minified dev environment for full errors and additional helpful warnings."
}
function a(e, t, n) {
this.props = e,
this.context = t,
this.refs = T,
this.updater = n || w
}
function i() {}
function o(e, t, n) {
this.props = e,
this.context = t,
this.refs = T,
this.updater = n || w
}
function s(e, t, n) {
var r, a = {}, i = null, o = null;
if (null != t)
for (r in void 0 !== t.ref && (o = t.ref),
void 0 !== t.key && (i = "" + t.key),
t)
D.call(t, r) && !U.hasOwnProperty(r) && (a[r] = t[r]);
var s = arguments.length - 2;
if (1 === s)
a.children = n;
else if (1 < s) {
for (var u = Array(s), l = 0; l < s; l++)
u[l] = arguments[l + 2];
a.children = u
}
if (e && e.defaultProps)
for (r in s = e.defaultProps)
void 0 === a[r] && (a[r] = s[r]);
return {
$$typeof: b,
type: e,
key: i,
ref: o,
props: a,
_owner: L.current
}
}
function u(e) {
return "object" == typeof e && null !== e && e.$$typeof === b
}
function l(e, t, n, r) {
if (B.length) {
var a = B.pop();
return a.result = e,
a.keyPrefix = t,
a.func = n,
a.context = r,
a.count = 0,
a
}
return {
result: e,
keyPrefix: t,
func: n,
context: r,
count: 0
}
}
function c(e) {
e.result = null,
e.keyPrefix = null,
e.func = null,
e.context = null,
e.count = 0,
10 > B.length && B.push(e)
}
function d(e, t, n, a) {
var i = typeof e;
"undefined" !== i && "boolean" !== i || (e = null);
var o = !1;
if (null === e)
o = !0;
else
switch (i) {
case "string":
case "number":
o = !0;
break;
case "object":
switch (e.$$typeof) {
case b:
case S:
o = !0
}
}
if (o)
return n(a, e, "" === t ? "." + m(e, 0) : t),
1;
if (o = 0,
t = "" === t ? "." : t + ":",
Array.isArray(e))
for (var s = 0; s < e.length; s++) {
var u = t + m(i = e[s], s);
o += d(i, u, n, a)
}
else if (null === e || "object" != typeof e ? u = null : u = "function" == typeof (u = N && e[N] || e["@@iterator"]) ? u : null,
"function" == typeof u)
for (e = u.call(e),
s = 0; !(i = e.next()).done; )
o += d(i = i.value, u = t + m(i, s++), n, a);
else if ("object" === i)
throw n = "" + e,
Error(r(31, "[object Object]" === n ? "object with keys {" + Object.keys(e).join(", ") + "}" : n, ""));
return o
}
function p(e, t, n) {
return null == e ? 0 : d(e, "", t, n)
}
function m(e, t) {
return "object" == typeof e && null !== e && null != e.key ? function(e) {
var t = {
"=": "=0",
":": "=2"
};
return "$" + ("" + e).replace(/[=:]/g, (function(e) {
return t[e]
}
))
}(e.key) : t.toString(36)
}
function f(e, t) {
e.func.call(e.context, t, e.count++)
}
function h(e, t, n) {
var r = e.result
, a = e.keyPrefix;
e = e.func.call(e.context, t, e.count++),
Array.isArray(e) ? _(e, r, n, (function(e) {
return e
}
)) : null != e && (u(e) && (e = function(e, t) {
return {
$$typeof: b,
type: e.type,
key: t,
ref: e.ref,
props: e.props,
_owner: e._owner
}
}(e, a + (!e.key || t && t.key === e.key ? "" : ("" + e.key).replace(j, "$&/") + "/") + n)),
r.push(e))
}
function _(e, t, n, r, a) {
var i = "";
null != n && (i = ("" + n).replace(j, "$&/") + "/"),
p(e, h, t = l(t, i, r, a)),
c(t)
}
function y() {
var e = R.current;
if (null === e)
throw Error(r(321));
return e
}
var v = n(27418)
, g = "function" == typeof Symbol && Symbol.for
, b = g ? Symbol.for("react.element") : 60103
, S = g ? Symbol.for("react.portal") : 60106
, k = g ? Symbol.for("react.fragment") : 60107
, C = g ? Symbol.for("react.strict_mode") : 60108
, E = g ? Symbol.for("react.profiler") : 60114
, Z = g ? Symbol.for("react.provider") : 60109
, A = g ? Symbol.for("react.context") : 60110
, M = g ? Symbol.for("react.forward_ref") : 60112
, P = g ? Symbol.for("react.suspense") : 60113;
g && Symbol.for("react.suspense_list");
var x = g ? Symbol.for("react.memo") : 60115
, I = g ? Symbol.for("react.lazy") : 60116;
g && Symbol.for("react.fundamental"),
g && Symbol.for("react.responder"),
g && Symbol.for("react.scope");
var N = "function" == typeof Symbol && Symbol.iterator
, w = {
isMounted: function() {
return !1
},
enqueueForceUpdate: function() {},
enqueueReplaceState: function() {},
enqueueSetState: function() {}
}
, T = {};
a.prototype.isReactComponent = {},
a.prototype.setState = function(e, t) {
if ("object" != typeof e && "function" != typeof e && null != e)
throw Error(r(85));
this.updater.enqueueSetState(this, e, t, "setState")
}
,
a.prototype.forceUpdate = function(e) {
this.updater.enqueueForceUpdate(this, e, "forceUpdate")
}
,
i.prototype = a.prototype;
var O = o.prototype = new i;
O.constructor = o,
v(O, a.prototype),
O.isPureReactComponent = !0;
var R = {
current: null
}
, L = {
current: null
}
, D = Object.prototype.hasOwnProperty
, U = {
key: !0,
ref: !0,
__self: !0,
__source: !0
}
, j = /\/+/g
, B = []
, F = {
Children: {
map: function(e, t, n) {
if (null == e)
return e;
var r = [];
return _(e, r, null, t, n),
r
},
forEach: function(e, t, n) {
if (null == e)
return e;
p(e, f, t = l(null, null, t, n)),
c(t)
},
count: function(e) {
return p(e, (function() {
return null
}
), null)
},
toArray: function(e) {
var t = [];
return _(e, t, null, (function(e) {
return e
}
)),
t
},
only: function(e) {
if (!u(e))
throw Error(r(143));
return e
}
},
createRef: function() {
return {
current: null
}
},
Component: a,
PureComponent: o,
createContext: function(e, t) {
return void 0 === t && (t = null),
(e = {
$$typeof: A,
_calculateChangedBits: t,
_currentValue: e,
_currentValue2: e,
_threadCount: 0,
Provider: null,
Consumer: null
}).Provider = {
$$typeof: Z,
_context: e
},
e.Consumer = e
},
forwardRef: function(e) {
return {
$$typeof: M,
render: e
}
},
lazy: function(e) {
return {
$$typeof: I,
_ctor: e,
_status: -1,
_result: null
}
},
memo: function(e, t) {
return {
$$typeof: x,
type: e,
compare: void 0 === t ? null : t
}
},
useCallback: function(e, t) {
return y().useCallback(e, t)
},
useContext: function(e, t) {
return y().useContext(e, t)
},
useEffect: function(e, t) {
return y().useEffect(e, t)
},
useImperativeHandle: function(e, t, n) {
return y().useImperativeHandle(e, t, n)
},
useDebugValue: function() {},
useLayoutEffect: function(e, t) {
return y().useLayoutEffect(e, t)
},
useMemo: function(e, t) {
return y().useMemo(e, t)
},
useReducer: function(e, t, n) {
return y().useReducer(e, t, n)
},
useRef: function(e) {
return y().useRef(e)
},
useState: function(e) {
return y().useState(e)
},
Fragment: k,
Profiler: E,
StrictMode: C,
Suspense: P,
createElement: s,
cloneElement: function(e, t, n) {
if (null == e)
throw Error(r(267, e));
var a = v({}, e.props)
, i = e.key
, o = e.ref
, s = e._owner;
if (null != t) {
if (void 0 !== t.ref && (o = t.ref,
s = L.current),
void 0 !== t.key && (i = "" + t.key),
e.type && e.type.defaultProps)
var u = e.type.defaultProps;
for (l in t)
D.call(t, l) && !U.hasOwnProperty(l) && (a[l] = void 0 === t[l] && void 0 !== u ? u[l] : t[l])
}
var l = arguments.length - 2;
if (1 === l)
a.children = n;
else if (1 < l) {
u = Array(l);
for (var c = 0; c < l; c++)
u[c] = arguments[c + 2];
a.children = u
}
return {
$$typeof: b,
type: e.type,
key: i,
ref: o,
props: a,
_owner: s
}
},
createFactory: function(e) {
var t = s.bind(null, e);
return t.type = e,
t
},
isValidElement: u,
version: "16.12.0",
__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: {
ReactCurrentDispatcher: R,
ReactCurrentBatchConfig: {
suspense: null
},
ReactCurrentOwner: L,
IsSomeRendererActing: {
current: !1
},
assign: v
}
}
, G = {
default: F
}
, q = G && F || G;
e.exports = q.default || q
},
67294: function(e, t, n) {
"use strict";
e.exports = n(72408)
},
47499: function(e, t, n) {
"use strict";
function r(e, t) {
if ("function" != typeof t && null !== t)
throw new TypeError("Super expression must either be null or a function");
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
writable: !0,
configurable: !0
}
}),
Object.defineProperty(e, "prototype", {
writable: !1
}),
t && a(e, t)
}
function a(e, t) {
return (a = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {
return e.__proto__ = t,
e
}
)(e, t)
}
function i(e) {
var t = function() {
if ("undefined" == typeof Reflect || !Reflect.construct)
return !1;
if (Reflect.construct.sham)
return !1;
if ("function" == typeof Proxy)
return !0;
try {
return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function() {}
))),
!0
} catch (e) {
return !1
}
}();
return function() {
var n, r = s(e);
if (t) {
var a = s(this).constructor;
n = Reflect.construct(r, arguments, a)
} else
n = r.apply(this, arguments);
return o(this, n)
}
}
function o(e, t) {
if (t && ("object" === y(t) || "function" == typeof t))
return t;
if (void 0 !== t)
throw new TypeError("Derived constructors may only return object or undefined");
return function(e) {
if (void 0 === e)
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return e
}(e)
}
function s(e) {
return (s = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
return e.__proto__ || Object.getPrototypeOf(e)
}
)(e)
}
function u(e, t) {
var n = "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
if (!n) {
if (Array.isArray(e) || (n = h(e)) || t && e && "number" == typeof e.length) {
n && (e = n);
var r = 0
, a = function() {};
return {
s: a,
n: function() {
return r >= e.length ? {
done: !0
} : {
done: !1,
value: e[r++]
}
},
e: function(e) {
throw e
},
f: a
}
}
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")
}
var i, o = !0, s = !1;
return {
s: function() {
n = n.call(e)
},
n: function() {
var e = n.next();
return o = e.done,
e
},
e: function(e) {
s = !0,
i = e
},
f: function() {
try {
o || null == n.return || n.return()
} finally {
if (s)
throw i
}
}
}
}
function l() {
function e(e, t, n) {
return Object.defineProperty(e, t, {
value: n,
enumerable: !0,
configurable: !0,
writable: !0
}),
e[t]
}
function t(e, t, n, a) {
var i = t && t.prototype instanceof r ? t : r
, o = Object.create(i.prototype)
, s = new m(a || []);
return b(o, "_invoke", {
value: u(e, n, s)
}),
o
}
function n(e, t, n) {
try {
return {
type: "normal",
arg: e.call(t, n)
}
} catch (e) {
return {
type: "throw",
arg: e
}
}
}
function r() {}
function a() {}
function i() {}
function o(t) {
["next", "throw", "return"].forEach((function(n) {
e(t, n, (function(e) {
return this._invoke(n, e)
}
))
}
))
}
function s(e, t) {
var r;
b(this, "_invoke", {
value: function(a, i) {
function o() {
return new t((function(r, o) {
!function r(a, i, o, s) {
var u = n(e[a], e, i);
if ("throw" !== u.type) {
var l = u.arg
, c = l.value;
return c && "object" == y(c) && g.call(c, "__await") ? t.resolve(c.__await).then((function(e) {
r("next", e, o, s)
}
), (function(e) {
r("throw", e, o, s)
}
)) : t.resolve(c).then((function(e) {
l.value = e,
o(l)
}
), (function(e) {
return r("throw", e, o, s)
}
))
}
s(u.arg)
}(a, i, r, o)
}
))
}
return r = r ? r.then(o, o) : o()
}
})
}
function u(e, t, r) {
var a = "suspendedStart";
return function(i, o) {
if ("executing" === a)
throw new Error("Generator is already running");
if ("completed" === a) {
if ("throw" === i)
throw o;
return {
value: void 0,
done: !0
}
}
for (r.method = i,
r.arg = o; ; ) {
var s = r.delegate;
if (s) {
var u = c(s, r);
if (u) {
if (u === A)
continue;
return u
}
}
if ("next" === r.method)
r.sent = r._sent = r.arg;
else if ("throw" === r.method) {
if ("suspendedStart" === a)
throw a = "completed",
r.arg;
r.dispatchException(r.arg)
} else
"return" === r.method && r.abrupt("return", r.arg);
a = "executing";
var l = n(e, t, r);
if ("normal" === l.type) {
if (a = r.done ? "completed" : "suspendedYield",
l.arg === A)
continue;
return {
value: l.arg,
done: r.done
}
}
"throw" === l.type && (a = "completed",
r.method = "throw",
r.arg = l.arg)
}
}
}
function c(e, t) {
var r = t.method
, a = e.iterator[r];
if (void 0 === a)
return t.delegate = null,
"throw" === r && e.iterator.return && (t.method = "return",
t.arg = void 0,
c(e, t),
"throw" === t.method) || "return" !== r && (t.method = "throw",
t.arg = new TypeError("The iterator does not provide a '" + r + "' method")),
A;
var i = n(a, e.iterator, t.arg);
if ("throw" === i.type)
return t.method = "throw",
t.arg = i.arg,
t.delegate = null,
A;
var o = i.arg;
return o ? o.done ? (t[e.resultName] = o.value,
t.next = e.nextLoc,
"return" !== t.method && (t.method = "next",
t.arg = void 0),
t.delegate = null,
A) : o : (t.method = "throw",
t.arg = new TypeError("iterator result is not an object"),
t.delegate = null,
A)
}
function d(e) {
var t = {
tryLoc: e[0]
};
1 in e && (t.catchLoc = e[1]),
2 in e && (t.finallyLoc = e[2],
t.afterLoc = e[3]),
this.tryEntries.push(t)
}
function p(e) {
var t = e.completion || {};
t.type = "normal",
delete t.arg,
e.completion = t
}
function m(e) {
this.tryEntries = [{
tryLoc: "root"
}],
e.forEach(d, this),
this.reset(!0)
}
function f(e) {
if (e) {
var t = e[k];
if (t)
return t.call(e);
if ("function" == typeof e.next)
return e;
if (!isNaN(e.length)) {
var n = -1
, r = function t() {
for (; ++n < e.length; )
if (g.call(e, n))
return t.value = e[n],
t.done = !1,
t;
return t.value = void 0,
t.done = !0,
t
};
return r.next = r
}
}
return {
next: h
}
}
function h() {
return {
value: void 0,
done: !0
}
}
l = function() {
return _
}
;
var _ = {}
, v = Object.prototype
, g = v.hasOwnProperty
, b = Object.defineProperty || function(e, t, n) {
e[t] = n.value
}
, S = "function" == typeof Symbol ? Symbol : {}
, k = S.iterator || "@@iterator"
, C = S.asyncIterator || "@@asyncIterator"
, E = S.toStringTag || "@@toStringTag";
try {
e({}, "")
} catch (_) {
e = function(e, t, n) {
return e[t] = n
}
}
_.wrap = t;
var A = {}
, M = {};
e(M, k, (function() {
return this
}
));
var P = Object.getPrototypeOf
, x = P && P(P(f([])));
x && x !== v && g.call(x, k) && (M = x);
var I = i.prototype = r.prototype = Object.create(M);
return a.prototype = i,
b(I, "constructor", {
value: i,
configurable: !0
}),
b(i, "constructor", {
value: a,
configurable: !0
}),
a.displayName = e(i, E, "GeneratorFunction"),
_.isGeneratorFunction = function(e) {
var t = "function" == typeof e && e.constructor;
return !!t && (t === a || "GeneratorFunction" === (t.displayName || t.name))
}
,
_.mark = function(t) {
return Object.setPrototypeOf ? Object.setPrototypeOf(t, i) : (t.__proto__ = i,
e(t, E, "GeneratorFunction")),
t.prototype = Object.create(I),
t
}
,
_.awrap = function(e) {
return {
__await: e
}
}
,
o(s.prototype),
e(s.prototype, C, (function() {
return this
}
)),
_.AsyncIterator = s,
_.async = function(e, n, r, a, i) {
void 0 === i && (i = Z);
var o = new s(t(e, n, r, a),i);
return _.isGeneratorFunction(n) ? o : o.next().then((function(e) {
return e.done ? e.value : o.next()
}
))
}
,
o(I),
e(I, E, "Generator"),
e(I, k, (function() {
return this
}
)),
e(I, "toString", (function() {
return "[object Generator]"
}
)),
_.keys = function(e) {
var t = Object(e)
, n = [];
for (var r in t)
n.push(r);
return n.reverse(),
function e() {
for (; n.length; ) {
var r = n.pop();
if (r in t)
return e.value = r,
e.done = !1,
e
}
return e.done = !0,
e
}
}
,
_.values = f,
m.prototype = {
constructor: m,
reset: function(e) {
if (this.prev = 0,
this.next = 0,
this.sent = this._sent = void 0,
this.done = !1,
this.delegate = null,
this.method = "next",
this.arg = void 0,
this.tryEntries.forEach(p),
!e)
for (var t in this)
"t" === t.charAt(0) && g.call(this, t) && !isNaN(+t.slice(1)) && (this[t] = void 0)
},
stop: function() {
this.done = !0;
var e = this.tryEntries[0].completion;
if ("throw" === e.type)
throw e.arg;
return this.rval
},
dispatchException: function(e) {
function t(t, r) {
return i.type = "throw",
i.arg = e,
n.next = t,
r && (n.method = "next",
n.arg = void 0),
!!r
}
if (this.done)
throw e;
for (var n = this, r = this.tryEntries.length - 1; r >= 0; --r) {
var a = this.tryEntries[r]
, i = a.completion;
if ("root" === a.tryLoc)
return t("end");
if (a.tryLoc <= this.prev) {
var o = g.call(a, "catchLoc")
, s = g.call(a, "finallyLoc");
if (o && s) {
if (this.prev < a.catchLoc)
return t(a.catchLoc, !0);
if (this.prev < a.finallyLoc)
return t(a.finallyLoc)
} else if (o) {
if (this.prev < a.catchLoc)
return t(a.catchLoc, !0)
} else {
if (!s)
throw new Error("try statement without catch or finally");
if (this.prev < a.finallyLoc)
return t(a.finallyLoc)
}
}
}
},
abrupt: function(e, t) {
for (var n = this.tryEntries.length - 1; n >= 0; --n) {
var r = this.tryEntries[n];
if (r.tryLoc <= this.prev && g.call(r, "finallyLoc") && this.prev < r.finallyLoc) {
var a = r;
break
}
}
a && ("break" === e || "continue" === e) && a.tryLoc <= t && t <= a.finallyLoc && (a = null);
var i = a ? a.completion : {};
return i.type = e,
i.arg = t,
a ? (this.method = "next",
this.next = a.finallyLoc,
A) : this.complete(i)
},
complete: function(e, t) {
if ("throw" === e.type)
throw e.arg;
return "break" === e.type || "continue" === e.type ? this.next = e.arg : "return" === e.type ? (this.rval = this.arg = e.arg,
this.method = "return",
this.next = "end") : "normal" === e.type && t && (this.next = t),
A
},
finish: function(e) {
for (var t = this.tryEntries.length - 1; t >= 0; --t) {
var n = this.tryEntries[t];
if (n.finallyLoc === e)
return this.complete(n.completion, n.afterLoc),
p(n),
A
}
},
catch: function(e) {
for (var t = this.tryEntries.length - 1; t >= 0; --t) {
var n = this.tryEntries[t];
if (n.tryLoc === e) {
var r = n.completion;
if ("throw" === r.type) {
var a = r.arg;
p(n)
}
return a
}
}
throw new Error("illegal catch attempt")
},
delegateYield: function(e, t, n) {
return this.delegate = {
iterator: f(e),
resultName: t,
nextLoc: n
},
"next" === this.method && (this.arg = void 0),
A
}
},
_
}
function c(e) {
return function(e) {
if (Array.isArray(e))
return _(e)
}(e) || function(e) {
if ("undefined" != typeof Symbol && null != e[Symbol.iterator] || null != e["@@iterator"])
return Array.from(e)
}(e) || h(e) || function() {
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")
}()
}
function d(e, t) {
if (!(e instanceof t))
throw new TypeError("Cannot call a class as a function")
}
function p(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1,
r.configurable = !0,
"value"in r && (r.writable = !0),
Object.defineProperty(e, (void 0,
a = function(e, t) {
if ("object" !== y(e) || null === e)
return e;
var n = e[Symbol.toPrimitive];
if (void 0 !== n) {
var r = n.call(e, t);
if ("object" !== y(r))
return r;
throw new TypeError("@@toPrimitive must return a primitive value.")
}
return String(e)
}(r.key, "string"),
"symbol" === y(a) ? a : String(a)), r)
}
var a
}
function m(e, t, n) {
return t && p(e.prototype, t),
n && p(e, n),
Object.defineProperty(e, "prototype", {
writable: !1
}),
e
}
function f(e, t) {
return function(e) {
if (Array.isArray(e))
return e
}(e) || function(e, t) {
var n = null == e ? null : "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
if (null != n) {
var r, a, i, o, s = [], u = !0, l = !1;
try {
if (i = (n = n.call(e)).next,
0 === t) {
if (Object(n) !== n)
return;
u = !1
} else
for (; !(u = (r = i.call(n)).done) && (s.push(r.value),
s.length !== t); u = !0)
;
} catch (e) {
l = !0,
a = e
} finally {
try {
if (!u && null != n.return && (o = n.return(),
Object(o) !== o))
return
} finally {
if (l)
throw a
}
}
return s
}
}(e, t) || h(e, t) || function() {
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")
}()
}
function h(e, t) {
if (e) {
if ("string" == typeof e)
return _(e, t);
var n = Object.prototype.toString.call(e).slice(8, -1);
return "Object" === n && e.constructor && (n = e.constructor.name),
"Map" === n || "Set" === n ? Array.from(e) : "Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? _(e, t) : void 0
}
}
function _(e, t) {
(null == t || t > e.length) && (t = e.length);
for (var n = 0, r = new Array(t); n < t; n++)
r[n] = e[n];
return r
}
function y(e) {
return (y = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
return typeof e
}
: function(e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
}
)(e)
}
function v(e, t, n, r) {
return new (n || (n = Z))((function(a, i) {
function o(e) {
try {
u(r.next(e))
} catch (e) {
i(e)
}
}
function s(e) {
try {
u(r.throw(e))
} catch (e) {
i(e)
}
}
function u(e) {
var t;
e.done ? a(e.value) : (t = e.value,
t instanceof n ? t : new n((function(e) {
e(t)
}
))).then(o, s)
}
u((r = r.apply(e, t || [])).next())
}
))
}
function g(e) {
if (!P)
return !1;
var t;
try {
t = window[e];
var n = "__storage_test__";
return t.setItem(n, n),
t.removeItem(n),
!0
} catch (e) {
return !(!(e instanceof DOMException) || 22 !== e.code && 1014 !== e.code && "QuotaExceededError" !== e.name && "NS_ERROR_DOM_QUOTA_REACHED" !== e.name || !t || 0 === t.length)
}
}
function b(e) {
return "string" == typeof e && !!e.trim()
}
function S(e, t) {
var n = e.split(";").filter(b)
, r = n.shift().split("=")
, a = r.shift()
, i = r.join("=");
t = t ? (0,
E.Z)({}, Y, t) : Y;
try {
i = t.decodeValues ? decodeURIComponent(i) : i
} catch (e) {
console.error("set-cookie-parser encountered an error while decoding a cookie with value '" + i + "'. Set options.decodeValues to false to disable this feature.", e)
}
var o = {
name: a,
value: i
};
return n.forEach((function(e) {
var t = e.split("=")
, n = t.shift().trimLeft().toLowerCase()
, r = t.join("=");
"expires" === n ? o.expires = new Date(r) : "max-age" === n ? o.maxAge = parseInt(r, 10) : "secure" === n ? o.secure = !0 : "httponly" === n ? o.httpOnly = !0 : "samesite" === n ? o.sameSite = r : o[n] = r
}
)),
o
}
function k(e, t) {
if (t = t ? (0,
E.Z)({}, Y, t) : Y,
!e)
return t.map ? {} : [];
if (e.headers && e.headers["set-cookie"])
e = e.headers["set-cookie"];
else if (e.headers) {
var n = e.headers[Object.keys(e.headers).find((function(e) {
return "set-cookie" === e.toLowerCase()
}
))];
n || !e.headers.cookie || t.silent || console.warn("Warning: set-cookie-parser appears to have been called on a request object. It is designed to parse Set-Cookie headers from responses, not Cookie headers from requests. Set the option {silent: true} to suppress this warning."),
e = n
}
return Array.isArray(e) || (e = [e]),
(t = t ? (0,
E.Z)({}, Y, t) : Y).map ? e.filter(b).reduce((function(e, n) {
var r = S(n, t);
return e[r.name] = r,
e
}
), {}) : e.filter(b).map((function(e) {
return S(e, t)
}
))
}
n.r(t),
n.d(t, {
COOKIE_POLICY_URL: function() {
return me
},
COOKIE_SETTINGS_PAGE_URL: function() {
return pe
},
Categories: function() {
return A
},
Cookies: function() {
return $
},
ENFORCEMENT_MODE_URL: function() {
return fe
},
LocalStorage: function() {
return ie
},
PERMISSIONS_COOKIE_NAME: function() {
return L
},
Permissions: function() {
return j
},
SessionStorage: function() {
return de
}
});
var C, E = n(87462), Z = n(56274).Promise, A = {
authentication: {
necessary: !0
},
"fraud-prevention": {
necessary: !0
},
security: {
necessary: !0
},
functionality: {
necessary: !0
},
preferences: {
necessary: !1,
token: "p"
},
statistics: {
necessary: !1,
token: "s"
},
advertising: {
necessary: !1,
token: "a"
},
essential: {
necessary: !0
},
functional: {
necessary: !1,
token: "f"
}
}, M = function(e, t, n) {
return function(e) {
var t;
t = function() {
function e() {
for (var e = 0, t = {}; e < arguments.length; e++) {
var n = arguments[e];
for (var r in n)
t[r] = n[r]
}
return t
}
function t(e) {
return e.replace(/(%[0-9A-Z]{2})+/g, decodeURIComponent)
}
return function n(r) {
function a() {}
function i(t, n, i) {
if ("undefined" != typeof document) {
"number" == typeof (i = e({
path: "/"
}, a.defaults, i)).expires && (i.expires = new Date(1 * new Date + 864e5 * i.expires)),
i.expires = i.expires ? i.expires.toUTCString() : "";
try {
var o = JSON.stringify(n);
/^[\{\[]/.test(o) && (n = o)
} catch (e) {}
n = r.write ? r.write(n, t) : encodeURIComponent(String(n)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent),
t = encodeURIComponent(String(t)).replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent).replace(/[\(\)]/g, escape);
var s = "";
for (var u in i)
i[u] && (s += "; " + u,
!0 !== i[u] && (s += "=" + i[u].split(";")[0]));
return document.cookie = t + "=" + n + s
}
}
function o(e, n) {
if ("undefined" != typeof document) {
for (var a = {}, i = document.cookie ? document.cookie.split("; ") : [], o = 0; o < i.length; o++) {
var s = i[o].split("=")
, u = s.slice(1).join("=");
n || '"' !== u.charAt(0) || (u = u.slice(1, -1));
try {
var l = t(s[0]);
if (u = (r.read || r)(u, l) || t(u),
n)
try {
u = JSON.parse(u)
} catch (e) {}
if (a[l] = u,
e === l)
break
} catch (e) {}
}
return e ? a[e] : a
}
}
return a.set = i,
a.get = function(e) {
return o(e, !1)
}
,
a.getJSON = function(e) {
return o(e, !0)
}
,
a.remove = function(t, n) {
i(t, "", e(n, {
expires: -1
}))
}
,
a.defaults = {},
a.withConverter = n,
a
}((function() {}
))
}
,
e.exports = t()
}(n = {
path: void 0,
exports: {},
require: function(e, t) {
return function() {
throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")
}(null == t && n.path)
}
}, n.exports),
n.exports
}(), P = function() {
try {
return !!window
} catch (e) {
return !1
}
}() && "object" === ("undefined" == typeof window ? "undefined" : y(window)) && "object" === ("undefined" == typeof document ? "undefined" : y(document)) && 9 === document.nodeType, x = function(e, t) {
return !!t && (e === t || 0 !== t.length && "." === t[0] && (t === ".".concat(e) || e.length > t.length && e.endsWith(t)))
}, I = function(e) {
return !!(e.match(/(\.)?link.com?\//i) || e.match("mkt-mydev.dev.stripe.me") && e.match("host=link") || e.match("-mkt.tunnel.stripe.me") && e.match("host=link") || e.match(/mkt(\.qa)?\.corp\.stripe\.com/i) && e.match("host=link") || e.match("link_app-mydev.dev.stripe.me") || e.match("link_support_site-mydev.dev.stripe.com"))
}, N = P && (C = window.location.hostname,
["stripe.com", "stripe.dev", "stripe.global", "stripe.partners", "increment.com", "link.co", "link.com"].some((function(e) {
var t = "(^|.)".concat(e.replace(/\./g, "\\."), "$");
return new RegExp(t).test(C)
}
))), w = function(e) {
if (!N) {
for (var t, n = arguments.length, r = new Array(n > 1 ? n - 1 : 0), a = 1; a < n; a++)
r[a - 1] = arguments[a];
(t = console).warn.apply(t, [e].concat(r))
}
}, T = function(e) {
if (!N) {
for (var t, n = arguments.length, r = new Array(n > 1 ? n - 1 : 0), a = 1; a < n; a++)
r[a - 1] = arguments[a];
(t = console).error.apply(t, [e].concat(r))
}
}, O = function() {
var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : P ? window.location.href : "";
return I(e) ? e.match(/(\.)?link.co([^m]|\b)/i) ? "https://link.co" : "https://link.com" : "https://stripe.com"
}, R = function(e) {
var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : P ? window.location.href : ""
, n = O(t) + e;
if (!P || !window.URL || !window.URLSearchParams)
return n;
var r = new URL(t)
, a = new URL(n);
if (r.hostname.match(".dev.stripe.me") || r.hostname.match("-stripejs.tunnel.stripe.me")) {
var i, o = r.hostname.split(".", 1), s = f(o, 1), u = s[0];
if (u.split("--", 1)[0] !== u) {
var l = u.split("--", 1)
, c = f(l, 1);
i = c[0],
i += "-"
} else {
var d = u.split("-", 1)
, p = f(d, 1);
i = p[0]
}
return a.hostname = "".concat(i, "-mkt-mydev.dev.stripe.me"),
n.includes("link.co") && (a.search = new URLSearchParams({
$host: "link"
}).toString()),
a.toString()
}
return r.hostname.match(/(^|\.)qa\.stripe\.com$/) || r.hostname.match(/(^|\.)qa-dashboard\.stripe\.com$/) ? n.replace("stripe.com", "qa.stripe.com") : r.hostname.match(/(^|\.)preprod\.stripe\.com$/) || r.hostname.match(/(^|\.)preprod-dashboard\.stripe\.com$/) ? n.replace("stripe.com", "preprod.stripe.com") : r.hostname.match(/(^|\.)qa\.link\.co$/) ? n.replace("link.co", "qa.link.co") : r.hostname.match(/(^|\.)qa\.link\.com$/) ? n.replace("link.com", "qa.link.com") : r.hostname.match(/mkt(\.qa)?\.corp\.stripe\.com/i) || r.hostname.match("-mkt.tunnel.stripe.me") ? (a.hostname = r.hostname,
n.includes("link.co") && (a.search = new URLSearchParams({
$host: "link"
}).toString()),
a.toString()) : a.toString()
}, L = "cookie-perms", D = ["https://c.stripe.dev/cookie", "https://c.stripe.global/cookie", "https://c.stripe.partners/cookie", "https://c.increment.com/cookie"], U = Object.keys(A), j = function() {
function e(t, n, r) {
d(this, e),
this._version = t,
this._permissions = r,
this._timestamp = n
}
return m(e, [{
key: "version",
get: function() {
return this._version
}
}, {
key: "timestamp",
get: function() {
return this._timestamp
}
}, {
key: "get",
value: function(e) {
return this._permissions[e]
}
}, {
key: "getAll",
value: function() {
return (0,
E.Z)({}, this._permissions)
}
}, {
key: "toString",
value: function() {
var e = this
, t = U.reduce((function(t, n) {
var r = A[n];
return r && !r.necessary && e._permissions[n] ? [].concat(c(t), [r.token]) : t
}
), []).sort()
, n = Math.floor(this.timestamp.valueOf() / 1e3);
return "".concat(this._version, ":").concat(n, "|").concat(t.join(""))
}
}], [{
key: "deserialize",
value: function(t) {
var n = f(t.split(":", 2), 2)
, r = n[0]
, a = n[1].split("|")
, i = new Date(1e3 * Number(a[0]))
, o = a[1].split("");
return new e(r,i,U.reduce((function(e, t) {
var n = A[t];
return n.necessary ? e[t] = !0 : n.token && (e[t] = o.indexOf(n.token) >= 0),
e
}
), {}))
}
}, {
key: "get",
value: function() {
try {
var t = M.get("cookie-perms");
if (t)
return e.deserialize(t)
} catch (e) {}
return null
}
}, {
key: "set",
value: function(t) {
return v(this, void 0, void 0, l().mark((function n() {
var r, a, i = this;
return l().wrap((function(n) {
for (; ; )
switch (n.prev = n.next) {
case 0:
if (r = function(e) {
return v(i, void 0, void 0, l().mark((function n() {
return l().wrap((function(n) {
for (; ; )
switch (n.prev = n.next) {
case 0:
return n.prev = 0,
n.next = 3,
fetch(e, {
method: "post",
body: JSON.stringify(t),
credentials: "include",
headers: {
"Content-Type": "application/json",
"X-Requested-With": "cookies"
}
});
case 3:
return n.abrupt("return", n.sent);
case 6:
n.prev = 6,
n.t0 = n.catch(0),
n.t0 instanceof Error ? T(n.t0.message) : T("Unexpected error", n.t0);
case 9:
case "end":
return n.stop()
}
}
), n, null, [[0, 6]])
}
)))
}
,
a = R("/cookie-settings/update"),
!I(a)) {
n.next = 7;
break
}
return n.next = 5,
r(a);
case 5:
n.next = 9;
break;
case 7:
return n.next = 9,
Z.all([a].concat(D).map(r));
case 9:
return n.abrupt("return", e.get());
case 10:
case "end":
return n.stop()
}
}
), n)
}
)))
}
}, {
key: "allowAll",
value: function() {
return v(this, void 0, void 0, l().mark((function t() {
var n;
return l().wrap((function(t) {
for (; ; )
switch (t.prev = t.next) {
case 0:
return n = U.reduce((function(e, t) {
return A[t].necessary || (e[t] = !0),
e
}
), {}),
t.abrupt("return", e.set(n));
case 2:
case "end":
return t.stop()
}
}
), t)
}
)))
}
}, {
key: "rejectAll",
value: function() {
return v(this, void 0, void 0, l().mark((function t() {
var n;
return l().wrap((function(t) {
for (; ; )
switch (t.prev = t.next) {
case 0:
return n = U.reduce((function(e, t) {
return A[t].necessary || (e[t] = !1),
e
}
), {}),
t.abrupt("return", e.set(n));
case 2:
case "end":
return t.stop()
}
}
), t)
}
)))
}
}]),
e
}(), B = function() {
function e(t) {
d(this, e),
this._getPermissions = t,
this._callbacks = []
}
return m(e, [{
key: "addCallback",
value: function(e) {
this._callbacks.indexOf(e) >= 0 ? T("PermissionsWatcher.addCallback() was called for a function that was already registered with the PermissionsWatcher.") : (this._callbacks.push(e),
this._interval || this._pollForPermissionsChanges())
}
}, {
key: "removeCallback",
value: function(e) {
var t = this._callbacks.indexOf(e);
t < 0 ? T("PermissionsWatcher.removeCallback() was called for a function that wasn't registered with the PermissionsWatcher.") : (this._callbacks.splice(t, 1),
this._interval && 0 === this._callbacks.length && (clearInterval(this._interval),
this._interval = null))
}
}, {
key: "_pollForPermissionsChanges",
value: function() {
var e = this
, t = this._getPermissions();
this._interval = setInterval((function() {
var n = e._getPermissions();
if (null !== n) {
var r = null === t && null !== n
, a = t && n && t.timestamp !== n.timestamp;
(r || a) && e._callbacks.forEach((function(e) {
return e(n)
}
)),
t = n
}
}
), 100)
}
}]),
e
}(), F = null, G = function() {
function e(t) {
d(this, e),
this._watcher = new B((function() {
return j.get()
}
)),
t.enforcementMode && (this._enforcementModeValue = t.enforcementMode)
}
return m(e, [{
key: "getEnforcementMode",
value: function() {
return v(this, void 0, void 0, l().mark((function e() {
return l().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return e.abrupt("return", this.getEnforcementModeMaybeSync());
case 1:
case "end":
return e.stop()
}
}
), e, this)
}
)))
}
}, {
key: "getEnforcementModeMaybeSync",
value: function() {
var e = this;
if (!this._enforcementModeValue) {
var t = (F || (F = Z.race([v(void 0, void 0, void 0, l().mark((function e() {
var t, n, r, a;
return l().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return t = "restricted",
e.prev = 1,
e.next = 4,
fetch(R("/cookie-settings/enforcement-mode"));
case 4:
return n = e.sent,
e.next = 7,
n.json();
case 7:
r = e.sent,
"restricted" !== (a = r.mode) && "open" !== a && "functional" !== a || (t = a),
e.next = 14;
break;
case 12:
e.prev = 12,
e.t0 = e.catch(1);
case 14:
return e.abrupt("return", t);
case 15:
case "end":
return e.stop()
}
}
), e, null, [[1, 12]])
}
))), new Z((function(e) {
setTimeout((function() {
return e("restricted")
}
), 1e3)
}
))])),
F);
t.then((function(t) {
e._enforcementModeValue = t
}
)),
this._enforcementModeValue = t
}
return this._enforcementModeValue
}
}, {
key: "getPermissions",
value: function() {
return j.get()
}
}, {
key: "setPermissions",
value: function(e) {
return v(this, void 0, void 0, l().mark((function t() {
return l().wrap((function(t) {
for (; ; )
switch (t.prev = t.next) {
case 0:
return t.abrupt("return", j.set(e));
case 1:
case "end":
return t.stop()
}
}
), t)
}
)))
}
}, {
key: "allowAll",
value: function() {
return v(this, void 0, void 0, l().mark((function e() {
return l().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return e.abrupt("return", j.allowAll());
case 1:
case "end":
return e.stop()
}
}
), e)
}
)))
}
}, {
key: "rejectAll",
value: function() {
return v(this, void 0, void 0, l().mark((function e() {
return l().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return e.abrupt("return", j.rejectAll());
case 1:
case "end":
return e.stop()
}
}
), e)
}
)))
}
}, {
key: "isCategoryAllowed",
value: function(e) {
var t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1];
return v(this, void 0, void 0, l().mark((function n() {
return l().wrap((function(n) {
for (; ; )
switch (n.prev = n.next) {
case 0:
return n.abrupt("return", this.isCategoryAllowedMaybeSync(e, t));
case 1:
case "end":
return n.stop()
}
}
), n, this)
}
)))
}
}, {
key: "isCategoryAllowedMaybeSync",
value: function(e) {
var t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1]
, n = j.get();
if (A[e].necessary)
return !0;
if (!t && "advertising" === e && "undefined" != typeof navigator) {
var r = navigator;
if (null == r ? void 0 : r.globalPrivacyControl)
return !1
}
if (n)
return "1" === n.version && "functional" === e ? !!n.get("statistics") || !!n.get("preferences") : "2" !== n.version || "statistics" !== e && "preferences" !== e ? !!n.get(e) : !!n.get("functional");
var a = this.getEnforcementModeMaybeSync();
return "string" == typeof a ? "functional" === a ? "advertising" !== e : "restricted" !== a : a.then((function(t) {
return "functional" === t ? "advertising" !== e : "restricted" !== t
}
))
}
}, {
key: "areCategoriesAllowed",
value: function() {
for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
t[n] = arguments[n];
return v(this, void 0, void 0, l().mark((function e() {
var n, r, a;
return l().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
n = 0,
r = t;
case 1:
if (!(n < r.length)) {
e.next = 11;
break
}
return a = r[n],
e.next = 5,
this.isCategoryAllowed(a);
case 5:
if (e.sent) {
e.next = 8;
break
}
return e.abrupt("return", !1);
case 8:
n++,
e.next = 1;
break;
case 11:
return e.abrupt("return", !0);
case 12:
case "end":
return e.stop()
}
}
), e, this)
}
)))
}
}, {
key: "shouldShowBanner",
value: function() {
return v(this, void 0, void 0, l().mark((function e() {
var t;
return l().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
if (!this.getPermissions()) {
e.next = 3;
break
}
return e.abrupt("return", !1);
case 3:
return e.next = 5,
this.getEnforcementMode();
case 5:
return t = e.sent,
e.abrupt("return", "restricted" === t || "functional" === t);
case 7:
case "end":
return e.stop()
}
}
), e, this)
}
)))
}
}, {
key: "watchPermissions",
value: function(e) {
this._watcher.addCallback(e)
}
}, {
key: "unwatchPermissions",
value: function(e) {
this._watcher.removeCallback(e)
}
}]),
e
}(), q = function() {
function e(t, n) {
d(this, e),
this.name = t,
this.category = n.category,
this.lifetime = n.lifetime,
this.domains = n.domains,
this.secure = !(!1 === n.secure),
this.httpOnly = !(!1 === n.httpOnly),
this.sameSite = n.sameSite || "Lax",
this.name.indexOf("*") >= 0 ? (this.inexact = !0,
this._regexp = new RegExp(t.replace("*", ".+"))) : this.inexact = !1
}
return m(e, [{
key: "isMatch",
value: function(e) {
return this.name === e || this._regexp && this._regexp.test(e)
}
}, {
key: "resolveDomain",
value: function(e, t) {
if (!this.name.startsWith("__Host-")) {
var n = [];
this.domains && (n = this.domains.map((function(e) {
return t[e] || e
}
)));
var r = e;
if (!r && P && (r = document.location.host),
r && r.match("dev.stripe.me"))
return ".dev.stripe.me";
if (r && !n.some((function(e) {
return x(r, e)
}
)))
throw new Error("The ".concat(this.name, " cookie is not allowed to be set on the ").concat(r, " domain."));
return r || n[0]
}
}
}, {
key: "resolveExpiry",
value: function(e) {
if ("forever" !== this.lifetime) {
if ("session" !== this.lifetime) {
var t = this.lifetime || 0;
if (e) {
if (t < e)
throw new Error("The ".concat(this.name, " cookie has a maximum lifetime of ").concat(this.lifetime, " seconds."));
t = e
}
return new Date(Date.now() + 1e3 * t)
}
if (e)
throw new Error("The ".concat(this.name, " cookie cannot have a lifetime, because it is a session cookie."))
}
}
}]),
e
}(), K = {
__stripe_mid: {
category: "essential",
domains: [".checkout.stripe.com", ".link.co", ".link.com", "request"],
lifetime: 31536e3,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
__stripe_orig_props: {
category: "functional",
domains: [".stripe.com"],
lifetime: 31536e3,
secure: !0,
httpOnly: !0,
sameSite: "Lax"
},
__stripe_sid: {
category: "essential",
domains: [".checkout.stripe.com", ".link.co", ".link.com", "request"],
lifetime: 1800,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
_cfduid: {
category: "advertising",
domains: [".stripecdn.com", ".stripe.com", ".go.stripe.global"],
lifetime: 31536e3,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
_fbp: {
category: "advertising",
domains: [".facebook.com", ".stripe.com", ".stripe.events", ".go.stripe.global"],
lifetime: 7862400,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
_forum_session: {
category: "authentication",
domains: [".discuss.stripe.community"],
lifetime: "session",
secure: !0,
httpOnly: !0,
sameSite: "Lax"
},
_ga: {
category: "advertising",
domains: [".stripe.com", ".stripe.events", ".go.stripe.global"],
lifetime: 31536e3,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
"_ga*": {
category: "functional",
domains: [".stripe.com", ".stripe.events", ".go.stripe.global", ".link.co", ".link.com"],
lifetime: 5184e3,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
_gat: {
category: "functional",
domains: [".stripe.com", ".stripe.events", ".go.stripe.global"],
lifetime: 60,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
_gat_stripe_com: {
category: "functional",
domains: [".stripe.com", ".stripe.events", ".go.stripe.global"],
lifetime: 60,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
"_gat_UA-12675062-5": {
category: "functional",
domains: [".stripe.com"],
lifetime: 60,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
"_gat_UA-12675062-14": {
category: "functional",
domains: [".link.co", ".link.com"],
lifetime: 60,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
"_gac_gb_G-SEKFWD1C9J": {
category: "advertising",
domains: [".stripe.com", ".go.stripe.global"],
lifetime: 5184e3,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
_gcl_au: {
category: "advertising",
domains: [".stripe.com", ".go.stripe.global"],
lifetime: 7862400,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
_gid: {
category: "functional",
domains: [".stripe.com", ".go.stripe.global", ".link.co", ".link.com"],
lifetime: 86400,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
_GRECAPTCHA: {
category: "essential",
domains: [".stripe.com"],
lifetime: 15811200,
secure: !0,
httpOnly: !0,
sameSite: "Lax"
},
_guid: {
category: "advertising",
domains: [".stripe.com", ".linkedin.com", ".ads.linkedin.com", ".go.stripe.global"],
lifetime: 86400,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
_mkto_trk: {
category: "advertising",
domains: [".stripecdn.com", ".stripe.com", ".go.stripe.global"],
lifetime: 63072e3,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
_pxhd: {
category: "advertising",
domains: [".stripecdn.com", ".stripe.com", ".go.stripe.global"],
lifetime: 31536e3,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
_t: {
category: "authentication",
domains: [".discuss.stripe.community"],
lifetime: 5270400,
secure: !0,
httpOnly: !0,
sameSite: "Lax"
},
aam_uuid: {
category: "advertising",
domains: [".stripe.com", ".linkedin.com", ".ads.linkedin.com", ".go.stripe.global"],
lifetime: 2592e3,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
act_token: {
category: "essential",
domains: ["dashboard.stripe.com"],
lifetime: "session",
secure: !0,
httpOnly: !0,
sameSite: "Lax"
},
"allow-unsupported-browser": {
category: "functional",
domains: [".stripe.com"],
lifetime: "session",
secure: !0,
httpOnly: !0,
sameSite: "Lax"
},
"AMCV_*": {
category: "advertising",
domains: [".stripe.com", ".linkedin.com", ".ads.linkedin.com", ".go.stripe.global"],
lifetime: 31536e3,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
AnalyticsSyncHistory: {
category: "advertising",
domains: [".stripe.com", ".linkedin.com", ".ads.linkedin.com", ".go.stripe.global"],
lifetime: 2592e3,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
anonymous_overrides: {
category: "functional",
domains: [".stripe.com"],
lifetime: 1209600,
secure: !0,
httpOnly: !0,
sameSite: "Lax"
},
ark_in_cad_opt_out: {
category: "functional",
domains: [".stripe.com"],
lifetime: 604800,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
art_token: {
category: "essential",
domains: ["dashboard.stripe.com"],
lifetime: "session",
secure: !0,
httpOnly: !0,
sameSite: "Lax"
},
atlas_invite: {
category: "functional",
domains: [".stripe.com"],
lifetime: "session",
secure: !0,
httpOnly: !0,
sameSite: "Lax"
},
bcookie: {
category: "advertising",
domains: [".stripe.com", ".linkedin.com", ".ads.linkedin.com", ".go.stripe.global"],
lifetime: 63072e3,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
c_user: {
category: "advertising",
domains: [".clearbit.com", ".facebook.com", ".go.stripe.global", ".stripe.com", ".stripe.events"],
lifetime: 31536e3,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
cbt_token: {
category: "essential",
domains: ["dashboard.stripe.com", "connect.stripe.com"],
lifetime: "session",
secure: !0,
httpOnly: !0,
sameSite: "Lax"
},
eid: {
category: "functional",
domains: [".checkout.stripe.com"],
lifetime: 5270400,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
cid: {
category: "functional",
domains: [".stripe.com", ".link.com", ".link.co"],
lifetime: 7862400,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
"__Host-cliauth_token": {
category: "authentication",
domains: ["dashboard.stripe.com"],
lifetime: 180,
secure: !0,
httpOnly: !1,
sameSite: "Strict"
},
"color-scheme": {
category: "functional",
domains: [".stripe.com"],
lifetime: 15811200,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
connect_locale: {
category: "essential",
domains: [".connect.stripe.com", ".express.stripe.com"],
lifetime: "session",
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
"cookie-perms": {
category: "essential",
domains: [".stripe.com", ".stripe.dev", ".go.stripe.global", ".increment.com", ".link.co", ".link.com"],
lifetime: 15811200,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
country: {
category: "essential",
domains: [".stripe.com"],
lifetime: "session",
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
csv: {
category: "advertising",
domains: [".reddit.com", ".stripe.com", ".stripe.events", ".go.stripe.global"],
lifetime: 15811200,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
datr: {
category: "advertising",
domains: [".facebook.com", ".stripe.com", ".stripe.events", ".go.stripe.global"],
lifetime: 63072e3,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
disable_cmd_f_override: {
category: "functional",
domains: [".stripe.com"],
lifetime: 15811200,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
"docs.prefs": {
category: "functional",
domains: [".stripe.com"],
lifetime: 15811200,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
double_cmd_f_uses: {
category: "functional",
domains: [".stripe.com"],
lifetime: 15811200,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
dpr: {
category: "advertising",
domains: [".facebook.com", ".stripe.com", ".stripe.events", ".go.stripe.global"],
lifetime: 604800,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
edgebucket: {
category: "advertising",
domains: [".reddit.com", ".stripe.com", ".stripe.events", ".go.stripe.global"],
lifetime: 39484800,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
ev: {
category: "functional",
domains: [".stripe.com"],
lifetime: 5270400,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
"expanded-topics": {
category: "functional",
domains: [".stripe.com"],
lifetime: 15811200,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
fr: {
category: "advertising",
domains: [".facebook.com", ".stripe.com", ".stripe.events", ".go.stripe.global"],
lifetime: 7862400,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
gh_src: {
category: "functional",
domains: [".stripe.com"],
lifetime: 63072e3,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
GPS: {
category: "advertising",
domains: [".youtube.com"],
lifetime: 1800,
secure: !0,
httpOnly: !0,
sameSite: "Lax"
},
handoff: {
category: "essential",
domains: [".stripe.com"],
lifetime: 9e4,
secure: !0,
httpOnly: !0,
sameSite: "Lax"
},
has_intentionally_selected_curl: {
category: "functional",
domains: [".stripe.com"],
lifetime: 15811200,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
"__Host-has_recently_requested_netsuite_connector_*": {
category: "essential",
domains: ["marketplace.stripe.com"],
lifetime: 604800,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
"__Host-has_recently_requested_salesforce_cpq_connector_*": {
category: "essential",
domains: ["marketplace.stripe.com"],
lifetime: 604800,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
"__Host-has_recently_requested_sap_connector_*": {
category: "essential",
domains: ["marketplace.stripe.com"],
lifetime: 604800,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
IDE: {
category: "advertising",
domains: [".doubleclick.net"],
lifetime: 63072e3,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
invite: {
category: "functional",
domains: [".stripe.com"],
lifetime: 15811200,
secure: !0,
httpOnly: !0,
sameSite: "Lax"
},
lang: {
category: "functional",
domains: [".stripe.com"],
lifetime: 15811200,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
lc_token: {
category: "essential",
domains: ["dashboard.stripe.com"],
lifetime: "session",
secure: !0,
httpOnly: !0,
sameSite: "Lax"
},
_ldbrbid: {
category: "advertising",
domains: [".line.me", ".stripe.com", ".go.stripe.global"],
lifetime: 15811200,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
li_oatml: {
category: "advertising",
domains: [".stripe.com", ".linkedin.com", ".ads.linkedin.com", ".go.stripe.global"],
lifetime: 2592e3,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
li_sugr: {
category: "advertising",
domains: [".stripe.com", ".linkedin.com", ".ads.linkedin.com", ".go.stripe.global"],
lifetime: 7862400,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
liap: {
category: "advertising",
domains: [".stripe.com", ".linkedin.com", ".ads.linkedin.com", ".go.stripe.global"],
lifetime: 31536e3,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
lidc: {
category: "advertising",
domains: [".stripe.com", ".linkedin.com", ".ads.linkedin.com", ".go.stripe.global", ".stripe.events"],
lifetime: 86400,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
"__Host-LinkSession": {
category: "authentication",
domains: ["checkout-cookies.stripe.com", "checkout-cookies.link.com", "merchant-ui-api.stripe.com"],
lifetime: 31536e3,
secure: !0,
httpOnly: !0,
sameSite: "None"
},
"__Host-LinkSessionPresent": {
category: "essential",
domains: ["checkout-cookies.stripe.com", "checkout-cookies.link.com", "merchant-ui-api.stripe.com"],
lifetime: 31536e3,
secure: !0,
httpOnly: !1,
sameSite: "None"
},
lissc: {
category: "advertising",
domains: [".stripe.com", ".linkedin.com", ".ads.linkedin.com", ".go.stripe.global"],
lifetime: 15811200,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
locale: {
category: "essential",
domains: [".link.co", ".link.com", ".stripe.com"],
lifetime: "session",
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
loid: {
category: "advertising",
domains: [".reddit.com", ".stripe.com", ".stripe.events", ".go.stripe.global"],
lifetime: 15811200,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
m: {
category: "essential",
domains: [".m.stripe.com"],
lifetime: 63072e3,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
"m-tz": {
category: "advertising",
domains: [".stripe.com", ".go.stripe.global", ".stripe.events"],
lifetime: 31536e3,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
"m-ans_frontend_early_version": {
category: "advertising",
domains: [".stripe.com", ".go.stripe.global", ".stripe.events"],
lifetime: 63072e3,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
"m-s": {
category: "advertising",
domains: [".stripe.com", ".go.stripe.global", ".stripe.events"],
lifetime: 63072e3,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
"m-b_strict": {
category: "advertising",
domains: [".stripe.com", ".go.stripe.global", ".stripe.events"],
lifetime: 63072e3,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
"m-b_lax": {
category: "advertising",
domains: [".stripe.com", ".go.stripe.global", ".stripe.events"],
lifetime: 63072e3,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
"m-uid": {
category: "advertising",
domains: [".stripe.com", ".go.stripe.global", ".stripe.events"],
lifetime: 57888e3,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
"m-b": {
category: "advertising",
domains: [".stripe.com", ".go.stripe.global", ".stripe.events"],
lifetime: 63072e3,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
machine_identifier: {
category: "essential",
domains: [".stripe.com"],
lifetime: 31536e3,
secure: !0,
httpOnly: !0,
sameSite: "Lax"
},
merchant: {
category: "functional",
domains: [".stripe.com"],
lifetime: "session",
secure: !0,
httpOnly: !1,
sameSite: "None"
},
over18: {
category: "advertising",
domains: [".reddit.com", ".stripe.com", ".stripe.events", ".go.stripe.global"],
lifetime: 47347200,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
pay_sid: {
category: "authentication",
domains: [".link.co", ".link.com", ".link.corp.stripe.com", ".link.qa.corp.stripe.com", ".link-support-site.corp.stripe.com", ".link-support-site.qa.corp.stripe.com", ".link-support-site.preprod.corp.stripe.com"],
lifetime: 31536e3,
secure: !0,
httpOnly: !0,
sameSite: "Lax"
},
private_machine_identifier: {
category: "essential",
domains: [".stripe.com"],
lifetime: 31536e3,
secure: !0,
httpOnly: !0,
sameSite: "None"
},
prt_token: {
category: "essential",
domains: ["dashboard.stripe.com"],
lifetime: "session",
secure: !0,
httpOnly: !0,
sameSite: "Lax"
},
"recent-views": {
category: "functional",
domains: [".stripe.com"],
lifetime: 31536e3,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
recent_srs: {
category: "advertising",
domains: [".reddit.com", ".stripe.com", ".stripe.events", ".go.stripe.global"],
lifetime: 63072e3,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
"saml_sca_success_for_*": {
category: "authentication",
domains: ["dashboard.stripe.com"],
lifetime: 30,
secure: !0,
httpOnly: !0,
sameSite: "Lax"
},
samlit_email: {
category: "authentication",
domains: ["dashboard.stripe.com"],
lifetime: 960,
secure: !0,
httpOnly: !0,
sameSite: "Lax"
},
samlit_token: {
category: "authentication",
domains: ["dashboard.stripe.com"],
lifetime: 960,
secure: !0,
httpOnly: !0,
sameSite: "Lax"
},
sb: {
category: "advertising",
domains: [".facebook.com", ".stripe.com", ".stripe.events", ".go.stripe.global"],
lifetime: 63072e3,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
sca_migration_not_started_alert_actioned: {
category: "functional",
domains: [".stripe.com"],
lifetime: 604800,
secure: !0,
httpOnly: !0,
sameSite: "Lax"
},
scfc: {
category: "essential",
domains: [".stripe.com"],
lifetime: 31536e3,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
sdsc: {
category: "advertising",
domains: [".stripe.com", ".linkedin.com", ".ads.linkedin.com", ".go.stripe.global"],
lifetime: 31536e3,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
"__Host-sessions_on_demand_qualified": {
category: "essential",
domains: ["stripe.com"],
lifetime: "session",
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
session_tracker: {
category: "advertising",
domains: [".reddit.com", ".stripe.com", ".stripe.events", ".go.stripe.global"],
lifetime: "session",
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
"__Secure-sid": {
category: "functional",
domains: [".stripe.com", ".link.com"],
lifetime: 1800,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
token_v2: {
category: "advertising",
domains: [".reddit.com", ".stripe.com", ".stripe.events", ".go.stripe.global"],
lifetime: 63072e3,
secure: !0,
httpOnly: !0,
sameSite: "Lax"
},
"__Host-session": {
category: "essential",
domains: ["support.stripe.com", "support-conversations.stripe.com", "stripe.com", "dashboard.stripe.com", "connect.stripe.com", "express.stripe.com", "marketplace.stripe.com", "docs.stripe.com", "dashboard-admin.stripe.com", "site-admin.stripe.com", "support-admin.corp.stripe.com", "manage.stripe.com", "billing.stripe.com", "pay.stripe.com"],
lifetime: 7776e3,
secure: !0,
httpOnly: !0,
sameSite: "None"
},
"__Host-auth_token": {
category: "authentication",
domains: ["dashboard.stripe.com", "dashboard-admin.stripe.com", "docs.stripe.com"],
lifetime: 7776e3,
secure: !0,
httpOnly: !0,
sameSite: "Lax"
},
"__Host-stripe.link_app.csrf": {
category: "essential",
domains: ["app.link.co", "app.link.com", "link.corp.stripe.com", "link.qa.corp.stripe.com"],
lifetime: "session",
secure: !0,
httpOnly: !0,
sameSite: "Strict"
},
"__Host-shopify_app_session": {
category: "authentication",
domains: ["sbyog-ppp-external.stripe.com"],
lifetime: 86400,
secure: !0,
httpOnly: !0,
sameSite: "Lax"
},
site_sid: {
category: "functional",
domains: [".stripe.com"],
lifetime: 7200,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
"site-auth": {
category: "essential",
domains: [".stripe.com"],
lifetime: "session",
secure: !0,
httpOnly: !0,
sameSite: "Lax"
},
skip_mismatched_country_check: {
category: "functional",
domains: [".stripe.com"],
lifetime: "session",
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
skip_tfa_interrupt: {
category: "functional",
domains: [".stripe.com"],
lifetime: 2592e3,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
spin: {
category: "advertising",
domains: [".facebook.com", ".stripe.com", ".stripe.events", ".go.stripe.global"],
lifetime: 63072e3,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
spl: {
category: "advertising",
domains: [".stripe.events"],
lifetime: 31536e3,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
"stripe.csrf": {
category: "essential",
domains: [".stripe.com"],
lifetime: "session",
secure: !0,
httpOnly: !0,
sameSite: "None"
},
"stripe.appmarketplace.csrf": {
category: "essential",
domains: ["marketplace.stripe.com"],
lifetime: "session",
secure: !0,
httpOnly: !0,
sameSite: "Strict"
},
"stripe.climate.csrf": {
category: "essential",
domains: ["climate.stripe.com", "edge-climate.stripe.com"],
lifetime: "session",
secure: !0,
httpOnly: !0,
sameSite: "Strict"
},
"stripe.customerportal.csrf": {
category: "essential",
domains: ["billing.stripe.com"],
lifetime: "session",
secure: !0,
httpOnly: !0,
sameSite: "Strict"
},
"stripe.docs.csrf": {
category: "essential",
domains: ["docs.stripe.com", "docs.corp.stripe.com", "docs.qa.corp.stripe.com"],
lifetime: "session",
secure: !0,
httpOnly: !0,
sameSite: "Strict"
},
svt_token: {
category: "essential",
domains: ["dashboard.stripe.com", "connect.stripe.com"],
lifetime: "session",
secure: !0,
httpOnly: !0,
sameSite: "Lax"
},
tuuid: {
category: "advertising",
domains: [".demandbase.com", ".stripe.com"],
lifetime: 63072e3,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
tuuid_lu: {
category: "advertising",
domains: [".demandbase.com", ".stripe.com"],
lifetime: 63072e3,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
U: {
category: "advertising",
domains: [".adsymptotic.com", ".stripe.com", ".go.stripe.global"],
lifetime: 7862400,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
UserMatchHistory: {
category: "advertising",
domains: [".stripe.com", ".linkedin.com", ".ads.linkedin.com", ".go.stripe.global"],
lifetime: 2592e3,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
user: {
category: "functional",
domains: [".stripe.com"],
lifetime: "session",
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
VISITOR_INFO1_LIVE: {
category: "advertising",
domains: [".youtube.com"],
lifetime: 15811200,
secure: !0,
httpOnly: !0,
sameSite: "Lax"
},
wd: {
category: "advertising",
domains: [".facebook.com", ".stripe.com", ".stripe.events", ".go.stripe.global"],
lifetime: 604800,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
xs: {
category: "advertising",
domains: [".facebook.com", ".stripe.com", ".stripe.events", ".go.stripe.global"],
lifetime: 31536e3,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
XA: {
category: "advertising",
domains: [".yahoo.co.jp", ".go.stripe.global"],
lifetime: 31536e3,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
XB: {
category: "advertising",
domains: [".yahoo.co.jp", ".go.stripe.global"],
lifetime: 52617600,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
ndcd: {
category: "essential",
domains: [".acs.touch.tech", ".idcheck.acs.touchtechpayments.com", ".verifiedbyvisa.acs.touchtechpayments.com"],
lifetime: 31536e3,
secure: !0,
httpOnly: !0,
sameSite: "Lax"
},
YSC: {
category: "advertising",
domains: [".youtube.com"],
lifetime: "session",
secure: !0,
httpOnly: !0,
sameSite: "Lax"
},
"stripe.delegated-authentication.csrf": {
category: "essential",
domains: ["delegated-authentication.stripe.com", "oneclickauthn.qa.corp.stripe.com", "oneclickauthn.corp.stripe.com"],
lifetime: 1800,
secure: !0,
httpOnly: !0,
sameSite: "Strict"
},
payment_methods_settings_platform: {
category: "functional",
domains: [".stripe.com"],
lifetime: 15811200,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
VisitorId: {
category: "advertising",
domains: [".stripecdn.com", ".stripe.com", ".go.stripe.global"],
lifetime: 31536e3,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
"__Host-stripe.link_support_site.csrf": {
category: "essential",
domains: ["support.link.co", "support.link.com", "link-support-site.corp.stripe.com", "link-support-site.qa.corp.stripe.com"],
lifetime: "session",
secure: !0,
httpOnly: !0,
sameSite: "Strict"
},
"__Host-stripe.sources_redirect_site.csrf": {
category: "essential",
domains: ["hooks.stripe.com", "hooks.qa.corp.stripe.com"],
lifetime: "session",
secure: !0,
httpOnly: !0,
sameSite: "Strict"
},
saml_login_result: {
category: "essential",
domains: [".stripe.com"],
lifetime: "session",
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
"__Host-saml_auth_result": {
category: "essential",
domains: ["dashboard.stripe.com"],
lifetime: 60,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
"__Host-stripe.support_site.csrf": {
category: "essential",
domains: ["support.stripe.com"],
lifetime: "session",
secure: !0,
httpOnly: !0,
sameSite: "Strict"
},
"__Host-unauthenticated_support_identity": {
category: "authentication",
domains: ["support.stripe.com", "support.link.co", "support.link.com", "support-conversations.stripe.com", "edge-support-conversations.stripe.com", "support-conversations.link.co", "support-conversations.link.com"],
lifetime: "session",
secure: !0,
httpOnly: !0,
sameSite: "Strict"
},
"__Host-stripe.site.csrf": {
category: "essential",
domains: ["stripe.com"],
lifetime: "session",
secure: !0,
httpOnly: !0,
sameSite: "Strict"
},
"__Host-upsess": {
category: "authentication",
domains: ["privacy.stripe.com"],
lifetime: 1800,
secure: !0,
httpOnly: !0,
sameSite: "Strict"
},
"__Host-privacy-csat": {
category: "functional",
domains: ["privacy.stripe.com"],
lifetime: 2592e3,
secure: !0,
httpOnly: !1,
sameSite: "Strict"
},
"__Host-stripe.mkt.csrf": {
category: "essential",
domains: ["stripe.com", "press.stripe.com", "link.com", "site-admin.stripe.com", "edge.stripe.com", "edge-press.stripe.com"],
lifetime: "session",
secure: !0,
httpOnly: !0,
sameSite: "Strict"
},
"__Secure-webchat_qualification": {
category: "advertising",
domains: [".stripe.com"],
lifetime: 604800,
secure: !0,
httpOnly: !1,
sameSite: "Strict"
},
"__Secure-stripe-routing-context": {
category: "essential",
domains: [".stripe.com"],
lifetime: 86400,
secure: !0,
httpOnly: !0,
sameSite: "Strict"
},
"__Host-webchat_widget": {
category: "essential",
domains: ["sales-live-chat.stripe.com"],
lifetime: 604800,
secure: !0,
httpOnly: !1,
sameSite: "Strict"
},
"__Host-webchat_state": {
category: "essential",
domains: ["sales-live-chat.stripe.com"],
lifetime: 604800,
secure: !0,
httpOnly: !1,
sameSite: "Strict"
},
"__Host-webchat_survey": {
category: "essential",
domains: ["sales-live-chat.stripe.com"],
lifetime: 604800,
secure: !0,
httpOnly: !1,
sameSite: "Strict"
},
"__Secure-has_logged_in": {
category: "essential",
domains: [".stripe.com"],
lifetime: 15811200,
secure: !0,
httpOnly: !1,
sameSite: "Strict"
},
muc_ads: {
category: "advertising",
domains: [".t.co", ".stripe.com", ".go.stripe.global"],
lifetime: 63072e3,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
personalization_id: {
category: "advertising",
domains: [".twitter.com", ".stripe.com", ".go.stripe.global"],
lifetime: 63072e3,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
guest_id: {
category: "advertising",
domains: [".twitter.com", ".stripe.com", ".go.stripe.global"],
lifetime: 63072e3,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
guest_id_ads: {
category: "advertising",
domains: [".twitter.com", ".stripe.com", ".go.stripe.global"],
lifetime: 63072e3,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
guest_id_marketing: {
category: "advertising",
domains: [".twitter.com", ".stripe.com", ".go.stripe.global"],
lifetime: 63072e3,
secure: !0,
httpOnly: !1,
sameSite: "Lax"
},
"__Secure-last_login_method": {
category: "functional",
domains: ["dashboard.stripe.com"],
lifetime: 15811200,
secure: !0,
httpOnly: !1,
sameSite: "Strict"
},
"__Host-oauth_registration_token": {
category: "essential",
domains: ["dashboard.stripe.com"],
lifetime: 600,
secure: !0,
httpOnly: !1,
sameSite: "Strict"
}
}, V = {}, z = null, H = function(e) {
if (K[e])
return new q(e,K[e]);
if (V[e])
return new q(e,V[e]);
z || (z = [].concat(c(Object.entries(K)), c(Object.entries(V))).map((function(e) {
var t = f(e, 2)
, n = t[0]
, r = t[1];
return new q(n,r)
}
)).filter((function(e) {
return e.inexact
}
)));
var t, n = u(z);
try {
for (n.s(); !(t = n.n()).done; ) {
var r = t.value;
if (r.isMatch(e))
return r
}
} catch (e) {
n.e(e)
} finally {
n.f()
}
return null
}, Y = {
decodeValues: !0,
map: !1,
silent: !1
}, W = k, J = k, X = S;
W.parse = J,
W.parseString = X,
W.splitCookiesString = function(e) {
function t() {
for (; u < e.length && /\s/.test(e.charAt(u)); )
u += 1;
return u < e.length
}
if (Array.isArray(e))
return e;
if ("string" != typeof e)
return [];
for (var n, r, a, i, o, s = [], u = 0; u < e.length; ) {
for (n = u,
o = !1; t(); )
if ("," === (r = e.charAt(u))) {
for (a = u,
u += 1,
t(),
i = u; u < e.length && "=" !== (r = e.charAt(u)) && ";" !== r && "," !== r; )
u += 1;
u < e.length && "=" === e.charAt(u) ? (o = !0,
u = i,
s.push(e.substring(n, a)),
n = u) : u = a + 1
} else
u += 1;
(!o || u >= e.length) && s.push(e.substring(n, e.length))
}
return s
}
;
var Q = null
, $ = function() {
function e() {
var n, r = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
if (d(this, e),
(n = t.call(this, r))._domainOverrides = r.domainOverrides || {},
n._documentCookiePatched = !1,
"undefined" != typeof navigator) {
var a = navigator;
if (null == a ? void 0 : a.globalPrivacyControl)
for (var i = M.get(), o = 0, s = Object.keys(i); o < s.length; o++) {
var u = s[o]
, l = H(u);
"advertising" !== (null == l ? void 0 : l.category) || (null == l ? void 0 : l.httpOnly) || n.remove(u)
}
}
return n
}
r(e, G);
var t = i(e);
return m(e, [{
key: "get",
value: function(e) {
H(e) || w("No cookie matching the name ".concat(e, " was found in the cookies.yaml or cookies-next.yaml manifests. ") + "Reading the value of the cookie will work, but attempting to set the cookie will result in an error. If you're adding a new cookie, please visit go/cookies for more information!");
var t = M.get(e);
return void 0 === t ? null : t
}
}, {
key: "set",
value: function(e, t) {
var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {};
return v(this, void 0, void 0, l().mark((function r() {
var a, i, o, s, u;
return l().wrap((function(r) {
for (; ; )
switch (r.prev = r.next) {
case 0:
if (a = H(e)) {
r.next = 4;
break
}
return T("No cookie matching the name ".concat(e, " was found in the cookies.yaml or cookies-next.yaml manifests. ") + "If you're adding a new cookie, please visit go/cookies for more information!"),
r.abrupt("return", !1);
case 4:
if (!a.httpOnly) {
r.next = 7;
break
}
return T("Cannot set the cookie ".concat(e, " via JavaScript, since it is marked HttpOnly. ") + "Please visit go/cookies for more information!"),
r.abrupt("return", !1);
case 7:
r.prev = 7,
i = a.resolveDomain(n.domain, this._domainOverrides),
o = a.resolveExpiry(n.lifetime),
r.next = 16;
break;
case 12:
return r.prev = 12,
r.t0 = r.catch(7),
r.t0 instanceof Error ? T(r.t0.message) : T("Unexpected error", r.t0),
r.abrupt("return", !1);
case 16:
return r.next = 18,
this.isCategoryAllowed(a.category);
case 18:
if (r.sent) {
r.next = 21;
break
}
return r.abrupt("return", !1);
case 21:
return !P || a.name.startsWith("__Host-") || x(window.location.hostname, i) || w("The cookie ".concat(e, " will be set on the domain ").concat(i, ", which doesn't match ") + "the current domain (".concat(window.location.hostname, "). This will result in the ") + "cookie being silently ignored by the browser. Please check to ensure the domain(s) for the cookie are correct in cookies[-next].yaml, or visit go/cookies for more information."),
s = void 0 === n.secure ? a.secure : n.secure,
u = this._getCookieAttributes({
domain: i,
expires: o,
secure: s,
sameSite: a.sameSite
}),
a.name.startsWith("__Host-") && (u.path = "/"),
M.set(e, t, u),
r.abrupt("return", !0);
case 27:
case "end":
return r.stop()
}
}
), r, this, [[7, 12]])
}
)))
}
}, {
key: "remove",
value: function(e) {
var t, n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, r = H(e);
if (!r)
return T("No cookie matching the name ".concat(e, " was found in the cookies.yaml or cookies-next.yaml manifests. ") + "If you're adding a new cookie, please visit go/cookies for more information!"),
!1;
try {
t = r.resolveDomain(n.domain, this._domainOverrides)
} catch (e) {
return e instanceof Error ? T(e.message) : T("Unexpected error", e),
!1
}
P && !x(window.location.hostname, t) && w("The cookie ".concat(e, " will be set on the domain ").concat(t, ", which doesn't match ") + "the current domain (".concat(window.location.hostname, "). This will result in the ") + "cookie being silently ignored by the browser. Please check to ensure the domain(s) for the cookie are correct in cookies[-next].yaml, or visit go/cookies for more information.");
var a = this._getCookieAttributes({
domain: t,
secure: r.secure,
sameSite: r.sameSite
});
return M.remove(e, a),
!0
}
}, {
key: "refresh",
value: function() {
return v(this, void 0, void 0, l().mark((function e() {
var t = this;
return l().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
Object.keys(M.get()).forEach((function(e) {
var n = H(e);
if (n && M.get(e)) {
var r = t.isCategoryAllowedMaybeSync(n.category);
!1 === r && t.remove(e),
r instanceof Z && r.then((function(n) {
n || t.remove(e)
}
))
}
}
));
case 1:
case "end":
return e.stop()
}
}
), e)
}
)))
}
}, {
key: "trapDocumentCookie",
value: function() {
this._documentCookiePatched || (this._documentCookiePatched = function(e) {
if (!P)
return T("You cannot patch document.cookie if you aren't in a browser."),
!1;
if (Q || (Q = Object.getOwnPropertyDescriptor(Document.prototype, "cookie")),
!Q || !Q.get || !Q.set)
return !1;
var t = Q.get
, n = Q.set;
return Object.defineProperty(document, "cookie", {
configurable: !0,
get: function() {
for (var e = arguments.length, n = new Array(e), r = 0; r < e; r++)
n[r] = arguments[r];
return t.apply(this, n)
},
set: function(t) {
if (!t || 0 === t.length)
return n.apply(this, [t]);
var r = X(t)
, a = r.name
, i = r.value
, o = r.domain;
"true" === r.allowed ? n.apply(this, [t]) : e.set(a, i, {
domain: o
})
}
}),
!0
}(this))
}
}, {
key: "untrapDocumentCookie",
value: function() {
this._documentCookiePatched && (Q ? Object.defineProperty(document, "cookie", Q) : T("The document.cookie property has not been patched"),
this._documentCookiePatched = !1)
}
}, {
key: "_getCookieAttributes",
value: function(e) {
var t = (0,
E.Z)({}, e);
return this._documentCookiePatched && (t.allowed = "true"),
t
}
}]),
e
}()
, ee = function() {
function e(t, n) {
d(this, e),
this.name = t,
this.category = n.category,
this.name.indexOf("*") >= 0 ? (this.inexact = !0,
this._regexp = new RegExp(t.replace("*", ".+"))) : this.inexact = !1
}
return m(e, [{
key: "isMatch",
value: function(e) {
return this.name === e || this._regexp && this._regexp.test(e)
}
}]),
e
}()
, te = {
"*_dismissed": {
category: "functional"
},
docs: {
category: "essential"
},
lsid: {
category: "functional"
},
imt: {
category: "advertising"
},
personalizations: {
category: "functional"
},
"twilio_chat_*": {
category: "essential"
},
"yt-remote-connected-devices": {
category: "advertising"
},
"yt-remote-device-id": {
category: "advertising"
},
"yt.innertube::nextId": {
category: "advertising"
},
"yt.innertube::requests": {
category: "advertising"
},
"link.auth_session_client_secret": {
category: "authentication"
},
apps_oauth_state: {
category: "authentication"
},
request_sign_key: {
category: "authentication"
},
elements_session: {
category: "functional"
},
elements_assignment: {
category: "functional"
},
"elements.prb_warning.dismiss_timestamp": {
category: "essential"
},
last_used_payment_method: {
category: "functional"
},
user_session_token: {
category: "authentication"
},
"userleap.ids": {
category: "essential"
},
"userleap.pageviews": {
category: "essential"
},
workbenchState: {
category: "functional"
},
"dashboard.banner-dismissals": {
category: "essential"
},
"dashboard.nav-collapsed": {
category: "functional"
},
link_app_devtools: {
category: "essential"
},
"payment_method_settings.direct": {
category: "functional"
},
"verification-session-create--verification-flow-toggle--value": {
category: "functional"
},
"payment_method_settings.connect": {
category: "functional"
}
}
, ne = Object.keys(te).reduce((function(e, t) {
var n = te[t];
return e[t] = new ee(t,n),
e
}
), {})
, re = Object.keys(ne).filter((function(e) {
return ne[e].inexact
}
)).map((function(e) {
return ne[e]
}
))
, ae = function(e) {
if (ne[e])
return ne[e];
var t, n = u(re);
try {
for (n.s(); !(t = n.n()).done; ) {
var r = t.value;
if (r.isMatch(e))
return r
}
} catch (e) {
n.e(e)
} finally {
n.f()
}
return null
}
, ie = function() {
function e() {
var n, r = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
return d(this, e),
n = t.call(this, r),
g("localStorage") && setTimeout((function() {
n.refresh()
}
), 0),
n
}
r(e, G);
var t = i(e);
return m(e, [{
key: "isStorageAvailable",
value: function() {
return g("localStorage")
}
}, {
key: "get",
value: function(e) {
return ae(e) || w("No item matching the name ".concat(e, " was found in the localStorage.yaml manifest. ") + "Reading the value of the item will work, but attempting to set the item will result in an error. If you're adding a new localStorage item, please visit go/cookies for more information!"),
g("localStorage") ? (this.refresh(),
localStorage.getItem(e)) : null
}
}, {
key: "getKeyMatches",
value: function(e) {
if (!(e.indexOf("*") >= 0))
return w("Invalid pattern provided, no wildcard after other characters"),
[];
var t = new RegExp("^".concat(e.replace("*", ".+"), "$"));
return Object.keys(localStorage).filter((function(e) {
return t.test(e)
}
)).filter((function(e) {
return ae(e)
}
))
}
}, {
key: "set",
value: function(e, t) {
return v(this, void 0, void 0, l().mark((function n() {
var r;
return l().wrap((function(n) {
for (; ; )
switch (n.prev = n.next) {
case 0:
if (r = ae(e)) {
n.next = 4;
break
}
return T("No item matching the name ".concat(e, " was found in the localStorage.yaml manifest. ") + "If you're adding a new item, please visit go/cookies for more information!"),
n.abrupt("return", !1);
case 4:
return n.next = 6,
this.isCategoryAllowed(r.category);
case 6:
if (n.sent) {
n.next = 9;
break
}
return n.abrupt("return", !1);
case 9:
if (g("localStorage")) {
n.next = 11;
break
}
return n.abrupt("return", !1);
case 11:
return localStorage.setItem(e, t),
n.abrupt("return", !0);
case 13:
case "end":
return n.stop()
}
}
), n, this)
}
)))
}
}, {
key: "remove",
value: function(e) {
return ae(e) ? !!g("localStorage") && (localStorage.removeItem(e),
!0) : (T("No item matching the name ".concat(e, " was found in the localStorage.yaml manifest. ") + "If you're adding a new item, please visit go/cookies for more information!"),
!1)
}
}, {
key: "refresh",
value: function() {
return v(this, void 0, void 0, l().mark((function e() {
var t = this;
return l().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
Object.keys(localStorage).forEach((function(e) {
var n = ae(e);
if (n && localStorage.getItem(e)) {
var r = t.isCategoryAllowedMaybeSync(n.category);
!1 === r && localStorage.removeItem(e),
r instanceof Z && r.then((function(t) {
t || localStorage.removeItem(e)
}
))
}
}
));
case 1:
case "end":
return e.stop()
}
}
), e)
}
)))
}
}]),
e
}()
, oe = function() {
function e(t, n) {
d(this, e),
this.name = t,
this.category = n.category,
this.name.indexOf("*") >= 0 ? (this.inexact = !0,
this._regexp = new RegExp(t.replace("*", ".+"))) : this.inexact = !1
}
return m(e, [{
key: "isMatch",
value: function(e) {
return this.name === e || this._regexp && this._regexp.test(e)
}
}]),
e
}()
, se = {
1: {
category: "essential"
},
placeholder_session_storage_object: {
category: "essential"
},
workbenchState: {
category: "functional"
},
"dashboard.tab-context": {
category: "essential"
},
_ab: {
category: "essential"
},
_mf: {
category: "essential"
},
id: {
category: "essential"
}
}
, ue = Object.keys(se).reduce((function(e, t) {
var n = se[t];
return e[t] = new oe(t,n),
e
}
), {})
, le = Object.keys(ue).filter((function(e) {
return ue[e].inexact
}
)).map((function(e) {
return ue[e]
}
))
, ce = function(e) {
if (ue[e])
return ue[e];
var t, n = u(le);
try {
for (n.s(); !(t = n.n()).done; ) {
var r = t.value;
if (r.isMatch(e))
return r
}
} catch (e) {
n.e(e)
} finally {
n.f()
}
return null
}
, de = function() {
function e() {
var n, r = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
return d(this, e),
n = t.call(this, r),
g("sessionStorage") && setTimeout((function() {
n.refresh()
}
), 0),
n
}
r(e, G);
var t = i(e);
return m(e, [{
key: "isStorageAvailable",
value: function() {
return g("sessionStorage")
}
}, {
key: "get",
value: function(e) {
return ce(e) || w("No item matching the name ".concat(e, " was found in the sessionStorage.yaml manifest. ") + "Reading the value of the item will work, but attempting to set the item will result in an error. If you're adding a new sessionStorage item, please visit go/cookies for more information!"),
g("sessionStorage") ? (this.refresh(),
sessionStorage.getItem(e)) : null
}
}, {
key: "set",
value: function(e, t) {
return v(this, void 0, void 0, l().mark((function n() {
var r;
return l().wrap((function(n) {
for (; ; )
switch (n.prev = n.next) {
case 0:
if (r = ce(e)) {
n.next = 4;
break
}
return T("No item matching the name ".concat(e, " was found in the sessionStorage.yaml manifest. ") + "If you're adding a new item, please visit go/cookies for more information!"),
n.abrupt("return", !1);
case 4:
return n.next = 6,
this.isCategoryAllowed(r.category);
case 6:
if (n.sent) {
n.next = 9;
break
}
return n.abrupt("return", !1);
case 9:
if (g("sessionStorage")) {
n.next = 11;
break
}
return n.abrupt("return", !1);
case 11:
return sessionStorage.setItem(e, t),
n.abrupt("return", !0);
case 13:
case "end":
return n.stop()
}
}
), n, this)
}
)))
}
}, {
key: "remove",
value: function(e) {
return ce(e) ? !!g("sessionStorage") && (sessionStorage.removeItem(e),
!0) : (T("No item matching the name ".concat(e, " was found in the sessionStorage.yaml manifest. ") + "If you're adding a new item, please visit go/cookies for more information!"),
!1)
}
}, {
key: "refresh",
value: function() {
return v(this, void 0, void 0, l().mark((function e() {
var t = this;
return l().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
Object.keys(sessionStorage).forEach((function(e) {
var n = ce(e);
if (n && sessionStorage.getItem(e)) {
var r = t.isCategoryAllowedMaybeSync(n.category);
!1 === r && sessionStorage.removeItem(e),
r instanceof Z && r.then((function(t) {
t || sessionStorage.removeItem(e)
}
))
}
}
));
case 1:
case "end":
return e.stop()
}
}
), e)
}
)))
}
}]),
e
}()
, pe = R("/cookie-settings")
, me = R("/cookies-policy/legal")
, fe = "https://stripe.com/cookie-settings/enforcement-mode"
},
10134: function(e, t, n) {
"use strict";
function r(e, t, n) {
return t in e ? Object.defineProperty(e, t, {
value: n,
enumerable: !0,
configurable: !0,
writable: !0
}) : e[t] = n,
e
}
function a(e, t) {
var n = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var r = Object.getOwnPropertySymbols(e);
t && (r = r.filter((function(t) {
return Object.getOwnPropertyDescriptor(e, t).enumerable
}
))),
n.push.apply(n, r)
}
return n
}
function i(e) {
for (var t = 1; t < arguments.length; t++) {
var n = null != arguments[t] ? arguments[t] : {};
t % 2 ? a(Object(n), !0).forEach((function(t) {
r(e, t, n[t])
}
)) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : a(Object(n)).forEach((function(t) {
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t))
}
))
}
return e
}
function o(e) {
return "Minified Redux error #" + e + "; visit https://redux.js.org/Errors?code=" + e + " for the full message or use the non-minified dev environment for full errors. "
}
function s(e) {
if ("object" != typeof e || null === e)
return !1;
for (var t = e; null !== Object.getPrototypeOf(t); )
t = Object.getPrototypeOf(t);
return Object.getPrototypeOf(e) === t
}
function u(e, t, n) {
function r() {
_ === h && (_ = h.slice())
}
function a() {
if (y)
throw new Error(o(3));
return f
}
function i(e) {
if ("function" != typeof e)
throw new Error(o(4));
if (y)
throw new Error(o(5));
var t = !0;
return r(),
_.push(e),
function() {
if (t) {
if (y)
throw new Error(o(6));
t = !1,
r();
var n = _.indexOf(e);
_.splice(n, 1),
h = null
}
}
}
function l(e) {
if (!s(e))
throw new Error(o(7));
if (void 0 === e.type)
throw new Error(o(8));
if (y)
throw new Error(o(9));
try {
y = !0,
f = m(f, e)
} finally {
y = !1
}
for (var t = h = _, n = 0; n < t.length; n++) {
(0,
t[n])()
}
return e
}
function c(e) {
if ("function" != typeof e)
throw new Error(o(10));
m = e,
l({
type: ag.REPLACE
})
}
function d() {
var e, t = i;
return (e = {
subscribe: function(e) {
function n() {
e.next && e.next(a())
}
if ("object" != typeof e || null === e)
throw new Error(o(11));
return n(),
{
unsubscribe: t(n)
}
}
})[ng] = function() {
return this
}
,
e
}
var p;
if ("function" == typeof t && "function" == typeof n || "function" == typeof n && "function" == typeof arguments[3])
throw new Error(o(0));
if ("function" == typeof t && void 0 === n && (n = t,
t = void 0),
void 0 !== n) {
if ("function" != typeof n)
throw new Error(o(1));
return n(u)(e, t)
}
if ("function" != typeof e)
throw new Error(o(2));
var m = e
, f = t
, h = []
, _ = h
, y = !1;
return l({
type: ag.INIT
}),
(p = {
dispatch: l,
subscribe: i,
getState: a,
replaceReducer: c
})[ng] = d,
p
}
function l(e) {
for (var t = Object.keys(e), n = {}, r = 0; r < t.length; r++) {
var a = t[r];
0,
"function" == typeof e[a] && (n[a] = e[a])
}
var i, s = Object.keys(n);
try {
!function(e) {
Object.keys(e).forEach((function(t) {
var n = e[t];
if (void 0 === n(void 0, {
type: ag.INIT
}))
throw new Error(o(12));
if (void 0 === n(void 0, {
type: ag.PROBE_UNKNOWN_ACTION()
}))
throw new Error(o(13))
}
))
}(n)
} catch (e) {
i = e
}
return function(e, t) {
if (void 0 === e && (e = {}),
i)
throw i;
for (var r = !1, a = {}, u = 0; u < s.length; u++) {
var l = s[u]
, c = n[l]
, d = e[l]
, p = c(d, t);
if (void 0 === p) {
t && t.type;
throw new Error(o(14))
}
a[l] = p,
r = r || p !== d
}
return (r = r || s.length !== Object.keys(e).length) ? a : e
}
}
function c() {
for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
t[n] = arguments[n];
return 0 === t.length ? function(e) {
return e
}
: 1 === t.length ? t[0] : t.reduce((function(e, t) {
return function() {
return e(t.apply(void 0, arguments))
}
}
))
}
function d() {
for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
t[n] = arguments[n];
return function(e) {
return function() {
var n = e.apply(void 0, arguments)
, r = function() {
throw new Error(o(15))
}
, a = {
getState: n.getState,
dispatch: function() {
return r.apply(void 0, arguments)
}
}
, s = t.map((function(e) {
return e(a)
}
));
return r = c.apply(void 0, s)(n.dispatch),
i(i({}, n), {}, {
dispatch: r
})
}
}
}
function p(e) {
return function(t) {
var n = t.dispatch
, r = t.getState;
return function(t) {
return function(a) {
return "function" == typeof a ? a(n, r, e) : t(a)
}
}
}
}
var m, f, h = n(45987), _ = n(87462), y = n(36459), v = n(4942), g = n(93324), b = n(1413), S = n(74165), k = n(15861), C = n(15671), E = n(43144), Z = n(89062), A = n(52303), M = n(71873), P = n(39581), x = n(24245), I = n(18812), N = n(47792), w = ((0,
M.mC)({
name: (0,
M.kw)("react-stripe-js", "stripe-js", "react-stripe-elements"),
version: (0,
M.AG)(M.Z_),
startTime: (0,
M.jt)(M.Rx)
}),
function(e) {
var t = {
wrapper: "unknown",
wrapper_version: null,
es_module: !1,
es_module_version: null
};
return e.forEach((function(e) {
"stripe-js" === e.name ? (t.es_module = !0,
e.version && !t.es_module_version && (t.es_module_version = e.version)) : t.wrapper_version || (t.wrapper = e.name,
t.wrapper_version = e.version)
}
)),
t
}
), T = ((0,
M.ci)({
name: (0,
M.ui)(1, 30),
partner_id: (0,
M.jt)(M.Z_),
version: (0,
M.jt)((0,
M.ui)(5, 15)),
url: (0,
M.jt)((0,
M.ui)(4, 60))
}),
n(36617)), O = n(12024), R = n(69620), L = n(80755), D = n(35918), U = {
"card[exp_year]": {
param: "exp_year",
code: "incomplete_expiry"
},
"card[exp_month]": {
param: "exp_month",
code: "incomplete_expiry"
},
"card[number]": {
param: "number",
code: "incomplete_number"
},
"card[cvc]": {
param: "cvc",
code: "incomplete_cvc"
},
"card[address_zip]": {
param: "address_zip",
code: "incomplete_zip"
},
"sofort[country]": {
param: "country",
code: "invalid_sofort_country"
}
}, j = {
rate_limit: "processing_error_intransient"
}, B = {
card_brand_blocked: "errors.code.card_brand_blocked",
card_number_in_name_field: "errors.code.card_number_in_name_field",
card_number_in_postal_code_field: "errors.code.card_number_in_postal_code_field",
cvc_recollection_required: "errors.code.cvc_recollection_required",
expired_card: "errors.code.expired_card",
financial_connections_session_cancelled: "errors.code.financial_connections_session_cancelled",
postal_code_recollection_required_check_failed: "errors.code.postal_code_recollection_required",
postal_code_recollection_required_missing_required_postal_code: "errors.code.postal_code_recollection_required",
empty_phone_number: "errors.code.empty_phone_number",
incomplete: "errors.code.incomplete_card",
incomplete_au_bank_account_number: "errors.code.incomplete_au_bank_account_number",
incomplete_au_bank_account_bsb: "errors.code.incomplete_au_bank_account_bsb",
incomplete_cvc: "errors.code.incomplete_cvc",
incomplete_expiry: "errors.code.incomplete_expiry",
incomplete_iban: "errors.code.incomplete_iban",
incomplete_number: "errors.code.incomplete_number",
incomplete_zip: "errors.code.incomplete_zip",
incomplete_name: "errors.code.incomplete_name",
incomplete_first_name: "errors.code.incomplete_first_name",
incomplete_last_name: "errors.code.incomplete_last_name",
incomplete_organization_name: "errors.code.incomplete_organization_name",
incomplete_card_name: "errors.code.incomplete_card_name",
incomplete_phone_number: "errors.code.incomplete_phone_number",
incomplete_us_bank_account_account_number: "errors.code.incomplete_us_bank_account_account_number",
incomplete_us_bank_account_confirm_account_number: "errors.code.incomplete_us_bank_account_confirm_account_number",
incomplete_us_bank_account_routing_number: "errors.code.incomplete_us_bank_account_routing_number",
invalid_us_bank_account_email_length: "errors.code.invalid_us_bank_account_email_length",
invalid_us_bank_account_name_length: "errors.code.invalid_us_bank_account_name_length",
incorrect_cvc: "errors.code.incorrect_cvc",
incorrect_zip: "errors.code.incorrect_zip",
instant_verification_incomplete: "errors.code.instant_verification_incomplete",
instant_verification_initialization: "errors.code.instant_verification_initialization",
invalid_au_bank_account_bsb: "errors.code.invalid_au_bank_account_bsb",
invalid_au_bank_account_bsb_livemode: "errors.code.invalid_au_bank_account_bsb_livemode",
invalid_au_bank_account_bsb_testmode: "errors.code.invalid_au_bank_account_bsb_testmode",
invalid_au_bank_account_number_testmode: "errors.code.invalid_au_bank_account_number_testmode",
invalid_bank_account_account_number: "errors.code.invalid_bank_account_account_number",
invalid_bank_account_routing_number: "errors.code.invalid_bank_account_routing_number",
invalid_blik_code: "errors.code.invalid_blik_code",
incomplete_br_tax_id: "errors.code.incomplete_br_tax_id",
incomplete_br_tax_id_cnpj_only: "errors.code.incomplete_br_tax_id_cnpj_only",
invalid_cvc: "errors.code.invalid_cvc",
invalid_expiry_month: "errors.code.invalid_expiry_month",
invalid_expiry_month_past: "errors.code.invalid_expiry_month_past",
invalid_expiry_year: "errors.code.invalid_expiry_year",
invalid_expiry_year_past: "errors.code.invalid_expiry_year_past",
invalid_iban: "errors.code.invalid_iban",
invalid_iban_country_code: "errors.code.invalid_iban_country_code",
unsupported_non_sepa_iban_country_code: "errors.code.unsupported_non_sepa_iban_country_code",
invalid_iban_start: "errors.code.invalid_iban_start",
invalid_name_bancontact: "errors.code.invalid_name_bancontact",
invalid_number: "errors.code.invalid_number",
invalid_phone_number: "errors.code.invalid_phone_number",
invalid_phone_number_prefix: "errors.code.invalid_phone_number_prefix",
invalid_postal_code: "errors.code.invalid_postal_code",
invalid_zip: "errors.code.invalid_zip",
invalid_rechnung_date: "errors.code.invalid_rechnung_date",
invalid_rechnung_birthdate_too_old: "errors.code.invalid_rechnung_birthdate_too_old",
invalid_rechnung_birthdate_too_young: "errors.code.invalid_rechnung_birthdate_too_young",
invalid_upi_vpa: "errors.code.invalid_upi_vpa",
invalid_payid: "errors.code.invalid_payid",
incomplete_payment_details: "errors.code.incomplete_payment_details",
email_invalid: "errors.code.email_invalid",
incomplete_email: "errors.code.incomplete_email",
incomplete_email_autofill: "link.autofill.select_an_option",
incomplete_address: "errors.code.incomplete_address",
incomplete_nz_bank_name: "errors.code.incomplete_nz_bank_name",
incomplete_id_bank_transfer_bank: "errors.code.incomplete_id_bank_transfer_bank",
po_box_prohibited: "errors.code.po_box_prohibited",
incomplete_nz_bank_account_account_number: "errors.code.incomplete_nz_bank_account_account_number",
invalid_nz_bank_account_number: "errors.code.invalid_nz_bank_account_number",
incomplete_mandate_checkbox: "errors.code.incomplete_mandate_checkbox",
"invalid_payment_view.add": "errors.code.invalid_payment_view.add",
"invalid_payment_view.remove": "errors.code.invalid_payment_view.remove",
"invalid_payment_view.update": "errors.code.invalid_payment_view.update",
"invalid_address_view.update": "errors.code.invalid_address_view.update",
mismatch_us_bank_account_account_number: "errors.code.mismatch_us_bank_account_account_number",
modify_bacs_debit_bank_details: "errors.code.modify_bacs_debit_bank_details",
sepa_debit_microdeposits_unconfirmed: "errors.code.sepa_debit_microdeposits_unconfirmed",
incomplete_payment_method: "errors.code.incomplete_payment_method",
nz_bank_account_invalid_account_number_length: "errors.code.nz_bank_account_invalid_account_number_length",
card_velocity_exceeded: "errors.declines.card_velocity_exceeded",
fraudulent: "errors.declines.generic_decline",
generic_decline: "errors.declines.generic_decline",
insufficient_funds: "errors.declines.insufficient_funds",
lost_card: "errors.declines.generic_decline",
stolen_card: "errors.declines.generic_decline"
}, F = function(e, t) {
var n = e.code
, r = e.translateMessageParams
, a = e.messageParams
, i = B[n];
return {
code: n,
type: "validation_error",
message: a ? (0,
D.jt)(t, i, a, r) : (0,
D.Yo)(t, i)
}
}, G = function(e, t) {
if ("input_validation_error" === e.type)
return {
localizedError: F(e, t),
reports: [],
localized: !0
};
var n, r = (d = e,
(0,
b.Z)((0,
b.Z)({
type: d.type || "unexpected"
}, d), d.param ? U[d.param] : {})), a = r.code, i = r.type, o = r.decline_code, s = a && j[a] || a, u = o && (0,
D.pY)(t, "errors.declines.".concat(o)), l = s && (0,
D.pY)(t, "errors.code.".concat(s)), c = i && (0,
D.pY)(t, "errors.type.".concat(i));
if (n = "generic_decline" === o ? l || u || c : u || l || c)
return {
localizedError: (0,
b.Z)((0,
b.Z)({}, r), {}, {
message: n
}),
reports: [],
localized: !0
};
n = r.message && "string" == typeof r.message ? r.message : (0,
D.Yo)(t, "errors.code.unexpected");
var d, p = ["missing_error_message", {
locale: t,
code: a,
type: i,
declineCode: o
}];
return {
localizedError: (0,
b.Z)((0,
b.Z)({}, r), {}, {
message: n
}),
reports: [p],
localized: !1
}
}, q = n(32583), K = n(69792), V = n(60276), z = n(31522), H = (0,
b.Z)((0,
b.Z)({}, z.y.typesByType), {}, {
amazon_pay: "amazon_pay",
alipay: "alipay",
alma: "alma",
affirm: "affirm",
afterpay_clearpay: "afterpay_clearpay",
au_becs_debit: "au_becs_debit",
acss_debit: "acss_debit",
bacs_debit: "bacs_debit",
bancontact: "bancontact",
blik: "blik",
boleto: "boleto",
card: "card",
cashapp: "cashapp",
capchase_pay: "capchase_pay",
crypto: "crypto",
customer_balance: "customer_balance",
eps: "eps",
fpx: "fpx",
giropay: "giropay",
gopay: "gopay",
grabpay: "grabpay",
ideal: "ideal",
klarna: "klarna",
kriya: "kriya",
konbini: "konbini",
mb_way: "mb_way",
mobilepay: "mobilepay",
multibanco: "multibanco",
mondu: "mondu",
ng_bank: "ng_bank",
ng_bank_transfer: "ng_bank_transfer",
ng_card: "ng_card",
ng_market: "ng_market",
ng_ussd: "ng_ussd",
nz_bank_account: "nz_bank_account",
oxxo: "oxxo",
p24: "p24",
pay_by_bank: "pay_by_bank",
paypal: "paypal",
payto: "payto",
qris: "qris",
rechnung: "rechnung",
sepa_debit: "sepa_debit",
sofort: "sofort",
south_korea_market: "south_korea_market",
kr_card: "kr_card",
kr_market: "kr_market",
kakao_pay: "kakao_pay",
naver_pay: "naver_pay",
payco: "payco",
samsung_pay: "samsung_pay",
shopeepay: "shopeepay",
swish: "swish",
three_d_secure: "three_d_secure",
twint: "twint",
upi: "upi",
us_bank_account: "us_bank_account",
wechat_pay: "wechat_pay",
paynow: "paynow",
pix: "pix",
promptpay: "promptpay",
revolut_pay: "revolut_pay",
sunbit: "sunbit",
satispay: "satispay",
sequra: "sequra",
netbanking: "netbanking",
id_bank_transfer: "id_bank_transfer",
link: "link",
link_card_brand: "link_card_brand",
demo_pay: "demo_pay",
zip: "zip"
}), Y = (m = {},
(0,
v.Z)(m, V.Yj.auBankAccount, H.au_becs_debit),
(0,
v.Z)(m, V.Yj.card, H.card),
(0,
v.Z)(m, V.Yj.cardNumber, H.card),
(0,
v.Z)(m, V.Yj.cardExpiry, H.card),
(0,
v.Z)(m, V.Yj.cardCvc, H.card),
(0,
v.Z)(m, V.Yj.postalCode, H.card),
(0,
v.Z)(m, V.Yj.iban, H.sepa_debit),
(0,
v.Z)(m, V.Yj.idealBank, H.ideal),
(0,
v.Z)(m, V.Yj.fpxBank, H.fpx),
(0,
v.Z)(m, V.Yj.p24Bank, H.p24),
(0,
v.Z)(m, V.Yj.netbankingBank, H.netbanking),
(0,
v.Z)(m, V.Yj.epsBank, H.eps),
m), W = function(e, t) {
return null != t ? t : function(e) {
return -1 === V.sL.indexOf(e)
}(e) ? null : Y[e] || null
}, J = function(e) {
var t = e.match(/^(seti|pi)_/);
if (t)
return "seti" === t[1] ? V.kE.SETUP_INTENT : V.kE.PAYMENT_INTENT;
throw new Error("Unexpected intent id or client secret shape")
}, X = function(e) {
return "payment_intent" === e.object ? {
id: e.id,
clientSecret: e.client_secret,
type: "PAYMENT_INTENT"
} : {
id: e.id,
clientSecret: e.client_secret,
type: "SETUP_INTENT"
}
}, Q = function(e) {
if ("tag"in e) {
var t = e.tag;
return "shipping-from-elements" === t || "elements" === t || "paymentMethod" === t
}
return !1
}, $ = function(e) {
var t;
switch (e.tag) {
case "source-from-element":
case "paymentMethod-from-element":
return e.elementName;
case "elements":
return e.frameId ? null !== (t = e.elementName) && void 0 !== t ? t : "payment" : "elements";
case "shipping-from-elements":
case "source-from-data":
case "paymentMethod-from-data":
case "source":
case "paymentMethod":
case "none":
case "confirmationToken":
return null;
default:
return (0,
P.Rz)(e)
}
}, ee = n(47499), te = function(e) {
for (var t = "", n = 0; n < e.length; ++n)
t += String.fromCharCode(5 ^ e.charCodeAt(n));
return t
}, ne = function(e) {
return encodeURIComponent(btoa(te((n = 3 - (t = e).length % 3,
r = new Array(n + 1).join(" "),
"".concat(t).concat(r)))));
var t, n, r
}, re = n(56274).Promise, ae = new ee.LocalStorage, ie = [V.D3.elements_session], oe = function(e, t) {
return e && t ? ne(e + t) : e && ne(e)
}, se = function(e) {
try {
var t = ae.get(e);
return t ? JSON.parse(t) : null
} catch (e) {
return null
}
}, ue = function(e, t) {
var n, r = -1 !== ie.indexOf(e), a = se(e);
if (!a)
return null;
if (!r)
return a;
if (!t)
return null;
var i = a;
return null !== (n = null == i ? void 0 : i[t]) && void 0 !== n ? n : null
}, le = function(e) {
var t = e.experimentKey
, n = e.experimentId
, r = e.apiKey
, a = e.stripeAccount
, i = e.stripeJsId;
if (!n)
return re.resolve(null);
var o = oe(r, a)
, s = ue(t, o);
return (null == s ? void 0 : s.experimentId) === n ? re.resolve(n) : s && s.stripeJsId === i ? re.resolve(s.experimentId) : function(e, t, n) {
return -1 !== ie.indexOf(e) ? t ? ae.set(e, JSON.stringify((0,
b.Z)((0,
b.Z)({}, se(e)), {}, (0,
v.Z)({}, t, n)))) : new re((function() {
return !1
}
)) : ae.set(e, JSON.stringify(n))
}(t, o, {
experimentId: n,
stripeJsId: i,
expiresAt: Date.now() + V.Lt[t]
}).then((function() {
return n
}
), (function() {
return n
}
))
}, ce = function(e) {
var t = e.experimentKey
, n = e.apiKey
, r = e.stripeAccount;
try {
!function(e, t) {
if (-1 === ie.indexOf(e))
return new re((function() {
return ae.remove(e)
}
));
if (!t)
return new re((function() {
return !1
}
));
var n = se(e);
null != n && n[t] ? (delete n[t],
ae.set(e, JSON.stringify(n))) : new re((function() {
return !1
}
))
}(t, oe(n, r))
} catch (e) {}
}, de = function(e) {
var t = e.experimentKey
, n = e.apiKey
, r = e.stripeAccount;
try {
var a = oe(n, r)
, i = ue(t, a);
return i ? Date.now() >= i.expiresAt ? (ce({
experimentKey: t,
apiKey: n
}),
null) : i.experimentId : null
} catch (e) {
return null
}
}, pe = function(e) {
return -1 !== ["tokenize", "create_payment_method", "create_confirmation_token", "create_source", "confirm_setup_intent", "confirm_payment_intent"].indexOf(e)
}, me = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
var n;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
n = t.apiClient,
ce({
experimentKey: V.D3.elements_session,
apiKey: n.getApiKey(),
stripeAccount: n.getStripeAccount()
});
case 2:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), fe = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return r = t.apiClient,
a = n.paymentIntentId,
e.abrupt("return", r.paypalConfiguration.retrieve({
paymentIntentId: a,
data: {}
}));
case 3:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), he = n(84490), _e = n(66751), ye = (f = {},
(0,
v.Z)(f, V.Yj.cardNumber, "number"),
(0,
v.Z)(f, V.Yj.cardExpiry, "exp"),
(0,
v.Z)(f, V.Yj.cardCvc, "cvc"),
(0,
v.Z)(f, V.Yj.postalCode, "zip"),
f), ve = function(e) {
return e.filter((function(e) {
return ye[e]
}
)).map((function(e) {
return ye[e]
}
)).join(",")
}, ge = new RegExp("".concat(he.Lb),"g"), be = function e(t) {
return (0,
O.Q8)(t, (function(t) {
return "string" == typeof t ? t.replace(ge, "") : "object" == typeof t && null !== t ? e(t) : t
}
))
}, Se = n(352), ke = n(92531), Ce = ["ELEMENTS_DISPATCH", "RETRIEVE_WALLET_CONFIG", "RETRIEVE_LINK_IN_CARD_CONFIG", "RETRIEVE_LINK_SHARED_SESSION_CONTEXT", "TEMPORARY_AND_DANGEROUS_GET_CONSUMER_INFO", "RECORD_ELEMENTS_PERFORMANCE_TIMELINE", "PERFORM_POST_MOUNT_ACTIONS", "DANGEROUS_UNCACHED_UNLOGGED_LOOKUP"], Ee = new Set(["tokenize.success", "create_payment_method.success", "create_source.success", "confirm_setup_intent.success", "confirm_payment_intent.success", "pr.payment_authorized", "pr.can_make_payment_timed_out", "create_confirmation_token.success", "confirm_payment_page.success", "confirm_payment_intent.type.payment_method", "confirm_payment_intent.type.payment_method_data", "confirm_setup_intent.type.payment_method", "confirm_setup_intent.type.payment_method_data", "confirm_payment_intent.type.link_sign_up", "confirm_payment_intent.type.link_new_card", "confirm_payment_intent.type.link_update_card", "confirm_payment_intent.type.link_payment_details", "confirm_setup_intent.type.link_sign_up", "confirm_setup_intent.type.link_new_card", "confirm_setup_intent.type.link_update_card", "confirm_setup_intent.type.link_payment_details", "link_in_card.mount_link_manager_frame", "link_in_card.fetch_link_config.success", "link_in_card.button_visibility", "link_in_card.link_pm_present", "link_in_card.eject", "link_in_card.no_link_button", "link_in_card.warning", "link_in_card.button_exposure", "link_in_card.has_client_secret", "api.unexpected_400", ke.f3]), Ze = function(e) {
return Ee.has(e)
};
Se.kg.setDefaultPrefix("elements.");
var Ae, Me, Pe, xe, Ie, Ne, we, Te, Oe, Re, Le, De, Ue, je, Be, Fe, Ge, qe, Ke, Ve, ze = {
getParams: function() {
return Se.kg.getParams()
},
updateParams: function(e) {
Se.kg.updateParams(e)
},
log: function(e) {
var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
Se.kg.log(e, (0,
b.Z)({
frame_width: window.innerWidth
}, t), Ze(e) ? {
priority: "high"
} : void 0)
},
warn: function() {
if (ze.getParams().key_mode === R.Kl.test) {
for (var e, t = arguments.length, n = new Array(t), r = 0; r < t; r++)
n[r] = arguments[r];
(e = console).warn.apply(e, ["[Stripe.js]"].concat(n))
}
},
setDefaultPrefix: function(e) {
Se.kg.setDefaultPrefix(e)
}
}, He = ze, Ye = function(e) {
return e.replace(/[^A-Za-z0-9]/g, "")
}, We = function(e) {
return e.replace(/\D/g, "")
}, Je = We, Xe = function(e) {
if (t = e,
(0,
x.Kn)(t) && (0,
x.Kn)(t.linkInCardPaymentData))
return e;
var t, n = e.cardExpiry ? e.cardExpiry.replace(new RegExp("^".concat(he.Lb)), "").split(" / ") : [], r = {
number: e.cardNumber && Je(e.cardNumber),
cvc: e.cardCvc || void 0,
exp_month: n[0],
exp_year: n[1]
}, a = e.postalCode ? {
address: {
postal_code: e.postalCode
}
} : {}, i = {
address_zip: e.postalCode || void 0
};
return {
card: (0,
O.D9)(r, (function(e, t) {
return void 0 !== t
}
)),
owner: (0,
O.D9)(a, (function(e, t) {
return void 0 !== t
}
)),
legacyOwner: (0,
O.D9)(i, (function(e, t) {
return void 0 !== t
}
))
}
}, Qe = (n(56241),
{
austria: "AT",
sterreich: "AT",
csterreich: "AT",
au: "AU",
australia: "AU",
belgium: "BE",
br: "BR",
brasil: "BR",
brazil: "BR",
ca: "CA",
canada: "CA",
ch: "CH",
schweiz: "CH",
switzerland: "CH",
china: "CN",
cn: "CN",
czechrepublic: "CZ",
eskrepublika: "CZ",
cz: "CZ",
de: "DE",
deu: "DE",
deutschland: "DE",
dk: "DK",
germany: "DE",
danmark: "DK",
denmark: "DK",
egypt: "EG",
es: "ES",
espaa: "ES",
espanya: "ES",
spain: "ES",
finland: "FI",
suomi: "FI",
fi: "FI",
fr: "FR",
hk: "HK",
hongkong: "HK",
hungary: "HU",
hu: "HU",
england: "GB",
gb: "GB",
gbr: "GB",
uk: "GB",
unitedkingdom: "GB",
greatbritain: "GB",
scotland: "GB",
wales: "GB",
in: "IN",
ire: "IE",
israel: "IL",
it: "IT",
italy: "IT",
italia: "IT",
italie: "IT",
japan: "JP",
jp: "JP",
lv: "LV",
latvia: "LV",
latvija: "LV",
lietuva: "LT",
lt: "LT",
luxembourg: "LU",
mexico: "MX",
mx: "MX",
my: "MY",
netherlands: "NL",
thenetherlands: "NL",
nederland: "NL",
nederlands: "NL",
nl: "NL",
norway: "NO",
no: "NO",
nz: "NZ",
pl: "PL",
poland: "PL",
polska: "PL",
pr: "PR",
pt: "PT",
ro: "RO",
russia: "RU",
saintpierreandmiquelon: "PM",
saudiarabia: "SA",
se: "SE",
sg: "SG",
slovakia: "SK",
svk: "SK",
southafrica: "ZA",
sweden: "SE",
sverige: "SE",
singapore: "SG",
taiwan: "TW",
turkey: "TR",
uae: "AE",
ukraine: "UA",
us: "US",
usa: "US",
unitedstatesofamerica: "US",
unitedstates: "US",
estadosunidos: "US"
}), $e = function(e, t) {
if (e.country && "string" == typeof e.country) {
var n, r = e.country.toLowerCase().replace(/[^a-z]+/g, "");
return e.countryCode ? "string" == typeof e.countryCode && (n = e.countryCode.toUpperCase()) : (n = Qe[r]) || t(),
(0,
b.Z)((0,
b.Z)({}, e), {}, {
countryCode: n
})
}
return e
}, et = function(e) {
if (e && "object" == typeof e) {
var t = e.addressLines
, n = e.givenName
, r = e.familyName
, a = e.locality
, i = e.administrativeArea
, o = e.postalCode
, s = (e.countryCode,
[n, r].filter((function(e) {
return e
}
)));
return {
name: s.length ? s.join(" ") : void 0,
address_line1: t && Array.isArray(t) ? t[0] : void 0,
address_line2: t && Array.isArray(t) ? t.slice(1).join(", ") : void 0,
address_city: a,
address_state: i,
address_zip: null == o ? void 0 : o.trim(),
address_country: $e(e, x.ZT).countryCode
}
}
return {}
}, tt = {
email: (0,
M.jt)(M.Z_),
usage: (0,
M.jt)(M.Z_)
}, nt = {
city: (0,
M.jt)(M.Z_),
country: (0,
M.jt)(M.Z_),
line1: (0,
M.jt)(M.Z_),
line2: (0,
M.jt)(M.Z_),
postal_code: (0,
M.jt)(M.Z_),
state: (0,
M.jt)(M.Z_)
}, rt = (0,
b.Z)((0,
b.Z)({}, nt), {}, {
town: (0,
M.jt)(M.Z_)
}), at = (0,
M.ci)({
front: (0,
M.jt)(M.Z_),
back: (0,
M.jt)(M.Z_)
}), it = {
address: (0,
M.jt)((0,
M.ci)(nt)),
dob: (0,
M.jt)((0,
M.ci)({
day: (0,
M.or)(M.Z_, (0,
M.O)(1, 31)),
month: (0,
M.or)(M.Z_, (0,
M.O)(1, 12)),
year: (0,
M.or)(M.Z_, M.Rx)
})),
first_name: (0,
M.jt)(M.Z_),
last_name: (0,
M.jt)(M.Z_),
maiden_name: (0,
M.jt)(M.Z_),
verification: (0,
M.jt)((0,
M.or)((0,
M.ci)({
document: (0,
M.jt)(M.Z_),
document_back: (0,
M.jt)(M.Z_),
additional_document: (0,
M.jt)(M.Z_),
additional_document_back: (0,
M.jt)(M.Z_)
}), (0,
M.ci)({
document: (0,
M.jt)(at),
additional_document: (0,
M.jt)(at)
})))
}, ot = {
card: {
name: (0,
M.jt)(M.Z_),
address_line1: (0,
M.jt)(M.Z_),
address_line2: (0,
M.jt)(M.Z_),
address_city: (0,
M.jt)(M.Z_),
address_state: (0,
M.jt)(M.Z_),
address_zip: (0,
M.jt)(M.Z_),
address_country: (0,
M.jt)(M.Z_),
currency: (0,
M.jt)(M.Z_),
number: (0,
M.yv)("Elements"),
cvc: (0,
M.yv)("Elements"),
exp_month: (0,
M.yv)("Elements"),
exp_year: (0,
M.yv)("Elements")
},
cvc_update: {
cvc: (0,
M.yv)("Elements")
},
pii: {
id_number: (0,
M.jt)(M.Z_),
personal_id_number: (0,
M.jt)(M.Z_),
ssn_last_4: (0,
M.jt)(M.Z_)
},
bank_account: {
account_number: (0,
M.jt)((0,
M.vC)([V.Yj.iban], "The 'account_number' parameter is not supported when creating a token with the '".concat(V.Yj.iban, "' Element"))(M.Z_)),
country: (0,
M.jt)((0,
M.vC)([V.Yj.iban], "The 'country' parameter is not supported when creating a token with the '".concat(V.Yj.iban, "' Element"))(M.Z_)),
currency: (0,
M.jt)(M.Z_),
routing_number: (0,
M.jt)((0,
M.vC)([V.Yj.iban], "The 'routing_number' parameter is not supported when creating a token with the '".concat(V.Yj.iban, "' Element"))(M.Z_)),
account_use: (0,
M.jt)(M.Z_),
account_holder_name: (0,
M.jt)(M.Z_),
account_holder_type: (0,
M.jt)(M.Z_),
account_type: (0,
M.jt)(M.Z_),
debit_agreement_shown_and_accepted: (0,
M.jt)(M.Xg)
},
account: {
legal_entity: (0,
M.jt)((0,
M.ci)((0,
b.Z)((0,
b.Z)({}, it), {}, {
additional_owners: (0,
M.jt)((0,
M.CT)((0,
M.ci)(it))),
address_kana: (0,
M.jt)((0,
M.ci)(rt)),
address_kanji: (0,
M.jt)((0,
M.ci)(rt)),
business_name: (0,
M.jt)(M.Z_),
business_name_kana: (0,
M.jt)(M.Z_),
business_name_kanji: (0,
M.jt)(M.Z_),
business_tax_id: (0,
M.jt)(M.Z_),
business_vat_id: (0,
M.jt)(M.Z_),
first_name_kana: (0,
M.jt)(M.Z_),
first_name_kanji: (0,
M.jt)(M.Z_),
gender: (0,
M.jt)((0,
M.kw)("male", "female")),
last_name_kana: (0,
M.jt)(M.Z_),
last_name_kanji: (0,
M.jt)(M.Z_),
personal_address: (0,
M.jt)((0,
M.ci)(nt)),
personal_address_kana: (0,
M.jt)((0,
M.ci)(rt)),
personal_address_kanji: (0,
M.jt)((0,
M.ci)(rt)),
personal_id_number: (0,
M.jt)(M.Z_),
phone_number: (0,
M.jt)(M.Z_),
ssn_last_4: (0,
M.jt)((0,
M.ui)(4, 4)),
tax_id_registrar: (0,
M.jt)(M.Z_),
type: (0,
M.jt)((0,
M.kw)("individual", "company", "non_profit", "government_entity")),
structure: (0,
M.jt)((0,
M.kw)("government_instrumentality", "governmental_unit", "incorporated_non_profit", "limited_liability_partnership", "multi_member_llc", "private_company", "private_corporation", "private_partnership", "public_company", "public_corporation", "public_partnership", "single_member_llc", "sole_proprietorship", "tax_exempt_government_instrumentality", "unincorporated_association", "unincorporated_non_profit")),
company_verification: (0,
M.jt)((0,
M.ci)({
document: M.Z_,
document_back: (0,
M.jt)(M.Z_)
}))
}))),
individual: (0,
M.jt)((0,
M.ci)((0,
b.Z)((0,
b.Z)({}, it), {}, {
first_name_kana: (0,
M.jt)(M.Z_),
first_name_kanji: (0,
M.jt)(M.Z_),
last_name_kana: (0,
M.jt)(M.Z_),
last_name_kanji: (0,
M.jt)(M.Z_),
address_kana: (0,
M.jt)((0,
M.ci)(rt)),
address_kanji: (0,
M.jt)((0,
M.ci)(rt)),
gender: (0,
M.jt)((0,
M.kw)("male", "female")),
email: (0,
M.jt)(M.Z_),
phone: (0,
M.jt)(M.Z_),
id_number: (0,
M.jt)(M.Z_),
ssn_last_4: (0,
M.jt)((0,
M.ui)(4, 4)),
relationship: (0,
M.jt)((0,
M.ci)(nt))
}))),
company: (0,
M.jt)((0,
M.ci)({
name: (0,
M.jt)(M.Z_),
name_kana: (0,
M.jt)(M.Z_),
name_kanji: (0,
M.jt)(M.Z_),
phone: (0,
M.jt)(M.Z_),
tax_id: (0,
M.jt)(M.Z_),
tax_id_registrar: (0,
M.jt)(M.Z_),
vat_id: (0,
M.jt)(M.Z_),
registration_number: (0,
M.jt)(M.Z_),
structure: (0,
M.jt)((0,
M.kw)("free_zone_establishment", "free_zone_llc", "government_instrumentality", "governmental_unit", "incorporated_non_profit", "limited_liability_partnership", "llc", "multi_member_llc", "private_company", "private_corporation", "private_partnership", "public_company", "public_corporation", "public_partnership", "single_member_llc", "sole_establishment", "sole_proprietorship", "tax_exempt_government_instrumentality", "unincorporated_association", "unincorporated_non_profit")),
directors_provided: (0,
M.jt)(M.Xg),
owners_provided: (0,
M.jt)(M.Xg),
ownership_declaration: (0,
M.jt)((0,
M.ci)({
date: (0,
M.jt)(M.Z_),
ip: (0,
M.jt)(M.Z_),
user_agent: (0,
M.jt)(M.Z_)
})),
ownership_declaration_shown_and_signed: (0,
M.jt)(M.Xg),
executives_provided: (0,
M.jt)(M.Xg),
address: (0,
M.jt)((0,
M.ci)(nt)),
address_kana: (0,
M.jt)((0,
M.ci)(rt)),
address_kanji: (0,
M.jt)((0,
M.ci)(rt)),
verification: (0,
M.jt)((0,
M.ci)({
document: (0,
M.ci)({
front: (0,
M.jt)(M.Z_),
back: (0,
M.jt)(M.Z_)
})
}))
})),
business_type: (0,
M.jt)((0,
M.kw)("individual", "company", "non_profit", "government_entity")),
tos_shown_and_accepted: (0,
M.jt)((0,
M.p3)(!0))
},
person: (0,
b.Z)((0,
b.Z)({}, it), {}, {
first_name_kana: (0,
M.jt)(M.Z_),
first_name_kanji: (0,
M.jt)(M.Z_),
last_name_kana: (0,
M.jt)(M.Z_),
last_name_kanji: (0,
M.jt)(M.Z_),
address_kana: (0,
M.jt)((0,
M.ci)(rt)),
address_kanji: (0,
M.jt)((0,
M.ci)(rt)),
gender: (0,
M.jt)((0,
M.kw)("male", "female")),
email: (0,
M.jt)(M.Z_),
phone: (0,
M.jt)(M.Z_),
id_number: (0,
M.jt)(M.Z_),
ssn_last_4: (0,
M.jt)((0,
M.ui)(4, 4)),
relationship: (0,
M.jt)((0,
M.ci)({
account_opener: (0,
M.jt)(M.Xg),
representative: (0,
M.jt)(M.Xg),
executive: (0,
M.jt)(M.Xg),
director: (0,
M.jt)(M.Xg),
owner: (0,
M.jt)(M.Xg),
percent_ownership: (0,
M.jt)((0,
M.O)(0, 100)),
title: (0,
M.jt)(M.Z_)
}))
})
}, st = function(e, t, n, r) {
switch (ke.eG[e]) {
case ke.uN.card:
var a = Xe(be(t));
if ("linkInCardPaymentData"in a)
return {
type: "link_in_card_payment_data",
data: a.linkInCardPaymentData
};
var i = a.card
, o = a.legacyOwner
, s = n && n.length ? ve(n) : void 0
, u = r ? {
networks: {
preferred: r
}
} : null;
return {
data: {
card: (0,
b.Z)((0,
b.Z)((0,
b.Z)({}, i), o), u)
},
pastedFields: s,
type: ke.uN.card,
warnings: []
};
case ke.uN.bank_account:
return {
data: {
bank_account: t[e] ? {
account_number: Ye(t[e]),
country: t[e].slice(0, 2)
} : {}
},
type: "bank_account",
warnings: []
};
default:
throw new Error("No corresponding token type for this Element: ".concat(e, "."))
}
}, ut = function(e, t, n) {
if ("apple_pay" === e) {
var r = t.token
, a = t.currencyCode
, i = t.total
, o = r;
if ("simulated identifier" === o.transactionIdentifier.toLowerCase()) {
var s = "4242424242424242"
, u = i && i.amount ? i.amount : "0"
, l = a ? a.toLowerCase() : "usd";
o = (0,
b.Z)((0,
b.Z)({
paymentData: ""
}, o), {}, {
cardNumber: s,
transactionIdentifier: "ApplePayStubs~".concat(s, "~").concat(u, "~").concat(l, "~").concat(Math.random().toString(36).slice(-10))
})
}
return {
type: ke.uN.card,
data: {
pk_token: JSON.stringify(o.paymentData),
pk_token_transaction_id: o.transactionIdentifier,
pk_token_payment_network: o.paymentMethod.network,
pk_token_instrument_name: o.paymentMethod.displayName,
card: t.billingContact ? et(t.billingContact) : {}
},
warnings: []
}
}
var c, d, p, m = (0,
M.Gu)(M.kw.apply(void 0, (0,
Z.Z)(Object.keys(ot))), e, "token type").value, f = (0,
M.Gu)((d = tt,
p = ot[c = m],
(0,
M.mC)((0,
b.Z)((0,
b.Z)((0,
b.Z)({}, d), p), {}, (0,
v.Z)({}, c, (0,
M.jt)((0,
M.mC)(p)))))), t, "token creation parameter", {
element: n
}), h = f.value || {}, _ = h[e], y = Object.keys(ot[m]), g = (0,
b.Z)((0,
v.Z)({}, m, (0,
b.Z)((0,
b.Z)({}, (0,
O.ei)(h, y)), _)), (0,
O.CE)(h, [].concat(y, [e])));
return {
type: e,
data: (0,
O.TS)({}, g),
warnings: f.warnings
}
}, lt = (0,
E.Z)((function e() {
var t = this;
(0,
C.Z)(this, e),
this.isPassiveCaptchaEnabled = !1,
this.isPassiveCaptchaInitialized = !1,
this._integrationManager = {
elements: {
_siteKey: null,
rqdata: void 0
},
link: {
_siteKey: null,
rqdata: void 0
}
},
this._setSiteKey = function(e, n) {
var r;
(r = t._integrationManager[e])._siteKey || (r._siteKey = n)
}
,
this.setSiteKey = function(e, n) {
t.isPassiveCaptchaEnabled || (t.isPassiveCaptchaEnabled = !0),
t._setSiteKey(e, n)
}
,
this.getSiteKey = function(e) {
return t._integrationManager[e]._siteKey
}
,
this.setRqdata = function(e, n) {
t._integrationManager[e].rqdata = n
}
,
this.getRqdata = function(e) {
return t._integrationManager[e].rqdata
}
}
)), ct = n(56274).Promise, dt = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
var n, r, a, i, o;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
if (r = t.slug,
a = t.siteKey,
i = t.getCaptchaToken,
a && pt.has(r)) {
e.next = 3;
break
}
return e.abrupt("return", null);
case 3:
return e.next = 5,
mt;
case 5:
return mt = i(a),
e.next = 8,
mt;
case 8:
return o = e.sent,
e.abrupt("return", null !== (n = null == o ? void 0 : o.response) && void 0 !== n ? n : null);
case 10:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t) {
return e.apply(this, arguments)
}
}(), pt = new Set(["tokenize", "create_source", "create_payment_method", "create_confirmation_token", "confirm_payment_intent", "confirm_setup_intent", "link_sign_up", "update_payment_intent"]), mt = ct.resolve(null), ft = function(e, t) {
if (e.isPassiveCaptchaEnabled && !e.isPassiveCaptchaInitialized) {
var n = e.getSiteKey("elements");
n && t.sendMessageToParent({
action: "stripe-init-passive-captcha",
payload: {
siteKey: n,
rqdata: e.getRqdata("elements")
}
});
var r = e.getSiteKey("link")
, a = e.getRqdata("link") || null;
r && t.sendMessageToParent({
action: "stripe-init-link-passive-captcha",
payload: {
linkSiteKey: r,
linkRqdata: a
}
}),
e.isPassiveCaptchaInitialized = !0
}
}, ht = function(e, t) {
return e && "paymentRequestButton" !== e && "card" === t
}, _t = n(66680), yt = function(e) {
var t = e.elementName
, n = e.mids
, r = e.usesLink;
return t ? {
element: t,
usesLink: r,
hasValidMids: (0,
_t.x5)(n)
} : {}
}, vt = n(48229), gt = n(11937), bt = ["credentials", "auth_session_client_secret"], St = ["FAIL", "UNAVAILABLE", "UNCHECKED", "STATE_INVALID"], kt = ["CARD", "BANK_ACCOUNT", "KLARNA"], Ct = function(e) {
return e.filter((function(e) {
var t;
return !e.metadata || (null === (t = e.metadata) || void 0 === t ? void 0 : t.active)
}
))
}, Et = function(e, t) {
var n = t.map((function(e) {
return vt.uB[e]
}
));
return e.filter((function(e) {
var r = -1 !== n.indexOf(e.type)
, a = function(e, t) {
return -1 !== t.indexOf("INSTANT_DEBITS") ? function(e) {
var t;
return !1 !== (null === (t = e.bank_account_details) || void 0 === t ? void 0 : t.is_instant_debits_eligible)
}(e) : -1 === t.indexOf("US_BANK_ACCOUNT") || function(e) {
var t;
return !(null !== (t = e.bank_account_details) && void 0 !== t && t.is_networking_share_disabled)
}(e)
}(e, t);
return r && a
}
))
}, Zt = function(e, t) {
switch (e) {
case "CARD":
return vt.yT.Card;
case "BANK_ACCOUNT":
return "LINK_CARD_BRAND" === t ? vt.yT.Card : vt.yT.BankAccount;
case "KLARNA":
return vt.yT.Klarna;
case null:
case "PAYMENT_DETAILS_TYPE_INVALID":
return null;
default:
return (0,
P.Rz)(e)
}
}, At = function(e) {
var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "full";
return "plan" === t ? e.filter((function(e) {
return (0,
vt.Az)(e.type)
}
)) : e.filter((function(e) {
return !(0,
vt.Az)(e.type)
}
))
}, Mt = function(e, t) {
var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : "full"
, r = Ct(e)
, a = Et(r, t)
, i = At(a, n);
return i.length > 0 ? i[0] : null
}, Pt = function(e, t) {
var n, r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : "full";
return (null === (n = Mt(e, t, r)) || void 0 === n ? void 0 : n.id) || null
}, xt = function(e) {
return e.length > 0 ? e[0] : null
}, It = function(e) {
var t = e.country
, n = e.postalCode
, r = e.options
, a = void 0 === r ? {} : r
, i = e.checks
, o = t && function(e) {
return -1 !== V.UQ.indexOf(e)
}(t);
return "FAIL" === (null == i ? void 0 : i.address_postal_code_check) ? "postal_code_recollection_required_check_failed" : o && a.errorOnMissing && !n ? "postal_code_recollection_required_missing_required_postal_code" : null
}, Nt = function(e) {
var t = e.name;
return !e.requireName || t && "" !== t.trim() ? null : "incomplete_name"
}, wt = function(e) {
var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}
, n = arguments.length > 2 ? arguments[2] : void 0;
if (null == n)
return null;
var r = t.reverifyPaymentMethod
, a = void 0 !== r && r;
return a && e || n.cvc_check && St.indexOf(n.cvc_check.toUpperCase()) >= 0 ? "cvc_recollection_required" : null
}, Tt = function(e) {
var t = e.exp_year
, n = e.exp_month;
return t && n ? {
year: t < 100 ? t + 2e3 : t,
month: n
} : null
}, Ot = function(e) {
return e.some((function(e) {
return "VERIFIED" === e.state
}
))
}, Rt = {
AC: {
country: "AC",
fmt: "%N%n%O%n%A%n%C%n%Z",
zip: "ASCN 1ZZ",
zipex: "ASCN 1ZZ"
},
AD: {
country: "AD",
lang: "ca",
fmt: "%N%n%O%n%A%n%Z %C",
sub_keys: ["Parròquia d'Andorra la Vella", "Canillo", "Encamp", "Escaldes-Engordany", "La Massana", "Ordino", "Sant Julià de Lòria"],
sub_labels: ["Andorra la Vella", "Canillo", "Encamp", "Escaldes-Engordany", "La Massana", "Ordino", "Sant Julià de Lòria"],
sub_zips: "AD50[01]~AD10[01]~AD20[01]~AD70[01]~AD40[01]~AD30[01]~AD60[01]",
zip: "AD[1-7]0\\d",
zipex: "AD100,AD501,AD700"
},
AE: {
country: "AE",
lang: "ar",
require: "AS",
fmt: "%N%n%O%n%A%n%S",
state_name_type: "emirate",
sub_keys: ["أبو ظبي", "إمارة الشارقةّ", "الفجيرة", "ام القيوين", "إمارة دبيّ", "إمارة رأس الخيمة", "عجمان"],
sub_labels: ["أبو ظبي — Abu Dhabi", "الشارقة — Sharjah", "الفجيرة — Fujairah", "ام القيوين — Umm Al Quwain", "دبي — Dubai", "رأس الخيمة — Ras al Khaimah", "عجمان — Ajman"],
sub_latin_names: ["Abu Dhabi", "Sharjah", "Fujairah", "Umm Al Quwain", "Dubai", "Ras al Khaimah", "Ajman"]
},
AF: {
country: "AF",
fmt: "%N%n%O%n%A%n%C%n%Z",
zip: "\\d{4}",
zipex: "1001,2601,3801"
},
AG: {
country: "AG",
require: "A"
},
AI: {
country: "AI",
fmt: "%N%n%O%n%A%n%C%n%Z",
zip: "(?:AI-)?2640",
zipex: "2640"
},
AL: {
country: "AL",
fmt: "%N%n%O%n%A%n%Z%n%C",
zip: "\\d{4}",
zipex: "1001,1017,3501"
},
AM: {
country: "AM",
lang: "hy",
fmt: "%N%n%O%n%A%n%Z%n%C%n%S",
sub_keys: ["Արագածոտն", "Արարատ", "Արմավիր", "Գեղարքունիք", "Երևան", "Լոռի", "Կոտայք", "Շիրակ", "Սյունիք", "Վայոց ձոր", "Տավուշ"],
sub_labels: ["Արագածոտն — Aragatsotn", "Արարատ — Ararat", "Արմավիր — Armavir", "Գեղարքունիք — Gegharkunik", "Երևան — Yerevan", "Լոռի — Lori", "Կոտայք — Kotayk", "Շիրակ — Shirak", "Սյունիք — Syunik", "Վայոց ձոր — Vayots Dzor", "Տավուշ — Tavush"],
sub_latin_names: ["Aragatsotn", "Ararat", "Armavir", "Gegharkunik", "Yerevan", "Lori", "Kotayk", "Shirak", "Syunik", "Vayots Dzor", "Tavush"],
sub_zips: "0[2-5]~0[6-8]~09|1[01]~1[2-6]~00~1[7-9]|2[01]~2[2-5]~2[6-9]|3[01]~3[2-5]~3[6-8]~39|4[0-2]",
zip: "(?:37)?\\d{4}",
zipex: "375010,0002,0010"
},
AO: {
country: "AO"
},
AQ: {
country: "AQ"
},
AR: {
country: "AR",
lang: "es",
fmt: "%N%n%O%n%A%n%Z %C%n%S",
sub_keys: ["Buenos Aires", "Catamarca", "Chaco", "Chubut", "Ciudad Autónoma de Buenos Aires", "Córdoba", "Corrientes", "Entre Ríos", "Formosa", "Jujuy", "La Pampa", "La Rioja", "Mendoza", "Misiones", "Neuquén", "Río Negro", "Salta", "San Juan", "San Luis", "Santa Cruz", "Santa Fe", "Santiago del Estero", "Tierra del Fuego", "Tucumán"],
sub_labels: ["Buenos Aires", "Catamarca", "Chaco", "Chubut", "Ciudad Autónoma de Buenos Aires", "Córdoba", "Corrientes", "Entre Ríos", "Formosa", "Jujuy", "La Pampa", "La Rioja", "Mendoza", "Misiones", "Neuquén", "Río Negro", "Salta", "San Juan", "San Luis", "Santa Cruz", "Santa Fe", "Santiago del Estero", "Tierra del Fuego", "Tucumán"],
sub_zips: "B?[1-36-8]~K?[45]~H?3~U?[89]~C?1~X?[235-8]~W?3~E?[1-3]~P?[37]~Y?4~L?[3568]~F?5~M?[56]~N?3~Q?[38]~R?[89]~A?[34]~J?5~D?[4-6]~Z?[89]~S?[2368]~G?[2-5]~V?9~T?[45]",
zip: "((?:[A-HJ-NP-Z])?\\d{4})([A-Z]{3})?",
zipex: "C1070AAM,C1000WAM,B1000TBU,X5187XAB"
},
AT: {
country: "AT",
require: "ACZ",
fmt: "%O%n%N%n%A%n%Z %C",
zip: "\\d{4}",
zipex: "1010,3741"
},
AU: {
country: "AU",
lang: "en",
require: "ACSZ",
fmt: "%O%n%N%n%A%n%C %S %Z",
locality_name_type: "suburb",
state_name_type: "state",
sub_keys: ["ACT", "JBT", "NSW", "NT", "QLD", "SA", "TAS", "VIC", "WA"],
sub_labels: ["Australian Capital Territory", "Jervis Bay Territory", "New South Wales", "Northern Territory", "Queensland", "South Australia", "Tasmania", "Victoria", "Western Australia"],
sub_zips: "29|2540|260|261[0-8]|02|2620~2540~1|2[0-57-8]|26[2-9]|261[189]|3500|358[56]|3644|3707~0[89]~[49]~5|0872~7~[38]~6|0872",
zip: "\\d{4}",
zipex: "2060,3171,6430,4000,4006,3001"
},
AW: {
country: "AW"
},
AX: {
country: "AX",
require: "ACZ",
fmt: "%O%n%N%n%A%nAX-%Z %C%nÅLAND",
zip: "22\\d{3}",
zipex: "22150,22550,22240,22710,22270,22730,22430"
},
AZ: {
country: "AZ",
fmt: "%N%n%O%n%A%nAZ %Z %C",
zip: "\\d{4}",
zipex: "1000"
},
BA: {
country: "BA",
fmt: "%N%n%O%n%A%n%Z %C",
zip: "\\d{5}",
zipex: "71000"
},
BB: {
country: "BB",
fmt: "%N%n%O%n%A%n%C, %S %Z",
state_name_type: "parish",
sub_keys: ["Christ Church", "Saint Andrew", "Saint George", "Saint James", "Saint John", "Saint Joseph", "Saint Lucy", "Saint Michael", "Saint Peter", "Saint Philip", "Saint Thomas"],
zip: "BB\\d{5}",
zipex: "BB23026,BB22025"
},
BD: {
country: "BD",
fmt: "%N%n%O%n%A%n%C - %Z",
zip: "\\d{4}",
zipex: "1340,1000"
},
BE: {
country: "BE",
require: "ACZ",
fmt: "%O%n%N%n%A%n%Z %C",
zip: "\\d{4}",
zipex: "4000,1000"
},
BF: {
country: "BF",
fmt: "%N%n%O%n%A%n%C %X"
},
BG: {
country: "BG",
fmt: "%N%n%O%n%A%n%Z %C",
zip: "\\d{4}",
zipex: "1000,1700"
},
BH: {
country: "BH",
fmt: "%N%n%O%n%A%n%C %Z",
zip: "(?:^|\\b)(?:1[0-2]|[1-9])\\d{2}(?:$|\\b)",
zipex: "317"
},
BI: {
country: "BI"
},
BJ: {
country: "BJ"
},
BL: {
country: "BL",
require: "ACZ",
fmt: "%O%n%N%n%A%n%Z %C %X",
zip: "9[78][01]\\d{2}",
zipex: "97100"
},
BM: {
country: "BM",
fmt: "%N%n%O%n%A%n%C %Z",
zip: "[A-Z]{2} ?[A-Z0-9]{2}",
zipex: "FL 07,HM GX,HM 12"
},
BN: {
country: "BN",
fmt: "%N%n%O%n%A%n%C %Z",
zip: "[A-Z]{2} ?\\d{4}",
zipex: "BT2328,KA1131,BA1511"
},
BO: {
country: "BO"
},
BQ: {
country: "BQ"
},
BR: {
country: "BR",
lang: "pt",
require: "ASCZ",
fmt: "%O%n%N%n%A%n%D%n%C-%S%n%Z",
sublocality_name_type: "neighborhood",
state_name_type: "state",
sub_keys: ["AC", "AL", "AP", "AM", "BA", "CE", "DF", "ES", "GO", "MA", "MT", "MS", "MG", "PA", "PB", "PR", "PE", "PI", "RJ", "RN", "RS", "RO", "RR", "SC", "SP", "SE", "TO"],
sub_labels: ["Acre", "Alagoas", "Amapá", "Amazonas", "Bahia", "Ceará", "Distrito Federal", "Espírito Santo", "Goiás", "Maranhão", "Mato Grosso", "Mato Grosso do Sul", "Minas Gerais", "Pará", "Paraíba", "Paraná", "Pernambuco", "Piauí", "Rio de Janeiro", "Rio Grande do Norte", "Rio Grande do Sul", "Rondônia", "Roraima", "Santa Catarina", "São Paulo", "Sergipe", "Tocantins"],
sub_zips: "699~57~689~69[0-24-8]~4[0-8]~6[0-3]~7[0-1]|72[0-7]|73[0-6]~29~72[89]|73[7-9]|7[4-6]~65~78[0-8]~79~3~6[6-7]|68[0-8]~58~8[0-7]~5[0-6]~64~2[0-8]~59~9~76[89]|789~693~8[89]~[01][1-9]~49~77",
zip: "\\d{5}-?\\d{3}",
zipex: "40301-110,70002-900"
},
BS: {
country: "BS",
lang: "en",
fmt: "%N%n%O%n%A%n%C, %S",
state_name_type: "island",
sub_keys: ["Abaco", "Acklins", "Andros", "Berry Islands", "Bimini", "Cat Island", "Crooked Island", "Eleuthera", "Exuma", "Grand Bahama", "Harbour Island", "Inagua", "Long Island", "Mayaguana", "N.P.", "Ragged Island", "Rum Cay", "San Salvador", "Spanish Wells"],
sub_labels: ["Abaco Islands", "Acklins", "Andros Island", "Berry Islands", "Bimini", "Cat Island", "Crooked Island", "Eleuthera", "Exuma and Cays", "Grand Bahama", "Harbour Island", "Inagua", "Long Island", "Mayaguana", "New Providence", "Ragged Island", "Rum Cay", "San Salvador", "Spanish Wells"]
},
BT: {
country: "BT",
fmt: "%N%n%O%n%A%n%C %Z",
zip: "\\d{5}",
zipex: "11001,31101,35003"
},
BV: {
country: "BV"
},
BW: {
country: "BW"
},
BY: {
country: "BY",
fmt: "%O%n%N%n%A%n%Z, %C%n%S",
state_name_type: "oblast",
sub_keys: ["Brestskaya oblast'", "Gomel'skaya oblast'", "Grodnenskaya oblast'", "Mogilevskaya oblast'", "Minskaya oblast'", "Vitebskaya oblast'", "Gorod Minsk"],
zip: "\\d{6}",
zipex: "223016,225860,220050"
},
BZ: {
country: "BZ"
},
CA: {
country: "CA",
lang: "en",
require: "ACSZ",
fmt: "%N%n%O%n%A%n%C %S %Z",
sub_keys: ["AB", "BC", "MB", "NB", "NL", "NT", "NS", "NU", "ON", "PE", "QC", "SK", "YT"],
sub_labels: ["Alberta", "British Columbia", "Manitoba", "New Brunswick", "Newfoundland and Labrador", "Northwest Territories", "Nova Scotia", "Nunavut", "Ontario", "Prince Edward Island", "Quebec", "Saskatchewan", "Yukon"],
sub_zips: "T~V~R~E~A~X0E|X0G|X1A~B~X0A|X0B|X0C~K|L|M|N|P~C~G|H|J|K1A~S|R8A~Y",
zip: "[ABCEGHJKLMNPRSTVXY]\\d[ABCEGHJ-NPRSTV-Z] ?\\d[ABCEGHJ-NPRSTV-Z]\\d",
zipex: "H3Z 2Y7,V8X 3X4,T0L 1K0,T0H 1A0,K1A 0B1"
},
CD: {
country: "CD"
},
CF: {
country: "CF"
},
CG: {
country: "CG"
},
CH: {
country: "CH",
require: "ACZ",
fmt: "%O%n%N%n%A%nCH-%Z %C",
zip: "\\d{4}",
zipex: "2544,1211,1556,3030"
},
CI: {
country: "CI",
fmt: "%N%n%O%n%X %A %C %X"
},
CK: {
country: "CK"
},
CL: {
country: "CL",
lang: "es",
fmt: "%N%n%O%n%A%n%Z %C%n%S",
sub_keys: ["Antofagasta", "Araucanía", "Arica y Parinacota", "Atacama", "Aysén", "Biobío", "Coquimbo", "O'Higgins", "Los Lagos", "Los Ríos", "Magallanes", "Maule", "Región Metropolitana", "Ñuble", "Tarapacá", "Valparaíso"],
sub_labels: ["Antofagasta", "Araucanía", "Arica y Parinacota", "Atacama", "Aysén del General Carlos Ibáñez del Campo", "Biobío", "Coquimbo", "Libertador General Bernardo O'Higgins", "Los Lagos", "Los Ríos", "Magallanes y de la Antártica Chilena", "Maule", "Metropolitana de Santiago", "Ñuble", "Tarapacá", "Valparaíso"],
zip: "\\d{7}",
zipex: "8340457,8720019,1230000,8329100"
},
CM: {
country: "CM"
},
CN: {
country: "CN",
lang: "zh",
require: "ACSZ",
fmt: "%Z%n%S%C%D%n%A%n%O%n%N",
sublocality_name_type: "district",
sub_keys: ["安徽省", "澳门", "北京市", "重庆市", "福建省", "甘肃省", "广东省", "广西壮族自治区", "贵州省", "海南省", "河北省", "河南省", "黑龙江省", "湖北省", "湖南省", "吉林省", "江苏省", "江西省", "辽宁省", "内蒙古自治区", "宁夏回族自治区", "青海省", "山东省", "山西省", "陕西省", "上海市", "四川省", "台湾", "天津市", "西藏自治区", "香港", "新疆维吾尔自治区", "云南省", "浙江省"],
sub_labels: ["安徽省 — Anhui Sheng", "澳门 — Macau", "北京市 — Beijing Shi", "重庆市 — Chongqing Shi", "福建省 — Fujian Sheng", "甘肃省 — Gansu Sheng", "广东省 — Guangdong Sheng", "广西 — Guangxi Zhuangzuzizhiqu", "贵州省 — Guizhou Sheng", "海南省 — Hainan Sheng", "河北省 — Hebei Sheng", "河南省 — Henan Sheng", "黑龙江省 — Heilongjiang Sheng", "湖北省 — Hubei Sheng", "湖南省 — Hunan Sheng", "吉林省 — Jilin Sheng", "江苏省 — Jiangsu Sheng", "江西省 — Jiangxi Sheng", "辽宁省 — Liaoning Sheng", "内蒙古 — Neimenggu Zizhiqu", "宁夏 — Ningxia Huizuzizhiqu", "青海省 — Qinghai Sheng", "山东省 — Shandong Sheng", "山西省 — Shanxi Sheng", "陕西省 — Shaanxi Sheng", "上海市 — Shanghai Shi", "四川省 — Sichuan Sheng", "台湾 — Taiwan", "天津市 — Tianjin Shi", "西藏 — Xizang Zizhiqu", "香港 — Hong Kong", "新疆 — Xinjiang Weiwuerzizhiqu", "云南省 — Yunnan Sheng", "浙江省 — Zhejiang Sheng"],
sub_latin_names: ["Anhui Sheng", "Macau", "Beijing Shi", "Chongqing Shi", "Fujian Sheng", "Gansu Sheng", "Guangdong Sheng", "Guangxi Zhuangzuzizhiqu", "Guizhou Sheng", "Hainan Sheng", "Hebei Sheng", "Henan Sheng", "Heilongjiang Sheng", "Hubei Sheng", "Hunan Sheng", "Jilin Sheng", "Jiangsu Sheng", "Jiangxi Sheng", "Liaoning Sheng", "Neimenggu Zizhiqu", "Ningxia Huizuzizhiqu", "Qinghai Sheng", "Shandong Sheng", "Shanxi Sheng", "Shaanxi Sheng", "Shanghai Shi", "Sichuan Sheng", "Taiwan", "Tianjin Shi", "Xizang Zizhiqu", "Hong Kong", "Xinjiang Weiwuerzizhiqu", "Yunnan Sheng", "Zhejiang Sheng"],
zip: "\\d{6}",
zipex: "266033,317204,100096,100808"
},
CO: {
country: "CO",
lang: "es",
require: "AS",
fmt: "%N%n%O%n%A%n%D%n%C, %S, %Z",
state_name_type: "department",
sub_keys: ["DC", "AMA", "ANT", "ARA", "ATL", "BOL", "BOY", "CAL", "CAQ", "CAS", "CAU", "CES", "COR", "CUN", "CHO", "GUA", "GUV", "HUI", "LAG", "MAG", "MET", "NAR", "NSA", "PUT", "QUI", "RIS", "SAP", "SAN", "SUC", "TOL", "VAC", "VAU", "VID"],
sub_labels: ["Distrito Capital de Bogotá", "Amazonas", "Antioquia", "Arauca", "Atlántico", "Bolívar", "Boyacá", "Caldas", "Caquetá", "Casanare", "Cauca", "Cesar", "Córdoba", "Cundinamarca", "Chocó", "Guainía", "Guaviare", "Huila", "La Guajira", "Magdalena", "Meta", "Nariño", "Norte de Santander", "Putumayo", "Quindío", "Risaralda", "San Andrés, Providencia y Santa Catalina", "Santander", "Sucre", "Tolima", "Valle del Cauca", "Vaupés", "Vichada"],
zip: "\\d{6}",
zipex: "111221,130001,760011"
},
CR: {
country: "CR",
require: "ACS",
fmt: "%N%n%O%n%A%n%S, %C%n%Z",
sub_keys: ["Alajuela", "Cartago", "Guanacaste", "Heredia", "Limón", "Puntarenas", "San José"],
zip: "\\d{4,5}|\\d{3}-\\d{4}",
zipex: "1000,2010,1001"
},
CV: {
country: "CV",
lang: "pt",
fmt: "%N%n%O%n%A%n%Z %C%n%S",
state_name_type: "island",
sub_keys: ["Boa Vista", "Brava", "Fogo", "Maio", "Sal", "Santiago", "Santo Antão", "São Nicolau", "São Vicente"],
zip: "\\d{4}",
zipex: "7600"
},
CW: {
country: "CW"
},
CY: {
country: "CY",
fmt: "%N%n%O%n%A%n%Z %C",
zip: "\\d{4}",
zipex: "2008,3304,1900"
},
CZ: {
country: "CZ",
require: "ACZ",
fmt: "%N%n%O%n%A%n%Z %C",
zip: "\\d{3} ?\\d{2}",
zipex: "100 00,251 66,530 87,110 00,225 99"
},
DE: {
country: "DE",
require: "ACZ",
fmt: "%N%n%O%n%A%n%Z %C",
zip: "\\d{5}",
zipex: "26133,53225"
},
DJ: {
country: "DJ"
},
DK: {
country: "DK",
require: "ACZ",
fmt: "%N%n%O%n%A%n%Z %C",
zip: "\\d{4}",
zipex: "8660,1566"
},
DM: {
country: "DM"
},
DO: {
country: "DO",
fmt: "%N%n%O%n%A%n%Z %C",
zip: "\\d{5}",
zipex: "11903,10101"
},
DZ: {
country: "DZ",
fmt: "%N%n%O%n%A%n%Z %C",
zip: "\\d{5}",
zipex: "40304,16027"
},
EC: {
country: "EC",
fmt: "%N%n%O%n%A%n%Z%n%C",
zip: "\\d{6}",
zipex: "090105,092301"
},
EE: {
country: "EE",
require: "ACZ",
fmt: "%N%n%O%n%A%n%Z %C %S",
zip: "\\d{5}",
zipex: "69501,11212"
},
EG: {
country: "EG",
lang: "ar",
fmt: "%N%n%O%n%A%n%C%n%S%n%Z",
sub_keys: ["أسوان", "أسيوط", "الإسكندرية", "الإسماعيلية", "الأقصر", "البحر الأحمر", "البحيرة", "الجيزة", "الدقهلية", "السويس", "الشرقية", "الغربية", "الفيوم", "القاهرة", "القليوبية", "المنوفية", "المنيا", "الوادي الجديد", "بني سويف", "بورسعيد", "جنوب سيناء", "دمياط", "سوهاج", "شمال سيناء", "قنا", "كفر الشيخ", "مطروح"],
sub_labels: ["أسوان — Aswan Governorate", "أسيوط — Asyut Governorate", "الإسكندرية — Alexandria Governorate", "الإسماعيلية — Ismailia Governorate", "الأقصر — Luxor Governorate", "البحر الأحمر — Red Sea Governorate", "البحيرة — El Beheira Governorate", "الجيزة — Giza Governorate", "الدقهلية — Dakahlia Governorate", "السويس — Suez Governorate", "الشرقية — Ash Sharqia Governorate", "الغربية — Gharbia Governorate", "الفيوم — Faiyum Governorate", "القاهرة — Cairo Governorate", "القليوبية — Qalyubia Governorate", "المنوفية — Menofia Governorate", "المنيا — Menia Governorate", "الوادي الجديد — New Valley Governorate", "بني سويف — Beni Suef Governorate", "بورسعيد — Port Said Governorate", "جنوب سيناء — South Sinai Governorate", "دمياط — Damietta Governorate", "سوهاج — Sohag Governorate", "شمال سيناء — North Sinai Governorate", "قنا — Qena Governorate", "كفر الشيخ — Kafr El Sheikh Governorate", "مطروح — Matrouh Governorate"],
sub_latin_names: ["Aswan Governorate", "Asyut Governorate", "Alexandria Governorate", "Ismailia Governorate", "Luxor Governorate", "Red Sea Governorate", "El Beheira Governorate", "Giza Governorate", "Dakahlia Governorate", "Suez Governorate", "Ash Sharqia Governorate", "Gharbia Governorate", "Faiyum Governorate", "Cairo Governorate", "Qalyubia Governorate", "Menofia Governorate", "Menia Governorate", "New Valley Governorate", "Beni Suef Governorate", "Port Said Governorate", "South Sinai Governorate", "Damietta Governorate", "Sohag Governorate", "North Sinai Governorate", "Qena Governorate", "Kafr El Sheikh Governorate", "Matrouh Governorate"],
sub_zips: "81~71~2[13]~41~85~84~22~12~35~43~44~31~63~11~13~32~61~72~62~42~46~34~82~45~83~33~51",
zip: "\\d{5}",
zipex: "12411,11599"
},
EH: {
country: "EH",
fmt: "%N%n%O%n%A%n%Z %C",
zip: "\\d{5}",
zipex: "70000,72000"
},
ER: {
country: "ER"
},
ES: {
country: "ES",
lang: "es",
require: "ACSZ",
fmt: "%N%n%O%n%A%n%Z %C %S",
sub_keys: ["VI", "AB", "A", "AL", "O", "AV", "BA", "B", "BU", "CC", "CA", "S", "CS", "CE", "CR", "CO", "CU", "GI", "GR", "GU", "SS", "H", "HU", "PM", "J", "C", "LO", "GC", "LE", "L", "LU", "M", "MA", "ML", "MU", "NA", "OR", "P", "PO", "SA", "TF", "SG", "SE", "SO", "T", "TE", "TO", "V", "VA", "BI", "ZA", "Z"],
sub_labels: ["Álava", "Albacete", "Alicante", "Almería", "Asturias", "Ávila", "Badajoz", "Barcelona", "Burgos", "Cáceres", "Cádiz", "Cantabria", "Castellón", "Ceuta", "Ciudad Real", "Córdoba", "Cuenca", "Girona", "Granada", "Guadalajara", "Guipúzcoa", "Huelva", "Huesca", "Islas Baleares", "Jaén", "La Coruña", "La Rioja", "Las Palmas", "León", "Lérida", "Lugo", "Madrid", "Málaga", "Melilla", "Murcia", "Navarra", "Ourense", "Palencia", "Pontevedra", "Salamanca", "Santa Cruz de Tenerife", "Segovia", "Sevilla", "Soria", "Tarragona", "Teruel", "Toledo", "Valencia", "Valladolid", "Vizcaya", "Zamora", "Zaragoza"],
sub_zips: "01~02~03~04~33~05~06~08~09~10~11~39~12~51~13~14~16~17~18~19~20~21~22~07~23~15~26~35~24~25~27~28~29~52~30~31~32~34~36~37~38~40~41~26127|42~43~44~45~46~47~48~49~50",
zip: "\\d{5}",
zipex: "28039,28300,28070"
},
ET: {
country: "ET",
fmt: "%N%n%O%n%A%n%Z %C",
zip: "\\d{4}",
zipex: "1000"
},
FI: {
country: "FI",
require: "ACZ",
fmt: "%O%n%N%n%A%nFI-%Z %C",
zip: "\\d{5}",
zipex: "00550,00011"
},
FJ: {
country: "FJ"
},
FK: {
country: "FK",
require: "ACZ",
fmt: "%N%n%O%n%A%n%C%n%Z",
zip: "FIQQ 1ZZ",
zipex: "FIQQ 1ZZ"
},
FO: {
country: "FO",
fmt: "%N%n%O%n%A%nFO%Z %C",
zip: "\\d{3}",
zipex: "100"
},
FR: {
country: "FR",
require: "ACZ",
fmt: "%O%n%N%n%A%n%Z %C",
zip: "\\d{2} ?\\d{3}",
zipex: "33380,34092,33506"
},
GA: {
country: "GA"
},
GB: {
country: "GB",
require: "ACZ",
fmt: "%N%n%O%n%A%n%C%n%Z",
locality_name_type: "post_town",
zip: "GIR ?0AA|(?:(?:AB|AL|B|BA|BB|BD|BF|BH|BL|BN|BR|BS|BT|BX|CA|CB|CF|CH|CM|CO|CR|CT|CV|CW|DA|DD|DE|DG|DH|DL|DN|DT|DY|E|EC|EH|EN|EX|FK|FY|G|GL|GY|GU|HA|HD|HG|HP|HR|HS|HU|HX|IG|IM|IP|IV|JE|KA|KT|KW|KY|L|LA|LD|LE|LL|LN|LS|LU|M|ME|MK|ML|N|NE|NG|NN|NP|NR|NW|OL|OX|PA|PE|PH|PL|PO|PR|RG|RH|RM|S|SA|SE|SG|SK|SL|SM|SN|SO|SP|SR|SS|ST|SW|SY|TA|TD|TF|TN|TQ|TR|TS|TW|UB|W|WA|WC|WD|WF|WN|WR|WS|WV|YO|ZE)(?:\\d[\\dA-Z]? ?\\d[ABD-HJLN-UW-Z]{2}))|BFPO ?\\d{1,4}",
zipex: "EC1Y 8SY,GIR 0AA,M2 5BQ,M34 4AB,CR0 2YR,DN16 9AA,W1A 4ZZ,EC1A 1HQ,OX14 4PG,BS18 8HF,NR25 7HG,RH6 0NP,BH23 6AA,B6 5BA,SO23 9AP,PO1 3AX,BFPO 61"
},
GD: {
country: "GD"
},
GE: {
country: "GE",
fmt: "%N%n%O%n%A%n%Z %C",
zip: "\\d{4}",
zipex: "0101"
},
GF: {
country: "GF",
require: "ACZ",
fmt: "%O%n%N%n%A%n%Z %C %X",
zip: "9[78]3\\d{2}",
zipex: "97300"
},
GG: {
country: "GG",
require: "ACZ",
fmt: "%N%n%O%n%A%n%C%nGUERNSEY%n%Z",
zip: "GY\\d[\\dA-Z]? ?\\d[ABD-HJLN-UW-Z]{2}",
zipex: "GY1 1AA,GY2 2BT"
},
GH: {
country: "GH"
},
GI: {
country: "GI",
require: "A",
fmt: "%N%n%O%n%A%nGIBRALTAR%n%Z",
zip: "GX11 1AA",
zipex: "GX11 1AA"
},
GL: {
country: "GL",
require: "ACZ",
fmt: "%N%n%O%n%A%n%Z %C",
zip: "39\\d{2}",
zipex: "3900,3950,3911"
},
GM: {
country: "GM"
},
GN: {
country: "GN",
fmt: "%N%n%O%n%Z %A %C",
zip: "\\d{3}",
zipex: "001,200,100"
},
GP: {
country: "GP",
require: "ACZ",
fmt: "%O%n%N%n%A%n%Z %C %X",
zip: "9[78][01]\\d{2}",
zipex: "97100"
},
GQ: {
country: "GQ"
},
GR: {
country: "GR",
require: "ACZ",
fmt: "%N%n%O%n%A%n%Z %C",
zip: "\\d{3} ?\\d{2}",
zipex: "151 24,151 10,101 88"
},
GS: {
country: "GS",
require: "ACZ",
fmt: "%N%n%O%n%A%n%n%C%n%Z",
zip: "SIQQ 1ZZ",
zipex: "SIQQ 1ZZ"
},
GT: {
country: "GT",
fmt: "%N%n%O%n%A%n%Z- %C",
zip: "\\d{5}",
zipex: "09001,01501"
},
GU: {
country: "GU",
require: "ACZ",
fmt: "%N%n%O%n%A%n%C %Z",
zip_name_type: "zip",
zip: "(969(?:[12]\\d|3[12]))(?:[ \\-](\\d{4}))?",
zipex: "96910,96931"
},
GW: {
country: "GW",
fmt: "%N%n%O%n%A%n%Z %C",
zip: "\\d{4}",
zipex: "1000,1011"
},
GY: {
country: "GY"
},
HK: {
country: "HK",
lang: "zh-Hant",
require: "AS",
fmt: "%S%n%C%n%A%n%O%n%N",
locality_name_type: "district",
state_name_type: "area",
sub_keys: ["Kowloon", "Hong Kong", "New Territories"],
sub_labels: ["九龍 — Kowloon", "香港島 — Hong Kong", "新界 — New Territories"],
sub_latin_names: ["Kowloon", "Hong Kong", "New Territories"]
},
HN: {
country: "HN",
require: "ACS",
fmt: "%N%n%O%n%A%n%C, %S%n%Z",
state_name_type: "department",
sub_keys: ["Atlántida", "Choluteca", "Colón", "Comayagua", "Copán", "Cortés", "El Paraíso", "Francisco Morazán", "Gracias a Dios", "Intibucá", "Islas de la Bahía", "La Paz", "Lempira", "Ocotepeque", "Olancho", "Santa Bárbara", "Valle", "Yoro"],
zip: "\\d{5}",
zipex: "31301"
},
HR: {
country: "HR",
fmt: "%N%n%O%n%A%nHR-%Z %C",
zip: "\\d{5}",
zipex: "10000,21001,10002"
},
HT: {
country: "HT",
fmt: "%N%n%O%n%A%nHT%Z %C",
zip: "\\d{4}",
zipex: "6120,5310,6110,8510"
},
HU: {
country: "HU",
require: "ACZ",
fmt: "%N%n%O%n%C%n%A%n%Z",
zip: "\\d{4}",
zipex: "1037,2380,1540"
},
ID: {
country: "ID",
lang: "id",
require: "AS",
fmt: "%N%n%O%n%A%n%C%n%S %Z",
sub_keys: ["Aceh", "Bali", "Banten", "Bengkulu", "Daerah Istimewa Yogyakarta", "DKI Jakarta", "Gorontalo", "Jambi", "Jawa Barat", "Jawa Tengah", "Jawa Timur", "Kalimantan Barat", "Kalimantan Selatan", "Kalimantan Tengah", "Kalimantan Timur", "Kalimantan Utara", "Kepulauan Bangka Belitung", "Kepulauan Riau", "Lampung", "Maluku", "Maluku Utara", "Nusa Tenggara Barat", "Nusa Tenggara Timur", "Papua", "Papua Barat", "Riau", "Sulawesi Barat", "Sulawesi Selatan", "Sulawesi Tengah", "Sulawesi Tenggara", "Sulawesi Utara", "Sumatera Barat", "Sumatera Selatan", "Sumatera Utara"],
sub_labels: ["Aceh — Aceh", "Bali — Bali", "Banten — Banten", "Bengkulu — Bengkulu", "Daerah Istimewa Yogyakarta — Special Region of Yogyakarta", "DKI Jakarta — Jakarta", "Gorontalo — Gorontalo", "Jambi — Jambi", "Jawa Barat — West Java", "Jawa Tengah — Central Java", "Jawa Timur — East Java", "Kalimantan Barat — West Kalimantan", "Kalimantan Selatan — South Kalimantan", "Kalimantan Tengah — Central Kalimantan", "Kalimantan Timur — East Kalimantan", "Kalimantan Utara — North Kalimantan", "Kepulauan Bangka Belitung — Bangka Belitung Islands", "Kepulauan Riau — Riau Islands", "Lampung — Lampung", "Maluku — Maluku", "Maluku Utara — North Maluku", "Nusa Tenggara Barat — West Nusa Tenggara", "Nusa Tenggara Timur — East Nusa Tenggara", "Papua — Papua", "Papua Barat — West Papua", "Riau — Riau", "Sulawesi Barat — West Sulawesi", "Sulawesi Selatan — South Sulawesi", "Sulawesi Tengah — Central Sulawesi", "Sulawesi Tenggara — South East Sulawesi", "Sulawesi Utara — North Sulawesi", "Sumatera Barat — West Sumatra", "Sumatera Selatan — South Sumatra", "Sumatera Utara — North Sumatra"],
sub_latin_names: ["Aceh", "Bali", "Banten", "Bengkulu", "Special Region of Yogyakarta", "Jakarta", "Gorontalo", "Jambi", "West Java", "Central Java", "East Java", "West Kalimantan", "South Kalimantan", "Central Kalimantan", "East Kalimantan", "North Kalimantan", "Bangka Belitung Islands", "Riau Islands", "Lampung", "Maluku", "North Maluku", "West Nusa Tenggara", "East Nusa Tenggara", "Papua", "West Papua", "Riau", "West Sulawesi", "South Sulawesi", "Central Sulawesi", "South East Sulawesi", "North Sulawesi", "West Sumatra", "South Sumatra", "North Sumatra"],
zip: "\\d{5}",
zipex: "40115"
},
IE: {
country: "IE",
lang: "en",
require: "ACS",
fmt: "%N%n%O%n%A%n%D%n%C%n%S%n%Z",
sublocality_name_type: "townland",
state_name_type: "county",
zip_name_type: "eircode",
sub_keys: ["County Carlow", "County Cavan", "County Clare", "County Cork", "County Donegal", "County Dublin", "County Galway", "County Kerry", "County Kildare", "County Kilkenny", "County Laois", "County Leitrim", "County Limerick", "County Longford", "County Louth", "County Mayo", "County Meath", "County Monaghan", "County Offaly", "County Roscommon", "County Sligo", "County Tipperary", "County Waterford", "County Westmeath", "County Wexford", "County Wicklow"],
zip: "[\\dA-Z]{3} ?[\\dA-Z]{4}",
zipex: "A65 F4E2"
},
IL: {
country: "IL",
fmt: "%N%n%O%n%A%n%C %Z",
zip: "\\d{5}(?:\\d{2})?",
zipex: "9614303"
},
IM: {
country: "IM",
require: "ACZ",
fmt: "%N%n%O%n%A%n%C%n%Z",
zip: "IM\\d[\\dA-Z]? ?\\d[ABD-HJLN-UW-Z]{2}",
zipex: "IM2 1AA,IM99 1PS"
},
IN: {
country: "IN",
lang: "en",
require: "ACSZ",
fmt: "%N%n%O%n%A%n%C %Z%n%S",
state_name_type: "state",
zip_name_type: "pin",
sub_keys: ["Andaman and Nicobar Islands", "Andhra Pradesh", "Arunachal Pradesh", "Assam", "Bihar", "Chandigarh", "Chhattisgarh", "Dadra and Nagar Haveli and Daman and Diu", "Delhi", "Goa", "Gujarat", "Haryana", "Himachal Pradesh", "Jammu and Kashmir", "Jharkhand", "Karnataka", "Kerala", "Ladakh", "Lakshadweep", "Madhya Pradesh", "Maharashtra", "Manipur", "Meghalaya", "Mizoram", "Nagaland", "Odisha", "Puducherry", "Punjab", "Rajasthan", "Sikkim", "Tamil Nadu", "Telangana", "Tripura", "Uttar Pradesh", "Uttarakhand", "West Bengal"],
sub_labels: ["Andaman & Nicobar", "Andhra Pradesh", "Arunachal Pradesh", "Assam", "Bihar", "Chandigarh", "Chhattisgarh", "Dadra & Nagar Haveli & Daman & Diu", "Delhi", "Goa", "Gujarat", "Haryana", "Himachal Pradesh", "Jammu & Kashmir", "Jharkhand", "Karnataka", "Kerala", "Ladakh", "Lakshadweep", "Madhya Pradesh", "Maharashtra", "Manipur", "Meghalaya", "Mizoram", "Nagaland", "Odisha", "Puducherry", "Punjab", "Rajasthan", "Sikkim", "Tamil Nadu", "Telangana", "Tripura", "Uttar Pradesh", "Uttarakhand", "West Bengal"],
sub_zips: "744~5[0-3]~79[0-2]~78~8[0-5]~16|1440[3-9]~49~396|362~11~403~3[6-9]~1[23]~17~1[89]~81[4-9]|82|83[0-5]~5[4-9]|53[7-9]~6[7-9]|6010|607008|777~194~682~4[5-8]|490~4[0-4]~79[56]~79[34]~796~79[78]~7[5-7]~60[579]~1[456]~3[0-4]~737|750~6[0-6]|536~5[0-3]~799~2[0-35-8]|24[0-7]|26[12]~24[46-9]|254|26[23]~7[0-4]",
zip: "\\d{6}",
zipex: "110034,110001"
},
IO: {
country: "IO",
require: "ACZ",
fmt: "%N%n%O%n%A%n%C%n%Z",
zip: "BBND 1ZZ",
zipex: "BBND 1ZZ"
},
IQ: {
country: "IQ",
require: "ACS",
fmt: "%O%n%N%n%A%n%C, %S%n%Z",
sub_keys: ["Al Anbar Governorate", "Basra Governorate", "Muthanna Governorate", "Al-Qadisiyah Governorate", "Najaf Governorate", "Erbil Governorate", "Sulaymaniyah Governorate", "Babil Governorate", "Baghdad Governorate", "Dohuk Governorate", "Dhi Qar Governorate", "Diyala Governorate", "Karbala Governorate", "Kirkuk Governorate", "Maysan Governorate", "Nineveh Governorate", "Saladin Governorate", "Wasit Governorate"],
zip: "\\d{5}",
zipex: "31001"
},
IS: {
country: "IS",
fmt: "%N%n%O%n%A%n%Z %C",
zip: "\\d{3}",
zipex: "320,121,220,110"
},
IT: {
country: "IT",
lang: "it",
require: "ACSZ",
fmt: "%N%n%O%n%A%n%Z %C %S",
sub_keys: ["AG", "AL", "AN", "AO", "AR", "AP", "AT", "AV", "BA", "BT", "BL", "BN", "BG", "BI", "BO", "BZ", "BS", "BR", "CA", "CL", "CB", "CE", "CT", "CZ", "CH", "CO", "CS", "CR", "KR", "CN", "EN", "FM", "FE", "FI", "FG", "FC", "FR", "GE", "GO", "GR", "IM", "IS", "AQ", "SP", "LT", "LE", "LC", "LI", "LO", "LU", "MC", "MN", "MS", "MT", "ME", "MI", "MO", "MB", "NA", "NO", "NU", "OR", "PD", "PA", "PR", "PV", "PG", "PU", "PE", "PC", "PI", "PT", "PN", "PZ", "PO", "RG", "RA", "RC", "RE", "RI", "RN", "RM", "RO", "SA", "SS", "SV", "SI", "SR", "SO", "SU", "TA", "TE", "TR", "TO", "TP", "TN", "TV", "TS", "UD", "VA", "VE", "VB", "VC", "VR", "VV", "VI", "VT"],
sub_labels: ["Agrigento", "Alessandria", "Ancona", "Aosta", "Arezzo", "Ascoli Piceno", "Asti", "Avellino", "Bari", "Barletta-Andria-Trani", "Belluno", "Benevento", "Bergamo", "Biella", "Bologna", "Bolzano", "Brescia", "Brindisi", "Cagliari", "Caltanissetta", "Campobasso", "Caserta", "Catania", "Catanzaro", "Chieti", "Como", "Cosenza", "Cremona", "Crotone", "Cuneo", "Enna", "Fermo", "Ferrara", "Firenze", "Foggia", "Forlì-Cesena", "Frosinone", "Genova", "Gorizia", "Grosseto", "Imperia", "Isernia", "L'Aquila", "La Spezia", "Latina", "Lecce", "Lecco", "Livorno", "Lodi", "Lucca", "Macerata", "Mantova", "Massa-Carrara", "Matera", "Messina", "Milano", "Modena", "Monza e Brianza", "Napoli", "Novara", "Nuoro", "Oristano", "Padova", "Palermo", "Parma", "Pavia", "Perugia", "Pesaro e Urbino", "Pescara", "Piacenza", "Pisa", "Pistoia", "Pordenone", "Potenza", "Prato", "Ragusa", "Ravenna", "Reggio Calabria", "Reggio Emilia", "Rieti", "Rimini", "Roma", "Rovigo", "Salerno", "Sassari", "Savona", "Siena", "Siracusa", "Sondrio", "Sud Sardegna", "Taranto", "Teramo", "Terni", "Torino", "Trapani", "Trento", "Treviso", "Trieste", "Udine", "Varese", "Venezia", "Verbano-Cusio-Ossola", "Vercelli", "Verona", "Vibo Valentia", "Vicenza", "Viterbo"],
sub_zips: "92~15~60~11~52~63~14~83~70~76[01]~32~82~24~13[89]~40~39~25~72~0912[1-9]|0913[0-4]|0901[0289]|0902[03468]|0903[0234]|0904|0803[035]|08043~93~860[1-4]|86100~81~95~88[01]~66~22~87~26[01]~88[89]~12|18025~94~638|63900~44~50~71~47[015]~03~16~34[01]7~58~18~860[7-9]|86170~67~19~04~73~23[89]~57~26[89]~55~62~46~54~75~98~20~41~208|20900~80~28[01]~080[1-4]|08100~090[7-9]|09170|0801[039]|0803[04]~35~90~43~27~06~61~65~29~56~51~330[7-9]|33170~85~59~97~48~89[01]~42~02~47[89]~00~45~84~07[01]|08020~17|12071~53~96~23[01]~090[1-5][0-9]|0906[0-6]|080[1-4]~74~64~05~10~91~38~31~3401|341[0-689]|34062~330[1-5]|33100~21~30~28[89]~13[01]~37~89[89]~36~01",
zip: "\\d{5}",
zipex: "00144,47037,39049"
},
JE: {
country: "JE",
require: "ACZ",
fmt: "%N%n%O%n%A%n%C%nJERSEY%n%Z",
zip: "JE\\d[\\dA-Z]? ?\\d[ABD-HJLN-UW-Z]{2}",
zipex: "JE1 1AA,JE2 2BT"
},
JM: {
country: "JM",
lang: "en",
require: "ACS",
fmt: "%N%n%O%n%A%n%C%n%S %X",
state_name_type: "parish",
sub_keys: ["Clarendon", "Hanover", "Kingston", "Manchester", "Portland", "St. Andrew", "St. Ann", "St. Catherine", "St. Elizabeth", "St. James", "St. Mary", "St. Thomas", "Trelawny", "Westmoreland"]
},
JO: {
country: "JO",
fmt: "%N%n%O%n%A%n%C %Z",
zip: "\\d{5}",
zipex: "11937,11190"
},
JP: {
country: "JP",
lang: "ja",
require: "ASZ",
fmt: "〒%Z%n%S%n%A%n%O%n%N",
state_name_type: "prefecture",
sub_keys: ["北海道", "青森県", "岩手県", "宮城県", "秋田県", "山形県", "福島県", "茨城県", "栃木県", "群馬県", "埼玉県", "千葉県", "東京都", "神奈川県", "新潟県", "富山県", "石川県", "福井県", "山梨県", "長野県", "岐阜県", "静岡県", "愛知県", "三重県", "滋賀県", "京都府", "大阪府", "兵庫県", "奈良県", "和歌山県", "鳥取県", "島根県", "岡山県", "広島県", "山口県", "徳島県", "香川県", "愛媛県", "高知県", "福岡県", "佐賀県", "長崎県", "熊本県", "大分県", "宮崎県", "鹿児島県", "沖縄県"],
sub_labels: ["北海道 — Hokkaido", "青森県 — Aomori", "岩手県 — Iwate", "宮城県 — Miyagi", "秋田県 — Akita", "山形県 — Yamagata", "福島県 — Fukushima", "茨城県 — Ibaraki", "栃木県 — Tochigi", "群馬県 — Gunma", "埼玉県 — Saitama", "千葉県 — Chiba", "東京都 — Tokyo", "神奈川県 — Kanagawa", "新潟県 — Niigata", "富山県 — Toyama", "石川県 — Ishikawa", "福井県 — Fukui", "山梨県 — Yamanashi", "長野県 — Nagano", "岐阜県 — Gifu", "静岡県 — Shizuoka", "愛知県 — Aichi", "三重県 — Mie", "滋賀県 — Shiga", "京都府 — Kyoto", "大阪府 — Osaka", "兵庫県 — Hyogo", "奈良県 — Nara", "和歌山県 — Wakayama", "鳥取県 — Tottori", "島根県 — Shimane", "岡山県 — Okayama", "広島県 — Hiroshima", "山口県 — Yamaguchi", "徳島県 — Tokushima", "香川県 — Kagawa", "愛媛県 — Ehime", "高知県 — Kochi", "福岡県 — Fukuoka", "佐賀県 — Saga", "長崎県 — Nagasaki", "熊本県 — Kumamoto", "大分県 — Oita", "宮崎県 — Miyazaki", "鹿児島県 — Kagoshima", "沖縄県 — Okinawa"],
sub_latin_names: ["Hokkaido", "Aomori", "Iwate", "Miyagi", "Akita", "Yamagata", "Fukushima", "Ibaraki", "Tochigi", "Gunma", "Saitama", "Chiba", "Tokyo", "Kanagawa", "Niigata", "Toyama", "Ishikawa", "Fukui", "Yamanashi", "Nagano", "Gifu", "Shizuoka", "Aichi", "Mie", "Shiga", "Kyoto", "Osaka", "Hyogo", "Nara", "Wakayama", "Tottori", "Shimane", "Okayama", "Hiroshima", "Yamaguchi", "Tokushima", "Kagawa", "Ehime", "Kochi", "Fukuoka", "Saga", "Nagasaki", "Kumamoto", "Oita", "Miyazaki", "Kagoshima", "Okinawa"],
sub_zips: "0[4-9]|00[1-7]~03|018~02~98~01~99~9[67]~3[01]~32|311|349~37|38[49]~3[3-6]~2[6-9]~1[0-8]|19[0-8]|20~2[1-5]|199~9[45]|389~93~92|939~91|922~40~3[89]|949~50~4[1-9]~4[4-9]|431~51|498|647~52~6[0-2]|520~5[3-9]|618|630~6[5-7]|563~63|64[78]~64|519~68~69|68[45]~7[01]~7[23]~7[45]~77~76~79~78~8[0-3]|871~84~85|81[17]|848~86~87|839~88~89~90",
zip: "\\d{3}-?\\d{4}",
zipex: "154-0023,350-1106,951-8073,112-0001,208-0032,231-0012"
},
KE: {
country: "KE",
fmt: "%N%n%O%n%A%n%C%n%Z",
zip: "\\d{5}",
zipex: "20100,00100"
},
KG: {
country: "KG",
fmt: "%N%n%O%n%A%n%Z %C",
zip: "\\d{6}",
zipex: "720001"
},
KH: {
country: "KH",
fmt: "%N%n%O%n%A%n%C %Z",
zip: "\\d{5,6}",
zipex: "120101,120108"
},
KI: {
country: "KI",
fmt: "%N%n%O%n%A%n%S%n%C",
state_name_type: "island",
sub_keys: ["Gilbert Islands", "Line Islands", "Phoenix Islands"]
},
KM: {
country: "KM"
},
KN: {
country: "KN",
lang: "en",
require: "ACS",
fmt: "%N%n%O%n%A%n%C, %S",
state_name_type: "island",
sub_keys: ["Nevis", "St. Kitts"]
},
KR: {
country: "KR",
lang: "ko",
require: "ACSZ",
fmt: "%S %C%D%n%A%n%O%n%N%n%Z",
sublocality_name_type: "district",
state_name_type: "do_si",
sub_keys: ["강원도", "경기도", "경상남도", "경상북도", "광주광역시", "대구광역시", "대전광역시", "부산광역시", "서울특별시", "세종특별자치시", "울산광역시", "인천광역시", "전라남도", "전라북도", "제주특별자치도", "충청남도", "충청북도"],
sub_labels: ["강원 — Gangwon-do", "경기 — Gyeonggi-do", "경남 — Gyeongsangnam-do", "경북 — Gyeongsangbuk-do", "광주 — Gwangju", "대구 — Daegu", "대전 — Daejeon", "부산 — Busan", "서울 — Seoul", "세종 — Sejong", "울산 — Ulsan", "인천 — Incheon", "전남 — Jeollanam-do", "전북 — Jeollabuk-do", "제주 — Jeju-do", "충남 — Chungcheongnam-do", "충북 — Chungcheongbuk-do"],
sub_latin_names: ["Gangwon-do", "Gyeonggi-do", "Gyeongsangnam-do", "Gyeongsangbuk-do", "Gwangju", "Daegu", "Daejeon", "Busan", "Seoul", "Sejong", "Ulsan", "Incheon", "Jeollanam-do", "Jeollabuk-do", "Jeju-do", "Chungcheongnam-do", "Chungcheongbuk-do"],
sub_zips: "2[456]\\d{2}~1[0-8]\\d{2}~5[0-3]\\d{2}~(?:3[6-9]|40)\\d{2}~6[12]\\d{2}~4[123]\\d{2}~3[45]\\d{2}~4[6-9]\\d{2}~0[1-8]\\d{2}~30[01]\\d~4[45]\\d{2}~2[1-3]\\d{2}~5[7-9]\\d{2}~5[4-6]\\d{2}~63[0-356]\\d~3[1-3]\\d{2}~2[789]\\d{2}",
zip: "\\d{5}",
zipex: "03051"
},
KW: {
country: "KW",
fmt: "%N%n%O%n%A%n%Z %C",
zip: "\\d{5}",
zipex: "54541,54551,54404,13009"
},
KY: {
country: "KY",
lang: "en",
require: "AS",
fmt: "%N%n%O%n%A%n%S %Z",
state_name_type: "island",
sub_keys: ["Cayman Brac", "Grand Cayman", "Little Cayman"],
zip: "KY\\d-\\d{4}",
zipex: "KY1-1100,KY1-1702,KY2-2101"
},
KZ: {
country: "KZ",
fmt: "%Z%n%S%n%C%n%A%n%O%n%N",
sub_keys: ["Almaty", "Astana", "Almatinskaya oblast'", "Akmolinskaya oblast'", "Aktyubinskaya oblast'", "Atyrauskaya oblast'", "Baykonyr", "Zapadno-Kazakhstanskaya oblast'", "Mangistauskaya oblast'", "Yuzhno-Kazakhstankaya oblast'", "Pavlodarskaya oblast'", "Karagandinskaya oblast'", "Kostanayskaya oblast'", "Kyzylordinskaya oblast'", "Vostochno-Kazakhstanskaya oblast'", "Severo-Kazakhstanskaya oblast'", "Zhambylskaya oblast'"],
zip: "\\d{6}",
zipex: "040900,050012"
},
LA: {
country: "LA",
fmt: "%N%n%O%n%A%n%Z %C",
zip: "\\d{5}",
zipex: "01160,01000"
},
LB: {
country: "LB",
fmt: "%N%n%O%n%A%n%C %Z",
zip: "(?:\\d{4})(?: ?(?:\\d{4}))?",
zipex: "2038 3054,1107 2810,1000"
},
LC: {
country: "LC"
},
LI: {
country: "LI",
require: "ACZ",
fmt: "%O%n%N%n%A%nFL-%Z %C",
zip: "948[5-9]|949[0-8]",
zipex: "9496,9491,9490,9485"
},
LK: {
country: "LK",
fmt: "%N%n%O%n%A%n%C%n%Z",
zip: "\\d{5}",
zipex: "20000,00100"
},
LR: {
country: "LR",
fmt: "%N%n%O%n%A%n%Z %C",
zip: "\\d{4}",
zipex: "1000"
},
LS: {
country: "LS",
fmt: "%N%n%O%n%A%n%C %Z",
zip: "\\d{3}",
zipex: "100"
},
LT: {
country: "LT",
require: "ACZ",
fmt: "%O%n%N%n%A%nLT-%Z %C %S",
zip: "\\d{5}",
zipex: "04340,03500"
},
LU: {
country: "LU",
require: "ACZ",
fmt: "%O%n%N%n%A%nL-%Z %C",
zip: "\\d{4}",
zipex: "4750,2998"
},
LV: {
country: "LV",
require: "ACZ",
fmt: "%N%n%O%n%A%n%S%n%C, %Z",
zip: "LV-\\d{4}",
zipex: "LV-1073,LV-1000"
},
LY: {
country: "LY"
},
MA: {
country: "MA",
fmt: "%N%n%O%n%A%n%Z %C",
zip: "\\d{5}",
zipex: "53000,10000,20050,16052"
},
MC: {
country: "MC",
fmt: "%N%n%O%n%A%nMC-%Z %C %X",
zip: "980\\d{2}",
zipex: "98000,98020,98011,98001"
},
MD: {
country: "MD",
fmt: "%N%n%O%n%A%nMD-%Z %C",
zip: "\\d{4}",
zipex: "2012,2019"
},
ME: {
country: "ME",
fmt: "%N%n%O%n%A%n%Z %C",
zip: "8\\d{4}",
zipex: "81257,81258,81217,84314,85366"
},
MF: {
country: "MF",
require: "ACZ",
fmt: "%O%n%N%n%A%n%Z %C %X",
zip: "9[78][01]\\d{2}",
zipex: "97100"
},
MG: {
country: "MG",
fmt: "%N%n%O%n%A%n%Z %C",
zip: "\\d{3}",
zipex: "501,101"
},
MK: {
country: "MK",
fmt: "%N%n%O%n%A%n%Z %C",
zip: "\\d{4}",
zipex: "1314,1321,1443,1062"
},
ML: {
country: "ML"
},
MM: {
country: "MM",
fmt: "%N%n%O%n%A%n%C, %Z",
zip: "\\d{5}",
zipex: "11181"
},
MN: {
country: "MN",
fmt: "%N%n%O%n%A%n%C%n%S %Z",
sub_keys: ["Ulaanbaatar", "Arkhangai Province", "Bayankhongor Province", "Bayan-Ölgii Province", "Bulgan Province", "Darkhan-Uul Province", "Dornod Province", "Dornogovi Province", "Dundgovi Province", "Zavkhan Province", "Govi-Altai Province", "Govisümber Province", "Khentii Province", "Khovd Province", "Khövsgöl Province", "Ömnögovi Province", "Orkhon Province", "Övörkhangai Province", "Selenge Province", "Sükhbaatar Province", "Töv Province", "Uvs Province"],
zip: "\\d{5}",
zipex: "65030,65270"
},
MO: {
country: "MO",
require: "A",
fmt: "%A%n%O%n%N"
},
MQ: {
country: "MQ",
require: "ACZ",
fmt: "%O%n%N%n%A%n%Z %C %X",
zip: "9[78]2\\d{2}",
zipex: "97220"
},
MR: {
country: "MR"
},
MS: {
country: "MS"
},
MT: {
country: "MT",
fmt: "%N%n%O%n%A%n%C %Z",
zip: "[A-Z]{3} ?\\d{2,4}",
zipex: "NXR 01,ZTN 05,GPO 01,BZN 1130,SPB 6031,VCT 1753"
},
MU: {
country: "MU",
fmt: "%N%n%O%n%A%n%Z%n%C",
zip: "\\d{3}(?:\\d{2}|[A-Z]{2}\\d{3})",
zipex: "42602"
},
MV: {
country: "MV",
fmt: "%N%n%O%n%A%n%C %Z",
zip: "\\d{5}",
zipex: "20026"
},
MW: {
country: "MW",
fmt: "%N%n%O%n%A%n%C %X"
},
MX: {
country: "MX",
lang: "es",
require: "ACSZ",
fmt: "%N%n%O%n%A%n%D%n%Z %C, %S",
sublocality_name_type: "neighborhood",
state_name_type: "state",
sub_keys: ["Ags.", "B.C.", "B.C.S.", "Camp.", "Chis.", "Chih.", "CDMX", "Coah.", "Col.", "Dgo.", "Méx.", "Gto.", "Gro.", "Hgo.", "Jal.", "Mich.", "Mor.", "Nay.", "N.L.", "Oax.", "Pue.", "Qro.", "Q.R.", "S.L.P.", "Sin.", "Son.", "Tab.", "Tamps.", "Tlax.", "Ver.", "Yuc.", "Zac."],
sub_labels: ["Aguascalientes", "Baja California", "Baja California Sur", "Campeche", "Chiapas", "Chihuahua", "Ciudad de México", "Coahuila de Zaragoza", "Colima", "Durango", "Estado de México", "Guanajuato", "Guerrero", "Hidalgo", "Jalisco", "Michoacán", "Morelos", "Nayarit", "Nuevo León", "Oaxaca", "Puebla", "Querétaro", "Quintana Roo", "San Luis Potosí", "Sinaloa", "Sonora", "Tabasco", "Tamaulipas", "Tlaxcala", "Veracruz", "Yucatán", "Zacatecas"],
sub_zips: "20~2[12]~23~24~29|30~3[1-3]~0|1[0-6]~2[5-7]~28~3[45]~5[0-7]~3[6-8]~39|4[01]~4[23]~4[4-9]~5[89]|6[01]~62~63~6[4-7]~6[89]|7[01]~7[2-5]~76~77~7[89]~8[0-2]~8[3-5]~86~8[7-9]~90~9[1-6]~97~9[89]",
zip: "\\d{5}",
zipex: "02860,77520,06082"
},
MY: {
country: "MY",
lang: "ms",
require: "ACZ",
fmt: "%N%n%O%n%A%n%D%n%Z %C%n%S",
sublocality_name_type: "village_township",
state_name_type: "state",
sub_keys: ["Johor", "Kedah", "Kelantan", "Kuala Lumpur", "Labuan", "Melaka", "Negeri Sembilan", "Pahang", "Perak", "Perlis", "Pulau Pinang", "Putrajaya", "Sabah", "Sarawak", "Selangor", "Terengganu"],
sub_zips: "79|8[0-6]~0[5-9]|34950~1[5-9]~5|60~87~7[5-8]~7[0-4]~2[5-8]|[346]9~3[0-6]|39000~0[12]~1[0-4]~62~8[89]|9[01]~9[3-8]~4[0-8]|6[3-8]~2[0-4]",
zip: "\\d{5}",
zipex: "43000,50754,88990,50670"
},
MZ: {
country: "MZ",
lang: "pt",
fmt: "%N%n%O%n%A%n%Z %C%S",
sub_keys: ["Cabo Delgado", "Cidade de Maputo", "Gaza", "Inhambane", "Manica", "Maputo", "Nampula", "Niassa", "Sofala", "Tete", "Zambezia"],
zip: "\\d{4}",
zipex: "1102,1119,3212"
},
NA: {
country: "NA",
fmt: "%N%n%O%n%A%n%C%n%Z",
zip: "\\d{5}",
zipex: "10001,10017"
},
NC: {
country: "NC",
require: "ACZ",
fmt: "%O%n%N%n%A%n%Z %C %X",
zip: "988\\d{2}",
zipex: "98814,98800,98810"
},
NE: {
country: "NE",
fmt: "%N%n%O%n%A%n%Z %C",
zip: "\\d{4}",
zipex: "8001"
},
NG: {
country: "NG",
lang: "en",
fmt: "%N%n%O%n%A%n%D%n%C %Z%n%S",
state_name_type: "state",
sub_keys: ["Abia", "Adamawa", "Akwa Ibom", "Anambra", "Bauchi", "Bayelsa", "Benue", "Borno", "Cross River", "Delta", "Ebonyi", "Edo", "Ekiti", "Enugu", "Federal Capital Territory", "Gombe", "Imo", "Jigawa", "Kaduna", "Kano", "Katsina", "Kebbi", "Kogi", "Kwara", "Lagos", "Nasarawa", "Niger", "Ogun State", "Ondo", "Osun", "Oyo", "Plateau", "Rivers", "Sokoto", "Taraba", "Yobe", "Zamfara"],
zip: "\\d{6}",
zipex: "930283,300001,931104"
},
NI: {
country: "NI",
lang: "es",
fmt: "%N%n%O%n%A%n%Z%n%C, %S",
state_name_type: "department",
sub_keys: ["Boaco", "Carazo", "Chinandega", "Chontales", "Estelí", "Granada", "Jinotega", "León", "Madriz", "Managua", "Masaya", "Matagalpa", "Nueva Segovia", "Región Autónoma de la Costa Caribe Norte", "Región Autónoma de la Costa Caribe Sur", "Río San Juan", "Rivas"],
sub_zips: "5[12]~4[56]~2[5-7]~5[56]~3[12]~4[34]~6[56]~2[12]~3[45]~1[0-6]~4[12]~6[1-3]~3[7-9]~7[12]~8[1-3]~9[12]~4[78]",
zip: "\\d{5}",
zipex: "52000"
},
NL: {
country: "NL",
require: "ACZ",
fmt: "%O%n%N%n%A%n%Z %C",
zip: "[1-9]\\d{3} ?(?:[A-RT-Z][A-Z]|S[BCE-RT-Z])",
zipex: "1234 AB,2490 AA"
},
NO: {
country: "NO",
require: "ACZ",
fmt: "%N%n%O%n%A%n%Z %C",
locality_name_type: "post_town",
zip: "\\d{4}",
zipex: "0025,0107,6631"
},
NP: {
country: "NP",
fmt: "%N%n%O%n%A%n%C %Z",
zip: "\\d{5}",
zipex: "44601"
},
NR: {
country: "NR",
lang: "en",
require: "AS",
fmt: "%N%n%O%n%A%n%S",
state_name_type: "district",
sub_keys: ["Aiwo District", "Anabar District", "Anetan District", "Anibare District", "Baiti District", "Boe District", "Buada District", "Denigomodu District", "Ewa District", "Ijuw District", "Meneng District", "Nibok District", "Uaboe District", "Yaren District"]
},
NU: {
country: "NU"
},
NZ: {
country: "NZ",
require: "ACZ",
fmt: "%N%n%O%n%A%n%D%n%C %Z",
zip: "\\d{4}",
zipex: "6001,6015,6332,8252,1030"
},
OM: {
country: "OM",
fmt: "%N%n%O%n%A%n%Z%n%C",
zip: "(?:PC )?\\d{3}",
zipex: "133,112,111"
},
PA: {
country: "PA",
fmt: "%N%n%O%n%A%n%C%n%S",
sub_keys: ["Bocas del Toro", "Chiriquí", "Coclé", "Colón", "Darién", "Herrera", "Los Santos", "Panamá", "Veraguas", "Panamá Oeste", "Emberá", "Guna Yala", "Ngäbe-Buglé"]
},
PE: {
country: "PE",
lang: "es",
fmt: "%N%n%O%n%A%n%C %Z%n%S",
locality_name_type: "district",
sub_keys: ["Municipalidad Metropolitana de Lima", "Amazonas", "Ancash", "Apurímac", "Arequipa", "Ayacucho", "Cajamarca", "Cusco", "El Callao", "Huancavelica", "Huánuco", "Ica", "Junín", "La Libertad", "Lambayeque", "Lima", "Loreto", "Madre de Dios", "Moquegua", "Pasco", "Piura", "Puno", "San Martín", "Tacna", "Tumbes", "Ucayali"],
zip: "(?:LIMA \\d{1,2}|CALLAO 0?\\d)|[0-2]\\d{4}",
zipex: "LIMA 23,LIMA 42,CALLAO 2,02001"
},
PF: {
country: "PF",
require: "ACSZ",
fmt: "%N%n%O%n%A%n%Z %C %S",
state_name_type: "island",
sub_keys: ["Windward Islands", "Austral Islands", "Tuamotu-Gambier", "Leeward Islands", "Marquesas Islands"],
zip: "987\\d{2}",
zipex: "98709"
},
PG: {
country: "PG",
require: "ACS",
fmt: "%N%n%O%n%A%n%C %Z %S",
sub_keys: ["National Capital District", "Central", "Chimbu", "Eastern Highlands", "East New Britain", "East Sepik", "Enga", "Gulf", "Hela", "Jiwaka", "Madang", "Manus", "Milne Bay", "Morobe", "New Ireland", "Northern", "West Sepik", "Southern Highlands", "Western", "Western Highlands", "West New Britain", "Bougainville"],
zip: "\\d{3}",
zipex: "111"
},
PH: {
country: "PH",
lang: "en",
fmt: "%N%n%O%n%A%n%D, %C%n%Z %S",
sub_keys: ["Abra", "Agusan del Norte", "Agusan del Sur", "Aklan", "Albay", "Antique", "Apayao", "Aurora", "Basilan", "Bataan", "Batanes", "Batangas", "Benguet", "Biliran", "Bohol", "Bukidnon", "Bulacan", "Cagayan", "Camarines Norte", "Camarines Sur", "Camiguin", "Capiz", "Catanduanes", "Cavite", "Cebu", "Compostela Valley", "Cotabato", "Davao del Norte", "Davao del Sur", "Davao Occidental", "Davao Oriental", "Dinagat Islands", "Eastern Samar", "Guimaras", "Ifugao", "Ilocos Norte", "Ilocos Sur", "Iloilo", "Isabela", "Kalinga", "La Union", "Laguna", "Lanao del Norte", "Lanao del Sur", "Leyte", "Maguindanao", "Marinduque", "Masbate", "Metro Manila", "Mindoro Occidental", "Mindoro Oriental", "Misamis Occidental", "Misamis Oriental", "Mountain Province", "Negros Occidental", "Negros Oriental", "Northern Samar", "Nueva Ecija", "Nueva Vizcaya", "Palawan", "Pampanga", "Pangasinan", "Quezon Province", "Quirino", "Rizal", "Romblon", "Samar", "Sarangani", "Siquijor", "Sorsogon", "South Cotabato", "Southern Leyte", "Sultan Kudarat", "Sulu", "Surigao del Norte", "Surigao del Sur", "Tarlac", "Tawi-Tawi", "Zambales", "Zamboanga del Norte", "Zamboanga del Sur", "Zamboanga Sibuguey"],
sub_zips: "28[0-2]~86[01]~85[01]~56[01]~45[01]~57[01]~380[0-68]~320~730~21[01]~390~42[0-3]~26(0|1[0-5])~65(4[3-9]|5)~63[0-3]~87[0-2]~30[0-2]~35[0-2]~46[01]~44[0-3]~910~58[01]~48[01]~41[0-2]~60[0-5]~88[01]~94[01]~81[0-2]~80[01]~801[1-5]~82[01]~84[12]~68[0-2]~504[4-6]~36[01]~29[0-2]~27[0-3]~50([0-3]|4[0-3])~33[0-3]~38(0[79]|1[0-4])~25[0-2]~40[0-3]~92[0-2]~9(3[0-2]|7[01])~65([0-3]|4[0-2])~96[01]~490~54[0-2]~~51[01]~52[01]~72[01]~90[0-2]~26(1[6-9]|2[0-5])~61[0-3]~62[0-2]~64[0-2]~31[0-3]~37[01]~53[0-2]~20[0-2]~24[0-4]~43[0-4]~340~1[89]~55[01]~67[0-2]~8015~62(2[5-9]|30)~47[01]~95[01]~66[10]~98[01]~74[01]~84[0-2]~83[01]~23[01]~750~22[01]~71[0-2]~70[0-4]~70[0-4]",
zip: "\\d{4}",
zipex: "1008,1050,1135,1207,2000,1000"
},
PK: {
country: "PK",
fmt: "%N%n%O%n%A%n%D%n%C-%Z",
zip: "\\d{5}",
zipex: "44000"
},
PL: {
country: "PL",
require: "ACZ",
fmt: "%N%n%O%n%A%n%Z %C",
zip: "\\d{2}-\\d{3}",
zipex: "00-950,05-470,48-300,32-015,00-940"
},
PM: {
country: "PM",
require: "ACZ",
fmt: "%O%n%N%n%A%n%Z %C %X",
zip: "9[78]5\\d{2}",
zipex: "97500"
},
PN: {
country: "PN",
require: "ACZ",
fmt: "%N%n%O%n%A%n%C%n%Z",
zip: "PCRN 1ZZ",
zipex: "PCRN 1ZZ"
},
PR: {
country: "PR",
require: "ACZ",
fmt: "%N%n%O%n%A%n%C PR %Z",
zip_name_type: "zip",
zip: "(00[679]\\d{2})(?:[ \\-](\\d{4}))?",
zipex: "00930"
},
PS: {
country: "PS"
},
PT: {
country: "PT",
require: "ACZ",
fmt: "%N%n%O%n%A%n%Z %C",
zip: "\\d{4}-\\d{3}",
zipex: "2725-079,1250-096,1201-950,2860-571,1208-148"
},
PY: {
country: "PY",
fmt: "%N%n%O%n%A%n%Z %C",
zip: "\\d{4}",
zipex: "1536,1538,1209"
},
QA: {
country: "QA"
},
RE: {
country: "RE",
require: "ACZ",
fmt: "%O%n%N%n%A%n%Z %C %X",
zip: "9[78]4\\d{2}",
zipex: "97400"
},
RO: {
country: "RO",
require: "ACZ",
fmt: "%N%n%O%n%A%n%Z %S %C",
zip: "\\d{6}",
zipex: "060274,061357,200716"
},
RS: {
country: "RS",
fmt: "%N%n%O%n%A%n%Z %C",
zip: "\\d{5,6}",
zipex: "106314"
},
RU: {
country: "RU",
lang: "ru",
require: "ACSZ",
fmt: "%N%n%O%n%A%n%C%n%S%n%Z",
state_name_type: "oblast",
sub_keys: ["Алтайский край", "Амурская область", "Архангельская область", "Астраханская область", "Белгородская область", "Брянская область", "Владимирская область", "Волгоградская область", "Вологодская область", "Воронежская область", "Еврейская автономная область", "Забайкальский край", "Ивановская область", "Иркутская область", "Кабардино-Балкарская Республика", "Калининградская область", "Калужская область", "Камчатский край", "Карачаево-Черкесская Республика", "Кемеровская область", "Кировская область", "Костромская область", "Краснодарский край", "Красноярский край", "Курганская область", "Курская область", "Ленинградская область", "Липецкая область", "Магаданская область", "Москва", "Московская область", "Мурманская область", "Ненецкий автономный округ", "Нижегородская область", "Новгородская область", "Новосибирская область", "Омская область", "Оренбургская область", "Орловская область", "Пензенская область", "Пермский край", "Приморский край", "Псковская область", "Республика Адыгея", "Республика Алтай", "Республика Башкортостан", "Республика Бурятия", "Республика Дагестан", "Республика Ингушетия", "Республика Калмыкия", "Республика Карелия", "Республика Коми", "Республика Марий Эл", "Республика Мордовия", "Республика Саха (Якутия)", "Республика Северная Осетия-Алания", "Республика Татарстан", "Республика Тыва", "Республика Удмуртия", "Республика Хакасия", "Ростовская область", "Рязанская область", "Самарская область", "Санкт-Петербург", "Саратовская область", "Сахалинская область", "Свердловская область", "Смоленская область", "Ставропольский край", "Тамбовская область", "Тверская область", "Томская область", "Тульская область", "Тюменская область", "Ульяновская область", "Хабаровский край", "Ханты-Мансийский автономный округ", "Челябинская область", "Чеченская Республика", "Чувашская Республика", "Чукотский автономный округ", "Ямало-Ненецкий автономный округ", "Ярославская область"],
sub_labels: ["Алтайский край — Altayskiy kray", "Амурская область — Amurskaya oblast'", "Архангельская область — Arkhangelskaya oblast'", "Астраханская область — Astrakhanskaya oblast'", "Белгородская область — Belgorodskaya oblast'", "Брянская область — Bryanskaya oblast'", "Владимирская область — Vladimirskaya oblast'", "Волгоградская область — Volgogradskaya oblast'", "Вологодская область — Vologodskaya oblast'", "Воронежская область — Voronezhskaya oblast'", "Еврейская автономная область — Evreyskaya avtonomnaya oblast'", "Забайкальский край — Zabaykalskiy kray", "Ивановская область — Ivanovskaya oblast'", "Иркутская область — Irkutskaya oblast'", "Кабардино-Балкарская Республика — Kabardino-Balkarskaya Republits", "Калининградская область — Kaliningradskaya oblast'", "Калужская область — Kaluzhskaya oblast'", "Камчатский край — Kamchatskiy kray", "Карачаево-Черкесская Республика — Karachaevo-Cherkesskaya Republits", "Кемеровская область — Kemerovskaya oblast'", "Кировская область — Kirovskaya oblast'", "Костромская область — Kostromskaya oblast'", "Краснодарский край — Krasnodarskiy kray", "Красноярский край — Krasnoyarskiy kray", "Курганская область — Kurganskaya oblast'", "Курская область — Kurskaya oblast'", "Ленинградская область — Leningradskaya oblast'", "Липецкая область — Lipetskaya oblast'", "Магаданская область — Magadanskaya oblast'", "Москва — Moskva", "Московская область — Moskovskaya oblast'", "Мурманская область — Murmanskaya oblast'", "Ненецкий автономный округ — Nenetskiy", "Нижегородская область — Nizhegorodskaya oblast'", "Новгородская область — Novgorodskaya oblast'", "Новосибирская область — Novosibirskaya oblast'", "Омская область — Omskaya oblast'", "Оренбургская область — Orenburgskaya oblast'", "Орловская область — Orlovskaya oblast'", "Пензенская область — Penzenskaya oblast'", "Пермский край — Permskiy kray", "Приморский край — Primorskiy kray", "Псковская область — Pskovskaya oblast'", "Республика Адыгея — Respublika Adygeya", "Республика Алтай — Altay Republits", "Республика Башкортостан — Bashkortostan Republits", "Республика Бурятия — Buryatiya Republits", "Республика Дагестан — Dagestan Republits", "Республика Ингушетия — Ingushetiya Republits", "Республика Калмыкия — Respublika Kalmykiya", "Республика Карелия — Kareliya Republits", "Республика Коми — Komi Republits", "Республика Марий Эл — Respublika Mariy El", "Республика Мордовия — Respublika Mordoviya", "Республика Саха (Якутия) — Sakha (Yakutiya) Republits", "Республика Северная Осетия-Алания — Respublika Severnaya Osetiya-Alaniya", "Республика Татарстан — Respublika Tatarstan", "Республика Тыва — Tyva Republits", "Республика Удмуртия — Udmurtskaja Respublika", "Республика Хакасия — Khakasiya Republits", "Ростовская область — Rostovskaya oblast'", "Рязанская область — Ryazanskaya oblast'", "Самарская область — Samarskaya oblast'", "Санкт-Петербург — Sankt-Peterburg", "Саратовская область — Saratovskaya oblast'", "Сахалинская область — Sakhalinskaya oblast'", "Свердловская область — Sverdlovskaya oblast'", "Смоленская область — Smolenskaya oblast'", "Ставропольский край — Stavropolskiy kray", "Тамбовская область — Tambovskaya oblast'", "Тверская область — Tverskaya oblast'", "Томская область — Tomskaya oblast'", "Тульская область — Tulskaya oblast'", "Тюменская область — Tyumenskaya oblast'", "Ульяновская область — Ulyanovskaya oblast'", "Хабаровский край — Khabarovskiy kray", "Ханты-Мансийский автономный округ — Khanty-Mansiyskiy avtonomnyy okrug", "Челябинская область — Chelyabinskaya oblast'", "Чеченская Республика — Chechenskaya Republits", "Чувашская Республика — Chuvashia", "Чукотский автономный округ — Chukotskiy", "Ямало-Ненецкий автономный округ — Yamalo-Nenetskiy", "Ярославская область — Yaroslavskaya oblast'"],
sub_latin_names: ["Altayskiy kray", "Amurskaya oblast'", "Arkhangelskaya oblast'", "Astrakhanskaya oblast'", "Belgorodskaya oblast'", "Bryanskaya oblast'", "Vladimirskaya oblast'", "Volgogradskaya oblast'", "Vologodskaya oblast'", "Voronezhskaya oblast'", "Evreyskaya avtonomnaya oblast'", "Zabaykalskiy kray", "Ivanovskaya oblast'", "Irkutskaya oblast'", "Kabardino-Balkarskaya Republits", "Kaliningradskaya oblast'", "Kaluzhskaya oblast'", "Kamchatskiy kray", "Karachaevo-Cherkesskaya Republits", "Kemerovskaya oblast'", "Kirovskaya oblast'", "Kostromskaya oblast'", "Krasnodarskiy kray", "Krasnoyarskiy kray", "Kurganskaya oblast'", "Kurskaya oblast'", "Leningradskaya oblast'", "Lipetskaya oblast'", "Magadanskaya oblast'", "Moskva", "Moskovskaya oblast'", "Murmanskaya oblast'", "Nenetskiy", "Nizhegorodskaya oblast'", "Novgorodskaya oblast'", "Novosibirskaya oblast'", "Omskaya oblast'", "Orenburgskaya oblast'", "Orlovskaya oblast'", "Penzenskaya oblast'", "Permskiy kray", "Primorskiy kray", "Pskovskaya oblast'", "Respublika Adygeya", "Altay Republits", "Bashkortostan Republits", "Buryatiya Republits", "Dagestan Republits", "Ingushetiya Republits", "Respublika Kalmykiya", "Kareliya Republits", "Komi Republits", "Respublika Mariy El", "Respublika Mordoviya", "Sakha (Yakutiya) Republits", "Respublika Severnaya Osetiya-Alaniya", "Respublika Tatarstan", "Tyva Republits", "Udmurtskaja Respublika", "Khakasiya Republits", "Rostovskaya oblast'", "Ryazanskaya oblast'", "Samarskaya oblast'", "Sankt-Peterburg", "Saratovskaya oblast'", "Sakhalinskaya oblast'", "Sverdlovskaya oblast'", "Smolenskaya oblast'", "Stavropolskiy kray", "Tambovskaya oblast'", "Tverskaya oblast'", "Tomskaya oblast'", "Tulskaya oblast'", "Tyumenskaya oblast'", "Ulyanovskaya oblast'", "Khabarovskiy kray", "Khanty-Mansiyskiy avtonomnyy okrug", "Chelyabinskaya oblast'", "Chechenskaya Republits", "Chuvashia", "Chukotskiy", "Yamalo-Nenetskiy", "Yaroslavskaya oblast'"],
sub_zips: "65[6-9]~67[56]~16[3-5]~41[4-6]~30[89]~24[1-3]~60[0-2]~40[0-4]~16[0-2]~39[4-7]~679~6(?:7[2-4]|87)~15[3-5]~66[4-9]~36[01]~23[6-8]~24[89]~68[348]~369~65[0-4]~61[0-3]~15[67]~35[0-4]~6(?:6[0-3]|4[78])~64[01]~30[5-7]~18[78]~39[89]~68[56]~1(?:0[1-9]|1|2|3[0-5]|4[0-4])~14[0-4]~18[34]~166~60[3-7]~17[3-5]~63[0-3]~64[4-6]~46[0-2]~30[23]~44[0-2]~61[4-9]~69[0-2]~18[0-2]~385~649~45[0-3]~67[01]~36[78]~386~35[89]~18[56]~16[7-9]~29[5-8]~42[45]~43[01]~67[78]~36[23]~42[0-3]~66[78]~42[67]~655~34[4-7]~39[01]~44[3-6]~19~41[0-3]~69[34]~62[0-4]~299~21[4-6]~35[5-7]~39[23]~17[0-2]~63[4-6]~30[01]~62[5-7]~43[23]~68[0-2]~628~45[4-7]~36[4-6]~42[89]~689~629~15[0-2]",
zip: "\\d{6}",
zipex: "247112,103375,188300"
},
RW: {
country: "RW"
},
SA: {
country: "SA",
fmt: "%N%n%O%n%A%n%C %Z",
zip: "\\d{5}",
zipex: "11564,11187,11142"
},
SB: {
country: "SB"
},
SC: {
country: "SC",
fmt: "%N%n%O%n%A%n%C%n%S",
state_name_type: "island"
},
SD: {
country: "SD",
fmt: "%N%n%O%n%A%n%C%n%Z",
locality_name_type: "district",
zip: "\\d{5}",
zipex: "11042,11113"
},
SE: {
country: "SE",
require: "ACZ",
fmt: "%O%n%N%n%A%nSE-%Z %C",
locality_name_type: "post_town",
zip: "\\d{3} ?\\d{2}",
zipex: "11455,12345,10500"
},
SG: {
country: "SG",
require: "AZ",
fmt: "%N%n%O%n%A%nSINGAPORE %Z",
zip: "\\d{6}",
zipex: "546080,308125,408600"
},
SH: {
country: "SH",
require: "ACZ",
fmt: "%N%n%O%n%A%n%C%n%Z",
zip: "(?:ASCN|STHL) 1ZZ",
zipex: "STHL 1ZZ"
},
SI: {
country: "SI",
fmt: "%N%n%O%n%A%nSI-%Z %C",
zip: "\\d{4}",
zipex: "4000,1001,2500"
},
SJ: {
country: "SJ",
require: "ACZ",
fmt: "%N%n%O%n%A%n%Z %C",
locality_name_type: "post_town",
zip: "\\d{4}",
zipex: "9170"
},
SK: {
country: "SK",
require: "ACZ",
fmt: "%N%n%O%n%A%n%Z %C",
zip: "\\d{3} ?\\d{2}",
zipex: "010 01,023 14,972 48,921 01,975 99"
},
SL: {
country: "SL"
},
SM: {
country: "SM",
require: "AZ",
fmt: "%N%n%O%n%A%n%Z %C",
zip: "4789\\d",
zipex: "47890,47891,47895,47899"
},
SN: {
country: "SN",
fmt: "%N%n%O%n%A%n%Z %C",
zip: "\\d{5}",
zipex: "12500,46024,16556,10000"
},
SO: {
country: "SO",
lang: "so",
require: "ACS",
fmt: "%N%n%O%n%A%n%C, %S %Z",
sub_keys: ["AD", "BK", "BN", "BR", "BY", "GG", "GD", "HR", "JD", "JH", "MD", "NG", "SG", "SD", "SH", "SL", "TG", "WG"],
sub_labels: ["Awdal", "Bakool", "Banaadir", "Bari", "Bay", "Galguduud", "Gedo", "Hiiraan", "Jubbada Dhexe", "Jubbada Hoose", "Mudug", "Nugaal", "Sanaag", "Shabeellaha Dhexe", "Shabeellaha Hoose", "Sool", "Togdheer", "Woqooyi Galbeed"],
zip: "[A-Z]{2} ?\\d{5}",
zipex: "JH 09010,AD 11010"
},
SR: {
country: "SR",
lang: "nl",
fmt: "%N%n%O%n%A%n%C%n%S",
sub_keys: ["Brokopondo", "Commewijne", "Coronie", "Marowijne", "Nickerie", "Para", "Paramaribo", "Saramacca", "Sipaliwini", "Wanica"]
},
SS: {
country: "SS"
},
ST: {
country: "ST"
},
SV: {
country: "SV",
lang: "es",
require: "ACS",
fmt: "%N%n%O%n%A%n%Z-%C%n%S",
sub_keys: ["Ahuachapan", "Cabanas", "Calatenango", "Cuscatlan", "La Libertad", "La Paz", "La Union", "Morazan", "San Miguel", "San Salvador", "San Vicente", "Santa Ana", "Sonsonate", "Usulutan"],
sub_labels: ["Ahuachapán", "Cabañas", "Chalatenango", "Cuscatlán", "La Libertad", "La Paz", "La Unión", "Morazán", "San Miguel", "San Salvador", "San Vicente", "Santa Ana", "Sonsonate", "Usulután"],
sub_zips: "CP 21~CP 12~CP 13~CP 14~CP 15~CP 16~CP 31~CP 32~CP 33~CP 11~CP 17~CP 22~CP 23~CP 34",
zip: "CP [1-3][1-7][0-2]\\d",
zipex: "CP 1101"
},
SX: {
country: "SX"
},
SZ: {
country: "SZ",
fmt: "%N%n%O%n%A%n%C%n%Z",
zip: "[HLMS]\\d{3}",
zipex: "H100"
},
TA: {
country: "TA",
fmt: "%N%n%O%n%A%n%C%n%Z",
zip: "TDCU 1ZZ",
zipex: "TDCU 1ZZ"
},
TC: {
country: "TC",
require: "ACZ",
fmt: "%N%n%O%n%A%n%C%n%Z",
zip: "TKCA 1ZZ",
zipex: "TKCA 1ZZ"
},
TD: {
country: "TD"
},
TF: {
country: "TF"
},
TG: {
country: "TG"
},
TH: {
country: "TH",
lang: "th",
fmt: "%N%n%O%n%A%n%D %C%n%S %Z",
sub_keys: ["กระบี่", "กรุงเทพมหานคร", "กาญจนบุรี", "กาฬสินธุ์", "กำแพงเพชร", "ขอนแก่น", "จังหวัด บึงกาฬ", "จันทบุรี", "ฉะเชิงเทรา", "ชลบุรี", "ชัยนาท", "ชัยภูมิ", "ชุมพร", "เชียงราย", "เชียงใหม่", "ตรัง", "ตราด", "ตาก", "นครนายก", "นครปฐม", "นครพนม", "นครราชสีมา", "นครศรีธรรมราช", "นครสวรรค์", "นนทบุรี", "นราธิวาส", "น่าน", "บุรีรัมย์", "ปทุมธานี", "ประจวบคีรีขันธ์", "ปราจีนบุรี", "ปัตตานี", "พระนครศรีอยุธยา", "พะเยา", "พังงา", "พัทลุง", "พิจิตร", "พิษณุโลก", "เพชรบุรี", "เพชรบูรณ์", "แพร่", "ภูเก็ต", "มหาสารคาม", "มุกดาหาร", "แม่ฮ่องสอน", "ยโสธร", "ยะลา", "ร้อยเอ็ด", "ระนอง", "ระยอง", "ราชบุรี", "ลพบุรี", "ลำปาง", "ลำพูน", "เลย", "ศรีสะเกษ", "สกลนคร", "สงขลา", "สตูล", "สมุทรปราการ", "สมุทรสงคราม", "สมุทรสาคร", "สระแก้ว", "สระบุรี", "สิงห์บุรี", "สุโขทัย", "สุพรรณบุรี", "สุราษฎร์ธานี", "สุรินทร์", "หนองคาย", "หนองบัวลำภู", "อ่างทอง", "อำนาจเจริญ", "อุดรธานี", "อุตรดิตถ์", "อุทัยธานี", "อุบลราชธานี"],
sub_labels: ["กระบี่ — Krabi", "กรุงเทพมหานคร — Bangkok", "กาญจนบุรี — Kanchanaburi", "กาฬสินธุ์ — Kalasin", "กำแพงเพชร — Kamphaeng Phet", "ขอนแก่น — Khon Kaen", "จังหวัด บึงกาฬ — Bueng Kan", "จันทบุรี — Chanthaburi", "ฉะเชิงเทรา — Chachoengsao", "ชลบุรี — Chon Buri", "ชัยนาท — Chai Nat", "ชัยภูมิ — Chaiyaphum", "ชุมพร — Chumpon", "เชียงราย — Chiang Rai", "เชียงใหม่ — Chiang Mai", "ตรัง — Trang", "ตราด — Trat", "ตาก — Tak", "นครนายก — Nakhon Nayok", "นครปฐม — Nakhon Pathom", "นครพนม — Nakhon Phanom", "นครราชสีมา — Nakhon Ratchasima", "นครศรีธรรมราช — Nakhon Si Thammarat", "นครสวรรค์ — Nakhon Sawan", "นนทบุรี — Nonthaburi", "นราธิวาส — Narathiwat", "น่าน — Nan", "บุรีรัมย์ — Buri Ram", "ปทุมธานี — Pathum Thani", "ประจวบคีรีขันธ์ — Prachuap Khiri Khan", "ปราจีนบุรี — Prachin Buri", "ปัตตานี — Pattani", "พระนครศรีอยุธยา — Phra Nakhon Si Ayutthaya", "พะเยา — Phayao", "พังงา — Phang Nga", "พัทลุง — Phattalung", "พิจิตร — Phichit", "พิษณุโลก — Phitsanulok", "เพชรบุรี — Phetchaburi", "เพชรบูรณ์ — Phetchabun", "แพร่ — Phrae", "ภูเก็ต — Phuket", "มหาสารคาม — Maha Sarakham", "มุกดาหาร — Mukdahan", "แม่ฮ่องสอน — Mae Hong Son", "ยโสธร — Yasothon", "ยะลา — Yala", "ร้อยเอ็ด — Roi Et", "ระนอง — Ranong", "ระยอง — Rayong", "ราชบุรี — Ratchaburi", "ลพบุรี — Lop Buri", "ลำปาง — Lampang", "ลำพูน — Lamphun", "เลย — Loei", "ศรีสะเกษ — Si Sa Ket", "สกลนคร — Sakon Nakhon", "สงขลา — Songkhla", "สตูล — Satun", "สมุทรปราการ — Samut Prakan", "สมุทรสงคราม — Samut Songkhram", "สมุทรสาคร — Samut Sakhon", "สระแก้ว — Sa Kaeo", "สระบุรี — Saraburi", "สิงห์บุรี — Sing Buri", "สุโขทัย — Sukhothai", "สุพรรณบุรี — Suphanburi", "สุราษฎร์ธานี — Surat Thani", "สุรินทร์ — Surin", "หนองคาย — Nong Khai", "หนองบัวลำภู — Nong Bua Lam Phu", "อ่างทอง — Ang Thong", "อำนาจเจริญ — Amnat Charoen", "อุดรธานี — Udon Thani", "อุตรดิตถ์ — Uttaradit", "อุทัยธานี — Uthai Thani", "อุบลราชธานี — Ubon Ratchathani"],
sub_latin_names: ["Krabi", "Bangkok", "Kanchanaburi", "Kalasin", "Kamphaeng Phet", "Khon Kaen", "Bueng Kan", "Chanthaburi", "Chachoengsao", "Chon Buri", "Chai Nat", "Chaiyaphum", "Chumpon", "Chiang Rai", "Chiang Mai", "Trang", "Trat", "Tak", "Nakhon Nayok", "Nakhon Pathom", "Nakhon Phanom", "Nakhon Ratchasima", "Nakhon Si Thammarat", "Nakhon Sawan", "Nonthaburi", "Narathiwat", "Nan", "Buri Ram", "Pathum Thani", "Prachuap Khiri Khan", "Prachin Buri", "Pattani", "Phra Nakhon Si Ayutthaya", "Phayao", "Phang Nga", "Phattalung", "Phichit", "Phitsanulok", "Phetchaburi", "Phetchabun", "Phrae", "Phuket", "Maha Sarakham", "Mukdahan", "Mae Hong Son", "Yasothon", "Yala", "Roi Et", "Ranong", "Rayong", "Ratchaburi", "Lop Buri", "Lampang", "Lamphun", "Loei", "Si Sa Ket", "Sakon Nakhon", "Songkhla", "Satun", "Samut Prakan", "Samut Songkhram", "Samut Sakhon", "Sa Kaeo", "Saraburi", "Sing Buri", "Sukhothai", "Suphanburi", "Surat Thani", "Surin", "Nong Khai", "Nong Bua Lam Phu", "Ang Thong", "Amnat Charoen", "Udon Thani", "Uttaradit", "Uthai Thani", "Ubon Ratchathani"],
sub_zips: "81~10~71~46~62~40~~22~24~20~17~36~86~57~50~92~23~63~26~73~48~30~80~60~11~96~55~31~12~77~25~94~13~56~82~93~66~65~76~67~54~83~44~49~58~35~95~45~85~21~70~15~52~51~42~33~47~90~91~10~75~74~27~18~16~64~72~84~32~43~39~14~37~41~53~61~34",
zip: "\\d{5}",
zipex: "10150,10210"
},
TJ: {
country: "TJ",
fmt: "%N%n%O%n%A%n%Z %C",
zip: "\\d{6}",
zipex: "735450,734025"
},
TK: {
country: "TK"
},
TL: {
country: "TL"
},
TM: {
country: "TM",
fmt: "%N%n%O%n%A%n%Z %C",
zip: "\\d{6}",
zipex: "744000"
},
TN: {
country: "TN",
fmt: "%N%n%O%n%A%n%Z %C",
zip: "\\d{4}",
zipex: "1002,8129,3100,1030"
},
TO: {
country: "TO"
},
TR: {
country: "TR",
lang: "tr",
require: "ACZ",
fmt: "%N%n%O%n%A%n%Z %C/%S",
locality_name_type: "district",
sub_keys: ["Adana", "Adıyaman", "Afyon", "Ağrı", "Aksaray", "Amasya", "Ankara", "Antalya", "Ardahan", "Artvin", "Aydın", "Balıkesir", "Bartın", "Batman", "Bayburt", "Bilecik", "Bingöl", "Bitlis", "Bolu", "Burdur", "Bursa", "Çanakkale", "Çankırı", "Çorum", "Denizli", "Diyarbakır", "Düzce", "Edirne", "Elazığ", "Erzincan", "Erzurum", "Eskişehir", "Gaziantep", "Giresun", "Gümüşhane", "Hakkari", "Hatay", "Iğdır", "Isparta", "İstanbul", "İzmir", "Kahramanmaraş", "Karabük", "Karaman", "Kars", "Kastamonu", "Kayseri", "Kırıkkale", "Kırklareli", "Kırşehir", "Kilis", "Kocaeli", "Konya", "Kütahya", "Malatya", "Manisa", "Mardin", "Mersin", "Muğla", "Muş", "Nevşehir", "Niğde", "Ordu", "Osmaniye", "Rize", "Sakarya", "Samsun", "Siirt", "Sinop", "Sivas", "Şanlıurfa", "Şırnak", "Tekirdağ", "Tokat", "Trabzon", "Tunceli", "Uşak", "Van", "Yalova", "Yozgat", "Zonguldak"],
sub_zips: "01~02~03~04~68~05~06~07~75~08~09~10~74~72~69~11~12~13~14~15~16~17~18~19~20~21~81~22~23~24~25~26~27~28~29~30~31~76~32~34~35~46~78~70~36~37~38~71~39~40~79~41~42~43~44~45~47~33~48~49~50~51~52~80~53~54~55~56~57~58~63~73~59~60~61~62~64~65~77~66~67",
zip: "\\d{5}",
zipex: "01960,06101"
},
TT: {
country: "TT"
},
TV: {
country: "TV",
lang: "tyv",
fmt: "%N%n%O%n%A%n%C%n%S",
state_name_type: "island",
sub_keys: ["Funafuti", "Nanumanga", "Nanumea", "Niulakita", "Niutao", "Nui", "Nukufetau", "Nukulaelae", "Vaitupu"]
},
TW: {
country: "TW",
lang: "zh-Hant",
require: "ACSZ",
fmt: "%Z%n%S%C%n%A%n%O%n%N",
locality_name_type: "district",
state_name_type: "county",
sub_keys: ["台中市", "台北市", "台東縣", "台南市", "宜蘭縣", "花蓮縣", "金門縣", "南投縣", "屏東縣", "苗栗縣", "桃園市", "高雄市", "基隆市", "連江縣", "雲林縣", "新北市", "新竹市", "新竹縣", "嘉義市", "嘉義縣", "彰化縣", "澎湖縣"],
sub_labels: ["台中市 — Taichung City", "台北市 — Taipei City", "台東縣 — Taitung County", "台南市 — Tainan City", "宜蘭縣 — Yilan County", "花蓮縣 — Hualien County", "金門縣 — Kinmen County", "南投縣 — Nantou County", "屏東縣 — Pingtung County", "苗栗縣 — Miaoli County", "桃園市 — Taoyuan City", "高雄市 — Kaohsiung City", "基隆市 — Keelung City", "連江縣 — Lienchiang County", "雲林縣 — Yunlin County", "新北市 — New Taipei City", "新竹市 — Hsinchu City", "新竹縣 — Hsinchu County", "嘉義市 — Chiayi City", "嘉義縣 — Chiayi County", "彰化縣 — Changhua County", "澎湖縣 — Penghu County"],
sub_latin_names: ["Taichung City", "Taipei City", "Taitung County", "Tainan City", "Yilan County", "Hualien County", "Kinmen County", "Nantou County", "Pingtung County", "Miaoli County", "Taoyuan City", "Kaohsiung City", "Keelung City", "Lienchiang County", "Yunlin County", "New Taipei City", "Hsinchu City", "Hsinchu County", "Chiayi City", "Chiayi County", "Changhua County", "Penghu County"],
sub_zips: "4[0-3]~1[01]~9[56]~7[0-4]~2[67]~9[78]~89~5[45]~9[0-4]~3[56]~3[23]~8[02-5]|81[1-579]~20[0-6]~209|21[012]~6[3-5]~20[78]|2[2345]~300~30[2-8]|31~600~60[1-9]|6[12]~5[0123]~88",
zip: "\\d{3}(?:\\d{2,3})?",
zipex: "104,106,10603,40867"
},
TZ: {
country: "TZ",
fmt: "%N%n%O%n%A%n%Z %C",
zip: "\\d{4,5}",
zipex: "6090,34413"
},
UA: {
country: "UA",
lang: "uk",
require: "ACZ",
fmt: "%N%n%O%n%A%n%C%n%S%n%Z",
state_name_type: "oblast",
sub_keys: ["Вінницька область", "Волинська область", "Дніпропетровська область", "Житомирська область", "Закарпатська область", "Запорізька область", "Івано-Франківська область", "місто Київ", "Київська область", "Кіровоградська область", "Львівська область", "Миколаївська область", "Одеська область", "Полтавська область", "Рівненська область", "Сумська область", "Тернопільська область", "Харківська область", "Херсонська область", "Хмельницька область", "Черкаська область", "Чернівецька область", "Чернігівська область"],
sub_labels: ["Вінницька область — Vinnyts'ka oblast", "Волинська область — Volyns'ka oblast", "Дніпропетровська область — Dnipropetrovsk oblast", "Житомирська область — Zhytomyrs'ka oblast", "Закарпатська область — Zakarpats'ka oblast", "Запорізька область — Zaporiz'ka oblast", "Івано-Франківська область — Ivano-Frankivs'ka oblast", "Київ — Kyiv city", "Київська область — Kiev oblast", "Кіровоградська область — Kirovohrads'ka oblast", "Львівська область — Lviv oblast", "Миколаївська область — Mykolaivs'ka oblast", "Одеська область — Odessa oblast", "Полтавська область — Poltavs'ka oblast", "Рівненська область — Rivnens'ka oblast", "Сумська область — Sums'ka oblast", "Тернопільська область — Ternopil's'ka oblast", "Харківська область — Kharkiv oblast", "Херсонська область — Khersons'ka oblast", "Хмельницька область — Khmel'nyts'ka oblast", "Черкаська область — Cherkas'ka oblast", "Чернівецька область — Chernivets'ka oblast", "Чернігівська область — Chernihivs'ka oblast"],
sub_latin_names: ["Vinnyts'ka oblast", "Volyns'ka oblast", "Dnipropetrovsk oblast", "Zhytomyrs'ka oblast", "Zakarpats'ka oblast", "Zaporiz'ka oblast", "Ivano-Frankivs'ka oblast", "Kyiv city", "Kiev oblast", "Kirovohrads'ka oblast", "Lviv oblast", "Mykolaivs'ka oblast", "Odessa oblast", "Poltavs'ka oblast", "Rivnens'ka oblast", "Sums'ka oblast", "Ternopil's'ka oblast", "Kharkiv oblast", "Khersons'ka oblast", "Khmel'nyts'ka oblast", "Cherkas'ka oblast", "Chernivets'ka oblast", "Chernihivs'ka oblast"],
sub_zips: "9[5-8]~2[1-4]~4[3-5]~49|5[0-3]~8[3-7]~1[0-3]~8[89]|90~69|7[0-2]~7[6-8]~0[1-6]~0[7-9]~2[5-8]~9[1-4]~79|8[0-2]~5[4-7]~6[5-8]~3[6-9]~3[3-5]~99~4[0-2]~4[6-8]~6[1-4]~7[3-5]~29|3[0-2]~1[89]|20~5[89]|60~1[4-7]",
zip: "\\d{5}",
zipex: "15432,01055,01001"
},
UG: {
country: "UG"
},
US: {
country: "US",
lang: "en",
require: "ACSZ",
fmt: "%N%n%O%n%A%n%C, %S %Z",
state_name_type: "state",
zip_name_type: "zip",
sub_keys: ["AL", "AK", "AS", "AZ", "AR", "AA", "AE", "AP", "CA", "CO", "CT", "DE", "DC", "FL", "GA", "GU", "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MH", "MD", "MA", "MI", "FM", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ", "NM", "NY", "NC", "ND", "MP", "OH", "OK", "OR", "PW", "PA", "PR", "RI", "SC", "SD", "TN", "TX", "UT", "VT", "VI", "VA", "WA", "WV", "WI", "WY"],
sub_labels: ["Alabama", "Alaska", "American Samoa", "Arizona", "Arkansas", "Armed Forces (AA)", "Armed Forces (AE)", "Armed Forces (AP)", "California", "Colorado", "Connecticut", "Delaware", "District of Columbia", "Florida", "Georgia", "Guam", "Hawaii", "Idaho", "Illinois", "Indiana", "Iowa", "Kansas", "Kentucky", "Louisiana", "Maine", "Marshall Islands", "Maryland", "Massachusetts", "Michigan", "Micronesia", "Minnesota", "Mississippi", "Missouri", "Montana", "Nebraska", "Nevada", "New Hampshire", "New Jersey", "New Mexico", "New York", "North Carolina", "North Dakota", "Northern Mariana Islands", "Ohio", "Oklahoma", "Oregon", "Palau", "Pennsylvania", "Puerto Rico", "Rhode Island", "South Carolina", "South Dakota", "Tennessee", "Texas", "Utah", "Vermont", "Virgin Islands", "Virginia", "Washington", "West Virginia", "Wisconsin", "Wyoming"],
sub_zips: "3[56]~99[5-9]~96799~8[56]~71[6-9]|72~340~09~96[2-6]~9[0-5]|96[01]~8[01]~06~19[7-9]~20[02-5]|569~3[23]|34[1-9]~3[01]|398|39901~969([1-2]\\d|3[12])~967[0-8]|9679[0-8]|968~83[2-9]~6[0-2]~4[67]~5[0-2]~6[67]~4[01]|42[0-7]~70|71[0-5]~039|04~969[67]~20[6-9]|21~01|02[0-7]|05501|05544~4[89]~9694[1-4]~55|56[0-7]~38[6-9]|39[0-7]~6[3-5]~59~6[89]~889|89~03[0-8]~0[78]~87|88[0-4]~1[0-4]|06390|00501|00544~2[78]~58~9695[0-2]~4[3-5]~7[34]~97~969(39|40)~1[5-8]|19[0-6]~00[679]~02[89]~29~57~37|38[0-5]~7[5-9]|885|73301|73344~84~05~008~201|2[23]|24[0-6]~98|99[0-4]~24[7-9]|2[56]~5[34]~82|83[01]|83414",
zip: "(\\d{5})(?:[ \\-](\\d{4}))?",
zipex: "95014,22162-1010"
},
UY: {
country: "UY",
lang: "es",
fmt: "%N%n%O%n%A%n%Z %C %S",
sub_keys: ["Artigas", "Canelones", "Cerro Largo", "Colonia", "Durazno", "Flores", "Florida", "Lavalleja", "Maldonado", "Montevideo", "Paysandú", "Río Negro", "Rivera", "Rocha", "Salto", "San José", "Soriano", "Tacuarembó", "Treinta y Tres"],
sub_zips: "55~9[01]|1[456]~37~70|75204~97~85~94|9060|97005~30~20~1|91600~60~65|60002~40~27~50~80~75|70003~45~33|30203|30204|30302|37007",
zip: "\\d{5}",
zipex: "11600"
},
UZ: {
country: "UZ",
fmt: "%N%n%O%n%A%n%Z %C%n%S",
sub_keys: ["Tashkent", "Andijan Region", "Bukhara Region", "Fergana Region", "Jizzakh Region", "Namangan Region", "Navoiy Region", "Qashqadaryo Region", "Samarqand Region", "Sirdaryo Region", "Surxondaryo Region", "Tashkent Region", "Xorazm Region", "Karakalpakstan"],
zip: "\\d{6}",
zipex: "702100,700000"
},
VA: {
country: "VA",
fmt: "%N%n%O%n%A%n%Z %C",
zip: "00120",
zipex: "00120"
},
VC: {
country: "VC",
fmt: "%N%n%O%n%A%n%C %Z",
zip: "VC\\d{4}",
zipex: "VC0100,VC0110,VC0400"
},
VE: {
country: "VE",
lang: "es",
require: "ACS",
fmt: "%N%n%O%n%A%n%C %Z, %S",
state_name_type: "state",
sub_keys: ["Amazonas", "Anzoátegui", "Apure", "Aragua", "Barinas", "Bolívar", "Carabobo", "Cojedes", "Delta Amacuro", "Dependencias Federales", "Distrito Federal", "Falcón", "Guárico", "Lara", "Mérida", "Miranda", "Monagas", "Nueva Esparta", "Portuguesa", "Sucre", "Táchira", "Trujillo", "Vargas", "Yaracuy", "Zulia"],
zip: "\\d{4}",
zipex: "1010,3001,8011,1020"
},
VG: {
country: "VG",
require: "A",
fmt: "%N%n%O%n%A%n%C%n%Z",
zip: "VG\\d{4}",
zipex: "VG1110,VG1150,VG1160"
},
VN: {
country: "VN",
lang: "vi",
fmt: "%N%n%O%n%A%n%C%n%S %Z",
sub_keys: ["An Giang", "Bà Rịa–Vũng Tàu", "Bạc Liêu", "Bắc Giang", "Bắc Kạn", "Bắc Ninh", "Bến Tre", "Bình Dương", "Bình Định", "Bình Phước", "Bình Thuận", "Cà Mau", "Cao Bằng", "Cần Thơ", "Đà Nẵng", "Đắk Lắk", "Đăk Nông", "Điện Biên", "Đồng Nai", "Đồng Tháp", "Gia Lai", "Hà Giang", "Hà Nam", "Hà Nội", "Hà Tĩnh", "Hải Dương", "Hải Phòng", "Hậu Giang", "Hòa Bình", "Hưng Yên", "Khánh Hòa", "Kiên Giang", "Kon Tum", "Lai Châu", "Lạng Sơn", "Lào Cai", "Lâm Đồng", "Long An", "Nam Định", "Nghệ An", "Ninh Bình", "Ninh Thuận", "Phú Thọ", "Phú Yên", "Quảng Bình", "Quảng Nam", "Quảng Ngãi", "Quảng Ninh", "Quảng Trị", "Sóc Trăng", "Sơn La", "Tây Ninh", "Thái Bình", "Thái Nguyên", "Thanh Hóa", "Thành phố Hồ Chí Minh", "Thừa Thiên–Huế", "Tiền Giang", "Trà Vinh", "Tuyên Quang", "Vĩnh Long", "Vĩnh Phúc", "Yên Bái"],
sub_labels: ["An Giang — An Giang Province", "Bà Rịa–Vũng Tàu — Ba Ria-Vung Tau Province", "Bạc Liêu — Bac Lieu Province", "Bắc Giang — Bac Giang Province", "Bắc Kạn — Bac Kan Province", "Bắc Ninh — Bac Ninh Province", "Bến Tre — Ben Tre Province", "Bình Dương — Binh Duong Province", "Bình Định — Binh Dinh Province", "Bình Phước — Binh Phuoc Province", "Bình Thuận — Binh Thuan Province", "Cà Mau — Ca Mau Province", "Cao Bằng — Cao Bang Province", "Cần Thơ — Can Tho City", "Đà Nẵng — Da Nang City", "Đắk Lắk — Dak Lak Province", "Đăk Nông — Dak Nong Province", "Điện Biên — Dien Bien Province", "Đồng Nai — Dong Nai Province", "Đồng Tháp — Dong Thap Province", "Gia Lai — Gia Lai Province", "Hà Giang — Ha Giang Province", "Hà Nam — Ha Nam Province", "Hà Nội — Hanoi City", "Hà Tĩnh — Ha Tinh Province", "Hải Dương — Hai Duong Province", "Hải Phòng — Haiphong City", "Hậu Giang — Hau Giang Province", "Hòa Bình — Hoa Binh Province", "Hưng Yên — Hung Yen Province", "Khánh Hòa — Khanh Hoa Province", "Kiên Giang — Kien Giang Province", "Kon Tum — Kon Tum Province", "Lai Châu — Lai Chau Province", "Lạng Sơn — Lang Song Province", "Lào Cai — Lao Cai Province", "Lâm Đồng — Lam Dong Province", "Long An — Long An Province", "Nam Định — Nam Dinh Province", "Nghệ An — Nghe An Province", "Ninh Bình — Ninh Binh Province", "Ninh Thuận — Ninh Thuan Province", "Phú Thọ — Phu Tho Province", "Phú Yên — Phu Yen Province", "Quảng Bình — Quang Binh Province", "Quảng Nam — Quang Nam Province", "Quảng Ngãi — Quang Ngai Province", "Quảng Ninh — Quang Ninh Province", "Quảng Trị — Quang Tri Province", "Sóc Trăng — Soc Trang Province", "Sơn La — Son La Province", "Tây Ninh — Tay Ninh Province", "Thái Bình — Thai Binh Province", "Thái Nguyên — Thai Nguyen Province", "Thanh Hóa — Thanh Hoa Province", "Thành phố Hồ Chí Minh — Ho Chi Minh City", "Thừa Thiên–Huế — Thua Thien-Hue Province", "Tiền Giang — Tien Giang Province", "Trà Vinh — Tra Vinh Province", "Tuyên Quang — Tuyen Quang Province", "Vĩnh Long — Vinh Long Province", "Vĩnh Phúc — Vinh Phuc Province", "Yên Bái — Yen Bai Province"],
sub_latin_names: ["An Giang Province", "Ba Ria-Vung Tau Province", "Bac Lieu Province", "Bac Giang Province", "Bac Kan Province", "Bac Ninh Province", "Ben Tre Province", "Binh Duong Province", "Binh Dinh Province", "Binh Phuoc Province", "Binh Thuan Province", "Ca Mau Province", "Cao Bang Province", "Can Tho City", "Da Nang City", "Dak Lak Province", "Dak Nong Province", "Dien Bien Province", "Dong Nai Province", "Dong Thap Province", "Gia Lai Province", "Ha Giang Province", "Ha Nam Province", "Hanoi City", "Ha Tinh Province", "Hai Duong Province", "Haiphong City", "Hau Giang Province", "Hoa Binh Province", "Hung Yen Province", "Khanh Hoa Province", "Kien Giang Province", "Kon Tum Province", "Lai Chau Province", "Lang Song Province", "Lao Cai Province", "Lam Dong Province", "Long An Province", "Nam Dinh Province", "Nghe An Province", "Ninh Binh Province", "Ninh Thuan Province", "Phu Tho Province", "Phu Yen Province", "Quang Binh Province", "Quang Nam Province", "Quang Ngai Province", "Quang Ninh Province", "Quang Tri Province", "Soc Trang Province", "Son La Province", "Tay Ninh Province", "Thai Binh Province", "Thai Nguyen Province", "Thanh Hoa Province", "Ho Chi Minh City", "Thua Thien-Hue Province", "Tien Giang Province", "Tra Vinh Province", "Tuyen Quang Province", "Vinh Long Province", "Vinh Phuc Province", "Yen Bai Province"],
zip: "\\d{5}\\d?",
zipex: "70010,55999"
},
VU: {
country: "VU"
},
WF: {
country: "WF",
require: "ACZ",
fmt: "%O%n%N%n%A%n%Z %C %X",
zip: "986\\d{2}",
zipex: "98600"
},
WS: {
country: "WS"
},
XK: {
country: "XK",
fmt: "%N%n%O%n%A%n%Z %C",
zip: "[1-7]\\d{4}",
zipex: "10000"
},
YE: {
country: "YE"
},
YT: {
country: "YT",
require: "ACZ",
fmt: "%O%n%N%n%A%n%Z %C %X",
zip: "976\\d{2}",
zipex: "97600"
},
ZA: {
country: "ZA",
require: "ACZ",
fmt: "%N%n%O%n%A%n%D%n%C%n%Z",
zip: "\\d{4}",
zipex: "0083,1451,0001"
},
ZM: {
country: "ZM",
fmt: "%N%n%O%n%A%n%Z %C",
zip: "\\d{5}",
zipex: "50100,50101"
},
ZW: {
country: "ZW"
},
ZZ: {
country: "ZZ",
require: "AC",
fmt: "%N%n%O%n%A%n%C",
sublocality_name_type: "suburb",
locality_name_type: "city",
state_name_type: "province",
zip_name_type: "postal"
}
}, Lt = function(e, t) {
if ("AU" === t)
return "suburb_or_city";
switch (e) {
case "district":
case "post_town":
case "suburb":
return e;
default:
return "city"
}
}, Dt = function(e) {
switch (e) {
case "eircode":
case "pin":
case "zip":
return e;
default:
return "postal"
}
}, Ut = function(e) {
var t = e.sub_keys
, n = e.state_name_type
, r = e.lang
, a = function(e) {
switch (e) {
case "area":
case "county":
case "department":
case "district":
case "do_si":
case "emirate":
case "island":
case "oblast":
case "parish":
case "prefecture":
case "state":
return e;
default:
return "province"
}
}(n);
if (null == t || !t.length)
return {
nameType: a,
list: [],
lang: r
};
var i = (e.sub_zips || "").split("~")
, o = e.sub_labels || e.sub_keys || [];
return {
nameType: a,
lang: r,
list: t.map((function(t, n) {
var r = o[n] || ""
, a = new RegExp("^(".concat(i[n], ")"));
return e.sub_latin_names ? {
key: t,
label: r,
postalCodeRegex: a,
latinName: e.sub_latin_names[n]
} : {
key: t,
label: r,
postalCodeRegex: a
}
}
))
}
}, jt = /^\\\\d\{\d(,\d)?\}$/, Bt = ["US"], Ft = function(e) {
var t = e.zip
, n = void 0 === t ? ".*" : t
, r = e.zipex
, a = void 0 === r ? "" : r
, i = e.zip_name_type
, o = void 0 === i ? "" : i;
return {
regex: new RegExp("^".concat(n, "$"),"i"),
isNumeric: jt.test(n) || -1 !== Bt.indexOf(e.country),
examples: a.split(","),
nameType: Dt(o)
}
}, Gt = function(e) {
var t = (e.fmt || "").split("%").map((function(e) {
return e.replace(/[^A-Z]/g, "")
}
))
, n = function(e, t) {
return function(n, r) {
var a = -1 !== t.indexOf(r);
switch (r) {
case "A":
return [].concat((0,
Z.Z)(n), [{
type: "addressLine1",
required: a
}, {
type: "addressLine2",
required: !1
}]);
case "C":
return [].concat((0,
Z.Z)(n), [{
type: "locality",
required: a,
schema: {
nameType: Lt(e.locality_name_type, e.country)
}
}]);
case "S":
return 0 === Ut(e).list.length ? n : [].concat((0,
Z.Z)(n), [{
type: "administrativeArea",
required: a,
schema: Ut(e)
}]);
case "Z":
return [].concat((0,
Z.Z)(n), [{
type: "postalCode",
required: a,
schema: Ft(e)
}]);
default:
return n
}
}
}(e, (e.require || "").split(""));
return t.reduce(n, [])
}, qt = {}, Kt = function(e, t) {
var n = "".concat(e).concat(JSON.stringify(t));
if (qt[n])
return qt[n];
var r = Gt((0,
b.Z)((0,
b.Z)({}, function(e) {
var t = (arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}).fallbackCountry
, n = Rt.ZZ
, r = Rt[e] || t && Rt[t];
if (!r)
throw new Error("Unknown country code: ".concat(e));
return (0,
b.Z)((0,
b.Z)({}, n), r)
}(e, {
fallbackCountry: "US"
})), t));
return qt[n] = r,
r
}, Vt = function(e, t) {
for (var n = 0; n < e.length; n++)
if (e[n].type === t)
return e[n];
return null
}, zt = {
AC: "AC",
AD: "AD",
AE: "AE",
AF: "AF",
AG: "AG",
AI: "AI",
AL: "AL",
AM: "AM",
AO: "AO",
AQ: "AQ",
AR: "AR",
AT: "AT",
AU: "AU",
AW: "AW",
AX: "AX",
AZ: "AZ",
BA: "BA",
BB: "BB",
BD: "BD",
BE: "BE",
BF: "BF",
BG: "BG",
BH: "BH",
BI: "BI",
BJ: "BJ",
BL: "BL",
BM: "BM",
BN: "BN",
BO: "BO",
BQ: "BQ",
BR: "BR",
BS: "BS",
BT: "BT",
BV: "BV",
BW: "BW",
BY: "BY",
BZ: "BZ",
CA: "CA",
CD: "CD",
CF: "CF",
CG: "CG",
CH: "CH",
CI: "CI",
CK: "CK",
CL: "CL",
CM: "CM",
CN: "CN",
CO: "CO",
CR: "CR",
CV: "CV",
CW: "CW",
CY: "CY",
CZ: "CZ",
DE: "DE",
DJ: "DJ",
DK: "DK",
DM: "DM",
DO: "DO",
DZ: "DZ",
EC: "EC",
EE: "EE",
EG: "EG",
EH: "EH",
ER: "ER",
ES: "ES",
ET: "ET",
FI: "FI",
FJ: "FJ",
FK: "FK",
FO: "FO",
FR: "FR",
GA: "GA",
GB: "GB",
GD: "GD",
GE: "GE",
GF: "GF",
GG: "GG",
GH: "GH",
GI: "GI",
GL: "GL",
GM: "GM",
GN: "GN",
GP: "GP",
GQ: "GQ",
GR: "GR",
GS: "GS",
GT: "GT",
GU: "GU",
GW: "GW",
GY: "GY",
HK: "HK",
HN: "HN",
HR: "HR",
HT: "HT",
HU: "HU",
ID: "ID",
IE: "IE",
IL: "IL",
IM: "IM",
IN: "IN",
IO: "IO",
IQ: "IQ",
IS: "IS",
IT: "IT",
JE: "JE",
JM: "JM",
JO: "JO",
JP: "JP",
KE: "KE",
KG: "KG",
KH: "KH",
KI: "KI",
KM: "KM",
KN: "KN",
KR: "KR",
KW: "KW",
KY: "KY",
KZ: "KZ",
LA: "LA",
LB: "LB",
LC: "LC",
LI: "LI",
LK: "LK",
LR: "LR",
LS: "LS",
LT: "LT",
LU: "LU",
LV: "LV",
LY: "LY",
MA: "MA",
MC: "MC",
MD: "MD",
ME: "ME",
MF: "MF",
MG: "MG",
MK: "MK",
ML: "ML",
MM: "MM",
MN: "MN",
MO: "MO",
MQ: "MQ",
MR: "MR",
MS: "MS",
MT: "MT",
MU: "MU",
MV: "MV",
MW: "MW",
MX: "MX",
MY: "MY",
MZ: "MZ",
NA: "NA",
NC: "NC",
NE: "NE",
NG: "NG",
NI: "NI",
NL: "NL",
NO: "NO",
NP: "NP",
NR: "NR",
NU: "NU",
NZ: "NZ",
OM: "OM",
PA: "PA",
PE: "PE",
PF: "PF",
PG: "PG",
PH: "PH",
PK: "PK",
PL: "PL",
PM: "PM",
PN: "PN",
PR: "PR",
PS: "PS",
PT: "PT",
PY: "PY",
QA: "QA",
RE: "RE",
RO: "RO",
RS: "RS",
RU: "RU",
RW: "RW",
SA: "SA",
SB: "SB",
SC: "SC",
SD: "SD",
SE: "SE",
SG: "SG",
SH: "SH",
SI: "SI",
SJ: "SJ",
SK: "SK",
SL: "SL",
SM: "SM",
SN: "SN",
SO: "SO",
SR: "SR",
SS: "SS",
ST: "ST",
SV: "SV",
SX: "SX",
SZ: "SZ",
TA: "TA",
TC: "TC",
TD: "TD",
TF: "TF",
TG: "TG",
TH: "TH",
TJ: "TJ",
TK: "TK",
TL: "TL",
TM: "TM",
TN: "TN",
TO: "TO",
TR: "TR",
TT: "TT",
TV: "TV",
TW: "TW",
TZ: "TZ",
UA: "UA",
UG: "UG",
US: "US",
UY: "UY",
UZ: "UZ",
VA: "VA",
VC: "VC",
VE: "VE",
VG: "VG",
VN: "VN",
VU: "VU",
WF: "WF",
WS: "WS",
XK: "XK",
YE: "YE",
YT: "YT",
ZA: "ZA",
ZM: "ZM",
ZW: "ZW",
ZZ: "ZZ"
}, Ht = (Object.keys(zt),
zt), Yt = function(e) {
return e && Ht[e.toUpperCase()] || null
}, Wt = new RegExp(/(P *\.* *O *\.* *BOX|POST(AL)*\s*(OFFICE)*\s*BOX|(^|\W)P *O *B($|\W|\d))/i), Jt = new RegExp(/POSTFACH\s*(ADRESSE)*/i), Xt = new RegExp(/((^|\W)B(\W)*P($|\W|\d)|BO(I|î|Î)TE\s*POST(AL|ALE)*)/i), Qt = new RegExp(/CASE\s*POSTAL(E*)/i), $t = new RegExp(/POSTBUS/i), en = new RegExp(/ταχυδρομική\s*θυρίδα|(^|[\P{Greek}&&\W])Τ([\P{Greek}&&\W])*Θ($|[\P{Greek}&&\W]|\d)/i), tn = new RegExp(/POSTBOKS(NUMMER)*/i), nn = new RegExp(/APARTADO/i), rn = new RegExp(/postafi[óo]k|(^|\W)P(\W)*F($|\W|\d)/i), an = {
AT: [Jt],
BE: [Jt, Xt, $t],
BG: [new RegExp(/POSHTENSKA\s*KUT(['’ʼ`]*)YA/i)],
CA: [Qt],
CH: [Jt, Qt],
CY: [en, /POSTA\s*KUTUSU/i],
CZ: [new RegExp(/po[šs]tovn[íi]\s*p[řr]ihr[áa]dka/i)],
DE: [Jt],
DK: [tn],
EE: [new RegExp(/NIMEKAPP/i)],
ES: [nn],
FI: [new RegExp(/POSTILOKERO/i)],
FR: [Xt],
GR: [en],
HU: [rn],
IT: [new RegExp(/CASELLA\s*POSTAL(E*)/i)],
JP: [new RegExp(/私書箱/i)],
LI: [Jt, Qt],
LT: [new RegExp(/(^|\W)P(\W)*D($|\W|\d)/i)],
LU: [Jt, Xt],
LV: [new RegExp(/abonenta\s*kast[īi]te/i)],
MC: [Xt],
MT: [new RegExp(/KAXXA\s*POSTAL(I)*/i)],
MX: [nn],
MY: [new RegExp(/PETI\s*SURAT/i)],
NL: [$t],
NO: [tn],
PL: [new RegExp(/Skrytka\s*pocztowa/i)],
PT: [nn],
RO: [new RegExp(/cutie\s*po[șsş]tal[ăa]/i)],
SI: [new RegExp(/(^|\W)p(\W)*p($|\W|\d)/i)]
}, on = function(e, t) {
return e in an ? an[e].some((function(e) {
return e.test(t)
}
)) : Wt.test(t)
}, sn = function(e, t) {
return "postalCode" !== e.type || e.schema.regex.test(t) ? null : "zip" === e.schema.nameType ? "invalid_zip" : "invalid_postal_code"
}, un = function(e, t, n) {
var r = arguments.length > 3 && void 0 !== arguments[3] && arguments[3]
, a = Vt(e, n);
if (!a)
return null;
var i = t[n].trim();
if ("" === i && dn(n, e))
return "incomplete_address";
var o = sn(a, i);
return o || (r && ("addressLine1" === a.type || "addressLine2" === a.type) && on(t.country, i) ? "po_box_prohibited" : null)
}, ln = function(e, t) {
var n = Kt(e)
, r = Vt(n, "postalCode");
if (!r)
return null;
var a = sn(r, t);
return a || null
}, cn = function(e) {
var t;
return "always" === (null == e || null === (t = e.phone) || void 0 === t ? void 0 : t.required)
}, dn = function(e, t) {
switch (e) {
case "addressLine1":
return t.some((function(e) {
return "addressLine1" === e.type && e.required
}
));
case "addressLine2":
return t.some((function(e) {
return "addressLine2" === e.type && e.required
}
));
case "locality":
return t.some((function(e) {
return "locality" === e.type && e.required
}
));
case "administrativeArea":
return t.some((function(e) {
return "administrativeArea" === e.type && e.required
}
));
case "postalCode":
return t.some((function(e) {
return "postalCode" === e.type && e.required
}
));
case "country":
return !0;
default:
return !1
}
}, pn = n(94217), mn = n(27490), fn = n(8464), hn = n.n(fn), _n = n(90342), yn = n.n(_n), vn = n(32726), gn = n.n(vn), bn = n(3120), Sn = n.n(bn), kn = n(7689), Cn = n.n(kn), En = n(96250), Zn = n.n(En), An = n(96889), Mn = n.n(An), Pn = n(54613), xn = n.n(Pn), In = n(23030), Nn = n.n(In), wn = n(16973), Tn = n.n(wn), On = n(40724), Rn = n.n(On), Ln = n(71060), Dn = n.n(Ln), Un = n(60919), jn = n.n(Un), Bn = n(12875), Fn = n.n(Bn), Gn = n(10378), qn = n.n(Gn), Kn = n(5427), Vn = n.n(Kn), zn = n(59291), Hn = n.n(zn), Yn = n(41713), Wn = n.n(Yn), Jn = n(48173), Xn = n.n(Jn), Qn = n(43596), $n = n.n(Qn), er = n(97750), tr = n.n(er), nr = n(2901), rr = n.n(nr), ar = n(54581), ir = n.n(ar), or = n(53763), sr = n.n(or), ur = n(61685), lr = n.n(ur), cr = n(39156), dr = n.n(cr), pr = n(83389), mr = n.n(pr), fr = n(53556), hr = n.n(fr), _r = n(527), yr = n.n(_r), vr = n(47126), gr = n.n(vr), br = n(60613), Sr = n.n(br), kr = n(5563), Cr = n.n(kr), Er = n(65043), Zr = n.n(Er), Ar = n(83005), Mr = n.n(Ar), Pr = n(34700), xr = n.n(Pr), Ir = n(75478), Nr = n.n(Ir), wr = n(77918), Tr = n.n(wr), Or = n(99797), Rr = n.n(Or), Lr = n(30265), Dr = n.n(Lr), Ur = n(35300), jr = n.n(Ur), Br = n(3523), Fr = n.n(Br), Gr = {
ar: hn(),
bg: yn(),
cs: gn(),
da: Sn(),
de: Cn(),
el: Zn(),
"en-GB": Mn(),
"en-NL": Mn(),
es: xn(),
"es-419": Nn(),
et: Tn(),
fi: Rn(),
fil: Dn(),
fr: jn(),
"fr-CA": Fn(),
he: qn(),
hr: Vn(),
hu: Hn(),
id: Wn(),
it: Xn(),
ja: $n(),
ko: tr(),
lt: rr(),
lv: ir(),
ms: sr(),
mt: lr(),
nb: mr(),
nl: dr(),
"nl-BE": dr(),
no: mr(),
pl: hr(),
pt: yr(),
"pt-BR": gr(),
ru: Cr(),
ro: Sr(),
sk: Zr(),
sl: Mr(),
sv: xr(),
th: Nr(),
tr: Tr(),
vi: Rr(),
zh: Dr(),
"zh-HK": jr(),
"zh-TW": Fr()
}, qr = JSON.parse('[{"value":"AC","label":"Ascension Island"},{"value":"AD","label":"Andorra"},{"value":"AE","label":"United Arab Emirates"},{"value":"AF","label":"Afghanistan"},{"value":"AG","label":"Antigua & Barbuda"},{"value":"AI","label":"Anguilla"},{"value":"AL","label":"Albania"},{"value":"AM","label":"Armenia"},{"value":"AO","label":"Angola"},{"value":"AQ","label":"Antarctica"},{"value":"AR","label":"Argentina"},{"value":"AT","label":"Austria"},{"value":"AU","label":"Australia"},{"value":"AW","label":"Aruba"},{"value":"AX","label":"Åland Islands"},{"value":"AZ","label":"Azerbaijan"},{"value":"BA","label":"Bosnia & Herzegovina"},{"value":"BB","label":"Barbados"},{"value":"BD","label":"Bangladesh"},{"value":"BE","label":"Belgium"},{"value":"BF","label":"Burkina Faso"},{"value":"BG","label":"Bulgaria"},{"value":"BH","label":"Bahrain"},{"value":"BI","label":"Burundi"},{"value":"BJ","label":"Benin"},{"value":"BL","label":"St. Barthélemy"},{"value":"BM","label":"Bermuda"},{"value":"BN","label":"Brunei"},{"value":"BO","label":"Bolivia"},{"value":"BQ","label":"Caribbean Netherlands"},{"value":"BR","label":"Brazil"},{"value":"BS","label":"Bahamas"},{"value":"BT","label":"Bhutan"},{"value":"BV","label":"Bouvet Island"},{"value":"BW","label":"Botswana"},{"value":"BY","label":"Belarus"},{"value":"BZ","label":"Belize"},{"value":"CA","label":"Canada"},{"value":"CD","label":"Congo - Kinshasa"},{"value":"CF","label":"Central African Republic"},{"value":"CG","label":"Congo - Brazzaville"},{"value":"CH","label":"Switzerland"},{"value":"CI","label":"Côte d’Ivoire"},{"value":"CK","label":"Cook Islands"},{"value":"CL","label":"Chile"},{"value":"CM","label":"Cameroon"},{"value":"CN","label":"China"},{"value":"CO","label":"Colombia"},{"value":"CR","label":"Costa Rica"},{"value":"CV","label":"Cape Verde"},{"value":"CW","label":"Curaçao"},{"value":"CY","label":"Cyprus"},{"value":"CZ","label":"Czechia"},{"value":"DE","label":"Germany"},{"value":"DJ","label":"Djibouti"},{"value":"DK","label":"Denmark"},{"value":"DM","label":"Dominica"},{"value":"DO","label":"Dominican Republic"},{"value":"DZ","label":"Algeria"},{"value":"EC","label":"Ecuador"},{"value":"EE","label":"Estonia"},{"value":"EG","label":"Egypt"},{"value":"EH","label":"Western Sahara"},{"value":"ER","label":"Eritrea"},{"value":"ES","label":"Spain"},{"value":"ET","label":"Ethiopia"},{"value":"FI","label":"Finland"},{"value":"FJ","label":"Fiji"},{"value":"FK","label":"Falkland Islands"},{"value":"FO","label":"Faroe Islands"},{"value":"FR","label":"France"},{"value":"GA","label":"Gabon"},{"value":"GB","label":"United Kingdom"},{"value":"GD","label":"Grenada"},{"value":"GE","label":"Georgia"},{"value":"GF","label":"French Guiana"},{"value":"GG","label":"Guernsey"},{"value":"GH","label":"Ghana"},{"value":"GI","label":"Gibraltar"},{"value":"GL","label":"Greenland"},{"value":"GM","label":"Gambia"},{"value":"GN","label":"Guinea"},{"value":"GP","label":"Guadeloupe"},{"value":"GQ","label":"Equatorial Guinea"},{"value":"GR","label":"Greece"},{"value":"GS","label":"South Georgia & South Sandwich Islands"},{"value":"GT","label":"Guatemala"},{"value":"GU","label":"Guam"},{"value":"GW","label":"Guinea-Bissau"},{"value":"GY","label":"Guyana"},{"value":"HK","label":"Hong Kong SAR China"},{"value":"HN","label":"Honduras"},{"value":"HR","label":"Croatia"},{"value":"HT","label":"Haiti"},{"value":"HU","label":"Hungary"},{"value":"ID","label":"Indonesia"},{"value":"IE","label":"Ireland"},{"value":"IL","label":"Israel"},{"value":"IM","label":"Isle of Man"},{"value":"IN","label":"India"},{"value":"IO","label":"British Indian Ocean Territory"},{"value":"IQ","label":"Iraq"},{"value":"IS","label":"Iceland"},{"value":"IT","label":"Italy"},{"value":"JE","label":"Jersey"},{"value":"JM","label":"Jamaica"},{"value":"JO","label":"Jordan"},{"value":"JP","label":"Japan"},{"value":"KE","label":"Kenya"},{"value":"KG","label":"Kyrgyzstan"},{"value":"KH","label":"Cambodia"},{"value":"KI","label":"Kiribati"},{"value":"KM","label":"Comoros"},{"value":"KN","label":"St. Kitts & Nevis"},{"value":"KR","label":"South Korea"},{"value":"KW","label":"Kuwait"},{"value":"KY","label":"Cayman Islands"},{"value":"KZ","label":"Kazakhstan"},{"value":"LA","label":"Laos"},{"value":"LB","label":"Lebanon"},{"value":"LC","label":"St. Lucia"},{"value":"LI","label":"Liechtenstein"},{"value":"LK","label":"Sri Lanka"},{"value":"LR","label":"Liberia"},{"value":"LS","label":"Lesotho"},{"value":"LT","label":"Lithuania"},{"value":"LU","label":"Luxembourg"},{"value":"LV","label":"Latvia"},{"value":"LY","label":"Libya"},{"value":"MA","label":"Morocco"},{"value":"MC","label":"Monaco"},{"value":"MD","label":"Moldova"},{"value":"ME","label":"Montenegro"},{"value":"MF","label":"St. Martin"},{"value":"MG","label":"Madagascar"},{"value":"MK","label":"North Macedonia"},{"value":"ML","label":"Mali"},{"value":"MM","label":"Myanmar (Burma)"},{"value":"MN","label":"Mongolia"},{"value":"MO","label":"Macao SAR China"},{"value":"MQ","label":"Martinique"},{"value":"MR","label":"Mauritania"},{"value":"MS","label":"Montserrat"},{"value":"MT","label":"Malta"},{"value":"MU","label":"Mauritius"},{"value":"MV","label":"Maldives"},{"value":"MW","label":"Malawi"},{"value":"MX","label":"Mexico"},{"value":"MY","label":"Malaysia"},{"value":"MZ","label":"Mozambique"},{"value":"NA","label":"Namibia"},{"value":"NC","label":"New Caledonia"},{"value":"NE","label":"Niger"},{"value":"NG","label":"Nigeria"},{"value":"NI","label":"Nicaragua"},{"value":"NL","label":"Netherlands"},{"value":"NO","label":"Norway"},{"value":"NP","label":"Nepal"},{"value":"NR","label":"Nauru"},{"value":"NU","label":"Niue"},{"value":"NZ","label":"New Zealand"},{"value":"OM","label":"Oman"},{"value":"PA","label":"Panama"},{"value":"PE","label":"Peru"},{"value":"PF","label":"French Polynesia"},{"value":"PG","label":"Papua New Guinea"},{"value":"PH","label":"Philippines"},{"value":"PK","label":"Pakistan"},{"value":"PL","label":"Poland"},{"value":"PM","label":"St. Pierre & Miquelon"},{"value":"PN","label":"Pitcairn Islands"},{"value":"PR","label":"Puerto Rico"},{"value":"PS","label":"Palestinian Territories"},{"value":"PT","label":"Portugal"},{"value":"PY","label":"Paraguay"},{"value":"QA","label":"Qatar"},{"value":"RE","label":"Réunion"},{"value":"RO","label":"Romania"},{"value":"RS","label":"Serbia"},{"value":"RU","label":"Russia"},{"value":"RW","label":"Rwanda"},{"value":"SA","label":"Saudi Arabia"},{"value":"SB","label":"Solomon Islands"},{"value":"SC","label":"Seychelles"},{"value":"SD","label":"Sudan"},{"value":"SE","label":"Sweden"},{"value":"SG","label":"Singapore"},{"value":"SH","label":"St. Helena"},{"value":"SI","label":"Slovenia"},{"value":"SJ","label":"Svalbard & Jan Mayen"},{"value":"SK","label":"Slovakia"},{"value":"SL","label":"Sierra Leone"},{"value":"SM","label":"San Marino"},{"value":"SN","label":"Senegal"},{"value":"SO","label":"Somalia"},{"value":"SR","label":"Suriname"},{"value":"SS","label":"South Sudan"},{"value":"ST","label":"São Tomé & Príncipe"},{"value":"SV","label":"El Salvador"},{"value":"SX","label":"Sint Maarten"},{"value":"SZ","label":"Eswatini"},{"value":"TA","label":"Tristan da Cunha"},{"value":"TC","label":"Turks & Caicos Islands"},{"value":"TD","label":"Chad"},{"value":"TF","label":"French Southern Territories"},{"value":"TG","label":"Togo"},{"value":"TH","label":"Thailand"},{"value":"TJ","label":"Tajikistan"},{"value":"TK","label":"Tokelau"},{"value":"TL","label":"Timor-Leste"},{"value":"TM","label":"Turkmenistan"},{"value":"TN","label":"Tunisia"},{"value":"TO","label":"Tonga"},{"value":"TR","label":"Türkiye"},{"value":"TT","label":"Trinidad & Tobago"},{"value":"TV","label":"Tuvalu"},{"value":"TW","label":"Taiwan"},{"value":"TZ","label":"Tanzania"},{"value":"UA","label":"Ukraine"},{"value":"UG","label":"Uganda"},{"value":"US","label":"United States"},{"value":"UY","label":"Uruguay"},{"value":"UZ","label":"Uzbekistan"},{"value":"VA","label":"Vatican City"},{"value":"VC","label":"St. Vincent & Grenadines"},{"value":"VE","label":"Venezuela"},{"value":"VG","label":"British Virgin Islands"},{"value":"VN","label":"Vietnam"},{"value":"VU","label":"Vanuatu"},{"value":"WF","label":"Wallis & Futuna"},{"value":"WS","label":"Samoa"},{"value":"XK","label":"Kosovo"},{"value":"YE","label":"Yemen"},{"value":"YT","label":"Mayotte"},{"value":"ZA","label":"South Africa"},{"value":"ZM","label":"Zambia"},{"value":"ZW","label":"Zimbabwe"},{"value":"ZZ","label":"Unknown Region"}]'), Kr = n(56274).Promise, Vr = {}, zr = (0,
v.Z)({}, mn.vS, qr), Hr = function(e) {
var t = (0,
mn.Nj)(e);
if (t === mn.vS)
return Kr.resolve(qr);
var n = Gr[t];
if ("object" == typeof n)
return Kr.resolve(n);
if (Vr[n])
return Vr[n];
if (n) {
var r = {
url: n,
method: "GET"
};
return Vr[n] = (0,
pn.h)(r).then((function(e) {
try {
var n = JSON.parse(e.responseText);
return zr[t] = n,
n
} catch (e) {
throw e
}
}
)),
Vr[n]
}
return Kr.reject(new Error("Could not load locale data for ".concat(t, ".")))
}, Yr = n(67294), Wr = n.n(Yr), Jr = n(39294), Xr = {
usd: "US",
gbp: "GB",
aud: "AU",
cad: "CA",
eur: "FR",
mxn: "MX",
sgd: "SG"
}, Qr = function(e) {
var t = e ? Xr[e] : null
, n = (0,
Jr.UT)().slice(3);
return t || Yt(n) || null
}, $r = {
AC: "SH",
TA: "SH"
}, ea = function(e) {
var t, n, r = e.addressLine1, a = e.addressLine2, i = e.locality, o = e.administrativeArea, s = e.postalCode, u = e.country;
return (0,
O.VJ)({
line1: r,
line2: a.trim() || null,
city: i,
country: (t = u,
null !== (n = $r[t]) && void 0 !== n ? n : t),
postal_code: s,
state: o
})
}, ta = function(e) {
var t = e.name
, n = e.address
, r = void 0 === n ? {} : n
, a = e.phone
, i = r
, o = i.line1
, s = i.line2
, u = i.city
, l = i.state
, c = i.postal_code
, d = i.country;
return (0,
O.VJ)({
name: t,
phone: a,
line_1: o,
line_2: s,
locality: u,
administrative_area: l,
postal_code: c,
country_code: d
})
}, na = {
country: "US",
addressLine1: "",
addressLine2: "",
locality: "",
administrativeArea: "",
postalCode: ""
}, ra = {
name: "",
firstName: "",
lastName: "",
organizationName: ""
}, aa = function(e, t, n) {
return {
type: "input_validation_error",
code: e,
messageParams: t,
translateMessageParams: null == n ? void 0 : n.translateMessageParams,
displayImmediately: null == n ? void 0 : n.displayImmediately
}
}, ia = function(e, t) {
return e ? aa(e, t) : null
}, oa = aa, sa = (Ae = function(e) {
return e && oa(e)
}
,
function(e) {
var t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1]
, n = Kt(e.country);
return {
country: null,
addressLine1: Ae(un(n, e, "addressLine1", t)),
addressLine2: Ae(un(n, e, "addressLine2", t)),
locality: Ae(un(n, e, "locality")),
administrativeArea: Ae(un(n, e, "administrativeArea")),
postalCode: Ae(un(n, e, "postalCode"))
}
}
), ua = n(72292), la = (n(62320),
function(e) {
return e.EMAIL = "EMAIL",
e.SMS = "SMS",
e.WEBAUTHN = "WEBAUTHN",
e
}({})), ca = {
EMAIL: {
status: "NOT_STARTED"
},
SMS: {
status: "NOT_STARTED"
},
WEBAUTHN: {
status: "NOT_STARTED"
}
}, da = {
form: {
values: {
email: "",
passcode: "",
autofill: "NONE"
},
shouldUpdateLocalValueFromState: {
email: !0
},
displayErrors: {
email: !1,
passcode: !1,
autofill: !1
},
isEmpty: !0,
isComplete: !1,
isDeleting: !1,
focusedField: null,
authenticated: !1
},
options: {
defaultValues: null
},
isRtl: !1,
touched: !1,
isRecollectingPhone: !1,
isInEmailVerification: !1,
showEmailOtpResend: !1,
loggedOutOfAutofill: !1,
currentVerificationType: null,
verificationTypeState: ca
}, pa = function(e, t) {
return function() {
var n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : t || e
, r = arguments.length > 1 ? arguments[1] : void 0;
switch (r.type) {
case "AUTHENTICATION.INIT":
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
options: r.options,
isRtl: r.isRtl
});
case "AUTHENTICATION.FIELD_CHANGED":
var a = n.form.values[r.name]
, i = !(0,
O.Xy)(r.value, a);
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
touched: n.touched || i && r.touched,
form: (0,
b.Z)((0,
b.Z)({}, n.form), {}, {
values: (0,
b.Z)((0,
b.Z)({}, n.form.values), {}, (0,
v.Z)({}, r.name, r.value)),
displayErrors: (0,
b.Z)((0,
b.Z)({}, n.form.displayErrors), {}, (0,
v.Z)({}, r.name, !1)),
shouldUpdateLocalValueFromState: (0,
b.Z)((0,
b.Z)({}, n.form.shouldUpdateLocalValueFromState), {}, (0,
v.Z)({}, r.name, !r.oneWay))
})
});
case "AUTHENTICATION.FIELD_FOCUSED":
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
form: (0,
b.Z)((0,
b.Z)({}, n.form), {}, {
focusedField: r.name
})
});
case "AUTHENTICATION.DISPLAY_ERRORS":
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
form: (0,
b.Z)((0,
b.Z)({}, n.form), {}, {
displayErrors: (0,
b.Z)((0,
b.Z)({}, n.form.displayErrors), {}, (0,
v.Z)({}, r.name, !!n.form.values[r.name])),
focusedField: null
})
});
case "AUTHENTICATION.FIELD_BLURRED":
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
form: (0,
b.Z)((0,
b.Z)({}, n.form), {}, {
displayErrors: (0,
b.Z)((0,
b.Z)({}, n.form.displayErrors), {}, (0,
v.Z)({}, r.name, !!n.form.values[r.name] || n.form.displayErrors[r.name])),
focusedField: null
})
});
case "AUTHENTICATION.IS_DELETING_CHANGED":
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
form: (0,
b.Z)((0,
b.Z)({}, n.form), {}, {
isDeleting: r.isDeleting
})
});
case "AUTHENTICATION.AUTHENTICATED_CHANGED":
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
form: (0,
b.Z)((0,
b.Z)({}, n.form), {}, {
authenticated: r.authenticated
})
});
case "AUTHENTICATION.CLEAR_PASSCODE":
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
form: (0,
b.Z)((0,
b.Z)({}, n.form), {}, {
values: (0,
b.Z)((0,
b.Z)({}, n.form.values), {}, {
passcode: ""
})
})
});
case "AUTHENTICATION.CONTROLLER_USER_CLEARED":
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
form: da.form
});
case "ELEMENTS.DISPLAY_ERRORS":
return r.elementsToDisplayErrors && -1 === r.elementsToDisplayErrors.indexOf("linkAuthentication") ? n : (0,
b.Z)((0,
b.Z)({}, n), {}, {
form: (0,
b.Z)((0,
b.Z)({}, n.form), {}, {
displayErrors: (0,
O.Q8)(n.form.displayErrors, (function() {
return !0
}
))
})
});
case "CONSUMER.LOGOUT.SUCCESS":
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
form: (0,
b.Z)((0,
b.Z)({}, n.form), {}, {
values: (0,
b.Z)((0,
b.Z)({}, n.form.values), {}, {
passcode: ""
}),
displayErrors: da.form.displayErrors,
authenticated: !1
}),
touched: !0,
isRecollectingPhone: !1,
isInEmailVerification: !1,
showEmailOtpResend: !1,
currentVerificationType: null,
verificationTypeState: ca
});
case "AUTHENTICATION.IS_RECOLLECTING_PHONE_UPDATE":
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
isRecollectingPhone: r.isRecollectingPhone
});
case "AUTHENTICATION.SHOW_EMAIL_OTP_RESEND_UPDATE":
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
showEmailOtpResend: r.showEmailOtpResend
});
case "CONSUMER.START_VERIFICATION.PENDING":
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
showEmailOtpResend: !1,
verificationTypeState: (0,
b.Z)((0,
b.Z)({}, n.verificationTypeState), {}, (0,
v.Z)({}, r.verificationType, {
status: "PENDING"
}))
});
case "CONSUMER.START_VERIFICATION.SUCCESS":
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
isInEmailVerification: "EMAIL" === r.verificationType,
currentVerificationType: r.verificationType === la.WEBAUTHN ? n.currentVerificationType : r.verificationType,
verificationTypeState: (0,
b.Z)((0,
b.Z)({}, n.verificationTypeState), {}, (0,
v.Z)({}, r.verificationType, {
status: "SUCCESS"
}))
});
case "CONSUMER.START_VERIFICATION.ERROR":
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
verificationTypeState: (0,
b.Z)((0,
b.Z)({}, n.verificationTypeState), {}, (0,
v.Z)({}, r.verificationType, {
status: "ERROR"
}))
});
case "AUTHENTICATION.CLEAR_EMAIL_VERIFICATION":
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
isRecollectingPhone: !1,
showEmailOtpResend: !1,
isInEmailVerification: !1,
verificationTypeState: (0,
b.Z)((0,
b.Z)({}, n.verificationTypeState), {}, {
EMAIL: {
status: "NOT_STARTED"
}
})
});
case "AUTHENTICATION.LOG_OUT":
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
loggedOutOfAutofill: r.fromAutofill,
currentVerificationType: null,
verificationTypeState: ca
});
case "AUTHENTICATION.SET_VERIFICATION_TYPE":
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
currentVerificationType: r.value
});
default:
return n
}
}
}, ma = {
type: "input_validation_error",
code: "incomplete_email",
messageParams: null
}, fa = {
type: "input_validation_error",
code: "email_invalid",
messageParams: null
}, ha = {
type: "input_validation_error",
code: "incomplete_email_autofill",
messageParams: null
}, _a = function(e) {
var t = e.trim();
return "" === t ? ma : V.CU.test(t) ? null : fa
}, ya = function(e) {
return e.paymentElement.selectedPaymentForm
}, va = function(e) {
var t, n, r, a, i, o;
if (function(e) {
var t;
return ((null === (t = e.config.session) || void 0 === t ? void 0 : t.orderedPaymentMethodTypesAndWallets) || []).indexOf("link") >= 0
}(e))
o = "LINK_PAYMENT_METHOD";
else {
if (!function(e) {
var t, n;
return (null === (t = e.config.session) || void 0 === t || null === (n = t.linkSettings) || void 0 === n ? void 0 : n.linkPassthroughModeEnabled) || e.paymentElement.shouldForceEnableLinkPassthroughMode
}(e))
return {
available: !1,
unavailabilityReasons: ["link_payment_method_not_present"].concat((0,
Z.Z)(ba(e, "PASSTHROUGH")))
};
o = function(e) {
var t, n;
return "LINK_CARD_BRAND" === (null === (t = e.config.session) || void 0 === t || null === (n = t.linkSettings) || void 0 === n ? void 0 : n.linkMode)
}(e) ? "LINK_CARD_BRAND" : "PASSTHROUGH"
}
var s = ((null === (t = e.config) || void 0 === t || null === (n = t.session) || void 0 === n || null === (r = n.linkSettings) || void 0 === r ? void 0 : r.linkFundingSources.length) || 0) > 0
, u = e.paymentElement.shouldForceEnableLinkPassthroughMode;
if (!s && !u)
return {
available: !1,
unavailabilityReasons: ["no_link_funding_sources_available"]
};
var l = ga(e, o);
return !function(e) {
var t, n;
return -1 === (null !== (t = null === (n = e.config.session) || void 0 === n ? void 0 : n.unverifiedPaymentMethodsOnDomain) && void 0 !== t ? t : ["link"]).indexOf("link")
}(e) && (null !== (a = l.externalAutofillModal) && void 0 !== a && a.available || null !== (i = l.externalLinkAuthentication) && void 0 !== i && i.available) ? {
available: !1,
unavailabilityReasons: ["link_not_on_verified_domain"]
} : {
available: !0,
authenticationTypeAvailability: l,
mode: o
}
}, ga = function(e, t) {
var n, r, a, i, o, s = {};
if (function(e) {
var t;
return (null === (t = e.config.session) || void 0 === t ? void 0 : t.linkSettings.linkPaymentElementDisabledByTargeting) || !1
}(e))
return (0,
b.Z)((0,
b.Z)({}, s), {}, {
embedded: {
available: !1,
unavailabilityReasons: ["link_payment_element_disabled_by_targeting"]
},
expressCheckoutElementOnly: {
available: !0
}
});
if (!1 === (null === (n = e.config.mounted.linkAuthentication) || void 0 === n ? void 0 : n.internal) && (s.externalLinkAuthentication = {
available: !0
}),
(0,
N.uN)(e.config.betas, N.M4.link_autofill_modal_beta_1) && (s.externalAutofillModal = {
available: !0
}),
null !== (r = s.externalLinkAuthentication) && void 0 !== r && r.available || null !== (a = s.externalAutofillModal) && void 0 !== a && a.available)
return s;
if ("link" === ya(e) && (s.externalFinancialConnectionModal = {
available: !0
}),
function(e) {
return !!function(e) {
var t, n;
return !(null === (t = e.config.session) || void 0 === t || null === (n = t.linkSettings) || void 0 === n || !n.linkPageloadSignUpDisabled)
}(e) || !!e.paymentElement.installments.wantsInstallments || function(e) {
return e.consumer.hideLinkSignUpFromBillingCountry
}(e)
}(e))
return (0,
b.Z)((0,
b.Z)({}, s), {}, {
embedded: {
available: !1,
unavailabilityReasons: ["link_signup_disabled"]
}
});
var u, l, c, d, p, m = ba(e, t);
return m.length ? (0,
N.uN)(e.config.betas, N.M4.link_default_integration_beta_2) || e.paymentElement.shouldForceEnableLinkPassthroughMode || null !== (i = e.paymentElement.options.defaultValues) && void 0 !== i && null !== (o = i.billingDetails) && void 0 !== o && o.email ? (0,
b.Z)((0,
b.Z)({}, s), {}, {
embedded: {
available: !0
}
}) : (0,
b.Z)((0,
b.Z)({}, s), {}, {
embedded: {
available: !1,
unavailabilityReasons: m
}
}) : "PASSTHROUGH" !== t || "not_targeted" !== (null === (u = e.config.session) || void 0 === u || null === (l = u.linkSettings) || void 0 === l || null === (c = l.linkTargetingResults) || void 0 === c ? void 0 : c.paymentElementPassthroughMode) || e.consumer.loaded || null !== (d = e.paymentElement.options.defaultValues) && void 0 !== d && null !== (p = d.billingDetails) && void 0 !== p && p.email ? (0,
b.Z)((0,
b.Z)({}, s), {}, {
embedded: {
available: !0
}
}) : (0,
b.Z)((0,
b.Z)({}, s), {}, {
embedded: {
available: !1,
unavailabilityReasons: ["payment_element_passthrough_mode_not_targeted"]
}
})
}, ba = function(e, t) {
var n, r, a, i, o, s, u, l;
switch (t) {
case "PASSTHROUGH":
return (null === (n = e.config) || void 0 === n || null === (r = n.session) || void 0 === r || null === (a = r.linkSettings) || void 0 === a || null === (i = a.linkDisabledReasons) || void 0 === i ? void 0 : i.paymentElementPassthroughMode) || [];
case "LINK_PAYMENT_METHOD":
return (null === (o = e.config) || void 0 === o || null === (s = o.session) || void 0 === s || null === (u = s.linkSettings) || void 0 === u || null === (l = u.linkDisabledReasons) || void 0 === l ? void 0 : l.paymentElementPaymentMethodMode) || [];
case "LINK_CARD_BRAND":
return [];
default:
return (0,
P.Rz)(t)
}
}, Sa = function(e) {
if (!e.available)
return !1;
var t = (0,
O.D9)(e.authenticationTypeAvailability, (function(e, t) {
return "expressCheckoutElementOnly" !== e && t.available
}
));
return Object.keys(t).length > 0
}, ka = {
accel: !0,
american_express: !0,
cartes_bancaires: !0,
diners_club: !0,
discover: !0,
eftpos_au: !0,
elo: !0,
girocard: !0,
jcb: !0,
mastercard: !0,
nyce: !0,
pulse: !0,
rupay: !0,
star: !0,
unionpay: !0,
visa: !0
}, Ca = Object.keys({
accel: !0,
amex: !0,
carnet: !0,
cartes_bancaires: !0,
diners: !0,
discover: !0,
eftpos_au: !0,
elo: !0,
girocard: !0,
interac: !0,
jcb: !0,
mastercard: !0,
nyce: !0,
pulse: !0,
rupay: !0,
star: !0,
unionpay: !0,
visa: !0
}), Ea = {
eligible: !1,
preferred_networks: ["cartes_bancaires"],
supported_cobranded_networks: {
cartes_bancaires: !1
}
}, Za = function(e) {
return e.config.apiKey
}, Aa = function(e) {
return e.config.stripeAccount
}, Ma = function(e) {
return e.config.stripeJsId
}, Pa = function(e) {
var t = e.config.session;
if (!t)
throw new Error("Unable to select session. Make sure Elements is initialized with clientSecret\n or use the nullableSessionSelector() instead.");
return t
}, xa = function(e) {
return e.config.session
}, Ia = function(e) {
var t;
return null === (t = xa(e)) || void 0 === t ? void 0 : t.elementsSessionId
}, Na = function(e) {
var t;
return null === (t = Pa(e).parsedClientSecret) || void 0 === t ? void 0 : t.id
}, wa = function(e) {
return ni(e) ? vt.jL.HostedInvoicePagePaymentElement : Ta(e)
}, Ta = function(e) {
return qa(e) ? vt.jL.LinkAuthenticationElement : $a(e) ? vt.jL.LinkAuthenticationInPaymentElement : vt.jL.PaymentElement
}, Oa = function(e) {
var t, n, r, a, i = null === (t = Pa(e).parsedClientSecret) || void 0 === t ? void 0 : t.type;
if (i)
return i;
var o = null === (n = e.config.deferredIntent) || void 0 === n ? void 0 : n.mode;
if ("payment" === o)
return "PAYMENT_INTENT";
if ("setup" === o)
return "SETUP_INTENT";
if ("subscription" === o && null !== (r = e.config.deferredIntent) && void 0 !== r && r.amount)
return "PAYMENT_INTENT";
if ("subscription" !== o || null !== (a = e.config.deferredIntent) && void 0 !== a && a.amount)
throw new Error("Unexpected mode");
return "SETUP_INTENT"
}, Ra = function(e) {
return e.config.locale
}, La = function(e) {
return Pa(e).amount
}, Da = function(e) {
return Pa(e).currency
}, Ua = function(e, t) {
return Pa(e).featureFlags[t]
}, ja = function(e) {
return e.config.mounted
}, Ba = function(e) {
var t, n = ja(e)[V.Yj.address];
return !!n && !(null === (t = n.mode) || void 0 === t || !t.shipping)
}, Fa = function(e) {
var t, n = ja(e)[V.Yj.address];
return !!n && !(null === (t = n.mode) || void 0 === t || !t.billing)
}, Ga = function(e) {
return Fa(e) && Ba(e)
}, qa = function(e) {
var t;
return !1 === (null === (t = ja(e)[V.Yj.linkAuthentication]) || void 0 === t ? void 0 : t.internal)
}, Ka = function(e) {
var t, n;
return null !== (t = null === (n = Pa(e).customerInfo) || void 0 === n ? void 0 : n.email) && void 0 !== t ? t : null
}, Va = function(e) {
var t = Yt(e.address.country || "");
if (!t)
return !1;
var n = sa({
addressLine1: e.address.line1 || "",
addressLine2: e.address.line2 || "",
administrativeArea: e.address.state || "",
locality: e.address.city || "",
postalCode: e.address.postal_code || "",
country: t
});
return !(0,
O.VO)(n).some(Boolean)
}, za = function(e) {
var t, n, r = null === (t = xa(e)) || void 0 === t || null === (n = t.customerInfo) || void 0 === n ? void 0 : n.shipping;
return (r ? [r] : []).filter(Va)
}, Ha = function(e) {
return Pa(e).linkSettings
}, Ya = function(e) {
var t;
return null === (t = xa(e)) || void 0 === t ? void 0 : t.linkSettings
}, Wa = function(e) {
var t;
return (null === (t = Ya(e)) || void 0 === t ? void 0 : t.linkPassthroughModeEnabled) || e.paymentElement.shouldForceEnableLinkPassthroughMode
}, Ja = function(e) {
return Ha(e).isCryptoOnramp
}, Xa = function(e) {
return va(e).available && !function(e) {
return e.paymentElement.installments.wantsInstallments
}(e)
}, Qa = function(e) {
var t, n = va(e);
return n.available && null !== (t = n.authenticationTypeAvailability.embedded) && void 0 !== t && t.available ? "link_default_integration_2" : null
}, $a = function(e) {
var t, n, r = va(e);
return null !== (t = r.available && (null === (n = r.authenticationTypeAvailability.embedded) || void 0 === n ? void 0 : n.available)) && void 0 !== t && t
}, ei = function(e) {
var t;
return function(e) {
var t;
return ((null === (t = xa(e)) || void 0 === t ? void 0 : t.orderedPaymentMethodTypesAndWallets) || []).indexOf("link") >= 0
}(e) && !("SETUP_INTENT" !== (null === (t = Pa(e).parsedClientSecret) || void 0 === t ? void 0 : t.type) && !Pa(e).setupFutureUsage)
}, ti = function(e) {
return e.config.onBehalfOf
}, ni = function(e) {
return e.config.paymentUserAgentSuffix === ua.wl
}, ri = function(e) {
return Pa(e).linkSettings.linkPaymentElementEnableWebAuthnLogin
}, ai = function(e) {
var t;
return null === (t = xa(e)) || void 0 === t ? void 0 : t.linkPurchaseProtectionsData
}, ii = function(e) {
var t, n;
return null === (t = xa(e)) || void 0 === t || null === (n = t.linkSettings) || void 0 === n ? void 0 : n.linkPaymentSessionContext
}, oi = function(e) {
var t, n = null === (t = e.config.session) || void 0 === t ? void 0 : t.customer;
if (!n)
throw new Error("Unable to select customer. Make sure the customer is part of this session.");
return n
}, si = function(e) {
var t, n;
return null === (t = e.config.session) || void 0 === t || null === (n = t.customer) || void 0 === n ? void 0 : n.paymentMethods
}, ui = function(e) {
var t, n, r, a = ((null === (t = e.config.session) || void 0 === t || null === (n = t.customer) || void 0 === n || null === (r = n.customerSession) || void 0 === r ? void 0 : r.components) || {}).paymentElement, i = ((null == a ? void 0 : a.features) || {}).paymentMethodSave;
if (a && a.enabled && i)
switch (i) {
case "enabled":
return !0;
case "auto":
case "never":
case "disabled":
return !1;
default:
return (0,
P.Rz)(i)
}
}, li = function(e) {
var t, n, r, a, i, o, s, u = null == e || null === (t = e.customer) || void 0 === t || null === (n = t.customerSession) || void 0 === n || null === (r = n.components) || void 0 === r || null === (a = r.paymentElement.features) || void 0 === a ? void 0 : a.paymentMethodSetAsDefault;
switch (u) {
case "enabled":
return !0;
case "auto":
case "never":
case "disabled":
return !1;
case void 0:
return void 0 === (null === (i = e.customer) || void 0 === i || null === (o = i.customerSession) || void 0 === o || null === (s = o.components) || void 0 === s ? void 0 : s.paymentElement.enabled) && void 0;
default:
return (0,
P.Rz)(u)
}
}, ci = (vt.sf.SMS,
vt.sf.SMS,
vt.sf.EMAIL,
function(e) {
return e.authenticationElement.form.values
}
), di = function(e) {
if (Ka(e))
return {
email: null,
autofill: null
};
var t = ci(e)
, n = t.email
, r = t.autofill;
if (_i(e)) {
if ("NONE" === r)
return {
email: null,
autofill: ha
};
if ("OPT-IN" === r)
return {
email: null,
autofill: _a(n)
}
}
return {
email: _a(n),
autofill: null
}
}, pi = function(e) {
return e.authenticationElement.form.authenticated
}, mi = function(e) {
return e.authenticationElement.isInEmailVerification
}, fi = function(e) {
return "OPT-OUT" === e.authenticationElement.form.values.autofill
}, hi = function(e) {
return !Ua(e, "elements_disable_link_email_otp")
}, _i = function(e) {
return Xa(e) && "oneclick" === fd(e) && !(Hc(e) && td(e)) && od(e)
}, yi = ["external_hip_ach_credit_transfer", "external_hip_paper_check", "external_hip_sepa_credit_transfer"], vi = ["external_aplazame", "external_atone", "external_au_easy_payment", "external_au_pay", "external_azupay", "external_bank_pay", "external_benefit", "external_bitcash", "external_bizum", "external_catch", "external_dapp", "external_dbarai", "external_divido", "external_famipay", "external_fawry", "external_fonix", "external_gcash", "external_grabpay_later", "external_interac", "external_iwocapay", "external_kbc", "external_knet", "external_laybuy", "external_line_pay", "external_merpay", "external_momo", "external_net_cash", "external_nexi_pay", "external_octopus", "external_oney", "external_paidy", "external_pay_easy", "external_payconiq", "external_paypal", "external_paypay", "external_paypo", "external_paysafecard", "external_picpay", "external_planpay", "external_postepay", "external_postfinance", "external_rakuten_pay", "external_samsung_pay", "external_scalapay", "external_sezzle", "external_shopback_pay", "external_sofinco", "external_softbank_carrier_payment", "external_tabby", "external_tng_ewallet", "external_toss_pay", "external_truelayer", "external_twint", "external_venmo", "external_walley", "external_webmoney", "external_younited_pay"].concat(yi), gi = {}, bi = function() {
return gi
}, Si = {
external_aplazame: "aplazame",
external_atone: "atone",
external_au_easy_payment: "au_easy_payment",
external_au_pay: "au_pay",
external_azupay: "azupay",
external_bank_pay: "bank_pay",
external_benefit: "benefit",
external_bitcash: "bitcash",
external_bizum: "bizum",
external_catch: "catch",
external_dapp: "dapp",
external_dbarai: "dbarai",
external_divido: "divido",
external_famipay: "famipay",
external_fawry: "fawry",
external_fonix: "fonix",
external_gcash: "gcash",
external_grabpay_later: "grabpay_later",
external_interac: "interac",
external_iwocapay: "iwocapay",
external_kbc: "kbc",
external_knet: "knet",
external_laybuy: "laybuy",
external_line_pay: "line_pay",
external_merpay: "merpay",
external_momo: "momo",
external_net_cash: "net_cash",
external_nexi_pay: "nexi_pay",
external_octopus: "octopus",
external_oney: "oney",
external_paidy: "paidy",
external_pay_easy: "pay_easy",
external_payconiq: "payconiq",
external_paypal: "paypal",
external_paypay: "paypay",
external_paypo: "paypo",
external_paysafecard: "paysafecard",
external_picpay: "picpay",
external_planpay: "planpay",
external_postepay: "postepay",
external_postfinance: "postfinance",
external_rakuten_pay: "rakuten_pay",
external_samsung_pay: "samsung_pay",
external_scalapay: "scalapay",
external_sezzle: "sezzle",
external_shopback_pay: "shopback_pay",
external_sofinco: "sofinco",
external_softbank_carrier_payment: "softbank",
external_tabby: "tabby",
external_tng_ewallet: "tng_ewallet",
external_toss_pay: "toss_pay",
external_truelayer: "truelayer",
external_twint: "twint",
external_venmo: "venmo",
external_walley: "walley",
external_webmoney: "webmoney",
external_younited_pay: "younited_pay",
external_hip_ach_credit_transfer: null,
external_hip_paper_check: null,
external_hip_sepa_credit_transfer: null
}, ki = n(5937), Ci = n.n(ki), Ei = n(21520), Zi = n.n(Ei), Ai = n(3089), Mi = n.n(Ai), Pi = n(58256), xi = n.n(Pi), Ii = n(94223), Ni = n.n(Ii), wi = n(66863), Ti = n.n(wi), Oi = n(36628), Ri = n.n(Oi), Li = n(69824), Di = n.n(Li), Ui = n(83260), ji = n.n(Ui), Bi = n(24975), Fi = n.n(Bi), Gi = n(54481), qi = n.n(Gi), Ki = n(73381), Vi = n.n(Ki), zi = n(83181), Hi = n.n(zi), Yi = n(82142), Wi = n.n(Yi), Ji = function(e) {
switch (e) {
case "abn_amro":
return Ci();
case "asn_bank":
return Zi();
case "bunq":
return Mi();
case "ing":
return xi();
case "knab":
return Ni();
case "n26":
return Ti();
case "nn":
return Ri();
case "rabobank":
return Di();
case "regiobank":
return ji();
case "revolut":
return Fi();
case "sns_bank":
return qi();
case "triodos_bank":
return Vi();
case "van_lanschot":
return Hi();
case "yoursafe":
return Wi();
default:
return (0,
P.Rz)(e)
}
}, Xi = {
abn_amro: {
icon: Ji("abn_amro"),
text: "ABN Amro"
},
asn_bank: {
icon: Ji("asn_bank"),
text: "ASN Bank"
},
bunq: {
icon: Ji("bunq"),
text: "bunq B.V.".concat(he.Lb)
},
ing: {
icon: Ji("ing"),
text: "ING Bank"
},
knab: {
icon: Ji("knab"),
text: "Knab"
},
n26: {
icon: Ji("n26"),
text: "N26"
},
nn: {
icon: Ji("nn"),
text: "Nationale-Nederlanden"
},
rabobank: {
icon: Ji("rabobank"),
text: "Rabobank"
},
regiobank: {
icon: Ji("regiobank"),
text: "RegioBank"
},
revolut: {
icon: Ji("revolut"),
text: "Revolut"
},
sns_bank: {
icon: Ji("sns_bank"),
text: "SNS Bank"
},
triodos_bank: {
icon: Ji("triodos_bank"),
text: "Triodos Bank"
},
van_lanschot: {
icon: Ji("van_lanschot"),
text: "Van Lanschot Kempen"
},
yoursafe: {
icon: Ji("yoursafe"),
text: "Yoursafe"
}
}, Qi = (Object.keys(Xi).map((function(e) {
return {
value: e,
icon: Xi[e].icon,
text: Xi[e].text
}
}
)),
n(81743)), $i = (n(56274).Promise,
(0,
x.HP)((function(e) {
return window.ApplePaySession.canMakePaymentsWithActiveCard(e)
}
)),
(0,
M.mC)({
amount: M.MZ,
label: M.Z_,
recurringPaymentStartDate: (0,
M.jt)(M.Kr),
recurringPaymentEndDate: (0,
M.jt)(M.Kr),
recurringPaymentIntervalUnit: (0,
M.jt)((0,
M.kw)("year", "month", "day", "hour", "minute")),
recurringPaymentIntervalCount: (0,
M.jt)((0,
M.M2)(0))
})), eo = {
paymentDescription: M.Z_,
managementURL: M.Z_,
regularBilling: $i,
trialBilling: (0,
M.jt)($i)
}, to = {
paymentDescription: M.Z_,
managementURL: M.Z_,
deferredBilling: (0,
M.mC)({
amount: M.MZ,
label: M.Z_,
deferredPaymentDate: M.Kr
}),
freeCancellationDate: (0,
M.jt)(M.Kr),
freeCancellationDateTimeZone: (0,
M.jt)(M.Z_),
billingAgreement: (0,
M.jt)(M.Z_)
}, no = {
paymentDescription: M.Z_,
managementURL: M.Z_,
automaticReloadBilling: (0,
M.mC)({
amount: M.MZ,
label: M.Z_,
automaticReloadPaymentThresholdAmount: M.MZ
})
}, ro = Object.freeze({
recurringPaymentRequest: (0,
M.jt)((0,
M.AG)((0,
M.mC)((0,
b.Z)((0,
b.Z)({}, eo), {}, {
billingAgreement: (0,
M.jt)(M.Z_)
})))),
deferredPaymentRequest: (0,
M.jt)((0,
M.AG)((0,
M.mC)(to))),
automaticReloadPaymentRequest: (0,
M.jt)((0,
M.AG)((0,
M.mC)((0,
b.Z)((0,
b.Z)({}, no), {}, {
billingAgreement: (0,
M.jt)(M.Z_)
}))))
}), ao = (0,
M.mC)({
amount: M.Cz,
label: M.Z_,
recurringPaymentStartDate: (0,
M.jt)(M.Kr),
recurringPaymentEndDate: (0,
M.jt)(M.Kr),
recurringPaymentIntervalUnit: (0,
M.jt)((0,
M.kw)("year", "month", "day", "hour", "minute")),
recurringPaymentIntervalCount: (0,
M.jt)(M.Cz)
}), io = {
paymentDescription: M.Z_,
managementURL: M.Z_,
regularBilling: ao,
trialBilling: (0,
M.jt)(ao)
}, oo = {
paymentDescription: M.Z_,
managementURL: M.Z_,
deferredBilling: (0,
M.mC)({
amount: M.Cz,
label: M.Z_,
deferredPaymentDate: M.Kr
}),
freeCancellationDate: (0,
M.jt)(M.Kr),
freeCancellationDateTimeZone: (0,
M.jt)(M.Z_),
billingAgreement: (0,
M.jt)(M.Z_)
}, so = {
paymentDescription: M.Z_,
managementURL: M.Z_,
automaticReloadBilling: (0,
M.mC)({
amount: M.Cz,
label: M.Z_,
automaticReloadPaymentThresholdAmount: M.Cz
})
}, uo = ((0,
M.jt)((0,
M.AG)((0,
M.mC)((0,
b.Z)((0,
b.Z)({}, io), {}, {
billingAgreement: (0,
M.jt)(M.Z_)
})))),
(0,
M.jt)((0,
M.AG)((0,
M.mC)(oo))),
(0,
M.jt)((0,
M.AG)((0,
M.mC)((0,
b.Z)((0,
b.Z)({}, so), {}, {
billingAgreement: (0,
M.jt)(M.Z_)
})))),
Object.freeze({
recurringPaymentRequest: (0,
M.jt)((0,
M.AG)((0,
M.mC)(eo))),
deferredPaymentRequest: (0,
M.jt)((0,
M.AG)((0,
M.mC)(to))),
automaticReloadPaymentRequest: (0,
M.jt)((0,
M.AG)((0,
M.mC)(no)))
})), lo = ((0,
M.CT)(M.z$.apply(void 0, (0,
Z.Z)(vi))),
[].concat((0,
Z.Z)(z.y.typesSupportingPaymentElement), ["affirm", "afterpay_clearpay", "alipay", "alma", "acss_debit", "amazon_pay", "au_becs_debit", "bancontact", "blik", "boleto", "card", "cashapp", "crypto", "customer_balance", "eps", "fpx", "giropay", "grabpay", "id_bank_transfer", "ideal", "klarna", "konbini", "naver_pay", "kakao_pay", "payco", "kr_card", "samsung_pay", "kr_market", "link", "link_card_brand", "mb_way", "mobilepay", "multibanco", "ng_bank", "ng_bank_transfer", "ng_card", "ng_market", "ng_ussd", "oxxo", "p24", "pay_by_bank", "paynow", "paypal", "payto", "pix", "promptpay", "demo_pay", "rechnung", "revolut_pay", "sunbit", "satispay", "sepa_debit", "sofort", "swish", "twint", "us_bank_account", "upi", "wechat_pay", "zip", "south_korea_market", "nz_bank_account", "bacs_debit", "gopay", "qris", "shopeepay", "apple_pay", "google_pay"], (0,
Z.Z)(vi))), co = [V.rM.VISA, V.rM.MASTERCARD, V.rM.AMEX, V.rM.DISCOVER, V.rM.DINERS, V.rM.JCB, V.rM.UNIONPAY, V.rM.ELO], po = ((0,
v.Z)({}, V.rM.AMEX, ["BR", "MY", "AE", "TH"]),
Me = {},
(0,
v.Z)(Me, V.rM.ELO, ["CA", "US", "GB"]),
(0,
v.Z)(Me, V.rM.DISCOVER, ["CA", "JP", "US", "GB"]),
(0,
v.Z)(Me, V.rM.DINERS, ["CA", "JP", "US", "GB"]),
(0,
v.Z)(Me, V.rM.JCB, ["AU", "CA", "DE", "GB", "IE", "JP", "NZ", "PL", "SG", "US"]),
(0,
v.Z)(Me, V.rM.UNIONPAY, ["AU", "CA", "HK", "MY", "NZ", "SG", "GB", "US", "CH", "AT", "BE", "BG", "CY", "CZ", "DK", "EE", "FI", "FR", "DE", "GR", "HU", "IE", "IT", "LV", "LT", "LU", "MT", "NL", "PL", "PT", "RO", "SK", "SI", "ES", "SE", "NO"]),
Me), mo = (V.rM.VISA,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.UNIONPAY,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.AMEX,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.AMEX,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.AMEX,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.AMEX,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.AMEX,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.AMEX,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.AMEX,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.AMEX,
V.rM.VISA,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.AMEX,
V.rM.VISA,
V.rM.VISA,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.AMEX,
V.rM.UNIONPAY,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.AMEX,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.AMEX,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.UNIONPAY,
V.rM.JCB,
V.rM.AMEX,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.AMEX,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.AMEX,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.AMEX,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.UNIONPAY,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.AMEX,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.AMEX,
V.rM.DINERS,
V.rM.DISCOVER,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.AMEX,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.AMEX,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.AMEX,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.AMEX,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.AMEX,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.AMEX,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.AMEX,
V.rM.VISA,
V.rM.VISA,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.AMEX,
V.rM.UNIONPAY,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.AMEX,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.DINERS,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.JCB,
V.rM.AMEX,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.AMEX,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.AMEX,
V.rM.DINERS,
V.rM.DISCOVER,
V.rM.JCB,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.AMEX,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.AMEX,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.JCB,
V.rM.MASTERCARD,
V.rM.AMEX,
V.rM.DINERS,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.UNIONPAY,
V.rM.VISA,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.AMEX,
V.rM.UNIONPAY,
V.rM.JCB,
V.rM.DISCOVER,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.AMEX,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.UNIONPAY,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.AMEX,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.DINERS,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.JCB,
V.rM.UNIONPAY,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.UNIONPAY,
V.rM.AMEX,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.UNIONPAY,
V.rM.AMEX,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.AMEX,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.AMEX,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.AMEX,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.AMEX,
V.rM.VISA,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.AMEX,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.AMEX,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.AMEX,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.AMEX,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.AMEX,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.AMEX,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.AMEX,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.AMEX,
V.rM.DINERS,
V.rM.AMEX,
V.rM.UNIONPAY,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.AMEX,
V.rM.JCB,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.AMEX,
V.rM.UNIONPAY,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.AMEX,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.AMEX,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.DINERS,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.AMEX,
V.rM.UNIONPAY,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.AMEX,
V.rM.VISA,
V.rM.VISA,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.AMEX,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.AMEX,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.DINERS,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.UNIONPAY,
V.rM.VISA,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.AMEX,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.UNIONPAY,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.AMEX,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.AMEX,
V.rM.JCB,
V.rM.UNIONPAY,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.UNIONPAY,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.DISCOVER,
V.rM.AMEX,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.JCB,
V.rM.AMEX,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.AMEX,
V.rM.DISCOVER,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.AMEX,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.UNIONPAY,
V.rM.VISA,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.AMEX,
V.rM.JCB,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.AMEX,
V.rM.VISA,
V.rM.MASTERCARD,
V.rM.VISA,
V.rM.MASTERCARD,
{
UNIONPAY: "unionpay",
JCB: "jcb",
ELO: "elo",
DISCOVER: "discover",
DINERS: "diners_club"
}), fo = {
VISA: "visa",
MASTERCARD: "mastercard",
AMEX: "amex",
AMERICAN_EXPRESS: "american_express",
DISCOVER_GLOBAL_NETWORK: "discover_global_network"
}, ho = (Pe = {},
(0,
v.Z)(Pe, fo.VISA, [V.rM.VISA]),
(0,
v.Z)(Pe, fo.MASTERCARD, [V.rM.MASTERCARD]),
(0,
v.Z)(Pe, fo.AMEX, [V.rM.AMEX]),
(0,
v.Z)(Pe, fo.AMERICAN_EXPRESS, [V.rM.AMEX]),
(0,
v.Z)(Pe, fo.DISCOVER_GLOBAL_NETWORK, [V.rM.DISCOVER, V.rM.DINERS, V.rM.JCB, V.rM.UNIONPAY, V.rM.ELO]),
(0,
v.Z)(Pe, mo.UNIONPAY, [V.rM.UNIONPAY]),
(0,
v.Z)(Pe, mo.JCB, [V.rM.JCB]),
(0,
v.Z)(Pe, mo.ELO, [V.rM.ELO]),
(0,
v.Z)(Pe, mo.DISCOVER, [V.rM.DISCOVER]),
(0,
v.Z)(Pe, mo.DINERS, [V.rM.DINERS]),
Pe), _o = Object.keys(mo).map((function(e) {
return mo[e]
}
)), yo = function(e) {
var t = Object.keys(fo).map((function(e) {
return fo[e]
}
));
return e === N.M4.blocked_card_brands_beta_1 ? t.filter((function(e) {
return e !== fo.AMERICAN_EXPRESS
}
)) : t.filter((function(e) {
return e !== fo.AMEX
}
))
}, vo = M.kw.apply(void 0, (0,
Z.Z)(yo(N.M4.blocked_card_brands_beta_1))), go = M.z$.apply(void 0, (0,
Z.Z)(yo()).concat((0,
Z.Z)(_o))), bo = {
CARD: ["card"],
INSTANT_DEBITS: ["link", "link_card_brand"]
}, So = (0,
M.mC)({
email: (0,
M.jt)((0,
M.AG)(M.Z_)),
name: (0,
M.jt)((0,
M.AG)(M.Z_)),
phone: (0,
M.jt)((0,
M.AG)(M.Z_)),
address: (0,
M.jt)((0,
M.mC)({
city: (0,
M.jt)((0,
M.AG)(M.Z_)),
country: (0,
M.jt)((0,
M.AG)(M.Z_)),
line1: (0,
M.jt)((0,
M.AG)(M.Z_)),
line2: (0,
M.jt)((0,
M.AG)(M.Z_)),
postal_code: (0,
M.jt)((0,
M.AG)(M.Z_)),
state: (0,
M.jt)((0,
M.AG)(M.Z_))
}))
}), ko = M.z$.apply(void 0, (0,
Z.Z)(Ca)), Co = (0,
M.mC)({
network: (0,
M.jt)((0,
M.CT)(ko))
}), Eo = M.kw.apply(void 0, (0,
Z.Z)(Object.keys(Xi))), Zo = (0,
M.mC)({
bank: (0,
M.jt)(Eo)
}), Ao = (0,
M.mC)({
ideal: (0,
M.jt)(Zo)
}), Mo = (0,
M.mC)({
saveForFuturePurchases: (0,
M.jt)((0,
M.or)(M.Xg, M.HM)),
setAsDefault: (0,
M.jt)((0,
M.or)(M.Xg, M.HM))
}), Po = ((0,
M.mC)({
billingDetails: (0,
M.jt)(So),
card: (0,
M.jt)(Co),
paymentMethods: (0,
M.jt)(Ao),
savePaymentMethod: (0,
M.jt)(Mo)
}),
(0,
M.mC)({
enableSave: (0,
M.jt)((0,
M.kw)("never", "auto")),
enableSetAsDefault: (0,
M.jt)((0,
M.kw)("never", "auto")),
messages: (0,
M.jt)((0,
M.mC)({
saveLabel: (0,
M.jt)(M.Z_),
setAsDefaultLabel: (0,
M.jt)(M.Z_),
removeSavedDialogBody: (0,
M.jt)(M.Z_)
})),
maxVisiblePaymentMethods: (0,
M.jt)((0,
M.or)((0,
M.M4)(0), (0,
M.ig)(0)))
}),
Object.keys(Qi.yv)), xo = ((0,
M.mC)(uo),
(0,
M.mC)((0,
b.Z)((0,
b.Z)({}, ro), {}, {
applePayLaterAvailability: (0,
M.jt)(M.kw.apply(void 0, Po))
})),
(0,
M.mC)({
billingDetails: (0,
M.jt)((0,
M.or)((0,
M.kw)("never", "auto"), (0,
M.mC)({
name: (0,
M.jt)((0,
M.kw)("never", "auto")),
phone: (0,
M.jt)((0,
M.kw)("never", "auto")),
email: (0,
M.jt)((0,
M.kw)("never", "auto")),
address: (0,
M.jt)((0,
M.or)((0,
M.kw)("never", "auto", "if_required"), (0,
M.mC)({
country: (0,
M.jt)((0,
M.kw)("never", "auto")),
postalCode: (0,
M.jt)((0,
M.kw)("never", "auto")),
state: (0,
M.jt)((0,
M.kw)("never", "auto")),
city: (0,
M.jt)((0,
M.kw)("never", "auto")),
line1: (0,
M.jt)((0,
M.kw)("never", "auto")),
line2: (0,
M.jt)((0,
M.kw)("never", "auto"))
})))
})))
}),
(0,
M.mC)({
amazon_pay: (0,
M.jt)((0,
M.kw)("auto", "always", "never")),
applePay: (0,
M.jt)((0,
M.kw)("auto", "always", "never")),
auBecsDebit: (0,
M.jt)((0,
M.kw)("auto", "always", "never")),
bancontact: (0,
M.jt)((0,
M.kw)("auto", "always", "never")),
card: (0,
M.jt)((0,
M.kw)("auto", "always", "never")),
cashapp: (0,
M.jt)((0,
M.kw)("auto", "always", "never")),
demo_pay: (0,
M.jt)((0,
M.kw)("auto", "always", "never")),
googlePay: (0,
M.jt)((0,
M.kw)("auto", "always", "never")),
ideal: (0,
M.jt)((0,
M.kw)("auto", "always", "never")),
kr_market: (0,
M.jt)((0,
M.kw)("auto", "always", "never")),
ng_card: (0,
M.jt)((0,
M.kw)("auto", "always", "never")),
ng_market: (0,
M.jt)((0,
M.kw)("auto", "always", "never")),
paypal: (0,
M.jt)((0,
M.kw)("auto", "always", "never")),
revolut_pay: (0,
M.jt)((0,
M.kw)("auto", "always", "never")),
sepaDebit: (0,
M.jt)((0,
M.kw)("auto", "always", "never")),
sofort: (0,
M.jt)((0,
M.kw)("auto", "always", "never")),
usBankAccount: (0,
M.jt)((0,
M.kw)("auto", "always", "never"))
}),
(0,
M.or)((0,
M.kw)("auto", "never"), (0,
M.mC)({
applePay: (0,
M.jt)((0,
M.kw)("auto", "never")),
googlePay: (0,
M.jt)((0,
M.kw)("auto", "never"))
})),
(0,
M.or)((0,
M.kw)("auto", "never"), M.Ry),
(0,
M.mC)({
applePay: (0,
M.jt)((0,
M.kw)("auto", "never")),
googlePay: (0,
M.jt)((0,
M.kw)("auto", "never"))
}),
(0,
M.CT)(vo),
(0,
M.CT)(go),
(0,
M.mC)({
onEvent: (0,
M.jt)(M.uz)
}),
(0,
M.kw)("accordion", "tabs", "auto")), Io = ((0,
M.or)(xo, M.Ry),
(0,
M.mC)({
type: xo,
radios: (0,
M.jt)(M.Xg),
spacedAccordionItems: (0,
M.jt)(M.Xg),
defaultCollapsed: (0,
M.jt)(M.Xg),
visibleAccordionItemsCount: (0,
M.jt)((0,
M.M2)(0))
}),
(0,
M.mC)({
type: xo,
radios: (0,
M.jt)(M.Xg),
spacedAccordionItems: (0,
M.jt)(M.Xg),
visibleAccordionItemsCount: (0,
M.jt)((0,
M.M2)(0))
}),
(0,
M.or)(xo, (0,
M.or)((0,
M.mC)({
type: (0,
M.kw)("tabs", "auto")
}), (0,
M.mC)({
type: (0,
M.kw)("accordion"),
radios: (0,
M.jt)(M.Xg),
spacedAccordionItems: (0,
M.jt)(M.Xg),
visibleAccordionItemsCount: (0,
M.jt)((0,
M.M2)(0))
}))),
(0,
M.or)(xo, (0,
M.or)((0,
M.mC)({
type: (0,
M.kw)("tabs", "auto"),
defaultCollapsed: (0,
M.jt)(M.HM)
}), (0,
M.mC)({
type: (0,
M.kw)("accordion"),
defaultCollapsed: (0,
M.jt)(M.HM),
radios: (0,
M.jt)(M.HM),
spacedAccordionItems: (0,
M.jt)(M.HM),
visibleAccordionItemsCount: (0,
M.jt)((0,
M.gy)(0))
}))),
{
"billing_details.name": !0,
"billing_details.email": !0,
"billing_details.phone": !0,
"billing_details.address.country": !0,
"billing_details.address.postal_code": !0,
"billing_details.address.state": !0,
"billing_details.address.city": !0,
"billing_details.address.line1": !0,
"billing_details.address.line2": !0
}), No = function(e, t) {
for (var n = (0,
O.RP)(t); n.length > 0; ) {
var r = (0,
O.uu)(e, n.map(x.i3));
if ("never" === r || "auto" === r || "if_required" === r)
return {
fieldOption: r,
fieldsOptionPath: n.join(".")
};
n.pop()
}
return {
fieldOption: "auto",
fieldsOptionPath: null
}
}, wo = function(e, t) {
return No(e, t).fieldOption
}, To = function(e) {
return Object.keys(Io).map((function(t) {
var n = No(e, t)
, r = n.fieldOption;
return {
paymentMethodDataPath: t,
fieldsOptionPath: n.fieldsOptionPath,
fieldOption: r
}
}
))
}, Oo = ["visa", "mastercard", "amex", "discover", "diners", "diners14", "jcb", "unionpay", "elo"], Ro = {
visa: /^4/,
mastercard: /^(50[0-5,7-8]|5069|51|52|53|54|55|56|58|22|23|24|25|26|27|60[0,2-9]|601[0,2-9]|627[1-6,8-9]|627767|63[0-5,7-9]|6361|67)/,
amex: /^(34|37)/,
discover: /^(6011|64|65)/,
diners: /^(30|38|39)/,
diners14: /^(36)/,
jcb: /^(35)/,
unionpay: /^(62[0-6,8-9]|6270|6277[0-5,7,9]|62776[0-6,8-9]|62778[1-9]|81)/,
elo: /^(5067|509|636368|627780)/
}, Lo = function() {
var e = arguments.length > 0 && void 0 !== arguments[0] && arguments[0];
return {
cartes_bancaires: {
minLength: 16,
maxLength: 16,
cvcMaxLength: 3,
cvcMinLength: null
},
visa: {
minLength: 16,
maxLength: e ? 19 : 16,
cvcMaxLength: 3,
cvcMinLength: null
},
mastercard: {
minLength: 16,
maxLength: e ? 19 : 16,
cvcMaxLength: 3,
cvcMinLength: null
},
amex: {
minLength: 15,
maxLength: 15,
cvcMaxLength: 4,
cvcMinLength: 3
},
unionpay: {
minLength: 13,
maxLength: 19,
cvcMaxLength: 3,
cvcMinLength: null
},
diners: {
minLength: 16,
maxLength: 16,
cvcMaxLength: 3,
cvcMinLength: null
},
diners14: {
minLength: 14,
maxLength: 14,
cvcMaxLength: 3,
cvcMinLength: null
},
discover: {
minLength: 16,
maxLength: 16,
cvcMaxLength: 3,
cvcMinLength: null
},
jcb: {
minLength: 16,
maxLength: 16,
cvcMaxLength: 3,
cvcMinLength: null
},
elo: {
minLength: 16,
maxLength: 16,
cvcMaxLength: 3,
cvcMinLength: null
},
unknown: {
minLength: 16,
maxLength: 16,
cvcMaxLength: 4,
cvcMinLength: 3
}
}
}, Do = (0,
x.HP)((function() {
var e, t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "", n = Je(t), r = 0;
return Oo.forEach((function(t) {
var a = Ro[t]
, i = n.match(a);
if (i) {
var o = i[0];
o && o.length > r && (e = t,
r = o.length)
}
}
)),
e || "unknown"
}
)), Uo = function(e) {
return "diners14" === e ? "diners" : e
}, jo = {
brand: Do,
unifiedBrand: function() {
var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : ""
, t = Do(e);
return Uo(t)
},
brandToUnifiedBrand: Uo,
isVariableLengthCard: function() {
var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : ""
, t = Lo()[Do(e)]
, n = t.minLength
, r = t.maxLength;
return n !== r
}
}, Bo = new RegExp("".concat(he.Lb),"g"), Fo = function(e) {
var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}
, n = t.ignoreIncomplete
, r = e.replace(Bo, "").split(" / ")
, a = r[1] || ""
, i = parseInt(a, 10)
, o = 2 === a.length ? i % 100 : i
, s = r[0]
, u = parseInt(s, 10);
return a.length < 2 || 3 === a.length ? n ? null : oa("incomplete_expiry") : ia((0,
M.eH)(o, u, {
ignoreIncomplete: n
}))
}, Go = function(e) {
return function() {
return e
}
}, qo = function() {
return null
}, Ko = function() {
return "all_caps"
}, Vo = function(e) {
return (0,
O.Sm)(e.map((function(e) {
return e.length
}
)))
}, zo = function(e, t, n) {
var r = arguments.length > 3 && void 0 !== arguments[3] && arguments[3]
, a = arguments.length > 4 && void 0 !== arguments[4] && arguments[4]
, i = e(t, a);
if (!i)
return {
value: t,
selection: null,
autocorrectComplete: !!t
};
if ("all_caps" === i)
return {
value: t.toUpperCase(),
selection: null,
autocorrectComplete: !!t
};
for (var o = 0, s = 0, u = [], l = [], c = 0 === n.selectionStart ? 0 : null, d = 0 === n.selectionEnd ? 0 : null, p = function() {
null === c && o + 1 >= n.selectionStart && (c = Vo(u) + (r ? l.length : 0)),
null === d && o + 1 >= n.selectionEnd && (d = Vo(u) + (r ? l.length : 0))
}, m = function(e) {
e > 0 && (p(),
o += e)
}; s < i.length; ) {
var f = i[s]
, h = f(t.slice(o))
, _ = h.consumed
, y = h.type
, v = h.result;
if ("required" === y)
if ("" !== v) {
if (u = [].concat((0,
Z.Z)(u), (0,
Z.Z)(l), [v]),
l = [],
s += 1,
h.partial) {
m(t.length - o);
break
}
m(_)
} else {
if (!_)
break;
m(1)
}
else if ("optional" === y)
"" !== v && (u = [].concat((0,
Z.Z)(u), (0,
Z.Z)(l), [v]),
l = [],
m(_)),
s += 1;
else if ("formatting" === y) {
if (!r && o >= t.length)
break;
l = [].concat((0,
Z.Z)(l), [v]),
s += 1,
m(_)
}
}
return r && (u = [].concat((0,
Z.Z)(u), (0,
Z.Z)(l))),
{
value: u.join(""),
selection: {
selectionStart: null === c || t.length && n.selectionStart === t.length ? Vo(u) : c,
selectionEnd: null === d || t.length && n.selectionEnd === t.length ? Vo(u) : d
},
autocorrectComplete: s === i.length
}
}, Ho = function(e, t) {
return zo(e, t, {
selectionStart: 0,
selectionEnd: 0
}, !1).autocorrectComplete
}, Yo = "0".charCodeAt(0) - "0".charCodeAt(0), Wo = /[0-9]/g, Jo = function(e) {
return String.fromCharCode(e.charCodeAt(0) - Yo)
}, Xo = function(e) {
return e.replace(Wo, Jo)
}, Qo = function(e, t) {
return {
type: "optional",
result: e,
consumed: t
}
}, $o = function(e, t) {
var n = arguments.length > 2 && void 0 !== arguments[2] && arguments[2];
return {
type: "required",
result: e,
consumed: t,
partial: n
}
}, es = function(e) {
var t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1];
return function(n) {
var r = new RegExp("^".concat(e.source.replace(/^\^/, "")))
, a = n.match(r)
, i = t ? Qo : $o;
if (a) {
var o = a[0];
return i(o, a.index + o.length)
}
return i("", n.length)
}
}, ts = es(/[A-Za-z]/), ns = function(e) {
var t = es(/\w/)(e);
return t.result ? $o(t.result.toUpperCase(), t.consumed) : t
}, rs = es(/1[0-2]|0?[1-9]|0/), as = {
digit: function(e) {
return es(/[0-9]/)(Xo(e))
},
optionalDigit: function(e) {
var t = es(/[0-9]/, !0)(Xo(e));
return t.result ? t : Qo("", 0)
},
letter: ts,
character: es(/[\w]/),
capitalLetter: function(e) {
var t = es(/[A-Za-z]/)(e);
return t.result ? ns(e) : t
},
capitalCharacter: ns,
month: function(e) {
var t = rs(Xo(e))
, n = t.result.replace(/\D/g, "")
, r = "0" === t.result && 1 === e.length
, a = "1" === t.result && 1 === e.length;
return r || a || "0" === t.result && e.length >= 2 ? $o(t.result, e.length, !0) : $o(1 === n.length ? "0".concat(n) : n, t.consumed)
},
formattingCharacter: function(e) {
return function(t) {
return n = e,
r = t[0] === e ? 1 : 0,
{
type: "formatting",
result: n,
consumed: r
};
var n, r
}
},
optionalPattern: function(e) {
return function(t) {
var n = es(e, !0)(t);
return n.result ? n : Qo("", 0)
}
},
regexPattern: es
}, is = as.digit, os = as.optionalDigit, ss = as.capitalCharacter, us = as.formattingCharacter(" "), ls = as.formattingCharacter(he.Lb), cs = as.optionalPattern(/\d\d/), ds = [is, is, is, is, us, is, is, is, is, is, is, us, is, is, is, is, is], ps = [is, is, is, is, us, is, is, is, is, is, is, us, is, is, is, is], ms = (0,
x.HP)((function(e) {
for (var t = [], n = 0, r = 0; n < e; )
4 === r ? (t.push(us),
r = 0) : (t.push(is),
n += 1,
r += 1);
return t
}
)), fs = function(e, t) {
var n = jo.brand(e);
if ("amex" === n)
return ds;
if ("diners14" === n)
return ps;
var r, a, i, o = Lo(t)[n], s = o.minLength, u = o.maxLength, l = Je(e).length, c = (r = l,
a = s,
i = u,
Math.min(Math.max(a, r), i));
return ms(c)
}, hs = {
cardNumber: fs,
rtlCardNumber: function(e, t) {
return [ls].concat((0,
Z.Z)(fs(e, t)))
},
redactedCardNumber: function(e, t) {
return "amex" === e ? "•••• •••••• •".concat(t) : "•••• •••• •••• ".concat(t)
},
cardExpiry: Go([as.month, us, as.formattingCharacter("/"), us, is, is, cs]),
rtlCardExpiry: Go([ls, as.month, us, as.formattingCharacter("/"), us, ls, is, is, cs]),
cardCvc: function() {
var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "";
return hs.cardCvcFromBrand(jo.brand(e))
},
cardCvcFromBrand: (0,
x.HP)((function(e) {
var t = Lo()[e]
, n = t.cvcMinLength
, r = t.cvcMaxLength
, a = Array.apply(void 0, (0,
Z.Z)(Array(n || r))).map((function() {
return is
}
))
, i = [];
if (n && n < r) {
var o = r - n;
o && (i = Array.apply(void 0, (0,
Z.Z)(Array(o))).map((function() {
return os
}
)))
}
return Go([].concat((0,
Z.Z)(a), (0,
Z.Z)(i)))
}
)),
redactedCardCvcFromBrand: function(e) {
return "amex" === e ? "••••" : "•••"
},
postalCodeFromCountry: (0,
x.HP)((function(e) {
switch (e) {
case "UA":
case "US":
return Go([is, is, is, is, is]);
case "IN":
return Go([is, is, is, is, is, is]);
case "CA":
return Go([ss, ss, ss, us, ss, ss, ss]);
case "GB":
return Ko;
default:
return qo
}
}
))
}, _s = hs, ys = window.location.origin === V.jQ, vs = {}, gs = function(e) {
var t;
if (!ys)
return !1;
if (!(e in vs))
try {
vs[e] = "true" === localStorage.getItem(e)
} catch (t) {
vs[e] = !1
}
return null !== (t = vs[e]) && void 0 !== t && t
}, bs = n(41216), Ss = gs("FORCE_LINK_IN_CARD"), ks = {
is_override: !0,
link_available: {
card_element: !0,
split_card_elements: !0,
checkout: !0,
payment_request_button: !0
},
google_pay_available: {
payment_request_button: !1
},
apple_pay_available: {
payment_request_button: !1
},
apple_pay_later_available: {
payment_request_button: !1
},
link_settings: {
merchant_info: {
business_name: "Test Business",
country: "US"
},
customer_info: {
country: "US"
},
link_disabled_reasons: {
card_element: [],
split_card_elements: []
},
link_purchase_protections_data: {
is_eligible: !1,
type: "shopping"
},
link_funding_sources: ["CARD"]
},
experiments: {
experiment_assignments: {},
arb_id: "default",
elements_session_id: null,
elements_assignment_id: null
},
gates: {
elements_display_prb_warning: !1,
is_testmode_preview: !1
},
passive_captcha: null,
card_brand_choice: Ea,
verified_payment_methods_on_domain: {
apple_pay: !1,
google_pay: !1,
link: !1
}
}, Cs = bs.td ? ["", "", ""] : ["pk_test_51LGShDDyaLrjkeNa24KnDiDeOZekDxWCD9SBHcLjE46W7sNtjUXoqTpKuoRYUSA8TDzoaVdVCAqA6OCTiNef3hOj00aI7mpqEd", "pk_test_51No8AzHowlNEOsMkXykxpyVu3tQ4BdfyHPRkHgijmzIRY69b3x3AgbE6bR4ELzwcdmYNTvFvgk6hS7b5E23uzCet00cZxCsaBO", "pk_test_51NoCQnAPsGP7fxCI4K4VjBuRWdKII67egs4lWKdA0sKFbSo8THJ7gl8pBrr4Eac3Ss4mhViuFRClPnE6A6NBGgi900JY87syKB"], Es = {
"consumers/payment_details": {
POST: [{
code: "rate_limit_exceeded"
}]
},
"consumers/payment_details/share": {
POST: [{
code: "rate_limit_exceeded"
}]
},
"consumers/payment_details/share_token": {
POST: [{
code: "rate_limit_exceeded"
}]
}
}, Zs = n(45894), As = n(56274).Promise, Ms = function(e) {
return As.resolve({
type: "error",
error: {
message: e.message
}
})
}, Ps = n(56274).Promise, xs = function(e, t, n) {
return (0,
Zs.Nv)("financial_connections/sessions/synchronize", "POST", (0,
b.Z)({
client_secret: t.clientSecret,
"expand[]": t.expandActiveAuthSession ? "manifest.active_auth_session" : void 0,
emit_events: t.passEmitEventsParam,
cookies: null == n ? void 0 : n.cookies
}, e))
}, Is = function(e, t, n, r) {
var a = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : 180
, i = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : 250;
return new Ps((function(o) {
setTimeout((function() {
o((0,
x.XD)((function() {
return (0,
Zs.Nv)("link_account_sessions/attach_payment_account", "POST", (0,
b.Z)((0,
b.Z)({
client_secret: t,
consumer_session_client_secret: (0,
gt.P9)(r)
}, n), e), {
includeErrorStatus: !0
}).then((function(e) {
return "error" === e.type && 202 === e.error.status ? Ps.reject(new Error("No accounts were returned.")) : e
}
))
}
), a, i).catch(Ms))
}
), 1e3)
}
))
}, Ns = function(e, t, n) {
return (0,
Zs.Nv)("link_account_sessions/complete", "POST", (0,
b.Z)({
client_secret: t,
terminal_error: n
}, e)).then((function(e) {
return e.object && e.object.accounts && (e.object.linked_accounts = e.object.accounts,
delete e.object.accounts),
e
}
))
}, ws = function(e, t, n) {
return (0,
Zs.Nv)("link_account_sessions/networked_accounts", "GET", (0,
b.Z)({
client_secret: t,
consumer_session_client_secret: (0,
gt.P9)(n),
expand: ["data.institution"]
}, e))
}, Ts = function(e, t, n, r, a, i, o, s, u, l, c) {
return (0,
Zs.Nv)("link_account_sessions/save_accounts_to_link", "POST", (0,
b.Z)({
client_secret: t,
selected_accounts: n,
email_address: o,
country: r,
country_inferring_method: a,
locale: i,
phone_number: s,
consumer_session_client_secret: (0,
gt.P9)(u),
hcaptcha_response: l,
hcaptcha_key: c
}, e))
}, Os = function(e, t, n, r, a) {
return (0,
Zs.Nv)("link_account_sessions/share_networked_account", "POST", (0,
b.Z)((0,
b.Z)({
client_secret: t,
selected_accounts: n,
consumer_session_client_secret: (0,
gt.P9)(r)
}, e), {}, {
consent_acquired: a
}))
}, Rs = function(e, t, n, r) {
return (0,
Zs.Nv)("connections/link_account_sessions/consumer_sessions", "POST", (0,
b.Z)({
request_surface: vt.jL.Connections,
email_address: n.trim().toLowerCase(),
client_secret: t,
cookies: null == r ? void 0 : r.cookies
}, e))
}, Ls = function(e, t, n) {
return (0,
Zs.Nv)("consumers/setup_intents/".concat(e, "/complete"), "POST", (0,
b.Z)((0,
b.Z)({}, n), {}, {
client_secret: t
}), {
includeErrorStatus: !0
})
}, Ds = function(e, t) {
return {
type: "input_validation_error",
code: e,
param: t
}
}, Us = n(3644), js = n(56274).Promise, Bs = {
transformElementData: function(e, t, n, r, a) {
var i, o = r && r.length ? ve(r) : void 0, s = t.value;
switch (n) {
case "au_becs_debit":
return i = be((0,
b.Z)({}, s)),
{
type: H.au_becs_debit,
data: {
au_becs_debit: {
bsb_number: We(i.bsbValue),
account_number: i.accountNumberValue
}
}
};
case "card":
i = be((0,
b.Z)({}, s));
var u = Xe(i);
if ("linkInCardPaymentData"in u)
return {
type: "link_in_card_payment_data",
data: u.linkInCardPaymentData
};
var l = u.card
, c = u.owner
, d = a ? {
networks: {
preferred: a
}
} : null;
return {
type: H.card,
data: {
card: (0,
b.Z)((0,
b.Z)({}, l), d),
billing_details: c
},
pastedFields: o
};
case "fpx":
var p = t.accountHolderType;
return i = be((0,
b.Z)((0,
b.Z)({}, s), {}, {
accountHolderType: p
})),
{
type: H.fpx,
data: {
fpx: {
bank: i[e],
account_holder_type: i.accountHolderType
}
}
};
case "ideal":
return i = be((0,
b.Z)({}, s)),
{
type: H.ideal,
data: {
ideal: {
bank: i.idealBank
}
}
};
case "p24":
return i = be((0,
b.Z)({}, s)),
{
type: H.p24,
data: {
p24: {
bank: i.p24Bank
}
}
};
case "netbanking":
return i = be((0,
b.Z)({}, s)),
{
type: H.netbanking,
data: {
netbanking: {
bank: i.netbankingBank
}
}
};
case "sepa_debit":
return i = be((0,
b.Z)({}, s)),
{
type: H.sepa_debit,
data: {
sepa_debit: {
iban: Ye(i[e])
}
}
};
case "eps":
return i = be((0,
b.Z)({}, s)),
{
type: H.eps,
data: {
eps: {
bank: i.epsBank
}
}
};
default:
return (0,
P.Rz)(n)
}
},
transformData: function(e, t) {
return {
type: e,
data: t
}
},
create: function(e) {
var t = e.data
, n = e.errorLog;
return (0,
M.Sl)((0,
O.uu)(t, ["billing_details", "address", "postal_code"])) ? js.resolve({
type: "error",
error: Ds("card_number_in_postal_code_field", "postal_code")
}) : (0,
M.Sl)((0,
O.uu)(t, ["billing_details", "name"])) ? js.resolve({
type: "error",
error: Ds("card_number_in_name_field", "name")
}) : (0,
Us.Wj)("payment_methods", "POST", t, {
key: t.key,
log: n,
extraLogData: {
team: "pcfp",
apiMethod: "PaymentMethod.create"
},
expectedErrors: [{
param: "billing_details[email]",
message: /^Invalid email address/
}]
})
}
}, Fs = n(43514), Gs = n(60136), qs = n(29388), Ks = n(7112), Vs = function(e) {
function t() {
var e;
return (0,
C.Z)(this, t),
(e = n.call(this, "consumer api error")).name = "ConsumerApiError",
e
}
(0,
Gs.Z)(t, e);
var n = (0,
qs.Z)(t);
return (0,
E.Z)(t)
}((0,
Ks.Z)(Error)), zs = function(e) {
function t() {
var e;
return (0,
C.Z)(this, t),
(e = n.call(this, "consumer session is expired")).name = "ConsumerSessionExpiredError",
e
}
(0,
Gs.Z)(t, e);
var n = (0,
qs.Z)(t);
return (0,
E.Z)(t)
}((0,
Ks.Z)(Error)), Hs = (Error,
Error,
Error,
Error,
Error,
function(e) {
function t() {
var e;
return (0,
C.Z)(this, t),
(e = n.call(this, "webauthn iframe was not focused")).name = "GetWebAuthnCredentialIframeNotFocusedError",
e
}
(0,
Gs.Z)(t, e);
var n = (0,
qs.Z)(t);
return (0,
E.Z)(t)
}((0,
Ks.Z)(Error))), Ys = function(e) {
function t() {
var e;
return (0,
C.Z)(this, t),
(e = n.call(this, "user cancelled webauthn credential request")).name = "GetWebAuthnCredentialUserCancelledRequestError",
e
}
(0,
Gs.Z)(t, e);
var n = (0,
qs.Z)(t);
return (0,
E.Z)(t)
}((0,
Ks.Z)(Error)), Ws = function(e) {
function t() {
var e;
return (0,
C.Z)(this, t),
(e = n.call(this, "webauthn request already pending")).name = "GetWebAuthnCredentialRequestAlreadyPendingError",
e
}
(0,
Gs.Z)(t, e);
var n = (0,
qs.Z)(t);
return (0,
E.Z)(t)
}((0,
Ks.Z)(Error)), Js = function(e) {
function t() {
var e;
return (0,
C.Z)(this, t),
(e = n.call(this, "unknown error getting user webauthn credential")).name = "GetWebAuthnCredentialUnknownError",
e
}
(0,
Gs.Z)(t, e);
var n = (0,
qs.Z)(t);
return (0,
E.Z)(t)
}((0,
Ks.Z)(Error)), Xs = function(e) {
var t = e.verification_session_id
, n = e.consumer_session.verification_sessions.filter((function(e) {
return e.id === t
}
));
if (0 === n.length) {
return {
type: "error",
error: {
code: "internal_error",
message: "No verification session matching the verification_session_id returned in Start Verification response"
}
}
}
if (n[0].type !== vt.sf.WEBAUTHN) {
return {
type: "error",
error: {
code: "internal_error",
message: "Started verification session is not a WebAuthn verification session"
}
}
}
var r = n[0].verification_token;
if (null == r) {
return {
type: "error",
error: {
code: "internal_error",
message: "Verification session did not have a WebAuthn challenge attached"
}
}
}
var a = e.available_passkeys;
if (!a || 0 === a.length) {
return {
type: "error",
error: {
code: "internal_error",
message: "StartVerificationResponse did not have any WebAuthn credentials available. User does not have any passkeys"
}
}
}
return {
type: "fetchWebAuthnCredentialsParams",
fetchWebAuthnCredentialsParams: {
challenge: r,
allowCredentials: a
}
}
}, Qs = function(e) {
var t = Xs(e);
return "fetchWebAuthnCredentialsParams" === t.type ? null : t.error
}, $s = function(e) {
var t, n;
return e.message.indexOf("The document is not focused") > -1 ? (t = {
code: "get_webauthn_credential_iframe_not_focused",
message: JSON.stringify(e)
},
n = new Hs) : e.message.indexOf("The operation either timed out or was not allowed") > -1 || e.message.indexOf("This request has been cancelled by the user") > -1 || e.message.indexOf("The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission") > -1 ? (t = {
code: "get_webauthn_credential_user_cancelled_request",
message: JSON.stringify(e)
},
n = new Ys) : e.message.indexOf("A request is already pending") > -1 ? (t = {
code: "get_webauthn_credential_request_already_pending",
message: JSON.stringify(e)
},
n = new Ws) : (t = {
code: "get_webauthn_credential_unknown_error",
message: JSON.stringify(e)
},
n = new Js),
{
throwableError: n,
error: t
}
}, eu = function(e) {
return e.LJS001 = "Unsupported request surface",
e.LJS002 = "Consumer not logged in",
e.LJS003 = "No credentials for email",
e.LJS004 = "Missing active consumer session",
e.LJS005 = "Missing active verification",
e.LJS006 = "Invalid authentication state transition",
e.LJS007 = "Invalid params or context for action",
e
}({}), tu = (xe = {},
(0,
v.Z)(xe, eu.LJS001, "LJS001"),
(0,
v.Z)(xe, eu.LJS002, "LJS002"),
(0,
v.Z)(xe, eu.LJS003, "LJS003"),
(0,
v.Z)(xe, eu.LJS004, "LJS004"),
(0,
v.Z)(xe, eu.LJS005, "LJS005"),
(0,
v.Z)(xe, eu.LJS006, "LJS006"),
(0,
v.Z)(xe, eu.LJS007, "LJS007"),
xe), nu = function(e) {
function t(e, r) {
var a;
(0,
C.Z)(this, t);
var i = "https://go/linkjs/#".concat(tu[e].toLowerCase());
return (a = n.call(this, r ? "".concat(e, "; ").concat(r, "; ").concat(i) : "".concat(e, "; ").concat(i))).name = "LinkJsError",
a
}
(0,
Gs.Z)(t, e);
var n = (0,
qs.Z)(t);
return (0,
E.Z)(t)
}((0,
Ks.Z)(Error)), ru = n(40069), au = "link.auth_session_client_secret", iu = function() {
return window.location.ancestorOrigins && window.location.ancestorOrigins[0] ? window.location.ancestorOrigins[0] : document.referrer ? new URL(document.referrer).origin : null
}, ou = function(e) {
var t = e.authSessionClientSecret
, n = e.key;
try {
var r = iu();
if (!r)
return;
var a = window.sessionStorage;
if (!a)
return;
var i = {
key: n,
parent: r,
token: (0,
gt.P9)(t)
};
a.setItem(au, JSON.stringify(i))
} catch (e) {}
}, su = function() {
try {
var e = window.sessionStorage;
if (!e)
return;
e.removeItem(au)
} catch (e) {}
}, uu = function() {
return window.location.href.indexOf("__iframe-debug-mode__") >= 0
}, lu = n(43248), cu = function(e) {
function t() {
return (0,
C.Z)(this, t),
n.call(this, {
channel: "logger-transport-iframe",
fingerprintedPath: /*! STRIPE_JS_BUILD_SALT 4b9a5a2ae3*/
"logger-transport-iframe-4b9a5a2ae33c52af3f7c93bb2ee9a461aa4a1c8c.html",
frameQueryParams: {
debugMode: uu()
}
})
}
(0,
Gs.Z)(t, e);
var n = (0,
qs.Z)(t);
return (0,
E.Z)(t, [{
key: "send",
value: function(e) {
var t = e.name
, n = e.params;
this.sendMessageToChild("logMessage", {
name: t,
params: n
})
}
}]),
t
}(lu.K), du = cu, pu = n(21487), mu = null, fu = function() {
function e() {
(0,
C.Z)(this, e),
mu || (mu = new du,
(0,
pu.z)().then((function(e) {
var t;
e && (null === (t = mu) || void 0 === t || t.mount(e))
}
))),
this.frame = mu
}
return (0,
E.Z)(e, [{
key: "send",
value: function(e) {
var t = e.name
, n = e.params;
this.frame.send({
name: t,
params: n
})
}
}]),
e
}(), hu = function(e) {
return e.Init = "init",
e.HasAuth = "has_auth",
e.LocalStorageLoginFrameLoaded = "local_storage_login.frame_loaded",
e.CookieLoginFrameLoaded = "cookie_login.frame_loaded",
e.LocalStorageLoginError = "local_storage_login.login_error",
e.CookieLoginError = "cookie_login.login_error",
e.GetHttpCookieSuccess = "get_http_cookie.success",
e.GetHttpCookieError = "get_http_cookie.error",
e.BrowserStorageSetSuccess = "browser_storage.set.success",
e.BrowserStorageSetError = "browser_storage.set.error",
e.BrowserStorageGetSuccess = "browser_storage.get.success",
e.BrowserStorageGetError = "browser_storage.get.error",
e.BrowserStorageGetMultipleValues = "browser_storage.get.multiple_values",
e.BrowserStorageDeleteSuccess = "browser_storage.delete.success",
e.BrowserStorageDeleteError = "browser_storage.delete.error",
e.FrameClientGetLoginStart = "frame_client.get_login.start",
e.FrameClientGetLoginNoResult = "frame_client.get_login.no_result",
e.FrameClientGetLoginSuccess = "frame_client.get_login.success",
e.FrameClientGetLoginTimeout = "frame_client.get_login.timeout",
e.GetHttpCookieTimeout = "get_http_cookie.timeout",
e.AttemptLogInUsingStoredCredentialsStart = "attempt_log_in_using_stored_credentials.start",
e.AttemptLogInUsingStoredCredentialsSuccess = "attempt_log_in_using_stored_credentials.success",
e.AttemptLogInUsingStoredCredentialsError = "attempt_log_in_using_stored_credentials.error",
e.SharedSessionSourceNotFound = "shared_session_source_not_found",
e.NoMessageSource = "no_message_source",
e.SharedSessionRequested = "shared_session_requested",
e.SharedSessionUpdateReceived = "shared_session_update_received",
e.SharedSessionUpdateSent = "shared_session_update_sent",
e.InternalError = "internal_error",
e.LogOutStart = "log_out.start",
e.LogOutSuccess = "log_out.success",
e.LogOutError = "log_out.error",
e.LookupCacheHit = "lookup_cache.hit",
e.LookupRequestFired = "lookup.requested",
e.AttemptLogInUsingEmailStart = "attempt_log_in.using_email.start",
e.AttemptLogInUsingEmailWhenNoCredentialStart = "attempt_log_in.using_email.no_credentials.start",
e.AttemptLogInUsingCredentialStart = "attempt_log_in.using_credentials.start",
e.AttemptLogInUsingEmailPrewarmStart = "attempt_log_in.using_email.pre_warm.start",
e.AttemptLogInFromLookupConsumerSession = "attempt_log_in.lookup_consumer_session.start",
e.ConfirmVerificationEmailMismatch = "confirm_verification_email_mismatch",
e.ApiUnexpected400 = "api.unexpected_400",
e.DebugApiUnexpected400 = "debug.api.unexpected_400",
e
}({}), _u = function() {
function e(t) {
(0,
C.Z)(this, e),
this.baseLogger = (0,
Se.hu)();
var n = function(e, t) {
var n, r = "";
switch (e) {
case vt.jL.Checkout:
r = "payment_pages.";
break;
case vt.jL.CryptoOnramp:
r = "crypto_onramp_session.";
break;
case vt.jL.CryptoPayins:
r = "crypto_payin_session.";
break;
case vt.jL.Connections:
case vt.jL.InstantDebits:
case vt.jL.NetworkedConnections:
r = "linked_accounts.";
break;
case vt.jL.HostedInvoicePagePopup:
case vt.jL.ExpressCheckoutElementPopup:
case vt.jL.MobileSdkPopup:
case vt.jL.LegacyElementsPopup:
case vt.jL.SplitCardElementPopup:
case vt.jL.CheckoutPopup:
case vt.jL.CardElementPopup:
case vt.jL.ElementsController:
case vt.jL.PaymentElement:
case vt.jL.LinkAuthenticationElement:
case vt.jL.LinkAuthenticationInPaymentElement:
case vt.jL.HostedInvoicePagePaymentElement:
case vt.jL.CardElement:
case vt.jL.SplitCardElement:
r = "elements.";
break;
default:
(0,
P.Rz)(e)
}
var a = null !== (n = null == t ? void 0 : t.linkPrefix) && void 0 !== n ? n : "link.";
return "".concat(r).concat(a)
}(t);
this.baseLogger.setDefaultPrefix(n),
t !== vt.jL.Checkout || (0,
T.Qg)(window.location.origin) || this.baseLogger.setTransports([new fu]),
this.baseLogger.updateParams({
link_api_client: !0
})
}
return (0,
E.Z)(e, [{
key: "log",
value: function(e) {
var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
this.baseLogger.log(e, t)
}
}, {
key: "updateParams",
value: function(e) {
this.baseLogger.updateParams(e)
}
}]),
e
}(), yu = function(e) {
function t(e) {
return (0,
C.Z)(this, t),
n.call(this, {
channel: "link-login",
fingerprintedPath: /*! STRIPE_JS_BUILD_SALT 4b9a5a2ae3*/
"link-login-inner-4b9a5a2ae33c52af3f7c93bb2ee9a461aa4a1c8c.html",
frameQueryParams: {
debugMode: uu(),
publishableApiKey: e.publishableApiKey,
useCookies: e.useCookies
}
})
}
(0,
Gs.Z)(t, e);
var n = (0,
qs.Z)(t);
return (0,
E.Z)(t, [{
key: "getLogin",
value: function() {
return this.sendMessageToChild("getLogin", {}).then((function(e) {
return {
authSessionClientSecret: e.authSessionClientSecret,
loginType: e.loginType
}
}
))
}
}, {
key: "rememberLogin",
value: function(e) {
var t = e.authSessionClientSecret
, n = e.requestSurface;
this.sendMessageToChild("rememberLogin", {
authSessionClientSecret: t,
requestSurface: n
})
}
}, {
key: "forgetLogin",
value: function() {
return this.sendMessageToChild("forgetLogin", {}).then((function() {}
))
}
}, {
key: "hasLogin",
value: function() {
return this.sendMessageToChild("hasLogin", {}).then((function(e) {
return e.loginType
}
))
}
}]),
t
}(lu.K), vu = n(77489), gu = "[redacted]", bu = function() {
function e(t) {
(0,
C.Z)(this, e),
this.value = t
}
return (0,
E.Z)(e, [{
key: "equals",
value: function(e) {
return this.value === e.value
}
}, {
key: "toLocaleString",
value: function() {
return gu
}
}, {
key: "toString",
value: function() {
return gu
}
}, {
key: "valueOf",
value: function() {
return gu
}
}, {
key: "toJSON",
value: function() {
return gu
}
}, {
key: "isEmpty",
value: function() {
return null == this.value || "string" == typeof this.value && 0 === this.value.trim().length
}
}, {
key: "DANGEROUS_getValue",
value: function() {
return this.value
}
}]),
e
}(), Su = n(56274).Promise, ku = {
value: new bu(null),
lifetime: null
}, Cu = function(e) {
return !!e && !e.value.isEmpty()
}, Eu = function(e) {
function t() {
var e;
return (0,
C.Z)(this, t),
(e = n.call(this, "Entry or value is empty")).name = "EmptyValueError",
e
}
(0,
Gs.Z)(t, e);
var n = (0,
qs.Z)(t);
return (0,
E.Z)(t)
}((0,
Ks.Z)(Error)), Zu = function(e) {
return e ? {
value: e.value,
lifetime: e.lifetime
} : ku
}, Au = function(e) {
return e.then((function(e) {
return null === e || e.value.isEmpty() ? Su.reject(new Eu) : Su.resolve(e)
}
)).catch((function() {
return Su.reject(new Eu)
}
))
}, Mu = function() {
function e(t) {
var n = this
, r = t.livemode
, a = t.publishableKey
, i = t.requestSurface
, o = t.logger;
(0,
C.Z)(this, e),
this.cachedFrameClientHasLoginPromise = null,
this.resolvedSecret = null,
this.cachedGetAllPromise = null,
this.browserStorageStrategy = {
localStorage: function() {
return {
async: !1,
set: (t = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
n.livemode || -1 === Cs.indexOf(n.publishableKey) ? (0,
ru.hl)({
authSessionClientSecret: t.DANGEROUS_getValue(),
key: n.publishableKey,
livemode: n.livemode
}) : (0,
ru.qF)({
authSessionClientSecret: t.DANGEROUS_getValue(),
keys: Cs,
livemode: n.livemode
});
case 2:
case "end":
return e.stop()
}
}
), e)
}
))),
function(e) {
return t.apply(this, arguments)
}
),
get: function() {
var e = (0,
ru.jC)({
key: n.publishableKey,
livemode: n.livemode
});
return e ? {
value: new bu(e),
lifetime: "persistent"
} : null
},
delete: (e = (0,
k.Z)((0,
S.Z)().mark((function e() {
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
n.livemode || -1 === Cs.indexOf(n.publishableKey) ? (0,
ru.tt)({
key: n.publishableKey,
livemode: n.livemode
}) : (0,
ru.f2)({
keys: Cs,
livemode: n.livemode
});
case 2:
case "end":
return e.stop()
}
}
), e)
}
))),
function() {
return e.apply(this, arguments)
}
),
toString: function() {
return "localStorage"
}
};
var e, t
},
sessionStorage: function() {
return {
async: !1,
set: (t = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return e.abrupt("return", ou({
authSessionClientSecret: t.DANGEROUS_getValue(),
key: n.publishableKey
}));
case 1:
case "end":
return e.stop()
}
}
), e)
}
))),
function(e) {
return t.apply(this, arguments)
}
),
get: function() {
var e = function(e) {
var t = e.key;
try {
var n = iu();
if (!n)
return null;
var r = window.sessionStorage;
if (!r)
return null;
var a = r.getItem(au);
if (!a)
return null;
var i = JSON.parse(a);
return t === i.key && (0,
T.uW)(n, i.parent) ? (0,
gt.eB)(i.token) : null
} catch (e) {
return null
}
}({
key: n.publishableKey
});
return e ? {
value: new bu(e),
lifetime: "ephemeral"
} : null
},
delete: (e = (0,
k.Z)((0,
S.Z)().mark((function e() {
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return e.abrupt("return", su());
case 1:
case "end":
return e.stop()
}
}
), e)
}
))),
function() {
return e.apply(this, arguments)
}
),
toString: function() {
return "sessionStorage"
}
};
var e, t
},
frameClient: function(e) {
var t, r, a = e.useCookies;
return {
async: !0,
init: function() {
n.frameClient = new yu({
publishableApiKey: n.publishableKey,
useCookies: a
});
var e = document.body ? Su.resolve() : new Su((function(e) {
document.addEventListener("DOMContentLoaded", (function() {
document.body && e()
}
)),
window.addEventListener("load", (function() {
e()
}
))
}
));
n.cachedFrameClientHasLoginPromise = e.then((function() {
return n.frameClient ? (n.frameClient.mount(document.body),
n.frameClient.hasLogin().then((function(e) {
return e || null
}
))) : Su.resolve(null)
}
))
},
set: (r = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
var r;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return e.abrupt("return", null === (r = n.frameClient) || void 0 === r ? void 0 : r.rememberLogin({
authSessionClientSecret: t.DANGEROUS_getValue(),
requestSurface: n.requestSurface
}));
case 1:
case "end":
return e.stop()
}
}
), e)
}
))),
function(e) {
return r.apply(this, arguments)
}
),
get: function() {
if (n.logger.log(hu.FrameClientGetLoginStart, {
use_cookies: a
}),
!n.frameClient || !n.cachedFrameClientHasLoginPromise)
return Su.resolve(null);
var e = new K.E
, t = n.cachedFrameClientHasLoginPromise.then((function(t) {
return t && n.frameClient ? n.frameClient.getLogin().then((function(t) {
return t.authSessionClientSecret ? (n.logger.log(hu.FrameClientGetLoginSuccess, {
elapsed_time: e.getElapsedTime(),
login_type: t.loginType
}),
{
value: new bu(t.authSessionClientSecret),
lifetime: "persistent"
}) : (n.logger.log(hu.FrameClientGetLoginNoResult, {
elapsed_time: e.getElapsedTime(),
has_login: !0
}),
null)
}
)) : (n.logger.log(hu.FrameClientGetLoginNoResult, {
elapsed_time: e.getElapsedTime(),
has_login: !1
}),
null)
}
));
return Pu({
promise: t,
timeoutMs: 2e3,
onTimeout: function() {
var t;
n.logger.log(hu.FrameClientGetLoginTimeout, {
elapsed_time: e.getElapsedTime(),
link_login_frame_loaded: null === (t = n.frameClient) || void 0 === t ? void 0 : t.isLoaded()
})
}
})
},
delete: (t = (0,
k.Z)((0,
S.Z)().mark((function e() {
var t;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return e.abrupt("return", null === (t = n.frameClient) || void 0 === t ? void 0 : t.forgetLogin());
case 1:
case "end":
return e.stop()
}
}
), e)
}
))),
function() {
return t.apply(this, arguments)
}
),
toString: function() {
return "frameClient"
}
}
},
httpCookie: function(e) {
var t, r, a = e.domains;
return {
async: !0,
set: (r = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return e.next = 2,
(0,
Fs.nS)({
newAuthSessionClientSecret: t.DANGEROUS_getValue(),
currentAuthSessionClientSecret: null,
validDomains: a
});
case 2:
case "end":
return e.stop()
}
}
), e)
}
))),
function(e) {
return r.apply(this, arguments)
}
),
get: (t = (0,
k.Z)((0,
S.Z)().mark((function e() {
var t, r;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return t = new K.E,
r = (0,
Fs.bI)(a).then((function(e) {
if ("error" === e.type) {
var r = e.error;
return n.logger.log(hu.GetHttpCookieError, {
error: r.message,
elapsed_time: t.getElapsedTime()
}),
null
}
return n.logger.log(hu.GetHttpCookieSuccess, {
elapsed_time: t.getElapsedTime()
}),
{
value: new bu(e.object.auth_session_client_secret),
lifetime: "persistent"
}
}
)),
e.abrupt("return", Pu({
promise: r,
timeoutMs: 2500,
onTimeout: function() {
n.logger.log(hu.GetHttpCookieTimeout, {
elapsed_time: t.getElapsedTime()
})
}
}));
case 4:
case "end":
return e.stop()
}
}
), e)
}
))),
function() {
return t.apply(this, arguments)
}
),
delete: function() {
return (0,
Fs.XG)(a)
},
toString: function() {
return "httpCookie"
}
}
}
},
this.livemode = r,
this.publishableKey = a,
this.requestSurface = i,
this.logger = o;
var s = this.storageStrategies();
this.logger.updateParams({
browser_storage_strategies: s.map((function(e) {
return e.toString()
}
))
}),
s.map((function(e) {
var t;
return null === (t = e.init) || void 0 === t ? void 0 : t.call(e)
}
))
}
var t, n;
return (0,
E.Z)(e, [{
key: "set",
value: function(e) {
var t = this
, n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
if (!n.onlySessionStorage || !n.ignoreSessionStorage) {
this.cachedGetAllPromise = this.storageStrategies().filter((function(e) {
return !("sessionStorage" === e.toString() && n.ignoreSessionStorage)
}
)).map((function(t) {
return Su.resolve(Zu({
value: e,
lifetime: "sessionStorage" === t.toString() ? "ephemeral" : "persistent"
}))
}
));
var r = !1
, a = this.storageStrategies();
a.forEach(function() {
var a = (0,
k.Z)((0,
S.Z)().mark((function a(i) {
var o;
return (0,
S.Z)().wrap((function(a) {
for (; ; )
switch (a.prev = a.next) {
case 0:
if ("sessionStorage" !== i.toString() || !n.ignoreSessionStorage) {
a.next = 2;
break
}
return a.abrupt("return");
case 2:
if ("sessionStorage" === i.toString() || !n.onlySessionStorage) {
a.next = 4;
break
}
return a.abrupt("return");
case 4:
return a.prev = 4,
a.next = 7,
i.set(e);
case 7:
a.next = 15;
break;
case 9:
a.prev = 9,
a.t0 = a.catch(4),
r = !0,
o = "Unknown error",
a.t0 instanceof Error && (o = a.t0.message),
t.logger.log(hu.BrowserStorageSetError, {
error: o,
strategy: i.toString()
});
case 15:
case "end":
return a.stop()
}
}
), a, null, [[4, 9]])
}
)));
return function(e) {
return a.apply(this, arguments)
}
}()),
r || this.logger.log(hu.BrowserStorageSetSuccess),
this.resolvedSecret = null
}
}
}, {
key: "getSync",
value: function() {
var e, t = this;
return this.resolvedSecret && !this.resolvedSecret.value.isEmpty() ? this.resolvedSecret : ((0,
O.G)(this.storageStrategies(), (function(e) {
if (e.async)
return !1;
try {
var n = e.get();
if (Cu(n))
return t.resolvedSecret = Zu(n),
!0
} catch (e) {
t.logger.log(hu.BrowserStorageGetError, {
error: null == e ? void 0 : e.message
})
}
return !1
}
)),
null !== (e = this.resolvedSecret) && void 0 !== e ? e : ku)
}
}, {
key: "getAll",
value: function() {
var e = this;
if (this.cachedGetAllPromise)
return this.cachedGetAllPromise;
var t = this.storageStrategies().map((function(t) {
if (t.async)
return t.get();
try {
var n = t.get();
return e.resolvedSecret || (e.resolvedSecret = Cu(n) ? Zu(n) : null),
Su.resolve(n)
} catch (e) {
return Su.reject(e)
}
}
));
return this.cachedGetAllPromise = t.map((function(e) {
return e.then((function(e) {
return Cu(e) ? e : null
}
))
}
)),
Su.all(t).then((function(t) {
var n = t.filter(Cu).map((function(e) {
return e.value.DANGEROUS_getValue()
}
));
new Set(n).size > 1 && e.logger.log(hu.BrowserStorageGetMultipleValues)
}
)).catch((function(t) {
e.logger.log(hu.BrowserStorageGetError, {
error: t.message
})
}
)),
this.cachedGetAllPromise
}
}, {
key: "get",
value: (n = (0,
k.Z)((0,
S.Z)().mark((function e() {
var t, n = this;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return t = this.getAll(),
e.abrupt("return", (0,
vu.Z)(t.map(Au)).then((function(e) {
return n.resolvedSecret || (n.resolvedSecret = e),
e
}
)).catch((function(e) {
var t = (0,
O.sE)(e.errors, (function(e) {
return !(e instanceof Eu)
}
));
return t ? n.logger.log(hu.BrowserStorageGetError, {
error: t.message
}) : n.logger.log(hu.BrowserStorageGetSuccess),
Zu(null)
}
)));
case 2:
case "end":
return e.stop()
}
}
), e, this)
}
))),
function() {
return n.apply(this, arguments)
}
)
}, {
key: "clear",
value: (t = (0,
k.Z)((0,
S.Z)().mark((function e() {
var t, n, r = this;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return this.cachedGetAllPromise = null,
this.resolvedSecret = null,
t = !1,
n = this.storageStrategies(),
e.next = 6,
Su.all(n.map(function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(n) {
var a;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return e.prev = 0,
e.next = 3,
n.delete();
case 3:
e.next = 11;
break;
case 5:
e.prev = 5,
e.t0 = e.catch(0),
t = !0,
a = "Unknown error",
e.t0 instanceof Error && (a = e.t0.message),
r.logger.log(hu.BrowserStorageDeleteError, {
error: a
});
case 11:
case "end":
return e.stop()
}
}
), e, null, [[0, 5]])
}
)));
return function(t) {
return e.apply(this, arguments)
}
}()));
case 6:
t || this.logger.log(hu.BrowserStorageDeleteSuccess);
case 7:
case "end":
return e.stop()
}
}
), e, this)
}
))),
function() {
return t.apply(this, arguments)
}
)
}, {
key: "storageStrategies",
value: function() {
var e = window.location.origin
, t = [];
switch (this.requestSurface) {
case vt.jL.Checkout:
var n = (0,
Fs.ix)(e);
n && t.push(this.browserStorageStrategy.httpCookie({
domains: n
})),
(0,
T.Qg)(e) ? t.push(this.browserStorageStrategy.frameClient({
useCookies: !1
})) : (0,
T.K7)(e) && t.push(this.browserStorageStrategy.frameClient({
useCookies: Jr.G9
}));
break;
case vt.jL.CheckoutPopup:
case vt.jL.CardElementPopup:
case vt.jL.SplitCardElementPopup:
case vt.jL.HostedInvoicePagePopup:
case vt.jL.ExpressCheckoutElementPopup:
case vt.jL.MobileSdkPopup:
case vt.jL.LegacyElementsPopup:
(bs.td || (0,
T.MX)(e)) && (t.push(this.browserStorageStrategy.httpCookie({
domains: [Fs.eK.CheckoutLink]
})),
t.push(this.browserStorageStrategy.frameClient({
useCookies: !0
})));
break;
case vt.jL.Connections:
(bs.td || (0,
T.tl)(e)) && t.push(this.browserStorageStrategy.httpCookie({
domains: [Fs.eK.MerchantUiApi]
})),
(0,
T.Qg)(e) && t.push(this.browserStorageStrategy.localStorage());
break;
case vt.jL.CardElement:
case vt.jL.SplitCardElement:
break;
case vt.jL.ElementsController:
(bs.td || (0,
T.vo)(e)) && (t.push(this.browserStorageStrategy.sessionStorage()),
t.push(this.browserStorageStrategy.localStorage()),
t.push(this.browserStorageStrategy.httpCookie({
domains: [Fs.eK.MerchantUiApi]
})));
break;
case vt.jL.CryptoPayins:
case vt.jL.CryptoOnramp:
if (!(0,
T.Qg)(e))
break;
t.push(this.browserStorageStrategy.sessionStorage()),
t.push(this.browserStorageStrategy.localStorage());
break;
case vt.jL.PaymentElement:
break;
default:
throw (0,
P.fv)(this.requestSurface),
new nu(eu.LJS001)
}
return t
}
}]),
e
}(), Pu = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
var n, r, a;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return n = t.promise,
r = t.timeoutMs,
a = t.onTimeout,
e.abrupt("return", new Su((function(e, t) {
var i = setTimeout((function() {
a(),
e(null)
}
), r);
n.then(e, t).finally((function() {
clearTimeout(i)
}
))
}
)));
case 2:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t) {
return e.apply(this, arguments)
}
}(), xu = n(91111), Iu = n(97412), Nu = function(e, t, n) {
var r = e
, a = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(a) {
var i;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
if (!(0,
T.Qg)(a)) {
e.next = 2;
break
}
return e.abrupt("return", a);
case 2:
return i = r,
e.next = 5,
(0,
xu.s)(a, i);
case 5:
if (!e.sent) {
e.next = 11;
break
}
return r = 10,
e.abrupt("return", a);
case 11:
return r = Math.max(Math.floor(i / t), n),
e.abrupt("return", null);
case 13:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t) {
return e.apply(this, arguments)
}
}();
return a
}(5e3, 3, 10), wu = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
var n, r, a, i, o, s, u, l, c, d, p, m, f;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return u = t.type,
l = t.frameId,
c = t.origin,
e.next = 3,
Nu(c);
case 3:
if (d = e.sent) {
e.next = 6;
break
}
throw new Error("Invalid shared session origin");
case 6:
p = l,
m = window.opener,
f = null,
e.prev = 9,
e.t0 = u,
e.next = "frame_to_frame" === e.t0 ? 13 : "controller_to_frame_to_popup" === e.t0 ? 15 : "controller_to_outer_to_popup" === e.t0 ? 17 : "hosted_to_frame" === e.t0 ? 19 : 21;
break;
case 13:
return f = null !== (n = null === (r = window.parent) || void 0 === r ? void 0 : r.frames[p]) && void 0 !== n ? n : null,
e.abrupt("break", 22);
case 15:
return f = null !== (a = null == m || null === (i = m.parent) || void 0 === i ? void 0 : i.frames[p]) && void 0 !== a ? a : null,
e.abrupt("break", 22);
case 17:
return f = null !== (o = null == m ? void 0 : m.frames[p]) && void 0 !== o ? o : null,
e.abrupt("break", 22);
case 19:
return f = null !== (s = window.parent) && void 0 !== s ? s : null,
e.abrupt("break", 22);
case 21:
return e.abrupt("return", (0,
P.Rz)(u));
case 22:
e.next = 27;
break;
case 24:
return e.prev = 24,
e.t1 = e.catch(9),
e.abrupt("return", null);
case 27:
return e.abrupt("return", f && {
window: f,
origin: d
});
case 28:
case "end":
return e.stop()
}
}
), e, null, [[9, 24]])
}
)));
return function(t) {
return e.apply(this, arguments)
}
}(), Tu = function(e) {
return e.trim().toLowerCase().replace(/•/g, "*")
}, Ou = Iu.Vj, Ru = n(4663), Lu = n(56274).Promise, Du = function() {
function e(t) {
var n, r, a, i = this, o = t.logger, s = t.routing, u = t.livemode, l = t.publishableKey, c = t.requestSurface;
(0,
C.Z)(this, e),
this.syncTargets = new Map,
this.init = new Ru.B,
this.actions = (r = function(e) {
var t = i.handleAction(e);
return i.pendingActions.push(t),
t
}
,
a = {},
["storeCredentials", "setAuthSessionClientSecret", "clearAuthSessionClientSecret", "updateConsumerSessionClientSecret", "clearConsumerSessionClientSecret", "updateEmail", "activateSession", "clearCredentials"].forEach((function(e) {
a[e] = function(t) {
return r({
type: e,
payload: t
})
}
}
)),
a),
this.pendingActions = [],
this.awaitPendingActions = function() {
if (0 === i.pendingActions.length)
return i.init.promise;
var e = i.pendingActions;
return i.pendingActions = [],
Lu.all(e).then(i.awaitPendingActions)
}
,
this.logger = o,
this.sharedId = null !== (n = null == s ? void 0 : s.sharedId) && void 0 !== n ? n : (0,
Iu.Vj)(),
this.livemode = u,
this.publishableKey = l,
this.requestSurface = c,
this.setupPostMessageListener(),
s ? this.requestSessionSync(s) : this.init.resolve({
cache: {
activeEmailCacheKey: null,
keys: {},
credentials: {},
lastSetAuthSessionClientSecretPayload: null
},
store: new Mu({
livemode: u,
publishableKey: l,
requestSurface: c,
logger: o
})
});
var d = function() {
i.syncTargets.forEach((function(e) {
i.sendMessage({
type: "end_sync"
}, e)
}
))
};
window.addEventListener("pagehide", d),
window.addEventListener("beforeunload", d)
}
var t, n, r, a, i, o;
return (0,
E.Z)(e, [{
key: "getAuthSessionClientSecret",
value: function() {
return this.awaitPendingActions().then((function(e) {
return e.store.get()
}
))
}
}, {
key: "getAllAuthSessionClientSecrets",
value: function() {
return this.awaitPendingActions().then((function(e) {
return e.store.getAll()
}
))
}
}, {
key: "getAuthSessionClientSecretSync",
value: function() {
return this.awaitPendingActions().then((function(e) {
return e.store.getSync()
}
))
}
}, {
key: "credentials",
value: (o = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
var n, r, a;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return e.next = 2,
this.awaitPendingActions();
case 2:
if (n = e.sent,
r = n.cache,
a = t ? r.keys[Tu(t)] : r.activeEmailCacheKey) {
e.next = 7;
break
}
return e.abrupt("return", null);
case 7:
return e.abrupt("return", r.credentials[a]);
case 8:
case "end":
return e.stop()
}
}
), e, this)
}
))),
function(e) {
return o.apply(this, arguments)
}
)
}, {
key: "credentialsOrReject",
value: (i = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
var n;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return e.next = 2,
this.credentials(t);
case 2:
if (n = e.sent) {
e.next = 5;
break
}
throw new nu(t ? eu.LJS003 : eu.LJS002);
case 5:
return e.abrupt("return", n);
case 6:
case "end":
return e.stop()
}
}
), e, this)
}
))),
function(e) {
return i.apply(this, arguments)
}
)
}, {
key: "createRouting",
value: function(e) {
return {
type: e,
sharedId: this.sharedId,
frameId: window.name,
origin: window.location.origin
}
}
}, {
key: "handleAction",
value: (a = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o, s, u, l, c, d, p, m, f, h, _, y, v, g, b, k, C, E, Z, A, M = this;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return e.next = 2,
this.init.promise;
case 2:
r = e.sent,
a = r.cache,
i = r.store,
this.syncTargets.forEach((function(e) {
n && n.window === e.window || ("closed"in e.window && e.window.closed ? M.removeSyncTarget(e) : M.sendMessage({
type: "shared_session_action",
action: t
}, e))
}
)),
e.t0 = t.type,
e.next = "storeCredentials" === e.t0 ? 9 : "updateConsumerSessionClientSecret" === e.t0 ? 17 : "updateEmail" === e.t0 ? 23 : "activateSession" === e.t0 ? 30 : "setAuthSessionClientSecret" === e.t0 ? 37 : "clearAuthSessionClientSecret" === e.t0 ? 41 : "clearConsumerSessionClientSecret" === e.t0 ? 45 : "clearCredentials" === e.t0 ? 47 : 51;
break;
case 9:
return u = t.payload,
l = u.consumerInfo,
c = u.activate,
d = {
consumerSessionClientSecret: l.consumer_session.client_secret,
consumerPublishableKey: l.publishable_key,
emailAddress: l.consumer_session.email_address
},
p = Tu(d.emailAddress),
m = null !== (o = a.keys[p]) && void 0 !== o ? o : Ou(),
(s = a.keys)[p] || (s[p] = m),
a.credentials[m] = d,
c && (a.activeEmailCacheKey = m),
e.abrupt("break", 52);
case 17:
if (f = t.payload,
h = f.secret,
_ = f.email,
y = a.keys[Tu(_)]) {
e.next = 21;
break
}
throw new nu(eu.LJS002);
case 21:
return a.credentials[y].consumerSessionClientSecret = h,
e.abrupt("break", 52);
case 23:
if (a.activeEmailCacheKey) {
e.next = 25;
break
}
throw new nu(eu.LJS002);
case 25:
return v = t.payload,
g = Tu(v),
a.keys[g] = a.activeEmailCacheKey,
a.credentials[a.activeEmailCacheKey].emailAddress = g,
e.abrupt("break", 52);
case 30:
if (b = t.payload,
k = Tu(b),
C = a.keys[k]) {
e.next = 35;
break
}
throw new nu(eu.LJS003);
case 35:
return a.activeEmailCacheKey = C,
e.abrupt("break", 52);
case 37:
return E = t.payload,
Z = E.secret,
A = E.options,
a.lastSetAuthSessionClientSecretPayload = t.payload,
i.set(new bu(Z), A),
e.abrupt("break", 52);
case 41:
return a.lastSetAuthSessionClientSecretPayload = null,
e.next = 44,
i.clear();
case 44:
case 50:
return e.abrupt("break", 52);
case 45:
return a.activeEmailCacheKey = null,
e.abrupt("break", 52);
case 47:
return this.actions.clearConsumerSessionClientSecret(),
e.next = 50,
this.actions.clearAuthSessionClientSecret();
case 51:
throw new P.Rq(t);
case 52:
case "end":
return e.stop()
}
}
), e, this)
}
))),
function(e, t) {
return a.apply(this, arguments)
}
)
}, {
key: "addSyncTarget",
value: function(e) {
this.syncTargets.set(e.window, e)
}
}, {
key: "removeSyncTarget",
value: function(e) {
this.syncTargets.delete(e.window)
}
}, {
key: "requestSessionSync",
value: (r = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
var n;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return e.next = 2,
wu(t);
case 2:
(n = e.sent) ? (this.sendMessage({
type: "request_session_sync"
}, n),
this.logger.log(hu.SharedSessionRequested),
this.addSyncTarget(n)) : this.logger.log(hu.SharedSessionSourceNotFound);
case 4:
case "end":
return e.stop()
}
}
), e, this)
}
))),
function(e) {
return r.apply(this, arguments)
}
)
}, {
key: "handleMessage",
value: (n = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
var n, r, a, i, o, s, u;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
e.t0 = t.data.type,
e.next = "request_session_sync" === e.t0 ? 3 : "shared_session_action" === e.t0 ? 11 : "shared_session_init" === e.t0 ? 14 : "end_sync" === e.t0 ? 20 : 22;
break;
case 3:
return this.addSyncTarget(t.source),
e.next = 6,
this.init.promise;
case 6:
return n = e.sent,
r = n.cache,
this.sendMessage({
type: "shared_session_init",
cache: r
}, t.source),
this.logger.log(hu.SharedSessionUpdateSent),
e.abrupt("break", 23);
case 11:
return this.logger.log(hu.SharedSessionUpdateReceived),
this.handleAction(t.data.action, t.source),
e.abrupt("break", 23);
case 14:
return this.logger.log(hu.SharedSessionUpdateReceived),
a = t.data.cache,
i = new Mu({
livemode: this.livemode,
publishableKey: this.publishableKey,
requestSurface: this.requestSurface,
logger: this.logger
}),
a.lastSetAuthSessionClientSecretPayload && (o = a.lastSetAuthSessionClientSecretPayload,
s = o.secret,
u = o.options,
i.set(new bu(s), u)),
this.init.resolve({
cache: a,
store: i
}),
e.abrupt("break", 23);
case 20:
return this.removeSyncTarget(t.source),
e.abrupt("break", 23);
case 22:
throw new P.Rq(t.data);
case 23:
case "end":
return e.stop()
}
}
), e, this)
}
))),
function(e) {
return n.apply(this, arguments)
}
)
}, {
key: "parseMessageEvent",
value: (t = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
var n, r, a, i;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
if (n = t.origin,
r = t.data,
a = t.source,
(0,
x.Kn)(r) && r.__linkApiClient === this.sharedId) {
e.next = 3;
break
}
return e.abrupt("return", null);
case 3:
if (null != a) {
e.next = 6;
break
}
return this.logger.log(hu.NoMessageSource),
e.abrupt("return", null);
case 6:
return e.next = 8,
Nu(n);
case 8:
if (i = e.sent) {
e.next = 11;
break
}
return e.abrupt("return", null);
case 11:
return e.abrupt("return", {
source: {
window: a,
origin: i
},
data: r.inner
});
case 12:
case "end":
return e.stop()
}
}
), e, this)
}
))),
function(e) {
return t.apply(this, arguments)
}
)
}, {
key: "sendMessage",
value: function(e, t) {
var n = {
inner: e,
__linkApiClient: this.sharedId
};
t.window.postMessage(n, {
targetOrigin: t.origin
})
}
}, {
key: "setupPostMessageListener",
value: function() {
var e = this;
window.addEventListener("message", function() {
var t = (0,
k.Z)((0,
S.Z)().mark((function t(n) {
var r;
return (0,
S.Z)().wrap((function(t) {
for (; ; )
switch (t.prev = t.next) {
case 0:
return t.next = 2,
e.parseMessageEvent(n);
case 2:
(r = t.sent) && e.handleMessage(r);
case 4:
case "end":
return t.stop()
}
}
), t)
}
)));
return function(e) {
return t.apply(this, arguments)
}
}())
}
}]),
e
}(), Uu = ["credentials", "publishable_key"], ju = ["credentials", "publishable_key"], Bu = ["credentials", "publishable_key"], Fu = ["credentials", "publishable_key"], Gu = ["credentials", "publishable_key"], qu = ["credentials", "publishable_key"], Ku = ["unwrap_payment_method_params", "publishable_key"], Vu = ["auth_session_client_secret", "publishable_key"], zu = ["auth_session_client_secret"], Hu = ["advance_link_login_params", "publishable_key"], Yu = ["credentials"], Wu = ["advance_wallet_attach_params", "publishable_key"], Ju = ["credentials", "publishable_key"], Xu = function(e) {
return {
credentials: (0,
b.Z)((0,
b.Z)({}, e), {}, {
consumer_session_client_secret: (0,
gt.P9)(e.consumer_session_client_secret)
})
}
}, Qu = function(e) {
var t = e.headers
, n = e.publishableKey;
return function(e) {
return {
includeErrorStatus: !0,
includeRequestId: !0,
headers: (0,
b.Z)({
"Accept-Language": "en"
}, e)
}
}((0,
b.Z)({
Authorization: "Bearer ".concat(n)
}, t))
}, $u = {
deleteConsumerWallet: (Be = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
var n, r, a;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return n = t.credentials,
r = t.publishable_key,
a = (0,
h.Z)(t, Uu),
e.abrupt("return", (0,
Zs.Nv)("crypto/internal/wallet", "DELETE", (0,
b.Z)((0,
b.Z)({}, a), Xu(n)), Qu({
publishableKey: r
})));
case 2:
case "end":
return e.stop()
}
}
), e)
}
))),
function() {
return Be.apply(this, arguments)
}
),
createConsumerWallet: (je = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
var n, r, a;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return n = t.credentials,
r = t.publishable_key,
a = (0,
h.Z)(t, ju),
e.abrupt("return", (0,
Zs.Nv)("crypto/internal/wallet", "POST", (0,
b.Z)((0,
b.Z)({}, a), Xu(n)), Qu({
publishableKey: r
})));
case 2:
case "end":
return e.stop()
}
}
), e)
}
))),
function() {
return je.apply(this, arguments)
}
),
populateConsumerPerson: (Ue = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
var n, r, a;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return n = t.credentials,
r = t.publishable_key,
a = (0,
h.Z)(t, Bu),
e.abrupt("return", (0,
Zs.Nv)("crypto/internal/kyc_data_collection", "POST", (0,
b.Z)((0,
b.Z)({}, a), Xu(n)), Qu({
publishableKey: r
})));
case 2:
case "end":
return e.stop()
}
}
), e)
}
))),
function() {
return Ue.apply(this, arguments)
}
),
listTransactions: (De = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
var n, r, a;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return n = t.credentials,
r = t.publishable_key,
a = (0,
h.Z)(t, Fu),
e.abrupt("return", (0,
Zs.Nv)("crypto/internal/transactions", "POST", (0,
b.Z)((0,
b.Z)({}, a), Xu(n)), Qu({
publishableKey: r
})));
case 2:
case "end":
return e.stop()
}
}
), e)
}
))),
function() {
return De.apply(this, arguments)
}
),
updateConsumerSettings: (Le = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
var n, r, a;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return n = t.credentials,
r = t.publishable_key,
a = (0,
h.Z)(t, Gu),
e.abrupt("return", (0,
Zs.Nv)("crypto/internal/consumer_settings", "POST", (0,
b.Z)((0,
b.Z)({}, a), Xu(n)), Qu({
publishableKey: r
})));
case 2:
case "end":
return e.stop()
}
}
), e)
}
))),
function() {
return Le.apply(this, arguments)
}
),
startIdentityVerification: (Re = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
var n, r, a;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return n = t.credentials,
r = t.publishable_key,
a = (0,
h.Z)(t, qu),
e.abrupt("return", (0,
Zs.Nv)("crypto/internal/start_identity_verification", "POST", (0,
b.Z)((0,
b.Z)({}, a), Xu(n)), Qu({
publishableKey: r
})));
case 2:
case "end":
return e.stop()
}
}
), e)
}
))),
function() {
return Re.apply(this, arguments)
}
),
unwrapPaymentMethod: (Oe = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
var n, r, a;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return n = t.unwrap_payment_method_params.consumer_session_client_secret,
r = t.publishable_key,
a = (0,
h.Z)(t, Ku),
e.abrupt("return", (0,
Zs.Nv)("crypto/internal/onramp_session/update", "POST", (0,
b.Z)((0,
b.Z)({}, a), {}, {
unwrap_payment_method_params: {
consumer_session_client_secret: (0,
gt.P9)(n)
}
}), Qu({
publishableKey: r
})));
case 2:
case "end":
return e.stop()
}
}
), e)
}
))),
function() {
return Oe.apply(this, arguments)
}
),
startPurchase: (Te = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
var n, r, a;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return n = t.auth_session_client_secret,
r = t.publishable_key,
a = (0,
h.Z)(t, Vu),
e.abrupt("return", (0,
Zs.Nv)("crypto/internal/onramp_session/start_purchase", "POST", (0,
b.Z)((0,
b.Z)({}, a), {}, {
auth_session_client_secret: (0,
gt.P9)(n)
}), Qu({
publishableKey: r
})));
case 2:
case "end":
return e.stop()
}
}
), e)
}
))),
function() {
return Te.apply(this, arguments)
}
),
advanceLinkLogin: (we = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
var n, r, a, i, o;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return n = t.advance_link_login_params,
r = n.auth_session_client_secret,
a = (0,
h.Z)(n, zu),
i = t.publishable_key,
o = (0,
h.Z)(t, Hu),
e.abrupt("return", (0,
Zs.Nv)("crypto/internal/onramp_session/update", "POST", (0,
b.Z)((0,
b.Z)({}, o), {}, {
advance_link_login_params: (0,
b.Z)((0,
b.Z)({}, a), {}, {
auth_session_client_secret: (0,
gt.P9)(r)
})
}), Qu({
publishableKey: i
})));
case 2:
case "end":
return e.stop()
}
}
), e)
}
))),
function() {
return we.apply(this, arguments)
}
),
advanceWalletAttach: (Ne = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
var n, r, a, i, o;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return n = t.advance_wallet_attach_params,
r = n.credentials,
a = (0,
h.Z)(n, Yu),
i = t.publishable_key,
o = (0,
h.Z)(t, Wu),
e.abrupt("return", (0,
Zs.Nv)("crypto/internal/onramp_session/update", "POST", (0,
b.Z)((0,
b.Z)({}, o), {}, {
advance_wallet_attach_params: (0,
b.Z)((0,
b.Z)({}, a), Xu(r))
}), Qu({
publishableKey: i
})));
case 2:
case "end":
return e.stop()
}
}
), e)
}
))),
function() {
return Ne.apply(this, arguments)
}
),
confirmPurchase: (Ie = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
var n, r, a;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return n = t.credentials,
r = t.publishable_key,
a = (0,
h.Z)(t, Ju),
e.abrupt("return", (0,
Zs.Nv)("crypto/internal/onramp_session/confirm_purchase", "POST", (0,
b.Z)((0,
b.Z)({}, a), Xu(n)), Qu({
publishableKey: r
})));
case 2:
case "end":
return e.stop()
}
}
), e)
}
))),
function() {
return Ie.apply(this, arguments)
}
)
}, el = new Set([vt.jL.Checkout, vt.jL.CheckoutPopup, vt.jL.CryptoOnramp, vt.jL.CryptoPayins, vt.jL.CardElementPopup, vt.jL.SplitCardElementPopup, vt.jL.CardElement, vt.jL.SplitCardElement, vt.jL.HostedInvoicePagePopup, vt.jL.ExpressCheckoutElementPopup, vt.jL.LegacyElementsPopup, vt.jL.MobileSdkPopup, vt.jL.Connections, vt.jL.ElementsController, vt.jL.PaymentElement]), tl = function(e) {
return el.has(e)
}, nl = function(e) {
return e.PaymentSurfaceRendered = "payment_surface_rendered",
e.LinkRendered = "link_rendered",
e.LinkServerSideEnablement = "link_server_side_enablement",
e.LinkLookupSuccessful = "link_lookup_successful",
e.LinkAccountCreationSuccessful = "link_account_creation_success",
e.LinkInteraction = "link_interaction",
e.LinkPaymentMethodSelected = "link_payment_method_selected",
e.LinkCheckoutConfirmationAttempted = "link_checkout_confirmation_attempted",
e.NonLinkCheckoutConfirmationAttempted = "non_link_checkout_confirmation_attempted",
e.LinkCheckoutConfirmationSucceeded = "link_checkout_confirmation_succeeded",
e.NonLinkCheckoutConfirmationSucceeded = "non_link_checkout_confirmation_succeeded",
e.LinkCheckoutConfirmationError = "link_checkout_confirmation_error",
e.NonLinkCheckoutConfirmationError = "non_link_checkout_confirmation_error",
e.Authentication = "authentication",
e.AuthenticationError = "authentication_error",
e.Fatal = "fatal",
e
}({}), rl = function(e) {
return e.Checkout = "checkout",
e.EmbeddedCheckout = "embedded-checkout",
e.HostedInvoicePage = "hosted-invoice-page",
e.CardElement = "card-element",
e.SplitCardElement = "split-card-element",
e.LinkAuthenticationElement = "link-authentication-element",
e.PaymentElement = "payment-element",
e.PaymentRequestButtonElement = "payment-request-button-element",
e.ExpressCheckoutElement = "express-checkout-element",
e.MobileElement = "mobile-element",
e.GlobalElements = "global-elements",
e
}({}), al = [nl.LinkCheckoutConfirmationSucceeded, nl.LinkCheckoutConfirmationError], il = Boolean("undefined" == typeof jest && !1), ol = "/link-modal-inner.html", sl = ["surface"], ul = ["surface"], ll = function() {
function e() {
(0,
C.Z)(this, e),
this.baseLogger = (0,
Se.hu)(),
this.baseLogger.setDefaultPrefix("link_funnel.");
var t = (0,
T.l0)().referrerOrigin;
t && this.baseLogger.updateParams({
referrer: t
})
}
return (0,
E.Z)(e, [{
key: "fatalError",
value: function(e) {
if (il)
throw new Error(e)
}
}, {
key: "log",
value: function(e, t, n) {
try {
var r = al.indexOf(e) > -1;
this.baseLogger.log(e, (0,
b.Z)((0,
b.Z)({}, n), {}, {
surface: t
}), {
priority: r ? "high" : void 0
}),
il && (window.opener && window.opener !== window ? window.postMessage(JSON.stringify({
linkEvent: e,
data: n
}), "*") : window.parent.postMessage(JSON.stringify({
linkEvent: e,
data: n
}), "*"))
} catch (e) {}
}
}, {
key: "innerCheck",
value: function() {
var e = (0,
T.vB)(window.location.hash.substring(1).split("?")[0]).controllerId
, t = window.location.pathname;
"string" == typeof e && 0 === t.indexOf(ol) && t !== ol && this.fatalError("ControllerId detected, please use Link Funnel Client")
}
}, {
key: "event",
value: function(e, t) {
this.innerCheck(),
this.surface ? this.log(e, this.surface, t) : this.fatalError("LinkFunnel.event called directly but no surface was initialized via updateParams")
}
}, {
key: "controllerAppEvent",
value: function(e) {
var t = e.event
, n = e.data
, r = n.surface
, a = (0,
h.Z)(n, sl);
this.log(t, r, a)
}
}, {
key: "linkApiClientEvent",
value: function(e, t, n) {
var r = t;
t === rl.Checkout && this.surface === rl.EmbeddedCheckout && (r = rl.EmbeddedCheckout),
this.log(e, r, n)
}
}, {
key: "updateParams",
value: function(e) {
var t = e.surface
, n = (0,
h.Z)(e, ul);
t !== rl.Checkout || (0,
T.Qg)(window.location.origin) || this.baseLogger.setTransports([new fu]),
this.baseLogger.updateParams(n),
t && (this.surface = t)
}
}]),
e
}(), cl = new ll, dl = {
create: function(e) {
var t = e.data;
return (0,
Zs.Nv)("confirmation_tokens", "POST", t)
}
}, pl = {
retrieve: function(e) {
var t = e.id
, n = e.ephemeralKey
, r = e.data
, a = e.errorHandlingConfig
, i = {
headers: {
Authorization: "Bearer ".concat(n)
}
};
return (0,
Us.Wj)("customers/".concat(t), "GET", r, (0,
b.Z)((0,
b.Z)({}, a), {}, {
extraLogData: {
team: "pcfp",
apiMethod: "CustomerApi.retrieve"
}
}), i)
},
update: function(e) {
var t = e.id
, n = e.ephemeralKey
, r = e.stripeVersion
, a = e.data
, i = e.errorHandlingConfig
, o = {
headers: {
Authorization: "Bearer ".concat(n),
"Stripe-Version": r
}
};
return (0,
Us.Wj)("customers/".concat(t), "POST", a, (0,
b.Z)((0,
b.Z)({}, i), {}, {
extraLogData: {
team: "pcfp",
apiMethod: "CustomerApi.update"
}
}), o)
}
}, ml = [{
code: "resource_missing"
}, {
param: "client_secret",
message: /The client_secret provided does not match the client_secret associated with the.*/
}], fl = [{
code: "payment_intent_unexpected_state"
}, {
code: "setup_intent_unexpected_state"
}, {
code: "resource_missing"
}, {
code: "payment_intent_incompatible_payment_method"
}, {
code: "token_already_used"
}, {
code: "parameter_missing"
}, {
param: "client_secret",
message: /The client_secret provided does not match the client_secret associated with the.*/
}, {
message: /When providing a shipping address, .* must be provided./
}, {
param: "payment_method_types",
message: /The payment method type .* is invalid. Please ensure the provided type is activated in your dashboard/
}, {
param: "payment_method_types",
message: /All types provided in .* are invalid/
}, {
param: "legacy_return_url"
}, {
param: "payment_method_data[fpx][bank]",
code: "parameter_invalid_empty"
}, {
param: "bacs_debit[account_number]",
code: "invalid_bank_account_account_number"
}, {
param: "bacs_debit[sort_code]",
code: "invalid_bank_account_routing_number"
}, {
code: "email_invalid",
param: "payment_method_data[billing_details][email]"
}, {
param: "payment_method_data[billing_details][name]"
}, {
param: "billing_details[name]"
}, {
param: "shipping[name]"
}, {
param: "shipping[address][country]",
message: /Affirm payment does not support shipping country as .* it only supports/
}, {
param: "setup_future_usage",
message: /The provided setup_future_usage \(.*\) does not match/
}, {
param: "currency",
message: /Klarna cannot accept payments in .* for customers in .* valid currencies are/
}, {
param: "currency",
message: /The provided currency \(.*\) does not match the expected currency/
}, {
param: "capture_method",
message: /The provided capture method .* does not match/
}, {
param: "card",
message: /Your Stripe account cannot currently process .* cards/
}, {
param: "card",
message: "Your card was declined. Try a different card."
}, {
param: "card",
message: /American Express cards issued in India aren't supported for businesses in India/
}, {
param: "description",
message: /As per Indian regulations, export transactions require a description/
}, {
param: "billing_details[address][country]",
message: /You must provide .* to use Klarna/
}, {
param: "billing_details[address][country]",
message: /billing address country is .* which is outside the countries you can accept Klarna payment from/
}, {
message: /Invalid routing number/
}, {
message: /Invalid account number/
}, {
param: "customer",
message: /No such customer/
}, {
param: "token",
message: /Invalid token id: pm_.*/
}, {
param: "payment_method_data[card][exp_month]",
code: "parameter_missing"
}, {
param: "payment_method_data[card][number]",
code: "parameter_invalid_empty"
}, {
param: "payment_method_data[card][token]",
code: "parameter_invalid_empty"
}, {
param: "payment_method_data[nickname]",
code: "parameter_unknown"
}, {
param: "payment_method_data[card][networks][preferred]",
message: /must be one of/
}], hl = [{
param: "card[number]",
code: "parameter_invalid_empty"
}, {
param: "nickname",
code: "parameter_unknown"
}, {
code: "email_invalid",
param: "billing_details[email]"
}, {
param: "card[exp_month]",
code: "parameter_missing"
}, {
param: "billing_details[name]",
code: "parameter_missing"
}, {
param: "token",
message: /Invalid token id: /
}, {
param: "card",
message: /Your Stripe account cannot currently process .* cards/
}, {
param: "card",
message: /American Express cards issued in India aren't supported for businesses in India/
}, {
param: "billing_details[address][line1]",
code: "parameter_missing"
}, {
param: "billing_details[address][country]",
message: /You must provide .* to use Klarna/
}, {
code: "token_already_used"
}, {
param: "type",
message: /Invalid type: must be one of/
}], _l = [{
param: "card",
message: /Your Stripe account cannot currently process .* cards/
}, {
param: "card[exp_month]",
code: "parameter_missing"
}], yl = [{
code: "incorrect_number"
}, {
code: "card_declined"
}, {
param: "card",
message: /American Express cards issued in India aren't supported for businesses in India/
}, {
code: "token_already_used"
}, {
code: "payment_method_unactivated"
}, {
param: "card",
message: /Your Stripe account cannot currently process .* cards/
}, {
message: /The type `(applepay|googlepay)` is not a valid source type/
}], vl = [{
param: "browser",
message: /^Invalid JSON/
}], gl = {
retrieve: function(e) {
var t = e.id
, n = e.data
, r = e.allowRetries
, a = void 0 !== r && r
, i = e.log;
return (0,
Us.Wj)("payment_intents/".concat(t), "GET", n, (0,
b.Z)((0,
b.Z)({
log: i,
key: n.key
}, a && {
retries: {
shouldRetry: Zs.YN,
maxAttempts: 2
}
}), {}, {
expectedErrors: ml,
extraLogData: {
team: "pcfp",
apiMethod: "PaymentIntentApi.retrieve"
}
}))
},
confirm: function(e) {
var t = e.id
, n = e.data
, r = e.log
, a = e.merchantParams;
return (0,
Us.Wj)("payment_intents/".concat(t, "/confirm"), "POST", n, {
log: r,
key: n.key,
merchantParams: a,
expectedErrors: fl,
extraLogData: {
team: "pcfp",
apiMethod: "PaymentIntentApi.confirm"
}
}, {
includeErrorStatus: !0
})
},
update: function(e) {
var t = e.id
, n = e.data
, r = e.log
, a = e.merchantParams;
return (0,
Us.Wj)("payment_intents/".concat(t), "POST", n, {
log: r,
key: n.key,
merchantParams: a,
extraLogData: {
team: "pcfp",
apiMethod: "PaymentIntentApi.update"
},
expectedErrors: fl
})
},
sourceCancel: function(e) {
var t = e.id
, n = e.data;
return (0,
Zs.Nv)("payment_intents/".concat(t, "/source_cancel"), "POST", n)
},
verifyMicrodeposits: function(e) {
var t = e.id
, n = e.data;
return (0,
Zs.Nv)("payment_intents/".concat(t, "/verify_microdeposits"), "POST", n)
},
attachLinkAccountSession: function(e) {
var t = e.id
, n = e.linkAccountSessionId
, r = e.data;
return (0,
Zs.Nv)("payment_intents/".concat(t, "/link_account_sessions/").concat(n, "/attach"), "POST", r, {
includeErrorStatus: !0
})
},
createAcssSession: function(e) {
var t = e.id
, n = e.data;
return (0,
Zs.Nv)("payment_intents/".concat(t, "/acss_sessions"), "POST", n)
},
cancelChallenge: function(e) {
var t = e.id
, n = e.data;
return (0,
Zs.Nv)("payment_intents/".concat(t, "/cancel_challenge"), "POST", n)
}
}, bl = {
create: function(e) {
var t = e.data;
return (0,
Zs.Nv)("payment_pages", "POST", t)
},
init: function(e) {
var t = e.id
, n = e.data;
return (0,
Zs.Nv)("payment_pages/".concat(t, "/init"), "POST", n, {
includeErrorStatus: !0
})
},
update: function(e) {
var t = e.id
, n = e.data;
return (0,
Zs.Nv)("payment_pages/".concat(t), "POST", n, {
includeErrorStatus: !0
})
},
confirm: function(e) {
var t = e.id
, n = e.data;
return (0,
Zs.Nv)("payment_pages/".concat(t, "/confirm"), "POST", n, {
includeErrorStatus: !0
})
},
retrieve: function(e) {
var t = e.id
, n = e.data;
return (0,
Zs.Nv)("payment_pages/".concat(t), "GET", n, {
includeErrorStatus: !0
})
}
}, Sl = {
create: function(e) {
var t = e.data;
return (0,
Zs.Nv)("radar/session", "POST", t)
},
attachHcaptchaToken: function(e) {
var t = e.sessionId
, n = e.data;
return (0,
Zs.Nv)("radar/session/".concat(t, "/attach_hcaptcha_token"), "POST", n)
}
}, kl = {
confirm: function(e) {
var t = e.id
, n = e.data;
return (0,
Zs.Nv)("return_intents/".concat(t, "/confirm"), "POST", n)
}
}, Cl = {
retrieve: function(e) {
var t = e.id
, n = e.data
, r = e.allowRetries
, a = void 0 !== r && r
, i = e.log;
return (0,
Us.Wj)("setup_intents/".concat(t), "GET", n, (0,
b.Z)((0,
b.Z)({
log: i,
key: n.key
}, a && {
retries: {
shouldRetry: Zs.YN,
maxAttempts: 2
}
}), {}, {
expectedErrors: ml,
extraLogData: {
team: "pcfp",
apiMethod: "SetupIntentApi.retrieve"
}
}))
},
confirm: function(e) {
var t = e.id
, n = e.data
, r = e.log
, a = e.merchantParams;
return (0,
Us.Wj)("setup_intents/".concat(t, "/confirm"), "POST", n, {
log: r,
key: n.key,
merchantParams: a,
expectedErrors: fl,
extraLogData: {
team: "pcfp",
apiMethod: "SetupIntentApi.confirm"
}
}, {
includeErrorStatus: !0
})
},
sourceCancel: function(e) {
var t = e.id
, n = e.data;
return (0,
Zs.Nv)("setup_intents/".concat(t, "/source_cancel"), "POST", n)
},
verifyMicrodeposits: function(e) {
var t = e.id
, n = e.data;
return (0,
Zs.Nv)("setup_intents/".concat(t, "/verify_microdeposits"), "POST", n)
},
attachLinkAccountSession: function(e) {
var t = e.id
, n = e.linkAccountSessionId
, r = e.data;
return (0,
Zs.Nv)("setup_intents/".concat(t, "/link_account_sessions/").concat(n, "/attach"), "POST", r, {
includeErrorStatus: !0
})
},
createAcssSession: function(e) {
var t = e.id
, n = e.data;
return (0,
Zs.Nv)("setup_intents/".concat(t, "/acss_sessions"), "POST", n)
},
cancelChallenge: function(e) {
var t = e.id
, n = e.data;
return (0,
Zs.Nv)("setup_intents/".concat(t, "/cancel_challenge"), "POST", n)
}
}, El = {
retrieve: function(e) {
var t = e.id
, n = e.data;
return (0,
Zs.Nv)("sources/".concat(t), "GET", n)
},
create: function(e) {
var t = e.data
, n = e.errorLog
, r = e.merchantParams;
return (0,
Us.Wj)("sources", "POST", t, {
log: n,
key: t.key,
merchantParams: r,
extraLogData: {
team: "pcfp",
apiMethod: "SourceApi.create"
},
expectedErrors: yl
})
}
}, Zl = {
create: function(e) {
var t = e.data
, n = e.merchantParams
, r = void 0 === n ? {} : n
, a = e.errorLog;
return (0,
Us.Wj)("tokens", "POST", t, {
log: a,
key: t.key,
merchantParams: r,
extraLogData: {
team: "pcfp",
apiMethod: "TokenApi.create"
},
expectedErrors: _l
})
}
}, Al = {
create: function(e) {
var t = e.data
, n = e.log
, r = e.merchantParams;
return (0,
Us.Wj)("payment_methods", "POST", t, {
log: n,
key: t.key,
merchantParams: r,
extraLogData: {
team: "pcfp",
apiMethod: "PaymentMethodApi.create"
},
expectedErrors: hl
})
},
list: function(e) {
var t = e.ephemeralKey
, n = e.stripeVersion
, r = e.data;
return (0,
Zs.Nv)("payment_methods", "GET", r, {
headers: (0,
b.Z)((0,
b.Z)({}, n && {
"Stripe-Version": n
}), {}, {
Authorization: "Bearer ".concat(t)
})
})
},
detach: function(e) {
var t = e.id
, n = e.ephemeralKey
, r = e.stripeVersion;
return (0,
Zs.Nv)("payment_methods/".concat(t, "/detach"), "POST", {}, {
headers: {
"Stripe-Version": r,
Authorization: "Bearer ".concat(n)
}
})
},
update: function(e) {
var t = e.id
, n = e.ephemeralKey
, r = e.stripeVersion
, a = e.data
, i = e.key
, o = e.log;
return (0,
Us.Wj)("payment_methods/".concat(t), "POST", a, {
log: o,
key: i,
extraLogData: {
team: "pcfp",
apiMethod: "PaymentMethodApi.update"
}
}, {
headers: {
"Stripe-Version": r,
Authorization: "Bearer ".concat(n)
}
})
}
}, Ml = {
authenticate: function(e) {
var t = e.data
, n = e.errorLog;
return (0,
Us.Wj)("3ds2/authenticate", "POST", t, {
key: t.key,
log: n,
extraLogData: {
team: "pcfp",
apiMethod: "ThreeDSecure2Api.authenticate"
},
expectedErrors: vl
})
},
challengeComplete: function(e) {
var t = e.data;
return (0,
Zs.Nv)("3ds2/challenge_complete", "POST", t, {}, {
retries: {
shouldRetry: function(e) {
return 400 === e.status
},
maxAttempts: 3
}
})
}
}, Pl = {
verifyChallenge: function(e) {
var t = e.verifyUrl
, n = e.data
, r = t.replace(/^\/v1\//, "");
return (0,
Zs.Nv)(r, "POST", n)
}
}, xl = {
completeChallenge: function(e) {
var t = e.completeUrl
, n = e.data
, r = t.replace(/^\/v1\//, "");
return (0,
Zs.Nv)(r, "POST", n)
}
}, Il = {
retrieveCard: function(e) {
var t = e.cardId
, n = e.ephemeralKey
, r = e.stripeVersion
, a = e.data
, i = r ? {
Authorization: "Bearer ".concat(n),
"Stripe-Version": r
} : {
Authorization: "Bearer ".concat(n)
};
return (0,
Zs.Nv)("issuing/cards/".concat(t), "GET", a, {
headers: i
})
}
}, Nl = {
create: function(e) {
var t = e.data
, n = t.key
, r = t._stripe_account
, a = r ? {
Authorization: "Bearer ".concat(n),
"Stripe-Account": r
} : {
Authorization: "Bearer ".concat(n)
};
return (0,
Zs.Nv)("ephemeral_key_nonces", "POST", t, {
headers: a
})
}
}, wl = {
create: function(e) {
var t = e.data;
return (0,
Zs.Nv)("apple_pay/sessions", "POST", t, {}, {
retries: {
shouldRetry: Zs.YN,
maxAttempts: 2
}
})
}
}, Tl = {
retrieve: function(e) {
var t = e.paymentIntentId
, n = e.data;
return (0,
Zs.Nv)("paypal/configuration/".concat(t), "GET", n)
}
}, Ol = {
applePaySession: wl,
captcha: Pl,
cardDetailsRecollection: xl,
confirmationTokens: dl,
customers: pl,
ephemeralKeyNonce: Nl,
issuing: Il,
paymentIntents: gl,
paymentMethods: Al,
paymentPages: bl,
paypalConfiguration: Tl,
radarSessions: Sl,
returnIntents: kl,
setupIntents: Cl,
sources: El,
threeDSecure2: Ml,
tokens: Zl
}, Rl = ["auth_session_client_secret", "consumer_session"], Ll = ["client_secret"], Dl = function(e) {
e.auth_session_client_secret;
var t = e.consumer_session
, n = (0,
h.Z)(e, Rl);
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
consumer_session: Ul(t)
})
}, Ul = function(e) {
e.client_secret;
return (0,
h.Z)(e, Ll)
}, jl = n(85340), Bl = ["object"], Fl = ["consumer_info"], Gl = function(e, t) {
var n, r = null === (n = t.enableLinkAuthentication) || void 0 === n || n, a = r ? (0,
gt.P9)(e.auth_session_client_secret) : void 0;
return (0,
Us.Wj)("elements/wallet-config", "POST", (0,
b.Z)((0,
b.Z)({}, e), {}, {
auth_session_client_secret: a
}), {
log: t.errorLog,
extraLogData: {
team: "pcfp",
apiMethod: "retrieveWalletConfig"
},
merchantParams: {
auth_session_client_secret: !0
},
expectedErrors: jl.j,
key: e.key,
server: "merchant-ui-api",
retries: {
shouldRetry: function(e) {
return "fetch_error" === e.type
},
maxAttempts: 2
}
}, {
includeRequestId: !0,
includeErrorStatus: !0,
withCredentials: r
}).then((function(e) {
if ("error" === e.type)
return e;
var t = e.object
, n = (0,
h.Z)(e, Bl)
, r = t.consumer_info
, a = (0,
h.Z)(t, Fl);
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
object: (0,
b.Z)((0,
b.Z)({}, a), r ? {
consumer_info: (0,
b.Z)((0,
b.Z)({}, r), {}, {
consumer_session: (0,
b.Z)((0,
b.Z)({}, r.consumer_session), {}, {
client_secret: (0,
gt.OP)(r.consumer_session.client_secret)
}),
auth_session_client_secret: (0,
gt.eB)(r.auth_session_client_secret)
})
} : null)
})
}
))
}, ql = n(56274).Promise, Kl = ["auth_session_client_secret"], Vl = ["email_address", "session_id", "cookies"], zl = ["session_id", "email_address", "cookies"], Hl = function() {
function e(t, n, r) {
var a, i, o, s, u, l, c, d, p, m, f, _, y = this, v = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : {}, g = v.sharedSessionRouting, E = v.disableStoredCredentialsPreload, Z = void 0 !== E && E, A = v.sessionId, M = v.useConsumerPublishableKey, P = void 0 !== M && M;
if ((0,
C.Z)(this, e),
this.lookupCache = {},
this.listPaymentPlansCache = {},
this.unexpected400Log = function(e, t) {
var n = "api.unexpected_400" === e ? hu.ApiUnexpected400 : hu.DebugApiUnexpected400;
y.logger.log(n, t)
}
,
this.walletConfig = {
retrieve: (i = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
var n, r, a, i, o, s, u, l, c, d;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return y.sessionId = null !== (n = t.stripeJsId) && void 0 !== n ? n : y.sessionId,
e.next = 3,
y.sharedSessionManager.getAuthSessionClientSecretSync();
case 3:
if (r = e.sent,
a = r.value,
Ss) {
e.next = 15;
break
}
return e.next = 8,
Gl({
stripe_js_id: t.stripeJsId,
referrer_host: t.referrerHost,
elements_session_id: t.elementsSessionId,
elements_assignment_id: t.elementsAssignmentId,
on_behalf_of: t.onBehalfOf,
amount: t.amount,
currency: t.currency,
key: y.publishableKey,
_stripe_account: y.stripeAccount,
request_surface: y.getRequestSurface(t.requestSurface),
auth_session_client_secret: null == a ? void 0 : a.DANGEROUS_getValue(),
top_level_referrer_host: t.topLevelReferrerHost
}, {
errorLog: y.unexpected400Log,
enableLinkAuthentication: t.linkAuthentication
});
case 8:
if (!(o = e.sent).error) {
e.next = 11;
break
}
return e.abrupt("return", o);
case 11:
return (s = o.object.consumer_info) && y.sharedSessionManager.actions.storeCredentials({
consumerInfo: s,
activate: !0
}),
null !== (i = o.object.consumer_info) && void 0 !== i && i.auth_session_client_secret && y.sharedSessionManager.actions.setAuthSessionClientSecret({
secret: o.object.consumer_info.auth_session_client_secret,
options: {
ignoreSessionStorage: !0
}
}),
e.abrupt("return", (0,
b.Z)((0,
b.Z)({}, o), {}, {
object: (0,
b.Z)((0,
b.Z)({
type: "wallet_config"
}, o.object), {}, {
consumer_info: o.object.consumer_info && Dl(o.object.consumer_info)
})
}));
case 15:
return u = (0,
x._v)(200),
e.next = 18,
y.attemptLogInUsingStoredCredentials({
supportedPaymentDetailsTypes: ["CARD"]
});
case 18:
if (l = e.sent,
null == (c = l.consumerInfo) || !c.redacted_payment_details.length) {
e.next = 26;
break
}
return e.next = 23,
y.paymentDetails.shareToken({
id: c.redacted_payment_details[0].id
});
case 23:
e.t0 = e.sent,
e.next = 27;
break;
case 26:
e.t0 = null;
case 27:
return d = e.t0,
e.next = 30,
u;
case 30:
return e.abrupt("return", {
type: "object",
object: (0,
b.Z)((0,
b.Z)({
type: "wallet_config"
}, ks), {}, {
consumer_info: c,
token: null == d ? void 0 : d.object
})
});
case 31:
case "end":
return e.stop()
}
}
), e)
}
))),
function(e) {
return i.apply(this, arguments)
}
)
},
this.paymentPlans = {
list: function(e) {
var t = e.payment_detail_types
, n = e.total_amount
, r = e.currency
, a = e.locale
, i = JSON.stringify({
payment_detail_types: t,
total_amount: n,
currency: r,
locale: a
})
, o = y.listPaymentPlansCache[i];
if (o)
return o;
var s = y.retryOnConsumerSessionExpiry((0,
k.Z)((0,
S.Z)().mark((function t() {
return (0,
S.Z)().wrap((function(t) {
for (; ; )
switch (t.prev = t.next) {
case 0:
return t.t0 = y,
t.t1 = b.Z,
t.t2 = (0,
b.Z)({}, e),
t.t3 = {},
t.next = 6,
y.publishableKeyForMerchantOrConsumer();
case 6:
return t.t4 = t.sent,
t.t5 = y.useConsumerPublishableKey ? null : y.stripeAccount,
t.next = 10,
y.credentialsOrReject();
case 10:
return t.t6 = t.sent,
t.t7 = y.getRequestSurface(e.request_surface),
t.t8 = {
key: t.t4,
_stripe_account: t.t5,
credentials: t.t6,
request_surface: t.t7
},
t.t9 = (0,
t.t1)(t.t2, t.t3, t.t8),
t.t10 = {
path: "consumers/payment_plans/list",
method: "POST",
data: t.t9
},
t.abrupt("return", t.t0.request.call(t.t0, t.t10));
case 16:
case "end":
return t.stop()
}
}
), t)
}
))), {
requestSurface: e.request_surface
});
return y.listPaymentPlansCache[i] = s,
s
}
},
this.paymentDetails = {
create: function(e) {
return y.retryOnConsumerSessionExpiry((0,
k.Z)((0,
S.Z)().mark((function t() {
var n;
return (0,
S.Z)().wrap((function(t) {
for (; ; )
switch (t.prev = t.next) {
case 0:
return t.t0 = y,
t.t1 = b.Z,
t.t2 = b.Z,
t.next = 5,
y.publishableKeyForMerchantOrConsumer();
case 5:
return t.t3 = t.sent,
t.t4 = y.useConsumerPublishableKey ? null : y.stripeAccount,
t.next = 9,
y.credentialsOrReject();
case 9:
return t.t5 = t.sent,
t.t6 = y.getRequestSurface(e.request_surface),
t.t7 = {
key: t.t3,
_stripe_account: t.t4,
credentials: t.t5,
request_surface: t.t6
},
t.t8 = e,
t.t9 = (0,
t.t2)(t.t7, t.t8),
t.t10 = {},
t.t11 = {
nickname: null === (n = e.nickname) || void 0 === n ? void 0 : n.trim()
},
t.t12 = (0,
t.t1)(t.t9, t.t10, t.t11),
t.t13 = {
path: "consumers/payment_details",
method: "POST",
data: t.t12
},
t.abrupt("return", t.t0.request.call(t.t0, t.t13));
case 19:
case "end":
return t.stop()
}
}
), t)
}
))), {
requestSurface: e.request_surface
})
},
list: function(e) {
return y.retryOnConsumerSessionExpiry((0,
k.Z)((0,
S.Z)().mark((function t() {
return (0,
S.Z)().wrap((function(t) {
for (; ; )
switch (t.prev = t.next) {
case 0:
return t.t0 = y,
t.t1 = b.Z,
t.t2 = (0,
b.Z)({}, e),
t.t3 = {},
t.next = 6,
y.publishableKeyForMerchantOrConsumer();
case 6:
return t.t4 = t.sent,
t.t5 = y.useConsumerPublishableKey ? null : y.stripeAccount,
t.next = 10,
y.credentialsOrReject();
case 10:
return t.t6 = t.sent,
t.t7 = y.getRequestSurface(e.request_surface),
t.t8 = {
key: t.t4,
_stripe_account: t.t5,
credentials: t.t6,
request_surface: t.t7
},
t.t9 = (0,
t.t1)(t.t2, t.t3, t.t8),
t.t10 = {
path: "consumers/payment_details/list",
method: "POST",
data: t.t9
},
t.abrupt("return", t.t0.request.call(t.t0, t.t10));
case 16:
case "end":
return t.stop()
}
}
), t)
}
))), {
requestSurface: e.request_surface
})
},
shareToken: function(e) {
return y.retryOnConsumerSessionExpiry((0,
k.Z)((0,
S.Z)().mark((function t() {
return (0,
S.Z)().wrap((function(t) {
for (; ; )
switch (t.prev = t.next) {
case 0:
return t.t0 = y,
t.t1 = b.Z,
t.t2 = y.publishableKey,
t.t3 = y.stripeAccount,
t.next = 6,
y.credentialsOrReject();
case 6:
return t.t4 = t.sent,
t.t5 = y.getRequestSurface(e.request_surface),
t.t6 = {
key: t.t2,
_stripe_account: t.t3,
credentials: t.t4,
request_surface: t.t5
},
t.t7 = e,
t.t8 = (0,
t.t1)(t.t6, t.t7),
t.t9 = {
path: "consumers/payment_details/share_token",
method: "POST",
data: t.t8
},
t.abrupt("return", t.t0.request.call(t.t0, t.t9));
case 13:
case "end":
return t.stop()
}
}
), t)
}
))), {
requestSurface: e.request_surface
})
},
share: function(e) {
return y.retryOnConsumerSessionExpiry((0,
k.Z)((0,
S.Z)().mark((function t() {
var n, r, a, i;
return (0,
S.Z)().wrap((function(t) {
for (; ; )
switch (t.prev = t.next) {
case 0:
return t.t0 = y,
t.t1 = b.Z,
t.t2 = b.Z,
t.t3 = y.publishableKey,
t.t4 = y.stripeAccount,
t.next = 7,
y.credentialsOrReject();
case 7:
return t.t5 = t.sent,
t.t6 = y.getRequestSurface(e.request_surface),
t.t7 = {
key: t.t3,
_stripe_account: t.t4,
credentials: t.t5,
request_surface: t.t6
},
t.t8 = e,
t.t9 = (0,
t.t2)(t.t7, t.t8),
t.t10 = {},
t.t11 = {
payment_method_options: (0,
b.Z)((0,
b.Z)({}, e.payment_method_options), {}, {
client_attribution_metadata: (0,
b.Z)((0,
b.Z)({}, null === (n = e.payment_method_options) || void 0 === n ? void 0 : n.client_attribution_metadata), {}, {
client_session_id: null !== (r = null === (a = e.payment_method_options) || void 0 === a || null === (i = a.client_attribution_metadata) || void 0 === i ? void 0 : i.client_session_id) && void 0 !== r ? r : y.sessionId
})
})
},
t.t12 = (0,
t.t1)(t.t9, t.t10, t.t11),
t.t13 = {
path: "consumers/payment_details/share",
method: "POST",
data: t.t12
},
t.abrupt("return", t.t0.request.call(t.t0, t.t13));
case 17:
case "end":
return t.stop()
}
}
), t)
}
))), {
requestSurface: e.request_surface
})
},
update: function(e, t) {
return y.retryOnConsumerSessionExpiry((0,
k.Z)((0,
S.Z)().mark((function n() {
var r;
return (0,
S.Z)().wrap((function(n) {
for (; ; )
switch (n.prev = n.next) {
case 0:
return n.t0 = y,
n.t1 = "consumers/payment_details/".concat(e),
n.t2 = b.Z,
n.t3 = b.Z,
n.t4 = y.publishableKey,
n.t5 = y.stripeAccount,
n.next = 8,
y.credentialsOrReject();
case 8:
return n.t6 = n.sent,
n.t7 = y.getRequestSurface(t.request_surface),
n.t8 = {
key: n.t4,
_stripe_account: n.t5,
credentials: n.t6,
request_surface: n.t7
},
n.t9 = t,
n.t10 = (0,
n.t3)(n.t8, n.t9),
n.t11 = {},
n.t12 = {
nickname: null === (r = t.nickname) || void 0 === r ? void 0 : r.trim()
},
n.t13 = (0,
n.t2)(n.t10, n.t11, n.t12),
n.t14 = {
path: n.t1,
method: "POST",
data: n.t13
},
n.abrupt("return", n.t0.request.call(n.t0, n.t14));
case 18:
case "end":
return n.stop()
}
}
), n)
}
))), {
requestSurface: t.request_surface
})
},
delete: function(e) {
var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
return y.retryOnConsumerSessionExpiry((0,
k.Z)((0,
S.Z)().mark((function n() {
return (0,
S.Z)().wrap((function(n) {
for (; ; )
switch (n.prev = n.next) {
case 0:
return n.t0 = y,
n.t1 = "consumers/payment_details/".concat(e),
n.t2 = b.Z,
n.t3 = y.publishableKey,
n.t4 = y.stripeAccount,
n.next = 7,
y.credentialsOrReject();
case 7:
return n.t5 = n.sent,
n.t6 = y.getRequestSurface(t.request_surface),
n.t7 = {
key: n.t3,
_stripe_account: n.t4,
credentials: n.t5,
request_surface: n.t6
},
n.t8 = t,
n.t9 = (0,
n.t2)(n.t7, n.t8),
n.t10 = {
path: n.t1,
method: "DELETE",
data: n.t9
},
n.abrupt("return", n.t0.request.call(n.t0, n.t10));
case 14:
case "end":
return n.stop()
}
}
), n)
}
))), {
requestSurface: t.request_surface
})
}
},
this.shippingAddresses = {
create: function(e) {
return y.retryOnConsumerSessionExpiry((0,
k.Z)((0,
S.Z)().mark((function t() {
return (0,
S.Z)().wrap((function(t) {
for (; ; )
switch (t.prev = t.next) {
case 0:
return t.t0 = y,
t.t1 = b.Z,
t.t2 = (0,
b.Z)({}, e),
t.t3 = {},
t.t4 = y.publishableKey,
t.t5 = y.stripeAccount,
t.next = 8,
y.credentialsOrReject();
case 8:
return t.t6 = t.sent,
t.t7 = y.getRequestSurface(e.request_surface),
t.t8 = {
key: t.t4,
_stripe_account: t.t5,
credentials: t.t6,
request_surface: t.t7
},
t.t9 = (0,
t.t1)(t.t2, t.t3, t.t8),
t.t10 = {
path: "consumers/shipping_addresses",
method: "POST",
data: t.t9
},
t.abrupt("return", t.t0.request.call(t.t0, t.t10));
case 14:
case "end":
return t.stop()
}
}
), t)
}
))), {
requestSurface: e.request_surface
})
},
list: function() {
var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
return y.retryOnConsumerSessionExpiry((0,
k.Z)((0,
S.Z)().mark((function t() {
return (0,
S.Z)().wrap((function(t) {
for (; ; )
switch (t.prev = t.next) {
case 0:
return t.t0 = y,
t.t1 = b.Z,
t.t2 = (0,
b.Z)({}, e),
t.t3 = {},
t.next = 6,
y.publishableKeyForMerchantOrConsumer();
case 6:
return t.t4 = t.sent,
t.t5 = y.useConsumerPublishableKey ? null : y.stripeAccount,
t.next = 10,
y.credentialsOrReject();
case 10:
return t.t6 = t.sent,
t.t7 = y.getRequestSurface(e.request_surface),
t.t8 = {
key: t.t4,
_stripe_account: t.t5,
credentials: t.t6,
request_surface: t.t7
},
t.t9 = (0,
t.t1)(t.t2, t.t3, t.t8),
t.t10 = {
path: "consumers/shipping_addresses/list",
method: "POST",
data: t.t9
},
t.abrupt("return", t.t0.request.call(t.t0, t.t10));
case 16:
case "end":
return t.stop()
}
}
), t)
}
))), {
requestSurface: e.request_surface
})
},
update: function(e) {
var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
return y.retryOnConsumerSessionExpiry((0,
k.Z)((0,
S.Z)().mark((function n() {
return (0,
S.Z)().wrap((function(n) {
for (; ; )
switch (n.prev = n.next) {
case 0:
return n.t0 = y,
n.t1 = "consumers/shipping_addresses/".concat(e),
n.t2 = b.Z,
n.t3 = (0,
b.Z)({}, t),
n.t4 = {},
n.t5 = y.publishableKey,
n.t6 = y.stripeAccount,
n.next = 9,
y.credentialsOrReject();
case 9:
return n.t7 = n.sent,
n.t8 = y.getRequestSurface(t.request_surface),
n.t9 = {
key: n.t5,
_stripe_account: n.t6,
credentials: n.t7,
request_surface: n.t8
},
n.t10 = (0,
n.t2)(n.t3, n.t4, n.t9),
n.t11 = {
path: n.t1,
method: "POST",
data: n.t10
},
n.abrupt("return", n.t0.request.call(n.t0, n.t11));
case 15:
case "end":
return n.stop()
}
}
), n)
}
))), {
requestSurface: t.request_surface
})
},
delete: function(e) {
var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
return y.retryOnConsumerSessionExpiry((0,
k.Z)((0,
S.Z)().mark((function n() {
return (0,
S.Z)().wrap((function(n) {
for (; ; )
switch (n.prev = n.next) {
case 0:
return n.t0 = y,
n.t1 = "consumers/shipping_addresses/".concat(e),
n.t2 = b.Z,
n.t3 = (0,
b.Z)({}, t),
n.t4 = {},
n.t5 = y.publishableKey,
n.t6 = y.stripeAccount,
n.next = 9,
y.credentialsOrReject();
case 9:
return n.t7 = n.sent,
n.t8 = y.getRequestSurface(t.request_surface),
n.t9 = {
key: n.t5,
_stripe_account: n.t6,
credentials: n.t7,
request_surface: n.t8
},
n.t10 = (0,
n.t2)(n.t3, n.t4, n.t9),
n.t11 = {
path: n.t1,
method: "DELETE",
data: n.t10
},
n.abrupt("return", n.t0.request.call(n.t0, n.t11));
case 15:
case "end":
return n.stop()
}
}
), n)
}
))), {
requestSurface: t.request_surface
})
}
},
this.linkAccountSessions = {
create: function(e) {
return y.retryOnConsumerSessionExpiry((0,
k.Z)((0,
S.Z)().mark((function t() {
return (0,
S.Z)().wrap((function(t) {
for (; ; )
switch (t.prev = t.next) {
case 0:
return t.t0 = y,
t.t1 = b.Z,
t.t2 = (0,
b.Z)({}, e),
t.t3 = {},
t.next = 6,
y.publishableKeyForMerchantOrConsumer();
case 6:
return t.t4 = t.sent,
t.t5 = y.useConsumerPublishableKey ? null : y.stripeAccount,
t.next = 10,
y.credentialsOrReject();
case 10:
return t.t6 = t.sent,
t.t7 = y.getRequestSurface(e.request_surface),
t.t8 = {
key: t.t4,
_stripe_account: t.t5,
credentials: t.t6,
request_surface: t.t7
},
t.t9 = (0,
t.t1)(t.t2, t.t3, t.t8),
t.t10 = {
path: "consumers/link_account_sessions",
method: "POST",
data: t.t9
},
t.abrupt("return", t.t0.request.call(t.t0, t.t10));
case 16:
case "end":
return t.stop()
}
}
), t)
}
))), {
requestSurface: e.request_surface
})
},
attachLinkConsumer: function(e) {
return y.retryOnConsumerSessionExpiry((0,
k.Z)((0,
S.Z)().mark((function t() {
return (0,
S.Z)().wrap((function(t) {
for (; ; )
switch (t.prev = t.next) {
case 0:
return t.t0 = y,
t.t1 = b.Z,
t.t2 = (0,
b.Z)({}, e),
t.t3 = {},
t.t4 = y.publishableKey,
t.t5 = y.stripeAccount,
t.next = 8,
y.credentialsOrReject();
case 8:
return t.t6 = t.sent,
t.t7 = y.getRequestSurface(e.request_surface),
t.t8 = {
key: t.t4,
_stripe_account: t.t5,
credentials: t.t6,
request_surface: t.t7
},
t.t9 = (0,
t.t1)(t.t2, t.t3, t.t8),
t.t10 = {
path: "consumers/attach_link_consumer_to_link_account_session",
method: "POST",
data: t.t9
},
t.abrupt("return", t.t0.request.call(t.t0, t.t10));
case 14:
case "end":
return t.stop()
}
}
), t)
}
))), {
requestSurface: e.request_surface
})
}
},
this.experiments = {
financialIncentives: function(e) {
return y.retryOnConsumerSessionExpiry((0,
k.Z)((0,
S.Z)().mark((function t() {
return (0,
S.Z)().wrap((function(t) {
for (; ; )
switch (t.prev = t.next) {
case 0:
return t.abrupt("return", y.request({
path: "consumers/experiments/financial_incentives",
method: "POST",
data: (0,
b.Z)((0,
b.Z)({}, e), {}, {
stripe_js_id: y.sessionId,
key: y.publishableKey,
_stripe_account: y.stripeAccount,
request_surface: y.getRequestSurface(e.request_surface)
})
}));
case 1:
case "end":
return t.stop()
}
}
), t)
}
))), {
requestSurface: e.request_surface
})
}
},
this.incentives = {
updateAvailable: function(e) {
return y.retryOnConsumerSessionExpiry((0,
k.Z)((0,
S.Z)().mark((function t() {
return (0,
S.Z)().wrap((function(t) {
for (; ; )
switch (t.prev = t.next) {
case 0:
return t.t0 = y,
t.t1 = b.Z,
t.t2 = (0,
b.Z)({}, e),
t.t3 = {},
t.t4 = y.publishableKey,
t.t5 = y.stripeAccount,
t.next = 8,
y.credentialsOrReject();
case 8:
return t.t6 = t.sent,
t.t7 = y.getRequestSurface(e.request_surface),
t.t8 = {
key: t.t4,
_stripe_account: t.t5,
credentials: t.t6,
request_surface: t.t7
},
t.t9 = (0,
t.t1)(t.t2, t.t3, t.t8),
t.t10 = {
path: "consumers/incentives/update_available",
method: "POST",
data: t.t9
},
t.abrupt("return", t.t0.request.call(t.t0, t.t10));
case 14:
case "end":
return t.stop()
}
}
), t)
}
))), {
requestSurface: e.request_surface
})
}
},
this.purchaseProtections = {
create: function(e) {
return y.retryOnConsumerSessionExpiry((0,
k.Z)((0,
S.Z)().mark((function t() {
return (0,
S.Z)().wrap((function(t) {
for (; ; )
switch (t.prev = t.next) {
case 0:
return t.t0 = y,
t.t1 = b.Z,
t.t2 = (0,
b.Z)({}, e),
t.t3 = {},
t.t4 = y.publishableKey,
t.t5 = y.stripeAccount,
t.next = 8,
y.credentialsOrReject();
case 8:
return t.t6 = t.sent,
t.t7 = y.getRequestSurface(e.request_surface),
t.t8 = {
key: t.t4,
_stripe_account: t.t5,
credentials: t.t6,
request_surface: t.t7
},
t.t9 = (0,
t.t1)(t.t2, t.t3, t.t8),
t.t10 = {
path: "consumers/purchase_protection",
method: "POST",
data: t.t9
},
t.abrupt("return", t.t0.request.call(t.t0, t.t10));
case 14:
case "end":
return t.stop()
}
}
), t)
}
))), {
requestSurface: e.request_surface
})
}
},
this.cardPaymentStatus = {
list: function(e) {
return y.retryOnConsumerSessionExpiry((0,
k.Z)((0,
S.Z)().mark((function t() {
return (0,
S.Z)().wrap((function(t) {
for (; ; )
switch (t.prev = t.next) {
case 0:
return t.t0 = y,
t.t1 = "consumers/card_payment_status/".concat(e, "/list"),
t.t2 = y.publishableKey,
t.t3 = y.stripeAccount,
t.next = 6,
y.credentialsOrReject();
case 6:
return t.t4 = t.sent,
t.t5 = {
key: t.t2,
_stripe_account: t.t3,
credentials: t.t4
},
t.t6 = {
path: t.t1,
method: "POST",
data: t.t5
},
t.abrupt("return", t.t0.request.call(t.t0, t.t6));
case 10:
case "end":
return t.stop()
}
}
), t)
}
))))
}
},
this.cryptoOnramp = {
advanceLinkLogin: function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
var n, r, a, i, o;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return r = t.parsedSecret,
a = t.publishableKey,
e.next = 3,
y.sharedSessionManager.getAuthSessionClientSecret();
case 3:
if (i = e.sent,
o = null === (n = i.value) || void 0 === n ? void 0 : n.DANGEROUS_getValue()) {
e.next = 7;
break
}
throw new nu(eu.LJS002);
case 7:
return e.t0 = $u,
e.t1 = b.Z,
e.t2 = (0,
b.Z)({}, r),
e.t3 = {},
e.next = 13,
y.consumerPublishableKeyOrReject();
case 13:
return e.t4 = e.sent,
e.t5 = o,
e.t6 = {
consumer_publishable_key: e.t4,
auth_session_client_secret: e.t5
},
e.t7 = a,
e.t8 = {
advance_link_login_params: e.t6,
publishable_key: e.t7
},
e.t9 = (0,
e.t1)(e.t2, e.t3, e.t8),
e.abrupt("return", e.t0.advanceLinkLogin.call(e.t0, e.t9));
case 20:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t) {
return e.apply(this, arguments)
}
}(),
startPurchase: function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
var n, r, a, i, o;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return r = t.request,
a = t.publishableKey,
e.next = 3,
y.sharedSessionManager.getAuthSessionClientSecret();
case 3:
if (i = e.sent,
o = null === (n = i.value) || void 0 === n ? void 0 : n.DANGEROUS_getValue()) {
e.next = 7;
break
}
throw new nu(eu.LJS002);
case 7:
return e.abrupt("return", $u.startPurchase((0,
b.Z)((0,
b.Z)({}, r), {}, {
publishable_key: a,
auth_session_client_secret: o
})));
case 8:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t) {
return e.apply(this, arguments)
}
}(),
unwrapPaymentMethod: function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
var n, r;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return n = t.parsedSecret,
r = t.publishableKey,
e.abrupt("return", y.retryOnConsumerSessionExpiry((0,
k.Z)((0,
S.Z)().mark((function e() {
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return e.t0 = $u,
e.t1 = b.Z,
e.t2 = (0,
b.Z)({}, n),
e.t3 = {},
e.next = 6,
y.credentialsOrReject();
case 6:
return e.t4 = e.sent,
e.t5 = r,
e.t6 = {
unwrap_payment_method_params: e.t4,
publishable_key: e.t5
},
e.t7 = (0,
e.t1)(e.t2, e.t3, e.t6),
e.abrupt("return", e.t0.unwrapPaymentMethod.call(e.t0, e.t7));
case 11:
case "end":
return e.stop()
}
}
), e)
}
)))));
case 2:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t) {
return e.apply(this, arguments)
}
}(),
startIdentityVerification: function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
var n, r;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return n = t.request,
r = t.publishableKey,
e.abrupt("return", y.retryOnConsumerSessionExpiry((0,
k.Z)((0,
S.Z)().mark((function e() {
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return e.t0 = $u,
e.t1 = b.Z,
e.t2 = (0,
b.Z)({}, n),
e.t3 = {},
e.next = 6,
y.credentialsOrReject();
case 6:
return e.t4 = e.sent,
e.t5 = r,
e.t6 = {
credentials: e.t4,
publishable_key: e.t5
},
e.t7 = (0,
e.t1)(e.t2, e.t3, e.t6),
e.abrupt("return", e.t0.startIdentityVerification.call(e.t0, e.t7));
case 11:
case "end":
return e.stop()
}
}
), e)
}
)))));
case 2:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t) {
return e.apply(this, arguments)
}
}(),
updateConsumerSettings: function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return e.abrupt("return", y.retryOnConsumerSessionExpiry((0,
k.Z)((0,
S.Z)().mark((function e() {
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return e.t0 = $u,
e.t1 = b.Z,
e.t2 = (0,
b.Z)({}, t),
e.t3 = {},
e.next = 6,
y.credentialsOrReject();
case 6:
return e.t4 = e.sent,
e.next = 9,
y.consumerPublishableKeyOrReject();
case 9:
return e.t5 = e.sent,
e.t6 = {
credentials: e.t4,
publishable_key: e.t5
},
e.t7 = (0,
e.t1)(e.t2, e.t3, e.t6),
e.abrupt("return", e.t0.updateConsumerSettings.call(e.t0, e.t7));
case 13:
case "end":
return e.stop()
}
}
), e)
}
)))));
case 1:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t) {
return e.apply(this, arguments)
}
}(),
listTransactions: function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e() {
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return e.abrupt("return", y.retryOnConsumerSessionExpiry((0,
k.Z)((0,
S.Z)().mark((function e() {
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return e.t0 = $u,
e.next = 3,
y.credentialsOrReject();
case 3:
return e.t1 = e.sent,
e.next = 6,
y.consumerPublishableKeyOrReject();
case 6:
return e.t2 = e.sent,
e.t3 = {
credentials: e.t1,
publishable_key: e.t2
},
e.abrupt("return", e.t0.listTransactions.call(e.t0, e.t3));
case 9:
case "end":
return e.stop()
}
}
), e)
}
)))));
case 1:
case "end":
return e.stop()
}
}
), e)
}
)));
return function() {
return e.apply(this, arguments)
}
}(),
populateConsumerPerson: function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return e.abrupt("return", y.retryOnConsumerSessionExpiry((0,
k.Z)((0,
S.Z)().mark((function e() {
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return e.t0 = $u,
e.t1 = b.Z,
e.t2 = (0,
b.Z)({}, t),
e.t3 = {},
e.next = 6,
y.credentialsOrReject();
case 6:
return e.t4 = e.sent,
e.next = 9,
y.consumerPublishableKeyOrReject();
case 9:
return e.t5 = e.sent,
e.t6 = {
credentials: e.t4,
publishable_key: e.t5
},
e.t7 = (0,
e.t1)(e.t2, e.t3, e.t6),
e.abrupt("return", e.t0.populateConsumerPerson.call(e.t0, e.t7));
case 13:
case "end":
return e.stop()
}
}
), e)
}
)))));
case 1:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t) {
return e.apply(this, arguments)
}
}(),
createConsumerWallet: function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return e.abrupt("return", y.retryOnConsumerSessionExpiry((0,
k.Z)((0,
S.Z)().mark((function e() {
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return e.t0 = $u,
e.t1 = b.Z,
e.t2 = (0,
b.Z)({}, t),
e.t3 = {},
e.next = 6,
y.credentialsOrReject();
case 6:
return e.t4 = e.sent,
e.next = 9,
y.consumerPublishableKeyOrReject();
case 9:
return e.t5 = e.sent,
e.t6 = {
credentials: e.t4,
publishable_key: e.t5
},
e.t7 = (0,
e.t1)(e.t2, e.t3, e.t6),
e.abrupt("return", e.t0.createConsumerWallet.call(e.t0, e.t7));
case 13:
case "end":
return e.stop()
}
}
), e)
}
)))));
case 1:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t) {
return e.apply(this, arguments)
}
}(),
deleteConsumerWallet: function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return e.abrupt("return", y.retryOnConsumerSessionExpiry((0,
k.Z)((0,
S.Z)().mark((function e() {
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return e.t0 = $u,
e.t1 = b.Z,
e.t2 = (0,
b.Z)({}, t),
e.t3 = {},
e.next = 6,
y.credentialsOrReject();
case 6:
return e.t4 = e.sent,
e.next = 9,
y.consumerPublishableKeyOrReject();
case 9:
return e.t5 = e.sent,
e.t6 = {
credentials: e.t4,
publishable_key: e.t5
},
e.t7 = (0,
e.t1)(e.t2, e.t3, e.t6),
e.abrupt("return", e.t0.deleteConsumerWallet.call(e.t0, e.t7));
case 13:
case "end":
return e.stop()
}
}
), e)
}
)))));
case 1:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t) {
return e.apply(this, arguments)
}
}(),
advanceWalletAttach: function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
var n, r, a;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return n = t.params,
r = t.publishableKey,
a = t.parsedSecret,
e.abrupt("return", y.retryOnConsumerSessionExpiry((0,
k.Z)((0,
S.Z)().mark((function e() {
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return e.t0 = $u,
e.t1 = b.Z,
e.t2 = (0,
b.Z)({}, a),
e.t3 = {},
e.t4 = n.advance_wallet_attach_params.consumer_wallet_token,
e.next = 7,
y.credentialsOrReject();
case 7:
return e.t5 = e.sent,
e.t6 = {
consumer_wallet_token: e.t4,
credentials: e.t5
},
e.t7 = r,
e.t8 = {
advance_wallet_attach_params: e.t6,
publishable_key: e.t7
},
e.t9 = (0,
e.t1)(e.t2, e.t3, e.t8),
e.abrupt("return", e.t0.advanceWalletAttach.call(e.t0, e.t9));
case 13:
case "end":
return e.stop()
}
}
), e)
}
)))));
case 2:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t) {
return e.apply(this, arguments)
}
}(),
confirmPurchase: function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
var n, r;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return n = t.request,
r = t.publishableKey,
e.abrupt("return", y.retryOnConsumerSessionExpiry((0,
k.Z)((0,
S.Z)().mark((function e() {
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return e.t0 = $u,
e.t1 = b.Z,
e.t2 = (0,
b.Z)({}, n),
e.t3 = {},
e.next = 6,
y.credentialsOrReject();
case 6:
return e.t4 = e.sent,
e.t5 = r,
e.t6 = {
credentials: e.t4,
publishable_key: e.t5
},
e.t7 = (0,
e.t1)(e.t2, e.t3, e.t6),
e.abrupt("return", e.t0.confirmPurchase.call(e.t0, e.t7));
case 11:
case "end":
return e.stop()
}
}
), e)
}
)))));
case 2:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t) {
return e.apply(this, arguments)
}
}()
},
this.cryptoPayins = {
lookupConsumerWallet: (u = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
var n;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return n = t.request,
e.abrupt("return", y.retryOnConsumerSessionExpiry((0,
k.Z)((0,
S.Z)().mark((function e() {
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return e.t0 = Zs.Nv,
e.t1 = b.Z,
e.t2 = (0,
b.Z)({}, n),
e.t3 = {},
e.next = 6,
y.credentialsOrReject();
case 6:
return e.t4 = e.sent,
e.t5 = {
credentials: e.t4
},
e.t6 = (0,
e.t1)(e.t2, e.t3, e.t5),
e.t7 = "Bearer ",
e.next = 12,
y.consumerPublishableKeyOrReject();
case 12:
return e.t8 = e.sent,
e.t9 = e.t7.concat.call(e.t7, e.t8),
e.t10 = {
Authorization: e.t9
},
e.t11 = {
headers: e.t10
},
e.abrupt("return", (0,
e.t0)("crypto/internal/wallet/lookup", "POST", e.t6, e.t11));
case 17:
case "end":
return e.stop()
}
}
), e)
}
)))));
case 2:
case "end":
return e.stop()
}
}
), e)
}
))),
function(e) {
return u.apply(this, arguments)
}
),
lookupConsumerPerson: (s = (0,
k.Z)((0,
S.Z)().mark((function e() {
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return e.abrupt("return", y.retryOnConsumerSessionExpiry((0,
k.Z)((0,
S.Z)().mark((function e() {
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return e.t0 = Zs.Nv,
e.next = 3,
y.credentialsOrReject();
case 3:
return e.t1 = e.sent,
e.t2 = {
credentials: e.t1
},
e.t3 = "Bearer ",
e.next = 8,
y.consumerPublishableKeyOrReject();
case 8:
return e.t4 = e.sent,
e.t5 = e.t3.concat.call(e.t3, e.t4),
e.t6 = {
Authorization: e.t5
},
e.t7 = {
headers: e.t6
},
e.abrupt("return", (0,
e.t0)("crypto/internal/person/lookup", "POST", e.t2, e.t7));
case 13:
case "end":
return e.stop()
}
}
), e)
}
)))));
case 1:
case "end":
return e.stop()
}
}
), e)
}
))),
function() {
return s.apply(this, arguments)
}
),
populateConsumerPerson: (o = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
var n;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return n = t.request,
e.abrupt("return", y.retryOnConsumerSessionExpiry((0,
k.Z)((0,
S.Z)().mark((function e() {
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return e.t0 = Zs.Nv,
e.t1 = b.Z,
e.t2 = (0,
b.Z)({}, n),
e.t3 = {},
e.next = 6,
y.credentialsOrReject();
case 6:
return e.t4 = e.sent,
e.t5 = {
credentials: e.t4
},
e.t6 = (0,
e.t1)(e.t2, e.t3, e.t5),
e.t7 = "Bearer ",
e.next = 12,
y.consumerPublishableKeyOrReject();
case 12:
return e.t8 = e.sent,
e.t9 = e.t7.concat.call(e.t7, e.t8),
e.t10 = {
Authorization: e.t9
},
e.t11 = {
headers: e.t10
},
e.abrupt("return", (0,
e.t0)("crypto/internal/person/populate", "POST", e.t6, e.t11));
case 17:
case "end":
return e.stop()
}
}
), e)
}
)))));
case 2:
case "end":
return e.stop()
}
}
), e)
}
))),
function(e) {
return o.apply(this, arguments)
}
)
},
this.networkedConnections = {
pollForNetworkedAccounts: (f = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
var n, r, a;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return n = y.useConsumerPublishableKey,
e.next = 3,
y.publishableKeyForMerchantOrConsumer();
case 3:
return e.t0 = e.sent,
e.t1 = n ? null : y.stripeAccount,
e.t2 = n ? null : t._stripe_version,
r = {
key: e.t0,
_stripe_account: e.t1,
_stripe_version: e.t2
},
e.next = 9,
y.credentialsOrReject();
case 9:
return a = e.sent,
e.abrupt("return", ws(r, t.client_secret, a.consumer_session_client_secret));
case 11:
case "end":
return e.stop()
}
}
), e)
}
))),
function(e) {
return f.apply(this, arguments)
}
),
saveToNetworkAndLink: (m = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
var n, r, a, i, o;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
if (void 0 !== t.email_address) {
e.next = 4;
break
}
return e.next = 3,
y.credentialsOrReject().then((function(e) {
return e.consumer_session_client_secret
}
)).catch((function() {}
));
case 3:
n = e.sent;
case 4:
return e.next = 6,
Ts({
key: y.publishableKey,
_stripe_account: y.stripeAccount,
_stripe_version: t._stripe_version
}, t.client_secret, t.selected_accounts, t.country, t.country_inferring_method, t.locale, t.email_address, t.phone_number, n, t.hcaptcha_response, t.hcaptcha_key);
case 6:
if ("error" !== (r = e.sent).type) {
e.next = 9;
break
}
return e.abrupt("return", r);
case 9:
return a = r.object,
i = a.auth_session_client_secret,
o = (0,
h.Z)(a, Kl),
i && (y.sharedSessionManager.actions.setAuthSessionClientSecret({
secret: i
}),
y.clearLookupCache(),
y.clearListPaymentPlansCache()),
e.abrupt("return", (0,
b.Z)((0,
b.Z)({}, r), {}, {
object: o
}));
case 12:
case "end":
return e.stop()
}
}
), e)
}
))),
function(e) {
return m.apply(this, arguments)
}
),
selectNetworkedAccounts: (p = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
var n, r, a;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return e.next = 2,
y.credentialsOrReject().then((function(e) {
return e.consumer_session_client_secret
}
)).catch((function() {}
));
case 2:
return n = e.sent,
r = y.useConsumerPublishableKey,
e.next = 6,
y.publishableKeyForMerchantOrConsumer();
case 6:
return e.t0 = e.sent,
e.t1 = r ? null : y.stripeAccount,
e.t2 = r ? null : t._stripe_version,
a = {
key: e.t0,
_stripe_account: e.t1,
_stripe_version: e.t2
},
e.abrupt("return", Os(a, t.client_secret, t.selected_accounts, n, t.consent_acquired));
case 11:
case "end":
return e.stop()
}
}
), e)
}
))),
function(e) {
return p.apply(this, arguments)
}
),
lookupConsumerSessionForConnections: (d = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
var n, r, a, i, o, s, u;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return e.next = 2,
y.sharedSessionManager.getAuthSessionClientSecret();
case 2:
return r = e.sent,
a = r.value,
i = r.lifetime,
o = null !== (n = y.formattedCookies(a, i)) && void 0 !== n ? n : void 0,
e.next = 8,
Rs({
key: y.publishableKey,
_stripe_account: y.stripeAccount,
_stripe_version: t._stripe_version
}, t.client_secret, t.email_address, o);
case 8:
if ("error" !== (s = e.sent).type) {
e.next = 11;
break
}
return e.abrupt("return", s);
case 11:
if ((u = s.object).exists) {
e.next = 14;
break
}
return e.abrupt("return", (0,
b.Z)((0,
b.Z)({}, s), {}, {
object: u
}));
case 14:
return y.sharedSessionManager.actions.storeCredentials({
consumerInfo: u
}),
e.abrupt("return", (0,
b.Z)((0,
b.Z)({}, s), {}, {
object: Dl(u)
}));
case 16:
case "end":
return e.stop()
}
}
), e)
}
))),
function(e) {
return d.apply(this, arguments)
}
),
attachPaymentAccountToLinkAccountSession: (c = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
var n, r, a;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return n = y.useConsumerPublishableKey,
e.next = 3,
y.credentialsOrReject().then((function(e) {
return e.consumer_session_client_secret
}
)).catch((function() {}
));
case 3:
return r = e.sent,
e.next = 6,
y.publishableKeyForMerchantOrConsumer();
case 6:
return e.t0 = e.sent,
e.t1 = n ? null : y.stripeAccount,
e.t2 = n ? null : t._stripe_version,
a = {
key: e.t0,
_stripe_account: e.t1,
_stripe_version: e.t2
},
e.abrupt("return", Is(a, t.clientSecret, t.paymentAccount, r, t.numRetries, t.retryInterval));
case 11:
case "end":
return e.stop()
}
}
), e)
}
))),
function(e) {
return c.apply(this, arguments)
}
),
completeLinkAccountSession: function(e) {
var t = {
key: e.publishableKey,
_stripe_account: e._stripe_account,
_stripe_version: e._stripe_version
};
return Ns(t, e.client_secret, e.terminal_error)
},
synchronizeLinkAccountSessionManifest: (l = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o, s;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return e.next = 2,
y.sharedSessionManager.getAuthSessionClientSecret();
case 2:
return a = e.sent,
i = a.value,
o = a.lifetime,
s = null !== (r = y.formattedCookies(i, o)) && void 0 !== r ? r : void 0,
e.abrupt("return", xs(t, n, s));
case 7:
case "end":
return e.stop()
}
}
), e)
}
))),
function(e, t) {
return l.apply(this, arguments)
}
)
},
this.paymentIntent = {
confirm: function(e) {
var t = e.id
, n = e.data
, r = e.merchantParams;
return y.retryOnConsumerSessionExpiry((0,
k.Z)((0,
S.Z)().mark((function e() {
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return e.t0 = Ol.paymentIntents,
e.t1 = t,
e.t2 = b.Z,
e.t3 = (0,
b.Z)({}, n),
e.t4 = {},
e.t5 = b.Z,
e.t6 = (0,
b.Z)({}, n.payment_method_data),
e.t7 = {},
e.t8 = b.Z,
e.t9 = (0,
b.Z)({}, n.payment_method_data.link),
e.t10 = {},
e.next = 13,
y.credentialsOrReject();
case 13:
return e.t11 = e.sent,
e.t12 = {
credentials: e.t11
},
e.t13 = (0,
e.t8)(e.t9, e.t10, e.t12),
e.t14 = {
link: e.t13
},
e.t15 = (0,
e.t5)(e.t6, e.t7, e.t14),
e.t16 = {
payment_method_data: e.t15
},
e.t17 = (0,
e.t2)(e.t3, e.t4, e.t16),
e.t18 = y.unexpected400Log,
e.t19 = r,
e.t20 = {
id: e.t1,
data: e.t17,
log: e.t18,
merchantParams: e.t19
},
e.abrupt("return", e.t0.confirm.call(e.t0, e.t20));
case 24:
case "end":
return e.stop()
}
}
), e)
}
))))
},
confirmWithPaymentMethodId: function(e) {
var t = e.id
, n = e.data
, r = e.merchantParams;
return y.retryOnConsumerSessionExpiry((0,
k.Z)((0,
S.Z)().mark((function e() {
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return e.abrupt("return", Ol.paymentIntents.confirm({
id: t,
data: n,
log: y.unexpected400Log,
merchantParams: r
}));
case 1:
case "end":
return e.stop()
}
}
), e)
}
))))
},
update: function(e) {
var t = e.id
, n = e.data
, r = e.merchantParams;
return y.retryOnConsumerSessionExpiry((0,
k.Z)((0,
S.Z)().mark((function e() {
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return e.t0 = Ol.paymentIntents,
e.t1 = t,
e.t2 = b.Z,
e.t3 = (0,
b.Z)({}, n),
e.t4 = {},
e.t5 = b.Z,
e.t6 = (0,
b.Z)({}, n.payment_method_data),
e.t7 = {},
e.t8 = b.Z,
e.t9 = (0,
b.Z)({}, n.payment_method_data.link),
e.t10 = {},
e.next = 13,
y.credentialsOrReject();
case 13:
return e.t11 = e.sent,
e.t12 = {
credentials: e.t11
},
e.t13 = (0,
e.t8)(e.t9, e.t10, e.t12),
e.t14 = {
link: e.t13
},
e.t15 = (0,
e.t5)(e.t6, e.t7, e.t14),
e.t16 = {
payment_method_data: e.t15
},
e.t17 = (0,
e.t2)(e.t3, e.t4, e.t16),
e.t18 = y.unexpected400Log,
e.t19 = r,
e.t20 = {
id: e.t1,
data: e.t17,
log: e.t18,
merchantParams: e.t19
},
e.abrupt("return", e.t0.update.call(e.t0, e.t20));
case 24:
case "end":
return e.stop()
}
}
), e)
}
))))
}
},
this.setupIntent = {
confirm: function(e) {
var t = e.id
, n = e.clientSecret
, r = e.data
, a = e.merchantParams;
return y.retryOnConsumerSessionExpiry((0,
k.Z)((0,
S.Z)().mark((function e() {
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return e.t0 = Ol.setupIntents,
e.t1 = t,
e.t2 = b.Z,
e.t3 = (0,
b.Z)({}, r),
e.t4 = {},
e.t5 = n,
e.t6 = b.Z,
e.t7 = (0,
b.Z)({}, r.payment_method_data),
e.t8 = {},
e.t9 = b.Z,
e.t10 = (0,
b.Z)({}, r.payment_method_data.link),
e.t11 = {},
e.next = 14,
y.credentialsOrReject();
case 14:
return e.t12 = e.sent,
e.t13 = {
credentials: e.t12
},
e.t14 = (0,
e.t9)(e.t10, e.t11, e.t13),
e.t15 = {
link: e.t14
},
e.t16 = (0,
e.t6)(e.t7, e.t8, e.t15),
e.t17 = {
client_secret: e.t5,
payment_method_data: e.t16
},
e.t18 = (0,
e.t2)(e.t3, e.t4, e.t17),
e.t19 = y.unexpected400Log,
e.t20 = a,
e.t21 = {
id: e.t1,
data: e.t18,
log: e.t19,
merchantParams: e.t20
},
e.abrupt("return", e.t0.confirm.call(e.t0, e.t21));
case 25:
case "end":
return e.stop()
}
}
), e)
}
))))
},
consumerIntentComplete: function(e) {
var t = e.id
, n = e.clientSecret
, r = e.paymentDetailsId;
return y.retryOnConsumerSessionExpiry((0,
k.Z)((0,
S.Z)().mark((function e() {
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return e.t0 = Ls,
e.t1 = t,
e.t2 = n,
e.t3 = y.publishableKey,
e.next = 6,
y.credentialsOrReject();
case 6:
return e.t4 = e.sent,
e.t5 = r,
e.t6 = {
key: e.t3,
credentials: e.t4,
payment_details_id: e.t5
},
e.abrupt("return", (0,
e.t0)(e.t1, e.t2, e.t6));
case 10:
case "end":
return e.stop()
}
}
), e)
}
))))
}
},
this.paymentMethod = {
create: function(e) {
return y.retryOnConsumerSessionExpiry((0,
k.Z)((0,
S.Z)().mark((function t() {
return (0,
S.Z)().wrap((function(t) {
for (; ; )
switch (t.prev = t.next) {
case 0:
return t.t0 = Bs,
t.t1 = b.Z,
t.t2 = (0,
b.Z)({
key: y.publishableKey,
_stripe_account: y.stripeAccount
}, e),
t.t3 = {},
t.t4 = b.Z,
t.t5 = (0,
b.Z)({}, e.link),
t.t6 = {},
t.next = 9,
y.credentialsOrReject();
case 9:
return t.t7 = t.sent,
t.t8 = {
credentials: t.t7
},
t.t9 = (0,
t.t4)(t.t5, t.t6, t.t8),
t.t10 = {
link: t.t9
},
t.t11 = (0,
t.t1)(t.t2, t.t3, t.t10),
t.t12 = y.unexpected400Log,
t.t13 = {
data: t.t11,
errorLog: t.t12
},
t.abrupt("return", t.t0.create.call(t.t0, t.t13));
case 17:
case "end":
return t.stop()
}
}
), t)
}
))))
}
},
this.paymentPage = {
confirm: (_ = (0,
k.Z)((0,
S.Z)().mark((function e(t, n, r) {
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return e.abrupt("return", y.retryOnConsumerSessionExpiry((0,
k.Z)((0,
S.Z)().mark((function e() {
var a, i;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return a = n.link,
e.next = 3,
y.credentials();
case 3:
return i = e.sent,
!a && i && (a = {
credentials: i
}),
e.abrupt("return", (0,
Us.Wj)("payment_pages/".concat(t, "/confirm"), "POST", (0,
b.Z)((0,
b.Z)({}, n), a ? {
link: a
} : null), r, {
includeErrorStatus: !0
}));
case 6:
case "end":
return e.stop()
}
}
), e)
}
)))));
case 1:
case "end":
return e.stop()
}
}
), e)
}
))),
function(e, t, n) {
return _.apply(this, arguments)
}
)
},
this.confirmationToken = {
create: function(e) {
return y.retryOnConsumerSessionExpiry((0,
k.Z)((0,
S.Z)().mark((function t() {
return (0,
S.Z)().wrap((function(t) {
for (; ; )
switch (t.prev = t.next) {
case 0:
return t.t0 = Ol.confirmationTokens,
t.t1 = b.Z,
t.t2 = (0,
b.Z)({}, e),
t.t3 = {},
t.t4 = b.Z,
t.t5 = (0,
b.Z)({}, e.payment_method_data),
t.t6 = {},
t.t7 = b.Z,
t.t8 = (0,
b.Z)({}, e.payment_method_data.link),
t.t9 = {},
t.next = 12,
y.credentialsOrReject();
case 12:
return t.t10 = t.sent,
t.t11 = {
credentials: t.t10
},
t.t12 = (0,
t.t7)(t.t8, t.t9, t.t11),
t.t13 = {
link: t.t12
},
t.t14 = (0,
t.t4)(t.t5, t.t6, t.t13),
t.t15 = {
payment_method_data: t.t14
},
t.t16 = (0,
t.t1)(t.t2, t.t3, t.t15),
t.t17 = {
data: t.t16
},
t.abrupt("return", t.t0.create.call(t.t0, t.t17));
case 21:
case "end":
return t.stop()
}
}
), t)
}
))))
}
},
!tl(t))
throw new nu(eu.LJS001);
this.numRequestsInProgress = 0,
this.publishableKey = n;
var I = -1 === this.publishableKey.indexOf("pk_test_");
this._sharedRequestSurface = t,
this.stripeAccount = r,
this.useConsumerPublishableKey = P,
this.sessionId = A,
this.logger = new _u(t),
this.logger.updateParams({
publishable_key: n,
request_surface: t,
stripe_account: r,
livemode: I,
routing: null !== (a = null == g ? void 0 : g.type) && void 0 !== a ? a : "root",
session_id: A
}),
this.logger.log(hu.Init),
this.sharedSessionManager = new Du({
logger: this.logger,
routing: g,
livemode: I,
publishableKey: n,
requestSurface: t
}),
Z || this.preloadAndLogAuth()
}
var t, n, r, a, i, o, s, u, l, c, d, p, m, f, _, y, v, g, Z, A;
return (0,
E.Z)(e, [{
key: "getRequestSurface",
value: function(e) {
return null != e ? e : this._sharedRequestSurface
}
}, {
key: "shareSessionContext",
value: function(e) {
return {
publishableKey: this.publishableKey,
stripeAccount: this.stripeAccount,
routing: this.sharedSessionManager.createRouting(e)
}
}
}, {
key: "preloadAndLogAuth",
value: function() {
var e = this;
this.sharedSessionManager.getAuthSessionClientSecret().then((function(t) {
t.value.isEmpty() || e.logger.log(hu.HasAuth, {
lifetime: t.lifetime
})
}
))
}
}, {
key: "request",
value: function(e) {
var t, n = this, r = e.path, a = e.method, i = e.data, o = e.config, s = e.merchantParams, u = null === (t = Es[r]) || void 0 === t ? void 0 : t[a], l = (0,
b.Z)({
log: this.unexpected400Log,
extraLogData: {
team: "link_pax",
path: r
},
key: this.publishableKey,
merchantParams: s,
expectedErrors: u,
debug: !0
}, o);
return (0,
Us.Wj)(r, a, i, l, {
includeErrorStatus: !0,
includeRequestId: !0,
headers: {
"Accept-Language": "en"
}
}).catch((function(e) {
return e instanceof Error && ("FetchError" === e.name || "NetworkError" === e.name) ? {
type: "error",
error: {
type: "api_connection_error",
extra_fields: {
name: e.name
}
}
} : (n.logger.log(hu.InternalError, {
method: "request",
message: e instanceof Error ? e.message : "Unknown error",
path: r
}),
{
type: "error",
error: {
type: "unexpected_error"
}
})
}
))
}
}, {
key: "preloadStoredCredentials",
value: function() {
this.preloadAndLogAuth()
}
}, {
key: "setUseConsumerPublishableKey",
value: function(e) {
this.useConsumerPublishableKey = e
}
}, {
key: "cachedLookup",
value: (A = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
var n, r, a, i, o, s, u, l, c = this;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
if (n = t.email_address,
r = t.session_id,
a = t.cookies,
i = (0,
h.Z)(t, Vl),
this.sessionId = null != r ? r : this.sessionId,
o = null == n ? void 0 : n.email.trim().toLowerCase(),
s = JSON.stringify({
session_id: this.sessionId,
email_address: o,
cookies: a
}),
!(u = this.lookupCache[s])) {
e.next = 8;
break
}
return this.logger.log(hu.LookupCacheHit),
e.abrupt("return", u);
case 8:
return this.logger.log(hu.LookupRequestFired, {
num_requests_already_in_progress: this.numRequestsInProgress,
has_email: Boolean(o),
has_cookie: Boolean(a)
}),
this.numRequestsInProgress += 1,
l = this.request({
path: "consumers/sessions/lookup",
method: "POST",
data: (0,
b.Z)((0,
b.Z)({}, i), {}, {
email_address: null == n ? void 0 : n.email,
email_source: null == n ? void 0 : n.source,
cookies: a,
session_id: this.sessionId,
key: this.publishableKey,
_stripe_account: this.stripeAccount
}),
config: {
retries: {
shouldRetry: function(e) {
return !e.code
},
maxAttempts: 2
}
}
}).then((function(e) {
var r;
if (c.numRequestsInProgress -= 1,
null !== (r = e.object) && void 0 !== r && r.exists) {
var a, i, o = e.object, s = o.consumer_session, u = o.settings, l = o.redacted_payment_details, d = o.account_id, p = c.linkApiClientSurfaceToLinkFunnelSurface(c.getRequestSurface(t.request_surface));
p && (i = Ot(s.verification_sessions) && !u.found_using_partial_cookie ? "cookie" : u.found_using_partial_cookie ? "partial-cookie" : null == n ? void 0 : n.source,
cl.linkApiClientEvent(nl.LinkLookupSuccessful, p, {
source: i,
hasSavedPaymentDetails: Boolean(null === (a = l[0]) || void 0 === a ? void 0 : a.card_details),
consumerAccountId: d
})),
c.sharedSessionManager.actions.storeCredentials({
consumerInfo: e.object
})
}
return e
}
)),
this.lookupCache[s] = l,
e.abrupt("return", l);
case 13:
case "end":
return e.stop()
}
}
), e, this)
}
))),
function(e) {
return A.apply(this, arguments)
}
)
}, {
key: "clearLookupCache",
value: function() {
this.lookupCache = {}
}
}, {
key: "clearListPaymentPlansCache",
value: function() {
this.listPaymentPlansCache = {}
}
}, {
key: "DANGEROUS_uncachedUnloggedLookup",
value: (Z = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
var n, r, a, i, o, s;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return n = t.session_id,
r = t.email_address,
a = t.cookies,
i = (0,
h.Z)(t, zl),
e.next = 3,
this.request({
path: "consumers/sessions/lookup",
method: "POST",
data: (0,
b.Z)((0,
b.Z)({}, i), {}, {
email_address: null == r ? void 0 : r.email,
email_source: null == r ? void 0 : r.source,
cookies: a,
session_id: null != n ? n : this.sessionId,
key: this.publishableKey,
_stripe_account: this.stripeAccount,
TEMPORARY_AND_DANGEROUS__do_not_log_consumer_funnel_event: !0
}),
config: {
retries: {
shouldRetry: function(e) {
return !e.code
},
maxAttempts: 2
}
}
});
case 3:
if ("error" !== (o = e.sent).type) {
e.next = 6;
break
}
return e.abrupt("return", o);
case 6:
if ((s = o.object).exists) {
e.next = 9;
break
}
return e.abrupt("return", (0,
b.Z)((0,
b.Z)({}, o), {}, {
object: s
}));
case 9:
return e.abrupt("return", (0,
b.Z)((0,
b.Z)({}, o), {}, {
object: Dl(s)
}));
case 10:
case "end":
return e.stop()
}
}
), e, this)
}
))),
function(e) {
return Z.apply(this, arguments)
}
)
}, {
key: "linkApiClientSurfaceToLinkFunnelSurface",
value: function(e) {
switch (e) {
case vt.jL.CardElementPopup:
return rl.CardElement;
case vt.jL.SplitCardElementPopup:
return rl.SplitCardElement;
case vt.jL.CheckoutPopup:
case vt.jL.LegacyElementsPopup:
case vt.jL.HostedInvoicePagePopup:
return rl.PaymentRequestButtonElement;
case vt.jL.ExpressCheckoutElementPopup:
return rl.ExpressCheckoutElement;
case vt.jL.PaymentElement:
case vt.jL.HostedInvoicePagePaymentElement:
case vt.jL.LinkAuthenticationInPaymentElement:
return rl.PaymentElement;
case vt.jL.LinkAuthenticationElement:
return rl.LinkAuthenticationElement;
case vt.jL.MobileSdkPopup:
return rl.MobileElement;
case vt.jL.ElementsController:
return rl.GlobalElements;
case vt.jL.Checkout:
return rl.Checkout;
default:
return
}
}
}, {
key: "consumerPublishableKeyOrReject",
value: (g = (0,
k.Z)((0,
S.Z)().mark((function e() {
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return e.abrupt("return", this.sharedSessionManager.credentialsOrReject().then((function(e) {
return e.consumerPublishableKey
}
)));
case 1:
case "end":
return e.stop()
}
}
), e, this)
}
))),
function() {
return g.apply(this, arguments)
}
)
}, {
key: "credentials",
value: (v = (0,
k.Z)((0,
S.Z)().mark((function e() {
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return e.abrupt("return", this.sharedSessionManager.credentials().then((function(e) {
return e ? {
consumer_session_client_secret: e.consumerSessionClientSecret
} : null
}
)));
case 1:
case "end":
return e.stop()
}
}
), e, this)
}
))),
function() {
return v.apply(this, arguments)
}
)
}, {
key: "credentialsOrReject",
value: (y = (0,
k.Z)((0,
S.Z)().mark((function e() {
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return e.abrupt("return", this.sharedSessionManager.credentialsOrReject().then((function(e) {
return {
consumer_session_client_secret: e.consumerSessionClientSecret
}
}
)));
case 1:
case "end":
return e.stop()
}
}
), e, this)
}
))),
function() {
return y.apply(this, arguments)
}
)
}, {
key: "publishableKeyForMerchantOrConsumer",
value: function() {
return this.useConsumerPublishableKey ? this.consumerPublishableKeyOrReject() : ql.resolve(this.publishableKey)
}
}, {
key: "formattedCookies",
value: function(e, t) {
var n = e.DANGEROUS_getValue();
return n ? {
cookies: {
verification_session_client_secrets: [n],
lifetime: t
}
} : null
}
}, {
key: "attemptLogInUsingEmailOrCredential",
value: (_ = (0,
k.Z)((0,
S.Z)().mark((function e() {
var t, n, r, a, i, o, s, u, l, c, d, p, m, f, h, _, y, v, g, k, C, E, Z, A, M, P, x = arguments;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
if (r = x.length > 0 && void 0 !== x[0] ? x[0] : {},
a = r.credential,
i = void 0 === a ? null : a,
o = r.sessionId,
s = void 0 === o ? null : o,
u = r.emailAddress,
l = void 0 === u ? null : u,
c = r.paymentAmount,
d = void 0 === c ? null : c,
p = r.supportedPaymentDetailsTypes,
m = void 0 === p ? kt : p,
f = r.requestSurface,
h = r.onBehalfOf,
_ = r.transactionContext,
v = (y = null != d ? d : {}).amount,
g = y.currency,
k = null !== (t = null == i ? void 0 : i.value) && void 0 !== t ? t : new bu(null),
C = null !== (n = null == i ? void 0 : i.lifetime) && void 0 !== n ? n : null,
!k.isEmpty() || l) {
e.next = 6;
break
}
return e.abrupt("return", {});
case 6:
return E = k.DANGEROUS_getValue(),
l && this.logger.log(hu.AttemptLogInUsingEmailStart, {}),
e.next = 10,
this.cachedLookup((0,
b.Z)((0,
b.Z)((0,
b.Z)({
session_id: s,
request_surface: this.getRequestSurface(f),
amount: v,
currency: g
}, l ? {
email_address: l
} : null), E ? {
cookies: {
verification_session_client_secrets: [E],
lifetime: C
}
} : null), {}, {
on_behalf_of: h,
transaction_context: _,
supported_payment_details_types: m
}));
case 10:
if (Z = e.sent,
A = Z.error,
M = Z.object,
!A) {
e.next = 16;
break
}
return this.logger.log(hu.AttemptLogInUsingStoredCredentialsError, {
error_type: A.type,
error_message: A.message
}),
e.abrupt("return", {});
case 16:
if (M.exists) {
e.next = 18;
break
}
return e.abrupt("return", {});
case 18:
if (M.consumer_session) {
e.next = 20;
break
}
return e.abrupt("return", {});
case 20:
if (M.publishable_key) {
e.next = 22;
break
}
return e.abrupt("return", {});
case 22:
return this.sharedSessionManager.actions.activateSession(M.consumer_session.email_address),
this.logger.log(hu.AttemptLogInUsingStoredCredentialsSuccess),
(P = Dl(M)).redacted_payment_details = P.redacted_payment_details.filter((function(e) {
var t = e.type;
return m.indexOf(t) >= 0
}
)),
e.abrupt("return", {
consumerInfo: P,
credentialLifetime: C
});
case 27:
case "end":
return e.stop()
}
}
), e, this)
}
))),
function() {
return _.apply(this, arguments)
}
)
}, {
key: "persistLoginForSession",
value: (f = (0,
k.Z)((0,
S.Z)().mark((function e() {
var t;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return e.next = 2,
this.sharedSessionManager.getAuthSessionClientSecret();
case 2:
(t = e.sent).value.isEmpty() || this.sharedSessionManager.actions.setAuthSessionClientSecret({
secret: t.value.DANGEROUS_getValue(),
options: {
onlySessionStorage: !0
}
});
case 4:
case "end":
return e.stop()
}
}
), e, this)
}
))),
function() {
return f.apply(this, arguments)
}
)
}, {
key: "hasAuthSessionClientSecret",
value: (m = (0,
k.Z)((0,
S.Z)().mark((function e() {
var t, n;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return e.next = 2,
this.sharedSessionManager.getAllAuthSessionClientSecrets();
case 2:
t = e.sent,
n = 0;
case 4:
if (!(n < t.length)) {
e.next = 13;
break
}
return e.next = 7,
t[n];
case 7:
if (null === e.sent) {
e.next = 10;
break
}
return e.abrupt("return", !0);
case 10:
n++,
e.next = 4;
break;
case 13:
return e.abrupt("return", !1);
case 14:
case "end":
return e.stop()
}
}
), e, this)
}
))),
function() {
return m.apply(this, arguments)
}
)
}, {
key: "attemptLogInUsingStoredCredentials",
value: (p = (0,
k.Z)((0,
S.Z)().mark((function e() {
var t, n, r, a, i, o, s, u, l, c, d, p, m, f, h, _, y, v, g, k = arguments;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return t = k.length > 0 && void 0 !== k[0] ? k[0] : {},
n = t.sessionId,
r = void 0 === n ? null : n,
a = t.emailAddress,
i = void 0 === a ? null : a,
o = t.paymentAmount,
s = void 0 === o ? null : o,
u = t.transactionContext,
l = void 0 === u ? null : u,
c = t.supportedPaymentDetailsTypes,
d = void 0 === c ? kt : c,
p = t.requestSurface,
m = t.onBehalfOf,
e.prev = 1,
r && this.logger.updateParams({
session_id: r
}),
this.logger.log(hu.AttemptLogInUsingStoredCredentialsStart),
e.next = 6,
this.sharedSessionManager.getAllAuthSessionClientSecrets();
case 6:
f = e.sent,
h = {
sessionId: r,
emailAddress: i,
paymentAmount: s,
supportedPaymentDetailsTypes: d,
requestSurface: p,
onBehalfOf: m,
transactionContext: l
},
_ = 0;
case 9:
if (!(_ < f.length)) {
e.next = 24;
break
}
return e.next = 12,
f[_];
case 12:
if (null === (y = e.sent)) {
e.next = 21;
break
}
return this.logger.log(hu.AttemptLogInUsingCredentialStart, {
number_of_credentials: f.length
}),
e.next = 17,
this.attemptLogInUsingEmailOrCredential((0,
b.Z)((0,
b.Z)({}, h), {}, {
credential: y
}));
case 17:
if (!(v = e.sent).consumerInfo) {
e.next = 21;
break
}
return y.value.isEmpty() || this.sharedSessionManager.actions.setAuthSessionClientSecret({
secret: y.value.DANGEROUS_getValue(),
options: {
ignoreSessionStorage: "persistent" === y.lifetime
}
}),
e.abrupt("return", (0,
b.Z)((0,
b.Z)({}, v), {}, {
consumerInfo: (0,
b.Z)((0,
b.Z)({}, v.consumerInfo), {}, {
consumer_session: (0,
b.Z)((0,
b.Z)({}, v.consumerInfo.consumer_session), {}, {
verification_sessions: v.consumerInfo.consumer_session.verification_sessions.filter((function(e) {
return "VERIFIED" === e.state
}
))
})
})
}));
case 21:
_++,
e.next = 9;
break;
case 24:
return e.next = 26,
ql.all(f).then((function(e) {
return e.filter((function(e) {
return null !== e
}
))
}
));
case 26:
if (0 !== (g = e.sent).length) {
e.next = 30;
break
}
return this.logger.log(hu.AttemptLogInUsingEmailWhenNoCredentialStart),
e.abrupt("return", this.attemptLogInUsingEmailOrCredential((0,
b.Z)({}, h)));
case 30:
if (!(g.length > 0) || i) {
e.next = 33;
break
}
return e.next = 33,
this.sharedSessionManager.actions.clearCredentials();
case 33:
return e.abrupt("return", {});
case 36:
return e.prev = 36,
e.t0 = e.catch(1),
this.logger.log(hu.InternalError, {
method: "attemptLogInUsingStoredCredentials",
message: e.t0 instanceof Error ? e.t0.message : "Unknown error"
}),
e.abrupt("return", {});
case 40:
case "end":
return e.stop()
}
}
), e, this, [[1, 36]])
}
))),
function() {
return p.apply(this, arguments)
}
)
}, {
key: "lookupConsumerSession",
value: (d = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
var n, r;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return this.logger.log(hu.AttemptLogInFromLookupConsumerSession, {
has_email: Boolean(t.email_address)
}),
e.next = 3,
this.cachedLookup((0,
b.Z)((0,
b.Z)({
session_id: t.session_id,
request_surface: this.getRequestSurface(t.request_surface),
payment_intent: t.payment_intent,
amount: t.amount,
currency: t.currency
}, t.email_address ? {
email_address: t.email_address
} : null), {}, {
on_behalf_of: t.on_behalf_of,
transaction_context: t.transaction_context,
supported_payment_details_types: t.supported_payment_details_types
}));
case 3:
if ("error" !== (n = e.sent).type) {
e.next = 6;
break
}
return e.abrupt("return", n);
case 6:
if ((r = n.object).exists) {
e.next = 9;
break
}
return e.abrupt("return", (0,
b.Z)((0,
b.Z)({}, n), {}, {
object: r
}));
case 9:
return e.abrupt("return", (0,
b.Z)((0,
b.Z)({}, n), {}, {
object: Dl(r)
}));
case 10:
case "end":
return e.stop()
}
}
), e, this)
}
))),
function(e) {
return d.apply(this, arguments)
}
)
}, {
key: "DANGEROUS_lookupConsumerSessionUncachedUnlogged",
value: (c = (0,
k.Z)((0,
S.Z)().mark((function e() {
var t, n, r, a, i, o, s, u, l, c, d, p, m, f, h, _, y, v = arguments;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return t = v.length > 0 && void 0 !== v[0] ? v[0] : {},
n = t.sessionId,
r = void 0 === n ? null : n,
a = t.paymentAmount,
i = void 0 === a ? null : a,
o = t.requestSurface,
s = t.emailAddress,
l = (u = null != i ? i : {}).amount,
c = u.currency,
e.next = 4,
this.sharedSessionManager.getAllAuthSessionClientSecrets();
case 4:
d = e.sent,
p = 0;
case 6:
if (!(p < d.length)) {
e.next = 21;
break
}
return e.next = 9,
d[p];
case 9:
if (!(m = e.sent)) {
e.next = 18;
break
}
if (f = m.value.DANGEROUS_getValue(),
h = m.lifetime,
null == f) {
e.next = 18;
break
}
return e.next = 16,
this.DANGEROUS_uncachedUnloggedLookup({
session_id: r,
currency: c,
amount: l,
request_surface: o,
email_address: s,
cookies: {
verification_session_client_secrets: [f],
lifetime: h
}
});
case 16:
return _ = e.sent,
e.abrupt("return", {
response: _,
lookupBy: "cookie"
});
case 18:
p++,
e.next = 6;
break;
case 21:
if (!s) {
e.next = 26;
break
}
return e.next = 24,
this.DANGEROUS_uncachedUnloggedLookup({
session_id: r,
currency: c,
amount: l,
request_surface: o,
email_address: s
});
case 24:
return y = e.sent,
e.abrupt("return", {
response: y,
lookupBy: "email"
});
case 26:
return e.abrupt("return", void 0);
case 27:
case "end":
return e.stop()
}
}
), e, this)
}
))),
function() {
return c.apply(this, arguments)
}
)
}, {
key: "prewarmLookupWithStoredCredentials",
value: (l = (0,
k.Z)((0,
S.Z)().mark((function e() {
var t, n, r, a, i, o, s, u, l, c, d, p, m, f, h, _, y, v, g, b, k = arguments;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return t = k.length > 0 && void 0 !== k[0] ? k[0] : {},
n = t.sessionId,
r = void 0 === n ? null : n,
a = t.paymentAmount,
i = void 0 === a ? null : a,
o = t.transactionContext,
s = void 0 === o ? null : o,
u = t.supportedPaymentDetailsTypes,
l = void 0 === u ? kt : u,
c = t.requestSurface,
e.next = 3,
this.sharedSessionManager.getAllAuthSessionClientSecrets();
case 3:
d = e.sent,
m = (p = null != i ? i : {}).amount,
f = p.currency,
h = 0;
case 6:
if (!(h < d.length)) {
e.next = 23;
break
}
return e.next = 9,
d[h];
case 9:
if (!(_ = e.sent)) {
e.next = 20;
break
}
if (y = _.value.DANGEROUS_getValue(),
v = _.lifetime,
null == y) {
e.next = 20;
break
}
return e.next = 16,
this.cachedLookup({
session_id: r,
request_surface: this.getRequestSurface(c),
amount: m,
currency: f,
cookies: {
verification_session_client_secrets: [y],
lifetime: v
},
transaction_context: s,
supported_payment_details_types: l
});
case 16:
if (g = e.sent,
null == (b = g.object) || !b.exists) {
e.next = 20;
break
}
return e.abrupt("return", {
found: !0
});
case 20:
h++,
e.next = 6;
break;
case 23:
return e.abrupt("return", {
found: !1
});
case 24:
case "end":
return e.stop()
}
}
), e, this)
}
))),
function() {
return l.apply(this, arguments)
}
)
}, {
key: "prewarmLookupWithEmail",
value: (u = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return this.logger.log(hu.AttemptLogInUsingEmailPrewarmStart),
e.next = 3,
this.cachedLookup((0,
b.Z)({
session_id: t.session_id,
request_surface: this.getRequestSurface(t.request_surface),
payment_intent: t.payment_intent,
amount: t.amount,
currency: t.currency
}, t.email_address ? {
email_address: t.email_address
} : null));
case 3:
case "end":
return e.stop()
}
}
), e, this)
}
))),
function(e) {
return u.apply(this, arguments)
}
)
}, {
key: "startVerification",
value: (s = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
var n, r, a, i, o, s, u, l = this;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return this.sessionId = null !== (n = t.session_id) && void 0 !== n ? n : this.sessionId,
r = t.locale,
a = t.type,
i = t.account_phone_number,
e.next = 4,
this.retryOnConsumerSessionExpiry((0,
k.Z)((0,
S.Z)().mark((function e() {
var n, o;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return e.next = 2,
l.sharedSessionManager.credentialsOrReject(t.email_address);
case 2:
return n = e.sent,
o = n.consumerSessionClientSecret,
e.abrupt("return", l.request({
path: "consumers/sessions/start_verification",
method: "POST",
data: {
key: l.publishableKey,
_stripe_account: l.stripeAccount,
locale: r,
type: a,
session_id: l.sessionId,
account_phone_number: i,
credentials: {
consumer_session_client_secret: o
},
request_surface: l.getRequestSurface(t.request_surface)
}
}));
case 5:
case "end":
return e.stop()
}
}
), e)
}
))), {
requestSurface: t.request_surface,
email: t.email_address
});
case 4:
if ("error" !== (o = e.sent).type) {
e.next = 7;
break
}
return e.abrupt("return", o);
case 7:
if (s = Dl(o.object),
t.type !== vt.sf.WEBAUTHN) {
e.next = 12;
break
}
if (!(u = Qs(s))) {
e.next = 12;
break
}
return e.abrupt("return", {
type: "error",
error: u
});
case 12:
return e.abrupt("return", (0,
b.Z)((0,
b.Z)({}, o), {}, {
object: s
}));
case 13:
case "end":
return e.stop()
}
}
), e, this)
}
))),
function(e) {
return s.apply(this, arguments)
}
)
}, {
key: "confirmVerification",
value: (o = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
var n, r, a, i, o, s, u = this;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return this.sessionId = null !== (n = t.session_id) && void 0 !== n ? n : this.sessionId,
r = t.type,
a = t.code,
i = t.webauthn_credential_data,
e.next = 4,
this.retryOnConsumerSessionExpiry((0,
k.Z)((0,
S.Z)().mark((function e() {
var n, o;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return e.next = 2,
u.sharedSessionManager.credentialsOrReject(t.email_address);
case 2:
return n = e.sent,
o = n.consumerSessionClientSecret,
e.abrupt("return", u.request({
path: "consumers/sessions/confirm_verification",
method: "POST",
data: {
key: u.publishableKey,
_stripe_account: u.stripeAccount,
type: r,
code: a,
session_id: u.sessionId,
credentials: {
consumer_session_client_secret: o
},
request_surface: u.getRequestSurface(t.request_surface),
webauthn_credential_data: i
}
}));
case 5:
case "end":
return e.stop()
}
}
), e)
}
))), {
requestSurface: t.request_surface,
email: t.email_address
});
case 4:
if ("error" !== (o = e.sent).type) {
e.next = 7;
break
}
return e.abrupt("return", o);
case 7:
return (s = o.object.auth_session_client_secret) && this.sharedSessionManager.actions.setAuthSessionClientSecret({
secret: s
}),
this.sharedSessionManager.actions.activateSession(t.email_address),
this.sharedSessionManager.actions.updateEmail(o.object.consumer_session.email_address),
this.clearLookupCache(),
this.clearListPaymentPlansCache(),
e.abrupt("return", (0,
b.Z)((0,
b.Z)({}, o), {}, {
object: Dl(o.object)
}));
case 14:
case "end":
return e.stop()
}
}
), e, this)
}
))),
function(e) {
return o.apply(this, arguments)
}
)
}, {
key: "logOut",
value: (i = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
var n, r, a, i, o = this;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return this.sessionId = null !== (n = null == t ? void 0 : t.session_id) && void 0 !== n ? n : this.sessionId,
this.clearLookupCache(),
this.clearListPaymentPlansCache(),
r = this.sharedSessionManager.actions.clearAuthSessionClientSecret(),
e.prev = 4,
e.prev = 5,
this.logger.log(hu.LogOutStart),
e.next = 9,
this.retryOnConsumerSessionExpiry((0,
k.Z)((0,
S.Z)().mark((function e() {
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return e.t0 = o,
e.t1 = o.publishableKey,
e.t2 = o.stripeAccount,
e.next = 5,
o.credentialsOrReject();
case 5:
return e.t3 = e.sent,
e.t4 = o.getRequestSurface(null == t ? void 0 : t.request_surface),
e.t5 = o.sessionId,
e.t6 = {
key: e.t1,
_stripe_account: e.t2,
credentials: e.t3,
request_surface: e.t4,
session_id: e.t5
},
e.t7 = {
path: "consumers/sessions/log_out",
method: "POST",
data: e.t6
},
e.abrupt("return", e.t0.request.call(e.t0, e.t7));
case 11:
case "end":
return e.stop()
}
}
), e)
}
))), {
requestSurface: null == t ? void 0 : t.request_surface
});
case 9:
a = e.sent,
i = a.requestId,
"error" === a.type ? this.logger.log(hu.LogOutError, {
error: a.error.message,
request_id: i
}) : this.logger.log(hu.LogOutSuccess, {
request_id: i
});
case 12:
return e.prev = 12,
this.sharedSessionManager.actions.clearConsumerSessionClientSecret(),
e.next = 16,
r;
case 16:
return e.finish(12);
case 17:
e.next = 22;
break;
case 19:
e.prev = 19,
e.t0 = e.catch(4),
this.logger.log(hu.InternalError, {
method: "logOut",
error: e.t0.message
});
case 22:
case "end":
return e.stop()
}
}
), e, this, [[4, 19], [5, , 12, 17]])
}
))),
function(e) {
return i.apply(this, arguments)
}
)
}, {
key: "extendSession",
value: (a = (0,
k.Z)((0,
S.Z)().mark((function e() {
var t, n, r, a, i, o, s, u, l, c, d, p = arguments;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return t = p.length > 0 && void 0 !== p[0] ? p[0] : {},
n = t.requestSurface,
r = t.email,
e.next = 3,
this.sharedSessionManager.getAuthSessionClientSecret();
case 3:
return a = e.sent,
i = a.value,
o = a.lifetime,
e.next = 8,
this.sharedSessionManager.credentialsOrReject(r);
case 8:
return s = e.sent,
u = s.consumerSessionClientSecret,
l = s.emailAddress,
c = {
consumer_session_client_secret: u
},
e.next = 14,
this.request({
path: "consumers/sessions/extend",
method: "POST",
data: (0,
b.Z)({
key: this.publishableKey,
_stripe_account: this.stripeAccount,
credentials: c,
request_surface: this.getRequestSurface(n)
}, this.formattedCookies(i, o))
});
case 14:
if (!(d = e.sent).error) {
e.next = 17;
break
}
return e.abrupt("return", d);
case 17:
return this.sharedSessionManager.actions.updateConsumerSessionClientSecret({
secret: d.object.consumer_session_client_secret,
email: l
}),
this.clearLookupCache(),
this.clearListPaymentPlansCache(),
e.abrupt("return", (0,
b.Z)((0,
b.Z)({}, d), {}, {
object: {}
}));
case 21:
case "end":
return e.stop()
}
}
), e, this)
}
))),
function() {
return a.apply(this, arguments)
}
)
}, {
key: "retryOnConsumerSessionExpiry",
value: (r = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return e.next = 2,
t();
case 2:
if (a = e.sent,
"consumer_session_credentials_invalid" === (null === (r = a.error) || void 0 === r ? void 0 : r.code)) {
e.next = 6;
break
}
return e.abrupt("return", a);
case 6:
return e.next = 8,
this.extendSession(n);
case 8:
return i = e.sent,
o = i.error,
e.abrupt("return", o ? a : t());
case 11:
case "end":
return e.stop()
}
}
), e, this)
}
))),
function(e, t) {
return r.apply(this, arguments)
}
)
}, {
key: "temporaryAndDangerous_setCredentials",
value: function(e) {
e.authSessionClientSecret && this.sharedSessionManager.actions.setAuthSessionClientSecret({
secret: e.authSessionClientSecret
}),
e.consumerSessionClientSecret && this.sharedSessionManager.actions.storeCredentials({
consumerInfo: {
consumer_session: {
client_secret: e.consumerSessionClientSecret,
email_address: e.emailAddress
},
publishable_key: e.consumerPublishableKey
},
activate: !0
})
}
}, {
key: "temporaryAndDangerous_clearCredentials",
value: (n = (0,
k.Z)((0,
S.Z)().mark((function e() {
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return e.next = 2,
this.sharedSessionManager.actions.clearCredentials();
case 2:
case "end":
return e.stop()
}
}
), e, this)
}
))),
function() {
return n.apply(this, arguments)
}
)
}, {
key: "createAccount",
value: (t = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
var n, r, a, i;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return this.sessionId = null !== (n = t.session_id) && void 0 !== n ? n : this.sessionId,
e.next = 3,
this.request({
path: "consumers/accounts/sign_up",
method: "POST",
data: (0,
b.Z)((0,
b.Z)({}, t), {}, {
key: this.publishableKey,
_stripe_account: this.stripeAccount,
stripe_js_id: this.sessionId,
request_surface: this.getRequestSurface(t.request_surface)
})
});
case 3:
if ("error" !== (r = e.sent).type) {
e.next = 6;
break
}
return e.abrupt("return", r);
case 6:
return (a = this.linkApiClientSurfaceToLinkFunnelSurface(this.getRequestSurface(t.request_surface))) && cl.linkApiClientEvent(nl.LinkAccountCreationSuccessful, a, {
consumerAccountId: r.object.account_id
}),
(i = r.object.auth_session_client_secret) && this.sharedSessionManager.actions.setAuthSessionClientSecret({
secret: i
}),
this.sharedSessionManager.actions.storeCredentials({
consumerInfo: r.object,
activate: !0
}),
this.clearLookupCache(),
this.clearListPaymentPlansCache(),
e.abrupt("return", (0,
b.Z)((0,
b.Z)({}, r), {}, {
object: Dl(r.object)
}));
case 14:
case "end":
return e.stop()
}
}
), e, this)
}
))),
function(e) {
return t.apply(this, arguments)
}
)
}, {
key: "createLinkPaymentMethod",
value: function(e) {
var t = e.paymentDetailsId
, n = e.backupPaymentDetailsIds
, r = e.billingDetails
, a = e.paymentUserAgent
, i = e.stripeVersion
, o = {
link: (0,
b.Z)({
payment_details_id: t
}, n ? {
backup_payment_details_ids: n
} : {}),
billing_details: r
}
, s = Bs.transformData("link", o)
, u = s.type
, l = s.data
, c = (0,
b.Z)((0,
b.Z)({
type: u
}, l), {}, {
key: this.publishableKey,
payment_user_agent: a
});
return this.stripeAccount && (c._stripe_account = this.stripeAccount),
i && (c._stripe_version = i),
this.paymentMethod.create(c)
}
}, {
key: "elementToLinkRequestSurface",
value: function(e) {
switch (e) {
case V.Yj.payment:
return vt.jL.PaymentElement;
case V.Yj.linkAuthentication:
return vt.jL.LinkAuthenticationElement;
case V.Yj.card:
return vt.jL.CardElementPopup;
case V.Yj.expressCheckout:
return vt.jL.ExpressCheckoutElementPopup;
case V.Yj.paymentRequestButton:
return vt.jL.LegacyElementsPopup;
case V.Yj.cardNumber:
case V.Yj.cardCvc:
case V.Yj.cardExpiry:
case V.Yj.postalCode:
return vt.jL.SplitCardElementPopup;
default:
return
}
}
}], [{
key: "init",
value: function(t, n, r, a) {
return e.instance = new e(t,n,r,a),
e.instance
}
}, {
key: "initChild",
value: function(t, n, r) {
var a;
return e.instance = new e(t,n.publishableKey,null !== (a = n.stripeAccount) && void 0 !== a ? a : null,(0,
b.Z)((0,
b.Z)({}, r), {}, {
sharedSessionRouting: n.routing
})),
e.instance
}
}, {
key: "sharedInstance",
value: function() {
if (!e.instance)
throw Error("LinkApiClient has not been initialized.");
return e.instance
}
}, {
key: "prewarmCheckoutCookies",
value: function() {
var e = (0,
Fs.ix)(window.location.origin);
e && (0,
Fs.bI)(e)
}
}]),
e
}(), Yl = new Set(["link.consumer_account.sign_up.success", "link.consumer_account.sign_up.error", "link.payment_details.create.success", "link.payment_details.create.error"]), Wl = (0,
b.Z)((0,
b.Z)({}, Se.kg), {}, {
log: function(e) {
var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
Se.kg.log(e, (0,
b.Z)({
frame_width: window.innerWidth
}, t), Yl.has(e) ? {
priority: "high"
} : void 0)
}
}), Jl = Wl, Xl = function(e) {
return Cc(e, "elements_disable_payment_element_card_country_zip_validations") && (0,
N.uN)(e.config.betas, N.M4.payment_element_disable_card_country_zip_validations_beta_1)
}, Ql = function() {
return Promise.all([n.e(203), n.e(1944)]).then(n.bind(n, 30260))
}, $l = function(e) {
return function(t) {
var n = t.paymentElement.options.fields;
if (!n)
return "auto";
var r = wo(n, e);
return "if_required" === r && Ua(t, "disable_payment_element_if_required_billing_config") ? "auto" : r
}
}, ec = n(56274).Promise, tc = function(e) {
var t = e.number
, n = e.exp_month
, r = e.exp_year
, a = e.cvc
, i = e.networks
, o = parseInt(r, 10)
, s = 4 === r.length ? o : o + 2e3;
return {
number: t,
exp_month: parseInt(n, 10),
exp_year: s,
cvc: a,
preferred_network: null == i ? void 0 : i.preferred
}
}, nc = function(e) {
var t = e.address
, n = void 0 === t ? {} : t
, r = e.name;
return (0,
b.Z)((0,
b.Z)((0,
b.Z)((0,
b.Z)((0,
b.Z)((0,
b.Z)((0,
b.Z)({}, r ? {
name: r
} : {}), n.line1 ? {
line_1: n.line1
} : null), n.line2 ? {
line_2: n.line2
} : null), n.city ? {
locality: n.city
} : null), n.state ? {
administrative_area: n.state
} : null), n.postal_code ? {
postal_code: n.postal_code
} : null), n.country ? {
country_code: n.country
} : null)
}, rc = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
var n, r, a, i, o, s, u, l, c, d, p, m, f, h, _;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
if (n = t.apiKey,
r = t.stripeAccount,
a = t.clientSecret,
i = t.cardDetails,
o = t.requestSurface,
s = t.billingDetails,
u = t.consumerAddress,
l = t.email,
c = t.active,
d = t.isDefault,
p = t.useLinkApiClient,
m = t.nickname,
f = t.onBehalfOf,
void 0 === i.token) {
e.next = 3;
break
}
throw new Error("Unsupported for Card details with token.");
case 3:
if (!u) {
e.next = 7;
break
}
h = u,
e.next = 12;
break;
case 7:
if (!s) {
e.next = 11;
break
}
h = nc(s),
e.next = 12;
break;
case 11:
throw new Error("Did not receive consumerAddress or billingDetails");
case 12:
if (_ = (0,
b.Z)({
card: tc(i),
billing_address: h,
billing_email_address: l.trim().toLowerCase(),
is_default: d,
active: c,
request_surface: o,
nickname: m
}, f ? {
on_behalf_of: f
} : {}),
!p) {
e.next = 15;
break
}
return e.abrupt("return", Hl.sharedInstance().paymentDetails.create((0,
b.Z)((0,
b.Z)({}, _), {}, {
type: "card"
})));
case 15:
if (a) {
e.next = 17;
break
}
throw new Error("Must pass in clientSecret when not using LinkApiClient.");
case 17:
return e.abrupt("return", (y = (0,
b.Z)({
key: n,
_stripe_account: null != r ? r : void 0,
credentials: {
consumer_session_client_secret: a
},
type: "card"
}, _),
(0,
Zs.Nv)("consumers/payment_details", "POST", (0,
b.Z)((0,
b.Z)({}, y), {}, {
credentials: (0,
b.Z)((0,
b.Z)({}, y.credentials), {}, {
consumer_session_client_secret: y.credentials.consumer_session_client_secret
})
}), {
includeErrorStatus: !0,
includeRequestId: !0,
headers: {
"Accept-Language": "en"
}
})));
case 18:
case "end":
return e.stop()
}
var y
}
), e)
}
)));
return function(t) {
return e.apply(this, arguments)
}
}(), ac = function(e, t) {
return e || vd(t)
}, ic = function(e, t) {
return e || gd(t)
}, oc = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
var n, r, a, i, o, s, u, l, c, d, p, m, f, h, _, y, v, g, k, C, E, Z, A, M, P;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
if (r = t.cvc,
a = t.mids,
i = t.paymentUserAgent,
o = t.selectedPaymentMethodType,
s = t.state,
u = t.metadata,
l = t.allow_redisplay,
c = t.isECE,
d = t.userPaymentMethodData,
p = Qc(s, {
isECE: c
}),
m = null == p ? void 0 : p.id,
f = null == p ? void 0 : p.type,
h = Zt(f || null, null === (n = Ha(s)) || void 0 === n ? void 0 : n.linkMode),
_ = wa(s),
y = null,
v = null,
c && (y = ac(null == d || null === (g = d.billing_details) || void 0 === g ? void 0 : g.phone, s),
v = ic(null == d || null === (k = d.billing_details) || void 0 === k ? void 0 : k.email, s)),
m) {
e.next = 11;
break
}
return e.abrupt("return", ec.reject(new Error("No payment details id found during sharePaymentDetails")));
case 11:
return C = {},
"card" === o && r ? C = {
card: {
cvc: r
}
} : "us_bank_account" === o && (Z = null === (E = xa(s)) || void 0 === E ? void 0 : E.parsedClientSecret,
C = {
us_bank_account: {
financial_connections: {
permissions: ["payment_method"]
},
intent_client_secret: null == Z ? void 0 : Z.clientSecret,
payment_intent: "PAYMENT_INTENT" === (null == Z ? void 0 : Z.type) ? Z.id : null,
setup_intent: "SETUP_INTENT" === (null == Z ? void 0 : Z.type) ? Z.id : null
}
}),
A = (0,
b.Z)((0,
b.Z)((0,
b.Z)((0,
b.Z)((0,
b.Z)((0,
b.Z)((0,
b.Z)((0,
b.Z)({
id: m,
request_surface: _
}, a), null === i ? null : {
payment_user_agent: i
}), {}, {
payment_method_options: C
}, h ? {
expected_payment_method_type: h
} : null), u && {
metadata: u
}), l && {
allow_redisplay: l
}), {
expand: ["payment_method"]
}), y && {
billing_phone: y
}), v && {
billing_email: v
}),
e.next = 16,
Hl.sharedInstance().paymentDetails.share(A);
case 16:
if ("error" !== (M = e.sent).type) {
e.next = 23;
break
}
if (P = M.error,
Jl.log("link.payment_details.share.error", {
error: P,
selected_payment_method_type: o
}),
"consumer_session_expired" !== P.code) {
e.next = 22;
break
}
throw new zs;
case 22:
throw new Vs;
case 23:
return Jl.log("link.payment_details.share.success", {
selected_payment_method_type: o
}),
e.abrupt("return", {
payment_method: M.object.payment_method
});
case 25:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t) {
return e.apply(this, arguments)
}
}(), sc = Object.keys({
cvc: !0,
expiry: !0,
postalCode: !0,
linkLegalName: !0
}), uc = function(e) {
return (0,
O.D9)(e, (function(e, t) {
return "string" == typeof t
}
))
}, lc = function(e, t, n) {
var r = e.exp_month
, a = e.exp_year;
return !t && !n || t === r && n === a
}, cc = function(e, t) {
var n = e.brand;
return (t && function(e) {
switch (e) {
case "visa":
return "VISA";
case "mastercard":
return "MASTERCARD";
case "amex":
return "AMERICAN_EXPRESS";
case "jcb":
return "JCB";
case "diners":
return "DINERS_CLUB";
case "discover":
return "DISCOVER";
case "unionpay":
return "UNIONPAY";
case "elo":
return "ELO";
case "cartes_bancaires":
return "CARTES_BANCAIRES";
default:
return "BRAND_INVALID"
}
}(t)) === n
}, dc = function(e, t) {
return !t || !e.billing_address || (n = t,
r = e.billing_address,
(0,
O.Xy)(uc(n), uc(r)));
var n, r
}, pc = function(e) {
var t = e.linkOptIn
, n = e.linkOptInTouched
, r = e.linkOptInIsVisibleFromFormChange
, a = e.autofillPromptOpen
, i = e.phoneNonEmpty
, o = e.linkDefaultOptInBehavior
, s = e.isSpmLinkSignUp
, u = !!n && !!n.linkOptIn
, l = !(!n || !n.linkMobilePhone && !n.linkMobilePhoneCountry)
, c = !!n && !!n.linkEmail;
if (!t && !a && !r)
return null;
if (!i)
return null;
if (a)
return l ? vt.pM.ClickedPromptEnteredPhoneNumber : vt.pM.ClickedPromptPrefilledPhoneNumber;
if (u)
return l ? vt.pM.CheckedOptInBoxEnteredPhoneNumber : vt.pM.CheckedOptInBoxPrefilledPhoneNumber;
if (s)
return l ? vt.pM.ImpliedConsentWithSpm : vt.pM.ImpliedConsentWithSpmPrefilledPhoneNumber;
var d = c && l
, p = c ? !l : l;
return "blocking" === o ? d ? vt.pM.PrecheckedOptinBoxPrefilledNone : p ? vt.pM.PrecheckedOptinBoxPrefilledSome : vt.pM.PrecheckedOptinBoxPrefilledAll : "non-blocking-optional" === o ? d ? vt.pM.NoCheckboxPrefilledNone : p ? vt.pM.NoCheckboxPrefilledSome : vt.pM.NoCheckboxPrefilledAll : r ? l ? vt.pM.EnteredPhoneNumber : vt.pM.AutofilledPhoneNumber : null
}, mc = function(e, t) {
return e && t ? Ql().then((function(n) {
return (0,
n.formatE164)(e, t)
}
)) : ec.resolve(null)
}, fc = function(e, t) {
var n = (null == t ? void 0 : t.linkSupportedPaymentMethods) || []
, r = e.indexOf("link");
if (-1 === r && "LINK_CARD_BRAND" !== (null == t ? void 0 : t.linkMode))
return e;
var a = e.filter((function(e) {
return "link" !== e
}
));
return n.forEach((function(e) {
switch (e) {
case "CARD":
a = function(e) {
var t = e.paymentForms
, n = e.indexOfLink;
return -1 === t.indexOf("card") ? [].concat((0,
Z.Z)(t.slice(0, n)), ["card"], (0,
Z.Z)(t.slice(n))) : t
}({
paymentForms: a,
indexOfLink: r
});
break;
case "INSTANT_DEBITS":
a = function(e) {
var t, n = e.paymentForms, r = e.linkSettings;
return n.indexOf("us_bank_account") > -1 || null == r || !r.bankOnboardingEnabled ? n : (t = "LINK_CARD_BRAND" === (null == r ? void 0 : r.linkMode) ? "link_card_brand" : "link",
[].concat((0,
Z.Z)(n.slice(0, 2)), [t], (0,
Z.Z)(n.slice(2))))
}({
paymentForms: a,
linkSettings: t
})
}
}
)),
a
}, hc = function(e) {
var t, n = e.isDeferredIntent, r = e.intentType, a = e.paymentDetailsId, i = e.requestSurface, o = e.intentId, s = e.elementsSessionId;
if (n)
t = {
type: "bank_account",
bank_account: {
payment_details: a
},
request_surface: i,
elements_session_id: s
};
else {
if (!o)
throw new Error("Intent id not populated in non-deferred intent");
if ("PAYMENT_INTENT" === r)
t = {
type: "bank_account",
bank_account: {
payment_details: a
},
request_surface: i,
payment_intent: o
};
else {
if ("SETUP_INTENT" !== r)
throw new Error("Unexpected intent id or client secret shape");
t = {
type: "bank_account",
bank_account: {
payment_details: a
},
request_surface: i,
setup_intent: o
}
}
}
return t
}, _c = function(e) {
return "apple_pay_inner" === e || "apple_pay_outer" === e || "applePayOuter" === e || "applePayInner" === e
}, yc = function(e) {
return "cpmt" === e.split("_", 1)[0]
}, vc = function(e) {
var t = e.orderedPaymentMethodTypesAndWallets
, n = e.unverifiedPaymentMethodsOnDomain
, r = e.customPaymentMethodOrder
, a = e.shouldListApplePay
, i = e.shouldListGooglePay
, o = e.shouldListLink
, s = e.eceVisibleButtons
, u = e.linkSettings
, l = e.heldbackPaymentMethods
, c = t.filter((function(e) {
return -1 !== lo.indexOf(e) || "saved" === e || yc(e)
}
));
c = null != u && u.linkFundingSources && (null == u ? void 0 : u.linkFundingSources.length) > 0 && o ? fc(c, u) : c.filter((function(e) {
return "link" !== e
}
)),
s.forEach((function(e) {
"link" === e || (c = _c(e) ? c.filter((function(e) {
return "apple_pay" !== e
}
)) : c.filter((function(t) {
return (0,
x.i3)(t) !== e
}
)))
}
)),
a && -1 === n.indexOf("apple_pay") || (c = c.filter((function(e) {
return "apple_pay" !== e
}
))),
i && -1 === n.indexOf("google_pay") || (c = c.filter((function(e) {
return "google_pay" !== e
}
))),
-1 !== n.indexOf("paypal") && (c = c.filter((function(e) {
return "paypal" !== e
}
))),
l.forEach((function(e) {
c = c.filter((function(t) {
return t !== e
}
))
}
));
var d = {
saved: -1
}
, p = r || [];
p.forEach((function(e, t) {
"saved" !== e && (d[e] = t + 1)
}
));
var m = function(e) {
return d[e] ? d[e] : c.indexOf(e) + p.length + 1
};
return c.sort((function(e, t) {
return m(e) - m(t)
}
)),
c
}, gc = function(e, t) {
if (!t)
return e;
if ("string" == typeof t)
return (0,
b.Z)((0,
b.Z)({}, e), {}, {
type: t
});
var n = (0,
b.Z)((0,
b.Z)({}, e), t);
return {
type: n.type,
radios: n.radios,
spacedAccordionItems: n.spacedAccordionItems,
visibleAccordionItemsCount: n.visibleAccordionItemsCount
}
}, bc = function(e, t) {
if (null === e && null == t)
return null;
var n = (0,
b.Z)((0,
b.Z)({}, e), t);
return (null != t && t.automaticReloadPaymentRequest || null != t && t.recurringPaymentRequest || null != t && t.deferredPaymentRequest) && (n.automaticReloadPaymentRequest = void 0,
n.deferredPaymentRequest = void 0,
n.recurringPaymentRequest = void 0),
(0,
b.Z)((0,
b.Z)({}, n), t)
}, Sc = function(e) {
return !!e && null !== e.customer
}, kc = function(e) {
return vc(e)[0]
}, Cc = function(e, t) {
return Pa(e).featureFlags[t] || !1
}, Ec = function(e, t) {
var n = e.paymentMethods.filter((function(e) {
return e.id !== t
}
));
if (n.length < 1)
return null;
var r = (0,
O.sE)(n, (function(t) {
return t.id === e.defaultPaymentMethod
}
));
return r || (r = n[0]),
{
mode: "customer_from_session",
id: r.id,
paymentMethod: r
}
}, Zc = function(e) {
var t = Ac(e);
if (t)
return t.paymentMethod
}, Ac = function(e) {
return e.paymentElement.customerSessionSavedPayment.selectedSavedPayment
}, Mc = function(e) {
var t = Zc(e);
return !(!t || "card" !== t.type) && (function(e) {
var t, n, r, a, i;
return !!(null !== (t = e.config.deferredIntent) && void 0 !== t && null !== (n = t.payment_method_options) && void 0 !== n && null !== (r = n.card) && void 0 !== r && r.require_cvc_recollection || null !== (a = e.config.session) && void 0 !== a && null !== (i = a.paymentMethodOptions.card) && void 0 !== i && i.require_cvc_recollection)
}(e) || !!function(e) {
var t, n = e.paymentElement.customerSessionSavedPayment.cvcConfirmationError;
return n && n.paymentMethodId && n.paymentMethodId === (null === (t = Ac(e)) || void 0 === t ? void 0 : t.id) ? n : null
}(e))
}, Pc = function(e) {
var t, n = function(e) {
return e.paymentElement.savePaymentMethodDisplay
}(e), r = n.maxVisiblePaymentMethods;
return (null === (t = si(e)) || void 0 === t ? void 0 : t.slice(0, r).map((function(e) {
return {
mode: "customer_from_session",
id: e.id,
paymentMethod: e
}
}
))) || []
}, xc = function(e) {
var t, n;
return !(null === (t = e.config.session) || void 0 === t || null === (n = t.customer) || void 0 === n || !n.paymentMethods.length || e.authenticationElement.form.authenticated)
}, Ic = function(e) {
var t = function(e, t) {
return "saved" === t || void 0 !== t && Gc(e).some((function(e) {
var n = bo[e];
return n && n.indexOf(t) > -1
}
))
}(e, ya(e));
return Sc(e.config.session) && !pi(e) && t && Ua(e, "elements_enable_link_spm")
}, Nc = function(e) {
var t;
return (null === (t = e.paymentElement.selectedSavedPayment) || void 0 === t ? void 0 : t.id) || null
}, wc = function(e) {
var t, n, r;
return (null == e || null === (t = e.expressCheckoutElement) || void 0 === t || null === (n = t.paymentMethodData) || void 0 === n || null === (r = n.link) || void 0 === r ? void 0 : r.payment_details_id) || null
}, Tc = function(e) {
var t, n, r, a;
return (null == e || null === (t = e.expressCheckoutElement) || void 0 === t || null === (n = t.paymentMethodData) || void 0 === n || null === (r = n.link) || void 0 === r || null === (a = r.card) || void 0 === a ? void 0 : a.cvc) || null
}, Oc = function(e, t) {
return {
view: "authentication",
authIntegration: e,
authStatus: t
}
}, Rc = function(e) {
var t, n, r, a, i, o, s, u = function(e) {
var t, n, r, a, i = va(e);
return i.available ? null !== (t = i.authenticationTypeAvailability.externalLinkAuthentication) && void 0 !== t && t.available ? "externalLinkAuthentication" : null !== (n = i.authenticationTypeAvailability.embedded) && void 0 !== n && n.available ? "embedded" : null !== (r = i.authenticationTypeAvailability.externalAutofillModal) && void 0 !== r && r.available ? "externalAutofillModal" : null !== (a = i.authenticationTypeAvailability.externalFinancialConnectionModal) && void 0 !== a && a.available ? "externalFinancialConnectionModal" : null : null
}(e), l = {
availableAuthenticationType: u,
updatingSavedPayment: "consumer" === (null === (t = e.paymentElement.updatingSavedPayment) || void 0 === t ? void 0 : t.mode),
removingSavedPayment: "consumer" === (null === (n = e.paymentElement.removingSavedPayment) || void 0 === n ? void 0 : n.mode),
isLoggingOut: e.paymentElement.isLoggingOut,
isAddingSavedPayment: e.paymentElement.isAddingSavedPayment,
activeSavedPayment: (null === (r = e.paymentElement.selectedSavedPayment) || void 0 === r ? void 0 : r.active) || !1,
autoFillBehavior: e.consumer.autoFillBehavior,
hasCustomerSavedPayment: !(null === (a = e.config.session) || void 0 === a || null === (i = a.customer) || void 0 === i || !i.paymentMethods.length),
authStatus: e.consumer.authenticationState,
linkPageloadSignUpDisabled: (null === (o = e.config.session) || void 0 === o || null === (s = o.linkSettings) || void 0 === s ? void 0 : s.linkPageloadSignUpDisabled) || !1,
startVerificationState: e.consumer.requests.START_VERIFICATION,
confirmVerificationState: e.consumer.requests.CONFIRM_VERIFICATION
};
return Lc(l.availableAuthenticationType, l.updatingSavedPayment, l.removingSavedPayment, l.isLoggingOut, l.isAddingSavedPayment, l.activeSavedPayment, l.autoFillBehavior, l.authStatus, l.linkPageloadSignUpDisabled, l.startVerificationState, l.confirmVerificationState, l.hasCustomerSavedPayment)
}, Lc = (0,
x.qe)((function(e, t, n, r, a, i, o, s, u, l, c, d) {
var p = e
, m = function(e, t) {
if (e && "NONE" !== e.status) {
var n = e.status
, r = e.verificationType;
switch (n) {
case "PENDING":
return {
type: r,
status: "confirm-pending"
};
case "ERROR":
return {
type: r,
status: "confirm-error"
};
case "SUCCESS":
return {
type: r,
status: "confirm-success"
};
default:
return (0,
P.Rz)(n)
}
}
if (t && "NONE" !== t.status) {
var a = t.status
, i = t.verificationType;
switch (a) {
case "PENDING":
return {
type: i,
status: "start-pending"
};
case "ERROR":
return {
type: i,
status: "start-error"
};
case "SUCCESS":
return {
type: i,
status: "start-success"
};
default:
return (0,
P.Rz)(a)
}
}
return null
}(c, l)
, f = "oneclick" === o && ("embedded" === p && !d || "externalLinkAuthentication" === p);
if (!p)
return {
view: "unavailable",
authStatus: "none",
authIntegration: null
};
switch (s) {
case "unregistered":
case "none":
return u ? {
view: "unavailable",
authStatus: "none",
authIntegration: null
} : Oc(p, s);
case "logged-in":
return r ? {
view: "logout-confirmation",
authIntegration: p,
authStatus: s
} : n ? {
view: "remove-saved-confirmation",
authIntegration: p,
authStatus: s
} : t ? {
view: "update-saved",
authIntegration: p,
authStatus: s
} : a ? {
view: "add-new",
authIntegration: p,
authStatus: s
} : i ? {
view: "use-saved",
authIntegration: p,
authStatus: s
} : {
view: "add-new",
authIntegration: p,
authStatus: s
};
case "verifying":
return f ? {
view: "cookie-authentication",
authIntegration: p,
authStatus: s,
verificationState: m
} : m ? {
view: "verification",
authIntegration: p,
authStatus: s,
verificationState: m
} : Oc(p, "none");
case "declined":
case "unverified":
return f ? {
view: "cookie-authentication",
authIntegration: p,
authStatus: s,
verificationState: m
} : Oc(p, "declined" === s ? "none" : s);
case "verified":
return f ? {
view: "cookie-authentication",
authIntegration: p,
authStatus: s,
verificationState: m
} : Oc(p, "none");
case "blocked":
return {
view: "unavailable",
authStatus: s,
authIntegration: null
};
default:
return (0,
P.Rz)(s)
}
}
)), Dc = function(e) {
var t, n, r;
if (null !== (t = e.config.session) && void 0 !== t && null !== (n = t.featureFlags) && void 0 !== n && n.use_link_views)
return function(e) {
var t, n, r = Rc(e);
if ("logged-in" === r.authStatus)
return {
view: "link-nested",
linkView: r
};
if (null !== (t = e.paymentElement.selectedSavedPayment) && void 0 !== t && t.active && "customer" === (null === (n = e.paymentElement.selectedSavedPayment) || void 0 === n ? void 0 : n.mode) && !e.paymentElement.isAddingSavedPayment)
return {
view: "customer-saved"
};
var a = va(e);
return a.available && Sa(a) ? {
view: "link-nested",
linkView: r
} : {
view: "details-link-disabled"
}
}(e);
if (hd(e))
return {
view: "link-blocked"
};
if (!e.consumer.loaded && !Pa(e).customerInfo || xc(e))
return {
view: "details"
};
var a = !!e.paymentElement.updatingSavedPayment
, i = !!e.paymentElement.removingSavedPayment
, o = e.paymentElement.isLoggingOut
, s = e.paymentElement.isAddingSavedPayment
, u = !(null === (r = e.paymentElement.selectedSavedPayment) || void 0 === r || !r.active)
, l = function(e) {
if (!$a(e) || !Xa(e) || qa(e))
return null;
var t = e.consumer.autoFillBehavior;
return "oneclick" !== t || od(e) ? t : null
}(e);
return o ? {
view: "logout"
} : i ? {
view: "remove"
} : a ? {
view: "update"
} : u && !s ? {
view: "saved"
} : "oneclick" === l ? {
view: "link-return-autofill"
} : {
view: "details-link-authenticated"
}
}, Uc = function(e) {
var t = Dc(e);
if ("link-nested" === t.view) {
var n = t.linkView.view;
return "authentication" === n || "verification" === n || "add-new" === n
}
var r = t.view;
return "details" === r || "details-link-authenticated" === r || "details-link-disabled" === r
}, jc = function(e) {
return !e.config.livemode && null !== e.authenticationElement.form.values.email.match(/\+disable_bank@/)
}, Bc = function(e) {
return !e.config.livemode && null !== e.authenticationElement.form.values.email.match(/\+multiple_funding_sources@/)
}, Fc = function(e) {
var t;
return !(null === (t = e.config.session) || void 0 === t || !t.linkSettings.linkEnableInstantDebitsInTestmode)
}, Gc = function(e) {
var t;
if (!Xa(e))
return [];
var n = Pa(e).linkSettings.linkSupportedPaymentMethods
, r = Fc(e)
, a = null === (t = e.consumer.consumerSession) || void 0 === t ? void 0 : t.support_payment_details_types
, i = n.filter((function(e) {
return !a || "US_BANK_ACCOUNT" === e || -1 !== a.indexOf(vt.uB[e])
}
))
, o = -1 !== i.indexOf("INSTANT_DEBITS");
return r && o && jc(e) ? i = i.filter((function(e) {
return "INSTANT_DEBITS" !== e
}
)) : r || o || !Bc(e) || i.push("INSTANT_DEBITS"),
i
}, qc = function(e) {
return Gc(e).map((function(e) {
return vt.uB[e]
}
))
}, Kc = function(e) {
return (0,
O.G)(e.verification_sessions, (function(e) {
var t = e.type
, n = e.state;
return "SMS" === t && "VERIFIED" === n
}
))
}, Vc = function(e) {
return (0,
O.G)(e.verification_sessions, (function(e) {
var t = e.type
, n = e.state;
return "EMAIL" === t && "VERIFIED" === n
}
))
}, zc = function(e) {
return (0,
O.G)(e.verification_sessions, (function(e) {
var t = e.type
, n = e.state;
return "WEBAUTHN" === t && "VERIFIED" === n
}
))
}, Hc = function(e) {
return e.consumer.foundUsingPartialCookie
}, Yc = function(e, t) {
var n = e.consumer.consumerSession;
if (!n || t && n.email_address !== t.trim().toLowerCase())
return !1;
var r = Ha(e)
, a = (r.emailVerificationLoginEnabled || hi(e)) && Vc(n)
, i = (r.linkPaymentElementEnableWebAuthnLogin || ri(e)) && zc(n);
return Kc(n) || a || i
}, Wc = function(e, t) {
var n = e.consumer.consumerSession;
return !!n && ((!t || n.email_address === t.trim().toLowerCase()) && function(e) {
return (0,
O.G)(e.verification_sessions, (function(e) {
var t = e.type
, n = e.state;
return "SIGNUP" === t && "STARTED" === n
}
))
}(n))
}, Jc = function(e) {
return e.consumer.paymentDetails
}, Xc = function(e) {
return Ct(e.consumer.paymentDetails)
}, Qc = function(e) {
var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}
, n = t.isECE
, r = n ? wc(e) : Nc(e)
, a = (0,
O.sE)(e.consumer.paymentDetails, (function(e) {
return e.id === r
}
))
, i = a || null;
return null === i && n ? {
id: r || "",
type: "CARD",
backup_ids: []
} : i
}, $c = function(e) {
return function(e) {
var t, n;
return -1 === (null !== (t = null === (n = xa(e)) || void 0 === n ? void 0 : n.unverifiedPaymentMethodsOnDomain) && void 0 !== t ? t : ["link"]).indexOf("link")
}(e) ? e.consumer.shippingAddresses : []
}, ed = function(e) {
var t;
return !!("ERROR" === e.consumer.requests.START_VERIFICATION.status && (null === (t = e.consumer.requests.START_VERIFICATION.error) || void 0 === t ? void 0 : t.status))
}, td = function(e) {
return ed(e) && e.consumer.requests.START_VERIFICATION.verificationType === vt.sf.SMS
}, nd = function(e) {
return !!e.consumer.consumerSession && (hi(e) ? (0,
O.G)(e.consumer.consumerSession.verification_sessions, (function(e) {
var t = e.type
, n = e.state;
return ("SMS" === t || "EMAIL" === t) && "STARTED" === n
}
)) : (0,
O.G)(e.consumer.consumerSession.verification_sessions, (function(e) {
var t = e.type
, n = e.state;
return "SMS" === t && "STARTED" === n
}
)))
}, rd = function(e, t) {
return e.consumer.requests[t].status
}, ad = function(e) {
var t;
return null === (t = e.consumer.consumerSession) || void 0 === t ? void 0 : t.email_address
}, id = function(e) {
var t = e.consumer.requests.CONFIRM_LINK_PAYMENT_INTENT
, n = e.consumer.requests.CONFIRM_LINK_SETUP_INTENT;
return "ERROR" === t.status && (0,
A.T)({
error: t.error
}) || "ERROR" === n.status && (0,
A.T)({
error: n.error
})
}, od = function(e) {
return e.consumer.loaded
}, sd = function(e) {
return od(e) && (Wc(e) || Yc(e))
}, ud = function(e) {
return ei(e) && function(e) {
return e.consumer.useBackupPaymentMethod
}(e)
}, ld = function(e) {
return "card" === ya(e) && (sd(e) || Wc(e)) && Wa(e) && !fi(e)
}, cd = function(e) {
var t, n = "link" === (null === (t = e.expressCheckoutElement) || void 0 === t ? void 0 : t.confirmingPaymentMethodType), r = ya(e);
return n && "card" === r && Wa(e) && !fi(e)
}, dd = function(e) {
var t;
return null === (t = e.expressCheckoutElement) || void 0 === t ? void 0 : t.sharedPaymentMethodId
}, pd = function(e) {
return !xc(e) && sd(e) && (ld(e) || function(e) {
var t, n = Pa(e).orderedPaymentMethodTypesAndWallets, r = (null == n ? void 0 : n.indexOf("link")) >= 0, a = ya(e);
"card" === a && (t = "CARD"),
"link" === a && (t = "INSTANT_DEBITS");
var i = Gc(e);
return r && (sd(e) || Wc(e)) && t && i.indexOf(t) >= 0 && !fi(e)
}(e) || function(e) {
return "link_card_brand" === ya(e) && (sd(e) || Wc(e)) && !fi(e)
}(e) || yd(e))
}, md = function(e) {
var t;
return (null == e || null === (t = e.consumer) || void 0 === t ? void 0 : t.linkFunnelConfirmationLinkType) || ""
}, fd = function(e) {
return e.consumer.autoFillBehavior
}, hd = function(e) {
var t = Pa(e).orderedPaymentMethodTypesAndWallets
, n = 1 === t.length && "link" === t[0]
, r = function(e) {
var t;
return !("ERROR" !== e.consumer.requests.CREATE_SESSION.status || !(null === (t = e.consumer.requests.CREATE_SESSION.error) || void 0 === t ? void 0 : t.status))
}(e) || ed(e)
, a = qc(e).length > 0
, i = Ha(e).linkPmKillswitchOnInElements;
return n && (r || !a || i)
}, _d = function(e) {
return function(t) {
var n, r = va(t), a = r.available && Sa(r) || "expressCheckout" === e && function(e) {
return Pa(e).linkSettings.linkPayButtonElementEnabled
}(t);
return !qa(t) && null !== (n = si(t)) && void 0 !== n && n.length ? ["ephemeral"] : a ? ["ephemeral", "persistent"] : ["ephemeral"]
}
}, yd = function(e) {
var t = ya(e)
, n = Gc(e)
, r = Qc(e)
, a = Dc(e)
, i = Yc(e)
, o = "link-nested" === a.view ? "use-saved" === a.linkView.view : i && "saved" === a.view;
return "us_bank_account" === t && "BANK_ACCOUNT" === (null == r ? void 0 : r.type) && -1 !== n.indexOf("US_BANK_ACCOUNT") && o
}, vd = function(e) {
var t, n, r;
return e && (null === (t = e.expressCheckoutElement) || void 0 === t || null === (n = t.paymentMethodData) || void 0 === n || null === (r = n.billing_details) || void 0 === r ? void 0 : r.phone) || null
}, gd = function(e) {
var t, n, r;
return e && (null === (t = e.expressCheckoutElement) || void 0 === t || null === (n = t.paymentMethodData) || void 0 === n || null === (r = n.billing_details) || void 0 === r ? void 0 : r.email) || null
}, bd = function(e, t) {
var n = function(e) {
return $a(e) && !Ua(e, "payment_element_link_modal_preload_killswitch")
}(e);
if (!n)
return !1;
if (!function(e) {
return e.consumer.linkModalEnabledByExperiment
}(e))
return !1;
if (!function(e) {
return "disabled" !== e.consumer.linkModalStatus
}(e))
return !1;
var r = e.consumer.consumerSession;
if (!r)
return !1;
var a = function(e) {
return e.consumer.emailSource
}(e);
return !(null != t && t.allowedEmailSources && (!a || t.allowedEmailSources.indexOf(a) < 0)) && !(0,
O.G)(r.verification_sessions, (function(e) {
return "STARTED" === e.state
}
))
}, Sd = function(e, t) {
var n = t.paymentMethod
, r = t.element
, a = t.store;
if (n && "link" === n)
return !0;
if (r && ["card", "cardNumber", "cardExpiry", "cardCvc", "postalCode"].indexOf(r) > -1)
return !!e.linkConfigs.linkInCardPaymentData;
try {
if (a) {
var i = a.getState();
return pd(i) || "LINK" === md(i)
}
} catch (e) {
return !1
}
return !1
}, kd = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o, s, u, l, c, d, p, m, f, h, _, y, v, g, k, C, E;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
if (r = t.logger,
a = t.hcaptchaManager,
i = t.outerActions,
o = t.apiClient,
s = t.integrationMetadata,
u = t.cardElementState,
l = t.outerInitiatedActions,
c = n.locale,
d = n.elementName,
p = n.mids,
m = n.type,
f = n.tokenData,
h = n.elementData,
_ = n.pastedFields,
y = ut(m, f, d),
v = y.data,
y.warnings.forEach((function(e) {
return r.warn(e)
}
)),
g = (0,
O.TS)({}, v, h || {}),
!ht(d, m)) {
e.next = 10;
break
}
return e.next = 8,
dt({
slug: "tokenize",
siteKey: a.getSiteKey("elements"),
getCaptchaToken: i.getCaptchaToken
});
case 8:
(k = e.sent) && (g.radar_options ? g.radar_options.hcaptcha_token = k : g.radar_options = {
hcaptcha_token: k
});
case 10:
return C = s.getPaymentMetadata(d),
e.next = 13,
o.tokens.create({
data: (0,
b.Z)((0,
b.Z)({}, g), {}, {
payment_user_agent: C.payment_user_agent,
pasted_fields: _
}),
merchantParams: v,
errorLog: r.log,
options: (0,
b.Z)({
loggerExtras: yt({
elementName: d,
mids: p,
usesLink: Sd(u, {
element: d
})
})
}, c ? {
localeOverride: c
} : {})
});
case 13:
return E = e.sent,
e.next = 16,
l.removeElementsExperimentId();
case 16:
return e.abrupt("return", E);
case 17:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), Cd = {
card: ua.gE,
cardNumber: ua.AJ,
cardExpiry: ua.AJ,
cardCvc: ua.AJ,
postalCode: ua.AJ,
iban: ua.I1,
idealBank: ua.I1,
p24Bank: ua.I1,
auBankAccount: ua.I1,
fpxBank: ua.I1,
netbankingBank: ua.I1,
epsBank: ua.I1,
paymentRequestButton: ua.wN
}, Ed = function() {
function e(t) {
(0,
C.Z)(this, e),
this.stripeWrappers = [],
this.wrappersMap = new Map,
this.paymentUserAgentSurfaceContextSuffix = t.paymentUserAgentContextSuffix,
this.topOriginForCrossOriginFrame = t.topOriginForCrossOriginFrame,
this.stripeJsLoadTimestamp = t.stripeJsLoadTimestamp,
this.loadTimestamp = t.loadTimestamp,
this.stripeJsId = t.stripeJsId,
this.globalLocale = t.globalLocale || null,
this.betas = t.betas;
var n = (0,
T.l0)();
this.referrer = n.referrer,
this.referrerOrigin = "" === n.referrerOrigin ? void 0 : n.referrerOrigin
}
return (0,
E.Z)(e, [{
key: "getPaymentUserAgentFromElementName",
value: function(e) {
var t;
return this.getPaymentUserAgent(null !== (t = e && Cd[e]) && void 0 !== t ? t : void 0)
}
}, {
key: "getPaymentUserAgent",
value: function(e) {
var t = e || ua.GD;
return this.paymentUserAgentSurfaceContextSuffix ? "".concat(t, "; ").concat(this.paymentUserAgentSurfaceContextSuffix) : t
}
}, {
key: "getReferrerHost",
value: function() {
var e, t;
return null !== (e = null === (t = (0,
T.Ds)(this.referrer)) || void 0 === t ? void 0 : t.host) && void 0 !== e ? e : null
}
}, {
key: "getTopLevelReferrerHost",
value: function() {
var e, t;
return null !== (e = this.topOriginForCrossOriginFrame && (null === (t = (0,
T.Ds)(this.topOriginForCrossOriginFrame)) || void 0 === t ? void 0 : t.host)) && void 0 !== e ? e : null
}
}, {
key: "getPaymentMetadata",
value: function(e) {
return {
payment_user_agent: this.getPaymentUserAgentFromElementName(e),
referrer: this.referrerOrigin,
time_on_page: this.getTimeOnPage()
}
}
}, {
key: "getTimeOnPage",
value: function() {
return e.getInstance().stripeJsLoadTimestamp.getElapsedTime()
}
}, {
key: "resolveLocale",
value: function(e) {
return e || this.globalLocale || "auto"
}
}, {
key: "registerStripeWrapper",
value: function(e) {
var t = e.startTime;
t && (!this.createWrapperTimestamp || this.createWrapperTimestamp.getAsPosixTime() > t) && (this.createWrapperTimestamp = K.E.fromPosixTime(t)),
this.stripeWrappers.push(e),
He.updateParams(w(this.stripeWrappers))
}
}, {
key: "registerStripeAppInfo",
value: function(e) {
var t = e.name
, n = e.partner_id
, r = e.url
, a = e.version;
this.wrappersMap.size >= 5 ? He.log("register_app_info.error", {
error: "Exceed maximum number of libraries"
}) : this.wrappersMap.has(t) ? He.log("register_app_info.error", {
error: "Register duplicated library: ".concat(t)
}) : (He.log("register_app_info", {
app_info_raw: t,
app_info_partner_id: n || null,
app_info_url: r || null,
app_info_version: a || null
}),
this.wrappersMap.set(t, e))
}
}], [{
key: "getInstance",
value: function() {
if (!e.instance)
throw new Error("IntegrationMetadataManager not initialized; initInstance must be called first");
return e.instance
}
}, {
key: "initInstance",
value: function(t) {
return e.instance = new e(t),
e.instance
}
}]),
e
}(), Zd = (n(56274).Promise,
{
type: (0,
M.kw)("au_becs_debit"),
currency: (0,
M.kw)("aud"),
au_becs_debit: (0,
M.ci)({
bsb_number: M.Z_,
account_number: M.Z_
}),
mandate: (0,
M.mC)({
acceptance: (0,
M.ci)({
status: (0,
M.kw)("accepted")
})
})
}), Ad = function(e, t, n, r) {
var a = r && r.length ? ve(r) : void 0
, i = be(t);
switch (n) {
case "au_becs_debit":
return {
type: H.au_becs_debit,
data: {
au_becs_debit: {
bsb_number: We(i.bsbValue),
account_number: i.accountNumberValue
}
}
};
case "card":
var o = Xe(i);
if ("linkInCardPaymentData"in o)
return {
type: "link_in_card_payment_data",
data: o.linkInCardPaymentData
};
var s = o.card
, u = o.owner;
return {
type: H.card,
data: {
card: s,
owner: u
},
pastedFields: a
};
case "ideal":
return {
type: H.ideal,
data: {
ideal: {
bank: i[e]
}
}
};
case "sepa_debit":
return {
type: H.sepa_debit,
data: {
sepa_debit: {
iban: Ye(i[e])
}
}
};
default:
return (0,
P.Rz)(n)
}
}, Md = function(e, t) {
return "au_becs_debit" === e ? ((0,
M.Gu)((0,
M.mC)(Zd), t, "source creation parameter"),
{
type: e,
data: (0,
O.TS)(t, {
mandate: {
acceptance: {
type: "online",
online: {
infer_from_client: !0
}
}
}
})
}) : {
type: e,
data: t
}
}, Pd = function(e, t, n) {
return function(e, t) {
return null === e || 0 === e.length || -1 !== e.indexOf(t)
}(t, e.country_code) && !(n && function(e) {
var t = e.line_1
, n = void 0 === t ? "" : t
, r = e.line_2
, a = void 0 === r ? "" : r
, i = e.country_code
, o = Yt(void 0 === i ? "" : i);
return !!o && (on(o, n) || on(o, a))
}(e))
}, xd = ["BE", "BR", "CH", "ES", "ID", "IT", "MX", "NL", "NO", "PL", "RU", "SE"], Id = function(e, t) {
return (0,
O.sE)(t.address_components, (function(t) {
return -1 !== t.types.indexOf(e)
}
))
}, Nd = function(e) {
e.dependentLocality && (e.addressLine2 ? e.addressLine2 = "".concat(e.addressLine2, ", ").concat(e.dependentLocality) : e.addressLine2 = e.dependentLocality)
}, wd = function(e, t) {
var n = function(e, t) {
var n = Id(e, t);
return n ? n.short_name : null
}("administrative_area_level_2", e)
, r = function(e, t) {
var n = Id(e, t);
return n ? n.long_name : null
}("administrative_area_level_1", e);
switch (t.country) {
case "IE":
r && (t.administrativeArea = r),
Nd(t);
break;
case "JP":
t.addressLine2 = "",
Nd(t);
break;
case "TR":
case "BR":
!t.locality && n && (t.locality = n),
Nd(t);
break;
case "ES":
case "IT":
n && (t.administrativeArea = n);
break;
case "CO":
case "MX":
case "MY":
case "PH":
case "PK":
case "ZA":
Nd(t)
}
return t
}, Td = function(e, t, n) {
var r = n.locality
, a = n.country
, i = n.addressLine2
, o = e.street_number
, s = e.route_long
, u = e.route_short
, l = null != o ? o : ""
, c = null != s ? s : ""
, d = null != u ? u : "";
return "JP" === a ? function(e, t, n) {
var r = e.sublocality_level_2
, a = e.sublocality_level_3
, i = e.sublocality_level_4
, o = a && i && n
, s = a
, u = i
, l = n
, c = r;
if ("ja" === (0,
Jr.UT)()) {
var d = o ? "".concat(s).concat(u, "-").concat(l) : "";
return "".concat(t).concat(c).concat(d)
}
var p = o ? "".concat(s, "-").concat(u, "-").concat(l) : "";
return "".concat(p, " ").concat(c, " ").concat(t).trim()
}(e, r, i) : t && (l || c) ? !function(e, t, n, r) {
return "" !== t && "" !== n && (-1 !== e.indexOf(n) || -1 !== e.indexOf(r)) && -1 !== e.indexOf(t)
}(t, l, c, d) || function(e, t) {
return "" !== t && -1 !== e.indexOf(t)
}(t, i) ? -1 !== xd.indexOf(a) ? "".concat(c.trim(), " ").concat(l.trim()) : "".concat(l.trim(), " ").concat(c.trim()) : t : ""
}, Od = function(e, t, n) {
var r = {
addressLine1: "",
addressLine2: "",
dependentLocality: "",
locality: "",
administrativeArea: "",
postalCode: "",
country: ""
}
, a = {};
return e.address_components.forEach((function(e) {
var t = e.short_name
, i = e.long_name;
switch (e.types[0]) {
case "street_number":
a.street_number = i;
break;
case "route":
a.route_long = i,
a.route_short = t;
break;
case "premise":
case "subpremise":
r.addressLine2 = i;
break;
case "locality":
case "sublocality":
case "postal_town":
r.locality = i;
break;
case "administrative_area_level_1":
r.administrativeArea = t;
break;
case "administrative_area_level_3":
r.locality || (r.locality = i);
break;
case "administrative_area_level_2":
r.administrativeArea || r.dependentLocality ? r.administrativeArea = t : r.dependentLocality = i;
break;
case "neighborhood":
r.locality ? r.dependentLocality = i : r.locality = i;
break;
case "postal_code":
r.postalCode = i;
break;
case "postal_code_prefix":
if (n) {
var o = n.filter((function(e) {
return -1 !== e.value.indexOf(i)
}
));
r.postalCode = o.length > 0 ? o[0].value : ""
}
break;
case "country":
r.country = t;
break;
case "sublocality_level_1":
r.locality ? r.locality = i : r.dependentLocality = i;
break;
case "sublocality_level_2":
a.sublocality_level_2 = i;
break;
case "sublocality_level_3":
a.sublocality_level_3 = i;
break;
case "sublocality_level_4":
a.sublocality_level_4 = i
}
}
)),
r.addressLine1 = Td(a, t, r),
wd(e, r)
}, Rd = {
isFetchingSuggestions: !1,
selectedIndex: 0,
isSuggestionSelected: !1,
suggestions: null,
inputLocation: null,
isAutofillUsed: !1,
isMouseInsideDropdown: !1,
isInputFocused: !1
}, Ld = ((0,
M.mC)({
phone: (0,
M.jt)((0,
M.kw)("auto", "always", "never"))
}),
(0,
M.mC)({
required: (0,
M.kw)("auto", "always", "never")
})), Dd = ((0,
M.mC)({
phone: (0,
M.jt)(Ld)
}),
"shipping"), Ud = "billing", jd = ((0,
M.or)((0,
M.mC)({
mode: (0,
M.kw)("automatic", "disabled")
}), (0,
M.mC)({
mode: (0,
M.kw)("google_maps_api"),
apiKey: M.Z_
})),
(0,
M.mC)({
name: (0,
M.jt)((0,
M.kw)("full", "split", "organization"))
}),
Object.freeze({
line1: (0,
M.jt)(M.Z_),
line2: (0,
M.jt)(M.Z_),
city: (0,
M.jt)(M.Z_),
state: (0,
M.jt)(M.Z_),
country: (0,
M.jt)(M.Z_),
postal_code: (0,
M.jt)(M.Z_)
})), Bd = ((0,
M.jt)(M.Z_),
(0,
M.jt)((0,
M.mC)(jd)),
(0,
M.jt)(M.Z_),
"full"), Fd = "split", Gd = ["incorrect_zip"], qd = [].concat(Gd, ["card_velocity_exceeded", "expired_card", "fraudulent", "generic_decline", "incorrect_cvc", "insufficient_funds", "invalid_cvc", "invalid_expiry_month", "invalid_expiry_year", "lost_card", "stolen_card"]), Kd = function(e) {
switch (e.decline_code || e.code) {
case "card_velocity_exceeded":
case "fraudulent":
case "generic_decline":
case "insufficient_funds":
case "lost_card":
case "stolen_card":
return "number";
case "expired_card":
case "invalid_expiry_month":
case "invalid_expiry_year":
return "expiry";
case "incorrect_cvc":
case "invalid_cvc":
return "cvc";
case "incorrect_zip":
return "postalCode";
default:
return null
}
}, Vd = function(e) {
var t, n, r = e || {}, a = r.error, i = r.field, o = (null == a || null === (t = a.extra_fields) || void 0 === t ? void 0 : t.link_decline_code) || (null == a || null === (n = a.extra_fields) || void 0 === n ? void 0 : n.link_code) || (null == a ? void 0 : a.decline_code) || (null == a ? void 0 : a.code);
return "string" != typeof o ? {} : o ? -1 === qd.indexOf(o) ? {} : (0,
v.Z)({}, i, oa(o)) : {}
}, zd = ["id", "mode"], Hd = "customer_shipping", Yd = "customer_payment_method_billing_details", Wd = {
form: {
autofilledFields: (0,
b.Z)((0,
b.Z)({
phone: !1
}, (0,
O.Q8)(ra, (function() {
return !1
}
))), (0,
O.Q8)(na, (function() {
return !1
}
))),
displayErrors: (0,
b.Z)((0,
b.Z)({
phone: !1
}, (0,
O.Q8)(ra, (function() {
return !1
}
))), (0,
O.Q8)(na, (function() {
return !1
}
))),
errors: (0,
b.Z)((0,
b.Z)({
phone: null
}, (0,
O.Q8)(ra, (function() {
return null
}
))), (0,
O.Q8)(na, (function() {
return null
}
))),
shouldUpdateLocalValueFromState: (0,
b.Z)((0,
b.Z)({
phone: !1
}, (0,
O.Q8)(ra, (function() {
return !1
}
))), (0,
O.Q8)(na, (function() {
return !1
}
))),
values: (0,
b.Z)((0,
b.Z)((0,
b.Z)({
phone: "",
phoneCountry: na.country
}, ra), na), {}, {
syncAddress: !1
}),
formattedValues: {
phone: ""
},
isPhoneCountryTouched: !1,
showAllFields: !1,
focusedField: null
},
isConsumerInformationListed: !1,
isAddingSavedAddress: !1,
isNewAddressTouched: !1,
removingSavedAddress: null,
isSelectingSavedAddress: !1,
isUpdatingSavedBillingDetails: !1,
updateError: null,
isUpdatePending: !1,
selectedSavedAddress: null,
countryCode: null,
options: {
mode: Dd,
allowedCountries: null,
autocomplete: null,
blockPoBox: !1,
contacts: null,
defaultValues: null,
display: null,
fields: null,
validation: null
},
isRtl: !1,
autocomplete: Rd,
isStateInit: !1,
touched: !1,
hasConfirmFailedForView: !1,
confirmationError: null
}, Jd = "US", Xd = function(e) {
var t, n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "", r = null !== (t = Yt(e || Jd)) && void 0 !== t ? t : Jd;
return (0,
b.Z)((0,
b.Z)({}, Wd.form), {}, {
values: (0,
b.Z)((0,
b.Z)({}, Wd.form.values), {}, {
country: r,
phoneCountry: r,
name: n
})
})
}, Qd = function(e, t, n, r) {
var a = e[t].form
, i = (0,
O.ei)((0,
b.Z)((0,
b.Z)({}, na), ra), n);
return (0,
b.Z)((0,
b.Z)({}, e), {}, (0,
v.Z)({}, t, (0,
b.Z)((0,
b.Z)({}, e[t]), {}, {
form: (0,
b.Z)((0,
b.Z)({}, a), {}, {
displayErrors: (0,
b.Z)((0,
b.Z)({}, a.displayErrors), (0,
O.Q8)(i, (function() {
return !1
}
))),
shouldUpdateLocalValueFromState: (0,
b.Z)((0,
b.Z)((0,
b.Z)({}, a.shouldUpdateLocalValueFromState), (0,
O.Q8)(i, (function() {
return !0
}
))), {}, {
phoneCountry: !0
}),
values: (0,
b.Z)((0,
b.Z)((0,
b.Z)({}, a.values), i), {}, {
phoneCountry: r ? a.values.country : a.values.phoneCountry
})
})
})))
}, $d = function(e, t) {
var n = Kt(e[t].form.values.country)
, r = n[(0,
O.cx)(n, (function(e) {
return e.required
}
))]
, a = new Set(["name", "firstName", "lastName", "organizationName", r.type]);
return (0,
O.Q8)(e[t].form.displayErrors, (function(n, r) {
var i, o;
return e[t].form.showAllFields || e[t].selectedSavedAddress && ["phone"].indexOf(r) > -1 || (null === (i = e[t].options.validation) || void 0 === i || null === (o = i.phone) || void 0 === o ? void 0 : o.required) && e[t].form.values.syncAddress && ["phone"].indexOf(r) > -1 || a.has(r)
}
))
}, ep = function(e, t) {
return function() {
var n, r = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : t || e, a = arguments.length > 1 ? arguments[1] : void 0, i = a, o = i.mode, s = "shipping";
switch (a.type) {
case "ADDRESS.INIT":
var u, l = (null === (u = r[o].selectedSavedAddress) || void 0 === u ? void 0 : u.id) === Yd, c = (0,
b.Z)((0,
b.Z)({}, r), {}, (0,
v.Z)({}, o, (0,
b.Z)((0,
b.Z)({}, r[o]), {}, {
isStateInit: !0,
options: (0,
b.Z)((0,
b.Z)({}, a.options), l ? {
contacts: null
} : null),
isRtl: a.isRtl,
form: (0,
b.Z)((0,
b.Z)({}, r[o].form), {}, {
shouldUpdateLocalValueFromState: (0,
b.Z)((0,
b.Z)({
phone: !0
}, (0,
O.Q8)(ra, (function() {
return !0
}
))), (0,
O.Q8)(na, (function() {
return !0
}
)))
})
})));
if (a.options.contacts && a.options.contacts.allowed.length > 0 && !l) {
var d = a.options.contacts.allowed[0]
, p = d.mode
, m = d.id;
return (0,
b.Z)((0,
b.Z)({}, c), {}, (0,
v.Z)({}, o, (0,
b.Z)((0,
b.Z)({}, c[o]), {}, {
selectedSavedAddress: {
mode: p,
id: m
}
})))
}
if (a.options.defaultValues) {
var f = a.options.defaultValues
, _ = Object.entries(f).filter((function(e) {
var t = (0,
g.Z)(e, 2);
t[0];
return !!t[1]
}
)).map((function(e) {
var t = (0,
g.Z)(e, 2)
, n = t[0];
t[1];
return n
}
))
, y = yp(f, c[o].form)
, S = hp(f.phone, y.phoneCountry)
, k = (0,
b.Z)((0,
b.Z)({}, f), {}, {
phone: S || y.phone,
phoneCountry: y.phoneCountry
});
return (0,
b.Z)((0,
b.Z)({}, c), {}, (0,
v.Z)({}, o, (0,
b.Z)((0,
b.Z)({}, c[o]), {}, {
form: (0,
b.Z)((0,
b.Z)({}, c[o].form), {}, {
values: k,
formattedValues: (0,
b.Z)((0,
b.Z)({}, c[o].form.formattedValues), {}, {
phone: y.formattedPhone
}),
showAllFields: vp(k),
displayErrors: (0,
b.Z)((0,
b.Z)({}, c[o].form.displayErrors), (0,
O.sq)(_.map((function(e) {
return [e, !0]
}
))))
})
})))
}
return c;
case "ADDRESS.FIELD_CHANGED":
var C = r[o].form.values[a.name]
, E = !(0,
O.Xy)(a.value, C)
, Z = (0,
b.Z)((0,
b.Z)({}, r[o].form.values), {}, (0,
v.Z)({}, a.name, a.value));
"firstName" === a.name || "lastName" === a.name ? Z.name = "".concat(Z.firstName || "", " ").concat(Z.lastName || "").trim() : "organizationName" === a.name && (Z.name = a.value);
var A = r[o].options
, M = A.blockPoBox
, P = A.validation
, x = A.display
, I = r[o].confirmationError
, N = I && a.name === I.field && E;
N && (I = null);
var w = mp(Z, M, P, x, I)
, T = r[o].autocomplete.isFetchingSuggestions || !!r[o].autocomplete.suggestions
, R = new Set(["name", "firstName", "lastName", "organizationName", "syncAddress"])
, L = !T && !R.has(a.name) && "string" == typeof a.value && a.value.length > 2
, D = (0,
b.Z)((0,
b.Z)({}, r), {}, (0,
v.Z)({}, o, (0,
b.Z)((0,
b.Z)({}, r[o]), {}, {
touched: r[o].touched || E && a.touched,
form: (0,
b.Z)((0,
b.Z)({}, r[o].form), {}, {
values: Z,
displayErrors: (0,
b.Z)((0,
b.Z)({}, r[o].form.displayErrors), {}, (0,
v.Z)({}, a.name, !!a.displayError)),
errors: w,
showAllFields: L || r[o].form.showAllFields,
shouldUpdateLocalValueFromState: (0,
b.Z)((0,
b.Z)({}, r[o].form.shouldUpdateLocalValueFromState), {}, (0,
v.Z)({}, a.name, !a.oneWay))
})
})));
return "country" === a.name && r[o].form.values.country !== a.value ? Qd(D, o, ["locality", "postalCode", "administrativeArea"], a.shouldUpdatePhoneCountry) : D;
case "ADDRESS.FORMATTED_FIELD_CHANGED":
var U = (0,
b.Z)((0,
b.Z)({}, r), {}, (0,
v.Z)({}, o, (0,
b.Z)((0,
b.Z)({}, r[o]), {}, {
form: (0,
b.Z)((0,
b.Z)({}, r[o].form), {}, {
formattedValues: (0,
b.Z)((0,
b.Z)({}, r[o].form.formattedValues), {}, (0,
v.Z)({}, a.name, a.value))
})
})));
return U;
case "ADDRESS.RESET_ADDRESS_VALUES":
return (0,
b.Z)((0,
b.Z)({}, r), {}, (0,
v.Z)({}, o, (0,
b.Z)((0,
b.Z)({}, r[o]), {}, {
form: (0,
b.Z)((0,
b.Z)({}, Xd(r[o].countryCode, "")), {}, {
shouldUpdateLocalValueFromState: (0,
b.Z)((0,
b.Z)({
phone: !0
}, (0,
O.Q8)(ra, (function() {
return !0
}
))), (0,
O.Q8)(na, (function() {
return !0
}
)))
})
})));
case "ADDRESS.SHOW_ALL_FIELDS":
return (0,
b.Z)((0,
b.Z)({}, r), {}, (0,
v.Z)({}, o, (0,
b.Z)((0,
b.Z)({}, r[o]), {}, {
form: (0,
b.Z)((0,
b.Z)({}, r[o].form), {}, {
showAllFields: !0
})
})));
case "ADDRESS.FILL_PHONE":
return (0,
b.Z)((0,
b.Z)({}, r), {}, (0,
v.Z)({}, o, (0,
b.Z)((0,
b.Z)({}, r[o]), {}, {
form: (0,
b.Z)((0,
b.Z)({}, r[o].form), {}, {
values: (0,
b.Z)((0,
b.Z)({}, r[o].form.values), {}, {
phone: a.value.phone,
phoneCountry: a.value.phoneCountry
}),
shouldUpdateLocalValueFromState: (0,
b.Z)((0,
b.Z)({}, r[o].form.shouldUpdateLocalValueFromState), {}, {
phone: !0,
phoneCountry: !0
}),
displayErrors: (0,
b.Z)((0,
b.Z)({}, r[o].form.displayErrors), {}, {
phone: !1
})
})
})));
case "ADDRESS.PHONE_COUNTRY_TOUCHED":
return (0,
b.Z)((0,
b.Z)({}, r), {}, (0,
v.Z)({}, o, (0,
b.Z)((0,
b.Z)({}, r[o]), {}, {
form: (0,
b.Z)((0,
b.Z)({}, r[o].form), {}, {
isPhoneCountryTouched: !0
})
})));
case "ADDRESS.FIELD_FOCUSED":
return (0,
b.Z)((0,
b.Z)({}, r), {}, (0,
v.Z)({}, o, (0,
b.Z)((0,
b.Z)({}, r[o]), {}, {
form: (0,
b.Z)((0,
b.Z)({}, r[o].form), {}, {
focusedField: a.name
})
})));
case "ADDRESS.FIELD_BLURRED":
return (0,
b.Z)((0,
b.Z)({}, r), {}, (0,
v.Z)({}, o, (0,
b.Z)((0,
b.Z)({}, r[o]), {}, {
form: (0,
b.Z)((0,
b.Z)({}, r[o].form), {}, {
displayErrors: (0,
b.Z)((0,
b.Z)({}, r[o].form.displayErrors), {}, (0,
v.Z)({}, a.name, !!r[o].form.values[a.name] || r[o].form.displayErrors[a.name])),
focusedField: null
})
})));
case "ADDRESS.FIELD_AUTOFILL_USED":
return (0,
b.Z)((0,
b.Z)({}, r), {}, (0,
v.Z)({}, o, (0,
b.Z)((0,
b.Z)({}, r[o]), {}, {
form: (0,
b.Z)((0,
b.Z)({}, r[o].form), {}, {
autofilledFields: (0,
b.Z)((0,
b.Z)({}, r[o].form.autofilledFields), {}, (0,
v.Z)({}, a.name, a.value))
})
})));
case "ELEMENTS.DISPLAY_ERRORS":
var j;
return a.elementsToDisplayErrors && -1 === a.elementsToDisplayErrors.indexOf("address") ? r : (0,
b.Z)((0,
b.Z)({}, r), {}, (j = {},
(0,
v.Z)(j, Dd, (0,
b.Z)((0,
b.Z)({}, r.shipping), {}, {
form: (0,
b.Z)((0,
b.Z)({}, r.shipping.form), {}, {
displayErrors: $d(r, Dd)
})
})),
(0,
v.Z)(j, Ud, (0,
b.Z)((0,
b.Z)({}, r.billing), {}, {
form: (0,
b.Z)((0,
b.Z)({}, r.billing.form), {}, {
displayErrors: $d(r, Ud)
})
})),
j));
case "ADDRESS.DISPLAY_ERRORS":
return (0,
b.Z)((0,
b.Z)({}, r), {}, (0,
v.Z)({}, o, (0,
b.Z)((0,
b.Z)({}, r[o]), {}, {
form: (0,
b.Z)((0,
b.Z)({}, r[o].form), {}, {
displayErrors: $d(r, o)
})
})));
case "ADDRESS.LIST_CONSUMER_SHIPPING_ADDRESSES":
var B, F = a.shippingAddresses, G = r.shipping, q = G.options, K = q.allowedCountries, V = q.blockPoBox, z = (q.display,
G.form.values), H = F.filter((function(e) {
var t = e.address;
return Pd(t, K, V)
}
)), Y = xt(H), W = up(r.shipping.countryCode, z);
return Y ? (0,
b.Z)((0,
b.Z)({}, r), {}, {
shipping: (0,
b.Z)((0,
b.Z)({}, r.shipping), {}, {
isConsumerInformationListed: !0,
isAddingSavedAddress: !W && r.shipping.touched,
isSelectingSavedAddress: !1,
selectedSavedAddress: {
mode: "consumer",
id: Y.id
}
})
}) : "consumer" === (null === (B = r.shipping.selectedSavedAddress) || void 0 === B ? void 0 : B.mode) ? (0,
b.Z)((0,
b.Z)({}, r), {}, {
shipping: (0,
b.Z)((0,
b.Z)({}, r.shipping), {}, {
selectedSavedAddress: null
})
}) : r;
case "ADDRESS.SET_IS_ADDING_SAVED_ADDRESS":
return r[o].isNewAddressTouched ? (0,
b.Z)((0,
b.Z)({}, r), {}, (0,
v.Z)({}, o, (0,
b.Z)((0,
b.Z)({}, r[o]), {}, {
isAddingSavedAddress: !0,
form: (0,
b.Z)((0,
b.Z)({}, r[o].form), {}, {
displayErrors: Wd.form.displayErrors
})
}))) : (0,
b.Z)((0,
b.Z)({}, r), {}, (0,
v.Z)({}, o, (0,
b.Z)((0,
b.Z)({}, r[o]), {}, {
isAddingSavedAddress: !0,
isNewAddressTouched: !0,
form: (0,
b.Z)((0,
b.Z)({}, r[o].form), {}, {
values: (0,
b.Z)((0,
b.Z)({}, r[o].form.values), {}, {
name: "",
locality: "",
administrativeArea: ""
}),
displayErrors: Wd.form.displayErrors
})
})));
case "ADDRESS.SET_IS_SELECTING_SAVED_ADDRESS":
return (0,
b.Z)((0,
b.Z)({}, r), {}, (0,
v.Z)({}, o, (0,
b.Z)((0,
b.Z)({}, r[o]), {}, {
isSelectingSavedAddress: !0
})));
case "ADDRESS.SET_IS_UPDATING_SAVED_BILLING_DETAILS":
var J;
if (!a.savedAddress)
return (0,
b.Z)((0,
b.Z)({}, r), {}, (0,
v.Z)({}, o, (0,
b.Z)((0,
b.Z)({}, r[o]), {}, {
isUpdatingSavedBillingDetails: !1,
updateError: null
})));
var X = fp(a.savedAddress)
, Q = X || {}
, $ = (Q.id,
Q.mode,
(0,
h.Z)(Q, zd))
, ee = yp((0,
b.Z)((0,
b.Z)({}, $), {}, {
phone: a.savedAddress.address.phone || ""
}), r[o].form);
return (0,
b.Z)((0,
b.Z)({}, r), {}, (0,
v.Z)({}, o, (0,
b.Z)((0,
b.Z)({}, r[o]), {}, {
form: (0,
b.Z)((0,
b.Z)({}, r[o].form), {}, {
values: (0,
b.Z)((0,
b.Z)((0,
b.Z)((0,
b.Z)({}, na), $), {}, {
phone: ee.phone,
phoneCountry: ee.phoneCountry
}, "split" === (null === (J = r[o].options.display) || void 0 === J ? void 0 : J.name) ? gp($.name) : null), {}, {
organizationName: $.name
}),
shouldUpdateLocalValueFromState: (0,
b.Z)({}, (0,
O.Q8)($, (function() {
return !0
}
))),
showAllFields: !0
}),
isUpdatingSavedBillingDetails: !0,
hasConfirmFailedForView: !1
})));
case "ADDRESS.SAVED_ADDRESS_SELECTED":
var te = a.showSelectionList
, ne = a.savedAddress
, re = r[o].selectedSavedAddress;
if (ne)
switch (ne.mode) {
case "consumer":
re = {
mode: "consumer",
id: ne.id
};
break;
case "customer":
re = {
mode: "customer",
id: ne.id
};
break;
case "merchant":
re = {
mode: "merchant",
id: ne.id
}
}
return (0,
b.Z)((0,
b.Z)({}, r), {}, (0,
v.Z)({}, o, (0,
b.Z)((0,
b.Z)({}, r[o]), {}, {
isAddingSavedAddress: !1,
isSelectingSavedAddress: te,
selectedSavedAddress: re
})));
case "ADDRESS.ASK_TO_REMOVE_SAVED_ADDRESS":
var ae = a.savedAddress
, ie = "consumer" === ae.mode ? {
mode: "consumer",
id: ae.id
} : {
mode: "customer",
id: ae.id
};
return (0,
b.Z)((0,
b.Z)({}, r), {}, (0,
v.Z)({}, o, (0,
b.Z)((0,
b.Z)({}, r[o]), {}, {
removingSavedAddress: ie
})));
case "ADDRESS.CANCEL_REMOVE_SAVED_ADDRESS":
return (0,
b.Z)((0,
b.Z)({}, r), {}, (0,
v.Z)({}, o, (0,
b.Z)((0,
b.Z)({}, r[o]), {}, {
removingSavedAddress: null
})));
case "ADDRESS.PUBLIC_OPTIONS_RECEIVED":
var oe = (0,
b.Z)((0,
b.Z)({}, r[o].options), a.options)
, se = r[o].form.values
, ue = oe.blockPoBox
, le = oe.validation
, ce = oe.display
, de = mp(se, ue, le, ce)
, pe = (0,
b.Z)((0,
b.Z)({}, r), {}, (0,
v.Z)({}, o, (0,
b.Z)((0,
b.Z)({}, r[o]), {}, {
options: oe,
form: (0,
b.Z)((0,
b.Z)({}, r[o].form), {}, {
errors: de
})
})));
return pe;
case "CONSUMER.REMOVE_SHIPPING_ADDRESS.SUCCESS":
var me, fe = a.id, he = a.remainingShippingAddresses;
if ((null === (me = r[s].selectedSavedAddress) || void 0 === me ? void 0 : me.id) === fe) {
var _e, ye, ve = he.filter((function(e) {
var t = e.address;
return Pd(t, r[s].options.allowedCountries, r[s].options.blockPoBox)
}
)), ge = null === (_e = xt(ve)) || void 0 === _e ? void 0 : _e.id;
if (ge)
return (0,
b.Z)((0,
b.Z)({}, r), {}, (0,
v.Z)({}, s, (0,
b.Z)((0,
b.Z)({}, r[s]), {}, {
removingSavedAddress: null,
selectedSavedAddress: {
mode: "consumer",
id: ge
}
})));
var be = null === (ye = r[s].options.contacts) || void 0 === ye ? void 0 : ye.allowed;
if (be && be.length > 0) {
var Se = be[0]
, ke = Se.mode
, Ce = Se.id
, Ee = {
mode: ke,
id: Ce
};
return (0,
b.Z)((0,
b.Z)({}, r), {}, (0,
v.Z)({}, s, (0,
b.Z)((0,
b.Z)({}, r[s]), {}, {
removingSavedAddress: null,
selectedSavedAddress: Ee
})))
}
return (0,
b.Z)((0,
b.Z)({}, r), {}, (0,
v.Z)({}, s, (0,
b.Z)((0,
b.Z)({}, r[s]), {}, {
removingSavedAddress: null,
selectedSavedAddress: e[s].selectedSavedAddress
})))
}
return (0,
b.Z)((0,
b.Z)({}, r), {}, (0,
v.Z)({}, s, (0,
b.Z)((0,
b.Z)({}, r[s]), {}, {
removingSavedAddress: null
})));
case "CONSUMER.LOGOUT.SUCCESS":
var Ze, Ae = !r[s].isAddingSavedAddress, Me = e[s].selectedSavedAddress, Pe = null === (Ze = r[s].options.contacts) || void 0 === Ze ? void 0 : Ze.allowed;
if (Pe && Pe.length > 0) {
var xe = Pe[0]
, Ie = xe.mode
, Ne = xe.id;
Me = {
mode: Ie,
id: Ne
}
}
var we = Ae ? Xd(r[s].countryCode, "") : r[s].form;
return (0,
b.Z)((0,
b.Z)({}, r), {}, (0,
v.Z)({
touched: !0
}, s, (0,
b.Z)((0,
b.Z)({}, r[s]), {}, {
isConsumerInformationListed: !1,
isAddingSavedAddress: !1,
removingSavedAddress: null,
isSelectingSavedAddress: !1,
selectedSavedAddress: Me,
form: (0,
b.Z)((0,
b.Z)({}, we), {}, {
shouldUpdateLocalValueFromState: (0,
b.Z)((0,
b.Z)({
phone: !0
}, (0,
O.Q8)(ra, (function() {
return !0
}
))), (0,
O.Q8)(na, (function() {
return !0
}
)))
})
})));
case "ADDRESS.AUTOCOMPLETE.IS_FETCHING_SUGGESTIONS":
return (0,
b.Z)((0,
b.Z)({}, r), {}, (0,
v.Z)({}, o, (0,
b.Z)((0,
b.Z)({}, r[o]), {}, {
autocomplete: (0,
b.Z)((0,
b.Z)({}, r[o].autocomplete), {}, {
isFetchingSuggestions: a.value
})
})));
case "ADDRESS.AUTOCOMPLETE.SELECTED_INDEX_CHANGED":
return (0,
b.Z)((0,
b.Z)({}, r), {}, (0,
v.Z)({}, o, (0,
b.Z)((0,
b.Z)({}, r[o]), {}, {
autocomplete: (0,
b.Z)((0,
b.Z)({}, r[o].autocomplete), {}, {
selectedIndex: a.index
})
})));
case "ADDRESS.AUTOCOMPLETE.SUGGESTIONS_CHANGED":
return (0,
b.Z)((0,
b.Z)({}, r), {}, (0,
v.Z)({}, o, (0,
b.Z)((0,
b.Z)({}, r[o]), {}, {
autocomplete: (0,
b.Z)((0,
b.Z)({}, r[o].autocomplete), {}, {
suggestions: a.suggestions,
isFetchingSuggestions: !1
})
})));
case "ADDRESS.AUTOCOMPLETE.RESET":
return (0,
b.Z)((0,
b.Z)({}, r), {}, (0,
v.Z)({}, o, (0,
b.Z)((0,
b.Z)({}, r[o]), {}, {
autocomplete: (0,
b.Z)((0,
b.Z)({}, Rd), {}, {
inputLocation: r[o].autocomplete.inputLocation
})
})));
case "ADDRESS.AUTOCOMPLETE.SUGGESTION_SELECTED":
return (0,
b.Z)((0,
b.Z)({}, r), {}, (0,
v.Z)({}, o, (0,
b.Z)((0,
b.Z)({}, r[o]), {}, {
autocomplete: (0,
b.Z)((0,
b.Z)({}, r[o].autocomplete), {}, {
isSuggestionSelected: !0
})
})));
case "ADDRESS.AUTOCOMPLETE.DETAILS_RETRIEVED":
var Te = a.value
, Oe = r[o].autocomplete
, Re = Oe.selectedIndex
, Le = Oe.suggestions;
if (Te && Le) {
var De = (0,
O.ei)(na, ["addressLine1", "addressLine2", "locality", "administrativeArea", "postalCode"])
, Ue = Le[Re].structured_formatting.main_text
, je = Le[Re].terms
, Be = Od(Te, Ue, je)
, Fe = Be.addressLine1
, Ge = Be.addressLine2
, qe = Be.locality
, Ke = Be.administrativeArea
, Ve = Be.postalCode;
return (0,
b.Z)((0,
b.Z)({}, r), {}, (0,
v.Z)({}, o, (0,
b.Z)((0,
b.Z)({}, r[o]), {}, {
form: (0,
b.Z)((0,
b.Z)({}, r[o].form), {}, {
values: (0,
b.Z)((0,
b.Z)({}, r[o].form.values), {}, {
addressLine1: Fe,
addressLine2: Ge,
locality: qe,
administrativeArea: Ke,
postalCode: Ve
}),
shouldUpdateLocalValueFromState: (0,
b.Z)((0,
b.Z)({}, r[o].form.shouldUpdateLocalValueFromState), (0,
O.Q8)(De, (function() {
return !0
}
))),
showAllFields: !0
}),
autocomplete: Rd,
confirmationError: null
})))
}
return r;
case "ADDRESS.AUTOCOMPLETE.INPUT_LOCATION_CHANGED":
return (0,
b.Z)((0,
b.Z)({}, r), {}, (0,
v.Z)({}, o, (0,
b.Z)((0,
b.Z)({}, r[o]), {}, {
autocomplete: (0,
b.Z)((0,
b.Z)({}, r[o].autocomplete), {}, {
inputLocation: a.value
})
})));
case "ADDRESS.AUTOCOMPLETE.MOUSE_INSIDE_DROPDOWN":
return (0,
b.Z)((0,
b.Z)({}, r), {}, (0,
v.Z)({}, o, (0,
b.Z)((0,
b.Z)({}, r[o]), {}, {
autocomplete: (0,
b.Z)((0,
b.Z)({}, r[o].autocomplete), {}, {
isMouseInsideDropdown: a.value
})
})));
case "ADDRESS.AUTOCOMPLETE.INPUT_FOCUSED":
return (0,
b.Z)((0,
b.Z)({}, r), {}, (0,
v.Z)({}, o, (0,
b.Z)((0,
b.Z)({}, r[o]), {}, {
autocomplete: (0,
b.Z)((0,
b.Z)({}, r[o].autocomplete), {}, {
isInputFocused: a.value
})
})));
case "ADDRESS.SET_FORM_VALUES":
var ze, He = a.newFormValues, Ye = yp(He, r[o].form), We = (0,
b.Z)((0,
b.Z)((0,
b.Z)({}, He), "split" === (null === (ze = r[o].options.display) || void 0 === ze ? void 0 : ze.name) ? gp(He.name) : null), {}, {
phone: Ye.phone,
phoneCountry: Ye.phoneCountry,
syncAddress: r[o].form.values.syncAddress
}), Je = Object.entries(He).filter((function(e) {
var t = (0,
g.Z)(e, 2);
t[0];
return !!t[1]
}
)).map((function(e) {
var t = (0,
g.Z)(e, 2)
, n = t[0];
t[1];
return n
}
)), Xe = r[o].options, Qe = Xe.blockPoBox, $e = Xe.validation, et = Xe.display, tt = mp(We, Qe, $e, et);
return (0,
b.Z)((0,
b.Z)({}, r), {}, (0,
v.Z)({}, o, (0,
b.Z)((0,
b.Z)({}, r[o]), {}, {
form: (0,
b.Z)((0,
b.Z)({}, r[o].form), {}, {
values: We,
formattedValues: (0,
b.Z)((0,
b.Z)({}, r[o].form.formattedValues), {}, {
phone: Ye.formattedPhone
}),
showAllFields: vp(He) || r[o].form.showAllFields,
displayErrors: (0,
b.Z)((0,
b.Z)({}, (0,
O.Q8)(na, (function() {
return !1
}
))), (0,
O.sq)(Je.map((function(e) {
return [e, !0]
}
)))),
errors: tt,
shouldUpdateLocalValueFromState: (0,
b.Z)({}, (0,
O.Q8)(We, (function() {
return !0
}
)))
})
})));
case "ADDRESS.UPDATE_BILLING_DETAILS.SUCCESS":
return (0,
b.Z)((0,
b.Z)({}, r), {}, (0,
v.Z)({}, o, (0,
b.Z)((0,
b.Z)({}, r[o]), {}, {
isUpdatingSavedBillingDetails: !1,
isUpdatePending: !1,
hasConfirmFailedForView: !1
})));
case "ADDRESS.UPDATE_BILLING_DETAILS.PENDING":
return (0,
b.Z)((0,
b.Z)({}, r), {}, (0,
v.Z)({}, o, (0,
b.Z)((0,
b.Z)({}, r[o]), {}, {
isUpdatePending: !0
})));
case "ADDRESS.UPDATE_BILLING_DETAILS.ERROR":
return (0,
b.Z)((0,
b.Z)({}, r), {}, (0,
v.Z)({}, o, (0,
b.Z)((0,
b.Z)({}, r[o]), {}, {
updateError: a.error,
isUpdatePending: !1
})));
case "ADDRESS.CONFIRM_FAILED_FOR_VIEW":
return (0,
b.Z)((0,
b.Z)({}, r), {}, (0,
v.Z)({}, o, (0,
b.Z)((0,
b.Z)({}, r[o]), {}, {
hasConfirmFailedForView: !0
})));
case "ADDRESS.CONFIRM_FAILED_FOR_INTENT":
var nt = a.confirmationErrorState;
return (0,
b.Z)((0,
b.Z)({}, r), {}, (0,
v.Z)({}, o, (0,
b.Z)((0,
b.Z)({}, r[o]), {}, {
confirmationError: nt,
form: (0,
b.Z)((0,
b.Z)({}, r[o].form), {}, {
displayErrors: (0,
b.Z)((0,
b.Z)({}, r[o].form.displayErrors), {}, (0,
v.Z)({}, nt.field, !0)),
errors: (0,
b.Z)((0,
b.Z)({}, r[o].form.errors), Vd(nt))
})
})));
case "ADDRESS.CLEAR_CONFIRMATION_ERROR":
var rt = null === (n = r[o].confirmationError) || void 0 === n ? void 0 : n.field;
return (0,
b.Z)((0,
b.Z)({}, r), {}, (0,
v.Z)({}, o, (0,
b.Z)((0,
b.Z)({}, r[o]), {}, {
confirmationError: null,
form: (0,
b.Z)((0,
b.Z)({}, r[o].form), {}, {
displayErrors: (0,
b.Z)((0,
b.Z)({}, r[o].form.displayErrors), {}, (0,
v.Z)({}, rt, !1)),
errors: (0,
b.Z)((0,
b.Z)({}, r[o].form.errors), {}, (0,
v.Z)({}, rt, null))
})
})));
case "PAYMENT.CUSTOMER_SESSION_SAVED_PAYMENT.SELECTED":
return Qd((0,
b.Z)((0,
b.Z)({}, r), {}, {
billing: (0,
b.Z)((0,
b.Z)({}, r.billing), {}, {
isUpdatingSavedBillingDetails: !1
})
}), "billing", ["name", "firstName", "lastName", "organizationName", "country", "addressLine1", "addressLine2", "locality", "administrativeArea", "postalCode"]);
default:
return r
}
}
}, tp = n(56274).Promise, np = null, rp = function() {
function e() {
if ((0,
C.Z)(this, e),
Fe)
throw new Error("Only one instance of PhoneLib can be created.");
Fe = this
}
return (0,
E.Z)(e, [{
key: "initialize",
value: function() {
return np ? tp.resolve(np) : Ql().then((function(e) {
return np = e
}
))
}
}, {
key: "getPhoneNumbersModule",
value: function() {
return np
}
}]),
e
}(), ap = Object.freeze(new rp), ip = ap, op = {
name: null,
firstName: null,
lastName: null,
organizationName: null,
phone: null,
country: null,
addressLine1: null,
addressLine2: null,
locality: null,
administrativeArea: null,
postalCode: null
}, sp = function(e, t, n) {
var r = ip.getPhoneNumbersModule();
if (!r)
return !e.trim() && n ? oa("empty_phone_number") : null;
var a = r.validate(e.trim(), t);
return ("empty_phone_number" !== a || n) && a ? oa(a) : null
}, up = function(e, t) {
return (0,
O.Xy)(Xd(e).values, t)
}, lp = function(e, t) {
return t !== Bd ? null : "" === e.trim() ? oa("incomplete_name") : null
}, cp = function(e, t, n, r) {
return r !== Fd || "" !== n.trim() && "" === e && "" === t ? null : "" === e.trim() ? oa("incomplete_first_name") : null
}, dp = function(e, t, n, r) {
return r !== Fd || "" !== n.trim() && "" === e && "" === t ? null : "" === t.trim() ? oa("incomplete_last_name") : null
}, pp = function(e, t, n) {
return "organization" !== n || "" !== t.trim() ? null : "" === e.trim() ? oa("incomplete_organization_name") : null
}, mp = function(e, t, n, r, a) {
var i = (null == r ? void 0 : r.name) || Bd
, o = e.name
, s = e.firstName
, u = e.lastName
, l = e.organizationName;
return e.syncAddress ? (0,
b.Z)((0,
b.Z)({}, op), {}, {
phone: sp(e.phone || "", e.phoneCountry, cn(n))
}) : (0,
b.Z)((0,
b.Z)({
name: lp(o, i),
firstName: cp(s, u, o, i),
lastName: dp(s, u, o, i),
organizationName: pp(l, o, i),
phone: sp(e.phone || "", e.phoneCountry, cn(n))
}, sa(e, t)), Vd(a))
}, fp = function(e) {
var t, n = e.id, r = e.address, a = e.mode, i = r.name, o = r.line_1, s = r.line_2, u = r.locality, l = r.administrative_area, c = r.postal_code, d = r.country_code;
return {
id: n,
mode: a,
name: null != i ? i : "",
firstName: "",
lastName: "",
organizationName: "",
addressLine1: null != o ? o : "",
addressLine2: null != s ? s : "",
locality: null != u ? u : "",
administrativeArea: null != l ? l : "",
postalCode: null != c ? c : "",
country: null !== (t = Yt(null != d ? d : "")) && void 0 !== t ? t : "ZZ",
phone: "",
phoneCountry: "ZZ",
syncAddress: !1
}
}, hp = function(e, t) {
var n = ip.getPhoneNumbersModule();
if (n)
try {
return n.formatNational(e, t)
} catch (e) {
return ""
}
return ""
}, _p = function(e, t) {
var n = ip.getPhoneNumbersModule();
if (!n)
return {
phoneCountry: t,
formattedPhone: e
};
var r = n.getCountry(e, t);
return {
phoneCountry: r,
formattedPhone: n.formatPhoneNumber(e, r)
}
}, yp = function(e, t) {
var n = t.values.phone
, r = e.country || t.values.phoneCountry
, a = t.formattedValues.phone;
if (e.phone) {
var i = _p(e.phone, e.country || t.values.phoneCountry)
, o = i.phoneCountry
, s = i.formattedPhone;
n = s,
a = function(e, t) {
var n = ip.getPhoneNumbersModule();
if (n)
try {
return String(n.formatE164(e, t))
} catch (e) {
return ""
}
return ""
}(s, r = o)
}
return {
phone: n,
phoneCountry: r,
formattedPhone: a
}
}, vp = function(e) {
var t = Object.entries(e).filter((function(e) {
var t = (0,
g.Z)(e, 2);
t[0];
return !!t[1]
}
)).map((function(e) {
var t = (0,
g.Z)(e, 2)
, n = t[0];
t[1];
return n
}
))
, n = new Set(["name", "firstName", "lastName", "organizationName", "country", "phoneCountry", "syncAddress"]);
return t.filter((function(e) {
return !n.has(e)
}
)).length > 0
}, gp = function(e) {
var t = (e || "").split(/\s+/).filter((function(e) {
return e.length > 0
}
));
if (0 === t.length)
return {
name: "",
firstName: "",
lastName: ""
};
if (1 === t.length)
return {
name: t[0],
firstName: t[0],
lastName: ""
};
var n = t.slice(0, -1).join(" ")
, r = t.slice(-1).join(" ");
return {
name: "".concat(n, " ").concat(r),
firstName: n,
lastName: r
}
}, bp = function(e) {
return function(t) {
return t.addressElement[e].options.validation
}
}, Sp = {
redirect: !0,
polling: !0,
paymentScreens: [{
type: "cashapp",
step: "initial"
}],
alwaysCollectFullBillingAddress: !1,
alwaysCollectCountry: !1,
alwaysCollectTaxInformation: !1,
allowedCountries: ["US"],
defaultCountry: "US",
taxCountry: null,
supportsOffSession: !0,
fieldLabels: null,
nextActionQrCode: !Jr.q$,
setupFutureUsageMandateText: "upe.mandates.cashapp",
fullyLuxeDrivenSurfaces: ["payment_element", "checkout"],
type: "cashapp"
}, kp = {
polling: !1,
redirect: !0,
paymentScreens: [{
type: "south_korea_market",
step: "initial"
}],
alwaysCollectFullBillingAddress: !1,
alwaysCollectCountry: !1,
alwaysCollectTaxInformation: !1,
allowedCountries: null,
defaultCountry: "KR",
taxCountry: null,
supportsOffSession: !1,
fieldLabels: null,
type: "south_korea_market"
}, Cp = {
polling: !1,
redirect: !0,
paymentScreens: [{
type: "kr_card",
step: "initial"
}],
alwaysCollectFullBillingAddress: !1,
alwaysCollectCountry: !1,
alwaysCollectTaxInformation: !1,
allowedCountries: null,
defaultCountry: "KR",
taxCountry: null,
supportsOffSession: !0,
fieldLabels: null,
type: "kr_card",
setupFutureUsageMandateText: "upe.mandates.kr_card",
redirectMessage: "upe.redirectMessage.kr_card",
redirectMessageLinks: {
terms_link: {
url: "https://support.stripe.com/questions/nicepayments-customer-terms",
text: "upe.redirectMessage.kr_card.link_text",
linkType: "terms"
}
}
}, Ep = {
polling: !1,
redirect: !0,
paymentScreens: [{
type: "kr_market",
step: "initial"
}],
alwaysCollectFullBillingAddress: !1,
alwaysCollectCountry: !1,
alwaysCollectTaxInformation: !1,
allowedCountries: ["US"],
defaultCountry: "US",
taxCountry: "US",
supportsOffSession: !1,
fieldLabels: null,
type: "kr_market",
setupFutureUsageMandateText: "upe.mandates.kr_market"
}, Zp = {
polling: !1,
redirect: !0,
paymentScreens: [{
type: "crypto",
step: "initial"
}],
alwaysCollectFullBillingAddress: !1,
alwaysCollectCountry: !1,
alwaysCollectTaxInformation: !1,
allowedCountries: null,
defaultCountry: "US",
taxCountry: "US",
supportsOffSession: !1,
fieldLabels: null,
type: "crypto"
}, Ap = (n(85923),
n(3302),
n(87006),
n(51063),
n(32503),
n(54098),
n(8683),
n(49696),
n(88187),
n(16747),
n(21846),
n(78487),
n(15468),
n(24584),
n(66146),
n(76279),
n(58180),
n(3648),
n(51302),
n(874),
n(41359),
n(36248),
n(97185),
n(73149),
n(52801),
n(70224),
n(34237),
n(66485),
n(42844),
n(39028),
n(59329),
n(99213),
n(47809),
n(95987),
n(66323),
n(56909),
n(9232),
n(32230),
n(70784),
n(17349),
n(46262),
n(22408),
n(51959),
n(27525),
n(79695),
n(59539),
n(28824),
n(27564),
n(53691),
n(58828),
n(60804),
n(60341),
n(98685),
n(5550),
n(33179),
n(56317),
n(80527),
n(53226),
n(85584),
n(74953),
n(33536),
n(52029),
n(43650),
n(65761),
n(39830),
n(44109),
n(232),
n(23459),
n(51304),
n(38305),
n(56544),
n(53005),
n(61287),
n(75447),
n(5970),
n(6549),
(0,
b.Z)((0,
b.Z)({}, z.y.clientSpecsByType), {}, {
paypal: {
polling: !1,
redirect: !0,
paymentScreens: [{
type: "paypal",
step: "initial"
}],
alwaysCollectFullBillingAddress: !1,
alwaysCollectCountry: !1,
alwaysCollectTaxInformation: !1,
allowedCountries: null,
defaultCountry: null,
taxCountry: null,
supportsOffSession: !1,
fieldLabels: null,
fields: [],
type: "paypal",
setupFutureUsageMandateText: "upe.mandates.paypal"
},
giropay: {
polling: !1,
redirect: !0,
paymentScreens: [{
type: "giropay",
step: "initial"
}],
alwaysCollectFullBillingAddress: !1,
alwaysCollectCountry: !1,
alwaysCollectTaxInformation: !0,
allowedCountries: null,
defaultCountry: null,
taxCountry: "DE",
supportsOffSession: !1,
fieldLabels: null,
type: "giropay"
},
alipay: {
polling: !1,
redirect: !0,
paymentScreens: [{
type: "alipay",
step: "initial"
}],
alwaysCollectFullBillingAddress: !1,
alwaysCollectCountry: !1,
alwaysCollectTaxInformation: !1,
allowedCountries: null,
defaultCountry: null,
taxCountry: null,
supportsOffSession: !1,
fieldLabels: null,
type: "alipay"
},
grabpay: {
polling: !1,
redirect: !0,
paymentScreens: [{
type: "grabpay",
step: "initial"
}],
alwaysCollectFullBillingAddress: !1,
alwaysCollectCountry: !1,
alwaysCollectTaxInformation: !1,
allowedCountries: null,
defaultCountry: null,
taxCountry: null,
supportsOffSession: !1,
fieldLabels: null,
type: "grabpay"
},
mobilepay: {
polling: !1,
redirect: !0,
paymentScreens: [{
type: "mobilepay",
step: "initial"
}],
alwaysCollectFullBillingAddress: !1,
alwaysCollectCountry: !1,
alwaysCollectTaxInformation: !0,
allowedCountries: ["DK", "FI"],
defaultCountry: "DK",
taxCountry: "DK",
supportsOffSession: !1,
fieldLabels: null,
type: "mobilepay"
},
multibanco: {
polling: !1,
redirect: !1,
paymentScreens: [{
type: "multibanco",
step: "initial"
}],
alwaysCollectFullBillingAddress: !1,
alwaysCollectCountry: !1,
alwaysCollectTaxInformation: !1,
allowedCountries: null,
defaultCountry: null,
taxCountry: null,
supportsOffSession: !1,
fieldLabels: null,
type: "multibanco"
},
oxxo: {
polling: !1,
redirect: !1,
paymentScreens: [{
type: "oxxo",
step: "initial"
}],
alwaysCollectFullBillingAddress: !1,
alwaysCollectCountry: !1,
alwaysCollectTaxInformation: !1,
allowedCountries: ["MX"],
defaultCountry: "MX",
taxCountry: null,
supportsOffSession: !1,
fieldLabels: {
name: "payment.oxxo.label.billing_name"
},
type: "oxxo"
},
pay_by_bank: {
polling: !1,
redirect: !0,
paymentScreens: [{
type: "pay_by_bank",
step: "initial"
}],
alwaysCollectFullBillingAddress: !1,
alwaysCollectCountry: !1,
alwaysCollectTaxInformation: !0,
allowedCountries: ["GB"],
defaultCountry: "GB",
taxCountry: "GB",
supportsOffSession: !1,
fieldLabels: null,
fullyLuxeDrivenSurfaces: ["checkout"],
redirectMessage: "upe.pay_by_bank.redirect_text",
type: "pay_by_bank"
},
paynow: {
redirect: !1,
polling: !0,
paymentScreens: [{
type: "paynow",
step: "initial"
}],
alwaysCollectFullBillingAddress: !1,
alwaysCollectCountry: !1,
alwaysCollectTaxInformation: !1,
allowedCountries: null,
defaultCountry: "SG",
taxCountry: null,
supportsOffSession: !1,
fieldLabels: null,
nextActionQrCode: !0,
type: "paynow"
},
promptpay: {
redirect: !1,
polling: !0,
paymentScreens: [{
type: "promptpay",
step: "initial"
}],
alwaysCollectFullBillingAddress: !1,
alwaysCollectCountry: !1,
alwaysCollectTaxInformation: !1,
allowedCountries: null,
defaultCountry: "TH",
taxCountry: null,
supportsOffSession: !1,
fieldLabels: null,
nextActionQrCode: !0,
type: "promptpay"
},
demo_pay: {
polling: !1,
redirect: !0,
paymentScreens: [{
type: "demo_pay",
step: "initial"
}],
alwaysCollectFullBillingAddress: !1,
alwaysCollectCountry: !1,
alwaysCollectTaxInformation: !1,
allowedCountries: ["GB", "US"],
defaultCountry: "GB",
taxCountry: "GB",
supportsOffSession: !0,
fieldLabels: null,
type: "demo_pay",
setupFutureUsageMandateText: "upe.mandates.demo_pay",
fullyLuxeDrivenSurfaces: ["checkout", "payment_element"]
},
revolut_pay: {
polling: !1,
redirect: !0,
paymentScreens: [{
type: "revolut_pay",
step: "initial"
}],
alwaysCollectFullBillingAddress: !1,
alwaysCollectCountry: !1,
alwaysCollectTaxInformation: !1,
allowedCountries: null,
defaultCountry: "GB",
taxCountry: "GB",
supportsOffSession: !0,
fieldLabels: null,
type: "revolut_pay",
setupFutureUsageMandateText: "upe.mandates.revolut_pay"
},
gopay: {
polling: !1,
redirect: !0,
paymentScreens: [{
type: "gopay",
step: "initial"
}],
alwaysCollectFullBillingAddress: !1,
alwaysCollectCountry: !1,
alwaysCollectTaxInformation: !1,
allowedCountries: ["US", "ID"],
defaultCountry: "US",
taxCountry: "US",
supportsOffSession: !1,
fieldLabels: null,
type: "gopay"
},
shopeepay: {
polling: !1,
redirect: !0,
paymentScreens: [{
type: "shopeepay",
step: "initial"
}],
alwaysCollectFullBillingAddress: !1,
alwaysCollectCountry: !1,
alwaysCollectTaxInformation: !1,
allowedCountries: ["US", "ID"],
defaultCountry: "US",
taxCountry: "US",
supportsOffSession: !1,
fieldLabels: null,
type: "shopeepay"
},
qris: {
polling: !1,
redirect: !0,
paymentScreens: [{
type: "qris",
step: "initial"
}],
alwaysCollectFullBillingAddress: !1,
alwaysCollectCountry: !1,
alwaysCollectTaxInformation: !1,
allowedCountries: ["US", "ID"],
defaultCountry: "US",
taxCountry: "US",
supportsOffSession: !1,
fieldLabels: null,
type: "qris"
},
sunbit: {
polling: !1,
redirect: !0,
paymentScreens: [{
type: "sunbit",
step: "initial"
}],
alwaysCollectFullBillingAddress: !1,
alwaysCollectCountry: !1,
alwaysCollectTaxInformation: !1,
allowedCountries: null,
defaultCountry: "US",
taxCountry: "US",
supportsOffSession: !1,
fieldLabels: null,
type: "sunbit"
},
satispay: {
polling: !1,
redirect: !0,
paymentScreens: [{
type: "satispay",
step: "initial"
}],
alwaysCollectFullBillingAddress: !1,
alwaysCollectCountry: !1,
alwaysCollectTaxInformation: !1,
allowedCountries: null,
defaultCountry: "IT",
taxCountry: null,
supportsOffSession: !1,
fieldLabels: null,
type: "satispay"
},
wechat_pay: {
redirect: !1,
polling: !0,
paymentScreens: [{
type: "wechat_pay",
step: "initial"
}],
alwaysCollectFullBillingAddress: !1,
alwaysCollectCountry: !1,
alwaysCollectTaxInformation: !1,
allowedCountries: null,
defaultCountry: null,
taxCountry: null,
supportsOffSession: !1,
fieldLabels: null,
nextActionQrCode: !0,
type: "wechat_pay"
},
customer_balance: {
polling: !1,
redirect: !1,
paymentScreens: [{
type: "customer_balance",
step: "initial"
}],
alwaysCollectFullBillingAddress: !1,
alwaysCollectCountry: !1,
alwaysCollectTaxInformation: !1,
allowedCountries: null,
defaultCountry: null,
taxCountry: null,
supportsOffSession: !1,
fieldLabels: null,
type: "customer_balance",
nextActionHostedInstructions: !0,
fields: []
},
eps: {
polling: !1,
redirect: !0,
paymentScreens: [{
type: "eps",
step: "initial"
}],
alwaysCollectFullBillingAddress: !1,
alwaysCollectCountry: !1,
alwaysCollectTaxInformation: !0,
allowedCountries: null,
defaultCountry: null,
taxCountry: "AT",
supportsOffSession: !1,
fieldLabels: {
bank: "payment.eps.label.bank"
},
type: "eps"
},
p24: {
polling: !1,
redirect: !0,
paymentScreens: [{
type: "p24",
step: "initial"
}],
alwaysCollectFullBillingAddress: !1,
alwaysCollectCountry: !1,
alwaysCollectTaxInformation: !0,
allowedCountries: null,
defaultCountry: null,
taxCountry: "PL",
supportsOffSession: !1,
fieldLabels: {
bank: "payment.p24.label.bank"
},
type: "p24"
},
zip: {
polling: !1,
redirect: !0,
paymentScreens: [{
type: "zip",
step: "initial"
}],
alwaysCollectFullBillingAddress: !1,
alwaysCollectCountry: !0,
alwaysCollectTaxInformation: !1,
allowedCountries: ["AU", "US"],
defaultCountry: "AU",
taxCountry: null,
supportsOffSession: !1,
fieldLabels: null,
type: "zip"
},
south_korea_market: kp,
kr_card: Cp,
kr_market: Ep,
amazon_pay: {
polling: !1,
redirect: !0,
paymentScreens: [{
type: "amazon_pay",
step: "initial"
}],
alwaysCollectFullBillingAddress: !1,
alwaysCollectCountry: !1,
alwaysCollectTaxInformation: !1,
allowedCountries: null,
defaultCountry: "US",
taxCountry: "US",
supportsOffSession: !1,
fieldLabels: null,
type: "amazon_pay",
setupFutureUsageMandateText: "upe.mandates.amazon_pay"
},
alma: {
polling: !1,
redirect: !0,
paymentScreens: [{
type: "alma",
step: "initial"
}],
alwaysCollectFullBillingAddress: !1,
alwaysCollectCountry: !1,
alwaysCollectTaxInformation: !1,
allowedCountries: null,
defaultCountry: "FR",
taxCountry: "FR",
supportsOffSession: !1,
fieldLabels: null,
type: "alma",
redirectMessage: "upe.alma.redirect_text"
},
ng_market: {
polling: !1,
redirect: !0,
paymentScreens: [{
type: "ng_market",
step: "initial"
}],
alwaysCollectFullBillingAddress: !1,
alwaysCollectCountry: !1,
alwaysCollectTaxInformation: !1,
allowedCountries: ["US"],
defaultCountry: "US",
taxCountry: "US",
supportsOffSession: !1,
fieldLabels: null,
type: "ng_market"
},
twint: {
polling: !1,
redirect: !0,
paymentScreens: [{
type: "twint",
step: "initial"
}],
alwaysCollectFullBillingAddress: !1,
alwaysCollectCountry: !1,
alwaysCollectTaxInformation: !0,
allowedCountries: null,
defaultCountry: "CH",
taxCountry: "CH",
supportsOffSession: !1,
fieldLabels: null,
type: "twint"
},
crypto: Zp,
cashapp: Sp,
kakao_pay: {
polling: !1,
redirect: !0,
paymentScreens: [{
type: "kakao_pay",
step: "initial"
}],
alwaysCollectFullBillingAddress: !1,
alwaysCollectCountry: !1,
alwaysCollectTaxInformation: !1,
allowedCountries: null,
defaultCountry: "KR",
taxCountry: null,
supportsOffSession: !0,
fieldLabels: null,
fields: [{
type: "email",
api_path: {
v1: "billing_details[email]"
}
}],
type: "kakao_pay",
setupFutureUsageMandateText: "upe.mandates.kakao_pay",
hidePaymentMethodDescription: !0,
redirectMessage: "upe.redirectMessage.kakao_pay",
redirectMessageLinks: {
terms_link: {
url: "https://support.stripe.com/questions/nicepayments-customer-terms",
text: "upe.redirectMessage.kakao_pay.link_text",
linkType: "terms"
}
}
},
naver_pay: {
polling: !1,
redirect: !0,
paymentScreens: [{
type: "naver_pay",
step: "initial"
}],
alwaysCollectFullBillingAddress: !1,
alwaysCollectCountry: !1,
alwaysCollectTaxInformation: !1,
allowedCountries: null,
defaultCountry: "KR",
taxCountry: null,
supportsOffSession: !0,
fieldLabels: null,
fields: [{
type: "selector",
translation_id: "luxe.naver_pay.selector.label.funding",
items: [{
display_text: "Naver card",
translation_id: "luxe.naver_pay.selector.funding.item.card",
api_value: "card"
}, {
display_text: "Naver points",
translation_id: "luxe.naver_pay.selector.funding.item.point",
api_value: "points"
}],
api_path: {
v1: "naver_pay[funding]"
}
}],
type: "naver_pay",
setupFutureUsageMandateText: "upe.mandates.naver_pay",
hidePaymentMethodDescription: !0,
redirectMessage: "upe.redirectMessage.naver_pay",
redirectMessageLinks: {
terms_link: {
url: "https://support.stripe.com/questions/nicepayments-customer-terms",
text: "upe.redirectMessage.naver_pay.link_text",
linkType: "terms"
}
}
},
payco: {
polling: !1,
redirect: !0,
paymentScreens: [{
type: "payco",
step: "initial"
}],
alwaysCollectFullBillingAddress: !1,
alwaysCollectCountry: !1,
alwaysCollectTaxInformation: !1,
allowedCountries: null,
defaultCountry: "KR",
taxCountry: null,
supportsOffSession: !1,
fieldLabels: null,
type: "payco",
hidePaymentMethodDescription: !0,
redirectMessage: "upe.redirectMessage.payco",
redirectMessageLinks: {
terms_link: {
url: "https://support.stripe.com/questions/nicepayments-customer-terms",
text: "upe.redirectMessage.payco.link_text",
linkType: "terms"
}
}
},
samsung_pay: {
polling: !1,
redirect: !0,
paymentScreens: [{
type: "samsung_pay",
step: "initial"
}],
alwaysCollectFullBillingAddress: !1,
alwaysCollectCountry: !1,
alwaysCollectTaxInformation: !1,
allowedCountries: null,
defaultCountry: "US",
taxCountry: null,
supportsOffSession: !1,
fieldLabels: null,
type: "samsung_pay",
hidePaymentMethodDescription: !0,
redirectMessage: "upe.redirectMessage.samsung_pay",
redirectMessageLinks: {
terms_link: {
url: "https://support.stripe.com/questions/nicepayments-customer-terms",
text: "upe.redirectMessage.samsung_pay.link_text",
linkType: "terms"
}
}
},
ng_bank: {
polling: !1,
redirect: !0,
paymentScreens: [{
type: "ng_bank",
step: "initial"
}],
alwaysCollectFullBillingAddress: !1,
alwaysCollectCountry: !1,
alwaysCollectTaxInformation: !1,
allowedCountries: null,
defaultCountry: "NG",
taxCountry: "NG",
supportsOffSession: !1,
fieldLabels: null,
type: "ng_bank",
redirectMessage: "upe.redirectMessage.nigeria_paystack",
redirectMessageLinks: {
terms_link: {
url: "https://d37ugbyn3rpeym.cloudfront.net/docs/GSSL%20-%20Buyer%20T&Cs%20(Final).pdf",
text: "upe.redirectMessage.nigeria_paystack.link_text",
linkType: "terms"
}
}
},
ng_bank_transfer: {
polling: !1,
redirect: !0,
paymentScreens: [{
type: "ng_bank_transfer",
step: "initial"
}],
alwaysCollectFullBillingAddress: !1,
alwaysCollectCountry: !1,
alwaysCollectTaxInformation: !1,
allowedCountries: null,
defaultCountry: "NG",
taxCountry: "NG",
supportsOffSession: !1,
fieldLabels: null,
type: "ng_bank_transfer",
redirectMessage: "upe.redirectMessage.nigeria_paystack",
redirectMessageLinks: {
terms_link: {
url: "https://d37ugbyn3rpeym.cloudfront.net/docs/GSSL%20-%20Buyer%20T&Cs%20(Final).pdf",
text: "upe.redirectMessage.nigeria_paystack.link_text",
linkType: "terms"
}
}
},
ng_card: {
polling: !1,
redirect: !0,
paymentScreens: [{
type: "ng_card",
step: "initial"
}],
alwaysCollectFullBillingAddress: !1,
alwaysCollectCountry: !1,
alwaysCollectTaxInformation: !1,
allowedCountries: null,
defaultCountry: "NG",
taxCountry: "NG",
supportsOffSession: !1,
fieldLabels: null,
type: "ng_card",
redirectMessage: "upe.redirectMessage.nigeria_paystack",
redirectMessageLinks: {
terms_link: {
url: "https://d37ugbyn3rpeym.cloudfront.net/docs/GSSL%20-%20Buyer%20T&Cs%20(Final).pdf",
text: "upe.redirectMessage.nigeria_paystack.link_text",
linkType: "terms"
}
}
},
ng_ussd: {
polling: !1,
redirect: !0,
paymentScreens: [{
type: "ng_ussd",
step: "initial"
}],
alwaysCollectFullBillingAddress: !1,
alwaysCollectCountry: !1,
alwaysCollectTaxInformation: !1,
allowedCountries: null,
defaultCountry: "NG",
taxCountry: "NG",
supportsOffSession: !1,
fieldLabels: null,
type: "ng_ussd",
redirectMessage: "upe.redirectMessage.nigeria_paystack",
redirectMessageLinks: {
terms_link: {
url: "https://d37ugbyn3rpeym.cloudfront.net/docs/GSSL%20-%20Buyer%20T&Cs%20(Final).pdf",
text: "upe.redirectMessage.nigeria_paystack.link_text",
linkType: "terms"
}
}
}
})), Mp = function() {
return Ap
}, Pp = "US", xp = {
email: "",
name: ""
}, Ip = {
savePayment: void 0,
setAsDefaultSavedPayment: void 0
}, Np = {
bank: "",
linkAutofillPromptOptIn: !1,
linkEmail: "",
linkLegalName: ""
}, wp = {
affirm: Object.freeze({}),
afterpay_clearpay: (0,
b.Z)({
name: "",
email: "",
shippingAsBilling: !0
}, na),
acss_debit: {
name: "",
email: ""
},
au_becs_debit: {
auBankAccountNumber: "",
auBsb: "",
email: "",
name: ""
},
bacs_debit: (0,
b.Z)({
name: "",
email: "",
sortCode: "",
accountNumber: "",
shippingAsBilling: !0,
termsConfirmation: !1
}, na),
bancontact: (0,
b.Z)({
name: "",
email: ""
}, Ip),
boleto: (0,
b.Z)({
name: "",
email: "",
taxId: "",
shippingAsBilling: !0
}, na),
card: (0,
b.Z)((0,
b.Z)({
number: "",
expiry: "",
cvc: "",
country: Pp,
postalCode: "",
linkOptIn: !1,
linkOptInIsVisibleFromFormChange: !1,
linkOptInTouched: !1,
linkOptInDefaultsNonUS: !1,
linkAutofillPromptOptIn: !1,
linkEmail: "",
linkLegalName: "",
linkMobilePhone: "",
linkDefaultFormattedMobilePhone: "",
linkDefaultFormattedMobilePhoneCountry: "",
linkMobilePhoneCountry: "US",
linkEmailOtpVerificationPhone: "",
linkEmailOtpVerificationPhoneCountry: "US",
shippingAsBilling: !0,
installmentPlan: null
}, Ip), {}, {
network: "unknown",
nickname: void 0
}),
fpx: {
accountHolderType: "individual",
bank: "maybank2u"
},
id_bank_transfer: Object.freeze({
bank: "",
name: "",
email: ""
}),
ideal: (0,
b.Z)({
email: "",
name: ""
}, Ip),
konbini: {
email: "",
name: "",
phoneNumber: ""
},
mb_way: {
phoneNumber: "",
phoneCountry: "PT"
},
nz_bank_account: {
email: "",
name: "",
accountHolderName: "",
bankName: "",
accountNumber: "",
mandateAuthority: !1,
mandateSignature: !1
},
p24: {
bank: "alior_bank",
email: "",
name: ""
},
pix: (0,
b.Z)({
name: "",
email: "",
taxId: ""
}, na),
blik: {
email: "",
code: ""
},
saved: (0,
b.Z)((0,
b.Z)({
name: "",
email: "",
number: "",
expiry: "",
cvc: "",
country: Pp,
postalCode: ""
}, Ip), {}, {
shippingAsBilling: !1,
network: "unknown"
}),
sepa_debit: (0,
b.Z)((0,
b.Z)({
name: "",
email: "",
iban: "",
shippingAsBilling: !0
}, na), Ip),
sofort: (0,
b.Z)({
country: "AT",
name: "",
email: ""
}, Ip),
link: (0,
b.Z)({}, Np),
link_card_brand: (0,
b.Z)({}, Np),
us_bank_account: {
name: "",
email: "",
bank: "",
accountHolderType: "personal",
accountType: "checking",
routingNumber: "",
accountNumber: "",
confirmAccountNumber: "",
linkLegalName: ""
},
upi: {
vpa: ""
},
payto: {
name: "",
email: "",
payId: "",
accountNumber: "",
bsbNumber: "",
usePayId: !1
},
rechnung: (0,
b.Z)((0,
b.Z)({
email: "",
name: "",
birthdate: ""
}, na), {}, {
phoneNumber: "",
phoneCountry: "",
shippingAsBilling: !0
}),
klarna: {
email: "",
name: "",
country: ""
},
apple_pay: Object.freeze({}),
google_pay: Object.freeze({}),
cashapp: Object.freeze({})
}, Tp = function(e, t) {
return n = e,
void 0 !== Mp()[n] ? function(e, t) {
var n, r, a = (0,
O.sE)(null !== (n = null == t ? void 0 : t.paymentMethodSpecs) && void 0 !== n ? n : [], (function(t) {
return t.type === e
}
)), i = (0,
O.sE)(null !== (r = null == a ? void 0 : a.fields) && void 0 !== r ? r : [], (function(e) {
return "selector" === e.type
}
)), o = "selector" === (null == i ? void 0 : i.type) && i.items.length ? i.items[0].api_value : void 0;
return (0,
b.Z)((0,
b.Z)({}, xp), {}, {
bank: o
})
}(e, t) : wp[e];
var n
}, Op = {
cad: ["CA"],
eur: ["AT", "FI", "DE", "NL", "BE", "ES", "IE", "IT", "FR", "PT", "GR"],
chf: ["CH"],
dkk: ["DK"],
nok: ["NO"],
sek: ["SE"],
gbp: ["GB"],
usd: ["US"],
aud: ["AU"],
nzd: ["NZ"],
czk: ["CZ"],
pln: ["PL"],
ron: ["RO"]
}, Rp = function(e) {
return t = e,
n = Up,
(0,
O.sE)(Object.keys(n), (function(e) {
return -1 !== n[e].indexOf(t)
}
));
var t, n
}, Lp = function(e) {
var t = Rp(e);
if (!t)
return [];
var n = Dp[t];
return n || []
}, Dp = {
US: ["US"],
CA: ["CA"],
EU: ["AT", "FI", "DE", "NL", "BE", "ES", "IE", "IT", "FR", "PT", "GR", "CH", "NO", "SE", "GB", "CZ", "PL", "RO"],
AU: ["AU"],
NZ: ["NZ"]
}, Up = {
US: ["US"],
CA: ["CA"],
EU: ["AT", "FI", "DE", "NL", "BE", "ES", "IE", "IT", "FR", "PT", "GR", "CH", "NO", "SE", "GB", "CZ", "PL", "EE", "LV", "LT", "SK", "SI", "LU", "CY", "MT", "HR", "RO"],
AU: ["AU"],
NZ: ["NZ"]
}, jp = {
AT: "AT",
CA: "CA",
CH: "CH",
AU: "AU",
FI: "FI",
DE: "DE",
NL: "NL",
BE: "BE",
ES: "ES",
FR: "FR",
IE: "IE",
IT: "IT",
DK: "DK",
NO: "NO",
NZ: "NZ",
SE: "SE",
GB: "GB",
US: "US",
CZ: "CZ",
PT: "PT",
PL: "PL",
GR: "GR",
RO: "RO"
}, Bp = ["AT", "BE", "CA", "CH", "CZ", "DE", "DK", "ES", "FI", "FR", "GB", "GR", "IE", "IT", "NL", "NO", "PL", "PT", "SE", "US"], Fp = function(e) {
var t = {}
, n = e.address
, r = n.city
, a = n.country
, i = n.line1
, o = n.line2
, s = n.postal_code
, u = n.state
, l = e.name;
e.phone;
return r && (t.locality = r),
u && (t.administrative_area = u),
i && (t.line_1 = i),
o && (t.line_2 = o),
s && (t.postal_code = s),
a && (t.country_code = a),
l && (t.name = l),
t
}, Gp = function(e) {
return function(t, n) {
if (e === Ud)
return Pc(t).map((function(e) {
var t, n, r, a, i = e.paymentMethod;
return {
id: i.id,
mode: "customer",
address: (t = i.billing_details,
n = t.phone,
r = t.name,
a = t.address,
{
administrative_area: (null == a ? void 0 : a.state) || void 0,
country_code: (null == a ? void 0 : a.country) || void 0,
line_1: (null == a ? void 0 : a.line1) || void 0,
line_2: (null == a ? void 0 : a.line2) || void 0,
locality: (null == a ? void 0 : a.city) || void 0,
postal_code: (null == a ? void 0 : a.postal_code) || void 0,
phone: n || void 0,
name: r || void 0
})
}
}
)) || [];
var r = function(e) {
var t;
return null === (t = e.consumer.consumerSession) || void 0 === t ? void 0 : t.unredacted_phone_number
}(t)
, a = function(e) {
var t;
return Yt(null === (t = e.consumer.consumerSession) || void 0 === t ? void 0 : t.phone_number_country)
}(t)
, i = "";
if (r && a) {
var o = _p(r, a).phoneCountry;
i = hp(r, o)
}
var s = $c(t).map((function(e) {
var t = e.id
, n = e.address;
return {
mode: "consumer",
id: t,
address: (0,
b.Z)((0,
b.Z)({}, n), {}, {
phone: n.phone || i,
phone_country: n.phone_country || a || void 0
})
}
}
));
if (_m(e)(t))
return s;
var u = za(t).map((function(e) {
return {
mode: "customer",
id: Hd,
address: Fp(e)
}
}
))
, l = function(e, t) {
var n = "oneclick" === fd(t);
return e.filter((function() {
return !n
}
))
}(s, t);
return [].concat((0,
Z.Z)(n ? s : l), (0,
Z.Z)(u))
}
}, qp = function(e) {
return function(t) {
var n, r = null === (n = t.addressElement[e].selectedSavedAddress) || void 0 === n ? void 0 : n.id, a = Zc(t);
return "billing" === e ? (null == a ? void 0 : a.id) || r || null : r || null
}
}, Kp = function(e) {
return function(t) {
var n;
return (null === (n = t.addressElement[e].selectedSavedAddress) || void 0 === n ? void 0 : n.id) === Yd
}
}, Vp = function(e) {
return function(t) {
var n;
return (null === (n = t.addressElement[e].removingSavedAddress) || void 0 === n ? void 0 : n.id) || null
}
}, zp = function(e) {
return function(t) {
return !!t.addressElement[e].selectedSavedAddress
}
}, Hp = function(e) {
return function(t) {
return t.addressElement[e].isAddingSavedAddress
}
}, Yp = function(e) {
return function(t) {
var n = function(e) {
return function(t) {
return t.addressElement[e].options.allowedCountries
}
}(e)(t)
, r = ym(e)(t)
, a = function(e, t, n) {
var r = {
allowed: [],
disallowed: []
};
return e.forEach((function(e) {
var a = e.address;
Pd(a, t, n) ? r.allowed.push(e) : r.disallowed.push(e)
}
)),
r
}(Gp(e)(t), n, r)
, i = a.allowed
, o = a.disallowed
, s = fm(e)(t) || []
, u = hm(e)(t) || [];
return {
allowed: i.concat(s),
disallowed: o.concat(u)
}
}
}, Wp = function(e) {
var t, n, r = null === (t = e.config.mounted.address) || void 0 === t ? void 0 : t.mode, a = !!e.config.mounted.payment, i = e.paymentElement.selectedPaymentForm;
if (null == r || !r.billing || !a || "saved" !== i)
return !1;
var o, s, u, l, c, d = (null === (n = Zc(e)) || void 0 === n ? void 0 : n.billing_details) || {}, p = function(e) {
var t = e.name
, n = e.address
, r = void 0 === n ? {} : n
, a = e.phone
, i = r
, o = i.line1
, s = i.line2
, u = i.city
, l = i.state
, c = i.postal_code
, d = i.country
, p = Yt(d || "") || "US";
return (0,
O.VJ)({
name: null != t ? t : "",
addressLine1: null != o ? o : "",
addressLine2: null != s ? s : "",
locality: null != u ? u : "",
administrativeArea: null != l ? l : "",
postalCode: null != c ? c : "",
country: p,
phone: null != a ? a : ""
})
}({
address: (null == d ? void 0 : d.address) || {},
name: d.name,
phone: d.phone
});
return o = (0,
b.Z)((0,
b.Z)({}, p), {}, {
firstName: "",
lastName: "",
organizationName: "",
phoneCountry: _p(d.phone || "", p.country).phoneCountry,
syncAddress: !1
}),
s = ym(Ud)(e),
u = bp(Ud)(e),
l = vm(Ud)(e),
c = mp(o, s, u, l),
!!(0,
O.VO)(c).every((function(e) {
return null === e
}
))
}, Jp = function(e) {
return function(t) {
if (!Ga(t))
return !1;
var n = Cm(e)(t)
, r = n.allowedCountries
, a = n.blockPoBox
, i = $p(e)
, o = Cm(i)(t)
, s = o.allowedCountries;
if (!o.blockPoBox && a)
return !1;
if (r) {
if (!s)
return !1;
if (s.length > r.length)
return !1;
var u = new Set(r);
if (!s.every((function(e) {
return u.has(e)
}
)))
return !1
}
return !t.config.syncAddressCheckbox && e === Ud || t.config.syncAddressCheckbox === e
}
}, Xp = function(e) {
return function(t) {
return tm(e, "syncAddress")(t) && Ga(t)
}
}, Qp = function(e) {
return function(t) {
var n = $p(e);
return Xp(e)(t) && Jp(e)(t) ? n : e
}
}, $p = function(e) {
return e === Dd ? Ud : Dd
}, em = function(e) {
return function(t) {
var n = za(t).length > 0
, r = _m(e)(t)
, a = Wp(t);
if (!(t.consumer.loaded || n || r || a))
return !0;
var i = Hp(e)(t);
return !zp(e)(t) || i || Kp(e)(t) && "details" === dm(e)(t)
}
}, tm = function(e, t) {
return function(n) {
return n.addressElement[e].form.values[t]
}
}, nm = (0,
x.qe)((function(e, t) {
return e.addressElement[t].form.values
}
)), rm = function(e) {
return function(t) {
return t.addressElement[e].form.errors
}
}, am = (0,
x.qe)((function(e, t) {
return e.addressElement[t].form.formattedValues
}
)), im = ["id", "mode"], om = function(e) {
return function(t) {
var n = qp(e)(t)
, r = function(e) {
return function(t) {
return Yp(e)(t).allowed
}
}(e)(t)
, a = (0,
O.sE)(r, (function(e) {
return e.id === n
}
));
if (!a)
throw new Error("Could not find expected shipping address by id.");
var i = fp(a)
, o = (i.id,
i.mode,
(0,
h.Z)(i, im))
, s = function(e, t) {
return function(n) {
return n.addressElement[e].form.formattedValues[t]
}
}(e, "phone")(t)
, u = nm(t, e).phoneCountry;
return o.phone = s,
o.phoneCountry = u,
o
}
}, sm = function(e, t) {
if (t === Dd && !Ba(e) || t === Ud && !Fa(e))
return null;
var n = lm(t)(e)
, r = n.addressLine1
, a = n.addressLine2
, i = n.locality
, o = n.administrativeArea
, s = n.postalCode
, u = n.country
, l = n.name
, c = n.phone;
return {
name: l,
address: ea({
addressLine1: r,
addressLine2: a,
locality: i,
administrativeArea: o,
postalCode: s,
country: u
}),
phone: c
}
}, um = function(e, t, n) {
var r;
return t === Dd && !Ba(e) || t === Ud && !Fa(e) ? null : function(e) {
return function(t) {
var n = $p(e);
return mm(e)(t) && (!mm(n)(t) || mm(n)(t) && !km(n)(t) && (km(e)(t) || "saved" === dm(n)(t))) && Jp(e)(t) && Xp(e)(t)
}
}(t)(e) ? null === (r = sm(e, t)) || void 0 === r ? void 0 : r.phone : n
}, lm = function(e) {
return function(t) {
return em(e)(t) ? (0,
b.Z)((0,
b.Z)({}, nm(t, e)), am(t, e)) : om(e)(t)
}
}, cm = function(e) {
var t, n = null === (t = ja(e).address) || void 0 === t ? void 0 : t.mode;
if (!n)
return null;
var r = Object.keys(n).filter((function(e) {
return n[e]
}
))
, a = null;
return r.forEach((function(t) {
var n = rm(t)(e)
, r = Object.keys(n).map((function(e) {
return n[e]
}
)).filter((function(e) {
return !!e
}
))
, i = !em(t)(e)
, o = Jp(Ud)(e) && Xp(Ud)(e);
i ? n.phone && (a = (0,
b.Z)((0,
b.Z)({}, a), {}, (0,
v.Z)({}, t, n.phone))) : r.length ? a = (0,
b.Z)((0,
b.Z)({}, a), {}, (0,
v.Z)({}, t, r[0])) : !o && Kp(t)(e) && "saved" === ya(e) && "details" === dm(t)(e) && (a = (0,
b.Z)((0,
b.Z)({}, a), {}, (0,
v.Z)({}, t, oa("invalid_address_view.update"))))
}
)),
a
}, dm = function(e) {
return function(t) {
var n = Wp(t);
if (!(od(t) || function(e) {
return za(e).length > 0
}(t) || _m(e)(t) || n))
return "details";
if (Vp(e)(t))
return "remove";
var r = Hp(e)(t)
, a = zp(e)(t)
, i = function(e) {
return function(t) {
return t.addressElement[e].isUpdatingSavedBillingDetails
}
}(e)(t)
, o = Kp(e)(t) && !n;
return !a || r || i || o ? "details" : "saved"
}
}, pm = ((0,
x.qe)((function(e, t) {
var n = e.addressElement[t]
, r = n.form
, a = (n.options.blockPoBox,
r.displayErrors)
, i = rm(t)(e);
return Object.keys(i).reduce((function(e, t) {
var n = i[t];
return n && a[t] ? (0,
b.Z)((0,
b.Z)({}, e), {}, (0,
v.Z)({}, t, B[n.code])) : (0,
b.Z)((0,
b.Z)({}, e), {}, (0,
v.Z)({}, t, null))
}
), {})
}
)),
function(e) {
return function(t) {
return t.addressElement[e].options.fields
}
}
), mm = function(e) {
return function(t) {
var n;
return "always" === (null === (n = pm(e)(t)) || void 0 === n ? void 0 : n.phone)
}
}, fm = function(e) {
return function(t) {
var n = t.addressElement[e].options.contacts;
return n ? n.allowed : null
}
}, hm = function(e) {
return function(t) {
var n = t.addressElement[e].options.contacts;
return n ? n.disallowed : null
}
}, _m = function(e) {
return function(t) {
var n = t.addressElement[e].options.contacts;
return null !== n && 0 !== n.allowed.length
}
}, ym = function(e) {
return function(t) {
return t.addressElement[e].options.blockPoBox
}
}, vm = function(e) {
return function(t) {
return t.addressElement[e].options.display
}
}, gm = ["mb_way"], bm = function(e) {
return function(t) {
var n;
return "always" === (null === (n = pm(e)(t)) || void 0 === n ? void 0 : n.phone)
}
}, Sm = function(e) {
return function(t) {
var n, r;
return "always" === (null === (n = t.addressElement[e].options.validation) || void 0 === n || null === (r = n.phone) || void 0 === r ? void 0 : r.required)
}
}, km = function(e) {
return function(t) {
if ("billing" !== e)
return Sm(e)(t);
var n = function(e) {
return function(t) {
var n;
return "never" === (null === (n = pm(e)(t)) || void 0 === n ? void 0 : n.phone)
}
}(e)(t);
if (n)
return !1;
if (Sm(e)(t))
return !0;
var r = function(e) {
return function(t) {
var n, r;
return "never" === (null === (n = bp(e)(t)) || void 0 === n || null === (r = n.phone) || void 0 === r ? void 0 : r.required)
}
}(e)(t);
if (r)
return !1;
var a = -1 !== gm.indexOf(t.paymentElement.selectedPaymentForm);
return !!bm(e)(t) && a
}
}, Cm = function(e) {
return function(t) {
return t.addressElement[e].options
}
}, Em = ["link_instant_debits", "us_bank_account"], Zm = function(e) {
var t = e || {}
, n = t.enabled
, r = t.instrumentId
, a = t.instrumentEligible;
return !(!n || !r || void 0 === a || a)
}, Am = function(e) {
return function(t, n) {
var r, a, i, o = Mm(n)[t], s = Pa(n).linkSettings.linkConsumerIncentiveOffer;
return "treatment" !== (null === (r = n.config.session) || void 0 === r ? void 0 : r.experimentsData.experimentAssignments.connections_elements_ach_incentives_experiment_v2) && "us_bank_account" === (null == s || null === (a = s.incentive_params) || void 0 === a ? void 0 : a.payment_method) ? null : e(o) && (null == s || null === (i = s.incentive_params) || void 0 === i ? void 0 : i.payment_method) === t ? s : null
}
}, Mm = function(e) {
return e.consumer.consumerSignUpIncentiveOffers || {}
}, Pm = Am((function(e) {
var t = e || {}
, n = t.enabled
, r = t.instrumentId
, a = t.instrumentEligible;
return !(!n || !a && r)
}
)), xm = (Am(Zm),
function(e) {
return e.consumer.instantDebitsIncentive
}
), Im = function(e) {
var t, n = Ha(e).linkConsumerIncentiveOffer, r = null == n || null === (t = n.incentive_params) || void 0 === t ? void 0 : t.payment_method;
if (r && function(e) {
return -1 !== Em.indexOf(e)
}(r))
return r
}, Nm = function(e) {
if (!bd(e))
return null;
var t = e.consumer
, n = t.consumerSession
, r = t.paymentDetails
, a = t.shippingAddresses
, i = t.foundUsingPartialCookie
, o = t.fullNameCollectionRequired
, s = t.emailOtpRequiresAdditionalInfo
, u = t.emailOtpVerifyPhoneDespiteSmsOtp
, l = t.hasPasskey
, c = t.hasPreviousMerchantRelationship
, d = t.publishableKey
, p = t.experiments
, m = t.purchaseProtectionsHoldback;
return n && d ? (0,
O.G)(n.verification_sessions, (function(e) {
return "STARTED" === e.state
}
)) ? null : {
publishable_key: d,
consumer_session: n,
redacted_payment_details: r,
shipping_addresses: a,
settings: {
found_using_partial_cookie: i,
full_name_collection_required: o,
email_otp_requires_additional_info: s,
email_otp_verify_phone_despite_sms_otp: u,
has_passkey: l,
has_previous_merchant_relationship: c,
purchase_protections_holdback: m
},
experiments: p
} : null
}, wm = n(56274).Promise, Tm = ["country"], Om = ["address"], Rm = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e() {
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return e.next = 2,
Hl.sharedInstance().persistLoginForSession();
case 2:
case "end":
return e.stop()
}
}
), e)
}
)));
return function() {
return e.apply(this, arguments)
}
}(), Lm = function(e) {
return function(e) {
return !!ja(e)[V.Yj.linkAuthentication]
}(e) && !$a(e)
}, Dm = function(e) {
return function() {
var t = (0,
k.Z)((0,
S.Z)().mark((function t(n, r) {
var a, i, o, s, u, l, c, d, p, m, f, h, _, y;
return (0,
S.Z)().wrap((function(t) {
for (; ; )
switch (t.prev = t.next) {
case 0:
if (a = r(),
i = La(a),
o = Da(a),
s = wa(a),
u = Ma(a),
l = Qa(a),
c = Oa(a),
d = ii(a),
e) {
t.next = 10;
break
}
return t.abrupt("return", {
found: !1
});
case 10:
if (!Yc(r()) && !Hc(r())) {
t.next = 12;
break
}
return t.abrupt("return", {
found: !1
});
case 12:
return n({
type: "CONSUMER.CREATE_SESSION.PENDING"
}),
p = (0,
b.Z)({
email_address: e,
session_id: u,
request_surface: s,
transaction_context: d
}, "PAYMENT_INTENT" === c ? {
payment_intent: Na(a),
amount: null,
currency: null
} : {
amount: i,
currency: o
}),
t.next = 16,
Hl.sharedInstance().lookupConsumerSession(p);
case 16:
if (m = t.sent,
f = m.requestId,
"error" !== m.type) {
t.next = 22;
break
}
return Jl.log("link.consumer_session.create.error", {
request_id: f,
error: m.error,
default_integration: l,
email_source: e.source
}),
n({
type: "CONSUMER.CREATE_SESSION.ERROR",
error: m.error,
source: e.source
}),
t.abrupt("return", {
found: !1
});
case 22:
if ((h = m.object).exists) {
t.next = 28;
break
}
return _ = {
message: "Consumer not found"
},
Jl.log("link.consumer_session.create.error", {
request_id: f,
error: _,
default_integration: l,
email_source: e.source
}),
n({
type: "CONSUMER.CREATE_SESSION.ERROR",
error: _,
source: e.source
}),
t.abrupt("return", {
found: !1
});
case 28:
return Jl.updateParams({
consumer_account_id: h.account_id
}),
Jl.log("link.consumer_session.create.success", {
request_id: f,
default_integration: l,
email_source: e.source
}),
y = {},
h.experiments.forEach((function(e) {
y[e.experiment_name] = e.response_id
}
)),
Jl.log("link.consumer_lookup_response_id", y),
Yc(r()) && Jl.log("link.ir_window_influence.session_created_but_logged_in"),
n({
type: "CONSUMER.CREATE_SESSION.SUCCESS",
session: h.consumer_session,
emailSource: e.source,
publishableKey: h.publishable_key,
emailOtpRequiresAdditionalInfo: h.settings.email_otp_requires_additional_info,
emailOtpVerifyPhoneDespiteSmsOtp: h.settings.email_otp_verify_phone_despite_sms_otp,
fullNameCollectionRequired: h.settings.full_name_collection_required,
experiments: h.experiments,
hasPasskey: h.settings.has_passkey,
hasPreviousMerchantRelationship: h.settings.has_previous_merchant_relationship,
purchaseProtectionsHoldback: h.settings.purchase_protections_holdback,
lookupBy: "email",
source: e.source
}),
t.abrupt("return", {
found: !0
});
case 36:
case "end":
return t.stop()
}
}
), t)
}
)));
return function(e, n) {
return t.apply(this, arguments)
}
}()
}, Um = function(e, t, n) {
return function() {
var r = (0,
k.Z)((0,
S.Z)().mark((function r(a, i) {
var o, s, u, l, c, d, p, m, f, h, _;
return (0,
S.Z)().wrap((function(r) {
for (; ; )
switch (r.prev = r.next) {
case 0:
if (o = i(),
s = Ra(o),
u = Qa(o),
l = Hc(o),
c = wa(o),
d = ad(o)) {
r.next = 8;
break
}
throw new Error("Cannot start verification without an existing consumer session.");
case 8:
return a({
type: "CONSUMER.START_VERIFICATION.PENDING",
verificationType: e
}),
r.next = 11,
mc(t, n);
case 11:
return p = r.sent,
m = {
email_address: d,
type: e,
locale: s,
account_phone_number: p,
request_surface: c
},
r.next = 15,
Hl.sharedInstance().startVerification(m);
case 15:
if ("error" !== (f = r.sent).type) {
r.next = 20;
break
}
return Jl.log("link.consumer_session.start_verification.error", {
request_id: f.requestId,
error: f.error,
default_integration: u,
verification_type: e
}),
a({
type: "CONSUMER.START_VERIFICATION.ERROR",
verificationType: e,
error: f.error
}),
r.abrupt("return");
case 20:
if (e !== vt.sf.WEBAUTHN) {
r.next = 27;
break
}
if (!(_ = Qs(f.object))) {
r.next = 26;
break
}
return Jl.log("link.consumer_session.start_verification.error", {
request_id: f.requestId,
error: _,
default_integration: u,
verification_type: e
}),
a({
type: "CONSUMER.START_VERIFICATION.ERROR",
verificationType: e,
error: _
}),
r.abrupt("return");
case 26:
y = f.object,
v = void 0,
v = Xs(y),
h = "error" === v.type ? null : v.fetchWebAuthnCredentialsParams;
case 27:
Jl.log("link.consumer_session.start_verification.success", {
request_id: f.requestId,
default_integration: u,
partial_cookie: l,
verification_type: e,
network_connection_type: (0,
Jr.Eu)(),
document_hidden: document.hidden
}),
a({
type: "CONSUMER.START_VERIFICATION.SUCCESS",
verificationType: e,
session: f.object.consumer_session,
fetchWebAuthnCredentialsParams: h
});
case 29:
case "end":
return r.stop()
}
var y, v
}
), r)
}
)));
return function(e, t) {
return r.apply(this, arguments)
}
}()
}, jm = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o, s, u, l;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return r = n(),
a = Qa(r),
i = wa(r),
o = qc(r),
t({
type: "CONSUMER.LIST_PAYMENT_DETAILS.PENDING"
}),
e.next = 7,
Hl.sharedInstance().paymentDetails.list({
types: o,
request_surface: i
});
case 7:
if (s = e.sent,
u = s.requestId,
"error" !== s.type) {
e.next = 14;
break
}
Jl.log("link.payment_details.list.error", {
request_id: u,
error: s.error,
default_integration: a
}),
t({
type: "CONSUMER.LIST_PAYMENT_DETAILS.ERROR",
error: s.error
}),
e.next = 19;
break;
case 14:
if (Yc(r) || Wc(r)) {
e.next = 16;
break
}
return e.abrupt("return");
case 16:
l = s.object.redacted_payment_details,
Jl.log("link.payment_details.list.success", {
request_id: u,
payment_details_count: l.length,
default_integration: a
}),
t({
type: "CONSUMER.LIST_PAYMENT_DETAILS.SUCCESS",
paymentDetails: l,
supportedPaymentDetailsTypes: o
});
case 19:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), Bm = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o, s, u;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return r = n(),
a = Qa(r),
i = wa(r),
t({
type: "CONSUMER.LIST_SHIPPING_ADDRESSES.PENDING"
}),
e.next = 6,
Hl.sharedInstance().shippingAddresses.list({
request_surface: i
});
case 6:
if (o = e.sent,
s = o.requestId,
"error" !== o.type) {
e.next = 12;
break
}
return Jl.log("link.shipping_address.list.error", {
request_id: s,
error: o.error,
default_integration: a
}),
t({
type: "CONSUMER.LIST_SHIPPING_ADDRESSES.ERROR",
error: o.error
}),
e.abrupt("return");
case 12:
if (Yc(n())) {
e.next = 14;
break
}
return e.abrupt("return");
case 14:
u = o.object.shipping_addresses,
Jl.log("link.shipping_address.list.success", {
request_id: s,
shipping_addresses_count: u.length,
default_integration: a
}),
t({
type: "CONSUMER.LIST_SHIPPING_ADDRESSES.SUCCESS",
shippingAddresses: u
});
case 17:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), Fm = function(e, t, n, r) {
return function() {
var a = (0,
k.Z)((0,
S.Z)().mark((function a(i, o) {
var s, u, l, c, d, p;
return (0,
S.Z)().wrap((function(a) {
for (; ; )
switch (a.prev = a.next) {
case 0:
if (void 0 === e.token) {
a.next = 2;
break
}
throw new Error("Unsupported for Card details with token.");
case 2:
return s = o(),
u = Za(s),
l = Aa(s),
c = Qa(s),
d = wa(s),
p = ti(s),
i({
type: "CONSUMER.CREATE_PAYMENT_DETAILS.PENDING"
}),
a.abrupt("return", rc({
apiKey: u,
stripeAccount: l,
cardDetails: e,
billingDetails: t,
email: n,
useLinkApiClient: !0,
active: !0,
requestSurface: d,
nickname: r,
onBehalfOf: p
}).then((function(t) {
var n = t.requestId;
if ("error" === t.type)
Jl.log("link.payment_details.create.error", {
request_id: n,
error: t.error,
default_integration: c
}),
i({
type: "CONSUMER.CREATE_PAYMENT_DETAILS.ERROR",
error: t.error
});
else {
var r = t.object.redacted_payment_details;
Jl.log("link.payment_details.create.success", {
request_id: n,
payment_details_id: r.id,
payment_details_type: r.type,
default_integration: c
}),
i({
type: "CONSUMER.CREATE_PAYMENT_DETAILS.SUCCESS",
paymentDetails: r,
cvc: e.cvc
})
}
}
)));
case 10:
case "end":
return a.stop()
}
}
), a)
}
)));
return function(e, t) {
return a.apply(this, arguments)
}
}()
}, Gm = function(e, t, n, r, a) {
return function() {
var i = (0,
k.Z)((0,
S.Z)().mark((function i(o, s) {
var u, l, c, d, p, m, f, h, _, y, v, g, k, C, E, Z, A, M, P;
return (0,
S.Z)().wrap((function(i) {
for (; ; )
switch (i.prev = i.next) {
case 0:
if (void 0 === t.token) {
i.next = 2;
break
}
throw new Error("Unsupported for Card details with token.");
case 2:
if ("CARD" === e.type && e.card_details) {
i.next = 4;
break
}
throw new Error("updateCardPaymentDetails called with non-card payment details.");
case 4:
if (o({
type: "CONSUMER.UPDATE_PAYMENT_DETAILS.PENDING"
}),
u = s(),
l = Qa(u),
c = wa(u),
d = n && nc(n),
p = t.cvc,
m = t.exp_month,
f = t.exp_year,
m && f && (v = tc(t),
g = v.exp_month,
k = v.exp_year,
C = v.preferred_network,
h = g,
_ = k,
y = C),
E = cc(e.card_details, y),
Z = a === e.nickname,
!(lc(e.card_details, h, _) && E && dc(e, d) && Z)) {
i.next = 16;
break
}
return p && o({
type: "CONSUMER.UPDATE_PAYMENT_DETAILS.SUCCESS",
paymentDetails: e,
cvc: p,
shouldShowList: r
}),
i.abrupt("return");
case 16:
return A = (0,
b.Z)((0,
b.Z)({
request_surface: c,
exp_month: h,
exp_year: _,
preferred_network: E ? void 0 : y
}, n ? {
billing_address: nc(n)
} : null), {}, {
nickname: a
}),
i.next = 19,
Hl.sharedInstance().paymentDetails.update(e.id, A);
case 19:
if (M = i.sent,
P = {
payment_details_id: e.id,
request_id: M.requestId,
default_integration: l
},
"error" !== M.type) {
i.next = 25;
break
}
return Jl.log("link.payment_details.update.error", (0,
b.Z)((0,
b.Z)({}, P), {}, {
error: M.error
})),
o({
type: "CONSUMER.UPDATE_PAYMENT_DETAILS.ERROR",
error: M.error
}),
i.abrupt("return");
case 25:
Jl.log("link.payment_details.update.success", P),
o({
type: "CONSUMER.UPDATE_PAYMENT_DETAILS.SUCCESS",
paymentDetails: M.object.redacted_payment_details,
cvc: p,
shouldShowList: r
});
case 27:
case "end":
return i.stop()
}
}
), i)
}
)));
return function(e, t) {
return i.apply(this, arguments)
}
}()
}, qm = function(e) {
return e ? e.trim().toLowerCase() : e
}, Km = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e() {
var t;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return e.next = 2,
Hl.sharedInstance().hasAuthSessionClientSecret();
case 2:
return t = e.sent,
e.abrupt("return", {
found: t
});
case 4:
case "end":
return e.stop()
}
}
), e)
}
)));
return function() {
return e.apply(this, arguments)
}
}(), Vm = function(e) {
var t = e.consumer_session
, n = e.redacted_payment_details
, r = e.shipping_addresses
, a = e.publishable_key
, i = e.account_id;
return function(e, o) {
var s, u, l = o();
if (!Xa(l))
return e({
type: "CONSUMER.RESET_SESSION",
ignoreCookieLogin: !0
}),
wm.resolve();
Jl.updateParams({
consumer_account_id: i
}),
e({
type: "CONSUMER.CREATE_SESSION.SUCCESS",
session: t,
publishableKey: a,
lookupBy: "email"
});
var c = t.email_address;
ci(l).email.trim().toLowerCase() !== c && e({
type: "AUTHENTICATION.FIELD_CHANGED",
name: "email",
value: c,
touched: !1
}),
e({
type: "AUTHENTICATION.FIELD_CHANGED",
name: "autofill",
value: "NONE",
touched: !1
}),
(null === (s = l.paymentElement.form.card) || void 0 === s || null === (u = s.values) || void 0 === u ? void 0 : u.linkEmail) !== c && e({
type: "PAYMENT.FIELD_CHANGED",
name: "linkEmail",
value: c,
paymentMethod: "card",
touched: !0
});
var d = qc(l);
return e({
type: "CONSUMER.LIST_PAYMENT_DETAILS.SUCCESS",
paymentDetails: n,
supportedPaymentDetailsTypes: d
}),
e({
type: "CONSUMER.LIST_SHIPPING_ADDRESSES.SUCCESS",
shippingAddresses: r
}),
e(zm("link.logged_in_with_consumer_info")),
e({
type: "AUTHENTICATION.AUTHENTICATED_CHANGED",
authenticated: !0
}),
e({
type: "CONSUMER.LOADED",
autofillBehavior: "noclick"
}),
wm.resolve()
}
}, zm = function(e, t) {
return function(n, r) {
var a, i, o, s = r(), u = Qa(s), l = Jc(s), c = l[0], d = $c(s), p = function(e) {
return e.consumer.fullNameCollectionRequired
}(s), m = function(e, t) {
var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}
, r = n.state
, a = n.reverifyPaymentMethod
, i = void 0 !== a && a
, o = n.requireName
, s = void 0 !== o && o
, u = n.fieldsToValidate
, l = void 0 === u ? sc : u
, c = n.formValues
, d = {
cvc: null,
expiry: null,
postalCode: null,
linkLegalName: null
}
, p = r && Xl(r)
, m = r && $l("billing_details.address.postal_code")(r);
if (!t)
return d;
var f = t.country
, h = t.postalCode
, _ = t.expiry
, y = t.checks
, v = t.billingName;
return l.forEach((function(t) {
var n = null;
switch (t) {
case "cvc":
n = wt(e, {
reverifyPaymentMethod: i
}, y);
break;
case "expiry":
var r = Tt(_);
n = r && (0,
M.eH)(r.year, r.month);
break;
case "postalCode":
n = It({
country: f,
postalCode: h,
options: {
errorOnMissing: !("never" === m || e && "if_required" === m || p)
},
checks: y
});
break;
case "linkLegalName":
n = Nt({
name: v,
requireName: s
});
break;
default:
(0,
P.Rz)(t)
}
d[t] = ia(n)
}
)),
Object.keys((0,
O.D9)(d, (function(e, t) {
return null !== t
}
))).forEach((function(e) {
switch (e) {
case "cvc":
if ("" === (null == c ? void 0 : c.cvc) || null != c && c.cvc) {
var t = Ho(_s.cardCvc(), c.cvc);
d.cvc = t ? null : oa("incomplete_cvc")
}
break;
case "expiry":
("" === (null == c ? void 0 : c.expiry) || null != c && c.expiry) && (d.expiry = Fo(c.expiry));
break;
case "postalCode":
if ("" === (null == c ? void 0 : c.postalCode) || null != c && c.postalCode) {
var n = ln(f, c.postalCode);
d.postalCode = n ? oa(n) : null
}
break;
case "linkLegalName":
var r = Nt({
name: null == c ? void 0 : c.linkLegalName,
requireName: s
});
d.linkLegalName = r ? oa(r) : null
}
}
)),
d
}(function(e) {
if (!e)
return !1;
var t = "type"in e && "CARD" === e.type
, n = "mode"in e && "consumer" === e.mode && "CARD" === e.paymentDetails.type
, r = "paymentMethod"in e && "card" === e.paymentMethod.type;
return t || n || r
}(c), null !== (a = function(e) {
var t, n, r, a, i, o, s, u, l, c;
if (!e)
return null;
if (!("mode"in e))
return {
cvc: null === (a = e.metadata) || void 0 === a ? void 0 : a.cvc,
expiry: {
exp_year: null === (i = e.card_details) || void 0 === i ? void 0 : i.exp_year,
exp_month: null === (o = e.card_details) || void 0 === o ? void 0 : o.exp_month
},
postalCode: null === (s = e.billing_address) || void 0 === s ? void 0 : s.postal_code,
country: null === (u = e.billing_address) || void 0 === u ? void 0 : u.country_code,
checks: null === (l = e.card_details) || void 0 === l ? void 0 : l.checks,
billingName: null === (c = e.billing_address) || void 0 === c ? void 0 : c.name
};
if ("consumer" === e.mode) {
var d, p, m, f, h, _ = e.paymentDetails, y = _.card_details;
return {
cvc: null === (d = _.metadata) || void 0 === d ? void 0 : d.cvc,
expiry: {
exp_year: null == y ? void 0 : y.exp_year,
exp_month: null == y ? void 0 : y.exp_month
},
postalCode: null === (p = _.billing_address) || void 0 === p ? void 0 : p.postal_code,
country: null === (m = _.billing_address) || void 0 === m ? void 0 : m.country_code,
checks: null === (f = _.card_details) || void 0 === f ? void 0 : f.checks,
billingName: null === (h = _.billing_address) || void 0 === h ? void 0 : h.name
}
}
var v = e.paymentMethod;
return "card" !== v.type ? null : {
cvc: void 0,
expiry: {
exp_year: v.card.exp_year,
exp_month: v.card.exp_month
},
postalCode: null === (t = v.billing_details.address) || void 0 === t ? void 0 : t.postal_code,
country: v.card.country,
checks: "checks"in v.card ? null === (n = v.card) || void 0 === n ? void 0 : n.checks : void 0,
billingName: null === (r = v.billing_details) || void 0 === r ? void 0 : r.name
}
}(c)) && void 0 !== a ? a : null, {
state: s,
requireName: p
}), f = Ka(s), h = function(e) {
return e.paymentElement.options.defaultValues
}(s), _ = null == h || null === (i = h.billingDetails) || void 0 === i ? void 0 : i.email, y = null === (o = s.authenticationElement.options.defaultValues) || void 0 === o ? void 0 : o.email, v = Lm(s);
return Jl.log(e, (0,
b.Z)({
default_integration: u,
recollect_cvc: !!m.cvc,
recollect_billing: !!m.postalCode,
recollect_expiry: !!m.expiry,
recollect_name: !!m.linkLegalName,
num_saved_payment_details: l.length,
num_saved_shipping_addresses: d.length,
has_customer_email: !!f,
has_lae_default_values_email: v && !!y,
has_lape_default_values_email: !!_,
payment_details_id: null == c ? void 0 : c.id
}, t)),
wm.resolve()
}
}, Hm = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return r = n(),
a = Ha(r),
i = wa(r),
t({
type: "CONSUMER.LOGOUT.SUCCESS"
}),
a.bankIncentivesEnabled && t({
type: "CONSUMER.SET_INSTANT_DEBITS_INCENTIVE",
amount: 500
}),
(o = Im(r)) && t({
type: "CONSUMER.ENABLE_SIGN_UP_INCENTIVE_OFFERS",
paymentMethodTypes: [o]
}),
e.next = 9,
Hl.sharedInstance().logOut({
request_surface: i
});
case 9:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), Ym = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return r = ad(n()),
e.abrupt("return", t(Hm).then((function() {
r && t({
type: "EFFECT",
effect: "CREATE_CONSUMER_SESSION",
email: {
email: r,
source: "user_action"
}
})
}
)));
case 2:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), Wm = function(e) {
return function(t, n) {
return t(function(e) {
return function() {
var t = (0,
k.Z)((0,
S.Z)().mark((function t(n, r) {
var a, i, o, s, u, l, c, d, p, m, f, h, _, y, v;
return (0,
S.Z)().wrap((function(t) {
for (; ; )
switch (t.prev = t.next) {
case 0:
if (o = r(),
s = o.authenticationElement.form.values.passcode,
u = Qa(o),
l = Hc(o),
c = wa(o),
d = vt.sf.SMS,
mi(o) && (d = vt.sf.EMAIL),
e && (d = vt.sf.WEBAUTHN),
n({
type: "CONSUMER.CONFIRM_VERIFICATION.PENDING",
verificationType: d
}),
!e || "error" !== e.type) {
t.next = 14;
break
}
return p = $s(e.error),
m = p.error,
Jl.log("link.consumer_session.confirm_verification.error", {
error: m,
default_integration: u,
verification_type: d
}),
n({
type: "CONSUMER.CONFIRM_VERIFICATION.ERROR",
error: m,
verificationType: d
}),
t.abrupt("return");
case 14:
return f = {
type: d,
code: d === vt.sf.WEBAUTHN ? "000001" : s,
request_surface: c,
webauthn_credential_data: null == e ? void 0 : e.credential,
email_address: null !== (a = null === (i = o.consumer.consumerSession) || void 0 === i ? void 0 : i.email_address) && void 0 !== a ? a : ""
},
t.next = 17,
Hl.sharedInstance().confirmVerification(f);
case 17:
if ("error" !== (h = t.sent).type) {
t.next = 22;
break
}
return Jl.log("link.consumer_session.confirm_verification.error", {
request_id: h.requestId,
error: h.error,
default_integration: u,
partial_cookie: l,
verification_type: d
}),
n({
type: "CONSUMER.CONFIRM_VERIFICATION.ERROR",
error: h.error,
verificationType: d
}),
t.abrupt("return");
case 22:
if (_ = h.object.consumer_session,
y = !1,
d === vt.sf.SMS ? y = Kc(_) : d === vt.sf.EMAIL ? y = Vc(_) : d === vt.sf.WEBAUTHN && (y = zc(_)),
y) {
t.next = 29;
break
}
return Jl.log("link.consumer_session.confirm_verification.error", {
request_id: h.requestId,
default_integration: u
}),
n({
type: "CONSUMER.CONFIRM_VERIFICATION.ERROR",
error: {
message: "Generic error"
},
verificationType: d
}),
t.abrupt("return");
case 29:
v = h.object.auth_session_client_secret || null,
Jl.log("link.consumer_session.confirm_verification.success", {
request_id: h.requestId,
default_integration: u,
partial_cookie: l,
verification_type: d
}),
n({
type: "CONSUMER.CONFIRM_VERIFICATION.SUCCESS",
session: h.object.consumer_session,
authSessionClientSecret: v,
verificationType: d
});
case 32:
case "end":
return t.stop()
}
}
), t)
}
)));
return function(e, n) {
return t.apply(this, arguments)
}
}()
}(e)).then((function() {
var e = n()
, r = rd(e, "CONFIRM_VERIFICATION");
return Yc(e) && "ERROR" !== r ? wm.all([t(jm), t(Bm), new wm((function(e) {
return setTimeout(e, 1e3)
}
))]).then((function() {
var e = n()
, r = ad(e)
, a = function(e) {
return e.authenticationElement.form.values.email
}(e)
, i = Im(e);
r && r !== a && t({
type: "AUTHENTICATION.FIELD_CHANGED",
name: "email",
value: r,
touched: !1
}),
t(zm("link.logged_in")),
t({
type: "AUTHENTICATION.AUTHENTICATED_CHANGED",
authenticated: !0
}),
t({
type: "CONSUMER.LOADED",
autofillBehavior: "noclick"
}),
t({
type: "CONSUMER.CLEAR_INSTANT_DEBITS_INCENTIVE"
}),
i && t({
type: "CONSUMER.RESET_SIGN_UP_INCENTIVE_OFFERS",
paymentMethodTypes: [i]
})
}
)) : wm.resolve()
}
))
}
}, Jm = function(e) {
return function() {
var t = (0,
k.Z)((0,
S.Z)().mark((function t(n) {
return (0,
S.Z)().wrap((function(t) {
for (; ; )
switch (t.prev = t.next) {
case 0:
n({
type: "CONSUMER.CREATE_PAYMENT_DETAILS.SUCCESS",
paymentDetails: e
});
case 1:
case "end":
return t.stop()
}
}
), t)
}
)));
return function(e) {
return t.apply(this, arguments)
}
}()
}, Xm = function(e, t, n) {
return function() {
var r = (0,
k.Z)((0,
S.Z)().mark((function r(a, i) {
var o, s, u, l, c, d, p;
return (0,
S.Z)().wrap((function(r) {
for (; ; )
switch (r.prev = r.next) {
case 0:
if ("BANK_ACCOUNT" === e.type && e.bank_account_details) {
r.next = 2;
break
}
throw new Error("updateBankPaymentDetails called with non-bank payment details.");
case 2:
if (a({
type: "CONSUMER.UPDATE_PAYMENT_DETAILS.PENDING"
}),
o = i(),
s = Qa(o),
u = wa(o),
l = t && nc(t),
!dc(e, l)) {
r.next = 9;
break
}
return r.abrupt("return");
case 9:
return c = (0,
b.Z)({
request_surface: u
}, t ? {
billing_address: nc(t)
} : null),
r.next = 12,
Hl.sharedInstance().paymentDetails.update(e.id, c);
case 12:
if (d = r.sent,
p = {
payment_details_id: e.id,
request_id: d.requestId,
default_integration: s
},
"error" !== d.type) {
r.next = 18;
break
}
return Jl.log("link.payment_details.update.error", (0,
b.Z)((0,
b.Z)({}, p), {}, {
error: d.error
})),
a({
type: "CONSUMER.UPDATE_PAYMENT_DETAILS.ERROR",
error: d.error
}),
r.abrupt("return");
case 18:
Jl.log("link.payment_details.update.success", p),
a({
type: "CONSUMER.UPDATE_PAYMENT_DETAILS.SUCCESS",
paymentDetails: d.object.redacted_payment_details,
cvc: "",
shouldShowList: n
});
case 20:
case "end":
return r.stop()
}
}
), r)
}
)));
return function(e, t) {
return r.apply(this, arguments)
}
}()
}, Qm = function(e, t) {
return function() {
var n = (0,
k.Z)((0,
S.Z)().mark((function n(r, a) {
var i, o, s, u, l, c, d;
return (0,
S.Z)().wrap((function(n) {
for (; ; )
switch (n.prev = n.next) {
case 0:
return r({
type: "CONSUMER.REMOVE_PAYMENT_DETAILS.PENDING"
}),
i = a(),
o = Qa(i),
s = wa(i),
n.next = 6,
Hl.sharedInstance().paymentDetails.delete(e, {
request_surface: s,
is_automatic: null != t && t
});
case 6:
if (u = n.sent,
l = {
payment_details_id: e,
request_id: u.requestId,
default_integration: o
},
"error" !== u.type) {
n.next = 12;
break
}
return Jl.log("link.payment_details.delete.error", (0,
b.Z)((0,
b.Z)({}, l), {}, {
error: u.error
})),
r({
type: "CONSUMER.REMOVE_PAYMENT_DETAILS.ERROR",
error: u.error
}),
n.abrupt("return");
case 12:
c = Jc(i).filter((function(t) {
return t.id !== e
}
)).map((function(t) {
return (0,
b.Z)((0,
b.Z)({}, t), {}, {
backup_ids: t.backup_ids.filter((function(t) {
return t !== e
}
))
})
}
)),
Jl.log("link.payment_details.delete.success", l),
d = Gc(i),
r({
type: "CONSUMER.REMOVE_PAYMENT_DETAILS.SUCCESS",
id: e,
remainingPaymentDetails: c,
supportedPaymentMethodTypes: d
});
case 16:
case "end":
return n.stop()
}
}
), n)
}
)));
return function(e, t) {
return n.apply(this, arguments)
}
}()
}, $m = function(e, t, n, r, a, i, o, s, u) {
return function(l, c) {
if (!o.billing_details || !o.billing_details.address || !o.billing_details.address.country || "card" !== o.type)
return wm.resolve();
var d = o.card
, p = o.billing_details
, m = p.address
, f = m.country
, _ = (0,
h.Z)(m, Tm)
, y = (0,
h.Z)(p, Om)
, v = (0,
b.Z)((0,
b.Z)({}, y), {}, {
address: (0,
b.Z)({
country: f
}, _)
})
, g = c()
, C = g.paymentElement.linkDefaultOptInBehavior
, E = g.paymentElement.linkOptInConsentShown;
return null != n && n.trim() && (e || null != r && r.trim()) && ("non-blocking-optional" !== C || null != r && r.trim()) && (E || e) ? !t || null != i && i.trim() ? Ql().then((function(e) {
var t = e.formatE164;
return l(function(e, t, n, r, a, i, o) {
return function() {
var s = (0,
k.Z)((0,
S.Z)().mark((function s(u, l) {
var c, d, p, m, f, h, _, y, v, g, k, C, E, Z, A, M, P, x, I, N, w, T, O, R, L;
return (0,
S.Z)().wrap((function(s) {
for (; ; )
switch (s.prev = s.next) {
case 0:
if (u({
type: "CONSUMER.SIGN_UP.PENDING"
}),
f = l(),
h = Qa(f),
!Wc(f, t)) {
s.next = 5;
break
}
return s.abrupt("return");
case 5:
if (_ = Ra(f),
y = La(f),
v = Da(f),
g = wa(f),
k = null === (c = f.paymentElement.form.card) || void 0 === c ? void 0 : c.values.linkOptIn,
C = null === (d = f.paymentElement.form.card) || void 0 === d ? void 0 : d.values.linkOptInIsVisibleFromFormChange,
E = null === (p = f.paymentElement.form.card) || void 0 === p ? void 0 : p.values.linkAutofillPromptOptIn,
Z = null === (m = f.paymentElement.form.card) || void 0 === m ? void 0 : m.values.linkOptInTouched,
A = Ic(f),
M = pc({
linkOptIn: k,
linkOptInTouched: Z,
linkOptInIsVisibleFromFormChange: C,
phoneNonEmpty: !!e,
linkDefaultOptInBehavior: f.paymentElement.linkDefaultOptInBehavior,
autofillPromptOpen: E,
isSpmLinkSignUp: A
})) {
s.next = 20;
break
}
return P = new Error("No consent action provided on sign up"),
Jl.log("link.consumer_account.sign_up.error", {
error: P,
default_integration: h
}),
u({
type: "CONSUMER.SIGN_UP.ERROR",
error: P
}),
s.abrupt("return");
case 20:
return x = Oa(f),
I = Na(f),
N = ti(f),
w = "PAYMENT_INTENT" === x && I ? I : void 0,
T = "SETUP_INTENT" === x && I ? I : void 0,
O = (0,
b.Z)((0,
b.Z)((0,
b.Z)({
email_address: t.trim().toLowerCase(),
phone_number: e
}, !!a && {
legal_name: a
}), {}, {
country: n,
country_inferring_method: r,
locale: _,
amount: y,
currency: v,
request_surface: g,
consent_action: M,
payment_intent: w,
setup_intent: T
}, !!i && {
hcaptcha_response: i
}), {}, {
session_id: o,
on_behalf_of: N
}),
s.next = 28,
Hl.sharedInstance().createAccount(O);
case 28:
if (R = s.sent,
L = R.requestId,
"error" !== R.type) {
s.next = 34;
break
}
return Jl.log("link.consumer_account.sign_up.error", {
request_id: L,
error: R.error,
default_integration: h
}),
u({
type: "CONSUMER.SIGN_UP.ERROR",
error: R.error
}),
s.abrupt("return");
case 34:
u({
type: "CONSUMER.SIGN_UP.SUCCESS",
session: R.object.consumer_session
}),
Jl.log("link.consumer_account.sign_up.success", {
request_id: L,
default_integration: h
});
case 36:
case "end":
return s.stop()
}
}
), s)
}
)));
return function(e, t) {
return s.apply(this, arguments)
}
}()
}(t(r, a), n, f, "BILLING_ADDRESS", i, s, u))
}
)).then((function() {
return Wc(c(), n) ? (Jl.log("link.sign_up_success", {
missingEmail: !(null != n && n.trim()),
missingPhone: !(null != r && r.trim()),
linkOptInConsentShown: E,
isLinkOptInTouched: e,
linkOptInBehavior: C
}),
l(Fm(d, v, n, void 0))) : wm.resolve()
}
)) : wm.resolve() : (Jl.log("link.invalid_sign_up", {
missingEmail: !(null != n && n.trim()),
missingPhone: !(null != r && r.trim()),
linkOptInConsentShown: E,
isLinkOptInTouched: e,
linkOptInBehavior: C
}),
wm.resolve())
}
}, ef = function(e) {
return function() {
var t = (0,
k.Z)((0,
S.Z)().mark((function t(n, r) {
var a, i, o, s, u, l, c;
return (0,
S.Z)().wrap((function(t) {
for (; ; )
switch (t.prev = t.next) {
case 0:
if (a = r(),
i = Na(a),
o = Oa(a),
s = xm(a),
u = wa(a),
s) {
t.next = 7;
break
}
return t.abrupt("return");
case 7:
return l = hc({
paymentDetailsId: e,
intentId: i,
intentType: o,
requestSurface: u,
isDeferredIntent: !!a.config.deferredIntent
}),
t.next = 10,
Hl.sharedInstance().experiments.financialIncentives(l);
case 10:
if ("object" === (c = t.sent).type && c.object) {
t.next = 15;
break
}
return n({
type: "CONSUMER.CLEAR_INSTANT_DEBITS_INCENTIVE"
}),
n({
type: "CONSUMER.RESET_SIGN_UP_INCENTIVE_OFFERS",
paymentMethodTypes: ["link_instant_debits"]
}),
t.abrupt("return");
case 15:
c.object.eligible ? (n({
type: "CONSUMER.SET_INSTANT_DEBITS_INCENTIVE",
amount: 500,
bankPaymentDetailsId: e
}),
n({
type: "CONSUMER.SET_INSTRUMENT_FOR_SIGN_UP_INCENTIVE",
paymentMethodType: "link_instant_debits",
instrumentId: e
})) : (n({
type: "CONSUMER.CLEAR_INSTANT_DEBITS_INCENTIVE"
}),
n({
type: "CONSUMER.RESET_SIGN_UP_INCENTIVE_OFFERS",
paymentMethodTypes: ["link_instant_debits"]
}));
case 17:
case "end":
return t.stop()
}
}
), t)
}
)));
return function(e, n) {
return t.apply(this, arguments)
}
}()
}, tf = function(e, t) {
return function() {
var n = (0,
k.Z)((0,
S.Z)().mark((function n(r, a) {
var i, o, s, u, l, c;
return (0,
S.Z)().wrap((function(n) {
for (; ; )
switch (n.prev = n.next) {
case 0:
if (i = a(),
Pm(e, i)) {
n.next = 4;
break
}
return n.abrupt("return");
case 4:
return o = Ia(i),
s = wa(i),
u = {
session_id: o || "",
request_surface: s,
payment_details_id: t
},
n.next = 9,
Hl.sharedInstance().incentives.updateAvailable(u);
case 9:
if ("object" === (l = n.sent).type && l.object && !l.error) {
n.next = 16;
break
}
return Jl.log("link.financial_incentive.confirmation.error", {
instrumentId: t,
res: l
}),
r({
type: "CONSUMER.RESET_SIGN_UP_INCENTIVE_OFFERS",
paymentMethodTypes: [e]
}),
n.abrupt("return");
case 16:
if (l.object) {
n.next = 20;
break
}
return Jl.log("link.financial_incentive.confirmation.error", {
instrumentId: t
}),
r({
type: "CONSUMER.RESET_SIGN_UP_INCENTIVE_OFFERS",
paymentMethodTypes: [e]
}),
n.abrupt("return");
case 20:
c = l.object.data,
r({
type: "CONSUMER.SET_INSTRUMENT_FOR_SIGN_UP_INCENTIVE",
paymentMethodType: e,
instrumentId: t,
instrumentEligible: c.length > 0
});
case 22:
case "end":
return n.stop()
}
}
), n)
}
)));
return function(e, t) {
return n.apply(this, arguments)
}
}()
}, nf = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
if (!gs("FORCE_DISTINCTLY_LINK")) {
e.next = 4;
break
}
return t({
type: "CONSUMER.LINK_MODAL.ENABLED_BY_EXPERIMENT"
}),
e.abrupt("return");
case 4:
o = n(),
a = o.consumer.experiments || [],
i = (null === (r = (0,
O.sE)(a, (function(e) {
return "distinctly_link_payment_element_m1" === e.experiment_name
}
))) || void 0 === r ? void 0 : r.variant) || "control",
t("treatment" === i ? {
type: "CONSUMER.LINK_MODAL.ENABLED_BY_EXPERIMENT"
} : {
type: "CONSUMER.LINK_MODAL.DISABLED_BY_EXPERIMENT"
});
case 7:
case "end":
return e.stop()
}
var o
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), rf = function(e, t, n) {
return function() {
var r = (0,
k.Z)((0,
S.Z)().mark((function r(a, i) {
var o, s, u, l, c, d, p, m, f, h, _;
return (0,
S.Z)().wrap((function(r) {
for (; ; )
switch (r.prev = r.next) {
case 0:
if (o = i(),
s = Na(o),
u = Oa(o),
l = Pm(t, o),
c = wa(o),
d = Ia(o),
l) {
r.next = 8;
break
}
return r.abrupt("return");
case 8:
return p = hc({
paymentDetailsId: n,
intentId: s,
intentType: u,
requestSurface: c,
isDeferredIntent: !!o.config.deferredIntent,
elementsSessionId: d
}),
m = function(e) {
Jl.log("link.financial_incentive.confirmation.error", {
paymentDetailsId: n,
error: e
}),
a({
type: "CONSUMER.RESET_SIGN_UP_INCENTIVE_OFFERS",
paymentMethodTypes: [t]
})
}
,
r.prev = 10,
r.next = 13,
Hl.sharedInstance().experiments.financialIncentives(p);
case 13:
f = r.sent,
r.next = 20;
break;
case 16:
return r.prev = 16,
r.t0 = r.catch(10),
m(r.t0),
r.abrupt("return");
case 20:
if ("object" === f.type && f.object && !f.error) {
r.next = 23;
break
}
return m(null === (h = f) || void 0 === h ? void 0 : h.error),
r.abrupt("return");
case 23:
_ = f.object.eligible,
a({
type: "CONSUMER.SET_INSTRUMENT_FOR_SIGN_UP_INCENTIVE",
paymentMethodType: t,
instrumentId: e || n,
instrumentEligible: !!_
});
case 25:
case "end":
return r.stop()
}
}
), r, null, [[10, 16]])
}
)));
return function(e, t) {
return r.apply(this, arguments)
}
}()
}, af = function(e) {
return function() {
var t = (0,
k.Z)((0,
S.Z)().mark((function t(n, r) {
var a, i, o, s, u;
return (0,
S.Z)().wrap((function(t) {
for (; ; )
switch (t.prev = t.next) {
case 0:
o = r(),
s = e.consumer_session.email_address,
(u = null === (a = o.paymentElement.form.us_bank_account) || void 0 === a || null === (i = a.values) || void 0 === i ? void 0 : i.email) || u === s || n({
type: "PAYMENT.FIELD_CHANGED",
name: "email",
value: s,
paymentMethod: "us_bank_account",
touched: !0
});
case 4:
case "end":
return t.stop()
}
}
), t)
}
)));
return function(e, n) {
return t.apply(this, arguments)
}
}()
}, of = function(e, t, n) {
return function() {
var r = (0,
k.Z)((0,
S.Z)().mark((function r(a) {
return (0,
S.Z)().wrap((function(r) {
for (; ; )
switch (r.prev = r.next) {
case 0:
a({
type: "CONSUMER.SET_INSTRUMENT_FOR_SIGN_UP_INCENTIVE",
paymentMethodType: t,
instrumentId: e,
instrumentEligible: n
});
case 1:
case "end":
return r.stop()
}
}
), r)
}
)));
return function(e, t) {
return r.apply(this, arguments)
}
}()
}, sf = function(e, t, n) {
var r, a = n.logger, i = n.isLink, o = (0,
mn.jR)(t);
switch (e.type) {
case "error":
var s = G(e.error, o)
, u = s.localizedError
, l = s.reports
, c = s.localized;
if (i) {
var d = function(e, t) {
var n = e.decline_code;
if ("generic_decline" === n) {
var r = (0,
D.pY)(t, "errors.declines.".concat(n, "_link"));
return (0,
b.Z)((0,
b.Z)({}, e), {}, {
message: null != r ? r : e.message
})
}
return e
}(u, o);
r = {
type: "error",
error: d,
locale: o
}
} else
r = {
type: "error",
error: u,
locale: o
};
!0 === n.renderLocalizedFlag && (r = (0,
b.Z)((0,
b.Z)({}, r), {}, {
localized: c
})),
a && l.forEach((function(e) {
a.log.apply(a, (0,
Z.Z)(e))
}
));
break;
case "object":
r = {
type: "object",
object: e.object,
locale: o
};
break;
default:
return (0,
P.Rz)(e.type)
}
return r
}, uf = (0,
E.Z)((function e(t) {
(0,
C.Z)(this, e),
this.value = t
}
)), lf = function(e) {
function t() {
return (0,
C.Z)(this, t),
n.apply(this, arguments)
}
(0,
Gs.Z)(t, e);
var n = (0,
qs.Z)(t);
return (0,
E.Z)(t)
}(uf), cf = {
"invalid_payment_view.add": !0,
"invalid_payment_view.update": !0,
"invalid_payment_view.remove": !0,
"invalid_payment_view.logout": !0,
"invalid_payment_view.link-blocked": !0,
"invalid_payment_view.remove-saved-confirmation": !0,
"invalid_payment_view.logout-confirmation": !0,
"invalid_payment_view.customer-saved": !0,
"invalid_payment_view.details-link-disabled": !0
}, df = {
"invalid_address_view.update": !0
}, pf = function(e) {
return e && "object" == typeof e && (e.constructor === Array || e.constructor === Object)
}, mf = function(e) {
return pf(e) ? Array.isArray(e) ? e.slice(0, e.length) : (0,
_.Z)({}, e) : e
}, ff = function e() {
for (var t = arguments.length, n = new Array(t), r = 0; r < t; r++)
n[r] = arguments[r];
if (Array.isArray(n[0]))
return mf(n[0]);
var a = Array.isArray(n[0]) ? [] : {};
return n.forEach((function(t) {
t && Object.keys(t).forEach((function(n) {
var r = a[n]
, i = t[n]
, o = pf(r) && !Array.isArray(r) && !Array.isArray(i);
"object" == typeof i && o ? a[n] = e(r, mf(i)) : null != i && "" !== i || void 0 === r && void 0 !== i ? a[n] = pf(i) ? e(i) : mf(i) : void 0 !== r && (a[n] = r)
}
))
}
)),
a
}, hf = {
"controller.js": !0,
"elements-inner-authentication.js": !0,
"elements-inner-card.js": !0,
"elements-inner-payment.js": !0,
"phone-numbers-lib.js": !0
}, _f = /\/\/[qr]\.stripe\.com/, yf = function() {
if (window.performance.getEntriesByType)
return window.performance.getEntriesByType("resource").reduce((function(e, t) {
if (!_f.test(t.name)) {
var n = t.name.match(/\/([^/#?]*)(?:$|[#?])/);
if (n && n[1]) {
var r = n[1].replace(/-[0-9a-f]{32}\./, ".");
return (0,
b.Z)((0,
b.Z)({}, e), {}, (0,
v.Z)({}, r, (0,
b.Z)({
raw_size: t.decodedBodySize,
transfer_size: t.transferSize,
duration: Math.round(t.duration)
}, r in hf ? (a = t,
{
duration: Math.round(a.duration),
transfer_size: null !== (i = a.transferSize) && void 0 !== i ? i : null,
tcp_handshake_duration: 0 !== a.connectStart ? Math.round(a.connectEnd - a.connectStart) : null,
dns_lookup_duration: 0 !== a.domainLookupStart ? Math.round(a.domainLookupEnd - a.domainLookupStart) : null,
redirect_duration: 0 !== a.redirectStart ? Math.round(a.redirectEnd - a.redirectStart) : null,
request_duration: 0 !== a.requestStart ? Math.round(a.responseStart - a.requestStart) : null,
response_duration: 0 !== a.responseStart ? Math.round(a.responseEnd - a.responseStart) : null,
tls_negotiation_duration: 0 !== a.secureConnectionStart ? Math.round(a.requestStart - a.secureConnectionStart) : null,
fetch_duration: 0 !== a.fetchStart ? Math.round(a.responseEnd - a.fetchStart) : null,
service_worker_duration: 0 !== a.workerStart ? Math.round(a.fetchStart - a.workerStart) : null,
raw_size: null !== (o = a.decodedBodySize) && void 0 !== o ? o : null,
compressed: "number" == typeof a.encodedBodySize && "number" == typeof a.decodedBodySize ? a.encodedBodySize === a.decodedBodySize : null,
cached_locally: "number" == typeof a.transferSize ? 0 === a.transferSize : null,
next_hop_protocol: a.nextHopProtocol || null,
is_http3: "string" == typeof a.nextHopProtocol ? "h3" === a.nextHopProtocol : null
}) : {})))
}
}
var a, i, o;
return e
}
), {})
}, vf = function(e) {
switch (e) {
case "american_express":
return "amex";
case "diners_club":
return "diners";
default:
return e
}
}, gf = function(e, t) {
if (null === e)
return null;
var n = e.filter((function(e) {
return e in ka
}
));
return n.length !== e.length && t("invalid_card_networks_retrieved", {
rawNetworks: e,
validNetworks: n
}),
n.map(vf)
}, bf = (n(62322),
{
4242424242424242: ["visa"],
4000056655665556: ["visa"],
5555555555554444: ["mastercard"],
2223003122003222: ["mastercard"],
5200828282828210: ["mastercard"],
5105105105105100: ["mastercard"],
6011111111111117: ["discover"],
6011000990139424: ["discover"],
3566002020360505: ["jcb"],
6200000000000005: ["unionpay"],
6200000000000047: ["unionpay"],
"6205500000000000004": ["unionpay"],
4000002500001001: ["cartes_bancaires", "visa"],
5555552500001001: ["cartes_bancaires", "mastercard"],
5341034800000008: ["cartes_bancaires", "mastercard"]
}), Sf = {
424242: "US",
4e5: "US"
}, kf = n(56274).Promise, Cf = function() {
function e(t) {
(0,
C.Z)(this, e),
this._fetcher = t,
this._cardNumber = "",
this._previousCardNumber = "",
this._binPref = "",
this._comparablePrefix = "",
this._previouscomparablePrefix = "",
this._emitted = {},
this._rangeMap = {},
this._pending = {},
this._pendingCardMetadataRequest = null,
this._prevNetworks = null,
this._testCardsEmitted = {}
}
return (0,
E.Z)(e, [{
key: "fetchingCardMetadata",
value: function() {
var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : ""
, t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1];
t && (this._emitted = {},
this._testCardsEmitted = {}),
this._previousCardNumber = this._cardNumber,
this._cardNumber = Je(e);
var n = this._binPref;
return this._binPref = this._cardNumber.length >= 6 ? this._cardNumber.slice(0, 6) : "",
this._comparablePrefix = this._cardNumber.length >= 8 ? this._cardNumber.slice(0, 8) : "",
this._previouscomparablePrefix = this._previousCardNumber.length >= 8 ? this._previousCardNumber.slice(0, 8) : "",
this._previouscomparablePrefix && this._comparablePrefix !== this._previouscomparablePrefix && delete this._emitted[this._previouscomparablePrefix],
this._previousCardNumber in bf && this._previousCardNumber !== this._cardNumber && delete this._testCardsEmitted[this._previousCardNumber],
n && n !== this._binPref && (this._pendingCardMetadataRequest = null,
delete this._pending[this._binPref]),
!(!this._binPref || this._pending[this._binPref] || this._rangeMap[this._binPref]) && (this._pending[this._binPref] = !0,
this._prevNetworks = null,
!0)
}
}, {
key: "retrieveCardNetworks",
value: function(e) {
var t, n = this;
if (this._cardNumber in bf) {
var r = (t = this._cardNumber,
this._testCardsEmitted[t] ? null : bf[t] || null)
, a = gf(r, e);
return this._testCardsEmitted[this._cardNumber] = !0,
delete this._emitted[this._comparablePrefix],
this._prevNetworks = a,
kf.resolve(a)
}
return !this._comparablePrefix && this._prevNetworks && this._prevNetworks.length >= 1 ? (this._prevNetworks = null,
kf.resolve([])) : !this._binPref || this._comparablePrefix && this._emitted[this._comparablePrefix] || this._rangeMap[this._binPref] && !this._comparablePrefix ? kf.resolve(null) : this.retrieveOrGetCachedCardNetworks().then((function(t) {
if (!n._comparablePrefix)
return null;
var r = function(e, t) {
var n = [];
return t && (t.forEach((function(t) {
var r = Math.min(t.pan_length, e.length)
, a = e.slice(0, r)
, i = t.account_range_low.slice(0, r)
, o = t.account_range_high.slice(0, r)
, s = t.brand.toLowerCase();
i <= a && a <= o && -1 === n.indexOf(s) && n.push(s)
}
)),
n.sort()),
n
}(n._cardNumber, t)
, a = gf(r, e);
return n._prevNetworks = a,
n._emitted[n._comparablePrefix] = !0,
a
}
))
}
}, {
key: "retrieveOrGetCachedCardNetworks",
value: function() {
var e = this
, t = this._rangeMap[this._binPref];
if (t)
return kf.resolve(t);
var n = this._pendingCardMetadataRequest;
return n || (n = this._fetcher(this._binPref),
this._pendingCardMetadataRequest = n),
n.then((function(e) {
return "object" === e.type ? e.object.data : kf.reject(e.error || new Error("Unexcepted result error"))
}
)).then((function(t) {
return e._pendingCardMetadataRequest = null,
e._rangeMap[e._binPref] = t,
delete e._pending[e._binPref],
t
}
)).catch((function() {
return e._pendingCardMetadataRequest = null,
e._rangeMap[e._binPref] = [],
delete e._pending[e._binPref],
[]
}
))
}
}, {
key: "getNetworks",
value: function() {
return this._prevNetworks
}
}]),
e
}(), Ef = function(e) {
var t = e.frameId
, n = e.cardMetadataManagerCache
, r = e.apiClient;
return n.get(t) || n.set(t, new Cf((function(e) {
return r.cardMetadata.retrieve({
data: {
bin_prefix: e
}
})
}
)))
}, Zf = n(7547), Af = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o, s, u, l;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return r = t.frameHub,
a = t.cache,
i = t.apiClient,
o = n.frameId,
s = n.resetEmitted,
u = void 0 !== s && s,
e.next = 4,
Mf(r, o);
case 4:
return l = e.sent,
e.abrupt("return", Ef({
frameId: o,
cardMetadataManagerCache: a.cardMetadataManagerCache,
apiClient: i
}).fetchingCardMetadata(l, u));
case 6:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), Mf = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return e.next = 2,
(0,
Zf.XQ)(t, n, {
skipValidation: !0
});
case 2:
if (a = e.sent) {
e.next = 5;
break
}
throw new I.No("We could not retrieve data from the specified Element.\n Please make sure the Element you are attempting to use is still mounted.");
case 5:
return e.abrupt("return", (null === (r = a.value) || void 0 === r ? void 0 : r.cardNumber) || "");
case 6:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), Pf = function(e) {
return vi.indexOf(e) >= 0
}, xf = n(63110), If = n.n(xf), Nf = ["_1057540218"], wf = ["_1541774781"], Tf = "block", Of = "allow", Rf = "list", Lf = "query-param", Df = "real-rollout", Uf = "no-rollout", jf = (V.Xk.replace(/\/$/, ""),
function(e, t) {
var n = (0,
b.Z)({
event: e
}, t);
var r = "".concat("https://q.stripe.com", "?").concat((0,
T.qC)(n));
(new Image).src = r
}
), Bf = new Set(["card", "us_bank_account", "link", "sepa_debit", "bancontact", "sofort", "ideal"]), Ff = function(e, t, n) {
return {
element: $(e),
payment_method_type: t,
is_card: "card" === t,
usesLink: n,
returnUrlProvided: !!e.otherParams.return_url,
hasValidMids: (0,
_t.x5)(e.mids)
}
}, Gf = function(e, t) {
var n, r = !(null === (n = e.session) || void 0 === n || !n.customer);
return {
hasCustomerSession: r,
isSavedPaymentMethod: r && t && "saved" === e.selectedPaymentForm
}
}, qf = function(e, t, n, r, a, i) {
var o, s = arguments.length > 6 && void 0 !== arguments[6] ? arguments[6] : {}, u = Gf(t, i), l = u.hasCustomerSession, c = u.isSavedPaymentMethod, d = r ? J(r) : n, p = (0,
b.Z)({
payment_method_type: a,
returnUrlProvided: !(null === (o = e.params) || void 0 === o || !o.return_url),
elementsModeOrIntentType: d
}, s);
if (!l)
return p;
if (c)
return (0,
b.Z)((0,
b.Z)({}, p), {}, {
isSavedPaymentMethod: !0,
enableSaveCheckbox: "not_shown_not_checked",
enableSetAsDefaultCheckbox: "not_shown_not_checked"
});
var m = zf(t, a)
, f = m.enableSaveCheckbox
, h = m.enableSetAsDefaultCheckbox;
return (0,
b.Z)((0,
b.Z)({}, p), {}, {
isSavedPaymentMethod: !1,
enableSaveCheckbox: f,
enableSetAsDefaultCheckbox: h
})
}, Kf = function(e, t, n, r) {
var a, i, o, s = Gf(t, n), u = s.hasCustomerSession, l = s.isSavedPaymentMethod, c = null !== (a = null === (i = t.session) || void 0 === i ? void 0 : i.featureFlags) && void 0 !== a ? a : {}, d = (o = c,
Object.keys(o).filter((function(e) {
return o[e]
}
)));
if (!u)
return (0,
b.Z)((0,
b.Z)({}, e), {}, {
featureFlags: d,
wasConfirmationTokenUsedForConfirm: r
});
if (l)
return (0,
b.Z)((0,
b.Z)({}, e), {}, {
isSavedPaymentMethod: !0,
enableSaveCheckbox: "not_shown_not_checked",
enableSetAsDefaultCheckbox: "not_shown_not_checked",
featureFlags: d,
wasConfirmationTokenUsedForConfirm: r
});
var p = zf(t, e.payment_method_type)
, m = p.enableSaveCheckbox
, f = p.enableSetAsDefaultCheckbox;
return (0,
b.Z)((0,
b.Z)({}, e), {}, {
isSavedPaymentMethod: !1,
enableSaveCheckbox: m,
enableSetAsDefaultCheckbox: f,
featureFlags: d,
wasConfirmationTokenUsedForConfirm: r
})
}, Vf = function(e, t, n) {
var r = n.isSavedPaymentMethod
, a = n.enableSaveCheckbox
, i = n.payment_method_type;
r ? e.report("spm.".concat(t, ".confirm_with_saved_pm"), {
payment_method_type: i
}) : "shown_and_checked" === a ? e.report("spm.".concat(t, ".confirm_and_save_with_new_pm"), {
payment_method_type: i
}) : "shown_not_checked" === a && e.report("spm.".concat(t, ".confirm_with_new_pm_without_save"))
}, zf = function(e, t) {
var n, r, a = e.savePaymentMethodDisplay, i = a.shouldRenderSaveCheckbox, o = a.shouldRenderSetAsDefaultCheckbox;
if (!t)
return {
enableSaveCheckbox: void 0,
enableSetAsDefaultCheckbox: void 0
};
var s = function(e) {
return Bf.has(e)
}(t);
if (!s)
return {
enableSaveCheckbox: void 0,
enableSetAsDefaultCheckbox: void 0
};
var u = null == e || null === (n = e.form) || void 0 === n || null === (r = n["link" === t ? "card" : t]) || void 0 === r ? void 0 : r.values
, l = !(null == u || !u.savePayment)
, c = !(null == u || !u.setAsDefaultSavedPayment);
return {
enableSaveCheckbox: i ? l ? "shown_and_checked" : "shown_not_checked" : "not_shown_not_checked",
enableSetAsDefaultCheckbox: o ? c ? "shown_and_checked" : "shown_not_checked" : c ? "not_shown_and_checked" : "not_shown_not_checked"
}
}, Hf = function(e) {
var t = e.isCheckingOutWithLink
, n = e.element
, r = e.linkFunnel
, a = e.type
, i = e.isLinkFallbackToCard
, o = function(e) {
switch (e) {
case "expressCheckout":
return rl.ExpressCheckoutElement;
case "card":
return rl.CardElement;
case "cardNumber":
return rl.SplitCardElement;
case "paymentRequestButton":
return rl.PaymentRequestButtonElement;
case "linkAuthentication":
return rl.LinkAuthenticationElement;
case "payment":
case "linkModal":
return rl.PaymentElement;
default:
return ""
}
}(n);
return o ? {
attempt: function() {
r.controllerAppEvent({
event: t ? nl.LinkCheckoutConfirmationAttempted : nl.NonLinkCheckoutConfirmationAttempted,
data: {
surface: o
}
})
},
error: function() {
r.controllerAppEvent({
event: t ? nl.LinkCheckoutConfirmationError : nl.NonLinkCheckoutConfirmationError,
data: {
surface: o
}
})
},
result: function(e) {
var n;
switch (e.type) {
case "error":
r.controllerAppEvent({
event: t ? nl.LinkCheckoutConfirmationError : nl.NonLinkCheckoutConfirmationError,
data: {
surface: o
}
});
break;
case "object":
i && r.controllerAppEvent({
event: nl.LinkCheckoutConfirmationError,
data: {
surface: o
}
}),
r.controllerAppEvent({
event: t && !i ? nl.LinkCheckoutConfirmationSucceeded : nl.NonLinkCheckoutConfirmationSucceeded,
data: {
surface: o,
id: null === (n = e.object) || void 0 === n ? void 0 : n.id,
type: a
}
});
break;
default:
r.controllerAppEvent({
event: nl.Fatal,
data: {
message: "unknown confirmation result type type for ".concat(a, " on ").concat(o),
surface: o
}
})
}
}
} : null
}, Yf = function(e) {
if (!e)
return null;
switch (e.type) {
case "konbini":
return {
konbini: e.data
};
case "wechat_pay":
return {
wechat_pay: e.data
};
case "card":
return {
card: e.data
};
case "link":
return {
link: e.data
};
case "blik":
return {
blik: e.data
};
case "paypal":
return {
paypal: e.data
};
case "affirm":
return {
affirm: e.data
};
case "ideal":
return {
ideal: e.data
};
case "sofort":
return {
sofort: e.data
};
case "sepa_debit":
return {
sepa_debit: e.data
};
case "bancontact":
return {
bancontact: e.data
};
case "us_bank_account":
return {
us_bank_account: e.data
};
case "demo_pay":
return {
demo_pay: e.data
};
case "amazon_pay":
return {
amazon_pay: e.data
};
case "rechnung":
return {
rechnung: e.data
};
case "klarna":
return {
klarna: e.data
};
default:
return null
}
}, Wf = function() {
function e() {
(0,
C.Z)(this, e),
this.cache = new Set
}
return (0,
E.Z)(e, [{
key: "add",
value: function(e) {
this.cache.add(e)
}
}, {
key: "has",
value: function(e) {
return this.cache.has(e)
}
}]),
e
}(), Jf = function(e, t) {
var n = e.frameHub
, r = e.integrationMetadata
, a = e.logger
, i = n.getFrameGroup(t)
, o = r.resolveLocale()
, s = (0,
mn.jR)(o || "auto");
return a.log("link_in_card.cvc_recollection_with_link_chip"),
i && n.sendGroupMessage(i, {
action: "stripe-internal-link-clear",
payload: {}
}, {
types: [L.NC.CARD_ELEMENT_COMBINED, L.NC.CARD_ELEMENT_SPLIT]
}),
{
type: "error",
error: G(oa("incomplete_cvc"), s).localizedError,
locale: s
}
}, Xf = ["card"], Qf = function(e, t) {
var n, r, a, i, o, s, u = t.elementName, l = t.postalCollectionDisabled, c = t.paymentDetailsBillingCountry, d = t.merchantPassthroughParams, p = t.locale, m = t.frameId, f = t.slug, _ = e.apiClient, y = e.integrationMetadata, v = e.cardElementState, g = e.logger, S = e.linkApiClient, k = e.outerInitiatedActions, C = e.frameHub, E = y.resolveLocale(p), Z = "token" === d.mode, A = Sd(v, {
element: u
}), M = Hf({
isCheckingOutWithLink: A,
linkFunnel: cl,
element: u,
type: "token"
}), P = t.sharePaymentDetailsRequestParams;
if (Z) {
null == M || M.attempt();
var x = ut("card", d.data, u);
x.warnings.forEach(g.warn),
s = x.data
}
if ("payment_method" === d.mode || "source" === d.mode) {
var I = d.data
, N = "payment_method" === d.mode ? "billing_details.address" : "owner.address"
, w = (0,
O.uu)(I, "".concat(N, ".city"))
, T = (0,
O.uu)(I, "".concat(N, ".country"))
, R = (0,
O.uu)(I, "".concat(N, ".line1"))
, L = (0,
O.uu)(I, "".concat(N, ".line2"))
, D = (0,
O.uu)(I, "".concat(N, ".postal_code"))
, U = (0,
O.uu)(I, "".concat(N, ".state"));
s = {
card: (0,
b.Z)((0,
b.Z)((0,
b.Z)((0,
b.Z)((0,
b.Z)((0,
b.Z)({}, w ? {
address_city: w
} : {}), T ? {
address_country: T
} : {}), R ? {
address_line1: R
} : {}), L ? {
address_line2: L
} : {}), D ? {
address_zip: D
} : {}), U ? {
address_state: U
} : {})
}
}
var j = null === (n = s) || void 0 === n || null === (r = n.card) || void 0 === r ? void 0 : r.address_zip
, B = null === (a = P.payment_method_options) || void 0 === a || null === (i = a.card) || void 0 === i ? void 0 : i.address_zip;
if (j && !B) {
var F, G, q = P.id;
S.paymentDetails.update(q, {
billing_address: {
postal_code: j,
country_code: (null === (F = s) || void 0 === F || null === (G = F.card) || void 0 === G ? void 0 : G.address_country) || c
},
request_surface: P.request_surface
})
}
var K, V = Object.keys((null === (o = s) || void 0 === o ? void 0 : o.card) || {}).filter((function(e) {
return /^address_/.test(e)
}
));
(-1 !== V.indexOf("address_zip") && V.length > 1 || l) && (null !== (K = P.payment_method_options) && void 0 !== K && K.card && (P = (0,
b.Z)((0,
b.Z)({}, P), {}, {
payment_method_options: (0,
b.Z)((0,
b.Z)({}, P.payment_method_options), {}, {
card: (0,
O.CE)(P.payment_method_options.card, ["address_zip"])
})
})));
var z = s
, H = z.card
, Y = (0,
h.Z)(z, Xf)
, W = (0,
O.TS)({}, (0,
b.Z)({
payment_method_options: {
card: H
}
}, Y), P);
return S.paymentDetails.shareToken(W).then((function(e) {
return (Z || "error" === e.type) && (pe(f) && k.removeElementsExperimentId(),
_.reportFetchResult(f, e, yt({
elementName: u,
usesLink: A,
mids: null
}))),
m && "object" === e.type && C.sendMessageToFrame(m, {
action: "stripe-link-in-card-tokenized",
payload: {
cardToken: e.object.card.id
}
}),
Z && (null == M || M.result(e)),
sf(e, E, {
logger: g
})
}
)).catch((function(e) {
return Z && (null == M || M.error()),
_.handleFetchErrorTagged(f, e, E)
}
))
}, $f = {
mandate_data: {
customer_acceptance: {
type: "online",
online: {
infer_from_client: !0
}
}
}
}, eh = function(e, t) {
switch (e) {
case "acss_debit":
case "au_becs_debit":
case "bacs_debit":
case "bancontact":
case "cashapp":
case "ideal":
case "sepa_debit":
case "eps":
case "sofort":
case "nz_bank_account":
case "link":
case "demo_pay":
case "revolut_pay":
case "amazon_pay":
case "kr_market":
case "ng_market":
case "ng_card":
case "us_bank_account":
case "kr_card":
case "kakao_pay":
case "naver_pay":
return $f;
case "paypal":
return t && (0,
x.Kn)(t.paypal) && t.paypal.risk_correlation_id ? {} : $f;
default:
return {}
}
}, th = function(e) {
var t = e.deferredIntentSetupFutureUsage
, n = e.intentFirstType
, r = e.intentFirstSetupFutureUsage
, a = e.intentFirstPaymentMethodOptions
, i = e.paymentMethodType
, o = e.paymentMethodOptionsOverriddenBySJS;
if (null != o && o.data && "setup_future_usage"in o.data && o.data.setup_future_usage)
return o.data.setup_future_usage;
if ("on_session" === t || "off_session" === t)
return t;
if ("SETUP_INTENT" === n)
return nh(r);
if ("PAYMENT_INTENT" === n) {
var s, u = i ? null == a || null === (s = a[i]) || void 0 === s ? void 0 : s.setup_future_usage : null;
return "none" === u ? null : u || nh(r)
}
return null
}, nh = function(e) {
return void 0 === e || "none" === e ? null : e
}, rh = function(e, t) {
if ("payment_method_data" !== e.type)
throw new Error("Incorrect data passed");
var n = (0,
b.Z)((0,
b.Z)({}, e.paymentMethodData), {}, {
type: "card",
card: {
token: t
}
});
return (0,
b.Z)((0,
b.Z)({}, e), {}, {
paymentMethodData: n
})
}, ah = ["pay", "checkout"], ih = ["light", "dark"], oh = {
thirdPartyFrameType: "AmazonPayButton",
isSupported: (0,
Jr.gG)() && !Jr.aS,
rolloutConfig: {
type: "ga",
circuitBreaker: "elements_disable_express_checkout_button_amazon_pay"
},
recurringFlowsRolloutConfig: {
type: "ga",
circuitBreaker: "elements_disable_recurring_express_checkout_button_amazon_pay"
},
confirmationTokenRolloutConfig: {
type: "ga"
},
supportedButtonThemes: ih,
defaultButtonTheme: "light",
defaultBackgroundDarkButtonTheme: "light",
defaultBackgroundLightButtonTheme: "dark",
supportedButtonTypes: ah,
defaultButtonTypeOption: "pay",
plainButtonType: "pay",
isNextActionSupported: !0
}, sh = {
thirdPartyFrameType: "DemoPayButton",
isSupported: !0,
rolloutConfig: {
type: "beta",
betaGate: "elements_enable_express_checkout_button_demo_pay"
},
recurringFlowsRolloutConfig: {
type: "ga"
},
confirmationTokenRolloutConfig: {
type: "ga"
},
supportedButtonThemes: ih,
defaultButtonTheme: "light",
defaultBackgroundDarkButtonTheme: "light",
defaultBackgroundLightButtonTheme: "dark",
supportedButtonTypes: ah,
defaultButtonTypeOption: "pay",
plainButtonType: "pay",
isNextActionSupported: !0
}, uh = (Ge = {},
(0,
v.Z)(Ge, "demo_pay", sh),
(0,
v.Z)(Ge, "amazon_pay", oh),
Ge), lh = function(e) {
return Object.keys(uh).reduce((function(t, n) {
var r = e(n, uh[n])
, a = (0,
g.Z)(r, 2)
, i = a[0]
, o = a[1];
return (0,
b.Z)((0,
b.Z)({}, t), {}, (0,
v.Z)({}, i, o))
}
), {})
}, ch = function(e) {
return lh((function(t, n) {
return [t, e(t, n)]
}
))
}, dh = function(e) {
return lh((function(t, n) {
return [mh(t), e(t, n)]
}
))
}, ph = function(e) {
return hh().indexOf(e) >= 0
}, mh = function(e) {
return (0,
x.i3)(e)
}, fh = function(e) {
return uh[e]
}, hh = (0,
x.qe)((function() {
return (0,
O.qh)(uh).map((function(e) {
return (0,
g.Z)(e, 1)[0]
}
))
}
)), _h = ["auto", "never"], yh = ((0,
b.Z)((0,
b.Z)({}, dh((function() {
return "never"
}
))), {}, {
googlePay: "never",
applePay: "never",
paypal: "never",
link: "never"
}),
hh(),
dh((function(e, t) {
return t
}
)),
ch((function(e, t) {
return t.thirdPartyFrameType
}
)),
ch((function(e, t) {
return t.isSupported
}
))), vh = (dh((function(e, t) {
return t.supportedButtonThemes
}
)),
dh((function(e, t) {
return t.defaultBackgroundLightButtonTheme
}
)),
dh((function(e, t) {
return t.defaultBackgroundDarkButtonTheme
}
)),
dh((function(e, t) {
return t.defaultButtonTypeOption
}
))), gh = (dh((function(e, t) {
return t.supportedButtonTypes
}
)),
dh((function(e, t) {
return t.plainButtonType
}
))), bh = ch((function(e, t) {
return t.isNextActionSupported
}
)), Sh = (dh((function() {
return (0,
M.jt)(M.kw.apply(void 0, (0,
Z.Z)(_h)))
}
)),
dh((function(e, t) {
return t.rolloutConfig
}
))), kh = {
applePay: "black",
googlePay: "black",
paypal: "gold",
link: "default",
klarna: "dark"
}, Ch = {
applePay: "white",
googlePay: "white",
paypal: "gold",
link: "default",
klarna: "light"
}, Eh = ((0,
b.Z)({
applePay: "plain",
googlePay: "plain",
paypal: "paypal",
klarna: "pay"
}, gh),
{
layout: "auto",
paymentMethodOrder: [],
buttonHeight: 44,
buttonType: (0,
b.Z)({
applePay: "plain",
googlePay: "buy",
paypal: "paypal",
link: "link",
klarna: "pay"
}, vh),
paymentMethods: {
applePay: "auto",
googlePay: "auto"
}
}), Zh = {
orderId: null,
clientSecret: null,
amount: 0,
shippingRateId: null,
isShippingAddressAccepted: !0
}, Ah = {
billingAgreementToken: null,
clientSecret: null,
billingAgreementId: null
}, Mh = (0,
b.Z)({
apple_pay_inner: !1,
apple_pay_outer: !1,
google_pay: !1,
paypal: !1,
link: !1,
klarna: !1,
card: !1
}, bh), Ph = {
klarnaConfirmationToken: null
}, xh = function(e) {
var t, n, r, a, i = (null === (t = e.session) || void 0 === t ? void 0 : t.orderedPaymentMethodTypesAndWallets.filter((function(t) {
var n;
return -1 === (null === (n = e.session) || void 0 === n ? void 0 : n.unverifiedPaymentMethodsOnDomain.indexOf(t))
}
))) || [], o = !0 === (null === (n = e.session) || void 0 === n ? void 0 : n.featureFlags.elements_enable_link_in_passthrough_ece), s = -1 !== ["PASSTHROUGH", "LINK_CARD_BRAND"].indexOf((null === (r = e.session) || void 0 === r || null === (a = r.linkSettings) || void 0 === a ? void 0 : a.linkMode) || ""), u = -1 !== i.indexOf("card"), l = -1 === i.indexOf("link");
return o && s && u && l
}, Ih = function(e) {
return e.expressCheckoutElement.klarna
}, Nh = function(e) {
return e.expressCheckoutElement.paypalBillingAgreement
}, wh = function(e) {
var t = e.expressCheckoutElement.confirmingPaymentMethodType
, n = xh(e.config);
return "link" === t && n ? "card" : t
}, Th = function(e) {
return e.expressCheckoutElement.confirmNonce
}, Oh = function(e) {
var t, n = e.canUseShipping, r = e.isECE, a = e.elementsState, i = e.shippingParam;
if (n)
if (r)
t = a.expressCheckoutElement.shippingContact;
else {
var o = Qp(Dd)(a)
, s = sm(a, o)
, u = um(a, Dd, null == s ? void 0 : s.phone);
t = s ? (0,
b.Z)((0,
b.Z)({}, s), {}, {
phone: u
}) : null
}
return (0,
O.PM)(t, i)
}, Rh = function(e, t, n) {
var r = !(arguments.length > 3 && void 0 !== arguments[3]) || arguments[3];
if (!(0,
N.uN)(e, N.M4.disable_deferred_intent_client_validation_beta_1) && n) {
var a = ["currency", "mode", "capture_method", "payment_method_types", "on_behalf_of", "payment_method_options"];
return r && a.push("setup_future_usage"),
(0,
b.Z)((0,
b.Z)({}, (0,
O.ei)(n, a)), t ? {
customer: t
} : {})
}
}, Lh = function(e) {
if (e.masterpass || e.visa_checkout) {
var t = Object.keys(e);
if (1 !== t.length) {
var n = t.filter((function(e) {
return "visa_checkout" !== e && "masterpass" !== e
}
));
throw new I.No("Unexpected parameters for ".concat(e.visa_checkout ? "Visa Checkout" : "Masterpass", ": ").concat(n.join(", ")))
}
return !0
}
return !1
}, Dh = function(e, t) {
var n = "disabled" !== t.type ? t.circuitBreaker : void 0
, r = null == e ? void 0 : e.featureFlags;
return n && Fh(r, n) ? "circuit_breaker" : Uh(r, t)
}, Uh = function(e, t) {
var n = t.type;
switch (n) {
case "disabled":
return "manual_override_early_development";
case "beta":
return jh(e, t.betaGate);
case "beta_ga_rollout":
var r = t.betaGate
, a = t.gaFeatureFlag;
return Bh({
featureFlags: e,
betaGate: r,
gaFeatureFlag: a
});
case "ga":
return null;
default:
return n
}
}, jh = function(e, t) {
return Fh(e, t) ? null : "beta_gate_disabled"
}, Bh = function(e) {
var t = e.featureFlags
, n = e.betaGate
, r = e.gaFeatureFlag;
return Fh(t, r) || Fh(t, n) ? null : "beta_gate_disabled"
}, Fh = function(e, t) {
return !(null == e || !e[t])
}, Gh = function(e) {
var t = e.paymentMethod
, n = e.elementConfirming
, r = e.session;
if (qh(t, n)) {
var a = fh(t).confirmationTokenRolloutConfig;
if (!a || !function(e, t) {
return null === Dh(e, t)
}(r, a))
throw Kh("stripe.createConfirmationToken()", t)
}
}, qh = function(e, t) {
return "expressCheckout" === t && !!e && ph(e)
}, Kh = function(e, t) {
var n = (0,
D.Yo)("en", "upe.methods.".concat(t));
return new I.No("".concat(e, " does not support payments through ").concat(n, ". To accept ").concat(n, ", please use stripe.confirmPayment() or stripe.confirmSetup() instead."))
}, Vh = n(45791), zh = n(70136), Hh = {
loading: !1,
error: null,
value: null
}, Yh = {
type: "tabs",
radios: !0,
spacedAccordionItems: !1,
visibleAccordionItemsCount: 5
}, Wh = {
shouldRenderSaveCheckbox: !1,
shouldRenderSetAsDefaultCheckbox: !1,
saveLabel: void 0,
setAsDefaultLabel: void 0,
removeSavedDialogBody: void 0,
maxVisiblePaymentMethods: void 0
}, Jh = {
savePaymentConsentGiven: !1,
setAsDefault: !1
}, Xh = ["expired_card", "generic_decline", "incorrect_zip", "invalid_expiry_month", "invalid_expiry_year"], Qh = ["incorrect_cvc", "invalid_cvc"], $h = function(e) {
var t, n, r, a, i = e.paymentState, o = e.session, s = e.shouldRenderSaveCheckbox, u = i.selectedPaymentForm, l = i.options, c = !(null == o || null === (t = o.customer) || void 0 === t || !t.defaultPaymentMethod || (null === (n = i.customerSessionSavedPayment.updatingSavedPayment) || void 0 === n ? void 0 : n.id) !== o.customer.defaultPaymentMethod), d = li(o), p = (null === (r = l.savePaymentMethod) || void 0 === r ? void 0 : r.enableSetAsDefault) || "auto", m = !s, f = !!(s && u && null !== (a = i.form[u]) && void 0 !== a && a.values.savePayment);
return (m || f) && !c && (d || void 0 === d && "auto" === p)
}, e_ = function(e) {
var t = e.config.session
, n = function(e) {
var t;
return null !== (t = ui(e)) && void 0 !== t ? t : function(e) {
var t;
return "never" !== ((null === (t = e.paymentElement.options.savePaymentMethod) || void 0 === t ? void 0 : t.enableSave) || "auto")
}(e)
}(e);
return !!t && n && Sc(t) && (!Xa(e) || Ua(e, "elements_enable_link_spm"))
}, t_ = function(e) {
var t = e.config.session
, n = e.paymentElement
, r = n.selectedPaymentForm
, a = n.options;
if (!t || !r || !e_(e) || !function(e) {
if (Ua(e, "elements_enable_read_allow_redisplay"))
return !0;
var t = (e.config.session || {}).setupFutureUsage;
return "off_session" !== t || "off_session" === t && (0,
N.uN)(e.config.betas, N.M4.elements_spm_sfu_off_session_override_beta_1)
}(e) || pi(e))
return Wh;
var i, o, s, u, l, c, d, p, m, f, h, _ = function(e) {
var t = e.elementsState
, n = "saved" === ya(t);
if (Ua(t, "elements_enable_read_allow_redisplay") && ui(t))
return !n;
var r = Oa(t)
, a = (t.config.session || {}).setupFutureUsage;
return "PAYMENT_INTENT" === r && !a && !n
}({
elementsState: e
});
Ua(e, "elements_spm_messages") && (i = (null === (u = a.savePaymentMethod) || void 0 === u || null === (l = u.messages) || void 0 === l ? void 0 : l.saveLabel) || void 0,
o = (null === (c = a.savePaymentMethod) || void 0 === c || null === (d = c.messages) || void 0 === d ? void 0 : d.setAsDefaultLabel) || void 0,
s = (null === (p = a.savePaymentMethod) || void 0 === p || null === (m = p.messages) || void 0 === m ? void 0 : m.removeSavedDialogBody) || void 0);
Ua(e, "elements_spm_max_visible_payment_methods") && (f = null === (h = a.savePaymentMethod) || void 0 === h ? void 0 : h.maxVisiblePaymentMethods);
return {
shouldRenderSaveCheckbox: _,
shouldRenderSetAsDefaultCheckbox: $h({
paymentState: e.paymentElement,
session: t,
shouldRenderSaveCheckbox: _
}),
saveLabel: i,
setAsDefaultLabel: o,
removeSavedDialogBody: s,
maxVisiblePaymentMethods: f
}
}, n_ = function(e, t) {
var n, r, a, i = e.selectedPaymentForm, o = e.options, s = li(t), u = (null === (n = o.savePaymentMethod) || void 0 === n ? void 0 : n.enableSetAsDefault) || "auto";
if (!t || !i)
return Jh;
var l = !(null != s && !s) && ("never" === u && void 0 === s || !(null === (r = e.form[i]) || void 0 === r || !r.values.setAsDefaultSavedPayment));
return {
savePaymentConsentGiven: !(null === (a = e.form[i]) || void 0 === a || !a.values.savePayment),
setAsDefault: l
}
}, r_ = function(e, t) {
return !("link" === e.paymentMethod.type) && function(e) {
var t, n, r, a, i = null == e || null === (t = e.customer) || void 0 === t || null === (n = t.customerSession) || void 0 === n || null === (r = n.components) || void 0 === r || null === (a = r.paymentElement.features) || void 0 === a ? void 0 : a.paymentMethodUpdate;
switch (i) {
case "enabled":
case void 0:
return !0;
case "never":
case "auto":
case "disabled":
return !1;
default:
return (0,
P.Rz)(i)
}
}(t)
}, a_ = function(e, t, n, r) {
var a, i, o, s, u, l, c, d, p;
if (t.featureFlags.elements_enable_write_allow_redisplay)
if (null != n && null !== (a = n.params) && void 0 !== a && a.payment_method) {
var m = (s = t,
u = n.params.payment_method,
-1 !== (p = null === (l = s.customer) || void 0 === l || null === (c = l.paymentMethods) || void 0 === c ? void 0 : c.findIndex((function(e) {
return e.id === u
}
))) && void 0 !== p ? null === (d = s.customer) || void 0 === d ? void 0 : d.paymentMethods[p].allow_redisplay : void 0);
m && "always" !== m && n.params.set_as_default_payment_method && r.report("spm.".concat(e, ".invalid_set_default_pm"), {
allow_redisplay: m,
set_as_default_payment_method: n.params.set_as_default_payment_method
})
} else if (null != n && null !== (i = n.params) && void 0 !== i && null !== (o = i.payment_method_data) && void 0 !== o && o.allow_redisplay) {
var f = n.params.payment_method_data.allow_redisplay;
f && "always" !== f && n.params.set_as_default_payment_method && r.report("spm.".concat(e, ".invalid_set_default_pm"), {
allow_redisplay: f,
set_as_default_payment_method: n.params.set_as_default_payment_method
})
}
}, i_ = function(e) {
var t, n = e.slug, r = e.elementsState;
if ("update_payment_intent" !== n && (null !== (t = r.config.session) && void 0 !== t && t.customer))
return n_(r.paymentElement, r.config.session).setAsDefault
}, o_ = n(56274).Promise, s_ = ["locale"], u_ = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return r = t.logger,
a = n.locale,
e.abrupt("return", o_.all([Hr(a), (0,
D.HO)(a)]).then((function() {}
), (function(e) {
r.log("error.locale_load_error", {
error: e,
locale: a
})
}
)));
case 3:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), l_ = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return r = n.locale,
e.abrupt("return", (0,
mn.jR)(r));
case 2:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), c_ = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return r = t.integrationMetadata,
a = n.message,
i = n.data,
o = n.locale,
e.abrupt("return", i ? (0,
D.cg)(r.resolveLocale(o), a, i) : (0,
D.pY)(r.resolveLocale(o), a));
case 3:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), d_ = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o, s, u, l, c;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return r = t.integrationMetadata,
a = t.logger,
i = n.locale,
o = (0,
h.Z)(n, s_),
s = G(o, r.resolveLocale(i)),
u = s.localizedError,
l = s.reports,
c = s.localized,
l.forEach((function(e) {
return a.log.apply(a, (0,
Z.Z)(e))
}
)),
e.abrupt("return", o_.resolve({
error: u,
localized: c
}));
case 5:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), p_ = n(69662), m_ = n(54379), f_ = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return r = t.logger,
a = n.locale,
i = (0,
mn.Nj)(a),
e.abrupt("return", (0,
p_.w)(i, m_.$).catch((function(e) {
return r.log("error.locale_load_error", {
error: e,
detectedLocale: i
}),
{}
}
)));
case 4:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), h_ = function(e) {
return {
type: "error",
error: e
}
}, __ = function(e) {
if ("error" === e.type)
return e;
var t = e.object;
switch (t.status) {
case "requires_confirmation":
case "requires_capture":
case "succeeded":
return e;
case "canceled":
return h_(function(e) {
switch (e.object) {
case "payment_intent":
return {
code: "payment_intent_unexpected_state",
doc_url: "https://stripe.com/docs/error-codes/payment-intent-unexpected-state",
payment_intent: e,
type: "invalid_request_error"
};
case "setup_intent":
return {
code: "setup_intent_unexpected_state",
doc_url: "https://stripe.com/docs/error-codes/setup-intent-unexpected-state",
setup_intent: e,
type: "invalid_request_error"
};
default:
return (0,
P.Rz)(e)
}
}(t));
default:
return h_(function(e) {
switch (e.object) {
case "payment_intent":
return e.last_payment_error ? (0,
b.Z)((0,
b.Z)({}, e.last_payment_error), {}, {
payment_intent: e
}) : {
code: "payment_intent_authentication_failure",
doc_url: "https://stripe.com/docs/error-codes/payment-intent-authentication-failure",
payment_intent: e,
type: "invalid_request_error"
};
case "setup_intent":
return e.last_setup_error ? (0,
b.Z)((0,
b.Z)({}, e.last_setup_error), {}, {
setup_intent: e
}) : {
code: "setup_intent_authentication_failure",
doc_url: "https://stripe.com/docs/error-codes/setup-intent-authentication-failure",
setup_intent: e,
type: "invalid_request_error"
};
default:
return (0,
P.Rz)(e)
}
}(t))
}
}, y_ = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o, s, u, l, c, d, p, m, f;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return r = t.apiClient,
a = t.logger,
i = t.integrationMetadata,
o = n.intentSecret,
s = n.hosted,
u = n.locale,
l = n.asErrorIfNotSucceeded,
c = n.expandParam,
d = n.allowRetries,
p = i.resolveLocale(u),
e.next = 5,
r.paymentIntents.retrieve({
id: o.id,
data: {
is_stripe_sdk: s,
expand: c || [],
client_secret: o.clientSecret
},
allowRetries: !!d,
log: a.log,
options: {
localeOverride: p
}
});
case 5:
return m = e.sent,
f = l ? __(m) : m,
e.abrupt("return", sf(f, p, {
logger: a
}));
case 8:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), v_ = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o, s, u, l, c, d, p, m, f;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return r = t.apiClient,
a = t.logger,
i = t.integrationMetadata,
o = n.intentSecret,
s = n.hosted,
u = n.locale,
l = n.asErrorIfNotSucceeded,
c = n.expandParam,
d = n.allowRetries,
p = i.resolveLocale(u),
e.next = 5,
r.setupIntents.retrieve({
id: o.id,
data: {
client_secret: o.clientSecret,
is_stripe_sdk: s,
expand: c || []
},
allowRetries: !!d,
log: a.log,
options: {
localeOverride: p
}
});
case 5:
return m = e.sent,
f = l ? __(m) : m,
e.abrupt("return", sf(f, p, {
logger: a
}));
case 8:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), g_ = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return r = t.apiClient,
a = n.source,
i = a.id,
o = a.client_secret,
e.abrupt("return", r.sources.retrieve({
id: i,
data: {
client_secret: o
}
}));
case 4:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), b_ = function(e) {
if (e.length <= ke.fh)
return {
layoutType: null
};
var t = e.substring(ke.A9, ke.A9 + ke.gJ).charAt(ke.bT);
return {
layoutType: function() {
switch (t) {
case ke.KA:
return "single_column";
case ke.QS:
return "single_item";
case ke.VS:
return "multi_item";
default:
return "single_item"
}
}()
}
}, S_ = n(56274).Promise, k_ = ["betas"], C_ = ["apiKey", "stripeAccount", "mids", "referrerOrigin", "betas", "layoutType"], E_ = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o, s, u, l, c, d, p, m, f, _, y;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return r = t.apiClient,
a = t.integrationMetadata,
i = n.betas,
o = (0,
h.Z)(n, k_),
s = "create_payment_page",
u = o.locale || a.globalLocale,
e.next = 6,
r.paymentPages.create({
data: o,
options: {
localeOverride: o.locale
}
});
case 6:
if ("error" !== (l = e.sent).type) {
e.next = 13;
break
}
if (c = l.error,
r.reportFetchResult(s, l),
"api_connection_error" === c.type) {
e.next = 12;
break
}
throw new I.No(c.message || c.code || "unexpected error");
case 12:
return e.abrupt("return", l);
case 13:
return d = l.object,
p = d.url,
m = d.session_id,
r.reportFetchResult(s, l, {
url: p
}),
f = b_(m),
_ = f.layoutType,
y = A_({
apiKey: r.getApiKey(),
stripeAccount: r.getStripeAccount(),
referrerOrigin: a.referrerOrigin,
mids: r.getMids(),
betas: i,
locale: u,
layoutType: _
}),
l.object.url = "".concat(M_(p), "#").concat(y),
e.abrupt("return", l);
case 19:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), Z_ = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o, s, u, l, c, d, p, m;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return r = t.apiClient,
a = t.integrationMetadata,
i = t.logger,
o = n.betas,
s = n.sessionId,
u = s.trim(),
l = b_(u),
c = l.layoutType,
d = A_({
apiKey: r.getApiKey(),
stripeAccount: r.getStripeAccount(),
referrerOrigin: a.referrerOrigin,
mids: r.getMids(),
betas: o,
layoutType: c
}),
"https://checkout.stripe.com/",
p = M_("".concat("https://checkout.stripe.com/", "c/pay/").concat(encodeURIComponent(u))),
m = sf({
type: "object",
object: {
url: "".concat(p, "#").concat(d)
}
}, a.resolveLocale(), {
logger: i
}),
e.abrupt("return", S_.resolve(m));
case 9:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), A_ = function(e) {
var t = e.apiKey
, n = e.stripeAccount
, r = e.mids
, a = e.referrerOrigin
, i = e.betas
, o = e.layoutType
, s = (0,
h.Z)(e, C_);
return ne(JSON.stringify((0,
b.Z)({
apiKey: t,
stripeAccount: n,
mids: r,
betas: i,
layoutType: o,
referrerOrigin: a || null
}, s)))
}, M_ = function(e) {
return e.replace("https://checkout.stripe.com/", "https://checkout.stripe.com/")
}, P_ = ["guid", "muid", "sid"], x_ = (0,
M.mC)({
promotion_code: M.Z_,
passive_captcha_ekey: (0,
M.jt)((0,
M.AG)(M.Z_)),
passive_captcha_token: (0,
M.jt)((0,
M.AG)(M.Z_))
}), I_ = (0,
M.mC)({
country: (0,
M.jt)((0,
M.AG)(M.Z_)),
line1: (0,
M.jt)((0,
M.AG)(M.Z_)),
line2: (0,
M.jt)((0,
M.AG)(M.Z_)),
city: (0,
M.jt)((0,
M.AG)(M.Z_)),
postal_code: (0,
M.jt)((0,
M.AG)(M.Z_)),
state: (0,
M.jt)((0,
M.AG)(M.Z_))
}), N_ = (0,
M.mC)({
tax_region: I_
}), w_ = (0,
M.mC)({
updated_currency: M.Z_
}), T_ = (0,
M.mC)({
updated_line_item_quantity: (0,
M.mC)({
line_item_id: M.Z_,
quantity: M.Rx,
fail_update_on_discount_error: M.Xg
})
}), O_ = (0,
M.mC)({
shipping_rate: M.Z_
}), R_ = (0,
M.mC)({
init_checksum: (0,
M.jt)((0,
M.AG)(M.Z_)),
version: M.Z_,
payment_method: M.Z_,
expected_amount: (0,
M.jt)(M.Rx),
js_checksum: M.Z_,
passive_captcha_token: (0,
M.jt)(M.Z_),
passive_captcha_ekey: (0,
M.jt)(M.Z_),
last_displayed_line_item_group_details: (0,
M.jt)((0,
M.mC)({
subtotal: M.Rx,
total_exclusive_tax: M.Rx,
total_inclusive_tax: M.Rx,
total_discount_amount: M.Rx,
shipping_rate_amount: M.Rx
})),
shipping: (0,
M.jt)((0,
M.AG)((0,
M.mC)({
name: (0,
M.AG)(M.Z_),
address: I_
}))),
expected_payment_method_type: (0,
M.jt)(M.Z_),
return_url: (0,
M.jt)((0,
M.AG)(M.Z_)),
phone_number_collection: (0,
M.jt)((0,
M.AG)((0,
M.mC)({
phone: M.Z_,
source: M.Z_
}))),
save_payment_method: (0,
M.jt)(M.Xg)
}), L_ = (0,
M.mC)({
init_checksum: (0,
M.jt)((0,
M.AG)(M.Z_)),
version: M.Z_,
expected_amount: M.Rx,
js_checksum: M.Z_,
passive_captcha_token: (0,
M.jt)(M.Z_),
passive_captcha_ekey: (0,
M.jt)(M.Z_),
last_displayed_line_item_group_details: (0,
M.jt)((0,
M.mC)({
subtotal: M.Rx,
total_exclusive_tax: M.Rx,
total_inclusive_tax: M.Rx,
total_discount_amount: M.Rx,
shipping_rate_amount: M.Rx
})),
shipping: (0,
M.jt)((0,
M.AG)((0,
M.mC)({
name: (0,
M.AG)(M.Z_),
address: I_
}))),
return_url: (0,
M.jt)((0,
M.AG)(M.Z_)),
phone_number_collection: (0,
M.jt)((0,
M.AG)((0,
M.mC)({
phone: M.Z_,
source: M.Z_
}))),
customer_data: (0,
M.mC)({
email: (0,
M.jt)((0,
M.AG)(M.Z_)),
name: (0,
M.jt)((0,
M.AG)(M.Z_)),
address: (0,
M.jt)(I_)
})
}), D_ = function(e) {
var t = e.guid
, n = e.muid
, r = e.sid
, a = (0,
h.Z)(e, P_)
, i = null
, o = [];
if (t && n && r) {
var s = (0,
M.Gu)(_t.pt, {
guid: t,
muid: n,
sid: r
}, "validateConfirmPaymentParams");
i = s.value,
o = s.warnings
}
var u = "payment_method"in a ? (0,
M.Gu)(R_, a, "validateConfirmPaymentParams") : (0,
M.Gu)(L_, a, "validateConfirmPaymentParams")
, l = u.value
, c = u.warnings;
return {
value: i ? (0,
b.Z)((0,
b.Z)({}, i), l) : l,
warnings: [].concat((0,
Z.Z)(o), (0,
Z.Z)(c))
}
}, U_ = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return r = t.apiClient,
a = t.logger,
i = n.checkoutSessionId,
a.updateParams({
checkout_session_id: i
}),
e.abrupt("return", r.paymentPages.init({
id: i,
data: {}
}));
case 4:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), j_ = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return r = t.apiClient,
a = n.checkoutSessionId,
e.abrupt("return", r.paymentPages.retrieve({
id: a,
data: {}
}));
case 3:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), B_ = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o, s, u, l;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return r = t.apiClient,
a = t.logger,
i = n.checkoutSessionId,
o = n.data,
s = "promotion_code"in (c = o) ? (0,
M.Gu)(x_, c, "validatePaymentPageUpdateParams") : "tax_region"in c ? (0,
M.Gu)(N_, c, "validatePaymentPageUpdateParams") : "updated_currency"in c ? (0,
M.Gu)(w_, c, "validatePaymentPageUpdateParams") : "updated_line_item_quantity"in c ? (0,
M.Gu)(T_, c, "validatePaymentPageUpdateParams") : "shipping_rate"in c ? (0,
M.Gu)(O_, c, "validatePaymentPageUpdateParams") : (0,
P.Rz)(c),
u = s.value,
(l = s.warnings).length > 0 && l.forEach((function(e) {
return a.warn(e)
}
)),
e.abrupt("return", r.paymentPages.update({
id: i,
data: u
}));
case 5:
case "end":
return e.stop()
}
var c
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), F_ = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o, s, u, l, c;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return r = t.apiClient,
a = t.logger,
i = n.checkoutSessionId,
o = n.data,
s = n.renderLocalizedFlag,
u = D_(o),
l = u.value,
(c = u.warnings).length > 0 && c.forEach((function(e) {
return a.warn(e)
}
)),
e.abrupt("return", r.paymentPages.confirm({
id: i,
data: l,
options: {
renderLocalizedFlag: s
}
}));
case 5:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), G_ = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
r = t.frameHub,
a = n.addressElementFrameId,
i = n.data,
r.sendMessageToFrame(a, {
action: "stripe-internal-address-element-set-value",
payload: i
});
case 3:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), q_ = function() {
function e() {
(0,
C.Z)(this, e),
this.requests = new Map
}
return (0,
E.Z)(e, [{
key: "create",
value: function() {
var e = this
, t = (0,
Iu.Vj)()
, n = new Ru.B;
return this.requests.set(t, n),
n.promise.finally((function() {
return e.requests.delete(t)
}
)),
{
nonce: t,
promise: n.promise
}
}
}, {
key: "resolve",
value: function(e, t) {
var n;
null === (n = this.requests.get(e)) || void 0 === n || n.resolve(t)
}
}, {
key: "reject",
value: function(e, t) {
var n;
null === (n = this.requests.get(e)) || void 0 === n || n.reject(t)
}
}]),
e
}(), K_ = n(97326), V_ = (Error,
Error,
Error,
n(56274).Promise,
"".concat(V.L$, "customer_sessions/claim"),
function(e) {
var t = {
id: e.id,
apiKey: e.api_key,
apiKeyExpiry: e.api_key_expiry,
components: null
};
if (e.components) {
var n, r, a, i = e.components, o = i.payment_element, s = i.pricing_table, u = i.buy_button, l = {
enabled: null !== (n = null == o ? void 0 : o.enabled) && void 0 !== n && n,
features: null != o && o.features ? {
paymentMethodSave: o.features.payment_method_save,
paymentMethodSaveUsage: o.features.payment_method_save_usage,
paymentMethodRemove: o.features.payment_method_remove,
paymentMethodUpdate: o.features.payment_method_update,
paymentMethodSetAsDefault: o.features.payment_method_set_as_default
} : void 0
}, c = {
enabled: null !== (r = null == s ? void 0 : s.enabled) && void 0 !== r && r
}, d = {
enabled: null !== (a = null == u ? void 0 : u.enabled) && void 0 !== a && a
};
t.components = {
paymentElement: l,
pricingTable: c,
buyButton: d
}
}
return t
}
), z_ = ["amazon_pay", "card", "link", "paypal"], H_ = ["setup_future_usage"], Y_ = function(e) {
return e.payment_method_configuration ? {
payment_method_configuration: {
id: e.payment_method_configuration
}
} : {}
}, W_ = function(e, t) {
var n;
if (e)
switch (n = !e.payment_method_options || "checkout" !== t && "payment_link" !== t ? e.payment_method_options : function(e) {
e.amazon_pay;
var t, n = e.card, r = (e.link,
e.paypal,
(0,
h.Z)(e, z_));
if (n) {
n.setup_future_usage;
var a = (0,
h.Z)(n, H_);
t = (0,
b.Z)((0,
b.Z)({}, r), Object.keys(a).length > 0 ? {
card: a
} : void 0)
} else
t = r;
return Object.keys(t).length > 0 ? t : void 0
}(e.payment_method_options),
e.mode) {
case "payment":
return (0,
b.Z)((0,
b.Z)({
mode: "payment",
amount: e.amount,
currency: e.currency,
payment_method_types: e.payment_method_types,
setup_future_usage: e.setup_future_usage,
capture_method: e.capture_method
}, Y_(e)), {}, {
on_behalf_of: e.on_behalf_of,
payment_method_options: n
});
case "setup":
return (0,
b.Z)((0,
b.Z)({
mode: "setup",
currency: e.currency,
payment_method_types: e.payment_method_types,
setup_future_usage: e.setup_future_usage,
capture_method: e.capture_method
}, Y_(e)), {}, {
on_behalf_of: e.on_behalf_of,
payment_method_options: n
});
case "subscription":
return (0,
b.Z)((0,
b.Z)({
mode: "subscription",
amount: e.amount,
currency: e.currency,
setup_future_usage: e.setup_future_usage,
payment_method_types: e.payment_method_types
}, Y_(e)), {}, {
on_behalf_of: e.on_behalf_of,
payment_method_options: n
})
}
}, J_ = n(56274).Promise, X_ = Object.freeze({
flags: {},
experiments_data: {
arb_id: null,
experiment_assignments: {}
},
shipping_address_settings: {
autocomplete_allowed: !1
},
unactivated_payment_method_types: [],
link_settings: {
link_bank_onboarding_enabled: !1,
link_session_storage_login_enabled: !1,
link_local_storage_login_enabled: !1,
link_financial_incentives_experiment_enabled: !1,
link_email_verification_login_enabled: !1,
link_crypto_onramp_bank_upsell: !1,
link_crypto_onramp_elements_logout_disabled: !1,
link_crypto_onramp_force_cvc_reverification: !1,
link_bank_incentives_enabled: !1,
link_authenticated_change_event_enabled: !1,
link_funding_sources: [],
link_supported_payment_methods: [],
link_only_for_payment_method_types_enabled: !1,
link_passthrough_mode_enabled: !1,
link_elements_pageload_sign_up_disabled: !1,
link_elements_billing_country_sign_up_disabled: !1,
link_elements_is_crypto_onramp: !1,
link_pay_button_element_enabled: !1,
link_payment_element_disabled_by_targeting: !1,
link_enable_email_otp_for_link_popup: !1,
link_enable_webauthn_for_link_popup: !1,
link_enable_instant_debits_in_testmode: !1,
link_disabled_reasons: {
payment_element_passthrough_mode: [],
payment_element_payment_method_mode: []
},
link_payment_element_enable_webauthn_login: !1,
link_payment_element_smart_defaults_enabled: !1,
link_targeting_results: {},
link_pm_killswitch_on_in_elements: !1,
link_no_code_default_values_identification: !1,
link_no_code_default_values_recall: !1,
link_no_code_default_values_usage: !1,
link_no_code_default_values_dashboard_setting: !1,
link_hcaptcha_site_key: null,
link_hcaptcha_rqdata: null,
link_mode: null,
link_default_opt_in: null,
link_in_optional_default_opt_in_experiment: !1,
link_payment_session_context: null,
link_consumer_incentive: null,
link_instant_debits_new_incentive_display_enabled: !1,
link_new_consumer_incentive_system_enabled: !1
},
klarna_express_config: {
klarna_mid: null
},
paypal_express_config: {
client_id: null,
paypal_merchant_id: null
},
link_purchase_protections_data: {
is_eligible: !1,
type: null
},
payment_method_specs: [],
account_id: null,
unverified_payment_methods_on_domain: [],
card_brand_choice: Ea,
auth_session_client_secret: null,
passive_captcha: null,
capability_enabled_card_networks: [],
card_installments_enabled: !1,
is_connect_platform: !1
}), Q_ = ["ideal", "sepa_debit"], $_ = function(e) {
if (0 === e.length)
return null;
if (1 === e.length)
return e;
var t = e.filter((function(e, t, n) {
return n.findIndex((function(t) {
return t.card.fingerprint === e.card.fingerprint
}
)) === t
}
));
return t.slice(0, Math.min(3, t.length))
}, ey = function(e, t) {
return t.financial_connections_enable_deferred_intent_flow ? e : e.filter((function(e) {
return -1 === ["us_bank_account"].indexOf(e)
}
))
}, ty = function(e, t, n, r, a, i) {
var o, s, u, l;
if ("error" === e.type)
return [e, []];
var c, d = function(e, t, n) {
if (e.ordered_payment_method_types_and_wallets.every((function(e) {
return -1 === lo.indexOf(e)
}
))) {
if (t) {
var r = "No valid payment method types for this configuration. Please ensure that you have activated payment methods compatible with your chosen currency in your dashboard (https://dashboard.stripe.com/settings/payment_methods)";
return "payment" === t.mode && t.amount ? {
type: "validation_error",
message: "".concat(r, " and that the `amount` (").concat(t.amount, ") is not lower than the `currency` (").concat(t.currency, ") minimum: https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts."),
extra_fields: {
nonBlocking: !0
}
} : "subscription" === t.mode ? {
type: "validation_error",
message: "".concat(r, " and invoice settings (https://dashboard.stripe.com/settings/billing/invoice) and that the `amount` (").concat(t.amount, ") is not lower than the `currency` (").concat(t.currency, ") minimum: https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts."),
extra_fields: {
nonBlocking: !0
}
} : {
type: "validation_error",
message: "".concat(r, ".")
}
}
return {
type: "validation_error",
code: "unsupported_parameter",
param: "payment_method_types",
message: "The Intent you passed doesn't have any supported payment_method_types. Please ensure that you have activated payment methods compatible with your chosen currency in your dashboard (https://dashboard.stripe.com/settings/payment_methods)"
}
}
var a = -1 !== e.ordered_payment_method_types_and_wallets.indexOf("card")
, i = -1 !== e.ordered_payment_method_types_and_wallets.indexOf("link")
, o = e.link_settings.link_only_for_payment_method_types_enabled
, s = n === ua.wl;
if (i && !a && !o && !s)
return {
type: "validation_error",
code: "unsupported_parameter",
param: "payment_method_types",
message: "To use 'link' with the PaymentElement, please pass both 'link' and 'card' as payment_method_types."
};
var u = 1 === e.ordered_payment_method_types_and_wallets.length && -1 !== e.ordered_payment_method_types_and_wallets.indexOf("link")
, l = 0 === e.link_settings.link_funding_sources.length;
return u && l ? {
type: "validation_error",
code: "unsupported_parameter",
param: "payment_method_types",
message: "No link funding sources available. Please pass in additional supported payment_method_types."
} : null
}(e.object, r, i);
if (d) {
var p;
if (He.log("upe.validation_error", {
session_details: {
elements_session_id: e.object.session_id,
merchant_id: e.object.merchant_id,
payment_method_types: e.object.ordered_payment_method_types_and_wallets
},
error_code: d.code,
error_message: d.message,
error_type: d.type
}),
null === (p = d.extra_fields) || void 0 === p || !p.nonBlocking)
return [{
type: "error",
error: d
}, []];
c = d
}
var m = e.object
, f = m.link_settings
, h = m.bacs_debit_info
, _ = void 0 === h ? null : h
, y = m.sepa_debit_info
, v = void 0 === y ? null : y
, S = m.card_installments_enabled
, k = void 0 !== S && S
, C = m.business_name
, E = void 0 === C ? null : C
, A = m.merchant_country
, M = void 0 === A ? null : A
, x = m.merchant_currency
, I = void 0 === x ? null : x
, N = m.merchant_id
, w = m.merchant_logo_url
, T = void 0 === w ? null : w
, O = m.customer_info
, L = m.customer
, D = m.customer_error
, U = m.custom_payment_method_data
, j = m.card_brand_choice
, B = m.payment_method_preference.country_code
, F = void 0 === B ? null : B
, G = m.ordered_payment_method_types_and_wallets
, q = m.unverified_payment_methods_on_domain
, K = m.unactivated_payment_method_types
, V = m.flags
, z = m.experiments_data
, H = m.klarna_express_config
, Y = m.paypal_express_config
, W = m.link_purchase_protections_data
, J = m.shipping_address_settings
, Q = m.payment_method_specs
, $ = m.account_id
, ee = m.filter_cards
, te = m.passive_captcha
, ne = m.prefill_selectors
, re = m.capability_enabled_card_networks
, ae = m.is_connect_platform;
He.log("link.settings.opt_in_and_disabled_reasons", {
response_merchant_id: N,
default_opt_in: f.link_default_opt_in,
payment_element_passthrough_mode: f.link_disabled_reasons.payment_element_passthrough_mode,
payment_element_payment_method_mode: f.link_disabled_reasons.payment_element_payment_method_mode
});
var ie = r ? ey(G, V) : G;
i === ua.wl && (ie = function(e) {
var t = -1 !== e.indexOf("card");
return -1 === e.indexOf("link") || t ? e : e.filter((function(e) {
return "link" !== e
}
))
}(ie));
var oe, se, ue, le, ce, de = function(e) {
var t = e.deferredIntent
, n = e.unactivatedPaymentMethodTypes
, r = e.featureFlags
, a = n.filter((function(e) {
return "apple_pay_later" !== e
}
));
return t && (a = ey(a, r)),
a
}({
unactivatedPaymentMethodTypes: K,
deferredIntent: r,
featureFlags: V
}), pe = e.object.payment_method_preference;
switch (pe.type) {
case "payment_intent":
se = (oe = pe.payment_intent).amount;
break;
case "setup_intent":
oe = pe.setup_intent,
se = null;
break;
case "deferred_intent":
if (!r)
throw new Error("Unexpected elements session and client options combination");
se = (oe = {
object: "deferred_intent",
livemode: "live" === t,
currency: r.currency || null,
amount: "setup" !== r.mode && r.amount || null,
status: "requires_payment_method",
automatic_payment_methods: {
enabled: !r.payment_method_types
},
payment_method_options: r.payment_method_options
}).amount;
break;
default:
return (0,
P.Rz)(pe)
}
if (!n || "payment_intent" !== oe.object && "setup_intent" !== oe.object || (ue = function(e) {
switch (e.object) {
case "payment_intent":
case "setup_intent":
return X(e);
default:
return (0,
P.Rz)(e)
}
}(oe)),
"payment_intent" === oe.object || "setup_intent" === oe.object) {
var me = "microdeposits" === (null == (le = oe.payment_method_options) || null === (ce = le.us_bank_account) || void 0 === ce ? void 0 : ce.verification_method) ? {
type: "validation_error",
code: "unsupported_parameter",
param: "payment_method_options",
message: "You passed verification_method: '".concat(le.us_bank_account.verification_method, "' in payment_method_options.us_bank_account. To use 'us_bank_account' with the PaymentElement, please use verification_method: 'automatic', verification_method: 'instant' or verification_method: 'skip'.")
} : null;
if (me)
return [{
type: "error",
error: me
}, []]
}
var fe, he = "setup_intent" === oe.object ? null : oe.currency, _e = function(e, t, n) {
if (t.length > 0) {
if (n === R.Kl.test) {
var r = "- ".concat(t.join("\n- "));
return [e, [["The following payment method types are not activated:\n\n".concat(r, "\n\n"), "They will be displayed in test mode, but hidden in live mode. ", "Please activate the payment method types in your dashboard (https://dashboard.stripe.com/settings/payment_methods) and ensure your account is enabled for any preview features that you are trying to use."].join("")]]
}
return [e.filter((function(e) {
return -1 === t.indexOf(e)
}
)), []]
}
return [e, []]
}(ie, de, t), ye = (0,
g.Z)(_e, 2), ve = ye[0], ge = ye[1], be = function(e, t) {
if (!e || 0 === e.length)
return null;
var n = {}
, r = [];
if (e.forEach((function(e) {
e.error ? t === R.Kl.test && r.push(e.type) : n[e.type] = {
logoUrl: e.logo_url,
displayName: e.display_name
}
}
)),
0 === r.length)
return [n, ""];
var a = "- ".concat(r.join("\n- "))
, i = ["The following custom payment method types are not enabled:\n\n".concat(a, "\n\n"), "Please ensure that your account has configured to use these payment method types in dashboard correctly: https://dashboard.stripe.com/settings/custom_payment_methods."].join("");
return [n, i]
}(U || [], t), Se = null;
e.object.adaptive_pricing && (Se = {
activeCurrency: e.object.adaptive_pricing.active_presentment_currency,
integrationAmount: e.object.adaptive_pricing.integration_amount,
integrationCurrency: e.object.adaptive_pricing.integration_currency,
fxQuoteId: e.object.adaptive_pricing.fx_quote_id,
currencyOptions: null === (fe = e.object.adaptive_pricing.currency_options) || void 0 === fe ? void 0 : fe.map((function(e) {
return {
currency: e.currency,
amount: e.amount,
exchangeRate: e.exchange_rate,
conversionMarkupBps: e.conversion_markup_bps,
referenceRate: e.reference_rate,
referenceRateProvider: e.reference_rate_provider
}
}
))
});
var ke = null;
if (be) {
var Ce = (0,
g.Z)(be, 2)
, Ee = Ce[0]
, Ze = Ce[1];
ke = Ee,
ve.push.apply(ve, (0,
Z.Z)(Object.keys(ke))),
Ze && ge.push(Ze)
}
var Ae = null;
if (D)
ge.push(D.error_message);
else if (L) {
var Me;
Me = (Me = V.elements_enable_link_spm ? L.payment_methods_with_link_details.map((function(e) {
var t = e.payment_method
, n = e.link_payment_details;
return n ? (0,
b.Z)((0,
b.Z)({}, t), {}, {
redacted_payment_details: n
}) : t
}
)) : L.payment_methods).filter((function(e) {
var t;
return !("card" === e.type && "link" === (null === (t = e.card) || void 0 === t ? void 0 : t.brand))
}
));
var Pe = 0 === f.link_disabled_reasons.payment_element_passthrough_mode.length || 0 === f.link_disabled_reasons.payment_element_payment_method_mode.length;
!Me.length || Pe && !V.elements_enable_link_spm || ve.unshift("saved"),
Ae = {
paymentMethods: Me,
defaultPaymentMethod: L.default_payment_method,
customerSession: V_(L.customer_session),
id: L.customer_session.customer
}
}
var xe, Ie = null;
"payment_intent" === oe.object ? Ie = (null === (xe = oe) || void 0 === xe ? void 0 : xe.setup_future_usage) || null : "setup_intent" === oe.object ? Ie = oe.usage || null : "deferred_intent" === oe.object && (Ie = (null == r ? void 0 : r.setup_future_usage) || null);
var Ne, we = null;
"payment_intent" === oe.object ? we = (null === (Ne = oe) || void 0 === Ne ? void 0 : Ne.capture_method) || null : "deferred_intent" === oe.object && r && "capture_method"in r && (we = (null == r ? void 0 : r.capture_method) || null);
var Te = {
isFallback: a,
parsedClientSecret: ue,
isAutomaticPaymentMethods: !(null === (o = oe.automatic_payment_methods) || void 0 === o || !o.enabled),
livemode: oe.livemode,
amount: se,
confirmationMethod: "payment_intent" === oe.object ? oe.confirmation_method : void 0,
elementsSessionId: e.object.session_id ? e.object.session_id : void 0,
applePayTokenRevokeWebhookUrl: e.object.apple_pay_merchant_token_webhook_url,
currency: he,
setupFutureUsage: Ie || null,
captureMethod: we,
merchantInfo: {
businessName: E,
merchantLogoUrl: T,
countryCode: M,
defaultCurrency: I,
id: N
},
customerInfo: O ? {
ephemeralKey: O.ephemeral_key,
id: O.customer.id,
email: O.customer.email,
shipping: O.customer.shipping,
paymentMethods: O.payment_methods
} : null,
customer: Ae,
cardBrandChoice: j || null,
customPaymentMethodData: ke,
detectedCountryCode: F || Qr(he),
orderedPaymentMethodTypesAndWallets: ve,
unverifiedPaymentMethodsOnDomain: q,
unactivatedPaymentMethodTypes: K,
paymentMethodOptions: oe.payment_method_options || {},
lpmPromotions: e.object.lpm_promotions || {},
linkSettings: {
bankOnboardingEnabled: f.link_bank_onboarding_enabled,
sessionStorageLoginEnabled: f.link_session_storage_login_enabled,
localStorageLoginEnabled: f.link_local_storage_login_enabled,
financialIncentivesExperimentEnabled: f.link_financial_incentives_experiment_enabled,
emailVerificationLoginEnabled: f.link_email_verification_login_enabled,
cryptoOnrampBankUpsell: f.link_crypto_onramp_bank_upsell,
cryptoOnrampLogoutDisabled: f.link_crypto_onramp_elements_logout_disabled,
cryptoOnrampForceCvcReverification: f.link_crypto_onramp_force_cvc_reverification,
bankIncentivesEnabled: f.link_bank_incentives_enabled,
authenticatedChangeEventEnabled: f.link_authenticated_change_event_enabled,
linkFundingSources: f.link_funding_sources,
linkSupportedPaymentMethods: f.link_supported_payment_methods,
linkOnlyEnabled: f.link_only_for_payment_method_types_enabled,
linkPassthroughModeEnabled: f.link_passthrough_mode_enabled,
linkPageloadSignUpDisabled: f.link_elements_pageload_sign_up_disabled,
isCryptoOnramp: f.link_elements_is_crypto_onramp,
linkPayButtonElementEnabled: f.link_pay_button_element_enabled,
linkPaymentElementDisabledByTargeting: f.link_payment_element_disabled_by_targeting,
linkEnableEmailOtpForLinkPopup: f.link_enable_email_otp_for_link_popup,
linkEnableWebAuthnForLinkPopup: f.link_enable_webauthn_for_link_popup,
linkEnableInstantDebitsInTestmode: f.link_enable_instant_debits_in_testmode,
linkDisabledReasons: {
paymentElementPassthroughMode: null === (s = f.link_disabled_reasons) || void 0 === s ? void 0 : s.payment_element_passthrough_mode,
paymentElementPaymentMethodMode: null === (u = f.link_disabled_reasons) || void 0 === u ? void 0 : u.payment_element_payment_method_mode
},
linkPaymentElementEnableWebAuthnLogin: f.link_payment_element_enable_webauthn_login,
linkPaymentElementSmartDefaultsEnabled: f.link_payment_element_smart_defaults_enabled,
linkTargetingResults: {
paymentElementPassthroughMode: null === (l = f.link_targeting_results) || void 0 === l ? void 0 : l.payment_element_passthrough_mode
},
linkPmKillswitchOnInElements: f.link_pm_killswitch_on_in_elements,
linkNoCodeDefaultValuesIdentification: f.link_no_code_default_values_identification,
linkNoCodeDefaultValuesRecall: f.link_no_code_default_values_recall,
linkNoCodeDefaultValuesUsage: f.link_no_code_default_values_usage,
linkHcaptchaSiteKey: f.link_hcaptcha_site_key,
linkHcaptchaRqdata: f.link_hcaptcha_rqdata,
linkMode: f.link_mode,
linkDefaultOptIn: f.link_default_opt_in,
linkInOptionalDefaultOptInExperiment: f.link_in_optional_default_opt_in_experiment,
linkPaymentSessionContext: f.link_payment_session_context,
linkConsumerIncentiveOffer: f.link_consumer_incentive,
linkInstantDebitsNewIncentiveDisplay: f.link_instant_debits_new_incentive_display_enabled,
linkNewConsumerIncentiveSystem: f.link_new_consumer_incentive_system_enabled
},
bacsDebitInfo: _,
sepaDebitInfo: v,
cardInstallmentsEnabled: k,
featureFlags: V,
shippingAddressSettings: {
autocompleteAllowed: J.autocomplete_allowed
},
klarnaExpressConfig: H.klarna_mid ? {
klarnaMid: H.klarna_mid
} : null,
paypalExpressConfig: Y.client_id ? {
clientId: Y.client_id,
merchantId: Y.paypal_merchant_id
} : null,
linkPurchaseProtectionsData: {
isEligible: W.is_eligible,
type: W.type
},
objectStatus: oe.status,
paymentMethodSpecs: null != Q ? Q : [],
paymentMethodType: "deferred_intent" !== oe.object && oe.payment_method && "object" == typeof oe.payment_method ? oe.payment_method.type : null,
accountId: $,
experimentsData: {
arbId: z.arb_id,
experimentMetadata: z.experiment_metadata ? {
seed: z.experiment_metadata.seed,
semiDominantPaymentMethods: z.experiment_metadata.semi_dominant_payment_methods
} : null,
experimentAssignments: z.experiment_assignments
},
filterCards: ee && {
filterByAllowingBrands: ee.filter_by_allowing_brands,
filterByDisallowingBrands: ee.filter_by_disallowing_brands
},
passiveCaptcha: te ? {
siteKey: te.site_key,
rqdata: te.rqdata
} : null,
prefillSelectors: ne && {
defaultValues: {
email: ne.default_values.email,
merchantProvidesDefaultValuesOnUpdate: ne.default_values.merchant_provides_default_values_on_update
}
},
capabilityEnabledCardNetworks: null != re ? re : [],
isConnectPlatform: ae,
nonBlockingLoadError: c,
adaptivePricing: Se
};
return [(0,
b.Z)((0,
b.Z)({}, e), {}, {
object: Te
}), ge]
}, ny = function(e) {
return e.status && e.status >= 400 && e.status < 429 && "invalid_request_error" === e.type
}, ry = function(e) {
var t, n = e.clientSecret, r = e.deferredIntent, a = e.customerSessionClientSecret, i = e.locale, o = e.authentication, s = e.referrer, u = e.stripeJsId, l = e.betas, c = e.existingElementsSessionId, d = e.currency, p = e.customPaymentMethods, m = e.paymentUserAgentSuffix, f = e.topOriginForCrossOriginFrame, h = e.elementsInitSource, _ = e.alwaysUseMuas, y = e.adaptivePricing, v = !1, g = n ? n.type.toLowerCase() : "deferred_intent", S = function(e) {
var t, n, r, a, i = e.clientSecret, o = e.deferredIntent, s = e.customerSessionClientSecret, u = e.locale, l = e.authentication, c = e.referrer, d = e.stripeJsId, p = e.betas, m = e.existingElementsSessionId, f = e.currency, h = e.customPaymentMethods, _ = e.paymentUserAgentSuffix, y = e.topOriginForCrossOriginFrame, v = e.elementsInitSource, g = e.adaptivePricing, S = i ? i.type.toLowerCase() : "deferred_intent", k = u && "auto" !== u ? u : (0,
Jr.UT)(), C = "payment_intent" !== S && "setup_intent" !== S ? [] : ["payment_method_preference.".concat(S, ".payment_method")], E = !!(0,
N.uN)(p, N.M4.disable_link_passthrough_beta_1) || void 0, Z = {
client_betas: p,
client_secret: null == i ? void 0 : i.clientSecret,
customer_session_client_secret: s,
deferred_intent: W_(o, v),
currency: f || null
}, A = null;
return _ === ua.wl ? A = "hosted_invoice_page" : "checkout" !== v && "payment_link" !== v || (A = "checkout"),
{
requestParams: (0,
b.Z)((0,
b.Z)((0,
b.Z)((0,
b.Z)((0,
b.Z)((0,
b.Z)((0,
b.Z)({}, Z), l), {}, {
type: S
}, k ? {
locale: k
} : null), {}, {
disable_link_passthrough: E,
referrer_host: null !== (t = null === (n = (0,
T.Ds)(c)) || void 0 === n ? void 0 : n.host) && void 0 !== t ? t : null,
top_level_referrer_host: y && (null !== (r = null === (a = (0,
T.Ds)(y)) || void 0 === a ? void 0 : a.host) && void 0 !== r ? r : null)
}, h ? {
custom_payment_methods: h.map((function(e) {
return e.id
}
))
} : null), {}, {
expand: C
}, m ? {
session_id: m
} : null), A ? {
hosted_surface: A
} : null), {}, {
stripe_js_id: d,
adaptive_pricing_context: g ? {
fx_quote_id: g.fxQuoteId,
active_presentment_currency: g.activeCurrency
} : void 0
}),
merchantParams: Z
}
}({
clientSecret: n,
deferredIntent: r,
customerSessionClientSecret: a,
locale: i,
authentication: o,
referrer: s,
stripeJsId: u,
betas: l,
existingElementsSessionId: c,
currency: d,
customPaymentMethods: p,
paymentUserAgentSuffix: m,
topOriginForCrossOriginFrame: f,
elementsInitSource: h,
adaptivePricing: y
}), k = S.requestParams, C = S.merchantParams, E = function() {
return (0,
Us.Wj)("elements/sessions", "GET", k, {
server: "bapi",
log: He.log,
key: o.key,
merchantParams: C,
expectedErrors: jl.Y
}, {
includeErrorStatus: !0
}).then((function(e) {
return "error" === e.type ? ny(e.error) ? e : (v = !0,
He.log("retrieve_elements_session.unknown_error", (0,
b.Z)((0,
b.Z)({}, e.error), {}, {
server: "bapi"
})),
oy({
type: g,
keyMode: (0,
R.lO)(o.key),
deferredIntent: r,
clientSecret: n,
authentication: o
})) : e
}
))
};
return (_ || (0,
N.HX)(l) ? (t = !0,
(0,
Us.Wj)(my(l, o.key) ? "elements/sessions-edge" : "elements/sessions", "GET", k, {
server: "merchant-ui-api",
log: He.log,
key: o.key,
merchantParams: C,
expectedErrors: jl.Y
}, {
includeErrorStatus: !0,
withCredentials: !0
}).then((function(e) {
return "error" === e.type ? (He.log("retrieve_elements_session.unknown_error", (0,
b.Z)((0,
b.Z)({}, e.error), {}, {
server: "merchant-ui-api"
})),
ny(e.error) ? e : t ? E() : e) : e
}
))) : E()).then((function(e) {
return {
result: e,
isFallback: v
}
}
))
}, ay = function(e, t) {
var n = e.clientSecret
, r = e.deferredIntent
, a = e.customerOptions
, i = e.customerSessionClientSecret
, o = e.locale
, s = e.authentication
, u = e.referrer
, l = e.stripeJsId
, c = e.betas
, d = e.existingElementsSessionId
, p = e.currency
, m = e.customPaymentMethods
, f = e.paymentUserAgentSuffix
, h = e.topOriginForCrossOriginFrame
, _ = e.elementsInitSource
, y = e.alwaysUseMuas
, v = void 0 !== y && y
, S = e.adaptivePricing
, k = t ? t.then((function(e) {
if ("error" === e.type) {
if (ny(e.error))
return {
result: e,
isFallback: !1
};
He.log("retrieve_elements_session.unknown_error", (0,
b.Z)((0,
b.Z)({}, e.error), {}, {
server: "bapi",
is_fastpath: !0
}));
var t = n ? n.type.toLowerCase() : "deferred_intent";
return oy({
type: t,
keyMode: (0,
R.lO)(s.key),
deferredIntent: r,
clientSecret: n,
authentication: s
}).then((function(e) {
return {
result: e,
isFallback: !0
}
}
))
}
return {
result: e,
isFallback: !1
}
}
)) : ry({
clientSecret: n,
deferredIntent: r,
customerSessionClientSecret: i,
locale: o,
authentication: s,
referrer: u,
stripeJsId: l,
betas: c,
existingElementsSessionId: d,
currency: p,
customPaymentMethods: m,
paymentUserAgentSuffix: f,
topOriginForCrossOriginFrame: h,
elementsInitSource: _,
alwaysUseMuas: v,
adaptivePricing: S
});
if (!a)
return k.then((function(e) {
var t = e.result
, a = e.isFallback;
return ty(t, (0,
R.lO)(s.key), null == n ? void 0 : n.clientSecret, r, a, f)
}
));
var C = a.ephemeralKey
, E = a.customer
, Z = {
_stripe_version: s._stripe_version,
_stripe_account: s._stripe_account
}
, A = Ol.paymentMethods.list({
ephemeralKey: C,
data: (0,
b.Z)({
customer: E,
type: "card"
}, Z)
})
, M = Ol.customers.retrieve({
id: E,
ephemeralKey: C,
data: Z,
errorHandlingConfig: {
key: s.key,
log: He.log
}
});
return J_.all([k, A, M]).then((function(e) {
var t = (0,
g.Z)(e, 3)
, n = t[0]
, r = n.result
, a = n.isFallback
, i = t[1]
, o = t[2];
return r.error ? {
result: r,
isFallback: a
} : i.error ? {
result: i,
isFallback: a
} : o.error ? {
result: o,
isFallback: a
} : {
result: (0,
b.Z)((0,
b.Z)({}, r), {}, {
object: (0,
b.Z)((0,
b.Z)({}, r.object), {}, {
customer_info: {
ephemeral_key: C,
customer: o.object,
payment_methods: $_(i.object.data)
}
})
}),
isFallback: a
}
}
)).then((function(e) {
var t = e.result
, a = e.isFallback;
return ty(t, (0,
R.lO)(s.key), null == n ? void 0 : n.clientSecret, r, a, f)
}
))
}, iy = {
createAndParse: ay,
singleFlightCreateAndParse: (qe = ay,
Ke = {},
function() {
for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
t[n] = arguments[n];
var r = JSON.stringify(t)
, a = Ke[r];
if (a)
return a;
var i = qe.apply(void 0, t).finally((function() {
delete Ke[r]
}
));
return Ke[r] = i,
i
}
)
}, oy = function(e) {
var t = e.type
, n = e.keyMode
, r = e.deferredIntent
, a = e.clientSecret
, i = e.authentication;
if (a && t)
return sy(t, a.id, a.clientSecret, i).then((function(e) {
return "error" === e.type ? e : {
type: "object",
object: uy(e.object)
}
}
));
if (r)
return J_.resolve({
type: "object",
object: dy(r, n)
});
throw new Error("Unexpected")
}, sy = function(e, t, n, r) {
return "setup_intent" === e ? Ol.setupIntents.retrieve({
id: t,
data: (0,
b.Z)((0,
b.Z)({}, r), {}, {
client_secret: n
}),
log: He.log
}) : Ol.paymentIntents.retrieve({
id: t,
data: (0,
b.Z)((0,
b.Z)({}, r), {}, {
client_secret: n
}),
log: He.log
})
}, uy = function(e) {
var t, n = py(e), r = "currency"in e ? e.currency : void 0, a = null !== (t = Qr(r)) && void 0 !== t ? t : void 0;
return "setup_intent" === e.object ? (0,
b.Z)((0,
b.Z)({}, X_), {}, {
ordered_payment_method_types_and_wallets: n,
payment_method_preference: {
object: "payment_method_preference",
type: "setup_intent",
setup_intent: e,
ordered_payment_method_types: n,
country_code: a
}
}) : (0,
b.Z)((0,
b.Z)({}, X_), {}, {
merchant_currency: r,
ordered_payment_method_types_and_wallets: n,
payment_method_preference: {
object: "payment_method_preference",
type: "payment_intent",
payment_intent: e,
ordered_payment_method_types: n,
country_code: a
}
})
}, ly = function(e) {
var t, n = e.currency, r = e.keyMode, a = e.amount, i = e.setup_future_usage, o = e.ordered_payment_method_types;
return (0,
b.Z)((0,
b.Z)({}, X_), {}, {
merchant_currency: n,
ordered_payment_method_types_and_wallets: o,
payment_method_preference: {
country_code: n && null !== (t = Qr(n)) && void 0 !== t ? t : void 0,
object: "payment_method_preference",
type: "payment_intent",
ordered_payment_method_types: o,
payment_intent: {
livemode: "live" === r,
object: "payment_intent",
amount: a,
currency: n,
setup_future_usage: i,
automatic_payment_methods: {
enabled: !1
}
}
}
})
}, cy = function(e) {
var t = e.keyMode
, n = e.usage
, r = e.ordered_payment_method_types;
return (0,
b.Z)((0,
b.Z)({}, X_), {}, {
ordered_payment_method_types_and_wallets: r,
payment_method_preference: {
object: "payment_method_preference",
type: "setup_intent",
ordered_payment_method_types: r,
setup_intent: {
livemode: "live" === t,
object: "setup_intent",
usage: n,
automatic_payment_methods: {
enabled: !1
}
}
}
})
}, dy = function(e, t) {
var n = e.payment_method_types || ["card"];
switch (e.mode) {
case "payment":
return ly({
currency: e.currency,
keyMode: t,
amount: e.amount || void 0,
setup_future_usage: e.setup_future_usage,
ordered_payment_method_types: n
});
case "setup":
return cy({
keyMode: t,
usage: e.setup_future_usage,
ordered_payment_method_types: n
});
case "subscription":
return e.amount ? ly({
currency: e.currency,
keyMode: t,
amount: e.amount,
setup_future_usage: "off_session",
ordered_payment_method_types: n
}) : cy({
keyMode: t,
usage: "off_session",
ordered_payment_method_types: n
});
default:
throw new Error("Unexpected")
}
}, py = function(e) {
var t = e.payment_method_types;
return -1 !== t.indexOf("card") ? ["card"] : Q_.filter((function(e) {
return -1 !== t.indexOf(e)
}
))
}, my = function(e, t) {
return (0,
N.uN)(e, N.M4.elements_enable_sessions_edge) && (0,
R.lO)(t) === R.Kl.test
}, fy = n(56274).Promise, hy = function() {
function e() {
var t = this;
(0,
C.Z)(this, e),
this.elementsInitialState = {},
this.elementsActionCounters = {},
this.latestElementsSession = {},
this.pendingElementsUpdates = new Map,
this.wrappedCreateAndParse = function() {
return iy.createAndParse.apply(iy, arguments)
}
,
this.retrieveLatestElementsSession = function(e) {
for (var n = t.latestElementsSession[e], r = arguments.length, a = new Array(r > 1 ? r - 1 : 0), i = 1; i < r; i++)
a[i - 1] = arguments[i];
if (n)
return n.apply(void 0, a);
var o = (0,
x.pA)(t.wrappedCreateAndParse);
return t.latestElementsSession[e] = o,
o.apply(void 0, a)
}
}
var t;
return (0,
E.Z)(e, [{
key: "waitForPendingElementsUpdates",
value: (t = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
var n;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
if (null != (n = this.pendingElementsUpdates.get(t)) && n.size) {
e.next = 3;
break
}
return e.abrupt("return");
case 3:
return e.next = 5,
fy.all(Array.from(n));
case 5:
return e.next = 7,
this.waitForPendingElementsUpdates(t);
case 7:
case "end":
return e.stop()
}
}
), e, this)
}
))),
function(e) {
return t.apply(this, arguments)
}
)
}]),
e
}(), _y = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o, s, u, l, c, d, p;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return r = t.frameHub,
a = t.outerActions,
i = n.frameTypeToErrorMapping,
o = n.groupId,
s = n.store,
e.next = 4,
a.getFramePrecedence();
case 4:
u = e.sent,
l = Object.keys(i).filter((function(e) {
return i[e]
}
)).map((function(e) {
return (0,
Zf.jW)(r, o, e)
}
)).filter((function(e) {
return r.getFrameLoaded(e)
}
)).sort((function(e, t) {
return u[e] - u[t]
}
)),
c = function(e) {
switch (e) {
case L.NC.PAYMENT_ELEMENT:
s.dispatch({
type: "PAYMENT.FOCUS_ERROR",
focus: !0
});
break;
case L.NC.ADDRESS_ELEMENT_SHIPPING:
s.dispatch({
type: "ADDRESS.FOCUS_ERROR",
focus: !0,
mode: Dd
});
break;
case L.NC.ADDRESS_ELEMENT_BILLING:
s.dispatch({
type: "ADDRESS.FOCUS_ERROR",
focus: !0,
mode: Ud
});
break;
case L.NC.LINK_AUTHENTICATION_ELEMENT:
s.dispatch({
type: "AUTHENTICATION.FOCUS_ERROR",
focus: !0
});
break;
default:
throw new Error("This frame type cannot be focused.")
}
}
,
d = null == l ? void 0 : l[0],
(p = r.getFrameType(d)) && c(p);
case 10:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), yy = function(e, t, n, r) {
var a = e.logger
, i = e.apiClient
, o = e.hcaptchaManager
, s = e.frameHub
, u = e.integrationMetadata;
if (r.forEach((function(e) {
a.warn(e)
}
)),
"object" === n.type) {
var l, c, d, p = n.object, m = t ? t.id : void 0;
a.updateParams({
intent_id: m
}),
a.updateParams({
decoupled_intent: !m
}),
a.updateParams({
merchant: null === (l = p.merchantInfo) || void 0 === l ? void 0 : l.id
}),
a.updateParams({
amount: p.amount,
currency: p.currency
}),
p.isFallback || i.reportFetchResult(ke.BL, n, {
experiments: p.experimentsData.experimentAssignments
});
var f = null === (c = p.passiveCaptcha) || void 0 === c ? void 0 : c.siteKey
, h = null === (d = p.passiveCaptcha) || void 0 === d ? void 0 : d.rqdata;
if (f) {
o.setSiteKey("elements", f),
o.setRqdata("elements", h);
var _ = p.linkSettings.linkHcaptchaSiteKey
, y = p.linkSettings.linkHcaptchaRqdata;
_ && (o.setSiteKey("link", _),
o.setRqdata("link", y || void 0)),
setTimeout((function() {
o.isPassiveCaptchaEnabled && !o.isPassiveCaptchaInitialized && (a.log("initialize_passive_captcha_trigger.timeout"),
ft(o, s))
}
), 500)
}
}
return sf(n, u.resolveLocale(), {
logger: a
})
}, vy = {
stripe: !0,
flat: !0,
night: !0,
none: !0
}, gy = Object.keys(vy), by = gy.filter((function(e) {
return "none" !== e
}
)), Sy = {
above: !0,
floating: !0
}, ky = {
fontFamily: "any",
fontSmooth: "any",
fontVariantLigatures: "any",
fontVariationSettings: "any",
fontLineHeight: "any",
fontSizeBase: "length",
fontSizeSm: "length",
fontSizeXs: "length",
fontSize2Xs: "length",
fontSize3Xs: "length",
fontSizeLg: "length",
fontSizeXl: "length",
fontSize2Xl: "length",
fontWeightLight: "any",
fontWeightNormal: "any",
fontWeightMedium: "any",
fontWeightBold: "any",
spacingUnit: "length",
gridRowSpacing: "length",
gridColumnSpacing: "length",
tabSpacing: "length",
pickerItemSpacing: "length",
accordionItemSpacing: "length",
colorPrimary: "colorStrict",
colorBackground: "colorStrict",
colorText: "colorStrict",
colorSuccess: "color",
colorDanger: "colorStrict",
colorWarning: "colorStrict",
colorTextSecondary: "color",
colorTextPlaceholder: "color",
accessibleColorOnColorPrimary: "color",
accessibleColorOnColorBackground: "color",
accessibleColorOnColorSuccess: "color",
accessibleColorOnColorDanger: "color",
accessibleColorOnColorWarning: "color",
iconColor: "color",
iconHoverColor: "color",
iconCardErrorColor: "color",
iconCardCvcColor: "color",
iconCardCvcErrorColor: "color",
iconCheckmarkColor: "color",
iconChevronDownColor: "color",
iconChevronDownHoverColor: "color",
iconCloseColor: "color",
iconCloseHoverColor: "color",
iconLoadingIndicatorColor: "color",
iconMenuColor: "color",
iconMenuHoverColor: "color",
iconMenuOpenColor: "color",
iconPasscodeDeviceColor: "color",
iconPasscodeDeviceHoverColor: "color",
iconPasscodeDeviceNotificationColor: "color",
iconRedirectColor: "color",
tabIconColor: "color",
tabIconHoverColor: "color",
tabIconSelectedColor: "color",
tabIconMoreColor: "color",
tabIconMoreHoverColor: "color",
logoColor: "logo",
tabLogoColor: "logo",
tabLogoSelectedColor: "logo",
blockLogoColor: "logo",
focusBoxShadow: "any",
focusOutline: "any",
borderRadius: "length"
}, Cy = {
spacingGridRow: "gridRowSpacing",
spacingGridColumn: "gridColumnSpacing",
spacingTab: "tabSpacing",
spacingPickerItem: "pickerItemSpacing",
spacingAccordionItem: "accordionItemSpacing",
colorPrimaryText: "accessibleColorOnColorPrimary",
colorBackgroundText: "accessibleColorOnColorBackground",
colorSuccessText: "accessibleColorOnColorSuccess",
colorDangerText: "accessibleColorOnColorDanger",
colorWarningText: "accessibleColorOnColorWarning",
colorIcon: "iconColor",
colorIconHover: "iconHoverColor",
colorIconCardError: "iconCardErrorColor",
colorIconCardCvc: "iconCardCvcColor",
colorIconCardCvcError: "iconCardCvcErrorColor",
colorIconCheckmark: "iconCheckmarkColor",
colorIconChevronDown: "iconChevronDownColor",
colorIconChevronDownHover: "iconChevronDownHoverColor",
colorIconClose: "iconCloseColor",
colorIconCloseHover: "iconCloseHoverColor",
colorIconLoadingIndicator: "iconLoadingIndicatorColor",
colorIconMenu: "iconMenuColor",
colorIconMenuHover: "iconMenuHoverColor",
colorIconMenuOpen: "iconMenuOpenColor",
colorIconPasscodeDevice: "iconPasscodeDeviceColor",
colorIconPasscodeDeviceHover: "iconPasscodeDeviceHoverColor",
colorIconPasscodeDeviceNotification: "iconPasscodeDeviceNotificationColor",
colorIconRedirect: "iconRedirectColor",
colorIconTab: "tabIconColor",
colorIconTabHover: "tabIconHoverColor",
colorIconTabSelected: "tabIconSelectedColor",
colorIconTabMore: "tabIconMoreColor",
colorIconTabMoreHover: "tabIconMoreHoverColor",
colorLogo: "logoColor",
colorLogoTab: "tabLogoColor",
colorLogoTabSelected: "tabLogoSelectedColor",
colorLogoBlock: "blockLogoColor"
}, Ey = (Object.keys(Cy),
{
fontFamily: !0,
fontSize: !0,
color: !0,
letterSpacing: !0,
fontWeight: !0,
fontVariant: !0,
textDecoration: !0,
textShadow: !0,
textTransform: !0,
lineHeight: !0,
"-webkit-font-smoothing": !0,
"-moz-osx-font-smoothing": !0,
"-webkit-text-fill-color": !0,
fontVariation: !0
}), Zy = {
padding: !0,
paddingTop: !0,
paddingRight: !0,
paddingBottom: !0,
paddingLeft: !0
}, Ay = {
margin: !0,
marginTop: !0,
marginRight: !0,
marginBottom: !0,
marginLeft: !0
}, My = {
border: !0,
borderTop: !0,
borderRight: !0,
borderBottom: !0,
borderLeft: !0,
borderRadius: !0,
borderWidth: !0,
borderColor: !0,
borderStyle: !0,
borderTopWidth: !0,
borderTopColor: !0,
borderTopStyle: !0,
borderRightWidth: !0,
borderRightColor: !0,
borderRightStyle: !0,
borderBottomWidth: !0,
borderBottomColor: !0,
borderBottomStyle: !0,
borderLeftWidth: !0,
borderLeftColor: !0,
borderLeftStyle: !0,
borderTopLeftRadius: !0,
borderTopRightRadius: !0,
borderBottomRightRadius: !0,
borderBottomLeftRadius: !0
}, Py = {
outline: !0,
outlineOffset: !0,
boxShadow: !0
}, xy = {
fill: !0
}, Iy = (0,
b.Z)((0,
b.Z)((0,
b.Z)((0,
b.Z)({}, Zy), My), Py), {}, {
backgroundColor: !0,
transition: !0
}), Ny = ((0,
b.Z)((0,
b.Z)((0,
b.Z)((0,
b.Z)((0,
b.Z)((0,
b.Z)((0,
b.Z)({}, Ey), Zy), Ay), My), Py), xy), {}, {
backgroundColor: !0,
transition: !0,
opacity: !0
}),
(0,
b.Z)((0,
b.Z)((0,
b.Z)((0,
b.Z)((0,
b.Z)((0,
b.Z)((0,
b.Z)({}, Ey), Zy), Ay), My), Py), xy), {}, {
backgroundColor: !0,
transition: !0
})), wy = {
Label: !0,
Input: !0,
InputDivider: !0,
Error: !0,
Checkbox: !0,
CheckboxLabel: !0,
CheckboxInput: !0,
CodeInput: !0,
Switch: !0,
SwitchControl: !0,
Dropdown: !0,
DropdownItem: !0,
Tab: !0,
TabIcon: !0,
TabLabel: !0,
Block: !0,
BlockDivider: !0,
BlockAction: !0,
PickerItem: !0,
PickerAction: !0,
Menu: !0,
MenuIcon: !0,
MenuAction: !0,
Icon: !0,
Text: !0,
TermsText: !0,
RedirectText: !0,
Action: !0,
Link: !0,
SecondaryLink: !0,
TermsLink: !0,
Button: !0,
InputCloseIcon: !0,
PasscodeShowIcon: !0,
PasscodeCloseIcon: !0,
AccordionItem: !0,
PaymentMethodMessaging: !0,
RadioIcon: !0,
RadioIconOuter: !0,
RadioIconInner: !0
}, Ty = {
Label: ["empty", "invalid", "floating", "resting", "focused"],
Input: ["empty", "invalid"],
InputDivider: [],
Error: [],
Checkbox: ["checked"],
CheckboxLabel: ["checked"],
CheckboxInput: ["checked"],
CodeInput: ["empty"],
Switch: ["checked"],
SwitchControl: ["checked"],
Dropdown: [],
DropdownItem: ["highlight"],
Tab: ["selected", "more"],
TabIcon: ["selected", "more"],
TabLabel: ["selected"],
Block: [],
BlockDivider: [],
BlockAction: ["danger"],
PickerItem: ["selected", "highlight", "new", "disabled"],
PickerAction: [],
Menu: [],
MenuIcon: ["open"],
MenuAction: ["danger"],
Icon: [],
Text: ["terms", "redirect"],
RedirectText: [],
TermsText: [],
Action: ["danger", "tertiary"],
Link: [],
SecondaryLink: [],
TermsLink: [],
Button: [],
InputCloseIcon: [],
PasscodeShowIcon: [],
PasscodeCloseIcon: [],
AccordionItem: ["selected"],
PaymentMethodMessaging: ["split", "list", "textOnly", "condensedSingle", "condensedMulti"],
RadioIcon: ["checked"],
RadioIconOuter: ["checked"],
RadioIconInner: ["checked"]
}, Oy = {
Block: [],
BlockDivider: [],
BlockAction: ["hover", "focus", "focus-visible", "active"],
PickerItem: ["hover", "focus", "focus-visible"],
PickerAction: ["hover", "focus", "focus-visible", "active"],
Menu: [],
MenuIcon: ["hover", "focus", "focus-visible", "active"],
MenuAction: ["hover", "focus", "focus-visible", "active"],
Dropdown: [],
DropdownItem: ["active"],
Tab: ["hover", "focus", "focus-visible", "active", "disabled"],
TabIcon: ["hover", "focus", "focus-visible", "active", "disabled"],
TabLabel: ["hover", "focus", "focus-visible", "active", "disabled"],
Label: [],
Input: ["hover", "focus", "focus-visible", "disabled", "autofill"],
InputDivider: [],
Error: [],
Checkbox: [],
CheckboxLabel: ["hover", "focus", "focus-visible"],
CheckboxInput: ["hover", "focus", "focus-visible"],
CodeInput: ["focus", "focus-visible"],
Switch: ["hover", "focus", "focus-visible"],
SwitchControl: ["hover", "focus", "focus-visible"],
Icon: [],
Text: [],
RedirectText: [],
TermsText: [],
Action: ["hover", "focus", "focus-visible", "active", "disabled"],
Link: ["hover", "focus", "focus-visible", "active"],
SecondaryLink: ["hover", "focus", "focus-visible", "active"],
TermsLink: ["hover", "focus", "focus-visible", "active"],
Button: ["hover", "focus", "focus-visible", "active", "disabled"],
InputCloseIcon: ["focus", "focus-visible"],
PasscodeShowIcon: ["focus", "focus-visible"],
PasscodeCloseIcon: ["focus", "focus-visible"],
AccordionItem: ["hover", "focus", "focus-visible"],
PaymentMethodMessaging: [],
RadioIcon: [],
RadioIconOuter: [],
RadioIconInner: []
}, Ry = {
Label: [],
Input: ["placeholder", "selection"],
InputDivider: [],
Error: [],
Checkbox: [],
CheckboxLabel: [],
CheckboxInput: [],
CodeInput: [],
Switch: [],
SwitchControl: [],
Dropdown: [],
DropdownItem: [],
Tab: [],
TabIcon: [],
TabLabel: [],
Block: [],
BlockDivider: [],
BlockAction: [],
PickerItem: [],
PickerAction: [],
Menu: [],
MenuIcon: [],
MenuAction: [],
Icon: [],
Text: [],
RedirectText: [],
TermsText: [],
Action: [],
Link: [],
SecondaryLink: [],
TermsLink: [],
Button: [],
InputCloseIcon: [],
PasscodeShowIcon: [],
PasscodeCloseIcon: [],
AccordionItem: [],
PaymentMethodMessaging: [],
RadioIcon: [],
RadioIconOuter: [],
RadioIconInner: []
}, Ly = {
Label: (0,
b.Z)((0,
b.Z)((0,
b.Z)((0,
b.Z)({}, Ey), Zy), Ay), {}, {
transition: !0,
opacity: !0
}),
Input: Ny,
InputDivider: {
backgroundColor: !0
},
Error: Ny,
Checkbox: Ey,
CheckboxLabel: (0,
b.Z)((0,
b.Z)({}, Ey), {}, {
transition: !0
}),
CheckboxInput: (0,
b.Z)((0,
b.Z)((0,
b.Z)({}, My), Py), {}, {
backgroundColor: !0,
transition: !0
}),
CodeInput: Ny,
Switch: (0,
b.Z)((0,
b.Z)((0,
b.Z)({}, My), Py), {}, {
fontSize: !0,
backgroundColor: !0,
transition: !0
}),
SwitchControl: (0,
b.Z)((0,
b.Z)((0,
b.Z)({}, My), Py), {}, {
fill: !0,
transition: !0
}),
Dropdown: (0,
b.Z)((0,
b.Z)((0,
b.Z)({}, My), Py), {}, {
transition: !0
}),
DropdownItem: Ny,
Tab: Ny,
TabIcon: (0,
b.Z)((0,
b.Z)((0,
b.Z)({}, Zy), xy), {}, {
color: !0,
transition: !0
}),
TabLabel: (0,
b.Z)((0,
b.Z)((0,
b.Z)({}, Ey), Zy), {}, {
transition: !0
}),
Block: Iy,
BlockDivider: {
backgroundColor: !0
},
BlockAction: Ny,
PickerItem: Ny,
PickerAction: Ny,
Menu: (0,
b.Z)({}, Zy),
MenuIcon: (0,
b.Z)((0,
b.Z)({}, Iy), {}, {
fill: !0
}),
MenuAction: Ny,
Icon: {
transition: !0
},
Text: (0,
b.Z)((0,
b.Z)((0,
b.Z)((0,
b.Z)({}, Ey), Zy), My), {}, {
transition: !0
}),
RedirectText: (0,
b.Z)((0,
b.Z)((0,
b.Z)((0,
b.Z)({}, Ey), Zy), My), {}, {
transition: !0
}),
TermsText: (0,
b.Z)((0,
b.Z)((0,
b.Z)((0,
b.Z)({}, Ey), Zy), My), {}, {
transition: !0
}),
Action: Ny,
Link: (0,
b.Z)((0,
b.Z)((0,
b.Z)({}, Ey), Py), {}, {
transition: !0,
borderRadius: !0
}),
SecondaryLink: (0,
b.Z)((0,
b.Z)((0,
b.Z)({}, Ey), Py), {}, {
transition: !0,
borderRadius: !0
}),
TermsLink: (0,
b.Z)((0,
b.Z)((0,
b.Z)({}, Ey), Py), {}, {
transition: !0,
borderRadius: !0
}),
Button: Ny,
InputCloseIcon: (0,
b.Z)((0,
b.Z)({}, Py), {}, {
borderRadius: !0,
transition: !0
}),
PasscodeShowIcon: (0,
b.Z)((0,
b.Z)({}, Py), {}, {
borderRadius: !0,
transition: !0
}),
PasscodeCloseIcon: (0,
b.Z)((0,
b.Z)({}, Py), {}, {
borderRadius: !0,
transition: !0
}),
AccordionItem: (0,
b.Z)((0,
b.Z)((0,
b.Z)((0,
b.Z)((0,
b.Z)({}, My), Ey), Py), Zy), {}, {
backgroundColor: !0,
boxShadow: !0
}),
PaymentMethodMessaging: {
textAlign: !0
},
RadioIcon: {
width: !0
},
RadioIconOuter: {
stroke: !0,
strokeWidth: !0,
strokeOpacity: !0,
fill: !0,
fillOpacity: !0,
transition: !0
},
RadioIconInner: {
stroke: !0,
strokeWidth: !0,
strokeOpacity: !0,
fill: !0,
fillOpacity: !0,
transition: !0,
r: !0
}
}, Dy = /[^0-9.]/, Uy = {
r: function(e) {
return e.match(Dy) ? e : "".concat(e, "px")
}
}, jy = function(e) {
var t = e.namespace ? "".concat(e.namespace, "-") : ""
, n = e.modifier ? "--".concat(e.modifier) : ""
, r = e.pseudoClasses.length ? ":".concat(e.pseudoClasses.join(":")) : ""
, a = e.pseudoElement ? "::".concat(e.pseudoElement) : "";
return ".".concat(t).concat(e.name).concat(n).concat(r).concat(a)
}, By = function(e) {
return "*" === e ? e : e.map((function(e) {
return e.map(jy).join("")
}
)).join(", ")
}, Fy = /^[#a-zA-Z0-9-_+\s,"'().%]*$/, Gy = /url\(.*\)/, qy = function(e, t) {
if (!Fy.test(t)) {
for (var n = '"'.concat(t, '" is not a supported value for the "').concat(e, '" property'), r = 0; r < t.length; r++) {
var a = t[r];
if (!Fy.test(a))
return {
valid: !1,
warning: "".concat(n, '; the "').concat(a, '" character is not supported')
}
}
return {
valid: !1,
warning: n
}
}
return Gy.test(t) ? {
valid: !1,
warning: '"'.concat(t, '" is not a supported value for the "').concat(e, '" property; the url() function is not supported')
} : {
valid: !0,
warning: null
}
}, Ky = function(e, t) {
var n = {}
, r = [];
return (0,
O.qh)(t).forEach((function(t) {
var a = (0,
g.Z)(t, 2)
, i = a[0]
, o = function(e, t) {
var n = Uy[e];
return n ? n(t) : t
}(i, a[1])
, s = function(e, t, n) {
var r = qy(t, n);
if (!r.valid)
return r;
if ("*" === e && !Ey[t])
return {
valid: !1,
warning: '"'.concat(t, '" is not a supported property for "*"')
};
if ("*" !== e)
for (var a = (0,
O.zG)(e), i = 0; i < a.length; i++) {
var o = a[i];
if (!Ly[o.name][t]) {
var s = [[o]];
return {
valid: !1,
warning: '"'.concat(t, '" is not a supported property for "').concat(By(s), '"')
}
}
}
return {
valid: !0,
warning: null
}
}(e, i, o)
, u = s.valid
, l = s.warning;
u ? n[i] = o : l && r.push(l)
}
)),
{
properties: n,
warnings: r
}
}, Vy = function(e) {
var t = e.h
, n = e.s
, r = e.l
, a = 360 * t
, i = n * Math.min(r, 1 - r)
, o = function(e) {
var t = (e + a / 30) % 12;
return r - i * Math.max(Math.min(t - 3, 9 - t, 1), -1)
};
return {
r: Math.round(255 * o(0)),
g: Math.round(255 * o(8)),
b: Math.round(255 * o(4))
}
}, zy = function(e) {
var t, n, r = e.r / 255, a = e.g / 255, i = e.b / 255, o = Math.max(r, a, i), s = Math.min(r, a, i), u = (o + s) / 2;
if (o === s)
t = 0,
n = 0;
else {
var l = o - s;
switch (n = u > .5 ? l / (2 - o - s) : l / (o + s),
o) {
case r:
t = (a - i) / l + (a < i ? 6 : 0);
break;
case a:
t = (i - r) / l + 2;
break;
case i:
t = (r - a) / l + 4;
break;
default:
t = 0
}
t /= 6
}
return {
h: t,
s: n,
l: u
}
}, Hy = function(e) {
var t = Vy(e)
, n = t.r
, r = t.g
, a = t.b
, i = function(e) {
var t = e / 255;
return t <= .03928 ? t / 12.92 : Math.pow((t + .055) / 1.055, 2.4)
}
, o = [i(n), i(r), i(a)];
return Number((.2126 * o[0] + .7152 * o[1] + .0722 * o[2]).toFixed(3))
}, Yy = {}, Wy = function(e) {
var t = JSON.stringify(e);
if (Object.hasOwnProperty.call(Yy, t))
return Yy[t];
var n = Hy(e) < .5;
return Yy[t] = n,
n
}, Jy = function(e) {
var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1
, n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0;
return Math.min(Math.max(n, e), t)
}, Xy = function(e, t) {
var n = e.h
, r = e.s
, a = e.l;
return {
h: n,
s: r,
l: Jy(a + (1 - a) * Jy(t))
}
}, Qy = function(e, t) {
var n = e.h
, r = e.s
, a = e.l;
return {
h: n,
s: r,
l: Jy(a * (1 - Jy(t)))
}
}, $y = function(e, t) {
var n = e.h
, r = e.s
, a = e.l;
return {
h: n,
s: Jy(r * (1 - Jy(t))),
l: a
}
}, ev = function(e, t) {
return Wy(e) ? Xy(e, t) : Qy(e, t)
}, tv = Math.round, nv = function(e) {
var t = tv(e).toString(16);
return 1 === t.length ? "0".concat(t) : t
}, rv = {
aliceblue: "#f0f8ff",
antiquewhite: "#faebd7",
aqua: "#0ff",
aquamarine: "#7fffd4",
azure: "#f0ffff",
beige: "#f5f5dc",
bisque: "#ffe4c4",
black: "#000",
blanchedalmond: "#ffebcd",
blue: "#00f",
blueviolet: "#8a2be2",
brown: "#a52a2a",
burlywood: "#deb887",
burntsienna: "#ea7e5d",
cadetblue: "#5f9ea0",
chartreuse: "#7fff00",
chocolate: "#d2691e",
coral: "#ff7f50",
cornflowerblue: "#6495ed",
cornsilk: "#fff8dc",
crimson: "#dc143c",
cyan: "#0ff",
darkblue: "#00008b",
darkcyan: "#008b8b",
darkgoldenrod: "#b8860b",
darkgray: "#a9a9a9",
darkgreen: "#006400",
darkgrey: "#a9a9a9",
darkkhaki: "#bdb76b",
darkmagenta: "#8b008b",
darkolivegreen: "#556b2f",
darkorange: "#ff8c00",
darkorchid: "#9932cc",
darkred: "#8b0000",
darksalmon: "#e9967a",
darkseagreen: "#8fbc8f",
darkslateblue: "#483d8b",
darkslategray: "#2f4f4f",
darkslategrey: "#2f4f4f",
darkturquoise: "#00ced1",
darkviolet: "#9400d3",
deeppink: "#ff1493",
deepskyblue: "#00bfff",
dimgray: "#696969",
dimgrey: "#696969",
dodgerblue: "#1e90ff",
firebrick: "#b22222",
floralwhite: "#fffaf0",
forestgreen: "#228b22",
fuchsia: "#f0f",
gainsboro: "#dcdcdc",
ghostwhite: "#f8f8ff",
gold: "#ffd700",
goldenrod: "#daa520",
gray: "#808080",
green: "#008000",
greenyellow: "#adff2f",
grey: "#808080",
honeydew: "#f0fff0",
hotpink: "#ff69b4",
indianred: "#cd5c5c",
indigo: "#4b0082",
ivory: "#fffff0",
khaki: "#f0e68c",
lavender: "#e6e6fa",
lavenderblush: "#fff0f5",
lawngreen: "#7cfc00",
lemonchiffon: "#fffacd",
lightblue: "#add8e6",
lightcoral: "#f08080",
lightcyan: "#e0ffff",
lightgoldenrodyellow: "#fafad2",
lightgray: "#d3d3d3",
lightgreen: "#90ee90",
lightgrey: "#d3d3d3",
lightpink: "#ffb6c1",
lightsalmon: "#ffa07a",
lightseagreen: "#20b2aa",
lightskyblue: "#87cefa",
lightslategray: "#789",
lightslategrey: "#789",
lightsteelblue: "#b0c4de",
lightyellow: "#ffffe0",
lime: "#0f0",
limegreen: "#32cd32",
linen: "#faf0e6",
magenta: "#f0f",
maroon: "#800000",
mediumaquamarine: "#66cdaa",
mediumblue: "#0000cd",
mediumorchid: "#ba55d3",
mediumpurple: "#9370db",
mediumseagreen: "#3cb371",
mediumslateblue: "#7b68ee",
mediumspringgreen: "#00fa9a",
mediumturquoise: "#48d1cc",
mediumvioletred: "#c71585",
midnightblue: "#191970",
mintcream: "#f5fffa",
mistyrose: "#ffe4e1",
moccasin: "#ffe4b5",
navajowhite: "#ffdead",
navy: "#000080",
oldlace: "#fdf5e6",
olive: "#808000",
olivedrab: "#6b8e23",
orange: "#ffa500",
orangered: "#ff4500",
orchid: "#da70d6",
palegoldenrod: "#eee8aa",
palegreen: "#98fb98",
paleturquoise: "#afeeee",
palevioletred: "#db7093",
papayawhip: "#ffefd5",
peachpuff: "#ffdab9",
peru: "#cd853f",
pink: "#ffc0cb",
plum: "#dda0dd",
powderblue: "#b0e0e6",
purple: "#800080",
rebeccapurple: "#663399",
red: "#f00",
rosybrown: "#bc8f8f",
royalblue: "#4169e1",
saddlebrown: "#8b4513",
salmon: "#fa8072",
sandybrown: "#f4a460",
seagreen: "#2e8b57",
seashell: "#fff5ee",
sienna: "#a0522d",
silver: "#c0c0c0",
skyblue: "#87ceeb",
slateblue: "#6a5acd",
slategray: "#708090",
slategrey: "#708090",
snow: "#fffafa",
springgreen: "#00ff7f",
steelblue: "#4682b4",
tan: "#d2b48c",
teal: "#008080",
thistle: "#d8bfd8",
tomato: "#ff6347",
turquoise: "#40e0d0",
violet: "#ee82ee",
wheat: "#f5deb3",
white: "#fff",
whitesmoke: "#f5f5f5",
yellow: "#ff0",
yellowgreen: "#9acd32"
}, av = function() {
for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
t[n] = arguments[n];
return t.some((function(e) {
return isNaN(e)
}
))
}, iv = function(e, t) {
var n = e.r
, r = e.g
, a = e.b;
if (av(n, r, a))
throw new Error('Invalid color provided "'.concat(t, '". Please ensure your color value is correct.'));
return e
}, ov = function(e) {
var t = "#" === e[0] ? e.substr(1) : e
, n = t.match(new RegExp(".{1,".concat(t.length >= 6 ? 2 : 1, "}"),"g"));
if (!Array.isArray(n))
throw new Error('Invalid HEX color format "'.concat(e, '". Please ensure your color value is passed correctly.'));
1 === n[0].length && (n = n.map((function(e) {
return "".concat(e).concat(e)
}
)));
var r = n
, a = (0,
g.Z)(r, 3)
, i = a[0]
, o = a[1]
, s = a[2];
return iv({
r: parseInt(i, 16),
g: parseInt(o, 16),
b: parseInt(s, 16)
}, e)
}, sv = function(e) {
var t, n;
return null !== (t = null === (n = e.match(/\(([^)]+)\)/)) || void 0 === n ? void 0 : n[1].replace(/,/g, " ").trim().split(/\s+/)) && void 0 !== t ? t : [""]
}, uv = function(e) {
var t = sv(e)
, n = (0,
g.Z)(t, 3)
, r = n[0]
, a = n[1]
, i = n[2];
return function(e, t) {
var n = e.h
, r = e.s
, a = e.l;
if (av(n, r, a))
throw new Error('Invalid color provided "'.concat(t, '". Please ensure your color value is correct.'));
return e
}({
h: parseFloat(r) * (r.indexOf("turn") > -1 ? 360 : 1) % 360 / 360,
s: parseFloat(a) / 100,
l: parseFloat(i) / 100
}, e)
}, lv = function(e) {
var t = sv(e)
, n = (0,
g.Z)(t, 3)
, r = n[0]
, a = n[1]
, i = n[2];
return iv({
r: parseFloat(r),
g: parseFloat(a),
b: parseFloat(i)
}, e)
}, cv = function(e) {
var t = e.toLowerCase().trim()
, n = rv[t] || t
, r = function(e) {
if ("#" === e[0])
return "hex";
var t = e.indexOf("(")
, n = e.substring(0, t);
switch (n) {
case "rgb":
case "hsl":
return n;
default:
throw new Error('Invalid color provided "'.concat(e, '". The following formats are supported: HEX, rgb(), and hsl().'))
}
}(n);
switch (r) {
case "hex":
return {
type: r,
hsl: zy(ov(n))
};
case "hsl":
return {
type: r,
hsl: uv(n)
};
case "rgb":
return {
type: r,
hsl: zy(lv(n))
};
default:
return (0,
P.Rz)(r)
}
}, dv = {
AALarge: 3,
AASmall: 4.5,
AAALarge: 4.5,
AAASmall: 7
}, pv = function(e, t) {
var n = Hy(e)
, r = Hy(t);
return (Math.max(n, r) + .05) / (Math.min(n, r) + .05)
}, mv = function(e, t) {
return pv(e, t) >= dv.AASmall
}, fv = function e(t) {
var n = "string" == typeof t ? cv(t) : t
, r = n.type
, a = n.hsl
, i = function(t) {
return e({
type: r,
hsl: t
})
};
return {
parsedColor: n,
isDark: function() {
return Wy(a)
},
lighten: function(e) {
return i(Xy(a, e))
},
lightenAbsolute: function(e) {
return i(function(e, t) {
var n = e.h
, r = e.s
, a = e.l;
return {
h: n,
s: r,
l: Jy(a + t)
}
}(a, e))
},
darken: function(e) {
return i(Qy(a, e))
},
desaturate: function(e) {
return i($y(a, e))
},
emphasize: function(e) {
return i(function(e, t) {
return Wy(e) ? Qy(e, t) : Xy(e, t)
}(a, e))
},
deemphasize: function(e) {
return i(ev(a, e))
},
getContrastRatio: function(e) {
return pv(a, e.parsedColor.hsl)
},
isReadable: function(e) {
return mv(a, e.parsedColor.hsl)
},
isEqual: function(e) {
return t = a,
n = e.parsedColor.hsl,
t.h === n.h && t.s === n.s && t.l === n.l;
var t, n
},
readableDeemphasize: function(e, t) {
return i(function(e, t, n) {
for (var r = cv(t).hsl, a = n; a >= 0; ) {
var i = ev(e, a);
if (mv(i, r))
return i;
a -= .04
}
return e
}(a, e, t))
},
readableDesaturate: function(e, t) {
return i(function(e, t, n) {
for (var r = cv(t).hsl, a = n; a >= 0; ) {
var i = $y(e, a);
if (mv(i, r))
return i;
a -= .04
}
return $y(e, n)
}(a, e, t))
},
readableContrastText: function(e) {
return function(e, t) {
var n = Wy(e) ? "#fff" : "#000";
if (!t)
return n;
var r = cv(t).hsl;
return mv(e, r) ? t : n
}(a, e)
},
toString: function() {
switch (r) {
case "hex":
return o = Vy(a),
s = o.r,
u = o.g,
l = o.b,
"#".concat(nv(s)).concat(nv(u)).concat(nv(l));
case "hsl":
return t = (e = a).h,
n = e.s,
i = e.l,
"hsl(".concat(tv(360 * t), ", ").concat(tv(100 * n), "%, ").concat(tv(100 * i), "%)");
default:
return function(e) {
var t = e.r
, n = e.g
, r = e.b;
return "rgb(".concat(tv(t), ", ").concat(tv(n), ", ").concat(tv(r), ")")
}(Vy(a))
}
var e, t, n, i, o, s, u, l
},
toAlphaString: function(e) {
return function(e, t) {
var n = e.h
, r = e.s
, a = e.l;
return "hsla(".concat(tv(360 * n), ", ").concat(tv(100 * r), "%, ").concat(tv(100 * a), "%, ").concat(tv(100 * Jy(t)), "%)")
}(a, e)
}
}
}, hv = function(e) {
return 0 === e.indexOf("var(--")
}, _v = function(e, t, n) {
var r = function(e) {
return ky[e]
}(e);
switch (r) {
case "any":
return {
valid: !0,
warning: null
};
case "length":
return hv(t) || !isNaN(parseFloat(t)) ? {
valid: !0,
warning: null
} : {
valid: !1,
warning: 'invalid variable value "'.concat(t, '" provided to "').concat(n, '"; "').concat(n, '" accepts a valid CSS length unit.')
};
case "logo":
return ["light", "dark"].indexOf(t) > -1 ? {
valid: !0,
warning: null
} : {
valid: !1,
warning: 'invalid variable value "'.concat(t, '" provided to "').concat(n, '"; "').concat(n, '" accepts "light" or "dark".')
};
case "color":
return hv(t) || function(e) {
if (["transparent", "currentColor", "inherit", "initial"].indexOf(e) > -1)
return !0;
var t = document.createElement("div").style;
return t.color = e,
!!t.color
}(t) ? {
valid: !0,
warning: null
} : {
valid: !1,
warning: 'invalid variable "'.concat(t, '" provided to "').concat(n, '"; "').concat(n, '" accepts a valid CSS color.')
};
case "colorStrict":
try {
return fv(t),
{
valid: !0,
warning: null
}
} catch (e) {
return {
valid: !1,
warning: 'invalid variable value "'.concat(t, '" provided to "').concat(n, '"; "').concat(n, '" accepts a valid HEX, rgb(), or hsl() CSS color.')
}
}
default:
return (0,
P.Rz)(r, "Invalid variable type")
}
}, yv = function(e) {
return t = e,
Object.hasOwnProperty.call(Cy, t) ? Cy[e] : e;
var t
}, vv = function(e) {
var t = {}
, n = [];
return Object.keys(e).forEach((function(r) {
var a, i = yv(r);
if (a = i,
Object.hasOwnProperty.call(ky, a)) {
var o = e[r];
if ("string" != typeof o)
return void n.push('invalid value provided to "'.concat(r, '"; expected "string" but was provided "').concat(typeof o, '" value.'));
var s = qy(r, o)
, u = s.valid
, l = s.warning;
if (l && n.push(l),
u) {
var c = _v(i, o, r)
, d = c.valid
, p = c.warning;
d ? (t[i] = o,
"0" === o && (t[i] = "0px")) : p && n.push(p)
}
} else
n.push('invalid variable "'.concat(r, '"; "').concat(r, '" is not a supported variable.'))
}
)),
{
variables: t,
warnings: n
}
}, gv = "^[a-zA-Z]+$", bv = function() {
function e(t) {
(0,
C.Z)(this, e),
this._index = 0,
this._selector = [],
this._targetConjunction = [],
this._input = t.trim()
}
return (0,
E.Z)(e, [{
key: "parse",
value: function() {
for (; null !== this._peek(1); ) {
var e = this._eat([".", ","]);
if ("." === e) {
var t = this._parseTarget();
this._targetConjunction.push(t)
} else {
if ("," !== e)
throw new Error(this._formatError());
this._selector.push(this._targetConjunction),
this._targetConjunction = [],
this._eatWhitespace()
}
}
return this._selector.push(this._targetConjunction),
this._selector
}
}, {
key: "_parseTarget",
value: function() {
var e = this._parseNamespaceAndName()
, t = (0,
g.Z)(e, 2);
return {
namespace: t[0],
name: t[1],
modifier: this._parseModifier(),
pseudoClasses: this._parsePseudoClasses(),
pseudoElement: this._parsePseudoElement()
}
}
}, {
key: "_parseNamespaceAndName",
value: function() {
var e = this._eatUntil(["--", "-", ":", "::", ",", ".", " ", null]);
if (!e)
throw new Error(this._formatError());
if ("-" === this._peek(1) && "--" !== this._peek(2)) {
this._eat(["-"]);
var t = this._eatUntil(["--", ":", "::", ",", ".", " ", null]);
if (!t)
throw new Error(this._formatError());
return [e, t]
}
return [null, e]
}
}, {
key: "_parseModifier",
value: function() {
if ("--" !== this._peek(2))
return null;
this._eat(["--"]);
var e = this._eatUntil(["--", ":", "::", ",", ".", " ", null]);
if (!e)
throw new Error(this._formatError());
return e
}
}, {
key: "_parsePseudoClasses",
value: function() {
for (var e = []; ":" === this._peek(1) && "::" !== this._peek(2); ) {
this._eat([":"]);
var t = this._eatUntil(["--", ":", "::", ",", ".", " ", null], "^[a-zA-Z-]+$");
if (!t)
throw new Error(this._formatError());
e.push(t)
}
return e
}
}, {
key: "_parsePseudoElement",
value: function() {
if ("::" !== this._peek(2))
return null;
this._eat(["::"]);
var e = this._eatUntil(["--", ":", "::", ",", ".", " ", null]);
if (!e)
throw new Error(this._formatError());
return e
}
}, {
key: "_eat",
value: function() {
for (var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : [], t = 0; t < e.length; t++) {
var n = e[t];
if (null === n && this._index === this._input.length)
return null;
if (null !== n && this._input.slice(this._index, this._index + n.length) === n)
return this._index += n.length,
n
}
throw new Error(this._formatError({
expectedTokens: e
}))
}
}, {
key: "_eatUntil",
value: function(e) {
for (var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : gv, n = this._index; this._index < this._input.length; ) {
for (var r = 0; r < e.length; r++) {
var a = e[r];
if (null !== a && this._input.slice(this._index, this._index + a.length) === a)
return this._assertAllowedCharacters(n, this._index, t),
this._input.slice(n, this._index)
}
this._index += 1
}
if (-1 !== e.indexOf(null))
return this._assertAllowedCharacters(n, this._input.length, t),
this._input.slice(n, this._input.length);
throw new Error(this._formatError({
expectedTokens: e
}))
}
}, {
key: "_eatWhitespace",
value: function() {
for (; " " === this._peek(1); )
this._eat([" "])
}
}, {
key: "_peek",
value: function(e) {
return this._index >= this._input.length ? null : this._input.slice(this._index, this._index + e)
}
}, {
key: "_assertAllowedCharacters",
value: function(e, t, n) {
var r = new RegExp(n)
, a = this._input.slice(e, t);
if (!r.test(a))
for (var i = e; i < t; i++) {
var o = this._input[i];
if (!r.test(o))
throw this._index = i,
new Error(this._formatError())
}
}
}, {
key: "_formatError",
value: function() {
var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}
, t = e.expectedTokens
, n = "";
if (t) {
var r = t.map((function(e) {
return null === e ? "end of line" : '"'.concat(e, '"')
}
))
, a = 1 === r.length ? r[0] : "".concat(r.slice(0, r.length - 1).join(", "), " or ").concat(r[r.length - 1]);
n = "expected one of ".concat(a, ' but received "').concat(this._input[this._index], '"')
} else
n = this._index === this._input.length ? "unexpected end of line" : "unexpected character";
var i = (0,
O.rx)(" ", this._index)
, o = 'invalid selector\n\n "'.concat(this._input, '"\n ').concat(i, "^\n ").concat(i).concat(n);
return o
}
}]),
e
}(), Sv = function(e) {
try {
return {
valid: !0,
selector: new bv(e).parse()
}
} catch (e) {
return {
valid: !1,
errorMessage: e.message
}
}
}, kv = function(e) {
var t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1];
if (t && "*" === e.trim())
return {
valid: !0,
selector: "*"
};
var n = Sv(e);
if (!n.valid)
return n;
for (var r = n.selector, a = (0,
O.zG)(r), i = 0; i < a.length; i++) {
var o = a[i];
if (o.namespace) {
var s = 'invalid selector "'.concat(e, '"; namespaces are not supported');
return {
valid: !1,
errorMessage: s
}
}
if (!wy[o.name]) {
var u = 'invalid selector "'.concat(e, '"; "').concat(o.name, '" is not a supported class');
return {
valid: !1,
errorMessage: u
}
}
if (o.modifier && -1 === Ty[o.name].indexOf(o.modifier)) {
var l = 'invalid selector "'.concat(e, '"; "').concat(o.modifier, '" is not a supported modifier for the class "').concat(o.name, '"');
return {
valid: !1,
errorMessage: l
}
}
for (var c = 0; c < o.pseudoClasses.length; c++) {
var d = o.pseudoClasses[c];
if (-1 === Oy[o.name].indexOf(d)) {
var p = 'invalid selector "'.concat(e, '"; "').concat(d, '" is not a supported pseudo-class for the class "').concat(o.name, '"');
return {
valid: !1,
errorMessage: p
}
}
}
if (o.pseudoElement && -1 === Ry[o.name].indexOf(o.pseudoElement)) {
var m = 'invalid selector "'.concat(e, '"; "').concat(o.pseudoElement, '" is not a supported pseudo-element for the class "').concat(o.name, '"');
return {
valid: !1,
errorMessage: m
}
}
}
return {
valid: !0,
selector: r
}
}, Cv = function(e) {
var t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1]
, n = []
, r = [];
return Object.keys(e).forEach((function(a) {
var i = kv(a, t);
if (i.valid) {
var o = i.selector
, s = e[a]
, u = Ky(o, s)
, l = u.properties;
u.warnings.forEach((function(e) {
return r.push(e)
}
)),
n.push({
selector: o,
properties: l
})
} else
r.push(i.errorMessage)
}
)),
{
rules: n,
warnings: r
}
}, Ev = function(e) {
var t = []
, n = "stripe";
return e && e in vy ? n = e : e && t.push('Invalid value "'.concat(e, '" provided to "theme". Supported values for "theme" are ').concat(by.map((function(e) {
return "'".concat(e, "'")
}
)).join(", "))),
"none" === e && t.push("The 'none' theme is deprecated and no longer supported. Supported values for \"theme\" are ".concat(by.map((function(e) {
return "'".concat(e, "'")
}
)).join(", "))),
{
theme: n,
warnings: t
}
}, Zv = function(e) {
var t = []
, n = "above";
if (e && Sy[e])
n = e;
else if (e) {
var r = Object.keys(Sy).map((function(e) {
return '"'.concat(e, '"')
}
));
t.push('Invalid value "'.concat(e, '" provided to "labels". Supported values for "labels" are ').concat(function(e) {
var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "or";
if (0 === e.length)
return "";
if (1 === e.length)
return e[0];
if (2 === e.length)
return "".concat(e[0], " ").concat(t, " ").concat(e[1]);
var n = e.slice(0, e.length - 1)
, r = e[e.length - 1];
return "".concat(n.join(", "), ", ").concat(t, " ").concat(r)
}(r)))
}
return {
labels: n,
warnings: t
}
}, Av = n(94184), Mv = n.n(Av), Pv = function(e) {
function t(e) {
var r;
(0,
C.Z)(this, t),
(r = n.call(this, e)).performGroupAction = function() {}
,
r.state = {
number: ""
};
var a = r.props
, i = a.issuingCard
, o = a.ephemeralKeySecret
, s = a.nonce;
return r.props.onDispatchInnerAction("RETRIEVE_ISSUING_CARD", {
cardId: i,
ephemeralKeySecret: o,
nonce: s
}).then((function(e) {
var t = e.number;
r.setState({
number: t
}),
r.props.onDispatchGroupAction(V.Yj.issuingCardCopyButton, {
type: "sendIssuingCardNumber",
payload: {
number: t
}
})
}
)),
r
}
(0,
Gs.Z)(t, e);
var n = (0,
qs.Z)(t);
return (0,
E.Z)(t, [{
key: "focus",
value: function() {}
}, {
key: "focusError",
value: function() {
this.focus()
}
}, {
key: "wantsError",
value: function() {
return !1
}
}, {
key: "clear",
value: function() {}
}, {
key: "validate",
value: function() {
return !0
}
}, {
key: "calculateWidth",
value: function() {
return this._container ? this._container.getBoundingClientRect().width : 0
}
}, {
key: "calculateHeight",
value: function() {
return this._container ? this._container.getBoundingClientRect().height : 0
}
}, {
key: "render",
value: function() {
var e = this
, t = Mv()("IssuingDisplayElement");
return Wr().createElement("div", {
ref: function(t) {
return e._container = t
}
}, Wr().createElement("span", {
className: t
}, this.state.number.substring(0, 4)), Wr().createElement("span", {
className: t
}, this.state.number.substring(4, 8)), Wr().createElement("span", {
className: t
}, this.state.number.substring(8, 12)), Wr().createElement("span", {
className: t
}, this.state.number.substring(12, 16)))
}
}]),
t
}(Wr().Component), xv = ((0,
v.Z)({}, V.Yj.issuingCardNumberDisplay, Pv),
V.T2,
V.Yj.cardNumber,
V.Yj.cardExpiry,
V.Yj.cardCvc,
V.Yj.postalCode,
V.Yj.iban,
V.Yj.issuingCardNumberDisplay,
V.Yj.idealBank,
V.Yj.fpxBank,
V.Yj.epsBank,
V.Yj.p24Bank,
V.Yj.netbankingBank,
V.Yj.idealBankSecondary,
V.Yj.fpxBankSecondary,
V.Yj.epsBankSecondary,
V.Yj.p24BankSecondary,
V.Yj.netbankingBankSecondary,
V.Yj.issuingCardNumberDisplay,
V.Yj.issuingCardCvcDisplay,
V.Yj.issuingCardExpiryDisplay,
V.Yj.issuingCardPinDisplay,
function(e, t, n) {
var r = (0,
M.or)(M.Z_, M.Rx)(e, t, n);
if ("error" === r.type)
return r;
var a = String(r.value);
return a.match(/^[#a-zA-Z0-9-_\s,"'().]*$/) ? (0,
M.x4)(new lf(a)) : (0,
M.zS)(new I.No("Invalid style configuration value: ".concat(a, ". This value contains invalid characters.")))
}
), Iv = function(e, t) {
return function(n) {
return "string" == typeof n ? n.match(t) ? (0,
M.x4)(new uf(n)) : (0,
M.zS)(new I.No("Invalid ".concat(e, " value: ").concat(n, ". This value contains invalid characters."))) : (0,
M.zS)(new I.No("Invalid ".concat(e, " value: ").concat(String(n), ". Expected a string.")))
}
}, Nv = /^\d+(px|em|rem)$/, wv = Iv("rowGap", Nv), Tv = Iv("columnGap", Nv), Ov = (0,
M.mC)({
disableAnimations: (0,
M.jt)((0,
M.or)(M.HM, M.Xg)),
rowGap: (0,
M.jt)(wv),
columnGap: (0,
M.jt)(Tv),
rules: (0,
M.jt)((0,
M.FL)((0,
M.FL)(M.Z_)))
}), Rv = function(e, t, n) {
return "number" == typeof e ? (0,
M.x4)(String(e)) : (0,
M.Z_)(e, t, n)
}, Lv = (0,
M.mC)({
disableAnimations: (0,
M.jt)((0,
M.or)(M.HM, M.Xg)),
theme: (0,
M.jt)(M.Z_),
rules: (0,
M.jt)((0,
M.FL)((0,
M.FL)(Rv))),
variables: (0,
M.jt)((0,
M.FL)(Rv)),
labels: (0,
M.jt)(M.Z_)
}), Dv = (Iv("padding", /^((\d+px)|0)( ((\d+px)|0)){0,3}$/),
Iv("font family", /^([-_a-zA-Z0-9\s'"]*|'[-_a-zA-Z0-9()\s]*'|"[-_a-zA-Z0-9()\s]*")$/)), Uv = (Iv("font unicodeRange", /^[-U+A-Fa-f0-9?, ]*$/),
Iv("font variant", /^[a-zA-Z0-9-()\s]*$/),
/^[a-zA-Z0-9-]*$/), jv = (Iv("font display", Uv),
Iv("font weight", /^[a-zA-Z0-9- ]*$/),
Iv("font style", Uv),
Iv("font stretch", /^([a-zA-Z-]+|\d{1,3}%)$/),
function(e, t, n) {
var r = (0,
M.Z_)(e, t, n);
return "error" === r.type ? r : r.value.match(/^[-a-zA-Z0-9]*$/) ? (0,
M.x4)(new uf(window.encodeURI(r.value))) : (0,
M.zS)(new I.No("Invalid src value in font configuration value: ".concat(r.value, ". This value contains invalid characters.")))
}
), Bv = ((0,
M.CT)((function(e, t, n) {
var r = (0,
M.Ry)(e, t, n);
if ("error" === r.type)
return r;
var a = r.value
, i = {}
, o = (0,
M.kw)("local", "url")(a.loadType, t, n);
if ("error" === o.type)
return o;
i.loadType = o.value;
var s = (0,
M.jt)(jv)(a.format, t, n);
if ("error" === s.type)
return s;
s.value && (i.format = s.value);
var u = "local" === i.loadType ? Dv(a.value, t, n) : function(e, t, n) {
var r = (0,
M.Z_)(e, t, n);
return "error" === r.type ? r : r.value.match(/^"?'?https:\/\//) || r.value.match(/^data:/) || r.value.match(/^\/\//) ? r.value.match(/^[#?&=;,a-zA-Z0-9-+_/.:]*$/) ? (0,
M.x4)(new uf(window.encodeURI(r.value))) : (0,
M.zS)(new I.No("Invalid src value in font configuration value: ".concat(r.value, ". This value contains invalid characters."))) : (0,
M.zS)(new I.No("Invalid src value in font configuration: ".concat(r.value, ". URLs have to start with 'https://' or 'data:'.")))
}(a.value, t, n);
return "error" === u.type ? u : (i.value = u.value,
(0,
M.x4)(i))
}
)),
(0,
M.mC)({
borderRadius: (0,
M.jt)(xv),
theme: (0,
M.jt)(M.kw.apply(void 0, ["dark", "light", "light-outline"])),
type: (0,
M.jt)(M.kw.apply(void 0, ["donate", "buy", "book", "default", "check-out", "subscribe", "add-money", "contribute", "order", "reload", "rent", "support", "tip", "top-up"])),
height: (0,
M.jt)(xv),
buttonSpacing: (0,
M.jt)(xv)
}),
function(e, t, n) {
var r, a;
if (!n)
return {
config: e,
warnings: []
};
var i = (0,
M.Gu)(Ov, e, t)
, o = i.value
, s = i.warnings
, u = o.rowGap
, l = o.columnGap
, c = o.disableAnimations;
return {
config: {
rules: o.rules,
disableAnimations: c,
variables: {
gridRowSpacing: null !== (r = null == u ? void 0 : u.value) && void 0 !== r ? r : "10px",
gridColumnSpacing: null !== (a = null == l ? void 0 : l.value) && void 0 !== a ? a : "10px"
}
},
warnings: s
}
}
), Fv = function(e, t) {
var n = arguments.length > 2 && void 0 !== arguments[2] && arguments[2]
, r = Bv(e, t, n)
, a = r.config
, i = r.warnings
, o = (0,
M.Gu)(Lv, a, t)
, s = o.value
, u = o.warnings
, l = Ev(s.theme || null)
, c = l.theme
, d = l.warnings
, p = vv(s.variables || {})
, m = p.variables
, f = p.warnings
, h = Zv(s.labels || null)
, _ = h.labels
, y = h.warnings
, v = Cv(s.rules || {}, n)
, g = v.rules
, b = v.warnings
, S = [].concat((0,
Z.Z)(i), (0,
Z.Z)(u), (0,
Z.Z)(d), (0,
Z.Z)(f), (0,
Z.Z)(b), (0,
Z.Z)(y)).map((function(e) {
return -1 !== e.indexOf(t) ? e : "".concat(t, ": ").concat(e)
}
));
return S.length && S.push("For more information on using the `appearance` option, see https://stripe.com/docs/stripe-js/appearance-api"),
{
warnings: S,
config: {
theme: c,
variables: m,
rules: g,
disableAnimations: !!s.disableAnimations,
labels: _
}
}
}, Gv = function(e) {
var t = e.isAllowedCardBrandsOption
, n = e.option
, r = e.availableBrandsFromSession
, a = e.beta
, i = e.merchantCountry
, o = new Set(_o)
, s = yo(a)
, u = s.filter((function(e) {
return "discover_global_network" !== e
}
))
, l = n.filter((function(e) {
return o.has(e)
}
))
, c = t ? "allowedCardBrands" : "disallowedCardBrands";
if (l.length > 0) {
if (0 === r.length)
throw new I.No("".concat(c, " should be a subset of the following strings: ").concat(s.join(", "), ". You specified: ").concat(n.join(", ")));
if (-1 !== n.indexOf("discover_global_network"))
throw new I.No("You cannot specify both discover_global_network and a subset of the Discover network brands.\n discover_global_network encompasses all of the cards that are part of the Discover Global Network, including Discover, Diners, JCB, UnionPay, and Elo.");
l.forEach((function(e) {
if (-1 === r.indexOf(e)) {
var t = [].concat((0,
Z.Z)(u), (0,
Z.Z)(r));
throw new I.No("".concat(c, " should be a subset of the following strings: ").concat(t.join(", "), ". You specified: ").concat(n.join(", ")))
}
}
))
}
if (!t) {
var d = s.length;
if (l.length > 0 && (d = new Set([].concat((0,
Z.Z)(function(e) {
return e ? co.filter((function(t) {
var n;
return !(!po[t] || -1 === (null === (n = po[t]) || void 0 === n ? void 0 : n.indexOf(e)))
}
)) : []
}(i)), (0,
Z.Z)(u))).size),
n.length === d)
throw new I.No("You cannot block all available card brands.")
}
}, qv = function(e, t) {
var n, r, a, i, o, s = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : [];
if (((0,
N.uN)(s, N.M4.blocked_card_brands_beta_2) || (0,
N.uN)(s, N.M4.blocked_card_brands_beta_1)) && (null != e && null !== (n = e.allowedCardBrands) && void 0 !== n && n.length || null != e && null !== (r = e.disallowedCardBrands) && void 0 !== r && r.length)) {
if (null != e && null !== (a = e.allowedCardBrands) && void 0 !== a && a.length && null != e && null !== (i = e.disallowedCardBrands) && void 0 !== i && i.length)
throw new I.No("You cannot specify both disallowedCardBrands and allowedCardBrands. Please specify only one of those parameters.");
var u = (0,
N.uN)(s || [], N.M4.blocked_card_brands_beta_2) ? N.M4.blocked_card_brands_beta_2 : N.M4.blocked_card_brands_beta_1
, l = t.merchantCountry
, c = t.filterByAllowingBrands
, d = void 0 === c ? [] : c
, p = t.filterByDisallowingBrands
, m = void 0 === p ? [] : p
, f = Boolean(null == e || null === (o = e.allowedCardBrands) || void 0 === o ? void 0 : o.length)
, h = f ? d : m
, _ = f ? e.allowedCardBrands : e.disallowedCardBrands;
_ && Gv({
isAllowedCardBrandsOption: f,
option: _,
availableBrandsFromSession: h,
beta: u,
merchantCountry: l
})
}
}, Kv = function(e, t) {
if (!("subscription" !== e || t && t.elements_enable_read_allow_redisplay))
throw new I.No("You cannot specify a customerSessionClientSecret while using Subscriptions.")
}, Vv = function(e) {
var t = e.deferredIntentMode
, n = e.clientSecretType
, r = e.setupFutureUsage
, a = e.betas
, i = void 0 === a ? [] : a
, o = e.featureFlags
, s = "\"mode: 'payment'\"";
if ("PAYMENT_INTENT" === n ? s = '"paymentIntent"' : "setup" === t ? s = "\"mode: 'setup'\"" : "SETUP_INTENT" === n && (s = '"setupIntent"'),
!(void 0 === o ? {} : o).elements_enable_read_allow_redisplay) {
if ("subscription" === t)
throw new I.No("You cannot use the save payment method feature while using Subscriptions.");
if ("off_session" === r && !(0,
N.uN)(i, N.M4.elements_spm_sfu_off_session_override_beta_1))
throw new I.No("You cannot use the save payment method feature when specifying \"setup_future_usage: 'off_session'\" with ".concat(s, "."));
if (("PAYMENT_INTENT" === n || "payment" === t) && "on_session" === r)
throw new I.No("You cannot use the save payment method feature when specifying \"setup_future_usage: 'on_session'\" and with a Payment Intent or payment mode.")
}
}, zv = function(e) {
var t = e.unverifiedPaymentMethods
, n = e.elementName
, r = "- ".concat(t.join("\n- "));
return ["You have not registered or verified the domain, so the following payment methods are not enabled in the ".concat(n, ": \n\n").concat(r, "\n\n"), "Please follow https://stripe.com/docs/payments/payment-methods/pmd-registration to register and verify the domain."].join("")
}, Hv = function(e, t) {
var n;
if (n = e,
yi.indexOf(n) >= 0)
return Ed.getInstance().paymentUserAgentSurfaceContextSuffix === ua.wl;
var r = bi()[e];
return null == r || void 0 !== t && !!t[r]
}, Yv = function(e, t) {
if (!t)
return !1;
var n = Si[e];
return !!n && t.indexOf(n) >= 0
}, Wv = function(e, t, n) {
return e ? e.filter((function(r, a) {
return a === e.indexOf(r) && Hv(r, t) && !Yv(r, n)
}
)) : []
}, Jv = function(e, t, n, r) {
if (t) {
var a = t.filter((function(e) {
return !Hv(e, n)
}
));
if (a.length > 0) {
var i = "- ".concat(a.join("\n- "));
e(["The following external payment method types are not enabled:\n\n".concat(i, "\n\n"), "Please ensure that your account is enabled for any preview features that you are trying to use."].join(""))
}
var o = t.filter((function(e) {
return Hv(e, n) && Yv(e, r)
}
));
if (o.length > 0) {
var s = "- ".concat(o.join("\n- "));
e("The following external payment method types will be omitted because equivalent payment methods are already available in the payment intent:\n\n".concat(s))
}
}
}, Xv = [L.NC.PAYMENT_ELEMENT, L.NC.LINK_AUTHENTICATION_ELEMENT, L.NC.ADDRESS_ELEMENT, L.NC.ADDRESS_ELEMENT_BILLING, L.NC.ADDRESS_ELEMENT_SHIPPING, L.NC.AUTOCOMPLETE_SUGGESTIONS_ELEMENT, L.NC.ACH_BANK_SEARCH_RESULTS_ELEMENT, L.NC.EXPRESS_CHECKOUT_ELEMENT, L.NC.CURRENCY_SELECTOR_ELEMENT], Qv = (Ve = {},
(0,
v.Z)(Ve, V.Yj.payment, {
internal: !1
}),
(0,
v.Z)(Ve, V.Yj.linkAuthentication, {
internal: !1
}),
(0,
v.Z)(Ve, V.Yj.address, {
internal: !1
}),
(0,
v.Z)(Ve, V.Yj.expressCheckout, {
internal: !1
}),
(0,
v.Z)(Ve, V.Yj.currencySelector, {
internal: !1
}),
Ve), $v = (0,
O.Q8)(Qv, (function() {
return null
}
)), eg = function(e) {
return e.reduce((function(e, t) {
return e.push.apply(e, (0,
Z.Z)(ho[t])),
e
}
), [])
}, tg = function(e, t) {
if (null != e && e.length) {
var n = eg(e);
return (0,
Z.Z)(V.iw).filter((function(e) {
return -1 === n.indexOf(e)
}
))
}
return null != t && t.length ? eg(t) : []
}, ng = "function" == typeof Symbol && Symbol.observable || "@@observable", rg = function() {
return Math.random().toString(36).substring(7).split("").join(".")
}, ag = {
INIT: "@@redux/INIT" + rg(),
REPLACE: "@@redux/REPLACE" + rg(),
PROBE_UNKNOWN_ACTION: function() {
return "@@redux/PROBE_UNKNOWN_ACTION" + rg()
}
};
var ig = p();
ig.withExtraArgument = p;
var og, sg, ug, lg = ig, cg = ["checks"], dg = {
requests: {
CREATE_SESSION: {
status: "NONE"
},
LINK_GLOBAL_HOLDBACK_LOOKUP: {
status: "NONE"
},
LOGOUT: {
status: "NONE"
},
START_VERIFICATION: {
status: "NONE"
},
CONFIRM_VERIFICATION: {
status: "NONE"
},
LIST_PAYMENT_DETAILS: {
status: "NONE"
},
LIST_SHIPPING_ADDRESSES: {
status: "NONE"
},
REMOVE_PAYMENT_DETAILS: {
status: "NONE"
},
REMOVE_SHIPPING_ADDRESS: {
status: "NONE"
},
SIGN_UP: {
status: "NONE"
},
CREATE_PAYMENT_DETAILS: {
status: "NONE"
},
UPDATE_PAYMENT_DETAILS: {
status: "NONE"
},
CONFIRM_LINK_PAYMENT_INTENT: {
status: "NONE",
failedPaymentDetailsIds: []
},
CONFIRM_LINK_SETUP_INTENT: {
status: "NONE",
failedPaymentDetailsIds: []
}
},
loaded: !1,
consumerSession: null,
emailSource: null,
authenticationState: "none",
paymentDetails: [],
shippingAddresses: [],
isPersistentConsumerSessionPending: !1,
instantDebitsIncentive: null,
instantDebitsIncentiveShown: !1,
publishableKey: null,
linkAutofillEmail: null,
hideLinkSignUpFromBillingCountry: !1,
linkFunnelConfirmationLinkType: "",
autoFillBehavior: null,
useBackupPaymentMethod: !1,
foundUsingPartialCookie: !1,
fullNameCollectionRequired: !1,
emailOtpRequiresAdditionalInfo: !1,
emailOtpVerifyPhoneDespiteSmsOtp: !1,
experiments: [],
fetchWebAuthnCredentialsParams: null,
hasPasskey: !1,
hasPreviousMerchantRelationship: !1,
linkModalStatus: "disabled",
linkModalEnabledByExperiment: !1,
purchaseProtectionsHoldback: !1,
linkGlobalHoldbackLookupState: null,
consumerSignUpIncentiveOffers: {}
}, pg = [403], mg = function(e) {
return e.split(".")[1]
}, fg = function(e, t) {
return function() {
var n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : t || e
, r = arguments.length > 1 ? arguments[1] : void 0;
switch (r.type) {
case "CONSUMER.SIGN_UP.PENDING":
case "CONSUMER.CREATE_SESSION.PENDING":
case "CONSUMER.LOGOUT.PENDING":
case "CONSUMER.REMOVE_SHIPPING_ADDRESS.PENDING":
case "CONSUMER.REMOVE_PAYMENT_DETAILS.PENDING":
case "CONSUMER.CREATE_PAYMENT_DETAILS.PENDING":
case "CONSUMER.UPDATE_PAYMENT_DETAILS.PENDING":
case "CONSUMER.LIST_PAYMENT_DETAILS.PENDING":
case "CONSUMER.LIST_SHIPPING_ADDRESSES.PENDING":
case "CONSUMER.LINK_GLOBAL_HOLDBACK_LOOKUP.PENDING":
var a, i = mg(r.type), o = hg(r, n);
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
authenticationState: o,
requests: (0,
b.Z)((0,
b.Z)({}, n.requests), {}, (0,
v.Z)({}, i, {
status: "PENDING",
lastError: null !== (a = n.requests[i].error) && void 0 !== a ? a : null
}))
});
case "CONSUMER.CONFIRM_VERIFICATION.PENDING":
var s, u = mg(r.type);
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
requests: (0,
b.Z)((0,
b.Z)({}, n.requests), {}, (0,
v.Z)({}, u, {
status: "PENDING",
lastError: null !== (s = n.requests[u].error) && void 0 !== s ? s : null,
verificationType: r.verificationType,
isWebAuthnGettingCredential: r.isWebAuthnGettingCredential
}))
});
case "CONSUMER.START_VERIFICATION.PENDING":
var l, c = mg(r.type);
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
requests: (0,
b.Z)((0,
b.Z)({}, n.requests), {}, (0,
v.Z)({}, c, {
status: "PENDING",
lastError: null !== (l = n.requests[c].error) && void 0 !== l ? l : null,
verificationType: r.verificationType
}))
});
case "CONSUMER.CONFIRM_LINK_PAYMENT_INTENT.PENDING":
case "CONSUMER.CONFIRM_LINK_SETUP_INTENT.PENDING":
var d = mg(r.type);
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
requests: (0,
b.Z)((0,
b.Z)({}, n.requests), {}, (0,
v.Z)({}, d, {
status: "PENDING",
failedPaymentDetailsIds: (0,
Z.Z)(n.requests[d].failedPaymentDetailsIds)
}))
});
case "CONSUMER.CREATE_PAYMENT_DETAILS.ERROR":
case "CONSUMER.LIST_PAYMENT_DETAILS.ERROR":
case "CONSUMER.LIST_SHIPPING_ADDRESSES.ERROR":
case "CONSUMER.LOGOUT.ERROR":
case "CONSUMER.REMOVE_PAYMENT_DETAILS.ERROR":
case "CONSUMER.REMOVE_SHIPPING_ADDRESS.ERROR":
case "CONSUMER.UPDATE_PAYMENT_DETAILS.ERROR":
var p = mg(r.type);
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
requests: (0,
b.Z)((0,
b.Z)({}, n.requests), {}, (0,
v.Z)({}, p, {
status: "ERROR",
error: r.error
}))
});
case "CONSUMER.LINK_GLOBAL_HOLDBACK_LOOKUP.ERROR":
var m, f = mg(r.type);
return m = "email" === r.lookupBy ? r.source : "cookie",
(0,
b.Z)((0,
b.Z)({}, n), {}, {
requests: (0,
b.Z)((0,
b.Z)({}, n.requests), {}, (0,
v.Z)({}, f, {
status: "ERROR",
error: r.error
})),
linkGlobalHoldbackLookupState: {
lookupStatus: "unregistered",
lookupType: m
}
});
case "CONSUMER.CONFIRM_VERIFICATION.ERROR":
case "CONSUMER.START_VERIFICATION.ERROR":
var _ = mg(r.type)
, y = hg(r, n);
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
authenticationState: y,
requests: (0,
b.Z)((0,
b.Z)({}, n.requests), {}, (0,
v.Z)({}, _, {
status: "ERROR",
verificationType: r.verificationType,
error: r.error
}))
});
case "CONSUMER.CONFIRM_LINK_SETUP_INTENT.ERROR":
case "CONSUMER.CONFIRM_LINK_PAYMENT_INTENT.ERROR":
var g = mg(r.type)
, S = n.requests[g].failedPaymentDetailsIds;
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
requests: (0,
b.Z)((0,
b.Z)({}, n.requests), {}, (0,
v.Z)({}, g, {
status: "ERROR",
error: r.error,
failedPaymentDetailsIds: S.filter((function(e) {
return e !== r.id
}
)).concat(r.id ? [r.id] : [])
}))
});
case "CONFIG.ASYNC_UPDATE_RECEIVED":
var k, C;
return r.consumerSession ? -1 !== (null === (k = r.config.session) || void 0 === k || null === (C = k.orderedPaymentMethodTypesAndWallets) || void 0 === C ? void 0 : C.indexOf("link")) || r.isLinkPassthroughAlreadyEnabled ? Kc(r.consumerSession) ? (0,
b.Z)((0,
b.Z)({}, n), {}, {
loaded: !0
}) : n : Kc(r.consumerSession) ? (0,
b.Z)((0,
b.Z)({}, n), {}, {
loaded: !1
}) : (0,
b.Z)((0,
b.Z)({}, dg), {}, {
instantDebitsIncentive: n.instantDebitsIncentive && (0,
b.Z)({}, n.instantDebitsIncentive),
consumerSignUpIncentiveOffers: (0,
b.Z)({}, n.consumerSignUpIncentiveOffers)
}) : n;
case "CONFIG.ELEMENT_UNMOUNTED":
return "payment" === r.element && "disabled" !== n.linkModalStatus ? (0,
b.Z)((0,
b.Z)({}, dg), {}, {
requests: (0,
b.Z)((0,
b.Z)({}, dg.requests), {}, {
LOGOUT: n.requests.LOGOUT
}),
hideLinkSignUpFromBillingCountry: n.hideLinkSignUpFromBillingCountry,
instantDebitsIncentive: n.instantDebitsIncentive && (0,
b.Z)({}, n.instantDebitsIncentive),
consumerSignUpIncentiveOffers: (0,
b.Z)({}, n.consumerSignUpIncentiveOffers),
isPersistentConsumerSessionPending: e.isPersistentConsumerSessionPending
}) : n;
case "CONSUMER.RESET_SESSION":
if (n.isPersistentConsumerSessionPending && !r.ignoreCookieLogin)
return n;
var E = hg(r, n);
return (0,
b.Z)((0,
b.Z)({}, dg), {}, {
requests: (0,
b.Z)((0,
b.Z)({}, dg.requests), {}, {
LOGOUT: n.requests.LOGOUT
}),
hideLinkSignUpFromBillingCountry: n.hideLinkSignUpFromBillingCountry,
instantDebitsIncentive: n.instantDebitsIncentive && (0,
b.Z)({}, n.instantDebitsIncentive),
consumerSignUpIncentiveOffers: (0,
b.Z)({}, n.consumerSignUpIncentiveOffers),
autoFillBehavior: dg.autoFillBehavior,
authenticationState: E,
linkModalStatus: n.linkModalStatus,
linkGlobalHoldbackLookupState: n.linkGlobalHoldbackLookupState
});
case "CONSUMER.SIGN_UP.ERROR":
var A = mg(r.type)
, M = hg(r, n);
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
consumerSession: null,
authenticationState: M,
requests: (0,
b.Z)((0,
b.Z)({}, n.requests), {}, (0,
v.Z)({}, A, {
status: "ERROR",
error: r.error
})),
isPersistentConsumerSessionPending: !1
});
case "CONSUMER.CREATE_SESSION.ERROR":
var P = mg(r.type)
, x = hg(r, n);
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
consumerSession: null,
authenticationState: x,
requests: (0,
b.Z)((0,
b.Z)({}, n.requests), {}, (0,
v.Z)({}, P, {
status: "ERROR",
error: r.error
})),
isPersistentConsumerSessionPending: !1,
linkGlobalHoldbackLookupState: {
lookupStatus: "unregistered",
lookupType: null == r ? void 0 : r.source
}
});
case "CONSUMER.SIGN_UP.SUCCESS":
var I = hg(r, n);
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
consumerSession: r.session,
authenticationState: I,
requests: (0,
b.Z)((0,
b.Z)({}, n.requests), {}, {
SIGN_UP: {
status: "SUCCESS"
}
})
});
case "CONSUMER.SET_EXPERIMENTS":
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
experiments: r.experiments
});
case "CONSUMER.LINK_GLOBAL_HOLDBACK_LOOKUP.SUCCESS":
var N, w = hg(r, n), T = r.response.exists ? "found" : "unregistered";
return N = r.response.exists ? r.response.settings.found_using_partial_cookie ? "partial_cookie" : r.source ? r.source : "cookie" === r.lookupBy ? "cookie" : "unknown" : "none",
(0,
b.Z)((0,
b.Z)({}, n), {}, {
authenticationState: w,
requests: (0,
b.Z)((0,
b.Z)({}, n.requests), {}, {
CREATE_SESSION: {
status: "SUCCESS"
}
}),
linkGlobalHoldbackLookupState: {
lookupStatus: T,
lookupType: N
}
});
case "CONSUMER.CREATE_SESSION.SUCCESS":
var O, R, L, D, U, j, B, F = !!n.isPersistentConsumerSessionPending && Kc(r.session), G = hg(r, n), q = r.experiments || [], K = "found";
return B = "email" === r.lookupBy ? r.source : r.foundUsingPartialCookie ? "partial_cookie" : "cookie",
(0,
b.Z)((0,
b.Z)({}, n), {}, {
consumerSession: r.session,
emailSource: r.emailSource || null,
authenticationState: G,
requests: (0,
b.Z)((0,
b.Z)({}, n.requests), {}, {
CREATE_SESSION: {
status: "SUCCESS"
}
}),
isPersistentConsumerSessionPending: F,
publishableKey: r.publishableKey || null,
foundUsingPartialCookie: null !== (O = r.foundUsingPartialCookie) && void 0 !== O && O,
fullNameCollectionRequired: null !== (R = r.fullNameCollectionRequired) && void 0 !== R && R,
emailOtpRequiresAdditionalInfo: null !== (L = r.emailOtpRequiresAdditionalInfo) && void 0 !== L && L,
emailOtpVerifyPhoneDespiteSmsOtp: null !== (D = r.emailOtpVerifyPhoneDespiteSmsOtp) && void 0 !== D && D,
experiments: q,
hasPasskey: null !== (U = r.hasPasskey) && void 0 !== U && U,
hasPreviousMerchantRelationship: r.hasPreviousMerchantRelationship,
purchaseProtectionsHoldback: null !== (j = r.purchaseProtectionsHoldback) && void 0 !== j && j,
linkGlobalHoldbackLookupState: {
lookupStatus: K,
lookupType: B
}
});
case "CONSUMER.LOGOUT.SUCCESS":
return (0,
b.Z)((0,
b.Z)({}, dg), {}, {
requests: (0,
b.Z)((0,
b.Z)({}, dg.requests), {}, {
LOGOUT: {
status: "SUCCESS"
}
}),
linkModalStatus: n.linkModalStatus
});
case "CONSUMER.START_VERIFICATION.SUCCESS":
var V;
if ((null === (V = n.consumerSession) || void 0 === V ? void 0 : V.email_address) === r.session.email_address || n.foundUsingPartialCookie) {
var z, H = hg(r, n);
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
consumerSession: (0,
b.Z)((0,
b.Z)({}, r.session), {}, {
available_verification_factors: null === (z = n.consumerSession) || void 0 === z ? void 0 : z.available_verification_factors
}),
authenticationState: H,
requests: (0,
b.Z)((0,
b.Z)({}, n.requests), {}, {
START_VERIFICATION: {
status: "SUCCESS",
verificationType: r.verificationType
},
LOGOUT: {
status: "NONE"
}
}),
fetchWebAuthnCredentialsParams: r.fetchWebAuthnCredentialsParams || n.fetchWebAuthnCredentialsParams
})
}
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
requests: (0,
b.Z)((0,
b.Z)({}, n.requests), {}, {
START_VERIFICATION: {
status: "NONE"
}
})
});
case "CONSUMER.CONFIRM_VERIFICATION.SUCCESS":
var Y = hg(r, n);
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
consumerSession: r.session,
authenticationState: Y,
requests: (0,
b.Z)((0,
b.Z)({}, n.requests), {}, {
CONFIRM_VERIFICATION: {
status: "SUCCESS",
verificationType: r.verificationType
},
LOGOUT: {
status: "NONE"
}
})
});
case "CONSUMER.LIST_PAYMENT_DETAILS.SUCCESS":
var W = r.paymentDetails.map((function(e) {
return (0,
b.Z)((0,
b.Z)({}, e), {}, {
metadata: {
active: !0
}
})
}
));
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
paymentDetails: W,
requests: (0,
b.Z)((0,
b.Z)({}, n.requests), {}, {
LIST_PAYMENT_DETAILS: {
status: "SUCCESS"
}
})
});
case "CONSUMER.CREATE_PAYMENT_DETAILS.SUCCESS":
var J = r.paymentDetails
, X = r.cvc
, Q = (0,
b.Z)((0,
b.Z)({}, J), {}, {
metadata: {
active: "CARD" !== J.type,
cvc: X
}
})
, $ = !1
, ee = n.paymentDetails.map((function(e) {
return e.id === Q.id ? ($ = !0,
Q) : e
}
));
return $ || ee.push(Q),
(0,
b.Z)((0,
b.Z)({}, n), {}, {
paymentDetails: ee,
requests: (0,
b.Z)((0,
b.Z)({}, n.requests), {}, {
CREATE_PAYMENT_DETAILS: {
status: "SUCCESS"
}
})
});
case "CONSUMER.UPDATE_PAYMENT_DETAILS.SUCCESS":
var te = r.paymentDetails
, ne = r.cvc
, re = null;
if ("CARD" === te.type && te.card_details) {
var ae = te.card_details
, ie = (ae.checks,
(0,
h.Z)(ae, cg));
re = ie
}
var oe = (0,
b.Z)((0,
b.Z)({}, te), {}, {
card_details: re,
metadata: {
active: !0,
cvc: ne
}
})
, se = n.paymentDetails.map((function(e) {
return e.id !== oe.id ? e : oe
}
));
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
paymentDetails: se,
requests: (0,
b.Z)((0,
b.Z)({}, n.requests), {}, {
UPDATE_PAYMENT_DETAILS: {
status: "SUCCESS"
},
CONFIRM_LINK_PAYMENT_INTENT: (0,
b.Z)((0,
b.Z)({}, n.requests.CONFIRM_LINK_PAYMENT_INTENT), {}, {
failedPaymentDetailsIds: n.requests.CONFIRM_LINK_PAYMENT_INTENT.failedPaymentDetailsIds.filter((function(e) {
return e !== oe.id
}
))
}),
CONFIRM_LINK_SETUP_INTENT: (0,
b.Z)((0,
b.Z)({}, n.requests.CONFIRM_LINK_SETUP_INTENT), {}, {
failedPaymentDetailsIds: n.requests.CONFIRM_LINK_SETUP_INTENT.failedPaymentDetailsIds.filter((function(e) {
return e !== oe.id
}
))
})
})
});
case "CONSUMER.LIST_SHIPPING_ADDRESSES.SUCCESS":
var ue = r.shippingAddresses;
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
shippingAddresses: ue,
requests: (0,
b.Z)((0,
b.Z)({}, n.requests), {}, {
LIST_SHIPPING_ADDRESSES: {
status: "SUCCESS"
}
})
});
case "CONSUMER.REMOVE_PAYMENT_DETAILS.SUCCESS":
var le = r.remainingPaymentDetails;
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
paymentDetails: le,
requests: (0,
b.Z)((0,
b.Z)({}, n.requests), {}, {
REMOVE_PAYMENT_DETAILS: {
status: "SUCCESS"
}
})
});
case "CONSUMER.REMOVE_SHIPPING_ADDRESS.SUCCESS":
var ce = r.id
, de = n.shippingAddresses.filter((function(e) {
return e.id !== ce
}
));
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
shippingAddresses: de,
requests: (0,
b.Z)((0,
b.Z)({}, n.requests), {}, {
REMOVE_SHIPPING_ADDRESS: {
status: "SUCCESS"
}
})
});
case "CONSUMER.CONFIRM_LINK_PAYMENT_INTENT.SUCCESS":
case "CONSUMER.CONFIRM_LINK_SETUP_INTENT.SUCCESS":
var pe = mg(r.type)
, me = n.requests[pe].failedPaymentDetailsIds;
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
requests: (0,
b.Z)((0,
b.Z)({}, n.requests), {}, (0,
v.Z)({}, pe, {
status: "SUCCESS",
failedPaymentDetailsIds: me.filter((function(e) {
return e !== r.id
}
))
}))
});
case "CONSUMER.LOADED":
var fe = r.autofillBehavior
, he = hg(r, n);
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
loaded: !0,
authenticationState: he,
isPersistentConsumerSessionPending: !1,
autoFillBehavior: fe
});
case "CONSUMER.UNSET_PENDING":
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
isPersistentConsumerSessionPending: !1
});
case "CONSUMER.INSTANT_DEBITS_INCENTIVE_SHOWN":
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
instantDebitsIncentiveShown: !0
});
case "CONSUMER.SET_INSTANT_DEBITS_INCENTIVE":
var _e = r.amount
, ye = r.bankPaymentDetailsId;
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
instantDebitsIncentive: {
amount: _e,
bankPaymentDetailsId: ye
}
});
case "CONSUMER.CLEAR_INSTANT_DEBITS_INCENTIVE":
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
instantDebitsIncentive: null
});
case "CONSUMER.ENABLE_SIGN_UP_INCENTIVE_OFFERS":
var ve = r.paymentMethodTypes;
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
consumerSignUpIncentiveOffers: ve.reduce((function(e, t) {
return (0,
b.Z)((0,
b.Z)({}, e), {}, (0,
v.Z)({}, t, (0,
b.Z)((0,
b.Z)({}, n.consumerSignUpIncentiveOffers[t]), {}, {
enabled: !0
})))
}
), n.consumerSignUpIncentiveOffers)
});
case "CONSUMER.RESET_SIGN_UP_INCENTIVE_OFFERS":
var ge = r.paymentMethodTypes;
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
consumerSignUpIncentiveOffers: ge.reduce((function(e, t) {
return (0,
b.Z)((0,
b.Z)({}, e), {}, (0,
v.Z)({}, t, (0,
b.Z)((0,
b.Z)({}, n.consumerSignUpIncentiveOffers[t]), {}, {
enabled: !1,
instrumentId: void 0,
paymentInstrumentEligible: void 0
})))
}
), n.consumerSignUpIncentiveOffers)
});
case "CONSUMER.SET_INSTRUMENT_FOR_SIGN_UP_INCENTIVE":
var be, Se = r.paymentMethodType, ke = r.instrumentId, Ce = r.instrumentEligible;
return null !== (be = n.consumerSignUpIncentiveOffers[Se]) && void 0 !== be && be.enabled ? (0,
b.Z)((0,
b.Z)({}, n), {}, {
consumerSignUpIncentiveOffers: (0,
b.Z)((0,
b.Z)({}, n.consumerSignUpIncentiveOffers), {}, (0,
v.Z)({}, Se, (0,
b.Z)((0,
b.Z)({}, n.consumerSignUpIncentiveOffers[Se]), {}, {
instrumentId: ke,
instrumentEligible: Ce
})))
}) : n;
case "CONSUMER.SIGN_UP_INCENTIVE_OFFER_SHOWN":
var Ee, Ze = r.paymentMethodType;
return null !== (Ee = n.consumerSignUpIncentiveOffers[Ze]) && void 0 !== Ee && Ee.enabled ? (0,
b.Z)((0,
b.Z)({}, n), {}, {
consumerSignUpIncentiveOffers: (0,
b.Z)((0,
b.Z)({}, n.consumerSignUpIncentiveOffers), {}, (0,
v.Z)({}, Ze, (0,
b.Z)((0,
b.Z)({}, n.consumerSignUpIncentiveOffers[Ze]), {}, {
wasShown: !0
})))
}) : n;
case "CONSUMER.RESET_INSTRUMENT_FOR_SIGN_UP_INCENTIVE":
var Ae, Me = r.paymentMethodType;
return null !== (Ae = n.consumerSignUpIncentiveOffers[Me]) && void 0 !== Ae && Ae.enabled ? (0,
b.Z)((0,
b.Z)({}, n), {}, {
consumerSignUpIncentiveOffers: (0,
b.Z)((0,
b.Z)({}, n.consumerSignUpIncentiveOffers), {}, (0,
v.Z)({}, Me, (0,
b.Z)((0,
b.Z)({}, n.consumerSignUpIncentiveOffers[Me]), {}, {
instrumentId: void 0,
instrumentEligible: void 0
})))
}) : n;
case "CONSUMER.LINK_AUTOFILL_EMAIL_CHANGED":
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
linkAutofillEmail: r.email
});
case "CONSUMER.TOGGLE_LINK_SIGN_UP":
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
hideLinkSignUpFromBillingCountry: r.hideLinkSignUpFromBillingCountry
});
case "CONSUMER.LINK_FUNNEL_CONFIRMATION_LINK_TYPE":
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
linkFunnelConfirmationLinkType: r.confirmationType
});
case "CONSUMER.RETURN_USER_AUTOFILL_CLICKED":
var Pe = hg(r, n);
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
autoFillBehavior: "noclick",
authenticationState: Pe
});
case "CONSUMER.TOGGLE_BACKUP_PAYMENT_METHOD":
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
useBackupPaymentMethod: r.useBackupPaymentMethod
});
case "CONSUMER.CONFIRM_VERIFICATION.CLEAR":
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
requests: (0,
b.Z)((0,
b.Z)({}, n.requests), {}, {
CONFIRM_VERIFICATION: {
status: "NONE"
}
})
});
case "CONSUMER.CLEAR_START_VERIFICATION_ERROR":
return "ERROR" !== n.requests.START_VERIFICATION.status ? n : (0,
b.Z)((0,
b.Z)({}, n), {}, {
requests: (0,
b.Z)((0,
b.Z)({}, n.requests), {}, {
START_VERIFICATION: {
status: "NONE"
}
})
});
case "CONSUMER.LINK_MODAL.ENABLED_BY_EXPERIMENT":
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
linkModalEnabledByExperiment: !0
});
case "CONSUMER.LINK_MODAL.DISABLED_BY_EXPERIMENT":
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
linkModalEnabledByExperiment: !1
});
case "CONSUMER.LINK_MODAL.LOADING":
var xe = n.linkModalStatus;
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
linkModalStatus: "disabled" === xe ? "loading" : xe
});
case "CONSUMER.LINK_MODAL.LOADED":
var Ie = n.linkModalStatus;
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
linkModalStatus: "disabled" === Ie || "loading" === Ie ? "unopened" : Ie
});
case "CONSUMER.LINK_MODAL.OPEN":
var Ne = n.linkModalStatus;
return "disabled" === Ne ? n : (0,
b.Z)((0,
b.Z)({}, n), {}, {
linkModalStatus: "open"
});
case "CONSUMER.LINK_MODAL.CLOSE":
var we = n.linkModalStatus;
return "disabled" === we ? n : (0,
b.Z)((0,
b.Z)({}, n), {}, {
linkModalStatus: "previously-open"
});
case "AUTHENTICATION.FIELD_CHANGED":
var Te = r.name;
if ("autofill" === Te && "OPT-OUT" === r.value)
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
authenticationState: "declined"
});
if ("autofill" === Te && "OPT-IN" === r.value) {
var Oe = n.consumerSession && Kc(n.consumerSession) && "oneclick" === n.autoFillBehavior;
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
authenticationState: Oe ? n.authenticationState : "unverified"
})
}
return n;
default:
return n
}
}
}, hg = function(e, t) {
var n;
switch (e.type) {
case "CONSUMER.RESET_SESSION":
return "none";
case "CONSUMER.CREATE_SESSION.SUCCESS":
return e.publishableKey ? t.authenticationState : "unregistered";
case "CONSUMER.LOADED":
return "noclick" === e.autofillBehavior ? "logged-in" : t.consumerSession && Kc(t.consumerSession) && "oneclick" === e.autofillBehavior ? "verified" : "unverified";
case "CONSUMER.CREATE_SESSION.ERROR":
return null !== (n = e.error) && void 0 !== n && n.status && -1 !== pg.indexOf(e.error.status) ? "none" : "unregistered";
case "CONSUMER.CREATE_SESSION.PENDING":
var r = t.requests.CREATE_SESSION.error;
return r && -1 === pg.indexOf(r.status || -1) ? "unregistered" : t.authenticationState;
case "CONSUMER.START_VERIFICATION.SUCCESS":
case "CONSUMER.START_VERIFICATION.ERROR":
case "CONSUMER.CONFIRM_VERIFICATION.SUCCESS":
return "verifying";
case "CONSUMER.RETURN_USER_AUTOFILL_CLICKED":
return "logged-in";
case "CONSUMER.SIGN_UP.SUCCESS":
return "unverified";
default:
return t.authenticationState
}
}, _g = {
AT: "AT",
BE: "BE",
DE: "DE",
ES: "ES",
NL: "NL"
}, yg = function(e, t, n, r) {
switch (e) {
case "sofort":
return t && (_g[t.toUpperCase()] || null) || wp.sofort.country;
case "klarna":
return function(e, t, n) {
if (t && t in Op) {
var r = -1 !== Op[t].indexOf(e);
return e && r ? jp[e] : Op[t][0]
}
if (n) {
var a = Lp(n);
if (0 === a.length)
return wp.klarna.country;
var i = -1 !== (a = a.filter((function(e) {
return -1 !== Bp.indexOf(e)
}
))).indexOf(e);
return e && i ? e : a[0]
}
return wp.klarna.country
}(t, n, r);
default:
return (t ? Yt(t) : null) || Pp
}
}, vg = {
isFetchingBanks: !1,
hoveredIndex: 0,
isBankSelected: !1,
banks: null,
inputLocation: null,
bankAccount: null,
error: null,
arrowPressed: !1
}, gg = (n(94827),
n(5167),
n(15972),
n(14657),
n(53022),
n(75979),
n(2919),
n(54504),
n(94697),
n(86520),
Object.keys({
visa: !0,
amex: !0,
cartes_bancaires: !0,
discover: !0,
mastercard: !0,
jcb: !0,
diners: !0,
unionpay: !0,
elo: !0,
unknown: !0
}),
{}), bg = function(e, t, n) {
var r = t || {}
, a = r.currency
, i = void 0 === a ? "usd" : a
, o = r.detectedCountryCode
, s = void 0 === o ? "US" : o
, u = r.merchantInfo
, l = function(e, t) {
if (!new Set(["card", "saved", "sepa_debit", "bacs_debit", "boleto", "afterpay_clearpay"]).has(e))
return !1;
if (!t)
return !0;
var n = {
name: "billing_details.name",
country: "billing_details.address.country",
postalCode: "billing_details.address.postal_code",
administrativeArea: "billing_details.address.state",
locality: "billing_details.address.city",
addressLine1: "billing_details.address.line1",
addressLine2: "billing_details.address.line2"
}
, r = Object.keys(n);
return "card" !== e && "saved" !== e || (r = ["country", "postalCode"]),
r.every((function(e) {
return "never" !== wo(t, n[e])
}
))
}(e, null == n ? void 0 : n.fields)
, c = null == u ? void 0 : u.countryCode
, d = [e, s, i, l, c].map((function(e) {
return null != e ? e : "null"
}
)).join(":");
if (gg[d])
return gg[d];
var p = yg(e, s, i, c)
, m = (0,
b.Z)((0,
b.Z)({}, Tp(e, t)), {}, {
shippingAsBilling: l,
country: p,
linkMobilePhoneCountry: p
})
, f = Object.keys(m)
, h = f.reduce((function(e, t) {
return (0,
b.Z)((0,
b.Z)({}, e), {}, (0,
v.Z)({}, t, m[t]))
}
), {})
, _ = f.reduce((function(e, t) {
return (0,
b.Z)((0,
b.Z)({}, e), {}, (0,
v.Z)({}, t, !1))
}
), {})
, y = f.reduce((function(e, t) {
return (0,
b.Z)((0,
b.Z)({}, e), {}, (0,
v.Z)({}, t, !0))
}
), {})
, g = {
values: h,
focusedField: null,
displayErrors: _,
autofilledFields: f.reduce((function(e, t) {
return (0,
b.Z)((0,
b.Z)({}, e), {}, (0,
v.Z)({}, t, !1))
}
), {}),
pastedFields: f.reduce((function(e, t) {
return (0,
b.Z)((0,
b.Z)({}, e), {}, (0,
v.Z)({}, t, !1))
}
), {}),
shouldUpdateLocalValueFromState: y,
isEmpty: !0,
isComplete: !1,
touched: !1
};
return gg[d] = g,
g
}, Sg = function(e) {
var t = e.paymentMethod
, n = e.session
, r = e.options
, a = e.savedPaymentCvcs
, i = e.savedPaymentId
, o = bg(t, n, r);
return null != a && a[i] ? (0,
b.Z)((0,
b.Z)({}, o), {}, {
values: (0,
b.Z)((0,
b.Z)({}, o.values), {}, {
cvc: a[i]
})
}) : o
}, kg = function(e) {
var t = e.session
, n = e.selectedPaymentForm
, r = e.options
, a = e.savedPaymentMethodAction
, i = e.previousCustomer
, o = e.customerSessionSavedPaymentFromState
, s = e.elementsState
, u = o.selectedSavedPayment
, l = o.updatingSavedPayment
, c = o.removingSavedPayment
, d = null == c ? void 0 : c.id
, p = {
selectedPaymentForm: n,
session: t,
form: (0,
v.Z)({}, n, bg(n, t, r)),
savePaymentMethodDisplay: t_(s)
}
, m = o
, f = p.session.customer;
if (a)
m = f ? (null == u ? void 0 : u.id) === d ? (0,
b.Z)((0,
b.Z)((0,
b.Z)({}, o), a), {}, {
selectedSavedPayment: Ec(f, d)
}) : (0,
b.Z)((0,
b.Z)({}, o), a) : (0,
b.Z)((0,
b.Z)((0,
b.Z)({}, o), a), {}, {
selectedSavedPayment: null
});
else if (f)
if (f.id === (null == i ? void 0 : i.id)) {
var h = Pc(s);
m = (0,
b.Z)((0,
b.Z)({}, o), {}, {
selectedSavedPayment: (0,
O.sE)(h, (function(e) {
return e.id === (null == u ? void 0 : u.id)
}
)) ? u : Ec(f),
updatingSavedPayment: l && (0,
O.sE)(h, (function(e) {
return e.id === l.id
}
)) ? l : null,
removingSavedPayment: d && (0,
O.sE)(h, (function(e) {
return e.id === d
}
)) ? c : null
})
} else
m = (0,
b.Z)((0,
b.Z)({}, o), {}, {
selectedSavedPayment: Ec(f),
updatingSavedPayment: null,
removingSavedPayment: null
});
else
m = {
selectedSavedPayment: null,
updatingSavedPayment: null,
removingSavedPayment: null,
isSelectingSavedPayment: !1
};
return (0,
b.Z)((0,
b.Z)({}, p), {}, {
customerSessionSavedPayment: m
})
}, Cg = function(e) {
var t, n, r = kc({
orderedPaymentMethodTypesAndWallets: (null == e ? void 0 : e.orderedPaymentMethodTypesAndWallets) || [],
unverifiedPaymentMethodsOnDomain: (null == e ? void 0 : e.unverifiedPaymentMethodsOnDomain) || [],
customPaymentMethodOrder: null,
shouldListApplePay: !1,
shouldListGooglePay: !1,
shouldListLink: !0,
eceVisibleButtons: [],
linkSettings: null == e ? void 0 : e.linkSettings,
heldbackPaymentMethods: []
}), a = (0,
v.Z)({}, r, bg(r, e, null)), i = null == e || null === (t = e.customerInfo) || void 0 === t ? void 0 : t.paymentMethods, o = null;
i && i.length && (o = {
mode: "customer",
id: i[0].id,
active: !0,
paymentMethod: i[0]
});
try {
n = gs("FORCE_LINK_IN_PE_PASSTHROUGH")
} catch (e) {
n = !1
}
return {
initialized: !1,
parentVisible: !1,
isCollapsed: !1,
linkOptInConsentShown: !1,
touched: !1,
options: {
businessName: null,
paymentMethodOrder: null,
allowedCardBrands: null,
disallowedCardBrands: null,
fields: null,
readOnly: !1,
terms: null,
wallets: null,
defaultValues: null,
layout: null,
savePaymentMethod: null,
applePay: null
},
savePaymentMethodDisplay: Wh,
selectedPaymentForm: r,
session: e,
form: a,
selectedSavedPayment: o,
updatingSavedPayment: null,
removingSavedPayment: null,
isConsumerInformationListed: !1,
isSelectingSavedPayment: !1,
isAddingSavedPayment: !1,
postLoginSavedPaymentAction: null,
isLoggingOut: !1,
hasConfirmFailedForSavedPayment: !1,
hasConfirmFailedForView: !1,
shouldListApplePay: !1,
shouldListGooglePay: !1,
shouldListLink: !0,
eceVisibleButtons: [],
heldbackPaymentMethods: [],
blockedCardBrands: [],
isRtl: !1,
achBankSearch: vg,
installments: {
availableInstallments: Hh,
wantsInstallments: !1,
request: null
},
customerSessionSavedPayment: {
selectedSavedPayment: null != e && e.customer ? Ec(e.customer) : null,
isSelectingSavedPayment: !1,
updatingSavedPayment: null,
removingSavedPayment: null
},
timings: {
renderTimestamp: null,
walletLoadTimestamp: null
},
isFetchingWallets: !1,
layout: Yh,
showReturnAutofillPromptErrors: !1,
shouldForceEnableLinkPassthroughMode: n,
linkPrefillDataCollectionTrigger: null,
linkDefaultValuesSource: "merchant",
cardBrandChoice: {
networks: []
},
linkDefaultOptInBehavior: null,
confirmationError: null
}
}, Eg = {
linkMobilePhone: {
isValueDefault: function(e, t) {
var n, r, a;
return t.value === (null === (n = e.options.defaultValues) || void 0 === n || null === (r = n.billingDetails) || void 0 === r ? void 0 : r.phone) || t.value === (null === (a = e.form.card) || void 0 === a ? void 0 : a.values.linkDefaultFormattedMobilePhone)
}
},
linkEmail: {
isValueDefault: function(e, t) {
var n, r;
return t.value === (null === (n = e.options.defaultValues) || void 0 === n || null === (r = n.billingDetails) || void 0 === r ? void 0 : r.email)
}
},
linkMobilePhoneCountry: {
isValueDefault: function(e, t) {
var n;
return "US" === t.value || t.value === (null === (n = e.form.card) || void 0 === n ? void 0 : n.values.linkDefaultFormattedMobilePhoneCountry)
}
}
}, Zg = function(e, t) {
var n;
return (0,
b.Z)((0,
b.Z)({}, e), {}, {
form: (0,
b.Z)((0,
b.Z)({}, e.form), {}, (0,
v.Z)({}, t.paymentMethod, (0,
b.Z)((0,
b.Z)({}, e.form[t.paymentMethod]), {}, {
values: (0,
b.Z)((0,
b.Z)({}, null === (n = e.form[t.paymentMethod]) || void 0 === n ? void 0 : n.values), {}, {
linkLegalName: ""
})
})))
})
}, Ag = function(e, t) {
var n, r, a, i, o, s, u, l = e.form, c = null !== (n = null === (r = l.card) || void 0 === r ? void 0 : r.values) && void 0 !== n ? n : {}, d = c.linkOptIn, p = c.linkAutofillPromptOptIn, m = c.linkOptInIsVisibleFromFormChange;
if ("" === t.value || !(d || p || m) || null !== (a = Eg[t.name]) && void 0 !== a && a.isValueDefault(e, t))
return e;
var f = null !== (i = null === (o = e.form[t.paymentMethod]) || void 0 === o || null === (s = o.values) || void 0 === s ? void 0 : s.linkOptInTouched) && void 0 !== i ? i : {};
return (0,
b.Z)((0,
b.Z)({}, e), {}, {
form: (0,
b.Z)((0,
b.Z)({}, l), {}, (0,
v.Z)({}, t.paymentMethod, (0,
b.Z)((0,
b.Z)({}, l[t.paymentMethod]), {}, {
values: (0,
b.Z)((0,
b.Z)({}, (null === (u = l[t.paymentMethod]) || void 0 === u ? void 0 : u.values) || {}), {}, {
linkOptInTouched: (0,
b.Z)((0,
b.Z)({}, f), {}, (0,
v.Z)({}, t.name, !0))
})
})))
})
}, Mg = function(e, t) {
var n, r, a, i, o = e.form, s = ["postalCode", "administrativeArea"];
return (0,
b.Z)((0,
b.Z)({}, e), {}, {
form: (0,
b.Z)((0,
b.Z)({}, o), {}, (0,
v.Z)({}, t.paymentMethod, (0,
b.Z)((0,
b.Z)({}, o[t.paymentMethod]), {}, {
displayErrors: (0,
b.Z)((0,
b.Z)({}, o[t.paymentMethod].displayErrors), (0,
O.sq)(s.map((function(e) {
return [e, !1]
}
)))),
shouldUpdateLocalValueFromState: (0,
b.Z)((0,
b.Z)({}, o[t.paymentMethod].shouldUpdateLocalValueFromState), (0,
O.sq)(s.map((function(e) {
return [e, !0]
}
)))),
autofilledFields: (0,
b.Z)((0,
b.Z)({}, o[t.paymentMethod].autofilledFields), (0,
O.sq)(s.map((function(e) {
return [e, !1]
}
)))),
pastedFields: (0,
b.Z)((0,
b.Z)({}, o[t.paymentMethod].pastedFields), (0,
O.sq)(s.map((function(e) {
return [e, !1]
}
)))),
values: (0,
b.Z)((0,
b.Z)({}, o[t.paymentMethod].values), {}, {
linkOptIn: !(null === (n = o[t.paymentMethod]) || void 0 === n || null === (r = n.values) || void 0 === r || !r.linkOptInTouched) && (null === (a = o[t.paymentMethod]) || void 0 === a || null === (i = a.values) || void 0 === i ? void 0 : i.linkOptIn)
}, (0,
O.ei)(bg(t.paymentMethod, e.session, e.options).values, s))
})))
})
}, Pg = function(e) {
var t = e.state
, n = e.paymentMethod
, r = e.isUserPerformingSelection
, a = void 0 === r || r
, i = t.form
, o = a || t.touched;
return (0,
b.Z)((0,
b.Z)({}, t), {}, {
touched: o,
isCollapsed: !1,
selectedPaymentForm: n,
form: (0,
b.Z)((0,
b.Z)({}, i), {}, (0,
v.Z)({}, n, (0,
b.Z)((0,
b.Z)({}, bg(n, t.session, t.options)), i[n])))
})
}, xg = function(e) {
var t, n, r, a = e.state, i = e.removedPaymentMethods, o = kc({
orderedPaymentMethodTypesAndWallets: (null === (t = a.session) || void 0 === t ? void 0 : t.orderedPaymentMethodTypesAndWallets) || [],
unverifiedPaymentMethodsOnDomain: (null === (n = a.session) || void 0 === n ? void 0 : n.unverifiedPaymentMethodsOnDomain) || [],
customPaymentMethodOrder: a.options.paymentMethodOrder,
shouldListApplePay: a.shouldListApplePay,
shouldListGooglePay: a.shouldListGooglePay,
shouldListLink: a.shouldListLink,
eceVisibleButtons: a.eceVisibleButtons,
linkSettings: null === (r = a.session) || void 0 === r ? void 0 : r.linkSettings,
heldbackPaymentMethods: a.heldbackPaymentMethods
});
return !a.selectedPaymentForm || -1 !== i.indexOf(a.selectedPaymentForm) ? (0,
b.Z)({}, Pg({
state: a,
paymentMethod: o,
isUserPerformingSelection: !1
})) : a.touched || o === a.selectedPaymentForm ? (0,
b.Z)({}, a) : (0,
b.Z)({}, Pg({
state: a,
paymentMethod: o,
isUserPerformingSelection: !1
}))
}, Ig = function(e, t) {
if (!e)
return null;
switch (e.type) {
case "BANK_ACCOUNT":
return null != t && t.linkSupportedPaymentMethods && -1 !== (null == t ? void 0 : t.linkSupportedPaymentMethods.indexOf("US_BANK_ACCOUNT")) ? "us_bank_account" : "LINK_CARD_BRAND" === (null == t ? void 0 : t.linkMode) ? "link_card_brand" : "link";
case "CARD":
return "card";
case "KLARNA":
case "PAYMENT_DETAILS_TYPE_INVALID":
return null;
default:
return (0,
P.Rz)(e.type)
}
}, Ng = function(e, t) {
if ("consumer" === e.mode) {
var n, r, a, i, o, s, u, l = e.paymentDetails, c = (null === (n = l.card_details) || void 0 === n ? void 0 : n.brand) && function(e) {
switch (e) {
case "VISA":
return "visa";
case "MASTERCARD":
return "mastercard";
case "AMERICAN_EXPRESS":
return "amex";
case "JCB":
return "jcb";
case "DINERS_CLUB":
return "diners";
case "DISCOVER":
return "discover";
case "UNIONPAY":
return "unionpay";
case "ELO":
return "elo";
case "CARTES_BANCAIRES":
return "cartes_bancaires";
case "BRAND_INVALID":
case "RUPAY":
case "EFTPOS_AU":
case "GIROCARD":
case "NYCE":
case "ACCEL":
case "STAR":
case "PULSE":
return null;
default:
return (0,
P.Rz)(e)
}
}(null === (r = l.card_details) || void 0 === r ? void 0 : r.brand);
return {
isCard: !("CARD" !== l.type || !l.card_details),
id: l.id,
country: null === (a = l.billing_address) || void 0 === a ? void 0 : a.country_code,
postalCode: null === (i = l.billing_address) || void 0 === i ? void 0 : i.postal_code,
cvc: null === (o = l.metadata) || void 0 === o ? void 0 : o.cvc,
expMonth: null === (s = l.card_details) || void 0 === s ? void 0 : s.exp_month,
expYear: null === (u = l.card_details) || void 0 === u ? void 0 : u.exp_year,
brand: c,
nickname: l.nickname
}
}
var d, p, m = e.paymentMethod;
return "us_bank_account" === m.type ? {
isCard: !1,
id: m.id,
name: m.billing_details.name,
email: m.billing_details.email
} : "card" === m.type ? {
isCard: !0,
id: m.id,
country: null === (d = m.billing_details.address) || void 0 === d ? void 0 : d.country,
postalCode: null === (p = m.billing_details.address) || void 0 === p ? void 0 : p.postal_code,
expMonth: m.card.exp_month,
expYear: m.card.exp_year,
cvc: t,
brand: m.card.networks.preferred
} : {}
}, wg = function(e) {
var t, n = e.state, r = e.paymentMethodType, a = e.savedPayment, i = r && "card" === r, o = a && "consumer" === a.mode;
return i && o && n.form.card ? (n.form.card.values.country = null === (t = a.paymentDetails.billing_address) || void 0 === t ? void 0 : t.country_code,
n) : n
}, Tg = function(e, t) {
var n, r = t.paymentMethod, a = t.value, i = t.name;
if ("card" !== r && "link" !== r)
return e;
var o = "card" === r ? "link" : "card";
return (0,
b.Z)((0,
b.Z)({}, e), {}, {
form: (0,
b.Z)((0,
b.Z)({}, e.form), {}, (0,
v.Z)({}, o, (0,
b.Z)((0,
b.Z)((0,
b.Z)({}, bg(o, e.session, e.options)), e.form[o]), {}, {
values: (0,
b.Z)((0,
b.Z)({}, null === (n = e.form[o]) || void 0 === n ? void 0 : n.values), {}, (0,
v.Z)({}, i, a))
})))
})
}, Og = function(e) {
return (0,
b.Z)((0,
b.Z)({}, e), {}, {
confirmationError: null
})
}, Rg = function(e) {
var t, n = e.state, r = e.session, a = e.savedPayment, i = e.paymentMethod, o = e.confirmationError, s = Ng(a, null === (t = n.savedPaymentCvcs) || void 0 === t ? void 0 : t[a.id]), u = s.isCard, l = s.id, c = s.country, d = s.postalCode, p = s.expMonth, m = s.expYear, f = s.cvc, h = s.name, _ = s.email, y = s.brand, g = s.nickname;
if (!l)
return n;
var S, k = n.form, C = n.options, E = n.selectedPaymentForm, Z = bg(i, r, C), A = function(e) {
var t = e.paymentState
, n = e.session;
return $h({
paymentState: t,
session: n,
shouldRenderSaveCheckbox: !1
})
}({
session: r,
paymentState: n
});
if (u)
S = (0,
b.Z)((0,
b.Z)({}, Z), {}, {
values: (0,
b.Z)((0,
b.Z)({}, Z.values), {}, {
expiry: "".concat(null == p ? void 0 : p.toString().padStart(2, "0"), " / ").concat(null == m ? void 0 : m.toString().substring(2, 4)),
cvc: f || "",
country: c || "",
postalCode: d || "",
network: y || "unknown",
nickname: g,
shippingAsBilling: !1
})
});
else {
if ("customer_from_session" !== a.mode)
return n;
S = (0,
b.Z)((0,
b.Z)({}, Z), {}, {
values: (0,
b.Z)((0,
b.Z)({}, Z.values), {}, {
name: h,
email: _
})
})
}
var M = (0,
b.Z)((0,
b.Z)((0,
b.Z)({}, n), "customer_from_session" === a.mode ? {
customerSessionSavedPayment: (0,
b.Z)((0,
b.Z)({}, n.customerSessionSavedPayment), {}, {
updatingSavedPayment: {
mode: "customer_from_session",
id: a.id,
paymentMethod: a.paymentMethod,
error: null,
confirmationError: o ? {
error: o,
showValidationErrors: !0
} : void 0,
pending: !1
}
})
} : {
updatingSavedPayment: {
mode: a.mode,
id: l
}
}), {}, {
form: (0,
b.Z)((0,
b.Z)({}, k), {}, (0,
v.Z)({}, i, S)),
savePaymentMethodDisplay: (0,
b.Z)((0,
b.Z)({}, n.savePaymentMethodDisplay), {}, {
shouldRenderSetAsDefaultCheckbox: A
})
});
return "card" !== E && "saved" !== E ? Pg({
state: M,
paymentMethod: i
}) : M
}, Lg = function(e) {
var t, n = e.state, r = e.session, a = n.customerSessionSavedPayment.selectedSavedPayment, i = null === (t = n.customerSessionSavedPayment.selectedSavedPayment) || void 0 === t ? void 0 : t.paymentMethod;
if (r && a && r_(a, r) && "card" === (null == i ? void 0 : i.type) && Fo(function(e, t) {
var n = (e < 10 ? "0" : "") + e.toString()
, r = t.toString().slice(-2);
return "".concat(n, " / ").concat(r)
}(i.card.exp_month, i.card.exp_year))) {
var o = Rg({
state: n,
session: r,
savedPayment: a,
paymentMethod: "saved"
});
return o.form.saved ? (0,
b.Z)((0,
b.Z)({}, o), {}, {
form: (0,
b.Z)((0,
b.Z)({}, o.form), {}, {
saved: (0,
b.Z)((0,
b.Z)({}, o.form.saved), {}, {
displayErrors: (0,
O.Q8)(o.form.saved.displayErrors, (function() {
return !0
}
))
})
})
}) : n
}
return n
}, Dg = function(e) {
var t = e.state
, n = e.requireCVCRecollection
, r = t.selectedPaymentForm
, a = t.customerSessionSavedPayment.isSelectingSavedPayment
, i = !("saved" !== r || !a || !n);
return (0,
b.Z)((0,
b.Z)({}, t), {}, {
customerSessionSavedPayment: (0,
b.Z)((0,
b.Z)({}, t.customerSessionSavedPayment), {}, {
isSelectingSavedPayment: !i && a
})
})
}, Ug = function(e, t) {
var n, r, a;
return vc({
orderedPaymentMethodTypesAndWallets: [].concat((0,
Z.Z)((null === (n = e.session) || void 0 === n ? void 0 : n.orderedPaymentMethodTypesAndWallets) || []), (0,
Z.Z)(t || [])),
unverifiedPaymentMethodsOnDomain: (null === (r = e.session) || void 0 === r ? void 0 : r.unverifiedPaymentMethodsOnDomain) || [],
customPaymentMethodOrder: e.options.paymentMethodOrder,
shouldListApplePay: e.shouldListApplePay,
shouldListGooglePay: e.shouldListGooglePay,
shouldListLink: e.shouldListLink,
eceVisibleButtons: e.eceVisibleButtons,
linkSettings: null === (a = e.session) || void 0 === a ? void 0 : a.linkSettings,
heldbackPaymentMethods: e.heldbackPaymentMethods
}).length > 1
}, jg = function(e) {
return !(!e || "string" == typeof e) && e.defaultCollapsed
}, Bg = function(e, t) {
return function() {
var n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : t || e
, r = arguments.length > 1 ? arguments[1] : void 0
, a = n.form
, i = n.selectedPaymentForm;
switch (r.type) {
case "CONFIG.ASYNC_UPDATE_RECEIVED":
var o, s, u = r.config, l = r.elementsState, c = u.session, d = u.externalPaymentMethodTypes, p = c.orderedPaymentMethodTypesAndWallets, m = n.session || {}, f = m.orderedPaymentMethodTypesAndWallets, h = void 0 === f ? [] : f, _ = [].concat((0,
Z.Z)(p), (0,
Z.Z)(null != d ? d : [])), y = [].concat((0,
Z.Z)(h), (0,
Z.Z)(null != d ? d : []));
y.length === _.length && (0,
O.dq)(y, _).length === _.length && (c.orderedPaymentMethodTypesAndWallets = h);
var S = void 0 === i || -1 === _.indexOf(i)
, k = -1 === y.indexOf("link") && -1 !== _.indexOf("link");
s = S || k ? kc({
orderedPaymentMethodTypesAndWallets: c.orderedPaymentMethodTypesAndWallets,
unverifiedPaymentMethodsOnDomain: (null == c ? void 0 : c.unverifiedPaymentMethodsOnDomain) || [],
customPaymentMethodOrder: n.options.paymentMethodOrder,
shouldListApplePay: n.shouldListApplePay,
shouldListGooglePay: n.shouldListGooglePay,
shouldListLink: n.shouldListLink,
eceVisibleButtons: n.eceVisibleButtons,
linkSettings: null == c ? void 0 : c.linkSettings,
heldbackPaymentMethods: n.heldbackPaymentMethods
}) : i;
var C = kg({
session: c,
selectedPaymentForm: s,
options: n.options,
savedPaymentMethodAction: r.savedPaymentMethod,
customerSessionSavedPaymentFromState: n.customerSessionSavedPayment,
previousCustomer: null === (o = r.prevSession) || void 0 === o ? void 0 : o.customer,
elementsState: l
});
return Lg({
state: (0,
b.Z)((0,
b.Z)((0,
b.Z)({}, n), C), {}, {
form: (0,
b.Z)((0,
b.Z)({}, C.form), n.form)
}),
session: c
});
case "PAYMENT.INIT":
var E, A = tg(r.options.allowedCardBrands, r.options.disallowedCardBrands), M = gc(Yh, r.options.layout), P = t_((0,
b.Z)((0,
b.Z)({}, r.elementsState), {}, {
paymentElement: (0,
b.Z)((0,
b.Z)({}, r.elementsState.paymentElement), {}, {
options: (0,
b.Z)({}, r.options)
})
})), I = Ug(n, r.externalPaymentMethodTypes), N = jg(r.options.layout), w = !1;
N && (w = n.shouldListApplePay || n.shouldListGooglePay || !n.isFetchingWallets ? !(!I && "accordion" !== M.type || !N) : N);
var T, R = r.holdbackDefaultValuesBillingDetails ? (0,
b.Z)((0,
b.Z)({}, r.options), {}, {
defaultValues: null !== (E = r.options) && void 0 !== E && E.defaultValues ? (0,
b.Z)((0,
b.Z)({}, r.options.defaultValues), {}, {
billingDetails: void 0
}) : null
}) : r.options;
if (r.options.paymentMethodOrder || n.initialized) {
var L, D, U, j = n.initialized && n.selectedPaymentForm ? n.selectedPaymentForm : kc({
orderedPaymentMethodTypesAndWallets: (null === (L = n.session) || void 0 === L ? void 0 : L.orderedPaymentMethodTypesAndWallets) || [],
unverifiedPaymentMethodsOnDomain: (null === (D = n.session) || void 0 === D ? void 0 : D.unverifiedPaymentMethodsOnDomain) || [],
customPaymentMethodOrder: r.options.paymentMethodOrder,
shouldListApplePay: n.shouldListApplePay,
shouldListGooglePay: n.shouldListGooglePay,
shouldListLink: n.shouldListLink,
eceVisibleButtons: n.eceVisibleButtons,
linkSettings: null === (U = n.session) || void 0 === U ? void 0 : U.linkSettings,
heldbackPaymentMethods: n.heldbackPaymentMethods
}), B = (0,
v.Z)({}, j, bg(j, n.session, r.options));
T = (0,
b.Z)((0,
b.Z)({}, n), {}, {
form: B,
selectedPaymentForm: j,
initialized: !0,
options: R,
isRtl: r.isRtl,
blockedCardBrands: A,
layout: M,
savePaymentMethodDisplay: P,
isCollapsed: w,
touched: !1
})
} else
T = (0,
b.Z)((0,
b.Z)({}, n), {}, {
initialized: !0,
options: R,
isRtl: r.isRtl,
blockedCardBrands: A,
layout: M,
savePaymentMethodDisplay: P,
isCollapsed: w,
touched: !1
});
return Lg({
state: T,
session: r.elementsState.config.session
});
case "PAYMENT.FIELD_CHANGED":
var F, G, q, K, V, z, H, Y, W, J, X, Q, $, ee = null === (F = n.form[r.paymentMethod]) || void 0 === F || null === (G = F.values) || void 0 === G ? void 0 : G[r.name], te = !(0,
O.Xy)(r.value, ee), ne = n.confirmationError && ("number" === r.name || r.name === (null === (q = n.confirmationError) || void 0 === q ? void 0 : q.field)) && te, re = "shippingAsBilling" === r.name && r.value, ae = (0,
b.Z)((0,
b.Z)({}, n), {}, {
touched: n.touched || te && r.touched,
form: (0,
b.Z)((0,
b.Z)({}, a), {}, (0,
v.Z)({}, r.paymentMethod, (0,
b.Z)((0,
b.Z)({}, a[r.paymentMethod]), {}, {
values: (0,
b.Z)((0,
b.Z)({}, null === (K = a[r.paymentMethod]) || void 0 === K ? void 0 : K.values), {}, (0,
v.Z)({}, r.name, r.value)),
displayErrors: (0,
b.Z)((0,
b.Z)({}, null === (V = a[r.paymentMethod]) || void 0 === V ? void 0 : V.displayErrors), {}, (0,
v.Z)({}, r.name, !!r.displayErrors)),
shouldUpdateLocalValueFromState: (0,
b.Z)((0,
b.Z)({}, null === (z = a[r.paymentMethod]) || void 0 === z ? void 0 : z.shouldUpdateLocalValueFromState), {}, (0,
v.Z)({}, r.name, !r.oneWay)),
touched: (null === (H = a[r.paymentMethod]) || void 0 === H ? void 0 : H.touched) || te && r.touched
})))
});
if (te && "card" === r.paymentMethod && r.touched && "" !== r.value) {
var ie, oe, se, ue, le, ce = "linkAutofillPromptOptIn" !== r.name && !(null === (ie = ae.form[r.paymentMethod]) || void 0 === ie || null === (oe = ie.values) || void 0 === oe || !oe.linkOptIn), de = "linkAutofillPromptOptIn" !== r.name && !(null !== (se = ae.form[r.paymentMethod]) && void 0 !== se && null !== (ue = se.values) && void 0 !== ue && ue.linkAutofillPromptOptIn);
ae = (0,
b.Z)((0,
b.Z)({}, ae), {}, {
form: (0,
b.Z)((0,
b.Z)({}, ae.form), {}, (0,
v.Z)({}, r.paymentMethod, (0,
b.Z)((0,
b.Z)({}, ae.form[r.paymentMethod]), {}, {
values: (0,
b.Z)((0,
b.Z)({}, (null === (le = ae.form[r.paymentMethod]) || void 0 === le ? void 0 : le.values) || {}), {}, {
linkOptIn: ce,
linkOptInIsVisibleFromFormChange: de
})
})))
})
}
return "country" === r.name && (null === (Y = n.form[r.paymentMethod]) || void 0 === Y || null === (W = Y.values) || void 0 === W ? void 0 : W.country) !== r.value && (ae = Mg(ae, r)),
"shippingAsBilling" !== r.name || !1 !== r.value || null !== (J = n.form[r.paymentMethod]) && void 0 !== J && null !== (X = J.values) && void 0 !== X && X.linkOptInTouched || null !== (Q = n.options.defaultValues) && void 0 !== Q && null !== ($ = Q.billingDetails) && void 0 !== $ && $.name || (ae = Zg(ae, r)),
Eg[r.name] && te && (ae = Ag(ae, r)),
"linkEmail" === r.name && (ae = Tg(ae, r)),
(ne || re) && (ae = Og(ae)),
ae;
case "PAYMENT.FIELD_FOCUSED":
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
touched: !0,
form: i ? (0,
b.Z)((0,
b.Z)({}, a), {}, (0,
v.Z)({}, i, (0,
b.Z)((0,
b.Z)({}, a[i]), {}, {
focusedField: r.name
}))) : a
});
case "PAYMENT.FIELD_BLURRED":
if (void 0 === i)
return n;
var pe = (0,
b.Z)((0,
b.Z)({}, n), {}, {
form: (0,
b.Z)((0,
b.Z)({}, a), {}, (0,
v.Z)({}, i, (0,
b.Z)((0,
b.Z)({}, a[i]), {}, {
displayErrors: (0,
b.Z)((0,
b.Z)({}, a[i].displayErrors), {}, (0,
v.Z)({}, r.name, !!a[i].values[r.name] || a[i].displayErrors[r.name])),
focusedField: null
})))
})
, me = n.customerSessionSavedPayment.updatingSavedPayment;
null != me && me.confirmationError && (pe.customerSessionSavedPayment.updatingSavedPayment = (0,
b.Z)((0,
b.Z)({}, me), {}, {
confirmationError: (0,
b.Z)((0,
b.Z)({}, me.confirmationError), {}, {
showValidationErrors: !1
})
}));
var fe = pe.customerSessionSavedPayment.cvcConfirmationError;
return fe && fe.showValidationErrors && (pe.customerSessionSavedPayment.cvcConfirmationError = (0,
b.Z)((0,
b.Z)({}, fe), {}, {
showValidationErrors: !1
})),
pe;
case "PAYMENT.FIELD_AUTOFILL_USED":
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
form: i ? (0,
b.Z)((0,
b.Z)({}, a), {}, (0,
v.Z)({}, i, (0,
b.Z)((0,
b.Z)({}, a[i]), {}, {
autofilledFields: (0,
b.Z)((0,
b.Z)({}, a[i].autofilledFields), {}, (0,
v.Z)({}, r.name, r.value))
}))) : a
});
case "PAYMENT.FIELD_PASTED":
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
touched: !0,
form: i ? (0,
b.Z)((0,
b.Z)({}, a), {}, (0,
v.Z)({}, i, (0,
b.Z)((0,
b.Z)({}, a[i]), {}, {
pastedFields: (0,
b.Z)((0,
b.Z)({}, a[i].pastedFields), {}, (0,
v.Z)({}, r.name, !0))
}))) : a
});
case "PAYMENT.FIELD_DISPLAY_ERRORS":
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
touched: !0,
form: i ? (0,
b.Z)((0,
b.Z)({}, a), {}, (0,
v.Z)({}, i, (0,
b.Z)((0,
b.Z)({}, a[i]), {}, {
displayErrors: (0,
b.Z)((0,
b.Z)({}, a[i].displayErrors), {}, (0,
v.Z)({}, r.name, !0))
}))) : a
});
case "PAYMENT.FILL_DEFAULT_VALUES":
if (n.touched)
return n;
var he = (0,
b.Z)((0,
b.Z)({}, n), {}, {
linkDefaultOptInBehavior: r.linkDefaultOptInBehavior,
form: (0,
b.Z)((0,
b.Z)({}, a), (0,
O.Q8)(r.value, (function(e, t) {
var i, o, s, u = t, l = Object.entries(r.value[u] || {}).filter((function(e) {
var t = (0,
g.Z)(e, 2)
, n = t[0]
, r = t[1];
return "setAsDefaultSavedPayment" === n || "savePayment" === n ? "boolean" == typeof r : !!r
}
)).map((function(e) {
var t = (0,
g.Z)(e, 2)
, n = t[0];
t[1];
return n
}
)), c = bg(u, n.session, n.options), d = c.values;
return (0,
b.Z)((0,
b.Z)({}, a[u]), {}, {
values: (0,
b.Z)((0,
b.Z)((0,
b.Z)((0,
b.Z)((0,
b.Z)({}, d), null === (i = a[u]) || void 0 === i ? void 0 : i.values), (0,
O.ei)(r.value[u], l)), r.linkDefaultOptInBehavior ? {} : (0,
O.ei)(d, ["linkOptIn"])), (0,
O.ei)(d, ["linkOptInDefaultsNonUS"])),
displayErrors: (0,
b.Z)((0,
b.Z)((0,
b.Z)({}, c.displayErrors), null === (o = a[u]) || void 0 === o ? void 0 : o.displayErrors), (0,
O.sq)(l.map((function(e) {
return [e, !0]
}
)))),
shouldUpdateLocalValueFromState: (0,
b.Z)((0,
b.Z)({}, null === (s = a[u]) || void 0 === s ? void 0 : s.shouldUpdateLocalValueFromState), (0,
O.sq)(l.map((function(e) {
return [e, !0]
}
)))),
pastedFields: (0,
b.Z)({}, c.pastedFields),
autofilledFields: (0,
b.Z)({}, c.autofilledFields)
})
}
)))
});
return he;
case "PAYMENT.PAYMENT_METHOD_SELECTED":
return Pg({
state: n,
paymentMethod: r.paymentMethod
});
case "PAYMENT.CONTROLLER_USER_CLEARED":
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
form: i ? (0,
v.Z)({}, i, bg(i, n.session, n.options)) : {}
});
case "PAYMENT.CONTROLLER_USER_COLLAPSED":
var _e = Ug(n, r.externalPaymentMethodTypes);
return _e || "accordion" === n.layout.type ? (0,
b.Z)((0,
b.Z)({}, n), {}, {
isCollapsed: !0
}) : n;
case "ELEMENTS.DISPLAY_ERRORS":
var ye = r.elementsToDisplayErrors && -1 === r.elementsToDisplayErrors.indexOf("payment");
if (!n.initialized || ye)
return n;
var ve = Dg({
state: n,
requireCVCRecollection: r.requireCVCRecollection
})
, ge = Lg({
state: ve,
session: r.session
});
return (0,
b.Z)((0,
b.Z)({}, ge), {}, {
showReturnAutofillPromptErrors: !0,
form: i && !r.onlyShowReturnAutofillPromptErrors ? (0,
b.Z)((0,
b.Z)({}, a), {}, (0,
v.Z)({}, i, (0,
b.Z)((0,
b.Z)({}, a[i]), {}, {
displayErrors: (0,
O.Q8)(a[i].displayErrors, (function() {
return !0
}
))
}))) : a
});
case "PAYMENT.PUBLIC_OPTIONS_RECEIVED":
var be, Se, ke = gc(n.layout, r.options.layout), Ce = bc(n.options.applePay, r.options.applePay), Ee = null !== (be = r.options) && void 0 !== be && be.defaultValues ? {
linkDefaultValuesSource: "merchantUpdate"
} : {}, Ze = r.holdbackDefaultValuesBillingDetails ? (0,
b.Z)((0,
b.Z)((0,
b.Z)({}, n.options), r.options), {}, {
applePay: Ce,
defaultValues: null !== (Se = r.options) && void 0 !== Se && Se.defaultValues ? (0,
b.Z)((0,
b.Z)({}, r.options.defaultValues), {}, {
billingDetails: void 0
}) : null
}) : (0,
b.Z)((0,
b.Z)((0,
b.Z)({}, n.options), r.options), {}, {
applePay: Ce
});
return (0,
b.Z)((0,
b.Z)((0,
b.Z)({}, n), Ee), {}, {
options: Ze,
layout: ke
});
case "PAYMENT.LIST_CONSUMER_PAYMENT_DETAILS":
var Ae, Me, Pe = r.isAddingSavedPayment, xe = r.supportedPaymentMethodTypes, Ie = r.isSelectingSavedPayment, Ne = Pt(r.paymentDetails, xe), we = null === (Ae = r.paymentDetails.filter((function(e) {
var t;
return e.id === (null === (t = n.selectedSavedPayment) || void 0 === t ? void 0 : t.id)
}
))) || void 0 === Ae ? void 0 : Ae[0];
return Ne && !we ? (0,
b.Z)((0,
b.Z)({}, n), {}, {
isAddingSavedPayment: Pe,
isSelectingSavedPayment: Ie,
postLoginSavedPaymentAction: null,
selectedSavedPayment: {
mode: "consumer",
id: Ne,
active: !0
},
isConsumerInformationListed: !0
}) : "consumer" !== (null === (Me = n.selectedSavedPayment) || void 0 === Me ? void 0 : Me.mode) || we ? (0,
b.Z)((0,
b.Z)({}, n), {}, {
isConsumerInformationListed: !0
}) : (0,
b.Z)((0,
b.Z)({}, n), {}, {
selectedSavedPayment: null,
isConsumerInformationListed: !0
});
case "PAYMENT.UPDATE_WITH_SAVED_PAYMENT":
var Te = r.savedPayment;
if (Te) {
var Oe, Re = "consumer" === Te.mode ? Ig(Te.paymentDetails, null === (Oe = n.session) || void 0 === Oe ? void 0 : Oe.linkSettings) : Te.paymentMethod.type, Le = wg({
state: n,
paymentMethodType: Re,
savedPayment: Te
});
return Re && Re !== i ? Pg({
state: Le,
paymentMethod: Re
}) : Le
}
return n;
case "PAYMENT.HIDE_LINK":
var De = (0,
b.Z)((0,
b.Z)({}, n), {}, {
shouldListLink: !1
});
if ("link" === De.selectedPaymentForm) {
var Ue, je, Be, Fe = kc({
orderedPaymentMethodTypesAndWallets: (null === (Ue = De.session) || void 0 === Ue ? void 0 : Ue.orderedPaymentMethodTypesAndWallets) || [],
unverifiedPaymentMethodsOnDomain: (null === (je = De.session) || void 0 === je ? void 0 : je.unverifiedPaymentMethodsOnDomain) || [],
customPaymentMethodOrder: De.options.paymentMethodOrder,
shouldListApplePay: De.shouldListApplePay,
shouldListGooglePay: De.shouldListGooglePay,
shouldListLink: De.shouldListLink,
eceVisibleButtons: De.eceVisibleButtons,
linkSettings: null === (Be = De.session) || void 0 === Be ? void 0 : Be.linkSettings,
heldbackPaymentMethods: De.heldbackPaymentMethods
});
return (0,
b.Z)({}, Pg({
state: De,
paymentMethod: Fe,
isUserPerformingSelection: !1
}))
}
return De;
case "PAYMENT.SAVED_PAYMENT_SELECTED":
var Ge = r.savedPayment
, qe = r.shouldShowList
, Ke = "consumer" === (null == Ge ? void 0 : Ge.mode) ? "selected-saved-payment" : n.linkPrefillDataCollectionTrigger
, Ve = null;
Ge && ("consumer" === Ge.mode ? Ve = {
mode: "consumer",
id: Ge.paymentDetails.id,
active: !0
} : "customer" === Ge.mode && (Ve = {
mode: Ge.mode,
id: Ge.paymentMethod.id,
active: !0,
paymentMethod: Ge.paymentMethod
}));
var ze = (0,
b.Z)((0,
b.Z)({}, n), {}, {
selectedSavedPayment: Ve,
updatingSavedPayment: null,
removingSavedPayment: null,
isSelectingSavedPayment: qe,
isAddingSavedPayment: !1,
isLoggingOut: !1,
hasConfirmFailedForSavedPayment: !1,
hasConfirmFailedForView: !1,
linkPrefillDataCollectionTrigger: Ke,
form: (0,
b.Z)((0,
b.Z)({}, n.form), n.form.card ? {
card: bg("card", n.session, n.options)
} : null)
});
if (Ge) {
var He, Ye;
if ("consumer" === Ge.mode)
He = Ig(Ge.paymentDetails, null === (Ye = n.session) || void 0 === Ye ? void 0 : Ye.linkSettings);
else
"customer" === Ge.mode && (He = Ge.paymentMethod.type);
var We = wg({
state: ze,
paymentMethodType: He,
savedPayment: Ge
});
return He && He !== i ? Pg({
state: We,
paymentMethod: He
}) : We
}
return ze;
case "PAYMENT.SET_UPDATING_SAVED_PAYMENT":
var Je, Xe = r.savedPayment, Qe = r.session, $e = "consumer" === ((null == Xe ? void 0 : Xe.mode) || (null === (Je = n.updatingSavedPayment) || void 0 === Je ? void 0 : Je.mode)) ? "card" : "saved";
if (Xe)
return "customer" === Xe.mode ? n : Rg({
state: n,
session: Qe,
savedPayment: Xe,
paymentMethod: $e
});
var et = !!n.form[$e];
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
updatingSavedPayment: null,
form: (0,
b.Z)((0,
b.Z)({}, n.form), et ? (0,
v.Z)({}, $e, bg($e, n.session, n.options)) : null),
hasConfirmFailedForView: !1
});
case "PAYMENT.SET_REMOVING_SAVED_PAYMENT_ID":
var tt = r.mode
, nt = r.id;
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
removingSavedPayment: nt ? {
mode: tt,
id: nt
} : null,
hasConfirmFailedForView: !1
});
case "PAYMENT.DETACH_SAVED_PAYMENT_METHOD.ERROR":
var rt = r.error;
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
customerSessionSavedPayment: (0,
b.Z)((0,
b.Z)({}, n.customerSessionSavedPayment), {}, {
removingSavedPayment: (0,
b.Z)((0,
b.Z)({}, n.customerSessionSavedPayment.removingSavedPayment), {}, {
error: rt,
pending: !1
})
})
});
case "PAYMENT.DETACH_SAVED_PAYMENT_METHOD.PENDING":
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
customerSessionSavedPayment: (0,
b.Z)((0,
b.Z)({}, n.customerSessionSavedPayment), {}, {
removingSavedPayment: (0,
b.Z)((0,
b.Z)({}, n.customerSessionSavedPayment.removingSavedPayment), {}, {
pending: !0
})
})
});
case "PAYMENT.UPDATE_SAVED_PAYMENT_METHOD.ERROR":
var at = r.error;
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
customerSessionSavedPayment: (0,
b.Z)((0,
b.Z)({}, n.customerSessionSavedPayment), {}, {
updatingSavedPayment: (0,
b.Z)((0,
b.Z)({}, n.customerSessionSavedPayment.updatingSavedPayment), {}, {
error: at,
pending: !1
})
})
});
case "PAYMENT.UPDATE_SAVED_PAYMENT_METHOD.PENDING":
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
customerSessionSavedPayment: (0,
b.Z)((0,
b.Z)({}, n.customerSessionSavedPayment), {}, {
updatingSavedPayment: (0,
b.Z)((0,
b.Z)({}, n.customerSessionSavedPayment.updatingSavedPayment), {}, {
pending: !0
})
})
});
case "PAYMENT.UPDATE_SAVED_PAYMENT_METHOD.SUCCESS":
var it = r.cvc
, ot = r.selectedSavedPayment
, st = n.savedPaymentCvcs
, ut = (0,
b.Z)((0,
b.Z)({}, st), {}, (0,
v.Z)({}, ot.id, it || ""));
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
savedPaymentCvcs: ut,
customerSessionSavedPayment: (0,
b.Z)((0,
b.Z)({}, n.customerSessionSavedPayment), {}, {
updatingSavedPayment: null,
selectedSavedPayment: ot
}),
form: (0,
b.Z)((0,
b.Z)({}, n.form), {}, {
saved: Sg({
paymentMethod: "saved",
session: n.session,
options: n.options,
savedPaymentCvcs: ut,
savedPaymentId: ot.id
})
})
});
case "ADDRESS.UPDATE_BILLING_DETAILS.SUCCESS":
var lt;
return (null === (lt = n.customerSessionSavedPayment.selectedSavedPayment) || void 0 === lt ? void 0 : lt.id) !== r.id ? n : (0,
b.Z)((0,
b.Z)({}, n), {}, {
customerSessionSavedPayment: (0,
b.Z)((0,
b.Z)({}, n.customerSessionSavedPayment), {}, {
selectedSavedPayment: (0,
b.Z)((0,
b.Z)({}, n.customerSessionSavedPayment.selectedSavedPayment), {}, {
paymentMethod: (0,
b.Z)((0,
b.Z)({}, n.customerSessionSavedPayment.selectedSavedPayment.paymentMethod), {}, {
billing_details: r.billingDetails
})
})
})
});
case "PAYMENT.SET_IS_SELECTING_SAVED_PAYMENT":
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
isSelectingSavedPayment: !0
});
case "CONSUMER.RETURN_USER_AUTOFILL_CLICKED":
var ct = r.isAddingSavedPayment;
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
isAddingSavedPayment: ct
});
case "CONSUMER.CONFIRM_VERIFICATION.SUCCESS":
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
linkPrefillDataCollectionTrigger: "completed-verification"
});
case "CONSUMER.SIGN_UP.SUCCESS":
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
linkPrefillDataCollectionTrigger: "completed-signup"
});
case "CONSUMER.NO_CODE_DEFAULT_VALUE_FOUND":
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
linkDefaultValuesSource: "noCodeDefaultValues",
options: (0,
b.Z)((0,
b.Z)({}, n.options), {}, {
defaultValues: (0,
b.Z)((0,
b.Z)({}, n.options.defaultValues), {}, {
billingDetails: {
email: r.email
}
})
})
});
case "PAYMENT.SET_IS_ADDING_SAVED_PAYMENT":
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
isAddingSavedPayment: !0
});
case "PAYMENT.SET_POST_LOGIN_SAVED_PAYMENT_ACTION":
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
postLoginSavedPaymentAction: r.action
});
case "PAYMENT.SET_IS_LOGGING_OUT":
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
isLoggingOut: r.isLoggingOut,
hasConfirmFailedForView: !1
});
case "PAYMENT.OPT_IN_CONSENT.SHOWN":
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
linkOptInConsentShown: !0
});
case "ADDRESS.FIELD_CHANGED":
var dt, pt, mt, ft, ht, _t, yt, vt, gt, bt, St, kt, Ct, Et, Zt, At;
if (void 0 === i || "country" !== r.name && "phone" !== r.name && "phoneCountry" !== r.name && "name" !== r.name)
return n;
var Mt = null === (dt = n.form[i]) || void 0 === dt ? void 0 : dt.values.shippingAsBilling;
if (!Mt || "country" === r.name && "US" === r.value)
return n;
var xt = null === (pt = n.form[i]) || void 0 === pt ? void 0 : pt.values.linkMobilePhone
, It = null === (mt = n.form[i]) || void 0 === mt ? void 0 : mt.values.linkMobilePhoneCountry;
null !== (ft = a[i]) && void 0 !== ft && null !== (ht = ft.values) && void 0 !== ht && ht.linkOptInTouched || null !== (_t = n.options.defaultValues) && void 0 !== _t && null !== (yt = _t.billingDetails) && void 0 !== yt && yt.phone || ("phone" === r.name ? xt = r.value : ("phoneCountry" === r.name || "country" === r.name && r.shouldUpdatePhoneCountry) && (It = r.value));
var Nt = null === (vt = a[i]) || void 0 === vt || null === (gt = vt.values) || void 0 === gt ? void 0 : gt.linkLegalName;
"name" !== r.name || null !== (bt = a[i]) && void 0 !== bt && null !== (St = bt.values) && void 0 !== St && St.linkOptInTouched || null !== (kt = n.options.defaultValues) && void 0 !== kt && null !== (Ct = kt.billingDetails) && void 0 !== Ct && Ct.name || (Nt = r.value);
var wt, Tt, Ot, Rt, Lt = null === (Et = a[i]) || void 0 === Et || null === (Zt = Et.values) || void 0 === Zt ? void 0 : Zt.linkOptIn;
if ("country" === r.name || "phoneCountry" === r.name)
Lt = !(null === (wt = a[i]) || void 0 === wt || null === (Tt = wt.values) || void 0 === Tt || !Tt.linkOptInTouched) && (null === (Ot = a[i]) || void 0 === Ot || null === (Rt = Ot.values) || void 0 === Rt ? void 0 : Rt.linkOptIn);
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
form: (0,
b.Z)((0,
b.Z)({}, a), {}, (0,
v.Z)({}, i, (0,
b.Z)((0,
b.Z)({}, a[i]), {}, {
values: (0,
b.Z)((0,
b.Z)({}, (null === (At = a[i]) || void 0 === At ? void 0 : At.values) || {}), {}, {
linkMobilePhone: xt,
linkMobilePhoneCountry: It,
linkLegalName: Nt,
linkOptIn: Lt
})
})))
});
case "ADDRESS.SAVED_ADDRESS_SELECTED":
var Dt, Ut, jt, Bt, Ft, Gt, qt, Kt, Vt, zt, Ht, Yt, Wt, Jt, Xt;
if (void 0 === i)
return n;
var Qt = null === (Dt = n.form[i]) || void 0 === Dt ? void 0 : Dt.values.shippingAsBilling;
if (!Qt || null !== (Ut = a[i]) && void 0 !== Ut && null !== (jt = Ut.values) && void 0 !== jt && jt.linkOptInTouched)
return n;
var $t, en, tn = null === (Bt = a[i]) || void 0 === Bt || null === (Ft = Bt.values) || void 0 === Ft ? void 0 : Ft.linkLegalName;
if (null === (Gt = n.options.defaultValues) || void 0 === Gt || null === (qt = Gt.billingDetails) || void 0 === qt || !qt.name)
tn = null === ($t = r.savedAddress) || void 0 === $t || null === (en = $t.address) || void 0 === en ? void 0 : en.name;
var nn, rn, an, on, sn = null === (Kt = a[i]) || void 0 === Kt || null === (Vt = Kt.values) || void 0 === Vt ? void 0 : Vt.country, un = null === (zt = a[i]) || void 0 === zt || null === (Ht = zt.values) || void 0 === Ht ? void 0 : Ht.linkMobilePhoneCountry;
if (null === (Yt = n.options.defaultValues) || void 0 === Yt || null === (Wt = Yt.billingDetails) || void 0 === Wt || null === (Jt = Wt.address) || void 0 === Jt || !Jt.country)
sn = null === (nn = r.savedAddress) || void 0 === nn || null === (rn = nn.address) || void 0 === rn ? void 0 : rn.country_code,
un = null === (an = r.savedAddress) || void 0 === an || null === (on = an.address) || void 0 === on ? void 0 : on.country_code;
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
form: (0,
b.Z)((0,
b.Z)({}, a), {}, (0,
v.Z)({}, i, (0,
b.Z)((0,
b.Z)({}, a[i]), {}, {
values: (0,
b.Z)((0,
b.Z)({}, (null === (Xt = a[i]) || void 0 === Xt ? void 0 : Xt.values) || {}), {}, {
linkLegalName: tn,
country: sn,
phoneCountry: un
})
})))
});
case "CONSUMER.TOUCHED_LINK_OPT_IN":
var ln, cn, dn, pn;
if (void 0 === i)
return n;
var mn = null !== (ln = null === (cn = n.form[i]) || void 0 === cn || null === (dn = cn.values) || void 0 === dn ? void 0 : dn.linkOptInTouched) && void 0 !== ln ? ln : {};
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
form: (0,
b.Z)((0,
b.Z)({}, a), {}, (0,
v.Z)({}, i, (0,
b.Z)((0,
b.Z)({}, a[i]), {}, {
values: (0,
b.Z)((0,
b.Z)({}, (null === (pn = a[i]) || void 0 === pn ? void 0 : pn.values) || {}), {}, {
linkOptInTouched: (0,
b.Z)((0,
b.Z)({}, mn), {}, {
linkOptIn: r.linkOptIn
})
})
})))
});
case "CONSUMER.RESET_SESSION":
var fn, hn, _n, yn, vn, gn;
if (void 0 === i)
return n;
var bn = (0,
b.Z)((0,
b.Z)({}, (null === (fn = a[i]) || void 0 === fn ? void 0 : fn.values) || {}), "card" === i && {
linkEmailOtpVerificationPhone: "",
linkOptIn: Tp("card", n.session).linkOptIn ? null === (hn = a[i]) || void 0 === hn ? void 0 : hn.values.linkOptIn : (null === (_n = a[i]) || void 0 === _n ? void 0 : _n.values.linkOptIn) && (!(null === (yn = a[i]) || void 0 === yn || !yn.values.linkMobilePhone) || void 0 === (null === (vn = a[i]) || void 0 === vn || null === (gn = vn.values.linkOptInTouched) || void 0 === gn ? void 0 : gn.linkOptIn))
});
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
form: (0,
b.Z)((0,
b.Z)({}, a), {}, (0,
v.Z)({}, i, (0,
b.Z)((0,
b.Z)({}, a[i]), {}, {
values: bn
})))
});
case "CONSUMER.CREATE_PAYMENT_DETAILS.SUCCESS":
var Sn = r.paymentDetails
, kn = {
mode: "consumer",
id: Sn.id,
active: "CARD" !== Sn.type
};
switch (Sn.type) {
case "BANK_ACCOUNT":
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
selectedSavedPayment: kn,
isSelectingSavedPayment: !1,
isAddingSavedPayment: !1
});
case "CARD":
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
selectedSavedPayment: kn
});
default:
return n
}
case "CONSUMER.REMOVE_PAYMENT_DETAILS.SUCCESS":
var Cn, En = r.id, Zn = r.remainingPaymentDetails, An = r.supportedPaymentMethodTypes;
if ((null === (Cn = n.selectedSavedPayment) || void 0 === Cn ? void 0 : Cn.id) === En) {
var Mn = Pt(Zn, An);
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
removingSavedPayment: null,
selectedSavedPayment: Mn ? {
mode: "consumer",
id: Mn,
active: !0
} : e.selectedSavedPayment
})
}
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
removingSavedPayment: null
});
case "CONSUMER.UPDATE_PAYMENT_DETAILS.SUCCESS":
var Pn = r.paymentDetails
, xn = r.shouldShowList;
return xn ? (0,
b.Z)((0,
b.Z)({}, n), {}, {
updatingSavedPayment: null,
selectedSavedPayment: {
mode: "consumer",
id: Pn.id,
active: !0
},
form: (0,
b.Z)((0,
b.Z)({}, n.form), n.form.card ? {
card: bg("card", n.session, n.options)
} : null)
}) : n;
case "CONSUMER.LOGOUT.SUCCESS":
var In, Nn, wn, Tn, On, Rn, Ln = !!n.updatingSavedPayment, Dn = vc({
orderedPaymentMethodTypesAndWallets: (null === (In = n.session) || void 0 === In ? void 0 : In.orderedPaymentMethodTypesAndWallets) || [],
unverifiedPaymentMethodsOnDomain: (null === (Nn = n.session) || void 0 === Nn ? void 0 : Nn.unverifiedPaymentMethodsOnDomain) || [],
customPaymentMethodOrder: n.options.paymentMethodOrder,
shouldListApplePay: n.shouldListApplePay,
shouldListGooglePay: n.shouldListGooglePay,
shouldListLink: n.shouldListLink,
eceVisibleButtons: n.eceVisibleButtons,
linkSettings: null === (wn = n.session) || void 0 === wn ? void 0 : wn.linkSettings,
heldbackPaymentMethods: n.heldbackPaymentMethods
})[0], Un = null === (Tn = n.session) || void 0 === Tn || null === (On = Tn.customerInfo) || void 0 === On ? void 0 : On.paymentMethods, jn = null;
Un && Un.length && (jn = {
mode: "customer",
id: Un[0].id,
active: !0,
paymentMethod: Un[0]
});
var Bn = Ln ? bg("card", n.session, n.options) : n.form.card;
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
selectedPaymentForm: "link" === i ? Dn : i,
selectedSavedPayment: jn,
updatingSavedPayment: null,
removingSavedPayment: null,
isConsumerInformationListed: !1,
isSelectingSavedPayment: !1,
isAddingSavedPayment: !1,
isLoggingOut: !1,
hasConfirmFailedForSavedPayment: !1,
touched: !0,
form: (0,
b.Z)((0,
b.Z)({}, n.form), {}, {
card: (0,
b.Z)((0,
b.Z)({}, Bn), {}, {
values: (0,
b.Z)((0,
b.Z)({}, null == Bn ? void 0 : Bn.values), {}, {
linkEmail: "",
linkAutofillPromptOptIn: !1
}),
displayErrors: (0,
b.Z)((0,
b.Z)({}, null == Bn ? void 0 : Bn.displayErrors), {}, {
linkEmail: !1
})
}),
link: (0,
b.Z)((0,
b.Z)({}, n.form.link), {}, {
values: (0,
b.Z)((0,
b.Z)({}, null === (Rn = n.form.link) || void 0 === Rn ? void 0 : Rn.values), {}, {
linkEmail: "",
linkAutofillPromptOptIn: !1
})
})
})
});
case "CONSUMER.CONFIRM_LINK_PAYMENT_INTENT.ERROR":
return n.isAddingSavedPayment ? n : (0,
b.Z)((0,
b.Z)({}, n), {}, {
isSelectingSavedPayment: !0,
updatingSavedPayment: null,
removingSavedPayment: null,
isAddingSavedPayment: !1,
isLoggingOut: !1
});
case "PAYMENT.CONFIRM_FAILED_FOR_SAVED_PAYMENT":
if (n.updatingSavedPayment)
return n;
var Fn = r.savedPayment
, Gn = r.session;
if ("customer" === Fn.mode || "us_bank_account" === i)
return n;
var qn = Rg({
state: n,
session: Gn,
savedPayment: Fn,
paymentMethod: "card"
})
, Kn = qn.form.card
, Vn = Kn.displayErrors
, zn = Kn.shouldUpdateLocalValueFromState;
return (0,
b.Z)((0,
b.Z)({}, qn), {}, {
form: (0,
b.Z)((0,
b.Z)({}, qn.form), {}, {
card: (0,
b.Z)((0,
b.Z)({}, qn.form.card), {}, {
displayErrors: (0,
O.Q8)(Vn, (function() {
return !0
}
)),
shouldUpdateLocalValueFromState: (0,
O.Q8)(zn, (function() {
return !1
}
))
})
}),
hasConfirmFailedForSavedPayment: !0
});
case "PAYMENT.CONFIRM_FAILED_FOR_VIEW":
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
hasConfirmFailedForView: !0
});
case "PAYMENT.LOG_RENDER":
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
timings: (0,
b.Z)((0,
b.Z)({}, n.timings), {}, {
renderTimestamp: r.timestamp
})
});
case "PAYMENT.SHOULD_LIST_WALLET":
var Hn, Yn, Wn;
if (!r.shouldList)
return n;
var Jn = (0,
b.Z)((0,
b.Z)({}, n), {}, {
shouldListApplePay: "applePay" === r.wallet || n.shouldListApplePay,
shouldListGooglePay: "googlePay" === r.wallet || n.shouldListGooglePay
})
, Xn = Ug(Jn, r.externalPaymentMethodTypes)
, Qn = !(!Xn && "accordion" !== Jn.layout.type || !jg(Jn.options.layout))
, $n = kc({
orderedPaymentMethodTypesAndWallets: (null === (Hn = Jn.session) || void 0 === Hn ? void 0 : Hn.orderedPaymentMethodTypesAndWallets) || [],
unverifiedPaymentMethodsOnDomain: (null === (Yn = Jn.session) || void 0 === Yn ? void 0 : Yn.unverifiedPaymentMethodsOnDomain) || [],
customPaymentMethodOrder: Jn.options.paymentMethodOrder,
shouldListApplePay: Jn.shouldListApplePay,
shouldListGooglePay: Jn.shouldListGooglePay,
shouldListLink: Jn.shouldListLink,
eceVisibleButtons: Jn.eceVisibleButtons,
linkSettings: null === (Wn = Jn.session) || void 0 === Wn ? void 0 : Wn.linkSettings,
heldbackPaymentMethods: Jn.heldbackPaymentMethods
});
return n.touched || $n === n.selectedPaymentForm ? (0,
b.Z)((0,
b.Z)({}, Jn), {}, {
timings: (0,
b.Z)((0,
b.Z)({}, n.timings), {}, {
walletLoadTimestamp: r.timestamp
}),
isCollapsed: Qn
}) : (0,
b.Z)((0,
b.Z)({}, Pg({
state: Jn,
paymentMethod: $n,
isUserPerformingSelection: !1
})), {}, {
timings: (0,
b.Z)((0,
b.Z)({}, n.timings), {}, {
walletLoadTimestamp: r.timestamp
}),
isCollapsed: Qn
});
case "EXPRESS_CHECKOUT.VISIBLE_BUTTONS_CHANGED":
var er = (0,
b.Z)((0,
b.Z)({}, n), {}, {
eceVisibleButtons: r.visibleButtons
});
return xg({
state: er,
removedPaymentMethods: er.eceVisibleButtons.map(x.O8)
});
case "PAYMENT.HELDBACK_PAYMENT_METHODS_CHANGED":
var tr = (0,
b.Z)((0,
b.Z)({}, n), {}, {
heldbackPaymentMethods: r.heldbackPaymentMethods
});
return xg({
state: tr,
removedPaymentMethods: r.heldbackPaymentMethods
});
case "PAYMENT.ACH_BANK_SEARCH.FIELD_BLURRED":
if (void 0 === i)
return n;
var nr = (0,
b.Z)({}, a);
return nr[i] = (0,
b.Z)((0,
b.Z)({}, a[i]), {}, {
displayErrors: (0,
b.Z)((0,
b.Z)({}, a[i].displayErrors), {}, {
bank: !1
}),
focusedField: null
}),
(0,
b.Z)((0,
b.Z)({}, n), {}, {
form: nr
});
case "PAYMENT.FETCHING_WALLETS":
var rr = !r.isComplete;
return rr ? (0,
b.Z)((0,
b.Z)({}, n), {}, {
isFetchingWallets: rr
}) : (0,
b.Z)((0,
b.Z)({}, n), {}, {
isFetchingWallets: rr,
isCollapsed: !(!Ug(n, r.externalPaymentMethodTypes) && "accordion" !== n.layout.type || !jg(n.options.layout))
});
case "PAYMENT.ACH_BANK_SEARCH.IS_FETCHING_BANKS":
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
achBankSearch: (0,
b.Z)((0,
b.Z)({}, n.achBankSearch), {}, {
isFetchingBanks: r.isFetchingBanks,
arrowPressed: !1
})
});
case "PAYMENT.ACH_BANK_SEARCH.BANKS_CHANGED":
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
achBankSearch: (0,
b.Z)((0,
b.Z)({}, n.achBankSearch), {}, {
hoveredIndex: 0,
banks: r.banks,
isFetchingBanks: !1,
error: null,
arrowPressed: !1
})
});
case "PAYMENT.ACH_BANK_SEARCH.ERROR":
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
achBankSearch: (0,
b.Z)((0,
b.Z)({}, vg), {}, {
error: r.error,
arrowPressed: !1
})
});
case "PAYMENT.ACH_BANK_SEARCH.HOVERED_INDEX_CHANGED":
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
achBankSearch: (0,
b.Z)((0,
b.Z)({}, n.achBankSearch), {}, {
hoveredIndex: r.index,
isBankSelected: !1,
arrowPressed: r.arrowPressed
})
});
case "PAYMENT.ACH_BANK_SEARCH.BANK_SELECTED":
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
achBankSearch: (0,
b.Z)((0,
b.Z)({}, n.achBankSearch), {}, {
hoveredIndex: r.index,
isBankSelected: !0,
arrowPressed: !1
})
});
case "PAYMENT.ACH_BANK_SEARCH.RESET":
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
achBankSearch: (0,
b.Z)((0,
b.Z)({}, vg), {}, {
inputLocation: n.achBankSearch.inputLocation
})
});
case "PAYMENT.ACH_BANK_SEARCH.INPUT_LOCATION_CHANGED":
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
achBankSearch: (0,
b.Z)((0,
b.Z)({}, n.achBankSearch), {}, {
inputLocation: r.inputLocation
})
});
case "PAYMENT.ACH_BANK_SEARCH.ACCOUNT_LINKED":
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
achBankSearch: (0,
b.Z)((0,
b.Z)({}, vg), {}, {
bankAccount: r.bankAccount
})
});
case "PAYMENT.SET_INSTALLMENT_PLAN":
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
form: (0,
b.Z)((0,
b.Z)({}, n.form), {}, {
card: (0,
b.Z)((0,
b.Z)({}, n.form.card), {}, {
values: (0,
b.Z)((0,
b.Z)({}, n.form.card.values), {}, {
installmentPlan: r.plan
})
})
})
});
case "PAYMENT.SET_WANTS_INSTALLMENTS":
var ar, ir, or;
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
form: (0,
b.Z)((0,
b.Z)({}, n.form), {}, {
card: (0,
b.Z)((0,
b.Z)({}, n.form.card), {}, {
values: (0,
b.Z)((0,
b.Z)({}, null === (ar = n.form.card) || void 0 === ar ? void 0 : ar.values), {}, {
linkOptIn: !r.wantsInstallments && (null === (ir = n.form.card) || void 0 === ir || null === (or = ir.values) || void 0 === or ? void 0 : or.linkOptIn)
})
})
}),
installments: (0,
b.Z)((0,
b.Z)({}, n.installments), {}, {
wantsInstallments: r.wantsInstallments
})
});
case "AVAILABLE_INSTALLMENT_PLANS.RETRIEVE.BEGIN":
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
installments: (0,
b.Z)((0,
b.Z)({}, n.installments), {}, {
availableInstallments: (0,
b.Z)((0,
b.Z)({}, n.installments.availableInstallments), {}, {
loading: !0,
error: null
}),
request: r.payload
})
});
case "AVAILABLE_INSTALLMENT_PLANS.RETRIEVE.SUCCESS":
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
installments: (0,
b.Z)((0,
b.Z)({}, n.installments), {}, {
availableInstallments: (0,
b.Z)((0,
b.Z)({}, n.installments.availableInstallments), {}, {
loading: !1,
error: null,
value: r.payload.availableInstallmentPlans
})
})
});
case "AVAILABLE_INSTALLMENT_PLANS.RETRIEVE.FAILURE":
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
installments: (0,
b.Z)((0,
b.Z)({}, n.installments), {}, {
availableInstallments: (0,
b.Z)((0,
b.Z)({}, n.installments.availableInstallments), {}, {
loading: !1,
error: r.payload.error,
value: null
})
})
});
case "PAYMENT.SET_SHIPPING_AS_BILLING":
var sr, ur = r.paymentMethod, lr = r.value;
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
form: (0,
b.Z)((0,
b.Z)({}, n.form), {}, (0,
v.Z)({}, ur, (0,
b.Z)((0,
b.Z)({}, n.form[ur]), {}, {
values: (0,
b.Z)((0,
b.Z)({}, null === (sr = n.form[ur]) || void 0 === sr ? void 0 : sr.values), {}, {
shippingAsBilling: lr
})
})))
});
case "PAYMENT.SET_SAVE_PAYMENT_METHOD":
var cr, dr = t_(r.elementsState), pr = r.paymentMethodType;
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
form: (0,
b.Z)((0,
b.Z)({}, n.form), {}, (0,
v.Z)({}, pr, (0,
b.Z)((0,
b.Z)({}, n.form[pr]), {}, {
values: (0,
b.Z)((0,
b.Z)({}, null === (cr = n.form[pr]) || void 0 === cr ? void 0 : cr.values), {}, {
savePayment: r.value
})
}))),
savePaymentMethodDisplay: dr
});
case "PAYMENT.SET_DEFAULT_SAVED_PAYMENT_METHOD":
var mr, fr = t_(r.elementsState), hr = r.paymentMethodType;
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
form: (0,
b.Z)((0,
b.Z)({}, n.form), {}, (0,
v.Z)({}, hr, (0,
b.Z)((0,
b.Z)({}, n.form[hr]), {}, {
values: (0,
b.Z)((0,
b.Z)({}, null === (mr = n.form[hr]) || void 0 === mr ? void 0 : mr.values), {}, {
setAsDefaultSavedPayment: r.value
})
}))),
savePaymentMethodDisplay: fr
});
case "PAYMENT.CONFIRM_ERROR":
var _r = r.error
, yr = r.session
, vr = r.confirmationErrorState
, gr = n.customerSessionSavedPayment.selectedSavedPayment;
if ("card" === i && vr) {
if (!n.form.card)
return n;
var br = (0,
b.Z)((0,
b.Z)({}, n), {}, {
confirmationError: vr,
form: (0,
b.Z)((0,
b.Z)({}, n.form), {}, {
card: (0,
b.Z)((0,
b.Z)({}, n.form.card), {}, {
displayErrors: (0,
O.Q8)(n.form.card.displayErrors, (function() {
return !0
}
))
})
})
});
return br
}
if ("saved" !== i || !gr)
return n;
if (Qh.indexOf(_r.decline_code || "") >= 0) {
if (!n.form.saved)
return n;
var Sr = (0,
b.Z)((0,
b.Z)({}, n), {}, {
customerSessionSavedPayment: (0,
b.Z)((0,
b.Z)({}, n.customerSessionSavedPayment), {}, {
cvcConfirmationError: {
error: _r,
showValidationErrors: !0,
paymentMethodId: gr.id
}
}),
form: (0,
b.Z)((0,
b.Z)({}, n.form), {}, {
saved: (0,
b.Z)((0,
b.Z)({}, n.form.saved), {}, {
displayErrors: (0,
O.Q8)(n.form.saved.displayErrors, (function() {
return !0
}
))
})
})
});
return Sr
}
if (!r_(gr, yr))
return n;
if (-1 === Xh.indexOf(_r.decline_code || _r.code || ""))
return n;
var kr = Rg({
state: n,
session: yr,
savedPayment: gr,
paymentMethod: "saved",
confirmationError: _r
});
if (!kr.form.saved)
return n;
var Cr = kr.form.saved
, Er = Cr.displayErrors
, Zr = Cr.shouldUpdateLocalValueFromState;
return (0,
b.Z)((0,
b.Z)({}, kr), {}, {
form: (0,
b.Z)((0,
b.Z)({}, kr.form), {}, {
saved: (0,
b.Z)((0,
b.Z)({}, kr.form.saved), {}, {
displayErrors: (0,
O.Q8)(Er, (function() {
return !0
}
)),
shouldUpdateLocalValueFromState: (0,
O.Q8)(Zr, (function() {
return !1
}
))
})
})
});
case "CONSUMER.CREATE_SESSION.SUCCESS":
var Ar, Mr, Pr;
if (void 0 === r.session.support_payment_details_types)
return n;
var xr = null === (Ar = n.session) || void 0 === Ar ? void 0 : Ar.linkSettings.linkFundingSources
, Ir = r.session.support_payment_details_types
, Nr = Ir.filter((function(e) {
return "BANK_ACCOUNT" === e || -1 !== (null == xr ? void 0 : xr.indexOf(e))
}
))
, wr = n.session ? (0,
b.Z)((0,
b.Z)({}, n.session.linkSettings), {}, {
bankOnboardingEnabled: -1 !== r.session.support_payment_details_types.indexOf("BANK_ACCOUNT"),
linkFundingSources: Nr
}) : null
, Tr = vc({
orderedPaymentMethodTypesAndWallets: (null === (Mr = n.session) || void 0 === Mr ? void 0 : Mr.orderedPaymentMethodTypesAndWallets) || [],
unverifiedPaymentMethodsOnDomain: (null === (Pr = n.session) || void 0 === Pr ? void 0 : Pr.unverifiedPaymentMethodsOnDomain) || [],
customPaymentMethodOrder: n.options.paymentMethodOrder,
shouldListApplePay: n.shouldListApplePay,
shouldListGooglePay: n.shouldListGooglePay,
shouldListLink: n.shouldListLink,
eceVisibleButtons: n.eceVisibleButtons,
linkSettings: wr,
heldbackPaymentMethods: n.heldbackPaymentMethods
})
, Or = i;
return Tr.length > 0 && (void 0 === i || -1 === Tr.indexOf(i)) && (Or = Tr[0]),
(0,
b.Z)((0,
b.Z)({}, n), {}, {
selectedPaymentForm: Or
});
case "PAYMENT.CARD_BRAND_CHOICE.NETWORKS_RETRIEVED":
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
cardBrandChoice: (0,
b.Z)((0,
b.Z)({}, n.cardBrandChoice), {}, {
networks: r.networks
})
});
case "PAYMENT.PARENT_VISIBLE":
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
parentVisible: !0
});
case "PAYMENT.CLEAR_LINK_PHONE_VERIFICATION":
var Rr;
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
form: (0,
b.Z)((0,
b.Z)({}, n.form), {}, {
card: (0,
b.Z)((0,
b.Z)({}, n.form.card), {}, {
values: (0,
b.Z)((0,
b.Z)({}, null === (Rr = n.form.card) || void 0 === Rr ? void 0 : Rr.values), {}, {
linkEmailOtpVerificationPhone: ""
})
})
})
});
case "PAYMENT.CUSTOMER_SESSION_SAVED_PAYMENT.IS_SELECTING":
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
customerSessionSavedPayment: (0,
b.Z)((0,
b.Z)({}, n.customerSessionSavedPayment), {}, {
isSelectingSavedPayment: !0
})
});
case "PAYMENT.CUSTOMER_SESSION_SAVED_PAYMENT.SELECTED":
var Lr = r.savedPayment
, Dr = n.savedPaymentCvcs
, Ur = (0,
b.Z)((0,
b.Z)({}, n), {}, {
form: (0,
b.Z)((0,
b.Z)({}, n.form), {}, {
saved: Sg({
paymentMethod: "saved",
session: n.session,
options: n.options,
savedPaymentCvcs: Dr,
savedPaymentId: Lr.id
})
}),
customerSessionSavedPayment: (0,
b.Z)((0,
b.Z)({}, n.customerSessionSavedPayment), {}, {
selectedSavedPayment: r.savedPayment,
updatingSavedPayment: null,
removingSavedPayment: null,
isSelectingSavedPayment: !1
})
});
return Lg({
state: Ur,
session: n.session
});
case "PAYMENT.CUSTOMER_SESSION_SAVED_PAYMENT.IS_REMOVING":
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
customerSessionSavedPayment: (0,
b.Z)((0,
b.Z)({}, n.customerSessionSavedPayment), {}, {
removingSavedPayment: r.savedPayment
})
});
case "PAYMENT.CUSTOMER_SESSION_SAVED_PAYMENT.IS_UPDATING":
var jr = r.session
, Br = r.savedPayment;
return Br ? Rg({
state: n,
session: jr,
savedPayment: Br,
paymentMethod: "saved"
}) : (0,
b.Z)((0,
b.Z)({}, n), {}, {
customerSessionSavedPayment: (0,
b.Z)((0,
b.Z)({}, n.customerSessionSavedPayment), {}, {
updatingSavedPayment: null,
isSelectingSavedPayment: !0
})
});
default:
return n
}
}
}, Fg = (n(17948),
n(91493),
n(47934),
(0,
b.Z)({
google_pay: !0,
paypal: !0,
link: !0,
klarna: !0
}, yh)), Gg = (0,
b.Z)({
apple_pay_inner: !0,
apple_pay_outer: !0
}, Fg), qg = ((0,
b.Z)({
apple_pay: !0
}, Fg),
(0,
b.Z)({}, Gg)), Kg = ((0,
b.Z)({
googlePay: {
type: "ga"
},
applePayOuter: {
type: "ga"
},
applePayInner: {
type: "beta",
betaGate: "enable_apple_pay_crossbrowser_express_checkout_element"
},
paypal: {
type: "ga"
},
link: {
type: "ga"
},
klarna: {
type: "beta",
betaGate: "elements_enable_klarna_express_checkout"
}
}, Sh),
function(e, t, n) {
return (0,
b.Z)((0,
b.Z)({}, e), {}, (0,
v.Z)({}, t, n))
}
), Vg = ["type"], zg = ["type"], Hg = function(e, t) {
var n = (0,
Z.Z)(e)
, r = e.indexOf(t);
return r > -1 && n.splice(r, 1),
n
}, Yg = function(e, t) {
var n = e.session
, r = (null == n ? void 0 : n.orderedPaymentMethodTypesAndWallets.filter((function(e) {
return -1 === (null == n ? void 0 : n.unverifiedPaymentMethodsOnDomain.indexOf(e))
}
))) || [];
xh(e) && r.push("link");
var a = r.indexOf("apple_pay");
-1 !== a && (r.splice(a, 1),
r.push("apple_pay_inner", "apple_pay_outer"));
var i = Wg((function(n) {
return Jg(e, n, r, t)
}
));
return {
sortedButtons: r.filter((function(e) {
return e in qg
}
)).map((function(e) {
return (0,
x.i3)(e)
}
)).filter((function(e) {
return "hidden" !== i[e].type
}
)),
buttonDisplayStates: i
}
}, Wg = function(e) {
return Object.keys(qg).reduce((function(t, n) {
var r = (0,
x.i3)(n)
, a = e(n);
return (0,
b.Z)((0,
b.Z)({}, t), {}, (0,
v.Z)({}, r, a))
}
), {})
}, Jg = function(e, t, n, r) {
var a = Xg(e, t, n);
if (a.length > 0)
return {
type: "hidden",
reasons: a
};
if (r) {
var i, o = null !== (i = r[(0,
x.i3)(t)]) && void 0 !== i ? i : null;
if (null !== o && "paypal" !== t)
return o
}
return {
type: "loading"
}
}, Xg = function(e, t, n) {
var r = e.session
, a = [tb(r, t), eb(t, n), nb(r, t), $g(e, t), Qg(t)];
return (0,
O.VS)(a, (function(e) {
return null == e ? [] : [e]
}
))
}, Qg = function(e) {
return !1 === qg[e] ? "manual_override_early_development" : null
}, $g = function(e, t) {
return "manual" !== e.paymentMethodCreation ? null : ph(t) || "paypal" === t || "klarna" === t ? "manual_payment_method_creation_unsupported" : null
}, eb = function(e, t) {
return _c(e) && -1 !== t.indexOf("apple_pay") ? null : -1 === t.indexOf(e) ? "domain_unregistered_or_backend_filtered" : null
}, tb = function(e, t) {
var n, r;
switch (t) {
case "klarna":
return (null == e || null === (n = e.klarnaExpressConfig) || void 0 === n ? void 0 : n.klarnaMid) ? null : "payment_method_disabled";
case "paypal":
return null != e && null !== (r = e.paypalExpressConfig) && void 0 !== r && r.clientId ? null : "payment_method_disabled";
case "link":
return null != e && e.linkSettings.linkPayButtonElementEnabled ? null : "payment_method_disabled";
case "apple_pay_inner":
return !(null == e || !e.featureFlags.enable_apple_pay_crossbrowser_express_checkout_element) ? null : "payment_method_disabled";
default:
if (!ph(t))
return null;
var a = fh(t);
return Dh(e, a.rolloutConfig)
}
}, nb = function(e, t) {
if (!ab(e))
return null;
if (ph(t)) {
var n = fh(t);
return Dh(e, n.recurringFlowsRolloutConfig)
}
return rb(t) ? null : "setup_future_usage_unsupported"
}, rb = function(e) {
return "klarna" !== e
}, ab = function(e) {
return "off_session" === (null == e ? void 0 : e.setupFutureUsage) || "on_session" === (null == e ? void 0 : e.setupFutureUsage)
}, ib = function(e) {
var t = Yg(e)
, n = t.sortedButtons
, r = t.buttonDisplayStates
, a = {
initialized: !1,
options: (0,
b.Z)((0,
b.Z)({}, Eh), {}, {
buttonTheme: {}
}),
isRtl: !1,
isAwaitingConfirmCallback: !1,
confirmingPaymentMethodType: null,
confirmNonce: null,
paymentMethodData: null,
sharedPaymentMethodId: null,
paypalOrder: Zh,
paypalBillingAgreement: Ah,
shippingContact: null,
googlePayMinWidth: 240,
sheetOpenedPaymentMethod: null,
sheetOpenFailure: !1,
width: null,
shouldForcePlainButtons: !1,
buttonCount: n.length,
klarna: Ph
};
return (0,
b.Z)((0,
b.Z)({}, a), {}, {
sortedButtons: n,
buttonDisplayStates: r,
config: e
})
}, ob = function(e, t, n) {
var r, a = {};
if (t) {
var i = (null == n ? void 0 : n.googlePay) || "auto";
if ("hidden" !== e.buttonDisplayStates.googlePay.type && ("never" === (r = i) || !Jr.Wt && !Jr.j3 || "always" !== r && (!window.PaymentRequest || Jr.s$))) {
var o = "never" === i ? ["merchant_payment_method_param_config"] : ["unsupported_browser"];
a = (0,
b.Z)((0,
b.Z)({}, a), {}, {
googlePay: {
type: "hidden",
reasons: o
}
})
}
"never" === ((null == n ? void 0 : n.applePay) || "auto") && "hidden" !== e.buttonDisplayStates.applePayInner.type && (a = (0,
b.Z)((0,
b.Z)({}, a), {}, {
applePayInner: {
type: "hidden",
reasons: ["merchant_payment_method_param_config"]
}
})),
(0,
O.qh)(n).forEach((function(t) {
var n, r, i, o = (0,
g.Z)(t, 2), s = o[0], u = o[1];
lb(s, u, e) && "applePay" !== s && (n = a,
r = s,
i = {
type: "hidden",
reasons: ["merchant_payment_method_param_config"]
},
a = (0,
b.Z)((0,
b.Z)({}, n), {}, (0,
v.Z)({}, r, i)))
}
))
}
var s = e.config
, u = s.session
, l = s.elementsInitSource;
if (ab(u)) {
var c = !(null == u || !u.featureFlags.paypal_express_checkout_recurring_support_elements_for_new_ece_shape) && e.options.__usesNewIntegrationShape && !e.options.shippingAddressRequired;
!(null == u || !u.featureFlags.paypal_express_checkout_recurring_support) || function(e) {
return null != e && -1 !== ["custom_checkout", "checkout", "payment_link"].indexOf(e)
}(l || null) || c || (a = (0,
b.Z)((0,
b.Z)({}, a), {}, {
paypal: {
type: "hidden",
reasons: ["setup_future_usage_unsupported"]
}
}))
}
(Jr.Wt || Jr.j3) && (0,
Jr.gG)() || (a = (0,
b.Z)((0,
b.Z)({}, a), {}, {
link: {
type: "hidden",
reasons: ["unsupported_browser"]
}
})),
(!(0,
Jr.gG)() || Jr.aS || Jr.D1 && Jr.sV) && (a = (0,
b.Z)((0,
b.Z)({}, a), {}, {
paypal: {
type: "hidden",
reasons: ["unsupported_browser"]
}
})),
(!(0,
Jr.gG)() || Jr.D1 || Jr.aS) && (a = (0,
b.Z)((0,
b.Z)({}, a), {}, {
klarna: {
type: "hidden",
reasons: ["unsupported_browser"]
}
})),
(0,
Jr.gG)() || (a = (0,
b.Z)((0,
b.Z)({}, a), dh((function() {
return {
type: "hidden",
reasons: ["unsupported_browser"]
}
}
)))),
(0,
Jr.x_)() && (a = (0,
b.Z)((0,
b.Z)({}, a), {}, {
paypal: {
type: "hidden",
reasons: ["unsupported_browser"]
}
})),
ub() || (a = (0,
b.Z)((0,
b.Z)({}, a), {}, {
applePayInner: {
type: "hidden",
reasons: ["unsupported_browser"]
}
}));
var d = Object.keys(a).reduce((function(e, t) {
return Hg(e, t)
}
), e.sortedButtons);
return (0,
b.Z)((0,
b.Z)({}, e), {}, {
buttonDisplayStates: (0,
b.Z)((0,
b.Z)({}, e.buttonDisplayStates), a),
sortedButtons: d
})
}, sb = function(e) {
return "allowedShippingCountries"in e || "billingAddressRequired"in e || "phoneNumberRequired"in e || "shippingAddressRequired"in e || "shippingRates"in e || "emailRequired"in e || "applePay"in e || "lineItems"in e || "business"in e
}, ub = function() {
return Jr.G9
}, lb = function(e, t, n) {
return "googlePay" !== e && "applePay" !== e && "hidden" !== n.buttonDisplayStates[e].type && "never" === t
}, cb = function(e) {
var t = e.sortedButtons
, n = e.buttonDisplayStates
, r = e.options
, a = e.isRtl
, i = e.hasInitialized
, o = e.state
, s = r.paymentMethodOrder
, u = r.paymentMethods
, l = o.options
, c = l.paymentMethodOrder
, d = l.paymentMethods
, p = function(e) {
var t = e.sortedButtons
, n = e.buttonDisplayStates
, r = e.paymentMethodOrderOption
, a = (0,
Z.Z)(t);
(0,
O.Ke)(n).forEach((function(e) {
"hidden" === n[e].type && (a = Hg(a, e))
}
));
var i = {};
r.forEach((function(e, t) {
"apple_pay" === e ? (i.applePayInner = t + 1,
i.applePayOuter = t + 1) : i[(0,
x.i3)(e)] = t + 1
}
));
var o = function(e) {
return i[e] || (_c(e) ? r.length + 1 : t.indexOf(e) + r.length + 2)
};
return a.sort((function(e, t) {
return o(e) - o(t)
}
)),
a
}({
sortedButtons: t,
buttonDisplayStates: n,
paymentMethodOrderOption: s || c || []
})
, m = (0,
b.Z)((0,
b.Z)({}, o), {}, {
buttonDisplayStates: n,
sortedButtons: p,
options: (0,
b.Z)((0,
b.Z)({}, o.options), r),
isRtl: a,
initialized: i
});
return ob(m, i, u || d)
}, db = function(e, t) {
return "loading" === t[e].type && ("googlePay" === e || _c(e))
}, pb = function(e) {
return e.shouldShowButton ? {
type: "visible"
} : {
type: "hidden",
reasons: ["should_show_button_dispatch"]
}
}, mb = function(e, t) {
return function() {
var n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : t || e
, r = arguments.length > 1 ? arguments[1] : void 0;
switch (r.type) {
case "CONFIG.ASYNC_UPDATE_RECEIVED":
var a = r.config
, i = r.prevSession
, o = a.session
, s = o || {}
, u = s.orderedPaymentMethodTypesAndWallets
, l = i || {}
, c = l.orderedPaymentMethodTypesAndWallets
, d = void 0 === c ? [] : c;
o && d.length === (null == u ? void 0 : u.length) && (0,
O.dq)(d, u).length === u.length && (o = (0,
b.Z)((0,
b.Z)({}, o), {}, {
orderedPaymentMethodTypesAndWallets: d
}));
var p = Yg((0,
b.Z)((0,
b.Z)({}, r.elementsState.config), {}, {
session: o || null
}))
, m = (0,
O.Ke)(p.buttonDisplayStates);
return m.forEach((function(e) {
db(e, p.buttonDisplayStates) && (p.buttonDisplayStates[e] = n.buttonDisplayStates[e])
}
)),
cb((0,
b.Z)((0,
b.Z)({}, p), {}, {
options: n.options,
isRtl: n.isRtl,
hasInitialized: n.initialized,
state: n
}));
case "EXPRESS_CHECKOUT.RESET_STATE":
return ib(r.config);
case "EXPRESS_CHECKOUT.INIT":
var f = (0,
b.Z)((0,
b.Z)({}, n), {}, {
options: (0,
b.Z)((0,
b.Z)({}, n.options), {}, {
__usesNewIntegrationShape: sb(r.options)
})
});
return cb({
sortedButtons: f.sortedButtons,
buttonDisplayStates: f.buttonDisplayStates,
options: r.options,
isRtl: r.isRtl,
hasInitialized: !0,
state: f
});
case "EXPRESS_CHECKOUT.PUBLIC_OPTIONS_RECEIVED":
var _ = (0,
b.Z)((0,
b.Z)({}, n), {}, {
options: (0,
b.Z)((0,
b.Z)({}, n.options), {}, {
__usesNewIntegrationShape: n.options.__usesNewIntegrationShape || sb(r.options)
})
})
, y = Yg(_.config, _.buttonDisplayStates)
, v = y.sortedButtons
, g = y.buttonDisplayStates;
return cb({
sortedButtons: v,
buttonDisplayStates: g,
options: r.options,
isRtl: _.isRtl,
hasInitialized: !0,
state: _
});
case "EXPRESS_CHECKOUT.SHOULD_SHOW_BUTTON":
var S = r.button
, k = r.shouldShowButton
, C = (0,
Z.Z)(n.sortedButtons);
k || (C = Hg(C, S));
var E = (0,
b.Z)({}, n.buttonDisplayStates);
if ("hidden" !== n.buttonDisplayStates[S].type) {
var A = pb({
shouldShowButton: k
});
E = Kg(E, S, A)
}
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
buttonDisplayStates: E,
sortedButtons: C
});
case "EXPRESS_CHECKOUT.BACKGROUND_COLOR":
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
options: (0,
b.Z)((0,
b.Z)({}, n.options), {}, {
buttonTheme: (0,
b.Z)((0,
b.Z)({}, r.isBackgroundColorDark ? Ch : kh), n.options.buttonTheme)
})
});
case "EXPRESS_CHECKOUT.CONFIRM_START":
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
isAwaitingConfirmCallback: !0,
confirmingPaymentMethodType: r.paymentMethodType,
confirmNonce: r.nonce || null
});
case "EXPRESS_CHECKOUT.CONFIRM_END":
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
isAwaitingConfirmCallback: !1,
confirmingPaymentMethodType: null,
confirmNonce: null
});
case "EXPRESS_CHECKOUT.SET_CONFIRM_DATA":
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
paymentMethodData: r.paymentMethodData,
shippingContact: r.shippingContact
});
case "EXPRESS_CHECKOUT.GOOGLE_PAY_MIN_WIDTH":
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
googlePayMinWidth: r.minWidth
});
case "EXPRESS_CHECKOUT.UPDATE_PAYPAL_BILLING_AGREEMENT":
r.type;
var M = (0,
h.Z)(r, Vg);
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
paypalBillingAgreement: (0,
b.Z)((0,
b.Z)({}, n.paypalBillingAgreement), M)
});
case "EXPRESS_CHECKOUT.RESET_PAYPAL_BILLING_AGREEMENT":
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
paypalBillingAgreement: Ah
});
case "EXPRESS_CHECKOUT.UPDATE_PAYPAL_ORDER":
r.type;
var P = (0,
h.Z)(r, zg);
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
paypalOrder: (0,
b.Z)((0,
b.Z)({}, n.paypalOrder), P)
});
case "EXPRESS_CHECKOUT.RESET_PAYPAL_ORDER":
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
paypalOrder: Zh
});
case "EXPRESS_CHECKOUT.SET_KLARNA_STATE":
var x = r.klarnaConfirmationToken;
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
klarna: {
klarnaConfirmationToken: x
}
});
case "EXPRESS_CHECKOUT.SHEET_OPENED":
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
sheetOpenedPaymentMethod: r.paymentMethodType
});
case "EXPRESS_CHECKOUT.SHEET_CLOSED":
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
sheetOpenedPaymentMethod: null
});
case "EXPRESS_CHECKOUT.SHEET_OPEN_FAILURE":
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
sheetOpenFailure: r.value
});
case "EXPRESS_CHECKOUT.WIDTH":
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
width: r.width
});
case "EXPRESS_CHECKOUT.UPDATE_SHOULD_FORCE_PLAIN_BUTTONS":
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
shouldForcePlainButtons: r.shouldForcePlainButtons
});
case "EXPRESS_CHECKOUT.BUTTON_COUNT":
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
buttonCount: r.count
});
case "EXPRESS_CHECKOUT.PAYMENT_METHOD_SHARED":
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
sharedPaymentMethodId: r.paymentMethodId
});
case "PAYMENT.FETCHING_WALLETS":
return "googlePay" === r.wallet || "both" === r.wallet ? (0,
b.Z)((0,
b.Z)({}, n), {}, {
isPeFetchingGooglePayAvailability: !r.isComplete
}) : n;
case "PAYMENT.SHOULD_LIST_WALLET":
return "googlePay" === r.wallet ? (0,
b.Z)((0,
b.Z)({}, n), {}, {
cachedGooglePayAvailability: r.shouldList
}) : n;
case "EXPRESS_CHECKOUT.SET_SESSION":
return (0,
b.Z)((0,
b.Z)({}, n), {}, {
expressCheckoutSession: r.expressCheckoutSession
});
default:
return n
}
}
}, fb = function(e, t) {
return function() {
var n, r, a, i, o = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : t || e, s = arguments.length > 1 ? arguments[1] : void 0;
switch (s.type) {
case "CURRENCY_SELECTOR.INIT":
return (0,
b.Z)((0,
b.Z)({}, o), {}, {
initialized: !0,
isRtl: s.isRtl,
options: s.options,
localCurrency: null !== (n = null === (r = s.options.__customCheckout) || void 0 === r ? void 0 : r.currency) && void 0 !== n ? n : o.localCurrency
});
case "CURRENCY_SELECTOR.PUBLIC_OPTIONS_RECEIVED":
return (0,
b.Z)((0,
b.Z)({}, o), {}, {
options: (0,
b.Z)((0,
b.Z)({}, o.options), s.options)
});
case "CURRENCY_SELECTOR.SELECT_CURRENCY":
return (0,
b.Z)((0,
b.Z)({}, o), {}, {
localCurrency: s.currency
});
case "CURRENCY_SELECTOR.CONTROLLER_USER_CLEARED":
var u = o.options.__customCheckout;
return (0,
b.Z)((0,
b.Z)({}, o), {}, {
localCurrency: null !== (a = null == u || null === (i = u.currencyOptions) || void 0 === i ? void 0 : i[0].currency) && void 0 !== a ? a : o.localCurrency
});
default:
return o
}
}
}, hb = "2020-08-27", _b = (0,
b.Z)((0,
b.Z)({}, Se.kg), {}, {
log: function(e, t, n) {
Se.kg.log(e, t, {
prefix: n
})
}
}), yb = _b, vb = n(56274).Promise, gb = function(e) {
var t = e.ephemeralKey
, n = e.paymentMethodId
, r = e.paymentMethodType
, a = e.state
, i = e.request
, o = e.onError
, s = e.onSuccess
, u = oi(a)
, l = a.config;
return Ol.paymentMethods.list({
ephemeralKey: t,
stripeVersion: l.stripeVersion || hb,
data: {
customer: u.id,
type: r,
limit: 30
}
}).then((function(e) {
return "error" === e.type ? [n] : "card" === r ? (t = n,
a = e.object.data,
(i = (0,
O.sE)(a, (function(e) {
return e.id === t
}
))) ? a.filter((function(e) {
return e.card.fingerprint === i.card.fingerprint
}
)).map((function(e) {
return e.id
}
)) : [t]) : "us_bank_account" === r ? function(e, t) {
var n = (0,
O.sE)(t, (function(t) {
return t.id === e
}
));
return n ? t.filter((function(e) {
return e.us_bank_account.fingerprint === n.us_bank_account.fingerprint
}
)).map((function(e) {
return e.id
}
)) : [e]
}(n, e.object.data) : "sepa_debit" === r ? function(e, t) {
var n = (0,
O.sE)(t, (function(t) {
return t.id === e
}
));
return n ? t.filter((function(e) {
return e.sepa_debit.fingerprint === n.sepa_debit.fingerprint
}
)).map((function(e) {
return e.id
}
)) : [e]
}(n, e.object.data) : [n];
var t, a, i
}
)).then((function(e) {
var t = e.map((function(e) {
return i(e)
}
));
return vb.all(t)
}
)).then((function(e) {
var t, n = e.map((function(e) {
return "error" === e.type && "resource_missing" !== e.error.code ? e.error : null
}
)).filter((function(e) {
return null !== e
}
)), r = 0 === n.length ? (0,
O.sE)(e, (function(e) {
return "object" === e.type
}
)) : null;
n.length > 0 ? o(n[0]) : s(null !== (t = null == r ? void 0 : r.object) && void 0 !== t ? t : null)
}
))
}, bb = function(e) {
if ("card" !== e.type)
return !1;
var t = e.card;
return !!(0,
M.eH)(t.exp_year, t.exp_month)
}, Sb = n(56274).Promise, kb = ["paymentMethod"], Cb = function(e) {
var t = e.paymentMethod
, n = (0,
h.Z)(e, kb);
return function(e, r) {
e({
type: "PAYMENT.UPDATE_SAVED_PAYMENT_METHOD.PENDING"
});
var a = r()
, i = oi(a)
, o = Pa(a)
, s = i.customerSession.apiKey
, u = a.config
, l = n_(a.paymentElement, o).setAsDefault
, c = function(n, r, o) {
return e((0,
b.Z)({
type: "PAYMENT.UPDATE_SAVED_PAYMENT_METHOD.SUCCESS",
selectedSavedPayment: {
mode: "customer_from_session",
id: r.id,
paymentMethod: r
}
}, o)),
l ? Ol.customers.update({
id: i.id,
ephemeralKey: s,
stripeVersion: u.stripeVersion || hb,
data: {
invoice_settings: {
default_payment_method: t.id
}
},
errorHandlingConfig: {
key: u.apiKey,
log: yb.log
}
}).then((function(r) {
if ("error" === r.type)
return yb.log("upe.update_customer_error", r.error),
null;
if (n) {
var o;
if (!u.session)
return null;
var s = {
externalPaymentMethodTypes: u.externalPaymentMethodTypes,
session: (0,
b.Z)((0,
b.Z)({}, u.session), {}, {
customer: (0,
b.Z)((0,
b.Z)({}, i), {}, {
defaultPaymentMethod: t.id
})
})
};
e({
type: "CONFIG.ASYNC_UPDATE_RECEIVED",
config: s,
prevSession: u.session,
consumerSession: null !== (o = a.consumer.consumerSession) && void 0 !== o ? o : void 0,
elementsState: a
})
}
return t.id
}
)).catch((function(e) {
return yb.log("upe.update_customer_error", e),
null
}
)) : Sb.resolve(null)
};
if ("card" !== t.type)
return c(!0, t),
Sb.resolve();
var d = n
, p = d.cardDetails
, m = d.billingDetails;
if ("token"in p || "wallet"in p)
throw new Error("Unsupported for card details with token.");
return function(e, t, n) {
var r, a = e.billing_details.address, i = e.card, o = i.exp_month, s = i.exp_year, u = i.networks.preferred, l = o.toString().padStart(2, "0") === t.exp_month && s.toString().substring(2, 4) === t.exp_year, c = !n || (0,
O.Xy)(n, (0,
b.Z)((0,
b.Z)((0,
b.Z)((0,
b.Z)((0,
b.Z)((0,
b.Z)({}, n.line1 ? {
line1: null == a ? void 0 : a.line1
} : {}), n.line2 ? {
line2: null == a ? void 0 : a.line2
} : {}), n.city ? {
city: null == a ? void 0 : a.city
} : {}), n.state ? {
state: null == a ? void 0 : a.state
} : {}), n.postal_code ? {
postal_code: null == a ? void 0 : a.postal_code
} : {}), n.country ? {
country: null == a ? void 0 : a.country
} : {})), d = null === (r = t.networks) || void 0 === r ? void 0 : r.preferred;
return l && c && (!d || !!d && u === d)
}(t, p, m.address) ? (c(!0, t, {
cvc: p.cvc
}),
Sb.resolve()) : gb({
ephemeralKey: s,
paymentMethodId: t.id,
paymentMethodType: "card",
state: a,
request: function(e) {
var t, n, r, a = null === (t = p.networks) || void 0 === t ? void 0 : t.preferred, i = a && {
preferred: a
};
return Ol.paymentMethods.update({
id: e,
ephemeralKey: s,
stripeVersion: u.stripeVersion || hb,
data: {
billing_details: {
address: {
postal_code: null === (n = m.address) || void 0 === n ? void 0 : n.postal_code,
country: null === (r = m.address) || void 0 === r ? void 0 : r.country
}
},
card: {
exp_month: p.exp_month,
exp_year: p.exp_year,
networks: i
}
},
log: yb.log,
key: u.apiKey
})
},
onError: function(t) {
e({
type: "PAYMENT.UPDATE_SAVED_PAYMENT_METHOD.ERROR",
error: t
})
},
onSuccess: function(n) {
var r, o;
n && bb(t) && !bb(n) && yb.log("upe.saved_card_expired.updated", {
saved_payment_method_id: n.id
});
var s = i.paymentMethods.map((function(e) {
return e.id === t.id && null !== n ? (o = (0,
b.Z)((0,
b.Z)({}, n), {}, {
id: t.id
}),
(0,
b.Z)({
object: "payment_method"
}, o)) : e
}
));
c(!1, null !== (r = o) && void 0 !== r ? r : t, {
cvc: p.cvc
}).then((function(t) {
var n;
if (u.session) {
var r = {
externalPaymentMethodTypes: u.externalPaymentMethodTypes,
session: (0,
b.Z)((0,
b.Z)({}, u.session), {}, {
customer: (0,
b.Z)((0,
b.Z)({}, i), {}, {
paymentMethods: s,
defaultPaymentMethod: null != t ? t : i.defaultPaymentMethod
})
})
};
e({
type: "CONFIG.ASYNC_UPDATE_RECEIVED",
config: r,
prevSession: u.session,
consumerSession: null !== (n = a.consumer.consumerSession) && void 0 !== n ? n : void 0,
savedPaymentMethod: {
isSelectingSavedPayment: s.length > 1,
updatingSavedPayment: null
},
elementsState: a
})
}
}
))
}
})
}
}, Eb = function() {
return function(e) {
return function(t) {
if ("function" == typeof t)
return e(t);
if ("EFFECT" !== t.type)
return e(t);
switch (t.effect) {
case "HAS_AUTH":
return e(Km);
case "CREATE_CONSUMER_SESSION":
return e(Dm(t.email));
case "CONFIRM_INSTANT_DEBITS_FINANCIAL_INCENTIVE":
return e(ef(t.paymentDetailsId));
case "LINK_GLOBAL_HOLDBACK_LOOKUP":
return e((E = t.email,
function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
var n;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
n = Hl.sharedInstance(),
t({
type: "CONSUMER.LINK_GLOBAL_HOLDBACK_LOOKUP.PENDING"
}),
n.DANGEROUS_lookupConsumerSessionUncachedUnlogged({
requestSurface: vt.jL.ElementsController,
emailAddress: E
}).then((function(e) {
if (e && e.response) {
var n, r, a = e.response, i = e.lookupBy;
"error" === a.type ? (t({
type: "CONSUMER.LINK_GLOBAL_HOLDBACK_LOOKUP.ERROR",
error: a.error,
lookupBy: i,
source: null == E ? void 0 : E.source
}),
Jl.log("link.global_holdback.lookup_error", {
request_id: a.requestId,
error: a.error
})) : (t({
type: "CONSUMER.LINK_GLOBAL_HOLDBACK_LOOKUP.SUCCESS",
response: a.object,
lookupBy: i,
source: null == E ? void 0 : E.source
}),
Jl.log("link.global_holdback.lookup_success", {
request_id: a.requestId,
consumer_account_id: null !== (n = a.object) && void 0 !== n && n.exists ? null === (r = a.object) || void 0 === r ? void 0 : r.account_id : "unknown"
}))
} else
t({
type: "CONSUMER.LINK_GLOBAL_HOLDBACK_LOOKUP.ERROR",
error: {},
lookupBy: E ? "email" : "cookie",
source: null == E ? void 0 : E.source
})
}
));
case 3:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t) {
return e.apply(this, arguments)
}
}()));
case "LOGIN":
return e(function(e) {
return function(t, n) {
if (Yc(n()))
return wm.resolve({
found: !1
});
var r = ri(n());
if (!Xa(n()))
return t({
type: "CONSUMER.RESET_SESSION",
ignoreCookieLogin: !0
}),
wm.resolve({
found: !1
});
var a = wm.resolve()
, i = ad(n())
, o = qm(e.email)
, s = i === o;
return s || (a = t(Dm(e))),
a.then((0,
k.Z)((0,
S.Z)().mark((function a() {
var u, l, c, d;
return (0,
S.Z)().wrap((function(a) {
for (; ; )
switch (a.prev = a.next) {
case 0:
if (i = ad(n()),
o = qm(e.email),
s = i === o,
p = n(),
u = p.consumer.hasPasskey,
s) {
a.next = 6;
break
}
return a.abrupt("return", wm.resolve({
found: !1
}));
case 6:
if ("user_action" !== e.source) {
a.next = 9;
break
}
return a.next = 9,
t(nf);
case 9:
if (l = bd(n()),
c = Nm(n()),
!l || !c) {
a.next = 13;
break
}
return a.abrupt("return", wm.resolve({
found: !0,
shouldOpenLinkModal: !0,
consumerInfoForLinkModal: c
}));
case 13:
return d = t(Um(vt.sf.SMS)),
r && u && t(Um(vt.sf.WEBAUTHN)),
a.next = 17,
d;
case 17:
return a.abrupt("return", wm.resolve({
found: !0
}));
case 18:
case "end":
return a.stop()
}
var p
}
), a)
}
))))
}
}(t.email));
case "TEMPORARY_AND_DANGEROUS_LOGIN_WITH_LINK_MODAL_STATE":
return e((C = t.consumerInfo,
function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o, s, u, l, c, d, p, m, f, h, _;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
if (r = C.consumer_session,
a = C.redacted_payment_details,
i = C.shipping_addresses,
o = C.publishable_key,
s = C.account_id,
u = C.settings,
l = u.found_using_partial_cookie,
c = u.full_name_collection_required,
d = u.email_otp_requires_additional_info,
p = u.email_otp_verify_phone_despite_sms_otp,
m = u.has_passkey,
f = u.has_previous_merchant_relationship,
h = u.purchase_protections_holdback,
_ = C.experiments,
Ot(r.verification_sessions)) {
e.next = 3;
break
}
return e.abrupt("return");
case 3:
Jl.updateParams({
consumer_account_id: s
}),
t({
type: "CONSUMER.CREATE_SESSION.SUCCESS",
session: r,
publishableKey: o,
foundUsingPartialCookie: l,
fullNameCollectionRequired: c,
emailOtpRequiresAdditionalInfo: d,
emailOtpVerifyPhoneDespiteSmsOtp: p,
experiments: _,
hasPasskey: m,
hasPreviousMerchantRelationship: f,
purchaseProtectionsHoldback: h,
lookupBy: "email",
source: "user_action"
}),
t({
type: "CONSUMER.LIST_PAYMENT_DETAILS.SUCCESS",
paymentDetails: a,
supportedPaymentDetailsTypes: qc(n())
}),
t({
type: "CONSUMER.LIST_SHIPPING_ADDRESSES.SUCCESS",
shippingAddresses: i
}),
zm("link.logged_in_with_link_store_state"),
t({
type: "AUTHENTICATION.AUTHENTICATED_CHANGED",
authenticated: !0
}),
t({
type: "CONSUMER.LOADED",
autofillBehavior: "noclick"
});
case 10:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}()));
case "ATTEMPT_LOGIN_USING_STORED_CREDENTIALS":
return e((v = t.element,
function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o, s, u, l, c, d, p;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
if (r = Xa(n()),
a = _d(v)(n()),
!Yc(n())) {
e.next = 4;
break
}
return e.abrupt("return");
case 4:
if (!nd(n())) {
e.next = 6;
break
}
return e.abrupt("return");
case 6:
if (r) {
e.next = 9;
break
}
return t({
type: "CONSUMER.RESET_SESSION",
ignoreCookieLogin: !0
}),
e.abrupt("return");
case 9:
return i = wa(n()),
o = Ma(n()),
s = ii(n()),
u = qc(n()),
e.next = 15,
Hl.sharedInstance().attemptLogInUsingStoredCredentials({
requestSurface: i,
sessionId: o,
transactionContext: s,
supportedPaymentDetailsTypes: u
}).then(function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(r) {
var i, o, s, u, l, c, d, p, m, f, h, _, y, v, g, b, k, C, E, Z, A, M, P, x, I, N, w, T, O;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
if (r.consumerInfo && (!r.credentialLifetime || -1 !== a.indexOf(r.credentialLifetime))) {
e.next = 4;
break
}
return t({
type: "CONSUMER.LINK_GLOBAL_HOLDBACK_LOOKUP.ERROR",
error: {
message: "Consumer not found"
},
lookupBy: "cookie"
}),
e.abrupt("return", {
found: !1
});
case 4:
if (o = r.consumerInfo,
s = o.consumer_session,
u = o.redacted_payment_details,
l = o.shipping_addresses,
c = o.publishable_key,
d = o.account_id,
p = o.settings,
m = p.found_using_partial_cookie,
f = p.full_name_collection_required,
h = p.email_otp_requires_additional_info,
_ = p.email_otp_verify_phone_despite_sms_otp,
y = p.has_passkey,
v = p.has_previous_merchant_relationship,
g = p.purchase_protections_holdback,
b = o.experiments,
k = r.credentialLifetime,
Jl.updateParams({
consumer_account_id: d
}),
t({
type: "CONSUMER.CREATE_SESSION.SUCCESS",
session: s,
publishableKey: c,
foundUsingPartialCookie: m,
fullNameCollectionRequired: f,
emailOtpRequiresAdditionalInfo: h,
emailOtpVerifyPhoneDespiteSmsOtp: _,
experiments: b,
hasPasskey: y,
hasPreviousMerchantRelationship: v,
purchaseProtectionsHoldback: g,
lookupBy: "cookie"
}),
t({
type: "CONSUMER.LIST_PAYMENT_DETAILS.SUCCESS",
paymentDetails: u,
supportedPaymentDetailsTypes: qc(n())
}),
t({
type: "CONSUMER.LIST_SHIPPING_ADDRESSES.SUCCESS",
shippingAddresses: l
}),
C = n(),
E = Qa(C),
Jl.log("link.start_login_with_auth_session_client_secret", {
default_integration: E,
partial_cookie: m
}),
Z = ad(C),
!(A = null === (i = Ka(C)) || void 0 === i ? void 0 : i.toLowerCase().trim()) || A === Z) {
e.next = 18;
break
}
return Jl.log("link.customer_and_cookie_email_dont_match", {
default_integration: E,
partial_cookie: m
}),
t({
type: "CONSUMER.RESET_SESSION",
ignoreCookieLogin: !0
}),
e.abrupt("return", {
found: !1
});
case 18:
if (M = Xc(n()),
P = Gc(n()),
x = Et(M, P),
!m) {
e.next = 28;
break
}
if (N = qa(C) && (null === (I = si(C)) || void 0 === I ? void 0 : I.length),
!(x.length < 1 || N)) {
e.next = 26;
break
}
return t({
type: "CONSUMER.RESET_SESSION"
}),
e.abrupt("return", {
found: !1
});
case 26:
return t({
type: "CONSUMER.LOADED",
autofillBehavior: "oneclick"
}),
e.abrupt("return", {
found: !0
});
case 28:
return t(zm("link.logged_in_with_auth_session_client_secret")),
w = ci(C),
T = w.email,
"noclick" == (O = "ephemeral" === k || x.length < 1 ? "noclick" : "oneclick") && Z && T.trim().toLowerCase() !== Z && t({
type: "AUTHENTICATION.FIELD_CHANGED",
name: "email",
value: Z,
touched: !1
}),
"noclick" === O && t({
type: "AUTHENTICATION.AUTHENTICATED_CHANGED",
authenticated: !0
}),
t({
type: "CONSUMER.LOADED",
autofillBehavior: O
}),
e.abrupt("return", {
found: !0
});
case 35:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t) {
return e.apply(this, arguments)
}
}()).catch((function() {
return {
found: !1
}
}
));
case 15:
l = e.sent,
c = l.found,
t({
type: "CONSUMER.UNSET_PENDING"
}),
c || Jl.log("link.not_logged_in_with_auth_session_client_secret"),
c || (d = n(),
Ha(d).bankIncentivesEnabled && t({
type: "CONSUMER.SET_INSTANT_DEBITS_INCENTIVE",
amount: 500
}),
(p = Im(d)) && t({
type: "CONSUMER.ENABLE_SIGN_UP_INCENTIVE_OFFERS",
paymentMethodTypes: [p]
}));
case 20:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}()));
case "LOGOUT":
return e(Hm);
case "VERIFY_CONSUMER_SESSION":
return e(Wm(t.webAuthnCredentialResponse));
case "REMOVE_SHIPPING_ADDRESS":
var n = t.id;
return e(function(e) {
return function() {
var t = (0,
k.Z)((0,
S.Z)().mark((function t(n, r) {
var a, i, o, s, u, l;
return (0,
S.Z)().wrap((function(t) {
for (; ; )
switch (t.prev = t.next) {
case 0:
return n({
type: "CONSUMER.REMOVE_SHIPPING_ADDRESS.PENDING"
}),
a = r(),
i = Qa(a),
o = wa(a),
t.next = 6,
Hl.sharedInstance().shippingAddresses.delete(e, {
request_surface: o
});
case 6:
if (s = t.sent,
u = {
shipping_address_id: e,
request_id: s.requestId,
default_integration: i
},
"error" !== s.type) {
t.next = 12;
break
}
return Jl.log("link.shipping_address.delete.error", (0,
b.Z)((0,
b.Z)({}, u), {}, {
error: s.error
})),
n({
type: "CONSUMER.REMOVE_SHIPPING_ADDRESS.ERROR",
error: s.error
}),
t.abrupt("return");
case 12:
l = $c(a).filter((function(t) {
return t.id !== e
}
)),
Jl.log("link.shipping_address.delete.success", u),
n({
type: "CONSUMER.REMOVE_SHIPPING_ADDRESS.SUCCESS",
id: e,
remainingShippingAddresses: l
});
case 15:
case "end":
return t.stop()
}
}
), t)
}
)));
return function(e, n) {
return t.apply(this, arguments)
}
}()
}(n));
case "REMOVE_PAYMENT_DETAILS":
var r = t.id;
return e(Qm(r));
case "START_VERIFICATION":
var a = t.verificationType
, i = t.mobilePhone
, o = t.mobilePhoneCountry;
return e(Um(a, i, o));
case "SET_AUTH_SESSION_STORAGE":
return e(Rm);
case "UPDATE_PAYMENT_DETAILS":
var s = t.paymentDetails
, u = t.cardDetails
, l = t.billingDetails
, c = t.nickname;
return e(Gm(s, u, l, !0, c));
case "PAYMENT.DETACH_SAVED_PAYMENT_METHOD":
var d = t.id
, p = t.pmType;
return e((_ = d,
y = p,
function(e, t) {
var n = t()
, r = oi(n)
, a = r.customerSession.apiKey
, i = n.config
, o = i.session
, s = i.deferredIntent
, u = i.customerSessionClientSecret
, l = i.locale
, c = i.apiKey
, d = i.stripeAccount
, p = i.stripeVersion
, m = i.parentOrigin
, f = i.betas
, h = i.paymentUserAgentSuffix
, v = i.stripeJsId
, S = i.customPaymentMethods;
return e({
type: "PAYMENT.DETACH_SAVED_PAYMENT_METHOD.PENDING"
}),
gb({
ephemeralKey: a,
paymentMethodId: _,
paymentMethodType: y,
state: n,
request: function(e) {
return Ol.paymentMethods.detach({
id: e,
ephemeralKey: a,
stripeVersion: i.stripeVersion || hb
})
},
onError: function(t) {
e({
type: "PAYMENT.DETACH_SAVED_PAYMENT_METHOD.ERROR",
error: t
})
},
onSuccess: function() {
iy.createAndParse({
authentication: {
key: c,
_stripe_account: d,
_stripe_version: p
},
betas: f,
clientSecret: null == o ? void 0 : o.parsedClientSecret,
currency: null,
customerOptions: null,
customerSessionClientSecret: u,
customPaymentMethods: S,
deferredIntent: s,
existingElementsSessionId: null == o ? void 0 : o.elementsSessionId,
locale: l,
paymentUserAgentSuffix: h,
referrer: m,
stripeJsId: v
}).then((function(e) {
var t = (0,
g.Z)(e, 1)[0];
return sf(t, l, {
logger: null
})
}
)).then((function(t) {
var a;
if (i.session) {
var o = r.paymentMethods.filter((function(e) {
return e.id !== _
}
))
, s = "error" !== t.type ? {
externalPaymentMethodTypes: i.externalPaymentMethodTypes,
session: t.object
} : {
externalPaymentMethodTypes: i.externalPaymentMethodTypes,
session: (0,
b.Z)((0,
b.Z)({}, i.session), {}, {
customer: (0,
b.Z)((0,
b.Z)({}, r), {}, {
paymentMethods: o
})
})
};
e({
type: "CONFIG.ASYNC_UPDATE_RECEIVED",
config: s,
prevSession: i.session,
consumerSession: null !== (a = n.consumer.consumerSession) && void 0 !== a ? a : void 0,
savedPaymentMethod: {
isSelectingSavedPayment: o.length > 1,
removingSavedPayment: null
},
elementsState: n
})
}
}
))
}
})
}
));
case "PAYMENT.UPDATE_SAVED_PAYMENT_METHOD":
var m = t.paymentMethod
, f = t.cardDetails
, h = t.billingDetails;
return "card" === m.type ? e(Cb({
paymentMethod: m,
cardDetails: f,
billingDetails: h
})) : e(Cb({
paymentMethod: m
}));
case "ADDRESS.UPDATE_BILLING_DETAILS":
return e(function(e, t, n) {
return function() {
var r = (0,
k.Z)((0,
S.Z)().mark((function r(a, i) {
var o, s, u, l;
return (0,
S.Z)().wrap((function(r) {
for (; ; )
switch (r.prev = r.next) {
case 0:
return o = i(),
s = oi(o),
u = s.customerSession.apiKey,
l = o.config,
a({
type: "ADDRESS.UPDATE_BILLING_DETAILS.PENDING",
mode: "billing"
}),
r.abrupt("return", gb({
ephemeralKey: u,
paymentMethodId: e,
paymentMethodType: n,
state: o,
request: function(e) {
return Ol.paymentMethods.update({
id: e,
ephemeralKey: u,
stripeVersion: l.stripeVersion || hb,
data: {
billing_details: t
},
log: yb.log,
key: l.apiKey
})
},
onError: function(e) {
a({
type: "ADDRESS.UPDATE_BILLING_DETAILS.ERROR",
mode: "billing",
error: e
})
},
onSuccess: function(t) {
a({
type: "ADDRESS.UPDATE_BILLING_DETAILS.SUCCESS",
mode: "billing",
billingDetails: null == t ? void 0 : t.billing_details,
id: e
})
}
}));
case 6:
case "end":
return r.stop()
}
}
), r)
}
)));
return function(e, t) {
return r.apply(this, arguments)
}
}()
}(t.id, t.billingDetails, t.paymentMethodType));
case "LAE_PARTIAL_LOGOUT":
return e(Ym);
default:
return (0,
P.Rz)(t)
}
var _, y, v, C, E
}
}
}, Zb = function(e) {
return function() {
return function(t) {
return function(n) {
if ("function" == typeof n)
return t(n);
var r = function(e) {
return "WRAPPED_ACTION" === e.type ? e : {
type: "WRAPPED_ACTION",
action: e,
nonce: null,
count: null
}
}(n);
return e(r),
t(r.action)
}
}
}
}, Ab = c, Mb = function(e) {
var t = e.config
, n = e.dispatchToGroup
, r = e.isPersistentConsumerSessionPending
, a = [Zb(n), Eb, lg]
, i = [d.apply(void 0, a)]
, o = Ab.apply(void 0, i);
return u(function(e, t) {
return l({
config: (_ = e,
function() {
var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : y || _
, t = arguments.length > 1 ? arguments[1] : void 0;
switch (t.type) {
case "CONFIG.ASYNC_UPDATE_RECEIVED":
case "CONFIG.SYNC_UPDATE_RECEIVED":
return (0,
b.Z)((0,
b.Z)({}, e), t.config);
case "ADDRESS.UPDATE_BILLING_DETAILS.SUCCESS":
var n = t.billingDetails
, r = t.id;
if (!e.session || !e.session.customer || !n)
return e;
var a = e.session.customer.paymentMethods.map((function(e) {
return e.id === r ? (0,
b.Z)((0,
b.Z)({}, e), {}, {
billing_details: n
}) : e
}
));
return (0,
b.Z)((0,
b.Z)({}, e), {}, {
session: (0,
b.Z)((0,
b.Z)({}, e.session), {}, {
customer: (0,
b.Z)((0,
b.Z)({}, e.session.customer), {}, {
paymentMethods: a
})
})
});
case "CONFIG.ELEMENT_MOUNTED":
var i = (0,
b.Z)({}, e.mounted)
, o = e.mounted[t.element]
, s = !1 === (null == o ? void 0 : o.internal) ? o.internal : !!t.mountedInternal;
return i[t.element] = {
internal: s
},
t.mode && (i[t.element].mode = (0,
b.Z)((0,
b.Z)({}, null == o ? void 0 : o.mode), {}, (0,
v.Z)({}, t.mode, !0))),
(0,
b.Z)((0,
b.Z)({}, e), {}, {
mounted: i
});
case "CONFIG.ELEMENT_UNMOUNTED":
var u, l = null;
return t.mode && (l = (0,
b.Z)((0,
b.Z)({}, e.mounted[t.element]), {}, {
mode: (0,
b.Z)((0,
b.Z)({}, null === (u = e.mounted[t.element]) || void 0 === u ? void 0 : u.mode), {}, (0,
v.Z)({}, t.mode, !1))
})),
(0,
b.Z)((0,
b.Z)({}, e), {}, {
mounted: (0,
b.Z)((0,
b.Z)({}, e.mounted), {}, (0,
v.Z)({}, t.element, l))
});
case "CONFIG.UPDATE_MERCHANT_PAGE_PROPERTIES":
return (0,
b.Z)((0,
b.Z)({}, e), {}, {
merchantPageProperties: t.merchantPageProperties
});
case "CONFIG.MIDS_CHANGED":
return (0,
b.Z)((0,
b.Z)({}, e), {}, {
mids: t.mids
});
case "CURRENCY_SELECTOR.SELECT_CURRENCY":
var c;
return (0,
b.Z)((0,
b.Z)({}, e), {}, {
session: (0,
b.Z)((0,
b.Z)({}, e.session), {}, {
adaptivePricing: (0,
b.Z)((0,
b.Z)({}, null === (c = e.session) || void 0 === c ? void 0 : c.adaptivePricing), {}, {
activeCurrency: t.currency
})
})
});
default:
return e
}
}
),
authenticationElement: pa(da),
consumer: fg((0,
b.Z)((0,
b.Z)({}, dg), {}, {
isPersistentConsumerSessionPending: t
})),
paymentElement: Bg(Cg(e.session)),
addressElement: ep((n = e.session,
u = null == n || null === (r = n.customerInfo) || void 0 === r ? void 0 : r.shipping,
c = u && Va(u) ? {
mode: "customer",
id: Hd
} : null,
d = (null == u || null === (a = u.address) || void 0 === a ? void 0 : a.country) || (null == n ? void 0 : n.detectedCountryCode) || Qr(),
p = c ? null == u ? void 0 : u.name : "",
m = (0,
b.Z)((0,
b.Z)({}, Wd), {}, {
countryCode: d,
selectedSavedAddress: c,
form: Xd(d, p)
}),
f = null != n && null !== (i = n.customer) && void 0 !== i && null !== (o = i.paymentMethods) && void 0 !== o && o.length ? {
mode: "customer",
id: Yd
} : null,
h = (0,
b.Z)((0,
b.Z)({}, Wd), {}, {
countryCode: d,
form: Xd(d, p),
selectedSavedAddress: f
}),
s = {},
(0,
v.Z)(s, Dd, m),
(0,
v.Z)(s, Ud, h),
s)),
expressCheckoutElement: mb(ib(e), void 0),
currencySelectorElement: fb((e.session,
{
initialized: !1,
isRtl: !1,
options: {
__customCheckout: null
},
localCurrency: "usd"
}))
});
var n, r, a, i, o, s, u, c, d, p, m, f, h, _, y
}(t, r), o)
}, Pb = n(56274).Promise, xb = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o, s, u, l, c, d, p, m, f, h, _, y, v, C, E, Z, A, M, P, x, I, w, O, L, D, U, j, B, F;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return r = n.req,
a = n.prefetchedResponse,
i = t.apiClient,
o = t.integrationMetadata,
s = t.linkApiClient,
u = t.elementsStores,
l = t.elementsGroupManager,
c = t.frameHub,
d = t.logger,
p = r.clientSecret,
m = r.customerSessionClientSecret,
f = r.deferredIntent,
h = r.onBehalfOf,
_ = r.customerOptions,
y = r.currency,
v = r.locale,
C = void 0 === v ? "auto" : v,
E = r.groupId,
Z = r.appearance,
A = void 0 === Z ? {} : Z,
M = r.loader,
P = r.externalPaymentMethodTypes,
x = r.customPaymentMethods,
I = r.paymentMethodCreation,
w = r.disallowedCardBrands,
O = r.allowedCardBrands,
L = r.syncAddressCheckbox,
D = r.elementsInitSource,
U = r.mids,
j = i.getAuthenticationParams(),
(B = p || f) && s.preloadStoredCredentials(),
F = B ? iy.singleFlightCreateAndParse({
authentication: j,
betas: o.betas,
clientSecret: p,
currency: y,
customPaymentMethods: x,
deferredIntent: f,
customerOptions: _,
customerSessionClientSecret: m,
locale: C,
paymentUserAgentSuffix: o.paymentUserAgentSurfaceContextSuffix,
referrer: o.referrer,
stripeJsId: o.stripeJsId,
topOriginForCrossOriginFrame: o.topOriginForCrossOriginFrame,
elementsInitSource: D
}, a ? Pb.resolve(a) : void 0).then((function(e) {
var n = (0,
g.Z)(e, 2)
, r = n[0]
, a = n[1];
return yy(t, p, r, a)
}
)).catch((function(e) {
return i.handleFetchErrorTagged(ke.BL, e, o.resolveLocale(C))
}
)) : Pb.resolve({
type: "object",
object: null
}),
e.abrupt("return", F.then(function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
var n, a, _, y, v, g, Z, j, B, F, G, q, K, V, z;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
if ("error" !== t.type) {
e.next = 3;
break
}
return u.error(E, t.error),
e.abrupt("return");
case 3:
g = (0,
mn.Nj)(C),
Z = (0,
N.uN)(o.betas, N.M4.payment_element_beta_1),
j = Fv(A, "stripe.elements()", Z),
B = j.config,
j.warnings.forEach((function(e) {
return d.warn(e)
}
)),
F = t.object,
G = (null == F ? void 0 : F.livemode) || !!(0,
R.cx)(i.getApiKey()),
m && Kv(null == f ? void 0 : f.mode, null == F ? void 0 : F.featureFlags),
qv({
allowedCardBrands: r.allowedCardBrands,
disallowedCardBrands: r.disallowedCardBrands
}, {
merchantCountry: null == F ? void 0 : F.merchantInfo.countryCode,
filterByAllowingBrands: null == F || null === (n = F.filterCards) || void 0 === n ? void 0 : n.filterByAllowingBrands,
filterByDisallowingBrands: null == F || null === (a = F.filterCards) || void 0 === a ? void 0 : a.filterByDisallowingBrands
}, o.betas),
Jv(d.warn, P, null == F ? void 0 : F.featureFlags, null == F ? void 0 : F.orderedPaymentMethodTypesAndWallets),
q = {
session: F,
deferredIntent: f,
onBehalfOf: h,
customerSessionClientSecret: m,
appearance: B,
parentOrigin: null !== (_ = null === (y = (0,
T.Ds)(o.referrer)) || void 0 === y ? void 0 : y.origin) && void 0 !== _ ? _ : "",
locale: g,
rawLocale: C || "auto",
mounted: $v,
livemode: G,
loader: M,
paymentMethodCreation: I,
externalPaymentMethodTypes: Wv(P, null == F ? void 0 : F.featureFlags, null == F ? void 0 : F.orderedPaymentMethodTypesAndWallets),
customPaymentMethods: x,
blockedCardBrands: (0,
N.uN)(o.betas, N.M4.blocked_card_brands_beta_2) ? tg(O, w) : [],
paymentUserAgentSuffix: null !== (v = o.paymentUserAgentSurfaceContextSuffix) && void 0 !== v ? v : null,
syncAddressCheckbox: L,
elementsInitSource: D
},
K = function(e) {
return function() {
var t = (0,
k.Z)((0,
S.Z)().mark((function t(n) {
var r, a, i;
return (0,
S.Z)().wrap((function(t) {
for (; ; )
switch (t.prev = t.next) {
case 0:
if (r = c.getGroup(e),
a = l.elementsActionCounters[e],
i = (0,
b.Z)((0,
b.Z)({}, n), {}, {
count: a
}),
l.elementsActionCounters[e] += 1,
!u.has(e) || !r) {
t.next = 8;
break
}
return t.next = 7,
u.getForExistingGroup(e, "sendElementsAction");
case 7:
c.sendGroupMessage(e, {
action: "stripe-elements-dispatch",
payload: i
}, {
types: Xv
});
case 8:
case "end":
return t.stop()
}
}
), t)
}
)));
return function(e) {
return t.apply(this, arguments)
}
}()
}
,
V = Mb({
config: (0,
b.Z)((0,
b.Z)({}, q), {}, {
apiKey: i.getApiKey(),
betas: o.betas,
stripeAccount: i.getStripeAccount() || null,
stripeVersion: i.getApiVersion() || null,
stripeJsId: o.stripeJsId,
mids: null != U ? U : null
}),
dispatchToGroup: K(E),
isPersistentConsumerSessionPending: !!F
}),
e_(V.getState()) && Vv({
deferredIntentMode: null == f ? void 0 : f.mode,
clientSecretType: null == p ? void 0 : p.type,
setupFutureUsage: (null == F ? void 0 : F.setupFutureUsage) || (null == f ? void 0 : f.setup_future_usage),
betas: o.betas,
featureFlags: null == F ? void 0 : F.featureFlags
}),
l.elementsActionCounters[E] = 0,
u.add(E, V),
l.elementsInitialState[E] = V.getState(),
z = Yc(V.getState()),
V.subscribe((function() {
var e = Yc(V.getState());
e && !z && c.sendMessageToParent({
action: "stripe-frame-event",
payload: {
event: "elements-link-login",
data: {}
}
}),
z = e
}
)),
F && (d.log("link.attempt_log_in.store_elements_group.start"),
s.prewarmLookupWithStoredCredentials({
requestSurface: wa(V.getState()),
sessionId: o.stripeJsId,
transactionContext: ii(V.getState()),
supportedPaymentDetailsTypes: qc(V.getState())
}));
case 22:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t) {
return e.apply(this, arguments)
}
}()));
case 8:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), Ib = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o, s, u, l;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
if (r = t.frameHub,
a = t.elementsStores,
i = n.action,
o = n.frameId,
r.doesFrameExist(o)) {
e.next = 4;
break
}
throw new Error("Could not find expected elements frame");
case 4:
if (s = r.getFrameGroup(o)) {
e.next = 7;
break
}
throw new Error("Could not find expected elements group");
case 7:
return e.next = 9,
a.getForDeferredGroup(s);
case 9:
if (u = e.sent,
l = u.store,
!u.error) {
e.next = 14;
break
}
return e.abrupt("return", null);
case 14:
return e.abrupt("return", l.dispatch(i));
case 15:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), Nb = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o, s, u, l, c;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
if (r = t.frameHub,
a = t.elementsStores,
i = t.elementsGroupManager,
o = n.frameId,
r.doesFrameExist(o)) {
e.next = 4;
break
}
throw new Error("Could not find expected elements frame");
case 4:
if (s = r.getFrameGroup(o)) {
e.next = 7;
break
}
throw new Error("Could not find expected elements group");
case 7:
return e.next = 9,
i.waitForPendingElementsUpdates(s);
case 9:
return e.next = 11,
a.getForDeferredGroup(s);
case 11:
if (u = e.sent,
l = u.store,
!(c = u.error)) {
e.next = 16;
break
}
return e.abrupt("return", {
type: "error",
error: c
});
case 16:
return e.abrupt("return", {
type: "object",
currentState: l.getState(),
initialState: i.elementsInitialState[s],
initialActionCount: i.elementsActionCounters[s]
});
case 17:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), wb = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o, s, u, l, c, d, p, m, f, h, _, y, v, b, C, E;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return r = t.apiClient,
a = t.integrationMetadata,
i = t.elementsStores,
o = t.elementsGroupManager,
s = t.outerInitiatedActions,
u = n.clientSecret,
l = n.customerOptions,
c = n.customerSessionClientSecret,
d = n.deferredIntent,
p = n.locale,
m = void 0 === p ? "auto" : p,
f = n.groupId,
h = n.existingElementsSessionId,
_ = n.currency,
y = n.customPaymentMethods,
v = n.elementsInitSource,
b = n.adaptivePricing,
C = o.retrieveLatestElementsSession(f, {
authentication: r.getAuthenticationParams(),
betas: a.betas,
clientSecret: u,
currency: _,
deferredIntent: d,
existingElementsSessionId: h,
customerOptions: l,
customerSessionClientSecret: c,
customPaymentMethods: y,
locale: m,
paymentUserAgentSuffix: a.paymentUserAgentSurfaceContextSuffix,
referrer: a.referrer,
stripeJsId: a.stripeJsId,
topOriginForCrossOriginFrame: a.topOriginForCrossOriginFrame,
elementsInitSource: v,
adaptivePricing: b
}),
"fetch_updates",
E = (0,
mn.jR)(m || "auto"),
e.abrupt("return", C.then((function(e) {
var n = (0,
g.Z)(e, 2)
, r = n[0]
, a = n[1];
return yy(t, u, r, a)
}
)).catch((function(e) {
return r.handleFetchErrorTagged(ke.BL, e, E)
}
)).then(function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
var n, r, a, o, u, l, c;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
if ("error" !== t.type) {
e.next = 2;
break
}
return e.abrupt("return", t);
case 2:
if (!t.object.parsedClientSecret) {
e.next = 7;
break
}
if (-1 === ["abandoned", "failed", "canceled", "processing", "succeeded"].indexOf(t.object.objectStatus)) {
e.next = 7;
break
}
return n = {
extra_fields: {
status: t.object.objectStatus
},
code: "fetch_updates.unexpected_status"
},
e.abrupt("return", s.localizeError(n).then((function(e) {
var n = e.error;
return n.message = n.message.replace("{object}", {
PAYMENT_INTENT: "PaymentIntent",
SETUP_INTENT: "SetupIntent"
}[t.object.parsedClientSecret.type]),
{
type: "error",
error: n,
locale: E
}
}
)));
case 7:
return e.next = 9,
i.getForDeferredGroup(f);
case 9:
if (r = e.sent,
(a = r.store) && t) {
u = a.getState(),
l = {
session: t.object,
externalPaymentMethodTypes: u.config.externalPaymentMethodTypes
},
c = !1;
try {
c = Wa(u)
} catch (e) {
c = !1
}
a.dispatch({
type: "CONFIG.ASYNC_UPDATE_RECEIVED",
config: l,
prevSession: u.config.session,
consumerSession: null !== (o = u.consumer.consumerSession) && void 0 !== o ? o : void 0,
elementsState: u,
isLinkPassthroughAlreadyEnabled: c
})
}
return e.abrupt("return", void 0);
case 13:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t) {
return e.apply(this, arguments)
}
}()).catch((function(e) {
return r.handleFetchErrorTagged("fetch_updates", e, E)
}
)));
case 6:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), Tb = n(56274).Promise, Ob = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o, s, u, l, c, d, p, m, f, h, _, y, v, g, b, C, E, Z;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return a = t.frameHub,
i = t.elementsStores,
o = t.elementsGroupManager,
s = t.integrationMetadata,
u = t.logger,
l = t.outerInitiatedActions,
c = n.customerOptions,
d = n.customerSessionClientSecret,
p = n.clientSecret,
m = n.deferredIntent,
f = n.locale,
h = n.appearance,
_ = n.groupId,
y = n.stripeUserCredentials,
v = n.currency,
g = n.onBehalfOf,
b = n.adaptivePricing,
C = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e() {
var t, r, o, k, C, E, Z, A, M, P, x, w, T, R, D, U, j, B, F, G;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return f && a.sendGroupMessage(_, {
action: "stripe-controller-update",
payload: {
locale: f
}
}),
e.next = 3,
i.getForDeferredGroup(_);
case 3:
if (t = e.sent,
r = t.store,
!t.error) {
e.next = 8;
break
}
return e.abrupt("return", void 0);
case 8:
if (o = {},
k = r.getState(),
f && (o.rawLocale = f,
o.locale = (0,
mn.jR)(f),
u.log("locale_updated", {
previous_locale: Ra(k)
})),
h && (C = (0,
N.uN)(s.betas, N.M4.payment_element_beta_1),
E = Fv(h, C ? "element.update()" : "elements.update()", C),
Z = E.config,
E.warnings.forEach((function(e) {
return u.warn(e)
}
)),
o.appearance = Z),
A = Tb.resolve(),
M = Ia(k),
P = k.config.session,
m && (o.deferredIntent = m),
g && (o.onBehalfOf = g),
void 0 !== d && (o.customerSessionClientSecret = d),
x = k.config,
(d || x.customerSessionClientSecret) && Kv(null !== (w = null == m ? void 0 : m.mode) && void 0 !== w ? w : null === (T = x.deferredIntent) || void 0 === T ? void 0 : T.mode, null == P ? void 0 : P.featureFlags),
y && (o.apiKey = y.publishableKey,
o.stripeAccount = y.stripeAccount,
o.stripeVersion = y.apiVersion),
R = !!Object.keys((0,
O.ei)(n, ["clientSecret", "currency", "customerOptions", "customerSessionClientSecret", "deferredIntent", "onBehalfOf", "stripeUserCredentials", "adaptivePricing"])).length,
void 0 === g) {
e.next = 36;
break
}
if (D = {
isReady: !0,
types: [L.NC.CARD_ELEMENT_COMBINED, L.NC.CARD_ELEMENT_SPLIT]
},
U = a.getGroupFrames(_, D),
j = (null == k ? void 0 : k.config.onBehalfOf) || null,
B = j !== (g || null),
!U.length || !B) {
e.next = 36;
break
}
if (G = "Updating onBehalfOf on the Elements group is not supported for the Card Element.",
!(null != m && m.mode || null !== (F = x.deferredIntent) && void 0 !== F && F.mode)) {
e.next = 34;
break
}
u.warn(G),
e.next = 36;
break;
case 34:
throw U.forEach((function(e) {
a.sendMessageToFrame(e, {
action: "stripe-self-destruct",
payload: null
})
}
)),
new I.No(G);
case 36:
return R && (u.log("session_updated"),
A = l.fetchUpdates({
customerOptions: c,
customerSessionClientSecret: d,
clientSecret: p,
deferredIntent: m,
locale: f,
groupId: _,
existingElementsSessionId: M,
currency: v,
customPaymentMethods: null == k ? void 0 : k.config.customPaymentMethods,
elementsInitSource: null == k ? void 0 : k.config.elementsInitSource,
adaptivePricing: b
}).then((function(e) {
e && "error" === e.type && console.error(e.error.message)
}
))),
r.dispatch({
type: "CONFIG.SYNC_UPDATE_RECEIVED",
config: o
}),
e.abrupt("return", A);
case 39:
case "end":
return e.stop()
}
}
), e)
}
)));
return function() {
return e.apply(this, arguments)
}
}(),
E = null !== (r = o.pendingElementsUpdates.get(_)) && void 0 !== r ? r : new Set,
o.pendingElementsUpdates.set(_, E),
Z = C().then((function() {
E.delete(Z)
}
)),
E.add(Z),
e.abrupt("return", Z);
case 8:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), Rb = (og = {},
(0,
v.Z)(og, V.Yj.cardNumber, {
required: !0
}),
(0,
v.Z)(og, V.Yj.cardExpiry, {
required: !0
}),
(0,
v.Z)(og, V.Yj.cardCvc, {
required: !0
}),
(0,
v.Z)(og, V.Yj.postalCode, {
required: !1
}),
og), Lb = (0,
E.Z)((function e(t) {
var n = this;
(0,
C.Z)(this, e),
this._updateTimeout = null,
this.handleSplitCardMountUnmount = function(e) {
var t = e.groupId;
n._updateMountedElementsReference(e);
var r = n.getChangesSinceLastEmit(t);
if ("UNMOUNTED" === (null == r ? void 0 : r.postalMountedState) || "UNMOUNTED" === (null == r ? void 0 : r.requiredElementsMountedState)) {
var a = {};
return "UNMOUNTED" === (null == r ? void 0 : r.postalMountedState) && (a.postalMountedState = "UNMOUNTED"),
"UNMOUNTED" === (null == r ? void 0 : r.requiredElementsMountedState) && (a.requiredElementsMountedState = "UNMOUNTED"),
n.emitSplitCardMessage(a, t),
void n.debounceSplitCardGroupUpdate(t)
}
n._updateTimeout ? n.debounceSplitCardGroupUpdate(t) : n.emitSplitCardMessage(r, t)
}
,
this.getChangesSinceLastEmit = function(e) {
var t = n.getSplitCardState(e)
, r = {};
return n._lastEmittedState.postalMountedState !== t.postalMountedState && (r.postalMountedState = t.postalMountedState),
n._lastEmittedState.requiredElementsMountedState !== t.requiredElementsMountedState && (r.requiredElementsMountedState = t.requiredElementsMountedState),
r
}
,
this.getSplitCardState = function(e) {
return {
requiredElementsMountedState: Object.keys(Rb).filter((function(e) {
return Rb[e].required
}
)).every((function(t) {
return !!n._mountedElements[e][t]
}
)) ? "MOUNTED" : "UNMOUNTED",
postalMountedState: n._mountedElements[e].postalCode ? "MOUNTED" : "UNMOUNTED"
}
}
,
this.emitSplitCardMessage = function(e, t) {
var r = n._context.frameHub;
(null != e && e.requiredElementsMountedState || null != e && e.postalMountedState) && (n._lastEmittedState = (0,
b.Z)((0,
b.Z)({}, n._lastEmittedState), e),
r.getGroupFrames(t, {
types: [L.NC.CARD_ELEMENT_SPLIT]
}).forEach((function(t) {
if ("UNMOUNTED" !== e.requiredElementsMountedState || r.isFrameReady(t)) {
var n = {
action: "stripe-split-card-group-update",
payload: e
};
r.sendMessageToFrame(t, n)
}
}
)))
}
,
this.debounceSplitCardGroupUpdate = function(e) {
n._updateTimeout && clearTimeout(n._updateTimeout),
n._updateTimeout = setTimeout((function() {
n._updateTimeout = null;
var t = n.getChangesSinceLastEmit(e);
n.emitSplitCardMessage(t, e)
}
), 500)
}
,
this._updateMountedElementsReference = function(e) {
var t, r = e.groupId, a = e.elementName, i = e.action;
(t = n._mountedElements)[r] || (t[r] = {}),
"MOUNT" === i && (n._mountedElements[r][a] = e.frameId),
"UNMOUNT" === i && delete n._mountedElements[r][a]
}
,
this._updateTimeout = null,
this._lastEmittedState = {
postalMountedState: "UNMOUNTED",
requiredElementsMountedState: "UNMOUNTED"
},
this._context = t,
this._mountedElements = {}
}
)), Db = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o, s;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
r = t.cardElementState,
a = t.frameHub,
i = n.elementName,
o = n.groupId,
s = n.frameId,
i in Rb && (r.splitCardGroup || (r.splitCardGroup = new Lb({
frameHub: a
})),
r.splitCardGroup.handleSplitCardMountUnmount({
action: "MOUNT",
groupId: o,
elementName: i,
frameId: s
}));
case 3:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), Ub = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o, s, u, l, c, d, p, m, f;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
if (r = t.cache,
a = t.elementsStores,
i = t.cardElementState,
o = t.frameHub,
s = n.elementName,
u = n.groupId,
l = n.frameId,
c = n.mode,
(d = r.cardMetadataManagerCache.get(l)) && d.fetchingCardMetadata(""),
o.getGroup(u)) {
e.next = 7;
break
}
return e.abrupt("return");
case 7:
if (!(s in Qv) || !a.has(u)) {
e.next = 13;
break
}
return e.next = 10,
a.getForExistingGroup(u, "elementUnmounted");
case 10:
p = e.sent,
null == (m = p.store) || m.dispatch({
type: "CONFIG.ELEMENT_UNMOUNTED",
element: s,
mode: c
});
case 13:
s in Rb && (null === (f = i.splitCardGroup) || void 0 === f || f.handleSplitCardMountUnmount({
action: "UNMOUNT",
groupId: u,
elementName: s,
frameId: l
}));
case 14:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), jb = function(e) {
if ((0,
x.Kn)(e.card)) {
var t = e.card.number || e.card.cvc || e.card.exp_month || e.card.exp_year;
return t && He.log("create_source_card_data", {
number: !!e.card.number,
cvc: !!e.card.cvc,
exp_month: !!e.card.exp_month,
exp_year: !!e.card.exp_year
}),
!!t
}
return !1
}, Bb = n(56274).Promise, Fb = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o, s, u, l, c, d, p, m, f, h, _, y, v, g, k, C, E, Z, A, M, P = arguments;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
if (r = !(P.length > 2 && void 0 !== P[2]) || P[2],
t.doesFrameExist(n)) {
e.next = 3;
break
}
throw new I.No("Please use the same instance of `Stripe` you used to create this Element to create your Source or Token.");
case 3:
if (a = t.getFrameGroup(n),
i = t.getFrameType(n),
o = [],
a && r) {
e.next = 10;
break
}
o = [n],
e.next = 15;
break;
case 10:
if (!i) {
e.next = 14;
break
}
o = t.getGroupFrames(a, {
types: [i]
}),
e.next = 15;
break;
case 14:
throw new Error("retrieveElementData called with retrieveSiblingData=true but frameId passed has no associated frame type to query siblings for");
case 15:
return e.next = 17,
Bb.all(o.map((function(e) {
return (0,
Zf.XQ)(t, e)
}
)));
case 17:
if (l = e.sent,
c = {},
d = {},
h = !1,
0 !== l.filter((function(e) {
return e && e.frameId === n
}
)).length) {
e.next = 23;
break
}
throw new I.No("We could not retrieve data from the specified Element.\n Please make sure the Element you are attempting to use is still mounted.");
case 23:
_ = 0;
case 24:
if (!(_ < l.length)) {
e.next = 42;
break
}
if (!(y = l[_])) {
e.next = 39;
break
}
if (v = y.meta,
g = y.value,
k = y.locale,
C = y.element,
E = y.frameId,
Z = y.pastedFields,
A = y.preferredNetwork,
M = y.didMerchantSpecifyNetworkPreference,
v.brand && (p = v.brand),
v.accountHolderType && (m = v.accountHolderType),
E === n && (s = k,
u = C),
A && (f = A),
M && (h = M),
!v.error) {
e.next = 37;
break
}
return e.abrupt("return", {
type: "error",
error: v.error,
locale: v.locale
});
case 37:
c = (0,
O.TS)({}, c, g),
d = (0,
b.Z)((0,
b.Z)({}, d), Z);
case 39:
_ += 1,
e.next = 24;
break;
case 42:
if (s && u) {
e.next = 44;
break
}
throw new Error("Retrieved element for frameId did not include locale or element");
case 44:
return e.abrupt("return", (0,
b.Z)((0,
b.Z)((0,
b.Z)((0,
b.Z)({
type: "data",
value: c,
locale: s,
element: u,
pastedFields: Object.keys(d)
}, p ? {
clientCardBrand: p
} : {}), m ? {
accountHolderType: m
} : {}), f ? {
preferredNetwork: f
} : {}), h ? {
didMerchantSpecifyNetworkPreference: h
} : {}));
case 45:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), Gb = "v2_create_card_payment_method", qb = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o, s, u, l, c, d, p, m, f, h, _, y, v, g, k, C, E, Z, A, P, x, N, w, T, R, L, D, U, j, B, F, q, K, V, z, H;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
if (r = t.apiClient,
a = t.frameHub,
i = t.logger,
o = t.integrationMetadata,
s = t.hcaptchaManager,
u = t.outerActions,
l = n.authToken,
c = n.stripeContext,
d = n.params,
p = n.frameId,
m = n.mids,
!d || !jb(d)) {
e.next = 4;
break
}
throw new I.No("Do not pass raw card data to createV2CardPaymentMethod. Use an Element.");
case 4:
return e.next = 6,
Fb(a, p);
case 6:
if ("error" !== (f = e.sent).type) {
e.next = 9;
break
}
return e.abrupt("return", {
error: f.error
});
case 9:
if (h = f.locale,
_ = f.pastedFields,
y = f.preferredNetwork,
v = f.value,
g = f.element,
k = be((0,
b.Z)({}, v)),
C = k.cardExpiry,
E = k.cardNumber,
Z = k.cardCvc,
A = k.postalCode,
E || C) {
e.next = 13;
break
}
throw new Error("Expected card number and expiry");
case 13:
if (P = C.split(" / "),
x = P[0].trim().replace(/^0+/, ""),
2 === (N = P[1].trim()).length && (N = "20".concat(N)),
w = {
number: Je(E),
exp_month: x,
exp_year: N,
cvc: Z,
billing_details: A ? {
address: {
postal_code: A
}
} : void 0
},
T = o.getPaymentMetadata(g),
R = T.payment_user_agent,
L = T.referrer,
D = null != _ && _.length ? ve(_) : null,
U = y ? {
preferred: y
} : void 0,
j = null,
!(B = s.getSiteKey("elements"))) {
e.next = 28;
break
}
return e.next = 26,
u.getCaptchaToken(B);
case 26:
F = e.sent,
j = {
hcaptcha_token: null == F ? void 0 : F.response
};
case 28:
if (q = {
client_metadata: {
payment_user_agent: R,
referrer: L,
pasted_fields: D,
networks: U,
guid: null == m ? void 0 : m.guid,
muid: null == m ? void 0 : m.muid,
sid: null == m ? void 0 : m.sid,
radar_options: j
}
},
K = (0,
O.TS)(d, w, q),
!(0,
M.Sl)((0,
O.uu)(K, ["billing_details", "address", "postal_code"]))) {
e.next = 32;
break
}
return e.abrupt("return", {
error: G(Ds("card_number_in_postal_code_field", "postal_code"), h).localizedError
});
case 32:
if (!(0,
M.Sl)((0,
O.uu)(K, ["billing_details", "name"]))) {
e.next = 34;
break
}
return e.abrupt("return", {
error: G(Ds("card_number_in_name_field", "name"), h).localizedError
});
case 34:
return e.next = 36,
(0,
Zs.Nv)("payment_methods/cards_internal", "POST", K, {
contentType: "application/json",
withCredentials: !1,
headers: {
Authorization: "Bearer ".concat(l),
"Stripe-Context": c,
"Stripe-Version": r.getApiVersion()
},
priority: "high"
}, {
server: "bapi_v2"
}).then((function(e) {
return sf(e, h, {
logger: i
})
}
)).catch((function(e) {
return r.handleFetchErrorTagged(Gb, e, h)
}
));
case 36:
return V = e.sent,
r.reportFetchResult(Gb, V),
z = V.error,
H = V.object,
e.abrupt("return", z ? {
error: z
} : {
paymentMethod: H
});
case 40:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), Kb = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o, s, u;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return r = t.elementsStores,
a = t.integrationMetadata,
e.next = 3,
r.strictGet(n, "getPaymentUserAgentForPaymentElement");
case 3:
return i = e.sent.getState(),
(o = i.config).deferredIntent ? (s = a.getPaymentUserAgent(ua.JE),
o.deferredIntent.payment_method_types && 0 !== (null === (u = o.deferredIntent.payment_method_types) || void 0 === u ? void 0 : u.length) || (s += "; ".concat(ua.Kf))) : s = a.getPaymentUserAgent(ua.CD),
e.abrupt("return", s);
case 7:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), Vb = function(e) {
switch (e) {
case "apple_pay":
case "google_pay":
case "link_card_brand":
return "card";
default:
return e
}
}, zb = function(e) {
if (e) {
var t = e.type;
return "card" === t ? Hb(e) : "paypal" === t ? Jb(e) : "klarna" === t ? Xb(e) : "rechnung" === t ? Qb(e) : ph(t) ? Wb(e) : void 0
}
}, Hb = function(e) {
var t, n = {
card: {}
};
if ("cvc"in e.data && (n.card.cvc = e.data.cvc),
"installments"in e.data && null !== (t = e.data.installments) && void 0 !== t && t.plan && "string" != typeof e.data.installments.plan && (n.card.installments = {
plan: e.data.installments.plan
}),
0 !== Object.keys(n.card).length)
return n
}, Yb = {
sheet_closed_three_ds: !0
}, Wb = function(e) {
if ("express_checkout_element_session_id"in e.data) {
var t = (0,
b.Z)({
express_checkout_element_session_id: e.data.express_checkout_element_session_id
}, Yb);
return (0,
v.Z)({}, e.type, t)
}
}, Jb = function(e) {
return "order_id"in e.data && null != e.data.order_id ? {
paypal: {
order_id: e.data.order_id
}
} : "express_billing_agreement_id"in e.data && null != e.data.express_billing_agreement_id ? {
paypal: {
express_billing_agreement_id: e.data.express_billing_agreement_id
}
} : void 0
}, Xb = function(e) {
if ("partner_confirmation_token"in e.data)
return {
klarna: {
partner_confirmation_token: e.data.partner_confirmation_token
}
}
}, Qb = function(e) {
if ("risk_correlation_id"in e.data)
return {
rechnung: {
risk_correlation_id: e.data.risk_correlation_id
}
}
}, $b = ["address_zip", "postal_code", "name"], eS = function(e) {
var t = function(e) {
var t = null;
return (0,
O.l2)(e, (function(e, n) {
-1 !== $b.indexOf(e) && "string" == typeof n && (0,
M.Sl)(n) && (t = e)
}
)),
t
}(e);
switch (t) {
case "address_zip":
return {
type: "error",
error: Ds("card_number_in_postal_code_field", "address_zip")
};
case "postal_code":
return {
type: "error",
error: Ds("card_number_in_postal_code_field", "postal_code")
};
case "name":
return {
type: "error",
error: Ds("card_number_in_name_field", "name")
};
default:
return null
}
}, tS = n(74355), nS = n(56274).Promise, rS = "".concat(he.Ay, "card-metadata"), aS = function(e, t) {
return {
account_range_high: "".concat(e, "9999999999"),
account_range_low: "".concat(e, "0000000000"),
country: t,
pan_length: 16,
brand: "VISA",
funding: "CREDIT"
}
}, iS = function(e) {
var t = e.data
, n = t.bin_prefix;
if ((0,
R.lO)(t.key) === R.Kl.test && void 0 !== Sf[n])
return nS.resolve({
type: "object",
object: {
object: "card_metadata_list",
data: [aS(n, Sf[n])]
}
});
if ("string" != typeof n || 6 !== n.length || !function(e) {
var t = !0;
return e.split("").forEach((function(n, r) {
String(parseInt(n, 10)) !== e[r] && (t = !1)
}
)),
t
}(n))
throw new Error("Invalid BIN prefix");
return (0,
pn.h)({
url: rS,
method: "GET",
data: t
}).then((function(e) {
if (200 !== e.status)
return {
type: "error",
error: {
status: e.status
}
};
try {
return {
type: "object",
object: JSON.parse(e.responseText)
}
} catch (t) {
return {
type: "error",
error: {
status: e.status
}
}
}
}
))
}, oS = function() {
function e(t) {
var n, r = this;
(0,
C.Z)(this, e),
this.applePaySession = {
create: this.wrapMethod({
slug: "create_apple_pay_session",
requestFunc: Ol.applePaySession.create,
shouldReport: !0,
authParams: function(e) {
return {
data: (0,
b.Z)({}, e)
}
},
defaultParams: function() {
return {}
}
})
},
this.cardMetadata = {
retrieve: this.wrapMethod({
slug: "retrieve_card_metadata",
requestFunc: iS,
shouldReport: !1,
authParams: function(e) {
return {
data: (0,
b.Z)({}, e)
}
},
defaultParams: function() {
return {}
}
})
},
this.paymentIntents = {
retrieve: this.wrapMethod({
slug: "retrieve_payment_intent",
requestFunc: Ol.paymentIntents.retrieve,
shouldReport: !0,
authParams: function(e) {
return {
data: (0,
b.Z)({}, e)
}
},
defaultParams: function() {
return {}
}
}),
attachLinkAccountSession: this.wrapMethod({
slug: "attach_link_account_session_for_payment",
requestFunc: Ol.paymentIntents.attachLinkAccountSession,
shouldReport: !0,
authParams: function(e) {
return {
data: (0,
b.Z)({}, e)
}
},
defaultParams: function() {
return {}
}
}),
createAcssSession: this.wrapMethod({
slug: "create_acss_debit_session",
requestFunc: Ol.paymentIntents.createAcssSession,
shouldReport: !0,
authParams: function(e) {
return {
data: (0,
b.Z)({}, e)
}
},
defaultParams: function() {
return {}
}
}),
sourceCancel: this.wrapMethod({
slug: "payment_intent_source_cancel",
requestFunc: Ol.paymentIntents.sourceCancel,
shouldReport: !0,
authParams: function(e) {
return {
data: (0,
b.Z)({}, e)
}
},
defaultParams: function() {
return {}
}
}),
cancelChallenge: this.wrapMethod({
slug: "cancel_challenge_captcha",
requestFunc: Ol.paymentIntents.cancelChallenge,
shouldReport: !0,
authParams: function(e) {
return {
data: (0,
b.Z)({}, e)
}
},
defaultParams: function() {
return {}
}
}),
verifyMicrodeposits: this.wrapMethod({
slug: "payment_intent_verify_microdeposits",
requestFunc: Ol.paymentIntents.verifyMicrodeposits,
shouldReport: !0,
authParams: function(e) {
return {
data: (0,
b.Z)({}, e)
}
},
defaultParams: function() {
return {}
}
})
},
this.setupIntents = {
retrieve: this.wrapMethod({
slug: "retrieve_setup_intent",
requestFunc: Ol.setupIntents.retrieve,
shouldReport: !0,
authParams: function(e) {
return {
data: (0,
b.Z)({}, e)
}
},
defaultParams: function() {
return {}
}
}),
attachLinkAccountSession: this.wrapMethod({
slug: "attach_link_account_session_for_setup",
requestFunc: Ol.setupIntents.attachLinkAccountSession,
shouldReport: !0,
authParams: function(e) {
return {
data: (0,
b.Z)({}, e)
}
},
defaultParams: function() {
return {}
}
}),
createAcssSession: this.wrapMethod({
slug: "create_acss_debit_session",
requestFunc: Ol.setupIntents.createAcssSession,
shouldReport: !0,
authParams: function(e) {
return {
data: (0,
b.Z)({}, e)
}
},
defaultParams: function() {
return {}
}
}),
sourceCancel: this.wrapMethod({
slug: "setup_intent_source_cancel",
requestFunc: Ol.setupIntents.sourceCancel,
shouldReport: !0,
authParams: function(e) {
return {
data: (0,
b.Z)({}, e)
}
},
defaultParams: function() {
return {}
}
}),
cancelChallenge: this.wrapMethod({
slug: "cancel_challenge_captcha",
requestFunc: Ol.setupIntents.cancelChallenge,
shouldReport: !0,
authParams: function(e) {
return {
data: (0,
b.Z)({}, e)
}
},
defaultParams: function() {
return {}
}
}),
verifyMicrodeposits: this.wrapMethod({
slug: "setup_intent_verify_microdeposits",
requestFunc: Ol.setupIntents.verifyMicrodeposits,
shouldReport: !0,
authParams: function(e) {
return {
data: (0,
b.Z)({}, e)
}
},
defaultParams: function() {
return {}
}
})
},
this.sources = {
retrieve: this.wrapMethod({
slug: "retrieve_source",
requestFunc: Ol.sources.retrieve,
shouldReport: !0,
authParams: function(e) {
return {
data: (0,
b.Z)({}, e)
}
},
defaultParams: function() {
return {}
}
}),
create: this.wrapMethod({
slug: "create_source",
requestFunc: Ol.sources.create,
shouldReport: !0,
authParams: function(e) {
return {
data: (0,
b.Z)({}, e)
}
},
defaultParams: function() {
return {
data: {
referrer: Ed.getInstance().referrerOrigin
}
}
}
})
},
this.tokens = {
create: this.wrapMethod({
slug: "tokenize",
requestFunc: Ol.tokens.create,
shouldReport: !0,
authParams: function(e) {
return {
data: (0,
b.Z)({}, e)
}
},
defaultParams: function() {
return {
data: (0,
b.Z)((0,
b.Z)({}, r.mids), {}, {
referrer: Ed.getInstance().referrerOrigin,
time_on_page: Ed.getInstance().getTimeOnPage()
})
}
}
})
},
this.confirmationTokens = {
create: this.wrapMethod({
slug: "create_confirmation_token",
requestFunc: Ol.confirmationTokens.create,
shouldReport: !0,
authParams: function(e) {
return {
data: (0,
b.Z)({}, e)
}
},
defaultParams: function() {
return {}
}
}),
createForLink: this.wrapMethod({
slug: "create_confirmation_token",
requestFunc: Hl.sharedInstance().confirmationToken.create,
shouldReport: !0,
authParams: function(e) {
return (0,
b.Z)({}, e)
},
defaultParams: function() {
return {}
}
})
},
this.ephemeralKeyNonces = {
create: this.wrapMethod({
slug: "create_ephemeral_key_nonce",
requestFunc: Ol.ephemeralKeyNonce.create,
shouldReport: !1,
authParams: function(e) {
return {
data: (0,
b.Z)({}, e)
}
},
defaultParams: function() {
return {}
}
})
},
this.radarSessions = {
create: this.wrapMethod({
slug: "create_radar_session",
requestFunc: Ol.radarSessions.create,
shouldReport: !0,
authParams: function(e) {
return {
data: (0,
b.Z)({}, e)
}
},
defaultParams: function() {
return {
data: (0,
b.Z)((0,
b.Z)({}, r.mids), {}, {
referrer: Ed.getInstance().referrerOrigin,
payment_user_agent: Ed.getInstance().getPaymentUserAgent()
})
}
}
})
},
this.threeDSecure2 = {
challengeComplete: this.wrapMethod({
slug: "complete_challenge_3ds2",
requestFunc: Ol.threeDSecure2.challengeComplete,
shouldReport: !0,
authParams: function(e) {
return {
data: (0,
b.Z)({}, e)
}
},
defaultParams: function() {
return {}
}
}),
authenticate: this.wrapMethod({
slug: "authenticate_3ds2",
requestFunc: Ol.threeDSecure2.authenticate,
shouldReport: !0,
authParams: function(e) {
return {
data: (0,
b.Z)({}, e)
}
},
defaultParams: function() {
return {}
}
})
},
this.returnIntents = {
confirm: this.wrapMethod({
slug: "confirm_return_intent",
requestFunc: Ol.returnIntents.confirm,
shouldReport: !0,
authParams: function(e) {
return {
data: (0,
b.Z)({}, e)
}
},
defaultParams: function() {
return {}
}
})
},
this.paypalConfiguration = {
retrieve: this.wrapMethod({
slug: "retrieve_paypal_merchant_id",
requestFunc: Ol.paypalConfiguration.retrieve,
shouldReport: !0,
authParams: function(e) {
return {
data: (0,
b.Z)({}, e)
}
},
defaultParams: function() {
return {}
}
})
},
this.paymentPages = {
create: this.wrapMethod({
slug: "create_payment_page",
requestFunc: Ol.paymentPages.create,
shouldReport: !1,
authParams: function(e) {
return {
data: (0,
b.Z)({}, e)
}
},
defaultParams: function() {
return {
data: (0,
b.Z)((0,
b.Z)({}, r.mids), {}, {
referrer: Ed.getInstance().referrer
})
}
}
}),
init: this.wrapMethod({
slug: "init_payment_page",
requestFunc: Ol.paymentPages.init,
shouldReport: !0,
authParams: function(e) {
return {
data: (0,
b.Z)({}, e)
}
},
defaultParams: function() {
return {
data: {
browser_locale: Ed.getInstance().resolveLocale() || void 0
}
}
}
}),
update: this.wrapMethod({
slug: "update_payment_page",
requestFunc: Ol.paymentPages.update,
shouldReport: !0,
authParams: function(e) {
return {
data: (0,
b.Z)({}, e)
}
},
defaultParams: function() {
return {}
}
}),
retrieve: this.wrapMethod({
slug: "retrieve_payment_page",
requestFunc: Ol.paymentPages.retrieve,
shouldReport: !0,
authParams: function(e) {
return {
data: (0,
b.Z)({}, e)
}
},
defaultParams: function() {
return {}
}
}),
confirm: this.wrapMethod({
slug: "confirm_payment_page",
requestFunc: Ol.paymentPages.confirm,
shouldReport: !0,
authParams: function(e) {
return {
data: (0,
b.Z)({}, e)
}
},
defaultParams: function() {
return {}
}
})
},
this.captcha = {
verifyChallenge: this.wrapMethod({
slug: "verify_challenge_captcha",
requestFunc: Ol.captcha.verifyChallenge,
shouldReport: !0,
authParams: function(e) {
return {
data: (0,
b.Z)({}, e)
}
},
defaultParams: function() {
return {}
}
})
},
this.issuing = {
retrieveCard: this.wrapMethod({
slug: "retrieve_issuing_card",
requestFunc: Ol.issuing.retrieveCard,
shouldReport: !1,
authParams: function() {
return {}
},
defaultParams: function() {
return {}
}
})
},
this.linkWalletConfig = {
retrieve: this.wrapMethod({
slug: "retrieve_link_config",
requestFunc: Hl.sharedInstance().walletConfig.retrieve,
shouldReport: !0,
authParams: function() {
return {}
},
defaultParams: function() {
return {}
}
})
},
this.cardDetailsRecollection = {
completeChallenge: this.wrapMethod({
slug: "complete_challenge_card_details_recollection",
requestFunc: Ol.cardDetailsRecollection.completeChallenge,
shouldReport: !0,
authParams: function(e) {
return {
data: (0,
b.Z)({}, e)
}
},
defaultParams: function() {
return {}
}
})
},
this.logger = t.logger,
this.authenticationParams = t.authenticationParams,
this.mids = null !== (n = t.mids) && void 0 !== n ? n : null
}
return (0,
E.Z)(e, [{
key: "setMids",
value: function(e) {
this.mids = e
}
}, {
key: "getMids",
value: function() {
return this.mids
}
}, {
key: "updateAuthenticationParams",
value: function(e) {
this.authenticationParams = e
}
}, {
key: "getAuthenticationParams",
value: function() {
return this.authenticationParams
}
}, {
key: "getApiKey",
value: function() {
return this.authenticationParams.key
}
}, {
key: "getStripeAccount",
value: function() {
var e;
return null !== (e = this.authenticationParams._stripe_account) && void 0 !== e ? e : void 0
}
}, {
key: "getApiVersion",
value: function() {
var e;
return null !== (e = this.authenticationParams._stripe_version) && void 0 !== e ? e : void 0
}
}, {
key: "getCustomAuthForLink",
value: function(e) {
return {
key: e,
_stripe_account: null,
_stripe_version: ke.mj
}
}
}, {
key: "reportFetchResult",
value: function(e, t, n) {
switch (t.type) {
case "error":
this.logger.log("".concat(e, ".server_error"), (0,
b.Z)({
error: (0,
tS.Am)(t.error)
}, n));
break;
case "object":
this.logger.log("".concat(e, ".success"), (0,
b.Z)((0,
b.Z)({}, (r = t.object,
{
object_id: String(r.id),
object_kind: String(r.object),
object_type: String(r.type || void 0),
object_livemode: String(r.livemode)
})), n));
break;
default:
(0,
P.Rz)(t)
}
var r
}
}, {
key: "handleFetchErrorTagged",
value: function(e, t, n) {
if ("NetworkError" === t.name || "FetchError" === t.name)
return this.logger.log("".concat(e, ".network_error"), {
error: t
}),
sf({
type: "error",
error: {
type: "api_connection_error",
extra_fields: {
name: t.name
}
}
}, n, {
logger: this.logger
});
throw this.logger.log("".concat(e, ".unknown_error"), {
error: t
}),
t
}
}, {
key: "wrapMethod",
value: function(e) {
var t = this;
return function() {
var n = (0,
k.Z)((0,
S.Z)().mark((function n(r) {
var a, i, o, s, u, l, c, d, p, m, f;
return (0,
S.Z)().wrap((function(n) {
for (; ; )
switch (n.prev = n.next) {
case 0:
return o = Ed.getInstance().resolveLocale(null === (a = r.options) || void 0 === a ? void 0 : a.localeOverride),
s = r.authData,
u = (null === (i = r.options) || void 0 === i ? void 0 : i.slugOverride) || e.slug,
n.prev = 3,
delete (c = (0,
_.Z)({}, r)).options,
delete c.authData,
d = e.defaultParams(),
p = (0,
O.PM)(d, c, e.authParams(null != s ? s : t.authenticationParams)),
m = r.options && "loggerExtras"in r.options && r.options.loggerExtras ? r.options.loggerExtras : void 0,
n.next = 12,
void 0,
eS(p) || e.requestFunc(p);
case 12:
return f = n.sent,
e.shouldReport && t.reportFetchResult(u, f, m),
n.abrupt("return", sf(f, o, (0,
b.Z)({
logger: t.logger
}, null !== (l = r.options) && void 0 !== l && l.renderLocalizedFlag ? {
renderLocalizedFlag: !0
} : {})));
case 17:
return n.prev = 17,
n.t0 = n.catch(3),
n.abrupt("return", t.handleFetchErrorTagged(u, n.t0, o));
case 20:
case "end":
return n.stop()
}
}
), n, null, [[3, 17]])
}
)));
return function(e) {
return n.apply(this, arguments)
}
}()
}
}]),
e
}(), sS = (0,
E.Z)((function e() {
(0,
C.Z)(this, e),
this.linkConfigs = {
linkInCardPaymentData: null,
linkPaymentError: null
}
}
)), uS = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o, s, u;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return r = t.apiClient,
a = n.threeDS2Source,
i = n.data,
o = n.publishableKey,
s = n.recordFinalCres,
u = o ? {
key: o,
_stripe_account: null,
_stripe_version: ke.mj
} : void 0,
e.next = 5,
r.threeDSecure2.challengeComplete({
data: {
source: a,
one_click_authn_enrollment: i.oneClickAuthnEnrollmentAPIParam,
one_click_authn_opt_out: i.oneClickAuthnOptOutAPIParam || void 0,
final_cres: i.oneClickAuthnEnrollmentAPIParam || s ? i.cres : void 0
},
authData: u
});
case 5:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), lS = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return r = t.apiClient,
a = n.bin,
e.abrupt("return", r.cardMetadata.retrieve({
data: {
bin_prefix: a
}
}));
case 3:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), cS = ["number", "cvc", "pin.number"], dS = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o, s, u;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
if (r = t.cache,
a = t.outerInitiatedActions,
i = n.cardId,
o = n.ephemeralKeySecret,
s = n.nonce,
!!r.issuingCardCache.get(i) || !o || !s) {
e.next = 6;
break
}
return e.next = 6,
a.retrieveIssuingCard({
cardId: i,
ephemeralKeySecret: o,
publicNonce: s,
expand: cS
});
case 6:
if (u = r.issuingCardCache.get(i)) {
e.next = 9;
break
}
throw new Error("Issuing card ".concat(i, " not found in cache"));
case 9:
return e.abrupt("return", u);
case 10:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), pS = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
var n, r;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return n = t.outerInitiatedActions,
r = t.cardElementState,
e.abrupt("return", n.checkForLinkClientSecret().then((function(e) {
return {
hasClientSecret: e,
config: r.linkConfigs
}
}
)));
case 2:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), mS = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o, s, u;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
if (r = t.elementsStores,
a = n.groupId,
r.has(a)) {
e.next = 4;
break
}
return e.abrupt("return", null);
case 4:
return e.next = 6,
r.getForExistingGroup(a, "TEMPORARY_AND_DANGEROUS_GET_CONSUMER_INFO");
case 6:
if (i = e.sent,
o = i.store) {
e.next = 10;
break
}
return e.abrupt("return", null);
case 10:
if (s = o.getState(),
(u = s.consumer).consumerSession && u.publishableKey) {
e.next = 13;
break
}
return e.abrupt("return", null);
case 13:
return e.abrupt("return", {
consumer_session: u.consumerSession,
redacted_payment_details: u.paymentDetails,
shipping_addresses: u.shippingAddresses,
publishable_key: u.publishableKey,
experiments: u.experiments,
settings: {}
});
case 14:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), fS = ["cvc", "exp_month", "exp_year", "number", "pin"], hS = ["cvc", "exp_month", "exp_year", "number", "pin"], _S = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o, s, u, l, c, d, p, m, f, _, y, v, g;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
if (r = t.apiClient,
a = t.integrationMetadata,
i = t.cache,
o = t.logger,
s = n.cardId,
u = n.ephemeralKeySecret,
l = n.publicNonce,
c = n.expand,
d = "retrieve_issuing_card",
p = a.resolveLocale(),
m = i.ephemeralKeyNonceCache.get(l)) {
e.next = 7;
break
}
throw new I.No("Ephemeral key nonce ".concat(l, " was not created by createEphemeralKeyNonce."));
case 7:
return f = function() {
return r.issuing.retrieveCard({
cardId: s,
ephemeralKey: u,
stripeVersion: r.getApiVersion(),
data: {
ephemeral_key_private_nonce: m,
expand: c || cS,
safe_expands: !0
}
})
}
,
e.next = 10,
i.issuingCardRequestCache.get(s) || i.issuingCardRequestCache.set(s, f());
case 10:
return _ = e.sent,
i.issuingCardRequestCache.delete(s),
y = _,
"object" === _.type && (i.issuingCardCache.set(s, {
number: _.object.number,
cvc: _.object.cvc,
exp_month: _.object.exp_month,
exp_year: _.object.exp_year,
pin: _.object.pin && _.object.pin.number
}),
v = _.object,
v.cvc,
v.exp_month,
v.exp_year,
v.number,
v.pin,
g = (0,
h.Z)(v, fS),
y = {
type: "object",
object: g
}),
r.reportFetchResult(d, y),
e.abrupt("return", sf(y, p, {
logger: o
}));
case 16:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), yS = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o, s, u, l, c, d, p, m, f;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return r = t.apiClient,
a = t.integrationMetadata,
i = t.cache,
o = t.logger,
s = n.cardId,
u = n.ephemeralKeySecret,
l = "retrieve_issuing_card_without_nonce",
c = a.resolveLocale(),
e.next = 6,
r.issuing.retrieveCard({
cardId: s,
ephemeralKey: u,
data: {
expand: cS,
safe_expands: !0
},
options: {
slugOverride: l
}
});
case 6:
return d = e.sent,
p = d,
"object" === d.type && (i.issuingCardCache.set(s, {
number: d.object.number,
cvc: d.object.cvc,
exp_month: d.object.exp_month,
exp_year: d.object.exp_year,
pin: d.object.pin && d.object.pin.number
}),
m = d.object,
m.cvc,
m.exp_month,
m.exp_year,
m.number,
m.pin,
f = (0,
h.Z)(m, hS),
p = {
type: "object",
object: f
}),
r.reportFetchResult(l, p),
e.abrupt("return", sf(p, c, {
logger: o
}));
case 11:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), vS = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o, s;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return r = t.apiClient,
a = n.verifyUrl,
i = n.response,
o = n.ekey,
s = n.clientSecret,
e.abrupt("return", r.captcha.verifyChallenge({
verifyUrl: a,
data: {
challenge_response_token: i,
challenge_response_ekey: o,
client_secret: s
}
}));
case 3:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), gS = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
if (r = t.apiClient,
a = n.intentId,
i = n.clientSecret,
!(-1 !== a.indexOf("pi_"))) {
e.next = 7;
break
}
return e.abrupt("return", r.paymentIntents.cancelChallenge({
id: a,
data: {
client_secret: i
}
}));
case 7:
return e.abrupt("return", r.setupIntents.cancelChallenge({
id: a,
data: {
client_secret: i
}
}));
case 8:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), bS = function(e, t) {
var n = e.linkApiClient
, r = t.integrationType;
switch (r) {
case "elements_app_controller":
case "connections_modal":
case "link_login_modal":
case "link_modal":
return n.shareSessionContext("frame_to_frame");
case "card":
case "express_checkout":
return n.shareSessionContext("controller_to_frame_to_popup");
case "prb":
return n.shareSessionContext("controller_to_outer_to_popup");
default:
throw new Error("Routing not specified for integration type: ".concat(r))
}
}, SS = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o, s;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return r = t.apiClient,
a = n.completeUrl,
i = n.clientSecret,
o = n.cvc,
s = n.postalCode,
e.abrupt("return", r.cardDetailsRecollection.completeChallenge({
completeUrl: a,
data: {
client_secret: i,
cvc: o || void 0,
postal_code: s || void 0
}
}));
case 3:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), kS = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return r = t.apiClient,
a = n.returnIntentId,
i = n.data,
e.abrupt("return", r.returnIntents.confirm({
id: a,
data: i
}));
case 3:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), CS = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
var n, r, a, i, o, s;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return n = t.apiClient,
r = t.cache,
a = n.getMids(),
i = a ? "".concat(a.muid, "#").concat(a.guid, "#").concat(a.sid) : "",
o = function() {
return n.radarSessions.create({
data: {}
})
}
,
e.next = 6,
r.radarSessionCache.get(i) || r.radarSessionCache.set(i, o());
case 6:
return "error" === (s = e.sent).type && r.radarSessionCache.delete(i),
e.abrupt("return", s);
case 9:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), ES = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return r = t.apiClient,
a = n.session,
i = n.token,
o = n.ekey,
e.next = 4,
Ol.radarSessions.attachHcaptchaToken({
sessionId: a,
data: (0,
b.Z)((0,
b.Z)({}, r.getAuthenticationParams()), {}, {
passive_captcha_token: i,
passive_captcha_ekey: o || void 0
})
});
case 4:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), ZS = function(e) {
return e["250x400"] = "01",
e["390x400"] = "02",
e["500x600"] = "03",
e["600x400"] = "04",
e.fullScreen = "05",
e
}(ZS || {}), AS = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return r = t.apiClient,
a = t.logger,
i = n.publishableKey ? r.getCustomAuthForLink(n.publishableKey) : void 0,
e.abrupt("return", r.threeDSecure2.authenticate({
data: {
source: n.threeDS2Source,
browser: (o = n,
s = void 0,
u = void 0,
l = void 0,
c = void 0,
JSON.stringify((0,
b.Z)((0,
b.Z)({}, o.fingerprintResult), {}, {
challengeWindowSize: (l = o.outerWindowWidth,
c = o.hosted,
c ? l < 390 ? ZS["250x400"] : l < 500 ? ZS["390x400"] : l < 600 ? ZS["500x600"] : l < 768 ? ZS["600x400"] : ZS.fullScreen : null),
threeDSCompInd: "Y",
browserJavaEnabled: navigator.javaEnabled(),
browserJavascriptEnabled: !0,
browserLanguage: (s = navigator.language || navigator.languages || navigator.browserLanguage,
u = Array.isArray(s) ? s[0] : s,
"string" == typeof u ? u : null),
browserColorDepth: String(screen.colorDepth),
browserScreenHeight: String(screen.height),
browserScreenWidth: String(screen.width),
browserTZ: String((new Date).getTimezoneOffset()),
browserUserAgent: navigator.userAgent
}))),
one_click_authn_device_support: n.oneClickAuthnDeviceSupportAPIParam,
one_click_authn_authentication: n.oneClickAuthnAuthenticationAPIParam
},
authData: i,
errorLog: a.log
}));
case 3:
case "end":
return e.stop()
}
var o, s, u, l, c
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), MS = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o, s, u, l, c, d, p, m;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return r = t.apiClient,
a = n.intentSecret,
i = a.id,
o = a.clientSecret,
s = a.type,
u = n.shouldCreatePaymentMethod,
l = n.confirmIntentData,
c = n.localeOverride,
d = "data"in l && "billing_details"in l.data && (0,
x.Kn)(l.data.billing_details) ? {
billing_details: l.data.billing_details
} : {},
p = "paymentMethod" === l.tag ? {
payment_method: l.paymentMethod
} : {},
m = (0,
b.Z)((0,
b.Z)({
create_payment_method: u
}, d), p),
e.abrupt("return", "PAYMENT_INTENT" === s ? r.paymentIntents.createAcssSession({
id: i,
data: (0,
b.Z)({
client_secret: o
}, m),
options: {
localeOverride: c
}
}) : r.setupIntents.createAcssSession({
id: i,
data: (0,
b.Z)({
client_secret: o
}, m),
options: {
localeOverride: c
}
}));
case 6:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), PS = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return r = t.apiClient,
a = n.intentSecret,
i = n.data,
e.abrupt("return", r.paymentIntents.verifyMicrodeposits({
id: a.id,
data: (0,
b.Z)((0,
b.Z)({}, i), {}, {
client_secret: a.clientSecret
})
}));
case 3:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), xS = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return r = t.apiClient,
a = n.intentSecret,
i = n.data,
e.abrupt("return", r.setupIntents.verifyMicrodeposits({
id: a.id,
data: (0,
b.Z)((0,
b.Z)({}, i), {}, {
client_secret: a.clientSecret
})
}));
case 3:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), IS = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
r = t.frameHub,
a = n.data,
i = n.frameId,
r.sendMessageToParent({
action: "get-google-maps-predictions",
payload: {
data: a,
frameId: i
}
});
case 3:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), NS = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
r = t.frameHub,
a = n.data,
i = n.frameId,
r.sendMessageToParent({
action: "get-google-maps-details",
payload: {
data: a,
frameId: i
}
});
case 3:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), wS = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
r = t.frameHub,
a = n.apiKey,
r.sendMessageToParent({
action: "init-google-maps-service",
payload: {
apiKey: a
}
});
case 3:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), TS = function(e) {
return "requires_source_action" === (t = e.status) || "requires_action" === t;
var t
}, OS = function(e) {
var t = e.luxePath
, n = e.intent;
return t && (t.match(/(\w+)|\[(.*?)\]/g) || []).reduce((function(e, t) {
return e ? e[t.replace("[", "").replace("]", "")] : null
}
), n) || null
}, RS = function() {
function e(t) {
var n = t.apiSpec
, r = t.cfg;
(0,
C.Z)(this, e),
this._spec = n,
this._cfg = r
}
return (0,
E.Z)(e, [{
key: "type",
value: function() {
return this._spec.type
}
}, {
key: "nextBuyerAction",
value: function() {
return this._nextActionSpec.nextBuyerAction()
}
}, {
key: "nextBuyerActionIconType",
value: function() {
var e = this.nextBuyerAction();
switch (e) {
case "redirect_desktop":
return "redirectDesktop";
case "redirect_mobile":
case "qr_scan":
case "in_context_completion":
return "redirectMobile";
default:
return (0,
P.Rz)(e)
}
}
}, {
key: "partnerProductLink",
value: function() {
return this._spec.partner_product_link || null
}
}, {
key: "hasExplicitNextBuyerAction",
value: function() {
return !(this._nextActionSpec instanceof LS)
}
}, {
key: "getLuxeMessageServerSpec",
value: function() {
var e;
return null === (e = this._spec.localization) || void 0 === e ? void 0 : e.content
}
}, {
key: "getSelectedPaymentCustomMessagingSpec",
value: function() {
var e;
return null === (e = this._spec.buyer_messaging) || void 0 === e ? void 0 : e.selected_payment_custom_messaging
}
}, {
key: "selectedPaymentCustomMessagingEnabled",
value: function() {
var e = this.getSelectedPaymentCustomMessagingSpec();
if (null == e || !e.enabled)
return !1;
var t = this.getLuxeMessageServerSpec();
return !(null == e || !e.learn_more_link || null == t || !t.selected_payment_custom_messaging_terms_text || null == t || !t.selected_payment_custom_messaging_text)
}
}, {
key: "_nextActionSpec",
get: function() {
return this._redirectToUrlCoreSpec || this._confirmOnMobileDeviceCoreSpec || this._inContextCompletionCoreSpec || new LS({
cfg: this._cfg
})
}
}, {
key: "_redirectToUrlCoreSpec",
get: function() {
var e;
if ("redirect_to_url" === (null === (e = this._spec.next_action_spec) || void 0 === e ? void 0 : e.confirm_response_status_specs.requires_action.type)) {
var t, n = null === (t = this._spec.next_action_spec) || void 0 === t ? void 0 : t.confirm_response_status_specs.requires_action;
return new DS({
redirectToUrlSpec: n,
cfg: this._cfg
})
}
return null
}
}, {
key: "_confirmOnMobileDeviceCoreSpec",
get: function() {
var e = this._confirmMobileDeviceSpec;
return e ? new US({
confirmOnMobileDeviceSpec: e,
cfg: this._cfg
}) : null
}
}, {
key: "_confirmMobileDeviceSpec",
get: function() {
var e, t;
return "confirm_on_mobile_device" === (null === (e = this._spec.next_action_spec) || void 0 === e ? void 0 : e.confirm_response_status_specs.requires_action.type) ? null === (t = this._spec.next_action_spec) || void 0 === t ? void 0 : t.confirm_response_status_specs.requires_action : null
}
}, {
key: "_inContextCompletionCoreSpec",
get: function() {
var e = this._inContextCompletionSpec;
return e ? new jS({
inContextCompletionSpec: e,
cfg: this._cfg
}) : null
}
}, {
key: "_inContextCompletionSpec",
get: function() {
var e, t;
return "in_context_completion" === (null === (e = this._spec.next_action_spec) || void 0 === e ? void 0 : e.confirm_response_status_specs.requires_action.type) ? null === (t = this._spec.next_action_spec) || void 0 === t ? void 0 : t.confirm_response_status_specs.requires_action : null
}
}, {
key: "prepareParsedNextAction",
value: function(e) {
return this._confirmMobileDeviceSpec ? this.prepareParsedConfirmOnMobileDeviceAction(e) : this._inContextCompletionSpec ? this.prepareParsedInContextCompletionAction(e) : null
}
}, {
key: "prepareParsedConfirmOnMobileDeviceAction",
value: function(e) {
var t, n, r, a, i, o, s, u, l, c, d, p, m = (0,
M.TX)({
appUrl: (0,
M.AG)(M.Z_),
hostedInstructionsUrl: M.Z_,
qrImageUrlPng: M.Z_,
qrImageUrlSvg: M.Z_,
qrExpiresAt: (0,
M.AG)(M.Rx)
});
if (!this._confirmMobileDeviceSpec)
return null;
var f = {
appUrl: OS({
luxePath: null === (t = this._confirmMobileDeviceSpec.mobile_payment_link) || void 0 === t || null === (n = t.app_url) || void 0 === n ? void 0 : n.intent_path,
intent: e
}),
hostedInstructionsUrl: OS({
luxePath: null === (r = this._confirmMobileDeviceSpec.mobile_payment_link) || void 0 === r || null === (a = r.hosted_instructions_url) || void 0 === a ? void 0 : a.intent_path,
intent: e
}),
qrImageUrlPng: OS({
luxePath: null === (i = this._confirmMobileDeviceSpec.mobile_payment_link) || void 0 === i || null === (o = i.qr_image_url_png) || void 0 === o ? void 0 : o.intent_path,
intent: e
}),
qrImageUrlSvg: OS({
luxePath: null === (s = this._confirmMobileDeviceSpec.mobile_payment_link) || void 0 === s || null === (u = s.qr_image_url_svg) || void 0 === u ? void 0 : u.intent_path,
intent: e
}),
qrExpiresAt: OS({
luxePath: null === (l = this._confirmMobileDeviceSpec.mobile_payment_link) || void 0 === l || null === (c = l.qr_expires_at) || void 0 === c ? void 0 : c.intent_path,
intent: e
})
}
, h = (0,
M.ld)(m, f, "luxeConfirmOnMobileDeviceActionShape");
return "error" === h.type ? null : (0,
b.Z)((0,
b.Z)({}, h.value), {}, {
type: "luxe_confirm_on_mobile_device",
redirectBehavior: null === (d = this._confirmMobileDeviceSpec.mobile_payment_link) || void 0 === d || null === (p = d.app_url) || void 0 === p ? void 0 : p.redirect_behavior
})
}
}, {
key: "prepareParsedInContextCompletionAction",
value: function(e) {
var t, n = (0,
M.TX)({
url: M.Z_
});
if (!this._inContextCompletionSpec)
return null;
var r = {
url: OS({
luxePath: null === (t = this._inContextCompletionSpec.url) || void 0 === t ? void 0 : t.intent_path,
intent: e
})
}
, a = (0,
M.ld)(n, r, "luxeInContextCompletionActionShape");
return "error" === a.type ? null : (0,
b.Z)((0,
b.Z)({}, a.value), {}, {
type: "luxe_in_context_completion"
})
}
}, {
key: "getHostedInstructionUI",
value: function() {
var e;
return (null === (e = this._confirmMobileDeviceSpec) || void 0 === e ? void 0 : e.hosted_instructions_ui) || null
}
}, {
key: "getTermsLink",
value: function() {
var e, t, n;
return (null === (e = this._confirmMobileDeviceSpec) || void 0 === e || null === (t = e.hosted_instructions_ui) || void 0 === t || null === (n = t.page_footer) || void 0 === n ? void 0 : n.terms_link) || null
}
}, {
key: "hasConfirmOnMobileDeviceNextAction",
value: function() {
return Boolean(this._confirmMobileDeviceSpec)
}
}], [{
key: "create",
value: function(t) {
return new e({
apiSpec: t,
cfg: {
isMobile: Jr.q$
}
})
}
}]),
e
}(), LS = function() {
function e(t) {
var n = t.cfg;
(0,
C.Z)(this, e),
this._cfg = n
}
return (0,
E.Z)(e, [{
key: "nextBuyerAction",
value: function() {
return this._cfg.isMobile ? "redirect_mobile" : "redirect_desktop"
}
}]),
e
}(), DS = function() {
function e(t) {
var n = t.redirectToUrlSpec
, r = t.cfg;
(0,
C.Z)(this, e),
this._redirectToUrlSpec = n,
this._delegate = new LS({
cfg: r
})
}
return (0,
E.Z)(e, [{
key: "nextBuyerAction",
value: function() {
return this._delegate.nextBuyerAction()
}
}]),
e
}(), US = function() {
function e(t) {
var n = t.confirmOnMobileDeviceSpec
, r = t.cfg;
(0,
C.Z)(this, e),
this._confirmOnMobileDeviceSpec = n,
this._cfg = r
}
return (0,
E.Z)(e, [{
key: "_redirectBehavior",
value: function() {
var e, t, n;
return null === (e = this._confirmOnMobileDeviceSpec) || void 0 === e || null === (t = e.mobile_payment_link) || void 0 === t || null === (n = t.app_url) || void 0 === n ? void 0 : n.redirect_behavior
}
}, {
key: "nextBuyerAction",
value: function() {
var e = this._redirectBehavior();
switch (e) {
case "on_mobile_only":
return this._cfg.isMobile ? "redirect_mobile" : "qr_scan";
case "never":
case void 0:
return "qr_scan";
default:
return (0,
P.Rz)(e)
}
}
}]),
e
}(), jS = function() {
function e(t) {
var n = t.inContextCompletionSpec
, r = t.cfg;
(0,
C.Z)(this, e),
this._inContextCompletionSpec = n,
this._cfg = r
}
return (0,
E.Z)(e, [{
key: "nextBuyerAction",
value: function() {
return this._cfg.isMobile ? "redirect_mobile" : "in_context_completion"
}
}]),
e
}(), BS = function() {
function e(t) {
(0,
C.Z)(this, e),
this._paymentSpecs = t.reduce((function(e, t) {
return e[t.type] = RS.create(t),
e
}
), {})
}
return (0,
E.Z)(e, [{
key: "getLuxeEngineCoreSpec",
value: function(e) {
return this._paymentSpecs[e] || null
}
}, {
key: "parseNextAction",
value: function(e, t) {
var n = this.getLuxeEngineCoreSpec(t);
return n ? n.prepareParsedNextAction(e) : null
}
}]),
e
}(), FS = [].concat((0,
Z.Z)(z.y.typesWithLuxeServerSpec), ["alipay", "affirm", "afterpay_clearpay", "au_becs_debit", "klarna", "sepa_debit", "sofort", "alma", "amazon_pay", "bancontact", "demo_pay", "giropay", "grabpay", "mobilepay", "ng_market", "pay_by_bank", "paypal", "revolut_pay", "sunbit", "satispay", "crypto", "zip", "twint", "south_korea_market", "kr_market", "kr_card", "kakao_pay", "naver_pay", "payco", "samsung_pay", "ng_bank", "ng_bank_transfer", "ng_card", "ng_ussd", "gopay", "qris", "shopeepay", "oxxo", "multibanco", "paynow", "promptpay", "wechat_pay", "cashapp", "ideal", "eps", "p24", "customer_balance"]), GS = function() {
function e(t) {
(0,
C.Z)(this, e),
this._deps = t
}
var t, n, r;
return (0,
E.Z)(e, [{
key: "_getConfigFromElementStore",
value: (r = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
var n, r;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
if (t && this._deps.elementsStoreByGroupId.has(t)) {
e.next = 2;
break
}
return e.abrupt("return", null);
case 2:
return e.next = 4,
this._deps.elementsStoreByGroupId.getForExistingGroup(t, "_getConfigFromElementStore");
case 4:
return n = e.sent,
r = n.store,
e.abrupt("return", (null == r ? void 0 : r.getState().config) || null);
case 7:
case "end":
return e.stop()
}
}
), e, this)
}
))),
function(e) {
return r.apply(this, arguments)
}
)
}, {
key: "getPaymentMethodSpecLuxeData",
value: (n = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
var n, r, a, i, o, s, u, l, c;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return r = t.groupId,
a = t.clientSecret,
i = t.paymentMethod,
e.next = 3,
this._getConfigFromElementStore(r);
case 3:
if (o = e.sent,
null == i || !i.type || null == o || !o.session) {
e.next = 6;
break
}
return e.abrupt("return", {
paymentMethodSpecs: o.session.paymentMethodSpecs,
featureFlags: o.session.featureFlags,
paymentMethodType: i.type
});
case 6:
return e.next = 8,
iy.createAndParse({
authentication: this._deps.authenticationParams(),
betas: this._deps.betas() || [],
clientSecret: a,
deferredIntent: void 0,
customerSessionClientSecret: null == o ? void 0 : o.customerSessionClientSecret,
existingElementsSessionId: null == o || null === (n = o.session) || void 0 === n ? void 0 : n.elementsSessionId,
locale: null == o ? void 0 : o.locale,
paymentUserAgentSuffix: this._deps.paymentUserAgentSuffix(),
referrer: this._deps.referrer(),
stripeJsId: this._deps.stripeJsId()
});
case 8:
if (s = e.sent,
u = (0,
g.Z)(s, 1),
"object" === (null == (l = u[0]) ? void 0 : l.type)) {
e.next = 13;
break
}
return e.abrupt("return", new I.No("elementsSessionApi response is not an object, caused by: ".concat(null == l ? void 0 : l.error.message)));
case 13:
if (null !== (c = (null == i ? void 0 : i.type) || l.object.paymentMethodType)) {
e.next = 16;
break
}
return e.abrupt("return", new I.No("paymentMethodType not found from elementsSessionApi response, intent: ".concat(a.id)));
case 16:
return e.abrupt("return", {
paymentMethodSpecs: l.object.paymentMethodSpecs,
featureFlags: l.object.featureFlags,
paymentMethodType: c
});
case 17:
case "end":
return e.stop()
}
}
), e, this)
}
))),
function(e) {
return n.apply(this, arguments)
}
)
}, {
key: "getLuxeCoreEngine",
value: function(e) {
return new BS(e)
}
}, {
key: "parseLuxeNextAction",
value: (t = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
var n, r, a, i, o, s, u;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
if (n = t.intent,
r = t.clientSecret,
a = t.groupId,
i = this._deps.getLogger(),
TS(n)) {
e.next = 5;
break
}
return i.log("luxe_controller.get_payment_method_spec_luxe_data.error", {
message: "Intent is not in requires action",
intent_id: n.id,
status: n.status
}),
e.abrupt("return", null);
case 5:
return e.next = 7,
this.getPaymentMethodSpecLuxeData({
groupId: a,
clientSecret: r,
paymentMethod: "object" == typeof n.payment_method ? n.payment_method : null
});
case 7:
if (!((o = e.sent)instanceof I.No)) {
e.next = 11;
break
}
return i.log("luxe_controller.get_payment_method_spec_luxe_data.error", {
error: o
}),
e.abrupt("return", null);
case 11:
if (void 0 !== (s = (0,
O.sE)(FS, (function(e) {
return e === o.paymentMethodType
}
)))) {
e.next = 15;
break
}
return i.log("luxe_controller.get_payment_method_spec_luxe_data.error", {
message: "payment method type is not enlisted within LuxePaymentMethods",
intent_id: n.id,
payment_method_type: o.paymentMethodType
}),
e.abrupt("return", null);
case 15:
return null !== (u = this.getLuxeCoreEngine(o.paymentMethodSpecs).parseNextAction(n, s)) ? i.log("luxe_controller.handled_next_action", {
message: "Handled an intent next_action using Luxe",
intent_id: n.id,
payment_method_type: s
}) : i.log("luxe_controller.get_payment_method_spec_luxe_data.error", {
message: "LuxeEngineCore failed to parsedNextAction, likely due to missing spec",
intent_id: n.id,
payment_method_type: s
}),
e.abrupt("return", u);
case 18:
case "end":
return e.stop()
}
}
), e, this)
}
))),
function(e) {
return t.apply(this, arguments)
}
)
}], [{
key: "create",
value: function(t) {
return new e(t)
}
}]),
e
}(), qS = "luxe-controller-cache-key", KS = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return r = n.intent,
a = n.groupId,
i = n.clientSecret,
e.abrupt("return", VS(t).parseLuxeNextAction({
intent: r,
groupId: a,
clientSecret: i
}));
case 2:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), VS = function(e) {
var t = e.cache
, n = e.apiClient
, r = e.integrationMetadata
, a = e.logger
, i = e.elementsStores
, o = e.outerInitiatedActions;
return t.luxeControllerCache.get(qS) || t.luxeControllerCache.set(qS, GS.create({
authenticationParams: function() {
return n.getAuthenticationParams()
},
betas: function() {
return r.betas
},
paymentUserAgentSuffix: function() {
return r.paymentUserAgentSurfaceContextSuffix || null
},
referrer: function() {
return r.referrer
},
stripeJsId: function() {
return r.stripeJsId
},
elementsStoreByGroupId: i,
getLogger: function() {
return a
},
retrievePaymentIntent: o.retrievePaymentIntent,
retrieveSetupIntent: o.retrieveSetupIntent
})),
t.luxeControllerCache.get(qS)
}, zS = n(56274).Promise, HS = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o, s, u, l, c, d, p, m, f, h, _, y, v, g, b, k, C, E, Z, A, M, P;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
if (r = t.logger,
a = t.elementsStores,
i = t.outerInitiatedActions,
o = n.wallet,
s = n.isCheckout,
u = n.groupId,
l = n.isHostedInvoicePage,
c = n.isPaymentElement,
d = n.onBehalfOf,
p = n.amount,
m = n.currency,
!l) {
e.next = 4;
break
}
return e.abrupt("return", zS.resolve({
availability: !0
}));
case 4:
if (!c || !u) {
e.next = 20;
break
}
return e.next = 7,
a.getForDeferredGroup(u);
case 7:
if (f = e.sent,
h = f.store,
!(_ = f.error)) {
e.next = 14;
break
}
r.log("error.pr.reading_domain_registration_from_store_failed", {
error: _.message
}),
e.next = 20;
break;
case 14:
if (v = h.getState(),
g = (null === (y = v.config.session) || void 0 === y ? void 0 : y.unverifiedPaymentMethodsOnDomain) || [],
b = -1 === g.indexOf(o),
"apple_pay" !== o) {
e.next = 19;
break
}
return e.abrupt("return", {
availability: b,
tokenNotificationURL: null === (k = v.config.session) || void 0 === k ? void 0 : k.applePayTokenRevokeWebhookUrl
});
case 19:
return e.abrupt("return", {
availability: b
});
case 20:
return e.next = 22,
i.retrieveWalletConfig({
onBehalfOf: d,
amount: p,
currency: m
});
case 22:
if ("error" !== (C = e.sent).type) {
e.next = 28;
break
}
if (r.log("error.pr.fetch_domain_registration_failed", {
error: C.error,
wallet: o,
isCheckout: s,
isHostedInvoicePage: l,
isPaymentElement: c
}),
"apple_pay" !== o) {
e.next = 27;
break
}
return e.abrupt("return", {
availability: !1
});
case 27:
return e.abrupt("return", {
availability: !0
});
case 28:
E = C.object,
e.t0 = o,
e.next = "apple_pay" === e.t0 ? 32 : "apple_pay_later" === e.t0 ? 35 : 38;
break;
case 32:
return Z = E.apple_pay_available.payment_request_button,
A = E.verified_payment_methods_on_domain[o],
e.abrupt("break", 40);
case 35:
return Z = E.apple_pay_later_available.payment_request_button,
A = E.verified_payment_methods_on_domain.apple_pay,
e.abrupt("break", 40);
case 38:
Z = E.google_pay_available.payment_request_button,
A = E.verified_payment_methods_on_domain[o];
case 40:
if ("apple_pay_later" !== o) {
e.next = 42;
break
}
return e.abrupt("return", {
availability: Z
});
case 42:
return c || A || (r.warn(zv({
unverifiedPaymentMethods: [o],
elementName: "`paymentRequest`"
})),
r.log("pr.".concat(o, ".domain_unverified"), {
is_override: null !== (M = E.is_override) && void 0 !== M && M
})),
P = "apple_pay" === o ? E.apple_pay_available.token_notification_url : void 0,
e.abrupt("return", {
availability: Z,
tokenNotificationURL: P
});
case 45:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), YS = function(e) {
return (0,
b.Z)((0,
b.Z)({}, e), {}, {
object: (0,
b.Z)((0,
b.Z)({}, e.object), {}, {
experiments: e.object.experiments && (0,
b.Z)((0,
b.Z)({}, e.object.experiments), {}, {
elements_session_id: null,
elements_assignment_id: null
}),
consumer_info: null,
token: null
})
})
}, WS = n(56274).Promise, JS = function(e) {
return (0,
T.qC)(e)
}, XS = function(e) {
var t = e.cache
, n = e.withSecretConsumerData
, r = e.onBehalfOf
, a = e.amount
, i = e.currency
, o = JS({
onBehalfOf: r,
amount: a,
currency: i
});
return n ? t.withPrivateConsumerInfo.get(o) : t.withoutPrivateConsumerInfo.get(o)
}, QS = function(e) {
var t = e.cache
, n = e.withSecretConsumerData
, r = e.onBehalfOf
, a = e.amount
, i = e.currency
, o = e.walletConfigPromise
, s = JS({
onBehalfOf: r,
amount: a,
currency: i
});
n && t.withPrivateConsumerInfo.set(s, o);
var u = o.then((function(e) {
return "error" === e.type ? e : YS(e)
}
));
return t.withoutPrivateConsumerInfo.set(s, u),
n ? o : u
}, $S = function(e) {
return WS.all(e.withPrivateConsumerInfo.keys().map(function() {
var t = (0,
k.Z)((0,
S.Z)().mark((function t(n) {
var r;
return (0,
S.Z)().wrap((function(t) {
for (; ; )
switch (t.prev = t.next) {
case 0:
return t.next = 2,
e.withPrivateConsumerInfo.get(n);
case 2:
"object" === (r = t.sent).type && (r.object.consumer_info = null,
r.object.token = null,
e.withPrivateConsumerInfo.set(n, WS.resolve(r)));
case 4:
case "end":
return t.stop()
}
}
), t)
}
)));
return function(e) {
return t.apply(this, arguments)
}
}()))
}, ek = n(56274).Promise, tk = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return e.next = 2,
nk(t, (0,
b.Z)((0,
b.Z)({}, n), {}, {
withSecretConsumerData: !0
}));
case 2:
if ("error" !== (r = e.sent).type) {
e.next = 5;
break
}
return e.abrupt("return", r);
case 5:
return e.abrupt("return", YS(r));
case 6:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), nk = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o, s, u, l, c, d, p, m, f, h, _, y, v;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
if (r = t.logger,
a = t.apiClient,
i = t.integrationMetadata,
o = t.cache,
s = t.outerActions,
u = n.onBehalfOf,
l = n.withSecretConsumerData,
c = n.requestSurface,
d = n.amount,
p = n.currency,
!(m = XS({
cache: o.walletConfigCache,
withSecretConsumerData: l,
onBehalfOf: u,
amount: d,
currency: p
}))) {
e.next = 5;
break
}
return e.abrupt("return", m);
case 5:
return f = i.getReferrerHost(),
h = i.getTopLevelReferrerHost(),
_ = de({
experimentKey: V.D3.elements_session,
apiKey: a.getApiKey(),
stripeAccount: a.getStripeAccount()
}),
y = de({
experimentKey: V.D3.elements_assignment
}),
v = a.linkWalletConfig.retrieve({
stripeJsId: i.stripeJsId,
elementsSessionId: _,
elementsAssignmentId: y,
referrerHost: f,
requestSurface: c,
topLevelReferrerHost: h,
linkAuthentication: l,
onBehalfOf: u,
amount: d,
currency: p
}).then(function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
var n, o, u, l, c;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
if (!t.error && !t.object.is_override) {
e.next = 2;
break
}
return e.abrupt("return", t);
case 2:
if (!(n = t.object.experiments)) {
e.next = 14;
break
}
return e.next = 6,
s.localStorageSemaphoreAcquire();
case 6:
return e.next = 8,
ek.all([le({
experimentKey: V.D3.elements_session,
experimentId: n.elements_session_id,
apiKey: a.getApiKey(),
stripeAccount: a.getStripeAccount(),
stripeJsId: i.stripeJsId
}), le({
experimentKey: V.D3.elements_assignment,
experimentId: n.elements_assignment_id,
stripeJsId: i.stripeJsId
})]);
case 8:
o = e.sent,
u = (0,
g.Z)(o, 2),
l = u[0],
c = u[1],
r.updateParams({
elements_session_id: l,
elements_assignment_id: c
}),
s.localStorageSemaphoreRelease();
case 14:
return e.abrupt("return", t);
case 15:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t) {
return e.apply(this, arguments)
}
}()),
e.abrupt("return", QS({
cache: o.walletConfigCache,
withSecretConsumerData: l,
onBehalfOf: u,
amount: d,
currency: p,
walletConfigPromise: v
}));
case 11:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), rk = ["requestSurface", "withSecretConsumerData"], ak = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o, s, u, l, c, d, p, m, f, _, y, v, g, b;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
if (s = n.requestSurface,
u = n.withSecretConsumerData,
l = (0,
h.Z)(n, rk),
"paymentRequestButton" !== (m = l.componentName)) {
e.next = 8;
break
}
c = l.onBehalfOf,
d = l.amount,
p = l.currency,
e.next = 19;
break;
case 8:
if (f = t.frameHub.getFrameGroup(l.frameId)) {
e.next = 11;
break
}
throw new Error("Could not find the expected elements group");
case 11:
return e.next = 13,
t.elementsStores.getForDeferredGroup(f);
case 13:
if (_ = e.sent,
y = _.store,
!_.error) {
e.next = 18;
break
}
throw new Error("Could not retrieve elements store");
case 18:
c = y.getState().config.onBehalfOf;
case 19:
return e.next = 21,
nk(t, {
onBehalfOf: c,
requestSurface: s,
withSecretConsumerData: u,
amount: d,
currency: p
});
case 21:
return v = e.sent,
g = null === (r = v.object) || void 0 === r || null === (a = r.passive_captcha) || void 0 === a ? void 0 : a.site_key,
b = null === (i = v.object) || void 0 === i || null === (o = i.passive_captcha) || void 0 === o ? void 0 : o.rqdata,
g && (t.hcaptchaManager.setSiteKey("elements", g),
t.hcaptchaManager.setRqdata("elements", b)),
"card" !== m && "cardNumber" !== m || ft(t.hcaptchaManager, t.frameHub),
c && t.logger.log("on_behalf_of.wallet_config_called_with_obo", {
isError: "error" === v.type
}),
e.abrupt("return", {
response: v,
additionalDetails: {
onBehalfOf: c
}
});
case 28:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), ik = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o, s;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return r = t.cache,
a = n.onBehalfOf,
i = n.amount,
o = n.currency,
e.next = 4,
XS({
cache: r.walletConfigCache,
withSecretConsumerData: !1,
onBehalfOf: a,
amount: i,
currency: o
});
case 4:
if (!(s = e.sent) || "error" !== s.type || "on_behalf_of" !== s.error.param) {
e.next = 7;
break
}
return e.abrupt("return", s.error.message);
case 7:
return e.abrupt("return", null);
case 8:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), ok = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o, s;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return r = t.apiClient,
a = n.data,
i = n.usesButtonElement,
o = n.usesExpressCheckoutElement,
s = n.paymentRequestType,
e.abrupt("return", r.applePaySession.create({
data: (0,
b.Z)({}, a),
options: {
loggerExtras: {
usesButtonElement: !!i,
usesExpressCheckoutElement: !!o,
paymentRequestType: s
}
}
}));
case 3:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), sk = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o, s, u, l, c, d, p, m;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
if (r = t.frameHub,
a = t.outerInitiatedActions,
i = t.sharedInnerData,
o = t.outerActions,
s = n.groupId,
u = n.locale,
l = (0,
Zf.jW)(r, s, L.NC.PAYMENT_ELEMENT)) {
e.next = 5;
break
}
return e.abrupt("return", null);
case 5:
return e.next = 7,
(0,
Zf.XQ)(r, l);
case 7:
return c = e.sent,
e.next = 10,
i.consume("recentlyCreatedWalletData");
case 10:
if (!(d = e.sent)) {
e.next = 13;
break
}
return e.abrupt("return", d);
case 13:
if ("payment_method_data" === (null == c ? void 0 : c.type)) {
e.next = 15;
break
}
return e.abrupt("return", null);
case 15:
if ("apple_pay" === c.selectedPaymentMethod || "google_pay" === c.selectedPaymentMethod) {
e.next = 17;
break
}
return e.abrupt("return", null);
case 17:
return e.prev = 17,
e.next = 20,
o.showUpeWallet({
frameId: l,
wallet: c.selectedPaymentMethod
});
case 20:
return "token" === (p = e.sent).type && i.set("recentlyCreatedWalletData", p),
e.abrupt("return", p);
case 25:
return e.prev = 25,
e.t0 = e.catch(17),
m = c.selectedPaymentMethod,
e.abrupt("return", a.unsafeLocalizeString({
message: "errors.wallet_show_error",
data: {
wallet: (0,
x.pM)(m.replace("_", " "))
},
locale: u
}).then((function(e) {
return {
type: "error",
error: {
type: "invalid_request_error",
message: e || "Something went wrong. Unable to show wallet. Please choose a different payment method and try again."
}
}
}
)));
case 29:
case "end":
return e.stop()
}
}
), e, null, [[17, 25]])
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), uk = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
var n, r, a, i, o, s, u, l, c;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return n = t.apiClient,
r = t.integrationMetadata,
a = t.cache,
i = t.logger,
o = "create_ephemeral_key_nonce",
s = r.resolveLocale(),
e.next = 5,
n.ephemeralKeyNonces.create({
data: {}
});
case 5:
return u = e.sent,
l = u,
"object" === u.type && (c = u.object.public_nonce,
a.ephemeralKeyNonceCache.set(c, u.object.private_nonce),
l = {
type: "object",
object: {
public_nonce: c
}
}),
n.reportFetchResult(o, l),
e.abrupt("return", sf(l, s, {
logger: i
}));
case 10:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t) {
return e.apply(this, arguments)
}
}(), lk = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return r = t.apiClient,
a = n.intentSecret,
i = n.linkAccountSessionId,
o = n.expandParam,
e.abrupt("return", r.paymentIntents.attachLinkAccountSession({
id: a.id,
linkAccountSessionId: i,
data: {
expand: o || [],
client_secret: a.clientSecret
}
}));
case 3:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), ck = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return r = t.apiClient,
a = n.intentSecret,
i = n.linkAccountSessionId,
o = n.expandParam,
e.abrupt("return", r.setupIntents.attachLinkAccountSession({
id: a.id,
linkAccountSessionId: i,
data: {
expand: o || [],
client_secret: a.clientSecret
}
}));
case 3:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), dk = ((0,
M.Wc)((0,
M.mC)({
handleActions: (0,
M.Wc)(M.Xg, (function() {
return !0
}
))
}), (function() {
return {
handleActions: !0
}
}
)),
n(56274).Promise,
"instant_verification_incomplete"), pk = n(56274).Promise, mk = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o, s, u, l, c;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return r = t.elementsStores,
a = t.outerInitiatedActions,
i = n.error,
o = n.bankAccount,
s = n.groupId,
e.next = 4,
r.strictGet(s, "completeLinkAccountSessionElements");
case 4:
if (u = e.sent,
!i) {
e.next = 17;
break
}
if (i.code !== dk) {
e.next = 10;
break
}
u.dispatch({
type: "PAYMENT.ACH_BANK_SEARCH.RESET"
}),
e.next = 15;
break;
case 10:
return e.next = 12,
a.localizeError(i);
case 12:
l = e.sent,
c = l.error,
u.dispatch({
type: "PAYMENT.ACH_BANK_SEARCH.ERROR",
error: {
type: "connections",
code: c.code,
message: c.message
}
});
case 15:
e.next = 18;
break;
case 17:
o && u.dispatch({
type: "PAYMENT.ACH_BANK_SEARCH.ACCOUNT_LINKED",
bankAccount: o
});
case 18:
return e.abrupt("return", pk.resolve());
case 19:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), fk = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return r = t.elementsStores,
a = n.paymentDetails,
i = n.groupId,
e.next = 4,
r.strictGet(i, "createBankPaymentDetails");
case 4:
e.sent.dispatch(Jm(a));
case 5:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), hk = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return r = t.elementsStores,
a = n.consumerInfo,
i = n.groupId,
e.next = 4,
r.strictGet(i, "loginWithConsumerInfo");
case 4:
e.sent.dispatch(Vm(a));
case 5:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), _k = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return r = t.elementsStores,
a = n.groupId,
e.next = 4,
r.strictGet(a, "clearInstantDebitsIncentive");
case 4:
e.sent.dispatch({
type: "CONSUMER.CLEAR_INSTANT_DEBITS_INCENTIVE"
});
case 5:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), yk = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return r = t.elementsStores,
a = n.groupId,
i = n.paymentMethodType,
e.next = 4,
r.strictGet(a, "resetConsumerIncentiveOffer");
case 4:
e.sent.dispatch({
type: "CONSUMER.RESET_SIGN_UP_INCENTIVE_OFFERS",
paymentMethodTypes: [i]
});
case 5:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), vk = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return r = t.elementsStores,
a = n.bankPaymentDetailsId,
i = n.groupId,
e.next = 4,
r.strictGet(i, "confirmInstantDebitsIncentiveForPaymentDetails");
case 4:
e.sent.dispatch(ef(a));
case 5:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), gk = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return r = t.elementsStores,
a = n.groupId,
i = n.paymentMethodType,
o = n.paymentDetailsId,
e.next = 4,
r.strictGet(a, "updateAvailableConsumerIncentives");
case 4:
e.sent.dispatch(tf(i, o));
case 5:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), bk = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o, s;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return r = t.elementsStores,
a = n.instrumentId,
i = n.paymentMethodType,
o = n.groupId,
s = n.paymentDetailsId,
e.next = 4,
r.strictGet(o, "confirmConsumerSignUpIncentiveForPaymentDetails");
case 4:
e.sent.dispatch(rf(a, i, s));
case 5:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), Sk = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return r = t.elementsStores,
a = n.consumerInfo,
i = n.groupId,
e.next = 4,
r.strictGet(i, "prefillUsBankAccountFormWithConsumer");
case 4:
e.sent.dispatch(af(a));
case 5:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), kk = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o, s;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return r = t.elementsStores,
a = n.instrumentId,
i = n.instrumentEligible,
o = n.paymentMethodType,
s = n.groupId,
e.next = 4,
r.strictGet(s, "setInstrumentForConsumerSignUpIncentive");
case 4:
e.sent.dispatch(of(a, o, i));
case 5:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), Ck = function() {
return he.Fd
}, Ek = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
if (r = t.linkApiClient,
a = t.logger,
i = Ck(),
(0,
T.Qg)(i)) {
e.next = 7;
break
}
if (a.log("error.remember_link_login.untrusted_origin", {
parent_origin: i
}),
!i) {
e.next = 6;
break
}
throw new I.No("This function may only be called from the Link app");
case 6:
return e.abrupt("return");
case 7:
r.temporaryAndDangerous_setCredentials(n);
case 8:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), Zk = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
var n, r, a;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
if (n = t.linkApiClient,
r = t.logger,
a = Ck(),
(0,
T.Qg)(a)) {
e.next = 7;
break
}
if (r.log("error.forget_link_login.untrusted_origin", {
parent_origin: a
}),
!a) {
e.next = 6;
break
}
throw new I.No("This function may only be called from the Link app");
case 6:
return e.abrupt("return");
case 7:
n.temporaryAndDangerous_clearCredentials();
case 8:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), Ak = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
var n, r, a;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
n = t.elementsStores,
r = t.frameHub,
a = t.logger,
n.keys().forEach(function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
var i, o;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
if (i = r.getGroup(t),
n.has(t) && i) {
e.next = 3;
break
}
return e.abrupt("return");
case 3:
return e.next = 5,
n.strictGet(t, "logOutOfLinkInElements");
case 5:
o = e.sent,
s = o.getState(),
!!s.consumer.consumerSession && (o.dispatch({
type: "CONSUMER.LOGOUT.SUCCESS"
}),
a.log("pr.link.elements_logout"));
case 8:
case "end":
return e.stop()
}
var s
}
), e)
}
)));
return function(t) {
return e.apply(this, arguments)
}
}());
case 2:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), Mk = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
var n, r, a;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
n = t.frameHub,
r = t.outerInitiatedActions,
a = t.cache,
n.sendBroadcast({
type: "link_popup_log_out_no_sensitive_data"
}),
r.logOutOfLinkInElements(),
$S(a.walletConfigCache);
case 4:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), Pk = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
var n, r;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
n = t.frameHub,
r = t.cache,
n.sendBroadcast({
type: "preloaded_data_stale"
}),
$S(r.walletConfigCache);
case 3:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), xk = n(56274).Promise, Ik = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o, s, u, l, c, d, p, m, f, h, _, y, v, g, k, C, E, Z, A, P, x, N;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return r = t.apiClient,
a = t.integrationMetadata,
i = t.frameHub,
o = "create_consumer_payment_details",
s = n.email,
u = n.clientSecret,
l = n.frameId,
c = n.billingDetails,
d = n.isDefault,
p = n.requestSurface,
m = n.nickname,
f = u,
e.prev = 4,
e.next = 7,
Fb(i, l);
case 7:
if ("error" !== (h = e.sent).type) {
e.next = 12;
break
}
return e.abrupt("return", xk.reject(h.error));
case 12:
return _ = h.value,
y = _.cardNumber,
v = _.cardExpiry,
g = _.cardCvc,
k = _.postalCode,
C = (0,
M.qQ)(v),
E = C.year,
Z = C.month,
e.next = 16,
rc({
apiKey: r.getApiKey(),
stripeAccount: r.getStripeAccount() || null,
clientSecret: f,
cardDetails: {
exp_month: Z,
exp_year: E,
number: y,
cvc: g
},
email: s,
consumerAddress: (0,
b.Z)({
postal_code: k
}, c),
active: !0,
isDefault: d,
requestSurface: p || (S = a.paymentUserAgentSurfaceContextSuffix,
S === ua.wl ? vt.jL.HostedInvoicePagePaymentElement : vt.jL.PaymentElement),
nickname: m,
useLinkApiClient: !1
});
case 16:
if ("error" !== (A = e.sent).type) {
e.next = 23;
break
}
throw P = A.error,
r.reportFetchResult(o, A),
new I.No(P.message || P.code || "unexpected error");
case 23:
return N = null == A || null === (x = A.object) || void 0 === x ? void 0 : x.redacted_payment_details,
e.abrupt("return", N);
case 25:
e.next = 30;
break;
case 27:
return e.prev = 27,
e.t0 = e.catch(4),
e.abrupt("return", xk.reject(e.t0));
case 30:
case "end":
return e.stop()
}
var S
}
), e, null, [[4, 27]])
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), Nk = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o, s, u, l, c, d, p;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return r = t.linkApiClient,
a = n.email,
i = n.session_id,
o = n.payment_intent,
s = n.amount,
u = n.currency,
l = n.element,
c = n.transaction_context,
d = r.elementToLinkRequestSurface(l) || vt.jL.LinkAuthenticationInPaymentElement,
e.next = 5,
r.prewarmLookupWithStoredCredentials({
requestSurface: d,
sessionId: i,
transactionContext: c
});
case 5:
p = e.sent,
p.found || r.prewarmLookupWithEmail({
email_address: a,
amount: s,
currency: u,
request_surface: d,
session_id: i,
payment_intent: o,
transaction_context: c
});
case 8:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), wk = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
var n;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return n = t.apiClient,
e.abrupt("return", !!(0,
ru.jC)({
key: n.getApiKey(),
livemode: (0,
R.lO)(n.getApiKey()) === R.Kl.live
}));
case 2:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), Tk = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return r = t.linkApiClient,
e.abrupt("return", r.shareSessionContext(n));
case 2:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), Ok = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o, s, u, l;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
if (r = t.elementsStores,
a = n.groupId,
i = n.wallet,
o = n.isComplete,
a) {
e.next = 4;
break
}
throw new Error("Could not find expected elements group");
case 4:
return e.next = 6,
r.getForDeferredGroup(a);
case 6:
if (s = e.sent,
u = s.error,
l = s.store,
!u) {
e.next = 11;
break
}
return e.abrupt("return");
case 11:
l.dispatch({
type: "PAYMENT.FETCHING_WALLETS",
isComplete: !!o,
wallet: i,
externalPaymentMethodTypes: l.getState().config.externalPaymentMethodTypes
});
case 12:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), Rk = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o, s, u, l;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
if (r = t.elementsStores,
a = n.groupId,
i = n.shouldShowButton,
o = n.button,
a) {
e.next = 4;
break
}
throw new Error("Could not find expected elements group");
case 4:
return e.next = 6,
r.getForDeferredGroup(a);
case 6:
if (s = e.sent,
u = s.error,
l = s.store,
!u) {
e.next = 11;
break
}
return e.abrupt("return");
case 11:
l.dispatch({
type: "EXPRESS_CHECKOUT.SHOULD_SHOW_BUTTON",
button: o,
shouldShowButton: i
});
case 12:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), Lk = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o, s, u;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
if (r = t.elementsStores,
a = n.groupId,
i = n.paymentMethodType,
a) {
e.next = 4;
break
}
throw new Error("Could not find expected elements group");
case 4:
return e.next = 6,
r.getForExistingGroup(a, "expressCheckoutConfirmStart");
case 6:
if (o = e.sent,
s = o.error,
u = o.store,
!s) {
e.next = 11;
break
}
return e.abrupt("return");
case 11:
u.dispatch({
type: "EXPRESS_CHECKOUT.CONFIRM_START",
paymentMethodType: i
});
case 12:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), Dk = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o, s;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
if (r = t.elementsStores,
a = n.groupId) {
e.next = 4;
break
}
throw new Error("Could not find expected elements group");
case 4:
return e.next = 6,
r.getForExistingGroup(a, "expressCheckoutConfirmEnd");
case 6:
if (i = e.sent,
o = i.error,
s = i.store,
!o) {
e.next = 11;
break
}
return e.abrupt("return");
case 11:
s.dispatch({
type: "EXPRESS_CHECKOUT.CONFIRM_END"
});
case 12:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), Uk = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o, s, u;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
if (r = t.elementsStores,
a = n.groupId,
i = n.paymentMethodType,
a) {
e.next = 4;
break
}
throw new Error("Could not find expected elements group");
case 4:
return e.next = 6,
r.getForExistingGroup(a, "expressCheckoutSheetOpened");
case 6:
if (o = e.sent,
s = o.error,
u = o.store,
!s) {
e.next = 11;
break
}
return e.abrupt("return");
case 11:
u.dispatch({
type: "EXPRESS_CHECKOUT.SHEET_OPENED",
paymentMethodType: i
});
case 12:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), jk = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o, s;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
if (r = t.elementsStores,
a = n.groupId) {
e.next = 4;
break
}
throw new Error("Could not find expected elements group");
case 4:
return e.next = 6,
r.getForExistingGroup(a, "expressCheckoutSheetClosed");
case 6:
if (i = e.sent,
o = i.error,
s = i.store,
!o) {
e.next = 11;
break
}
return e.abrupt("return");
case 11:
s.dispatch({
type: "EXPRESS_CHECKOUT.SHEET_CLOSED"
});
case 12:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), Bk = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o, s, u, l;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
if (r = t.elementsStores,
a = n.groupId,
i = n.shippingContact,
o = n.paymentMethodData,
a) {
e.next = 4;
break
}
throw new Error("Could not find expected elements group");
case 4:
return e.next = 6,
r.getForExistingGroup(a, "setExpressCheckoutConfirmData");
case 6:
if (s = e.sent,
u = s.error,
l = s.store,
!u) {
e.next = 11;
break
}
return e.abrupt("return");
case 11:
l.dispatch({
type: "EXPRESS_CHECKOUT.SET_CONFIRM_DATA",
shippingContact: i,
paymentMethodData: o
});
case 12:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), Fk = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o, s;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return r = t.elementsStores,
a = n.groupId,
e.next = 4,
r.getForExistingGroup(a, "resetExpressCheckoutState");
case 4:
i = e.sent,
(o = i.store) && (s = o.getState(),
o.dispatch({
type: "EXPRESS_CHECKOUT.RESET_STATE",
config: s.config
}));
case 7:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), Gk = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
r = t.frameHub,
a = n.authenticationUrl,
i = n.groupId,
(o = (0,
Zf.jW)(r, i, L.NC.EXPRESS_CHECKOUT_ELEMENT)) && r.sendMessageToFrame(o, {
action: "stripe-ece-notify-sheet-authentication-needed",
payload: {
authenticationUrl: a
}
});
case 4:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), qk = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o, s, u, l, c, d, p, m;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
if (a = t.elementsStores,
i = t.logger,
o = n.groupId,
s = n.wallets,
o) {
e.next = 4;
break
}
throw new Error("Could not find expected elements group");
case 4:
return e.next = 6,
a.getForDeferredGroup(o);
case 6:
if (u = e.sent,
l = u.store,
!u.error) {
e.next = 11;
break
}
return e.abrupt("return", []);
case 11:
return c = l.getState(),
(d = (null === (r = c.config.session) || void 0 === r ? void 0 : r.unverifiedPaymentMethodsOnDomain) || []).length > 0 && (p = s ? null == d ? void 0 : d.filter((function(e) {
return "never" !== s[(0,
x.i3)(e)]
}
)) : d).length > 0 && (m = zv({
unverifiedPaymentMethods: p,
elementName: "Express Checkout Element"
}),
i.warn(m)),
e.abrupt("return", d);
case 15:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), Kk = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o, s, u, l, c;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
if (i = t.elementsStores,
o = n.groupId) {
e.next = 4;
break
}
throw new Error("Could not find expected elements group");
case 4:
return e.next = 6,
i.getForExistingGroup(o, "getElementsSessionAmountModeCurrency");
case 6:
if (s = e.sent,
u = s.error,
l = s.store,
!u) {
e.next = 11;
break
}
throw new Error("Could not find expected store for elements group");
case 11:
return c = l.getState(),
e.abrupt("return", {
amount: (null === (r = c.config.session) || void 0 === r ? void 0 : r.amount) || 0,
mode: Oa(c),
currency: (null === (a = c.config.session) || void 0 === a ? void 0 : a.currency) || "usd"
});
case 13:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), Vk = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o, s;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
if (r = t.elementsStores,
a = n.groupId) {
e.next = 4;
break
}
throw new Error("Could not find expected elements group");
case 4:
return e.next = 6,
r.getForExistingGroup(a, "getIsAwaitingConfirmCallback");
case 6:
if (i = e.sent,
o = i.error,
s = i.store,
!o) {
e.next = 11;
break
}
return e.abrupt("return", !1);
case 11:
return e.abrupt("return", s.getState().expressCheckoutElement.isAwaitingConfirmCallback);
case 12:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), zk = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o, s, u, l, c, d, p;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
if (r = t.elementsStores,
a = n.groupId,
i = n.errorMessageMethodName,
a) {
e.next = 4;
break
}
throw new Error("Could not find expected elements group");
case 4:
return e.next = 6,
r.getForDeferredGroup(a);
case 6:
if (o = e.sent,
s = o.error,
u = o.store,
!s) {
e.next = 11;
break
}
return e.abrupt("return", "payment");
case 11:
if (l = u.getState(),
c = l.expressCheckoutElement,
d = c.isAwaitingConfirmCallback,
!(p = c.sheetOpenedPaymentMethod) || !d) {
e.next = 15;
break
}
return e.abrupt("return", "expressCheckout");
case 15:
if (!p || d) {
e.next = 17;
break
}
throw new I.No("Unexpected call to ".concat(i, ". Ensure you are either submitting a payment or calling paymentFailed() once per expressCheckout Element confirm event."));
case 17:
return e.abrupt("return", "payment");
case 18:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), Hk = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o, s, u, l, c, d, p, m, f, h, _, y;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
if (r = t.elementsStores,
a = t.frameHub,
i = t.logger,
o = n.groupId,
s = n.isError,
u = n.errorMessageMethodName,
l = n.filterByNextActionSupport,
c = n.forceClose,
d = (0,
Zf.jW)(a, o, L.NC.EXPRESS_CHECKOUT_ELEMENT)) {
e.next = 5;
break
}
return e.abrupt("return");
case 5:
return e.next = 7,
r.strictGet(o, "closeECEPaymentSheet");
case 7:
if (p = e.sent,
m = p.getState(),
f = wh(m),
h = Th(m),
f) {
e.next = 13;
break
}
return e.abrupt("return");
case 13:
if (void 0 === l) {
e.next = 16;
break
}
if (!(l && !Mh[f] || !l && Mh[f])) {
e.next = 16;
break
}
return e.abrupt("return");
case 16:
if (_ = m.expressCheckoutElement,
y = _.isAwaitingConfirmCallback,
!1 !== _.options.__autoClose || c) {
e.next = 19;
break
}
return e.abrupt("return");
case 19:
if (y) {
e.next = 21;
break
}
throw new I.No("Unexpected call to ".concat(u, " or paymentFailed() during the expressCheckout confirm event. Ensure you are either submitting a payment or calling paymentFailed() once per confirm event."));
case 21:
p.dispatch({
type: "EXPRESS_CHECKOUT.CONFIRM_END"
}),
a.sendMessageToParent({
action: "ece-outer-pm-complete-payment",
payload: {
frameId: d,
paymentMethodType: f,
isError: s
}
}),
h ? a.sendMessageToFrame(d, {
action: "stripe-ece-confirm-payment",
payload: (0,
b.Z)({
nonce: h
}, s ? {
paymentFailedPayload: {
reason: "fail"
}
} : {})
}) : "apple_pay_outer" !== f && i.log("ece.confirm.missing_nonce", {
payment_method: f
});
case 24:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), Yk = function(e, t) {
switch (e.type) {
case "paypal":
return {
type: H.paypal,
data: {
order_id: (a = t,
a.expressCheckoutElement.paypalOrder).orderId,
express_billing_agreement_id: Nh(t).billingAgreementId
}
};
case "klarna":
return {
type: H.klarna,
data: {
partner_confirmation_token: Ih(t).klarnaConfirmationToken
}
};
default:
if (ph(e.type)) {
var n, r = null === (n = function(e) {
return e.expressCheckoutElement.expressCheckoutSession
}(t)) || void 0 === n ? void 0 : n.id;
if (void 0 === r)
throw new Error("Express Checkout Element absurdly has no express_checkout_element_session_id when confirming the payment intent. In all cases that should have been created after the buyer's initial click.");
return {
type: e.type,
data: {
express_checkout_element_session_id: r
}
}
}
return null
}
var a
}, Wk = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o, s, u, l, c, d, p, m, f, h, _, y, v, g, k, C, E, Z, A, M, P, x, N, w;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
if (r = t.frameHub,
a = t.elementsStores,
i = t.integrationMetadata,
o = n.frameId,
s = n.mids,
u = n.enforcePaymentMethodCreationManual,
l = n.paymentMethodData,
c = n.slug,
r.doesFrameExist(o)) {
e.next = 4;
break
}
throw new I.No("Please use the same instance of `Stripe` you used to create this Element.");
case 4:
if (d = r.getFrameGroup(o)) {
e.next = 7;
break
}
throw new Error("Could not find expected elements group");
case 7:
return e.next = 9,
a.strictGet(d, "createPaymentMethodParamsWithExpressCheckoutElement");
case 9:
if (p = e.sent,
m = p.getState(),
f = m.expressCheckoutElement.paymentMethodData,
h = Pa(m),
_ = Ra(m),
y = wh(m),
v = cd(m),
g = null,
k = null,
!v) {
e.next = 38;
break
}
return C = Tc(m),
e.t0 = oc,
e.t1 = C,
e.t2 = s,
e.next = 25,
Kb(t, d);
case 25:
return e.t3 = e.sent,
e.t4 = m,
e.t5 = l,
e.t6 = {
cvc: e.t1,
mids: e.t2,
paymentUserAgent: e.t3,
selectedPaymentMethodType: "card",
state: e.t4,
isECE: !0,
userPaymentMethodData: e.t5
},
e.next = 31,
(0,
e.t0)(e.t6);
case 31:
if ("object" == typeof (g = e.sent) || "string" == typeof g) {
e.next = 34;
break
}
throw new Error("Unexpected sharePaymentDetailsResponse payment_method type");
case 34:
k = "string" == typeof g.payment_method ? g.payment_method : g.payment_method.id,
E = Qc(m, {
isECE: !0
}),
Z = null == E ? void 0 : E.id,
k && Z && p.dispatch({
type: "EXPRESS_CHECKOUT.PAYMENT_METHOD_SHARED",
paymentMethodId: k
});
case 38:
if (f) {
e.next = 40;
break
}
throw new Error("Express Checkout Element does not have any payment method data saved with it.");
case 40:
if ("manual" === m.config.paymentMethodCreation || !u) {
e.next = 42;
break
}
throw new I.No("To use createPaymentMethod with the Express Checkout Element, your elements instance must be created with paymentMethodCreation: 'manual'.");
case 42:
if (A = Yk(f, m),
M = m.config.deferredIntent ? ua.q3 : ua.VR,
null != h && h.isAutomaticPaymentMethods && (M += "; ".concat(ua.Kf)),
"checkout" === (P = m.config.elementsInitSource) ? M += "; ".concat(ua.Wb) : "payment_link" === P && (M += "; ".concat(ua._Z, "; ").concat(ua.Wb)),
x = {
client_session_id: i.stripeJsId,
merchant_integration_source: "elements",
merchant_integration_subtype: "express-checkout-element",
merchant_integration_version: "2021",
payment_intent_creation_flow: null != h && h.parsedClientSecret ? "standard" : "deferred",
payment_method_selection_flow: null != h && h.isAutomaticPaymentMethods ? "automatic" : "merchant_specified"
},
N = "apple_pay_inner" === y || "apple_pay_outer" === y ? "apple_pay" : y,
!v) {
e.next = 55;
break
}
if ("create_payment_method" !== c || !g) {
e.next = 54;
break
}
if ("string" != typeof g.payment_method) {
e.next = 53;
break
}
return e.abrupt("return", {
type: "element_payment_method_id",
locale: _,
selectedPaymentMethod: N,
paymentMethod: g.payment_method,
session: h,
confirmPaymentMethodOptions: A
});
case 53:
return e.abrupt("return", {
type: "element_payment_method",
locale: _,
selectedPaymentMethod: N,
paymentMethod: g.payment_method,
session: h,
confirmPaymentMethodOptions: A
});
case 54:
return e.abrupt("return", {
type: "element_payment_method_params",
locale: _,
selectedPaymentMethod: y,
paymentMethodId: k,
paymentMethodParams: null,
confirmPaymentMethodOptions: A,
session: h
});
case 55:
return w = (0,
b.Z)((0,
b.Z)((0,
b.Z)({}, ff(l, f)), i.getPaymentMetadata(null)), {}, {
payment_user_agent: i.getPaymentUserAgent(M),
client_attribution_metadata: x
}, s || {}),
e.abrupt("return", {
type: "element_payment_method_params",
locale: _,
selectedPaymentMethod: N,
paymentMethodParams: w,
confirmPaymentMethodOptions: A,
session: h
});
case 57:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), Jk = function() {
function e(t) {
(0,
C.Z)(this, e),
this.name = t,
this.cache = {}
}
return (0,
E.Z)(e, [{
key: "get",
value: function(e) {
return this.cache[e]
}
}, {
key: "set",
value: function(e, t) {
return this.cache[e] = t,
t
}
}, {
key: "delete",
value: function(e) {
delete this.cache[e]
}
}, {
key: "clearAll",
value: function() {
this.cache = {}
}
}, {
key: "keys",
value: function() {
return Object.keys(this.cache)
}
}]),
e
}(), Xk = function() {
function e() {
(0,
C.Z)(this, e),
this.radarSessionCache = new Jk("radarSession"),
this.issuingCardCache = new Jk("issuingCard"),
this.issuingCardRequestCache = new Jk("issuingCardRequest"),
this.ephemeralKeyNonceCache = new Jk("ephemeralKeyNonce"),
this.walletConfigCache = {
withPrivateConsumerInfo: new Jk("walletConfigWithPrivateConsumerInfo"),
withoutPrivateConsumerInfo: new Jk("walletConfigWithoutPrivateConsumerInfo")
},
this.cardMetadataManagerCache = new Jk("cardMetadataManager"),
this.luxeControllerCache = new Jk("luxeController")
}
return (0,
E.Z)(e, [{
key: "resetAll",
value: function() {
this.radarSessionCache.clearAll(),
this.issuingCardCache.clearAll(),
this.issuingCardRequestCache.clearAll(),
this.ephemeralKeyNonceCache.clearAll(),
this.walletConfigCache.withPrivateConsumerInfo.clearAll(),
this.walletConfigCache.withoutPrivateConsumerInfo.clearAll(),
this.cardMetadataManagerCache.clearAll(),
this.luxeControllerCache.clearAll()
}
}], [{
key: "getInstance",
value: function() {
return this.instance || (this.instance = new e),
this.instance
}
}]),
e
}(), Qk = function() {
function e(t, n) {
(0,
C.Z)(this, e),
this.stores = {},
this.controller = t,
this.logger = n
}
var t, n, r;
return (0,
E.Z)(e, [{
key: "add",
value: function(e, t) {
var n;
(n = this.stores)[e] || (n[e] = new Ru.B),
this.stores[e].resolve({
store: t
})
}
}, {
key: "error",
value: function(e, t) {
var n;
(n = this.stores)[e] || (n[e] = new Ru.B),
this.stores[e].resolve({
error: t
})
}
}, {
key: "getWithOptions",
value: function(e, t) {
var n, r = t.caller, a = t.groupMustExist;
if ((void 0 === a || a) && !this.controller.frameHub.getGroup(e))
throw new Error("Could not retrieve elements store because group ".concat(e, " does not exist [caller: ").concat(r, "]"));
return this.stores[e] || this.logger.log("dispatch_before_store"),
(n = this.stores)[e] || (n[e] = new Ru.B),
this.stores[e].promise
}
}, {
key: "has",
value: function(e) {
return e in this.stores
}
}, {
key: "hasSettled",
value: function(e) {
return !!this.has(e) && !this.stores[e].isPending()
}
}, {
key: "keys",
value: function() {
return Object.keys(this.stores)
}
}, {
key: "getForDeferredGroup",
value: (r = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return e.abrupt("return", this.getWithOptions(t, {
groupMustExist: !1
}));
case 1:
case "end":
return e.stop()
}
}
), e, this)
}
))),
function(e) {
return r.apply(this, arguments)
}
)
}, {
key: "getForExistingGroup",
value: (n = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return e.abrupt("return", this.getWithOptions(t, {
caller: n
}));
case 1:
case "end":
return e.stop()
}
}
), e, this)
}
))),
function(e, t) {
return n.apply(this, arguments)
}
)
}, {
key: "strictGet",
value: (t = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return e.next = 2,
this.getWithOptions(t, {
caller: n
});
case 2:
if (r = e.sent,
a = r.store) {
e.next = 7;
break
}
throw this.logger.log("store_does_not_exist", {
caller: n
}),
new Error("Could not retrieve elements store");
case 7:
return e.abrupt("return", a);
case 8:
case "end":
return e.stop()
}
}
), e, this)
}
))),
function(e, n) {
return t.apply(this, arguments)
}
)
}]),
e
}(), $k = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return r = t.cache,
a = t.apiClient,
i = t.logger,
o = n.frameId,
e.abrupt("return", Ef({
frameId: o,
cardMetadataManagerCache: r.cardMetadataManagerCache,
apiClient: a
}).retrieveCardNetworks(i.log));
case 3:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), eC = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o, s;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return r = t.cache,
a = t.apiClient,
i = t.logger,
o = n.rawCardNumber,
(s = Ef({
frameId: "stripe.retrieveCardMethod",
cardMetadataManagerCache: r.cardMetadataManagerCache,
apiClient: a
})).fetchingCardMetadata(o, !0),
e.abrupt("return", s.retrieveCardNetworks(i.log).then((function(e) {
return {
networks: e
}
}
)));
case 5:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), tC = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o, s, u, l, c, d, p, m;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return r = t.apiClient,
a = t.outerInitiatedActions,
i = t.logger,
o = n.intentSecret,
s = n.sourceId,
u = n.locale,
l = n.sourceIntentId,
c = n.publishableKey,
d = null != l ? l : o.id,
p = c ? r.getCustomAuthForLink(c) : void 0,
e.next = 6,
r.setupIntents.sourceCancel({
id: d,
data: {
source: s
},
authData: p
});
case 6:
if ("error" !== (m = e.sent).type) {
e.next = 9;
break
}
return e.abrupt("return", a.retrieveSetupIntent({
intentSecret: o,
hosted: !1,
asErrorIfNotSucceeded: !0,
locale: u
}));
case 9:
return e.abrupt("return", sf(__(m), u, {
logger: i
}));
case 10:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), nC = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o, s, u, l, c, d, p, m;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return r = t.apiClient,
a = t.outerInitiatedActions,
i = t.logger,
o = n.intentSecret,
s = n.sourceId,
u = n.locale,
l = n.sourceIntentId,
c = n.publishableKey,
d = null != l ? l : o.id,
p = c ? r.getCustomAuthForLink(c) : void 0,
e.next = 6,
r.paymentIntents.sourceCancel({
id: d,
data: {
source: s
},
authData: p
});
case 6:
if ("error" !== (m = e.sent).type) {
e.next = 9;
break
}
return e.abrupt("return", a.retrievePaymentIntent({
intentSecret: o,
hosted: !1,
asErrorIfNotSucceeded: !0,
locale: u
}));
case 9:
return e.abrupt("return", sf(__(m), u, {
logger: i
}));
case 10:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), rC = function() {
function e() {
var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}
, n = t.frameId;
(0,
C.Z)(this, e),
this.frameIds = [],
n && this.frameIds.push(n)
}
return (0,
E.Z)(e, [{
key: "addFrame",
value: function(e) {
this.frameExistsInGroup(e) || (this.frameIds = [].concat((0,
Z.Z)(this.frameIds), [e]))
}
}, {
key: "frameExistsInGroup",
value: function(e) {
return Boolean(e && -1 !== this.frameIds.indexOf(e))
}
}, {
key: "getFrames",
value: function() {
return this.frameIds
}
}, {
key: "removeFrame",
value: function(e) {
this.frameIds = this.frameIds.filter((function(t) {
return t !== e
}
))
}
}]),
e
}(), aC = n(75336), iC = (sg = {},
(0,
v.Z)(sg, V.Yj.card, L.NC.CARD_ELEMENT_COMBINED),
(0,
v.Z)(sg, V.Yj.cardNumber, L.NC.CARD_ELEMENT_SPLIT),
(0,
v.Z)(sg, V.Yj.cardExpiry, L.NC.CARD_ELEMENT_SPLIT),
(0,
v.Z)(sg, V.Yj.cardCvc, L.NC.CARD_ELEMENT_SPLIT),
(0,
v.Z)(sg, V.Yj.postalCode, L.NC.CARD_ELEMENT_SPLIT),
(0,
v.Z)(sg, V.Yj.paymentRequestButton, L.NC.PAYMENT_REQUEST_ELEMENT),
(0,
v.Z)(sg, V.Yj.iban, L.NC.IBAN_ELEMENT),
(0,
v.Z)(sg, V.Yj.idealBank, L.NC.IDEAL_BANK_ELEMENT),
(0,
v.Z)(sg, V.Yj.p24Bank, L.NC.P24_BANK_ELEMENT),
(0,
v.Z)(sg, V.Yj.auBankAccount, L.NC.AU_BANK_ACCOUNT_ELEMENT),
(0,
v.Z)(sg, V.Yj.fpxBank, L.NC.FPX_BANK_ELEMENT),
(0,
v.Z)(sg, V.Yj.issuingCardNumberDisplay, L.NC.ISSUING_CARD_NUMBER_DISPLAY_ELEMENT),
(0,
v.Z)(sg, V.Yj.issuingCardCopyButton, L.NC.ISSUING_CARD_COPY_BUTTON_ELEMENT),
(0,
v.Z)(sg, V.Yj.issuingCardCvcDisplay, L.NC.ISSUING_CARD_CVC_DISPLAY_ELEMENT),
(0,
v.Z)(sg, V.Yj.issuingCardExpiryDisplay, L.NC.ISSUING_CARD_EXPIRY_DISPLAY_ELEMENT),
(0,
v.Z)(sg, V.Yj.issuingCardPinDisplay, L.NC.ISSUING_CARD_PIN_DISPLAY_ELEMENT),
(0,
v.Z)(sg, V.Yj.epsBank, L.NC.EPS_BANK_ELEMENT),
(0,
v.Z)(sg, V.Yj.netbankingBank, L.NC.NETBANKING_BANK_ELEMENT),
(0,
v.Z)(sg, V.Yj.afterpayClearpayMessageModal, L.NC.AFTERPAY_MESSAGE_MODAL_ELEMENT),
(0,
v.Z)(sg, V.Yj.autocompleteSuggestions, L.NC.AUTOCOMPLETE_SUGGESTIONS_ELEMENT),
(0,
v.Z)(sg, V.Yj.achBankSearchResults, L.NC.ACH_BANK_SEARCH_RESULTS_ELEMENT),
(0,
v.Z)(sg, V.Yj.linkAuthentication, L.NC.LINK_AUTHENTICATION_ELEMENT),
(0,
v.Z)(sg, V.Yj.address, L.NC.ADDRESS_ELEMENT),
(0,
v.Z)(sg, V.Yj.payment, L.NC.PAYMENT_ELEMENT),
(0,
v.Z)(sg, V.Yj.paymentMethodMessaging, L.NC.PAYMENT_METHOD_MESSAGING_ELEMENT),
sg), oC = function() {
function e(t) {
(0,
C.Z)(this, e);
var n, r = t.elementName && (n = t.elementName,
iC[n] !== t.type), a = t.elementName && !t.groupId;
(r || a) && He.log("debug.frame_hub.new_frame.unexpected_payload", (0,
b.Z)({}, t)),
this.controllerId = t.controllerId,
this.frameId = t.frameId,
this.state = {
groupId: void 0,
elementName: void 0,
type: t.type,
loaded: !1,
queuedMessages: [],
messenger: void 0
},
this.updateState({
groupId: t.groupId,
loaded: t.loaded,
type: t.type,
elementName: t.elementName
})
}
return (0,
E.Z)(e, [{
key: "getState",
value: function() {
return this.state
}
}, {
key: "updateState",
value: function(e) {
e.loaded && !this.state.messenger && this.initMessenger(),
this.state = (0,
b.Z)((0,
b.Z)({}, this.state), e)
}
}, {
key: "initMessenger",
value: function() {
if (!this.state.messenger)
try {
var e = new aC.t1({
controllerAppFrameId: this.controllerId,
innerFrameId: this.frameId,
handlers: {},
debugLog: (0,
Zf.dA)(this.controllerId) ? He.log : void 0
});
this.state.messenger = e
} catch (e) {
He.log("debug.controller.init_frame_messenger_error", {
error: e
})
}
}
}]),
e
}(), sC = function() {
function e(t, n) {
var r = this;
(0,
C.Z)(this, e),
this.groups = {},
this.frames = {},
this._constructSiblingFrameMessage = function(e) {
return function(t) {
return {
controllerAppFrameId: r.controllerId,
message: e,
sourceFrameId: r.controllerId,
targetFrameId: t,
type: "sibling"
}
}
}
,
this.logger = n,
this.controllerId = t
}
return (0,
E.Z)(e, [{
key: "addEmptyGroup",
value: function(e, t) {
if (!t)
throw new Error("frameHub.addEmptyGroup should only be used for testing");
if (this.getGroup(e))
throw new Error("Attempted to overwrite an existing group using frameHub.addEmptyGroup(".concat(e, ")."));
this.setGroup(e, new rC)
}
}, {
key: "existsInGroup",
value: function(e) {
var t = e.groupId
, n = e.frameId
, r = this.getGroup(t);
return Boolean(r && r.frameExistsInGroup(n))
}
}, {
key: "getGroup",
value: function(e) {
return e ? this.groups[e] : void 0
}
}, {
key: "getGroupFrames",
value: function(e, t) {
var n = this
, r = this.getGroup(e);
if (!r)
return [];
var a = r.getFrames();
if (!t)
return a;
var i = [];
if (t.isReady && i.push(this.isFrameReady.bind(this)),
t.types) {
i.push((function(e) {
var r, a = n.getFrameType(e);
return Boolean(a && -1 !== (null === (r = t.types) || void 0 === r ? void 0 : r.indexOf(a)))
}
))
}
if (t.elementNames) {
i.push((function(e) {
var r, a = n.getFrameElementName(e);
return Boolean(a && -1 !== (null === (r = t.elementNames) || void 0 === r ? void 0 : r.indexOf(a)))
}
))
}
return t.custom && i.push(t.custom),
a.filter((function(e) {
return i.every((function(t) {
return t(e)
}
))
}
))
}
}, {
key: "removeFrameFromGroup",
value: function(e) {
var t = e.groupId
, n = e.frameId
, r = this.getGroup(t);
null == r || r.removeFrame(n)
}
}, {
key: "sendGroupMessage",
value: function(e, t, n) {
var r = this;
this.getGroupFrames(e, n).forEach((function(e) {
r.sendMessageToFrame(e, t)
}
))
}
}, {
key: "addFrameToGroup",
value: function(e) {
var t = e.groupId
, n = e.frameId
, r = this.getGroup(t);
r ? r.addFrame(n) : this.setGroup(t, new rC({
frameId: n
}))
}
}, {
key: "setGroup",
value: function(e, t) {
this.groups[e] = t
}
}, {
key: "addFrame",
value: function(e) {
var t = e.frameId
, n = e.groupId
, r = e.loaded
, a = void 0 !== r && r
, i = e.type
, o = e.elementName;
this.getFrame(t) && this.logger.log("debug.frame_id_already_exists", {
frameId: t,
type: i
});
var s = new oC({
frameId: t,
groupId: n,
loaded: a,
type: i,
elementName: o,
controllerId: this.controllerId
});
this.setFrame(t, s),
n && this.addFrameToGroup({
groupId: n,
frameId: t
})
}
}, {
key: "deleteFrame",
value: function(e) {
delete this.frames[e]
}
}, {
key: "doesFrameExist",
value: function(e) {
return Boolean(this.getFrame(e))
}
}, {
key: "getFrameGroup",
value: function(e) {
var t = this.getFrame(e);
return t ? t.getState().groupId : void 0
}
}, {
key: "getFrameLoaded",
value: function(e) {
var t = this.getFrame(e);
return t ? t.getState().loaded : void 0
}
}, {
key: "getFrameQueuedMessages",
value: function(e) {
var t = this.getFrame(e);
return t ? t.getState().queuedMessages : void 0
}
}, {
key: "getFrameType",
value: function(e) {
var t = this.getFrame(e);
return t ? t.getState().type : void 0
}
}, {
key: "getFrameElementName",
value: function(e) {
var t = this.getFrame(e);
return t ? t.getState().elementName : void 0
}
}, {
key: "getAllFrameIds",
value: function() {
return Object.keys(this.frames)
}
}, {
key: "isFrameReady",
value: function(e) {
return !!this.doesFrameExist(e) && (Boolean(this.getFrameLoaded(e)) && this.isFrameMounted(e))
}
}, {
key: "isFrameMounted",
value: function(e) {
return !!(0,
q.Hb)(e)
}
}, {
key: "sendMessageToFrame",
value: function(e, t) {
var n = this._constructSiblingFrameMessage(t)(e);
this.doesFrameExist(e) && (this.isFrameReady(e) ? (0,
L.oi)(n) : (this.getFrameQueuedMessages(e) || []).push(n))
}
}, {
key: "sendMessageToParent",
value: function(e) {
(0,
L.oi)({
type: "parent",
sourceFrameId: this.controllerId,
controllerAppFrameId: this.controllerId,
message: e
})
}
}, {
key: "sendBroadcast",
value: function(e) {
var t = this;
this.getAllFrameIds().forEach((function(n) {
t.sendMessageToFrame(n, {
action: "stripe-broadcast",
payload: e
})
}
))
}
}, {
key: "sendCommandToFrame",
value: function(e, t, n) {
var r = this.getFrame(e);
if (!r)
throw new Error("frameHub.sendCommandToFrame can only be used on existing frames");
var a = r.getState().messenger;
if (!a)
throw new Error("frameHub.sendCommandToFrame can only be used on frames with initialized messengers");
return a.commands[t](n)
}
}, {
key: "updateFrame",
value: function(e, t) {
var n = this.getFrame(e);
n && ((t.groupId || t.elementName || t.precedence || t.type) && this.logger.log("debug.frame_hub.update_frame.unexpected_param", (0,
b.Z)({
frameId: e
}, t)),
n.updateState(t))
}
}, {
key: "getFrame",
value: function(e) {
return e ? this.frames[e] : void 0
}
}, {
key: "setFrame",
value: function(e, t) {
this.frames[e] = t
}
}]),
e
}(), uC = n(65835), lC = {}, cC = function(e, t) {
var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : void 0
, r = arguments.length > 3 ? arguments[3] : void 0
, a = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : {}
, i = (0,
uC.Q)(t, n, r)
, o = (0,
g.Z)(i, 2)
, s = o[0]
, u = o[1];
return lC["".concat(t).concat(n)] || (e("light_experiment_exposure", (0,
b.Z)({
qualified: s,
variant: u,
experiment_name: t
}, a)),
lC["".concat(t).concat(n)] = !0),
u
}, dC = function(e, t) {
var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : void 0
, r = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : {
treatment: 5,
control: 5
}
, a = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : {};
return cC(e, t, n, r, a)
}, pC = n(73341), mC = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
var n;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return n = t.linkApiClient,
e.abrupt("return", n.DANGEROUS_lookupConsumerSessionUncachedUnlogged({
requestSurface: vt.jL.ElementsController
}));
case 2:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), fC = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o, s;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
if (r = t.elementsStores,
a = n.groupId) {
e.next = 4;
break
}
throw new Error("Could not find expected elements group");
case 4:
return e.next = 6,
r.getForExistingGroup(a, "getEcePaymentSheetState");
case 6:
if (i = e.sent,
o = i.error,
s = i.store,
!o) {
e.next = 11;
break
}
return e.abrupt("return", {
isAwaitingConfirmCallback: !1,
sheetOpenedPaymentMethod: null
});
case 11:
return e.abrupt("return", {
isAwaitingConfirmCallback: s.getState().expressCheckoutElement.isAwaitingConfirmCallback,
sheetOpenedPaymentMethod: s.getState().expressCheckoutElement.sheetOpenedPaymentMethod
});
case 12:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), hC = function(e) {
var t = Ka(e)
, n = Ra(e)
, r = di(e)
, a = ci(e);
return r.email ? {
type: "error",
error: r.email,
locale: n
} : r.autofill ? {
type: "error",
error: ma,
locale: n
} : {
type: "email",
email: t || a.email,
locale: n
}
}, _C = [ke.uN.account, ke.uN.bank_account, ke.uN.person, ke.uN.pii, ke.uN.cvc_update, "apple_pay"], yC = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o, s, u;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return r = n.type,
a = n.elementName,
i = n.tokenData,
o = n.mids,
"token type",
s = (0,
M.Gu)(M.kw.apply(void 0, (0,
Z.Z)(_C)), r, "token type"),
u = s.value,
e.abrupt("return", kd(t, {
type: u,
elementName: a,
tokenData: i,
mids: o
}));
case 5:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(), vC = n(56274).Promise, gC = ["card"], bC = ["cvc"], SC = function(e) {
return Object.keys(cf).indexOf(e.code) >= 0
}, kC = {
confirm_payment_intent: "stripe.confirmPayment()",
confirm_setup_intent: "stripe.confirmSetup()",
update_payment_intent: "stripe.updatePaymentIntent()",
create_payment_method: "stripe.createPaymentMethod()",
create_confirmation_token: "stripe.createConfirmationToken()",
submit_elements: "elements.submit()"
}, CC = (0,
M.mC)({
controllerId: (0,
M.jt)(M.Z_),
__privateApiUrl: (0,
M.jt)(M.Z_),
__privatePaymentUserAgentSuffix: (0,
M.jt)(M.z$.apply(void 0, (0,
Z.Z)(ua.R3))),
__privateSharedSessionContext: (0,
M.jt)(M.Ry),
apiKey: (0,
M.jt)(M.Z_),
apiVersion: (0,
M.jt)(M.Z_),
stripeAccount: (0,
M.jt)(M.Z_),
v2: (0,
M.jt)((0,
M.mC)({
authToken: M.Z_,
stripeContext: M.Z_
})),
mids: (0,
M.jt)((0,
M.mC)({
muid: M.Z_,
sid: M.Z_,
guid: M.Z_
})),
betas: (0,
M.jt)((0,
M.CT)(M.z$.apply(void 0, (0,
Z.Z)(N.Lv)))),
referrer: (0,
M.jt)(M.Z_),
stripeJsId: (0,
M.jt)(M.Z_),
stripeJsLoadTime: (0,
M.jt)(M.Z_),
locale: (0,
M.jt)(M.Z_),
manualBrowserDeprecationRollout: (0,
M.jt)(M.HM),
topOriginForCrossOriginFrame: (0,
M.jt)(M.Z_),
controllerCount: (0,
M.jt)(M.Cz)
}), EC = function() {
function e(t) {
var n, r, a, i, o, s, u, l, c, d, p, m, f, E = this;
(0,
C.Z)(this, e),
this._cache = Xk.getInstance(),
this.requests = new q_,
this.elementsStores = new Qk(this,He),
this.elementsGroupManager = new hy,
this.sharedInnerData = (o = {},
{
get: (i = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return e.abrupt("return", o[t]);
case 1:
case "end":
return e.stop()
}
}
), e)
}
))),
function(e) {
return i.apply(this, arguments)
}
),
delete: (a = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
o[t] = void 0;
case 1:
case "end":
return e.stop()
}
}
), e)
}
))),
function(e) {
return a.apply(this, arguments)
}
),
consume: (r = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
var n;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return n = o[t],
o[t] = void 0,
e.abrupt("return", n);
case 3:
case "end":
return e.stop()
}
}
), e)
}
))),
function(e) {
return r.apply(this, arguments)
}
),
set: (n = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
o[t] = n;
case 1:
case "end":
return e.stop()
}
}
), e)
}
))),
function(e, t) {
return n.apply(this, arguments)
}
)
}),
this._cardElementState = new sS,
this._recentlyValidated = !1,
this._recentlyCreatedPaymentMethod = null,
this._hcaptchaManager = new lt,
this.reportErrorToApp = function(e) {
E._reportError(e.app, e.exception)
}
,
this.warn = function() {
He.warn.apply(He, arguments)
}
,
this.controllerFor = function() {
return "ControllerApp"
}
,
this._isExpressCheckoutElement = function(e) {
return E.frameHub.getFrameType(e) === L.NC.EXPRESS_CHECKOUT_ELEMENT
}
,
this.shippingFromElementsIntentMutationParams = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o, s, u, l, c, d, p, m, f;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return a = t.groupId,
i = t.intentSecret,
o = t.otherParams,
e.next = 3,
E.elementsStores.getForExistingGroup(a, "shippingFromElementsIntentMutationParams");
case 3:
if (s = e.sent,
u = s.store) {
e.next = 7;
break
}
throw new I.No("Could not retrieve data from Elements. Did Elements mount successfully?");
case 7:
if (l = u.getState(),
c = i || (null == l || null === (r = l.config.session) || void 0 === r ? void 0 : r.parsedClientSecret)) {
e.next = 11;
break
}
throw new I.No("You must pass in a clientSecret when calling ".concat(kC[n], "."));
case 11:
return e.next = 13,
E.outerInitiatedActions.validateElements({
groupId: a,
slug: n
});
case 13:
if (!(d = e.sent) || "error" !== d.type) {
e.next = 16;
break
}
return e.abrupt("return", d);
case 16:
return p = Qp(Dd)(l),
m = sm(l, p),
f = um(l, Dd, null == m ? void 0 : m.phone),
e.abrupt("return", {
type: "intent_mutation_params",
locale: null,
clientSecret: c,
params: (0,
b.Z)((0,
b.Z)({}, o), {}, {
expected_payment_method_type: null,
shipping: (0,
O.PM)((0,
b.Z)((0,
b.Z)({}, m), {}, {
phone: f
}), o.shipping)
})
});
case 20:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(),
this.parseElementsIntentMutationParams = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o, s, u, l, c, d, p, m, f, h, _, y, v, C, Z, A, M;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return i = t.otherParams,
o = t.expectedType,
s = t.mids,
u = t.groupId,
l = t.frameId,
c = t.elementName,
d = t.data,
p = t.enforcePreSubmit,
m = t.options,
f = t.intentSecret,
e.next = 3,
E.elementsStores.getForExistingGroup(u, "parseElementsIntentMutationParams");
case 3:
if (h = e.sent,
_ = h.store) {
e.next = 7;
break
}
throw new I.No("Could not retrieve data from Elements. Did Elements mount successfully?");
case 7:
if (y = _.getState(),
v = y.config,
C = null === (r = y.paymentElement.session) || void 0 === r || null === (a = r.customer) || void 0 === a ? void 0 : a.id,
Z = v.session,
A = f || (null == Z ? void 0 : Z.parsedClientSecret)) {
e.next = 18;
break
}
if (!v.deferredIntent) {
e.next = 17;
break
}
throw new I.No("You must pass in a clientSecret when calling ".concat(kC[n], "."));
case 17:
throw new Error("No clientSecret available");
case 18:
return M = E.validateAndCreatePaymentMethodParamsWithL3PlusElement({
groupId: u,
frameId: l,
paymentMethodData: d,
mids: s,
slug: n,
enforcePreSubmit: p,
enforcePaymentMethodCreationManual: !1,
maybeParsedIntentSecret: A
}),
e.abrupt("return", vC.all([E._transformPaymentMethodOptions(m), M]).then(function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
var r, a, s, l, d, p, m, f, h, _, k, Z, M, x, I;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
if (r = (0,
g.Z)(t, 2),
a = r[0],
s = r[1],
"error" !== a.type) {
e.next = 3;
break
}
return e.abrupt("return", a);
case 3:
if (l = Oh({
canUseShipping: "PAYMENT_INTENT" === A.type,
isECE: "expressCheckout" === c,
elementsState: y,
shippingParam: i.shipping
}),
new Set(["update_payment_intent"]).has(n)) {
e.next = 11;
break
}
return e.next = 8,
dt({
slug: n,
siteKey: E._hcaptchaManager.getSiteKey("elements"),
getCaptchaToken: E.outerAction.getCaptchaToken
});
case 8:
e.t0 = e.sent,
e.next = 12;
break;
case 11:
e.t0 = null;
case 12:
d = e.t0,
p = d ? {
hcaptcha_token: d
} : null,
e.t1 = s.type,
e.next = "error" === e.t1 ? 17 : "element_payment_method_id" === e.t1 || "element_payment_method" === e.t1 ? 18 : "element_payment_method_params" === e.t1 ? 20 : 30;
break;
case 17:
return e.abrupt("return", s);
case 18:
return f = "string" == typeof (null == s ? void 0 : s.paymentMethod) ? s.paymentMethod : null == s || null === (m = s.paymentMethod) || void 0 === m ? void 0 : m.id,
e.abrupt("return", {
type: "intent_mutation_params",
locale: s.locale,
clientSecret: A,
params: (0,
b.Z)((0,
b.Z)({}, i), {}, {
shipping: l || void 0,
payment_method: f,
payment_method_options: (0,
O.TS)(a.paymentMethodOptions, Yf(s.confirmPaymentMethodOptions)),
expected_payment_method_type: Vb(s.selectedPaymentMethod),
radar_options: p,
set_as_default_payment_method: i_({
slug: n,
elementsState: y
})
})
});
case 20:
return _ = i.return_url ? i.return_url : void 0,
(k = s.selectedPaymentMethod) && -1 !== ke.y$.indexOf(k) && (_ = void 0),
e.next = 25,
E.elementsStores.strictGet(u, "createPaymentMethodParamsWithElements");
case 25:
return Z = e.sent.getState(),
M = xa(Z),
x = null == M || null === (h = M.linkSettings) || void 0 === h ? void 0 : h.linkMode,
I = -1 !== ["PASSTHROUGH", "LINK_CARD_BRAND"].indexOf(x || "") ? {
payment_method: s.paymentMethodId
} : void 0,
e.abrupt("return", {
type: "intent_mutation_params",
locale: s.locale,
clientSecret: A,
params: (0,
b.Z)((0,
b.Z)((0,
b.Z)({}, i), {}, {
return_url: _,
shipping: l || void 0,
payment_method_data: s.paymentMethodParams,
payment_method_options: (0,
O.TS)(a.paymentMethodOptions, Yf(s.confirmPaymentMethodOptions))
}, I), {}, {
expected_payment_method_type: o || Vb(s.selectedPaymentMethod),
client_context: Rh(E._metadataManager.betas, C, v.deferredIntent),
radar_options: p,
set_as_default_payment_method: i_({
slug: n,
elementsState: y
})
})
});
case 30:
return e.abrupt("return", (0,
P.Rz)(s));
case 31:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t) {
return e.apply(this, arguments)
}
}()));
case 20:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(),
this.parsePaymentMethodIntentMutationParams = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
var n, r;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return n = t.otherParams,
r = t.expectedType,
e.abrupt("return", E._transformPaymentMethodOptions(t.options).then((function(e) {
return "error" === e.type ? e : {
type: "intent_mutation_params",
locale: null,
clientSecret: t.intentSecret,
params: (0,
b.Z)((0,
b.Z)({}, n), {}, {
payment_method: t.paymentMethod,
payment_method_options: e.paymentMethodOptions,
expected_payment_method_type: r
})
}
}
)));
case 2:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t) {
return e.apply(this, arguments)
}
}(),
this.parseUpdateIntentMutationParams = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
e.t0 = t.tag,
e.next = "shipping-from-elements" === e.t0 ? 3 : "elements" === e.t0 ? 4 : "paymentMethod" === e.t0 ? 5 : 6;
break;
case 3:
return e.abrupt("return", E.shippingFromElementsIntentMutationParams(t, n));
case 4:
return e.abrupt("return", E.parseElementsIntentMutationParams(t, n));
case 5:
return e.abrupt("return", E.parsePaymentMethodIntentMutationParams(t));
case 6:
return e.abrupt("return", (0,
P.Rz)(t));
case 7:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(),
this.parseIntentMutationParams = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o, s;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
r = t.otherParams,
a = t.expectedType,
i = t.mids,
He.log("debug.parse_intent_mutation_params", {
slug: n,
tag: t.tag
}),
e.t0 = t.tag,
e.next = "shipping-from-elements" === e.t0 ? 5 : "elements" === e.t0 ? 6 : "paymentMethod-from-element" === e.t0 ? 7 : "paymentMethod-from-data" === e.t0 ? 8 : "paymentMethod" === e.t0 ? 13 : "confirmationToken" === e.t0 ? 14 : "none" === e.t0 ? 15 : "source-from-element" === e.t0 ? 16 : "source-from-data" === e.t0 ? 17 : "source" === e.t0 ? 19 : 20;
break;
case 5:
throw new Error("Attempted to confirm with only an address Element.");
case 6:
return e.abrupt("return", E.parseElementsIntentMutationParams(t, n));
case 7:
return e.abrupt("return", vC.all([E._transformPaymentMethodOptions(t.options), E.createPaymentMethodParamsWithElement({
frameId: t.frameId,
elementName: t.elementName,
type: t.type,
paymentMethodData: t.data,
mids: i,
enforcePreSubmit: !1,
enforcePaymentMethodCreationManual: !1
}, n)]).then(function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(i) {
var o, s, u, l;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
if (o = (0,
g.Z)(i, 2),
s = o[0],
u = o[1],
"error" !== s.type) {
e.next = 3;
break
}
return e.abrupt("return", s);
case 3:
e.t0 = u.type,
e.next = "error" === e.t0 ? 6 : "element_payment_method_id" === e.t0 || "element_payment_method" === e.t0 ? 7 : "element_payment_method_params" === e.t0 ? 8 : 12;
break;
case 6:
return e.abrupt("return", u);
case 7:
throw new Error("Unexpected element_payment_method_id or element_payment_method");
case 8:
return e.next = 10,
dt({
slug: n,
siteKey: E._hcaptchaManager.getSiteKey("elements"),
getCaptchaToken: E.outerAction.getCaptchaToken
});
case 10:
return l = e.sent,
e.abrupt("return", {
type: "intent_mutation_params",
locale: u.locale,
clientSecret: t.intentSecret,
params: (0,
b.Z)((0,
b.Z)({}, r), {}, {
payment_method_data: u.paymentMethodParams,
payment_method_options: (0,
O.TS)(s.paymentMethodOptions, Yf(u.confirmPaymentMethodOptions)),
expected_payment_method_type: a || Vb(u.selectedPaymentMethod),
radar_options: l ? {
hcaptcha_token: l
} : null
}),
didMerchantSpecifyNetworkPreference: u.didMerchantSpecifyNetworkPreference
});
case 12:
return e.abrupt("return", (0,
P.Rz)(u));
case 13:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t) {
return e.apply(this, arguments)
}
}()));
case 8:
if (null !== t.type) {
e.next = 12;
break
}
throw new I.No("payment_method[type] is required to create a payment method");
case 12:
return e.abrupt("return", vC.all([E._transformPaymentMethodOptions(t.options), E.createPaymentMethodParamsWithData({
elementName: null,
type: t.type,
paymentMethodData: t.data,
mids: i
})]).then((function(e) {
var n = (0,
g.Z)(e, 2)
, i = n[0]
, o = n[1].paymentMethodParams;
return "error" === i.type ? i : {
type: "intent_mutation_params",
locale: null,
clientSecret: t.intentSecret,
params: (0,
b.Z)((0,
b.Z)({}, r), {}, {
payment_method_data: o,
payment_method_options: i.paymentMethodOptions,
expected_payment_method_type: a
})
}
}
)));
case 13:
return e.abrupt("return", E.parsePaymentMethodIntentMutationParams(t));
case 14:
return e.abrupt("return", E._transformPaymentMethodOptions(t.options).then((function(e) {
return "error" === e.type ? e : {
type: "intent_mutation_params",
locale: null,
clientSecret: t.intentSecret,
params: (0,
b.Z)((0,
b.Z)({}, r), {}, {
confirmation_token: t.confirmationToken,
payment_method_options: e.paymentMethodOptions,
expected_payment_method_type: a
})
}
}
)));
case 15:
return e.abrupt("return", {
type: "intent_mutation_params",
locale: null,
clientSecret: t.intentSecret,
params: (0,
b.Z)((0,
b.Z)({}, r), {}, {
expected_payment_method_type: a
})
});
case 16:
return e.abrupt("return", E.createSourceParamsWithElement({
frameId: t.frameId,
elementName: t.elementName,
type: t.type,
sourceData: t.data,
mids: i
}, n).then(function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(i) {
var o;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
if ("error" !== i.type) {
e.next = 2;
break
}
return e.abrupt("return", i);
case 2:
return e.next = 4,
dt({
slug: n,
siteKey: E._hcaptchaManager.getSiteKey("elements"),
getCaptchaToken: E.outerAction.getCaptchaToken
});
case 4:
return o = e.sent,
e.abrupt("return", {
type: "intent_mutation_params",
locale: i.locale,
clientSecret: t.intentSecret,
params: (0,
b.Z)((0,
b.Z)({}, r), {}, {
source_data: i.sourceParams,
expected_payment_method_type: a,
radar_options: o ? {
hcaptcha_token: o
} : null
})
});
case 6:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t) {
return e.apply(this, arguments)
}
}()));
case 17:
return o = E.createSourceParamsWithData({
elementName: null,
type: t.type,
sourceData: t.data,
mids: i
}),
s = o.sourceParams,
e.abrupt("return", {
type: "intent_mutation_params",
locale: null,
clientSecret: t.intentSecret,
params: (0,
b.Z)((0,
b.Z)({}, r), {}, {
source_data: s,
expected_payment_method_type: a
})
});
case 19:
return e.abrupt("return", {
type: "intent_mutation_params",
locale: null,
clientSecret: t.intentSecret,
params: (0,
b.Z)((0,
b.Z)({}, r), {}, {
source: t.source,
expected_payment_method_type: a
})
});
case 20:
return e.abrupt("return", (0,
P.Rz)(t));
case 21:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(),
this.createPaymentMethodParamsWithElement = function(e, t) {
var n, r = e.frameId, a = e.elementName, i = e.type, o = e.paymentMethodData, s = e.mids, u = e.enforcePreSubmit, l = e.enforcePaymentMethodCreationManual;
if ("payment" === a) {
var c = E.frameHub.getFrameGroup(r);
if (!c)
throw new Error("Unable to get payment element from `elements`");
return E.validateAndCreatePaymentMethodParamsWithL3PlusElement({
paymentMethodData: o,
frameId: r,
groupId: c,
mids: s,
slug: t,
enforcePreSubmit: u,
enforcePaymentMethodCreationManual: l
}).then((function(e) {
if (!e)
throw new Error("Unable to get payment element from `elements`");
return e
}
))
}
var d = W(a, i)
, p = (0,
M.$6)((n = {},
(0,
v.Z)(n, V.Yj.auBankAccount, (0,
M.kw)(H.au_becs_debit)),
(0,
v.Z)(n, V.Yj.card, (0,
M.kw)(H.card)),
(0,
v.Z)(n, V.Yj.cardNumber, (0,
M.kw)(H.card)),
(0,
v.Z)(n, V.Yj.cardExpiry, (0,
M.kw)(H.card)),
(0,
v.Z)(n, V.Yj.cardCvc, (0,
M.kw)(H.card)),
(0,
v.Z)(n, V.Yj.postalCode, (0,
M.kw)(H.card)),
(0,
v.Z)(n, V.Yj.idealBank, (0,
M.kw)(H.ideal)),
(0,
v.Z)(n, V.Yj.p24Bank, (0,
M.kw)(H.p24)),
(0,
v.Z)(n, V.Yj.fpxBank, (0,
M.kw)(H.fpx)),
(0,
v.Z)(n, V.Yj.netbankingBank, (0,
M.kw)(H.netbanking)),
(0,
v.Z)(n, V.Yj.iban, (0,
M.kw)(H.sepa_debit)),
(0,
v.Z)(n, V.Yj.epsBank, (0,
M.kw)(H.eps)),
n))
, m = (0,
M.Gu)(p, d, "type", {
element: a
}).value
, f = dC(He.log, "frame_messenger_request_state_createPaymentMethodParamsWithElement", E.controllerId, {
control: 50,
treatment: 50
});
return E._retrieveElementData(r, !0, {
useFrameMessengerMode: "treatment" === f ? "actual" : void 0,
debugPath: "createPaymentMethodParamsWithElement"
}).then((function(e) {
if ("error" === e.type)
return He.log("".concat(t, ".validation_error"), {
error: e.error,
element: a
}),
e;
var n = e.element
, i = e.locale
, u = e.pastedFields
, l = e.preferredNetwork
, c = e.didMerchantSpecifyNetworkPreference
, d = Bs.transformElementData(n, e, m, u, l);
if ("link_in_card_payment_data" === d.type) {
var p = d.data
, f = p.sharePaymentDetailsRequestParams
, h = p.paymentDetailsBillingCountry
, _ = p.meta;
return Qf(E._getControllerContext(), {
elementName: n,
locale: i,
sharePaymentDetailsRequestParams: f,
paymentDetailsBillingCountry: h,
merchantPassthroughParams: {
mode: "payment_method",
data: o
},
postalCollectionDisabled: (null == _ ? void 0 : _.isNotCollectingPostal) || !1,
frameId: r,
slug: t
}).then((function(e) {
if ("error" === e.type)
return e;
var t = (0,
O.TS)({
type: "card"
}, o, {
card: {
token: e.object.id
}
});
(0,
O.$D)(t, "billing_details.address");
var r = E.transformPaymentMethodParams({
data: t,
elementName: n,
mids: s
});
return {
type: "element_payment_method_params",
locale: i,
selectedPaymentMethod: null,
confirmPaymentMethodOptions: null,
paymentMethodParams: jb(o) ? (0,
b.Z)((0,
b.Z)({}, r), {}, {
payment_user_agent: E._metadataManager.getPaymentUserAgent(ua.QO)
}) : r
}
}
))
}
var y = d.data
, v = d.type
, g = "card" === v && d.pastedFields ? {
pastedFields: d.pastedFields
} : {}
, S = (0,
O.TS)({
type: v
}, o, y)
, k = E.transformPaymentMethodParams((0,
b.Z)({
data: S,
elementName: n,
mids: s
}, g));
return {
type: "element_payment_method_params",
locale: i,
selectedPaymentMethod: null,
confirmPaymentMethodOptions: null,
paymentMethodParams: jb(o) ? (0,
b.Z)((0,
b.Z)({}, k), {}, {
payment_user_agent: E._metadataManager.getPaymentUserAgent(ua.QO)
}) : k,
didMerchantSpecifyNetworkPreference: c
}
}
))
}
,
this.createPaymentMethodParamsWithPaymentElement = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o, s, u, l, c, d, p, m, f, _, y, v, g, C, A, M, x, N, w, T, R;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
if (r = t.frameId,
a = t.paymentMethodData,
i = t.mids,
o = t.enforcePaymentMethodCreationManual,
s = t.maybeParsedIntentSecret,
E.frameHub.doesFrameExist(r)) {
e.next = 3;
break
}
throw new I.No("Please use the same instance of `Stripe` you used to create this Element.");
case 3:
if (u = E.frameHub.getFrameGroup(r)) {
e.next = 6;
break
}
throw new Error("Could not find expected elements group");
case 6:
return e.next = 8,
E.elementsStores.strictGet(u, "createPaymentMethodParamsWithPaymentElement");
case 8:
if (l = e.sent,
c = l.getState(),
d = Pa(c),
p = Ra(c),
m = {
client_session_id: E._metadataManager.stripeJsId,
merchant_integration_source: "elements",
merchant_integration_subtype: "payment-element",
merchant_integration_version: "2021",
payment_intent_creation_flow: null != d && d.parsedClientSecret ? "standard" : "deferred",
payment_method_selection_flow: null != d && d.isAutomaticPaymentMethods ? "automatic" : "merchant_specified"
},
"manual" === c.config.paymentMethodCreation || !o) {
e.next = 15;
break
}
throw new I.No("To use createPaymentMethod with the Payment Element, your elements instance must be created with paymentMethodCreation: 'manual'.");
case 15:
return f = dC(He.log, "frame_messenger_request_state_createPaymentMethodParamsWithPaymentElement", E.controllerId, {
control: 50,
treatment: 50
}),
_ = function(e) {
var t = (0,
Zf.jW)(E.frameHub, u, e);
return t ? "treatment" === f ? (0,
Zf.XQ)(E.frameHub, t) : E.requestState(t) : vC.resolve(null)
}
,
e.next = 19,
_(L.NC.PAYMENT_ELEMENT);
case 19:
return y = e.sent,
e.next = 22,
_(L.NC.LINK_AUTHENTICATION_ELEMENT);
case 22:
if (v = e.sent,
g = (0,
Zf.jW)(E.frameHub, u, L.NC.LINK_AUTHENTICATION_ELEMENT),
C = g ? (0,
b.Z)((0,
b.Z)({}, hC(l.getState())), {}, {
frameId: g
}) : null,
A = (0,
O.Dg)(v),
M = (0,
O.Dg)(C),
!(0,
O.Xy)(A, M))
try {
x = A && M && "object" == typeof A && "object" == typeof M ? (0,
O.uf)(A, M) : {
oldStateValue: A,
newStateValue: M
},
He.log("debug.controller.state_mismatch", {
element: "linkAuthentication",
frameId: g,
source: "createPaymentMethodParamsWithPaymentElement",
oldStateExists: !!A,
newStateExists: !!M,
diff: JSON.stringify((0,
O.M4)(x, {
allowListKeys: ["error"]
}))
})
} catch (e) {
He.log("debug.controller.state_mismatch", {
element: "linkAuthentication",
frameId: g,
source: "createPaymentMethodParamsWithPaymentElement",
error: e
})
}
return N = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
var r, o, s;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return r = t.paymentMethodData,
o = t.fields,
e.t0 = be,
e.t1 = b.Z,
e.t2 = (0,
b.Z)((0,
b.Z)({}, ff(a, r)), {}, {
type: r.type
}, E._metadataManager.getPaymentMetadata(null)),
e.t3 = {},
e.next = 7,
Kb(E._getControllerContext(), u);
case 7:
return e.t4 = e.sent,
e.t5 = m,
e.t6 = {
payment_user_agent: e.t4,
client_attribution_metadata: e.t5
},
e.t7 = i || {},
e.t8 = (0,
e.t1)(e.t2, e.t3, e.t6, e.t7),
s = (0,
e.t0)(e.t8),
function() {
a.allow_redisplay && (s.allow_redisplay = a.allow_redisplay)
}(),
To(o).forEach((function(e) {
var t = e.fieldOption
, r = e.paymentMethodDataPath
, a = e.fieldsOptionPath;
if ("never" === t && void 0 === (0,
O.uu)(s, r)) {
var i = a ? "fields.".concat(a) : "the `fields` option"
, o = "";
switch (n) {
case "confirm_payment_intent":
case "confirm_setup_intent":
o = "confirmParams.payment_method_data";
break;
case "create_confirmation_token":
case "update_payment_intent":
o = "params.payment_method_data";
break;
case "create_payment_method":
o = "params";
break;
default:
(0,
P.fv)(n)
}
throw new I.No(['You specified "never" for '.concat(i, " when creating the payment Element,"), "but did not pass ".concat(o, ".").concat(r, " when calling ").concat(kC[n], "."), "If you opt out of collecting data via the payment Element using the fields option,", "the data must be passed in when calling ".concat(kC[n], ".")].join(" "))
}
}
)),
e.abrupt("return", s);
case 17:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t) {
return e.apply(this, arguments)
}
}(),
e.next = 31,
(0,
k.Z)((0,
S.Z)().mark((function e() {
var t, r;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
if (y) {
e.next = 2;
break
}
throw new I.No("We could not retrieve data from the specified Element.\n Please make sure the Element you are attempting to use is still mounted.");
case 2:
if ("hidden" !== y.type) {
e.next = 4;
break
}
throw new I.No("We could not retrieve data from the specified Element.\n Please make sure the Element you are attempting to use has a payment method selection.");
case 4:
if ("create_payment_method" === n || !E._recentlyCreatedPaymentMethod) {
e.next = 8;
break
}
return t = E._recentlyCreatedPaymentMethod,
E._recentlyCreatedPaymentMethod = null,
e.abrupt("return", {
type: "payment_method",
paymentMethod: t.id,
session: y.session,
locale: y.locale,
selectedPaymentMethod: t.type
});
case 8:
return e.next = 10,
E.outerInitiatedActions.showWalletIfNecessary({
groupId: u,
locale: y.locale
});
case 10:
return r = e.sent,
e.abrupt("return", (0,
k.Z)((0,
S.Z)().mark((function e() {
var t, n, a, i, o, s, l;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
if (t = y,
!r || "payment_method" === y.type) {
e.next = 8;
break
}
if ("cancelled" !== r.type) {
e.next = 4;
break
}
return e.abrupt("return", {
type: "error",
locale: p,
error: {
code: "incomplete",
type: "input_validation_error",
messageParams: {}
},
session: y.session
});
case 4:
if ("error" !== r.type) {
e.next = 7;
break
}
return n = {
type: "input_validation_error",
code: "incomplete_payment_details",
messageParams: {}
},
e.abrupt("return", {
type: "error",
locale: p,
error: r.error || n,
session: y.session
});
case 7:
t = rh(y, r.token);
case 8:
if (!Fa(c) || "payment_method_data" !== t.type && "link_new_card" !== t.type && "link_update_card" !== t.type && "link_sign_up" !== t.type && "link_payment_details" !== t.type) {
e.next = 17;
break
}
return a = Qp(Ud)(c),
e.next = 12,
E.elementsStores.strictGet(u, "createPaymentMethodParamsWithElements");
case 12:
i = e.sent.getState(),
o = sm(i, a),
s = um(i, Ud, null == o ? void 0 : o.phone),
l = ff(t.paymentMethodData.billing_details, (0,
b.Z)((0,
b.Z)({}, o), {}, {
phone: s
})),
t.paymentMethodData.billing_details = l;
case 17:
if (v && "link_payment_details" !== t.type) {
e.next = 19;
break
}
return e.abrupt("return", t);
case 19:
if ("payment_method" !== t.type) {
e.next = 21;
break
}
return e.abrupt("return", t);
case 21:
if ("error" !== t.type && "error" !== v.type) {
e.next = 23;
break
}
throw new Error("No available element data");
case 23:
return e.abrupt("return", (0,
b.Z)((0,
b.Z)({}, t), {}, {
paymentMethodData: (0,
b.Z)((0,
b.Z)({}, t.paymentMethodData), {}, {
billing_details: (0,
b.Z)((0,
b.Z)({}, t.paymentMethodData.billing_details), {}, {
email: v.email
})
})
}));
case 24:
case "end":
return e.stop()
}
}
), e)
}
)))());
case 12:
case "end":
return e.stop()
}
}
), e)
}
)))();
case 31:
return w = e.sent,
e.next = 34,
(0,
k.Z)((0,
S.Z)().mark((function e() {
var t, r, a;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return e.next = 2,
(0,
k.Z)((0,
S.Z)().mark((function e() {
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
if ("payment_method_data" === w.type && "bacs_debit" === w.selectedPaymentMethod) {
e.next = 2;
break
}
return e.abrupt("return", null);
case 2:
return e.t0 = E.sharedInnerData,
e.next = 5,
N({
paymentMethodData: w.paymentMethodData,
fields: w.fields
});
case 5:
return e.t1 = e.sent,
e.t0.set.call(e.t0, "bacsData", e.t1),
e.abrupt("return", E.outerAction.showBacsMandateConfirmation(w.session.bacsDebitInfo));
case 8:
case "end":
return e.stop()
}
}
), e)
}
)))();
case 2:
if (null === (t = e.sent) || "payment_method" === w.type) {
e.next = 6;
break
}
if ("reject" !== t) {
e.next = 6;
break
}
return e.abrupt("return", {
type: "error",
locale: p,
error: {
code: "modify_bacs_debit_bank_details",
type: "input_validation_error",
messageParams: {}
},
session: w.session
});
case 6:
return e.next = 8,
(0,
k.Z)((0,
S.Z)().mark((function e() {
var t;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
if ("payment_method_data" === w.type && "sepa_debit" === w.selectedPaymentMethod && "sepa_debit" === w.paymentMethodData.type && "microdeposits" === (null === (t = w.session.paymentMethodOptions.sepa_debit) || void 0 === t ? void 0 : t.verification_method)) {
e.next = 2;
break
}
return e.abrupt("return", null);
case 2:
return e.abrupt("return", E.outerAction.showSepaDebitMicrodepositsConfirmation(w.paymentMethodData.sepa_debit.iban.slice(-4)));
case 3:
case "end":
return e.stop()
}
}
), e)
}
)))();
case 8:
if (null === (r = e.sent) || "payment_method" === w.type) {
e.next = 12;
break
}
if ("reject" !== r) {
e.next = 12;
break
}
return e.abrupt("return", {
type: "error",
locale: p,
error: {
code: "sepa_debit_microdeposits_unconfirmed",
type: "input_validation_error",
messageParams: {}
},
session: w.session
});
case 12:
return e.next = 14,
(0,
k.Z)((0,
S.Z)().mark((function e() {
var t;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
if ("payment_method_data" === w.type && "acss_debit" === w.selectedPaymentMethod) {
e.next = 2;
break
}
return e.abrupt("return", null);
case 2:
if (s) {
e.next = 6;
break
}
if ("confirm_payment_intent" === n || "confirm_setup_intent" === n || "update_payment_intent" === n) {
e.next = 5;
break
}
throw new I.No("You need to pass a PaymentIntent or SetupIntent client secret to Elements in order to create an ACSS PaymentMethod directly.");
case 5:
throw new Error("Parsed intent secret is required");
case 6:
return e.next = 8,
N({
paymentMethodData: w.paymentMethodData,
fields: w.fields
});
case 8:
return t = e.sent,
e.abrupt("return", E.outerAction.showAcssBankCollection({
parsedIntentSecret: s,
collectedBillingDetails: t.billing_details
}));
case 10:
case "end":
return e.stop()
}
}
), e)
}
)))();
case 14:
if (null === (a = e.sent) || "payment_method" === w.type) {
e.next = 19;
break
}
if ("error" !== a.type) {
e.next = 18;
break
}
return e.abrupt("return", {
type: "error",
locale: p,
error: {
code: "incomplete_payment_details",
type: "input_validation_error",
messageParams: {}
},
session: w.session
});
case 18:
return e.abrupt("return", {
type: "payment_method",
paymentMethod: a.paymentMethod,
selectedPaymentMethod: "acss_debit",
locale: p,
session: w.session,
confirmPaymentMethodOptions: void 0
});
case 19:
return e.abrupt("return", null);
case 20:
case "end":
return e.stop()
}
}
), e)
}
)))();
case 34:
return T = e.sent,
R = (0,
k.Z)((0,
S.Z)().mark((function e() {
var t, r, a, o, s, l, f, _, y, v, g, C, A, M, x, O, R, L, D, U, j, B, F, q, K, V, z, H, Y, W, J, X, Q, $, ee, te, ne, re, ae, ie, oe, se, ue;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
t = T || w,
r = function(e) {
var n = G(e, t.locale)
, r = n.localizedError;
return n.reports.forEach((function(e) {
return He.log.apply(He, (0,
Z.Z)(e))
}
)),
{
type: "error",
error: r,
locale: t.locale
}
}
,
a = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(n, r, a, o) {
var s, l, c, d, f, _, y, v, g, k, C, Z, A, M, P, x, I, N, w, T, O;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return d = n && "confirmPaymentMethodOptions"in n ? n.confirmPaymentMethodOptions : null,
null !== (s = d) && void 0 !== s && s.data && "setup_future_usage"in (null === (l = d) || void 0 === l ? void 0 : l.data) && (f = "on_session" === d.data.setup_future_usage ? "off_session" : d.data.setup_future_usage,
d = {
type: "link",
data: {
setup_future_usage: f
}
}),
e.next = 4,
E.elementsStores.strictGet(u, "elementPaymentMethodParamsForLink");
case 4:
if (_ = e.sent,
y = _.getState,
v = _.dispatch,
g = y(),
k = Qc(g),
C = ud(g),
Z = rd(g, "CREATE_PAYMENT_DETAILS"),
A = rd(g, "SIGN_UP"),
M = id(g),
!n || !("selectedPaymentMethod"in n) || "card" !== n.selectedPaymentMethod) {
e.next = 18;
break
}
if (k && "ERROR" !== Z && "ERROR" !== A && !M && "CARD" === k.type) {
e.next = 18;
break
}
return v({
type: "CONSUMER.LINK_FUNNEL_CONFIRMATION_LINK_TYPE",
confirmationType: "FALLBACK"
}),
He.log("link.fallback_to_card_payment", {
reason: "error_status_or_missing_payment_details",
hasPaymentDetails: !!k,
hasConfirmLinkInternalServerError: M,
paymentDetailsRequestStatus: Z,
signUpRequestStatus: A,
paymentDetailsType: (null == k ? void 0 : k.type) || null
}),
e.abrupt("return", n);
case 18:
if (k) {
e.next = 20;
break
}
throw new Error("Missing selected payment details");
case 20:
return S = {
payment_details_id: k.id,
backup_payment_details_ids: C ? k.backup_ids : []
},
R = void 0,
L = void 0,
D = void 0,
R = S.credentials,
L = S.auth_session_client_secret,
D = (0,
h.Z)(S, bt),
P = (0,
b.Z)((0,
b.Z)((0,
b.Z)({}, D), R ? {
credentials: {
consumer_session_client_secret: (0,
gt.P9)(R.consumer_session_client_secret)
}
} : {}), L ? {
auth_session_client_secret: (0,
gt.P9)(L)
} : {}),
x = null === (c = k.metadata) || void 0 === c ? void 0 : c.cvc,
"CARD" === k.type && x && (P = (0,
b.Z)((0,
b.Z)({}, P), {}, {
card: {
cvc: x
}
})),
e.t0 = b.Z,
e.t1 = (0,
b.Z)({
type: "link"
}, E._metadataManager.getPaymentMetadata(null)),
e.t2 = {},
e.next = 28,
Kb(E._getControllerContext(), u);
case 28:
if (e.t3 = e.sent,
e.t4 = m,
e.t5 = P,
e.t6 = r,
e.t7 = a,
e.t8 = o,
e.t9 = {
payment_user_agent: e.t3,
client_attribution_metadata: e.t4,
link: e.t5,
billing_details: e.t6,
metadata: e.t7,
allow_redisplay: e.t8
},
e.t10 = i,
I = (0,
e.t0)(e.t1, e.t2, e.t9, e.t10),
n && "selectedPaymentMethod"in n && "card" === n.selectedPaymentMethod && "paymentMethodParams"in n && (I.pasted_fields = null == n || null === (N = n.paymentMethodParams) || void 0 === N ? void 0 : N.pasted_fields),
w = Ja(g) && "BANK_ACCOUNT" === k.type,
T = yd(g),
!(Wa(g) && !w || T)) {
e.next = 55;
break
}
return O = T ? "us_bank_account" : "card",
d && "type"in d && (d.type = O),
e.t11 = oc,
e.t12 = x,
e.t13 = i,
e.next = 48,
Kb(E._getControllerContext(), u);
case 48:
return e.t14 = e.sent,
e.t15 = O,
e.t16 = g,
e.t17 = I.metadata,
e.t18 = I.allow_redisplay,
e.t19 = {
cvc: e.t12,
mids: e.t13,
paymentUserAgent: e.t14,
selectedPaymentMethodType: e.t15,
state: e.t16,
metadata: e.t17,
allow_redisplay: e.t18
},
e.abrupt("return", (0,
e.t11)(e.t19).then((function(e) {
if ("string" == typeof e.payment_method)
return {
type: "element_payment_method_id",
paymentMethod: e.payment_method,
confirmPaymentMethodOptions: d,
selectedPaymentMethod: O,
locale: p,
session: t.session
};
if ("object" == typeof e.payment_method)
return {
type: "element_payment_method",
paymentMethod: e.payment_method,
confirmPaymentMethodOptions: d,
selectedPaymentMethod: O,
locale: p,
session: t.session
};
throw new Error("Unexpected sharePaymentDetailsResponse payment_method type")
}
)).catch((function(e) {
return "ConsumerApiError" === e.name && n ? (v({
type: "CONSUMER.LINK_FUNNEL_CONFIRMATION_LINK_TYPE",
confirmationType: "FALLBACK"
}),
He.log("link.fallback_to_card_payment", {
reason: "consumer_api_error"
}),
n) : {
type: "error",
error: G(e, p).localizedError,
locale: p
}
}
)));
case 55:
return e.abrupt("return", {
type: "element_payment_method_params",
selectedPaymentMethod: "link",
confirmPaymentMethodOptions: d,
paymentMethodParams: I,
locale: t.locale,
session: t.session
});
case 56:
case "end":
return e.stop()
}
var S, R, L, D
}
), e)
}
)));
return function(t, n, r, a) {
return e.apply(this, arguments)
}
}(),
o = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
var n, r, a, i, o;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return n = t.paymentMethodData,
r = t.fields,
a = t.selectedPaymentMethod,
i = t.session,
o = null,
"payment_method_data" !== t.type && "link_sign_up" !== t.type || (o = t.confirmPaymentMethodOptions),
e.t0 = p,
e.t1 = a,
e.next = 7,
N({
paymentMethodData: n,
fields: r
});
case 7:
return e.t2 = e.sent,
e.t3 = o,
e.t4 = i,
e.abrupt("return", {
type: "element_payment_method_params",
locale: e.t0,
selectedPaymentMethod: e.t1,
paymentMethodParams: e.t2,
confirmPaymentMethodOptions: e.t3,
session: e.t4
});
case 11:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t) {
return e.apply(this, arguments)
}
}(),
s = function(e, t) {
var n, r, a, i = null == e || null === (n = e.postal_code) || void 0 === n || null === (r = n.toString()) || void 0 === r ? void 0 : r.replace(/\s/g, ""), o = null == e ? void 0 : e.country, s = null == t || null === (a = t.postal_code) || void 0 === a ? void 0 : a.replace(/\s/g, ""), u = null == t ? void 0 : t.country_code, l = i && i !== s;
"US" !== o && "US" !== u || (l = !!i && i.substring(0, 5) !== (null == s ? void 0 : s.substring(0, 5)));
var c = !!o && o !== u;
return (l || c) && He.log("link.mismatch_billing_details", {
mismatch_postal_code: l,
mismatch_country: c,
has_merchant_line1: !(null == e || !e.line1),
has_merchant_line2: !(null == e || !e.line2),
has_merchant_city: !(null == e || !e.city),
has_merchant_state: !(null == e || !e.state),
has_merchant_postal_code: !(null == e || !e.postal_code),
has_merchant_country: !(null == e || !e.country)
}),
{
mismatchPostalCode: l,
mismatchCountry: c
}
}
,
e.t0 = n,
e.next = "confirm_payment_intent" === e.t0 || "confirm_setup_intent" === e.t0 ? 8 : 10;
break;
case 8:
return "error" !== t.type && "hidden" !== t.type && He.log("".concat(n, ".type.").concat(t.type), {
livemode: t.session.livemode
}),
e.abrupt("break", 10);
case 10:
e.t1 = t.type,
e.next = "error" === e.t1 ? 13 : "payment_method_data" === e.t1 ? 23 : "payment_method" === e.t1 ? 24 : "link_sign_up" === e.t1 ? 25 : "link_new_card" === e.t1 ? 33 : "link_update_card" === e.t1 ? 56 : "link_payment_details" === e.t1 ? 66 : "custom_payment_method_data" === e.t1 ? 87 : "hidden" === e.t1 ? 88 : 89;
break;
case 13:
if (!t.paymentDetails) {
e.next = 17;
break
}
return e.next = 16,
E.elementsStores.strictGet(u, "findBillingAddressMismatches");
case 16:
e.sent.dispatch({
type: "PAYMENT.CONFIRM_FAILED_FOR_SAVED_PAYMENT",
savedPayment: {
mode: "consumer",
id: t.paymentDetails.id,
paymentDetails: t.paymentDetails
},
session: d
});
case 17:
if (!SC(t.error)) {
e.next = 21;
break
}
return e.next = 20,
E.elementsStores.strictGet(u, "createPaymentMethodParamsWithPaymentElement");
case 20:
e.sent.dispatch({
type: "PAYMENT.CONFIRM_FAILED_FOR_VIEW"
});
case 21:
return He.log("".concat(n, ".validation_error"), {
error: t.error,
element: "payment",
link_payment_details_id: (null === (l = t.paymentDetails) || void 0 === l ? void 0 : l.id) || null,
livemode: t.session.livemode
}),
e.abrupt("return", r(t.error));
case 23:
return e.abrupt("return", o(t));
case 24:
return e.abrupt("return", {
type: "element_payment_method_id",
locale: p,
selectedPaymentMethod: t.selectedPaymentMethod,
paymentMethod: t.paymentMethod,
session: t.session,
confirmPaymentMethodOptions: t.confirmPaymentMethodOptions
});
case 25:
return e.next = 27,
o(t);
case 27:
return f = e.sent,
_ = t.paymentMethodData,
y = t.fields,
v = t.email,
g = t.linkMobilePhone,
C = t.linkMobilePhoneCountry,
A = t.linkLegalName,
M = t.isLinkOptInTouched,
x = t.shouldCollectLinkLegalName,
e.next = 31,
N({
paymentMethodData: _,
fields: y
});
case 31:
return O = e.sent,
e.abrupt("return", dt({
slug: "link_sign_up",
siteKey: d.linkSettings.linkHcaptchaSiteKey,
getCaptchaToken: E.outerAction.getCaptchaToken
}).catch((function(e) {
return He.log("link.sign_up.hcaptcha_get_token.error", {
error: e
}),
null
}
)).then(function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return e.next = 2,
E.elementsStores.strictGet(u, "createPaymentMethodParamsWithPaymentElement");
case 2:
return e.abrupt("return", e.sent.dispatch($m(M, x, v, g, C, A, O, t, E._metadataManager.stripeJsId)).then((function() {
return vC.resolve(a(f, O.billing_details, O.metadata, O.allow_redisplay))
}
)));
case 3:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t) {
return e.apply(this, arguments)
}
}()));
case 33:
return e.next = 35,
o(t);
case 35:
return R = e.sent,
L = t.paymentMethodData,
D = t.fields,
e.next = 39,
N({
paymentMethodData: L,
fields: D
});
case 39:
if (U = e.sent,
j = U.card,
B = U.billing_details,
F = U.metadata,
B && null != B.email) {
e.next = 53;
break
}
return e.next = 46,
E.elementsStores.strictGet(u, "createPaymentMethodParamsWithPaymentElement");
case 46:
return q = e.sent,
(0,
q.dispatch)({
type: "CONSUMER.LINK_FUNNEL_CONFIRMATION_LINK_TYPE",
confirmationType: "FALLBACK"
}),
He.log("link.fallback_to_card_payment", {
reason: "missing_billing_details",
hasBillingDetails: !!B,
hasEmail: null != B.email
}),
e.abrupt("return", R);
case 53:
return e.next = 55,
E.elementsStores.strictGet(u, "createPaymentMethodParamsWithPaymentElement");
case 55:
return e.abrupt("return", e.sent.dispatch(Fm(j, B, B.email, L.nickname)).then((function() {
return vC.resolve(a(R, B, F))
}
)));
case 56:
return K = t.paymentMethodData,
V = t.fields,
e.next = 59,
N({
paymentMethodData: K,
fields: V
});
case 59:
return z = e.sent,
H = z.billing_details,
Y = z.metadata,
W = !1,
e.next = 65,
E.elementsStores.strictGet(u, "createPaymentMethodParamsWithPaymentElement");
case 65:
return e.abrupt("return", e.sent.dispatch(Gm(t.paymentDetails, t.paymentMethodData.card, t.paymentMethodData.billing_details, W, K.nickname)).then((function() {
return vC.resolve(a(void 0, H, Y))
}
)));
case 66:
return X = t.paymentMethodData,
Q = t.fields,
e.next = 69,
N({
paymentMethodData: X,
fields: Q
});
case 69:
if ($ = e.sent,
ee = $.billing_details,
te = $.metadata,
ne = t.paymentDetails.billing_address,
ce = ne,
de = void 0,
de = null == (le = ee) ? void 0 : le.address,
re = (0,
b.Z)((0,
b.Z)({}, le), {}, {
address: (0,
b.Z)((0,
b.Z)({}, de), {}, {
postal_code: (null == de ? void 0 : de.postal_code) || (null == ce ? void 0 : ce.postal_code),
country: (null == de ? void 0 : de.country) || (null == ce ? void 0 : ce.country_code)
})
}),
ae = s(null == ee ? void 0 : ee.address, ne),
ie = ae.mismatchPostalCode,
oe = ae.mismatchCountry,
!(Fa(c) || ie || oe) || !("card"in X) || "CARD" !== t.paymentDetails.type) {
e.next = 81;
break
}
return se = !1,
e.next = 80,
E.elementsStores.strictGet(u, "createPaymentMethodParamsWithPaymentElement");
case 80:
return e.abrupt("return", e.sent.dispatch(Gm(t.paymentDetails, X.card, re, se, void 0)).then((function() {
return vC.resolve(a(void 0, re, te))
}
)));
case 81:
if ("BANK_ACCOUNT" !== t.paymentDetails.type || null != ne && ne.name || null === (J = X.billing_details) || void 0 === J || !J.name) {
e.next = 86;
break
}
return re.name = null === (ue = X.billing_details) || void 0 === ue ? void 0 : ue.name,
e.next = 85,
E.elementsStores.strictGet(u, "createPaymentMethodParamsWithPaymentElement");
case 85:
return e.abrupt("return", e.sent.dispatch(Xm(t.paymentDetails, re, !1)).then((function() {
return vC.resolve(a(void 0, re, te))
}
)));
case 86:
return e.abrupt("return", vC.resolve(a(void 0, re, te)));
case 87:
throw new I.No("Stripe does not support processing the selected custom payment method ".concat(t.selectedPaymentMethod, ". Make sure you're handling the custom payment method individually."));
case 88:
throw new Error("Unexpected hidden type");
case 89:
return e.abrupt("return", (0,
P.Rz)(t));
case 90:
case "end":
return e.stop()
}
var le, ce, de
}
), e)
}
)))(),
e.abrupt("return", R);
case 37:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}(),
this._getControllerContext = function() {
return {
controller: E,
logger: He,
integrationMetadata: E._metadataManager,
outerInitiatedActions: E.outerInitiatedActions,
outerActions: E.outerAction,
apiClient: E._apiClient,
cache: E._cache,
elementsStores: E.elementsStores,
elementsGroupManager: E.elementsGroupManager,
frameHub: E.frameHub,
sharedInnerData: E.sharedInnerData,
cardElementState: E._cardElementState,
hcaptchaManager: E._hcaptchaManager,
linkApiClient: E.linkApiClient
}
}
,
this.innerInitiatedActions = {
COMPLETE_CHALLENGE_3DS2: this.injectControllerContext(uS),
RETRIEVE_ISSUING_CARD: this.injectControllerContext(dS),
VERIFY_CAPTCHA_CHALLENGE: this.injectControllerContext(vS),
CANCEL_CAPTCHA_CHALLENGE: this.injectControllerContext(gS),
COMPLETE_CARD_DETAILS_RECOLLECTION_CHALLENGE: this.injectControllerContext(SS),
LOOKUP_LOCALE: this.injectControllerContext(f_),
ELEMENTS_DISPATCH: this.injectControllerContext(Ib),
GET_ELEMENTS_STATE: this.injectControllerContext(Nb),
RETRIEVE_CARD_METADATA: this.injectControllerContext(lS),
SHARED_INNER_DATA_CONSUME: function(e) {
return E.sharedInnerData.consume(e.key)
},
SHARED_INNER_DATA_GET: function(e) {
return E.sharedInnerData.get(e.key)
},
SHARED_INNER_DATA_DELETE: function(e) {
return E.sharedInnerData.delete(e.key)
},
SHARED_INNER_DATA_SET: function(e) {
return E.sharedInnerData.set(e.key, e.value)
},
RETRIEVE_WALLET_CONFIG: this.injectControllerContext(ak),
RETRIEVE_LINK_SHARED_SESSION_CONTEXT: this.injectControllerContext(bS),
RETRIEVE_WALLET_CONFIG_AVAILABILITY: this.injectControllerContext(HS),
RETRIEVE_LINK_IN_CARD_CONFIG: this.injectControllerContext(pS),
TEMPORARY_AND_DANGEROUS_GET_CONSUMER_INFO: this.injectControllerContext(mS),
DANGEROUS_UNCACHED_UNLOGGED_LOOKUP: this.injectControllerContext(mC),
RECORD_ELEMENTS_PERFORMANCE_TIMELINE: function(e) {
var t = e.frameSrc
, n = e.entries;
E._performanceTimelineReporter.recordEntries(n, t)
},
PERFORM_POST_MOUNT_ACTIONS: function() {
E._hcaptchaManager.isPassiveCaptchaEnabled && ft(E._hcaptchaManager, E.frameHub)
},
RECEIVE_ELEMENTS_SESSIONS_RESPONSE: this.injectControllerContext(xb),
CREATE_APPLE_PAY_SESSION: this.injectControllerContext(ok),
TOKENIZE_WITH_DATA: this.injectControllerContext(yC)
},
this.tokenizeWithElement = function(e) {
var t = e.frameId
, n = e.elementName
, r = e.tokenData
, a = e.mids
, i = dC(He.log, "frame_messenger_request_state_tokenizeWithElement", E.controllerId, {
control: 50,
treatment: 50
});
return E._retrieveElementData(t, !0, {
useFrameMessengerMode: "treatment" === i ? "actual" : void 0,
debugPath: "tokenizeWithElement"
}).then((function(e) {
if ("error" === e.type) {
var i = e.error
, o = e.locale
, s = {
error: i,
element: n
};
return He.log("tokenize.validation_error", s),
{
type: "error",
error: i,
locale: o
}
}
var u = e.value
, l = e.element
, c = e.pastedFields
, d = e.preferredNetwork
, p = st(l, u, c, d);
if ("link_in_card_payment_data" === p.type) {
var m = p.data
, f = m.sharePaymentDetailsRequestParams
, h = m.paymentDetailsBillingCountry
, _ = m.meta;
return Qf(E._getControllerContext(), {
locale: e.locale,
elementName: l,
sharePaymentDetailsRequestParams: f,
paymentDetailsBillingCountry: h,
merchantPassthroughParams: {
mode: "token",
data: r
},
postalCollectionDisabled: (null == _ ? void 0 : _.isNotCollectingPostal) || !1,
frameId: t,
slug: "tokenize"
})
}
return p.warnings.forEach((function(e) {
return E.warn(e)
}
)),
kd(E._getControllerContext(), {
type: p.type,
locale: e.locale,
elementName: l,
mids: a,
pastedFields: p.pastedFields,
clientCardBrand: e.clientCardBrand,
elementData: p.data,
tokenData: r
})
}
))
}
,
this._retrieveElementData = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
var n, r, a, i, o, s, u, l, c, d, p, m, f, h, _, y, v, g, k, C, Z, A, M, P, x, N = arguments;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
if (n = !(N.length > 1 && void 0 !== N[1]) || N[1],
r = N.length > 2 ? N[2] : void 0,
!E.frameHub.doesFrameExist(t)) {
e.next = 51;
break
}
if (o = E.frameHub.getFrameGroup(t),
s = E.frameHub.getFrameType(t),
u = [],
o && n ? s ? u = E.frameHub.getGroupFrames(o, {
types: [s]
}) : (He.log("debug.retrieve_element_data.frame_with_no_frame_type", {
frameId: t
}),
u = []) : u = [t],
l = function(e, t) {
return vC.all(e.map((function(e) {
return E.requestState(e, t)
}
)))
}
,
e.prev = 8,
"actual" !== (null == r ? void 0 : r.useFrameMessengerMode)) {
e.next = 15;
break
}
return e.next = 12,
vC.all(u.map((function(e) {
return (0,
Zf.XQ)(E.frameHub, e)
}
)));
case 12:
e.t0 = e.sent,
e.next = 18;
break;
case 15:
return e.next = 17,
l(u, {
useFrameMessengerMode: null == r ? void 0 : r.useFrameMessengerMode,
debugPath: null == r ? void 0 : r.debugPath
});
case 17:
e.t0 = e.sent;
case 18:
if (c = e.t0,
d = {},
p = {},
_ = !1,
0 !== c.filter((function(e) {
return e && e.frameId === t
}
)).length) {
e.next = 24;
break
}
throw new I.No("We could not retrieve data from the specified Element.\n Please make sure the Element you are attempting to use is still mounted.");
case 24:
y = 0;
case 25:
if (!(y < c.length)) {
e.next = 43;
break
}
if (!(v = c[y])) {
e.next = 40;
break
}
if (g = v.meta,
k = v.value,
C = v.locale,
Z = v.element,
A = v.frameId,
M = v.pastedFields,
P = v.preferredNetwork,
x = v.didMerchantSpecifyNetworkPreference,
g.brand && (m = g.brand),
g.accountHolderType && (f = g.accountHolderType),
A === t && (a = C,
i = Z),
P && (h = P),
x && (_ = x),
!g.error) {
e.next = 38;
break
}
return e.abrupt("return", {
type: "error",
error: g.error,
locale: g.locale
});
case 38:
d = (0,
O.TS)({}, d, k),
p = (0,
b.Z)((0,
b.Z)({}, p), M);
case 40:
y += 1,
e.next = 25;
break;
case 43:
return e.abrupt("return", (0,
b.Z)((0,
b.Z)((0,
b.Z)((0,
b.Z)({
type: "data",
value: d,
locale: a,
element: i,
pastedFields: Object.keys(p)
}, m ? {
clientCardBrand: m
} : {}), f ? {
accountHolderType: f
} : {}), h ? {
preferredNetwork: h
} : {}), _ ? {
didMerchantSpecifyNetworkPreference: _
} : {}));
case 46:
throw e.prev = 46,
e.t1 = e.catch(8),
e.t1;
case 49:
e.next = 52;
break;
case 51:
throw new I.No("Please use the same instance of `Stripe` you used to create this Element to create your Source or Token.");
case 52:
case "end":
return e.stop()
}
}
), e, null, [[8, 46]])
}
)));
return function(t) {
return e.apply(this, arguments)
}
}(),
this.outerAction = (s = {},
["localStorageSemaphoreAcquire", "localStorageSemaphoreRelease", "getCaptchaToken", "getFramePrecedence", "showBacsMandateConfirmation", "showSepaDebitMicrodepositsConfirmation", "showAcssBankCollection", "showUpeWallet", "mountPrbWarningModal", "unmountPrbWarningModal"].forEach((function(e) {
s[e] = function(t) {
var n = E.requests.create()
, r = n.nonce
, a = n.promise;
return E.frameHub.sendMessageToParent({
action: "stripe-outer-controller-action-request",
payload: {
nonce: r,
actionName: e,
request: t
}
}),
a
}
}
)),
s),
this.outerInitiatedActions = {
eceNotifySheetAuthenticationNeeded: this.injectControllerContext(Gk),
confirmSetupIntent: (f = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
var n;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return n = "confirm_setup_intent",
(0,
O.Xy)(t.mids, E._apiClient.getMids()) || He.log("debug.mids_mismatch", {
path: "confirmSetupIntent",
reqMids: t.mids,
apiClientMids: E._apiClient.getMids()
}),
e.abrupt("return", E.confirmIntentParams(t, n).then(function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(r) {
var a, i, o, s, u, l, c, d, p, m, f, h, _, y, v, g, k, C, Z, M, P, x, w, T, R, L, D, U, j, B;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
if ("error" !== r.type) {
e.next = 2;
break
}
return e.abrupt("return", r);
case 2:
if (i = r.locale,
o = r.params,
s = r.clientSecret,
u = E._metadataManager.resolveLocale(i),
l = "elements" === t.tag && "link" === o.expected_payment_method_type,
"elements" !== t.tag) {
e.next = 11;
break
}
return e.next = 8,
E.elementsStores.getForExistingGroup(t.groupId, n);
case 8:
e.t0 = e.sent.store,
e.next = 12;
break;
case 11:
e.t0 = null;
case 12:
if (c = e.t0,
d = (0,
b.Z)((0,
b.Z)({}, o), E._apiClient.getAuthenticationParams()),
p = Boolean(c && "FALLBACK" === md(null == c ? void 0 : c.getState())),
m = $(t),
f = Sd(E._cardElementState, {
element: m,
store: c,
paymentMethod: null === (a = o.payment_method_data) || void 0 === a ? void 0 : a.type
}),
h = Hf({
isCheckingOutWithLink: f,
isLinkFallbackToCard: p,
linkFunnel: cl,
element: m,
type: "setup-intent"
}),
l && (null == c || c.dispatch({
type: "CONSUMER.CONFIRM_LINK_SETUP_INTENT.PENDING"
})),
!o.expected_payment_method_type || !Pf(o.expected_payment_method_type)) {
e.next = 21;
break
}
return e.abrupt("return", sf({
type: "error",
error: {
code: "external_payment_method_selected",
extra_fields: {
selectedPaymentMethod: o.expected_payment_method_type
}
}
}, u, {
logger: He
}));
case 21:
if ("PAYMENT_INTENT" !== s.type) {
e.next = 23;
break
}
throw new I.No("Your code called confirmSetup() but you passed a client_secret associated with a PaymentIntent. Did you mean to call confirmPayment() instead?");
case 23:
if (!(0,
N.uN)(E._metadataManager.betas, N.M4.deferred_intent_pe_optional_amount_beta_0) || !c) {
e.next = 29;
break
}
if (y = c.getState(),
!(v = null === (_ = y.config.deferredIntent) || void 0 === _ ? void 0 : _.mode) || "setup" === v) {
e.next = 29;
break
}
throw new I.No("It looks like you have ".concat(null == v ? void 0 : v.toString(), " mode in your Elements options. Please call elements.update() to set the mode to setup before calling stripe.confirmSetup()"));
case 29:
return c && (g = c.getState().config.session) && a_(n, g, r, E),
null == h || h.attempt(),
e.prev = 31,
e.next = 34,
E._isLinkPaymentMethodData(o.payment_method_data) ? E.linkApiClient.setupIntent.confirm({
id: s.id,
clientSecret: s.clientSecret,
data: (0,
b.Z)((0,
b.Z)({}, d), {}, {
payment_method_data: (0,
b.Z)((0,
b.Z)({}, d.payment_method_data), {}, {
type: "link"
})
}),
merchantParams: t.merchantParams
}) : Ol.setupIntents.confirm({
id: s.id,
data: (0,
b.Z)((0,
b.Z)({}, d), {}, {
client_secret: s.clientSecret
}),
log: He.log,
merchantParams: t.merchantParams
});
case 34:
if (C = e.sent,
Z = o.expected_payment_method_type,
M = Ff(t, Z, !!E._cardElementState.linkConfigs.linkInCardPaymentData),
P = "error" === C.type ? (0,
b.Z)((0,
b.Z)({}, C), {}, {
error: (0,
O.CE)(C.error, ["status"])
}) : C,
k = sf(P, u, {
logger: He
}),
x = !1,
c && (w = c.getState(),
x = ld(w),
"error" === C.type && (R = Uc(w),
L = null === (T = Qc(w)) || void 0 === T ? void 0 : T.id,
R && L && "insufficient_funds" !== C.error.decline_code && c.dispatch(Qm(L, !0))),
"error" === C.type && w.config.session && E._dispatchErrorOnIntentConfirm(C.error, Z, w.config.session, w, c),
D = l || x || !!E._cardElementState.linkConfigs.linkInCardPaymentData,
M = Ff(t, Z, D),
M = Kf(M, w.paymentElement, !!d.payment_method, !!d.confirmation_token),
Vf(E, "setup_intent", M)),
null == h || h.result(C),
E._apiClient.reportFetchResult(n, C, M),
E.outerInitiatedActions.removeElementsExperimentId(),
!c || !l && !x) {
e.next = 59;
break
}
if (U = c.getState(),
j = Qc(U),
"error" !== C.type) {
e.next = 53;
break
}
if (c.dispatch({
type: "CONSUMER.CONFIRM_LINK_SETUP_INTENT.ERROR",
error: C.error,
id: null == j ? void 0 : j.id
}),
!Uc(U) || !(0,
A.T)(C)) {
e.next = 51;
break
}
return e.abrupt("return", E.outerInitiatedActions.confirmSetupIntent(t));
case 51:
e.next = 59;
break;
case 53:
if ("object" !== C.type) {
e.next = 59;
break
}
if (c.dispatch({
type: "CONSUMER.CONFIRM_LINK_SETUP_INTENT.SUCCESS",
id: null == j ? void 0 : j.id
}),
!(B = E._createOrUpdateShippingAddressOp(U))) {
e.next = 59;
break
}
return e.next = 59,
c.dispatch(B);
case 59:
e.next = 65;
break;
case 61:
return e.prev = 61,
e.t1 = e.catch(31),
null == h || h.error(),
e.abrupt("return", E._apiClient.handleFetchErrorTagged(n, e.t1, u));
case 65:
return e.prev = 65,
E._recentlyCreatedPaymentMethod = null,
E.sharedInnerData.delete("recentlyCreatedWalletData"),
E._recentlyValidated = !1,
e.finish(65);
case 70:
return e.abrupt("return", k);
case 71:
case "end":
return e.stop()
}
}
), e, null, [[31, 61, 65, 70]])
}
)));
return function(t) {
return e.apply(this, arguments)
}
}()));
case 3:
case "end":
return e.stop()
}
}
), e)
}
))),
function(e) {
return f.apply(this, arguments)
}
),
retrieveSetupIntent: this.injectControllerContext(v_),
cancelSetupIntentSource: this.injectControllerContext(tC),
cancelPaymentIntentSource: this.injectControllerContext(nC),
retrievePaymentIntent: this.injectControllerContext(y_),
updatePaymentIntent: function(e) {
var t = "update_payment_intent";
return (0,
O.Xy)(e.mids, E._apiClient.getMids()) || He.log("debug.mids_mismatch", {
path: "updatePaymentIntent",
reqMids: e.mids,
apiClientMids: E._apiClient.getMids()
}),
E.updateIntentParams(e, t).then(function() {
var n = (0,
k.Z)((0,
S.Z)().mark((function n(r) {
var a, i, o, s, u, l, c, d;
return (0,
S.Z)().wrap((function(n) {
for (; ; )
switch (n.prev = n.next) {
case 0:
if ("error" !== r.type) {
n.next = 2;
break
}
return n.abrupt("return", r);
case 2:
if (a = r.locale,
i = r.clientSecret,
o = r.params,
s = E._metadataManager.resolveLocale(a),
o.expected_payment_method_type && Pf(o.expected_payment_method_type) && (o.expected_payment_method_type = null,
o.payment_method_data = {}),
!o.payment_method_data) {
n.next = 10;
break
}
return n.next = 8,
dt({
slug: t,
siteKey: E._hcaptchaManager.getSiteKey("elements"),
getCaptchaToken: E.outerAction.getCaptchaToken
});
case 8:
(u = n.sent) && (o.payment_method_data.radar_options = {
hcaptcha_token: u
});
case 10:
return l = (0,
b.Z)((0,
b.Z)({}, o), E._apiClient.getAuthenticationParams()),
n.prev = 11,
n.next = 14,
void 0,
eS(l) || (E._isLinkPaymentMethodData(o.payment_method_data) ? E.linkApiClient.paymentIntent.update({
id: i.id,
data: (0,
b.Z)((0,
b.Z)({}, l), {}, {
client_secret: i.clientSecret,
payment_method_data: (0,
b.Z)((0,
b.Z)({}, l.payment_method_data), {}, {
type: "link"
})
}),
merchantParams: e.merchantParams
}) : Ol.paymentIntents.update({
id: i.id,
data: (0,
b.Z)((0,
b.Z)({}, l), {}, {
client_secret: i.clientSecret
}),
log: He.log,
merchantParams: e.merchantParams
}));
case 14:
return c = n.sent,
d = {
element: $(e),
payment_method_type: e.expectedType
},
E._apiClient.reportFetchResult(t, c, d),
n.abrupt("return", sf(c, s, {
logger: He
}));
case 20:
return n.prev = 20,
n.t0 = n.catch(11),
n.abrupt("return", E._apiClient.handleFetchErrorTagged(t, n.t0, s));
case 23:
case "end":
return n.stop()
}
}
), n, null, [[11, 20]])
}
)));
return function(e) {
return n.apply(this, arguments)
}
}())
},
confirmPaymentIntent: function(e) {
var t = "confirm_payment_intent";
return (0,
O.Xy)(e.mids, E._apiClient.getMids()) || He.log("debug.mids_mismatch", {
path: "confirmPaymentIntent",
reqMids: e.mids,
apiClientMids: E._apiClient.getMids()
}),
E.confirmIntentParams(e, t).then(function() {
var n = (0,
k.Z)((0,
S.Z)().mark((function n(r) {
var a, i, o, s, u, l, c, d, p, m, f, h, _, y, v, g, k, C, Z, M, P, x, w, T, R, L, D, U, j, B, F, G, q, K, V, z;
return (0,
S.Z)().wrap((function(n) {
for (; ; )
switch (n.prev = n.next) {
case 0:
if ("error" !== r.type) {
n.next = 2;
break
}
return n.abrupt("return", r);
case 2:
if (i = r.locale,
o = r.clientSecret,
s = r.params,
u = E._metadataManager.resolveLocale(i),
l = "elements" === e.tag && "link" === s.expected_payment_method_type,
"elements" !== e.tag) {
n.next = 11;
break
}
return n.next = 8,
E.elementsStores.getForExistingGroup(e.groupId, t);
case 8:
n.t0 = n.sent.store,
n.next = 12;
break;
case 11:
n.t0 = null;
case 12:
if (c = n.t0,
d = $(e),
p = Boolean(c && "FALLBACK" === md(null == c ? void 0 : c.getState())),
m = Sd(E._cardElementState, {
element: d,
store: c,
paymentMethod: null === (a = s.payment_method_data) || void 0 === a ? void 0 : a.type
}),
null == (f = Hf({
isCheckingOutWithLink: m,
isLinkFallbackToCard: p,
linkFunnel: cl,
element: d,
type: "payment-intent"
})) || f.attempt(),
"paymentMethod-from-element" !== e.tag || "card" !== d && "cardNumber" !== d) {
n.next = 23;
break
}
if (_ = null === (h = s.payment_method_options) || void 0 === h ? void 0 : h.card,
!!(null == _ || "object" != typeof _ || !("network"in _) || !_.network) || !r.didMerchantSpecifyNetworkPreference) {
n.next = 23;
break
}
throw new I.No("You cannot provide a preferred network preference during confirmation after passing a preference when creating the Element.");
case 23:
if (y = (0,
b.Z)((0,
b.Z)((0,
b.Z)({}, s), E._apiClient.getAuthenticationParams()), s._stripe_version ? {
_stripe_version: s._stripe_version
} : {}),
l && (null == c || c.dispatch({
type: "CONSUMER.CONFIRM_LINK_PAYMENT_INTENT.PENDING"
})),
!s.expected_payment_method_type || !Pf(s.expected_payment_method_type)) {
n.next = 27;
break
}
return n.abrupt("return", sf({
type: "error",
error: {
code: "external_payment_method_selected",
extra_fields: {
selectedPaymentMethod: s.expected_payment_method_type
}
}
}, u, {
logger: He
}));
case 27:
if ("SETUP_INTENT" !== o.type) {
n.next = 29;
break
}
throw new I.No("Your code called confirmPayment() but you passed a client_secret associated with a SetupIntent. Did you mean to call confirmSetup() instead?");
case 29:
if (!(0,
N.uN)(E._metadataManager.betas, N.M4.deferred_intent_pe_optional_amount_beta_0) || !c) {
n.next = 34;
break
}
if (k = c.getState(),
"payment" !== (null === (v = k.config.deferredIntent) || void 0 === v ? void 0 : v.mode) || null != (null === (g = k.config.deferredIntent) || void 0 === g ? void 0 : g.amount)) {
n.next = 34;
break
}
throw new I.No("It looks like you have payment mode in your Elements options but the amount is not set. Please call elements.update() to set the amount before calling stripe.confirmPayment()");
case 34:
return c && (C = c.getState().config.session) && a_(t, C, r, E),
n.prev = 35,
n.next = 38,
function(t) {
var n = eS(y);
if (n)
return n;
var r = E._isLinkPaymentMethodData(s.payment_method_data)
, a = null == c ? void 0 : c.getState();
if ("elements" === e.tag && E._isExpressCheckoutElement(e.frameId) && a && !0 === cd(a) && a && !0 === (null === (t = a.config.session) || void 0 === t ? void 0 : t.featureFlags.elements_enable_link_in_passthrough_ece)) {
var i = s.payment_method
, u = !!i;
if ("card" !== s.expected_payment_method_type)
throw new I.No('Unexpected payment method "'.concat(s.expected_payment_method_type, '"; expected "card"'));
if (!u)
throw new I.No("Could not determine payment method");
return E.linkApiClient.paymentIntent.confirmWithPaymentMethodId({
id: o.id,
data: (0,
b.Z)((0,
b.Z)({}, y), {}, {
payment_method: i,
client_secret: o.clientSecret
}),
merchantParams: e.merchantParams
})
}
return r ? E.linkApiClient.paymentIntent.confirm({
id: o.id,
data: (0,
b.Z)((0,
b.Z)({}, y), {}, {
client_secret: o.clientSecret,
payment_method_data: (0,
b.Z)((0,
b.Z)({}, y.payment_method_data), {}, {
type: "link"
})
}),
merchantParams: e.merchantParams
}) : Ol.paymentIntents.confirm({
id: o.id,
data: (0,
b.Z)((0,
b.Z)({}, y), {}, {
client_secret: o.clientSecret
}),
log: He.log,
merchantParams: e.merchantParams
})
}();
case 38:
if (M = n.sent,
P = r.params.expected_payment_method_type,
x = Ff(e, P, !!E._cardElementState.linkConfigs.linkInCardPaymentData),
w = "error" === M.type ? (0,
b.Z)((0,
b.Z)({}, M), {}, {
error: (0,
O.CE)(M.error, ["status"])
}) : M,
Z = sf(w, u, {
logger: He,
isLink: l
}),
T = !1,
c && (R = c.getState(),
T = ld(R),
"error" === M.type && (D = Uc(R),
U = null === (L = Qc(R)) || void 0 === L ? void 0 : L.id,
D && U && "insufficient_funds" !== M.error.decline_code && c.dispatch(Qm(U, !0))),
"error" === M.type && R.config.session && E._dispatchErrorOnIntentConfirm(M.error, P, R.config.session, R, c),
j = l || T || !!E._cardElementState.linkConfigs.linkInCardPaymentData,
x = Ff(e, P, j),
x = Kf(x, R.paymentElement, !!y.payment_method, !!y.confirmation_token),
Vf(E, "payment_intent", x)),
p ? null == f || f.error() : null == f || f.result(M),
E._apiClient.reportFetchResult(t, M, x),
E.outerInitiatedActions.removeElementsExperimentId(),
!c || !l && !T) {
n.next = 67;
break
}
if (B = c.getState(),
F = Qc(B),
"error" !== M.type) {
n.next = 57;
break
}
if (c.dispatch({
type: "CONSUMER.CONFIRM_LINK_PAYMENT_INTENT.ERROR",
error: M.error,
id: null == F ? void 0 : F.id
}),
!Uc(B) || !(0,
A.T)({
result: M
})) {
n.next = 55;
break
}
return n.abrupt("return", E.outerInitiatedActions.confirmPaymentIntent(e));
case 55:
n.next = 67;
break;
case 57:
if ("object" !== M.type) {
n.next = 67;
break
}
if (c.dispatch({
type: "CONSUMER.CONFIRM_LINK_PAYMENT_INTENT.SUCCESS",
id: null == F ? void 0 : F.id
}),
!(q = E._createOrUpdateShippingAddressOp(B))) {
n.next = 63;
break
}
return n.next = 63,
c.dispatch(q);
case 63:
K = null === (G = ai(B)) || void 0 === G ? void 0 : G.isEligible,
V = ya(B),
z = ["link", "card"].indexOf(null != V ? V : ""),
He.log("confirm_link_payment_intent.success", {
purchase_protections_eligible: K,
should_create_purchase_protection: K && z,
payment_intent_id: o.id
});
case 67:
n.next = 73;
break;
case 69:
return n.prev = 69,
n.t1 = n.catch(35),
null == f || f.error(),
n.abrupt("return", E._apiClient.handleFetchErrorTagged(t, n.t1, u));
case 73:
return n.prev = 73,
E._recentlyCreatedPaymentMethod = null,
E.sharedInnerData.delete("recentlyCreatedWalletData"),
E._recentlyValidated = !1,
n.finish(73);
case 78:
return n.abrupt("return", Z);
case 79:
case "end":
return n.stop()
}
}
), n, null, [[35, 69, 73, 78]])
}
)));
return function(e) {
return n.apply(this, arguments)
}
}())
},
validateElements: function(e) {
var t = e.groupId
, n = e.slug;
return E.outerInitiatedActions.getElementConfirmingPayment({
groupId: t,
errorMessageMethodName: kC[n]
}).then(function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(r) {
var a, i, o, s, u, l, c, d, p, m, f, h, _, y, k, C, Z, A, M, P, x, I, N, w, T, R, D, U, j, B, F, q, K, V, z, H, Y, W, J;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
if ("expressCheckout" !== r) {
e.next = 2;
break
}
return e.abrupt("return", null);
case 2:
if (E._recentlyValidated = !0,
E.elementsStores.hasSettled(t)) {
e.next = 5;
break
}
throw new Error("Could not retrieve elements store");
case 5:
return e.next = 7,
E.elementsStores.getForDeferredGroup(t);
case 7:
if (a = e.sent,
i = a.store) {
e.next = 11;
break
}
throw new Error("Could not retrieve elements store due to unexpected error");
case 11:
o = i.getState(),
s = !1;
try {
u = Rc(o),
l = u.view,
c = u.authIntegration,
s = "embedded" === c && "cookie-authentication" === l
} catch (e) {
He.log("debug.validate_elements_link_return_autofill_error", {
error: e
})
}
return i.dispatch({
type: "ELEMENTS.DISPLAY_ERRORS",
requireCVCRecollection: Mc(o),
session: o.config.session,
onlyShowReturnAutofillPromptErrors: s
}),
d = Ra(o),
p = dC(He.log, "frame_messenger_request_state_validateElements", E.controllerId, {
control: 50,
treatment: 50
}),
f = (m = function(e) {
var n = (0,
Zf.jW)(E.frameHub, t, e);
return n ? "treatment" === p ? (0,
Zf.XQ)(E.frameHub, n) : E.requestState(n) : vC.resolve(null)
}
)(L.NC.PAYMENT_ELEMENT),
h = m(L.NC.LINK_AUTHENTICATION_ELEMENT),
e.next = 22,
vC.all([f, h]);
case 22:
if (_ = e.sent,
y = (0,
g.Z)(_, 2),
k = y[0],
C = y[1],
Z = (0,
Zf.jW)(E.frameHub, t, L.NC.LINK_AUTHENTICATION_ELEMENT),
A = Z ? (0,
b.Z)((0,
b.Z)({}, hC(i.getState())), {}, {
frameId: Z
}) : null,
M = (0,
O.Dg)(C),
P = (0,
O.Dg)(A),
!(0,
O.Xy)(M, P))
try {
x = M && P && "object" == typeof M && "object" == typeof P ? (0,
O.uf)(M, P) : {
oldStateValue: M,
newStateValue: P
},
He.log("debug.controller.state_mismatch", {
element: "linkAuthentication",
frameId: Z,
source: "validateElements",
oldStateExists: !!M,
newStateExists: !!P,
diff: JSON.stringify((0,
O.M4)(x, {
allowListKeys: ["error"]
}))
})
} catch (e) {
He.log("debug.controller.state_mismatch", {
element: "linkAuthentication",
frameId: Z,
source: "validateElements",
error: e
})
}
if (I = cm(o),
N = !(null == I || !I.shipping),
w = !(null == I || !I.billing),
T = "error" === (null == C ? void 0 : C.type),
R = "error" === (null == k ? void 0 : k.type),
N || w || T || R) {
e.next = 40;
break
}
if (k && "hidden" !== (null == k ? void 0 : k.type)) {
e.next = 39;
break
}
return e.abrupt("return", null);
case 39:
return e.abrupt("return", {
type: "object",
selectedPaymentMethod: k.selectedPaymentMethod
});
case 40:
try {
D = {},
(0,
v.Z)(D, L.NC.ADDRESS_ELEMENT_SHIPPING, N),
(0,
v.Z)(D, L.NC.ADDRESS_ELEMENT_BILLING, w),
(0,
v.Z)(D, L.NC.PAYMENT_ELEMENT, R),
(0,
v.Z)(D, L.NC.LINK_AUTHENTICATION_ELEMENT, T),
U = D,
_y({
frameHub: E.frameHub,
outerActions: E.outerAction
}, {
frameTypeToErrorMapping: U,
groupId: t,
store: i
})
} catch (e) {
He.log("input.move_focus_first_invalid_field_failed", {
error: e
})
}
if (!N) {
e.next = 47;
break
}
return j = null == I ? void 0 : I.shipping,
B = G(j, d),
F = B.localizedError,
e.abrupt("return", {
type: "error",
error: F,
locale: d
});
case 47:
if (!w) {
e.next = 54;
break
}
return q = null == I ? void 0 : I.billing,
K = G(q, d),
V = K.localizedError,
S = q,
Object.keys(df).indexOf(S.code) >= 0 && i.dispatch({
type: "ADDRESS.CONFIRM_FAILED_FOR_VIEW",
mode: "billing"
}),
e.abrupt("return", {
type: "error",
error: V,
locale: d
});
case 54:
if (!T) {
e.next = 59;
break
}
return z = G(C.error, d),
H = z.localizedError,
e.abrupt("return", {
type: "error",
error: H,
locale: d
});
case 59:
if (!R) {
e.next = 75;
break
}
if (Y = G(k.error, d),
W = Y.localizedError,
!k.paymentDetails || !o.config.session) {
e.next = 66;
break
}
return e.next = 64,
E.elementsStores.strictGet(t, "validateElements");
case 64:
e.sent.dispatch({
type: "PAYMENT.CONFIRM_FAILED_FOR_SAVED_PAYMENT",
savedPayment: {
mode: "consumer",
id: k.paymentDetails.id,
paymentDetails: k.paymentDetails
},
session: o.config.session
});
case 66:
if (!SC(k.error)) {
e.next = 71;
break
}
return e.next = 69,
E.elementsStores.strictGet(t, "validateElements");
case 69:
e.sent.dispatch({
type: "PAYMENT.CONFIRM_FAILED_FOR_VIEW"
});
case 71:
return n && He.log("".concat(n, ".validation_error"), {
error: k.error,
element: "payment",
link_payment_details_id: (null === (J = k.paymentDetails) || void 0 === J ? void 0 : J.id) || null,
livemode: k.session.livemode
}),
e.abrupt("return", {
type: "error",
error: W,
locale: d
});
case 75:
return e.abrupt("return", null);
case 76:
case "end":
return e.stop()
}
var S
}
), e)
}
)));
return function(t) {
return e.apply(this, arguments)
}
}())
},
showWalletIfNecessary: this.injectControllerContext(sk),
rememberLinkLogin: this.injectControllerContext(Ek),
forgetLinkLogin: this.injectControllerContext(Zk),
createSharedSessionContext: this.injectControllerContext(Tk),
updateLoggingParams: (m = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
var n, r;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
if ((0,
T.Qg)(he.Fd)) {
e.next = 2;
break
}
throw new I.No("This function may only be called from trusted domains");
case 2:
if (n = t.session_id,
r = t.invoice_id,
!(n && "string" != typeof n || r && "string" != typeof r)) {
e.next = 5;
break
}
throw new Error("invalid logging params");
case 5:
n && (He.updateParams({
session_id: n
}),
cl.updateParams({
checkout_session_id: n,
hostedWithin: rl.Checkout
})),
r && cl.updateParams({
invoice_id: r,
hostedWithin: rl.HostedInvoicePage
});
case 7:
case "end":
return e.stop()
}
}
), e)
}
))),
function(e) {
return m.apply(this, arguments)
}
),
createConsumerPaymentDetails: this.injectControllerContext(Ik),
addPaymentDetails: this.injectControllerContext(fk),
loginWithConsumerInfo: this.injectControllerContext(hk),
clearInstantDebitsIncentive: this.injectControllerContext(_k),
resetConsumerIncentiveOffer: this.injectControllerContext(yk),
confirmInstantDebitsIncentiveForPaymentDetails: this.injectControllerContext(vk),
confirmConsumerSignUpIncentiveForPaymentDetails: this.injectControllerContext(bk),
updateAvailableConsumerIncentives: this.injectControllerContext(gk),
fetchingWallets: this.injectControllerContext(Ok),
shouldShowEceButton: this.injectControllerContext(Rk),
expressCheckoutConfirmStart: this.injectControllerContext(Lk),
expressCheckoutConfirmEnd: this.injectControllerContext(Dk),
expressCheckoutSheetOpened: this.injectControllerContext(Uk),
expressCheckoutSheetClosed: this.injectControllerContext(jk),
recordOuterPerformanceTimeline: function(e) {
E._performanceTimelineReporter.recordEntries(e)
},
linkFunnelEvent: function(e) {
cl.controllerAppEvent(e)
},
parseLuxeNextAction: this.injectControllerContext(KS),
getElementConfirmingPayment: this.injectControllerContext(zk),
getIsAwaitingConfirmCallback: this.injectControllerContext(Vk),
getEcePaymentSheetState: this.injectControllerContext(fC),
getElementsSessionAmountModeCurrency: this.injectControllerContext(Kk),
getElementsSessionUnverifiedPaymentMethodsOnDomain: this.injectControllerContext(qk),
setExpressCheckoutConfirmData: this.injectControllerContext(Bk),
closeECEPaymentSheet: this.injectControllerContext(Hk),
resetExpressCheckoutState: this.injectControllerContext(Fk),
tokenizeWithElement: this.tokenizeWithElement,
tokenizeCvcUpdate: (p = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
var n, r, a, i;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return n = t.frameId,
r = dC(He.log, "frame_messenger_request_state_tokenizeCvcUpdate", E.controllerId, {
control: 50,
treatment: 50
}),
e.next = 4,
E._retrieveElementData(n, !1, {
useFrameMessengerMode: "treatment" === r ? "actual" : void 0,
debugPath: "tokenizeCvcUpdate"
});
case 4:
if ("error" !== (a = e.sent).type) {
e.next = 8;
break
}
return He.log("tokenize.validation_error", {
error: a.error,
element: "cardCvc"
}),
e.abrupt("return", a);
case 8:
if (!a.value.linkInCardPaymentData) {
e.next = 10;
break
}
return e.abrupt("return", Jf(E._getControllerContext(), n));
case 10:
return i = E._metadataManager.getPaymentMetadata("cardCvc"),
e.abrupt("return", E._apiClient.tokens.create({
data: {
payment_user_agent: i.payment_user_agent,
cvc_update: {
cvc: a.value.cardCvc
}
},
errorLog: He.log,
options: {
loggerExtras: null
}
}));
case 12:
case "end":
return e.stop()
}
}
), e)
}
))),
function(e) {
return p.apply(this, arguments)
}
),
tokenizeWithData: this.injectControllerContext(yC),
createSourceWithElement: function(e) {
var t = e.elementName
, n = e.sourceData
, r = "create_source";
return E.createSourceParamsWithElement(e, r).then((function(e) {
if ("error" === e.type)
return e;
var a = e.locale
, i = e.sourceParams;
return E.createSourceWithParams({
sourceParams: i,
locale: a,
elementName: t,
slug: r,
merchantParams: n
})
}
))
},
createSourceWithData: function(e) {
var t = e.elementName
, n = e.sourceData
, r = E.createSourceParamsWithData(e).sourceParams;
return E.createSourceWithParams({
sourceParams: r,
locale: E._metadataManager.resolveLocale(),
elementName: t,
slug: "create_source",
merchantParams: n
})
},
createPaymentMethodWithElement: function(e) {
var t = e.elementName
, n = "create_payment_method";
return (0,
O.Xy)(e.mids, E._apiClient.getMids()) || He.log("debug.mids_mismatch", {
path: "createPaymentMethodWithElement",
reqMids: e.mids,
apiClientMids: E._apiClient.getMids()
}),
E.createPaymentMethodParamsWithElement(e, n).then((function(r) {
switch (r.type) {
case "error":
return r;
case "element_payment_method_params":
return E.createPaymentMethodWithParams({
paymentMethodParams: r.paymentMethodParams,
locale: r.locale,
elementName: t,
slug: n,
merchantParams: e.paymentMethodData
});
case "element_payment_method_id":
case "element_payment_method":
throw new Error("Unexpected element_payment_method_id or element_payment_method");
default:
return (0,
P.Rz)(r)
}
}
))
},
createConfirmationTokenWithElements: (d = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
var n, r, a, i, o, s, u, l, c, d, p, m, f, h, _, y, v, g, k, C, Z, A, M, P, x, I;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return s = "create_confirmation_token",
(0,
O.Xy)(t.mids, E._apiClient.getMids()) || He.log("debug.mids_mismatch", {
path: "createConfirmationTokenWithElements",
reqMids: t.mids,
apiClientMids: E._apiClient.getMids()
}),
e.next = 4,
E.createConfirmationTokenParamsWithElements(t, s);
case 4:
return u = e.sent,
l = t.elementConfirming,
c = t.groupId,
e.next = 8,
E.elementsStores.strictGet(c, s);
case 8:
if (d = e.sent,
p = d.getState(),
"error" !== u.type) {
e.next = 12;
break
}
return e.abrupt("return", u);
case 12:
return m = l,
(f = p.config.session) && a_(s, f, u, E),
h = null !== (n = u.params) && void 0 !== n ? n : {},
_ = Sd(E._cardElementState, {
element: m,
store: d,
paymentMethod: h.payment_method_data
}),
null == (y = Hf({
isCheckingOutWithLink: _,
linkFunnel: cl,
element: m,
type: "confirmation-token"
})) || y.attempt(),
e.next = 21,
dt({
slug: s,
siteKey: E._hcaptchaManager.getSiteKey("elements"),
getCaptchaToken: E.outerAction.getCaptchaToken
});
case 21:
if ((v = e.sent) && (null !== (g = h.payment_method_data) && void 0 !== g && g.radar_options ? h.payment_method_data.radar_options.hcaptcha_token = v : h.payment_method_data && (h.payment_method_data.radar_options = {
hcaptcha_token: v
})),
k = yt({
elementName: m,
mids: h.payment_method_data,
usesLink: !("link" !== (null === (r = h.payment_method_data) || void 0 === r ? void 0 : r.type))
}),
C = qf(t, p.paymentElement, null === (a = p.config.deferredIntent) || void 0 === a ? void 0 : a.mode, null === (i = p.config.session) || void 0 === i || null === (o = i.parsedClientSecret) || void 0 === o ? void 0 : o.id, u.expected_payment_method_type, !!h.payment_method, k),
Z = E._isLinkPaymentMethodData(h.payment_method_data),
E.outerInitiatedActions.removeElementsExperimentId(),
A = cd(p),
!Z) {
e.next = 32;
break
}
M = E._apiClient.confirmationTokens.createForLink((0,
b.Z)((0,
b.Z)({}, h), {}, {
payment_method_data: (0,
b.Z)((0,
b.Z)({}, h.payment_method_data), {}, {
type: "link"
}),
options: {
loggerExtras: C
}
})),
e.next = 43;
break;
case 32:
if (!A) {
e.next = 42;
break
}
if (null === (P = Qc(p, {
isECE: !0
})) || void 0 === P ? void 0 : P.id) {
e.next = 36;
break
}
throw new Error("Expected Payment Method ID to be present with using Link in ECE");
case 36:
x = dd(p),
delete h.payment_method_data,
h.payment_method = x,
M = E._apiClient.confirmationTokens.create({
data: h,
options: {
loggerExtras: C
}
}),
e.next = 43;
break;
case 42:
M = E._apiClient.confirmationTokens.create({
data: h,
options: {
loggerExtras: C
}
});
case 43:
return e.next = 45,
M;
case 45:
return I = e.sent,
e.next = 48,
E.outerInitiatedActions.removeElementsExperimentId();
case 48:
return null == y || y.result(I),
"error" !== I.type && Vf(E, "confirmation_token", C),
e.abrupt("return", I);
case 51:
case "end":
return e.stop()
}
}
), e)
}
))),
function(e) {
return d.apply(this, arguments)
}
),
createPaymentMethodWithElements: function(e) {
var t = e.elementConfirming
, n = "create_payment_method";
return (0,
O.Xy)(e.mids, E._apiClient.getMids()) || He.log("debug.mids_mismatch", {
path: "createPaymentMethodParamsWithElements",
reqMids: e.mids,
apiClientMids: E._apiClient.getMids()
}),
E.createPaymentMethodParamsWithElements(e, n).then((function(r) {
var a, i;
switch (r.type) {
case "error":
return r;
case "element_payment_method_id":
return sf({
type: "object",
object: {
id: r.paymentMethod,
type: r.selectedPaymentMethod
}
}, E._metadataManager.resolveLocale(), {
logger: He
});
case "element_payment_method_params":
var o = r.selectedPaymentMethod;
if ("expressCheckout" === t && "paypal" === o)
throw new I.No("stripe.createPaymentMethod() does not support payments through PayPal. To accept PayPal, please use stripe.confirmPayment() or stripe.confirmSetup() instead.");
if (function(e) {
var t = e.paymentMethod
, n = e.elementConfirming
, r = e.stripeMethod;
if (qh(t, n))
throw Kh(r, t)
}({
paymentMethod: o,
elementConfirming: t,
stripeMethod: "stripe.createPaymentMethod()"
}),
"session"in r && (null === (a = r.session.customer) || void 0 === a ? void 0 : a.customerSession) && null !== (i = r.confirmPaymentMethodOptions) && void 0 !== i && i.data && "setup_future_usage"in r.confirmPaymentMethodOptions.data && r.confirmPaymentMethodOptions.data.setup_future_usage)
throw new I.No("It looks like you're trying to save payment details for future use with createPaymentMethod(). Please use createConfirmationToken() instead.");
return E.createPaymentMethodWithParams({
paymentMethodParams: r.paymentMethodParams,
locale: r.locale,
elementName: t,
slug: n,
merchantParams: e.paymentMethodData
}).then((function(e) {
return "object" === e.type && (E._recentlyCreatedPaymentMethod = e.object),
e
}
));
case "element_payment_method":
return sf({
type: "object",
object: r.paymentMethod
}, E._metadataManager.resolveLocale(), {
logger: He
});
default:
return (0,
P.Rz)(r)
}
}
))
},
createPaymentMethodWithData: function(e) {
var t = e.elementName
, n = E.createPaymentMethodParamsWithData(e);
(0,
O.Xy)(e.mids, E._apiClient.getMids()) || He.log("debug.mids_mismatch", {
path: "createPaymentMethodWithData",
reqMids: e.mids,
apiClientMids: E._apiClient.getMids()
});
var r = n.paymentMethodParams;
return E.createPaymentMethodWithParams({
paymentMethodParams: r,
locale: E._metadataManager.resolveLocale(),
elementName: t,
slug: "create_payment_method",
merchantParams: e.paymentMethodData
})
},
updateCSSFonts: (c = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
var n, r;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
n = t.fonts,
r = t.groupId,
E.frameHub.sendGroupMessage(r, {
action: "stripe-controller-update",
payload: {
fonts: n
}
});
case 2:
case "end":
return e.stop()
}
}
), e)
}
))),
function(e) {
return c.apply(this, arguments)
}
),
createApplePaySession: this.injectControllerContext(ok),
retrieveSource: this.injectControllerContext(g_),
removeElementsExperimentId: this.injectControllerContext(me),
createPaymentPage: this.injectControllerContext(E_),
createPaymentPageWithSession: this.injectControllerContext(Z_),
initPaymentPage: this.injectControllerContext(U_),
updatePaymentPage: this.injectControllerContext(B_),
retrievePaymentPage: this.injectControllerContext(j_),
confirmPaymentPage: this.injectControllerContext(F_),
createRadarSession: this.injectControllerContext(CS),
attachHCaptchaTokenToRadarSession: this.injectControllerContext(ES),
authenticate3DS2: this.injectControllerContext(AS),
verifyMicrodepositsForPayment: this.injectControllerContext(PS),
verifyMicrodepositsForSetup: this.injectControllerContext(xS),
retrieveIssuingCardWithoutNonce: this.injectControllerContext(yS),
retrieveIssuingCard: this.injectControllerContext(_S),
createEphemeralKeyNonce: this.injectControllerContext(uk),
createAcssDebitSession: this.injectControllerContext(MS),
confirmReturnIntent: this.injectControllerContext(kS),
attachLinkAccountSessionForPayment: this.injectControllerContext(lk),
attachLinkAccountSessionForSetup: this.injectControllerContext(ck),
fetchLocale: this.injectControllerContext(u_),
resolveLocale: this.injectControllerContext(l_),
localizeError: this.injectControllerContext(d_),
unsafeLocalizeString: this.injectControllerContext(c_),
preloadLinkStoredCredentials: function() {
E.linkApiClient.preloadStoredCredentials()
},
setupDeferredElementsStore: function(e) {
var t = e.groupId;
return E.elementsStores.getForDeferredGroup(t)
},
setupStoreForElementsGroup: this.injectControllerContext(xb),
fetchUpdates: this.injectControllerContext(wb),
getGoogleMapsPredictions: this.injectControllerContext(IS),
getGoogleMapsDetails: this.injectControllerContext(NS),
initGoogleMapsService: this.injectControllerContext(wS),
updateElementsOptions: this.injectControllerContext(Ob),
isCardMetadataRequired: this.injectControllerContext(Af),
retrieveCardNetworks: this.injectControllerContext($k),
userFacingRetrieveCardNetworks: this.injectControllerContext(eC),
completeLinkAccountSessionElements: this.injectControllerContext(mk),
verifyCardImageVerificationChallenge: function(e) {
var t = E._metadataManager.resolveLocale();
return (0,
Zs.Nv)(e.verifyUrl, "POST", (0,
b.Z)({
challenge_response_token: "",
challenge_response_ekey: "",
client_secret: e.clientSecret
}, E._apiClient.getAuthenticationParams())).then((function(e) {
return sf(e, t, {
logger: He
})
}
)).catch((function(e) {
return E._apiClient.handleFetchErrorTagged("verify_challenge_cardimageverification", e, t)
}
))
},
cancelCardImageVerificationChallenge: function(e) {
var t = E._metadataManager.resolveLocale();
return (0,
Zs.Nv)(e.cancelUrl, "POST", (0,
b.Z)({
client_secret: e.clientSecret
}, E._apiClient.getAuthenticationParams())).then((function(e) {
return sf(e, t, {
logger: He
})
}
)).catch((function(e) {
return E._apiClient.handleFetchErrorTagged("cancel_challenge_cardimageverification", e, t)
}
))
},
retrieveWalletConfigAvailability: this.injectControllerContext(HS),
retrieveWalletConfig: this.injectControllerContext(tk),
getOnBehalfOfError: this.injectControllerContext(ik),
checkForLinkClientSecret: this.injectControllerContext(wk),
elementMounted: this.injectControllerContext(Db),
elementUnmounted: this.injectControllerContext(Ub),
logOutOfLinkInElements: this.injectControllerContext(Ak),
updateStripeUserCredentials: (l = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
E._apiClient.updateAuthenticationParams({
key: t.publishableKey,
_stripe_account: t.stripeAccount,
_stripe_version: t.apiVersion
}),
E._cache.resetAll(),
E._recentlyCreatedPaymentMethod = null,
E.sharedInnerData.delete("recentlyCreatedWalletData"),
He.updateParams({
key: E._apiClient.getApiKey(),
key_mode: (0,
R.lO)(E._apiClient.getApiKey()),
elements_session_id: de({
experimentKey: V.D3.elements_session,
apiKey: E._apiClient.getApiKey(),
stripeAccount: E._apiClient.getStripeAccount()
})
}),
E.frameHub.sendMessageToParent({
action: "stripe-frame-event",
payload: {
event: "stripe-user-credentials-update",
data: t
}
});
case 6:
case "end":
return e.stop()
}
}
), e)
}
))),
function(e) {
return l.apply(this, arguments)
}
),
retrievePaypalMerchantId: this.injectControllerContext(fe),
linkPopupPreloadedDataStale: this.injectControllerContext(Pk),
linkPopupLogOut: this.injectControllerContext(Mk),
internalSetFormValueForAddressElement: this.injectControllerContext(G_),
midsChange: (u = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
var n;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return n = t.mids,
E._apiClient.setMids(n),
e.next = 4,
vC.all(E.elementsStores.keys().map(function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
var r, a;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return e.next = 2,
E.elementsStores.getForDeferredGroup(t);
case 2:
r = e.sent,
null == (a = r.store) || a.dispatch({
type: "CONFIG.MIDS_CHANGED",
mids: n
});
case 5:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t) {
return e.apply(this, arguments)
}
}()));
case 4:
case "end":
return e.stop()
}
}
), e)
}
))),
function(e) {
return u.apply(this, arguments)
}
),
prefillUsBankAccountFormWithConsumer: this.injectControllerContext(Sk),
setInstrumentForConsumerSignUpIncentive: this.injectControllerContext(kk),
preloadConsumerLookup: this.injectControllerContext(Nk),
createV2CardPaymentMethod: this.injectControllerContext(qb)
},
this.reportAction = function(e) {
var t = e.actionName
, n = e.request
, r = function(e) {
switch (e) {
case "attachLinkAccountSessionForPayment":
case "attachLinkAccountSessionForSetup":
case "cancelPaymentIntentSource":
case "cancelSetupIntentSource":
case "clearInstantDebitsIncentive":
case "resetConsumerIncentiveOffer":
case "completeLinkAccountSessionElements":
case "confirmPaymentIntent":
case "confirmReturnIntent":
case "confirmSetupIntent":
case "createAcssDebitSession":
case "createApplePaySession":
case "createConfirmationTokenWithElements":
case "createConsumerPaymentDetails":
case "createEphemeralKeyNonce":
case "createPaymentMethodWithData":
case "createPaymentMethodWithElement":
case "createPaymentMethodWithElements":
case "createPaymentPage":
case "createPaymentPageWithSession":
case "initPaymentPage":
case "updatePaymentPage":
case "retrievePaymentPage":
case "confirmPaymentPage":
case "createRadarSession":
case "attachHCaptchaTokenToRadarSession":
case "createSourceWithData":
case "createSourceWithElement":
case "confirmInstantDebitsIncentiveForPaymentDetails":
case "fetchingWallets":
case "shouldShowEceButton":
case "eceNotifySheetAuthenticationNeeded":
case "expressCheckoutConfirmStart":
case "expressCheckoutConfirmEnd":
case "expressCheckoutSheetOpened":
case "expressCheckoutSheetClosed":
case "getElementConfirmingPayment":
case "getIsAwaitingConfirmCallback":
case "getEcePaymentSheetState":
case "getElementsSessionAmountModeCurrency":
case "setExpressCheckoutConfirmData":
case "closeECEPaymentSheet":
case "fetchLocale":
case "fetchUpdates":
case "localizeError":
case "unsafeLocalizeString":
case "loginWithConsumerInfo":
case "retrieveIssuingCard":
case "retrieveIssuingCardWithoutNonce":
case "retrievePaymentIntent":
case "retrieveSetupIntent":
case "retrieveSource":
case "rememberLinkLogin":
case "forgetLinkLogin":
case "createSharedSessionContext":
case "removeElementsExperimentId":
case "resetExpressCheckoutState":
case "getGoogleMapsPredictions":
case "getGoogleMapsDetails":
case "initGoogleMapsService":
case "setupStoreForElementsGroup":
case "showWalletIfNecessary":
case "tokenizeCvcUpdate":
case "tokenizeWithData":
case "tokenizeWithElement":
case "updateElementsOptions":
case "updatePaymentIntent":
case "verifyMicrodepositsForPayment":
case "verifyMicrodepositsForSetup":
case "retrieveWalletConfigAvailability":
case "retrieveWalletConfig":
case "elementMounted":
case "elementUnmounted":
case "logOutOfLinkInElements":
case "updateStripeUserCredentials":
case "validateElements":
case "retrievePaypalMerchantId":
case "linkPopupLogOut":
case "updateLoggingParams":
case "internalSetFormValueForAddressElement":
case "preloadConsumerLookup":
case "prefillUsBankAccountFormWithConsumer":
case "setInstrumentForConsumerSignUpIncentive":
case "midsChange":
return (0,
x.O8)(e);
case "authenticate3DS2":
return "authenticate_3ds2";
case "updateCSSFonts":
return "update_css_fonts";
case "cancelCardImageVerificationChallenge":
return "cancel_challenge_cardimageverification";
case "verifyCardImageVerificationChallenge":
return "verify_challenge_cardimageverification";
default:
return null
}
}(t);
if (r) {
var a = {};
try {
switch (t) {
case "confirmSetupIntent":
case "updatePaymentIntent":
case "confirmPaymentIntent":
var i = n;
a.element = $(i);
break;
case "createPaymentPage":
var o = n
, s = o.betas
, u = o.mode;
a.options = {
betas: s,
mode: u
};
break;
case "createPaymentPageWithSession":
var l = n.betas;
a.options = {
betas: l
}
}
} catch (e) {}
He.log(r, a)
}
}
,
this.handleAction = function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
var n, r, a, i, o;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return E.reportAction(t),
n = t.nonce,
r = t.actionName,
a = t.request,
e.prev = 2,
i = E.outerInitiatedActions[r],
e.next = 6,
i(a);
case 6:
o = e.sent,
E.frameHub.sendMessageToParent({
action: "stripe-controller-action-response",
payload: {
nonce: n,
response: o
}
}),
e.next = 13;
break;
case 10:
e.prev = 10,
e.t0 = e.catch(2),
E.frameHub.sendMessageToParent({
action: "stripe-controller-action-error",
payload: {
nonce: n,
error: (0,
Vh.Xy)(e.t0)
}
});
case 13:
case "end":
return e.stop()
}
}
), e, null, [[2, 10]])
}
)));
return function(t) {
return e.apply(this, arguments)
}
}(),
this.requestState = function(e, t) {
var n, r = E.requests.create(), a = r.nonce, i = r.promise;
return null != t && t.useFrameMessengerMode && (n = (0,
Zf.XQ)(E.frameHub, e, {
skipValidation: null == t ? void 0 : t.skipValidation
})),
E.frameHub.isFrameReady(e) ? E.frameHub.sendMessageToFrame(e, {
action: "stripe-controller-request",
payload: {
nonce: a,
skipValidation: null == t ? void 0 : t.skipValidation
}
}) : E.requests.resolve(a, void 0),
n && n.then((function(n) {
i.then((function(r) {
var a = (0,
O.Dg)(r)
, i = (0,
O.Dg)(n);
if (!(0,
O.Xy)(a, i)) {
var o = E.frameHub.getFrameType(e) || ""
, s = [L.NC.CARD_ELEMENT_SPLIT, L.NC.CARD_ELEMENT_COMBINED].indexOf(o) > -1;
He.log("debug.controller.request_state_mismatch", {
debugPath: null == t ? void 0 : t.debugPath,
frameType: o,
oldPathState: s ? JSON.stringify((0,
O.M4)(a)) : void 0,
newPathState: s ? JSON.stringify((0,
O.M4)(i)) : void 0
})
}
}
))
}
)),
i
}
;
var D = (0,
T.vB)(t)
, U = (0,
_.Z)({}, ((0,
y.Z)(D),
D))
, j = (0,
M.Gu)(CC, U, "[internal interface]", {
authenticatedOrigin: he.Fd
}).value
, B = j.apiKey
, F = j.apiVersion
, q = j.v2
, z = j.__privateApiUrl
, Y = j.__privatePaymentUserAgentSuffix
, J = j.__privateSharedSessionContext
, X = j.stripeAccount
, Q = j.betas
, ee = j.controllerId
, te = j.stripeJsId
, ne = j.stripeJsLoadTime
, re = j.locale
, ae = j.manualBrowserDeprecationRollout
, ie = j.topOriginForCrossOriginFrame
, oe = j.controllerCount
, se = j.mids;
if (!(B && te && ne && ee))
throw new Error("It looks like Stripe.js was not loaded correctly");
if (function(e) {
var t = e.apiKey
, n = e.context
, r = e.forceRollout
, a = e.isAffectedBrowser
, i = e.rolloutSlice
, o = e.log
, s = If()(t)
, u = {
apiKey: t,
hashedKey: s,
isAffectedBrowser: a,
context: n
}
, l = function(e) {
var t = e.mechanism
, r = e.action;
a && o("legacy-deprecation-rollout", (0,
b.Z)((0,
b.Z)({}, u), {}, {
mechanism: t,
action: r,
state: [n, t, r].join("-")
}))
};
return r ? (l({
mechanism: Lf,
action: a ? Tf : Of
}),
a) : "___TESTMODE_FORCE_UNSUPPORTED_BROWSER" === t || (-1 !== (0,
O.cx)(wf, (function(e) {
return e === s
}
)) ? (l({
mechanism: Rf,
action: a ? Tf : Of
}),
a) : -1 !== (0,
O.cx)(Nf, (function(e) {
return e === s
}
)) ? (l({
mechanism: Rf,
action: Of
}),
!1) : function(e, t) {
return t < 100
}(0, i) ? (l({
mechanism: Df,
action: a ? Tf : Of
}),
a) : (l({
mechanism: Uf,
action: Of
}),
!1))
}({
apiKey: B,
context: "inner",
forceRollout: !0 === ae,
isAffectedBrowser: !window.Promise,
rolloutSlice: Math.floor(100 * Math.random()),
log: jf
}))
throw new Error("Stripe is being used in an unsupported browser and will not function. See https://stripe.com/docs/js/appendix/supported_browsers for details.");
this._metadataManager = Ed.initInstance({
stripeJsId: te,
topOriginForCrossOriginFrame: ie,
stripeJsLoadTimestamp: K.E.fromPosixTime(Number(ne)),
loadTimestamp: new K.E,
globalLocale: re,
betas: null != Q ? Q : [],
paymentUserAgentContextSuffix: Y
}),
this.v2Auth = q ? {
authToken: q.authToken,
stripeContext: q.stripeContext
} : null,
this.id = window.name,
this.controllerId = ee;
var ue = (0,
T.Ds)(this._metadataManager.referrer)
, le = (0,
b.Z)((0,
b.Z)({
key: B,
key_mode: (0,
R.lO)(B),
stripe_account: X,
referrer: ue ? ue.origin : ""
}, Q ? {
betas: Q
} : {}), {}, {
stripe_js_id: te,
controller_load_time: this._metadataManager.loadTimestamp.getAsPosixTime(),
elements_session_id: de({
experimentKey: V.D3.elements_session,
apiKey: B,
stripeAccount: X
}),
elements_assignment_id: de({
experimentKey: V.D3.elements_assignment
})
}, w([]));
He.updateParams(le),
cl.updateParams({
public_key: le.key,
stripe_account: le.stripe_account,
stripe_js_id: te
});
var ce, pe = vt.jL.ElementsController, ye = {
disableStoredCredentialsPreload: !0,
sessionId: te
};
this.linkApiClient = J ? Hl.initChild(pe, J, ye) : Hl.init(pe, B, null != X ? X : null, ye),
z && ((0,
Zs.lC)(z) || this.warn("__privateApiUrl can only be used by Stripe-owned integrations, with stripe.com or stripe.me domains.")),
(0,
Zs.qO)((function() {
E.frameHub.sendMessageToParent({
action: "stripe-api-call",
payload: {}
})
}
)),
this.experimentCache = new Wf,
this._apiClient = new oS({
logger: He,
authenticationParams: {
key: B,
_stripe_account: X,
_stripe_version: F
},
mids: se
}),
this._cache.resetAll(),
this._setupPostMessage(),
(0,
_e.u)(this, (function() {
return !0
}
)),
this._checkFrameMountedProperly(),
this.frameHub = new sC(this.controllerId,He),
this.frameHub.sendMessageToParent({
action: "stripe-controller-load",
payload: {
controllerMetrics: {
resource_timings: yf()
}
}
}),
He.log("controller.load", {
controller_count: oe,
has_link_auth: !!(0,
ru.jC)({
key: B,
livemode: (0,
R.lO)(B) === R.Kl.live
})
}),
ce = function(e) {
"hidden" === e ? He.log("controller.page_hide") : He.log("controller.page_show")
}
,
document.visibilityState ? document.addEventListener("visibilitychange", (function() {
ce(document.visibilityState)
}
)) : (window.addEventListener("pagehide", (function() {
ce("hidden")
}
)),
window.addEventListener("pageshow", (function() {
ce("visible")
}
))),
this._performanceTimelineReporter = new pC.nq(this.report.bind(this)),
(0,
pC.IR)({
types: ["resource", "longtask", "long-animation-frame", "visibility-state"],
reporter: function(e) {
E._performanceTimelineReporter.recordEntries(e, location.href)
}
})
}
var t, n, r, a, i, o, s;
return (0,
E.Z)(e, [{
key: "report",
value: function(e, t) {
He.log(e, t)
}
}, {
key: "reportError",
value: function(e) {
this._reportError(zh.QO.CONTROLLER, e)
}
}, {
key: "_reportError",
value: function(e, t) {
(0,
zh.Tb)({
app: e,
exception: t,
hint: {
captureContext: {
tags: (0,
O.ei)(He.getParams(), ["referrer", "stripe_js_id", "key", "key_mode", "stripe_account", "wrapper", "browserClassification"])
}
}
})
}
}, {
key: "updateLogParams",
value: function(e) {
He.updateParams(e)
}
}, {
key: "innerAction",
value: function(e, t) {
var n = this;
return this.innerInitiatedActions[e] ? (-1 === Ce.indexOf(e) && He.log((0,
x.wX)(e), {
element: null == t ? void 0 : t.elementName
}),
new vC((function(r) {
r(n.innerInitiatedActions[e](t))
}
))) : (He.log("fatal.unknown_action", {
type: e,
options: t
}),
vC.reject(new I.No("Unknown action: ".concat(e))))
}
}, {
key: "validateAndCreatePaymentMethodParamsWithL3PlusElement",
value: (s = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
var n, r, a, i, o, s, u, l, c, d = this;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
if (n = t.frameId,
r = t.groupId,
a = t.paymentMethodData,
i = t.mids,
o = t.slug,
s = t.enforcePreSubmit,
u = t.enforcePaymentMethodCreationManual,
l = t.maybeParsedIntentSecret,
!jb(a || {})) {
e.next = 4;
break
}
throw new I.No("Do not use ".concat(kC[o], ' with raw card data. Use the "payment" Element instead.'));
case 4:
if ((c = this._isExpressCheckoutElement(n)) || !s || this._recentlyValidated) {
e.next = 7;
break
}
throw new I.No("elements.submit() must be called before ".concat(kC[o], ". Call elements.submit() as soon as your customer presses pay, prior to any asynchronous work. Integration guide: https://stripe.com/docs/payments/accept-a-payment-deferred"));
case 7:
return e.abrupt("return", this.outerInitiatedActions.validateElements({
groupId: r,
slug: o
}).then((function(e) {
return e && "error" === e.type ? e : c ? Wk(d._getControllerContext(), {
paymentMethodData: a,
frameId: n,
mids: i,
enforcePaymentMethodCreationManual: u,
slug: o
}) : d.createPaymentMethodParamsWithPaymentElement({
frameId: n,
paymentMethodData: a,
mids: i,
enforcePaymentMethodCreationManual: u,
maybeParsedIntentSecret: l
}, o)
}
)));
case 8:
case "end":
return e.stop()
}
}
), e, this)
}
))),
function(e) {
return s.apply(this, arguments)
}
)
}, {
key: "confirmIntentParams",
value: (o = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return e.next = 2,
this.parseIntentMutationParams(t, n);
case 2:
if ("error" !== (r = e.sent).type) {
e.next = 5;
break
}
return e.abrupt("return", r);
case 5:
if (r.params.confirmation_token || (a = eh(r.params.expected_payment_method_type, r.params.payment_method_options),
(i = a.mandate_data) && (r.params.mandate_data = i)),
!t.handleActions) {
e.next = 12;
break
}
e.t0 = r.params.expected_payment_method_type,
e.next = "link" === e.t0 || "card" === e.t0 || "affirm" === e.t0 ? 10 : 12;
break;
case 10:
return r.params.use_stripe_sdk = !0,
e.abrupt("break", 12);
case 12:
return e.abrupt("return", r);
case 13:
case "end":
return e.stop()
}
}
), e, this)
}
))),
function(e, t) {
return o.apply(this, arguments)
}
)
}, {
key: "updateIntentParams",
value: (i = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o, s = this;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return e.next = 2,
Q(t) ? s.parseUpdateIntentMutationParams(t, n) : (He.log("debug.update_intent_params.fallback_used_for_tag", {
tag: t.tag
}),
s.parseIntentMutationParams(t, n));
case 2:
if (r = e.sent,
a = (0,
N.uN)(this._metadataManager.betas, [N.M4.line_items_beta_1, N.M4.tax_product_beta_1]),
"error" !== r.type && !a) {
e.next = 6;
break
}
return e.abrupt("return", r);
case 6:
return i = eh(r.params.expected_payment_method_type, r.params.payment_method_options),
(o = i.mandate_data) && (r.params.mandate_data = o),
e.abrupt("return", r);
case 9:
case "end":
return e.stop()
}
}
), e, this)
}
))),
function(e, t) {
return i.apply(this, arguments)
}
)
}, {
key: "_transformPaymentMethodOptions",
value: function(e) {
var t = this;
return vC.resolve().then((function() {
if (!(0,
x.Kn)(e))
return e;
var n = e.card
, r = (0,
h.Z)(e, gC);
if (!(0,
x.Kn)(n))
return e;
var a = n.cvc
, i = (0,
h.Z)(n, bC);
if (null == a)
return e;
var o = (0,
M.rX)(a);
if (!o)
return (0,
b.Z)((0,
b.Z)({}, r), {}, {
card: (0,
b.Z)((0,
b.Z)({}, n), {}, {
payment_user_agent: t._metadataManager.getPaymentUserAgent(ua.Kp)
})
});
var s = o._implementation._frame.id
, u = dC(He.log, "frame_messenger_request_state_transformPaymentMethodOptions", t.controllerId, {
control: 50,
treatment: 50
});
return t._retrieveElementData(s, !1, {
useFrameMessengerMode: "treatment" === u ? "actual" : void 0,
debugPath: "transformPaymentMethodOptions"
}).then((function(e) {
return "error" === e.type ? vC.reject(e) : e.value.linkInCardPaymentData ? vC.reject(Jf(t._getControllerContext(), s)) : (0,
b.Z)((0,
b.Z)({}, r), {}, {
card: (0,
b.Z)((0,
b.Z)({}, i), {}, {
cvc: e.value.cardCvc
})
})
}
))
}
)).then((function(e) {
return {
type: "payment_method_options",
paymentMethodOptions: e
}
}
), (function(e) {
return e
}
))
}
}, {
key: "createPaymentMethodParamsWithElements",
value: (a = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o, s, u, l, c, d, p, m, f, h, _;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
if (r = t.elementConfirming,
a = t.groupId,
i = t.paymentMethodData,
o = t.mids,
s = t.elements,
u = t.enforcePreSubmit,
l = t.enforcePaymentMethodCreationManual,
c = (0,
Zf.jW)(this.frameHub, a, "payment" === r ? L.NC.PAYMENT_ELEMENT : L.NC.EXPRESS_CHECKOUT_ELEMENT)) {
e.next = 14;
break
}
if (!((d = s.filter((function(e) {
return Y.hasOwnProperty(e._componentName)
}
))).length > 1)) {
e.next = 8;
break
}
throw new I.No("Found multiple payment method elements: ".concat(d.join(", "), ". Pass in a single `element` instead."));
case 8:
if (0 !== d.length) {
e.next = 12;
break
}
throw new I.No("Could not find a mounted element to create a payment method from.");
case 12:
return p = d[0],
e.abrupt("return", this.createPaymentMethodParamsWithElement({
mids: o,
frameId: p._implementation._frame.id,
elementName: p._componentName,
type: Y[p._componentName],
paymentMethodData: i,
enforcePreSubmit: u,
enforcePaymentMethodCreationManual: l
}, n));
case 14:
return e.next = 16,
this.elementsStores.strictGet(a, "createPaymentMethodParamsWithElements");
case 16:
if (m = e.sent.getState(),
f = xa(m),
!(0,
N.uN)(this._metadataManager.betas, N.M4.deferred_intent_pe_optional_amount_beta_0)) {
e.next = 22;
break
}
if ("payment" !== (null === (h = m.config.deferredIntent) || void 0 === h ? void 0 : h.mode) || null != (null === (_ = m.config.deferredIntent) || void 0 === _ ? void 0 : _.amount)) {
e.next = 22;
break
}
throw new I.No("It looks like you have payment mode in your Elements options but the amount is not set. Please call elements.update() to set the amount before calling stripe.createPaymentMethod()");
case 22:
return e.abrupt("return", this.validateAndCreatePaymentMethodParamsWithL3PlusElement({
frameId: c,
groupId: a,
paymentMethodData: i,
mids: o,
slug: n,
enforcePreSubmit: u,
enforcePaymentMethodCreationManual: l,
maybeParsedIntentSecret: null == f ? void 0 : f.parsedClientSecret
}));
case 23:
case "end":
return e.stop()
}
}
), e, this)
}
))),
function(e, t) {
return a.apply(this, arguments)
}
)
}, {
key: "createSourceParamsWithElement",
value: function(e, t) {
var n, r = this, a = e.frameId, i = e.elementName, o = e.type, s = e.sourceData, u = e.mids, l = W(i, o), c = (0,
M.$6)((n = {},
(0,
v.Z)(n, V.Yj.auBankAccount, (0,
M.kw)(H.au_becs_debit)),
(0,
v.Z)(n, V.Yj.iban, (0,
M.kw)(H.sepa_debit)),
(0,
v.Z)(n, V.Yj.card, (0,
M.kw)(H.card)),
(0,
v.Z)(n, V.Yj.cardNumber, (0,
M.kw)(H.card)),
(0,
v.Z)(n, V.Yj.cardExpiry, (0,
M.kw)(H.card)),
(0,
v.Z)(n, V.Yj.cardCvc, (0,
M.kw)(H.card)),
(0,
v.Z)(n, V.Yj.postalCode, (0,
M.kw)(H.card)),
(0,
v.Z)(n, V.Yj.idealBank, (0,
M.kw)(H.ideal)),
n)), d = (0,
M.Gu)(c, l, "type", {
element: i
}).value, p = dC(He.log, "frame_messenger_request_state_createSourceParamsWithElement", this.controllerId, {
control: 50,
treatment: 50
});
return this._retrieveElementData(a, !0, {
useFrameMessengerMode: "treatment" === p ? "actual" : void 0,
debugPath: "createSourceParamsWithElement"
}).then((function(e) {
if ("error" === e.type)
return He.log("".concat(t, ".validation_error"), {
error: e.error,
element: i
}),
e;
var n = e.element
, o = e.locale
, l = e.value
, c = e.pastedFields
, p = Ad(n, l, d, c);
if ("link_in_card_payment_data" === p.type) {
var m = p.data
, f = m.sharePaymentDetailsRequestParams
, h = m.paymentDetailsBillingCountry
, _ = m.meta;
return Qf(r._getControllerContext(), {
elementName: n,
locale: o,
sharePaymentDetailsRequestParams: f,
paymentDetailsBillingCountry: h,
merchantPassthroughParams: {
mode: "source",
data: s
},
postalCollectionDisabled: (null == _ ? void 0 : _.isNotCollectingPostal) || !1,
frameId: a,
slug: t
}).then((function(e) {
if ("error" === e.type)
return e;
var t = (0,
O.TS)({
type: "card"
}, s, {
token: e.object.id
});
(0,
O.$D)(t, "owner.address");
var a = r.transformSourceParams({
data: t,
mids: u,
elementName: n
});
return {
type: "element_source_params",
locale: o,
sourceParams: jb(s) ? (0,
b.Z)((0,
b.Z)({}, a), {}, {
payment_user_agent: r._metadataManager.getPaymentUserAgent(ua.QO)
}) : a
}
}
))
}
var y = p.data
, v = p.type
, g = "card" === v && p.pastedFields ? {
pastedFields: p.pastedFields
} : {}
, S = (0,
O.TS)({
type: v
}, s, y)
, k = r.transformSourceParams((0,
b.Z)({
data: S,
elementName: n,
mids: u
}, g));
return {
type: "element_source_params",
locale: o,
sourceParams: jb(s) ? (0,
b.Z)((0,
b.Z)({}, k), {}, {
payment_user_agent: r._metadataManager.getPaymentUserAgent(ua.QO)
}) : k
}
}
))
}
}, {
key: "createPaymentMethodParamsWithData",
value: function(e) {
var t = e.type
, n = e.paymentMethodData
, r = e.mids
, a = e.elementName;
if ("card" === t) {
var i = (0,
M.Gu)((0,
M.jt)(M.Ry), n.card, "createPaymentMethod card data").value;
if (i) {
var o = !!(0,
M.Gu)((0,
M.jt)(M.Z_), i.token, "createPaymentMethod token string").value
, s = Lh(i);
if (!o && !s) {
var u = this.transformPaymentMethodParams({
data: (0,
b.Z)({
type: t
}, n),
mids: r
});
return {
type: "data_payment_method_params",
paymentMethodParams: (0,
b.Z)((0,
b.Z)({}, u), {}, {
payment_user_agent: this._metadataManager.getPaymentUserAgent(ua.Kp)
})
}
}
}
}
var l = this.transformPaymentMethodParams({
data: (0,
b.Z)({
type: t
}, n),
elementName: null != a ? a : void 0,
mids: r
});
return {
type: "data_payment_method_params",
paymentMethodParams: "card" === t ? l : (0,
b.Z)((0,
b.Z)({}, l), {}, {
payment_user_agent: this._metadataManager.getPaymentUserAgent(ua.s8)
})
}
}
}, {
key: "createConfirmationTokenParamsWithElements",
value: (r = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var r, a, i, o, s, u, l, c, d, p, m, f, h, _;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
if (i = t.groupId,
o = t.params,
s = t.mids,
u = t.elementConfirming,
l = (0,
Zf.jW)(this.frameHub, i, "payment" === u ? L.NC.PAYMENT_ELEMENT : L.NC.EXPRESS_CHECKOUT_ELEMENT)) {
e.next = 4;
break
}
throw new I.No("Could not find a mounted element to create the Confirmation Token from, please ensure you have a Payment Element or Express Checkout Element mounted (or both).");
case 4:
return e.next = 6,
this.elementsStores.strictGet(i, "createConfirmationTokenParamsWithElements");
case 6:
return c = e.sent.getState(),
d = c.config,
p = null === (r = c.paymentElement.session) || void 0 === r || null === (a = r.customer) || void 0 === a ? void 0 : a.id,
m = xa(c),
f = Oh({
canUseShipping: !0,
isECE: "expressCheckout" === u,
elementsState: c,
shippingParam: null == o ? void 0 : o.shipping
}),
h = Rh(this._metadataManager.betas, p, d.deferredIntent, !1),
_ = {
shipping: f,
client_context: h,
return_url: null == o ? void 0 : o.return_url,
expand: null == o ? void 0 : o.expand
},
e.abrupt("return", this.validateAndCreatePaymentMethodParamsWithL3PlusElement({
frameId: l,
groupId: i,
paymentMethodData: (null == o ? void 0 : o.payment_method_data) || {},
mids: s,
slug: n,
enforcePreSubmit: !0,
enforcePaymentMethodCreationManual: !1,
maybeParsedIntentSecret: null == m ? void 0 : m.parsedClientSecret
}).then((function(e) {
var t, r, a, i, s;
if ("error" === e.type)
return e;
var l = Vb(e.selectedPaymentMethod)
, p = th({
deferredIntentSetupFutureUsage: null === (t = d.deferredIntent) || void 0 === t ? void 0 : t.setup_future_usage,
intentFirstType: null === (r = d.session) || void 0 === r || null === (a = r.parsedClientSecret) || void 0 === a ? void 0 : a.type,
intentFirstSetupFutureUsage: null === (i = d.session) || void 0 === i ? void 0 : i.setupFutureUsage,
intentFirstPaymentMethodOptions: null === (s = d.session) || void 0 === s ? void 0 : s.paymentMethodOptions,
paymentMethodType: l,
paymentMethodOptionsOverriddenBySJS: e.confirmPaymentMethodOptions
});
switch (e.type) {
case "element_payment_method":
case "element_payment_method_id":
var m = "element_payment_method" === e.type ? e.paymentMethod.id : e.paymentMethod;
return {
type: "payment_method_id",
expected_payment_method_type: l,
params: (0,
b.Z)((0,
b.Z)((0,
b.Z)({
payment_method: m,
setup_future_usage: p
}, eh(e.selectedPaymentMethod, e.confirmPaymentMethodOptions)), _), {}, {
payment_method_options: zb(e.confirmPaymentMethodOptions),
set_as_default_payment_method: i_({
slug: n,
elementsState: c
})
})
};
case "element_payment_method_params":
var f = e.selectedPaymentMethod;
Gh({
paymentMethod: f,
elementConfirming: u,
session: e.session
});
var h = (0,
b.Z)({}, ff(e.paymentMethodParams, null == o ? void 0 : o.payment_method_data));
return {
type: "payment_method_data",
expected_payment_method_type: l,
params: (0,
b.Z)((0,
b.Z)((0,
b.Z)({
payment_method_data: h,
payment_method_options: zb(e.confirmPaymentMethodOptions),
setup_future_usage: p
}, eh(e.selectedPaymentMethod, e.confirmPaymentMethodOptions)), _), {}, {
set_as_default_payment_method: i_({
slug: n,
elementsState: c
})
})
};
default:
return (0,
P.Rz)(e)
}
}
)));
case 14:
case "end":
return e.stop()
}
}
), e, this)
}
))),
function(e, t) {
return r.apply(this, arguments)
}
)
}, {
key: "createSourceParamsWithData",
value: function(e) {
var t = e.type
, n = e.sourceData
, r = e.mids
, a = e.elementName;
if ("card" === t) {
var i = (0,
M.Gu)((0,
M.jt)(M.Ry), n.card, "createSource card data").value
, o = (0,
M.Gu)((0,
M.jt)(M.Z_), n.token, "createSource token string").value;
if (!(i && Lh(i)) && !!!o) {
var s = this.transformSourceParams({
data: (0,
b.Z)({
type: t
}, n),
mids: r
});
return {
type: "data_source_params",
sourceParams: (0,
b.Z)((0,
b.Z)({}, s), {}, {
payment_user_agent: this._metadataManager.getPaymentUserAgent(ua.Kp)
})
}
}
}
return {
type: "data_source_params",
sourceParams: this.transformSourceParams({
data: (0,
b.Z)({
type: t
}, n),
elementName: null != a ? a : void 0,
mids: r
})
}
}
}, {
key: "transformSourceParams",
value: function(e) {
var t = e.mids
, n = e.data
, r = e.pastedFields
, a = e.elementName
, i = Md(n.type, n).data;
return (0,
b.Z)((0,
b.Z)((0,
b.Z)({}, i), t || {}), {}, {
pasted_fields: r
}, this._metadataManager.getPaymentMetadata(a))
}
}, {
key: "transformPaymentMethodParams",
value: function(e) {
var t = e.mids
, n = e.data
, r = e.pastedFields
, a = e.elementName
, i = Bs.transformData(n.type, n).data;
return (0,
b.Z)((0,
b.Z)((0,
b.Z)({}, i), t || {}), {}, {
pasted_fields: r
}, this._metadataManager.getPaymentMetadata(a))
}
}, {
key: "createSourceWithParams",
value: (n = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
var n, r, a, i, o, s, u, l, c;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
if (n = t.sourceParams,
r = t.locale,
a = t.elementName,
i = t.slug,
o = t.merchantParams,
s = Sd(this._cardElementState, {
element: a,
paymentMethod: null == n ? void 0 : n.type
}),
u = Hf({
isCheckingOutWithLink: s,
linkFunnel: cl,
element: a,
type: "source"
}),
!ht(a, n.type)) {
e.next = 8;
break
}
return e.next = 6,
dt({
slug: i,
siteKey: this._hcaptchaManager.getSiteKey("elements"),
getCaptchaToken: this.outerAction.getCaptchaToken
});
case 6:
(l = e.sent) && (n.radar_options ? n.radar_options.hcaptcha_token = l : n.radar_options = {
hcaptcha_token: l
});
case 8:
return null == u || u.attempt(),
e.next = 11,
this._apiClient.sources.create({
data: (0,
b.Z)({}, n),
errorLog: He.log,
merchantParams: o,
options: {
slugOverride: i,
loggerExtras: yt((0,
b.Z)({
elementName: a,
mids: n,
usesLink: s
}, r ? {
localeOverride: r
} : {}))
}
});
case 11:
return c = e.sent,
pe(i) && this.outerInitiatedActions.removeElementsExperimentId(),
null == u || u.result(c),
e.abrupt("return", c);
case 15:
case "end":
return e.stop()
}
}
), e, this)
}
))),
function(e) {
return n.apply(this, arguments)
}
)
}, {
key: "createPaymentMethodWithParams",
value: (t = (0,
k.Z)((0,
S.Z)().mark((function e(t) {
var n, r, a, i, o, s, u, l, c, d, p = this;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
if (n = t.paymentMethodParams,
r = t.locale,
a = t.elementName,
i = t.slug,
o = this._metadataManager.resolveLocale(r),
s = (0,
b.Z)((0,
b.Z)({}, n), this._apiClient.getAuthenticationParams()),
u = Sd(this._cardElementState, {
element: a,
paymentMethod: null == n ? void 0 : n.type
}),
l = Hf({
isCheckingOutWithLink: u,
linkFunnel: cl,
element: a,
type: "payment-method"
}),
!ht(a, null == n ? void 0 : n.type)) {
e.next = 10;
break
}
return e.next = 8,
dt({
slug: i,
siteKey: this._hcaptchaManager.getSiteKey("elements"),
getCaptchaToken: this.outerAction.getCaptchaToken
});
case 8:
(c = e.sent) && (s.radar_options ? s.radar_options.hcaptcha_token = c : s.radar_options = {
hcaptcha_token: c
});
case 10:
return e.prev = 10,
e.next = 13,
m = void 0,
(m = eS(s)) ? vC.resolve(m) : (null == l || l.attempt(),
p._isLinkPaymentMethodData(n) ? p.linkApiClient.paymentMethod.create((0,
b.Z)((0,
b.Z)({}, s), {}, {
type: "link"
})) : Ol.paymentMethods.create({
data: s,
log: He.log,
merchantParams: t.merchantParams
}));
case 13:
return d = e.sent,
null == l || l.result(d),
this._apiClient.reportFetchResult(i, d, yt({
elementName: a,
mids: n,
usesLink: u
})),
pe(i) && this.outerInitiatedActions.removeElementsExperimentId(),
e.abrupt("return", sf(d, o, {
logger: He
}));
case 20:
return e.prev = 20,
e.t0 = e.catch(10),
null == l || l.error(),
e.abrupt("return", this._apiClient.handleFetchErrorTagged(i, e.t0, o));
case 24:
case "end":
return e.stop()
}
var m
}
), e, this, [[10, 20]])
}
))),
function(e) {
return t.apply(this, arguments)
}
)
}, {
key: "injectControllerContext",
value: function(e) {
var t = this;
return function(n) {
return e(t._getControllerContext(), n)
}
}
}, {
key: "_isLinkPaymentMethodData",
value: function(e) {
return "link" === (null == e ? void 0 : e.type)
}
}, {
key: "_createOrUpdateShippingAddressOp",
value: function(e) {
var t, n, r, a, i, o = Qp(Dd)(e), s = (t = o,
function(e) {
if (!em(t)(e))
return null;
var n = sm(e, t);
return n && (0,
O.CE)(n, ["phone"])
}
)(e), u = qp(Dd)(e), l = function(e) {
return function(t) {
var n;
return (null === (n = t.addressElement[e].selectedSavedAddress) || void 0 === n ? void 0 : n.mode) || null
}
}(Dd)(e);
return s ? (r = (n = {
shippingAddress: s,
isDefault: !0
}).shippingAddress,
a = n.isDefault,
i = void 0 !== a && a,
function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(t, n) {
var a, o, s, u, l, c, d, p;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return a = n(),
o = ta(r),
s = Qa(a),
u = wa(a),
e.next = 6,
Hl.sharedInstance().shippingAddresses.create({
request_surface: u,
address: o,
is_default: i
});
case 6:
l = e.sent,
c = l.error,
d = l.requestId,
p = l.object,
c ? Jl.log("link.shipping_address.create.error", {
request_id: d,
error: c,
default_integration: s
}) : Jl.log("link.shipping_address.create.success", {
request_id: d,
shipping_address_id: p.shipping_address.id,
default_integration: s
});
case 11:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}()) : u && "consumer" === l ? function(e) {
var t = e.id
, n = e.isDefault
, r = void 0 !== n && n;
return function() {
var e = (0,
k.Z)((0,
S.Z)().mark((function e(n, a) {
var i, o, s, u, l, c, d;
return (0,
S.Z)().wrap((function(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return i = a(),
o = Qa(i),
s = wa(i),
e.next = 5,
Hl.sharedInstance().shippingAddresses.update(t, {
request_surface: s,
is_default: r
});
case 5:
u = e.sent,
l = u.requestId,
c = u.error,
d = u.object,
c ? Jl.log("link.shipping_address.update.error", {
request_id: l,
error: c,
default_integration: o
}) : Jl.log("link.shipping_address.update.success", {
request_id: l,
shipping_address_id: d.shipping_address.id,
default_integration: o
});
case 10:
case "end":
return e.stop()
}
}
), e)
}
)));
return function(t, n) {
return e.apply(this, arguments)
}
}()
}({
id: u,
isDefault: !0
}) : null
}
}, {
key: "_dispatchErrorOnIntentConfirm",
value: function(e, t, n, r, a) {
var i, o = e.decline_code || e.code;
if (("card" === t || "link" === t) && o && qd.indexOf(o) >= 0) {
var s = (i = "card",
function(e) {
var t, n, r = (t = i,
n = "shippingAsBilling",
function(e) {
var r;
return void 0 !== t ? null === (r = e.paymentElement.form[t]) || void 0 === r ? void 0 : r.values[n] : ""
}
)(e);
return r && Ba(e)
}
)(r)
, u = {
error: e,
field: Kd(e)
};
(Fa(r) || s) && Gd.indexOf(o) >= 0 ? a.dispatch({
type: "ADDRESS.CONFIRM_FAILED_FOR_INTENT",
mode: Ud,
confirmationErrorState: u
}) : a.dispatch({
type: "PAYMENT.CONFIRM_ERROR",
error: e,
session: n,
confirmationErrorState: u
})
} else
a.dispatch({
type: "PAYMENT.CONFIRM_ERROR",
error: e,
session: n
})
}
}, {
key: "handleInnerBroadcast",
value: function(e) {
switch (e.type) {
case "link_launch_broadcast":
case "prb_warning_modal_dismiss":
break;
case "link_popup_log_out_no_sensitive_data":
this.outerInitiatedActions.logOutOfLinkInElements(),
$S(this._cache.walletConfigCache);
break;
case "preloaded_data_stale":
case "preloaded_data_change":
$S(this._cache.walletConfigCache);
break;
default:
(0,
P.Rz)(e)
}
}
}, {
key: "_checkFrameMountedProperly",
value: function() {
var e = this.id
, t = this.controllerId
, n = (0,
q.Hb)(e) === window.self;
e === t && n || He.log("error.iframe_unreachable", {
element: this.controllerFor(),
frameId: e,
controllerId: t,
reachable: n
})
}
}, {
key: "_setupPostMessage",
value: function() {
var e = this;
window.addEventListener("message", (function(t) {
var n = t.data
, r = t.origin
, a = (0,
L.$G)(n);
if (a) {
var i = a.message;
if ("stripe-controller-report" === i.action)
e._handleInnerReport(i.payload.event, i.payload.data);
else if ("stripe-controller-link-funnel" === i.action)
cl.controllerAppEvent(i.payload);
else if ("stripe-controller-update-log-params" === i.action)
e._handleInnerUpdateLogParams(i.payload.data);
else if ("stripe-controller-warn" === i.action)
e.warn.apply(e, (0,
Z.Z)(i.payload.args));
else if ("stripe-controller-experiment-exposure" === i.action)
e.trackExperimentExposure(i.payload.data);
else if ("report-error" === i.action) {
var o = i.payload
, s = o.error
, u = o.app
, l = (0,
Vh.Fq)(s);
e._reportError(u, l)
} else if ((0,
T.uW)(V.jQ, r))
e._handleInnerMessage(a);
else {
var c;
if (window.parent !== window && t.source !== window.parent && !(0,
T.Je)(r))
return void He.log("controller.action_from_non_parent", {
action: i.action,
actionName: null === (c = i.payload) || void 0 === c ? void 0 : c.actionName,
origin: r
});
e._handleOuterMessage(a)
}
}
}
))
}
}, {
key: "_handleOuterMessage",
value: function(e) {
var t = this
, n = e.message;
switch (n.action) {
case "stripe-user-createframe":
var r = n.payload
, a = r.newFrameId
, i = r.frameType
, o = r.groupId
, s = r.elementName;
a && (this.frameHub.addFrame((0,
b.Z)({
frameId: a,
groupId: o,
type: i
}, s ? {
elementName: s
} : {})),
i !== L.NC.ADDRESS_ELEMENT_SHIPPING && i !== L.NC.ADDRESS_ELEMENT_BILLING || (0,
x.XD)((function() {
return ip.initialize()
}
)).catch((function(e) {
He.log("ae.phone_lib.load.error", {
error: e
})
}
)));
break;
case "stripe-outer-controller-action-response":
var u = n.payload
, l = u.nonce
, c = u.response;
this.requests.resolve(l, c);
break;
case "stripe-outer-controller-action-error":
var d = n.payload
, p = d.nonce
, m = d.error;
this.requests.reject(p, m);
break;
case "stripe-controller-action-request":
this.handleAction(n.payload);
break;
case "stripe-frame-unload":
var f = n.payload.unloadedFrameId;
if (!this.frameHub.doesFrameExist(f))
break;
this.frameHub.updateFrame(f, {
loaded: !1
});
break;
case "stripe-frame-destroy":
var h = n.payload.destroyedFrameId
, _ = this.frameHub.getFrameGroup(h);
if (_) {
var y = h;
this.frameHub.removeFrameFromGroup({
groupId: _,
frameId: y
})
}
this.frameHub.deleteFrame(h);
break;
case "stripe-frame-load":
var v = n.payload.loadedFrameId
, g = this.frameHub.getFrameQueuedMessages(v);
if (!g)
break;
this.frameHub.updateFrame(v, {
loaded: !0,
queuedMessages: []
}),
g.forEach((function(e) {
return t.frameHub.sendMessageToFrame(e.targetFrameId, e.message)
}
)),
this.frameHub.sendMessageToFrame(v, {
action: "stripe-controller-init",
payload: {}
});
break;
case "stripe-wrapper-register":
var S = n.payload.stripeWrapperLibrary;
this._metadataManager.registerStripeWrapper(S);
break;
case "stripe-app-info-register":
var k = n.payload.wrapperLibrary;
this._metadataManager.registerStripeAppInfo(k)
}
}
}, {
key: "trackExperimentExposure",
value: function(e) {
var t = V.Jl.indexOf(e.experiment_retrieved) >= 0 ? "".concat(e.experiment_retrieved, "_").concat(e.arb_id) : e.experiment_retrieved;
this.experimentCache.has(t) || (this.experimentCache.add(t),
He.log(ke.f3, e))
}
}, {
key: "_handleInnerReport",
value: function(e, t) {
He.log(e, t)
}
}, {
key: "_handleInnerUpdateLogParams",
value: function(e) {
this.updateLogParams(e)
}
}, {
key: "_handleInnerMessage",
value: function(e) {
var t = this
, n = e.sourceFrameId
, r = e.message;
if (this.frameHub.doesFrameExist(n))
switch (r.action) {
case "stripe-controller-request-complete":
var a = r.payload
, i = a.nonce
, o = a.result
, s = a.error;
o && "object" == typeof o ? this.requests.resolve(i, (0,
b.Z)((0,
b.Z)({}, o), {}, {
frameId: n
})) : s && "object" == typeof s && this.requests.reject(i, (0,
b.Z)((0,
b.Z)({}, s), {}, {
frameId: n
}));
break;
case "stripe-inner-action":
this.innerAction(r.payload.type, r.payload.options).then((function(e) {
return t.frameHub.sendMessageToFrame(n, {
action: "stripe-inner-action-complete",
payload: {
nonce: r.payload.nonce,
result: e
}
})
}
), (function(e) {
r.payload.type && He.log("".concat((0,
x.wX)(r.payload.type), ".error"), {
error: e instanceof Error ? (0,
b.Z)((0,
b.Z)({}, e), {}, {
name: e.name,
message: e.message
}) : e
}),
t.frameHub.sendMessageToFrame(n, {
action: "stripe-inner-action-error",
payload: {
nonce: r.payload.nonce,
error: e.message
}
})
}
));
break;
case "stripe-broadcast":
this.frameHub.sendBroadcast(r.payload),
this.handleInnerBroadcast(r.payload);
break;
case "stripe-group-update":
case "stripe-group-action":
var u = this.frameHub.getFrameGroup(n)
, l = n;
u && this.frameHub.existsInGroup({
groupId: u,
frameId: l
}) && this.frameHub.sendGroupMessage(u, e.message, {
custom: function(e) {
return e !== n
}
});
break;
case "stripe-link-in-card-update-config":
this._cardElementState.linkConfigs = (0,
b.Z)((0,
b.Z)({}, this._cardElementState.linkConfigs), r.payload);
break;
default:
this.warn("Action ".concat(r.action, " could not be handled as an inner message."))
}
else
this._handleOuterMessage(e)
}
}]),
e
}(), ZC = EC;
ug = window.location.hash.substring(1).split("?")[0],
new ZC(ug)
},
64007: function(e, t, n) {
"use strict";
n.d(t, {
N: function() {
return r
}
});
var r = function(e, t) {
return "".concat(e || "https://js.stripe.com/v3/").concat(t || "")
}
},
76466: function(e, t, n) {
"use strict";
n.d(t, {
t: function() {
return r
}
});
var r = function(e) {
return Boolean(e && "function" == typeof e.then)
}
},
68148: function(e, t, n) {
"use strict";
n.d(t, {
O8: function() {
return r
},
i3: function() {
return a
},
pM: function() {
return i
},
wX: function() {
return o
}
});
var r = function(e) {
return e.replace(/[A-Z]/g, (function(e) {
return "_".concat(e[0].toLowerCase())
}
))
}
, a = function(e) {
return e.replace(/_./g, (function(e) {
return e[1].toUpperCase()
}
))
}
, i = function(e) {
var t = e.trim().toLowerCase();
return t ? "".concat(t[0].toUpperCase()).concat(t.substring(1).replace(/ +./g, (function(e) {
return " ".concat(e.slice(-1).toUpperCase())
}
))) : ""
}
, o = function(e) {
return e.toLowerCase()
}
},
63110: function(e) {
e.exports = function(e) {
var t = e.split("").map((function(e) {
return e.charCodeAt(0)
}
)).reduce((function(e, t) {
return (e << 5) - e + t & (e << 5) - e + t
}
), 0).toString();
return "_".concat(t.replace(/[-.]/g, "_"))
}
},
40882: function(e, t, n) {
"use strict";
n.d(t, {
l: function() {
return i
}
});
var r = n(47600)
, a = n(13745)
, i = function() {
var e = ""
, t = ""
, n = (0,
a.Ds)(document.referrer);
if (n && n.host !== window.location.host)
e = document.referrer,
t = n.origin;
else
try {
var i, o = window.location.hash.substring(1).split("?")[0], s = (0,
r.v)(o).referrer;
if ("string" == typeof s)
e = s,
t = (null === (i = (0,
a.Ds)(s)) || void 0 === i ? void 0 : i.origin) || ""
} catch (e) {}
return {
referrer: e,
referrerOrigin: t
}
}
},
34693: function(e, t, n) {
"use strict";
n.d(t, {
Ji: function() {
return i
},
Sl: function() {
return o
},
eH: function() {
return u
},
qQ: function() {
return s
}
});
var r = n(93324)
, a = new RegExp("^(?:4[0-9]{15,}|(?:5[0-6,8]|2[2-7]|6[037])[0-9]{14,}|3[47][0-9]{13}|6[45][0-9]{14}|3[089][0-9]{14}|36[0-9]{12}|35[0-9]{14}|(?:62|81)[0-9]{11,})$")
, i = function(e) {
for (var t = "0".charCodeAt(0), n = e.length % 2, r = 0, a = e.length - 1; a >= 0; --a) {
var i = a % 2 === n
, o = e.charCodeAt(a) - t;
i && (o *= 2),
o > 9 && (o -= 9),
r += o
}
return r % 10 == 0
}
, o = function(e) {
if ("string" != typeof e)
return !1;
var t = e.replace(/[\s-]+/g, "").match(/\d{13,}/g);
return !!t && t.some((function(e) {
return a.test(e) && i(e)
}
))
}
, s = function(e) {
var t = e.split("/").map((function(e) {
return e.trim()
}
))
, n = (0,
r.Z)(t, 2)
, a = n[0]
, i = void 0 === a ? "" : a
, o = n[1];
return {
year: void 0 === o ? "" : o,
month: i
}
}
, u = function(e, t, n) {
var r = new Date(Date.now())
, a = e < 100 ? r.getFullYear() % 100 : r.getFullYear()
, i = r.getMonth() + 1;
return isNaN(e) || isNaN(t) ? null != n && n.ignoreIncomplete ? null : "incomplete_expiry" : e - a < 0 ? "invalid_expiry_year_past" : e - a > 50 ? "invalid_expiry_year" : e - a == 0 && t < i ? "invalid_expiry_month_past" : null
}
},
84506: function(e, t, n) {
"use strict";
function r(e) {
return (0,
a.Z)(e) || (0,
i.Z)(e) || (0,
o.Z)(e) || (0,
s.Z)()
}
n.d(t, {
Z: function() {
return r
}
});
var a = n(83878)
, i = n(59199)
, o = n(40181)
, s = n(25267)
}
}, i = {};
e.m = a,
t = [],
e.O = function(n, r, a, i) {
if (!r) {
var o = 1 / 0;
for (c = 0; c < t.length; c++) {
r = t[c][0],
a = t[c][1],
i = t[c][2];
for (var s = !0, u = 0; u < r.length; u++)
(!1 & i || o >= i) && Object.keys(e.O).every((function(t) {
return e.O[t](r[u])
}
)) ? r.splice(u--, 1) : (s = !1,
i < o && (o = i));
if (s) {
t.splice(c--, 1);
var l = a();
void 0 !== l && (n = l)
}
}
return n
}
i = i || 0;
for (var c = t.length; c > 0 && t[c - 1][2] > i; c--)
t[c] = t[c - 1];
t[c] = [r, a, i]
}
,
e.n = function(t) {
var n = t && t.__esModule ? function() {
return t.default
}
: function() {
return t
}
;
return e.d(n, {
a: n
}),
n
}
,
e.d = function(t, n) {
for (var r in n)
e.o(n, r) && !e.o(t, r) && Object.defineProperty(t, r, {
enumerable: !0,
get: n[r]
})
}
,
e.f = {},
e.e = function(t) {
return Promise.all(Object.keys(e.f).reduce((function(n, r) {
return e.f[r](t, n),
n
}
), []))
}
,
e.u = function(e) {
return "fingerprinted/js/" + ({
1944: "phone-numbers-lib",
2897: "sentry",
7058: "stripe-cookies"
}[e] || e) + "-" + {
203: "9b7a5a765aafe5e8edc90bfbd4f86d5b",
1072: "8580f523356efbd69e6f83651b09422e",
1944: "aa1058d55b485c97b8d8566c76ad470a",
2897: "55e794a45906b3928352d1cd8374424d",
7058: "dad8b91c9944389b13aa885a576c929c"
}[e] + ".js"
}
,
e.miniCssF = function() {}
,
e.g = function() {
if ("object" == typeof globalThis)
return globalThis;
try {
return this || new Function("return this")()
} catch (e) {
if ("object" == typeof window)
return window
}
}(),
e.hmd = function(e) {
return (e = Object.create(e)).children || (e.children = []),
Object.defineProperty(e, "exports", {
enumerable: !0,
set: function() {
throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: " + e.id)
}
}),
e
}
,
e.o = function(e, t) {
return Object.prototype.hasOwnProperty.call(e, t)
}
,
n = {},
r = "stripe-js-v3:",
e.l = function(t, a, i) {
if (n[t])
n[t].push(a);
else {
var o, s;
if (void 0 !== i)
for (var u = document.getElementsByTagName("script"), l = 0; l < u.length; l++) {
var c = u[l];
if (c.getAttribute("src") == t || c.getAttribute("data-webpack") == r + i) {
o = c;
break
}
}
o || (s = !0,
(o = document.createElement("script")).charset = "utf-8",
o.timeout = 120,
e.nc && o.setAttribute("nonce", e.nc),
o.setAttribute("data-webpack", r + i),
o.src = t),
n[t] = [a];
var d = function(e, r) {
o.onerror = o.onload = null,
clearTimeout(p);
var a = n[t];
if (delete n[t],
o.parentNode && o.parentNode.removeChild(o),
a && a.forEach((function(e) {
return e(r)
}
)),
e)
return e(r)
}
, p = setTimeout(d.bind(null, void 0, {
type: "timeout",
target: o
}), 12e4);
o.onerror = d.bind(null, o.onerror),
o.onload = d.bind(null, o.onload),
s && document.head.appendChild(o)
}
}
,
e.r = function(e) {
"undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e, Symbol.toStringTag, {
value: "Module"
}),
Object.defineProperty(e, "__esModule", {
value: !0
})
}
,
e.j = 2204,
e.p = "https://js.stripe.com/v3/",
function() {
var t = {
2204: 0,
7058: 0
};
e.f.j = function(n, r) {
var a = e.o(t, n) ? t[n] : void 0;
if (0 !== a)
if (a)
r.push(a[2]);
else {
var i = new Promise((function(e, r) {
a = t[n] = [e, r]
}
));
r.push(a[2] = i);
var o = e.p + e.u(n)
, s = new Error;
e.l(o, (function(r) {
if (e.o(t, n) && (0 !== (a = t[n]) && (t[n] = void 0),
a)) {
var i = r && ("load" === r.type ? "missing" : r.type)
, o = r && r.target && r.target.src;
s.message = "Loading chunk " + n + " failed.\n(" + i + ": " + o + ")",
s.name = "ChunkLoadError",
s.type = i,
s.request = o,
a[1](s)
}
}
), "chunk-" + n, n)
}
}
,
e.O.j = function(e) {
return 0 === t[e]
}
;
var n = function(n, r) {
var a, i, o = r[0], s = r[1], u = r[2], l = 0;
if (o.some((function(e) {
return 0 !== t[e]
}
))) {
for (a in s)
e.o(s, a) && (e.m[a] = s[a]);
if (u)
var c = u(e)
}
for (n && n(r); l < o.length; l++)
i = o[l],
e.o(t, i) && t[i] && t[i][0](),
t[i] = 0;
return e.O(c)
}
, r = window.webpackChunkStripeJSinner = window.webpackChunkStripeJSinner || [];
r.forEach(n.bind(null, 0)),
r.push = n.bind(null, r.push.bind(r))
}();
var o = e.O(void 0, [3712], (function() {
return e(10134)
}
));
o = e.O(o)
}();