1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[710],{10710:(e,s,r)=>{"use strict";r.r(s),r.d(s,{EmailSubscriptions:()=>p,default:()=>v});var l=r(6029),c=r(55729),n=r(64761),t=r(95669),i=r.n(t),a=r(494),d=r(87467),u=r(38714),o=r(46217),h=r(89525),m=r(82087),x=r(48168),b=r(48251),_=r(16705),j=r(41109);let p=()=>{let[e,s]=(0,c.useState)(""),{user:r,userId:t}=(0,d.N4)(e=>({user:(0,j.ds)(e),userId:(0,j.Sj)(e)||""}),a.bN),p=(0,c.useCallback)(()=>{s("")},[]),v=(0,c.useMemo)(()=>{let{subscriptions:e=u.g}=r||{},{newsletters:s,reminders:l,product:c,research:n}=e||{};return{newsletters:!s||s.isSubscribed,reminders:!l||l.isSubscribed,product:!c||c.isSubscribed,research:!n||n.isSubscribed}},[r]),w=(0,c.useCallback)(async(e,l)=>{s("");try{(0,o.v)(t,"User ID is undefined"),(0,o.v)(r,"User is undefined");let[s]=Object.keys(r.subscriptions||{}).filter(s=>{var l;return(null==(l=r.subscriptions)?void 0:l[s].isSubscribed)!==e[s]}),l=(0,u.X)(e[s],s,r);await (0,b.updateUser)(t,{subscriptions:l})}catch(e){s(e.message),console.error(e)}finally{l.setSubmitting(!1)}},[s,t,r]),{t:N}=(0,_.GL)(),{t:g}=(0,_.F4)();return(0,l.jsxs)(h.eQ,{children:[(0,l.jsx)(i(),{children:(0,l.jsx)("title",{children:N("EmailPref")})}),(0,l.jsx)(h.H1,{children:N("SubscribeTo")}),(0,l.jsx)(h.Hr,{}),e&&(0,l.jsxs)(x.W_,{children:[(0,l.jsx)("strong",{children:g("UhOh")})," ",e]}),(0,l.jsx)(n.l1,{initialValues:v,onSubmit:w,children:e=>(0,l.jsxs)(n.lV,{onChange:p,children:[(0,l.jsxs)(h.Nz,{children:[(0,l.jsx)(m.l,{name:"newsletters",submitOnClick:!0}),(0,l.jsxs)(h.$X,{htmlFor:"checkbox-newsletters",children:[N("Newsletters"),(0,l.jsx)("span",{children:N("NewslettersDesc")})]})]}),(0,l.jsxs)(h.Nz,{children:[(0,l.jsx)(m.l,{name:"reminders",submitOnClick:!0}),(0,l.jsxs)(h.$X,{htmlFor:"checkbox-reminders",children:[N("ReminderEmails"),(0,l.jsx)("span",{children:N("ReminderEmailsDesc")})]})]}),(0,l.jsxs)(h.Nz,{children:[(0,l.jsx)(m.l,{name:"product",submitOnClick:!0}),(0,l.jsxs)(h.$X,{htmlFor:"checkbox-product",children:[N("ProductEmails"),(0,l.jsx)("span",{children:N("ProductEmailsDesc")})]})]}),(0,l.jsxs)(h.Nz,{children:[(0,l.jsx)(m.l,{name:"research",submitOnClick:!0}),(0,l.jsxs)(h.$X,{htmlFor:"checkbox-research",children:[N("ResearchEmails"),(0,l.jsx)("span",{children:N("ResearchEmailsDesc")})]})]})]})})]})},v=p},40263:e=>{e.exports={switchButton:"Toggle_switchButton__3arvZ",miniSwitch:"Toggle_miniSwitch__3fISj",switchSpan:"Toggle_switchSpan__Nrmvo"}},45836:e=>{e.exports={base:"Alert_base__r5lgT",warning:"Alert_warning__ZhqRx",info:"Alert_info__61ylO",danger:"Alert_danger__7Zt7O",success:"Alert_success__fM8Fp"}},48168:(e,s,r)=>{"use strict";r.d(s,{C9:()=>a,W_:()=>d,Z0:()=>u,hZ:()=>o});var l=r(87011),c=r(92424),n=r(6029);r(55729);var t=r(45836),i=r.n(t);let a=e=>{let{className:s=""}=e,r=(0,c._)(e,["className"]);return(0,n.jsx)("div",(0,l._)({className:"".concat(i().success," ").concat(s)},r))},d=e=>{let{className:s=""}=e,r=(0,c._)(e,["className"]);return(0,n.jsx)("div",(0,l._)({className:"".concat(i().danger," ").concat(s)},r))},u=e=>{let{role:s="alert",className:r=""}=e,t=(0,c._)(e,["role","className"]);return(0,n.jsx)("div",(0,l._)({role:s,className:"".concat(i().info," ").concat(r)},t))},o=e=>{let{className:s=""}=e,r=(0,c._)(e,["className"]);return(0,n.jsx)("div",(0,l._)({className:"".concat(i().warning," ").concat(s)},r))}},82087:(e,s,r)=>{"use strict";r.d(s,{l:()=>u});var l=r(6029),c=r(55729),n=r(75828),t=r.n(n),i=r(89525),a=r(40263),d=r.n(a);let u=e=>{let{id:s,name:r,isDisabled:n,submitOnClick:a=!1,isMini:u=!1,disabledMessage:o="This option is disabled",onChange:h}=e;return(0,l.jsx)("div",{children:(0,l.jsx)(i.D0,{name:r,children:e=>{let{field:r,form:{setFieldValue:i,setFieldTouched:m,submitForm:x}}=e,b=(0,c.useCallback)(()=>{n||(i(r.name,!r.value,!1),m(r.name),a&&x(),null==h||h(r.name))},[r.value,r.name,i,m,x,h,n]);return(0,l.jsx)("button",{className:t()({[d().switchButton]:!0,[d().miniSwitch]:u}),id:s,onClick:b,disabled:n,title:n?o:void 0,value:r.value,type:"button",role:"switch","aria-checked":r.value,children:(0,l.jsx)("span",{className:d().switchSpan,style:{transform:"translateX(".concat(r.value?u?"16px":"20px":"0",")")}})})}})})}}}]);
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.