{"version":3,"file":"MapEmbed.CMyp-a11.mjs","names":[],"sources":["https:/framerusercontent.com/modules/PWBRZ8jsaKUVAV7Poa9X/OD2Iz8yRQg2WPb6ygEMc/MapEmbed.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";/**\n * Google Maps embed with an accessible iframe title.\n *\n * Framer's built-in Embed (URL mode) renders an <iframe> with no `title`, which fails the\n * WCAG \"frame-title\" check — screen-reader users hear an unlabelled frame, and it is a\n * *serious* axe violation, not a nitpick. Its HTML mode would let you write a title but\n * cannot take the address from a CMS field or a component variable, so per-location maps\n * would break. This component keeps the address bindable AND sets the title.\n *\n * `address` accepts either:\n *   • a full Google Maps URL (what the existing \"Map Address\" variable already holds), or\n *   • a bare address like \"14 Northcote Road, SW11 1NZ\"\n * so it is a drop-in replacement for the Embed without touching the CMS.\n *\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n * @framerIntrinsicWidth 400\n * @framerIntrinsicHeight 300\n */export default function MapEmbed(props){const{address,title,zoom,radius}=props;const raw=String(address||\"\").trim();const isUrl=/^https?:\\/\\//i.test(raw);// Build the embed URL. A pasted maps URL is used as-is, but must carry output=embed or\n// Google serves the full site inside the frame.\nlet src=\"about:blank\";let place=raw;if(isUrl){src=raw.includes(\"output=embed\")?raw:raw+(raw.includes(\"?\")?\"&\":\"?\")+\"output=embed\";try{const q=new URL(raw).searchParams.get(\"q\");if(q)place=q;}catch(e){// malformed URL — fall back to the raw string for the label only\n}}else if(raw){src=`https://www.google.com/maps?q=${encodeURIComponent(raw)}&z=${zoom}&output=embed`;}// Never render an empty title: screen readers would announce an unnamed frame.\nconst label=title&&title.trim()||(place?`Map of ${place}`:\"Map\");return /*#__PURE__*/_jsx(\"iframe\",{src:src,title:label,loading:\"lazy\",referrerPolicy:\"no-referrer-when-downgrade\",style:{width:\"100%\",height:\"100%\",border:\"none\",borderRadius:radius,display:\"block\"}});}MapEmbed.defaultProps={address:\"\",title:\"\",zoom:15,radius:0};addPropertyControls(MapEmbed,{address:{type:ControlType.String,title:\"Address\",description:\"A Google Maps URL or a plain address. Bind this to the location.\"},title:{type:ControlType.String,title:\"Title\",description:\"Accessible name for the map frame, e.g. 'Map - Clapham practice'. Leave blank to use the address.\"},zoom:{type:ControlType.Number,title:\"Zoom\",min:1,max:20,step:1,defaultValue:15},radius:{type:ControlType.Number,title:\"Radius\",min:0,max:60,step:1,defaultValue:0}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"MapEmbed\",\"slots\":[],\"annotations\":{\"framerIntrinsicHeight\":\"300\",\"framerIntrinsicWidth\":\"400\",\"framerSupportedLayoutWidth\":\"any\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./MapEmbed.map"],"mappings":"4JAkBG,SAAwB,EAAS,EAAM,CAAC,GAAK,CAAC,UAAQ,QAAM,OAAK,UAAQ,EAAY,EAAI,OAAO,GAAS,EAAE,CAAC,CAAC,KAAK,EAAQ,EAAM,gBAAgB,KAAK,CAAG,EAEvJ,EAAI,cAAkB,EAAM,EAAI,GAAG,EAAM,CAAC,EAAI,EAAI,SAAS,cAAc,EAAE,EAAI,GAAK,EAAI,SAAS,GAAG,EAAE,IAAI,KAAK,eAAe,GAAG,CAAC,IAAM,EAAE,IAAI,IAAI,CAAG,CAAC,CAAC,aAAa,IAAI,GAAG,EAAK,IAAE,EAAM,EAAE,MAAS,CACvM,CAAC,MAAS,IAAK,EAAI,iCAAiC,mBAAmB,CAAG,EAAE,KAAK,EAAK,gBACtF,IAAM,EAAM,GAAO,EAAM,KAAK,IAAI,EAAM,UAAU,IAAQ,OAAO,OAAoB,EAAK,SAAS,CAAK,MAAI,MAAM,EAAM,QAAQ,OAAO,eAAe,6BAA6B,MAAM,CAAC,MAAM,OAAO,OAAO,OAAO,OAAO,OAAO,aAAa,EAAO,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