1import{d as le,o as n,c as o,i as c,v as xe,w as k,h as J,e as D,a,t as y,b as ie,bo as ke,l as we,bp as Se,G as p,K as z,$ as Ce,bq as Ie,a1 as $e,aC as Le,s as Ee,u as e,az as te,br as Oe,B as A,ba as se,A as Ue,z as De,ad as Pe,j as Te,aJ as Ve,n as M,F as E,r as O,bs as We,bt as U,bu as ze,y as Ae,f as B,bv as Be,bw as Ne,bx as je,a0 as Fe,by as Re,N as qe}from"./CY6xmeCc.js";import{_ as He}from"./BsXivoQd.js";import{_ as Ge}from"./DiUBi7a7.js";import{_ as Ke,S as Me}from"./pFPSgjrM.js";import"./eZgKItK9.js";import"./Bwyd98dk.js";import"./CroYjl-l.js";import"./CG7MK3qO.js";try{let r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},g=new r.Error().stack;g&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[g]="fbe28d39-a06b-4d2d-986e-ca00dc0508cc",r._sentryDebugIdIdentifier="sentry-dbid-fbe28d39-a06b-4d2d-986e-ca00dc0508cc")}catch{}const Je={class:"flex h-full items-center gap-4 overflow-hidden md:h-20"},Ye={class:"flex flex-col gap-1"},Xe={class:"line-clamp-1 items-center text-body-sm font-bold","data-test":"title"},Qe={key:0,class:"line-clamp-1 text-body-sm text-gray-900"},Ze=le({__name:"UiCardVehicleMicro",props:{title:{type:String,required:!0},image:{type:String,required:!0},link:{type:String,required:!1},type:{type:String,required:!0},price:{type:Object,required:!0}},setup(r){return(g,N)=>{const b=He,d=xe,P=Ge;return n(),o("div",Je,[c(d,{to:r.link,class:"h-[66px] w-[88px] shrink-0"},{default:k(()=>[r.image?(n(),J(b,{key:0,image:r.image,sizes:[{width:88,height:66,query:"(min-width: 1px)"}],"aria-hidden":"true","image-class":"h-full rounded-sm",role:"presentation","fit-in":""},null,8,["image"])):D("",!0)]),_:1},8,["to"]),a("div",Ye,[a("span",Xe,y(r.title),1),r.type?(n(),o("div",Qe,y(r.type),1)):D("",!0),a("div",{class:ie([r.price?.before_discount?.formatted?` 2 flex-row-reverse justify-end gap-2 3 `:"","flex items-center"])},[c(P,{price:r.price,size:"small","disable-discount":""},null,8,["price"])],2)])])}}}),et=Object.assign(Ze,{__name:"UiCardVehicleMicro"}),tt={class:"py-10"},st={class:"container flex flex-col gap-4"},lt={key:0,class:"flex flex-wrap items-center justify-between gap-2"},it={class:"flex size-8 items-center justify-center rounded-full bg-blue-ribbon-700 font-bold text-white"},nt={class:"flex gap-2"},at={key:1,class:"flex flex-row justify-between gap-10 pb-8"},ot={class:"max-w-[800px]"},rt={class:"text-display-sm"},ct={key:0,class:"mt-4"},dt={key:1,class:"mt-4"},ut={class:"flex h-full items-center justify-center"},pt={key:0,class:"containerOffset relative overflow-hidden"},ft={class:"relative w-fit"},_t={class:"z-10 flex w-full justify-between border-b border-gray-100 bg-white py-2"},mt={class:"container flex items-center justify-end"},ht={class:"flex gap-2"},vt={class:"col-span-full"},gt=["onClick"],yt={class:"text-display-sm"},bt={key:1,class:"container flex items-center justify-center py-20"},xt=le({__name:"compare",async setup(r){let g,N;const b=ke(),{t:d,localeProperties:P}=we(),{vehicleCompareURL:ne}=Se(),f=p(b.compareList??[]);z(()=>b.compareList,s=>{f.value=s});const{data:w,execute:ae,pending:oe}=([g,N]=Ce(()=>Fe(()=>ne(),{query:{id:f},watch:!1,immediate:!1,onResponseError:({response:s})=>{if(s.status===404){const{found:t,not_found:l}=s._data;t.length>=1?b.setCompareList(t):t.length===0&&b.setCompareList([]),l.length>=1&&Re({message:d("vehicle.compare.notifications.existing_deleted",{amount:l.length}),type:"warning"})}},key:"compare"},"$JrJFPY6Xjc")),g=await g,N(),g);function re(){f.value.length>=2&&ae()}z(f,()=>{re()},{immediate:!0});const T=p(!0);function ce(s){return!s||s.length<=1?!1:s.some(t=>t!==s[0])}const Y=B(()=>{if(!w?.value?.sections)return[];function s(t){if(t==="condition.odometer.value_in_km"){const l=[],u=[];return w?.value?.vehicles?.forEach(_=>{_?.region_specific?.nl?.nap_weblabel?(l.push({src:"/images/mileageVerification/nap-checked.webp",alt:"Nationale Auto Pas",width:48,height:18}),u.push(!0)):_?.region_specific?.be?.car_pass&&_?.region_specific?.be?.car_pass_url?(l.push({src:"/images/mileageVerification/car-pass.webp",alt:"Car-pass",width:83,height:18,url:_?.region_specific?.be?.car_pass_url}),u.push(!0)):(l.push(null),u.push(!1))}),{images:l,sideBySide:u}}return{}}return w?.value?.sections?.map(t=>({category:t.title,fields:t.subsections.reduce((l,u)=>u.fields?[...l,...u.fields.map(_=>{const $=s(_.key);return{label:_.label,values:_.vehicles.map(K=>K.display_value),...$}})]:l,[])})).map(t=>T.value?{...t,fields:t.fields.filter(l=>ce(l.values))}:t).filter(t=>t.fields.length>0)}),{stockSlug:X}=Ie(),Q=$e(),V=B(()=>{const s=w?.value?.vehicles?Be(w?.value?.vehicles,Q.stock.locationDisplayFields,P.value.language??P.value.code,void 0,Q.stock.showPkwEnvkvImageAltSuffix,d):[];return s?s.map(t=>{const l=[`${t.id}-${t.slug}`].join("/");return new Ne({...t,detailLink:l})}):[]}),m=p([0]);function de(s){m.value.includes(s)?m.value=m.value.toSpliced(m.value.indexOf(s),1):m.value=[...m.value,s]}
3const h=p(),Z=p(),S=p(),C=p(),j=p(0),F=p(0),R=p(0),q=p(!1),I=B(()=>({slideWidth:S.value?.length?S.value[0]?.clientWidth:0,slideHeight:S.value?.length?S.value[0]?.clientHeight:0})),ee=p(!1);z([h,Z,ee],([s,t,l])=>{s&&t&&!l&&(ee.value=!0,H(0),t.scrollLeft=s.scrollLeft,s.addEventListener("scroll",()=>ue(s,t)))});function ue(s,t){const l=s.scrollLeft;t.scrollLeft=l,H(l)}const{width:pe}=je();z(pe,()=>{h.value.scrollLeft>0?h.value.scrollLeft=0:H(0)});function H(s){j.value=Math.ceil((C.value.clientWidth-s-h.value.clientWidth)/I.value.slideWidth),F.value=C.value.clientWidth-h.value.clientWidth-s,R.value=C.value.clientWidth-h.value.clientWidth,q.value=C.value.clientWidth-h.value.clientWidth>0}function W(s){const t=h.value,l=s==="left"?t.scrollLeft<I.value.slideWidth?I.value.slideWidth*-1:t.scrollLeft-I.value.slideWidth:t.scrollLeft+I.value.slideWidth;t.scrollTo({left:l,behavior:"smooth"})}const fe=Le(),G=B(()=>`grid-template-columns: repeat(${V.value?.length},320px)`);function _e(s){return fe(`/${[X.value,s].join("/")}`)}return(s,t)=>{const l=Ee("i18n-t"),u=Oe,_=Ue,$=Te,K=De,me=et,he=Ke,ve=Ve,ge=We,ye=ze;return n(),o("div",tt,[c(e(Ae),{"config-file":"true"},{default:k(()=>[a("div",st,[e(f)?.length>1?(n(),o("div",lt,[c(l,{class:"whitespace-no-wrap flex items-center gap-2 text-display-sm",keypath:"vehicle.compare.title",tag:"h2"},{default:k(()=>[a("div",it,y(e(f)?.length),1)]),_:1}),te(a("div",null,[a("div",nt,[c(u,{disabled:e(F)===e(R),label:e(d)("slider.button.label.previous"),variant:e(A).GHOST,icon:"lucide:chevron-left",size:"small",onClick:t[0]||(t[0]=i=>W("left"))},null,8,["disabled","label","variant"]),c(u,{disabled:e(j)===0,label:e(d)("slider.button.label.next"),variant:e(A).GHOST,icon:"lucide:chevron-right",size:"small",onClick:t[1]||(t[1]=i=>W("right"))},null,8,["disabled","label","variant"])])],512),[[se,e(q)]])])):(n(),o("div",at,[a("div",ot,[a("h1",rt,y(e(d)("vehicle.compare.empty.title")),1),e(f).length===1?(n(),o("p",ct,y(e(d)("vehicle.compare.empty.description_not_enough")),1)):(n(),o("p",dt,y(e(d)("vehicle.compare.empty.description_none")),1)),c(_,{label:e(d)("vehicle.compare.empty.cta"),to:`/${e(X)}`,class:"mt-8"},null,8,["label","to"])])])),e(f)?.length>1?(n(),J(K,{key:2,id:"compare-only-differences",modelValue:e(T),"onUpdate:modelValue":t[2]||(t[2]=i=>Pe(T)?T.value=i:null),config:{classes:{outer:"!mb-0",wrapper:"!mb-0",label:"!mb-0"}},label:e(d)("vehicle.compare.only_differences"),class:"mt-4",name:"compare-only-differences",type:"checkbox"},{decoratorIcon:k(()=>[a("div",ut,[c($,{name:"lucide:check"})])]),_:1},8,["modelValue","label"])):D("",!0)]),e(V).length&&e(f)?.length>1?(n(),o("div",pt,[c(ve,null,{default:k(()=>[c(he,{position:e(Me).TOP,threshold:300,class:"left-0"},{default:k(()=>[a("div",{ref_key:"stickyBar",ref:Z,class:"containerOffset pointer-events-none scroll-px-6 overflow-hidden bg-white pr-6 sm:scroll-px-0 sm:pr-4"},[a("div",ft,[a("div",{style:M(e(G)),class:"grid w-full gap-6 py-4"},[(n(!0),o(E,null,O(e(V),i=>(n(),o("div",{key:i.id,class:"snap-start"},[c(me,{image:i.image.src,link:_e(`${i.id}-${i.slug}`),price:i.price.purchase,title:i.title,type:i.type},null,8,["image","link","price","title","type"])]))),128))],4)])],512),a("div",_t,[te(a("div",mt,[a("div",ht,[c(u,{disabled:e(F)===e(R),label:e(d)("slider.button.label.previous"),variant:e(A).GHOST,icon:"lucide:chevron-left",size:"small",onClick:t[3]||(t[3]=i=>W("left"))},null,8,["disabled","label","variant"]),c(u,{disabled:e(j)===0,label:e(d)("slider.button.label.next"),variant:e(A).GHOST,icon:"lucide:chevron-right",size:"small",onClick:t[4]||(t[4]=i=>W("right"))},null,8,["disabled","label","variant"])])],512),[[se,e(q)]])])]),_:1},8,["position"])]),_:1}),a("div",{ref_key:"gridContainer",ref:h,class:"flex snap-x scroll-px-6 gap-6 overflow-x-scroll pr-6 sm:scroll-px-0 sm:pr-4"},[a("div",{ref_key:"scroller",ref:C,style:M(e(G)),class:"grid w-fit gap-6 py-4"},[(n(!0),o(E,null,O(e(V),i=>(n(),o("div",{key:i.id,ref_for:!0,ref_key:"section",ref:S,class:"snap-start"},[c(ge,{"price-display":[e(U).PURCHASE,e(U).PRIVATE_LEASE,e(U).BUSINESS_LEASE,e(U).PRIVATE_FINANCE,e(U).BUSINESS_FINANCE],vehicle:i},null,8,["price-display","vehicle"])]))),128)),a("div",vt,[(n(!0),o(E,null,O(e(Y),(i,x)=>(n(),o("div",{key:i.category,class:ie([{"border-b border-gray-100":x<e(Y).length-1&&!e(m).includes(x)},"py-6"])},[a("button",{class:"sticky left-0 flex flex-row items-center gap-2 whitespace-nowrap",onClick:v=>de(x)},[c($,{name:`lucide:${e(m).includes(x)?"minus":"plus"}`},null,8,["name"]),a("h4",yt,y(i.category),1)],8,gt),i.fields&&e(m).includes(x)?(n(!0),o(E,{key:0},O(i.fields,v=>(n(),o("div",{key:`${v?.label}-${x}`,style:M(e(G)),class:"grid gap-6 pt-4"},[(n(!0),o(E,null,O(v?.values,(be,L)=>(n(),J(ye,{key:`${v?.label}-${L}`,image:v?.images?.[L],label:v?.label,"side-by-side":v?.sideBySide?.[L],tooltip:v?.field_tooltip?.[L],url:v?.url?.[L],value:be},null,8,["image","label","side-by-side","tooltip","url","value"]))),128))],4))),128)):D("",!0)],2))),128))])],4)],512)])):e(oe)&&e(f)?.length>1?(n(),o("div",bt,[c($,{class:"animate-spin",name:"lucide:loader",size:"64"})])):D("",!0)]),_:1})])}}}
3),Ot=qe(xt,[["__scopeId","data-v-6624b4cd"]]);export{Ot 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.