(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,1567,e=>{"use strict";var t=e.i(947118),i=e.i(737801),o=e.i(477716);e.s(["useTrackModuleViewed",0,()=>{let e="module-viewed",r=(0,t.useIsInitialized)(),n=(0,i.useEventAttributes)();return(0,o.useCallback)(({moduleId:t,modulePosition:i})=>{if(!r)return void console.warn("MParticle is not initialized");let o={module_id:t,module_position:i,...n};try{window.mParticle?.logEvent?.(e,window.mParticle?.EventType?.Other,o),console.debug(`MParticle: Event "${e}" tracked`,o)}catch(t){console.error(`MParticle: Event "${e}" failed`,t)}},[n,r])}])},855602,e=>{"use strict";var t=e.i(297647),i=e.i(477716),o=e.i(1567),r=e.i(333350);e.s(["ModuleAnalytics",0,({moduleId:e,modulePosition:n,variant:l="frontend",children:s})=>{let a=(0,i.useRef)(null),[c,u]=(0,i.useState)(!1),d=(0,i.useRef)(null),g=(0,o.useTrackModuleViewed)();return"admin"===l?(0,t.jsx)(t.Fragment,{children:s}):((0,i.useEffect)(()=>{if(c||!r.default||!a.current)return;let t=a.current,i=new IntersectionObserver(t=>{t.forEach(t=>{t.isIntersecting&&t.intersectionRatio>=1?d.current||(d.current=setTimeout(()=>{g({moduleId:e,modulePosition:n}),u(!0),d.current=null},2e3)):d.current&&(clearTimeout(d.current),d.current=null)})},{threshold:1});i.observe(t);let o=t.getBoundingClientRect(),l=window.innerHeight||document.documentElement.clientHeight,s=window.innerWidth||document.documentElement.clientWidth;return o.top>=0&&o.left>=0&&o.bottom{g({moduleId:e,modulePosition:n}),u(!0),d.current=null},2e3)),()=>{d.current&&clearTimeout(d.current),i.disconnect()}},[c,e,n,g]),(0,t.jsx)("div",{ref:a,className:"hide-empty","data-module-id":e,children:s}))}])},590238,e=>{"use strict";var t=e.i(537989),i=e.i(827049),o=e.i(695203),r=e.i(604323),n=e.i(797770),l=e.i(991511);e.s(["AnalyticsBoundary",0,e=>((0,l.useRehydrateAtoms)([[t.pageIdAtom,e.pageId],[i.pageLocaleAtom,e.pageLocale],[o.deviceClassAtom,e.deviceClass],[r.metricsArticleDataAtom,e.metricsArticleData],[n.adsMetricsUnitAndZoneAtom,e.adsMetricsUnitAndZone??"non_monetized"]]),null)])},703123,e=>{"use strict";let t=(0,e.i(751931).atom)({});e.s(["gsiEmailStatesAtom",0,t])},404893,e=>{"use strict";let t=(0,e.i(751931).atom)(!1);e.s(["googleLoginInitilizedAtom",0,t])},874905,e=>{"use strict";e.i(694914);var t=e.i(297647),i=e.i(241722),o=e.i(477716),r=e.i(475566),n=e.i(352194),l=e.i(671525),s=e.i(901351),a=e.i(310847),c=e.i(776169),u=e.i(422825),d=e.i(143851),g=e.i(703123),m=e.i(404893),h=e.i(367810),p=e.i(251392);function A({onLoad:e,prompt:A=!0,isUserLoggedIn:f}){let w=(0,n.useTranslations)("GoogleLogin"),v=(0,r.useSetAtom)(m.googleLoginInitilizedAtom),{loginWithGoogle:y,error:b,clearError:E}=function(){let e=(0,n.useTranslations)("GoogleLogin"),[t,i]=(0,o.useState)(null),m=(0,r.useSetAtom)(a.userHasLoggedInBeforeAtom),h=(0,r.useAtomValue)(g.gsiEmailStatesAtom),{updateEmailSubscriptions:p}=(0,u.useEmailPreferences)(),{refresh:A}=(0,l.usePageNavigation)(),{syncPreferencesFromUpsx:f}=(0,c.usePreferences)(),{authSuccess:w,authRedirect:v}=(0,d.useUserLogin)();return{loginWithGoogle:(0,o.useCallback)(async t=>{let{credential:o}=t;i(null);try{let e=await s.upsxClient.auth.loginWithGoogle({google_id_token:o}),t=e?.isFirstLogin;await w({email:e.email,userID:e.userID,type:t?"signup":"login"},!1);let{newsletter:i,weekly:r,marketing:n,alwaysSubscribe:l}=h||{};return(t||l)&&await p({newsletter:i,weekly:r,marketing:n}).catch(e=>{console.error("Failed to update email subscriptions",e)}),v(),!0}catch(t){console.error("Failed to login with Google",t);try{let o=t?.data,r=o?.messageCode;if(!r)throw Error("No Error Message");switch(r){case 1e3:case 1026:case 1033:i({header:e("emailAlreadyUsedGoogleHeader"),body:e.raw("emailAlreadyUsedGoogleBody")});break;case 1027:case 1030:i({header:e("emailAlreadyRegisteredGoogleHeader"),body:e("emailAlreadyRegisteredGoogleBody")});break;default:throw Error("No Specific Error")}}catch(t){i({header:e("somethingWentWrong")})}return!1}},[m,f,A,w,v,p,h]),error:t,clearError:(0,o.useCallback)(()=>{i(null)},[])}}(),T=(0,p.useRefMemo)(y);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i.default,{src:"https://accounts.google.com/gsi/client",onLoad:()=>{let t=window.google?.accounts?.id;t&&(t.initialize({client_id:"797231885346-rai9vgnvf4u38enai8bhginnnrh5uvch.apps.googleusercontent.com",context:"signin",ux_mode:"popup",use_fedcm_for_prompt:!0,callback:e=>{T.current?.(e)}}),v(!0)),e?.(),!f&&A&&t?.prompt()},id:"google-gsi-script"}),(0,t.jsx)(h.Dialog,{open:!!b,onOpenChange:e=>!e&&E(),children:(0,t.jsx)(h.BasicDialog,{showCloseButton:!1,title:b?.header||"",description:(0,t.jsx)("span",{dangerouslySetInnerHTML:{__html:b?.body||""}}),primaryAction:{label:w("cancel")}})})]})}e.s(["GoogleAuthScript",()=>A],874905)},711899,e=>{e.v(t=>Promise.all(["static/chunks/8198254d842f31ab.js"].map(t=>e.l(t))).then(()=>t(171714)))},137688,e=>{e.v(t=>Promise.all(["static/chunks/775f6992a5490e4c.js"].map(t=>e.l(t))).then(()=>t(72990)))}]);