(globalThis["TURBOPACK_remote_chunk_loading_global_wx-next-web"]||(globalThis["TURBOPACK_remote_chunk_loading_global_wx-next-web"]=[])).push(["object"==typeof document?document.currentScript:void 0,414338,e=>{"use strict";var t=e.i(902875),a=e.i(247865),o=e.i(730921),i=e.i(581014),n=e.i(877957),r=e.i(62544),s=e.i(901351),l=e.i(313983),c=e.i(725296),u=e.i(521350),d=e.i(546446),g=e.i(540768),p=e.i(682142),C=e.i(782937),f=e.i(695881),m=e.i(333350),w=e.i(64412),h=e.i(950771),S=e.i(537989),v=e.i(695203),A=e.i(158662),y=e.i(358273),D=e.i(777638),x=e.i(924776),k=e.i(409628),b=e.i(605781),_=e.i(289681);let P=(0,f.createLogger)("useTrackConsentChange"),O={"sale-of-data":"sod","sensitive-data":"sensitive-data"};var T=e.i(611540),U=e.i(553329);let I=async e=>{let t;await (0,U.tryCatch)(Promise.race([Promise.resolve().then(e),new Promise(e=>{t=setTimeout(e,1e3)})])),clearTimeout(t)},E=({isUserLoggedIn:e,regime:f,deviceClass:U,experience:E,isPremiumUser:L})=>{let j=(0,i.useTranslations)("PrivacyConsentModal"),R=(0,o.useLocale)(),B=(0,T.interpolateUrl)(T.URLS.privacyPolicy,{locale:R}),[M,N]=(0,a.useState)(!1),[V,H]=(0,a.useState)(!1),[K,$]=(0,a.useState)(!1),F=(()=>{let e=(0,d.useAtomValue)(S.pageIdAtom),t=(0,d.useAtomValue)(h.pageLocaleAtom),o=(0,d.useAtomValue)(v.deviceClassAtom),i=(0,d.useAtomValue)(A.experimentJoinListAtom),{location:n}=(0,w.useLocation)(),r=(0,x.useIsHightouchReady)(),s=(0,a.useCallback)(()=>{let e=(0,p.getCICookie)(),a=e?.["TWC-GeoIP-Country"]??(0,g.getCookie)("twc-location-country"),r=e?.["TWC-GeoIP-Region"]??(0,g.getCookie)("twc-location-region"),s=e?.["TWC-Privacy"]??(0,g.getCookie)("twc-privacy"),l=window.DprSdk?.getGdprConsentOptInsString()??"",c=window.DprSdk?.getCcpaSaleOptInString()??"",u=window.navigator?.globalPrivacyControl??!1,d=l?.includes("functional-technology")??!1,f=window.DprSdk?.getUserConsent("geographically-relevant-advertising")!==!1,m=window.DprSdk?.getUserConsent("interest-based-ads")!==!1,w=(0,_.getConsentAuthorization)("sale-of-data"),h=(0,_.getConsentAuthorization)("sensitive-data"),S=navigator?.cookieEnabled??!1,v=(0,g.getCookie)("partner")||"",A=(0,C.getPartnerByPattern)(v)??v,x=(0,y.getMetricsSession)(),b=x?.sessionId||"",P=new Date(x?.sessionStartTime||0).toISOString(),O=new Date,T=O.getHours(),U=k.WEEK_DAYS[O.getDay()]??"";return{schemaVersion:"nextgen",referrer:document.referrer,locale:t,deviceClass:o,partner:A,sessionId:b,sessionStartTime:P,siteMode:"normal",dayOfWeek:U,hourOfDay:T,regime:s??"",cookiesEnabled:S,gpcSignalOptOut:u,functionalTechnologies:d,geographicallyRelevantAds:f,interestBasedAds:m,priv:l,privProducts:c,saleOfData:w??void 0,saleOfDataAuthorization:w,sensitiveDataAuthorization:h,campaign:(0,D.getCampaign)(),experimentJoinList:i,weatherMode:"normal",physicalCountry:a??"",physicalState:r??"",caUser:"US"===a&&"CA"===r,wlocCity:n?.city??null,wlocCountry:n?.countryCode??null,wlocState:n?.adminDistrictCode??null,samsungVersion:(0,D.getSamsungVersion)(),appVersion:"f8b2958c3bf4e34f803045a5250abc259d5b13bb".slice(0,10)}},[t,o,i,n]),l=(0,a.useCallback)((t,a)=>{if("sensitive-data"===t&&a)return(0,b.trackSensitiveDataOptin)(s());let o={...s(),pageId:e??"",wlocDMA:n?.dmaCd??null};return"sensitive-data"===t?(0,b.trackSensitiveDataOptout)(o):a?(0,b.trackSodOptin)(o):(0,b.trackSodOptout)(o)},[s,e,n]);return(0,a.useCallback)((e,t)=>{let a=`${O[e]}-${t?"optin":"optout"}`;if(m.default)return r?(P.info(`Hightouch: Event "${a}" tracked`),l(e,t)):void P.warn(`Hightouch: Event "${a}" skipped - SDK not ready`)},[r,l])})();(0,a.useEffect)(()=>{if(!c.US_REGIMES.includes(f)||L||!(0,u.isLocalStorageAvailable)())return;let t=localStorage.getItem("gpcConflict"),a=localStorage.getItem("saleOfDataConflict");t?(H(!0),N(!0)):e&&a&&f===c.Regime.USA_CCPA&&($(!0),N(!0))},[f,L,e]);let G=async e=>{try{let t={purpose:e.purpose,consent:e.value,setByUser:!0};await s.upsxClient.consent.createUserConsent(t),e.refreshAfterUpdate&&(await e.beforeRefresh,window.location.reload())}catch(e){console.error("Failed to update UPSX consent:",e)}},W=t=>{let a=window,o=window.top,i=a.DprSdk||o?.DprSdk;if(!i)return void console.error("Unable to fix conflict, missing DprSdk.");i.setUserConsents({[l.Purpose.SALE_OF_DATA]:t});let n=I(()=>F(l.Purpose.SALE_OF_DATA,t));e&&G({purpose:l.Purpose.SALE_OF_DATA,value:t,refreshAfterUpdate:!0,beforeRefresh:n}),V?((0,u.isLocalStorageAvailable)()&&localStorage.removeItem("gpcConflict"),e||n.then(()=>window.location.reload())):K&&(0,u.isLocalStorageAvailable)()&&localStorage.removeItem("saleOfDataConflict"),N(!1)},z="",J="";if(V?(z="gpcConflictHeader",J="gpcConflictParagraph",f===c.Regime.USA_CCPA&&(J+="_usa-ccpa")):K&&(z="saleOfDataConflictHeader",J="saleOfDataConflictParagraph",f===c.Regime.USA_CCPA&&(J+="_usa-ccpa")),J)return(0,t.jsx)(r.Dialog,{open:M,onOpenChange:N,children:(0,t.jsxs)(r.DialogContent,{className:`text-center ${"desktop"!==U?"h-screen w-screen max-w-none rounded-none":"max-w-lg"} ${"wu"===E?"wu-theme":""} `,onEscapeKeyDown:e=>{(K||V)&&e.preventDefault()},onPointerDownOutside:e=>{e.preventDefault()},showCloseButton:!1,children:[z&&(0,t.jsx)(r.DialogHeader,{children:(0,t.jsx)(r.DialogTitle,{className:"text-xl font-semibold",children:j(z)})}),(0,t.jsx)("div",{className:"py-4",children:(0,t.jsx)("p",{className:"text-sm leading-relaxed",children:j.rich(J,{privacyPolicyLink:e=>(0,t.jsx)("a",{href:B,target:"_top",className:"text-blue-600 underline hover:text-blue-800",children:e})})})}),(0,t.jsxs)(r.DialogFooter,{className:"flex w-fit flex-col gap-3 justify-self-center",children:[(0,t.jsx)(n.Button,{onClick:()=>{W(!0)},variant:"default",className:"w-full sm:w-auto",children:j("optInButtonText")}),(0,t.jsx)(n.Button,{onClick:()=>{W(!1)},variant:"secondary",className:"w-full sm:w-auto",children:j("optOutButtonText")})]})]})})};e.s(["PrivacyConsentModalClient",0,E,"SOD_TRACK_TIMEOUT_MS",0,1e3,"default",0,E],414338)},685840,function(e){e.n(e.i(414338))}]);