1import{_ as Z}from"./CGKMBKvc.js";import{u as Q,S as J}from"./BKmPoQhe.js";import{H as K}from"./xQVsPsyn.js";import{F as W}from"./PXo2_PVZ.js";import{u as X,h as Y,r as d,A as ee,f as te,M as re,c as oe,b as r,a as w,e as ae,o as ne}from"./BWgNQVgb.js";import{_ as se}from"./DlAUqK2U.js";import"./BT2WAnea.js";const le={class:"min-h-screen relative overflow-hidden",style:{"background-color":"#0F172A"}},ie={class:"relative z-10 px-4 sm:px-6 lg:px-8 pt-8 lg:pt-32"},ce={class:"min-h-[calc(100vh-12rem)] flex items-start lg:items-center"},ue={class:"w-full max-w-7xl mx-auto"},de={class:"grid grid-cols-1 lg:grid-cols-2 gap-32 lg:gap-12 items-start"},pe={class:"order-2 lg:order-2 max-w-4xl lg:ml-auto space-y-6"},me={class:"space-y-4"},ge={class:"space-y-3"},fe={class:"flex justify-center px-4 lg:px-0"},ve={class:"relative w-full max-w-[600px]"},ye={__name:"home",setup(he){X({title:"France Parcelles - Cadastre et Informations Foncières | 100M+ Parcelles, 36k Communes",titleTemplate:null,meta:[{name:"description",content:"Accédez gratuitement aux informations cadastrales de toute la France. Consultez 100M+ parcelles, historique des ventes, propriétaires, urbanisme, DPE et risques naturels. Données officielles IGN actualisées."},{name:"keywords",content:"cadastre france, parcelles cadastrales, recherche parcelle, référence cadastrale, mutations immobilières, prix terrain, propriété foncière, urbanisme, PLU, géorisques, DPE diagnostic, taxe foncière, notaire, géomètre, investissement immobilier, achat terrain, vente parcelle, IGN cadastre, données foncières officielles"},{property:"og:title",content:"France Parcelles - La référence du cadastre français"},{property:"og:description",content:"Consultez gratuitement 100M+ parcelles cadastrales françaises. Données officielles IGN, historique des ventes, informations urbanistiques et risques naturels."},{property:"og:type",content:"website"},{property:"og:site_name",content:"France Parcelles"},{property:"og:locale",content:"fr_FR"},{property:"og:url",content:"https://france-parcelles.fr"},{name:"twitter:card",content:"summary_large_image"},{name:"twitter:title",content:"France Parcelles - Cadastre et données foncières officielles"},{name:"twitter:description",content:"Accès gratuit aux informations cadastrales de 100M+ parcelles françaises. Données IGN officielles."},{name:"robots",content:"index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:-1"},{name:"googlebot",content:"index, follow, max-video-preview:-1, max-image-preview:large, max-snippet:-1"},{name:"bingbot",content:"index, follow"},{name:"geo.region",content:"FR"},{name:"geo.country",content:"France"},{name:"geo.placename",content:"France"},{name:"author",content:"France Parcelles"},{name:"publisher",content:"France Parcelles"},{name:"copyright",content:"© 2025 France Parcelles."},{name:"application-name",content:"France Parcelles"},{name:"category",content:"Immobilier, Cadastre, Urbanisme, Données publiques"},{name:"coverage",content:"France métropolitaine et DOM-TOM"},{name:"distribution",content:"Global"},{name:"rating",content:"General"},{name:"revisit-after",content:"7 days"}]}),Y();const h=d(null),c=d(null),{search:A}=Q(),f=d(""),p=d(null),i=d(null),a=d(null),k=d(null),D=d(null);d(!1);const v=async t=>{try{if(!t||t.length!==5)return t||"commune";const e=await fetch(`https://geo.api.gouv.fr/communes/${t}`);if(e.ok){const l=(await e.json()).nom;return l?l.toLowerCase().replace(/[à áâãäåÄ]/g,"a").replace(/[èéêëÄ]/g,"e").replace(/[ìÃîïī]/g,"i").replace(/[òóôõöøÅ]/g,"o").replace(/[ùúûüū]/g,"u").replace(/[ýÿ]/g,"y").replace(/[ç]/g,"c").replace(/[ñ]/g,"n").replace(/[æ]/g,"ae").replace(/[Å]/g,"oe").replace(/\s+/g,"-").replace(/['']/g,"-").replace(/[^\w\-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,""):t}else return t}catch{return t}},j=async()=>{if(!f.value.trim())return;const t=f.value.trim();if(/^[a-z0-9]{14}$/i.test(t))try{const o=t.substring(0,5),l=await v(o),n=`/parcelles/${`${o}-${l||o}`}/${t}`;setTimeout(()=>{window.location.href=n},100)}catch{}else{const o=await A(t);o&&o.length>0&&C(o[0])}},C=async t=>{const e=t.properties,o=t.geometry.coordinates;if(e.type==="municipality"&&e.citycode)try{const l=e.citycode,s=await v(l),n=`${l}-${s}`;window.location.href=`/parcelles/${n}`;return}catch(l){console.error("Erreur lors de la redirection vers la commune:",l)}x(e.label),a.value&&o&&(a.value.flyTo({center:o,zoom:18,duration:2e3}),M(o[1],o[0]),setTimeout(()=>{const l=a.value.project(o);b({lng:o[0],lat:o[1]},l)},2500)),p.value={nom:e.city,code:e.citycode,codesPostaux:[e.postcode]}},F=t=>{var e;f.value=t,p.value&&t!==`${p.value.nom} (${((e=p.value.codesPostaux)==null?void 0:e[0])||p.value.code})`&&(p.value=null)},N=async()=>{try{const t=document.createElement("script");t.src="https://unpkg.com/[email protected]/dist/maplibre-gl.js";const e=document.createElement("link");e.rel="stylesheet",e.href="https://unpkg.com/[email protected]/dist/maplibre-gl.css",document.head.appendChild(e),document.head.appendChild(t),t.onload=()=>{z()},t.onerror=()=>{}}catch{}},z=()=>{if(h.value)try{const t=new window.maplibregl.Map({container:h.value,style:"https://api.maptiler.com/maps/01978973-77b7-7f70-b930-09f5
15eaad684/style.json?key=pc4w87sIQkyjMSdlu8yf",center:[2.35,46.86],zoom:5,minZoom:5});a.value=t,t.on("load",()=>{t.addSource("selected-parcel",{type:"geojson",data:{type:"FeatureCollection",features:[]}}),t.addLayer({id:"selected-parcel-fill",type:"fill",source:"selected-parcel",paint:{"fill-color":"#00FF00","fill-opacity":.7}}),t.addLayer({id:"selected-parcel-stroke",type:"line",source:"selected-parcel",paint:{"line-color":"#00DD00","line-width":4,"line-opacity":1}}),t.on("click",e=>{b(e.lngLat,e.point)}),t.on("mouseenter",()=>{t.getCanvas().style.cursor="crosshair"}),t.on("mouseleave",()=>{t.getCanvas().style.cursor=""})})}catch{}},y=t=>{if(!(!a.value||!t))try{k.value=t;const e=a.value.getSource("selected-parcel");if(!e)return;const o={type:"FeatureCollection",features:[{type:"Feature",geometry:t,properties:{}}]};e.setData(o)}catch{}},P=()=>{try{if(k.value=null,!a.value)return;const t=a.value.getSource("selected-parcel");if(!t)return;const e={type:"FeatureCollection",features:[]};t.setData(e)}catch{}},b=async(t,e)=>{try{const o=a.value.queryRenderedFeatures(e);if(o.length>0){const l=o.find(s=>s.properties&&(s.properties.id||s.properties.numero||s.properties.section||s.layer.id.includes("cadastre")||s.layer.id.includes("parcelle")))||o[0];if(l&&l.properties){const s=l.properties;if(i.value&&i.value.parcelData&&i.value.parcelData.id===s.id){i.value=null,P();return}if(s.id){const n={id:s.id,commune:s.commune||"Non disponible",prefixe:s.prefixe||"000",section:s.section||"Non disponible",numero:s.numero||"Non disponible",contenance:s.contenance||s.surface||0,arpente:s.arpente||!1,created:s.created||s.date_creation||"Non disponible",updated:s.updated||s.date_maj||"Non disponible"};if(i.value={coordinates:`${t.lng.toFixed(6)}, ${t.lat.toFixed(6)}`,properties:s,parcelData:n,source:"MapTiler + API Cadastre",geometry:l.geometry},n&&n.id){const m=n.id,u=m.substring(0,5);v(u).then(g=>{n.communeName=g,n.communeSlug=`${u}-${g}`}),x(m)}S(t,l.geometry);return}}}await $(t)}catch{await $(t)}},S=async(t,e)=>{try{const o=`https://apicarto.ign.fr/api/cadastre/parcelle?geom={"type":"Point","coordinates":[${t.lng},${t.lat}]}`,l=await fetch(o);if(l.ok){const s=await l.json();if(s.features&&s.features.length>0){const n=s.features[0].geometry;i.value&&(i.value.geometry=n,i.value.source="MapTiler + Géométrie précise IGN"),y(n);return}}y(e)}catch{y(e)}},$=async t=>{try{const e=`https://apicarto.ign.fr/api/cadastre/parcelle?geom={"type":"Point","coordinates":[${t.lng},${t.lat}]}`,o=await fetch(e);if(o.ok){const l=await o.json();if(l.features&&l.features.length>0){const s=l.features[0],n=s.properties,m=n.id||`${n.commune}${n.prefixe||"000"}${n.section}${n.numero}`;if(i.value&&i.value.parcelData&&i.value.parcelData.id===m){i.value=null,P();return}const u={id:m,commune:n.commune,prefixe:n.prefixe||"000",section:n.section,numero:n.numero,contenance:n.contenance||n.surface||0,arpente:n.arpente||!1,created:n.created||n.date_creation||"Non disponible",updated:n.updated||n.date_maj||"Non disponible"};i.value={coordinates:`${t.lng.toFixed(6)}, ${t.lat.toFixed(6)}`,properties:n,parcelData:u,source:"API Cadastre IGN",geometry:s.geometry};const g=await v(n.commune);if(u&&u.id){const V=u.id;u.communeName=g,u.communeSlug=`${n.commune}-${g}`,x(V)}s.geometry&&y(s.geometry)}}}catch{i.value={coordinates:`${t.lng.toFixed(6)}, ${t.lat.toFixed(6)}`,properties:{error:"API cadastre temporairement indisponible"},parcelData:null,source:"Erreur API",geometry:null}}},I=()=>{if(!navigator.geolocation)return;const t={enableHighAccuracy:!0,timeout:1e4,maximumAge:3e5};navigator.geolocation.getCurrentPosition(e=>{const o=e.coords.latitude,l=e.coords.longitude;T(o,l)},e=>{let o="Impossible d'obtenir votre position";switch(e.code){case e.PERMISSION_DENIED:o="Autorisation de géolocalisation refusée";break;case e.POSITION_UNAVAILABLE:o="Position non disponible";break;case e.TIMEOUT:o="Délai de géolocalisation dépassé";break}alert(o)},t)},E=async(t,e)=>{try{const o=await fetch(`https://api-adresse.data.gouv.fr/reverse/?lon=${e}&lat=${t}`);if(!o.ok)throw new Error(`Erreur API: ${o.status}`);const l=await o.json();if(l.features&&l.features.length>0){const n=l.features[0].properties;D.value={latitude:t,longitude:e,codeInsee:n.citycode,commune:n.city,adresse:n.label,codePostal:n.postcode}}}catch{}},T=async(t,e)=>{if(a.value)try{await E(t,e),a.value.flyTo({center:[e,t],zoom:18,duration:2e3}),M(t,e),setTimeout(()=>{B(t,e)},2500)}catch{}},M=(t,e)=>{if(a.value)try{a.value.getSource("user-location")&&(a.value.removeLayer("user-location-circle"),a.value.removeLayer("user-location-dot"),a.value.removeSource("user-location")),a.value.addSource("user-location",{type:"geojson",data:{type:"Feature",geometry:{type:"Point",coordinates:[e,t]},properties:{}}}
1),a.value.addLayer({id:"user-location-circle",type:"circle",source:"user-location",paint:{"circle-radius":20,"circle-color":"#007CE0","circle-opacity":.3,"circle-stroke-width":2,"circle-stroke-color":"#007CE0","circle-stroke-opacity":.8}}),a.value.addLayer({id:"user-location-dot",type:"circle",source:"user-location",paint:{"circle-radius":6,"circle-color":"#007CE0","circle-opacity":1,"circle-stroke-width":2,"circle-stroke-color":"#FFFFFF","circle-stroke-opacity":1}})}catch{}},B=(t,e)=>{if(a.value)try{const o=a.value.project([e,t]);b({lng:e,lat:t},o)}catch{}},q=()=>{if(!a.value)return;const t=a.value.getZoom();a.value.easeTo({zoom:t+1,duration:500})},R=()=>{if(!a.value)return;const t=a.value.getZoom();a.value.easeTo({zoom:t-1,duration:500})},G=()=>{a.value&&a.value.panBy([0,-100],{duration:300})},_=()=>{a.value&&a.value.panBy([0,100],{duration:300})},L=()=>{a.value&&a.value.panBy([-100,0],{duration:300})},U=()=>{a.value&&a.value.panBy([100,0],{duration:300})},O=()=>{a.value&&a.value.flyTo({center:[2.35,46.86],zoom:5,duration:2e3})},x=t=>{f.value=t;try{if(c.value)if(typeof c.value.updateQuery=="function")c.value.updateQuery(t);else if(c.value.$refs&&c.value.$refs.input)c.value.$refs.input.value=t;else try{if(c.value.$el&&typeof c.value.$el.querySelector=="function"){const e=c.value.$el.querySelector("input");e&&(e.value=t,e.dispatchEvent(new Event("input",{bubbles:!0})))}}catch{}}catch{}F(t)},H=ee(()=>{const t=navigator.userAgent.toLowerCase();return["googlebot","bingbot","slurp","duckduckbot","baiduspider","yandexbot","sogou","exabot","facebot","ia_archiver","chatgpt","gptbot","claudebot","perplexitybot","amazonbot","observer","meta-externalagent","openai","crawler","spider","bot","crawl"].some(o=>t.includes(o))});return te(()=>{if(H.value){console.log("ð¤ Bot détecté, MapTiler non chargé (économie $$)");return}setTimeout(()=>{N()},100)}),re(()=>{a.value&&(a.value.remove(),a.value=null)}),(t,e)=>(ne(),oe("div",le,[e[17]||(e[17]=r("div",{class:"absolute inset-0 z-0"},[r("img",{src:Z,alt:"Parcelles françaises",class:"w-full h-full object-cover opacity-70"}),r("div",{class:"absolute inset-0 bg-gradient-to-b from-black/60 via-black/40 to-black/70"})],-1)),w(K,{"current-page":"/home"}),r("main",ie,[r("div",ce,[r("div",ue,[r("div",de,[e[15]||(e[15]=r("div",{class:"order-1 lg:order-1 text-left lg:text-left"},[r("h1",{class:"text-7xl md:text-8xl lg:text-9xl font-bold text-white leading-none"},[ae(" France "),r("br"),r("span",{class:"text-primary-500"},"Parcelles")]),r("p",{class:"text-2xl md:text-2xl text-gray-200 leading-relaxed max-w-lg mt-6"}," Infos claires et accessibles sur tous les terrains partout en france ! ")],-1)),r("div",pe,[e[14]||(e[14]=r("div",{class:"text-center"},[r("h2",{class:"text-4xl font-bold text-white"}," Rechercher une parcelle ")],-1)),r("div",me,[w(J,{ref_key:"searchAutocompleteRef",ref:c,placeholder:"Référence cadastrale, adresse...",onSelect:C,onInput:F,onGeolocationRequested:I},null,512),r("button",{onClick:j,class:"w-full bg-primary-500 hover:bg-primary-600 text-white font-semibold py-3 px-6 rounded-xl transition-all duration-200 flex items-center justify-center space-x-2 shadow-lg hover:shadow-xl"},[...e[0]||(e[0]=[r("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[r("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})],-1),r("span",{class:"text-lg"},"Rechercher",-1)])])]),r("div",ge,[e[13]||(e[13]=r("div",{class:"text-center"},[r("h3",{class:"text-3xl font-bold text-white mb-3"}," Visualisation cadastrale "),r("p",{class:"text-sm text-gray-400 mb-2"}," Cliquez sur les parcelles pour récupérer leurs informations ")],-1)),r("div",fe,[r("div",ve,[r("div",{ref_key:"mapContainer",ref:h,id:"map-container",class:"w-full lg:w-[600px] h-[400px] rounded-lg shadow-lg",style:{height:"400px","background-color":"#0F172A"}},null,512),r("button",{onClick:I,class:"absolute top-3 left-3 bg-white hover:bg-gray-100 text-gray-800 p-2.5 rounded-lg shadow-lg transition-all duration-200 hover:shadow-xl z-10",title:"Cibler ma position"},[...e[1]||(e[1]=[r("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[r("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"}),r("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 11a3 3 0 11-6 0 3 3 0 016 0z"})],-1)])]),r("div",{class:"absolute bottom-3 left-3 flex flex-col gap-1.5 z-10"},[r("div",{class:"flex flex-col gap-1 bg-white rounded-md shadow-lg p-1"},[r("button",{onClick:q,class:"bg-white hover:bg-primary-50 text-gray-800 p-1.5 rounded border border-gray-200 hover:border-primary-500 transition-all duration-200",title:"Zoomer"},[...e[2]||(e[2]=[r("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[r("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2.5",d:"M12 6v12m6-6H6"})],-1)])]),r("button",{onClick:R,class:"bg-white hover:bg-primary-50 text-gray-800 p-1.5 rounded border border-gray-200 hover:border-primary-500 transition-all duration-200",title:"Dézoomer"},[...e[3]||(e[3]=[r("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[r("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2.5",d:"M18 12H6"})],-1)])])]),r("div",{class:"bg-white rounded-md shadow-lg p-1"},[r("div",{class:"grid grid-cols-3 gap-0.5"},[e[9]||(e[9]=r("div",null,null,-1)),r("button",{onClick:G,class:"bg-white hover:bg-primary-50 text-gray-800 p-1.5 rounded border border-gray-200 hover:border-primary-500 transition-all duration-200",title:"Déplacer vers le haut"},[...e[4]||(e[4]=[r("svg",{class:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[r("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2.5",d:"M5 15l7-7 7 7"})],-1)])]),e[10]||(e[10]=r("div",null,null,-1)),r("button",{onClick:L,class:"bg-white hover:bg-primary-50 text-gray-800 p-1.5 rounded border border-gray-200 hover:border-primary-500 transition-all duration-200",title:"Déplacer vers la gauche"},[...e[5]||(e[5]=[r("svg",{class:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[r("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2.5",d:"M15 19l-7-7 7-7"})],-1)])]),r("button",{onClick:O,class:"bg-white hover:bg-primary-50 text-gray-800 p-1.5 rounded border border-gray-200 hover:border-primary-500 transition-all duration-200",title:"Recentrer sur la France"},[...e[6]||(e[6]=[r("svg",{class:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[r("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6"})],-1)])]),r("button",{onClick:U,class:"bg-white hover:bg-primary-50 text-gray-800 p-1.5 rounded border border-gray-200 hover:border-primary-500 transition-all duration-200",title:"Déplacer vers la droite"},[...e[7]||(e[7]=[r("svg",{class:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[r("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2.5",d:"M9 5l7 7-7 7"})],-1)])]),e[11]||(e[11]=r("div",null,null,-1)),r("button",{onClick:_,class:"bg-white hover:bg-primary-50 text-gray-800 p-1.5 rounded border border-gray-200 hover:border-primary-500 transition-all duration-200",title:"Déplacer vers le bas"},[...e[8]||(e[8]=[r("svg",{class:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[r("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2.5",d:"M19 9l-7 7-7-7"})],-1)])]),e[12]||(e[12]=r("div",null,null,-1))])])])])])])])])])]),e[16]||(e[16]=r("div",{style:{height:"50px"}},null,-1))]),w(W)]))}},$e=se(ye,[["__scopeId","data-v-aac8ecdc"]]);export{$e 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.