vue3-google-map 0.20.0 → 0.21.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -15,6 +15,7 @@ Note: Please refer to the [documentation site](https://vue3-google-map.com/) for
15
15
  - [Installation](#installation)
16
16
  - [Your First Map](#your-first-map)
17
17
  - [Components](#components)
18
+ - [Advanced Marker](#advanced-marker)
18
19
  - [Marker](#marker)
19
20
  - [Polyline](#polyline)
20
21
  - [Polygon](#polygon)
@@ -58,6 +59,8 @@ All the map components are available on the `Vue3GoogleMap` global variable.
58
59
  To construct a map using `vue3-google-map` you'll need to use the base `GoogleMap` component which receives your [Google Maps API key](https://developers.google.com/maps/documentation/javascript/get-api-key), styles (e.g. setting width and height), and any [MapOptions](https://developers.google.com/maps/documentation/javascript/reference/map#MapOptions) to configure your map ([see this](https://github.com/inocan-group/vue3-google-map/blob/develop/src/components/GoogleMap.vue#L36-L230) for all the supported `MapOptions`).
59
60
  Other map features can be added to your map by passing map subcomponents ([Marker](#marker), [Polyline](#polyline), [Polygon](#polygon), [Rectangle](#rectangle), [Circle](#circle), [InfoWindow](#info-window), [CustomMarker](#custom-marker), [CustomControl](#custom-control), or [MarkerCluster](#marker-cluster)) to the default slot of the `GoogleMap` component.
60
61
 
62
+ The [the following events](https://developers.google.com/maps/documentation/javascript/reference/map#Map-Events) will be emitted by the `GoogleMap` component and can be listened to by using `@event_name`.
63
+
61
64
  ```vue
62
65
  <script setup>
63
66
  import { GoogleMap, Marker } from 'vue3-google-map'
@@ -83,6 +86,7 @@ This library is intended to be used in a composable fashion. Therefore you will
83
86
 
84
87
  The main mapping component is `GoogleMap`, however the following components are available at your disposal:
85
88
 
89
+ - [AdvancedMarker](#advanced-marker)
86
90
  - [Marker](#marker)
87
91
  - [Polyline](#polyline)
88
92
  - [Polygon](#polygon)
@@ -93,6 +97,44 @@ The main mapping component is `GoogleMap`, however the following components are
93
97
  - [CustomControl](#custom-control)
94
98
  - [MarkerCluster](#marker-cluster)
95
99
 
100
+ ### Advanced Marker
101
+
102
+ Use the `AdvancedMarker` component to draw markers, drop pins or any custom icons on a map. `AdvancedMarker` is the new version offered by google when deprecated the `Marker` component ([read more here](https://developers.google.com/maps/deprecations#googlemapsmarker_in_the_deprecated_as_of_february_2024)).
103
+
104
+ In order to use the `AdvancedMarker` component is necessary to specify a MapId on declaring the `GoogleMap` component ([see more here](https://developers.google.com/maps/documentation/javascript/advanced-markers/start#create_a_map_id)).
105
+
106
+ #### Options
107
+
108
+ You can pass a [AdvancedMarkerElementOptions](https://developers.google.com/maps/documentation/javascript/reference/advanced-markers#AdvancedMarkerElementOptions) object to the `options` prop to configure your marker.
109
+
110
+ You can also pass a [PinElementOptions interface](https://developers.google.com/maps/documentation/javascript/reference/advanced-markers#PinElementOptions) object to custumize pin used by the marker.
111
+
112
+ ```vue
113
+ <script setup>
114
+ import { GoogleMap, AdvancedMarker } from 'vue3-google-map'
115
+
116
+ const center = { lat: 40.689247, lng: -74.044502 }
117
+ const markerOptions = { position: center, label: 'L', title: 'LADY LIBERTY' }
118
+ const pinOptions = { background: '#FBBC04' }
119
+ </script>
120
+
121
+ <template>
122
+ <GoogleMap
123
+ api-key="YOUR_GOOGLE_MAPS_API_KEY"
124
+ mapId="DEMO_MAP_ID"
125
+ style="width: 100%; height: 500px"
126
+ :center="center"
127
+ :zoom="15"
128
+ >
129
+ <AdvancedMarker :options="markerOptions" :pin-options="pinOptions"/>
130
+ </GoogleMap>
131
+ </template>
132
+ ```
133
+
134
+ #### Events
135
+
136
+ You can listen for [the following events](https://developers.google.com/maps/documentation/javascript/reference/advanced-markers#AdvancedMarkerElement-Events) on the `AdvancedMarker` component.
137
+
96
138
  ### Marker
97
139
 
98
140
  Use the `Marker` component to draw markers, drop pins or any custom icons on a map.
package/dist/index.cjs CHANGED
@@ -1,5 +1,5 @@
1
- (function(){"use strict";try{if(typeof document<"u"){var a=document.createElement("style");a.appendChild(document.createTextNode(".mapdiv[data-v-dbf82c40]{width:100%;height:100%}.custom-control-wrapper[data-v-d099a3a6]{display:none}.mapdiv .custom-control-wrapper[data-v-d099a3a6]{display:inline-block}.info-window-wrapper[data-v-cbe1707b]{display:none}.mapdiv .info-window-wrapper[data-v-cbe1707b]{display:inline-block}.custom-marker-wrapper[data-v-2d2d343a]{display:none}.mapdiv .custom-marker-wrapper[data-v-2d2d343a]{display:inline-block}")),document.head.appendChild(a)}}catch(d){console.error("vite-plugin-css-injected-by-js",d)}})();
2
- "use strict";var ke=Object.defineProperty;var Ce=(n,e,t)=>e in n?ke(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var z=(n,e,t)=>(Ce(n,typeof e!="symbol"?e+"":e,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("vue"),R=Symbol("map"),j=Symbol("api"),he=Symbol("marker"),pe=Symbol("markerCluster"),F=Symbol("CustomMarker"),fe=Symbol("mapTilesLoaded"),T=["click","dblclick","drag","dragend","dragstart","mousedown","mousemove","mouseout","mouseover","mouseup","rightclick"];/*! *****************************************************************************
1
+ (function(){"use strict";try{if(typeof document<"u"){var a=document.createElement("style");a.appendChild(document.createTextNode(".mapdiv[data-v-d05fc6bc]{width:100%;height:100%}.custom-control-wrapper[data-v-d099a3a6]{display:none}.mapdiv .custom-control-wrapper[data-v-d099a3a6]{display:inline-block}.info-window-wrapper[data-v-cbe1707b]{display:none}.mapdiv .info-window-wrapper[data-v-cbe1707b]{display:inline-block}.custom-marker-wrapper[data-v-2d2d343a]{display:none}.mapdiv .custom-marker-wrapper[data-v-2d2d343a]{display:inline-block}")),document.head.appendChild(a)}}catch(d){console.error("vite-plugin-css-injected-by-js",d)}})();
2
+ "use strict";var Ce=Object.defineProperty;var Me=(s,e,t)=>e in s?Ce(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var z=(s,e,t)=>(Me(s,typeof e!="symbol"?e+"":e,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("vue"),I=Symbol("map"),T=Symbol("api"),Y=Symbol("marker"),J=Symbol("markerCluster"),F=Symbol("CustomMarker"),me=Symbol("mapTilesLoaded"),$=["click","dblclick","drag","dragend","dragstart","mousedown","mousemove","mouseout","mouseover","mouseup","rightclick"];/*! *****************************************************************************
3
3
  Copyright (c) Microsoft Corporation.
4
4
 
5
5
  Permission to use, copy, modify, and/or distribute this software for any
@@ -12,7 +12,7 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12
12
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
13
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
14
  PERFORMANCE OF THIS SOFTWARE.
15
- ***************************************************************************** */function be(n,e,t,r){function s(o){return o instanceof t?o:new t(function(a){a(o)})}return new(t||(t=Promise))(function(o,a){function c(d){try{h(r.next(d))}catch(u){a(u)}}function i(d){try{h(r.throw(d))}catch(u){a(u)}}function h(d){d.done?o(d.value):s(d.value).then(c,i)}h((r=r.apply(n,e||[])).next())})}var Me=function n(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var r,s,o;if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(s=r;s--!==0;)if(!n(e[s],t[s]))return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(s=r;s--!==0;)if(!Object.prototype.hasOwnProperty.call(t,o[s]))return!1;for(s=r;s--!==0;){var a=o[s];if(!n(e[a],t[a]))return!1}return!0}return e!==e&&t!==t};const Q="__googleMapsScriptId";var I;(function(n){n[n.INITIALIZED=0]="INITIALIZED",n[n.LOADING=1]="LOADING",n[n.SUCCESS=2]="SUCCESS",n[n.FAILURE=3]="FAILURE"})(I||(I={}));class S{constructor({apiKey:e,authReferrerPolicy:t,channel:r,client:s,id:o=Q,language:a,libraries:c=[],mapIds:i,nonce:h,region:d,retries:u=3,url:p="https://maps.googleapis.com/maps/api/js",version:f}){if(this.callbacks=[],this.done=!1,this.loading=!1,this.errors=[],this.apiKey=e,this.authReferrerPolicy=t,this.channel=r,this.client=s,this.id=o||Q,this.language=a,this.libraries=c,this.mapIds=i,this.nonce=h,this.region=d,this.retries=u,this.url=p,this.version=f,S.instance){if(!Me(this.options,S.instance.options))throw new Error(`Loader must not be called again with different options. ${JSON.stringify(this.options)} !== ${JSON.stringify(S.instance.options)}`);return S.instance}S.instance=this}get options(){return{version:this.version,apiKey:this.apiKey,channel:this.channel,client:this.client,id:this.id,libraries:this.libraries,language:this.language,region:this.region,mapIds:this.mapIds,nonce:this.nonce,url:this.url,authReferrerPolicy:this.authReferrerPolicy}}get status(){return this.errors.length?I.FAILURE:this.done?I.SUCCESS:this.loading?I.LOADING:I.INITIALIZED}get failed(){return this.done&&!this.loading&&this.errors.length>=this.retries+1}createUrl(){let e=this.url;return e+="?callback=__googleMapsCallback",this.apiKey&&(e+=`&key=${this.apiKey}`),this.channel&&(e+=`&channel=${this.channel}`),this.client&&(e+=`&client=${this.client}`),this.libraries.length>0&&(e+=`&libraries=${this.libraries.join(",")}`),this.language&&(e+=`&language=${this.language}`),this.region&&(e+=`&region=${this.region}`),this.version&&(e+=`&v=${this.version}`),this.mapIds&&(e+=`&map_ids=${this.mapIds.join(",")}`),this.authReferrerPolicy&&(e+=`&auth_referrer_policy=${this.authReferrerPolicy}`),e}deleteScript(){const e=document.getElementById(this.id);e&&e.remove()}load(){return this.loadPromise()}loadPromise(){return new Promise((e,t)=>{this.loadCallback(r=>{r?t(r.error):e(window.google)})})}importLibrary(e){return this.execute(),google.maps.importLibrary(e)}loadCallback(e){this.callbacks.push(e),this.execute()}setScript(){var e,t;if(document.getElementById(this.id)){this.callback();return}const r={key:this.apiKey,channel:this.channel,client:this.client,libraries:this.libraries.length&&this.libraries,v:this.version,mapIds:this.mapIds,language:this.language,region:this.region,authReferrerPolicy:this.authReferrerPolicy};Object.keys(r).forEach(o=>!r[o]&&delete r[o]),!((t=(e=window==null?void 0:window.google)===null||e===void 0?void 0:e.maps)===null||t===void 0)&&t.importLibrary||(o=>{let a,c,i,h="The Google Maps JavaScript API",d="google",u="importLibrary",p="__ib__",f=document,g=window;g=g[d]||(g[d]={});const m=g.maps||(g.maps={}),v=new Set,y=new URLSearchParams,w=()=>a||(a=new Promise((_,M)=>be(this,void 0,void 0,function*(){var C;yield c=f.createElement("script"),c.id=this.id,y.set("libraries",[...v]+"");for(i in o)y.set(i.replace(/[A-Z]/g,E=>"_"+E[0].toLowerCase()),o[i]);y.set("callback",d+".maps."+p),c.src=this.url+"?"+y,m[p]=_,c.onerror=()=>a=M(Error(h+" could not load.")),c.nonce=this.nonce||((C=f.querySelector("script[nonce]"))===null||C===void 0?void 0:C.nonce)||"",f.head.append(c)})));m[u]?console.warn(h+" only loads once. Ignoring:",o):m[u]=(_,...M)=>v.add(_)&&w().then(()=>m[u](_,...M))})(r);const s=this.libraries.map(o=>this.importLibrary(o));s.length||s.push(this.importLibrary("core")),Promise.all(s).then(()=>this.callback(),o=>{const a=new ErrorEvent("error",{error:o});this.loadErrorCallback(a)})}reset(){this.deleteScript(),this.done=!1,this.loading=!1,this.errors=[],this.onerrorEvent=null}resetIfRetryingFailed(){this.failed&&this.reset()}loadErrorCallback(e){if(this.errors.push(e),this.errors.length<=this.retries){const t=this.errors.length*Math.pow(2,this.errors.length);console.error(`Failed to load Google Maps script, retrying in ${t} ms.`),setTimeout(()=>{this.deleteScript(),this.setScript()},t)}else this.onerrorEvent=e,this.callback()}callback(){this.done=!0,this.loading=!1,this.callbacks.forEach(e=>{e(this.onerrorEvent)}),this.callbacks=[]}execute(){if(this.resetIfRetryingFailed(),this.done)this.callback();else{if(window.google&&window.google.maps&&window.google.maps.version){console.warn("Google Maps already loaded outside @googlemaps/js-api-loader.This may result in undesirable behavior as options and script parameters may not match."),this.callback();return}this.loading||(this.loading=!0,this.setScript())}}}function Ee(n){return class extends n.OverlayView{constructor(r){super();z(this,"element");z(this,"opts");const{element:s,...o}=r;this.element=s,this.opts=o,this.opts.map&&this.setMap(this.opts.map)}getPosition(){return this.opts.position?this.opts.position instanceof n.LatLng?this.opts.position:new n.LatLng(this.opts.position):null}getVisible(){if(!this.element)return!1;const r=this.element;return r.style.display!=="none"&&r.style.visibility!=="hidden"&&(r.style.opacity===""||Number(r.style.opacity)>.01)}onAdd(){if(!this.element)return;const r=this.getPanes();r&&r.overlayMouseTarget.appendChild(this.element)}draw(){if(!this.element)return;const r=this.getProjection(),s=r==null?void 0:r.fromLatLngToDivPixel(this.getPosition());if(s){this.element.style.position="absolute";const o=this.element.offsetHeight,a=this.element.offsetWidth;let c,i;switch(this.opts.anchorPoint){case"TOP_CENTER":c=s.x-a/2,i=s.y;break;case"BOTTOM_CENTER":c=s.x-a/2,i=s.y-o;break;case"LEFT_CENTER":c=s.x,i=s.y-o/2;break;case"RIGHT_CENTER":c=s.x-a,i=s.y-o/2;break;case"TOP_LEFT":c=s.x,i=s.y;break;case"TOP_RIGHT":c=s.x-a,i=s.y;break;case"BOTTOM_LEFT":c=s.x,i=s.y-o;break;case"BOTTOM_RIGHT":c=s.x-a,i=s.y-o;break;default:c=s.x-a/2,i=s.y-o/2}this.element.style.left=c+"px",this.element.style.top=i+"px",this.element.style.transform=`translateX(${this.opts.offsetX||0}px) translateY(${this.opts.offsetY||0}px)`,this.opts.zIndex&&(this.element.style.zIndex=this.opts.zIndex.toString())}}onRemove(){this.element&&this.element.remove()}setOptions(r){const{element:s,...o}=r;this.element=s,this.opts=o,this.draw()}}}let ee;const te=["bounds_changed","center_changed","click","contextmenu","dblclick","drag","dragend","dragstart","heading_changed","idle","isfractionalzoomenabled_changed","mapcapabilities_changed","maptypeid_changed","mousemove","mouseout","mouseover","projection_changed","renderingtype_changed","rightclick","tilesloaded","tilt_changed","zoom_changed"],Pe=l.defineComponent({props:{apiPromise:{type:Promise},apiKey:{type:String,default:""},version:{type:String,default:"weekly"},libraries:{type:Array,default:()=>["places"]},region:{type:String,required:!1},language:{type:String,required:!1},backgroundColor:{type:String,required:!1},center:{type:Object,default:()=>({lat:0,lng:0})},clickableIcons:{type:Boolean,required:!1,default:void 0},controlSize:{type:Number,required:!1},disableDefaultUi:{type:Boolean,required:!1,default:void 0},disableDoubleClickZoom:{type:Boolean,required:!1,default:void 0},draggable:{type:Boolean,required:!1,default:void 0},draggableCursor:{type:String,required:!1},draggingCursor:{type:String,required:!1},fullscreenControl:{type:Boolean,required:!1,default:void 0},fullscreenControlPosition:{type:String,required:!1},gestureHandling:{type:String,required:!1},heading:{type:Number,required:!1},isFractionalZoomEnabled:{type:Boolean,required:!1,default:void 0},keyboardShortcuts:{type:Boolean,required:!1,default:void 0},mapTypeControl:{type:Boolean,required:!1,default:void 0},mapTypeControlOptions:{type:Object,required:!1},mapTypeId:{type:[Number,String],required:!1},mapId:{type:String,required:!1},maxZoom:{type:Number,required:!1},minZoom:{type:Number,required:!1},noClear:{type:Boolean,required:!1,default:void 0},panControl:{type:Boolean,required:!1,default:void 0},panControlPosition:{type:String,required:!1},restriction:{type:Object,required:!1},rotateControl:{type:Boolean,required:!1,default:void 0},rotateControlPosition:{type:String,required:!1},scaleControl:{type:Boolean,required:!1,default:void 0},scaleControlStyle:{type:Number,required:!1},scrollwheel:{type:Boolean,required:!1,default:void 0},streetView:{type:Object,required:!1},streetViewControl:{type:Boolean,required:!1,default:void 0},streetViewControlPosition:{type:String,required:!1},styles:{type:Array,required:!1},tilt:{type:Number,required:!1},zoom:{type:Number,required:!1},zoomControl:{type:Boolean,required:!1,default:void 0},zoomControlPosition:{type:String,required:!1},nonce:{type:String,default:""}},emits:te,setup(n,{emit:e}){const t=l.ref(),r=l.ref(!1),s=l.ref(),o=l.ref(),a=l.ref(!1);l.provide(R,s),l.provide(j,o),l.provide(fe,a);const c=()=>{const u={...n};Object.keys(u).forEach(m=>{u[m]===void 0&&delete u[m]});const f=m=>{var v;return m?{position:(v=o.value)==null?void 0:v.ControlPosition[m]}:{}},g={scaleControlOptions:n.scaleControlStyle?{style:n.scaleControlStyle}:{},panControlOptions:f(n.panControlPosition),zoomControlOptions:f(n.zoomControlPosition),rotateControlOptions:f(n.rotateControlPosition),streetViewControlOptions:f(n.streetViewControlPosition),fullscreenControlOptions:f(n.fullscreenControlPosition),disableDefaultUI:n.disableDefaultUi};return{...u,...g}},i=l.watch([o,s],([u,p])=>{const f=u,g=p;f&&g&&(f.event.addListenerOnce(g,"tilesloaded",()=>{a.value=!0}),setTimeout(i,0))},{immediate:!0}),h=()=>{try{const{apiKey:u,region:p,version:f,language:g,libraries:m,nonce:v}=n;ee=new S({apiKey:u,region:p,version:f,language:g,libraries:m,nonce:v})}catch(u){console.error(u)}},d=u=>{o.value=l.markRaw(u.maps),s.value=l.markRaw(new u.maps.Map(t.value,c()));const p=Ee(o.value);o.value[F]=p,te.forEach(g=>{var m;(m=s.value)==null||m.addListener(g,v=>e(g,v))}),r.value=!0;const f=Object.keys(n).filter(g=>!["apiPromise","apiKey","version","libraries","region","language","center","zoom","nonce"].includes(g)).map(g=>l.toRef(n,g));l.watch([()=>n.center,()=>n.zoom,...f],([g,m],[v,y])=>{var E,b,$;const{center:w,zoom:_,...M}=c();(E=s.value)==null||E.setOptions(M),m!==void 0&&m!==y&&((b=s.value)==null||b.setZoom(m));const C=!v||g.lng!==v.lng||g.lat!==v.lat;g&&C&&(($=s.value)==null||$.panTo(g))})};return l.onMounted(()=>{n.apiPromise&&n.apiPromise instanceof Promise?n.apiPromise.then(d):(h(),ee.load().then(d))}),l.onBeforeUnmount(()=>{var u;a.value=!1,s.value&&((u=o.value)==null||u.event.clearInstanceListeners(s.value))}),{mapRef:t,ready:r,map:s,api:o,mapTilesLoaded:a}}});const V=(n,e)=>{const t=n.__vccOpts||n;for(const[r,s]of e)t[r]=s;return t},Oe={ref:"mapRef",class:"mapdiv"};function xe(n,e,t,r,s,o){return l.openBlock(),l.createElementBlock("div",null,[l.createElementVNode("div",Oe,null,512),l.renderSlot(n.$slots,"default",l.normalizeProps(l.guardReactiveProps({ready:n.ready,map:n.map,api:n.api,mapTilesLoaded:n.mapTilesLoaded})),void 0,!0)])}const Se=V(Pe,[["render",xe],["__scopeId","data-v-dbf82c40"]]);function Le(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Ie=function n(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var r,s,o;if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(s=r;s--!==0;)if(!n(e[s],t[s]))return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(s=r;s--!==0;)if(!Object.prototype.hasOwnProperty.call(t,o[s]))return!1;for(s=r;s--!==0;){var a=o[s];if(!n(e[a],t[a]))return!1}return!0}return e!==e&&t!==t};const L=Le(Ie),Ae=n=>n==="Marker",Te=n=>n===F,B=(n,e,t,r)=>{const s=l.ref(),o=l.inject(R,l.ref()),a=l.inject(j,l.ref()),c=l.inject(pe,l.ref()),i=l.computed(()=>!!(c.value&&a.value&&(s.value instanceof a.value.Marker||s.value instanceof a.value[F])));return l.watch([o,t],(h,[d,u])=>{var f,g,m;const p=!L(t.value,u)||o.value!==d;!o.value||!a.value||!p||(s.value?(s.value.setOptions(t.value),i.value&&((f=c.value)==null||f.removeMarker(s.value),(g=c.value)==null||g.addMarker(s.value))):(Ae(n)?s.value=l.markRaw(new a.value[n](t.value)):Te(n)?s.value=l.markRaw(new a.value[n](t.value)):s.value=l.markRaw(new a.value[n]({...t.value,map:o.value})),i.value?(m=c.value)==null||m.addMarker(s.value):s.value.setMap(o.value),e.forEach(v=>{var y;(y=s.value)==null||y.addListener(v,w=>r(v,w))})))},{immediate:!0}),l.onBeforeUnmount(()=>{var h,d;s.value&&((h=a.value)==null||h.event.clearInstanceListeners(s.value),i.value?(d=c.value)==null||d.removeMarker(s.value):s.value.setMap(null))}),s},re=["animation_changed","click","dblclick","rightclick","dragstart","dragend","drag","mouseover","mousedown","mouseout","mouseup","draggable_changed","clickable_changed","contextmenu","cursor_changed","flat_changed","rightclick","zindex_changed","icon_changed","position_changed","shape_changed","title_changed","visible_changed"],Re=l.defineComponent({name:"Marker",props:{options:{type:Object,required:!0}},emits:re,setup(n,{emit:e,expose:t,slots:r}){const s=l.toRef(n,"options"),o=B("Marker",re,s,e);return l.provide(he,o),t({marker:o}),()=>{var a;return(a=r.default)==null?void 0:a.call(r)}}}),je=l.defineComponent({name:"Polyline",props:{options:{type:Object,required:!0}},emits:T,setup(n,{emit:e}){const t=l.toRef(n,"options");return{polyline:B("Polyline",T,t,e)}},render:()=>null}),Be=l.defineComponent({name:"Polygon",props:{options:{type:Object,required:!0}},emits:T,setup(n,{emit:e}){const t=l.toRef(n,"options");return{polygon:B("Polygon",T,t,e)}},render:()=>null}),se=T.concat(["bounds_changed"]),$e=l.defineComponent({name:"Rectangle",props:{options:{type:Object,required:!0}},emits:se,setup(n,{emit:e}){const t=l.toRef(n,"options");return{rectangle:B("Rectangle",se,t,e)}},render:()=>null}),ne=T.concat(["center_changed","radius_changed"]),qe=l.defineComponent({name:"Circle",props:{options:{type:Object,required:!0}},emits:ne,setup(n,{emit:e}){const t=l.toRef(n,"options");return{circle:B("Circle",ne,t,e)}},render:()=>null}),Ne=l.defineComponent({props:{position:{type:String,required:!0},index:{type:Number,default:1}},emits:["content:loaded"],setup(n,{emit:e}){const t=l.ref(null),r=l.inject(R,l.ref()),s=l.inject(j,l.ref()),o=l.inject(fe,l.ref(!1)),a=l.watch([o,s,t],([h,d,u])=>{d&&h&&u&&(c(n.position),e("content:loaded"),setTimeout(a,0))},{immediate:!0}),c=h=>{if(r.value&&s.value&&t.value){const d=s.value.ControlPosition[h];r.value.controls[d].push(t.value)}},i=h=>{if(r.value&&s.value){let d=null;const u=s.value.ControlPosition[h];r.value.controls[u].forEach((p,f)=>{p===t.value&&(d=f)}),d!==null&&r.value.controls[u].removeAt(d)}};return l.onBeforeUnmount(()=>i(n.position)),l.watch(()=>n.position,(h,d)=>{i(d),c(h)}),l.watch(()=>n.index,h=>{h&&t.value&&(t.value.index=n.index)}),{controlRef:t}}});const Ze={ref:"controlRef",class:"custom-control-wrapper"};function Ue(n,e,t,r,s,o){return l.openBlock(),l.createElementBlock("div",Ze,[l.renderSlot(n.$slots,"default",{},void 0,!0)],512)}const De=V(Ne,[["render",Ue],["__scopeId","data-v-d099a3a6"]]),oe=["closeclick","content_changed","domready","position_changed","visible","zindex_changed"],Fe=l.defineComponent({inheritAttrs:!1,props:{options:{type:Object,default:()=>({})},modelValue:{type:Boolean}},emits:[...oe,"update:modelValue"],setup(n,{slots:e,emit:t,expose:r}){const s=l.ref(),o=l.ref(),a=l.inject(R,l.ref()),c=l.inject(j,l.ref()),i=l.inject(he,l.ref());let h,d=n.modelValue;const u=l.computed(()=>{var m;return(m=e.default)==null?void 0:m.call(e).some(v=>v.type!==l.Comment)}),p=m=>{d=m,t("update:modelValue",m)},f=m=>{s.value&&(s.value.open({map:a.value,anchor:i.value,...m}),p(!0))},g=()=>{s.value&&(s.value.close(),p(!1))};return l.onMounted(()=>{l.watch([a,()=>n.options],([m,v],[y,w])=>{var M;const _=!L(v,w)||a.value!==y;a.value&&c.value&&_&&(s.value?(s.value.setOptions({...v,content:u.value?o.value:v.content}),i.value||f()):(s.value=l.markRaw(new c.value.InfoWindow({...v,content:u.value?o.value:v.content})),i.value&&(h=i.value.addListener("click",()=>{f()})),(!i.value||d)&&f(),oe.forEach(C=>{var E;(E=s.value)==null||E.addListener(C,b=>t(C,b))}),(M=s.value)==null||M.addListener("closeclick",()=>p(!1))))},{immediate:!0}),l.watch(()=>n.modelValue,m=>{m!==d&&(m?f():g())})}),l.onBeforeUnmount(()=>{var m;h&&h.remove(),s.value&&((m=c.value)==null||m.event.clearInstanceListeners(s.value),g())}),r({infoWindow:s,open:f,close:g}),{infoWindow:s,infoWindowRef:o,hasSlotContent:u,open:f,close:g}}});const Ve={key:0,class:"info-window-wrapper"};function ze(n,e,t,r,s,o){return n.hasSlotContent?(l.openBlock(),l.createElementBlock("div",Ve,[l.createElementVNode("div",l.mergeProps({ref:"infoWindowRef"},n.$attrs),[l.renderSlot(n.$slots,"default",{},void 0,!0)],16)])):l.createCommentVNode("",!0)}const Ge=V(Fe,[["render",ze],["__scopeId","data-v-cbe1707b"]]),ie=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],G=1,q=8;class J{static from(e){if(!(e instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[t,r]=new Uint8Array(e,0,2);if(t!==219)throw new Error("Data does not appear to be in a KDBush format.");const s=r>>4;if(s!==G)throw new Error(`Got v${s} data when expected v${G}.`);const o=ie[r&15];if(!o)throw new Error("Unrecognized array type.");const[a]=new Uint16Array(e,2,1),[c]=new Uint32Array(e,4,1);return new J(c,a,o,e)}constructor(e,t=64,r=Float64Array,s){if(isNaN(e)||e<0)throw new Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+t,2),65535),this.ArrayType=r,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;const o=ie.indexOf(this.ArrayType),a=e*2*this.ArrayType.BYTES_PER_ELEMENT,c=e*this.IndexArrayType.BYTES_PER_ELEMENT,i=(8-c%8)%8;if(o<0)throw new Error(`Unexpected typed array class: ${r}.`);s&&s instanceof ArrayBuffer?(this.data=s,this.ids=new this.IndexArrayType(this.data,q,e),this.coords=new this.ArrayType(this.data,q+c+i,e*2),this._pos=e*2,this._finished=!0):(this.data=new ArrayBuffer(q+a+c+i),this.ids=new this.IndexArrayType(this.data,q,e),this.coords=new this.ArrayType(this.data,q+c+i,e*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(G<<4)+o]),new Uint16Array(this.data,2,1)[0]=t,new Uint32Array(this.data,4,1)[0]=e)}add(e,t){const r=this._pos>>1;return this.ids[r]=r,this.coords[this._pos++]=e,this.coords[this._pos++]=t,r}finish(){const e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return K(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,t,r,s){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:o,coords:a,nodeSize:c}=this,i=[0,o.length-1,0],h=[];for(;i.length;){const d=i.pop()||0,u=i.pop()||0,p=i.pop()||0;if(u-p<=c){for(let v=p;v<=u;v++){const y=a[2*v],w=a[2*v+1];y>=e&&y<=r&&w>=t&&w<=s&&h.push(o[v])}continue}const f=p+u>>1,g=a[2*f],m=a[2*f+1];g>=e&&g<=r&&m>=t&&m<=s&&h.push(o[f]),(d===0?e<=g:t<=m)&&(i.push(p),i.push(f-1),i.push(1-d)),(d===0?r>=g:s>=m)&&(i.push(f+1),i.push(u),i.push(1-d))}return h}within(e,t,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:s,coords:o,nodeSize:a}=this,c=[0,s.length-1,0],i=[],h=r*r;for(;c.length;){const d=c.pop()||0,u=c.pop()||0,p=c.pop()||0;if(u-p<=a){for(let v=p;v<=u;v++)ae(o[2*v],o[2*v+1],e,t)<=h&&i.push(s[v]);continue}const f=p+u>>1,g=o[2*f],m=o[2*f+1];ae(g,m,e,t)<=h&&i.push(s[f]),(d===0?e-r<=g:t-r<=m)&&(c.push(p),c.push(f-1),c.push(1-d)),(d===0?e+r>=g:t+r>=m)&&(c.push(f+1),c.push(u),c.push(1-d))}return i}}function K(n,e,t,r,s,o){if(s-r<=t)return;const a=r+s>>1;me(n,e,a,r,s,o),K(n,e,t,r,a-1,1-o),K(n,e,t,a+1,s,1-o)}function me(n,e,t,r,s,o){for(;s>r;){if(s-r>600){const h=s-r+1,d=t-r+1,u=Math.log(h),p=.5*Math.exp(2*u/3),f=.5*Math.sqrt(u*p*(h-p)/h)*(d-h/2<0?-1:1),g=Math.max(r,Math.floor(t-d*p/h+f)),m=Math.min(s,Math.floor(t+(h-d)*p/h+f));me(n,e,t,g,m,o)}const a=e[2*t+o];let c=r,i=s;for(N(n,e,r,t),e[2*s+o]>a&&N(n,e,r,s);c<i;){for(N(n,e,c,i),c++,i--;e[2*c+o]<a;)c++;for(;e[2*i+o]>a;)i--}e[2*r+o]===a?N(n,e,r,i):(i++,N(n,e,i,s)),i<=t&&(r=i+1),t<=i&&(s=i-1)}}function N(n,e,t,r){H(n,t,r),H(e,2*t,2*r),H(e,2*t+1,2*r+1)}function H(n,e,t){const r=n[e];n[e]=n[t],n[t]=r}function ae(n,e,t,r){const s=n-t,o=e-r;return s*s+o*o}const He={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:n=>n},le=Math.fround||(n=>e=>(n[0]=+e,n[0]))(new Float32Array(1)),x=2,O=3,W=4,P=5,ge=6;class ve{constructor(e){this.options=Object.assign(Object.create(He),e),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(e){const{log:t,minZoom:r,maxZoom:s}=this.options;t&&console.time("total time");const o=`prepare ${e.length} points`;t&&console.time(o),this.points=e;const a=[];for(let i=0;i<e.length;i++){const h=e[i];if(!h.geometry)continue;const[d,u]=h.geometry.coordinates,p=le(U(d)),f=le(D(u));a.push(p,f,1/0,i,-1,1),this.options.reduce&&a.push(0)}let c=this.trees[s+1]=this._createTree(a);t&&console.timeEnd(o);for(let i=s;i>=r;i--){const h=+Date.now();c=this.trees[i]=this._createTree(this._cluster(c,i)),t&&console.log("z%d: %d clusters in %dms",i,c.numItems,+Date.now()-h)}return t&&console.timeEnd("total time"),this}getClusters(e,t){let r=((e[0]+180)%360+360)%360-180;const s=Math.max(-90,Math.min(90,e[1]));let o=e[2]===180?180:((e[2]+180)%360+360)%360-180;const a=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)r=-180,o=180;else if(r>o){const u=this.getClusters([r,s,180,a],t),p=this.getClusters([-180,s,o,a],t);return u.concat(p)}const c=this.trees[this._limitZoom(t)],i=c.range(U(r),D(a),U(o),D(s)),h=c.data,d=[];for(const u of i){const p=this.stride*u;d.push(h[p+P]>1?ce(h,p,this.clusterProps):this.points[h[p+O]])}return d}getChildren(e){const t=this._getOriginId(e),r=this._getOriginZoom(e),s="No cluster with the specified id.",o=this.trees[r];if(!o)throw new Error(s);const a=o.data;if(t*this.stride>=a.length)throw new Error(s);const c=this.options.radius/(this.options.extent*Math.pow(2,r-1)),i=a[t*this.stride],h=a[t*this.stride+1],d=o.within(i,h,c),u=[];for(const p of d){const f=p*this.stride;a[f+W]===e&&u.push(a[f+P]>1?ce(a,f,this.clusterProps):this.points[a[f+O]])}if(u.length===0)throw new Error(s);return u}getLeaves(e,t,r){t=t||10,r=r||0;const s=[];return this._appendLeaves(s,e,t,r,0),s}getTile(e,t,r){const s=this.trees[this._limitZoom(e)],o=Math.pow(2,e),{extent:a,radius:c}=this.options,i=c/a,h=(r-i)/o,d=(r+1+i)/o,u={features:[]};return this._addTileFeatures(s.range((t-i)/o,h,(t+1+i)/o,d),s.data,t,r,o,u),t===0&&this._addTileFeatures(s.range(1-i/o,h,1,d),s.data,o,r,o,u),t===o-1&&this._addTileFeatures(s.range(0,h,i/o,d),s.data,-1,r,o,u),u.features.length?u:null}getClusterExpansionZoom(e){let t=this._getOriginZoom(e)-1;for(;t<=this.options.maxZoom;){const r=this.getChildren(e);if(t++,r.length!==1)break;e=r[0].properties.cluster_id}return t}_appendLeaves(e,t,r,s,o){const a=this.getChildren(t);for(const c of a){const i=c.properties;if(i&&i.cluster?o+i.point_count<=s?o+=i.point_count:o=this._appendLeaves(e,i.cluster_id,r,s,o):o<s?o++:e.push(c),e.length===r)break}return o}_createTree(e){const t=new J(e.length/this.stride|0,this.options.nodeSize,Float32Array);for(let r=0;r<e.length;r+=this.stride)t.add(e[r],e[r+1]);return t.finish(),t.data=e,t}_addTileFeatures(e,t,r,s,o,a){for(const c of e){const i=c*this.stride,h=t[i+P]>1;let d,u,p;if(h)d=ye(t,i,this.clusterProps),u=t[i],p=t[i+1];else{const m=this.points[t[i+O]];d=m.properties;const[v,y]=m.geometry.coordinates;u=U(v),p=D(y)}const f={type:1,geometry:[[Math.round(this.options.extent*(u*o-r)),Math.round(this.options.extent*(p*o-s))]],tags:d};let g;h||this.options.generateId?g=t[i+O]:g=this.points[t[i+O]].id,g!==void 0&&(f.id=g),a.features.push(f)}}_limitZoom(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}_cluster(e,t){const{radius:r,extent:s,reduce:o,minPoints:a}=this.options,c=r/(s*Math.pow(2,t)),i=e.data,h=[],d=this.stride;for(let u=0;u<i.length;u+=d){if(i[u+x]<=t)continue;i[u+x]=t;const p=i[u],f=i[u+1],g=e.within(i[u],i[u+1],c),m=i[u+P];let v=m;for(const y of g){const w=y*d;i[w+x]>t&&(v+=i[w+P])}if(v>m&&v>=a){let y=p*m,w=f*m,_,M=-1;const C=((u/d|0)<<5)+(t+1)+this.points.length;for(const E of g){const b=E*d;if(i[b+x]<=t)continue;i[b+x]=t;const $=i[b+P];y+=i[b]*$,w+=i[b+1]*$,i[b+W]=C,o&&(_||(_=this._map(i,u,!0),M=this.clusterProps.length,this.clusterProps.push(_)),o(_,this._map(i,b)))}i[u+W]=C,h.push(y/v,w/v,1/0,C,-1,v),o&&h.push(M)}else{for(let y=0;y<d;y++)h.push(i[u+y]);if(v>1)for(const y of g){const w=y*d;if(!(i[w+x]<=t)){i[w+x]=t;for(let _=0;_<d;_++)h.push(i[w+_])}}}}return h}_getOriginId(e){return e-this.points.length>>5}_getOriginZoom(e){return(e-this.points.length)%32}_map(e,t,r){if(e[t+P]>1){const a=this.clusterProps[e[t+ge]];return r?Object.assign({},a):a}const s=this.points[e[t+O]].properties,o=this.options.map(s);return r&&o===s?Object.assign({},o):o}}function ce(n,e,t){return{type:"Feature",id:n[e+O],properties:ye(n,e,t),geometry:{type:"Point",coordinates:[We(n[e]),Ke(n[e+1])]}}}function ye(n,e,t){const r=n[e+P],s=r>=1e4?`${Math.round(r/1e3)}k`:r>=1e3?`${Math.round(r/100)/10}k`:r,o=n[e+ge],a=o===-1?{}:Object.assign({},t[o]);return Object.assign(a,{cluster:!0,cluster_id:n[e+O],point_count:r,point_count_abbreviated:s})}function U(n){return n/360+.5}function D(n){const e=Math.sin(n*Math.PI/180),t=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return t<0?0:t>1?1:t}function We(n){return(n-.5)*360}function Ke(n){const e=(180-n*360)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}/*! *****************************************************************************
15
+ ***************************************************************************** */function be(s,e,t,r){function n(o){return o instanceof t?o:new t(function(i){i(o)})}return new(t||(t=Promise))(function(o,i){function u(d){try{h(r.next(d))}catch(c){i(c)}}function a(d){try{h(r.throw(d))}catch(c){i(c)}}function h(d){d.done?o(d.value):n(d.value).then(u,a)}h((r=r.apply(s,e||[])).next())})}var Ee=function s(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var r,n,o;if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(n=r;n--!==0;)if(!s(e[n],t[n]))return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(t,o[n]))return!1;for(n=r;n--!==0;){var i=o[n];if(!s(e[i],t[i]))return!1}return!0}return e!==e&&t!==t};const te="__googleMapsScriptId";var R;(function(s){s[s.INITIALIZED=0]="INITIALIZED",s[s.LOADING=1]="LOADING",s[s.SUCCESS=2]="SUCCESS",s[s.FAILURE=3]="FAILURE"})(R||(R={}));class A{constructor({apiKey:e,authReferrerPolicy:t,channel:r,client:n,id:o=te,language:i,libraries:u=[],mapIds:a,nonce:h,region:d,retries:c=3,url:p="https://maps.googleapis.com/maps/api/js",version:f}){if(this.callbacks=[],this.done=!1,this.loading=!1,this.errors=[],this.apiKey=e,this.authReferrerPolicy=t,this.channel=r,this.client=n,this.id=o||te,this.language=i,this.libraries=u,this.mapIds=a,this.nonce=h,this.region=d,this.retries=c,this.url=p,this.version=f,A.instance){if(!Ee(this.options,A.instance.options))throw new Error(`Loader must not be called again with different options. ${JSON.stringify(this.options)} !== ${JSON.stringify(A.instance.options)}`);return A.instance}A.instance=this}get options(){return{version:this.version,apiKey:this.apiKey,channel:this.channel,client:this.client,id:this.id,libraries:this.libraries,language:this.language,region:this.region,mapIds:this.mapIds,nonce:this.nonce,url:this.url,authReferrerPolicy:this.authReferrerPolicy}}get status(){return this.errors.length?R.FAILURE:this.done?R.SUCCESS:this.loading?R.LOADING:R.INITIALIZED}get failed(){return this.done&&!this.loading&&this.errors.length>=this.retries+1}createUrl(){let e=this.url;return e+="?callback=__googleMapsCallback",this.apiKey&&(e+=`&key=${this.apiKey}`),this.channel&&(e+=`&channel=${this.channel}`),this.client&&(e+=`&client=${this.client}`),this.libraries.length>0&&(e+=`&libraries=${this.libraries.join(",")}`),this.language&&(e+=`&language=${this.language}`),this.region&&(e+=`&region=${this.region}`),this.version&&(e+=`&v=${this.version}`),this.mapIds&&(e+=`&map_ids=${this.mapIds.join(",")}`),this.authReferrerPolicy&&(e+=`&auth_referrer_policy=${this.authReferrerPolicy}`),e}deleteScript(){const e=document.getElementById(this.id);e&&e.remove()}load(){return this.loadPromise()}loadPromise(){return new Promise((e,t)=>{this.loadCallback(r=>{r?t(r.error):e(window.google)})})}importLibrary(e){return this.execute(),google.maps.importLibrary(e)}loadCallback(e){this.callbacks.push(e),this.execute()}setScript(){var e,t;if(document.getElementById(this.id)){this.callback();return}const r={key:this.apiKey,channel:this.channel,client:this.client,libraries:this.libraries.length&&this.libraries,v:this.version,mapIds:this.mapIds,language:this.language,region:this.region,authReferrerPolicy:this.authReferrerPolicy};Object.keys(r).forEach(o=>!r[o]&&delete r[o]),!((t=(e=window==null?void 0:window.google)===null||e===void 0?void 0:e.maps)===null||t===void 0)&&t.importLibrary||(o=>{let i,u,a,h="The Google Maps JavaScript API",d="google",c="importLibrary",p="__ib__",f=document,g=window;g=g[d]||(g[d]={});const m=g.maps||(g.maps={}),v=new Set,y=new URLSearchParams,w=()=>i||(i=new Promise((k,b)=>be(this,void 0,void 0,function*(){var M;yield u=f.createElement("script"),u.id=this.id,y.set("libraries",[...v]+"");for(a in o)y.set(a.replace(/[A-Z]/g,E=>"_"+E[0].toLowerCase()),o[a]);y.set("callback",d+".maps."+p),u.src=this.url+"?"+y,m[p]=k,u.onerror=()=>i=b(Error(h+" could not load.")),u.nonce=this.nonce||((M=f.querySelector("script[nonce]"))===null||M===void 0?void 0:M.nonce)||"",f.head.append(u)})));m[c]?console.warn(h+" only loads once. Ignoring:",o):m[c]=(k,...b)=>v.add(k)&&w().then(()=>m[c](k,...b))})(r);const n=this.libraries.map(o=>this.importLibrary(o));n.length||n.push(this.importLibrary("core")),Promise.all(n).then(()=>this.callback(),o=>{const i=new ErrorEvent("error",{error:o});this.loadErrorCallback(i)})}reset(){this.deleteScript(),this.done=!1,this.loading=!1,this.errors=[],this.onerrorEvent=null}resetIfRetryingFailed(){this.failed&&this.reset()}loadErrorCallback(e){if(this.errors.push(e),this.errors.length<=this.retries){const t=this.errors.length*Math.pow(2,this.errors.length);console.error(`Failed to load Google Maps script, retrying in ${t} ms.`),setTimeout(()=>{this.deleteScript(),this.setScript()},t)}else this.onerrorEvent=e,this.callback()}callback(){this.done=!0,this.loading=!1,this.callbacks.forEach(e=>{e(this.onerrorEvent)}),this.callbacks=[]}execute(){if(this.resetIfRetryingFailed(),this.done)this.callback();else{if(window.google&&window.google.maps&&window.google.maps.version){console.warn("Google Maps already loaded outside @googlemaps/js-api-loader.This may result in undesirable behavior as options and script parameters may not match."),this.callback();return}this.loading||(this.loading=!0,this.setScript())}}}function Oe(s){return class extends s.OverlayView{constructor(r){super();z(this,"element");z(this,"opts");const{element:n,...o}=r;this.element=n,this.opts=o,this.opts.map&&this.setMap(this.opts.map)}getPosition(){return this.opts.position?this.opts.position instanceof s.LatLng?this.opts.position:new s.LatLng(this.opts.position):null}getVisible(){if(!this.element)return!1;const r=this.element;return r.style.display!=="none"&&r.style.visibility!=="hidden"&&(r.style.opacity===""||Number(r.style.opacity)>.01)}onAdd(){if(!this.element)return;const r=this.getPanes();r&&r.overlayMouseTarget.appendChild(this.element)}draw(){if(!this.element)return;const r=this.getProjection(),n=r==null?void 0:r.fromLatLngToDivPixel(this.getPosition());if(n){this.element.style.position="absolute";let o,i;switch(this.opts.anchorPoint){case"TOP_CENTER":o="-50%",i="-100%";break;case"BOTTOM_CENTER":o="-50%",i="0";break;case"LEFT_CENTER":o="-100%",i="-50%";break;case"RIGHT_CENTER":o="0",i="-50%";break;case"TOP_LEFT":o="-100%",i="-100%";break;case"TOP_RIGHT":o="0",i="-100%";break;case"BOTTOM_LEFT":o="-100%",i="0";break;case"BOTTOM_RIGHT":o="0",i="0";break;default:o="-50%",i="-50%"}const u=n.x+(this.opts.offsetX||0)+"px",a=n.y+(this.opts.offsetY||0)+"px";this.element.style.transform=`translateX(${o}) translateX(${u}) translateY(${i}) translateY(${a})`,this.opts.zIndex&&(this.element.style.zIndex=this.opts.zIndex.toString())}}onRemove(){this.element&&this.element.remove()}setOptions(r){const{element:n,...o}=r;this.element=n,this.opts=o,this.draw()}}}let re;const ne=["bounds_changed","center_changed","click","contextmenu","dblclick","drag","dragend","dragstart","heading_changed","idle","isfractionalzoomenabled_changed","mapcapabilities_changed","maptypeid_changed","mousemove","mouseout","mouseover","projection_changed","renderingtype_changed","rightclick","tilesloaded","tilt_changed","zoom_changed"],Pe=l.defineComponent({props:{apiPromise:{type:Promise},apiKey:{type:String,default:""},version:{type:String,default:"weekly"},libraries:{type:Array,default:()=>["places","marker"]},region:{type:String,required:!1},language:{type:String,required:!1},backgroundColor:{type:String,required:!1},center:{type:Object,default:()=>({lat:0,lng:0})},clickableIcons:{type:Boolean,required:!1,default:void 0},controlSize:{type:Number,required:!1},disableDefaultUi:{type:Boolean,required:!1,default:void 0},disableDoubleClickZoom:{type:Boolean,required:!1,default:void 0},draggable:{type:Boolean,required:!1,default:void 0},draggableCursor:{type:String,required:!1},draggingCursor:{type:String,required:!1},fullscreenControl:{type:Boolean,required:!1,default:void 0},fullscreenControlPosition:{type:String,required:!1},gestureHandling:{type:String,required:!1},heading:{type:Number,required:!1},isFractionalZoomEnabled:{type:Boolean,required:!1,default:void 0},keyboardShortcuts:{type:Boolean,required:!1,default:void 0},mapTypeControl:{type:Boolean,required:!1,default:void 0},mapTypeControlOptions:{type:Object,required:!1},mapTypeId:{type:[Number,String],required:!1},mapId:{type:String,required:!1},maxZoom:{type:Number,required:!1},minZoom:{type:Number,required:!1},noClear:{type:Boolean,required:!1,default:void 0},panControl:{type:Boolean,required:!1,default:void 0},panControlPosition:{type:String,required:!1},restriction:{type:Object,required:!1},rotateControl:{type:Boolean,required:!1,default:void 0},rotateControlPosition:{type:String,required:!1},scaleControl:{type:Boolean,required:!1,default:void 0},scaleControlStyle:{type:Number,required:!1},scrollwheel:{type:Boolean,required:!1,default:void 0},streetView:{type:Object,required:!1},streetViewControl:{type:Boolean,required:!1,default:void 0},streetViewControlPosition:{type:String,required:!1},styles:{type:Array,required:!1},tilt:{type:Number,required:!1},zoom:{type:Number,required:!1},zoomControl:{type:Boolean,required:!1,default:void 0},zoomControlPosition:{type:String,required:!1},nonce:{type:String,default:""}},emits:ne,setup(s,{emit:e}){const t=l.ref(),r=l.ref(!1),n=l.ref(),o=l.ref(),i=l.ref(!1);l.provide(I,n),l.provide(T,o),l.provide(me,i);const u=()=>{const c={...s};Object.keys(c).forEach(m=>{c[m]===void 0&&delete c[m]});const f=m=>{var v;return m?{position:(v=o.value)==null?void 0:v.ControlPosition[m]}:{}},g={scaleControlOptions:s.scaleControlStyle?{style:s.scaleControlStyle}:{},panControlOptions:f(s.panControlPosition),zoomControlOptions:f(s.zoomControlPosition),rotateControlOptions:f(s.rotateControlPosition),streetViewControlOptions:f(s.streetViewControlPosition),fullscreenControlOptions:f(s.fullscreenControlPosition),disableDefaultUI:s.disableDefaultUi};return{...c,...g}},a=l.watch([o,n],([c,p])=>{const f=c,g=p;f&&g&&(f.event.addListenerOnce(g,"tilesloaded",()=>{i.value=!0}),setTimeout(a,0))},{immediate:!0}),h=()=>{try{const{apiKey:c,region:p,version:f,language:g,libraries:m,nonce:v}=s;re=new A({apiKey:c,region:p,version:f,language:g,libraries:m,nonce:v})}catch(c){console.error(c)}},d=c=>{o.value=l.markRaw(c.maps),n.value=l.markRaw(new c.maps.Map(t.value,u()));const p=Oe(o.value);o.value[F]=p,ne.forEach(g=>{var m;(m=n.value)==null||m.addListener(g,v=>e(g,v))}),r.value=!0;const f=Object.keys(s).filter(g=>!["apiPromise","apiKey","version","libraries","region","language","center","zoom","nonce"].includes(g)).map(g=>l.toRef(s,g));l.watch([()=>s.center,()=>s.zoom,...f],([g,m],[v,y])=>{var E,_,O;const{center:w,zoom:k,...b}=u();(E=n.value)==null||E.setOptions(b),m!==void 0&&m!==y&&((_=n.value)==null||_.setZoom(m));const M=!v||g.lng!==v.lng||g.lat!==v.lat;g&&M&&((O=n.value)==null||O.panTo(g))})};return l.onMounted(()=>{s.apiPromise&&s.apiPromise instanceof Promise?s.apiPromise.then(d):(h(),re.load().then(d))}),l.onBeforeUnmount(()=>{var c;i.value=!1,n.value&&((c=o.value)==null||c.event.clearInstanceListeners(n.value))}),{mapRef:t,ready:r,map:n,api:o,mapTilesLoaded:i}}});const V=(s,e)=>{const t=s.__vccOpts||s;for(const[r,n]of e)t[r]=n;return t},Se={ref:"mapRef",class:"mapdiv"};function Le(s,e,t,r,n,o){return l.openBlock(),l.createElementBlock("div",null,[l.createElementVNode("div",Se,null,512),l.renderSlot(s.$slots,"default",l.normalizeProps(l.guardReactiveProps({ready:s.ready,map:s.map,api:s.api,mapTilesLoaded:s.mapTilesLoaded})),void 0,!0)])}const xe=V(Pe,[["render",Le],["__scopeId","data-v-d05fc6bc"]]);function Ae(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var Ie=function s(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var r,n,o;if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(n=r;n--!==0;)if(!s(e[n],t[n]))return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(t,o[n]))return!1;for(n=r;n--!==0;){var i=o[n];if(!s(e[i],t[i]))return!1}return!0}return e!==e&&t!==t};const P=Ae(Ie),se=["click","drag","dragend","dragstart","gmp-click"],Te=l.defineComponent({name:"AdvancedMarker",props:{options:{type:Object,required:!0},pinOptions:{type:Object,required:!1}},emits:se,setup(s,{emit:e,expose:t,slots:r}){const n=l.toRef(s,"options"),o=l.toRef(s,"pinOptions"),i=l.ref(),u=l.inject(I,l.ref()),a=l.inject(T,l.ref()),h=l.inject(J,l.ref()),d=l.computed(()=>!!(h.value&&a.value&&i.value instanceof google.maps.marker.AdvancedMarkerElement));return l.watch([u,n,o],async(c,[p,f,g])=>{var k,b,M;const v=!P(n.value,f)||!P(o.value,g)||u.value!==p;if(!u.value||!a.value||!v)return;const{AdvancedMarkerElement:y,PinElement:w}=a.value.marker;if(i.value){const{map:E,content:_,...O}=n.value;Object.assign(i.value,{content:o.value?new w(o.value).element:_,...O}),d.value&&((k=h.value)==null||k.removeMarker(i.value),(b=h.value)==null||b.addMarker(i.value))}else o.value&&(n.value.content=new w(o.value).element),i.value=l.markRaw(new y(n.value)),d.value?(M=h.value)==null||M.addMarker(i.value):i.value.map=u.value,se.forEach(E=>{var _;(_=i.value)==null||_.addListener(E,O=>e(E,O))})},{immediate:!0}),l.onBeforeUnmount(()=>{var c,p;i.value&&((c=a.value)==null||c.event.clearInstanceListeners(i.value),d.value?(p=h.value)==null||p.removeMarker(i.value):i.value.map=null)}),l.provide(Y,i),t({marker:i}),()=>{var c;return(c=r.default)==null?void 0:c.call(r)}}}),Re=s=>s==="Marker",je=s=>s===F,B=(s,e,t,r)=>{const n=l.ref(),o=l.inject(I,l.ref()),i=l.inject(T,l.ref()),u=l.inject(J,l.ref()),a=l.computed(()=>!!(u.value&&i.value&&(n.value instanceof i.value.Marker||n.value instanceof i.value[F])));return l.watch([o,t],(h,[d,c])=>{var f,g,m;const p=!P(t.value,c)||o.value!==d;!o.value||!i.value||!p||(n.value?(n.value.setOptions(t.value),a.value&&((f=u.value)==null||f.removeMarker(n.value),(g=u.value)==null||g.addMarker(n.value))):(Re(s)?n.value=l.markRaw(new i.value[s](t.value)):je(s)?n.value=l.markRaw(new i.value[s](t.value)):n.value=l.markRaw(new i.value[s]({...t.value,map:o.value})),a.value?(m=u.value)==null||m.addMarker(n.value):n.value.setMap(o.value),e.forEach(v=>{var y;(y=n.value)==null||y.addListener(v,w=>r(v,w))})))},{immediate:!0}),l.onBeforeUnmount(()=>{var h,d;n.value&&((h=i.value)==null||h.event.clearInstanceListeners(n.value),a.value?(d=u.value)==null||d.removeMarker(n.value):n.value.setMap(null))}),n},oe=["animation_changed","click","dblclick","rightclick","dragstart","dragend","drag","mouseover","mousedown","mouseout","mouseup","draggable_changed","clickable_changed","contextmenu","cursor_changed","flat_changed","rightclick","zindex_changed","icon_changed","position_changed","shape_changed","title_changed","visible_changed"],$e=l.defineComponent({name:"Marker",props:{options:{type:Object,required:!0}},emits:oe,setup(s,{emit:e,expose:t,slots:r}){const n=l.toRef(s,"options"),o=B("Marker",oe,n,e);return l.provide(Y,o),t({marker:o}),()=>{var i;return(i=r.default)==null?void 0:i.call(r)}}}),Be=l.defineComponent({name:"Polyline",props:{options:{type:Object,required:!0}},emits:$,setup(s,{emit:e}){const t=l.toRef(s,"options");return{polyline:B("Polyline",$,t,e)}},render:()=>null}),qe=l.defineComponent({name:"Polygon",props:{options:{type:Object,required:!0}},emits:$,setup(s,{emit:e}){const t=l.toRef(s,"options");return{polygon:B("Polygon",$,t,e)}},render:()=>null}),ie=$.concat(["bounds_changed"]),Ne=l.defineComponent({name:"Rectangle",props:{options:{type:Object,required:!0}},emits:ie,setup(s,{emit:e}){const t=l.toRef(s,"options");return{rectangle:B("Rectangle",ie,t,e)}},render:()=>null}),ae=$.concat(["center_changed","radius_changed"]),Ze=l.defineComponent({name:"Circle",props:{options:{type:Object,required:!0}},emits:ae,setup(s,{emit:e}){const t=l.toRef(s,"options");return{circle:B("Circle",ae,t,e)}},render:()=>null}),Ue=l.defineComponent({props:{position:{type:String,required:!0},index:{type:Number,default:1}},emits:["content:loaded"],setup(s,{emit:e}){const t=l.ref(null),r=l.inject(I,l.ref()),n=l.inject(T,l.ref()),o=l.inject(me,l.ref(!1)),i=l.watch([o,n,t],([h,d,c])=>{d&&h&&c&&(u(s.position),e("content:loaded"),setTimeout(i,0))},{immediate:!0}),u=h=>{if(r.value&&n.value&&t.value){const d=n.value.ControlPosition[h];r.value.controls[d].push(t.value)}},a=h=>{if(r.value&&n.value){let d=null;const c=n.value.ControlPosition[h];r.value.controls[c].forEach((p,f)=>{p===t.value&&(d=f)}),d!==null&&r.value.controls[c].removeAt(d)}};return l.onBeforeUnmount(()=>a(s.position)),l.watch(()=>s.position,(h,d)=>{a(d),u(h)}),l.watch(()=>s.index,h=>{h&&t.value&&(t.value.index=s.index)}),{controlRef:t}}});const De={ref:"controlRef",class:"custom-control-wrapper"};function Fe(s,e,t,r,n,o){return l.openBlock(),l.createElementBlock("div",De,[l.renderSlot(s.$slots,"default",{},void 0,!0)],512)}const Ve=V(Ue,[["render",Fe],["__scopeId","data-v-d099a3a6"]]),le=["closeclick","content_changed","domready","position_changed","visible","zindex_changed"],ze=l.defineComponent({inheritAttrs:!1,props:{options:{type:Object,default:()=>({})},modelValue:{type:Boolean}},emits:[...le,"update:modelValue"],setup(s,{slots:e,emit:t,expose:r}){const n=l.ref(),o=l.ref(),i=l.inject(I,l.ref()),u=l.inject(T,l.ref()),a=l.inject(Y,l.ref());let h,d=s.modelValue;const c=l.computed(()=>{var m;return(m=e.default)==null?void 0:m.call(e).some(v=>v.type!==l.Comment)}),p=m=>{d=m,t("update:modelValue",m)},f=m=>{n.value&&(n.value.open({map:i.value,anchor:a.value,...m}),p(!0))},g=()=>{n.value&&(n.value.close(),p(!1))};return l.onMounted(()=>{l.watch([i,()=>s.options],([m,v],[y,w])=>{var b;const k=!P(v,w)||i.value!==y;i.value&&u.value&&k&&(n.value?(n.value.setOptions({...v,content:c.value?o.value:v.content}),a.value||f()):(n.value=l.markRaw(new u.value.InfoWindow({...v,content:c.value?o.value:v.content})),a.value&&(h=a.value.addListener("click",()=>{f()})),(!a.value||d)&&f(),le.forEach(M=>{var E;(E=n.value)==null||E.addListener(M,_=>t(M,_))}),(b=n.value)==null||b.addListener("closeclick",()=>p(!1))))},{immediate:!0}),l.watch(()=>s.modelValue,m=>{m!==d&&(m?f():g())})}),l.onBeforeUnmount(()=>{var m;h&&h.remove(),n.value&&((m=u.value)==null||m.event.clearInstanceListeners(n.value),g())}),r({infoWindow:n,open:f,close:g}),{infoWindow:n,infoWindowRef:o,hasSlotContent:c,open:f,close:g}}});const Ge={key:0,class:"info-window-wrapper"};function He(s,e,t,r,n,o){return s.hasSlotContent?(l.openBlock(),l.createElementBlock("div",Ge,[l.createElementVNode("div",l.mergeProps({ref:"infoWindowRef"},s.$attrs),[l.renderSlot(s.$slots,"default",{},void 0,!0)],16)])):l.createCommentVNode("",!0)}const We=V(ze,[["render",He],["__scopeId","data-v-cbe1707b"]]),ce=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],G=1,q=8;class X{static from(e){if(!(e instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[t,r]=new Uint8Array(e,0,2);if(t!==219)throw new Error("Data does not appear to be in a KDBush format.");const n=r>>4;if(n!==G)throw new Error(`Got v${n} data when expected v${G}.`);const o=ce[r&15];if(!o)throw new Error("Unrecognized array type.");const[i]=new Uint16Array(e,2,1),[u]=new Uint32Array(e,4,1);return new X(u,i,o,e)}constructor(e,t=64,r=Float64Array,n){if(isNaN(e)||e<0)throw new Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+t,2),65535),this.ArrayType=r,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;const o=ce.indexOf(this.ArrayType),i=e*2*this.ArrayType.BYTES_PER_ELEMENT,u=e*this.IndexArrayType.BYTES_PER_ELEMENT,a=(8-u%8)%8;if(o<0)throw new Error(`Unexpected typed array class: ${r}.`);n&&n instanceof ArrayBuffer?(this.data=n,this.ids=new this.IndexArrayType(this.data,q,e),this.coords=new this.ArrayType(this.data,q+u+a,e*2),this._pos=e*2,this._finished=!0):(this.data=new ArrayBuffer(q+i+u+a),this.ids=new this.IndexArrayType(this.data,q,e),this.coords=new this.ArrayType(this.data,q+u+a,e*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(G<<4)+o]),new Uint16Array(this.data,2,1)[0]=t,new Uint32Array(this.data,4,1)[0]=e)}add(e,t){const r=this._pos>>1;return this.ids[r]=r,this.coords[this._pos++]=e,this.coords[this._pos++]=t,r}finish(){const e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return K(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,t,r,n){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:o,coords:i,nodeSize:u}=this,a=[0,o.length-1,0],h=[];for(;a.length;){const d=a.pop()||0,c=a.pop()||0,p=a.pop()||0;if(c-p<=u){for(let v=p;v<=c;v++){const y=i[2*v],w=i[2*v+1];y>=e&&y<=r&&w>=t&&w<=n&&h.push(o[v])}continue}const f=p+c>>1,g=i[2*f],m=i[2*f+1];g>=e&&g<=r&&m>=t&&m<=n&&h.push(o[f]),(d===0?e<=g:t<=m)&&(a.push(p),a.push(f-1),a.push(1-d)),(d===0?r>=g:n>=m)&&(a.push(f+1),a.push(c),a.push(1-d))}return h}within(e,t,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:n,coords:o,nodeSize:i}=this,u=[0,n.length-1,0],a=[],h=r*r;for(;u.length;){const d=u.pop()||0,c=u.pop()||0,p=u.pop()||0;if(c-p<=i){for(let v=p;v<=c;v++)ue(o[2*v],o[2*v+1],e,t)<=h&&a.push(n[v]);continue}const f=p+c>>1,g=o[2*f],m=o[2*f+1];ue(g,m,e,t)<=h&&a.push(n[f]),(d===0?e-r<=g:t-r<=m)&&(u.push(p),u.push(f-1),u.push(1-d)),(d===0?e+r>=g:t+r>=m)&&(u.push(f+1),u.push(c),u.push(1-d))}return a}}function K(s,e,t,r,n,o){if(n-r<=t)return;const i=r+n>>1;ge(s,e,i,r,n,o),K(s,e,t,r,i-1,1-o),K(s,e,t,i+1,n,1-o)}function ge(s,e,t,r,n,o){for(;n>r;){if(n-r>600){const h=n-r+1,d=t-r+1,c=Math.log(h),p=.5*Math.exp(2*c/3),f=.5*Math.sqrt(c*p*(h-p)/h)*(d-h/2<0?-1:1),g=Math.max(r,Math.floor(t-d*p/h+f)),m=Math.min(n,Math.floor(t+(h-d)*p/h+f));ge(s,e,t,g,m,o)}const i=e[2*t+o];let u=r,a=n;for(N(s,e,r,t),e[2*n+o]>i&&N(s,e,r,n);u<a;){for(N(s,e,u,a),u++,a--;e[2*u+o]<i;)u++;for(;e[2*a+o]>i;)a--}e[2*r+o]===i?N(s,e,r,a):(a++,N(s,e,a,n)),a<=t&&(r=a+1),t<=a&&(n=a-1)}}function N(s,e,t,r){H(s,t,r),H(e,2*t,2*r),H(e,2*t+1,2*r+1)}function H(s,e,t){const r=s[e];s[e]=s[t],s[t]=r}function ue(s,e,t,r){const n=s-t,o=e-r;return n*n+o*o}const Ke={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:s=>s},de=Math.fround||(s=>e=>(s[0]=+e,s[0]))(new Float32Array(1)),x=2,L=3,W=4,S=5,ve=6;class ye{constructor(e){this.options=Object.assign(Object.create(Ke),e),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(e){const{log:t,minZoom:r,maxZoom:n}=this.options;t&&console.time("total time");const o=`prepare ${e.length} points`;t&&console.time(o),this.points=e;const i=[];for(let a=0;a<e.length;a++){const h=e[a];if(!h.geometry)continue;const[d,c]=h.geometry.coordinates,p=de(U(d)),f=de(D(c));i.push(p,f,1/0,a,-1,1),this.options.reduce&&i.push(0)}let u=this.trees[n+1]=this._createTree(i);t&&console.timeEnd(o);for(let a=n;a>=r;a--){const h=+Date.now();u=this.trees[a]=this._createTree(this._cluster(u,a)),t&&console.log("z%d: %d clusters in %dms",a,u.numItems,+Date.now()-h)}return t&&console.timeEnd("total time"),this}getClusters(e,t){let r=((e[0]+180)%360+360)%360-180;const n=Math.max(-90,Math.min(90,e[1]));let o=e[2]===180?180:((e[2]+180)%360+360)%360-180;const i=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)r=-180,o=180;else if(r>o){const c=this.getClusters([r,n,180,i],t),p=this.getClusters([-180,n,o,i],t);return c.concat(p)}const u=this.trees[this._limitZoom(t)],a=u.range(U(r),D(i),U(o),D(n)),h=u.data,d=[];for(const c of a){const p=this.stride*c;d.push(h[p+S]>1?he(h,p,this.clusterProps):this.points[h[p+L]])}return d}getChildren(e){const t=this._getOriginId(e),r=this._getOriginZoom(e),n="No cluster with the specified id.",o=this.trees[r];if(!o)throw new Error(n);const i=o.data;if(t*this.stride>=i.length)throw new Error(n);const u=this.options.radius/(this.options.extent*Math.pow(2,r-1)),a=i[t*this.stride],h=i[t*this.stride+1],d=o.within(a,h,u),c=[];for(const p of d){const f=p*this.stride;i[f+W]===e&&c.push(i[f+S]>1?he(i,f,this.clusterProps):this.points[i[f+L]])}if(c.length===0)throw new Error(n);return c}getLeaves(e,t,r){t=t||10,r=r||0;const n=[];return this._appendLeaves(n,e,t,r,0),n}getTile(e,t,r){const n=this.trees[this._limitZoom(e)],o=Math.pow(2,e),{extent:i,radius:u}=this.options,a=u/i,h=(r-a)/o,d=(r+1+a)/o,c={features:[]};return this._addTileFeatures(n.range((t-a)/o,h,(t+1+a)/o,d),n.data,t,r,o,c),t===0&&this._addTileFeatures(n.range(1-a/o,h,1,d),n.data,o,r,o,c),t===o-1&&this._addTileFeatures(n.range(0,h,a/o,d),n.data,-1,r,o,c),c.features.length?c:null}getClusterExpansionZoom(e){let t=this._getOriginZoom(e)-1;for(;t<=this.options.maxZoom;){const r=this.getChildren(e);if(t++,r.length!==1)break;e=r[0].properties.cluster_id}return t}_appendLeaves(e,t,r,n,o){const i=this.getChildren(t);for(const u of i){const a=u.properties;if(a&&a.cluster?o+a.point_count<=n?o+=a.point_count:o=this._appendLeaves(e,a.cluster_id,r,n,o):o<n?o++:e.push(u),e.length===r)break}return o}_createTree(e){const t=new X(e.length/this.stride|0,this.options.nodeSize,Float32Array);for(let r=0;r<e.length;r+=this.stride)t.add(e[r],e[r+1]);return t.finish(),t.data=e,t}_addTileFeatures(e,t,r,n,o,i){for(const u of e){const a=u*this.stride,h=t[a+S]>1;let d,c,p;if(h)d=we(t,a,this.clusterProps),c=t[a],p=t[a+1];else{const m=this.points[t[a+L]];d=m.properties;const[v,y]=m.geometry.coordinates;c=U(v),p=D(y)}const f={type:1,geometry:[[Math.round(this.options.extent*(c*o-r)),Math.round(this.options.extent*(p*o-n))]],tags:d};let g;h||this.options.generateId?g=t[a+L]:g=this.points[t[a+L]].id,g!==void 0&&(f.id=g),i.features.push(f)}}_limitZoom(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}_cluster(e,t){const{radius:r,extent:n,reduce:o,minPoints:i}=this.options,u=r/(n*Math.pow(2,t)),a=e.data,h=[],d=this.stride;for(let c=0;c<a.length;c+=d){if(a[c+x]<=t)continue;a[c+x]=t;const p=a[c],f=a[c+1],g=e.within(a[c],a[c+1],u),m=a[c+S];let v=m;for(const y of g){const w=y*d;a[w+x]>t&&(v+=a[w+S])}if(v>m&&v>=i){let y=p*m,w=f*m,k,b=-1;const M=((c/d|0)<<5)+(t+1)+this.points.length;for(const E of g){const _=E*d;if(a[_+x]<=t)continue;a[_+x]=t;const O=a[_+S];y+=a[_]*O,w+=a[_+1]*O,a[_+W]=M,o&&(k||(k=this._map(a,c,!0),b=this.clusterProps.length,this.clusterProps.push(k)),o(k,this._map(a,_)))}a[c+W]=M,h.push(y/v,w/v,1/0,M,-1,v),o&&h.push(b)}else{for(let y=0;y<d;y++)h.push(a[c+y]);if(v>1)for(const y of g){const w=y*d;if(!(a[w+x]<=t)){a[w+x]=t;for(let k=0;k<d;k++)h.push(a[w+k])}}}}return h}_getOriginId(e){return e-this.points.length>>5}_getOriginZoom(e){return(e-this.points.length)%32}_map(e,t,r){if(e[t+S]>1){const i=this.clusterProps[e[t+ve]];return r?Object.assign({},i):i}const n=this.points[e[t+L]].properties,o=this.options.map(n);return r&&o===n?Object.assign({},o):o}}function he(s,e,t){return{type:"Feature",id:s[e+L],properties:we(s,e,t),geometry:{type:"Point",coordinates:[Ye(s[e]),Je(s[e+1])]}}}function we(s,e,t){const r=s[e+S],n=r>=1e4?`${Math.round(r/1e3)}k`:r>=1e3?`${Math.round(r/100)/10}k`:r,o=s[e+ve],i=o===-1?{}:Object.assign({},t[o]);return Object.assign(i,{cluster:!0,cluster_id:s[e+L],point_count:r,point_count_abbreviated:n})}function U(s){return s/360+.5}function D(s){const e=Math.sin(s*Math.PI/180),t=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return t<0?0:t>1?1:t}function Ye(s){return(s-.5)*360}function Je(s){const e=(180-s*360)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}/*! *****************************************************************************
16
16
  Copyright (c) Microsoft Corporation.
17
17
 
18
18
  Permission to use, copy, modify, and/or distribute this software for any
@@ -25,9 +25,9 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
25
25
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
26
26
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
27
27
  PERFORMANCE OF THIS SOFTWARE.
28
- ***************************************************************************** */function Y(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(n);s<r.length;s++)e.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(n,r[s])&&(t[r[s]]=n[r[s]]);return t}class k{static isAdvancedMarkerAvailable(e){return google.maps.marker&&e.getMapCapabilities().isAdvancedMarkersAvailable===!0}static isAdvancedMarker(e){return google.maps.marker&&e instanceof google.maps.marker.AdvancedMarkerElement}static setMap(e,t){this.isAdvancedMarker(e)?e.map=t:e.setMap(t)}static getPosition(e){if(this.isAdvancedMarker(e)){if(e.position){if(e.position instanceof google.maps.LatLng)return e.position;if(e.position.lat&&e.position.lng)return new google.maps.LatLng(e.position.lat,e.position.lng)}return new google.maps.LatLng(null)}return e.getPosition()}static getVisible(e){return this.isAdvancedMarker(e)?!0:e.getVisible()}}class Z{constructor({markers:e,position:t}){this.markers=e,t&&(t instanceof google.maps.LatLng?this._position=t:this._position=new google.maps.LatLng(t))}get bounds(){if(this.markers.length===0&&!this._position)return;const e=new google.maps.LatLngBounds(this._position,this._position);for(const t of this.markers)e.extend(k.getPosition(t));return e}get position(){return this._position||this.bounds.getCenter()}get count(){return this.markers.filter(e=>k.getVisible(e)).length}push(e){this.markers.push(e)}delete(){this.marker&&(k.setMap(this.marker,null),this.marker=void 0),this.markers.length=0}}const Je=(n,e,t,r)=>{const s=we(n.getBounds(),e,r);return t.filter(o=>s.contains(k.getPosition(o)))},we=(n,e,t)=>{const{northEast:r,southWest:s}=Ye(n,e),o=Xe({northEast:r,southWest:s},t);return Qe(o,e)},ue=(n,e,t)=>{const r=we(n,e,t),s=r.getNorthEast(),o=r.getSouthWest();return[o.lng(),o.lat(),s.lng(),s.lat()]},Ye=(n,e)=>({northEast:e.fromLatLngToDivPixel(n.getNorthEast()),southWest:e.fromLatLngToDivPixel(n.getSouthWest())}),Xe=({northEast:n,southWest:e},t)=>(n.x+=t,n.y-=t,e.x-=t,e.y+=t,{northEast:n,southWest:e}),Qe=({northEast:n,southWest:e},t)=>{const r=t.fromDivPixelToLatLng(e),s=t.fromDivPixelToLatLng(n);return new google.maps.LatLngBounds(r,s)};class _e{constructor({maxZoom:e=16}){this.maxZoom=e}noop({markers:e}){return tt(e)}}class et extends _e{constructor(e){var{viewportPadding:t=60}=e,r=Y(e,["viewportPadding"]);super(r),this.viewportPadding=60,this.viewportPadding=t}calculate({markers:e,map:t,mapCanvasProjection:r}){return t.getZoom()>=this.maxZoom?{clusters:this.noop({markers:e}),changed:!1}:{clusters:this.cluster({markers:Je(t,r,e,this.viewportPadding),map:t,mapCanvasProjection:r})}}}const tt=n=>n.map(t=>new Z({position:k.getPosition(t),markers:[t]}));class rt extends _e{constructor(e){var{maxZoom:t,radius:r=60}=e,s=Y(e,["maxZoom","radius"]);super({maxZoom:t}),this.state={zoom:-1},this.superCluster=new ve(Object.assign({maxZoom:this.maxZoom,radius:r},s))}calculate(e){let t=!1;const r={zoom:e.map.getZoom()};if(!L(e.markers,this.markers)){t=!0,this.markers=[...e.markers];const s=this.markers.map(o=>{const a=k.getPosition(o);return{type:"Feature",geometry:{type:"Point",coordinates:[a.lng(),a.lat()]},properties:{marker:o}}});this.superCluster.load(s)}return t||(this.state.zoom<=this.maxZoom||r.zoom<=this.maxZoom)&&(t=!L(this.state,r)),this.state=r,t&&(this.clusters=this.cluster(e)),{clusters:this.clusters,changed:t}}cluster({map:e}){return this.superCluster.getClusters([-180,-90,180,90],Math.round(e.getZoom())).map(t=>this.transformCluster(t))}transformCluster({geometry:{coordinates:[e,t]},properties:r}){if(r.cluster)return new Z({markers:this.superCluster.getLeaves(r.cluster_id,1/0).map(o=>o.properties.marker),position:{lat:t,lng:e}});const s=r.marker;return new Z({markers:[s],position:k.getPosition(s)})}}class st extends et{constructor(e){var{maxZoom:t,radius:r=60,viewportPadding:s=60}=e,o=Y(e,["maxZoom","radius","viewportPadding"]);super({maxZoom:t,viewportPadding:s}),this.superCluster=new ve(Object.assign({maxZoom:this.maxZoom,radius:r},o)),this.state={zoom:-1,view:[0,0,0,0]}}calculate(e){const t={zoom:Math.round(e.map.getZoom()),view:ue(e.map.getBounds(),e.mapCanvasProjection,this.viewportPadding)};let r=!L(this.state,t);if(!L(e.markers,this.markers)){r=!0,this.markers=[...e.markers];const s=this.markers.map(o=>{const a=k.getPosition(o);return{type:"Feature",geometry:{type:"Point",coordinates:[a.lng(),a.lat()]},properties:{marker:o}}});this.superCluster.load(s)}return r&&(this.clusters=this.cluster(e),this.state=t),{clusters:this.clusters,changed:r}}cluster({map:e,mapCanvasProjection:t}){const r={zoom:Math.round(e.getZoom()),view:ue(e.getBounds(),t,this.viewportPadding)};return this.superCluster.getClusters(r.view,r.zoom).map(s=>this.transformCluster(s))}transformCluster({geometry:{coordinates:[e,t]},properties:r}){if(r.cluster)return new Z({markers:this.superCluster.getLeaves(r.cluster_id,1/0).map(o=>o.properties.marker),position:{lat:t,lng:e}});const s=r.marker;return new Z({markers:[s],position:k.getPosition(s)})}}class nt{constructor(e,t){this.markers={sum:e.length};const r=t.map(o=>o.count),s=r.reduce((o,a)=>o+a,0);this.clusters={count:t.length,markers:{mean:s/t.length,sum:s,min:Math.min(...r),max:Math.max(...r)}}}}class ot{render({count:e,position:t},r,s){const a=`<svg fill="${e>Math.max(10,r.clusters.markers.mean)?"#ff0000":"#0000ff"}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 240" width="50" height="50">
28
+ ***************************************************************************** */function Q(s,e){var t={};for(var r in s)Object.prototype.hasOwnProperty.call(s,r)&&e.indexOf(r)<0&&(t[r]=s[r]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,r=Object.getOwnPropertySymbols(s);n<r.length;n++)e.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(s,r[n])&&(t[r[n]]=s[r[n]]);return t}class C{static isAdvancedMarkerAvailable(e){return google.maps.marker&&e.getMapCapabilities().isAdvancedMarkersAvailable===!0}static isAdvancedMarker(e){return google.maps.marker&&e instanceof google.maps.marker.AdvancedMarkerElement}static setMap(e,t){this.isAdvancedMarker(e)?e.map=t:e.setMap(t)}static getPosition(e){if(this.isAdvancedMarker(e)){if(e.position){if(e.position instanceof google.maps.LatLng)return e.position;if(e.position.lat&&e.position.lng)return new google.maps.LatLng(e.position.lat,e.position.lng)}return new google.maps.LatLng(null)}return e.getPosition()}static getVisible(e){return this.isAdvancedMarker(e)?!0:e.getVisible()}}class Z{constructor({markers:e,position:t}){this.markers=e,t&&(t instanceof google.maps.LatLng?this._position=t:this._position=new google.maps.LatLng(t))}get bounds(){if(this.markers.length===0&&!this._position)return;const e=new google.maps.LatLngBounds(this._position,this._position);for(const t of this.markers)e.extend(C.getPosition(t));return e}get position(){return this._position||this.bounds.getCenter()}get count(){return this.markers.filter(e=>C.getVisible(e)).length}push(e){this.markers.push(e)}delete(){this.marker&&(C.setMap(this.marker,null),this.marker=void 0),this.markers.length=0}}const Xe=(s,e,t,r)=>{const n=ke(s.getBounds(),e,r);return t.filter(o=>n.contains(C.getPosition(o)))},ke=(s,e,t)=>{const{northEast:r,southWest:n}=Qe(s,e),o=et({northEast:r,southWest:n},t);return tt(o,e)},pe=(s,e,t)=>{const r=ke(s,e,t),n=r.getNorthEast(),o=r.getSouthWest();return[o.lng(),o.lat(),n.lng(),n.lat()]},Qe=(s,e)=>({northEast:e.fromLatLngToDivPixel(s.getNorthEast()),southWest:e.fromLatLngToDivPixel(s.getSouthWest())}),et=({northEast:s,southWest:e},t)=>(s.x+=t,s.y-=t,e.x-=t,e.y+=t,{northEast:s,southWest:e}),tt=({northEast:s,southWest:e},t)=>{const r=t.fromDivPixelToLatLng(e),n=t.fromDivPixelToLatLng(s);return new google.maps.LatLngBounds(r,n)};class _e{constructor({maxZoom:e=16}){this.maxZoom=e}noop({markers:e}){return nt(e)}}class rt extends _e{constructor(e){var{viewportPadding:t=60}=e,r=Q(e,["viewportPadding"]);super(r),this.viewportPadding=60,this.viewportPadding=t}calculate({markers:e,map:t,mapCanvasProjection:r}){return t.getZoom()>=this.maxZoom?{clusters:this.noop({markers:e}),changed:!1}:{clusters:this.cluster({markers:Xe(t,r,e,this.viewportPadding),map:t,mapCanvasProjection:r})}}}const nt=s=>s.map(t=>new Z({position:C.getPosition(t),markers:[t]}));class st extends _e{constructor(e){var{maxZoom:t,radius:r=60}=e,n=Q(e,["maxZoom","radius"]);super({maxZoom:t}),this.state={zoom:-1},this.superCluster=new ye(Object.assign({maxZoom:this.maxZoom,radius:r},n))}calculate(e){let t=!1;const r={zoom:e.map.getZoom()};if(!P(e.markers,this.markers)){t=!0,this.markers=[...e.markers];const n=this.markers.map(o=>{const i=C.getPosition(o);return{type:"Feature",geometry:{type:"Point",coordinates:[i.lng(),i.lat()]},properties:{marker:o}}});this.superCluster.load(n)}return t||(this.state.zoom<=this.maxZoom||r.zoom<=this.maxZoom)&&(t=!P(this.state,r)),this.state=r,t&&(this.clusters=this.cluster(e)),{clusters:this.clusters,changed:t}}cluster({map:e}){return this.superCluster.getClusters([-180,-90,180,90],Math.round(e.getZoom())).map(t=>this.transformCluster(t))}transformCluster({geometry:{coordinates:[e,t]},properties:r}){if(r.cluster)return new Z({markers:this.superCluster.getLeaves(r.cluster_id,1/0).map(o=>o.properties.marker),position:{lat:t,lng:e}});const n=r.marker;return new Z({markers:[n],position:C.getPosition(n)})}}class ot extends rt{constructor(e){var{maxZoom:t,radius:r=60,viewportPadding:n=60}=e,o=Q(e,["maxZoom","radius","viewportPadding"]);super({maxZoom:t,viewportPadding:n}),this.superCluster=new ye(Object.assign({maxZoom:this.maxZoom,radius:r},o)),this.state={zoom:-1,view:[0,0,0,0]}}calculate(e){const t={zoom:Math.round(e.map.getZoom()),view:pe(e.map.getBounds(),e.mapCanvasProjection,this.viewportPadding)};let r=!P(this.state,t);if(!P(e.markers,this.markers)){r=!0,this.markers=[...e.markers];const n=this.markers.map(o=>{const i=C.getPosition(o);return{type:"Feature",geometry:{type:"Point",coordinates:[i.lng(),i.lat()]},properties:{marker:o}}});this.superCluster.load(n)}return r&&(this.clusters=this.cluster(e),this.state=t),{clusters:this.clusters,changed:r}}cluster({map:e,mapCanvasProjection:t}){const r={zoom:Math.round(e.getZoom()),view:pe(e.getBounds(),t,this.viewportPadding)};return this.superCluster.getClusters(r.view,r.zoom).map(n=>this.transformCluster(n))}transformCluster({geometry:{coordinates:[e,t]},properties:r}){if(r.cluster)return new Z({markers:this.superCluster.getLeaves(r.cluster_id,1/0).map(o=>o.properties.marker),position:{lat:t,lng:e}});const n=r.marker;return new Z({markers:[n],position:C.getPosition(n)})}}class it{constructor(e,t){this.markers={sum:e.length};const r=t.map(o=>o.count),n=r.reduce((o,i)=>o+i,0);this.clusters={count:t.length,markers:{mean:n/t.length,sum:n,min:Math.min(...r),max:Math.max(...r)}}}}class at{render({count:e,position:t},r,n){const i=`<svg fill="${e>Math.max(10,r.clusters.markers.mean)?"#ff0000":"#0000ff"}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 240" width="50" height="50">
29
29
  <circle cx="120" cy="120" opacity=".6" r="70" />
30
30
  <circle cx="120" cy="120" opacity=".3" r="90" />
31
31
  <circle cx="120" cy="120" opacity=".2" r="110" />
32
32
  <text x="50%" y="50%" style="fill:#fff" text-anchor="middle" font-size="50" dominant-baseline="middle" font-family="roboto,arial,sans-serif">${e}</text>
33
- </svg>`,c=`Cluster of ${e} markers`,i=Number(google.maps.Marker.MAX_ZINDEX)+e;if(k.isAdvancedMarkerAvailable(s)){const d=document.createElement("div");d.innerHTML=a;const u=d.firstElementChild;u.setAttribute("transform","translate(0 25)");const p={map:s,position:t,zIndex:i,title:c,content:u};return new google.maps.marker.AdvancedMarkerElement(p)}const h={position:t,zIndex:i,title:c,icon:{url:`data:image/svg+xml;base64,${btoa(a)}`,anchor:new google.maps.Point(25,25)}};return new google.maps.Marker(h)}}function it(n,e){for(let t in e.prototype)n.prototype[t]=e.prototype[t]}class X{constructor(){it(X,google.maps.OverlayView)}}var A;(function(n){n.CLUSTERING_BEGIN="clusteringbegin",n.CLUSTERING_END="clusteringend",n.CLUSTER_CLICK="click"})(A||(A={}));const at=(n,e,t)=>{t.fitBounds(e.bounds)};class lt extends X{constructor({map:e,markers:t=[],algorithmOptions:r={},algorithm:s=new rt(r),renderer:o=new ot,onClusterClick:a=at}){super(),this.markers=[...t],this.clusters=[],this.algorithm=s,this.renderer=o,this.onClusterClick=a,e&&this.setMap(e)}addMarker(e,t){this.markers.includes(e)||(this.markers.push(e),t||this.render())}addMarkers(e,t){e.forEach(r=>{this.addMarker(r,!0)}),t||this.render()}removeMarker(e,t){const r=this.markers.indexOf(e);return r===-1?!1:(k.setMap(e,null),this.markers.splice(r,1),t||this.render(),!0)}removeMarkers(e,t){let r=!1;return e.forEach(s=>{r=this.removeMarker(s,!0)||r}),r&&!t&&this.render(),r}clearMarkers(e){this.markers.length=0,e||this.render()}render(){const e=this.getMap();if(e instanceof google.maps.Map&&e.getProjection()){google.maps.event.trigger(this,A.CLUSTERING_BEGIN,this);const{clusters:t,changed:r}=this.algorithm.calculate({markers:this.markers,map:e,mapCanvasProjection:this.getProjection()});if(r||r==null){const s=new Set;for(const a of t)a.markers.length==1&&s.add(a.markers[0]);const o=[];for(const a of this.clusters)a.marker!=null&&(a.markers.length==1?s.has(a.marker)||k.setMap(a.marker,null):o.push(a.marker));this.clusters=t,this.renderClusters(),requestAnimationFrame(()=>o.forEach(a=>k.setMap(a,null)))}google.maps.event.trigger(this,A.CLUSTERING_END,this)}}onAdd(){this.idleListener=this.getMap().addListener("idle",this.render.bind(this)),this.render()}onRemove(){google.maps.event.removeListener(this.idleListener),this.reset()}reset(){this.markers.forEach(e=>k.setMap(e,null)),this.clusters.forEach(e=>e.delete()),this.clusters=[]}renderClusters(){const e=new nt(this.markers,this.clusters),t=this.getMap();this.clusters.forEach(r=>{r.markers.length===1?r.marker=r.markers[0]:(r.marker=this.renderer.render(r,e,t),r.markers.forEach(s=>k.setMap(s,null)),this.onClusterClick&&r.marker.addListener("click",s=>{google.maps.event.trigger(this,A.CLUSTER_CLICK,r),this.onClusterClick(s,r,t)})),k.setMap(r.marker,t)})}}const de=Object.values(A),ct=l.defineComponent({name:"MarkerCluster",props:{options:{type:Object,default:()=>({})}},emits:de,setup(n,{emit:e,expose:t,slots:r}){const s=l.ref(),o=l.inject(R,l.ref()),a=l.inject(j,l.ref());return l.provide(pe,s),l.watch(o,()=>{o.value&&(s.value=l.markRaw(new lt({map:o.value,algorithm:new st(n.options.algorithmOptions??{}),...n.options})),de.forEach(c=>{var i;(i=s.value)==null||i.addListener(c,h=>e(c,h))}))},{immediate:!0}),l.onBeforeUnmount(()=>{var c;s.value&&((c=a.value)==null||c.event.clearInstanceListeners(s.value),s.value.clearMarkers(),s.value.setMap(null))}),t({markerCluster:s}),()=>{var c;return(c=r.default)==null?void 0:c.call(r)}}}),ut=l.defineComponent({inheritAttrs:!1,props:{options:{type:Object,required:!0}},setup(n,{slots:e,emit:t,expose:r}){const s=l.ref(),o=l.computed(()=>{var i;return(i=e.default)==null?void 0:i.call(e).some(h=>h.type!==l.Comment)}),a=l.computed(()=>({...n.options,element:s.value})),c=B(F,[],a,t);return r({customMarker:c}),{customMarkerRef:s,customMarker:c,hasSlotContent:o}}});const dt={key:0,class:"custom-marker-wrapper"};function ht(n,e,t,r,s,o){return n.hasSlotContent?(l.openBlock(),l.createElementBlock("div",dt,[l.createElementVNode("div",l.mergeProps({ref:"customMarkerRef",style:{cursor:n.$attrs.onClick?"pointer":void 0}},n.$attrs),[l.renderSlot(n.$slots,"default",{},void 0,!0)],16)])):l.createCommentVNode("",!0)}const pt=V(ut,[["render",ht],["__scopeId","data-v-2d2d343a"]]),ft=l.defineComponent({name:"HeatmapLayer",props:{options:{type:Object,default:()=>({})}},setup(n){const e=l.ref(),t=l.inject(R,l.ref()),r=l.inject(j,l.ref());return l.watch([t,()=>n.options],([s,o],[a,c])=>{var h;const i=!L(o,c)||t.value!==a;if(t.value&&r.value&&i){const d=structuredClone(o);if(d.data&&!(d.data instanceof r.value.MVCArray)){const u=r.value.LatLng;d.data=(h=d.data)==null?void 0:h.map(p=>p instanceof u||"location"in p&&(p.location instanceof u||p.location===null)?p:"location"in p?{...p,location:new u(p.location)}:new u(p))}e.value?e.value.setOptions(d):e.value=l.markRaw(new r.value.visualization.HeatmapLayer({...d,map:t.value}))}},{immediate:!0}),l.onBeforeUnmount(()=>{e.value&&e.value.setMap(null)}),{heatmapLayer:e}},render:()=>null});exports.Circle=qe;exports.CustomControl=De;exports.CustomMarker=pt;exports.GoogleMap=Se;exports.HeatmapLayer=ft;exports.InfoWindow=Ge;exports.Marker=Re;exports.MarkerCluster=ct;exports.Polygon=Be;exports.Polyline=je;exports.Rectangle=$e;
33
+ </svg>`,u=`Cluster of ${e} markers`,a=Number(google.maps.Marker.MAX_ZINDEX)+e;if(C.isAdvancedMarkerAvailable(n)){const d=document.createElement("div");d.innerHTML=i;const c=d.firstElementChild;c.setAttribute("transform","translate(0 25)");const p={map:n,position:t,zIndex:a,title:u,content:c};return new google.maps.marker.AdvancedMarkerElement(p)}const h={position:t,zIndex:a,title:u,icon:{url:`data:image/svg+xml;base64,${btoa(i)}`,anchor:new google.maps.Point(25,25)}};return new google.maps.Marker(h)}}function lt(s,e){for(let t in e.prototype)s.prototype[t]=e.prototype[t]}class ee{constructor(){lt(ee,google.maps.OverlayView)}}var j;(function(s){s.CLUSTERING_BEGIN="clusteringbegin",s.CLUSTERING_END="clusteringend",s.CLUSTER_CLICK="click"})(j||(j={}));const ct=(s,e,t)=>{t.fitBounds(e.bounds)};class ut extends ee{constructor({map:e,markers:t=[],algorithmOptions:r={},algorithm:n=new st(r),renderer:o=new at,onClusterClick:i=ct}){super(),this.markers=[...t],this.clusters=[],this.algorithm=n,this.renderer=o,this.onClusterClick=i,e&&this.setMap(e)}addMarker(e,t){this.markers.includes(e)||(this.markers.push(e),t||this.render())}addMarkers(e,t){e.forEach(r=>{this.addMarker(r,!0)}),t||this.render()}removeMarker(e,t){const r=this.markers.indexOf(e);return r===-1?!1:(C.setMap(e,null),this.markers.splice(r,1),t||this.render(),!0)}removeMarkers(e,t){let r=!1;return e.forEach(n=>{r=this.removeMarker(n,!0)||r}),r&&!t&&this.render(),r}clearMarkers(e){this.markers.length=0,e||this.render()}render(){const e=this.getMap();if(e instanceof google.maps.Map&&e.getProjection()){google.maps.event.trigger(this,j.CLUSTERING_BEGIN,this);const{clusters:t,changed:r}=this.algorithm.calculate({markers:this.markers,map:e,mapCanvasProjection:this.getProjection()});if(r||r==null){const n=new Set;for(const i of t)i.markers.length==1&&n.add(i.markers[0]);const o=[];for(const i of this.clusters)i.marker!=null&&(i.markers.length==1?n.has(i.marker)||C.setMap(i.marker,null):o.push(i.marker));this.clusters=t,this.renderClusters(),requestAnimationFrame(()=>o.forEach(i=>C.setMap(i,null)))}google.maps.event.trigger(this,j.CLUSTERING_END,this)}}onAdd(){this.idleListener=this.getMap().addListener("idle",this.render.bind(this)),this.render()}onRemove(){google.maps.event.removeListener(this.idleListener),this.reset()}reset(){this.markers.forEach(e=>C.setMap(e,null)),this.clusters.forEach(e=>e.delete()),this.clusters=[]}renderClusters(){const e=new it(this.markers,this.clusters),t=this.getMap();this.clusters.forEach(r=>{r.markers.length===1?r.marker=r.markers[0]:(r.marker=this.renderer.render(r,e,t),r.markers.forEach(n=>C.setMap(n,null)),this.onClusterClick&&r.marker.addListener("click",n=>{google.maps.event.trigger(this,j.CLUSTER_CLICK,r),this.onClusterClick(n,r,t)})),C.setMap(r.marker,t)})}}const fe=Object.values(j),dt=l.defineComponent({name:"MarkerCluster",props:{options:{type:Object,default:()=>({})}},emits:fe,setup(s,{emit:e,expose:t,slots:r}){const n=l.ref(),o=l.inject(I,l.ref()),i=l.inject(T,l.ref());return l.provide(J,n),l.watch(o,()=>{o.value&&(n.value=l.markRaw(new ut({map:o.value,algorithm:new ot(s.options.algorithmOptions??{}),...s.options})),fe.forEach(u=>{var a;(a=n.value)==null||a.addListener(u,h=>e(u,h))}))},{immediate:!0}),l.onBeforeUnmount(()=>{var u;n.value&&((u=i.value)==null||u.event.clearInstanceListeners(n.value),n.value.clearMarkers(),n.value.setMap(null))}),t({markerCluster:n}),()=>{var u;return(u=r.default)==null?void 0:u.call(r)}}}),ht=l.defineComponent({inheritAttrs:!1,props:{options:{type:Object,required:!0}},setup(s,{slots:e,emit:t,expose:r}){const n=l.ref(),o=l.computed(()=>{var a;return(a=e.default)==null?void 0:a.call(e).some(h=>h.type!==l.Comment)}),i=l.computed(()=>({...s.options,element:n.value})),u=B(F,[],i,t);return r({customMarker:u}),{customMarkerRef:n,customMarker:u,hasSlotContent:o}}});const pt={key:0,class:"custom-marker-wrapper"};function ft(s,e,t,r,n,o){return s.hasSlotContent?(l.openBlock(),l.createElementBlock("div",pt,[l.createElementVNode("div",l.mergeProps({ref:"customMarkerRef",style:{cursor:s.$attrs.onClick?"pointer":void 0}},s.$attrs),[l.renderSlot(s.$slots,"default",{},void 0,!0)],16)])):l.createCommentVNode("",!0)}const mt=V(ht,[["render",ft],["__scopeId","data-v-2d2d343a"]]),gt=l.defineComponent({name:"HeatmapLayer",props:{options:{type:Object,default:()=>({})}},setup(s){const e=l.ref(),t=l.inject(I,l.ref()),r=l.inject(T,l.ref());return l.watch([t,()=>s.options],([n,o],[i,u])=>{var h;const a=!P(o,u)||t.value!==i;if(t.value&&r.value&&a){const d=structuredClone(o);if(d.data&&!(d.data instanceof r.value.MVCArray)){const c=r.value.LatLng;d.data=(h=d.data)==null?void 0:h.map(p=>p instanceof c||"location"in p&&(p.location instanceof c||p.location===null)?p:"location"in p?{...p,location:new c(p.location)}:new c(p))}e.value?e.value.setOptions(d):e.value=l.markRaw(new r.value.visualization.HeatmapLayer({...d,map:t.value}))}},{immediate:!0}),l.onBeforeUnmount(()=>{e.value&&e.value.setMap(null)}),{heatmapLayer:e}},render:()=>null});exports.AdvancedMarker=Te;exports.Circle=Ze;exports.CustomControl=Ve;exports.CustomMarker=mt;exports.GoogleMap=xe;exports.HeatmapLayer=gt;exports.InfoWindow=We;exports.Marker=$e;exports.MarkerCluster=dt;exports.Polygon=qe;exports.Polyline=Be;exports.Rectangle=Ne;