@turnkey/react-wallet-kit 1.0.0-beta.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/LICENSE +201 -0
- package/README.MD +112 -0
- package/dist/_virtual/_rollupPluginBabelHelpers.mjs +420 -0
- package/dist/_virtual/_rollupPluginBabelHelpers.mjs.map +1 -0
- package/dist/components/auth/Action.d.ts +10 -0
- package/dist/components/auth/Action.d.ts.map +1 -0
- package/dist/components/auth/Action.js +76 -0
- package/dist/components/auth/Action.js.map +1 -0
- package/dist/components/auth/Action.mjs +97 -0
- package/dist/components/auth/Action.mjs.map +1 -0
- package/dist/components/auth/Email.d.ts +6 -0
- package/dist/components/auth/Email.d.ts.map +1 -0
- package/dist/components/auth/Email.js +73 -0
- package/dist/components/auth/Email.js.map +1 -0
- package/dist/components/auth/Email.mjs +95 -0
- package/dist/components/auth/Email.mjs.map +1 -0
- package/dist/components/auth/OAuth.d.ts +10 -0
- package/dist/components/auth/OAuth.d.ts.map +1 -0
- package/dist/components/auth/OAuth.js +42 -0
- package/dist/components/auth/OAuth.js.map +1 -0
- package/dist/components/auth/OAuth.mjs +46 -0
- package/dist/components/auth/OAuth.mjs.map +1 -0
- package/dist/components/auth/OTP.d.ts +19 -0
- package/dist/components/auth/OTP.d.ts.map +1 -0
- package/dist/components/auth/OTP.js +204 -0
- package/dist/components/auth/OTP.js.map +1 -0
- package/dist/components/auth/OTP.mjs +288 -0
- package/dist/components/auth/OTP.mjs.map +1 -0
- package/dist/components/auth/OrSeparator.d.ts +2 -0
- package/dist/components/auth/OrSeparator.d.ts.map +1 -0
- package/dist/components/auth/OrSeparator.js +20 -0
- package/dist/components/auth/OrSeparator.js.map +1 -0
- package/dist/components/auth/OrSeparator.mjs +18 -0
- package/dist/components/auth/OrSeparator.mjs.map +1 -0
- package/dist/components/auth/Passkey.d.ts +7 -0
- package/dist/components/auth/Passkey.d.ts.map +1 -0
- package/dist/components/auth/Passkey.js +26 -0
- package/dist/components/auth/Passkey.js.map +1 -0
- package/dist/components/auth/Passkey.mjs +22 -0
- package/dist/components/auth/Passkey.mjs.map +1 -0
- package/dist/components/auth/Phone.d.ts +6 -0
- package/dist/components/auth/Phone.d.ts.map +1 -0
- package/dist/components/auth/Phone.js +67 -0
- package/dist/components/auth/Phone.js.map +1 -0
- package/dist/components/auth/Phone.mjs +93 -0
- package/dist/components/auth/Phone.mjs.map +1 -0
- package/dist/components/auth/Wallet.d.ts +30 -0
- package/dist/components/auth/Wallet.d.ts.map +1 -0
- package/dist/components/auth/Wallet.js +408 -0
- package/dist/components/auth/Wallet.js.map +1 -0
- package/dist/components/auth/Wallet.mjs +509 -0
- package/dist/components/auth/Wallet.mjs.map +1 -0
- package/dist/components/auth/index.d.ts +2 -0
- package/dist/components/auth/index.d.ts.map +1 -0
- package/dist/components/auth/index.js +327 -0
- package/dist/components/auth/index.js.map +1 -0
- package/dist/components/auth/index.mjs +540 -0
- package/dist/components/auth/index.mjs.map +1 -0
- package/dist/components/design/Buttons.d.ts +26 -0
- package/dist/components/design/Buttons.d.ts.map +1 -0
- package/dist/components/design/Buttons.js +79 -0
- package/dist/components/design/Buttons.js.map +1 -0
- package/dist/components/design/Buttons.mjs +71 -0
- package/dist/components/design/Buttons.mjs.map +1 -0
- package/dist/components/design/Failure.d.ts +9 -0
- package/dist/components/design/Failure.d.ts.map +1 -0
- package/dist/components/design/Failure.js +33 -0
- package/dist/components/design/Failure.js.map +1 -0
- package/dist/components/design/Failure.mjs +34 -0
- package/dist/components/design/Failure.mjs.map +1 -0
- package/dist/components/design/Inputs.d.ts +9 -0
- package/dist/components/design/Inputs.d.ts.map +1 -0
- package/dist/components/design/Inputs.js +113 -0
- package/dist/components/design/Inputs.js.map +1 -0
- package/dist/components/design/Inputs.mjs +108 -0
- package/dist/components/design/Inputs.mjs.map +1 -0
- package/dist/components/design/Lottie/Dynamic.d.ts +2 -0
- package/dist/components/design/Lottie/Dynamic.d.ts.map +1 -0
- package/dist/components/design/Lottie/Dynamic.js +9 -0
- package/dist/components/design/Lottie/Dynamic.js.map +1 -0
- package/dist/components/design/Lottie/Dynamic.mjs +27 -0
- package/dist/components/design/Lottie/Dynamic.mjs.map +1 -0
- package/dist/components/design/Lottie/Wrapper.d.ts +8 -0
- package/dist/components/design/Lottie/Wrapper.d.ts.map +1 -0
- package/dist/components/design/Lottie/Wrapper.js +26 -0
- package/dist/components/design/Lottie/Wrapper.js.map +1 -0
- package/dist/components/design/Lottie/Wrapper.mjs +43 -0
- package/dist/components/design/Lottie/Wrapper.mjs.map +1 -0
- package/dist/components/design/Spinners.d.ts +9 -0
- package/dist/components/design/Spinners.d.ts.map +1 -0
- package/dist/components/design/Spinners.js +38 -0
- package/dist/components/design/Spinners.js.map +1 -0
- package/dist/components/design/Spinners.mjs +37 -0
- package/dist/components/design/Spinners.mjs.map +1 -0
- package/dist/components/design/Success.d.ts +8 -0
- package/dist/components/design/Success.d.ts.map +1 -0
- package/dist/components/design/Success.js +82 -0
- package/dist/components/design/Success.js.map +1 -0
- package/dist/components/design/Success.mjs +86 -0
- package/dist/components/design/Success.mjs.map +1 -0
- package/dist/components/design/Svg.d.ts +10 -0
- package/dist/components/design/Svg.d.ts.map +1 -0
- package/dist/components/design/Svg.js +156 -0
- package/dist/components/design/Svg.js.map +1 -0
- package/dist/components/design/Svg.mjs +153 -0
- package/dist/components/design/Svg.mjs.map +1 -0
- package/dist/components/export/Export.d.ts +9 -0
- package/dist/components/export/Export.d.ts.map +1 -0
- package/dist/components/export/Export.js +140 -0
- package/dist/components/export/Export.js.map +1 -0
- package/dist/components/export/Export.mjs +178 -0
- package/dist/components/export/Export.mjs.map +1 -0
- package/dist/components/export/ExportWarning.d.ts +12 -0
- package/dist/components/export/ExportWarning.d.ts.map +1 -0
- package/dist/components/export/ExportWarning.js +87 -0
- package/dist/components/export/ExportWarning.js.map +1 -0
- package/dist/components/export/ExportWarning.mjs +113 -0
- package/dist/components/export/ExportWarning.mjs.map +1 -0
- package/dist/components/import/Import.d.ts +14 -0
- package/dist/components/import/Import.d.ts.map +1 -0
- package/dist/components/import/Import.js +226 -0
- package/dist/components/import/Import.js.map +1 -0
- package/dist/components/import/Import.mjs +328 -0
- package/dist/components/import/Import.mjs.map +1 -0
- package/dist/components/sign/Message.d.ts +17 -0
- package/dist/components/sign/Message.d.ts.map +1 -0
- package/dist/components/sign/Message.js +127 -0
- package/dist/components/sign/Message.js.map +1 -0
- package/dist/components/sign/Message.mjs +145 -0
- package/dist/components/sign/Message.mjs.map +1 -0
- package/dist/components/user/LinkWallet.d.ts +8 -0
- package/dist/components/user/LinkWallet.d.ts.map +1 -0
- package/dist/components/user/LinkWallet.js +102 -0
- package/dist/components/user/LinkWallet.js.map +1 -0
- package/dist/components/user/LinkWallet.mjs +162 -0
- package/dist/components/user/LinkWallet.mjs.map +1 -0
- package/dist/components/user/RemoveEmail.d.ts +11 -0
- package/dist/components/user/RemoveEmail.d.ts.map +1 -0
- package/dist/components/user/RemoveEmail.js +101 -0
- package/dist/components/user/RemoveEmail.js.map +1 -0
- package/dist/components/user/RemoveEmail.mjs +122 -0
- package/dist/components/user/RemoveEmail.mjs.map +1 -0
- package/dist/components/user/RemoveOAuthProvider.d.ts +11 -0
- package/dist/components/user/RemoveOAuthProvider.d.ts.map +1 -0
- package/dist/components/user/RemoveOAuthProvider.js +106 -0
- package/dist/components/user/RemoveOAuthProvider.js.map +1 -0
- package/dist/components/user/RemoveOAuthProvider.mjs +129 -0
- package/dist/components/user/RemoveOAuthProvider.mjs.map +1 -0
- package/dist/components/user/RemovePasskey.d.ts +11 -0
- package/dist/components/user/RemovePasskey.d.ts.map +1 -0
- package/dist/components/user/RemovePasskey.js +109 -0
- package/dist/components/user/RemovePasskey.js.map +1 -0
- package/dist/components/user/RemovePasskey.mjs +132 -0
- package/dist/components/user/RemovePasskey.mjs.map +1 -0
- package/dist/components/user/RemovePhoneNumber.d.ts +11 -0
- package/dist/components/user/RemovePhoneNumber.d.ts.map +1 -0
- package/dist/components/user/RemovePhoneNumber.js +101 -0
- package/dist/components/user/RemovePhoneNumber.js.map +1 -0
- package/dist/components/user/RemovePhoneNumber.mjs +122 -0
- package/dist/components/user/RemovePhoneNumber.mjs.map +1 -0
- package/dist/components/user/UpdateEmail.d.ts +8 -0
- package/dist/components/user/UpdateEmail.d.ts.map +1 -0
- package/dist/components/user/UpdateEmail.js +139 -0
- package/dist/components/user/UpdateEmail.js.map +1 -0
- package/dist/components/user/UpdateEmail.mjs +186 -0
- package/dist/components/user/UpdateEmail.mjs.map +1 -0
- package/dist/components/user/UpdatePhoneNumber.d.ts +8 -0
- package/dist/components/user/UpdatePhoneNumber.d.ts.map +1 -0
- package/dist/components/user/UpdatePhoneNumber.js +136 -0
- package/dist/components/user/UpdatePhoneNumber.js.map +1 -0
- package/dist/components/user/UpdatePhoneNumber.mjs +187 -0
- package/dist/components/user/UpdatePhoneNumber.mjs.map +1 -0
- package/dist/components/user/UpdateUserName.d.ts +11 -0
- package/dist/components/user/UpdateUserName.d.ts.map +1 -0
- package/dist/components/user/UpdateUserName.js +112 -0
- package/dist/components/user/UpdateUserName.js.map +1 -0
- package/dist/components/user/UpdateUserName.mjs +139 -0
- package/dist/components/user/UpdateUserName.mjs.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +32 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +6 -0
- package/dist/index.mjs.map +1 -0
- package/dist/providers/TurnkeyProvider.d.ts +8 -0
- package/dist/providers/TurnkeyProvider.d.ts.map +1 -0
- package/dist/providers/TurnkeyProvider.js +35 -0
- package/dist/providers/TurnkeyProvider.js.map +1 -0
- package/dist/providers/TurnkeyProvider.mjs +33 -0
- package/dist/providers/TurnkeyProvider.mjs.map +1 -0
- package/dist/providers/client/Hook.d.ts +3 -0
- package/dist/providers/client/Hook.d.ts.map +1 -0
- package/dist/providers/client/Hook.js +14 -0
- package/dist/providers/client/Hook.js.map +1 -0
- package/dist/providers/client/Hook.mjs +12 -0
- package/dist/providers/client/Hook.mjs.map +1 -0
- package/dist/providers/client/Provider.d.ts +39 -0
- package/dist/providers/client/Provider.d.ts.map +1 -0
- package/dist/providers/client/Provider.js +2489 -0
- package/dist/providers/client/Provider.js.map +1 -0
- package/dist/providers/client/Provider.mjs +4744 -0
- package/dist/providers/client/Provider.mjs.map +1 -0
- package/dist/providers/client/Types.d.ts +524 -0
- package/dist/providers/client/Types.d.ts.map +1 -0
- package/dist/providers/client/Types.js +9 -0
- package/dist/providers/client/Types.js.map +1 -0
- package/dist/providers/client/Types.mjs +7 -0
- package/dist/providers/client/Types.mjs.map +1 -0
- package/dist/providers/index.d.ts +5 -0
- package/dist/providers/index.d.ts.map +1 -0
- package/dist/providers/modal/Hook.d.ts +3 -0
- package/dist/providers/modal/Hook.d.ts.map +1 -0
- package/dist/providers/modal/Hook.js +14 -0
- package/dist/providers/modal/Hook.js.map +1 -0
- package/dist/providers/modal/Hook.mjs +12 -0
- package/dist/providers/modal/Hook.mjs.map +1 -0
- package/dist/providers/modal/Provider.d.ts +21 -0
- package/dist/providers/modal/Provider.d.ts.map +1 -0
- package/dist/providers/modal/Provider.js +37 -0
- package/dist/providers/modal/Provider.js.map +1 -0
- package/dist/providers/modal/Provider.mjs +48 -0
- package/dist/providers/modal/Provider.mjs.map +1 -0
- package/dist/providers/modal/Root.d.ts +7 -0
- package/dist/providers/modal/Root.d.ts.map +1 -0
- package/dist/providers/modal/Root.js +258 -0
- package/dist/providers/modal/Root.js.map +1 -0
- package/dist/providers/modal/Root.mjs +263 -0
- package/dist/providers/modal/Root.mjs.map +1 -0
- package/dist/providers/theme/Overrides.d.ts +18 -0
- package/dist/providers/theme/Overrides.d.ts.map +1 -0
- package/dist/providers/theme/Overrides.js +35 -0
- package/dist/providers/theme/Overrides.js.map +1 -0
- package/dist/providers/theme/Overrides.mjs +37 -0
- package/dist/providers/theme/Overrides.mjs.map +1 -0
- package/dist/styles.css +1 -0
- package/dist/types/base.d.ts +79 -0
- package/dist/types/base.d.ts.map +1 -0
- package/dist/types/base.js +19 -0
- package/dist/types/base.js.map +1 -0
- package/dist/types/base.mjs +19 -0
- package/dist/types/base.mjs.map +1 -0
- package/dist/utils.d.ts +72 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +211 -0
- package/dist/utils.js.map +1 -0
- package/dist/utils.mjs +307 -0
- package/dist/utils.mjs.map +1 -0
- package/package.json +69 -0
|
@@ -0,0 +1,420 @@
|
|
|
1
|
+
function _arrayLikeToArray(r, a) {
|
|
2
|
+
(null == a || a > r.length) && (a = r.length);
|
|
3
|
+
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
4
|
+
return n;
|
|
5
|
+
}
|
|
6
|
+
function _arrayWithHoles(r) {
|
|
7
|
+
if (Array.isArray(r)) return r;
|
|
8
|
+
}
|
|
9
|
+
function _arrayWithoutHoles(r) {
|
|
10
|
+
if (Array.isArray(r)) return _arrayLikeToArray(r);
|
|
11
|
+
}
|
|
12
|
+
function asyncGeneratorStep(n, t, e, r, o, a, c) {
|
|
13
|
+
try {
|
|
14
|
+
var i = n[a](c),
|
|
15
|
+
u = i.value;
|
|
16
|
+
} catch (n) {
|
|
17
|
+
return void e(n);
|
|
18
|
+
}
|
|
19
|
+
i.done ? t(u) : Promise.resolve(u).then(r, o);
|
|
20
|
+
}
|
|
21
|
+
function _asyncToGenerator(n) {
|
|
22
|
+
return function () {
|
|
23
|
+
var t = this,
|
|
24
|
+
e = arguments;
|
|
25
|
+
return new Promise(function (r, o) {
|
|
26
|
+
var a = n.apply(t, e);
|
|
27
|
+
function _next(n) {
|
|
28
|
+
asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
|
|
29
|
+
}
|
|
30
|
+
function _throw(n) {
|
|
31
|
+
asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
|
|
32
|
+
}
|
|
33
|
+
_next(void 0);
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
function _defineProperty(e, r, t) {
|
|
38
|
+
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
39
|
+
value: t,
|
|
40
|
+
enumerable: true,
|
|
41
|
+
configurable: true,
|
|
42
|
+
writable: true
|
|
43
|
+
}) : e[r] = t, e;
|
|
44
|
+
}
|
|
45
|
+
function _iterableToArray(r) {
|
|
46
|
+
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
|
|
47
|
+
}
|
|
48
|
+
function _iterableToArrayLimit(r, l) {
|
|
49
|
+
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
50
|
+
if (null != t) {
|
|
51
|
+
var e,
|
|
52
|
+
n,
|
|
53
|
+
i,
|
|
54
|
+
u,
|
|
55
|
+
a = [],
|
|
56
|
+
f = true,
|
|
57
|
+
o = false;
|
|
58
|
+
try {
|
|
59
|
+
if (i = (t = t.call(r)).next, 0 === l) {
|
|
60
|
+
if (Object(t) !== t) return;
|
|
61
|
+
f = !1;
|
|
62
|
+
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
63
|
+
} catch (r) {
|
|
64
|
+
o = true, n = r;
|
|
65
|
+
} finally {
|
|
66
|
+
try {
|
|
67
|
+
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
|
|
68
|
+
} finally {
|
|
69
|
+
if (o) throw n;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return a;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
function _nonIterableRest() {
|
|
76
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
77
|
+
}
|
|
78
|
+
function _nonIterableSpread() {
|
|
79
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
80
|
+
}
|
|
81
|
+
function ownKeys(e, r) {
|
|
82
|
+
var t = Object.keys(e);
|
|
83
|
+
if (Object.getOwnPropertySymbols) {
|
|
84
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
85
|
+
r && (o = o.filter(function (r) {
|
|
86
|
+
return Object.getOwnPropertyDescriptor(e, r).enumerable;
|
|
87
|
+
})), t.push.apply(t, o);
|
|
88
|
+
}
|
|
89
|
+
return t;
|
|
90
|
+
}
|
|
91
|
+
function _objectSpread2(e) {
|
|
92
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
93
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
|
94
|
+
r % 2 ? ownKeys(Object(t), true).forEach(function (r) {
|
|
95
|
+
_defineProperty(e, r, t[r]);
|
|
96
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
|
|
97
|
+
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
return e;
|
|
101
|
+
}
|
|
102
|
+
function _objectWithoutProperties(e, t) {
|
|
103
|
+
if (null == e) return {};
|
|
104
|
+
var o,
|
|
105
|
+
r,
|
|
106
|
+
i = _objectWithoutPropertiesLoose(e, t);
|
|
107
|
+
if (Object.getOwnPropertySymbols) {
|
|
108
|
+
var n = Object.getOwnPropertySymbols(e);
|
|
109
|
+
for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
110
|
+
}
|
|
111
|
+
return i;
|
|
112
|
+
}
|
|
113
|
+
function _objectWithoutPropertiesLoose(r, e) {
|
|
114
|
+
if (null == r) return {};
|
|
115
|
+
var t = {};
|
|
116
|
+
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
117
|
+
if (-1 !== e.indexOf(n)) continue;
|
|
118
|
+
t[n] = r[n];
|
|
119
|
+
}
|
|
120
|
+
return t;
|
|
121
|
+
}
|
|
122
|
+
function _regeneratorRuntime() {
|
|
123
|
+
_regeneratorRuntime = function () {
|
|
124
|
+
return r;
|
|
125
|
+
};
|
|
126
|
+
var t,
|
|
127
|
+
r = {},
|
|
128
|
+
e = Object.prototype,
|
|
129
|
+
n = e.hasOwnProperty,
|
|
130
|
+
o = "function" == typeof Symbol ? Symbol : {},
|
|
131
|
+
i = o.iterator || "@@iterator",
|
|
132
|
+
a = o.asyncIterator || "@@asyncIterator",
|
|
133
|
+
u = o.toStringTag || "@@toStringTag";
|
|
134
|
+
function c(t, r, e, n) {
|
|
135
|
+
Object.defineProperty(t, r, {
|
|
136
|
+
value: e,
|
|
137
|
+
enumerable: !n,
|
|
138
|
+
configurable: !n,
|
|
139
|
+
writable: !n
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
try {
|
|
143
|
+
c({}, "");
|
|
144
|
+
} catch (t) {
|
|
145
|
+
c = function (t, r, e) {
|
|
146
|
+
return t[r] = e;
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
function h(r, e, n, o) {
|
|
150
|
+
var i = e && e.prototype instanceof Generator ? e : Generator,
|
|
151
|
+
a = Object.create(i.prototype);
|
|
152
|
+
return c(a, "_invoke", function (r, e, n) {
|
|
153
|
+
var o = 1;
|
|
154
|
+
return function (i, a) {
|
|
155
|
+
if (3 === o) throw Error("Generator is already running");
|
|
156
|
+
if (4 === o) {
|
|
157
|
+
if ("throw" === i) throw a;
|
|
158
|
+
return {
|
|
159
|
+
value: t,
|
|
160
|
+
done: true
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
for (n.method = i, n.arg = a;;) {
|
|
164
|
+
var u = n.delegate;
|
|
165
|
+
if (u) {
|
|
166
|
+
var c = d(u, n);
|
|
167
|
+
if (c) {
|
|
168
|
+
if (c === f) continue;
|
|
169
|
+
return c;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
|
|
173
|
+
if (1 === o) throw o = 4, n.arg;
|
|
174
|
+
n.dispatchException(n.arg);
|
|
175
|
+
} else "return" === n.method && n.abrupt("return", n.arg);
|
|
176
|
+
o = 3;
|
|
177
|
+
var h = s(r, e, n);
|
|
178
|
+
if ("normal" === h.type) {
|
|
179
|
+
if (o = n.done ? 4 : 2, h.arg === f) continue;
|
|
180
|
+
return {
|
|
181
|
+
value: h.arg,
|
|
182
|
+
done: n.done
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
"throw" === h.type && (o = 4, n.method = "throw", n.arg = h.arg);
|
|
186
|
+
}
|
|
187
|
+
};
|
|
188
|
+
}(r, n, new Context(o || [])), true), a;
|
|
189
|
+
}
|
|
190
|
+
function s(t, r, e) {
|
|
191
|
+
try {
|
|
192
|
+
return {
|
|
193
|
+
type: "normal",
|
|
194
|
+
arg: t.call(r, e)
|
|
195
|
+
};
|
|
196
|
+
} catch (t) {
|
|
197
|
+
return {
|
|
198
|
+
type: "throw",
|
|
199
|
+
arg: t
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
r.wrap = h;
|
|
204
|
+
var f = {};
|
|
205
|
+
function Generator() {}
|
|
206
|
+
function GeneratorFunction() {}
|
|
207
|
+
function GeneratorFunctionPrototype() {}
|
|
208
|
+
var l = {};
|
|
209
|
+
c(l, i, function () {
|
|
210
|
+
return this;
|
|
211
|
+
});
|
|
212
|
+
var p = Object.getPrototypeOf,
|
|
213
|
+
y = p && p(p(x([])));
|
|
214
|
+
y && y !== e && n.call(y, i) && (l = y);
|
|
215
|
+
var v = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(l);
|
|
216
|
+
function g(t) {
|
|
217
|
+
["next", "throw", "return"].forEach(function (r) {
|
|
218
|
+
c(t, r, function (t) {
|
|
219
|
+
return this._invoke(r, t);
|
|
220
|
+
});
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
function AsyncIterator(t, r) {
|
|
224
|
+
function e(o, i, a, u) {
|
|
225
|
+
var c = s(t[o], t, i);
|
|
226
|
+
if ("throw" !== c.type) {
|
|
227
|
+
var h = c.arg,
|
|
228
|
+
f = h.value;
|
|
229
|
+
return f && "object" == typeof f && n.call(f, "__await") ? r.resolve(f.__await).then(function (t) {
|
|
230
|
+
e("next", t, a, u);
|
|
231
|
+
}, function (t) {
|
|
232
|
+
e("throw", t, a, u);
|
|
233
|
+
}) : r.resolve(f).then(function (t) {
|
|
234
|
+
h.value = t, a(h);
|
|
235
|
+
}, function (t) {
|
|
236
|
+
return e("throw", t, a, u);
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
u(c.arg);
|
|
240
|
+
}
|
|
241
|
+
var o;
|
|
242
|
+
c(this, "_invoke", function (t, n) {
|
|
243
|
+
function i() {
|
|
244
|
+
return new r(function (r, o) {
|
|
245
|
+
e(t, n, r, o);
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
return o = o ? o.then(i, i) : i();
|
|
249
|
+
}, true);
|
|
250
|
+
}
|
|
251
|
+
function d(r, e) {
|
|
252
|
+
var n = e.method,
|
|
253
|
+
o = r.i[n];
|
|
254
|
+
if (o === t) return e.delegate = null, "throw" === n && r.i.return && (e.method = "return", e.arg = t, d(r, e), "throw" === e.method) || "return" !== n && (e.method = "throw", e.arg = new TypeError("The iterator does not provide a '" + n + "' method")), f;
|
|
255
|
+
var i = s(o, r.i, e.arg);
|
|
256
|
+
if ("throw" === i.type) return e.method = "throw", e.arg = i.arg, e.delegate = null, f;
|
|
257
|
+
var a = i.arg;
|
|
258
|
+
return a ? a.done ? (e[r.r] = a.value, e.next = r.n, "return" !== e.method && (e.method = "next", e.arg = t), e.delegate = null, f) : a : (e.method = "throw", e.arg = new TypeError("iterator result is not an object"), e.delegate = null, f);
|
|
259
|
+
}
|
|
260
|
+
function w(t) {
|
|
261
|
+
this.tryEntries.push(t);
|
|
262
|
+
}
|
|
263
|
+
function m(r) {
|
|
264
|
+
var e = r[4] || {};
|
|
265
|
+
e.type = "normal", e.arg = t, r[4] = e;
|
|
266
|
+
}
|
|
267
|
+
function Context(t) {
|
|
268
|
+
this.tryEntries = [[-1]], t.forEach(w, this), this.reset(true);
|
|
269
|
+
}
|
|
270
|
+
function x(r) {
|
|
271
|
+
if (null != r) {
|
|
272
|
+
var e = r[i];
|
|
273
|
+
if (e) return e.call(r);
|
|
274
|
+
if ("function" == typeof r.next) return r;
|
|
275
|
+
if (!isNaN(r.length)) {
|
|
276
|
+
var o = -1,
|
|
277
|
+
a = function e() {
|
|
278
|
+
for (; ++o < r.length;) if (n.call(r, o)) return e.value = r[o], e.done = false, e;
|
|
279
|
+
return e.value = t, e.done = true, e;
|
|
280
|
+
};
|
|
281
|
+
return a.next = a;
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
throw new TypeError(typeof r + " is not iterable");
|
|
285
|
+
}
|
|
286
|
+
return GeneratorFunction.prototype = GeneratorFunctionPrototype, c(v, "constructor", GeneratorFunctionPrototype), c(GeneratorFunctionPrototype, "constructor", GeneratorFunction), c(GeneratorFunctionPrototype, u, GeneratorFunction.displayName = "GeneratorFunction"), r.isGeneratorFunction = function (t) {
|
|
287
|
+
var r = "function" == typeof t && t.constructor;
|
|
288
|
+
return !!r && (r === GeneratorFunction || "GeneratorFunction" === (r.displayName || r.name));
|
|
289
|
+
}, r.mark = function (t) {
|
|
290
|
+
return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, c(t, u, "GeneratorFunction")), t.prototype = Object.create(v), t;
|
|
291
|
+
}, r.awrap = function (t) {
|
|
292
|
+
return {
|
|
293
|
+
__await: t
|
|
294
|
+
};
|
|
295
|
+
}, g(AsyncIterator.prototype), c(AsyncIterator.prototype, a, function () {
|
|
296
|
+
return this;
|
|
297
|
+
}), r.AsyncIterator = AsyncIterator, r.async = function (t, e, n, o, i) {
|
|
298
|
+
void 0 === i && (i = Promise);
|
|
299
|
+
var a = new AsyncIterator(h(t, e, n, o), i);
|
|
300
|
+
return r.isGeneratorFunction(e) ? a : a.next().then(function (t) {
|
|
301
|
+
return t.done ? t.value : a.next();
|
|
302
|
+
});
|
|
303
|
+
}, g(v), c(v, u, "Generator"), c(v, i, function () {
|
|
304
|
+
return this;
|
|
305
|
+
}), c(v, "toString", function () {
|
|
306
|
+
return "[object Generator]";
|
|
307
|
+
}), r.keys = function (t) {
|
|
308
|
+
var r = Object(t),
|
|
309
|
+
e = [];
|
|
310
|
+
for (var n in r) e.unshift(n);
|
|
311
|
+
return function t() {
|
|
312
|
+
for (; e.length;) if ((n = e.pop()) in r) return t.value = n, t.done = false, t;
|
|
313
|
+
return t.done = true, t;
|
|
314
|
+
};
|
|
315
|
+
}, r.values = x, Context.prototype = {
|
|
316
|
+
constructor: Context,
|
|
317
|
+
reset: function (r) {
|
|
318
|
+
if (this.prev = this.next = 0, this.sent = this._sent = t, this.done = false, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(m), !r) for (var e in this) "t" === e.charAt(0) && n.call(this, e) && !isNaN(+e.slice(1)) && (this[e] = t);
|
|
319
|
+
},
|
|
320
|
+
stop: function () {
|
|
321
|
+
this.done = true;
|
|
322
|
+
var t = this.tryEntries[0][4];
|
|
323
|
+
if ("throw" === t.type) throw t.arg;
|
|
324
|
+
return this.rval;
|
|
325
|
+
},
|
|
326
|
+
dispatchException: function (r) {
|
|
327
|
+
if (this.done) throw r;
|
|
328
|
+
var e = this;
|
|
329
|
+
function n(t) {
|
|
330
|
+
a.type = "throw", a.arg = r, e.next = t;
|
|
331
|
+
}
|
|
332
|
+
for (var o = e.tryEntries.length - 1; o >= 0; --o) {
|
|
333
|
+
var i = this.tryEntries[o],
|
|
334
|
+
a = i[4],
|
|
335
|
+
u = this.prev,
|
|
336
|
+
c = i[1],
|
|
337
|
+
h = i[2];
|
|
338
|
+
if (-1 === i[0]) return n("end"), false;
|
|
339
|
+
if (!c && !h) throw Error("try statement without catch or finally");
|
|
340
|
+
if (null != i[0] && i[0] <= u) {
|
|
341
|
+
if (u < c) return this.method = "next", this.arg = t, n(c), true;
|
|
342
|
+
if (u < h) return n(h), false;
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
},
|
|
346
|
+
abrupt: function (t, r) {
|
|
347
|
+
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
|
348
|
+
var n = this.tryEntries[e];
|
|
349
|
+
if (n[0] > -1 && n[0] <= this.prev && this.prev < n[2]) {
|
|
350
|
+
var o = n;
|
|
351
|
+
break;
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
o && ("break" === t || "continue" === t) && o[0] <= r && r <= o[2] && (o = null);
|
|
355
|
+
var i = o ? o[4] : {};
|
|
356
|
+
return i.type = t, i.arg = r, o ? (this.method = "next", this.next = o[2], f) : this.complete(i);
|
|
357
|
+
},
|
|
358
|
+
complete: function (t, r) {
|
|
359
|
+
if ("throw" === t.type) throw t.arg;
|
|
360
|
+
return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && r && (this.next = r), f;
|
|
361
|
+
},
|
|
362
|
+
finish: function (t) {
|
|
363
|
+
for (var r = this.tryEntries.length - 1; r >= 0; --r) {
|
|
364
|
+
var e = this.tryEntries[r];
|
|
365
|
+
if (e[2] === t) return this.complete(e[4], e[3]), m(e), f;
|
|
366
|
+
}
|
|
367
|
+
},
|
|
368
|
+
catch: function (t) {
|
|
369
|
+
for (var r = this.tryEntries.length - 1; r >= 0; --r) {
|
|
370
|
+
var e = this.tryEntries[r];
|
|
371
|
+
if (e[0] === t) {
|
|
372
|
+
var n = e[4];
|
|
373
|
+
if ("throw" === n.type) {
|
|
374
|
+
var o = n.arg;
|
|
375
|
+
m(e);
|
|
376
|
+
}
|
|
377
|
+
return o;
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
throw Error("illegal catch attempt");
|
|
381
|
+
},
|
|
382
|
+
delegateYield: function (r, e, n) {
|
|
383
|
+
return this.delegate = {
|
|
384
|
+
i: x(r),
|
|
385
|
+
r: e,
|
|
386
|
+
n: n
|
|
387
|
+
}, "next" === this.method && (this.arg = t), f;
|
|
388
|
+
}
|
|
389
|
+
}, r;
|
|
390
|
+
}
|
|
391
|
+
function _slicedToArray(r, e) {
|
|
392
|
+
return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
|
|
393
|
+
}
|
|
394
|
+
function _toConsumableArray(r) {
|
|
395
|
+
return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
|
|
396
|
+
}
|
|
397
|
+
function _toPrimitive(t, r) {
|
|
398
|
+
if ("object" != typeof t || !t) return t;
|
|
399
|
+
var e = t[Symbol.toPrimitive];
|
|
400
|
+
if (void 0 !== e) {
|
|
401
|
+
var i = e.call(t, r);
|
|
402
|
+
if ("object" != typeof i) return i;
|
|
403
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
404
|
+
}
|
|
405
|
+
return ("string" === r ? String : Number)(t);
|
|
406
|
+
}
|
|
407
|
+
function _toPropertyKey(t) {
|
|
408
|
+
var i = _toPrimitive(t, "string");
|
|
409
|
+
return "symbol" == typeof i ? i : i + "";
|
|
410
|
+
}
|
|
411
|
+
function _unsupportedIterableToArray(r, a) {
|
|
412
|
+
if (r) {
|
|
413
|
+
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
414
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
415
|
+
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
export { _arrayLikeToArray as arrayLikeToArray, _arrayWithHoles as arrayWithHoles, _arrayWithoutHoles as arrayWithoutHoles, _asyncToGenerator as asyncToGenerator, _defineProperty as defineProperty, _iterableToArray as iterableToArray, _iterableToArrayLimit as iterableToArrayLimit, _nonIterableRest as nonIterableRest, _nonIterableSpread as nonIterableSpread, _objectSpread2 as objectSpread2, _objectWithoutProperties as objectWithoutProperties, _objectWithoutPropertiesLoose as objectWithoutPropertiesLoose, _regeneratorRuntime as regeneratorRuntime, _slicedToArray as slicedToArray, _toConsumableArray as toConsumableArray, _toPrimitive as toPrimitive, _toPropertyKey as toPropertyKey, _unsupportedIterableToArray as unsupportedIterableToArray };
|
|
420
|
+
//# sourceMappingURL=_rollupPluginBabelHelpers.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_rollupPluginBabelHelpers.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
interface ActionPageProps {
|
|
3
|
+
title: string;
|
|
4
|
+
icon: React.ReactNode;
|
|
5
|
+
closeOnComplete?: boolean;
|
|
6
|
+
action?: () => Promise<void>;
|
|
7
|
+
}
|
|
8
|
+
export declare function ActionPage(props: ActionPageProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=Action.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Action.d.ts","sourceRoot":"","sources":["../../../src/components/auth/Action.tsx"],"names":[],"mappings":";AAKA,UAAU,eAAe;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC;IACtB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9B;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,2CA2DhD"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var react = require('react');
|
|
5
|
+
var Hook = require('../../providers/modal/Hook.js');
|
|
6
|
+
var Spinners = require('../design/Spinners.js');
|
|
7
|
+
var clsx = require('clsx');
|
|
8
|
+
|
|
9
|
+
function ActionPage(props) {
|
|
10
|
+
const {
|
|
11
|
+
title,
|
|
12
|
+
icon,
|
|
13
|
+
closeOnComplete = true,
|
|
14
|
+
action
|
|
15
|
+
} = props;
|
|
16
|
+
const {
|
|
17
|
+
popPage,
|
|
18
|
+
closeModal,
|
|
19
|
+
isMobile
|
|
20
|
+
} = Hook.useModal();
|
|
21
|
+
const hasRun = react.useRef(false);
|
|
22
|
+
const iconRef = react.useRef(null);
|
|
23
|
+
const [spinnerSize, setSpinnerSize] = react.useState(40);
|
|
24
|
+
react.useEffect(() => {
|
|
25
|
+
if (iconRef.current) {
|
|
26
|
+
const rect = iconRef.current.getBoundingClientRect();
|
|
27
|
+
const size = Math.max(rect.width, rect.height);
|
|
28
|
+
setSpinnerSize(size + 50);
|
|
29
|
+
}
|
|
30
|
+
}, []);
|
|
31
|
+
react.useEffect(() => {
|
|
32
|
+
if (hasRun.current) return;
|
|
33
|
+
hasRun.current = true;
|
|
34
|
+
const runAction = async () => {
|
|
35
|
+
if (action) {
|
|
36
|
+
try {
|
|
37
|
+
await action();
|
|
38
|
+
} catch (error) {
|
|
39
|
+
popPage();
|
|
40
|
+
throw new Error(`${error}`);
|
|
41
|
+
}
|
|
42
|
+
if (closeOnComplete) {
|
|
43
|
+
closeModal();
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
runAction();
|
|
48
|
+
}, []);
|
|
49
|
+
return jsxRuntime.jsx("div", {
|
|
50
|
+
className: clsx("flex items-center justify-center py-10", isMobile ? "w-full" : "w-96"),
|
|
51
|
+
children: jsxRuntime.jsxs("div", {
|
|
52
|
+
className: "flex flex-col items-center justify-center gap-8",
|
|
53
|
+
children: [jsxRuntime.jsxs("div", {
|
|
54
|
+
className: "relative flex items-center justify-center",
|
|
55
|
+
children: [jsxRuntime.jsx("div", {
|
|
56
|
+
ref: iconRef,
|
|
57
|
+
className: "flex items-center justify-center",
|
|
58
|
+
children: icon
|
|
59
|
+
}), jsxRuntime.jsx(Spinners.Spinner, {
|
|
60
|
+
className: "absolute",
|
|
61
|
+
style: {
|
|
62
|
+
width: spinnerSize,
|
|
63
|
+
height: spinnerSize
|
|
64
|
+
},
|
|
65
|
+
strokeWidth: 1
|
|
66
|
+
})]
|
|
67
|
+
}), jsxRuntime.jsx("span", {
|
|
68
|
+
className: "text-lg font-semibold",
|
|
69
|
+
children: title
|
|
70
|
+
})]
|
|
71
|
+
})
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
exports.ActionPage = ActionPage;
|
|
76
|
+
//# sourceMappingURL=Action.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Action.js","sources":["../../../src/components/auth/Action.tsx"],"sourcesContent":[null],"names":["ActionPage","props","title","icon","closeOnComplete","action","popPage","closeModal","isMobile","useModal","hasRun","useRef","iconRef","spinnerSize","setSpinnerSize","useState","useEffect","current","rect","getBoundingClientRect","size","Math","max","width","height","runAction","error","Error","_jsx","className","clsx","children","_jsxs","ref","Spinner","style","strokeWidth"],"mappings":";;;;;;;;AAYM,SAAUA,UAAUA,CAACC,KAAsB,EAAA;EAC/C,MAAM;IAAEC,KAAK;IAAEC,IAAI;AAAEC,IAAAA,eAAe,GAAG,IAAI;AAAEC,IAAAA;AAAQ,GAAA,GAAGJ,KAAK;EAC7D,MAAM;IAAEK,OAAO;IAAEC,UAAU;AAAEC,IAAAA;GAAU,GAAGC,aAAQ,EAAE;AACpD,EAAA,MAAMC,MAAM,GAAGC,YAAM,CAAC,KAAK,CAAC;AAC5B,EAAA,MAAMC,OAAO,GAAGD,YAAM,CAAiB,IAAI,CAAC;EAC5C,MAAM,CAACE,WAAW,EAAEC,cAAc,CAAC,GAAGC,cAAQ,CAAS,EAAE,CAAC;AAE1DC,EAAAA,eAAS,CAAC,MAAK;IACb,IAAIJ,OAAO,CAACK,OAAO,EAAE;MACnB,MAAMC,IAAI,GAAGN,OAAO,CAACK,OAAO,CAACE,qBAAqB,EAAE;AACpD,MAAA,MAAMC,IAAI,GAAGC,IAAI,CAACC,GAAG,CAACJ,IAAI,CAACK,KAAK,EAAEL,IAAI,CAACM,MAAM,CAAC;AAC9CV,MAAAA,cAAc,CAACM,IAAI,GAAG,EAAE,CAAC;AAC3B;GACD,EAAE,EAAE,CAAC;AAENJ,EAAAA,eAAS,CAAC,MAAK;IACb,IAAIN,MAAM,CAACO,OAAO,EAAE;IACpBP,MAAM,CAACO,OAAO,GAAG,IAAI;AACrB,IAAA,MAAMQ,SAAS,GAAG,YAAW;AAC3B,MAAA,IAAIpB,MAAM,EAAE;QACV,IAAI;UACF,MAAMA,MAAM,EAAE;SACf,CAAC,OAAOqB,KAAK,EAAE;AACdpB,UAAAA,OAAO,EAAE;AACT,UAAA,MAAM,IAAIqB,KAAK,CAAC,CAAGD,EAAAA,KAAK,EAAE,CAAC;AAC7B;AACA,QAAA,IAAItB,eAAe,EAAE;AACnBG,UAAAA,UAAU,EAAE;AACd;AACF;KACD;AACDkB,IAAAA,SAAS,EAAE;GACZ,EAAE,EAAE,CAAC;EAEN,OACEG;IACEC,SAAS,EAAEC,IAAI,CACb,wCAAwC,EACxCtB,QAAQ,GAAG,QAAQ,GAAG,MAAM,CAC7B;AAEDuB,IAAAA,QAAA,EAAAC,eAAA,CAAA,KAAA,EAAA;AAAKH,MAAAA,SAAS,EAAC,iDAAiD;AAAAE,MAAAA,QAAA,EAAA,CAC9DC;AAAKH,QAAAA,SAAS,EAAC,2CAA2C;AACxDE,QAAAA,QAAA,EAAA,CAAAH,cAAA,CAAA,KAAA,EAAA;AAAKK,UAAAA,GAAG,EAAErB,OAAO;AAAEiB,UAAAA,SAAS,EAAC,kCAAkC;oBAC5D1B;AAAI,SAAA,CACD,EACNyB,cAAA,CAACM,gBAAO,EAAA;AACNL,UAAAA,SAAS,EAAC,UAAU;AACpBM,UAAAA,KAAK,EAAE;AACLZ,YAAAA,KAAK,EAAEV,WAAW;AAClBW,YAAAA,MAAM,EAAEX;WACT;AACDuB,UAAAA,WAAW,EAAE;AACb,SAAA,CAAA;AAAA,OAAA,CACE,EACNR,cAAM,CAAA,MAAA,EAAA;AAAAC,QAAAA,SAAS,EAAC,uBAAuB;kBAAE3B;AAAK,OAAA,CAAQ;KAClD;AAAA,GAAA,CACF;AAEV;;;;"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { slicedToArray as _slicedToArray, asyncToGenerator as _asyncToGenerator, regeneratorRuntime as _regeneratorRuntime } from '../../_virtual/_rollupPluginBabelHelpers.mjs';
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
import { useRef, useState, useEffect } from 'react';
|
|
4
|
+
import { useModal } from '../../providers/modal/Hook.mjs';
|
|
5
|
+
import { Spinner } from '../design/Spinners.mjs';
|
|
6
|
+
import clsx from 'clsx';
|
|
7
|
+
|
|
8
|
+
function ActionPage(props) {
|
|
9
|
+
var title = props.title,
|
|
10
|
+
icon = props.icon,
|
|
11
|
+
_props$closeOnComplet = props.closeOnComplete,
|
|
12
|
+
closeOnComplete = _props$closeOnComplet === void 0 ? true : _props$closeOnComplet,
|
|
13
|
+
action = props.action;
|
|
14
|
+
var _useModal = useModal(),
|
|
15
|
+
popPage = _useModal.popPage,
|
|
16
|
+
closeModal = _useModal.closeModal,
|
|
17
|
+
isMobile = _useModal.isMobile;
|
|
18
|
+
var hasRun = useRef(false);
|
|
19
|
+
var iconRef = useRef(null);
|
|
20
|
+
var _useState = useState(40),
|
|
21
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
22
|
+
spinnerSize = _useState2[0],
|
|
23
|
+
setSpinnerSize = _useState2[1];
|
|
24
|
+
useEffect(function () {
|
|
25
|
+
if (iconRef.current) {
|
|
26
|
+
var rect = iconRef.current.getBoundingClientRect();
|
|
27
|
+
var size = Math.max(rect.width, rect.height);
|
|
28
|
+
setSpinnerSize(size + 50);
|
|
29
|
+
}
|
|
30
|
+
}, []);
|
|
31
|
+
useEffect(function () {
|
|
32
|
+
if (hasRun.current) return;
|
|
33
|
+
hasRun.current = true;
|
|
34
|
+
var runAction = /*#__PURE__*/function () {
|
|
35
|
+
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
36
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
37
|
+
while (1) switch (_context.prev = _context.next) {
|
|
38
|
+
case 0:
|
|
39
|
+
if (!action) {
|
|
40
|
+
_context.next = 11;
|
|
41
|
+
break;
|
|
42
|
+
}
|
|
43
|
+
_context.prev = 1;
|
|
44
|
+
_context.next = 4;
|
|
45
|
+
return action();
|
|
46
|
+
case 4:
|
|
47
|
+
_context.next = 10;
|
|
48
|
+
break;
|
|
49
|
+
case 6:
|
|
50
|
+
_context.prev = 6;
|
|
51
|
+
_context.t0 = _context["catch"](1);
|
|
52
|
+
popPage();
|
|
53
|
+
throw new Error("".concat(_context.t0));
|
|
54
|
+
case 10:
|
|
55
|
+
if (closeOnComplete) {
|
|
56
|
+
closeModal();
|
|
57
|
+
}
|
|
58
|
+
case 11:
|
|
59
|
+
case "end":
|
|
60
|
+
return _context.stop();
|
|
61
|
+
}
|
|
62
|
+
}, _callee, null, [[1, 6]]);
|
|
63
|
+
}));
|
|
64
|
+
return function runAction() {
|
|
65
|
+
return _ref.apply(this, arguments);
|
|
66
|
+
};
|
|
67
|
+
}();
|
|
68
|
+
runAction();
|
|
69
|
+
}, []);
|
|
70
|
+
return jsx("div", {
|
|
71
|
+
className: clsx("flex items-center justify-center py-10", isMobile ? "w-full" : "w-96"),
|
|
72
|
+
children: jsxs("div", {
|
|
73
|
+
className: "flex flex-col items-center justify-center gap-8",
|
|
74
|
+
children: [jsxs("div", {
|
|
75
|
+
className: "relative flex items-center justify-center",
|
|
76
|
+
children: [jsx("div", {
|
|
77
|
+
ref: iconRef,
|
|
78
|
+
className: "flex items-center justify-center",
|
|
79
|
+
children: icon
|
|
80
|
+
}), jsx(Spinner, {
|
|
81
|
+
className: "absolute",
|
|
82
|
+
style: {
|
|
83
|
+
width: spinnerSize,
|
|
84
|
+
height: spinnerSize
|
|
85
|
+
},
|
|
86
|
+
strokeWidth: 1
|
|
87
|
+
})]
|
|
88
|
+
}), jsx("span", {
|
|
89
|
+
className: "text-lg font-semibold",
|
|
90
|
+
children: title
|
|
91
|
+
})]
|
|
92
|
+
})
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export { ActionPage };
|
|
97
|
+
//# sourceMappingURL=Action.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Action.mjs","sources":["../../../src/components/auth/Action.tsx"],"sourcesContent":[null],"names":["ActionPage","props","title","icon","_props$closeOnComplet","closeOnComplete","action","_useModal","useModal","popPage","closeModal","isMobile","hasRun","useRef","iconRef","_useState","useState","_useState2","_slicedToArray","spinnerSize","setSpinnerSize","useEffect","current","rect","getBoundingClientRect","size","Math","max","width","height","runAction","_ref","_asyncToGenerator","_regeneratorRuntime","mark","_callee","wrap","_callee$","_context","prev","next","t0","Error","concat","stop","apply","arguments","_jsx","className","clsx","children","_jsxs","ref","Spinner","style","strokeWidth"],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Email.d.ts","sourceRoot":"","sources":["../../../src/components/auth/Email.tsx"],"names":[],"mappings":"AAWA,UAAU,eAAe;IACvB,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACtC;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,2CAiFhD"}
|