File: /home/zeusxp5/chuair.org/wp-content/plugins/wd-framework/build/product-attributes/view.js
!function(){"use strict";window.React,document.addEventListener("DOMContentLoaded",(function(){const e=document.querySelectorAll(".map-line");if(e.length){function o(e,o){const t=o/111320/2,a=(Math.random()-.5)*t,l=(Math.random()-.5)*t;return{lat:e.lat+a,lng:e.lng+l}}function t(e,o,t,a){e.geocode({location:a}).then((e=>{if(e.results[0]){o.setZoom(10);const l=new google.maps.Marker({position:a,map:o});for(const o of e.results)if(o.types.includes("political")){t.setContent(`<p>${o.formatted_address}</p>`);break}t.open(o,l)}else window.alert("No results found")})).catch((e=>window.alert("Geocoder failed due to: "+e)))}e.forEach((e=>{const a=e.querySelector("#locationInfo").dataset.mapApi,l=JSON.parse(e.querySelector("#locationInfo").value),n=parseInt(e.querySelector("#zoomLevel").value),r=JSON.parse(e.querySelector("#locationInfo").dataset.areas);if("google"==a){const a=new google.maps.Geocoder,s=new google.maps.InfoWindow;let i;fetch(`${devia.home_url}/wp-content/plugins/wd-framework/includes/map-styles/map-style.json`).then((e=>e.json())).then((e=>i=e));try{""!=e.querySelector("#locationInfo").dataset.mapStyle?i=JSON.parse(e.querySelector("#locationInfo").dataset.mapStyle):alert("Empty custom map style, please enter a valid custom JSON value or choose from the available.")}catch(e){alert("Invalid custom map style JSON, the fallback style will be shown instead!")}const c=new google.maps.StyledMapType(i,{name:"Styled Map"}),p=new google.maps.Map(e.querySelector("#map"),{center:l,zoom:n,mapTypeControl:!1});if(p.mapTypes.set("map_style",c),p.setMapTypeId("map_style"),r.hasAreas){const e=r.areasWidth;new google.maps.Circle({strokeColor:"orange",strokeOpacity:.8,strokeWeight:2,fillColor:"orange",fillOpacity:.35,map:p,center:o(l,e),radius:e})}else t(a,p,s,l)}else{var s=L.map("map").setView([l.lat,l.lng],n);L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:"Map data © OpenStreetMap contributors",maxZoom:18}).addTo(s);var i=L.icon({iconUrl:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSIjRUQyOTM5Ij48cGF0aCBkPSJNMTIgMGMtNC4xOTggMC04IDMuNDAzLTggNy42MDIgMCA0LjE5OCAzLjQ2OSA5LjIxIDggMTYuMzk4IDQuNTMxLTcuMTg4IDgtMTIuMiA4LTE2LjM5OCAwLTQuMTk5LTMuODAxLTcuNjAyLTgtNy42MDJ6bTAgMTRjLTMuMzE0IDAtNi0yLjY4Ni02LTZzMi42ODYtNiA2LTYgNiAyLjY4NiA2IDYtMi42ODYgNi02IDZ6Ii8+PC9zdmc+",iconSize:[32,32],iconAnchor:[16,32],popupAnchor:[0,-32]});if(r.hasAreas){const e=r.areasWidth;L.circle([o(l,e).lat,o(l,e).lng],{color:"var(--accent-color)",fillColor:"var(--primary-color)",fillOpacity:.5,radius:e}).addTo(s)}else L.marker([l.lat,l.lng],{icon:i}).addTo(s)}}))}}))}();