@dcl-regenesislabs/mobile-hub 1.0.0-20601593503.commit-26e252e

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/assets/PhArrowCircleDown-BtlNV0TZ.js +14 -0
  2. package/assets/PhArrowClockwise-mOiWYLMV.js +14 -0
  3. package/assets/PhArrowDown-CkoOD89h.js +14 -0
  4. package/assets/PhArrowLeft-C0jlxVhM.js +14 -0
  5. package/assets/PhArrowRight-BI-V03Xf.js +14 -0
  6. package/assets/PhArrowSquareOut-DnQ7n_B4.js +14 -0
  7. package/assets/PhArrowUp-izKvURUW.js +14 -0
  8. package/assets/PhArrowUpRight-Bn-JhHsY.js +14 -0
  9. package/assets/PhArrowsClockwise-Brtx2Re-.js +14 -0
  10. package/assets/PhArrowsDownUp-PZosTqZG.js +14 -0
  11. package/assets/PhArrowsLeftRight-CYsRQ2qh.js +14 -0
  12. package/assets/PhBank-hhPAIPVb.js +14 -0
  13. package/assets/PhBrowser-BjzAmrHO.js +14 -0
  14. package/assets/PhCaretDown-ddSjwcwm.js +14 -0
  15. package/assets/PhCaretLeft-B7YLoNEF.js +14 -0
  16. package/assets/PhCaretRight-BY8D5MIg.js +14 -0
  17. package/assets/PhCaretUp-BG10nSut.js +14 -0
  18. package/assets/PhCheck-DrKd7pBC.js +14 -0
  19. package/assets/PhCircleHalf-Bk9C4DvT.js +14 -0
  20. package/assets/PhClock-Sj17weCB.js +14 -0
  21. package/assets/PhCompass-Df1ugFO-.js +14 -0
  22. package/assets/PhCopy-rgttky8E.js +14 -0
  23. package/assets/PhCreditCard-CZpdid2n.js +14 -0
  24. package/assets/PhCurrencyDollar-B6IKKjue.js +14 -0
  25. package/assets/PhDesktop-BuCDXYJj.js +14 -0
  26. package/assets/PhDeviceMobile-CnybhXY-.js +14 -0
  27. package/assets/PhDotsThree-CSAEcba1.js +14 -0
  28. package/assets/PhEnvelope-SmaNeXoQ.js +14 -0
  29. package/assets/PhFunnelSimple-DKx35ITq.js +14 -0
  30. package/assets/PhGlobe-q1mqj65V.js +14 -0
  31. package/assets/PhIdentificationCard-BeLXJpfZ.js +14 -0
  32. package/assets/PhImage-BYrKfN9k.js +14 -0
  33. package/assets/PhInfo-X33f06Ej.js +14 -0
  34. package/assets/PhLightbulb-DMZJsowR.js +14 -0
  35. package/assets/PhMagnifyingGlass-B6D0sWFL.js +14 -0
  36. package/assets/PhPaperPlaneRight-Dvo-nXr9.js +14 -0
  37. package/assets/PhPlus-CBvZvLax.js +14 -0
  38. package/assets/PhPower-D8-AcNM6.js +14 -0
  39. package/assets/PhPuzzlePiece-C-7mYqGO.js +14 -0
  40. package/assets/PhQrCode-uIXlI5ER.js +14 -0
  41. package/assets/PhQuestion-rUoqC2sC.js +14 -0
  42. package/assets/PhQuestionMark-W55Txvvb.js +14 -0
  43. package/assets/PhSealCheck-BeVLq9PH.js +14 -0
  44. package/assets/PhSignOut-Cq2PivQ6.js +14 -0
  45. package/assets/PhSpinner-CZMtAFdX.js +14 -0
  46. package/assets/PhTrash-BamrmMsN.js +14 -0
  47. package/assets/PhUser-A2fxqIV0.js +14 -0
  48. package/assets/PhVault-B8m1usHw.js +14 -0
  49. package/assets/PhWarning-CpkID9oi.js +14 -0
  50. package/assets/PhWarningCircle-Cm58gXb9.js +14 -0
  51. package/assets/PhX-C3b4cCEy.js +14 -0
  52. package/assets/basic-BqNJI8_e.js +1423 -0
  53. package/assets/core-CHil1RFh.js +217 -0
  54. package/assets/features-C-ekZReg.js +5 -0
  55. package/assets/fortmatic-Fv2dqlKd.js +13 -0
  56. package/assets/index-8e4wv-tH.js +1 -0
  57. package/assets/index-B06SWXYS.js +36 -0
  58. package/assets/index-BH66FyTx.js +23 -0
  59. package/assets/index-Bxs-jmhN.js +15 -0
  60. package/assets/index-CcyN_bjy.css +1 -0
  61. package/assets/index-DoQzB8-2.js +5 -0
  62. package/assets/index-Nz_EXiLp.js +7 -0
  63. package/assets/index-QHMvomuf.js +1 -0
  64. package/assets/index-r-E8-KUv.js +1298 -0
  65. package/assets/property-CnFDNXw5.js +3 -0
  66. package/assets/w3m-modal-DV77a3rm.js +1209 -0
  67. package/index.html +14 -0
  68. package/package.json +22 -0
  69. package/vite.svg +1 -0
@@ -0,0 +1,1423 @@
1
+ import{i as M,C as K,A as N,O as q,a as L,b as P,c as He,d as u,E as F,R as B,e as U,f as Kt,g as ye,h as ge,H as Yn,r as J,j as me,T as Lt,S as Me,M as kn,k as An,l as Bn,m as Pn,w as Oe,n as fe,o as Xn,p as Zn,q as Gt,s as Ln,W as Nt}from"./core-CHil1RFh.js";import{n as d,r as T,c as O,o as j,U as ce,i as ei,t as ti,e as ni}from"./index-r-E8-KUv.js";import{a as ii}from"./index-BH66FyTx.js";import"./index-Bxs-jmhN.js";var Be=function(e,t,i,r){var o=arguments.length,n=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,i):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(n=(o<3?s(n):o>3?s(t,i,n):s(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n};let ve=class extends M{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=K.state.connectors,this.count=N.state.count,this.filteredCount=N.state.filteredWallets.length,this.isFetchingRecommendedWallets=N.state.isFetchingRecommendedWallets,this.unsubscribe.push(K.subscribeKey("connectors",t=>this.connectors=t),N.subscribeKey("count",t=>this.count=t),N.subscribeKey("filteredWallets",t=>this.filteredCount=t.length),N.subscribeKey("isFetchingRecommendedWallets",t=>this.isFetchingRecommendedWallets=t))}disconnectedCallback(){this.unsubscribe.forEach(t=>t())}render(){const t=this.connectors.find(c=>c.id==="walletConnect"),{allWallets:i}=q.state;if(!t||i==="HIDE"||i==="ONLY_MOBILE"&&!L.isMobile())return null;const r=N.state.featured.length,o=this.count+r,n=o<10?o:Math.floor(o/10)*10,s=this.filteredCount>0?this.filteredCount:n;let a=`${s}`;this.filteredCount>0?a=`${this.filteredCount}`:s<o&&(a=`${s}+`);const l=P.hasAnyConnection(He.CONNECTOR_ID.WALLET_CONNECT);return u`
2
+ <wui-list-wallet
3
+ name="Search Wallet"
4
+ walletIcon="search"
5
+ showAllWallets
6
+ @click=${this.onAllWallets.bind(this)}
7
+ tagLabel=${a}
8
+ tagVariant="info"
9
+ data-testid="all-wallets"
10
+ tabIdx=${j(this.tabIdx)}
11
+ .loading=${this.isFetchingRecommendedWallets}
12
+ ?disabled=${l}
13
+ size="sm"
14
+ ></wui-list-wallet>
15
+ `}onAllWallets(){F.sendEvent({type:"track",event:"CLICK_ALL_WALLETS"}),B.push("AllWallets",{redirectView:B.state.data?.redirectView})}};Be([d()],ve.prototype,"tabIdx",void 0);Be([T()],ve.prototype,"connectors",void 0);Be([T()],ve.prototype,"count",void 0);Be([T()],ve.prototype,"filteredCount",void 0);Be([T()],ve.prototype,"isFetchingRecommendedWallets",void 0);ve=Be([O("w3m-all-wallets-widget")],ve);const ri=U`
16
+ :host {
17
+ margin-top: ${({spacing:e})=>e[1]};
18
+ }
19
+ wui-separator {
20
+ margin: ${({spacing:e})=>e[3]} calc(${({spacing:e})=>e[3]} * -1)
21
+ ${({spacing:e})=>e[2]} calc(${({spacing:e})=>e[3]} * -1);
22
+ width: calc(100% + ${({spacing:e})=>e[3]} * 2);
23
+ }
24
+ `;var de=function(e,t,i,r){var o=arguments.length,n=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,i):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(n=(o<3?s(n):o>3?s(t,i,n):s(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n};let Z=class extends M{constructor(){super(),this.unsubscribe=[],this.connectors=K.state.connectors,this.recommended=N.state.recommended,this.featured=N.state.featured,this.explorerWallets=N.state.explorerWallets,this.connections=P.state.connections,this.connectorImages=Kt.state.connectorImages,this.loadingTelegram=!1,this.unsubscribe.push(K.subscribeKey("connectors",t=>this.connectors=t),P.subscribeKey("connections",t=>this.connections=t),Kt.subscribeKey("connectorImages",t=>this.connectorImages=t),N.subscribeKey("recommended",t=>this.recommended=t),N.subscribeKey("featured",t=>this.featured=t),N.subscribeKey("explorerFilteredWallets",t=>{this.explorerWallets=t?.length?t:N.state.explorerWallets}),N.subscribeKey("explorerWallets",t=>{this.explorerWallets?.length||(this.explorerWallets=t)})),L.isTelegram()&&L.isIos()&&(this.loadingTelegram=!P.state.wcUri,this.unsubscribe.push(P.subscribeKey("wcUri",t=>this.loadingTelegram=!t)))}disconnectedCallback(){this.unsubscribe.forEach(t=>t())}render(){return u`
25
+ <wui-flex flexDirection="column" gap="2"> ${this.connectorListTemplate()} </wui-flex>
26
+ `}mapConnectorsToExplorerWallets(t,i){return t.map(r=>{if(r.type==="MULTI_CHAIN"&&r.connectors){const n=r.connectors.map(c=>c.id),s=r.connectors.map(c=>c.name),a=r.connectors.map(c=>c.info?.rdns),l=i?.find(c=>n.includes(c.id)||s.includes(c.name)||c.rdns&&(a.includes(c.rdns)||n.includes(c.rdns)));return r.explorerWallet=l??r.explorerWallet,r}const o=i?.find(n=>n.id===r.id||n.rdns===r.info?.rdns||n.name===r.name);return r.explorerWallet=o??r.explorerWallet,r})}processConnectorsByType(t,i=!0){const r=ye.sortConnectorsByExplorerWallet([...t]);return i?r.filter(ye.showConnector):r}connectorListTemplate(){const t=this.mapConnectorsToExplorerWallets(this.connectors,this.explorerWallets??[]),i=ye.getConnectorsByType(t,this.recommended,this.featured),r=this.processConnectorsByType(i.announced.filter(h=>h.id!=="walletConnect")),o=this.processConnectorsByType(i.injected),n=this.processConnectorsByType(i.multiChain.filter(h=>h.name!=="WalletConnect"),!1),s=i.custom,a=i.recent,l=this.processConnectorsByType(i.external.filter(h=>h.id!==He.CONNECTOR_ID.COINBASE_SDK)),c=i.recommended,f=i.featured,E=ye.getConnectorTypeOrder({custom:s,recent:a,announced:r,injected:o,multiChain:n,recommended:c,featured:f,external:l}),y=this.connectors.find(h=>h.id==="walletConnect"),p=L.isMobile(),v=[];for(const h of E)switch(h){case"walletConnect":{!p&&y&&v.push({kind:"connector",subtype:"walletConnect",connector:y});break}case"recent":{ye.getFilteredRecentWallets().forEach(g=>v.push({kind:"wallet",subtype:"recent",wallet:g}));break}case"injected":{n.forEach(w=>v.push({kind:"connector",subtype:"multiChain",connector:w})),r.forEach(w=>v.push({kind:"connector",subtype:"announced",connector:w})),o.forEach(w=>v.push({kind:"connector",subtype:"injected",connector:w}));break}case"featured":{f.forEach(w=>v.push({kind:"wallet",subtype:"featured",wallet:w}));break}case"custom":{ye.getFilteredCustomWallets(s??[]).forEach(g=>v.push({kind:"wallet",subtype:"custom",wallet:g}));break}case"external":{l.forEach(w=>v.push({kind:"connector",subtype:"external",connector:w}));break}case"recommended":{ye.getCappedRecommendedWallets(c).forEach(g=>v.push({kind:"wallet",subtype:"recommended",wallet:g}));break}default:console.warn(`Unknown connector type: ${h}`)}return v.map((h,w)=>h.kind==="connector"?this.renderConnector(h,w):this.renderWallet(h,w))}renderConnector(t,i){const r=t.connector,o=ge.getConnectorImage(r)||this.connectorImages[r?.imageId??""],s=(this.connections.get(r.chain)??[]).some(E=>Yn.isLowerCaseMatch(E.connectorId,r.id));let a,l;t.subtype==="multiChain"?(a="multichain",l="info"):t.subtype==="walletConnect"?(a="qr code",l="accent"):t.subtype==="injected"||t.subtype==="announced"?(a=s?"connected":"installed",l=s?"info":"success"):(a=void 0,l=void 0);const c=P.hasAnyConnection(He.CONNECTOR_ID.WALLET_CONNECT),f=t.subtype==="walletConnect"||t.subtype==="external"?c:!1;return u`
27
+ <w3m-list-wallet
28
+ displayIndex=${i}
29
+ imageSrc=${j(o)}
30
+ .installed=${!0}
31
+ name=${r.name??"Unknown"}
32
+ .tagVariant=${l}
33
+ tagLabel=${j(a)}
34
+ data-testid=${`wallet-selector-${r.id.toLowerCase()}`}
35
+ size="sm"
36
+ @click=${()=>this.onClickConnector(t)}
37
+ tabIdx=${j(this.tabIdx)}
38
+ ?disabled=${f}
39
+ rdnsId=${j(r.explorerWallet?.rdns||void 0)}
40
+ walletRank=${j(r.explorerWallet?.order)}
41
+ >
42
+ </w3m-list-wallet>
43
+ `}onClickConnector(t){const i=B.state.data?.redirectView;if(t.subtype==="walletConnect"){K.setActiveConnector(t.connector),L.isMobile()?B.push("AllWallets"):B.push("ConnectingWalletConnect",{redirectView:i});return}if(t.subtype==="multiChain"){K.setActiveConnector(t.connector),B.push("ConnectingMultiChain",{redirectView:i});return}if(t.subtype==="injected"){K.setActiveConnector(t.connector),B.push("ConnectingExternal",{connector:t.connector,redirectView:i,wallet:t.connector.explorerWallet});return}if(t.subtype==="announced"){if(t.connector.id==="walletConnect"){L.isMobile()?B.push("AllWallets"):B.push("ConnectingWalletConnect",{redirectView:i});return}B.push("ConnectingExternal",{connector:t.connector,redirectView:i,wallet:t.connector.explorerWallet});return}B.push("ConnectingExternal",{connector:t.connector,redirectView:i})}renderWallet(t,i){const r=t.wallet,o=ge.getWalletImage(r),s=P.hasAnyConnection(He.CONNECTOR_ID.WALLET_CONNECT),a=this.loadingTelegram,l=t.subtype==="recent"?"recent":void 0,c=t.subtype==="recent"?"info":void 0;return u`
44
+ <w3m-list-wallet
45
+ displayIndex=${i}
46
+ imageSrc=${j(o)}
47
+ name=${r.name??"Unknown"}
48
+ @click=${()=>this.onClickWallet(t)}
49
+ size="sm"
50
+ data-testid=${`wallet-selector-${r.id}`}
51
+ tabIdx=${j(this.tabIdx)}
52
+ ?loading=${a}
53
+ ?disabled=${s}
54
+ rdnsId=${j(r.rdns||void 0)}
55
+ walletRank=${j(r.order)}
56
+ tagLabel=${j(l)}
57
+ .tagVariant=${c}
58
+ >
59
+ </w3m-list-wallet>
60
+ `}onClickWallet(t){const i=B.state.data?.redirectView;if(t.subtype==="featured"){K.selectWalletConnector(t.wallet);return}if(t.subtype==="recent"){if(this.loadingTelegram)return;K.selectWalletConnector(t.wallet);return}if(t.subtype==="custom"){if(this.loadingTelegram)return;B.push("ConnectingWalletConnect",{wallet:t.wallet,redirectView:i});return}if(this.loadingTelegram)return;const r=K.getConnector({id:t.wallet.id,rdns:t.wallet.rdns});r?B.push("ConnectingExternal",{connector:r,redirectView:i}):B.push("ConnectingWalletConnect",{wallet:t.wallet,redirectView:i})}};Z.styles=ri;de([d({type:Number})],Z.prototype,"tabIdx",void 0);de([T()],Z.prototype,"connectors",void 0);de([T()],Z.prototype,"recommended",void 0);de([T()],Z.prototype,"featured",void 0);de([T()],Z.prototype,"explorerWallets",void 0);de([T()],Z.prototype,"connections",void 0);de([T()],Z.prototype,"connectorImages",void 0);de([T()],Z.prototype,"loadingTelegram",void 0);Z=de([O("w3m-connector-list")],Z);const oi=U`
61
+ :host {
62
+ flex: 1;
63
+ height: 100%;
64
+ }
65
+
66
+ button {
67
+ width: 100%;
68
+ height: 100%;
69
+ display: inline-flex;
70
+ align-items: center;
71
+ padding: ${({spacing:e})=>e[1]} ${({spacing:e})=>e[2]};
72
+ column-gap: ${({spacing:e})=>e[1]};
73
+ color: ${({tokens:e})=>e.theme.textSecondary};
74
+ border-radius: ${({borderRadius:e})=>e[20]};
75
+ background-color: transparent;
76
+ transition: background-color ${({durations:e})=>e.lg}
77
+ ${({easings:e})=>e["ease-out-power-2"]};
78
+ will-change: background-color;
79
+ }
80
+
81
+ /* -- Hover & Active states ----------------------------------------------------------- */
82
+ button[data-active='true'] {
83
+ color: ${({tokens:e})=>e.theme.textPrimary};
84
+ background-color: ${({tokens:e})=>e.theme.foregroundTertiary};
85
+ }
86
+
87
+ button:hover:enabled:not([data-active='true']),
88
+ button:active:enabled:not([data-active='true']) {
89
+ wui-text,
90
+ wui-icon {
91
+ color: ${({tokens:e})=>e.theme.textPrimary};
92
+ }
93
+ }
94
+ `;var je=function(e,t,i,r){var o=arguments.length,n=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,i):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(n=(o<3?s(n):o>3?s(t,i,n):s(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n};const si={lg:"lg-regular",md:"md-regular",sm:"sm-regular"},ai={lg:"md",md:"sm",sm:"sm"};let Ce=class extends M{constructor(){super(...arguments),this.icon="mobile",this.size="md",this.label="",this.active=!1}render(){return u`
95
+ <button data-active=${this.active}>
96
+ ${this.icon?u`<wui-icon size=${ai[this.size]} name=${this.icon}></wui-icon>`:""}
97
+ <wui-text variant=${si[this.size]}> ${this.label} </wui-text>
98
+ </button>
99
+ `}};Ce.styles=[J,me,oi];je([d()],Ce.prototype,"icon",void 0);je([d()],Ce.prototype,"size",void 0);je([d()],Ce.prototype,"label",void 0);je([d({type:Boolean})],Ce.prototype,"active",void 0);Ce=je([O("wui-tab-item")],Ce);const li=U`
100
+ :host {
101
+ display: inline-flex;
102
+ align-items: center;
103
+ background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
104
+ border-radius: ${({borderRadius:e})=>e[32]};
105
+ padding: ${({spacing:e})=>e["01"]};
106
+ box-sizing: border-box;
107
+ }
108
+
109
+ :host([data-size='sm']) {
110
+ height: 26px;
111
+ }
112
+
113
+ :host([data-size='md']) {
114
+ height: 36px;
115
+ }
116
+ `;var Ue=function(e,t,i,r){var o=arguments.length,n=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,i):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(n=(o<3?s(n):o>3?s(t,i,n):s(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n};let $e=class extends M{constructor(){super(...arguments),this.tabs=[],this.onTabChange=()=>null,this.size="md",this.activeTab=0}render(){return this.dataset.size=this.size,this.tabs.map((t,i)=>{const r=i===this.activeTab;return u`
117
+ <wui-tab-item
118
+ @click=${()=>this.onTabClick(i)}
119
+ icon=${t.icon}
120
+ size=${this.size}
121
+ label=${t.label}
122
+ ?active=${r}
123
+ data-active=${r}
124
+ data-testid="tab-${t.label?.toLowerCase()}"
125
+ ></wui-tab-item>
126
+ `})}onTabClick(t){this.activeTab=t,this.onTabChange(t)}};$e.styles=[J,me,li];Ue([d({type:Array})],$e.prototype,"tabs",void 0);Ue([d()],$e.prototype,"onTabChange",void 0);Ue([d()],$e.prototype,"size",void 0);Ue([T()],$e.prototype,"activeTab",void 0);$e=Ue([O("wui-tabs")],$e);var Dt=function(e,t,i,r){var o=arguments.length,n=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,i):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(n=(o<3?s(n):o>3?s(t,i,n):s(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n};let Ke=class extends M{constructor(){super(...arguments),this.platformTabs=[],this.unsubscribe=[],this.platforms=[],this.onSelectPlatfrom=void 0}disconnectCallback(){this.unsubscribe.forEach(t=>t())}render(){const t=this.generateTabs();return u`
127
+ <wui-flex justifyContent="center" .padding=${["0","0","4","0"]}>
128
+ <wui-tabs .tabs=${t} .onTabChange=${this.onTabChange.bind(this)}></wui-tabs>
129
+ </wui-flex>
130
+ `}generateTabs(){const t=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=t.map(({platform:i})=>i),t}onTabChange(t){const i=this.platformTabs[t];i&&this.onSelectPlatfrom?.(i)}};Dt([d({type:Array})],Ke.prototype,"platforms",void 0);Dt([d()],Ke.prototype,"onSelectPlatfrom",void 0);Ke=Dt([O("w3m-connecting-header")],Ke);const ci=U`
131
+ :host {
132
+ display: block;
133
+ width: 100px;
134
+ height: 100px;
135
+ }
136
+
137
+ svg {
138
+ width: 100px;
139
+ height: 100px;
140
+ }
141
+
142
+ rect {
143
+ fill: none;
144
+ stroke: ${e=>e.colors.accent100};
145
+ stroke-width: 3px;
146
+ stroke-linecap: round;
147
+ animation: dash 1s linear infinite;
148
+ }
149
+
150
+ @keyframes dash {
151
+ to {
152
+ stroke-dashoffset: 0px;
153
+ }
154
+ }
155
+ `;var Nn=function(e,t,i,r){var o=arguments.length,n=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,i):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(n=(o<3?s(n):o>3?s(t,i,n):s(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n};let Ge=class extends M{constructor(){super(...arguments),this.radius=36}render(){return this.svgLoaderTemplate()}svgLoaderTemplate(){const t=this.radius>50?50:this.radius,r=36-t,o=116+r,n=245+r,s=360+r*1.75;return u`
156
+ <svg viewBox="0 0 110 110" width="110" height="110">
157
+ <rect
158
+ x="2"
159
+ y="2"
160
+ width="106"
161
+ height="106"
162
+ rx=${t}
163
+ stroke-dasharray="${o} ${n}"
164
+ stroke-dashoffset=${s}
165
+ />
166
+ </svg>
167
+ `}};Ge.styles=[J,ci];Nn([d({type:Number})],Ge.prototype,"radius",void 0);Ge=Nn([O("wui-loading-thumbnail")],Ge);const ui=U`
168
+ wui-flex {
169
+ width: 100%;
170
+ height: 52px;
171
+ box-sizing: border-box;
172
+ background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
173
+ border-radius: ${({borderRadius:e})=>e[5]};
174
+ padding-left: ${({spacing:e})=>e[3]};
175
+ padding-right: ${({spacing:e})=>e[3]};
176
+ display: flex;
177
+ align-items: center;
178
+ justify-content: space-between;
179
+ gap: ${({spacing:e})=>e[6]};
180
+ }
181
+
182
+ wui-text {
183
+ color: ${({tokens:e})=>e.theme.textSecondary};
184
+ }
185
+
186
+ wui-icon {
187
+ width: 12px;
188
+ height: 12px;
189
+ }
190
+ `;var it=function(e,t,i,r){var o=arguments.length,n=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,i):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(n=(o<3?s(n):o>3?s(t,i,n):s(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n};let ke=class extends M{constructor(){super(...arguments),this.disabled=!1,this.label="",this.buttonLabel=""}render(){return u`
191
+ <wui-flex justifyContent="space-between" alignItems="center">
192
+ <wui-text variant="lg-regular" color="inherit">${this.label}</wui-text>
193
+ <wui-button variant="accent-secondary" size="sm">
194
+ ${this.buttonLabel}
195
+ <wui-icon name="chevronRight" color="inherit" size="inherit" slot="iconRight"></wui-icon>
196
+ </wui-button>
197
+ </wui-flex>
198
+ `}};ke.styles=[J,me,ui];it([d({type:Boolean})],ke.prototype,"disabled",void 0);it([d()],ke.prototype,"label",void 0);it([d()],ke.prototype,"buttonLabel",void 0);ke=it([O("wui-cta-button")],ke);const di=U`
199
+ :host {
200
+ display: block;
201
+ padding: 0 ${({spacing:e})=>e[5]} ${({spacing:e})=>e[5]};
202
+ }
203
+ `;var On=function(e,t,i,r){var o=arguments.length,n=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,i):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(n=(o<3?s(n):o>3?s(t,i,n):s(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n};let Qe=class extends M{constructor(){super(...arguments),this.wallet=void 0}render(){if(!this.wallet)return this.style.display="none",null;const{name:t,app_store:i,play_store:r,chrome_store:o,homepage:n}=this.wallet,s=L.isMobile(),a=L.isIos(),l=L.isAndroid(),c=[i,r,n,o].filter(Boolean).length>1,f=ce.getTruncateString({string:t,charsStart:12,charsEnd:0,truncate:"end"});return c&&!s?u`
204
+ <wui-cta-button
205
+ label=${`Don't have ${f}?`}
206
+ buttonLabel="Get"
207
+ @click=${()=>B.push("Downloads",{wallet:this.wallet})}
208
+ ></wui-cta-button>
209
+ `:!c&&n?u`
210
+ <wui-cta-button
211
+ label=${`Don't have ${f}?`}
212
+ buttonLabel="Get"
213
+ @click=${this.onHomePage.bind(this)}
214
+ ></wui-cta-button>
215
+ `:i&&a?u`
216
+ <wui-cta-button
217
+ label=${`Don't have ${f}?`}
218
+ buttonLabel="Get"
219
+ @click=${this.onAppStore.bind(this)}
220
+ ></wui-cta-button>
221
+ `:r&&l?u`
222
+ <wui-cta-button
223
+ label=${`Don't have ${f}?`}
224
+ buttonLabel="Get"
225
+ @click=${this.onPlayStore.bind(this)}
226
+ ></wui-cta-button>
227
+ `:(this.style.display="none",null)}onAppStore(){this.wallet?.app_store&&L.openHref(this.wallet.app_store,"_blank")}onPlayStore(){this.wallet?.play_store&&L.openHref(this.wallet.play_store,"_blank")}onHomePage(){this.wallet?.homepage&&L.openHref(this.wallet.homepage,"_blank")}};Qe.styles=[di];On([d({type:Object})],Qe.prototype,"wallet",void 0);Qe=On([O("w3m-mobile-download-links")],Qe);const hi=U`
228
+ @keyframes shake {
229
+ 0% {
230
+ transform: translateX(0);
231
+ }
232
+ 25% {
233
+ transform: translateX(3px);
234
+ }
235
+ 50% {
236
+ transform: translateX(-3px);
237
+ }
238
+ 75% {
239
+ transform: translateX(3px);
240
+ }
241
+ 100% {
242
+ transform: translateX(0);
243
+ }
244
+ }
245
+
246
+ wui-flex:first-child:not(:only-child) {
247
+ position: relative;
248
+ }
249
+
250
+ wui-wallet-image {
251
+ width: 56px;
252
+ height: 56px;
253
+ }
254
+
255
+ wui-loading-thumbnail {
256
+ position: absolute;
257
+ }
258
+
259
+ wui-icon-box {
260
+ position: absolute;
261
+ right: calc(${({spacing:e})=>e[1]} * -1);
262
+ bottom: calc(${({spacing:e})=>e[1]} * -1);
263
+ opacity: 0;
264
+ transform: scale(0.5);
265
+ transition-property: opacity, transform;
266
+ transition-duration: ${({durations:e})=>e.lg};
267
+ transition-timing-function: ${({easings:e})=>e["ease-out-power-2"]};
268
+ will-change: opacity, transform;
269
+ }
270
+
271
+ wui-text[align='center'] {
272
+ width: 100%;
273
+ padding: 0px ${({spacing:e})=>e[4]};
274
+ }
275
+
276
+ [data-error='true'] wui-icon-box {
277
+ opacity: 1;
278
+ transform: scale(1);
279
+ }
280
+
281
+ [data-error='true'] > wui-flex:first-child {
282
+ animation: shake 250ms ${({easings:e})=>e["ease-out-power-2"]} both;
283
+ }
284
+
285
+ [data-retry='false'] wui-link {
286
+ display: none;
287
+ }
288
+
289
+ [data-retry='true'] wui-link {
290
+ display: block;
291
+ opacity: 1;
292
+ }
293
+
294
+ w3m-mobile-download-links {
295
+ padding: 0px;
296
+ width: 100%;
297
+ }
298
+ `;var ee=function(e,t,i,r){var o=arguments.length,n=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,i):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(n=(o<3?s(n):o>3?s(t,i,n):s(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n};class z extends M{constructor(){super(),this.wallet=B.state.data?.wallet,this.connector=B.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=ge.getConnectorImage(this.connector)??ge.getWalletImage(this.wallet),this.name=this.wallet?.name??this.connector?.name??"Wallet",this.isRetrying=!1,this.uri=P.state.wcUri,this.error=P.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(P.subscribeKey("wcUri",t=>{this.uri=t,this.isRetrying&&this.onRetry&&(this.isRetrying=!1,this.onConnect?.())}),P.subscribeKey("wcError",t=>this.error=t)),(L.isTelegram()||L.isSafari())&&L.isIos()&&P.state.wcUri&&this.onConnect?.()}firstUpdated(){this.onAutoConnect?.(),this.showRetry=!this.onAutoConnect}disconnectedCallback(){this.unsubscribe.forEach(t=>t()),P.setWcError(!1),clearTimeout(this.timeout)}render(){this.onRender?.(),this.onShowRetry();const t=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")),u`
299
+ <wui-flex
300
+ data-error=${j(this.error)}
301
+ data-retry=${this.showRetry}
302
+ flexDirection="column"
303
+ alignItems="center"
304
+ .padding=${["10","5","5","5"]}
305
+ gap="6"
306
+ >
307
+ <wui-flex gap="2" justifyContent="center" alignItems="center">
308
+ <wui-wallet-image size="lg" imageSrc=${j(this.imageSrc)}></wui-wallet-image>
309
+
310
+ ${this.error?null:this.loaderTemplate()}
311
+
312
+ <wui-icon-box
313
+ color="error"
314
+ icon="close"
315
+ size="sm"
316
+ border
317
+ borderColor="wui-color-bg-125"
318
+ ></wui-icon-box>
319
+ </wui-flex>
320
+
321
+ <wui-flex flexDirection="column" alignItems="center" gap="6"> <wui-flex
322
+ flexDirection="column"
323
+ alignItems="center"
324
+ gap="2"
325
+ .padding=${["2","0","0","0"]}
326
+ >
327
+ <wui-text align="center" variant="lg-medium" color=${this.error?"error":"primary"}>
328
+ ${i}
329
+ </wui-text>
330
+ <wui-text align="center" variant="lg-regular" color="secondary">${t}</wui-text>
331
+ </wui-flex>
332
+
333
+ ${this.secondaryBtnLabel?u`
334
+ <wui-button
335
+ variant="neutral-secondary"
336
+ size="md"
337
+ ?disabled=${this.isRetrying||this.isLoading}
338
+ @click=${this.onTryAgain.bind(this)}
339
+ data-testid="w3m-connecting-widget-secondary-button"
340
+ >
341
+ <wui-icon
342
+ color="inherit"
343
+ slot="iconLeft"
344
+ name=${this.secondaryBtnIcon}
345
+ ></wui-icon>
346
+ ${this.secondaryBtnLabel}
347
+ </wui-button>
348
+ `:null}
349
+ </wui-flex>
350
+
351
+ ${this.isWalletConnect?u`
352
+ <wui-flex .padding=${["0","5","5","5"]} justifyContent="center">
353
+ <wui-link
354
+ @click=${this.onCopyUri}
355
+ variant="secondary"
356
+ icon="copy"
357
+ data-testid="wui-link-copy"
358
+ >
359
+ Copy link
360
+ </wui-link>
361
+ </wui-flex>
362
+ `:null}
363
+
364
+ <w3m-mobile-download-links .wallet=${this.wallet}></w3m-mobile-download-links></wui-flex>
365
+ </wui-flex>
366
+ `}onShowRetry(){this.error&&!this.showRetry&&(this.showRetry=!0,this.shadowRoot?.querySelector("wui-button")?.animate([{opacity:0},{opacity:1}],{fill:"forwards",easing:"ease"}))}onTryAgain(){P.setWcError(!1),this.onRetry?(this.isRetrying=!0,this.onRetry?.()):this.onConnect?.()}loaderTemplate(){const t=Lt.state.themeVariables["--w3m-border-radius-master"],i=t?parseInt(t.replace("px",""),10):4;return u`<wui-loading-thumbnail radius=${i*9}></wui-loading-thumbnail>`}onCopyUri(){try{this.uri&&(L.copyToClopboard(this.uri),Me.showSuccess("Link copied"))}catch{Me.showError("Failed to copy")}}}z.styles=hi;ee([T()],z.prototype,"isRetrying",void 0);ee([T()],z.prototype,"uri",void 0);ee([T()],z.prototype,"error",void 0);ee([T()],z.prototype,"ready",void 0);ee([T()],z.prototype,"showRetry",void 0);ee([T()],z.prototype,"label",void 0);ee([T()],z.prototype,"secondaryBtnLabel",void 0);ee([T()],z.prototype,"secondaryLabel",void 0);ee([T()],z.prototype,"isLoading",void 0);ee([d({type:Boolean})],z.prototype,"isMobile",void 0);ee([d()],z.prototype,"onRetry",void 0);var fi=function(e,t,i,r){var o=arguments.length,n=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,i):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(n=(o<3?s(n):o>3?s(t,i,n):s(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n};let Qt=class extends z{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),F.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"browser",displayIndex:this.wallet?.display_index,walletRank:this.wallet.order,view:B.state.view}})}async onConnectProxy(){try{this.error=!1;const{connectors:t}=K.state,i=t.find(r=>r.type==="ANNOUNCED"&&r.info?.rdns===this.wallet?.rdns||r.type==="INJECTED"||r.name===this.wallet?.name);if(i)await P.connectExternal(i,i.chain);else throw new Error("w3m-connecting-wc-browser: No connector found");kn.close(),F.sendEvent({type:"track",event:"CONNECT_SUCCESS",properties:{method:"browser",name:this.wallet?.name||"Unknown",view:B.state.view,walletRank:this.wallet?.order}})}catch(t){t instanceof An&&t.originalName===Bn.PROVIDER_RPC_ERROR_NAME.USER_REJECTED_REQUEST?F.sendEvent({type:"track",event:"USER_REJECTED",properties:{message:t.message}}):F.sendEvent({type:"track",event:"CONNECT_ERROR",properties:{message:t?.message??"Unknown"}}),this.error=!0}}};Qt=fi([O("w3m-connecting-wc-browser")],Qt);var pi=function(e,t,i,r){var o=arguments.length,n=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,i):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(n=(o<3?s(n):o>3?s(t,i,n):s(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n};let Jt=class extends z{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),F.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"desktop",displayIndex:this.wallet?.display_index,walletRank:this.wallet.order,view:B.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:t,name:i}=this.wallet,{redirect:r,href:o}=L.formatNativeUrl(t,this.uri);P.setWcLinking({name:i,href:o}),P.setRecentWallet(this.wallet),L.openHref(r,"_blank")}catch{this.error=!0}}};Jt=pi([O("w3m-connecting-wc-desktop")],Jt);var Pe=function(e,t,i,r){var o=arguments.length,n=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,i):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(n=(o<3?s(n):o>3?s(t,i,n):s(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n};let xe=class extends z{constructor(){if(super(),this.btnLabelTimeout=void 0,this.redirectDeeplink=void 0,this.redirectUniversalLink=void 0,this.target=void 0,this.preferUniversalLinks=q.state.experimental_preferUniversalLinks,this.isLoading=!0,this.onConnect=()=>{if(this.wallet?.mobile_link&&this.uri)try{this.error=!1;const{mobile_link:t,link_mode:i,name:r}=this.wallet,{redirect:o,redirectUniversalLink:n,href:s}=L.formatNativeUrl(t,this.uri,i);this.redirectDeeplink=o,this.redirectUniversalLink=n,this.target=L.isIframe()?"_top":"_self",P.setWcLinking({name:r,href:s}),P.setRecentWallet(this.wallet),this.preferUniversalLinks&&this.redirectUniversalLink?L.openHref(this.redirectUniversalLink,this.target):L.openHref(this.redirectDeeplink,this.target)}catch(t){F.sendEvent({type:"track",event:"CONNECT_PROXY_ERROR",properties:{message:t instanceof Error?t.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=Pn.CONNECT_LABELS.MOBILE,this.secondaryBtnIcon="externalLink",this.onHandleURI(),this.unsubscribe.push(P.subscribeKey("wcUri",()=>{this.onHandleURI()})),F.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"mobile",displayIndex:this.wallet?.display_index,walletRank:this.wallet.order,view:B.state.view}})}disconnectedCallback(){super.disconnectedCallback(),clearTimeout(this.btnLabelTimeout)}onHandleURI(){this.isLoading=!this.uri,!this.ready&&this.uri&&(this.ready=!0,this.onConnect?.())}onTryAgain(){P.setWcError(!1),this.onConnect?.()}};Pe([T()],xe.prototype,"redirectDeeplink",void 0);Pe([T()],xe.prototype,"redirectUniversalLink",void 0);Pe([T()],xe.prototype,"target",void 0);Pe([T()],xe.prototype,"preferUniversalLinks",void 0);Pe([T()],xe.prototype,"isLoading",void 0);xe=Pe([O("w3m-connecting-wc-mobile")],xe);var We={},ct,Yt;function gi(){return Yt||(Yt=1,ct=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),ct}var ut={},pe={},Xt;function _e(){if(Xt)return pe;Xt=1;let e;const t=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];return pe.getSymbolSize=function(r){if(!r)throw new Error('"version" cannot be null or undefined');if(r<1||r>40)throw new Error('"version" should be in range from 1 to 40');return r*4+17},pe.getSymbolTotalCodewords=function(r){return t[r]},pe.getBCHDigit=function(i){let r=0;for(;i!==0;)r++,i>>>=1;return r},pe.setToSJISFunction=function(r){if(typeof r!="function")throw new Error('"toSJISFunc" is not a valid function.');e=r},pe.isKanjiModeEnabled=function(){return typeof e<"u"},pe.toSJIS=function(r){return e(r)},pe}var dt={},Zt;function Mt(){return Zt||(Zt=1,(function(e){e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function t(i){if(typeof i!="string")throw new Error("Param is not a string");switch(i.toLowerCase()){case"l":case"low":return e.L;case"m":case"medium":return e.M;case"q":case"quartile":return e.Q;case"h":case"high":return e.H;default:throw new Error("Unknown EC Level: "+i)}}e.isValid=function(r){return r&&typeof r.bit<"u"&&r.bit>=0&&r.bit<4},e.from=function(r,o){if(e.isValid(r))return r;try{return t(r)}catch{return o}}})(dt)),dt}var ht,en;function mi(){if(en)return ht;en=1;function e(){this.buffer=[],this.length=0}return e.prototype={get:function(t){const i=Math.floor(t/8);return(this.buffer[i]>>>7-t%8&1)===1},put:function(t,i){for(let r=0;r<i;r++)this.putBit((t>>>i-r-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(t){const i=Math.floor(this.length/8);this.buffer.length<=i&&this.buffer.push(0),t&&(this.buffer[i]|=128>>>this.length%8),this.length++}},ht=e,ht}var ft,tn;function wi(){if(tn)return ft;tn=1;function e(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}return e.prototype.set=function(t,i,r,o){const n=t*this.size+i;this.data[n]=r,o&&(this.reservedBit[n]=!0)},e.prototype.get=function(t,i){return this.data[t*this.size+i]},e.prototype.xor=function(t,i,r){this.data[t*this.size+i]^=r},e.prototype.isReserved=function(t,i){return this.reservedBit[t*this.size+i]},ft=e,ft}var pt={},nn;function bi(){return nn||(nn=1,(function(e){const t=_e().getSymbolSize;e.getRowColCoords=function(r){if(r===1)return[];const o=Math.floor(r/7)+2,n=t(r),s=n===145?26:Math.ceil((n-13)/(2*o-2))*2,a=[n-7];for(let l=1;l<o-1;l++)a[l]=a[l-1]-s;return a.push(6),a.reverse()},e.getPositions=function(r){const o=[],n=e.getRowColCoords(r),s=n.length;for(let a=0;a<s;a++)for(let l=0;l<s;l++)a===0&&l===0||a===0&&l===s-1||a===s-1&&l===0||o.push([n[a],n[l]]);return o}})(pt)),pt}var gt={},rn;function yi(){if(rn)return gt;rn=1;const e=_e().getSymbolSize,t=7;return gt.getPositions=function(r){const o=e(r);return[[0,0],[o-t,0],[0,o-t]]},gt}var mt={},on;function vi(){return on||(on=1,(function(e){e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const t={N1:3,N2:3,N3:40,N4:10};e.isValid=function(o){return o!=null&&o!==""&&!isNaN(o)&&o>=0&&o<=7},e.from=function(o){return e.isValid(o)?parseInt(o,10):void 0},e.getPenaltyN1=function(o){const n=o.size;let s=0,a=0,l=0,c=null,f=null;for(let E=0;E<n;E++){a=l=0,c=f=null;for(let y=0;y<n;y++){let p=o.get(E,y);p===c?a++:(a>=5&&(s+=t.N1+(a-5)),c=p,a=1),p=o.get(y,E),p===f?l++:(l>=5&&(s+=t.N1+(l-5)),f=p,l=1)}a>=5&&(s+=t.N1+(a-5)),l>=5&&(s+=t.N1+(l-5))}return s},e.getPenaltyN2=function(o){const n=o.size;let s=0;for(let a=0;a<n-1;a++)for(let l=0;l<n-1;l++){const c=o.get(a,l)+o.get(a,l+1)+o.get(a+1,l)+o.get(a+1,l+1);(c===4||c===0)&&s++}return s*t.N2},e.getPenaltyN3=function(o){const n=o.size;let s=0,a=0,l=0;for(let c=0;c<n;c++){a=l=0;for(let f=0;f<n;f++)a=a<<1&2047|o.get(c,f),f>=10&&(a===1488||a===93)&&s++,l=l<<1&2047|o.get(f,c),f>=10&&(l===1488||l===93)&&s++}return s*t.N3},e.getPenaltyN4=function(o){let n=0;const s=o.data.length;for(let l=0;l<s;l++)n+=o.data[l];return Math.abs(Math.ceil(n*100/s/5)-10)*t.N4};function i(r,o,n){switch(r){case e.Patterns.PATTERN000:return(o+n)%2===0;case e.Patterns.PATTERN001:return o%2===0;case e.Patterns.PATTERN010:return n%3===0;case e.Patterns.PATTERN011:return(o+n)%3===0;case e.Patterns.PATTERN100:return(Math.floor(o/2)+Math.floor(n/3))%2===0;case e.Patterns.PATTERN101:return o*n%2+o*n%3===0;case e.Patterns.PATTERN110:return(o*n%2+o*n%3)%2===0;case e.Patterns.PATTERN111:return(o*n%3+(o+n)%2)%2===0;default:throw new Error("bad maskPattern:"+r)}}e.applyMask=function(o,n){const s=n.size;for(let a=0;a<s;a++)for(let l=0;l<s;l++)n.isReserved(l,a)||n.xor(l,a,i(o,l,a))},e.getBestMask=function(o,n){const s=Object.keys(e.Patterns).length;let a=0,l=1/0;for(let c=0;c<s;c++){n(c),e.applyMask(c,o);const f=e.getPenaltyN1(o)+e.getPenaltyN2(o)+e.getPenaltyN3(o)+e.getPenaltyN4(o);e.applyMask(c,o),f<l&&(l=f,a=c)}return a}})(mt)),mt}var Ve={},sn;function Dn(){if(sn)return Ve;sn=1;const e=Mt(),t=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],i=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];return Ve.getBlocksCount=function(o,n){switch(n){case e.L:return t[(o-1)*4+0];case e.M:return t[(o-1)*4+1];case e.Q:return t[(o-1)*4+2];case e.H:return t[(o-1)*4+3];default:return}},Ve.getTotalCodewordsCount=function(o,n){switch(n){case e.L:return i[(o-1)*4+0];case e.M:return i[(o-1)*4+1];case e.Q:return i[(o-1)*4+2];case e.H:return i[(o-1)*4+3];default:return}},Ve}var wt={},Ne={},an;function Ci(){if(an)return Ne;an=1;const e=new Uint8Array(512),t=new Uint8Array(256);return(function(){let r=1;for(let o=0;o<255;o++)e[o]=r,t[r]=o,r<<=1,r&256&&(r^=285);for(let o=255;o<512;o++)e[o]=e[o-255]})(),Ne.log=function(r){if(r<1)throw new Error("log("+r+")");return t[r]},Ne.exp=function(r){return e[r]},Ne.mul=function(r,o){return r===0||o===0?0:e[t[r]+t[o]]},Ne}var ln;function $i(){return ln||(ln=1,(function(e){const t=Ci();e.mul=function(r,o){const n=new Uint8Array(r.length+o.length-1);for(let s=0;s<r.length;s++)for(let a=0;a<o.length;a++)n[s+a]^=t.mul(r[s],o[a]);return n},e.mod=function(r,o){let n=new Uint8Array(r);for(;n.length-o.length>=0;){const s=n[0];for(let l=0;l<o.length;l++)n[l]^=t.mul(o[l],s);let a=0;for(;a<n.length&&n[a]===0;)a++;n=n.slice(a)}return n},e.generateECPolynomial=function(r){let o=new Uint8Array([1]);for(let n=0;n<r;n++)o=e.mul(o,new Uint8Array([1,t.exp(n)]));return o}})(wt)),wt}var bt,cn;function xi(){if(cn)return bt;cn=1;const e=$i();function t(i){this.genPoly=void 0,this.degree=i,this.degree&&this.initialize(this.degree)}return t.prototype.initialize=function(r){this.degree=r,this.genPoly=e.generateECPolynomial(this.degree)},t.prototype.encode=function(r){if(!this.genPoly)throw new Error("Encoder not initialized");const o=new Uint8Array(r.length+this.degree);o.set(r);const n=e.mod(o,this.genPoly),s=this.degree-n.length;if(s>0){const a=new Uint8Array(this.degree);return a.set(n,s),a}return n},bt=t,bt}var yt={},vt={},Ct={},un;function Mn(){return un||(un=1,Ct.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40}),Ct}var te={},dn;function jn(){if(dn)return te;dn=1;const e="[0-9]+",t="[A-Z $%*+\\-./:]+";let i="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";i=i.replace(/u/g,"\\u");const r="(?:(?![A-Z0-9 $%*+\\-./:]|"+i+`)(?:.|[\r
367
+ ]))+`;te.KANJI=new RegExp(i,"g"),te.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),te.BYTE=new RegExp(r,"g"),te.NUMERIC=new RegExp(e,"g"),te.ALPHANUMERIC=new RegExp(t,"g");const o=new RegExp("^"+i+"$"),n=new RegExp("^"+e+"$"),s=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return te.testKanji=function(l){return o.test(l)},te.testNumeric=function(l){return n.test(l)},te.testAlphanumeric=function(l){return s.test(l)},te}var hn;function Se(){return hn||(hn=1,(function(e){const t=Mn(),i=jn();e.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},e.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},e.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(n,s){if(!n.ccBits)throw new Error("Invalid mode: "+n);if(!t.isValid(s))throw new Error("Invalid version: "+s);return s>=1&&s<10?n.ccBits[0]:s<27?n.ccBits[1]:n.ccBits[2]},e.getBestModeForData=function(n){return i.testNumeric(n)?e.NUMERIC:i.testAlphanumeric(n)?e.ALPHANUMERIC:i.testKanji(n)?e.KANJI:e.BYTE},e.toString=function(n){if(n&&n.id)return n.id;throw new Error("Invalid mode")},e.isValid=function(n){return n&&n.bit&&n.ccBits};function r(o){if(typeof o!="string")throw new Error("Param is not a string");switch(o.toLowerCase()){case"numeric":return e.NUMERIC;case"alphanumeric":return e.ALPHANUMERIC;case"kanji":return e.KANJI;case"byte":return e.BYTE;default:throw new Error("Unknown mode: "+o)}}e.from=function(n,s){if(e.isValid(n))return n;try{return r(n)}catch{return s}}})(vt)),vt}var fn;function Ei(){return fn||(fn=1,(function(e){const t=_e(),i=Dn(),r=Mt(),o=Se(),n=Mn(),s=7973,a=t.getBCHDigit(s);function l(y,p,v){for(let h=1;h<=40;h++)if(p<=e.getCapacity(h,v,y))return h}function c(y,p){return o.getCharCountIndicator(y,p)+4}function f(y,p){let v=0;return y.forEach(function(h){const w=c(h.mode,p);v+=w+h.getBitsLength()}),v}function E(y,p){for(let v=1;v<=40;v++)if(f(y,v)<=e.getCapacity(v,p,o.MIXED))return v}e.from=function(p,v){return n.isValid(p)?parseInt(p,10):v},e.getCapacity=function(p,v,h){if(!n.isValid(p))throw new Error("Invalid QR Code version");typeof h>"u"&&(h=o.BYTE);const w=t.getSymbolTotalCodewords(p),g=i.getTotalCodewordsCount(p,v),b=(w-g)*8;if(h===o.MIXED)return b;const C=b-c(h,p);switch(h){case o.NUMERIC:return Math.floor(C/10*3);case o.ALPHANUMERIC:return Math.floor(C/11*2);case o.KANJI:return Math.floor(C/13);case o.BYTE:default:return Math.floor(C/8)}},e.getBestVersionForData=function(p,v){let h;const w=r.from(v,r.M);if(Array.isArray(p)){if(p.length>1)return E(p,w);if(p.length===0)return 1;h=p[0]}else h=p;return l(h.mode,h.getLength(),w)},e.getEncodedBits=function(p){if(!n.isValid(p)||p<7)throw new Error("Invalid QR Code version");let v=p<<12;for(;t.getBCHDigit(v)-a>=0;)v^=s<<t.getBCHDigit(v)-a;return p<<12|v}})(yt)),yt}var $t={},pn;function Ri(){if(pn)return $t;pn=1;const e=_e(),t=1335,i=21522,r=e.getBCHDigit(t);return $t.getEncodedBits=function(n,s){const a=n.bit<<3|s;let l=a<<10;for(;e.getBCHDigit(l)-r>=0;)l^=t<<e.getBCHDigit(l)-r;return(a<<10|l)^i},$t}var xt={},Et,gn;function _i(){if(gn)return Et;gn=1;const e=Se();function t(i){this.mode=e.NUMERIC,this.data=i.toString()}return t.getBitsLength=function(r){return 10*Math.floor(r/3)+(r%3?r%3*3+1:0)},t.prototype.getLength=function(){return this.data.length},t.prototype.getBitsLength=function(){return t.getBitsLength(this.data.length)},t.prototype.write=function(r){let o,n,s;for(o=0;o+3<=this.data.length;o+=3)n=this.data.substr(o,3),s=parseInt(n,10),r.put(s,10);const a=this.data.length-o;a>0&&(n=this.data.substr(o),s=parseInt(n,10),r.put(s,a*3+1))},Et=t,Et}var Rt,mn;function Si(){if(mn)return Rt;mn=1;const e=Se(),t=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function i(r){this.mode=e.ALPHANUMERIC,this.data=r}return i.getBitsLength=function(o){return 11*Math.floor(o/2)+6*(o%2)},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(o){let n;for(n=0;n+2<=this.data.length;n+=2){let s=t.indexOf(this.data[n])*45;s+=t.indexOf(this.data[n+1]),o.put(s,11)}this.data.length%2&&o.put(t.indexOf(this.data[n]),6)},Rt=i,Rt}var _t,wn;function Ti(){return wn||(wn=1,_t=function(t){for(var i=[],r=t.length,o=0;o<r;o++){var n=t.charCodeAt(o);if(n>=55296&&n<=56319&&r>o+1){var s=t.charCodeAt(o+1);s>=56320&&s<=57343&&(n=(n-55296)*1024+s-56320+65536,o+=1)}if(n<128){i.push(n);continue}if(n<2048){i.push(n>>6|192),i.push(n&63|128);continue}if(n<55296||n>=57344&&n<65536){i.push(n>>12|224),i.push(n>>6&63|128),i.push(n&63|128);continue}if(n>=65536&&n<=1114111){i.push(n>>18|240),i.push(n>>12&63|128),i.push(n>>6&63|128),i.push(n&63|128);continue}i.push(239,191,189)}return new Uint8Array(i).buffer}),_t}var St,bn;function Ii(){if(bn)return St;bn=1;const e=Ti(),t=Se();function i(r){this.mode=t.BYTE,typeof r=="string"&&(r=e(r)),this.data=new Uint8Array(r)}return i.getBitsLength=function(o){return o*8},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(r){for(let o=0,n=this.data.length;o<n;o++)r.put(this.data[o],8)},St=i,St}var Tt,yn;function Wi(){if(yn)return Tt;yn=1;const e=Se(),t=_e();function i(r){this.mode=e.KANJI,this.data=r}return i.getBitsLength=function(o){return o*13},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(r){let o;for(o=0;o<this.data.length;o++){let n=t.toSJIS(this.data[o]);if(n>=33088&&n<=40956)n-=33088;else if(n>=57408&&n<=60351)n-=49472;else throw new Error("Invalid SJIS character: "+this.data[o]+`
368
+ Make sure your charset is UTF-8`);n=(n>>>8&255)*192+(n&255),r.put(n,13)}},Tt=i,Tt}var It={exports:{}},vn;function ki(){return vn||(vn=1,(function(e){var t={single_source_shortest_paths:function(i,r,o){var n={},s={};s[r]=0;var a=t.PriorityQueue.make();a.push(r,0);for(var l,c,f,E,y,p,v,h,w;!a.empty();){l=a.pop(),c=l.value,E=l.cost,y=i[c]||{};for(f in y)y.hasOwnProperty(f)&&(p=y[f],v=E+p,h=s[f],w=typeof s[f]>"u",(w||h>v)&&(s[f]=v,a.push(f,v),n[f]=c))}if(typeof o<"u"&&typeof s[o]>"u"){var g=["Could not find a path from ",r," to ",o,"."].join("");throw new Error(g)}return n},extract_shortest_path_from_predecessor_list:function(i,r){for(var o=[],n=r;n;)o.push(n),i[n],n=i[n];return o.reverse(),o},find_path:function(i,r,o){var n=t.single_source_shortest_paths(i,r,o);return t.extract_shortest_path_from_predecessor_list(n,o)},PriorityQueue:{make:function(i){var r=t.PriorityQueue,o={},n;i=i||{};for(n in r)r.hasOwnProperty(n)&&(o[n]=r[n]);return o.queue=[],o.sorter=i.sorter||r.default_sorter,o},default_sorter:function(i,r){return i.cost-r.cost},push:function(i,r){var o={value:i,cost:r};this.queue.push(o),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};e.exports=t})(It)),It.exports}var Cn;function Ai(){return Cn||(Cn=1,(function(e){const t=Se(),i=_i(),r=Si(),o=Ii(),n=Wi(),s=jn(),a=_e(),l=ki();function c(g){return unescape(encodeURIComponent(g)).length}function f(g,b,C){const m=[];let D;for(;(D=g.exec(C))!==null;)m.push({data:D[0],index:D.index,mode:b,length:D[0].length});return m}function E(g){const b=f(s.NUMERIC,t.NUMERIC,g),C=f(s.ALPHANUMERIC,t.ALPHANUMERIC,g);let m,D;return a.isKanjiModeEnabled()?(m=f(s.BYTE,t.BYTE,g),D=f(s.KANJI,t.KANJI,g)):(m=f(s.BYTE_KANJI,t.BYTE,g),D=[]),b.concat(C,m,D).sort(function(I,S){return I.index-S.index}).map(function(I){return{data:I.data,mode:I.mode,length:I.length}})}function y(g,b){switch(b){case t.NUMERIC:return i.getBitsLength(g);case t.ALPHANUMERIC:return r.getBitsLength(g);case t.KANJI:return n.getBitsLength(g);case t.BYTE:return o.getBitsLength(g)}}function p(g){return g.reduce(function(b,C){const m=b.length-1>=0?b[b.length-1]:null;return m&&m.mode===C.mode?(b[b.length-1].data+=C.data,b):(b.push(C),b)},[])}function v(g){const b=[];for(let C=0;C<g.length;C++){const m=g[C];switch(m.mode){case t.NUMERIC:b.push([m,{data:m.data,mode:t.ALPHANUMERIC,length:m.length},{data:m.data,mode:t.BYTE,length:m.length}]);break;case t.ALPHANUMERIC:b.push([m,{data:m.data,mode:t.BYTE,length:m.length}]);break;case t.KANJI:b.push([m,{data:m.data,mode:t.BYTE,length:c(m.data)}]);break;case t.BYTE:b.push([{data:m.data,mode:t.BYTE,length:c(m.data)}])}}return b}function h(g,b){const C={},m={start:{}};let D=["start"];for(let x=0;x<g.length;x++){const I=g[x],S=[];for(let $=0;$<I.length;$++){const k=I[$],R=""+x+$;S.push(R),C[R]={node:k,lastCount:0},m[R]={};for(let W=0;W<D.length;W++){const _=D[W];C[_]&&C[_].node.mode===k.mode?(m[_][R]=y(C[_].lastCount+k.length,k.mode)-y(C[_].lastCount,k.mode),C[_].lastCount+=k.length):(C[_]&&(C[_].lastCount=k.length),m[_][R]=y(k.length,k.mode)+4+t.getCharCountIndicator(k.mode,b))}}D=S}for(let x=0;x<D.length;x++)m[D[x]].end=0;return{map:m,table:C}}function w(g,b){let C;const m=t.getBestModeForData(g);if(C=t.from(b,m),C!==t.BYTE&&C.bit<m.bit)throw new Error('"'+g+'" cannot be encoded with mode '+t.toString(C)+`.
369
+ Suggested mode is: `+t.toString(m));switch(C===t.KANJI&&!a.isKanjiModeEnabled()&&(C=t.BYTE),C){case t.NUMERIC:return new i(g);case t.ALPHANUMERIC:return new r(g);case t.KANJI:return new n(g);case t.BYTE:return new o(g)}}e.fromArray=function(b){return b.reduce(function(C,m){return typeof m=="string"?C.push(w(m,null)):m.data&&C.push(w(m.data,m.mode)),C},[])},e.fromString=function(b,C){const m=E(b,a.isKanjiModeEnabled()),D=v(m),x=h(D,C),I=l.find_path(x.map,"start","end"),S=[];for(let $=1;$<I.length-1;$++)S.push(x.table[I[$]].node);return e.fromArray(p(S))},e.rawSplit=function(b){return e.fromArray(E(b,a.isKanjiModeEnabled()))}})(xt)),xt}var $n;function Bi(){if($n)return ut;$n=1;const e=_e(),t=Mt(),i=mi(),r=wi(),o=bi(),n=yi(),s=vi(),a=Dn(),l=xi(),c=Ei(),f=Ri(),E=Se(),y=Ai();function p(x,I){const S=x.size,$=n.getPositions(I);for(let k=0;k<$.length;k++){const R=$[k][0],W=$[k][1];for(let _=-1;_<=7;_++)if(!(R+_<=-1||S<=R+_))for(let A=-1;A<=7;A++)W+A<=-1||S<=W+A||(_>=0&&_<=6&&(A===0||A===6)||A>=0&&A<=6&&(_===0||_===6)||_>=2&&_<=4&&A>=2&&A<=4?x.set(R+_,W+A,!0,!0):x.set(R+_,W+A,!1,!0))}}function v(x){const I=x.size;for(let S=8;S<I-8;S++){const $=S%2===0;x.set(S,6,$,!0),x.set(6,S,$,!0)}}function h(x,I){const S=o.getPositions(I);for(let $=0;$<S.length;$++){const k=S[$][0],R=S[$][1];for(let W=-2;W<=2;W++)for(let _=-2;_<=2;_++)W===-2||W===2||_===-2||_===2||W===0&&_===0?x.set(k+W,R+_,!0,!0):x.set(k+W,R+_,!1,!0)}}function w(x,I){const S=x.size,$=c.getEncodedBits(I);let k,R,W;for(let _=0;_<18;_++)k=Math.floor(_/3),R=_%3+S-8-3,W=($>>_&1)===1,x.set(k,R,W,!0),x.set(R,k,W,!0)}function g(x,I,S){const $=x.size,k=f.getEncodedBits(I,S);let R,W;for(R=0;R<15;R++)W=(k>>R&1)===1,R<6?x.set(R,8,W,!0):R<8?x.set(R+1,8,W,!0):x.set($-15+R,8,W,!0),R<8?x.set(8,$-R-1,W,!0):R<9?x.set(8,15-R-1+1,W,!0):x.set(8,15-R-1,W,!0);x.set($-8,8,1,!0)}function b(x,I){const S=x.size;let $=-1,k=S-1,R=7,W=0;for(let _=S-1;_>0;_-=2)for(_===6&&_--;;){for(let A=0;A<2;A++)if(!x.isReserved(k,_-A)){let he=!1;W<I.length&&(he=(I[W]>>>R&1)===1),x.set(k,_-A,he),R--,R===-1&&(W++,R=7)}if(k+=$,k<0||S<=k){k-=$,$=-$;break}}}function C(x,I,S){const $=new i;S.forEach(function(A){$.put(A.mode.bit,4),$.put(A.getLength(),E.getCharCountIndicator(A.mode,x)),A.write($)});const k=e.getSymbolTotalCodewords(x),R=a.getTotalCodewordsCount(x,I),W=(k-R)*8;for($.getLengthInBits()+4<=W&&$.put(0,4);$.getLengthInBits()%8!==0;)$.putBit(0);const _=(W-$.getLengthInBits())/8;for(let A=0;A<_;A++)$.put(A%2?17:236,8);return m($,x,I)}function m(x,I,S){const $=e.getSymbolTotalCodewords(I),k=a.getTotalCodewordsCount(I,S),R=$-k,W=a.getBlocksCount(I,S),_=$%W,A=W-_,he=Math.floor($/W),Le=Math.floor(R/W),Gn=Le+1,Ft=he-Le,Qn=new l(Ft);let ot=0;const Fe=new Array(W),Vt=new Array(W);let st=0;const Jn=new Uint8Array(x.buffer);for(let Ie=0;Ie<W;Ie++){const lt=Ie<A?Le:Gn;Fe[Ie]=Jn.slice(ot,ot+lt),Vt[Ie]=Qn.encode(Fe[Ie]),ot+=lt,st=Math.max(st,lt)}const at=new Uint8Array($);let Ht=0,se,ae;for(se=0;se<st;se++)for(ae=0;ae<W;ae++)se<Fe[ae].length&&(at[Ht++]=Fe[ae][se]);for(se=0;se<Ft;se++)for(ae=0;ae<W;ae++)at[Ht++]=Vt[ae][se];return at}function D(x,I,S,$){let k;if(Array.isArray(x))k=y.fromArray(x);else if(typeof x=="string"){let he=I;if(!he){const Le=y.rawSplit(x);he=c.getBestVersionForData(Le,S)}k=y.fromString(x,he||40)}else throw new Error("Invalid data");const R=c.getBestVersionForData(k,S);if(!R)throw new Error("The amount of data is too big to be stored in a QR Code");if(!I)I=R;else if(I<R)throw new Error(`
370
+ The chosen QR Code version cannot contain this amount of data.
371
+ Minimum version required to store current data is: `+R+`.
372
+ `);const W=C(I,S,k),_=e.getSymbolSize(I),A=new r(_);return p(A,I),v(A),h(A,I),g(A,S,0),I>=7&&w(A,I),b(A,W),isNaN($)&&($=s.getBestMask(A,g.bind(null,A,S))),s.applyMask($,A),g(A,S,$),{modules:A,version:I,errorCorrectionLevel:S,maskPattern:$,segments:k}}return ut.create=function(I,S){if(typeof I>"u"||I==="")throw new Error("No input text");let $=t.M,k,R;return typeof S<"u"&&($=t.from(S.errorCorrectionLevel,t.M),k=c.from(S.version),R=s.from(S.maskPattern),S.toSJISFunc&&e.setToSJISFunction(S.toSJISFunc)),D(I,k,$,R)},ut}var Wt={},kt={},xn;function Un(){return xn||(xn=1,(function(e){function t(i){if(typeof i=="number"&&(i=i.toString()),typeof i!="string")throw new Error("Color should be defined as hex string");let r=i.slice().replace("#","").split("");if(r.length<3||r.length===5||r.length>8)throw new Error("Invalid hex color: "+i);(r.length===3||r.length===4)&&(r=Array.prototype.concat.apply([],r.map(function(n){return[n,n]}))),r.length===6&&r.push("F","F");const o=parseInt(r.join(""),16);return{r:o>>24&255,g:o>>16&255,b:o>>8&255,a:o&255,hex:"#"+r.slice(0,6).join("")}}e.getOptions=function(r){r||(r={}),r.color||(r.color={});const o=typeof r.margin>"u"||r.margin===null||r.margin<0?4:r.margin,n=r.width&&r.width>=21?r.width:void 0,s=r.scale||4;return{width:n,scale:n?4:s,margin:o,color:{dark:t(r.color.dark||"#000000ff"),light:t(r.color.light||"#ffffffff")},type:r.type,rendererOpts:r.rendererOpts||{}}},e.getScale=function(r,o){return o.width&&o.width>=r+o.margin*2?o.width/(r+o.margin*2):o.scale},e.getImageWidth=function(r,o){const n=e.getScale(r,o);return Math.floor((r+o.margin*2)*n)},e.qrToImageData=function(r,o,n){const s=o.modules.size,a=o.modules.data,l=e.getScale(s,n),c=Math.floor((s+n.margin*2)*l),f=n.margin*l,E=[n.color.light,n.color.dark];for(let y=0;y<c;y++)for(let p=0;p<c;p++){let v=(y*c+p)*4,h=n.color.light;if(y>=f&&p>=f&&y<c-f&&p<c-f){const w=Math.floor((y-f)/l),g=Math.floor((p-f)/l);h=E[a[w*s+g]?1:0]}r[v++]=h.r,r[v++]=h.g,r[v++]=h.b,r[v]=h.a}}})(kt)),kt}var En;function Pi(){return En||(En=1,(function(e){const t=Un();function i(o,n,s){o.clearRect(0,0,n.width,n.height),n.style||(n.style={}),n.height=s,n.width=s,n.style.height=s+"px",n.style.width=s+"px"}function r(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}e.render=function(n,s,a){let l=a,c=s;typeof l>"u"&&(!s||!s.getContext)&&(l=s,s=void 0),s||(c=r()),l=t.getOptions(l);const f=t.getImageWidth(n.modules.size,l),E=c.getContext("2d"),y=E.createImageData(f,f);return t.qrToImageData(y.data,n,l),i(E,c,f),E.putImageData(y,0,0),c},e.renderToDataURL=function(n,s,a){let l=a;typeof l>"u"&&(!s||!s.getContext)&&(l=s,s=void 0),l||(l={});const c=e.render(n,s,l),f=l.type||"image/png",E=l.rendererOpts||{};return c.toDataURL(f,E.quality)}})(Wt)),Wt}var At={},Rn;function Li(){if(Rn)return At;Rn=1;const e=Un();function t(o,n){const s=o.a/255,a=n+'="'+o.hex+'"';return s<1?a+" "+n+'-opacity="'+s.toFixed(2).slice(1)+'"':a}function i(o,n,s){let a=o+n;return typeof s<"u"&&(a+=" "+s),a}function r(o,n,s){let a="",l=0,c=!1,f=0;for(let E=0;E<o.length;E++){const y=Math.floor(E%n),p=Math.floor(E/n);!y&&!c&&(c=!0),o[E]?(f++,E>0&&y>0&&o[E-1]||(a+=c?i("M",y+s,.5+p+s):i("m",l,0),l=0,c=!1),y+1<n&&o[E+1]||(a+=i("h",f),f=0)):l++}return a}return At.render=function(n,s,a){const l=e.getOptions(s),c=n.modules.size,f=n.modules.data,E=c+l.margin*2,y=l.color.light.a?"<path "+t(l.color.light,"fill")+' d="M0 0h'+E+"v"+E+'H0z"/>':"",p="<path "+t(l.color.dark,"stroke")+' d="'+r(f,c,l.margin)+'"/>',v='viewBox="0 0 '+E+" "+E+'"',w='<svg xmlns="http://www.w3.org/2000/svg" '+(l.width?'width="'+l.width+'" height="'+l.width+'" ':"")+v+' shape-rendering="crispEdges">'+y+p+`</svg>
373
+ `;return typeof a=="function"&&a(null,w),w},At}var _n;function Ni(){if(_n)return We;_n=1;const e=gi(),t=Bi(),i=Pi(),r=Li();function o(n,s,a,l,c){const f=[].slice.call(arguments,1),E=f.length,y=typeof f[E-1]=="function";if(!y&&!e())throw new Error("Callback required as last argument");if(y){if(E<2)throw new Error("Too few arguments provided");E===2?(c=a,a=s,s=l=void 0):E===3&&(s.getContext&&typeof c>"u"?(c=l,l=void 0):(c=l,l=a,a=s,s=void 0))}else{if(E<1)throw new Error("Too few arguments provided");return E===1?(a=s,s=l=void 0):E===2&&!s.getContext&&(l=a,a=s,s=void 0),new Promise(function(p,v){try{const h=t.create(a,l);p(n(h,s,l))}catch(h){v(h)}})}try{const p=t.create(a,l);c(null,n(p,s,l))}catch(p){c(p)}}return We.create=t.create,We.toCanvas=o.bind(null,i.render),We.toDataURL=o.bind(null,i.renderToDataURL),We.toString=o.bind(null,function(n,s,a){return r.render(n,a)}),We}var Oi=Ni();const Di=ii(Oi),Mi=.1,Sn=2.5,le=7;function Bt(e,t,i){return e===t?!1:(e-t<0?t-e:e-t)<=i+Mi}function ji(e,t){const i=Array.prototype.slice.call(Di.create(e,{errorCorrectionLevel:t}).modules.data,0),r=Math.sqrt(i.length);return i.reduce((o,n,s)=>(s%r===0?o.push([n]):o[o.length-1].push(n))&&o,[])}const Ui={generate({uri:e,size:t,logoSize:i,padding:r=8,dotColor:o="var(--apkt-colors-black)"}){const s=[],a=ji(e,"Q"),l=(t-2*r)/a.length,c=[{x:0,y:0},{x:1,y:0},{x:0,y:1}];c.forEach(({x:h,y:w})=>{const g=(a.length-le)*l*h+r,b=(a.length-le)*l*w+r,C=.45;for(let m=0;m<c.length;m+=1){const D=l*(le-m*2);s.push(Oe`
374
+ <rect
375
+ fill=${m===2?"var(--apkt-colors-black)":"var(--apkt-colors-white)"}
376
+ width=${m===0?D-10:D}
377
+ rx= ${m===0?(D-10)*C:D*C}
378
+ ry= ${m===0?(D-10)*C:D*C}
379
+ stroke=${o}
380
+ stroke-width=${m===0?10:0}
381
+ height=${m===0?D-10:D}
382
+ x= ${m===0?b+l*m+10/2:b+l*m}
383
+ y= ${m===0?g+l*m+10/2:g+l*m}
384
+ />
385
+ `)}});const f=Math.floor((i+25)/l),E=a.length/2-f/2,y=a.length/2+f/2-1,p=[];a.forEach((h,w)=>{h.forEach((g,b)=>{if(a[w][b]&&!(w<le&&b<le||w>a.length-(le+1)&&b<le||w<le&&b>a.length-(le+1))&&!(w>E&&w<y&&b>E&&b<y)){const C=w*l+l/2+r,m=b*l+l/2+r;p.push([C,m])}})});const v={};return p.forEach(([h,w])=>{v[h]?v[h]?.push(w):v[h]=[w]}),Object.entries(v).map(([h,w])=>{const g=w.filter(b=>w.every(C=>!Bt(b,C,l)));return[Number(h),g]}).forEach(([h,w])=>{w.forEach(g=>{s.push(Oe`<circle cx=${h} cy=${g} fill=${o} r=${l/Sn} />`)})}),Object.entries(v).filter(([h,w])=>w.length>1).map(([h,w])=>{const g=w.filter(b=>w.some(C=>Bt(b,C,l)));return[Number(h),g]}).map(([h,w])=>{w.sort((b,C)=>b<C?-1:1);const g=[];for(const b of w){const C=g.find(m=>m.some(D=>Bt(b,D,l)));C?C.push(b):g.push([b])}return[h,g.map(b=>[b[0],b[b.length-1]])]}).forEach(([h,w])=>{w.forEach(([g,b])=>{s.push(Oe`
386
+ <line
387
+ x1=${h}
388
+ x2=${h}
389
+ y1=${g}
390
+ y2=${b}
391
+ stroke=${o}
392
+ stroke-width=${l/(Sn/2)}
393
+ stroke-linecap="round"
394
+ />
395
+ `)})}),s}},zi=U`
396
+ :host {
397
+ position: relative;
398
+ user-select: none;
399
+ display: block;
400
+ overflow: hidden;
401
+ aspect-ratio: 1 / 1;
402
+ width: 100%;
403
+ height: 100%;
404
+ background-color: ${({colors:e})=>e.white};
405
+ border: 1px solid ${({tokens:e})=>e.theme.borderPrimary};
406
+ }
407
+
408
+ :host {
409
+ border-radius: ${({borderRadius:e})=>e[4]};
410
+ display: flex;
411
+ align-items: center;
412
+ justify-content: center;
413
+ }
414
+
415
+ :host([data-clear='true']) > wui-icon {
416
+ display: none;
417
+ }
418
+
419
+ svg:first-child,
420
+ wui-image,
421
+ wui-icon {
422
+ position: absolute;
423
+ top: 50%;
424
+ left: 50%;
425
+ transform: translateY(-50%) translateX(-50%);
426
+ background-color: ${({tokens:e})=>e.theme.backgroundPrimary};
427
+ box-shadow: inset 0 0 0 4px ${({tokens:e})=>e.theme.backgroundPrimary};
428
+ border-radius: ${({borderRadius:e})=>e[6]};
429
+ }
430
+
431
+ wui-image {
432
+ width: 25%;
433
+ height: 25%;
434
+ border-radius: ${({borderRadius:e})=>e[2]};
435
+ }
436
+
437
+ wui-icon {
438
+ width: 100%;
439
+ height: 100%;
440
+ color: #3396ff !important;
441
+ transform: translateY(-50%) translateX(-50%) scale(0.25);
442
+ }
443
+
444
+ wui-icon > svg {
445
+ width: inherit;
446
+ height: inherit;
447
+ }
448
+ `;var we=function(e,t,i,r){var o=arguments.length,n=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,i):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(n=(o<3?s(n):o>3?s(t,i,n):s(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n};let ne=class extends M{constructor(){super(...arguments),this.uri="",this.size=500,this.theme="dark",this.imageSrc=void 0,this.alt=void 0,this.arenaClear=void 0,this.farcaster=void 0}render(){return this.dataset.theme=this.theme,this.dataset.clear=String(this.arenaClear),u`<wui-flex
449
+ alignItems="center"
450
+ justifyContent="center"
451
+ class="wui-qr-code"
452
+ direction="column"
453
+ gap="4"
454
+ width="100%"
455
+ style="height: 100%"
456
+ >
457
+ ${this.templateVisual()} ${this.templateSvg()}
458
+ </wui-flex>`}templateSvg(){return Oe`
459
+ <svg viewBox="0 0 ${this.size} ${this.size}" width="100%" height="100%">
460
+ ${Ui.generate({uri:this.uri,size:this.size,logoSize:this.arenaClear?0:this.size/4})}
461
+ </svg>
462
+ `}templateVisual(){return this.imageSrc?u`<wui-image src=${this.imageSrc} alt=${this.alt??"logo"}></wui-image>`:this.farcaster?u`<wui-icon
463
+ class="farcaster"
464
+ size="inherit"
465
+ color="inherit"
466
+ name="farcaster"
467
+ ></wui-icon>`:u`<wui-icon size="inherit" color="inherit" name="walletConnect"></wui-icon>`}};ne.styles=[J,zi];we([d()],ne.prototype,"uri",void 0);we([d({type:Number})],ne.prototype,"size",void 0);we([d()],ne.prototype,"theme",void 0);we([d()],ne.prototype,"imageSrc",void 0);we([d()],ne.prototype,"alt",void 0);we([d({type:Boolean})],ne.prototype,"arenaClear",void 0);we([d({type:Boolean})],ne.prototype,"farcaster",void 0);ne=we([O("wui-qr-code")],ne);const qi=U`
468
+ :host {
469
+ display: block;
470
+ background: linear-gradient(
471
+ 90deg,
472
+ ${({tokens:e})=>e.theme.foregroundSecondary} 0%,
473
+ ${({tokens:e})=>e.theme.foregroundTertiary} 50%,
474
+ ${({tokens:e})=>e.theme.foregroundSecondary} 100%
475
+ );
476
+ background-size: 200% 100%;
477
+ animation: shimmer 1s ease-in-out infinite;
478
+ border-radius: ${({borderRadius:e})=>e[2]};
479
+ }
480
+
481
+ :host([data-rounded='true']) {
482
+ border-radius: ${({borderRadius:e})=>e[16]};
483
+ }
484
+
485
+ @keyframes shimmer {
486
+ 0% {
487
+ background-position: 200% 0;
488
+ }
489
+ 100% {
490
+ background-position: -200% 0;
491
+ }
492
+ }
493
+ `;var ze=function(e,t,i,r){var o=arguments.length,n=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,i):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(n=(o<3?s(n):o>3?s(t,i,n):s(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n};let Ee=class extends M{constructor(){super(...arguments),this.width="",this.height="",this.variant="default",this.rounded=!1}render(){return this.style.cssText=`
494
+ width: ${this.width};
495
+ height: ${this.height};
496
+ `,this.dataset.rounded=this.rounded?"true":"false",u`<slot></slot>`}};Ee.styles=[qi];ze([d()],Ee.prototype,"width",void 0);ze([d()],Ee.prototype,"height",void 0);ze([d()],Ee.prototype,"variant",void 0);ze([d({type:Boolean})],Ee.prototype,"rounded",void 0);Ee=ze([O("wui-shimmer")],Ee);const Fi=U`
497
+ wui-shimmer {
498
+ width: 100%;
499
+ aspect-ratio: 1 / 1;
500
+ border-radius: ${({borderRadius:e})=>e[4]};
501
+ }
502
+
503
+ wui-qr-code {
504
+ opacity: 0;
505
+ animation-duration: ${({durations:e})=>e.xl};
506
+ animation-timing-function: ${({easings:e})=>e["ease-out-power-2"]};
507
+ animation-name: fade-in;
508
+ animation-fill-mode: forwards;
509
+ }
510
+
511
+ @keyframes fade-in {
512
+ from {
513
+ opacity: 0;
514
+ }
515
+ to {
516
+ opacity: 1;
517
+ }
518
+ }
519
+ `;var zn=function(e,t,i,r){var o=arguments.length,n=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,i):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(n=(o<3?s(n):o>3?s(t,i,n):s(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n};let Je=class extends z{constructor(){super(),this.basic=!1}firstUpdated(){this.basic||F.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet?.name??"WalletConnect",platform:"qrcode",displayIndex:this.wallet?.display_index,walletRank:this.wallet?.order,view:B.state.view}})}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribe?.forEach(t=>t())}render(){return this.onRenderProxy(),u`
520
+ <wui-flex
521
+ flexDirection="column"
522
+ alignItems="center"
523
+ .padding=${["0","5","5","5"]}
524
+ gap="5"
525
+ >
526
+ <wui-shimmer width="100%"> ${this.qrCodeTemplate()} </wui-shimmer>
527
+ <wui-text variant="lg-medium" color="primary"> Scan this QR Code with your phone </wui-text>
528
+ ${this.copyTemplate()}
529
+ </wui-flex>
530
+ <w3m-mobile-download-links .wallet=${this.wallet}></w3m-mobile-download-links>
531
+ `}onRenderProxy(){!this.ready&&this.uri&&(this.ready=!0)}qrCodeTemplate(){if(!this.uri||!this.ready)return null;const t=this.wallet?this.wallet.name:void 0;return P.setWcLinking(void 0),P.setRecentWallet(this.wallet),u` <wui-qr-code
532
+ theme=${Lt.state.themeMode}
533
+ uri=${this.uri}
534
+ imageSrc=${j(ge.getWalletImage(this.wallet))}
535
+ color=${j(Lt.state.themeVariables["--w3m-qr-color"])}
536
+ alt=${j(t)}
537
+ data-testid="wui-qr-code"
538
+ ></wui-qr-code>`}copyTemplate(){const t=!this.uri||!this.ready;return u`<wui-button
539
+ .disabled=${t}
540
+ @click=${this.onCopyUri}
541
+ variant="neutral-secondary"
542
+ size="sm"
543
+ data-testid="copy-wc2-uri"
544
+ >
545
+ Copy link
546
+ <wui-icon size="sm" color="inherit" name="copy" slot="iconRight"></wui-icon>
547
+ </wui-button>`}};Je.styles=Fi;zn([d({type:Boolean})],Je.prototype,"basic",void 0);Je=zn([O("w3m-connecting-wc-qrcode")],Je);var Vi=function(e,t,i,r){var o=arguments.length,n=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,i):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(n=(o<3?s(n):o>3?s(t,i,n):s(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n};let Tn=class extends M{constructor(){if(super(),this.wallet=B.state.data?.wallet,!this.wallet)throw new Error("w3m-connecting-wc-unsupported: No wallet provided");F.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"browser",displayIndex:this.wallet?.display_index,walletRank:this.wallet?.order,view:B.state.view}})}render(){return u`
548
+ <wui-flex
549
+ flexDirection="column"
550
+ alignItems="center"
551
+ .padding=${["10","5","5","5"]}
552
+ gap="5"
553
+ >
554
+ <wui-wallet-image
555
+ size="lg"
556
+ imageSrc=${j(ge.getWalletImage(this.wallet))}
557
+ ></wui-wallet-image>
558
+
559
+ <wui-text variant="md-regular" color="primary">Not Detected</wui-text>
560
+ </wui-flex>
561
+
562
+ <w3m-mobile-download-links .wallet=${this.wallet}></w3m-mobile-download-links>
563
+ `}};Tn=Vi([O("w3m-connecting-wc-unsupported")],Tn);var qn=function(e,t,i,r){var o=arguments.length,n=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,i):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(n=(o<3?s(n):o>3?s(t,i,n):s(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n};let Ot=class extends z{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=Pn.CONNECT_LABELS.MOBILE,this.secondaryBtnIcon="externalLink",this.updateLoadingState(),this.unsubscribe.push(P.subscribeKey("wcUri",()=>{this.updateLoadingState()})),F.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"web",displayIndex:this.wallet?.display_index,walletRank:this.wallet?.order,view:B.state.view}})}updateLoadingState(){this.isLoading=!this.uri}onConnectProxy(){if(this.wallet?.webapp_link&&this.uri)try{this.error=!1;const{webapp_link:t,name:i}=this.wallet,{redirect:r,href:o}=L.formatUniversalUrl(t,this.uri);P.setWcLinking({name:i,href:o}),P.setRecentWallet(this.wallet),L.openHref(r,"_blank")}catch{this.error=!0}}};qn([T()],Ot.prototype,"isLoading",void 0);Ot=qn([O("w3m-connecting-wc-web")],Ot);const Hi=U`
564
+ :host([data-mobile-fullscreen='true']) {
565
+ height: 100%;
566
+ display: flex;
567
+ flex-direction: column;
568
+ }
569
+
570
+ :host([data-mobile-fullscreen='true']) wui-ux-by-reown {
571
+ margin-top: auto;
572
+ }
573
+ `;var Te=function(e,t,i,r){var o=arguments.length,n=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,i):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(n=(o<3?s(n):o>3?s(t,i,n):s(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n};let ue=class extends M{constructor(){super(),this.wallet=B.state.data?.wallet,this.unsubscribe=[],this.platform=void 0,this.platforms=[],this.isSiwxEnabled=!!q.state.siwx,this.remoteFeatures=q.state.remoteFeatures,this.displayBranding=!0,this.basic=!1,this.determinePlatforms(),this.initializeConnection(),this.unsubscribe.push(q.subscribeKey("remoteFeatures",t=>this.remoteFeatures=t))}disconnectedCallback(){this.unsubscribe.forEach(t=>t())}render(){return q.state.enableMobileFullScreen&&this.setAttribute("data-mobile-fullscreen","true"),u`
574
+ ${this.headerTemplate()}
575
+ <div class="platform-container">${this.platformTemplate()}</div>
576
+ ${this.reownBrandingTemplate()}
577
+ `}reownBrandingTemplate(){return!this.remoteFeatures?.reownBranding||!this.displayBranding?null:u`<wui-ux-by-reown></wui-ux-by-reown>`}async initializeConnection(t=!1){if(!(this.platform==="browser"||q.state.manualWCControl&&!t))try{const{wcPairingExpiry:i,status:r}=P.state,{redirectView:o}=B.state.data??{};if(t||q.state.enableEmbedded||L.isPairingExpired(i)||r==="connecting"){const n=P.getConnections(fe.state.activeChain),s=this.remoteFeatures?.multiWallet,a=n.length>0;await P.connectWalletConnect({cache:"never"}),this.isSiwxEnabled||(a&&s?(B.replace("ProfileWallets"),Me.showSuccess("New Wallet Added")):o?B.replace(o):kn.close())}}catch(i){if(i instanceof Error&&i.message.includes("An error occurred when attempting to switch chain")&&!q.state.enableNetworkSwitch&&fe.state.activeChain){fe.setActiveCaipNetwork(Xn.getUnsupportedNetwork(`${fe.state.activeChain}:${fe.state.activeCaipNetwork?.id}`)),fe.showUnsupportedChainUI();return}i instanceof An&&i.originalName===Bn.PROVIDER_RPC_ERROR_NAME.USER_REJECTED_REQUEST?F.sendEvent({type:"track",event:"USER_REJECTED",properties:{message:i.message}}):F.sendEvent({type:"track",event:"CONNECT_ERROR",properties:{message:i?.message??"Unknown"}}),P.setWcError(!0),Me.showError(i.message??"Connection error"),P.resetWcConnection(),B.goBack()}}determinePlatforms(){if(!this.wallet){this.platforms.push("qrcode"),this.platform="qrcode";return}if(this.platform)return;const{mobile_link:t,desktop_link:i,webapp_link:r,injected:o,rdns:n}=this.wallet,s=o?.map(({injected_id:v})=>v).filter(Boolean),a=[...n?[n]:s??[]],l=q.state.isUniversalProvider?!1:a.length,c=t,f=r,E=P.checkInstalled(a),y=l&&E,p=i&&!L.isMobile();y&&!fe.state.noAdapters&&this.platforms.push("browser"),c&&this.platforms.push(L.isMobile()?"mobile":"qrcode"),f&&this.platforms.push("web"),p&&this.platforms.push("desktop"),!y&&l&&!fe.state.noAdapters&&this.platforms.push("unsupported"),this.platform=this.platforms[0]}platformTemplate(){switch(this.platform){case"browser":return u`<w3m-connecting-wc-browser></w3m-connecting-wc-browser>`;case"web":return u`<w3m-connecting-wc-web></w3m-connecting-wc-web>`;case"desktop":return u`
578
+ <w3m-connecting-wc-desktop .onRetry=${()=>this.initializeConnection(!0)}>
579
+ </w3m-connecting-wc-desktop>
580
+ `;case"mobile":return u`
581
+ <w3m-connecting-wc-mobile isMobile .onRetry=${()=>this.initializeConnection(!0)}>
582
+ </w3m-connecting-wc-mobile>
583
+ `;case"qrcode":return u`<w3m-connecting-wc-qrcode ?basic=${this.basic}></w3m-connecting-wc-qrcode>`;default:return u`<w3m-connecting-wc-unsupported></w3m-connecting-wc-unsupported>`}}headerTemplate(){return this.platforms.length>1?u`
584
+ <w3m-connecting-header
585
+ .platforms=${this.platforms}
586
+ .onSelectPlatfrom=${this.onSelectPlatform.bind(this)}
587
+ >
588
+ </w3m-connecting-header>
589
+ `:null}async onSelectPlatform(t){const i=this.shadowRoot?.querySelector("div");i&&(await i.animate([{opacity:1},{opacity:0}],{duration:200,fill:"forwards",easing:"ease"}).finished,this.platform=t,i.animate([{opacity:0},{opacity:1}],{duration:200,fill:"forwards",easing:"ease"}))}};ue.styles=Hi;Te([T()],ue.prototype,"platform",void 0);Te([T()],ue.prototype,"platforms",void 0);Te([T()],ue.prototype,"isSiwxEnabled",void 0);Te([T()],ue.prototype,"remoteFeatures",void 0);Te([d({type:Boolean})],ue.prototype,"displayBranding",void 0);Te([d({type:Boolean})],ue.prototype,"basic",void 0);ue=Te([O("w3m-connecting-wc-view")],ue);var jt=function(e,t,i,r){var o=arguments.length,n=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,i):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(n=(o<3?s(n):o>3?s(t,i,n):s(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n};let Ye=class extends M{constructor(){super(),this.unsubscribe=[],this.isMobile=L.isMobile(),this.remoteFeatures=q.state.remoteFeatures,this.unsubscribe.push(q.subscribeKey("remoteFeatures",t=>this.remoteFeatures=t))}disconnectedCallback(){this.unsubscribe.forEach(t=>t())}render(){if(this.isMobile){const{featured:t,recommended:i}=N.state,{customWallets:r}=q.state,o=Zn.getRecentWallets(),n=t.length||i.length||r?.length||o.length;return u`<wui-flex flexDirection="column" gap="2" .margin=${["1","3","3","3"]}>
590
+ ${n?u`<w3m-connector-list></w3m-connector-list>`:null}
591
+ <w3m-all-wallets-widget></w3m-all-wallets-widget>
592
+ </wui-flex>`}return u`<wui-flex flexDirection="column" .padding=${["0","0","4","0"]}>
593
+ <w3m-connecting-wc-view ?basic=${!0} .displayBranding=${!1}></w3m-connecting-wc-view>
594
+ <wui-flex flexDirection="column" .padding=${["0","3","0","3"]}>
595
+ <w3m-all-wallets-widget></w3m-all-wallets-widget>
596
+ </wui-flex>
597
+ </wui-flex>
598
+ ${this.reownBrandingTemplate()} `}reownBrandingTemplate(){return this.remoteFeatures?.reownBranding?u` <wui-flex flexDirection="column" .padding=${["1","0","1","0"]}>
599
+ <wui-ux-by-reown></wui-ux-by-reown>
600
+ </wui-flex>`:null}};jt([T()],Ye.prototype,"isMobile",void 0);jt([T()],Ye.prototype,"remoteFeatures",void 0);Ye=jt([O("w3m-connecting-wc-basic-view")],Ye);const Ki=e=>e.strings===void 0;const De=(e,t)=>{const i=e._$AN;if(i===void 0)return!1;for(const r of i)r._$AO?.(t,!1),De(r,t);return!0},Xe=e=>{let t,i;do{if((t=e._$AM)===void 0)break;i=t._$AN,i.delete(e),e=t}while(i?.size===0)},Fn=e=>{for(let t;t=e._$AM;e=t){let i=t._$AN;if(i===void 0)t._$AN=i=new Set;else if(i.has(e))break;i.add(e),Ji(t)}};function Gi(e){this._$AN!==void 0?(Xe(this),this._$AM=e,Fn(this)):this._$AM=e}function Qi(e,t=!1,i=0){const r=this._$AH,o=this._$AN;if(o!==void 0&&o.size!==0)if(t)if(Array.isArray(r))for(let n=i;n<r.length;n++)De(r[n],!1),Xe(r[n]);else r!=null&&(De(r,!1),Xe(r));else De(this,e)}const Ji=e=>{e.type==ti.CHILD&&(e._$AP??=Qi,e._$AQ??=Gi)};class Yi extends ei{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,i,r){super._$AT(t,i,r),Fn(this),this.isConnected=t._$AU}_$AO(t,i=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),i&&(De(this,t),Xe(this))}setValue(t){if(Ki(this._$Ct))this._$Ct._$AI(t,this);else{const i=[...this._$Ct._$AH];i[this._$Ci]=t,this._$Ct._$AI(i,this,0)}}disconnected(){}reconnected(){}}const Ut=()=>new Xi;class Xi{}const Pt=new WeakMap,zt=ni(class extends Yi{render(e){return Gt}update(e,[t]){const i=t!==this.G;return i&&this.G!==void 0&&this.rt(void 0),(i||this.lt!==this.ct)&&(this.G=t,this.ht=e.options?.host,this.rt(this.ct=e.element)),Gt}rt(e){if(this.isConnected||(e=void 0),typeof this.G=="function"){const t=this.ht??globalThis;let i=Pt.get(t);i===void 0&&(i=new WeakMap,Pt.set(t,i)),i.get(this.G)!==void 0&&this.G.call(this.ht,void 0),i.set(this.G,e),e!==void 0&&this.G.call(this.ht,e)}else this.G.value=e}get lt(){return typeof this.G=="function"?Pt.get(this.ht??globalThis)?.get(this.G):this.G?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}}),Zi=U`
601
+ :host {
602
+ display: flex;
603
+ align-items: center;
604
+ justify-content: center;
605
+ }
606
+
607
+ label {
608
+ position: relative;
609
+ display: inline-block;
610
+ user-select: none;
611
+ transition:
612
+ background-color ${({durations:e})=>e.lg}
613
+ ${({easings:e})=>e["ease-out-power-2"]},
614
+ color ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]},
615
+ border ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]},
616
+ box-shadow ${({durations:e})=>e.lg}
617
+ ${({easings:e})=>e["ease-out-power-2"]},
618
+ width ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]},
619
+ height ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]},
620
+ transform ${({durations:e})=>e.lg}
621
+ ${({easings:e})=>e["ease-out-power-2"]},
622
+ opacity ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]};
623
+ will-change: background-color, color, border, box-shadow, width, height, transform, opacity;
624
+ }
625
+
626
+ input {
627
+ width: 0;
628
+ height: 0;
629
+ opacity: 0;
630
+ }
631
+
632
+ span {
633
+ position: absolute;
634
+ cursor: pointer;
635
+ top: 0;
636
+ left: 0;
637
+ right: 0;
638
+ bottom: 0;
639
+ background-color: ${({colors:e})=>e.neutrals300};
640
+ border-radius: ${({borderRadius:e})=>e.round};
641
+ border: 1px solid transparent;
642
+ will-change: border;
643
+ transition:
644
+ background-color ${({durations:e})=>e.lg}
645
+ ${({easings:e})=>e["ease-out-power-2"]},
646
+ color ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]},
647
+ border ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]},
648
+ box-shadow ${({durations:e})=>e.lg}
649
+ ${({easings:e})=>e["ease-out-power-2"]},
650
+ width ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]},
651
+ height ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]},
652
+ transform ${({durations:e})=>e.lg}
653
+ ${({easings:e})=>e["ease-out-power-2"]},
654
+ opacity ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]};
655
+ will-change: background-color, color, border, box-shadow, width, height, transform, opacity;
656
+ }
657
+
658
+ span:before {
659
+ content: '';
660
+ position: absolute;
661
+ background-color: ${({colors:e})=>e.white};
662
+ border-radius: 50%;
663
+ }
664
+
665
+ /* -- Sizes --------------------------------------------------------- */
666
+ label[data-size='lg'] {
667
+ width: 48px;
668
+ height: 32px;
669
+ }
670
+
671
+ label[data-size='md'] {
672
+ width: 40px;
673
+ height: 28px;
674
+ }
675
+
676
+ label[data-size='sm'] {
677
+ width: 32px;
678
+ height: 22px;
679
+ }
680
+
681
+ label[data-size='lg'] > span:before {
682
+ height: 24px;
683
+ width: 24px;
684
+ left: 4px;
685
+ top: 3px;
686
+ }
687
+
688
+ label[data-size='md'] > span:before {
689
+ height: 20px;
690
+ width: 20px;
691
+ left: 4px;
692
+ top: 3px;
693
+ }
694
+
695
+ label[data-size='sm'] > span:before {
696
+ height: 16px;
697
+ width: 16px;
698
+ left: 3px;
699
+ top: 2px;
700
+ }
701
+
702
+ /* -- Focus states --------------------------------------------------- */
703
+ input:focus-visible:not(:checked) + span,
704
+ input:focus:not(:checked) + span {
705
+ border: 1px solid ${({tokens:e})=>e.core.iconAccentPrimary};
706
+ background-color: ${({tokens:e})=>e.theme.textTertiary};
707
+ box-shadow: 0px 0px 0px 4px rgba(9, 136, 240, 0.2);
708
+ }
709
+
710
+ input:focus-visible:checked + span,
711
+ input:focus:checked + span {
712
+ border: 1px solid ${({tokens:e})=>e.core.iconAccentPrimary};
713
+ box-shadow: 0px 0px 0px 4px rgba(9, 136, 240, 0.2);
714
+ }
715
+
716
+ /* -- Checked states --------------------------------------------------- */
717
+ input:checked + span {
718
+ background-color: ${({tokens:e})=>e.core.iconAccentPrimary};
719
+ }
720
+
721
+ label[data-size='lg'] > input:checked + span:before {
722
+ transform: translateX(calc(100% - 9px));
723
+ }
724
+
725
+ label[data-size='md'] > input:checked + span:before {
726
+ transform: translateX(calc(100% - 9px));
727
+ }
728
+
729
+ label[data-size='sm'] > input:checked + span:before {
730
+ transform: translateX(calc(100% - 7px));
731
+ }
732
+
733
+ /* -- Hover states ------------------------------------------------------- */
734
+ label:hover > input:not(:checked):not(:disabled) + span {
735
+ background-color: ${({colors:e})=>e.neutrals400};
736
+ }
737
+
738
+ label:hover > input:checked:not(:disabled) + span {
739
+ background-color: ${({colors:e})=>e.accent080};
740
+ }
741
+
742
+ /* -- Disabled state --------------------------------------------------- */
743
+ label:has(input:disabled) {
744
+ pointer-events: none;
745
+ user-select: none;
746
+ }
747
+
748
+ input:not(:checked):disabled + span {
749
+ background-color: ${({colors:e})=>e.neutrals700};
750
+ }
751
+
752
+ input:checked:disabled + span {
753
+ background-color: ${({colors:e})=>e.neutrals700};
754
+ }
755
+
756
+ input:not(:checked):disabled + span::before {
757
+ background-color: ${({colors:e})=>e.neutrals400};
758
+ }
759
+
760
+ input:checked:disabled + span::before {
761
+ background-color: ${({tokens:e})=>e.theme.textTertiary};
762
+ }
763
+ `;var rt=function(e,t,i,r){var o=arguments.length,n=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,i):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(n=(o<3?s(n):o>3?s(t,i,n):s(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n};let Ae=class extends M{constructor(){super(...arguments),this.inputElementRef=Ut(),this.checked=!1,this.disabled=!1,this.size="md"}render(){return u`
764
+ <label data-size=${this.size}>
765
+ <input
766
+ ${zt(this.inputElementRef)}
767
+ type="checkbox"
768
+ ?checked=${this.checked}
769
+ ?disabled=${this.disabled}
770
+ @change=${this.dispatchChangeEvent.bind(this)}
771
+ />
772
+ <span></span>
773
+ </label>
774
+ `}dispatchChangeEvent(){this.dispatchEvent(new CustomEvent("switchChange",{detail:this.inputElementRef.value?.checked,bubbles:!0,composed:!0}))}};Ae.styles=[J,me,Zi];rt([d({type:Boolean})],Ae.prototype,"checked",void 0);rt([d({type:Boolean})],Ae.prototype,"disabled",void 0);rt([d()],Ae.prototype,"size",void 0);Ae=rt([O("wui-toggle")],Ae);const er=U`
775
+ :host {
776
+ height: auto;
777
+ }
778
+
779
+ :host > wui-flex {
780
+ height: 100%;
781
+ display: flex;
782
+ align-items: center;
783
+ justify-content: center;
784
+ column-gap: ${({spacing:e})=>e[2]};
785
+ padding: ${({spacing:e})=>e[2]} ${({spacing:e})=>e[3]};
786
+ background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
787
+ border-radius: ${({borderRadius:e})=>e[4]};
788
+ box-shadow: inset 0 0 0 1px ${({tokens:e})=>e.theme.foregroundPrimary};
789
+ transition: background-color ${({durations:e})=>e.lg}
790
+ ${({easings:e})=>e["ease-out-power-2"]};
791
+ will-change: background-color;
792
+ cursor: pointer;
793
+ }
794
+
795
+ wui-switch {
796
+ pointer-events: none;
797
+ }
798
+ `;var Vn=function(e,t,i,r){var o=arguments.length,n=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,i):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(n=(o<3?s(n):o>3?s(t,i,n):s(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n};let Ze=class extends M{constructor(){super(...arguments),this.checked=!1}render(){return u`
799
+ <wui-flex>
800
+ <wui-icon size="xl" name="walletConnectBrown"></wui-icon>
801
+ <wui-toggle
802
+ ?checked=${this.checked}
803
+ size="sm"
804
+ @switchChange=${this.handleToggleChange.bind(this)}
805
+ ></wui-toggle>
806
+ </wui-flex>
807
+ `}handleToggleChange(t){t.stopPropagation(),this.checked=t.detail,this.dispatchSwitchEvent()}dispatchSwitchEvent(){this.dispatchEvent(new CustomEvent("certifiedSwitchChange",{detail:this.checked,bubbles:!0,composed:!0}))}};Ze.styles=[J,me,er];Vn([d({type:Boolean})],Ze.prototype,"checked",void 0);Ze=Vn([O("wui-certified-switch")],Ze);const tr=U`
808
+ :host {
809
+ position: relative;
810
+ width: 100%;
811
+ display: inline-flex;
812
+ flex-direction: column;
813
+ gap: ${({spacing:e})=>e[3]};
814
+ color: ${({tokens:e})=>e.theme.textPrimary};
815
+ caret-color: ${({tokens:e})=>e.core.textAccentPrimary};
816
+ }
817
+
818
+ .wui-input-text-container {
819
+ position: relative;
820
+ display: flex;
821
+ }
822
+
823
+ input {
824
+ width: 100%;
825
+ border-radius: ${({borderRadius:e})=>e[4]};
826
+ color: inherit;
827
+ background: transparent;
828
+ border: 1px solid ${({tokens:e})=>e.theme.borderPrimary};
829
+ caret-color: ${({tokens:e})=>e.core.textAccentPrimary};
830
+ padding: ${({spacing:e})=>e[3]} ${({spacing:e})=>e[3]}
831
+ ${({spacing:e})=>e[3]} ${({spacing:e})=>e[10]};
832
+ font-size: ${({textSize:e})=>e.large};
833
+ line-height: ${({typography:e})=>e["lg-regular"].lineHeight};
834
+ letter-spacing: ${({typography:e})=>e["lg-regular"].letterSpacing};
835
+ font-weight: ${({fontWeight:e})=>e.regular};
836
+ font-family: ${({fontFamily:e})=>e.regular};
837
+ }
838
+
839
+ input[data-size='lg'] {
840
+ padding: ${({spacing:e})=>e[4]} ${({spacing:e})=>e[3]}
841
+ ${({spacing:e})=>e[4]} ${({spacing:e})=>e[10]};
842
+ }
843
+
844
+ @media (hover: hover) and (pointer: fine) {
845
+ input:hover:enabled {
846
+ border: 1px solid ${({tokens:e})=>e.theme.borderSecondary};
847
+ }
848
+ }
849
+
850
+ input:disabled {
851
+ cursor: unset;
852
+ border: 1px solid ${({tokens:e})=>e.theme.borderPrimary};
853
+ }
854
+
855
+ input::placeholder {
856
+ color: ${({tokens:e})=>e.theme.textSecondary};
857
+ }
858
+
859
+ input:focus:enabled {
860
+ border: 1px solid ${({tokens:e})=>e.theme.borderSecondary};
861
+ background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
862
+ -webkit-box-shadow: 0px 0px 0px 4px ${({tokens:e})=>e.core.foregroundAccent040};
863
+ -moz-box-shadow: 0px 0px 0px 4px ${({tokens:e})=>e.core.foregroundAccent040};
864
+ box-shadow: 0px 0px 0px 4px ${({tokens:e})=>e.core.foregroundAccent040};
865
+ }
866
+
867
+ div.wui-input-text-container:has(input:disabled) {
868
+ opacity: 0.5;
869
+ }
870
+
871
+ wui-icon.wui-input-text-left-icon {
872
+ position: absolute;
873
+ top: 50%;
874
+ transform: translateY(-50%);
875
+ pointer-events: none;
876
+ left: ${({spacing:e})=>e[4]};
877
+ color: ${({tokens:e})=>e.theme.iconDefault};
878
+ }
879
+
880
+ button.wui-input-text-submit-button {
881
+ position: absolute;
882
+ top: 50%;
883
+ transform: translateY(-50%);
884
+ right: ${({spacing:e})=>e[3]};
885
+ width: 24px;
886
+ height: 24px;
887
+ border: none;
888
+ background: transparent;
889
+ border-radius: ${({borderRadius:e})=>e[2]};
890
+ color: ${({tokens:e})=>e.core.textAccentPrimary};
891
+ }
892
+
893
+ button.wui-input-text-submit-button:disabled {
894
+ opacity: 1;
895
+ }
896
+
897
+ button.wui-input-text-submit-button.loading wui-icon {
898
+ animation: spin 1s linear infinite;
899
+ }
900
+
901
+ button.wui-input-text-submit-button:hover {
902
+ background: ${({tokens:e})=>e.core.foregroundAccent010};
903
+ }
904
+
905
+ input:has(+ .wui-input-text-submit-button) {
906
+ padding-right: ${({spacing:e})=>e[12]};
907
+ }
908
+
909
+ input[type='number'] {
910
+ -moz-appearance: textfield;
911
+ }
912
+
913
+ input[type='search']::-webkit-search-decoration,
914
+ input[type='search']::-webkit-search-cancel-button,
915
+ input[type='search']::-webkit-search-results-button,
916
+ input[type='search']::-webkit-search-results-decoration {
917
+ -webkit-appearance: none;
918
+ }
919
+
920
+ /* -- Keyframes --------------------------------------------------- */
921
+ @keyframes spin {
922
+ from {
923
+ transform: rotate(0deg);
924
+ }
925
+ to {
926
+ transform: rotate(360deg);
927
+ }
928
+ }
929
+ `;var Y=function(e,t,i,r){var o=arguments.length,n=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,i):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(n=(o<3?s(n):o>3?s(t,i,n):s(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n};let V=class extends M{constructor(){super(...arguments),this.inputElementRef=Ut(),this.disabled=!1,this.loading=!1,this.placeholder="",this.type="text",this.value="",this.size="md"}render(){return u` <div class="wui-input-text-container">
930
+ ${this.templateLeftIcon()}
931
+ <input
932
+ data-size=${this.size}
933
+ ${zt(this.inputElementRef)}
934
+ data-testid="wui-input-text"
935
+ type=${this.type}
936
+ enterkeyhint=${j(this.enterKeyHint)}
937
+ ?disabled=${this.disabled}
938
+ placeholder=${this.placeholder}
939
+ @input=${this.dispatchInputChangeEvent.bind(this)}
940
+ @keydown=${this.onKeyDown}
941
+ .value=${this.value||""}
942
+ />
943
+ ${this.templateSubmitButton()}
944
+ <slot class="wui-input-text-slot"></slot>
945
+ </div>
946
+ ${this.templateError()} ${this.templateWarning()}`}templateLeftIcon(){return this.icon?u`<wui-icon
947
+ class="wui-input-text-left-icon"
948
+ size="md"
949
+ data-size=${this.size}
950
+ color="inherit"
951
+ name=${this.icon}
952
+ ></wui-icon>`:null}templateSubmitButton(){return this.onSubmit?u`<button
953
+ class="wui-input-text-submit-button ${this.loading?"loading":""}"
954
+ @click=${this.onSubmit?.bind(this)}
955
+ ?disabled=${this.disabled||this.loading}
956
+ >
957
+ ${this.loading?u`<wui-icon name="spinner" size="md"></wui-icon>`:u`<wui-icon name="chevronRight" size="md"></wui-icon>`}
958
+ </button>`:null}templateError(){return this.errorText?u`<wui-text variant="sm-regular" color="error">${this.errorText}</wui-text>`:null}templateWarning(){return this.warningText?u`<wui-text variant="sm-regular" color="warning">${this.warningText}</wui-text>`:null}dispatchInputChangeEvent(){this.dispatchEvent(new CustomEvent("inputChange",{detail:this.inputElementRef.value?.value,bubbles:!0,composed:!0}))}};V.styles=[J,me,tr];Y([d()],V.prototype,"icon",void 0);Y([d({type:Boolean})],V.prototype,"disabled",void 0);Y([d({type:Boolean})],V.prototype,"loading",void 0);Y([d()],V.prototype,"placeholder",void 0);Y([d()],V.prototype,"type",void 0);Y([d()],V.prototype,"value",void 0);Y([d()],V.prototype,"errorText",void 0);Y([d()],V.prototype,"warningText",void 0);Y([d()],V.prototype,"onSubmit",void 0);Y([d()],V.prototype,"size",void 0);Y([d({attribute:!1})],V.prototype,"onKeyDown",void 0);V=Y([O("wui-input-text")],V);const nr=U`
959
+ :host {
960
+ position: relative;
961
+ display: inline-block;
962
+ width: 100%;
963
+ }
964
+
965
+ wui-icon {
966
+ position: absolute;
967
+ top: 50%;
968
+ transform: translateY(-50%);
969
+ right: ${({spacing:e})=>e[3]};
970
+ color: ${({tokens:e})=>e.theme.iconDefault};
971
+ cursor: pointer;
972
+ padding: ${({spacing:e})=>e[2]};
973
+ background-color: transparent;
974
+ border-radius: ${({borderRadius:e})=>e[4]};
975
+ transition: background-color ${({durations:e})=>e.lg}
976
+ ${({easings:e})=>e["ease-out-power-2"]};
977
+ }
978
+
979
+ @media (hover: hover) {
980
+ wui-icon:hover {
981
+ background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
982
+ }
983
+ }
984
+ `;var Hn=function(e,t,i,r){var o=arguments.length,n=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,i):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(n=(o<3?s(n):o>3?s(t,i,n):s(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n};let et=class extends M{constructor(){super(...arguments),this.inputComponentRef=Ut(),this.inputValue=""}render(){return u`
985
+ <wui-input-text
986
+ ${zt(this.inputComponentRef)}
987
+ placeholder="Search wallet"
988
+ icon="search"
989
+ type="search"
990
+ enterKeyHint="search"
991
+ size="sm"
992
+ @inputChange=${this.onInputChange}
993
+ >
994
+ ${this.inputValue?u`<wui-icon
995
+ @click=${this.clearValue}
996
+ color="inherit"
997
+ size="sm"
998
+ name="close"
999
+ ></wui-icon>`:null}
1000
+ </wui-input-text>
1001
+ `}onInputChange(t){this.inputValue=t.detail||""}clearValue(){const i=this.inputComponentRef.value?.inputElementRef.value;i&&(i.value="",this.inputValue="",i.focus(),i.dispatchEvent(new Event("input")))}};et.styles=[J,nr];Hn([d()],et.prototype,"inputValue",void 0);et=Hn([O("wui-search-bar")],et);const ir=Oe`<svg viewBox="0 0 48 54" fill="none">
1002
+ <path
1003
+ d="M43.4605 10.7248L28.0485 1.61089C25.5438 0.129705 22.4562 0.129705 19.9515 1.61088L4.53951 10.7248C2.03626 12.2051 0.5 14.9365 0.5 17.886V36.1139C0.5 39.0635 2.03626 41.7949 4.53951 43.2752L19.9515 52.3891C22.4562 53.8703 25.5438 53.8703 28.0485 52.3891L43.4605 43.2752C45.9637 41.7949 47.5 39.0635 47.5 36.114V17.8861C47.5 14.9365 45.9637 12.2051 43.4605 10.7248Z"
1004
+ />
1005
+ </svg>`,rr=U`
1006
+ :host {
1007
+ display: flex;
1008
+ flex-direction: column;
1009
+ justify-content: center;
1010
+ align-items: center;
1011
+ height: 104px;
1012
+ width: 104px;
1013
+ row-gap: ${({spacing:e})=>e[2]};
1014
+ background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
1015
+ border-radius: ${({borderRadius:e})=>e[5]};
1016
+ position: relative;
1017
+ }
1018
+
1019
+ wui-shimmer[data-type='network'] {
1020
+ border: none;
1021
+ -webkit-clip-path: var(--apkt-path-network);
1022
+ clip-path: var(--apkt-path-network);
1023
+ }
1024
+
1025
+ svg {
1026
+ position: absolute;
1027
+ width: 48px;
1028
+ height: 54px;
1029
+ z-index: 1;
1030
+ }
1031
+
1032
+ svg > path {
1033
+ stroke: ${({tokens:e})=>e.theme.foregroundSecondary};
1034
+ stroke-width: 1px;
1035
+ }
1036
+
1037
+ @media (max-width: 350px) {
1038
+ :host {
1039
+ width: 100%;
1040
+ }
1041
+ }
1042
+ `;var Kn=function(e,t,i,r){var o=arguments.length,n=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,i):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(n=(o<3?s(n):o>3?s(t,i,n):s(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n};let tt=class extends M{constructor(){super(...arguments),this.type="wallet"}render(){return u`
1043
+ ${this.shimmerTemplate()}
1044
+ <wui-shimmer width="80px" height="20px"></wui-shimmer>
1045
+ `}shimmerTemplate(){return this.type==="network"?u` <wui-shimmer data-type=${this.type} width="48px" height="54px"></wui-shimmer>
1046
+ ${ir}`:u`<wui-shimmer width="56px" height="56px"></wui-shimmer>`}};tt.styles=[J,me,rr];Kn([d()],tt.prototype,"type",void 0);tt=Kn([O("wui-card-select-loader")],tt);const or=Ln`
1047
+ :host {
1048
+ display: grid;
1049
+ width: inherit;
1050
+ height: inherit;
1051
+ }
1052
+ `;var X=function(e,t,i,r){var o=arguments.length,n=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,i):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(n=(o<3?s(n):o>3?s(t,i,n):s(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n};let H=class extends M{render(){return this.style.cssText=`
1053
+ grid-template-rows: ${this.gridTemplateRows};
1054
+ grid-template-columns: ${this.gridTemplateColumns};
1055
+ justify-items: ${this.justifyItems};
1056
+ align-items: ${this.alignItems};
1057
+ justify-content: ${this.justifyContent};
1058
+ align-content: ${this.alignContent};
1059
+ column-gap: ${this.columnGap&&`var(--apkt-spacing-${this.columnGap})`};
1060
+ row-gap: ${this.rowGap&&`var(--apkt-spacing-${this.rowGap})`};
1061
+ gap: ${this.gap&&`var(--apkt-spacing-${this.gap})`};
1062
+ padding-top: ${this.padding&&ce.getSpacingStyles(this.padding,0)};
1063
+ padding-right: ${this.padding&&ce.getSpacingStyles(this.padding,1)};
1064
+ padding-bottom: ${this.padding&&ce.getSpacingStyles(this.padding,2)};
1065
+ padding-left: ${this.padding&&ce.getSpacingStyles(this.padding,3)};
1066
+ margin-top: ${this.margin&&ce.getSpacingStyles(this.margin,0)};
1067
+ margin-right: ${this.margin&&ce.getSpacingStyles(this.margin,1)};
1068
+ margin-bottom: ${this.margin&&ce.getSpacingStyles(this.margin,2)};
1069
+ margin-left: ${this.margin&&ce.getSpacingStyles(this.margin,3)};
1070
+ `,u`<slot></slot>`}};H.styles=[J,or];X([d()],H.prototype,"gridTemplateRows",void 0);X([d()],H.prototype,"gridTemplateColumns",void 0);X([d()],H.prototype,"justifyItems",void 0);X([d()],H.prototype,"alignItems",void 0);X([d()],H.prototype,"justifyContent",void 0);X([d()],H.prototype,"alignContent",void 0);X([d()],H.prototype,"columnGap",void 0);X([d()],H.prototype,"rowGap",void 0);X([d()],H.prototype,"gap",void 0);X([d()],H.prototype,"padding",void 0);X([d()],H.prototype,"margin",void 0);H=X([O("wui-grid")],H);const sr=U`
1071
+ button {
1072
+ display: flex;
1073
+ flex-direction: column;
1074
+ justify-content: center;
1075
+ align-items: center;
1076
+ cursor: pointer;
1077
+ width: 104px;
1078
+ row-gap: ${({spacing:e})=>e[2]};
1079
+ padding: ${({spacing:e})=>e[3]} ${({spacing:e})=>e[0]};
1080
+ background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
1081
+ border-radius: clamp(0px, ${({borderRadius:e})=>e[4]}, 20px);
1082
+ transition:
1083
+ color ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-1"]},
1084
+ background-color ${({durations:e})=>e.lg}
1085
+ ${({easings:e})=>e["ease-out-power-1"]},
1086
+ border-radius ${({durations:e})=>e.lg}
1087
+ ${({easings:e})=>e["ease-out-power-1"]};
1088
+ will-change: background-color, color, border-radius;
1089
+ outline: none;
1090
+ border: none;
1091
+ }
1092
+
1093
+ button > wui-flex > wui-text {
1094
+ color: ${({tokens:e})=>e.theme.textPrimary};
1095
+ max-width: 86px;
1096
+ white-space: nowrap;
1097
+ overflow: hidden;
1098
+ text-overflow: ellipsis;
1099
+ justify-content: center;
1100
+ }
1101
+
1102
+ button > wui-flex > wui-text.certified {
1103
+ max-width: 66px;
1104
+ }
1105
+
1106
+ @media (hover: hover) and (pointer: fine) {
1107
+ button:hover:enabled {
1108
+ background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
1109
+ }
1110
+ }
1111
+
1112
+ button:disabled > wui-flex > wui-text {
1113
+ color: ${({tokens:e})=>e.core.glass010};
1114
+ }
1115
+
1116
+ [data-selected='true'] {
1117
+ background-color: ${({colors:e})=>e.accent020};
1118
+ }
1119
+
1120
+ @media (hover: hover) and (pointer: fine) {
1121
+ [data-selected='true']:hover:enabled {
1122
+ background-color: ${({colors:e})=>e.accent010};
1123
+ }
1124
+ }
1125
+
1126
+ [data-selected='true']:active:enabled {
1127
+ background-color: ${({colors:e})=>e.accent010};
1128
+ }
1129
+
1130
+ @media (max-width: 350px) {
1131
+ button {
1132
+ width: 100%;
1133
+ }
1134
+ }
1135
+ `;var re=function(e,t,i,r){var o=arguments.length,n=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,i):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(n=(o<3?s(n):o>3?s(t,i,n):s(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n};let G=class extends M{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(t=>{t.forEach(i=>{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 t=this.wallet?.badge_type==="certified";return u`
1136
+ <button>
1137
+ ${this.imageTemplate()}
1138
+ <wui-flex flexDirection="row" alignItems="center" justifyContent="center" gap="1">
1139
+ <wui-text
1140
+ variant="md-regular"
1141
+ color="inherit"
1142
+ class=${j(t?"certified":void 0)}
1143
+ >${this.wallet?.name}</wui-text
1144
+ >
1145
+ ${t?u`<wui-icon size="sm" name="walletConnectBrown"></wui-icon>`:null}
1146
+ </wui-flex>
1147
+ </button>
1148
+ `}imageTemplate(){return!this.visible&&!this.imageSrc||this.imageLoading?this.shimmerTemplate():u`
1149
+ <wui-wallet-image
1150
+ size="lg"
1151
+ imageSrc=${j(this.imageSrc)}
1152
+ name=${j(this.wallet?.name)}
1153
+ .installed=${this.wallet?.installed??!1}
1154
+ badgeSize="sm"
1155
+ >
1156
+ </wui-wallet-image>
1157
+ `}shimmerTemplate(){return u`<wui-shimmer width="56px" height="56px"></wui-shimmer>`}async fetchImageSrc(){this.wallet&&(this.imageSrc=ge.getWalletImage(this.wallet),!this.imageSrc&&(this.imageLoading=!0,this.imageSrc=await ge.fetchWalletImage(this.wallet.image_id),this.imageLoading=!1))}sendImpressionEvent(){!this.wallet||this.isImpressed||(this.isImpressed=!0,F.sendWalletImpressionEvent({name:this.wallet.name,walletRank:this.wallet.order,explorerId:this.explorerId,view:B.state.view,query:this.walletQuery,certified:this.certified,displayIndex:this.displayIndex}))}};G.styles=sr;re([T()],G.prototype,"visible",void 0);re([T()],G.prototype,"imageSrc",void 0);re([T()],G.prototype,"imageLoading",void 0);re([T()],G.prototype,"isImpressed",void 0);re([d()],G.prototype,"explorerId",void 0);re([d()],G.prototype,"walletQuery",void 0);re([d()],G.prototype,"certified",void 0);re([d()],G.prototype,"displayIndex",void 0);re([d({type:Object})],G.prototype,"wallet",void 0);G=re([O("w3m-all-wallets-list-item")],G);const ar=U`
1158
+ wui-grid {
1159
+ max-height: clamp(360px, 400px, 80vh);
1160
+ overflow: scroll;
1161
+ scrollbar-width: none;
1162
+ grid-auto-rows: min-content;
1163
+ grid-template-columns: repeat(auto-fill, 104px);
1164
+ }
1165
+
1166
+ :host([data-mobile-fullscreen='true']) wui-grid {
1167
+ max-height: none;
1168
+ }
1169
+
1170
+ @media (max-width: 350px) {
1171
+ wui-grid {
1172
+ grid-template-columns: repeat(2, 1fr);
1173
+ }
1174
+ }
1175
+
1176
+ wui-grid[data-scroll='false'] {
1177
+ overflow: hidden;
1178
+ }
1179
+
1180
+ wui-grid::-webkit-scrollbar {
1181
+ display: none;
1182
+ }
1183
+
1184
+ w3m-all-wallets-list-item {
1185
+ opacity: 0;
1186
+ animation-duration: ${({durations:e})=>e.xl};
1187
+ animation-timing-function: ${({easings:e})=>e["ease-inout-power-2"]};
1188
+ animation-name: fade-in;
1189
+ animation-fill-mode: forwards;
1190
+ }
1191
+
1192
+ @keyframes fade-in {
1193
+ from {
1194
+ opacity: 0;
1195
+ }
1196
+ to {
1197
+ opacity: 1;
1198
+ }
1199
+ }
1200
+
1201
+ wui-loading-spinner {
1202
+ padding-top: ${({spacing:e})=>e[4]};
1203
+ padding-bottom: ${({spacing:e})=>e[4]};
1204
+ justify-content: center;
1205
+ grid-column: 1 / span 4;
1206
+ }
1207
+ `;var be=function(e,t,i,r){var o=arguments.length,n=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,i):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(n=(o<3?s(n):o>3?s(t,i,n):s(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n};const In="local-paginator";let ie=class extends M{constructor(){super(),this.unsubscribe=[],this.paginationObserver=void 0,this.loading=!N.state.wallets.length,this.wallets=N.state.wallets,this.recommended=N.state.recommended,this.featured=N.state.featured,this.filteredWallets=N.state.filteredWallets,this.mobileFullScreen=q.state.enableMobileFullScreen,this.unsubscribe.push(N.subscribeKey("wallets",t=>this.wallets=t),N.subscribeKey("recommended",t=>this.recommended=t),N.subscribeKey("featured",t=>this.featured=t),N.subscribeKey("filteredWallets",t=>this.filteredWallets=t))}firstUpdated(){this.initialFetch(),this.createPaginationObserver()}disconnectedCallback(){this.unsubscribe.forEach(t=>t()),this.paginationObserver?.disconnect()}render(){return this.mobileFullScreen&&this.setAttribute("data-mobile-fullscreen","true"),u`
1208
+ <wui-grid
1209
+ data-scroll=${!this.loading}
1210
+ .padding=${["0","3","3","3"]}
1211
+ gap="2"
1212
+ justifyContent="space-between"
1213
+ >
1214
+ ${this.loading?this.shimmerTemplate(16):this.walletsTemplate()}
1215
+ ${this.paginationLoaderTemplate()}
1216
+ </wui-grid>
1217
+ `}async initialFetch(){this.loading=!0;const t=this.shadowRoot?.querySelector("wui-grid");t&&(await N.fetchWalletsByPage({page:1}),await t.animate([{opacity:1},{opacity:0}],{duration:200,fill:"forwards",easing:"ease"}).finished,this.loading=!1,t.animate([{opacity:0},{opacity:1}],{duration:200,fill:"forwards",easing:"ease"}))}shimmerTemplate(t,i){return[...Array(t)].map(()=>u`
1218
+ <wui-card-select-loader type="wallet" id=${j(i)}></wui-card-select-loader>
1219
+ `)}getWallets(){const t=[...this.featured,...this.recommended];this.filteredWallets?.length>0?t.push(...this.filteredWallets):t.push(...this.wallets);const i=L.uniqueBy(t,"id"),r=Nt.markWalletsAsInstalled(i);return Nt.markWalletsWithDisplayIndex(r)}walletsTemplate(){return this.getWallets().map((i,r)=>u`
1220
+ <w3m-all-wallets-list-item
1221
+ data-testid="wallet-search-item-${i.id}"
1222
+ @click=${()=>this.onConnectWallet(i)}
1223
+ .wallet=${i}
1224
+ explorerId=${i.id}
1225
+ certified=${this.badge==="certified"}
1226
+ displayIndex=${r}
1227
+ ></w3m-all-wallets-list-item>
1228
+ `)}paginationLoaderTemplate(){const{wallets:t,recommended:i,featured:r,count:o,mobileFilteredOutWalletsLength:n}=N.state,s=window.innerWidth<352?3:4,a=t.length+i.length;let c=Math.ceil(a/s)*s-a+s;return c-=t.length?r.length%s:0,o===0&&r.length>0?null:o===0||[...r,...t,...i].length<o-(n??0)?this.shimmerTemplate(c,In):null}createPaginationObserver(){const t=this.shadowRoot?.querySelector(`#${In}`);t&&(this.paginationObserver=new IntersectionObserver(([i])=>{if(i?.isIntersecting&&!this.loading){const{page:r,count:o,wallets:n}=N.state;n.length<o&&N.fetchWalletsByPage({page:r+1})}}),this.paginationObserver.observe(t))}onConnectWallet(t){K.selectWalletConnector(t)}};ie.styles=ar;be([T()],ie.prototype,"loading",void 0);be([T()],ie.prototype,"wallets",void 0);be([T()],ie.prototype,"recommended",void 0);be([T()],ie.prototype,"featured",void 0);be([T()],ie.prototype,"filteredWallets",void 0);be([T()],ie.prototype,"badge",void 0);be([T()],ie.prototype,"mobileFullScreen",void 0);ie=be([O("w3m-all-wallets-list")],ie);const lr=Ln`
1229
+ wui-grid,
1230
+ wui-loading-spinner,
1231
+ wui-flex {
1232
+ height: 360px;
1233
+ }
1234
+
1235
+ wui-grid {
1236
+ overflow: scroll;
1237
+ scrollbar-width: none;
1238
+ grid-auto-rows: min-content;
1239
+ grid-template-columns: repeat(auto-fill, 104px);
1240
+ }
1241
+
1242
+ :host([data-mobile-fullscreen='true']) wui-grid {
1243
+ max-height: none;
1244
+ height: auto;
1245
+ }
1246
+
1247
+ wui-grid[data-scroll='false'] {
1248
+ overflow: hidden;
1249
+ }
1250
+
1251
+ wui-grid::-webkit-scrollbar {
1252
+ display: none;
1253
+ }
1254
+
1255
+ wui-loading-spinner {
1256
+ justify-content: center;
1257
+ align-items: center;
1258
+ }
1259
+
1260
+ @media (max-width: 350px) {
1261
+ wui-grid {
1262
+ grid-template-columns: repeat(2, 1fr);
1263
+ }
1264
+ }
1265
+ `;var qe=function(e,t,i,r){var o=arguments.length,n=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,i):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(n=(o<3?s(n):o>3?s(t,i,n):s(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n};let Re=class extends M{constructor(){super(...arguments),this.prevQuery="",this.prevBadge=void 0,this.loading=!0,this.mobileFullScreen=q.state.enableMobileFullScreen,this.query=""}render(){return this.mobileFullScreen&&this.setAttribute("data-mobile-fullscreen","true"),this.onSearch(),this.loading?u`<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 N.searchWallet({search:this.query,badge:this.badge}),this.loading=!1)}walletsTemplate(){const{search:t}=N.state,i=Nt.markWalletsAsInstalled(t);return t.length?u`
1266
+ <wui-grid
1267
+ data-testid="wallet-list"
1268
+ .padding=${["0","3","3","3"]}
1269
+ rowGap="4"
1270
+ columngap="2"
1271
+ justifyContent="space-between"
1272
+ >
1273
+ ${i.map((r,o)=>u`
1274
+ <w3m-all-wallets-list-item
1275
+ @click=${()=>this.onConnectWallet(r)}
1276
+ .wallet=${r}
1277
+ data-testid="wallet-search-item-${r.id}"
1278
+ explorerId=${r.id}
1279
+ certified=${this.badge==="certified"}
1280
+ walletQuery=${this.query}
1281
+ displayIndex=${o}
1282
+ ></w3m-all-wallets-list-item>
1283
+ `)}
1284
+ </wui-grid>
1285
+ `:u`
1286
+ <wui-flex
1287
+ data-testid="no-wallet-found"
1288
+ justifyContent="center"
1289
+ alignItems="center"
1290
+ gap="3"
1291
+ flexDirection="column"
1292
+ >
1293
+ <wui-icon-box size="lg" color="default" icon="wallet"></wui-icon-box>
1294
+ <wui-text data-testid="no-wallet-found-text" color="secondary" variant="md-medium">
1295
+ No Wallet found
1296
+ </wui-text>
1297
+ </wui-flex>
1298
+ `}onConnectWallet(t){K.selectWalletConnector(t)}};Re.styles=lr;qe([T()],Re.prototype,"loading",void 0);qe([T()],Re.prototype,"mobileFullScreen",void 0);qe([d()],Re.prototype,"query",void 0);qe([d()],Re.prototype,"badge",void 0);Re=qe([O("w3m-all-wallets-search")],Re);var qt=function(e,t,i,r){var o=arguments.length,n=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,i):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(n=(o<3?s(n):o>3?s(t,i,n):s(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n};let nt=class extends M{constructor(){super(...arguments),this.search="",this.badge=void 0,this.onDebouncedSearch=L.debounce(t=>{this.search=t})}render(){const t=this.search.length>=2;return u`
1299
+ <wui-flex .padding=${["1","3","3","3"]} gap="2" alignItems="center">
1300
+ <wui-search-bar @inputChange=${this.onInputChange.bind(this)}></wui-search-bar>
1301
+ <wui-certified-switch
1302
+ ?checked=${this.badge==="certified"}
1303
+ @certifiedSwitchChange=${this.onCertifiedSwitchChange.bind(this)}
1304
+ data-testid="wui-certified-switch"
1305
+ ></wui-certified-switch>
1306
+ ${this.qrButtonTemplate()}
1307
+ </wui-flex>
1308
+ ${t||this.badge?u`<w3m-all-wallets-search
1309
+ query=${this.search}
1310
+ .badge=${this.badge}
1311
+ ></w3m-all-wallets-search>`:u`<w3m-all-wallets-list .badge=${this.badge}></w3m-all-wallets-list>`}
1312
+ `}onInputChange(t){this.onDebouncedSearch(t.detail)}onCertifiedSwitchChange(t){t.detail?(this.badge="certified",Me.showSvg("Only WalletConnect certified",{icon:"walletConnectBrown",iconColor:"accent-100"})):this.badge=void 0}qrButtonTemplate(){return L.isMobile()?u`
1313
+ <wui-icon-box
1314
+ size="xl"
1315
+ iconSize="xl"
1316
+ color="accent-primary"
1317
+ icon="qrCode"
1318
+ border
1319
+ borderColor="wui-accent-glass-010"
1320
+ @click=${this.onWalletConnectQr.bind(this)}
1321
+ ></wui-icon-box>
1322
+ `:null}onWalletConnectQr(){B.push("ConnectingWalletConnect")}};qt([T()],nt.prototype,"search",void 0);qt([T()],nt.prototype,"badge",void 0);nt=qt([O("w3m-all-wallets-view")],nt);const cr=U`
1323
+ :host {
1324
+ width: 100%;
1325
+ }
1326
+
1327
+ button {
1328
+ display: flex;
1329
+ align-items: center;
1330
+ justify-content: space-between;
1331
+ padding: ${({spacing:e})=>e[3]};
1332
+ width: 100%;
1333
+ background-color: ${({tokens:e})=>e.theme.backgroundPrimary};
1334
+ border-radius: ${({borderRadius:e})=>e[4]};
1335
+ transition:
1336
+ background-color ${({durations:e})=>e.lg}
1337
+ ${({easings:e})=>e["ease-out-power-2"]},
1338
+ scale ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]};
1339
+ will-change: background-color, scale;
1340
+ }
1341
+
1342
+ wui-text {
1343
+ text-transform: capitalize;
1344
+ }
1345
+
1346
+ wui-image {
1347
+ color: ${({tokens:e})=>e.theme.textPrimary};
1348
+ }
1349
+
1350
+ @media (hover: hover) {
1351
+ button:hover:enabled {
1352
+ background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
1353
+ }
1354
+ }
1355
+
1356
+ button:disabled {
1357
+ opacity: 0.5;
1358
+ cursor: not-allowed;
1359
+ }
1360
+ `;var oe=function(e,t,i,r){var o=arguments.length,n=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,i):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(n=(o<3?s(n):o>3?s(t,i,n):s(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n};let Q=class extends M{constructor(){super(...arguments),this.imageSrc="google",this.loading=!1,this.disabled=!1,this.rightIcon=!0,this.rounded=!1,this.fullSize=!1}render(){return this.dataset.rounded=this.rounded?"true":"false",u`
1361
+ <button
1362
+ ?disabled=${this.loading?!0:!!this.disabled}
1363
+ data-loading=${this.loading}
1364
+ tabindex=${j(this.tabIdx)}
1365
+ >
1366
+ <wui-flex gap="2" alignItems="center">
1367
+ ${this.templateLeftIcon()}
1368
+ <wui-flex gap="1">
1369
+ <slot></slot>
1370
+ </wui-flex>
1371
+ </wui-flex>
1372
+ ${this.templateRightIcon()}
1373
+ </button>
1374
+ `}templateLeftIcon(){return this.icon?u`<wui-image
1375
+ icon=${this.icon}
1376
+ iconColor=${j(this.iconColor)}
1377
+ ?boxed=${!0}
1378
+ ?rounded=${this.rounded}
1379
+ ></wui-image>`:u`<wui-image
1380
+ ?boxed=${!0}
1381
+ ?rounded=${this.rounded}
1382
+ ?fullSize=${this.fullSize}
1383
+ src=${this.imageSrc}
1384
+ ></wui-image>`}templateRightIcon(){return this.rightIcon?this.loading?u`<wui-loading-spinner size="md" color="accent-primary"></wui-loading-spinner>`:u`<wui-icon name="chevronRight" size="lg" color="default"></wui-icon>`:null}};Q.styles=[J,me,cr];oe([d()],Q.prototype,"imageSrc",void 0);oe([d()],Q.prototype,"icon",void 0);oe([d()],Q.prototype,"iconColor",void 0);oe([d({type:Boolean})],Q.prototype,"loading",void 0);oe([d()],Q.prototype,"tabIdx",void 0);oe([d({type:Boolean})],Q.prototype,"disabled",void 0);oe([d({type:Boolean})],Q.prototype,"rightIcon",void 0);oe([d({type:Boolean})],Q.prototype,"rounded",void 0);oe([d({type:Boolean})],Q.prototype,"fullSize",void 0);Q=oe([O("wui-list-item")],Q);var ur=function(e,t,i,r){var o=arguments.length,n=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,i):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(n=(o<3?s(n):o>3?s(t,i,n):s(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n};let Wn=class extends M{constructor(){super(...arguments),this.wallet=B.state.data?.wallet}render(){if(!this.wallet)throw new Error("w3m-downloads-view");return u`
1385
+ <wui-flex gap="2" flexDirection="column" .padding=${["3","3","4","3"]}>
1386
+ ${this.chromeTemplate()} ${this.iosTemplate()} ${this.androidTemplate()}
1387
+ ${this.homepageTemplate()}
1388
+ </wui-flex>
1389
+ `}chromeTemplate(){return this.wallet?.chrome_store?u`<wui-list-item
1390
+ variant="icon"
1391
+ icon="chromeStore"
1392
+ iconVariant="square"
1393
+ @click=${this.onChromeStore.bind(this)}
1394
+ chevron
1395
+ >
1396
+ <wui-text variant="md-medium" color="primary">Chrome Extension</wui-text>
1397
+ </wui-list-item>`:null}iosTemplate(){return this.wallet?.app_store?u`<wui-list-item
1398
+ variant="icon"
1399
+ icon="appStore"
1400
+ iconVariant="square"
1401
+ @click=${this.onAppStore.bind(this)}
1402
+ chevron
1403
+ >
1404
+ <wui-text variant="md-medium" color="primary">iOS App</wui-text>
1405
+ </wui-list-item>`:null}androidTemplate(){return this.wallet?.play_store?u`<wui-list-item
1406
+ variant="icon"
1407
+ icon="playStore"
1408
+ iconVariant="square"
1409
+ @click=${this.onPlayStore.bind(this)}
1410
+ chevron
1411
+ >
1412
+ <wui-text variant="md-medium" color="primary">Android App</wui-text>
1413
+ </wui-list-item>`:null}homepageTemplate(){return this.wallet?.homepage?u`
1414
+ <wui-list-item
1415
+ variant="icon"
1416
+ icon="browser"
1417
+ iconVariant="square-blue"
1418
+ @click=${this.onHomePage.bind(this)}
1419
+ chevron
1420
+ >
1421
+ <wui-text variant="md-medium" color="primary">Website</wui-text>
1422
+ </wui-list-item>
1423
+ `:null}openStore(t){t.href&&this.wallet&&(F.sendEvent({type:"track",event:"GET_WALLET",properties:{name:this.wallet.name,walletRank:this.wallet.order,explorerId:this.wallet.id,type:t.type}}),L.openHref(t.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"})}};Wn=ur([O("w3m-downloads-view")],Wn);export{nt as W3mAllWalletsView,Ye as W3mConnectingWcBasicView,Wn as W3mDownloadsView};