1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[511],{800:(e,s,i)=>{"use strict";i.d(s,{A:()=>a});let a=(0,i(12119).A)("settings-2",[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]])},3346:(e,s,i)=>{"use strict";i.d(s,{A:()=>a});let a=(0,i(12119).A)("funnel",[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]])},13119:(e,s,i)=>{"use strict";i.d(s,{A:()=>a});let a=(0,i(12119).A)("activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]])},18699:()=>{},20511:(e,s,i)=>{"use strict";i.r(s),i.d(s,{AutoView:()=>M});var a=i(54568),t=i(7620),n=i(90008),l=i(6158),r=i(85271),c=i(60844),o=i(66840);i(18699);let d=e=>{let{user:s,onPostCreated:i}=e,[d,u]=(0,t.useState)(""),[p,h]=(0,t.useState)(""),[m,x]=(0,t.useState)(""),[g,v]=(0,t.useState)(""),[j,f]=(0,t.useState)("Truck"),[y,b]=(0,t.useState)(""),[N,k]=(0,t.useState)(""),[S,w]=(0,t.useState)([]),[A,_]=(0,t.useState)(!1),[C,q]=(0,t.useState)(""),{activeCounty:z}=(0,l.n)();(0,t.useEffect)(()=>{(null==s?void 0:s.id)&&n.supabase.from("stores").select("location, city, address").eq("owner_id",s.id).maybeSingle().then(e=>{let{data:s}=e;s&&b(s.location||s.city||s.address||"")})},[null==s?void 0:s.id]);let I=async e=>{if(e.preventDefault(),s){_(!0),q("");try{let e=[];for(let i of S){let a=i.name.split(".").pop(),t="vehicles/".concat(s.id,"_").concat(Date.now(),"_").concat(Math.random().toString(36).substring(2),".").concat(a),{data:l,error:r}=await n.supabase.storage.from("posts").upload(t,i);if(!r&&l){let{data:{publicUrl:s}}=n.supabase.storage.from("posts").getPublicUrl(l.path);e.push(s)}}let a=parseFloat(p.replace(/[^0-9.]/g,""))||0,t=parseInt(m)||new Date().getFullYear(),l=parseInt(g.replace(/[^0-9]/g,""))||0,{data:r,error:c}=await n.supabase.schema("pro").from("classified_items").insert({tenant_id:s.county||z,user_id:s.id,title:d,price:a,location:y||"Southeast Texas",category:"Vehicles & Powersports",description:N,images:e,item_details:{year:t,mileage:l,body_type:j},status:"active",metadata:{source:"dealer_dashboard"}}).select().single();if(c)throw c;let{error:o}=await n.supabase.schema("consumer").from("posts").insert({tenant_id:s.county||z,profile_id:s.id,type:"post",content:"\uD83D\uDE97 **Just Listed!**\n\n**".concat(t," ").concat(d,"**\nPrice: $").concat(a.toLocaleString(),"\nMileage: ").concat(l.toLocaleString()," mi\nBody: ").concat(j,"\n\n").concat(N),media_urls:e,metadata:{category:"Vehicles",classified_item_id:r.id}});if(o)throw o;q("Vehicle published successfully!"),u(""),h(""),x(""),v(""),k(""),w([]),i&&i()}catch(e){console.error(e),alert("Failed to publish vehicle: "+e.message)}finally{_(!1)}}};return(0,a.jsxs)("div",{className:"dealer-dashboard auto-content-v",children:[(0,a.jsxs)("div",{className:"section-title-row",children:[(0,a.jsx)("h2",{children:"Dealer Dashboard"}),(0,a.jsx)("span",{style:{color:"var(--primary)",fontSize:"0.9rem",fontWeight:600},children:"Publish Vehicle"})]}),(0,a.jsxs)("div",{className:"dealer-form-card glass",children:[C&&(0,a.jsx)("div",{className:"dealer-success-banner",children:C}),(0,a.jsxs)("form",{onSubmit:I,className:"dealer-form",children:[(0,a.jsxs)("div",{className:"form-row",children:[(0,a.jsxs)("div",{className:"form-group",children:[(0,a.jsx)("label",{children:"Vehicle Title"}),(0,a.jsx)("input",{type:"text",required:!0,value:d,onChange:e=>u(e.target.value),placeholder:"e.g. 2024 SETX Electric Alpha"})]}),(0,a.jsxs)("div",{className:"form-group",children:[(0,a.jsx)("label",{children:"Price"}),(0,a.jsx)("input",{type:"text",required:!0,value:p,onChange:e=>h(e.target.value),placeholder:"$0.00"})]})]}),(0,a.jsxs)("div",{className:"form-row",children:[(0,a.jsxs)("div",{className:"form-group",children:[(0,a.jsx)("label",{children:"Year"}),(0,a.jsx)("input",{type:"number",required:!0,value:m,onChange:e=>x(e.target.value),placeholder:"YYYY"})]}),(0,a.jsxs)("div",{className:"form-group",children:[(0,a.jsx)("label",{children:"Mileage"}),(0,a.jsx)("input",{type:"text",required:!0,value:g,onChange:e=>v(e.target.value),placeholder:"0"})]}),(0,a.jsxs)("div",{className:"form-group",children:[(0,a.jsx)("label",{children:"Body Type"}),(0,a.jsxs)("select",{value:j,onChange:e=>f(e.target.value),children:[(0,a.jsx)("option",{children:"Truck"}),(0,a.jsx)("option",{children:"SUV"}),(0,a.jsx)("option",{children:"Sedan"}),(0,a.jsx)("option",{children:"Coupe"}),(0,a.jsx)("option",{children:"Van"})]})]})]}),(0,a.jsxs)("div",{className:"form-group",children:[(0,a.jsx)("label",{children:"Lot Location / City"}),(0,a.jsx)("input",{type:"text",required:!0,value:y,onChange:e=>b(e.target.value),placeholder:"e.g. Beaumont, TX"})]}),(0,a.jsxs)("div",{className:"form-group",children:[(0,a.jsx)("label",{children:"Description"}),(0,a.jsx)("textarea",{required:!0,rows:4,value:N,onChange:e=>k(e.target.value),placeholder:"Describe the vehicle..."})]}),(0,a.jsxs)("div",{className:"form-group",children:[(0,a.jsx)("label",{children:"Images"}),(0,a.jsxs)("div",{className:"file-upload-box",children:[(0,a.jsx)("input",{type:"file",multiple:!0,accept:"image/*",onChange:e=>{e.target.files&&w(Array.from(e.target.files))},id:"dealer_img",style:{display:"none"}}),(0,a.jsxs)("label",{htmlFor:"dealer_img",className:"file-upload-btn",children:[(0,a.jsx)(r.A,{size:20})," Select Images"]}),(0,a.jsxs)("span",{className:"file-count",children:[S.length," files selected"]})]})]}),(0,a.jsx)("button",{type:"submit",className:"dealer-submit-btn",disabled:A,children:A?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(c.A,{size:18,className:"animate-spin"})," Publishing..."]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o.A,{size:18})," Publish to Vehicles & Social"]})})]})]})]})};var u=i(96897),p=i(24643),h=i(13119);let m=(0,i(12119).A)("fuel",[["path",{d:"M14 13h2a2 2 0 0 1 2 2v2a2 2 0 0 0 4 0v-6.998a2 2 0 0 0-.59-1.42L18 5",key:"1wtuz0"}],["path",{d:"M14 21V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v16",key:"e09ifn"}],["path",{d:"M2 21h13",key:"1x0fut"}],["path",{d:"M3 9h11",key:"1p7c0w"}]]);var x=i(69354),g=i(79502),v=i(63072),j=i(3346),f=i(14486),y=i(800),b=i(65202),N=i(40590),k=i(21011),S=i(12598),w=i(98890),A=i(24734),_=i(61580),C=i(4518),q=i(34046);i(96560);let z="Vehicles & Powersports",I=e=>{var s,i,a,t,n,l,r,c,o,d,u,p,h;return{id:e.id,name:e.title||"Vehicle",price:"number"==typeof e.price?"$".concat(e.price.toLocaleStr
1ing()):e.price||"Contact for price",year:null!=(h=null!=(p=null==(s=e.item_details)?void 0:s.year)?p:null==(i=e.vehicle_details)?void 0:i.year)?h:new Date().getFullYear(),miles:(null==(a=e.item_details)?void 0:a.mileage)!=null?String(e.item_details.mileage):(null==(t=e.vehicle_details)?void 0:t.mileage)!=null?String(e.vehicle_details.mileage):"0",type:(null==(n=e.item_details)?void 0:n.body_type)||(null==(l=e.vehicle_details)?void 0:l.body_type)||"Vehicle",image:(null==(r=e.images)?void 0:r[0])||"/luxury_truck.png",isFeatured:!1,isSponsored:!!e.is_sponsored,sellerId:e.user_id,vin:(null==(c=e.item_details)?void 0:c.vin)||(null==(o=e.vehicle_details)?void 0:o.vin)||"",transmission:(null==(d=e.item_details)?void 0:d.transmission)||(null==(u=e.vehicle_details)?void 0:u.transmission)||"Automatic"}},M=e=>{let{activeTab:s=0,user:i,scope:r="state"}=e,[M,F]=(0,t.useState)(s),[L,E]=(0,t.useState)("All"),[P,V]=(0,t.useState)(""),[D,T]=(0,t.useState)([]),[Y,B]=(0,t.useState)(!0),[R,W]=(0,t.useState)(null),[$,H]=(0,t.useState)([]),[O,U]=(0,t.useState)(!1),[X,J]=(0,t.useState)(""),[K,G]=(0,t.useState)(""),[Q,Z]=(0,t.useState)(60),[ee,es]=(0,t.useState)(!1),[ei,ea]=(0,t.useState)(1e5),[et,en]=(0,t.useState)(15e4),{user:el,activeCounty:er,setEnv:ec,setA
1ctiveTab:eo,isDemoMode:ed}=(0,l.n)(),{info:eu,error:ep}=(0,w.d)(),eh=i||el;(0,t.useEffect)(()=>{F(s)},[s]),(0,t.useEffect)(()=>{ed?em():ex()},[r,eh,er,ed]);let em=async()=>{B(!0);let{data:e}=await n.supabase.from("demo_classified_items").select("*").eq("category",z).order("created_at",{ascending:!1});T((e||[]).map(e=>I({...e,user_id:e.author_id}))),B(!1)};(0,t.useEffect)(()=>{if(3!==M)return;U(!0);let e=ed?"demo_stores":"stores";n.supabase.from(e).select("id, name, description").eq("category","Services").ilike("subcategory","%auto%").then(e=>{let{data:s}=e;H(null!=s?s:[]),U(!1)})},[M,ed]);let ex=async()=>{B(!0);let e=n.supabase.schema("pro").from("classified_items").select("*").eq("category",z).neq("status","deleted").neq("status","sold").order("created_at",{ascending:!1}).limit(24),s=er||(null==eh?void 0:eh.county);s&&("county"===r||"city"===r)&&(e=e.eq("tenant_id",s));let[{data:i,error:a},t]=await Promise.all([e,(0,A.xy)("classified_item",{table:"classified_items",schema:"pro",select:"*",tenantField:"tenant_id"},{tenantId:s,limit:5})]),l=t.filter(e=>e.category===z),c=new Set(l.map(e=>e.id));T([...l,...(i||[]).filter(e=>!c.has(e.id))].map(I)),B(!1),a&&console.error("Failed to load vehicle listings:",a)},eg=e=>{if("number"==typeof e)return e;let s=parseFloat(String(null!=e?e:"").replace(/[^0-9.]/g,""));return isNaN(s)?0:s},ev=D.filter(e=>{var s,i;let a="All"===L||(null==(s=e.type)?void 0:s.toLowerCase().includes(L.toLowerCase())),t=!P.trim()||(null==(i=e.name)?void 0:i.toLowerCase().includes(P.toLowerCase()))||String(e.year).includes(P),n=eg(e.price),l=parseFloat(e.miles.replace(/[^0-9.]/g,""))||0,r=n<=ei&&(l<=et||0===l);return a&&t&&r});return(0,a.jsxs)("div",{className:"auto-container",children:[(0,a.jsx)(C.Y,{placement:"auto"}),(0,a.jsxs)("header",{className:"auto-hero",children:[(0,a.jsx)("h1",{children:"Your Next Drive in SETX"}),(0,a.jsx)("p",{children:"Verified dealership inventories, certified pre-owned, and local private seller marketplace."}),(0,a.jsxs)("div",{className:"auto-search-box glass",children:[(0,a.jsx)(b.A,{size:20}),(0,a.jsx)("input",{type:"text",placeholder:"Search by make, model, or year...",value:P,onChange:e=>V(e.target.value)}),(0,a.jsxs)("button",{className:"auto-filter-pill",onClick:()=>es(!0),children:[(0,a.jsx)(j.A,{size:16})," Filters"]})]}),(0,a.jsx)("div",{style:{display:"flex",gap:8,overflowX:"auto",marginTop:18,paddingBottom:4},children:[{id:0,label:"Showroom",icon:o.A},{id:1,label:"All Stock (".concat(ev.length,")"),icon:N.A},{id:2,label:"Finance",icon:g.A},{id:3,label:"Service Centers",icon:k.A}].map(e=>{let s=e.icon,i=M===e.id;return(0,a.jsxs)("button",{onClick:()=>F(e.id),style:{display:"flex",alignItems:"center",gap:6,padding:"8px 14px",borderRadius:12,fontSize:"0.82rem",fontWeight:700,cursor:"pointer",border:"none",background:i?"var(--primary)":"rgba(255,255,255,0.06)",color:i?"#fff":"var(--text-secondary)",whiteSpace:"nowrap",flexShrink:0,transition:"all 0.2s ease"},children:[(0,a.jsx)(s,{size:14}),(0,a.jsx)("span",{children:e.label})]},e.id)})})]}),(()=>{switch(M){case 0:default:return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"auto-category-scroll",children:["All","Trucks","SUV","Sedan","Electric","Performance","Luxury"].map(e=>(0,a.jsx)("button",{className:"type-pill ".concat(L===e?"active":""),onClick:()=>E(e),children:e},e))}),(0,a.jsxs)("div",{className:"vehicles-grid",children:[(0,a.jsxs)("div",{className:"section-title-row",children:[(0,a.jsx)("h2",{children:"Latest Arrivals"}),(0,a.jsx)("button",{className:"view-link",onClick:()=>F(1),children:"See All Deals"})]}),Y?(0,a.jsx)("div",{style:{display:"flex",justifyContent:"center",padding:"40px",width:"100%"},children:(0,a.jsx)(c.A,{className:"animate-spin",size:32,color:"var(--primary)"})}):0===ev.length?(0,a.jsx)("div",{style:{textAlign:"center",padding:"40px",color:"var(--text-muted)",width:"100%"},children:"No vehicles match your search or filters."}):ev.map(e=>(0,a.jsxs)("div",{className:"vehicle-card glass",children:[(0,a.jsxs)("div",{className:"vehicle-image",children:[(0,a.jsx)("img",{src:e.image,alt:e.name,className:"home-image-inner"}),e.isSponsored?(0,a.jsxs)("span",{className:"hot-tag",style:{background:"var(--primary)"},children:[(0,a.jsx)(p.A,{size:12})," Sponsored"]}):e.isFeatured&&(0,a.jsxs)("span",{className:"hot-tag",children:[(0,a.jsx)(p.A,{size:12})," Hot Deal"]}),(0,a.jsx)("div",{className:"v-price-overlay",children:e.price})]}),(0,a.jsxs)("div",{className:"vehicle-body",children:[(0,a.jsxs)("div",{className:"v-header",children:[(0,a.jsx)("span",{className:"v-year",children:e.year}),(0,a.jsx)("h3",{className:"v-title",children:e.name})]}),(0,a.jsxs)("div",{className:"v-meta",children:[(0,a.jsxs)("span",{children:[(0,a.jsx)(h.A,{size:14})," ",e.miles," mi"]}),(0,a.jsxs)("span",{children:[(0,a.jsx)(m,{size:14})," ",e.type]})]}),(0,a.jsxs)("div",{className:"v-footer",children:[(0,a.jsxs)("div",{className:"v-dealer",children:[(0,a.jsx)(x.A,{size:14,className:"verified-icon"}),(0,a.jsx)("span",{children:"SETX Certified"})]}),(0,a.jsx)(u._,{platform:"auto",size:16,title:"Ask Sabine about this vehicle",context:{type:"vehicle",title:e.name,price:e.price,text:[e.year,e.miles+" mi",e.type].join(", ")+". The user is looking at this vehicle listing. Use price_check to compare with local listings; never invent history or condition."}}),(0,a.jsx)("button",{className:"inquiry-btn",disabled:!e.sellerId,onClick:()=>e.sellerId&&W(e),children:"Message"})]})]})]},e.id))]}),(0,a.jsxs)("div",{className:"auto-tools-section",children:[(0,a.jsx)("h2",{children:"Ownership & Buyer Suite"}),(0,a.jsxs)("div",{className:"tools-row",style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(130px, 1fr))",gap:12},children:[(0,a.jsxs)("div",{className:"tool-box glass",onClick:()=>F(2),style:{cursor:"pointer",padding:18},children:[(0,a.jsx)(g.A,{size:24,color:"var(--primary)"}),(0,a.jsx)("span",{style:{fontWeight:700},children:"Finance Calculator"})]}),(0,a.jsxs)("div",{className:"tool-box glass",onClick:()=>F(3),style:{cursor:"pointer",padding:18},children:[(0,a.jsx)(v.A,{size:24,color:"#f59e0b"}),(0,a.jsx)("span",{style:{fontWeight:700},children:"Service Booking"})]})]})]})]});case 1:return(0,a.jsxs)("div",{className:"auto-content-v",children:[(0,a.jsxs)("div",{className:"section-title-row",children:[(0,a.jsxs)("h2",{children:["Full Inventory (",ev.length," vehicles)"]}),(0,a.jsxs)("button",{className:"auto-filter-pill",onClick:()=>es(!0),children:[(0,a.jsx)(j.A,{size:14})," Filter Results"]})]}),(0,a.jsx)("div",{className:"vehicles-grid-h",children:ev.map(e=>(0,a.jsxs)("div",{className:"v-card-h glass",style:{cursor:"pointer"},onClick:()=>e.sellerId&&W(e),children:[(0,a.jsx)("div",{className:"v-h-img",style:{backgroundImage:"url(".concat(e.image,")")}}),(0,a.jsxs)("div",{className:"v-h-info",children:[(0,a.jsx)("h4",{children:e.name}),(0,a.jsxs)("p",{children:[e.year," ⢠",e.miles," mi ⢠",e.type]}),(0,a.jsx)("strong",{children:e.price})]}),(0,a.jsx)(f.A,{size:18})]},e.id))})]});case 2:return(()=>{let e=D.length>0?eg(D[0].price):35e3,s=X?parseFloat(X)||0:e,i=Math.round(.1*e),t=K?parseFloat(K)||0:i,n=Math.max(s-t,0),l=n>0?.006583333333333333*n*Math.pow(1.0065833333333334,Q)/(Math.pow(1.0065833333333334,Q)-1):0;return(0,a.jsxs)("div",{className:"auto-content-v",children:[(0,a.jsx)("div",{className:"section-title-row",children:(0,a.jsx)("h2",{children:"Vehicle Finance"})}),(0,a.jsxs)("div",{className:"finance-card-auto glass",children:[(0,a.jsxs)("div",{className:"f-auto-header",children:[(0,a.jsx)(p.A,{size:24,color:"#10b981"}),(0,a.jsx)("h3",{children:"Est. Payment Calculator"})]}),(0,a.jsxs)("div",{className:"f-auto-body",children:[(0,a.jsxs)("div",{className:"f-item",children:[(0,a.jsx)("span",{children:"Vehicle Price"}),(0,a.jsx)("input",{type:"number",className:"finance-input",value:X,placeholder:"$".concat(e.toLocaleStr
1ing()),onChange:e=>J(e.target.value)})]}),(0,a.jsxs)("div",{className:"f-item",children:[(0,a.jsx)("span",{children:"Down Payment"}),(0,a.jsx)("input",{type:"number",className:"finance-input",value:K,placeholder:"$".concat(i.toLocaleString()),onChange:e=>G(e.target.value)})]}),(0,a.jsxs)("div",{className:"f-item",children:[(0,a.jsx)("span",{children:"Loan Term"}),(0,a.jsxs)("select",{className:"finance-input",value:Q,onChange:e=>Z(Number(e.target.value)),children:[(0,a.jsx)("option",{value:36,children:"36 Months (3 Years)"}),(0,a.jsx)("option",{value:48,children:"48 Months (4 Years)"}),(0,a.jsx)("option",{value:60,children:"60 Months (5 Years)"}),(0,a.jsx)("option",{value:72,children:"72 Months (6 Years)"})]})]}),(0,a.jsxs)("div",{className:"f-item",children:[(0,a.jsx)("span",{children:"Assumed APR"}),(0,a.jsxs)("strong",{children:[7.9,"%"]})]}),(0,a.jsx)("div",{className:"f-divider"}),(0,a.jsxs)("div",{className:"f-monthly",children:[(0,a.jsx)("span",{children:"Est. Monthly Payment"}),(0,a.jsx)("h2",{children:n>0?"~$".concat(l.toLocaleString(void 0,{maximumFractionDigits:0})," / mo"):"--"}),(0,a.jsxs)("p",{className:"finance-disclaimer",children:["Amortized estimate based on ",7.9,"% APR and $",t.toLocaleString()," down payment."]})]})]})]})]})})();case 3:return(0,a.jsxs)("div",{className:"auto-content-v",children:[(0,a.jsx)("div",{className:"section-title-row",children:(0,a.jsx)("h2",{children:"Certified Auto Service Centers"})}),(0,a.jsxs)("div",{className:"service-booking glass",style:{borderRadius:20,padding:22},children:[(0,a.jsxs)("div",{className:"s-b-header",style:{marginBottom:16},children:[(0,a.jsx)(y.A,{size:24,color:"var(--primary)"}),(0,a.jsx)("h3",{children:"Book Local Service"})]}),O?(0,a.jsx)("div",{style:{display:"flex",justifyContent:"center",padding:20},children:(0,a.jsx)(c.A,{className:"animate-spin"})}):(0,a.jsxs)("div",{className:"s-b-list",style:{display:"flex",flexDirection:"column",gap:12},children:[0===$.length&&(0,a.jsx)("div",{style:{padding:24,textAlign:"center",opacity:.7},children:"No auto shops are listed on SETX 360 yet. Know one? Local shops can sign up from the Pro tools."}),$.map(e=>(0,a.jsxs)("div",{className:"s-item glass",style:{padding:"16px 20px",borderRadius:14,display:"flex",justifyContent:"space-between",alignItems:"center",cursor:"pointer"},onClick:()=>eu("Opening service booking for ".concat(e.name)),children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("strong",{style:{fontSize:"0.95rem",display:"block",marginBottom:2},children:e.name}),(0,a.jsx)("span",{style:{fontSize:"0.8rem",color:"var(--text-muted)"},children:e.description||"ASE-certified repair and inspection"})]}),(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,color:"var(--primary)",fontWeight:700,fontSize:"0.82rem"},children:[(0,a.jsx)("span",{children:"Schedule"}),(0,a.jsx)(f.A,{size:16})]})]},e.id))]})]})]});case 5:return(0,a.jsx)(d,{user:eh,onPostCreated:()=>F(1)})}})(),(0,a.jsx)("div",{className:"auto-fab",children:(0,a.jsxs)("button",{className:"sell-car-btn",onClick:()=>{["dealership","v_dealership","admin"].includes(null==eh?void 0:eh.role)?F(5):(ec("classifieds"),eo(0))},children:[(0,a.jsx)(o.A,{size:20})," Sell Your Vehicle"]})}),R&&R.sellerId&&(0,a.jsx)(_.W,{user:eh,recipientId:R.sellerId,recipientName:R.name,subtitle:"Seller",onClose:()=>W(null)}),ee&&(0,a.jsx)(q.a,{isOpen:ee,onClose:()=>es(!1),maxWidth:"480px",children:(0,a.jsxs)("div",{style:{padding:24,color:"var(--text)"},children:[(0,a.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:16},children:[(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8},children:[(0,a.jsx)(j.A,{size:20,color:"var(--primary)"}),(0,a.jsx)("h3",{style:{margin:0,fontSize:"1.2rem",fontWeight:800},children:"Filter Vehicles"})]}),(0,a.jsx)("button",{onClick:()=>es(!1),style:{background:"transparent",border:"none",color:"var(--text-muted)",cursor:"pointer"},children:(0,a.jsx)(S.A,{size:20})})]}),(0,a.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:14},children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"0.82rem",marginBottom:4},children:[(0,a.jsx)("span",{children:"Max Price"}
1),(0,a.jsxs)("strong",{children:["$",ei.toLocaleString()]})]}),(0,a.jsx)("input",{type:"range",min:5e3,max:12e4,step:2500,value:ei,onChange:e=>ea(Number(e.target.value)),style:{width:"100%"}})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"0.82rem",marginBottom:4},children:[(0,a.jsx)("span",{children:"Max Mileage"}),(0,a.jsxs)("strong",{children:[et.toLocaleString()," miles"]})]}),(0,a.jsx)("input",{type:"range",min:1e4,max:2e5,step:5e3,value:et,onChange:e=>en(Number(e.target.value)),style:{width:"100%"}})]}),(0,a.jsxs)("div",{style:{display:"flex",justifyContent:"flex-end",gap:10,marginTop:12},children:[(0,a.jsx)("button",{onClick:()=>{ea(1e5),en(15e4)},style:{padding:"8px 14px",borderRadius:10,background:"transparent",border:"1px solid rgba(255,255,255,0.2)",color:"var(--text)",cursor:"pointer"},children:"Reset"}),(0,a.jsx)("button",{onClick:()=>es(!1),style:{padding:"8px 20px",borderRadius:10,background:"var(--primary)",color:"#fff",border:"none",fontWeight:700,cursor:"pointer"},children:"Apply Filters"})]})]})]})})]})}},40590:(e,s,i)=>{"use strict";i.d(s,{A:()=>a});let a=(0,i(12119).A)("tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]])},61580:(e,s,i)=>{"use strict";i.d(s,{W:()=>m});var a=i(54568),t=i(7620),n=i(32064),l=i(12598),r=i(60844),c=i(20415),o=i(29304),d=i(90008),u=i(16325),p=i(63104),h=i(34046);let m=e=>{let{user:s,recipientId:i,recipientName:m,recipientAvatar:x,subtitle:g,pageId:v,onClose:j}=e,[f,y]=(0,t.useState)([]),[b,N]=(0,t.useState)(""),[k,S]=(0,t.useState)(!0),[w,A]=(0,t.useState)(!1),[_,C]=(0,t.useState)(null),q=(0,t.useRef)(null),z=e=>y(s=>s.some(s=>s.id===e.id)?s:[...s,e]),[I,M]=(0,t.useState)(null),[F,L]=(0,t.useState)(!v);(0,t.useEffect)(()=>{v&&d.supabase.from("pages").select("id").eq("id",v).maybeSingle().then(e=>{let{data:s}=e;M(s?v:null),L(!0)})},[v]),(0,t.useEffect)(()=>{if(!F)return;E(),I?(0,u.rU)({pageId:I,userId:s.id,asPage:!1}):(0,u.vs)(s.id,i);let e=d.supabase.channel("quick-msg-".concat(s.id,"-").concat(i)).on("postgres_changes",{event:"INSERT",schema:"consumer",table:"messages",filter:"receiver_id=eq.".concat(s.id)},e=>{let a=e.new;(I?a.page_id!==I:a.page_id||a.sender_id!==i)||(z(a),I?(0,u.rU)({pageId:I,userId:s.id,asPage:!1}):(0,u.vs)(s.id,i))}).subscribe();return()=>{d.supabase.removeChannel(e)}},[i,F,I]),(0,t.useEffect)(()=>{var e;null==(e=q.current)||e.scrollIntoView({behavior:"smooth"})},[f]);let E=async()=>{S(!0);let e=d.supabase.schema("consumer").from("messages").select("*"),{data:a,error:t}=await (I?e.eq("page_id",I).or("sender_id.eq.".concat(s.id,",receiver_id.eq.").concat(s.id)):e.is("page_id",null).or("and(sender_id.eq.".concat(s.id,",receiver_id.eq.").concat(i,"),and(sender_id.eq.").concat(i,",receiver_id.eq.").concat(s.id,")"))).order("created_at",{ascending:!0});!t&&a&&y(a),S(!1)},P=async()=>{if(!b.trim()||w)return;A(!0),C(null);let{data:e,error:a}=await (0,u.pW)({sender:{id:s.id,name:s.name},receiverId:I||i,text:b,pageId:I});a?C(a):(e&&z(e),N("")),A(!1)};return(0,a.jsxs)(h.a,{isOpen:!0,onClose:j,maxWidth:"380px",children:[(0,a.jsxs)("div",{className:"quick-message-modal glass fade-in",style:{width:"100%",boxShadow:"none",borderRadius:0,border:"none"},children:[(0,a.jsxs)("header",{className:"quick-msg-header",children:[(0,a.jsxs)("div",{className:"recipient-info",children:[(0,a.jsx)(p.e,{name:m,url:x,size:36}),(0,a.jsxs)("div",{className:"text-info",children:[(0,a.jsx)("h4",{children:m}),g&&(0,a.jsx)("span",{className:"status-indicator online",children:g})]})]}),(0,a.jsxs)("div",{style:{display:"flex",gap:8,alignItems:"center"},children:[(0,a.jsx)("button",{className:"close-quick-msg",title:"Open in Messages","aria-label":"Open in Messages",onClick:()=>{j(),(0,u.JJ)(I||i)},children:(0,a.jsx)(n.A,{size:18})}),(0,a.jsx)("button",{className:"close-quick-msg","aria-label":"Close",onClick:j,children:(0,a.jsx)(l.A,{size:20})})]})]}),(0,a.jsx)("div",{className:"quick-msg-body",children:k?(0,a.jsx)("div",{className:"msg-loading",children:(0,a.jsx)(r.A,{className:"animate-spin"})}):0===f.length?(0,a.jsxs)("div",{className:"empty-quick-msg",children:[(0,a.jsx)(c.A,{size:32}),(0,a.jsxs)("p",{children:["Start a conversation with ",(0,a.jsx)("strong",{children:m})]})]}):(0,a.jsxs)("div",{className:"quick-msg-list",children:[f.map(e=>(0,a.jsx)("div",{className:"quick-bubble ".concat(e.sender_id===s.id?"sent":"received"),children:(0,a.jsx)("div",{className:"bubble-text",children:(0,u.IL)(e)})},e.id)),(0,a.jsx)("div",{ref:q})]})}),_&&(0,a.jsx)("div",{style:{padding:"8px 16px",color:"var(--error, #ef4444)",fontSize:"0.8rem"},children:_}),(0,a.jsxs)("footer",{className:"quick-msg-footer",children:[(0,a.jsx)("input",{type:"text",placeholder:"Type your message...",value:b,onChange:e=>N(e.target.value),onKeyDown:e=>"Enter"===e.key&&P()}),(0,a.jsx)("button",{className:"send-quick-btn",onClick:P,disabled:!b.trim()||w,"aria-label":"Send",children:w?(0,a.jsx)(r.A,{className:"animate-spin",size:18}):(0,a.jsx)(o.A,{size:18})})]})]}),(0,a.jsx)("style",{children:"\n .quick-message-overlay {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: rgba(0,0,0,0.4);\n backdrop-filter: blur(4px);\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 9999;\n }\n .quick-message-modal {\n width: 380px;\n height: 500px;\n display: flex;\n flex-direction: column;\n border-radius: 20px;\n border: 1px solid rgba(255,255,255,0.1);\n overflow: hidden;\n box-shadow: 0 20px 40px rgba(0,0,0,0.4);\n }\n .quick-msg-header {\n padding: 16px;\n background: rgba(255,255,255,0.03);\n border-bottom: 1px solid rgba(255,255,255,0.05);\n display: flex;\n justify-content: space-between;\n align-items: center;\n }\n .recipient-info {\n display: flex;\n gap: 12px;\n align-items: center;\n }\n .text-info h4 { margin: 0; font-size: 0.95rem; }\n .status-indicator { font-size: 0.7rem; opacity: 0.6; display: flex; align-items: center; gap: 4px; }\n .status-indicator::before { content: ''; width: 6px; height: 6px; background: #10b981; border-radius: 50%; }\n .close-quick-msg { background: none; border: none; color: var(--text-muted); cursor: pointer; }\n\n .quick-msg-body {\n flex: 1;\n overflow-y: auto;\n padding: 16px;\n display: flex;\n flex-direction: column;\n }\n .quick-msg-list {\n display: flex;\n flex-direction: column;\n gap: 8px;\n }\n .quick-bubble {\n max-width: 80%;\n padding: 10px 14px;\n border-radius: 18px;\n font-size: 0.85rem;\n line-height: 1.4;\n }\n .quick-bubble.sent {\n align-self: flex-end;\n background: var(--store-primary, var(--primary));\n color: #fff;\n border-bottom-right-radius: 4px;\n }\n .quick-bubble.received {\n align-self: flex-start;\n background: rgba(255,255,255,0.08);\n color: var(--text);\n border-bottom-left-radius: 4px;\n }\n \n .empty-quick-msg {\n flex: 1;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n opacity: 0.5;\n text-align: center;\n padding: 40px;\n }\n\n .quick-msg-footer {\n padding: 16px;\n display: flex;\n gap: 10px;\n background: rgba(255,255,255,0.02);\n border-top: 1px solid rgba(255,255,255,0.05);\n }\n .quick-msg-footer input {\n flex: 1;\n background: rgba(255,255,255,0.05);\n border: 1px solid rgba(255,255,255,0.1);\n border-radius: 12px;\n padding: 10px 16px;\n color: #fff;\n font-size: 0.9rem;\n }\n .send-quick-btn {\n width: 40px;\n height: 40px;\n flex-shrink: 0;\n border-radius: 12px;\n background: var(--store-primary, var(--primary));\n color: white;\n border: none;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n transition: all 0.2s ease;\n }\n .send-quick-btn:hover:not(:disabled) {\n transform: scale(1.05);\n filter: brightness(1.1);\n }\n "})]})}},85271:(e,s,i)=>{"use strict";i.d(s,{A:()=>a});let a=(0,i(12119).A)("cloud-upload",[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]])},96560:()=>{}}]);
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.