vue3-google-map 0.24.1 → 0.25.0
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 +31 -14
- package/dist/index.cjs +3 -3
- package/dist/index.mjs +697 -900
- package/dist/index.umd.js +4 -4
- package/dist/types/components/GoogleMap.vue.d.ts +4 -13
- package/package.json +3 -3
package/dist/index.umd.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var a=document.createElement("style");a.appendChild(document.createTextNode(".mapdiv[data-v-
|
|
2
|
-
(function(k,l){typeof exports=="object"&&typeof module<"u"?l(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],l):(k=typeof globalThis<"u"?globalThis:k||self,l(k.Vue3GoogleMap={},k.Vue))})(this,function(k,l){"use strict";var Cr=Object.defineProperty;var Mr=(k,l,M)=>l in k?Cr(k,l,{enumerable:!0,configurable:!0,writable:!0,value:M}):k[l]=M;var fe=(k,l,M)=>(Mr(k,typeof l!="symbol"?l+"":l,M),M);const M=Symbol("map"),q=Symbol("api"),Q=Symbol("marker"),ee=Symbol("markerCluster"),W=Symbol("CustomMarker"),te=Symbol("mapTilesLoaded"),$=["click","dblclick","drag","dragend","dragstart","mousedown","mousemove","mouseout","mouseover","mouseup","rightclick"];function Ge(n,e,t,r){function s(o){return o instanceof t?o:new t(function(i){i(o)})}return new(t||(t=Promise))(function(o,i){function c(f){try{d(r.next(f))}catch(u){i(u)}}function a(f){try{d(r.throw(f))}catch(u){i(u)}}function d(f){f.done?o(f.value):s(f.value).then(c,a)}d((r=r.apply(n,e||[])).next())})}typeof SuppressedError=="function"&&SuppressedError;function ze(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var re,pe;function We(){return pe||(pe=1,re=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 i=o[s];if(!n(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}),re}var He=We(),Ke=ze(He);const he="__googleMapsScriptId";var N;(function(n){n[n.INITIALIZED=0]="INITIALIZED",n[n.LOADING=1]="LOADING",n[n.SUCCESS=2]="SUCCESS",n[n.FAILURE=3]="FAILURE"})(N||(N={}));class R{constructor({apiKey:e,authReferrerPolicy:t,channel:r,client:s,id:o=he,language:i,libraries:c=[],mapIds:a,nonce:d,region:f,retries:u=3,url:m="https://maps.googleapis.com/maps/api/js",version:g}){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||he,this.language=i,this.libraries=c,this.mapIds=a,this.nonce=d,this.region=f,this.retries=u,this.url=m,this.version=g,R.instance){if(!Ke(this.options,R.instance.options))throw new Error(`Loader must not be called again with different options. ${JSON.stringify(this.options)} !== ${JSON.stringify(R.instance.options)}`);return R.instance}R.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?N.FAILURE:this.done?N.SUCCESS:this.loading?N.LOADING:N.INITIALIZED}get failed(){return this.done&&!this.loading&&this.errors.length>=this.retries+1}createUrl(){let e=this.url;return e+="?callback=__googleMapsCallback&loading=async",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+=`®ion=${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,c,a,d="The Google Maps JavaScript API",f="google",u="importLibrary",m="__ib__",g=document,p=window;p=p[f]||(p[f]={});const h=p.maps||(p.maps={}),y=new Set,v=new URLSearchParams,E=()=>i||(i=new Promise((w,b)=>Ge(this,void 0,void 0,function*(){var O;yield c=g.createElement("script"),c.id=this.id,v.set("libraries",[...y]+"");for(a in o)v.set(a.replace(/[A-Z]/g,S=>"_"+S[0].toLowerCase()),o[a]);v.set("callback",f+".maps."+m),c.src=this.url+"?"+v,h[m]=w,c.onerror=()=>i=b(Error(d+" could not load.")),c.nonce=this.nonce||((O=g.querySelector("script[nonce]"))===null||O===void 0?void 0:O.nonce)||"",g.head.append(c)})));h[u]?console.warn(d+" only loads once. Ignoring:",o):h[u]=(w,...b)=>y.add(w)&&E().then(()=>h[u](w,...b))})(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 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.loading)if(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=!0,this.setScript()}}}function Je(n){return class extends n.OverlayView{constructor(r){super();fe(this,"element");fe(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";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 c=s.x+(this.opts.offsetX||0)+"px",a=s.y+(this.opts.offsetY||0)+"px";this.element.style.transform=`translateX(${o}) translateX(${c}) 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:s,...o}=r;this.element=s,this.opts=o,this.draw()}}}let me;const ge=["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"],Ye=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},colorScheme:{type:String,required:!1},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},cameraControl:{type:Boolean,required:!1,default:void 0},cameraControlPosition:{type:String,required:!1},nonce:{type:String,default:""}},emits:ge,setup(n,{emit:e}){const t=l.ref(),r=l.ref(!1),s=l.ref(),o=l.ref(),i=l.ref(!1);l.provide(M,s),l.provide(q,o),l.provide(te,i);const c=()=>{const u={...n};Object.keys(u).forEach(h=>{u[h]===void 0&&delete u[h]});const g=h=>{var y;return h?{position:(y=o.value)==null?void 0:y.ControlPosition[h]}:{}},p={scaleControlOptions:n.scaleControlStyle?{style:n.scaleControlStyle}:{},panControlOptions:g(n.panControlPosition),zoomControlOptions:g(n.zoomControlPosition),rotateControlOptions:g(n.rotateControlPosition),streetViewControlOptions:g(n.streetViewControlPosition),fullscreenControlOptions:g(n.fullscreenControlPosition),cameraControlOptions:g(n.cameraControlPosition),disableDefaultUI:n.disableDefaultUi};return{...u,...p}},a=l.watch([o,s],([u,m])=>{const g=u,p=m;g&&p&&(g.event.addListenerOnce(p,"tilesloaded",()=>{i.value=!0}),setTimeout(a,0))},{immediate:!0}),d=()=>{try{const{apiKey:u,region:m,version:g,language:p,libraries:h,nonce:y}=n;me=new R({apiKey:u,region:m,version:g,language:p,libraries:h,nonce:y})}catch(u){console.error(u)}},f=u=>{o.value=l.markRaw(u.maps),s.value=l.markRaw(new u.maps.Map(t.value,c()));const m=Je(o.value);o.value[W]=m,ge.forEach(p=>{var h;(h=s.value)==null||h.addListener(p,y=>e(p,y))}),r.value=!0;const g=Object.keys(n).filter(p=>!["apiPromise","apiKey","version","libraries","region","language","center","zoom","nonce"].includes(p)).map(p=>l.toRef(n,p));l.watch([()=>n.center,()=>n.zoom,...g],([p,h],[y,v])=>{var S,C,j;const{center:E,zoom:w,...b}=c();(S=s.value)==null||S.setOptions(b),h!==void 0&&h!==v&&((C=s.value)==null||C.setZoom(h));const O=!y||p.lng!==y.lng||p.lat!==y.lat;p&&O&&((j=s.value)==null||j.panTo(p))})};return l.onMounted(()=>{n.apiPromise&&n.apiPromise instanceof Promise?n.apiPromise.then(f):(d(),me.load().then(f))}),l.onBeforeUnmount(()=>{var u;i.value=!1,s.value&&((u=o.value)==null||u.event.clearInstanceListeners(s.value))}),{mapRef:t,ready:r,map:s,api:o,mapTilesLoaded:i}}}),Or="",U=(n,e)=>{const t=n.__vccOpts||n;for(const[r,s]of e)t[r]=s;return t},Xe={ref:"mapRef",class:"mapdiv"};function Qe(n,e,t,r,s,o){return l.openBlock(),l.createElementBlock("div",null,[l.createElementVNode("div",Xe,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 et=U(Ye,[["render",Qe],["__scopeId","data-v-e315b413"]]);function tt(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var rt=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 i=o[s];if(!n(e[i],t[i]))return!1}return!0}return e!==e&&t!==t};const F=tt(rt),ye=["click","drag","dragend","dragstart","gmp-click"],nt=l.defineComponent({name:"AdvancedMarker",props:{options:{type:Object,required:!0},pinOptions:{type:Object,required:!1}},emits:ye,setup(n,{emit:e,expose:t,slots:r}){const s=l.ref(),o=l.computed(()=>{var g;return(g=r.content)==null?void 0:g.call(r).some(p=>p.type!==l.Comment)}),i=l.toRef(n,"options"),c=l.toRef(n,"pinOptions"),a=l.ref(),d=l.inject(M,l.ref()),f=l.inject(q,l.ref()),u=l.inject(ee,l.ref()),m=l.computed(()=>!!(u.value&&f.value&&a.value instanceof google.maps.marker.AdvancedMarkerElement));return l.watch([d,i,c,s],async(g,[p,h,y,v])=>{var C,j,Ve;const E=!F(i.value,h)||!F(c.value,y),w=s.value!==v,b=E||w||d.value!==p;if(!d.value||!f.value||!b||o.value&&!s.value)return;const{AdvancedMarkerElement:O,PinElement:S}=f.value.marker;if(a.value){const{map:ue,content:X,...de}=i.value;Object.assign(a.value,{content:o.value?s.value:c.value?new S(c.value).element:X,...de}),m.value&&((C=u.value)==null||C.removeMarker(a.value),(j=u.value)==null||j.addMarker(a.value))}else o.value?i.value.content=s.value:c.value&&(i.value.content=new S(c.value).element),a.value=l.markRaw(new O(i.value)),m.value?(Ve=u.value)==null||Ve.addMarker(a.value):a.value.map=d.value,ye.forEach(ue=>{var X;(X=a.value)==null||X.addListener(ue,de=>e(ue,de))})},{immediate:!0,flush:"post"}),l.onBeforeUnmount(()=>{var g,p;a.value&&((g=f.value)==null||g.event.clearInstanceListeners(a.value),m.value?(p=u.value)==null||p.removeMarker(a.value):a.value.map=null)}),l.provide(Q,a),t({marker:a}),{hasCustomSlotContent:o,markerRef:s}}}),br="",st={key:0,class:"advanced-marker-wrapper"};function ot(n,e,t,r,s,o){return l.openBlock(),l.createElementBlock(l.Fragment,null,[n.hasCustomSlotContent?(l.openBlock(),l.createElementBlock("div",st,[l.createElementVNode("div",l.mergeProps({ref:"markerRef"},n.$attrs),[l.renderSlot(n.$slots,"content")],16)])):l.createCommentVNode("v-if",!0),l.renderSlot(n.$slots,"default")],64)}const it=U(nt,[["render",ot]]),ve=n=>n==="Marker",we=n=>n===W,D=(n,e,t,r)=>{const s=l.ref(),o=l.inject(M,l.ref()),i=l.inject(q,l.ref()),c=l.inject(ee,l.ref()),a=l.computed(()=>!!(c.value&&i.value&&(s.value instanceof i.value.Marker||s.value instanceof i.value[W])));return l.watch([o,t],(d,[f,u])=>{var g,p,h;const m=!F(t.value,u)||o.value!==f;if(!(!o.value||!i.value||!m))if(s.value)s.value.setOptions(t.value),a.value&&((g=c.value)==null||g.removeMarker(s.value),(p=c.value)==null||p.addMarker(s.value));else{if(ve(n))s.value=l.markRaw(new i.value[n](t.value));else if(we(n)){const y=t.value;y.element&&(s.value=l.markRaw(new i.value[n](y)))}else s.value=l.markRaw(new i.value[n]({...t.value,map:o.value}));s.value&&(a.value?(h=c.value)==null||h.addMarker(s.value):(ve(n)||we(n))&&s.value.setMap(o.value)),e.forEach(y=>{var v;(v=s.value)==null||v.addListener(y,E=>r(y,E))})}},{immediate:!0,flush:"post"}),l.onBeforeUnmount(()=>{var d,f;s.value&&((d=i.value)==null||d.event.clearInstanceListeners(s.value),a.value?(f=c.value)==null||f.removeMarker(s.value):s.value.setMap(null))}),s},Ee=["animation_changed","click","dblclick","rightclick","dragstart","dragend","drag","mouseover","mousedown","mouseout","mouseup","draggable_changed","clickable_changed","contextmenu","cursor_changed","flat_changed","zindex_changed","icon_changed","position_changed","shape_changed","title_changed","visible_changed"],at=l.defineComponent({name:"Marker",props:{options:{type:Object,required:!0}},emits:Ee,setup(n,{emit:e,expose:t,slots:r}){const s=l.toRef(n,"options"),o=D("Marker",Ee,s,e);return l.provide(Q,o),t({marker:o}),()=>{var i;return(i=r.default)==null?void 0:i.call(r)}}}),lt=l.defineComponent({name:"Polyline",props:{options:{type:Object,required:!0}},emits:$,setup(n,{emit:e}){const t=l.toRef(n,"options");return{polyline:D("Polyline",$,t,e)}},render:()=>null}),ct=l.defineComponent({name:"Polygon",props:{options:{type:Object,required:!0}},emits:$,setup(n,{emit:e}){const t=l.toRef(n,"options");return{polygon:D("Polygon",$,t,e)}},render:()=>null}),ke=$.concat(["bounds_changed"]),ut=l.defineComponent({name:"Rectangle",props:{options:{type:Object,required:!0}},emits:ke,setup(n,{emit:e}){const t=l.toRef(n,"options");return{rectangle:D("Rectangle",ke,t,e)}},render:()=>null}),_e=$.concat(["center_changed","radius_changed"]),dt=l.defineComponent({name:"Circle",props:{options:{type:Object,required:!0}},emits:_e,setup(n,{emit:e}){const t=l.toRef(n,"options");return{circle:D("Circle",_e,t,e)}},render:()=>null}),ft=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(M,l.ref()),s=l.inject(q,l.ref()),o=l.inject(te,l.ref(!1)),i=l.watch([o,s,t],([d,f,u])=>{f&&d&&u&&(c(n.position),e("content:loaded"),setTimeout(i,0))},{immediate:!0}),c=d=>{if(r.value&&s.value&&t.value){const f=s.value.ControlPosition[d];t.value.index=n.index,r.value.controls[f].push(t.value)}},a=d=>{if(r.value&&s.value){let f=null;const u=s.value.ControlPosition[d];r.value.controls[u].forEach((m,g)=>{m===t.value&&(f=g)}),f!==null&&r.value.controls[u].removeAt(f)}};return l.onBeforeUnmount(()=>a(n.position)),l.watch(()=>n.position,(d,f)=>{a(f),c(d)}),l.watch(()=>n.index,d=>{t.value&&(t.value.index=d)}),{controlRef:t}}}),Sr="",pt={ref:"controlRef",class:"custom-control-wrapper"};function ht(n,e,t,r,s,o){return l.openBlock(),l.createElementBlock(l.Fragment,null,[l.createCommentVNode(`
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var a=document.createElement("style");a.appendChild(document.createTextNode(".mapdiv[data-v-c6aa3e71]{width:100%;height:100%}.advanced-marker-wrapper{display:none}.mapdiv .advanced-marker-wrapper{display:inline-block}.custom-control-wrapper[data-v-ae91c15f]{display:none}.mapdiv .custom-control-wrapper[data-v-ae91c15f]{display:inline-block}.info-window-wrapper[data-v-0e669f85]{display:none}.mapdiv .info-window-wrapper[data-v-0e669f85]{display:inline-block}.custom-marker-wrapper[data-v-4b2eafc1]{display:none}.mapdiv .custom-marker-wrapper[data-v-4b2eafc1]{display:inline-block}")),document.head.appendChild(a)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
|
2
|
+
(function(_,l){typeof exports=="object"&&typeof module<"u"?l(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],l):(_=typeof globalThis<"u"?globalThis:_||self,l(_.Vue3GoogleMap={},_.Vue))})(this,function(_,l){"use strict";var Or=Object.defineProperty;var Pr=(_,l,M)=>l in _?Or(_,l,{enumerable:!0,configurable:!0,writable:!0,value:M}):_[l]=M;var pe=(_,l,M)=>(Pr(_,typeof l!="symbol"?l+"":l,M),M);const M=Symbol("map"),b=Symbol("api"),X=Symbol("marker"),Q=Symbol("markerCluster"),z=Symbol("CustomMarker"),ee=Symbol("mapTilesLoaded"),B=["click","dblclick","drag","dragend","dragstart","mousedown","mousemove","mouseout","mouseover","mouseup","rightclick"];function Ue(n,e){n.src=e}const Ze=n=>{var e,t,r,o="The Google Maps JavaScript API",s="google",i="importLibrary",c="__ib__",a=document,d=window,f=d[s]||(d[s]={}),u=f.maps||(f.maps={}),m=new Set,g=new URLSearchParams,h=()=>e||(e=new Promise(async(p,y)=>{var v;await(t=a.createElement("script")),g.set("libraries",[...m]+"");for(r in n)g.set(r.replace(/[A-Z]/g,w=>"_"+w[0].toLowerCase()),n[r]);g.set("callback",s+".maps."+c),Ue(t,"https://maps.googleapis.com/maps/api/js?"+g),u[c]=p,t.onerror=()=>e=y(Error(o+" could not load.")),t.nonce=((v=a.querySelector("script[nonce]"))==null?void 0:v.nonce)||"",a.head.append(t)}));u[i]?console.warn(o+" only loads once. Ignoring:",n):u[i]=(p,...y)=>m.add(p)&&h().then(()=>u[i](p,...y))},Ge=n=>`The setOptions() function should only be called once. The options passed to the additional call (${JSON.stringify(n)}) will be ignored.`,Fe=n=>`The google.maps.importLibrary() function is already defined, and @googlemaps/js-api-loader will use the existing function instead of overwriting it. The options passed to setOptions (${JSON.stringify(n)}) will be ignored.`,ze="No options were set before calling importLibrary. Make sure to configure the loader using setOptions().",We="There already is a script loading the Google Maps JavaScript API, and no google.maps.importLibrary function is defined. @googlemaps/js-api-loader will proceed to bootstrap the API with the specified options, but the existing script might cause problems using the API. Make sure to remove the script loading the API.",te=process.env.NODE_ENV!=="production"?n=>{console.warn(`[@googlemaps/js-api-loader] ${n}`)}:()=>{},He=process.env.NODE_ENV!=="production"?n=>{console.info(`[@googlemaps/js-api-loader] ${n}`)}:()=>{};let re=!1;function Ke(n){if(re){te(Ge(n));return}Je(n),re=!0}async function Ye(n){var e,t;if(re||te(ze),!((t=(e=window==null?void 0:window.google)==null?void 0:e.maps)!=null&&t.importLibrary))throw new Error("google.maps.importLibrary is not installed.");return await google.maps.importLibrary(n)}function Je(n){var t,r;const e=!!((r=(t=window.google)==null?void 0:t.maps)!=null&&r.importLibrary);e?He(Fe(n)):process.env.NODE_ENV!=="production"&&document.querySelector('script[src*="maps.googleapis.com/maps/api/js"]')&&te(We),e||Ze(n)}function Xe(n){return class extends n.OverlayView{constructor(r){super();pe(this,"element");pe(this,"opts");const{element:o,...s}=r;this.element=o,this.opts=s,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(),o=r==null?void 0:r.fromLatLngToDivPixel(this.getPosition());if(o){this.element.style.position="absolute";let s,i;switch(this.opts.anchorPoint){case"TOP_CENTER":s="-50%",i="-100%";break;case"BOTTOM_CENTER":s="-50%",i="0";break;case"LEFT_CENTER":s="-100%",i="-50%";break;case"RIGHT_CENTER":s="0",i="-50%";break;case"TOP_LEFT":s="-100%",i="-100%";break;case"TOP_RIGHT":s="0",i="-100%";break;case"BOTTOM_LEFT":s="-100%",i="0";break;case"BOTTOM_RIGHT":s="0",i="0";break;default:s="-50%",i="-50%"}const c=o.x+(this.opts.offsetX||0)+"px",a=o.y+(this.opts.offsetY||0)+"px";this.element.style.transform=`translateX(${s}) translateX(${c}) 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:o,...s}=r;this.element=o,this.opts=s,this.draw()}}}let fe=!1;const me=["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"],Qe=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},colorScheme:{type:String,required:!1},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},cameraControl:{type:Boolean,required:!1,default:void 0},cameraControlPosition:{type:String,required:!1}},emits:me,setup(n,{emit:e}){const t=l.ref(),r=l.ref(!1),o=l.ref(),s=l.ref(),i=l.ref(!1);l.provide(M,o),l.provide(b,s),l.provide(ee,i);const c=()=>{const u={...n};Object.keys(u).forEach(p=>{u[p]===void 0&&delete u[p]});const g=p=>{var y;return p?{position:(y=s.value)==null?void 0:y.ControlPosition[p]}:{}},h={scaleControlOptions:n.scaleControlStyle?{style:n.scaleControlStyle}:{},panControlOptions:g(n.panControlPosition),zoomControlOptions:g(n.zoomControlPosition),rotateControlOptions:g(n.rotateControlPosition),streetViewControlOptions:g(n.streetViewControlPosition),fullscreenControlOptions:g(n.fullscreenControlPosition),cameraControlOptions:g(n.cameraControlPosition),disableDefaultUI:n.disableDefaultUi};return{...u,...h}},a=l.watch([s,o],([u,m])=>{const g=u,h=m;g&&h&&(g.event.addListenerOnce(h,"tilesloaded",()=>{i.value=!0}),setTimeout(a,0))},{immediate:!0}),d=()=>{const{apiKey:u,region:m,version:g,language:h,libraries:p}=n;Ke({key:u,region:m,v:g,language:h,libraries:p})},f=u=>{const m=u?u.maps:google.maps;s.value=l.markRaw(m),o.value=l.markRaw(new m.Map(t.value,c()));const g=Xe(s.value);s.value[z]=g,me.forEach(p=>{var y;(y=o.value)==null||y.addListener(p,v=>e(p,v))}),r.value=!0;const h=Object.keys(n).filter(p=>!["apiPromise","apiKey","version","libraries","region","language","center","zoom"].includes(p)).map(p=>l.toRef(n,p));l.watch([()=>n.center,()=>n.zoom,...h],([p,y],[v,w])=>{var C,j,F;const{center:E,zoom:R,...O}=c();(C=o.value)==null||C.setOptions(O),y!==void 0&&y!==w&&((j=o.value)==null||j.setZoom(y));const S=!v||p.lng!==v.lng||p.lat!==v.lat;p&&S&&((F=o.value)==null||F.panTo(p))})};return l.onMounted(()=>{if(n.apiPromise&&n.apiPromise instanceof Promise)n.apiPromise.then(f);else{fe||(d(),fe=!0);const u=n.libraries&&n.libraries.length>0?n.libraries:["maps","marker"];Promise.all(u.map(m=>Ye(m))).then(()=>f())}}),l.onBeforeUnmount(()=>{var u;i.value=!1,o.value&&((u=s.value)==null||u.event.clearInstanceListeners(o.value))}),{mapRef:t,ready:r,map:o,api:s,mapTilesLoaded:i}}}),Sr="",$=(n,e)=>{const t=n.__vccOpts||n;for(const[r,o]of e)t[r]=o;return t},et={ref:"mapRef",class:"mapdiv"};function tt(n,e,t,r,o,s){return l.openBlock(),l.createElementBlock("div",null,[l.createElementVNode("div",et,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 rt=$(Qe,[["render",tt],["__scopeId","data-v-c6aa3e71"]]);function nt(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var ot=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,o,s;if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(o=r;o--!==0;)if(!n(e[o],t[o]))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(s=Object.keys(e),r=s.length,r!==Object.keys(t).length)return!1;for(o=r;o--!==0;)if(!Object.prototype.hasOwnProperty.call(t,s[o]))return!1;for(o=r;o--!==0;){var i=s[o];if(!n(e[i],t[i]))return!1}return!0}return e!==e&&t!==t};const D=nt(ot),he=["click","drag","dragend","dragstart","gmp-click"],st=l.defineComponent({name:"AdvancedMarker",props:{options:{type:Object,required:!0},pinOptions:{type:Object,required:!1}},emits:he,setup(n,{emit:e,expose:t,slots:r}){const o=l.ref(),s=l.computed(()=>{var g;return(g=r.content)==null?void 0:g.call(r).some(h=>h.type!==l.Comment)}),i=l.toRef(n,"options"),c=l.toRef(n,"pinOptions"),a=l.ref(),d=l.inject(M,l.ref()),f=l.inject(b,l.ref()),u=l.inject(Q,l.ref()),m=l.computed(()=>!!(u.value&&f.value&&a.value instanceof google.maps.marker.AdvancedMarkerElement));return l.watch([d,i,c,o],async(g,[h,p,y,v])=>{var C,j,F;const w=!D(i.value,p)||!D(c.value,y),E=o.value!==v,R=w||E||d.value!==h;if(!d.value||!f.value||!R||s.value&&!o.value)return;const{AdvancedMarkerElement:O,PinElement:S}=f.value.marker;if(a.value){const{map:ue,content:J,...de}=i.value;Object.assign(a.value,{content:s.value?o.value:c.value?new S(c.value).element:J,...de}),m.value&&((C=u.value)==null||C.removeMarker(a.value),(j=u.value)==null||j.addMarker(a.value))}else s.value?i.value.content=o.value:c.value&&(i.value.content=new S(c.value).element),a.value=l.markRaw(new O(i.value)),m.value?(F=u.value)==null||F.addMarker(a.value):a.value.map=d.value,he.forEach(ue=>{var J;(J=a.value)==null||J.addListener(ue,de=>e(ue,de))})},{immediate:!0,flush:"post"}),l.onBeforeUnmount(()=>{var g,h;a.value&&((g=f.value)==null||g.event.clearInstanceListeners(a.value),m.value?(h=u.value)==null||h.removeMarker(a.value):a.value.map=null)}),l.provide(X,a),t({marker:a}),{hasCustomSlotContent:s,markerRef:o}}}),br="",at={key:0,class:"advanced-marker-wrapper"};function it(n,e,t,r,o,s){return l.openBlock(),l.createElementBlock(l.Fragment,null,[n.hasCustomSlotContent?(l.openBlock(),l.createElementBlock("div",at,[l.createElementVNode("div",l.mergeProps({ref:"markerRef"},n.$attrs),[l.renderSlot(n.$slots,"content")],16)])):l.createCommentVNode("v-if",!0),l.renderSlot(n.$slots,"default")],64)}const lt=$(st,[["render",it]]),ge=n=>n==="Marker",ye=n=>n===z,N=(n,e,t,r)=>{const o=l.ref(),s=l.inject(M,l.ref()),i=l.inject(b,l.ref()),c=l.inject(Q,l.ref()),a=l.computed(()=>!!(c.value&&i.value&&(o.value instanceof i.value.Marker||o.value instanceof i.value[z])));return l.watch([s,t],(d,[f,u])=>{var g,h,p;const m=!D(t.value,u)||s.value!==f;if(!(!s.value||!i.value||!m))if(o.value)o.value.setOptions(t.value),a.value&&((g=c.value)==null||g.removeMarker(o.value),(h=c.value)==null||h.addMarker(o.value));else{if(ge(n))o.value=l.markRaw(new i.value[n](t.value));else if(ye(n)){const y=t.value;y.element&&(o.value=l.markRaw(new i.value[n](y)))}else o.value=l.markRaw(new i.value[n]({...t.value,map:s.value}));o.value&&(a.value?(p=c.value)==null||p.addMarker(o.value):(ge(n)||ye(n))&&o.value.setMap(s.value)),e.forEach(y=>{var v;(v=o.value)==null||v.addListener(y,w=>r(y,w))})}},{immediate:!0,flush:"post"}),l.onBeforeUnmount(()=>{var d,f;o.value&&((d=i.value)==null||d.event.clearInstanceListeners(o.value),a.value?(f=c.value)==null||f.removeMarker(o.value):o.value.setMap(null))}),o},ve=["animation_changed","click","dblclick","rightclick","dragstart","dragend","drag","mouseover","mousedown","mouseout","mouseup","draggable_changed","clickable_changed","contextmenu","cursor_changed","flat_changed","zindex_changed","icon_changed","position_changed","shape_changed","title_changed","visible_changed"],ct=l.defineComponent({name:"Marker",props:{options:{type:Object,required:!0}},emits:ve,setup(n,{emit:e,expose:t,slots:r}){const o=l.toRef(n,"options"),s=N("Marker",ve,o,e);return l.provide(X,s),t({marker:s}),()=>{var i;return(i=r.default)==null?void 0:i.call(r)}}}),ut=l.defineComponent({name:"Polyline",props:{options:{type:Object,required:!0}},emits:B,setup(n,{emit:e}){const t=l.toRef(n,"options");return{polyline:N("Polyline",B,t,e)}},render:()=>null}),dt=l.defineComponent({name:"Polygon",props:{options:{type:Object,required:!0}},emits:B,setup(n,{emit:e}){const t=l.toRef(n,"options");return{polygon:N("Polygon",B,t,e)}},render:()=>null}),we=B.concat(["bounds_changed"]),pt=l.defineComponent({name:"Rectangle",props:{options:{type:Object,required:!0}},emits:we,setup(n,{emit:e}){const t=l.toRef(n,"options");return{rectangle:N("Rectangle",we,t,e)}},render:()=>null}),_e=B.concat(["center_changed","radius_changed"]),ft=l.defineComponent({name:"Circle",props:{options:{type:Object,required:!0}},emits:_e,setup(n,{emit:e}){const t=l.toRef(n,"options");return{circle:N("Circle",_e,t,e)}},render:()=>null}),mt=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(M,l.ref()),o=l.inject(b,l.ref()),s=l.inject(ee,l.ref(!1)),i=l.watch([s,o,t],([d,f,u])=>{f&&d&&u&&(c(n.position),e("content:loaded"),setTimeout(i,0))},{immediate:!0}),c=d=>{if(r.value&&o.value&&t.value){const f=o.value.ControlPosition[d];t.value.index=n.index,r.value.controls[f].push(t.value)}},a=d=>{if(r.value&&o.value){let f=null;const u=o.value.ControlPosition[d];r.value.controls[u].forEach((m,g)=>{m===t.value&&(f=g)}),f!==null&&r.value.controls[u].removeAt(f)}};return l.onBeforeUnmount(()=>a(n.position)),l.watch(()=>n.position,(d,f)=>{a(f),c(d)}),l.watch(()=>n.index,d=>{t.value&&(t.value.index=d)}),{controlRef:t}}}),Ar="",ht={ref:"controlRef",class:"custom-control-wrapper"};function gt(n,e,t,r,o,s){return l.openBlock(),l.createElementBlock(l.Fragment,null,[l.createCommentVNode(`
|
|
3
3
|
v-show must be used instead of v-if otherwise there
|
|
4
4
|
would be no rendered content pushed to the map controls
|
|
5
|
-
`),l.createElementVNode("div",pt,[l.renderSlot(n.$slots,"default",{},void 0,!0)],512)],2112)}const mt=U(ft,[["render",ht],["__scopeId","data-v-ae91c15f"]]),Ce=["closeclick","content_changed","domready","position_changed","visible","zindex_changed"],gt=l.defineComponent({inheritAttrs:!1,props:{options:{type:Object,default:()=>({})},modelValue:{type:Boolean}},emits:[...Ce,"update:modelValue"],setup(n,{slots:e,emit:t,expose:r}){const s=l.ref(),o=l.ref(),i=l.inject(M,l.ref()),c=l.inject(q,l.ref()),a=l.inject(Q,l.ref());let d,f=n.modelValue;const u=l.computed(()=>{var h;return(h=e.default)==null?void 0:h.call(e).some(y=>y.type!==l.Comment)}),m=h=>{f=h,t("update:modelValue",h)},g=h=>{s.value&&(s.value.open({map:i.value,anchor:a.value,...h}),m(!0))},p=()=>{s.value&&(s.value.close(),m(!1))};return l.onMounted(()=>{l.watch([i,()=>n.options],([h,y],[v,E])=>{var b;const w=!F(y,E)||i.value!==v;i.value&&c.value&&w&&(s.value?(s.value.setOptions({...y,content:u.value?o.value:y.content}),a.value||g()):(s.value=l.markRaw(new c.value.InfoWindow({...y,content:u.value?o.value:y.content})),a.value&&(d=a.value.addListener("click",()=>{g()})),(!a.value||f)&&g(),Ce.forEach(O=>{var S;(S=s.value)==null||S.addListener(O,C=>t(O,C))}),(b=s.value)==null||b.addListener("closeclick",()=>m(!1))))},{immediate:!0,flush:"post"}),l.watch(()=>n.modelValue,h=>{h!==f&&(h?g():p())})}),l.onBeforeUnmount(()=>{var h;d&&d.remove(),s.value&&((h=c.value)==null||h.event.clearInstanceListeners(s.value),p())}),r({infoWindow:s,open:g,close:p}),{infoWindow:s,infoWindowRef:o,hasSlotContent:u,open:g,close:p}}}),Pr="",yt={key:0,class:"info-window-wrapper"};function vt(n,e,t,r,s,o){return n.hasSlotContent?(l.openBlock(),l.createElementBlock("div",yt,[l.createElementVNode("div",l.mergeProps({ref:"infoWindowRef"},n.$attrs),[l.renderSlot(n.$slots,"default",{},void 0,!0)],16)])):l.createCommentVNode("v-if",!0)}const wt=U(gt,[["render",vt],["__scopeId","data-v-0e669f85"]]);var Et=Object.getOwnPropertyNames,kt=Object.getOwnPropertySymbols,_t=Object.prototype.hasOwnProperty;function Me(n,e){return function(r,s,o){return n(r,s,o)&&e(r,s,o)}}function H(n){return function(t,r,s){if(!t||!r||typeof t!="object"||typeof r!="object")return n(t,r,s);var o=s.cache,i=o.get(t),c=o.get(r);if(i&&c)return i===r&&c===t;o.set(t,r),o.set(r,t);var a=n(t,r,s);return o.delete(t),o.delete(r),a}}function Oe(n){return Et(n).concat(kt(n))}var Ct=Object.hasOwn||function(n,e){return _t.call(n,e)};function x(n,e){return n===e||!n&&!e&&n!==n&&e!==e}var Mt="__v",Ot="__o",bt="_owner",be=Object.getOwnPropertyDescriptor,Se=Object.keys;function St(n,e,t){var r=n.length;if(e.length!==r)return!1;for(;r-- >0;)if(!t.equals(n[r],e[r],r,r,n,e,t))return!1;return!0}function Pt(n,e){return x(n.getTime(),e.getTime())}function qt(n,e){return n.name===e.name&&n.message===e.message&&n.cause===e.cause&&n.stack===e.stack}function At(n,e){return n===e}function Pe(n,e,t){var r=n.size;if(r!==e.size)return!1;if(!r)return!0;for(var s=new Array(r),o=n.entries(),i,c,a=0;(i=o.next())&&!i.done;){for(var d=e.entries(),f=!1,u=0;(c=d.next())&&!c.done;){if(s[u]){u++;continue}var m=i.value,g=c.value;if(t.equals(m[0],g[0],a,u,n,e,t)&&t.equals(m[1],g[1],m[0],g[0],n,e,t)){f=s[u]=!0;break}u++}if(!f)return!1;a++}return!0}var Tt=x;function Lt(n,e,t){var r=Se(n),s=r.length;if(Se(e).length!==s)return!1;for(;s-- >0;)if(!Ae(n,e,t,r[s]))return!1;return!0}function Z(n,e,t){var r=Oe(n),s=r.length;if(Oe(e).length!==s)return!1;for(var o,i,c;s-- >0;)if(o=r[s],!Ae(n,e,t,o)||(i=be(n,o),c=be(e,o),(i||c)&&(!i||!c||i.configurable!==c.configurable||i.enumerable!==c.enumerable||i.writable!==c.writable)))return!1;return!0}function It(n,e){return x(n.valueOf(),e.valueOf())}function jt(n,e){return n.source===e.source&&n.flags===e.flags}function qe(n,e,t){var r=n.size;if(r!==e.size)return!1;if(!r)return!0;for(var s=new Array(r),o=n.values(),i,c;(i=o.next())&&!i.done;){for(var a=e.values(),d=!1,f=0;(c=a.next())&&!c.done;){if(!s[f]&&t.equals(i.value,c.value,i.value,c.value,n,e,t)){d=s[f]=!0;break}f++}if(!d)return!1}return!0}function Rt(n,e){var t=n.length;if(e.length!==t)return!1;for(;t-- >0;)if(n[t]!==e[t])return!1;return!0}function xt(n,e){return n.hostname===e.hostname&&n.pathname===e.pathname&&n.protocol===e.protocol&&n.port===e.port&&n.hash===e.hash&&n.username===e.username&&n.password===e.password}function Ae(n,e,t,r){return(r===bt||r===Ot||r===Mt)&&(n.$$typeof||e.$$typeof)?!0:Ct(e,r)&&t.equals(n[r],e[r],r,r,n,e,t)}var Bt="[object Arguments]",$t="[object Boolean]",Nt="[object Date]",Dt="[object Error]",Ut="[object Map]",Ft="[object Number]",Zt="[object Object]",Vt="[object RegExp]",Gt="[object Set]",zt="[object String]",Wt="[object URL]",Ht=Array.isArray,Te=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,Le=Object.assign,Kt=Object.prototype.toString.call.bind(Object.prototype.toString);function Jt(n){var e=n.areArraysEqual,t=n.areDatesEqual,r=n.areErrorsEqual,s=n.areFunctionsEqual,o=n.areMapsEqual,i=n.areNumbersEqual,c=n.areObjectsEqual,a=n.arePrimitiveWrappersEqual,d=n.areRegExpsEqual,f=n.areSetsEqual,u=n.areTypedArraysEqual,m=n.areUrlsEqual;return function(p,h,y){if(p===h)return!0;if(p==null||h==null)return!1;var v=typeof p;if(v!==typeof h)return!1;if(v!=="object")return v==="number"?i(p,h,y):v==="function"?s(p,h,y):!1;var E=p.constructor;if(E!==h.constructor)return!1;if(E===Object)return c(p,h,y);if(Ht(p))return e(p,h,y);if(Te!=null&&Te(p))return u(p,h,y);if(E===Date)return t(p,h,y);if(E===RegExp)return d(p,h,y);if(E===Map)return o(p,h,y);if(E===Set)return f(p,h,y);var w=Kt(p);return w===Nt?t(p,h,y):w===Vt?d(p,h,y):w===Ut?o(p,h,y):w===Gt?f(p,h,y):w===Zt?typeof p.then!="function"&&typeof h.then!="function"&&c(p,h,y):w===Wt?m(p,h,y):w===Dt?r(p,h,y):w===Bt?c(p,h,y):w===$t||w===Ft||w===zt?a(p,h,y):!1}}function Yt(n){var e=n.circular,t=n.createCustomConfig,r=n.strict,s={areArraysEqual:r?Z:St,areDatesEqual:Pt,areErrorsEqual:qt,areFunctionsEqual:At,areMapsEqual:r?Me(Pe,Z):Pe,areNumbersEqual:Tt,areObjectsEqual:r?Z:Lt,arePrimitiveWrappersEqual:It,areRegExpsEqual:jt,areSetsEqual:r?Me(qe,Z):qe,areTypedArraysEqual:r?Z:Rt,areUrlsEqual:xt};if(t&&(s=Le({},s,t(s))),e){var o=H(s.areArraysEqual),i=H(s.areMapsEqual),c=H(s.areObjectsEqual),a=H(s.areSetsEqual);s=Le({},s,{areArraysEqual:o,areMapsEqual:i,areObjectsEqual:c,areSetsEqual:a})}return s}function Xt(n){return function(e,t,r,s,o,i,c){return n(e,t,c)}}function Qt(n){var e=n.circular,t=n.comparator,r=n.createState,s=n.equals,o=n.strict;if(r)return function(a,d){var f=r(),u=f.cache,m=u===void 0?e?new WeakMap:void 0:u,g=f.meta;return t(a,d,{cache:m,equals:s,meta:g,strict:o})};if(e)return function(a,d){return t(a,d,{cache:new WeakMap,equals:s,meta:void 0,strict:o})};var i={cache:void 0,equals:s,meta:void 0,strict:o};return function(a,d){return t(a,d,i)}}var K=A();A({strict:!0}),A({circular:!0}),A({circular:!0,strict:!0}),A({createInternalComparator:function(){return x}}),A({strict:!0,createInternalComparator:function(){return x}}),A({circular:!0,createInternalComparator:function(){return x}}),A({circular:!0,createInternalComparator:function(){return x},strict:!0});function A(n){n===void 0&&(n={});var e=n.circular,t=e===void 0?!1:e,r=n.createInternalComparator,s=n.createState,o=n.strict,i=o===void 0?!1:o,c=Yt(n),a=Jt(c),d=r?r(a):Xt(a);return Qt({circular:t,comparator:a,createState:s,equals:d,strict:i})}const Ie=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],ne=1,V=8;class se{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!==ne)throw new Error(`Got v${s} data when expected v${ne}.`);const o=Ie[r&15];if(!o)throw new Error("Unrecognized array type.");const[i]=new Uint16Array(e,2,1),[c]=new Uint32Array(e,4,1);return new se(c,i,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),i=e*2*this.ArrayType.BYTES_PER_ELEMENT,c=e*this.IndexArrayType.BYTES_PER_ELEMENT,a=(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,V,e),this.coords=new this.ArrayType(this.data,V+c+a,e*2),this._pos=e*2,this._finished=!0):(this.data=new ArrayBuffer(V+i+c+a),this.ids=new this.IndexArrayType(this.data,V,e),this.coords=new this.ArrayType(this.data,V+c+a,e*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(ne<<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 oe(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:i,nodeSize:c}=this,a=[0,o.length-1,0],d=[];for(;a.length;){const f=a.pop()||0,u=a.pop()||0,m=a.pop()||0;if(u-m<=c){for(let y=m;y<=u;y++){const v=i[2*y],E=i[2*y+1];v>=e&&v<=r&&E>=t&&E<=s&&d.push(o[y])}continue}const g=m+u>>1,p=i[2*g],h=i[2*g+1];p>=e&&p<=r&&h>=t&&h<=s&&d.push(o[g]),(f===0?e<=p:t<=h)&&(a.push(m),a.push(g-1),a.push(1-f)),(f===0?r>=p:s>=h)&&(a.push(g+1),a.push(u),a.push(1-f))}return d}within(e,t,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:s,coords:o,nodeSize:i}=this,c=[0,s.length-1,0],a=[],d=r*r;for(;c.length;){const f=c.pop()||0,u=c.pop()||0,m=c.pop()||0;if(u-m<=i){for(let y=m;y<=u;y++)Re(o[2*y],o[2*y+1],e,t)<=d&&a.push(s[y]);continue}const g=m+u>>1,p=o[2*g],h=o[2*g+1];Re(p,h,e,t)<=d&&a.push(s[g]),(f===0?e-r<=p:t-r<=h)&&(c.push(m),c.push(g-1),c.push(1-f)),(f===0?e+r>=p:t+r>=h)&&(c.push(g+1),c.push(u),c.push(1-f))}return a}}function oe(n,e,t,r,s,o){if(s-r<=t)return;const i=r+s>>1;je(n,e,i,r,s,o),oe(n,e,t,r,i-1,1-o),oe(n,e,t,i+1,s,1-o)}function je(n,e,t,r,s,o){for(;s>r;){if(s-r>600){const d=s-r+1,f=t-r+1,u=Math.log(d),m=.5*Math.exp(2*u/3),g=.5*Math.sqrt(u*m*(d-m)/d)*(f-d/2<0?-1:1),p=Math.max(r,Math.floor(t-f*m/d+g)),h=Math.min(s,Math.floor(t+(d-f)*m/d+g));je(n,e,t,p,h,o)}const i=e[2*t+o];let c=r,a=s;for(G(n,e,r,t),e[2*s+o]>i&&G(n,e,r,s);c<a;){for(G(n,e,c,a),c++,a--;e[2*c+o]<i;)c++;for(;e[2*a+o]>i;)a--}e[2*r+o]===i?G(n,e,r,a):(a++,G(n,e,a,s)),a<=t&&(r=a+1),t<=a&&(s=a-1)}}function G(n,e,t,r){ie(n,t,r),ie(e,2*t,2*r),ie(e,2*t+1,2*r+1)}function ie(n,e,t){const r=n[e];n[e]=n[t],n[t]=r}function Re(n,e,t,r){const s=n-t,o=e-r;return s*s+o*o}const er={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:n=>n},xe=Math.fround||(n=>e=>(n[0]=+e,n[0]))(new Float32Array(1)),B=2,T=3,ae=4,L=5,Be=6;class $e{constructor(e){this.options=Object.assign(Object.create(er),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 i=[];for(let a=0;a<e.length;a++){const d=e[a];if(!d.geometry)continue;const[f,u]=d.geometry.coordinates,m=xe(J(f)),g=xe(Y(u));i.push(m,g,1/0,a,-1,1),this.options.reduce&&i.push(0)}let c=this.trees[s+1]=this._createTree(i);t&&console.timeEnd(o);for(let a=s;a>=r;a--){const d=+Date.now();c=this.trees[a]=this._createTree(this._cluster(c,a)),t&&console.log("z%d: %d clusters in %dms",a,c.numItems,+Date.now()-d)}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 i=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,i],t),m=this.getClusters([-180,s,o,i],t);return u.concat(m)}const c=this.trees[this._limitZoom(t)],a=c.range(J(r),Y(i),J(o),Y(s)),d=c.data,f=[];for(const u of a){const m=this.stride*u;f.push(d[m+L]>1?Ne(d,m,this.clusterProps):this.points[d[m+T]])}return f}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 i=o.data;if(t*this.stride>=i.length)throw new Error(s);const c=this.options.radius/(this.options.extent*Math.pow(2,r-1)),a=i[t*this.stride],d=i[t*this.stride+1],f=o.within(a,d,c),u=[];for(const m of f){const g=m*this.stride;i[g+ae]===e&&u.push(i[g+L]>1?Ne(i,g,this.clusterProps):this.points[i[g+T]])}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:i,radius:c}=this.options,a=c/i,d=(r-a)/o,f=(r+1+a)/o,u={features:[]};return this._addTileFeatures(s.range((t-a)/o,d,(t+1+a)/o,f),s.data,t,r,o,u),t===0&&this._addTileFeatures(s.range(1-a/o,d,1,f),s.data,o,r,o,u),t===o-1&&this._addTileFeatures(s.range(0,d,a/o,f),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 i=this.getChildren(t);for(const c of i){const a=c.properties;if(a&&a.cluster?o+a.point_count<=s?o+=a.point_count:o=this._appendLeaves(e,a.cluster_id,r,s,o):o<s?o++:e.push(c),e.length===r)break}return o}_createTree(e){const t=new se(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,i){for(const c of e){const a=c*this.stride,d=t[a+L]>1;let f,u,m;if(d)f=De(t,a,this.clusterProps),u=t[a],m=t[a+1];else{const h=this.points[t[a+T]];f=h.properties;const[y,v]=h.geometry.coordinates;u=J(y),m=Y(v)}const g={type:1,geometry:[[Math.round(this.options.extent*(u*o-r)),Math.round(this.options.extent*(m*o-s))]],tags:f};let p;d||this.options.generateId?p=t[a+T]:p=this.points[t[a+T]].id,p!==void 0&&(g.id=p),i.features.push(g)}}_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:i}=this.options,c=r/(s*Math.pow(2,t)),a=e.data,d=[],f=this.stride;for(let u=0;u<a.length;u+=f){if(a[u+B]<=t)continue;a[u+B]=t;const m=a[u],g=a[u+1],p=e.within(a[u],a[u+1],c),h=a[u+L];let y=h;for(const v of p){const E=v*f;a[E+B]>t&&(y+=a[E+L])}if(y>h&&y>=i){let v=m*h,E=g*h,w,b=-1;const O=((u/f|0)<<5)+(t+1)+this.points.length;for(const S of p){const C=S*f;if(a[C+B]<=t)continue;a[C+B]=t;const j=a[C+L];v+=a[C]*j,E+=a[C+1]*j,a[C+ae]=O,o&&(w||(w=this._map(a,u,!0),b=this.clusterProps.length,this.clusterProps.push(w)),o(w,this._map(a,C)))}a[u+ae]=O,d.push(v/y,E/y,1/0,O,-1,y),o&&d.push(b)}else{for(let v=0;v<f;v++)d.push(a[u+v]);if(y>1)for(const v of p){const E=v*f;if(!(a[E+B]<=t)){a[E+B]=t;for(let w=0;w<f;w++)d.push(a[E+w])}}}}return d}_getOriginId(e){return e-this.points.length>>5}_getOriginZoom(e){return(e-this.points.length)%32}_map(e,t,r){if(e[t+L]>1){const i=this.clusterProps[e[t+Be]];return r?Object.assign({},i):i}const s=this.points[e[t+T]].properties,o=this.options.map(s);return r&&o===s?Object.assign({},o):o}}function Ne(n,e,t){return{type:"Feature",id:n[e+T],properties:De(n,e,t),geometry:{type:"Point",coordinates:[tr(n[e]),rr(n[e+1])]}}}function De(n,e,t){const r=n[e+L],s=r>=1e4?`${Math.round(r/1e3)}k`:r>=1e3?`${Math.round(r/100)/10}k`:r,o=n[e+Be],i=o===-1?{}:Object.assign({},t[o]);return Object.assign(i,{cluster:!0,cluster_id:n[e+T],point_count:r,point_count_abbreviated:s})}function J(n){return n/360+.5}function Y(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 tr(n){return(n-.5)*360}function rr(n){const e=(180-n*360)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}function le(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}typeof SuppressedError=="function"&&SuppressedError;class _{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(Number.isFinite(e.position.lat)&&Number.isFinite(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&&(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(_.getPosition(t));return e}get position(){return this._position||this.bounds.getCenter()}get count(){return this.markers.filter(e=>_.getVisible(e)).length}push(e){this.markers.push(e)}delete(){this.marker&&(_.setMap(this.marker,null),this.marker=void 0),this.markers.length=0}}function P(n,e="assertion failed"){if(n==null)throw Error(e)}const nr=(n,e,t,r)=>{const s=n.getBounds();P(s);const o=Ue(s,e,r);return t.filter(i=>o.contains(_.getPosition(i)))},Ue=(n,e,t)=>{const{northEast:r,southWest:s}=or(n,e),o=ir({northEast:r,southWest:s},t);return ar(o,e)},sr=(n,e,t)=>{const r=Ue(n,e,t),s=r.getNorthEast(),o=r.getSouthWest();return[o.lng(),o.lat(),s.lng(),s.lat()]},or=(n,e)=>{const t=e.fromLatLngToDivPixel(n.getNorthEast()),r=e.fromLatLngToDivPixel(n.getSouthWest());return P(t),P(r),{northEast:t,southWest:r}},ir=({northEast:n,southWest:e},t)=>(n.x+=t,n.y-=t,e.x-=t,e.y+=t,{northEast:n,southWest:e}),ar=({northEast:n,southWest:e},t)=>{const r=t.fromDivPixelToLatLng(e),s=t.fromDivPixelToLatLng(n);return new google.maps.LatLngBounds(r,s)};class Fe{constructor({maxZoom:e=16}){this.maxZoom=e}noop({markers:e}){return cr(e)}}class lr extends Fe{constructor(e){var{viewportPadding:t=60}=e,r=le(e,["viewportPadding"]);super(r),this.viewportPadding=60,this.viewportPadding=t}calculate({markers:e,map:t,mapCanvasProjection:r}){const s=t.getZoom();return P(s),s>=this.maxZoom?{clusters:this.noop({markers:e}),changed:!1}:{clusters:this.cluster({markers:nr(t,r,e,this.viewportPadding),map:t,mapCanvasProjection:r})}}}const cr=n=>n.map(t=>new z({position:_.getPosition(t),markers:[t]}));class ur extends Fe{constructor(e){var{maxZoom:t,radius:r=60}=e,s=le(e,["maxZoom","radius"]);super({maxZoom:t}),this.markers=[],this.clusters=[],this.state={zoom:-1},this.superCluster=new $e(Object.assign({maxZoom:this.maxZoom,radius:r},s))}calculate(e){let t=!1,r=e.map.getZoom();P(r),r=Math.round(r);const s={zoom:r};if(!K(e.markers,this.markers)){t=!0,this.markers=[...e.markers];const o=this.markers.map(i=>{const c=_.getPosition(i);return{type:"Feature",geometry:{type:"Point",coordinates:[c.lng(),c.lat()]},properties:{marker:i}}});this.superCluster.load(o)}return t||(this.state.zoom<=this.maxZoom||s.zoom<=this.maxZoom)&&(t=!K(this.state,s)),this.state=s,e.markers.length===0?(this.clusters=[],{clusters:this.clusters,changed:t}):(t&&(this.clusters=this.cluster(e)),{clusters:this.clusters,changed:t})}cluster({map:e}){const t=e.getZoom();return P(t),this.superCluster.getClusters([-180,-90,180,90],Math.round(t)).map(r=>this.transformCluster(r))}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:_.getPosition(s)})}}class dr extends lr{constructor(e){var{maxZoom:t,radius:r=60,viewportPadding:s=60}=e,o=le(e,["maxZoom","radius","viewportPadding"]);super({maxZoom:t,viewportPadding:s}),this.markers=[],this.clusters=[],this.superCluster=new $e(Object.assign({maxZoom:this.maxZoom,radius:r},o)),this.state={zoom:-1,view:[0,0,0,0]}}calculate(e){const t=this.getViewportState(e);let r=!K(this.state,t);if(!K(e.markers,this.markers)){r=!0,this.markers=[...e.markers];const s=this.markers.map(o=>{const i=_.getPosition(o);return{type:"Feature",geometry:{type:"Point",coordinates:[i.lng(),i.lat()]},properties:{marker:o}}});this.superCluster.load(s)}return r&&(this.clusters=this.cluster(e),this.state=t),{clusters:this.clusters,changed:r}}cluster(e){const t=this.getViewportState(e);return this.superCluster.getClusters(t.view,t.zoom).map(r=>this.transformCluster(r))}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:_.getPosition(s)})}getViewportState(e){const t=e.map.getZoom(),r=e.map.getBounds();return P(t),P(r),{zoom:Math.round(t),view:sr(r,e.mapCanvasProjection,this.viewportPadding)}}}class fr{constructor(e,t){this.markers={sum:e.length};const r=t.map(o=>o.count),s=r.reduce((o,i)=>o+i,0);this.clusters={count:t.length,markers:{mean:s/t.length,sum:s,min:Math.min(...r),max:Math.max(...r)}}}}class pr{render({count:e,position:t},r,s){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">
|
|
5
|
+
`),l.createElementVNode("div",ht,[l.renderSlot(n.$slots,"default",{},void 0,!0)],512)],2112)}const yt=$(mt,[["render",gt],["__scopeId","data-v-ae91c15f"]]),Ee=["closeclick","content_changed","domready","position_changed","visible","zindex_changed"],vt=l.defineComponent({inheritAttrs:!1,props:{options:{type:Object,default:()=>({})},modelValue:{type:Boolean}},emits:[...Ee,"update:modelValue"],setup(n,{slots:e,emit:t,expose:r}){const o=l.ref(),s=l.ref(),i=l.inject(M,l.ref()),c=l.inject(b,l.ref()),a=l.inject(X,l.ref());let d,f=n.modelValue;const u=l.computed(()=>{var p;return(p=e.default)==null?void 0:p.call(e).some(y=>y.type!==l.Comment)}),m=p=>{f=p,t("update:modelValue",p)},g=p=>{o.value&&(o.value.open({map:i.value,anchor:a.value,...p}),m(!0))},h=()=>{o.value&&(o.value.close(),m(!1))};return l.onMounted(()=>{l.watch([i,()=>n.options],([p,y],[v,w])=>{var R;const E=!D(y,w)||i.value!==v;i.value&&c.value&&E&&(o.value?(o.value.setOptions({...y,content:u.value?s.value:y.content}),a.value||g()):(o.value=l.markRaw(new c.value.InfoWindow({...y,content:u.value?s.value:y.content})),a.value&&(d=a.value.addListener("click",()=>{g()})),(!a.value||f)&&g(),Ee.forEach(O=>{var S;(S=o.value)==null||S.addListener(O,C=>t(O,C))}),(R=o.value)==null||R.addListener("closeclick",()=>m(!1))))},{immediate:!0,flush:"post"}),l.watch(()=>n.modelValue,p=>{p!==f&&(p?g():h())})}),l.onBeforeUnmount(()=>{var p;d&&d.remove(),o.value&&((p=c.value)==null||p.event.clearInstanceListeners(o.value),h())}),r({infoWindow:o,open:g,close:h}),{infoWindow:o,infoWindowRef:s,hasSlotContent:u,open:g,close:h}}}),qr="",wt={key:0,class:"info-window-wrapper"};function _t(n,e,t,r,o,s){return n.hasSlotContent?(l.openBlock(),l.createElementBlock("div",wt,[l.createElementVNode("div",l.mergeProps({ref:"infoWindowRef"},n.$attrs),[l.renderSlot(n.$slots,"default",{},void 0,!0)],16)])):l.createCommentVNode("v-if",!0)}const Et=$(vt,[["render",_t],["__scopeId","data-v-0e669f85"]]);var kt=Object.getOwnPropertyNames,Ct=Object.getOwnPropertySymbols,Mt=Object.prototype.hasOwnProperty;function ke(n,e){return function(r,o,s){return n(r,o,s)&&e(r,o,s)}}function W(n){return function(t,r,o){if(!t||!r||typeof t!="object"||typeof r!="object")return n(t,r,o);var s=o.cache,i=s.get(t),c=s.get(r);if(i&&c)return i===r&&c===t;s.set(t,r),s.set(r,t);var a=n(t,r,o);return s.delete(t),s.delete(r),a}}function Ce(n){return kt(n).concat(Ct(n))}var Ot=Object.hasOwn||function(n,e){return Mt.call(n,e)};function x(n,e){return n===e||!n&&!e&&n!==n&&e!==e}var Pt="__v",St="__o",bt="_owner",Me=Object.getOwnPropertyDescriptor,Oe=Object.keys;function At(n,e,t){var r=n.length;if(e.length!==r)return!1;for(;r-- >0;)if(!t.equals(n[r],e[r],r,r,n,e,t))return!1;return!0}function qt(n,e){return x(n.getTime(),e.getTime())}function Tt(n,e){return n.name===e.name&&n.message===e.message&&n.cause===e.cause&&n.stack===e.stack}function Lt(n,e){return n===e}function Pe(n,e,t){var r=n.size;if(r!==e.size)return!1;if(!r)return!0;for(var o=new Array(r),s=n.entries(),i,c,a=0;(i=s.next())&&!i.done;){for(var d=e.entries(),f=!1,u=0;(c=d.next())&&!c.done;){if(o[u]){u++;continue}var m=i.value,g=c.value;if(t.equals(m[0],g[0],a,u,n,e,t)&&t.equals(m[1],g[1],m[0],g[0],n,e,t)){f=o[u]=!0;break}u++}if(!f)return!1;a++}return!0}var Rt=x;function jt(n,e,t){var r=Oe(n),o=r.length;if(Oe(e).length!==o)return!1;for(;o-- >0;)if(!be(n,e,t,r[o]))return!1;return!0}function V(n,e,t){var r=Ce(n),o=r.length;if(Ce(e).length!==o)return!1;for(var s,i,c;o-- >0;)if(s=r[o],!be(n,e,t,s)||(i=Me(n,s),c=Me(e,s),(i||c)&&(!i||!c||i.configurable!==c.configurable||i.enumerable!==c.enumerable||i.writable!==c.writable)))return!1;return!0}function xt(n,e){return x(n.valueOf(),e.valueOf())}function It(n,e){return n.source===e.source&&n.flags===e.flags}function Se(n,e,t){var r=n.size;if(r!==e.size)return!1;if(!r)return!0;for(var o=new Array(r),s=n.values(),i,c;(i=s.next())&&!i.done;){for(var a=e.values(),d=!1,f=0;(c=a.next())&&!c.done;){if(!o[f]&&t.equals(i.value,c.value,i.value,c.value,n,e,t)){d=o[f]=!0;break}f++}if(!d)return!1}return!0}function Bt(n,e){var t=n.length;if(e.length!==t)return!1;for(;t-- >0;)if(n[t]!==e[t])return!1;return!0}function Nt(n,e){return n.hostname===e.hostname&&n.pathname===e.pathname&&n.protocol===e.protocol&&n.port===e.port&&n.hash===e.hash&&n.username===e.username&&n.password===e.password}function be(n,e,t,r){return(r===bt||r===St||r===Pt)&&(n.$$typeof||e.$$typeof)?!0:Ot(e,r)&&t.equals(n[r],e[r],r,r,n,e,t)}var $t="[object Arguments]",Dt="[object Boolean]",Vt="[object Date]",Ut="[object Error]",Zt="[object Map]",Gt="[object Number]",Ft="[object Object]",zt="[object RegExp]",Wt="[object Set]",Ht="[object String]",Kt="[object URL]",Yt=Array.isArray,Ae=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,qe=Object.assign,Jt=Object.prototype.toString.call.bind(Object.prototype.toString);function Xt(n){var e=n.areArraysEqual,t=n.areDatesEqual,r=n.areErrorsEqual,o=n.areFunctionsEqual,s=n.areMapsEqual,i=n.areNumbersEqual,c=n.areObjectsEqual,a=n.arePrimitiveWrappersEqual,d=n.areRegExpsEqual,f=n.areSetsEqual,u=n.areTypedArraysEqual,m=n.areUrlsEqual;return function(h,p,y){if(h===p)return!0;if(h==null||p==null)return!1;var v=typeof h;if(v!==typeof p)return!1;if(v!=="object")return v==="number"?i(h,p,y):v==="function"?o(h,p,y):!1;var w=h.constructor;if(w!==p.constructor)return!1;if(w===Object)return c(h,p,y);if(Yt(h))return e(h,p,y);if(Ae!=null&&Ae(h))return u(h,p,y);if(w===Date)return t(h,p,y);if(w===RegExp)return d(h,p,y);if(w===Map)return s(h,p,y);if(w===Set)return f(h,p,y);var E=Jt(h);return E===Vt?t(h,p,y):E===zt?d(h,p,y):E===Zt?s(h,p,y):E===Wt?f(h,p,y):E===Ft?typeof h.then!="function"&&typeof p.then!="function"&&c(h,p,y):E===Kt?m(h,p,y):E===Ut?r(h,p,y):E===$t?c(h,p,y):E===Dt||E===Gt||E===Ht?a(h,p,y):!1}}function Qt(n){var e=n.circular,t=n.createCustomConfig,r=n.strict,o={areArraysEqual:r?V:At,areDatesEqual:qt,areErrorsEqual:Tt,areFunctionsEqual:Lt,areMapsEqual:r?ke(Pe,V):Pe,areNumbersEqual:Rt,areObjectsEqual:r?V:jt,arePrimitiveWrappersEqual:xt,areRegExpsEqual:It,areSetsEqual:r?ke(Se,V):Se,areTypedArraysEqual:r?V:Bt,areUrlsEqual:Nt};if(t&&(o=qe({},o,t(o))),e){var s=W(o.areArraysEqual),i=W(o.areMapsEqual),c=W(o.areObjectsEqual),a=W(o.areSetsEqual);o=qe({},o,{areArraysEqual:s,areMapsEqual:i,areObjectsEqual:c,areSetsEqual:a})}return o}function er(n){return function(e,t,r,o,s,i,c){return n(e,t,c)}}function tr(n){var e=n.circular,t=n.comparator,r=n.createState,o=n.equals,s=n.strict;if(r)return function(a,d){var f=r(),u=f.cache,m=u===void 0?e?new WeakMap:void 0:u,g=f.meta;return t(a,d,{cache:m,equals:o,meta:g,strict:s})};if(e)return function(a,d){return t(a,d,{cache:new WeakMap,equals:o,meta:void 0,strict:s})};var i={cache:void 0,equals:o,meta:void 0,strict:s};return function(a,d){return t(a,d,i)}}var H=A();A({strict:!0}),A({circular:!0}),A({circular:!0,strict:!0}),A({createInternalComparator:function(){return x}}),A({strict:!0,createInternalComparator:function(){return x}}),A({circular:!0,createInternalComparator:function(){return x}}),A({circular:!0,createInternalComparator:function(){return x},strict:!0});function A(n){n===void 0&&(n={});var e=n.circular,t=e===void 0?!1:e,r=n.createInternalComparator,o=n.createState,s=n.strict,i=s===void 0?!1:s,c=Qt(n),a=Xt(c),d=r?r(a):er(a);return tr({circular:t,comparator:a,createState:o,equals:d,strict:i})}const Te=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],ne=1,U=8;class oe{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 o=r>>4;if(o!==ne)throw new Error(`Got v${o} data when expected v${ne}.`);const s=Te[r&15];if(!s)throw new Error("Unrecognized array type.");const[i]=new Uint16Array(e,2,1),[c]=new Uint32Array(e,4,1);return new oe(c,i,s,e)}constructor(e,t=64,r=Float64Array,o){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 s=Te.indexOf(this.ArrayType),i=e*2*this.ArrayType.BYTES_PER_ELEMENT,c=e*this.IndexArrayType.BYTES_PER_ELEMENT,a=(8-c%8)%8;if(s<0)throw new Error(`Unexpected typed array class: ${r}.`);o&&o instanceof ArrayBuffer?(this.data=o,this.ids=new this.IndexArrayType(this.data,U,e),this.coords=new this.ArrayType(this.data,U+c+a,e*2),this._pos=e*2,this._finished=!0):(this.data=new ArrayBuffer(U+i+c+a),this.ids=new this.IndexArrayType(this.data,U,e),this.coords=new this.ArrayType(this.data,U+c+a,e*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(ne<<4)+s]),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 se(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,t,r,o){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:s,coords:i,nodeSize:c}=this,a=[0,s.length-1,0],d=[];for(;a.length;){const f=a.pop()||0,u=a.pop()||0,m=a.pop()||0;if(u-m<=c){for(let y=m;y<=u;y++){const v=i[2*y],w=i[2*y+1];v>=e&&v<=r&&w>=t&&w<=o&&d.push(s[y])}continue}const g=m+u>>1,h=i[2*g],p=i[2*g+1];h>=e&&h<=r&&p>=t&&p<=o&&d.push(s[g]),(f===0?e<=h:t<=p)&&(a.push(m),a.push(g-1),a.push(1-f)),(f===0?r>=h:o>=p)&&(a.push(g+1),a.push(u),a.push(1-f))}return d}within(e,t,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:o,coords:s,nodeSize:i}=this,c=[0,o.length-1,0],a=[],d=r*r;for(;c.length;){const f=c.pop()||0,u=c.pop()||0,m=c.pop()||0;if(u-m<=i){for(let y=m;y<=u;y++)Re(s[2*y],s[2*y+1],e,t)<=d&&a.push(o[y]);continue}const g=m+u>>1,h=s[2*g],p=s[2*g+1];Re(h,p,e,t)<=d&&a.push(o[g]),(f===0?e-r<=h:t-r<=p)&&(c.push(m),c.push(g-1),c.push(1-f)),(f===0?e+r>=h:t+r>=p)&&(c.push(g+1),c.push(u),c.push(1-f))}return a}}function se(n,e,t,r,o,s){if(o-r<=t)return;const i=r+o>>1;Le(n,e,i,r,o,s),se(n,e,t,r,i-1,1-s),se(n,e,t,i+1,o,1-s)}function Le(n,e,t,r,o,s){for(;o>r;){if(o-r>600){const d=o-r+1,f=t-r+1,u=Math.log(d),m=.5*Math.exp(2*u/3),g=.5*Math.sqrt(u*m*(d-m)/d)*(f-d/2<0?-1:1),h=Math.max(r,Math.floor(t-f*m/d+g)),p=Math.min(o,Math.floor(t+(d-f)*m/d+g));Le(n,e,t,h,p,s)}const i=e[2*t+s];let c=r,a=o;for(Z(n,e,r,t),e[2*o+s]>i&&Z(n,e,r,o);c<a;){for(Z(n,e,c,a),c++,a--;e[2*c+s]<i;)c++;for(;e[2*a+s]>i;)a--}e[2*r+s]===i?Z(n,e,r,a):(a++,Z(n,e,a,o)),a<=t&&(r=a+1),t<=a&&(o=a-1)}}function Z(n,e,t,r){ae(n,t,r),ae(e,2*t,2*r),ae(e,2*t+1,2*r+1)}function ae(n,e,t){const r=n[e];n[e]=n[t],n[t]=r}function Re(n,e,t,r){const o=n-t,s=e-r;return o*o+s*s}const rr={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:n=>n},je=Math.fround||(n=>e=>(n[0]=+e,n[0]))(new Float32Array(1)),I=2,q=3,ie=4,T=5,xe=6;class Ie{constructor(e){this.options=Object.assign(Object.create(rr),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:o}=this.options;t&&console.time("total time");const s=`prepare ${e.length} points`;t&&console.time(s),this.points=e;const i=[];for(let a=0;a<e.length;a++){const d=e[a];if(!d.geometry)continue;const[f,u]=d.geometry.coordinates,m=je(K(f)),g=je(Y(u));i.push(m,g,1/0,a,-1,1),this.options.reduce&&i.push(0)}let c=this.trees[o+1]=this._createTree(i);t&&console.timeEnd(s);for(let a=o;a>=r;a--){const d=+Date.now();c=this.trees[a]=this._createTree(this._cluster(c,a)),t&&console.log("z%d: %d clusters in %dms",a,c.numItems,+Date.now()-d)}return t&&console.timeEnd("total time"),this}getClusters(e,t){let r=((e[0]+180)%360+360)%360-180;const o=Math.max(-90,Math.min(90,e[1]));let s=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,s=180;else if(r>s){const u=this.getClusters([r,o,180,i],t),m=this.getClusters([-180,o,s,i],t);return u.concat(m)}const c=this.trees[this._limitZoom(t)],a=c.range(K(r),Y(i),K(s),Y(o)),d=c.data,f=[];for(const u of a){const m=this.stride*u;f.push(d[m+T]>1?Be(d,m,this.clusterProps):this.points[d[m+q]])}return f}getChildren(e){const t=this._getOriginId(e),r=this._getOriginZoom(e),o="No cluster with the specified id.",s=this.trees[r];if(!s)throw new Error(o);const i=s.data;if(t*this.stride>=i.length)throw new Error(o);const c=this.options.radius/(this.options.extent*Math.pow(2,r-1)),a=i[t*this.stride],d=i[t*this.stride+1],f=s.within(a,d,c),u=[];for(const m of f){const g=m*this.stride;i[g+ie]===e&&u.push(i[g+T]>1?Be(i,g,this.clusterProps):this.points[i[g+q]])}if(u.length===0)throw new Error(o);return u}getLeaves(e,t,r){t=t||10,r=r||0;const o=[];return this._appendLeaves(o,e,t,r,0),o}getTile(e,t,r){const o=this.trees[this._limitZoom(e)],s=Math.pow(2,e),{extent:i,radius:c}=this.options,a=c/i,d=(r-a)/s,f=(r+1+a)/s,u={features:[]};return this._addTileFeatures(o.range((t-a)/s,d,(t+1+a)/s,f),o.data,t,r,s,u),t===0&&this._addTileFeatures(o.range(1-a/s,d,1,f),o.data,s,r,s,u),t===s-1&&this._addTileFeatures(o.range(0,d,a/s,f),o.data,-1,r,s,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,o,s){const i=this.getChildren(t);for(const c of i){const a=c.properties;if(a&&a.cluster?s+a.point_count<=o?s+=a.point_count:s=this._appendLeaves(e,a.cluster_id,r,o,s):s<o?s++:e.push(c),e.length===r)break}return s}_createTree(e){const t=new oe(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,o,s,i){for(const c of e){const a=c*this.stride,d=t[a+T]>1;let f,u,m;if(d)f=Ne(t,a,this.clusterProps),u=t[a],m=t[a+1];else{const p=this.points[t[a+q]];f=p.properties;const[y,v]=p.geometry.coordinates;u=K(y),m=Y(v)}const g={type:1,geometry:[[Math.round(this.options.extent*(u*s-r)),Math.round(this.options.extent*(m*s-o))]],tags:f};let h;d||this.options.generateId?h=t[a+q]:h=this.points[t[a+q]].id,h!==void 0&&(g.id=h),i.features.push(g)}}_limitZoom(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}_cluster(e,t){const{radius:r,extent:o,reduce:s,minPoints:i}=this.options,c=r/(o*Math.pow(2,t)),a=e.data,d=[],f=this.stride;for(let u=0;u<a.length;u+=f){if(a[u+I]<=t)continue;a[u+I]=t;const m=a[u],g=a[u+1],h=e.within(a[u],a[u+1],c),p=a[u+T];let y=p;for(const v of h){const w=v*f;a[w+I]>t&&(y+=a[w+T])}if(y>p&&y>=i){let v=m*p,w=g*p,E,R=-1;const O=((u/f|0)<<5)+(t+1)+this.points.length;for(const S of h){const C=S*f;if(a[C+I]<=t)continue;a[C+I]=t;const j=a[C+T];v+=a[C]*j,w+=a[C+1]*j,a[C+ie]=O,s&&(E||(E=this._map(a,u,!0),R=this.clusterProps.length,this.clusterProps.push(E)),s(E,this._map(a,C)))}a[u+ie]=O,d.push(v/y,w/y,1/0,O,-1,y),s&&d.push(R)}else{for(let v=0;v<f;v++)d.push(a[u+v]);if(y>1)for(const v of h){const w=v*f;if(!(a[w+I]<=t)){a[w+I]=t;for(let E=0;E<f;E++)d.push(a[w+E])}}}}return d}_getOriginId(e){return e-this.points.length>>5}_getOriginZoom(e){return(e-this.points.length)%32}_map(e,t,r){if(e[t+T]>1){const i=this.clusterProps[e[t+xe]];return r?Object.assign({},i):i}const o=this.points[e[t+q]].properties,s=this.options.map(o);return r&&s===o?Object.assign({},s):s}}function Be(n,e,t){return{type:"Feature",id:n[e+q],properties:Ne(n,e,t),geometry:{type:"Point",coordinates:[nr(n[e]),or(n[e+1])]}}}function Ne(n,e,t){const r=n[e+T],o=r>=1e4?`${Math.round(r/1e3)}k`:r>=1e3?`${Math.round(r/100)/10}k`:r,s=n[e+xe],i=s===-1?{}:Object.assign({},t[s]);return Object.assign(i,{cluster:!0,cluster_id:n[e+q],point_count:r,point_count_abbreviated:o})}function K(n){return n/360+.5}function Y(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 nr(n){return(n-.5)*360}function or(n){const e=(180-n*360)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}function le(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 o=0,r=Object.getOwnPropertySymbols(n);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(n,r[o])&&(t[r[o]]=n[r[o]]);return t}typeof SuppressedError=="function"&&SuppressedError;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(Number.isFinite(e.position.lat)&&Number.isFinite(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 G{constructor({markers:e,position:t}){this.markers=[],e&&(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}}function P(n,e="assertion failed"){if(n==null)throw Error(e)}const sr=(n,e,t,r)=>{const o=n.getBounds();P(o);const s=$e(o,e,r);return t.filter(i=>s.contains(k.getPosition(i)))},$e=(n,e,t)=>{const{northEast:r,southWest:o}=ir(n,e),s=lr({northEast:r,southWest:o},t);return cr(s,e)},ar=(n,e,t)=>{const r=$e(n,e,t),o=r.getNorthEast(),s=r.getSouthWest();return[s.lng(),s.lat(),o.lng(),o.lat()]},ir=(n,e)=>{const t=e.fromLatLngToDivPixel(n.getNorthEast()),r=e.fromLatLngToDivPixel(n.getSouthWest());return P(t),P(r),{northEast:t,southWest:r}},lr=({northEast:n,southWest:e},t)=>(n.x+=t,n.y-=t,e.x-=t,e.y+=t,{northEast:n,southWest:e}),cr=({northEast:n,southWest:e},t)=>{const r=t.fromDivPixelToLatLng(e),o=t.fromDivPixelToLatLng(n);return new google.maps.LatLngBounds(r,o)};class De{constructor({maxZoom:e=16}){this.maxZoom=e}noop({markers:e}){return dr(e)}}class ur extends De{constructor(e){var{viewportPadding:t=60}=e,r=le(e,["viewportPadding"]);super(r),this.viewportPadding=60,this.viewportPadding=t}calculate({markers:e,map:t,mapCanvasProjection:r}){const o=t.getZoom();return P(o),o>=this.maxZoom?{clusters:this.noop({markers:e}),changed:!1}:{clusters:this.cluster({markers:sr(t,r,e,this.viewportPadding),map:t,mapCanvasProjection:r})}}}const dr=n=>n.map(t=>new G({position:k.getPosition(t),markers:[t]}));class pr extends De{constructor(e){var{maxZoom:t,radius:r=60}=e,o=le(e,["maxZoom","radius"]);super({maxZoom:t}),this.markers=[],this.clusters=[],this.state={zoom:-1},this.superCluster=new Ie(Object.assign({maxZoom:this.maxZoom,radius:r},o))}calculate(e){let t=!1,r=e.map.getZoom();P(r),r=Math.round(r);const o={zoom:r};if(!H(e.markers,this.markers)){t=!0,this.markers=[...e.markers];const s=this.markers.map(i=>{const c=k.getPosition(i);return{type:"Feature",geometry:{type:"Point",coordinates:[c.lng(),c.lat()]},properties:{marker:i}}});this.superCluster.load(s)}return t||(this.state.zoom<=this.maxZoom||o.zoom<=this.maxZoom)&&(t=!H(this.state,o)),this.state=o,e.markers.length===0?(this.clusters=[],{clusters:this.clusters,changed:t}):(t&&(this.clusters=this.cluster(e)),{clusters:this.clusters,changed:t})}cluster({map:e}){const t=e.getZoom();return P(t),this.superCluster.getClusters([-180,-90,180,90],Math.round(t)).map(r=>this.transformCluster(r))}transformCluster({geometry:{coordinates:[e,t]},properties:r}){if(r.cluster)return new G({markers:this.superCluster.getLeaves(r.cluster_id,1/0).map(s=>s.properties.marker),position:{lat:t,lng:e}});const o=r.marker;return new G({markers:[o],position:k.getPosition(o)})}}class fr extends ur{constructor(e){var{maxZoom:t,radius:r=60,viewportPadding:o=60}=e,s=le(e,["maxZoom","radius","viewportPadding"]);super({maxZoom:t,viewportPadding:o}),this.markers=[],this.clusters=[],this.superCluster=new Ie(Object.assign({maxZoom:this.maxZoom,radius:r},s)),this.state={zoom:-1,view:[0,0,0,0]}}calculate(e){const t=this.getViewportState(e);let r=!H(this.state,t);if(!H(e.markers,this.markers)){r=!0,this.markers=[...e.markers];const o=this.markers.map(s=>{const i=k.getPosition(s);return{type:"Feature",geometry:{type:"Point",coordinates:[i.lng(),i.lat()]},properties:{marker:s}}});this.superCluster.load(o)}return r&&(this.clusters=this.cluster(e),this.state=t),{clusters:this.clusters,changed:r}}cluster(e){const t=this.getViewportState(e);return this.superCluster.getClusters(t.view,t.zoom).map(r=>this.transformCluster(r))}transformCluster({geometry:{coordinates:[e,t]},properties:r}){if(r.cluster)return new G({markers:this.superCluster.getLeaves(r.cluster_id,1/0).map(s=>s.properties.marker),position:{lat:t,lng:e}});const o=r.marker;return new G({markers:[o],position:k.getPosition(o)})}getViewportState(e){const t=e.map.getZoom(),r=e.map.getBounds();return P(t),P(r),{zoom:Math.round(t),view:ar(r,e.mapCanvasProjection,this.viewportPadding)}}}class mr{constructor(e,t){this.markers={sum:e.length};const r=t.map(s=>s.count),o=r.reduce((s,i)=>s+i,0);this.clusters={count:t.length,markers:{mean:o/t.length,sum:o,min:Math.min(...r),max:Math.max(...r)}}}}class hr{render({count:e,position:t},r,o){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">
|
|
6
6
|
<circle cx="120" cy="120" opacity=".6" r="70" />
|
|
7
7
|
<circle cx="120" cy="120" opacity=".3" r="90" />
|
|
8
8
|
<circle cx="120" cy="120" opacity=".2" r="110" />
|
|
9
9
|
<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>
|
|
10
|
-
</svg>`,c=`Cluster of ${e} markers`,a=Number(google.maps.Marker.MAX_ZINDEX)+e;if(
|
|
10
|
+
</svg>`,c=`Cluster of ${e} markers`,a=Number(google.maps.Marker.MAX_ZINDEX)+e;if(k.isAdvancedMarkerAvailable(o)){const u=new DOMParser().parseFromString(i,"image/svg+xml").documentElement;u.setAttribute("transform","translate(0 25)");const m={map:o,position:t,zIndex:a,title:c,content:u};return new google.maps.marker.AdvancedMarkerElement(m)}const d={position:t,zIndex:a,title:c,icon:{url:`data:image/svg+xml;base64,${btoa(i)}`,anchor:new google.maps.Point(25,25)}};return new google.maps.Marker(d)}}function gr(n,e){for(let t in e.prototype)n.prototype[t]=e.prototype[t]}class ce{constructor(){gr(ce,google.maps.OverlayView)}}var L;(function(n){n.CLUSTERING_BEGIN="clusteringbegin",n.CLUSTERING_END="clusteringend",n.CLUSTER_CLICK="click",n.GMP_CLICK="gmp-click"})(L||(L={}));const yr=(n,e,t)=>{e.bounds&&t.fitBounds(e.bounds)};class vr extends ce{constructor({map:e,markers:t=[],algorithmOptions:r={},algorithm:o=new pr(r),renderer:s=new hr,onClusterClick:i=yr}){super(),this.map=null,this.idleListener=null,this.markers=[...t],this.clusters=[],this.algorithm=o,this.renderer=s,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:(k.setMap(e,null),this.markers.splice(r,1),t||this.render(),!0)}removeMarkers(e,t){let r=!1;return e.forEach(o=>{r=this.removeMarker(o,!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,L.CLUSTERING_BEGIN,this);const{clusters:t,changed:r}=this.algorithm.calculate({markers:this.markers,map:e,mapCanvasProjection:this.getProjection()});if(r||r==null){const o=new Set;for(const i of t)i.markers.length==1&&o.add(i.markers[0]);const s=[];for(const i of this.clusters)i.marker!=null&&(i.markers.length==1?o.has(i.marker)||k.setMap(i.marker,null):s.push(i.marker));this.clusters=t,this.renderClusters(),requestAnimationFrame(()=>s.forEach(i=>k.setMap(i,null)))}google.maps.event.trigger(this,L.CLUSTERING_END,this)}}onAdd(){const e=this.getMap();P(e),this.idleListener=e.addListener("idle",this.render.bind(this)),this.render()}onRemove(){this.idleListener&&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 mr(this.markers,this.clusters),t=this.getMap();this.clusters.forEach(r=>{if(r.markers.length===1)r.marker=r.markers[0];else if(r.marker=this.renderer.render(r,e,t),r.markers.forEach(o=>k.setMap(o,null)),this.onClusterClick){const o=k.isAdvancedMarker(r.marker)?L.GMP_CLICK:L.CLUSTER_CLICK;r.marker.addListener(o,s=>{google.maps.event.trigger(this,L.CLUSTER_CLICK,r),this.onClusterClick(s,r,t)})}k.setMap(r.marker,t)})}}const Ve=Object.values(L),wr=l.defineComponent({name:"MarkerCluster",props:{options:{type:Object,default:()=>({})}},emits:Ve,setup(n,{emit:e,expose:t,slots:r}){const o=l.ref(),s=l.inject(M,l.ref()),i=l.inject(b,l.ref());return l.provide(Q,o),l.watch(s,()=>{s.value&&(o.value=l.markRaw(new vr({map:s.value,algorithm:new fr(n.options.algorithmOptions??{}),...n.options})),Ve.forEach(c=>{var a;(a=o.value)==null||a.addListener(c,d=>e(c,d))}))},{immediate:!0}),l.onBeforeUnmount(()=>{var c;o.value&&((c=i.value)==null||c.event.clearInstanceListeners(o.value),o.value.clearMarkers(),o.value.setMap(null))}),t({markerCluster:o}),()=>{var c;return(c=r.default)==null?void 0:c.call(r)}}}),_r=l.defineComponent({inheritAttrs:!1,props:{options:{type:Object,required:!0}},setup(n,{slots:e,emit:t,expose:r}){const o=l.ref(),s=l.computed(()=>{var a;return(a=e.default)==null?void 0:a.call(e).some(d=>d.type!==l.Comment)}),i=l.computed(()=>({...n.options,element:o.value})),c=N(z,[],i,t);return r({customMarker:c}),{customMarkerRef:o,customMarker:c,hasSlotContent:s}}}),Tr="",Er={key:0,class:"custom-marker-wrapper"};function kr(n,e,t,r,o,s){return n.hasSlotContent?(l.openBlock(),l.createElementBlock("div",Er,[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("v-if",!0)}const Cr=$(_r,[["render",kr],["__scopeId","data-v-4b2eafc1"]]),Mr=l.defineComponent({name:"HeatmapLayer",props:{options:{type:Object,default:()=>({})}},setup(n){const e=l.ref(),t=l.inject(M,l.ref()),r=l.inject(b,l.ref());return l.watch([t,()=>n.options],([o,s],[i,c])=>{const a=!D(s,c)||t.value!==i;if(t.value&&r.value&&a){let d;if(s.data&&!(s.data instanceof r.value.MVCArray)){const f=r.value.LatLng,u=s.data.map(m=>m instanceof f||"location"in m&&(m.location instanceof f||m.location===null)?m:"location"in m?{...m,location:new f(m.location)}:new f(m));d={...s,data:u}}else d=s;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});_.AdvancedMarker=lt,_.Circle=ft,_.CustomControl=yt,_.CustomMarker=Cr,_.GoogleMap=rt,_.HeatmapLayer=Mr,_.InfoWindow=Et,_.Marker=ct,_.MarkerCluster=wr,_.Polygon=dt,_.Polyline=ut,_.Rectangle=pt,_.apiSymbol=b,_.mapSymbol=M,_.mapTilesLoadedSymbol=ee,Object.defineProperty(_,Symbol.toStringTag,{value:"Module"})});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PropType } from "vue";
|
|
2
|
-
import { Library } from "@googlemaps/js-api-loader";
|
|
3
2
|
import { IControlPosition } from "../@types/index";
|
|
3
|
+
export declare const __resetOptionsFlag: () => void;
|
|
4
4
|
export declare const mapEvents: string[];
|
|
5
5
|
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
6
6
|
apiPromise: {
|
|
@@ -15,7 +15,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
15
15
|
default: string;
|
|
16
16
|
};
|
|
17
17
|
libraries: {
|
|
18
|
-
type: PropType<
|
|
18
|
+
type: PropType<string[]>;
|
|
19
19
|
default: () => string[];
|
|
20
20
|
};
|
|
21
21
|
region: {
|
|
@@ -209,10 +209,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
209
209
|
type: PropType<IControlPosition>;
|
|
210
210
|
required: false;
|
|
211
211
|
};
|
|
212
|
-
nonce: {
|
|
213
|
-
type: StringConstructor;
|
|
214
|
-
default: string;
|
|
215
|
-
};
|
|
216
212
|
}>, {
|
|
217
213
|
mapRef: import("vue").Ref<HTMLElement | undefined, HTMLElement | undefined>;
|
|
218
214
|
ready: import("vue").Ref<boolean, boolean>;
|
|
@@ -232,7 +228,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
232
228
|
default: string;
|
|
233
229
|
};
|
|
234
230
|
libraries: {
|
|
235
|
-
type: PropType<
|
|
231
|
+
type: PropType<string[]>;
|
|
236
232
|
default: () => string[];
|
|
237
233
|
};
|
|
238
234
|
region: {
|
|
@@ -426,16 +422,12 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
426
422
|
type: PropType<IControlPosition>;
|
|
427
423
|
required: false;
|
|
428
424
|
};
|
|
429
|
-
nonce: {
|
|
430
|
-
type: StringConstructor;
|
|
431
|
-
default: string;
|
|
432
|
-
};
|
|
433
425
|
}>> & Readonly<{
|
|
434
426
|
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
435
427
|
}>, {
|
|
436
428
|
apiKey: string;
|
|
437
429
|
version: string;
|
|
438
|
-
libraries:
|
|
430
|
+
libraries: string[];
|
|
439
431
|
center: google.maps.LatLng | google.maps.LatLngLiteral;
|
|
440
432
|
clickableIcons: boolean;
|
|
441
433
|
disableDefaultUi: boolean;
|
|
@@ -453,6 +445,5 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
453
445
|
streetViewControl: boolean;
|
|
454
446
|
zoomControl: boolean;
|
|
455
447
|
cameraControl: boolean;
|
|
456
|
-
nonce: string;
|
|
457
448
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
458
449
|
export default _default;
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vue3-google-map",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.25.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
|
-
"url": "https://github.com/inocan-group/vue3-google-
|
|
7
|
+
"url": "https://github.com/inocan-group/vue3-google-map.git"
|
|
8
8
|
},
|
|
9
9
|
"homepage": "https://vue3-google-map.com",
|
|
10
10
|
"description": "A set of composable components for easy use of Google Maps in your Vue 3 projects.",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"test:coverage": "jest --coverage"
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
|
-
"@googlemaps/js-api-loader": "^
|
|
58
|
+
"@googlemaps/js-api-loader": "^2.0.1",
|
|
59
59
|
"@googlemaps/markerclusterer": "^2.4.0",
|
|
60
60
|
"fast-deep-equal": "^3.1.3"
|
|
61
61
|
},
|