@prohetamine/redstone 0.0.1
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/dist/PhArrowCircleDown-BR-zH4LC.js +14 -0
- package/dist/PhArrowCircleDown-Sb38khBy.mjs +73 -0
- package/dist/PhArrowClockwise-BE5j9P0Z.mjs +73 -0
- package/dist/PhArrowClockwise-BRaehQGe.js +14 -0
- package/dist/PhArrowDown-B_WmmmY9.js +14 -0
- package/dist/PhArrowDown-CFEyR2dR.mjs +73 -0
- package/dist/PhArrowLeft-CYfU7NZj.mjs +73 -0
- package/dist/PhArrowLeft-CkEd70hm.js +14 -0
- package/dist/PhArrowRight-C07Qkx86.js +14 -0
- package/dist/PhArrowRight-EermNu0V.mjs +73 -0
- package/dist/PhArrowSquareOut-BjTBfzOP.js +14 -0
- package/dist/PhArrowSquareOut-DZwTtw54.mjs +73 -0
- package/dist/PhArrowUp-DB4CCSss.js +14 -0
- package/dist/PhArrowUp-xTpLFQkg.mjs +73 -0
- package/dist/PhArrowUpRight-CQbvn6NO.mjs +73 -0
- package/dist/PhArrowUpRight-GpCIMsAh.js +14 -0
- package/dist/PhArrowsClockwise-BgcIUg-Z.js +14 -0
- package/dist/PhArrowsClockwise-DnUYZTVx.mjs +73 -0
- package/dist/PhArrowsDownUp-C8KXUqtu.js +14 -0
- package/dist/PhArrowsDownUp-DgoprEe2.mjs +73 -0
- package/dist/PhArrowsLeftRight-CahChzCj.js +14 -0
- package/dist/PhArrowsLeftRight-FD4AZiLh.mjs +73 -0
- package/dist/PhBank-DIqIL4x_.js +14 -0
- package/dist/PhBank-DbQOQ9zJ.mjs +73 -0
- package/dist/PhBrowser-BCBXK2IM.mjs +73 -0
- package/dist/PhBrowser-laCKtn7T.js +14 -0
- package/dist/PhCaretDown-CnjP-QjZ.mjs +73 -0
- package/dist/PhCaretDown-DDe42xDU.js +14 -0
- package/dist/PhCaretLeft-Cskc5OY9.js +14 -0
- package/dist/PhCaretLeft-DkuXxjf_.mjs +73 -0
- package/dist/PhCaretRight-CBWpghxt.mjs +73 -0
- package/dist/PhCaretRight-DNgI5w_B.js +14 -0
- package/dist/PhCaretUp-CQ-OztBV.mjs +73 -0
- package/dist/PhCaretUp-CUZ4g_Me.js +14 -0
- package/dist/PhCheck-BVV_Dwfo.js +14 -0
- package/dist/PhCheck-t515emYS.mjs +73 -0
- package/dist/PhCircleHalf-BuQTmrKW.mjs +73 -0
- package/dist/PhCircleHalf-DDC7rige.js +14 -0
- package/dist/PhClock-BqynEKWl.js +14 -0
- package/dist/PhClock-D6XkTmM_.mjs +73 -0
- package/dist/PhCompass-2QeeX5Ad.mjs +73 -0
- package/dist/PhCompass-BsuJwXAE.js +14 -0
- package/dist/PhCopy-CO34-_xD.mjs +73 -0
- package/dist/PhCopy-MVqtRS6X.js +14 -0
- package/dist/PhCreditCard-Dq4kdjCw.js +14 -0
- package/dist/PhCreditCard-bfnqYflD.mjs +73 -0
- package/dist/PhCurrencyDollar-6k8UWxal.js +14 -0
- package/dist/PhCurrencyDollar-BekVYPtC.mjs +73 -0
- package/dist/PhDesktop-BkNzf3rT.mjs +73 -0
- package/dist/PhDesktop-CfsXQ0vC.js +14 -0
- package/dist/PhDeviceMobile-BT3Mg_b0.mjs +73 -0
- package/dist/PhDeviceMobile-BnrrDrwf.js +14 -0
- package/dist/PhDotsThree-6LRvhAcL.js +14 -0
- package/dist/PhDotsThree-kpf2OKxJ.mjs +73 -0
- package/dist/PhEnvelope-CHsfC2e0.js +14 -0
- package/dist/PhEnvelope-UFKpKtwf.mjs +73 -0
- package/dist/PhFunnelSimple-CdAqSIhK.mjs +73 -0
- package/dist/PhFunnelSimple-JAk7X9Wo.js +14 -0
- package/dist/PhGlobe-B3RYXl8h.mjs +73 -0
- package/dist/PhGlobe-Tfs4MfpG.js +14 -0
- package/dist/PhIdentificationCard-Dqmd6eY1.js +14 -0
- package/dist/PhIdentificationCard-rSq59Czm.mjs +73 -0
- package/dist/PhImage-aEryzfCi.js +14 -0
- package/dist/PhImage-ynsEnFd_.mjs +73 -0
- package/dist/PhInfo-B7lsWl6m.mjs +73 -0
- package/dist/PhInfo-D6oUrWpA.js +14 -0
- package/dist/PhLightbulb-FQDaMMqu.mjs +73 -0
- package/dist/PhLightbulb-qbEduhPa.js +14 -0
- package/dist/PhMagnifyingGlass-COdRH2k5.js +14 -0
- package/dist/PhMagnifyingGlass-_NXk13-0.mjs +73 -0
- package/dist/PhPaperPlaneRight-BYi7SorW.mjs +73 -0
- package/dist/PhPaperPlaneRight-DrpVAQOZ.js +14 -0
- package/dist/PhPlus-25KQTPHG.mjs +73 -0
- package/dist/PhPlus-BhUXef08.js +14 -0
- package/dist/PhPower-BKl7gzsB.mjs +73 -0
- package/dist/PhPower-BNJf1AGQ.js +14 -0
- package/dist/PhPuzzlePiece-BkZeF8CX.js +14 -0
- package/dist/PhPuzzlePiece-BqUI4GRs.mjs +73 -0
- package/dist/PhQrCode-C-tqZKPP.mjs +73 -0
- package/dist/PhQrCode-C0v0iXQN.js +14 -0
- package/dist/PhQuestion-BBAiRWgt.js +14 -0
- package/dist/PhQuestion-CtYvffyD.mjs +73 -0
- package/dist/PhQuestionMark-BNbtL2yx.mjs +73 -0
- package/dist/PhQuestionMark-BvGUBZ1h.js +14 -0
- package/dist/PhSealCheck-B0TEqWpq.mjs +73 -0
- package/dist/PhSealCheck-BwNkuF7G.js +14 -0
- package/dist/PhSignOut-C1rMSNaS.js +14 -0
- package/dist/PhSignOut-HX2_BVsD.mjs +73 -0
- package/dist/PhSpinner-CoDYLYOX.mjs +73 -0
- package/dist/PhSpinner-nmsGWDQl.js +14 -0
- package/dist/PhTrash-CALlKx3e.js +14 -0
- package/dist/PhTrash-DeQHS8ZP.mjs +73 -0
- package/dist/PhUser-CA0e5OPI.js +14 -0
- package/dist/PhUser-Cy5EY3vX.mjs +73 -0
- package/dist/PhVault-DdXjVOO9.mjs +73 -0
- package/dist/PhVault-DqxV75cz.js +14 -0
- package/dist/PhWallet-CeQrfGYc.mjs +73 -0
- package/dist/PhWallet-CyCuEs2U.js +14 -0
- package/dist/PhWarning-BKaHv_wT.mjs +73 -0
- package/dist/PhWarning-C7oj86bY.js +14 -0
- package/dist/PhWarningCircle-8MWw-QgE.mjs +73 -0
- package/dist/PhWarningCircle-CrNPXGj4.js +14 -0
- package/dist/PhX-9lsrXjyl.js +14 -0
- package/dist/PhX-DgXr_Fb0.mjs +73 -0
- package/dist/ReownAuthentication-Bfv31LzI.mjs +274 -0
- package/dist/ReownAuthentication-d8aYgGOq.js +5 -0
- package/dist/SwapController-4lzoYsYr.js +1 -0
- package/dist/SwapController-DjzUWRyQ.mjs +462 -0
- package/dist/ccip-CvwbEhki.js +1 -0
- package/dist/ccip-TuO68NeE.mjs +150 -0
- package/dist/data-capture-BwdjH2vc.mjs +489 -0
- package/dist/data-capture-xVUNZJ2T.js +242 -0
- package/dist/email-BCZObJCY.js +90 -0
- package/dist/email-m-wo60fN.mjs +338 -0
- package/dist/embedded-wallet-CGSri-4g.js +410 -0
- package/dist/embedded-wallet-DdZmv5qP.mjs +808 -0
- package/dist/features-BJ8kNaE8.js +1 -0
- package/dist/features-CJ34oImB.mjs +6 -0
- package/dist/index-4lfXeo30.js +132 -0
- package/dist/index-B6Mg114Z.mjs +69182 -0
- package/dist/index-BX7gAgT3.mjs +35 -0
- package/dist/index-BYQqNbCe.js +1 -0
- package/dist/index-BmdHwtJo.js +1 -0
- package/dist/index-BvUx3ULC.js +78 -0
- package/dist/index-CD-QGO70.mjs +196 -0
- package/dist/index-CJtXfdoM.mjs +29621 -0
- package/dist/index-CMzdgE-y.mjs +215 -0
- package/dist/index-CjZQCcwG.js +7203 -0
- package/dist/index-D7VuOaCI.js +19 -0
- package/dist/index-DV7SQwgn.mjs +2688 -0
- package/dist/index-DVf4BnNh.mjs +352 -0
- package/dist/index-DhN9vL4k.js +138 -0
- package/dist/index-DvllakY0.mjs +274 -0
- package/dist/index-Ho06VKh2.mjs +151 -0
- package/dist/index-a8mS2Eh1.js +1062 -0
- package/dist/index-aamBi9Tu.js +1 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.es.js +14 -0
- package/dist/onramp-DLlhSPQg.js +422 -0
- package/dist/onramp-k-EAEepC.mjs +842 -0
- package/dist/parseSignature-D1tZHglo.js +16 -0
- package/dist/parseSignature-DM0lwcDr.mjs +8883 -0
- package/dist/pay-with-exchange---G2M1Ag.js +280 -0
- package/dist/pay-with-exchange-CFIcUXUe.mjs +512 -0
- package/dist/property-Bd8U3_QP.mjs +618 -0
- package/dist/property-DissjCbZ.js +27 -0
- package/dist/receive-B9LCljO6.mjs +228 -0
- package/dist/receive-E8H6GDOX.js +131 -0
- package/dist/send-B-AooLph.js +554 -0
- package/dist/send-DZd_xhsd.mjs +1155 -0
- package/dist/socials-ChWFLEFe.mjs +611 -0
- package/dist/socials-YSUYSh8o.js +250 -0
- package/dist/swaps-DpR9W9Ld.js +1050 -0
- package/dist/swaps-Du7-Ui_V.mjs +1752 -0
- package/dist/transactions-DhsK5-QJ.mjs +35 -0
- package/dist/transactions-VPsz2OLe.js +16 -0
- package/dist/w3m-modal-DhomfjKU.js +891 -0
- package/dist/w3m-modal-KuYD-zqQ.mjs +1759 -0
- package/package.json +51 -0
- package/readme.md +1 -0
|
@@ -0,0 +1,489 @@
|
|
|
1
|
+
import { c0 as y, bW as $, bX as l, bU as S, bV as x, cy as m, c3 as p, ca as f, c4 as h, cv as u, b$ as _, cp as E, cn as R } from "./index-B6Mg114Z.mjs";
|
|
2
|
+
import { W as C } from "./index-DVf4BnNh.mjs";
|
|
3
|
+
import { R as v } from "./ReownAuthentication-Bfv31LzI.mjs";
|
|
4
|
+
const D = y`
|
|
5
|
+
.email-sufixes {
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: row;
|
|
8
|
+
gap: var(--wui-spacing-3xs);
|
|
9
|
+
overflow-x: auto;
|
|
10
|
+
max-width: 100%;
|
|
11
|
+
margin-top: var(--wui-spacing-s);
|
|
12
|
+
margin-bottom: calc(-1 * var(--wui-spacing-m));
|
|
13
|
+
padding-bottom: var(--wui-spacing-m);
|
|
14
|
+
margin-left: calc(-1 * var(--wui-spacing-m));
|
|
15
|
+
margin-right: calc(-1 * var(--wui-spacing-m));
|
|
16
|
+
padding-left: var(--wui-spacing-m);
|
|
17
|
+
padding-right: var(--wui-spacing-m);
|
|
18
|
+
|
|
19
|
+
&::-webkit-scrollbar {
|
|
20
|
+
display: none;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
`;
|
|
24
|
+
var O = function(o, t, i, a) {
|
|
25
|
+
var n = arguments.length, e = n < 3 ? t : a === null ? a = Object.getOwnPropertyDescriptor(t, i) : a, r;
|
|
26
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") e = Reflect.decorate(o, t, i, a);
|
|
27
|
+
else for (var s = o.length - 1; s >= 0; s--) (r = o[s]) && (e = (n < 3 ? r(e) : n > 3 ? r(t, i, e) : r(t, i)) || e);
|
|
28
|
+
return n > 3 && e && Object.defineProperty(t, i, e), e;
|
|
29
|
+
};
|
|
30
|
+
const I = [
|
|
31
|
+
"@gmail.com",
|
|
32
|
+
"@outlook.com",
|
|
33
|
+
"@yahoo.com",
|
|
34
|
+
"@hotmail.com",
|
|
35
|
+
"@aol.com",
|
|
36
|
+
"@icloud.com",
|
|
37
|
+
"@zoho.com"
|
|
38
|
+
];
|
|
39
|
+
let g = class extends $ {
|
|
40
|
+
constructor() {
|
|
41
|
+
super(...arguments), this.email = "";
|
|
42
|
+
}
|
|
43
|
+
render() {
|
|
44
|
+
const t = I.filter(this.filter.bind(this)).map(this.item.bind(this));
|
|
45
|
+
return t.length === 0 ? null : l`<div class="email-sufixes">${t}</div>`;
|
|
46
|
+
}
|
|
47
|
+
filter(t) {
|
|
48
|
+
if (!this.email)
|
|
49
|
+
return !1;
|
|
50
|
+
const i = this.email.split("@");
|
|
51
|
+
if (i.length < 2)
|
|
52
|
+
return !0;
|
|
53
|
+
const a = i.pop();
|
|
54
|
+
return t.includes(a) && t !== `@${a}`;
|
|
55
|
+
}
|
|
56
|
+
item(t) {
|
|
57
|
+
return l`<wui-button variant="neutral" size="sm" @click=${() => {
|
|
58
|
+
const a = this.email.split("@");
|
|
59
|
+
a.length > 1 && a.pop();
|
|
60
|
+
const n = a[0] + t;
|
|
61
|
+
this.dispatchEvent(new CustomEvent("change", {
|
|
62
|
+
detail: n,
|
|
63
|
+
bubbles: !0,
|
|
64
|
+
composed: !0
|
|
65
|
+
}));
|
|
66
|
+
}}
|
|
67
|
+
>${t}</wui-button
|
|
68
|
+
>`;
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
g.styles = [D];
|
|
72
|
+
O([
|
|
73
|
+
S()
|
|
74
|
+
], g.prototype, "email", void 0);
|
|
75
|
+
g = O([
|
|
76
|
+
x("w3m-email-suffixes-widget")
|
|
77
|
+
], g);
|
|
78
|
+
const j = y`
|
|
79
|
+
.recent-emails {
|
|
80
|
+
display: flex;
|
|
81
|
+
flex-direction: column;
|
|
82
|
+
padding: var(--wui-spacing-s) 0;
|
|
83
|
+
border-top: 1px solid var(--wui-color-gray-glass-005);
|
|
84
|
+
border-bottom: 1px solid var(--wui-color-gray-glass-005);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.recent-emails-heading {
|
|
88
|
+
margin-bottom: var(--wui-spacing-s);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.recent-emails-list-item {
|
|
92
|
+
--wui-color-gray-glass-002: transparent;
|
|
93
|
+
}
|
|
94
|
+
`;
|
|
95
|
+
var W = function(o, t, i, a) {
|
|
96
|
+
var n = arguments.length, e = n < 3 ? t : a === null ? a = Object.getOwnPropertyDescriptor(t, i) : a, r;
|
|
97
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") e = Reflect.decorate(o, t, i, a);
|
|
98
|
+
else for (var s = o.length - 1; s >= 0; s--) (r = o[s]) && (e = (n < 3 ? r(e) : n > 3 ? r(t, i, e) : r(t, i)) || e);
|
|
99
|
+
return n > 3 && e && Object.defineProperty(t, i, e), e;
|
|
100
|
+
};
|
|
101
|
+
let w = class extends $ {
|
|
102
|
+
constructor() {
|
|
103
|
+
super(...arguments), this.emails = [];
|
|
104
|
+
}
|
|
105
|
+
render() {
|
|
106
|
+
return this.emails.length === 0 ? null : l`<div class="recent-emails">
|
|
107
|
+
<wui-text variant="micro-600" color="fg-200" class="recent-emails-heading"
|
|
108
|
+
>Recently used emails</wui-text
|
|
109
|
+
>
|
|
110
|
+
${this.emails.map(this.item.bind(this))}
|
|
111
|
+
</div>`;
|
|
112
|
+
}
|
|
113
|
+
item(t) {
|
|
114
|
+
return l`<wui-list-item
|
|
115
|
+
@click=${() => {
|
|
116
|
+
this.dispatchEvent(new CustomEvent("select", {
|
|
117
|
+
detail: t,
|
|
118
|
+
bubbles: !0,
|
|
119
|
+
composed: !0
|
|
120
|
+
}));
|
|
121
|
+
}}
|
|
122
|
+
?chevron=${!0}
|
|
123
|
+
icon="mail"
|
|
124
|
+
iconVariant="overlay"
|
|
125
|
+
class="recent-emails-list-item"
|
|
126
|
+
>
|
|
127
|
+
<wui-text variant="paragraph-500" color="fg-100">${t}</wui-text>
|
|
128
|
+
</wui-list-item>`;
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
w.styles = [j];
|
|
132
|
+
W([
|
|
133
|
+
S()
|
|
134
|
+
], w.prototype, "emails", void 0);
|
|
135
|
+
w = W([
|
|
136
|
+
x("w3m-recent-emails-widget")
|
|
137
|
+
], w);
|
|
138
|
+
var A = function(o, t, i, a) {
|
|
139
|
+
var n = arguments.length, e = n < 3 ? t : a === null ? a = Object.getOwnPropertyDescriptor(t, i) : a, r;
|
|
140
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") e = Reflect.decorate(o, t, i, a);
|
|
141
|
+
else for (var s = o.length - 1; s >= 0; s--) (r = o[s]) && (e = (n < 3 ? r(e) : n > 3 ? r(t, i, e) : r(t, i)) || e);
|
|
142
|
+
return n > 3 && e && Object.defineProperty(t, i, e), e;
|
|
143
|
+
};
|
|
144
|
+
let b = class extends C {
|
|
145
|
+
constructor() {
|
|
146
|
+
super(...arguments), this.siwx = m.state.siwx, this.onOtpSubmit = async (t) => {
|
|
147
|
+
await this.siwx.confirmEmailOtp({ code: t }), p.replace("SIWXSignMessage");
|
|
148
|
+
}, this.onOtpResend = async (t) => {
|
|
149
|
+
const i = f.getAccountData();
|
|
150
|
+
if (!(i != null && i.caipAddress))
|
|
151
|
+
throw new Error("No account data found");
|
|
152
|
+
await this.siwx.requestEmailOtp({
|
|
153
|
+
email: t,
|
|
154
|
+
account: i.caipAddress
|
|
155
|
+
});
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
connectedCallback() {
|
|
159
|
+
(!this.siwx || !(this.siwx instanceof v)) && h.showError("ReownAuthentication is not initialized."), super.connectedCallback();
|
|
160
|
+
}
|
|
161
|
+
shouldSubmitOnOtpChange() {
|
|
162
|
+
return this.otp.length === C.OTP_LENGTH;
|
|
163
|
+
}
|
|
164
|
+
};
|
|
165
|
+
A([
|
|
166
|
+
u()
|
|
167
|
+
], b.prototype, "siwx", void 0);
|
|
168
|
+
b = A([
|
|
169
|
+
x("w3m-data-capture-otp-confirm-view")
|
|
170
|
+
], b);
|
|
171
|
+
const P = y`
|
|
172
|
+
.hero {
|
|
173
|
+
display: flex;
|
|
174
|
+
flex-direction: column;
|
|
175
|
+
align-items: center;
|
|
176
|
+
justify-content: center;
|
|
177
|
+
gap: var(--wui-spacing-3xs);
|
|
178
|
+
|
|
179
|
+
transition-property: margin, height;
|
|
180
|
+
transition-duration: var(--wui-duration-md);
|
|
181
|
+
transition-timing-function: var(--wui-ease-out-power-1);
|
|
182
|
+
margin-top: -100px;
|
|
183
|
+
|
|
184
|
+
&[data-state='loading'] {
|
|
185
|
+
margin-top: 0px;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
position: relative;
|
|
189
|
+
&:after {
|
|
190
|
+
content: '';
|
|
191
|
+
position: absolute;
|
|
192
|
+
bottom: 0;
|
|
193
|
+
height: 252px;
|
|
194
|
+
width: 360px;
|
|
195
|
+
background: radial-gradient(
|
|
196
|
+
96.11% 53.95% at 50% 51.28%,
|
|
197
|
+
transparent 0%,
|
|
198
|
+
color-mix(in srgb, var(--wui-color-bg-100) 5%, transparent) 49%,
|
|
199
|
+
color-mix(in srgb, var(--wui-color-bg-100) 65%, transparent) 99.43%
|
|
200
|
+
);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.hero-main-icon {
|
|
205
|
+
width: 176px;
|
|
206
|
+
transition-property: background-color;
|
|
207
|
+
transition-duration: var(--wui-duration-lg);
|
|
208
|
+
transition-timing-function: var(--wui-ease-out-power-1);
|
|
209
|
+
|
|
210
|
+
&[data-state='loading'] {
|
|
211
|
+
width: 56px;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.hero-row {
|
|
216
|
+
display: flex;
|
|
217
|
+
flex-direction: row;
|
|
218
|
+
align-items: center;
|
|
219
|
+
justify-content: center;
|
|
220
|
+
gap: var(--wui-spacing-3xs);
|
|
221
|
+
flex-wrap: nowrap;
|
|
222
|
+
min-width: fit-content;
|
|
223
|
+
|
|
224
|
+
&:nth-child(1) {
|
|
225
|
+
transform: translateX(-30px);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
&:nth-child(2) {
|
|
229
|
+
transform: translateX(30px);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
&:nth-child(4) {
|
|
233
|
+
transform: translateX(40px);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
transition-property: height;
|
|
237
|
+
transition-duration: var(--wui-duration-md);
|
|
238
|
+
transition-timing-function: var(--wui-ease-out-power-1);
|
|
239
|
+
height: 68px;
|
|
240
|
+
|
|
241
|
+
&[data-state='loading'] {
|
|
242
|
+
height: 0px;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.hero-row-icon {
|
|
247
|
+
opacity: 0.1;
|
|
248
|
+
transition-property: opacity;
|
|
249
|
+
transition-duration: var(--wui-duration-md);
|
|
250
|
+
transition-timing-function: var(--wui-ease-out-power-1);
|
|
251
|
+
|
|
252
|
+
&[data-state='loading'] {
|
|
253
|
+
opacity: 0;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
`;
|
|
257
|
+
var d = function(o, t, i, a) {
|
|
258
|
+
var n = arguments.length, e = n < 3 ? t : a === null ? a = Object.getOwnPropertyDescriptor(t, i) : a, r;
|
|
259
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") e = Reflect.decorate(o, t, i, a);
|
|
260
|
+
else for (var s = o.length - 1; s >= 0; s--) (r = o[s]) && (e = (n < 3 ? r(e) : n > 3 ? r(t, i, e) : r(t, i)) || e);
|
|
261
|
+
return n > 3 && e && Object.defineProperty(t, i, e), e;
|
|
262
|
+
};
|
|
263
|
+
let c = class extends $ {
|
|
264
|
+
constructor() {
|
|
265
|
+
var t, i, a, n, e, r, s;
|
|
266
|
+
super(...arguments), this.email = ((t = p.state.data) == null ? void 0 : t.email) ?? ((a = (i = f.getAccountData()) == null ? void 0 : i.user) == null ? void 0 : a.email) ?? "", this.address = ((n = f.getAccountData()) == null ? void 0 : n.address) ?? "", this.loading = !1, this.appName = ((e = m.state.metadata) == null ? void 0 : e.name) ?? "AppKit", this.siwx = m.state.siwx, this.isRequired = Array.isArray((r = m.state.remoteFeatures) == null ? void 0 : r.emailCapture) && ((s = m.state.remoteFeatures) == null ? void 0 : s.emailCapture.includes("required")), this.recentEmails = this.getRecentEmails();
|
|
267
|
+
}
|
|
268
|
+
connectedCallback() {
|
|
269
|
+
(!this.siwx || !(this.siwx instanceof v)) && h.showError("ReownAuthentication is not initialized. Please contact support."), super.connectedCallback();
|
|
270
|
+
}
|
|
271
|
+
firstUpdated() {
|
|
272
|
+
this.loading = !1, this.recentEmails = this.getRecentEmails(), this.email && this.onSubmit();
|
|
273
|
+
}
|
|
274
|
+
render() {
|
|
275
|
+
return l`
|
|
276
|
+
<wui-flex flexDirection="column" .padding=${["3xs", "m", "m", "m"]} gap="l">
|
|
277
|
+
${this.hero()} ${this.paragraph()} ${this.emailInput()} ${this.recentEmailsWidget()}
|
|
278
|
+
${this.footerActions()}
|
|
279
|
+
</wui-flex>
|
|
280
|
+
`;
|
|
281
|
+
}
|
|
282
|
+
hero() {
|
|
283
|
+
return l`
|
|
284
|
+
<div class="hero" data-state=${this.loading ? "loading" : "default"}>
|
|
285
|
+
${this.heroRow(["id", "mail", "wallet", "x", "solana", "qrCode"])}
|
|
286
|
+
${this.heroRow(["mail", "farcaster", "wallet", "discord", "mobile", "qrCode"])}
|
|
287
|
+
<div class="hero-row">
|
|
288
|
+
${this.heroIcon("github")} ${this.heroIcon("bank")}
|
|
289
|
+
<wui-icon-box
|
|
290
|
+
size="xl"
|
|
291
|
+
iconSize="xxl"
|
|
292
|
+
iconColor=${this.loading ? "fg-100" : "accent-100"}
|
|
293
|
+
backgroundColor=${this.loading ? "fg-100" : "accent-100"}
|
|
294
|
+
icon=${this.loading ? "id" : "user"}
|
|
295
|
+
isOpaque
|
|
296
|
+
class="hero-main-icon"
|
|
297
|
+
data-state=${this.loading ? "loading" : "default"}
|
|
298
|
+
>
|
|
299
|
+
</wui-icon-box>
|
|
300
|
+
${this.heroIcon("id")} ${this.heroIcon("card")}
|
|
301
|
+
</div>
|
|
302
|
+
${this.heroRow(["google", "id", "github", "verify", "apple", "mobile"])}
|
|
303
|
+
</div>
|
|
304
|
+
`;
|
|
305
|
+
}
|
|
306
|
+
heroRow(t) {
|
|
307
|
+
return l`
|
|
308
|
+
<div class="hero-row" data-state=${this.loading ? "loading" : "default"}>
|
|
309
|
+
${t.map(this.heroIcon.bind(this))}
|
|
310
|
+
</div>
|
|
311
|
+
`;
|
|
312
|
+
}
|
|
313
|
+
heroIcon(t) {
|
|
314
|
+
return l`
|
|
315
|
+
<wui-icon-box
|
|
316
|
+
size="xl"
|
|
317
|
+
iconSize="xxl"
|
|
318
|
+
iconColor="fg-100"
|
|
319
|
+
backgroundColor="fg-100"
|
|
320
|
+
icon=${t}
|
|
321
|
+
data-state=${this.loading ? "loading" : "default"}
|
|
322
|
+
isOpaque
|
|
323
|
+
class="hero-row-icon"
|
|
324
|
+
>
|
|
325
|
+
</wui-icon-box>
|
|
326
|
+
`;
|
|
327
|
+
}
|
|
328
|
+
paragraph() {
|
|
329
|
+
return this.loading ? l`
|
|
330
|
+
<wui-text variant="paragraph-400" color="fg-200" align="center"
|
|
331
|
+
>We are verifying your account with email
|
|
332
|
+
<wui-text variant="paragraph-600" color="accent-100">${this.email}</wui-text> and address
|
|
333
|
+
<wui-text variant="paragraph-600" color="fg-100">
|
|
334
|
+
${_.getTruncateString({
|
|
335
|
+
string: this.address,
|
|
336
|
+
charsEnd: 4,
|
|
337
|
+
charsStart: 4,
|
|
338
|
+
truncate: "middle"
|
|
339
|
+
})} </wui-text
|
|
340
|
+
>, please wait a moment.</wui-text
|
|
341
|
+
>
|
|
342
|
+
` : this.isRequired ? l`
|
|
343
|
+
<wui-text variant="paragraph-600" color="fg-100" align="center">
|
|
344
|
+
${this.appName} requires your email for authentication.
|
|
345
|
+
</wui-text>
|
|
346
|
+
` : l`
|
|
347
|
+
<wui-flex flexDirection="column" gap="xs" alignItems="center">
|
|
348
|
+
<wui-text variant="paragraph-600" color="fg-100" align="center" size>
|
|
349
|
+
${this.appName} would like to collect your email.
|
|
350
|
+
</wui-text>
|
|
351
|
+
|
|
352
|
+
<wui-text variant="small-400" color="fg-200" align="center">
|
|
353
|
+
Don't worry, it's optional—you can skip this step.
|
|
354
|
+
</wui-text>
|
|
355
|
+
</wui-flex>
|
|
356
|
+
`;
|
|
357
|
+
}
|
|
358
|
+
emailInput() {
|
|
359
|
+
if (this.loading)
|
|
360
|
+
return null;
|
|
361
|
+
const t = (a) => {
|
|
362
|
+
a.key === "Enter" && this.onSubmit();
|
|
363
|
+
}, i = (a) => {
|
|
364
|
+
this.email = a.detail;
|
|
365
|
+
};
|
|
366
|
+
return l`
|
|
367
|
+
<wui-flex flexDirection="column">
|
|
368
|
+
<wui-email-input
|
|
369
|
+
.value=${this.email}
|
|
370
|
+
.disabled=${this.loading}
|
|
371
|
+
@inputChange=${i}
|
|
372
|
+
@keydown=${t}
|
|
373
|
+
></wui-email-input>
|
|
374
|
+
|
|
375
|
+
<w3m-email-suffixes-widget
|
|
376
|
+
.email=${this.email}
|
|
377
|
+
@change=${i}
|
|
378
|
+
></w3m-email-suffixes-widget>
|
|
379
|
+
</wui-flex>
|
|
380
|
+
`;
|
|
381
|
+
}
|
|
382
|
+
recentEmailsWidget() {
|
|
383
|
+
if (this.recentEmails.length === 0 || this.loading)
|
|
384
|
+
return null;
|
|
385
|
+
const t = (i) => {
|
|
386
|
+
this.email = i.detail, this.onSubmit();
|
|
387
|
+
};
|
|
388
|
+
return l`
|
|
389
|
+
<w3m-recent-emails-widget
|
|
390
|
+
.emails=${this.recentEmails}
|
|
391
|
+
@select=${t}
|
|
392
|
+
></w3m-recent-emails-widget>
|
|
393
|
+
`;
|
|
394
|
+
}
|
|
395
|
+
footerActions() {
|
|
396
|
+
return l`
|
|
397
|
+
<wui-flex flexDirection="row" fullWidth gap="s">
|
|
398
|
+
${this.isRequired ? null : l`<wui-button
|
|
399
|
+
size="lg"
|
|
400
|
+
variant="neutral"
|
|
401
|
+
fullWidth
|
|
402
|
+
.disabled=${this.loading}
|
|
403
|
+
@click=${this.onSkip.bind(this)}
|
|
404
|
+
>Skip this step</wui-button
|
|
405
|
+
>`}
|
|
406
|
+
|
|
407
|
+
<wui-button
|
|
408
|
+
size="lg"
|
|
409
|
+
variant="main"
|
|
410
|
+
type="submit"
|
|
411
|
+
fullWidth
|
|
412
|
+
.disabled=${!this.email || !this.isValidEmail(this.email)}
|
|
413
|
+
.loading=${this.loading}
|
|
414
|
+
@click=${this.onSubmit.bind(this)}
|
|
415
|
+
>
|
|
416
|
+
Continue
|
|
417
|
+
</wui-button>
|
|
418
|
+
</wui-flex>
|
|
419
|
+
`;
|
|
420
|
+
}
|
|
421
|
+
async onSubmit() {
|
|
422
|
+
if (!(this.siwx instanceof v)) {
|
|
423
|
+
h.showError("ReownAuthentication is not initialized. Please contact support.");
|
|
424
|
+
return;
|
|
425
|
+
}
|
|
426
|
+
const t = f.getActiveCaipAddress();
|
|
427
|
+
if (!t)
|
|
428
|
+
throw new Error("Account is not connected.");
|
|
429
|
+
if (!this.isValidEmail(this.email)) {
|
|
430
|
+
h.showError("Please provide a valid email.");
|
|
431
|
+
return;
|
|
432
|
+
}
|
|
433
|
+
try {
|
|
434
|
+
this.loading = !0;
|
|
435
|
+
const i = await this.siwx.requestEmailOtp({
|
|
436
|
+
email: this.email,
|
|
437
|
+
account: t
|
|
438
|
+
});
|
|
439
|
+
this.pushRecentEmail(this.email), i.uuid === null ? p.replace("SIWXSignMessage") : p.replace("DataCaptureOtpConfirm", { email: this.email });
|
|
440
|
+
} catch {
|
|
441
|
+
h.showError("Failed to send email OTP"), this.loading = !1;
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
onSkip() {
|
|
445
|
+
p.replace("SIWXSignMessage");
|
|
446
|
+
}
|
|
447
|
+
getRecentEmails() {
|
|
448
|
+
const t = E.getItem(R.RECENT_EMAILS);
|
|
449
|
+
return (t ? t.split(",") : []).filter(this.isValidEmail.bind(this)).slice(0, 3);
|
|
450
|
+
}
|
|
451
|
+
pushRecentEmail(t) {
|
|
452
|
+
const i = this.getRecentEmails(), a = Array.from(/* @__PURE__ */ new Set([t, ...i])).slice(0, 3);
|
|
453
|
+
E.setItem(R.RECENT_EMAILS, a.join(","));
|
|
454
|
+
}
|
|
455
|
+
isValidEmail(t) {
|
|
456
|
+
return /^\S+@\S+\.\S+$/u.test(t);
|
|
457
|
+
}
|
|
458
|
+
};
|
|
459
|
+
c.styles = [P];
|
|
460
|
+
d([
|
|
461
|
+
u()
|
|
462
|
+
], c.prototype, "email", void 0);
|
|
463
|
+
d([
|
|
464
|
+
u()
|
|
465
|
+
], c.prototype, "address", void 0);
|
|
466
|
+
d([
|
|
467
|
+
u()
|
|
468
|
+
], c.prototype, "loading", void 0);
|
|
469
|
+
d([
|
|
470
|
+
u()
|
|
471
|
+
], c.prototype, "appName", void 0);
|
|
472
|
+
d([
|
|
473
|
+
u()
|
|
474
|
+
], c.prototype, "siwx", void 0);
|
|
475
|
+
d([
|
|
476
|
+
u()
|
|
477
|
+
], c.prototype, "isRequired", void 0);
|
|
478
|
+
d([
|
|
479
|
+
u()
|
|
480
|
+
], c.prototype, "recentEmails", void 0);
|
|
481
|
+
c = d([
|
|
482
|
+
x("w3m-data-capture-view")
|
|
483
|
+
], c);
|
|
484
|
+
export {
|
|
485
|
+
b as W3mDataCaptureOtpConfirmView,
|
|
486
|
+
c as W3mDataCaptureView,
|
|
487
|
+
g as W3mEmailSuffixesWidget,
|
|
488
|
+
w as W3mRecentEmailsWidget
|
|
489
|
+
};
|