1"use strict";(self.__LOADABLE_LOADED_CHUNKS__=self.__LOADABLE_LOADED_CHUNKS__||[]).push([[20319],{13273:function(e,t,n){n.d(t,{XR:function(){return s},e3:function(){return r},vA:function(){return i}});var a=n(75142);let r=`${a.Dy}RequestCallback/assets/request_call_back.png`,s=`${a.Dy}RequestCallback/assets/loan_call_back_img_v3.svg`,i={[a.H2.SPINNY]:`${a.Dy}RequestCallback/assets/loan_call_back_imgV2.svg`}},28631:function(e,t,n){n.d(t,{Z:function(){return b}});var a=n(67294),r=n(45007),s=n(17861),i=n(14793),l=n(98746),o=n(28700),c=n(13325),d=n(48629),u=n(70933),m=n(75142),h=n(60824),g=n(98899),_=n(76228),p=n(92480),C=n(13273),x=n(77462),v="styles__requestCallBackWrap",f=n(85893),b=({name:e="",heading:t="",isSell:n=!1,addMarginBottom:b=!1,showName:y=!1,isLoan:k=!1,thankUMsg:j="",disableNumberEdit:L=!1,verifyOtpForUser:w=!1,ctaName:E="",...T})=>{let{callBackForm:D,base:R,login:N}=(0,r.v9)(e=>({callBackForm:e.listing.callBackForm,base:e.base,login:e.login})),{intent:S}=T,B=(0,r.I0)(),F=new h.W(B),[I,P]=(0,a.useState)(R.userInfo?R.userInfo.contact_number:""),[A,q]=(0,a.useState)(!1),[Z,W]=(0,a.useState)(!1),[O,V]=(0,a.useState)(!1),[H,G]=(0,a.useState)(!1),[$,Y]=(0,a.useState)(R.userInfo&&R.userInfo.full_name?R.userInfo.full_name:""),[U,M]=(0,a.useState)(!1),[z,X]=(0,a.useState)(!1),[K,Q]=(0,a.useState)(!1),[J,ee]=(0,a.useState)(!1),te=(0,a.useRef)(null),ne=new _.L(B),ae=(0,s.TH)(),re=n||ae.pathname.includes("sell")||ae.pathname.includes("evaluation")||ae.search.includes("sell");(0,a.useEffect)(()=>{!D.isLoading&&D.submitted_successfully&&A&&V(!0),D.isLoading?te.current&&te.current.classList.add(x.Z.showLoader):te.current&&te.current.classList.remove(x.Z.showLoader)},[D.isLoading,D.submitted_successfully]),(0,a.useEffect)(()=>{w&&(N.loginData.err_msg?new p.u(B).openToast({text:N.loginData.err_msg,timeout:4e3,hideClose:!0}):N.loginData.isBlacklisted&&new p.u(B).openToast({text:`This mobile number is blacklisted. For any help, call us at ${m.SG}.`,timeout:4e3,hideClose:!0}))},[N.loginData.err_msg,N.loginData.isBlacklisted]);let se=(e=!1)=>{ee(!0),(0,l.pushMarketingEvent)("request_callback"),(0,i.a8)("user/status","POST",{contact_number:I},!1,!1,{},null,!0).then(e=>e).then(e=>e.json()).then(t=>{let a={event:"returning"===t.user_status?"returningNumberSubmit":"newNumberSubmit",entryPoint:S,returningUser:"returning"===t.user_status};if("returning"===t.user_status&&(0,l.pushIntoDataLayer)(a),"new"===t.user_status&&(0,l.pushIntoDataLayer)(a),"blacklisted"===t.user_status)G(!0);else if(n){te.current&&!e&&te.current.classList.add(x.Z.showLoader);let t={name:R.userInfo&&R.userInfo.full_name?R.userInfo.full_name:"",contact_number:I,preferred_datetime:new Date};(0,l.pushIntoDataLayer)({event:"requestCallBack",...t}),(0,i.a8)("c/accounts/schedule_call/sell_lead/","POST",t).then(e=>e).then(e=>e.json()).then(()=>{!e&&(V(!0),ee(!1),Q(!1),te.current&&te.current.classList.remove(x.Z.showLoader))}).catch(e=>{(0,l.handleExceptionError)(`${(e||"").toString()}`,"c/accounts/schedule_call/sell_lead/","api_error")})}else e||q(!0),F.submitCallBack({intent:S||R.currentLocation&&R.currentLocation.key,status:"new",city:{name:R.currentLocation?R.currentLocation.key:"delhi-ncr",display_name:R.currentLocation?R.currentLocation.title:"Delhi NCR"},noEvent:k,contact_details:{name:y?$:R.userInfo&&R.userInfo.full_name?R.userInfo.full_name:"",contact_number:I}})}).catch(e=>{(0,l.handleExceptionError)(`${(e||"").toString()}`,"user/status","api_error")})},ie=e=>{k&&(0,l.sendGAEvent)("loan-page","input",`${e}-input`)};return(0,f.jsxs)(f.Fragment,{children:[O&&(0,f.jsxs)("div",{className:(0,o.Y1)(x.Z.mainBox,v,!b&&x.Z.noMarginBottom,x.Z.noShadow),children:[(0,f.jsxs)("i",{className:"styles__checkIconWrap",children:[(0,f.jsx)(d.Z,{fill:"#00E2AE",opacity:"0.5",width:"40px",height:"40px"}),(0,f.jsx)(c.Z,{width:"21px",height:"21px"})]}),(0,f.jsx)("p",{className:(0,o.Y1)("styles__thankYouText",w&&"styles__changeColor"),children:j||(w?`Thanks, our executive will contact you shortly on ${I}`:`Our ${m.jT} executive will get in touch with you shortly`)}),!w&&(0,f.jsxs)("p",{className:"styles__editWrap",children:[I,!(w&&R.isUserLoggedIn)&&(0,f.jsx)("span",{onClick:()=>{k&&(0,l.sendGAEvent)("loan-page","button-click","lead-edit"),ee(!1),V(!1)},role:"none",children:"EDIT"})]})]}),!O&&(0,f.jsxs)("div",{className:(0,o.Y1)(x.Z.mainBox,v,!b&&x.Z.noMarginBottom,x.Z.noShadow),children:[(0,f.jsx)(g.Z,{imgClass:"styles__background",src:`${m.Dy}RequestCallback/assets/backgroundWireframe.svg`,alt:"background_Lines"}),(0,f.jsx)(g.Z,{imgClass:(0,o.Y1)("styles__bulbIcon","styles__desktop"),fallbackSrc:"",fallbackImgClass:"styles__fallbackImgClass",src:`${C.vA[m.jT]}`,alt:"",height:128}),(0,f.jsx)("h2",{className:"styles__subHeading",children:t||(n?"Let us help you sell your car":"Let us help you select the right car")}
1),y&&!R.isUserLoggedIn&&(0,f.jsx)("div",{className:"styles__inputContainer",children:(0,f.jsx)(u.Z,{onSuccess:e=>{Y(e),X(!0),M(!1)},onUnSuccess:()=>{Y(""),X(!1)},inputValue:$,type:"name",name:e||"",maxLength:40,labelValue:"Enter your Full name",labelFocusValue:k?"Full Name":"Name",errorMessage:"Enter a valid name",showForceError:U,isFocus:!1,onBlur:()=>ie("name")})}),!(R.isUserLoggedIn&&w)&&(0,f.jsx)(u.Z,{onSuccess:e=>{P(e),W(!0),G(!1),I!==e&&10===e.length&&w&&(R.isUserLoggedIn||K?R.isUserLoggedIn&&(ee(!0),setTimeout(()=>{Q(!1),ee(!1)},1e3)):(ee(!0),Q(!0),setTimeout(()=>{ee(!1)},1e3)))},onUnSuccess:()=>{P(""),W(!1)},inputValue:I,type:"tel",name:e||"",maxLength:10,labelValue:"Enter Your Mobile Number",labelFocusValue:k?"Phone Number":"Mobile Number",errorMessage:"Invalid number",showForceError:H,isFocus:!1,onBlur:()=>ie("phone"),disabled:L}),(0,f.jsx)("button",{ref:te,onClick:()=>{if(!y||z)if(Z||w&&R.isUserLoggedIn){if(k&&((0,l.pushIntoDataLayer)({event:"dataLayerGenericEvent",category:"loan-page",action:"button-click",label:"loan-callback-request"}),(0,l.pushIntoGA4)({eventName:"used_car_loan_need_help_financing_click",eventCategory:"cta_click",componentTitle:""},"genericGA4TdEvent")),Z&&!L&&!R.isUserLoggedIn&&w){let e={mobileNumber:I,title:"Login to get callback",postLoginHandler:se,skipNameEmailForNewUser:!0,category:"callback"};if(k&&(e={...e,name:$}),K)return ne.updateLoginData(e),ne.getUserStatus(I),void se(!0)}se()}else G(!0);else M(!0)},className:(0,o.Y1)(x.Z.btn,x.Z.darkPurple,"styles__callBackBtn",(J||N.isOTPGenerating)&&x.Z.showLoader),"data-category":"cta-btn","data-label":S,type:"button",children:K&&w?"GET OTP":E||"REQUEST A CALL BACK"}),(K||!R.isUserLoggedIn)&&(0,f.jsxs)("p",{className:"styles__terms",children:["By logging in, I agree to ",m.jT,"'s"," ",(0,f.jsx)("a",{href:"/terms-and-conditions/"+(re?"pure-ride/":""),target:"_blank",onClick:()=>(0,l.sendGAEvent)("login","button-click","tnc","login"),rel:"noreferrer",children:"terms"})," ","and  ",(0,f.jsx)("a",{href:"/privacy-policy/"+(re?"pure-ride/":""),target:"_blank",onClick:()=>(0,l.sendGAEvent)("login","button-click","privacy-policy","login"),rel:"noreferrer",children:"privacy policy"})]})]})]})}},32609:function(e,t,n){n.d(t,{Ay:function(){return l},FO:function(){return o},br:function(){return s}});var a=n(14793),r=n(29784);let s=(e,t,n)=>(0,a.OT)(`listing/${e}/related/v5?count=${n??(t?30:5)}`,"GET",{},!1,!1,{},null,!0).then(e=>e).then(e=>e.json()).then(e=>e?.results?.reduce((e,t)=>(e.push(t),e),[])),i="similarCarsCache",l=()=>(0,r.G)(i)||{},o=e=>(0,r.t_)(i,e)},60551:function(e,t,n){var a=n(67294),r=n(64618),s=n(96503),i=n(98746),l=n(43237),o=n(32609),c=n(81221),d=n(45952),u=n(76908),m=n(14793),h=n(73957),g=n(38168),_=n(78845),p=n(85893);let C=({text:e,size:t,wrapperProps:n={}})=>(0,p.jsxs)(r.xu,{display:"flex",alignItems:"center",justifyContent:"space-between",...n,children:[(0,p.jsx)(r.xu,{flex:"1",height:"1px",marginRight:"spacing.6",background:"linear-gradient(270deg, #acacac66, #e8e8e800)"}),(0,p.jsx)(r.X6,{as:"h2",size:t,weight:"semibold",color:"surface.text.gray.normal",textAlign:"center",children:e}),(0,p.jsx)(r.xu,{flex:"1",height:"1px",marginLeft:"spacing.6",background:"linear-gradient(270deg, #e8e8e800, #acacac66)"})]});t.Z=(0,h.P)(({productLoaded:e=!1,isDesktop:t=!1,isIpad:n=!1,addTBMargin:h=!1,showWhatsappIcon:x=!1,budgetCityCar:v=!1,onPDP:f=!1,isLazyLoaded:b=!1,isPersonalisedListing:y=!1,productId:k,customContainerClass:j})=>{let[L,w]=(0,a.useState)([]),[E,T]=(0,a.useState)(!1),[D,R]=(0,a.useState)(""),N=!0,S=(0,s.Z)("genericProductGA4Event",{eventName:"similar_car_section_seen",eventCategory:"section_seen"},.5,[],!0,{sendToClarity:!0}),B=async()=>{let e=(0,o.Ay)();if(e[k])w(e[k]);else try{let t=await(0,o.br)(k,!1,5);w(t),(0,o.FO)({...e,[k]:t})}catch(e){w([])}};(0,a.useEffect)(()=>(E||b||B(),()=>{N=!1}),[]);let F=t=>{if(N){var n;let a,r;T(!0);let s=t.detail?Object.keys(t.detail).reduce((e,n)=>e+`${n}=${t.detail[n]}&`,""):"";R(s=s.slice(0,s.length-1)),n=s,a=20,r=setInterval(()=>{e?(clearTimeout(r),(0,m.ZK)(`item_item?listing_id=${k}&${n}`,"GET").then(e=>e).then(e=>e.json()).then(e=>{w(e.results)})):(a-=1)||clearTimeout(r)},250)}};(0,a.useEffect)(()=>(window.addEventListener("showProductSimilarCar",F,!0),()=>{window.removeEventListener("showProductSimilarCar",F)}),[]),(0,l.h)(()=>!E&&b&&B(),{rootMargin:"0px 0px 300px 0px"},S,[!1]);let I=`/custom-listing/product-similar-cars/?carid=${k}${D?`&${D}
1`:""}&isRecommend=${E}`;if(!L||!L.length){if(b){let e="medium";return t?e="small":f&&(e="large"),(0,p.jsxs)(r.xu,{ref:S,marginY:"spacing.8",marginX:"spacing.5",paddingTop:t?"spacing.9":"spacing.5",...t?{display:"flex",flexWrap:"wrap",justifyContent:"space-between"}:{},children:[(0,p.jsx)(C,{text:"Similar cars",size:e}),(0,p.jsx)(r.xu,{display:t?"grid":"flex",flexDirection:t?void 0:"column",gridTemplateColumns:t?"repeat(3, 1fr)":void 0,gap:"spacing.4",width:t?"100%":void 0,children:[void 0,void 0,void 0].map((e,t)=>(0,p.jsx)(c.Z,{},`PDPPRC${t}`))}),!t&&(0,p.jsxs)(r.xu,{href:I,display:"block",position:"relative",marginTop:"spacing.7",textAlign:"center",children:[(0,p.jsx)(u.Z,{}),(0,p.jsx)(r.xv,{as:"span",size:"medium",weight:"bold",color:"surface.text.primary.normal",textDecorationLine:"underline",children:"View all"+(y?" similar cars":"")})]})]})}return null}return(0,p.jsx)(r.xu,{"data-category":g.WD.PRODUCT_RELATED_CAR,"product-id":k,children:t?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(C,{text:"Similar Cars",size:"large",wrapperProps:{margin:h?"spacing.0":"2em",padding:h?"2em":"spacing.0"}}),(0,p.jsx)(r.xu,{marginX:"-56px",minWidth:"978px",children:(0,p.jsx)(r.eW,{items:L,keyExtractor:(e,t)=>e?.id??t,renderItem:(e,n)=>(0,p.jsx)(r.xu,{borderRadius:"medium",minHeight:"166px",overflow:"hidden",children:(0,p.jsx)(d.Z,{...e,cardIndex:n+1,category:g.WD.PRODUCT_RELATED_CARD,horizontalCard:!0,showTestDriveAvailability:!0,showCarouselOnHover:t,openDetailsInNewTab:t,showWhatsappIcon:x,onPDP:f,budgetCityCar:v,entryPoint:"related-cars",noBoxShadow:!0,isDesktop:!0},n)}),fixedCardWidth:400,cardGap:16,showArrows:!n,arrowsPlacement:"outside"})})]}):(0,p.jsx)(_.Z,{carListData:L,title:"Similar cars",link:I,category:g.WD.PRODUCT_RELATED_CAR,maxItem:4,showWhatsappIcon:x,budgetCityCar:v,onPDP:f,showEmi:!0,entryPoint:"similar_car",isPlpV3:!y,isPlpV2:y,noMargin:y,onViewAllCarsClick:()=>{(0,i.pushIntoGA4)({eventName:"similar_car_view_all_click",eventCategory:"cta_click",componentTitle:"similar_cars"},"genericProductGA4Event")},isPersonalisedListing:y,customContainerClass:j})})},"ProductRelatedCars")},20319:function(e,t,n){n.d(t,{Z:function(){return E}});var a=n(67294),r=n(19670),s=n(94537),i=n(98746),l=n(94150),o=n(83955),c=n(28700),d=n(30256),u=n(17861),m=n(75231),h=n(13325),g=n(60551),_=n(17001),p=n(28631),C=n(77462),x=n(12957),v={cancelRequestDiaLog:"CancelRequestForm__cancelRequestDiaLog",showAnimation:"CancelRequestForm__showAnimation",removeBoxShadow:"CancelRequestForm__removeBoxShadow",heading:"CancelRequestForm__heading",medium:"CancelRequestForm__medium",purple:"CancelRequestForm__purple",darkPurple:"CancelRequestForm__darkPurple",addExtraPadding:"CancelRequestForm__addExtraPadding",subHeaderActionContainer:"CancelRequestForm__subHeaderActionContainer",details:"CancelRequestForm__details",changeCTA:"CancelRequestForm__changeCTA",thankYouContentSection:"CancelRequestForm__thankYouContentSection",contentSection:"CancelRequestForm__contentSection",reasonListWrap:"CancelRequestForm__reasonListWrap",title:"CancelRequestForm__title",reasonList:"CancelRequestForm__reasonList",reasonItem:"CancelRequestForm__reasonItem",cancelBtn:"CancelRequestForm__cancelBtn",orSeprator:"CancelRequestForm__orSeprator",goBackBtn:"CancelRequestForm__goBackBtn",bookCancelContainer:"CancelRequestForm__bookCancelContainer",bookingCancelContentSection:"CancelRequestForm__bookingCancelContentSection",changeColor:"CancelRequestForm__changeColor",unselected:"CancelRequestForm__unselected",selected:"CancelRequestForm__selected",whiteBgColor:"CancelRequestForm__whiteBgColor",bottomContainer:"CancelRequestForm__bottomContainer",ctaContainer:"CancelRequestForm__ctaContainer",addOpacity:"CancelRequestForm__addOpacity",subText:"CancelRequestForm__subText"},f=n(85893),b=({subHeading:e="",modalRef:t=null,btnHeading:n="",btnCategory:r="",btnLabel:s="",thankHeading:l="",productId:o="",theme:d="",noBackArrow:b=!1,removeBoxShadow:y=!1,bgColor:k="",subHeaderActionDetail:j=null,headingSize:L="",showSubHeaderAction:w=!1,subHeaderActionTitle:E="",handleChange:T,warningMessage:D="",mainButtonSubText:R="",callbackCardHeading:N="",disableNumberEdit:S=!1,isNebula:B=!1,...F})=>{let{heading:I,handleCloseConfirmation:P,cancellatinReasonList:A,handleCancelRequest:q,category:Z,showFormThankyou:W}=F,O=(0,u.s0)(),V=(0,u.TH)(),[H,G]=(0,a.useState)(!1),[$,Y]=(0,a.useState)(0),U=(0,a.useRef)(null),M=(0,a.useRef)(null),z=e=>{(0,i.pushIntoGA4)({eventName:"remove_car_from_visit_go_back_click",eventCategory:"footer_cta_click",componentTitle:"td_reschedule"},"genericGA4TdEvent"),e&&O(-1),G(!1),setTimeout(()=>{P(),t&&t.current&&(t.current.style.overflow="auto")},300)},X=(0,a.useEffectEvent)(()=>{"CancelRequestForm"===(V.state??"")&&z(null)});return(0,a.useEffect)(()=>(t&&t.current&&(t.current.style.overflow="unset"),O({pathname:V.pathname,search:V.search},{replace:!0,state:"CancelRequestForm"}),O(`${V.pathname}${V.search}`),window.addEventListener("popstate",X),setTimeout(()=>{G(!0)},50),()=>{window.removeEventListener("popstate",X)}
1),[]),(0,f.jsxs)("section",{className:(0,c.Y1)(v.cancelRequestDiaLog,H&&v.showAnimation,"white"===k?v.whiteBgColor:""),"data-category":Z,children:[(0,f.jsxs)("div",{className:(0,c.Y1)(C.Z.backHeading,y&&v.removeBoxShadow),children:[(!b||W)&&(0,f.jsx)("i",{onClick:z,role:"none",children:(0,f.jsx)(m.Z,{})}),(0,f.jsxs)("div",{className:(0,c.Y1)(v.heading,(()=>{switch(d){case"purple":return v.purple;case"darkPurple":return v.darkPurple;default:return null}})(),b&&v.addExtraPadding,"medium"===L?v.medium:""),children:[(0,f.jsx)("p",{className:v.subHeading,children:e}),(0,f.jsx)("h2",{children:W?l:I})]})]}),!W&&w&&j&&(0,f.jsxs)("div",{className:v.subHeaderActionContainer,children:[(0,f.jsxs)("div",{className:v.details,children:[(0,f.jsx)("h3",{children:E}),(0,f.jsxs)("h4",{children:[j.display_name?j.display_name:j.bank_branch.bank.display_name," ",j.account_number.substring(j.account_number.length-4)]})]}),(0,f.jsx)(_.Z,{text:"Change",label:"change_cta",category:"cancel-return_request_form",color:"transparentBtn",className:v.changeCTA,onClick:()=>{T?.()}})]}),W&&(0,f.jsxs)("div",{className:v.thankYouContentSection,children:[(0,f.jsx)(p.Z,{intent:Z,name:"request-callback-cancel-request-form",heading:N,disableNumberEdit:S}),o&&(0,f.jsx)(g.Z,{productId:o})]}),!W&&(w?(0,f.jsxs)("div",{className:v.bookCancelContainer,children:[(0,f.jsx)("div",{className:v.bookingCancelContentSection,children:(0,f.jsx)("div",{className:(0,c.Y1)(C.Z.mainBox,v.reasonListWrap),children:(0,f.jsx)("ul",{className:v.reasonList,children:A.map((e,t)=>(0,f.jsxs)("li",{className:v.reasonItem,onClick:()=>Y(t),role:"none",children:[(0,f.jsx)("span",{className:$===t?v.changeColor:"",children:e}),(0,f.jsx)("div",{className:(0,c.Y1)(v.unselected,$===t&&v.changeColor),children:$===t?(0,f.jsx)("div",{className:v.selected}):""})]},t))})})}),(0,f.jsxs)("div",{className:v.bottomContainer,children:[(0,f.jsx)("div",{ref:M,className:C.Z.warningContainer,children:D}),(0,f.jsxs)("div",{className:v.ctaContainer,children:[(0,f.jsx)(_.Z,{text:"Back",label:"back_cta_cancel_booking_form",color:B?"darkPurple":"primary",category:"cancel_booking_form",className:v.goBackBtn,onClick:z}),(0,f.jsx)(_.Z,{text:n||"Cancel",label:s||"cancel_cta_request_form",color:B?"greyPurple":"purpleOutline",size:"largeBtn",category:r||"cancel-return_request_form",className:(0,c.Y1)(v.cancelBtn,null===$&&v.addOpacity),btnRef:U,onClick:null!==$?()=>q(U,A[$],M):()=>null})]}),(0,f.jsx)("span",{className:v.subText,children:R})]})]}):(0,f.jsxs)("div",{className:v.contentSection,children:[(0,f.jsxs)("div",{className:(0,c.Y1)(C.Z.mainBox,v.reasonListWrap),children:[(0,f.jsx)("h3",{className:v.title,children:"Reasons for Cancelling:"}),(0,f.jsx)("ul",{className:v.reasonList,children:A.map((e,t)=>(0,f.jsxs)("li",{className:v.reasonItem,onClick:()=>{(0,i.pushIntoGA4)({eventName:"remove_car_from_visit_reason_select",eventCategory:"option_selector_click",componentTitle:"td_reschedule",eventValue:e},"genericGA4TdEvent"),Y(t)},role:"none",children:[(0,f.jsx)(h.Z,{fill:$===t?x.Z.secondaryPurple100:x.Z.border10}),(0,f.jsx)("span",{children:e})]},t))}),(0,f.jsx)(_.Z,{btnRef:U,color:B?"greyPurple":"purpleOutline",onClick:()=>q(U,A[$]),className:v.cancelBtn,category:r||"cancel-return_request_form",label:s||"cancel_cta_request_form",text:(0,f.jsx)(f.Fragment,{children:n||"Cancel"})})]}),(0,f.jsx)("span",{className:v.orSeprator,children:"OR"}),(0,f.jsx)(_.Z,{text:"GO BACK",label:"back_cta_cancel_booking_form",color:"primary",category:"cancel_booking_form",className:v.goBackBtn,onClick:z})]}))]})},y=n(94456),k=n(97229),j={testDriveCarsListingContainer:"TestDriveCarsListing__testDriveCarsListingContainer",whiteBack:"TestDriveCarsListing__whiteBack",addFixHeight:"TestDriveCarsListing__addFixHeight",noTopPadding:"TestDriveCarsListing__noTopPadding",collapseableView:"TestDriveCarsListing__collapseableView",carCardWrap:"TestDriveCarsListing__carCardWrap",animate:"TestDriveCarsListing__animate",expand:"TestDriveCarsListing__expand",rotateSvg:"TestDriveCarsListing__rotateSvg",headingWrap:"TestDriveCarsListing__headingWrap",heading:"TestDriveCarsListing__heading",addMoreBtn:"TestDriveCarsListing__addMoreBtn",testDriveCarsListingWrap:"TestDriveCarsListing__testDriveCarsListingWrap",addBorder:"TestDriveCarsListing__addBorder",addWhiteBackgroun
1d:"TestDriveCarsListing__addWhiteBackground",horizontalCarCard:"TestDriveCarsListing__horizontalCarCard",deleteIcon:"TestDriveCarsListing__deleteIcon",carCardViewWrap:"TestDriveCarsListing__carCardViewWrap",loadingCardWrap:"TestDriveCarsListing__loadingCardWrap"};let L={transition:"opacity 500ms ease-in-out, transform 500ms ease-in-out",opacity:0},w={entering:{opacity:1,transform:"translateX(0)"},entered:{opacity:1,transform:"translateX(0)"},exiting:{opacity:0,transform:"translateX(-100%)"},exited:{opacity:0,transform:"translateX(-100%)"}};var E=({addBorder:e=!1,whiteBack:t=!1,addDelete:n=!1,handleRemoveCarFromList:u=null,noTopPadding:m=!1,modalRef:h=null,desktopView:g=!1,addWhiteBackground:_=!1,isLuxury:p=!1,collapseableView:C=!1,editSchedule:v=!1,handleShowPriceDetails:E=null,carListingData:T,isLoading:D})=>{let[R,N]=(0,a.useState)(null),{status:S,responseData:B}=(0,o.i)("common/dynamic_reasons/?platform=consumer",null,[],!!n),[F,I]=(0,a.useState)(!1),P=(0,a.useRef)(null),A=(0,a.useMemo)(()=>({}),[]),q=e=>(A[e]||(A[e]=(0,a.createRef)()),A[e]),Z=B?B.car_removed_from_hub_test_drive&&Object.keys(B.car_removed_from_hub_test_drive).reduce((e,t)=>[...e,...B.car_removed_from_hub_test_drive[t]],[]):[],W=(t,a)=>(0,f.jsx)(r.Z,{nodeRef:q(t.id),timeout:500,children:r=>(0,f.jsx)("div",{ref:q(t.id),style:C?{}:{...L,...w[r]},className:(0,c.Y1)(j.carCardWrap,e&&j.addBorder,_&&j.addWhiteBackground),children:(0,f.jsxs)("div",{className:j.horizontalCarCard,children:[n&&T.length>1&&(0,f.jsx)("i",{role:"none",onClick:()=>{(0,i.pushIntoGA4)({eventName:"td_reschedule_remove_car_cross_click",eventCategory:"cross_icon_click",componentTitle:"td_reschedule"},"genericGA4TdEvent"),N(t.id)},className:j.deleteIcon,children:(0,f.jsx)(d.Z,{stroke:x.Z.textPrimary})}),(0,f.jsx)("div",{className:(0,c.Y1)(j.carCardViewWrap),children:(0,f.jsx)(y.Z,{cardIndex:a+1,category:"listing-testdrive-car",noBorder:!0,addBadge:!0,desktop:g,...t,isLuxury:p,showEmi:!0,collapseableView:C,label:v?"td_reschedule":"td_schedule",handleShowPriceDetails:E,singleLineCarDetailShow:!0})})]})})},t.id);return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{className:(0,c.Y1)(j.testDriveCarsListingContainer,t&&j.whiteBack,m&&j.noTopPadding,C&&j.collapseableView),children:(0,f.jsxs)("div",{className:[j.testDriveCarsListingWrap,!D&&1===T.length&&j.onlyOneCar].filter(Boolean).join(" "),children:[(0,f.jsx)(s.Z,{children:!D&&T.length>0&&(C&&T.length>2?T.slice(0,2):T).map((e,t)=>W(e,t))}),!D&&T.length>2&&C&&(0,f.jsx)("div",{ref:P,style:{maxHeight:F?P.current?.scrollHeight:void 0},className:j.animate,children:T.slice(2,T.length).map((e,t)=>W(e,t))}),T.length>2&&C&&(0,f.jsx)("div",{className:(0,c.Y1)(j.expand,F&&j.rotateSvg),children:(0,f.jsxs)("span",{role:"none",onClick:()=>I(!F),children:[F?"View Less":`${T.length-2} more ${T.length-2>1?"cars":"car"}`,(0,f.jsx)(l.Z,{height:"20",width:"20",fill:x.Z.secondaryPurple100})]})}),D&&(!T||!T.length)&&[void 0,void 0].map((e,t)=>(0,f.jsx)("div",{className:j.carCardWrap,children:(0,f.jsx)("div",{className:j.loadingCardWrap,children:(0,f.jsx)(k.Z,{})})},t))]})}),R&&"fetched"===S&&B&&(0,f.jsx)(b,{heading:"Reason for Remove",cancellatinReasonList:Z.map(e=>e.reason),handleCloseConfirmation:()=>N(!1),handleCancelRequest:(e,t)=>{(0,i.pushIntoGA4)({eventName:"remove_car_from_visit_remove_cta_click",eventCategory:"footer_cta_click",componentTitle:"td_reschedule",eventValue:t},"genericGA4TdEvent"),u&&u({car_id:R,reason_id:Z.find(e=>e.reason===t)?.id}),N(!1)},btnHeading:"Remove Car",category:"request-cancel-inspection",showFormThankyou:!1,thankHeading:"Cancel Request Submitted",theme:"darkPurple",modalRef:h})]})}},94537:function(e,t,n){n.d(t,{Z:function(){return h}});var a=n(63366),r=n(87462),s=n(97326),i=n(51721),l=n(67294),o=n(220);function c(e,t){var n=Object.create(null);return e&&l.Children.map(e,function(e){return e}).forEach(function(e){n[e.key]=t&&(0,l.isValidElement)(e)?t(e):e}),n}function d(e,t,n){return null!=n[t]?n[t]:e.props[t]}var u=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},m=function(e){function t(t,n){var a=e.call(this,t,n)||this,r=a.handleExited.bind((0,s.default)(a));return a.state={contextValue:{isMounting:!0}
1,handleExited:r,firstRender:!0},a}(0,i.default)(t,e);var n=t.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(e,t){var n,a,r=t.children,s=t.handleExited;return{children:t.firstRender?c(e.children,function(t){return(0,l.cloneElement)(t,{onExited:s.bind(null,t),in:!0,appear:d(t,"appear",e),enter:d(t,"enter",e),exit:d(t,"exit",e)})}):(Object.keys(a=function(e,t){function n(n){return n in t?t[n]:e[n]}e=e||{},t=t||{};var a,r=Object.create(null),s=[];for(var i in e)i in t?s.length&&(r[i]=s,s=[]):s.push(i);var l={};for(var o in t){if(r[o])for(a=0;a<r[o].length;a++){var c=r[o][a];l[r[o][a]]=n(c)}l[o]=n(o)}for(a=0;a<s.length;a++)l[s[a]]=n(s[a]);return l}(r,n=c(e.children))).forEach(function(t){var i=a[t];if((0,l.isValidElement)(i)){var o=t in r,c=t in n,u=r[t],m=(0,l.isValidElement)(u)&&!u.props.in;!c||o&&!m?c||!o||m?c&&o&&(0,l.isValidElement)(u)&&(a[t]=(0,l.cloneElement)(i,{onExited:s.bind(null,i),in:u.props.in,exit:d(i,"exit",e),enter:d(i,"enter",e)})):a[t]=(0,l.cloneElement)(i,{in:!1}):a[t]=(0,l.cloneElement)(i,{onExited:s.bind(null,i),in:!0,exit:d(i,"exit",e),enter:d(i,"enter",e)})}}),a),firstRender:!1}},n.handleExited=function(e,t){var n=c(this.props.children);e.key in n||(e.props.onExited&&e.props.onExited(t),this.mounted&&this.setState(function(t){var n=(0,r.default)({},t.children);return delete n[e.key],{children:n}}))},n.render=function(){var e=this.props,t=e.component,n=e.childFactory,r=(0,a.default)(e,["component","childFactory"]),s=this.state.contextValue,i=u(this.state.children).map(n);return delete r.appear,delete r.enter,delete r.exit,null===t?l.createElement(o.Z.Provider,{value:s},i):l.createElement(o.Z.Provider,{value:s},l.createElement(t,r,i))},t}(l.Component);m.propTypes={},m.defaultProps={component:"div",childFactory:function(e){return e}};var h=m}}]);
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.