@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,808 @@
|
|
|
1
|
+
import { c0 as H, bW as g, cz as W, cy as K, bX as c, ci as _, ct as V, cH as G, cv as d, bV as w, bR as E, bS as z, bT as B, bU as l, cg as N, ca as h, cI as j, c6 as k, c8 as C, c9 as m, c5 as L, cJ as X, cu as q, bY as J, cK as v, cc as U, cL as O, b_ as Q, c7 as I, c4 as Z, cM as ee, c3 as te } from "./index-B6Mg114Z.mjs";
|
|
2
|
+
const ie = H`
|
|
3
|
+
div {
|
|
4
|
+
width: 100%;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
[data-ready='false'] {
|
|
8
|
+
transform: scale(1.05);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@media (max-width: 430px) {
|
|
12
|
+
[data-ready='false'] {
|
|
13
|
+
transform: translateY(-50px);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
`;
|
|
17
|
+
var F = function(e, t, i, n) {
|
|
18
|
+
var r = arguments.length, o = r < 3 ? t : n === null ? n = Object.getOwnPropertyDescriptor(t, i) : n, s;
|
|
19
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o = Reflect.decorate(e, t, i, n);
|
|
20
|
+
else for (var a = e.length - 1; a >= 0; a--) (s = e[a]) && (o = (r < 3 ? s(o) : r > 3 ? s(t, i, o) : s(t, i)) || o);
|
|
21
|
+
return r > 3 && o && Object.defineProperty(t, i, o), o;
|
|
22
|
+
};
|
|
23
|
+
const P = 600, M = 360, oe = 64;
|
|
24
|
+
let R = class extends g {
|
|
25
|
+
constructor() {
|
|
26
|
+
super(), this.bodyObserver = void 0, this.unsubscribe = [], this.iframe = document.getElementById("w3m-iframe"), this.ready = !1, this.unsubscribe.push(W.subscribeKey("open", (t) => {
|
|
27
|
+
t || this.onHideIframe();
|
|
28
|
+
}), W.subscribeKey("shake", (t) => {
|
|
29
|
+
t ? this.iframe.style.animation = "w3m-shake 500ms var(--apkt-easings-ease-out-power-2)" : this.iframe.style.animation = "none";
|
|
30
|
+
}));
|
|
31
|
+
}
|
|
32
|
+
disconnectedCallback() {
|
|
33
|
+
var t;
|
|
34
|
+
this.onHideIframe(), this.unsubscribe.forEach((i) => i()), (t = this.bodyObserver) == null || t.unobserve(window.document.body);
|
|
35
|
+
}
|
|
36
|
+
async firstUpdated() {
|
|
37
|
+
var i;
|
|
38
|
+
await this.syncTheme(), this.iframe.style.display = "block";
|
|
39
|
+
const t = (i = this == null ? void 0 : this.renderRoot) == null ? void 0 : i.querySelector("div");
|
|
40
|
+
this.bodyObserver = new ResizeObserver((n) => {
|
|
41
|
+
var s, a;
|
|
42
|
+
const r = (s = n == null ? void 0 : n[0]) == null ? void 0 : s.contentBoxSize, o = (a = r == null ? void 0 : r[0]) == null ? void 0 : a.inlineSize;
|
|
43
|
+
this.iframe.style.height = `${P}px`, t.style.height = `${P}px`, K.state.enableEmbedded ? this.updateFrameSizeForEmbeddedMode() : o && o <= 430 ? (this.iframe.style.width = "100%", this.iframe.style.left = "0px", this.iframe.style.bottom = "0px", this.iframe.style.top = "unset", this.onShowIframe()) : (this.iframe.style.width = `${M}px`, this.iframe.style.left = `calc(50% - ${M / 2}px)`, this.iframe.style.top = `calc(50% - ${P / 2}px + ${oe / 2}px)`, this.iframe.style.bottom = "unset", this.onShowIframe());
|
|
44
|
+
}), this.bodyObserver.observe(window.document.body);
|
|
45
|
+
}
|
|
46
|
+
render() {
|
|
47
|
+
return c`<div data-ready=${this.ready} id="w3m-frame-container"></div>`;
|
|
48
|
+
}
|
|
49
|
+
onShowIframe() {
|
|
50
|
+
const t = window.innerWidth <= 430;
|
|
51
|
+
this.ready = !0, this.iframe.style.animation = t ? "w3m-iframe-zoom-in-mobile 200ms var(--apkt-easings-ease-out-power-2)" : "w3m-iframe-zoom-in 200ms var(--apkt-easings-ease-out-power-2)";
|
|
52
|
+
}
|
|
53
|
+
onHideIframe() {
|
|
54
|
+
this.iframe.style.display = "none", this.iframe.style.animation = "w3m-iframe-fade-out 200ms var(--apkt-easings-ease-out-power-2)";
|
|
55
|
+
}
|
|
56
|
+
async syncTheme() {
|
|
57
|
+
const t = _.getAuthConnector();
|
|
58
|
+
if (t) {
|
|
59
|
+
const i = V.getSnapshot().themeMode, n = V.getSnapshot().themeVariables;
|
|
60
|
+
await t.provider.syncTheme({
|
|
61
|
+
themeVariables: n,
|
|
62
|
+
w3mThemeVariables: G(n, i)
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
async updateFrameSizeForEmbeddedMode() {
|
|
67
|
+
var n;
|
|
68
|
+
const t = (n = this == null ? void 0 : this.renderRoot) == null ? void 0 : n.querySelector("div");
|
|
69
|
+
await new Promise((r) => {
|
|
70
|
+
setTimeout(r, 300);
|
|
71
|
+
});
|
|
72
|
+
const i = this.getBoundingClientRect();
|
|
73
|
+
t.style.width = "100%", this.iframe.style.left = `${i.left}px`, this.iframe.style.top = `${i.top}px`, this.iframe.style.width = `${i.width}px`, this.iframe.style.height = `${i.height}px`, this.onShowIframe();
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
R.styles = ie;
|
|
77
|
+
F([
|
|
78
|
+
d()
|
|
79
|
+
], R.prototype, "ready", void 0);
|
|
80
|
+
R = F([
|
|
81
|
+
w("w3m-approve-transaction-view")
|
|
82
|
+
], R);
|
|
83
|
+
const ne = E`
|
|
84
|
+
a {
|
|
85
|
+
border: none;
|
|
86
|
+
border-radius: ${({ borderRadius: e }) => e[20]};
|
|
87
|
+
display: flex;
|
|
88
|
+
flex-direction: row;
|
|
89
|
+
align-items: center;
|
|
90
|
+
padding: ${({ spacing: e }) => e[1]};
|
|
91
|
+
transition:
|
|
92
|
+
background-color ${({ durations: e }) => e.lg}
|
|
93
|
+
${({ easings: e }) => e["ease-out-power-2"]},
|
|
94
|
+
box-shadow ${({ durations: e }) => e.lg}
|
|
95
|
+
${({ easings: e }) => e["ease-out-power-2"]},
|
|
96
|
+
border ${({ durations: e }) => e.lg} ${({ easings: e }) => e["ease-out-power-2"]};
|
|
97
|
+
will-change: background-color, box-shadow, border;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/* -- Variants --------------------------------------------------------------- */
|
|
101
|
+
a[data-type='success'] {
|
|
102
|
+
background-color: ${({ tokens: e }) => e.core.backgroundSuccess};
|
|
103
|
+
color: ${({ tokens: e }) => e.core.textSuccess};
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
a[data-type='error'] {
|
|
107
|
+
background-color: ${({ tokens: e }) => e.core.backgroundError};
|
|
108
|
+
color: ${({ tokens: e }) => e.core.textError};
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
a[data-type='warning'] {
|
|
112
|
+
background-color: ${({ tokens: e }) => e.core.backgroundWarning};
|
|
113
|
+
color: ${({ tokens: e }) => e.core.textWarning};
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/* -- Sizes --------------------------------------------------------------- */
|
|
117
|
+
a[data-size='sm'] {
|
|
118
|
+
height: 24px;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
a[data-size='md'] {
|
|
122
|
+
height: 28px;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
a[data-size='lg'] {
|
|
126
|
+
height: 32px;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
a[data-size='sm'] > wui-image,
|
|
130
|
+
a[data-size='sm'] > wui-icon {
|
|
131
|
+
width: 16px;
|
|
132
|
+
height: 16px;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
a[data-size='md'] > wui-image,
|
|
136
|
+
a[data-size='md'] > wui-icon {
|
|
137
|
+
width: 20px;
|
|
138
|
+
height: 20px;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
a[data-size='lg'] > wui-image,
|
|
142
|
+
a[data-size='lg'] > wui-icon {
|
|
143
|
+
width: 24px;
|
|
144
|
+
height: 24px;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
wui-text {
|
|
148
|
+
padding-left: ${({ spacing: e }) => e[1]};
|
|
149
|
+
padding-right: ${({ spacing: e }) => e[1]};
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
wui-image {
|
|
153
|
+
border-radius: ${({ borderRadius: e }) => e[3]};
|
|
154
|
+
overflow: hidden;
|
|
155
|
+
user-drag: none;
|
|
156
|
+
user-select: none;
|
|
157
|
+
-moz-user-select: none;
|
|
158
|
+
-webkit-user-drag: none;
|
|
159
|
+
-webkit-user-select: none;
|
|
160
|
+
-ms-user-select: none;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/* -- States --------------------------------------------------------------- */
|
|
164
|
+
@media (hover: hover) and (pointer: fine) {
|
|
165
|
+
a[data-type='success']:not(:disabled):hover {
|
|
166
|
+
background-color: ${({ tokens: e }) => e.theme.foregroundPrimary};
|
|
167
|
+
box-shadow: 0px 0px 0px 1px ${({ tokens: e }) => e.core.borderSuccess};
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
a[data-type='error']:not(:disabled):hover {
|
|
171
|
+
background-color: ${({ tokens: e }) => e.theme.foregroundPrimary};
|
|
172
|
+
box-shadow: 0px 0px 0px 1px ${({ tokens: e }) => e.core.borderError};
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
a[data-type='warning']:not(:disabled):hover {
|
|
176
|
+
background-color: ${({ tokens: e }) => e.theme.foregroundPrimary};
|
|
177
|
+
box-shadow: 0px 0px 0px 1px ${({ tokens: e }) => e.core.borderWarning};
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
a[data-type='success']:not(:disabled):focus-visible {
|
|
182
|
+
box-shadow:
|
|
183
|
+
0px 0px 0px 1px ${({ tokens: e }) => e.core.backgroundAccentPrimary},
|
|
184
|
+
0px 0px 0px 4px ${({ tokens: e }) => e.core.foregroundAccent020};
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
a[data-type='error']:not(:disabled):focus-visible {
|
|
188
|
+
box-shadow:
|
|
189
|
+
0px 0px 0px 1px ${({ tokens: e }) => e.core.backgroundAccentPrimary},
|
|
190
|
+
0px 0px 0px 4px ${({ tokens: e }) => e.core.foregroundAccent020};
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
a[data-type='warning']:not(:disabled):focus-visible {
|
|
194
|
+
box-shadow:
|
|
195
|
+
0px 0px 0px 1px ${({ tokens: e }) => e.core.backgroundAccentPrimary},
|
|
196
|
+
0px 0px 0px 4px ${({ tokens: e }) => e.core.foregroundAccent020};
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
a:disabled {
|
|
200
|
+
opacity: 0.5;
|
|
201
|
+
}
|
|
202
|
+
`;
|
|
203
|
+
var y = function(e, t, i, n) {
|
|
204
|
+
var r = arguments.length, o = r < 3 ? t : n === null ? n = Object.getOwnPropertyDescriptor(t, i) : n, s;
|
|
205
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o = Reflect.decorate(e, t, i, n);
|
|
206
|
+
else for (var a = e.length - 1; a >= 0; a--) (s = e[a]) && (o = (r < 3 ? s(o) : r > 3 ? s(t, i, o) : s(t, i)) || o);
|
|
207
|
+
return r > 3 && o && Object.defineProperty(t, i, o), o;
|
|
208
|
+
};
|
|
209
|
+
const re = {
|
|
210
|
+
sm: "md-regular",
|
|
211
|
+
md: "lg-regular",
|
|
212
|
+
lg: "lg-regular"
|
|
213
|
+
}, se = {
|
|
214
|
+
success: "sealCheck",
|
|
215
|
+
error: "warning",
|
|
216
|
+
warning: "exclamationCircle"
|
|
217
|
+
};
|
|
218
|
+
let u = class extends g {
|
|
219
|
+
constructor() {
|
|
220
|
+
super(...arguments), this.type = "success", this.size = "md", this.imageSrc = void 0, this.disabled = !1, this.href = "", this.text = void 0;
|
|
221
|
+
}
|
|
222
|
+
render() {
|
|
223
|
+
return c`
|
|
224
|
+
<a
|
|
225
|
+
rel="noreferrer"
|
|
226
|
+
target="_blank"
|
|
227
|
+
href=${this.href}
|
|
228
|
+
class=${this.disabled ? "disabled" : ""}
|
|
229
|
+
data-type=${this.type}
|
|
230
|
+
data-size=${this.size}
|
|
231
|
+
>
|
|
232
|
+
${this.imageTemplate()}
|
|
233
|
+
<wui-text variant=${re[this.size]} color="inherit">${this.text}</wui-text>
|
|
234
|
+
</a>
|
|
235
|
+
`;
|
|
236
|
+
}
|
|
237
|
+
imageTemplate() {
|
|
238
|
+
return this.imageSrc ? c`<wui-image src=${this.imageSrc} size="inherit"></wui-image>` : c`<wui-icon
|
|
239
|
+
name=${se[this.type]}
|
|
240
|
+
weight="fill"
|
|
241
|
+
color="inherit"
|
|
242
|
+
size="inherit"
|
|
243
|
+
class="image-icon"
|
|
244
|
+
></wui-icon>`;
|
|
245
|
+
}
|
|
246
|
+
};
|
|
247
|
+
u.styles = [z, B, ne];
|
|
248
|
+
y([
|
|
249
|
+
l()
|
|
250
|
+
], u.prototype, "type", void 0);
|
|
251
|
+
y([
|
|
252
|
+
l()
|
|
253
|
+
], u.prototype, "size", void 0);
|
|
254
|
+
y([
|
|
255
|
+
l()
|
|
256
|
+
], u.prototype, "imageSrc", void 0);
|
|
257
|
+
y([
|
|
258
|
+
l({ type: Boolean })
|
|
259
|
+
], u.prototype, "disabled", void 0);
|
|
260
|
+
y([
|
|
261
|
+
l()
|
|
262
|
+
], u.prototype, "href", void 0);
|
|
263
|
+
y([
|
|
264
|
+
l()
|
|
265
|
+
], u.prototype, "text", void 0);
|
|
266
|
+
u = y([
|
|
267
|
+
w("wui-semantic-chip")
|
|
268
|
+
], u);
|
|
269
|
+
var ae = function(e, t, i, n) {
|
|
270
|
+
var r = arguments.length, o = r < 3 ? t : n === null ? n = Object.getOwnPropertyDescriptor(t, i) : n, s;
|
|
271
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o = Reflect.decorate(e, t, i, n);
|
|
272
|
+
else for (var a = e.length - 1; a >= 0; a--) (s = e[a]) && (o = (r < 3 ? s(o) : r > 3 ? s(t, i, o) : s(t, i)) || o);
|
|
273
|
+
return r > 3 && o && Object.defineProperty(t, i, o), o;
|
|
274
|
+
};
|
|
275
|
+
let Y = class extends g {
|
|
276
|
+
render() {
|
|
277
|
+
return c`
|
|
278
|
+
<wui-flex flexDirection="column" alignItems="center" gap="5" padding="5">
|
|
279
|
+
<wui-text variant="md-regular" color="primary">Follow the instructions on</wui-text>
|
|
280
|
+
<wui-semantic-chip
|
|
281
|
+
icon="externalLink"
|
|
282
|
+
variant="fill"
|
|
283
|
+
text=${N.SECURE_SITE_DASHBOARD}
|
|
284
|
+
href=${N.SECURE_SITE_DASHBOARD}
|
|
285
|
+
imageSrc=${N.SECURE_SITE_FAVICON}
|
|
286
|
+
data-testid="w3m-secure-website-button"
|
|
287
|
+
>
|
|
288
|
+
</wui-semantic-chip>
|
|
289
|
+
<wui-text variant="sm-regular" color="secondary">
|
|
290
|
+
You will have to reconnect for security reasons
|
|
291
|
+
</wui-text>
|
|
292
|
+
</wui-flex>
|
|
293
|
+
`;
|
|
294
|
+
}
|
|
295
|
+
};
|
|
296
|
+
Y = ae([
|
|
297
|
+
w("w3m-upgrade-wallet-view")
|
|
298
|
+
], Y);
|
|
299
|
+
var A = function(e, t, i, n) {
|
|
300
|
+
var r = arguments.length, o = r < 3 ? t : n === null ? n = Object.getOwnPropertyDescriptor(t, i) : n, s;
|
|
301
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o = Reflect.decorate(e, t, i, n);
|
|
302
|
+
else for (var a = e.length - 1; a >= 0; a--) (s = e[a]) && (o = (r < 3 ? s(o) : r > 3 ? s(t, i, o) : s(t, i)) || o);
|
|
303
|
+
return r > 3 && o && Object.defineProperty(t, i, o), o;
|
|
304
|
+
};
|
|
305
|
+
let $ = class extends g {
|
|
306
|
+
constructor() {
|
|
307
|
+
super(...arguments), this.loading = !1, this.switched = !1, this.text = "", this.network = h.state.activeCaipNetwork;
|
|
308
|
+
}
|
|
309
|
+
render() {
|
|
310
|
+
return c`
|
|
311
|
+
<wui-flex flexDirection="column" gap="2" .padding=${["6", "4", "3", "4"]}>
|
|
312
|
+
${this.togglePreferredAccountTypeTemplate()} ${this.toggleSmartAccountVersionTemplate()}
|
|
313
|
+
</wui-flex>
|
|
314
|
+
`;
|
|
315
|
+
}
|
|
316
|
+
toggleSmartAccountVersionTemplate() {
|
|
317
|
+
return c`
|
|
318
|
+
<w3m-tooltip-trigger text="Changing the smart account version will reload the page">
|
|
319
|
+
<wui-list-item
|
|
320
|
+
icon=${this.isV6() ? "arrowTop" : "arrowBottom"}
|
|
321
|
+
?rounded=${!0}
|
|
322
|
+
?chevron=${!0}
|
|
323
|
+
data-testid="account-toggle-smart-account-version"
|
|
324
|
+
@click=${this.toggleSmartAccountVersion.bind(this)}
|
|
325
|
+
>
|
|
326
|
+
<wui-text variant="lg-regular" color="primary"
|
|
327
|
+
>Force Smart Account Version ${this.isV6() ? "7" : "6"}</wui-text
|
|
328
|
+
>
|
|
329
|
+
</wui-list-item>
|
|
330
|
+
</w3m-tooltip-trigger>
|
|
331
|
+
`;
|
|
332
|
+
}
|
|
333
|
+
isV6() {
|
|
334
|
+
return (j.get("dapp_smart_account_version") || "v6") === "v6";
|
|
335
|
+
}
|
|
336
|
+
toggleSmartAccountVersion() {
|
|
337
|
+
var t;
|
|
338
|
+
j.set("dapp_smart_account_version", this.isV6() ? "v7" : "v6"), typeof window < "u" && ((t = window == null ? void 0 : window.location) == null || t.reload());
|
|
339
|
+
}
|
|
340
|
+
togglePreferredAccountTypeTemplate() {
|
|
341
|
+
var o;
|
|
342
|
+
const t = (o = this.network) == null ? void 0 : o.chainNamespace, i = h.checkIfSmartAccountEnabled(), n = _.getConnectorId(t);
|
|
343
|
+
return !_.getAuthConnector() || n !== k.CONNECTOR_ID.AUTH || !i ? null : (this.switched || (this.text = C(t) === m.ACCOUNT_TYPES.SMART_ACCOUNT ? "Switch to your EOA" : "Switch to your Smart Account"), c`
|
|
344
|
+
<wui-list-item
|
|
345
|
+
icon="swapHorizontal"
|
|
346
|
+
?rounded=${!0}
|
|
347
|
+
?chevron=${!0}
|
|
348
|
+
?loading=${this.loading}
|
|
349
|
+
@click=${this.changePreferredAccountType.bind(this)}
|
|
350
|
+
data-testid="account-toggle-preferred-account-type"
|
|
351
|
+
>
|
|
352
|
+
<wui-text variant="lg-regular" color="primary">${this.text}</wui-text>
|
|
353
|
+
</wui-list-item>
|
|
354
|
+
`);
|
|
355
|
+
}
|
|
356
|
+
async changePreferredAccountType() {
|
|
357
|
+
var o;
|
|
358
|
+
const t = (o = this.network) == null ? void 0 : o.chainNamespace, i = h.checkIfSmartAccountEnabled(), n = C(t) === m.ACCOUNT_TYPES.SMART_ACCOUNT || !i ? m.ACCOUNT_TYPES.EOA : m.ACCOUNT_TYPES.SMART_ACCOUNT;
|
|
359
|
+
_.getAuthConnector() && (this.loading = !0, await L.setPreferredAccountType(n, t), this.text = n === m.ACCOUNT_TYPES.SMART_ACCOUNT ? "Switch to your EOA" : "Switch to your Smart Account", this.switched = !0, X.resetSend(), this.loading = !1, this.requestUpdate());
|
|
360
|
+
}
|
|
361
|
+
};
|
|
362
|
+
A([
|
|
363
|
+
d()
|
|
364
|
+
], $.prototype, "loading", void 0);
|
|
365
|
+
A([
|
|
366
|
+
d()
|
|
367
|
+
], $.prototype, "switched", void 0);
|
|
368
|
+
A([
|
|
369
|
+
d()
|
|
370
|
+
], $.prototype, "text", void 0);
|
|
371
|
+
A([
|
|
372
|
+
d()
|
|
373
|
+
], $.prototype, "network", void 0);
|
|
374
|
+
$ = A([
|
|
375
|
+
w("w3m-smart-account-settings-view")
|
|
376
|
+
], $);
|
|
377
|
+
const ce = E`
|
|
378
|
+
:host {
|
|
379
|
+
width: 100%;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
button {
|
|
383
|
+
width: 100%;
|
|
384
|
+
display: flex;
|
|
385
|
+
justify-content: space-between;
|
|
386
|
+
align-items: center;
|
|
387
|
+
background-color: ${({ tokens: e }) => e.theme.foregroundPrimary};
|
|
388
|
+
border-radius: ${({ borderRadius: e }) => e[4]};
|
|
389
|
+
padding: ${({ spacing: e }) => e[4]};
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
.name {
|
|
393
|
+
max-width: 75%;
|
|
394
|
+
overflow: hidden;
|
|
395
|
+
text-overflow: ellipsis;
|
|
396
|
+
white-space: nowrap;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
@media (hover: hover) and (pointer: fine) {
|
|
400
|
+
button:hover:enabled {
|
|
401
|
+
cursor: pointer;
|
|
402
|
+
background-color: ${({ tokens: e }) => e.theme.foregroundSecondary};
|
|
403
|
+
border-radius: ${({ borderRadius: e }) => e[6]};
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
button:disabled {
|
|
408
|
+
opacity: 0.5;
|
|
409
|
+
cursor: default;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
button:focus-visible:enabled {
|
|
413
|
+
box-shadow: 0 0 0 4px ${({ tokens: e }) => e.core.foregroundAccent040};
|
|
414
|
+
background-color: ${({ tokens: e }) => e.theme.foregroundSecondary};
|
|
415
|
+
}
|
|
416
|
+
`;
|
|
417
|
+
var T = function(e, t, i, n) {
|
|
418
|
+
var r = arguments.length, o = r < 3 ? t : n === null ? n = Object.getOwnPropertyDescriptor(t, i) : n, s;
|
|
419
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o = Reflect.decorate(e, t, i, n);
|
|
420
|
+
else for (var a = e.length - 1; a >= 0; a--) (s = e[a]) && (o = (r < 3 ? s(o) : r > 3 ? s(t, i, o) : s(t, i)) || o);
|
|
421
|
+
return r > 3 && o && Object.defineProperty(t, i, o), o;
|
|
422
|
+
};
|
|
423
|
+
let b = class extends g {
|
|
424
|
+
constructor() {
|
|
425
|
+
super(...arguments), this.name = "", this.registered = !1, this.loading = !1, this.disabled = !1;
|
|
426
|
+
}
|
|
427
|
+
render() {
|
|
428
|
+
return c`
|
|
429
|
+
<button ?disabled=${this.disabled}>
|
|
430
|
+
<wui-text class="name" color="primary" variant="md-regular">${this.name}</wui-text>
|
|
431
|
+
${this.templateRightContent()}
|
|
432
|
+
</button>
|
|
433
|
+
`;
|
|
434
|
+
}
|
|
435
|
+
templateRightContent() {
|
|
436
|
+
return this.loading ? c`<wui-loading-spinner size="lg" color="primary"></wui-loading-spinner>` : this.registered ? c`<wui-tag variant="info" size="sm">Registered</wui-tag>` : c`<wui-tag variant="success" size="sm">Available</wui-tag>`;
|
|
437
|
+
}
|
|
438
|
+
};
|
|
439
|
+
b.styles = [z, B, ce];
|
|
440
|
+
T([
|
|
441
|
+
l()
|
|
442
|
+
], b.prototype, "name", void 0);
|
|
443
|
+
T([
|
|
444
|
+
l({ type: Boolean })
|
|
445
|
+
], b.prototype, "registered", void 0);
|
|
446
|
+
T([
|
|
447
|
+
l({ type: Boolean })
|
|
448
|
+
], b.prototype, "loading", void 0);
|
|
449
|
+
T([
|
|
450
|
+
l({ type: Boolean })
|
|
451
|
+
], b.prototype, "disabled", void 0);
|
|
452
|
+
b = T([
|
|
453
|
+
w("wui-account-name-suggestion-item")
|
|
454
|
+
], b);
|
|
455
|
+
const le = E`
|
|
456
|
+
:host {
|
|
457
|
+
position: relative;
|
|
458
|
+
width: 100%;
|
|
459
|
+
display: inline-block;
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
:host([disabled]) {
|
|
463
|
+
opacity: 0.5;
|
|
464
|
+
cursor: not-allowed;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
.base-name {
|
|
468
|
+
position: absolute;
|
|
469
|
+
right: ${({ spacing: e }) => e[4]};
|
|
470
|
+
top: 50%;
|
|
471
|
+
transform: translateY(-50%);
|
|
472
|
+
text-align: right;
|
|
473
|
+
padding: ${({ spacing: e }) => e[1]};
|
|
474
|
+
background-color: ${({ tokens: e }) => e.theme.foregroundSecondary};
|
|
475
|
+
border-radius: ${({ borderRadius: e }) => e[1]};
|
|
476
|
+
}
|
|
477
|
+
`;
|
|
478
|
+
var S = function(e, t, i, n) {
|
|
479
|
+
var r = arguments.length, o = r < 3 ? t : n === null ? n = Object.getOwnPropertyDescriptor(t, i) : n, s;
|
|
480
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o = Reflect.decorate(e, t, i, n);
|
|
481
|
+
else for (var a = e.length - 1; a >= 0; a--) (s = e[a]) && (o = (r < 3 ? s(o) : r > 3 ? s(t, i, o) : s(t, i)) || o);
|
|
482
|
+
return r > 3 && o && Object.defineProperty(t, i, o), o;
|
|
483
|
+
};
|
|
484
|
+
let f = class extends g {
|
|
485
|
+
constructor() {
|
|
486
|
+
super(...arguments), this.disabled = !1, this.loading = !1;
|
|
487
|
+
}
|
|
488
|
+
render() {
|
|
489
|
+
return c`
|
|
490
|
+
<wui-input-text
|
|
491
|
+
value=${q(this.value)}
|
|
492
|
+
?disabled=${this.disabled}
|
|
493
|
+
.value=${this.value || ""}
|
|
494
|
+
data-testid="wui-ens-input"
|
|
495
|
+
icon="search"
|
|
496
|
+
inputRightPadding="5xl"
|
|
497
|
+
.onKeyDown=${this.onKeyDown}
|
|
498
|
+
></wui-input-text>
|
|
499
|
+
`;
|
|
500
|
+
}
|
|
501
|
+
};
|
|
502
|
+
f.styles = [z, le];
|
|
503
|
+
S([
|
|
504
|
+
l()
|
|
505
|
+
], f.prototype, "errorMessage", void 0);
|
|
506
|
+
S([
|
|
507
|
+
l({ type: Boolean })
|
|
508
|
+
], f.prototype, "disabled", void 0);
|
|
509
|
+
S([
|
|
510
|
+
l()
|
|
511
|
+
], f.prototype, "value", void 0);
|
|
512
|
+
S([
|
|
513
|
+
l({ type: Boolean })
|
|
514
|
+
], f.prototype, "loading", void 0);
|
|
515
|
+
S([
|
|
516
|
+
l({ attribute: !1 })
|
|
517
|
+
], f.prototype, "onKeyDown", void 0);
|
|
518
|
+
f = S([
|
|
519
|
+
w("wui-ens-input")
|
|
520
|
+
], f);
|
|
521
|
+
const de = E`
|
|
522
|
+
wui-flex {
|
|
523
|
+
width: 100%;
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
.suggestion {
|
|
527
|
+
background-color: ${({ tokens: e }) => e.theme.foregroundPrimary};
|
|
528
|
+
border-radius: ${({ borderRadius: e }) => e[4]};
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
.suggestion:hover:not(:disabled) {
|
|
532
|
+
cursor: pointer;
|
|
533
|
+
border: none;
|
|
534
|
+
width: 100%;
|
|
535
|
+
display: flex;
|
|
536
|
+
justify-content: space-between;
|
|
537
|
+
align-items: center;
|
|
538
|
+
background-color: ${({ tokens: e }) => e.theme.foregroundSecondary};
|
|
539
|
+
border-radius: ${({ borderRadius: e }) => e[6]};
|
|
540
|
+
padding: ${({ spacing: e }) => e[4]};
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
.suggestion:disabled {
|
|
544
|
+
opacity: 0.5;
|
|
545
|
+
cursor: default;
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
.suggestion:focus-visible:not(:disabled) {
|
|
549
|
+
box-shadow: 0 0 0 4px ${({ tokens: e }) => e.core.foregroundAccent040};
|
|
550
|
+
background-color: ${({ tokens: e }) => e.theme.foregroundSecondary};
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
.suggested-name {
|
|
554
|
+
max-width: 75%;
|
|
555
|
+
overflow: hidden;
|
|
556
|
+
text-overflow: ellipsis;
|
|
557
|
+
white-space: nowrap;
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
form {
|
|
561
|
+
width: 100%;
|
|
562
|
+
position: relative;
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
.input-submit-button,
|
|
566
|
+
.input-loading-spinner {
|
|
567
|
+
position: absolute;
|
|
568
|
+
top: 22px;
|
|
569
|
+
transform: translateY(-50%);
|
|
570
|
+
right: 10px;
|
|
571
|
+
}
|
|
572
|
+
`;
|
|
573
|
+
var x = function(e, t, i, n) {
|
|
574
|
+
var r = arguments.length, o = r < 3 ? t : n === null ? n = Object.getOwnPropertyDescriptor(t, i) : n, s;
|
|
575
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o = Reflect.decorate(e, t, i, n);
|
|
576
|
+
else for (var a = e.length - 1; a >= 0; a--) (s = e[a]) && (o = (r < 3 ? s(o) : r > 3 ? s(t, i, o) : s(t, i)) || o);
|
|
577
|
+
return r > 3 && o && Object.defineProperty(t, i, o), o;
|
|
578
|
+
};
|
|
579
|
+
let p = class extends g {
|
|
580
|
+
constructor() {
|
|
581
|
+
var t;
|
|
582
|
+
super(), this.formRef = J(), this.usubscribe = [], this.name = "", this.error = "", this.loading = v.state.loading, this.suggestions = v.state.suggestions, this.profileName = (t = h.getAccountData()) == null ? void 0 : t.profileName, this.onDebouncedNameInputChange = U.debounce((i) => {
|
|
583
|
+
i.length < 4 ? this.error = "Name must be at least 4 characters long" : O.isValidReownName(i) ? (this.error = "", v.getSuggestions(i)) : this.error = "The value is not a valid username";
|
|
584
|
+
}), this.usubscribe.push(v.subscribe((i) => {
|
|
585
|
+
this.suggestions = i.suggestions, this.loading = i.loading;
|
|
586
|
+
}), h.subscribeChainProp("accountState", (i) => {
|
|
587
|
+
this.profileName = i == null ? void 0 : i.profileName, i != null && i.profileName && (this.error = "You already own a name");
|
|
588
|
+
}));
|
|
589
|
+
}
|
|
590
|
+
firstUpdated() {
|
|
591
|
+
var t;
|
|
592
|
+
(t = this.formRef.value) == null || t.addEventListener("keydown", this.onEnterKey.bind(this));
|
|
593
|
+
}
|
|
594
|
+
disconnectedCallback() {
|
|
595
|
+
var t;
|
|
596
|
+
super.disconnectedCallback(), this.usubscribe.forEach((i) => i()), (t = this.formRef.value) == null || t.removeEventListener("keydown", this.onEnterKey.bind(this));
|
|
597
|
+
}
|
|
598
|
+
render() {
|
|
599
|
+
return c`
|
|
600
|
+
<wui-flex
|
|
601
|
+
flexDirection="column"
|
|
602
|
+
alignItems="center"
|
|
603
|
+
gap="4"
|
|
604
|
+
.padding=${["1", "3", "4", "3"]}
|
|
605
|
+
>
|
|
606
|
+
<form ${Q(this.formRef)} @submit=${this.onSubmitName.bind(this)}>
|
|
607
|
+
<wui-ens-input
|
|
608
|
+
@inputChange=${this.onNameInputChange.bind(this)}
|
|
609
|
+
.errorMessage=${this.error}
|
|
610
|
+
.value=${this.name}
|
|
611
|
+
.onKeyDown=${this.onKeyDown.bind(this)}
|
|
612
|
+
>
|
|
613
|
+
</wui-ens-input>
|
|
614
|
+
${this.submitButtonTemplate()}
|
|
615
|
+
<input type="submit" hidden />
|
|
616
|
+
</form>
|
|
617
|
+
${this.templateSuggestions()}
|
|
618
|
+
</wui-flex>
|
|
619
|
+
`;
|
|
620
|
+
}
|
|
621
|
+
submitButtonTemplate() {
|
|
622
|
+
const t = this.suggestions.find((n) => {
|
|
623
|
+
var r, o;
|
|
624
|
+
return ((o = (r = n.name) == null ? void 0 : r.split(".")) == null ? void 0 : o[0]) === this.name && n.registered;
|
|
625
|
+
});
|
|
626
|
+
if (this.loading)
|
|
627
|
+
return c`<wui-loading-spinner
|
|
628
|
+
class="input-loading-spinner"
|
|
629
|
+
color="secondary"
|
|
630
|
+
></wui-loading-spinner>`;
|
|
631
|
+
const i = `${this.name}${k.WC_NAME_SUFFIX}`;
|
|
632
|
+
return c`
|
|
633
|
+
<wui-icon-link
|
|
634
|
+
?disabled=${!!t}
|
|
635
|
+
class="input-submit-button"
|
|
636
|
+
size="sm"
|
|
637
|
+
icon="chevronRight"
|
|
638
|
+
iconColor=${t ? "default" : "accent-primary"}
|
|
639
|
+
@click=${() => this.onSubmitName(i)}
|
|
640
|
+
>
|
|
641
|
+
</wui-icon-link>
|
|
642
|
+
`;
|
|
643
|
+
}
|
|
644
|
+
onNameInputChange(t) {
|
|
645
|
+
const i = O.validateReownName(t.detail || "");
|
|
646
|
+
this.name = i, this.onDebouncedNameInputChange(i);
|
|
647
|
+
}
|
|
648
|
+
onKeyDown(t) {
|
|
649
|
+
t.key.length === 1 && !O.isValidReownName(t.key) && t.preventDefault();
|
|
650
|
+
}
|
|
651
|
+
templateSuggestions() {
|
|
652
|
+
return !this.name || this.name.length < 4 || this.error ? null : c`<wui-flex flexDirection="column" gap="1" alignItems="center">
|
|
653
|
+
${this.suggestions.map((t) => c`<wui-account-name-suggestion-item
|
|
654
|
+
name=${t.name}
|
|
655
|
+
?registered=${t.registered}
|
|
656
|
+
?loading=${this.loading}
|
|
657
|
+
?disabled=${t.registered || this.loading}
|
|
658
|
+
data-testid="account-name-suggestion"
|
|
659
|
+
@click=${() => this.onSubmitName(t.name)}
|
|
660
|
+
></wui-account-name-suggestion-item>`)}
|
|
661
|
+
</wui-flex>`;
|
|
662
|
+
}
|
|
663
|
+
isAllowedToSubmit(t) {
|
|
664
|
+
var r;
|
|
665
|
+
const i = (r = t.split(".")) == null ? void 0 : r[0], n = this.suggestions.find((o) => {
|
|
666
|
+
var s, a;
|
|
667
|
+
return ((a = (s = o.name) == null ? void 0 : s.split(".")) == null ? void 0 : a[0]) === i && o.registered;
|
|
668
|
+
});
|
|
669
|
+
return !this.loading && !this.error && !this.profileName && i && v.validateName(i) && !n;
|
|
670
|
+
}
|
|
671
|
+
async onSubmitName(t) {
|
|
672
|
+
try {
|
|
673
|
+
if (!this.isAllowedToSubmit(t))
|
|
674
|
+
return;
|
|
675
|
+
I.sendEvent({
|
|
676
|
+
type: "track",
|
|
677
|
+
event: "REGISTER_NAME_INITIATED",
|
|
678
|
+
properties: {
|
|
679
|
+
isSmartAccount: C(h.state.activeChain) === m.ACCOUNT_TYPES.SMART_ACCOUNT,
|
|
680
|
+
ensName: t
|
|
681
|
+
}
|
|
682
|
+
}), await v.registerName(t), I.sendEvent({
|
|
683
|
+
type: "track",
|
|
684
|
+
event: "REGISTER_NAME_SUCCESS",
|
|
685
|
+
properties: {
|
|
686
|
+
isSmartAccount: C(h.state.activeChain) === m.ACCOUNT_TYPES.SMART_ACCOUNT,
|
|
687
|
+
ensName: t
|
|
688
|
+
}
|
|
689
|
+
});
|
|
690
|
+
} catch (i) {
|
|
691
|
+
Z.showError(i.message), I.sendEvent({
|
|
692
|
+
type: "track",
|
|
693
|
+
event: "REGISTER_NAME_ERROR",
|
|
694
|
+
properties: {
|
|
695
|
+
isSmartAccount: C(h.state.activeChain) === m.ACCOUNT_TYPES.SMART_ACCOUNT,
|
|
696
|
+
ensName: t,
|
|
697
|
+
error: U.parseError(i)
|
|
698
|
+
}
|
|
699
|
+
});
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
onEnterKey(t) {
|
|
703
|
+
if (t.key === "Enter" && this.name && this.isAllowedToSubmit(this.name)) {
|
|
704
|
+
const i = `${this.name}${k.WC_NAME_SUFFIX}`;
|
|
705
|
+
this.onSubmitName(i);
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
};
|
|
709
|
+
p.styles = de;
|
|
710
|
+
x([
|
|
711
|
+
l()
|
|
712
|
+
], p.prototype, "errorMessage", void 0);
|
|
713
|
+
x([
|
|
714
|
+
d()
|
|
715
|
+
], p.prototype, "name", void 0);
|
|
716
|
+
x([
|
|
717
|
+
d()
|
|
718
|
+
], p.prototype, "error", void 0);
|
|
719
|
+
x([
|
|
720
|
+
d()
|
|
721
|
+
], p.prototype, "loading", void 0);
|
|
722
|
+
x([
|
|
723
|
+
d()
|
|
724
|
+
], p.prototype, "suggestions", void 0);
|
|
725
|
+
x([
|
|
726
|
+
d()
|
|
727
|
+
], p.prototype, "profileName", void 0);
|
|
728
|
+
p = x([
|
|
729
|
+
w("w3m-register-account-name-view")
|
|
730
|
+
], p);
|
|
731
|
+
const ue = H`
|
|
732
|
+
.continue-button-container {
|
|
733
|
+
width: 100%;
|
|
734
|
+
}
|
|
735
|
+
`;
|
|
736
|
+
var pe = function(e, t, i, n) {
|
|
737
|
+
var r = arguments.length, o = r < 3 ? t : n === null ? n = Object.getOwnPropertyDescriptor(t, i) : n, s;
|
|
738
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o = Reflect.decorate(e, t, i, n);
|
|
739
|
+
else for (var a = e.length - 1; a >= 0; a--) (s = e[a]) && (o = (r < 3 ? s(o) : r > 3 ? s(t, i, o) : s(t, i)) || o);
|
|
740
|
+
return r > 3 && o && Object.defineProperty(t, i, o), o;
|
|
741
|
+
};
|
|
742
|
+
let D = class extends g {
|
|
743
|
+
render() {
|
|
744
|
+
return c`
|
|
745
|
+
<wui-flex
|
|
746
|
+
flexDirection="column"
|
|
747
|
+
alignItems="center"
|
|
748
|
+
gap="6"
|
|
749
|
+
.padding=${["0", "0", "4", "0"]}
|
|
750
|
+
>
|
|
751
|
+
${this.onboardingTemplate()} ${this.buttonsTemplate()}
|
|
752
|
+
<wui-link
|
|
753
|
+
@click=${() => {
|
|
754
|
+
U.openHref(ee.URLS.FAQ, "_blank");
|
|
755
|
+
}}
|
|
756
|
+
>
|
|
757
|
+
Learn more
|
|
758
|
+
<wui-icon color="inherit" slot="iconRight" name="externalLink"></wui-icon>
|
|
759
|
+
</wui-link>
|
|
760
|
+
</wui-flex>
|
|
761
|
+
`;
|
|
762
|
+
}
|
|
763
|
+
onboardingTemplate() {
|
|
764
|
+
return c` <wui-flex
|
|
765
|
+
flexDirection="column"
|
|
766
|
+
gap="6"
|
|
767
|
+
alignItems="center"
|
|
768
|
+
.padding=${["0", "6", "0", "6"]}
|
|
769
|
+
>
|
|
770
|
+
<wui-flex gap="3" alignItems="center" justifyContent="center">
|
|
771
|
+
<wui-icon-box size="xl" color="success" icon="checkmark"></wui-icon-box>
|
|
772
|
+
</wui-flex>
|
|
773
|
+
<wui-flex flexDirection="column" alignItems="center" gap="3">
|
|
774
|
+
<wui-text align="center" variant="md-medium" color="primary">
|
|
775
|
+
Account name chosen successfully
|
|
776
|
+
</wui-text>
|
|
777
|
+
<wui-text align="center" variant="md-regular" color="primary">
|
|
778
|
+
You can now fund your account and trade crypto
|
|
779
|
+
</wui-text>
|
|
780
|
+
</wui-flex>
|
|
781
|
+
</wui-flex>`;
|
|
782
|
+
}
|
|
783
|
+
buttonsTemplate() {
|
|
784
|
+
return c`<wui-flex
|
|
785
|
+
.padding=${["0", "4", "0", "4"]}
|
|
786
|
+
gap="3"
|
|
787
|
+
class="continue-button-container"
|
|
788
|
+
>
|
|
789
|
+
<wui-button fullWidth size="lg" borderRadius="xs" @click=${this.redirectToAccount.bind(this)}
|
|
790
|
+
>Let's Go!
|
|
791
|
+
</wui-button>
|
|
792
|
+
</wui-flex>`;
|
|
793
|
+
}
|
|
794
|
+
redirectToAccount() {
|
|
795
|
+
te.replace("Account");
|
|
796
|
+
}
|
|
797
|
+
};
|
|
798
|
+
D.styles = ue;
|
|
799
|
+
D = pe([
|
|
800
|
+
w("w3m-register-account-name-success-view")
|
|
801
|
+
], D);
|
|
802
|
+
export {
|
|
803
|
+
R as W3mApproveTransactionView,
|
|
804
|
+
D as W3mRegisterAccountNameSuccess,
|
|
805
|
+
p as W3mRegisterAccountNameView,
|
|
806
|
+
$ as W3mSmartAccountSettingsView,
|
|
807
|
+
Y as W3mUpgradeWalletView
|
|
808
|
+
};
|