"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9133],{49133:function(e,a,t){t.r(a);var r=t(85893),l=t(67294),s=t(43078),n=t(93967),o=t.n(n),i=t(15830),d=t(83884);a.default=e=>{var a,t,n,c,u,m;let[x,b]=(0,l.useState)(!1),{title:g,description:h,email_input:p,disclaimer:f='By pressing "submit", I understand that I am providing express consent for Trane Residential to contact me about this request or similar topics. I can unsubscribe and opt-out from future communications at any time. See our Privacy Policy for more information.',background_img_large:v,background_img_small:y}=e.attributes.data,{forceMobile:N=!1}=e,[w,j]=(0,l.useState)(!1),C=e=>{j(!!e.target.value)},_="banner-email",k=(0,l.useId)(),E="".concat(_,"-email-").concat(k),S="".concat(_,"-country-").concat(k),I=(0,l.useRef)(!1),M=e=>{I.current||((0,d.p)({event:"dealer_form_start",formId:_,fieldStarted:e}),I.current=!0)};return(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)("div",{className:"z-9 container relative mx-auto flex flex-col justify-between overflow-hidden rounded-lg bg-black px-5 py-10 ".concat(N?"":"md:px-20 lg:flex-row lg:py-28"),children:[(0,r.jsx)("div",{style:{"--bg-sm":"url(".concat((null===(n=e.mediaData)||void 0===n?void 0:null===(t=n[1])||void 0===t?void 0:null===(a=t.node)||void 0===a?void 0:a.sourceUrl)||"",")"),"--bg-lg":"url(".concat((null===(m=e.mediaData)||void 0===m?void 0:null===(u=m[0])||void 0===u?void 0:null===(c=u.node)||void 0===c?void 0:c.sourceUrl)||"",")")},className:"absolute inset-0 bg-[image:var(--bg-sm)] bg-cover bg-center opacity-60 md:bg-[image:var(--bg-lg)]","aria-hidden":"true"}),(0,r.jsxs)("div",{className:"z-10 grid ".concat(N?"":"lg:grid-cols-2"),children:[(0,r.jsxs)("div",{className:"mb-6 ".concat(N?"":"lg:mb-0 lg:mr-20"),children:[(0,r.jsx)("h2",{className:"mb-4 mt-0 p-0 text-28 font-bold text-white",children:g}),(0,r.jsx)("span",{className:"block text-16 text-white",children:h})]}),(0,r.jsx)("div",{className:o()({"lg:ml-8 lg:flex lg:items-center":!N}),children:"1"===p&&(0,r.jsx)("div",{children:(0,r.jsxs)("div",{className:"w-full text-center lg:mb-0",children:[!x&&(0,r.jsxs)(s.l0,{className:o()("flex flex-wrap justify-center",{"lg:ml-8 lg:w-90% lg:justify-end":!N}),id:_,brand:"Trane",kind:"MARKETO",source:"TRANE:BANNER_WITH_EMAIL_CAPABILITY",onSubmit:()=>{(0,d.p)({event:"dealer_form_success",formId:_}),b(!0)},name:"CUSTOMER EMAIL",children:[(0,r.jsx)(s.U5,{id:E,placeholder:"Enter your email",autoComplete:"email",label:"Email",name:"email",onChange:e=>{C(e),M("email")},required:!0,loadingNode:(0,r.jsx)("span",{className:"font-14 absolute inset-1/4 z-2 h-56 bg-error-red py-4 text-white",children:"Sending..."}),errorMessages:{external:"Please enter a valid email",none:null,required:"Please enter a valid email",regex:"Please enter an email with a @ and a domain name"},wrapperClassName:"w-full",errorMessageClassName:"text-error-red text-14 font-bold text-left my-2",errorClassName:"order-4 w-full text-error-red my-0",inputClassName:"py-4 order-2 rounded w-full border-light-silver ".concat(""),inputOnErrorClassName:"",labelClassName:"sr-only order-1"}),(0,r.jsxs)("div",{className:"relative flex basis-full gap-4 pt-4",children:[(0,r.jsxs)(s.Ph,{id:S,label:"Country",name:"country",errorMessages:{external:"Please select a country",none:null,required:"Please select a country",regex:"Please select a country"},labelClassName:"sr-only",wrapperClassName:"flex-1 flex flex-col",inputClassName:"rounded border border-light-silver text-black flex-1 px-2",inputOnErrorClassName:"rounded border border-trane-red text-black flex-1 px-2",errorClassName:"order-4 w-full text-error-red my-0 absolute bottom-[-2.75rem]",errorMessageClassName:"text-error-red text-14 font-bold text-left",required:!0,children:[(0,r.jsx)("option",{value:"US",defaultChecked:!0,children:"United States"}),(0,r.jsx)("option",{value:"CA",children:"Canada"}),(0,r.jsx)("option",{value:"OO",children:"Other"})]}),(0,r.jsx)(s.Mm,{disabled:!w,"data-position":"body","data-location":"banner","data-action":"submit","data-text-grouping":"cta","data-text":"send","data-type":"button",className:o()("text-16 leading-1.7 text-white","rounded","order-3 bg-trane-red","disabled:cursor-not-allowed disabled:bg-trane-red/50","px-6 py-3"),children:"Send"})]}),(0,r.jsx)(s.Q2,{children:(0,r.jsx)("p",{className:o()("mt-9","order-5","text-left text-10 leading-1.2 text-ceiling-bright-white"),dangerouslySetInnerHTML:{__html:(0,i.F)(f)}})})]}),x&&(0,r.jsx)("div",{className:"text-22 text-white",children:"Thank you! Your email has been successfully\xa0submitted."})]})})})]})]})})}}}]);