1import{a4 as k,f as R,r as y,c as h,o as v,a as l,aa as C,ac as F,h as n,a5 as P,a3 as S,j as T,t as x,F as z,g as E,ad as q}from"./ZmefSjRN.js";const A=k("/icons/411.001-ZorgopdeKaart-iconen-zoeken.svg"),B={trailing:!0};function D(b,d=25,e={}){if(e={...B,...e},!Number.isFinite(d))throw new TypeError("Expected `wait` to be a finite number");let o,t,f=[],r,i;const m=(a,p)=>(r=N(b,a,p),r.finally(()=>{if(r=null,e.trailing&&i&&!t){const g=m(a,i);return i=null,g}}),r);return function(...a){return r?(e.trailing&&(i=a),r):new Promise(p=>{const g=!t&&e.leading;clearTimeout(t),t=setTimeout(()=>{t=null;const c=e.leading?o:m(this,a);for(const s of f)s(c);f=[]},d),g?(o=m(this,a),p(o)):f.push(p)})}}async function N(b,d,e){return await b.apply(d,e)}const U={class:"flex w-52 flex-col rounded sm:pt-4 pt-8"},L={class:"flex flex-row items-center space-x-1"},V=["aria-expanded"],j={key:0,class:""},K={class:"gap-1px flex flex-col text-govblue",id:"popup-searchResults",role:"listbox","aria-label":"Kies een zoeksuggestie"},M={class:"px-1",role:"option"},Z=["onClick"],G={class:"bg-blue-700 px-3 py-2 text-white"},I={class:"text-left"},W=500,H=R({__name:"Search",emits:["selectPdokResult"],setup(b,{emit:d}){const e=y(""),o=y({});let t=!1;async function f(c){const{response:s}=await $fetch("https://api.pdok.nl/bzk/locatieserver/search/v3_1/suggest",{query:c});return s}async function r(){e.value||(o.value={error:"Geen zoekresultaten gevonden."});const s=await f({fq:"type:(gemeente or buurt or wijk or woonplaats or postcode or adres)",q:e.value,rows:100,fl:"id weergavenaam type score adrestype centroide_ll gemeentenaam gemeentecode buurtnaam buurtcode"});o.value=s}const i=D(r,W),m=d,a={woonplaats:"WP",buurt:"BU",wijk:"WK",gemeente:"GM",postcode:"PC",adres:"AD"};function p(c){m("selectPdokResult",c),t=!1,e.value=""}function g(){e.value!=""?t=!0:t=!1}return(c,s)=>{var _,w;return v(),h("div",U,[l("div",L,[C(l("input",{"onUpdate:modelValue":[s[0]||(s[0]=u=>P(e)?e.value=u:null),s[1]||(s[1]=(...u)=>n(i)&&n(i)(...u))],placeholder:"Zoek op de kaart",onInput:g,role:"combobox","aria-expanded":n(t),"aria-autocomplete":"list","aria-controls":"popup-searchResults",class:"mb-1 flex h-10 w-full rounded-[0.1rem] border-2 border-govSecondary bg-background bg-white text-govblue px-3 py-2 text-sm r
1ing-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50"},null,40,V),[[F,n(e)]]),s[2]||(s[2]=l("img",{src:A,alt:"Zoeken icoon",class:"w-8 h-10 mb-1 bg-govSecondary p-1 rounded rounded-20"},null,-1))]),l("div",{class:S(["max-h-80 overflow-y-auto",{hidden:!n(t),block:n(t)}])},[(_=n(o))!=null&&_.error?(v(),h("p",j,x(n(o).error),1)):T("",!0),l("ul",K,[(v(!0),h(z,null,E((w=n(o))==null?void 0:w.docs,u=>(v(),h("li",M,[l("button",{onClick:$=>p(u),class:"flex h-full w-full place-items-center gap-2 bg-white pl-1 pr-4 py-2 hover:bg-slate-100"},[l("span",G,x(q(a[u.type])),1),l("span",I,x(u.weergavenaam),1)],8,Z)]))),256))])],2)])}}});export{H as _};
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.