@superlogic/spree-pay 0.0.2 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/build/index.cjs +95 -1875
  2. package/build/index.js +64 -1867
  3. package/package.json +3 -5
package/build/index.js CHANGED
@@ -1,977 +1,3 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __commonJS = (cb, mod) => function __require() {
8
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
19
- // If the importer is in node compatibility mode or this is not an ESM
20
- // file that has been converted to a CommonJS file using a Babel-
21
- // compatible transform (i.e. "__esModule" has not been set), then set
22
- // "default" to the CommonJS "module.exports" for node compatibility.
23
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
24
- mod
25
- ));
26
-
27
- // ../../node_modules/react-is/cjs/react-is.production.min.js
28
- var require_react_is_production_min = __commonJS({
29
- "../../node_modules/react-is/cjs/react-is.production.min.js"(exports) {
30
- "use strict";
31
- var b = "function" === typeof Symbol && Symbol.for;
32
- var c = b ? Symbol.for("react.element") : 60103;
33
- var d = b ? Symbol.for("react.portal") : 60106;
34
- var e = b ? Symbol.for("react.fragment") : 60107;
35
- var f = b ? Symbol.for("react.strict_mode") : 60108;
36
- var g = b ? Symbol.for("react.profiler") : 60114;
37
- var h = b ? Symbol.for("react.provider") : 60109;
38
- var k = b ? Symbol.for("react.context") : 60110;
39
- var l = b ? Symbol.for("react.async_mode") : 60111;
40
- var m = b ? Symbol.for("react.concurrent_mode") : 60111;
41
- var n = b ? Symbol.for("react.forward_ref") : 60112;
42
- var p = b ? Symbol.for("react.suspense") : 60113;
43
- var q = b ? Symbol.for("react.suspense_list") : 60120;
44
- var r2 = b ? Symbol.for("react.memo") : 60115;
45
- var t = b ? Symbol.for("react.lazy") : 60116;
46
- var v = b ? Symbol.for("react.block") : 60121;
47
- var w = b ? Symbol.for("react.fundamental") : 60117;
48
- var x = b ? Symbol.for("react.responder") : 60118;
49
- var y = b ? Symbol.for("react.scope") : 60119;
50
- function z(a) {
51
- if ("object" === typeof a && null !== a) {
52
- var u = a.$$typeof;
53
- switch (u) {
54
- case c:
55
- switch (a = a.type, a) {
56
- case l:
57
- case m:
58
- case e:
59
- case g:
60
- case f:
61
- case p:
62
- return a;
63
- default:
64
- switch (a = a && a.$$typeof, a) {
65
- case k:
66
- case n:
67
- case t:
68
- case r2:
69
- case h:
70
- return a;
71
- default:
72
- return u;
73
- }
74
- }
75
- case d:
76
- return u;
77
- }
78
- }
79
- }
80
- function A(a) {
81
- return z(a) === m;
82
- }
83
- exports.AsyncMode = l;
84
- exports.ConcurrentMode = m;
85
- exports.ContextConsumer = k;
86
- exports.ContextProvider = h;
87
- exports.Element = c;
88
- exports.ForwardRef = n;
89
- exports.Fragment = e;
90
- exports.Lazy = t;
91
- exports.Memo = r2;
92
- exports.Portal = d;
93
- exports.Profiler = g;
94
- exports.StrictMode = f;
95
- exports.Suspense = p;
96
- exports.isAsyncMode = function(a) {
97
- return A(a) || z(a) === l;
98
- };
99
- exports.isConcurrentMode = A;
100
- exports.isContextConsumer = function(a) {
101
- return z(a) === k;
102
- };
103
- exports.isContextProvider = function(a) {
104
- return z(a) === h;
105
- };
106
- exports.isElement = function(a) {
107
- return "object" === typeof a && null !== a && a.$$typeof === c;
108
- };
109
- exports.isForwardRef = function(a) {
110
- return z(a) === n;
111
- };
112
- exports.isFragment = function(a) {
113
- return z(a) === e;
114
- };
115
- exports.isLazy = function(a) {
116
- return z(a) === t;
117
- };
118
- exports.isMemo = function(a) {
119
- return z(a) === r2;
120
- };
121
- exports.isPortal = function(a) {
122
- return z(a) === d;
123
- };
124
- exports.isProfiler = function(a) {
125
- return z(a) === g;
126
- };
127
- exports.isStrictMode = function(a) {
128
- return z(a) === f;
129
- };
130
- exports.isSuspense = function(a) {
131
- return z(a) === p;
132
- };
133
- exports.isValidElementType = function(a) {
134
- return "string" === typeof a || "function" === typeof a || a === e || a === m || a === g || a === f || a === p || a === q || "object" === typeof a && null !== a && (a.$$typeof === t || a.$$typeof === r2 || a.$$typeof === h || a.$$typeof === k || a.$$typeof === n || a.$$typeof === w || a.$$typeof === x || a.$$typeof === y || a.$$typeof === v);
135
- };
136
- exports.typeOf = z;
137
- }
138
- });
139
-
140
- // ../../node_modules/react-is/cjs/react-is.development.js
141
- var require_react_is_development = __commonJS({
142
- "../../node_modules/react-is/cjs/react-is.development.js"(exports) {
143
- "use strict";
144
- if (process.env.NODE_ENV !== "production") {
145
- (function() {
146
- "use strict";
147
- var hasSymbol = typeof Symbol === "function" && Symbol.for;
148
- var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for("react.element") : 60103;
149
- var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for("react.portal") : 60106;
150
- var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for("react.fragment") : 60107;
151
- var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for("react.strict_mode") : 60108;
152
- var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for("react.profiler") : 60114;
153
- var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for("react.provider") : 60109;
154
- var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for("react.context") : 60110;
155
- var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for("react.async_mode") : 60111;
156
- var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for("react.concurrent_mode") : 60111;
157
- var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for("react.forward_ref") : 60112;
158
- var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for("react.suspense") : 60113;
159
- var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for("react.suspense_list") : 60120;
160
- var REACT_MEMO_TYPE = hasSymbol ? Symbol.for("react.memo") : 60115;
161
- var REACT_LAZY_TYPE = hasSymbol ? Symbol.for("react.lazy") : 60116;
162
- var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for("react.block") : 60121;
163
- var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for("react.fundamental") : 60117;
164
- var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for("react.responder") : 60118;
165
- var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for("react.scope") : 60119;
166
- function isValidElementType(type) {
167
- return typeof type === "string" || typeof type === "function" || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
168
- type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === "object" && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
169
- }
170
- function typeOf(object) {
171
- if (typeof object === "object" && object !== null) {
172
- var $$typeof = object.$$typeof;
173
- switch ($$typeof) {
174
- case REACT_ELEMENT_TYPE:
175
- var type = object.type;
176
- switch (type) {
177
- case REACT_ASYNC_MODE_TYPE:
178
- case REACT_CONCURRENT_MODE_TYPE:
179
- case REACT_FRAGMENT_TYPE:
180
- case REACT_PROFILER_TYPE:
181
- case REACT_STRICT_MODE_TYPE:
182
- case REACT_SUSPENSE_TYPE:
183
- return type;
184
- default:
185
- var $$typeofType = type && type.$$typeof;
186
- switch ($$typeofType) {
187
- case REACT_CONTEXT_TYPE:
188
- case REACT_FORWARD_REF_TYPE:
189
- case REACT_LAZY_TYPE:
190
- case REACT_MEMO_TYPE:
191
- case REACT_PROVIDER_TYPE:
192
- return $$typeofType;
193
- default:
194
- return $$typeof;
195
- }
196
- }
197
- case REACT_PORTAL_TYPE:
198
- return $$typeof;
199
- }
200
- }
201
- return void 0;
202
- }
203
- var AsyncMode = REACT_ASYNC_MODE_TYPE;
204
- var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
205
- var ContextConsumer = REACT_CONTEXT_TYPE;
206
- var ContextProvider = REACT_PROVIDER_TYPE;
207
- var Element = REACT_ELEMENT_TYPE;
208
- var ForwardRef = REACT_FORWARD_REF_TYPE;
209
- var Fragment6 = REACT_FRAGMENT_TYPE;
210
- var Lazy = REACT_LAZY_TYPE;
211
- var Memo = REACT_MEMO_TYPE;
212
- var Portal = REACT_PORTAL_TYPE;
213
- var Profiler = REACT_PROFILER_TYPE;
214
- var StrictMode = REACT_STRICT_MODE_TYPE;
215
- var Suspense = REACT_SUSPENSE_TYPE;
216
- var hasWarnedAboutDeprecatedIsAsyncMode = false;
217
- function isAsyncMode(object) {
218
- {
219
- if (!hasWarnedAboutDeprecatedIsAsyncMode) {
220
- hasWarnedAboutDeprecatedIsAsyncMode = true;
221
- console["warn"]("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.");
222
- }
223
- }
224
- return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
225
- }
226
- function isConcurrentMode(object) {
227
- return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
228
- }
229
- function isContextConsumer(object) {
230
- return typeOf(object) === REACT_CONTEXT_TYPE;
231
- }
232
- function isContextProvider(object) {
233
- return typeOf(object) === REACT_PROVIDER_TYPE;
234
- }
235
- function isElement(object) {
236
- return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
237
- }
238
- function isForwardRef(object) {
239
- return typeOf(object) === REACT_FORWARD_REF_TYPE;
240
- }
241
- function isFragment(object) {
242
- return typeOf(object) === REACT_FRAGMENT_TYPE;
243
- }
244
- function isLazy(object) {
245
- return typeOf(object) === REACT_LAZY_TYPE;
246
- }
247
- function isMemo(object) {
248
- return typeOf(object) === REACT_MEMO_TYPE;
249
- }
250
- function isPortal(object) {
251
- return typeOf(object) === REACT_PORTAL_TYPE;
252
- }
253
- function isProfiler(object) {
254
- return typeOf(object) === REACT_PROFILER_TYPE;
255
- }
256
- function isStrictMode(object) {
257
- return typeOf(object) === REACT_STRICT_MODE_TYPE;
258
- }
259
- function isSuspense(object) {
260
- return typeOf(object) === REACT_SUSPENSE_TYPE;
261
- }
262
- exports.AsyncMode = AsyncMode;
263
- exports.ConcurrentMode = ConcurrentMode;
264
- exports.ContextConsumer = ContextConsumer;
265
- exports.ContextProvider = ContextProvider;
266
- exports.Element = Element;
267
- exports.ForwardRef = ForwardRef;
268
- exports.Fragment = Fragment6;
269
- exports.Lazy = Lazy;
270
- exports.Memo = Memo;
271
- exports.Portal = Portal;
272
- exports.Profiler = Profiler;
273
- exports.StrictMode = StrictMode;
274
- exports.Suspense = Suspense;
275
- exports.isAsyncMode = isAsyncMode;
276
- exports.isConcurrentMode = isConcurrentMode;
277
- exports.isContextConsumer = isContextConsumer;
278
- exports.isContextProvider = isContextProvider;
279
- exports.isElement = isElement;
280
- exports.isForwardRef = isForwardRef;
281
- exports.isFragment = isFragment;
282
- exports.isLazy = isLazy;
283
- exports.isMemo = isMemo;
284
- exports.isPortal = isPortal;
285
- exports.isProfiler = isProfiler;
286
- exports.isStrictMode = isStrictMode;
287
- exports.isSuspense = isSuspense;
288
- exports.isValidElementType = isValidElementType;
289
- exports.typeOf = typeOf;
290
- })();
291
- }
292
- }
293
- });
294
-
295
- // ../../node_modules/react-is/index.js
296
- var require_react_is = __commonJS({
297
- "../../node_modules/react-is/index.js"(exports, module) {
298
- "use strict";
299
- if (process.env.NODE_ENV === "production") {
300
- module.exports = require_react_is_production_min();
301
- } else {
302
- module.exports = require_react_is_development();
303
- }
304
- }
305
- });
306
-
307
- // ../../node_modules/object-assign/index.js
308
- var require_object_assign = __commonJS({
309
- "../../node_modules/object-assign/index.js"(exports, module) {
310
- "use strict";
311
- var getOwnPropertySymbols = Object.getOwnPropertySymbols;
312
- var hasOwnProperty = Object.prototype.hasOwnProperty;
313
- var propIsEnumerable = Object.prototype.propertyIsEnumerable;
314
- function toObject(val) {
315
- if (val === null || val === void 0) {
316
- throw new TypeError("Object.assign cannot be called with null or undefined");
317
- }
318
- return Object(val);
319
- }
320
- function shouldUseNative() {
321
- try {
322
- if (!Object.assign) {
323
- return false;
324
- }
325
- var test1 = new String("abc");
326
- test1[5] = "de";
327
- if (Object.getOwnPropertyNames(test1)[0] === "5") {
328
- return false;
329
- }
330
- var test2 = {};
331
- for (var i = 0; i < 10; i++) {
332
- test2["_" + String.fromCharCode(i)] = i;
333
- }
334
- var order2 = Object.getOwnPropertyNames(test2).map(function(n) {
335
- return test2[n];
336
- });
337
- if (order2.join("") !== "0123456789") {
338
- return false;
339
- }
340
- var test3 = {};
341
- "abcdefghijklmnopqrst".split("").forEach(function(letter) {
342
- test3[letter] = letter;
343
- });
344
- if (Object.keys(Object.assign({}, test3)).join("") !== "abcdefghijklmnopqrst") {
345
- return false;
346
- }
347
- return true;
348
- } catch (err) {
349
- return false;
350
- }
351
- }
352
- module.exports = shouldUseNative() ? Object.assign : function(target, source) {
353
- var from;
354
- var to = toObject(target);
355
- var symbols;
356
- for (var s = 1; s < arguments.length; s++) {
357
- from = Object(arguments[s]);
358
- for (var key in from) {
359
- if (hasOwnProperty.call(from, key)) {
360
- to[key] = from[key];
361
- }
362
- }
363
- if (getOwnPropertySymbols) {
364
- symbols = getOwnPropertySymbols(from);
365
- for (var i = 0; i < symbols.length; i++) {
366
- if (propIsEnumerable.call(from, symbols[i])) {
367
- to[symbols[i]] = from[symbols[i]];
368
- }
369
- }
370
- }
371
- }
372
- return to;
373
- };
374
- }
375
- });
376
-
377
- // ../../node_modules/prop-types/lib/ReactPropTypesSecret.js
378
- var require_ReactPropTypesSecret = __commonJS({
379
- "../../node_modules/prop-types/lib/ReactPropTypesSecret.js"(exports, module) {
380
- "use strict";
381
- var ReactPropTypesSecret = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
382
- module.exports = ReactPropTypesSecret;
383
- }
384
- });
385
-
386
- // ../../node_modules/prop-types/lib/has.js
387
- var require_has = __commonJS({
388
- "../../node_modules/prop-types/lib/has.js"(exports, module) {
389
- "use strict";
390
- module.exports = Function.call.bind(Object.prototype.hasOwnProperty);
391
- }
392
- });
393
-
394
- // ../../node_modules/prop-types/checkPropTypes.js
395
- var require_checkPropTypes = __commonJS({
396
- "../../node_modules/prop-types/checkPropTypes.js"(exports, module) {
397
- "use strict";
398
- var printWarning = function() {
399
- };
400
- if (process.env.NODE_ENV !== "production") {
401
- ReactPropTypesSecret = require_ReactPropTypesSecret();
402
- loggedTypeFailures = {};
403
- has = require_has();
404
- printWarning = function(text) {
405
- var message = "Warning: " + text;
406
- if (typeof console !== "undefined") {
407
- console.error(message);
408
- }
409
- try {
410
- throw new Error(message);
411
- } catch (x) {
412
- }
413
- };
414
- }
415
- var ReactPropTypesSecret;
416
- var loggedTypeFailures;
417
- var has;
418
- function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
419
- if (process.env.NODE_ENV !== "production") {
420
- for (var typeSpecName in typeSpecs) {
421
- if (has(typeSpecs, typeSpecName)) {
422
- var error;
423
- try {
424
- if (typeof typeSpecs[typeSpecName] !== "function") {
425
- var err = Error(
426
- (componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."
427
- );
428
- err.name = "Invariant Violation";
429
- throw err;
430
- }
431
- error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
432
- } catch (ex) {
433
- error = ex;
434
- }
435
- if (error && !(error instanceof Error)) {
436
- printWarning(
437
- (componentName || "React class") + ": type specification of " + location + " `" + typeSpecName + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof error + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."
438
- );
439
- }
440
- if (error instanceof Error && !(error.message in loggedTypeFailures)) {
441
- loggedTypeFailures[error.message] = true;
442
- var stack = getStack ? getStack() : "";
443
- printWarning(
444
- "Failed " + location + " type: " + error.message + (stack != null ? stack : "")
445
- );
446
- }
447
- }
448
- }
449
- }
450
- }
451
- checkPropTypes.resetWarningCache = function() {
452
- if (process.env.NODE_ENV !== "production") {
453
- loggedTypeFailures = {};
454
- }
455
- };
456
- module.exports = checkPropTypes;
457
- }
458
- });
459
-
460
- // ../../node_modules/prop-types/factoryWithTypeCheckers.js
461
- var require_factoryWithTypeCheckers = __commonJS({
462
- "../../node_modules/prop-types/factoryWithTypeCheckers.js"(exports, module) {
463
- "use strict";
464
- var ReactIs = require_react_is();
465
- var assign = require_object_assign();
466
- var ReactPropTypesSecret = require_ReactPropTypesSecret();
467
- var has = require_has();
468
- var checkPropTypes = require_checkPropTypes();
469
- var printWarning = function() {
470
- };
471
- if (process.env.NODE_ENV !== "production") {
472
- printWarning = function(text) {
473
- var message = "Warning: " + text;
474
- if (typeof console !== "undefined") {
475
- console.error(message);
476
- }
477
- try {
478
- throw new Error(message);
479
- } catch (x) {
480
- }
481
- };
482
- }
483
- function emptyFunctionThatReturnsNull() {
484
- return null;
485
- }
486
- module.exports = function(isValidElement2, throwOnDirectAccess) {
487
- var ITERATOR_SYMBOL = typeof Symbol === "function" && Symbol.iterator;
488
- var FAUX_ITERATOR_SYMBOL = "@@iterator";
489
- function getIteratorFn(maybeIterable) {
490
- var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
491
- if (typeof iteratorFn === "function") {
492
- return iteratorFn;
493
- }
494
- }
495
- var ANONYMOUS = "<<anonymous>>";
496
- var ReactPropTypes = {
497
- array: createPrimitiveTypeChecker("array"),
498
- bigint: createPrimitiveTypeChecker("bigint"),
499
- bool: createPrimitiveTypeChecker("boolean"),
500
- func: createPrimitiveTypeChecker("function"),
501
- number: createPrimitiveTypeChecker("number"),
502
- object: createPrimitiveTypeChecker("object"),
503
- string: createPrimitiveTypeChecker("string"),
504
- symbol: createPrimitiveTypeChecker("symbol"),
505
- any: createAnyTypeChecker(),
506
- arrayOf: createArrayOfTypeChecker,
507
- element: createElementTypeChecker(),
508
- elementType: createElementTypeTypeChecker(),
509
- instanceOf: createInstanceTypeChecker,
510
- node: createNodeChecker(),
511
- objectOf: createObjectOfTypeChecker,
512
- oneOf: createEnumTypeChecker,
513
- oneOfType: createUnionTypeChecker,
514
- shape: createShapeTypeChecker,
515
- exact: createStrictShapeTypeChecker
516
- };
517
- function is(x, y) {
518
- if (x === y) {
519
- return x !== 0 || 1 / x === 1 / y;
520
- } else {
521
- return x !== x && y !== y;
522
- }
523
- }
524
- function PropTypeError(message, data) {
525
- this.message = message;
526
- this.data = data && typeof data === "object" ? data : {};
527
- this.stack = "";
528
- }
529
- PropTypeError.prototype = Error.prototype;
530
- function createChainableTypeChecker(validate) {
531
- if (process.env.NODE_ENV !== "production") {
532
- var manualPropTypeCallCache = {};
533
- var manualPropTypeWarningCount = 0;
534
- }
535
- function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
536
- componentName = componentName || ANONYMOUS;
537
- propFullName = propFullName || propName;
538
- if (secret !== ReactPropTypesSecret) {
539
- if (throwOnDirectAccess) {
540
- var err = new Error(
541
- "Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types"
542
- );
543
- err.name = "Invariant Violation";
544
- throw err;
545
- } else if (process.env.NODE_ENV !== "production" && typeof console !== "undefined") {
546
- var cacheKey = componentName + ":" + propName;
547
- if (!manualPropTypeCallCache[cacheKey] && // Avoid spamming the console because they are often not actionable except for lib authors
548
- manualPropTypeWarningCount < 3) {
549
- printWarning(
550
- "You are manually calling a React.PropTypes validation function for the `" + propFullName + "` prop on `" + componentName + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."
551
- );
552
- manualPropTypeCallCache[cacheKey] = true;
553
- manualPropTypeWarningCount++;
554
- }
555
- }
556
- }
557
- if (props[propName] == null) {
558
- if (isRequired) {
559
- if (props[propName] === null) {
560
- return new PropTypeError("The " + location + " `" + propFullName + "` is marked as required " + ("in `" + componentName + "`, but its value is `null`."));
561
- }
562
- return new PropTypeError("The " + location + " `" + propFullName + "` is marked as required in " + ("`" + componentName + "`, but its value is `undefined`."));
563
- }
564
- return null;
565
- } else {
566
- return validate(props, propName, componentName, location, propFullName);
567
- }
568
- }
569
- var chainedCheckType = checkType.bind(null, false);
570
- chainedCheckType.isRequired = checkType.bind(null, true);
571
- return chainedCheckType;
572
- }
573
- function createPrimitiveTypeChecker(expectedType) {
574
- function validate(props, propName, componentName, location, propFullName, secret) {
575
- var propValue = props[propName];
576
- var propType = getPropType(propValue);
577
- if (propType !== expectedType) {
578
- var preciseType = getPreciseType(propValue);
579
- return new PropTypeError(
580
- "Invalid " + location + " `" + propFullName + "` of type " + ("`" + preciseType + "` supplied to `" + componentName + "`, expected ") + ("`" + expectedType + "`."),
581
- { expectedType }
582
- );
583
- }
584
- return null;
585
- }
586
- return createChainableTypeChecker(validate);
587
- }
588
- function createAnyTypeChecker() {
589
- return createChainableTypeChecker(emptyFunctionThatReturnsNull);
590
- }
591
- function createArrayOfTypeChecker(typeChecker) {
592
- function validate(props, propName, componentName, location, propFullName) {
593
- if (typeof typeChecker !== "function") {
594
- return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside arrayOf.");
595
- }
596
- var propValue = props[propName];
597
- if (!Array.isArray(propValue)) {
598
- var propType = getPropType(propValue);
599
- return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an array."));
600
- }
601
- for (var i = 0; i < propValue.length; i++) {
602
- var error = typeChecker(propValue, i, componentName, location, propFullName + "[" + i + "]", ReactPropTypesSecret);
603
- if (error instanceof Error) {
604
- return error;
605
- }
606
- }
607
- return null;
608
- }
609
- return createChainableTypeChecker(validate);
610
- }
611
- function createElementTypeChecker() {
612
- function validate(props, propName, componentName, location, propFullName) {
613
- var propValue = props[propName];
614
- if (!isValidElement2(propValue)) {
615
- var propType = getPropType(propValue);
616
- return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement."));
617
- }
618
- return null;
619
- }
620
- return createChainableTypeChecker(validate);
621
- }
622
- function createElementTypeTypeChecker() {
623
- function validate(props, propName, componentName, location, propFullName) {
624
- var propValue = props[propName];
625
- if (!ReactIs.isValidElementType(propValue)) {
626
- var propType = getPropType(propValue);
627
- return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement type."));
628
- }
629
- return null;
630
- }
631
- return createChainableTypeChecker(validate);
632
- }
633
- function createInstanceTypeChecker(expectedClass) {
634
- function validate(props, propName, componentName, location, propFullName) {
635
- if (!(props[propName] instanceof expectedClass)) {
636
- var expectedClassName = expectedClass.name || ANONYMOUS;
637
- var actualClassName = getClassName(props[propName]);
638
- return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + actualClassName + "` supplied to `" + componentName + "`, expected ") + ("instance of `" + expectedClassName + "`."));
639
- }
640
- return null;
641
- }
642
- return createChainableTypeChecker(validate);
643
- }
644
- function createEnumTypeChecker(expectedValues) {
645
- if (!Array.isArray(expectedValues)) {
646
- if (process.env.NODE_ENV !== "production") {
647
- if (arguments.length > 1) {
648
- printWarning(
649
- "Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."
650
- );
651
- } else {
652
- printWarning("Invalid argument supplied to oneOf, expected an array.");
653
- }
654
- }
655
- return emptyFunctionThatReturnsNull;
656
- }
657
- function validate(props, propName, componentName, location, propFullName) {
658
- var propValue = props[propName];
659
- for (var i = 0; i < expectedValues.length; i++) {
660
- if (is(propValue, expectedValues[i])) {
661
- return null;
662
- }
663
- }
664
- var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
665
- var type = getPreciseType(value);
666
- if (type === "symbol") {
667
- return String(value);
668
- }
669
- return value;
670
- });
671
- return new PropTypeError("Invalid " + location + " `" + propFullName + "` of value `" + String(propValue) + "` " + ("supplied to `" + componentName + "`, expected one of " + valuesString + "."));
672
- }
673
- return createChainableTypeChecker(validate);
674
- }
675
- function createObjectOfTypeChecker(typeChecker) {
676
- function validate(props, propName, componentName, location, propFullName) {
677
- if (typeof typeChecker !== "function") {
678
- return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside objectOf.");
679
- }
680
- var propValue = props[propName];
681
- var propType = getPropType(propValue);
682
- if (propType !== "object") {
683
- return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an object."));
684
- }
685
- for (var key in propValue) {
686
- if (has(propValue, key)) {
687
- var error = typeChecker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
688
- if (error instanceof Error) {
689
- return error;
690
- }
691
- }
692
- }
693
- return null;
694
- }
695
- return createChainableTypeChecker(validate);
696
- }
697
- function createUnionTypeChecker(arrayOfTypeCheckers) {
698
- if (!Array.isArray(arrayOfTypeCheckers)) {
699
- process.env.NODE_ENV !== "production" ? printWarning("Invalid argument supplied to oneOfType, expected an instance of array.") : void 0;
700
- return emptyFunctionThatReturnsNull;
701
- }
702
- for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
703
- var checker = arrayOfTypeCheckers[i];
704
- if (typeof checker !== "function") {
705
- printWarning(
706
- "Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + getPostfixForTypeWarning(checker) + " at index " + i + "."
707
- );
708
- return emptyFunctionThatReturnsNull;
709
- }
710
- }
711
- function validate(props, propName, componentName, location, propFullName) {
712
- var expectedTypes = [];
713
- for (var i2 = 0; i2 < arrayOfTypeCheckers.length; i2++) {
714
- var checker2 = arrayOfTypeCheckers[i2];
715
- var checkerResult = checker2(props, propName, componentName, location, propFullName, ReactPropTypesSecret);
716
- if (checkerResult == null) {
717
- return null;
718
- }
719
- if (checkerResult.data && has(checkerResult.data, "expectedType")) {
720
- expectedTypes.push(checkerResult.data.expectedType);
721
- }
722
- }
723
- var expectedTypesMessage = expectedTypes.length > 0 ? ", expected one of type [" + expectedTypes.join(", ") + "]" : "";
724
- return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName + "`" + expectedTypesMessage + "."));
725
- }
726
- return createChainableTypeChecker(validate);
727
- }
728
- function createNodeChecker() {
729
- function validate(props, propName, componentName, location, propFullName) {
730
- if (!isNode(props[propName])) {
731
- return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName + "`, expected a ReactNode."));
732
- }
733
- return null;
734
- }
735
- return createChainableTypeChecker(validate);
736
- }
737
- function invalidValidatorError(componentName, location, propFullName, key, type) {
738
- return new PropTypeError(
739
- (componentName || "React class") + ": " + location + " type `" + propFullName + "." + key + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + type + "`."
740
- );
741
- }
742
- function createShapeTypeChecker(shapeTypes) {
743
- function validate(props, propName, componentName, location, propFullName) {
744
- var propValue = props[propName];
745
- var propType = getPropType(propValue);
746
- if (propType !== "object") {
747
- return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`."));
748
- }
749
- for (var key in shapeTypes) {
750
- var checker = shapeTypes[key];
751
- if (typeof checker !== "function") {
752
- return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
753
- }
754
- var error = checker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
755
- if (error) {
756
- return error;
757
- }
758
- }
759
- return null;
760
- }
761
- return createChainableTypeChecker(validate);
762
- }
763
- function createStrictShapeTypeChecker(shapeTypes) {
764
- function validate(props, propName, componentName, location, propFullName) {
765
- var propValue = props[propName];
766
- var propType = getPropType(propValue);
767
- if (propType !== "object") {
768
- return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`."));
769
- }
770
- var allKeys = assign({}, props[propName], shapeTypes);
771
- for (var key in allKeys) {
772
- var checker = shapeTypes[key];
773
- if (has(shapeTypes, key) && typeof checker !== "function") {
774
- return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
775
- }
776
- if (!checker) {
777
- return new PropTypeError(
778
- "Invalid " + location + " `" + propFullName + "` key `" + key + "` supplied to `" + componentName + "`.\nBad object: " + JSON.stringify(props[propName], null, " ") + "\nValid keys: " + JSON.stringify(Object.keys(shapeTypes), null, " ")
779
- );
780
- }
781
- var error = checker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
782
- if (error) {
783
- return error;
784
- }
785
- }
786
- return null;
787
- }
788
- return createChainableTypeChecker(validate);
789
- }
790
- function isNode(propValue) {
791
- switch (typeof propValue) {
792
- case "number":
793
- case "string":
794
- case "undefined":
795
- return true;
796
- case "boolean":
797
- return !propValue;
798
- case "object":
799
- if (Array.isArray(propValue)) {
800
- return propValue.every(isNode);
801
- }
802
- if (propValue === null || isValidElement2(propValue)) {
803
- return true;
804
- }
805
- var iteratorFn = getIteratorFn(propValue);
806
- if (iteratorFn) {
807
- var iterator = iteratorFn.call(propValue);
808
- var step;
809
- if (iteratorFn !== propValue.entries) {
810
- while (!(step = iterator.next()).done) {
811
- if (!isNode(step.value)) {
812
- return false;
813
- }
814
- }
815
- } else {
816
- while (!(step = iterator.next()).done) {
817
- var entry = step.value;
818
- if (entry) {
819
- if (!isNode(entry[1])) {
820
- return false;
821
- }
822
- }
823
- }
824
- }
825
- } else {
826
- return false;
827
- }
828
- return true;
829
- default:
830
- return false;
831
- }
832
- }
833
- function isSymbol(propType, propValue) {
834
- if (propType === "symbol") {
835
- return true;
836
- }
837
- if (!propValue) {
838
- return false;
839
- }
840
- if (propValue["@@toStringTag"] === "Symbol") {
841
- return true;
842
- }
843
- if (typeof Symbol === "function" && propValue instanceof Symbol) {
844
- return true;
845
- }
846
- return false;
847
- }
848
- function getPropType(propValue) {
849
- var propType = typeof propValue;
850
- if (Array.isArray(propValue)) {
851
- return "array";
852
- }
853
- if (propValue instanceof RegExp) {
854
- return "object";
855
- }
856
- if (isSymbol(propType, propValue)) {
857
- return "symbol";
858
- }
859
- return propType;
860
- }
861
- function getPreciseType(propValue) {
862
- if (typeof propValue === "undefined" || propValue === null) {
863
- return "" + propValue;
864
- }
865
- var propType = getPropType(propValue);
866
- if (propType === "object") {
867
- if (propValue instanceof Date) {
868
- return "date";
869
- } else if (propValue instanceof RegExp) {
870
- return "regexp";
871
- }
872
- }
873
- return propType;
874
- }
875
- function getPostfixForTypeWarning(value) {
876
- var type = getPreciseType(value);
877
- switch (type) {
878
- case "array":
879
- case "object":
880
- return "an " + type;
881
- case "boolean":
882
- case "date":
883
- case "regexp":
884
- return "a " + type;
885
- default:
886
- return type;
887
- }
888
- }
889
- function getClassName(propValue) {
890
- if (!propValue.constructor || !propValue.constructor.name) {
891
- return ANONYMOUS;
892
- }
893
- return propValue.constructor.name;
894
- }
895
- ReactPropTypes.checkPropTypes = checkPropTypes;
896
- ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
897
- ReactPropTypes.PropTypes = ReactPropTypes;
898
- return ReactPropTypes;
899
- };
900
- }
901
- });
902
-
903
- // ../../node_modules/prop-types/factoryWithThrowingShims.js
904
- var require_factoryWithThrowingShims = __commonJS({
905
- "../../node_modules/prop-types/factoryWithThrowingShims.js"(exports, module) {
906
- "use strict";
907
- var ReactPropTypesSecret = require_ReactPropTypesSecret();
908
- function emptyFunction() {
909
- }
910
- function emptyFunctionWithReset() {
911
- }
912
- emptyFunctionWithReset.resetWarningCache = emptyFunction;
913
- module.exports = function() {
914
- function shim(props, propName, componentName, location, propFullName, secret) {
915
- if (secret === ReactPropTypesSecret) {
916
- return;
917
- }
918
- var err = new Error(
919
- "Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types"
920
- );
921
- err.name = "Invariant Violation";
922
- throw err;
923
- }
924
- ;
925
- shim.isRequired = shim;
926
- function getShim() {
927
- return shim;
928
- }
929
- ;
930
- var ReactPropTypes = {
931
- array: shim,
932
- bigint: shim,
933
- bool: shim,
934
- func: shim,
935
- number: shim,
936
- object: shim,
937
- string: shim,
938
- symbol: shim,
939
- any: shim,
940
- arrayOf: getShim,
941
- element: shim,
942
- elementType: shim,
943
- instanceOf: getShim,
944
- node: shim,
945
- objectOf: getShim,
946
- oneOf: getShim,
947
- oneOfType: getShim,
948
- shape: getShim,
949
- exact: getShim,
950
- checkPropTypes: emptyFunctionWithReset,
951
- resetWarningCache: emptyFunction
952
- };
953
- ReactPropTypes.PropTypes = ReactPropTypes;
954
- return ReactPropTypes;
955
- };
956
- }
957
- });
958
-
959
- // ../../node_modules/prop-types/index.js
960
- var require_prop_types = __commonJS({
961
- "../../node_modules/prop-types/index.js"(exports, module) {
962
- "use strict";
963
- if (process.env.NODE_ENV !== "production") {
964
- ReactIs = require_react_is();
965
- throwOnDirectAccess = true;
966
- module.exports = require_factoryWithTypeCheckers()(ReactIs.isElement, throwOnDirectAccess);
967
- } else {
968
- module.exports = require_factoryWithThrowingShims()();
969
- }
970
- var ReactIs;
971
- var throwOnDirectAccess;
972
- }
973
- });
974
-
975
1
  // src/SpreePay.tsx
976
2
  import { useCallback as useCallback5, useEffect as useEffect5 } from "react";
977
3
  import { SWRConfig } from "swr";
@@ -3996,811 +3022,8 @@ var SpreeLegal = () => {
3996
3022
 
3997
3023
  // src/components/Tabs.tsx
3998
3024
  import { useMemo as useMemo4 } from "react";
3999
-
4000
- // ../../node_modules/@stripe/react-stripe-js/dist/react-stripe.esm.mjs
4001
- var import_prop_types = __toESM(require_prop_types(), 1);
4002
- import React from "react";
4003
- function ownKeys(object, enumerableOnly) {
4004
- var keys = Object.keys(object);
4005
- if (Object.getOwnPropertySymbols) {
4006
- var symbols = Object.getOwnPropertySymbols(object);
4007
- if (enumerableOnly) {
4008
- symbols = symbols.filter(function(sym) {
4009
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
4010
- });
4011
- }
4012
- keys.push.apply(keys, symbols);
4013
- }
4014
- return keys;
4015
- }
4016
- function _objectSpread2(target) {
4017
- for (var i = 1; i < arguments.length; i++) {
4018
- var source = arguments[i] != null ? arguments[i] : {};
4019
- if (i % 2) {
4020
- ownKeys(Object(source), true).forEach(function(key) {
4021
- _defineProperty(target, key, source[key]);
4022
- });
4023
- } else if (Object.getOwnPropertyDescriptors) {
4024
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
4025
- } else {
4026
- ownKeys(Object(source)).forEach(function(key) {
4027
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
4028
- });
4029
- }
4030
- }
4031
- return target;
4032
- }
4033
- function _typeof(obj) {
4034
- "@babel/helpers - typeof";
4035
- if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
4036
- _typeof = function(obj2) {
4037
- return typeof obj2;
4038
- };
4039
- } else {
4040
- _typeof = function(obj2) {
4041
- return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
4042
- };
4043
- }
4044
- return _typeof(obj);
4045
- }
4046
- function _defineProperty(obj, key, value) {
4047
- if (key in obj) {
4048
- Object.defineProperty(obj, key, {
4049
- value,
4050
- enumerable: true,
4051
- configurable: true,
4052
- writable: true
4053
- });
4054
- } else {
4055
- obj[key] = value;
4056
- }
4057
- return obj;
4058
- }
4059
- function _objectWithoutPropertiesLoose(source, excluded) {
4060
- if (source == null) return {};
4061
- var target = {};
4062
- var sourceKeys = Object.keys(source);
4063
- var key, i;
4064
- for (i = 0; i < sourceKeys.length; i++) {
4065
- key = sourceKeys[i];
4066
- if (excluded.indexOf(key) >= 0) continue;
4067
- target[key] = source[key];
4068
- }
4069
- return target;
4070
- }
4071
- function _objectWithoutProperties(source, excluded) {
4072
- if (source == null) return {};
4073
- var target = _objectWithoutPropertiesLoose(source, excluded);
4074
- var key, i;
4075
- if (Object.getOwnPropertySymbols) {
4076
- var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
4077
- for (i = 0; i < sourceSymbolKeys.length; i++) {
4078
- key = sourceSymbolKeys[i];
4079
- if (excluded.indexOf(key) >= 0) continue;
4080
- if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
4081
- target[key] = source[key];
4082
- }
4083
- }
4084
- return target;
4085
- }
4086
- function _slicedToArray(arr, i) {
4087
- return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
4088
- }
4089
- function _arrayWithHoles(arr) {
4090
- if (Array.isArray(arr)) return arr;
4091
- }
4092
- function _iterableToArrayLimit(arr, i) {
4093
- var _i = arr && (typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]);
4094
- if (_i == null) return;
4095
- var _arr = [];
4096
- var _n = true;
4097
- var _d = false;
4098
- var _s, _e;
4099
- try {
4100
- for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
4101
- _arr.push(_s.value);
4102
- if (i && _arr.length === i) break;
4103
- }
4104
- } catch (err) {
4105
- _d = true;
4106
- _e = err;
4107
- } finally {
4108
- try {
4109
- if (!_n && _i["return"] != null) _i["return"]();
4110
- } finally {
4111
- if (_d) throw _e;
4112
- }
4113
- }
4114
- return _arr;
4115
- }
4116
- function _unsupportedIterableToArray(o, minLen) {
4117
- if (!o) return;
4118
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
4119
- var n = Object.prototype.toString.call(o).slice(8, -1);
4120
- if (n === "Object" && o.constructor) n = o.constructor.name;
4121
- if (n === "Map" || n === "Set") return Array.from(o);
4122
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
4123
- }
4124
- function _arrayLikeToArray(arr, len) {
4125
- if (len == null || len > arr.length) len = arr.length;
4126
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
4127
- return arr2;
4128
- }
4129
- function _nonIterableRest() {
4130
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
4131
- }
4132
- var useAttachEvent = function useAttachEvent2(element, event, cb) {
4133
- var cbDefined = !!cb;
4134
- var cbRef = React.useRef(cb);
4135
- React.useEffect(function() {
4136
- cbRef.current = cb;
4137
- }, [cb]);
4138
- React.useEffect(function() {
4139
- if (!cbDefined || !element) {
4140
- return function() {
4141
- };
4142
- }
4143
- var decoratedCb = function decoratedCb2() {
4144
- if (cbRef.current) {
4145
- cbRef.current.apply(cbRef, arguments);
4146
- }
4147
- };
4148
- element.on(event, decoratedCb);
4149
- return function() {
4150
- element.off(event, decoratedCb);
4151
- };
4152
- }, [cbDefined, event, element, cbRef]);
4153
- };
4154
- var usePrevious = function usePrevious2(value) {
4155
- var ref = React.useRef(value);
4156
- React.useEffect(function() {
4157
- ref.current = value;
4158
- }, [value]);
4159
- return ref.current;
4160
- };
4161
- var isUnknownObject = function isUnknownObject2(raw) {
4162
- return raw !== null && _typeof(raw) === "object";
4163
- };
4164
- var isPromise = function isPromise2(raw) {
4165
- return isUnknownObject(raw) && typeof raw.then === "function";
4166
- };
4167
- var isStripe = function isStripe2(raw) {
4168
- return isUnknownObject(raw) && typeof raw.elements === "function" && typeof raw.createToken === "function" && typeof raw.createPaymentMethod === "function" && typeof raw.confirmCardPayment === "function";
4169
- };
4170
- var PLAIN_OBJECT_STR = "[object Object]";
4171
- var isEqual = function isEqual2(left, right) {
4172
- if (!isUnknownObject(left) || !isUnknownObject(right)) {
4173
- return left === right;
4174
- }
4175
- var leftArray = Array.isArray(left);
4176
- var rightArray = Array.isArray(right);
4177
- if (leftArray !== rightArray) return false;
4178
- var leftPlainObject = Object.prototype.toString.call(left) === PLAIN_OBJECT_STR;
4179
- var rightPlainObject = Object.prototype.toString.call(right) === PLAIN_OBJECT_STR;
4180
- if (leftPlainObject !== rightPlainObject) return false;
4181
- if (!leftPlainObject && !leftArray) return left === right;
4182
- var leftKeys = Object.keys(left);
4183
- var rightKeys = Object.keys(right);
4184
- if (leftKeys.length !== rightKeys.length) return false;
4185
- var keySet = {};
4186
- for (var i = 0; i < leftKeys.length; i += 1) {
4187
- keySet[leftKeys[i]] = true;
4188
- }
4189
- for (var _i = 0; _i < rightKeys.length; _i += 1) {
4190
- keySet[rightKeys[_i]] = true;
4191
- }
4192
- var allKeys = Object.keys(keySet);
4193
- if (allKeys.length !== leftKeys.length) {
4194
- return false;
4195
- }
4196
- var l = left;
4197
- var r2 = right;
4198
- var pred = function pred2(key) {
4199
- return isEqual2(l[key], r2[key]);
4200
- };
4201
- return allKeys.every(pred);
4202
- };
4203
- var extractAllowedOptionsUpdates = function extractAllowedOptionsUpdates2(options, prevOptions, immutableKeys) {
4204
- if (!isUnknownObject(options)) {
4205
- return null;
4206
- }
4207
- return Object.keys(options).reduce(function(newOptions, key) {
4208
- var isUpdated = !isUnknownObject(prevOptions) || !isEqual(options[key], prevOptions[key]);
4209
- if (immutableKeys.includes(key)) {
4210
- if (isUpdated) {
4211
- console.warn("Unsupported prop change: options.".concat(key, " is not a mutable property."));
4212
- }
4213
- return newOptions;
4214
- }
4215
- if (!isUpdated) {
4216
- return newOptions;
4217
- }
4218
- return _objectSpread2(_objectSpread2({}, newOptions || {}), {}, _defineProperty({}, key, options[key]));
4219
- }, null);
4220
- };
4221
- var INVALID_STRIPE_ERROR$2 = "Invalid prop `stripe` supplied to `Elements`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.";
4222
- var validateStripe = function validateStripe2(maybeStripe) {
4223
- var errorMsg = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : INVALID_STRIPE_ERROR$2;
4224
- if (maybeStripe === null || isStripe(maybeStripe)) {
4225
- return maybeStripe;
4226
- }
4227
- throw new Error(errorMsg);
4228
- };
4229
- var parseStripeProp = function parseStripeProp2(raw) {
4230
- var errorMsg = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : INVALID_STRIPE_ERROR$2;
4231
- if (isPromise(raw)) {
4232
- return {
4233
- tag: "async",
4234
- stripePromise: Promise.resolve(raw).then(function(result) {
4235
- return validateStripe(result, errorMsg);
4236
- })
4237
- };
4238
- }
4239
- var stripe = validateStripe(raw, errorMsg);
4240
- if (stripe === null) {
4241
- return {
4242
- tag: "empty"
4243
- };
4244
- }
4245
- return {
4246
- tag: "sync",
4247
- stripe
4248
- };
4249
- };
4250
- var registerWithStripeJs = function registerWithStripeJs2(stripe) {
4251
- if (!stripe || !stripe._registerWrapper || !stripe.registerAppInfo) {
4252
- return;
4253
- }
4254
- stripe._registerWrapper({
4255
- name: "react-stripe-js",
4256
- version: "3.9.0"
4257
- });
4258
- stripe.registerAppInfo({
4259
- name: "react-stripe-js",
4260
- version: "3.9.0",
4261
- url: "https://stripe.com/docs/stripe-js/react"
4262
- });
4263
- };
4264
- var ElementsContext = /* @__PURE__ */ React.createContext(null);
4265
- ElementsContext.displayName = "ElementsContext";
4266
- var parseElementsContext = function parseElementsContext2(ctx, useCase) {
4267
- if (!ctx) {
4268
- throw new Error("Could not find Elements context; You need to wrap the part of your app that ".concat(useCase, " in an <Elements> provider."));
4269
- }
4270
- return ctx;
4271
- };
4272
- var Elements = function Elements2(_ref) {
4273
- var rawStripeProp = _ref.stripe, options = _ref.options, children = _ref.children;
4274
- var parsed = React.useMemo(function() {
4275
- return parseStripeProp(rawStripeProp);
4276
- }, [rawStripeProp]);
4277
- var _React$useState = React.useState(function() {
4278
- return {
4279
- stripe: parsed.tag === "sync" ? parsed.stripe : null,
4280
- elements: parsed.tag === "sync" ? parsed.stripe.elements(options) : null
4281
- };
4282
- }), _React$useState2 = _slicedToArray(_React$useState, 2), ctx = _React$useState2[0], setContext = _React$useState2[1];
4283
- React.useEffect(function() {
4284
- var isMounted = true;
4285
- var safeSetContext = function safeSetContext2(stripe) {
4286
- setContext(function(ctx2) {
4287
- if (ctx2.stripe) return ctx2;
4288
- return {
4289
- stripe,
4290
- elements: stripe.elements(options)
4291
- };
4292
- });
4293
- };
4294
- if (parsed.tag === "async" && !ctx.stripe) {
4295
- parsed.stripePromise.then(function(stripe) {
4296
- if (stripe && isMounted) {
4297
- safeSetContext(stripe);
4298
- }
4299
- });
4300
- } else if (parsed.tag === "sync" && !ctx.stripe) {
4301
- safeSetContext(parsed.stripe);
4302
- }
4303
- return function() {
4304
- isMounted = false;
4305
- };
4306
- }, [parsed, ctx, options]);
4307
- var prevStripe = usePrevious(rawStripeProp);
4308
- React.useEffect(function() {
4309
- if (prevStripe !== null && prevStripe !== rawStripeProp) {
4310
- console.warn("Unsupported prop change on Elements: You cannot change the `stripe` prop after setting it.");
4311
- }
4312
- }, [prevStripe, rawStripeProp]);
4313
- var prevOptions = usePrevious(options);
4314
- React.useEffect(function() {
4315
- if (!ctx.elements) {
4316
- return;
4317
- }
4318
- var updates = extractAllowedOptionsUpdates(options, prevOptions, ["clientSecret", "fonts"]);
4319
- if (updates) {
4320
- ctx.elements.update(updates);
4321
- }
4322
- }, [options, prevOptions, ctx.elements]);
4323
- React.useEffect(function() {
4324
- registerWithStripeJs(ctx.stripe);
4325
- }, [ctx.stripe]);
4326
- return /* @__PURE__ */ React.createElement(ElementsContext.Provider, {
4327
- value: ctx
4328
- }, children);
4329
- };
4330
- Elements.propTypes = {
4331
- stripe: import_prop_types.default.any,
4332
- options: import_prop_types.default.object
4333
- };
4334
- var useElementsContextWithUseCase = function useElementsContextWithUseCase2(useCaseMessage) {
4335
- var ctx = React.useContext(ElementsContext);
4336
- return parseElementsContext(ctx, useCaseMessage);
4337
- };
4338
- var useElements = function useElements2() {
4339
- var _useElementsContextWi = useElementsContextWithUseCase("calls useElements()"), elements = _useElementsContextWi.elements;
4340
- return elements;
4341
- };
4342
- var ElementsConsumer = function ElementsConsumer2(_ref2) {
4343
- var children = _ref2.children;
4344
- var ctx = useElementsContextWithUseCase("mounts <ElementsConsumer>");
4345
- return children(ctx);
4346
- };
4347
- ElementsConsumer.propTypes = {
4348
- children: import_prop_types.default.func.isRequired
4349
- };
4350
- var _excluded$1 = ["on", "session"];
4351
- var CheckoutSdkContext = /* @__PURE__ */ React.createContext(null);
4352
- CheckoutSdkContext.displayName = "CheckoutSdkContext";
4353
- var parseCheckoutSdkContext = function parseCheckoutSdkContext2(ctx, useCase) {
4354
- if (!ctx) {
4355
- throw new Error("Could not find CheckoutProvider context; You need to wrap the part of your app that ".concat(useCase, " in an <CheckoutProvider> provider."));
4356
- }
4357
- return ctx;
4358
- };
4359
- var CheckoutContext = /* @__PURE__ */ React.createContext(null);
4360
- CheckoutContext.displayName = "CheckoutContext";
4361
- var extractCheckoutContextValue = function extractCheckoutContextValue2(checkoutSdk, sessionState) {
4362
- if (!checkoutSdk) {
4363
- return null;
4364
- }
4365
- checkoutSdk.on;
4366
- checkoutSdk.session;
4367
- var actions = _objectWithoutProperties(checkoutSdk, _excluded$1);
4368
- if (!sessionState) {
4369
- return Object.assign(checkoutSdk.session(), actions);
4370
- }
4371
- return Object.assign(sessionState, actions);
4372
- };
4373
- var INVALID_STRIPE_ERROR$1 = "Invalid prop `stripe` supplied to `CheckoutProvider`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.";
4374
- var CheckoutProvider = function CheckoutProvider2(_ref) {
4375
- var rawStripeProp = _ref.stripe, options = _ref.options, children = _ref.children;
4376
- var parsed = React.useMemo(function() {
4377
- return parseStripeProp(rawStripeProp, INVALID_STRIPE_ERROR$1);
4378
- }, [rawStripeProp]);
4379
- var _React$useState = React.useState(null), _React$useState2 = _slicedToArray(_React$useState, 2), session = _React$useState2[0], setSession = _React$useState2[1];
4380
- var _React$useState3 = React.useState(function() {
4381
- return {
4382
- stripe: parsed.tag === "sync" ? parsed.stripe : null,
4383
- checkoutSdk: null
4384
- };
4385
- }), _React$useState4 = _slicedToArray(_React$useState3, 2), ctx = _React$useState4[0], setContext = _React$useState4[1];
4386
- var safeSetContext = function safeSetContext2(stripe, checkoutSdk) {
4387
- setContext(function(ctx2) {
4388
- if (ctx2.stripe && ctx2.checkoutSdk) {
4389
- return ctx2;
4390
- }
4391
- return {
4392
- stripe,
4393
- checkoutSdk
4394
- };
4395
- });
4396
- };
4397
- var initCheckoutCalledRef = React.useRef(false);
4398
- React.useEffect(function() {
4399
- var isMounted = true;
4400
- if (parsed.tag === "async" && !ctx.stripe) {
4401
- parsed.stripePromise.then(function(stripe) {
4402
- if (stripe && isMounted && !initCheckoutCalledRef.current) {
4403
- initCheckoutCalledRef.current = true;
4404
- stripe.initCheckout(options).then(function(checkoutSdk) {
4405
- if (checkoutSdk) {
4406
- safeSetContext(stripe, checkoutSdk);
4407
- checkoutSdk.on("change", setSession);
4408
- }
4409
- });
4410
- }
4411
- });
4412
- } else if (parsed.tag === "sync" && parsed.stripe && !initCheckoutCalledRef.current) {
4413
- initCheckoutCalledRef.current = true;
4414
- parsed.stripe.initCheckout(options).then(function(checkoutSdk) {
4415
- if (checkoutSdk) {
4416
- safeSetContext(parsed.stripe, checkoutSdk);
4417
- checkoutSdk.on("change", setSession);
4418
- }
4419
- });
4420
- }
4421
- return function() {
4422
- isMounted = false;
4423
- };
4424
- }, [parsed, ctx, options, setSession]);
4425
- var prevStripe = usePrevious(rawStripeProp);
4426
- React.useEffect(function() {
4427
- if (prevStripe !== null && prevStripe !== rawStripeProp) {
4428
- console.warn("Unsupported prop change on CheckoutProvider: You cannot change the `stripe` prop after setting it.");
4429
- }
4430
- }, [prevStripe, rawStripeProp]);
4431
- var prevOptions = usePrevious(options);
4432
- var prevCheckoutSdk = usePrevious(ctx.checkoutSdk);
4433
- React.useEffect(function() {
4434
- var _prevOptions$elements, _options$elementsOpti, _prevOptions$elements2, _options$elementsOpti2;
4435
- if (!ctx.checkoutSdk) {
4436
- return;
4437
- }
4438
- var hasSdkLoaded = Boolean(!prevCheckoutSdk && ctx.checkoutSdk);
4439
- var previousAppearance = prevOptions === null || prevOptions === void 0 ? void 0 : (_prevOptions$elements = prevOptions.elementsOptions) === null || _prevOptions$elements === void 0 ? void 0 : _prevOptions$elements.appearance;
4440
- var currentAppearance = options === null || options === void 0 ? void 0 : (_options$elementsOpti = options.elementsOptions) === null || _options$elementsOpti === void 0 ? void 0 : _options$elementsOpti.appearance;
4441
- var hasAppearanceChanged = !isEqual(currentAppearance, previousAppearance);
4442
- if (currentAppearance && (hasAppearanceChanged || hasSdkLoaded)) {
4443
- ctx.checkoutSdk.changeAppearance(currentAppearance);
4444
- }
4445
- var previousFonts = prevOptions === null || prevOptions === void 0 ? void 0 : (_prevOptions$elements2 = prevOptions.elementsOptions) === null || _prevOptions$elements2 === void 0 ? void 0 : _prevOptions$elements2.fonts;
4446
- var currentFonts = options === null || options === void 0 ? void 0 : (_options$elementsOpti2 = options.elementsOptions) === null || _options$elementsOpti2 === void 0 ? void 0 : _options$elementsOpti2.fonts;
4447
- var hasFontsChanged = !isEqual(previousFonts, currentFonts);
4448
- if (currentFonts && (hasFontsChanged || hasSdkLoaded)) {
4449
- ctx.checkoutSdk.loadFonts(currentFonts);
4450
- }
4451
- }, [options, prevOptions, ctx.checkoutSdk, prevCheckoutSdk]);
4452
- React.useEffect(function() {
4453
- registerWithStripeJs(ctx.stripe);
4454
- }, [ctx.stripe]);
4455
- var checkoutContextValue = React.useMemo(function() {
4456
- return extractCheckoutContextValue(ctx.checkoutSdk, session);
4457
- }, [ctx.checkoutSdk, session]);
4458
- if (!ctx.checkoutSdk) {
4459
- return null;
4460
- }
4461
- return /* @__PURE__ */ React.createElement(CheckoutSdkContext.Provider, {
4462
- value: ctx
4463
- }, /* @__PURE__ */ React.createElement(CheckoutContext.Provider, {
4464
- value: checkoutContextValue
4465
- }, children));
4466
- };
4467
- CheckoutProvider.propTypes = {
4468
- stripe: import_prop_types.default.any,
4469
- options: import_prop_types.default.shape({
4470
- fetchClientSecret: import_prop_types.default.func.isRequired,
4471
- elementsOptions: import_prop_types.default.object
4472
- }).isRequired
4473
- };
4474
- var useElementsOrCheckoutSdkContextWithUseCase = function useElementsOrCheckoutSdkContextWithUseCase2(useCaseString) {
4475
- var checkoutSdkContext = React.useContext(CheckoutSdkContext);
4476
- var elementsContext = React.useContext(ElementsContext);
4477
- if (checkoutSdkContext && elementsContext) {
4478
- throw new Error("You cannot wrap the part of your app that ".concat(useCaseString, " in both <CheckoutProvider> and <Elements> providers."));
4479
- }
4480
- if (checkoutSdkContext) {
4481
- return parseCheckoutSdkContext(checkoutSdkContext, useCaseString);
4482
- }
4483
- return parseElementsContext(elementsContext, useCaseString);
4484
- };
4485
- var _excluded = ["mode"];
4486
- var capitalized = function capitalized2(str) {
4487
- return str.charAt(0).toUpperCase() + str.slice(1);
4488
- };
4489
- var createElementComponent = function createElementComponent2(type, isServer2) {
4490
- var displayName = "".concat(capitalized(type), "Element");
4491
- var ClientElement = function ClientElement2(_ref) {
4492
- var id = _ref.id, className = _ref.className, _ref$options = _ref.options, options = _ref$options === void 0 ? {} : _ref$options, onBlur = _ref.onBlur, onFocus = _ref.onFocus, onReady = _ref.onReady, onChange = _ref.onChange, onEscape = _ref.onEscape, onClick = _ref.onClick, onLoadError = _ref.onLoadError, onLoaderStart = _ref.onLoaderStart, onNetworksChange = _ref.onNetworksChange, onConfirm = _ref.onConfirm, onCancel = _ref.onCancel, onShippingAddressChange = _ref.onShippingAddressChange, onShippingRateChange = _ref.onShippingRateChange;
4493
- var ctx = useElementsOrCheckoutSdkContextWithUseCase("mounts <".concat(displayName, ">"));
4494
- var elements = "elements" in ctx ? ctx.elements : null;
4495
- var checkoutSdk = "checkoutSdk" in ctx ? ctx.checkoutSdk : null;
4496
- var _React$useState = React.useState(null), _React$useState2 = _slicedToArray(_React$useState, 2), element = _React$useState2[0], setElement = _React$useState2[1];
4497
- var elementRef = React.useRef(null);
4498
- var domNode = React.useRef(null);
4499
- useAttachEvent(element, "blur", onBlur);
4500
- useAttachEvent(element, "focus", onFocus);
4501
- useAttachEvent(element, "escape", onEscape);
4502
- useAttachEvent(element, "click", onClick);
4503
- useAttachEvent(element, "loaderror", onLoadError);
4504
- useAttachEvent(element, "loaderstart", onLoaderStart);
4505
- useAttachEvent(element, "networkschange", onNetworksChange);
4506
- useAttachEvent(element, "confirm", onConfirm);
4507
- useAttachEvent(element, "cancel", onCancel);
4508
- useAttachEvent(element, "shippingaddresschange", onShippingAddressChange);
4509
- useAttachEvent(element, "shippingratechange", onShippingRateChange);
4510
- useAttachEvent(element, "change", onChange);
4511
- var readyCallback;
4512
- if (onReady) {
4513
- if (type === "expressCheckout") {
4514
- readyCallback = onReady;
4515
- } else {
4516
- readyCallback = function readyCallback2() {
4517
- onReady(element);
4518
- };
4519
- }
4520
- }
4521
- useAttachEvent(element, "ready", readyCallback);
4522
- React.useLayoutEffect(function() {
4523
- if (elementRef.current === null && domNode.current !== null && (elements || checkoutSdk)) {
4524
- var newElement = null;
4525
- if (checkoutSdk) {
4526
- switch (type) {
4527
- case "payment":
4528
- newElement = checkoutSdk.createPaymentElement(options);
4529
- break;
4530
- case "address":
4531
- if ("mode" in options) {
4532
- var mode = options.mode, restOptions = _objectWithoutProperties(options, _excluded);
4533
- if (mode === "shipping") {
4534
- newElement = checkoutSdk.createShippingAddressElement(restOptions);
4535
- } else if (mode === "billing") {
4536
- newElement = checkoutSdk.createBillingAddressElement(restOptions);
4537
- } else {
4538
- throw new Error("Invalid options.mode. mode must be 'billing' or 'shipping'.");
4539
- }
4540
- } else {
4541
- throw new Error("You must supply options.mode. mode must be 'billing' or 'shipping'.");
4542
- }
4543
- break;
4544
- case "expressCheckout":
4545
- newElement = checkoutSdk.createExpressCheckoutElement(options);
4546
- break;
4547
- case "currencySelector":
4548
- newElement = checkoutSdk.createCurrencySelectorElement();
4549
- break;
4550
- case "taxId":
4551
- newElement = checkoutSdk.createTaxIdElement(options);
4552
- break;
4553
- default:
4554
- throw new Error("Invalid Element type ".concat(displayName, ". You must use either the <PaymentElement />, <AddressElement options={{mode: 'shipping'}} />, <AddressElement options={{mode: 'billing'}} />, or <ExpressCheckoutElement />."));
4555
- }
4556
- } else if (elements) {
4557
- newElement = elements.create(type, options);
4558
- }
4559
- elementRef.current = newElement;
4560
- setElement(newElement);
4561
- if (newElement) {
4562
- newElement.mount(domNode.current);
4563
- }
4564
- }
4565
- }, [elements, checkoutSdk, options]);
4566
- var prevOptions = usePrevious(options);
4567
- React.useEffect(function() {
4568
- if (!elementRef.current) {
4569
- return;
4570
- }
4571
- var updates = extractAllowedOptionsUpdates(options, prevOptions, ["paymentRequest"]);
4572
- if (updates && "update" in elementRef.current) {
4573
- elementRef.current.update(updates);
4574
- }
4575
- }, [options, prevOptions]);
4576
- React.useLayoutEffect(function() {
4577
- return function() {
4578
- if (elementRef.current && typeof elementRef.current.destroy === "function") {
4579
- try {
4580
- elementRef.current.destroy();
4581
- elementRef.current = null;
4582
- } catch (error) {
4583
- }
4584
- }
4585
- };
4586
- }, []);
4587
- return /* @__PURE__ */ React.createElement("div", {
4588
- id,
4589
- className,
4590
- ref: domNode
4591
- });
4592
- };
4593
- var ServerElement = function ServerElement2(props) {
4594
- useElementsOrCheckoutSdkContextWithUseCase("mounts <".concat(displayName, ">"));
4595
- var id = props.id, className = props.className;
4596
- return /* @__PURE__ */ React.createElement("div", {
4597
- id,
4598
- className
4599
- });
4600
- };
4601
- var Element = isServer2 ? ServerElement : ClientElement;
4602
- Element.propTypes = {
4603
- id: import_prop_types.default.string,
4604
- className: import_prop_types.default.string,
4605
- onChange: import_prop_types.default.func,
4606
- onBlur: import_prop_types.default.func,
4607
- onFocus: import_prop_types.default.func,
4608
- onReady: import_prop_types.default.func,
4609
- onEscape: import_prop_types.default.func,
4610
- onClick: import_prop_types.default.func,
4611
- onLoadError: import_prop_types.default.func,
4612
- onLoaderStart: import_prop_types.default.func,
4613
- onNetworksChange: import_prop_types.default.func,
4614
- onConfirm: import_prop_types.default.func,
4615
- onCancel: import_prop_types.default.func,
4616
- onShippingAddressChange: import_prop_types.default.func,
4617
- onShippingRateChange: import_prop_types.default.func,
4618
- options: import_prop_types.default.object
4619
- };
4620
- Element.displayName = displayName;
4621
- Element.__elementType = type;
4622
- return Element;
4623
- };
4624
- var isServer = typeof window === "undefined";
4625
- var EmbeddedCheckoutContext = /* @__PURE__ */ React.createContext(null);
4626
- EmbeddedCheckoutContext.displayName = "EmbeddedCheckoutProviderContext";
4627
- var useStripe = function useStripe2() {
4628
- var _useElementsOrCheckou = useElementsOrCheckoutSdkContextWithUseCase("calls useStripe()"), stripe = _useElementsOrCheckou.stripe;
4629
- return stripe;
4630
- };
4631
- var AuBankAccountElement = createElementComponent("auBankAccount", isServer);
4632
- var CardElement = createElementComponent("card", isServer);
4633
- var CardNumberElement = createElementComponent("cardNumber", isServer);
4634
- var CardExpiryElement = createElementComponent("cardExpiry", isServer);
4635
- var CardCvcElement = createElementComponent("cardCvc", isServer);
4636
- var FpxBankElement = createElementComponent("fpxBank", isServer);
4637
- var IbanElement = createElementComponent("iban", isServer);
4638
- var IdealBankElement = createElementComponent("idealBank", isServer);
4639
- var P24BankElement = createElementComponent("p24Bank", isServer);
4640
- var EpsBankElement = createElementComponent("epsBank", isServer);
4641
- var PaymentElement = createElementComponent("payment", isServer);
4642
- var ExpressCheckoutElement = createElementComponent("expressCheckout", isServer);
4643
- var CurrencySelectorElement = createElementComponent("currencySelector", isServer);
4644
- var PaymentRequestButtonElement = createElementComponent("paymentRequestButton", isServer);
4645
- var LinkAuthenticationElement = createElementComponent("linkAuthentication", isServer);
4646
- var AddressElement = createElementComponent("address", isServer);
4647
- var ShippingAddressElement = createElementComponent("shippingAddress", isServer);
4648
- var PaymentMethodMessagingElement = createElementComponent("paymentMethodMessaging", isServer);
4649
- var AffirmMessageElement = createElementComponent("affirmMessage", isServer);
4650
- var AfterpayClearpayMessageElement = createElementComponent("afterpayClearpayMessage", isServer);
4651
- var TaxIdElement = createElementComponent("taxId", isServer);
4652
-
4653
- // ../../node_modules/@stripe/stripe-js/dist/index.mjs
4654
- var RELEASE_TRAIN = "basil";
4655
- var runtimeVersionToUrlVersion = function runtimeVersionToUrlVersion2(version) {
4656
- return version === 3 ? "v3" : version;
4657
- };
4658
- var ORIGIN = "https://js.stripe.com";
4659
- var STRIPE_JS_URL = "".concat(ORIGIN, "/").concat(RELEASE_TRAIN, "/stripe.js");
4660
- var V3_URL_REGEX = /^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/;
4661
- var STRIPE_JS_URL_REGEX = /^https:\/\/js\.stripe\.com\/(v3|[a-z]+)\/stripe\.js(\?.*)?$/;
4662
- var EXISTING_SCRIPT_MESSAGE = "loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used";
4663
- var isStripeJSURL = function isStripeJSURL2(url) {
4664
- return V3_URL_REGEX.test(url) || STRIPE_JS_URL_REGEX.test(url);
4665
- };
4666
- var findScript = function findScript2() {
4667
- var scripts = document.querySelectorAll('script[src^="'.concat(ORIGIN, '"]'));
4668
- for (var i = 0; i < scripts.length; i++) {
4669
- var script = scripts[i];
4670
- if (!isStripeJSURL(script.src)) {
4671
- continue;
4672
- }
4673
- return script;
4674
- }
4675
- return null;
4676
- };
4677
- var injectScript = function injectScript2(params) {
4678
- var queryString = params && !params.advancedFraudSignals ? "?advancedFraudSignals=false" : "";
4679
- var script = document.createElement("script");
4680
- script.src = "".concat(STRIPE_JS_URL).concat(queryString);
4681
- var headOrBody = document.head || document.body;
4682
- if (!headOrBody) {
4683
- throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");
4684
- }
4685
- headOrBody.appendChild(script);
4686
- return script;
4687
- };
4688
- var registerWrapper = function registerWrapper2(stripe, startTime) {
4689
- if (!stripe || !stripe._registerWrapper) {
4690
- return;
4691
- }
4692
- stripe._registerWrapper({
4693
- name: "stripe-js",
4694
- version: "7.8.0",
4695
- startTime
4696
- });
4697
- };
4698
- var stripePromise$1 = null;
4699
- var onErrorListener = null;
4700
- var onLoadListener = null;
4701
- var onError = function onError2(reject) {
4702
- return function(cause) {
4703
- reject(new Error("Failed to load Stripe.js", {
4704
- cause
4705
- }));
4706
- };
4707
- };
4708
- var onLoad = function onLoad2(resolve, reject) {
4709
- return function() {
4710
- if (window.Stripe) {
4711
- resolve(window.Stripe);
4712
- } else {
4713
- reject(new Error("Stripe.js not available"));
4714
- }
4715
- };
4716
- };
4717
- var loadScript = function loadScript2(params) {
4718
- if (stripePromise$1 !== null) {
4719
- return stripePromise$1;
4720
- }
4721
- stripePromise$1 = new Promise(function(resolve, reject) {
4722
- if (typeof window === "undefined" || typeof document === "undefined") {
4723
- resolve(null);
4724
- return;
4725
- }
4726
- if (window.Stripe && params) {
4727
- console.warn(EXISTING_SCRIPT_MESSAGE);
4728
- }
4729
- if (window.Stripe) {
4730
- resolve(window.Stripe);
4731
- return;
4732
- }
4733
- try {
4734
- var script = findScript();
4735
- if (script && params) {
4736
- console.warn(EXISTING_SCRIPT_MESSAGE);
4737
- } else if (!script) {
4738
- script = injectScript(params);
4739
- } else if (script && onLoadListener !== null && onErrorListener !== null) {
4740
- var _script$parentNode;
4741
- script.removeEventListener("load", onLoadListener);
4742
- script.removeEventListener("error", onErrorListener);
4743
- (_script$parentNode = script.parentNode) === null || _script$parentNode === void 0 ? void 0 : _script$parentNode.removeChild(script);
4744
- script = injectScript(params);
4745
- }
4746
- onLoadListener = onLoad(resolve, reject);
4747
- onErrorListener = onError(reject);
4748
- script.addEventListener("load", onLoadListener);
4749
- script.addEventListener("error", onErrorListener);
4750
- } catch (error) {
4751
- reject(error);
4752
- return;
4753
- }
4754
- });
4755
- return stripePromise$1["catch"](function(error) {
4756
- stripePromise$1 = null;
4757
- return Promise.reject(error);
4758
- });
4759
- };
4760
- var initStripe = function initStripe2(maybeStripe, args, startTime) {
4761
- if (maybeStripe === null) {
4762
- return null;
4763
- }
4764
- var pk = args[0];
4765
- var isTestKey = pk.match(/^pk_test/);
4766
- var version = runtimeVersionToUrlVersion(maybeStripe.version);
4767
- var expectedVersion = RELEASE_TRAIN;
4768
- if (isTestKey && version !== expectedVersion) {
4769
- console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("7.8.0", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
4770
- }
4771
- var stripe = maybeStripe.apply(void 0, args);
4772
- registerWrapper(stripe, startTime);
4773
- return stripe;
4774
- };
4775
- var stripePromise;
4776
- var loadCalled = false;
4777
- var getStripePromise = function getStripePromise2() {
4778
- if (stripePromise) {
4779
- return stripePromise;
4780
- }
4781
- stripePromise = loadScript(null)["catch"](function(error) {
4782
- stripePromise = null;
4783
- return Promise.reject(error);
4784
- });
4785
- return stripePromise;
4786
- };
4787
- Promise.resolve().then(function() {
4788
- return getStripePromise();
4789
- })["catch"](function(error) {
4790
- if (!loadCalled) {
4791
- console.warn(error);
4792
- }
4793
- });
4794
- var loadStripe = function loadStripe2() {
4795
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
4796
- args[_key] = arguments[_key];
4797
- }
4798
- loadCalled = true;
4799
- var startTime = Date.now();
4800
- return getStripePromise().then(function(maybeStripe) {
4801
- return initStripe(maybeStripe, args, startTime);
4802
- });
4803
- };
3025
+ import { Elements } from "@stripe/react-stripe-js";
3026
+ import { loadStripe } from "@stripe/stripe-js";
4804
3027
 
4805
3028
  // src/context/SpreePayActionsContext.tsx
4806
3029
  import { createContext, useCallback, useContext, useRef, useState } from "react";
@@ -4815,7 +3038,7 @@ var SpreePayProvider = ({ children, env }) => {
4815
3038
  const register = useCallback((fn) => {
4816
3039
  processRef.current = fn;
4817
3040
  }, []);
4818
- const process2 = useCallback((data) => {
3041
+ const process = useCallback((data) => {
4819
3042
  if (!processRef.current) throw new Error("SpreePay process function not registered");
4820
3043
  try {
4821
3044
  return processRef.current(data);
@@ -4826,7 +3049,7 @@ var SpreePayProvider = ({ children, env }) => {
4826
3049
  const value = {
4827
3050
  env,
4828
3051
  enabled: Boolean(selectedPaymentMethod.method),
4829
- process: process2,
3052
+ process,
4830
3053
  register,
4831
3054
  selectedPaymentMethod,
4832
3055
  setSelectedPaymentMethod
@@ -4947,12 +3170,13 @@ var CardsList = ({ selectedCard, setCard }) => {
4947
3170
 
4948
3171
  // src/components/CreditCard/CreditCardForm.tsx
4949
3172
  import { useId, useState as useState6 } from "react";
3173
+ import { CardCvcElement, CardExpiryElement, CardNumberElement, useElements, useStripe } from "@stripe/react-stripe-js";
4950
3174
 
4951
3175
  // ../../node_modules/@radix-ui/react-slot/dist/index.mjs
4952
- import * as React3 from "react";
3176
+ import * as React2 from "react";
4953
3177
 
4954
3178
  // ../../node_modules/@radix-ui/react-compose-refs/dist/index.mjs
4955
- import * as React2 from "react";
3179
+ import * as React from "react";
4956
3180
  function setRef(ref, value) {
4957
3181
  if (typeof ref === "function") {
4958
3182
  return ref(value);
@@ -4985,7 +3209,7 @@ function composeRefs(...refs) {
4985
3209
  };
4986
3210
  }
4987
3211
  function useComposedRefs(...refs) {
4988
- return React2.useCallback(composeRefs(...refs), refs);
3212
+ return React.useCallback(composeRefs(...refs), refs);
4989
3213
  }
4990
3214
 
4991
3215
  // ../../node_modules/@radix-ui/react-slot/dist/index.mjs
@@ -4993,21 +3217,21 @@ import { Fragment as Fragment22, jsx as jsx5 } from "react/jsx-runtime";
4993
3217
  // @__NO_SIDE_EFFECTS__
4994
3218
  function createSlot(ownerName) {
4995
3219
  const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
4996
- const Slot2 = React3.forwardRef((props, forwardedRef) => {
3220
+ const Slot2 = React2.forwardRef((props, forwardedRef) => {
4997
3221
  const { children, ...slotProps } = props;
4998
- const childrenArray = React3.Children.toArray(children);
3222
+ const childrenArray = React2.Children.toArray(children);
4999
3223
  const slottable = childrenArray.find(isSlottable);
5000
3224
  if (slottable) {
5001
3225
  const newElement = slottable.props.children;
5002
3226
  const newChildren = childrenArray.map((child) => {
5003
3227
  if (child === slottable) {
5004
- if (React3.Children.count(newElement) > 1) return React3.Children.only(null);
5005
- return React3.isValidElement(newElement) ? newElement.props.children : null;
3228
+ if (React2.Children.count(newElement) > 1) return React2.Children.only(null);
3229
+ return React2.isValidElement(newElement) ? newElement.props.children : null;
5006
3230
  } else {
5007
3231
  return child;
5008
3232
  }
5009
3233
  });
5010
- return /* @__PURE__ */ jsx5(SlotClone, { ...slotProps, ref: forwardedRef, children: React3.isValidElement(newElement) ? React3.cloneElement(newElement, void 0, newChildren) : null });
3234
+ return /* @__PURE__ */ jsx5(SlotClone, { ...slotProps, ref: forwardedRef, children: React2.isValidElement(newElement) ? React2.cloneElement(newElement, void 0, newChildren) : null });
5011
3235
  }
5012
3236
  return /* @__PURE__ */ jsx5(SlotClone, { ...slotProps, ref: forwardedRef, children });
5013
3237
  });
@@ -5017,24 +3241,24 @@ function createSlot(ownerName) {
5017
3241
  var Slot = /* @__PURE__ */ createSlot("Slot");
5018
3242
  // @__NO_SIDE_EFFECTS__
5019
3243
  function createSlotClone(ownerName) {
5020
- const SlotClone = React3.forwardRef((props, forwardedRef) => {
3244
+ const SlotClone = React2.forwardRef((props, forwardedRef) => {
5021
3245
  const { children, ...slotProps } = props;
5022
- if (React3.isValidElement(children)) {
3246
+ if (React2.isValidElement(children)) {
5023
3247
  const childrenRef = getElementRef(children);
5024
3248
  const props2 = mergeProps(slotProps, children.props);
5025
- if (children.type !== React3.Fragment) {
3249
+ if (children.type !== React2.Fragment) {
5026
3250
  props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
5027
3251
  }
5028
- return React3.cloneElement(children, props2);
3252
+ return React2.cloneElement(children, props2);
5029
3253
  }
5030
- return React3.Children.count(children) > 1 ? React3.Children.only(null) : null;
3254
+ return React2.Children.count(children) > 1 ? React2.Children.only(null) : null;
5031
3255
  });
5032
3256
  SlotClone.displayName = `${ownerName}.SlotClone`;
5033
3257
  return SlotClone;
5034
3258
  }
5035
3259
  var SLOTTABLE_IDENTIFIER = Symbol("radix.slottable");
5036
3260
  function isSlottable(child) {
5037
- return React3.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
3261
+ return React2.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
5038
3262
  }
5039
3263
  function mergeProps(slotProps, childProps) {
5040
3264
  const overrideProps = { ...childProps };
@@ -5156,27 +3380,27 @@ function Button({
5156
3380
  }
5157
3381
 
5158
3382
  // ../../node_modules/@radix-ui/react-checkbox/dist/index.mjs
5159
- import * as React11 from "react";
3383
+ import * as React10 from "react";
5160
3384
 
5161
3385
  // ../../node_modules/@radix-ui/react-context/dist/index.mjs
5162
- import * as React4 from "react";
3386
+ import * as React3 from "react";
5163
3387
  import { jsx as jsx7 } from "react/jsx-runtime";
5164
3388
  function createContextScope(scopeName, createContextScopeDeps = []) {
5165
3389
  let defaultContexts = [];
5166
3390
  function createContext3(rootComponentName, defaultContext) {
5167
- const BaseContext = React4.createContext(defaultContext);
3391
+ const BaseContext = React3.createContext(defaultContext);
5168
3392
  const index = defaultContexts.length;
5169
3393
  defaultContexts = [...defaultContexts, defaultContext];
5170
3394
  const Provider = (props) => {
5171
3395
  const { scope, children, ...context } = props;
5172
3396
  const Context = scope?.[scopeName]?.[index] || BaseContext;
5173
- const value = React4.useMemo(() => context, Object.values(context));
3397
+ const value = React3.useMemo(() => context, Object.values(context));
5174
3398
  return /* @__PURE__ */ jsx7(Context.Provider, { value, children });
5175
3399
  };
5176
3400
  Provider.displayName = rootComponentName + "Provider";
5177
3401
  function useContext22(consumerName, scope) {
5178
3402
  const Context = scope?.[scopeName]?.[index] || BaseContext;
5179
- const context = React4.useContext(Context);
3403
+ const context = React3.useContext(Context);
5180
3404
  if (context) return context;
5181
3405
  if (defaultContext !== void 0) return defaultContext;
5182
3406
  throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
@@ -5185,11 +3409,11 @@ function createContextScope(scopeName, createContextScopeDeps = []) {
5185
3409
  }
5186
3410
  const createScope = () => {
5187
3411
  const scopeContexts = defaultContexts.map((defaultContext) => {
5188
- return React4.createContext(defaultContext);
3412
+ return React3.createContext(defaultContext);
5189
3413
  });
5190
3414
  return function useScope(scope) {
5191
3415
  const contexts = scope?.[scopeName] || scopeContexts;
5192
- return React4.useMemo(
3416
+ return React3.useMemo(
5193
3417
  () => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),
5194
3418
  [scope, contexts]
5195
3419
  );
@@ -5212,7 +3436,7 @@ function composeContextScopes(...scopes) {
5212
3436
  const currentScope = scopeProps[`__scope${scopeName}`];
5213
3437
  return { ...nextScopes2, ...currentScope };
5214
3438
  }, {});
5215
- return React4.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
3439
+ return React3.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
5216
3440
  };
5217
3441
  };
5218
3442
  createScope.scopeName = baseScope.scopeName;
@@ -5230,16 +3454,16 @@ function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForD
5230
3454
  }
5231
3455
 
5232
3456
  // ../../node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs
5233
- import * as React6 from "react";
3457
+ import * as React5 from "react";
5234
3458
 
5235
3459
  // ../../node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs
5236
- import * as React5 from "react";
5237
- var useLayoutEffect2 = globalThis?.document ? React5.useLayoutEffect : () => {
3460
+ import * as React4 from "react";
3461
+ var useLayoutEffect2 = globalThis?.document ? React4.useLayoutEffect : () => {
5238
3462
  };
5239
3463
 
5240
3464
  // ../../node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs
5241
3465
  import * as React22 from "react";
5242
- var useInsertionEffect = React6[" useInsertionEffect ".trim().toString()] || useLayoutEffect2;
3466
+ var useInsertionEffect = React5[" useInsertionEffect ".trim().toString()] || useLayoutEffect2;
5243
3467
  function useControllableState({
5244
3468
  prop,
5245
3469
  defaultProp,
@@ -5254,8 +3478,8 @@ function useControllableState({
5254
3478
  const isControlled = prop !== void 0;
5255
3479
  const value = isControlled ? prop : uncontrolledProp;
5256
3480
  if (true) {
5257
- const isControlledRef = React6.useRef(prop !== void 0);
5258
- React6.useEffect(() => {
3481
+ const isControlledRef = React5.useRef(prop !== void 0);
3482
+ React5.useEffect(() => {
5259
3483
  const wasControlled = isControlledRef.current;
5260
3484
  if (wasControlled !== isControlled) {
5261
3485
  const from = wasControlled ? "controlled" : "uncontrolled";
@@ -5267,7 +3491,7 @@ function useControllableState({
5267
3491
  isControlledRef.current = isControlled;
5268
3492
  }, [isControlled, caller]);
5269
3493
  }
5270
- const setValue = React6.useCallback(
3494
+ const setValue = React5.useCallback(
5271
3495
  (nextValue) => {
5272
3496
  if (isControlled) {
5273
3497
  const value2 = isFunction(nextValue) ? nextValue(prop) : nextValue;
@@ -5286,13 +3510,13 @@ function useUncontrolledState({
5286
3510
  defaultProp,
5287
3511
  onChange
5288
3512
  }) {
5289
- const [value, setValue] = React6.useState(defaultProp);
5290
- const prevValueRef = React6.useRef(value);
5291
- const onChangeRef = React6.useRef(onChange);
3513
+ const [value, setValue] = React5.useState(defaultProp);
3514
+ const prevValueRef = React5.useRef(value);
3515
+ const onChangeRef = React5.useRef(onChange);
5292
3516
  useInsertionEffect(() => {
5293
3517
  onChangeRef.current = onChange;
5294
3518
  }, [onChange]);
5295
- React6.useEffect(() => {
3519
+ React5.useEffect(() => {
5296
3520
  if (prevValueRef.current !== value) {
5297
3521
  onChangeRef.current?.(value);
5298
3522
  prevValueRef.current = value;
@@ -5306,10 +3530,10 @@ function isFunction(value) {
5306
3530
  var SYNC_STATE = Symbol("RADIX:SYNC_STATE");
5307
3531
 
5308
3532
  // ../../node_modules/@radix-ui/react-use-previous/dist/index.mjs
5309
- import * as React7 from "react";
5310
- function usePrevious3(value) {
5311
- const ref = React7.useRef({ value, previous: value });
5312
- return React7.useMemo(() => {
3533
+ import * as React6 from "react";
3534
+ function usePrevious(value) {
3535
+ const ref = React6.useRef({ value, previous: value });
3536
+ return React6.useMemo(() => {
5313
3537
  if (ref.current.value !== value) {
5314
3538
  ref.current.previous = ref.current.value;
5315
3539
  ref.current.value = value;
@@ -5319,9 +3543,9 @@ function usePrevious3(value) {
5319
3543
  }
5320
3544
 
5321
3545
  // ../../node_modules/@radix-ui/react-use-size/dist/index.mjs
5322
- import * as React8 from "react";
3546
+ import * as React7 from "react";
5323
3547
  function useSize(element) {
5324
- const [size, setSize] = React8.useState(void 0);
3548
+ const [size, setSize] = React7.useState(void 0);
5325
3549
  useLayoutEffect2(() => {
5326
3550
  if (element) {
5327
3551
  setSize({ width: element.offsetWidth, height: element.offsetHeight });
@@ -5357,9 +3581,9 @@ function useSize(element) {
5357
3581
 
5358
3582
  // ../../node_modules/@radix-ui/react-presence/dist/index.mjs
5359
3583
  import * as React23 from "react";
5360
- import * as React9 from "react";
3584
+ import * as React8 from "react";
5361
3585
  function useStateMachine(initialState, machine) {
5362
- return React9.useReducer((state, event) => {
3586
+ return React8.useReducer((state, event) => {
5363
3587
  const nextState = machine[state][event];
5364
3588
  return nextState ?? state;
5365
3589
  }, initialState);
@@ -5482,7 +3706,7 @@ function getElementRef2(element) {
5482
3706
  }
5483
3707
 
5484
3708
  // ../../node_modules/@radix-ui/react-primitive/dist/index.mjs
5485
- import * as React10 from "react";
3709
+ import * as React9 from "react";
5486
3710
  import * as ReactDOM from "react-dom";
5487
3711
  import { jsx as jsx8 } from "react/jsx-runtime";
5488
3712
  var NODES = [
@@ -5506,7 +3730,7 @@ var NODES = [
5506
3730
  ];
5507
3731
  var Primitive = NODES.reduce((primitive, node) => {
5508
3732
  const Slot2 = createSlot(`Primitive.${node}`);
5509
- const Node = React10.forwardRef((props, forwardedRef) => {
3733
+ const Node = React9.forwardRef((props, forwardedRef) => {
5510
3734
  const { asChild, ...primitiveProps } = props;
5511
3735
  const Comp = asChild ? Slot2 : node;
5512
3736
  if (typeof window !== "undefined") {
@@ -5544,9 +3768,9 @@ function CheckboxProvider(props) {
5544
3768
  onChange: onCheckedChange,
5545
3769
  caller: CHECKBOX_NAME
5546
3770
  });
5547
- const [control, setControl] = React11.useState(null);
5548
- const [bubbleInput, setBubbleInput] = React11.useState(null);
5549
- const hasConsumerStoppedPropagationRef = React11.useRef(false);
3771
+ const [control, setControl] = React10.useState(null);
3772
+ const [bubbleInput, setBubbleInput] = React10.useState(null);
3773
+ const hasConsumerStoppedPropagationRef = React10.useRef(false);
5550
3774
  const isFormControl = control ? !!form || !!control.closest("form") : (
5551
3775
  // We set this to true by default so that events bubble to forms without JS (SSR)
5552
3776
  true
@@ -5577,7 +3801,7 @@ function CheckboxProvider(props) {
5577
3801
  );
5578
3802
  }
5579
3803
  var TRIGGER_NAME = "CheckboxTrigger";
5580
- var CheckboxTrigger = React11.forwardRef(
3804
+ var CheckboxTrigger = React10.forwardRef(
5581
3805
  ({ __scopeCheckbox, onKeyDown, onClick, ...checkboxProps }, forwardedRef) => {
5582
3806
  const {
5583
3807
  control,
@@ -5592,8 +3816,8 @@ var CheckboxTrigger = React11.forwardRef(
5592
3816
  bubbleInput
5593
3817
  } = useCheckboxContext(TRIGGER_NAME, __scopeCheckbox);
5594
3818
  const composedRefs = useComposedRefs(forwardedRef, setControl);
5595
- const initialCheckedStateRef = React11.useRef(checked);
5596
- React11.useEffect(() => {
3819
+ const initialCheckedStateRef = React10.useRef(checked);
3820
+ React10.useEffect(() => {
5597
3821
  const form = control?.form;
5598
3822
  if (form) {
5599
3823
  const reset = () => setChecked(initialCheckedStateRef.current);
@@ -5629,7 +3853,7 @@ var CheckboxTrigger = React11.forwardRef(
5629
3853
  }
5630
3854
  );
5631
3855
  CheckboxTrigger.displayName = TRIGGER_NAME;
5632
- var Checkbox = React11.forwardRef(
3856
+ var Checkbox = React10.forwardRef(
5633
3857
  (props, forwardedRef) => {
5634
3858
  const {
5635
3859
  __scopeCheckbox,
@@ -5677,7 +3901,7 @@ var Checkbox = React11.forwardRef(
5677
3901
  );
5678
3902
  Checkbox.displayName = CHECKBOX_NAME;
5679
3903
  var INDICATOR_NAME = "CheckboxIndicator";
5680
- var CheckboxIndicator = React11.forwardRef(
3904
+ var CheckboxIndicator = React10.forwardRef(
5681
3905
  (props, forwardedRef) => {
5682
3906
  const { __scopeCheckbox, forceMount, ...indicatorProps } = props;
5683
3907
  const context = useCheckboxContext(INDICATOR_NAME, __scopeCheckbox);
@@ -5701,7 +3925,7 @@ var CheckboxIndicator = React11.forwardRef(
5701
3925
  );
5702
3926
  CheckboxIndicator.displayName = INDICATOR_NAME;
5703
3927
  var BUBBLE_INPUT_NAME = "CheckboxBubbleInput";
5704
- var CheckboxBubbleInput = React11.forwardRef(
3928
+ var CheckboxBubbleInput = React10.forwardRef(
5705
3929
  ({ __scopeCheckbox, ...props }, forwardedRef) => {
5706
3930
  const {
5707
3931
  control,
@@ -5717,9 +3941,9 @@ var CheckboxBubbleInput = React11.forwardRef(
5717
3941
  setBubbleInput
5718
3942
  } = useCheckboxContext(BUBBLE_INPUT_NAME, __scopeCheckbox);
5719
3943
  const composedRefs = useComposedRefs(forwardedRef, setBubbleInput);
5720
- const prevChecked = usePrevious3(checked);
3944
+ const prevChecked = usePrevious(checked);
5721
3945
  const controlSize = useSize(control);
5722
- React11.useEffect(() => {
3946
+ React10.useEffect(() => {
5723
3947
  const input = bubbleInput;
5724
3948
  if (!input) return;
5725
3949
  const inputProto = window.HTMLInputElement.prototype;
@@ -5736,7 +3960,7 @@ var CheckboxBubbleInput = React11.forwardRef(
5736
3960
  input.dispatchEvent(event);
5737
3961
  }
5738
3962
  }, [bubbleInput, prevChecked, checked, hasConsumerStoppedPropagationRef]);
5739
- const defaultCheckedRef = React11.useRef(isIndeterminate(checked) ? false : checked);
3963
+ const defaultCheckedRef = React10.useRef(isIndeterminate(checked) ? false : checked);
5740
3964
  return /* @__PURE__ */ jsx9(
5741
3965
  Primitive.input,
5742
3966
  {
@@ -5896,10 +4120,10 @@ function Checkbox2({ className, ...props }) {
5896
4120
  }
5897
4121
 
5898
4122
  // ../../node_modules/@radix-ui/react-label/dist/index.mjs
5899
- import * as React12 from "react";
4123
+ import * as React11 from "react";
5900
4124
  import { jsx as jsx11 } from "react/jsx-runtime";
5901
4125
  var NAME = "Label";
5902
- var Label = React12.forwardRef((props, forwardedRef) => {
4126
+ var Label = React11.forwardRef((props, forwardedRef) => {
5903
4127
  return /* @__PURE__ */ jsx11(
5904
4128
  Primitive.label,
5905
4129
  {
@@ -6126,14 +4350,14 @@ import { jsx as jsx16, jsxs as jsxs8 } from "react/jsx-runtime";
6126
4350
  var Tabs = () => {
6127
4351
  const { env } = useSpreePayEnv();
6128
4352
  const { selectedPaymentMethod, setSelectedPaymentMethod } = useSpreePaymentMethod();
6129
- const stripePromise2 = useMemo4(() => loadStripe(env.stripePublicKey), [env.stripePublicKey]);
4353
+ const stripePromise = useMemo4(() => loadStripe(env.stripePublicKey), [env.stripePublicKey]);
6130
4354
  return /* @__PURE__ */ jsxs8("div", { className: "mb-4 rounded-2xl border border-black/25 bg-white", children: [
6131
4355
  /* @__PURE__ */ jsxs8("div", { className: "flex w-full flex-col gap-4 border-b-1 border-black/7 px-7 py-6", children: [
6132
4356
  /* @__PURE__ */ jsx16("h2", { className: "text-primary text-2xl font-semibold", children: "Choose a Payment Method" }),
6133
4357
  /* @__PURE__ */ jsx16(TabButtons, { value: selectedPaymentMethod.type, onChange: setSelectedPaymentMethod })
6134
4358
  ] }),
6135
4359
  /* @__PURE__ */ jsxs8("div", { className: "px-7 py-6", children: [
6136
- selectedPaymentMethod.type === "CREDIT_CARD" /* CREDIT_CARD */ && /* @__PURE__ */ jsx16(Elements, { stripe: stripePromise2, children: /* @__PURE__ */ jsx16(CreditCard, {}) }),
4360
+ selectedPaymentMethod.type === "CREDIT_CARD" /* CREDIT_CARD */ && /* @__PURE__ */ jsx16(Elements, { stripe: stripePromise, children: /* @__PURE__ */ jsx16(CreditCard, {}) }),
6137
4361
  selectedPaymentMethod.type === "CRYPTO" /* CRYPTO */ && null
6138
4362
  ] })
6139
4363
  ] });
@@ -6347,33 +4571,6 @@ export {
6347
4571
  };
6348
4572
  /*! Bundled license information:
6349
4573
 
6350
- react-is/cjs/react-is.production.min.js:
6351
- (** @license React v16.13.1
6352
- * react-is.production.min.js
6353
- *
6354
- * Copyright (c) Facebook, Inc. and its affiliates.
6355
- *
6356
- * This source code is licensed under the MIT license found in the
6357
- * LICENSE file in the root directory of this source tree.
6358
- *)
6359
-
6360
- react-is/cjs/react-is.development.js:
6361
- (** @license React v16.13.1
6362
- * react-is.development.js
6363
- *
6364
- * Copyright (c) Facebook, Inc. and its affiliates.
6365
- *
6366
- * This source code is licensed under the MIT license found in the
6367
- * LICENSE file in the root directory of this source tree.
6368
- *)
6369
-
6370
- object-assign/index.js:
6371
- (*
6372
- object-assign
6373
- (c) Sindre Sorhus
6374
- @license MIT
6375
- *)
6376
-
6377
4574
  lucide-react/dist/esm/shared/src/utils.js:
6378
4575
  lucide-react/dist/esm/defaultAttributes.js:
6379
4576
  lucide-react/dist/esm/Icon.js: