vendor: 4,216 bytes, line 1
1import{f6 as tt}from"./hydrate.DZ4YTm7p.js";import"./esnext-vendor.B9Da21W6.js";import"./addresses-is-address-empty.Bn2lNY_L.js";import"./app.DbSrjjlA.js";import"./graphql-PaymentSessionMutation.CAXCwUvV.js";import"./hooks-useShopPayExternalAppContext.DWwMuRnz.js";import"./hooks-useReplaceShopPayInHistory.DPpLejwu.js";function et(o,t,e,s){function r(i){return i instanceof e?i:new e(function(a){a(i)})}return new(e||(e=Promise))(function(i,a){function l(h){try{u(s.next(h))}catch(c){a(c)}}function n(h){try{u(s.throw(h))}catch(c){a(c)}}function u(h){h.done?i(h.value):r(h.value).then(l,n)}u((s=s.apply(o,[])).next())})}function st(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}var rt=function o(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,i;if(Array.isArray(t)){if(s=t.length,s!=e.length)return!1;for(r=s;r--!==0;)if(!o(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(i=Object.keys(t),s=i.length,s!==Object.keys(e).length)return!1;for(r=s;r--!==0;)if(!Object.prototype.hasOwnProperty.call(e,i[r]))return!1;for(r=s;r--!==0;){var a=i[r];if(!o(t[a],e[a]))return!1}return!0}return t!==t&&e!==e},it=st(rt);const q="__googleMapsScriptId";var I;(function(o){o[o.INITIALIZED=0]="INITIALIZED",o[o.LOADING=1]="LOADING",o[o.SUCCESS=2]="SUCCESS",o[o.FAILURE=3]="FAILURE"})(I||(I={}));class b{constructor({apiKey:t,authReferrerPolicy:e,channel:s,client:r,id:i=q,language:a,libraries:l=[],mapIds:n,nonce:u,region:h,retries:c=3,url:p="https://maps.googleapis.com/maps/api/js",version:f}){if(this.callbacks=[],this.done=!1,this.loading=!1,this.errors=[],this.apiKey=t,this.authReferrerPolicy=e,this.channel=s,this.client=r,this.id=i||q,this.language=a,this.libraries=l,this.mapIds=n,this.nonce=u,this.region=h,this.retries=c,this.url=p,this.version=f,b.instance){if(!it(this.options,b.instance.options))throw new Error(`Loader must not be called again with different options. ${JSON.stringify(this.options)} !== ${JSON.stringify(b.instance.options)}`);return b.instance}b.instance=this}get options(){return{version:this.version,apiKey:this.apiKey,channel:this.channel,client:this.client,id:this.id,libraries:this.libraries,language:this.language,region:this.region,mapIds:this.mapIds,nonce:this.nonce,url:this.url,authReferrerPolicy:this.authReferrerPolicy}}get status(){return this.errors.length?I.FAILURE:this.done?I.SUCCESS:this.loading?I.LOADING:I.INITIALIZED}get failed(){return this.done&&!this.loading&&this.errors.length>=this.retries+1}createUrl(){let t=this.url;return t+="?callback=__googleMapsCallback&loading=async",this.apiKey&&(t+=`&key=${this.apiKey}`),this.channel&&(t+=`&channel=${this.channel}`),this.client&&(t+=`&client=${this.client}`),this.libraries.length>0&&(t+=`&libraries=${this.libraries.join(",")}`),this.language&&(t+=`&language=${this.language}`),this.region&&(t+=`®ion=${this.region}`),this.version&&(t+=`&v=${this.version}`),this.mapIds&&(t+=`&map_ids=${this.mapIds.join(",")}`),this.authReferrerPolicy&&(t+=`&auth_referrer_policy=${this.authReferrerPolicy}`),t}deleteScript(){const t=document.getElementById(this.id);t&&t.remove()}load(){return this.loadPromise()}loadPromise(){return new Promise((t,e)=>{this.loadCallback(s=>{s?e(s.error):t(window.google)})})}importLibrary(t){return this.execute(),google.maps.importLibrary(t)}loadCallback(t){this.callbacks.push(t),this.execute()}setScript(){var t,e;if(document.getElementById(this.id)){this.callback();return}const s={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(s).forEach(i=>!s[i]&&delete s[i]),!((e=(t=window?.google)===null||t===void 0?void 0:t.maps)===null||e===void 0)&&e.importLibrary||(i=>{let a,l,n,u="The Google Maps JavaScript API",h="google",c="importLibrary",p="__ib__",f=document,d=window;d=d[h]||(d[h]={});
1const m=d.maps||(d.maps={}),g=new Set,y=new URLSearchParams,w=()=>a||(a=new Promise((v,O)=>et(this,void 0,void 0,function*(){var k;yield l=f.createElement("script"),l.id=this.id,y.set("libraries",[...g]+"");for(n in i)y.set(n.replace(/[A-Z]/g,j=>"_"+j[0].toLowerCase()),i[n]);y.set("callback",h+".maps."+p),l.src=this.url+"?"+y,m[p]=v,l.onerror=()=>a=O(Error(u+" could not load.")),l.nonce=this.nonce||((k=f.querySelector("script[nonce]"))===null||k===void 0?void 0:k.nonce)||"",f.head.append(l)})));m[c]?console.warn(u+" only loads once. Ignoring:",i):m[c]=(v,...O)=>g.add(v)&&w().then(()=>m[c](v,...O))})(s);const r=this.libraries.map(i=>this.importLibrary(i));r.length||r.push(this.importLibrary("core")),Promise.all(r).then(()=>this.callback(),i=>{const a=new ErrorEvent("error",{error:i});this.loadErrorCallback(a)})}reset(){this.deleteScript(),this.done=!1,this.loading=!1,this.errors=[],this.onerrorEvent=null}resetIfRetryingFailed(){this.failed&&this.reset()}loadErrorCallback(t){if(this.errors.push(t),this.errors.length<=this.retries){const e=this.errors.length*Math.pow(2,this.errors.length);console.error(`Failed to load Google Maps script, retrying in ${e} ms.`),setTimeout(()=>{this.deleteScript(),this.setScript()},e)}else this.onerrorEvent=t,this.callback()}callback(){this.done=!0,this.loading=!1,this.callbacks.forEach(t=>{t(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()}}}var F,K;function nt(){return K||(K=1,F=function o(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,i;if(Array.isArray(t)){if(s=t.length,s!=e.length)return!1;for(r=s;r--!==0;)if(!o(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(i=Object.keys(t),s=i.length,s!==Object.keys(e).length)return!1;for(r=s;r--!==0;)if(!Object.prototype.hasOwnProperty.call(e,i[r]))return!1;for(r=s;r--!==0;){var a=i[r];if(!o(t[a],e[a]))return!1}return!0}return t!==t&&e!==e}),F}var ot=nt();const z=tt(ot),V=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],R=1,C=8;class ${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!==R)throw new Error(`Got v${r} data when expected v${R}.`);const i=V[s&15];if(!i)throw new Error("Unrecognized array type.");const[a]=new Uint16Array(t,2,1),[l]=new Uint32Array(t,4,1);return new $(l,a,i,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 i=V.indexOf(this.ArrayType),a=t*2*this.ArrayType.BYTES_PER_ELEMENT,l=t*this.IndexArrayType.BYTES_PER_ELEMENT,n=(8-l%8)%8;if(i<0)throw new Error(`Unexpected typed array class: ${s}.`);r&&r instanceof ArrayBuffer?(this.data=r,this.ids=new this.IndexArrayType(this.data,C,t),this.coords=new this.ArrayType(this.data,C+l+n,t*2),this._pos=t*2,this._finished=!0):(this.data=new ArrayBuffer(C+a+l+n),this.ids=new this.IndexArrayType(this.data,C,t),this.coords=new this.ArrayType(this.data,C+l+n,t*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(R<<4)+i]),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 D(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:i,coords:a,nodeSize:l}=this,n=[0,i.length-1,0],u=[];for(;n.length;){const h=n.pop()||0,c=n.pop()||0,p=n.pop()||0;if(c-p<=l){for(let g=p;g<=c;g++){const y=a[2*g],w=a[2*g+1];y>=t&&y<=s&&w>=e&&w<=r&&u.push(i[g])}continue}const f=p+c>>1,d=a[2*f],m=a[2*f+1];d>=t&&d<=s&&m>=e&&m<=r&&u.push(i[f]),(h===0?t<=d:e<=m)&&(n.push(p),n.push(f-1),n.push(1-h)),(h===0?s>=d:r>=m)&&(n.push(f+1),n.push(c),n.push(1-h))}return u}within(t,e,s){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:r,coords:i,nodeSize:a}=this,l=[0,r.length-1,0],n=[],u=s*s;for(;l.length;){const h=l.pop()||0,c=l.pop()||0,p=l.pop()||0;if(c-p<=a){for(let g=p;g<=c;g++)H(i[2*g],i[2*g+1],t,e)<=u&&n.push(r[g]);continue}const f=p+c>>
11,d=i[2*f],m=i[2*f+1];H(d,m,t,e)<=u&&n.push(r[f]),(h===0?t-s<=d:e-s<=m)&&(l.push(p),l.push(f-1),l.push(1-h)),(h===0?t+s>=d:e+s>=m)&&(l.push(f+1),l.push(c),l.push(1-h))}return n}}function D(o,t,e,s,r,i){if(r-s<=e)return;const a=s+r>>1;Q(o,t,a,s,r,i),D(o,t,e,s,a-1,1-i),D(o,t,e,a+1,r,1-i)}function Q(o,t,e,s,r,i){for(;r>s;){if(r-s>600){const u=r-s+1,h=e-s+1,c=Math.log(u),p=.5*Math.exp(2*c/3),f=.5*Math.sqrt(c*p*(u-p)/u)*(h-u/2<0?-1:1),d=Math.max(s,Math.floor(e-h*p/u+f)),m=Math.min(r,Math.floor(e+(u-h)*p/u+f));Q(o,t,e,d,m,i)}const a=t[2*e+i];let l=s,n=r;for(S(o,t,s,e),t[2*r+i]>a&&S(o,t,s,r);l<n;){for(S(o,t,l,n),l++,n--;t[2*l+i]<a;)l++;for(;t[2*n+i]>a;)n--}t[2*s+i]===a?S(o,t,s,n):(n++,S(o,t,n,r)),n<=e&&(s=n+1),e<=n&&(r=n-1)}}function S(o,t,e,s){Z(o,e,s),Z(t,2*e,2*s),Z(t,2*e+1,2*s+1)}function Z(o,t,e){const s=o[t];o[t]=o[e],o[e]=s}function H(o,t,e,s){const r=o-e,i=t-s;return r*r+i*i}const at={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:o=>o},J=Math.fround||(o=>(t=>(o[0]=+t,o[0])))(new Float32Array(1)),x=2,_=3,U=4,M=5,W=6;class ct{constructor(t){this.options=Object.assign(Object.create(at),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 i=`prepare ${t.length} points`;e&&console.time(i),this.points=t;const a=[];for(let n=0;n<t.length;n++){const u=t[n];if(!u.geometry)continue;const[h,c]=u.geometry.coordinates,p=J(L(h)),f=J(T(c));a.push(p,f,1/0,n,-1,1),this.options.reduce&&a.push(0)}let l=this.trees[r+1]=this._createTree(a);e&&console.timeEnd(i);for(let n=r;n>=s;n--){const u=+Date.now();l=this.trees[n]=this._createTree(this._cluster(l,n)),e&&console.log("z%d: %d clusters in %dms",n,l.numItems,+Date.now()-u)}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 i=t[2]===180?180:((t[2]+180)%360+360)%360-180;const a=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)s=-180,i=180;else if(s>i){const c=this.getClusters([s,r,180,a],e),p=this.getClusters([-180,r,i,a],e);return c.concat(p)}const l=this.trees[this._limitZoom(e)],n=l.range(L(s),T(a),L(i),T(r)),u=l.data,h=[];for(const c of n){const p=this.stride*c;h.push(u[p+M]>1?Y(u,p,this.clusterProps):this.points[u[p+_]])}return h}getChildren(t){const e=this._getOriginId(t),s=this._getOriginZoom(t),r="No cluster with the specified id.",i=this.trees[s];if(!i)throw new Error(r);const a=i.data;if(e*this.stride>=a.length)throw new Error(r);const l=this.options.radius/(this.options.extent*Math.pow(2,s-1)),n=a[e*this.stride],u=a[e*this.stride+1],h=i.within(n,u,l),c=[];for(const p of h){const f=p*this.stride;a[f+U]===t&&c.push(a[f+M]>1?Y(a,f,this.clusterProps):this.points[a[f+_]])}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)],i=Math.pow(2,t),{extent:a,radius:l}=this.options,n=l/a,u=(s-n)/i,h=(s+1+n)/i,c={features:[]};return this._addTileFeatures(r.range((e-n)/i,u,(e+1+n)/i,h),r.data,e,s,i,c),e===0&&this._addTileFeatures(r.range(1-n/i,u,1,h),r.data,i,s,i,c),e===i-1&&this._addTileFeatures(r.range(0,u,n/i,h),r.data,-1,s,i,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,i){const a=this.getChildren(e);for(const l of a){const n=l.properties;if(n&&n.cluster?i+n.point_count<=r?i+=n.point_count:i=this._appendLeaves(t,n.cluster_id,s,r,i):i<r?i++:t.push(l),t.length===s)break}return i}_createTree(t){const e=new $(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,i,a){for(const l of t){const n=l*this.stride,u=e[n+M]>1;let h,c,p;if(u)h=X(e,n,this.clusterProps),c=e[n],p=e[n+1];else{const m=this.points[e[n+_]];h=m.properties;const[g,y]=m.geometry.coordinates;c=L(g),p=T(y)}const f={type:1,geometry:[[Math.round(this.options.extent*(c*i-s)),Math.round(this.options.extent*(p*i-r))]],tags:h};let d;u||this.options.generateId?d=e[n+_]:d=this.points[e[n+_]].id,d!==void 0&&(f.id=d),a.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:i,minPoints:a}=this.options,l=s/(r*Math.pow(2,e)),n=t.data,u=[],h=this.stride;for(let c=0;c<n.length;c+=h){if(n[c+x]<=e)continue;n[c+x]=e;const p=n[c],f=n[c+1],d=t.within(n[c],n[c+1],l),m=n[c+M];let g=m;for(const y of d){const w=y*h;n[w+x]>e&&(g+=n[w+M])}if(g>m&&g>=a){let y=p*m,w=f*m,v,O=-1;const k=((c/h|0)<<5)+(e+1)+this.points.length;for(const j of d){const A=j*h;if(n[A+x]<=e)continue;n[A+x]=e;const G=n[A+M];y+=n[A]*G,w+=n[A+1]*G,n[A+U]=k,i&&(v||(v=this._map(n,c,!0),O=this.clusterProps.length,this.clusterProps.push(v)),i(v,this._map(n,A)))}n[c+U]=k,u.push(y/g,w/g,1/0,k,-1,g),i&&u.push(O)}else{for(let y=0;y<h;y++)u.push(n[c+y]);if(g>1)for(const y of d){const w=y*h;if(!(n[w+x]<=e)){n[w+x]=e;for(let v=0;v<h;v++)u.push(n[w+v])}}}}return u}_getOriginId(t){return t-this.points.length>>5}_getOriginZoom(t){return(t-this.points.length)%32}_map(t,e,s){if(t[e+M]>1){const a=this.clusterProps[t[e+W]];return s?Object.assign({},a):a}const r=this.points[t[e+_]].properties,i=this.options.map(r);return s&&i===r?Object.assign({},i):i}}function Y(o,t,e){return{type:"Feature",id:o[t+_],properties:X(o,t,e),geometry:{type:"Point",coordinates:[lt(o[t]),ht(o[t+1])]}}}function X(o,t,e){const s=o[t+M],r=s>=1e4?`${Math.round(s/1e3)}
1k`:s>=1e3?`${Math.round(s/100)/10}k`:s,i=o[t+W],a=i===-1?{}:Object.assign({},e[i]);return Object.assign(a,{cluster:!0,cluster_id:o[t+_],point_count:s,point_count_abbreviated:r})}function L(o){return o/360+.5}function T(o){const t=Math.sin(o*Math.PI/180),e=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return e<0?0:e>1?1:e}function lt(o){return(o-.5)*360}function ht(o){const t=(180-o*360)*Math.PI/180;return 360*Math.atan(Math.exp(t))/Math.PI-90}function ut(o,t){var e={};for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&t.indexOf(s)<0&&(e[s]=o[s]);if(o!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(o);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(o,s[r])&&(e[s[r]]=o[s[r]]);return e}class E{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 N{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(E.getPosition(e));return t}get position(){return this._position||this.bounds.getCenter()}get count(){return this.markers.filter(t=>E.getVisible(t)).length}push(t){this.markers.push(t)}delete(){this.marker&&(E.setMap(this.marker,null),this.marker=void 0),this.markers.length=0}}class pt{constructor({maxZoom:t=16}){this.maxZoom=t}noop({markers:t}){return ft(t)}}const ft=o=>o.map(e=>new N({position:E.getPosition(e),markers:[e]}));class dt extends pt{constructor(t){var{maxZoom:e,radius:s=60}=t,r=ut(t,["maxZoom","radius"]);super({maxZoom:e}),this.state={zoom:-1},this.superCluster=new ct(Object.assign({maxZoom:this.maxZoom,radius:s},r))}calculate(t){let e=!1;const s={zoom:t.map.getZoom()};if(!z(t.markers,this.markers)){e=!0,this.markers=[...t.markers];const r=this.markers.map(i=>{const a=E.getPosition(i);return{type:"Feature",geometry:{type:"Point",coordinates:[a.lng(),a.lat()]},properties:{marker:i}}});this.superCluster.load(r)}return e||(this.state.zoom<=this.maxZoom||s.zoom<=this.maxZoom)&&(e=!z(this.state,s)),this.state=s,e&&(this.cluster
1s=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 N({markers:this.superCluster.getLeaves(s.cluster_id,1/0).map(i=>i.properties.marker),position:{lat:e,lng:t}});const r=s.marker;return new N({markers:[r],position:E.getPosition(r)})}}class gt{constructor(t,e){this.markers={sum:t.length};const s=e.map(i=>i.count),r=s.reduce((i,a)=>i+a,0);this.clusters={count:e.length,markers:{mean:r/e.length,sum:r,min:Math.min(...s),max:Math.max(...s)}}}}class mt{render({count:t,position:e},s,r){const a=`<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"> 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">${t}</text> 6</svg>`,l=`Cluster of ${t} markers`,n=Number(google.maps.Marker.MAX_ZINDEX)+t;if(E.isAdvancedMarkerAvailable(r)){const c=new DOMParser().parseFromString(a,"image/svg+xml").documentElement;c.setAttribute("transform","translate(0 25)");const p={map:r,position:e,zIndex:n,title:l,content:c};return new google.maps.marker.AdvancedMarkerElement(p)}const u={position:e,zIndex:n,title:l,icon:{url:`data:image/svg+xml;base64,${btoa(a)}`,anchor:new google.maps.Point(25,25)}};return new google.maps.Marker(u)}}function yt(o,t){for(let e in t.prototype)o.prototype[e]=t.prototype[e]}class B{constructor(){yt(B,google.maps.OverlayView)}}var P;(function(o){o.CLUSTERING_BEGIN="clusteringbegin",o.CLUSTERING_END="clusteringend",o.CLUSTER_CLICK="click"})(P||(P={}));const wt=(o,t,e)=>{e.fitBounds(t.bounds)};class Ot extends B{constructor({map:t,markers:e=[],algorithmOptions:s={},algorithm:r=new dt(s),renderer:i=new mt,onClusterClick:a=wt}){super(),this.markers=[...e],this.clusters=[],this.algorithm=r,this.renderer=i,this.onClusterClick=a,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:(E.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,P.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 a of e)a.markers.length==1&&r.add(a.markers[0]);const i=[];for(const a of this.clusters)a.marker!=null&&(a.markers.length==1?r.has(a.marker)||E.setMap(a.marker,null):i.push(a.marker));this.clusters=e,this.renderClusters(),requestAnimationFrame(()=>i.forEach(a=>E.setMap(a,null)))}google.maps.event.trigger(this,P.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=>E.setMap(t,null)),this.clusters.forEach(t=>t.delete()),this.clusters=[]}renderClusters(){const t=new gt(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=>E.setMap(r,null)),this.onClusterClick&&s.marker.addListener("click",r=>{google.maps.event.trigger(this,P.CLUSTER_CLICK,s),this.onClusterClick(r,s,e)})),E.setMap(s.marker,e)})}}export{b as Loader,Ot as MarkerClusterer};
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.