PageSourceSearch

https://www.mirageprivacy.com/js/index-Dv-5T5S7.js

js mirageprivacy.com collected 2026-10-06 15:13:21 UTC 226,160 bytes, 3,426 lines download raw bytes

1import{l as v,r as _,n as W,o as f,q as l,O as m,C as d,ac as Ee,K as S,a as y,V as P,u as ee,E as C,U as me,I as b,z as E,R as h,d as D,S as A,y as x,D as ze,W as Fe,b3 as Xt,b4 as he,aq as J,ao as qi,$ as I,b5 as tt,G as Ii,a1 as Ki,a0 as Gi,_ as Xi,T as ft,ag as Yt,ah as Qt,b6 as Yi,b7 as Qi,aj as Bt,b8 as Ji}from"./index-BBgfjYoQ.js";import{n as c,r as u,a as _i}from"./class-map-C28V0hlT.js";import{o as w}from"./if-defined-BBpXNL40.js";import{c as p,U as F}from"./index-BB_tkGjL.js";import"./index-DP_tdCWC.js";import"./index-C550dzPh.js";import"./index-D1k8h1dr.js";import"./index-D6b3sr2b.js";import{W as ks,a as As}from"./index-DgAWsrwG.js";import"./index-BtfV_rcw.js";import"./index-pJfyTnd4.js";import"./index-Bm3c14tq.js";import{H as Jt}from"./HelpersUtil-Beh-2DTI.js";import{n as Zi}from"./index-BOQEBdAC.js";import{E as Q}from"./ExchangeController-BCHczA2a.js";import"./index-Y39MW7mA.js";import"./index-CDzK957e.js";import"./index-CmsIBQt7.js";import{M as mt}from"./MathUtil-BGCe3rZ3.js";import"./index-XYApXL_n.js";import{e as Zt,n as ei}from"./ref-Cjc6RVZJ.js";import"./index-CbMa4L1B.js";import"./index-Ce--EPXA.js";import"./index-DZ3_KGWR.js";import"./index-C6-BqMpP.js";import{O as bt}from"./index-CqIZTVYW.js";import{e as en}from"./index-Lau0nuiY.js";import"./index-BPiUVzkt.js";import"./index-QNnpOj_I.js";import{N as tn}from"./NavigationUtil-DmfK5sOV.js";import"./index-4rqJmygW.js";import"./viem-Byk_7Uap.js";import"./ConstantsUtil-BYeV0Szv.js";import"./async-directive-Rfx3T8o-.js";import"./browser-B2IYtrfa.js";const nn=v`
2  :host {
3    display: block;
4  }
5
6  button {
7    border-radius: ${({borderRadius:t})=>t[20]};
8    background: ${({tokens:t})=>t.theme.foregroundPrimary};
9    display: flex;
10    gap: ${({spacing:t})=>t[1]};
11    padding: ${({spacing:t})=>t[1]};
12    color: ${({tokens:t})=>t.theme.textSecondary};
13    border-radius: ${({borderRadius:t})=>t[16]};
14    height: 32px;
15    transition: box-shadow ${({durations:t})=>t.lg}
16      ${({easings:t})=>t["ease-out-power-2"]};
17    will-change: box-shadow;
18  }
19
20  button wui-flex.avatar-container {
21    width: 28px;
22    height: 24px;
23    position: relative;
24
25    wui-flex.network-image-container {
26      position: absolute;
27      bottom: 0px;
28      right: 0px;
29      width: 12px;
30      height: 12px;
31    }
32
33    wui-flex.network-image-container wui-icon {
34      background: ${({tokens:t})=>t.theme.foregroundPrimary};
35    }
36
37    wui-avatar {
38      width: 24px;
39      min-width: 24px;
40      height: 24px;
41    }
42
43    wui-icon {
44      width: 12px;
45      height: 12px;
46    }
47  }
48
49  wui-image,
50  wui-icon {
51    border-radius: ${({borderRadius:t})=>t[16]};
52  }
53
54  wui-text {
55    white-space: nowrap;
56  }
57
58  button wui-flex.balance-container {
59    height: 100%;
60    border-radius: ${({borderRadius:t})=>t[16]};
61    padding-left: ${({spacing:t})=>t[1]};
62    padding-right: ${({spacing:t})=>t[1]};
63    background: ${({tokens:t})=>t.theme.foregroundSecondary};
64    color: ${({tokens:t})=>t.theme.textPrimary};
65    transition: background-color ${({durations:t})=>t.lg}
66      ${({easings:t})=>t["ease-out-power-2"]};
67    will-change: background-color;
68  }
69
70  /* -- Hover & Active states ----------------------------------------------------------- */
71  button:hover:enabled,
72  button:focus-visible:enabled,
73  button:active:enabled {
74    box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.2);
75
76    wui-flex.balance-container {
77      background: ${({tokens:t})=>t.theme.foregroundTertiary};
78    }
79  }
80
81  /* -- Disabled states --------------------------------------------------- */
82  button:disabled wui-text,
83  button:disabled wui-flex.avatar-container {
84    opacity: 0.3;
85  }
86`;var re=function(t,e,i,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};let K=class extends f{constructor(){super(...arguments),this.networkSrc=void 0,this.avatarSrc=void 0,this.balance=void 0,this.isUnsupportedChain=void 0,this.disabled=!1,this.loading=!1,this.address="",this.profileName="",this.charsStart=4,this.charsEnd=6}render(){return l`
87      <button
88        ?disabled=${this.disabled}
89        class=${w(this.balance?void 0:"local-no-balance")}
90        data-error=${w(this.isUnsupportedChain)}
91      >
92        ${this.imageTemplate()} ${this.addressTemplate()} ${this.balanceTemplate()}
93      </button>
94    `}imageTemplate(){const e=this.networkSrc?l`<wui-image src=${this.networkSrc}></wui-image>`:l` <wui-icon size="inherit" color="inherit" name="networkPlaceholder"></wui-icon> `;return l`<wui-flex class="avatar-container">
95      <wui-avatar
96        .imageSrc=${this.avatarSrc}
97        alt=${this.address}
98        address=${this.address}
99      ></wui-avatar>
100
101      <wui-flex class="network-image-container">${e}</wui-flex>
102    </wui-flex>`}addressTemplate(){return l`<wui-text variant="md-regular" color="inherit">
103      ${this.address?F.getTruncateString({string:this.profileName||this.address,charsStart:this.profileName?18:this.charsStart,charsEnd:this.profileName?0:this.charsEnd,truncate:this.profileName?"end":"middle"}):null}
104    </wui-text>`}balanceTemplate(){if(this.balance){const e=this.loading?l`<wui-loading-spinner size="md" color="inherit"></wui-loading-spinner>`:l`<wui-text variant="md-regular" color="inherit"> ${this.balance}</wui-text>`;return l`<wui-flex alignItems="center" justifyContent="center" class="balance-container"
105        >${e}</wui-flex
106      >`}return null}};K.styles=[_,W,nn];re([c()],K.prototype,"networkSrc",void 0);re([c()],K.prototype,"avatarSrc",void 0);re([c()],K.prototype,"balance",void 0);re([c({type:Boolean})],K.prototype,"isUnsupportedChain",void 0);re([c({type:Boolean})],K.prototype,"disabled",void 0);re([c({type:Boolean})],K.prototype,"loading",void 0);re([c()],K.prototype,"address",void 0);re([c()],K.prototype,"profileName",void 0);re([c()],K.prototype,"charsStart",void 0);re([c()],K.prototype,"charsEnd",void 0);K=re([p("wui-account-button")],K);
106var U=function(t,e,i,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};class z extends f{constructor(){super(...arguments),this.unsubscribe=[],this.disabled=!1,this.balance="show",this.charsStart=4,this.charsEnd=6,this.namespace=void 0,this.isSupported=m.state.allowUnsupportedChain?!0:d.state.activeChain?d.checkIfSupportedNetwork(d.state.activeChain):!0}connectedCallback(){super.connectedCallback(),this.setAccountData(d.getAccountData(this.namespace)),this.setNetworkData(d.getNetworkData(this.namespace))}firstUpdated(){const e=this.namespace;e?this.unsubscribe.push(d.subscribeChainProp("accountState",i=>{this.setAccountData(i)},e),d.subscribeChainProp("networkState",i=>{var o;this.setNetworkData(i),this.isSupported=d.checkIfSupportedNetwork(e,(o=i==null?void 0:i.caipNetwork)==null?void 0:o.caipNetworkId)},e)):this.unsubscribe.push(Ee.subscribeNetworkImages(()=>{this.networkImage=S.getNetworkImage(this.network)}),d.subscribeKey("activeCaipAddress",i=>{this.caipAddress=i}),d.subscribeChainProp("accountState",i=>{this.setAccountData(i)}),d.subscribeKey("activeCaipNetwork",i=>{this.network=i,this.networkImage=S.getNetworkImage(i),this.isSupported=i!=null&&i.chainNamespace?d.checkIfSupportedNetwork(i==null?void 0:i.chainNamespace):!0,this.fetchNetworkImage(i)}))}updated(){this.fetchNetworkImage(this.network)}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){if(!d.state.activeChain)return null;const e=this.balance==="show",i=typeof this.balanceVal!="string",{formattedText:o}=y.parseBalance(this.balanceVal,this.balanceSymbol);return l`
107      <wui-account-button
108        .disabled=${!!this.disabled}
109        .isUnsupportedChain=${m.state.allowUnsupportedChain?!1:!this.isSupported}
110        address=${w(y.getPlainAddress(this.caipAddress))}
111        profileName=${w(this.profileName)}
112        networkSrc=${w(this.networkImage)}
113        avatarSrc=${w(this.profileImage)}
114        balance=${e?o:""}
115        @click=${this.onClick.bind(this)}
116        data-testid=${`account-button${this.namespace?`-${this.namespace}`:""}`}
117        .charsStart=${this.charsStart}
118        .charsEnd=${this.charsEnd}
119        ?loading=${i}
120      >
121      </wui-account-button>
122    `}onClick(){this.isSupported||m.state.allowUnsupportedChain?P.open({namespace:this.namespace}):P.open({view:"UnsupportedChain"})}async fetchNetworkImage(e){var i,o;(i=e==null?void 0:e.assets)!=null&&i.imageId&&(this.networkImage=await S.fetchNetworkImage((o=e==null?void 0:e.assets)==null?void 0:o.imageId))}setAccountData(e){e&&(this.caipAddress=e.caipAddress,this.balanceVal=e.balance,this.balanceSymbol=e.balanceSymbol,this.profileName=e.profileName,this.profileImage=e.profileImage)}setNetworkData(e){e&&(this.network=e.caipNetwork,this.networkImage=S.getNetworkImage(e.caipNetwork))}}U([c({type:Boolean})],z.prototype,"disabled",void 0);U([c()],z.prototype,"balance",void 0);U([c()],z.prototype,"charsStart",void 0);U([c()],z.prototype,"charsEnd",void 0);U([c()],z.prototype,"namespace",void 0);U([u()],z.prototype,"caipAddress",void 0);U([u()],z.prototype,"balanceVal",void 0);U([u()],z.prototype,"balanceSymbol",void 0);U([u()],z.prototype,"profileName",void 0);U([u()],z.prototype,"profileImage",void 0);U([u()],z.prototype,"network",void 0);U([u()],z.prototype,"networkImage",void 0);U([u()],z.prototype,"isSupported",void 0);let ci=class extends z{};ci=U([p("w3m-account-button")],ci);let di=class extends z{};di=U([p("appkit-account-button")],di);const on=ee`
123  :host {
124    display: block;
125    width: max-content;
126  }
127`;var se=function(t,e,i,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};class te extends f{constructor(){super(...arguments),this.unsubscribe=[],this.disabled=!1,this.balance=void 0,this.size=void 0,this.label=void 0,this.loadingLabel=void 0,this.charsStart=4,this.charsEnd=6,this.namespace=void 0}firstUpdated(){var e;
127this.caipAddress=this.namespace?(e=d.getAccountData(this.namespace))==null?void 0:e.caipAddress:d.state.activeCaipAddress,this.namespace?this.unsubscribe.push(d.subscribeChainProp("accountState",i=>{this.caipAddress=i==null?void 0:i.caipAddress},this.namespace)):this.unsubscribe.push(d.subscribeKey("activeCaipAddress",i=>this.caipAddress=i))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return this.caipAddress?l`
128          <appkit-account-button
129            .disabled=${!!this.disabled}
130            balance=${w(this.balance)}
131            .charsStart=${w(this.charsStart)}
132            .charsEnd=${w(this.charsEnd)}
133            namespace=${w(this.namespace)}
134          >
135          </appkit-account-button>
136        `:l`
137          <appkit-connect-button
138            size=${w(this.size)}
139            label=${w(this.label)}
140            loadingLabel=${w(this.loadingLabel)}
141            namespace=${w(this.namespace)}
142          ></appkit-connect-button>
143        `}}te.styles=on;se([c({type:Boolean})],te.prototype,"disabled",void 0);se([c()],te.prototype,"balance",void 0);se([c()],te.prototype,"size",void 0);se([c()],te.prototype,"label",void 0);se([c()],te.prototype,"loadingLabel",void 0);se([c()],te.prototype,"charsStart",void 0);se([c()],te.prototype,"charsEnd",void 0);se([c()],te.prototype,"namespace",void 0);se([u()],te.prototype,"caipAddress",void 0);let ui=class extends te{};ui=se([p("w3m-button")],ui);let hi=class extends te{};hi=se([p("appkit-button")],hi);const rn=v`
144  :host {
145    position: relative;
146    display: block;
147  }
148
149  button {
150    border-radius: ${({borderRadius:t})=>t[2]};
151  }
152
153  button[data-size='sm'] {
154    padding: ${({spacing:t})=>t[2]};
155  }
156
157  button[data-size='md'] {
158    padding: ${({spacing:t})=>t[3]};
159  }
160
161  button[data-size='lg'] {
162    padding: ${({spacing:t})=>t[4]};
163  }
164
165  button[data-variant='primary'] {
166    background: ${({tokens:t})=>t.core.backgroundAccentPrimary};
167  }
168
169  button[data-variant='secondary'] {
170    background: ${({tokens:t})=>t.core.foregroundAccent010};
171  }
172
173  button:hover:enabled {
174    border-radius: ${({borderRadius:t})=>t[3]};
175  }
176
177  button:disabled {
178    cursor: not-allowed;
179  }
180
181  button[data-loading='true'] {
182    cursor: not-allowed;
183  }
184
185  button[data-loading='true'][data-size='sm'] {
186    border-radius: ${({borderRadius:t})=>t[32]};
187    padding: ${({spacing:t})=>t[2]} ${({spacing:t})=>t[3]};
188  }
189
190  button[data-loading='true'][data-size='md'] {
191    border-radius: ${({borderRadius:t})=>t[20]};
192    padding: ${({spacing:t})=>t[3]} ${({spacing:t})=>t[4]};
193  }
194
195  button[data-loading='true'][data-size='lg'] {
196    border-radius: ${({borderRadius:t})=>t[16]};
197    padding: ${({spacing:t})=>t[4]} ${({spacing:t})=>t[5]};
198  }
199`;var st=function(t,e,i,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};let ke=class extends f{constructor(){super(...arguments),this.size="md",this.variant="primary",this.loading=!1,this.text="Connect Wallet"}render(){return l`
200      <button
201        data-loading=${this.loading}
202        data-variant=${this.variant}
203        data-size=${this.size}
204        ?disabled=${this.loading}
205      >
206        ${this.contentTemplate()}
207      </button>
208    `}contentTemplate(){const e={lg:"lg-regular",md:"md-regular",sm:"sm-regular"},i={primary:"invert",secondary:"accent-primary"};return this.loading?l`<wui-loading-spinner
209      color=${i[this.variant]}
210      size=${this.size}
211    ></wui-loading-spinner>`:l` <wui-text variant=${e[this.size]} color=${i[this.variant]}>
212        ${this.text}
213      </wui-text>`}};ke.styles=[_,W,rn];st([c()],ke.prototype,"size",void 0);st([c()],ke.prototype,"variant",void 0);st([c({type:Boolean})],ke.prototype,"loading",void 0);st([c()],ke.prototype,"text",void 0);ke=st([p("wui-connect-button")],ke);var ve=function(t,e,i,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;
213a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};class $e extends f{constructor(){super(),this.unsubscribe=[],this.size="md",this.label="Connect Wallet",this.loadingLabel="Connecting...",this.open=P.state.open,this.loading=this.namespace?P.state.loadingNamespaceMap.get(this.namespace):P.state.loading,this.unsubscribe.push(P.subscribe(e=>{this.open=e.open,this.loading=this.namespace?e.loadingNamespaceMap.get(this.namespace):e.loading}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return l`
214      <wui-connect-button
215        size=${w(this.size)}
216        .loading=${this.loading}
217        @click=${this.onClick.bind(this)}
218        data-testid=${`connect-button${this.namespace?`-${this.namespace}`:""}`}
219      >
220        ${this.loading?this.loadingLabel:this.label}
221      </wui-connect-button>
222    `}onClick(){this.open?P.close():this.loading||P.open({view:"Connect",namespace:this.namespace})}}ve([c()],$e.prototype,"size",void 0);ve([c()],$e.prototype,"label",void 0);ve([c()],$e.prototype,"loadingLabel",void 0);ve([c()],$e.prototype,"namespace",void 0);ve([u()],$e.prototype,"open",void 0);ve([u()],$e.prototype,"loading",void 0);let pi=class extends $e{};pi=ve([p("w3m-connect-button")],pi);let wi=class extends $e{};wi=ve([p("appkit-connect-button")],wi);const sn=v`
223  :host {
224    display: block;
225  }
226
227  button {
228    border-radius: ${({borderRadius:t})=>t[32]};
229    display: flex;
230    gap: ${({spacing:t})=>t[1]};
231    padding: ${({spacing:t})=>t[1]} ${({spacing:t})=>t[2]}
232      ${({spacing:t})=>t[1]} ${({spacing:t})=>t[1]};
233    background-color: ${({tokens:t})=>t.theme.foregroundPrimary};
234  }
235
236  button:disabled {
237    opacity: 0.5;
238    cursor: not-allowed;
239  }
240
241  @media (hover: hover) {
242    button:hover:enabled {
243      background-color: ${({tokens:t})=>t.theme.foregroundSecondary};
244    }
245  }
246
247  button[data-size='sm'] > wui-icon-box,
248  button[data-size='sm'] > wui-image {
249    width: 16px;
250    height: 16px;
251  }
252
253  button[data-size='md'] > wui-icon-box,
254  button[data-size='md'] > wui-image {
255    width: 20px;
256    height: 20px;
257  }
258
259  button[data-size='lg'] > wui-icon-box,
260  button[data-size='lg'] > wui-image {
261    width: 24px;
262    height: 24px;
263  }
264
265  wui-image,
266  wui-icon-box {
267    border-radius: ${({borderRadius:t})=>t[32]};
268  }
269`;var at=function(t,e,i,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};let Ae=class extends f{constructor(){super(...arguments),this.imageSrc=void 0,this.isUnsupportedChain=void 0,this.disabled=!1,this.size="lg"}render(){const e={sm:"sm-regular",md:"md-regular",lg:"lg-regular"};return l`
270      <button data-size=${this.size} data-testid="wui-network-button" ?disabled=${this.disabled}>
271        ${this.visualTemplate()}
272        <wui-text variant=${e[this.size]} color="primary">
273          <slot></slot>
274        </wui-text>
275      </button>
276    `}visualTemplate(){return this.isUnsupportedChain?l` <wui-icon-box color="error" icon="warningCircle"></wui-icon-box> `:this.imageSrc?l`<wui-image src=${this.imageSrc}></wui-image>`:l` <wui-icon size="xl" color="default" name="networkPlaceholder"></wui-icon> `}};Ae.styles=[_,W,sn];at([c()],Ae.prototype,"imageSrc",void 0);at([c({type:Boolean})],Ae.prototype,"isUnsupportedChain",void 0);at([c({type:Boolean})],Ae.prototype,"disabled",void 0);at([c()],Ae.prototype,"size",void 0);Ae=at([p("wui-network-button")],Ae);const an=ee`
277  :host {
278    display: block;
279    width: max-content;
280  }
281`;var fe=function(t,e,i,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};class de extends f{constructor(){super(),this.unsubscribe=[],this.disabled=!1,this.network=d.state.activeCaipNetwork,this.networkImage=S.getNetworkImage(this.network),this.caipAddress=d.state.activeCaipAddress,this.loading=P.state.loading,this.isSupported=m.state.allowUnsupportedChain?!0:d.state.activeChain?d.checkIfSupportedNetwork(d.state.activeChain):!0,this.unsubscribe.push(Ee.subscribeNetworkImages(()=>{this.networkImage=S.getNetworkImage(this.network)}),d.subscribeKey("activeCaipAddress",e=>{this.caipAddress=e}),d.subscribeKey("activeCaipNetwork",e=>{var i;this.network=e,this.networkImage=S.getNetworkImage(e),this.isSupported=e!=null&&e.chainNamespace?d.checkIfSupportedNetwork(e.chainNamespace):!0,S.fetchNetworkImage((i=e==null?void 0:e.assets)==null?void 0:i.imageId)}),P.subscribeKey("loading",e=>this.loading=e))}firstUpdated(){var e,i;S.fetchNetworkImage((i=(e=this.network)==null?void 0:e.assets)==null?void 0:i.imageId)}
281disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const e=this.network?d.checkIfSupportedNetwork(this.network.chainNamespace):!0;return l`
282      <wui-network-button
283        .disabled=${!!(this.disabled||this.loading)}
284        .isUnsupportedChain=${m.state.allowUnsupportedChain?!1:!e}
285        imageSrc=${w(this.networkImage)}
286        @click=${this.onClick.bind(this)}
287        data-testid="w3m-network-button"
288      >
289        ${this.getLabel()}
290        <slot></slot>
291      </wui-network-button>
292    `}getLabel(){return this.network?!this.isSupported&&!m.state.allowUnsupportedChain?"Switch Network":this.network.name:this.label?this.label:this.caipAddress?"Unknown Network":"Select Network"}onClick(){this.loading||(C.sendEvent({type:"track",event:"CLICK_NETWORKS"}),P.open({view:"Networks"}))}}de.styles=an;fe([c({type:Boolean})],de.prototype,"disabled",void 0);fe([c({type:String})],de.prototype,"label",void 0);fe([u()],de.prototype,"network",void 0);fe([u()],de.prototype,"networkImage",void 0);fe([u()],de.prototype,"caipAddress",void 0);fe([u()],de.prototype,"loading",void 0);fe([u()],de.prototype,"isSupported",void 0);let fi=class extends de{};fi=fe([p("w3m-network-button")],fi);let mi=class extends de{};mi=fe([p("appkit-network-button")],mi);const ln=v`
293  :host {
294    display: block;
295  }
296
297  button {
298    width: 100%;
299    display: flex;
300    align-items: center;
301    justify-content: space-between;
302    gap: ${({spacing:t})=>t[4]};
303    padding: ${({spacing:t})=>t[3]};
304    border-radius: ${({borderRadius:t})=>t[4]};
305    background-color: ${({tokens:t})=>t.core.foregroundAccent010};
306  }
307
308  wui-flex > wui-icon {
309    padding: ${({spacing:t})=>t[2]};
310    color: ${({tokens:t})=>t.theme.textInvert};
311    background-color: ${({tokens:t})=>t.core.backgroundAccentPrimary};
312    border-radius: ${({borderRadius:t})=>t[2]};
313    align-items: center;
314  }
315
316  @media (hover: hover) {
317    button:hover:enabled {
318      background-color: ${({tokens:t})=>t.core.foregroundAccent020};
319    }
320  }
321`;var Tt=function(t,e,i,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};let Me=class extends f{constructor(){super(...arguments),this.label="",this.description="",this.icon="wallet"}render(){return l`
322      <button>
323        <wui-flex gap="2" alignItems="center">
324          <wui-icon weight="fill" size="lg" name=${this.icon} color="inherit"></wui-icon>
325          <wui-flex flexDirection="column" gap="1">
326            <wui-text variant="md-medium" color="primary">${this.label}</wui-text>
327            <wui-text variant="md-regular" color="tertiary">${this.description}</wui-text>
328          </wui-flex>
329        </wui-flex>
330        <wui-icon size="lg" color="accent-primary" name="chevronRight"></wui-icon>
331      </button>
332    `}};Me.styles=[_,W,ln];Tt([c()],Me.prototype,"label",void 0);Tt([c()],Me.prototype,"description",void 0);Tt([c()],Me.prototype,"icon",void 0);Me=Tt([p("wui-notice-card")],Me);var Ri=function(t,e,i,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};let Ut=class extends f{constructor(){super(),this.unsubscribe=[],this.socialProvider=me.getConnectedSocialProvider(),this.socialUsername=me.getConnectedSocialUsername(),this.namespace=d.state.activeChain,this.unsubscribe.push(d.subscribeKey("activeChain",e=>{this.namespace=e}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const e=b.getConnectorId(this.namespace),i=b.getAuthConnector();if(!i||e!==E.CONNECTOR_ID.AUTH)return this.style.cssText="display: none",null;const o=i.provider.getEmail()??"";return!o&&!this.socialUsername?(this.style.cssText="display: none",null):l`
333      <wui-list-item
334        ?rounded=${!0}
335        icon=${this.socialProvider??"mail"}
336        data-testid="w3m-account-email-update"
337        ?chevron=${!this.socialProvider}
338        @click=${()=>{this.onGoToUpdateEmail(o,this.socialProvider)}}
339      >
340        <wui-text variant="lg-regular" color="primary">${this.getAuthName(o)}</wui-text>
341      </wui-list-item>
342    `}onGoToUpdateEmail(e,i){i||h.push("UpdateEmailWallet",{email:e,redirectView:"Account"})}getAuthName(e){return this.socialUsername?this.socialProvider==="discord"&&this.socialUsername.endsWith("0")?this.socialUsername.slice(0,-1):this.socialUsername:e.length>30?`${e.slice(0,-3)}...`:e}};Ri([u()],Ut.prototype,"namespace",void 0);Ut=Ri([p("w3m-account-auth-button")],Ut);
342var je=function(t,e,i,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};let be=class extends f{constructor(){var e,i,o;super(),this.usubscribe=[],this.networkImages=Ee.state.networkImages,this.address=(e=d.getAccountData())==null?void 0:e.address,this.profileImage=(i=d.getAccountData())==null?void 0:i.profileImage,this.profileName=(o=d.getAccountData())==null?void 0:o.profileName,this.network=d.state.activeCaipNetwork,this.disconnecting=!1,this.remoteFeatures=m.state.remoteFeatures,this.usubscribe.push(d.subscribeChainProp("accountState",r=>{r&&(this.address=r.address,this.profileImage=r.profileImage,this.profileName=r.profileName)}),d.subscribeKey("activeCaipNetwork",r=>{r!=null&&r.id&&(this.network=r)}),m.subscribeKey("remoteFeatures",r=>{this.remoteFeatures=r}))}disconnectedCallback(){this.usubscribe.forEach(e=>e())}render(){var i,o,r;if(!this.address)throw new Error("w3m-account-settings-view: No account provided");const e=this.networkImages[((o=(i=this.network)==null?void 0:i.assets)==null?void 0:o.imageId)??""];return l`
343      <wui-flex
344        flexDirection="column"
345        alignItems="center"
346        gap="4"
347        .padding=${["0","5","3","5"]}
348      >
349        <wui-avatar
350          alt=${this.address}
351          address=${this.address}
352          imageSrc=${w(this.profileImage)}
353          size="lg"
354        ></wui-avatar>
355        <wui-flex flexDirection="column" alignItems="center">
356          <wui-flex gap="1" alignItems="center" justifyContent="center">
357            <wui-text variant="h5-medium" color="primary" data-testid="account-settings-address">
358              ${F.getTruncateString({string:this.address,charsStart:4,charsEnd:6,truncate:"middle"})}
359            </wui-text>
360            <wui-icon-link
361              size="md"
362              icon="copy"
363              iconColor="default"
364              @click=${this.onCopyAddress}
365            ></wui-icon-link>
366          </wui-flex>
367        </wui-flex>
368      </wui-flex>
369      <wui-flex flexDirection="column" gap="4">
370        <wui-flex flexDirection="column" gap="2" .padding=${["6","4","3","4"]}>
371          ${this.authCardTemplate()}
372          <w3m-account-auth-button></w3m-account-auth-button>
373          <wui-list-item
374            imageSrc=${w(e)}
375            ?chevron=${this.isAllowedNetworkSwitch()}
376            ?fullSize=${!0}
377            ?rounded=${!0}
378            @click=${this.onNetworks.bind(this)}
379            data-testid="account-switch-network-button"
380          >
381            <wui-text variant="lg-regular" color="primary">
382              ${((r=this.network)==null?void 0:r.name)??"Unknown"}
383            </wui-text>
384          </wui-list-item>
385          ${this.smartAccountSettingsTemplate()} ${this.chooseNameButtonTemplate()}
386          <wui-list-item
387            ?rounded=${!0}
388            icon="power"
389            iconColor="error"
390            ?chevron=${!1}
391            .loading=${this.disconnecting}
392            @click=${this.onDisconnect.bind(this)}
393            data-testid="disconnect-button"
394          >
395            <wui-text variant="lg-regular" color="primary">Disconnect</wui-text>
396          </wui-list-item>
397        </wui-flex>
398      </wui-flex>
399    `}chooseNameButtonTemplate(){var n;const e=(n=this.network)==null?void 0:n.chainNamespace,i=b.getConnectorId(e),o=b.getAuthConnector();return!d.checkIfNamesSupported()||!o||i!==E.CONNECTOR_ID.AUTH||this.profileName?null:l`
400      <wui-list-item
401        icon="id"
402        ?rounded=${!0}
403        ?chevron=${!0}
404        @click=${this.onChooseName.bind(this)}
405        data-testid="account-choose-name-button"
406      >
407        <wui-text variant="lg-regular" color="primary">Choose account name </wui-text>
408      </wui-list-item>
409    `}authCardTemplate(){var r;const e=b.getConnectorId((r=this.network)==null?void 0:r.chainNamespace),i=b.getAuthConnector(),{origin:o}=location;return!i||e!==E.CONNECTOR_ID.AUTH||o.includes(D.SECURE_SITE)?null:l`
410      <wui-notice-card
411        @click=${this.onGoToUpgradeView.bind(this)}
412        label="Upgrade your wallet"
413        description="Transition to a self-custodial wallet"
414        icon="wallet"
415        data-testid="w3m-wallet-upgrade-card"
416      ></wui-notice-card>
417    `}isAllowedNetworkSwitch(){const e=d.getAllRequestedCaipNetworks(),i=e?e.length>1:!1,o=e==null?void 0:e.find(({id:r})=>{var n;return r===((n=this.network)==null?void 0:n.id)});return i||!o}onCopyAddress(){try{this.address&&(y.copyToClopboard(this.address),A.showSuccess("Address copied"))}catch{A.showError("Failed to copy")}}smartAccountSettingsTemplate(){var n;const e=(n=this.network)==null?void 0:n.chainNamespace,i=d.checkIfSmartAccountEnabled(),o=b.getConnectorId(e);return!b.getAuthConnector()||o!==E.CONNECTOR_ID.AUTH||!i?null:l`
418      <wui-list-item
419        icon="user"
420        ?rounded=${!0}
421        ?chevron=${!0}
422        @click=${this.onSmartAccountSettings.bind(this)}
423        data-testid="account-smart-account-settings-button"
424      >
425        <wui-text variant="lg-regular" color="primary">Smart Account Settings</wui-text>
426      </wui-list-item>
427    `}onChooseName(){h.push("ChooseAccountName")}onNetworks(){this.isAllowedNetworkSwitch()&&h.push("Networks")}async onDisconnect(){var e,i;try{this.disconnecting=!0;const o=(e=this.network)==null?void 0:e.chainNamespace,n=x.getConnections(o).length>0,s=o&&b.state.activeConnectorIds[o],a=(i=this.remoteFeatures)==null?void 0:i.multiWallet;await x.disconnect(a?{id:s,namespace:o}:{}),n&&a&&(h.push("ProfileWallets"),A.showSuccess("Wallet deleted"))}catch{C.sendEvent({type:"track",event:"DISCONNECT_ERROR",properties:{message:"Failed to disconnect"}}),A.showError("Failed to disconnect")}finally{this.disconnecting=!1}}onGoToUpgradeView(){C.sendEvent({type:"track",event:"EMAIL_UPGRADE_FROM_MODAL"}),h.push("UpgradeEmailWallet")}onSmartAccountSettings(){h.push("SmartAccountSettings")}};je([u()],be.prototype,"address",void 0);je([u()],be.prototype,"profileImage",void 0);je([u()],be.prototype,"profileName",void 0);je([u()],be.prototype,"network",void 0);je([u()],be.prototype,"disconnecting",void 0);je([u()],be.prototype,"remoteFeatures",void 0);be=je([p("w3m-account-settings-view")],be);const cn=v`
428  :host {
429    flex: 1;
430    height: 100%;
431  }
432
433  button {
434    width: 100%;
435    height: 100%;
436    display: inline-flex;
437    align-items: center;
438    padding: ${({spacing:t})=>t[1]} ${({spacing:t})=>t[2]};
439    column-gap: ${({spacing:t})=>t[1]};
440    color: ${({tokens:t})=>t.theme.textSecondary};
441    border-radius: ${({borderRadius:t})=>t[20]};
442    background-color: transparent;
443    transition: background-color ${({durations:t})=>t.lg}
444      ${({easings:t})=>t["ease-out-power-2"]};
445    will-change: background-color;
446  }
447
448  /* -- Hover & Active states ----------------------------------------------------------- */
449  button[data-active='true'] {
450    color: ${({tokens:t})=>t.theme.textPrimary};
451    background-color: ${({tokens:t})=>t.theme.foregroundTertiary};
452  }
453
454  button:hover:enabled:not([data-active='true']),
455  button:active:enabled:not([data-active='true']) {
456    wui-text,
457    wui-icon {
458      color: ${({tokens:t})=>t.theme.textPrimary};
459    }
460  }
461`;
461var lt=function(t,e,i,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};const dn={lg:"lg-regular",md:"md-regular",sm:"sm-regular"},un={lg:"md",md:"sm",sm:"sm"};let Ie=class extends f{constructor(){super(...arguments),this.icon="mobile",this.size="md",this.label="",this.active=!1}render(){return l`
462      <button data-active=${this.active}>
463        ${this.icon?l`<wui-icon size=${un[this.size]} name=${this.icon}></wui-icon>`:""}
464        <wui-text variant=${dn[this.size]}> ${this.label} </wui-text>
465      </button>
466    `}};Ie.styles=[_,W,cn];lt([c()],Ie.prototype,"icon",void 0);lt([c()],Ie.prototype,"size",void 0);lt([c()],Ie.prototype,"label",void 0);lt([c({type:Boolean})],Ie.prototype,"active",void 0);Ie=lt([p("wui-tab-item")],Ie);const hn=v`
467  :host {
468    display: inline-flex;
469    align-items: center;
470    background-color: ${({tokens:t})=>t.theme.foregroundSecondary};
471    border-radius: ${({borderRadius:t})=>t[32]};
472    padding: ${({spacing:t})=>t["01"]};
473    box-sizing: border-box;
474  }
475
476  :host([data-size='sm']) {
477    height: 26px;
478  }
479
480  :host([data-size='md']) {
481    height: 36px;
482  }
483`;var ct=function(t,e,i,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};let _e=class extends f{constructor(){super(...arguments),this.tabs=[],this.onTabChange=()=>null,this.size="md",this.activeTab=0}render(){return this.dataset.size=this.size,this.tabs.map((e,i)=>{var r;const o=i===this.activeTab;return l`
484        <wui-tab-item
485          @click=${()=>this.onTabClick(i)}
486          icon=${e.icon}
487          size=${this.size}
488          label=${e.label}
489          ?active=${o}
490          data-active=${o}
491          data-testid="tab-${(r=e.label)==null?void 0:r.toLowerCase()}"
492        ></wui-tab-item>
493      `})}onTabClick(e){this.activeTab=e,this.onTabChange(e)}};_e.styles=[_,W,hn];ct([c({type:Array})],_e.prototype,"tabs",void 0);ct([c()],_e.prototype,"onTabChange",void 0);ct([c()],_e.prototype,"size",void 0);ct([u()],_e.prototype,"activeTab",void 0);_e=ct([p("wui-tabs")],_e);const pn=v`
494  wui-icon-link {
495    margin-right: calc(${({spacing:t})=>t[8]} * -1);
496  }
497
498  wui-notice-card {
499    margin-bottom: ${({spacing:t})=>t[1]};
500  }
501
502  wui-list-item > wui-text {
503    flex: 1;
504  }
505
506  w3m-transactions-view {
507    max-height: 200px;
508  }
509
510  .balance-container {
511    display: inline;
512  }
513
514  .tab-content-container {
515    height: 300px;
516    overflow-y: auto;
517    overflow-x: hidden;
518    scrollbar-width: none;
519  }
520
521  .symbol {
522    transform: translateY(-2px);
523  }
524
525  .tab-content-container::-webkit-scrollbar {
526    display: none;
527  }
528
529  .account-button {
530    width: auto;
531    border: none;
532    display: flex;
533    align-items: center;
534    justify-content: center;
535    gap: ${({spacing:t})=>t[3]};
536    height: 48px;
537    padding: ${({spacing:t})=>t[2]};
538    padding-right: ${({spacing:t})=>t[3]};
539    box-shadow: inset 0 0 0 1px ${({tokens:t})=>t.theme.foregroundPrimary};
540    background-color: ${({tokens:t})=>t.theme.foregroundPrimary};
541    border-radius: ${({borderRadius:t})=>t[6]};
542    transition: background-color ${({durations:t})=>t.lg}
543      ${({easings:t})=>t["ease-out-power-2"]};
544  }
545
546  .account-button:hover {
547    background-color: ${({tokens:t})=>t.core.glass010};
548  }
549
550  .avatar-container {
551    position: relative;
552  }
553
554  wui-avatar.avatar {
555    width: 32px;
556    height: 32px;
557    box-shadow: 0 0 0 2px ${({tokens:t})=>t.core.glass010};
558  }
559
560  wui-wallet-switch {
561    margin-top: ${({spacing:t})=>t[2]};
562  }
563
564  wui-avatar.network-avatar {
565    width: 16px;
566    height: 16px;
567    position: absolute;
568    left: 100%;
569    top: 100%;
570    transform: translate(-75%, -75%);
571    box-shadow: 0 0 0 2px ${({tokens:t})=>t.core.glass010};
572  }
573
574  .account-links {
575    display: flex;
576    justify-content: space-between;
577    align-items: center;
578  }
579
580  .account-links wui-flex {
581    cursor: pointer;
582    display: flex;
583    align-items: center;
584    justify-content: center;
585    flex: 1;
586    background: red;
587    align-items: center;
588    justify-content: center;
589    height: 48px;
590    padding: 10px;
591    flex: 1 0 0;
592    border-radius: var(--XS, 16px);
593    border: 1px solid var(--dark-accent-glass-010, rgba(71, 161, 255, 0.1));
594    background: var(--dark-accent-glass-010, rgba(71, 161, 255, 0.1));
595    transition:
596      background-color ${({durations:t})=>t.md}
597        ${({easings:t})=>t["ease-out-power-1"]},
598      opacity ${({durations:t})=>t.md} ${({easings:t})=>t["ease-out-power-1"]};
599    will-change: background-color, opacity;
600  }
601
602  .account-links wui-flex:hover {
603    background: var(--dark-accent-glass-015, rgba(71, 161, 255, 0.15));
604  }
605
606  .account-links wui-flex wui-icon {
607    width: var(--S, 20px);
608    height: var(--S, 20px);
609  }
610
611  .account-links wui-flex wui-icon svg path {
612    stroke: #667dff;
613  }
614`;var ie=function(t,e,i,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};let M=class extends f{constructor(){var e,i,o,r,n,s;super(),this.unsubscribe=[],this.caipAddress=(e=d.getAccountData())==null?void 0:e.caipAddress,this.address=y.getPlainAddress((i=d.getAccountData())==null?void 0:i.caipAddress),this.profileImage=(o=d.getAccountData())==null?void 0:o.profileImage,this.profileName=(r=d.getAccountData())==null?void 0:r.profileName,this.disconnecting=!1,this.balance=(n=d.getAccountData())==null?void 0:n.balance,this.balanceSymbol=(s=d.getAccountData())==null?void 0:s.balanceSymbol,this.features=m.state.features,this.remoteFeatures=m.state.remoteFeatures,this.namespace=d.state.activeChain,this.activeConnectorIds=b.state.activeConnectorIds,this.unsubscribe.push(d.subscribeChainProp("accountState",a=>{this.address=y.getPlainAddress(a==null?void 0:a.caipAddress),this.caipAddress=a==null?void 0:a.caipAddress,this.balance=a==null?void 0:a.balance,this.balanceSymbol=a==null?void 0:a.balanceSymbol,this.profileName=a==null?void 0:a.profileName,this.profileImage=a==null?void 0:a.profileImage}),m.subscribeKey("features",a=>this.features=a),m.subscribeKey("remoteFeatures",a=>this.remoteFeatures=a),b.subscribeKey("activeConnectorIds",a=>{this.activeConnectorIds=a}),d.subscribeKey("activeChain",a=>this.namespace=a),d.subscribeKey("activeCaipNetwork",a=>{a!=null&&a.chainNamespace&&(this.namespace=a==null?void 0:a.chainNamespace)}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){if(!this.caipAddress||!this.namespace)return null;const e=this.activeConnectorIds[this.namespace],i=e?b.getConnectorById(e):void 0,o=S.getConnectorImage(i),{value:r,decimals:n,symbol:s}=y.parseBalance(this.balance,this.balanceSymbol);return l`<wui-flex
615        flexDirection="column"
616        .padding=${["0","5","4","5"]}
617        alignItems="center"
618        gap="3"
619      >
620        <wui-avatar
621          alt=${w(this.caipAddress)}
622          address=${w(y.getPlainAddress(this.caipAddress))}
623          imageSrc=${w(this.profileImage===null?void 0:this.profileImage)}
624          data-testid="single-account-avatar"
625        ></wui-avatar>
626        <wui-wallet-switch
627          profileName=${this.profileName}
628          address=${this.address}
629          imageSrc=${o}
630          alt=${i==null?void 0:i.name}
631          @click=${this.onGoToProfileWalletsView.bind(this)}
632          data-testid="wui-wallet-switch"
633        ></wui-wallet-switch>
634        <div class="balance-container">
635          <wui-text variant="h3-regular" color="primary">${r}</wui-text>
636          <wui-text variant="h3-regular" color="secondary">.${n}</wui-text>
637          <wui-text variant="h6-medium" color="primary" class="symbol">${s}</wui-text>
638        </div>
639        ${this.explorerBtnTemplate()}
640      </wui-flex>
641
642      <wui-flex flexDirection="column" gap="2" .padding=${["0","3","3","3"]}>
643        ${this.authCardTemplate()} <w3m-account-auth-button></w3m-account-auth-button>
644        ${this.orderedFeaturesTemplate()} ${this.activityTemplate()}
645        <wui-list-item
646          .rounded=${!0}
647          icon="power"
648          iconColor="error"
649          ?chevron=${!1}
650          .loading=${this.disconnecting}
651          .rightIcon=${!1}
652          @click=${this.onDisconnect.bind(this)}
653          data-testid="disconnect-button"
654        >
655          <wui-text variant="lg-regular" color="primary">Disconnect</wui-text>
656        </wui-list-item>
657      </wui-flex>`}fundWalletTemplate(){var n,s;if(!this.namespace)return null;const e=D.ONRAMP_SUPPORTED_CHAIN_NAMESPACES.includes(this.namespace),i=!!((n=this.features)!=null&&n.receive),o=((s=this.remoteFeatures)==null?void 0:s.onramp)&&e,r=Q.isPayWithExchangeEnabled();return!o&&!i&&!r?null:l`
658      <wui-list-item
659        .rounded=${!0}
660        data-testid="w3m-account-default-fund-wallet-button"
661        iconVariant="blue"
662        icon="dollar"
663        ?chevron=${!0}
664        @click=${this.handleClickFundWallet.bind(this)}
665      >
666        <wui-text variant="lg-regular" color="primary">Fund wallet</wui-text>
667      </wui-list-item>
668    `}orderedFeaturesTemplate(){var i;return(((i=this.features)==null?void 0:i.walletFeaturesOrder)||D.DEFAULT_FEATURES.walletFeaturesOrder).map(o=>{switch(o){case"onramp":return this.fundWalletTemplate();case"swaps":return this.swapsTemplate();case"send":return this.sendTemplate();default:return null}})}activityTemplate(){var i;return this.namespace&&((i=this.remoteFeatures)==null?void 0:i.activity)&&D.ACTIVITY_ENABLED_CHAIN_NAMESPACES.includes(this.namespace)?l` <wui-list-item
669          .rounded=${!0}
670          icon="clock"
671          ?chevron=${!0}
672          @click=${this.onTransactions.bind(this)}
673          data-testid="w3m-account-default-activity-button"
674        >
675          <wui-text variant="lg-regular" color="primary">Activity</wui-text>
676        </wui-list-item>`:null}swapsTemplate(){var o;const e=(o=this.remoteFeatures)==null?void 0:o.swaps,i=d.state.activeChain===E.CHAIN.EVM;return!e||!i?null:l`
677      <wui-list-item
678        .rounded=${!0}
679        icon="recycleHorizontal"
680        ?chevron=${!0}
681        @click=${this.handleClickSwap.bind(this)}
682        data-testid="w3m-account-default-swaps-button"
683      >
684        <wui-text variant="lg-regular" color="primary">Swap</wui-text>
685      </wui-list-item>
686    `}sendTemplate(){var r;const e=(r=this.features)==null?void 0:r.send,i=d.state.activeChain;if(!i)throw new Error("SendController:sendTemplate - namespace is required");const o=D.SEND_SUPPORTED_NAMESPACES.includes(i);return!e||!o?null:l`
687      <wui-list-item
688        .rounded=${!0}
689        icon="send"
690        ?chevron=${!0}
691        @click=${this.handleClickSend.bind(this)}
692        data-testid="w3m-account-default-send-button"
693      >
694        <wui-text variant="lg-regular" color="primary">Send</wui-text>
695      </wui-list-item>
696    `}authCardTemplate(){const e=d.state.activeChain;if(!e)throw new Error("AuthCardTemplate:authCardTemplate - namespace is required");const i=b.getConnectorId(e),o=b.getAuthConnector(),{origin:r}=location;return!o||i!==E.CONNECTOR_ID.AUTH||r.includes(D.SECURE_SITE)?null:l`
697      <wui-notice-card
698        @click=${this.onGoToUpgradeView.bind(this)}
699        label="Upgrade your wallet"
700        description="Transition to a self-custodial wallet"
701        icon="wallet"
702        data-testid="w3m-wallet-upgrade-card"
703      ></wui-notice-card>
704    `}handleClickFundWallet(){h.push("FundWallet")}handleClickSwap(){h.push("Swap")}handleClickSend(){h.push("WalletSend")}explorerBtnTemplate(){var i;return((i=d.getAccountData())==null?void 0:i.addressExplorerUrl)?l`
705      <wui-button size="md" variant="accent-primary" @click=${this.onExplorer.bind(this)}>
706        <wui-icon size="sm" color="inherit" slot="iconLeft" name="compass"></wui-icon>
707        Block Explorer
708        <wui-icon size="sm" color="inherit" slot="iconRight" name="externalLink"></wui-icon>
709      </wui-button>
710    `:null}onTransactions(){C.sendEvent({type:"track",event:"CLICK_TRANSACTIONS",properties:{isSmartAccount:ze(d.state.activeChain)===Fe.ACCOUNT_TYPES.SMART_ACCOUNT}}),h.push("Transactions")}async onDisconnect(){var e;try{this.disconnecting=!0;const o=x.getConnections(this.namespace).length>0,r=this.namespace&&b.state.activeConnectorIds[this.namespace],n=(e=this.remoteFeatures)==null?void 0:e.multiWallet;await x.disconnect(n?{id:r,namespace:this.namespace}:{}),o&&n&&(h.push("ProfileWallets"),A.showSuccess("Wallet deleted"))}catch{C.sendEvent({type:"track",event:"DISCONNECT_ERROR",properties:{message:"Failed to disconnect"}}),A.showError("Failed to disconnect")}finally{this.disconnecting=!1}}onExplorer(){var i;const e=(i=d.getAccountData())==null?void 0:i.addressExplorerUrl;e&&y.openHref(e,"_blank")}onGoToUpgradeView(){C.sendEvent({type:"track",event:"EMAIL_UPGRADE_FROM_MODAL"}),h.push("UpgradeEmailWallet")}onGoToProfileWalletsView(){h.push("ProfileWallets")}};M.styles=pn;ie([u()],M.prototype,"caipAddress",void 0);ie([u()],M.prototype,"address",void 0);ie([u()],M.prototype,"profileImage",void 0);ie([u()],M.prototype,"profileName",void 0);ie([u()],M.prototype,"disconnecting",void 0);ie([u()],M.prototype,"balance",void 0);ie([u()],M.prototype,"balanceSymbol",void 0);ie([u()],M.prototype,"features",void 0);ie([u()],M.prototype,"remoteFeatures",void 0);ie([u()],M.prototype,"namespace",void 0);ie([u()],M.prototype,"activeConnectorIds",void 0);M=ie([p("w3m-account-default-widget")],M);const wn=v`
711  span {
712    font-weight: 500;
713    font-size: 38px;
714    color: ${({tokens:t})=>t.theme.textPrimary};
715    line-height: 38px;
716    letter-spacing: -2%;
717    text-align: center;
718    font-family: var(--apkt-fontFamily-regular);
719  }
720
721  .pennies {
722    color: ${({tokens:t})=>t.theme.textSecondary};
723  }
724`;
724var ti=function(t,e,i,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};let it=class extends f{constructor(){super(...arguments),this.dollars="0",this.pennies="00"}render(){return l`<span>$${this.dollars}<span class="pennies">.${this.pennies}</span></span>`}};it.styles=[_,wn];ti([c()],it.prototype,"dollars",void 0);ti([c()],it.prototype,"pennies",void 0);it=ti([p("wui-balance")],it);const fn=v`
725  :host {
726    display: inline-flex;
727    justify-content: center;
728    align-items: center;
729    position: relative;
730  }
731
732  wui-icon {
733    position: absolute;
734    width: 12px !important;
735    height: 4px !important;
736  }
737
738  /* -- Variants --------------------------------------------------------- */
739  :host([data-variant='fill']) {
740    background-color: ${({colors:t})=>t.neutrals100};
741  }
742
743  :host([data-variant='shade']) {
744    background-color: ${({colors:t})=>t.neutrals900};
745  }
746
747  :host([data-variant='fill']) > wui-text {
748    color: ${({colors:t})=>t.black};
749  }
750
751  :host([data-variant='shade']) > wui-text {
752    color: ${({colors:t})=>t.white};
753  }
754
755  :host([data-variant='fill']) > wui-icon {
756    color: ${({colors:t})=>t.neutrals100};
757  }
758
759  :host([data-variant='shade']) > wui-icon {
760    color: ${({colors:t})=>t.neutrals900};
761  }
762
763  /* -- Sizes --------------------------------------------------------- */
764  :host([data-size='sm']) {
765    padding: ${({spacing:t})=>t[1]} ${({spacing:t})=>t[2]};
766    border-radius: ${({borderRadius:t})=>t[2]};
767  }
768
769  :host([data-size='md']) {
770    padding: ${({spacing:t})=>t[2]} ${({spacing:t})=>t[3]};
771    border-radius: ${({borderRadius:t})=>t[3]};
772  }
773
774  /* -- Placements --------------------------------------------------------- */
775  wui-icon[data-placement='top'] {
776    bottom: 0px;
777    left: 50%;
778    transform: translate(-50%, 95%);
779  }
780
781  wui-icon[data-placement='bottom'] {
782    top: 0;
783    left: 50%;
784    transform: translate(-50%, -95%) rotate(180deg);
785  }
786
787  wui-icon[data-placement='right'] {
788    top: 50%;
789    left: 0;
790    transform: translate(-65%, -50%) rotate(90deg);
791  }
792
793  wui-icon[data-placement='left'] {
794    top: 50%;
795    right: 0%;
796    transform: translate(65%, -50%) rotate(270deg);
797  }
798`;var dt=function(t,e,i,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};const mn={sm:"sm-regular",md:"md-regular"};let Re=class extends f{constructor(){super(...arguments),this.placement="top",this.variant="fill",this.size="md",this.message=""}render(){return this.dataset.variant=this.variant,this.dataset.size=this.size,l`<wui-icon data-placement=${this.placement} size="inherit" name="cursor"></wui-icon>
799      <wui-text variant=${mn[this.size]}>${this.message}</wui-text>`}};Re.styles=[_,W,fn];dt([c()],Re.prototype,"placement",void 0);dt([c()],Re.prototype,"variant",void 0);dt([c()],Re.prototype,"size",void 0);dt([c()],Re.prototype,"message",void 0);Re=dt([p("wui-tooltip")],Re);const bn=ee`
800  :host {
801    width: 100%;
802    max-height: 280px;
803    overflow: scroll;
804    scrollbar-width: none;
805  }
806
807  :host::-webkit-scrollbar {
808    display: none;
809  }
810`;var gn=function(t,e,i,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};let zt=class extends f{render(){return l`<w3m-activity-list page="account"></w3m-activity-list>`}};zt.styles=bn;zt=gn([p("w3m-account-activity-widget")],zt);const yn=v`
811  :host {
812    width: 100%;
813  }
814
815  button {
816    width: 100%;
817    display: flex;
818    justify-content: space-between;
819    align-items: center;
820    gap: ${({spacing:t})=>t[4]};
821    padding: ${({spacing:t})=>t[4]};
822    background-color: transparent;
823    border-radius: ${({borderRadius:t})=>t[4]};
824  }
825
826  wui-text {
827    max-width: 174px;
828  }
829
830  .tag-container {
831    width: fit-content;
832  }
833
834  @media (hover: hover) {
835    button:hover:enabled {
836      background-color: ${({tokens:t})=>t.theme.foregroundPrimary};
837    }
838  }
839`;var Xe=function(t,e,i,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};let ge=class extends f{constructor(){super(...arguments),this.icon="card",this.text="",this.description="",this.tag=void 0,this.disabled=!1}render(){return l`
840      <button ?disabled=${this.disabled}>
841        <wui-flex alignItems="center" gap="3">
842          <wui-icon-box padding="2" color="secondary" icon=${this.icon} size="lg"></wui-icon-box>
843          <wui-flex flexDirection="column" gap="1">
844            <wui-text variant="md-medium" color="primary">${this.text}</wui-text>
845            ${this.description?l`<wui-text variant="md-regular" color="secondary">
846                  ${this.description}</wui-text
847                >`:null}
848          </wui-flex>
849        </wui-flex>
850
851        <wui-flex class="tag-container" alignItems="center" gap="1" justifyContent="flex-end">
852          ${this.tag?l`<wui-tag tagType="main" size="sm">${this.tag}</wui-tag>`:null}
853          <wui-icon size="md" name="chevronRight" color="default"></wui-icon>
854        </wui-flex>
855      </button>
856    `}};ge.styles=[_,W,yn];Xe([c()],ge.prototype,"icon",void 0);Xe([c()],ge.prototype,"text",void 0);Xe([c()],ge.prototype,"description",void 0);Xe([c()],ge.prototype,"tag",void 0);Xe([c({type:Boolean})],ge.prototype,"disabled",void 0);ge=Xe([p("wui-list-description")],ge);const xn=ee`
857  :host {
858    width: 100%;
859  }
860
861  wui-flex {
862    width: 100%;
863  }
864
865  .contentContainer {
866    max-height: 280px;
867    overflow: scroll;
868    scrollbar-width: none;
869  }
870
871  .contentContainer::-webkit-scrollbar {
872    display: none;
873  }
874`;var ii=function(t,e,i,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};let nt=class extends f{constructor(){var e;super(),this.unsubscribe=[],this.tokenBalance=(e=d.getAccountData())==null?void 0:e.tokenBalance,this.remoteFeatures=m.state.remoteFeatures,this.unsubscribe.push(d.subscribeChainProp("accountState",i=>{this.tokenBalance=i==null?void 0:i.tokenBalance}),m.subscribeKey("remoteFeatures",i=>{this.remoteFeatures=i}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return l`${this.tokenTemplate()}`}tokenTemplate(){var e;return this.tokenBalance&&((e=this.tokenBalance)==null?void 0:e.length)>0?l`<wui-flex class="contentContainer" flexDirection="column" gap="2">
875        ${this.tokenItemTemplate()}
876      </wui-flex>`:l` <wui-flex flexDirection="column">
877      ${this.onRampTemplate()}
878      <wui-list-description
879        @click=${this.onReceiveClick.bind(this)}
880        text="Receive funds"
881        description="Scan the QR code and receive funds"
882        icon="qrCode"
883        iconColor="fg-200"
884        iconBackgroundColor="fg-200"
885        data-testid="w3m-account-receive-button"
886      ></wui-list-description
887    ></wui-flex>`}onRampTemplate(){var e;return(e=this.remoteFeatures)!=null&&e.onramp?l`<wui-list-description
888        @click=${this.onBuyClick.bind(this)}
889        text="Buy Crypto"
890        description="Easy with card or bank account"
891        icon="card"
892        iconColor="success-100"
893        iconBackgroundColor="success-100"
894        tag="popular"
895        data-testid="w3m-account-onramp-button"
896      ></wui-list-description>`:l``}tokenItemTemplate(){var e;return(e=this.tokenBalance)==null?void 0:e.map(i=>l`<wui-list-token
897          tokenName=${i.name}
898          tokenImageUrl=${i.iconUrl}
899          tokenAmount=${i.quantity.numeric}
900          tokenValue=${i.value}
901          tokenCurrency=${i.symbol}
902        ></wui-list-token>`)}onReceiveClick(){h.push("WalletReceive")}onBuyClick(){C.sendEvent({type:"track",event:"SELECT_BUY_CRYPTO",properties:{isSmartAccount:ze(d.state.activeChain)===Fe.ACCOUNT_TYPES.SMART_ACCOUNT}}
902),h.push("OnRampProviders")}};nt.styles=xn;ii([u()],nt.prototype,"tokenBalance",void 0);ii([u()],nt.prototype,"remoteFeatures",void 0);nt=ii([p("w3m-account-tokens-widget")],nt);const vn=v`
903  wui-flex {
904    width: 100%;
905  }
906
907  wui-promo {
908    position: absolute;
909    top: -32px;
910  }
911
912  wui-profile-button {
913    margin-top: calc(-1 * ${({spacing:t})=>t[4]});
914  }
915
916  wui-promo + wui-profile-button {
917    margin-top: ${({spacing:t})=>t[4]};
918  }
919
920  wui-tabs {
921    width: 100%;
922  }
923
924  .contentContainer {
925    height: 280px;
926  }
927
928  .contentContainer > wui-icon-box {
929    width: 40px;
930    height: 40px;
931    border-radius: ${({borderRadius:t})=>t[3]};
932  }
933
934  .contentContainer > .textContent {
935    width: 65%;
936  }
937`;var ae=function(t,e,i,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};let G=class extends f{constructor(){var e,i,o,r;super(...arguments),this.unsubscribe=[],this.network=d.state.activeCaipNetwork,this.profileName=(e=d.getAccountData())==null?void 0:e.profileName,this.address=(i=d.getAccountData())==null?void 0:i.address,this.currentTab=(o=d.getAccountData())==null?void 0:o.currentTab,this.tokenBalance=(r=d.getAccountData())==null?void 0:r.tokenBalance,this.features=m.state.features,this.namespace=d.state.activeChain,this.activeConnectorIds=b.state.activeConnectorIds,this.remoteFeatures=m.state.remoteFeatures}firstUpdated(){d.fetchTokenBalance(),this.unsubscribe.push(d.subscribeChainProp("accountState",e=>{e!=null&&e.address?(this.address=e.address,this.profileName=e.profileName,this.currentTab=e.currentTab,this.tokenBalance=e.tokenBalance):P.close()}),b.subscribeKey("activeConnectorIds",e=>{this.activeConnectorIds=e}),d.subscribeKey("activeChain",e=>this.namespace=e),d.subscribeKey("activeCaipNetwork",e=>this.network=e),m.subscribeKey("features",e=>this.features=e),m.subscribeKey("remoteFeatures",e=>this.remoteFeatures=e)),this.watchSwapValues()}disconnectedCallback(){this.unsubscribe.forEach(e=>e()),clearInterval(this.watchTokenBalance)}render(){if(!this.address)throw new Error("w3m-account-features-widget: No account provided");if(!this.namespace)return null;const e=this.activeConnectorIds[this.namespace],i=e?b.getConnectorById(e):void 0,{icon:o,iconSize:r}=this.getAuthData();return l`<wui-flex
938      flexDirection="column"
939      .padding=${["0","3","4","3"]}
940      alignItems="center"
941      gap="4"
942      data-testid="w3m-account-wallet-features-widget"
943    >
944      <wui-flex flexDirection="column" justifyContent="center" alignItems="center" gap="2">
945        <wui-wallet-switch
946          profileName=${this.profileName}
947          address=${this.address}
948          icon=${o}
949          iconSize=${r}
950          alt=${i==null?void 0:i.name}
951          @click=${this.onGoToProfileWalletsView.bind(this)}
952          data-testid="wui-wallet-switch"
953        ></wui-wallet-switch>
954
955        ${this.tokenBalanceTemplate()}
956      </wui-flex>
957      ${this.orderedWalletFeatures()} ${this.tabsTemplate()} ${this.listContentTemplate()}
958    </wui-flex>`}orderedWalletFeatures(){var n;const e=((n=this.features)==null?void 0:n.walletFeaturesOrder)||D.DEFAULT_FEATURES.walletFeaturesOrder;if(e.every(s=>{var a,g;return s==="send"||s==="receive"?!((a=this.features)!=null&&a[s]):s==="swaps"||s==="onramp"?!((g=this.remoteFeatures)!=null&&g[s]):!0}))return null;const o=e.map(s=>s==="receive"||s==="onramp"?"fund":s),r=[...new Set(o)];return l`<wui-flex gap="2">
959      ${r.map(s=>{switch(s){case"fund":return this.fundWalletTemplate();case"swaps":return this.swapsTemplate();case"send":return this.sendTemplate();default:return null}})}
960    </wui-flex>`}fundWalletTemplate(){var n,s;if(!this.namespace)return null;const e=D.ONRAMP_SUPPORTED_CHAIN_NAMESPACES.includes(this.namespace),i=(n=this.features)==null?void 0:n.receive,o=((s=this.remoteFeatures)==null?void 0:s.onramp)&&e,r=Q.isPayWithExchangeEnabled();return!o&&!i&&!r?null:l`
961      <w3m-tooltip-trigger text="Fund wallet">
962        <wui-button
963          data-testid="wallet-features-fund-wallet-button"
964          @click=${this.onFundWalletClick.bind(this)}
965          variant="accent-secondary"
966          size="lg"
967          fullWidth
968        >
969          <wui-icon name="dollar"></wui-icon>
970        </wui-button>
970
971      </w3m-tooltip-trigger>
972    `}swapsTemplate(){var o;const e=(o=this.remoteFeatures)==null?void 0:o.swaps,i=d.state.activeChain===E.CHAIN.EVM;return!e||!i?null:l`
973      <w3m-tooltip-trigger text="Swap">
974        <wui-button
975          fullWidth
976          data-testid="wallet-features-swaps-button"
977          @click=${this.onSwapClick.bind(this)}
978          variant="accent-secondary"
979          size="lg"
980        >
981          <wui-icon name="recycleHorizontal"></wui-icon>
982        </wui-button>
983      </w3m-tooltip-trigger>
984    `}sendTemplate(){var r;const e=(r=this.features)==null?void 0:r.send,i=d.state.activeChain,o=D.SEND_SUPPORTED_NAMESPACES.includes(i);return!e||!o?null:l`
985      <w3m-tooltip-trigger text="Send">
986        <wui-button
987          fullWidth
988          data-testid="wallet-features-send-button"
989          @click=${this.onSendClick.bind(this)}
990          variant="accent-secondary"
991          size="lg"
992        >
993          <wui-icon name="send"></wui-icon>
994        </wui-button>
995      </w3m-tooltip-trigger>
996    `}watchSwapValues(){this.watchTokenBalance=setInterval(()=>d.fetchTokenBalance(e=>this.onTokenBalanceError(e)),1e4)}onTokenBalanceError(e){e instanceof Error&&e.cause instanceof Response&&e.cause.status===E.HTTP_STATUS_CODES.SERVICE_UNAVAILABLE&&clearInterval(this.watchTokenBalance)}listContentTemplate(){return this.currentTab===0?l`<w3m-account-tokens-widget></w3m-account-tokens-widget>`:this.currentTab===1?l`<w3m-account-activity-widget></w3m-account-activity-widget>`:l`<w3m-account-tokens-widget></w3m-account-tokens-widget>`}tokenBalanceTemplate(){var e;if(this.tokenBalance&&((e=this.tokenBalance)==null?void 0:e.length)>=0){const i=y.calculateBalance(this.tokenBalance),{dollars:o="0",pennies:r="00"}=y.formatTokenBalance(i);return l`<wui-balance dollars=${o} pennies=${r}></wui-balance>`}return l`<wui-balance dollars="0" pennies="00"></wui-balance>`}tabsTemplate(){const e=Jt.getTabsByNamespace(d.state.activeChain);return e.length===0?null:l`<wui-tabs
997      .onTabChange=${this.onTabChange.bind(this)}
998      .activeTab=${this.currentTab}
999      .tabs=${e}
1000    ></wui-tabs>`}onTabChange(e){d.setAccountProp("currentTab",e,this.namespace)}onFundWalletClick(){h.push("FundWallet")}onSwapClick(){var e,i,o;(e=this.network)!=null&&e.caipNetworkId&&!D.SWAP_SUPPORTED_NETWORKS.includes((i=this.network)==null?void 0:i.caipNetworkId)?h.push("UnsupportedChain",{swapUnsupportedChain:!0}):(C.sendEvent({type:"track",event:"OPEN_SWAP",properties:{network:((o=this.network)==null?void 0:o.caipNetworkId)||"",isSmartAccount:ze(d.state.activeChain)===Fe.ACCOUNT_TYPES.SMART_ACCOUNT}}),h.push("Swap"))}getAuthData(){const e=me.getConnectedSocialProvider(),i=me.getConnectedSocialUsername(),o=b.getAuthConnector(),r=(o==null?void 0:o.provider.getEmail())??"";return{name:Xt.getAuthName({email:r,socialUsername:i,socialProvider:e}),icon:e??"mail",iconSize:e?"xl":"md"}}onGoToProfileWalletsView(){h.push("ProfileWallets")}onSendClick(){var e;C.sendEvent({type:"track",event:"OPEN_SEND",properties:{network:((e=this.network)==null?void 0:e.caipNetworkId)||"",isSmartAccount:ze(d.state.activeChain)===Fe.ACCOUNT_TYPES.SMART_ACCOUNT}}),h.push("WalletSend")}};G.styles=vn;ae([u()],G.prototype,"watchTokenBalance",void 0);ae([u()],G.prototype,"network",void 0);ae([u()],G.prototype,"profileName",void 0);ae([u()],G.prototype,"address",void 0);ae([u()],G.prototype,"currentTab",void 0);ae([u()],G.prototype,"tokenBalance",void 0);ae([u()],G.prototype,"features",void 0);ae([u()],G.prototype,"namespace",void 0);ae([u()],G.prototype,"activeConnectorIds",void 0);ae([u()],G.prototype,"remoteFeatures",void 0);G=ae([p("w3m-account-wallet-features-widget")],G);var Ti=function(t,e,i,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};let Ft=class extends f{constructor(){super(),this.unsubscribe=[],this.namespace=d.state.activeChain,this.unsubscribe.push(d.subscribeKey("activeChain",e=>{this.namespace=e}))}
1000render(){if(!this.namespace)return null;const e=b.getConnectorId(this.namespace),i=b.getAuthConnector();return l`
1001      ${i&&e===E.CONNECTOR_ID.AUTH?this.walletFeaturesTemplate():this.defaultTemplate()}
1002    `}walletFeaturesTemplate(){return l`<w3m-account-wallet-features-widget></w3m-account-wallet-features-widget>`}defaultTemplate(){return l`<w3m-account-default-widget></w3m-account-default-widget>`}};Ti([u()],Ft.prototype,"namespace",void 0);Ft=Ti([p("w3m-account-view")],Ft);const $n=v`
1003  wui-image {
1004    width: 24px;
1005    height: 24px;
1006    border-radius: ${({borderRadius:t})=>t[2]};
1007  }
1008
1009  wui-image,
1010  .icon-box {
1011    width: 32px;
1012    height: 32px;
1013    border-radius: ${({borderRadius:t})=>t[2]};
1014  }
1015
1016  wui-icon:not(.custom-icon, .icon-badge) {
1017    cursor: pointer;
1018  }
1019
1020  .icon-box {
1021    position: relative;
1022    border-radius: ${({borderRadius:t})=>t[2]};
1023    background-color: ${({tokens:t})=>t.theme.foregroundSecondary};
1024  }
1025
1026  .icon-badge {
1027    position: absolute;
1028    top: 18px;
1029    left: 23px;
1030    z-index: 3;
1031    background-color: ${({tokens:t})=>t.theme.foregroundPrimary};
1032    border: 2px solid ${({tokens:t})=>t.theme.backgroundPrimary};
1033    border-radius: 50%;
1034    padding: ${({spacing:t})=>t["01"]};
1035  }
1036
1037  .icon-badge {
1038    width: 8px;
1039    height: 8px;
1040  }
1041`;var q=function(t,e,i,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};let L=class extends f{constructor(){super(...arguments),this.address="",this.profileName="",this.content=[],this.alt="",this.imageSrc="",this.icon=void 0,this.iconSize="md",this.iconBadge=void 0,this.iconBadgeSize="md",this.buttonVariant="neutral-primary",this.enableMoreButton=!1,this.charsStart=4,this.charsEnd=6}render(){return l`
1042      <wui-flex flexDirection="column" rowgap="2">
1043        ${this.topTemplate()} ${this.bottomTemplate()}
1044      </wui-flex>
1045    `}topTemplate(){return l`
1046      <wui-flex alignItems="flex-start" justifyContent="space-between">
1047        ${this.imageOrIconTemplate()}
1048        <wui-icon-link
1049          variant="secondary"
1050          size="md"
1051          icon="copy"
1052          @click=${this.dispatchCopyEvent}
1053        ></wui-icon-link>
1054        <wui-icon-link
1055          variant="secondary"
1056          size="md"
1057          icon="externalLink"
1058          @click=${this.dispatchExternalLinkEvent}
1059        ></wui-icon-link>
1060        ${this.enableMoreButton?l`<wui-icon-link
1061              variant="secondary"
1062              size="md"
1063              icon="threeDots"
1064              @click=${this.dispatchMoreButtonEvent}
1065              data-testid="wui-active-profile-wallet-item-more-button"
1066            ></wui-icon-link>`:null}
1067      </wui-flex>
1068    `}bottomTemplate(){return l` <wui-flex flexDirection="column">${this.contentTemplate()}</wui-flex> `}imageOrIconTemplate(){return this.icon?l`
1069        <wui-flex flexGrow="1" alignItems="center">
1070          <wui-flex alignItems="center" justifyContent="center" class="icon-box">
1071            <wui-icon size="lg" color="default" name=${this.icon} class="custom-icon"></wui-icon>
1072
1073            ${this.iconBadge?l`<wui-icon
1074                  color="accent-primary"
1075                  size="inherit"
1076                  name=${this.iconBadge}
1077                  class="icon-badge"
1078                ></wui-icon>`:null}
1079          </wui-flex>
1080        </wui-flex>
1081      `:l`
1082      <wui-flex flexGrow="1" alignItems="center">
1083        <wui-image objectFit="contain" src=${this.imageSrc} alt=${this.alt}></wui-image>
1084      </wui-flex>
1085    `}contentTemplate(){return this.content.length===0?null:l`
1086      <wui-flex flexDirection="column" rowgap="3">
1087        ${this.content.map(e=>this.labelAndTagTemplate(e))}
1088      </wui-flex>
1089    `}labelAndTagTemplate({address:e,profileName:i,label:o,description:r,enableButton:n,buttonType:s,buttonLabel:a,buttonVariant:g,tagVariant:$,tagLabel:k,alignItems:R="flex-end"}){return l`
1090      <wui-flex justifyContent="space-between" alignItems=${R} columngap="1">
1091        <wui-flex flexDirection="column" rowgap="01">
1092          ${o?l`<wui-text variant="sm-medium" color="secondary">${o}</wui-text>`:null}
1093
1094          <wui-flex alignItems="center" columngap="1">
1095            <wui-text variant="md-regular" color="primary">
1096              ${F.getTruncateString({string:i||e,charsStart:i?16:this.charsStart,charsEnd:i?0:this.charsEnd,truncate:i?"end":"middle"})}
1097            </wui-text>
1098
1099            ${$&&k?l`<wui-tag variant=${$} size="sm">${k}</wui-tag>`:null}
1100          </wui-flex>
1101
1102          ${r?l`<wui-text variant="sm-regular" color="secondary">${r}</wui-text>`:null}
1103        </wui-flex>
1104
1105        ${n?this.buttonTemplate({buttonType:s,buttonLabel:a,buttonVariant:g}):null}
1106      </wui-flex>
1107    `}buttonTemplate({buttonType:e,buttonLabel:i,buttonVariant:o}){return l`
1108      <wui-button
1109        size="sm"
1110        variant=${o}
1111        @click=${e==="disconnect"?this.dispatchDisconnectEvent.bind(this):this.dispatchSwitchEvent.bind(this)}
1112        data-testid=${e==="disconnect"?"wui-active-profile-wallet-item-disconnect-button":"wui-active-profile-wallet-item-switch-button"}
1113      >
1114        ${i}
1115      </wui-button>
1115
1116    `}dispatchDisconnectEvent(){this.dispatchEvent(new CustomEvent("disconnect",{bubbles:!0,composed:!0}))}dispatchSwitchEvent(){this.dispatchEvent(new CustomEvent("switch",{bubbles:!0,composed:!0}))}dispatchExternalLinkEvent(){this.dispatchEvent(new CustomEvent("externalLink",{bubbles:!0,composed:!0}))}dispatchMoreButtonEvent(){this.dispatchEvent(new CustomEvent("more",{bubbles:!0,composed:!0}))}dispatchCopyEvent(){this.dispatchEvent(new CustomEvent("copy",{bubbles:!0,composed:!0}))}};L.styles=[_,W,$n];q([c()],L.prototype,"address",void 0);q([c()],L.prototype,"profileName",void 0);q([c({type:Array})],L.prototype,"content",void 0);q([c()],L.prototype,"alt",void 0);q([c()],L.prototype,"imageSrc",void 0);q([c()],L.prototype,"icon",void 0);q([c()],L.prototype,"iconSize",void 0);q([c()],L.prototype,"iconBadge",void 0);q([c()],L.prototype,"iconBadgeSize",void 0);q([c()],L.prototype,"buttonVariant",void 0);q([c({type:Boolean})],L.prototype,"enableMoreButton",void 0);q([c({type:Number})],L.prototype,"charsStart",void 0);q([c({type:Number})],L.prototype,"charsEnd",void 0);L=q([p("wui-active-profile-wallet-item")],L);const Cn=v`
1117  wui-image,
1118  .icon-box {
1119    width: 32px;
1120    height: 32px;
1121    border-radius: ${({borderRadius:t})=>t[2]};
1122  }
1123
1124  .right-icon {
1125    cursor: pointer;
1126  }
1127
1128  .icon-box {
1129    position: relative;
1130    background-color: ${({tokens:t})=>t.theme.foregroundPrimary};
1131  }
1132
1133  .icon-badge {
1134    position: absolute;
1135    top: 18px;
1136    left: 23px;
1137    z-index: 3;
1138    background-color: ${({tokens:t})=>t.theme.foregroundPrimary};
1139    border: 2px solid ${({tokens:t})=>t.theme.backgroundPrimary};
1140    border-radius: 50%;
1141    padding: ${({spacing:t})=>t["01"]};
1142  }
1143
1144  .icon-badge {
1145    width: 8px;
1146    height: 8px;
1147  }
1148`;var j=function(t,e,i,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};let T=class extends f{constructor(){super(...arguments),this.address="",this.profileName="",this.alt="",this.buttonLabel="",this.buttonVariant="accent-primary",this.imageSrc="",this.icon=void 0,this.iconSize="md",this.iconBadgeSize="md",this.rightIcon="signOut",this.rightIconSize="md",this.loading=!1,this.charsStart=4,this.charsEnd=6}render(){return l`
1149      <wui-flex alignItems="center" columngap="2">
1150        ${this.imageOrIconTemplate()} ${this.labelAndDescriptionTemplate()}
1151        ${this.buttonActionTemplate()}
1152      </wui-flex>
1153    `}imageOrIconTemplate(){return this.icon?l`
1154        <wui-flex alignItems="center" justifyContent="center" class="icon-box">
1155          <wui-flex alignItems="center" justifyContent="center" class="icon-box">
1156            <wui-icon size="lg" color="default" name=${this.icon} class="custom-icon"></wui-icon>
1157
1158            ${this.iconBadge?l`<wui-icon
1159                  color="default"
1160                  size="inherit"
1161                  name=${this.iconBadge}
1162                  class="icon-badge"
1163                ></wui-icon>`:null}
1164          </wui-flex>
1165        </wui-flex>
1166      `:l`<wui-image objectFit="contain" src=${this.imageSrc} alt=${this.alt}></wui-image>`}labelAndDescriptionTemplate(){return l`
1167      <wui-flex
1168        flexDirection="column"
1169        flexGrow="1"
1170        justifyContent="flex-start"
1171        alignItems="flex-start"
1172      >
1173        <wui-text variant="lg-regular" color="primary">
1174          ${F.getTruncateString({string:this.profileName||this.address,charsStart:this.profileName?16:this.charsStart,charsEnd:this.profileName?0:this.charsEnd,truncate:this.profileName?"end":"middle"})}
1175        </wui-text>
1176      </wui-flex>
1177    `}buttonActionTemplate(){return l`
1178      <wui-flex columngap="1" alignItems="center" justifyContent="center">
1179        <wui-button
1180          size="sm"
1181          variant=${this.buttonVariant}
1182          .loading=${this.loading}
1183          @click=${this.handleButtonClick}
1184          data-testid="wui-inactive-profile-wallet-item-button"
1185        >
1186          ${this.buttonLabel}
1187        </wui-button>
1187
1188
1189        <wui-icon-link
1190          variant="secondary"
1191          size="md"
1192          icon=${w(this.rightIcon)}
1193          class="right-icon"
1194          @click=${this.handleIconClick}
1195        ></wui-icon-link>
1196      </wui-flex>
1197    `}handleButtonClick(){this.dispatchEvent(new CustomEvent("buttonClick",{bubbles:!0,composed:!0}))}handleIconClick(){this.dispatchEvent(new CustomEvent("iconClick",{bubbles:!0,composed:!0}))}};T.styles=[_,W,Cn];j([c()],T.prototype,"address",void 0);j([c()],T.prototype,"profileName",void 0);j([c()],T.prototype,"alt",void 0);j([c()],T.prototype,"buttonLabel",void 0);j([c()],T.prototype,"buttonVariant",void 0);j([c()],T.prototype,"imageSrc",void 0);j([c()],T.prototype,"icon",void 0);j([c()],T.prototype,"iconSize",void 0);j([c()],T.prototype,"iconBadge",void 0);j([c()],T.prototype,"iconBadgeSize",void 0);j([c()],T.prototype,"rightIcon",void 0);j([c()],T.prototype,"rightIconSize",void 0);j([c({type:Boolean})],T.prototype,"loading",void 0);j([c({type:Number})],T.prototype,"charsStart",void 0);j([c({type:Number})],T.prototype,"charsEnd",void 0);T=j([p("wui-inactive-profile-wallet-item")],T);const jt={getAuthData(t){var s,a;const e=t.connectorId===E.CONNECTOR_ID.AUTH;if(!e)return{isAuth:!1,icon:void 0,iconSize:void 0,name:void 0};const i=((s=t==null?void 0:t.auth)==null?void 0:s.name)??me.getConnectedSocialProvider(),o=((a=t==null?void 0:t.auth)==null?void 0:a.username)??me.getConnectedSocialUsername(),r=b.getAuthConnector(),n=(r==null?void 0:r.provider.getEmail())??"";return{isAuth:!0,icon:i??"mail",iconSize:i?"xl":"md",name:e?Xt.getAuthName({email:n,socialUsername:o,socialProvider:i}):void 0}}},Sn=v`
1198  :host {
1199    --connect-scroll--top-opacity: 0;
1200    --connect-scroll--bottom-opacity: 0;
1201  }
1202
1203  .balance-amount {
1204    flex: 1;
1205  }
1206
1207  .wallet-list {
1208    scrollbar-width: none;
1209    overflow-y: scroll;
1210    overflow-x: hidden;
1211    transition: opacity ${({easings:t})=>t["ease-out-power-1"]}
1212      ${({durations:t})=>t.md};
1213    will-change: opacity;
1214    mask-image: linear-gradient(
1215      to bottom,
1216      rgba(0, 0, 0, calc(1 - var(--connect-scroll--top-opacity))) 0px,
1217      rgba(200, 200, 200, calc(1 - var(--connect-scroll--top-opacity))) 1px,
1218      black 40px,
1219      black calc(100% - 40px),
1220      rgba(155, 155, 155, calc(1 - var(--connect-scroll--bottom-opacity))) calc(100% - 1px),
1221      rgba(0, 0, 0, calc(1 - var(--connect-scroll--bottom-opacity))) 100%
1222    );
1223  }
1224
1225  .active-wallets {
1226    background-color: ${({tokens:t})=>t.theme.foregroundPrimary};
1227    border-radius: ${({borderRadius:t})=>t[4]};
1228  }
1229
1230  .active-wallets-box {
1231    height: 330px;
1232  }
1233
1234  .empty-wallet-list-box {
1235    height: 400px;
1236  }
1237
1238  .empty-box {
1239    width: 100%;
1240    padding: ${({spacing:t})=>t[4]};
1241    background-color: ${({tokens:t})=>t.theme.foregroundPrimary};
1242    border-radius: ${({borderRadius:t})=>t[4]};
1243  }
1244
1245  wui-separator {
1246    margin: ${({spacing:t})=>t[2]} 0 ${({spacing:t})=>t[2]} 0;
1247  }
1248
1249  .active-connection {
1250    padding: ${({spacing:t})=>t[2]};
1251  }
1252
1253  .recent-connection {
1254    padding: ${({spacing:t})=>t[2]} 0 ${({spacing:t})=>t[2]} 0;
1255  }
1256
1257  @media (max-width: 430px) {
1258    .active-wallets-box,
1259    .empty-wallet-list-box {
1260      height: auto;
1261      max-height: clamp(360px, 470px, 80vh);
1262    }
1263  }
1264`;var X=function(t,e,i,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};const Y={ADDRESS_DISPLAY:{START:4,END:6},BADGE:{SIZE:"md",ICON:"lightbulb"},SCROLL_THRESHOLD:50,OPACITY_RANGE:[0,1]},Se={eip155:"ethereum",solana:"solana",bip122:"bitcoin",ton:"ton",tron:"tron"},En=[{namespace:"eip155",icon:Se.eip155,label:"EVM"},{namespace:"solana",icon:Se.solana,label:"Solana"},{namespace:"bip122",icon:Se.bip122,label:"Bitcoin"},{namespace:"ton",icon:Se.ton,label:"Ton"},{namespace:"tron",icon:Se.tron,label:"Tron"}],kn={eip155:{title:"Add EVM Wallet",description:"Add your first EVM wallet"},solana:{title:"Add Solana Wallet",description:"Add your first Solana wallet"},bip122:{title:"Add Bitcoin Wallet",description:"Add your first Bitcoin wallet"},ton:{title:"Add TON Wallet",description:"Add your first TON wallet"},tron:{title:"Add TRON Wallet",description:"Add your first TRON wallet"}};let B=class extends f{constructor(){var e,i,o;super(),this.unsubscribers=[],this.currentTab=0,this.namespace=d.state.activeChain,this.namespaces=Array.from(d.state.chains.keys()),this.caipAddress=void 0,this.profileName=void 0,this.activeConnectorIds=b.state.activeConnectorIds,this.lastSelectedAddress="",this.lastSelectedConnectorId="",this.isSwitching=!1,this.caipNetwork=d.state.activeCaipNetwork,this.user=(e=d.getAccountData())==null?void 0:e.user,this.remoteFeatures=m.state.remoteFeatures,this.currentTab=this.namespace?this.namespaces.indexOf(this.namespace):0,this.caipAddress=(i=d.getAccountData(this.namespace))==null?void 0:i.caipAddress,this.profileName=(o=d.getAccountData(this.namespace))==null?void 0:o.profileName,this.unsubscribers.push(x.subscribeKey("connections",()=>this.onConnectionsChange()),x.subscribeKey("recentConnections",()=>this.requestUpdate()),b.subscribeKey("activeConnectorIds",r=>{this.activeConnectorIds=r}),d.subscribeKey("activeCaipNetwork",r=>this.caipNetwork=r),d.subscribeChainProp("accountState",r=>{this.user=r==null?void 0:r.user}),m.subscribeKey("remoteFeatures",r=>this.remoteFeatures=r)),this.chainListener=d.subscribeChainProp("accountState",r=>{this.caipAddress=r==null?void 0:r.caipAddress,this.profileName=r==null?void 0:r.profileName},this.namespace)}disconnectedCallback(){var e,i;
1264this.unsubscribers.forEach(o=>o()),(e=this.resizeObserver)==null||e.disconnect(),this.removeScrollListener(),(i=this.chainListener)==null||i.call(this)}firstUpdated(){var o;const e=(o=this.shadowRoot)==null?void 0:o.querySelector(".wallet-list");if(!e)return;const i=()=>this.updateScrollOpacity(e);requestAnimationFrame(i),e.addEventListener("scroll",i),this.resizeObserver=new ResizeObserver(i),this.resizeObserver.observe(e),i()}render(){const e=this.namespace;if(!e)throw new Error("Namespace is not set");return l`
1265      <wui-flex flexDirection="column" .padding=${["0","4","4","4"]} gap="4">
1266        ${this.renderTabs()} ${this.renderHeader(e)} ${this.renderConnections(e)}
1267        ${this.renderAddConnectionButton(e)}
1268      </wui-flex>
1269    `}renderTabs(){const e=this.namespaces.map(o=>En.find(r=>r.namespace===o)).filter(Boolean);return e.length>1?l`
1270        <wui-tabs
1271          .onTabChange=${o=>this.handleTabChange(o)}
1272          .activeTab=${this.currentTab}
1273          .tabs=${e}
1274        ></wui-tabs>
1275      `:null}renderHeader(e){const o=this.getActiveConnections(e).flatMap(({accounts:r})=>r).length+(this.caipAddress?1:0);return l`
1276      <wui-flex alignItems="center" columngap="1">
1277        <wui-icon
1278          size="sm"
1279          name=${Se[e]??Se.eip155}
1280        ></wui-icon>
1281        <wui-text color="secondary" variant="lg-regular"
1282          >${o>1?"Wallets":"Wallet"}</wui-text
1283        >
1284        <wui-text
1285          color="primary"
1286          variant="lg-regular"
1287          class="balance-amount"
1288          data-testid="balance-amount"
1289        >
1290          ${o}
1291        </wui-text>
1292        <wui-link
1293          color="secondary"
1294          variant="secondary"
1295          @click=${()=>x.disconnect({namespace:e})}
1296          ?disabled=${!this.hasAnyConnections(e)}
1297          data-testid="disconnect-all-button"
1298        >
1299          Disconnect All
1300        </wui-link>
1301      </wui-flex>
1302    `}renderConnections(e){const i=this.hasAnyConnections(e);return l`
1303      <wui-flex flexDirection="column" class=${_i({"wallet-list":!0,"active-wallets-box":i,"empty-wallet-list-box":!i})} rowgap="3">
1304        ${i?this.renderActiveConnections(e):this.renderEmptyState(e)}
1305      </wui-flex>
1306    `}renderActiveConnections(e){const i=this.getActiveConnections(e),o=this.activeConnectorIds[e],r=this.getPlainAddress();return l`
1307      ${r||o||i.length>0?l`<wui-flex
1308            flexDirection="column"
1309            .padding=${["4","0","4","0"]}
1310            class="active-wallets"
1311          >
1312            ${this.renderActiveProfile(e)} ${this.renderActiveConnectionsList(e)}
1313          </wui-flex>`:null}
1314      ${this.renderRecentConnections(e)}
1315    `}renderActiveProfile(e){const i=this.activeConnectorIds[e];if(!i)return null;const{connections:o}=he.getConnectionsData(e),r=b.getConnectorById(i),n=S.getConnectorImage(r),s=this.getPlainAddress();if(!s)return null;const a=e===E.CHAIN.BITCOIN,g=jt.getAuthData({connectorId:i,accounts:[]}),$=this.getActiveConnections(e).flatMap(O=>O.accounts).length>0,k=o.find(O=>O.connectorId===i),R=k==null?void 0:k.accounts.filter(O=>!J.isLowerCaseMatch(O.address,s));return l`
1316      <wui-flex flexDirection="column" .padding=${["0","4","0","4"]}>
1317        <wui-active-profile-wallet-item
1318          address=${s}
1319          alt=${r==null?void 0:r.name}
1320          .content=${this.getProfileContent({address:s,connections:o,connectorId:i,namespace:e})}
1321          .charsStart=${Y.ADDRESS_DISPLAY.START}
1322          .charsEnd=${Y.ADDRESS_DISPLAY.END}
1323          .icon=${g.icon}
1324          .iconSize=${g.iconSize}
1325          .iconBadge=${this.isSmartAccount(s)?Y.BADGE.ICON:void 0}
1326          .iconBadgeSize=${this.isSmartAccount(s)?Y.BADGE.SIZE:void 0}
1327          imageSrc=${n}
1328          ?enableMoreButton=${g.isAuth}
1329          @copy=${()=>this.handleCopyAddress(s)}
1330          @disconnect=${()=>this.handleDisconnect(e,i)}
1331          @switch=${()=>{a&&k&&(R!=null&&R[0])&&this.handleSwitchWallet(k,R[0].address,e)}}
1332          @externalLink=${()=>this.handleExternalLink(s)}
1333          @more=${()=>this.handleMore()}
1334          data-testid="wui-active-profile-wallet-item"
1335        ></wui-active-profile-wallet-item>
1336        ${$?l`<wui-separator></wui-separator>`:null}
1337      </wui-flex>
1338    `}renderActiveConnectionsList(e){const i=this.getActiveConnections(e);return i.length===0?null:l`
1339      <wui-flex flexDirection="column" .padding=${["0","2","0","2"]}>
1340        ${this.renderConnectionList(i,!1,e)}
1341      </wui-flex>
1342    `}renderRecentConnections(e){const{recentConnections:i}=he.getConnectionsData(e);return i.flatMap(r=>r.accounts).length===0?null:l`
1343      <wui-flex flexDirection="column" .padding=${["0","2","0","2"]} rowGap="2">
1344        <wui-text color="secondary" variant="sm-medium" data-testid="recently-connected-text"
1345          >RECENTLY CONNECTED</wui-text
1346        >
1347        <wui-flex flexDirection="column" .padding=${["0","2","0","2"]}>
1348          ${this.renderConnectionList(i,!0,e)}
1349        </wui-flex>
1350      </wui-flex>
1351    `}renderConnectionList(e,i,o){return e.filter(r=>r.accounts.length>0).map((r,n)=>{const s=b.getConnectorById(r.connectorId),a=S.getConnectorImage(s)??"",g=jt.getAuthData(r);return r.accounts.map(($,k)=>{const R=n!==0||k!==0,O=this.isAccountLoading(r.connectorId,$.address);return l`
1352            <wui-flex flexDirection="column">
1353              ${R?l`<wui-separator></wui-separator>`:null}
1354              <wui-inactive-profile-wallet-item
1355                address=${$.address}
1356                alt=${r.connectorId}
1357                buttonLabel=${i?"Connect":"Switch"}
1358                buttonVariant=${i?"neutral-secondary":"accent-secondary"}
1359                rightIcon=${i?"bin":"power"}
1360                rightIconSize="sm"
1361                class=${i?"recent-connection":"active-connection"}
1362                data-testid=${i?"recent-connection":"active-connection"}
1363                imageSrc=${a}
1364                .iconBadge=${this.isSmartAccount($.address)?Y.BADGE.ICON:void 0}
1365                .iconBadgeSize=${this.isSmartAccount($.address)?Y.BADGE.SIZE:void 0}
1366                .icon=${g.icon}
1367                .iconSize=${g.iconSize}
1368                .loading=${O}
1369                .showBalance=${!1}
1370                .charsStart=${Y.ADDRESS_DISPLAY.START}
1371                .charsEnd=${Y.ADDRESS_DISPLAY.END}
1372                @buttonClick=${()=>this.handleSwitchWallet(r,$.address,o)}
1373                @iconClick=${()=>this.handleWalletAction({connection:r,address:$.address,isRecentConnection:i,namespace:o})}
1374              ></wui-inactive-profile-wallet-item>
1375            </wui-flex>
1376          `})})}renderAddConnectionButton(e){if(!this.isMultiWalletEnabled()&&this.caipAddress||!this.hasAnyConnections(e))return null;const{title:i}=this.getChainLabelInfo(e);return l`
1377      <wui-list-item
1378        variant="icon"
1379        iconVariant="overlay"
1380        icon="plus"
1381        iconSize="sm"
1382        ?chevron=${!0}
1383        @click=${()=>this.handleAddConnection(e)}
1384        data-testid="add-connection-button"
1385      >
1386        <wui-text variant="md-medium" color="secondary">${i}</wui-text>
1387      </wui-list-item>
1388    `}renderEmptyState(e){const{title:i,description:o}=this.getChainLabelInfo(e);return l`
1389      <wui-flex alignItems="flex-start" class="empty-template" data-testid="empty-template">
1390        <wui-flex
1391          flexDirection="column"
1392          alignItems="center"
1393          justifyContent="center"
1394          rowgap="3"
1395          class="empty-box"
1396        >
1397          <wui-icon-box size="xl" icon="wallet" color="secondary"></wui-icon-box>
1398
1399          <wui-flex flexDirection="column" alignItems="center" justifyContent="center" gap="1">
1400            <wui-text color="primary" variant="lg-regular" data-testid="empty-state-text"
1401              >No wallet connected</wui-text
1402            >
1403            <wui-text color="secondary" variant="md-regular" data-testid="empty-state-description"
1404              >${o}</wui-text
1405            >
1406          </wui-flex>
1407
1408          <wui-link
1409            @click=${()=>this.handleAddConnection(e)}
1410            data-testid="empty-state-button"
1411            icon="plus"
1412          >
1413            ${i}
1414          </wui-link>
1415        </wui-flex>
1416      </wui-flex>
1417    `}handleTabChange(e){var o,r,n;const i=this.namespaces[e];i&&((o=this.chainListener)==null||o.call(this),this.currentTab=this.namespaces.indexOf(i),this.namespace=i,this.caipAddress=(r=d.getAccountData(i))==null?void 0:r.caipAddress,this.profileName=(n=d.getAccountData(i))==null?void 0:n.profileName,this.chainListener=d.subscribeChainProp("accountState",s=>{this.caipAddress=s==null?void 0:s.caipAddress},i))}async handleSwitchWallet(e,i,o){var r;try{this.isSwitching=!0,this.lastSelectedConnectorId=e.connectorId,this.lastSelectedAddress=i,((r=this.caipNetwork)==null?void 0:r.chainNamespace)!==o&&(e!=null&&e.caipNetwork)&&(b.setFilterByNamespace(o),await d.switchActiveNetwork(e==null?void 0:e.caipNetwork)),await x.switchConnection({connection:e,address:i,namespace:o,closeModalOnConnect:!1,onChange({hasSwitchedAccount:s,hasSwitchedWallet:
1417a}){a?A.showSuccess("Wallet switched"):s&&A.showSuccess("Account switched")}})}catch{A.showError("Failed to switch wallet")}finally{this.isSwitching=!1}}handleWalletAction(e){const{connection:i,address:o,isRecentConnection:r,namespace:n}=e;r?(me.deleteAddressFromConnection({connectorId:i.connectorId,address:o,namespace:n}),x.syncStorageConnections(),A.showSuccess("Wallet deleted")):this.handleDisconnect(n,i.connectorId)}async handleDisconnect(e,i){try{await x.disconnect({id:i,namespace:e}),A.showSuccess("Wallet disconnected")}catch{A.showError("Failed to disconnect wallet")}}handleCopyAddress(e){y.copyToClopboard(e),A.showSuccess("Address copied")}handleMore(){h.push("AccountSettings")}handleExternalLink(e){var o,r;const i=(r=(o=this.caipNetwork)==null?void 0:o.blockExplorers)==null?void 0:r.default.url;i&&y.openHref(`${i}/address/${e}`,"_blank")}handleAddConnection(e){b.setFilterByNamespace(e),h.push("Connect",{addWalletForNamespace:e})}getChainLabelInfo(e){return kn[e]??{title:"Add Wallet",description:"Add your first wallet"}}isSmartAccount(e){var o,r;if(!this.namespace)return!1;const i=(r=(o=this.user)==null?void 0:o.accounts)==null?void 0:r.find(n=>n.type==="smartAccount");return i&&e?J.isLowerCaseMatch(i.address,e):!1}getPlainAddress(){return this.caipAddress?y.getPlainAddress(this.caipAddress):void 0}getActiveConnections(e){const i=this.activeConnectorIds[e],{connections:o}=he.getConnectionsData(e),[r]=o.filter(g=>J.isLowerCaseMatch(g.connectorId,i));if(!i)return o;const n=e===E.CHAIN.BITCOIN,{address:s}=this.caipAddress?qi.parseCaipAddress(this.caipAddress):{};let a=[...s?[s]:[]];return n&&r&&(a=r.accounts.map(g=>g.address)||[]),he.excludeConnectorAddressFromConnections({connectorId:i,addresses:a,connections:o})}hasAnyConnections(e){const i=this.getActiveConnections(e),{recentConnections:o}=he.getConnectionsData(e);return!!this.caipAddress||i.length>0||o.length>0}isAccountLoading(e,i){return J.isLowerCaseMatch(this.lastSelectedConnectorId,e)&&J.isLowerCaseMatch(this.lastSelectedAddress,i)&&this.isSwitching}getProfileContent(e){const{address:i,connections:o,connectorId:r,namespace:n}=e,[s]=o.filter(g=>J.isLowerCaseMatch(g.connectorId,r));if(n===E.CHAIN.BITCOIN&&(s!=null&&s.accounts.every(g=>typeof g.type=="string")))return this.getBitcoinProfileContent(s.accounts,i);const a=jt.getAuthData({connectorId:r,accounts:[]});return[{address:i,tagLabel:"Active",tagVariant:"success",enableButton:!0,profileName:this.profileName,buttonType:"disconnect",buttonLabel:"Disconnect",buttonVariant:"neutral-secondary",...a.isAuth?{description:this.isSmartAccount(i)?"Smart Account":"EOA Account"}:{}}]}getBitcoinProfileContent(e,i){const o=e.length>1,r=this.getPlainAddress();return e.map(n=>{const s=J.isLowerCaseMatch(n.address,r);let a="PAYMENT";return n.type==="ordinal"&&(a="ORDINALS"),{address:n.address,tagLabel:J.isLowerCaseMatch(n.address,i)?"Active":void 0,tagVariant:J.isLowerCaseMatch(n.address,i)?"success":void 0,enableButton:!0,...o?{label:a,alignItems:"flex-end",buttonType:s?"disconnect":"switch",buttonLabel:s?"Disconnect":"Switch",buttonVariant:s?"neutral-secondary":"accent-secondary"}:{alignItems:"center",buttonType:"disconnect",buttonLabel:"Disconnect",buttonVariant:"neutral-secondary"}}})}removeScrollListener(){var i;const e=(i=this.shadowRoot)==null?void 0:i.querySelector(".wallet-list");e&&e.removeEventListener("scroll",()=>this.handleConnectListScroll())}handleConnectListScroll(){var i;const e=(i=this.shadowRoot)==null?void 0:i.querySelector(".wallet-list");e&&this.updateScrollOpacity(e)}isMultiWalletEnabled(){var e;return!!((e=this.remoteFeatures)!=null&&e.multiWallet)}updateScrollOpacity(e){e.style.setProperty("--connect-scroll--top-opacity",mt.interpolate([0,Y.SCROLL_THRESHOLD],Y.OPACITY_RANGE,e.scrollTop).toString()),e.style.setProperty("--connect-scroll--bottom-opacity",mt.interpolate([0,Y.SCROLL_THRESHOLD],Y.OPACITY_RANGE,e.scrollHeight-e.scrollTop-e.offsetHeight).toString())}onConnectionsChange(){if(this.isMultiWalletEnabled()&&this.namespace){const{connections:e}=he.getConnectionsData(this.namespace);e.length===0&&h.reset("ProfileWallets")}this.requestUpdate()}};B.styles=Sn;X([u()],B.prototype,"currentTab",void 0);
1417X([u()],B.prototype,"namespace",void 0);X([u()],B.prototype,"namespaces",void 0);X([u()],B.prototype,"caipAddress",void 0);X([u()],B.prototype,"profileName",void 0);X([u()],B.prototype,"activeConnectorIds",void 0);X([u()],B.prototype,"lastSelectedAddress",void 0);X([u()],B.prototype,"lastSelectedConnectorId",void 0);X([u()],B.prototype,"isSwitching",void 0);X([u()],B.prototype,"caipNetwork",void 0);X([u()],B.prototype,"user",void 0);X([u()],B.prototype,"remoteFeatures",void 0);B=X([p("w3m-profile-wallets-view")],B);var Ye=function(t,e,i,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};let Te=class extends f{constructor(){super(),this.unsubscribe=[],this.activeCaipNetwork=d.state.activeCaipNetwork,this.features=m.state.features,this.remoteFeatures=m.state.remoteFeatures,this.exchangesLoading=Q.state.isLoading,this.exchanges=Q.state.exchanges,this.unsubscribe.push(m.subscribeKey("features",e=>this.features=e),m.subscribeKey("remoteFeatures",e=>this.remoteFeatures=e),d.subscribeKey("activeCaipNetwork",e=>{this.activeCaipNetwork=e,this.setDefaultPaymentAsset()}),Q.subscribeKey("isLoading",e=>this.exchangesLoading=e),Q.subscribeKey("exchanges",e=>this.exchanges=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}async firstUpdated(){Q.isPayWithExchangeSupported()&&(await this.setDefaultPaymentAsset(),await Q.fetchExchanges())}render(){return l`
1418      <wui-flex flexDirection="column" .padding=${["1","3","3","3"]} gap="2">
1419        ${this.onrampTemplate()} ${this.receiveTemplate()} ${this.depositFromExchangeTemplate()}
1420      </wui-flex>
1421    `}async setDefaultPaymentAsset(){if(!this.activeCaipNetwork)return;const e=await Q.getAssetsForNetwork(this.activeCaipNetwork.caipNetworkId),i=e.find(o=>o.metadata.symbol==="USDC")||e[0];i&&Q.setPaymentAsset(i)}onrampTemplate(){var o;if(!this.activeCaipNetwork)return null;const e=(o=this.remoteFeatures)==null?void 0:o.onramp,i=D.ONRAMP_SUPPORTED_CHAIN_NAMESPACES.includes(this.activeCaipNetwork.chainNamespace);return!e||!i?null:l`
1422      <wui-list-item
1423        @click=${this.onBuyCrypto.bind(this)}
1424        icon="card"
1425        data-testid="wallet-features-onramp-button"
1426      >
1427        <wui-text variant="lg-regular" color="primary">Buy crypto</wui-text>
1428      </wui-list-item>
1429    `}depositFromExchangeTemplate(){return!this.activeCaipNetwork||!Q.isPayWithExchangeSupported()?null:l`
1430      <wui-list-item
1431        @click=${this.onDepositFromExchange.bind(this)}
1432        icon="arrowBottomCircle"
1433        data-testid="wallet-features-deposit-from-exchange-button"
1434        ?loading=${this.exchangesLoading}
1435        ?disabled=${this.exchangesLoading||!this.exchanges.length}
1436      >
1437        <wui-text variant="lg-regular" color="primary">Deposit from exchange</wui-text>
1438      </wui-list-item>
1439    `}receiveTemplate(){var i;return!((i=this.features)!=null&&i.receive)?null:l`
1440      <wui-list-item
1441        @click=${this.onReceive.bind(this)}
1442        icon="qrCode"
1443        data-testid="wallet-features-receive-button"
1444      >
1445        <wui-text variant="lg-regular" color="primary">Receive funds</wui-text>
1446      </wui-list-item>
1447    `}onBuyCrypto(){h.push("OnRampProviders")}onReceive(){h.push("WalletReceive")}onDepositFromExchange(){var e;Q.reset(),h.push("PayWithExchange",{redirectView:(e=h.state.data)==null?void 0:e.redirectView})}};Ye([u()],Te.prototype,"activeCaipNetwork",void 0);Ye([u()],Te.prototype,"features",void 0);Ye([u()],Te.prototype,"remoteFeatures",void 0);Ye([u()],Te.prototype,"exchangesLoading",void 0);Ye([u()],Te.prototype,"exchanges",void 0);Te=Ye([p("w3m-fund-wallet-view")],Te);const An=v`
1448  :host {
1449    display: flex;
1450    align-items: center;
1451    justify-content: center;
1452  }
1453
1454  label {
1455    position: relative;
1456    display: inline-block;
1457    user-select: none;
1458    transition:
1459      background-color ${({durations:t})=>t.lg}
1460        ${({easings:t})=>t["ease-out-power-2"]},
1461      color ${({durations:t})=>t.lg} ${({easings:t})=>t["ease-out-power-2"]},
1462      border ${({durations:t})=>t.lg} ${({easings:t})=>t["ease-out-power-2"]},
1463      box-shadow ${({durations:t})=>t.lg}
1464        ${({easings:t})=>t["ease-out-power-2"]},
1465      width ${({durations:t})=>t.lg} ${({easings:t})=>t["ease-out-power-2"]},
1466      height ${({durations:t})=>t.lg} ${({easings:t})=>t["ease-out-power-2"]},
1467      transform ${({durations:t})=>t.lg}
1468        ${({easings:t})=>t["ease-out-power-2"]},
1469      opacity ${({durations:t})=>t.lg} ${({easings:t})=>t["ease-out-power-2"]};
1470    will-change: background-color, color, border, box-shadow, width, height, transform, opacity;
1471  }
1472
1473  input {
1474    width: 0;
1475    height: 0;
1476    opacity: 0;
1477  }
1478
1479  span {
1480    position: absolute;
1481    cursor: pointer;
1482    top: 0;
1483    left: 0;
1484    right: 0;
1485    bottom: 0;
1486    background-color: ${({colors:t})=>t.neutrals300};
1487    border-radius: ${({borderRadius:t})=>t.round};
1488    border: 1px solid transparent;
1489    will-change: border;
1490    transition:
1491      background-color ${({durations:t})=>t.lg}
1492        ${({easings:t})=>t["ease-out-power-2"]},
1493      color ${({durations:t})=>t.lg} ${({easings:t})=>t["ease-out-power-2"]},
1494      border ${({durations:t})=>t.lg} ${({easings:t})=>t["ease-out-power-2"]},
1495      box-shadow ${({durations:t})=>t.lg}
1496        ${({easings:t})=>t["ease-out-power-2"]},
1497      width ${({durations:t})=>t.lg} ${({easings:t})=>t["ease-out-power-2"]},
1498      height ${({durations:t})=>t.lg} ${({easings:t})=>t["ease-out-power-2"]},
1499      transform ${({durations:t})=>t.lg}
1500        ${({easings:t})=>t["ease-out-power-2"]},
1501      opacity ${({durations:t})=>t.lg} ${({easings:t})=>t["ease-out-power-2"]};
1502    will-change: background-color, color, border, box-shadow, width, height, transform, opacity;
1503  }
1504
1505  span:before {
1506    content: '';
1507    position: absolute;
1508    background-color: ${({colors:t})=>t.white};
1509    border-radius: 50%;
1510  }
1511
1512  /* -- Sizes --------------------------------------------------------- */
1513  label[data-size='lg'] {
1514    width: 48px;
1515    height: 32px;
1516  }
1517
1518  label[data-size='md'] {
1519    width: 40px;
1520    height: 28px;
1521  }
1522
1523  label[data-size='sm'] {
1524    width: 32px;
1525    height: 22px;
1526  }
1527
1528  label[data-size='lg'] > span:before {
1529    height: 24px;
1530    width: 24px;
1531    left: 4px;
1532    top: 3px;
1533  }
1534
1535  label[data-size='md'] > span:before {
1536    height: 20px;
1537    width: 20px;
1538    left: 4px;
1539    top: 3px;
1540  }
1541
1542  label[data-size='sm'] > span:before {
1543    height: 16px;
1544    width: 16px;
1545    left: 3px;
1546    top: 2px;
1547  }
1548
1549  /* -- Focus states --------------------------------------------------- */
1550  input:focus-visible:not(:checked) + span,
1551  input:focus:not(:checked) + span {
1552    border: 1px solid ${({tokens:t})=>t.core.iconAccentPrimary};
1553    background-color: ${({tokens:t})=>t.theme.textTertiary};
1554    box-shadow: 0px 0px 0px 4px rgba(9, 136, 240, 0.2);
1555  }
1556
1557  input:focus-visible:checked + span,
1558  input:focus:checked + span {
1559    border: 1px solid ${({tokens:t})=>t.core.iconAccentPrimary};
1560    box-shadow: 0px 0px 0px 4px rgba(9, 136, 240, 0.2);
1561  }
1562
1563  /* -- Checked states --------------------------------------------------- */
1564  input:checked + span {
1565    background-color: ${({tokens:t})=>t.core.iconAccentPrimary};
1566  }
1567
1568  label[data-size='lg'] > input:checked + span:before {
1569    transform: translateX(calc(100% - 9px));
1570  }
1571
1572  label[data-size='md'] > input:checked + span:before {
1573    transform: translateX(calc(100% - 9px));
1574  }
1575
1576  label[data-size='sm'] > input:checked + span:before {
1577    transform: translateX(calc(100% - 7px));
1578  }
1579
1580  /* -- Hover states ------------------------------------------------------- */
1581  label:hover > input:not(:checked):not(:disabled) + span {
1582    background-color: ${({colors:t})=>t.neutrals400};
1583  }
1584
1585  label:hover > input:checked:not(:disabled) + span {
1586    background-color: ${({colors:t})=>t.accent080};
1587  }
1588
1589  /* -- Disabled state --------------------------------------------------- */
1590  label:has(input:disabled) {
1591    pointer-events: none;
1592    user-select: none;
1593  }
1594
1595  input:not(:checked):disabled + span {
1596    background-color: ${({colors:t})=>t.neutrals700};
1597  }
1598
1599  input:checked:disabled + span {
1600    background-color: ${({colors:t})=>t.neutrals700};
1601  }
1602
1603  input:not(:checked):disabled + span::before {
1604    background-color: ${({colors:t})=>t.neutrals400};
1605  }
1606
1607  input:checked:disabled + span::before {
1608    background-color: ${({tokens:t})=>t.theme.textTertiary};
1609  }
1610`;var Wt=function(t,e,i,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};let Ve=class extends f{constructor(){super(...arguments),this.inputElementRef=Zt(),this.checked=!1,this.disabled=!1,this.size="md"}render(){return l`
1611      <label data-size=${this.size}>
1612        <input
1613          ${ei(this.inputElementRef)}
1614          type="checkbox"
1615          ?checked=${this.checked}
1616          ?disabled=${this.disabled}
1617          @change=${this.dispatchChangeEvent.bind(this)}
1618        />
1619        <span></span>
1620      </label>
1621    `}dispatchChangeEvent(){var e;this.dispatchEvent(new CustomEvent("switchChange",{detail:(e=this.inputElementRef.value)==null?void 0:e.checked,bubbles:!0,composed:!0}))}};Ve.styles=[_,W,An];Wt([c({type:Boolean})],Ve.prototype,"checked",void 0);Wt([c({type:Boolean})],Ve.prototype,"disabled",void 0);Wt([c()],Ve.prototype,"size",void 0);Ve=Wt([p("wui-toggle")],Ve);const In=v`
1622  :host {
1623    height: auto;
1624  }
1625
1626  :host > wui-flex {
1627    height: 100%;
1628    display: flex;
1629    align-items: center;
1630    justify-content: center;
1631    column-gap: ${({spacing:t})=>t[2]};
1632    padding: ${({spacing:t})=>t[2]} ${({spacing:t})=>t[3]};
1633    background-color: ${({tokens:t})=>t.theme.foregroundPrimary};
1634    border-radius: ${({borderRadius:t})=>t[4]};
1635    box-shadow: inset 0 0 0 1px ${({tokens:t})=>t.theme.foregroundPrimary};
1636    transition: background-color ${({durations:t})=>t.lg}
1637      ${({easings:t})=>t["ease-out-power-2"]};
1638    will-change: background-color;
1639    cursor: pointer;
1640  }
1641
1642  wui-switch {
1643    pointer-events: none;
1644  }
1645`;var Wi=function(t,e,i,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;
1645a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};let gt=class extends f{constructor(){super(...arguments),this.checked=!1}render(){return l`
1646      <wui-flex>
1647        <wui-icon size="xl" name="walletConnectBrown"></wui-icon>
1648        <wui-toggle
1649          ?checked=${this.checked}
1650          size="sm"
1651          @switchChange=${this.handleToggleChange.bind(this)}
1652        ></wui-toggle>
1653      </wui-flex>
1654    `}handleToggleChange(e){e.stopPropagation(),this.checked=e.detail,this.dispatchSwitchEvent()}dispatchSwitchEvent(){this.dispatchEvent(new CustomEvent("certifiedSwitchChange",{detail:this.checked,bubbles:!0,composed:!0}))}};gt.styles=[_,W,In];Wi([c({type:Boolean})],gt.prototype,"checked",void 0);gt=Wi([p("wui-certified-switch")],gt);const _n=v`
1655  :host {
1656    position: relative;
1657    display: inline-block;
1658    width: 100%;
1659  }
1660
1661  wui-icon {
1662    position: absolute;
1663    top: 50%;
1664    transform: translateY(-50%);
1665    right: ${({spacing:t})=>t[3]};
1666    color: ${({tokens:t})=>t.theme.iconDefault};
1667    cursor: pointer;
1668    padding: ${({spacing:t})=>t[2]};
1669    background-color: transparent;
1670    border-radius: ${({borderRadius:t})=>t[4]};
1671    transition: background-color ${({durations:t})=>t.lg}
1672      ${({easings:t})=>t["ease-out-power-2"]};
1673  }
1674
1675  @media (hover: hover) {
1676    wui-icon:hover {
1677      background-color: ${({tokens:t})=>t.theme.foregroundSecondary};
1678    }
1679  }
1680`;var Ni=function(t,e,i,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};let yt=class extends f{constructor(){super(...arguments),this.inputComponentRef=Zt(),this.inputValue=""}render(){return l`
1681      <wui-input-text
1682        ${ei(this.inputComponentRef)}
1683        placeholder="Search wallet"
1684        icon="search"
1685        type="search"
1686        enterKeyHint="search"
1687        size="sm"
1688        @inputChange=${this.onInputChange}
1689      >
1690        ${this.inputValue?l`<wui-icon
1691              @click=${this.clearValue}
1692              color="inherit"
1693              size="sm"
1694              name="close"
1695            ></wui-icon>`:null}
1696      </wui-input-text>
1697    `}onInputChange(e){this.inputValue=e.detail||""}clearValue(){const e=this.inputComponentRef.value,i=e==null?void 0:e.inputElementRef.value;i&&(i.value="",this.inputValue="",i.focus(),i.dispatchEvent(new Event("input")))}};yt.styles=[_,_n];Ni([c()],yt.prototype,"inputValue",void 0);yt=Ni([p("wui-search-bar")],yt);const Rn=v`
1698  :host {
1699    display: flex;
1700    flex-direction: column;
1701    justify-content: center;
1702    align-items: center;
1703    height: 104px;
1704    width: 104px;
1705    row-gap: ${({spacing:t})=>t[2]};
1706    background-color: ${({tokens:t})=>t.theme.foregroundPrimary};
1707    border-radius: ${({borderRadius:t})=>t[5]};
1708    position: relative;
1709  }
1710
1711  wui-shimmer[data-type='network'] {
1712    border: none;
1713    -webkit-clip-path: var(--apkt-path-network);
1714    clip-path: var(--apkt-path-network);
1715  }
1716
1717  svg {
1718    position: absolute;
1719    width: 48px;
1720    height: 54px;
1721    z-index: 1;
1722  }
1723
1724  svg > path {
1725    stroke: ${({tokens:t})=>t.theme.foregroundSecondary};
1726    stroke-width: 1px;
1727  }
1728
1729  @media (max-width: 350px) {
1730    :host {
1731      width: 100%;
1732    }
1733  }
1734`;var Oi=function(t,e,i,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};let xt=class extends f{constructor(){super(...arguments),this.type="wallet"}render(){return l`
1735      ${this.shimmerTemplate()}
1736      <wui-shimmer width="80px" height="20px"></wui-shimmer>
1737    `}shimmerTemplate(){return this.type==="network"?l` <wui-shimmer data-type=${this.type} width="48px" height="54px"></wui-shimmer>
1738        ${Zi}`:l`<wui-shimmer width="56px" height="56px"></wui-shimmer>`}};xt.styles=[_,W,Rn];Oi([c()],xt.prototype,"type",void 0);xt=Oi([p("wui-card-select-loader")],xt);const Tn=ee`
1739  :host {
1740    display: grid;
1741    width: inherit;
1742    height: inherit;
1743  }
1744`;
1744var ne=function(t,e,i,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};let V=class extends f{render(){return this.style.cssText=`
1745      grid-template-rows: ${this.gridTemplateRows};
1746      grid-template-columns: ${this.gridTemplateColumns};
1747      justify-items: ${this.justifyItems};
1748      align-items: ${this.alignItems};
1749      justify-content: ${this.justifyContent};
1750      align-content: ${this.alignContent};
1751      column-gap: ${this.columnGap&&`var(--apkt-spacing-${this.columnGap})`};
1752      row-gap: ${this.rowGap&&`var(--apkt-spacing-${this.rowGap})`};
1753      gap: ${this.gap&&`var(--apkt-spacing-${this.gap})`};
1754      padding-top: ${this.padding&&F.getSpacingStyles(this.padding,0)};
1755      padding-right: ${this.padding&&F.getSpacingStyles(this.padding,1)};
1756      padding-bottom: ${this.padding&&F.getSpacingStyles(this.padding,2)};
1757      padding-left: ${this.padding&&F.getSpacingStyles(this.padding,3)};
1758      margin-top: ${this.margin&&F.getSpacingStyles(this.margin,0)};
1759      margin-right: ${this.margin&&F.getSpacingStyles(this.margin,1)};
1760      margin-bottom: ${this.margin&&F.getSpacingStyles(this.margin,2)};
1761      margin-left: ${this.margin&&F.getSpacingStyles(this.margin,3)};
1762    `,l`<slot></slot>`}};V.styles=[_,Tn];ne([c()],V.prototype,"gridTemplateRows",void 0);ne([c()],V.prototype,"gridTemplateColumns",void 0);ne([c()],V.prototype,"justifyItems",void 0);ne([c()],V.prototype,"alignItems",void 0);ne([c()],V.prototype,"justifyContent",void 0);ne([c()],V.prototype,"alignContent",void 0);ne([c()],V.prototype,"columnGap",void 0);ne([c()],V.prototype,"rowGap",void 0);ne([c()],V.prototype,"gap",void 0);ne([c()],V.prototype,"padding",void 0);ne([c()],V.prototype,"margin",void 0);V=ne([p("wui-grid")],V);const Wn=v`
1763  button {
1764    display: flex;
1765    flex-direction: column;
1766    justify-content: center;
1767    align-items: center;
1768    cursor: pointer;
1769    width: 104px;
1770    row-gap: ${({spacing:t})=>t[2]};
1771    padding: ${({spacing:t})=>t[3]} ${({spacing:t})=>t[0]};
1772    background-color: ${({tokens:t})=>t.theme.foregroundPrimary};
1773    border-radius: clamp(0px, ${({borderRadius:t})=>t[4]}, 20px);
1774    transition:
1775      color ${({durations:t})=>t.lg} ${({easings:t})=>t["ease-out-power-1"]},
1776      background-color ${({durations:t})=>t.lg}
1777        ${({easings:t})=>t["ease-out-power-1"]},
1778      border-radius ${({durations:t})=>t.lg}
1779        ${({easings:t})=>t["ease-out-power-1"]};
1780    will-change: background-color, color, border-radius;
1781    outline: none;
1782    border: none;
1783  }
1784
1785  button > wui-flex > wui-text {
1786    color: ${({tokens:t})=>t.theme.textPrimary};
1787    max-width: 86px;
1788    white-space: nowrap;
1789    overflow: hidden;
1790    text-overflow: ellipsis;
1791    justify-content: center;
1792  }
1793
1794  button > wui-flex > wui-text.certified {
1795    max-width: 66px;
1796  }
1797
1798  @media (hover: hover) and (pointer: fine) {
1799    button:hover:enabled {
1800      background-color: ${({tokens:t})=>t.theme.foregroundSecondary};
1801    }
1802  }
1803
1804  button:disabled > wui-flex > wui-text {
1805    color: ${({tokens:t})=>t.core.glass010};
1806  }
1807
1808  [data-selected='true'] {
1809    background-color: ${({colors:t})=>t.accent020};
1810  }
1811
1812  @media (hover: hover) and (pointer: fine) {
1813    [data-selected='true']:hover:enabled {
1814      background-color: ${({colors:t})=>t.accent010};
1815    }
1816  }
1817
1818  [data-selected='true']:active:enabled {
1819    background-color: ${({colors:t})=>t.accent010};
1820  }
1821
1822  @media (max-width: 350px) {
1823    button {
1824      width: 100%;
1825    }
1826  }
1827`;var ue=function(t,e,i,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};let Z=class extends f{constructor(){super(),this.observer=new IntersectionObserver(()=>{}),this.visible=!1,this.imageSrc=void 0,this.imageLoading=!1,this.isImpressed=!1,this.explorerId="",this.walletQuery="",this.certified=!1,this.displayIndex=0,this.wallet=void 0,this.observer=new IntersectionObserver(e=>{e.forEach(i=>
1827{i.isIntersecting?(this.visible=!0,this.fetchImageSrc(),this.sendImpressionEvent()):this.visible=!1})},{threshold:.01})}firstUpdated(){this.observer.observe(this)}disconnectedCallback(){this.observer.disconnect()}render(){var i,o;const e=((i=this.wallet)==null?void 0:i.badge_type)==="certified";return l`
1828      <button>
1829        ${this.imageTemplate()}
1830        <wui-flex flexDirection="row" alignItems="center" justifyContent="center" gap="1">
1831          <wui-text
1832            variant="md-regular"
1833            color="inherit"
1834            class=${w(e?"certified":void 0)}
1835            >${(o=this.wallet)==null?void 0:o.name}</wui-text
1836          >
1837          ${e?l`<wui-icon size="sm" name="walletConnectBrown"></wui-icon>`:null}
1838        </wui-flex>
1839      </button>
1840    `}imageTemplate(){var e,i;return!this.visible&&!this.imageSrc||this.imageLoading?this.shimmerTemplate():l`
1841      <wui-wallet-image
1842        size="lg"
1843        imageSrc=${w(this.imageSrc)}
1844        name=${w((e=this.wallet)==null?void 0:e.name)}
1845        .installed=${((i=this.wallet)==null?void 0:i.installed)??!1}
1846        badgeSize="sm"
1847      >
1848      </wui-wallet-image>
1849    `}shimmerTemplate(){return l`<wui-shimmer width="56px" height="56px"></wui-shimmer>`}async fetchImageSrc(){this.wallet&&(this.imageSrc=S.getWalletImage(this.wallet),!this.imageSrc&&(this.imageLoading=!0,this.imageSrc=await S.fetchWalletImage(this.wallet.image_id),this.imageLoading=!1))}sendImpressionEvent(){!this.wallet||this.isImpressed||(this.isImpressed=!0,C.sendWalletImpressionEvent({name:this.wallet.name,walletRank:this.wallet.order,explorerId:this.explorerId,view:h.state.view,query:this.walletQuery,certified:this.certified,displayIndex:this.displayIndex}))}};Z.styles=Wn;ue([u()],Z.prototype,"visible",void 0);ue([u()],Z.prototype,"imageSrc",void 0);ue([u()],Z.prototype,"imageLoading",void 0);ue([u()],Z.prototype,"isImpressed",void 0);ue([c()],Z.prototype,"explorerId",void 0);ue([c()],Z.prototype,"walletQuery",void 0);ue([c()],Z.prototype,"certified",void 0);ue([c()],Z.prototype,"displayIndex",void 0);ue([c({type:Object})],Z.prototype,"wallet",void 0);Z=ue([p("w3m-all-wallets-list-item")],Z);const Nn=v`
1850  wui-grid {
1851    max-height: clamp(360px, 400px, 80vh);
1852    overflow: scroll;
1853    scrollbar-width: none;
1854    grid-auto-rows: min-content;
1855    grid-template-columns: repeat(auto-fill, 104px);
1856  }
1857
1858  :host([data-mobile-fullscreen='true']) wui-grid {
1859    max-height: none;
1860  }
1861
1862  @media (max-width: 350px) {
1863    wui-grid {
1864      grid-template-columns: repeat(2, 1fr);
1865    }
1866  }
1867
1868  wui-grid[data-scroll='false'] {
1869    overflow: hidden;
1870  }
1871
1872  wui-grid::-webkit-scrollbar {
1873    display: none;
1874  }
1875
1876  w3m-all-wallets-list-item {
1877    opacity: 0;
1878    animation-duration: ${({durations:t})=>t.xl};
1879    animation-timing-function: ${({easings:t})=>t["ease-inout-power-2"]};
1880    animation-name: fade-in;
1881    animation-fill-mode: forwards;
1882  }
1883
1884  @keyframes fade-in {
1885    from {
1886      opacity: 0;
1887    }
1888    to {
1889      opacity: 1;
1890    }
1891  }
1892
1893  wui-loading-spinner {
1894    padding-top: ${({spacing:t})=>t[4]};
1895    padding-bottom: ${({spacing:t})=>t[4]};
1896    justify-content: center;
1897    grid-column: 1 / span 4;
1898  }
1899`;var ut=function(t,e,i,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};const bi="local-paginator";let We=class extends f{constructor(){super(),this.unsubscribe=[],this.paginationObserver=void 0,this.loading=!I.state.wallets.length,this.wallets=I.state.wallets,this.mobileFullScreen=m.state.enableMobileFullScreen,this.unsubscribe.push(I.subscribeKey("wallets",e=>this.wallets=e))}firstUpdated(){this.initialFetch(),this.createPaginationObserver()}disconnectedCallback(){var e;this.unsubscribe.forEach(i=>i()),(e=this.paginationObserver)==null||e.disconnect()}render(){return this.mobileFullScreen&&this.setAttribute("data-mobile-fullscreen","true"),l`
1900      <wui-grid
1901        data-scroll=${!this.loading}
1902        .padding=${["0","3","3","3"]}
1903        gap="2"
1904        justifyContent="space-between"
1905      >
1906        ${this.loading?this.shimmerTemplate(16):this.walletsTemplate()}
1907        ${this.paginationLoaderTemplate()}
1908      </wui-grid>
1909    `}async initialFetch(){var i;this.loading=!0;const e=(i=this.shadowRoot)==null?void 0:i.querySelector("wui-grid");e&&(await I.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,i){return[...Array(e)].map(()=>l`
1910        <wui-card-select-loader type="wallet" id=${w(i)}></wui-card-select-loader>
1911      `)}walletsTemplate(){return tt.getWalletConnectWallets(this.wallets).map((e,i)=>l`
1912        <w3m-all-wallets-list-item
1913          data-testid="wallet-search-item-${e.id}"
1914          @click=${()=>this.onConnectWallet(e)}
1915          .wallet=${e}
1916          explorerId=${e.id}
1917          certified=${this.badge==="certified"}
1918          displayIndex=${i}
1919        ></w3m-all-wallets-list-item>
1920      `)}paginationLoaderTemplate(){const{wallets:e,recommended:i,featured:o,count:r,mobileFilteredOutWalletsLength:n}=I.state,s=window.innerWidth<352?3:4,a=e.length+i.length;let $=Math.ceil(a/s)*s-a+s;return $-=e.length?o.length%s:0,r===0&&o.length>0?null:r===0||[...o,...e,...i].length<r-(n??0)?this.shimmerTemplate($,bi):null}createPaginationObserver(){var i;const e=(i=this.shadowRoot)==null?void 0:i.querySelector(`#${bi}`);e&&(this.paginationObserver=new IntersectionObserver(([o])=>{if(o!=null&&o.isIntersecting&&!this.loading){const{page:r,count:n,wallets:s}=I.state;s.length<n&&I.fetchWalletsByPage({page:r+1})}}),this.paginationObserver.observe(e))}onConnectWallet(e){b.selectWalletConnector(e)}};We.styles=Nn;ut([u()],We.prototype,"loading",void 0);ut([u()],We.prototype,"wallets",void 0);ut([u()],We.prototype,"badge",void 0);ut([u()],We.prototype,"mobileFullScreen",void 0);We=ut([p("w3m-all-wallets-list")],We);const On=ee`
1921  wui-grid,
1922  wui-loading-spinner,
1923  wui-flex {
1924    height: 360px;
1925  }
1926
1927  wui-grid {
1928    overflow: scroll;
1929    scrollbar-width: none;
1930    grid-auto-rows: min-content;
1931    grid-template-columns: repeat(auto-fill, 104px);
1932  }
1933
1934  :host([data-mobile-fullscreen='true']) wui-grid {
1935    max-height: none;
1936    height: auto;
1937  }
1938
1939  wui-grid[data-scroll='false'] {
1940    overflow: hidden;
1941  }
1942
1943  wui-grid::-webkit-scrollbar {
1944    display: none;
1945  }
1946
1947  wui-loading-spinner {
1948    justify-content: center;
1949    align-items: center;
1950  }
1951
1952  @media (max-width: 350px) {
1953    wui-grid {
1954      grid-template-columns: repeat(2, 1fr);
1955    }
1956  }
1957`;var ht=function(t,e,i,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};let Ne=class extends f{constructor(){super(...arguments),this.prevQuery="",this.prevBadge=void 0,this.loading=!0,this.mobileFullScreen=m.state.enableMobileFullScreen,this.query=""}render(){return this.mobileFullScreen&&this.setAttribute("data-mobile-fullscreen","true"),this.onSearch(),this.loading?l`<wui-loading-spinner color="accent-primary"></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 I.searchWallet({search:this.query,badge:this.badge}),this.loading=!1)}walletsTemplate(){const{search:e}=I.state,i=tt.markWalletsAsInstalled(e),o=tt.filterWalletsByWcSupport(i);return o.length?l`
1958      <wui-grid
1959        data-testid="wallet-list"
1960        .padding=${["0","3","3","3"]}
1961        rowGap="4"
1962        columngap="2"
1963        justifyContent="space-between"
1964      >
1965        ${o.map((r,n)=>l`
1966            <w3m-all-wallets-list-item
1967              @click=${()=>this.onConnectWallet(r)}
1968              .wallet=${r}
1969              data-testid="wallet-search-item-${r.id}"
1970              explorerId=${r.id}
1971              certified=${this.badge==="certified"}
1972              walletQuery=${this.query}
1973              displayIndex=${n}
1974            ></w3m-all-wallets-list-item>
1975          `)}
1976      </wui-grid>
1977    `:l`
1978        <wui-flex
1979          data-testid="no-wallet-found"
1980          justifyContent="center"
1981          alignItems="center"
1982          gap="3"
1983          flexDirection="column"
1984        >
1985          <wui-icon-box size="lg" color="default" icon="wallet"></wui-icon-box>
1986          <wui-text data-testid="no-wallet-found-text" color="secondary" variant="md-medium">
1987            No Wallet found
1988          </wui-text>
1989        </wui-flex>
1990      `}onConnectWallet(e){b.selectWalletConnector(e)}};Ne.styles=On;ht([u()],Ne.prototype,"loading",void 0);ht([u()],Ne.prototype,"mobileFullScreen",void 0);ht([c()],Ne.prototype,"query",void 0);ht([c()],Ne.prototype,"badge",void 0);Ne=ht([p("w3m-all-wallets-search")],Ne);var ni=function(t,e,i,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};let vt=class extends f{constructor(){super(...arguments),this.search="",this.badge=void 0,this.onDebouncedSearch=y.debounce(e=>{this.search=e})}render(){const e=this.search.length>=2;return l`
1991      <wui-flex .padding=${["1","3","3","3"]} gap="2" alignItems="center">
1992        <wui-search-bar @inputChange=${this.onInputChange.bind(this)}></wui-search-bar>
1993        <wui-certified-switch
1994          ?checked=${this.badge==="certified"}
1995          @certifiedSwitchChange=${this.onCertifiedSwitchChange.bind(this)}
1996          data-testid="wui-certified-switch"
1997        ></wui-certified-switch>
1998        ${this.qrButtonTemplate()}
1999      </wui-flex>
2000      ${e||this.badge?l`<w3m-all-wallets-search
2001            query=${this.search}
2002            .badge=${this.badge}
2003          ></w3m-all-wallets-search>`:l`<w3m-all-wallets-list .badge=${this.badge}></w3m-all-wallets-list>`}
2004    `}onInputChange(e){this.onDebouncedSearch(e.detail)}onCertifiedSwitchChange(e){e.detail?(this.badge="certified",A.showSvg("Only WalletConnect certified",{icon:"walletConnectBrown",iconColor:"accent-100"})):this.badge=void 0}qrButtonTemplate(){return y.isMobile()?l`
2005        <wui-icon-box
2006          size="xl"
2007          iconSize="xl"
2008          color="accent-primary"
2009          icon="qrCode"
2010          border
2011          borderColor="wui-accent-glass-010"
2012          @click=${this.onWalletConnectQr.bind(this)}
2013        ></wui-icon-box>
2014      `:null}onWalletConnectQr(){h.push("ConnectingWalletConnect")}};ni([u()],vt.prototype,"search",void 0);ni([u()],vt.prototype,"badge",void 0);vt=ni([p("w3m-all-wallets-view")],vt);const Pn=v`
2015  button {
2016    display: flex;
2017    gap: ${({spacing:t})=>t[1]};
2018    padding: ${({spacing:t})=>t[4]};
2019    width: 100%;
2020    background-color: ${({tokens:t})=>t.theme.foregroundPrimary};
2021    border-radius: ${({borderRadius:t})=>t[4]};
2022    justify-content: center;
2023    align-items: center;
2024  }
2025
2026  :host([data-size='sm']) button {
2027    padding: ${({spacing:t})=>t[2]};
2028    border-radius: ${({borderRadius:t})=>t[2]};
2029  }
2030
2031  :host([data-size='md']) button {
2032    padding: ${({spacing:t})=>t[3]};
2033    border-radius: ${({borderRadius:t})=>t[3]};
2034  }
2035
2036  button:hover {
2037    background-color: ${({tokens:t})=>t.theme.foregroundSecondary};
2038  }
2039
2040  button:disabled {
2041    opacity: 0.5;
2042  }
2043`;var Qe=function(t,e,i,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};let ye=class extends f{constructor(){super(...arguments),this.text="",this.disabled=!1,this.size="lg",this.icon="copy",this.tabIdx=void 0}render(){this.dataset.size=this.size;const e=`${this.size}-regular`;return l`
2044      <button ?disabled=${this.disabled} tabindex=${w(this.tabIdx)}>
2045        <wui-icon name=${this.icon} size=${this.size} color="default"></wui-icon>
2046        <wui-text align="center" variant=${e} color="primary">${this.text}</wui-text>
2047      </button>
2048    `}};ye.styles=[_,W,Pn];Qe([c()],ye.prototype,"text",void 0);Qe([c({type:Boolean})],ye.prototype,"disabled",void 0);Qe([c()],ye.prototype,"size",void 0);Qe([c()],ye.prototype,"icon",void 0);Qe([c()],ye.prototype,"tabIdx",void 0);ye=Qe([p("wui-list-button")],ye);const Dn=v`
2049  wui-separator {
2050    margin: ${({spacing:t})=>t[3]} calc(${({spacing:t})=>t[3]} * -1);
2051    width: calc(100% + ${({spacing:t})=>t[3]} * 2);
2052  }
2053
2054  wui-email-input {
2055    width: 100%;
2056  }
2057
2058  form {
2059    width: 100%;
2060    display: block;
2061    position: relative;
2062  }
2063
2064  wui-icon-link,
2065  wui-loading-spinner {
2066    position: absolute;
2067    top: 50%;
2068    transform: translateY(-50%);
2069  }
2070
2071  wui-icon-link {
2072    right: ${({spacing:t})=>t[2]};
2073  }
2074
2075  wui-loading-spinner {
2076    right: ${({spacing:t})=>t[3]};
2077  }
2078
2079  wui-text {
2080    margin: ${({spacing:t})=>t[2]} ${({spacing:t})=>t[3]}
2081      ${({spacing:t})=>t[0]} ${({spacing:t})=>t[3]};
2082  }
2083`;var Be=function(t,e,i,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};let pe=class extends f{constructor(){super(),this.unsubscribe=[],this.formRef=Zt(),this.email="",this.loading=!1,this.error="",this.remoteFeatures=m.state.remoteFeatures,this.hasExceededUsageLimit=I.state.plan.hasExceededUsageLimit,this.unsubscribe.push(m.subscribeKey("remoteFeatures",e=>{this.remoteFeatures=e}),I.subscribeKey("plan",e=>this.hasExceededUsageLimit=e.hasExceededUsageLimit))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}firstUpdated(){var e;(e=this.formRef.value)==null||e.addEventListener("keydown",i=>{i.key==="Enter"&&this.onSubmitEmail(i)})}render(){const e=x.hasAnyConnection(E.CONNECTOR_ID.AUTH);return l`
2084      <form ${ei(this.formRef)} @submit=${this.onSubmitEmail.bind(this)}>
2085        <wui-email-input
2086          @focus=${this.onFocusEvent.bind(this)}
2087          .disabled=${this.loading}
2088          @inputChange=${this.onEmailInputChange.bind(this)}
2089          tabIdx=${w(this.tabIdx)}
2090          ?disabled=${e||this.hasExceededUsageLimit}
2091        >
2092        </wui-email-input>
2093
2094        ${this.submitButtonTemplate()}${this.loadingTemplate()}
2095        <input type="submit" hidden />
2096      </form>
2097      ${this.templateError()}
2098    `}submitButtonTemplate(){return!this.loading&&this.email.length>3?l`
2099          <wui-icon-link
2100            size="lg"
2101            icon="chevronRight"
2102            iconcolor="accent-100"
2103            @click=${this.onSubmitEmail.bind(this)}
2104          >
2105          </wui-icon-link>
2106        `:null}loadingTemplate(){return this.loading?l`<wui-loading-spinner size="md" color="accent-primary"></wui-loading-spinner>`:null}templateError(){return this.error?l`<wui-text variant="sm-medium" color="error">${this.error}</wui-text>`:null}onEmailInputChange(e){this.email=e.detail.trim(),this.error=""}async onSubmitEmail(e){var o;if(!Jt.isValidEmail(this.email)){Ii.open({displayMessage:Ki.ALERT_WARNINGS.INVALID_EMAIL.displayMessage},"warning");return}if(!E.AUTH_CONNECTOR_SUPPORTED_CHAINS.find(r=>r===d.state.activeChain)){const r=d.getFirstCaipNetworkSupportsAuthConnector();if(r){h.push("SwitchNetwork",{network:r});return}}try{if(this.loading)return;this.loading=!0,e.preventDefault();const r=b.getAuthConnector();if(!r)throw new Error("w3m-email-login-widget: Auth connector not found");const{action:n}=await r.provider.connectEmail({email:this.email});if(C.sendEvent({type:"track",event:"EMAIL_SUBMITTED"}),n==="VERIFY_OTP")C.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_SENT"}),h.push("EmailVerifyOtp",{email:this.email});else if(n==="VERIFY_DEVICE")h.push("EmailVerifyDevice",{email:this.email});else if(n==="CONNECT"){const s=(o=this.remoteFeatures)==null?void 0:o.multiWallet;await x.connectExternal(r,d.state.activeChain),s?(h.replace("ProfileWallets"),A.showSuccess("New Wallet Added")):h.replace("Account")}}catch(r){const n=y.parseError(r);n!=null&&n.includes("Invalid email")?this.error="Invalid email. Try again.":A.showError(r)}finally{this.loading=!1}}onFocusEvent(){C.sendEvent({type:"track",event:"EMAIL_LOGIN_SELECTED"})}};pe.styles=Dn;Be([c()],pe.prototype,"tabIdx",void 0);Be([u()],pe.prototype,"email",void 0);Be([u()],pe.prototype,"loading",void 0);Be([u()],pe.prototype,"error",void 0);Be([u()],pe.prototype,"remoteFeatures",void 0);Be([u()],pe.prototype,"hasExceededUsageLimit",void 0);pe=Be([p("w3m-email-login-widget")],pe);const Ln=v`
2107  :host {
2108    display: block;
2109    width: 100%;
2110  }
2111
2112  button {
2113    width: 100%;
2114    height: 52px;
2115    display: flex;
2116    align-items: center;
2117    justify-content: center;
2118    background: ${({tokens:t})=>t.theme.foregroundPrimary};
2119    border-radius: ${({borderRadius:t})=>t[4]};
2120  }
2121
2122  @media (hover: hover) {
2123    button:hover:enabled {
2124      background: ${({tokens:t})=>t.theme.foregroundSecondary};
2125    }
2126  }
2127
2128  button:disabled {
2129    cursor: not-allowed;
2130    opacity: 0.5;
2131  }
2132`;var Nt=function(t,e,i,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};let He=class extends f{constructor(){super(...arguments),this.logo="google",this.disabled=!1,this.tabIdx=void 0}render(){return l`
2133      <button ?disabled=${this.disabled} tabindex=${w(this.tabIdx)}>
2134        <wui-icon size="xxl" name=${this.logo}></wui-icon>
2135      </button>
2136    `}};He.styles=[_,W,Ln];Nt([c()],He.prototype,"logo",void 0);Nt([c({type:Boolean})],He.prototype,"disabled",void 0);Nt([c()],He.prototype,"tabIdx",void 0);He=Nt([p("wui-logo-select")],He);const jn=v`
2137  wui-separator {
2138    margin: ${({spacing:t})=>t[3]} calc(${({spacing:t})=>t[3]} * -1)
2139      ${({spacing:t})=>t[3]} calc(${({spacing:t})=>t[3]} * -1);
2140    width: calc(100% + ${({spacing:t})=>t[3]} * 2);
2141  }
2142`;var Ce=function(t,e,i,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};const gi=2,yi=6;let ce=class extends f{constructor(){super(),this.unsubscribe=[],this.walletGuide="get-started",this.tabIdx=void 0,this.connectors=b.state.connectors,this.remoteFeatures=m.state.remoteFeatures,this.authConnector=this.connectors.find(e=>e.type==="AUTH"),this.isPwaLoading=!1,this.hasExceededUsageLimit=I.state.plan.hasExceededUsageLimit,this.unsubscribe.push(b.subscribeKey("connectors",e=>{this.connectors=e,this.authConnector=this.connectors.find(i=>i.type==="AUTH")}),m.subscribeKey("remoteFeatures",e=>this.remoteFeatures=e),I.subscribeKey("plan",e=>this.hasExceededUsageLimit=e.hasExceededUsageLimit))}connectedCallback(){super.connectedCallback(),this.handlePwaFrameLoad()}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return l`
2143      <wui-flex
2144        class="container"
2145        flexDirection="column"
2146        gap="2"
2147        data-testid="w3m-social-login-widget"
2148      >
2149        ${this.topViewTemplate()}${this.bottomViewTemplate()}
2150      </wui-flex>
2151    `}topViewTemplate(){var o;const e=this.walletGuide==="explore";let i=(o=this.remoteFeatures)==null?void 0:o.socials;return!i&&e?(i=D.DEFAULT_SOCIALS,this.renderTopViewContent(i)):i?this.renderTopViewContent(i):null}renderTopViewContent(e){return e.length===2?l` <wui-flex gap="2">
2152        ${e.slice(0,gi).map(i=>l`<wui-logo-select
2153              data-testid=${`social-selector-${i}`}
2154              @click=${()=>{this.onSocialClick(i)}}
2155              logo=${i}
2156              tabIdx=${w(this.tabIdx)}
2157              ?disabled=${this.isPwaLoading||this.hasConnection()}
2158            ></wui-logo-select>`)}
2159      </wui-flex>`:l` <wui-list-button
2160      data-testid=${`social-selector-${e[0]}`}
2161      @click=${()=>{this.onSocialClick(e[0])}}
2162      size="lg"
2163      icon=${w(e[0])}
2164      text=${`Continue with ${F.capitalize(e[0])}`}
2165      tabIdx=${w(this.tabIdx)}
2166      ?disabled=${this.isPwaLoading||this.hasConnection()}
2167    ></wui-list-button>`}bottomViewTemplate(){var r;let e=(r=this.remoteFeatures)==null?void 0:r.socials;const i=this.walletGuide==="explore";return(!this.authConnector||!e||e.length===0)&&i&&(e=D.DEFAULT_SOCIALS),!e||e.length<=gi?null:e&&e.length>yi?l`<wui-flex gap="2">
2168        ${e.slice(1,yi-1).map(n=>l`<wui-logo-select
2169              data-testid=${`social-selector-${n}`}
2170              @click=${()=>{this.onSocialClick(n)}}
2171              logo=${n}
2172              tabIdx=${w(this.tabIdx)}
2173              ?focusable=${this.tabIdx!==void 0&&this.tabIdx>=0}
2174              ?disabled=${this.isPwaLoading||this.hasConnection()}
2175            ></wui-logo-select>`)}
2176        <wui-logo-select
2177          logo="more"
2178          tabIdx=${w(this.tabIdx)}
2179          @click=${this.onMoreSocialsClick.bind(this)}
2180          ?disabled=${this.isPwaLoading||this.hasConnection()}
2181          data-testid="social-selector-more"
2182        ></wui-logo-select>
2183      </wui-flex>`:e?l`<wui-flex gap="2">
2184      ${e.slice(1,e.length).map(n=>l`<wui-logo-select
2185            data-testid=${`social-selector-${n}`}
2186            @click=${()=>{this.onSocialClick(n)}}
2187            logo=${n}
2188            tabIdx=${w(this.tabIdx)}
2189            ?focusable=${this.tabIdx!==void 0&&this.tabIdx>=0}
2190            ?disabled=${this.isPwaLoading||this.hasConnection()}
2191          ></wui-logo-select>`)}
2192    </wui-flex>`:null}onMoreSocialsClick(){h.push("ConnectSocials")}async onSocialClick(e){if(this.hasExceededUsageLimit){h.push("UsageExceeded");return}if(!E.AUTH_CONNECTOR_SUPPORTED_CHAINS.find(o=>o===d.state.activeChain)){const o=d.getFirstCaipNetworkSupportsAuthConnector();if(o){h.push("SwitchNetwork",{network:o});return}}e&&await en(e)}async handlePwaFrameLoad(){var e;if(y.isPWA()){this.isPwaLoading=!0;try{((e=this.authConnector)==null?void 0:e.provider)instanceof Gi&&await this.authConnector.provider.init()}catch(i){Ii.open({displayMessage:"Error loading embedded wallet in PWA",debugMessage:i.message},"error")}finally{this.isPwaLoading=!1}}}hasConnection(){return x.hasAnyConnection(E.CONNECTOR_ID.AUTH)}};ce.styles=jn;Ce([c()],ce.prototype,"walletGuide",void 0);Ce([c()],ce.prototype,"tabIdx",void 0);Ce([u()],ce.prototype,"connectors",void 0);Ce([u()],ce.prototype,"remoteFeatures",void 0);Ce([u()],ce.prototype,"authConnector",void 0);Ce([u()],ce.prototype,"isPwaLoading",void 0);Ce([u()],ce.prototype,"hasExceededUsageLimit",void 0);ce=Ce([p("w3m-social-login-widget")],ce);
2192var Je=function(t,e,i,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};let Oe=class extends f{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=b.state.connectors,this.count=I.state.count,this.filteredCount=I.state.filteredWallets.length,this.isFetchingRecommendedWallets=I.state.isFetchingRecommendedWallets,this.unsubscribe.push(b.subscribeKey("connectors",e=>this.connectors=e),I.subscribeKey("count",e=>this.count=e),I.subscribeKey("filteredWallets",e=>this.filteredCount=e.length),I.subscribeKey("isFetchingRecommendedWallets",e=>this.isFetchingRecommendedWallets=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const e=this.connectors.find($=>$.id==="walletConnect"),{allWallets:i}=m.state;if(!e||i==="HIDE"||i==="ONLY_MOBILE"&&!y.isMobile())return null;const o=I.state.featured.length,r=this.count+o,n=r<10?r:Math.floor(r/10)*10,s=this.filteredCount>0?this.filteredCount:n;let a=`${s}`;this.filteredCount>0?a=`${this.filteredCount}`:s<r&&(a=`${s}+`);const g=x.hasAnyConnection(E.CONNECTOR_ID.WALLET_CONNECT);return l`
2193      <wui-list-wallet
2194        name="Search Wallet"
2195        walletIcon="search"
2196        showAllWallets
2197        @click=${this.onAllWallets.bind(this)}
2198        tagLabel=${a}
2199        tagVariant="info"
2200        data-testid="all-wallets"
2201        tabIdx=${w(this.tabIdx)}
2202        .loading=${this.isFetchingRecommendedWallets}
2203        ?disabled=${g}
2204        size="sm"
2205      ></wui-list-wallet>
2206    `}onAllWallets(){var e;C.sendEvent({type:"track",event:"CLICK_ALL_WALLETS"}),h.push("AllWallets",{redirectView:(e=h.state.data)==null?void 0:e.redirectView})}};Je([c()],Oe.prototype,"tabIdx",void 0);Je([u()],Oe.prototype,"connectors",void 0);Je([u()],Oe.prototype,"count",void 0);Je([u()],Oe.prototype,"filteredCount",void 0);Je([u()],Oe.prototype,"isFetchingRecommendedWallets",void 0);Oe=Je([p("w3m-all-wallets-widget")],Oe);const Bn=v`
2207  :host {
2208    margin-top: ${({spacing:t})=>t[1]};
2209  }
2210  wui-separator {
2211    margin: ${({spacing:t})=>t[3]} calc(${({spacing:t})=>t[3]} * -1)
2212      ${({spacing:t})=>t[2]} calc(${({spacing:t})=>t[3]} * -1);
2213    width: calc(100% + ${({spacing:t})=>t[3]} * 2);
2214  }
2215`;var Ze=function(t,e,i,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};let xe=class extends f{constructor(){super(),this.unsubscribe=[],this.explorerWallets=I.state.explorerWallets,this.connections=x.state.connections,this.connectorImages=Ee.state.connectorImages,this.loadingTelegram=!1,this.unsubscribe.push(x.subscribeKey("connections",e=>this.connections=e),Ee.subscribeKey("connectorImages",e=>this.connectorImages=e),I.subscribeKey("explorerFilteredWallets",e=>{this.explorerWallets=e!=null&&e.length?e:I.state.explorerWallets}),I.subscribeKey("explorerWallets",e=>{var i;(i=this.explorerWallets)!=null&&i.length||(this.explorerWallets=e)})),y.isTelegram()&&y.isIos()&&(this.loadingTelegram=!x.state.wcUri,this.unsubscribe.push(x.subscribeKey("wcUri",e=>this.loadingTelegram=!e)))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return l`
2216      <wui-flex flexDirection="column" gap="2"> ${this.connectorListTemplate()} </wui-flex>
2217    `}connectorListTemplate(){return Xt.connectorList().map((e,i)=>e.kind==="connector"?this.renderConnector(e,i):this.renderWallet(e,i))}getConnectorNamespaces(e){var i;return e.subtype==="walletConnect"?[]:e.subtype==="multiChain"?((i=e.connector.connectors)==null?void 0:i.map(o=>o.chain))||[]:[e.connector.chain]}renderConnector(e,i){var R,O;const o=e.connector,r=S.getConnectorImage(o)||this.connectorImages[(o==null?void 0:o.imageId)??""],s=(this.connections.get(o.chain)??[]).some(Lt=>J.isLowerCaseMatch(Lt.connectorId,o.id));let a,g;e.subtype==="walletConnect"?(a="qr code",g="accent"):e.subtype==="injected"||e.subtype==="announced"?(a=s?"connected":"installed",g
2217=s?"info":"success"):(a=void 0,g=void 0);const $=x.hasAnyConnection(E.CONNECTOR_ID.WALLET_CONNECT),k=e.subtype==="walletConnect"||e.subtype==="external"?$:!1;return l`
2218      <w3m-list-wallet
2219        displayIndex=${i}
2220        imageSrc=${w(r)}
2221        .installed=${!0}
2222        name=${o.name??"Unknown"}
2223        .tagVariant=${g}
2224        tagLabel=${w(a)}
2225        data-testid=${`wallet-selector-${o.id.toLowerCase()}`}
2226        size="sm"
2227        @click=${()=>this.onClickConnector(e)}
2228        tabIdx=${w(this.tabIdx)}
2229        ?disabled=${k}
2230        rdnsId=${w(((R=o.explorerWallet)==null?void 0:R.rdns)||void 0)}
2231        walletRank=${w((O=o.explorerWallet)==null?void 0:O.order)}
2232        .namespaces=${this.getConnectorNamespaces(e)}
2233      >
2234      </w3m-list-wallet>
2235    `}onClickConnector(e){var o;const i=(o=h.state.data)==null?void 0:o.redirectView;if(e.subtype==="walletConnect"){b.setActiveConnector(e.connector),y.isMobile()?h.push("AllWallets"):h.push("ConnectingWalletConnect",{redirectView:i});return}if(e.subtype==="multiChain"){b.setActiveConnector(e.connector),h.push("ConnectingMultiChain",{redirectView:i});return}if(e.subtype==="injected"){b.setActiveConnector(e.connector),h.push("ConnectingExternal",{connector:e.connector,redirectView:i,wallet:e.connector.explorerWallet});return}if(e.subtype==="announced"){if(e.connector.id==="walletConnect"){y.isMobile()?h.push("AllWallets"):h.push("ConnectingWalletConnect",{redirectView:i});return}h.push("ConnectingExternal",{connector:e.connector,redirectView:i,wallet:e.connector.explorerWallet});return}h.push("ConnectingExternal",{connector:e.connector,redirectView:i})}renderWallet(e,i){const o=e.wallet,r=S.getWalletImage(o),s=x.hasAnyConnection(E.CONNECTOR_ID.WALLET_CONNECT),a=this.loadingTelegram,g=e.subtype==="recent"?"recent":void 0,$=e.subtype==="recent"?"info":void 0;return l`
2236      <w3m-list-wallet
2237        displayIndex=${i}
2238        imageSrc=${w(r)}
2239        name=${o.name??"Unknown"}
2240        @click=${()=>this.onClickWallet(e)}
2241        size="sm"
2242        data-testid=${`wallet-selector-${o.id}`}
2243        tabIdx=${w(this.tabIdx)}
2244        ?loading=${a}
2245        ?disabled=${s}
2246        rdnsId=${w(o.rdns||void 0)}
2247        walletRank=${w(o.order)}
2248        tagLabel=${w(g)}
2249        .tagVariant=${$}
2250      >
2251      </w3m-list-wallet>
2252    `}onClickWallet(e){var n;const i=(n=h.state.data)==null?void 0:n.redirectView,o=d.state.activeChain;if(e.subtype==="featured"){b.selectWalletConnector(e.wallet);return}if(e.subtype==="recent"){if(this.loadingTelegram)return;b.selectWalletConnector(e.wallet);return}if(e.subtype==="custom"){if(this.loadingTelegram)return;h.push("ConnectingWalletConnect",{wallet:e.wallet,redirectView:i});return}if(this.loadingTelegram)return;const r=o?b.getConnector({id:e.wallet.id,namespace:o}):void 0;r?h.push("ConnectingExternal",{connector:r,redirectView:i}):h.push("ConnectingWalletConnect",{wallet:e.wallet,redirectView:i})}};xe.styles=Bn;Ze([c({type:Number})],xe.prototype,"tabIdx",void 0);Ze([u()],xe.prototype,"explorerWallets",void 0);Ze([u()],xe.prototype,"connections",void 0);Ze([u()],xe.prototype,"connectorImages",void 0);Ze([u()],xe.prototype,"loadingTelegram",void 0);xe=Ze([p("w3m-connector-list")],xe);var Pi=function(t,e,i,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};let Mt=class extends f{constructor(){super(...arguments),this.tabIdx=void 0}render(){return l`
2253      <wui-flex flexDirection="column" gap="2">
2254        <w3m-connector-list tabIdx=${w(this.tabIdx)}></w3m-connector-list>
2255        <w3m-all-wallets-widget tabIdx=${w(this.tabIdx)}></w3m-all-wallets-widget>
2256      </wui-flex>
2257    `}};Pi([c()],Mt.prototype,"tabIdx",void 0);Mt=Pi([p("w3m-wallet-login-list")],Mt);const Un=v`
2258  :host {
2259    --connect-scroll--top-opacity: 0;
2260    --connect-scroll--bottom-opacity: 0;
2261    --connect-mask-image: none;
2262  }
2263
2264  .connect {
2265    max-height: clamp(360px, 470px, 80vh);
2266    scrollbar-width: none;
2267    overflow-y: scroll;
2268    overflow-x: hidden;
2269    transition: opacity ${({durations:t})=>t.lg}
2270      ${({easings:t})=>t["ease-out-power-2"]};
2271    will-change: opacity;
2272    mask-image: var(--connect-mask-image);
2273  }
2274
2275  .guide {
2276    transition: opacity ${({durations:t})=>t.lg}
2277      ${({easings:t})=>t["ease-out-power-2"]};
2278    will-change: opacity;
2279  }
2280
2281  .connect::-webkit-scrollbar {
2282    display: none;
2283  }
2284
2285  .all-wallets {
2286    flex-flow: column;
2287  }
2288
2289  .connect.disabled,
2290  .guide.disabled {
2291    opacity: 0.3;
2292    pointer-events: none;
2293    user-select: none;
2294  }
2295
2296  wui-separator {
2297    margin: ${({spacing:t})=>t[3]} calc(${({spacing:t})=>t[3]} * -1);
2298    width: calc(100% + ${({spacing:t})=>t[3]} * 2);
2299  }
2300`;var oe=function(t,e,i,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};const zn=470;let H=class extends f{constructor(){var e,i;super(),this.unsubscribe=[],this.connectors=b.state.connectors,this.authConnector=this.connectors.find(o=>o.type==="AUTH"),this.features=m.state.features,this.remoteFeatures=m.state.remoteFeatures,this.enableWallets=m.state.enableWallets,this.noAdapters=d.state.noAdapters,this.walletGuide="get-started",this.checked=bt.state.isLegalCheckboxChecked,this.isEmailEnabled=((e=this.remoteFeatures)==null?void 0:e.email)&&!d.state.noAdapters,this.isSocialEnabled=((i=this.remoteFeatures)==null?void 0:i.socials)&&this.remoteFeatures.socials.length>0&&!d.state.noAdapters,this.isAuthEnabled=this.checkIfAuthEnabled(this.connectors),this.unsubscribe.push(b.subscribeKey("connectors",o=>{this.connectors=o,this.authConnector=this.connectors.find(r=>r.type==="AUTH"),this.isAuthEnabled=this.checkIfAuthEnabled(this.connectors)}),m.subscribeKey("features",o=>{this.features=o}),m.subscribeKey("remoteFeatures",o=>{this.remoteFeatures=o,this.setEmailAndSocialEnableCheck(this.noAdapters,this.remoteFeatures)}),m.subscribeKey("enableWallets",o=>this.enableWallets=o),d.subscribeKey("noAdapters",o=>this.setEmailAndSocialEnableCheck(o,this.remoteFeatures)),bt.subscribeKey("isLegalCheckboxChecked",o=>this.checked=o))}disconnectedCallback(){var i,o;this.unsubscribe.forEach(r=>r()),(i=this.resizeObserver)==null||i.disconnect();const e=(o=this.shadowRoot)==null?void 0:o.querySelector(".connect");e==null||e.removeEventListener("scroll",this.handleConnectListScroll.bind(this))}firstUpdated(){var i,o;const e=(i=this.shadowRoot)==null?void 0:i.querySelector(".connect");e&&(requestAnimationFrame(this.handleConnectListScroll.bind(this)),e==null||e.addEventListener("scroll",this.handleConnectListScroll.bind(this)),this.resizeObserver=new ResizeObserver(()=>{this.handleConnectListScroll()}),(o=this.resizeObserver)==null||o.observe(e),this.handleConnectListScroll())}render(){var O;const{termsConditionsUrl:e,privacyPolicyUrl:i}=m.state,o=(O=m.state.features)==null?void 0:O.legalCheckbox,s=!!(e||i)&&!!o&&this.walletGuide==="get-started"&&!this.checked,a={connect:!0,disabled:s},g=m.state.enableWalletGuide,$=this.enableWallets,k=this.isSocialEnabled||this.authConnector,R=s?-1:void 0;return l`
2301      <wui-flex flexDirection="column">
2302        ${this.legalCheckboxTemplate()}
2303        <wui-flex
2304          data-testid="w3m-connect-scroll-view"
2305          flexDirection="column"
2306          .padding=${["0","0","4","0"]}
2307          class=${_i(a)}
2308        >
2309          <wui-flex
2310            class="connect-methods"
2311            flexDirection="column"
2312            gap="2"
2313            .padding=${k&&$&&g&&this.walletGuide==="get-started"?["0","3","0","3"]:["0","3","3","3"]}
2314          >
2315            ${this.renderConnectMethod(R)}
2316          </wui-flex>
2317        </wui-flex>
2318        ${this.reownBrandingTemplate()}
2319      </wui-flex>
2320    `}reownBrandingTemplate(){var e;return Jt.hasFooter()||!((e=this.remoteFeatures)!=null&&e.reownBranding)?null:l`<wui-ux-by-reown></wui-ux-by-reown>`}setEmailAndSocialEnableCheck(e,i){this.isEmailEnabled=(i==null?void 0:i.email)&&!e,this.isSocialEnabled=(i==null?void 0:i.socials)&&i.socials.length>0&&!e,this.remoteFeatures=i,this.noAdapters=e}checkIfAuthEnabled(e){const i=e.filter(r=>r.type===Xi.CONNECTOR_TYPE_AUTH).map(r=>r.chain);return E.AUTH_CONNECTOR_SUPPORTED_CHAINS.some(r=>i.includes(r))}renderConnectMethod(e){const i=tt.getConnectOrderMethod(this.features,this.connectors);return l`${i.map((o,r)=>
2320{switch(o){case"email":return l`${this.emailTemplate(e)} ${this.separatorTemplate(r,"email")}`;case"social":return l`${this.socialListTemplate(e)}
2321          ${this.separatorTemplate(r,"social")}`;case"wallet":return l`${this.walletListTemplate(e)}
2322          ${this.separatorTemplate(r,"wallet")}`;default:return null}})}`}checkMethodEnabled(e){switch(e){case"wallet":return this.enableWallets;case"social":return this.isSocialEnabled&&this.isAuthEnabled;case"email":return this.isEmailEnabled&&this.isAuthEnabled;default:return null}}checkIsThereNextMethod(e){const o=tt.getConnectOrderMethod(this.features,this.connectors)[e+1];return o?this.checkMethodEnabled(o)?o:this.checkIsThereNextMethod(e+1):void 0}separatorTemplate(e,i){const o=this.checkIsThereNextMethod(e),r=this.walletGuide==="explore";switch(i){case"wallet":return this.enableWallets&&o&&!r?l`<wui-separator data-testid="wui-separator" text="or"></wui-separator>`:null;case"email":{const n=o==="social";return this.isAuthEnabled&&this.isEmailEnabled&&!n&&o?l`<wui-separator
2323              data-testid="w3m-email-login-or-separator"
2324              text="or"
2325            ></wui-separator>`:null}case"social":{const n=o==="email";return this.isAuthEnabled&&this.isSocialEnabled&&!n&&o?l`<wui-separator data-testid="wui-separator" text="or"></wui-separator>`:null}default:return null}}emailTemplate(e){return!this.isEmailEnabled||!this.isAuthEnabled?null:l`<w3m-email-login-widget tabIdx=${w(e)}></w3m-email-login-widget>`}socialListTemplate(e){return!this.isSocialEnabled||!this.isAuthEnabled?null:l`<w3m-social-login-widget
2326      walletGuide=${this.walletGuide}
2327      tabIdx=${w(e)}
2328    ></w3m-social-login-widget>`}walletListTemplate(e){var a,g;const i=this.enableWallets,o=((a=this.features)==null?void 0:a.emailShowWallets)===!1,r=(g=this.features)==null?void 0:g.collapseWallets,n=o||r;return!i||(y.isTelegram()&&(y.isSafari()||y.isIos())&&x.connectWalletConnect().catch($=>({})),this.walletGuide==="explore")?null:this.isAuthEnabled&&(this.isEmailEnabled||this.isSocialEnabled)&&n?l`<wui-list-button
2329        data-testid="w3m-collapse-wallets-button"
2330        tabIdx=${w(e)}
2331        @click=${this.onContinueWalletClick.bind(this)}
2332        text="Continue with a wallet"
2333        icon="wallet"
2334      ></wui-list-button>`:l`<w3m-wallet-login-list tabIdx=${w(e)}></w3m-wallet-login-list>`}legalCheckboxTemplate(){return this.walletGuide==="explore"?null:l`<w3m-legal-checkbox data-testid="w3m-legal-checkbox"></w3m-legal-checkbox>`}handleConnectListScroll(){var o;const e=(o=this.shadowRoot)==null?void 0:o.querySelector(".connect");if(!e)return;e.scrollHeight>zn?(e.style.setProperty("--connect-mask-image",`linear-gradient(
2335          to bottom,
2336          rgba(0, 0, 0, calc(1 - var(--connect-scroll--top-opacity))) 0px,
2337          rgba(200, 200, 200, calc(1 - var(--connect-scroll--top-opacity))) 1px,
2338          black 100px,
2339          black calc(100% - 100px),
2340          rgba(155, 155, 155, calc(1 - var(--connect-scroll--bottom-opacity))) calc(100% - 1px),
2341          rgba(0, 0, 0, calc(1 - var(--connect-scroll--bottom-opacity))) 100%
2342        )`),e.style.setProperty("--connect-scroll--top-opacity",mt.interpolate([0,50],[0,1],e.scrollTop).toString()),e.style.setProperty("--connect-scroll--bottom-opacity",mt.interpolate([0,50],[0,1],e.scrollHeight-e.scrollTop-e.offsetHeight).toString())):(e.style.setProperty("--connect-mask-image","none"),e.style.setProperty("--connect-scroll--top-opacity","0"),e.style.setProperty("--connect-scroll--bottom-opacity","0"))}onContinueWalletClick(){h.push("ConnectWallets")}};H.styles=Un;oe([u()],H.prototype,"connectors",void 0);oe([u()],H.prototype,"authConnector",void 0);oe([u()],H.prototype,"features",void 0);oe([u()],H.prototype,"remoteFeatures",void 0);oe([u()],H.prototype,"enableWallets",void 0);oe([u()],H.prototype,"noAdapters",void 0);oe([c()],H.prototype,"walletGuide",void 0);oe([u()],H.prototype,"checked",void 0);oe([u()],H.prototype,"isEmailEnabled",void 0);oe([u()],H.prototype,"isSocialEnabled",void 0);oe([u()],H.prototype,"isAuthEnabled",void 0);H=oe([p("w3m-connect-view")],H);const Fn=v`
2343  wui-flex {
2344    width: 100%;
2345    height: 52px;
2346    box-sizing: border-box;
2347    background-color: ${({tokens:t})=>t.theme.foregroundPrimary};
2348    border-radius: ${({borderRadius:t})=>t[5]};
2349    padding-left: ${({spacing:t})=>t[3]};
2350    padding-right: ${({spacing:t})=>t[3]};
2351    display: flex;
2352    align-items: center;
2353    justify-content: space-between;
2354    gap: ${({spacing:t})=>t[6]};
2355  }
2356
2357  wui-text {
2358    color: ${({tokens:t})=>t.theme.textSecondary};
2359  }
2360
2361  wui-icon {
2362    width: 12px;
2363    height: 12px;
2364  }
2365`;
2365var Ot=function(t,e,i,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};let qe=class extends f{constructor(){super(...arguments),this.disabled=!1,this.label="",this.buttonLabel=""}render(){return l`
2366      <wui-flex justifyContent="space-between" alignItems="center">
2367        <wui-text variant="lg-regular" color="inherit">${this.label}</wui-text>
2368        <wui-button variant="accent-secondary" size="sm">
2369          ${this.buttonLabel}
2370          <wui-icon name="chevronRight" color="inherit" size="inherit" slot="iconRight"></wui-icon>
2371        </wui-button>
2372      </wui-flex>
2373    `}};qe.styles=[_,W,Fn];Ot([c({type:Boolean})],qe.prototype,"disabled",void 0);Ot([c()],qe.prototype,"label",void 0);Ot([c()],qe.prototype,"buttonLabel",void 0);qe=Ot([p("wui-cta-button")],qe);const Mn=v`
2374  :host {
2375    display: block;
2376    padding: 0 ${({spacing:t})=>t[5]} ${({spacing:t})=>t[5]};
2377  }
2378`;var Di=function(t,e,i,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};let $t=class extends f{constructor(){super(...arguments),this.wallet=void 0}render(){if(!this.wallet)return this.style.display="none",null;const{name:e,app_store:i,play_store:o,chrome_store:r,homepage:n}=this.wallet,s=y.isMobile(),a=y.isIos(),g=y.isAndroid(),$=[i,o,n,r].filter(Boolean).length>1,k=F.getTruncateString({string:e,charsStart:12,charsEnd:0,truncate:"end"});return $&&!s?l`
2379        <wui-cta-button
2380          label=${`Don't have ${k}?`}
2381          buttonLabel="Get"
2382          @click=${()=>h.push("Downloads",{wallet:this.wallet})}
2383        ></wui-cta-button>
2384      `:!$&&n?l`
2385        <wui-cta-button
2386          label=${`Don't have ${k}?`}
2387          buttonLabel="Get"
2388          @click=${this.onHomePage.bind(this)}
2389        ></wui-cta-button>
2390      `:i&&a?l`
2391        <wui-cta-button
2392          label=${`Don't have ${k}?`}
2393          buttonLabel="Get"
2394          @click=${this.onAppStore.bind(this)}
2395        ></wui-cta-button>
2396      `:o&&g?l`
2397        <wui-cta-button
2398          label=${`Don't have ${k}?`}
2399          buttonLabel="Get"
2400          @click=${this.onPlayStore.bind(this)}
2401        ></wui-cta-button>
2402      `:(this.style.display="none",null)}onAppStore(){var e;(e=this.wallet)!=null&&e.app_store&&y.openHref(this.wallet.app_store,"_blank")}onPlayStore(){var e;(e=this.wallet)!=null&&e.play_store&&y.openHref(this.wallet.play_store,"_blank")}onHomePage(){var e;(e=this.wallet)!=null&&e.homepage&&y.openHref(this.wallet.homepage,"_blank")}};$t.styles=[Mn];Di([c({type:Object})],$t.prototype,"wallet",void 0);$t=Di([p("w3m-mobile-download-links")],$t);const Vn=v`
2403  @keyframes shake {
2404    0% {
2405      transform: translateX(0);
2406    }
2407    25% {
2408      transform: translateX(3px);
2409    }
2410    50% {
2411      transform: translateX(-3px);
2412    }
2413    75% {
2414      transform: translateX(3px);
2415    }
2416    100% {
2417      transform: translateX(0);
2418    }
2419  }
2420
2421  wui-flex:first-child:not(:only-child) {
2422    position: relative;
2423  }
2424
2425  wui-wallet-image {
2426    width: 56px;
2427    height: 56px;
2428  }
2429
2430  wui-loading-thumbnail {
2431    position: absolute;
2432  }
2433
2434  wui-icon-box {
2435    position: absolute;
2436    right: calc(${({spacing:t})=>t[1]} * -1);
2437    bottom: calc(${({spacing:t})=>t[1]} * -1);
2438    opacity: 0;
2439    transform: scale(0.5);
2440    transition-property: opacity, transform;
2441    transition-duration: ${({durations:t})=>t.lg};
2442    transition-timing-function: ${({easings:t})=>t["ease-out-power-2"]};
2443    will-change: opacity, transform;
2444  }
2445
2446  wui-text[align='center'] {
2447    width: 100%;
2448    padding: 0px ${({spacing:t})=>t[4]};
2449  }
2450
2451  [data-error='true'] wui-icon-box {
2452    opacity: 1;
2453    transform: scale(1);
2454  }
2455
2456  [data-error='true'] > wui-flex:first-child {
2457    animation: shake 250ms ${({easings:t})=>t["ease-out-power-2"]} both;
2458  }
2459
2460  [data-retry='false'] wui-link {
2461    display: none;
2462  }
2463
2464  [data-retry='true'] wui-link {
2465    display: block;
2466    opacity: 1;
2467  }
2468
2469  w3m-mobile-download-links {
2470    padding: 0px;
2471    width: 100%;
2472  }
2473`;var le=function(t,e,i,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};class N extends f{constructor(){var e,i,o,r,n;super(),this.wallet=(e=h.state.data)==null?void 0:e.wallet,this.connector=(i=h.state.data)==null?void 0:i.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=S.getConnectorImage(this.connector)??S.getWalletImage(this.wallet),this.name=((o=this.wallet)==null?void 0:o.name)??((r=this.connector)==null?void 0:r.name)??"Wallet",this.isRetrying=!1,this.uri=x.state.wcUri,this.error=x.state.wcError,this.ready=!1,this.showRetry=!1,this.label=void 0,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(x.subscribeKey("wcUri",s=>{var a;this.uri=s,this.isRetrying&&this.onRetry&&(this.isRetrying=!1,(a=this.onConnect)==null||a.call(this))}),x.subscribeKey("wcError",s=>this.error=s)),(y.isTelegram()||y.isSafari())&&y.isIos()&&x.state.wcUri&&((n=this.onConnect)==null||n.call(this))}firstUpdated(){var e;(e=this.onAutoConnect)==null||e.call(this),this.showRetry=!this.onAutoConnect}disconnectedCallback(){this.unsubscribe.forEach(e=>e()),x.setWcError(!1),clearTimeout(this.timeout)}render(){var o;(o=this.onRender)==null||o.call(this),this.onShowRetry();const e=this.error?"Connection can be declined if a previous request is still active":this.secondaryLabel;let i="";return this.label?i=this.label:(i=`Continue in ${this.name}`,this.error&&(i="Connection declined")),l`
2474      <wui-flex
2475        data-error=${w(this.error)}
2476        data-retry=${this.showRetry}
2477        flexDirection="column"
2478        alignItems="center"
2479        .padding=${["10","5","5","5"]}
2480        gap="6"
2481      >
2482        <wui-flex gap="2" justifyContent="center" alignItems="center">
2483          <wui-wallet-image size="lg" imageSrc=${w(this.imageSrc)}></wui-wallet-image>
2484
2485          ${this.error?null:this.loaderTemplate()}
2486
2487          <wui-icon-box
2488            color="error"
2489            icon="close"
2490            size="sm"
2491            border
2492            borderColor="wui-color-bg-125"
2493          ></wui-icon-box>
2494        </wui-flex>
2495
2496        <wui-flex flexDirection="column" alignItems="center" gap="6"> <wui-flex
2497          flexDirection="column"
2498          alignItems="center"
2499          gap="2"
2500          .padding=${["2","0","0","0"]}
2501        >
2502          <wui-text align="center" variant="lg-medium" color=${this.error?"error":"primary"}>
2503            ${i}
2504          </wui-text>
2505          <wui-text align="center" variant="lg-regular" color="secondary">${e}</wui-text>
2506        </wui-flex>
2507
2508        ${this.secondaryBtnLabel?l`
2509                <wui-button
2510                  variant="neutral-secondary"
2511                  size="md"
2512                  ?disabled=${this.isRetrying||this.isLoading}
2513                  @click=${this.onTryAgain.bind(this)}
2514                  data-testid="w3m-connecting-widget-secondary-button"
2515                >
2516                  <wui-icon
2517                    color="inherit"
2518                    slot="iconLeft"
2519                    name=${this.secondaryBtnIcon}
2520                  ></wui-icon>
2521                  ${this.secondaryBtnLabel}
2522                </wui-button>
2523              `:null}
2524      </wui-flex>
2525
2526      ${this.isWalletConnect?l`
2527              <wui-flex .padding=${["0","5","5","5"]} justifyContent="center">
2528                <wui-link
2529                  @click=${this.onCopyUri}
2530                  variant="secondary"
2531                  icon="copy"
2532                  data-testid="wui-link-copy"
2533                >
2534                  Copy link
2535                </wui-link>
2536              </wui-flex>
2537            `:null}
2538
2539      <w3m-mobile-download-links .wallet=${this.wallet}></w3m-mobile-download-links></wui-flex>
2540      </wui-flex>
2541    `}onShowRetry(){var e;if(this.error&&!this.showRetry){this.showRetry=!0;const i=(e=this.shadowRoot)==null?void 0:e.querySelector("wui-button");i==null||i.animate([{opacity:0},{opacity:1}],{fill:"forwards",easing:"ease"})}}onTryAgain(){var e,i;x.setWcError(!1),this.onRetry?(this.isRetrying=!0,(e=this.onRetry)==null||e.call(this)):(i=this.onConnect)==null||i.call(this)}loaderTemplate(){const e=ft.state.themeVariables["--w3m-border-radius-master"],i=e?parseInt(e.replace("px",""),10):4;return l`<wui-loading-thumbnail radius=${i*9}></wui-loading-thumbnail>`}onCopyUri(){try{this.uri&&(y.copyToClopboard(this.uri),A.showSuccess("Link copied"))}catch{A.showError("Failed to copy")}}}N.styles=Vn;le([u()],N.prototype,"isRetrying",void 0);le([u()],N.prototype,"uri",void 0);le([u()],N.prototype,"error",void 0);le([u()],N.prototype,"ready",void 0);le([u()],N.prototype,"showRetry",void 0);le([u()],N.prototype,"label",void 0);le([u()],N.prototype,"secondaryBtnLabel",void 0);le([u()],N.prototype,"secondaryLabel",void 0);le([u()],N.prototype,"isLoading",void 0);le([c({type:Boolean})],N.prototype,"isMobile",void 0);le([c()],N.prototype,"onRetry",void 0);var Hn=function(t,e,i,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};let xi=class extends N{constructor(){var i,o,r,n,s;if(super(),this.externalViewUnsubscribe=[],this.connectionsByNamespace=x.getConnections((i=this.connector)==null?void 0:i.chain),this.hasMultipleConnections=this.connectionsByNamespace.length>0,this.remoteFeatures=m.state.remoteFeatures,this.currentActiveConnectorId=b.state.activeConnectorIds[(o=this.connector)==null?void 0:o.chain],!this.connector)throw new Error("w3m-connecting-view: No connector provided");const e=(r=this.connector)==null?void 0:r.chain;this.isAlreadyConnected(this.connector)&&(this.secondaryBtnLabel=void 0,this.label=`This account is already linked, change your account in ${this.connector.name}`,this.secondaryLabel=`To link a new account, open ${this.connector.name} and switch to the account you want to link`),C.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.connector.name??"Unknown",platform:"browser",displayIndex:(n=this.wallet)==null?void 0:n.display_index,walletRank:(s=this.wallet)==null?void 0:s.order,view:h.state.view}}),this.onConnect=this.onConnectProxy.bind(this),this.onAutoConnect=this.onConnectProxy.bind(this),this.isWalletConnect=!1,this.externalViewUnsubscribe.push(b.subscribeKey("activeConnectorIds",a=>{var R;const g=a[e],$=(R=this.remoteFeatures)==null?void 0:R.multiWallet,{redirectView:k}=h.state.data??{};g!==this.currentActiveConnectorId&&(this.hasMultipleConnections&&$?(h.replace("ProfileWallets"),A.showSuccess("New Wallet Added")):k?h.replace(k):P.close())}),x.subscribeKey("connections",this.onConnectionsChange.bind(this)))}disconnectedCallback(){this.externalViewUnsubscribe.forEach(e=>e())}async onConnectProxy(){try{if(this.error=!1,this.connector){if(this.isAlreadyConnected(this.connector))return;(this.connector.id!==E.CONNECTOR_ID.COINBASE_SDK||!this.error)&&await x.connectExternal(this.connector,this.connector.chain)}}catch(e){e instanceof Yt&&e.originalName===Qt.PROVIDER_RPC_ERROR_NAME.USER_REJECTED_REQUEST?C.sendEvent({type:"track",event:"USER_REJECTED",properties:{message:e.message}}):C.sendEvent({type:"track",event:"CONNECT_ERROR",properties:{message:(e==null?void 0:e.message)??"Unknown"}}),this.error=!0}}onConnectionsChange(e){var i,o;if((i=this.connector)!=null&&i.chain&&e.get(this.connector.chain)&&this.isAlreadyConnected(this.connector)){const r=e.get(this.connector.chain)??[],n=(o=this.remoteFeatures)==null?void 0:o.multiWallet;if(r.length===0)h.replace("Connect");else{const s=he.getConnectionsByConnectorId(this.connectionsByNamespace,this.connector.id).flatMap(g=>g.accounts),a=he.getConnectionsByConnectorId(r,this.connector.id).flatMap(g=>g.accounts);a.length===0?this.hasMultipleConnections&&n?(h.replace("ProfileWallets"),A.showSuccess("Wallet deleted")):P.close():!s.every($=>a.some(k=>J.isLowerCaseMatch($.address,k.address)))&&n&&h.replace("ProfileWallets")}}}
2541isAlreadyConnected(e){return!!e&&this.connectionsByNamespace.some(i=>J.isLowerCaseMatch(i.connectorId,e.id))}};xi=Hn([p("w3m-connecting-external-view")],xi);const qn=ee`
2542  wui-flex,
2543  wui-list-wallet {
2544    width: 100%;
2545  }
2546`;var Li=function(t,e,i,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};let Ct=class extends f{constructor(){super(),this.unsubscribe=[],this.activeConnector=b.state.activeConnector,this.unsubscribe.push(b.subscribeKey("activeConnector",e=>this.activeConnector=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){var e;return l`
2547      <wui-flex
2548        flexDirection="column"
2549        alignItems="center"
2550        .padding=${["3","5","5","5"]}
2551        gap="5"
2552      >
2553        <wui-flex justifyContent="center" alignItems="center">
2554          <wui-wallet-image
2555            size="lg"
2556            imageSrc=${w(S.getConnectorImage(this.activeConnector))}
2557          ></wui-wallet-image>
2558        </wui-flex>
2559        <wui-flex
2560          flexDirection="column"
2561          alignItems="center"
2562          gap="2"
2563          .padding=${["0","3","0","3"]}
2564        >
2565          <wui-text variant="lg-medium" color="primary">
2566            Select Chain for ${(e=this.activeConnector)==null?void 0:e.name}
2567          </wui-text>
2568          <wui-text align="center" variant="lg-regular" color="secondary"
2569            >Select which chain to connect to your multi chain wallet</wui-text
2570          >
2571        </wui-flex>
2572        <wui-flex
2573          flexGrow="1"
2574          flexDirection="column"
2575          alignItems="center"
2576          gap="2"
2577          .padding=${["2","0","2","0"]}
2578        >
2579          ${this.networksTemplate()}
2580        </wui-flex>
2581      </wui-flex>
2582    `}networksTemplate(){var e,i;return(i=(e=this.activeConnector)==null?void 0:e.connectors)==null?void 0:i.map((o,r)=>
2582{var n;return o.name?l`
2583            <w3m-list-wallet
2584              displayIndex=${r}
2585              imageSrc=${w(S.getChainImage(o.chain))}
2586              name=${E.CHAIN_NAME_MAP[o.chain]}
2587              @click=${()=>this.onConnector(o)}
2588              size="sm"
2589              data-testid="wui-list-chain-${o.chain}"
2590              rdnsId=${(n=o.explorerWallet)==null?void 0:n.rdns}
2591            ></w3m-list-wallet>
2592          `:null})}onConnector(e){var r,n,s,a;const i=(n=(r=this.activeConnector)==null?void 0:r.connectors)==null?void 0:n.find(g=>g.chain===e.chain),o=(s=h.state.data)==null?void 0:s.redirectView;if(!i){A.showError("Failed to find connector");return}i.id==="walletConnect"?y.isMobile()?h.push("AllWallets"):h.push("ConnectingWalletConnect",{redirectView:o}):h.push("ConnectingExternal",{connector:i,redirectView:o,wallet:(a=this.activeConnector)==null?void 0:a.explorerWallet})}};Ct.styles=qn;Li([u()],Ct.prototype,"activeConnector",void 0);Ct=Li([p("w3m-connecting-multi-chain-view")],Ct);var oi=function(t,e,i,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};let St=class extends f{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 l`
2593      <wui-flex justifyContent="center" .padding=${["0","0","4","0"]}>
2594        <wui-tabs .tabs=${e} .onTabChange=${this.onTabChange.bind(this)}></wui-tabs>
2595      </wui-flex>
2596    `}generateTabs(){const e=this.platforms.map(i=>i==="browser"?{label:"Browser",icon:"extension",platform:"browser"}:i==="mobile"?{label:"Mobile",icon:"mobile",platform:"mobile"}:i==="qrcode"?{label:"Mobile",icon:"mobile",platform:"qrcode"}:i==="web"?{label:"Webapp",icon:"browser",platform:"web"}:i==="desktop"?{label:"Desktop",icon:"desktop",platform:"desktop"}:{label:"Browser",icon:"extension",platform:"unsupported"});return this.platformTabs=e.map(({platform:i})=>i),e}onTabChange(e){var o;const i=this.platformTabs[e];i&&((o=this.onSelectPlatfrom)==null||o.call(this,i))}};oi([c({type:Array})],St.prototype,"platforms",void 0);oi([c()],St.prototype,"onSelectPlatfrom",void 0);St=oi([p("w3m-connecting-header")],St);var Kn=function(t,e,i,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};let vi=class extends N{constructor(){var e;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),C.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"browser",displayIndex:(e=this.wallet)==null?void 0:e.display_index,walletRank:this.wallet.order,view:h.state.view}})}async onConnectProxy(){try{this.error=!1;const{connectors:e}=b.state,i=e.find(o=>{var r,n,s;return o.type==="ANNOUNCED"&&((r=o.info)==null?void 0:r.rdns)===((n=this.wallet)==null?void 0:n.rdns)||o.type==="INJECTED"||o.name===((s=this.wallet)==null?void 0:s.name)});if(i)await x.connectExternal(i,i.chain);else throw new Error("w3m-connecting-wc-browser: No connector found");P.close()}catch(e){e instanceof Yt&&e.originalName===Qt.PROVIDER_RPC_ERROR_NAME.USER_REJECTED_REQUEST?C.sendEvent({type:"track",event:"USER_REJECTED",properties:{message:e.message}}):C.sendEvent({type:"track",event:"CONNECT_ERROR",properties:{message:(e==null?void 0:e.message)??"Unknown"}}),this.error=!0}}};vi=Kn([p("w3m-connecting-wc-browser")],vi);var Gn=function(t,e,i,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;
2596a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};let $i=class extends N{constructor(){var e;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),C.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"desktop",displayIndex:(e=this.wallet)==null?void 0:e.display_index,walletRank:this.wallet.order,view:h.state.view}})}onRenderProxy(){var e;!this.ready&&this.uri&&(this.ready=!0,(e=this.onConnect)==null||e.call(this))}onConnectProxy(){var e;if((e=this.wallet)!=null&&e.desktop_link&&this.uri)try{this.error=!1;const{desktop_link:i,name:o}=this.wallet,{redirect:r,href:n}=y.formatNativeUrl(i,this.uri);x.setWcLinking({name:o,href:n}),x.setRecentWallet(this.wallet),y.openHref(r,"_blank")}catch{this.error=!0}}};$i=Gn([p("w3m-connecting-wc-desktop")],$i);var et=function(t,e,i,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};let Pe=class extends N{constructor(){var e;if(super(),this.btnLabelTimeout=void 0,this.redirectDeeplink=void 0,this.redirectUniversalLink=void 0,this.target=void 0,this.preferUniversalLinks=m.state.experimental_preferUniversalLinks,this.isLoading=!0,this.onConnect=()=>{he.onConnectMobile(this.wallet)},!this.wallet)throw new Error("w3m-connecting-wc-mobile: No wallet provided");this.secondaryBtnLabel="Open",this.secondaryLabel=D.CONNECT_LABELS.MOBILE,this.secondaryBtnIcon="externalLink",this.onHandleURI(),this.unsubscribe.push(x.subscribeKey("wcUri",()=>{this.onHandleURI()})),C.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"mobile",displayIndex:(e=this.wallet)==null?void 0:e.display_index,walletRank:this.wallet.order,view:h.state.view}})}disconnectedCallback(){super.disconnectedCallback(),clearTimeout(this.btnLabelTimeout)}onHandleURI(){var e;this.isLoading=!this.uri,!this.ready&&this.uri&&(this.ready=!0,(e=this.onConnect)==null||e.call(this))}onTryAgain(){var e;x.setWcError(!1),(e=this.onConnect)==null||e.call(this)}};et([u()],Pe.prototype,"redirectDeeplink",void 0);et([u()],Pe.prototype,"redirectUniversalLink",void 0);et([u()],Pe.prototype,"target",void 0);et([u()],Pe.prototype,"preferUniversalLinks",void 0);et([u()],Pe.prototype,"isLoading",void 0);Pe=et([p("w3m-connecting-wc-mobile")],Pe);const Xn=v`
2597  wui-shimmer {
2598    width: 100%;
2599    aspect-ratio: 1 / 1;
2600    border-radius: ${({borderRadius:t})=>t[4]};
2601  }
2602
2603  wui-qr-code {
2604    opacity: 0;
2605    animation-duration: ${({durations:t})=>t.xl};
2606    animation-timing-function: ${({easings:t})=>t["ease-out-power-2"]};
2607    animation-name: fade-in;
2608    animation-fill-mode: forwards;
2609  }
2610
2611  @keyframes fade-in {
2612    from {
2613      opacity: 0;
2614    }
2615    to {
2616      opacity: 1;
2617    }
2618  }
2619`;var ji=function(t,e,i,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};let Et=class extends N{constructor(){super(),this.basic=!1}firstUpdated(){var e,i,o;this.basic||C.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:((e=this.wallet)==null?void 0:e.name)??"WalletConnect",platform:"qrcode",displayIndex:(i=this.wallet)==null?void 0:i.display_index,walletRank:(o=this.wallet)==null?void 0:o.order,view:h.state.view}})}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this.unsubscribe)==null||e.forEach(i=>i())}render(){return this.onRenderProxy(),l`
2620      <wui-flex
2621        flexDirection="column"
2622        alignItems="center"
2623        .padding=${["0","5","5","5"]}
2624        gap="5"
2625      >
2626        <wui-shimmer width="100%"> ${this.qrCodeTemplate()} </wui-shimmer>
2627        <wui-text variant="lg-medium" color="primary"> Scan this QR Code with your phone </wui-text>
2628        ${this.copyTemplate()}
2629      </wui-flex>
2630      <w3m-mobile-download-links .wallet=${this.wallet}></w3m-mobile-download-links>
2631    `}onRenderProxy(){!this.ready&&this.uri&&(this.ready=!0)}qrCodeTemplate(){if(!this.uri||!this.ready)return null;const e=this.wallet?this.wallet.name:void 0;x.setWcLinking(void 0),x.setRecentWallet(this.wallet);const i=ft.state.themeVariables["--apkt-qr-color"]??ft.state.themeVariables["--w3m-qr-color"];return l` <wui-qr-code
2632      theme=${ft.state.themeMode}
2633      uri=${this.uri}
2634      imageSrc=${w(S.getWalletImage(this.wallet))}
2635      color=${w(i)}
2636      alt=${w(e)}
2637      data-testid="wui-qr-code"
2638    ></wui-qr-code>`}copyTemplate(){const e=!this.uri||!this.ready;return l`<wui-button
2639      .disabled=${e}
2640      @click=${this.onCopyUri}
2641      variant="neutral-secondary"
2642      size="sm"
2643      data-testid="copy-wc2-uri"
2644    >
2645      Copy link
2646      <wui-icon size="sm" color="inherit" name="copy" slot="iconRight"></wui-icon>
2647    </wui-button>`}};Et.styles=Xn;ji([c({type:Boolean})],Et.prototype,"basic",void 0);Et=ji([p("w3m-connecting-wc-qrcode")],Et);var Yn=function(t,e,i,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};let Ci=class extends f{constructor(){var e,i,o;if(super(),this.wallet=(e=h.state.data)==null?void 0:e.wallet,!this.wallet)throw new Error("w3m-connecting-wc-unsupported: No wallet provided");C.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"browser",displayIndex:(i=this.wallet)==null?void 0:i.display_index,walletRank:(o=this.wallet)==null?void 0:o.order,view:h.state.view}})}render(){return l`
2648      <wui-flex
2649        flexDirection="column"
2650        alignItems="center"
2651        .padding=${["10","5","5","5"]}
2652        gap="5"
2653      >
2654        <wui-wallet-image
2655          size="lg"
2656          imageSrc=${w(S.getWalletImage(this.wallet))}
2657        ></wui-wallet-image>
2658
2659        <wui-text variant="md-regular" color="primary">Not Detected</wui-text>
2660      </wui-flex>
2661
2662      <w3m-mobile-download-links .wallet=${this.wallet}></w3m-mobile-download-links>
2663    `}};Ci=Yn([p("w3m-connecting-wc-unsupported")],Ci);var Bi=function(t,e,i,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};let Vt=class extends N{constructor(){var e,i;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=D.CONNECT_LABELS.MOBILE,this.secondaryBtnIcon="externalLink",this.updateLoadingState(),this.unsubscribe.push(x.subscribeKey("wcUri",()=>{this.updateLoadingState()})),C.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"web",displayIndex:(e=this.wallet)==null?void 0:e.display_index,walletRank:(i=this.wallet)==null?void 0:i.order,view:h.state.view}})}updateLoadingState(){this.isLoading=!this.uri}onConnectProxy(){var e;if((e=this.wallet)!=null&&e.webapp_link&&this.uri)try{this.error=!1;const{webapp_link:i,name:o}=this.wallet,{redirect:r,href:n}=y.formatUniversalUrl(i,this.uri);x.setWcLinking({name:o,href:n}),x.setRecentWallet(this.wallet),y.openHref(r,"_blank")}catch{this.error=!0}}};Bi([u()],Vt.prototype,"isLoading",void 0);Vt=Bi([p("w3m-connecting-wc-web")],Vt);const Qn=v`
2664  :host([data-mobile-fullscreen='true']) {
2665    height: 100%;
2666    display: flex;
2667    flex-direction: column;
2668  }
2669
2670  :host([data-mobile-fullscreen='true']) wui-ux-by-reown {
2671    margin-top: auto;
2672  }
2673`;var Ue=function(t,e,i,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;
2673a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};let we=class extends f{constructor(){var e;super(),this.wallet=(e=h.state.data)==null?void 0:e.wallet,this.unsubscribe=[],this.platform=void 0,this.platforms=[],this.isSiwxEnabled=!!m.state.siwx,this.remoteFeatures=m.state.remoteFeatures,this.displayBranding=!0,this.basic=!1,this.determinePlatforms(),this.initializeConnection(),this.unsubscribe.push(m.subscribeKey("remoteFeatures",i=>this.remoteFeatures=i))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return m.state.enableMobileFullScreen&&this.setAttribute("data-mobile-fullscreen","true"),l`
2674      ${this.headerTemplate()}
2675      <div class="platform-container">${this.platformTemplate()}</div>
2676      ${this.reownBrandingTemplate()}
2677    `}reownBrandingTemplate(){var e;return!((e=this.remoteFeatures)!=null&&e.reownBranding)||!this.displayBranding?null:l`<wui-ux-by-reown></wui-ux-by-reown>`}async initializeConnection(e=!1){var i,o;if(!(this.platform==="browser"||m.state.manualWCControl&&!e))try{const{wcPairingExpiry:r,status:n}=x.state,{redirectView:s}=h.state.data??{};if(e||m.state.enableEmbedded||y.isPairingExpired(r)||n==="connecting"){const a=x.getConnections(d.state.activeChain),g=(i=this.remoteFeatures)==null?void 0:i.multiWallet,$=a.length>0;await x.connectWalletConnect({cache:"never"}),this.isSiwxEnabled||($&&g?(h.replace("ProfileWallets"),A.showSuccess("New Wallet Added")):s?h.replace(s):P.close())}}catch(r){if(r instanceof Error&&r.message.includes("An error occurred when attempting to switch chain")&&!m.state.enableNetworkSwitch&&d.state.activeChain){d.setActiveCaipNetwork(Yi.getUnsupportedNetwork(`${d.state.activeChain}:${(o=d.state.activeCaipNetwork)==null?void 0:o.id}`)),d.showUnsupportedChainUI();return}r instanceof Yt&&r.originalName===Qt.PROVIDER_RPC_ERROR_NAME.USER_REJECTED_REQUEST?C.sendEvent({type:"track",event:"USER_REJECTED",properties:{message:r.message}}):C.sendEvent({type:"track",event:"CONNECT_ERROR",properties:{message:(r==null?void 0:r.message)??"Unknown"}}),x.setWcError(!0),A.showError(r.message??"Connection error"),x.resetWcConnection(),h.goBack()}}determinePlatforms(){if(!this.wallet){this.platforms.push("qrcode"),this.platform="qrcode";return}if(this.platform)return;const{mobile_link:e,desktop_link:i,webapp_link:o,injected:r,rdns:n}=this.wallet,s=r==null?void 0:r.map(({injected_id:Hi})=>Hi).filter(Boolean),a=[...n?[n]:s??[]],g=m.state.isUniversalProvider?!1:a.length,$=e,k=o,R=x.checkInstalled(a),O=g&&R,Lt=i&&!y.isMobile();O&&!d.state.noAdapters&&this.platforms.push("browser"),$&&this.platforms.push(y.isMobile()?"mobile":"qrcode"),k&&this.platforms.push("web"),Lt&&this.platforms.push("desktop");const Vi=Qi.isCustomDeeplinkWallet(this.wallet.id,d.state.activeChain);!O&&g&&!d.state.noAdapters&&!Vi&&this.platforms.push("unsupported"),this.platform=this.platforms[0]}platformTemplate(){switch(this.platform){case"browser":return l`<w3m-connecting-wc-browser></w3m-connecting-wc-browser>`;case"web":return l`<w3m-connecting-wc-web></w3m-connecting-wc-web>`;case"desktop":return l`
2678          <w3m-connecting-wc-desktop .onRetry=${()=>this.initializeConnection(!0)}>
2679          </w3m-connecting-wc-desktop>
2680        `;case"mobile":return l`
2681          <w3m-connecting-wc-mobile isMobile .onRetry=${()=>this.initializeConnection(!0)}>
2682          </w3m-connecting-wc-mobile>
2683        `;case"qrcode":return l`<w3m-connecting-wc-qrcode ?basic=${this.basic}></w3m-connecting-wc-qrcode>`;default:return l`<w3m-connecting-wc-unsupported></w3m-connecting-wc-unsupported>`}}headerTemplate(){return this.platforms.length>1?l`
2684      <w3m-connecting-header
2685        .platforms=${this.platforms}
2686        .onSelectPlatfrom=${this.onSelectPlatform.bind(this)}
2687      >
2688      </w3m-connecting-header>
2689    `:null}async onSelectPlatform(e){var o;const i=(o=this.shadowRoot)==null?void 0:o.querySelector("div");i&&(await i.animate([{opacity:1},{opacity:0}],{duration:200,fill:"forwards",easing:"ease"}).finished,this.platform=e,i.animate([{opacity:0},{opacity:1}],{duration:200,fill:"forwards",easing:"ease"}))}};we.styles=Qn;Ue([u()],we.prototype,"platform",void 0);Ue([u()],we.prototype,"platforms",void 0);Ue([u()],we.prototype,"isSiwxEnabled",void 0);Ue([u()],we.prototype,"remoteFeatures",void 0);Ue([c({type:Boolean})],we.prototype,"displayBranding",void 0);Ue([c({type:Boolean})],we.prototype,"basic",void 0);we=Ue([p("w3m-connecting-wc-view")],we);
2689var ri=function(t,e,i,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};let kt=class extends f{constructor(){super(),this.unsubscribe=[],this.isMobile=y.isMobile(),this.remoteFeatures=m.state.remoteFeatures,this.unsubscribe.push(m.subscribeKey("remoteFeatures",e=>this.remoteFeatures=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){if(this.isMobile){const{featured:e,recommended:i}=I.state,{customWallets:o}=m.state,r=me.getRecentWallets(),n=e.length||i.length||(o==null?void 0:o.length)||r.length;return l`<wui-flex flexDirection="column" gap="2" .margin=${["1","3","3","3"]}>
2690        ${n?l`<w3m-connector-list></w3m-connector-list>`:null}
2691        <w3m-all-wallets-widget></w3m-all-wallets-widget>
2692      </wui-flex>`}return l`<wui-flex flexDirection="column" .padding=${["0","0","4","0"]}>
2693        <w3m-connecting-wc-view ?basic=${!0} .displayBranding=${!1}></w3m-connecting-wc-view>
2694        <wui-flex flexDirection="column" .padding=${["0","3","0","3"]}>
2695          <w3m-all-wallets-widget></w3m-all-wallets-widget>
2696        </wui-flex>
2697      </wui-flex>
2698      ${this.reownBrandingTemplate()} `}reownBrandingTemplate(){var e;return(e=this.remoteFeatures)!=null&&e.reownBranding?l` <wui-flex flexDirection="column" .padding=${["1","0","1","0"]}>
2699      <wui-ux-by-reown></wui-ux-by-reown>
2700    </wui-flex>`:null}};ri([u()],kt.prototype,"isMobile",void 0);ri([u()],kt.prototype,"remoteFeatures",void 0);kt=ri([p("w3m-connecting-wc-basic-view")],kt);const Jn=ee`
2701  .continue-button-container {
2702    width: 100%;
2703  }
2704`;var Ui=function(t,e,i,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};let At=class extends f{constructor(){super(...arguments),this.loading=!1}render(){return l`
2705      <wui-flex
2706        flexDirection="column"
2707        alignItems="center"
2708        gap="6"
2709        .padding=${["0","0","4","0"]}
2710      >
2711        ${this.onboardingTemplate()} ${this.buttonsTemplate()}
2712        <wui-link
2713          @click=${()=>{y.openHref(tn.URLS.FAQ,"_blank")}}
2714        >
2715          Learn more about names
2716          <wui-icon color="inherit" slot="iconRight" name="externalLink"></wui-icon>
2717        </wui-link>
2718      </wui-flex>
2719    `}onboardingTemplate(){return l` <wui-flex
2720      flexDirection="column"
2721      gap="6"
2722      alignItems="center"
2723      .padding=${["0","6","0","6"]}
2724    >
2725      <wui-flex gap="3" alignItems="center" justifyContent="center">
2726        <wui-icon-box icon="id" size="xl" iconSize="xxl" color="default"></wui-icon-box>
2727      </wui-flex>
2728      <wui-flex flexDirection="column" alignItems="center" gap="3">
2729        <wui-text align="center" variant="lg-medium" color="primary">
2730          Choose your account name
2731        </wui-text>
2732        <wui-text align="center" variant="md-regular" color="primary">
2733          Finally say goodbye to 0x addresses, name your account to make it easier to exchange
2734          assets
2735        </wui-text>
2736      </wui-flex>
2737    </wui-flex>`}buttonsTemplate(){return l`<wui-flex
2738      .padding=${["0","8","0","8"]}
2739      gap="3"
2740      class="continue-button-container"
2741    >
2742      <wui-button
2743        fullWidth
2744        .loading=${this.loading}
2745        size="lg"
2746        borderRadius="xs"
2747        @click=${this.handleContinue.bind(this)}
2748        >Choose name
2749      </wui-button>
2750    </wui-flex>`}handleContinue(){h.push("RegisterAccountName"),C.sendEvent({type:"track",event:"OPEN_ENS_FLOW",properties:{isSmartAccount:ze(d.state.activeChain)===Fe.ACCOUNT_TYPES.SMART_ACCOUNT}})}};At.styles=Jn;Ui([u()],At.prototype,"loading",void 0);At=Ui([p("w3m-choose-account-name-view")],At);var Zn=function(t,e,i,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;
2750a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};let Si=class extends f{constructor(){var e;super(...arguments),this.wallet=(e=h.state.data)==null?void 0:e.wallet}render(){if(!this.wallet)throw new Error("w3m-downloads-view");return l`
2751      <wui-flex gap="2" flexDirection="column" .padding=${["3","3","4","3"]}>
2752        ${this.chromeTemplate()} ${this.iosTemplate()} ${this.androidTemplate()}
2753        ${this.homepageTemplate()}
2754      </wui-flex>
2755    `}chromeTemplate(){var e;return(e=this.wallet)!=null&&e.chrome_store?l`<wui-list-item
2756      variant="icon"
2757      icon="chromeStore"
2758      iconVariant="square"
2759      @click=${this.onChromeStore.bind(this)}
2760      chevron
2761    >
2762      <wui-text variant="md-medium" color="primary">Chrome Extension</wui-text>
2763    </wui-list-item>`:null}iosTemplate(){var e;return(e=this.wallet)!=null&&e.app_store?l`<wui-list-item
2764      variant="icon"
2765      icon="appStore"
2766      iconVariant="square"
2767      @click=${this.onAppStore.bind(this)}
2768      chevron
2769    >
2770      <wui-text variant="md-medium" color="primary">iOS App</wui-text>
2771    </wui-list-item>`:null}androidTemplate(){var e;return(e=this.wallet)!=null&&e.play_store?l`<wui-list-item
2772      variant="icon"
2773      icon="playStore"
2774      iconVariant="square"
2775      @click=${this.onPlayStore.bind(this)}
2776      chevron
2777    >
2778      <wui-text variant="md-medium" color="primary">Android App</wui-text>
2779    </wui-list-item>`:null}homepageTemplate(){var e;return(e=this.wallet)!=null&&e.homepage?l`
2780      <wui-list-item
2781        variant="icon"
2782        icon="browser"
2783        iconVariant="square-blue"
2784        @click=${this.onHomePage.bind(this)}
2785        chevron
2786      >
2787        <wui-text variant="md-medium" color="primary">Website</wui-text>
2788      </wui-list-item>
2789    `:null}openStore(e){e.href&&this.wallet&&(C.sendEvent({type:"track",event:"GET_WALLET",properties:{name:this.wallet.name,walletRank:this.wallet.order,explorerId:this.wallet.id,type:e.type}}),y.openHref(e.href,"_blank"))}onChromeStore(){var e;(e=this.wallet)!=null&&e.chrome_store&&this.openStore({href:this.wallet.chrome_store,type:"chrome_store"})}onAppStore(){var e;(e=this.wallet)!=null&&e.app_store&&this.openStore({href:this.wallet.app_store,type:"app_store"})}onPlayStore(){var e;(e=this.wallet)!=null&&e.play_store&&this.openStore({href:this.wallet.play_store,type:"play_store"})}onHomePage(){var e;(e=this.wallet)!=null&&e.homepage&&this.openStore({href:this.wallet.homepage,type:"homepage"})}};Si=Zn([p("w3m-downloads-view")],Si);var eo=function(t,e,i,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};const to="https://walletconnect.com/explorer";let Ei=class extends f{render(){return l`
2790      <wui-flex flexDirection="column" .padding=${["0","3","3","3"]} gap="2">
2791        ${this.recommendedWalletsTemplate()}
2792        <w3m-list-wallet
2793          name="Explore all"
2794          showAllWallets
2795          walletIcon="allWallets"
2796          icon="externalLink"
2797          size="sm"
2798          @click=${()=>{y.openHref("https://walletconnect.com/explorer?type=wallet","_blank")}}
2799        ></w3m-list-wallet>
2800      </wui-flex>
2801    `}recommendedWalletsTemplate(){const{recommended:e,featured:i}=I.state,{customWallets:o}=m.state;return[...i,...o??[],...e].slice(0,4).map((n,s)=>l`
2802        <w3m-list-wallet
2803          displayIndex=${s}
2804          name=${n.name??"Unknown"}
2805          tagVariant="accent"
2806          size="sm"
2807          imageSrc=${w(S.getWalletImage(n))}
2808          @click=${()=>{this.onWalletClick(n)}}
2809        ></w3m-list-wallet>
2810      `)}onWalletClick(e){C.sendEvent({type:"track",event:"GET_WALLET",properties:{name:e.name,walletRank:void 0,explorerId:e.id,type:"homepage"}}),y.openHref(e.homepage??to,"_blank")}};Ei=eo([p("w3m-get-wallet-view")],Ei);var zi=function(t,e,i,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;
2810a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};let Ht=class extends f{constructor(){super(...arguments),this.data=[]}render(){return l`
2811      <wui-flex flexDirection="column" alignItems="center" gap="4">
2812        ${this.data.map(e=>l`
2813            <wui-flex flexDirection="column" alignItems="center" gap="5">
2814              <wui-flex flexDirection="row" justifyContent="center" gap="1">
2815                ${e.images.map(i=>l`<wui-visual size="sm" name=${i}></wui-visual>`)}
2816              </wui-flex>
2817            </wui-flex>
2818            <wui-flex flexDirection="column" alignItems="center" gap="1">
2819              <wui-text variant="md-regular" color="primary" align="center">${e.title}</wui-text>
2820              <wui-text variant="sm-regular" color="secondary" align="center"
2821                >${e.text}</wui-text
2822              >
2823            </wui-flex>
2824          `)}
2825      </wui-flex>
2826    `}};zi([c({type:Array})],Ht.prototype,"data",void 0);Ht=zi([p("w3m-help-widget")],Ht);var io=function(t,e,i,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};const no=[{images:["login","profile","lock"],title:"One login for all of web3",text:"Log in to any app by connecting your wallet. Say goodbye to countless passwords!"},{images:["defi","nft","eth"],title:"A home for your digital assets",text:"A wallet lets you store, send and receive digital assets like cryptocurrencies and NFTs."},{images:["browser","noun","dao"],title:"Your gateway to a new web",text:"With your wallet, you can explore and interact with DeFi, NFTs, DAOs, and much more."}];let ki=class extends f{render(){return l`
2827      <wui-flex
2828        flexDirection="column"
2829        .padding=${["6","5","5","5"]}
2830        alignItems="center"
2831        gap="5"
2832      >
2833        <w3m-help-widget .data=${no}></w3m-help-widget>
2834        <wui-button variant="accent-primary" size="md" @click=${this.onGetWallet.bind(this)}>
2835          <wui-icon color="inherit" slot="iconLeft" name="wallet"></wui-icon>
2836          Get a wallet
2837        </wui-button>
2838      </wui-flex>
2839    `}onGetWallet(){C.sendEvent({type:"track",event:"CLICK_GET_WALLET_HELP"}),h.push("GetWallet")}};ki=io([p("w3m-what-is-a-wallet-view")],ki);const oo=v`
2840  wui-flex {
2841    max-height: clamp(360px, 540px, 80vh);
2842    overflow: scroll;
2843    scrollbar-width: none;
2844    transition: opacity ${({durations:t})=>t.lg}
2845      ${({easings:t})=>t["ease-out-power-2"]};
2846    will-change: opacity;
2847  }
2848  wui-flex::-webkit-scrollbar {
2849    display: none;
2850  }
2851  wui-flex.disabled {
2852    opacity: 0.3;
2853    pointer-events: none;
2854    user-select: none;
2855  }
2856`;var Fi=function(t,e,i,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};let It=class extends f{constructor(){super(),this.unsubscribe=[],this.checked=bt.state.isLegalCheckboxChecked,this.unsubscribe.push(bt.subscribeKey("isLegalCheckboxChecked",e=>{this.checked=e}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){var g;const{termsConditionsUrl:e,privacyPolicyUrl:i}=m.state,o=(g=m.state.features)==null?void 0:g.legalCheckbox,n=!!(e||i)&&!!o,s=n&&!this.checked,a=s?-1:void 0;return l`
2857      <w3m-legal-checkbox></w3m-legal-checkbox>
2858      <wui-flex
2859        flexDirection="column"
2860        .padding=${n?["0","3","3","3"]:"3"}
2861        gap="2"
2862        class=${w(s?"disabled":void 0)}
2863      >
2864        <w3m-wallet-login-list tabIdx=${w(a)}></w3m-wallet-login-list>
2865      </wui-flex>
2866    `}};It.styles=oo;Fi([u()],It.prototype,"checked",void 0);It=Fi([p("w3m-connect-wallets-view")],It);const ro=v`
2867  :host {
2868    display: block;
2869    width: 120px;
2870    height: 120px;
2871  }
2872
2873  svg {
2874    width: 120px;
2875    height: 120px;
2876    fill: none;
2877    stroke: transparent;
2878    stroke-linecap: round;
2879  }
2880
2881  use {
2882    stroke: ${t=>t.colors.accent100};
2883    stroke-width: 2px;
2884    stroke-dasharray: 54, 118;
2885    stroke-dashoffset: 172;
2886    animation: dash 1s linear infinite;
2887  }
2888
2889  @keyframes dash {
2890    to {
2891      stroke-dashoffset: 0px;
2892    }
2893  }
2894`;var so=function(t,e,i,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};let qt=class extends f{render(){return l`
2895      <svg viewBox="0 0 54 59">
2896        <path
2897          id="wui-loader-path"
2898          d="M17.22 5.295c3.877-2.277 5.737-3.363 7.72-3.726a11.44 11.44 0 0 1 4.12 0c1.983.363 3.844 1.45 7.72 3.726l6.065 3.562c3.876 2.276 5.731 3.372 7.032 4.938a11.896 11.896 0 0 1 2.06 3.63c.683 1.928.688 4.11.688 8.663v7.124c0 4.553-.005 6.735-.688 8.664a11.896 11.896 0 0 1-2.06 3.63c-1.3 1.565-3.156 2.66-7.032 4.937l-6.065 3.563c-3.877 2.276-5.737 3.362-7.72 3.725a11.46 11.46 0 0 1-4.12 0c-1.983-.363-3.844-1.449-7.72-3.726l-6.065-3.562c-3.876-2.276-5.731-3.372-7.032-4.938a11.885 11.885 0 0 1-2.06-3.63c-.682-1.928-.688-4.11-.688-8.663v-7.124c0-4.553.006-6.735.688-8.664a11.885 11.885 0 0 1 2.06-3.63c1.3-1.565 3.156-2.66 7.032-4.937l6.065-3.562Z"
2899        />
2900        <use xlink:href="#wui-loader-path"></use>
2901      </svg>
2902    `}};qt.styles=[_,ro];qt=so([p("wui-loading-hexagon")],qt);const ao=ee`
2903  @keyframes shake {
2904    0% {
2905      transform: translateX(0);
2906    }
2907    25% {
2908      transform: translateX(3px);
2909    }
2910    50% {
2911      transform: translateX(-3px);
2912    }
2913    75% {
2914      transform: translateX(3px);
2915    }
2916    100% {
2917      transform: translateX(0);
2918    }
2919  }
2920
2921  wui-flex:first-child:not(:only-child) {
2922    position: relative;
2923  }
2924
2925  wui-loading-hexagon {
2926    position: absolute;
2927  }
2928
2929  wui-icon-box {
2930    position: absolute;
2931    right: 4px;
2932    bottom: 0;
2933    opacity: 0;
2934    transform: scale(0.5);
2935    z-index: 1;
2936  }
2937
2938  wui-button {
2939    display: none;
2940  }
2941
2942  [data-error='true'] wui-icon-box {
2943    opacity: 1;
2944    transform: scale(1);
2945  }
2946
2947  [data-error='true'] > wui-flex:first-child {
2948    animation: shake 250ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
2949  }
2950
2951  wui-button[data-retry='true'] {
2952    display: block;
2953    opacity: 1;
2954  }
2955`;var si=function(t,e,i,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};let ot=class extends f{constructor(){var e;super(),this.network=(e=h.state.data)==null?void 0:e.network,this.unsubscribe=[],this.showRetry=!1,this.error=!1}
2955disconnectedCallback(){this.unsubscribe.forEach(e=>e())}firstUpdated(){this.onSwitchNetwork()}render(){if(!this.network)throw new Error("w3m-network-switch-view: No network provided");this.onShowRetry();const e=this.getLabel(),i=this.getSubLabel();return l`
2956      <wui-flex
2957        data-error=${this.error}
2958        flexDirection="column"
2959        alignItems="center"
2960        .padding=${["10","5","10","5"]}
2961        gap="7"
2962      >
2963        <wui-flex justifyContent="center" alignItems="center">
2964          <wui-network-image
2965            size="lg"
2966            imageSrc=${w(S.getNetworkImage(this.network))}
2967          ></wui-network-image>
2968
2969          ${this.error?null:l`<wui-loading-hexagon></wui-loading-hexagon>`}
2970
2971          <wui-icon-box color="error" icon="close" size="sm"></wui-icon-box>
2972        </wui-flex>
2973
2974        <wui-flex flexDirection="column" alignItems="center" gap="2">
2975          <wui-text align="center" variant="h6-regular" color="primary">${e}</wui-text>
2976          <wui-text align="center" variant="md-regular" color="secondary">${i}</wui-text>
2977        </wui-flex>
2978
2979        <wui-button
2980          data-retry=${this.showRetry}
2981          variant="accent-primary"
2982          size="md"
2983          .disabled=${!this.error}
2984          @click=${this.onSwitchNetwork.bind(this)}
2985        >
2986          <wui-icon color="inherit" slot="iconLeft" name="refresh"></wui-icon>
2987          Try again
2988        </wui-button>
2989      </wui-flex>
2990    `}getSubLabel(){const e=b.getConnectorId(d.state.activeChain);return b.getAuthConnector()&&e===E.CONNECTOR_ID.AUTH?"":this.error?"Switch can be declined if chain is not supported by a wallet or previous request is still active":"Accept connection request in your wallet"}getLabel(){var o;const e=b.getConnectorId(d.state.activeChain);return b.getAuthConnector()&&e===E.CONNECTOR_ID.AUTH?`Switching to ${((o=this.network)==null?void 0:o.name)??"Unknown"} network...`:this.error?"Switch declined":"Approve in wallet"}onShowRetry(){var e;if(this.error&&!this.showRetry){this.showRetry=!0;const i=(e=this.shadowRoot)==null?void 0:e.querySelector("wui-button");i==null||i.animate([{opacity:0},{opacity:1}],{fill:"forwards",easing:"ease"})}}async onSwitchNetwork(){var e;try{this.error=!1,d.state.activeChain!==((e=this.network)==null?void 0:e.chainNamespace)&&d.setIsSwitchingNamespace(!0),this.network&&(await d.switchActiveNetwork(this.network),await Bt.isAuthenticated()&&h.goBack())}catch{this.error=!0}}};ot.styles=ao;si([u()],ot.prototype,"showRetry",void 0);si([u()],ot.prototype,"error",void 0);ot=si([p("w3m-network-switch-view")],ot);const lo=v`
2991  :host {
2992    width: 100%;
2993  }
2994
2995  button {
2996    display: flex;
2997    align-items: center;
2998    justify-content: space-between;
2999    padding: ${({spacing:t})=>t[3]};
3000    width: 100%;
3001    background-color: transparent;
3002    border-radius: ${({borderRadius:t})=>t[4]};
3003  }
3004
3005  wui-text {
3006    text-transform: capitalize;
3007  }
3008
3009  @media (hover: hover) {
3010    button:hover:enabled {
3011      background-color: ${({tokens:t})=>t.theme.foregroundPrimary};
3012    }
3013  }
3014
3015  button:disabled {
3016    opacity: 0.5;
3017    cursor: not-allowed;
3018  }
3019`;var pt=function(t,e,i,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};let De=class extends f{constructor(){super(...arguments),this.imageSrc=void 0,this.name="Ethereum",this.disabled=!1}render(){return l`
3020      <button ?disabled=${this.disabled} tabindex=${w(this.tabIdx)}>
3021        <wui-flex gap="2" alignItems="center">
3022          ${this.imageTemplate()}
3023          <wui-text variant="lg-regular" color="primary">${this.name}</wui-text>
3024        </wui-flex>
3025        <wui-icon name="chevronRight" size="lg" color="default"></wui-icon>
3026      </button>
3027    `}imageTemplate(){return this.imageSrc?l`<wui-image ?boxed=${!0} src=${this.imageSrc}></wui-image>`:l`<wui-image
3028      ?boxed=${!0}
3029      icon="networkPlaceholder"
3030      size="lg"
3031      iconColor="default"
3032    ></wui-image>`}};De.styles=[_,W,lo];pt([c()],De.prototype,"imageSrc",void 0);pt([c()],De.prototype,"name",void 0);pt([c()],De.prototype,"tabIdx",void 0);pt([c({type:Boolean})],De.prototype,"disabled",void 0);
3032De=pt([p("wui-list-network")],De);const co=ee`
3033  .container {
3034    max-height: 360px;
3035    overflow: auto;
3036  }
3037
3038  .container::-webkit-scrollbar {
3039    display: none;
3040  }
3041`;var wt=function(t,e,i,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};let Le=class extends f{constructor(){super(),this.unsubscribe=[],this.network=d.state.activeCaipNetwork,this.requestedCaipNetworks=d.getCaipNetworks(),this.search="",this.onDebouncedSearch=y.debounce(e=>{this.search=e},100),this.unsubscribe.push(Ee.subscribeNetworkImages(()=>this.requestUpdate()),d.subscribeKey("activeCaipNetwork",e=>this.network=e),d.subscribe(()=>{this.requestedCaipNetworks=d.getAllRequestedCaipNetworks()}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return l`
3042      ${this.templateSearchInput()}
3043      <wui-flex
3044        class="container"
3045        .padding=${["0","3","3","3"]}
3046        flexDirection="column"
3047        gap="2"
3048      >
3049        ${this.networksTemplate()}
3050      </wui-flex>
3051    `}templateSearchInput(){return l`
3052      <wui-flex gap="2" .padding=${["0","3","3","3"]}>
3053        <wui-input-text
3054          @inputChange=${this.onInputChange.bind(this)}
3055          class="network-search-input"
3056          size="md"
3057          placeholder="Search network"
3058          icon="search"
3059        ></wui-input-text>
3060      </wui-flex>
3061    `}onInputChange(e){this.onDebouncedSearch(e.detail)}networksTemplate(){var o;const e=d.getAllApprovedCaipNetworkIds(),i=y.sortRequestedNetworks(e,this.requestedCaipNetworks);return this.search?this.filteredNetworks=i==null?void 0:i.filter(r=>{var n;return(n=r==null?void 0:r.name)==null?void 0:n.toLowerCase().includes(this.search.toLowerCase())}):this.filteredNetworks=i,(o=this.filteredNetworks)==null?void 0:o.map(r=>{var n;return l`
3062        <wui-list-network
3063          .selected=${((n=this.network)==null?void 0:n.id)===r.id}
3064          imageSrc=${w(S.getNetworkImage(r))}
3065          type="network"
3066          name=${r.name??r.id}
3067          @click=${()=>this.onSwitchNetwork(r)}
3068          .disabled=${d.isCaipNetworkDisabled(r)}
3069          data-testid=${`w3m-network-switch-${r.name??r.id}`}
3070        ></wui-list-network>
3071      `})}onSwitchNetwork(e){Ji.onSwitchNetwork({network:e})}};Le.styles=co;wt([u()],Le.prototype,"network",void 0);wt([u()],Le.prototype,"requestedCaipNetworks",void 0);wt([u()],Le.prototype,"filteredNetworks",void 0);wt([u()],Le.prototype,"search",void 0);Le=wt([p("w3m-networks-view")],Le);const uo=v`
3072  @keyframes shake {
3073    0% {
3074      transform: translateX(0);
3075    }
3076    25% {
3077      transform: translateX(3px);
3078    }
3079    50% {
3080      transform: translateX(-3px);
3081    }
3082    75% {
3083      transform: translateX(3px);
3084    }
3085    100% {
3086      transform: translateX(0);
3087    }
3088  }
3089
3090  wui-flex:first-child:not(:only-child) {
3091    position: relative;
3092  }
3093
3094  wui-loading-thumbnail {
3095    position: absolute;
3096  }
3097
3098  wui-visual {
3099    border-radius: calc(
3100      ${({borderRadius:t})=>t[1]} * 9 - ${({borderRadius:t})=>t[3]}
3101    );
3102    position: relative;
3103    overflow: hidden;
3104  }
3105
3106  wui-visual::after {
3107    content: '';
3108    display: block;
3109    width: 100%;
3110    height: 100%;
3111    position: absolute;
3112    inset: 0;
3113    border-radius: calc(
3114      ${({borderRadius:t})=>t[1]} * 9 - ${({borderRadius:t})=>t[3]}
3115    );
3116    box-shadow: inset 0 0 0 1px ${({tokens:t})=>t.core.glass010};
3117  }
3118
3119  wui-icon-box {
3120    position: absolute;
3121    right: calc(${({spacing:t})=>t[1]} * -1);
3122    bottom: calc(${({spacing:t})=>t[1]} * -1);
3123    opacity: 0;
3124    transform: scale(0.5);
3125    transition:
3126      opacity ${({durations:t})=>t.lg} ${({easings:t})=>t["ease-out-power-2"]},
3127      transform ${({durations:t})=>t.lg}
3128        ${({easings:t})=>t["ease-out-power-2"]};
3129    will-change: opacity, transform;
3130  }
3131
3132  wui-text[align='center'] {
3133    width: 100%;
3134    padding: 0px ${({spacing:t})=>t[4]};
3135  }
3136
3137  [data-error='true'] wui-icon-box {
3138    opacity: 1;
3139    transform: scale(1);
3140  }
3141
3142  [data-error='true'] > wui-flex:first-child {
3143    animation: shake 250ms ${({easings:t})=>t["ease-out-power-2"]} both;
3144  }
3145
3146  [data-retry='false'] wui-link {
3147    display: none;
3148  }
3149
3150  [data-retry='true'] wui-link {
3151    display: block;
3152    opacity: 1;
3153  }
3154
3155  wui-link {
3156    padding: ${({spacing:t})=>t["01"]} ${({spacing:t})=>t[2]};
3157  }
3158
3159  .capitalize {
3160    text-transform: capitalize;
3161  }
3162`;
3162var Mi=function(t,e,i,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};const ho={eip155:"eth",solana:"solana",bip122:"bitcoin",polkadot:void 0};let _t=class extends f{constructor(){var e,i;super(...arguments),this.unsubscribe=[],this.switchToChain=(e=h.state.data)==null?void 0:e.switchToChain,this.caipNetwork=(i=h.state.data)==null?void 0:i.network,this.activeChain=d.state.activeChain}firstUpdated(){this.unsubscribe.push(d.subscribeKey("activeChain",e=>this.activeChain=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const e=this.switchToChain?E.CHAIN_NAME_MAP[this.switchToChain]:"supported";if(!this.switchToChain)return null;const i=E.CHAIN_NAME_MAP[this.switchToChain];return l`
3163      <wui-flex
3164        flexDirection="column"
3165        alignItems="center"
3166        .padding=${["4","2","2","2"]}
3167        gap="4"
3168      >
3169        <wui-flex justifyContent="center" flexDirection="column" alignItems="center" gap="2">
3170          <wui-visual
3171            size="md"
3172            name=${w(ho[this.switchToChain])}
3173          ></wui-visual>
3174          <wui-flex gap="2" flexDirection="column" alignItems="center">
3175            <wui-text
3176              data-testid=${`w3m-switch-active-chain-to-${i}`}
3177              variant="lg-regular"
3178              color="primary"
3179              align="center"
3180              >Switch to <span class="capitalize">${i}</span></wui-text
3181            >
3182            <wui-text variant="md-regular" color="secondary" align="center">
3183              Connected wallet doesn't support connecting to ${e} chain. You
3184              need to connect with a different wallet.
3185            </wui-text>
3186          </wui-flex>
3187          <wui-button
3188            data-testid="w3m-switch-active-chain-button"
3189            size="md"
3190            @click=${this.switchActiveChain.bind(this)}
3191            >Switch</wui-button
3192          >
3193        </wui-flex>
3194      </wui-flex>
3195    `}async switchActiveChain(){this.switchToChain&&(d.setIsSwitchingNamespace(!0),b.setFilterByNamespace(this.switchToChain),this.caipNetwork?await d.switchActiveNetwork(this.caipNetwork):d.setActiveNamespace(this.switchToChain),h.reset("Connect"))}};_t.styles=uo;Mi([c()],_t.prototype,"activeChain",void 0);_t=Mi([p("w3m-switch-active-chain-view")],_t);var po=function(t,e,i,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};const wo=[{images:["network","layers","system"],title:"The system’s nuts and bolts",text:"A network is what brings the blockchain to life, as this technical infrastructure allows apps to access the ledger and smart contract services."},{images:["noun","defiAlt","dao"],title:"Designed for different uses",text:"Each network is designed differently, and may therefore suit certain apps and experiences."}];let Ai=class extends f{render(){return l`
3196      <wui-flex
3197        flexDirection="column"
3198        .padding=${["6","5","5","5"]}
3199        alignItems="center"
3200        gap="5"
3201      >
3202        <w3m-help-widget .data=${wo}></w3m-help-widget>
3203        <wui-button
3204          variant="accent-primary"
3205          size="md"
3206          @click=${()=>{y.openHref("https://ethereum.org/en/developers/docs/networks/","_blank")}}
3207        >
3208          Learn more
3209          <wui-icon color="inherit" slot="iconRight" name="externalLink"></wui-icon>
3210        </wui-button>
3211      </wui-flex>
3212    `}};Ai=po([p("w3m-what-is-a-network-view")],Ai);const fo=ee`
3213  :host > wui-flex {
3214    max-height: clamp(360px, 540px, 80vh);
3215    overflow: scroll;
3216    scrollbar-width: none;
3217  }
3218
3219  :host > wui-flex::-webkit-scrollbar {
3220    display: none;
3221  }
3222`;var ai=function(t,e,i,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};let rt=class extends f{constructor(){var e;super(),this.swapUnsupportedChain=(e=h.state.data)==null?void 0:e.swapUnsupportedChain,this.unsubscribe=[],this.disconnecting=!1,this.remoteFeatures=m.state.remoteFeatures,this.unsubscribe.push(Ee.subscribeNetworkImages(()=>this.requestUpdate()),m.subscribeKey("remoteFeatures",i=>{this.remoteFeatures=i}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return l`
3223      <wui-flex class="container" flexDirection="column" gap="0">
3224        <wui-flex
3225          class="container"
3226          flexDirection="column"
3227          .padding=${["3","5","2","5"]}
3228          alignItems="center"
3229          gap="5"
3230        >
3231          ${this.descriptionTemplate()}
3232        </wui-flex>
3233
3234        <wui-flex flexDirection="column" padding="3" gap="2"> ${this.networksTemplate()} </wui-flex>
3235
3236        <wui-separator text="or"></wui-separator>
3237        <wui-flex flexDirection="column" padding="3" gap="2">
3238          <wui-list-item
3239            variant="icon"
3240            iconVariant="overlay"
3241            icon="signOut"
3242            ?chevron=${!1}
3243            .loading=${this.disconnecting}
3244            @click=${this.onDisconnect.bind(this)}
3245            data-testid="disconnect-button"
3246          >
3247            <wui-text variant="md-medium" color="secondary">Disconnect</wui-text>
3248          </wui-list-item>
3249        </wui-flex>
3250      </wui-flex>
3251    `}descriptionTemplate(){return this.swapUnsupportedChain?l`
3252        <wui-text variant="sm-regular" color="secondary" align="center">
3253          The swap feature doesn’t support your current network. Switch to an available option to
3254          continue.
3255        </wui-text>
3256      `:l`
3257      <wui-text variant="sm-regular" color="secondary" align="center">
3258        This app doesn’t support your current network. Switch to an available option to continue.
3259      </wui-text>
3260    `}networksTemplate(){const e=d.getAllRequestedCaipNetworks(),i=d.getAllApprovedCaipNetworkIds(),o=y.sortRequestedNetworks(i,e);return(this.swapUnsupportedChain?o.filter(n=>D.SWAP_SUPPORTED_NETWORKS.includes(n.caipNetworkId)):o).map(n=>l`
3261        <wui-list-network
3262          imageSrc=${w(S.getNetworkImage(n))}
3263          name=${n.name??"Unknown"}
3264          @click=${()=>this.onSwitchNetwork(n)}
3265        >
3266        </wui-list-network>
3267      `)}async onDisconnect(){var e;try{this.disconnecting=!0;const i=d.state.activeChain,r=x.getConnections(i).length>0,n=i&&b.state.activeConnectorIds[i],s=(e=this.remoteFeatures)==null?void 0:e.multiWallet;await x.disconnect(s?{id:n,namespace:i}:{}),r&&s&&(h.push("ProfileWallets"),A.showSuccess("Wallet deleted"))}catch{C.sendEvent({type:"track",event:"DISCONNECT_ERROR",properties:{message:"Failed to disconnect"}}),A.showError("Failed to disconnect")}finally{this.disconnecting=!1}}async onSwitchNetwork(e){const i=d.getActiveCaipAddress(),o=d.getAllApprovedCaipNetworkIds(),r=d.getNetworkProp("supportsAllNetworks",e.chainNamespace),n=h.state.data;i?o!=null&&o.includes(e.caipNetworkId)?await d.switchActiveNetwork(e):r?h.push("SwitchNetwork",{...n,network:e}):h.push("SwitchNetwork",{...n,network:e}):i||(d.setActiveCaipNetwork(e),h.push("Connect"))}};rt.styles=fo;ai([u()],rt.prototype,"disconnecting",void 0);ai([u()],rt.prototype,"remoteFeatures",void 0);rt=ai([p("w3m-unsupported-chain-view")],rt);const mo=v`
3268  wui-flex {
3269    width: 100%;
3270    display: flex;
3271    align-items: center;
3272    justify-content: center;
3273    gap: ${({spacing:t})=>t[2]};
3274    border-radius: ${({borderRadius:t})=>t[4]};
3275    padding: ${({spacing:t})=>t[3]};
3276  }
3277
3278  /* -- Types --------------------------------------------------------- */
3279  wui-flex[data-type='info'] {
3280    color: ${({tokens:t})=>t.theme.textSecondary};
3281    background-color: ${({tokens:t})=>t.theme.foregroundPrimary};
3282  }
3283
3284  wui-flex[data-type='success'] {
3285    color: ${({tokens:t})=>t.core.textSuccess};
3286    background-color: ${({tokens:t})=>t.core.backgroundSuccess};
3287  }
3288
3289  wui-flex[data-type='error'] {
3290    color: ${({tokens:t})=>t.core.textError};
3291    background-color: ${({tokens:t})=>t.core.backgroundError};
3292  }
3293
3294  wui-flex[data-type='warning'] {
3295    color: ${({tokens:t})=>t.core.textWarning};
3296    background-color: ${({tokens:t})=>t.core.backgroundWarning};
3297  }
3298
3299  wui-flex[data-type='info'] wui-icon-box {
3300    background-color: ${({tokens:t})=>t.theme.foregroundSecondary};
3301  }
3302
3303  wui-flex[data-type='success'] wui-icon-box {
3304    background-color: ${({tokens:t})=>t.core.backgroundSuccess};
3305  }
3306
3307  wui-flex[data-type='error'] wui-icon-box {
3308    background-color: ${({tokens:t})=>t.core.backgroundError};
3309  }
3310
3311  wui-flex[data-type='warning'] wui-icon-box {
3312    background-color: ${({tokens:t})=>t.core.backgroundWarning};
3313  }
3314
3315  wui-text {
3316    flex: 1;
3317  }
3318`;
3318var Pt=function(t,e,i,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};let Ke=class extends f{constructor(){super(...arguments),this.icon="externalLink",this.text="",this.type="info"}render(){return l`
3319      <wui-flex alignItems="center" data-type=${this.type}>
3320        <wui-icon-box size="sm" color="inherit" icon=${this.icon}></wui-icon-box>
3321        <wui-text variant="md-regular" color="inherit">${this.text}</wui-text>
3322      </wui-flex>
3323    `}};Ke.styles=[_,W,mo];Pt([c()],Ke.prototype,"icon",void 0);Pt([c()],Ke.prototype,"text",void 0);Pt([c()],Ke.prototype,"type",void 0);Ke=Pt([p("wui-banner")],Ke);const bo=ee`
3324  :host > wui-flex {
3325    max-height: clamp(360px, 540px, 80vh);
3326    overflow: scroll;
3327    scrollbar-width: none;
3328  }
3329
3330  :host > wui-flex::-webkit-scrollbar {
3331    display: none;
3332  }
3333`;var go=function(t,e,i,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};let Kt=class extends f{constructor(){super(),this.unsubscribe=[]}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return l` <wui-flex flexDirection="column" .padding=${["2","3","3","3"]} gap="2">
3334      <wui-banner
3335        icon="warningCircle"
3336        text="You can only receive assets on these networks"
3337      ></wui-banner>
3338      ${this.networkTemplate()}
3339    </wui-flex>`}networkTemplate(){const e=d.getAllRequestedCaipNetworks(),i=d.getAllApprovedCaipNetworkIds(),o=d.state.activeCaipNetwork,r=d.checkIfSmartAccountEnabled();let n=y.sortRequestedNetworks(i,e);if(r&&ze(o==null?void 0:o.chainNamespace)===Fe.ACCOUNT_TYPES.SMART_ACCOUNT){if(!o)return null;n=[o]}return n.filter(a=>a.chainNamespace===(o==null?void 0:o.chainNamespace)).map(a=>l`
3340        <wui-list-network
3341          imageSrc=${w(S.getNetworkImage(a))}
3342          name=${a.name??"Unknown"}
3343          ?transparent=${!0}
3344        >
3345        </wui-list-network>
3346      `)}};Kt.styles=bo;Kt=go([p("w3m-wallet-compatible-networks-view")],Kt);const yo=v`
3347  :host {
3348    display: flex;
3349    justify-content: center;
3350    align-items: center;
3351    width: 56px;
3352    height: 56px;
3353    box-shadow: 0 0 0 8px ${({tokens:t})=>t.theme.borderPrimary};
3354    border-radius: ${({borderRadius:t})=>t[4]};
3355    overflow: hidden;
3356  }
3357
3358  :host([data-border-radius-full='true']) {
3359    border-radius: 50px;
3360  }
3361
3362  wui-icon {
3363    width: 32px;
3364    height: 32px;
3365  }
3366`;var Dt=function(t,e,i,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};let Ge=class extends f{render(){return this.dataset.borderRadiusFull=this.borderRadiusFull?"true":"false",l`${this.templateVisual()}`}templateVisual(){return this.imageSrc?l`<wui-image src=${this.imageSrc} alt=${this.alt??""}></wui-image>`:l`<wui-icon
3367      data-parent-size="md"
3368      size="inherit"
3369      color="inherit"
3370      name="wallet"
3371    ></wui-icon>`}};Ge.styles=[_,yo];Dt([c()],Ge.prototype,"imageSrc",void 0);Dt([c()],Ge.prototype,"alt",void 0);Dt([c({type:Boolean})],Ge.prototype,"borderRadiusFull",void 0);Ge=Dt([p("wui-visual-thumbnail")],Ge);const xo=v`
3372  :host {
3373    display: flex;
3374    justify-content: center;
3375    gap: ${({spacing:t})=>t[4]};
3376  }
3377
3378  wui-visual-thumbnail:nth-child(1) {
3379    z-index: 1;
3380  }
3381`;var vo=function(t,e,i,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};let Gt=class extends f{constructor(){var e,i,o;super(...arguments),this.dappImageUrl=(e=m.state.metadata)==null?void 0:e.icons,this.walletImageUrl=(o=(i=d.getAccountData())==null?void 0:i.connectedWalletInfo)==null?void 0:o.icon}firstUpdated(){var i;const e=(i=this.shadowRoot)==null?void 0:i.querySelectorAll("wui-visual-thumbnail");e!=null&&e[0]&&this.createAnimation(e[0],"translate(18px)"),e!=null&&e[1]&&this.createAnimation(e[1],"translate(-18px)")}render(){var e;return l`
3382      <wui-visual-thumbnail
3383        ?borderRadiusFull=${!0}
3384        .imageSrc=${(e=this.dappImageUrl)==null?void 0:e[0]}
3385      ></wui-visual-thumbnail>
3386      <wui-visual-thumbnail .imageSrc=${this.walletImageUrl}></wui-visual-thumbnail>
3387    `}createAnimation(e,i){e.animate([{transform:"translateX(0px)"},{transform:i}],{duration:1600,easing:"cubic-bezier(0.56, 0, 0.48, 1)",direction:"alternate",iterations:1/0})}};Gt.styles=xo;Gt=vo([p("w3m-siwx-sign-message-thumbnails")],Gt);
3387var li=function(t,e,i,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};let Rt=class extends f{constructor(){var e;super(...arguments),this.dappName=(e=m.state.metadata)==null?void 0:e.name,this.isCancelling=!1,this.isSigning=!1}render(){return l`
3388      <wui-flex justifyContent="center" .padding=${["8","0","6","0"]}>
3389        <w3m-siwx-sign-message-thumbnails></w3m-siwx-sign-message-thumbnails>
3390      </wui-flex>
3391      <wui-flex .padding=${["0","20","5","20"]} gap="3" justifyContent="space-between">
3392        <wui-text variant="lg-medium" align="center" color="primary"
3393          >${this.dappName??"Dapp"} needs to connect to your wallet</wui-text
3394        >
3395      </wui-flex>
3396      <wui-flex .padding=${["0","10","4","10"]} gap="3" justifyContent="space-between">
3397        <wui-text variant="md-regular" align="center" color="secondary"
3398          >Sign this message to prove you own this wallet and proceed. Canceling will disconnect
3399          you.</wui-text
3400        >
3401      </wui-flex>
3402      <wui-flex .padding=${["4","5","5","5"]} gap="3" justifyContent="space-between">
3403        <wui-button
3404          size="lg"
3405          borderRadius="xs"
3406          fullWidth
3407          variant="neutral-secondary"
3408          ?loading=${this.isCancelling}
3409          @click=${this.onCancel.bind(this)}
3410          data-testid="w3m-connecting-siwe-cancel"
3411        >
3412          ${this.isCancelling?"Cancelling...":"Cancel"}
3413        </wui-button>
3414        <wui-button
3415          size="lg"
3416          borderRadius="xs"
3417          fullWidth
3418          variant="neutral-primary"
3419          @click=${this.onSign.bind(this)}
3420          ?loading=${this.isSigning}
3421          data-testid="w3m-connecting-siwe-sign"
3422        >
3423          ${this.isSigning?"Signing...":"Sign"}
3424        </wui-button>
3425      </wui-flex>
3426    `}async onSign(){this.isSigning=!0;try{await Bt.requestSignMessage()}catch(e){if(e instanceof Error&&e.message.includes("OTP is required")){A.showError({message:"Something went wrong. We need to verify your account again."}),h.replace("DataCapture");return}throw e}finally{this.isSigning=!1}}async onCancel(){this.isCancelling=!0,await Bt.cancelSignMessage().finally(()=>this.isCancelling=!1)}};li([u()],Rt.prototype,"isCancelling",void 0);li([u()],Rt.prototype,"isSigning",void 0);Rt=li([p("w3m-siwx-sign-message-view")],Rt);export{di as AppKitAccountButton,hi as AppKitButton,wi as AppKitConnectButton,mi as AppKitNetworkButton,ci as W3mAccountButton,be as W3mAccountSettingsView,Ft as W3mAccountView,vt as W3mAllWalletsView,ui as W3mButton,At as W3mChooseAccountNameView,pi as W3mConnectButton,H as W3mConnectView,It as W3mConnectWalletsView,xi as W3mConnectingExternalView,Ct as W3mConnectingMultiChainView,kt as W3mConnectingWcBasicView,we as W3mConnectingWcView,Si as W3mDownloadsView,ks as W3mFooter,Te as W3mFundWalletView,Ei as W3mGetWalletView,fi as W3mNetworkButton,ot as W3mNetworkSwitchView,Le as W3mNetworksView,B as W3mProfileWalletsView,As as W3mRouter,Rt as W3mSIWXSignMessageView,_t as W3mSwitchActiveChainView,rt as W3mUnsupportedChainView,Kt as W3mWalletCompatibleNetworksView,Ai as W3mWhatIsANetworkView,ki as W3mWhatIsAWalletView};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.