"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[76882],{19378:(e,t,o)=>{o.d(t,{i:()=>n});function n(e){let t={},o=!1;if(e.search("@")>0){let n=e.split("@")[1].split(".");if(n.length>0)for(let e of n)if(t[e]){o=!0;break}else t[e]=!0}return o}},26628:(e,t,o)=>{o.d(t,{_:()=>n});var n=function(e){return e[e.ARROW_DOWN=40]="ARROW_DOWN",e[e.ARROW_LEFT=37]="ARROW_LEFT",e[e.ARROW_RIGHT=39]="ARROW_RIGHT",e[e.ARROW_UP=38]="ARROW_UP",e[e.BACKSPACE=8]="BACKSPACE",e[e.END=35]="END",e[e.ENTER=13]="ENTER",e[e.ESCAPE=27]="ESCAPE",e[e.HOME=36]="HOME",e[e.PAGE_DOWN=34]="PAGE_DOWN",e[e.PAGE_UP=33]="PAGE_UP",e[e.SPACE=32]="SPACE",e[e.HYPHEN=189]="HYPHEN",e[e.HYPHEN_FIREFOX=173]="HYPHEN_FIREFOX",e}({})},43437:(e,t,o)=>{o.d(t,{A:()=>R});var n=o(41364),a=o(12115),r=o(15586),i=o(25289),l=o(40539),c=o(64385),s=o(68536),E=o(56242),p=o(64006),u=o(44787);let d={INPUT_BOTTOM_PADDING:16,INPUT_HEIGHT:70,LABEL_SCALE_TRANSFORM:.8,LABEL_WIDTH_TRANSFORM:1.25,TEXT_AREA_HEIGHT:200},_={container:{"&:hover":{backgroundColor:l.l.LIGHT.GRAY_20},alignItems:"flex-end",backgroundColor:l.l.LIGHT.GRAY_10,border:r.s.SOLID_TRANSPARENT_2PX,borderRadius:c.Z.RADIUS_15,color:l.l.LIGHT.GRAY_70,display:"flex",fontSize:"1.6rem",height:d.INPUT_HEIGHT,position:"relative",transition:"background-color ".concat(E.E.MS100,"ms ease, border-color ").concat(E.E.MS100,"ms ease")},disabled:{"&:hover":{backgroundColor:l.l.LIGHT.GRAY_10},color:l.l.LIGHT.GRAY_20},hasPrefix:{padding:"".concat(s.E.SIZE_30,"px ").concat(s.E.SIZE_20,"px ").concat(d.INPUT_BOTTOM_PADDING,"px 0px")},helpText:[u.Il.smallCopyTight,{bottom:0,color:l.l.LIGHT.GRAY_70,left:s.E.SIZE_20,paddingTop:s.E.SIZE_05,position:"absolute",transform:"translate3D(0, 100%, 0)"}],input:[p.Yv,{"&::placeholder":{color:l.l.LIGHT.GRAY_70,opacity:0,transition:"opacity ".concat(E.E.MS100,"ms ease")},":focus::placeholder":{opacity:1,transition:"opacity ".concat(E.E.MS100,"ms ease")},backgroundColor:"transparent",border:0,color:l.l.GLOBAL.BLACK,height:"100%",overflow:"hidden",padding:"".concat(s.E.SIZE_30,"px ").concat(s.E.SIZE_20,"px ").concat(d.INPUT_BOTTOM_PADDING,"px"),textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%"}],inputContainer:{display:"flex",width:"100%"},inputDisabled:{color:l.l.GLOBAL.GRAY_60,opacity:.7},label:{left:s.E.SIZE_20,marginRight:s.E.SIZE_20,maxWidth:"calc(100% - (".concat(s.E.SIZE_20,"px + ").concat(s.E.SIZE_20,"px))"),overflow:"hidden",position:"absolute",textOverflow:"ellipsis",top:"50%",transform:"translateY(-50%)",transformOrigin:0,transition:"color ".concat(E.E.MS100,"ms ease, transform ").concat(E.E.MS100,"ms ease"),whiteSpace:"nowrap"},labelDisabled:{color:l.l.GLOBAL.BLACK,opacity:.4},prefix:{color:l.l.GLOBAL.BLACK,height:"100%",padding:"".concat(s.E.SIZE_30,"px 0px ").concat(d.INPUT_BOTTOM_PADDING,"px ").concat(s.E.SIZE_20,"px"),paddingTop:s.E.SIZE_30,whiteSpace:"nowrap"}},I={container:{height:d.TEXT_AREA_HEIGHT},input:{height:"calc(100% - ".concat(s.E.SIZE_30,"px - ").concat(d.INPUT_BOTTOM_PADDING,"px)"),margin:"".concat(s.E.SIZE_30,"px ").concat(s.E.SIZE_20,"px ").concat(d.INPUT_BOTTOM_PADDING,"px"),overflowY:"auto",padding:"0",resize:"none",whiteSpace:"pre-wrap",width:"calc(100% - ".concat(2*s.E.SIZE_20,"px)"),[i.MQ.M]:{padding:0}},label:{marginRight:0,paddingTop:s.E.SIZE_15,top:"17.5%"}},T={container:{borderColor:l.l.GLOBAL.ORANGE,":hover":{backgroundColor:l.l.LIGHT.GRAY_10}},input:{"&::placeholder":{opacity:.5}},label:{display:"block",pointerEvents:"none",textOverflow:"ellipsis",transform:"scale3d(".concat(d.LABEL_SCALE_TRANSFORM,", ").concat(d.LABEL_SCALE_TRANSFORM,", ").concat(d.LABEL_SCALE_TRANSFORM,") translateY(-125%)"),whiteSpace:"nowrap",width:"calc((100% * ".concat(d.LABEL_WIDTH_TRANSFORM,") - ").concat(d.INPUT_HEIGHT,"px)")}},S={container:{backgroundColor:l.l.LIGHT.RED_05,borderColor:l.l.GLOBAL.RED},errorMessage:[u.Il.labelCopyTight,{color:l.l.GLOBAL.RED,display:"inherit",paddingTop:s.E.SIZE_01,[i.MQ.S]:{marginLeft:s.E.SIZE_20,marginTop:s.E.SIZE_05,position:"relative",transform:"none"},[i.MQ.XL]:{position:"relative",transform:"none"}}],withHelpText:{bottom:-15}},R=function(e){let{customContainerStyles:t,customErrorStyle:o,contextualLabel:r,disabled:i,error:l={hasError:!1},helpText:c,id:s,isTextArea:E,label:p,onBlur:u,onChange:d,onFocus:R,onKeyDown:h,readonly:A,required:f,type:m,validationFn:g,value:L,hasError:b,prefix:O,ref:C,...H}=e,{hasError:G,errorMessage:N}=l,M=(0,a.useId)(),[D,P]=(0,a.useState)(!1),[x,B]=(0,a.useState)(!1);(0,a.useEffect)(()=>{L||B(!1)},[L]),(0,a.useEffect)(()=>{L&&L.length>0&&!D&&!x&&B(!0)},[L,D,x]);let w={"aria-required":f,disabled:i||A,id:"".concat(M,"-input"),onBlur:function(){P(!1),u&&u(),L?(B(!0),g&&g(L)):B(!1)},onChange:function(e){let{value:t}=e.target;d(t),g&&x&&t.length>0&&g(t)},onFocus:function(){P(!0),R&&R()},onKeyDown:h,placeholder:r,required:f,value:L},Y=G&&x||b&&void 0!==N,v=c&&c.length>0;return(0,n.FD)("div",{"data-component":"Input",children:[(0,n.FD)("span",{css:[_.container,D&&T.container,i&&!A&&_.disabled,E&&I.container,Y&&!i&&S.container,t],children:[(0,n.Y)("label",{htmlFor:"".concat(M,"-input"),css:[_.label,E&&I.label,i&&_.labelDisabled,(D||!!L||!!O)&&T.label],children:p}),E?(0,n.Y)("textarea",{css:[_.input,E&&I.input,D&&T.input],ref:C,...w,...H}):(0,n.FD)("span",{css:_.inputContainer,children:[O&&(0,n.Y)("span",{css:_.prefix,children:O}),(0,n.Y)("input",{css:[_.input,D&&T.input,i&&_.inputDisabled,!!O&&_.hasPrefix],ref:C,type:m,...w,...H})]}),v&&(0,n.Y)("span",{role:"definition",css:[_.helpText],children:c})]}),Y&&N&&(0,n.Y)("span",{role:"alert",css:[S.errorMessage,v&&S.withHelpText,o],children:N})]})}},76882:(e,t,o)=>{o.d(t,{A:()=>G});var n=o(41364),a=o(12115),r=o(33400),i=o(82462),l=o(43437),c=o(43093),s=o(31466),E=o(89878),p=o(73423),u=o(47684);async function d(e,t){return await (0,u.q$)({endpoint:"/subscribe-newsletter",jsonBody:e,method:"post",query:t})}var _=function(e){return e.EMAIL="email",e.NUMBER="number",e.PASSWORD="password",e.SEARCH="search",e.TEL="tel",e.TEXT="text",e.URL="url",e}({}),I=o(26628),T=o(16838),S=o(17601),R=o(85501),h=o(19378),A=o(54606),f=o(68852),m=o(25289),g=o(40539),L=o(68536),b=o(44787);let O={SUBMIT_ICON_HEIGHT:12,SUBMIT_ICON_WIDTH:15,EMAIL_INPUT_HEIGHT:60},C={emailInput:{paddingRight:L.E.SIZE_40,[m.MQ.M]:{paddingRight:L.E.SIZE_40}},heading:[b.Il.secondaryHeadline,{marginBottom:L.E.SIZE_10}],inputContainer:{position:"relative"},inputHeight:{height:O.EMAIL_INPUT_HEIGHT},submitButton:{padding:L.E.SIZE_05,position:"absolute",right:L.E.SIZE_15,svg:{height:O.SUBMIT_ICON_HEIGHT,width:O.SUBMIT_ICON_WIDTH},top:L.E.SIZE_25},text:[b.Il.bodyCopy,{color:g.l.LIGHT.GRAY_70,marginBottom:L.E.SIZE_20}],toast:{[m.MQ.L]:{marginTop:L.E.SIZE_20}}},H={[E.p.SUCCESS]:(0,n.Y)(c.A,{children:(0,f.ui)("footer.mailingList.success")}),[E.p.ERROR]:(0,n.Y)(c.A,{children:(0,f.ui)("footer.mailingList.error")})},G=function(e){let{description:t,emailSource:o,heading:c}=e,u=(0,p.J)(e=>e.userType),[m,g]=(0,a.useState)(!1),[L,b]=(0,a.useState)(""),{toastMessage:O,setToastMessage:G,handleClearMessage:N,isOpen:M,handleDismiss:D}=function(){let[e,t]=(0,a.useState)(""),[o,n]=(0,a.useState)(!1),r=(0,a.useRef)(e),i=(0,a.useCallback)(()=>{t("")},[]),l=(0,a.useCallback)(()=>{n(!1)},[]);return(0,a.useEffect)(()=>{!r.current&&e&&n(!0),r.current=e},[e,o]),{handleClearMessage:i,handleDismiss:l,isOpen:o,setToastMessage:t,toastMessage:e}}(),P=(0,a.useRef)(null),x=(0,a.useCallback)(async()=>{var e;if(!(await d({email:L,source:o||"footer",sourceURL:window.location.href},{accountType:u})).isSuccess){(0,T.uj)(S.B.FORM_ERROR,{accountType:u,email:L,error:E.p.ERROR,form_name:"email capture form",form_type:"SubscribeToNewsletter",source:o||"footer",sourceURL:window.location.href}),G(E.p.ERROR);return}let t=(0,R.oY)();(0,T.uj)(S.B.FORM_SUBMITTED,{form_details:{email:L,source:o||"footer",sourceURL:window.location.href,accountType:u},form_name:"email capture form",form_type:"SubscribeToNewsletter"}),(0,T.uj)(S.B.USER_MAILLIST,{user_id:t||"",user_email:L}),G(E.p.SUCCESS),b(""),g(!1),null===(e=P.current)||void 0===e||e.blur()},[L,o,u,G]),B=(0,a.useCallback)(e=>{g(A.Rp.test(e)&&!(0,h.i)(e))},[]),w=(0,a.useCallback)(e=>{b(e),B(e)},[B]),Y=(0,a.useCallback)(e=>{if(e.keyCode===I._.ENTER){var t,o;null===(t=P.current)||void 0===t||t.blur(),null===(o=P.current)||void 0===o||o.focus(),m&&x()}},[m,x]);return(0,n.FD)("div",{"data-component":"FooterMailingList",children:[(0,n.Y)("p",{css:C.heading,children:c||(0,f.ui)("footer.mailingList.heading")}),(0,n.Y)("p",{css:C.text,children:t||(0,f.ui)("footer.mailingList.description")}),(0,n.FD)("div",{css:C.inputContainer,children:[(0,n.Y)(l.A,{customContainerStyles:C.inputHeight,css:C.emailInput,error:{hasError:!m,errorMessage:(0,f.ui)("common.form.emailError")},label:(0,f.ui)("common.form.email"),onChange:w,onKeyDown:Y,ref:P,type:_.EMAIL,validationFn:B,value:L,id:"footer_mailing_list","data-element":"Input"}),m&&(0,n.Y)("button",{"aria-label":(0,f.ui)("common.form.submit"),css:C.submitButton,onClick:x,children:(0,n.Y)(r.default,{name:i.Ze.ARROW_RIGHT})})]}),(0,n.Y)(s.A,{customContainerStyles:C.toast,isOpen:M,onDismiss:D,handleClearMessage:N,"data-element":"Toast",children:H[O]})]})}},89878:(e,t,o)=>{o.d(t,{p:()=>n});var n=function(e){return e.ERROR="error",e.SUCCESS="success",e}({})}}]);