vendor: 4,238 bytes, line 1
1import{f as Ae,o as Me,G as Y,i as be,j as ve,v as Ce}from"./vue.esm-bundler-BrBtCA53.js";import{ensureGoogleMaps as ke}from"./googleMaps-Brvcrwmz.js";const{getOwnPropertyNames:Te,getOwnPropertySymbols:xe}=Object,{hasOwnProperty:Oe}=Object.prototype;function H(n,e){return function(r,s,i){return n(r,s,i)&&e(r,s,i)}}function G(n){return function(t,r,s){if(!t||!r||typeof t!="object"||typeof r!="object")return n(t,r,s);const{cache:i}=s,a=i.get(t),l=i.get(r);if(a&&l)return a===r&&l===t;i.set(t,r),i.set(r,t);const o=n(t,r,s);return i.delete(t),i.delete(r),o}}function Le(n){return n!=null?n[Symbol.toStringTag]:void 0}function oe(n){return Te(n).concat(xe(n))}const Ie=Object.hasOwn||((n,e)=>Oe.call(n,e));function B(n,e){return n===e||!n&&!e&&n!==n&&e!==e}const Se="__v",Pe="__o",je="_owner",{getOwnPropertyDescriptor:ie,keys:ae}=Object;function Re(n,e){return n.byteLength===e.byteLength&&V(new Uint8Array(n),new Uint8Array(e))}function Ne(n,e,t){let 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 Be(n,e){return n.byteLength===e.byteLength&&V(new Uint8Array(n.buffer,n.byteOffset,n.byteLength),new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}function Ue(n,e){return B(n.getTime(),e.getTime())}function qe(n,e){return n.name===e.name&&n.message===e.message&&n.cause===e.cause&&n.stack===e.stack}function Fe(n,e){return n===e}function le(n,e,t){const r=n.size;if(r!==e.size)return!1;if(!r)return!0;const s=new Array(r),i=n.entries();let a,l,o=0;for(;(a=i.next())&&!a.done;){const f=e.entries();let u=!1,c=0;for(;(l=f.next())&&!l.done;){if(s[c]){c++;continue}const m=a.value,y=l.value;if(t.equals(m[0],y[0],o,c,n,e,t)&&t.equals(m[1],y[1],m[0],y[0],n,e,t)){u=s[c]=!0;break}c++}if(!u)return!1;o++}return!0}const Ze=B;function De(n,e,t){const r=ae(n);let s=r.length;if(ae(e).length!==s)return!1;for(;s-- >0;)if(!ge(n,e,t,r[s]))return!1;return!0}function U(n,e,t){const r=oe(n);let s=r.length;if(oe(e).length!==s)return!1;let i,a,l;for(;s-- >0;)if(i=r[s],!ge(n,e,t,i)||(a=ie(n,i),l=ie(e,i),(a||l)&&(!a||!l||a.configurable!==l.configurable||a.enumerable!==l.enumerable||a.writable!==l.writable)))return!1;return!0}function Ge(n,e){return B(n.valueOf(),e.valueOf())}function $e(n,e){return n.source===e.source&&n.flags===e.flags}function ce(n,e,t){const r=n.size;if(r!==e.size)return!1;if(!r)return!0;const s=new Array(r),i=n.values();let a,l;for(;(a=i.next())&&!a.done;){const o=e.values();let f=!1,u=0;for(;(l=o.next())&&!l.done;){if(!s[u]&&t.equals(a.value,l.value,a.value,l.value,n,e,t)){f=s[u]=!0;break}u++}if(!f)return!1}return!0}function V(n,e){let t=n.byteLength;if(e.byteLength!==t||n.byteOffset!==e.byteOffset)return!1;for(;t-- >0;)if(n[t]!==e[t])return!1;return!0}function ze(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 ge(n,e,t,r){return(r===je||r===Pe||r===Se)&&(n.$$typeof||e.$$typeof)?!0:Ie(e,r)&&t.equals(n[r],e[r],r,r,n,e,t)}const Ve="[object ArrayBuffer]",We="[object Arguments]",Ke="[object Boolean]",Ye="[object DataView]",He="[object Date]",Je="[object Error]",Qe="[object Map]",Xe="[object Number]",et="[object Object]",tt="[object RegExp]",rt="[object Set]",nt="[object String]",st={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},ot="[object URL]",it=Object.prototype.toString;function at({areArrayBuffersEqual:n,areArraysEqual:e,areDataViewsEqual:t,areDatesEqual:r,areErrorsEqual:s,areFunctionsEqual:i,areMapsEqual:a,areNumbersEqual:l,areObjectsEqual:o,arePrimitiveWrappersEqual:f,areRegExpsEqual:u,areSetsEqual:c,areTypedArraysEqual:m,areUrlsEqual:y,unknownTagComparators:w}){return function(d,h,g){if(d===h)return!0;if(d==null||h==null)return!1;const v=typeof d;if(v!==typeof h)return!1;if(v!=="object")return v==="number"?l(d,h,g):v==="function"?i(d,h,g):!1;const x=d.constructor;if(x!==h.constructor)return!1;if(x===Object)return o(d,h,g);
1if(Array.isArray(d))return e(d,h,g);if(x===Date)return r(d,h,g);if(x===RegExp)return u(d,h,g);if(x===Map)return a(d,h,g);if(x===Set)return c(d,h,g);const M=it.call(d);if(M===He)return r(d,h,g);if(M===tt)return u(d,h,g);if(M===Qe)return a(d,h,g);if(M===rt)return c(d,h,g);if(M===et)return typeof d.then!="function"&&typeof h.then!="function"&&o(d,h,g);if(M===ot)return y(d,h,g);if(M===Je)return s(d,h,g);if(M===We)return o(d,h,g);if(st[M])return m(d,h,g);if(M===Ve)return n(d,h,g);if(M===Ye)return t(d,h,g);if(M===Ke||M===Xe||M===nt)return f(d,h,g);if(w){let I=w[M];if(!I){const k=Le(d);k&&(I=w[k])}if(I)return I(d,h,g)}return!1}}function lt({circular:n,createCustomConfig:e,strict:t}){let r={areArrayBuffersEqual:Re,areArraysEqual:t?U:Ne,areDataViewsEqual:Be,areDatesEqual:Ue,areErrorsEqual:qe,areFunctionsEqual:Fe,areMapsEqual:t?H(le,U):le,areNumbersEqual:Ze,areObjectsEqual:t?U:De,arePrimitiveWrappersEqual:Ge,areRegExpsEqual:$e,areSetsEqual:t?H(ce,U):ce,areTypedArraysEqual:t?H(V,U):V,areUrlsEqual:ze,unknownTagComparators:void 0};if(e&&(r=Object.assign({},r,e(r))),n){const s=G(r.areArraysEqual),i=G(r.areMapsEqual),a=G(r.areObjectsEqual),l=G(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:s,areMapsEqual:i,areObjectsEqual:a,areSetsEqual:l})}return r}function ct(n){return function(e,t,r,s,i,a,l){return n(e,t,l)}}function ut({circular:n,comparator:e,createState:t,equals:r,strict:s}){if(t)return function(l,o){const{cache:f=n?new WeakMap:void 0,meta:u}=t();return e(l,o,{cache:f,equals:r,meta:u,strict:s})};if(n)return function(l,o){return e(l,o,{cache:new WeakMap,equals:r,meta:void 0,strict:s})};const i={cache:void 0,equals:r,meta:void 0,strict:s};return function(l,o){return e(l,o,i)}}const ue=j();j({strict:!0});j({circular:!0});j({circular:!0,strict:!0});j({createInternalComparator:()=>B});j({strict:!0,createInternalComparator:()=>B});j({circular:!0,createInternalComparator:()=>B});j({circular:!0,createInternalComparator:()=>B,strict:!0});function j(n={}){const{circular:e=!1,createInternalComparator:t,createState:r,strict:s=!1}=n,i=lt(n),a=at(i),l=t?t(a):ct(a);return ut({circular:e,comparator:a,createState:r,equals:l,strict:s})}const fe=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],J=1,q=8,_=new Uint32Array(96);class ne{static from(e){if(!e||e.byteLength===void 0||e.buffer)throw new Error("Data must be an instance of ArrayBuffer or SharedArrayBuffer.");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!==J)throw new Error(`Got v${s} data when expected v${J}.`);const i=fe[r&15];if(!i)throw new Error("Unrecognized array type.");const[a]=new Uint16Array(e,2,1),[l]=new Uint32Array(e,4,1);return new ne(l,a,i,void 0,e)}constructor(e,t=64,r=Float64Array,s=ArrayBuffer,i){if(isNaN(e)||e<0)throw new Error(`Unexpected 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 a=fe.indexOf(this.ArrayType),l=e*2*this.ArrayType.BYTES_PER_ELEMENT,o=e*this.IndexArrayType.BYTES_PER_ELEMENT,f=(8-o%8)%8;if(a<0)throw new Error(`Unexpected typed array class: ${r}.`);if(i)this.data=i,this.ids=new this.IndexArrayType(i,q,e),this.coords=new r(i,q+o+f,e*2),this._pos=e*2,this._finished=!0;else{const u=this.data=new s(q+l+o+f);this.ids=new this.IndexArrayType(u,q,e),this.coords=new r(u,q+o+f,e*2),this._pos=0,this._finished=!1,new Uint8Array(u,0,2).set([219,(J<<4)+a]),new Uint16Array(u,2,1)[0]=t,new Uint32Array(u,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 ee(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:i,coords:a,nodeSize:l}=this;_[0]=0,_[1]=i.length-1,_[2]=0;let o=3;const f=[];for(;o>0;){const u=_[--o],c=_[--o],m=_[--o];if(c-m<=l){for(let d=m;d<=c;d++){const h=a[2*d],g=a[2*d+1];h>=e&&h<=r&&g>=t&&g<=s&&f.push(i[d])}continue}const y=m+c>>1,w=a[2*y],E=a[2*y+1];w>=e&&w<=r&&E>=t&&E<=s&&f.push(i[y]),(u===0?e<=w:t<=E)&&(_[o++]=m,_[o++]=y-1,_[o++]=1-u),(u===0?r>=w:s>=E)&&(_[o++]=y+1,_[o++]=c,_[o++]=1-u)}return f}within(e,t,r){const s=[];return this.withinInto(e,t,r,s),s}withinInto(e,t,r,s){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:i,coords:a,nodeSize:l}=this;_[0]=0,_[1]=i.length-1,_[2]=0;let o=3,f=0;const u=r*r;for(;o>0;){const c=_[--o],m=_[--o],y=_[--o];if(m-y<=l){for(let h=y;h<=m;h++)he(a[2*h],a[2*h+1],e,t)<=u&&(s[f++]=i[h]);continue}const w=y+m>>1,E=a[2*w],d=a[2*w+1];he(E,d,e,t)<=u&&(s[f++]=i[w]),(c===0?e-r<=E:t-r<=d)&&(_[o++]=y,_[o++]=w-1,_[o++]=1-c),(c===0?e+r>=E:t+r>=d)&&(_[o++]=w+1,_[o++]=m,_[o++]=1-c)}return f}}function ee(n,e,t,r,s,i){if(s-r<=t)return;const a=r+s>>1;ye(n,e,a,r,s,i),ee(n,e,t,r,a-1,1-i),ee(n,e,t,a+1,s,1-i)}function ye(n,e,t,r,s,i){for(;s>r;){if(s-r>600){const f=s-r+1,u=t-r+1,c=Math.log(f),m=.5*Math.exp(2*c/3),y=.5*Math.sqrt(c*m*(f-m)/f)*(u-f/2<0?-1:1),w=Math.max(r,Math.floor(t-u*m/f+y)),E=Math.min(s,Math.floor(t+(f-u)*m/f+y));ye(n,e,t,w,E,i)}const a=e[2*t+i];let l=r,o=s;for(F(n,e,r,t),e[2*s+i]>a&&F(n,e,r,s);l<o;){for(F(n,e,l,o),l++,o--;e[2*l+i]<a;)l++;for(;e[2*o+i]>a;)o--}e[2*r+i]===a?F(n,e,r,o):(o++,F(n,e,o,s)),o<=t&&(r=o+1),t<=o&&(s=o-1)}}function F(n,e,t,r){Q(n,t,r),Q(e,2*t,2*r),Q(e,2*t+1,2*r+1)}function Q(n,e,t){const r=n[e];n[e]=n[t],n[t]=r}function he(n,e,t,r){const s=n-t,i=e-r;return s*s+i*i}const ft={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:n=>n},de=Math.fround||(n=>e=>(n[0]=+e,n[0]))(new Float32Array(1)),R=2,P=3,X=4,S=5,we=6;class ht{constructor(e){this.options=Object.assign(Object.create(ft),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 i=`prepare ${e.length} points`;t&&console.time(i),this.points=e;const a=[];for(let o=0;o<e.length;o++){const f=e[o];if(!f.geometry)continue;const[u,c]=f.geometry.coordinates,m=de($(u)),y=de(z(c));a.push(m,y,1/0,o,-1,1),this.options.reduce&&a.push(0)}let l=this.trees[s+1]=this._createTree(a);t&&console.timeEnd(i);for(let o=s;o>=r;o--){const f=+Date.now();l=this.trees[o]=this._createTree(this._cluster(l,o)),t&&console.log("z%d: %d clusters in %dms",o,l.numItems,+Date.now()-f)}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 i=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,i=180;else if(r>i){const c=this.getClusters([r,s,180,a],t),m=this.getClusters([-180,s,i,a],t);return c.concat(m)}const l=this.trees[this._limitZoom(t)],o=l.range($(r),z(a),$(i),z(s)),f=l.data,u=[];for(const c of o){const m=this.stride*c;u.push(f[m+S]>1?pe(f,m,this.clusterProps):this.points[f[m+P]])}return u}getChildren(e){const t=this._getOriginId(e),r=this._getOriginZoom(e),s="No cluster with the specified id.",i=this.trees[r];if(!i)throw new Error(s);const a=i.data;if(t*this.stride>=a.length)throw new Error(s);const l=this.options.radius/(this.options.extent*Math.pow(2,r-1)),o=a[t*this.stride],f=a[t*this.stride+1],u=i.within(o,f,l),c=[];for(const m of u){const y=m*this.stride;a[y+X]===e&&c.push(a[y+S]>1?pe(a,y,this.clusterProps):this.points[a[y+P]])}if(c.length===0)throw new Error(s);return c}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)],i=Math.pow(2,e),{extent:a,radius:l}=this.options,o=l/a,f=(r-o)/i,u=(r+1+o)/i,c={features:[]};return this._addTileFeatures(s.range((t-o)/i,f,(t+1+o)/i,u),s.data,t,r,i,c),t===0&&this._addTileFeatures(s.range(1-o/i,f,1,u),s.data,i,r,i,c),t===i-1&&this._addTileFeatures(s.range(0,f,o/i,u),s.data,-1,r,i,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,s,i){const a=this.getChildren(t);for(const l of a){const o=l.properties;if(o&&o.cluster?i+o.point_count<=s?i+=o.point_count:i=this._appendLeaves(e,o.cluster_id,r,s,i):i<s?i++:e.push(l),e.length===r)break}return i}_createTree(e){const t=new ne(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,i,a){for(const l of e){const o=l*this.stride,f=t[o+S]>1;let u,c,m;
1if(f)u=Ee(t,o,this.clusterProps),c=t[o],m=t[o+1];else{const E=this.points[t[o+P]];u=E.properties;const[d,h]=E.geometry.coordinates;c=$(d),m=z(h)}const y={type:1,geometry:[[Math.round(this.options.extent*(c*i-r)),Math.round(this.options.extent*(m*i-s))]],tags:u};let w;f||this.options.generateId?w=t[o+P]:w=this.points[t[o+P]].id,w!==void 0&&(y.id=w),a.features.push(y)}}_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:i,minPoints:a}=this.options,l=r/(s*Math.pow(2,t)),o=e.data,f=[],u=this.stride;for(let c=0;c<o.length;c+=u){if(o[c+R]<=t)continue;o[c+R]=t;const m=o[c],y=o[c+1],w=e.within(o[c],o[c+1],l),E=o[c+S];let d=E;for(const h of w){const g=h*u;o[g+R]>t&&(d+=o[g+S])}if(d>E&&d>=a){let h=m*E,g=y*E,v,x=-1;const M=((c/u|0)<<5)+(t+1)+this.points.length;for(const I of w){const k=I*u;if(o[k+R]<=t)continue;o[k+R]=t;const O=o[k+S];h+=o[k]*O,g+=o[k+1]*O,o[k+X]=M,i&&(v||(v=this._map(o,c,!0),x=this.clusterProps.length,this.clusterProps.push(v)),i(v,this._map(o,k)))}o[c+X]=M,f.push(h/d,g/d,1/0,M,-1,d),i&&f.push(x)}else{for(let h=0;h<u;h++)f.push(o[c+h]);if(d>1)for(const h of w){const g=h*u;if(!(o[g+R]<=t)){o[g+R]=t;for(let v=0;v<u;v++)f.push(o[g+v])}}}}return f}_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 a=this.clusterProps[e[t+we]];return r?Object.assign({},a):a}const s=this.points[e[t+P]].properties,i=this.options.map(s);return r&&i===s?Object.assign({},i):i}}function pe(n,e,t){return{type:"Feature",id:n[e+P],properties:Ee(n,e,t),geometry:{type:"Point",coordinates:[dt(n[e]),pt(n[e+1])]}}}function Ee(n,e,t){const r=n[e+S],s=r>=1e4?`${Math.round(r/1e3)}k`:r>=1e3?`${Math.round(r/100)/10}k`:r,i=n[e+we],a=i===-1?{}:Object.assign({},t[i]);return Object.assign(a,{cluster:!0,cluster_id:n[e+P],point_count:r,point_count_abbreviated:s})}function $(n){return n/360+.5}function z(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 dt(n){return(n-.5)*360}function pt(n){const e=(180-n*360)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}function mt(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 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(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 te{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(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}}function re(n,e="assertion failed"){if(n==null)throw Error(e)}class gt{constructor({maxZoom:e=16}){this.maxZoom=e}noop({markers:e}){return yt(e)}}const yt=n=>n.map(t=>new te({position:C.getPosition(t),markers:[t]}));class wt extends gt{constructor(e){var{maxZoom:t,radius:r=60}=e,s=mt(e,["maxZoom","radius"]);super({maxZoom:t}
1),this.markers=[],this.clusters=[],this.state={zoom:-1},this.superCluster=new ht(Object.assign({maxZoom:this.maxZoom,radius:r},s))}calculate(e){let t=!1,r=e.map.getZoom();re(r),r=Math.round(r);const s={zoom:r};if(!ue(e.markers,this.markers)){t=!0,this.markers=[...e.markers];const i=this.markers.map(a=>{const l=C.getPosition(a);return{type:"Feature",geometry:{type:"Point",coordinates:[l.lng(),l.lat()]},properties:{marker:a}}});this.superCluster.load(i)}return t||(this.state.zoom<=this.maxZoom||s.zoom<=this.maxZoom)&&(t=!ue(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 re(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 te({markers:this.superCluster.getLeaves(r.cluster_id,1/0).map(i=>i.properties.marker),position:{lat:t,lng:e}});const s=r.marker;return new te({markers:[s],position:C.getPosition(s)})}}class Et{constructor(e,t){this.markers={sum:e.length};const r=t.map(i=>i.count),s=r.reduce((i,a)=>i+a,0);this.clusters={count:t.length,markers:{mean:s/t.length,sum:s,min:Math.min(...r),max:Math.max(...r)}}}}class _t{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"> 2<circle cx="120" cy="120" opacity=".6" r="70" /> 3<circle cx="120" cy="120" opacity=".3" r="90" /> 4<circle cx="120" cy="120" opacity=".2" r="110" /> 5<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> 6</svg>`,l=`Cluster of ${e} markers`,o=Number(google.maps.Marker.MAX_ZINDEX)+e;if(C.isAdvancedMarkerAvailable(s)){const c=new DOMParser().parseFromString(a,"image/svg+xml").documentElement;c.setAttribute("transform","translate(0 25)");const m={map:s,position:t,zIndex:o,title:l,content:c};return new google.maps.marker.AdvancedMarkerElement(m)}const f={position:t,zIndex:o,title:l,icon:{url:`data:image/svg+xml;base64,${btoa(a)}`,anchor:new google.maps.Point(25,25)}};return new google.maps.Marker(f)}}function At(n,e){for(let t in e.prototype)n.prototype[t]=e.prototype[t]}class se{constructor(){At(se,google.maps.OverlayView)}}var N;(function(n){n.CLUSTERING_BEGIN="clusteringbegin",n.CLUSTERING_END="clusteringend",n.CLUSTER_CLICK="click",n.GMP_CLICK="gmp-click"})(N||(N={}));const Mt=(n,e,t)=>{e.bounds&&t.fitBounds(e.bounds)};class bt extends se{constructor({map:e,markers:t=[],algorithmOptions:r={},algorithm:s=new wt(r),renderer:i=new _t,onClusterClick:a=Mt}){super(),this.map=null,this.idleListener=null,this.markers=[...t],this.clusters=[],this.algorithm=s,this.renderer=i,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:(C.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,N.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 i=[];for(const a of this.clusters)a.marker!=null&&(a.markers.length==1?s.has(a.marker)||C.setMap(a.marker,null):i.push(a.marker));this.clusters=t,this.renderClusters(),requestAnimationFrame(()=>i.forEach(a=>C.setMap(a,null)))}google.maps.event.trigger(this,N.CLUSTERING_END,this)}}onAdd(){const e=this.getMap();re(e),this.idleListener=e.addListener("idle",this.render.bind(this)),this.render()}onRemove(){this.idleListener&&google.maps.event.removeListener(this.idleListener),this.reset()}
6reset(){this.markers.forEach(e=>C.setMap(e,null)),this.clusters.forEach(e=>e.delete()),this.clusters=[]}renderClusters(){const e=new Et(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(s=>C.setMap(s,null)),this.onClusterClick){const s=C.isAdvancedMarker(r.marker)?N.GMP_CLICK:N.CLUSTER_CLICK;r.marker.addListener(s,i=>{google.maps.event.trigger(this,N.CLUSTER_CLICK,r),this.onClusterClick(i,r,t)})}C.setMap(r.marker,t)})}}const me=7,vt={__name:"DirectoryMap",props:{apiKey:{type:String,required:!0},pins:{type:Array,required:!0},userLocation:{type:Object,default:null},userRadius:{type:Number,default:null},directoryPathPrefix:{type:String,default:"/directory"},fitToPins:{type:Boolean,default:!1},bounds:{type:Object,default:null},forceBoundsFit:{type:Boolean,default:!1}},emits:["bounds-change"],setup(n,{emit:e}){const t=n,r=e,s={lat:45.1,lng:-63.1},i=[{elementType:"geometry",stylers:[{color:"#F0ECE5"}]},{elementType:"labels.text.fill",stylers:[{color:"#2E3A36"}]},{elementType:"labels.text.stroke",stylers:[{color:"#F0ECE5"}]},{featureType:"administrative",elementType:"geometry.stroke",stylers:[{color:"#C0C4C3"}]},{featureType:"landscape",elementType:"geometry",stylers:[{color:"#F0ECE5"}]},{featureType:"landscape.natural",elementType:"geometry",stylers:[{color:"#F0ECE5"}]},{featureType:"poi",elementType:"geometry",stylers:[{color:"#E8E1D0"}]},{featureType:"poi.park",elementType:"geometry",stylers:[{color:"#DFE7D3"}]},{featureType:"poi",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"road",elementType:"geometry.fill",stylers:[{color:"#F0ECE5"}]},{featureType:"road",elementType:"geometry.stroke",stylers:[{color:"#2E3A36"},{weight:.6}]},{featureType:"road.highway",elementType:"geometry.stroke",stylers:[{color:"#2E3A36"},{weight:1}]},{featureType:"road.highway",elementType:"labels.icon",stylers:[{visibility:"off"}]},{featureType:"road.local",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"transit",stylers:[{visibility:"off"}]},{featureType:"water",elementType:"geometry",stylers:[{color:"#9CC0E1"}]},{featureType:"water",elementType:"labels.text.fill",stylers:[{color:"#4A7BB0"}]}],a=Ae(null);let l=null,o=null,f=[],u=null,c=null,m=null,y=null,w=!1,E=null,d=!1,h=!1,g=null;function v(p){return String(p??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function x(p){const A=v(p.business_name),b=v(p.region??""),T=v(p.address??"");return` 7 <div class="directory-map__info"> 8 <a class="directory-map__info-title" href="${`${t.directoryPathPrefix}/${encodeURIComponent(p.slug)}`}">${A}</a> 9 ${b?`<div class="directory-map__info-region">${b}</div>`:""} 10 ${T?`<div class="directory-map__info-address">${T}</div>`:""} 11 </div> 12 `}function M(){o&&o.clearMarkers(),f.forEach(p=>p.setMap(null)),f=[]}function I(p){M();const A={path:"M12 0C6.48 0 2 4.48 2 10c0 7.5 10 22 10 22s10-14.5 10-22C22 4.48 17.52 0 12 0zm0 14a4 4 0 1 1 0-8 4 4 0 0 1 0 8z",fillColor:"#002773",fillOpacity:1,strokeColor:"#ffffff",strokeWeight:1.25,scale:1.4,anchor:new p.Point(12,32)};f=t.pins.map(T=>{const[L,W]=T.location??[],K=new p.Marker({position:{lat:Number(L),lng:Number(W)},title:T.business_name,icon:A});return K.addListener("click",()=>{c&&(c.setContent(x(T)),c.open({anchor:K,map:l}))}),K}),o&&o.clearMarkers();const b={render:({count:T,position:L})=>{const W=`data:image/svg+xml;utf-8,${encodeURIComponent(` 13 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 60"> 14 <circle cx="30" cy="30" r="28" fill="#002773" opacity="0.25"/> 15 <circle cx="30" cy="30" r="22" fill="#002773" opacity="0.55"/> 16 <circle cx="30" cy="30" r="16" fill="#002773"/> 17 </svg> 18 `)}`;return new p.Marker({position:L,icon:{url:W,scaledSize:new p.Size(48,48),anchor:new p.Point(24,24)},label:{text:String(T),color:"#ffffff",fontSize:"13px",fontWeight:"bold"},zIndex:1e3+T})}};o=new bt({map:l,markers:f,renderer:b,onClusterClick:(T,L)=>{L.bounds&&(h=!0,w=!0,l.fitBounds(L.bounds),p.event.addListenerOnce(l,"idle",()=>{w=!1,d=!1,Z()}))}})}function k(p){u&&(u.setMap(null),u=null),t.userLocation&&(u=new p.Marker({position:t.userLocation,map:l,title:"Your location",icon:{path:p.SymbolPath.CIRCLE,scale:8,fillColor:"#1a73e8",fillOpacity:1,strokeColor:"#ffffff",strokeWeight:2},zIndex:999}))}function O(p){if(w=!0,p.event.addListenerOnce(l,"idle",()=>{w=!1,d=!1}),t.bounds){l.fitBounds({south:Number(t.bounds.south),west:Number(t.bounds.west),north:Number(t.bounds.north),east:Number(t.bounds.east)});return}if(t.userLocation){if(t.userRadius){const A=new p.Circle({center:t.userLocation,radius:t.userRadius*1e3});l.fitBounds(A.getBounds(),32)}else l.setCenter(t.userLocation),l.setZoom(11);return}if(t.fitToPins&&t.pins.length>0){const A=new p.LatLngBounds;for(const b of t.pins){const[T,L]=b.location??[];T!=null&&L!=null&&A.extend({lat:Number(T),lng:Number(L)})}if(!A.isEmpty()){l.fitBounds(A,32);return}}l.setCenter(s),l.setZoom(me)}function Z(){const p=l==null?void 0:l.getBounds();if(!p)return;
18const A=p.getNorthEast(),b=p.getSouthWest();E={south:b.lat(),west:b.lng(),north:A.lat(),east:A.lng()},r("bounds-change",E)}function _e(p,A){return!p||!A?!1:["south","west","north","east"].every(b=>Math.abs(Number(p[b])-Number(A[b]))<5e-5)}Me(async()=>{try{const p=await ke(t.apiKey);l=new p.Map(a.value,{center:s,zoom:me,styles:i,disableDefaultUI:!1,mapTypeControl:!1,streetViewControl:!1,fullscreenControl:!1}),c=new p.InfoWindow,I(p),k(p),O(p),a.value.addEventListener("pointerdown",D),a.value.addEventListener("wheel",D,{passive:!0}),m=l.addListener("dragend",()=>{h=!0,Z(),d=!1}),y=l.addListener("zoom_changed",()=>{w||!d||p.event.addListenerOnce(l,"idle",()=>{h=!0,Z(),d=!1})}),g=new ResizeObserver(()=>{p.event.trigger(l,"resize"),t.bounds&&!w&&p.event.addListenerOnce(l,"idle",Z)}),g.observe(a.value)}catch(p){console.error("DirectoryMap: failed to load Google Maps",p)}});function D(){d=!0}return Y(()=>t.pins,()=>{var p;!l||!((p=window.google)!=null&&p.maps)||(I(window.google.maps),!t.bounds&&!h&&O(window.google.maps))},{deep:!0}),Y([()=>t.userLocation,()=>t.userRadius],([p],[A])=>{var b;if(!(!l||!((b=window.google)!=null&&b.maps))){if(k(window.google.maps),p){h=!1,O(window.google.maps);return}A&&!t.bounds&&!h&&O(window.google.maps)}},{deep:!0}),Y(()=>t.bounds,(p,A)=>{var b;if(!(!l||!((b=window.google)!=null&&b.maps))){if(!p){A&&(h=!1,O(window.google.maps));return}if(t.forceBoundsFit){h=!1,O(window.google.maps);return}if(_e(t.bounds,E)){E=null;return}h||O(window.google.maps)}},{deep:!0}),be(()=>{var p,A;M(),u&&u.setMap(null),c&&c.close(),m&&m.remove(),y&&y.remove(),g==null||g.disconnect(),(p=a.value)==null||p.removeEventListener("pointerdown",D),(A=a.value)==null||A.removeEventListener("wheel",D)}),(p,A)=>(Ce(),ve("div",{ref_key:"mapEl",ref:a,class:"directory-map"},null,512))}},Tt=Object.freeze(Object.defineProperty({__proto__:null,default:vt},Symbol.toStringTag,{value:"Module"}));export{Tt as _};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.