· 6 years ago · Mar 08, 2020, 07:38 AM
1! function(e) {
2 function t(r) {
3 if (n[r]) return n[r].exports;
4 var o = n[r] = {
5 i: r,
6 l: !1,
7 exports: {}
8 };
9 return e[r].call(o.exports, o, o.exports, t), o.l = !0, o.exports
10 }
11 var n = {};
12 t.m = e, t.c = n, t.d = function(e, n, r) {
13 t.o(e, n) || Object.defineProperty(e, n, {
14 configurable: !1,
15 enumerable: !0,
16 get: r
17 })
18 }, t.n = function(e) {
19 var n = e && e.__esModule ? function() {
20 return e.default
21 } : function() {
22 return e
23 };
24 return t.d(n, "a", n), n
25 }, t.o = function(e, t) {
26 return Object.prototype.hasOwnProperty.call(e, t)
27 }, t.p = "", t(t.s = 0)
28}([function(e, t, n) {
29 e.exports = n(1)
30}, function(e, t, n) {
31 "use strict";
32
33 function r(e, t) {
34 if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
35 }
36
37 function o(e, t) {
38 if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
39 return !t || "object" != typeof t && "function" != typeof t ? e : t
40 }
41
42 function a(e, t) {
43 if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
44 e.prototype = Object.create(t && t.prototype, {
45 constructor: {
46 value: e,
47 enumerable: !1,
48 writable: !0,
49 configurable: !0
50 }
51 }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
52 }
53
54 function i(e, t, n) {
55 return t in e ? Object.defineProperty(e, t, {
56 value: n,
57 enumerable: !0,
58 configurable: !0,
59 writable: !0
60 }) : e[t] = n, e
61 }
62
63 function c(e) {
64 if (Array.isArray(e)) {
65 for (var t = 0, n = Array(e.length); t < e.length; t++) n[t] = e[t];
66 return n
67 }
68 return Array.from(e)
69 }
70
71 function s(e) {
72 if (Array.isArray(e)) {
73 for (var t = 0, n = Array(e.length); t < e.length; t++) n[t] = e[t];
74 return n
75 }
76 return Array.from(e)
77 }
78
79 function u(e, t) {
80 if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
81 }
82
83 function l(e) {
84 if (Array.isArray(e)) {
85 for (var t = 0, n = Array(e.length); t < e.length; t++) n[t] = e[t];
86 return n
87 }
88 return Array.from(e)
89 }
90
91 function p(e, t) {
92 if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
93 }
94
95 function d(e, t) {
96 if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
97 return !t || "object" != typeof t && "function" != typeof t ? e : t
98 }
99
100 function f(e, t) {
101 if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
102 e.prototype = Object.create(t && t.prototype, {
103 constructor: {
104 value: e,
105 enumerable: !1,
106 writable: !0,
107 configurable: !0
108 }
109 }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
110 }
111
112 function h(e, t) {
113 if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
114 }
115
116 function _(e, t) {
117 if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
118 return !t || "object" != typeof t && "function" != typeof t ? e : t
119 }
120
121 function m(e, t) {
122 if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
123 e.prototype = Object.create(t && t.prototype, {
124 constructor: {
125 value: e,
126 enumerable: !1,
127 writable: !0,
128 configurable: !0
129 }
130 }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
131 }
132
133 function y(e, t) {
134 if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
135 }
136
137 function v(e, t) {
138 if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
139 return !t || "object" != typeof t && "function" != typeof t ? e : t
140 }
141
142 function b(e, t) {
143 if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
144 e.prototype = Object.create(t && t.prototype, {
145 constructor: {
146 value: e,
147 enumerable: !1,
148 writable: !0,
149 configurable: !0
150 }
151 }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
152 }
153
154 function g(e, t) {
155 if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
156 }
157
158 function E(e, t) {
159 if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
160 return !t || "object" != typeof t && "function" != typeof t ? e : t
161 }
162
163 function w(e, t) {
164 if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
165 e.prototype = Object.create(t && t.prototype, {
166 constructor: {
167 value: e,
168 enumerable: !1,
169 writable: !0,
170 configurable: !0
171 }
172 }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
173 }
174
175 function S(e, t) {
176 if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
177 }
178
179 function P(e, t) {
180 if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
181 }
182
183 function O(e, t) {
184 if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
185 return !t || "object" != typeof t && "function" != typeof t ? e : t
186 }
187
188 function k(e, t) {
189 if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
190 e.prototype = Object.create(t && t.prototype, {
191 constructor: {
192 value: e,
193 enumerable: !1,
194 writable: !0,
195 configurable: !0
196 }
197 }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
198 }
199
200 function A(e, t) {
201 if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
202 }
203
204 function T(e, t) {
205 if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
206 return !t || "object" != typeof t && "function" != typeof t ? e : t
207 }
208
209 function I(e, t) {
210 if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
211 e.prototype = Object.create(t && t.prototype, {
212 constructor: {
213 value: e,
214 enumerable: !1,
215 writable: !0,
216 configurable: !0
217 }
218 }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
219 }
220
221 function R(e, t, n) {
222 return t in e ? Object.defineProperty(e, t, {
223 value: n,
224 enumerable: !0,
225 configurable: !0,
226 writable: !0
227 }) : e[t] = n, e
228 }
229
230 function N(e, t, n) {
231 return t in e ? Object.defineProperty(e, t, {
232 value: n,
233 enumerable: !0,
234 configurable: !0,
235 writable: !0
236 }) : e[t] = n, e
237 }
238
239 function C(e, t, n) {
240 return t in e ? Object.defineProperty(e, t, {
241 value: n,
242 enumerable: !0,
243 configurable: !0,
244 writable: !0
245 }) : e[t] = n, e
246 }
247
248 function M(e, t) {
249 var n = {};
250 for (var r in e) t.indexOf(r) >= 0 || Object.prototype.hasOwnProperty.call(e, r) && (n[r] = e[r]);
251 return n
252 }
253
254 function j(e, t) {
255 if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
256 }
257
258 function L(e, t) {
259 if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
260 }
261
262 function x(e, t) {
263 if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
264 return !t || "object" != typeof t && "function" != typeof t ? e : t
265 }
266
267 function q(e, t) {
268 if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
269 e.prototype = Object.create(t && t.prototype, {
270 constructor: {
271 value: e,
272 enumerable: !1,
273 writable: !0,
274 configurable: !0
275 }
276 }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
277 }
278
279 function D(e, t, n) {
280 return t in e ? Object.defineProperty(e, t, {
281 value: n,
282 enumerable: !0,
283 configurable: !0,
284 writable: !0
285 }) : e[t] = n, e
286 }
287
288 function B(e) {
289 if (Array.isArray(e)) {
290 for (var t = 0, n = Array(e.length); t < e.length; t++) n[t] = e[t];
291 return n
292 }
293 return Array.from(e)
294 }
295
296 function F(e) {
297 if (Array.isArray(e)) {
298 for (var t = 0, n = Array(e.length); t < e.length; t++) n[t] = e[t];
299 return n
300 }
301 return Array.from(e)
302 }
303
304 function U(e, t, n) {
305 return t in e ? Object.defineProperty(e, t, {
306 value: n,
307 enumerable: !0,
308 configurable: !0,
309 writable: !0
310 }) : e[t] = n, e
311 }
312
313 function H(e) {
314 if (Array.isArray(e)) {
315 for (var t = 0, n = Array(e.length); t < e.length; t++) n[t] = e[t];
316 return n
317 }
318 return Array.from(e)
319 }
320
321 function z(e, t) {
322 if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
323 }
324
325 function G(e, t) {
326 if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
327 }
328
329 function Y(e, t) {
330 if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
331 }
332
333 function W(e, t, n) {
334 return t in e ? Object.defineProperty(e, t, {
335 value: n,
336 enumerable: !0,
337 configurable: !0,
338 writable: !0
339 }) : e[t] = n, e
340 }
341
342 function K(e, t) {
343 var n = {};
344 for (var r in e) t.indexOf(r) >= 0 || Object.prototype.hasOwnProperty.call(e, r) && (n[r] = e[r]);
345 return n
346 }
347
348 function V(e, t) {
349 if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
350 }
351
352 function J(e, t) {
353 if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
354 return !t || "object" != typeof t && "function" != typeof t ? e : t
355 }
356
357 function Q(e, t) {
358 if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
359 e.prototype = Object.create(t && t.prototype, {
360 constructor: {
361 value: e,
362 enumerable: !1,
363 writable: !0,
364 configurable: !0
365 }
366 }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
367 }
368
369 function X(e, t) {
370 var n = {};
371 for (var r in e) t.indexOf(r) >= 0 || Object.prototype.hasOwnProperty.call(e, r) && (n[r] = e[r]);
372 return n
373 }
374
375 function $(e) {
376 if (Array.isArray(e)) {
377 for (var t = 0, n = Array(e.length); t < e.length; t++) n[t] = e[t];
378 return n
379 }
380 return Array.from(e)
381 }
382
383 function Z(e, t) {
384 if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
385 }
386
387 function ee(e, t) {
388 if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
389 return !t || "object" != typeof t && "function" != typeof t ? e : t
390 }
391
392 function te(e, t) {
393 if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
394 e.prototype = Object.create(t && t.prototype, {
395 constructor: {
396 value: e,
397 enumerable: !1,
398 writable: !0,
399 configurable: !0
400 }
401 }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
402 }
403
404 function ne(e, t) {
405 var n = {};
406 for (var r in e) t.indexOf(r) >= 0 || Object.prototype.hasOwnProperty.call(e, r) && (n[r] = e[r]);
407 return n
408 }
409
410 function re(e, t) {
411 if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
412 }
413
414 function oe(e) {
415 if (Array.isArray(e)) {
416 for (var t = 0, n = Array(e.length); t < e.length; t++) n[t] = e[t];
417 return n
418 }
419 return Array.from(e)
420 }
421
422 function ae(e, t, n) {
423 return t in e ? Object.defineProperty(e, t, {
424 value: n,
425 enumerable: !0,
426 configurable: !0,
427 writable: !0
428 }) : e[t] = n, e
429 }
430
431 function ie(e) {
432 if (Array.isArray(e)) {
433 for (var t = 0, n = Array(e.length); t < e.length; t++) n[t] = e[t];
434 return n
435 }
436 return Array.from(e)
437 }
438
439 function ce(e, t) {
440 var n = {};
441 for (var r in e) t.indexOf(r) >= 0 || Object.prototype.hasOwnProperty.call(e, r) && (n[r] = e[r]);
442 return n
443 }
444
445 function se(e, t) {
446 if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
447 }
448
449 function ue(e, t) {
450 var n = {};
451 for (var r in e) t.indexOf(r) >= 0 || Object.prototype.hasOwnProperty.call(e, r) && (n[r] = e[r]);
452 return n
453 }
454
455 function le(e, t) {
456 var n = {};
457 for (var r in e) t.indexOf(r) >= 0 || Object.prototype.hasOwnProperty.call(e, r) && (n[r] = e[r]);
458 return n
459 }
460
461 function pe(e, t) {
462 var n = {};
463 for (var r in e) t.indexOf(r) >= 0 || Object.prototype.hasOwnProperty.call(e, r) && (n[r] = e[r]);
464 return n
465 }
466
467 function de(e, t) {
468 var n = {};
469 for (var r in e) t.indexOf(r) >= 0 || Object.prototype.hasOwnProperty.call(e, r) && (n[r] = e[r]);
470 return n
471 }
472
473 function fe(e) {
474 if (Array.isArray(e)) {
475 for (var t = 0, n = Array(e.length); t < e.length; t++) n[t] = e[t];
476 return n
477 }
478 return Array.from(e)
479 }
480
481 function he(e, t) {
482 var n = {};
483 for (var r in e) t.indexOf(r) >= 0 || Object.prototype.hasOwnProperty.call(e, r) && (n[r] = e[r]);
484 return n
485 }
486
487 function _e(e, t) {
488 if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
489 }
490
491 function me(e) {
492 if (Array.isArray(e)) {
493 for (var t = 0, n = Array(e.length); t < e.length; t++) n[t] = e[t];
494 return n
495 }
496 return Array.from(e)
497 }
498 Object.defineProperty(t, "__esModule", {
499 value: !0
500 });
501 var ye, ve, be, ge, Ee, we, Se, Pe, Oe = function(e) {
502 function t(e) {
503 r(this, t);
504 var n = o(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e));
505 return window.__stripeElementsController && window.__stripeElementsController.reportIntegrationError(e), n.name = "IntegrationError", Object.defineProperty(n, "message", {
506 value: n.message,
507 enumerable: !0
508 }), n
509 }
510 return a(t, e), t
511 }(Error),
512 ke = Oe,
513 Ae = function(e) {
514 var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "absurd";
515 throw new Error(t)
516 },
517 Te = n(2),
518 Ie = n.n(Te),
519 Re = window.Promise ? Promise : Ie.a,
520 Ne = Re,
521 Ce = ("function" == typeof Symbol && Symbol.iterator, function(e, t) {
522 for (var n = 0; n < e.length; n++)
523 if (t(e[n])) return e[n]
524 }),
525 Me = function(e, t) {
526 for (var n = 0; n < e.length; n++)
527 if (t(e[n])) return n;
528 return -1
529 },
530 je = function(e, t) {
531 for (var n = {}, r = 0; r < t.length; r++) n[t[r]] = !0;
532 for (var o = [], a = 0; a < e.length; a++) n[e[a]] && o.push(e[a]);
533 return o
534 },
535 Le = function(e, t) {
536 var n = 0,
537 r = function r(o) {
538 for (var a = Date.now() + 50; n < e.length && Date.now() < a;) t(e[n]), n++;
539 n === e.length ? o() : setTimeout(function() {
540 return r(o)
541 })
542 };
543 return new Ne(function(e) {
544 return r(e)
545 })
546 },
547 xe = ["aed", "afn", "all", "amd", "ang", "aoa", "ars", "aud", "awg", "azn", "bam", "bbd", "bdt", "bgn", "bhd", "bif", "bmd", "bnd", "bob", "brl", "bsd", "btn", "bwp", "byr", "bzd", "cad", "cdf", "chf", "clf", "clp", "cny", "cop", "crc", "cuc", "cup", "cve", "czk", "djf", "dkk", "dop", "dzd", "egp", "ern", "etb", "eur", "fjd", "fkp", "gbp", "gel", "ghs", "gip", "gmd", "gnf", "gtq", "gyd", "hkd", "hnl", "hrk", "htg", "huf", "idr", "ils", "inr", "iqd", "irr", "isk", "jmd", "jod", "jpy", "kes", "kgs", "khr", "kmf", "kpw", "krw", "kwd", "kyd", "kzt", "lak", "lbp", "lkr", "lrd", "lsl", "ltl", "lvl", "lyd", "mad", "mdl", "mga", "mkd", "mmk", "mnt", "mop", "mro", "mur", "mvr", "mwk", "mxn", "myr", "mzn", "nad", "ngn", "nio", "nok", "npr", "nzd", "omr", "pab", "pen", "pgk", "php", "pkr", "pln", "pyg", "qar", "ron", "rsd", "rub", "rwf", "sar", "sbd", "scr", "sdg", "sek", "sgd", "shp", "skk", "sll", "sos", "srd", "ssp", "std", "svc", "syp", "szl", "thb", "tjs", "tmt", "tnd", "top", "try", "ttd", "twd", "tzs", "uah", "ugx", "usd", "uyu", "uzs", "vef", "vnd", "vuv", "wst", "xaf", "xag", "xau", "xcd", "xdr", "xof", "xpf", "yer", "zar", "zmk", "zmw", "btc", "jep", "eek", "ghc", "mtl", "tmm", "yen", "zwd", "zwl", "zwn", "zwr"],
548 qe = xe,
549 De = {
550 AE: "AE",
551 AT: "AT",
552 AU: "AU",
553 BE: "BE",
554 BR: "BR",
555 CA: "CA",
556 CH: "CH",
557 CZ: "CZ",
558 DE: "DE",
559 DK: "DK",
560 EE: "EE",
561 ES: "ES",
562 FI: "FI",
563 FR: "FR",
564 GB: "GB",
565 GR: "GR",
566 HK: "HK",
567 IE: "IE",
568 IN: "IN",
569 IT: "IT",
570 JP: "JP",
571 LT: "LT",
572 LU: "LU",
573 LV: "LV",
574 MX: "MX",
575 MY: "MY",
576 NL: "NL",
577 NO: "NO",
578 NZ: "NZ",
579 PH: "PH",
580 PL: "PL",
581 PT: "PT",
582 RO: "RO",
583 SE: "SE",
584 SG: "SG",
585 SI: "SI",
586 SK: "SK",
587 US: "US"
588 },
589 Be = Object.keys(De),
590 Fe = {
591 live: "live",
592 test: "test",
593 unknown: "unknown"
594 },
595 Ue = function(e) {
596 return /^pk_test_/.test(e) ? Fe.test : /^pk_live_/.test(e) ? Fe.live : Fe.unknown
597 },
598 He = function(e) {
599 if (e === Fe.unknown) throw new ke("It looks like you're using an older Stripe key. In order to use this API, you'll need to use a modern API key, which is prefixed with 'pk_live_' or 'pk_test_'.\n You can roll your publishable key here: https://dashboard.stripe.com/account/apikeys")
600 },
601 ze = Object.assign || function(e) {
602 for (var t = 1; t < arguments.length; t++) {
603 var n = arguments[t];
604 for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r])
605 }
606 return e
607 },
608 Ge = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
609 return typeof e
610 } : function(e) {
611 return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
612 },
613 Ye = function(e, t, n) {
614 return "Invalid value for " + n.label + ": " + (n.path.join(".") || "value") + " should be " + e + ". You specified: " + t + "."
615 },
616 We = function(e) {
617 return {
618 type: "valid",
619 value: e,
620 warnings: arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : []
621 }
622 },
623 Ke = function(e) {
624 return {
625 error: e,
626 errorType: "full",
627 type: "error"
628 }
629 },
630 Ve = function(e, t, n) {
631 var r = new ke(Ye(e, t, n));
632 return Ke(r)
633 },
634 Je = function(e, t, n) {
635 return {
636 expected: e,
637 actual: String(t),
638 options: n,
639 errorType: "mismatch",
640 type: "error"
641 }
642 },
643 Qe = function(e) {
644 return function(t, n) {
645 return void 0 === t ? We(t) : e(t, n)
646 }
647 },
648 Xe = function(e, t) {
649 return function(n, r) {
650 var o = function(e) {
651 var t = e.options.path.join(".") || "value";
652 return {
653 error: t + " should be " + e.expected,
654 actual: t + " as " + e.actual
655 }
656 },
657 a = function(e, t, n) {
658 return Ke(new ke("Invalid value for " + e + ": " + t + ". You specified " + n + "."))
659 },
660 i = e(n, r),
661 c = t(n, r);
662 if ("error" === i.type && "error" === c.type) {
663 if ("mismatch" === i.errorType && "mismatch" === c.errorType) {
664 var s = o(i),
665 u = s.error,
666 l = s.actual,
667 p = o(c),
668 d = p.error,
669 f = p.actual;
670 return a(r.label, u === d ? u : u + " or " + d, l === f ? l : l + " and " + f)
671 }
672 if ("mismatch" === i.errorType) {
673 var h = o(i),
674 _ = h.error,
675 m = h.actual;
676 return a(r.label, _, m)
677 }
678 if ("mismatch" === c.errorType) {
679 var y = o(c),
680 v = y.error,
681 b = y.actual;
682 return a(r.label, v, b)
683 }
684 return Ke(i.error)
685 }
686 return "valid" === i.type ? i : c
687 }
688 },
689 $e = function(e, t) {
690 return function(n, r) {
691 var o = Ce(e, function(e) {
692 return e === n
693 });
694 if (void 0 === o) {
695 var a = t ? "a recognized string." : "one of the following strings: " + e.join(", ");
696 return Je(a, n, r)
697 }
698 return We(o)
699 }
700 },
701 Ze = function(e) {
702 return function(t, n) {
703 return "string" == typeof t && 0 === t.indexOf(e) ? We(t) : Je("a string starting with " + e, t, n)
704 }
705 },
706 et = function() {
707 for (var e = arguments.length, t = Array(e), n = 0; n < e; n++) t[n] = arguments[n];
708 return $e(t, !1)
709 },
710 tt = function() {
711 for (var e = arguments.length, t = Array(e), n = 0; n < e; n++) t[n] = arguments[n];
712 return $e(t, !0)
713 },
714 nt = et.apply(void 0, c(Be)),
715 rt = et.apply(void 0, c(qe)),
716 ot = (et.apply(void 0, c(Object.keys(Fe))), function(e, t) {
717 return "string" == typeof e ? We(e) : Je("a string", e, t)
718 }),
719 at = function(e, t) {
720 return function(n, r) {
721 return void 0 === n ? We(t()) : e(n, r)
722 }
723 },
724 it = function(e, t) {
725 return "boolean" == typeof e ? We(e) : Je("a boolean", e, t)
726 },
727 ct = function(e, t) {
728 return "number" == typeof e ? We(e) : Je("a number", e, t)
729 },
730 st = function(e) {
731 return function(t, n) {
732 return "number" == typeof t && t > e ? We(t) : Je("a number greater than " + e, t, n)
733 }
734 },
735 ut = function(e) {
736 return function(t, n) {
737 return "number" == typeof t && t === parseInt(t, 10) && (!e || t >= 0) ? We(t) : Je(e ? "a positive amount in the currency's subunit" : "an amount in the currency's subunit", t, n)
738 }
739 },
740 lt = function(e, t) {
741 return ut(!1)(e, t)
742 },
743 pt = function(e, t) {
744 return ut(!0)(e, t)
745 },
746 dt = function(e, t) {
747 return e && "object" === (void 0 === e ? "undefined" : Ge(e)) ? We(e) : Je("an object", e, t)
748 },
749 ft = function(e) {
750 return function(t, n) {
751 if (Array.isArray(t)) {
752 return t.map(function(t, r) {
753 return e(t, ze({}, n, {
754 path: [].concat(c(n.path), [String(r)])
755 }))
756 }).reduce(function(e, t) {
757 return "error" === e.type ? e : "error" === t.type ? t : We([].concat(c(e.value), [t.value]), [].concat(c(e.warnings), c(t.warnings)))
758 }, We([]))
759 }
760 return Je("array", t, n)
761 }
762 },
763 ht = function(e) {
764 return function(t) {
765 return function(n, r) {
766 if (Array.isArray(n)) {
767 var o = t(n, r);
768 if ("valid" === o.type)
769 for (var a = {}, i = 0; i < o.value.length; i += 1) {
770 var c = o.value[i];
771 if ("object" === (void 0 === c ? "undefined" : Ge(c)) && c && "string" == typeof c[e]) {
772 var s = c[e];
773 if (a[s]) return Ke(new ke("Duplicate value for " + e + ": " + s + ". The property '" + e + "' of '" + r.path.join(".") + "' has to be unique."));
774 a[s] = !0
775 }
776 }
777 return o
778 }
779 return Je("array", n, r)
780 }
781 }
782 },
783 _t = function(e) {
784 return function(t, n) {
785 return void 0 === t ? We(void 0) : Je("used in " + e + " instead", t, n)
786 }
787 },
788 mt = function(e) {
789 return function(t) {
790 return function(n, r) {
791 if (n && "object" === (void 0 === n ? "undefined" : Ge(n)) && !Array.isArray(n)) {
792 var o = n,
793 a = Ce(Object.keys(o), function(e) {
794 return !t[e]
795 });
796 if (a && e) return Ke(new ke("Invalid " + r.label + " parameter: " + [].concat(c(r.path), [a]).join(".") + " is not an accepted parameter."));
797 var s = Object.keys(o),
798 u = We({});
799 return a && (u = s.reduce(function(e, n) {
800 return t[n] ? e : We(e.value, [].concat(c(e.warnings), ["Unrecognized " + r.label + " parameter: " + [].concat(c(r.path), [n]).join(".") + " is not a recognized parameter. This may cause issues with your integration in the future."]))
801 }, u)), Object.keys(t).reduce(function(e, n) {
802 if ("error" === e.type) return e;
803 var a = t[n],
804 s = a(o[n], ze({}, r, {
805 path: [].concat(c(r.path), [n])
806 }));
807 return "valid" === s.type && void 0 !== s.value ? We(ze({}, e.value, i({}, n, s.value)), [].concat(c(e.warnings), c(s.warnings))) : "valid" === s.type ? We(e.value, [].concat(c(e.warnings), c(s.warnings))) : s
808 }, u)
809 }
810 return Je("an object", n, r)
811 }
812 }
813 },
814 yt = mt(!0),
815 vt = mt(!1),
816 bt = function(e, t) {
817 return ze({}, e, {
818 path: [].concat(c(e.path), [t])
819 })
820 },
821 gt = function(e, t, n, r) {
822 var o = r || {},
823 a = e(t, {
824 origin: o.origin || "",
825 element: o.element || "",
826 label: n,
827 path: o.path || []
828 });
829 return "valid" === a.type ? a : "full" === a.errorType ? a : {
830 type: "error",
831 errorType: "full",
832 error: new ke(Ye(a.expected, a.actual, a.options))
833 }
834 },
835 Et = function(e, t, n, r) {
836 var o = gt(e, t, n, r);
837 switch (o.type) {
838 case "valid":
839 return {
840 value: o.value, warnings: o.warnings
841 };
842 case "error":
843 throw o.error;
844 default:
845 return Ae(o)
846 }
847 },
848 wt = /^(http(s)?):\/\//,
849 St = function(e) {
850 return wt.test(e)
851 },
852 Pt = function(e) {
853 if (!St(e)) return null;
854 var t = document.createElement("a");
855 t.href = e;
856 var n = t.protocol,
857 r = t.host,
858 o = /:80$/,
859 a = /:443$/;
860 return "http:" === n && o.test(r) ? r = r.replace(o, "") : "https:" === n && a.test(r) && (r = r.replace(a, "")), {
861 host: r,
862 protocol: n,
863 origin: n + "//" + r
864 }
865 },
866 Ot = function(e, t) {
867 if ("/" === t[0]) {
868 var n = Pt(e);
869 return n ? "" + n.origin + t : t
870 }
871 return "" + e.replace(/\/[^\/]*$/, "/") + t
872 },
873 kt = {
874 CARD_ELEMENT: "CARD_ELEMENT",
875 CONTROLLER: "CONTROLLER",
876 METRICS_CONTROLLER: "METRICS_CONTROLLER",
877 PAYMENT_REQUEST_ELEMENT: "PAYMENT_REQUEST_ELEMENT",
878 PAYMENT_REQUEST_BROWSER: "PAYMENT_REQUEST_BROWSER",
879 PAYMENT_REQUEST_GOOGLE_PAY: "PAYMENT_REQUEST_GOOGLE_PAY",
880 IBAN_ELEMENT: "IBAN_ELEMENT",
881 IDEAL_BANK_ELEMENT: "IDEAL_BANK_ELEMENT",
882 AUTHORIZE_WITH_URL: "AUTHORIZE_WITH_URL",
883 STRIPE_3DS2_CHALLENGE: "STRIPE_3DS2_CHALLENGE",
884 STRIPE_3DS2_FINGERPRINT: "STRIPE_3DS2_FINGERPRINT",
885 AU_BANK_ACCOUNT_ELEMENT: "AU_BANK_ACCOUNT_ELEMENT",
886 FPX_BANK_ELEMENT: "FPX_BANK_ELEMENT"
887 },
888 At = kt,
889 Tt = Object({
890 NODE_ENV: "production",
891 TEST_ENV: !1,
892 SELENIUM_TEST_ENV: !1,
893 PUBLIC_URL: "",
894 RELEASE_VERSION: "942d75ed",
895 STRIPE_JS_API_URL: "https://api.stripe.com/v1/",
896 STRIPE_JS_HOOKS_URL: "https://hooks.stripe.com/",
897 STRIPE_JS_ALLOW_MUTABLE_API_URL: !1,
898 STRIPE_JS_Q_URL: "https://q.stripe.com",
899 //STRIPE_JS_M_NETWORK_URL: "https://m.stripe.network",
900 STRIPE_JS_M_NETWORK_URL: "/wp-content/plugins/woocommerce-gateway-stripe/assets/js/",
901 //STRIPE_JS_ROOT_URL: "https://js.stripe.com/v3/",
902 STRIPE_JS_ROOT_URL: "/wp-content/plugins/woocommerce-gateway-stripe/assets/js/",
903 STRIPE_CHECKOUT_URL: "https://checkout.stripe.com/",
904 STRIPE_JS_SOURCEMAPS: !1,
905 STRIPE_JS_DEBUG_POSTMESSAGE: !1,
906 STRIPE_JS_DEBUG_LOGGER: !0,
907 ELEMENTS_INNER_CARD_HTML_NAME: "elements-inner-card-95ff80dcb9b0b180bdada71ad8c849b3.html",
908 ELEMENTS_INNER_IBAN_HTML_NAME: "elements-inner-iban-bf4eabede1098950ecebc4704a1d0a0a.html",
909 ELEMENTS_INNER_IDEAL_BANK_HTML_NAME: "elements-inner-ideal-bank-030bfa35f364eefe15879ba1ae8ebcbc.html",
910 ELEMENTS_INNER_PAYMENT_REQUEST_HTML_NAME: "elements-inner-payment-request-0d61a46ad3a0b5ee96efd66bdc81fbf8.html",
911 ELEMENTS_INNER_AU_BANK_ACCOUNT_HTML_NAME: "elements-inner-au-bank-account-c9d8f6ad8fcc6147ba8942aeb3f5b5ab.html",
912 ELEMENTS_INNER_FPX_BANK_HTML_NAME: "elements-inner-fpx-bank-7f73addb32b406a3fcd49d8b90e29c1b.html",
913 RECAPTCHA_HTML_NAME: "recaptcha.html",
914 CONTROLLER_HTML_NAME: "controller-a3739bef1f7e07ab1d399458aac9e1df.html",
915 PAYMENT_REQUEST_INNER_BROWSER_HTML_NAME: "payment-request-inner-browser-12c02a75e1c52c9cd5e1c85004d61a65.html",
916 PAYMENT_REQUEST_INNER_GOOGLE_PAY_HTML_NAME: "payment-request-inner-google-pay-66c8275d32d4ed16ce19181754fd22d9.html",
917 AUTHORIZE_WITH_URL_INNER_HTML_NAME: "authorize-with-url-inner-e62ee79c7dfae3421c8be5692adca132.html",
918 THREE_DS_2_CHALLENGE_HTML_NAME: "three-ds-2-challenge-b0a3ae218256bf335cc7ba2edfbf5a89.html",
919 THREE_DS_2_FINGERPRINT_HTML_NAME: "three-ds-2-fingerprint-0cd0bd50937f976a821eb55ca19cbcda.html",
920 M_OUTER_HTML_NAME: "m-outer-a0f6c1465b8d9aab778cf2913d1d3c86.html",
921 STRIPE_JS_NO_DEMOS: "1",
922 STRIPE_JS_NO_REPORTS: "1"
923 }),
924 It = function(e) {
925 return "" + (Tt.STRIPE_JS_ROOT_URL || "") + (e || "")
926 },
927 Rt = function(e) {
928 switch (e) {
929
930 case "CARD_ELEMENT":
931 return It(Tt.ELEMENTS_INNER_CARD_HTML_NAME);
932 case "CONTROLLER":
933 return It(Tt.CONTROLLER_HTML_NAME);
934 case "METRICS_CONTROLLER":
935 return It(Tt.M_OUTER_HTML_NAME);
936 case "PAYMENT_REQUEST_ELEMENT":
937 return It(Tt.ELEMENTS_INNER_PAYMENT_REQUEST_HTML_NAME);
938 case "PAYMENT_REQUEST_BROWSER":
939 return It(Tt.PAYMENT_REQUEST_INNER_BROWSER_HTML_NAME);
940 case "PAYMENT_REQUEST_GOOGLE_PAY":
941 return It(Tt.PAYMENT_REQUEST_INNER_GOOGLE_PAY_HTML_NAME);
942 case "IBAN_ELEMENT":
943 return It(Tt.ELEMENTS_INNER_IBAN_HTML_NAME);
944 case "IDEAL_BANK_ELEMENT":
945 return It(Tt.ELEMENTS_INNER_IDEAL_BANK_HTML_NAME);
946 case "AUTHORIZE_WITH_URL":
947 return It(Tt.AUTHORIZE_WITH_URL_INNER_HTML_NAME);
948 case "STRIPE_3DS2_CHALLENGE":
949 return It(Tt.THREE_DS_2_CHALLENGE_HTML_NAME);
950 case "STRIPE_3DS2_FINGERPRINT":
951 return It(Tt.THREE_DS_2_FINGERPRINT_HTML_NAME);
952 case "AU_BANK_ACCOUNT_ELEMENT":
953 return It(Tt.ELEMENTS_INNER_AU_BANK_ACCOUNT_HTML_NAME);
954 case "FPX_BANK_ELEMENT":
955 return It(Tt.ELEMENTS_INNER_FPX_BANK_HTML_NAME);
956 default:
957 return Ae(e)
958 }
959 },
960 Nt = Rt,
961 Ct = {
962 card: "card",
963 cardNumber: "cardNumber",
964 cardExpiry: "cardExpiry",
965 cardCvc: "cardCvc",
966 postalCode: "postalCode",
967 iban: "iban",
968 idealBank: "idealBank",
969 paymentRequestButton: "paymentRequestButton",
970 auBankAccount: "auBankAccount",
971 fpxBank: "fpxBank",
972 idealBankSecondary: "idealBankSecondary",
973 auBankAccountNumber: "auBankAccountNumber",
974 auBsb: "auBsb",
975 fpxBankSecondary: "fpxBankSecondary"
976 },
977 Mt = Ct,
978 jt = {
979 PAYMENT_INTENT: "PAYMENT_INTENT",
980 SETUP_INTENT: "SETUP_INTENT"
981 },
982 Lt = jt,
983 xt = [Mt.card, Mt.cardNumber, Mt.cardExpiry, Mt.cardCvc, Mt.postalCode],
984 qt = xt,
985 Dt = window.location.origin,
986 Bt = Dt ? window.location.origin : "",
987 Ft = {
988 family: "font-family",
989 src: "src",
990 unicodeRange: "unicode-range",
991 style: "font-style",
992 variant: "font-variant",
993 stretch: "font-stretch",
994 weight: "font-weight",
995 display: "font-display"
996 },
997 Ut = Object.keys(Ft).reduce(function(e, t) {
998 return e[Ft[t]] = t, e
999 }, {}),
1000 Ht = [Mt.idealBank, Mt.idealBankSecondary, Mt.fpxBank, Mt.fpxBankSecondary],
1001 zt = 0,
1002 Gt = function(e) {
1003 return "" + e + zt++
1004 },
1005 Yt = function e() {
1006 var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "";
1007 return t ? (parseInt(t, 10) ^ 16 * Math.random() >> parseInt(t, 10) / 4).toString(16) : "00000000-0000-4000-8000-000000000000".replace(/[08]/g, e)
1008 },
1009 Wt = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
1010 return typeof e
1011 } : function(e) {
1012 return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
1013 },
1014 Kt = function e(t, n) {
1015 var r = [];
1016 return Object.keys(t).forEach(function(o) {
1017 var a = t[o],
1018 i = n ? n + "[" + o + "]" : o;
1019 if (a && "object" === (void 0 === a ? "undefined" : Wt(a))) {
1020 var c = e(a, i);
1021 "" !== c && (r = [].concat(s(r), [c]))
1022 } else void 0 !== a && null !== a && (r = [].concat(s(r), [i + "=" + encodeURIComponent(String(a))]))
1023 }), r.join("&").replace(/%20/g, "+")
1024 },
1025 Vt = Kt,
1026 Jt = n(6),
1027 Qt = n.n(Jt),
1028 Xt = function() {
1029 function e(e, t) {
1030 var n = [],
1031 r = !0,
1032 o = !1,
1033 a = void 0;
1034 try {
1035 for (var i, c = e[Symbol.iterator](); !(r = (i = c.next()).done) && (n.push(i.value), !t || n.length !== t); r = !0);
1036 } catch (e) {
1037 o = !0, a = e
1038 } finally {
1039 try {
1040 !r && c.return && c.return()
1041 } finally {
1042 if (o) throw a
1043 }
1044 }
1045 return n
1046 }
1047 return function(t, n) {
1048 if (Array.isArray(t)) return t;
1049 if (Symbol.iterator in Object(t)) return e(t, n);
1050 throw new TypeError("Invalid attempt to destructure non-iterable instance")
1051 }
1052 }(),
1053 $t = function(e, t) {
1054 var n = {};
1055 t.forEach(function(e) {
1056 var t = Xt(e, 2),
1057 r = t[0],
1058 o = t[1];
1059 r.split(/\s+/).forEach(function(e) {
1060 e && (n[e] = n[e] || o)
1061 })
1062 }), e.className = Qt()(e.className, n)
1063 },
1064 Zt = function(e, t) {
1065 e.style.cssText = Object.keys(t).map(function(e) {
1066 return e + ": " + t[e] + " !important;"
1067 }).join(" ")
1068 },
1069 en = function(e) {
1070 try {
1071 return window.parent.frames[e]
1072 } catch (e) {
1073 return null
1074 }
1075 },
1076 tn = function(e) {
1077 if (!document.body) throw new ke("Stripe.js requires that your page has a <body> element.");
1078 return e(document.body)
1079 },
1080 nn = Object.assign || function(e) {
1081 for (var t = 1; t < arguments.length; t++) {
1082 var n = arguments[t];
1083 for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r])
1084 }
1085 return e
1086 },
1087 rn = function(e) {
1088 var t = e.frameId,
1089 n = e.controllerId,
1090 r = e.type,
1091 o = Bt,
1092 a = void 0;
1093 "controller" === r ? a = en(t) : "group" === r ? a = en(n) : "outer" === r ? a = window.frames[t] : "inner" === r && (o = "*", a = window.parent), a && a.postMessage(JSON.stringify(nn({}, e, {
1094 __stripeJsV3: !0
1095 })), o)
1096 },
1097 on = function(e) {
1098 try {
1099 var t = "string" == typeof e ? JSON.parse(e) : e;
1100 return t.__stripeJsV3 ? t : null
1101 } catch (e) {
1102 return null
1103 }
1104 },
1105 an = (n(7), function(e, t) {
1106 var n = e._isUserError || "IntegrationError" === e.name;
1107 throw t && !n && t.report("fatal.uncaught_error", {
1108 iframe: !1,
1109 name: e.name,
1110 element: "outer",
1111 message: e.message || e.description,
1112 fileName: e.fileName,
1113 lineNumber: e.lineNumber,
1114 columnNumber: e.columnNumber,
1115 stack: e.stack && e.stack.substring(0, 1e3)
1116 }), e
1117 }),
1118 cn = function(e, t) {
1119 return function() {
1120 try {
1121 return e.call(this)
1122 } catch (e) {
1123 return an(e, t || this && this._controller)
1124 }
1125 }
1126 },
1127 sn = function(e, t) {
1128 return function(n) {
1129 try {
1130 return e.call(this, n)
1131 } catch (e) {
1132 return an(e, t || this && this._controller)
1133 }
1134 }
1135 },
1136 un = function(e, t) {
1137 return function(n, r) {
1138 try {
1139 return e.call(this, n, r)
1140 } catch (e) {
1141 return an(e, t || this && this._controller)
1142 }
1143 }
1144 },
1145 ln = function(e, t) {
1146 return function(n, r, o) {
1147 try {
1148 return e.call(this, n, r, o)
1149 } catch (e) {
1150 return an(e, t || this && this._controller)
1151 }
1152 }
1153 },
1154 pn = function(e, t) {
1155 return function() {
1156 try {
1157 for (var n = arguments.length, r = Array(n), o = 0; o < n; o++) r[o] = arguments[o];
1158 return e.call.apply(e, [this].concat(r))
1159 } catch (e) {
1160 return an(e, t || this && this._controller)
1161 }
1162 }
1163 },
1164 dn = function e() {
1165 var t = this;
1166 u(this, e), this._emit = function(e) {
1167 for (var n = arguments.length, r = Array(n > 1 ? n - 1 : 0), o = 1; o < n; o++) r[o - 1] = arguments[o];
1168 return (t._callbacks[e] || []).forEach(function(e) {
1169 var t = e.fn;
1170 if (t._isUserCallback) try {
1171 t.apply(void 0, r)
1172 } catch (e) {
1173 throw e._isUserError = !0, e
1174 } else t.apply(void 0, r)
1175 }), t
1176 }, this._once = function(e, n) {
1177 var r = function r() {
1178 t._off(e, r), n.apply(void 0, arguments)
1179 };
1180 return t._on(e, r, n)
1181 }, this._removeAllListeners = function() {
1182 return t._callbacks = {}, t
1183 }, this._on = function(e, n, r) {
1184 return t._callbacks[e] = t._callbacks[e] || [], t._callbacks[e].push({
1185 original: r,
1186 fn: n
1187 }), t
1188 }, this._validateUserOn = function(e, t) {}, this._userOn = function(e, n) {
1189 if ("string" != typeof e) throw new ke("When adding an event listener, the first argument should be a string event name.");
1190 if ("function" != typeof n) throw new ke("When adding an event listener, the second argument should be a function callback.");
1191 return t._validateUserOn(e, n), n._isUserCallback = !0, t._on(e, n)
1192 }, this._hasRegisteredListener = function(e) {
1193 return t._callbacks[e] && t._callbacks[e].length > 0
1194 }, this._off = function(e, n) {
1195 if (n) {
1196 for (var r = t._callbacks[e], o = void 0, a = 0; a < r.length; a++)
1197 if (o = r[a], o.fn === n || o.original === n) {
1198 r.splice(a, 1);
1199 break
1200 }
1201 } else delete t._callbacks[e];
1202 return t
1203 }, this._callbacks = {};
1204 var n = un(this._userOn),
1205 r = un(this._off),
1206 o = un(this._once),
1207 a = sn(this._hasRegisteredListener),
1208 i = sn(this._removeAllListeners),
1209 c = pn(this._emit);
1210 this.on = this.addListener = this.addEventListener = n, this.off = this.removeListener = this.removeEventListener = r, this.once = o, this.hasRegisteredListener = a, this.removeAllListeners = i, this.emit = c
1211 },
1212 fn = dn,
1213 hn = Object.assign || function(e) {
1214 for (var t = 1; t < arguments.length; t++) {
1215 var n = arguments[t];
1216 for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r])
1217 }
1218 return e
1219 },
1220 _n = function() {
1221 function e(e, t) {
1222 for (var n = 0; n < t.length; n++) {
1223 var r = t[n];
1224 r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
1225 }
1226 }
1227 return function(t, n, r) {
1228 return n && e(t.prototype, n), r && e(t, r), t
1229 }
1230 }(),
1231 mn = function(e) {
1232 function t(e, n, r) {
1233 p(this, t);
1234 var o = d(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this));
1235 return o._sendFAReq = function(e) {
1236 var t = Gt(e.tag);
1237 return new Ne(function(n, r) {
1238 o._requests[t] = {
1239 resolve: n,
1240 reject: r
1241 }, o._send({
1242 message: {
1243 action: "stripe-frame-action",
1244 payload: {
1245 nonce: t,
1246 faReq: e
1247 }
1248 },
1249 type: "outer",
1250 frameId: o.id,
1251 controllerId: o._controllerId
1252 })
1253 })
1254 }, o.action = {
1255 perform3DS2Challenge: function(e) {
1256 return o._sendFAReq({
1257 tag: "PERFORM_3DS2_CHALLENGE",
1258 value: e
1259 })
1260 },
1261 perform3DS2Fingerprint: function(e) {
1262 return o._sendFAReq({
1263 tag: "PERFORM_3DS2_FINGERPRINT",
1264 value: e
1265 })
1266 },
1267 show3DS2Spinner: function(e) {
1268 return o._sendFAReq({
1269 tag: "SHOW_3DS2_SPINNER",
1270 value: e
1271 })
1272 },
1273 checkCanMakePayment: function(e) {
1274 return o._sendFAReq({
1275 tag: "CHECK_CAN_MAKE_PAYMENT",
1276 value: e
1277 })
1278 }
1279 }, o.type = e, o.loaded = !1, o._controllerId = n, o._persistentMessages = [], o._queuedMessages = [], o._requests = {}, o.id = o._generateId(), o._iframe = o._createIFrame(r), o._on("load", function() {
1280 o.loaded = !0, o._ensureMounted(), o.loaded && (o._persistentMessages.forEach(function(e) {
1281 return o._send(e)
1282 }), o._queuedMessages.forEach(function(e) {
1283 return o._send(e)
1284 }), o._queuedMessages = [])
1285 }), o
1286 }
1287 return f(t, e), _n(t, [{
1288 key: "_generateId",
1289 value: function() {
1290 return Gt("__privateStripeFrame")
1291 }
1292 }, {
1293 key: "send",
1294 value: function(e) {
1295 this._send({
1296 message: e,
1297 type: "outer",
1298 frameId: this.id,
1299 controllerId: this._controllerId
1300 })
1301 }
1302 }, {
1303 key: "sendPersistent",
1304 value: function(e) {
1305 this._ensureMounted();
1306 var t = {
1307 message: e,
1308 type: "outer",
1309 frameId: this.id,
1310 controllerId: this._controllerId
1311 };
1312 this._persistentMessages = [].concat(l(this._persistentMessages), [t]), this.loaded && rn(t)
1313 }
1314 }, {
1315 key: "resolve",
1316 value: function(e, t) {
1317 this._requests[e] && this._requests[e].resolve(t)
1318 }
1319 }, {
1320 key: "reject",
1321 value: function(e, t) {
1322 this._requests[e] && this._requests[e].reject(t)
1323 }
1324 }, {
1325 key: "_send",
1326 value: function(e) {
1327 this._ensureMounted(), this.loaded ? rn(e) : this._queuedMessages = [].concat(l(this._queuedMessages), [e])
1328 }
1329 }, {
1330 key: "appendTo",
1331 value: function(e) {
1332 e.appendChild(this._iframe)
1333 }
1334 }, {
1335 key: "unmount",
1336 value: function() {
1337 this.loaded = !1, this._emit("unload")
1338 }
1339 }, {
1340 key: "destroy",
1341 value: function() {
1342 this.unmount();
1343 var e = this._iframe.parentElement;
1344 e && e.removeChild(this._iframe), this._emit("destroy")
1345 }
1346 }, {
1347 key: "_ensureMounted",
1348 value: function() {
1349 this._isMounted() || this.unmount()
1350 }
1351 }, {
1352 key: "_isMounted",
1353 value: function() {
1354 return !!document.body && document.body.contains(this._iframe)
1355 }
1356 }, {
1357 key: "_createIFrame",
1358 value: function(e) {
1359 var t = window.location.href.toString(),
1360 n = Pt(t),
1361 r = n ? n.origin : "",
1362 o = e.queryString && "string" == typeof e.queryString ? e.queryString : Vt(hn({}, e, {
1363 origin: r,
1364 referrer: t,
1365 controllerId: this._controllerId
1366 })),
1367 a = document.createElement("iframe");
1368 return a.setAttribute("frameborder", "0"), a.setAttribute("allowTransparency", "true"), a.setAttribute("scrolling", "no"), a.setAttribute("name", this.id), a.setAttribute("allowpaymentrequest", "true"), a.src = Nt(this.type) + "#" + o, a
1369 }
1370 }]), t
1371 }(fn),
1372 yn = mn,
1373 vn = function() {
1374 function e(e, t) {
1375 for (var n = 0; n < t.length; n++) {
1376 var r = t[n];
1377 r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
1378 }
1379 }
1380 return function(t, n, r) {
1381 return n && e(t.prototype, n), r && e(t, r), t
1382 }
1383 }(),
1384 bn = function e(t, n, r) {
1385 null === t && (t = Function.prototype);
1386 var o = Object.getOwnPropertyDescriptor(t, n);
1387 if (void 0 === o) {
1388 var a = Object.getPrototypeOf(t);
1389 return null === a ? void 0 : e(a, n, r)
1390 }
1391 if ("value" in o) return o.value;
1392 var i = o.get;
1393 if (void 0 !== i) return i.call(r)
1394 },
1395 gn = {
1396 border: "none",
1397 margin: "0",
1398 padding: "0",
1399 width: "1px",
1400 "min-width": "100%",
1401 overflow: "hidden",
1402 display: "block",
1403 visibility: "hidden",
1404 position: "fixed",
1405 height: "1px",
1406 "pointer-events": "none",
1407 "user-select": "none"
1408 },
1409 En = function(e) {
1410 function t(e, n, r) {
1411 h(this, t);
1412 var o = _(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, n, r));
1413 if (o.autoload = r.autoload || !1, "complete" === document.readyState) o._ensureMounted();
1414 else {
1415 var a = o._ensureMounted.bind(o);
1416 document.addEventListener("DOMContentLoaded", a), window.addEventListener("load", a), setTimeout(a, 5e3)
1417 }
1418 return o
1419 }
1420 return m(t, e), vn(t, [{
1421 key: "_ensureMounted",
1422 value: function() {
1423 bn(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "_ensureMounted", this).call(this), this._isMounted() || this._autoMount()
1424 }
1425 }, {
1426 key: "_autoMount",
1427 value: function() {
1428 if (document.body) this.appendTo(document.body);
1429 else if ("complete" === document.readyState || "interactive" === document.readyState) throw new ke("Stripe.js requires that your page has a <body> element.");
1430 this.autoload && (this.loaded = !0)
1431 }
1432 }, {
1433 key: "_createIFrame",
1434 value: function(e) {
1435 var n = bn(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "_createIFrame", this).call(this, e);
1436 return n.setAttribute("aria-hidden", "true"), n.setAttribute("allowpaymentrequest", "true"), n.setAttribute("tabIndex", "-1"), Zt(n, gn), n
1437 }
1438 }]), t
1439 }(yn),
1440 wn = En,
1441 Sn = function() {
1442 function e(e, t) {
1443 for (var n = 0; n < t.length; n++) {
1444 var r = t[n];
1445 r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
1446 }
1447 }
1448 return function(t, n, r) {
1449 return n && e(t.prototype, n), r && e(t, r), t
1450 }
1451 }(),
1452 Pn = function(e) {
1453 function t() {
1454 return y(this, t), v(this, (t.__proto__ || Object.getPrototypeOf(t)).apply(this, arguments))
1455 }
1456 return b(t, e), Sn(t, [{
1457 key: "_generateId",
1458 value: function() {
1459 return this._controllerId
1460 }
1461 }]), t
1462 }(wn),
1463 On = Pn,
1464 kn = function() {
1465 function e(e, t) {
1466 for (var n = 0; n < t.length; n++) {
1467 var r = t[n];
1468 r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
1469 }
1470 }
1471 return function(t, n, r) {
1472 return n && e(t.prototype, n), r && e(t, r), t
1473 }
1474 }(),
1475 An = function e(t, n, r) {
1476 null === t && (t = Function.prototype);
1477 var o = Object.getOwnPropertyDescriptor(t, n);
1478 if (void 0 === o) {
1479 var a = Object.getPrototypeOf(t);
1480 return null === a ? void 0 : e(a, n, r)
1481 }
1482 if ("value" in o) return o.value;
1483 var i = o.get;
1484 if (void 0 !== i) return i.call(r)
1485 },
1486 Tn = {
1487 border: "none",
1488 margin: "0",
1489 padding: "0",
1490 width: "1px",
1491 "min-width": "100%",
1492 overflow: "hidden",
1493 display: "block",
1494 "user-select": "none"
1495 },
1496 In = function(e) {
1497 function t() {
1498 return g(this, t), E(this, (t.__proto__ || Object.getPrototypeOf(t)).apply(this, arguments))
1499 }
1500 return w(t, e), kn(t, [{
1501 key: "update",
1502 value: function(e) {
1503 this.send({
1504 action: "stripe-user-update",
1505 payload: e
1506 })
1507 }
1508 }, {
1509 key: "updateStyle",
1510 value: function(e) {
1511 var t = this;
1512 Object.keys(e).forEach(function(n) {
1513 t._iframe.style[n] = e[n]
1514 })
1515 }
1516 }, {
1517 key: "focus",
1518 value: function() {
1519 this.loaded && this.send({
1520 action: "stripe-user-focus",
1521 payload: {}
1522 })
1523 }
1524 }, {
1525 key: "blur",
1526 value: function() {
1527 this.loaded && (this._iframe.contentWindow.blur(), this._iframe.blur())
1528 }
1529 }, {
1530 key: "clear",
1531 value: function() {
1532 this.send({
1533 action: "stripe-user-clear",
1534 payload: {}
1535 })
1536 }
1537 }, {
1538 key: "_createIFrame",
1539 value: function(e) {
1540 var n = An(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "_createIFrame", this).call(this, e);
1541 return n.setAttribute("title", "Secure payment input frame"), Zt(n, Tn), n
1542 }
1543 }]), t
1544 }(yn),
1545 Rn = In,
1546 Nn = function(e, t) {
1547 var n = !1;
1548 return function() {
1549 if (n) throw new ke(t);
1550 n = !0;
1551 try {
1552 return e.apply(void 0, arguments).then(function(e) {
1553 return n = !1, e
1554 }, function(e) {
1555 throw n = !1, e
1556 })
1557 } catch (e) {
1558 throw n = !1, e
1559 }
1560 }
1561 },
1562 Cn = function(e) {
1563 var t = e;
1564 return function() {
1565 t && (t.apply(void 0, arguments), t = null)
1566 }
1567 },
1568 Mn = function() {
1569 return tn(function(e) {
1570 var t = e.style,
1571 n = t.position,
1572 r = t.top,
1573 o = t.left,
1574 a = t.bottom,
1575 i = t.right,
1576 c = t.overflow,
1577 s = document.documentElement ? document.documentElement.style : {
1578 overflow: ""
1579 },
1580 u = s.overflow,
1581 l = window,
1582 p = l.pageXOffset,
1583 d = l.pageYOffset,
1584 f = document.documentElement ? window.innerWidth - document.documentElement.offsetWidth : 0,
1585 h = document.documentElement ? window.innerHeight - document.documentElement.offsetHeight : 0;
1586 return e.style.position = "fixed", e.style.overflow = "hidden", document.documentElement && (document.documentElement.style.overflow = "visible"), e.style.top = -d + "px", e.style.left = -p + "px", e.style.right = f + "px", e.style.bottom = h + "px", Cn(function() {
1587 e.style.position = n, e.style.top = r, e.style.left = o, e.style.bottom = a, e.style.right = i, e.style.overflow = c, document.documentElement && (document.documentElement.style.overflow = u), window.scrollTo(p, d)
1588 })
1589 })
1590 },
1591 jn = function(e, t) {
1592 return e ? window.getComputedStyle(e, t) : null
1593 },
1594 Ln = jn,
1595 xn = function(e, t) {
1596 var n = Array.prototype.slice.call(document.querySelectorAll("a[href], area[href], input:not([disabled]),\n select:not([disabled]), textarea:not([disabled]), button:not([disabled]),\n object, embed, *[tabindex], *[contenteditable]")).filter(function(e) {
1597 var t = e.getAttribute("tabindex"),
1598 n = !t || parseInt(t, 10) >= 0,
1599 r = e.getBoundingClientRect(),
1600 o = Ln(e),
1601 a = r.width > 0 && r.height > 0 && o && "hidden" !== o.getPropertyValue("visibility");
1602 return n && a
1603 });
1604 return n[Me(n, function(t) {
1605 return t === e || e.contains(t)
1606 }) + ("previous" === t ? -1 : 1)]
1607 },
1608 qn = function(e) {
1609 var t = [],
1610 n = Le(document.querySelectorAll("*"), function(n) {
1611 var r = n.getAttribute("tabindex") || "";
1612 e !== n && (n.tabIndex = -1), t.push({
1613 element: n,
1614 tabIndex: r
1615 })
1616 });
1617 return Cn(function() {
1618 n.then(function() {
1619 return Le(t, function(e) {
1620 var t = e.element,
1621 n = e.tabIndex;
1622 "" === n ? t.removeAttribute("tabindex") : t.setAttribute("tabindex", n)
1623 })
1624 })
1625 })
1626 },
1627 Dn = Object.assign || function(e) {
1628 for (var t = 1; t < arguments.length; t++) {
1629 var n = arguments[t];
1630 for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r])
1631 }
1632 return e
1633 },
1634 Bn = {
1635 display: "block",
1636 position: "fixed",
1637 "z-index": "2147483647",
1638 background: "rgba(40,40,40,0)",
1639 transition: "background 400ms ease",
1640 "will-change": "background",
1641 top: "0",
1642 left: "0",
1643 right: "0",
1644 bottom: "0"
1645 },
1646 Fn = Dn({}, Bn, {
1647 background: "rgba(40,40,40,0.75)"
1648 }),
1649 Un = function e(t) {
1650 var n = this,
1651 r = t.lockScrolling,
1652 o = t.lockFocus,
1653 a = t.lockFocusOn;
1654 S(this, e), this.domElement = document.createElement("div"), this._runOnHide = [], this.mount = function() {
1655 tn(function(e) {
1656 n.domElement.style.display = "none", e.contains(n.domElement) || e.insertBefore(n.domElement, e.firstChild)
1657 })
1658 }, this.show = function() {
1659 if (Zt(n.domElement, Bn), n._lockScrolling) {
1660 var e = Mn();
1661 n._runOnHide.push(e)
1662 }
1663 if (n._lockFocus) {
1664 var t = qn(n._lockFocusOn);
1665 n._runOnHide.push(t)
1666 }
1667 }, this.fadeIn = function() {
1668 setTimeout(function() {
1669 Zt(n.domElement, Fn)
1670 })
1671 }, this.fadeOut = function() {
1672 return new Ne(function(e) {
1673 Zt(n.domElement, Bn), setTimeout(e, 500), n.domElement.addEventListener("transitionend", e)
1674 }).then(function() {
1675 for (n.domElement.style.display = "none"; n._runOnHide.length;) n._runOnHide.pop()()
1676 })
1677 }, this.unmount = function() {
1678 tn(function(e) {
1679 e.removeChild(n.domElement)
1680 })
1681 }, this._lockScrolling = !!r, this._lockFocus = !!o, this._lockFocusOn = a || null
1682 },
1683 Hn = Un,
1684 zn = function e(t, n, r) {
1685 null === t && (t = Function.prototype);
1686 var o = Object.getOwnPropertyDescriptor(t, n);
1687 if (void 0 === o) {
1688 var a = Object.getPrototypeOf(t);
1689 return null === a ? void 0 : e(a, n, r)
1690 }
1691 if ("value" in o) return o.value;
1692 var i = o.get;
1693 if (void 0 !== i) return i.call(r)
1694 },
1695 Gn = {
1696 position: "absolute",
1697 left: "0",
1698 top: "0",
1699 height: "100%",
1700 width: "100%"
1701 },
1702 Yn = function(e) {
1703 function t(e, n, r) {
1704 P(this, t);
1705 var o = O(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, n, r));
1706 return o._autoMount = function() {
1707 o.appendTo(o._backdrop.domElement), o._backdrop.mount()
1708 }, o.show = function() {
1709 o._backdrop.show(), Zt(o._iframe, Gn)
1710 }, o.fadeInBackdrop = function() {
1711 o._backdrop.fadeIn()
1712 }, o._backdropFadeoutPromise = null, o.fadeOutBackdrop = function() {
1713 return o._backdropFadeoutPromise || (o._backdropFadeoutPromise = o._backdrop.fadeOut()), o._backdropFadeoutPromise
1714 }, o.destroy = function() {
1715 return o.fadeOutBackdrop().then(function() {
1716 o._backdrop.unmount(), zn(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "destroy", o).call(o)
1717 })
1718 }, o._backdrop = new Hn({
1719 lockScrolling: !0,
1720 lockFocus: !0,
1721 lockFocusOn: o._iframe
1722 }), o._autoMount(), o
1723 }
1724 return k(t, e), t
1725 }(yn),
1726 Wn = Yn,
1727 Kn = Object.assign || function(e) {
1728 for (var t = 1; t < arguments.length; t++) {
1729 var n = arguments[t];
1730 for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r])
1731 }
1732 return e
1733 },
1734 Vn = function() {
1735 function e(e, t) {
1736 for (var n = 0; n < t.length; n++) {
1737 var r = t[n];
1738 r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
1739 }
1740 }
1741 return function(t, n, r) {
1742 return n && e(t.prototype, n), r && e(t, r), t
1743 }
1744 }(),
1745 Jn = function e(t, n, r) {
1746 null === t && (t = Function.prototype);
1747 var o = Object.getOwnPropertyDescriptor(t, n);
1748 if (void 0 === o) {
1749 var a = Object.getPrototypeOf(t);
1750 return null === a ? void 0 : e(a, n, r)
1751 }
1752 if ("value" in o) return o.value;
1753 var i = o.get;
1754 if (void 0 !== i) return i.call(r)
1755 },
1756 Qn = {
1757 display: "block",
1758 position: "absolute",
1759 "z-index": "1000",
1760 width: "1px",
1761 "min-width": "100%",
1762 margin: "2px 0 0 0",
1763 padding: "0",
1764 border: "none",
1765 overflow: "hidden"
1766 },
1767 Xn = function(e) {
1768 function t() {
1769 return A(this, t), T(this, (t.__proto__ || Object.getPrototypeOf(t)).apply(this, arguments))
1770 }
1771 return I(t, e), Vn(t, [{
1772 key: "updateStyle",
1773 value: function(e) {
1774 var t = this;
1775 Object.keys(e).forEach(function(n) {
1776 t._iframe.style[n] = e[n]
1777 })
1778 }
1779 }, {
1780 key: "update",
1781 value: function(e) {
1782 this.send({
1783 action: "stripe-user-update",
1784 payload: e
1785 })
1786 }
1787 }, {
1788 key: "_createIFrame",
1789 value: function(e) {
1790 var n = Jn(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "_createIFrame", this).call(this, Kn({}, e, {
1791 isSecondaryFrame: !0
1792 }));
1793 return Zt(n, Qn), n.style.height = "0", n
1794 }
1795 }]), t
1796 }(yn),
1797 $n = Xn,
1798 Zn = function(e) {
1799
1800 var t = Pt(e),
1801 n = t ? t.host : "";
1802
1803 //return "stripe.com" === n || !!n.match(/\.stripe\.(com|me)$/)
1804 return true
1805 },
1806 er = function(e, t) {
1807 var n = Pt(e),
1808 r = Pt(t);
1809 return !(!n || !r) && n.origin === r.origin
1810 },
1811 tr = function(e) {
1812 //return er(e, "https://js.stripe.com/v3/")
1813 return true
1814 },
1815 nr = function(e) {
1816 return tr(e) || Zn(e)
1817 },
1818 rr = ["button", "checkbox", "file", "hidden", "image", "submit", "radio", "reset"],
1819 or = function(e) {
1820 var t = e.tagName;
1821 if (e.isContentEditable || "TEXTAREA" === t) return !0;
1822 if ("INPUT" !== t) return !1;
1823 var n = e.getAttribute("type");
1824 return -1 === rr.indexOf(n)
1825 },
1826 ar = or,
1827 ir = function(e) {
1828 return /Edge\//i.test(e)
1829 },
1830 cr = function(e) {
1831 return /(MSIE ([0-9]{1,}[.0-9]{0,})|Trident\/)/i.test(e)
1832 },
1833 sr = function(e) {
1834 return /SamsungBrowser/.test(e)
1835 },
1836 ur = function(e) {
1837 return /iPad|iPhone/i.test(e) && !cr(e)
1838 },
1839 lr = function(e) {
1840 return /Android/i.test(e) && !cr(e)
1841 },
1842 pr = window.navigator.userAgent,
1843 dr = ir(pr),
1844 fr = (function(e) {
1845 /Edge\/((1[0-6]\.)|0\.)/i.test(e)
1846 }(pr), cr(pr)),
1847 hr = (function(e) {
1848 /MSIE ([0-9]{1,}[.0-9]{0,})/i.test(e)
1849 }(pr), ur(pr)),
1850 _r = (function(e) {
1851 ur(e) || lr(e)
1852 }(pr), lr(pr), function(e) {
1853 /Android 4\./i.test(e) && !/Chrome/i.test(e) && lr(e)
1854 }(pr), function(e) {
1855 return /^((?!chrome|android).)*safari/i.test(e) && !sr(e)
1856 }(pr)),
1857 mr = (function(e) {
1858 /Firefox\//i.test(e)
1859 }(pr), function(e) {
1860 /Firefox\/(50|51|[0-4]?\d)([^\d]|$)/i.test(e)
1861 }(pr), sr(pr)),
1862 yr = (function(e) {
1863 /Chrome\/(6[6-9]|[7-9]\d+|[1-9]\d{2,})/i.test(e)
1864 }(pr), function(e) {
1865 return /AppleWebKit/i.test(e) && !/Chrome/i.test(e) && !ir(e) && !cr(e)
1866 }(pr)),
1867 vr = function(e) {
1868 return /Chrome/i.test(e) && !ir(e)
1869 }(pr),
1870 br = (ye = {}, R(ye, Mt.card, {
1871 unique: !0,
1872 conflict: [Mt.cardNumber, Mt.cardExpiry, Mt.cardCvc, Mt.postalCode],
1873 beta: !1
1874 }), R(ye, Mt.cardNumber, {
1875 unique: !0,
1876 conflict: [Mt.card],
1877 beta: !1
1878 }), R(ye, Mt.cardExpiry, {
1879 unique: !0,
1880 conflict: [Mt.card],
1881 beta: !1
1882 }), R(ye, Mt.cardCvc, {
1883 unique: !0,
1884 conflict: [Mt.card],
1885 beta: !1
1886 }), R(ye, Mt.postalCode, {
1887 unique: !0,
1888 conflict: [Mt.card],
1889 beta: !1
1890 }), R(ye, Mt.paymentRequestButton, {
1891 unique: !0,
1892 conflict: [],
1893 beta: !1
1894 }), R(ye, Mt.iban, {
1895 unique: !0,
1896 conflict: [],
1897 beta: !1
1898 }), R(ye, Mt.idealBank, {
1899 unique: !0,
1900 conflict: [],
1901 beta: !1
1902 }), R(ye, Mt.auBankAccount, {
1903 unique: !0,
1904 beta: !0,
1905 conflict: []
1906 }), R(ye, Mt.fpxBank, {
1907 unique: !0,
1908 beta: !1,
1909 conflict: []
1910 }), ye),
1911 gr = br,
1912 Er = (ve = {}, N(ve, Mt.card, At.CARD_ELEMENT), N(ve, Mt.cardNumber, At.CARD_ELEMENT), N(ve, Mt.cardExpiry, At.CARD_ELEMENT), N(ve, Mt.cardCvc, At.CARD_ELEMENT), N(ve, Mt.postalCode, At.CARD_ELEMENT), N(ve, Mt.paymentRequestButton, At.PAYMENT_REQUEST_ELEMENT), N(ve, Mt.iban, At.IBAN_ELEMENT), N(ve, Mt.idealBank, At.IDEAL_BANK_ELEMENT), N(ve, Mt.auBankAccount, At.AU_BANK_ACCOUNT_ELEMENT), N(ve, Mt.fpxBank, At.FPX_BANK_ELEMENT), ve),
1913 wr = Er,
1914 Sr = ["brand"],
1915 Pr = ["country", "bankName"],
1916 Or = ["bankName", "branchName"],
1917 kr = (be = {}, C(be, Mt.card, Sr), C(be, Mt.cardNumber, Sr), C(be, Mt.iban, Pr), C(be, Mt.auBankAccount, Or), be),
1918 Ar = (ge = {}, C(ge, Mt.idealBank, {
1919 secondary: Mt.idealBankSecondary
1920 }), C(ge, Mt.fpxBank, {
1921 secondary: Mt.fpxBankSecondary
1922 }), ge),
1923 Tr = Object.assign || function(e) {
1924 for (var t = 1; t < arguments.length; t++) {
1925 var n = arguments[t];
1926 for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r])
1927 }
1928 return e
1929 },
1930 Ir = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
1931 return typeof e
1932 } : function(e) {
1933 return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
1934 },
1935 Rr = !1,
1936 Nr = function(e, t) {
1937 return document.activeElement === e._iframe || e._iframe.parentElement && document.activeElement === t
1938 },
1939 Cr = function(e) {
1940 return "object" === (void 0 === e ? "undefined" : Ir(e)) && null !== e && "IntegrationError" === e.name ? new ke("string" == typeof e.message ? e.message : "") : e
1941 },
1942 Mr = function e(t) {
1943 j(this, e), jr.call(this);
1944 var n = t.apiKey,
1945 r = t.stripeAccount,
1946 o = t.stripeJsId,
1947 a = t.locale;
1948 this._id = Gt("__privateStripeController"), this._stripeJsId = o, this._apiKey = n, this._stripeAccount = r, this._controllerFrame = new On(At.CONTROLLER, this._id, Tr({}, t)), this._frames = {}, this._requests = {}, this._setupPostMessage(), this._handleMessage = sn(this._handleMessage, this), this.action.fetchLocale({
1949 locale: a || "auto"
1950 })
1951 },
1952 jr = function() {
1953 var e = this;
1954 this._sendCAReq = function(t) {
1955 var n = Gt(t.tag);
1956 return new Ne(function(r, o) {
1957 e._requests[n] = {
1958 resolve: r,
1959 reject: o
1960 }, e._controllerFrame.send({
1961 action: "stripe-safe-controller-action-request",
1962 payload: {
1963 nonce: n,
1964 caReq: t
1965 }
1966 })
1967 })
1968 }, this.livemode = function() {
1969 var t = e._apiKey;
1970 return /^pk_test_/.test(t) ? "testmode" : /^pk_live_/.test(t) ? "livemode" : "unknown"
1971 }, this.action = {
1972 retrievePaymentIntent: function(t) {
1973 return e._sendCAReq({
1974 tag: "RETRIEVE_PAYMENT_INTENT",
1975 value: t
1976 })
1977 },
1978 confirmPaymentIntent: function(t) {
1979 return e._sendCAReq({
1980 tag: "CONFIRM_PAYMENT_INTENT",
1981 value: t
1982 })
1983 },
1984 cancelPaymentIntentSource: function(t) {
1985 return e._sendCAReq({
1986 tag: "CANCEL_PAYMENT_INTENT_SOURCE",
1987 value: t
1988 })
1989 },
1990 confirmSetupIntent: function(t) {
1991 return e._sendCAReq({
1992 tag: "CONFIRM_SETUP_INTENT",
1993 value: t
1994 })
1995 },
1996 retrieveSetupIntent: function(t) {
1997 return e._sendCAReq({
1998 tag: "RETRIEVE_SETUP_INTENT",
1999 value: t
2000 })
2001 },
2002 cancelSetupIntentSource: function(t) {
2003 return e._sendCAReq({
2004 tag: "CANCEL_SETUP_INTENT_SOURCE",
2005 value: t
2006 })
2007 },
2008 fetchLocale: function(t) {
2009 return e._sendCAReq({
2010 tag: "FETCH_LOCALE",
2011 value: t
2012 })
2013 },
2014 updateCSSFonts: function(t) {
2015 return e._sendCAReq({
2016 tag: "UPDATE_CSS_FONTS",
2017 value: t
2018 })
2019 },
2020 createApplePaySession: function(t) {
2021 return e._sendCAReq({
2022 tag: "CREATE_APPLE_PAY_SESSION",
2023 value: t
2024 })
2025 },
2026 retrieveSource: function(t) {
2027 return e._sendCAReq({
2028 tag: "RETRIEVE_SOURCE",
2029 value: t
2030 })
2031 },
2032 tokenizeWithElement: function(t) {
2033 return e._sendCAReq({
2034 tag: "TOKENIZE_WITH_ELEMENT",
2035 value: t
2036 })
2037 },
2038 tokenizeCvcUpdate: function(t) {
2039 return e._sendCAReq({
2040 tag: "TOKENIZE_CVC_UPDATE",
2041 value: t
2042 })
2043 },
2044 tokenizeWithData: function(t) {
2045 return e._sendCAReq({
2046 tag: "TOKENIZE_WITH_DATA",
2047 value: t
2048 })
2049 },
2050 createSourceWithElement: function(t) {
2051 return e._sendCAReq({
2052 tag: "CREATE_SOURCE_WITH_ELEMENT",
2053 value: t
2054 })
2055 },
2056 createSourceWithData: function(t) {
2057 return e._sendCAReq({
2058 tag: "CREATE_SOURCE_WITH_DATA",
2059 value: t
2060 })
2061 },
2062 createPaymentMethodWithElement: function(t) {
2063 return e._sendCAReq({
2064 tag: "CREATE_PAYMENT_METHOD_WITH_ELEMENT",
2065 value: t
2066 })
2067 },
2068 createPaymentMethodWithData: function(t) {
2069 return e._sendCAReq({
2070 tag: "CREATE_PAYMENT_METHOD_WITH_DATA",
2071 value: t
2072 })
2073 },
2074 createPaymentPage: function(t) {
2075 return e._sendCAReq({
2076 tag: "CREATE_PAYMENT_PAGE",
2077 value: t
2078 })
2079 },
2080 createPaymentPageWithSession: function(t) {
2081 return e._sendCAReq({
2082 tag: "CREATE_PAYMENT_PAGE_WITH_SESSION",
2083 value: t
2084 })
2085 },
2086 createRadarSession: function(t) {
2087 return e._sendCAReq({
2088 tag: "CREATE_RADAR_SESSION",
2089 value: t
2090 })
2091 },
2092 authenticate3DS2: function(t) {
2093 return e._sendCAReq({
2094 tag: "AUTHENTICATE_3DS2",
2095 value: t
2096 })
2097 }
2098 }, this.createElementFrame = function(t, n) {
2099 var r = n.groupId,
2100 o = M(n, ["groupId"]),
2101 a = new Rn(t, e._id, Tr({}, o, {
2102 keyMode: Ue(e._apiKey),
2103 apiKey: e._apiKey
2104 }));
2105 return e._setupFrame(a, t, r)
2106 }, this.createSecondaryElementFrame = function(t, n) {
2107 var r = n.groupId,
2108 o = M(n, ["groupId"]),
2109 a = new $n(t, e._id, Tr({}, o));
2110 return e._setupFrame(a, t, r)
2111 }, this.createHiddenFrame = function(t, n) {
2112 var r = new wn(t, e._id, n);
2113 return e._setupFrame(r, t)
2114 }, this.createLightboxFrame = function(t, n) {
2115 var r = new Wn(t, e._id, n);
2116 return e._setupFrame(r, t)
2117 }, this._setupFrame = function(t, n, r) {
2118 return e._frames[t.id] = t, e._controllerFrame.sendPersistent({
2119 action: "stripe-user-createframe",
2120 payload: {
2121 newFrameId: t.id,
2122 frameType: n,
2123 groupId: r
2124 }
2125 }), t._on("unload", function() {
2126 e._controllerFrame.sendPersistent({
2127 action: "stripe-frame-unload",
2128 payload: {
2129 unloadedFrameId: t.id
2130 }
2131 })
2132 }), t._on("destroy", function() {
2133 delete e._frames[t.id], e._controllerFrame.sendPersistent({
2134 action: "stripe-frame-destroy",
2135 payload: {
2136 destroyedFrameId: t.id
2137 }
2138 })
2139 }), t._on("load", function() {
2140 e._controllerFrame.sendPersistent({
2141 action: "stripe-frame-load",
2142 payload: {
2143 loadedFrameId: t.id
2144 }
2145 }), e._controllerFrame.loaded && t.send({
2146 action: "stripe-controller-load",
2147 payload: {}
2148 })
2149 }), t
2150 }, this.report = function(t) {
2151 var n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
2152 e._controllerFrame.send({
2153 action: "stripe-controller-report",
2154 payload: {
2155 event: t,
2156 data: n
2157 }
2158 })
2159 }, this.warn = function() {
2160 for (var t = arguments.length, n = Array(t), r = 0; r < t; r++) n[r] = arguments[r];
2161 e._controllerFrame.send({
2162 action: "stripe-controller-warn",
2163 payload: {
2164 args: n
2165 }
2166 })
2167 }, this.controllerFor = function() {
2168 return "outer"
2169 }, this._setupPostMessage = function() {
2170 window.addEventListener("message", function(t) {
2171 var n = t.data,
2172 r = t.origin,
2173 o = on(n);
2174 o && er(Bt, r) && e._handleMessage(o)
2175 })
2176 }, this._handleMessage = function(t) {
2177 var n = t.controllerId,
2178 r = t.frameId,
2179 o = t.message,
2180 a = e._frames[r];
2181 if (n === e._id) switch (o.action) {
2182 case "stripe-frame-event":
2183 var i = o.payload,
2184 c = i.event,
2185 s = i.data;
2186 if (a) {
2187 if (hr) {
2188 var u = a._iframe.parentElement,
2189 l = u && u.querySelector(".__PrivateStripeElement-input");
2190 if ("focus" === c && !Rr && !Nr(a, l)) {
2191 l && l.focus(), Rr = !0;
2192 break
2193 }
2194 if ("blur" === c && Rr) {
2195 Rr = !1;
2196 break
2197 }
2198 "blur" === c && setTimeout(function() {
2199 var e = document.activeElement;
2200 if (e && !Nr(a, l) && !ar(e)) {
2201 var t = u && u.querySelector(".__PrivateStripeElement-safariInput");
2202 if (t) {
2203 var n = t;
2204 n.disabled = !1, n.focus(), n.blur(), n.disabled = !0
2205 }
2206 e.focus()
2207 }
2208 }, 400)
2209 }
2210 a._emit(c, s)
2211 }
2212 break;
2213 case "stripe-frame-action-response":
2214 a && a.resolve(o.payload.nonce, o.payload.faRes);
2215 break;
2216 case "stripe-frame-action-error":
2217 a && a.reject(o.payload.nonce, Cr(o.payload.faErr));
2218 break;
2219 case "stripe-frame-error":
2220 throw new ke(o.payload.message);
2221 case "stripe-integration-error":
2222 a && a._emit("__privateIntegrationError", {
2223 message: o.payload.message
2224 });
2225 break;
2226 case "stripe-controller-load":
2227 e._controllerFrame._emit("load"), Object.keys(e._frames).forEach(function(t) {
2228 return e._frames[t].send({
2229 action: "stripe-controller-load",
2230 payload: {}
2231 })
2232 });
2233 break;
2234 case "stripe-safe-controller-action-response":
2235 e._requests[o.payload.nonce] && e._requests[o.payload.nonce].resolve(o.payload.caRes);
2236 break;
2237 case "stripe-safe-controller-action-error":
2238 e._requests[o.payload.nonce] && e._requests[o.payload.nonce].reject(Cr(o.payload.caErr))
2239 }
2240 }
2241 },
2242 Lr = Mr,
2243 xr = function() {
2244 var e = document.querySelectorAll("meta[name=viewport][content]"),
2245 t = e[e.length - 1];
2246 return t && t instanceof HTMLMetaElement ? t.content : ""
2247 },
2248 qr = function(e) {
2249 xr().match(/width=device-width/) || e('Elements requires "width=device-width" be set in your page\'s viewport meta tag.\n For more information: https://stripe.com/docs/js/appendix/viewport_meta_requirements')
2250 },
2251 Dr = {
2252 checkout_beta_2: "checkout_beta_2",
2253 checkout_beta_3: "checkout_beta_3",
2254 checkout_beta_4: "checkout_beta_4",
2255 checkout_beta_testcards: "checkout_beta_testcards",
2256 payment_intent_beta_1: "payment_intent_beta_1",
2257 payment_intent_beta_2: "payment_intent_beta_2",
2258 payment_intent_beta_3: "payment_intent_beta_3",
2259 card_payment_method_beta_1: "card_payment_method_beta_1",
2260 acknowledge_ie9_deprecation: "acknowledge_ie9_deprecation",
2261 cvc_update_beta_1: "cvc_update_beta_1",
2262 google_pay_beta_1: "google_pay_beta_1",
2263 au_bank_account_beta_1: "au_bank_account_beta_1",
2264 au_bank_account_beta_2: "au_bank_account_beta_2",
2265 bacs_debit_beta: "bacs_debit_beta",
2266 bancontact_pm_beta_1: "bancontact_pm_beta_1",
2267 eps_pm_beta_1: "eps_pm_beta_1",
2268 fpx_bank_beta_1: "fpx_bank_beta_1",
2269 giropay_pm_beta_1: "giropay_pm_beta_1",
2270 grabpay_pm_beta_1: "grabpay_pm_beta_1",
2271 ideal_pm_beta_1: "ideal_pm_beta_1",
2272 oxxo_pm_beta_1: "oxxo_pm_beta_1",
2273 p24_pm_beta_1: "p24_pm_beta_1",
2274 sepa_pm_beta_1: "sepa_pm_beta_1",
2275 sofort_pm_beta_1: "sofort_pm_beta_1",
2276 checkout_beta_locales: "checkout_beta_locales"
2277 },
2278 Br = Object.keys(Dr),
2279 Fr = function(e, t) {
2280 return e.indexOf(t) >= 0
2281 },
2282 Ur = Object.assign || function(e) {
2283 for (var t = 1; t < arguments.length; t++) {
2284 var n = arguments[t];
2285 for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r])
2286 }
2287 return e
2288 },
2289 Hr = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
2290 return typeof e
2291 } : function(e) {
2292 return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
2293 },
2294 zr = function(e) {
2295 return e && "object" === (void 0 === e ? "undefined" : Hr(e)) && (e.constructor === Array || e.constructor === Object)
2296 },
2297 Gr = function(e) {
2298 return zr(e) ? Array.isArray(e) ? e.slice(0, e.length) : Ur({}, e) : e
2299 },
2300 Yr = function e(t) {
2301 return function() {
2302 for (var n = arguments.length, r = Array(n), o = 0; o < n; o++) r[o] = arguments[o];
2303 if (Array.isArray(r[0]) && t) return Gr(r[0]);
2304 var a = Array.isArray(r[0]) ? [] : {};
2305 return r.forEach(function(n) {
2306 n && Object.keys(n).forEach(function(r) {
2307 var o = a[r],
2308 i = n[r],
2309 c = zr(o) && !(t && Array.isArray(o));
2310 "object" === (void 0 === i ? "undefined" : Hr(i)) && c ? a[r] = e(t)(o, Gr(i)) : void 0 !== i ? a[r] = zr(i) ? e(t)(i) : Gr(i) : void 0 !== o && (a[r] = o)
2311 })
2312 }), a
2313 }
2314 },
2315 Wr = (Yr(!1), Yr(!0)),
2316 Kr = function(e) {
2317 function t() {
2318 L(this, t);
2319 var e = x(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this));
2320 return e.name = "NetworkError", e.type = "network_error", e
2321 }
2322 return q(t, e), t
2323 }(Error),
2324 Vr = Kr,
2325 Jr = Object.assign || function(e) {
2326 for (var t = 1; t < arguments.length; t++) {
2327 var n = arguments[t];
2328 for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r])
2329 }
2330 return e
2331 },
2332 Qr = {
2333 Accept: "application/json",
2334 "Content-Type": "application/x-www-form-urlencoded"
2335 },
2336 Xr = function(e) {
2337 return Object.keys(Qr).forEach(function(t) {
2338 e.setRequestHeader(t, Qr[t])
2339 }), e
2340 },
2341 $r = function e(t) {
2342 return new Ne(function(n, r) {
2343 var o = t.method,
2344 a = t.url,
2345 i = t.data,
2346 c = t.withCredentials,
2347 s = i ? Vt(i) : "",
2348 u = "GET" === o && s ? a + "?" + s : a,
2349 l = "GET" === o ? "" : s,
2350 p = new XMLHttpRequest;
2351 c && (p.withCredentials = c), p.open(o, u, !0), Xr(p), p.onreadystatechange = function() {
2352 4 === p.readyState && (p.onreadystatechange = function() {}, 0 === p.status ? c ? r(new Vr) : e(Jr({}, t, {
2353 withCredentials: !0
2354 })).then(n, r) : n(p))
2355 };
2356 try {
2357 p.send(l)
2358 } catch (e) {
2359 r(e)
2360 }
2361 })
2362 },
2363 Zr = $r,
2364 eo = Object.assign || function(e) {
2365 for (var t = 1; t < arguments.length; t++) {
2366 var n = arguments[t];
2367 for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r])
2368 }
2369 return e
2370 },
2371 to = function(e, t) {
2372 var n = /@font-face[ ]?{[^}]*}/g,
2373 r = e.match(n);
2374 if (!r) throw new ke("No @font-face rules found in file from " + t);
2375 return r
2376 },
2377 no = function(e) {
2378 var t = e.match(/@font-face[ ]?{([^}]*)}/);
2379 return t ? t[1] : ""
2380 },
2381 ro = function(e, t) {
2382 var n = e.replace(/\/\*.*\*\//g, "").trim(),
2383 r = n.length && /;$/.test(n) ? n : n + ";",
2384 o = r.match(/((([^;(]*\([^()]*\)[^;)]*)|[^;]+)+)(?=;)/g);
2385 if (!o) throw new ke("Found @font-face rule containing no valid font-properties in file from " + t);
2386 return o
2387 },
2388 oo = function(e, t) {
2389 var n = e.indexOf(":");
2390 if (-1 === n) throw new ke("Invalid css declaration in file from " + t + ': "' + e + '"');
2391 var r = e.slice(0, n).trim(),
2392 o = Ut[r];
2393 if (!o) throw new ke("Unsupported css property in file from " + t + ': "' + r + '"');
2394 return {
2395 property: o,
2396 value: e.slice(n + 1).trim()
2397 }
2398 },
2399 ao = function(e, t) {
2400 var n = e.reduce(function(e, n) {
2401 var r = oo(n, t),
2402 o = r.property,
2403 a = r.value;
2404 return eo({}, e, D({}, o, a))
2405 }, {});
2406 return ["family", "src"].forEach(function(e) {
2407 if (!n[e]) throw new ke("Missing css property in file from " + t + ': "' + Ft[e] + '"')
2408 }), n
2409 },
2410 io = function(e) {
2411 return Zr({
2412 url: e,
2413 method: "GET"
2414 }).then(function(e) {
2415 return e.responseText
2416 }).then(function(t) {
2417 return to(t, e).map(function(t) {
2418 var n = no(t),
2419 r = ro(n, e);
2420 return ao(r, e)
2421 })
2422 })
2423 },
2424 co = io,
2425 so = function(e, t) {
2426 return e.reduce(function(e, n) {
2427 return e.then(function(e) {
2428 return "SATISFIED" === e.type ? e : n().then(function(e) {
2429 return t(e) ? {
2430 type: "SATISFIED",
2431 value: e
2432 } : {
2433 type: "UNSATISFIED"
2434 }
2435 })
2436 })
2437 }, Ne.resolve({
2438 type: "UNSATISFIED"
2439 }))
2440 },
2441 uo = so,
2442 lo = Object.assign || function(e) {
2443 for (var t = 1; t < arguments.length; t++) {
2444 var n = arguments[t];
2445 for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r])
2446 }
2447 return e
2448 },
2449 po = {
2450 success: "success",
2451 fail: "fail",
2452 invalid_shipping_address: "invalid_shipping_address"
2453 },
2454 fo = {
2455 fail: "fail",
2456 invalid_payer_name: "invalid_payer_name",
2457 invalid_payer_email: "invalid_payer_email",
2458 invalid_payer_phone: "invalid_payer_phone",
2459 invalid_shipping_address: "invalid_shipping_address"
2460 },
2461 ho = {
2462 shipping: "shipping",
2463 delivery: "delivery",
2464 pickup: "pickup"
2465 },
2466 _o = lo({
2467 success: "success"
2468 }, fo),
2469 mo = {
2470 merchantCapabilities: ["supports3DS"],
2471 displayItems: []
2472 },
2473 yo = vt({
2474 amount: pt,
2475 label: ot,
2476 pending: Qe(it)
2477 }),
2478 vo = vt({
2479 amount: lt,
2480 label: ot,
2481 pending: Qe(it)
2482 }),
2483 bo = vt({
2484 amount: lt,
2485 label: ot,
2486 pending: Qe(it),
2487 id: at(ot, function() {
2488 return Gt("shippingOption")
2489 }),
2490 detail: at(ot, function() {
2491 return ""
2492 })
2493 }),
2494 go = et.apply(void 0, B(Object.keys(ho))),
2495 Eo = vt({
2496 origin: ot,
2497 name: ot
2498 }),
2499 wo = vt({
2500 displayItems: Qe(ft(vo)),
2501 shippingOptions: Qe(ht("id")(ft(bo))),
2502 total: yo,
2503 requestShipping: Qe(it),
2504 requestPayerName: Qe(it),
2505 requestPayerEmail: Qe(it),
2506 requestPayerPhone: Qe(it),
2507 shippingType: Qe(go),
2508 currency: rt,
2509 country: nt,
2510 jcbEnabled: Qe(it),
2511 __billingDetailsEmailOverride: Qe(ot),
2512 __minApplePayVersion: Qe(ct),
2513 __merchantDetails: Qe(Eo),
2514 __skipGooglePayInPaymentRequest: Qe(it)
2515 }),
2516 So = yt({
2517 currency: Qe(rt),
2518 displayItems: Qe(ft(vo)),
2519 shippingOptions: Qe(ht("id")(ft(bo))),
2520 total: Qe(yo)
2521 }),
2522 Po = function(e, t) {
2523 var n = ["invalid_payer_name", "invalid_payer_email", "invalid_payer_phone"];
2524 return et.apply(void 0, B(Object.keys(po)))(-1 !== n.indexOf(e) ? "fail" : e, t)
2525 },
2526 Oo = vt({
2527 displayItems: Qe(ft(vo)),
2528 shippingOptions: Qe(ht("id")(ft(bo))),
2529 total: Qe(yo),
2530 status: Po
2531 }),
2532 ko = et.apply(void 0, B(Object.keys(_o))),
2533 Ao = function(e) {
2534 var t = Fr(e, Dr.google_pay_beta_1);
2535 return _r ? t ? ["APPLE_PAY", "GOOGLE_PAY"] : ["APPLE_PAY"] : t ? ["GOOGLE_PAY", "BROWSER"] : ["BROWSER"]
2536 },
2537 To = Ao,
2538 Io = function() {
2539 try {
2540 return window.location.origin === window.top.location.origin
2541 } catch (e) {
2542 return !1
2543 }
2544 },
2545 Ro = 2,
2546 No = function(e) {
2547 var t = {};
2548 return function(n) {
2549 if (void 0 !== t[n]) return t[n];
2550 var r = e(n);
2551 return t[n] = r, r
2552 }
2553 }(function(e) {
2554 return window.ApplePaySession.canMakePaymentsWithActiveCard(e)
2555 }),
2556 Co = function(e) {
2557 if (!window.ApplePaySession) return !1;
2558 try {
2559 return window.ApplePaySession.supportsVersion(e)
2560 } catch (e) {
2561 return !1
2562 }
2563 },
2564 Mo = function(e, t, n, r) {
2565 var o = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : Ro,
2566 a = Math.max(Ro, o);
2567 if (window.ApplePaySession) {
2568 if (Io()) {
2569 if (n && "https:" !== window.location.protocol) return window.console && window.console.warn("To test Apple Pay, you must serve this page over HTTPS."), Ne.resolve(!1);
2570 if (window.ApplePaySession.supportsVersion(a)) {
2571 var i = t ? [e, t] : [e],
2572 c = "merchant." + i.join(".") + ".stripe";
2573 return No(c).then(function(o) {
2574 if (r("pr.apple_pay.can_make_payment_native_response", {
2575 available: o
2576 }), n && !o && window.console) {
2577 var a = t ? "or stripeAccount parameter (" + t + ") " : "";
2578 window.console.warn("Either you do not have a card saved to your Wallet or the current domain (" + e + ") " + a + "is not registered for Apple Pay. Visit https://dashboard.stripe.com/account/apple_pay to register this domain.")
2579 }
2580 return o
2581 })
2582 }
2583 return n && window.console && window.console.warn("This version of Safari does not support ApplePay JS version " + a + "."), Ne.resolve(!1)
2584 }
2585 return Ne.resolve(!1)
2586 }
2587 return Ne.resolve(!1)
2588 },
2589 jo = ["mastercard", "visa"],
2590 Lo = ["AT", "AU", "BE", "CA", "CH", "DE", "DK", "EE", "ES", "FI", "FR", "GB", "GR", "HK", "IE", "IT", "JP", "LT", "LU", "LV", "MX", "NL", "NO", "NZ", "PL", "PT", "SE", "SG", "US"],
2591 xo = function(e, t) {
2592 var n = "US" === e || t ? ["discover", "diners", "jcb"].concat(jo) : jo;
2593 return -1 !== Lo.indexOf(e) ? ["amex"].concat(F(n)) : n
2594 },
2595 qo = function(e, t) {
2596 return xo(e, t).reduce(function(e, t) {
2597 return "mastercard" === t ? [].concat(F(e), ["masterCard"]) : "diners" === t ? e : [].concat(F(e), [t])
2598 }, [])
2599 },
2600 Do = {
2601 bif: 1,
2602 clp: 1,
2603 djf: 1,
2604 gnf: 1,
2605 jpy: 1,
2606 kmf: 1,
2607 krw: 1,
2608 mga: 1,
2609 pyg: 1,
2610 rwf: 1,
2611 vnd: 1,
2612 vuv: 1,
2613 xaf: 1,
2614 xof: 1,
2615 xpf: 1
2616 },
2617 Bo = function(e) {
2618 var t = Do[e.toLowerCase()] || 100;
2619 return {
2620 unitSize: 1 / t,
2621 fractionDigits: Math.log(t) / Math.log(10)
2622 }
2623 },
2624 Fo = function(e, t) {
2625 var n = Bo(t);
2626 return (e * n.unitSize).toFixed(n.fractionDigits)
2627 },
2628 Uo = Object.assign || function(e) {
2629 for (var t = 1; t < arguments.length; t++) {
2630 var n = arguments[t];
2631 for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r])
2632 }
2633 return e
2634 },
2635 Ho = function(e, t) {
2636 return {
2637 amount: Fo(e.amount, t.currency),
2638 label: e.label,
2639 type: e.pending ? "pending" : "final"
2640 }
2641 },
2642 zo = function(e, t) {
2643 return {
2644 amount: Fo(e.amount, t.currency),
2645 label: e.label,
2646 detail: e.detail,
2647 identifier: e.id
2648 }
2649 },
2650 Go = function(e, t) {
2651 return new window.ApplePayError(e, t)
2652 },
2653 Yo = function(e) {
2654 return function(t) {
2655 return t[e] && "string" == typeof t[e] ? t[e].toUpperCase() : null
2656 }
2657 },
2658 Wo = (Ee = {}, U(Ee, _o.success, 0), U(Ee, _o.fail, 1), U(Ee, _o.invalid_payer_name, 2), U(Ee, _o.invalid_shipping_address, 3), U(Ee, _o.invalid_payer_phone, 4), U(Ee, _o.invalid_payer_email, 4), Ee),
2659 Ko = (we = {}, U(we, _o.success, function() {
2660 return null
2661 }), U(we, _o.fail, function() {
2662 return null
2663 }), U(we, _o.invalid_payer_name, function() {
2664 return Go("billingContactInvalid", "name")
2665 }), U(we, _o.invalid_shipping_address, function() {
2666 return Go("shippingContactInvalid", "postalAddress")
2667 }), U(we, _o.invalid_payer_phone, function() {
2668 return Go("shippingContactInvalid", "phoneNumber")
2669 }), U(we, _o.invalid_payer_email, function() {
2670 return Go("shippingContactInvalid", "emailAddress")
2671 }), we),
2672 Vo = (Se = {}, U(Se, ho.pickup, "storePickup"), U(Se, ho.shipping, "shipping"), U(Se, ho.delivery, "delivery"), Se),
2673 Jo = {
2674 total: function(e) {
2675 return Ho(e.total, e)
2676 },
2677 lineItems: function(e) {
2678 return e.displayItems ? e.displayItems.map(function(t) {
2679 return Ho(t, e)
2680 }) : []
2681 },
2682 shippingMethods: function(e) {
2683 return e.shippingOptions ? e.shippingOptions.map(function(t) {
2684 return zo(t, e)
2685 }) : []
2686 }
2687 },
2688 Qo = {
2689 shippingType: function(e) {
2690 var t = e.shippingType;
2691 if (!t) return null;
2692 var n = Vo[t];
2693 if (void 0 !== n) return n;
2694 throw new ke("Invalid value for shippingType: " + t)
2695 },
2696 requiredBillingContactFields: function(e) {
2697 return e.requestPayerName ? ["postalAddress"] : null
2698 },
2699 requiredShippingContactFields: function(e) {
2700 var t = [];
2701 return e.requestShipping && t.push("postalAddress"), e.requestPayerEmail && t.push("email"), e.requestPayerPhone && t.push("phone"), t.length ? t : null
2702 },
2703 countryCode: Yo("country"),
2704 currencyCode: Yo("currency"),
2705 merchantCapabilities: function(e) {
2706 return function(t) {
2707 return t[e] || null
2708 }
2709 }("merchantCapabilities"),
2710 supportedNetworks: function(e) {
2711 var t = qo(e.country, e.jcbEnabled || !1);
2712 return Co(4) && t.push("maestro"), t
2713 }
2714 },
2715 Xo = {
2716 status: function(e) {
2717 var t = Wo[e.status];
2718 return Co(3) && t > 1 ? 1 : t
2719 },
2720 error: function(e) {
2721 return Co(3) ? Ko[e.status]() : null
2722 }
2723 },
2724 $o = Uo({}, Jo, Qo),
2725 Zo = Uo({}, Jo, Xo),
2726 ea = function(e) {
2727 var t = Uo({}, mo, e);
2728 return Object.keys($o).reduce(function(e, n) {
2729 var r = $o[n],
2730 o = r(t);
2731 return null !== o ? Uo({}, e, U({}, n, o)) : e
2732 }, {})
2733 },
2734 ta = function(e) {
2735 return Object.keys(Zo).reduce(function(t, n) {
2736 var r = Zo[n],
2737 o = r(e);
2738 return null !== o ? Uo({}, t, U({}, n, o)) : t
2739 }, {})
2740 },
2741 na = function(e) {
2742 return "string" == typeof e ? e : null
2743 },
2744 ra = function(e) {
2745 return e ? na(e.phoneNumber) : null
2746 },
2747 oa = function(e) {
2748 return e ? na(e.emailAddress) : null
2749 },
2750 aa = function(e) {
2751 return e ? [e.givenName, e.familyName].filter(function(e) {
2752 return e && "string" == typeof e
2753 }).join(" ") : null
2754 },
2755 ia = function(e) {
2756 var t = e.addressLines,
2757 n = e.countryCode,
2758 r = e.postalCode,
2759 o = e.administrativeArea,
2760 a = e.locality,
2761 i = e.phoneNumber,
2762 c = na(n);
2763 return {
2764 addressLine: Array.isArray(t) ? t.reduce(function(e, t) {
2765 return "string" == typeof t ? [].concat(H(e), [t]) : e
2766 }, []) : [],
2767 country: c ? c.toUpperCase() : "",
2768 postalCode: na(r) || "",
2769 recipient: aa(e) || "",
2770 region: na(o) || "",
2771 city: na(a) || "",
2772 phone: na(i) || "",
2773 sortingCode: "",
2774 dependentLocality: "",
2775 organization: ""
2776 }
2777 },
2778 ca = function(e, t) {
2779 var n = e.identifier,
2780 r = e.label;
2781 return t.filter(function(e) {
2782 return e.id === n && e.label === r
2783 })[0]
2784 },
2785 sa = function(e, t) {
2786 var n = e.shippingContact,
2787 r = e.shippingMethod,
2788 o = e.billingContact;
2789 return {
2790 shippingOption: r && t.shippingOptions && t.shippingOptions.length ? ca(r, t.shippingOptions) : null,
2791 shippingAddress: n ? ia(n) : null,
2792 payerEmail: oa(n),
2793 payerPhone: ra(n),
2794 payerName: aa(o),
2795 methodName: "apple-pay"
2796 }
2797 },
2798 ua = sa,
2799 la = Object.assign || function(e) {
2800 for (var t = 1; t < arguments.length; t++) {
2801 var n = arguments[t];
2802 for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r])
2803 }
2804 return e
2805 },
2806 pa = function() {
2807 function e(e, t) {
2808 for (var n = 0; n < t.length; n++) {
2809 var r = t[n];
2810 r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
2811 }
2812 }
2813 return function(t, n, r) {
2814 return n && e(t.prototype, n), r && e(t, r), t
2815 }
2816 }(),
2817 da = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
2818 return typeof e
2819 } : function(e) {
2820 return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
2821 },
2822 fa = {
2823 australia: "AU",
2824 austria: "AT",
2825 canada: "CA",
2826 schweiz: "CH",
2827 deutschland: "DE",
2828 hongkong: "HK",
2829 saudiarabia: "SA",
2830 espaa: "ES",
2831 singapore: "SG",
2832 us: "US",
2833 usa: "US",
2834 unitedstatesofamerica: "US",
2835 unitedstates: "US",
2836 england: "GB",
2837 gb: "GB",
2838 uk: "GB",
2839 unitedkingdom: "GB"
2840 },
2841 ha = function(e, t) {
2842 return e && "object" === (void 0 === e ? "undefined" : da(e)) ? t(e) : null
2843 },
2844 _a = function() {
2845 function e(t) {
2846 var n = this;
2847 z(this, e), this._onEvent = function() {}, this.setEventHandler = function(e) {
2848 n._onEvent = e
2849 }, this.canMakePayment = function() {
2850 return Mo(window.location.hostname, n._authentication.accountId, Ue(n._authentication.apiKey) === Fe.test, n._report, n._minimumVersion)
2851 }, this.update = function(e) {
2852 n._initialPaymentRequest = Wr(n._paymentRequestOptions, e), n._initializeSessionState()
2853 }, this.show = function() {
2854 n._initializeSessionState();
2855 var e = void 0;
2856 try {
2857 e = new window.ApplePaySession(n._minimumVersion, ea(n._paymentRequestOptions))
2858 } catch (e) {
2859 throw "Must create a new ApplePaySession from a user gesture handler." === e.message ? new ke("show() must be called from a user gesture handler (such as a click handler, after the user clicks a button).") : e
2860 }
2861 n._privateSession = e, n._setupSession(e, n._usesButtonElement()), e.begin(), n._isShowing = !0
2862 }, this.abort = function() {
2863 n._privateSession && n._privateSession.abort()
2864 }, this._warn = function(e) {}, this._report = function(e, t) {
2865 n._controller.report(e, la({}, t, {
2866 backingLibrary: "APPLE_PAY",
2867 usesButtonElement: n._usesButtonElement()
2868 }))
2869 }, this._validateMerchant = function(e, t) {
2870 return function(r) {
2871 n._controller.action.createApplePaySession({
2872 data: {
2873 validation_url: r.validationURL,
2874 domain_name: window.location.hostname,
2875 display_name: n._paymentRequestOptions.total.label
2876 },
2877 usesButtonElement: t
2878 }).then(function(t) {
2879 if (n._isShowing) switch (t.type) {
2880 case "object":
2881 e.completeMerchantValidation(JSON.parse(t.object.session));
2882 break;
2883 case "error":
2884 n._handleValidationError(e)(t.error);
2885 break;
2886 default:
2887 Ae(t)
2888 }
2889 }, n._handleValidationError(e))
2890 }
2891 }, this._handleValidationError = function(e) {
2892 return function(t) {
2893 n._report("error.pr.apple_pay.session_creation_failed", {
2894 error: t
2895 }), e.abort();
2896 var r = t.message;
2897 "string" == typeof r && n._controller.warn(r)
2898 }
2899 }, this._paymentAuthorized = function(e) {
2900 return function(t) {
2901 var r = t.payment,
2902 o = n._usesButtonElement() ? Mt.paymentRequestButton : null;
2903 n._controller.action.tokenizeWithData({
2904 type: "apple_pay",
2905 elementName: o,
2906 tokenData: la({}, r, {
2907 billingContact: ha(r.billingContact, n._normalizeContact)
2908 }),
2909 mids: n._mids
2910 }).then(function(t) {
2911 if ("error" === t.type) e.completePayment(window.ApplePaySession.STATUS_FAILURE), n._report("error.pr.create_token_failed", {
2912 error: t.error
2913 });
2914 else {
2915 var o = ha(r.shippingContact, n._normalizeContact),
2916 a = ha(r.billingContact, n._normalizeContact);
2917 o && n._paymentRequestOptions.requestShipping && !o.countryCode && e.completePayment(window.ApplePaySession.STATUS_INVALID_SHIPPING_POSTAL_ADDRESS);
2918 var i = ua({
2919 shippingContact: o,
2920 billingContact: a
2921 }, n._paymentRequestOptions);
2922 n._onToken(e)(la({}, i, {
2923 shippingOption: n._privateShippingOption,
2924 token: t.object
2925 }))
2926 }
2927 })
2928 }
2929 }, this._normalizeContact = function(e) {
2930 if (e.country && "string" == typeof e.country) {
2931 var t = e.country.toLowerCase().replace(/[^a-z]+/g, ""),
2932 r = void 0;
2933 return e.countryCode ? "string" == typeof e.countryCode && (r = e.countryCode.toUpperCase()) : (r = fa[t]) || n._report("warn.pr.apple_pay.missing_country_code", {
2934 country: e.country
2935 }), la({}, e, {
2936 countryCode: r
2937 })
2938 }
2939 return e
2940 }, this._onToken = function(e) {
2941 return function(t) {
2942 n._onEvent({
2943 type: "paymentresponse",
2944 payload: la({}, t, {
2945 complete: n._completePayment(e)
2946 })
2947 })
2948 }
2949 }, this._completePayment = function(e) {
2950 return function(t) {
2951 n._paymentRequestOptions = Wr(n._paymentRequestOptions, {
2952 status: t
2953 });
2954 var r = ta(n._paymentRequestOptions),
2955 o = r.status,
2956 a = r.error;
2957 a ? e.completePayment({
2958 status: o,
2959 errors: [a]
2960 }) : e.completePayment(o), (0 === o || 1 === o && null == a) && (n._isShowing = !1, n._onEvent && n._onEvent({
2961 type: "close"
2962 }))
2963 }
2964 }, this._shippingContactSelected = function(e) {
2965 return function(t) {
2966 n._onEvent({
2967 type: "shippingaddresschange",
2968 payload: {
2969 shippingAddress: ia(n._normalizeContact(t.shippingContact)),
2970 updateWith: n._completeShippingContactSelection(e)
2971 }
2972 })
2973 }
2974 }, this._completeShippingContactSelection = function(e) {
2975 return function(t) {
2976 n._paymentRequestOptions = Wr(n._paymentRequestOptions, t), n._paymentRequestOptions.shippingOptions && n._paymentRequestOptions.shippingOptions.length && (n._privateShippingOption = n._paymentRequestOptions.shippingOptions[0]);
2977 var r = ta(n._paymentRequestOptions),
2978 o = r.status,
2979 a = r.shippingMethods,
2980 i = r.total,
2981 c = r.lineItems;
2982 e.completeShippingContactSelection(o, a, i, c)
2983 }
2984 }, this._shippingMethodSelected = function(e) {
2985 return function(t) {
2986 if (n._paymentRequestOptions.shippingOptions) {
2987 var r = ca(t.shippingMethod, n._paymentRequestOptions.shippingOptions);
2988 n._privateShippingOption = r, n._onEvent({
2989 type: "shippingoptionchange",
2990 payload: {
2991 shippingOption: r,
2992 updateWith: n._completeShippingMethodSelection(e)
2993 }
2994 })
2995 }
2996 }
2997 }, this._completeShippingMethodSelection = function(e) {
2998 return function(t) {
2999 n._paymentRequestOptions = Wr(n._paymentRequestOptions, t);
3000 var r = ta(n._paymentRequestOptions),
3001 o = r.status,
3002 a = r.total,
3003 i = r.lineItems;
3004 e.completeShippingMethodSelection(o, a, i)
3005 }
3006 };
3007 var r = t.controller,
3008 o = t.authentication,
3009 a = t.mids,
3010 i = t.options,
3011 c = t.usesButtonElement;
3012 this._controller = r, this._authentication = o, this._mids = a, this._minimumVersion = i.__minApplePayVersion || Ro, this._usesButtonElement = c, this._initialPaymentRequest = i, this._isShowing = !1, this._initializeSessionState()
3013 }
3014 return pa(e, [{
3015 key: "_initializeSessionState",
3016 value: function() {
3017 this._paymentRequestOptions = la({}, mo, this._initialPaymentRequest, {
3018 status: _o.success
3019 }), this._privateSession = null, this._privateShippingOption = null;
3020 var e = this._paymentRequestOptions.shippingOptions;
3021 e && e.length && (this._privateShippingOption = e[0])
3022 }
3023 }, {
3024 key: "_setupSession",
3025 value: function(e, t) {
3026 var n = this;
3027 e.addEventListener("validatemerchant", sn(this._validateMerchant(e, t))), e.addEventListener("paymentauthorized", sn(this._paymentAuthorized(e))), e.addEventListener("cancel", sn(function() {
3028 n._isShowing = !1, n._onEvent({
3029 type: "cancel"
3030 }), n._onEvent({
3031 type: "close"
3032 })
3033 })), e.addEventListener("shippingcontactselected", sn(this._shippingContactSelected(e))), e.addEventListener("shippingmethodselected", sn(this._shippingMethodSelected(e)))
3034 }
3035 }]), e
3036 }(),
3037 ma = _a,
3038 ya = null,
3039 va = function(e) {
3040 return null !== ya ? Ne.resolve(ya) : e().then(function(e) {
3041 return ya = e
3042 })
3043 },
3044 ba = va,
3045 ga = function() {
3046 return "https:" === window.location.protocol && !(!yr && !vr)
3047 },
3048 Ea = ga,
3049 wa = Object.assign || function(e) {
3050 for (var t = 1; t < arguments.length; t++) {
3051 var n = arguments[t];
3052 for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r])
3053 }
3054 return e
3055 },
3056 Sa = function e(t) {
3057 var n = this;
3058 G(this, e), this._mids = null, this._frame = null, this._backdrop = new Hn({
3059 lockScrolling: !1,
3060 lockFocus: !0,
3061 lockFocusOn: null
3062 }), this._initFrame = function(e) {
3063 var t = n._controller.createHiddenFrame(At.PAYMENT_REQUEST_GOOGLE_PAY, {
3064 authentication: n._authentication,
3065 mids: n._mids
3066 });
3067 t.send({
3068 action: "stripe-pr-initialize",
3069 payload: {
3070 data: e
3071 }
3072 }), n._initFrameEventHandlers(t), n._frame = t
3073 }, this._initFrameEventHandlers = function(e) {
3074 e._on("pr-cancel", function() {
3075 n._onEvent({
3076 type: "cancel"
3077 })
3078 }), e._on("pr-close", function() {
3079 n._backdrop.fadeOut().then(function() {
3080 n._backdrop.unmount()
3081 }), n._onEvent({
3082 type: "close"
3083 })
3084 }), e._on("pr-error", function(e) {
3085 n._onEvent({
3086 type: "error",
3087 payload: {
3088 errorMessage: e.errorMessage,
3089 errorCode: e.errorCode
3090 }
3091 })
3092 }), e._on("pr-callback", function(t) {
3093 var r = t.event,
3094 o = t.options,
3095 a = t.nonce;
3096 switch (r) {
3097 case "paymentresponse":
3098 n._handlePaymentResponse(e, o, a);
3099 break;
3100 case "shippingaddresschange":
3101 n._handleShippingAddressChange(e, o, a);
3102 break;
3103 case "shippingoptionchange":
3104 n._handleShippingOptionChange(e, o, a);
3105 break;
3106 default:
3107 throw new Error("Unexpected event name: " + r)
3108 }
3109 })
3110 }, this._handlePaymentResponse = function(e, t, r) {
3111 var o = function(t) {
3112 e.send({
3113 action: "stripe-pr-callback-complete",
3114 payload: {
3115 nonce: r,
3116 data: {
3117 status: t
3118 }
3119 }
3120 })
3121 };
3122 n._onEvent({
3123 type: "paymentresponse",
3124 payload: wa({}, t, {
3125 complete: o
3126 })
3127 })
3128 }, this._handleShippingAddressChange = function(e, t, r) {
3129 var o = function(t) {
3130 e.send({
3131 action: "stripe-pr-callback-complete",
3132 payload: {
3133 nonce: r,
3134 data: t
3135 }
3136 })
3137 };
3138 n._onEvent({
3139 type: "shippingaddresschange",
3140 payload: wa({}, t, {
3141 updateWith: o
3142 })
3143 })
3144 }, this._handleShippingOptionChange = function(e, t, r) {
3145 var o = function(t) {
3146 e.send({
3147 action: "stripe-pr-callback-complete",
3148 payload: {
3149 nonce: r,
3150 data: t
3151 }
3152 })
3153 };
3154 n._onEvent({
3155 type: "shippingoptionchange",
3156 payload: wa({}, t, {
3157 updateWith: o
3158 })
3159 })
3160 }, this.setEventHandler = function(e) {
3161 n._onEvent = e
3162 }, this.canMakePayment = function() {
3163 if (!Ea()) return Ne.resolve(!1);
3164 if (!n._frame) throw new Error("Frame not initialized.");
3165 var e = n._frame;
3166 return ba(function() {
3167 return e.action.checkCanMakePayment().then(function(e) {
3168 return !0 === e.available
3169 })
3170 })
3171 }, this.show = function() {
3172 n._frame && (n._frame.send({
3173 action: "stripe-pr-show",
3174 payload: {
3175 data: {
3176 usesButtonElement: n._usesButtonElement()
3177 }
3178 }
3179 }), n._backdrop.mount(), n._backdrop.show(), n._backdrop.fadeIn())
3180 }, this.update = function(e) {
3181 n._frame && n._frame.send({
3182 action: "stripe-pr-update",
3183 payload: {
3184 data: e
3185 }
3186 })
3187 }, this.abort = function() {
3188 n._frame && n._frame.send({
3189 action: "stripe-pr-abort",
3190 payload: {}
3191 })
3192 }, this._controller = t.controller, this._authentication = t.authentication, this._mids = t.mids, this._usesButtonElement = t.usesButtonElement, Ea() && this._controller && (this._controller.action.fetchLocale({
3193 locale: "auto"
3194 }), this._initFrame(t.options))
3195 },
3196 Pa = Sa,
3197 Oa = function() {
3198 if (!window.PaymentRequest) return null;
3199 if (/CriOS\/59/.test(navigator.userAgent)) return null;
3200 if (/.*\(.*; wv\).*Chrome\/(?:53|54)\.\d.*/g.test(navigator.userAgent)) return null;
3201 if (mr) return null;
3202 var e = window.PaymentRequest;
3203 return e.prototype.canMakePayment || (e.prototype.canMakePayment = function() {
3204 return Ne.resolve(!1)
3205 }), e
3206 }(),
3207 ka = null,
3208 Aa = function(e, t) {
3209 return null !== ka ? Ne.resolve(ka) : Oa ? t && "https:" !== window.location.protocol ? (window.console && window.console.warn("To test Payment Request, you must serve this page over HTTPS."), Ne.resolve(!1)) : e ? e.action.checkCanMakePayment().then(function(e) {
3210 var t = e.available;
3211 return ka = !0 === t
3212 }) : Ne.resolve(!1) : Ne.resolve(!1)
3213 },
3214 Ta = Object.assign || function(e) {
3215 for (var t = 1; t < arguments.length; t++) {
3216 var n = arguments[t];
3217 for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r])
3218 }
3219 return e
3220 },
3221 Ia = function e(t) {
3222 Y(this, e), Ra.call(this);
3223 var n = t.authentication,
3224 r = t.controller,
3225 o = t.mids,
3226 a = t.usesButtonElement,
3227 i = t.options;
3228 if (this._authentication = n, this._controller = r, this._mids = o, this._usesButtonElement = a, Oa && "https:" === window.location.protocol) {
3229 this._controller.action.fetchLocale({
3230 locale: "auto"
3231 });
3232 var c = this._controller.createHiddenFrame(At.PAYMENT_REQUEST_BROWSER, {
3233 authentication: n,
3234 mids: this._mids
3235 });
3236 this._setupPrFrame(c, i), this._prFrame = c
3237 } else this._prFrame = null
3238 },
3239 Ra = function() {
3240 var e = this;
3241 this._onEvent = function() {}, this.setEventHandler = function(t) {
3242 e._onEvent = t
3243 }, this.canMakePayment = function() {
3244 return Aa(e._prFrame, Ue(e._authentication.apiKey) === Fe.test)
3245 }, this.update = function(t) {
3246 var n = e._prFrame;
3247 n && n.send({
3248 action: "stripe-pr-update",
3249 payload: {
3250 data: t
3251 }
3252 })
3253 }, this.show = function() {
3254 if (!e._prFrame) throw new ke("Payment Request is not available in this browser.");
3255 e._prFrame.send({
3256 action: "stripe-pr-show",
3257 payload: {
3258 data: {
3259 usesButtonElement: e._usesButtonElement()
3260 }
3261 }
3262 })
3263 }, this.abort = function() {
3264 e._prFrame && e._prFrame.send({
3265 action: "stripe-pr-abort",
3266 payload: {}
3267 })
3268 }, this._setupPrFrame = function(t, n) {
3269 t.send({
3270 action: "stripe-pr-initialize",
3271 payload: {
3272 data: n
3273 }
3274 }), t._on("pr-cancel", function() {
3275 e._onEvent({
3276 type: "cancel"
3277 })
3278 }), t._on("pr-close", function() {
3279 e._onEvent({
3280 type: "close"
3281 })
3282 }), t._on("pr-error", function(t) {
3283 e._onEvent({
3284 type: "error",
3285 payload: {
3286 errorMessage: t.message || "",
3287 errorCode: t.code || ""
3288 }
3289 })
3290 }), t._on("pr-callback", function(n) {
3291 var r = n.event,
3292 o = n.nonce,
3293 a = n.options;
3294 switch (r) {
3295 case "token":
3296 e._onEvent({
3297 type: "paymentresponse",
3298 payload: Ta({}, a, {
3299 complete: function(e) {
3300 t.send({
3301 action: "stripe-pr-callback-complete",
3302 payload: {
3303 data: {
3304 status: e
3305 },
3306 nonce: o
3307 }
3308 })
3309 }
3310 })
3311 });
3312 break;
3313 case "shippingaddresschange":
3314 e._onEvent({
3315 type: "shippingaddresschange",
3316 payload: {
3317 shippingAddress: a.shippingAddress,
3318 updateWith: function(e) {
3319 t.send({
3320 action: "stripe-pr-callback-complete",
3321 payload: {
3322 nonce: o,
3323 data: e
3324 }
3325 })
3326 }
3327 }
3328 });
3329 break;
3330 case "shippingoptionchange":
3331 e._onEvent({
3332 type: "shippingoptionchange",
3333 payload: {
3334 shippingOption: a.shippingOption,
3335 updateWith: function(e) {
3336 t.send({
3337 action: "stripe-pr-callback-complete",
3338 payload: {
3339 nonce: o,
3340 data: e
3341 }
3342 })
3343 }
3344 }
3345 });
3346 break;
3347 default:
3348 throw new Error("Unexpected event from PaymentRequest inner: " + r)
3349 }
3350 })
3351 }
3352 },
3353 Na = Ia,
3354 Ca = Object.assign || function(e) {
3355 for (var t = 1; t < arguments.length; t++) {
3356 var n = arguments[t];
3357 for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r])
3358 }
3359 return e
3360 },
3361 Ma = function(e) {
3362 function t(e) {
3363 V(this, t);
3364 var n = J(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this));
3365 ja.call(n), n._controller = e.controller, n._authentication = e.authentication, n._mids = e.mids, n._report("pr.options", {
3366 options: e.rawOptions
3367 });
3368 var r = Et(wo, e.rawOptions || {}, "paymentRequest()"),
3369 o = r.value;
3370 if (r.warnings.forEach(function(e) {
3371 return n._warn(e)
3372 }), o.__billingDetailsEmailOverride && o.requestPayerEmail) throw new ke("When providing `__billingDetailsEmailOverride`, `requestPayerEmail` has to be `false` so that the customer is not prompted for their email in the payment sheet.");
3373 return n._queryStrategy = e.queryStrategyOverride || To(e.betas), n._report("pr.query_strategy", {
3374 queryStrategy: n._queryStrategy
3375 }), n._initialOptions = Ca({}, o, {
3376 __skipGooglePayInPaymentRequest: -1 !== n._queryStrategy.indexOf("GOOGLE_PAY")
3377 }), n._initBackingLibraries(n._initialOptions), n
3378 }
3379 return Q(t, e), t
3380 }(fn),
3381 ja = function() {
3382 var e = this;
3383 this._usedByButtonElement = null, this._showCalledByButtonElement = !1, this._isShowing = !1, this._backingLibraries = {
3384 APPLE_PAY: null,
3385 GOOGLE_PAY: null,
3386 BROWSER: null
3387 }, this._activeBackingLibraryName = null, this._activeBackingLibrary = null, this._canMakePaymentAvailability = {
3388 APPLE_PAY: null,
3389 GOOGLE_PAY: null,
3390 BROWSER: null
3391 }, this._canMakePaymentResolved = !1, this._validateUserOn = function(t, n) {
3392 "string" == typeof t && ("source" === t && e._hasRegisteredListener("paymentmethod") || "paymentmethod" === t && e._hasRegisteredListener("source")) && (e._report("pr.double_callback_registration"), e._controller.warn("Do not register event listeners for both `source` or `paymentmethod`. Only one of them will succeed."))
3393 }, this._report = function(t, n) {
3394 e._controller.report(t, Ca({}, n, {
3395 activeBackingLibrary: e._activeBackingLibraryName,
3396 usesButtonElement: e._usedByButtonElement
3397 }))
3398 }, this._warn = function(t) {
3399 e._controller.warn(t)
3400 }, this._registerElement = function() {
3401 e._usedByButtonElement = !0
3402 }, this._elementShow = function() {
3403 e._showCalledByButtonElement = !0, e.show()
3404 }, this._initBackingLibraries = function(t) {
3405 e._queryStrategy.forEach(function(n) {
3406 var r = {
3407 controller: e._controller,
3408 authentication: e._authentication,
3409 mids: e._mids,
3410 options: t,
3411 usesButtonElement: function() {
3412 return !0 === e._usedByButtonElement
3413 }
3414 };
3415 switch (n) {
3416 case "APPLE_PAY":
3417 e._backingLibraries.APPLE_PAY = new ma(r), e._backingLibraries.APPLE_PAY.setEventHandler(e._handleInternalEvent);
3418 break;
3419 case "GOOGLE_PAY":
3420 e._backingLibraries.GOOGLE_PAY = new Pa(r), e._backingLibraries.GOOGLE_PAY.setEventHandler(e._handleInternalEvent);
3421 break;
3422 case "BROWSER":
3423 e._backingLibraries.BROWSER = new Na(r), e._backingLibraries.BROWSER.setEventHandler(e._handleInternalEvent);
3424 break;
3425 default:
3426 Ae(n)
3427 }
3428 })
3429 }, this._handleInternalEvent = function(t) {
3430 switch (t.type) {
3431 case "paymentresponse":
3432 e._emitPaymentResponse(t.payload);
3433 break;
3434 case "error":
3435 e._report("error.pr.internal_error", {
3436 error: t.payload
3437 });
3438 break;
3439 case "close":
3440 e._isShowing = !1;
3441 break;
3442 default:
3443 e._emitExternalEvent(t)
3444 }
3445 }, this._emitExternalEvent = function(t) {
3446 switch (t.type) {
3447 case "cancel":
3448 e._emit("cancel");
3449 break;
3450 case "shippingoptionchange":
3451 case "shippingaddresschange":
3452 var n = t.type,
3453 r = t.payload,
3454 o = null,
3455 a = !1,
3456 i = !1,
3457 c = function(c) {
3458 if (i && a) return e._report("pr.update_with_called_after_timeout", {
3459 event: n
3460 }), void e._controller.warn("Call to updateWith() was ignored because it has already timed out. Please ensure that updateWith is called within 30 seconds.");
3461 if (a) return e._report("pr.update_with_double_call", {
3462 event: n
3463 }), void e._controller.warn("Call to updateWith() was ignored because it has already been called. Do not call updateWith more than once.");
3464 o && clearTimeout(o), a = !0, e._report("pr.update_with", {
3465 event: n,
3466 updates: c
3467 });
3468 var s = Et(Oo, c || {}, n + " callback"),
3469 u = s.value;
3470 s.warnings.forEach(function(t) {
3471 return e._controller.warn(t)
3472 });
3473 var l = u.shippingOptions || e._initialOptions.shippingOptions;
3474 if (!("shippingaddresschange" !== t.type || u.status !== _o.success || l && l.length)) throw new ke("When requesting shipping information, you must specify shippingOptions once a shipping address is selected.\nEither provide shippingOptions in stripe.paymentRequest(...) or listen for the shippingaddresschange event and provide shippingOptions to the updateWith callback there.");
3475 r.updateWith(u)
3476 };
3477 e._hasRegisteredListener(t.type) ? (o = setTimeout(function() {
3478 i = !0, e._report("pr.update_with_timed_out", {
3479 event: n
3480 }), e._controller.warn('Timed out waiting for a call to updateWith(). If you listen to "' + t.type + '" events, then you must call event.updateWith in the "' + t.type + '" handler within 30 seconds.'), c({
3481 status: "fail"
3482 })
3483 }, 29900), e._emit(n, Ca({}, r, {
3484 updateWith: c
3485 }))) : c({
3486 status: "success"
3487 });
3488 break;
3489 case "token":
3490 case "source":
3491 case "paymentmethod":
3492 var s = t.type,
3493 u = t.payload,
3494 l = null,
3495 p = !1,
3496 d = !1,
3497 f = function(t) {
3498 if (p && d) return e._report("pr.complete_called_after_timeout"), void e._controller.warn("Call to complete() was ignored because it has already timed out. Please ensure that complete is called within 30 seconds.");
3499 if (d) return e._report("pr.complete_double_call"), void e._controller.warn("Call to complete() was ignored because it has already been called. Do not call complete more than once.");
3500 l && clearTimeout(l), d = !0;
3501 var n = Et(ko, t, "status for PaymentRequest completion"),
3502 r = n.value;
3503 n.warnings.forEach(function(t) {
3504 return e._controller.warn(t)
3505 }), u.complete(r)
3506 };
3507 l = setTimeout(function() {
3508 p = !0, e._report("pr.complete_timed_out"), e._controller.warn('Timed out waiting for a call to complete(). Once you have processed the payment in the "' + t.type + '" handler, you must call event.complete within 30 seconds.'), f("fail")
3509 }, 29900), e._emit(s, Ca({}, u, {
3510 complete: f
3511 }));
3512 break;
3513 default:
3514 Ae(t)
3515 }
3516 }, this._maybeEmitPaymentResponse = function(t) {
3517 e._isShowing && e._emitExternalEvent(t)
3518 }, this._emitPaymentResponse = function(t) {
3519 e._report("pr.payment_authorized");
3520 var n = t.token,
3521 r = K(t, ["token"]),
3522 o = r.payerEmail,
3523 a = r.payerPhone,
3524 i = r.complete,
3525 c = e._showCalledByButtonElement ? Mt.paymentRequestButton : null;
3526 e._hasRegisteredListener("token") && e._maybeEmitPaymentResponse({
3527 type: "token",
3528 payload: t
3529 }), e._hasRegisteredListener("source") && e._controller.action.createSourceWithData({
3530 elementName: c,
3531 type: "card",
3532 sourceData: {
3533 token: n.id,
3534 owner: {
3535 email: e._initialOptions.__billingDetailsEmailOverride || o,
3536 phone: a
3537 }
3538 },
3539 mids: null
3540 }).then(function(t) {
3541 "error" === t.type ? t.error.code && "email_invalid" === t.error.code ? i("invalid_payer_email") : (e._report("fatal.pr.token_to_source_failed", {
3542 error: t.error,
3543 token: n.id
3544 }), i("fail")) : e._maybeEmitPaymentResponse({
3545 type: "source",
3546 payload: Ca({}, r, {
3547 source: t.object
3548 })
3549 })
3550 }), e._hasRegisteredListener("paymentmethod") && e._controller.action.createPaymentMethodWithData({
3551 elementName: c,
3552 type: "card",
3553 paymentMethodData: {
3554 card: {
3555 token: n.id
3556 },
3557 billing_details: {
3558 email: e._initialOptions.__billingDetailsEmailOverride || o,
3559 phone: a
3560 }
3561 },
3562 mids: null
3563 }).then(function(t) {
3564 "error" === t.type ? t.error.code && "email_invalid" === t.error.code ? i("invalid_payer_email") : (e._report("fatal.pr.token_to_payment_method_failed", {
3565 error: t.error,
3566 token: n.id
3567 }), i("fail")) : e._maybeEmitPaymentResponse({
3568 type: "paymentmethod",
3569 payload: Ca({}, r, {
3570 paymentMethod: t.object
3571 })
3572 })
3573 })
3574 }, this._canMakePaymentForBackingLibrary = function(t) {
3575 var n = e._backingLibraries[t];
3576 if (!n) throw new Error("Unexpectedly calling canMakePayment on uninitialized backing library.");
3577 return Ne.race([new Ne(function(e) {
3578 return setTimeout(e, 1e4)
3579 }).then(function() {
3580 return !1
3581 }), n.canMakePayment().then(function(e) {
3582 return !!e
3583 })]).then(function(n) {
3584 return e._canMakePaymentAvailability = Ca({}, e._canMakePaymentAvailability, W({}, t, n)), {
3585 backingLibraryName: t,
3586 available: n
3587 }
3588 })
3589 }, this._constructCanMakePaymentResponse = function() {
3590 return Ca({
3591 applePay: !!e._canMakePaymentAvailability.APPLE_PAY
3592 }, -1 !== e._queryStrategy.indexOf("GOOGLE_PAY") ? {
3593 googlePay: !!e._canMakePaymentAvailability.GOOGLE_PAY
3594 } : {})
3595 }, this.canMakePayment = sn(function() {
3596 if (e._report("pr.can_make_payment"), e._canMakePaymentResolved) {
3597 var t = null !== e._activeBackingLibrary ? e._constructCanMakePaymentResponse() : null;
3598 return e._report("pr.can_make_payment_response", {
3599 response: t,
3600 cached: !0
3601 }), Ne.resolve(t)
3602 }
3603 if ("https:" !== window.location.protocol) return e._canMakePaymentResolved = !0, Ne.resolve(null);
3604 var n = e._queryStrategy.map(function(t) {
3605 return function() {
3606 return e._canMakePaymentForBackingLibrary(t)
3607 }
3608 }),
3609 r = Date.now();
3610 return uo(n, function(t) {
3611 var n = t.backingLibraryName,
3612 r = t.available;
3613 return r && (e._activeBackingLibraryName = n, e._activeBackingLibrary = e._backingLibraries[n]), r
3614 }).then(function(t) {
3615 var n = Date.now();
3616 e._canMakePaymentResolved = !0;
3617 var o = null;
3618 return "SATISFIED" === t.type && (o = e._constructCanMakePaymentResponse()), e._report("pr.can_make_payment_response", {
3619 response: o,
3620 cached: !1,
3621 duration: n - r
3622 }), o
3623 })
3624 }), this.update = sn(function(t) {
3625 if (e._isShowing) throw e._report("pr.update_called_while_showing"), new ke("You cannot update Payment Request options while the payment sheet is showing.");
3626 e._report("pr.update", {
3627 updates: t
3628 });
3629 var n = Et(So, t, "PaymentRequest update()"),
3630 r = n.value;
3631 n.warnings.forEach(function(t) {
3632 return e._warn(t)
3633 }), e._activeBackingLibrary && e._activeBackingLibrary.update(r)
3634 }), this.show = sn(function() {
3635 if (e._usedByButtonElement && !e._showCalledByButtonElement && (e._report("pr.show_called_with_button"), e._warn("Do not call show() yourself if you are using the paymentRequestButton Element. The Element handles showing the payment sheet.")), !e._canMakePaymentResolved) throw e._report("pr.show_called_before_can_make_payment"), new ke("You must first check the Payment Request API's availability using paymentRequest.canMakePayment() before calling show().");
3636 if (!e._activeBackingLibrary) throw e._report("pr.show_called_with_can_make_payment_false"), new ke("Payment Request is not available in this browser.");
3637 var t = e._activeBackingLibrary;
3638 e._report("pr.show", {
3639 listeners: Object.keys(e._callbacks).sort()
3640 }), e._isShowing = !0, t.show()
3641 }), this.abort = sn(function() {
3642 if (e._activeBackingLibrary) {
3643 var t = e._activeBackingLibrary;
3644 e._report("pr.abort"), t.abort()
3645 }
3646 })
3647 },
3648 La = Ma,
3649 xa = {
3650 base: Qe(dt),
3651 complete: Qe(dt),
3652 empty: Qe(dt),
3653 invalid: Qe(dt),
3654 paymentRequestButton: Qe(dt)
3655 },
3656 qa = {
3657 classes: Qe(vt({
3658 base: Qe(ot),
3659 complete: Qe(ot),
3660 empty: Qe(ot),
3661 focus: Qe(ot),
3662 invalid: Qe(ot),
3663 webkitAutofill: Qe(ot)
3664 })),
3665 hidePostalCode: Qe(it),
3666 hideIcon: Qe(it),
3667 style: Qe(vt(xa)),
3668 iconStyle: Qe(et("solid", "default")),
3669 value: Qe(Xe(ot, dt)),
3670 __privateCvcOptional: Qe(it),
3671 __privateValue: Qe(Xe(ot, dt)),
3672 __privateEmitIbanValue: Qe(it),
3673 error: Qe(vt({
3674 type: ot,
3675 code: Qe(ot),
3676 decline_code: Qe(ot),
3677 param: Qe(ot)
3678 })),
3679 locale: _t("elements()"),
3680 fonts: _t("elements()"),
3681 placeholder: Qe(ot),
3682 disabled: Qe(it),
3683 placeholderCountry: Qe(ot),
3684 paymentRequest: Qe(function(e, t) {
3685 return function(n, r) {
3686 return n instanceof e ? We(n) : Je("a " + t + " instance", n, r)
3687 }
3688 }(La, "stripe.paymentRequest(...)")),
3689 supportedCountries: Qe(ft(ot)),
3690 accountHolderType: Qe(et("individual", "company"))
3691 },
3692 Da = vt(qa),
3693 Ba = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
3694 return typeof e
3695 } : function(e) {
3696 return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
3697 },
3698 Fa = function(e) {
3699 return "string" == typeof e ? Ce(Object.keys(gr), function(t) {
3700 return t === e
3701 }) || null : null
3702 },
3703 Ua = function(e) {
3704 return null != e && e.__elementType && "string" == typeof e.__elementType && "function" == typeof e ? e.__elementType : null
3705 },
3706 Ha = function(e, t) {
3707 var n = Fa(e),
3708 r = "auBankAccount" === n && !Fr(t, "au_bank_account_beta_1") && !Fr(t, "au_bank_account_beta_2");
3709 if (!n || r) throw new ke("A valid Element name must be provided. Valid Elements are:\n" + Object.keys(gr).filter(function(e) {
3710 return !gr[e].beta
3711 }).join(", ") + "; you passed: " + (n || (void 0 === e ? "undefined" : Ba(e))) + ".")
3712 },
3713 za = function(e, t, n) {
3714 if (Ha(e, n), gr[e].unique && -1 !== t.indexOf(e)) throw new ke("Can only create one Element of type " + e + ".");
3715 var r = gr[e].conflict,
3716 o = je(t, r);
3717 if (o.length) {
3718 var a = o[0];
3719 throw new ke("Cannot create an Element of type " + e + " after an Element of type " + a + " has already been created.")
3720 }
3721 },
3722 Ga = "14px",
3723 Ya = function(e) {
3724 var t = e.split(" ").map(function(e) {
3725 return parseInt(e.trim(), 10)
3726 });
3727 return 1 === t.length || 2 === t.length ? 2 * t[0] : 3 === t.length || 4 === t.length ? t[0] + t[2] : 0
3728 },
3729 Wa = function() {
3730 var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "1.2em",
3731 t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : Ga,
3732 n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : "0",
3733 r = Ya(n);
3734 if ("string" == typeof e && /^[0-9.]+px$/.test(e)) {
3735 return parseFloat(e.toString().replace(/[^0-9.]/g, "")) + r + "px"
3736 }
3737 var o = parseFloat(e.toString().replace(/[^0-9.]/g, "")),
3738 a = parseFloat(Ga.replace(/[^0-9.]/g, "")),
3739 i = parseFloat(t.toString().replace(/[^0-9.]/g, "")),
3740 c = void 0;
3741 if ("string" == typeof t && /^(\d+|\d*\.\d+)px$/.test(t)) c = i;
3742 else if ("string" == typeof t && /^(\d+|\d*\.\d+)em$/.test(t)) c = i * a;
3743 else if ("string" == typeof t && /^(\d+|\d*\.\d+)%$/.test(t)) c = i / 100 * a;
3744 else {
3745 if ("string" != typeof t || !/^[\d.]+$/.test(t) && !/^\d*\.(px|em|%)$/.test(t)) return "100%";
3746 c = a
3747 }
3748 var s = o * c + r,
3749 u = s + "px";
3750 return /^[0-9.]+px$/.test(u) ? u : "100%"
3751 },
3752 Ka = Wa,
3753 Va = Object.assign || function(e) {
3754 for (var t = 1; t < arguments.length; t++) {
3755 var n = arguments[t];
3756 for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r])
3757 }
3758 return e
3759 },
3760 Ja = function() {
3761 function e(e, t) {
3762 for (var n = 0; n < t.length; n++) {
3763 var r = t[n];
3764 r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
3765 }
3766 }
3767 return function(t, n, r) {
3768 return n && e(t.prototype, n), r && e(t, r), t
3769 }
3770 }(),
3771 Qa = {
3772 base: "StripeElement",
3773 focus: "StripeElement--focus",
3774 invalid: "StripeElement--invalid",
3775 complete: "StripeElement--complete",
3776 empty: "StripeElement--empty",
3777 webkitAutofill: "StripeElement--webkit-autofill"
3778 },
3779 Xa = {
3780 margin: "0",
3781 padding: "0",
3782 border: "none",
3783 display: "block",
3784 background: "transparent",
3785 position: "relative",
3786 opacity: "1"
3787 },
3788 $a = {
3789 border: "none",
3790 display: "block",
3791 position: "absolute",
3792 height: "1px",
3793 top: "0",
3794 left: "0",
3795 padding: "0",
3796 margin: "0",
3797 width: "100%",
3798 opacity: "0",
3799 background: "transparent",
3800 "pointer-events": "none",
3801 "font-size": "16px"
3802 },
3803 Za = function(e) {
3804 return parseFloat(e.toFixed(1))
3805 },
3806 ei = function(e) {
3807 return /^\d+(\.\d*)?px$/.test(e)
3808 },
3809 ti = function(e) {
3810 function t(e) {
3811 Z(this, t);
3812 var n = ee(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this));
3813 ni.call(n);
3814 var r = e.controller,
3815 o = e.componentName,
3816 a = e.paymentRequest;
3817 n._controller = r, n._componentName = o;
3818 var i = "paymentRequestButton" === n._componentName;
3819 if (i) {
3820 if (!a) throw new ke("You must pass in a stripe.paymentRequest object in order to use this Element.");
3821 n._paymentRequest = a, n._paymentRequest._registerElement()
3822 }
3823 return n._createComponent(e, o), n._classes = Qa, n._computeCustomClasses(e.classes || {}), n._lastBackgroundColor = "", n._destroyed = !1, n._focused = !1, n._empty = !i, n._invalid = !1, n._complete = !1, n._autofilled = !1, n._lastSubmittedAt = null, n
3824 }
3825 return te(t, e), Ja(t, [{
3826 key: "_checkDestroyed",
3827 value: function() {
3828 if (this._destroyed) throw new ke("This Element has already been destroyed. Please create a new one.")
3829 }
3830 }, {
3831 key: "_isMounted",
3832 value: function() {
3833 return !!document.body && document.body.contains(this._component)
3834 }
3835 }, {
3836 key: "_mountToParent",
3837 value: function(e) {
3838 var t = this._component.parentElement,
3839 n = this._isMounted();
3840 if (e === t) {
3841 if (n) return;
3842 this.unmount(), this._mountTo(e)
3843 } else if (t) {
3844 if (n) throw new ke("This Element is already mounted. Use `unmount()` to unmount the Element before re-mounting.");
3845 this.unmount(), this._mountTo(e)
3846 } else this._mountTo(e)
3847 }
3848 }, {
3849 key: "_mountTo",
3850 value: function(e) {
3851 var t = Date.now(),
3852 n = Ln(e, null),
3853 r = !!n && "rtl" === n.getPropertyValue("direction"),
3854 o = this._paymentRequest ? this._paymentRequest._activeBackingLibraryName : null;
3855 for (this._parent = e; e.firstChild;) e.removeChild(e.firstChild);
3856 e.appendChild(this._component), this._frame.send({
3857 action: "stripe-user-mount",
3858 payload: {
3859 mountTime: t,
3860 rtl: r,
3861 paymentRequestButtonType: o
3862 }
3863 }), this._findPossibleLabel(), this._updateClasses()
3864 }
3865 }, {
3866 key: "_updateClasses",
3867 value: function() {
3868 this._parent && $t(this._parent, [
3869 [this._classes.base, !0],
3870 [this._classes.empty, this._empty],
3871 [this._classes.focus, this._focused],
3872 [this._classes.invalid, this._invalid],
3873 [this._classes.complete, this._complete],
3874 [this._classes.webkitAutofill, this._autofilled]
3875 ])
3876 }
3877 }, {
3878 key: "_removeClasses",
3879 value: function() {
3880 this._parent && $t(this._parent, [
3881 [this._classes.base, !1],
3882 [this._classes.empty, !1],
3883 [this._classes.focus, !1],
3884 [this._classes.invalid, !1],
3885 [this._classes.complete, !1],
3886 [this._classes.webkitAutofill, !1]
3887 ])
3888 }
3889 }, {
3890 key: "_findPossibleLabel",
3891 value: function() {
3892 var e = this._parent;
3893 if (e) {
3894 var t = e.getAttribute("id"),
3895 n = void 0;
3896 if (t && (n = document.querySelector("label[for='" + t + "']")), n) e.addEventListener("click", this.focus);
3897 else
3898 for (n = n || e.parentElement; n && "LABEL" !== n.nodeName;) n = n.parentElement;
3899 n ? (this._label = n, n.addEventListener("click", this.focus)) : e.addEventListener("click", this.focus)
3900 }
3901 }
3902 }, {
3903 key: "_computeCustomClasses",
3904 value: function(e) {
3905 var t = {};
3906 return Object.keys(e).forEach(function(n) {
3907 if (!Qa[n]) throw new ke(n + " is not a customizable class name.\nYou can customize: " + Object.keys(Qa).join(", "));
3908 var r = e[n] || Qa[n];
3909 t[n] = r.replace(/\./g, " ")
3910 }), this._classes = Va({}, this._classes, t), this
3911 }
3912 }, {
3913 key: "_emitEvent",
3914 value: function(e, t) {
3915 return this._emit(e, Va({
3916 elementType: this._componentName
3917 }, t))
3918 }
3919 }, {
3920 key: "_setupEvents",
3921 value: function() {
3922 var e = this;
3923 this._frame._on("redirectfocus", function(t) {
3924 var n = t.focusDirection,
3925 r = xn(e._component, n);
3926 r && r.focus()
3927 }), this._frame._on("focus", function() {
3928 e._focused = !0, e._updateClasses()
3929 }), this._frame._on("blur", function() {
3930 e._focused = !1, e._updateClasses(), e._lastSubmittedAt && "paymentRequestButton" === e._componentName && (e._controller.report("payment_request_button.sheet_visible", {
3931 latency: new Date - e._lastSubmittedAt
3932 }), e._lastSubmittedAt = null)
3933 }), this._frame._on("submit", function() {
3934 if ("paymentRequestButton" === e._componentName) {
3935 e._lastSubmittedAt = new Date;
3936 var t = !1,
3937 n = !1;
3938 e._emitEvent("click", {
3939 preventDefault: function() {
3940 e._controller.report("payment_request_button.default_prevented"), t && e._controller.warn("event.preventDefault() was called after the payment sheet was shown. Make sure to call it synchronously when handling the `click` event."), n = !0
3941 }
3942 }), !n && e._paymentRequest && (e._paymentRequest._elementShow(), t = !0)
3943 } else e._emitEvent("submit"), e._formSubmit()
3944 }), ["ready", "focus", "blur", "escape"].forEach(function(t) {
3945 e._frame._on(t, function() {
3946 e._emitEvent(t)
3947 })
3948 }), this._frame._on("change", function(t) {
3949 var n = {};
3950 ["error", "value", "empty", "complete"].concat($(kr[e._componentName] || [])).forEach(function(e) {
3951 return n[e] = t[e]
3952 }), e._emitEvent("change", n), e._empty = n.empty, e._invalid = !!n.error, e._complete = n.complete, e._updateClasses()
3953 }), this._frame._on("__privateIntegrationError", function(t) {
3954 var n = t.message;
3955 e._emitEvent("__privateIntegrationError", {
3956 message: n
3957 })
3958 }), this._frame._on("dimensions", function(t) {
3959 if (e._parent) {
3960 var n = Ln(e._parent, null);
3961 if (n) {
3962 var r = parseFloat(n.getPropertyValue("height")),
3963 o = t.height;
3964 if ("border-box" === n.getPropertyValue("box-sizing")) {
3965 var a = parseFloat(n.getPropertyValue("padding-top")),
3966 i = parseFloat(n.getPropertyValue("padding-bottom"));
3967 r = r - parseFloat(n.getPropertyValue("border-top")) - parseFloat(n.getPropertyValue("border-bottom")) - a - i
3968 }
3969 0 !== r && Za(r) < Za(o) && e._controller.report("wrapper_height_mismatch", {
3970 height: o,
3971 outer_height: r
3972 });
3973 var c = e._component.getBoundingClientRect().height;
3974 0 !== c && 0 !== o && Za(c) !== Za(o) && (e._frame.updateStyle({
3975 height: o + "px"
3976 }), e._controller.report("iframe_height_update", {
3977 height: o,
3978 calculated_height: c
3979 }))
3980 }
3981 }
3982 }), this._frame._on("autofill", function() {
3983 if (e._parent) {
3984 var t = e._parent.style.backgroundColor,
3985 n = "#faffbd" === t || "rgb(250, 255, 189)" === t;
3986 e._lastBackgroundColor = n ? e._lastBackgroundColor : t, e._parent.style.backgroundColor = "#faffbd", e._autofilled = !0, e._updateClasses()
3987 }
3988 }), this._frame._on("autofill-cleared", function() {
3989 e._autofilled = !1, e._parent && (e._parent.style.backgroundColor = e._lastBackgroundColor), e._updateClasses()
3990 })
3991 }
3992 }, {
3993 key: "_handleOutsideClick",
3994 value: function() {
3995 this._secondaryFrame && this._secondaryFrame.send({
3996 action: "stripe-outside-click",
3997 payload: {}
3998 })
3999 }
4000 }, {
4001 key: "_createSecondFrame",
4002 value: function(e, t, n) {
4003 var r = this._controller.createSecondaryElementFrame(e, Va({}, n, {
4004 componentName: t
4005 }));
4006 return r && r.on && r.on("height-change", function(e) {
4007 r.updateStyle({
4008 height: e.height + "px"
4009 })
4010 }), r
4011 }
4012 }, {
4013 key: "_createComponent",
4014 value: function(e, t) {
4015 this._createElement(e, t), this._setupEvents(), this._updateFrameHeight(e, !0)
4016 }
4017 }, {
4018 key: "_updateFrameHeight",
4019 value: function(e) {
4020 var t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1];
4021 if ("paymentRequestButton" === this._componentName) {
4022 var n = e.style && e.style.paymentRequestButton || {},
4023 r = n.height,
4024 o = "string" == typeof r ? r : void 0;
4025 (t || o) && (this._frame.updateStyle({
4026 height: o || this._lastHeight || "40px"
4027 }), this._lastHeight = o || this._lastHeight)
4028 } else {
4029 var a = e.style && e.style.base || {},
4030 i = a.lineHeight,
4031 c = a.fontSize,
4032 s = a.padding,
4033 u = "string" != typeof i || isNaN(parseFloat(i)) ? void 0 : i,
4034 l = "string" == typeof c ? c : void 0,
4035 p = "string" == typeof s ? s : void 0;
4036 if (l && !ei(l) && this._controller.warn("The fontSize style you specified (" + l + ") is not in px. We do not recommend using relative css units, as they will be calculated relative to our iframe's styles rather than your site's."), t || u || l) {
4037 var d = -1 === Ht.indexOf(this._componentName) ? void 0 : p || this._lastPadding,
4038 f = Ka(u || this._lastHeight, l || this._lastFontSize, d);
4039 this._frame.updateStyle({
4040 height: f
4041 }), this._lastFontSize = l || this._lastFontSize, this._lastHeight = u || this._lastHeight, this._lastPadding = d
4042 }
4043 }
4044 }
4045 }, {
4046 key: "_createElement",
4047 value: function(e, t) {
4048 var n = this,
4049 r = (e.classes, e.controller, e.paymentRequest, X(e, ["classes", "controller", "paymentRequest"])),
4050 o = document.createElement("div");
4051 o.className = "__PrivateStripeElement";
4052 var a = document.createElement("input");
4053 a.className = "__PrivateStripeElement-input", a.setAttribute("aria-hidden", "true"), a.setAttribute("aria-label", " "), a.setAttribute("autocomplete", "false"), a.maxLength = 1, a.disabled = !0, Zt(o, Xa), Zt(a, $a);
4054 var i = Ln(document.body),
4055 c = !!i && "rtl" === i.getPropertyValue("direction"),
4056 s = wr[t],
4057 u = Va({}, r, {
4058 rtl: c
4059 }),
4060 l = this._controller.createElementFrame(s, u);
4061 if (l._on("load", function() {
4062 a.disabled = !1
4063 }), a.addEventListener("focus", function() {
4064 l.focus()
4065 }), l.appendTo(o), Ar[t]) {
4066 var p = Ar[t].secondary;
4067 this._secondaryFrame = this._createSecondFrame(s, p, Va({}, u, {
4068 primaryElementType: t
4069 })), this._secondaryFrame.appendTo(o), window.addEventListener("click", function() {
4070 return n._handleOutsideClick()
4071 })
4072 }
4073 if (o.appendChild(a), hr && t !== Mt.paymentRequestButton) {
4074 var d = document.createElement("input");
4075 d.className = "__PrivateStripeElement-safariInput", d.setAttribute("aria-hidden", "true"), d.setAttribute("tabindex", "-1"), d.setAttribute("autocomplete", "false"), d.maxLength = 1, d.disabled = !0, Zt(d, $a), o.appendChild(d)
4076 }
4077 this._component = o, this._frame = l, this._fakeInput = a
4078 }
4079 }]), t
4080 }(fn),
4081 ni = function() {
4082 var e = this;
4083 this._paymentRequest = null, this.mount = sn(function(t) {
4084 e._checkDestroyed();
4085 var n = void 0;
4086 if (!t) throw new ke("Missing argument. Make sure to call mount() with a valid DOM element or selector.");
4087 if ("string" == typeof t) {
4088 var r = document.querySelectorAll(t);
4089 if (r.length > 1 && e._controller.warn("The selector you specified (" + t + ") applies to " + r.length + " DOM elements that are currently on the page.\nThe Stripe Element will be mounted to the first one."), !r.length) throw new ke("The selector you specified (" + t + ") applies to no DOM elements that are currently on the page.\nMake sure the element exists on the page before calling mount().");
4090 n = r[0]
4091 } else {
4092 if (!t.appendChild) throw new ke("Invalid DOM element. Make sure to call mount() with a valid DOM element or selector.");
4093 n = t
4094 }
4095 if ("INPUT" === n.nodeName) throw new ke("Stripe Elements must be mounted in a DOM element that\ncan contain child nodes. `input` elements are not permitted to have child\nnodes. Try using a `div` element instead.");
4096 if (n.children.length && e._controller.warn("This Element will be mounted to a DOM element that contains child nodes."), e._paymentRequest) {
4097 if (!e._paymentRequest._canMakePaymentResolved) throw new ke("For the paymentRequestButton Element, you must first check availability using paymentRequest.canMakePayment() before mounting the Element.");
4098 if (!e._paymentRequest._activeBackingLibraryName) throw new ke("The paymentRequestButton Element is not available in the current environment.");
4099 e._mountToParent(n)
4100 } else e._mountToParent(n)
4101 }), this.update = sn(function(t) {
4102 e._checkDestroyed();
4103 var n = Et(Da, t || {}, "element.update()"),
4104 r = n.value;
4105 if (n.warnings.forEach(function(t) {
4106 return e._controller.warn(t)
4107 }), r) {
4108 var o = r.classes,
4109 a = X(r, ["classes"]);
4110 o && (e._removeClasses(), e._computeCustomClasses(o), e._updateClasses()), e._updateFrameHeight(r), Object.keys(a).length && (e._frame.update(a), e._secondaryFrame && e._secondaryFrame.update(a))
4111 }
4112 return e
4113 }), this.focus = sn(function(t) {
4114 return e._checkDestroyed(), t && t.preventDefault(), document.activeElement && document.activeElement.blur && document.activeElement.blur(), e._fakeInput.focus(), e
4115 }), this.blur = sn(function() {
4116 return e._checkDestroyed(), e._frame.blur(), e._fakeInput.blur(), e
4117 }), this.clear = sn(function() {
4118 return e._checkDestroyed(), e._frame.clear(), e
4119 }), this.unmount = sn(function() {
4120 e._checkDestroyed();
4121 var t = e._component.parentElement,
4122 n = e._label;
4123 return t && (t.removeChild(e._component), t.removeEventListener("click", e.focus), e._removeClasses()), e._parent = null, n && (n.removeEventListener("click", e.focus), e._label = null), e._secondaryFrame && (e._secondaryFrame.unmount(), window.removeEventListener("click", e._handleOutsideClick)), e._fakeInput.disabled = !0, e._frame.unmount(), e
4124 }), this.destroy = sn(function() {
4125 return e._checkDestroyed(), e.unmount(), e._destroyed = !0, e._emitEvent("destroy"), e
4126 }), this._formSubmit = function() {
4127 for (var t = e._component.parentElement; t && "FORM" !== t.nodeName;) t = t.parentElement;
4128 if (t) {
4129 var n = document.createEvent("Event");
4130 n.initEvent("submit", !0, !0), t.dispatchEvent(n)
4131 }
4132 }
4133 },
4134 ri = ti,
4135 oi = Object.assign || function(e) {
4136 for (var t = 1; t < arguments.length; t++) {
4137 var n = arguments[t];
4138 for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r])
4139 }
4140 return e
4141 },
4142 ai = {
4143 locale: Qe(ot),
4144 fonts: Qe(ft(dt)),
4145 betas: Qe(ft(tt.apply(void 0, oe(Br))))
4146 },
4147 ii = vt(ai),
4148 ci = function e(t, n) {
4149 var r = this;
4150 re(this, e), si.call(this);
4151 var o = Et(ii, n || {}, "elements()"),
4152 a = o.value;
4153 o.warnings.forEach(function(e) {
4154 return t.warn(e)
4155 }), qr(t.warn), t.report("elements", {
4156 options: n
4157 }), this._elements = [], this._id = Gt("elements"), this._controller = t;
4158 var i = a.locale,
4159 c = a.fonts || [];
4160 this._controller.action.fetchLocale({
4161 locale: i || "auto"
4162 }), this._betas = a.betas || [];
4163 var s = c.filter(function(e) {
4164 return !e.cssSrc || "string" != typeof e.cssSrc
4165 }).map(function(e) {
4166 return oi({}, e, {
4167 __resolveFontRelativeTo: window.location.href
4168 })
4169 }),
4170 u = c.map(function(e) {
4171 return e.cssSrc
4172 }).reduce(function(e, t) {
4173 return "string" == typeof t ? [].concat(oe(e), [t]) : e
4174 }, []).map(function(e) {
4175 return St(e) ? e : Ot(window.location.href, e)
4176 });
4177 this._pendingFonts = u.length;
4178 var l = (a.betas, ne(a, ["betas"]));
4179 return this._commonOptions = oi({}, l, {
4180 fonts: s
4181 }), u.forEach(function(e) {
4182 if ("string" == typeof e) {
4183 var t = Date.now();
4184 co(e).then(function(n) {
4185 r._controller.report("font.loaded", {
4186 load_time: Date.now() - t,
4187 font_count: n.length,
4188 css_src: e
4189 });
4190 var o = n.map(function(t) {
4191 return oi({}, t, {
4192 __resolveFontRelativeTo: e
4193 })
4194 });
4195 r._controller.action.updateCSSFonts({
4196 fonts: o,
4197 groupId: r._id
4198 }), r._commonOptions = oi({}, r._commonOptions, {
4199 fonts: [].concat(oe(r._commonOptions.fonts ? r._commonOptions.fonts : []), oe(o))
4200 })
4201 }).catch(function(n) {
4202 r._controller.report("error.font.not_loaded", {
4203 load_time: Date.now() - t,
4204 message: n && n.message && n.message,
4205 css_src: e
4206 }), r._controller.warn("Failed to load CSS file at " + e + ".")
4207 })
4208 }
4209 }), this
4210 },
4211 si = function() {
4212 var e = this;
4213 this.getElement = sn(function(t) {
4214 var n = Ua(t) || t;
4215 return Ha(n, e._betas), Ce(e._elements, function(e) {
4216 return e._componentName === n
4217 }) || null
4218 }), this.create = un(function(t, n) {
4219 za(t, e._elements.map(function(e) {
4220 return e._componentName
4221 }), e._betas);
4222 var r = Et(Da, n || {}, "create()"),
4223 o = r.value;
4224 r.warnings.forEach(function(t) {
4225 return e._controller.warn(t)
4226 });
4227 var a = oi({}, o, e._commonOptions, {
4228 componentName: t,
4229 groupId: e._id
4230 }),
4231 i = (dr || fr) && Vt(a).length > 2e3,
4232 c = !!e._pendingFonts || i,
4233 s = new ri(oi({}, a, {
4234 fonts: i ? null : e._commonOptions.fonts,
4235 controller: e._controller,
4236 wait: c
4237 }));
4238 return e._elements = [].concat(oe(e._elements), [s]), s._on("destroy", function() {
4239 e._elements = e._elements.filter(function(e) {
4240 return e._componentName !== t
4241 })
4242 }), i && s._frame.send({
4243 action: "stripe-user-update",
4244 payload: {
4245 fonts: e._commonOptions.fonts
4246 }
4247 }), s
4248 })
4249 },
4250 ui = ci,
4251 li = function(e, t, n, r, o, a) {
4252 return new La({
4253 controller: e,
4254 authentication: t,
4255 mids: n,
4256 rawOptions: r,
4257 betas: o,
4258 queryStrategyOverride: a
4259 })
4260 },
4261 pi = li,
4262 di = {
4263 _componentName: ot,
4264 _frame: vt({
4265 id: ot
4266 })
4267 },
4268 fi = vt(di),
4269 hi = function(e) {
4270 var t = gt(fi, e, "");
4271 return "error" === t.type ? null : t.value
4272 },
4273 _i = {
4274 au_becs_debit: "au_becs_debit",
4275 bacs_debit: "bacs_debit",
4276 bancontact: "bancontact",
4277 card: "card",
4278 eps: "eps",
4279 fpx: "fpx",
4280 giropay: "giropay",
4281 grabpay: "grabpay",
4282 ideal: "ideal",
4283 oxxo: "oxxo",
4284 p24: "p24",
4285 sepa_debit: "sepa_debit",
4286 sofort: "sofort",
4287 three_d_secure: "three_d_secure"
4288 },
4289 mi = (Pe = {}, ae(Pe, Mt.auBankAccount, _i.au_becs_debit), ae(Pe, Mt.card, _i.card), ae(Pe, Mt.cardNumber, _i.card), ae(Pe, Mt.cardExpiry, _i.card), ae(Pe, Mt.cardCvc, _i.card), ae(Pe, Mt.postalCode, _i.card), ae(Pe, Mt.iban, _i.sepa_debit), ae(Pe, Mt.idealBank, _i.ideal), ae(Pe, Mt.fpxBank, _i.fpx), Pe),
4290 yi = function(e) {
4291 return -1 === qt.indexOf(e)
4292 },
4293 vi = function(e, t) {
4294 return null != t ? t : yi(e) ? null : mi[e] || null
4295 },
4296 bi = Object.assign || function(e) {
4297 for (var t = 1; t < arguments.length; t++) {
4298 var n = arguments[t];
4299 for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r])
4300 }
4301 return e
4302 },
4303 gi = function(e, t) {
4304 switch (e.type) {
4305 case "object":
4306 return {
4307 paymentIntent: e.object
4308 };
4309 case "error":
4310 return {
4311 error: bi({}, t ? {
4312 payment_intent: t
4313 } : {}, e.error)
4314 };
4315 default:
4316 return Ae(e)
4317 }
4318 },
4319 Ei = function(e) {
4320 switch (e.type) {
4321 case "error":
4322 return {
4323 error: e.error
4324 };
4325 case "object":
4326 return {
4327 setupIntent: e.object
4328 };
4329 default:
4330 return Ae(e)
4331 }
4332 },
4333 wi = function(e) {
4334 var t = e.trim().match(/^([a-z]+_[^_]+)_secret_[^-]+$/);
4335 return t ? {
4336 id: t[1],
4337 clientSecret: t[0]
4338 } : null
4339 },
4340 Si = function(e) {
4341 return {
4342 id: e.id,
4343 clientSecret: e.client_secret
4344 }
4345 },
4346 Pi = function(e) {
4347 return "requires_source_action" === e || "requires_action" === e
4348 },
4349 Oi = function(e) {
4350 return "requires_source_action" === e.status || "requires_action" === e.status ? e.next_action : null
4351 },
4352 ki = Object.assign || function(e) {
4353 for (var t = 1; t < arguments.length; t++) {
4354 var n = arguments[t];
4355 for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r])
4356 }
4357 return e
4358 },
4359 Ai = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
4360 return typeof e
4361 } : function(e) {
4362 return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
4363 },
4364 Ti = function(e, t) {
4365 if ("string" != typeof e) return Je("a client_secret string", e, t);
4366 var n = wi(e);
4367 return null === n ? Je("a client secret of the form ${id}_secret_${secret}", e, t) : We(n, [])
4368 },
4369 Ii = function(e, t) {
4370 if (null === e) return Ve("object", "null", t);
4371 if ("object" !== (void 0 === e ? "undefined" : Ai(e))) return Ve("object", void 0 === e ? "undefined" : Ai(e), t);
4372 var n = e.client_secret,
4373 r = e.status,
4374 o = e.next_action,
4375 a = Ti(n, bt(t, "client_secret"));
4376 if ("error" === a.type) return a;
4377 if ("string" != typeof r) return Ve("string", void 0 === r ? "undefined" : Ai(r), bt(t, "status"));
4378 if (("requires_source_action" === r || "requires_action" === r) && "object" !== (void 0 === o ? "undefined" : Ai(o))) return Ve("object", void 0 === o ? "undefined" : Ai(o), bt(t, "next_action"));
4379 if ("payment_intent" === e.object) {
4380 return We(e, [])
4381 }
4382 return We(e, [])
4383 },
4384 Ri = function(e) {
4385 return function(t, n) {
4386 if ("object" !== (void 0 === t ? "undefined" : Ai(t))) return Ve("object", void 0 === t ? "undefined" : Ai(t), n);
4387 if (null === t) return Ve("object", "null", n);
4388 var r = t.type,
4389 o = ce(t, ["type"]),
4390 a = void 0;
4391 if (null === e) {
4392 if ("string" != typeof r) return Ve("string", void 0 === r ? "undefined" : Ai(r), bt(n, "type"));
4393 a = r
4394 } else {
4395 if (void 0 !== r && r !== e) return "string" != typeof r ? Ve("string", void 0 === r ? "undefined" : Ai(r), bt(n, "type")) : Ve('"' + r + '"', '"' + e + '"', bt(n, "type"));
4396 a = e
4397 }
4398 var i = ["bancontact", "eps", "giropay", "oxxo", "p24"],
4399 c = o[a],
4400 s = (o[a], ce(o, [a]));
4401 if (-1 !== i.indexOf(a) && void 0 === c && (c = {}), "object" !== (void 0 === c ? "undefined" : Ai(c))) return Ve("object or element", Ai(t[a]), bt(n, a));
4402 if (null === c) return Ve("object or element", "null", bt(n, a));
4403 var u = hi(c);
4404 if (u) {
4405 var l = u._componentName;
4406 if (mi[l] !== a) {
4407 var p = [].concat(ie(n.path), [a]).join("."),
4408 d = n.label,
4409 f = new ke("Invalid value for " + d + ": " + p + " was `" + l + "` Element, which cannot be used to create " + a + " PaymentMethods.");
4410 return Ke(f)
4411 }
4412 return We({
4413 type: a,
4414 element: u,
4415 data: s
4416 })
4417 }
4418 return We({
4419 type: a,
4420 element: null,
4421 data: o
4422 })
4423 }
4424 },
4425 Ni = function(e) {
4426 return function(t, n) {
4427 if (null == t) return We(null);
4428 if ("object" !== (void 0 === t ? "undefined" : Ai(t))) return Ve("object", void 0 === t ? "undefined" : Ai(t), n);
4429 var r = t.card,
4430 o = ce(t, ["card"]);
4431 if (!r || "object" !== (void 0 === r ? "undefined" : Ai(r))) return We(t);
4432 var a = r.cvc,
4433 i = ce(r, ["cvc"]);
4434 if (null == a) return We(t);
4435 var c = hi(a),
4436 s = c ? c._componentName : "";
4437 return Mt.cardCvc !== s ? Ve("`" + Mt.cardCvc + "` Element", s ? "`" + s + "` Element" : void 0 === a ? "undefined" : Ai(a), bt(n, e + ".cvc")) : We(ki({}, o, {
4438 card: ki({}, i, {
4439 cvc: c
4440 })
4441 }))
4442 }
4443 },
4444 Ci = at(vt({
4445 handleActions: at(it, function() {
4446 return !0
4447 })
4448 }), function() {
4449 return {
4450 handleActions: !0
4451 }
4452 }),
4453 Mi = function(e, t) {
4454 return function(n, r) {
4455 if (void 0 === n) return We({
4456 paymentMethodData: null,
4457 paymentMethodOptions: null,
4458 source: null,
4459 paymentMethod: null,
4460 otherParams: {}
4461 });
4462 if ("object" !== (void 0 === n ? "undefined" : Ai(n))) return Ve("object", void 0 === n ? "undefined" : Ai(n), r);
4463 if (null === n) return Ve("object", "null", r);
4464 var o = n.source,
4465 a = n.source_data,
4466 i = n.payment_method_data,
4467 c = n.payment_method_options,
4468 s = n.payment_method,
4469 u = ce(n, ["source", "source_data", "payment_method_data", "payment_method_options", "payment_method"]);
4470 if (null != a) throw new ke(t + ": Expected payment_method, or source, not source_data.");
4471 if (null != i) throw new ke(t + ": Expected payment_method, or source, not payment_method_data.");
4472 if (null != o && null != s) throw new ke(t + ": Expected either payment_method or source, but not both.");
4473 if (null != o) return "string" != typeof o ? Ve("string", void 0 === o ? "undefined" : Ai(o), bt(r, "source")) : We({
4474 source: o,
4475 paymentMethodData: null,
4476 paymentMethodOptions: null,
4477 paymentMethod: null,
4478 otherParams: u
4479 });
4480 if (null != s && "string" != typeof s && "object" !== (void 0 === s ? "undefined" : Ai(s))) return Ve("string or object", void 0 === s ? "undefined" : Ai(s), bt(r, "payment_method"));
4481 var l = gt(Ni(e), c, t, {
4482 path: [].concat(ie(r.path), ["payment_method_options"])
4483 });
4484 if ("error" === l.type) return l;
4485 if ("string" == typeof s) return We({
4486 source: null,
4487 paymentMethodData: null,
4488 paymentMethodOptions: l.value,
4489 paymentMethod: s,
4490 otherParams: u
4491 });
4492 if ("object" === (void 0 === s ? "undefined" : Ai(s)) && null !== s) {
4493 var p = gt(Ri(e), s, t, {
4494 path: [].concat(ie(r.path), ["payment_method"])
4495 });
4496 if ("error" === p.type) return p;
4497 var d = p.value;
4498 return We({
4499 source: null,
4500 paymentMethod: null,
4501 paymentMethodOptions: l.value,
4502 paymentMethodData: d,
4503 otherParams: u
4504 })
4505 }
4506 return We({
4507 source: null,
4508 paymentMethodData: null,
4509 paymentMethodOptions: null,
4510 paymentMethod: null,
4511 otherParams: u
4512 })
4513 }
4514 },
4515 ji = function(e) {
4516 var t = e.name,
4517 n = e.value,
4518 r = e.expiresIn,
4519 o = e.path,
4520 a = e.domain,
4521 i = new Date,
4522 c = r || 31536e6;
4523 i.setTime(i.getTime() + c);
4524 var s = o || "/",
4525 u = (n || "").replace(/[^!#-+\--:<-[\]-~]/g, encodeURIComponent),
4526 l = encodeURIComponent(t) + "=" + u + ";expires=" + i.toGMTString() + ";path=" + s + ";SameSite=Lax";
4527 return a && (l += ";domain=" + a), document.cookie = l, l
4528 },
4529 Li = function(e) {
4530 var t = Ce(document.cookie.split("; "), function(t) {
4531 var n = t.indexOf("=");
4532 return decodeURIComponent(t.substr(0, n)) === e
4533 });
4534 if (t) {
4535 var n = t.indexOf("=");
4536 return decodeURIComponent(t.substr(n + 1))
4537 }
4538 return null
4539 },
4540 xi = function() {
4541 function e(e, t) {
4542 for (var n = 0; n < t.length; n++) {
4543 var r = t[n];
4544 r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
4545 }
4546 }
4547 return function(t, n, r) {
4548 return n && e(t.prototype, n), r && e(t, r), t
4549 }
4550 }(),
4551 qi = "__privateStripeMetricsController",
4552 Di = {
4553 MERCHANT: "merchant",
4554 SESSION: "session"
4555 },
4556 Bi = function() {
4557 function e() {
4558 var t = this,
4559 n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
4560 if (se(this, e), n.checkoutIds) {
4561 var r = n.checkoutIds,
4562 o = r.muid,
4563 a = r.sid;
4564 this._muid = o, this._sid = a, this._doNotPersist = !0
4565 } else this._muid = this._getID(Di.MERCHANT), this._sid = this._getID(Di.SESSION), this._doNotPersist = !1;
4566 this._id = Gt(qi), this._controllerFrame = new On(At.METRICS_CONTROLLER, this._id, {
4567 autoload: !0,
4568 queryString: this._buildFrameQueryString()
4569 }), this._guidPromise = new Ne(function(e) {
4570 t._establishMessageChannel(e)
4571 }), this._startIntervalCheck(), setTimeout(this._testLatency.bind(this), 2e3 + 500 * Math.random())
4572 }
4573 return xi(e, [{
4574 key: "ids",
4575 value: function() {
4576 return {
4577 guid: this._guid || "NA",
4578 muid: this._muid || "NA",
4579 sid: this._sid || "NA"
4580 }
4581 }
4582 }, {
4583 key: "idsPromise",
4584 value: function() {
4585 var e = this;
4586 return this._guidPromise.then(function() {
4587 return e.ids()
4588 })
4589 }
4590 }, {
4591 key: "_establishMessageChannel",
4592 value: function(e) {
4593 var t = this;
4594 window.addEventListener("message", function(n) {
4595 var r = n.data;
4596 if ("string" == typeof r) try {
4597 var o = JSON.parse(r),
4598 a = o.originatingScript,
4599 i = o.payload;
4600 "m" === a && (t._guid = i, e(i))
4601 } catch (e) {}
4602 })
4603 }
4604 }, {
4605 key: "_startIntervalCheck",
4606 value: function() {
4607 var e = this,
4608 t = window.location.href;
4609 setInterval(function() {
4610 var n = window.location.href;
4611 n !== t && (e.send({
4612 action: "ping",
4613 payload: {
4614 sid: e._getID(Di.SESSION),
4615 muid: e._getID(Di.MERCHANT),
4616 title: document.title,
4617 referrer: document.referrer,
4618 url: document.location.href
4619 }
4620 }), t = n)
4621 }, 5e3)
4622 }
4623 }, {
4624 key: "report",
4625 value: function(e, t) {
4626 try {
4627 this.send({
4628 action: "track",
4629 payload: {
4630 sid: this._getID(Di.SESSION),
4631 muid: this._getID(Di.MERCHANT),
4632 url: document.location.href,
4633 source: e,
4634 data: t
4635 }
4636 })
4637 } catch (e) {}
4638 }
4639 }, {
4640 key: "send",
4641 value: function(e) {
4642 var t = Nt(At.METRICS_CONTROLLER);
4643 tr(t) && this._controllerFrame.send(e)
4644 }
4645 }, {
4646 key: "_testLatency",
4647 value: function() {
4648 var e = this,
4649 t = [],
4650 n = new Date,
4651 r = function r() {
4652 try {
4653 var o = new Date;
4654 t.push(o - n), t.length >= 10 && (e.report("mouse-timings-10", t), document.removeEventListener("mousemove", r)), n = o
4655 } catch (e) {}
4656 };
4657 document.addEventListener("mousemove", r)
4658 }
4659 }, {
4660 key: "_extractMetaReferrerPolicy",
4661 value: function() {
4662 var e = document.querySelector("meta[name=referrer]");
4663 return null != e && e instanceof HTMLMetaElement ? e.content.toLowerCase() : null
4664 }
4665 }, {
4666 key: "_extractUrl",
4667 value: function(e) {
4668 var t = document.location.href;
4669 switch (e) {
4670 case "origin":
4671 case "strict-origin":
4672 case "origin-when-cross-origin":
4673 case "strict-origin-when-cross-origin":
4674 return document.location.origin;
4675 case "unsafe-url":
4676 return t.split("#")[0];
4677 default:
4678 return t
4679 }
4680 }
4681 }, {
4682 key: "_buildFrameQueryString",
4683 value: function() {
4684 var e = this._extractMetaReferrerPolicy(),
4685 t = this._extractUrl(e),
4686 n = {
4687 url: t,
4688 title: document.title,
4689 referrer: document.referrer,
4690 muid: this._muid,
4691 sid: this._sid,
4692 preview: nr(t)
4693 };
4694 return null != e && (n.metaReferrerPolicy = e), Object.keys(n).map(function(e) {
4695 return null != n[e] ? e + "=" + encodeURIComponent(n[e].toString()) : null
4696 }).join("&")
4697 }
4698 }, {
4699 key: "_getID",
4700 value: function(e) {
4701 switch (e) {
4702 case Di.MERCHANT:
4703 if (this._doNotPersist) return this._muid;
4704 try {
4705 var t = Li("__stripe_mid") || Yt();
4706 return ji({
4707 name: "__stripe_mid",
4708 value: t,
4709 domain: "." + document.location.hostname
4710 }), t
4711 } catch (e) {
4712 return "NA"
4713 }
4714 case Di.SESSION:
4715 if (this._doNotPersist) return this._sid;
4716 try {
4717 var n = Li("__stripe_sid") || Yt();
4718 return ji({
4719 name: "__stripe_sid",
4720 value: n,
4721 domain: "." + document.location.hostname,
4722 expiresIn: 18e5
4723 }), n
4724 } catch (e) {
4725 return "NA"
4726 }
4727 default:
4728 throw new Error("Invalid ID type specified: " + e)
4729 }
4730 }
4731 }]), e
4732 }(),
4733 Fi = Bi,
4734 Ui = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
4735 return typeof e
4736 } : function(e) {
4737 return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
4738 },
4739 Hi = function(e) {
4740 if (!e || "object" !== (void 0 === e ? "undefined" : Ui(e))) return null;
4741 var t = e.type,
4742 n = ue(e, ["type"]);
4743 return {
4744 type: "string" == typeof t ? t : null,
4745 data: n
4746 }
4747 },
4748 zi = function(e) {
4749 switch (e.type) {
4750 case "object":
4751 return {
4752 source: e.object
4753 };
4754 case "error":
4755 return {
4756 error: e.error
4757 };
4758 default:
4759 return Ae(e)
4760 }
4761 },
4762 Gi = {
4763 source: vt({
4764 id: Ze("src_"),
4765 client_secret: Ze("src_client_secret_")
4766 })
4767 },
4768 Yi = vt(Gi),
4769 Wi = function(e) {
4770 switch (e.type) {
4771 case "object":
4772 return {
4773 paymentMethod: e.object
4774 };
4775 case "error":
4776 return {
4777 error: e.error
4778 };
4779 default:
4780 return Ae(e)
4781 }
4782 },
4783 Ki = function(e) {
4784 return Et(Ri(null), e, "createPaymentMethod").value
4785 },
4786 Vi = function(e, t, n, r, o) {
4787 var a = hi(r),
4788 i = Hi(a ? o : r),
4789 c = i || {
4790 type: null,
4791 data: {}
4792 },
4793 s = c.type,
4794 u = c.data;
4795 if (s && n !== s) return Ne.reject(new ke("The type supplied in payment_method_data is not consistent."));
4796 if (a) {
4797 var l = a._frame.id,
4798 p = a._componentName;
4799 return e.action.createPaymentMethodWithElement({
4800 frameId: l,
4801 elementName: p,
4802 type: n,
4803 paymentMethodData: u,
4804 mids: t
4805 }).then(Wi)
4806 }
4807 return i ? e.action.createPaymentMethodWithData({
4808 elementName: null,
4809 type: n,
4810 paymentMethodData: u,
4811 mids: t
4812 }).then(Wi) : Ne.reject(new ke("Please provide either an Element or PaymentMethod creation parameters to createPaymentMethod."))
4813 },
4814 Ji = function(e, t, n, r, o) {
4815 if ("string" == typeof n) return Vi(e, t, n, r, o);
4816 try {
4817 var a = Ki(n),
4818 i = a.element,
4819 c = a.type,
4820 s = a.data;
4821 if (i) {
4822 var u = i._frame.id,
4823 l = i._componentName;
4824 return e.action.createPaymentMethodWithElement({
4825 frameId: u,
4826 elementName: l,
4827 type: c,
4828 paymentMethodData: s,
4829 mids: t
4830 }).then(Wi)
4831 }
4832 return e.action.createPaymentMethodWithData({
4833 elementName: null,
4834 type: c,
4835 paymentMethodData: s,
4836 mids: t
4837 }).then(Wi)
4838 } catch (e) {
4839 return Ne.reject(e)
4840 }
4841 },
4842 Qi = function(e) {
4843 return "https://stripe.com/docs/stripe-js/reference#stripe-" + e.split(/(?=[A-Z])/).join("-").toLowerCase()
4844 },
4845 Xi = function(e, t) {
4846 return Et(Ti, e, "stripe." + t + " intent secret").value
4847 },
4848 $i = function(e, t) {
4849 return Et(Ci, t, e).value
4850 },
4851 Zi = function(e, t, n) {
4852 if ("valid" === gt(fi, n, t).type) throw new ke("Do not pass an Element to stripe." + t + "() directly.\nFor more information: " + Qi(t));
4853 var r = Et(Mi(e, t), n, t),
4854 o = r.value,
4855 a = o.source,
4856 i = o.paymentMethodData,
4857 c = o.paymentMethodOptions,
4858 s = o.paymentMethod,
4859 u = o.otherParams;
4860 if (null != a && (null != i || null != s)) throw new ke(t + ": Expected either source or payment_method, but not both.");
4861 return i ? i.element ? {
4862 confirmMode: {
4863 tag: "paymentMethod-from-element",
4864 type: e,
4865 elementName: i.element._componentName,
4866 frameId: i.element._frame.id,
4867 data: i.data,
4868 options: c
4869 },
4870 otherParams: u
4871 } : {
4872 confirmMode: {
4873 tag: "paymentMethod-from-data",
4874 type: e,
4875 data: i.data,
4876 options: c
4877 },
4878 otherParams: u
4879 } : s ? {
4880 confirmMode: {
4881 tag: "paymentMethod",
4882 paymentMethod: s,
4883 options: c
4884 },
4885 otherParams: u
4886 } : a ? {
4887 confirmMode: {
4888 tag: "source",
4889 source: a
4890 },
4891 otherParams: u
4892 } : {
4893 confirmMode: {
4894 tag: "none"
4895 },
4896 otherParams: u
4897 }
4898 },
4899 ec = function(e, t) {
4900 var n = {
4901 skipFingerprint: !1,
4902 sandboxFingerprintFrame: !1,
4903 sandboxChallengeFrame: !1
4904 };
4905 return -1 !== e.indexOf("Y") && (t.report("3ds2.optimization.Y"), n.skipFingerprint = !0), -1 !== e.indexOf("k") && (t.report("3ds2.optimization.k"), n.sandboxFingerprintFrame = !0), -1 !== e.indexOf("5") && (t.report("3ds2.optimization.5"), n.sandboxChallengeFrame = !0), n
4906 },
4907 tc = function(e) {
4908 return {
4909 american_express: "amex",
4910 visa: "visa",
4911 mastercard: "mastercard",
4912 discover: "discover"
4913 } [e] || "unknown"
4914 },
4915 nc = function(e, t, n) {
4916 if (!e) return null;
4917 if ("use_stripe_sdk" === e.type) {
4918 var r = e.use_stripe_sdk;
4919 switch (r.type) {
4920 case "stripe_3ds2_fingerprint":
4921 return {
4922 type: "3ds2-fingerprint", threeDS2Source: r.three_d_secure_2_source, cardBrand: tc(r.directory_server_name), transactionId: r.server_transaction_id, optimizations: ec(r.three_ds_optimizations, n), methodUrl: r.three_ds_method_url
4923 };
4924 case "stripe_3ds2_challenge":
4925 return {
4926 type: "3ds2-challenge", threeDS2Source: r.stripe_js.three_d_secure_2_source, cardBrand: tc(r.stripe_js.directory_server_name), transactionId: r.stripe_js.server_transaction_id, optimizations: ec(r.stripe_js.three_ds_optimizations, n), acsTransactionId: r.stripe_js.acs_transaction_id, acsUrl: r.stripe_js.acs_url
4927 };
4928 case "three_d_secure_redirect":
4929 return {
4930 type: "3ds1-modal", url: r.stripe_js, source: r.source
4931 }
4932 }
4933 }
4934 if ("redirect_to_url" === e.type) return {
4935 type: "redirect",
4936 redirectUrl: e.redirect_to_url.url
4937 };
4938 if ("display_oxxo_details" === e.type) return {
4939 type: "oxxo-display"
4940 };
4941 if ("authorize_with_url" === e.type) {
4942 var o = e.authorize_with_url.url;
4943 switch (t) {
4944 case _i.card:
4945 return {
4946 type: "3ds1-modal", url: o, source: null
4947 };
4948 case _i.ideal:
4949 return {
4950 type: "redirect", redirectUrl: o
4951 }
4952 }
4953 }
4954 return null
4955 },
4956 rc = function(e) {
4957 switch (e.type) {
4958 case "error":
4959 return {
4960 error: e.error
4961 };
4962 case "object":
4963 switch (e.object.object) {
4964 case "payment_intent":
4965 return {
4966 paymentIntent: e.object
4967 };
4968 case "setup_intent":
4969 return {
4970 setupIntent: e.object
4971 };
4972 default:
4973 return Ae(e.object)
4974 }
4975 default:
4976 return Ae(e)
4977 }
4978 },
4979 oc = function(e, t, n, r) {
4980 return t === Lt.PAYMENT_INTENT ? n.action.retrievePaymentIntent({
4981 hosted: !1,
4982 intentSecret: e,
4983 locale: r,
4984 asErrorIfNotSucceeded: !0
4985 }).then(rc) : n.action.retrieveSetupIntent({
4986 hosted: !1,
4987 intentSecret: e,
4988 locale: r,
4989 asErrorIfNotSucceeded: !0
4990 }).then(rc)
4991 },
4992 ac = function(e, t, n, r, o) {
4993 return t === Lt.PAYMENT_INTENT ? n.action.cancelPaymentIntentSource({
4994 intentSecret: e,
4995 locale: o,
4996 sourceId: r
4997 }).then(rc) : n.action.cancelSetupIntentSource({
4998 intentSecret: e,
4999 locale: o,
5000 sourceId: r
5001 }).then(rc)
5002 },
5003 ic = function() {
5004 function e(e, t) {
5005 var n = [],
5006 r = !0,
5007 o = !1,
5008 a = void 0;
5009 try {
5010 for (var i, c = e[Symbol.iterator](); !(r = (i = c.next()).done) && (n.push(i.value), !t || n.length !== t); r = !0);
5011 } catch (e) {
5012 o = !0, a = e
5013 } finally {
5014 try {
5015 !r && c.return && c.return()
5016 } finally {
5017 if (o) throw a
5018 }
5019 }
5020 return n
5021 }
5022 return function(t, n) {
5023 if (Array.isArray(t)) return t;
5024 if (Symbol.iterator in Object(t)) return e(t, n);
5025 throw new TypeError("Invalid attempt to destructure non-iterable instance")
5026 }
5027 }(),
5028 cc = Object.assign || function(e) {
5029 for (var t = 1; t < arguments.length; t++) {
5030 var n = arguments[t];
5031 for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r])
5032 }
5033 return e
5034 },
5035 sc = function(e, t, n, r, o) {
5036 return e.createLightboxFrame(At.AUTHORIZE_WITH_URL, cc({
5037 url: t,
5038 locale: o,
5039 intentId: n
5040 }, r ? {
5041 source: r
5042 } : {}))
5043 },
5044 uc = function(e, t, n, r, o) {
5045 var a = xr(),
5046 i = Date.now(),
5047 c = sc(r, e.url, t.id, e.source, o);
5048 c.show(), r.report("authorize_with_url.loading", {
5049 viewport: a,
5050 intentId: t.id
5051 }), c._on("load", function() {
5052 r.report("authorize_with_url.loaded", {
5053 loadDuration: Date.now() - i,
5054 intentId: t.id
5055 }), c.fadeInBackdrop()
5056 });
5057 var s = function(e) {
5058 return !(!e.code || !e.type) && !(!e.payment_intent && !e.setup_intent)
5059 };
5060 return c._on("challenge_complete", function() {
5061 c.fadeOutBackdrop()
5062 }), new Ne(function(a, u) {
5063 var l = e.source;
5064 l && c._once("cancel", function() {
5065 c.fadeOutBackdrop(), Ne.all([ac(t, n, r, l, o), c.destroy()]).then(function(e) {
5066 var t = ic(e, 1),
5067 n = t[0];
5068 return a(n)
5069 })
5070 }), c._once("authorize_with_url_done", function(e) {
5071 r.report("authorize_with_url.done", {
5072 shownDuration: Date.now() - i,
5073 success: !("error" in e),
5074 intentId: t.id
5075 });
5076 var u = function() {
5077 return Ne.all([oc(t, n, r, o), c.destroy()]).then(function(e) {
5078 return ic(e, 1)[0]
5079 })
5080 };
5081 "fallback" === e.type ? u().then(a) : e.result.error && !s(e.result.error) ? u().then(a) : c.destroy().then(function() {
5082 return a(e.result)
5083 })
5084 })
5085 })
5086 },
5087 lc = function() {
5088 function e(e, t) {
5089 var n = [],
5090 r = !0,
5091 o = !1,
5092 a = void 0;
5093 try {
5094 for (var i, c = e[Symbol.iterator](); !(r = (i = c.next()).done) && (n.push(i.value), !t || n.length !== t); r = !0);
5095 } catch (e) {
5096 o = !0, a = e
5097 } finally {
5098 try {
5099 !r && c.return && c.return()
5100 } finally {
5101 if (o) throw a
5102 }
5103 }
5104 return n
5105 }
5106 return function(t, n) {
5107 if (Array.isArray(t)) return t;
5108 if (Symbol.iterator in Object(t)) return e(t, n);
5109 throw new TypeError("Invalid attempt to destructure non-iterable instance")
5110 }
5111 }(),
5112 pc = Object.assign || function(e) {
5113 for (var t = 1; t < arguments.length; t++) {
5114 var n = arguments[t];
5115 for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r])
5116 }
5117 return e
5118 },
5119 dc = function(e) {
5120 return new Ne(function(t) {
5121 e._on("load", function() {
5122 return t(e)
5123 })
5124 })
5125 },
5126 fc = function(e, t, n, r) {
5127 var o = e.createHiddenFrame(At.STRIPE_3DS2_FINGERPRINT, {
5128 intentId: t,
5129 locale: r,
5130 hosted: n
5131 });
5132 e.report("3ds2.fingerprint_frame.loading", {
5133 hosted: n,
5134 intentId: t
5135 });
5136 var a = dc(o);
5137 return a.then(function() {
5138 e.report("3ds2.fingerprint_frame.loaded", {
5139 hosted: n,
5140 intentId: t
5141 })
5142 }), a
5143 },
5144 hc = function(e, t, n, r, o) {
5145 var a = t.createLightboxFrame(At.STRIPE_3DS2_CHALLENGE, {
5146 intentId: e,
5147 hosted: r,
5148 locale: o
5149 });
5150 t.report("3ds2.challenge_frame.loading", {
5151 intentId: e,
5152 hosted: r
5153 }), a._on("challenge_complete", function() {
5154 a.fadeOutBackdrop()
5155 });
5156 var i = dc(a);
5157 return i.then(function() {
5158 return t.report("3ds2.challenge_frame.loaded", {
5159 intentId: e,
5160 hosted: r
5161 })
5162 }), r && (a.show(), a.action.show3DS2Spinner({
5163 cardBrand: n
5164 })), i
5165 },
5166 _c = function(e, t, n, r, o) {
5167 return t.optimizations.skipFingerprint ? Ne.resolve({
5168 fingerprintAttempted: !1,
5169 fingerprintData: null
5170 }) : "" === t.methodUrl ? (n.report("3ds2.fingerprint.no_method_url", {
5171 hosted: r,
5172 intentId: e.id
5173 }), Ne.resolve({
5174 fingerprintAttempted: !1,
5175 fingerprintData: null
5176 })) : fc(n, e.id, r, o).then(function(e) {
5177 return e.action.perform3DS2Fingerprint({
5178 transactionId: t.transactionId,
5179 methodUrl: t.methodUrl,
5180 shouldSandbox: t.optimizations.sandboxFingerprintFrame
5181 }).then(function(t) {
5182 return e.destroy(), t
5183 })
5184 })
5185 },
5186 mc = function(e, t, n, r, o, a) {
5187 var i = Date.now(),
5188 c = hc(e.id, r, n.cardBrand, a, o),
5189 s = function(i) {
5190 var s = !0;
5191 return new Ne(function(u) {
5192 c.then(function(c) {
5193 c._once("cancel", function() {
5194 c.fadeOutBackdrop(), ac(e, t, r, n.threeDS2Source, o).then(function(e) {
5195 s = !1, u(e)
5196 })
5197 }), a || (c.show(), c.fadeInBackdrop());
5198 var l = (i.type, i.optimizations),
5199 p = le(i, ["type", "optimizations"]);
5200 c.action.perform3DS2Challenge(pc({}, p, {
5201 shouldSandbox: l.sandboxChallengeFrame
5202 })).then(function() {
5203 s = !1, u()
5204 });
5205 ! function n() {
5206 oc(e, t, r, o).then(function(e) {
5207 if (s) {
5208 if (e.error) {
5209 var t = e.error,
5210 r = t.payment_intent || t.setup_intent;
5211 (r && "requires_payment_method" === r.status || r && "requires_source" === r.status) && u(e)
5212 }
5213 setTimeout(n, 5e3)
5214 }
5215 })
5216 }()
5217 })
5218 })
5219 },
5220 u = function(t) {
5221 return r.report("3ds2.authenticate", {
5222 hosted: a,
5223 intentId: e.id
5224 }), r.action.authenticate3DS2({
5225 threeDS2Source: n.threeDS2Source,
5226 fingerprintResult: t
5227 }).then(function(t) {
5228 return "error" === t.type ? r.report("3ds2.authenticate.error", {
5229 error: t.error,
5230 hosted: a,
5231 intentId: e.id
5232 }) : r.report("3ds2.authenticate.success", {
5233 hosted: a,
5234 intentId: e.id
5235 }), t
5236 })
5237 },
5238 l = function(n) {
5239 return Ne.all([n ? Ne.resolve(n) : oc(e, t, r, o), c.then(function(e) {
5240 return e.destroy()
5241 })]).then(function(t) {
5242 var n = lc(t, 1),
5243 o = n[0];
5244 return r.report("3ds2.done", pc({
5245 intentId: e.id,
5246 hosted: a,
5247 totalDuration: Date.now() - i
5248 }, o.error ? {
5249 error: o.error,
5250 success: !1
5251 } : {
5252 success: !0
5253 })), o
5254 })
5255 };
5256 switch (n.type) {
5257 case "3ds2-challenge":
5258 return s(n).then(l);
5259 case "3ds2-fingerprint":
5260 return _c(e, n, r, a, o).then(u).then(function(t) {
5261 if ("error" === t.type) return l();
5262 var o = t.object.ares;
5263 return "C" !== o.transStatus ? (r.report("3ds2.frictionless", {
5264 hosted: a,
5265 intentId: e.id
5266 }), l()) : s({
5267 type: "3ds2-challenge",
5268 threeDS2Source: n.threeDS2Source,
5269 cardBrand: n.cardBrand,
5270 transactionId: n.transactionId,
5271 acsUrl: o.acsURL,
5272 acsTransactionId: o.acsTransID,
5273 optimizations: n.optimizations
5274 }).then(l)
5275 });
5276 default:
5277 return Ae(n)
5278 }
5279 },
5280 yc = function(e) {
5281 return new Ne(function(t, n) {
5282 var r = setTimeout(function() {
5283 t({
5284 type: "error",
5285 error: {
5286 code: "redirect_error",
5287 message: "Failed to redirect to " + e
5288 },
5289 locale: "en"
5290 })
5291 }, 3e3);
5292 window.addEventListener("pagehide", function() {
5293 clearTimeout(r)
5294 }), window.top.location.href = e
5295 })
5296 },
5297 vc = function(e, t, n) {
5298 e.report("redirect_error", {
5299 initiator: t,
5300 error: n.error
5301 })
5302 },
5303 bc = function(e, t, n, r) {
5304 return yc(n).then(function(n) {
5305 return vc(r, t + " redirect", n), gi(n, e)
5306 })
5307 },
5308 gc = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
5309 return typeof e
5310 } : function(e) {
5311 return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
5312 },
5313 Ec = function(e) {
5314 switch (e.type) {
5315 case "error":
5316 var t = e.error;
5317 if ("payment_intent_unexpected_state" === t.code && "object" === gc(t.payment_intent) && null != t.payment_intent && "string" == typeof t.payment_intent.status && Pi(t.payment_intent.status)) {
5318 var n = t.payment_intent;
5319 return {
5320 type: "object",
5321 locale: e.locale,
5322 object: n
5323 }
5324 }
5325 return e;
5326 case "object":
5327 return e;
5328 default:
5329 return Ae(e)
5330 }
5331 },
5332 wc = function(e, t, n, r, o) {
5333 var a = nc(Oi(t), n, e),
5334 i = Si(t);
5335 if (!a) return Ne.resolve({
5336 paymentIntent: t
5337 });
5338 switch (a.type) {
5339 case "3ds1-modal":
5340 return uc(a, i, Lt.PAYMENT_INTENT, e, r);
5341 case "3ds2-fingerprint":
5342 case "3ds2-challenge":
5343 return mc(i, Lt.PAYMENT_INTENT, a, e, r, o);
5344 case "redirect":
5345 return bc(t, n, a.redirectUrl, e);
5346 case "oxxo-display":
5347 throw new ke("Expected option `handleActions` to be `false`. The OXXO private beta does not handle the next actions for you automatically (e.g. display OXXO details). Please refer to the Stripe OXXO integration guide for more info: \n\nhttps://stripe.com/docs/payments/oxxo");
5348 default:
5349 return Ne.resolve({
5350 paymentIntent: t
5351 })
5352 }
5353 },
5354 Sc = function(e, t, n, r, o) {
5355 return wc(e, t, n, r, o).then(function(e) {
5356 if (e.setupIntent) throw new Error("Got unexpected SetupIntent response");
5357 return e
5358 })
5359 },
5360 Pc = function(e, t, n, r) {
5361 return function(o) {
5362 var a = Ec(o);
5363 switch (a.type) {
5364 case "error":
5365 var i = a.error,
5366 c = i.payment_intent;
5367 return n && c && "payment_intent_unexpected_state" === i.code && ("succeeded" === c.status || "requires_capture" === c.status) ? Ne.resolve({
5368 paymentIntent: c
5369 }) : Ne.resolve(gi(o));
5370 case "object":
5371 var s = a.object;
5372 return Sc(e, s, t, a.locale, r);
5373 default:
5374 return Ae(a)
5375 }
5376 }
5377 },
5378 Oc = Object.assign || function(e) {
5379 for (var t = 1; t < arguments.length; t++) {
5380 var n = arguments[t];
5381 for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r])
5382 }
5383 return e
5384 },
5385 kc = function(e, t) {
5386 return function(n, r, o, a, i) {
5387 var c = Xi(o, e),
5388 s = Zi(t, e, a),
5389 u = $i(e, i),
5390 l = "none" === s.confirmMode.tag,
5391 p = n.action.confirmPaymentIntent(Oc({}, s, {
5392 intentSecret: c,
5393 expectedType: t,
5394 options: u,
5395 mids: r
5396 }));
5397 return u.handleActions ? p.then(Pc(n, t, l, !1)) : p.then(gi)
5398 }
5399 },
5400 Ac = kc("confirmAuBecsDebitPayment", _i.au_becs_debit),
5401 Tc = kc("confirmBancontactPayment", _i.bancontact),
5402 Ic = kc("confirmCardPayment", _i.card),
5403 Rc = kc("confirmBacsDebitPayment", _i.bacs_debit),
5404 Nc = kc("confirmFpxPayment", _i.fpx),
5405 Cc = kc("confirmEpsPayment", _i.eps),
5406 Mc = kc("confirmGiropayPayment", _i.giropay),
5407 jc = kc("confirmGrabPayPayment", _i.grabpay),
5408 Lc = kc("confirmIdealPayment", _i.ideal),
5409 xc = kc("confirmOxxoPayment", _i.oxxo),
5410 qc = kc("confirmP24Payment", _i.p24),
5411 Dc = kc("confirmSepaDebitPayment", _i.sepa_debit),
5412 Bc = kc("confirmSofortPayment", _i.sofort),
5413 Fc = function(e, t) {
5414 var n = Xi(e, "retrievePaymentIntent");
5415 return t.action.retrievePaymentIntent({
5416 intentSecret: n,
5417 hosted: !1
5418 }).then(gi)
5419 },
5420 Uc = function(e, t) {
5421 var n = Xi(e, "handleHosted3DS2Setup [internal]");
5422 return t.action.retrievePaymentIntent({
5423 intentSecret: n,
5424 hosted: !0
5425 }).then(Pc(t, _i.card, !1, !0))
5426 },
5427 Hc = function(e, t) {
5428 var n = Xi(e, "handleCardAction");
5429 return t.action.retrievePaymentIntent({
5430 intentSecret: n,
5431 hosted: !1
5432 }).then(function(e) {
5433 var n = Ec(e);
5434 switch (n.type) {
5435 case "error":
5436 return Ne.resolve(gi(e));
5437 case "object":
5438 var r = n.object;
5439 if (Pi(r.status)) {
5440 if ("manual" !== r.confirmation_method) throw new ke("handleCardAction: The PaymentIntent supplied does not require manual server-side confirmation. Please use confirmCardPayment instead to complete the payment.");
5441 return Sc(t, r, _i.card, n.locale, !1)
5442 }
5443 throw new ke("handleCardAction: The PaymentIntent supplied is not in the requires_action state.");
5444 default:
5445 return Ae(n)
5446 }
5447 })
5448 },
5449 zc = Object.assign || function(e) {
5450 for (var t = 1; t < arguments.length; t++) {
5451 var n = arguments[t];
5452 for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r])
5453 }
5454 return e
5455 },
5456 Gc = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
5457 return typeof e
5458 } : function(e) {
5459 return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
5460 },
5461 Yc = function(e, t) {
5462 if (null == e) return We(null);
5463 var n = e.type,
5464 r = pe(e, ["type"]),
5465 o = at(ot, function() {
5466 return null
5467 })(n, bt(t, "type"));
5468 return "error" === o.type ? o : We({
5469 type: o.value,
5470 data: r
5471 })
5472 },
5473 Wc = function(e, t, n, r) {
5474 if (null === e) {
5475 if (null === t) {
5476 throw new ke(n + ": you must additionally specify the type of payment method to create within " + (r ? "source_data" : "payment_method_data") + ".")
5477 }
5478 return t
5479 }
5480 if (null === t) return e;
5481 if (t !== e) throw new ke(n + ": you specified `type: " + t + "`, but " + n + " will create a " + e + " payment method.");
5482 return e
5483 },
5484 Kc = function(e) {
5485 return function(t, n) {
5486 if ("object" === (void 0 === t ? "undefined" : Gc(t)) && null !== t) {
5487 var r = t.source,
5488 o = t.source_data,
5489 a = t.payment_method,
5490 i = t.payment_method_data,
5491 c = pe(t, ["source", "source_data", "payment_method", "payment_method_data"]);
5492 if (null != r && "string" != typeof r) return Ve("string", void 0 === r ? "undefined" : Gc(r), bt(n, "source"));
5493 if (null != a && "string" != typeof a) return Ve("string", void 0 === a ? "undefined" : Gc(a), bt(n, "payment_method"));
5494 if (null != o && "object" !== (void 0 === o ? "undefined" : Gc(o))) return Ve("object", void 0 === o ? "undefined" : Gc(o), bt(n, "source_data"));
5495 if (null != i && "object" !== (void 0 === i ? "undefined" : Gc(i))) return Ve("object", void 0 === i ? "undefined" : Gc(i), bt(n, "payment_method_data"));
5496 var s = Yc(o, bt(n, "source_data"));
5497 if ("error" === s.type) return s;
5498 var u = s.value,
5499 l = Yc(i, bt(n, "payment_method_data"));
5500 if ("error" === l.type) return l;
5501 var p = l.value;
5502 return We({
5503 sourceData: u,
5504 source: null == r ? null : r,
5505 paymentMethodData: p,
5506 paymentMethod: null == a ? null : a,
5507 otherParams: zc({}, e, c)
5508 })
5509 }
5510 return null === t ? Ve("object", "null", n) : Ve("object", void 0 === t ? "undefined" : Gc(t), n)
5511 }
5512 },
5513 Vc = function(e) {
5514 return function(t, n) {
5515 if (void 0 === t) return We({
5516 sourceData: null,
5517 paymentMethodData: null,
5518 source: null,
5519 paymentMethod: null,
5520 otherParams: {}
5521 });
5522 if ("object" !== (void 0 === t ? "undefined" : Gc(t))) return Ve("object", void 0 === t ? "undefined" : Gc(t), n);
5523 if (null === t) return Ve("object", "null", n);
5524 if (e) {
5525 if (!t.payment_intent) return We({
5526 sourceData: null,
5527 paymentMethodData: null,
5528 source: null,
5529 paymentMethod: null,
5530 otherParams: t
5531 });
5532 var r = t.payment_intent,
5533 o = pe(t, ["payment_intent"]);
5534 return Kc(o)(r, bt(n, "payment_intent"))
5535 }
5536 return t.payment_intent ? Ke(new ke("The payment_intent parameter has been removed. To fix, move everything nested under the payment_intent parameter to the top-level object.")) : Kc({})(t, n)
5537 }
5538 },
5539 Jc = function(e, t, n, r, o, a) {
5540 var i = gt(fi, o, r);
5541 if ("error" === i.type) return null;
5542 var c = i.value,
5543 s = Et(Vc(t), a, r),
5544 u = s.value,
5545 l = u.sourceData,
5546 p = u.source,
5547 d = u.paymentMethodData,
5548 f = u.paymentMethod,
5549 h = u.otherParams;
5550 if (!e && l) throw new ke(r + ": Expected payment_method_data, not source_data.");
5551 if (null != p) throw new ke("When calling " + r + " on an Element, you can't pass in a pre-existing source ID, as a source will be created using the Element.");
5552 if (null != f) throw new ke("When calling " + r + " on an Element, you can't pass in a pre-existing PaymentMethod ID, as a PaymentMethod will be created using the Element.");
5553 var _ = c._componentName,
5554 m = c._frame.id,
5555 y = l || d || {
5556 type: null,
5557 data: {}
5558 },
5559 v = y.type,
5560 b = y.data,
5561 g = vi(_, v),
5562 E = e && !d,
5563 w = Wc(n, g, r, E),
5564 S = {
5565 elementName: _,
5566 frameId: m,
5567 type: w,
5568 data: b
5569 };
5570 return E ? {
5571 confirmMode: zc({
5572 tag: "source-from-element"
5573 }, S),
5574 otherParams: h
5575 } : {
5576 confirmMode: zc({
5577 tag: "paymentMethod-from-element",
5578 options: null
5579 }, S),
5580 otherParams: h
5581 }
5582 },
5583 Qc = function(e, t, n, r, o, a) {
5584 var i = Et(Vc(t), o, r),
5585 c = i.value,
5586 s = c.sourceData,
5587 u = c.source,
5588 l = c.paymentMethodData,
5589 p = c.paymentMethod,
5590 d = c.otherParams;
5591 if (!e && s) throw new ke(r + ": Expected payment_method, source, or payment_method_data, not source_data.");
5592 if (null !== u && null !== s) throw new ke(r + ": Expected either source or source_data, but not both.");
5593 if (null !== p && null !== l) throw new ke(r + ": Expected either payment_method or payment_method_data, but not both.");
5594 if (null !== p && null !== u) throw new ke(r + ": Expected either payment_method or source, but not both.");
5595 if (s || l) {
5596 var f = s || l || {},
5597 h = f.type,
5598 _ = f.data,
5599 m = e && !l,
5600 y = Wc(n, h, r, m);
5601 return m ? {
5602 confirmMode: {
5603 tag: "source-from-data",
5604 type: y,
5605 data: _
5606 },
5607 otherParams: d
5608 } : {
5609 confirmMode: {
5610 tag: "paymentMethod-from-data",
5611 type: y,
5612 data: _,
5613 options: null
5614 },
5615 otherParams: d
5616 }
5617 }
5618 return null !== u ? {
5619 confirmMode: {
5620 tag: "source",
5621 source: u
5622 },
5623 otherParams: d
5624 } : null !== p ? {
5625 confirmMode: {
5626 tag: "paymentMethod",
5627 paymentMethod: p,
5628 options: null
5629 },
5630 otherParams: d
5631 } : {
5632 confirmMode: {
5633 tag: "none"
5634 },
5635 otherParams: d
5636 }
5637 },
5638 Xc = function(e, t, n, r) {
5639 return function(o, a) {
5640 var i = Jc(e, t, n, r, o, a);
5641 if (i) return i;
5642 var c = Qc(e, t, n, r, o);
5643 if (c) return c;
5644 throw new ke("Expected: stripe." + r + "(intentSecret, element[, data]) or stripe." + r + "(intentSecret[, data]). Please see the docs for more usage examples https://stripe.com/docs/payments/dynamic-authentication")
5645 }
5646 },
5647 $c = Object.assign || function(e) {
5648 for (var t = 1; t < arguments.length; t++) {
5649 var n = arguments[t];
5650 for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r])
5651 }
5652 return e
5653 },
5654 Zc = function(e, t, n, r, o, a) {
5655 var i = Et(Ti, r, "stripe.confirmPaymentIntent intent secret"),
5656 c = i.value,
5657 s = Xc(e, !1, null, "confirmPaymentIntent")(o, a);
5658 return t.action.confirmPaymentIntent($c({}, s, {
5659 intentSecret: c,
5660 expectedType: null,
5661 options: {
5662 handleActions: !1
5663 },
5664 mids: n
5665 })).then(gi)
5666 },
5667 es = function(e, t, n, r, o, a, i) {
5668 var c = Et(Ti, o, "stripe.handleCardPayment intent secret"),
5669 s = c.value,
5670 u = _i.card,
5671 l = Xc(e, r, u, "handleCardPayment")(a, i),
5672 p = !a && !i;
5673 return t.action.confirmPaymentIntent($c({}, l, {
5674 intentSecret: s,
5675 expectedType: u,
5676 options: {
5677 handleActions: !0
5678 },
5679 mids: n
5680 })).then(Pc(t, u, p, !1))
5681 },
5682 ts = function(e, t, n, r, o, a) {
5683 var i = Et(Ti, r, "stripe.handleSepaDebitPayment intent secret"),
5684 c = i.value,
5685 s = _i.sepa_debit,
5686 u = Xc(!1, n, s, "handleSepaDebitPayment")(o, a),
5687 l = !o && !a;
5688 return e.action.confirmPaymentIntent($c({}, u, {
5689 intentSecret: c,
5690 expectedType: s,
5691 options: {
5692 handleActions: !0
5693 },
5694 mids: t
5695 })).then(Pc(e, s, l, !1))
5696 },
5697 ns = function(e, t, n, r, o, a, i) {
5698 var c = Et(Ti, o, "stripe.handleIdealPayment intent secret"),
5699 s = c.value,
5700 u = _i.ideal,
5701 l = Xc(e, r, u, "handleIdealPayment")(a, i),
5702 p = !a && !i;
5703 return t.action.confirmPaymentIntent($c({}, l, {
5704 intentSecret: s,
5705 expectedType: u,
5706 options: {
5707 handleActions: !0
5708 },
5709 mids: n
5710 })).then(Pc(t, u, p, !1))
5711 },
5712 rs = function(e, t, n, r, o, a) {
5713 var i = Et(Ti, r, "stripe.handleFpxPayment intent secret"),
5714 c = i.value,
5715 s = _i.fpx,
5716 u = Xc(!1, n, s, "handleFpxPayment")(o, a),
5717 l = !o && !a;
5718 return e.action.confirmPaymentIntent($c({}, u, {
5719 intentSecret: c,
5720 expectedType: s,
5721 options: {
5722 handleActions: !0
5723 },
5724 mids: t
5725 })).then(Pc(e, s, l, !1))
5726 },
5727 os = function(e, t, n, r, o) {
5728 var a = nc(Oi(t), n, e),
5729 i = Si(t);
5730 if (!a) return Ne.resolve({
5731 setupIntent: t
5732 });
5733 switch (a.type) {
5734 case "3ds1-modal":
5735 return uc(a, i, Lt.SETUP_INTENT, e, r);
5736 case "3ds2-fingerprint":
5737 case "3ds2-challenge":
5738 return mc(i, Lt.SETUP_INTENT, a, e, r, o);
5739 default:
5740 return Ne.resolve({
5741 setupIntent: t
5742 })
5743 }
5744 },
5745 as = function(e, t, n, r, o) {
5746 return os(e, t, n, r, o).then(function(e) {
5747 if (e.paymentIntent) throw new Error("Got unexpected PaymentIntent response");
5748 return e
5749 })
5750 },
5751 is = function(e, t, n, r) {
5752 return function(o) {
5753 switch (o.type) {
5754 case "error":
5755 var a = o.error,
5756 i = a.setup_intent;
5757 return n && i && "succeeded" === i.status ? Ne.resolve({
5758 setupIntent: i
5759 }) : Ne.resolve({
5760 error: a
5761 });
5762 case "object":
5763 var c = o.object;
5764 return as(e, c, t, o.locale, r);
5765 default:
5766 return Ae(o)
5767 }
5768 }
5769 },
5770 cs = Object.assign || function(e) {
5771 for (var t = 1; t < arguments.length; t++) {
5772 var n = arguments[t];
5773 for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r])
5774 }
5775 return e
5776 },
5777 ss = function(e, t) {
5778 return function(n, r, o, a, i) {
5779 var c = Xi(o, e),
5780 s = Zi(t, e, a),
5781 u = $i(e, i),
5782 l = "none" === s.confirmMode.tag,
5783 p = n.action.confirmSetupIntent(cs({}, s, {
5784 intentSecret: c,
5785 expectedType: t,
5786 options: u,
5787 mids: r
5788 }));
5789 return u.handleActions ? p.then(is(n, t, l, !1)) : p.then(Ei)
5790 }
5791 },
5792 us = ss("confirmCardSetup", _i.card),
5793 ls = ss("confirmSepaDebitSetup", _i.sepa_debit),
5794 ps = ss("confirmAuBecsDebitSetup", _i.au_becs_debit),
5795 ds = ss("confirmBacsDebitSetup", _i.bacs_debit),
5796 fs = function(e, t) {
5797 var n = Xi(e, "retrieveSetupIntent");
5798 return t.action.retrieveSetupIntent({
5799 intentSecret: n,
5800 hosted: !1
5801 }).then(Ei)
5802 },
5803 hs = function(e, t) {
5804 var n = Xi(e, "handleHosted3DS2Setup [internal]");
5805 return t.action.retrieveSetupIntent({
5806 intentSecret: n,
5807 hosted: !0
5808 }).then(is(t, _i.card, !1, !0))
5809 },
5810 _s = Object.assign || function(e) {
5811 for (var t = 1; t < arguments.length; t++) {
5812 var n = arguments[t];
5813 for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r])
5814 }
5815 return e
5816 },
5817 ms = function(e, t, n, r, o) {
5818 var a = Et(Ti, n, "stripe.handleCardSetup intent secret"),
5819 i = a.value,
5820 c = _i.card,
5821 s = Xc(!1, !1, c, "handleCardSetup")(r, o),
5822 u = !r && !o;
5823 return e.action.confirmSetupIntent(_s({}, s, {
5824 intentSecret: i,
5825 expectedType: c,
5826 options: {
5827 handleActions: !0
5828 },
5829 mids: t
5830 })).then(is(e, c, u, !1))
5831 },
5832 ys = function(e, t, n, r, o) {
5833 var a = Et(Ti, n, "stripe.handleSepaDebitSetup intent secret"),
5834 i = a.value,
5835 c = _i.sepa_debit,
5836 s = Xc(!1, !1, c, "handleSepaDebitSetup")(r, o),
5837 u = !r && !o;
5838 return e.action.confirmSetupIntent(_s({}, s, {
5839 intentSecret: i,
5840 expectedType: c,
5841 options: {
5842 handleActions: !0
5843 },
5844 mids: t
5845 })).then(is(e, c, u, !1))
5846 },
5847 vs = function(e, t, n, r, o) {
5848 var a = Et(Ti, n, "stripe.confirmSetupIntent intent secret"),
5849 i = a.value,
5850 c = Xc(!1, !1, null, "confirmSetupIntent")(r, o);
5851 return e.action.confirmSetupIntent(_s({}, c, {
5852 otherParams: _s({}, c.otherParams),
5853 intentSecret: i,
5854 expectedType: null,
5855 options: {
5856 handleActions: !1
5857 },
5858 mids: t
5859 })).then(Ei)
5860 },
5861 bs = [Dr.checkout_beta_2, Dr.checkout_beta_3, Dr.checkout_beta_4],
5862 gs = [Dr.checkout_beta_2, Dr.checkout_beta_3, Dr.checkout_beta_4, Dr.checkout_beta_locales, Dr.checkout_beta_testcards],
5863 Es = {
5864 da: "da",
5865 de: "de",
5866 en: "en",
5867 es: "es",
5868 fi: "fi",
5869 fr: "fr",
5870 it: "it",
5871 ja: "ja",
5872 ms: "ms",
5873 nl: "nl",
5874 nb: "nb",
5875 pl: "pl",
5876 pt: "pt",
5877 sv: "sv",
5878 zh: "zh"
5879 },
5880 ws = {
5881 ru: "ru"
5882 },
5883 Ss = Object.keys(Es),
5884 Ps = Object.keys(ws),
5885 Os = Object.assign || function(e) {
5886 for (var t = 1; t < arguments.length; t++) {
5887 var n = arguments[t];
5888 for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r])
5889 }
5890 return e
5891 },
5892 ks = {
5893 sku: Qe(ot),
5894 plan: Qe(ot),
5895 clientReferenceId: Qe(ot),
5896 locale: Qe(et.apply(void 0, ["auto"].concat(fe(Ss)))),
5897 customerEmail: Qe(ot),
5898 billingAddressCollection: Qe(et("required", "auto")),
5899 submitType: Qe(et("auto", "pay", "book", "donate")),
5900 allowIncompleteSubscriptions: Qe(it),
5901 shippingAddressCollection: Qe(yt({
5902 allowedCountries: ft(ot)
5903 }))
5904 },
5905 As = function(e, t, n) {
5906 if (e && t || (e || t) && n) throw new ke("stripe.redirectToCheckout: Expected only one of sku, plan, or items.");
5907 if ("string" == typeof e) return [{
5908 sku: e,
5909 quantity: 1
5910 }];
5911 if ("string" == typeof t) return [{
5912 plan: t,
5913 quantity: 1
5914 }];
5915 if (n) return n.map(function(e) {
5916 return "sku" === e.type ? {
5917 sku: e.id,
5918 quantity: e.quantity
5919 } : {
5920 plan: e.id,
5921 quantity: e.quantity
5922 }
5923 });
5924 throw new ke("stripe.redirectToCheckout: You must provide either sku, plan, or items.")
5925 },
5926 Ts = function(e) {
5927 var t = yt(Os({}, ks, {
5928 items: Qe(Xe(ft(yt({
5929 type: et("plan"),
5930 quantity: st(0),
5931 id: ot
5932 })), ft(yt({
5933 type: et("sku"),
5934 quantity: st(0),
5935 id: ot
5936 })))),
5937 successUrl: ot,
5938 cancelUrl: ot
5939 })),
5940 n = Et(t, e, "stripe.redirectToCheckout"),
5941 r = n.value,
5942 o = r.sku,
5943 a = r.plan,
5944 i = r.items,
5945 c = de(r, ["sku", "plan", "items"]),
5946 s = As(o, a, i);
5947 return Os({
5948 tag: "no-session",
5949 items: s
5950 }, c)
5951 },
5952 Is = function(e, t, n) {
5953 var r = yt(Os({}, ks, {
5954 sessionId: Qe(ot),
5955 successUrl: Qe(ot),
5956 cancelUrl: Qe(ot),
5957 items: Qe(Xe(ft(yt({
5958 quantity: st(0),
5959 plan: ot
5960 })), ft(yt({
5961 quantity: st(0),
5962 sku: ot
5963 }))))
5964 }, -1 !== e.indexOf("checkout_beta_locales") ? {
5965 locale: Qe(et.apply(void 0, ["auto"].concat(fe(Ss), fe(Ps))))
5966 } : {})),
5967 o = Et(r, t, "stripe.redirectToCheckout"),
5968 a = o.value;
5969 if (a.sessionId) {
5970 var i = a.sessionId;
5971 if (Object.keys(a).length > 1) throw new ke("stripe.redirectToCheckout: Do not provide other parameters when providing sessionId. Specify all parameters on your server when creating the CheckoutSession.");
5972 if (!/^cs_/.test(i)) throw new ke("stripe.redirectToCheckout: Invalid value for sessionId. You specified '" + i + "'.");
5973 if ("livemode" === n && /^cs_test_/.test(i)) throw new ke("stripe.redirectToCheckout: the provided sessionId is for a test mode Checkout Session, whereas Stripe.js was initialized with a live mode publishable key.");
5974 if ("testmode" === n && /^cs_live_/.test(i)) throw new ke("stripe.redirectToCheckout: the provided sessionId is for a live mode Checkout Session, whereas Stripe.js was initialized with a test mode publishable key.");
5975 return {
5976 tag: "session",
5977 sessionId: i
5978 }
5979 }
5980 var c = (a.sessionId, a.sku, a.plan, a.items),
5981 s = a.successUrl,
5982 u = a.cancelUrl,
5983 l = de(a, ["sessionId", "sku", "plan", "items", "successUrl", "cancelUrl"]);
5984 if (!c) throw new ke("stripe.redirectToCheckout: You must provide one of items or sessionId.");
5985 if (!s || !u) throw new ke("stripe.redirectToCheckout: You must provide successUrl and cancelUrl.");
5986 return Os({
5987 tag: "no-session",
5988 items: c,
5989 successUrl: s,
5990 cancelUrl: u
5991 }, l)
5992 },
5993 Rs = function(e, t, n) {
5994 var r = Is(e, t, n);
5995 if ("no-session" === r.tag) {
5996 var o = r.successUrl,
5997 a = r.cancelUrl;
5998 if (!St(o)) throw new ke("stripe.redirectToCheckout: successUrl must start with either http:// or https://.");
5999 if (!St(a)) throw new ke("stripe.redirectToCheckout: cancelUrl must start with either http:// or https://.");
6000 return r
6001 }
6002 return r
6003 },
6004 Ns = function(e, t) {
6005 return "session" === t.tag || null == e || t.locale || -1 === ["auto"].concat(fe(Ss)).indexOf(e) ? t : Os({}, t, {
6006 locale: e
6007 })
6008 },
6009 Cs = function(e, t, n) {
6010 switch (Ce(bs, function(t) {
6011 return Fr(e, t)
6012 })) {
6013 case "checkout_beta_2":
6014 return Ts(t);
6015 case "checkout_beta_3":
6016 return Is(e, t, n);
6017 case "checkout_beta_4":
6018 default:
6019 return Rs(e, t, n)
6020 }
6021 },
6022 Ms = function(e, t, n) {
6023 var r = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : "unknown";
6024 return Ns(t, Cs(e, n, r))
6025 },
6026 js = Ms,
6027 Ls = Object.assign || function(e) {
6028 for (var t = 1; t < arguments.length; t++) {
6029 var n = arguments[t];
6030 for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r])
6031 }
6032 return e
6033 },
6034 xs = function(e, t) {
6035 var n = function(t) {
6036 return vc(e, "redirectToCheckout", t), {
6037 error: t.error
6038 }
6039 };
6040 return yc(t).then(n)
6041 },
6042 qs = function(e, t, n, r) {
6043 return function(o) {
6044 e.report("redirect_to_checkout.options", {
6045 betas: t,
6046 options: o,
6047 globalLocale: r
6048 });
6049 var a = js(t, r, o, e.livemode());
6050 if ("session" === a.tag) {
6051 var i = a,
6052 c = i.sessionId;
6053 return e.action.createPaymentPageWithSession({
6054 betas: t,
6055 mids: n(),
6056 sessionId: c
6057 }).then(function(t) {
6058 if ("error" === t.type) return {
6059 error: t.error
6060 };
6061 var n = t.object.url;
6062 return xs(e, n)
6063 })
6064 }
6065 var s = a,
6066 u = (s.tag, s.items),
6067 l = s.successUrl,
6068 p = s.cancelUrl,
6069 d = s.clientReferenceId,
6070 f = s.customerEmail,
6071 h = s.billingAddressCollection,
6072 _ = s.submitType,
6073 m = s.allowIncompleteSubscriptions,
6074 y = s.shippingAddressCollection,
6075 v = he(s, ["tag", "items", "successUrl", "cancelUrl", "clientReferenceId", "customerEmail", "billingAddressCollection", "submitType", "allowIncompleteSubscriptions", "shippingAddressCollection"]),
6076 b = u.map(function(e) {
6077 if (e.sku) return {
6078 type: "sku",
6079 id: e.sku,
6080 quantity: e.quantity
6081 };
6082 if (e.plan) return {
6083 type: "plan",
6084 id: e.plan,
6085 quantity: e.quantity
6086 };
6087 throw new Error("Unexpected item shape.")
6088 }),
6089 g = Ce(bs, function(e) {
6090 return Fr(t, e)
6091 });
6092 return e.action.createPaymentPage(Ls({
6093 betas: t,
6094 mids: n(),
6095 items: b,
6096 success_url: l,
6097 cancel_url: p,
6098 client_reference_id: d,
6099 customer_email: f,
6100 billing_address_collection: h,
6101 submit_type: _,
6102 use_payment_methods: !g,
6103 allow_incomplete_subscriptions: m,
6104 shipping_address_collection: y && {
6105 allowed_countries: y.allowedCountries
6106 }
6107 }, v)).then(function(t) {
6108 if ("error" === t.type) return {
6109 error: t.error
6110 };
6111 var n = t.object.url;
6112 return xs(e, n)
6113 })
6114 }
6115 },
6116 Ds = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
6117 return typeof e
6118 } : function(e) {
6119 return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
6120 },
6121 Bs = function(e) {
6122 switch (e.type) {
6123 case "object":
6124 return {
6125 token: e.object
6126 };
6127 case "error":
6128 return {
6129 error: e.error
6130 };
6131 default:
6132 return Ae(e)
6133 }
6134 },
6135 Fs = function(e) {
6136 return "object" === (void 0 === e ? "undefined" : Ds(e)) && null !== e ? e : {}
6137 },
6138 Us = function(e, t, n) {
6139 var r = hi(t);
6140 if (r && "cardCvc" === r._componentName) {
6141 var o = r._frame.id;
6142 return e.action.tokenizeCvcUpdate({
6143 frameId: o,
6144 mids: n
6145 }).then(Bs)
6146 }
6147 throw new ke("You must provide a `cardCvc` Element to create a `cvc_update` token.")
6148 },
6149 Hs = function(e, t) {
6150 return function(n, r) {
6151 var o = hi(n);
6152 if (o) {
6153 var a = o._frame.id,
6154 i = o._componentName,
6155 c = Fs(r);
6156 return e.action.tokenizeWithElement({
6157 frameId: a,
6158 elementName: i,
6159 tokenData: c,
6160 mids: t
6161 }).then(Bs)
6162 }
6163 if ("string" == typeof n) {
6164 var s = n,
6165 u = Fs(r);
6166 return e.action.tokenizeWithData({
6167 elementName: null,
6168 type: s,
6169 tokenData: u,
6170 mids: t
6171 }).then(Bs)
6172 }
6173 throw new ke("You must provide a Stripe Element or a valid token type to create a Token.")
6174 }
6175 },
6176 zs = function(e) {
6177 switch (e.type) {
6178 case "object":
6179 return {
6180 radarSession: e.object
6181 };
6182 case "error":
6183 return {
6184 error: e.error
6185 };
6186 default:
6187 return Ae(e)
6188 }
6189 },
6190 Gs = function(e, t) {
6191 return e.action.createRadarSession({
6192 mids: t
6193 }).then(zs)
6194 },
6195 Ys = Object.assign || function(e) {
6196 for (var t = 1; t < arguments.length; t++) {
6197 var n = arguments[t];
6198 for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r])
6199 }
6200 return e
6201 },
6202 Ws = function() {
6203 function e(e, t) {
6204 for (var n = 0; n < t.length; n++) {
6205 var r = t[n];
6206 r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
6207 }
6208 }
6209 return function(t, n, r) {
6210 return n && e(t.prototype, n), r && e(t, r), t
6211 }
6212 }(),
6213 Ks = function() {
6214 return window.performance && window.performance.now ? window.performance.now() : Date.now()
6215 }(),
6216 Vs = vt({
6217 apiKey: ot,
6218 stripeAccount: Qe(ot),
6219 locale: Qe(ot),
6220 __privateApiUrl: Qe(ot),
6221 __checkout: Qe(vt({
6222 mids: vt({
6223 muid: ot,
6224 sid: ot
6225 })
6226 })),
6227 __hosted3DS: Qe(it),
6228 canCreateRadarSession: Qe(it),
6229 betas: Qe(ft(tt.apply(void 0, me(Br))))
6230 }),
6231 Js = function(e) {
6232 return "You have an in-flight " + e + "! Please be sure to disable your form submit button when " + e + " is called."
6233 },
6234 Qs = function(e) {
6235 return function() {
6236 throw new ke("You cannot call `stripe." + e + "` without supplying a PaymentIntents beta flag when initializing Stripe.js. You can find more information including code snippets at https://www.stripe.com/docs/payments/payment-intents/quickstart.")
6237 }
6238 },
6239 Xs = function() {
6240 function e(t, n) {
6241 var r = this;
6242 _e(this, e), $s.call(this);
6243 var o = Et(Vs, t || {}, "Stripe()"),
6244 a = o.value,
6245 i = o.warnings,
6246 c = a.apiKey,
6247 s = a.stripeAccount,
6248 u = a.locale,
6249 l = a.__privateApiUrl,
6250 p = a.__checkout,
6251 d = a.__hosted3DS,
6252 f = a.canCreateRadarSession,
6253 h = a.betas;
6254 if ("" === c) throw new ke("Please call Stripe() with your publishable key. You used an empty string.");
6255 if (0 === c.indexOf("sk_")) throw new ke("You should not use your secret key with Stripe.js.\n Please pass a publishable key instead.");
6256 p && p.mids && (e._ec = new Fi({
6257 checkoutIds: p.mids
6258 })), this._apiKey = c, this._keyMode = Ue(c), this._locale = u || null, this._betas = h || [], this._stripeAccount = s || null, this._isCheckout = !!p, this._controller = new Lr(Ys({
6259 apiKey: c,
6260 __privateApiUrl: l,
6261 stripeAccount: s,
6262 betas: this._betas,
6263 stripeJsId: e.stripeJsId,
6264 startTime: Ks
6265 }, this._locale ? {
6266 locale: this._locale
6267 } : {})), i.forEach(function(e) {
6268 return r._controller.warn(e)
6269 }), this._ensureHTTPS(), this._ensureStripeHosted(n), this._attachPaymentIntentMethods(this._betas, !!d), this._attachLegacyPaymentIntentMethods(this._betas), this._attachCheckoutMethods(this._betas), this._attachPrivateMethodsForCheckout(this._isCheckout), this._attachCreateRadarSession(f || !1)
6270 }
6271 return Ws(e, [{
6272 key: "_attachCreateRadarSession",
6273 value: function(e) {
6274 var t = this;
6275 e && (this.createRadarSession = cn(function() {
6276 var e = t._mids();
6277 return Gs(t._controller, e)
6278 }))
6279 }
6280 }, {
6281 key: "_attachPaymentIntentMethods",
6282 value: function(e, t) {
6283 var n = this,
6284 r = function() {
6285 return n._mids()
6286 };
6287 this.createPaymentMethod = ln(function() {
6288 for (var e = arguments.length, t = Array(e), o = 0; o < e; o++) t[o] = arguments[o];
6289 return Ji.apply(void 0, [n._controller, r()].concat(t))
6290 }), this.retrievePaymentIntent = sn(function(e) {
6291 return Fc(e, n._controller)
6292 }), this.retrieveSetupIntent = sn(function(e) {
6293 return fs(e, n._controller)
6294 });
6295 var o = Nn(Hc, Js("handleCardAction"));
6296 this.handleCardAction = sn(function(e) {
6297 return o(e, n._controller)
6298 });
6299 var a = Nn(Ic, Js("confirmCardPayment"));
6300 this.confirmCardPayment = ln(function() {
6301 for (var e = arguments.length, t = Array(e), o = 0; o < e; o++) t[o] = arguments[o];
6302 return a.apply(void 0, [n._controller, r()].concat(t))
6303 });
6304 var i = Nn(us, Js("confirmCardSetup"));
6305 this.confirmCardSetup = ln(function() {
6306 for (var e = arguments.length, t = Array(e), o = 0; o < e; o++) t[o] = arguments[o];
6307 return i.apply(void 0, [n._controller, r()].concat(t))
6308 }), this.confirmIdealPayment = ln(function() {
6309 for (var e = arguments.length, t = Array(e), o = 0; o < e; o++) t[o] = arguments[o];
6310 return Lc.apply(void 0, [n._controller, r()].concat(t))
6311 }), this.confirmSepaDebitPayment = ln(function() {
6312 for (var e = arguments.length, t = Array(e), o = 0; o < e; o++) t[o] = arguments[o];
6313 return Dc.apply(void 0, [n._controller, r()].concat(t))
6314 }), this.confirmSepaDebitSetup = ln(function() {
6315 for (var e = arguments.length, t = Array(e), o = 0; o < e; o++) t[o] = arguments[o];
6316 return ls.apply(void 0, [n._controller, r()].concat(t))
6317 }), this.confirmFpxPayment = ln(function() {
6318 for (var e = arguments.length, t = Array(e), o = 0; o < e; o++) t[o] = arguments[o];
6319 return Nc.apply(void 0, [n._controller, r()].concat(t))
6320 }), Fr(this._betas, Dr.au_bank_account_beta_2) && (this.confirmAuBecsDebitPayment = ln(function() {
6321 for (var e = arguments.length, t = Array(e), o = 0; o < e; o++) t[o] = arguments[o];
6322 return Ac.apply(void 0, [n._controller, r()].concat(t))
6323 }), this.confirmAuBecsDebitSetup = ln(function() {
6324 for (var e = arguments.length, t = Array(e), o = 0; o < e; o++) t[o] = arguments[o];
6325 return ps.apply(void 0, [n._controller, r()].concat(t))
6326 })), Fr(this._betas, Dr.bacs_debit_beta) && (this.confirmBacsDebitPayment = ln(function() {
6327 for (var e = arguments.length, t = Array(e), o = 0; o < e; o++) t[o] = arguments[o];
6328 return Rc.apply(void 0, [n._controller, r()].concat(t))
6329 }), this.confirmBacsDebitSetup = ln(function() {
6330 for (var e = arguments.length, t = Array(e), o = 0; o < e; o++) t[o] = arguments[o];
6331 return ds.apply(void 0, [n._controller, r()].concat(t))
6332 })), this.confirmBancontactPayment = Qs("confirmBancontactPayment"), Fr(this._betas, Dr.bancontact_pm_beta_1) && (this.confirmBancontactPayment = ln(function() {
6333 for (var e = arguments.length, t = Array(e), o = 0; o < e; o++) t[o] = arguments[o];
6334 return Tc.apply(void 0, [n._controller, r()].concat(t))
6335 })), this.confirmGiropayPayment = Qs("confirmGiropayPayment"), Fr(this._betas, Dr.giropay_pm_beta_1) && (this.confirmGiropayPayment = ln(function() {
6336 for (var e = arguments.length, t = Array(e), o = 0; o < e; o++) t[o] = arguments[o];
6337 return Mc.apply(void 0, [n._controller, r()].concat(t))
6338 })), this.confirmGrabPayPayment = Qs("confirmGrabPayPayment"), Fr(this._betas, Dr.grabpay_pm_beta_1) && (this.confirmGrabPayPayment = ln(function() {
6339 for (var e = arguments.length, t = Array(e), o = 0; o < e; o++) t[o] = arguments[o];
6340 return jc.apply(void 0, [n._controller, r()].concat(t))
6341 })), this.confirmOxxoPayment = Qs("confirmOxxoPayment"), Fr(this._betas, Dr.oxxo_pm_beta_1) && (this.confirmOxxoPayment = ln(function() {
6342 for (var e = arguments.length, t = Array(e), o = 0; o < e; o++) t[o] = arguments[o];
6343 return xc.apply(void 0, [n._controller, r()].concat(t))
6344 })), this.confirmP24Payment = Qs("confirmP24Payment"), Fr(this._betas, Dr.p24_pm_beta_1) && (this.confirmP24Payment = ln(function() {
6345 for (var e = arguments.length, t = Array(e), o = 0; o < e; o++) t[o] = arguments[o];
6346 return qc.apply(void 0, [n._controller, r()].concat(t))
6347 })), this.confirmEpsPayment = Qs("confirmEpsPayment"), Fr(this._betas, Dr.eps_pm_beta_1) && (this.confirmEpsPayment = ln(function() {
6348 for (var e = arguments.length, t = Array(e), o = 0; o < e; o++) t[o] = arguments[o];
6349 return Cc.apply(void 0, [n._controller, r()].concat(t))
6350 })), this.confirmSofortPayment = Qs("confirmSofortPayment"), Fr(this._betas, Dr.sofort_pm_beta_1) && (this.confirmSofortPayment = ln(function() {
6351 for (var e = arguments.length, t = Array(e), o = 0; o < e; o++) t[o] = arguments[o];
6352 return Bc.apply(void 0, [n._controller, r()].concat(t))
6353 })), t && (this.handleHosted3DS2Payment = sn(function(e) {
6354 return Uc(e, n._controller)
6355 }), this.handleHosted3DS2Setup = sn(function(e) {
6356 return hs(e, n._controller)
6357 }))
6358 }
6359 }, {
6360 key: "_attachLegacyPaymentIntentMethods",
6361 value: function(e) {
6362 var t = this,
6363 n = Fr(this._betas, Dr.payment_intent_beta_1) || Fr(this._betas, Dr.payment_intent_beta_2),
6364 r = function() {
6365 return t._mids()
6366 },
6367 o = ln(function() {
6368 for (var e = arguments.length, n = Array(e), o = 0; o < e; o++) n[o] = arguments[o];
6369 return Zc.apply(void 0, [!0, t._controller, r()].concat(n))
6370 }),
6371 a = ln(function() {
6372 for (var e = arguments.length, n = Array(e), o = 0; o < e; o++) n[o] = arguments[o];
6373 return Zc.apply(void 0, [!1, t._controller, r()].concat(n))
6374 }),
6375 i = Nn(es, Js("handleCardPayment")),
6376 c = ln(function() {
6377 for (var e = arguments.length, o = Array(e), a = 0; a < e; a++) o[a] = arguments[a];
6378 return i.apply(void 0, [!0, t._controller, r(), n].concat(o))
6379 }),
6380 s = ln(function() {
6381 for (var e = arguments.length, o = Array(e), a = 0; a < e; a++) o[a] = arguments[a];
6382 return i.apply(void 0, [!1, t._controller, r(), n].concat(o))
6383 }),
6384 u = Nn(ms, Js("handleCardSetup")),
6385 l = ln(function() {
6386 for (var e = arguments.length, n = Array(e), o = 0; o < e; o++) n[o] = arguments[o];
6387 return u.apply(void 0, [t._controller, r()].concat(n))
6388 }),
6389 p = ln(function() {
6390 for (var e = arguments.length, n = Array(e), o = 0; o < e; o++) n[o] = arguments[o];
6391 return vs.apply(void 0, [t._controller, r()].concat(n))
6392 }),
6393 d = ln(function() {
6394 for (var e = arguments.length, o = Array(e), a = 0; a < e; a++) o[a] = arguments[a];
6395 return ts.apply(void 0, [t._controller, r(), n].concat(o))
6396 }),
6397 f = ln(function() {
6398 for (var e = arguments.length, n = Array(e), o = 0; o < e; o++) n[o] = arguments[o];
6399 return ys.apply(void 0, [t._controller, r()].concat(n))
6400 }),
6401 h = ln(function() {
6402 for (var e = arguments.length, o = Array(e), a = 0; a < e; a++) o[a] = arguments[a];
6403 return ns.apply(void 0, [!0, t._controller, r(), n].concat(o))
6404 }),
6405 _ = ln(function() {
6406 for (var e = arguments.length, o = Array(e), a = 0; a < e; a++) o[a] = arguments[a];
6407 return ns.apply(void 0, [!1, t._controller, r(), n].concat(o))
6408 }),
6409 m = ln(function() {
6410 for (var e = arguments.length, o = Array(e), a = 0; a < e; a++) o[a] = arguments[a];
6411 return rs.apply(void 0, [t._controller, r(), n].concat(o))
6412 });
6413 this.handleCardPayment = s, this.confirmPaymentIntent = a, this.handleCardSetup = l, this.confirmSetupIntent = p, this.fulfillPaymentIntent = Qs("fulfillPaymentIntent"), this.handleSepaDebitPayment = Qs("handleSepaDebitPayment"), this.handleSepaDebitSetup = Qs("handleSepaDebitSetup"), this.handleIdealPayment = Qs("handleIdealPayment"), this.handleFpxPayment = Qs("handleFpxPayment"), Fr(this._betas, Dr.payment_intent_beta_1) ? this.fulfillPaymentIntent = c : (Fr(this._betas, Dr.payment_intent_beta_3) || Fr(this._betas, Dr.payment_intent_beta_2)) && (this.handleCardPayment = c), Fr(this._betas, Dr.payment_intent_beta_3) && (this.confirmPaymentIntent = o, this.handleIdealPayment = h, this.handleSepaDebitPayment = d), Fr(this._betas, Dr.fpx_bank_beta_1) && (this.handleFpxPayment = m), Fr(this._betas, Dr.ideal_pm_beta_1) && (this.handleIdealPayment = _), Fr(this._betas, Dr.sepa_pm_beta_1) && (this.handleSepaDebitPayment = d, this.handleSepaDebitSetup = f)
6414 }
6415 }, {
6416 key: "_attachPrivateMethodsForCheckout",
6417 value: function(e) {
6418 var t = this;
6419 e && (this.tryNextAction = un(function(e, n) {
6420 var r = Et(Ii, e, "Payment Intent"),
6421 o = r.value,
6422 a = Object.keys(_i).map(function(e) {
6423 return _i[e]
6424 }),
6425 i = Et(et.apply(void 0, me(a)), n, "Source type"),
6426 c = i.value;
6427 return "payment_intent" === o.object ? Sc(t._controller, o, c, "auto", !1) : as(t._controller, o, c, "auto", !1)
6428 }))
6429 }
6430 }, {
6431 key: "_attachCheckoutMethods",
6432 value: function(e) {
6433 var t = this,
6434 n = function() {
6435 return t._mids()
6436 },
6437 r = e.reduce(function(e, t) {
6438 var n = Ce(gs, function(e) {
6439 return e === t
6440 });
6441 return n ? [].concat(me(e), [n]) : e
6442 }, []);
6443 this.redirectToCheckout = qs(this._controller, r, n, this._locale)
6444 }
6445 }, {
6446 key: "_ensureHTTPS",
6447 value: function() {
6448 var e = window.location.protocol,
6449 t = -1 !== ["https:", "file:", "ionic:"].indexOf(e),
6450 n = -1 !== ["localhost", "127.0.0.1", "0.0.0.0"].indexOf(window.location.hostname),
6451 r = this._keyMode === Fe.live,
6452 o = "Live Stripe.js integrations must use HTTPS. For more information: https://stripe.com/docs/web/setup#http-requirements";
6453 if (!t) {
6454 if (r && !n) throw this._controller.report("user_error.non_https_error", {
6455 protocol: e
6456 }), new ke(o);
6457 !r || n ? window.console && console.warn("You may test your Stripe.js integration over HTTP. However, live Stripe.js integrations must use HTTPS.") : window.console && console.warn(o)
6458 }
6459 }
6460 }, {
6461 key: "_ensureStripeHosted",
6462 value: function(e) {
6463 true
6464 }
6465 }, {
6466 key: "_mids",
6467 value: function() {
6468 return e._ec ? e._ec.ids() : null
6469 }
6470 }]), e
6471 }();
6472 Xs.version = 3, Xs.stripeJsId = Yt(), Xs._ec = function() {
6473 return "https://checkout.stripe.com/".match(new RegExp(document.location.protocol + "//" + document.location.host)) ? null : new Fi
6474 }();
6475 var $s = function() {
6476 var e = this;
6477 this.elements = sn(function(t) {
6478 return new ui(e._controller, Ys({}, e._locale ? {
6479 locale: e._locale
6480 } : {}, t, {
6481 betas: e._betas
6482 }))
6483 }), this.createToken = un(function(t, n) {
6484 var r = e._mids();
6485 if ("cvc_update" === t) {
6486 if (Fr(e._betas, Dr.cvc_update_beta_1)) return Us(e._controller, n, r);
6487 throw new ke("You cannot create a 'cvc_update' token without using the 'cvc_update_beta_1' beta flag.")
6488 }
6489 return Hs(e._controller, r)(t, n)
6490 }), this.createSource = un(function(t, n) {
6491 var r = hi(t),
6492 o = Hi(r ? n : t),
6493 a = o || {
6494 type: null,
6495 data: {}
6496 },
6497 i = a.type,
6498 c = a.data;
6499 if (r) {
6500 var s = r._frame.id,
6501 u = r._componentName;
6502 return !o && yi(u) ? Ne.reject(new ke("Please provide Source creation parameters to createSource.")) : e._controller.action.createSourceWithElement({
6503 frameId: s,
6504 elementName: u,
6505 type: i,
6506 sourceData: c,
6507 mids: e._mids()
6508 }).then(zi)
6509 }
6510 return o ? i ? e._controller.action.createSourceWithData({
6511 elementName: null,
6512 type: i,
6513 sourceData: c,
6514 mids: e._mids()
6515 }).then(zi) : Ne.reject(new ke("Please provide a source type to createSource.")) : Ne.reject(new ke("Please provide either an Element or Source creation parameters to createSource."))
6516 }), this.retrieveSource = sn(function(t) {
6517 var n = Et(Yi, {
6518 source: t
6519 }, "retrieveSource"),
6520 r = n.value;
6521 return n.warnings.forEach(function(t) {
6522 return e._controller.warn(t)
6523 }), e._controller.action.retrieveSource(r).then(zi)
6524 }), this.paymentRequest = un(function(t, n) {
6525 He(e._keyMode);
6526 var r = e._isCheckout && n ? n : null;
6527 return pi(e._controller, {
6528 apiKey: e._apiKey,
6529 accountId: e._stripeAccount
6530 }, e._mids(), t, e._betas, r)
6531 })
6532 },
6533 Zs = Xs,
6534 eu = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
6535 return typeof e
6536 } : function(e) {
6537 return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
6538 },
6539 tu = Object.assign || function(e) {
6540 for (var t = 1; t < arguments.length; t++) {
6541 var n = arguments[t];
6542 for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r])
6543 }
6544 return e
6545 },
6546 nu = function() {
6547 if (document.currentScript) {
6548 var e = Pt(document.currentScript.src);
6549 return !e || nr(e.origin)
6550 }
6551 return !0
6552 }(),
6553 ru = function(e, t) {
6554 return new Zs(tu({
6555 apiKey: e
6556 }, t && "object" === (void 0 === t ? "undefined" : eu(t)) ? t : {}), nu)
6557 };
6558 ru.version = Zs.version, window.Stripe && 2 === window.Stripe.version && !window.Stripe.StripeV3 ? window.Stripe.StripeV3 = ru : window.Stripe ? window.console && console.warn("It looks like Stripe.js was loaded more than one time. Please only load it once per page.") : window.Stripe = ru;
6559 t.default = ru
6560}, function(e, t, n) {
6561 "use strict";
6562
6563 function r(e) {
6564 var t = new o(o._61);
6565 return t._81 = 1, t._65 = e, t
6566 }
6567 var o = n(3);
6568 e.exports = o;
6569 var a = r(!0),
6570 i = r(!1),
6571 c = r(null),
6572 s = r(void 0),
6573 u = r(0),
6574 l = r("");
6575 o.resolve = function(e) {
6576 if (e instanceof o) return e;
6577 if (null === e) return c;
6578 if (void 0 === e) return s;
6579 if (!0 === e) return a;
6580 if (!1 === e) return i;
6581 if (0 === e) return u;
6582 if ("" === e) return l;
6583 if ("object" == typeof e || "function" == typeof e) try {
6584 var t = e.then;
6585 if ("function" == typeof t) return new o(t.bind(e))
6586 } catch (e) {
6587 return new o(function(t, n) {
6588 n(e)
6589 })
6590 }
6591 return r(e)
6592 }, o.all = function(e) {
6593 var t = Array.prototype.slice.call(e);
6594 return new o(function(e, n) {
6595 function r(i, c) {
6596 if (c && ("object" == typeof c || "function" == typeof c)) {
6597 if (c instanceof o && c.then === o.prototype.then) {
6598 for (; 3 === c._81;) c = c._65;
6599 return 1 === c._81 ? r(i, c._65) : (2 === c._81 && n(c._65), void c.then(function(e) {
6600 r(i, e)
6601 }, n))
6602 }
6603 var s = c.then;
6604 if ("function" == typeof s) {
6605 return void new o(s.bind(c)).then(function(e) {
6606 r(i, e)
6607 }, n)
6608 }
6609 }
6610 t[i] = c, 0 == --a && e(t)
6611 }
6612 if (0 === t.length) return e([]);
6613 for (var a = t.length, i = 0; i < t.length; i++) r(i, t[i])
6614 })
6615 }, o.reject = function(e) {
6616 return new o(function(t, n) {
6617 n(e)
6618 })
6619 }, o.race = function(e) {
6620 return new o(function(t, n) {
6621 e.forEach(function(e) {
6622 o.resolve(e).then(t, n)
6623 })
6624 })
6625 }, o.prototype.catch = function(e) {
6626 return this.then(null, e)
6627 }
6628}, function(e, t, n) {
6629 "use strict";
6630
6631 function r() {}
6632
6633 function o(e) {
6634 try {
6635 return e.then
6636 } catch (e) {
6637 return y = e, v
6638 }
6639 }
6640
6641 function a(e, t) {
6642 try {
6643 return e(t)
6644 } catch (e) {
6645 return y = e, v
6646 }
6647 }
6648
6649 function i(e, t, n) {
6650 try {
6651 e(t, n)
6652 } catch (e) {
6653 return y = e, v
6654 }
6655 }
6656
6657 function c(e) {
6658 if ("object" != typeof this) throw new TypeError("Promises must be constructed via new");
6659 if ("function" != typeof e) throw new TypeError("not a function");
6660 this._45 = 0, this._81 = 0, this._65 = null, this._54 = null, e !== r && _(e, this)
6661 }
6662
6663 function s(e, t, n) {
6664 return new e.constructor(function(o, a) {
6665 var i = new c(r);
6666 i.then(o, a), u(e, new h(t, n, i))
6667 })
6668 }
6669
6670 function u(e, t) {
6671 for (; 3 === e._81;) e = e._65;
6672 if (c._10 && c._10(e), 0 === e._81) return 0 === e._45 ? (e._45 = 1, void(e._54 = t)) : 1 === e._45 ? (e._45 = 2, void(e._54 = [e._54, t])) : void e._54.push(t);
6673 l(e, t)
6674 }
6675
6676 function l(e, t) {
6677 m(function() {
6678 var n = 1 === e._81 ? t.onFulfilled : t.onRejected;
6679 if (null === n) return void(1 === e._81 ? p(t.promise, e._65) : d(t.promise, e._65));
6680 var r = a(n, e._65);
6681 r === v ? d(t.promise, y) : p(t.promise, r)
6682 })
6683 }
6684
6685 function p(e, t) {
6686 if (t === e) return d(e, new TypeError("A promise cannot be resolved with itself."));
6687 if (t && ("object" == typeof t || "function" == typeof t)) {
6688 var n = o(t);
6689 if (n === v) return d(e, y);
6690 if (n === e.then && t instanceof c) return e._81 = 3, e._65 = t, void f(e);
6691 if ("function" == typeof n) return void _(n.bind(t), e)
6692 }
6693 e._81 = 1, e._65 = t, f(e)
6694 }
6695
6696 function d(e, t) {
6697 e._81 = 2, e._65 = t, c._97 && c._97(e, t), f(e)
6698 }
6699
6700 function f(e) {
6701 if (1 === e._45 && (u(e, e._54), e._54 = null), 2 === e._45) {
6702 for (var t = 0; t < e._54.length; t++) u(e, e._54[t]);
6703 e._54 = null
6704 }
6705 }
6706
6707 function h(e, t, n) {
6708 this.onFulfilled = "function" == typeof e ? e : null, this.onRejected = "function" == typeof t ? t : null, this.promise = n
6709 }
6710
6711 function _(e, t) {
6712 var n = !1,
6713 r = i(e, function(e) {
6714 n || (n = !0, p(t, e))
6715 }, function(e) {
6716 n || (n = !0, d(t, e))
6717 });
6718 n || r !== v || (n = !0, d(t, y))
6719 }
6720 var m = n(4),
6721 y = null,
6722 v = {};
6723 e.exports = c, c._10 = null, c._97 = null, c._61 = r, c.prototype.then = function(e, t) {
6724 if (this.constructor !== c) return s(this, e, t);
6725 var n = new c(r);
6726 return u(this, new h(e, t, n)), n
6727 }
6728}, function(e, t, n) {
6729 "use strict";
6730 (function(t) {
6731 function n(e) {
6732 i.length || (a(), c = !0), i[i.length] = e
6733 }
6734
6735 function r() {
6736 for (; s < i.length;) {
6737 var e = s;
6738 if (s += 1, i[e].call(), s > u) {
6739 for (var t = 0, n = i.length - s; t < n; t++) i[t] = i[t + s];
6740 i.length -= s, s = 0
6741 }
6742 }
6743 i.length = 0, s = 0, c = !1
6744 }
6745
6746 function o(e) {
6747 return function() {
6748 function t() {
6749 clearTimeout(n), clearInterval(r), e()
6750 }
6751 var n = setTimeout(t, 0),
6752 r = setInterval(t, 50)
6753 }
6754 }
6755 e.exports = n;
6756 var a, i = [],
6757 c = !1,
6758 s = 0,
6759 u = 1024,
6760 l = void 0 !== t ? t : self,
6761 p = l.MutationObserver || l.WebKitMutationObserver;
6762 a = "function" == typeof p ? function(e) {
6763 var t = 1,
6764 n = new p(e),
6765 r = document.createTextNode("");
6766 return n.observe(r, {
6767 characterData: !0
6768 }),
6769 function() {
6770 t = -t, r.data = t
6771 }
6772 }(r) : o(r), n.requestFlush = a, n.makeRequestCallFromTimer = o
6773 }).call(t, n(5))
6774}, function(e, t) {
6775 var n;
6776 n = function() {
6777 return this
6778 }();
6779 try {
6780 n = n || Function("return this")() || (0, eval)("this")
6781 } catch (e) {
6782 "object" == typeof window && (n = window)
6783 }
6784 e.exports = n
6785}, function(e, t, n) {
6786 var r, o;
6787 ! function() {
6788 "use strict";
6789 var n = function() {
6790 function e() {}
6791
6792 function t(e, t) {
6793 for (var n = t.length, r = 0; r < n; ++r) a(e, t[r])
6794 }
6795
6796 function n(e, t) {
6797 e[t] = !0
6798 }
6799
6800 function r(e, t) {
6801 for (var n in t) c.call(t, n) && (e[n] = !!t[n])
6802 }
6803
6804 function o(e, t) {
6805 for (var n = t.split(s), r = n.length, o = 0; o < r; ++o) e[n[o]] = !0
6806 }
6807
6808 function a(e, a) {
6809 if (a) {
6810 var i = typeof a;
6811 "string" === i ? o(e, a) : Array.isArray(a) ? t(e, a) : "object" === i ? r(e, a) : "number" === i && n(e, a)
6812 }
6813 }
6814
6815 function i() {
6816 for (var n = arguments.length, r = Array(n), o = 0; o < n; o++) r[o] = arguments[o];
6817 var a = new e;
6818 t(a, r);
6819 var i = [];
6820 for (var c in a) a[c] && i.push(c);
6821 return i.join(" ")
6822 }
6823 e.prototype = Object.create(null);
6824 var c = {}.hasOwnProperty,
6825 s = /\s+/;
6826 return i
6827 }();
6828 void 0 !== e && e.exports ? e.exports = n : (r = [], void 0 !== (o = function() {
6829 return n
6830 }.apply(t, r)) && (e.exports = o))
6831 }()
6832}, function(e, t) {}]);