import{d as z,k as K,H as ee,G as B,o,n as I,w as S,a as b,V as ue,b as V,c as g,F as A,j as R,t as $,e as T,A as D,l as U,f as Se,_ as H,S as Ve,r as E,x as be,B as q,a4 as de,I as Oe,a2 as Ce,a5 as Te,a6 as we,a7 as Fe,a8 as Ie,a9 as Pe,N as je,Y as ne,z as Le,a1 as Ae,Q as ce,X as Re,m as ve,M as Ee,J as Me,K as Ne,aa as De}from"./index-207e8178.js";import{F as me,_ as Be}from"./VDataIterator-fa50b4b0.js";import{u as te}from"./programStore-a9779e15.js";import{P as Ue,e as ze}from"./ProgramAttributes-d3a75b34.js";import{P as qe,a as Ke}from"./EventActions-9062df64.js";import{P as He}from"./EventNames-6f9cd989.js";import{s as L,f as ye,h as xe}from"./checkTypingFunction-087f80ba.js";import{m as Ge,u as Je,a as Ze,V as We,b as pe,g as he,T as ae}from"./Tooltip-b1f0fbee.js";import{m as Xe,c as Qe,u as Ye,d as ge,e as et,a as _e,b as $e}from"./VTextField-b712f4db.js";import{V as le}from"./VCheckbox-6837210d.js";import{s as ie,c as fe}from"./string-79822fd4.js";const tt={id:"search-query-summary"},at={id:"result-and-argument-summary"},lt={id:"filters-summary"},nt={key:0},it=z({__name:"ProgramResultStatus",props:{pageStart:Number,pageStop:Number,total:Number},setup(e){const f=K("$piwik"),u=te(),{query:t}=ee(u),v=[{title:"Relevantie",value:null},{title:"Naam opleiding (A-Z)",value:{veld:"titel",type:"asc"}},{title:"Naam opleiding (Z-A)",value:{veld:"titel",type:"desc"}},{title:"Naam opleider (A-Z)",value:{veld:"opleider_naam",type:"asc"}},{title:"Naam opleider (Z-A)",value:{veld:"opleider_naam",type:"desc"}},{title:"Tijd (kort-lang)",value:{veld:"studieduur_dagen",type:"asc"}},{title:"Tijd (lang-kort)",value:{veld:"studieduur_dagen",type:"desc"}},{title:"Dichtbij",value:{veld:"locatie",type:"asc"},disabled:!0,conditionKey:"location",disabledTooltipText:"Vul eerst een plaats of postcode in bij het filter 'Locatie' om op afstand te kunnen sorteren."}],m=B(()=>v.map(l=>{var i,d;return l.conditionKey&&(l.conditionKey==="location"?l.disabled=!((i=t.value[l.conditionKey])!=null&&i.search_term)||((d=t.value[l.conditionKey])==null?void 0:d.distance)===0:l.disabled=!t.value[l.conditionKey]),l})),h=B(()=>[{text:"Thema",id:"chip-thema",active:t.value.thema.length>0,clickMethod:()=>{t.value.thema=[],p("thema")}},{text:"Niveau",id:"chip-niveau",active:t.value.niveau.length>0,clickMethod:()=>{t.value.niveau=[],p("niveau")}},{text:"Locatie",id:"chip-locatie",active:t.value.location.search_term!==""&&t.value.location.distance>0,clickMethod:n},{text:"Tijd",id:"chip-studieduur",active:t.value.studieduur_dagen!==null,clickMethod:()=>{t.value.studieduur_dagen=null,p("tijd")}},{text:"Soort diploma",id:"chip-diploma",active:t.value.soort_diploma.length>0,clickMethod:()=>{t.value.soort_diploma=[],p("soort-diploma")}},{text:"Keurmerk",id:"chip-keurmerk",active:t.value.keurmerk.length>0,clickMethod:()=>{t.value.keurmerk=[],p("keurmerk")}},{text:"Leervorm",id:"chip-e-learning",active:t.value.elearning.length>0,clickMethod:()=>{t.value.elearning=[],p("leervorm")}},{text:"Leerweg",id:"chip-leertraject",active:t.value.leertraject.length>0,clickMethod:()=>{t.value.leertraject=[],p("leerweg")}},{text:"Taal",id:"chip-taal",active:t.value.instructietaal.length>0,clickMethod:()=>{t.value.instructietaal=[],p("taal")}}]),y=B(()=>({text:t.value.zoekargument.trim(),id:"searchargumentchip",active:!0,clickMethod:()=>t.value.zoekargument=""})),w=B(()=>[t.value.elearning.length>0,t.value.instructietaal.length>0,t.value.keurmerk.length>0,t.value.leertraject.length>0,t.value.niveau.length>0,t.value.location.search_term!==""&&t.value.location.distance>0,t.value.soort_diploma.length>0,t.value.studieduur_dagen!==null,t.value.thema.length>0].some(i=>i)),p=l=>{f("results","filter",`delete-${l}`)},n=()=>{var l;t.value.location.distance=0,t.value.location.search_term="",((l=t.value.sorteren)==null?void 0:l.veld)==="locatie"&&(t.value.sorteren=null),p("locatie")};return(l,i)=>(o(),I(Se,{id:"status-component-opleidingen",class:"no-gutters",amount:e.total},{default:S(()=>[b(ue,{cols:"12",sm:"12",md:"9",lg:"9"},{default:S(()=>[V("p",tt,[V("span",at,[e.total?(o(),g(A,{key:0},[R(" Resultaten "+$(e.pageStart)+" - "+$(e.pageStop)+" van "+$(e.total),1)],64)):(o(),g(A,{key:1},[R(" Geen resultaten ")],64)),T(t).zoekargument.trim()?(o(),g(A,{key:2},[R(" voor "),y.value?(o(),I(me,{onClick:i[0]||(i[0]=d=>p(y.value.text)),key:y.value.id,chip:y.value},null,8,["chip"])):D("",!0)],64)):D("",!0)]),V("span",lt,[w.value?(o(),g(A,{key:0},[y.value?(o(),g("span",nt," ")):D("",!0),R(" gefilterd door ")],64)):D("",!0),(o(!0),g(A,null,U(h.value,d=>(o(),I(me,{onClick:O=>p(d.text),key:d.id,chip:d},null,8,["onClick","chip"]))),128))])])]),_:1}),b(ue,{cols:"12",sm:"12",md:"3",lg:"3"},{default:S(()=>[b(Be,{modelValue:T(t).sorteren,"onUpdate:modelValue":i[1]||(i[1]=d=>T(t).sorteren=d),items:m.value},null,8,["modelValue","items"])]),_:1})]),_:1},8,["amount"]))}});const oa=H(it,[["__scopeId","data-v-b9f31c97"]]),ot=["id","cy-data-cards"],st={key:0,class:"pb-3"},rt={key:1,class:"pb-3"},ut=["id"],dt=["id"],ct={key:2,class:"d-flex align-start"},vt=["onClick"],mt=["id"],pt=["id"],ht={key:0,role:"text"},gt={key:1,role:"text"},ft={key:0,role:"text",class:"long-description"},kt={key:1,role:"text"},bt={class:"more-detail pt-5 mt-3 mx-n5 px-5 mx-lg-n7 px-lg-7"},yt=["id","aria-expanded","aria-controls"],xt=["id"],_t=z({__name:"ProgramCard",props:{program:{type:Object,required:!0},cardIndex:{type:Number,required:!0},open:{type:Boolean,default:!1}},emits:["toggleOpen"],setup(e,{emit:f}){const u=e,t=K("$piwik"),{logLevel:v}=Ve(),m=E(null),h=E(Object.keys(u.program.tijdsbesteding_variants)[0]),y=O=>{h.value=O},w=O=>{O&&t("results","navigate",O)},p=()=>{u.open&&m.value&&Ce(()=>{m.value.setAttribute("tabindex","-1"),m.value.focus()})},n=O=>{f("toggleOpen",O),t(qe.Results,Ke.Click,He.ResultCardMoreInfoToggle)},l=B(()=>`${u.program.internal_id}-${encodeURIComponent(u.program.titel).replace(/%20/g,"+")}`),i=(O,k)=>{const x=ze(O,k);return x.beschrijving??x.korte_beschrijving},d=B(()=>u.program.korte_beschrijving.trim());return(O,k)=>{const x=be("router-link");return o(),g("div",{class:"program-card background-white pa-5 pa-lg-7",id:`program-card-${e.cardIndex}`,"cy-data-cards":e.cardIndex},[T(v)?(o(),g("pre",st,$(e.program.source),1)):D("",!0),T(v)?(o(),g("pre",rt,$(e.program.external_id),1)):D("",!0),b(x,{onClick:k[0]||(k[0]=c=>w(`${l.value}`)),class:"program-card-header-link text-primary",to:{name:"leren-opleiding",params:{id:l.value}}},{default:S(()=>[V("h3",{id:`item-title-${e.cardIndex}`},$(e.program.titel),9,ut),V("p",{id:`item-organisation-${e.cardIndex}`},$(e.program.opleider_naam),9,dt)]),_:1},8,["to"]),e.open&&e.program.tijdsbesteding_variants&&Object.keys(e.program.tijdsbesteding_variants).length>1?(o(),g("div",ct,[(o(!0),g(A,null,U(Object.keys(e.program.tijdsbesteding_variants),c=>(o(),g("button",{key:c,class:q(["btn-variant flex-fill text-button mb-4",{active:h.value===c}]),onClick:a=>y(c)},$(c),11,vt))),128))])):D("",!0),V("div",{id:`item-content-${e.cardIndex}`},[V("p",{id:`item-desc-${e.cardIndex}`,ref_key:"itemDesc",ref:m},[d.value===i(e.program,h.value).trim().substring(0,d.value.length)?(o(),g("span",{key:0,role:"text",class:q(e.open&&"long-description")},[R($(d.value)+" ",1),b(de,{name:"fade",mode:"out-in",onAfterEnter:p},{default:S(()=>[e.open?(o(),g("span",ht,$(i(e.program,h.value).substring(d.value.length)),1)):D("",!0)]),_:1})],2)):(o(),g("span",gt,[b(de,{name:"fade",mode:"out-in",onAfterEnter:p},{default:S(()=>[e.open?(o(),g("span",ft,$(i(e.program,h.value)),1)):(o(),g("span",kt,$(d.value),1))]),_:1})]))],8,pt),b(Ue,{program:e.program,"is-open":e.open,selectedVariant:h.value,cardIndex:e.cardIndex},null,8,["program","is-open","selectedVariant","cardIndex"])],8,mt),V("div",bt,[V("button",{class:"more-detail-button",onClick:k[1]||(k[1]=c=>n(e.program.internal_id)),id:"info-button-"+e.cardIndex,"aria-expanded":e.open,"aria-controls":`item-content-${e.cardIndex}`},[V("span",{id:"info-button-"+e.cardIndex+"-text"},$(e.open?"Toon minder informatie":"Meer over deze opleiding"),9,xt),b(Oe,{icon:"caret-down",class:q({rotated:e.open})},null,8,["class"])],8,yt)])],8,ot)}}});const sa=H(_t,[["__scopeId","data-v-570e53c9"]]),$t=Te({...Xe(),...Qe(),...Ge(),strict:Boolean,modelValue:{type:Array,default:()=>[0,0]}},"VRangeSlider"),St=we()({name:"VRangeSlider",props:$t(),emits:{"update:focused":e=>!0,"update:modelValue":e=>!0,end:e=>!0,start:e=>!0},setup(e,f){let{slots:u,emit:t}=f;const v=E(),m=E(),h=E(),{rtlClasses:y}=Fe();function w(P){if(!v.value||!m.value)return;const j=he(P,v.value.$el,e.direction),F=he(P,m.value.$el,e.direction),C=Math.abs(j),M=Math.abs(F);return C<M||C===M&&j<0?v.value.$el:m.value.$el}const p=Je(e),n=Ie(e,"modelValue",void 0,P=>P!=null&&P.length?P.map(j=>p.roundValue(j)):[0,0]),{activeThumbRef:l,hasLabels:i,max:d,min:O,mousePressed:k,onSliderMousedown:x,onSliderTouchstart:c,position:a,trackContainerRef:r}=Ze({props:e,steps:p,onSliderStart:()=>{t("start",n.value)},onSliderEnd:P=>{var C;let{value:j}=P;const F=l.value===((C=v.value)==null?void 0:C.$el)?[j,n.value[1]]:[n.value[0],j];!e.strict&&F[0]<F[1]&&(n.value=F),t("end",n.value)},onSliderMove:P=>{var M,J,Z,N;let{value:j}=P;const[F,C]=n.value;!e.strict&&F===C&&F!==O.value&&(l.value=j>F?(M=m.value)==null?void 0:M.$el:(J=v.value)==null?void 0:J.$el,(Z=l.value)==null||Z.focus()),l.value===((N=v.value)==null?void 0:N.$el)?n.value=[Math.min(j,C),C]:n.value=[F,Math.max(F,j)]},getActiveThumb:w}),{isFocused:s,focus:_,blur:G}=Ye(e),se=B(()=>a(n.value[0])),re=B(()=>a(n.value[1]));return Pe(()=>{const P=ge.filterProps(e),j=!!(e.label||u.label||u.prepend);return b(ge,je({class:["v-slider","v-range-slider",{"v-slider--has-labels":!!u["tick-label"]||i.value,"v-slider--focused":s.value,"v-slider--pressed":k.value,"v-slider--disabled":e.disabled},y.value,e.class],style:e.style,ref:h},P,{focused:s.value}),{...u,prepend:j?F=>{var C,M;return b(A,null,[((C=u.label)==null?void 0:C.call(u,F))??(e.label?b(et,{class:"v-slider__label",text:e.label},null):void 0),(M=u.prepend)==null?void 0:M.call(u,F)])}:void 0,default:F=>{var J,Z;let{id:C,messagesId:M}=F;return b("div",{class:"v-slider__container",onMousedown:x,onTouchstartPassive:c},[b("input",{id:`${C.value}_start`,name:e.name||C.value,disabled:!!e.disabled,readonly:!!e.readonly,tabindex:"-1",value:n.value[0]},null),b("input",{id:`${C.value}_stop`,name:e.name||C.value,disabled:!!e.disabled,readonly:!!e.readonly,tabindex:"-1",value:n.value[1]},null),b(We,{ref:r,start:se.value,stop:re.value},{"tick-label":u["tick-label"]}),b(pe,{ref:v,"aria-describedby":M.value,focused:s&&l.value===((J=v.value)==null?void 0:J.$el),modelValue:n.value[0],"onUpdate:modelValue":N=>n.value=[N,n.value[1]],onFocus:N=>{var W,X,Q,Y;_(),l.value=(W=v.value)==null?void 0:W.$el,n.value[0]===n.value[1]&&n.value[1]===O.value&&N.relatedTarget!==((X=m.value)==null?void 0:X.$el)&&((Q=v.value)==null||Q.$el.blur(),(Y=m.value)==null||Y.$el.focus())},onBlur:()=>{G(),l.value=void 0},min:O.value,max:n.value[1],position:se.value,ripple:e.ripple},{"thumb-label":u["thumb-label"]}),b(pe,{ref:m,"aria-describedby":M.value,focused:s&&l.value===((Z=m.value)==null?void 0:Z.$el),modelValue:n.value[1],"onUpdate:modelValue":N=>n.value=[n.value[0],N],onFocus:N=>{var W,X,Q,Y;_(),l.value=(W=m.value)==null?void 0:W.$el,n.value[0]===n.value[1]&&n.value[0]===d.value&&N.relatedTarget!==((X=v.value)==null?void 0:X.$el)&&((Q=m.value)==null||Q.$el.blur(),(Y=v.value)==null||Y.$el.focus())},onBlur:()=>{G(),l.value=void 0},min:n.value[0],max:d.value,position:re.value,ripple:e.ripple},{"thumb-label":u["thumb-label"]})])}})}),{}}}),Vt={class:"mt-10 mb-1 studieduur-slider"},Ot=z({__name:"StudieduurSlider",setup(e){const f=K("$piwik"),u=te(),{query:t}=ee(u),v=E([0,L.length-1]),m=E(`${L[0].text} tot en met ${L[L.length-1].text}`),h={0:"",1:"",2:"dagen",3:"",4:"",5:"weken",6:"",8:"maanden",9:"",10:"",11:"jaren",12:"",13:""},y=n=>{const l=L.findIndex(d=>d.min===n.min),i=L.findIndex(d=>d.max===n.max);return[l!==-1?l:0,i!==-1?i:L.length-1]};ne(()=>t.value,n=>{n.studieduur_dagen&&w(y(n.studieduur_dagen))});const w=([n,l])=>{const i=L[n],d=L[l];v.value=[n,l],m.value=`${i.text} tot en met ${d.text}`,t.value.studieduur_dagen={min:i.min,max:d.max}},p=([n,l])=>{const i=L[n],d=L[l];f("results","filter",`studieduur-${i.min}-${d.max}`)};return(n,l)=>(o(),g("div",Vt,[b(St,{ticks:h,modelValue:v.value,"onUpdate:modelValue":l[0]||(l[0]=i=>v.value=i),min:"0",max:"13",step:1,"show-ticks":"always","thumb-label":"always","tick-size":"5","aria-label":"invoer slider studieduur",hint:m.value,"persistent-hint":"","thumb-size":"16",color:"cta_blue","track-color":"tertiary",onEnd:l[1]||(l[1]=([i,d])=>{p([i,d]),w([i,d])})},{"thumb-label":S(i=>[R($(T(L)[i.modelValue].text),1)]),_:1},8,["modelValue","hint"])]))}});const ra=H(Ot,[["__scopeId","data-v-f53228a3"]]),oe=z({__name:"ProgramFilterLink",props:{option:{},name:{},checkboxId:{}},setup(e){const f=e,u=v=>{var m;v.preventDefault(),(m=document.getElementById(f.checkboxId))==null||m.click()},t=()=>{var v,m,h;return((m=(v=f.option)==null?void 0:v.children)==null?void 0:m.length)!==void 0&&f.option.children.length>0?(((h=f.option.children)==null?void 0:h.map(y=>ie(y.value)).concat(f.option.value))??[]).join(","):ie(f.option.value)};return(v,m)=>{const h=be("RouterLink");return o(),I(h,{to:{name:"leren-zoeken",query:{[v.name]:t()}},class:"filter_label text-decoration-none",onClick:m[0]||(m[0]=y=>u(y)),id:`${v.name}-${T(ie)(v.option.value)}`},{default:S(()=>[Le(v.$slots,"default")]),_:3},8,["to","id"])}}}),Ct={class:"filter-flex-container"},Tt=["id"],wt={class:"hit-count"},Ft=["id"],ke=26,It=3,Pt=z({__name:"ProgramFilterListColumn",props:{minimumDisplayedItems:Number,categoryTitle:String,filterOptions:{type:Array,default:()=>[]},modelValue:{type:[Number,Array,String,Boolean,Object],required:!0},selectedOptionStoreField:{type:String,required:!0},showFullOption:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e,{emit:f}){const u=e,t=K("$piwik"),v=te(),{filterCounts:m}=ee(v);ne(m,k=>{y.value=k[u.selectedOptionStoreField]},{deep:!0});const h=E(!1),y=E(m.value[u.selectedOptionStoreField]),w=(k,x)=>{t("results","filter",`${x}`),f("update:modelValue",k)},p=(k,x)=>(h.value?"opties-alle-":"opties-minder-")+x+"-"+u.categoryTitle,n=k=>k.replace(" ","").length>=ke+It&&!u.showFullOption,l=(k,x)=>k.substring(0,x)+"...",i=k=>{const x=y.value.find(c=>c.key===k.value||c.key===k.value.toString());return x?`(${x.count})`:"(0)"},d=B(()=>{if(u.minimumDisplayedItems!==void 0&&!h.value){const k=y.value.sort((r,s)=>r.count-s.count).map(r=>r.key).reverse(),c=[...u.filterOptions].filter(r=>!r.onlyShowWhenExpanded).sort((r,s)=>k.indexOf(r.value.toString())-k.indexOf(s.value.toString())).slice(0,u.minimumDisplayedItems).sort((r,s)=>r.text.localeCompare(s.text)),a=c.findIndex(r=>r.value==="Opleidingen zonder thema");return c.push(c.splice(a,1)[0]),c}else return u.filterOptions}),O=()=>{h.value=!h.value};return(k,x)=>(o(),g("div",Ct,[b($e,null,{default:S(()=>[b(Ae,{name:"list",tag:"div"},{default:S(()=>[(o(!0),g(A,null,U(d.value,(c,a)=>(o(),I(_e,{class:"list-item",density:"compact",lines:"one",key:c.value,id:p(c,a)},{default:S(()=>[V("div",{class:q(c.class?c.class:"")},[b(le,{"onClick:prevent":x[0]||(x[0]=ce(()=>{},["self"])),dense:"",color:"cta_blue",modelValue:e.modelValue,value:c.value,"onUpdate:modelValue":r=>{w(r,c.text)},id:e.categoryTitle+"-"+c.value},{label:S(()=>[n(c.text)?(o(),I(ae,{key:0,tooltipText:c.text,tip:l(c.text,ke),index:a,count:i(c),labelId:"checkboxLabel-"+a+"-"+e.categoryTitle},null,8,["tooltipText","tip","index","count","labelId"])):T(ye)(c.text)?(o(),I(ae,{key:1,tooltipText:T(xe)(c.text),tip:c.text,index:a,count:i(c),labelId:"checkboxLabel-"+a+"-"+e.categoryTitle},null,8,["tooltipText","tip","index","count","labelId"])):(o(),g("span",{key:2,class:"mainFilterColor",id:"checkboxLabel-"+a+"-"+e.categoryTitle},[b(oe,{name:e.selectedOptionStoreField,option:c,"checkbox-id":`${u.categoryTitle}-${c.value}`},{default:S(()=>[R($(c.text),1)]),_:2},1032,["name","option","checkbox-id"]),V("span",wt,$(i(c)),1)],8,Tt))]),_:2},1032,["modelValue","value","onUpdate:modelValue","id"])],2)]),_:2},1032,["id"]))),128))]),_:1})]),_:1}),e.minimumDisplayedItems?(o(),g("a",{key:0,style:{"z-index":"10"},href:"#","onClick:prevent":x[1]||(x[1]=ce(()=>{},["self"])),id:e.categoryTitle+"-optionsToggle",class:"expander",onClick:O},$(h.value?"Minder opties":"Alle opties"),41,Ft)):D("",!0)]))}});const ua=H(Pt,[["__scopeId","data-v-23c3268c"]]),jt={class:"filter-flex-container"},Lt={class:"list-header"},At=["id"],Rt={class:"hit-count"},Et=z({__name:"ProgramFilterListColumnHeadered",props:{categoryTitle:String,filterOptions:{type:Array,default:()=>[]},modelValue:{type:[Number,Array,String,Boolean,Object],required:!0},selectedOptionStoreField:{type:String,required:!0},showFullOption:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e,{emit:f}){const u=e,t=K("$piwik"),v=te(),{filterCounts:m}=ee(v),h=E(m.value[u.selectedOptionStoreField]);ne(m,p=>{h.value=p[u.selectedOptionStoreField]},{deep:!0});const y=(p,n)=>{t("results","filter",`${n}-${p}`),f("update:modelValue",p)},w=p=>{const n=h.value.find(l=>l.key===p.value||l.key===p.value.toString());return n?`(${n.count})`:"(0)"};return(p,n)=>(o(),g("div",jt,[(o(!0),g(A,null,U(e.filterOptions,l=>(o(),I($e,{key:l.header},{default:S(()=>[V("h3",Lt,$(l.header),1),(o(!0),g(A,null,U(l.options,(i,d)=>(o(),I(_e,{lines:"one",key:i.value,id:d+"-"+l.header+"-"+e.categoryTitle},{default:S(()=>{var O;return[V("div",null,[b(le,{href:"#",color:"cta_blue",modelValue:e.modelValue,value:i.value,"onUpdate:modelValue":n[0]||(n[0]=k=>{y(k,e.modelValue)}),class:q(i.class?i.class:""),id:`checkbox-${d}-${(O=e.categoryTitle)==null?void 0:O.replace(" ","_")}-${i.value.replace(" ","_")}`,"hide-details":""},{label:S(()=>[T(ye)(i.text)?(o(),I(ae,{key:0,tooltipText:T(xe)(i.text),tip:T(fe)(i.text),index:d,count:w(i),labelId:"checkboxLabel-"+d+"-"+l.header+"-"+e.categoryTitle},null,8,["tooltipText","tip","index","count","labelId"])):(o(),g("span",{key:1,class:"mainFilterColor",id:"checkboxLabel-"+d+"-"+l.header+"-"+e.categoryTitle},[R($(T(fe)(i.text))+" ",1),V("span",Rt,$(w(i)),1)],8,At))]),_:2},1032,["modelValue","value","class","id"])])]}),_:2},1032,["id"]))),128))]),_:2},1024))),128))]))}});const da=H(Et,[["__scopeId","data-v-505f6f25"]]),Mt={class:"treeview"},Nt={class:"list-item"},Dt={class:"flex"},Bt=["id"],Ut=["id"],zt={class:"treeview-children"},qt={class:"list-item list-item-child"},Kt=["id"],Ht=["id"],Gt=z({__name:"ProgramFilterTree",props:{categoryTitle:String,filterOptions:{type:Array,default:()=>[]},selectedOptionStoreField:{type:String,required:!0}},setup(e){const f=e,u=te(),{query:t,filterCounts:v}=ee(u),m=K("$piwik"),h=E([]),y=E(v.value[f.selectedOptionStoreField]);Re(()=>{h.value=f.filterOptions,w(),h.value.forEach(a=>{a.parentExpanded=!1})}),ne(v,a=>{y.value=JSON.parse(JSON.stringify(a[f.selectedOptionStoreField])),w()},{deep:!0});const w=()=>{h.value.forEach(a=>{if(a.children)a.children.forEach(r=>{const s=y.value.find(_=>_.key===r.value);r.count=s?s.count:0}),a.count=a.children.reduce((r,s)=>r+(s.count??0),0);else{const r=y.value.find(s=>s.key===a.value);a.count=r?r.count:0}})},p=a=>{t.value.niveau.includes(a.value)||t.value.niveau.push(a.value)},n=a=>{const r=t.value.niveau.indexOf(a.value,0);r>-1&&t.value.niveau.splice(r,1)},l=a=>a.children?a.children.some(r=>t.value.niveau.includes(r.value))&&!i(a.children):!1,i=a=>a.filter(s=>t.value.niveau.includes(s.value)).length==a.length,d=a=>{m("results","filter",`${a.text}-${a.value}`),a.children&&(a.parentExpanded||(a.parentExpanded=!0),a.children.some(x)?i(a.children)||t.value.niveau.includes(a.value)?a.children.forEach(r=>{n(r)}):a.children.forEach(r=>{p(r)}):a.children.forEach(r=>{p(r)}))},O=a=>{const r=h.value.find(s=>s.children?s.children.some(_=>_===a):!1);r&&k(r)},k=a=>{a.children&&(!t.value.niveau.includes(a.value)&&i(a.children)?p(a):t.value.niveau.includes(a.value)&&!a.children.some(x)&&n(a))},x=a=>t.value.niveau.includes(a.value),c=a=>{a.parentExpanded=!a.parentExpanded};return(a,r)=>(o(),g("div",Mt,[(o(!0),g(A,null,U(h.value,s=>(o(),g("ul",{key:s.value,class:"pa-0"},[V("li",Nt,[V("div",Dt,[s.children?(o(),I(Ee,{key:0,id:"toggle-"+s.value,class:"expander",onClick:_=>c(s),depressed:"",rounded:"","aria-label":s.parentExpanded?"sluit lijst":"open lijst"},{default:S(()=>[s.parentExpanded?(o(),I(ve,{key:0},{default:S(()=>[R("mdi-menu-right")]),_:1})):(o(),I(ve,{key:1},{default:S(()=>[R("mdi-menu-down")]),_:1}))]),_:2},1032,["id","onClick","aria-label"])):D("",!0),b(le,{id:"checkbox-"+s.value,color:"cta_blue","hide-details":"",modelValue:T(t).niveau,"onUpdate:modelValue":r[0]||(r[0]=_=>T(t).niveau=_),onClick:_=>d(s),class:q(s.children?"ma-0":"ma-0 ml-7"),value:s.value,indeterminate:l(s),"on-icon":l(s)?"mdi-minus-box":"mdi-checkbox-marked"},{label:S(()=>[V("span",{class:"filter_label",id:e.categoryTitle+"-"+s.value},[b(oe,{name:e.selectedOptionStoreField,option:s,"checkbox-id":"checkbox-"+s.value},{default:S(()=>[R($(s.text),1)]),_:2},1032,["name","option","checkbox-id"])],8,Bt),V("span",{class:"hit-count",id:e.categoryTitle+"-"+s.value+"-count"},"  "+$("("+s.count+")"),9,Ut)]),_:2},1032,["id","modelValue","onClick","class","value","indeterminate","on-icon"])]),Me(V("div",zt,[(o(!0),g(A,null,U(s.children,_=>(o(),g("ul",{key:_.value},[V("li",qt,[b(le,{id:"checkbox-"+_.value,color:"cta_blue","hide-details":"",class:"ma-0 ml-4",modelValue:T(t).niveau,"onUpdate:modelValue":r[1]||(r[1]=G=>T(t).niveau=G),value:_.value,onChange:G=>O(_)},{label:S(()=>[_.text=="Vmbo"?(o(),I(ae,{key:0,tooltipText:"Onder vmbo vallen ook voorheen gebruikte opleidingsniveaus zoals vbo, lbo en mavo.",tip:_.text+" ",labelId:e.categoryTitle+"-"+_.value},null,8,["tip","labelId"])):(o(),g("span",{key:1,class:"filter_label",id:e.categoryTitle+"-"+_.value},[b(oe,{name:e.selectedOptionStoreField,option:_,"checkbox-id":"checkbox-"+_.value},{default:S(()=>[R($(_.text),1)]),_:2},1032,["name","option","checkbox-id"])],8,Kt)),V("span",{class:"hit-count",id:e.categoryTitle+"-"+_.value+"-count"},$("("+_.count+")"),9,Ht)]),_:2},1032,["id","modelValue","value","onChange"])])]))),128))],512),[[Ne,s.children&&s.parentExpanded]])])]))),128))]))}});const ca=H(Gt,[["__scopeId","data-v-bc704ec7"]]),Jt=e=>typeof e=="object"&&Object.hasOwn(e,"search_term"),va=De("filterStore",{state:()=>({activeFilters:{}}),actions:{updateActiveFilters(e,f){this.activeFilters[e]=f,typeof f=="object"&&Object.keys(f).length===0&&delete this.activeFilters[e],Array.isArray(f)&&f.length===0&&delete this.activeFilters[e],Jt(this.activeFilters.locatie)&&this.activeFilters.locatie.search_term===""&&delete this.activeFilters.locatie,this.updateUrl()},updateUrl(){const e=new URL(window.location.href);if(Object.entries(this.activeFilters).length===0){window.history.pushState({},"",e.origin+e.pathname);return}const f=new URLSearchParams;f.set("filters",JSON.stringify(this.activeFilters)),e.search=decodeURI(f.toString()).replaceAll("%3A",":").replaceAll("%2C",","),window.history.pushState({},"",e.toString())}}});export{ua as P,ra as S,St as V,ca as a,da as b,oa as c,sa as d,va as u};