PageSourceSearch

https://metarides.io/_next/static/chunks/8867.fe5cb31bfd4ad0d6.js

js metarides.io collected 2026-10-06 19:12:27 UTC 18,142 bytes, 250 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8867],{8867:function(e,t,o){o.r(t),o.d(t,{W3mConnectSocialsView:function(){return b},W3mConnectingFarcasterView:function(){return B},W3mConnectingSocialView:function(){return _}});var i=o(31133),r=o(84927),n=o(32801),s=o(81341),a=o(48415),l=o(92413);o(96277),o(34041);var c=o(35652),d=o(86777),u=o(59712),h=o(72723),p=o(5344),m=o(53357);o(15834);var w=o(55),g=(0,l.iv)`
2  :host {
3    margin-top: ${({spacing:e})=>e["1"]};
4  }
5  wui-separator {
6    margin: ${({spacing:e})=>e["3"]} calc(${({spacing:e})=>e["3"]} * -1)
7      ${({spacing:e})=>e["2"]} calc(${({spacing:e})=>e["3"]} * -1);
8    width: calc(100% + ${({spacing:e})=>e["3"]} * 2);
9  }
10`,C=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s};let f=class extends i.oi{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=c.ConnectorController.state.connectors,this.authConnector=this.connectors.find(e=>"AUTH"===e.type),this.remoteFeatures=a.OptionsController.state.remoteFeatures,this.isPwaLoading=!1,this.unsubscribe.push(c.ConnectorController.subscribeKey("connectors",e=>{this.connectors=e,this.authConnector=this.connectors.find(e=>"AUTH"===e.type)}),a.OptionsController.subscribeKey("remoteFeatures",e=>this.remoteFeatures=e))}connectedCallback(){super.connectedCallback(),this.handlePwaFrameLoad()}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){let e=this.remoteFeatures?.socials||[],t=!!this.authConnector,o=e?.length,r="ConnectSocials"===d.RouterController.state.view;return t&&o||r?(r&&!o&&(e=u.bq.DEFAULT_SOCIALS),(0,i.dy)` <wui-flex flexDirection="column" gap="2">
11      ${e.map(e=>(0,i.dy)`<wui-list-social
12            @click=${()=>{this.onSocialClick(e)}}
13            data-testid=${`social-selector-${e}`}
14            name=${e}
15            logo=${e}
16            ?disabled=${this.isPwaLoading}
17          ></wui-list-social>`)}
18    </wui-flex>`):null}async onSocialClick(e){e&&await (0,p.y0)(e)}async handlePwaFrameLoad(){if(m.j.isPWA()){this.isPwaLoading=!0;try{this.authConnector?.provider instanceof w.S&&await this.authConnector.provider.init()}catch(e){h.AlertController.open({displayMessage:"Error loading embedded wallet in PWA",debugMessage:e.message},"error")}finally{this.isPwaLoading=!1}}}};f.styles=g,C([(0,r.Cb)()],f.prototype,"tabIdx",void 0),C([(0,r.SB)()],f.prototype,"connectors",void 0),C([(0,r.SB)()],f.prototype,"authConnector",void 0),C([(0,r.SB)()],f.prototype,"remoteFeatures",void 0),C([(0,r.SB)()],f.prototype,"isPwaLoading",void 0),f=C([(0,l.Mo)("w3m-social-login-list")],f);var v=(0,l.iv)`
19  wui-flex {
20    max-height: clamp(360px, 540px, 80vh);
21    overflow: scroll;
22    scrollbar-width: none;
23    transition: opacity ${({durations:e})=>e.md}
24      ${({easings:e})=>e["ease-out-power-1"]};
25    will-change: opacity;
26  }
27
28  wui-flex::-webkit-scrollbar {
29    display: none;
30  }
31
32  wui-flex.disabled {
33    opacity: 0.3;
34    pointer-events: none;
35    user-select: none;
36  }
37`,y=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s};let b=class extends i.oi{constructor(){super(),this.unsubscribe=[],this.checked=s.M.state.isLegalCheckboxChecked,this.unsubscribe.push(s.M.subscribeKey("isLegalCheckboxChecked",e=>{this.checked=e}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){let{termsConditionsUrl:e,privacyPolicyUrl:t}=a.OptionsController.state,o=a.OptionsController.state.features?.legalCheckbox,r=!!(e||t)&&!!o&&!this.checked;return(0,i.dy)`
38      <w3m-legal-checkbox></w3m-legal-checkbox>
39      <wui-flex
40        flexDirection="column"
41        .padding=${["0","3","3","3"]}
42        gap="01"
43        class=${(0,n.o)(r?"disabled":void 0)}
44      >
45        <w3m-social-login-list tabIdx=${(0,n.o)(r?-1:void 0)}></w3m-social-login-list>
46      </wui-flex>
47    `}};b.styles=v,y([(0,r.SB)()],b.prototype,"checked",void 0),b=y([(0,l.Mo)("w3m-connect-socials-view")],b);var x=o(68584),S=o(64369),$=o(6943),k=o(31929),P=o(36801),E=o(66909),O=o(89512),R=o(52005);o(92374),o(87302),o(84793),o(44732);var I=o(65653),L=o(54946),A=(0,l.iv)`
48  wui-logo {
49    width: 80px;
50    height: 80px;
51    border-radius: ${({borderRadius:e})=>e["8"]};
52  }
53  @keyframes shake {
54    0% {
55      transform: translateX(0);
56    }
57    25% {
58      transform: translateX(3px);
59    }
60    50% {
61      transform: translateX(-3px);
62    }
63    75% {
64      transform: translateX(3px);
65    }
66    100% {
67      transform: translateX(0);
68    }
69  }
70  wui-flex:first-child:not(:only-child) {
71    position: relative;
72  }
73  wui-loading-thumbnail {
74    position: absolute;
75  }
76  wui-icon-box {
77    position: absolute;
78    right: calc(${({spacing:e})=>e["1"]} * -1);
79    bottom: calc(${({spacing:e})=>e["1"]} * -1);
80    opacity: 0;
81    transform: scale(0.5);
82    transition: all ${({easings:e})=>e["ease-out-power-2"]}
83      ${({durations:e})=>e.lg};
84  }
85  wui-text[align='center'] {
86    width: 100%;
87    padding: 0px ${({spacing:e})=>e["4"]};
88  }
89  [data-error='true'] wui-icon-box {
90    opacity: 1;
91    transform: scale(1);
92  }
93  [data-error='true'] > wui-flex:first-child {
94    animation: shake 250ms ${({easings:e})=>e["ease-out-power-2"]} both;
95  }
96  .capitalize {
97    text-transform: capitalize;
98  }
99`,T=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s};let _=class extends i.oi{constructor(){super(),this.unsubscribe=[],this.socialProvider=x.AccountController.state.socialProvider,this.socialWindow=x.AccountController.state.socialWindow,this.error=!1,this.connecting=!1,this.message="Connect in the provider window",this.remoteFeatures=a.OptionsController.state.remoteFeatures,this.address=x.AccountController.state.address,this.connectionsByNamespace=S.ConnectionController.getConnections($.R.state.activeChain),this.hasMultipleConnections=this.connectionsByNamespace.length>0,this.authConnector=c.ConnectorController.getAuthConnector(),this.handleSocialConnection=async e=>{if(e.data?.resultUri){if(e.origin===L.b.SECURE_SITE_ORIGIN){window.removeEventListener("message",this.handleSocialConnection,!1);try{if(this.authConnector&&!this.connecting){this.socialWindow&&(this.socialWindow.close(),x.AccountController.setSocialWindow(void 0,$.R.state.activeChain)),this.connecting=!0,this.updateMessage();let t=e.data.resultUri;this.socialProvider&&k.X.sendEvent({type:"track",event:"SOCIAL_LOGIN_REQUEST_USER_DATA",properties:{provider:this.socialProvider}}),await S.ConnectionController.connectExternal({id:this.authConnector.id,type:this.authConnector.type,socialUri:t},this.authConnector.chain),this.socialProvider&&(P.M.setConnectedSocialProvider(this.socialProvider),k.X.sendEvent({type:"track",event:"SOCIAL_LOGIN_SUCCESS",properties:{provider:this.socialProvider}}))}}catch(e){this.error=!0,this.updateMessage(),this.socialProvider&&k.X.sendEvent({type:"track",event:"SOCIAL_LOGIN_ERROR",properties:{provider:this.socialProvider}})}}else d.RouterController.goBack(),E.SnackController.showError("Untrusted Origin"),this.socialProvider&&k.X.sendEvent({type:"track",event:"SOCIAL_LOGIN_ERROR",properties:{provider:this.socialProvider}})}},I.j.EmbeddedWalletAbortController.signal.addEventListener("abort",()=>{this.socialWindow&&(this.socialWindow.close(),x.AccountController.setSocialWindow(void 0,$.R.state.activeChain))}),this.unsubscribe.push(x.AccountController.subscribe(e=>{e.socialProvider&&(this.socialProvider=e.socialProvider),e.socialWindow&&(this.socialWindow=e.socialWindow)}),a.OptionsController.subscribeKey("remoteFeatures",e=>{this.remoteFeatures=e}),x.AccountController.subscribeKey("address",e=>{let t=this.remoteFeatures?.multiWallet;e&&e!==this.address&&(this.hasMultipleConnections&&t?(d.RouterController.replace("ProfileWallets"),E.SnackController.showSuccess("New Wallet Added")):(O.I.state.open||a.OptionsController.state.enableEmbedded)&&O.I.close())})),this.authConnector&&this.connectSocial()}
99disconnectedCallback(){this.unsubscribe.forEach(e=>e()),window.removeEventListener("message",this.handleSocialConnection,!1),this.socialWindow?.close(),x.AccountController.setSocialWindow(void 0,$.R.state.activeChain)}render(){return(0,i.dy)`
100      <wui-flex
101        data-error=${(0,n.o)(this.error)}
102        flexDirection="column"
103        alignItems="center"
104        .padding=${["10","5","5","5"]}
105        gap="6"
106      >
107        <wui-flex justifyContent="center" alignItems="center">
108          <wui-logo logo=${(0,n.o)(this.socialProvider)}></wui-logo>
109          ${this.error?null:this.loaderTemplate()}
110          <wui-icon-box color="error" icon="close" size="sm"></wui-icon-box>
111        </wui-flex>
112        <wui-flex flexDirection="column" alignItems="center" gap="2">
113          <wui-text align="center" variant="lg-medium" color="primary"
114            >Log in with
115            <span class="capitalize">${this.socialProvider??"Social"}</span></wui-text
116          >
117          <wui-text align="center" variant="lg-regular" color=${this.error?"error":"secondary"}
118            >${this.message}</wui-text
119          ></wui-flex
120        >
121      </wui-flex>
122    `}loaderTemplate(){let e=R.ThemeController.state.themeVariables["--w3m-border-radius-master"],t=e?parseInt(e.replace("px",""),10):4;return(0,i.dy)`<wui-loading-thumbnail radius=${9*t}></wui-loading-thumbnail>`}connectSocial(){let e=setInterval(()=>{this.socialWindow?.closed&&(this.connecting||"ConnectingSocial"!==d.RouterController.state.view||(this.socialProvider&&k.X.sendEvent({type:"track",event:"SOCIAL_LOGIN_CANCELED",properties:{provider:this.socialProvider}}),d.RouterController.goBack()),clearInterval(e))},1e3);window.addEventListener("message",this.handleSocialConnection,!1)}updateMessage(){this.error?this.message="Something went wrong":this.connecting?this.message="Retrieving user data":this.message="Connect in the provider window"}};_.styles=A,T([(0,r.SB)()],_.prototype,"socialProvider",void 0),T([(0,r.SB)()],_.prototype,"socialWindow",void 0),T([(0,r.SB)()],_.prototype,"error",void 0),T([(0,r.SB)()],_.prototype,"connecting",void 0),T([(0,r.SB)()],_.prototype,"message",void 0),T([(0,r.SB)()],_.prototype,"remoteFeatures",void 0),_=T([(0,l.Mo)("w3m-connecting-social-view")],_),o(97585),o(4594),o(930),o(80843);var F=(0,l.iv)`
123  wui-shimmer {
124    width: 100%;
125    aspect-ratio: 1 / 1;
126    border-radius: ${({borderRadius:e})=>e[4]};
127  }
128
129  wui-qr-code {
130    opacity: 0;
131    animation-duration: ${({durations:e})=>e.xl};
132    animation-timing-function: ${({easings:e})=>e["ease-out-power-2"]};
133    animation-name: fade-in;
134    animation-fill-mode: forwards;
135  }
136
137  wui-logo {
138    width: 80px;
139    height: 80px;
140    border-radius: ${({borderRadius:e})=>e["8"]};
141  }
142
143  wui-flex:first-child:not(:only-child) {
144    position: relative;
145  }
146
147  wui-loading-thumbnail {
148    position: absolute;
149  }
150
151  wui-icon-box {
152    position: absolute;
153    right: calc(${({spacing:e})=>e["1"]} * -1);
154    bottom: calc(${({spacing:e})=>e["1"]} * -1);
155    opacity: 0;
156    transform: scale(0.5);
157    transition:
158      opacity ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]},
159      transform ${({durations:e})=>e.lg}
160        ${({easings:e})=>e["ease-out-power-2"]};
161    will-change: opacity, transform;
162  }
163
164  @keyframes fade-in {
165    from {
166      opacity: 0;
167    }
168    to {
169      opacity: 1;
170    }
171  }
172`,W=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s};let B=class extends i.oi{constructor(){super(),this.unsubscribe=[],this.timeout=void 0,this.socialProvider=x.AccountController.state.socialProvider,this.uri=x.AccountController.state.farcasterUrl,this.ready=!1,this.loading=!1,this.remoteFeatures=a.OptionsController.state.remoteFeatures,this.authConnector=c.ConnectorController.getAuthConnector(),this.forceUpdate=()=>{this.requestUpdate()},this.unsubscribe.push(x.AccountController.subscribeKey("farcasterUrl",e=>{e&&(this.uri=e,this.connectFarcaster())}),x.AccountController.subscribeKey("socialProvider",e=>{e&&(this.socialProvider=e)}),a.OptionsController.subscribeKey("remoteFeatures",e=>{this.remoteFeatures=e})),window.addEventListener("resize",this.forceUpdate)}disconnectedCallback(){super.disconnectedCallback(),clearTimeout(this.timeout),window.removeEventListener("resize",this.forceUpdate)}render(){return this.onRenderProxy(),(0,i.dy)`${this.platformTemplate()}`}platformTemplate(){return m.j.isMobile()?(0,i.dy)`${this.mobileTemplate()}`:(0,i.dy)`${this.desktopTemplate()}`}desktopTemplate(){return this.loading?(0,i.dy)`${this.loadingTemplate()}`:(0,i.dy)`${this.qrTemplate()}`}qrTemplate(){return(0,i.dy)` <wui-flex
173      flexDirection="column"
174      alignItems="center"
175      .padding=${["0","5","5","5"]}
176      gap="5"
177    >
178      <wui-shimmer width="100%"> ${this.qrCodeTemplate()} </wui-shimmer>
179
180      <wui-text variant="lg-medium" color="primary"> Scan this QR Code with your phone </wui-text>
181      ${this.copyTemplate()}
182    </wui-flex>`}loadingTemplate(){return(0,i.dy)`
183      <wui-flex
184        flexDirection="column"
185        alignItems="center"
186        .padding=${["5","5","5","5"]}
187        gap="5"
188      >
189        <wui-flex justifyContent="center" alignItems="center">
190          <wui-logo logo="farcaster"></wui-logo>
191          ${this.loaderTemplate()}
192          <wui-icon-box color="error" icon="close" size="sm"></wui-icon-box>
193        </wui-flex>
194        <wui-flex flexDirection="column" alignItems="center" gap="2">
195          <wui-text align="center" variant="md-medium" color="primary">
196            Loading user data
197          </wui-text>
198          <wui-text align="center" variant="sm-regular" color="secondary">
199            Please wait a moment while we load your data.
200          </wui-text>
201        </wui-flex>
202      </wui-flex>
203    `}mobileTemplate(){return(0,i.dy)` <wui-flex
204      flexDirection="column"
205      alignItems="center"
206      .padding=${["10","5","5","5"]}
207      gap="5"
208    >
209      <wui-flex justifyContent="center" alignItems="center">
210        <wui-logo logo="farcaster"></wui-logo>
211        ${this.loaderTemplate()}
212        <wui-icon-box
213          color="error"
214          icon="close"
215          size="sm"
216        ></wui-icon-box>
217      </wui-flex>
218      <wui-flex flexDirection="column" alignItems="center" gap="2">
219        <wui-text align="center" variant="md-medium" color="primary"
220          >
220Continue in Farcaster</span></wui-text
221        >
222        <wui-text align="center" variant="sm-regular" color="secondary"
223          >Accept connection request in the app</wui-text
224        ></wui-flex
225      >
226      ${this.mobileLinkTemplate()}
227    </wui-flex>`}loaderTemplate(){let e=R.ThemeController.state.themeVariables["--w3m-border-radius-master"],t=e?parseInt(e.replace("px",""),10):4;return(0,i.dy)`<wui-loading-thumbnail radius=${9*t}></wui-loading-thumbnail>`}async connectFarcaster(){if(this.authConnector)try{await this.authConnector?.provider.connectFarcaster(),this.socialProvider&&(P.M.setConnectedSocialProvider(this.socialProvider),k.X.sendEvent({type:"track",event:"SOCIAL_LOGIN_REQUEST_USER_DATA",properties:{provider:this.socialProvider}})),this.loading=!0;let e=S.ConnectionController.getConnections(this.authConnector.chain).length>0;await S.ConnectionController.connectExternal(this.authConnector,this.authConnector.chain);let t=this.remoteFeatures?.multiWallet;this.socialProvider&&k.X.sendEvent({type:"track",event:"SOCIAL_LOGIN_SUCCESS",properties:{provider:this.socialProvider}}),this.loading=!1,e&&t?(d.RouterController.replace("ProfileWallets"),E.SnackController.showSuccess("New Wallet Added")):O.I.close()}catch(e){this.socialProvider&&k.X.sendEvent({type:"track",event:"SOCIAL_LOGIN_ERROR",properties:{provider:this.socialProvider}}),d.RouterController.goBack(),E.SnackController.showError(e)}}mobileLinkTemplate(){return(0,i.dy)`<wui-button
228      size="md"
229      ?loading=${this.loading}
230      ?disabled=${!this.uri||this.loading}
231      @click=${()=>{this.uri&&m.j.openHref(this.uri,"_blank")}}
232    >
233      Open farcaster</wui-button
234    >`}onRenderProxy(){!this.ready&&this.uri&&(this.timeout=setTimeout(()=>{this.ready=!0},200))}qrCodeTemplate(){if(!this.uri||!this.ready)return null;let e=this.getBoundingClientRect().width-40;return(0,i.dy)` <wui-qr-code
235      size=${e}
236      theme=${R.ThemeController.state.themeMode}
237      uri=${this.uri}
238      ?farcaster=${!0}
239      data-testid="wui-qr-code"
240      color=${(0,n.o)(R.ThemeController.state.themeVariables["--w3m-qr-color"])}
241    ></wui-qr-code>`}copyTemplate(){let e=!this.uri||!this.ready;return(0,i.dy)`<wui-button
242      .disabled=${e}
243      @click=${this.onCopyUri}
244      variant="neutral-secondary"
245      size="sm"
246      data-testid="copy-wc2-uri"
247    >
248      <wui-icon size="sm" color="default" slot="iconRight" name="copy"></wui-icon>
249      Copy link
250    </wui-button>`}onCopyUri(){try{this.uri&&(m.j.copyToClopboard(this.uri),E.SnackController.showSuccess("Link copied"))}catch{E.SnackController.showError("Failed to copy")}}};B.styles=F,W([(0,r.SB)()],B.prototype,"socialProvider",void 0),W([(0,r.SB)()],B.prototype,"uri",void 0),W([(0,r.SB)()],B.prototype,"ready",void 0),W([(0,r.SB)()],B.prototype,"loading",void 0),W([(0,r.SB)()],B.prototype,"remoteFeatures",void 0),B=W([(0,l.Mo)("w3m-connecting-farcaster-view")],B)}}]);

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