PageSourceSearch

https://most-active-guild.web.app/assets/index-BOg8yWzs.js

js most-active-guild.web.app collected 2026-10-03 12:30:55 UTC 228,611 bytes, 3,499 lines download raw bytes

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