const s=e=>{new MutationObserver(function(){var a,t;let n=document.querySelector(e.selector);!n&&document.getElementById("elementor-preview-iframe")&&(n=(t=(a=document.getElementById("elementor-preview-iframe"))==null?void 0:a.contentDocument)==null?void 0:t.getElementById(e.selector.substring(1))),n&&(e.done(n),this.disconnect())}).observe(e.parent||document,{subtree:!0,childList:!0})},c=(e,n)=>{if(!n||n.className.match(/map-loaded/))return;if(e.detail.placeId){const t=document.createElement("iframe");t.style.width=e.detail.instance.width,t.style.height=e.detail.instance.height,t.style.border="0",t.frameborder="0",t.src="https://www.google.com/maps/embed/v1/place?key="+window.aioseoMapOptions.apiKey+"&q=place_id:"+e.detail.placeId,n.replaceChildren(t),n.className+=" map-loaded";return}new google.maps.plugins.loader.Loader({apiKey:window.aioseoMapOptions.apiKey,libraries:["places"]}).load().then(t=>{const o=new t.maps.Map(n,e.detail.mapOptions),i=new t.maps.Marker({map:o,position:e.detail.mapOptions.center,icon:e.detail.customMarker?{url:e.detail.customMarker,origin:new t.maps.Point(0,0),anchor:new t.maps.Point(17,34),scaledSize:new t.maps.Size(25,25)}:null});if(e.detail.infoWindowContent){const d=new t.maps.InfoWindow({content:e.detail.infoWindowContent});d.open(o,i),i.addListener("click",()=>{d.open({anchor:i,map:o,shouldFocus:!1})})}n.className+=" map-loaded"}).catch(t=>{console.error(t)})};var r;document.addEventListener((r=window==null?void 0:window.aioseoMapOptions)==null?void 0:r.mapLoadEvent,function(e){s({selector:e.detail.element,parent:document.querySelector("body"),done:n=>{e.detail===null||!e.detail||!e.detail.element||!e.detail.mapOptions||c(e,n)}})});
