1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5105],{43848:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});var n=r(55024),s=r(13005);class i extends s.Ay{static async fetchOrganizationInfo(e){let t=n.J.BASE_URL()+"/api/organizations/"+e+"/info";return await this.fetchApi(s.U0.get,t)}}},84490:(e,t,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/seller/[id]/auth/redirect",function(){return r(99982)}])},99982:(e,t,r)=>{"use strict";r.r(t),r.d(t,{__N_SSP:()=>y,default:()=>A,getRedirectProps:()=>p});var n=r(50979),s=r(84614),i=r(49181),a=r(25963),l=r(57404),o=r(55024),c=r(13005);class d extends c.Ay{static async getAccessToken(e){return this.fetchApi(c.U0.post,o.J.BASE_URL()+"/api/auth/token",{exchangeToken:e})}}var u=r(58411),h=r(62097),g=function(e){return e.loading="loading",e.error="error",e.success="success",e}(g||{});let f=e=>{let{seller:t,organization:r}=e,{t:o}=(0,s.Bd)(["common","auth","transactions"]),c=(0,i.useRouter)(),[g,f]=(0,a.useState)("loading");return(0,a.useLayoutEffect)(()=>{u.v.applyCheckoutStyling({theme:"white",sellerInfo:t})},[]),(0,a.useEffect)(()=>{if("error"===g){let e=setTimeout(()=>{t&&(window.location.href="/seller/".concat(t.url||t._id))},2500);return()=>clearTimeout(e)}},[g]),(0,a.useEffect)(()=>{let e=t?"/seller/".concat(t.url||t._id):null,{exchangeToken:r,redirect_uri:n=e}=c.query;if(!r||!n)return void f("error");let s=new URL(decodeURIComponent(n)).toString();if(!s.startsWith("https")&&!s.startsWith("http")&&s!==e)return void f("error");(async()=>{try{let e=await d.getAccessToken(String(r));f("success"),l.A.get().setToken(e.token),window.location.href=s}catch(e){l.A.get().isLoggedIn()&&(f("success"),window.location.href=s),f("error")}})()},[c.query.exchangeToken,c.query.redirect_uri]),(0,n.jsx)(h.v,{hideAccountPill:!0,children:(0,n.jsx)("div",{className:"fallback-holder",children:(0,n.jsx)("div",{className:"fallback-box",children:(0,n.jsxs)("div",{className:"fallback-box-content",children:[(0,n.jsx)("h2",{children:o("common:login")}),(0,n.jsx)("div",{className:"mt-24",children:(0,n.jsxs)("div",{className:"text info",children:["loading"===g&&(0,n.jsx)(n.Fragment,{children:o("auth:ssoRedirectPage.waitYouWillBeLoggedIn")}),"success"===g&&(0,n.jsx)(n.Fragment,{children:o("auth:ssoRedirectPage.successfullyLoggedIn")}),"error"===g&&(0,n.jsx)(n.Fragment,{children:o("auth:ssoRedirectPage.somethingWentWrongTryAgain")})]})})]})})})})};var m=r(81438),w=r(33792),x=r(92458),_=r(43848),v=r(92200),y=!0;let p=async(e,t,r)=>{try{let n=await v.A.fetchSellerInfo(r,e.detectedLocale),s=await (0,x.Wq)(t.domainCtx,n._id,n.orgId),i=null;return(null==n?void 0:n.orgId)&&(i=await _.A.fetchOrganizationInfo(n.orgId)),t.domainCtx=await s,{seller:n,organization:i}}catch(e){}return{seller:null,organization:null}},A=e=>{var t;let{t:r}=(0,s.Bd)("seller");return e.seller?(0,n.jsx)(w.O3,{seller:e.seller,organization:null!=(t=e.organization)?t:void 0,children:(0,n.jsx)(f,{seller:e.seller,organization:e.organization})}):(0,n.jsx)(m.M,{code:404,message:r("seller:sellerCouldNotBeFound")})}}},e=>{e.O(0,[7310,95,589,885,6878,8367,3407,7681,6707,6099,575,2194,636,6593,8792],()=>e(e.s=84490)),_N_E=e.O()}]);
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.