/*! For license information please see app_Site.Controllers.MapElementController.js.LICENSE.txt */ !function(){var t={4283:function(t){function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}function DBSCAN(t,r,o,i){this.dataset=[],this.epsilon=1,this.minPts=2,this.distance=this._euclideanDistance,this.clusters=[],this.noise=[],this._visited=[],this._assigned=[],this._datasetLength=0,this._init(t,r,o,i)}DBSCAN.prototype.run=function(t,r,o,i){this._init(t,r,o,i);for(var a=0;a=this.minPts&&(r=this._mergeArrays(r,a))}1!==this._assigned[i]&&this._addToCluster(i,t)}},DBSCAN.prototype._addToCluster=function(t,r){this.clusters[r].push(t),this._assigned[t]=1},DBSCAN.prototype._regionQuery=function(t){for(var r=[],o=0;o0){for(p=0;p=0);return t},KMEANS.prototype.assign=function(){for(var t,r=!1,o=this.dataset.length,i=0;i=this.minPts)return o}},OPTICS.prototype._regionQuery=function(t,r){r=r||this.epsilon;for(var o=[],i=0,a=this.dataset.length;ia&&(o=i):r=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(t){throw t},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u,l=!0,c=!1;return{s:function s(){o=o.call(t)},n:function n(){var t=o.next();return l=t.done,t},e:function e(t){c=!0,u=t},f:function f(){try{l||null==o.return||o.return()}finally{if(c)throw u}}}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var o=0,i=new Array(r);o=0?a:-a;return i},dist:function dist(t,r,o){var i=Math.abs(t-r);return o?i:i*i}}},9:function(t,r,o){"use strict";var i=o(5361),a=i.eudist,u=i.dist;t.exports={kmrand:function kmrand(t,r){for(var o={},i=[],a=r<<2,u=t.length,l=t[0].length>0;i.length0;){var c=t[Math.floor(Math.random()*u)],p=l?c.join("_"):"".concat(c);o[p]||(o[p]=!0,i.push(c))}if(i.length0,h=t[Math.floor(Math.random()*c)];p?h.join("_"):"".concat(h);for(l.push(h);l.length0,k=[];if(o)p="kmrand"==o?l(t,r):"kmpp"==o?c(t,r,a):o;else for(var C={},x=0;p.length>1;sort_select(t,r,l,i,a,u%2),sortKD(t,r,o,i,l-1,u+1),sortKD(t,r,o,l+1,a,u+1)}}function sort_select(t,r,o,i,a,u){for(;a>i;){if(a-i>600){var l=a-i+1,c=o-i+1,p=Math.log(l),h=.5*Math.exp(2*p/3),d=.5*Math.sqrt(p*h*(l-h)/l)*(c-l/2<0?-1:1);sort_select(t,r,o,Math.max(i,Math.floor(o-c*h/l+d)),Math.min(a,Math.floor(o+(l-c)*h/l+d)),u)}var m=r[2*o+u],g=i,y=a;for(swapItem(t,r,i,o),r[2*a+u]>m&&swapItem(t,r,i,a);gm;)y--}r[2*i+u]===m?swapItem(t,r,i,y):swapItem(t,r,++y,a),y<=o&&(i=y+1),o<=y&&(a=y-1)}}function swapItem(t,r,o,i){swap(t,o,i),swap(r,2*o,2*i),swap(r,2*o+1,2*i+1)}function swap(t,r,o){var i=t[r];t[r]=t[o],t[o]=i}function sqDist(t,r,o,i){var a=t-o,u=r-i;return a*a+u*u}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,r){for(var o=0;o1&&void 0!==arguments[1]?arguments[1]:l,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:c,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:64,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:Float64Array;_classCallCheck(this,KDBush),this.nodeSize=i,this.points=t;for(var u=t.length<65536?Uint16Array:Uint32Array,p=this.ids=new u(t.length),h=this.coords=new a(2*t.length),d=0;d=o&&c<=a&&p>=i&&p<=u&&d.push(t[_]);else{var v=Math.floor((y+g)/2);c=r[2*v],p=r[2*v+1],c>=o&&c<=a&&p>=i&&p<=u&&d.push(t[v]);var b=(m+1)%2;(0===m?o<=c:i<=p)&&(h.push(y),h.push(v-1),h.push(b)),(0===m?a>=c:u>=p)&&(h.push(v+1),h.push(g),h.push(b))}}return d}(this.ids,this.coords,t,r,o,i,this.nodeSize)}},{key:"within",value:function within(t,r,o){return function within_within(t,r,o,i,a,u){for(var l=[0,t.length-1,0],c=[],p=a*a;l.length;){var h=l.pop(),d=l.pop(),m=l.pop();if(d-m<=u)for(var g=m;g<=d;g++)sqDist(r[2*g],r[2*g+1],o,i)<=p&&c.push(t[g]);else{var y=Math.floor((m+d)/2),_=r[2*y],v=r[2*y+1];sqDist(_,v,o,i)<=p&&c.push(t[y]);var b=(h+1)%2;(0===h?o-a<=_:i-a<=v)&&(l.push(m),l.push(y-1),l.push(b)),(0===h?o+a>=_:i+a>=v)&&(l.push(y+1),l.push(d),l.push(b))}}return c}(this.ids,this.coords,t,r,o,this.nodeSize)}}]),KDBush}();function _slicedToArray(t,r){return function _arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function _iterableToArrayLimit(t,r){var o=null==t?null:"undefined"!==typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==o)return;var i,a,u=[],l=!0,c=!1;try{for(o=o.call(t);!(l=(i=o.next()).done)&&(u.push(i.value),!r||u.length!==r);l=!0);}catch(p){c=!0,a=p}finally{try{l||null==o.return||o.return()}finally{if(c)throw a}}return u}(t,r)||_unsupportedIterableToArray(t,r)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _createForOfIteratorHelper(t,r){var o="undefined"!==typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!o){if(Array.isArray(t)||(o=_unsupportedIterableToArray(t))||r&&t&&"number"===typeof t.length){o&&(t=o);var i=0,a=function F(){};return{s:a,n:function n(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(t){throw t},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u,l=!0,c=!1;return{s:function s(){o=o.call(t)},n:function n(){var t=o.next();return l=t.done,t},e:function e(t){c=!0,u=t},f:function f(){try{l||null==o.return||o.return()}finally{if(c)throw u}}}}function _unsupportedIterableToArray(t,r){if(t){if("string"===typeof t)return _arrayLikeToArray(t,r);var o=Object.prototype.toString.call(t).slice(8,-1);return"Object"===o&&t.constructor&&(o=t.constructor.name),"Map"===o||"Set"===o?Array.from(t):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?_arrayLikeToArray(t,r):void 0}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var o=0,i=new Array(r);o=i;b--){var k=+Date.now();_=this._cluster(_,b),this.trees[b]=new p(_,getX,getY,u,Float32Array),o&&console.log("z%d: %d clusters in %dms",b,_.length,+Date.now()-k)}return o&&console.timeEnd("total time"),this}},{key:"getClusters",value:function getClusters(t,r){var o=((t[0]+180)%360+360)%360-180,i=Math.max(-90,Math.min(90,t[1])),a=180===t[2]?180:((t[2]+180)%360+360)%360-180,u=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)o=-180,a=180;else if(o>a){var l=this.getClusters([o,i,180,u],r),c=this.getClusters([-180,i,a,u],r);return l.concat(c)}var p,h=this.trees[this._limitZoom(r)],d=[],m=_createForOfIteratorHelper(h.range(lngX(o),latY(u),lngX(a),latY(i)));try{for(m.s();!(p=m.n()).done;){var g=p.value,y=h.points[g];d.push(y.numPoints?getClusterJSON(y):this.points[y.index])}}catch(_){m.e(_)}finally{m.f()}return d}},{key:"getChildren",value:function getChildren(t){var r=this._getOriginId(t),o=this._getOriginZoom(t),i="No cluster with the specified id.",a=this.trees[o];if(!a)throw new Error(i);var u=a.points[r];if(!u)throw new Error(i);var l,c=this.options.radius/(this.options.extent*Math.pow(2,o-1)),p=[],h=_createForOfIteratorHelper(a.within(u.x,u.y,c));try{for(h.s();!(l=h.n()).done;){var d=l.value,m=a.points[d];m.parentId===t&&p.push(m.numPoints?getClusterJSON(m):this.points[m.index])}}catch(g){h.e(g)}finally{h.f()}if(0===p.length)throw new Error(i);return p}},{key:"getLeaves",value:function getLeaves(t,r,o){r=r||10,o=o||0;var i=[];return this._appendLeaves(i,t,r,o,0),i}},{key:"getTile",value:function getTile(t,r,o){var i=this.trees[this._limitZoom(t)],a=Math.pow(2,t),u=this.options,l=u.extent,c=u.radius/l,p=(o-c)/a,h=(o+1+c)/a,d={features:[]};return this._addTileFeatures(i.range((r-c)/a,p,(r+1+c)/a,h),i.points,r,o,a,d),0===r&&this._addTileFeatures(i.range(1-c/a,p,1,h),i.points,a,o,a,d),r===a-1&&this._addTileFeatures(i.range(0,p,c/a,h),i.points,-1,o,a,d),d.features.length?d:null}},{key:"getClusterExpansionZoom",value:function getClusterExpansionZoom(t){for(var r=this._getOriginZoom(t)-1;r<=this.options.maxZoom;){var o=this.getChildren(t);if(r++,1!==o.length)break;t=o[0].properties.cluster_id}return r}},{key:"_appendLeaves",value:function _appendLeaves(t,r,o,i,a){var u,l=_createForOfIteratorHelper(this.getChildren(r));try{for(l.s();!(u=l.n()).done;){var c=u.value,p=c.properties;if(p&&p.cluster?a+p.point_count<=i?a+=p.point_count:a=this._appendLeaves(t,p.cluster_id,o,i,a):ar&&(v+=C.numPoints||1)}}catch(N){b.e(N)}finally{b.f()}if(v>_&&v>=c){var x,w=d.x*_,P=d.y*_,M=l&&_>1?this._map(d,!0):null,O=(h<<5)+(r+1)+this.points.length,S=_createForOfIteratorHelper(y);try{for(S.s();!(x=S.n()).done;){var A=x.value,I=g.points[A];if(!(I.zoom<=r)){I.zoom=r;var E=I.numPoints||1;w+=I.x*E,P+=I.y*E,I.parentId=O,l&&(M||(M=this._map(d,!0)),l(M,this._map(I)))}}}catch(N){S.e(N)}finally{S.f()}d.parentId=O,o.push(createCluster(w/v,P/v,O,v,M))}else if(o.push(d),v>1){var T,L=_createForOfIteratorHelper(y);try{for(L.s();!(T=L.n()).done;){var j=T.value,D=g.points[j];D.zoom<=r||(D.zoom=r,o.push(D))}}catch(N){L.e(N)}finally{L.f()}}}}return o}},{key:"_getOriginId",value:function _getOriginId(t){return t-this.points.length>>5}},{key:"_getOriginZoom",value:function _getOriginZoom(t){return(t-this.points.length)%32}},{key:"_map",value:function _map(t,r){if(t.numPoints)return r?extend({},t.properties):t.properties;var o=this.points[t.index].properties,i=this.options.map(o);return r&&i===o?extend({},i):i}}]),Supercluster}();function createCluster(t,r,o,i,a){return{x:m(t),y:m(r),zoom:1/0,id:o,parentId:-1,numPoints:i,properties:a}}function getClusterJSON(t){return{type:"Feature",id:t.id,properties:getClusterProperties(t),geometry:{type:"Point",coordinates:[(i=t.x,360*(i-.5)),(r=t.y,o=(180-360*r)*Math.PI/180,360*Math.atan(Math.exp(o))/Math.PI-90)]}};var r,o,i}function getClusterProperties(t){var r=t.numPoints,o=r>=1e4?"".concat(Math.round(r/1e3),"k"):r>=1e3?"".concat(Math.round(r/100)/10,"k"):r;return extend(extend({},t.properties),{cluster:!0,cluster_id:t.id,point_count:r,point_count_abbreviated:o})}function lngX(t){return t/360+.5}function latY(t){var r=Math.sin(t*Math.PI/180),o=.5-.25*Math.log((1+r)/(1-r))/Math.PI;return o<0?0:o>1?1:o}function extend(t,r){for(var o in r)t[o]=r[o];return t}function getX(t){return t.x}function getY(t){return t.y}var y=__webpack_require__(3564),_=__webpack_require__.n(y);function index_esm_typeof(t){return index_esm_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},index_esm_typeof(t)}function index_esm_slicedToArray(t,r){return function index_esm_arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function index_esm_iterableToArrayLimit(t,r){var o=null==t?null:"undefined"!==typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==o)return;var i,a,u=[],l=!0,c=!1;try{for(o=o.call(t);!(l=(i=o.next()).done)&&(u.push(i.value),!r||u.length!==r);l=!0);}catch(p){c=!0,a=p}finally{try{l||null==o.return||o.return()}finally{if(c)throw a}}return u}(t,r)||index_esm_unsupportedIterableToArray(t,r)||function index_esm_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _toConsumableArray(t){return function _arrayWithoutHoles(t){if(Array.isArray(t))return index_esm_arrayLikeToArray(t)}(t)||function _iterableToArray(t){if("undefined"!==typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||index_esm_unsupportedIterableToArray(t)||function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function index_esm_unsupportedIterableToArray(t,r){if(t){if("string"===typeof t)return index_esm_arrayLikeToArray(t,r);var o=Object.prototype.toString.call(t).slice(8,-1);return"Object"===o&&t.constructor&&(o=t.constructor.name),"Map"===o||"Set"===o?Array.from(t):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?index_esm_arrayLikeToArray(t,r):void 0}}function index_esm_arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var o=0,i=new Array(r);othis.maxZoom&&i.zoom>this.maxZoom||(r=r||!_()(this.state,i)),this.state=i,r&&(this.clusters=this.cluster(t)),{clusters:this.clusters,changed:r}}},{key:"cluster",value:function cluster(t){var r=t.map;return this.superCluster.getClusters([-180,-90,180,90],Math.round(r.getZoom())).map(this.transformCluster.bind(this))}},{key:"transformCluster",value:function transformCluster(t){var r=index_esm_slicedToArray(t.geometry.coordinates,2),o=r[0],i=r[1],a=t.properties;if(a.cluster)return new v({markers:this.superCluster.getLeaves(a.cluster_id,1/0).map((function(t){return t.properties.marker})),position:new google.maps.LatLng({lat:i,lng:o})});var u=a.marker;return new v({markers:[u],position:u.getPosition()})}}]),SuperClusterAlgorithm}(b),x=index_esm_createClass((function ClusterStats(t,r){index_esm_classCallCheck(this,ClusterStats),this.markers={sum:t.length};var o=r.map((function(t){return t.count})),i=o.reduce((function(t,r){return t+r}),0);this.clusters={count:r.length,markers:{mean:i/r.length,sum:i,min:Math.min.apply(Math,_toConsumableArray(o)),max:Math.max.apply(Math,_toConsumableArray(o))}}})),w=function(){function DefaultRenderer(){index_esm_classCallCheck(this,DefaultRenderer)}return index_esm_createClass(DefaultRenderer,[{key:"render",value:function render(t,r){var o=t.count,i=t.position,a=o>Math.max(10,r.clusters.markers.mean)?"#ff0000":"#0000ff",u=window.btoa('\n \n \n \n \n '));return new google.maps.Marker({position:i,icon:{url:"data:image/svg+xml;base64,".concat(u),scaledSize:new google.maps.Size(45,45)},label:{text:String(o),color:"rgba(255,255,255,0.9)",fontSize:"12px"},title:"Cluster of ".concat(o," markers"),zIndex:Number(google.maps.Marker.MAX_ZINDEX)+o})}}]),DefaultRenderer}();var P,M=index_esm_createClass((function OverlayViewSafe(){index_esm_classCallCheck(this,OverlayViewSafe),function index_esm_extend(t,r){for(var o in r.prototype)t.prototype[o]=r.prototype[o]}(OverlayViewSafe,google.maps.OverlayView)}));!function(t){t.CLUSTERING_BEGIN="clusteringbegin",t.CLUSTERING_END="clusteringend",t.CLUSTER_CLICK="click"}(P||(P={}));var O=function defaultOnClusterClickHandler(t,r,o){o.fitBounds(r.bounds)},S=function(t){_inherits(MarkerClusterer,t);var r=_createSuper(MarkerClusterer);function MarkerClusterer(t){var o,i=t.map,a=t.markers,u=void 0===a?[]:a,l=t.algorithm,c=void 0===l?new C({}):l,p=t.renderer,h=void 0===p?new w:p,d=t.onClusterClick,m=void 0===d?O:d;return index_esm_classCallCheck(this,MarkerClusterer),(o=r.call(this)).markers=_toConsumableArray(u),o.clusters=[],o.algorithm=c,o.renderer=h,o.onClusterClick=m,i&&o.setMap(i),o}return index_esm_createClass(MarkerClusterer,[{key:"addMarker",value:function addMarker(t,r){this.markers.includes(t)||(this.markers.push(t),r||this.render())}},{key:"addMarkers",value:function addMarkers(t,r){var o=this;t.forEach((function(t){o.addMarker(t,!0)})),r||this.render()}},{key:"removeMarker",value:function removeMarker(t,r){var o=this.markers.indexOf(t);return-1!==o&&(t.setMap(null),this.markers.splice(o,1),r||this.render(),!0)}},{key:"removeMarkers",value:function removeMarkers(t,r){var o=this,i=!1;return t.forEach((function(t){i=o.removeMarker(t,!0)||i})),i&&!r&&this.render(),i}},{key:"clearMarkers",value:function clearMarkers(t){this.markers.length=0,t||this.render()}},{key:"render",value:function render(){var t=this.getMap();if(t instanceof google.maps.Map&&this.getProjection()){google.maps.event.trigger(this,P.CLUSTERING_BEGIN,this);var r=this.algorithm.calculate({markers:this.markers,map:t,mapCanvasProjection:this.getProjection()}),o=r.clusters,i=r.changed;(i||void 0==i)&&(this.reset(),this.clusters=o,this.renderClusters()),google.maps.event.trigger(this,P.CLUSTERING_END,this)}}},{key:"onAdd",value:function onAdd(){this.idleListener=this.getMap().addListener("idle",this.render.bind(this)),this.render()}},{key:"onRemove",value:function onRemove(){google.maps.event.removeListener(this.idleListener),this.reset()}},{key:"reset",value:function reset(){this.markers.forEach((function(t){return t.setMap(null)})),this.clusters.forEach((function(t){return t.delete()})),this.clusters=[]}},{key:"renderClusters",value:function renderClusters(){var t=this,r=new x(this.markers,this.clusters),o=this.getMap();this.clusters.forEach((function(i){1===i.markers.length?i.marker=i.markers[0]:(i.marker=t.renderer.render(i,r),t.onClusterClick&&i.marker.addListener("click",(function(r){google.maps.event.trigger(t,P.CLUSTER_CLICK,i),t.onClusterClick(r,i,o)}))),i.marker.setMap(o)}))}}]),MarkerClusterer}(M);function map_google_marker_typeof(t){return map_google_marker_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},map_google_marker_typeof(t)}function map_google_marker_defineProperties(t,r){for(var o=0;o',i.divClass=t.divClass,i.align=t.align,i.isDebugMode=t.debug,i.onClick=t.onClick,i.onMouseOver=t.onMouseOver,i.isBoolean=function(t){return"boolean"===typeof t},i.isNotUndefined=function(t){return"undefined"!==typeof t},i.hasContent=function(t){return t.length>0},i.isString=function(t){return"string"===typeof t},i.isFunction=function(t){return"function"===typeof t},o}return function map_google_marker_createClass(t,r,o){return r&&map_google_marker_defineProperties(t.prototype,r),o&&map_google_marker_defineProperties(t,o),Object.defineProperty(t,"prototype",{writable:!1}),t}(GoogleMapsHtmlOverlay,[{key:"onAdd",value:function onAdd(){var t=this;t.div=document.createElement("div"),t.div.style.position="absolute",t.isNotUndefined(t.divClass)&&t.hasContent(t.divClass)&&(t.div.className=t.divClass),t.isNotUndefined(t.html)&&t.hasContent(t.html)&&t.isString(t.html)&&(t.div.innerHTML=t.html),t.isBoolean(t.isDebugMode)&&t.isDebugMode&&(t.div.className="debug-mode",t.div.innerHTML='
Debug mode
',t.div.setAttribute("style","position: absolute;border: 5px dashed red;height: 150px;width: 150px;display: flex;justify-content: center;align-items: center;")),t.getPanes().overlayMouseTarget.appendChild(t.div),google.maps.event.addDomListener(t.div,"click",(function(r){google.maps.event.trigger(t,"click"),t.isFunction(t.onClick)&&t.onClick(),r.stopPropagation()})),google.maps.event.addDomListener(t.div,"mouseover",(function(r){google.maps.event.trigger(t,"mouseover"),t.isFunction(t.onMouseOver)&&t.onMouseOver(),r.stopPropagation()}))}},{key:"draw",value:function draw(){var t=this,r=document.querySelector(".popup");r.length||(r=t.div);var o=t.getProjection();if(!o)return console.log("GoogleMapsHtmlOverlay: current map is missing"),null;var i=o.fromLatLngToDivPixel(t.getPosition()),a={y:void 0,x:void 0},u=r.offsetWidth,l=r.offsetHeight;switch(Array.isArray(t.align)?t.align.join(" "):""){case"left top":a.y=l,a.x=u;break;case"left center":a.y=l/2,a.x=u;break;case"left bottom":a.y=0,a.x=u;break;case"center top":a.y=l,a.x=u/2;break;case"center center":default:a.y=l/2,a.x=u/2;break;case"center bottom":a.y=0,a.x=u/2;break;case"right top":a.y=l,a.x=0;break;case"right center":a.y=l/2,a.x=0;break;case"right bottom":a.y=0,a.x=0}t.div.style.top="".concat(i.y-a.y,"px"),t.div.style.left="".concat(i.x-a.x,"px")}},{key:"getPosition",value:function getPosition(){return new google.maps.LatLng(this.position)}},{key:"getDiv",value:function getDiv(){return this.div}},{key:"setPosition",value:function setPosition(t,r){var o=this;o.position=t,o.align=r,o.draw()}},{key:"remove",value:function remove(){this.setMap(null),this.div.remove()}},{key:"getDraggable",value:function getDraggable(){return!1}}]),GoogleMapsHtmlOverlay}()}};function map_google_defineProperties(t,r){for(var o=0;o1&&void 0!==arguments[1]?arguments[1]:[],i=this;i.el=r,i.config=o,i.markers=[],t["init".concat(i.getName())]=function(){i.googleApiLoaded()};var a=document.createElement("script");a.src="https://maps.googleapis.com/maps/api/js?key=".concat(o.key,"&callback=init").concat(i.getName()),a.async=!0,a.defer=!0,document.head.appendChild(a)}},{key:"googleApiLoaded",value:function googleApiLoaded(){var t=this,r=t.el,o=t.config,a=r.querySelector(".mapAPI-map"),u=o.mapZoom&&"0"!==o.mapZoom?parseInt(o.mapZoom):10,l=o.center&&","!==o.center?{lat:o.center[1],lng:o.center[0]}:{lat:0,lng:0},c=o.style?o.style:null;console.log("".concat(t.getName(),": API is loaded")),t.MarkerUI=A.init(),t.map=new google.maps.Map(a,{zoom:u,center:l,fullscreenControl:!0,styles:c}),t.default_zoom=u,a.classList.add("mapboxgl-map"),t.popup=new t.MarkerUI({map:t.map,align:["center","top"],divClass:"mapboxgl-popup popup mapboxgl-popup-anchor-bottom d-none",html:'
\xd7
'}),t.popup.setMap(t.map),t.geocoder=new google.maps.Geocoder,t.cluster=new S(t.map,null,{styles:[{width:30,height:30,className:"mapboxgl-cluster"}]}),r.dispatchEvent(new Event(i))}},{key:"addMarker",value:function addMarker(t,r){var o=this,i={lat:t[1],lng:t[0]},u=new o.MarkerUI({position:i,map:o.map,align:["center","top"],html:'
').concat(r.icon,"
"),onClick:function onClick(){var t=document.querySelector("#Marker".concat(r.id));o.showPopup(i,r.content),t.dispatchEvent(new Event(a))}});return o.markers.push(u),o.cluster.addMarker(u),u}},{key:"showPopup",value:function showPopup(t,r){var o=this,i=o.popup.getDiv();o.config.flyToMarker&&(o.map.setCenter(t),o.config.noZoom||o.map.setZoom(18)),i.style.opacity="0",i.classList.remove("d-none"),i.querySelector(".mapboxgl-popup-content .html").innerHTML=r,i.querySelector(".mapboxgl-popup-close-button").addEventListener("click",(function(t){t.preventDefault(),o.hidePopup()})),o.popup.setPosition(t,["center","top"]),i.style.opacity="1",i.style["margin-top"]="-1rem"}},{key:"hidePopup",value:function hidePopup(){var t=this;t.popup.getDiv().classList.add("d-none"),t.config.noRestoreBounds&&!t.config.flyToBounds||t.restoreBounds(),t.el.dispatchEvent(new Event(u))}},{key:"geocode",value:function geocode(t,r){var o=this;o.geocoder.geocode({address:t},(function(t,i){if("OK"===i)return"function"===typeof r&&r(t),t;console.error("".concat(o.getName(),": Geocode was not successful for the following reason: ").concat(i))}))}},{key:"reverseGeocode",value:function reverseGeocode(t,r){var o=this;o.geocoder.geocode({location:latlng},(function(t,i){if("OK"===i)return"function"===typeof r&&r(t),t;console.error("".concat(o.getName(),": Reverse Geocoding was not successful for the following reason: ").concat(i))}))}},{key:"addGeoJson",value:function addGeoJson(t){var r=this,o=JSON.parse(t.geojson),i=(o.features[0].geometry.coordinates,new google.maps.LatLngBounds);o.features.forEach((function(o){var a=o.id,u=o.geometry.coordinates,l=o.properties.content;r.addMarker(u,{id:a,content:l,icon:o.icon,flyToMarker:t.flyToMarker}),i.extend({lat:u[1],lng:u[0]})})),r.markers.length>1?r.map.fitBounds(i,{padding:30}):r.markers[0]&&r.map.setCenter(r.markers[0].getPosition()),r.default_bounds=i,r.default_zoom=r.map.getZoom()}},{key:"getMap",value:function getMap(){return this.map}},{key:"getPopup",value:function getPopup(){return this.popup}},{key:"restoreBounds",value:function restoreBounds(){var t=this;t.default_bounds&&t.markers.length>1?t.map.fitBounds(t.default_bounds,{padding:30}):(t.markers[0]&&t.map.setCenter(t.markers[0].getPosition()),t.restoreZoom())}},{key:"restoreZoom",value:function restoreZoom(){this.map.setZoom(this.default_zoom)}}]),GoogleMapsDriver}();return r}(window),E={ENVS:["xs","sm","md","lg","xl","xxl","xxxl"],MAP_DRIVER:I};function map_api_defineProperties(t,r){for(var o=0;o'),console.log("".concat(u,": init ").concat(o.getName(),"...")),r.drv=o,r.el=t,r.config=c,o.init(t,c),t.addEventListener(i,(function(){r.addMarkers()}))}return function map_api_createClass(t,r,o){return r&&map_api_defineProperties(t.prototype,r),o&&map_api_defineProperties(t,o),Object.defineProperty(t,"prototype",{writable:!1}),t}(MapAPI,[{key:"getMap",value:function getMap(){return ui.map}},{key:"dispose",value:function dispose(){this.el=null,this.el.classList.remove("".concat(u,"-active"))}},{key:"addMarkers",value:function addMarkers(){console.log("".concat(u,": addMarkers"));var t=this,r=t.el,i=t.drv,a=t.config;if(t.map=i.getMap(),a.geojson)console.log("".concat(u,": setting up geocode data")),i.addGeoJson(a);else if(a.address)console.log(a.address),console.log("".concat(u,": setting up address marker")),i.geocode(a.address,(function(r){console.log(r);var o=r[0].geometry.location.lat(),l=r[0].geometry.location.lng();console.log("".concat(u,": setting up single lat/lng marker lat: ").concat(o," lng: ").concat(l)),i.addMarker([l,o],a),t.map.setCenter({lat:o,lng:l})}));else if(a.lat&&a.lng){var l=a.lat,c=a.lng;console.log("".concat(u,": setting up single lat/lng marker lat: ").concat(l," lng: ").concat(c)),i.addMarker([c,l],a)}r.classList.add("".concat(u,"-active")),r.dispatchEvent(new Event(o)),console.log("".concat(u,": Map is loaded"))}}]),MapAPI}(),p=function init(){console.log("".concat(u,": init")),document.querySelectorAll(".".concat(u)).forEach((function(t,r){new c(t)}))};a.addEventListener("".concat(r),p),a.addEventListener("".concat(t),p)}(window)}()}();