@heliofi/checkout-react 1.0.0
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.
- package/README.md +3 -0
- package/dist/helio-checkout-react.es.js +693 -0
- package/dist/helio-checkout-react.umd.js +27 -0
- package/package.json +53 -0
package/README.md
ADDED
|
@@ -0,0 +1,693 @@
|
|
|
1
|
+
import xe, { Component as fr, useRef as dr, useState as Z, useEffect as Se, useLayoutEffect as vr } from "react";
|
|
2
|
+
var Q = { exports: {} }, L = {};
|
|
3
|
+
/**
|
|
4
|
+
* @license React
|
|
5
|
+
* react-jsx-runtime.production.min.js
|
|
6
|
+
*
|
|
7
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the MIT license found in the
|
|
10
|
+
* LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/
|
|
12
|
+
var Oe;
|
|
13
|
+
function pr() {
|
|
14
|
+
if (Oe)
|
|
15
|
+
return L;
|
|
16
|
+
Oe = 1;
|
|
17
|
+
var l = xe, m = Symbol.for("react.element"), P = Symbol.for("react.fragment"), S = Object.prototype.hasOwnProperty, b = l.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, j = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
18
|
+
function O(R, f, y) {
|
|
19
|
+
var d, h = {}, _ = null, E = null;
|
|
20
|
+
y !== void 0 && (_ = "" + y), f.key !== void 0 && (_ = "" + f.key), f.ref !== void 0 && (E = f.ref);
|
|
21
|
+
for (d in f)
|
|
22
|
+
S.call(f, d) && !j.hasOwnProperty(d) && (h[d] = f[d]);
|
|
23
|
+
if (R && R.defaultProps)
|
|
24
|
+
for (d in f = R.defaultProps, f)
|
|
25
|
+
h[d] === void 0 && (h[d] = f[d]);
|
|
26
|
+
return { $$typeof: m, type: R, key: _, ref: E, props: h, _owner: b.current };
|
|
27
|
+
}
|
|
28
|
+
return L.Fragment = P, L.jsx = O, L.jsxs = O, L;
|
|
29
|
+
}
|
|
30
|
+
var W = {};
|
|
31
|
+
/**
|
|
32
|
+
* @license React
|
|
33
|
+
* react-jsx-runtime.development.js
|
|
34
|
+
*
|
|
35
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
36
|
+
*
|
|
37
|
+
* This source code is licensed under the MIT license found in the
|
|
38
|
+
* LICENSE file in the root directory of this source tree.
|
|
39
|
+
*/
|
|
40
|
+
var we;
|
|
41
|
+
function hr() {
|
|
42
|
+
return we || (we = 1, process.env.NODE_ENV !== "production" && function() {
|
|
43
|
+
var l = xe, m = Symbol.for("react.element"), P = Symbol.for("react.portal"), S = Symbol.for("react.fragment"), b = Symbol.for("react.strict_mode"), j = Symbol.for("react.profiler"), O = Symbol.for("react.provider"), R = Symbol.for("react.context"), f = Symbol.for("react.forward_ref"), y = Symbol.for("react.suspense"), d = Symbol.for("react.suspense_list"), h = Symbol.for("react.memo"), _ = Symbol.for("react.lazy"), E = Symbol.for("react.offscreen"), A = Symbol.iterator, je = "@@iterator";
|
|
44
|
+
function ke(e) {
|
|
45
|
+
if (e === null || typeof e != "object")
|
|
46
|
+
return null;
|
|
47
|
+
var r = A && e[A] || e[je];
|
|
48
|
+
return typeof r == "function" ? r : null;
|
|
49
|
+
}
|
|
50
|
+
var k = l.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
51
|
+
function v(e) {
|
|
52
|
+
{
|
|
53
|
+
for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++)
|
|
54
|
+
t[n - 1] = arguments[n];
|
|
55
|
+
Fe("error", e, t);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
function Fe(e, r, t) {
|
|
59
|
+
{
|
|
60
|
+
var n = k.ReactDebugCurrentFrame, i = n.getStackAddendum();
|
|
61
|
+
i !== "" && (r += "%s", t = t.concat([i]));
|
|
62
|
+
var u = t.map(function(o) {
|
|
63
|
+
return String(o);
|
|
64
|
+
});
|
|
65
|
+
u.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, u);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
var De = !1, Ae = !1, Ie = !1, $e = !1, Le = !1, re;
|
|
69
|
+
re = Symbol.for("react.module.reference");
|
|
70
|
+
function We(e) {
|
|
71
|
+
return !!(typeof e == "string" || typeof e == "function" || e === S || e === j || Le || e === b || e === y || e === d || $e || e === E || De || Ae || Ie || typeof e == "object" && e !== null && (e.$$typeof === _ || e.$$typeof === h || e.$$typeof === O || e.$$typeof === R || e.$$typeof === f || // This needs to include all possible module reference object
|
|
72
|
+
// types supported by any Flight configuration anywhere since
|
|
73
|
+
// we don't know which Flight build this will end up being used
|
|
74
|
+
// with.
|
|
75
|
+
e.$$typeof === re || e.getModuleId !== void 0));
|
|
76
|
+
}
|
|
77
|
+
function Ye(e, r, t) {
|
|
78
|
+
var n = e.displayName;
|
|
79
|
+
if (n)
|
|
80
|
+
return n;
|
|
81
|
+
var i = r.displayName || r.name || "";
|
|
82
|
+
return i !== "" ? t + "(" + i + ")" : t;
|
|
83
|
+
}
|
|
84
|
+
function te(e) {
|
|
85
|
+
return e.displayName || "Context";
|
|
86
|
+
}
|
|
87
|
+
function C(e) {
|
|
88
|
+
if (e == null)
|
|
89
|
+
return null;
|
|
90
|
+
if (typeof e.tag == "number" && v("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
|
91
|
+
return e.displayName || e.name || null;
|
|
92
|
+
if (typeof e == "string")
|
|
93
|
+
return e;
|
|
94
|
+
switch (e) {
|
|
95
|
+
case S:
|
|
96
|
+
return "Fragment";
|
|
97
|
+
case P:
|
|
98
|
+
return "Portal";
|
|
99
|
+
case j:
|
|
100
|
+
return "Profiler";
|
|
101
|
+
case b:
|
|
102
|
+
return "StrictMode";
|
|
103
|
+
case y:
|
|
104
|
+
return "Suspense";
|
|
105
|
+
case d:
|
|
106
|
+
return "SuspenseList";
|
|
107
|
+
}
|
|
108
|
+
if (typeof e == "object")
|
|
109
|
+
switch (e.$$typeof) {
|
|
110
|
+
case R:
|
|
111
|
+
var r = e;
|
|
112
|
+
return te(r) + ".Consumer";
|
|
113
|
+
case O:
|
|
114
|
+
var t = e;
|
|
115
|
+
return te(t._context) + ".Provider";
|
|
116
|
+
case f:
|
|
117
|
+
return Ye(e, e.render, "ForwardRef");
|
|
118
|
+
case h:
|
|
119
|
+
var n = e.displayName || null;
|
|
120
|
+
return n !== null ? n : C(e.type) || "Memo";
|
|
121
|
+
case _: {
|
|
122
|
+
var i = e, u = i._payload, o = i._init;
|
|
123
|
+
try {
|
|
124
|
+
return C(o(u));
|
|
125
|
+
} catch {
|
|
126
|
+
return null;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
return null;
|
|
131
|
+
}
|
|
132
|
+
var x = Object.assign, I = 0, ne, ae, oe, ie, ue, se, ce;
|
|
133
|
+
function le() {
|
|
134
|
+
}
|
|
135
|
+
le.__reactDisabledLog = !0;
|
|
136
|
+
function Me() {
|
|
137
|
+
{
|
|
138
|
+
if (I === 0) {
|
|
139
|
+
ne = console.log, ae = console.info, oe = console.warn, ie = console.error, ue = console.group, se = console.groupCollapsed, ce = console.groupEnd;
|
|
140
|
+
var e = {
|
|
141
|
+
configurable: !0,
|
|
142
|
+
enumerable: !0,
|
|
143
|
+
value: le,
|
|
144
|
+
writable: !0
|
|
145
|
+
};
|
|
146
|
+
Object.defineProperties(console, {
|
|
147
|
+
info: e,
|
|
148
|
+
log: e,
|
|
149
|
+
warn: e,
|
|
150
|
+
error: e,
|
|
151
|
+
group: e,
|
|
152
|
+
groupCollapsed: e,
|
|
153
|
+
groupEnd: e
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
I++;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
function Ue() {
|
|
160
|
+
{
|
|
161
|
+
if (I--, I === 0) {
|
|
162
|
+
var e = {
|
|
163
|
+
configurable: !0,
|
|
164
|
+
enumerable: !0,
|
|
165
|
+
writable: !0
|
|
166
|
+
};
|
|
167
|
+
Object.defineProperties(console, {
|
|
168
|
+
log: x({}, e, {
|
|
169
|
+
value: ne
|
|
170
|
+
}),
|
|
171
|
+
info: x({}, e, {
|
|
172
|
+
value: ae
|
|
173
|
+
}),
|
|
174
|
+
warn: x({}, e, {
|
|
175
|
+
value: oe
|
|
176
|
+
}),
|
|
177
|
+
error: x({}, e, {
|
|
178
|
+
value: ie
|
|
179
|
+
}),
|
|
180
|
+
group: x({}, e, {
|
|
181
|
+
value: ue
|
|
182
|
+
}),
|
|
183
|
+
groupCollapsed: x({}, e, {
|
|
184
|
+
value: se
|
|
185
|
+
}),
|
|
186
|
+
groupEnd: x({}, e, {
|
|
187
|
+
value: ce
|
|
188
|
+
})
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
I < 0 && v("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
var B = k.ReactCurrentDispatcher, q;
|
|
195
|
+
function Y(e, r, t) {
|
|
196
|
+
{
|
|
197
|
+
if (q === void 0)
|
|
198
|
+
try {
|
|
199
|
+
throw Error();
|
|
200
|
+
} catch (i) {
|
|
201
|
+
var n = i.stack.trim().match(/\n( *(at )?)/);
|
|
202
|
+
q = n && n[1] || "";
|
|
203
|
+
}
|
|
204
|
+
return `
|
|
205
|
+
` + q + e;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
var H = !1, M;
|
|
209
|
+
{
|
|
210
|
+
var Ne = typeof WeakMap == "function" ? WeakMap : Map;
|
|
211
|
+
M = new Ne();
|
|
212
|
+
}
|
|
213
|
+
function fe(e, r) {
|
|
214
|
+
if (!e || H)
|
|
215
|
+
return "";
|
|
216
|
+
{
|
|
217
|
+
var t = M.get(e);
|
|
218
|
+
if (t !== void 0)
|
|
219
|
+
return t;
|
|
220
|
+
}
|
|
221
|
+
var n;
|
|
222
|
+
H = !0;
|
|
223
|
+
var i = Error.prepareStackTrace;
|
|
224
|
+
Error.prepareStackTrace = void 0;
|
|
225
|
+
var u;
|
|
226
|
+
u = B.current, B.current = null, Me();
|
|
227
|
+
try {
|
|
228
|
+
if (r) {
|
|
229
|
+
var o = function() {
|
|
230
|
+
throw Error();
|
|
231
|
+
};
|
|
232
|
+
if (Object.defineProperty(o.prototype, "props", {
|
|
233
|
+
set: function() {
|
|
234
|
+
throw Error();
|
|
235
|
+
}
|
|
236
|
+
}), typeof Reflect == "object" && Reflect.construct) {
|
|
237
|
+
try {
|
|
238
|
+
Reflect.construct(o, []);
|
|
239
|
+
} catch (T) {
|
|
240
|
+
n = T;
|
|
241
|
+
}
|
|
242
|
+
Reflect.construct(e, [], o);
|
|
243
|
+
} else {
|
|
244
|
+
try {
|
|
245
|
+
o.call();
|
|
246
|
+
} catch (T) {
|
|
247
|
+
n = T;
|
|
248
|
+
}
|
|
249
|
+
e.call(o.prototype);
|
|
250
|
+
}
|
|
251
|
+
} else {
|
|
252
|
+
try {
|
|
253
|
+
throw Error();
|
|
254
|
+
} catch (T) {
|
|
255
|
+
n = T;
|
|
256
|
+
}
|
|
257
|
+
e();
|
|
258
|
+
}
|
|
259
|
+
} catch (T) {
|
|
260
|
+
if (T && n && typeof T.stack == "string") {
|
|
261
|
+
for (var a = T.stack.split(`
|
|
262
|
+
`), p = n.stack.split(`
|
|
263
|
+
`), s = a.length - 1, c = p.length - 1; s >= 1 && c >= 0 && a[s] !== p[c]; )
|
|
264
|
+
c--;
|
|
265
|
+
for (; s >= 1 && c >= 0; s--, c--)
|
|
266
|
+
if (a[s] !== p[c]) {
|
|
267
|
+
if (s !== 1 || c !== 1)
|
|
268
|
+
do
|
|
269
|
+
if (s--, c--, c < 0 || a[s] !== p[c]) {
|
|
270
|
+
var g = `
|
|
271
|
+
` + a[s].replace(" at new ", " at ");
|
|
272
|
+
return e.displayName && g.includes("<anonymous>") && (g = g.replace("<anonymous>", e.displayName)), typeof e == "function" && M.set(e, g), g;
|
|
273
|
+
}
|
|
274
|
+
while (s >= 1 && c >= 0);
|
|
275
|
+
break;
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
} finally {
|
|
279
|
+
H = !1, B.current = u, Ue(), Error.prepareStackTrace = i;
|
|
280
|
+
}
|
|
281
|
+
var D = e ? e.displayName || e.name : "", Te = D ? Y(D) : "";
|
|
282
|
+
return typeof e == "function" && M.set(e, Te), Te;
|
|
283
|
+
}
|
|
284
|
+
function Ve(e, r, t) {
|
|
285
|
+
return fe(e, !1);
|
|
286
|
+
}
|
|
287
|
+
function Be(e) {
|
|
288
|
+
var r = e.prototype;
|
|
289
|
+
return !!(r && r.isReactComponent);
|
|
290
|
+
}
|
|
291
|
+
function U(e, r, t) {
|
|
292
|
+
if (e == null)
|
|
293
|
+
return "";
|
|
294
|
+
if (typeof e == "function")
|
|
295
|
+
return fe(e, Be(e));
|
|
296
|
+
if (typeof e == "string")
|
|
297
|
+
return Y(e);
|
|
298
|
+
switch (e) {
|
|
299
|
+
case y:
|
|
300
|
+
return Y("Suspense");
|
|
301
|
+
case d:
|
|
302
|
+
return Y("SuspenseList");
|
|
303
|
+
}
|
|
304
|
+
if (typeof e == "object")
|
|
305
|
+
switch (e.$$typeof) {
|
|
306
|
+
case f:
|
|
307
|
+
return Ve(e.render);
|
|
308
|
+
case h:
|
|
309
|
+
return U(e.type, r, t);
|
|
310
|
+
case _: {
|
|
311
|
+
var n = e, i = n._payload, u = n._init;
|
|
312
|
+
try {
|
|
313
|
+
return U(u(i), r, t);
|
|
314
|
+
} catch {
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
return "";
|
|
319
|
+
}
|
|
320
|
+
var N = Object.prototype.hasOwnProperty, de = {}, ve = k.ReactDebugCurrentFrame;
|
|
321
|
+
function V(e) {
|
|
322
|
+
if (e) {
|
|
323
|
+
var r = e._owner, t = U(e.type, e._source, r ? r.type : null);
|
|
324
|
+
ve.setExtraStackFrame(t);
|
|
325
|
+
} else
|
|
326
|
+
ve.setExtraStackFrame(null);
|
|
327
|
+
}
|
|
328
|
+
function qe(e, r, t, n, i) {
|
|
329
|
+
{
|
|
330
|
+
var u = Function.call.bind(N);
|
|
331
|
+
for (var o in e)
|
|
332
|
+
if (u(e, o)) {
|
|
333
|
+
var a = void 0;
|
|
334
|
+
try {
|
|
335
|
+
if (typeof e[o] != "function") {
|
|
336
|
+
var p = Error((n || "React class") + ": " + t + " type `" + o + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[o] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
337
|
+
throw p.name = "Invariant Violation", p;
|
|
338
|
+
}
|
|
339
|
+
a = e[o](r, o, n, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
340
|
+
} catch (s) {
|
|
341
|
+
a = s;
|
|
342
|
+
}
|
|
343
|
+
a && !(a instanceof Error) && (V(i), v("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", n || "React class", t, o, typeof a), V(null)), a instanceof Error && !(a.message in de) && (de[a.message] = !0, V(i), v("Failed %s type: %s", t, a.message), V(null));
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
var He = Array.isArray;
|
|
348
|
+
function J(e) {
|
|
349
|
+
return He(e);
|
|
350
|
+
}
|
|
351
|
+
function Je(e) {
|
|
352
|
+
{
|
|
353
|
+
var r = typeof Symbol == "function" && Symbol.toStringTag, t = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
354
|
+
return t;
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
function Ge(e) {
|
|
358
|
+
try {
|
|
359
|
+
return pe(e), !1;
|
|
360
|
+
} catch {
|
|
361
|
+
return !0;
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
function pe(e) {
|
|
365
|
+
return "" + e;
|
|
366
|
+
}
|
|
367
|
+
function he(e) {
|
|
368
|
+
if (Ge(e))
|
|
369
|
+
return v("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Je(e)), pe(e);
|
|
370
|
+
}
|
|
371
|
+
var $ = k.ReactCurrentOwner, ze = {
|
|
372
|
+
key: !0,
|
|
373
|
+
ref: !0,
|
|
374
|
+
__self: !0,
|
|
375
|
+
__source: !0
|
|
376
|
+
}, Ee, ge, G;
|
|
377
|
+
G = {};
|
|
378
|
+
function Ke(e) {
|
|
379
|
+
if (N.call(e, "ref")) {
|
|
380
|
+
var r = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
381
|
+
if (r && r.isReactWarning)
|
|
382
|
+
return !1;
|
|
383
|
+
}
|
|
384
|
+
return e.ref !== void 0;
|
|
385
|
+
}
|
|
386
|
+
function Xe(e) {
|
|
387
|
+
if (N.call(e, "key")) {
|
|
388
|
+
var r = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
389
|
+
if (r && r.isReactWarning)
|
|
390
|
+
return !1;
|
|
391
|
+
}
|
|
392
|
+
return e.key !== void 0;
|
|
393
|
+
}
|
|
394
|
+
function Ze(e, r) {
|
|
395
|
+
if (typeof e.ref == "string" && $.current && r && $.current.stateNode !== r) {
|
|
396
|
+
var t = C($.current.type);
|
|
397
|
+
G[t] || (v('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', C($.current.type), e.ref), G[t] = !0);
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
function Qe(e, r) {
|
|
401
|
+
{
|
|
402
|
+
var t = function() {
|
|
403
|
+
Ee || (Ee = !0, v("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
|
|
404
|
+
};
|
|
405
|
+
t.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
406
|
+
get: t,
|
|
407
|
+
configurable: !0
|
|
408
|
+
});
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
function er(e, r) {
|
|
412
|
+
{
|
|
413
|
+
var t = function() {
|
|
414
|
+
ge || (ge = !0, v("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
|
|
415
|
+
};
|
|
416
|
+
t.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
417
|
+
get: t,
|
|
418
|
+
configurable: !0
|
|
419
|
+
});
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
var rr = function(e, r, t, n, i, u, o) {
|
|
423
|
+
var a = {
|
|
424
|
+
// This tag allows us to uniquely identify this as a React Element
|
|
425
|
+
$$typeof: m,
|
|
426
|
+
// Built-in properties that belong on the element
|
|
427
|
+
type: e,
|
|
428
|
+
key: r,
|
|
429
|
+
ref: t,
|
|
430
|
+
props: o,
|
|
431
|
+
// Record the component responsible for creating this element.
|
|
432
|
+
_owner: u
|
|
433
|
+
};
|
|
434
|
+
return a._store = {}, Object.defineProperty(a._store, "validated", {
|
|
435
|
+
configurable: !1,
|
|
436
|
+
enumerable: !1,
|
|
437
|
+
writable: !0,
|
|
438
|
+
value: !1
|
|
439
|
+
}), Object.defineProperty(a, "_self", {
|
|
440
|
+
configurable: !1,
|
|
441
|
+
enumerable: !1,
|
|
442
|
+
writable: !1,
|
|
443
|
+
value: n
|
|
444
|
+
}), Object.defineProperty(a, "_source", {
|
|
445
|
+
configurable: !1,
|
|
446
|
+
enumerable: !1,
|
|
447
|
+
writable: !1,
|
|
448
|
+
value: i
|
|
449
|
+
}), Object.freeze && (Object.freeze(a.props), Object.freeze(a)), a;
|
|
450
|
+
};
|
|
451
|
+
function tr(e, r, t, n, i) {
|
|
452
|
+
{
|
|
453
|
+
var u, o = {}, a = null, p = null;
|
|
454
|
+
t !== void 0 && (he(t), a = "" + t), Xe(r) && (he(r.key), a = "" + r.key), Ke(r) && (p = r.ref, Ze(r, i));
|
|
455
|
+
for (u in r)
|
|
456
|
+
N.call(r, u) && !ze.hasOwnProperty(u) && (o[u] = r[u]);
|
|
457
|
+
if (e && e.defaultProps) {
|
|
458
|
+
var s = e.defaultProps;
|
|
459
|
+
for (u in s)
|
|
460
|
+
o[u] === void 0 && (o[u] = s[u]);
|
|
461
|
+
}
|
|
462
|
+
if (a || p) {
|
|
463
|
+
var c = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
464
|
+
a && Qe(o, c), p && er(o, c);
|
|
465
|
+
}
|
|
466
|
+
return rr(e, a, p, i, n, $.current, o);
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
var z = k.ReactCurrentOwner, me = k.ReactDebugCurrentFrame;
|
|
470
|
+
function F(e) {
|
|
471
|
+
if (e) {
|
|
472
|
+
var r = e._owner, t = U(e.type, e._source, r ? r.type : null);
|
|
473
|
+
me.setExtraStackFrame(t);
|
|
474
|
+
} else
|
|
475
|
+
me.setExtraStackFrame(null);
|
|
476
|
+
}
|
|
477
|
+
var K;
|
|
478
|
+
K = !1;
|
|
479
|
+
function X(e) {
|
|
480
|
+
return typeof e == "object" && e !== null && e.$$typeof === m;
|
|
481
|
+
}
|
|
482
|
+
function be() {
|
|
483
|
+
{
|
|
484
|
+
if (z.current) {
|
|
485
|
+
var e = C(z.current.type);
|
|
486
|
+
if (e)
|
|
487
|
+
return `
|
|
488
|
+
|
|
489
|
+
Check the render method of \`` + e + "`.";
|
|
490
|
+
}
|
|
491
|
+
return "";
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
function nr(e) {
|
|
495
|
+
{
|
|
496
|
+
if (e !== void 0) {
|
|
497
|
+
var r = e.fileName.replace(/^.*[\\\/]/, ""), t = e.lineNumber;
|
|
498
|
+
return `
|
|
499
|
+
|
|
500
|
+
Check your code at ` + r + ":" + t + ".";
|
|
501
|
+
}
|
|
502
|
+
return "";
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
var Re = {};
|
|
506
|
+
function ar(e) {
|
|
507
|
+
{
|
|
508
|
+
var r = be();
|
|
509
|
+
if (!r) {
|
|
510
|
+
var t = typeof e == "string" ? e : e.displayName || e.name;
|
|
511
|
+
t && (r = `
|
|
512
|
+
|
|
513
|
+
Check the top-level render call using <` + t + ">.");
|
|
514
|
+
}
|
|
515
|
+
return r;
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
function ye(e, r) {
|
|
519
|
+
{
|
|
520
|
+
if (!e._store || e._store.validated || e.key != null)
|
|
521
|
+
return;
|
|
522
|
+
e._store.validated = !0;
|
|
523
|
+
var t = ar(r);
|
|
524
|
+
if (Re[t])
|
|
525
|
+
return;
|
|
526
|
+
Re[t] = !0;
|
|
527
|
+
var n = "";
|
|
528
|
+
e && e._owner && e._owner !== z.current && (n = " It was passed a child from " + C(e._owner.type) + "."), F(e), v('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, n), F(null);
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
function _e(e, r) {
|
|
532
|
+
{
|
|
533
|
+
if (typeof e != "object")
|
|
534
|
+
return;
|
|
535
|
+
if (J(e))
|
|
536
|
+
for (var t = 0; t < e.length; t++) {
|
|
537
|
+
var n = e[t];
|
|
538
|
+
X(n) && ye(n, r);
|
|
539
|
+
}
|
|
540
|
+
else if (X(e))
|
|
541
|
+
e._store && (e._store.validated = !0);
|
|
542
|
+
else if (e) {
|
|
543
|
+
var i = ke(e);
|
|
544
|
+
if (typeof i == "function" && i !== e.entries)
|
|
545
|
+
for (var u = i.call(e), o; !(o = u.next()).done; )
|
|
546
|
+
X(o.value) && ye(o.value, r);
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
function or(e) {
|
|
551
|
+
{
|
|
552
|
+
var r = e.type;
|
|
553
|
+
if (r == null || typeof r == "string")
|
|
554
|
+
return;
|
|
555
|
+
var t;
|
|
556
|
+
if (typeof r == "function")
|
|
557
|
+
t = r.propTypes;
|
|
558
|
+
else if (typeof r == "object" && (r.$$typeof === f || // Note: Memo only checks outer props here.
|
|
559
|
+
// Inner props are checked in the reconciler.
|
|
560
|
+
r.$$typeof === h))
|
|
561
|
+
t = r.propTypes;
|
|
562
|
+
else
|
|
563
|
+
return;
|
|
564
|
+
if (t) {
|
|
565
|
+
var n = C(r);
|
|
566
|
+
qe(t, e.props, "prop", n, e);
|
|
567
|
+
} else if (r.PropTypes !== void 0 && !K) {
|
|
568
|
+
K = !0;
|
|
569
|
+
var i = C(r);
|
|
570
|
+
v("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", i || "Unknown");
|
|
571
|
+
}
|
|
572
|
+
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && v("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
function ir(e) {
|
|
576
|
+
{
|
|
577
|
+
for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
|
|
578
|
+
var n = r[t];
|
|
579
|
+
if (n !== "children" && n !== "key") {
|
|
580
|
+
F(e), v("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), F(null);
|
|
581
|
+
break;
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
e.ref !== null && (F(e), v("Invalid attribute `ref` supplied to `React.Fragment`."), F(null));
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
function Ce(e, r, t, n, i, u) {
|
|
588
|
+
{
|
|
589
|
+
var o = We(e);
|
|
590
|
+
if (!o) {
|
|
591
|
+
var a = "";
|
|
592
|
+
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (a += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
593
|
+
var p = nr(i);
|
|
594
|
+
p ? a += p : a += be();
|
|
595
|
+
var s;
|
|
596
|
+
e === null ? s = "null" : J(e) ? s = "array" : e !== void 0 && e.$$typeof === m ? (s = "<" + (C(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : s = typeof e, v("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", s, a);
|
|
597
|
+
}
|
|
598
|
+
var c = tr(e, r, t, i, u);
|
|
599
|
+
if (c == null)
|
|
600
|
+
return c;
|
|
601
|
+
if (o) {
|
|
602
|
+
var g = r.children;
|
|
603
|
+
if (g !== void 0)
|
|
604
|
+
if (n)
|
|
605
|
+
if (J(g)) {
|
|
606
|
+
for (var D = 0; D < g.length; D++)
|
|
607
|
+
_e(g[D], e);
|
|
608
|
+
Object.freeze && Object.freeze(g);
|
|
609
|
+
} else
|
|
610
|
+
v("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
611
|
+
else
|
|
612
|
+
_e(g, e);
|
|
613
|
+
}
|
|
614
|
+
return e === S ? ir(c) : or(c), c;
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
function ur(e, r, t) {
|
|
618
|
+
return Ce(e, r, t, !0);
|
|
619
|
+
}
|
|
620
|
+
function sr(e, r, t) {
|
|
621
|
+
return Ce(e, r, t, !1);
|
|
622
|
+
}
|
|
623
|
+
var cr = sr, lr = ur;
|
|
624
|
+
W.Fragment = S, W.jsx = cr, W.jsxs = lr;
|
|
625
|
+
}()), W;
|
|
626
|
+
}
|
|
627
|
+
process.env.NODE_ENV === "production" ? Q.exports = pr() : Q.exports = hr();
|
|
628
|
+
var w = Q.exports;
|
|
629
|
+
const Pe = ({ children: l }) => /* @__PURE__ */ w.jsxs("div", { children: [
|
|
630
|
+
"Error loading Helio Checkout for React",
|
|
631
|
+
l ? `: ${l}` : ""
|
|
632
|
+
] });
|
|
633
|
+
class Er extends fr {
|
|
634
|
+
constructor(m) {
|
|
635
|
+
super(m), this.state = { hasError: !1 };
|
|
636
|
+
}
|
|
637
|
+
static getDerivedStateFromError() {
|
|
638
|
+
return { hasError: !0 };
|
|
639
|
+
}
|
|
640
|
+
render() {
|
|
641
|
+
return this.state.hasError ? /* @__PURE__ */ w.jsx(Pe, {}) : this.props.children;
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
const gr = () => /* @__PURE__ */ w.jsx("div", { children: "Loading Helio Checkout..." }), mr = "https://embed.hel.io/assets/index-v1.js", ee = "helio-checkout-react-v1", br = () => {
|
|
645
|
+
const l = document.createElement("script");
|
|
646
|
+
return l.setAttribute("type", "module"), l.setAttribute("id", ee), l.setAttribute("src", mr), document.body.appendChild(l), l;
|
|
647
|
+
}, Rr = ({ config: l }) => {
|
|
648
|
+
const m = dr(null), [P, S] = Z(!1), [b, j] = Z(), [O, R] = Z("");
|
|
649
|
+
return Se(() => S(!0), []), Se(() => {
|
|
650
|
+
let f = !1;
|
|
651
|
+
if (b)
|
|
652
|
+
return;
|
|
653
|
+
const y = () => {
|
|
654
|
+
if (f)
|
|
655
|
+
return;
|
|
656
|
+
const E = window.helioCheckout;
|
|
657
|
+
if (!E) {
|
|
658
|
+
R(
|
|
659
|
+
"Unable to load helio checkout - missing init function on window.helioCheckout"
|
|
660
|
+
);
|
|
661
|
+
return;
|
|
662
|
+
}
|
|
663
|
+
j(() => E);
|
|
664
|
+
}, d = (E) => {
|
|
665
|
+
const A = () => R("Error loading script tag");
|
|
666
|
+
return E.addEventListener("load", y), E.addEventListener("error", A), () => {
|
|
667
|
+
f = !0, E.removeEventListener("load", y), E.removeEventListener("error", A);
|
|
668
|
+
};
|
|
669
|
+
}, h = document.querySelector(
|
|
670
|
+
`script#${ee}`
|
|
671
|
+
);
|
|
672
|
+
if (h) {
|
|
673
|
+
window.helioCheckout ? y() : d(h);
|
|
674
|
+
return;
|
|
675
|
+
}
|
|
676
|
+
const _ = br();
|
|
677
|
+
return d(_);
|
|
678
|
+
}, [b]), vr(() => {
|
|
679
|
+
if (!(!b || !P)) {
|
|
680
|
+
if (!m.current) {
|
|
681
|
+
R("Missing element to mount Helio checkout");
|
|
682
|
+
return;
|
|
683
|
+
}
|
|
684
|
+
b(m.current, {
|
|
685
|
+
...l,
|
|
686
|
+
source: ee
|
|
687
|
+
});
|
|
688
|
+
}
|
|
689
|
+
}, [b, P, l]), O ? /* @__PURE__ */ w.jsx(Pe, { children: O }) : b ? /* @__PURE__ */ w.jsx("div", { ref: m }) : /* @__PURE__ */ w.jsx(gr, {});
|
|
690
|
+
}, _r = (l) => /* @__PURE__ */ w.jsx(Er, { children: /* @__PURE__ */ w.jsx(Rr, { config: l.config }) });
|
|
691
|
+
export {
|
|
692
|
+
_r as HelioCheckout
|
|
693
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
(function(j,h){typeof exports=="object"&&typeof module<"u"?h(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],h):(j=typeof globalThis<"u"?globalThis:j||self,h(j["react-library-scaffold"]={},j.React))})(this,function(j,h){"use strict";var J={exports:{}},L={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var te;function je(){if(te)return L;te=1;var f=h,b=Symbol.for("react.element"),k=Symbol.for("react.fragment"),w=Object.prototype.hasOwnProperty,y=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,F={key:!0,ref:!0,__self:!0,__source:!0};function x(R,l,_){var d,E={},T=null,g=null;_!==void 0&&(T=""+_),l.key!==void 0&&(T=""+l.key),l.ref!==void 0&&(g=l.ref);for(d in l)w.call(l,d)&&!F.hasOwnProperty(d)&&(E[d]=l[d]);if(R&&R.defaultProps)for(d in l=R.defaultProps,l)E[d]===void 0&&(E[d]=l[d]);return{$$typeof:b,type:R,key:T,ref:g,props:E,_owner:y.current}}return L.Fragment=k,L.jsx=x,L.jsxs=x,L}var W={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.development.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var ne;function Pe(){return ne||(ne=1,process.env.NODE_ENV!=="production"&&function(){var f=h,b=Symbol.for("react.element"),k=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),y=Symbol.for("react.strict_mode"),F=Symbol.for("react.profiler"),x=Symbol.for("react.provider"),R=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),_=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),E=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),g=Symbol.for("react.offscreen"),Y=Symbol.iterator,We="@@iterator";function Ye(e){if(e===null||typeof e!="object")return null;var r=Y&&e[Y]||e[We];return typeof r=="function"?r:null}var D=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function v(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];Me("error",e,t)}}function Me(e,r,t){{var n=D.ReactDebugCurrentFrame,i=n.getStackAddendum();i!==""&&(r+="%s",t=t.concat([i]));var u=t.map(function(o){return String(o)});u.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,u)}}var Ue=!1,Ne=!1,Ve=!1,Be=!1,He=!1,oe;oe=Symbol.for("react.module.reference");function $e(e){return!!(typeof e=="string"||typeof e=="function"||e===w||e===F||He||e===y||e===_||e===d||Be||e===g||Ue||Ne||Ve||typeof e=="object"&&e!==null&&(e.$$typeof===T||e.$$typeof===E||e.$$typeof===x||e.$$typeof===R||e.$$typeof===l||e.$$typeof===oe||e.getModuleId!==void 0))}function Je(e,r,t){var n=e.displayName;if(n)return n;var i=r.displayName||r.name||"";return i!==""?t+"("+i+")":t}function ie(e){return e.displayName||"Context"}function C(e){if(e==null)return null;if(typeof e.tag=="number"&&v("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case w:return"Fragment";case k:return"Portal";case F:return"Profiler";case y:return"StrictMode";case _:return"Suspense";case d:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case R:var r=e;return ie(r)+".Consumer";case x:var t=e;return ie(t._context)+".Provider";case l:return Je(e,e.render,"ForwardRef");case E:var n=e.displayName||null;return n!==null?n:C(e.type)||"Memo";case T:{var i=e,u=i._payload,o=i._init;try{return C(o(u))}catch{return null}}}return null}var P=Object.assign,M=0,ue,se,ce,fe,le,de,ve;function pe(){}pe.__reactDisabledLog=!0;function Ge(){{if(M===0){ue=console.log,se=console.info,ce=console.warn,fe=console.error,le=console.group,de=console.groupCollapsed,ve=console.groupEnd;var e={configurable:!0,enumerable:!0,value:pe,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}M++}}function ze(){{if(M--,M===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:P({},e,{value:ue}),info:P({},e,{value:se}),warn:P({},e,{value:ce}),error:P({},e,{value:fe}),group:P({},e,{value:le}),groupCollapsed:P({},e,{value:de}),groupEnd:P({},e,{value:ve})})}M<0&&v("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var z=D.ReactCurrentDispatcher,K;function N(e,r,t){{if(K===void 0)try{throw Error()}catch(i){var n=i.stack.trim().match(/\n( *(at )?)/);K=n&&n[1]||""}return`
|
|
18
|
+
`+K+e}}var X=!1,V;{var Ke=typeof WeakMap=="function"?WeakMap:Map;V=new Ke}function he(e,r){if(!e||X)return"";{var t=V.get(e);if(t!==void 0)return t}var n;X=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var u;u=z.current,z.current=null,Ge();try{if(r){var o=function(){throw Error()};if(Object.defineProperty(o.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(o,[])}catch(S){n=S}Reflect.construct(e,[],o)}else{try{o.call()}catch(S){n=S}e.call(o.prototype)}}else{try{throw Error()}catch(S){n=S}e()}}catch(S){if(S&&n&&typeof S.stack=="string"){for(var a=S.stack.split(`
|
|
19
|
+
`),p=n.stack.split(`
|
|
20
|
+
`),s=a.length-1,c=p.length-1;s>=1&&c>=0&&a[s]!==p[c];)c--;for(;s>=1&&c>=0;s--,c--)if(a[s]!==p[c]){if(s!==1||c!==1)do if(s--,c--,c<0||a[s]!==p[c]){var m=`
|
|
21
|
+
`+a[s].replace(" at new "," at ");return e.displayName&&m.includes("<anonymous>")&&(m=m.replace("<anonymous>",e.displayName)),typeof e=="function"&&V.set(e,m),m}while(s>=1&&c>=0);break}}}finally{X=!1,z.current=u,ze(),Error.prepareStackTrace=i}var I=e?e.displayName||e.name:"",xe=I?N(I):"";return typeof e=="function"&&V.set(e,xe),xe}function Xe(e,r,t){return he(e,!1)}function Ze(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function B(e,r,t){if(e==null)return"";if(typeof e=="function")return he(e,Ze(e));if(typeof e=="string")return N(e);switch(e){case _:return N("Suspense");case d:return N("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case l:return Xe(e.render);case E:return B(e.type,r,t);case T:{var n=e,i=n._payload,u=n._init;try{return B(u(i),r,t)}catch{}}}return""}var H=Object.prototype.hasOwnProperty,Ee={},ge=D.ReactDebugCurrentFrame;function $(e){if(e){var r=e._owner,t=B(e.type,e._source,r?r.type:null);ge.setExtraStackFrame(t)}else ge.setExtraStackFrame(null)}function qe(e,r,t,n,i){{var u=Function.call.bind(H);for(var o in e)if(u(e,o)){var a=void 0;try{if(typeof e[o]!="function"){var p=Error((n||"React class")+": "+t+" type `"+o+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[o]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw p.name="Invariant Violation",p}a=e[o](r,o,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(s){a=s}a&&!(a instanceof Error)&&($(i),v("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",n||"React class",t,o,typeof a),$(null)),a instanceof Error&&!(a.message in Ee)&&(Ee[a.message]=!0,$(i),v("Failed %s type: %s",t,a.message),$(null))}}}var Qe=Array.isArray;function Z(e){return Qe(e)}function er(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function rr(e){try{return me(e),!1}catch{return!0}}function me(e){return""+e}function be(e){if(rr(e))return v("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",er(e)),me(e)}var U=D.ReactCurrentOwner,tr={key:!0,ref:!0,__self:!0,__source:!0},ye,Re,q;q={};function nr(e){if(H.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function ar(e){if(H.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function or(e,r){if(typeof e.ref=="string"&&U.current&&r&&U.current.stateNode!==r){var t=C(U.current.type);q[t]||(v('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',C(U.current.type),e.ref),q[t]=!0)}}function ir(e,r){{var t=function(){ye||(ye=!0,v("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function ur(e,r){{var t=function(){Re||(Re=!0,v("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var sr=function(e,r,t,n,i,u,o){var a={$$typeof:b,type:e,key:r,ref:t,props:o,_owner:u};return a._store={},Object.defineProperty(a._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(a,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(a,"_source",{configurable:!1,enumerable:!1,writable:!1,value:i}),Object.freeze&&(Object.freeze(a.props),Object.freeze(a)),a};function cr(e,r,t,n,i){{var u,o={},a=null,p=null;t!==void 0&&(be(t),a=""+t),ar(r)&&(be(r.key),a=""+r.key),nr(r)&&(p=r.ref,or(r,i));for(u in r)H.call(r,u)&&!tr.hasOwnProperty(u)&&(o[u]=r[u]);if(e&&e.defaultProps){var s=e.defaultProps;for(u in s)o[u]===void 0&&(o[u]=s[u])}if(a||p){var c=typeof e=="function"?e.displayName||e.name||"Unknown":e;a&&ir(o,c),p&&ur(o,c)}return sr(e,a,p,i,n,U.current,o)}}var Q=D.ReactCurrentOwner,_e=D.ReactDebugCurrentFrame;function A(e){if(e){var r=e._owner,t=B(e.type,e._source,r?r.type:null);_e.setExtraStackFrame(t)}else _e.setExtraStackFrame(null)}var ee;ee=!1;function re(e){return typeof e=="object"&&e!==null&&e.$$typeof===b}function Te(){{if(Q.current){var e=C(Q.current.type);if(e)return`
|
|
22
|
+
|
|
23
|
+
Check the render method of \``+e+"`."}return""}}function fr(e){{if(e!==void 0){var r=e.fileName.replace(/^.*[\\\/]/,""),t=e.lineNumber;return`
|
|
24
|
+
|
|
25
|
+
Check your code at `+r+":"+t+"."}return""}}var Ce={};function lr(e){{var r=Te();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
|
|
26
|
+
|
|
27
|
+
Check the top-level render call using <`+t+">.")}return r}}function Se(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=lr(r);if(Ce[t])return;Ce[t]=!0;var n="";e&&e._owner&&e._owner!==Q.current&&(n=" It was passed a child from "+C(e._owner.type)+"."),A(e),v('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,n),A(null)}}function Oe(e,r){{if(typeof e!="object")return;if(Z(e))for(var t=0;t<e.length;t++){var n=e[t];re(n)&&Se(n,r)}else if(re(e))e._store&&(e._store.validated=!0);else if(e){var i=Ye(e);if(typeof i=="function"&&i!==e.entries)for(var u=i.call(e),o;!(o=u.next()).done;)re(o.value)&&Se(o.value,r)}}}function dr(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===l||r.$$typeof===E))t=r.propTypes;else return;if(t){var n=C(r);qe(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!ee){ee=!0;var i=C(r);v("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",i||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&v("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function vr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if(n!=="children"&&n!=="key"){A(e),v("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),A(null);break}}e.ref!==null&&(A(e),v("Invalid attribute `ref` supplied to `React.Fragment`."),A(null))}}function we(e,r,t,n,i,u){{var o=$e(e);if(!o){var a="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(a+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var p=fr(i);p?a+=p:a+=Te();var s;e===null?s="null":Z(e)?s="array":e!==void 0&&e.$$typeof===b?(s="<"+(C(e.type)||"Unknown")+" />",a=" Did you accidentally export a JSX literal instead of a component?"):s=typeof e,v("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",s,a)}var c=cr(e,r,t,i,u);if(c==null)return c;if(o){var m=r.children;if(m!==void 0)if(n)if(Z(m)){for(var I=0;I<m.length;I++)Oe(m[I],e);Object.freeze&&Object.freeze(m)}else v("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Oe(m,e)}return e===w?vr(c):dr(c),c}}function pr(e,r,t){return we(e,r,t,!0)}function hr(e,r,t){return we(e,r,t,!1)}var Er=hr,gr=pr;W.Fragment=w,W.jsx=Er,W.jsxs=gr}()),W}process.env.NODE_ENV==="production"?J.exports=je():J.exports=Pe();var O=J.exports;const ae=({children:f})=>O.jsxs("div",{children:["Error loading Helio Checkout for React",f?`: ${f}`:""]});class ke extends h.Component{constructor(b){super(b),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}render(){return this.state.hasError?O.jsx(ae,{}):this.props.children}}const Fe=()=>O.jsx("div",{children:"Loading Helio Checkout..."}),De="https://embed.hel.io/assets/index-v1.js",G="helio-checkout-react-v1",Ae=()=>{const f=document.createElement("script");return f.setAttribute("type","module"),f.setAttribute("id",G),f.setAttribute("src",De),document.body.appendChild(f),f},Ie=({config:f})=>{const b=h.useRef(null),[k,w]=h.useState(!1),[y,F]=h.useState(),[x,R]=h.useState("");return h.useEffect(()=>w(!0),[]),h.useEffect(()=>{let l=!1;if(y)return;const _=()=>{if(l)return;const g=window.helioCheckout;if(!g){R("Unable to load helio checkout - missing init function on window.helioCheckout");return}F(()=>g)},d=g=>{const Y=()=>R("Error loading script tag");return g.addEventListener("load",_),g.addEventListener("error",Y),()=>{l=!0,g.removeEventListener("load",_),g.removeEventListener("error",Y)}},E=document.querySelector(`script#${G}`);if(E){window.helioCheckout?_():d(E);return}const T=Ae();return d(T)},[y]),h.useLayoutEffect(()=>{if(!(!y||!k)){if(!b.current){R("Missing element to mount Helio checkout");return}y(b.current,{...f,source:G})}},[y,k,f]),x?O.jsx(ae,{children:x}):y?O.jsx("div",{ref:b}):O.jsx(Fe,{})},Le=f=>O.jsx(ke,{children:O.jsx(Ie,{config:f.config})});j.HelioCheckout=Le,Object.defineProperty(j,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@heliofi/checkout-react",
|
|
3
|
+
"private": false,
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"dev": "vite",
|
|
8
|
+
"build": "tsc && vite build",
|
|
9
|
+
"build:vercel": "tsc && vite build --config vite-vercel.config.ts",
|
|
10
|
+
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
|
11
|
+
"lint:fix": "yarn lint --fix",
|
|
12
|
+
"format": "prettier -w .",
|
|
13
|
+
"format:check": "prettier -c .",
|
|
14
|
+
"preview": "vite preview",
|
|
15
|
+
"prepublishOnly": "rimraf dist && yarn build",
|
|
16
|
+
"test": "vitest run",
|
|
17
|
+
"test:watch": "vitest",
|
|
18
|
+
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
19
|
+
},
|
|
20
|
+
"main": "./dist/helio-checkout-react.umd.js",
|
|
21
|
+
"module": "./dist/helio-checkout-react.es.js",
|
|
22
|
+
"exports": {
|
|
23
|
+
".": {
|
|
24
|
+
"import": "./dist/helio-checkout-react.es.js",
|
|
25
|
+
"require": "./dist/helio-checkout-react.umd.js"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"files": [
|
|
29
|
+
"dist/helio-checkout-react.es.js",
|
|
30
|
+
"dist/helio-checkout-react.umd.js"
|
|
31
|
+
],
|
|
32
|
+
"peerDependencies": {
|
|
33
|
+
"react": "^18.2.0",
|
|
34
|
+
"react-dom": "^18.2.0"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@testing-library/dom": "^9.3.3",
|
|
38
|
+
"@testing-library/jest-dom": "^6.1.4",
|
|
39
|
+
"@testing-library/react": "^14.0.0",
|
|
40
|
+
"@types/react": "18.2.0",
|
|
41
|
+
"@types/react-dom": "18.2.0",
|
|
42
|
+
"@typescript-eslint/eslint-plugin": "^6.0.0",
|
|
43
|
+
"@typescript-eslint/parser": "^6.0.0",
|
|
44
|
+
"@vitejs/plugin-react": "^4.0.3",
|
|
45
|
+
"eslint": "8.45.0",
|
|
46
|
+
"eslint-plugin-react": "^7.33.2",
|
|
47
|
+
"eslint-plugin-react-hooks": "^4.6.0",
|
|
48
|
+
"jsdom": "^23.0.1",
|
|
49
|
+
"typescript": "5.1.6",
|
|
50
|
+
"vite": "^4.4.5",
|
|
51
|
+
"vitest": "^0.34.6"
|
|
52
|
+
}
|
|
53
|
+
}
|