@directcryptopay/sdk 0.2.1 → 0.2.3
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/ExchangeController-CPMQq6Q-.js +217 -0
- package/dist/HelpersUtil-DfMFC7Bf.js +120 -0
- package/dist/NavigationUtil-kj9LEOOd.js +8 -0
- package/dist/PhArrowCircleDown-lsK25DCk.js +73 -0
- package/dist/PhArrowClockwise-NeKHZ1co.js +73 -0
- package/dist/PhArrowDown-C9AkNvLs.js +73 -0
- package/dist/PhArrowLeft-RNfIQP1X.js +73 -0
- package/dist/PhArrowRight-DM1tna0G.js +73 -0
- package/dist/PhArrowSquareOut-S5XYbAZj.js +73 -0
- package/dist/PhArrowUp-DmktzOWy.js +73 -0
- package/dist/PhArrowUpRight-BkNeW_5i.js +73 -0
- package/dist/PhArrowsClockwise-CQ4pG76b.js +73 -0
- package/dist/PhArrowsDownUp-H6gxaNM6.js +73 -0
- package/dist/PhArrowsLeftRight-DZSsfMR6.js +73 -0
- package/dist/PhBank-4_9QzqIB.js +73 -0
- package/dist/PhBrowser-B-JSznId.js +73 -0
- package/dist/PhCaretDown-vV5oHMNi.js +73 -0
- package/dist/PhCaretLeft-BLo6Y_f4.js +73 -0
- package/dist/PhCaretRight-CqQN4TT3.js +73 -0
- package/dist/PhCaretUp-Df7UCAHy.js +73 -0
- package/dist/PhCheck-gtpfK4ed.js +73 -0
- package/dist/PhCircleHalf-Uq7dwDYw.js +73 -0
- package/dist/PhClock-SDCW-NmF.js +73 -0
- package/dist/PhCompass-B7hgtdx-.js +73 -0
- package/dist/PhCopy-BcnhyXCy.js +73 -0
- package/dist/PhCreditCard-BJjByVgu.js +73 -0
- package/dist/PhCurrencyDollar-B7ZXqXBy.js +73 -0
- package/dist/PhDesktop-B3VKPuJx.js +73 -0
- package/dist/PhDeviceMobile-Bnd0TYEH.js +73 -0
- package/dist/PhDotsThree-yyMWyZ-R.js +73 -0
- package/dist/PhEnvelope-67uzHbI9.js +73 -0
- package/dist/PhFunnelSimple-B-DCsloI.js +73 -0
- package/dist/PhGlobe-TMm_6qGk.js +73 -0
- package/dist/PhIdentificationCard-CePPD2xc.js +73 -0
- package/dist/PhImage-gY96WtHR.js +73 -0
- package/dist/PhInfo-DRQM_ZDP.js +73 -0
- package/dist/PhLightbulb-B0TxPfZ1.js +73 -0
- package/dist/PhMagnifyingGlass-B8si5_6W.js +73 -0
- package/dist/PhPaperPlaneRight-DVu5PLYd.js +73 -0
- package/dist/PhPlus-BfTsQnUz.js +73 -0
- package/dist/PhPower-CxYUGOWn.js +73 -0
- package/dist/PhPuzzlePiece-CQ4wh0gV.js +73 -0
- package/dist/PhQrCode-BuJ97NYJ.js +73 -0
- package/dist/PhQuestion-kJoP8Mja.js +73 -0
- package/dist/PhQuestionMark-C46ZkFpu.js +73 -0
- package/dist/PhSealCheck-Eh8jVqSN.js +73 -0
- package/dist/PhSignOut-jk97OSVt.js +73 -0
- package/dist/PhSpinner-CiYOhwMg.js +73 -0
- package/dist/PhTrash-pxerMqzd.js +73 -0
- package/dist/PhUser-BMg0VV4A.js +73 -0
- package/dist/PhVault-DYQvx5A-.js +73 -0
- package/dist/PhWarning-NLC5Mj87.js +73 -0
- package/dist/PhWarningCircle-Ch2jU9fA.js +73 -0
- package/dist/PhX-Bx4wpwm3.js +73 -0
- package/dist/SwapController-Cti0Cyxa.js +457 -0
- package/dist/{ccip-BIGqktC1.js → ccip-CKZd2XJ7.js} +4 -4
- package/dist/data-capture-7D5CL385.js +490 -0
- package/dist/dcp-sdk.umd.js +7400 -6589
- package/dist/email-AmK0INbZ.js +344 -0
- package/dist/embedded-wallet-Pn0I_XLn.js +820 -0
- package/dist/features-x8XNprEe.js +274 -0
- package/dist/{hashTypedData-ZH9ZnWu3.js → hashTypedData-B50-z0AA.js} +6 -6
- package/dist/if-defined-CdZSZ6UL.js +10 -0
- package/dist/index-4ewUtPPp.js +7981 -0
- package/dist/{index-D6h-qfpt.js → index-51l86yqx.js} +5 -5
- package/dist/index-B6K56LF_.js +85 -0
- package/dist/index-BAmv9PxJ.js +257 -0
- package/dist/index-BEswjY9r.js +117 -0
- package/dist/index-BSKRq56S.js +355 -0
- package/dist/index-BaygXQxx.js +172 -0
- package/dist/index-BcPxaHr5.js +118 -0
- package/dist/index-Bjt7nGaJ.js +199 -0
- package/dist/{index-D5r0iSq4.js → index-BkTSyAJb.js} +1 -1
- package/dist/index-Bmnl7l2U.js +555 -0
- package/dist/index-BvPvouSq.js +56 -0
- package/dist/index-C-6iznUO.js +174 -0
- package/dist/index-C4M5s_AM.js +228 -0
- package/dist/index-CEqcN8QP.js +1175 -0
- package/dist/{index-CPTcEPbD.js → index-CM3YaYca.js} +296 -298
- package/dist/{index-f3LXSfM5.js → index-CclBLA5r.js} +56 -142
- package/dist/index-ChTxJOiF.js +46 -0
- package/dist/index-CmAv0Tzr.js +86 -0
- package/dist/index-CmvoKY4x.js +125 -0
- package/dist/{index-BdSIrl-R.js → index-D7PmdQ9B.js} +578 -570
- package/dist/{index-DobBVPe4.js → index-D7k2Pc4e.js} +481 -236
- package/dist/index-D7lmgqUR.js +153 -0
- package/dist/index-DG_-qYze.js +107 -0
- package/dist/{index-Dy4NyE6l.js → index-DHot9Fdb.js} +7 -7
- package/dist/index-DV2LrPtU.js +123 -0
- package/dist/index-DYBaJQ2W.js +65 -0
- package/dist/{index-BJ7cbG3N.js → index-D_8VUmn1.js} +36688 -40208
- package/dist/index-D_gLn3rT.js +100 -0
- package/dist/index-DqcVUSC9.js +62 -0
- package/dist/index-I7VDqINw.js +128 -0
- package/dist/index-Oz72I9VP.js +209 -0
- package/dist/index-UclsHkJ0.js +118 -0
- package/dist/index-X8zir_1j.js +110 -0
- package/dist/index-XvlWKGCu.js +1281 -0
- package/dist/index-dO97xPlt.js +171 -0
- package/dist/{index-5mp7WkhV.js → index-uBeF6OAB.js} +2 -2
- package/dist/index-zeA_RiCV.js +159 -0
- package/dist/index.js +1 -1
- package/dist/{localBatchGatewayRequest-CjGcn5nM.js → localBatchGatewayRequest-BUZHGdjw.js} +1 -1
- package/dist/onramp-CdnBuF0r.js +855 -0
- package/dist/{parseSignature-S8VEpRHC.js → parseSignature-CcyTNGr4.js} +2312 -2313
- package/dist/pay-with-exchange-CSM6WCOV.js +525 -0
- package/dist/property-Bd8U3_QP.js +618 -0
- package/dist/receive-DooMu4Dx.js +232 -0
- package/dist/ref-CpgjXAw7.js +107 -0
- package/dist/send-3T7CyYic.js +1166 -0
- package/dist/socials-Dt-iHL17.js +620 -0
- package/dist/swaps-CjA9Es42.js +1760 -0
- package/dist/{transactions-DujFkB-M.js → transactions-nRm9DVzn.js} +10 -10
- package/dist/w3m-modal-NV25AXhM.js +1706 -0
- package/package.json +3 -3
- package/dist/ConstantsUtil-B-_-u8aQ.js +0 -6
- package/dist/add-sji6scSD.js +0 -19
- package/dist/all-wallets-B4H-890E.js +0 -10
- package/dist/app-store-Z433s97G.js +0 -21
- package/dist/apple-b8Lxj7nb.js +0 -22
- package/dist/arrow-bottom-M9oWWo_9.js +0 -12
- package/dist/arrow-bottom-circle-N9c4CXY1.js +0 -15
- package/dist/arrow-left-Dw8AKfwf.js +0 -12
- package/dist/arrow-right-DwLQZSC_.js +0 -12
- package/dist/arrow-top-zhUjkBe1.js +0 -12
- package/dist/bank-CbQdnILK.js +0 -18
- package/dist/browser-xAqNwt7z.js +0 -18
- package/dist/card-Dr1QBmWp.js +0 -18
- package/dist/checkmark-BhT1dTgG.js +0 -15
- package/dist/checkmark-bold-CPB29wqQ.js +0 -12
- package/dist/chevron-bottom-BhNyx2II.js +0 -12
- package/dist/chevron-left-CGuEjQlY.js +0 -12
- package/dist/chevron-right-CvIRRsqZ.js +0 -12
- package/dist/chevron-top-RSzCqjBd.js +0 -12
- package/dist/chrome-store-Cs8dAgs0.js +0 -65
- package/dist/clock-fhZO5otC.js +0 -12
- package/dist/close-BPuztrdR.js +0 -12
- package/dist/coinPlaceholder-C8X2i7Kh.js +0 -12
- package/dist/compass-WMc5huk0.js +0 -12
- package/dist/copy-DVAeT17y.js +0 -19
- package/dist/cursor-BJ4YLXfy.js +0 -7
- package/dist/cursor-transparent-DN2fLQN4.js +0 -16
- package/dist/desktop-6avxisBw.js +0 -13
- package/dist/disconnect-AReVI8Gk.js +0 -12
- package/dist/discord-CxrI30BZ.js +0 -21
- package/dist/email-B8dIIaay.js +0 -696
- package/dist/embedded-wallet-C_5hF7rM.js +0 -468
- package/dist/etherscan-BnAy8cIF.js +0 -10
- package/dist/exclamation-triangle-Bu7nHwx9.js +0 -8
- package/dist/extension-F0LIhvcf.js +0 -12
- package/dist/external-link-CP6phyaM.js +0 -12
- package/dist/facebook-BtQ-Io2y.js +0 -30
- package/dist/farcaster-BmaN1ugd.js +0 -16
- package/dist/filters-DpEwoOmy.js +0 -12
- package/dist/github-q7qO9V-b.js +0 -22
- package/dist/google-DH_ZE8bW.js +0 -22
- package/dist/help-circle-BAQVmKas.js +0 -16
- package/dist/id-Cj68Zwgo.js +0 -16
- package/dist/if-defined-CNte9B3N.js +0 -744
- package/dist/image-BKJDw6N-.js +0 -8
- package/dist/index-7toZMdtG.js +0 -573
- package/dist/index-B1uKzdvN.js +0 -170
- package/dist/index-BHFZVF-b.js +0 -257
- package/dist/index-BKwa5JSA.js +0 -559
- package/dist/index-BP4B9VUt.js +0 -54
- package/dist/index-BVdzXHpO.js +0 -181
- package/dist/index-BYND0GJ9.js +0 -146
- package/dist/index-BaJ0zEbh.js +0 -97
- package/dist/index-Bh0MPFwP.js +0 -58
- package/dist/index-Bsh7_qTp.js +0 -511
- package/dist/index-BwnXTNNg.js +0 -199
- package/dist/index-C0kPDbg_.js +0 -77
- package/dist/index-CKikVKe2.js +0 -75
- package/dist/index-ChVh0Hkp.js +0 -243
- package/dist/index-Cle_NnnS.js +0 -305
- package/dist/index-CmWdvIFT.js +0 -51
- package/dist/index-D2AMA8Bu.js +0 -65
- package/dist/index-DAUM8CO4.js +0 -65
- package/dist/index-DGjZW6uR.js +0 -78
- package/dist/index-DQe94z7X.js +0 -265
- package/dist/index-DTo6w99t.js +0 -7864
- package/dist/index-DYdXjap2.js +0 -320
- package/dist/index-DceCxNV5.js +0 -181
- package/dist/index-Uw9cSw0q.js +0 -294
- package/dist/index-qiuyrukh.js +0 -45
- package/dist/index-zddvaohA.js +0 -78
- package/dist/info-RfPsmroW.js +0 -7
- package/dist/info-circle-DFKHB_ZN.js +0 -16
- package/dist/lightbulb-B-Bykj9X.js +0 -7
- package/dist/mail-mBAgGuw5.js +0 -12
- package/dist/mobile-Dhh3ndkf.js +0 -13
- package/dist/more-D1h7UTvg.js +0 -15
- package/dist/network-placeholder-Dqynvc-t.js +0 -18
- package/dist/nftPlaceholder-Df7MW4MM.js +0 -12
- package/dist/off-BmG3cHTX.js +0 -12
- package/dist/onramp-C401Aenb.js +0 -1279
- package/dist/play-store-4q1fzL_P.js +0 -36
- package/dist/plus-603Gs3yG.js +0 -17
- package/dist/qr-code-Dgwhf6M1.js +0 -10
- package/dist/receive-CYXbbEUR.js +0 -186
- package/dist/recycle-horizontal-Bu8zZ563.js +0 -13
- package/dist/ref-DpmKRWBK.js +0 -41
- package/dist/refresh-BMZFu0mu.js +0 -12
- package/dist/reown-logo-BXph7ThY.js +0 -16
- package/dist/search-Cm_V42Y_.js +0 -12
- package/dist/secp256k1-C0iX1TUr.js +0 -1510
- package/dist/secp256k1-DOQBqE4Z.js +0 -1302
- package/dist/send-BSMYxDuP.js +0 -19
- package/dist/send-C8EeIzRB.js +0 -1038
- package/dist/socials-DQrHQajs.js +0 -574
- package/dist/swapHorizontal-98rnJewS.js +0 -12
- package/dist/swapHorizontalBold-C299FjEt.js +0 -12
- package/dist/swapHorizontalMedium-Cqm6i4WJ.js +0 -20
- package/dist/swapHorizontalRoundedBold-De7hFfqZ.js +0 -12
- package/dist/swapVertical-DSL75l8L.js +0 -12
- package/dist/swaps-BuTNp65Y.js +0 -1637
- package/dist/telegram-cJP7hgUb.js +0 -20
- package/dist/three-dots-DHnEh28O.js +0 -9
- package/dist/twitch-CR2iGcBo.js +0 -22
- package/dist/twitterIcon-E5TAQjOn.js +0 -10
- package/dist/verify-DEukUJp0.js +0 -12
- package/dist/verify-filled-BXsx1i_p.js +0 -12
- package/dist/w3m-modal-Bm7BqVng.js +0 -1037
- package/dist/wallet-CzyyvdrT.js +0 -12
- package/dist/wallet-placeholder-BrcmyGEe.js +0 -18
- package/dist/walletconnect-BSYogWiE.js +0 -36
- package/dist/warning-circle-Cgp2BW3m.js +0 -16
- package/dist/x-BJinLpTw.js +0 -16
|
@@ -0,0 +1,820 @@
|
|
|
1
|
+
import { c_ as Y, cX as g, df as W, cM as K, cY as c, d8 as _, di as V, dC as G, cU as R, cV as z, cW as B, cL as N, cE as m, dD as j, d2 as k, d3 as C, d4 as h, d1 as L, dE as X, dF as v, cG as D, cF as O, cH as q, d0 as Q } from "./index-D_8VUmn1.js";
|
|
2
|
+
import { r as l, c as w, n as d } from "./index-CEqcN8QP.js";
|
|
3
|
+
import "./index-I7VDqINw.js";
|
|
4
|
+
import { e as Z, n as J } from "./ref-CpgjXAw7.js";
|
|
5
|
+
import "./index-CmAv0Tzr.js";
|
|
6
|
+
import { H as I } from "./HelpersUtil-DfMFC7Bf.js";
|
|
7
|
+
import { o as ee } from "./if-defined-CdZSZ6UL.js";
|
|
8
|
+
import "./index-C4M5s_AM.js";
|
|
9
|
+
import "./index-BEswjY9r.js";
|
|
10
|
+
import "./index-Oz72I9VP.js";
|
|
11
|
+
import "./index-UclsHkJ0.js";
|
|
12
|
+
import "./index-X8zir_1j.js";
|
|
13
|
+
import { N as te } from "./NavigationUtil-kj9LEOOd.js";
|
|
14
|
+
const ie = Y`
|
|
15
|
+
div {
|
|
16
|
+
width: 100%;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
[data-ready='false'] {
|
|
20
|
+
transform: scale(1.05);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@media (max-width: 430px) {
|
|
24
|
+
[data-ready='false'] {
|
|
25
|
+
transform: translateY(-50px);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
`;
|
|
29
|
+
var F = function(e, t, i, r) {
|
|
30
|
+
var n = arguments.length, o = n < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, i) : r, s;
|
|
31
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o = Reflect.decorate(e, t, i, r);
|
|
32
|
+
else for (var a = e.length - 1; a >= 0; a--) (s = e[a]) && (o = (n < 3 ? s(o) : n > 3 ? s(t, i, o) : s(t, i)) || o);
|
|
33
|
+
return n > 3 && o && Object.defineProperty(t, i, o), o;
|
|
34
|
+
};
|
|
35
|
+
const P = 600, M = 360, oe = 64;
|
|
36
|
+
let E = class extends g {
|
|
37
|
+
constructor() {
|
|
38
|
+
super(), this.bodyObserver = void 0, this.unsubscribe = [], this.iframe = document.getElementById("w3m-iframe"), this.ready = !1, this.unsubscribe.push(W.subscribeKey("open", (t) => {
|
|
39
|
+
t || this.onHideIframe();
|
|
40
|
+
}), W.subscribeKey("shake", (t) => {
|
|
41
|
+
t ? this.iframe.style.animation = "w3m-shake 500ms var(--apkt-easings-ease-out-power-2)" : this.iframe.style.animation = "none";
|
|
42
|
+
}));
|
|
43
|
+
}
|
|
44
|
+
disconnectedCallback() {
|
|
45
|
+
var t;
|
|
46
|
+
this.onHideIframe(), this.unsubscribe.forEach((i) => i()), (t = this.bodyObserver) == null || t.unobserve(window.document.body);
|
|
47
|
+
}
|
|
48
|
+
async firstUpdated() {
|
|
49
|
+
var i;
|
|
50
|
+
await this.syncTheme(), this.iframe.style.display = "block";
|
|
51
|
+
const t = (i = this == null ? void 0 : this.renderRoot) == null ? void 0 : i.querySelector("div");
|
|
52
|
+
this.bodyObserver = new ResizeObserver((r) => {
|
|
53
|
+
var s, a;
|
|
54
|
+
const n = (s = r == null ? void 0 : r[0]) == null ? void 0 : s.contentBoxSize, o = (a = n == null ? void 0 : n[0]) == null ? void 0 : a.inlineSize;
|
|
55
|
+
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());
|
|
56
|
+
}), this.bodyObserver.observe(window.document.body);
|
|
57
|
+
}
|
|
58
|
+
render() {
|
|
59
|
+
return c`<div data-ready=${this.ready} id="w3m-frame-container"></div>`;
|
|
60
|
+
}
|
|
61
|
+
onShowIframe() {
|
|
62
|
+
const t = window.innerWidth <= 430;
|
|
63
|
+
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)";
|
|
64
|
+
}
|
|
65
|
+
onHideIframe() {
|
|
66
|
+
this.iframe.style.display = "none", this.iframe.style.animation = "w3m-iframe-fade-out 200ms var(--apkt-easings-ease-out-power-2)";
|
|
67
|
+
}
|
|
68
|
+
async syncTheme() {
|
|
69
|
+
const t = _.getAuthConnector();
|
|
70
|
+
if (t) {
|
|
71
|
+
const i = V.getSnapshot().themeMode, r = V.getSnapshot().themeVariables;
|
|
72
|
+
await t.provider.syncTheme({
|
|
73
|
+
themeVariables: r,
|
|
74
|
+
w3mThemeVariables: G(r, i)
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
async updateFrameSizeForEmbeddedMode() {
|
|
79
|
+
var r;
|
|
80
|
+
const t = (r = this == null ? void 0 : this.renderRoot) == null ? void 0 : r.querySelector("div");
|
|
81
|
+
await new Promise((n) => {
|
|
82
|
+
setTimeout(n, 300);
|
|
83
|
+
});
|
|
84
|
+
const i = this.getBoundingClientRect();
|
|
85
|
+
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();
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
E.styles = ie;
|
|
89
|
+
F([
|
|
90
|
+
l()
|
|
91
|
+
], E.prototype, "ready", void 0);
|
|
92
|
+
E = F([
|
|
93
|
+
w("w3m-approve-transaction-view")
|
|
94
|
+
], E);
|
|
95
|
+
const re = R`
|
|
96
|
+
a {
|
|
97
|
+
border: none;
|
|
98
|
+
border-radius: ${({ borderRadius: e }) => e[20]};
|
|
99
|
+
display: flex;
|
|
100
|
+
flex-direction: row;
|
|
101
|
+
align-items: center;
|
|
102
|
+
padding: ${({ spacing: e }) => e[1]};
|
|
103
|
+
transition:
|
|
104
|
+
background-color ${({ durations: e }) => e.lg}
|
|
105
|
+
${({ easings: e }) => e["ease-out-power-2"]},
|
|
106
|
+
box-shadow ${({ durations: e }) => e.lg}
|
|
107
|
+
${({ easings: e }) => e["ease-out-power-2"]},
|
|
108
|
+
border ${({ durations: e }) => e.lg} ${({ easings: e }) => e["ease-out-power-2"]};
|
|
109
|
+
will-change: background-color, box-shadow, border;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/* -- Variants --------------------------------------------------------------- */
|
|
113
|
+
a[data-type='success'] {
|
|
114
|
+
background-color: ${({ tokens: e }) => e.core.backgroundSuccess};
|
|
115
|
+
color: ${({ tokens: e }) => e.core.textSuccess};
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
a[data-type='error'] {
|
|
119
|
+
background-color: ${({ tokens: e }) => e.core.backgroundError};
|
|
120
|
+
color: ${({ tokens: e }) => e.core.textError};
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
a[data-type='warning'] {
|
|
124
|
+
background-color: ${({ tokens: e }) => e.core.backgroundWarning};
|
|
125
|
+
color: ${({ tokens: e }) => e.core.textWarning};
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/* -- Sizes --------------------------------------------------------------- */
|
|
129
|
+
a[data-size='sm'] {
|
|
130
|
+
height: 24px;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
a[data-size='md'] {
|
|
134
|
+
height: 28px;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
a[data-size='lg'] {
|
|
138
|
+
height: 32px;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
a[data-size='sm'] > wui-image,
|
|
142
|
+
a[data-size='sm'] > wui-icon {
|
|
143
|
+
width: 16px;
|
|
144
|
+
height: 16px;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
a[data-size='md'] > wui-image,
|
|
148
|
+
a[data-size='md'] > wui-icon {
|
|
149
|
+
width: 20px;
|
|
150
|
+
height: 20px;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
a[data-size='lg'] > wui-image,
|
|
154
|
+
a[data-size='lg'] > wui-icon {
|
|
155
|
+
width: 24px;
|
|
156
|
+
height: 24px;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
wui-text {
|
|
160
|
+
padding-left: ${({ spacing: e }) => e[1]};
|
|
161
|
+
padding-right: ${({ spacing: e }) => e[1]};
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
wui-image {
|
|
165
|
+
border-radius: ${({ borderRadius: e }) => e[3]};
|
|
166
|
+
overflow: hidden;
|
|
167
|
+
user-drag: none;
|
|
168
|
+
user-select: none;
|
|
169
|
+
-moz-user-select: none;
|
|
170
|
+
-webkit-user-drag: none;
|
|
171
|
+
-webkit-user-select: none;
|
|
172
|
+
-ms-user-select: none;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/* -- States --------------------------------------------------------------- */
|
|
176
|
+
@media (hover: hover) and (pointer: fine) {
|
|
177
|
+
a[data-type='success']:not(:disabled):hover {
|
|
178
|
+
background-color: ${({ tokens: e }) => e.theme.foregroundPrimary};
|
|
179
|
+
box-shadow: 0px 0px 0px 1px ${({ tokens: e }) => e.core.borderSuccess};
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
a[data-type='error']:not(:disabled):hover {
|
|
183
|
+
background-color: ${({ tokens: e }) => e.theme.foregroundPrimary};
|
|
184
|
+
box-shadow: 0px 0px 0px 1px ${({ tokens: e }) => e.core.borderError};
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
a[data-type='warning']:not(:disabled):hover {
|
|
188
|
+
background-color: ${({ tokens: e }) => e.theme.foregroundPrimary};
|
|
189
|
+
box-shadow: 0px 0px 0px 1px ${({ tokens: e }) => e.core.borderWarning};
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
a[data-type='success']: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[data-type='error']:not(:disabled):focus-visible {
|
|
200
|
+
box-shadow:
|
|
201
|
+
0px 0px 0px 1px ${({ tokens: e }) => e.core.backgroundAccentPrimary},
|
|
202
|
+
0px 0px 0px 4px ${({ tokens: e }) => e.core.foregroundAccent020};
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
a[data-type='warning']:not(:disabled):focus-visible {
|
|
206
|
+
box-shadow:
|
|
207
|
+
0px 0px 0px 1px ${({ tokens: e }) => e.core.backgroundAccentPrimary},
|
|
208
|
+
0px 0px 0px 4px ${({ tokens: e }) => e.core.foregroundAccent020};
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
a:disabled {
|
|
212
|
+
opacity: 0.5;
|
|
213
|
+
}
|
|
214
|
+
`;
|
|
215
|
+
var y = function(e, t, i, r) {
|
|
216
|
+
var n = arguments.length, o = n < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, i) : r, s;
|
|
217
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o = Reflect.decorate(e, t, i, r);
|
|
218
|
+
else for (var a = e.length - 1; a >= 0; a--) (s = e[a]) && (o = (n < 3 ? s(o) : n > 3 ? s(t, i, o) : s(t, i)) || o);
|
|
219
|
+
return n > 3 && o && Object.defineProperty(t, i, o), o;
|
|
220
|
+
};
|
|
221
|
+
const ne = {
|
|
222
|
+
sm: "md-regular",
|
|
223
|
+
md: "lg-regular",
|
|
224
|
+
lg: "lg-regular"
|
|
225
|
+
}, se = {
|
|
226
|
+
success: "sealCheck",
|
|
227
|
+
error: "warning",
|
|
228
|
+
warning: "exclamationCircle"
|
|
229
|
+
};
|
|
230
|
+
let u = class extends g {
|
|
231
|
+
constructor() {
|
|
232
|
+
super(...arguments), this.type = "success", this.size = "md", this.imageSrc = void 0, this.disabled = !1, this.href = "", this.text = void 0;
|
|
233
|
+
}
|
|
234
|
+
render() {
|
|
235
|
+
return c`
|
|
236
|
+
<a
|
|
237
|
+
rel="noreferrer"
|
|
238
|
+
target="_blank"
|
|
239
|
+
href=${this.href}
|
|
240
|
+
class=${this.disabled ? "disabled" : ""}
|
|
241
|
+
data-type=${this.type}
|
|
242
|
+
data-size=${this.size}
|
|
243
|
+
>
|
|
244
|
+
${this.imageTemplate()}
|
|
245
|
+
<wui-text variant=${ne[this.size]} color="inherit">${this.text}</wui-text>
|
|
246
|
+
</a>
|
|
247
|
+
`;
|
|
248
|
+
}
|
|
249
|
+
imageTemplate() {
|
|
250
|
+
return this.imageSrc ? c`<wui-image src=${this.imageSrc} size="inherit"></wui-image>` : c`<wui-icon
|
|
251
|
+
name=${se[this.type]}
|
|
252
|
+
weight="fill"
|
|
253
|
+
color="inherit"
|
|
254
|
+
size="inherit"
|
|
255
|
+
class="image-icon"
|
|
256
|
+
></wui-icon>`;
|
|
257
|
+
}
|
|
258
|
+
};
|
|
259
|
+
u.styles = [z, B, re];
|
|
260
|
+
y([
|
|
261
|
+
d()
|
|
262
|
+
], u.prototype, "type", void 0);
|
|
263
|
+
y([
|
|
264
|
+
d()
|
|
265
|
+
], u.prototype, "size", void 0);
|
|
266
|
+
y([
|
|
267
|
+
d()
|
|
268
|
+
], u.prototype, "imageSrc", void 0);
|
|
269
|
+
y([
|
|
270
|
+
d({ type: Boolean })
|
|
271
|
+
], u.prototype, "disabled", void 0);
|
|
272
|
+
y([
|
|
273
|
+
d()
|
|
274
|
+
], u.prototype, "href", void 0);
|
|
275
|
+
y([
|
|
276
|
+
d()
|
|
277
|
+
], u.prototype, "text", void 0);
|
|
278
|
+
u = y([
|
|
279
|
+
w("wui-semantic-chip")
|
|
280
|
+
], u);
|
|
281
|
+
var ae = function(e, t, i, r) {
|
|
282
|
+
var n = arguments.length, o = n < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, i) : r, s;
|
|
283
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o = Reflect.decorate(e, t, i, r);
|
|
284
|
+
else for (var a = e.length - 1; a >= 0; a--) (s = e[a]) && (o = (n < 3 ? s(o) : n > 3 ? s(t, i, o) : s(t, i)) || o);
|
|
285
|
+
return n > 3 && o && Object.defineProperty(t, i, o), o;
|
|
286
|
+
};
|
|
287
|
+
let H = class extends g {
|
|
288
|
+
render() {
|
|
289
|
+
return c`
|
|
290
|
+
<wui-flex flexDirection="column" alignItems="center" gap="5" padding="5">
|
|
291
|
+
<wui-text variant="md-regular" color="primary">Follow the instructions on</wui-text>
|
|
292
|
+
<wui-semantic-chip
|
|
293
|
+
icon="externalLink"
|
|
294
|
+
variant="fill"
|
|
295
|
+
text=${N.SECURE_SITE_DASHBOARD}
|
|
296
|
+
href=${N.SECURE_SITE_DASHBOARD}
|
|
297
|
+
imageSrc=${N.SECURE_SITE_FAVICON}
|
|
298
|
+
data-testid="w3m-secure-website-button"
|
|
299
|
+
>
|
|
300
|
+
</wui-semantic-chip>
|
|
301
|
+
<wui-text variant="sm-regular" color="secondary">
|
|
302
|
+
You will have to reconnect for security reasons
|
|
303
|
+
</wui-text>
|
|
304
|
+
</wui-flex>
|
|
305
|
+
`;
|
|
306
|
+
}
|
|
307
|
+
};
|
|
308
|
+
H = ae([
|
|
309
|
+
w("w3m-upgrade-wallet-view")
|
|
310
|
+
], H);
|
|
311
|
+
var A = function(e, t, i, r) {
|
|
312
|
+
var n = arguments.length, o = n < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, i) : r, s;
|
|
313
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o = Reflect.decorate(e, t, i, r);
|
|
314
|
+
else for (var a = e.length - 1; a >= 0; a--) (s = e[a]) && (o = (n < 3 ? s(o) : n > 3 ? s(t, i, o) : s(t, i)) || o);
|
|
315
|
+
return n > 3 && o && Object.defineProperty(t, i, o), o;
|
|
316
|
+
};
|
|
317
|
+
let $ = class extends g {
|
|
318
|
+
constructor() {
|
|
319
|
+
super(...arguments), this.loading = !1, this.switched = !1, this.text = "", this.network = m.state.activeCaipNetwork;
|
|
320
|
+
}
|
|
321
|
+
render() {
|
|
322
|
+
return c`
|
|
323
|
+
<wui-flex flexDirection="column" gap="2" .padding=${["6", "4", "3", "4"]}>
|
|
324
|
+
${this.togglePreferredAccountTypeTemplate()} ${this.toggleSmartAccountVersionTemplate()}
|
|
325
|
+
</wui-flex>
|
|
326
|
+
`;
|
|
327
|
+
}
|
|
328
|
+
toggleSmartAccountVersionTemplate() {
|
|
329
|
+
return c`
|
|
330
|
+
<w3m-tooltip-trigger text="Changing the smart account version will reload the page">
|
|
331
|
+
<wui-list-item
|
|
332
|
+
icon=${this.isV6() ? "arrowTop" : "arrowBottom"}
|
|
333
|
+
?rounded=${!0}
|
|
334
|
+
?chevron=${!0}
|
|
335
|
+
data-testid="account-toggle-smart-account-version"
|
|
336
|
+
@click=${this.toggleSmartAccountVersion.bind(this)}
|
|
337
|
+
>
|
|
338
|
+
<wui-text variant="lg-regular" color="primary"
|
|
339
|
+
>Force Smart Account Version ${this.isV6() ? "7" : "6"}</wui-text
|
|
340
|
+
>
|
|
341
|
+
</wui-list-item>
|
|
342
|
+
</w3m-tooltip-trigger>
|
|
343
|
+
`;
|
|
344
|
+
}
|
|
345
|
+
isV6() {
|
|
346
|
+
return (j.get("dapp_smart_account_version") || "v6") === "v6";
|
|
347
|
+
}
|
|
348
|
+
toggleSmartAccountVersion() {
|
|
349
|
+
var t;
|
|
350
|
+
j.set("dapp_smart_account_version", this.isV6() ? "v7" : "v6"), typeof window < "u" && ((t = window == null ? void 0 : window.location) == null || t.reload());
|
|
351
|
+
}
|
|
352
|
+
togglePreferredAccountTypeTemplate() {
|
|
353
|
+
var o;
|
|
354
|
+
const t = (o = this.network) == null ? void 0 : o.chainNamespace, i = m.checkIfSmartAccountEnabled(), r = _.getConnectorId(t);
|
|
355
|
+
return !_.getAuthConnector() || r !== k.CONNECTOR_ID.AUTH || !i ? null : (this.switched || (this.text = C(t) === h.ACCOUNT_TYPES.SMART_ACCOUNT ? "Switch to your EOA" : "Switch to your Smart Account"), c`
|
|
356
|
+
<wui-list-item
|
|
357
|
+
icon="swapHorizontal"
|
|
358
|
+
?rounded=${!0}
|
|
359
|
+
?chevron=${!0}
|
|
360
|
+
?loading=${this.loading}
|
|
361
|
+
@click=${this.changePreferredAccountType.bind(this)}
|
|
362
|
+
data-testid="account-toggle-preferred-account-type"
|
|
363
|
+
>
|
|
364
|
+
<wui-text variant="lg-regular" color="primary">${this.text}</wui-text>
|
|
365
|
+
</wui-list-item>
|
|
366
|
+
`);
|
|
367
|
+
}
|
|
368
|
+
async changePreferredAccountType() {
|
|
369
|
+
var o;
|
|
370
|
+
const t = (o = this.network) == null ? void 0 : o.chainNamespace, i = m.checkIfSmartAccountEnabled(), r = C(t) === h.ACCOUNT_TYPES.SMART_ACCOUNT || !i ? h.ACCOUNT_TYPES.EOA : h.ACCOUNT_TYPES.SMART_ACCOUNT;
|
|
371
|
+
_.getAuthConnector() && (this.loading = !0, await L.setPreferredAccountType(r, t), this.text = r === h.ACCOUNT_TYPES.SMART_ACCOUNT ? "Switch to your EOA" : "Switch to your Smart Account", this.switched = !0, X.resetSend(), this.loading = !1, this.requestUpdate());
|
|
372
|
+
}
|
|
373
|
+
};
|
|
374
|
+
A([
|
|
375
|
+
l()
|
|
376
|
+
], $.prototype, "loading", void 0);
|
|
377
|
+
A([
|
|
378
|
+
l()
|
|
379
|
+
], $.prototype, "switched", void 0);
|
|
380
|
+
A([
|
|
381
|
+
l()
|
|
382
|
+
], $.prototype, "text", void 0);
|
|
383
|
+
A([
|
|
384
|
+
l()
|
|
385
|
+
], $.prototype, "network", void 0);
|
|
386
|
+
$ = A([
|
|
387
|
+
w("w3m-smart-account-settings-view")
|
|
388
|
+
], $);
|
|
389
|
+
const ce = R`
|
|
390
|
+
:host {
|
|
391
|
+
width: 100%;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
button {
|
|
395
|
+
width: 100%;
|
|
396
|
+
display: flex;
|
|
397
|
+
justify-content: space-between;
|
|
398
|
+
align-items: center;
|
|
399
|
+
background-color: ${({ tokens: e }) => e.theme.foregroundPrimary};
|
|
400
|
+
border-radius: ${({ borderRadius: e }) => e[4]};
|
|
401
|
+
padding: ${({ spacing: e }) => e[4]};
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
.name {
|
|
405
|
+
max-width: 75%;
|
|
406
|
+
overflow: hidden;
|
|
407
|
+
text-overflow: ellipsis;
|
|
408
|
+
white-space: nowrap;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
@media (hover: hover) and (pointer: fine) {
|
|
412
|
+
button:hover:enabled {
|
|
413
|
+
cursor: pointer;
|
|
414
|
+
background-color: ${({ tokens: e }) => e.theme.foregroundSecondary};
|
|
415
|
+
border-radius: ${({ borderRadius: e }) => e[6]};
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
button:disabled {
|
|
420
|
+
opacity: 0.5;
|
|
421
|
+
cursor: default;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
button:focus-visible:enabled {
|
|
425
|
+
box-shadow: 0 0 0 4px ${({ tokens: e }) => e.core.foregroundAccent040};
|
|
426
|
+
background-color: ${({ tokens: e }) => e.theme.foregroundSecondary};
|
|
427
|
+
}
|
|
428
|
+
`;
|
|
429
|
+
var T = function(e, t, i, r) {
|
|
430
|
+
var n = arguments.length, o = n < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, i) : r, s;
|
|
431
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o = Reflect.decorate(e, t, i, r);
|
|
432
|
+
else for (var a = e.length - 1; a >= 0; a--) (s = e[a]) && (o = (n < 3 ? s(o) : n > 3 ? s(t, i, o) : s(t, i)) || o);
|
|
433
|
+
return n > 3 && o && Object.defineProperty(t, i, o), o;
|
|
434
|
+
};
|
|
435
|
+
let b = class extends g {
|
|
436
|
+
constructor() {
|
|
437
|
+
super(...arguments), this.name = "", this.registered = !1, this.loading = !1, this.disabled = !1;
|
|
438
|
+
}
|
|
439
|
+
render() {
|
|
440
|
+
return c`
|
|
441
|
+
<button ?disabled=${this.disabled}>
|
|
442
|
+
<wui-text class="name" color="primary" variant="md-regular">${this.name}</wui-text>
|
|
443
|
+
${this.templateRightContent()}
|
|
444
|
+
</button>
|
|
445
|
+
`;
|
|
446
|
+
}
|
|
447
|
+
templateRightContent() {
|
|
448
|
+
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>`;
|
|
449
|
+
}
|
|
450
|
+
};
|
|
451
|
+
b.styles = [z, B, ce];
|
|
452
|
+
T([
|
|
453
|
+
d()
|
|
454
|
+
], b.prototype, "name", void 0);
|
|
455
|
+
T([
|
|
456
|
+
d({ type: Boolean })
|
|
457
|
+
], b.prototype, "registered", void 0);
|
|
458
|
+
T([
|
|
459
|
+
d({ type: Boolean })
|
|
460
|
+
], b.prototype, "loading", void 0);
|
|
461
|
+
T([
|
|
462
|
+
d({ type: Boolean })
|
|
463
|
+
], b.prototype, "disabled", void 0);
|
|
464
|
+
b = T([
|
|
465
|
+
w("wui-account-name-suggestion-item")
|
|
466
|
+
], b);
|
|
467
|
+
const de = R`
|
|
468
|
+
:host {
|
|
469
|
+
position: relative;
|
|
470
|
+
width: 100%;
|
|
471
|
+
display: inline-block;
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
:host([disabled]) {
|
|
475
|
+
opacity: 0.5;
|
|
476
|
+
cursor: not-allowed;
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
.base-name {
|
|
480
|
+
position: absolute;
|
|
481
|
+
right: ${({ spacing: e }) => e[4]};
|
|
482
|
+
top: 50%;
|
|
483
|
+
transform: translateY(-50%);
|
|
484
|
+
text-align: right;
|
|
485
|
+
padding: ${({ spacing: e }) => e[1]};
|
|
486
|
+
background-color: ${({ tokens: e }) => e.theme.foregroundSecondary};
|
|
487
|
+
border-radius: ${({ borderRadius: e }) => e[1]};
|
|
488
|
+
}
|
|
489
|
+
`;
|
|
490
|
+
var S = function(e, t, i, r) {
|
|
491
|
+
var n = arguments.length, o = n < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, i) : r, s;
|
|
492
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o = Reflect.decorate(e, t, i, r);
|
|
493
|
+
else for (var a = e.length - 1; a >= 0; a--) (s = e[a]) && (o = (n < 3 ? s(o) : n > 3 ? s(t, i, o) : s(t, i)) || o);
|
|
494
|
+
return n > 3 && o && Object.defineProperty(t, i, o), o;
|
|
495
|
+
};
|
|
496
|
+
let f = class extends g {
|
|
497
|
+
constructor() {
|
|
498
|
+
super(...arguments), this.disabled = !1, this.loading = !1;
|
|
499
|
+
}
|
|
500
|
+
render() {
|
|
501
|
+
return c`
|
|
502
|
+
<wui-input-text
|
|
503
|
+
value=${ee(this.value)}
|
|
504
|
+
?disabled=${this.disabled}
|
|
505
|
+
.value=${this.value || ""}
|
|
506
|
+
data-testid="wui-ens-input"
|
|
507
|
+
icon="search"
|
|
508
|
+
inputRightPadding="5xl"
|
|
509
|
+
.onKeyDown=${this.onKeyDown}
|
|
510
|
+
></wui-input-text>
|
|
511
|
+
`;
|
|
512
|
+
}
|
|
513
|
+
};
|
|
514
|
+
f.styles = [z, de];
|
|
515
|
+
S([
|
|
516
|
+
d()
|
|
517
|
+
], f.prototype, "errorMessage", void 0);
|
|
518
|
+
S([
|
|
519
|
+
d({ type: Boolean })
|
|
520
|
+
], f.prototype, "disabled", void 0);
|
|
521
|
+
S([
|
|
522
|
+
d()
|
|
523
|
+
], f.prototype, "value", void 0);
|
|
524
|
+
S([
|
|
525
|
+
d({ type: Boolean })
|
|
526
|
+
], f.prototype, "loading", void 0);
|
|
527
|
+
S([
|
|
528
|
+
d({ attribute: !1 })
|
|
529
|
+
], f.prototype, "onKeyDown", void 0);
|
|
530
|
+
f = S([
|
|
531
|
+
w("wui-ens-input")
|
|
532
|
+
], f);
|
|
533
|
+
const le = R`
|
|
534
|
+
wui-flex {
|
|
535
|
+
width: 100%;
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
.suggestion {
|
|
539
|
+
background-color: ${({ tokens: e }) => e.theme.foregroundPrimary};
|
|
540
|
+
border-radius: ${({ borderRadius: e }) => e[4]};
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
.suggestion:hover:not(:disabled) {
|
|
544
|
+
cursor: pointer;
|
|
545
|
+
border: none;
|
|
546
|
+
width: 100%;
|
|
547
|
+
display: flex;
|
|
548
|
+
justify-content: space-between;
|
|
549
|
+
align-items: center;
|
|
550
|
+
background-color: ${({ tokens: e }) => e.theme.foregroundSecondary};
|
|
551
|
+
border-radius: ${({ borderRadius: e }) => e[6]};
|
|
552
|
+
padding: ${({ spacing: e }) => e[4]};
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
.suggestion:disabled {
|
|
556
|
+
opacity: 0.5;
|
|
557
|
+
cursor: default;
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
.suggestion:focus-visible:not(:disabled) {
|
|
561
|
+
box-shadow: 0 0 0 4px ${({ tokens: e }) => e.core.foregroundAccent040};
|
|
562
|
+
background-color: ${({ tokens: e }) => e.theme.foregroundSecondary};
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
.suggested-name {
|
|
566
|
+
max-width: 75%;
|
|
567
|
+
overflow: hidden;
|
|
568
|
+
text-overflow: ellipsis;
|
|
569
|
+
white-space: nowrap;
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
form {
|
|
573
|
+
width: 100%;
|
|
574
|
+
position: relative;
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
.input-submit-button,
|
|
578
|
+
.input-loading-spinner {
|
|
579
|
+
position: absolute;
|
|
580
|
+
top: 22px;
|
|
581
|
+
transform: translateY(-50%);
|
|
582
|
+
right: 10px;
|
|
583
|
+
}
|
|
584
|
+
`;
|
|
585
|
+
var x = function(e, t, i, r) {
|
|
586
|
+
var n = arguments.length, o = n < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, i) : r, s;
|
|
587
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o = Reflect.decorate(e, t, i, r);
|
|
588
|
+
else for (var a = e.length - 1; a >= 0; a--) (s = e[a]) && (o = (n < 3 ? s(o) : n > 3 ? s(t, i, o) : s(t, i)) || o);
|
|
589
|
+
return n > 3 && o && Object.defineProperty(t, i, o), o;
|
|
590
|
+
};
|
|
591
|
+
let p = class extends g {
|
|
592
|
+
constructor() {
|
|
593
|
+
var t;
|
|
594
|
+
super(), this.formRef = Z(), this.usubscribe = [], this.name = "", this.error = "", this.loading = v.state.loading, this.suggestions = v.state.suggestions, this.profileName = (t = m.getAccountData()) == null ? void 0 : t.profileName, this.onDebouncedNameInputChange = D.debounce((i) => {
|
|
595
|
+
i.length < 4 ? this.error = "Name must be at least 4 characters long" : I.isValidReownName(i) ? (this.error = "", v.getSuggestions(i)) : this.error = "The value is not a valid username";
|
|
596
|
+
}), this.usubscribe.push(v.subscribe((i) => {
|
|
597
|
+
this.suggestions = i.suggestions, this.loading = i.loading;
|
|
598
|
+
}), m.subscribeChainProp("accountState", (i) => {
|
|
599
|
+
this.profileName = i == null ? void 0 : i.profileName, i != null && i.profileName && (this.error = "You already own a name");
|
|
600
|
+
}));
|
|
601
|
+
}
|
|
602
|
+
firstUpdated() {
|
|
603
|
+
var t;
|
|
604
|
+
(t = this.formRef.value) == null || t.addEventListener("keydown", this.onEnterKey.bind(this));
|
|
605
|
+
}
|
|
606
|
+
disconnectedCallback() {
|
|
607
|
+
var t;
|
|
608
|
+
super.disconnectedCallback(), this.usubscribe.forEach((i) => i()), (t = this.formRef.value) == null || t.removeEventListener("keydown", this.onEnterKey.bind(this));
|
|
609
|
+
}
|
|
610
|
+
render() {
|
|
611
|
+
return c`
|
|
612
|
+
<wui-flex
|
|
613
|
+
flexDirection="column"
|
|
614
|
+
alignItems="center"
|
|
615
|
+
gap="4"
|
|
616
|
+
.padding=${["1", "3", "4", "3"]}
|
|
617
|
+
>
|
|
618
|
+
<form ${J(this.formRef)} @submit=${this.onSubmitName.bind(this)}>
|
|
619
|
+
<wui-ens-input
|
|
620
|
+
@inputChange=${this.onNameInputChange.bind(this)}
|
|
621
|
+
.errorMessage=${this.error}
|
|
622
|
+
.value=${this.name}
|
|
623
|
+
.onKeyDown=${this.onKeyDown.bind(this)}
|
|
624
|
+
>
|
|
625
|
+
</wui-ens-input>
|
|
626
|
+
${this.submitButtonTemplate()}
|
|
627
|
+
<input type="submit" hidden />
|
|
628
|
+
</form>
|
|
629
|
+
${this.templateSuggestions()}
|
|
630
|
+
</wui-flex>
|
|
631
|
+
`;
|
|
632
|
+
}
|
|
633
|
+
submitButtonTemplate() {
|
|
634
|
+
const t = this.suggestions.find((r) => {
|
|
635
|
+
var n, o;
|
|
636
|
+
return ((o = (n = r.name) == null ? void 0 : n.split(".")) == null ? void 0 : o[0]) === this.name && r.registered;
|
|
637
|
+
});
|
|
638
|
+
if (this.loading)
|
|
639
|
+
return c`<wui-loading-spinner
|
|
640
|
+
class="input-loading-spinner"
|
|
641
|
+
color="secondary"
|
|
642
|
+
></wui-loading-spinner>`;
|
|
643
|
+
const i = `${this.name}${k.WC_NAME_SUFFIX}`;
|
|
644
|
+
return c`
|
|
645
|
+
<wui-icon-link
|
|
646
|
+
?disabled=${!!t}
|
|
647
|
+
class="input-submit-button"
|
|
648
|
+
size="sm"
|
|
649
|
+
icon="chevronRight"
|
|
650
|
+
iconColor=${t ? "default" : "accent-primary"}
|
|
651
|
+
@click=${() => this.onSubmitName(i)}
|
|
652
|
+
>
|
|
653
|
+
</wui-icon-link>
|
|
654
|
+
`;
|
|
655
|
+
}
|
|
656
|
+
onNameInputChange(t) {
|
|
657
|
+
const i = I.validateReownName(t.detail || "");
|
|
658
|
+
this.name = i, this.onDebouncedNameInputChange(i);
|
|
659
|
+
}
|
|
660
|
+
onKeyDown(t) {
|
|
661
|
+
t.key.length === 1 && !I.isValidReownName(t.key) && t.preventDefault();
|
|
662
|
+
}
|
|
663
|
+
templateSuggestions() {
|
|
664
|
+
return !this.name || this.name.length < 4 || this.error ? null : c`<wui-flex flexDirection="column" gap="1" alignItems="center">
|
|
665
|
+
${this.suggestions.map((t) => c`<wui-account-name-suggestion-item
|
|
666
|
+
name=${t.name}
|
|
667
|
+
?registered=${t.registered}
|
|
668
|
+
?loading=${this.loading}
|
|
669
|
+
?disabled=${t.registered || this.loading}
|
|
670
|
+
data-testid="account-name-suggestion"
|
|
671
|
+
@click=${() => this.onSubmitName(t.name)}
|
|
672
|
+
></wui-account-name-suggestion-item>`)}
|
|
673
|
+
</wui-flex>`;
|
|
674
|
+
}
|
|
675
|
+
isAllowedToSubmit(t) {
|
|
676
|
+
var n;
|
|
677
|
+
const i = (n = t.split(".")) == null ? void 0 : n[0], r = this.suggestions.find((o) => {
|
|
678
|
+
var s, a;
|
|
679
|
+
return ((a = (s = o.name) == null ? void 0 : s.split(".")) == null ? void 0 : a[0]) === i && o.registered;
|
|
680
|
+
});
|
|
681
|
+
return !this.loading && !this.error && !this.profileName && i && v.validateName(i) && !r;
|
|
682
|
+
}
|
|
683
|
+
async onSubmitName(t) {
|
|
684
|
+
try {
|
|
685
|
+
if (!this.isAllowedToSubmit(t))
|
|
686
|
+
return;
|
|
687
|
+
O.sendEvent({
|
|
688
|
+
type: "track",
|
|
689
|
+
event: "REGISTER_NAME_INITIATED",
|
|
690
|
+
properties: {
|
|
691
|
+
isSmartAccount: C(m.state.activeChain) === h.ACCOUNT_TYPES.SMART_ACCOUNT,
|
|
692
|
+
ensName: t
|
|
693
|
+
}
|
|
694
|
+
}), await v.registerName(t), O.sendEvent({
|
|
695
|
+
type: "track",
|
|
696
|
+
event: "REGISTER_NAME_SUCCESS",
|
|
697
|
+
properties: {
|
|
698
|
+
isSmartAccount: C(m.state.activeChain) === h.ACCOUNT_TYPES.SMART_ACCOUNT,
|
|
699
|
+
ensName: t
|
|
700
|
+
}
|
|
701
|
+
});
|
|
702
|
+
} catch (i) {
|
|
703
|
+
q.showError(i.message), O.sendEvent({
|
|
704
|
+
type: "track",
|
|
705
|
+
event: "REGISTER_NAME_ERROR",
|
|
706
|
+
properties: {
|
|
707
|
+
isSmartAccount: C(m.state.activeChain) === h.ACCOUNT_TYPES.SMART_ACCOUNT,
|
|
708
|
+
ensName: t,
|
|
709
|
+
error: D.parseError(i)
|
|
710
|
+
}
|
|
711
|
+
});
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
onEnterKey(t) {
|
|
715
|
+
if (t.key === "Enter" && this.name && this.isAllowedToSubmit(this.name)) {
|
|
716
|
+
const i = `${this.name}${k.WC_NAME_SUFFIX}`;
|
|
717
|
+
this.onSubmitName(i);
|
|
718
|
+
}
|
|
719
|
+
}
|
|
720
|
+
};
|
|
721
|
+
p.styles = le;
|
|
722
|
+
x([
|
|
723
|
+
d()
|
|
724
|
+
], p.prototype, "errorMessage", void 0);
|
|
725
|
+
x([
|
|
726
|
+
l()
|
|
727
|
+
], p.prototype, "name", void 0);
|
|
728
|
+
x([
|
|
729
|
+
l()
|
|
730
|
+
], p.prototype, "error", void 0);
|
|
731
|
+
x([
|
|
732
|
+
l()
|
|
733
|
+
], p.prototype, "loading", void 0);
|
|
734
|
+
x([
|
|
735
|
+
l()
|
|
736
|
+
], p.prototype, "suggestions", void 0);
|
|
737
|
+
x([
|
|
738
|
+
l()
|
|
739
|
+
], p.prototype, "profileName", void 0);
|
|
740
|
+
p = x([
|
|
741
|
+
w("w3m-register-account-name-view")
|
|
742
|
+
], p);
|
|
743
|
+
const ue = Y`
|
|
744
|
+
.continue-button-container {
|
|
745
|
+
width: 100%;
|
|
746
|
+
}
|
|
747
|
+
`;
|
|
748
|
+
var pe = function(e, t, i, r) {
|
|
749
|
+
var n = arguments.length, o = n < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, i) : r, s;
|
|
750
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o = Reflect.decorate(e, t, i, r);
|
|
751
|
+
else for (var a = e.length - 1; a >= 0; a--) (s = e[a]) && (o = (n < 3 ? s(o) : n > 3 ? s(t, i, o) : s(t, i)) || o);
|
|
752
|
+
return n > 3 && o && Object.defineProperty(t, i, o), o;
|
|
753
|
+
};
|
|
754
|
+
let U = class extends g {
|
|
755
|
+
render() {
|
|
756
|
+
return c`
|
|
757
|
+
<wui-flex
|
|
758
|
+
flexDirection="column"
|
|
759
|
+
alignItems="center"
|
|
760
|
+
gap="6"
|
|
761
|
+
.padding=${["0", "0", "4", "0"]}
|
|
762
|
+
>
|
|
763
|
+
${this.onboardingTemplate()} ${this.buttonsTemplate()}
|
|
764
|
+
<wui-link
|
|
765
|
+
@click=${() => {
|
|
766
|
+
D.openHref(te.URLS.FAQ, "_blank");
|
|
767
|
+
}}
|
|
768
|
+
>
|
|
769
|
+
Learn more
|
|
770
|
+
<wui-icon color="inherit" slot="iconRight" name="externalLink"></wui-icon>
|
|
771
|
+
</wui-link>
|
|
772
|
+
</wui-flex>
|
|
773
|
+
`;
|
|
774
|
+
}
|
|
775
|
+
onboardingTemplate() {
|
|
776
|
+
return c` <wui-flex
|
|
777
|
+
flexDirection="column"
|
|
778
|
+
gap="6"
|
|
779
|
+
alignItems="center"
|
|
780
|
+
.padding=${["0", "6", "0", "6"]}
|
|
781
|
+
>
|
|
782
|
+
<wui-flex gap="3" alignItems="center" justifyContent="center">
|
|
783
|
+
<wui-icon-box size="xl" color="success" icon="checkmark"></wui-icon-box>
|
|
784
|
+
</wui-flex>
|
|
785
|
+
<wui-flex flexDirection="column" alignItems="center" gap="3">
|
|
786
|
+
<wui-text align="center" variant="md-medium" color="primary">
|
|
787
|
+
Account name chosen successfully
|
|
788
|
+
</wui-text>
|
|
789
|
+
<wui-text align="center" variant="md-regular" color="primary">
|
|
790
|
+
You can now fund your account and trade crypto
|
|
791
|
+
</wui-text>
|
|
792
|
+
</wui-flex>
|
|
793
|
+
</wui-flex>`;
|
|
794
|
+
}
|
|
795
|
+
buttonsTemplate() {
|
|
796
|
+
return c`<wui-flex
|
|
797
|
+
.padding=${["0", "4", "0", "4"]}
|
|
798
|
+
gap="3"
|
|
799
|
+
class="continue-button-container"
|
|
800
|
+
>
|
|
801
|
+
<wui-button fullWidth size="lg" borderRadius="xs" @click=${this.redirectToAccount.bind(this)}
|
|
802
|
+
>Let's Go!
|
|
803
|
+
</wui-button>
|
|
804
|
+
</wui-flex>`;
|
|
805
|
+
}
|
|
806
|
+
redirectToAccount() {
|
|
807
|
+
Q.replace("Account");
|
|
808
|
+
}
|
|
809
|
+
};
|
|
810
|
+
U.styles = ue;
|
|
811
|
+
U = pe([
|
|
812
|
+
w("w3m-register-account-name-success-view")
|
|
813
|
+
], U);
|
|
814
|
+
export {
|
|
815
|
+
E as W3mApproveTransactionView,
|
|
816
|
+
U as W3mRegisterAccountNameSuccess,
|
|
817
|
+
p as W3mRegisterAccountNameView,
|
|
818
|
+
$ as W3mSmartAccountSettingsView,
|
|
819
|
+
H as W3mUpgradeWalletView
|
|
820
|
+
};
|