PageSourceSearch

https://ww2.freshthyme.com/static/js/PreferencesPage.43a3f0f9.chunk.js

js freshthyme.com collected 2026-10-03 20:11:03 UTC 20,683 bytes, 154 lines download raw bytes

1"use strict";(self.__LOADABLE_LOADED_CHUNKS__=self.__LOADABLE_LOADED_CHUNKS__||[]).push([[900],{67672:(e,t,r)=>{r.d(t,{Z:()=>h});var n=r(85893),a=r(68827),o=r(67294),s=r(85086),i=r(65715),c=r(68575);let l=(0,s.ZP)(i.Z).withConfig({displayName:"CheckboxStyled",componentId:"-__sc-b0341f44-0"})(["padding-top:",";"],c.W0.sm);var d=r(76633),m=r(26323),p=r(45007),g=r(41931),f=r(79810),u=r(35684);let h=(0,p.$j)((e,t)=>({attributeValue:(0,g.R)(e.customer,t.attribute,e.settings.retailer.maintainCustomerPreferences.optInMarketingPreferences,e.settings.retailer.maintainCustomerPreferences.sections.marketingPreferences.includes(t.attribute),(0,f.Z)(e.ui.currentUrl,[u.ZP.registrationStepTwo]))}))(e=>{let t,r,s=(0,a.c)(9),{t:i}=o.useContext(d.q),[c,p]=o.useState(e.attributeValue);s[0]!==c||s[1]!==e?(t=()=>{let t=!c;p(t),e.handleChange(e.attribute,t)},s[0]=c,s[1]=e,s[2]=t):t=s[2];let g=t;return s[3]!==c||s[4]!==g||s[5]!==e.attribute||s[6]!==e.compartment||s[7]!==i?(r=(0,m.Z)(()=>{let t;return(0,n.jsx)(l,{"data-testid":(t=e.attribute,`preferences-checkbox-test-id-${t}`),checkboxName:e.attribute,ariaLabel:i(`myPreferencesPage.${e.compartment}.${e.attribute}`),label:i(`myPreferencesPage.${e.compartment}.${e.attribute}`),handleChange:g,checked:c})},{componentName:"PreferenceCheckbox"}),s[3]=c,s[4]=g,s[5]=e.attribute,s[6]=e.compartment,s[7]=i,s[8]=r):r=s[8],r})},3500:(e,t,r)=>{r.d(t,{J9:()=>o,Us:()=>s,cv:()=>n,iz:()=>a});let n="PreferencesDropdownWrapperTestId",a="PreferencesDropdownInputTestId",o="PreferencesDropdownResetTestId",s="PreferencesDropdownInputMissingErrorTestId"},92427:(e,t,r)=>{r.d(t,{Z:()=>W});var n=r(85893),a=r(68827),o=r(67294),s=r(85086),i=r(65715),c=r(68575),l=r(86239),d=r(73369);(0,s.ZP)(i.Z).withConfig({displayName:"DropdownStyled",componentId:"-__sc-9e8697fe-0"})(["padding-top:",";"],c.W0.sm);let m=s.ZP.div.withConfig({displayName:"PreferenceWrapper",componentId:"-__sc-9e8697fe-1"})(["display:grid;"]),p=s.ZP.label.withConfig({displayName:"PreferenceHeader",componentId:"-__sc-9e8697fe-2"})(({theme:e})=>`
2    font-size: ${e.typography.text.fontSM.fontSize};
3    font-weight: ${e.typography.weights.bold};
4    margin: ${c.W0.sm} 0 ${c.W0.sm} 0;
5    `),g=s.ZP.div.withConfig({displayName:"PreferenceInputWrapper",componentId:"-__sc-9e8697fe-3"})(["position:relative;"]),f=(0,s.ZP)(l.UP).withConfig({displayName:"PreferenceInput",componentId:"-__sc-9e8697fe-4"})(["width:100%;padding:"," "," "," ",";"],c.W0.sm,c.W0.xxl,c.W0.sm,c.W0.sm),u=(0,s.ZP)(l.zx).withConfig({displayName:"PreferenceReset",componentId:"-__sc-9e8697fe-5"})(({theme:e})=>`
6    display: flex;
7    justify-content: center;
8    align-items: center;
9    width: ${c.W0.lg};
10    height: ${c.W0.lg};
11    position: absolute;
12    top: 50%;
13    right: ${c.W0.xs};
14    transform: translateY(-50%);
15    cursor: pointer;
16    
17    ${(0,d.E0)()};
18  
19    svg {
20      fill: ${e.colors.uiColors.greyscale4};
21      transition: all 0.3s ease;
22    }
23  
24    &:hover {
25      svg {
26        transform: rotate(90deg);
27        fill: ${e.colors.uiColors.greyscale5};
28      }
29    }
30  `),h=(0,s.ZP)(l.zx).withConfig({displayName:"PreferenceSubmitButton",componentId:"-__sc-9e8697fe-6"})(({theme:e})=>`
31        display: flex;
32        justify-content: center;
33        align-items: center;
34        width: ${c.W0.lg};
35        height: ${c.W0.lg};
36        position: absolute;
37        top: 50%;
38        right: ${c.W0.xs};
39        transform: translateY(-50%);
40        cursor: pointer;
41        font-size: ${e.typography.text.fontSM.fontSize};
42        min-width: ${c.W0.xs};
43       
44        color: inherit;
45        border: none;
46        padding: 0;
47        outline: inherit;
48    
49       
50    
51        ${(0,d.E0)()};
52    
53        svg {
54          margin: 0;
55        }`),b=s.ZP.div.withConfig({displayName:"ErrorMessage",componentId:"-__sc-9e8697fe-7"})(({theme:e})=>`
56  display: inline-flex;
57  color: ${e.colors.uiColors.alert};
58  font-size: ${e.typography.text.fontSM.fontSize};
59  margin-top:${c.W0.xs}
60  `);var y=r(13201),C=r(26323),P=r(3500),S=r(45007);(0,s.ZP)(l.XZ).withConfig({displayName:"DropdownStyled",componentId:"-__sc-7ba1d98d-0"})(["padding-top:",";"],c.W0.sm);let x=s.ZP.div.withConfig({displayName:"PreferenceAutosuggestionsWrapper",componentId:"-__sc-7ba1d98d-1"})(({theme:e})=>`
61    overflow: auto;
62    max-height: 170px;
63
64    border: none;
65    font-family: ${e.typography.text.fontSM.fontFamily};
66    box-shadow: ${d.q.medium};
67
68    svg {
69        fill: ${e.colors.uiColors.greyscale4};
70    }
71`),_=s.ZP.div.withConfig({displayName:"PreferenceAutosuggestion",componentId:"-__sc-7ba1d98d-2"})(({theme:e})=>{let t=e.colors.uiColors.greyscale4;return`
72        display: flex;
73        align-items: center;
74        line-height: ${e.typography.text.fontSM.lineHeight};
75        font-size: ${e.typography.text.fontSM.fontSize};
76        font-weight: ${e.typography.text.fontSM.fontWeight};
77        padding: ${c.W0.xs} ${c.W0.sm};
78        color: ${t};
79        cursor: pointer;
80        border: none;
81        min-height: ${c.W0.lgr};
82        text-align: left;
83   
84        svg {
85            fill: ${t};
86        }
87
88       &:hover {
89            color: ${e.colors.uiColors.greyscale6};
90            background-color: ${e.colors.brandColors.tertiary1};
91        }
92        `}),I=(0,s.ZP)(l.pA).withConfig({displayName:"PreferenceAutosuggestionIcon",componentId:"-__sc-7ba1d98d-3"})(["width:",";height:",";margin-right:",";
92"],c.W0.sm,c.W0.sm,c.W0.vsm),v=e=>{let t=t=>{e.savePreferredStore(t)};return(0,C.Z)(()=>!e.listOfStores||e.listOfStores&&e.listOfStores.length<=0?null:(0,n.jsx)(x,{"data-testid":"PreferenceSuggestionsWrapperTestId",children:e.listOfStores.map((e,r)=>(0,n.jsxs)(_,{tabIndex:0,onKeyDown:r=>{13===r.which&&t(e)},onClick:()=>t(e),"data-testid":`PreferenceSuggestionsAutoSuggestionTestId_${e.retailerStoreId}`,children:[(0,n.jsx)(I,{name:"LocationPin"}),e.name]},r))}),{componentName:"PreferenceStoreField"})};var w=r(83172),k=r(76633),$=r(51845),j=r(71460),N=r(39834),Z=r(33430);let W=(0,S.$j)(e=>({storesList:(0,Z.M)(e),currentPreferredMarketingStore:e.customer.attributes&&e.customer.attributes[j.SQv],marketingStoreIdentifier:(0,w.Q4)(e)}),{})(e=>{let t,r,s,i,c,l,d,S,x,_,I,w,j=(0,a.c)(25),{t:Z}=o.useContext(k.q),[W,M]=o.useState(!1),[E,A]=o.useState("");j[0]===Symbol.for("react.memo_cache_sentinel")?(t=[],j[0]=t):t=j[0];let[D,O]=o.useState(t);j[1]!==e?(r=()=>{try{if(e.currentPreferredMarketingStore){let t=e.storesList.find(t=>t.retailerStoreId===e.currentPreferredMarketingStore[e.marketingStoreIdentifier]);t&&(A(t.name),e.setSelectedMarketingStore({retailerStoreId:t.retailerStoreId,marketingStoreIdentifier:e.marketingStoreIdentifier}))}}catch(e){$.logger.error("PreferenceDropdown - initialiseInputValue() error",e)}},j[1]=e,j[2]=r):r=j[2];let L=r;j[3]!==L?(s=()=>{L()},j[3]=L,j[4]=s):s=j[4],j[5]===Symbol.for("react.memo_cache_sentinel")?(i=[],j[5]=i):i=j[5],o.useEffect(s,i),j[6]===Symbol.for("react.memo_cache_sentinel")?(c=()=>{O([])},j[6]=c):c=j[6],j[7]!==e.selectedMarketingStore?(l=[e.selectedMarketingStore],j[7]=e.selectedMarketingStore,j[8]=l):l=j[8],o.useEffect(c,l),j[9]!==e?(d=t=>{try{let{value:r}=t.target;A(r);let n=e.storesList.filter(e=>e.name.toLowerCase().match(r.toLowerCase()));O(n),M(!0)}catch(e){_()}},S=()=>{try{e.resetErrorMessage(),M(!0),O(e.storesList)}catch(e){_()}},_=()=>{M(!1),A(""),O([]),e.setSelectedMarketingStore({retailerStoreId:"",marketingStoreIdentifier:""})},x=t=>{A(t.name),e.resetErrorMessage(),e.setSelectedMarketingStore({retailerStoreId:t.retailerStoreId,marketingStoreIdentifier:e.marketingStoreIdentifier})},j[9]=e,j[10]=d,j[11]=S,j[12]=x,j[13]=_):(d=j[10],S=j[11],x=j[12],_=j[13]);let z=x;j[14]===Symbol.for("react.memo_cache_sentinel")?(I=()=>{M(!1),O([])},j[14]=I):I=j[14];let H=I;return j[15]!==d||j[16]!==E||j[17]!==W||j[18]!==D||j[19]!==e.hasErrorMessage||j[20]!==z||j[21]!==S||j[22]!==Z||j[23]!==_?(w=(0,C.Z)(()=>(0,n.jsxs)(m,{id:P.cv,"data-testid":P.cv,children:[(0,n.jsx)(p,{htmlFor:"PreferenceInput",children:Z("myPreferencesPage.marketingPreferences.marketingStoreHeader")}),(0,n.jsxs)(N.default,{onOutsideClick:H,children:[(0,n.jsxs)(g,{children:[(0,n.jsx)(f,{hasError:e.hasErrorMessage,handleChange:d,handleFocus:d,autoComplete:"off",placeholder:"",value:E,id:"PreferenceInput",name:"PreferenceInput","data-testid":P.iz}),E?(0,n.jsx)(u,{ariaLabel:Z("common.button.resetSearch"),buttonStyle:"iconTransparent",icon:"Clear",handleClick:_,role:"button","data-testid":P.J9}):(0,n.jsx)(h,{icon:W?"Close":"ChevronDown",iconPosition:"left",ariaLabel:Z("common.button.showDropdown"),buttonStyle:"search",handleClick:W?_:S})]}),!!D.length&&(0,n.jsx)(v,{listOfStores:D,savePreferredStore:z}),e.hasErrorMessage&&(0,n.jsxs)(b,{"aria-atomic":!0,"data-testid":P.Us,role:"alert",children:[(0,n.jsx)(y.a,{name:"Warning"}),Z("myPreferencesPage.marketingPreferences.marketingStoreError")]})]})]}),{componentName:"PreferenceDropdown"}),j[15]=d,j[16]=E,j[17]=W,j[18]=D,j[19]=e.hasErrorMessage,j[20]=z,j[21]=S,j[22]=Z,j[23]=_,j[24]=w):w=j[24],w})},91992:(e,t,r)=>{r.d(t,{G9:()=>i,WT:()=>d,pj:()=>l,uP:()=>c});var n=r(85086),a=r(66085),o=r(73369),s=r(86239);let i="624px",c=n.ZP.div.withConfig({displayName:"Preferences",componentId:"-__sc-8075e4ae-0"})(({theme:e})=>`
93    background-color: ${e.colors.uiColors.greyscale1};
94    box-shadow: ${o.q.large};
95    position: relative;
96    max-width: ${i};
97`),l=n.ZP.div.withConfig({displayName:"PreferencesSpinnerWrapper",componentId:"-__sc-8075e4ae-1"})(({theme:e})=>`
98  position: absolute;
99  top: 0;
100  left: 0;
101  width: 100%;
102  height: 100%;
103  z-index: ${a.CJ};
104  &:before {
105    content: '';
106    position: absolute;
107    top: 0;
108    left: 0;
109    width: 100%;
110    height: 100%;
111    background: ${e.colors.uiColors.greyscale1};
112    opacity: 60%;
113  }
114`),d=(0,n.ZP)(s.$j).withConfig({displayName:"PreferencesSpinner",componentId:"-__sc-8075e4ae-2"})(["position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);"])},8937:(e,t,r)=>{r.d(t,{Z:()=>P});var n=r(85893),a=r(68827),o=r(67294),s=r(85086),i=r(68575),c=r(73369),l=r(86239);let d=s.ZP.section.withConfig({displayName:"Heading",componentId:"-__sc-ebbc3188-0"})(["display:flex;flex-direction:column;align-items:center;padding:"," ",";"],i.W0.lg,i.qJ),m=s.ZP.div.withConfig({displayName:"AvatarContainer",componentId:"-__sc-ebbc3188-1"})(["margin-bottom:",";",";box-shadow:",";overflow:hidden;"],i.W0.sm,(0,c.E0)("50%"),c.q.small),p=s.ZP.div.withConfig({displayName:"Avatar",componentId:"-__sc-ebbc3188-2"})(({theme:e})=>`
115    display: flex;
116    flex-direction: column;
117    align-items: center;
118    width: ${i.W0.xxl};
119    height: ${i.W0.xxl};
120    background: ${e.colors.brandColors.primary1};
121    mask-image: radial-gradient(circle, white 100%, black 100%);
122  `),g=(0,s.ZP)(l.pA).withConfig({displayName:"AvatarIcon",componentId:"-__sc-ebbc3188-3"})(({theme:e})=>`
123    fill: ${e.colors.uiColors.greyscale1};
124    transform: translateY(10px);
125  `),f=s.ZP.h1.withConfig({displayName:"HeadTitle",componentId:"-__sc-ebbc3188-4"})(["margin:0;"]),u=s.ZP.span.withConfig({displayName:"MemberSince",componentId:"-__sc-ebbc3188-5"})(({theme:e})=>`
126    color: ${e.colors.uiColors.greyscale5}; 
127    margin-top: ${i.W0.xs};
128  `);var h=r(45007),b=r(26323),y=r(76633),C=r(22559);let P=(0,h.$j)(e=>({customerDetails:e.customer.details}
128))(e=>{let t,r=(0,a.c)(4),{t:s}=o.useContext(y.q),{createdOn:i,firstName:c}=e.customerDetails;return r[0]!==i||r[1]!==c||r[2]!==s?(t=(0,b.Z)(()=>(0,n.jsxs)(d,{children:[(0,n.jsx)(m,{"data-testid":"AvatarContainer-testId",children:(0,n.jsx)(p,{children:(0,n.jsx)(g,{name:"AccountSolid",size:"56"})})}),(0,n.jsx)(f,{"data-testid":"AvatarHeadTitle-testId",...C.kf,children:s("myAccount.welcome",{name:c})}),(0,n.jsx)(u,{children:s("myAccount.joinDate",{year:new Date(i).getFullYear()})})]}),{componentName:"AccountHeading"}),r[0]=i,r[1]=c,r[2]=s,r[3]=t):t=r[3],t})},42481:(e,t,r)=>{r.r(t),r.d(t,{default:()=>q});var n=r(85893),a=r(68827),o=r(67294),s=r(45007),i=r(85086);let c=i.ZP.div.withConfig({displayName:"Wrapper",componentId:"-__sc-9c861390-0"})(({theme:e})=>`
129    display: flex;
130    flex-direction: column;
131    align-items: center;
132    background: ${e.body.backgroundColor};
133  `);var l=r(60503),d=r(26323),m=r(8937),p=r(91992),g=r(68575),f=r(86239),u=r(73369),h=r(31245);let b=i.ZP.div.withConfig({displayName:"Compartment",componentId:"-__sc-9531417b-0"})(({theme:e})=>`
134    background-color: ${e.colors.uiColors.greyscale1};
135
136    ${(0,h.Z)("md",{noUpper:!0})} {
137      ${(0,u.E0)()}
138    }
139    `),y=i.ZP.div.withConfig({displayName:"CompartmentHeader",componentId:"-__sc-9531417b-1"})(({theme:e})=>`
140    align-items: center;
141    padding: ${g.W0.sm} ${g.W0.sm};
142    border-bottom: 1px solid ${e.colors.uiColors.greyscale2};
143
144     ${(0,h.Z)("md",{noUpper:!0})} {
145      padding: ${g.W0.sm} ${g.W0.lg};
146    }
147    `),C=i.ZP.div.withConfig({displayName:"CompartmentHeaderDetails",componentId:"-__sc-9531417b-2"})(["display:flex;align-items:center;"]),P=(0,i.ZP)(f.pA).withConfig({displayName:"CompartmentHeaderIcon",componentId:"-__sc-9531417b-3"})(({theme:e})=>`
148    fill: ${e.colors.brandColors.primary1};
149    margin-right: ${g.W0.sm};`),S=i.ZP.h3.withConfig({displayName:"CompartmentHeadline",componentId:"-__sc-9531417b-4"})(["margin:0;"]),x=i.ZP.div.withConfig({displayName:"CompartmentBody",componentId:"-__sc-9531417b-5"})(["padding:"," ",";","{padding:"," ",";}"],g.W0.md,g.W0.sm,(0,h.Z)("md",{noUpper:!0}),g.W0.md,g.W0.lg),_=i.ZP.div.withConfig({displayName:"InfoLabel",componentId:"-__sc-9531417b-6"})(({theme:e})=>`
150    font-size: ${e.typography.text.fontSM.fontSize};
151    font-weight: ${e.typography.weights.bold};`),I=i.ZP.div.withConfig({displayName:"Checkboxes",componentId:"-__sc-9531417b-7"})(["display:flex;flex-direction:column;margin-left:",";"],g.W0.sm),v=i.ZP.p.withConfig({displayName:"CompartmentBodyDescription",componentId:"-__sc-9531417b-8"})(({theme:e})=>`
152    padding-top: ${g.W0.sm};
153    font-size: ${e.typography.text.fontSM.fontSize};
154  `),w="preferences-compartment-test-id";var k=r(76633),$=r(67672);let j=e=>{let t,r=(0,a.c)(6),{t:s}=o.useContext(k.q),{attributes:i,compartment:c,description:l,handleChange:m}=e;return!i||i&&0===i.length?null:(r[0]!==i||r[1]!==c||r[2]!==l||r[3]!==m||r[4]!==s?(t=(0,d.Z)(()=>(0,n.jsxs)(o.Fragment,{children:[(0,n.jsx)(_,{children:s(`myPreferencesPage.${c}.subtitle`)}),(0,n.jsx)(I,{children:i.map(e=>(0,n.jsx)($.Z,{compartment:c,attribute:e,handleChange:m},e))}),!!l&&(0,n.jsx)(v,{"data-testid":"CompartmentBodyDescriptionTestId",children:l})]}),{componentName:"PreferencesCompartmentBody"}),r[0]=i,r[1]=c,r[2]=l,r[3]=m,r[4]=s,r[5]=t):t=r[5],t)},N=e=>{let t,r=(0,a.c)(4),{t:s}=o.useContext(k.q);return!e.compartment||e.compartment&&0===e.compartment.length?null:(r[0]!==e.compartment||r[1]!==e.iconName||r[2]!==s?(t=(0,d.Z)(()=>(0,n.jsx)(y,{children:(0,n.jsxs)(C,{children:[(0,n.jsx)(P,{name:e.iconName,size:"16"}),(0,n.jsx)(S,{"data-testid":"PreferencesCompartmentHeaderHeaderLineTestId",children:s(`myPreferencesPage.${e.compartment}.title`)})]})}),{componentName:"PreferencesCompartmentHeader"}),r[0]=e.compartment,r[1]=e.iconName,r[2]=s,r[3]=t):t=r[3],t)},Z=e=>{let{attributes:t,compartment:r,dataTestId:a,description:o,handleChange:s,iconName:i}=e;return!t||t&&0===t.length?null:(0,d.Z)(()=>(0,n.jsxs)(b,{"data-testid":a?`${a}-${w}`:w,children:[(0,n.jsx)(N,{compartment:r,iconName:i}),(0,n.jsx)(x,{children:(0,n.jsx)(j,{attributes:t,compartment:r,description:o,handleChange:s,iconName:i})})]}),{componentName:"PreferencesCompartment"})},W=(0,i.ZP)(f.zx).withConfig({displayName:"ButtonStyled",componentId:"-__sc-1433aa4d-0"})(["margin:",";","{margin:",";width:90%;}"],g.W0.lg,(0,h.Z)("sm",{noUpper:!0}),g.W0.sm),M=e=>{let t,r=(0,a.c)(4),{t:s}=o.useContext(k.q);return r[0]!==e.disabled||r[1]!==e.handleClick||r[2]!==s?(t=(0,d.Z)(()=>(0,n.jsx)(W,{buttonStyle:"primary",disabled:e.disabled,handleClick:e.handleClick,"data-testid":"preferences-save-button-test-id",children:s("myPreferencesPage.save")}),{componentName:"PreferencesSaveButton"}),r[0]=e.disabled,r[1]=e.handleClick,r[2]=s,r[3]=t):t=r[3],t};var E=r(67873),A=r(62999),D=r(71460),O=r(83172),L=r(92427);let z=e=>{let t,r=(0,a.c)(3);if(!e.attributes||e.attributes&&0===e.attributes.length){let e;return r[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,n.jsx)(o.Fragment,{}),r[0]=e):e=r[0],e}return r[1]!==e?(t=(0,d.Z)(()=>(0,n.jsxs)(b,{"data-testid":w,children:[(0,n.jsx)(N,{compartment:e.compartment,iconName:e.iconName}),(0,n.jsxs)(x,{children:[(0,n.jsx)(j,{attributes:e.attributes,compartment:e.compartment,handleChange:e.handleChange,iconName:e.iconName}),e.hasMarketingPreferencesEnabledAndChecked?(0,n.jsx)(L.Z,{selectedMarketingStore:e.selectedMarketingStore,setSelectedMarketingStore:t=>{e.setSelectedMarketingStore(t)},hasErrorMessage:!!e.hasErrorMessage,resetErrorMessage:()=>e.resetErrorMessage()}):null]})]}),{componentName:"MarketingPreferencesCompartment"}),r[1]=e,r[2]=t):t=r[2],t};var H=r(3500);let T={updateCustomerPreferencesAttributes:A.UO,setCustomerSurveysOptOut:A.do}
154,U=(0,s.$j)(e=>({savedCustomerPreferencesAttributes:(0,E.R)(e.customer,e.settings.retailer.maintainCustomerPreferences.sections.marketingPreferences),isSaving:e.customer.isSavingCustomerDetails,forgottenPreferences:e.settings.retailer.checkout.enableInterimModal,maintainCustomerPreferences:e.settings.retailer.maintainCustomerPreferences,hasMarketingPreferencesEnabledAndChecked:(0,O.e0)(e),currentPreferredMarketingStore:e.customer.attributes&&e.customer.attributes[D.SQv],marketingStoreIdentifier:(0,O.Q4)(e),surveysOptOut:e.customer.details.surveysOptIn,SmsEnabled:(0,O.Mc)(e)}),T)(e=>{let{t}=o.useContext(k.q),[r,a]=o.useState(!1),s=null!==e.surveysOptOut,[i,c]=o.useState(e.savedCustomerPreferencesAttributes),l=(e,t)=>{c({...i,[e]:t})},m=()=>{try{let t=i[D.SQv];if(s&&e.setCustomerSurveysOptOut(!i[D.pCU]),e.hasMarketingPreferencesEnabledAndChecked(i)&&(!t||t&&!t[e.marketingStoreIdentifier])){a(!0),(()=>{try{let e=document&&document.getElementById(H.cv);e&&e.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})}catch{return}})();return}}catch{return}let t=i;e.hasMarketingPreferencesEnabledAndChecked(i)||c(t={...i,[D.SQv]:{[e.marketingStoreIdentifier]:""}}),e.updateCustomerPreferencesAttributes(t)},g=t=>c({...i,[D.SQv]:{...e.currentPreferredMarketingStore,[e.marketingStoreIdentifier]:t.retailerStoreId}});return(0,d.Z)(()=>(0,n.jsxs)(p.uP,{"data-testid":"preferences-test-id",children:[e.isSaving&&(0,n.jsx)(p.pj,{children:(0,n.jsx)(p.WT,{})}),(0,n.jsx)(z,{iconName:"ListLarge",compartment:"marketingPreferences",attributes:e.maintainCustomerPreferences.sections.marketingPreferences,handleChange:l,hasErrorMessage:r,resetErrorMessage:()=>a(!1),selectedMarketingStore:i[D.SQv],setSelectedMarketingStore:g,hasMarketingPreferencesEnabledAndChecked:e.hasMarketingPreferencesEnabledAndChecked(i)}),s&&(0,n.jsx)(Z,{iconName:"InstructionsFilled",compartment:"surveyPreferences",attributes:[D.pCU],handleChange:l,dataTestId:"survey-preferences-compartment-test-id"}),(0,n.jsx)(Z,{iconName:"Substitute",compartment:"substitutionPreferences",attributes:[D.Hw_],handleChange:l}),e.forgottenPreferences&&(0,n.jsx)(Z,{iconName:"PromoSolid",compartment:"forgottenAnything",attributes:[D.IWi],handleChange:l}),e.SmsEnabled&&(0,n.jsx)(Z,{attributes:[D.m8y],compartment:"smsPreferences",description:t("myPreferencesPage.smsPreferences.termsAndConditions"),handleChange:l,iconName:"Notifications"}),(0,n.jsx)(M,{disabled:(()=>{try{return e.isSaving||JSON.stringify(i)===JSON.stringify(e.savedCustomerPreferencesAttributes)}catch{return!1}})(),handleClick:m})]}),{componentName:"Preferences"})}),q=(0,s.$j)(e=>({maintainCustomerPreferences:e.settings.retailer.maintainCustomerPreferences}))(e=>{let t,r=(0,a.c)(2);if(!e.maintainCustomerPreferences.enabled){let e;return r[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,n.jsx)(l.default,{}),r[0]=e):e=r[0],e}return r[1]===Symbol.for("react.memo_cache_sentinel")?(t=(0,d.Z)(B,{componentName:"PreferencesPage"}),r[1]=t):t=r[1],t});function B(){return(0,n.jsxs)(c,{"data-testid":"preferences-page-wrapper-testId",children:[(0,n.jsx)(m.Z,{}),(0,n.jsx)(U,{})]})}},41931:(e,t,r)=>{r.d(t,{R:()=>a});var n=r(71460);let a=(e,t,r=!1,a=!1,o=!1)=>{if(r&&a&&o)return!0;if(t===n.pCU)return!!e.details.surveysOptIn;if(t===n.Hw_)return e.details.allowSubstitutions;let s=!1;try{s=e.attributes.find(e=>e.toLowerCase()===t.toLowerCase())}catch{s=e.attributes[t]}return void 0===s?t===n.IWi:t===n.SQv?s:!!s}},67873:(e,t,r)=>{r.d(t,{R:()=>s});var n=r(71460);let a=[n.Hw_,n.IWi,n.pCU,n.SQv,n.m8y,n.zd3];[n.l3O,n.SVt,...a];var o=r(41931);let s=(e,t,r=!1,n=!1)=>{let s={};return a.forEach(t=>{s={...s,[t]:(0,o.R)(e,t)}}),t.forEach(t=>{s={...s,[t]:(0,o.R)(e,t,r,!0,n)}}),s}}}]);

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.