{"version":3,"file":"MapWithPoints.BBo7wIcY.mjs","names":["useState","startTransition"],"sources":["https:/framerusercontent.com/modules/adJfUPaboSEQSkR1vdtR/0oVHQmQtKa8NxFd6Vpq7/MapWithPoints.js"],"sourcesContent":["// Carte interactive avec points cliquables affichant des données\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,startTransition}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";/**\n * Carte interactive avec points cliquables\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function MapWithPoints(props){const{points,mapImage={src:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",alt:\"Carte\"},pointColor,pointSize,popupBg,popupText,style}=props;const[openIndex,setOpenIndex]=useState(null);const isStatic=useIsStaticRenderer();// Map image is assumed to be a flat image, points are in % (0-100)\n// lat/lng are interpreted as % for simplicity\nreturn /*#__PURE__*/_jsxs(\"div\",{style:{...style,width:\"100%\",height:\"100%\",position:\"relative\",overflow:\"hidden\",borderRadius:8,background:\"#eee\"},children:[/*#__PURE__*/_jsx(\"img\",{src:mapImage.src,alt:mapImage.alt,style:{width:\"100%\",height:\"100%\",objectFit:\"cover\",display:\"block\"},draggable:false}),points.map((pt,i)=>/*#__PURE__*/_jsxs(\"div\",{style:{position:\"absolute\",left:`${pt.lng}%`,top:`${pt.lat}%`,transform:\"translate(-50%, -50%)\",zIndex:2,cursor:\"pointer\"},tabIndex:0,\"aria-label\":pt.label,onClick:()=>startTransition(()=>setOpenIndex(openIndex===i?null:i)),onKeyDown:e=>{if(e.key===\"Enter\"||e.key===\" \")startTransition(()=>setOpenIndex(openIndex===i?null:i));},children:[/*#__PURE__*/_jsx(\"div\",{style:{width:pointSize,height:pointSize,borderRadius:\"50%\",background:pointColor,border:\"2px solid #fff\",boxShadow:\"0 1px 4px rgba(0,0,0,0.12)\"}}),/*#__PURE__*/_jsxs(\"div\",{style:{position:\"absolute\",left:\"50%\",top:\"-12px\",transform:\"translate(-50%, -100%)\",minWidth:160,maxWidth:240,background:popupBg,color:popupText,borderRadius:8,boxShadow:\"0 2px 12px rgba(0,0,0,0.15)\",padding:16,zIndex:10,fontSize:15,lineHeight:1.4,pointerEvents:\"auto\"},role:\"dialog\",\"aria-modal\":\"true\",children:[/*#__PURE__*/_jsx(\"div\",{style:{fontWeight:600,marginBottom:4},children:pt.label}),/*#__PURE__*/_jsx(\"div\",{children:pt.description}),/*#__PURE__*/_jsx(\"button\",{style:{marginTop:10,background:\"none\",border:\"none\",color:popupText,cursor:\"pointer\",fontSize:13,textDecoration:\"underline\",padding:0},onClick:e=>{e.stopPropagation();startTransition(()=>setOpenIndex(null));},children:\"Fermer\"})]})]},i))]});}addPropertyControls(MapWithPoints,{mapImage:{type:ControlType.ResponsiveImage,title:\"Carte\"},points:{type:ControlType.Array,title:\"Points\",control:{type:ControlType.Object,controls:{lat:{type:ControlType.Number,title:\"Lat (%)\",min:0,max:100,defaultValue:50},lng:{type:ControlType.Number,title:\"Lng (%)\",min:0,max:100,defaultValue:50},label:{type:ControlType.String,title:\"Titre\",defaultValue:\"Point\"},description:{type:ControlType.String,title:\"Description\",defaultValue:\"Description du point\",displayTextArea:true}}},defaultValue:[{lat:40,lng:30,label:\"Point 1\",description:\"Description du point 1\"},{lat:60,lng:70,label:\"Point 2\",description:\"Description du point 2\"}],maxCount:10},pointColor:{type:ControlType.Color,title:\"Couleur point\",defaultValue:\"#0099FF\"},pointSize:{type:ControlType.Number,title:\"Taille point\",defaultValue:18,min:8,max:40},popupBg:{type:ControlType.Color,title:\"Fond popup\",defaultValue:\"#fff\"},popupText:{type:ControlType.Color,title:\"Texte popup\",defaultValue:\"#222\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"MapWithPoints\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framer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