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