1import{g as Y}from"./entry-client-D4F_DRpu.js";var S,B;function Q(){return B||(B=1,S=function a(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;var s,r,n;if(Array.isArray(t)){if(s=t.length,s!=e.length)return!1;for(r=s;r--!==0;)if(!a(t[r],e[r]))return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===e.toString();if(n=Object.keys(t),s=n.length,s!==Object.keys(e).length)return!1;for(r=s;r--!==0;)if(!Object.prototype.hasOwnProperty.call(e,n[r]))return!1;for(r=s;r--!==0;){var i=n[r];if(!a(t[i],e[i]))return!1}return!0}return t!==t&&e!==e}),S}var X=Q();const $=Y(X),z=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],b=1,v=8;class j{static from(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[e,s]=new Uint8Array(t,0,2);if(e!==219)throw new Error("Data does not appear to be in a KDBush format.");const r=s>>4;if(r!==b)throw new Error(`Got v${r} data when expected v${b}.`);const n=z[s&15];if(!n)throw new Error("Unrecognized array type.");const[i]=new Uint16Array(t,2,1),[h]=new Uint32Array(t,4,1);return new j(h,i,n,t)}constructor(t,e=64,s=Float64Array,r){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+e,2),65535),this.ArrayType=s,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;const n=z.indexOf(this.ArrayType),i=t*2*this.ArrayType.BYTES_PER_ELEMENT,h=t*this.IndexArrayType.BYTES_PER_ELEMENT,o=(8-h%8)%8;if(n<0)throw new Error(`Unexpected typed array class: ${s}.`);r&&r instanceof ArrayBuffer?(this.data=r,this.ids=new this.IndexArrayType(this.data,v,t),this.coords=new this.ArrayType(this.data,v+h+o,t*2),this._pos=t*2,this._finished=!0):(this.data=new ArrayBuffer(v+i+h+o),this.ids=new this.IndexArrayType(this.data,v,t),this.coords=new this.ArrayType(this.data,v+h+o,t*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(b<<4)+n]),new Uint16Array(this.data,2,1)[0]=e,new Uint32Array(this.data,4,1)[0]=t)}add(t,e){const s=this._pos>>1;return this.ids[s]=s,this.coords[this._pos++]=t,this.coords[this._pos++]=e,s}finish(){const t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return F(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,e,s,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:n,coords:i,nodeSize:h}=this,o=[0,n.length-1,0],l=[];for(;o.length;){const u=o.pop()||0,c=o.pop()||0,p=o.pop()||0;if(c-p<=h){for(let d=p;d<=c;d++){const w=i[2*d],M=i[2*d+1];w>=t&&w<=s&&M>=e&&M<=r&&l.push(n[d])}continue}const f=p+c>>1,g=i[2*f],m=i[2*f+1];g>=t&&g<=s&&m>=e&&m<=r&&l.push(n[f]),(u===0?t<=g:e<=m)&&(o.push(p),o.push(f-1),o.push(1-u)),(u===0?s>=g:r>=m)&&(o.push(f+1),o.push(c),o.push(1-u))}return l}within(t,e,s){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:r,coords:n,nodeSize:i}=this,h=[0,r.length-1,0],o=[],l=s*s;for(;h.length;){const u=h.pop()||0,c=h.pop()||0,p=h.pop()||0;if(c-p<=i){for(let d=p;d<=c;d++)G(n[2*d],n[2*d+1],t,e)<=l&&o.push(r[d]);continue}const f=p+c>>1,g=n[2*f],m=n[2*f+1];G(g,m,t,e)<=l&&o.push(r[f]),(u===0?t-s<=g:e-s<=m)&&(h.push(p),h.push(f-1),h.push(1-u)),(u===0?t+s>=g:e+s>=m)&&(h.push(f+1),h.push(c),h.push(1-u))}return o}}function F(a,t,e,s,r,n){if(r-s<=e)return;const i=s+r>>1;V(a,t,i,s,r,n),F(a,t,e,s,i-1,1-n),F(a,t,e,i+1,r,1-n)}function V(a,t,e,s,r,n){for(;r>s;){if(r-s>600){const l=r-s+1,u=e-s+1,c=Math.log(l),p=.5*Math.exp(2*c/3),f=.5*Math.sqrt(c*p*(l-p)/l)*(u-l/2<0?-1:1),g=Math.max(s,Math.floor(e-u*p/l+f)),m=Math.min(r,Math.floor(e+(l-u)*p/l+f));V(a,t,e,g,m,n)}const i=t[2*e+n];let h=s,o=r;for(C(a,t,s,e),t[2*r+n]>i&&C(a,t,s,r);h<o;){for(C(a,t,h,o),h++,o--;t[2*h+n]<i;)h++;for(;t[2*o+n]>i;)o--}t[2*s+n]===i?C(a,t,s,o):(o++,C(a,t,o,r)),o<=e&&(s=o+1),e<=o&&(r=o-1)}}function C(a,t,e,s){I(a,e,s),I(t,2*e,2*s),I(t,2*e+1,2*s+1)}function I(a,t,e){const s=a[t];a[t]=a[e],a[e]=s}function G(a,t,e,s){const r=a-e,n=t-s;return r*r+n*n}const tt={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:a=>a},q=Math.fround||(a=>t=>(a[0]=+t,a[0]))(new Float32Array(1)),A=2,E=3,Z=4,x=5,K=6;class et{constructor(t){this.options=Object.assign(Object.create(tt),t),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(t){const{log:e,minZoom:s,maxZoom:r}=this.options;e&&console.time("total time");const n=`prepare ${t.length} points`;e&&console.time(n),this.points=t;const i=[];for(let o=0;o<t.length;o++){const l=t[o];if(!l.geometry)continue;const[u,c]=l.geometry.coordinates,p=q(L(u)),f=q(P(c));i.push(p,f,1/0,o,-1,1),this.options.reduce&&i.push(0)}let h=this.trees[r+1]=this._createTree(i);e&&console.timeEnd(n);for(let o=r;o>=s;o--){const l=+Date.now();h=this.trees[o]=this._createTree(this._cluster(h,o)),e&&console.log("z%d: %d clusters in %dms",o,h.numItems,+Date.now()-l)}return e&&console.timeEnd("total time"),this}getClusters(t,e){let s=((t[0]+180)%360+360)%360-180;const r=Math.max(-90,Math.min(90,t[1]));let n=t[2]===180?180:((t[2]+180)%360+360)%360-180;const i=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)s=-180,n=180;else if(s>n){const c=this.getClusters([s,r,180,i],e),p=this.getClusters([-180,r,n,i],e);return c.concat(p)}const h=this.trees[this._limitZoom(e)],o=h.range(L(s),P(i),L(n),P(r)),l=h.data,u=[];for(const c of o){const p=this.stride*c;u.push(l[p+x]>1?H(l,p,this.clusterProps):this.points[l[p+E]])}return u}getChildren(t){const e=this._getOriginId(t),s=this._getOriginZoom(t),r="No cluster with the specified id.",n=this.trees[s];if(!n)throw new Error(r);const i=n.data;if(e*this.stride>=i.length)throw new Error(r);const h=this.options.radius/(this.options.extent*Math.pow(2,s-1)),o=i[e*this.stride],l=i[e*this.stride+1],u=n.within(o,l,h),c=[];for(const p of u){const f=p*this.stride;i[f+Z]===t&&c.push(i[f+x]>1?H(i,f,this.clusterProps):this.points[i[f+E]])}if(c.length===0)throw new Error(r);return c}getLeaves(t,e,s){e=e||10,s=s||0;const r=[];return this._appendLeaves(r,t,e,s,0),r}getTile(t,e,s){const r=this.trees[this._limitZoom(t)],n=Math.pow(2,t),{extent:i,radius:h}=this.options,o=h/i,l=(s-o)/n,u=(s+1+o)/n,c={features:[]};return this._addTileFeatures(r.range((e-o)/n,l,(e+1+o)/n,u),r.data,e,s,n,c),e===0&&this._addTileFeatures(r.range(1-o/n,l,1,u),r.data,n,s,n,c),e===n-1&&this._addTileFeatures(r.range(0,l,o/n,u),r.data,-1,s,n,c),c.features.length?c:null}getClusterExpansionZoom(t){let e=this._getOriginZoom(t)-1;for(;e<=this.options.maxZoom;){const s=this.getChildren(t);if(e++,s.length!==1)break;t=s[0].properties.cluster_id}return e}_appendLeaves(t,e,s,r,n){const i=this.getChildren(e);for(const h of i){const o=h.properties;if(o&&o.cluster?n+o.point_count<=r?n+=o.point_count:n=this._appendLeaves(t,o.cluster_id,s,r,n):n<r?n++:t.push(h),t.length===s)break}return n}_createTree(t){const e=new j(t.length/this.stride|0,this.options.nodeSize,Float32Array);for(let s=0;s<t.length;s+=this.stride)e.add(t[s],t[s+1]);return e.finish(),e.data=t,e}_addTileFeatures(t,e,s,r,n,i){for(const h of t){const o=h*this.stride,l=e[o+x]>1;let u,c,p;if(l)u=W(e,o,this.clusterProps),c=e[o],p=e[o+1];else{const m=this.points[e[o+E]];u=m.properties;const[d,w]=m.geometry.coordinates;c=L(d),p=P(w)}const f={type:1,geometry:[[Math.round(this.options.extent*(c*n-s)),Math.round(this.options.extent*(p*n-r))]],tags:u};let g;l||this.options.generateId?g=e[o+E]:g=this.points[e[o+E]].id,g!==void 0&&(f.id=g),i.features.push(f)}}_limitZoom(t){return Math.max(this.options.minZoom,Math.min(Math.floor(+t),this.options.maxZoom+1))}_cluster(t,e){const{radius:s,extent:r,reduce:n,minPoints:i}=this.options,h=s/(r*Math.pow(2,e)),o=t.data,l=[],u=this.stride;for(let c=0;c<o.length;c+=u){if(o[c+A]<=e)continue;o[c+A]=e;
1const p=o[c],f=o[c+1],g=t.within(o[c],o[c+1],h),m=o[c+x];let d=m;for(const w of g){const M=w*u;o[M+A]>e&&(d+=o[M+x])}if(d>m&&d>=i){let w=p*m,M=f*m,k,N=-1;const T=((c/u|0)<<5)+(e+1)+this.points.length;for(const J of g){const _=J*u;if(o[_+A]<=e)continue;o[_+A]=e;const R=o[_+x];w+=o[_]*R,M+=o[_+1]*R,o[_+Z]=T,n&&(k||(k=this._map(o,c,!0),N=this.clusterProps.length,this.clusterProps.push(k)),n(k,this._map(o,_)))}o[c+Z]=T,l.push(w/d,M/d,1/0,T,-1,d),n&&l.push(N)}else{for(let w=0;w<u;w++)l.push(o[c+w]);if(d>1)for(const w of g){const M=w*u;if(!(o[M+A]<=e)){o[M+A]=e;for(let k=0;k<u;k++)l.push(o[M+k])}}}}return l}_getOriginId(t){return t-this.points.length>>5}_getOriginZoom(t){return(t-this.points.length)%32}_map(t,e,s){if(t[e+x]>1){const i=this.clusterProps[t[e+K]];return s?Object.assign({},i):i}const r=this.points[t[e+E]].properties,n=this.options.map(r);return s&&n===r?Object.assign({},n):n}}function H(a,t,e){return{type:"Feature",id:a[t+E],properties:W(a,t,e),geometry:{type:"Point",coordinates:[st(a[t]),rt(a[t+1])]}}}function W(a,t,e){const s=a[t+x],r=s>=1e4?`${Math.round(s/1e3)}k`:s>=1e3?`${Math.round(s/100)/10}k`:s,n=a[t+K],i=n===-1?{}:Object.assign({},e[n]);return Object.assign(i,{cluster:!0,cluster_id:a[t+E],point_count:s,point_count_abbreviated:r})}function L(a){return a/360+.5}function P(a){const t=Math.sin(a*Math.PI/180),e=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return e<0?0:e>1?1:e}function st(a){return(a-.5)*360}function rt(a){const t=(180-a*360)*Math.PI/180;return 360*Math.atan(Math.exp(t))/Math.PI-90}/*! ***************************************************************************** 2Copyright (c) Microsoft Corporation. 3 4Permission to use, copy, modify, and/or distribute this software for any 5purpose with or without fee is hereby granted. 6 7THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 8REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 9AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 10INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 11LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 12OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 13PERFORMANCE OF THIS SOFTWARE. 14***************************************************************************** */function nt(a,t){var e={};for(var s in a)Object.prototype.hasOwnProperty.call(a,s)&&t.indexOf(s)<0&&(e[s]=a[s]);if(a!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(a);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(a,s[r])&&(e[s[r]]=a[s[r]]);return e}class y{static isAdvancedMarkerAvailable(t){return google.maps.marker&&t.getMapCapabilities().isAdvancedMarkersAvailable===!0}static isAdvancedMarker(t){return google.maps.marker&&t instanceof google.maps.marker.AdvancedMarkerElement}static setMap(t,e){this.isAdvancedMarker(t)?t.map=e:t.setMap(e)}static getPosition(t){if(this.isAdvancedMarker(t)){if(t.position){if(t.position instanceof google.maps.LatLng)return t.position;if(t.position.lat&&t.position.lng)return new google.maps.LatLng(t.position.lat,t.position.lng)}return new google.maps.LatLng(null)}return t.getPosition()}static getVisible(t){return this.isAdvancedMarker(t)?!0:t.getVisible()}}class U{constructor({markers:t,position:e}){this.markers=t,e&&(e instanceof google.maps.LatLng?this._position=e:this._position=new google.maps.LatLng(e))}get bounds(){if(this.markers.length===0&&!this._position)return;const t=new google.maps.LatLngBounds(this._position,this._position);for(const e of this.markers)t.extend(y.getPosition(e));return t}get position(){return this._position||this.bounds.getCenter()}get count(){return this.markers.filter(t=>y.getVisible(t)).length}push(t){this.markers.push(t)}delete(){this.marker&&(y.setMap(this.marker,null),this.marker=void 0),this.markers.length=0}}class ot{constructor({maxZoom:t=16}){this.maxZoom=t}noop({markers:t}){return it(t)}}const it=a=>a.map(e=>new U({position:y.getPosition(e),markers:[e]}));class at extends ot{constructor(t){var{maxZoom:e,radius:s=60}=t,r=nt(t,["maxZoom","radius"]);super({maxZoom:e}),this.state={zoom:-1}
14,this.superCluster=new et(Object.assign({maxZoom:this.maxZoom,radius:s},r))}calculate(t){let e=!1;const s={zoom:t.map.getZoom()};if(!$(t.markers,this.markers)){e=!0,this.markers=[...t.markers];const r=this.markers.map(n=>{const i=y.getPosition(n);return{type:"Feature",geometry:{type:"Point",coordinates:[i.lng(),i.lat()]},properties:{marker:n}}});this.superCluster.load(r)}return e||(this.state.zoom<=this.maxZoom||s.zoom<=this.maxZoom)&&(e=!$(this.state,s)),this.state=s,e&&(this.clusters=this.cluster(t)),{clusters:this.clusters,changed:e}}cluster({map:t}){return this.superCluster.getClusters([-180,-90,180,90],Math.round(t.getZoom())).map(e=>this.transformCluster(e))}transformCluster({geometry:{coordinates:[t,e]},properties:s}){if(s.cluster)return new U({markers:this.superCluster.getLeaves(s.cluster_id,1/0).map(n=>n.properties.marker),position:{lat:e,lng:t}});const r=s.marker;return new U({markers:[r],position:y.getPosition(r)})}}class ct{constructor(t,e){this.markers={sum:t.length};const s=e.map(n=>n.count),r=s.reduce((n,i)=>n+i,0);this.clusters={count:e.length,markers:{mean:r/e.length,sum:r,min:Math.min(...s),max:Math.max(...s)}}}}class ht{render({count:t,position:e},s,r){const i=`<svg fill="${t>Math.max(10,s.clusters.markers.mean)?"#ff0000":"#0000ff"}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 240" width="50" height="50"> 15<circle cx="120" cy="120" opacity=".6" r="70" /> 16<circle cx="120" cy="120" opacity=".3" r="90" /> 17<circle cx="120" cy="120" opacity=".2" r="110" /> 18<text x="50%" y="50%" style="fill:#fff" text-anchor="middle" font-size="50" dominant-baseline="middle" font-family="roboto,arial,sans-serif">${t}</text> 19</svg>`,h=`Cluster of ${t} markers`,o=Number(google.maps.Marker.MAX_ZINDEX)+t;if(y.isAdvancedMarkerAvailable(r)){const c=new DOMParser().parseFromString(i,"image/svg+xml").documentElement;c.setAttribute("transform","translate(0 25)");const p={map:r,position:e,zIndex:o,title:h,content:c};return new google.maps.marker.AdvancedMarkerElement(p)}const l={position:e,zIndex:o,title:h,icon:{url:`data:image/svg+xml;base64,${btoa(i)}`,anchor:new google.maps.Point(25,25)}};return new google.maps.Marker(l)}}function lt(a,t){for(let e in t.prototype)a.prototype[e]=t.prototype[e]}class D{constructor(){lt(D,google.maps.OverlayView)}}var O;(function(a){a.CLUSTERING_BEGIN="clusteringbegin",a.CLUSTERING_END="clusteringend",a.CLUSTER_CLICK="click"})(O||(O={}));const ut=(a,t,e)=>{e.fitBounds(t.bounds)};class pt extends D{constructor({map:t,markers:e=[],algorithmOptions:s={},algorithm:r=new at(s),renderer:n=new ht,onClusterClick:i=ut}){super(),this.markers=[...e],this.clusters=[],this.algorithm=r,this.renderer=n,this.onClusterClick=i,t&&this.setMap(t)}addMarker(t,e){this.markers.includes(t)||(this.markers.push(t),e||this.render())}addMarkers(t,e){t.forEach(s=>{this.addMarker(s,!0)}),e||this.render()}removeMarker(t,e){const s=this.markers.indexOf(t);return s===-1?!1:(y.setMap(t,null),this.markers.splice(s,1),e||this.render(),!0)}removeMarkers(t,e){let s=!1;return t.forEach(r=>{s=this.removeMarker(r,!0)||s}),s&&!e&&this.render(),s}clearMarkers(t){this.markers.length=0,t||this.render()}render(){const t=this.getMap();if(t instanceof google.maps.Map&&t.getProjection()){google.maps.event.trigger(this,O.CLUSTERING_BEGIN,this);const{clusters:e,changed:s}=this.algorithm.calculate({markers:this.markers,map:t,mapCanvasProjection:this.getProjection()});if(s||s==null){const r=new Set;for(const i of e)i.markers.length==1&&r.add(i.markers[0]);const n=[];for(const i of this.clusters)i.marker!=null&&(i.markers.length==1?r.has(i.marker)||y.setMap(i.marker,null):n.push(i.marker));this.clusters=e,this.renderClusters(),requestAnimationFrame(()=>n.forEach(i=>y.setMap(i,null)))}google.maps.event.trigger(this,O.CLUSTERING_END,this)}}onAdd(){this.idleListener=this.getMap().addListener("idle",this.render.bind(this)),this.render()}onRemove(){google.maps.event.removeListener(this.idleListener),this.reset()}reset(){this.markers.forEach(t=>y.setMap(t,null)),this.clusters.forEach(t=>t.delete()),this.clusters=[]}
19renderClusters(){const t=new ct(this.markers,this.clusters),e=this.getMap();this.clusters.forEach(s=>{s.markers.length===1?s.marker=s.markers[0]:(s.marker=this.renderer.render(s,t,e),s.markers.forEach(r=>y.setMap(r,null)),this.onClusterClick&&s.marker.addListener("click",r=>{google.maps.event.trigger(this,O.CLUSTER_CLICK,s),this.onClusterClick(r,s,e)})),y.setMap(s.marker,e)})}}const ft=5,gt=(a,{i18n:t,locations:e})=>{let s=!1;const r=e.length>1;let n=0;const i={render:({count:l,position:u})=>new google.maps.Marker({position:u,title:t==null?void 0:t.clickToZoom,label:{text:String(l),color:"black",fontSize:"14px",fontFamily:"arial"}})},h=()=>{const l=new google.maps.Map(a,{zoom:15,minZoom:4,gestureHandling:"cooperative",zoomControl:!0,scrollwheel:!1,center:{lat:e[0].lat,lng:e[0].lng}});if(r){const p=new google.maps.LatLngBounds;e.forEach(f=>{p.extend(f)}),l.fitBounds(p)}const u=new google.maps.InfoWindow({content:"",disableAutoPan:!0}),c=e.map(p=>{const f=new google.maps.Marker({position:p});return r&&p.name?(f.addListener("mouseover",()=>{u.setContent(`<div class="info-window">${p.name}</div>`),u.open(l,f)}),f.addListener("mouseout",()=>{u.close()}),f):(p.name&&(u.setContent(`<div class="info-window">${p.name}</div>`),u.open(l,f)),f.setMap(l),f)});r&&new pt({map:l,markers:c,renderer:i})},o=()=>{google!=null&&google.maps&&!s?(h(),s=!0):n<ft&&setTimeout(o,100),n++};o()};export{gt as default};
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.