1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8896],{1716:(e,t,s)=>{"use strict";s.r(t),s.d(t,{DrivingSchool:()=>ed,default:()=>ep});var a=s(6029),n=s(55729),r=s(44670),l=s.n(r),i=s(26923),o=s.n(i),c=s(91875),d=s(43059),p=s(99089),u=s(46756),m=s(81163),h=s(31332),g=s(85224),x=s(60660),f=s(70217),y=s(92476),b=s(58057),j=s(36061),v=s(72492),w=s(38252),A=s(50435),k=s(32525),N=s(78732),C=s(95725),S=s(69858),E=s(58677),T=s(9015),D=s(23847),M=s.n(D),_=s(43893),B=s.n(_),L=s(26613),F=s(74802),R=s.n(F),P=s(41474),z=s(16178),I=s(16718),H=s(67659),V=s.n(H),$=s(29910),q=s.n($),U=s(9145),W=s.n(U),G=s(7820),O=s.n(G),Z=s(35058),Y=s.n(Z),X=s(36342),J=s.n(X),K=s(59406),Q=s.n(K),ee=s(54554),et=s.n(ee),es=s(41498);let ea=({distanceOptions:e,pitchDirectory:t,projection:s,portal:r,intro:l,pitchType:i})=>{let p=(0,n.useRef)(null),[x,y]=(0,n.useState)({lat:51,lng:10}),[v,w]=(0,n.useState)(!0),[A,k]=(0,n.useState)([]),[N,C]=(0,n.useState)(null),[S,E]=(0,n.useState)(null),[T,D]=(0,n.useState)({distance:25,limit:10,p:0,sort:"score"}),[_,B]=(0,n.useState)({distance:25,limit:10,p:0,sort:"score"}),[L,F]=(0,n.useState)("0 Ergebnisse gefunden");return(0,a.jsxs)(I.l,{className:"px-4 lg:col-span-2 lg:px-0",onSubmit:()=>({isSubmitted:1,..._}),initialValues:T,onValuesChanged:e=>{B(e)},children:[(0,a.jsxs)("div",{className:"mb-4",id:"pitchMap",children:[(0,a.jsx)(c.W,{title:"Finden Sie die beste Fahrschule in Ihrer N\xe4he.",maxWidth:!1}),(0,a.jsx)("div",{className:"-mt-6 text-skin-black dark:text-skin-white",children:(0,a.jsx)(d.k,{text:"in Kooperation mit",logo:"werkstattsuche"})})]}),l&&(0,a.jsx)("div",{className:"mb-4 lg:w-content",children:(0,a.jsx)(f.Text,{isDarkMode:!0,dangerouslySetInnerHTML:{__html:l}})}),(0,a.jsxs)("div",{className:"p-4 pb-0 mb-9 relative lg:min-h-px-150 "+o().searchBg,children:[(0,a.jsxs)("div",{className:"flex gap-4 pb-4",children:[(0,a.jsxs)("div",{className:"grow space-y-4 lg:flex lg:items-center lg:gap-4 lg:space-y-0",children:[(0,a.jsxs)("div",{className:"relative lg:grow",children:[(0,a.jsx)(el,{id:"q",label:"Ort",name:"q",setCoordinates:y,setIsInitial:w,projection:s,pitchType:i}),(0,a.jsx)(es.B,{src:et(),className:`absolute bottom-px-8 right-1 flex size-px-15 self-center ${o().iconSearch}`})]}),(0,a.jsx)("div",{children:(0,a.jsx)(u.l,{id:"distance",name:"distance",options:e})}),(0,a.jsx)("div",{children:(0,a.jsx)(m.Button,{text:L,onClick:()=>{let e=document.getElementById("list");if(e){let t=(0,P.$R)(e);window.scrollTo({x:0,top:t.top-170})}}})})]}),(0,a.jsx)("div",{className:"lg:absolute lg:-right-px-100 lg:top-0",children:(0,a.jsx)(b.Ay,{src:M(),className:"w-px-80 lg:w-px-100"})})]}),(0,a.jsx)("div",{className:"-mx-4 h-0.5 bg-skin-white"})]}),(0,a.jsx)("div",{className:"va-maincol-list maincol_list relative mb-9 lg:col-span-2 lg:flex lg:justify-between",children:(0,a.jsxs)("div",{className:"va-maincol min-h-main lg:w-content",id:"map-container",children:[(0,a.jsx)(ei,{map:p,coordinates:x,setCoordinates:y,formValues:_,setButtonText:F,setLoadedData:k,setIsInitial:w,isInitial:v,setPages:C,pitchDirectory:t,projection:s,portal:r,setCount:E,pitchType:i}),(0,a.jsx)("div",{className:"my-4",id:"list",children:(0,a.jsx)(h.Headline,{headline:S?`Diese Suchanfrage liefert ${S} Ergebnisse`:"",size:"medium",isDarkMode:!0})}),(0,a.jsx)("div",{className:"mb-8 flex flex-wrap items-center justify-between gap-4 "+o().switchButton,children:(0,a.jsx)(g.d,{options:[{key:"score",label:"Score"},{key:"distance",label:"Entfernung"}],onChange:e=>{_.sort=e,B({..._,sort:e})}})}),(0,a.jsxs)(a.Fragment,{children:[A&&A.length?A.map((e,t)=>(0,a.jsx)(en,{hasBadge:!1,item:e},`repair-result-item-${t}`)):null,N?(0,a.jsx)("div",{className:"pt-4",children:(0,a.jsx)(j.d,{useLinkPush:!1,onClick:(e,t)=>{B({..._,page:t}),e.preventDefault();let s=document.getElementById("list");if(s){let e=(0,P.$R)(s);window.scrollTo({x:0,top:e.top-170})}return!1},pagination:N})}):null]}),(0,a.jsx)("div",{className:"mb-6",children:(0,a.jsx)(z.f,{children:(0,a.jsx)(m.Button,{type:"submit",text:L})})})]})})]})},en=({item:e,hasBadge:t,url:s})=>{let n=e.displayaddressnohtml,r=e.website?.replace("https://","")??"";return r=r.replace("http://",""),(0,a.jsxs)(y.Ay,{target:"_blank",href:s??e.url,className:"flex justify-between border-b border-solid border-skin-grey-medium py-4",children:[(0,a.jsxs)("div",{className:"flex w-px-70 flex-col items-center justify-between gap-2",children:[(0,a.jsx)(h.Headline,{headline:e.drivingSchool.ratings.finalScore,size:"small",isDarkMode:!0}),(0,a.jsx)(es.B,{src:V(),className:"h-px-70 w-auto"}),(0,a.jsx)(x.Subline,{size:"small",inverted:!1,isDarkMode:!0,children:"Score"})]}),(0,a.jsxs)("div",{className:"grow px-4",children:[(0,a.jsx)(h.Headline,{headline:e._de.name,size:"small",isDarkMode:!0}),(0,a.jsxs)("div",{className:"flex pt-2 "+o().itemDetail,children:[(0,a.jsx)("div",{className:"size-px-18 min-w-px-18 overflow-hidden",children:(0,a.jsx)(er,{icon:"adress"})}),(0,a.jsx)("div",{className:"grow pl-2",children:(0,a.jsx)(f.Text,{isDarkMode:!0,size:"small",children:n})})]}),e.website&&(0,a.jsxs)("div",{className:"flex pt-2 "+o().itemDetail,children:[(0,a.jsx)("div",{className:"size-px-18 min-w-px-18 overflow-hidden",children:(0,a.jsx)(er,{icon:"url"})}),(0,a.jsx)("div",{className:"grow pl-2",children:(0,a.jsx)(f.Text,{isDarkMode:!0,size:"small",children:(0,a.jsx)(y.Ay,{href:e.website,target:"_blank",rel:"nofollow",children:r})})})]})]}),t?(0,a.jsx)(b.Ay,{src:M(),className:"w-px-70 lg:w-px-100"}):null]})},er=({icon:e="phone"})=>{let t="block relative w-full h-full";switch(o().metaIcon,e){case"phone":return(0,a.jsx)(es.B,{src:J(),className:t});case"email":return(0,a.jsx)(es.B,{src:W(),className:t});case"url":return(0,a.jsx)(es.B,{src:Q(),className:t});case"adress":return(0,a.jsx)(es.B,{src:q(),className:t});case"info":return(0,a.jsx)(es.B,{src:O(),className:t});case"mobile":return(0,a.jsx)(es.B,{src:Y(),className:t});default:return null}},el=({setCoordinates:e,setIsInitial:t,projection:s,pitchType:r})=>{let l=(0,n.useContext)(v.c),i=(0,n.useContext)(w.HP),[c,d]=(0,n.use
1State)([]),[u,m]=(0,n.useState)(""),[h,g]=(0,n.useState)(!1),x=(0,A.A)(u,350);(0,n.useEffect)(()=>{f()},[x]);let f=async()=>{if(x?.length>=3){g(!0),d([]);let e=await b(x),t=await j(x);t?.length&&e.unshift(...t),g(!1),d(e)}},y=async e=>{m(e?.target?.value)},b=async e=>await fetch(`${i.apiHost}/pro-pitch/pitch/geocode?q=${e}&limit=10`,{method:"GET",headers:{"Content-Type":"application/json"}}).then(e=>e.json()).catch(e=>{console.error("error in listsSearchForm geocode",e)}),j=async e=>{let t=`&pitchType[]=${r}`;return await fetch(`${i.apiHost}/pro-pitch/pitch/getByName?name=${e}&limit=5${t}&projection=${s}`,{method:"GET",headers:{"Content-Type":"application/json"}}).then(e=>e.json())};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(p.p,{id:"q",name:"q",onChange:y,disableAutocomplete:!0,placeholder:"Stadt / Name / PLZ",iconRight:!0}),h&&(0,a.jsx)("ul",{className:"va-input-autocomplete",children:(0,a.jsx)(k.a,{size:"lg",color:"fill-white text-skin-primary"})}),!!c?.length&&(0,a.jsx)("ul",{className:"va-input-autocomplete !border-none "+o().input,children:(0,a.jsx)(N.T,{pitches:c,onClick:s=>{t(!1);let a=s?.point?.lng,n=s?.point?.lat;s.pitchType?(n=s.gps[0],a=s.gps[1]):s?.coordinates?.lng&&s?.coordinates?.lat&&(a=s.coordinates.lng,n=s.coordinates.lat),l.setFieldValue("q",s?._de?.name?s._de.name:s?.city),d([]),e({lng:a,lat:n})}})})]})},ei=({coordinates:e,map:t,formValues:s,setButtonText:r,setCount:i,setLoadedData:c,setCoordinates:d,setPages:p,isInitial:u,setIsInitial:m,pitchDirectory:h="werkstatt",projection:g,portal:x,pitchType:f,...y})=>{let b=(0,n.useRef)(null),j=e.lng,v=e.lat,[k,N]=(0,n.useState)(4.75),D=(0,n.useRef)(null),M=(0,n.useRef)(null),_=(0,n.useRef)(null),B=(0,n.useContext)(w.HP),F=(0,A.A)(s,500);(0,n.useEffect)(()=>{!u&&t.current&&P()},[e,F]),(0,n.useEffect)(()=>{if(!u&&t.current){let a=t.current.getSource("search-indicator");a&&(a.coordinates={lng:e.lng,lat:e.lat},t.current.easeTo({center:e,duration:300}),t.current.getSource("search-indicator").setData({type:"Point",coordinates:[e.lng,e.lat]}),t.current.setPaintProperty("search-indicator","circle-radius",{stops:[[0,0],[20,q(1e3*s.distance,t.current.getCenter().lat)]],base:2}))}},[e]);let P=async()=>{await I({center:e},s?.page);let t=await z({center:e}),a=[],n=[];for(let e=0;e<t.length;e++){let s=t[e];s?.name&&-1===a.indexOf(s._id)&&(a.push(s._id),n.push(s))}H(n)},z=async(e={})=>{if(!e.center){let s=t.current.getCenter();e.center={lng:s.lng,lat:s.lat}}let a="distance="+s.distance+"¢er[lng]="+e.center.lng+"¢er[lat]="+e.center.lat+"&pitchType[]="+f+"&projection="+g;return await fetch(B.apiHost+"/pro-pitch/pitch/getMapMarkersInBounds?"+a,{method:"GET",headers:{"Content-Type":"application/json"}}).then(e=>e.json())},I=async(e={},a=0)=>{if(!e.center){let s=t.current.getCenter();e.center={lng:s.lng,lat:s.lat}}let n="distance="+s.distance+"&lng="+e.center.lng+"&lat="+e.center.lat+"&pitchType[]="+f+"&projection="+g;"score"===s.sort&&(n+="&sort=data.drivingSchool.ratings.finalScore"),n+="&pitchDirectory="+h+"&p="+a;let r=await fetch(B.apiHost+"/pro-pitch/pitch/getListData?"+n,{method:"GET",headers:{"Content-Type":"application/json"}}).then(e=>e.json());return c(r.list),p(r.pagination),r.list},H=s=>{let a=$(s),n=a?.features?.length||0;r(n+" Ergebnisse gefunden"),i(n),t.current.getSource("markers").setData(a),t.current.easeTo({zoom:V(),center:e,duration:300})},V=()=>{let e=parseInt(s.distance),t=0;if(""!==e)switch(e){case 5:t+=10.25;break;case 10:t+=9.25;break;case 25:t+=8.25;break;case 50:t+=7.25;break;case 100:t+=6.25;break;default:t+=0}return t},$=e=>{let t={type:"FeatureCollection",features:[]};for(let s=0;s<e.length;s++){let a=e[s];a.name&&t.features.push({type:"Feature",geometry:{type:"Point",coordinates:[parseFloat(a.gps[1]),parseFloat(a.gps[0])]},properties:{title:a.name,score:a.drivingSchoolFinalScore,adress:a.displayaddressnohtml,id:a._id}})}return t},q=(e,t)=>e/.075/Math.cos(t*Math.PI/180),U=async e=>{e.on("click","clusters",t=>{let s=e.queryRenderedFeatures(t.point,{layers:["clusters"]}),a=s[0].properties.cluster_id;e.getSource("markers").getClusterExpansionZoom(a,(t,a)=>{t||e.easeTo({center:s[0].geometry.coordinates,zoom:a})})}),e.on("mouseenter","clusters",function(){e.getCanvas().style.cursor="pointer"}),e.on("mouseleave","clusters",function(){e.getCanvas().style.cursor=""}),e.on("click","unclustered-point",async t=>{let s=e.queryRenderedFeatures(t.point,{layers:["unclustered-point"]})[0].properties;e.easeTo({center:[t.lngLat.lng,t.lngLat.lat]}),new(l()).Popup({className:"marker-popup",anchor:"bottom",maxWidth:"none"}).setLngLat(t.lngLat).setHTML((0,L.F0)((0,a.jsx)(a.Fragment,{children:(0,a.jsx)(eo,{id:s.id,title:s.title,pitchDirectory:h,adress:s.adress,score:s.score})}))).addTo(e)}),e.on("mouseenter","unclustered-point",function(){e.getCanvas().style.cursor="pointer"}),e.on("mouseleave","unclustered-point",function(){e.getCanvas().style.cursor=""})};return(0,n.useEffect)(()=>
1{if(t.current)return;t.current=new(l()).Map({container:b.current,style:"https://maps.promobil.de/styles/6eb3236c-e4e7-44cb-ad2e-093a1c7881d1/style.json",center:[j,v],zoom:k});let e=new(R())({defaultLanguage:"de"});t.current.addControl(e),t.current.addControl(new(l()).NavigationControl({showCompass:!1})),t.current.addControl((()=>{if(D.current)return D.current;let e=document.createElement("button");e.className="mapboxgl-ctrl-icon";let s=document.createElement("span");s.style.height="12px",s.style.width="12px",s.style.backgroundColor="#262e38",s.style.borderRadius="50%",s.style.display="inline-block";let a=document.createElement("span");a.style.height="8px",a.style.width="8px",a.style.marginTop="2px",a.style.verticalAlign="top",a.style.backgroundColor="#fff",a.style.borderRadius="50%",a.style.display="inline-block",a.style.boxShadow="0px 0px 2px",s.appendChild(a),e.appendChild(s);let n=document.createElement("div");return n.className="mapboxgl-ctrl-group mapboxgl-ctrl",n.appendChild(e),n.onAdd=()=>n,n.onRemove=()=>n.parentNode.removeChild(n),n.setAttribute("view","Mapbox Streets"),D.current=n,e.addEventListener("click",e=>{"visible"===t.current.getLayoutProperty("search-indicator","visibility")?(t.current.setLayoutProperty("search-indicator","visibility","none"),a.style.display="none"):(t.current.setLayoutProperty("search-indicator","visibility","visible"),a.style.display="inline-block")}),e.addEventListener("mouseover",e=>a.style["background-color"]="rgba(255, 255, 255, 0.875)"),e.addEventListener("mouseout",e=>a.style["background-color"]="#fff"),n})(),"top-right"),t.current.dragRotate.disable(),t.current.touchZoomRotate.disableRotation(),t.current.keyboard.disable(),(()=>{if(_.current)return;let e=document.createElement("input");e.setAttribute("type","submit"),e.className="va-mapboxgl-ctrl-button",e.style.position="absolute",e.value="In diesem Bereich suchen",e.onAdd=()=>e,e.onRemove=()=>e.parentNode.removeChild(e),e.addEventListener("click",e=>{m(!1);let s=t.current.getCenter();d({lng:s.lng,lat:s.lat})}),_.current=!0,t.current._controlContainer.appendChild(e),t.current._controlPositions["top-center"]=e})(),(e=>{if(M.current)return;let s=document.createElement("img");s.className="va-mapboxgl-ctrl-icon","od"===x.toLowerCase()?s.src=C.A.src:s.src=S.A.src,s.onAdd=()=>s,s.onRemove=()=>s.parentNode.removeChild(s);let a=document.createElement("div");a.appendChild(s),a.className="va-mapboxgl-ctrl-center",t.current._controlContainer.appendChild(a),t.current._controlPositions.center=a,M.current=a})(t.current),t.current.on("load",()=>{var e;let a,n,r;e=t.current,a={type:"FeatureCollection",features:[]},n=E.A.src,r=T.A.src,e.loadImage(n,(t,n)=>{if(t)throw t;e.loadImage(r,(t,r)=>{if(t)throw t;e.addImage("s1",n),e.addImage("s2",r),e.addSource("markers",{type:"geojson",data:a,cluster:!0,clusterMaxZoom:14,clusterRadius:40}),e.addLayer({id:"clusters",type:"symbol",source:"markers",filter:["has","point_count"],layout:{"icon-image":"s1","icon-size":.6,"icon-offset":[0,-50],"icon-allow-overlap":!0,"text-allow-overlap":!0,"text-field":"{point_count_abbreviated}","text-font":["DIN Offc Pro Medium","Arial Unicode MS Bold"],"text-size":12,"text-anchor":"center","text-offset":[0,-3]},paint:{"text-color":"#ffffff"}}),e.addLayer({id:"unclustered-point",type:"symbol",source:"markers",filter:["!",["has","point_count"]],layout:{"icon-image":"s2","icon-size":.6,"icon-offset":[0,-27],"icon-allow-overlap":!0,"text-allow-overlap":!0}}),e.addSource("search-indicator",{type:"geojson",data:{type:"Point",coordinates:[e.getCenter().lng,e.getCenter().lat]}}),e.addLayer({id:"search-indicator",type:"circle",source:"search-indicator",paint:{"circle-radius":{stops:[[0,0],[20,q(1e3*s.distance,e.getCenter().lat)]],base:2},"circle-color":"black","circle-opacity":.3}}),U(e)})})})},[]),(0,a.jsx)("div",{className:o().mapContainer,children:(0,a.jsx)("div",{ref:b,className:"relative overflow-hidden "+o().map+" "+o().mapContainer})})},eo=({pitchDirectory:e,id:t,title:s,adress:n,score:r,...l})=>(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)(y.Ay,{href:"/"+e+"/"+s.replace(RegExp(" ","g"),"-")+"-"+t+".html",target:"_blank",children:[(0,a.jsx)("div",{className:"mb-1 line-clamp-2 overflow-hidden",children:(0,a.jsx)(h.Headline,{size:"small",headline:s,isDarkMode:!0})}),(0,a.jsxs)("div",{className:"flex text-skin-grey "+o().metaIcon,children:[(0,a.jsx)("div",{className:"size-px-18 min-w-px-18 overflow-hidden text-skin-grey",children:(0,a.jsx)(er,{icon:"adress"})}),(0,a.jsx)("div",{className:"line-clamp-1 grow overflow-hidden pl-2",children:(0,a.jsx)("span",{className:"block font-skin-primary text-xs",children:n})})]}),(0,a.jsxs)("div",{className:"absolute bottom-2 right-2 flex items-center gap-0.5 bg-opacity-50 p-1 font-skin-primary font-bold !text-skin-black "+o().badge,children:[(0,a.jsx)(b.Ay,{src:B(),className:"w-px-20"}),r]})]})});var ec=s(96417);let ed=({irConfig:e,apiKey:t,element:s,page:n,isDebug:r,pitchDirectory:i,projection:o,portal:c,pitchType:d,intro:p,...u})=>(l().accessToken=t,(0,a.jsx)(ec.DA,{isDrivingSchool:!0,children:(0,a.jsx)(ea,{distanceOptions:[{label:"5 km",value:"5"},{label:"10 km",value:"10"},{label:"25 km",value:"25"},{label:"50 km",value:"50"},{label:"100 km",value:"100"}],portal:c,pitchDirectory:i,projection:o,intro:p,pitchType:d})})),ep=ed},9015:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a={src:"/_next/static/media/poi-fahrschule.72d4b2a9.png",height:100,width:100,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAMAAADz0U65AAAATlBMVEVMaXEaWGsAGjYzb4MlZHjY3N3m
16+0AXV0POlABSF48OjoUVWsTVmoKUmcLUmgETWMDS2JNS0pHREOgnXWmnW7hvHp1o7Ita3/Ey87i1rD+q7LHAAAAFnRSTlMANBfl8P39AhGa/mZn9PXT1P7+xtiSZ1nVqQAAAAlwSFlzAAAVtgAAFbYBu2I9AAAAAD5JREFUeJwVxkcSgCAQAMFBlw2YE+j/P2rRpwYPkfsBoqp+F7jkUt5xwEWPs4eoOdcAfGttdzDSuiSsb54wflLoAiN+NUzjAAAAAElFTkSuQmCC",blurWidth:8,blurHeight:8}},23847:(e,t,s)=>{e.exports=s.p+"static/img/ams/AMS_Siegel_Fahrschule.svg"}}]);
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.