browser-rpc 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/index.js +4187 -0
- package/package.json +34 -0
- package/web-dist/assets/Arc-R3PUWRPJ-CUdEQO8X.js +1 -0
- package/web-dist/assets/Brave-24BM36UM-C6C5mkTK.js +1 -0
- package/web-dist/assets/Browser-4R4QKTV2-D3ON1q-S.js +1 -0
- package/web-dist/assets/Chrome-TLI42HDP-BgiVz-ma.js +1 -0
- package/web-dist/assets/Edge-AZ34LAFM-EBh9cG_z.js +1 -0
- package/web-dist/assets/Firefox-ZDK7RHKK-5nyhB0sj.js +1 -0
- package/web-dist/assets/Linux-VYP66PDO--MOvpQUa.js +1 -0
- package/web-dist/assets/Macos-5QL4JBJE-DLNYPiln.js +1 -0
- package/web-dist/assets/Opera-BKMCKUXC-CCypmVaM.js +1 -0
- package/web-dist/assets/Safari-PXQIVS6N-B-Lfxb9r.js +1 -0
- package/web-dist/assets/Windows-GTAT3OTE-K9Pt3pUF.js +1 -0
- package/web-dist/assets/add-Bt6ug9as.js +15 -0
- package/web-dist/assets/all-wallets-ClkSG7YV.js +6 -0
- package/web-dist/assets/app-store-BnzgCmML.js +17 -0
- package/web-dist/assets/apple-D3CNMHuT.js +18 -0
- package/web-dist/assets/ar_AR-ZRPPM56D-d2WEfzQ_.js +1349 -0
- package/web-dist/assets/arbitrum-IA4OWRTN-B0aI2PBQ.js +1 -0
- package/web-dist/assets/arrow-bottom-BrYwqDZR.js +8 -0
- package/web-dist/assets/arrow-bottom-circle-CBoHFkqN.js +11 -0
- package/web-dist/assets/arrow-left-CHVgplmz.js +8 -0
- package/web-dist/assets/arrow-right-Do5EdrXQ.js +8 -0
- package/web-dist/assets/arrow-top-BOPLd2d5.js +8 -0
- package/web-dist/assets/assets-NU2OP443-COMs-Mo6.js +1 -0
- package/web-dist/assets/avalanche-MXEFEDSW-DcC5FNt3.js +1 -0
- package/web-dist/assets/bank-DafdJl1O.js +14 -0
- package/web-dist/assets/base-Z4LFBE5D-DHfqMzJC.js +1 -0
- package/web-dist/assets/basic-CLeG2Fx1.js +2124 -0
- package/web-dist/assets/blast-TN2WIMWF-BUZNbRBy.js +1 -0
- package/web-dist/assets/browser-DRuHXezx.js +14 -0
- package/web-dist/assets/bsc-RVE67I5L-DVYEF0vl.js +1 -0
- package/web-dist/assets/card-YgaTGJnf.js +14 -0
- package/web-dist/assets/ccip-B4x4TU0w.js +1 -0
- package/web-dist/assets/ccip-ConwrR6S.js +1 -0
- package/web-dist/assets/celo-E6XU57FO-C5IguUgF.js +1 -0
- package/web-dist/assets/checkmark-Dgr_oUfC.js +11 -0
- package/web-dist/assets/checkmark-bold-b4BEKMa-.js +8 -0
- package/web-dist/assets/chevron-bottom-BlzLXicX.js +8 -0
- package/web-dist/assets/chevron-left-DWsjEedN.js +8 -0
- package/web-dist/assets/chevron-right-B-GnUH_e.js +8 -0
- package/web-dist/assets/chevron-top-lK6t2THp.js +8 -0
- package/web-dist/assets/chrome-store-CbBGk8YS.js +61 -0
- package/web-dist/assets/clock-ByEA0e_s.js +8 -0
- package/web-dist/assets/close-BxDaavrr.js +8 -0
- package/web-dist/assets/coinPlaceholder-B9aaOU5j.js +8 -0
- package/web-dist/assets/coinbaseWallet-WWX6LF36-BMRj6mTC.js +1 -0
- package/web-dist/assets/compass-CBP6oSW9.js +8 -0
- package/web-dist/assets/connect-MR6XDLIE-BET5HMNk.js +1 -0
- package/web-dist/assets/copy-Dp304nbr.js +15 -0
- package/web-dist/assets/core-Bf6VrE6v.js +896 -0
- package/web-dist/assets/create-X4WFHLCW-De9pC3ym.js +1 -0
- package/web-dist/assets/cronos-ROYR77VZ-Prn3LRPZ.js +1 -0
- package/web-dist/assets/cursor-WUohjLCE.js +3 -0
- package/web-dist/assets/cursor-transparent-CutfCQQz.js +12 -0
- package/web-dist/assets/de_DE-GYZFZXWH-CYZf24IR.js +1349 -0
- package/web-dist/assets/desktop-kZiy9C-p.js +9 -0
- package/web-dist/assets/disconnect-CG5TDY_m.js +8 -0
- package/web-dist/assets/discord-JyHSI7q0.js +17 -0
- package/web-dist/assets/es_419-OGVOQEFZ-D6BJPTeQ.js +1349 -0
- package/web-dist/assets/ethereum-RFBAMUVK-WsW8NXqo.js +1 -0
- package/web-dist/assets/etherscan-CyB1NBm9.js +6 -0
- package/web-dist/assets/events-DQ172AOg.js +1 -0
- package/web-dist/assets/exclamation-triangle-7y5nglSL.js +4 -0
- package/web-dist/assets/extension-BjB3--xE.js +8 -0
- package/web-dist/assets/external-link-BW0O7z6_.js +8 -0
- package/web-dist/assets/facebook-682BXGmP.js +26 -0
- package/web-dist/assets/farcaster-BOaaCMAh.js +12 -0
- package/web-dist/assets/filters-DFWbfLJh.js +8 -0
- package/web-dist/assets/flow-NBCRNYVF-D2XasjKk.js +1 -0
- package/web-dist/assets/fr_FR-Q5QBQBX2-lQoTmpTH.js +1349 -0
- package/web-dist/assets/github-DpRqYyal.js +18 -0
- package/web-dist/assets/gnosis-T7U5EW2Q-CoPEM_sI.js +1 -0
- package/web-dist/assets/google-CgUt7hYq.js +18 -0
- package/web-dist/assets/hardhat-NEEC6JX7-DzuWQYyS.js +1 -0
- package/web-dist/assets/help-circle-DwVgKpjs.js +12 -0
- package/web-dist/assets/hi_IN-7I7LRHGW-CTQjmeYe.js +1349 -0
- package/web-dist/assets/id-BaTvs6Gs.js +12 -0
- package/web-dist/assets/id_ID-ZMGZ2JFV-CgKQKAmU.js +1349 -0
- package/web-dist/assets/image-BieDxoY2.js +4 -0
- package/web-dist/assets/index-Burh8TwV.js +47 -0
- package/web-dist/assets/index-C4Lbscxg.js +1532 -0
- package/web-dist/assets/index-C5m0fBnu.js +7 -0
- package/web-dist/assets/index-CteTNahN.js +50 -0
- package/web-dist/assets/index-DgKl8WD4.js +9 -0
- package/web-dist/assets/index-GJH9xypQ.css +1 -0
- package/web-dist/assets/index-My90LZL7.js +1 -0
- package/web-dist/assets/index-aVimijSo.js +359 -0
- package/web-dist/assets/index.es-Me6_HSoS.js +13 -0
- package/web-dist/assets/info-CaUhPhOk.js +3 -0
- package/web-dist/assets/info-circle-Dgdf-_kY.js +12 -0
- package/web-dist/assets/ja_JP-NYBCHQTZ-CMaBl8Za.js +1349 -0
- package/web-dist/assets/klaytn-QTDBZIB3-DyuKTpxX.js +1 -0
- package/web-dist/assets/ko_KR-67WE736M-DHWhIjcm.js +1349 -0
- package/web-dist/assets/lightbulb-h5NbP99t.js +3 -0
- package/web-dist/assets/login-CWDTIDNK-DhDUYE4b.js +1 -0
- package/web-dist/assets/mail-DUTW6gdU.js +8 -0
- package/web-dist/assets/manta-5V6W5D7G-BnjsGzeJ.js +1 -0
- package/web-dist/assets/mantle-KBL3OIYT-DIpe0poV.js +1 -0
- package/web-dist/assets/metaMaskWallet-YFHEHW7V-BggUDXad.js +1 -0
- package/web-dist/assets/mobile-BFFFlSgH.js +9 -0
- package/web-dist/assets/more-s9g8TvGr.js +11 -0
- package/web-dist/assets/ms_MY-65AJIBUS-BLlUrxe6.js +1349 -0
- package/web-dist/assets/network-placeholder-DBVOULy6.js +14 -0
- package/web-dist/assets/nftPlaceholder-D8q6GiE5.js +8 -0
- package/web-dist/assets/off-7mG5bayL.js +8 -0
- package/web-dist/assets/optimism-VD7XDD2W-DpJY1TMb.js +1 -0
- package/web-dist/assets/play-store-BFa605Jk.js +32 -0
- package/web-dist/assets/plus-BgZ-WP7A.js +13 -0
- package/web-dist/assets/polygon-WWEUOMKW-CNBYSB1T.js +1 -0
- package/web-dist/assets/pt_BR-DMJANC65-DMs4DrlC.js +1349 -0
- package/web-dist/assets/qr-code-B_1WHzPs.js +6 -0
- package/web-dist/assets/rainbowWallet-2SR6TVBF-kimcGeuf.js +1 -0
- package/web-dist/assets/recycle-horizontal-CuuA7YIy.js +9 -0
- package/web-dist/assets/refresh-CSXbxAuT.js +8 -0
- package/web-dist/assets/refresh-HJGJRASX-D0rkc63_.js +1 -0
- package/web-dist/assets/reown-logo-OK1pdOfH.js +12 -0
- package/web-dist/assets/ronin-PNHX5V6H-BS-WPXjQ.js +1 -0
- package/web-dist/assets/ru_RU-WER7RQ6A-DsJK55uv.js +1349 -0
- package/web-dist/assets/safeWallet-VUYZPLY4-CXnodgMs.js +1 -0
- package/web-dist/assets/scan-DEOT2M37-1-mJ5OyF.js +1 -0
- package/web-dist/assets/scroll-NMZWDUQH-fIxBV-y0.js +1 -0
- package/web-dist/assets/search-b77MGgNN.js +8 -0
- package/web-dist/assets/secp256k1-CqlnLpBV.js +1 -0
- package/web-dist/assets/secp256k1-xC50DJGj.js +1 -0
- package/web-dist/assets/send-DlJtxaMX.js +15 -0
- package/web-dist/assets/sign-A7IJEUT5-CGsRnPrd.js +1 -0
- package/web-dist/assets/swapHorizontal-BmG4i-CJ.js +8 -0
- package/web-dist/assets/swapHorizontalBold-CrnzAaq6.js +8 -0
- package/web-dist/assets/swapHorizontalMedium-DuPE93B2.js +16 -0
- package/web-dist/assets/swapHorizontalRoundedBold-clkEaP-W.js +8 -0
- package/web-dist/assets/swapVertical-DXvCmf9g.js +8 -0
- package/web-dist/assets/telegram-uHX2mx77.js +16 -0
- package/web-dist/assets/th_TH-JOSHEZ6D-Cp87mIRZ.js +1349 -0
- package/web-dist/assets/three-dots-BoFVtYRM.js +5 -0
- package/web-dist/assets/tr_TR-EAMG2YPO-C52_xfsf.js +1349 -0
- package/web-dist/assets/twitch-BbZVXa-k.js +18 -0
- package/web-dist/assets/twitterIcon-DTDEnPwP.js +6 -0
- package/web-dist/assets/uk_UA-GO2TRVWA-C1C1400t.js +1349 -0
- package/web-dist/assets/verify-DSwt0ow9.js +8 -0
- package/web-dist/assets/verify-filled-Dd2saJZ0.js +8 -0
- package/web-dist/assets/vi_VN-5HLLSOJA-Dj7ferOp.js +1349 -0
- package/web-dist/assets/w3m-modal-Dkca-GXY.js +642 -0
- package/web-dist/assets/wallet-DFQUKIzv.js +8 -0
- package/web-dist/assets/wallet-placeholder-DBESmMOJ.js +14 -0
- package/web-dist/assets/walletConnectWallet-FNSU4KNU-B0ci71fU.js +1 -0
- package/web-dist/assets/walletconnect-Byk_h0ya.js +30 -0
- package/web-dist/assets/warning-circle-BjOhgUMO.js +12 -0
- package/web-dist/assets/x-qhswnC92.js +12 -0
- package/web-dist/assets/xdc-X7V4QFNF-CSGs0o6M.js +1 -0
- package/web-dist/assets/zetachain-BMJKVYBN-IK2CZBr3.js +1 -0
- package/web-dist/assets/zh_CN-THPIFVWJ-Cbp71xMR.js +1349 -0
- package/web-dist/assets/zh_HK-R7XP4TGF-CyJtfKGw.js +1349 -0
- package/web-dist/assets/zh_TW-F5LD752V-AHFgsYw-.js +1349 -0
- package/web-dist/assets/zkSync-JL26RB7U-BYMs9Lzo.js +1 -0
- package/web-dist/assets/zora-YZH32HP3-CY3tp3EJ.js +1 -0
- package/web-dist/index.html +13 -0
|
@@ -0,0 +1,2124 @@
|
|
|
1
|
+
import{k as N,o as G,l as q,m as O,n as c,y as M,D as z,O as ee,G as j,E as te,R as U,P as Me,u as K,Q as k,U as ft,I as yi,W as pt,C as Xt,v as vn,T as Zt,B as Xe,M as ni,V as ii,w as Ne,L as yn,q as xi}from"./core-Bf6VrE6v.js";import{n as u,c as T,o as W,r as I,U as he,e as Ci,f as Ri,a as $i}from"./index-aVimijSo.js";import{r as Ii,h as Ei}from"./index-C4Lbscxg.js";import"./index.es-Me6_HSoS.js";import"./events-DQ172AOg.js";const Wi=N`
|
|
2
|
+
:host {
|
|
3
|
+
position: relative;
|
|
4
|
+
background-color: var(--wui-color-gray-glass-002);
|
|
5
|
+
display: flex;
|
|
6
|
+
justify-content: center;
|
|
7
|
+
align-items: center;
|
|
8
|
+
width: var(--local-size);
|
|
9
|
+
height: var(--local-size);
|
|
10
|
+
border-radius: inherit;
|
|
11
|
+
border-radius: var(--local-border-radius);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
:host > wui-flex {
|
|
15
|
+
overflow: hidden;
|
|
16
|
+
border-radius: inherit;
|
|
17
|
+
border-radius: var(--local-border-radius);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
:host::after {
|
|
21
|
+
content: '';
|
|
22
|
+
position: absolute;
|
|
23
|
+
top: 0;
|
|
24
|
+
bottom: 0;
|
|
25
|
+
left: 0;
|
|
26
|
+
right: 0;
|
|
27
|
+
border-radius: inherit;
|
|
28
|
+
border: 1px solid var(--wui-color-gray-glass-010);
|
|
29
|
+
pointer-events: none;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
:host([name='Extension'])::after {
|
|
33
|
+
border: 1px solid var(--wui-color-accent-glass-010);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
:host([data-wallet-icon='allWallets']) {
|
|
37
|
+
background-color: var(--wui-all-wallets-bg-100);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
:host([data-wallet-icon='allWallets'])::after {
|
|
41
|
+
border: 1px solid var(--wui-color-accent-glass-010);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
wui-icon[data-parent-size='inherit'] {
|
|
45
|
+
width: 75%;
|
|
46
|
+
height: 75%;
|
|
47
|
+
align-items: center;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
wui-icon[data-parent-size='sm'] {
|
|
51
|
+
width: 18px;
|
|
52
|
+
height: 18px;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
wui-icon[data-parent-size='md'] {
|
|
56
|
+
width: 24px;
|
|
57
|
+
height: 24px;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
wui-icon[data-parent-size='lg'] {
|
|
61
|
+
width: 42px;
|
|
62
|
+
height: 42px;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
wui-icon[data-parent-size='full'] {
|
|
66
|
+
width: 100%;
|
|
67
|
+
height: 100%;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
:host > wui-icon-box {
|
|
71
|
+
position: absolute;
|
|
72
|
+
overflow: hidden;
|
|
73
|
+
right: -1px;
|
|
74
|
+
bottom: -2px;
|
|
75
|
+
z-index: 1;
|
|
76
|
+
border: 2px solid var(--wui-color-bg-150, #1e1f1f);
|
|
77
|
+
padding: 1px;
|
|
78
|
+
}
|
|
79
|
+
`;var Ie=function(r,e,n,i){var o=arguments.length,t=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,n):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(r,e,n,i);else for(var s=r.length-1;s>=0;s--)(a=r[s])&&(t=(o<3?a(t):o>3?a(e,n,t):a(e,n))||t);return o>3&&t&&Object.defineProperty(e,n,t),t};let fe=class extends O{constructor(){super(...arguments),this.size="md",this.name="",this.installed=!1,this.badgeSize="xs"}render(){let e="xxs";return this.size==="lg"?e="m":this.size==="md"?e="xs":e="xxs",this.style.cssText=`
|
|
80
|
+
--local-border-radius: var(--wui-border-radius-${e});
|
|
81
|
+
--local-size: var(--wui-wallet-image-size-${this.size});
|
|
82
|
+
`,this.walletIcon&&(this.dataset.walletIcon=this.walletIcon),c`
|
|
83
|
+
<wui-flex justifyContent="center" alignItems="center"> ${this.templateVisual()} </wui-flex>
|
|
84
|
+
`}templateVisual(){return this.imageSrc?c`<wui-image src=${this.imageSrc} alt=${this.name}></wui-image>`:this.walletIcon?c`<wui-icon
|
|
85
|
+
data-parent-size="md"
|
|
86
|
+
size="md"
|
|
87
|
+
color="inherit"
|
|
88
|
+
name=${this.walletIcon}
|
|
89
|
+
></wui-icon>`:c`<wui-icon
|
|
90
|
+
data-parent-size=${this.size}
|
|
91
|
+
size="inherit"
|
|
92
|
+
color="inherit"
|
|
93
|
+
name="walletPlaceholder"
|
|
94
|
+
></wui-icon>`}};fe.styles=[G,q,Wi];Ie([u()],fe.prototype,"size",void 0);Ie([u()],fe.prototype,"name",void 0);Ie([u()],fe.prototype,"imageSrc",void 0);Ie([u()],fe.prototype,"walletIcon",void 0);Ie([u({type:Boolean})],fe.prototype,"installed",void 0);Ie([u()],fe.prototype,"badgeSize",void 0);fe=Ie([T("wui-wallet-image")],fe);const _i=N`
|
|
95
|
+
:host {
|
|
96
|
+
position: relative;
|
|
97
|
+
border-radius: var(--wui-border-radius-xxs);
|
|
98
|
+
width: 40px;
|
|
99
|
+
height: 40px;
|
|
100
|
+
overflow: hidden;
|
|
101
|
+
background: var(--wui-color-gray-glass-002);
|
|
102
|
+
display: flex;
|
|
103
|
+
justify-content: center;
|
|
104
|
+
align-items: center;
|
|
105
|
+
flex-wrap: wrap;
|
|
106
|
+
gap: var(--wui-spacing-4xs);
|
|
107
|
+
padding: 3.75px !important;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
:host::after {
|
|
111
|
+
content: '';
|
|
112
|
+
position: absolute;
|
|
113
|
+
top: 0;
|
|
114
|
+
bottom: 0;
|
|
115
|
+
left: 0;
|
|
116
|
+
right: 0;
|
|
117
|
+
border-radius: inherit;
|
|
118
|
+
border: 1px solid var(--wui-color-gray-glass-010);
|
|
119
|
+
pointer-events: none;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
:host > wui-wallet-image {
|
|
123
|
+
width: 14px;
|
|
124
|
+
height: 14px;
|
|
125
|
+
border-radius: var(--wui-border-radius-5xs);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
:host > wui-flex {
|
|
129
|
+
padding: 2px;
|
|
130
|
+
position: fixed;
|
|
131
|
+
overflow: hidden;
|
|
132
|
+
left: 34px;
|
|
133
|
+
bottom: 8px;
|
|
134
|
+
background: var(--dark-background-150, #1e1f1f);
|
|
135
|
+
border-radius: 50%;
|
|
136
|
+
z-index: 2;
|
|
137
|
+
display: flex;
|
|
138
|
+
}
|
|
139
|
+
`;var oi=function(r,e,n,i){var o=arguments.length,t=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,n):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(r,e,n,i);else for(var s=r.length-1;s>=0;s--)(a=r[s])&&(t=(o<3?a(t):o>3?a(e,n,t):a(e,n))||t);return o>3&&t&&Object.defineProperty(e,n,t),t};const Et=4;let Ze=class extends O{constructor(){super(...arguments),this.walletImages=[]}render(){const e=this.walletImages.length<Et;return c`${this.walletImages.slice(0,Et).map(({src:n,walletName:i})=>c`
|
|
140
|
+
<wui-wallet-image
|
|
141
|
+
size="inherit"
|
|
142
|
+
imageSrc=${n}
|
|
143
|
+
name=${W(i)}
|
|
144
|
+
></wui-wallet-image>
|
|
145
|
+
`)}
|
|
146
|
+
${e?[...Array(Et-this.walletImages.length)].map(()=>c` <wui-wallet-image size="inherit" name=""></wui-wallet-image>`):null}
|
|
147
|
+
<wui-flex>
|
|
148
|
+
<wui-icon-box
|
|
149
|
+
size="xxs"
|
|
150
|
+
iconSize="xxs"
|
|
151
|
+
iconcolor="success-100"
|
|
152
|
+
backgroundcolor="success-100"
|
|
153
|
+
icon="checkmark"
|
|
154
|
+
background="opaque"
|
|
155
|
+
></wui-icon-box>
|
|
156
|
+
</wui-flex>`}};Ze.styles=[q,_i];oi([u({type:Array})],Ze.prototype,"walletImages",void 0);Ze=oi([T("wui-all-wallets-image")],Ze);const Si=N`
|
|
157
|
+
button {
|
|
158
|
+
column-gap: var(--wui-spacing-s);
|
|
159
|
+
padding: 7px var(--wui-spacing-l) 7px var(--wui-spacing-xs);
|
|
160
|
+
width: 100%;
|
|
161
|
+
background-color: var(--wui-color-gray-glass-002);
|
|
162
|
+
border-radius: var(--wui-border-radius-xs);
|
|
163
|
+
color: var(--wui-color-fg-100);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
button > wui-text:nth-child(2) {
|
|
167
|
+
display: flex;
|
|
168
|
+
flex: 1;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
button:disabled {
|
|
172
|
+
background-color: var(--wui-color-gray-glass-015);
|
|
173
|
+
color: var(--wui-color-gray-glass-015);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
button:disabled > wui-tag {
|
|
177
|
+
background-color: var(--wui-color-gray-glass-010);
|
|
178
|
+
color: var(--wui-color-fg-300);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
wui-icon {
|
|
182
|
+
color: var(--wui-color-fg-200) !important;
|
|
183
|
+
}
|
|
184
|
+
`;var Y=function(r,e,n,i){var o=arguments.length,t=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,n):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(r,e,n,i);else for(var s=r.length-1;s>=0;s--)(a=r[s])&&(t=(o<3?a(t):o>3?a(e,n,t):a(e,n))||t);return o>3&&t&&Object.defineProperty(e,n,t),t};let F=class extends O{constructor(){super(...arguments),this.walletImages=[],this.imageSrc="",this.name="",this.tabIdx=void 0,this.installed=!1,this.disabled=!1,this.showAllWallets=!1,this.loading=!1,this.loadingSpinnerColor="accent-100"}render(){return c`
|
|
185
|
+
<button ?disabled=${this.disabled} tabindex=${W(this.tabIdx)}>
|
|
186
|
+
${this.templateAllWallets()} ${this.templateWalletImage()}
|
|
187
|
+
<wui-text variant="paragraph-500" color="inherit">${this.name}</wui-text>
|
|
188
|
+
${this.templateStatus()}
|
|
189
|
+
</button>
|
|
190
|
+
`}templateAllWallets(){return this.showAllWallets&&this.imageSrc?c` <wui-all-wallets-image .imageeSrc=${this.imageSrc}> </wui-all-wallets-image> `:this.showAllWallets&&this.walletIcon?c` <wui-wallet-image .walletIcon=${this.walletIcon} size="sm"> </wui-wallet-image> `:null}templateWalletImage(){return!this.showAllWallets&&this.imageSrc?c`<wui-wallet-image
|
|
191
|
+
size="sm"
|
|
192
|
+
imageSrc=${this.imageSrc}
|
|
193
|
+
name=${this.name}
|
|
194
|
+
.installed=${this.installed}
|
|
195
|
+
></wui-wallet-image>`:!this.showAllWallets&&!this.imageSrc?c`<wui-wallet-image size="sm" name=${this.name}></wui-wallet-image>`:null}templateStatus(){return this.loading?c`<wui-loading-spinner
|
|
196
|
+
size="lg"
|
|
197
|
+
color=${this.loadingSpinnerColor}
|
|
198
|
+
></wui-loading-spinner>`:this.tagLabel&&this.tagVariant?c`<wui-tag variant=${this.tagVariant}>${this.tagLabel}</wui-tag>`:this.icon?c`<wui-icon color="inherit" size="sm" name=${this.icon}></wui-icon>`:null}};F.styles=[q,G,Si];Y([u({type:Array})],F.prototype,"walletImages",void 0);Y([u()],F.prototype,"imageSrc",void 0);Y([u()],F.prototype,"name",void 0);Y([u()],F.prototype,"tagLabel",void 0);Y([u()],F.prototype,"tagVariant",void 0);Y([u()],F.prototype,"icon",void 0);Y([u()],F.prototype,"walletIcon",void 0);Y([u()],F.prototype,"tabIdx",void 0);Y([u({type:Boolean})],F.prototype,"installed",void 0);Y([u({type:Boolean})],F.prototype,"disabled",void 0);Y([u({type:Boolean})],F.prototype,"showAllWallets",void 0);Y([u({type:Boolean})],F.prototype,"loading",void 0);Y([u({type:String})],F.prototype,"loadingSpinnerColor",void 0);F=Y([T("wui-list-wallet")],F);var Ae=function(r,e,n,i){var o=arguments.length,t=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,n):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(r,e,n,i);else for(var s=r.length-1;s>=0;s--)(a=r[s])&&(t=(o<3?a(t):o>3?a(e,n,t):a(e,n))||t);return o>3&&t&&Object.defineProperty(e,n,t),t};let ye=class extends O{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=M.state.connectors,this.count=z.state.count,this.filteredCount=z.state.filteredWallets.length,this.isFetchingRecommendedWallets=z.state.isFetchingRecommendedWallets,this.unsubscribe.push(M.subscribeKey("connectors",e=>this.connectors=e),z.subscribeKey("count",e=>this.count=e),z.subscribeKey("filteredWallets",e=>this.filteredCount=e.length),z.subscribeKey("isFetchingRecommendedWallets",e=>this.isFetchingRecommendedWallets=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const e=this.connectors.find(l=>l.id==="walletConnect"),{allWallets:n}=ee.state;if(!e||n==="HIDE"||n==="ONLY_MOBILE"&&!j.isMobile())return null;const i=z.state.featured.length,o=this.count+i,t=o<10?o:Math.floor(o/10)*10,a=this.filteredCount>0?this.filteredCount:t;let s=`${a}`;return this.filteredCount>0?s=`${this.filteredCount}`:a<o&&(s=`${a}+`),c`
|
|
199
|
+
<wui-list-wallet
|
|
200
|
+
name="All Wallets"
|
|
201
|
+
walletIcon="allWallets"
|
|
202
|
+
showAllWallets
|
|
203
|
+
@click=${this.onAllWallets.bind(this)}
|
|
204
|
+
tagLabel=${s}
|
|
205
|
+
tagVariant="shade"
|
|
206
|
+
data-testid="all-wallets"
|
|
207
|
+
tabIdx=${W(this.tabIdx)}
|
|
208
|
+
.loading=${this.isFetchingRecommendedWallets}
|
|
209
|
+
loadingSpinnerColor=${this.isFetchingRecommendedWallets?"fg-300":"accent-100"}
|
|
210
|
+
></wui-list-wallet>
|
|
211
|
+
`}onAllWallets(){te.sendEvent({type:"track",event:"CLICK_ALL_WALLETS"}),U.push("AllWallets")}};Ae([u()],ye.prototype,"tabIdx",void 0);Ae([I()],ye.prototype,"connectors",void 0);Ae([I()],ye.prototype,"count",void 0);Ae([I()],ye.prototype,"filteredCount",void 0);Ae([I()],ye.prototype,"isFetchingRecommendedWallets",void 0);ye=Ae([T("w3m-all-wallets-widget")],ye);var an=function(r,e,n,i){var o=arguments.length,t=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,n):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(r,e,n,i);else for(var s=r.length-1;s>=0;s--)(a=r[s])&&(t=(o<3?a(t):o>3?a(e,n,t):a(e,n))||t);return o>3&&t&&Object.defineProperty(e,n,t),t};let et=class extends O{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=M.state.connectors,this.unsubscribe.push(M.subscribeKey("connectors",e=>this.connectors=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const e=this.connectors.filter(n=>n.type==="ANNOUNCED");return e?.length?c`
|
|
212
|
+
<wui-flex flexDirection="column" gap="xs">
|
|
213
|
+
${e.filter(Me.showConnector).map(n=>c`
|
|
214
|
+
<wui-list-wallet
|
|
215
|
+
imageSrc=${W(K.getConnectorImage(n))}
|
|
216
|
+
name=${n.name??"Unknown"}
|
|
217
|
+
@click=${()=>this.onConnector(n)}
|
|
218
|
+
tagVariant="success"
|
|
219
|
+
tagLabel="installed"
|
|
220
|
+
data-testid=${`wallet-selector-${n.id}`}
|
|
221
|
+
.installed=${!0}
|
|
222
|
+
tabIdx=${W(this.tabIdx)}
|
|
223
|
+
>
|
|
224
|
+
</wui-list-wallet>
|
|
225
|
+
`)}
|
|
226
|
+
</wui-flex>
|
|
227
|
+
`:(this.style.cssText="display: none",null)}onConnector(e){e.id==="walletConnect"?j.isMobile()?U.push("AllWallets"):U.push("ConnectingWalletConnect"):U.push("ConnectingExternal",{connector:e})}};an([u()],et.prototype,"tabIdx",void 0);an([I()],et.prototype,"connectors",void 0);et=an([T("w3m-connect-announced-widget")],et);var gt=function(r,e,n,i){var o=arguments.length,t=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,n):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(r,e,n,i);else for(var s=r.length-1;s>=0;s--)(a=r[s])&&(t=(o<3?a(t):o>3?a(e,n,t):a(e,n))||t);return o>3&&t&&Object.defineProperty(e,n,t),t};let Ue=class extends O{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=M.state.connectors,this.loading=!1,this.unsubscribe.push(M.subscribeKey("connectors",e=>this.connectors=e)),j.isTelegram()&&j.isIos()&&(this.loading=!k.state.wcUri,this.unsubscribe.push(k.subscribeKey("wcUri",e=>this.loading=!e)))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const{customWallets:e}=ee.state;if(!e?.length)return this.style.cssText="display: none",null;const n=this.filterOutDuplicateWallets(e);return c`<wui-flex flexDirection="column" gap="xs">
|
|
228
|
+
${n.map(i=>c`
|
|
229
|
+
<wui-list-wallet
|
|
230
|
+
imageSrc=${W(K.getWalletImage(i))}
|
|
231
|
+
name=${i.name??"Unknown"}
|
|
232
|
+
@click=${()=>this.onConnectWallet(i)}
|
|
233
|
+
data-testid=${`wallet-selector-${i.id}`}
|
|
234
|
+
tabIdx=${W(this.tabIdx)}
|
|
235
|
+
?loading=${this.loading}
|
|
236
|
+
>
|
|
237
|
+
</wui-list-wallet>
|
|
238
|
+
`)}
|
|
239
|
+
</wui-flex>`}filterOutDuplicateWallets(e){const n=ft.getRecentWallets(),i=this.connectors.map(s=>s.info?.rdns).filter(Boolean),o=n.map(s=>s.rdns).filter(Boolean),t=i.concat(o);if(t.includes("io.metamask.mobile")&&j.isMobile()){const s=t.indexOf("io.metamask.mobile");t[s]="io.metamask"}return e.filter(s=>!t.includes(String(s?.rdns)))}onConnectWallet(e){this.loading||U.push("ConnectingWalletConnect",{wallet:e})}};gt([u()],Ue.prototype,"tabIdx",void 0);gt([I()],Ue.prototype,"connectors",void 0);gt([I()],Ue.prototype,"loading",void 0);Ue=gt([T("w3m-connect-custom-widget")],Ue);var sn=function(r,e,n,i){var o=arguments.length,t=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,n):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(r,e,n,i);else for(var s=r.length-1;s>=0;s--)(a=r[s])&&(t=(o<3?a(t):o>3?a(e,n,t):a(e,n))||t);return o>3&&t&&Object.defineProperty(e,n,t),t};let tt=class extends O{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=M.state.connectors,this.unsubscribe.push(M.subscribeKey("connectors",e=>this.connectors=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const i=this.connectors.filter(o=>o.type==="EXTERNAL").filter(Me.showConnector).filter(o=>o.id!==yi.CONNECTOR_ID.COINBASE_SDK);return i?.length?c`
|
|
240
|
+
<wui-flex flexDirection="column" gap="xs">
|
|
241
|
+
${i.map(o=>c`
|
|
242
|
+
<wui-list-wallet
|
|
243
|
+
imageSrc=${W(K.getConnectorImage(o))}
|
|
244
|
+
.installed=${!0}
|
|
245
|
+
name=${o.name??"Unknown"}
|
|
246
|
+
data-testid=${`wallet-selector-external-${o.id}`}
|
|
247
|
+
@click=${()=>this.onConnector(o)}
|
|
248
|
+
tabIdx=${W(this.tabIdx)}
|
|
249
|
+
>
|
|
250
|
+
</wui-list-wallet>
|
|
251
|
+
`)}
|
|
252
|
+
</wui-flex>
|
|
253
|
+
`:(this.style.cssText="display: none",null)}onConnector(e){U.push("ConnectingExternal",{connector:e})}};sn([u()],tt.prototype,"tabIdx",void 0);sn([I()],tt.prototype,"connectors",void 0);tt=sn([T("w3m-connect-external-widget")],tt);var ln=function(r,e,n,i){var o=arguments.length,t=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,n):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(r,e,n,i);else for(var s=r.length-1;s>=0;s--)(a=r[s])&&(t=(o<3?a(t):o>3?a(e,n,t):a(e,n))||t);return o>3&&t&&Object.defineProperty(e,n,t),t};let nt=class extends O{constructor(){super(...arguments),this.tabIdx=void 0,this.wallets=[]}render(){return this.wallets.length?c`
|
|
254
|
+
<wui-flex flexDirection="column" gap="xs">
|
|
255
|
+
${this.wallets.map(e=>c`
|
|
256
|
+
<wui-list-wallet
|
|
257
|
+
data-testid=${`wallet-selector-featured-${e.id}`}
|
|
258
|
+
imageSrc=${W(K.getWalletImage(e))}
|
|
259
|
+
name=${e.name??"Unknown"}
|
|
260
|
+
@click=${()=>this.onConnectWallet(e)}
|
|
261
|
+
tabIdx=${W(this.tabIdx)}
|
|
262
|
+
>
|
|
263
|
+
</wui-list-wallet>
|
|
264
|
+
`)}
|
|
265
|
+
</wui-flex>
|
|
266
|
+
`:(this.style.cssText="display: none",null)}onConnectWallet(e){M.selectWalletConnector(e)}};ln([u()],nt.prototype,"tabIdx",void 0);ln([u()],nt.prototype,"wallets",void 0);nt=ln([T("w3m-connect-featured-widget")],nt);var cn=function(r,e,n,i){var o=arguments.length,t=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,n):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(r,e,n,i);else for(var s=r.length-1;s>=0;s--)(a=r[s])&&(t=(o<3?a(t):o>3?a(e,n,t):a(e,n))||t);return o>3&&t&&Object.defineProperty(e,n,t),t};let it=class extends O{constructor(){super(...arguments),this.tabIdx=void 0,this.connectors=[]}render(){const e=this.connectors.filter(Me.showConnector);return e.length===0?(this.style.cssText="display: none",null):c`
|
|
267
|
+
<wui-flex flexDirection="column" gap="xs">
|
|
268
|
+
${e.map(n=>c`
|
|
269
|
+
<wui-list-wallet
|
|
270
|
+
imageSrc=${W(K.getConnectorImage(n))}
|
|
271
|
+
.installed=${!0}
|
|
272
|
+
name=${n.name??"Unknown"}
|
|
273
|
+
tagVariant="success"
|
|
274
|
+
tagLabel="installed"
|
|
275
|
+
data-testid=${`wallet-selector-${n.id}`}
|
|
276
|
+
@click=${()=>this.onConnector(n)}
|
|
277
|
+
tabIdx=${W(this.tabIdx)}
|
|
278
|
+
>
|
|
279
|
+
</wui-list-wallet>
|
|
280
|
+
`)}
|
|
281
|
+
</wui-flex>
|
|
282
|
+
`}onConnector(e){M.setActiveConnector(e),U.push("ConnectingExternal",{connector:e})}};cn([u()],it.prototype,"tabIdx",void 0);cn([u()],it.prototype,"connectors",void 0);it=cn([T("w3m-connect-injected-widget")],it);var un=function(r,e,n,i){var o=arguments.length,t=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,n):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(r,e,n,i);else for(var s=r.length-1;s>=0;s--)(a=r[s])&&(t=(o<3?a(t):o>3?a(e,n,t):a(e,n))||t);return o>3&&t&&Object.defineProperty(e,n,t),t};let ot=class extends O{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=M.state.connectors,this.unsubscribe.push(M.subscribeKey("connectors",e=>this.connectors=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const e=this.connectors.filter(n=>n.type==="MULTI_CHAIN"&&n.name!=="WalletConnect");return e?.length?c`
|
|
283
|
+
<wui-flex flexDirection="column" gap="xs">
|
|
284
|
+
${e.map(n=>c`
|
|
285
|
+
<wui-list-wallet
|
|
286
|
+
imageSrc=${W(K.getConnectorImage(n))}
|
|
287
|
+
.installed=${!0}
|
|
288
|
+
name=${n.name??"Unknown"}
|
|
289
|
+
tagVariant="shade"
|
|
290
|
+
tagLabel="multichain"
|
|
291
|
+
data-testid=${`wallet-selector-${n.id}`}
|
|
292
|
+
@click=${()=>this.onConnector(n)}
|
|
293
|
+
tabIdx=${W(this.tabIdx)}
|
|
294
|
+
>
|
|
295
|
+
</wui-list-wallet>
|
|
296
|
+
`)}
|
|
297
|
+
</wui-flex>
|
|
298
|
+
`:(this.style.cssText="display: none",null)}onConnector(e){M.setActiveConnector(e),U.push("ConnectingMultiChain")}};un([u()],ot.prototype,"tabIdx",void 0);un([I()],ot.prototype,"connectors",void 0);ot=un([T("w3m-connect-multi-chain-widget")],ot);var wt=function(r,e,n,i){var o=arguments.length,t=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,n):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(r,e,n,i);else for(var s=r.length-1;s>=0;s--)(a=r[s])&&(t=(o<3?a(t):o>3?a(e,n,t):a(e,n))||t);return o>3&&t&&Object.defineProperty(e,n,t),t};let qe=class extends O{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=M.state.connectors,this.loading=!1,this.unsubscribe.push(M.subscribeKey("connectors",e=>this.connectors=e)),j.isTelegram()&&j.isIos()&&(this.loading=!k.state.wcUri,this.unsubscribe.push(k.subscribeKey("wcUri",e=>this.loading=!e)))}render(){const n=ft.getRecentWallets().filter(i=>!pt.isExcluded(i)).filter(i=>!this.hasWalletConnector(i)).filter(i=>this.isWalletCompatibleWithCurrentChain(i));return n.length?c`
|
|
299
|
+
<wui-flex flexDirection="column" gap="xs">
|
|
300
|
+
${n.map(i=>c`
|
|
301
|
+
<wui-list-wallet
|
|
302
|
+
imageSrc=${W(K.getWalletImage(i))}
|
|
303
|
+
name=${i.name??"Unknown"}
|
|
304
|
+
@click=${()=>this.onConnectWallet(i)}
|
|
305
|
+
tagLabel="recent"
|
|
306
|
+
tagVariant="shade"
|
|
307
|
+
tabIdx=${W(this.tabIdx)}
|
|
308
|
+
?loading=${this.loading}
|
|
309
|
+
>
|
|
310
|
+
</wui-list-wallet>
|
|
311
|
+
`)}
|
|
312
|
+
</wui-flex>
|
|
313
|
+
`:(this.style.cssText="display: none",null)}onConnectWallet(e){this.loading||M.selectWalletConnector(e)}hasWalletConnector(e){return this.connectors.some(n=>n.id===e.id||n.name===e.name)}isWalletCompatibleWithCurrentChain(e){const n=Xt.state.activeChain;return n&&e.chains?e.chains.some(i=>{const o=i.split(":")[0];return n===o}):!0}};wt([u()],qe.prototype,"tabIdx",void 0);wt([I()],qe.prototype,"connectors",void 0);wt([I()],qe.prototype,"loading",void 0);qe=wt([T("w3m-connect-recent-widget")],qe);var mt=function(r,e,n,i){var o=arguments.length,t=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,n):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(r,e,n,i);else for(var s=r.length-1;s>=0;s--)(a=r[s])&&(t=(o<3?a(t):o>3?a(e,n,t):a(e,n))||t);return o>3&&t&&Object.defineProperty(e,n,t),t};let Fe=class extends O{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.wallets=[],this.loading=!1,j.isTelegram()&&j.isIos()&&(this.loading=!k.state.wcUri,this.unsubscribe.push(k.subscribeKey("wcUri",e=>this.loading=!e)))}render(){const{connectors:e}=M.state,{customWallets:n,featuredWalletIds:i}=ee.state,o=ft.getRecentWallets(),t=e.find(w=>w.id==="walletConnect"),s=e.filter(w=>w.type==="INJECTED"||w.type==="ANNOUNCED"||w.type==="MULTI_CHAIN").filter(w=>w.name!=="Browser Wallet");if(!t)return null;if(i||n||!this.wallets.length)return this.style.cssText="display: none",null;const l=s.length+o.length,d=Math.max(0,2-l),p=pt.filterOutDuplicateWallets(this.wallets).slice(0,d);return p.length?c`
|
|
314
|
+
<wui-flex flexDirection="column" gap="xs">
|
|
315
|
+
${p.map(w=>c`
|
|
316
|
+
<wui-list-wallet
|
|
317
|
+
imageSrc=${W(K.getWalletImage(w))}
|
|
318
|
+
name=${w?.name??"Unknown"}
|
|
319
|
+
@click=${()=>this.onConnectWallet(w)}
|
|
320
|
+
tabIdx=${W(this.tabIdx)}
|
|
321
|
+
?loading=${this.loading}
|
|
322
|
+
>
|
|
323
|
+
</wui-list-wallet>
|
|
324
|
+
`)}
|
|
325
|
+
</wui-flex>
|
|
326
|
+
`:(this.style.cssText="display: none",null)}onConnectWallet(e){if(this.loading)return;const n=M.getConnector(e.id,e.rdns);n?U.push("ConnectingExternal",{connector:n}):U.push("ConnectingWalletConnect",{wallet:e})}};mt([u()],Fe.prototype,"tabIdx",void 0);mt([u()],Fe.prototype,"wallets",void 0);mt([I()],Fe.prototype,"loading",void 0);Fe=mt([T("w3m-connect-recommended-widget")],Fe);var bt=function(r,e,n,i){var o=arguments.length,t=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,n):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(r,e,n,i);else for(var s=r.length-1;s>=0;s--)(a=r[s])&&(t=(o<3?a(t):o>3?a(e,n,t):a(e,n))||t);return o>3&&t&&Object.defineProperty(e,n,t),t};let Ve=class extends O{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=M.state.connectors,this.connectorImages=vn.state.connectorImages,this.unsubscribe.push(M.subscribeKey("connectors",e=>this.connectors=e),vn.subscribeKey("connectorImages",e=>this.connectorImages=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){if(j.isMobile())return this.style.cssText="display: none",null;const e=this.connectors.find(i=>i.id==="walletConnect");if(!e)return this.style.cssText="display: none",null;const n=e.imageUrl||this.connectorImages[e?.imageId??""];return c`
|
|
327
|
+
<wui-list-wallet
|
|
328
|
+
imageSrc=${W(n)}
|
|
329
|
+
name=${e.name??"Unknown"}
|
|
330
|
+
@click=${()=>this.onConnector(e)}
|
|
331
|
+
tagLabel="qr code"
|
|
332
|
+
tagVariant="main"
|
|
333
|
+
tabIdx=${W(this.tabIdx)}
|
|
334
|
+
data-testid="wallet-selector-walletconnect"
|
|
335
|
+
>
|
|
336
|
+
</wui-list-wallet>
|
|
337
|
+
`}onConnector(e){M.setActiveConnector(e),U.push("ConnectingWalletConnect")}};bt([u()],Ve.prototype,"tabIdx",void 0);bt([I()],Ve.prototype,"connectors",void 0);bt([I()],Ve.prototype,"connectorImages",void 0);Ve=bt([T("w3m-connect-walletconnect-widget")],Ve);const Ti=N`
|
|
338
|
+
:host {
|
|
339
|
+
margin-top: var(--wui-spacing-3xs);
|
|
340
|
+
}
|
|
341
|
+
wui-separator {
|
|
342
|
+
margin: var(--wui-spacing-m) calc(var(--wui-spacing-m) * -1) var(--wui-spacing-xs)
|
|
343
|
+
calc(var(--wui-spacing-m) * -1);
|
|
344
|
+
width: calc(100% + var(--wui-spacing-s) * 2);
|
|
345
|
+
}
|
|
346
|
+
`;var Ke=function(r,e,n,i){var o=arguments.length,t=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,n):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(r,e,n,i);else for(var s=r.length-1;s>=0;s--)(a=r[s])&&(t=(o<3?a(t):o>3?a(e,n,t):a(e,n))||t);return o>3&&t&&Object.defineProperty(e,n,t),t};let xe=class extends O{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=M.state.connectors,this.recommended=z.state.recommended,this.featured=z.state.featured,this.unsubscribe.push(M.subscribeKey("connectors",e=>this.connectors=e),z.subscribeKey("recommended",e=>this.recommended=e),z.subscribeKey("featured",e=>this.featured=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return c`
|
|
347
|
+
<wui-flex flexDirection="column" gap="xs"> ${this.connectorListTemplate()} </wui-flex>
|
|
348
|
+
`}connectorListTemplate(){const{custom:e,recent:n,announced:i,injected:o,multiChain:t,recommended:a,featured:s,external:l}=Me.getConnectorsByType(this.connectors,this.recommended,this.featured);return Me.getConnectorTypeOrder({custom:e,recent:n,announced:i,injected:o,multiChain:t,recommended:a,featured:s,external:l}).map(p=>{switch(p){case"injected":return c`
|
|
349
|
+
${t.length?c`<w3m-connect-multi-chain-widget
|
|
350
|
+
tabIdx=${W(this.tabIdx)}
|
|
351
|
+
></w3m-connect-multi-chain-widget>`:null}
|
|
352
|
+
${i.length?c`<w3m-connect-announced-widget
|
|
353
|
+
tabIdx=${W(this.tabIdx)}
|
|
354
|
+
></w3m-connect-announced-widget>`:null}
|
|
355
|
+
${o.length?c`<w3m-connect-injected-widget
|
|
356
|
+
.connectors=${o}
|
|
357
|
+
tabIdx=${W(this.tabIdx)}
|
|
358
|
+
></w3m-connect-injected-widget>`:null}
|
|
359
|
+
`;case"walletConnect":return c`<w3m-connect-walletconnect-widget
|
|
360
|
+
tabIdx=${W(this.tabIdx)}
|
|
361
|
+
></w3m-connect-walletconnect-widget>`;case"recent":return c`<w3m-connect-recent-widget
|
|
362
|
+
tabIdx=${W(this.tabIdx)}
|
|
363
|
+
></w3m-connect-recent-widget>`;case"featured":return c`<w3m-connect-featured-widget
|
|
364
|
+
.wallets=${s}
|
|
365
|
+
tabIdx=${W(this.tabIdx)}
|
|
366
|
+
></w3m-connect-featured-widget>`;case"custom":return c`<w3m-connect-custom-widget
|
|
367
|
+
tabIdx=${W(this.tabIdx)}
|
|
368
|
+
></w3m-connect-custom-widget>`;case"external":return c`<w3m-connect-external-widget
|
|
369
|
+
tabIdx=${W(this.tabIdx)}
|
|
370
|
+
></w3m-connect-external-widget>`;case"recommended":return c`<w3m-connect-recommended-widget
|
|
371
|
+
.wallets=${a}
|
|
372
|
+
tabIdx=${W(this.tabIdx)}
|
|
373
|
+
></w3m-connect-recommended-widget>`;default:return console.warn(`Unknown connector type: ${p}`),null}})}};xe.styles=Ti;Ke([u()],xe.prototype,"tabIdx",void 0);Ke([I()],xe.prototype,"connectors",void 0);Ke([I()],xe.prototype,"recommended",void 0);Ke([I()],xe.prototype,"featured",void 0);xe=Ke([T("w3m-connector-list")],xe);const Bi=N`
|
|
374
|
+
:host {
|
|
375
|
+
display: inline-flex;
|
|
376
|
+
background-color: var(--wui-color-gray-glass-002);
|
|
377
|
+
border-radius: var(--wui-border-radius-3xl);
|
|
378
|
+
padding: var(--wui-spacing-3xs);
|
|
379
|
+
position: relative;
|
|
380
|
+
height: 36px;
|
|
381
|
+
min-height: 36px;
|
|
382
|
+
overflow: hidden;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
:host::before {
|
|
386
|
+
content: '';
|
|
387
|
+
position: absolute;
|
|
388
|
+
pointer-events: none;
|
|
389
|
+
top: 4px;
|
|
390
|
+
left: 4px;
|
|
391
|
+
display: block;
|
|
392
|
+
width: var(--local-tab-width);
|
|
393
|
+
height: 28px;
|
|
394
|
+
border-radius: var(--wui-border-radius-3xl);
|
|
395
|
+
background-color: var(--wui-color-gray-glass-002);
|
|
396
|
+
box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-002);
|
|
397
|
+
transform: translateX(calc(var(--local-tab) * var(--local-tab-width)));
|
|
398
|
+
transition: transform var(--wui-ease-out-power-1) var(--wui-duration-md);
|
|
399
|
+
will-change: background-color, opacity;
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
:host([data-type='flex'])::before {
|
|
403
|
+
left: 3px;
|
|
404
|
+
transform: translateX(calc((var(--local-tab) * 34px) + (var(--local-tab) * 4px)));
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
:host([data-type='flex']) {
|
|
408
|
+
display: flex;
|
|
409
|
+
padding: 0px 0px 0px 12px;
|
|
410
|
+
gap: 4px;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
:host([data-type='flex']) > button > wui-text {
|
|
414
|
+
position: absolute;
|
|
415
|
+
left: 18px;
|
|
416
|
+
opacity: 0;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
button[data-active='true'] > wui-icon,
|
|
420
|
+
button[data-active='true'] > wui-text {
|
|
421
|
+
color: var(--wui-color-fg-100);
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
button[data-active='false'] > wui-icon,
|
|
425
|
+
button[data-active='false'] > wui-text {
|
|
426
|
+
color: var(--wui-color-fg-200);
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
button[data-active='true']:disabled,
|
|
430
|
+
button[data-active='false']:disabled {
|
|
431
|
+
background-color: transparent;
|
|
432
|
+
opacity: 0.5;
|
|
433
|
+
cursor: not-allowed;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
button[data-active='true']:disabled > wui-text {
|
|
437
|
+
color: var(--wui-color-fg-200);
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
button[data-active='false']:disabled > wui-text {
|
|
441
|
+
color: var(--wui-color-fg-300);
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
button > wui-icon,
|
|
445
|
+
button > wui-text {
|
|
446
|
+
pointer-events: none;
|
|
447
|
+
transition: color var(--wui-e ase-out-power-1) var(--wui-duration-md);
|
|
448
|
+
will-change: color;
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
button {
|
|
452
|
+
width: var(--local-tab-width);
|
|
453
|
+
transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-md);
|
|
454
|
+
will-change: background-color;
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
:host([data-type='flex']) > button {
|
|
458
|
+
width: 34px;
|
|
459
|
+
position: relative;
|
|
460
|
+
display: flex;
|
|
461
|
+
justify-content: flex-start;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
button:hover:enabled,
|
|
465
|
+
button:active:enabled {
|
|
466
|
+
background-color: transparent !important;
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
button:hover:enabled > wui-icon,
|
|
470
|
+
button:active:enabled > wui-icon {
|
|
471
|
+
transition: all var(--wui-ease-out-power-1) var(--wui-duration-lg);
|
|
472
|
+
color: var(--wui-color-fg-125);
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
button:hover:enabled > wui-text,
|
|
476
|
+
button:active:enabled > wui-text {
|
|
477
|
+
transition: all var(--wui-ease-out-power-1) var(--wui-duration-lg);
|
|
478
|
+
color: var(--wui-color-fg-125);
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
button {
|
|
482
|
+
border-radius: var(--wui-border-radius-3xl);
|
|
483
|
+
}
|
|
484
|
+
`;var ve=function(r,e,n,i){var o=arguments.length,t=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,n):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(r,e,n,i);else for(var s=r.length-1;s>=0;s--)(a=r[s])&&(t=(o<3?a(t):o>3?a(e,n,t):a(e,n))||t);return o>3&&t&&Object.defineProperty(e,n,t),t};let re=class extends O{constructor(){super(...arguments),this.tabs=[],this.onTabChange=()=>null,this.buttons=[],this.disabled=!1,this.localTabWidth="100px",this.activeTab=0,this.isDense=!1}render(){return this.isDense=this.tabs.length>3,this.style.cssText=`
|
|
485
|
+
--local-tab: ${this.activeTab};
|
|
486
|
+
--local-tab-width: ${this.localTabWidth};
|
|
487
|
+
`,this.dataset.type=this.isDense?"flex":"block",this.tabs.map((e,n)=>{const i=n===this.activeTab;return c`
|
|
488
|
+
<button
|
|
489
|
+
?disabled=${this.disabled}
|
|
490
|
+
@click=${()=>this.onTabClick(n)}
|
|
491
|
+
data-active=${i}
|
|
492
|
+
data-testid="tab-${e.label?.toLowerCase()}"
|
|
493
|
+
>
|
|
494
|
+
${this.iconTemplate(e)}
|
|
495
|
+
<wui-text variant="small-600" color="inherit"> ${e.label} </wui-text>
|
|
496
|
+
</button>
|
|
497
|
+
`})}firstUpdated(){this.shadowRoot&&this.isDense&&(this.buttons=[...this.shadowRoot.querySelectorAll("button")],setTimeout(()=>{this.animateTabs(0,!0)},0))}iconTemplate(e){return e.icon?c`<wui-icon size="xs" color="inherit" name=${e.icon}></wui-icon>`:null}onTabClick(e){this.buttons&&this.animateTabs(e,!1),this.activeTab=e,this.onTabChange(e)}animateTabs(e,n){const i=this.buttons[this.activeTab],o=this.buttons[e],t=i?.querySelector("wui-text"),a=o?.querySelector("wui-text"),s=o?.getBoundingClientRect(),l=a?.getBoundingClientRect();i&&t&&!n&&e!==this.activeTab&&(t.animate([{opacity:0}],{duration:50,easing:"ease",fill:"forwards"}),i.animate([{width:"34px"}],{duration:500,easing:"ease",fill:"forwards"})),o&&s&&l&&a&&(e!==this.activeTab||n)&&(this.localTabWidth=`${Math.round(s.width+l.width)+6}px`,o.animate([{width:`${s.width+l.width}px`}],{duration:n?0:500,fill:"forwards",easing:"ease"}),a.animate([{opacity:1}],{duration:n?0:125,delay:n?0:200,fill:"forwards",easing:"ease"}))}};re.styles=[q,G,Bi];ve([u({type:Array})],re.prototype,"tabs",void 0);ve([u()],re.prototype,"onTabChange",void 0);ve([u({type:Array})],re.prototype,"buttons",void 0);ve([u({type:Boolean})],re.prototype,"disabled",void 0);ve([u()],re.prototype,"localTabWidth",void 0);ve([I()],re.prototype,"activeTab",void 0);ve([I()],re.prototype,"isDense",void 0);re=ve([T("wui-tabs")],re);var dn=function(r,e,n,i){var o=arguments.length,t=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,n):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(r,e,n,i);else for(var s=r.length-1;s>=0;s--)(a=r[s])&&(t=(o<3?a(t):o>3?a(e,n,t):a(e,n))||t);return o>3&&t&&Object.defineProperty(e,n,t),t};let rt=class extends O{constructor(){super(...arguments),this.platformTabs=[],this.unsubscribe=[],this.platforms=[],this.onSelectPlatfrom=void 0}disconnectCallback(){this.unsubscribe.forEach(e=>e())}render(){const e=this.generateTabs();return c`
|
|
498
|
+
<wui-flex justifyContent="center" .padding=${["0","0","l","0"]}>
|
|
499
|
+
<wui-tabs .tabs=${e} .onTabChange=${this.onTabChange.bind(this)}></wui-tabs>
|
|
500
|
+
</wui-flex>
|
|
501
|
+
`}generateTabs(){const e=this.platforms.map(n=>n==="browser"?{label:"Browser",icon:"extension",platform:"browser"}:n==="mobile"?{label:"Mobile",icon:"mobile",platform:"mobile"}:n==="qrcode"?{label:"Mobile",icon:"mobile",platform:"qrcode"}:n==="web"?{label:"Webapp",icon:"browser",platform:"web"}:n==="desktop"?{label:"Desktop",icon:"desktop",platform:"desktop"}:{label:"Browser",icon:"extension",platform:"unsupported"});return this.platformTabs=e.map(({platform:n})=>n),e}onTabChange(e){const n=this.platformTabs[e];n&&this.onSelectPlatfrom?.(n)}};dn([u({type:Array})],rt.prototype,"platforms",void 0);dn([u()],rt.prototype,"onSelectPlatfrom",void 0);rt=dn([T("w3m-connecting-header")],rt);const Pi=N`
|
|
502
|
+
:host {
|
|
503
|
+
width: var(--local-width);
|
|
504
|
+
position: relative;
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
button {
|
|
508
|
+
border: none;
|
|
509
|
+
border-radius: var(--local-border-radius);
|
|
510
|
+
width: var(--local-width);
|
|
511
|
+
white-space: nowrap;
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
/* -- Sizes --------------------------------------------------- */
|
|
515
|
+
button[data-size='md'] {
|
|
516
|
+
padding: 8.2px var(--wui-spacing-l) 9px var(--wui-spacing-l);
|
|
517
|
+
height: 36px;
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
button[data-size='md'][data-icon-left='true'][data-icon-right='false'] {
|
|
521
|
+
padding: 8.2px var(--wui-spacing-l) 9px var(--wui-spacing-s);
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
button[data-size='md'][data-icon-right='true'][data-icon-left='false'] {
|
|
525
|
+
padding: 8.2px var(--wui-spacing-s) 9px var(--wui-spacing-l);
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
button[data-size='lg'] {
|
|
529
|
+
padding: var(--wui-spacing-m) var(--wui-spacing-2l);
|
|
530
|
+
height: 48px;
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
/* -- Variants --------------------------------------------------------- */
|
|
534
|
+
button[data-variant='main'] {
|
|
535
|
+
background-color: var(--wui-color-accent-100);
|
|
536
|
+
color: var(--wui-color-inverse-100);
|
|
537
|
+
border: none;
|
|
538
|
+
box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010);
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
button[data-variant='inverse'] {
|
|
542
|
+
background-color: var(--wui-color-inverse-100);
|
|
543
|
+
color: var(--wui-color-inverse-000);
|
|
544
|
+
border: none;
|
|
545
|
+
box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010);
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
button[data-variant='accent'] {
|
|
549
|
+
background-color: var(--wui-color-accent-glass-010);
|
|
550
|
+
color: var(--wui-color-accent-100);
|
|
551
|
+
border: none;
|
|
552
|
+
box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-005);
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
button[data-variant='accent-error'] {
|
|
556
|
+
background: var(--wui-color-error-glass-015);
|
|
557
|
+
color: var(--wui-color-error-100);
|
|
558
|
+
border: none;
|
|
559
|
+
box-shadow: inset 0 0 0 1px var(--wui-color-error-glass-010);
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
button[data-variant='accent-success'] {
|
|
563
|
+
background: var(--wui-color-success-glass-015);
|
|
564
|
+
color: var(--wui-color-success-100);
|
|
565
|
+
border: none;
|
|
566
|
+
box-shadow: inset 0 0 0 1px var(--wui-color-success-glass-010);
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
button[data-variant='neutral'] {
|
|
570
|
+
background: transparent;
|
|
571
|
+
color: var(--wui-color-fg-100);
|
|
572
|
+
border: none;
|
|
573
|
+
box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-005);
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
/* -- Focus states --------------------------------------------------- */
|
|
577
|
+
button[data-variant='main']:focus-visible:enabled {
|
|
578
|
+
background-color: var(--wui-color-accent-090);
|
|
579
|
+
box-shadow:
|
|
580
|
+
inset 0 0 0 1px var(--wui-color-accent-100),
|
|
581
|
+
0 0 0 4px var(--wui-color-accent-glass-020);
|
|
582
|
+
}
|
|
583
|
+
button[data-variant='inverse']:focus-visible:enabled {
|
|
584
|
+
background-color: var(--wui-color-inverse-100);
|
|
585
|
+
box-shadow:
|
|
586
|
+
inset 0 0 0 1px var(--wui-color-gray-glass-010),
|
|
587
|
+
0 0 0 4px var(--wui-color-accent-glass-020);
|
|
588
|
+
}
|
|
589
|
+
button[data-variant='accent']:focus-visible:enabled {
|
|
590
|
+
background-color: var(--wui-color-accent-glass-010);
|
|
591
|
+
box-shadow:
|
|
592
|
+
inset 0 0 0 1px var(--wui-color-accent-100),
|
|
593
|
+
0 0 0 4px var(--wui-color-accent-glass-020);
|
|
594
|
+
}
|
|
595
|
+
button[data-variant='accent-error']:focus-visible:enabled {
|
|
596
|
+
background: var(--wui-color-error-glass-015);
|
|
597
|
+
box-shadow:
|
|
598
|
+
inset 0 0 0 1px var(--wui-color-error-100),
|
|
599
|
+
0 0 0 4px var(--wui-color-error-glass-020);
|
|
600
|
+
}
|
|
601
|
+
button[data-variant='accent-success']:focus-visible:enabled {
|
|
602
|
+
background: var(--wui-color-success-glass-015);
|
|
603
|
+
box-shadow:
|
|
604
|
+
inset 0 0 0 1px var(--wui-color-success-100),
|
|
605
|
+
0 0 0 4px var(--wui-color-success-glass-020);
|
|
606
|
+
}
|
|
607
|
+
button[data-variant='neutral']:focus-visible:enabled {
|
|
608
|
+
background: var(--wui-color-gray-glass-005);
|
|
609
|
+
box-shadow:
|
|
610
|
+
inset 0 0 0 1px var(--wui-color-gray-glass-010),
|
|
611
|
+
0 0 0 4px var(--wui-color-gray-glass-002);
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
/* -- Hover & Active states ----------------------------------------------------------- */
|
|
615
|
+
@media (hover: hover) and (pointer: fine) {
|
|
616
|
+
button[data-variant='main']:hover:enabled {
|
|
617
|
+
background-color: var(--wui-color-accent-090);
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
button[data-variant='main']:active:enabled {
|
|
621
|
+
background-color: var(--wui-color-accent-080);
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
button[data-variant='accent']:hover:enabled {
|
|
625
|
+
background-color: var(--wui-color-accent-glass-015);
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
button[data-variant='accent']:active:enabled {
|
|
629
|
+
background-color: var(--wui-color-accent-glass-020);
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
button[data-variant='accent-error']:hover:enabled {
|
|
633
|
+
background: var(--wui-color-error-glass-020);
|
|
634
|
+
color: var(--wui-color-error-100);
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
button[data-variant='accent-error']:active:enabled {
|
|
638
|
+
background: var(--wui-color-error-glass-030);
|
|
639
|
+
color: var(--wui-color-error-100);
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
button[data-variant='accent-success']:hover:enabled {
|
|
643
|
+
background: var(--wui-color-success-glass-020);
|
|
644
|
+
color: var(--wui-color-success-100);
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
button[data-variant='accent-success']:active:enabled {
|
|
648
|
+
background: var(--wui-color-success-glass-030);
|
|
649
|
+
color: var(--wui-color-success-100);
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
button[data-variant='neutral']:hover:enabled {
|
|
653
|
+
background: var(--wui-color-gray-glass-002);
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
button[data-variant='neutral']:active:enabled {
|
|
657
|
+
background: var(--wui-color-gray-glass-005);
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
button[data-size='lg'][data-icon-left='true'][data-icon-right='false'] {
|
|
661
|
+
padding-left: var(--wui-spacing-m);
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
button[data-size='lg'][data-icon-right='true'][data-icon-left='false'] {
|
|
665
|
+
padding-right: var(--wui-spacing-m);
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
/* -- Disabled state --------------------------------------------------- */
|
|
670
|
+
button:disabled {
|
|
671
|
+
background-color: var(--wui-color-gray-glass-002);
|
|
672
|
+
box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-002);
|
|
673
|
+
color: var(--wui-color-gray-glass-020);
|
|
674
|
+
cursor: not-allowed;
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
button > wui-text {
|
|
678
|
+
transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md);
|
|
679
|
+
will-change: opacity;
|
|
680
|
+
opacity: var(--local-opacity-100);
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
::slotted(*) {
|
|
684
|
+
transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md);
|
|
685
|
+
will-change: opacity;
|
|
686
|
+
opacity: var(--local-opacity-100);
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
wui-loading-spinner {
|
|
690
|
+
position: absolute;
|
|
691
|
+
left: 50%;
|
|
692
|
+
top: 50%;
|
|
693
|
+
transform: translate(-50%, -50%);
|
|
694
|
+
opacity: var(--local-opacity-000);
|
|
695
|
+
}
|
|
696
|
+
`;var ae=function(r,e,n,i){var o=arguments.length,t=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,n):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(r,e,n,i);else for(var s=r.length-1;s>=0;s--)(a=r[s])&&(t=(o<3?a(t):o>3?a(e,n,t):a(e,n))||t);return o>3&&t&&Object.defineProperty(e,n,t),t};const xn={main:"inverse-100",inverse:"inverse-000",accent:"accent-100","accent-error":"error-100","accent-success":"success-100",neutral:"fg-100",disabled:"gray-glass-020"},Li={lg:"paragraph-600",md:"small-600"},Oi={lg:"md",md:"md"};let Q=class extends O{constructor(){super(...arguments),this.size="lg",this.disabled=!1,this.fullWidth=!1,this.loading=!1,this.variant="main",this.hasIconLeft=!1,this.hasIconRight=!1,this.borderRadius="m"}render(){this.style.cssText=`
|
|
697
|
+
--local-width: ${this.fullWidth?"100%":"auto"};
|
|
698
|
+
--local-opacity-100: ${this.loading?0:1};
|
|
699
|
+
--local-opacity-000: ${this.loading?1:0};
|
|
700
|
+
--local-border-radius: var(--wui-border-radius-${this.borderRadius});
|
|
701
|
+
`;const e=this.textVariant??Li[this.size];return c`
|
|
702
|
+
<button
|
|
703
|
+
data-variant=${this.variant}
|
|
704
|
+
data-icon-left=${this.hasIconLeft}
|
|
705
|
+
data-icon-right=${this.hasIconRight}
|
|
706
|
+
data-size=${this.size}
|
|
707
|
+
?disabled=${this.disabled}
|
|
708
|
+
>
|
|
709
|
+
${this.loadingTemplate()}
|
|
710
|
+
<slot name="iconLeft" @slotchange=${()=>this.handleSlotLeftChange()}></slot>
|
|
711
|
+
<wui-text variant=${e} color="inherit">
|
|
712
|
+
<slot></slot>
|
|
713
|
+
</wui-text>
|
|
714
|
+
<slot name="iconRight" @slotchange=${()=>this.handleSlotRightChange()}></slot>
|
|
715
|
+
</button>
|
|
716
|
+
`}handleSlotLeftChange(){this.hasIconLeft=!0}handleSlotRightChange(){this.hasIconRight=!0}loadingTemplate(){if(this.loading){const e=Oi[this.size],n=this.disabled?xn.disabled:xn[this.variant];return c`<wui-loading-spinner color=${n} size=${e}></wui-loading-spinner>`}return c``}};Q.styles=[q,G,Pi];ae([u()],Q.prototype,"size",void 0);ae([u({type:Boolean})],Q.prototype,"disabled",void 0);ae([u({type:Boolean})],Q.prototype,"fullWidth",void 0);ae([u({type:Boolean})],Q.prototype,"loading",void 0);ae([u()],Q.prototype,"variant",void 0);ae([u({type:Boolean})],Q.prototype,"hasIconLeft",void 0);ae([u({type:Boolean})],Q.prototype,"hasIconRight",void 0);ae([u()],Q.prototype,"borderRadius",void 0);ae([u()],Q.prototype,"textVariant",void 0);Q=ae([T("wui-button")],Q);const Ai=N`
|
|
717
|
+
button {
|
|
718
|
+
padding: var(--wui-spacing-4xs) var(--wui-spacing-xxs);
|
|
719
|
+
border-radius: var(--wui-border-radius-3xs);
|
|
720
|
+
background-color: transparent;
|
|
721
|
+
color: var(--wui-color-accent-100);
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
button:disabled {
|
|
725
|
+
background-color: transparent;
|
|
726
|
+
color: var(--wui-color-gray-glass-015);
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
button:hover {
|
|
730
|
+
background-color: var(--wui-color-gray-glass-005);
|
|
731
|
+
}
|
|
732
|
+
`;var vt=function(r,e,n,i){var o=arguments.length,t=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,n):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(r,e,n,i);else for(var s=r.length-1;s>=0;s--)(a=r[s])&&(t=(o<3?a(t):o>3?a(e,n,t):a(e,n))||t);return o>3&&t&&Object.defineProperty(e,n,t),t};let Be=class extends O{constructor(){super(...arguments),this.tabIdx=void 0,this.disabled=!1,this.color="inherit"}render(){return c`
|
|
733
|
+
<button ?disabled=${this.disabled} tabindex=${W(this.tabIdx)}>
|
|
734
|
+
<slot name="iconLeft"></slot>
|
|
735
|
+
<wui-text variant="small-600" color=${this.color}>
|
|
736
|
+
<slot></slot>
|
|
737
|
+
</wui-text>
|
|
738
|
+
<slot name="iconRight"></slot>
|
|
739
|
+
</button>
|
|
740
|
+
`}};Be.styles=[q,G,Ai];vt([u()],Be.prototype,"tabIdx",void 0);vt([u({type:Boolean})],Be.prototype,"disabled",void 0);vt([u()],Be.prototype,"color",void 0);Be=vt([T("wui-link")],Be);const ji=N`
|
|
741
|
+
:host {
|
|
742
|
+
display: block;
|
|
743
|
+
width: var(--wui-box-size-md);
|
|
744
|
+
height: var(--wui-box-size-md);
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
svg {
|
|
748
|
+
width: var(--wui-box-size-md);
|
|
749
|
+
height: var(--wui-box-size-md);
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
rect {
|
|
753
|
+
fill: none;
|
|
754
|
+
stroke: var(--wui-color-accent-100);
|
|
755
|
+
stroke-width: 4px;
|
|
756
|
+
stroke-linecap: round;
|
|
757
|
+
animation: dash 1s linear infinite;
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
@keyframes dash {
|
|
761
|
+
to {
|
|
762
|
+
stroke-dashoffset: 0px;
|
|
763
|
+
}
|
|
764
|
+
}
|
|
765
|
+
`;var ri=function(r,e,n,i){var o=arguments.length,t=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,n):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(r,e,n,i);else for(var s=r.length-1;s>=0;s--)(a=r[s])&&(t=(o<3?a(t):o>3?a(e,n,t):a(e,n))||t);return o>3&&t&&Object.defineProperty(e,n,t),t};let at=class extends O{constructor(){super(...arguments),this.radius=36}render(){return this.svgLoaderTemplate()}svgLoaderTemplate(){const e=this.radius>50?50:this.radius,i=36-e,o=116+i,t=245+i,a=360+i*1.75;return c`
|
|
766
|
+
<svg viewBox="0 0 110 110" width="110" height="110">
|
|
767
|
+
<rect
|
|
768
|
+
x="2"
|
|
769
|
+
y="2"
|
|
770
|
+
width="106"
|
|
771
|
+
height="106"
|
|
772
|
+
rx=${e}
|
|
773
|
+
stroke-dasharray="${o} ${t}"
|
|
774
|
+
stroke-dashoffset=${a}
|
|
775
|
+
/>
|
|
776
|
+
</svg>
|
|
777
|
+
`}};at.styles=[q,ji];ri([u({type:Number})],at.prototype,"radius",void 0);at=ri([T("wui-loading-thumbnail")],at);const ki=N`
|
|
778
|
+
button {
|
|
779
|
+
border: none;
|
|
780
|
+
border-radius: var(--wui-border-radius-3xl);
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
button[data-variant='main'] {
|
|
784
|
+
background-color: var(--wui-color-accent-100);
|
|
785
|
+
color: var(--wui-color-inverse-100);
|
|
786
|
+
box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010);
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
button[data-variant='accent'] {
|
|
790
|
+
background-color: var(--wui-color-accent-glass-010);
|
|
791
|
+
color: var(--wui-color-accent-100);
|
|
792
|
+
box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-005);
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
button[data-variant='gray'] {
|
|
796
|
+
background-color: transparent;
|
|
797
|
+
color: var(--wui-color-fg-200);
|
|
798
|
+
box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010);
|
|
799
|
+
}
|
|
800
|
+
|
|
801
|
+
button[data-variant='shade'] {
|
|
802
|
+
background-color: transparent;
|
|
803
|
+
color: var(--wui-color-accent-100);
|
|
804
|
+
box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010);
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
button[data-size='sm'] {
|
|
808
|
+
height: 32px;
|
|
809
|
+
padding: 0 var(--wui-spacing-s);
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
button[data-size='md'] {
|
|
813
|
+
height: 40px;
|
|
814
|
+
padding: 0 var(--wui-spacing-l);
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
button[data-size='sm'] > wui-image {
|
|
818
|
+
width: 16px;
|
|
819
|
+
height: 16px;
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
button[data-size='md'] > wui-image {
|
|
823
|
+
width: 24px;
|
|
824
|
+
height: 24px;
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
button[data-size='sm'] > wui-icon {
|
|
828
|
+
width: 12px;
|
|
829
|
+
height: 12px;
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
button[data-size='md'] > wui-icon {
|
|
833
|
+
width: 14px;
|
|
834
|
+
height: 14px;
|
|
835
|
+
}
|
|
836
|
+
|
|
837
|
+
wui-image {
|
|
838
|
+
border-radius: var(--wui-border-radius-3xl);
|
|
839
|
+
overflow: hidden;
|
|
840
|
+
}
|
|
841
|
+
|
|
842
|
+
button.disabled > wui-icon,
|
|
843
|
+
button.disabled > wui-image {
|
|
844
|
+
filter: grayscale(1);
|
|
845
|
+
}
|
|
846
|
+
|
|
847
|
+
button[data-variant='main'] > wui-image {
|
|
848
|
+
box-shadow: inset 0 0 0 1px var(--wui-color-accent-090);
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
button[data-variant='shade'] > wui-image,
|
|
852
|
+
button[data-variant='gray'] > wui-image {
|
|
853
|
+
box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010);
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
@media (hover: hover) and (pointer: fine) {
|
|
857
|
+
button[data-variant='main']:focus-visible {
|
|
858
|
+
background-color: var(--wui-color-accent-090);
|
|
859
|
+
}
|
|
860
|
+
|
|
861
|
+
button[data-variant='main']:hover:enabled {
|
|
862
|
+
background-color: var(--wui-color-accent-090);
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
button[data-variant='main']:active:enabled {
|
|
866
|
+
background-color: var(--wui-color-accent-080);
|
|
867
|
+
}
|
|
868
|
+
|
|
869
|
+
button[data-variant='accent']:hover:enabled {
|
|
870
|
+
background-color: var(--wui-color-accent-glass-015);
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
button[data-variant='accent']:active:enabled {
|
|
874
|
+
background-color: var(--wui-color-accent-glass-020);
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
button[data-variant='shade']:focus-visible,
|
|
878
|
+
button[data-variant='gray']:focus-visible,
|
|
879
|
+
button[data-variant='shade']:hover,
|
|
880
|
+
button[data-variant='gray']:hover {
|
|
881
|
+
background-color: var(--wui-color-gray-glass-002);
|
|
882
|
+
}
|
|
883
|
+
|
|
884
|
+
button[data-variant='gray']:active,
|
|
885
|
+
button[data-variant='shade']:active {
|
|
886
|
+
background-color: var(--wui-color-gray-glass-005);
|
|
887
|
+
}
|
|
888
|
+
}
|
|
889
|
+
|
|
890
|
+
button.disabled {
|
|
891
|
+
color: var(--wui-color-gray-glass-020);
|
|
892
|
+
background-color: var(--wui-color-gray-glass-002);
|
|
893
|
+
box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-002);
|
|
894
|
+
pointer-events: none;
|
|
895
|
+
}
|
|
896
|
+
`;var Ee=function(r,e,n,i){var o=arguments.length,t=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,n):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(r,e,n,i);else for(var s=r.length-1;s>=0;s--)(a=r[s])&&(t=(o<3?a(t):o>3?a(e,n,t):a(e,n))||t);return o>3&&t&&Object.defineProperty(e,n,t),t};let pe=class extends O{constructor(){super(...arguments),this.variant="accent",this.imageSrc="",this.disabled=!1,this.icon="externalLink",this.size="md",this.text=""}render(){const e=this.size==="sm"?"small-600":"paragraph-600";return c`
|
|
897
|
+
<button
|
|
898
|
+
class=${this.disabled?"disabled":""}
|
|
899
|
+
data-variant=${this.variant}
|
|
900
|
+
data-size=${this.size}
|
|
901
|
+
>
|
|
902
|
+
${this.imageSrc?c`<wui-image src=${this.imageSrc}></wui-image>`:null}
|
|
903
|
+
<wui-text variant=${e} color="inherit"> ${this.text} </wui-text>
|
|
904
|
+
<wui-icon name=${this.icon} color="inherit" size="inherit"></wui-icon>
|
|
905
|
+
</button>
|
|
906
|
+
`}};pe.styles=[q,G,ki];Ee([u()],pe.prototype,"variant",void 0);Ee([u()],pe.prototype,"imageSrc",void 0);Ee([u({type:Boolean})],pe.prototype,"disabled",void 0);Ee([u()],pe.prototype,"icon",void 0);Ee([u()],pe.prototype,"size",void 0);Ee([u()],pe.prototype,"text",void 0);pe=Ee([T("wui-chip-button")],pe);const Di=N`
|
|
907
|
+
wui-flex {
|
|
908
|
+
width: 100%;
|
|
909
|
+
background-color: var(--wui-color-gray-glass-002);
|
|
910
|
+
border-radius: var(--wui-border-radius-xs);
|
|
911
|
+
}
|
|
912
|
+
`;var yt=function(r,e,n,i){var o=arguments.length,t=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,n):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(r,e,n,i);else for(var s=r.length-1;s>=0;s--)(a=r[s])&&(t=(o<3?a(t):o>3?a(e,n,t):a(e,n))||t);return o>3&&t&&Object.defineProperty(e,n,t),t};let Pe=class extends O{constructor(){super(...arguments),this.disabled=!1,this.label="",this.buttonLabel=""}render(){return c`
|
|
913
|
+
<wui-flex
|
|
914
|
+
justifyContent="space-between"
|
|
915
|
+
alignItems="center"
|
|
916
|
+
.padding=${["1xs","2l","1xs","2l"]}
|
|
917
|
+
>
|
|
918
|
+
<wui-text variant="paragraph-500" color="fg-200">${this.label}</wui-text>
|
|
919
|
+
<wui-chip-button size="sm" variant="shade" text=${this.buttonLabel} icon="chevronRight">
|
|
920
|
+
</wui-chip-button>
|
|
921
|
+
</wui-flex>
|
|
922
|
+
`}};Pe.styles=[q,G,Di];yt([u({type:Boolean})],Pe.prototype,"disabled",void 0);yt([u()],Pe.prototype,"label",void 0);yt([u()],Pe.prototype,"buttonLabel",void 0);Pe=yt([T("wui-cta-button")],Pe);const zi=N`
|
|
923
|
+
:host {
|
|
924
|
+
display: block;
|
|
925
|
+
padding: 0 var(--wui-spacing-xl) var(--wui-spacing-xl);
|
|
926
|
+
}
|
|
927
|
+
`;var ai=function(r,e,n,i){var o=arguments.length,t=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,n):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(r,e,n,i);else for(var s=r.length-1;s>=0;s--)(a=r[s])&&(t=(o<3?a(t):o>3?a(e,n,t):a(e,n))||t);return o>3&&t&&Object.defineProperty(e,n,t),t};let st=class extends O{constructor(){super(...arguments),this.wallet=void 0}render(){if(!this.wallet)return this.style.display="none",null;const{name:e,app_store:n,play_store:i,chrome_store:o,homepage:t}=this.wallet,a=j.isMobile(),s=j.isIos(),l=j.isAndroid(),d=[n,i,t,o].filter(Boolean).length>1,p=he.getTruncateString({string:e,charsStart:12,charsEnd:0,truncate:"end"});return d&&!a?c`
|
|
928
|
+
<wui-cta-button
|
|
929
|
+
label=${`Don't have ${p}?`}
|
|
930
|
+
buttonLabel="Get"
|
|
931
|
+
@click=${()=>U.push("Downloads",{wallet:this.wallet})}
|
|
932
|
+
></wui-cta-button>
|
|
933
|
+
`:!d&&t?c`
|
|
934
|
+
<wui-cta-button
|
|
935
|
+
label=${`Don't have ${p}?`}
|
|
936
|
+
buttonLabel="Get"
|
|
937
|
+
@click=${this.onHomePage.bind(this)}
|
|
938
|
+
></wui-cta-button>
|
|
939
|
+
`:n&&s?c`
|
|
940
|
+
<wui-cta-button
|
|
941
|
+
label=${`Don't have ${p}?`}
|
|
942
|
+
buttonLabel="Get"
|
|
943
|
+
@click=${this.onAppStore.bind(this)}
|
|
944
|
+
></wui-cta-button>
|
|
945
|
+
`:i&&l?c`
|
|
946
|
+
<wui-cta-button
|
|
947
|
+
label=${`Don't have ${p}?`}
|
|
948
|
+
buttonLabel="Get"
|
|
949
|
+
@click=${this.onPlayStore.bind(this)}
|
|
950
|
+
></wui-cta-button>
|
|
951
|
+
`:(this.style.display="none",null)}onAppStore(){this.wallet?.app_store&&j.openHref(this.wallet.app_store,"_blank")}onPlayStore(){this.wallet?.play_store&&j.openHref(this.wallet.play_store,"_blank")}onHomePage(){this.wallet?.homepage&&j.openHref(this.wallet.homepage,"_blank")}};st.styles=[zi];ai([u({type:Object})],st.prototype,"wallet",void 0);st=ai([T("w3m-mobile-download-links")],st);const Ni=N`
|
|
952
|
+
@keyframes shake {
|
|
953
|
+
0% {
|
|
954
|
+
transform: translateX(0);
|
|
955
|
+
}
|
|
956
|
+
25% {
|
|
957
|
+
transform: translateX(3px);
|
|
958
|
+
}
|
|
959
|
+
50% {
|
|
960
|
+
transform: translateX(-3px);
|
|
961
|
+
}
|
|
962
|
+
75% {
|
|
963
|
+
transform: translateX(3px);
|
|
964
|
+
}
|
|
965
|
+
100% {
|
|
966
|
+
transform: translateX(0);
|
|
967
|
+
}
|
|
968
|
+
}
|
|
969
|
+
|
|
970
|
+
wui-flex:first-child:not(:only-child) {
|
|
971
|
+
position: relative;
|
|
972
|
+
}
|
|
973
|
+
|
|
974
|
+
wui-loading-thumbnail {
|
|
975
|
+
position: absolute;
|
|
976
|
+
}
|
|
977
|
+
|
|
978
|
+
wui-icon-box {
|
|
979
|
+
position: absolute;
|
|
980
|
+
right: calc(var(--wui-spacing-3xs) * -1);
|
|
981
|
+
bottom: calc(var(--wui-spacing-3xs) * -1);
|
|
982
|
+
opacity: 0;
|
|
983
|
+
transform: scale(0.5);
|
|
984
|
+
transition-property: opacity, transform;
|
|
985
|
+
transition-duration: var(--wui-duration-lg);
|
|
986
|
+
transition-timing-function: var(--wui-ease-out-power-2);
|
|
987
|
+
will-change: opacity, transform;
|
|
988
|
+
}
|
|
989
|
+
|
|
990
|
+
wui-text[align='center'] {
|
|
991
|
+
width: 100%;
|
|
992
|
+
padding: 0px var(--wui-spacing-l);
|
|
993
|
+
}
|
|
994
|
+
|
|
995
|
+
[data-error='true'] wui-icon-box {
|
|
996
|
+
opacity: 1;
|
|
997
|
+
transform: scale(1);
|
|
998
|
+
}
|
|
999
|
+
|
|
1000
|
+
[data-error='true'] > wui-flex:first-child {
|
|
1001
|
+
animation: shake 250ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
[data-retry='false'] wui-link {
|
|
1005
|
+
display: none;
|
|
1006
|
+
}
|
|
1007
|
+
|
|
1008
|
+
[data-retry='true'] wui-link {
|
|
1009
|
+
display: block;
|
|
1010
|
+
opacity: 1;
|
|
1011
|
+
}
|
|
1012
|
+
`;var se=function(r,e,n,i){var o=arguments.length,t=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,n):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(r,e,n,i);else for(var s=r.length-1;s>=0;s--)(a=r[s])&&(t=(o<3?a(t):o>3?a(e,n,t):a(e,n))||t);return o>3&&t&&Object.defineProperty(e,n,t),t};class V extends O{constructor(){super(),this.wallet=U.state.data?.wallet,this.connector=U.state.data?.connector,this.timeout=void 0,this.secondaryBtnIcon="refresh",this.onConnect=void 0,this.onRender=void 0,this.onAutoConnect=void 0,this.isWalletConnect=!0,this.unsubscribe=[],this.imageSrc=K.getWalletImage(this.wallet)??K.getConnectorImage(this.connector),this.name=this.wallet?.name??this.connector?.name??"Wallet",this.isRetrying=!1,this.uri=k.state.wcUri,this.error=k.state.wcError,this.ready=!1,this.showRetry=!1,this.secondaryBtnLabel="Try again",this.secondaryLabel="Accept connection request in the wallet",this.isLoading=!1,this.isMobile=!1,this.onRetry=void 0,this.unsubscribe.push(k.subscribeKey("wcUri",e=>{this.uri=e,this.isRetrying&&this.onRetry&&(this.isRetrying=!1,this.onConnect?.())}),k.subscribeKey("wcError",e=>this.error=e)),(j.isTelegram()||j.isSafari())&&j.isIos()&&k.state.wcUri&&this.onConnect?.()}firstUpdated(){this.onAutoConnect?.(),this.showRetry=!this.onAutoConnect}disconnectedCallback(){this.unsubscribe.forEach(e=>e()),k.setWcError(!1),clearTimeout(this.timeout)}render(){this.onRender?.(),this.onShowRetry();const e=this.error?"Connection can be declined if a previous request is still active":this.secondaryLabel;let n=`Continue in ${this.name}`;return this.error&&(n="Connection declined"),c`
|
|
1013
|
+
<wui-flex
|
|
1014
|
+
data-error=${W(this.error)}
|
|
1015
|
+
data-retry=${this.showRetry}
|
|
1016
|
+
flexDirection="column"
|
|
1017
|
+
alignItems="center"
|
|
1018
|
+
.padding=${["3xl","xl","xl","xl"]}
|
|
1019
|
+
gap="xl"
|
|
1020
|
+
>
|
|
1021
|
+
<wui-flex justifyContent="center" alignItems="center">
|
|
1022
|
+
<wui-wallet-image size="lg" imageSrc=${W(this.imageSrc)}></wui-wallet-image>
|
|
1023
|
+
|
|
1024
|
+
${this.error?null:this.loaderTemplate()}
|
|
1025
|
+
|
|
1026
|
+
<wui-icon-box
|
|
1027
|
+
backgroundColor="error-100"
|
|
1028
|
+
background="opaque"
|
|
1029
|
+
iconColor="error-100"
|
|
1030
|
+
icon="close"
|
|
1031
|
+
size="sm"
|
|
1032
|
+
border
|
|
1033
|
+
borderColor="wui-color-bg-125"
|
|
1034
|
+
></wui-icon-box>
|
|
1035
|
+
</wui-flex>
|
|
1036
|
+
|
|
1037
|
+
<wui-flex flexDirection="column" alignItems="center" gap="xs">
|
|
1038
|
+
<wui-text variant="paragraph-500" color=${this.error?"error-100":"fg-100"}>
|
|
1039
|
+
${n}
|
|
1040
|
+
</wui-text>
|
|
1041
|
+
<wui-text align="center" variant="small-500" color="fg-200">${e}</wui-text>
|
|
1042
|
+
</wui-flex>
|
|
1043
|
+
|
|
1044
|
+
${this.secondaryBtnLabel?c`
|
|
1045
|
+
<wui-button
|
|
1046
|
+
variant="accent"
|
|
1047
|
+
size="md"
|
|
1048
|
+
?disabled=${this.isRetrying||this.isLoading}
|
|
1049
|
+
@click=${this.onTryAgain.bind(this)}
|
|
1050
|
+
data-testid="w3m-connecting-widget-secondary-button"
|
|
1051
|
+
>
|
|
1052
|
+
<wui-icon color="inherit" slot="iconLeft" name=${this.secondaryBtnIcon}></wui-icon>
|
|
1053
|
+
${this.secondaryBtnLabel}
|
|
1054
|
+
</wui-button>
|
|
1055
|
+
`:null}
|
|
1056
|
+
</wui-flex>
|
|
1057
|
+
|
|
1058
|
+
${this.isWalletConnect?c`
|
|
1059
|
+
<wui-flex .padding=${["0","xl","xl","xl"]} justifyContent="center">
|
|
1060
|
+
<wui-link @click=${this.onCopyUri} color="fg-200" data-testid="wui-link-copy">
|
|
1061
|
+
<wui-icon size="xs" color="fg-200" slot="iconLeft" name="copy"></wui-icon>
|
|
1062
|
+
Copy link
|
|
1063
|
+
</wui-link>
|
|
1064
|
+
</wui-flex>
|
|
1065
|
+
`:null}
|
|
1066
|
+
|
|
1067
|
+
<w3m-mobile-download-links .wallet=${this.wallet}></w3m-mobile-download-links>
|
|
1068
|
+
`}onShowRetry(){this.error&&!this.showRetry&&(this.showRetry=!0,this.shadowRoot?.querySelector("wui-button")?.animate([{opacity:0},{opacity:1}],{fill:"forwards",easing:"ease"}))}onTryAgain(){k.setWcError(!1),this.onRetry?(this.isRetrying=!0,this.onRetry?.()):this.onConnect?.()}loaderTemplate(){const e=Zt.state.themeVariables["--w3m-border-radius-master"],n=e?parseInt(e.replace("px",""),10):4;return c`<wui-loading-thumbnail radius=${n*9}></wui-loading-thumbnail>`}onCopyUri(){try{this.uri&&(j.copyToClopboard(this.uri),Xe.showSuccess("Link copied"))}catch{Xe.showError("Failed to copy")}}}V.styles=Ni;se([I()],V.prototype,"isRetrying",void 0);se([I()],V.prototype,"uri",void 0);se([I()],V.prototype,"error",void 0);se([I()],V.prototype,"ready",void 0);se([I()],V.prototype,"showRetry",void 0);se([I()],V.prototype,"secondaryBtnLabel",void 0);se([I()],V.prototype,"secondaryLabel",void 0);se([I()],V.prototype,"isLoading",void 0);se([u({type:Boolean})],V.prototype,"isMobile",void 0);se([u()],V.prototype,"onRetry",void 0);var Mi=function(r,e,n,i){var o=arguments.length,t=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,n):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(r,e,n,i);else for(var s=r.length-1;s>=0;s--)(a=r[s])&&(t=(o<3?a(t):o>3?a(e,n,t):a(e,n))||t);return o>3&&t&&Object.defineProperty(e,n,t),t};let Cn=class extends V{constructor(){if(super(),!this.wallet)throw new Error("w3m-connecting-wc-browser: No wallet provided");this.onConnect=this.onConnectProxy.bind(this),this.onAutoConnect=this.onConnectProxy.bind(this),te.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"browser"}})}async onConnectProxy(){try{this.error=!1;const{connectors:e}=M.state,n=e.find(i=>i.type==="ANNOUNCED"&&i.info?.rdns===this.wallet?.rdns||i.type==="INJECTED"||i.name===this.wallet?.name);if(n)await k.connectExternal(n,n.chain);else throw new Error("w3m-connecting-wc-browser: No connector found");ni.close(),te.sendEvent({type:"track",event:"CONNECT_SUCCESS",properties:{method:"browser",name:this.wallet?.name||"Unknown"}})}catch(e){te.sendEvent({type:"track",event:"CONNECT_ERROR",properties:{message:e?.message??"Unknown"}}),this.error=!0}}};Cn=Mi([T("w3m-connecting-wc-browser")],Cn);var Ui=function(r,e,n,i){var o=arguments.length,t=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,n):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(r,e,n,i);else for(var s=r.length-1;s>=0;s--)(a=r[s])&&(t=(o<3?a(t):o>3?a(e,n,t):a(e,n))||t);return o>3&&t&&Object.defineProperty(e,n,t),t};let Rn=class extends V{constructor(){if(super(),!this.wallet)throw new Error("w3m-connecting-wc-desktop: No wallet provided");this.onConnect=this.onConnectProxy.bind(this),this.onRender=this.onRenderProxy.bind(this),te.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"desktop"}})}onRenderProxy(){!this.ready&&this.uri&&(this.ready=!0,this.onConnect?.())}onConnectProxy(){if(this.wallet?.desktop_link&&this.uri)try{this.error=!1;const{desktop_link:e,name:n}=this.wallet,{redirect:i,href:o}=j.formatNativeUrl(e,this.uri);k.setWcLinking({name:n,href:o}),k.setRecentWallet(this.wallet),j.openHref(i,"_blank")}catch{this.error=!0}}};Rn=Ui([T("w3m-connecting-wc-desktop")],Rn);var je=function(r,e,n,i){var o=arguments.length,t=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,n):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(r,e,n,i);else for(var s=r.length-1;s>=0;s--)(a=r[s])&&(t=(o<3?a(t):o>3?a(e,n,t):a(e,n))||t);return o>3&&t&&Object.defineProperty(e,n,t),t};let Ce=class extends V{constructor(){if(super(),this.btnLabelTimeout=void 0,this.redirectDeeplink=void 0,this.redirectUniversalLink=void 0,this.target=void 0,this.preferUniversalLinks=ee.state.experimental_preferUniversalLinks,this.isLoading=!0,this.onConnect=()=>{if(this.wallet?.mobile_link&&this.uri)try{this.error=!1;const{mobile_link:e,link_mode:n,name:i}=this.wallet,{redirect:o,redirectUniversalLink:t,href:a}=j.formatNativeUrl(e,this.uri,n);this.redirectDeeplink=o,this.redirectUniversalLink=t,this.target=j.isIframe()?"_top":"_self",k.setWcLinking({name:i,href:a}),k.setRecentWallet(this.wallet),this.preferUniversalLinks&&this.redirectUniversalLink?j.openHref(this.redirectUniversalLink,this.target):j.openHref(this.redirectDeeplink,this.target)}catch(e){te.sendEvent({type:"track",event:"CONNECT_PROXY_ERROR",properties:{message:e instanceof Error?e.message:"Error parsing the deeplink",uri:this.uri,mobile_link:this.wallet.mobile_link,name:this.wallet.name}}),this.error=!0}},!this.wallet)throw new Error("w3m-connecting-wc-mobile: No wallet provided");this.secondaryBtnLabel="Open",this.secondaryLabel=ii.CONNECT_LABELS.MOBILE,this.secondaryBtnIcon="externalLink",this.onHandleURI(),this.unsubscribe.push(k.subscribeKey("wcUri",()=>{this.onHandleURI()})),te.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"mobile"}})}disconnectedCallback(){super.disconnectedCallback(),clearTimeout(this.btnLabelTimeout)}onHandleURI(){this.isLoading=!this.uri,!this.ready&&this.uri&&(this.ready=!0,this.onConnect?.())}onTryAgain(){k.setWcError(!1),this.onConnect?.()}};je([I()],Ce.prototype,"redirectDeeplink",void 0);je([I()],Ce.prototype,"redirectUniversalLink",void 0);je([I()],Ce.prototype,"target",void 0);je([I()],Ce.prototype,"preferUniversalLinks",void 0);je([I()],Ce.prototype,"isLoading",void 0);Ce=je([T("w3m-connecting-wc-mobile")],Ce);var Te={},Wt,$n;function qi(){return $n||($n=1,Wt=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),Wt}var _t={},me={},In;function We(){if(In)return me;In=1;let r;const e=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];return me.getSymbolSize=function(i){if(!i)throw new Error('"version" cannot be null or undefined');if(i<1||i>40)throw new Error('"version" should be in range from 1 to 40');return i*4+17},me.getSymbolTotalCodewords=function(i){return e[i]},me.getBCHDigit=function(n){let i=0;for(;n!==0;)i++,n>>>=1;return i},me.setToSJISFunction=function(i){if(typeof i!="function")throw new Error('"toSJISFunc" is not a valid function.');r=i},me.isKanjiModeEnabled=function(){return typeof r<"u"},me.toSJIS=function(i){return r(i)},me}var St={},En;function hn(){return En||(En=1,(function(r){r.L={bit:1},r.M={bit:0},r.Q={bit:3},r.H={bit:2};function e(n){if(typeof n!="string")throw new Error("Param is not a string");switch(n.toLowerCase()){case"l":case"low":return r.L;case"m":case"medium":return r.M;case"q":case"quartile":return r.Q;case"h":case"high":return r.H;default:throw new Error("Unknown EC Level: "+n)}}r.isValid=function(i){return i&&typeof i.bit<"u"&&i.bit>=0&&i.bit<4},r.from=function(i,o){if(r.isValid(i))return i;try{return e(i)}catch{return o}}})(St)),St}var Tt,Wn;function Fi(){if(Wn)return Tt;Wn=1;function r(){this.buffer=[],this.length=0}return r.prototype={get:function(e){const n=Math.floor(e/8);return(this.buffer[n]>>>7-e%8&1)===1},put:function(e,n){for(let i=0;i<n;i++)this.putBit((e>>>n-i-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(e){const n=Math.floor(this.length/8);this.buffer.length<=n&&this.buffer.push(0),e&&(this.buffer[n]|=128>>>this.length%8),this.length++}},Tt=r,Tt}var Bt,_n;function Vi(){if(_n)return Bt;_n=1;function r(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}return r.prototype.set=function(e,n,i,o){const t=e*this.size+n;this.data[t]=i,o&&(this.reservedBit[t]=!0)},r.prototype.get=function(e,n){return this.data[e*this.size+n]},r.prototype.xor=function(e,n,i){this.data[e*this.size+n]^=i},r.prototype.isReserved=function(e,n){return this.reservedBit[e*this.size+n]},Bt=r,Bt}var Pt={},Sn;function Ki(){return Sn||(Sn=1,(function(r){const e=We().getSymbolSize;r.getRowColCoords=function(i){if(i===1)return[];const o=Math.floor(i/7)+2,t=e(i),a=t===145?26:Math.ceil((t-13)/(2*o-2))*2,s=[t-7];for(let l=1;l<o-1;l++)s[l]=s[l-1]-a;return s.push(6),s.reverse()},r.getPositions=function(i){const o=[],t=r.getRowColCoords(i),a=t.length;for(let s=0;s<a;s++)for(let l=0;l<a;l++)s===0&&l===0||s===0&&l===a-1||s===a-1&&l===0||o.push([t[s],t[l]]);return o}})(Pt)),Pt}var Lt={},Tn;function Hi(){if(Tn)return Lt;Tn=1;const r=We().getSymbolSize,e=7;return Lt.getPositions=function(i){const o=r(i);return[[0,0],[o-e,0],[0,o-e]]},Lt}var Ot={},Bn;function Gi(){return Bn||(Bn=1,(function(r){r.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const e={N1:3,N2:3,N3:40,N4:10};r.isValid=function(o){return o!=null&&o!==""&&!isNaN(o)&&o>=0&&o<=7},r.from=function(o){return r.isValid(o)?parseInt(o,10):void 0},r.getPenaltyN1=function(o){const t=o.size;let a=0,s=0,l=0,d=null,p=null;for(let w=0;w<t;w++){s=l=0,d=p=null;for(let C=0;C<t;C++){let g=o.get(w,C);g===d?s++:(s>=5&&(a+=e.N1+(s-5)),d=g,s=1),g=o.get(C,w),g===p?l++:(l>=5&&(a+=e.N1+(l-5)),p=g,l=1)}s>=5&&(a+=e.N1+(s-5)),l>=5&&(a+=e.N1+(l-5))}return a},r.getPenaltyN2=function(o){const t=o.size;let a=0;for(let s=0;s<t-1;s++)for(let l=0;l<t-1;l++){const d=o.get(s,l)+o.get(s,l+1)+o.get(s+1,l)+o.get(s+1,l+1);(d===4||d===0)&&a++}return a*e.N2},r.getPenaltyN3=function(o){const t=o.size;let a=0,s=0,l=0;for(let d=0;d<t;d++){s=l=0;for(let p=0;p<t;p++)s=s<<1&2047|o.get(d,p),p>=10&&(s===1488||s===93)&&a++,l=l<<1&2047|o.get(p,d),p>=10&&(l===1488||l===93)&&a++}return a*e.N3},r.getPenaltyN4=function(o){let t=0;const a=o.data.length;for(let l=0;l<a;l++)t+=o.data[l];return Math.abs(Math.ceil(t*100/a/5)-10)*e.N4};function n(i,o,t){switch(i){case r.Patterns.PATTERN000:return(o+t)%2===0;case r.Patterns.PATTERN001:return o%2===0;case r.Patterns.PATTERN010:return t%3===0;case r.Patterns.PATTERN011:return(o+t)%3===0;case r.Patterns.PATTERN100:return(Math.floor(o/2)+Math.floor(t/3))%2===0;case r.Patterns.PATTERN101:return o*t%2+o*t%3===0;case r.Patterns.PATTERN110:return(o*t%2+o*t%3)%2===0;case r.Patterns.PATTERN111:return(o*t%3+(o+t)%2)%2===0;default:throw new Error("bad maskPattern:"+i)}}r.applyMask=function(o,t){const a=t.size;for(let s=0;s<a;s++)for(let l=0;l<a;l++)t.isReserved(l,s)||t.xor(l,s,n(o,l,s))},r.getBestMask=function(o,t){const a=Object.keys(r.Patterns).length;let s=0,l=1/0;for(let d=0;d<a;d++){t(d),r.applyMask(d,o);const p=r.getPenaltyN1(o)+r.getPenaltyN2(o)+r.getPenaltyN3(o)+r.getPenaltyN4(o);r.applyMask(d,o),p<l&&(l=p,s=d)}return s}})(Ot)),Ot}var Qe={},Pn;function si(){if(Pn)return Qe;Pn=1;const r=hn(),e=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],n=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];return Qe.getBlocksCount=function(o,t){switch(t){case r.L:return e[(o-1)*4+0];case r.M:return e[(o-1)*4+1];case r.Q:return e[(o-1)*4+2];case r.H:return e[(o-1)*4+3];default:return}},Qe.getTotalCodewordsCount=function(o,t){switch(t){case r.L:return n[(o-1)*4+0];case r.M:return n[(o-1)*4+1];case r.Q:return n[(o-1)*4+2];case r.H:return n[(o-1)*4+3];default:return}},Qe}var At={},ze={},Ln;function Yi(){if(Ln)return ze;Ln=1;const r=new Uint8Array(512),e=new Uint8Array(256);return(function(){let i=1;for(let o=0;o<255;o++)r[o]=i,e[i]=o,i<<=1,i&256&&(i^=285);for(let o=255;o<512;o++)r[o]=r[o-255]})(),ze.log=function(i){if(i<1)throw new Error("log("+i+")");return e[i]},ze.exp=function(i){return r[i]},ze.mul=function(i,o){return i===0||o===0?0:r[e[i]+e[o]]},ze}var On;function Ji(){return On||(On=1,(function(r){const e=Yi();r.mul=function(i,o){const t=new Uint8Array(i.length+o.length-1);for(let a=0;a<i.length;a++)for(let s=0;s<o.length;s++)t[a+s]^=e.mul(i[a],o[s]);return t},r.mod=function(i,o){let t=new Uint8Array(i);for(;t.length-o.length>=0;){const a=t[0];for(let l=0;l<o.length;l++)t[l]^=e.mul(o[l],a);let s=0;for(;s<t.length&&t[s]===0;)s++;t=t.slice(s)}return t},r.generateECPolynomial=function(i){let o=new Uint8Array([1]);for(let t=0;t<i;t++)o=r.mul(o,new Uint8Array([1,e.exp(t)]));return o}})(At)),At}var jt,An;function Qi(){if(An)return jt;An=1;const r=Ji();function e(n){this.genPoly=void 0,this.degree=n,this.degree&&this.initialize(this.degree)}return e.prototype.initialize=function(i){this.degree=i,this.genPoly=r.generateECPolynomial(this.degree)},e.prototype.encode=function(i){if(!this.genPoly)throw new Error("Encoder not initialized");const o=new Uint8Array(i.length+this.degree);o.set(i);const t=r.mod(o,this.genPoly),a=this.degree-t.length;if(a>0){const s=new Uint8Array(this.degree);return s.set(t,a),s}return t},jt=e,jt}var kt={},Dt={},zt={},jn;function li(){return jn||(jn=1,zt.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}),zt}var oe={},kn;function ci(){if(kn)return oe;kn=1;const r="[0-9]+",e="[A-Z $%*+\\-./:]+";let n="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";n=n.replace(/u/g,"\\u");const i="(?:(?![A-Z0-9 $%*+\\-./:]|"+n+`)(?:.|[\r
|
|
1069
|
+
]))+`;oe.KANJI=new RegExp(n,"g"),oe.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),oe.BYTE=new RegExp(i,"g"),oe.NUMERIC=new RegExp(r,"g"),oe.ALPHANUMERIC=new RegExp(e,"g");const o=new RegExp("^"+n+"$"),t=new RegExp("^"+r+"$"),a=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return oe.testKanji=function(l){return o.test(l)},oe.testNumeric=function(l){return t.test(l)},oe.testAlphanumeric=function(l){return a.test(l)},oe}var Dn;function _e(){return Dn||(Dn=1,(function(r){const e=li(),n=ci();r.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},r.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},r.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},r.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},r.MIXED={bit:-1},r.getCharCountIndicator=function(t,a){if(!t.ccBits)throw new Error("Invalid mode: "+t);if(!e.isValid(a))throw new Error("Invalid version: "+a);return a>=1&&a<10?t.ccBits[0]:a<27?t.ccBits[1]:t.ccBits[2]},r.getBestModeForData=function(t){return n.testNumeric(t)?r.NUMERIC:n.testAlphanumeric(t)?r.ALPHANUMERIC:n.testKanji(t)?r.KANJI:r.BYTE},r.toString=function(t){if(t&&t.id)return t.id;throw new Error("Invalid mode")},r.isValid=function(t){return t&&t.bit&&t.ccBits};function i(o){if(typeof o!="string")throw new Error("Param is not a string");switch(o.toLowerCase()){case"numeric":return r.NUMERIC;case"alphanumeric":return r.ALPHANUMERIC;case"kanji":return r.KANJI;case"byte":return r.BYTE;default:throw new Error("Unknown mode: "+o)}}r.from=function(t,a){if(r.isValid(t))return t;try{return i(t)}catch{return a}}})(Dt)),Dt}var zn;function Xi(){return zn||(zn=1,(function(r){const e=We(),n=si(),i=hn(),o=_e(),t=li(),a=7973,s=e.getBCHDigit(a);function l(C,g,L){for(let y=1;y<=40;y++)if(g<=r.getCapacity(y,L,C))return y}function d(C,g){return o.getCharCountIndicator(C,g)+4}function p(C,g){let L=0;return C.forEach(function(y){const B=d(y.mode,g);L+=B+y.getBitsLength()}),L}function w(C,g){for(let L=1;L<=40;L++)if(p(C,L)<=r.getCapacity(L,g,o.MIXED))return L}r.from=function(g,L){return t.isValid(g)?parseInt(g,10):L},r.getCapacity=function(g,L,y){if(!t.isValid(g))throw new Error("Invalid QR Code version");typeof y>"u"&&(y=o.BYTE);const B=e.getSymbolTotalCodewords(g),b=n.getTotalCodewordsCount(g,L),f=(B-b)*8;if(y===o.MIXED)return f;const m=f-d(y,g);switch(y){case o.NUMERIC:return Math.floor(m/10*3);case o.ALPHANUMERIC:return Math.floor(m/11*2);case o.KANJI:return Math.floor(m/13);case o.BYTE:default:return Math.floor(m/8)}},r.getBestVersionForData=function(g,L){let y;const B=i.from(L,i.M);if(Array.isArray(g)){if(g.length>1)return w(g,B);if(g.length===0)return 1;y=g[0]}else y=g;return l(y.mode,y.getLength(),B)},r.getEncodedBits=function(g){if(!t.isValid(g)||g<7)throw new Error("Invalid QR Code version");let L=g<<12;for(;e.getBCHDigit(L)-s>=0;)L^=a<<e.getBCHDigit(L)-s;return g<<12|L}})(kt)),kt}var Nt={},Nn;function Zi(){if(Nn)return Nt;Nn=1;const r=We(),e=1335,n=21522,i=r.getBCHDigit(e);return Nt.getEncodedBits=function(t,a){const s=t.bit<<3|a;let l=s<<10;for(;r.getBCHDigit(l)-i>=0;)l^=e<<r.getBCHDigit(l)-i;return(s<<10|l)^n},Nt}var Mt={},Ut,Mn;function eo(){if(Mn)return Ut;Mn=1;const r=_e();function e(n){this.mode=r.NUMERIC,this.data=n.toString()}return e.getBitsLength=function(i){return 10*Math.floor(i/3)+(i%3?i%3*3+1:0)},e.prototype.getLength=function(){return this.data.length},e.prototype.getBitsLength=function(){return e.getBitsLength(this.data.length)},e.prototype.write=function(i){let o,t,a;for(o=0;o+3<=this.data.length;o+=3)t=this.data.substr(o,3),a=parseInt(t,10),i.put(a,10);const s=this.data.length-o;s>0&&(t=this.data.substr(o),a=parseInt(t,10),i.put(a,s*3+1))},Ut=e,Ut}var qt,Un;function to(){if(Un)return qt;Un=1;const r=_e(),e=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function n(i){this.mode=r.ALPHANUMERIC,this.data=i}return n.getBitsLength=function(o){return 11*Math.floor(o/2)+6*(o%2)},n.prototype.getLength=function(){return this.data.length},n.prototype.getBitsLength=function(){return n.getBitsLength(this.data.length)},n.prototype.write=function(o){let t;for(t=0;t+2<=this.data.length;t+=2){let a=e.indexOf(this.data[t])*45;a+=e.indexOf(this.data[t+1]),o.put(a,11)}this.data.length%2&&o.put(e.indexOf(this.data[t]),6)},qt=n,qt}var Ft,qn;function no(){return qn||(qn=1,Ft=function(e){for(var n=[],i=e.length,o=0;o<i;o++){var t=e.charCodeAt(o);if(t>=55296&&t<=56319&&i>o+1){var a=e.charCodeAt(o+1);a>=56320&&a<=57343&&(t=(t-55296)*1024+a-56320+65536,o+=1)}if(t<128){n.push(t);continue}if(t<2048){n.push(t>>6|192),n.push(t&63|128);continue}if(t<55296||t>=57344&&t<65536){n.push(t>>12|224),n.push(t>>6&63|128),n.push(t&63|128);continue}if(t>=65536&&t<=1114111){n.push(t>>18|240),n.push(t>>12&63|128),n.push(t>>6&63|128),n.push(t&63|128);continue}n.push(239,191,189)}return new Uint8Array(n).buffer}),Ft}var Vt,Fn;function io(){if(Fn)return Vt;Fn=1;const r=no(),e=_e();function n(i){this.mode=e.BYTE,typeof i=="string"&&(i=r(i)),this.data=new Uint8Array(i)}return n.getBitsLength=function(o){return o*8},n.prototype.getLength=function(){return this.data.length},n.prototype.getBitsLength=function(){return n.getBitsLength(this.data.length)},n.prototype.write=function(i){for(let o=0,t=this.data.length;o<t;o++)i.put(this.data[o],8)},Vt=n,Vt}var Kt,Vn;function oo(){if(Vn)return Kt;Vn=1;const r=_e(),e=We();function n(i){this.mode=r.KANJI,this.data=i}return n.getBitsLength=function(o){return o*13},n.prototype.getLength=function(){return this.data.length},n.prototype.getBitsLength=function(){return n.getBitsLength(this.data.length)},n.prototype.write=function(i){let o;for(o=0;o<this.data.length;o++){let t=e.toSJIS(this.data[o]);if(t>=33088&&t<=40956)t-=33088;else if(t>=57408&&t<=60351)t-=49472;else throw new Error("Invalid SJIS character: "+this.data[o]+`
|
|
1070
|
+
Make sure your charset is UTF-8`);t=(t>>>8&255)*192+(t&255),i.put(t,13)}},Kt=n,Kt}var Kn;function ro(){return Kn||(Kn=1,(function(r){const e=_e(),n=eo(),i=to(),o=io(),t=oo(),a=ci(),s=We(),l=Ii();function d(b){return unescape(encodeURIComponent(b)).length}function p(b,f,m){const h=[];let D;for(;(D=b.exec(m))!==null;)h.push({data:D[0],index:D.index,mode:f,length:D[0].length});return h}function w(b){const f=p(a.NUMERIC,e.NUMERIC,b),m=p(a.ALPHANUMERIC,e.ALPHANUMERIC,b);let h,D;return s.isKanjiModeEnabled()?(h=p(a.BYTE,e.BYTE,b),D=p(a.KANJI,e.KANJI,b)):(h=p(a.BYTE_KANJI,e.BYTE,b),D=[]),f.concat(m,h,D).sort(function(_,E){return _.index-E.index}).map(function(_){return{data:_.data,mode:_.mode,length:_.length}})}function C(b,f){switch(f){case e.NUMERIC:return n.getBitsLength(b);case e.ALPHANUMERIC:return i.getBitsLength(b);case e.KANJI:return t.getBitsLength(b);case e.BYTE:return o.getBitsLength(b)}}function g(b){return b.reduce(function(f,m){const h=f.length-1>=0?f[f.length-1]:null;return h&&h.mode===m.mode?(f[f.length-1].data+=m.data,f):(f.push(m),f)},[])}function L(b){const f=[];for(let m=0;m<b.length;m++){const h=b[m];switch(h.mode){case e.NUMERIC:f.push([h,{data:h.data,mode:e.ALPHANUMERIC,length:h.length},{data:h.data,mode:e.BYTE,length:h.length}]);break;case e.ALPHANUMERIC:f.push([h,{data:h.data,mode:e.BYTE,length:h.length}]);break;case e.KANJI:f.push([h,{data:h.data,mode:e.BYTE,length:d(h.data)}]);break;case e.BYTE:f.push([{data:h.data,mode:e.BYTE,length:d(h.data)}])}}return f}function y(b,f){const m={},h={start:{}};let D=["start"];for(let x=0;x<b.length;x++){const _=b[x],E=[];for(let v=0;v<_.length;v++){const P=_[v],R=""+x+v;E.push(R),m[R]={node:P,lastCount:0},h[R]={};for(let S=0;S<D.length;S++){const $=D[S];m[$]&&m[$].node.mode===P.mode?(h[$][R]=C(m[$].lastCount+P.length,P.mode)-C(m[$].lastCount,P.mode),m[$].lastCount+=P.length):(m[$]&&(m[$].lastCount=P.length),h[$][R]=C(P.length,P.mode)+4+e.getCharCountIndicator(P.mode,f))}}D=E}for(let x=0;x<D.length;x++)h[D[x]].end=0;return{map:h,table:m}}function B(b,f){let m;const h=e.getBestModeForData(b);if(m=e.from(f,h),m!==e.BYTE&&m.bit<h.bit)throw new Error('"'+b+'" cannot be encoded with mode '+e.toString(m)+`.
|
|
1071
|
+
Suggested mode is: `+e.toString(h));switch(m===e.KANJI&&!s.isKanjiModeEnabled()&&(m=e.BYTE),m){case e.NUMERIC:return new n(b);case e.ALPHANUMERIC:return new i(b);case e.KANJI:return new t(b);case e.BYTE:return new o(b)}}r.fromArray=function(f){return f.reduce(function(m,h){return typeof h=="string"?m.push(B(h,null)):h.data&&m.push(B(h.data,h.mode)),m},[])},r.fromString=function(f,m){const h=w(f,s.isKanjiModeEnabled()),D=L(h),x=y(D,m),_=l.find_path(x.map,"start","end"),E=[];for(let v=1;v<_.length-1;v++)E.push(x.table[_[v]].node);return r.fromArray(g(E))},r.rawSplit=function(f){return r.fromArray(w(f,s.isKanjiModeEnabled()))}})(Mt)),Mt}var Hn;function ao(){if(Hn)return _t;Hn=1;const r=We(),e=hn(),n=Fi(),i=Vi(),o=Ki(),t=Hi(),a=Gi(),s=si(),l=Qi(),d=Xi(),p=Zi(),w=_e(),C=ro();function g(x,_){const E=x.size,v=t.getPositions(_);for(let P=0;P<v.length;P++){const R=v[P][0],S=v[P][1];for(let $=-1;$<=7;$++)if(!(R+$<=-1||E<=R+$))for(let A=-1;A<=7;A++)S+A<=-1||E<=S+A||($>=0&&$<=6&&(A===0||A===6)||A>=0&&A<=6&&($===0||$===6)||$>=2&&$<=4&&A>=2&&A<=4?x.set(R+$,S+A,!0,!0):x.set(R+$,S+A,!1,!0))}}function L(x){const _=x.size;for(let E=8;E<_-8;E++){const v=E%2===0;x.set(E,6,v,!0),x.set(6,E,v,!0)}}function y(x,_){const E=o.getPositions(_);for(let v=0;v<E.length;v++){const P=E[v][0],R=E[v][1];for(let S=-2;S<=2;S++)for(let $=-2;$<=2;$++)S===-2||S===2||$===-2||$===2||S===0&&$===0?x.set(P+S,R+$,!0,!0):x.set(P+S,R+$,!1,!0)}}function B(x,_){const E=x.size,v=d.getEncodedBits(_);let P,R,S;for(let $=0;$<18;$++)P=Math.floor($/3),R=$%3+E-8-3,S=(v>>$&1)===1,x.set(P,R,S,!0),x.set(R,P,S,!0)}function b(x,_,E){const v=x.size,P=p.getEncodedBits(_,E);let R,S;for(R=0;R<15;R++)S=(P>>R&1)===1,R<6?x.set(R,8,S,!0):R<8?x.set(R+1,8,S,!0):x.set(v-15+R,8,S,!0),R<8?x.set(8,v-R-1,S,!0):R<9?x.set(8,15-R-1+1,S,!0):x.set(8,15-R-1,S,!0);x.set(v-8,8,1,!0)}function f(x,_){const E=x.size;let v=-1,P=E-1,R=7,S=0;for(let $=E-1;$>0;$-=2)for($===6&&$--;;){for(let A=0;A<2;A++)if(!x.isReserved(P,$-A)){let we=!1;S<_.length&&(we=(_[S]>>>R&1)===1),x.set(P,$-A,we),R--,R===-1&&(S++,R=7)}if(P+=v,P<0||E<=P){P-=v,v=-v;break}}}function m(x,_,E){const v=new n;E.forEach(function(A){v.put(A.mode.bit,4),v.put(A.getLength(),w.getCharCountIndicator(A.mode,x)),A.write(v)});const P=r.getSymbolTotalCodewords(x),R=s.getTotalCodewordsCount(x,_),S=(P-R)*8;for(v.getLengthInBits()+4<=S&&v.put(0,4);v.getLengthInBits()%8!==0;)v.putBit(0);const $=(S-v.getLengthInBits())/8;for(let A=0;A<$;A++)v.put(A%2?17:236,8);return h(v,x,_)}function h(x,_,E){const v=r.getSymbolTotalCodewords(_),P=s.getTotalCodewordsCount(_,E),R=v-P,S=s.getBlocksCount(_,E),$=v%S,A=S-$,we=Math.floor(v/S),De=Math.floor(R/S),mi=De+1,wn=we-De,bi=new l(wn);let Ct=0;const Je=new Array(S),mn=new Array(S);let Rt=0;const vi=new Uint8Array(x.buffer);for(let Se=0;Se<S;Se++){const It=Se<A?De:mi;Je[Se]=vi.slice(Ct,Ct+It),mn[Se]=bi.encode(Je[Se]),Ct+=It,Rt=Math.max(Rt,It)}const $t=new Uint8Array(v);let bn=0,ce,ue;for(ce=0;ce<Rt;ce++)for(ue=0;ue<S;ue++)ce<Je[ue].length&&($t[bn++]=Je[ue][ce]);for(ce=0;ce<wn;ce++)for(ue=0;ue<S;ue++)$t[bn++]=mn[ue][ce];return $t}function D(x,_,E,v){let P;if(Array.isArray(x))P=C.fromArray(x);else if(typeof x=="string"){let we=_;if(!we){const De=C.rawSplit(x);we=d.getBestVersionForData(De,E)}P=C.fromString(x,we||40)}else throw new Error("Invalid data");const R=d.getBestVersionForData(P,E);if(!R)throw new Error("The amount of data is too big to be stored in a QR Code");if(!_)_=R;else if(_<R)throw new Error(`
|
|
1072
|
+
The chosen QR Code version cannot contain this amount of data.
|
|
1073
|
+
Minimum version required to store current data is: `+R+`.
|
|
1074
|
+
`);const S=m(_,E,P),$=r.getSymbolSize(_),A=new i($);return g(A,_),L(A),y(A,_),b(A,E,0),_>=7&&B(A,_),f(A,S),isNaN(v)&&(v=a.getBestMask(A,b.bind(null,A,E))),a.applyMask(v,A),b(A,E,v),{modules:A,version:_,errorCorrectionLevel:E,maskPattern:v,segments:P}}return _t.create=function(_,E){if(typeof _>"u"||_==="")throw new Error("No input text");let v=e.M,P,R;return typeof E<"u"&&(v=e.from(E.errorCorrectionLevel,e.M),P=d.from(E.version),R=a.from(E.maskPattern),E.toSJISFunc&&r.setToSJISFunction(E.toSJISFunc)),D(_,P,v,R)},_t}var Ht={},Gt={},Gn;function ui(){return Gn||(Gn=1,(function(r){function e(n){if(typeof n=="number"&&(n=n.toString()),typeof n!="string")throw new Error("Color should be defined as hex string");let i=n.slice().replace("#","").split("");if(i.length<3||i.length===5||i.length>8)throw new Error("Invalid hex color: "+n);(i.length===3||i.length===4)&&(i=Array.prototype.concat.apply([],i.map(function(t){return[t,t]}))),i.length===6&&i.push("F","F");const o=parseInt(i.join(""),16);return{r:o>>24&255,g:o>>16&255,b:o>>8&255,a:o&255,hex:"#"+i.slice(0,6).join("")}}r.getOptions=function(i){i||(i={}),i.color||(i.color={});const o=typeof i.margin>"u"||i.margin===null||i.margin<0?4:i.margin,t=i.width&&i.width>=21?i.width:void 0,a=i.scale||4;return{width:t,scale:t?4:a,margin:o,color:{dark:e(i.color.dark||"#000000ff"),light:e(i.color.light||"#ffffffff")},type:i.type,rendererOpts:i.rendererOpts||{}}},r.getScale=function(i,o){return o.width&&o.width>=i+o.margin*2?o.width/(i+o.margin*2):o.scale},r.getImageWidth=function(i,o){const t=r.getScale(i,o);return Math.floor((i+o.margin*2)*t)},r.qrToImageData=function(i,o,t){const a=o.modules.size,s=o.modules.data,l=r.getScale(a,t),d=Math.floor((a+t.margin*2)*l),p=t.margin*l,w=[t.color.light,t.color.dark];for(let C=0;C<d;C++)for(let g=0;g<d;g++){let L=(C*d+g)*4,y=t.color.light;if(C>=p&&g>=p&&C<d-p&&g<d-p){const B=Math.floor((C-p)/l),b=Math.floor((g-p)/l);y=w[s[B*a+b]?1:0]}i[L++]=y.r,i[L++]=y.g,i[L++]=y.b,i[L]=y.a}}})(Gt)),Gt}var Yn;function so(){return Yn||(Yn=1,(function(r){const e=ui();function n(o,t,a){o.clearRect(0,0,t.width,t.height),t.style||(t.style={}),t.height=a,t.width=a,t.style.height=a+"px",t.style.width=a+"px"}function i(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}r.render=function(t,a,s){let l=s,d=a;typeof l>"u"&&(!a||!a.getContext)&&(l=a,a=void 0),a||(d=i()),l=e.getOptions(l);const p=e.getImageWidth(t.modules.size,l),w=d.getContext("2d"),C=w.createImageData(p,p);return e.qrToImageData(C.data,t,l),n(w,d,p),w.putImageData(C,0,0),d},r.renderToDataURL=function(t,a,s){let l=s;typeof l>"u"&&(!a||!a.getContext)&&(l=a,a=void 0),l||(l={});const d=r.render(t,a,l),p=l.type||"image/png",w=l.rendererOpts||{};return d.toDataURL(p,w.quality)}})(Ht)),Ht}var Yt={},Jn;function lo(){if(Jn)return Yt;Jn=1;const r=ui();function e(o,t){const a=o.a/255,s=t+'="'+o.hex+'"';return a<1?s+" "+t+'-opacity="'+a.toFixed(2).slice(1)+'"':s}function n(o,t,a){let s=o+t;return typeof a<"u"&&(s+=" "+a),s}function i(o,t,a){let s="",l=0,d=!1,p=0;for(let w=0;w<o.length;w++){const C=Math.floor(w%t),g=Math.floor(w/t);!C&&!d&&(d=!0),o[w]?(p++,w>0&&C>0&&o[w-1]||(s+=d?n("M",C+a,.5+g+a):n("m",l,0),l=0,d=!1),C+1<t&&o[w+1]||(s+=n("h",p),p=0)):l++}return s}return Yt.render=function(t,a,s){const l=r.getOptions(a),d=t.modules.size,p=t.modules.data,w=d+l.margin*2,C=l.color.light.a?"<path "+e(l.color.light,"fill")+' d="M0 0h'+w+"v"+w+'H0z"/>':"",g="<path "+e(l.color.dark,"stroke")+' d="'+i(p,d,l.margin)+'"/>',L='viewBox="0 0 '+w+" "+w+'"',B='<svg xmlns="http://www.w3.org/2000/svg" '+(l.width?'width="'+l.width+'" height="'+l.width+'" ':"")+L+' shape-rendering="crispEdges">'+C+g+`</svg>
|
|
1075
|
+
`;return typeof s=="function"&&s(null,B),B},Yt}var Qn;function co(){if(Qn)return Te;Qn=1;const r=qi(),e=ao(),n=so(),i=lo();function o(t,a,s,l,d){const p=[].slice.call(arguments,1),w=p.length,C=typeof p[w-1]=="function";if(!C&&!r())throw new Error("Callback required as last argument");if(C){if(w<2)throw new Error("Too few arguments provided");w===2?(d=s,s=a,a=l=void 0):w===3&&(a.getContext&&typeof d>"u"?(d=l,l=void 0):(d=l,l=s,s=a,a=void 0))}else{if(w<1)throw new Error("Too few arguments provided");return w===1?(s=a,a=l=void 0):w===2&&!a.getContext&&(l=s,s=a,a=void 0),new Promise(function(g,L){try{const y=e.create(s,l);g(t(y,a,l))}catch(y){L(y)}})}try{const g=e.create(s,l);d(null,t(g,a,l))}catch(g){d(g)}}return Te.create=e.create,Te.toCanvas=o.bind(null,n.render),Te.toDataURL=o.bind(null,n.renderToDataURL),Te.toString=o.bind(null,function(t,a,s){return i.render(t,s)}),Te}var uo=co();const ho=Ei(uo),fo=.1,Xn=2.5,de=7;function Jt(r,e,n){return r===e?!1:(r-e<0?e-r:r-e)<=n+fo}function po(r,e){const n=Array.prototype.slice.call(ho.create(r,{errorCorrectionLevel:e}).modules.data,0),i=Math.sqrt(n.length);return n.reduce((o,t,a)=>(a%i===0?o.push([t]):o[o.length-1].push(t))&&o,[])}const go={generate({uri:r,size:e,logoSize:n,dotColor:i="#141414"}){const o="transparent",a=[],s=po(r,"Q"),l=e/s.length,d=[{x:0,y:0},{x:1,y:0},{x:0,y:1}];d.forEach(({x:y,y:B})=>{const b=(s.length-de)*l*y,f=(s.length-de)*l*B,m=.45;for(let h=0;h<d.length;h+=1){const D=l*(de-h*2);a.push(Ne`
|
|
1076
|
+
<rect
|
|
1077
|
+
fill=${h===2?i:o}
|
|
1078
|
+
width=${h===0?D-5:D}
|
|
1079
|
+
rx= ${h===0?(D-5)*m:D*m}
|
|
1080
|
+
ry= ${h===0?(D-5)*m:D*m}
|
|
1081
|
+
stroke=${i}
|
|
1082
|
+
stroke-width=${h===0?5:0}
|
|
1083
|
+
height=${h===0?D-5:D}
|
|
1084
|
+
x= ${h===0?f+l*h+5/2:f+l*h}
|
|
1085
|
+
y= ${h===0?b+l*h+5/2:b+l*h}
|
|
1086
|
+
/>
|
|
1087
|
+
`)}});const p=Math.floor((n+25)/l),w=s.length/2-p/2,C=s.length/2+p/2-1,g=[];s.forEach((y,B)=>{y.forEach((b,f)=>{if(s[B][f]&&!(B<de&&f<de||B>s.length-(de+1)&&f<de||B<de&&f>s.length-(de+1))&&!(B>w&&B<C&&f>w&&f<C)){const m=B*l+l/2,h=f*l+l/2;g.push([m,h])}})});const L={};return g.forEach(([y,B])=>{L[y]?L[y]?.push(B):L[y]=[B]}),Object.entries(L).map(([y,B])=>{const b=B.filter(f=>B.every(m=>!Jt(f,m,l)));return[Number(y),b]}).forEach(([y,B])=>{B.forEach(b=>{a.push(Ne`<circle cx=${y} cy=${b} fill=${i} r=${l/Xn} />`)})}),Object.entries(L).filter(([y,B])=>B.length>1).map(([y,B])=>{const b=B.filter(f=>B.some(m=>Jt(f,m,l)));return[Number(y),b]}).map(([y,B])=>{B.sort((f,m)=>f<m?-1:1);const b=[];for(const f of B){const m=b.find(h=>h.some(D=>Jt(f,D,l)));m?m.push(f):b.push([f])}return[y,b.map(f=>[f[0],f[f.length-1]])]}).forEach(([y,B])=>{B.forEach(([b,f])=>{a.push(Ne`
|
|
1088
|
+
<line
|
|
1089
|
+
x1=${y}
|
|
1090
|
+
x2=${y}
|
|
1091
|
+
y1=${b}
|
|
1092
|
+
y2=${f}
|
|
1093
|
+
stroke=${i}
|
|
1094
|
+
stroke-width=${l/(Xn/2)}
|
|
1095
|
+
stroke-linecap="round"
|
|
1096
|
+
/>
|
|
1097
|
+
`)})}),a}},wo=N`
|
|
1098
|
+
:host {
|
|
1099
|
+
position: relative;
|
|
1100
|
+
user-select: none;
|
|
1101
|
+
display: block;
|
|
1102
|
+
overflow: hidden;
|
|
1103
|
+
aspect-ratio: 1 / 1;
|
|
1104
|
+
width: var(--local-size);
|
|
1105
|
+
}
|
|
1106
|
+
|
|
1107
|
+
:host([data-theme='dark']) {
|
|
1108
|
+
border-radius: clamp(0px, var(--wui-border-radius-l), 40px);
|
|
1109
|
+
background-color: var(--wui-color-inverse-100);
|
|
1110
|
+
padding: var(--wui-spacing-l);
|
|
1111
|
+
}
|
|
1112
|
+
|
|
1113
|
+
:host([data-theme='light']) {
|
|
1114
|
+
box-shadow: 0 0 0 1px var(--wui-color-bg-125);
|
|
1115
|
+
background-color: var(--wui-color-bg-125);
|
|
1116
|
+
}
|
|
1117
|
+
|
|
1118
|
+
:host([data-clear='true']) > wui-icon {
|
|
1119
|
+
display: none;
|
|
1120
|
+
}
|
|
1121
|
+
|
|
1122
|
+
svg:first-child,
|
|
1123
|
+
wui-image,
|
|
1124
|
+
wui-icon {
|
|
1125
|
+
position: absolute;
|
|
1126
|
+
top: 50%;
|
|
1127
|
+
left: 50%;
|
|
1128
|
+
transform: translateY(-50%) translateX(-50%);
|
|
1129
|
+
}
|
|
1130
|
+
|
|
1131
|
+
wui-image {
|
|
1132
|
+
width: 25%;
|
|
1133
|
+
height: 25%;
|
|
1134
|
+
border-radius: var(--wui-border-radius-xs);
|
|
1135
|
+
}
|
|
1136
|
+
|
|
1137
|
+
wui-icon {
|
|
1138
|
+
width: 100%;
|
|
1139
|
+
height: 100%;
|
|
1140
|
+
color: var(--local-icon-color) !important;
|
|
1141
|
+
transform: translateY(-50%) translateX(-50%) scale(0.25);
|
|
1142
|
+
}
|
|
1143
|
+
`;var ge=function(r,e,n,i){var o=arguments.length,t=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,n):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(r,e,n,i);else for(var s=r.length-1;s>=0;s--)(a=r[s])&&(t=(o<3?a(t):o>3?a(e,n,t):a(e,n))||t);return o>3&&t&&Object.defineProperty(e,n,t),t};const mo="#3396ff";let ne=class extends O{constructor(){super(...arguments),this.uri="",this.size=0,this.theme="dark",this.imageSrc=void 0,this.alt=void 0,this.arenaClear=void 0,this.farcaster=void 0}render(){return this.dataset.theme=this.theme,this.dataset.clear=String(this.arenaClear),this.style.cssText=`
|
|
1144
|
+
--local-size: ${this.size}px;
|
|
1145
|
+
--local-icon-color: ${this.color??mo}
|
|
1146
|
+
`,c`${this.templateVisual()} ${this.templateSvg()}`}templateSvg(){const e=this.theme==="light"?this.size:this.size-32;return Ne`
|
|
1147
|
+
<svg height=${e} width=${e}>
|
|
1148
|
+
${go.generate({uri:this.uri,size:e,logoSize:this.arenaClear?0:e/4,dotColor:this.color})}
|
|
1149
|
+
</svg>
|
|
1150
|
+
`}templateVisual(){return this.imageSrc?c`<wui-image src=${this.imageSrc} alt=${this.alt??"logo"}></wui-image>`:this.farcaster?c`<wui-icon
|
|
1151
|
+
class="farcaster"
|
|
1152
|
+
size="inherit"
|
|
1153
|
+
color="inherit"
|
|
1154
|
+
name="farcaster"
|
|
1155
|
+
></wui-icon>`:c`<wui-icon size="inherit" color="inherit" name="walletConnect"></wui-icon>`}};ne.styles=[q,wo];ge([u()],ne.prototype,"uri",void 0);ge([u({type:Number})],ne.prototype,"size",void 0);ge([u()],ne.prototype,"theme",void 0);ge([u()],ne.prototype,"imageSrc",void 0);ge([u()],ne.prototype,"alt",void 0);ge([u()],ne.prototype,"color",void 0);ge([u({type:Boolean})],ne.prototype,"arenaClear",void 0);ge([u({type:Boolean})],ne.prototype,"farcaster",void 0);ne=ge([T("wui-qr-code")],ne);const bo=N`
|
|
1156
|
+
:host {
|
|
1157
|
+
display: block;
|
|
1158
|
+
box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-005);
|
|
1159
|
+
background: linear-gradient(
|
|
1160
|
+
120deg,
|
|
1161
|
+
var(--wui-color-bg-200) 5%,
|
|
1162
|
+
var(--wui-color-bg-200) 48%,
|
|
1163
|
+
var(--wui-color-bg-300) 55%,
|
|
1164
|
+
var(--wui-color-bg-300) 60%,
|
|
1165
|
+
var(--wui-color-bg-300) calc(60% + 10px),
|
|
1166
|
+
var(--wui-color-bg-200) calc(60% + 12px),
|
|
1167
|
+
var(--wui-color-bg-200) 100%
|
|
1168
|
+
);
|
|
1169
|
+
background-size: 250%;
|
|
1170
|
+
animation: shimmer 3s linear infinite reverse;
|
|
1171
|
+
}
|
|
1172
|
+
|
|
1173
|
+
:host([variant='light']) {
|
|
1174
|
+
background: linear-gradient(
|
|
1175
|
+
120deg,
|
|
1176
|
+
var(--wui-color-bg-150) 5%,
|
|
1177
|
+
var(--wui-color-bg-150) 48%,
|
|
1178
|
+
var(--wui-color-bg-200) 55%,
|
|
1179
|
+
var(--wui-color-bg-200) 60%,
|
|
1180
|
+
var(--wui-color-bg-200) calc(60% + 10px),
|
|
1181
|
+
var(--wui-color-bg-150) calc(60% + 12px),
|
|
1182
|
+
var(--wui-color-bg-150) 100%
|
|
1183
|
+
);
|
|
1184
|
+
background-size: 250%;
|
|
1185
|
+
}
|
|
1186
|
+
|
|
1187
|
+
@keyframes shimmer {
|
|
1188
|
+
from {
|
|
1189
|
+
background-position: -250% 0;
|
|
1190
|
+
}
|
|
1191
|
+
to {
|
|
1192
|
+
background-position: 250% 0;
|
|
1193
|
+
}
|
|
1194
|
+
}
|
|
1195
|
+
`;var He=function(r,e,n,i){var o=arguments.length,t=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,n):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(r,e,n,i);else for(var s=r.length-1;s>=0;s--)(a=r[s])&&(t=(o<3?a(t):o>3?a(e,n,t):a(e,n))||t);return o>3&&t&&Object.defineProperty(e,n,t),t};let Re=class extends O{constructor(){super(...arguments),this.width="",this.height="",this.borderRadius="m",this.variant="default"}render(){return this.style.cssText=`
|
|
1196
|
+
width: ${this.width};
|
|
1197
|
+
height: ${this.height};
|
|
1198
|
+
border-radius: ${`clamp(0px,var(--wui-border-radius-${this.borderRadius}), 40px)`};
|
|
1199
|
+
`,c`<slot></slot>`}};Re.styles=[bo];He([u()],Re.prototype,"width",void 0);He([u()],Re.prototype,"height",void 0);He([u()],Re.prototype,"borderRadius",void 0);He([u()],Re.prototype,"variant",void 0);Re=He([T("wui-shimmer")],Re);const vo="https://reown.com",yo=N`
|
|
1200
|
+
.reown-logo {
|
|
1201
|
+
height: var(--wui-spacing-xxl);
|
|
1202
|
+
}
|
|
1203
|
+
|
|
1204
|
+
a {
|
|
1205
|
+
text-decoration: none;
|
|
1206
|
+
cursor: pointer;
|
|
1207
|
+
}
|
|
1208
|
+
|
|
1209
|
+
a:hover {
|
|
1210
|
+
opacity: 0.9;
|
|
1211
|
+
}
|
|
1212
|
+
`;var xo=function(r,e,n,i){var o=arguments.length,t=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,n):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(r,e,n,i);else for(var s=r.length-1;s>=0;s--)(a=r[s])&&(t=(o<3?a(t):o>3?a(e,n,t):a(e,n))||t);return o>3&&t&&Object.defineProperty(e,n,t),t};let en=class extends O{render(){return c`
|
|
1213
|
+
<a
|
|
1214
|
+
data-testid="ux-branding-reown"
|
|
1215
|
+
href=${vo}
|
|
1216
|
+
rel="noreferrer"
|
|
1217
|
+
target="_blank"
|
|
1218
|
+
style="text-decoration: none;"
|
|
1219
|
+
>
|
|
1220
|
+
<wui-flex
|
|
1221
|
+
justifyContent="center"
|
|
1222
|
+
alignItems="center"
|
|
1223
|
+
gap="xs"
|
|
1224
|
+
.padding=${["0","0","l","0"]}
|
|
1225
|
+
>
|
|
1226
|
+
<wui-text variant="small-500" color="fg-100"> UX by </wui-text>
|
|
1227
|
+
<wui-icon name="reown" size="xxxl" class="reown-logo"></wui-icon>
|
|
1228
|
+
</wui-flex>
|
|
1229
|
+
</a>
|
|
1230
|
+
`}};en.styles=[q,G,yo];en=xo([T("wui-ux-by-reown")],en);const Co=N`
|
|
1231
|
+
@keyframes fadein {
|
|
1232
|
+
from {
|
|
1233
|
+
opacity: 0;
|
|
1234
|
+
}
|
|
1235
|
+
to {
|
|
1236
|
+
opacity: 1;
|
|
1237
|
+
}
|
|
1238
|
+
}
|
|
1239
|
+
|
|
1240
|
+
wui-shimmer {
|
|
1241
|
+
width: 100%;
|
|
1242
|
+
aspect-ratio: 1 / 1;
|
|
1243
|
+
border-radius: clamp(0px, var(--wui-border-radius-l), 40px) !important;
|
|
1244
|
+
}
|
|
1245
|
+
|
|
1246
|
+
wui-qr-code {
|
|
1247
|
+
opacity: 0;
|
|
1248
|
+
animation-duration: 200ms;
|
|
1249
|
+
animation-timing-function: ease;
|
|
1250
|
+
animation-name: fadein;
|
|
1251
|
+
animation-fill-mode: forwards;
|
|
1252
|
+
}
|
|
1253
|
+
`;var Ro=function(r,e,n,i){var o=arguments.length,t=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,n):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(r,e,n,i);else for(var s=r.length-1;s>=0;s--)(a=r[s])&&(t=(o<3?a(t):o>3?a(e,n,t):a(e,n))||t);return o>3&&t&&Object.defineProperty(e,n,t),t};let tn=class extends V{constructor(){super(),this.forceUpdate=()=>{this.requestUpdate()},window.addEventListener("resize",this.forceUpdate),te.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet?.name??"WalletConnect",platform:"qrcode"}})}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribe?.forEach(e=>e()),window.removeEventListener("resize",this.forceUpdate)}render(){return this.onRenderProxy(),c`
|
|
1254
|
+
<wui-flex
|
|
1255
|
+
flexDirection="column"
|
|
1256
|
+
alignItems="center"
|
|
1257
|
+
.padding=${["0","xl","xl","xl"]}
|
|
1258
|
+
gap="xl"
|
|
1259
|
+
>
|
|
1260
|
+
<wui-shimmer borderRadius="l" width="100%"> ${this.qrCodeTemplate()} </wui-shimmer>
|
|
1261
|
+
|
|
1262
|
+
<wui-text variant="paragraph-500" color="fg-100">
|
|
1263
|
+
Scan this QR Code with your phone
|
|
1264
|
+
</wui-text>
|
|
1265
|
+
${this.copyTemplate()}
|
|
1266
|
+
</wui-flex>
|
|
1267
|
+
<w3m-mobile-download-links .wallet=${this.wallet}></w3m-mobile-download-links>
|
|
1268
|
+
`}onRenderProxy(){!this.ready&&this.uri&&(this.timeout=setTimeout(()=>{this.ready=!0},200))}qrCodeTemplate(){if(!this.uri||!this.ready)return null;const e=this.getBoundingClientRect().width-40,n=this.wallet?this.wallet.name:void 0;return k.setWcLinking(void 0),k.setRecentWallet(this.wallet),c` <wui-qr-code
|
|
1269
|
+
size=${e}
|
|
1270
|
+
theme=${Zt.state.themeMode}
|
|
1271
|
+
uri=${this.uri}
|
|
1272
|
+
imageSrc=${W(K.getWalletImage(this.wallet))}
|
|
1273
|
+
color=${W(Zt.state.themeVariables["--w3m-qr-color"])}
|
|
1274
|
+
alt=${W(n)}
|
|
1275
|
+
data-testid="wui-qr-code"
|
|
1276
|
+
></wui-qr-code>`}copyTemplate(){const e=!this.uri||!this.ready;return c`<wui-link
|
|
1277
|
+
.disabled=${e}
|
|
1278
|
+
@click=${this.onCopyUri}
|
|
1279
|
+
color="fg-200"
|
|
1280
|
+
data-testid="copy-wc2-uri"
|
|
1281
|
+
>
|
|
1282
|
+
<wui-icon size="xs" color="fg-200" slot="iconLeft" name="copy"></wui-icon>
|
|
1283
|
+
Copy link
|
|
1284
|
+
</wui-link>`}};tn.styles=Co;tn=Ro([T("w3m-connecting-wc-qrcode")],tn);var $o=function(r,e,n,i){var o=arguments.length,t=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,n):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(r,e,n,i);else for(var s=r.length-1;s>=0;s--)(a=r[s])&&(t=(o<3?a(t):o>3?a(e,n,t):a(e,n))||t);return o>3&&t&&Object.defineProperty(e,n,t),t};let Zn=class extends O{constructor(){if(super(),this.wallet=U.state.data?.wallet,!this.wallet)throw new Error("w3m-connecting-wc-unsupported: No wallet provided");te.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"browser"}})}render(){return c`
|
|
1285
|
+
<wui-flex
|
|
1286
|
+
flexDirection="column"
|
|
1287
|
+
alignItems="center"
|
|
1288
|
+
.padding=${["3xl","xl","xl","xl"]}
|
|
1289
|
+
gap="xl"
|
|
1290
|
+
>
|
|
1291
|
+
<wui-wallet-image
|
|
1292
|
+
size="lg"
|
|
1293
|
+
imageSrc=${W(K.getWalletImage(this.wallet))}
|
|
1294
|
+
></wui-wallet-image>
|
|
1295
|
+
|
|
1296
|
+
<wui-text variant="paragraph-500" color="fg-100">Not Detected</wui-text>
|
|
1297
|
+
</wui-flex>
|
|
1298
|
+
|
|
1299
|
+
<w3m-mobile-download-links .wallet=${this.wallet}></w3m-mobile-download-links>
|
|
1300
|
+
`}};Zn=$o([T("w3m-connecting-wc-unsupported")],Zn);var di=function(r,e,n,i){var o=arguments.length,t=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,n):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(r,e,n,i);else for(var s=r.length-1;s>=0;s--)(a=r[s])&&(t=(o<3?a(t):o>3?a(e,n,t):a(e,n))||t);return o>3&&t&&Object.defineProperty(e,n,t),t};let nn=class extends V{constructor(){if(super(),this.isLoading=!0,!this.wallet)throw new Error("w3m-connecting-wc-web: No wallet provided");this.onConnect=this.onConnectProxy.bind(this),this.secondaryBtnLabel="Open",this.secondaryLabel=ii.CONNECT_LABELS.MOBILE,this.secondaryBtnIcon="externalLink",this.updateLoadingState(),this.unsubscribe.push(k.subscribeKey("wcUri",()=>{this.updateLoadingState()})),te.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"web"}})}updateLoadingState(){this.isLoading=!this.uri}onConnectProxy(){if(this.wallet?.webapp_link&&this.uri)try{this.error=!1;const{webapp_link:e,name:n}=this.wallet,{redirect:i,href:o}=j.formatUniversalUrl(e,this.uri);k.setWcLinking({name:n,href:o}),k.setRecentWallet(this.wallet),j.openHref(i,"_blank")}catch{this.error=!0}}};di([I()],nn.prototype,"isLoading",void 0);nn=di([T("w3m-connecting-wc-web")],nn);var Ge=function(r,e,n,i){var o=arguments.length,t=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,n):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(r,e,n,i);else for(var s=r.length-1;s>=0;s--)(a=r[s])&&(t=(o<3?a(t):o>3?a(e,n,t):a(e,n))||t);return o>3&&t&&Object.defineProperty(e,n,t),t};let Le=class extends O{constructor(){super(),this.wallet=U.state.data?.wallet,this.unsubscribe=[],this.platform=void 0,this.platforms=[],this.isSiwxEnabled=!!ee.state.siwx,this.remoteFeatures=ee.state.remoteFeatures,this.determinePlatforms(),this.initializeConnection(),this.unsubscribe.push(ee.subscribeKey("remoteFeatures",e=>this.remoteFeatures=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return c`
|
|
1301
|
+
${this.headerTemplate()}
|
|
1302
|
+
<div>${this.platformTemplate()}</div>
|
|
1303
|
+
${this.reownBrandingTemplate()}
|
|
1304
|
+
`}reownBrandingTemplate(){return this.remoteFeatures?.reownBranding?c`<wui-ux-by-reown></wui-ux-by-reown>`:null}async initializeConnection(e=!1){if(!(this.platform==="browser"||ee.state.manualWCControl&&!e))try{const{wcPairingExpiry:n,status:i}=k.state;(e||ee.state.enableEmbedded||j.isPairingExpired(n)||i==="connecting")&&(await k.connectWalletConnect(),this.isSiwxEnabled||ni.close())}catch(n){te.sendEvent({type:"track",event:"CONNECT_ERROR",properties:{message:n?.message??"Unknown"}}),k.setWcError(!0),Xe.showError(n.message??"Connection error"),k.resetWcConnection(),U.goBack()}}determinePlatforms(){if(!this.wallet){this.platforms.push("qrcode"),this.platform="qrcode";return}if(this.platform)return;const{mobile_link:e,desktop_link:n,webapp_link:i,injected:o,rdns:t}=this.wallet,a=o?.map(({injected_id:L})=>L).filter(Boolean),s=[...t?[t]:a??[]],l=ee.state.isUniversalProvider?!1:s.length,d=e,p=i,w=k.checkInstalled(s),C=l&&w,g=n&&!j.isMobile();C&&!Xt.state.noAdapters&&this.platforms.push("browser"),d&&this.platforms.push(j.isMobile()?"mobile":"qrcode"),p&&this.platforms.push("web"),g&&this.platforms.push("desktop"),!C&&l&&!Xt.state.noAdapters&&this.platforms.push("unsupported"),this.platform=this.platforms[0]}platformTemplate(){switch(this.platform){case"browser":return c`<w3m-connecting-wc-browser></w3m-connecting-wc-browser>`;case"web":return c`<w3m-connecting-wc-web></w3m-connecting-wc-web>`;case"desktop":return c`
|
|
1305
|
+
<w3m-connecting-wc-desktop .onRetry=${()=>this.initializeConnection(!0)}>
|
|
1306
|
+
</w3m-connecting-wc-desktop>
|
|
1307
|
+
`;case"mobile":return c`
|
|
1308
|
+
<w3m-connecting-wc-mobile isMobile .onRetry=${()=>this.initializeConnection(!0)}>
|
|
1309
|
+
</w3m-connecting-wc-mobile>
|
|
1310
|
+
`;case"qrcode":return c`<w3m-connecting-wc-qrcode></w3m-connecting-wc-qrcode>`;default:return c`<w3m-connecting-wc-unsupported></w3m-connecting-wc-unsupported>`}}headerTemplate(){return this.platforms.length>1?c`
|
|
1311
|
+
<w3m-connecting-header
|
|
1312
|
+
.platforms=${this.platforms}
|
|
1313
|
+
.onSelectPlatfrom=${this.onSelectPlatform.bind(this)}
|
|
1314
|
+
>
|
|
1315
|
+
</w3m-connecting-header>
|
|
1316
|
+
`:null}async onSelectPlatform(e){const n=this.shadowRoot?.querySelector("div");n&&(await n.animate([{opacity:1},{opacity:0}],{duration:200,fill:"forwards",easing:"ease"}).finished,this.platform=e,n.animate([{opacity:0},{opacity:1}],{duration:200,fill:"forwards",easing:"ease"}))}};Ge([I()],Le.prototype,"platform",void 0);Ge([I()],Le.prototype,"platforms",void 0);Ge([I()],Le.prototype,"isSiwxEnabled",void 0);Ge([I()],Le.prototype,"remoteFeatures",void 0);Le=Ge([T("w3m-connecting-wc-view")],Le);var hi=function(r,e,n,i){var o=arguments.length,t=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,n):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(r,e,n,i);else for(var s=r.length-1;s>=0;s--)(a=r[s])&&(t=(o<3?a(t):o>3?a(e,n,t):a(e,n))||t);return o>3&&t&&Object.defineProperty(e,n,t),t};let on=class extends O{constructor(){super(...arguments),this.isMobile=j.isMobile()}render(){if(this.isMobile){const{featured:e,recommended:n}=z.state,{customWallets:i}=ee.state,o=ft.getRecentWallets(),t=e.length||n.length||i?.length||o.length;return c`<wui-flex
|
|
1317
|
+
flexDirection="column"
|
|
1318
|
+
gap="xs"
|
|
1319
|
+
.margin=${["3xs","s","s","s"]}
|
|
1320
|
+
>
|
|
1321
|
+
${t?c`<w3m-connector-list></w3m-connector-list>`:null}
|
|
1322
|
+
<w3m-all-wallets-widget></w3m-all-wallets-widget>
|
|
1323
|
+
</wui-flex>`}return c`<wui-flex flexDirection="column" .padding=${["0","0","l","0"]}>
|
|
1324
|
+
<w3m-connecting-wc-view></w3m-connecting-wc-view>
|
|
1325
|
+
<wui-flex flexDirection="column" .padding=${["0","m","0","m"]}>
|
|
1326
|
+
<w3m-all-wallets-widget></w3m-all-wallets-widget> </wui-flex
|
|
1327
|
+
></wui-flex>`}};hi([I()],on.prototype,"isMobile",void 0);on=hi([T("w3m-connecting-wc-basic-view")],on);const fn=()=>new Io;class Io{}const Qt=new WeakMap,pn=Ci(class extends Ri{render(r){return yn}update(r,[e]){const n=e!==this.G;return n&&this.G!==void 0&&this.rt(void 0),(n||this.lt!==this.ct)&&(this.G=e,this.ht=r.options?.host,this.rt(this.ct=r.element)),yn}rt(r){if(this.isConnected||(r=void 0),typeof this.G=="function"){const e=this.ht??globalThis;let n=Qt.get(e);n===void 0&&(n=new WeakMap,Qt.set(e,n)),n.get(this.G)!==void 0&&this.G.call(this.ht,void 0),n.set(this.G,r),r!==void 0&&this.G.call(this.ht,r)}else this.G.value=r}get lt(){return typeof this.G=="function"?Qt.get(this.ht??globalThis)?.get(this.G):this.G?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}}),Eo=N`
|
|
1328
|
+
:host {
|
|
1329
|
+
display: flex;
|
|
1330
|
+
align-items: center;
|
|
1331
|
+
justify-content: center;
|
|
1332
|
+
}
|
|
1333
|
+
|
|
1334
|
+
label {
|
|
1335
|
+
position: relative;
|
|
1336
|
+
display: inline-block;
|
|
1337
|
+
width: 32px;
|
|
1338
|
+
height: 22px;
|
|
1339
|
+
}
|
|
1340
|
+
|
|
1341
|
+
input {
|
|
1342
|
+
width: 0;
|
|
1343
|
+
height: 0;
|
|
1344
|
+
opacity: 0;
|
|
1345
|
+
}
|
|
1346
|
+
|
|
1347
|
+
span {
|
|
1348
|
+
position: absolute;
|
|
1349
|
+
cursor: pointer;
|
|
1350
|
+
top: 0;
|
|
1351
|
+
left: 0;
|
|
1352
|
+
right: 0;
|
|
1353
|
+
bottom: 0;
|
|
1354
|
+
background-color: var(--wui-color-blue-100);
|
|
1355
|
+
border-width: 1px;
|
|
1356
|
+
border-style: solid;
|
|
1357
|
+
border-color: var(--wui-color-gray-glass-002);
|
|
1358
|
+
border-radius: 999px;
|
|
1359
|
+
transition:
|
|
1360
|
+
background-color var(--wui-ease-inout-power-1) var(--wui-duration-md),
|
|
1361
|
+
border-color var(--wui-ease-inout-power-1) var(--wui-duration-md);
|
|
1362
|
+
will-change: background-color, border-color;
|
|
1363
|
+
}
|
|
1364
|
+
|
|
1365
|
+
span:before {
|
|
1366
|
+
position: absolute;
|
|
1367
|
+
content: '';
|
|
1368
|
+
height: 16px;
|
|
1369
|
+
width: 16px;
|
|
1370
|
+
left: 3px;
|
|
1371
|
+
top: 2px;
|
|
1372
|
+
background-color: var(--wui-color-inverse-100);
|
|
1373
|
+
transition: transform var(--wui-ease-inout-power-1) var(--wui-duration-lg);
|
|
1374
|
+
will-change: transform;
|
|
1375
|
+
border-radius: 50%;
|
|
1376
|
+
}
|
|
1377
|
+
|
|
1378
|
+
input:checked + span {
|
|
1379
|
+
border-color: var(--wui-color-gray-glass-005);
|
|
1380
|
+
background-color: var(--wui-color-blue-100);
|
|
1381
|
+
}
|
|
1382
|
+
|
|
1383
|
+
input:not(:checked) + span {
|
|
1384
|
+
background-color: var(--wui-color-gray-glass-010);
|
|
1385
|
+
}
|
|
1386
|
+
|
|
1387
|
+
input:checked + span:before {
|
|
1388
|
+
transform: translateX(calc(100% - 7px));
|
|
1389
|
+
}
|
|
1390
|
+
`;var fi=function(r,e,n,i){var o=arguments.length,t=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,n):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(r,e,n,i);else for(var s=r.length-1;s>=0;s--)(a=r[s])&&(t=(o<3?a(t):o>3?a(e,n,t):a(e,n))||t);return o>3&&t&&Object.defineProperty(e,n,t),t};let lt=class extends O{constructor(){super(...arguments),this.inputElementRef=fn(),this.checked=void 0}render(){return c`
|
|
1391
|
+
<label>
|
|
1392
|
+
<input
|
|
1393
|
+
${pn(this.inputElementRef)}
|
|
1394
|
+
type="checkbox"
|
|
1395
|
+
?checked=${W(this.checked)}
|
|
1396
|
+
@change=${this.dispatchChangeEvent.bind(this)}
|
|
1397
|
+
/>
|
|
1398
|
+
<span></span>
|
|
1399
|
+
</label>
|
|
1400
|
+
`}dispatchChangeEvent(){this.dispatchEvent(new CustomEvent("switchChange",{detail:this.inputElementRef.value?.checked,bubbles:!0,composed:!0}))}};lt.styles=[q,G,xi,Eo];fi([u({type:Boolean})],lt.prototype,"checked",void 0);lt=fi([T("wui-switch")],lt);const Wo=N`
|
|
1401
|
+
:host {
|
|
1402
|
+
height: 100%;
|
|
1403
|
+
}
|
|
1404
|
+
|
|
1405
|
+
button {
|
|
1406
|
+
display: flex;
|
|
1407
|
+
align-items: center;
|
|
1408
|
+
justify-content: center;
|
|
1409
|
+
column-gap: var(--wui-spacing-1xs);
|
|
1410
|
+
padding: var(--wui-spacing-xs) var(--wui-spacing-s);
|
|
1411
|
+
background-color: var(--wui-color-gray-glass-002);
|
|
1412
|
+
border-radius: var(--wui-border-radius-xs);
|
|
1413
|
+
box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-002);
|
|
1414
|
+
transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-md);
|
|
1415
|
+
will-change: background-color;
|
|
1416
|
+
cursor: pointer;
|
|
1417
|
+
}
|
|
1418
|
+
|
|
1419
|
+
wui-switch {
|
|
1420
|
+
pointer-events: none;
|
|
1421
|
+
}
|
|
1422
|
+
`;var pi=function(r,e,n,i){var o=arguments.length,t=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,n):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(r,e,n,i);else for(var s=r.length-1;s>=0;s--)(a=r[s])&&(t=(o<3?a(t):o>3?a(e,n,t):a(e,n))||t);return o>3&&t&&Object.defineProperty(e,n,t),t};let ct=class extends O{constructor(){super(...arguments),this.checked=void 0}render(){return c`
|
|
1423
|
+
<button>
|
|
1424
|
+
<wui-icon size="xl" name="walletConnectBrown"></wui-icon>
|
|
1425
|
+
<wui-switch ?checked=${W(this.checked)}></wui-switch>
|
|
1426
|
+
</button>
|
|
1427
|
+
`}};ct.styles=[q,G,Wo];pi([u({type:Boolean})],ct.prototype,"checked",void 0);ct=pi([T("wui-certified-switch")],ct);const _o=N`
|
|
1428
|
+
button {
|
|
1429
|
+
background-color: var(--wui-color-fg-300);
|
|
1430
|
+
border-radius: var(--wui-border-radius-4xs);
|
|
1431
|
+
width: 16px;
|
|
1432
|
+
height: 16px;
|
|
1433
|
+
}
|
|
1434
|
+
|
|
1435
|
+
button:disabled {
|
|
1436
|
+
background-color: var(--wui-color-bg-300);
|
|
1437
|
+
}
|
|
1438
|
+
|
|
1439
|
+
wui-icon {
|
|
1440
|
+
color: var(--wui-color-bg-200) !important;
|
|
1441
|
+
}
|
|
1442
|
+
|
|
1443
|
+
button:focus-visible {
|
|
1444
|
+
background-color: var(--wui-color-fg-250);
|
|
1445
|
+
border: 1px solid var(--wui-color-accent-100);
|
|
1446
|
+
}
|
|
1447
|
+
|
|
1448
|
+
@media (hover: hover) and (pointer: fine) {
|
|
1449
|
+
button:hover:enabled {
|
|
1450
|
+
background-color: var(--wui-color-fg-250);
|
|
1451
|
+
}
|
|
1452
|
+
|
|
1453
|
+
button:active:enabled {
|
|
1454
|
+
background-color: var(--wui-color-fg-225);
|
|
1455
|
+
}
|
|
1456
|
+
}
|
|
1457
|
+
`;var gi=function(r,e,n,i){var o=arguments.length,t=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,n):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(r,e,n,i);else for(var s=r.length-1;s>=0;s--)(a=r[s])&&(t=(o<3?a(t):o>3?a(e,n,t):a(e,n))||t);return o>3&&t&&Object.defineProperty(e,n,t),t};let ut=class extends O{constructor(){super(...arguments),this.icon="copy"}render(){return c`
|
|
1458
|
+
<button>
|
|
1459
|
+
<wui-icon color="inherit" size="xxs" name=${this.icon}></wui-icon>
|
|
1460
|
+
</button>
|
|
1461
|
+
`}};ut.styles=[q,G,_o];gi([u()],ut.prototype,"icon",void 0);ut=gi([T("wui-input-element")],ut);const So=N`
|
|
1462
|
+
:host {
|
|
1463
|
+
position: relative;
|
|
1464
|
+
width: 100%;
|
|
1465
|
+
display: inline-block;
|
|
1466
|
+
color: var(--wui-color-fg-275);
|
|
1467
|
+
}
|
|
1468
|
+
|
|
1469
|
+
input {
|
|
1470
|
+
width: 100%;
|
|
1471
|
+
border-radius: var(--wui-border-radius-xs);
|
|
1472
|
+
box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-002);
|
|
1473
|
+
background: var(--wui-color-gray-glass-002);
|
|
1474
|
+
font-size: var(--wui-font-size-paragraph);
|
|
1475
|
+
letter-spacing: var(--wui-letter-spacing-paragraph);
|
|
1476
|
+
color: var(--wui-color-fg-100);
|
|
1477
|
+
transition:
|
|
1478
|
+
background-color var(--wui-ease-inout-power-1) var(--wui-duration-md),
|
|
1479
|
+
border-color var(--wui-ease-inout-power-1) var(--wui-duration-md),
|
|
1480
|
+
box-shadow var(--wui-ease-inout-power-1) var(--wui-duration-md);
|
|
1481
|
+
will-change: background-color, border-color, box-shadow;
|
|
1482
|
+
caret-color: var(--wui-color-accent-100);
|
|
1483
|
+
}
|
|
1484
|
+
|
|
1485
|
+
input:disabled {
|
|
1486
|
+
cursor: not-allowed;
|
|
1487
|
+
border: 1px solid var(--wui-color-gray-glass-010);
|
|
1488
|
+
}
|
|
1489
|
+
|
|
1490
|
+
input:disabled::placeholder,
|
|
1491
|
+
input:disabled + wui-icon {
|
|
1492
|
+
color: var(--wui-color-fg-300);
|
|
1493
|
+
}
|
|
1494
|
+
|
|
1495
|
+
input::placeholder {
|
|
1496
|
+
color: var(--wui-color-fg-275);
|
|
1497
|
+
}
|
|
1498
|
+
|
|
1499
|
+
input:focus:enabled {
|
|
1500
|
+
background-color: var(--wui-color-gray-glass-005);
|
|
1501
|
+
-webkit-box-shadow:
|
|
1502
|
+
inset 0 0 0 1px var(--wui-color-accent-100),
|
|
1503
|
+
0px 0px 0px 4px var(--wui-box-shadow-blue);
|
|
1504
|
+
-moz-box-shadow:
|
|
1505
|
+
inset 0 0 0 1px var(--wui-color-accent-100),
|
|
1506
|
+
0px 0px 0px 4px var(--wui-box-shadow-blue);
|
|
1507
|
+
box-shadow:
|
|
1508
|
+
inset 0 0 0 1px var(--wui-color-accent-100),
|
|
1509
|
+
0px 0px 0px 4px var(--wui-box-shadow-blue);
|
|
1510
|
+
}
|
|
1511
|
+
|
|
1512
|
+
input:hover:enabled {
|
|
1513
|
+
background-color: var(--wui-color-gray-glass-005);
|
|
1514
|
+
}
|
|
1515
|
+
|
|
1516
|
+
wui-icon {
|
|
1517
|
+
position: absolute;
|
|
1518
|
+
top: 50%;
|
|
1519
|
+
transform: translateY(-50%);
|
|
1520
|
+
pointer-events: none;
|
|
1521
|
+
}
|
|
1522
|
+
|
|
1523
|
+
.wui-size-sm {
|
|
1524
|
+
padding: 9px var(--wui-spacing-m) 10px var(--wui-spacing-s);
|
|
1525
|
+
}
|
|
1526
|
+
|
|
1527
|
+
wui-icon + .wui-size-sm {
|
|
1528
|
+
padding: 9px var(--wui-spacing-m) 10px 36px;
|
|
1529
|
+
}
|
|
1530
|
+
|
|
1531
|
+
wui-icon[data-input='sm'] {
|
|
1532
|
+
left: var(--wui-spacing-s);
|
|
1533
|
+
}
|
|
1534
|
+
|
|
1535
|
+
.wui-size-md {
|
|
1536
|
+
padding: 15px var(--wui-spacing-m) var(--wui-spacing-l) var(--wui-spacing-m);
|
|
1537
|
+
}
|
|
1538
|
+
|
|
1539
|
+
wui-icon + .wui-size-md,
|
|
1540
|
+
wui-loading-spinner + .wui-size-md {
|
|
1541
|
+
padding: 10.5px var(--wui-spacing-3xl) 10.5px var(--wui-spacing-3xl);
|
|
1542
|
+
}
|
|
1543
|
+
|
|
1544
|
+
wui-icon[data-input='md'] {
|
|
1545
|
+
left: var(--wui-spacing-l);
|
|
1546
|
+
}
|
|
1547
|
+
|
|
1548
|
+
.wui-size-lg {
|
|
1549
|
+
padding: var(--wui-spacing-s) var(--wui-spacing-s) var(--wui-spacing-s) var(--wui-spacing-l);
|
|
1550
|
+
letter-spacing: var(--wui-letter-spacing-medium-title);
|
|
1551
|
+
font-size: var(--wui-font-size-medium-title);
|
|
1552
|
+
font-weight: var(--wui-font-weight-light);
|
|
1553
|
+
line-height: 130%;
|
|
1554
|
+
color: var(--wui-color-fg-100);
|
|
1555
|
+
height: 64px;
|
|
1556
|
+
}
|
|
1557
|
+
|
|
1558
|
+
.wui-padding-right-xs {
|
|
1559
|
+
padding-right: var(--wui-spacing-xs);
|
|
1560
|
+
}
|
|
1561
|
+
|
|
1562
|
+
.wui-padding-right-s {
|
|
1563
|
+
padding-right: var(--wui-spacing-s);
|
|
1564
|
+
}
|
|
1565
|
+
|
|
1566
|
+
.wui-padding-right-m {
|
|
1567
|
+
padding-right: var(--wui-spacing-m);
|
|
1568
|
+
}
|
|
1569
|
+
|
|
1570
|
+
.wui-padding-right-l {
|
|
1571
|
+
padding-right: var(--wui-spacing-l);
|
|
1572
|
+
}
|
|
1573
|
+
|
|
1574
|
+
.wui-padding-right-xl {
|
|
1575
|
+
padding-right: var(--wui-spacing-xl);
|
|
1576
|
+
}
|
|
1577
|
+
|
|
1578
|
+
.wui-padding-right-2xl {
|
|
1579
|
+
padding-right: var(--wui-spacing-2xl);
|
|
1580
|
+
}
|
|
1581
|
+
|
|
1582
|
+
.wui-padding-right-3xl {
|
|
1583
|
+
padding-right: var(--wui-spacing-3xl);
|
|
1584
|
+
}
|
|
1585
|
+
|
|
1586
|
+
.wui-padding-right-4xl {
|
|
1587
|
+
padding-right: var(--wui-spacing-4xl);
|
|
1588
|
+
}
|
|
1589
|
+
|
|
1590
|
+
.wui-padding-right-5xl {
|
|
1591
|
+
padding-right: var(--wui-spacing-5xl);
|
|
1592
|
+
}
|
|
1593
|
+
|
|
1594
|
+
wui-icon + .wui-size-lg,
|
|
1595
|
+
wui-loading-spinner + .wui-size-lg {
|
|
1596
|
+
padding-left: 50px;
|
|
1597
|
+
}
|
|
1598
|
+
|
|
1599
|
+
wui-icon[data-input='lg'] {
|
|
1600
|
+
left: var(--wui-spacing-l);
|
|
1601
|
+
}
|
|
1602
|
+
|
|
1603
|
+
.wui-size-mdl {
|
|
1604
|
+
padding: 17.25px var(--wui-spacing-m) 17.25px var(--wui-spacing-m);
|
|
1605
|
+
}
|
|
1606
|
+
wui-icon + .wui-size-mdl,
|
|
1607
|
+
wui-loading-spinner + .wui-size-mdl {
|
|
1608
|
+
padding: 17.25px var(--wui-spacing-3xl) 17.25px 40px;
|
|
1609
|
+
}
|
|
1610
|
+
wui-icon[data-input='mdl'] {
|
|
1611
|
+
left: var(--wui-spacing-m);
|
|
1612
|
+
}
|
|
1613
|
+
|
|
1614
|
+
input:placeholder-shown ~ ::slotted(wui-input-element),
|
|
1615
|
+
input:placeholder-shown ~ ::slotted(wui-icon) {
|
|
1616
|
+
opacity: 0;
|
|
1617
|
+
pointer-events: none;
|
|
1618
|
+
}
|
|
1619
|
+
|
|
1620
|
+
input::-webkit-outer-spin-button,
|
|
1621
|
+
input::-webkit-inner-spin-button {
|
|
1622
|
+
-webkit-appearance: none;
|
|
1623
|
+
margin: 0;
|
|
1624
|
+
}
|
|
1625
|
+
|
|
1626
|
+
input[type='number'] {
|
|
1627
|
+
-moz-appearance: textfield;
|
|
1628
|
+
}
|
|
1629
|
+
|
|
1630
|
+
::slotted(wui-input-element),
|
|
1631
|
+
::slotted(wui-icon) {
|
|
1632
|
+
position: absolute;
|
|
1633
|
+
top: 50%;
|
|
1634
|
+
transform: translateY(-50%);
|
|
1635
|
+
}
|
|
1636
|
+
|
|
1637
|
+
::slotted(wui-input-element) {
|
|
1638
|
+
right: var(--wui-spacing-m);
|
|
1639
|
+
}
|
|
1640
|
+
|
|
1641
|
+
::slotted(wui-icon) {
|
|
1642
|
+
right: 0px;
|
|
1643
|
+
}
|
|
1644
|
+
`;var le=function(r,e,n,i){var o=arguments.length,t=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,n):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(r,e,n,i);else for(var s=r.length-1;s>=0;s--)(a=r[s])&&(t=(o<3?a(t):o>3?a(e,n,t):a(e,n))||t);return o>3&&t&&Object.defineProperty(e,n,t),t};let X=class extends O{constructor(){super(...arguments),this.inputElementRef=fn(),this.size="md",this.disabled=!1,this.placeholder="",this.type="text",this.value=""}render(){const e=`wui-padding-right-${this.inputRightPadding}`,i={[`wui-size-${this.size}`]:!0,[e]:!!this.inputRightPadding};return c`${this.templateIcon()}
|
|
1645
|
+
<input
|
|
1646
|
+
data-testid="wui-input-text"
|
|
1647
|
+
${pn(this.inputElementRef)}
|
|
1648
|
+
class=${$i(i)}
|
|
1649
|
+
type=${this.type}
|
|
1650
|
+
enterkeyhint=${W(this.enterKeyHint)}
|
|
1651
|
+
?disabled=${this.disabled}
|
|
1652
|
+
placeholder=${this.placeholder}
|
|
1653
|
+
@input=${this.dispatchInputChangeEvent.bind(this)}
|
|
1654
|
+
.value=${this.value||""}
|
|
1655
|
+
tabindex=${W(this.tabIdx)}
|
|
1656
|
+
/>
|
|
1657
|
+
<slot></slot>`}templateIcon(){return this.icon?c`<wui-icon
|
|
1658
|
+
data-input=${this.size}
|
|
1659
|
+
size=${this.size}
|
|
1660
|
+
color="inherit"
|
|
1661
|
+
name=${this.icon}
|
|
1662
|
+
></wui-icon>`:null}dispatchInputChangeEvent(){this.dispatchEvent(new CustomEvent("inputChange",{detail:this.inputElementRef.value?.value,bubbles:!0,composed:!0}))}};X.styles=[q,G,So];le([u()],X.prototype,"size",void 0);le([u()],X.prototype,"icon",void 0);le([u({type:Boolean})],X.prototype,"disabled",void 0);le([u()],X.prototype,"placeholder",void 0);le([u()],X.prototype,"type",void 0);le([u()],X.prototype,"keyHint",void 0);le([u()],X.prototype,"value",void 0);le([u()],X.prototype,"inputRightPadding",void 0);le([u()],X.prototype,"tabIdx",void 0);X=le([T("wui-input-text")],X);const To=N`
|
|
1663
|
+
:host {
|
|
1664
|
+
position: relative;
|
|
1665
|
+
display: inline-block;
|
|
1666
|
+
width: 100%;
|
|
1667
|
+
}
|
|
1668
|
+
`;var Bo=function(r,e,n,i){var o=arguments.length,t=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,n):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(r,e,n,i);else for(var s=r.length-1;s>=0;s--)(a=r[s])&&(t=(o<3?a(t):o>3?a(e,n,t):a(e,n))||t);return o>3&&t&&Object.defineProperty(e,n,t),t};let rn=class extends O{constructor(){super(...arguments),this.inputComponentRef=fn()}render(){return c`
|
|
1669
|
+
<wui-input-text
|
|
1670
|
+
${pn(this.inputComponentRef)}
|
|
1671
|
+
placeholder="Search wallet"
|
|
1672
|
+
icon="search"
|
|
1673
|
+
type="search"
|
|
1674
|
+
enterKeyHint="search"
|
|
1675
|
+
size="sm"
|
|
1676
|
+
>
|
|
1677
|
+
<wui-input-element @click=${this.clearValue} icon="close"></wui-input-element>
|
|
1678
|
+
</wui-input-text>
|
|
1679
|
+
`}clearValue(){const n=this.inputComponentRef.value?.inputElementRef.value;n&&(n.value="",n.focus(),n.dispatchEvent(new Event("input")))}};rn.styles=[q,To];rn=Bo([T("wui-search-bar")],rn);const Po=Ne`<svg viewBox="0 0 48 54" fill="none">
|
|
1680
|
+
<path
|
|
1681
|
+
d="M43.4605 10.7248L28.0485 1.61089C25.5438 0.129705 22.4562 0.129705 19.9515 1.61088L4.53951 10.7248C2.03626 12.2051 0.5 14.9365 0.5 17.886V36.1139C0.5 39.0635 2.03626 41.7949 4.53951 43.2752L19.9515 52.3891C22.4562 53.8703 25.5438 53.8703 28.0485 52.3891L43.4605 43.2752C45.9637 41.7949 47.5 39.0635 47.5 36.114V17.8861C47.5 14.9365 45.9637 12.2051 43.4605 10.7248Z"
|
|
1682
|
+
/>
|
|
1683
|
+
</svg>`,Lo=N`
|
|
1684
|
+
:host {
|
|
1685
|
+
display: flex;
|
|
1686
|
+
flex-direction: column;
|
|
1687
|
+
align-items: center;
|
|
1688
|
+
width: 104px;
|
|
1689
|
+
row-gap: var(--wui-spacing-xs);
|
|
1690
|
+
padding: var(--wui-spacing-xs) 10px;
|
|
1691
|
+
background-color: var(--wui-color-gray-glass-002);
|
|
1692
|
+
border-radius: clamp(0px, var(--wui-border-radius-xs), 20px);
|
|
1693
|
+
position: relative;
|
|
1694
|
+
}
|
|
1695
|
+
|
|
1696
|
+
wui-shimmer[data-type='network'] {
|
|
1697
|
+
border: none;
|
|
1698
|
+
-webkit-clip-path: var(--wui-path-network);
|
|
1699
|
+
clip-path: var(--wui-path-network);
|
|
1700
|
+
}
|
|
1701
|
+
|
|
1702
|
+
svg {
|
|
1703
|
+
position: absolute;
|
|
1704
|
+
width: 48px;
|
|
1705
|
+
height: 54px;
|
|
1706
|
+
z-index: 1;
|
|
1707
|
+
}
|
|
1708
|
+
|
|
1709
|
+
svg > path {
|
|
1710
|
+
stroke: var(--wui-color-gray-glass-010);
|
|
1711
|
+
stroke-width: 1px;
|
|
1712
|
+
}
|
|
1713
|
+
|
|
1714
|
+
@media (max-width: 350px) {
|
|
1715
|
+
:host {
|
|
1716
|
+
width: 100%;
|
|
1717
|
+
}
|
|
1718
|
+
}
|
|
1719
|
+
`;var wi=function(r,e,n,i){var o=arguments.length,t=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,n):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(r,e,n,i);else for(var s=r.length-1;s>=0;s--)(a=r[s])&&(t=(o<3?a(t):o>3?a(e,n,t):a(e,n))||t);return o>3&&t&&Object.defineProperty(e,n,t),t};let dt=class extends O{constructor(){super(...arguments),this.type="wallet"}render(){return c`
|
|
1720
|
+
${this.shimmerTemplate()}
|
|
1721
|
+
<wui-shimmer width="56px" height="20px" borderRadius="xs"></wui-shimmer>
|
|
1722
|
+
`}shimmerTemplate(){return this.type==="network"?c` <wui-shimmer
|
|
1723
|
+
data-type=${this.type}
|
|
1724
|
+
width="48px"
|
|
1725
|
+
height="54px"
|
|
1726
|
+
borderRadius="xs"
|
|
1727
|
+
></wui-shimmer>
|
|
1728
|
+
${Po}`:c`<wui-shimmer width="56px" height="56px" borderRadius="xs"></wui-shimmer>`}};dt.styles=[q,G,Lo];wi([u()],dt.prototype,"type",void 0);dt=wi([T("wui-card-select-loader")],dt);const Oo=N`
|
|
1729
|
+
:host {
|
|
1730
|
+
display: grid;
|
|
1731
|
+
width: inherit;
|
|
1732
|
+
height: inherit;
|
|
1733
|
+
}
|
|
1734
|
+
`;var Z=function(r,e,n,i){var o=arguments.length,t=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,n):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(r,e,n,i);else for(var s=r.length-1;s>=0;s--)(a=r[s])&&(t=(o<3?a(t):o>3?a(e,n,t):a(e,n))||t);return o>3&&t&&Object.defineProperty(e,n,t),t};let H=class extends O{render(){return this.style.cssText=`
|
|
1735
|
+
grid-template-rows: ${this.gridTemplateRows};
|
|
1736
|
+
grid-template-columns: ${this.gridTemplateColumns};
|
|
1737
|
+
justify-items: ${this.justifyItems};
|
|
1738
|
+
align-items: ${this.alignItems};
|
|
1739
|
+
justify-content: ${this.justifyContent};
|
|
1740
|
+
align-content: ${this.alignContent};
|
|
1741
|
+
column-gap: ${this.columnGap&&`var(--wui-spacing-${this.columnGap})`};
|
|
1742
|
+
row-gap: ${this.rowGap&&`var(--wui-spacing-${this.rowGap})`};
|
|
1743
|
+
gap: ${this.gap&&`var(--wui-spacing-${this.gap})`};
|
|
1744
|
+
padding-top: ${this.padding&&he.getSpacingStyles(this.padding,0)};
|
|
1745
|
+
padding-right: ${this.padding&&he.getSpacingStyles(this.padding,1)};
|
|
1746
|
+
padding-bottom: ${this.padding&&he.getSpacingStyles(this.padding,2)};
|
|
1747
|
+
padding-left: ${this.padding&&he.getSpacingStyles(this.padding,3)};
|
|
1748
|
+
margin-top: ${this.margin&&he.getSpacingStyles(this.margin,0)};
|
|
1749
|
+
margin-right: ${this.margin&&he.getSpacingStyles(this.margin,1)};
|
|
1750
|
+
margin-bottom: ${this.margin&&he.getSpacingStyles(this.margin,2)};
|
|
1751
|
+
margin-left: ${this.margin&&he.getSpacingStyles(this.margin,3)};
|
|
1752
|
+
`,c`<slot></slot>`}};H.styles=[q,Oo];Z([u()],H.prototype,"gridTemplateRows",void 0);Z([u()],H.prototype,"gridTemplateColumns",void 0);Z([u()],H.prototype,"justifyItems",void 0);Z([u()],H.prototype,"alignItems",void 0);Z([u()],H.prototype,"justifyContent",void 0);Z([u()],H.prototype,"alignContent",void 0);Z([u()],H.prototype,"columnGap",void 0);Z([u()],H.prototype,"rowGap",void 0);Z([u()],H.prototype,"gap",void 0);Z([u()],H.prototype,"padding",void 0);Z([u()],H.prototype,"margin",void 0);H=Z([T("wui-grid")],H);const Ao=N`
|
|
1753
|
+
button {
|
|
1754
|
+
display: flex;
|
|
1755
|
+
flex-direction: column;
|
|
1756
|
+
justify-content: center;
|
|
1757
|
+
align-items: center;
|
|
1758
|
+
cursor: pointer;
|
|
1759
|
+
width: 104px;
|
|
1760
|
+
row-gap: var(--wui-spacing-xs);
|
|
1761
|
+
padding: var(--wui-spacing-s) var(--wui-spacing-0);
|
|
1762
|
+
background-color: var(--wui-color-gray-glass-002);
|
|
1763
|
+
border-radius: clamp(0px, var(--wui-border-radius-xs), 20px);
|
|
1764
|
+
transition:
|
|
1765
|
+
color var(--wui-duration-lg) var(--wui-ease-out-power-1),
|
|
1766
|
+
background-color var(--wui-duration-lg) var(--wui-ease-out-power-1),
|
|
1767
|
+
border-radius var(--wui-duration-lg) var(--wui-ease-out-power-1);
|
|
1768
|
+
will-change: background-color, color, border-radius;
|
|
1769
|
+
outline: none;
|
|
1770
|
+
border: none;
|
|
1771
|
+
}
|
|
1772
|
+
|
|
1773
|
+
button > wui-flex > wui-text {
|
|
1774
|
+
color: var(--wui-color-fg-100);
|
|
1775
|
+
max-width: 86px;
|
|
1776
|
+
white-space: nowrap;
|
|
1777
|
+
overflow: hidden;
|
|
1778
|
+
text-overflow: ellipsis;
|
|
1779
|
+
justify-content: center;
|
|
1780
|
+
}
|
|
1781
|
+
|
|
1782
|
+
button > wui-flex > wui-text.certified {
|
|
1783
|
+
max-width: 66px;
|
|
1784
|
+
}
|
|
1785
|
+
|
|
1786
|
+
button:hover:enabled {
|
|
1787
|
+
background-color: var(--wui-color-gray-glass-005);
|
|
1788
|
+
}
|
|
1789
|
+
|
|
1790
|
+
button:disabled > wui-flex > wui-text {
|
|
1791
|
+
color: var(--wui-color-gray-glass-015);
|
|
1792
|
+
}
|
|
1793
|
+
|
|
1794
|
+
[data-selected='true'] {
|
|
1795
|
+
background-color: var(--wui-color-accent-glass-020);
|
|
1796
|
+
}
|
|
1797
|
+
|
|
1798
|
+
@media (hover: hover) and (pointer: fine) {
|
|
1799
|
+
[data-selected='true']:hover:enabled {
|
|
1800
|
+
background-color: var(--wui-color-accent-glass-015);
|
|
1801
|
+
}
|
|
1802
|
+
}
|
|
1803
|
+
|
|
1804
|
+
[data-selected='true']:active:enabled {
|
|
1805
|
+
background-color: var(--wui-color-accent-glass-010);
|
|
1806
|
+
}
|
|
1807
|
+
|
|
1808
|
+
@media (max-width: 350px) {
|
|
1809
|
+
button {
|
|
1810
|
+
width: 100%;
|
|
1811
|
+
}
|
|
1812
|
+
}
|
|
1813
|
+
`;var Ye=function(r,e,n,i){var o=arguments.length,t=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,n):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(r,e,n,i);else for(var s=r.length-1;s>=0;s--)(a=r[s])&&(t=(o<3?a(t):o>3?a(e,n,t):a(e,n))||t);return o>3&&t&&Object.defineProperty(e,n,t),t};let $e=class extends O{constructor(){super(),this.observer=new IntersectionObserver(()=>{}),this.visible=!1,this.imageSrc=void 0,this.imageLoading=!1,this.wallet=void 0,this.observer=new IntersectionObserver(e=>{e.forEach(n=>{n.isIntersecting?(this.visible=!0,this.fetchImageSrc()):this.visible=!1})},{threshold:.01})}firstUpdated(){this.observer.observe(this)}disconnectedCallback(){this.observer.disconnect()}render(){const e=this.wallet?.badge_type==="certified";return c`
|
|
1814
|
+
<button>
|
|
1815
|
+
${this.imageTemplate()}
|
|
1816
|
+
<wui-flex flexDirection="row" alignItems="center" justifyContent="center" gap="3xs">
|
|
1817
|
+
<wui-text
|
|
1818
|
+
variant="tiny-500"
|
|
1819
|
+
color="inherit"
|
|
1820
|
+
class=${W(e?"certified":void 0)}
|
|
1821
|
+
>${this.wallet?.name}</wui-text
|
|
1822
|
+
>
|
|
1823
|
+
${e?c`<wui-icon size="sm" name="walletConnectBrown"></wui-icon>`:null}
|
|
1824
|
+
</wui-flex>
|
|
1825
|
+
</button>
|
|
1826
|
+
`}imageTemplate(){return!this.visible&&!this.imageSrc||this.imageLoading?this.shimmerTemplate():c`
|
|
1827
|
+
<wui-wallet-image
|
|
1828
|
+
size="md"
|
|
1829
|
+
imageSrc=${W(this.imageSrc)}
|
|
1830
|
+
name=${this.wallet?.name}
|
|
1831
|
+
.installed=${this.wallet?.installed}
|
|
1832
|
+
badgeSize="sm"
|
|
1833
|
+
>
|
|
1834
|
+
</wui-wallet-image>
|
|
1835
|
+
`}shimmerTemplate(){return c`<wui-shimmer width="56px" height="56px" borderRadius="xs"></wui-shimmer>`}async fetchImageSrc(){this.wallet&&(this.imageSrc=K.getWalletImage(this.wallet),!this.imageSrc&&(this.imageLoading=!0,this.imageSrc=await K.fetchWalletImage(this.wallet.image_id),this.imageLoading=!1))}};$e.styles=Ao;Ye([I()],$e.prototype,"visible",void 0);Ye([I()],$e.prototype,"imageSrc",void 0);Ye([I()],$e.prototype,"imageLoading",void 0);Ye([u()],$e.prototype,"wallet",void 0);$e=Ye([T("w3m-all-wallets-list-item")],$e);const jo=N`
|
|
1836
|
+
wui-grid {
|
|
1837
|
+
max-height: clamp(360px, 400px, 80vh);
|
|
1838
|
+
overflow: scroll;
|
|
1839
|
+
scrollbar-width: none;
|
|
1840
|
+
grid-auto-rows: min-content;
|
|
1841
|
+
grid-template-columns: repeat(auto-fill, 104px);
|
|
1842
|
+
}
|
|
1843
|
+
|
|
1844
|
+
@media (max-width: 350px) {
|
|
1845
|
+
wui-grid {
|
|
1846
|
+
grid-template-columns: repeat(2, 1fr);
|
|
1847
|
+
}
|
|
1848
|
+
}
|
|
1849
|
+
|
|
1850
|
+
wui-grid[data-scroll='false'] {
|
|
1851
|
+
overflow: hidden;
|
|
1852
|
+
}
|
|
1853
|
+
|
|
1854
|
+
wui-grid::-webkit-scrollbar {
|
|
1855
|
+
display: none;
|
|
1856
|
+
}
|
|
1857
|
+
|
|
1858
|
+
wui-loading-spinner {
|
|
1859
|
+
padding-top: var(--wui-spacing-l);
|
|
1860
|
+
padding-bottom: var(--wui-spacing-l);
|
|
1861
|
+
justify-content: center;
|
|
1862
|
+
grid-column: 1 / span 4;
|
|
1863
|
+
}
|
|
1864
|
+
`;var ke=function(r,e,n,i){var o=arguments.length,t=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,n):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(r,e,n,i);else for(var s=r.length-1;s>=0;s--)(a=r[s])&&(t=(o<3?a(t):o>3?a(e,n,t):a(e,n))||t);return o>3&&t&&Object.defineProperty(e,n,t),t};const ei="local-paginator";let be=class extends O{constructor(){super(),this.unsubscribe=[],this.paginationObserver=void 0,this.loading=!z.state.wallets.length,this.wallets=z.state.wallets,this.recommended=z.state.recommended,this.featured=z.state.featured,this.filteredWallets=z.state.filteredWallets,this.unsubscribe.push(z.subscribeKey("wallets",e=>this.wallets=e),z.subscribeKey("recommended",e=>this.recommended=e),z.subscribeKey("featured",e=>this.featured=e),z.subscribeKey("filteredWallets",e=>this.filteredWallets=e))}firstUpdated(){this.initialFetch(),this.createPaginationObserver()}disconnectedCallback(){this.unsubscribe.forEach(e=>e()),this.paginationObserver?.disconnect()}render(){return c`
|
|
1865
|
+
<wui-grid
|
|
1866
|
+
data-scroll=${!this.loading}
|
|
1867
|
+
.padding=${["0","s","s","s"]}
|
|
1868
|
+
columnGap="xxs"
|
|
1869
|
+
rowGap="l"
|
|
1870
|
+
justifyContent="space-between"
|
|
1871
|
+
>
|
|
1872
|
+
${this.loading?this.shimmerTemplate(16):this.walletsTemplate()}
|
|
1873
|
+
${this.paginationLoaderTemplate()}
|
|
1874
|
+
</wui-grid>
|
|
1875
|
+
`}async initialFetch(){this.loading=!0;const e=this.shadowRoot?.querySelector("wui-grid");e&&(await z.fetchWalletsByPage({page:1}),await e.animate([{opacity:1},{opacity:0}],{duration:200,fill:"forwards",easing:"ease"}).finished,this.loading=!1,e.animate([{opacity:0},{opacity:1}],{duration:200,fill:"forwards",easing:"ease"}))}shimmerTemplate(e,n){return[...Array(e)].map(()=>c`
|
|
1876
|
+
<wui-card-select-loader type="wallet" id=${W(n)}></wui-card-select-loader>
|
|
1877
|
+
`)}walletsTemplate(){const e=this.filteredWallets?.length>0?j.uniqueBy([...this.featured,...this.recommended,...this.filteredWallets],"id"):j.uniqueBy([...this.featured,...this.recommended,...this.wallets],"id");return pt.markWalletsAsInstalled(e).map(i=>c`
|
|
1878
|
+
<w3m-all-wallets-list-item
|
|
1879
|
+
@click=${()=>this.onConnectWallet(i)}
|
|
1880
|
+
.wallet=${i}
|
|
1881
|
+
></w3m-all-wallets-list-item>
|
|
1882
|
+
`)}paginationLoaderTemplate(){const{wallets:e,recommended:n,featured:i,count:o}=z.state,t=window.innerWidth<352?3:4,a=e.length+n.length;let l=Math.ceil(a/t)*t-a+t;return l-=e.length?i.length%t:0,o===0&&i.length>0?null:o===0||[...i,...e,...n].length<o?this.shimmerTemplate(l,ei):null}createPaginationObserver(){const e=this.shadowRoot?.querySelector(`#${ei}`);e&&(this.paginationObserver=new IntersectionObserver(([n])=>{if(n?.isIntersecting&&!this.loading){const{page:i,count:o,wallets:t}=z.state;t.length<o&&z.fetchWalletsByPage({page:i+1})}}),this.paginationObserver.observe(e))}onConnectWallet(e){M.selectWalletConnector(e)}};be.styles=jo;ke([I()],be.prototype,"loading",void 0);ke([I()],be.prototype,"wallets",void 0);ke([I()],be.prototype,"recommended",void 0);ke([I()],be.prototype,"featured",void 0);ke([I()],be.prototype,"filteredWallets",void 0);be=ke([T("w3m-all-wallets-list")],be);const ko=N`
|
|
1883
|
+
wui-grid,
|
|
1884
|
+
wui-loading-spinner,
|
|
1885
|
+
wui-flex {
|
|
1886
|
+
height: 360px;
|
|
1887
|
+
}
|
|
1888
|
+
|
|
1889
|
+
wui-grid {
|
|
1890
|
+
overflow: scroll;
|
|
1891
|
+
scrollbar-width: none;
|
|
1892
|
+
grid-auto-rows: min-content;
|
|
1893
|
+
grid-template-columns: repeat(auto-fill, 104px);
|
|
1894
|
+
}
|
|
1895
|
+
|
|
1896
|
+
wui-grid[data-scroll='false'] {
|
|
1897
|
+
overflow: hidden;
|
|
1898
|
+
}
|
|
1899
|
+
|
|
1900
|
+
wui-grid::-webkit-scrollbar {
|
|
1901
|
+
display: none;
|
|
1902
|
+
}
|
|
1903
|
+
|
|
1904
|
+
wui-loading-spinner {
|
|
1905
|
+
justify-content: center;
|
|
1906
|
+
align-items: center;
|
|
1907
|
+
}
|
|
1908
|
+
|
|
1909
|
+
@media (max-width: 350px) {
|
|
1910
|
+
wui-grid {
|
|
1911
|
+
grid-template-columns: repeat(2, 1fr);
|
|
1912
|
+
}
|
|
1913
|
+
}
|
|
1914
|
+
`;var xt=function(r,e,n,i){var o=arguments.length,t=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,n):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(r,e,n,i);else for(var s=r.length-1;s>=0;s--)(a=r[s])&&(t=(o<3?a(t):o>3?a(e,n,t):a(e,n))||t);return o>3&&t&&Object.defineProperty(e,n,t),t};let Oe=class extends O{constructor(){super(...arguments),this.prevQuery="",this.prevBadge=void 0,this.loading=!0,this.query=""}render(){return this.onSearch(),this.loading?c`<wui-loading-spinner color="accent-100"></wui-loading-spinner>`:this.walletsTemplate()}async onSearch(){(this.query.trim()!==this.prevQuery.trim()||this.badge!==this.prevBadge)&&(this.prevQuery=this.query,this.prevBadge=this.badge,this.loading=!0,await z.searchWallet({search:this.query,badge:this.badge}),this.loading=!1)}walletsTemplate(){const{search:e}=z.state,n=pt.markWalletsAsInstalled(e);return e.length?c`
|
|
1915
|
+
<wui-grid
|
|
1916
|
+
data-testid="wallet-list"
|
|
1917
|
+
.padding=${["0","s","s","s"]}
|
|
1918
|
+
rowGap="l"
|
|
1919
|
+
columnGap="xs"
|
|
1920
|
+
justifyContent="space-between"
|
|
1921
|
+
>
|
|
1922
|
+
${n.map(i=>c`
|
|
1923
|
+
<w3m-all-wallets-list-item
|
|
1924
|
+
@click=${()=>this.onConnectWallet(i)}
|
|
1925
|
+
.wallet=${i}
|
|
1926
|
+
data-testid="wallet-search-item-${i.id}"
|
|
1927
|
+
></w3m-all-wallets-list-item>
|
|
1928
|
+
`)}
|
|
1929
|
+
</wui-grid>
|
|
1930
|
+
`:c`
|
|
1931
|
+
<wui-flex
|
|
1932
|
+
data-testid="no-wallet-found"
|
|
1933
|
+
justifyContent="center"
|
|
1934
|
+
alignItems="center"
|
|
1935
|
+
gap="s"
|
|
1936
|
+
flexDirection="column"
|
|
1937
|
+
>
|
|
1938
|
+
<wui-icon-box
|
|
1939
|
+
size="lg"
|
|
1940
|
+
iconColor="fg-200"
|
|
1941
|
+
backgroundColor="fg-300"
|
|
1942
|
+
icon="wallet"
|
|
1943
|
+
background="transparent"
|
|
1944
|
+
></wui-icon-box>
|
|
1945
|
+
<wui-text data-testid="no-wallet-found-text" color="fg-200" variant="paragraph-500">
|
|
1946
|
+
No Wallet found
|
|
1947
|
+
</wui-text>
|
|
1948
|
+
</wui-flex>
|
|
1949
|
+
`}onConnectWallet(e){M.selectWalletConnector(e)}};Oe.styles=ko;xt([I()],Oe.prototype,"loading",void 0);xt([u()],Oe.prototype,"query",void 0);xt([u()],Oe.prototype,"badge",void 0);Oe=xt([T("w3m-all-wallets-search")],Oe);var gn=function(r,e,n,i){var o=arguments.length,t=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,n):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(r,e,n,i);else for(var s=r.length-1;s>=0;s--)(a=r[s])&&(t=(o<3?a(t):o>3?a(e,n,t):a(e,n))||t);return o>3&&t&&Object.defineProperty(e,n,t),t};let ht=class extends O{constructor(){super(...arguments),this.search="",this.onDebouncedSearch=j.debounce(e=>{this.search=e})}render(){const e=this.search.length>=2;return c`
|
|
1950
|
+
<wui-flex .padding=${["0","s","s","s"]} gap="xs">
|
|
1951
|
+
<wui-search-bar @inputChange=${this.onInputChange.bind(this)}></wui-search-bar>
|
|
1952
|
+
<wui-certified-switch
|
|
1953
|
+
?checked=${this.badge}
|
|
1954
|
+
@click=${this.onClick.bind(this)}
|
|
1955
|
+
data-testid="wui-certified-switch"
|
|
1956
|
+
></wui-certified-switch>
|
|
1957
|
+
${this.qrButtonTemplate()}
|
|
1958
|
+
</wui-flex>
|
|
1959
|
+
${e||this.badge?c`<w3m-all-wallets-search
|
|
1960
|
+
query=${this.search}
|
|
1961
|
+
badge=${W(this.badge)}
|
|
1962
|
+
></w3m-all-wallets-search>`:c`<w3m-all-wallets-list badge=${W(this.badge)}></w3m-all-wallets-list>`}
|
|
1963
|
+
`}onInputChange(e){this.onDebouncedSearch(e.detail)}onClick(){if(this.badge==="certified"){this.badge=void 0;return}this.badge="certified",Xe.showSvg("Only WalletConnect certified",{icon:"walletConnectBrown",iconColor:"accent-100"})}qrButtonTemplate(){return j.isMobile()?c`
|
|
1964
|
+
<wui-icon-box
|
|
1965
|
+
size="lg"
|
|
1966
|
+
iconSize="xl"
|
|
1967
|
+
iconColor="accent-100"
|
|
1968
|
+
backgroundColor="accent-100"
|
|
1969
|
+
icon="qrCode"
|
|
1970
|
+
background="transparent"
|
|
1971
|
+
border
|
|
1972
|
+
borderColor="wui-accent-glass-010"
|
|
1973
|
+
@click=${this.onWalletConnectQr.bind(this)}
|
|
1974
|
+
></wui-icon-box>
|
|
1975
|
+
`:null}onWalletConnectQr(){U.push("ConnectingWalletConnect")}};gn([I()],ht.prototype,"search",void 0);gn([I()],ht.prototype,"badge",void 0);ht=gn([T("w3m-all-wallets-view")],ht);const Do=N`
|
|
1976
|
+
button {
|
|
1977
|
+
column-gap: var(--wui-spacing-s);
|
|
1978
|
+
padding: 11px 18px 11px var(--wui-spacing-s);
|
|
1979
|
+
width: 100%;
|
|
1980
|
+
background-color: var(--wui-color-gray-glass-002);
|
|
1981
|
+
border-radius: var(--wui-border-radius-xs);
|
|
1982
|
+
color: var(--wui-color-fg-250);
|
|
1983
|
+
transition:
|
|
1984
|
+
color var(--wui-ease-out-power-1) var(--wui-duration-md),
|
|
1985
|
+
background-color var(--wui-ease-out-power-1) var(--wui-duration-md);
|
|
1986
|
+
will-change: color, background-color;
|
|
1987
|
+
}
|
|
1988
|
+
|
|
1989
|
+
button[data-iconvariant='square'],
|
|
1990
|
+
button[data-iconvariant='square-blue'] {
|
|
1991
|
+
padding: 6px 18px 6px 9px;
|
|
1992
|
+
}
|
|
1993
|
+
|
|
1994
|
+
button > wui-flex {
|
|
1995
|
+
flex: 1;
|
|
1996
|
+
}
|
|
1997
|
+
|
|
1998
|
+
button > wui-image {
|
|
1999
|
+
width: 32px;
|
|
2000
|
+
height: 32px;
|
|
2001
|
+
box-shadow: 0 0 0 2px var(--wui-color-gray-glass-005);
|
|
2002
|
+
border-radius: var(--wui-border-radius-3xl);
|
|
2003
|
+
}
|
|
2004
|
+
|
|
2005
|
+
button > wui-icon {
|
|
2006
|
+
width: 36px;
|
|
2007
|
+
height: 36px;
|
|
2008
|
+
transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md);
|
|
2009
|
+
will-change: opacity;
|
|
2010
|
+
}
|
|
2011
|
+
|
|
2012
|
+
button > wui-icon-box[data-variant='blue'] {
|
|
2013
|
+
box-shadow: 0 0 0 2px var(--wui-color-accent-glass-005);
|
|
2014
|
+
}
|
|
2015
|
+
|
|
2016
|
+
button > wui-icon-box[data-variant='overlay'] {
|
|
2017
|
+
box-shadow: 0 0 0 2px var(--wui-color-gray-glass-005);
|
|
2018
|
+
}
|
|
2019
|
+
|
|
2020
|
+
button > wui-icon-box[data-variant='square-blue'] {
|
|
2021
|
+
border-radius: var(--wui-border-radius-3xs);
|
|
2022
|
+
position: relative;
|
|
2023
|
+
border: none;
|
|
2024
|
+
width: 36px;
|
|
2025
|
+
height: 36px;
|
|
2026
|
+
}
|
|
2027
|
+
|
|
2028
|
+
button > wui-icon-box[data-variant='square-blue']::after {
|
|
2029
|
+
content: '';
|
|
2030
|
+
position: absolute;
|
|
2031
|
+
top: 0;
|
|
2032
|
+
bottom: 0;
|
|
2033
|
+
left: 0;
|
|
2034
|
+
right: 0;
|
|
2035
|
+
border-radius: inherit;
|
|
2036
|
+
border: 1px solid var(--wui-color-accent-glass-010);
|
|
2037
|
+
pointer-events: none;
|
|
2038
|
+
}
|
|
2039
|
+
|
|
2040
|
+
button > wui-icon:last-child {
|
|
2041
|
+
width: 14px;
|
|
2042
|
+
height: 14px;
|
|
2043
|
+
}
|
|
2044
|
+
|
|
2045
|
+
button:disabled {
|
|
2046
|
+
color: var(--wui-color-gray-glass-020);
|
|
2047
|
+
}
|
|
2048
|
+
|
|
2049
|
+
button[data-loading='true'] > wui-icon {
|
|
2050
|
+
opacity: 0;
|
|
2051
|
+
}
|
|
2052
|
+
|
|
2053
|
+
wui-loading-spinner {
|
|
2054
|
+
position: absolute;
|
|
2055
|
+
right: 18px;
|
|
2056
|
+
top: 50%;
|
|
2057
|
+
transform: translateY(-50%);
|
|
2058
|
+
}
|
|
2059
|
+
`;var ie=function(r,e,n,i){var o=arguments.length,t=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,n):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(r,e,n,i);else for(var s=r.length-1;s>=0;s--)(a=r[s])&&(t=(o<3?a(t):o>3?a(e,n,t):a(e,n))||t);return o>3&&t&&Object.defineProperty(e,n,t),t};let J=class extends O{constructor(){super(...arguments),this.tabIdx=void 0,this.variant="icon",this.disabled=!1,this.imageSrc=void 0,this.alt=void 0,this.chevron=!1,this.loading=!1}render(){return c`
|
|
2060
|
+
<button
|
|
2061
|
+
?disabled=${this.loading?!0:!!this.disabled}
|
|
2062
|
+
data-loading=${this.loading}
|
|
2063
|
+
data-iconvariant=${W(this.iconVariant)}
|
|
2064
|
+
tabindex=${W(this.tabIdx)}
|
|
2065
|
+
>
|
|
2066
|
+
${this.loadingTemplate()} ${this.visualTemplate()}
|
|
2067
|
+
<wui-flex gap="3xs">
|
|
2068
|
+
<slot></slot>
|
|
2069
|
+
</wui-flex>
|
|
2070
|
+
${this.chevronTemplate()}
|
|
2071
|
+
</button>
|
|
2072
|
+
`}visualTemplate(){if(this.variant==="image"&&this.imageSrc)return c`<wui-image src=${this.imageSrc} alt=${this.alt??"list item"}></wui-image>`;if(this.iconVariant==="square"&&this.icon&&this.variant==="icon")return c`<wui-icon name=${this.icon}></wui-icon>`;if(this.variant==="icon"&&this.icon&&this.iconVariant){const e=["blue","square-blue"].includes(this.iconVariant)?"accent-100":"fg-200",n=this.iconVariant==="square-blue"?"mdl":"md",i=this.iconSize?this.iconSize:n;return c`
|
|
2073
|
+
<wui-icon-box
|
|
2074
|
+
data-variant=${this.iconVariant}
|
|
2075
|
+
icon=${this.icon}
|
|
2076
|
+
iconSize=${i}
|
|
2077
|
+
background="transparent"
|
|
2078
|
+
iconColor=${e}
|
|
2079
|
+
backgroundColor=${e}
|
|
2080
|
+
size=${n}
|
|
2081
|
+
></wui-icon-box>
|
|
2082
|
+
`}return null}loadingTemplate(){return this.loading?c`<wui-loading-spinner
|
|
2083
|
+
data-testid="wui-list-item-loading-spinner"
|
|
2084
|
+
color="fg-300"
|
|
2085
|
+
></wui-loading-spinner>`:c``}chevronTemplate(){return this.chevron?c`<wui-icon size="inherit" color="fg-200" name="chevronRight"></wui-icon>`:null}};J.styles=[q,G,Do];ie([u()],J.prototype,"icon",void 0);ie([u()],J.prototype,"iconSize",void 0);ie([u()],J.prototype,"tabIdx",void 0);ie([u()],J.prototype,"variant",void 0);ie([u()],J.prototype,"iconVariant",void 0);ie([u({type:Boolean})],J.prototype,"disabled",void 0);ie([u()],J.prototype,"imageSrc",void 0);ie([u()],J.prototype,"alt",void 0);ie([u({type:Boolean})],J.prototype,"chevron",void 0);ie([u({type:Boolean})],J.prototype,"loading",void 0);J=ie([T("wui-list-item")],J);var zo=function(r,e,n,i){var o=arguments.length,t=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,n):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(r,e,n,i);else for(var s=r.length-1;s>=0;s--)(a=r[s])&&(t=(o<3?a(t):o>3?a(e,n,t):a(e,n))||t);return o>3&&t&&Object.defineProperty(e,n,t),t};let ti=class extends O{constructor(){super(...arguments),this.wallet=U.state.data?.wallet}render(){if(!this.wallet)throw new Error("w3m-downloads-view");return c`
|
|
2086
|
+
<wui-flex gap="xs" flexDirection="column" .padding=${["s","s","l","s"]}>
|
|
2087
|
+
${this.chromeTemplate()} ${this.iosTemplate()} ${this.androidTemplate()}
|
|
2088
|
+
${this.homepageTemplate()}
|
|
2089
|
+
</wui-flex>
|
|
2090
|
+
`}chromeTemplate(){return this.wallet?.chrome_store?c`<wui-list-item
|
|
2091
|
+
variant="icon"
|
|
2092
|
+
icon="chromeStore"
|
|
2093
|
+
iconVariant="square"
|
|
2094
|
+
@click=${this.onChromeStore.bind(this)}
|
|
2095
|
+
chevron
|
|
2096
|
+
>
|
|
2097
|
+
<wui-text variant="paragraph-500" color="fg-100">Chrome Extension</wui-text>
|
|
2098
|
+
</wui-list-item>`:null}iosTemplate(){return this.wallet?.app_store?c`<wui-list-item
|
|
2099
|
+
variant="icon"
|
|
2100
|
+
icon="appStore"
|
|
2101
|
+
iconVariant="square"
|
|
2102
|
+
@click=${this.onAppStore.bind(this)}
|
|
2103
|
+
chevron
|
|
2104
|
+
>
|
|
2105
|
+
<wui-text variant="paragraph-500" color="fg-100">iOS App</wui-text>
|
|
2106
|
+
</wui-list-item>`:null}androidTemplate(){return this.wallet?.play_store?c`<wui-list-item
|
|
2107
|
+
variant="icon"
|
|
2108
|
+
icon="playStore"
|
|
2109
|
+
iconVariant="square"
|
|
2110
|
+
@click=${this.onPlayStore.bind(this)}
|
|
2111
|
+
chevron
|
|
2112
|
+
>
|
|
2113
|
+
<wui-text variant="paragraph-500" color="fg-100">Android App</wui-text>
|
|
2114
|
+
</wui-list-item>`:null}homepageTemplate(){return this.wallet?.homepage?c`
|
|
2115
|
+
<wui-list-item
|
|
2116
|
+
variant="icon"
|
|
2117
|
+
icon="browser"
|
|
2118
|
+
iconVariant="square-blue"
|
|
2119
|
+
@click=${this.onHomePage.bind(this)}
|
|
2120
|
+
chevron
|
|
2121
|
+
>
|
|
2122
|
+
<wui-text variant="paragraph-500" color="fg-100">Website</wui-text>
|
|
2123
|
+
</wui-list-item>
|
|
2124
|
+
`:null}onChromeStore(){this.wallet?.chrome_store&&j.openHref(this.wallet.chrome_store,"_blank")}onAppStore(){this.wallet?.app_store&&j.openHref(this.wallet.app_store,"_blank")}onPlayStore(){this.wallet?.play_store&&j.openHref(this.wallet.play_store,"_blank")}onHomePage(){this.wallet?.homepage&&j.openHref(this.wallet.homepage,"_blank")}};ti=zo([T("w3m-downloads-view")],ti);export{ht as W3mAllWalletsView,on as W3mConnectingWcBasicView,ti as W3mDownloadsView};
|