1import{r as i,c as U,u as _,b as L,j as e}from"./vendor-react-Dxo5VVMX.js";import{L as P}from"./LoginPage-BuKocsEJ.js";import{mixpanel as c}from"./mixpanel-BhrQiLh9.js";import{b as E}from"./firebase-BVnSfmn9.js";import $ from"./QuoteFormPage-7-CIFXwV.js";import{t as D,A as T}from"./index-6F7UmCCt.js";import{F as R,S as M}from"./settings-DaQ5wits.js";import{C as y}from"./car-hPhOhJAI.js";import{C as I}from"./calendar-BuxqqRh-.js";import{U as O}from"./users-wV55u62z.js";import{C as z}from"./chevron-down-yKD9Oz0z.js";import{S as W}from"./shield-BNmcz-y5.js";import{S as B}from"./star-CALyqH9L.js";import"./vendor-analytics-BolNmaul.js";import"./vendor-firebase-core-Bea8MryS.js";import"./iconBase-WaUYP6_C.js";import"./index-BGwvH7bh.js";import"./bookingAnalytics-C-2oaXqa.js";import"./vendor-query-BGDNI3Fe.js";import"./vendor-firebase-firestore-BI8UjDC3.js";import"./vendor-firebase-extras-Butzwarm.js";import"./firebaseCore-DdWO-lul.js";const xe=({title:x})=>{var f;const[m,j]=i.useState(null),[p,d]=i.useState(!1),[w,N]=i.useState(null),[s,k]=i.useState(null),h=i.useRef(null),{id:r}=U(),v=_(),g=L(),t=((f=v.state)==null?void 0:f.car)||{};i.useEffect(()=>{const a=E.onAuthStateChanged(n=>{N(n)});return()=>a()},[]),i.useEffect(()=>{var n,l,o,b;c.track("Page View",{page:"Car Details",carId:r});const a={id:t.carId||r,name:t.name||"Unknown",model:t.model||"Unknown",variant:t.model||"Unknown",fuelType:t.type||"Unknown",transmission:t.transmission||"Unknown",bodyStyle:t.bodyStyle||"Unknown",modelYear:t.year?`${t.year}`:"Unknown",price:(n=t.price)!=null&&n.min_price?parseFloat(t.price.min_price):0,originalPrice:(l=t.price)!=null&&l.max_price?parseFloat(t.price.max_price):0,savedAmount:(o=t.price)!=null&&o.max_price&&((b=t.price)!=null&&b.min_price)?(parseFloat(t.price.max_price)-parseFloat(t.price.min_price))*1e5:0,image:t.image||"/placeholder.svg",specifications:{fuelType:t.type||"Unknown",engineCC:t.engine?`${t.engine} cc`:"Unknown",transmission:t.transmission||"Unknown",bodyStyle:t.bodyStyle||"Unknown",modelYear:t.year?`${t.year}`:"Unknown",seats:t.passengers||"Unknown"},ncapRating:{value:"GLOBAL NCAP",stars:t.rating?Math.round(t.rating):0,description:"Judged on 1 to 5 star rating: More the star rating, more will be the safety of passengers in case of a car crash."},features:{Comfort:["Air Conditioning","Power Steering","Central Locking","Power Windows"],Interior:["Fabric Upholstery","Digital Instrument Cluster","Steering Mounted Controls"],Safety:["Dual Airbags","ABS with EBD","Reverse Parking Sensors","Seatbelt Warning"],Exterior:["Body Colored Bumpers","Wheel Covers","Outside Rear View Mirror"],Engine:[t.engine?`${t.engine/1e3}L ${t.type} Engine`:"Unknown Engine",t.transmission?`${t.transmission} Transmission`:"Unknown Transmission",t.power?`${t.power} PS Power`:"Unknown Power"],Dimensions:[t.length?`Length: ${t.length}mm`:"Length: Unknown",t.width?`Width: ${t.width}mm`:"Width: Unknown",t.height?`Height: ${t.height}mm`:"Height: Unknown",t.warranty_km?`Wheelbase: ${t.warranty_km==="unlimited"?"2610mm":t.warranty_km}`:"Wheelbase: Unknown"]}};k(a)},[r,t]),i.useEffect(()=>{s&&h.current!==s.id&&(D("car_viewed",{city:t.city||"Unknown",partner:t.partner||"Unknown",car_id:s.id,car_name:`${s.name} ${s.model}`,car_category:s.bodyStyle||"Unknown",rental_days:t.rental_days||null,price:s.price||0}),h.current=s.id)},[s]),i.useEffect(()=>{document.title=x},[x]);const C=a=>{j(m===a?null:a)},[A,u]=i.useState(!1),S=a=>{if(a.preventDefault(),c.track("Button Click",{page:"Car Details",carId:r,button:"Get Quote"}),!w){d(!0),c.track("Login Modal Opened",{page:"Car Details",carId:r,action:"Get Quote Click"});return}u(!0)};if(!t||!s)return e.jsx("div",{className:"min-h-screen bg-white flex items-center justify-center text-gray-500",children:"No car data available"});const F=[{icon:R,label:s.specifications.fuelType},{icon:M,label:s.specifications.engineCC},{icon:y,label:s.specifications.transmission},{icon:y,label:s.specifications.bodyStyle},{icon:I,label:s.specifications.modelYear},{icon:O,label:s.specifications.seats}];return e.jsxs("div",{className:"min-h-screen bg-white",children:[e.jsx("button",{onClick:()=>g(-1),className:"fixed top-6 left-6 z-50 bg-white/80 backdrop-blur-sm rounded-full p-2.5 shadow-[0_2px_20px_rgba(0,0,0,0.08)] hover:shadow-[0_4px_24px_rgba(0,0,0,0.12)] transition-all",children:e.jsx(T,{size:20,className:"text-[#111]"})}),e.jsx("section",{className:"bg-[#FAFAFA]",children:e.jsx("div",{className:"max-w-4xl mx-auto pt-20 pb-12 px-6",children:e.jsx("img",{src:s.image||"/placeholder.svg",alt:`${s.name} ${s.model}`,className:"w-full aspect-[16/9] object-contain"})})}),e.jsx("section",{className:"max-w-4xl mx-auto px-6 py-12",children:e.jsxs("div",{className:"flex flex-col md:flex-row md:items-end md:justify-between gap-4",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-4xl md:text-5xl font-bold tracking-tight text-[#111]",children:[s.name," ",s.model]}),e.jsxs("p",{className:"text-gray-500 mt-2 text-base md:text-lg",children:[s.fuelType," · ",s.transmission," · ",s.bodyStyle]})]}),e.jsxs("div",{className:"text-left md:text-right",children:[e.jsxs("p",{className:"text-3xl md:text-4xl font-bold text-[#111]",children:["â¹",s.originalPrice," Lakh"]}),s.savedAmount>0&&e.jsxs("p",{className:"text-sm text-gray-400 mt-1",children:["Starting from ","â¹",s.price," Lakh"]})]})]})}),e.jsx("section",{className:"max-w-4xl mx-auto px-6 pb-16",children:e.jsx("div",{className:"grid grid-cols-3 md:grid-cols-6 gap-6",children:F.map((a,n)=>e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"w-12 h-12 mx-auto bg-[#FAFAFA] rounded-full flex items-center justify-center mb-2",children:e.jsx(a.icon,{size:20,className:"text-gray-400"})}),e.jsx("p",{className:"text-sm font-medium text-[#111]",children:a.label})]},n))})}),e.jsx("section",{className:"bg-[#0A0A0A] py-16 md:py-20",children:e.jsxs("div",{className:"max-w-3xl mx-auto px-6 text-center",children:[e.jsxs("h2",{className:"text-2xl md:text-3xl font-bold text-white mb-3",children:[s.originalPrice?e.jsxs(e.Fragment,{children:["â¹",s.originalPrice," Lakh is a big decision."]}):e.jsx(e.Fragment,{children:"This is a big decision."}),e.jsx("br",{}),e.jsx("span",{className:"text-gray-400 font-normal text-xl md:text-2xl",children:"Make sure with an Extended Test Drive."})]}),e.jsxs("div",{className:"text-gray-400 text-base md:text-lg mb-8 max-w-xl mx-auto
1space-y-1 mt-4",children:[e.jsx("p",{children:"Rent this exact model for 1-30 days."}),e.jsx("p",{children:"Same car, real roads, your schedule."}),e.jsx("p",{children:"Then buy brand new from the showroom."})]}),e.jsx("button",{onClick:()=>{c.track("ETD CTA Clicked",{page:"Car Details",carName:s==null?void 0:s.name,carModel:s==null?void 0:s.model}),g("/buy-car/extended-test-drive/location",{state:{car:t}})},className:"bg-white text-[#111] font-semibold px-8 py-3.5 rounded-full hover:bg-gray-100 transition-all",children:"Start Extended Test Drive"}),e.jsx("p",{className:"text-gray-500 text-sm mt-4",children:"No commitment to buy · Normal rental rates"})]})}),e.jsxs("section",{className:"max-w-4xl mx-auto px-6 py-16 md:py-24",children:[e.jsx("h2",{className:"text-3xl font-bold tracking-tight text-[#111] mb-8",children:"Features"}),e.jsx("div",{className:"divide-y divide-gray-100",children:Object.entries(s.features).map(([a,n])=>e.jsxs("div",{children:[e.jsxs("button",{onClick:()=>C(a),className:"w-full flex items-center justify-between py-5 text-left",children:[e.jsx("span",{className:"font-medium text-[#111]",children:a}),e.jsx(z,{size:18,className:`text-gray-400 transform transition-transform ${m===a?"rotate-180":""}`})]}),m===a&&e.jsx("div",{className:"pb-5",children:e.jsx("div",{className:"flex flex-wrap gap-2",children:n.map((l,o)=>e.jsx("span",{className:"px-4 py-2 bg-[#FAFAFA] rounded-full text-sm text-gray-600",children:l},o))})})]},a))})]}),s.ncapRating.stars>0&&e.jsx("section",{className:"max-w-4xl mx-auto px-6 pb-16",children:e.jsxs("div",{className:"bg-[#FAFAFA] rounded-2xl p-8",children:[e.jsxs("div",{className:"flex items-center gap-4 mb-3",children:[e.jsx(W,{size:24,className:"text-[#111]"}),e.jsx("span",{className:"font-bold text-[#111]",children:s.ncapRating.value}),e.jsx("div",{className:"flex gap-1",children:[...Array(5)].map((a,n)=>e.jsx(B,{size:18,className:n<s.ncapRating.stars?"text-[#111] fill-current":"text-gray-300"},n))})]}),e.jsx("p",{className:"text-gray-500 text-sm",children:s.ncapRating.description})]})}),e.jsx("div",{className:"fixed bottom-0 left-0 right-0 z-40 bg-white/80 backdrop-blur-md border-t border-gray-100 py-4 px-6",children:e.jsxs("div",{className:"max-w-4xl mx-auto flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsxs("p",{className:"text-2xl font-bold text-[#111]",children:["â¹",s.originalPrice," Lakh"]}),e.jsx("p",{className:"text-xs text-gray-400",children:"Prices may vary by variant & location"})]}),e.jsx("button",{onClick:S,className:"bg-[#111] text-white font-semibold px-8 py-3 rounded-full hover:bg-[#333] transition-all",children:"Get Quote"})]})}),e.jsx("div",{className:"h-24"}),p&&e.jsx(P,{isOpen:p,onClose:()=>d(!1),onAuth:()=>d(!1)}),e.jsx($,{isOpen:A,onClose:()=>u(!1),car:s})]})};export{xe as default};
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.