@qratilabs/qrati-connect 2.7.0-beta.12 → 2.7.0-beta.13
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/CHANGELOG.md +9 -0
- package/element/BJ85RnFv.js +1 -0
- package/element/C2UaAEQP.js +3 -0
- package/element/{D9Sm6pmy.js → CMtkKIjI.js} +1 -1
- package/element/{P_I3VuGh.js → DQpjw80t.js} +1 -1
- package/element/{DHNyTQC6.js → FXirOp_Y.js} +1 -1
- package/element/{Lyw2zR3l.js → MLdQBzEU.js} +1 -1
- package/element/OQ2IC54N.js +1 -0
- package/element/web.es.js +164 -164
- package/package.json +1 -1
- package/react/{BPGSy9Ut.js → B5Ka1p5E.js} +1 -1
- package/react/BASLCEhb.js +3 -0
- package/react/BJ85RnFv.js +1 -0
- package/react/{Dl_ukrsn.js → BJvO-E_0.js} +1 -1
- package/react/BtTYXVAR.js +1 -0
- package/react/{C5J_mt98.js → D-fmp40z.js} +1 -1
- package/react/{DNKrnolq.js → DCz37sa7.js} +1 -1
- package/react/{BWIAQDhf.js → DHsK9IXJ.js} +1 -1
- package/react/{DgTarv0d.js → DvzgEfqA.js} +1 -1
- package/react/{DC_o2r7p.js → Nxl0j44-.js} +1 -1
- package/react/OQ2IC54N.js +1 -0
- package/react/{BuSQqs3v.js → eCa9bk8E.js} +1 -1
- package/react/index.cjs +1 -1
- package/react/index.mjs +152 -152
- package/react/k7tfB18Y.js +1 -0
- package/react/y7LtxYJq.js +1 -0
- package/umd/web.umd.js +1 -1
- package/element/Bq49vNdl.js +0 -3
- package/react/CDIa86BW.js +0 -1
- package/react/CExbtpRs.js +0 -3
- /package/element/{CQymloKy.js → B-xR99M3.js} +0 -0
- /package/element/{BDYiBkxW.js → BTZXR2Ef.js} +0 -0
- /package/element/{BEK0eJPF.js → C1E5jOn8.js} +0 -0
- /package/element/{U-Ix_WZD.js → CNGkJRCP.js} +0 -0
- /package/element/{7raRG5De.js → CiA4qgsY.js} +0 -0
- /package/element/{CYAovJ6s.js → Da-TWV7Z.js} +0 -0
- /package/react/{D3Nr5Xmy.js → B100IxcO.js} +0 -0
- /package/react/{5_fXJ9Sc.js → B4gPJkGN.js} +0 -0
- /package/react/{BDYiBkxW.js → BTZXR2Ef.js} +0 -0
- /package/react/{CJdL1O4V.js → BmbdEikc.js} +0 -0
- /package/react/{BEK0eJPF.js → C1E5jOn8.js} +0 -0
- /package/react/{7raRG5De.js → CiA4qgsY.js} +0 -0
- /package/react/{CMiXcwFJ.js → CyhPgIea.js} +0 -0
- /package/react/{j3g_MqRj.js → D3_wj4xL.js} +0 -0
- /package/react/{1fZfDcwR.js → DAeYnzME.js} +0 -0
- /package/react/{DMQys5Qb.js → DpVbMh3w.js} +0 -0
- /package/react/{UBa8jAMZ.js → GBQQQlnH.js} +0 -0
- /package/react/{txGWA2cq.js → t9U7xts0.js} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
# [2.7.0-beta.12](https://github.com/qrati-labs/qrati-connect-ts/compare/v2.7.0-beta.11...v2.7.0-beta.12) (2026-04-20)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **i18n:** enhance multi-language support by refining translations and improving component accessibility across various pages ([6c26182](https://github.com/qrati-labs/qrati-connect-ts/commit/6c26182b091637f3708360b19a43574e4c6ad527))
|
|
7
|
+
* **i18n:** implement internationalization support with dynamic translations ([93a7dae](https://github.com/qrati-labs/qrati-connect-ts/commit/93a7daea6b519cd71cc29c80353a99a473ce3397))
|
|
8
|
+
* **i18n:** implement multi-language support by removing static translations and integrating dynamic translation functionality across components (EventHeader, EventHeaderAdminButtons, ContentFilter, etc.) to utilize dynamic translations. ([db5af9e](https://github.com/qrati-labs/qrati-connect-ts/commit/db5af9e2e5cb6b084747706d453059a9e0bba911))
|
|
9
|
+
|
|
1
10
|
# [2.7.0-beta.11](https://github.com/qrati-labs/qrati-connect-ts/compare/v2.7.0-beta.10...v2.7.0-beta.11) (2026-04-16)
|
|
2
11
|
|
|
3
12
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(){function t(i){return this instanceof t?(this._canvas=i="string"==typeof i?document.getElementById(i):i,this._ctx=i.getContext("2d"),this._width=i.width,this._height=i.height,this._max=1,void this.clear()):new t(i)}t.prototype={defaultRadius:25,defaultGradient:{.4:"blue",.6:"cyan",.7:"lime",.8:"yellow",1:"red"},data:function(t,i){return this._data=t,this},max:function(t){return this._max=t,this},add:function(t){return this._data.push(t),this},clear:function(){return this._data=[],this},radius:function(t,i){i=i||15;var a=this._circle=document.createElement("canvas"),s=a.getContext("2d"),e=this._r=t+i;return a.width=a.height=2*e,s.shadowOffsetX=s.shadowOffsetY=200,s.shadowBlur=i,s.shadowColor="black",s.beginPath(),s.arc(e-200,e-200,t,0,2*Math.PI,!0),s.closePath(),s.fill(),this},gradient:function(t){var i=document.createElement("canvas"),a=i.getContext("2d"),s=a.createLinearGradient(0,0,0,256);for(var e in i.width=1,i.height=256,t)s.addColorStop(e,t[e]);return a.fillStyle=s,a.fillRect(0,0,1,256),this._grad=a.getImageData(0,0,1,256).data,this},draw:function(t){this._circle||this.radius(this.defaultRadius),this._grad||this.gradient(this.defaultGradient);var i=this._ctx;i.clearRect(0,0,this._width,this._height);for(var a,s=0,e=this._data.length;e>s;s++)a=this._data[s],i.globalAlpha=Math.max(a[2]/this._max,t||.05),i.drawImage(this._circle,a[0]-this._r,a[1]-this._r);var n=i.getImageData(0,0,this._width,this._height);return this._colorize(n.data,this._grad),i.putImageData(n,0,0),this},_colorize:function(t,i){for(var a,s=3,e=t.length;e>s;s+=4)(a=4*t[s])&&(t[s-3]=i[a],t[s-2]=i[a+1],t[s-1]=i[a+2])}},window.simpleheat=t})(),L.HeatLayer=(L.Layer?L.Layer:L.Class).extend({initialize:function(t,i){this._latlngs=t,L.setOptions(this,i)},setLatLngs:function(t){return this._latlngs=t,this.redraw()},addLatLng:function(t){return this._latlngs.push(t),this.redraw()},setOptions:function(t){return L.setOptions(this,t),this._heat&&this._updateOptions(),this.redraw()},redraw:function(){return!this._heat||this._frame||this._map._animating||(this._frame=L.Util.requestAnimFrame(this._redraw,this)),this},onAdd:function(t){this._map=t,this._canvas||this._initCanvas(),t._panes.overlayPane.appendChild(this._canvas),t.on("moveend",this._reset,this),t.options.zoomAnimation&&L.Browser.any3d&&t.on("zoomanim",this._animateZoom,this),this._reset()},onRemove:function(t){t.getPanes().overlayPane.removeChild(this._canvas),t.off("moveend",this._reset,this),t.options.zoomAnimation&&t.off("zoomanim",this._animateZoom,this)},addTo:function(t){return t.addLayer(this),this},_initCanvas:function(){var t=this._canvas=L.DomUtil.create("canvas","leaflet-heatmap-layer leaflet-layer"),i=L.DomUtil.testProp(["transformOrigin","WebkitTransformOrigin","msTransformOrigin"]);t.style[i]="50% 50%";var a=this._map.getSize();t.width=a.x,t.height=a.y;var s=this._map.options.zoomAnimation&&L.Browser.any3d;L.DomUtil.addClass(t,"leaflet-zoom-"+(s?"animated":"hide")),this._heat=simpleheat(t),this._updateOptions()},_updateOptions:function(){this._heat.radius(this.options.radius||this._heat.defaultRadius,this.options.blur),this.options.gradient&&this._heat.gradient(this.options.gradient),this.options.max&&this._heat.max(this.options.max)},_reset:function(){var t=this._map.containerPointToLayerPoint([0,0]);L.DomUtil.setPosition(this._canvas,t);var i=this._map.getSize();this._heat._width!==i.x&&(this._canvas.width=this._heat._width=i.x),this._heat._height!==i.y&&(this._canvas.height=this._heat._height=i.y),this._redraw()},_redraw:function(){var t,i,a,s,e,n,h,o,r,d=[],_=this._heat._r,l=this._map.getSize(),m=new L.Bounds(L.point([-_,-_]),l.add([_,_])),c=void 0===this.options.max?1:this.options.max,u=void 0===this.options.maxZoom?this._map.getMaxZoom():this.options.maxZoom,f=1/Math.pow(2,Math.max(0,Math.min(u-this._map.getZoom(),12))),g=_/2,p=[],v=this._map._getMapPanePos(),w=v.x%g,y=v.y%g;for(t=0,i=this._latlngs.length;i>t;t++)a=this._map.latLngToContainerPoint(this._latlngs[t]),m.contains(a)&&(e=Math.floor((a.x-w)/g)+2,n=Math.floor((a.y-y)/g)+2,r=(void 0!==this._latlngs[t].alt?this._latlngs[t].alt:void 0!==this._latlngs[t][2]?+this._latlngs[t][2]:1)*f,p[n]=p[n]||[],(s=p[n][e])?(s[0]=(s[0]*s[2]+a.x*r)/(s[2]+r),s[1]=(s[1]*s[2]+a.y*r)/(s[2]+r),s[2]+=r):p[n][e]=[a.x,a.y,r]);for(t=0,i=p.length;i>t;t++)if(p[t])for(h=0,o=p[t].length;o>h;h++)(s=p[t][h])&&d.push([Math.round(s[0]),Math.round(s[1]),Math.min(s[2],c)]);this._heat.data(d).draw(this.options.minOpacity),this._frame=null},_animateZoom:function(t){var i=this._map.getZoomScale(t.zoom),a=this._map._getCenterOffset(t.center)._multiplyBy(-i).subtract(this._map._getMapPanePos());L.DomUtil.setTransform?L.DomUtil.setTransform(this._canvas,a,i):this._canvas.style[L.DomUtil.TRANSFORM]=L.DomUtil.getTranslateString(a)+" scale("+i+")"}}),L.heatLayer=function(t,i){return new L.HeatLayer(t,i)};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{a as e}from"./CsohJ1Yu.js";import{H as t,M as r,P as n,j as o,r as l,v as i,z as s}from"./19c52mJB.js";import{F as c,T as a}from"./DARlVjtx.js";import{n as u}from"./CbFCHusy.js";import{t as d}from"./CNGkJRCP.js";import{t as f}from"./Da-TWV7Z.js";var m=[[90,-180],[-90,180]],p=[0,0],y=new u,h=e=>e||"#fb8500",g=({folderId:u,onExplore:g,logoUrl:x})=>{const b=o(null),v=o(null),w=o(null),L=o(null),z=o(null),B=o(null),T=o(null),j=o(!1),k=o(u??null),O=o(null),C=o(!1),S=o(()=>{}),F=o(!1),I=r(()=>(()=>{try{const e=sessionStorage.getItem(a);if(!e)return null;const t=JSON.parse(e);if("number"==typeof t?.center?.lat&&"number"==typeof t?.center?.lng&&"number"==typeof t?.zoom)return t}catch{}return null})(),[]),[Z,E]=n(!0),[N,$]=n(!1),{isFolderViewEnabled:A,activeFolderId:M,visibleEvents:R,visibleFolders:V,folderFeatureCollection:q,breadcrumb:J,isBusy:G,setActiveFolderId:H,goBack:P,activeFolder:W,folderBounds:_}=f({folderId:u});k.current=M,O.current=W,C.current=A,S.current=H;const U=()=>{const e=v.current,t=w.current;if(!e||!N||!t)return;const r=M??null,n=I?.folderId??null;if(!F.current&&I&&r===n)return void(F.current=!0);let o=null;if(_){const[e,r,n,l]=_;o=t.latLngBounds([[r,e],[l,n]])}o||(o=((e,t)=>{const r=e.latLngBounds([]);for(const n of t)"number"==typeof n.location?.x&&"number"==typeof n.location?.y&&r.extend([n.location.y,n.location.x]);return r.isValid()?r:null})(t,R)),o&&(j.current=!0,e.fitBounds(o,{paddingTopLeft:[12,88],paddingBottomRight:[12,24],maxZoom:14}),F.current=!0)};return s(()=>{if(!b.current||v.current)return;let t;return(async()=>{try{const r=await import("./CiA4qgsY.js").then(t=>/* @__PURE__ */e(t.default,1));"undefined"!=typeof window&&(window.L=r),await Promise.all([import("./OQ2IC54N.js").then(t=>/* @__PURE__ */e(t.default,1)),import("./BJ85RnFv.js")]);const n=window.L??r,o=r.latLngBounds(m);if(!b.current)return;const l=r.map(b.current,{center:I?.center?[I.center.lat??p[0],I.center.lng??p[1]]:p,zoom:I?.zoom??3,minZoom:3,zoomControl:!0,worldCopyJump:!1,maxBounds:o,maxBoundsViscosity:1});r.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:"© OpenStreetMap contributors",maxZoom:19,noWrap:!0}).addTo(l);const i="function"==typeof n.markerClusterGroup?n.markerClusterGroup({chunkedLoading:!0,showCoverageOnHover:!1,spiderfyOnMaxZoom:!0,maxClusterRadius:48,zoomToBoundsOnClick:!1}):r.layerGroup(),s=e=>{const t=e?.layer;t&&(C.current?t.spiderfy?.():t.zoomToBounds?.())},c="function"==typeof n.heatLayer?n.heatLayer([],{radius:30,blur:30,maxZoom:10,minOpacity:.35}):null;c?.addTo(l),i.addTo(l);const u=()=>{T.current&&clearTimeout(T.current),T.current=setTimeout(()=>{try{sessionStorage.setItem(a,JSON.stringify({center:l.getCenter(),zoom:l.getZoom(),folderId:k.current}))}catch{}},250)},d=()=>{if(j.current)return void(j.current=!1);if(!C.current)return;const e=O.current;if(!e?._id)return;const t=((e,t)=>{if(!t?.length)return null;const r=e.latLngBounds([]);for(const n of t)"number"==typeof n?.x&&"number"==typeof n?.y&&r.extend([n.y,n.x]);return r.isValid()?r:null})(n,e.boundary);if(!t)return;const r=l.getBoundsZoom(t,!1);l.getZoom()>=r-1||S.current(e.parentFolderId??null)};l.on("zoomend",u),l.on("moveend",u),l.on("zoomend",d),i.on?.("clusterclick",s),v.current=l,w.current=n,z.current=i,B.current=c;const f=()=>{l.invalidateSize(!1)};let y;"undefined"!=typeof ResizeObserver&&b.current&&(y=new ResizeObserver(f),y.observe(b.current)),requestAnimationFrame(f),$(!0),E(!1),t=()=>{y?.disconnect(),T.current&&(clearTimeout(T.current),T.current=null),l.off("zoomend",u),l.off("moveend",u),l.off("zoomend",d),i.off?.("clusterclick",s),l.remove(),w.current=null,v.current=null,L.current=null,z.current=null,B.current=null}}finally{E(!1)}})(),()=>{t?.()}},[I]),s(()=>{F.current=!1},[M]),s(()=>{if(!v.current||!N)return;const e=v.current,r=w.current;if(!r)return;B.current&&(A?(B.current.setLatLngs?.([]),e.hasLayer(B.current)&&e.removeLayer(B.current)):e.hasLayer(B.current)||B.current.addTo(e)),L.current&&(e.removeLayer(L.current),L.current=null),z.current?.clearLayers?.(),q.features.length>0&&(L.current=r.geoJSON(q,{style:e=>{const t=h(e?.properties?.color);return{color:t,weight:2,opacity:1,fillColor:t,fillOpacity:.22}},onEachFeature:(t,r)=>{const n=t.properties??{},o=String(n.name??"Folder"),l=h(n.color);r.bindTooltip(`<div style="font-size:12px;font-weight:700;color:${l};white-space:nowrap;">${o}</div>`,{permanent:!0,direction:"center",className:"qrati-folder-label",opacity:1}),r.on("click",()=>{const t=n.folderId;t&&("function"==typeof r.getBounds&&(j.current=!0,e.fitBounds(r.getBounds(),{paddingTopLeft:[12,88],paddingBottomRight:[12,24],maxZoom:14})),H(String(t)))}),r.on("mouseover",()=>{r.setStyle({fillOpacity:.4,weight:3}),e.getContainer().style.cursor="pointer"}),r.on("mouseout",()=>{r.setStyle({fillOpacity:.28,weight:2}),e.getContainer().style.cursor=""})},pointToLayer:(t,n)=>{const o=t.properties??{},l=String(o.name??"Folder"),i=h(o.color);return r.circleMarker(n,{color:i,weight:2,fillColor:i,fillOpacity:.22,radius:10}).bindTooltip(`<div style="font-size:12px;font-weight:700;color:${i};white-space:nowrap;">${l}</div>`,{permanent:!0,direction:"top",offset:[0,-8],className:"qrati-folder-label",opacity:1}).on("click",()=>{const t=o.folderId;t&&(j.current=!0,e.setView(n,Math.max(e.getZoom(),10),{animate:!0}),H(String(t)))})}}).addTo(e));const n=R.filter(e=>"number"==typeof e.location?.x&&"number"==typeof e.location?.y);if(n.length>0){if(n.map(e=>{const n=e.location.x,o=e.location.y,s=r.divIcon({className:"qrati-leaflet-marker-wrapper",html:`\n <div style="\n width: 36px;\n height: 36px;\n cursor: pointer;\n background: var(--primary, #ff4800);\n border-radius: 50% 50% 50% 0;\n transform: rotate(-45deg);\n border: 2px solid white;\n box-shadow: 0 2px 8px rgba(0,0,0,0.3);\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n ">${x?`<img src="${x}" style="width: 24px; height: 24px; border-radius: 50%; object-fit: cover; transform: rotate(45deg);" />`:""}</div>\n `,iconSize:[36,36],iconAnchor:[18,36],popupAnchor:[0,-36]}),a=r.marker([o,n],{icon:s}),u=document.createElement("div");return u.style.width="fit-content",((e,r,n)=>{t(/* @__PURE__ */i(c,{client:y,children:/* @__PURE__ */i(l,{children:/* @__PURE__ */i(d,{event:e,onExplore:n})})}),r)})(e,u,g),a.bindPopup(u,{closeButton:!0,maxWidth:256}),a}).forEach(e=>z.current?.addLayer?.(e)),B.current&&!A){const e=[];n.forEach(t=>{const r=t.location.x,n=t.location.y,o="number"==typeof t.views&&t.views>0?t.views:1;e.push([n,r,o])});const t=n.reduce((e,t)=>{const r="number"==typeof t.views&&t.views>0?t.views:1;return r>e?r:e},1);B.current.setOptions?.({radius:30,blur:30,maxZoom:10,minOpacity:.35,max:t}),B.current.setLatLngs?.(e)}}else B.current?.setLatLngs?.([]);U()},[M,q,R,N,H,g,x,A]),s(()=>{U()},[M,_,N,R]),/* @__PURE__ */i("div",{class:"relative h-screen w-full sm:h-[calc(100vh-4rem)]",children:[
|
|
2
|
+
/* @__PURE__ */i("div",{class:"absolute top-4 left-4 z-200 flex w-[min(96%,420px)] flex-col gap-2 rounded-xl border border-slate-200 bg-white/95 p-3 shadow-lg backdrop-blur-sm",children:[/* @__PURE__ */i("div",{class:"flex items-center justify-between gap-3",children:[/* @__PURE__ */i("div",{children:[/* @__PURE__ */i("div",{class:"text-sm font-semibold text-slate-900",children:W?.name??"Home"}),/* @__PURE__ */i("div",{class:"text-xs text-slate-600",children:["Tap a folder region to drill into its contents. ",V?.length??0," folder",1===V?.length?"":"s",", ",R.length," event",1===R.length?"":"s"," total"]})]}),M&&/* @__PURE__ */i("button",{type:"button",onClick:P,class:"rounded bg-slate-100 px-3 py-1 text-xs font-semibold text-slate-700 hover:bg-slate-200",children:"Back"})]}),J.length>0&&/* @__PURE__ */i("div",{class:"flex flex-wrap gap-1 text-xs text-slate-500",children:[/* @__PURE__ */i("span",{children:"All folders"}),J.map(e=>/* @__PURE__ */i("span",{class:"inline-flex items-center gap-1",children:[/* @__PURE__ */i("span",{class:"text-slate-300",children:"/"}),/* @__PURE__ */i("span",{children:e.name})]},e._id))]})]}),G&&/* @__PURE__ */i("div",{class:"absolute inset-0 z-10 flex items-center justify-center bg-white/70",children:/* @__PURE__ */i("div",{class:"border-primary flex h-12 w-12 animate-spin items-center justify-center rounded-full border-4 border-t-transparent"})}),Z&&/* @__PURE__ */i("div",{class:"absolute inset-0 z-20 flex items-center justify-center bg-white/85",children:/* @__PURE__ */i("div",{class:"flex flex-col items-center gap-3",children:[/* @__PURE__ */i("div",{class:"border-primary size-10 animate-spin rounded-full border-4 border-t-transparent"}),/* @__PURE__ */i("p",{class:"text-sm font-medium text-slate-700",children:"Loading map…"})]})}),
|
|
3
|
+
/* @__PURE__ */i("div",{ref:b,class:"h-full w-full rounded-xl border border-slate-200"})]})};export{g as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{H as e,j as n,r as t,v as r,z as o}from"./19c52mJB.js";import{t as a}from"./
|
|
1
|
+
import{H as e,j as n,r as t,v as r,z as o}from"./19c52mJB.js";import{t as a}from"./CNGkJRCP.js";var i=(n,o,i)=>{e(/* @__PURE__ */r(t,{children:/* @__PURE__ */r(a,{event:n,onExplore:i})}),o)},s=({events:e,apiKey:t,onExplore:a,logoUrl:s})=>{const l=n(null),c=n(null);return o(()=>{if(l.current&&!c.current)return(async()=>{const{setOptions:n,importLibrary:r}=await import("./CjmNvKgB.js");n({key:t,v:"weekly"}),await Promise.all([r("maps"),r("marker")]);const o=window.google.maps;if(!l.current)return;const d=new o.Map(l.current,{mapId:"DEMO_MAP_ID",renderingType:"VECTOR",mapTypeId:"roadmap",center:{lat:20,lng:0},zoom:2,mapTypeControl:!1,streetViewControl:!1});o.event.addListenerOnce(d,"idle",()=>{d.getRenderingType?.()!==o.RenderingType?.VECTOR&&console.warn("Google Maps fell back to raster rendering; globe view is unavailable in raster mode.")}),c.current=d;const p=e.filter(e=>"number"==typeof e.location?.x&&"number"==typeof e.location?.y);if(0===p.length)return;const m=new o.LatLngBounds,u=new o.InfoWindow({maxWidth:200});for(const e of p){const n=e.location.x,t={lat:e.location.y,lng:n};m.extend(t);const r=document.createElement("div");if(r.style.cssText="\n width: 36px; height: 36px; cursor: pointer;\n background: var(--primary, #ff4800);\n border-radius: 50% 50% 50% 0;\n transform: rotate(-45deg);\n border: 2px solid white;\n box-shadow: 0 2px 8px rgba(0,0,0,0.3);\n display: flex; align-items: center; justify-content: center; overflow: hidden;\n ",s){const e=document.createElement("img");e.src=s,e.style.cssText="width: 24px; height: 24px; border-radius: 50%; object-fit: cover; transform: rotate(45deg);",r.appendChild(e)}const l=new o.marker.AdvancedMarkerElement({map:d,position:t,content:r,gmpClickable:!0});l.addListener("click",()=>{const n=document.createElement("div");i(e,n,a),u.close(),u.setContent(n),u.open(d,l)})}d.fitBounds(m)})(),()=>{c.current=null}},[t]),/* @__PURE__ */r("div",{ref:l,class:"size-full"})};export{s as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{a as e}from"./CsohJ1Yu.js";import{H as t,P as r,j as o,r as n,v as s,z as l}from"./19c52mJB.js";import{F as a}from"./DARlVjtx.js";import{n as i}from"./CbFCHusy.js";import{t as c}from"./
|
|
1
|
+
import{a as e}from"./CsohJ1Yu.js";import{H as t,P as r,j as o,r as n,v as s,z as l}from"./19c52mJB.js";import{F as a}from"./DARlVjtx.js";import{n as i}from"./CbFCHusy.js";import{t as c}from"./CNGkJRCP.js";import{t as d}from"./Da-TWV7Z.js";var u=new i,f=(e,r,o)=>{t(/* @__PURE__ */s(a,{client:u,children:/* @__PURE__ */s(n,{children:/* @__PURE__ */s(c,{event:e,onExplore:o})})}),r)},p=({folderId:t,onExplore:n,apiKey:a,is3D:i,logoUrl:c})=>{const u=o(null),p=o(null),m=o(null),h=o(null),[b,x]=r(!1),{activeFolderId:v,visibleFolders:g,visibleEvents:y,folderFeatureCollection:w,breadcrumb:k,isBusy:j,setActiveFolderId:L,goBack:C,activeFolder:F,folderBounds:B}=d({folderId:t}),S=y?.filter(e=>"number"==typeof e.location?.x&&"number"==typeof e.location?.y);return l(()=>{if(!u.current||p.current)return;let t;return(async()=>{const r=(await import("./C1E5jOn8.js").then(t=>/* @__PURE__ */e(t.default,1))).default;if(!document.querySelector("link[data-qrati-mapbox-css]")){const e=document.createElement("link");e.rel="stylesheet",e.href="https://unpkg.com/mapbox-gl@3.20.0/dist/mapbox-gl.css",e.setAttribute("data-qrati-mapbox-css",""),document.head.appendChild(e)}if(!u.current)return;r.accessToken=a;const o=new r.Map({container:u.current,style:"mapbox://styles/mapbox/streets-v12",center:[0,20],zoom:3,minZoom:2,pitch:i?30:0,bearing:i?-20:0,antialias:!0});p.current=o,o.on("load",()=>{if(0===S.length)return;const e=new r.LngLatBounds;for(const s of S){const t=s.location.x,l=s.location.y;e.extend([t,l]);const a=document.createElement("div");if(a.style.cssText="\n width: 36px; height: 36px; cursor: pointer;\n background: var(--primary, #ff4800);\n border-radius: 50% 50% 50% 0;\n transform: rotate(-45deg);\n border: 2px solid white;\n box-shadow: 0 2px 8px rgba(0,0,0,0.3);\n display: flex; align-items: center; justify-content: center; overflow: hidden;\n ",c){const e=document.createElement("img");e.src=c,e.style.cssText="width: 24px; height: 24px; border-radius: 50%; object-fit: cover; transform: rotate(45deg);",a.appendChild(e)}const i=document.createElement("div");f(s,i,n);const d=new r.Popup({closeButton:!0,closeOnClick:!1,maxWidth:"none",offset:[0,-20]}).setDOMContent(i);new r.Marker({element:a}).setLngLat([t,l]).setPopup(d).addTo(o)}e.isEmpty()||o.fitBounds(e,{padding:60,maxZoom:14,duration:1200}),x(!0),o.addSource("folder-areas",{type:"geojson",data:w}),o.addLayer({id:"folder-fill",type:"fill",source:"folder-areas",paint:{"fill-color":["case",["boolean",["feature-state","hover"],!1],"#ffb703","#ffb703"],"fill-opacity":.28}}),o.addLayer({id:"folder-border",type:"line",source:"folder-areas",paint:{"line-color":["case",["boolean",["feature-state","hover"],!1],"#fb8500","#fb8500"],"line-width":["case",["boolean",["feature-state","hover"],!1],3,2]}}),o.addLayer({id:"folder-point",type:"circle",source:"folder-areas",filter:["==",["geometry-type"],"Point"],paint:{"circle-radius":10,"circle-color":["case",["boolean",["feature-state","hover"],!1],"#fb8500","#ffb703"],"circle-stroke-color":"#fff","circle-stroke-width":2}}),o.on("mousemove","folder-fill",e=>{const t=e.features?.[0];if(!t)return;const n=String(t.properties?.folderId);h.current!==n&&(h.current&&o.setFeatureState({source:"folder-areas",id:h.current},{hover:!1}),h.current=n,o.setFeatureState({source:"folder-areas",id:n},{hover:!0})),o.getCanvas().style.cursor="pointer",((e,t)=>{const n=e.properties??{},s=String(n.name??"Folder"),l=Number(n.eventCount??0);m.current||(m.current=new r.Popup({closeButton:!1,closeOnClick:!1,offset:12})),m.current.setLngLat(t).setHTML(`<div class='text-sm font-semibold text-slate-900'>${s}</div><div class='text-xs text-slate-700'>${l} event${1===l?"":"s"}</div>`).addTo(o)})(t,e.lngLat)}),o.on("mouseleave","folder-fill",()=>{h.current&&(o.setFeatureState({source:"folder-areas",id:h.current},{hover:!1}),h.current=null,m.current?.remove()),o.getCanvas().style.cursor=""});const t=e=>{const t=(e.features?.[0])?.properties?.folderId;t&&L(String(t))};o.on("click","folder-fill",t),o.on("click","folder-border",t),o.on("click","folder-point",t)}),t=()=>{o.remove(),p.current=null,m.current=null}})(),()=>{t?.()}},[a,i,n,L]),l(()=>{if(!p.current||!b)return;const e=p.current;try{e.getSource("folder-areas")?.setData(w)}catch{}},[w,b]),l(()=>{(()=>{const e=p.current;if(!e||!b)return;const t=B;if(!t)return;const[r,o,n,s]=t;e.fitBounds([[r,o],[n,s]],{padding:72,duration:800,maxZoom:14})})()},[B,b]),l(()=>{p.current&&p.current.easeTo({pitch:i?30:0,bearing:i?-20:0,duration:800})},[i]),/* @__PURE__ */s("div",{class:"relative h-screen w-full sm:h-[calc(100vh-4rem)]",children:[
|
|
2
2
|
/* @__PURE__ */s("div",{class:"absolute top-4 left-4 z-20 flex w-[min(96%,420px)] flex-col gap-2 rounded-xl border border-slate-200 bg-white/95 p-3 shadow-lg backdrop-blur-sm",children:[/* @__PURE__ */s("div",{class:"flex items-center justify-between gap-3",children:[/* @__PURE__ */s("div",{children:[/* @__PURE__ */s("div",{class:"text-sm font-semibold text-slate-900",children:F?.name??"Home"}),/* @__PURE__ */s("div",{class:"text-xs text-slate-600",children:["Tap a folder region to drill into its contents. ",g?.length??0," folder",1===g?.length?"":"s",", ",S.length," event",1===S.length?"":"s"," total"]})]}),v&&/* @__PURE__ */s("button",{type:"button",onClick:C,class:"rounded bg-slate-100 px-3 py-1 text-xs font-semibold text-slate-700 hover:bg-slate-200",children:"Back"})]}),k.length>0&&/* @__PURE__ */s("div",{class:"flex flex-wrap gap-1 text-xs text-slate-500",children:[/* @__PURE__ */s("span",{children:"All folders"}),k.map(e=>/* @__PURE__ */s("span",{class:"inline-flex items-center gap-1",children:[/* @__PURE__ */s("span",{class:"text-slate-300",children:"/"}),/* @__PURE__ */s("span",{children:e.name})]},e._id))]})]}),j&&/* @__PURE__ */s("div",{class:"absolute inset-0 z-10 flex items-center justify-center bg-white/70",children:/* @__PURE__ */s("div",{class:"border-primary flex h-12 w-12 animate-spin items-center justify-center rounded-full border-4 border-t-transparent"})}),
|
|
3
3
|
/* @__PURE__ */s("div",{ref:u,class:"h-full w-full rounded-xl border border-slate-200"})]})};export{p as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./CsohJ1Yu.js";import{H as t,j as r,r as n,v as o,z as i}from"./19c52mJB.js";import{t as a}from"./
|
|
1
|
+
import{a as e}from"./CsohJ1Yu.js";import{H as t,j as r,r as n,v as o,z as i}from"./19c52mJB.js";import{t as a}from"./CNGkJRCP.js";var s=(e,r,i)=>{t(/* @__PURE__ */o(n,{children:/* @__PURE__ */o(a,{event:e,onExplore:i})}),r)},l=({events:t,apiKey:n,is3D:a,onExplore:l,logoUrl:c})=>{const d=r(null),u=r(null),p=r(a);return i(()=>{if(!d.current||u.current)return;let r;return(async()=>{const o=(await import("./BTZXR2Ef.js").then(t=>/* @__PURE__ */e(t.default,1))).default;if(!document.querySelector("link[data-qrati-maplibre-css]")){const e=document.createElement("link");e.rel="stylesheet",e.href="https://unpkg.com/maplibre-gl@5.21.0/dist/maplibre-gl.css",e.setAttribute("data-qrati-maplibre-css",""),document.head.appendChild(e)}if(!d.current)return;const i=new o.Map({container:d.current,style:`https://api.maptiler.com/maps/streets-v2/style.json?key=${n}`,center:[0,20],zoom:4,minZoom:2,pitch:0,bearing:0,projection:p.current?{type:"globe"}:{type:"mercator"},canvasContextAttributes:{antialias:!0}});u.current=i,i.on("load",()=>{const e=i.getStyle()?.layers??[];let r,n;for(const t of e){const e=t;"symbol"===e.type&&e.layout?.["text-field"]&&!r&&(r=t.id),"building"!==e["source-layer"]||n||(n=e.source)}n&&!i.getLayer("3d-buildings")&&i.addLayer({id:"3d-buildings",source:n,"source-layer":"building",filter:["has","render_height"],type:"fill-extrusion",minzoom:14,paint:{"fill-extrusion-color":["interpolate",["linear"],["get","render_height"],0,"lightgray",200,"royalblue",400,"lightblue"],"fill-extrusion-height":["interpolate",["linear"],["zoom"],14,0,15,["get","render_height"]],"fill-extrusion-base":["case",["has","render_min_height"],["get","render_min_height"],0],"fill-extrusion-opacity":.6}},r);const a=t.filter(e=>"number"==typeof e.location?.x&&"number"==typeof e.location?.y);if(0===a.length)return;const d=new o.LngLatBounds;for(const t of a){const e=t.location.x,r=t.location.y;d.extend([e,r]);const n=document.createElement("div");if(n.className="qrati-map-marker",n.style.cssText="\n width: 36px; height: 36px; cursor: pointer;\n background: var(--primary, #ff4800);\n border-radius: 50% 50% 50% 0;\n transform: rotate(-45deg);\n border: 2px solid white;\n box-shadow: 0 2px 8px rgba(0,0,0,0.3);\n display: flex; align-items: center; justify-content: center; overflow: hidden;\n ",c){const e=document.createElement("img");e.src=c,e.style.cssText="width: 24px; height: 24px; border-radius: 50%; object-fit: cover; transform: rotate(45deg);",n.appendChild(e)}const a=document.createElement("div");s(t,a,l);const u=new o.Popup({closeButton:!0,closeOnClick:!1,maxWidth:"none",offset:[0,-34]}).setDOMContent(a);new o.Marker({element:n}).setLngLat([e,r]).setPopup(u).addTo(i)}d.isEmpty()||i.fitBounds(d,{padding:{top:60,bottom:60,left:60,right:60},maxZoom:14,animate:!0,duration:1200})}),r=()=>{i.remove(),u.current=null}})(),()=>{r?.()}},[n]),i(()=>{u.current&&(p.current=a,u.current.setProjection(a?{type:"globe"}:{type:"mercator"}),u.current.easeTo({pitch:0,bearing:0,duration:600}))},[a]),/* @__PURE__ */o("div",{ref:d,class:"size-full"})};export{l as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{A as e,u as t,v as r,w as o}from"./19c52mJB.js";import{E as s,n as l}from"./DARlVjtx.js";var i=e(()=>import("./
|
|
1
|
+
import{A as e,u as t,v as r,w as o}from"./19c52mJB.js";import{E as s,n as l}from"./DARlVjtx.js";var i=e(()=>import("./C2UaAEQP.js")),n=e(()=>import("./FXirOp_Y.js")),a=e(()=>import("./CMtkKIjI.js")),c=e(()=>import("./DQpjw80t.js")),d=({events:e,isLoading:d=!1})=>{const{organization:p}=l(),m=t(),g=p?.integrationSettings??{},x=g.mapProvider??"openstreetmap",u=g.mapTilerApiKey??"",f=g.googleMapsApiKey??"",h=g.mapboxApiKey??"",v=e.filter(e=>"number"==typeof e.location?.x&&"number"==typeof e.location?.y),y="openstreetmap"===x&&!u||"google"===x&&!f||"mapbox"===x&&!h,w=e=>{m(s.GALLERY(e))};/* @__PURE__ */
|
|
2
2
|
return r("div",{class:"w relative mt-3 h-screen sm:mt-6",children:d?/* @__PURE__ */r("div",{class:"flex h-full items-center justify-center",children:/* @__PURE__ */r("div",{class:"border-primary bt-transparent size-8 animate-spin rounded-full"})}):y?/* @__PURE__ */r("div",{class:"flex h-full items-center justify-center",children:/* @__PURE__ */r("div",{class:"text-center",children:[
|
|
3
3
|
/* @__PURE__ */r("svg",{xmlns:"http://www.w3.org/2000/svg",class:"text-muted-foreground mx-auto mb-3 size-10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5",children:[/* @__PURE__ */r("path",{d:"M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7z"}),/* @__PURE__ */r("circle",{cx:"12",cy:"9",r:"2.5"})]}),
|
|
4
4
|
/* @__PURE__ */r("p",{class:"text-foreground",children:"API key is required to display the map."}),
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./CsohJ1Yu.js";var t=/* @__PURE__ */e((e,t)=>{var i,r;i=e,r=function(e){var t=L.MarkerClusterGroup=L.FeatureGroup.extend({options:{maxClusterRadius:80,iconCreateFunction:null,clusterPane:L.Marker.prototype.options.pane,spiderfyOnEveryZoom:!1,spiderfyOnMaxZoom:!0,showCoverageOnHover:!0,zoomToBoundsOnClick:!0,singleMarkerMode:!1,disableClusteringAtZoom:null,removeOutsideVisibleBounds:!0,animate:!0,animateAddingMarkers:!1,spiderfyShapePositions:null,spiderfyDistanceMultiplier:1,spiderLegPolylineOptions:{weight:1.5,color:"#222",opacity:.5},chunkedLoading:!1,chunkInterval:200,chunkDelay:50,chunkProgress:null,polygonOptions:{}},initialize:function(e){L.Util.setOptions(this,e),this.options.iconCreateFunction||(this.options.iconCreateFunction=this._defaultIconCreateFunction),this._featureGroup=L.featureGroup(),this._featureGroup.addEventParent(this),this._nonPointGroup=L.featureGroup(),this._nonPointGroup.addEventParent(this),this._inZoomAnimation=0,this._needsClustering=[],this._needsRemoving=[],this._currentShownBounds=null,this._queue=[],this._childMarkerEventHandlers={dragstart:this._childMarkerDragStart,move:this._childMarkerMoved,dragend:this._childMarkerDragEnd};var t=L.DomUtil.TRANSITION&&this.options.animate;L.extend(this,t?this._withAnimation:this._noAnimation),this._markerCluster=t?L.MarkerCluster:L.MarkerClusterNonAnimated},addLayer:function(e){if(e instanceof L.LayerGroup)return this.addLayers([e]);if(!e.getLatLng)return this._nonPointGroup.addLayer(e),this.fire("layeradd",{layer:e}),this;if(!this._map)return this._needsClustering.push(e),this.fire("layeradd",{layer:e}),this;if(this.hasLayer(e))return this;this._unspiderfy&&this._unspiderfy(),this._addLayer(e,this._maxZoom),this.fire("layeradd",{layer:e}),this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons();var t=e,i=this._zoom;if(e.__parent)for(;t.__parent._zoom>=i;)t=t.__parent;return this._currentShownBounds.contains(t.getLatLng())&&(this.options.animateAddingMarkers?this._animationAddLayer(e,t):this._animationAddLayerNonAnimated(e,t)),this},removeLayer:function(e){return e instanceof L.LayerGroup?this.removeLayers([e]):e.getLatLng?this._map?e.__parent?(this._unspiderfy&&(this._unspiderfy(),this._unspiderfyLayer(e)),this._removeLayer(e,!0),this.fire("layerremove",{layer:e}),this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),e.off(this._childMarkerEventHandlers,this),this._featureGroup.hasLayer(e)&&(this._featureGroup.removeLayer(e),e.clusterShow&&e.clusterShow()),this):this:(!this._arraySplice(this._needsClustering,e)&&this.hasLayer(e)&&this._needsRemoving.push({layer:e,latlng:e._latlng}),this.fire("layerremove",{layer:e}),this):(this._nonPointGroup.removeLayer(e),this.fire("layerremove",{layer:e}),this)},addLayers:function(e,t){if(!L.Util.isArray(e))return this.addLayer(e);var i,r=this._featureGroup,n=this._nonPointGroup,s=this.options.chunkedLoading,o=this.options.chunkInterval,a=this.options.chunkProgress,h=e.length,l=0,u=!0;if(this._map){var _=/* @__PURE__ */(new Date).getTime(),d=L.bind(function(){var p=/* @__PURE__ */(new Date).getTime();for(this._map&&this._unspiderfy&&this._unspiderfy();l<h&&!(s&&l%200==0&&/* @__PURE__ */(new Date).getTime()-p>o);l++)if((i=e[l])instanceof L.LayerGroup)u&&(e=e.slice(),u=!1),this._extractNonGroupLayers(i,e),h=e.length;else if(i.getLatLng){if(!this.hasLayer(i)&&(this._addLayer(i,this._maxZoom),t||this.fire("layeradd",{layer:i}),i.__parent&&2===i.__parent.getChildCount())){var c=i.__parent.getAllChildMarkers(),f=c[0]===i?c[1]:c[0];r.removeLayer(f)}}else n.addLayer(i),t||this.fire("layeradd",{layer:i});a&&a(l,h,/* @__PURE__ */(new Date).getTime()-_),l===h?(this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds)):setTimeout(d,this.options.chunkDelay)},this);d()}else for(var p=this._needsClustering;l<h;l++)(i=e[l])instanceof L.LayerGroup?(u&&(e=e.slice(),u=!1),this._extractNonGroupLayers(i,e),h=e.length):i.getLatLng?this.hasLayer(i)||p.push(i):n.addLayer(i);return this},removeLayers:function(e){var t,i,r=e.length,n=this._featureGroup,s=this._nonPointGroup,o=!0;if(!this._map){for(t=0;t<r;t++)(i=e[t])instanceof L.LayerGroup?(o&&(e=e.slice(),o=!1),this._extractNonGroupLayers(i,e),r=e.length):(this._arraySplice(this._needsClustering,i),s.removeLayer(i),this.hasLayer(i)&&this._needsRemoving.push({layer:i,latlng:i._latlng}),this.fire("layerremove",{layer:i}));return this}if(this._unspiderfy){this._unspiderfy();var a=e.slice(),h=r;for(t=0;t<h;t++)(i=a[t])instanceof L.LayerGroup?(this._extractNonGroupLayers(i,a),h=a.length):this._unspiderfyLayer(i)}for(t=0;t<r;t++)(i=e[t])instanceof L.LayerGroup?(o&&(e=e.slice(),o=!1),this._extractNonGroupLayers(i,e),r=e.length):i.__parent?(this._removeLayer(i,!0,!0),this.fire("layerremove",{layer:i}),n.hasLayer(i)&&(n.removeLayer(i),i.clusterShow&&i.clusterShow())):(s.removeLayer(i),this.fire("layerremove",{layer:i}));return this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds),this},clearLayers:function(){return this._map||(this._needsClustering=[],this._needsRemoving=[],delete this._gridClusters,delete this._gridUnclustered),this._noanimationUnspiderfy&&this._noanimationUnspiderfy(),this._featureGroup.clearLayers(),this._nonPointGroup.clearLayers(),this.eachLayer(function(e){e.off(this._childMarkerEventHandlers,this),delete e.__parent},this),this._map&&this._generateInitialClusters(),this},getBounds:function(){var e=new L.LatLngBounds;this._topClusterLevel&&e.extend(this._topClusterLevel._bounds);for(var t=this._needsClustering.length-1;t>=0;t--)e.extend(this._needsClustering[t].getLatLng());return e.extend(this._nonPointGroup.getBounds()),e},eachLayer:function(e,t){var i,r,n,s=this._needsClustering.slice(),o=this._needsRemoving;for(this._topClusterLevel&&this._topClusterLevel.getAllChildMarkers(s),r=s.length-1;r>=0;r--){for(i=!0,n=o.length-1;n>=0;n--)if(o[n].layer===s[r]){i=!1;break}i&&e.call(t,s[r])}this._nonPointGroup.eachLayer(e,t)},getLayers:function(){var e=[];return this.eachLayer(function(t){e.push(t)}),e},getLayer:function(e){var t=null;return e=parseInt(e,10),this.eachLayer(function(i){L.stamp(i)===e&&(t=i)}),t},hasLayer:function(e){if(!e)return!1;var t,i=this._needsClustering;for(t=i.length-1;t>=0;t--)if(i[t]===e)return!0;for(t=(i=this._needsRemoving).length-1;t>=0;t--)if(i[t].layer===e)return!1;return!(!e.__parent||e.__parent._group!==this)||this._nonPointGroup.hasLayer(e)},zoomToShowLayer:function(e,t){var i=this._map;"function"!=typeof t&&(t=function(){});var r=function(){!i.hasLayer(e)&&!i.hasLayer(e.__parent)||this._inZoomAnimation||(this._map.off("moveend",r,this),this.off("animationend",r,this),i.hasLayer(e)?t():e.__parent._icon&&(this.once("spiderfied",t,this),e.__parent.spiderfy()))};e._icon&&this._map.getBounds().contains(e.getLatLng())?t():e.__parent._zoom<Math.round(this._map._zoom)?(this._map.on("moveend",r,this),this._map.panTo(e.getLatLng())):(this._map.on("moveend",r,this),this.on("animationend",r,this),e.__parent.zoomToBounds())},onAdd:function(e){var t,i,r;if(this._map=e,!isFinite(this._map.getMaxZoom()))throw"Map has no maxZoom specified";for(this._featureGroup.addTo(e),this._nonPointGroup.addTo(e),this._gridClusters||this._generateInitialClusters(),this._maxLat=e.options.crs.projection.MAX_LATITUDE,t=0,i=this._needsRemoving.length;t<i;t++)(r=this._needsRemoving[t]).newlatlng=r.layer._latlng,r.layer._latlng=r.latlng;for(t=0,i=this._needsRemoving.length;t<i;t++)r=this._needsRemoving[t],this._removeLayer(r.layer,!0),r.layer._latlng=r.newlatlng;this._needsRemoving=[],this._zoom=Math.round(this._map._zoom),this._currentShownBounds=this._getExpandedVisibleBounds(),this._map.on("zoomend",this._zoomEnd,this),this._map.on("moveend",this._moveEnd,this),this._spiderfierOnAdd&&this._spiderfierOnAdd(),this._bindEvents(),i=this._needsClustering,this._needsClustering=[],this.addLayers(i,!0)},onRemove:function(e){e.off("zoomend",this._zoomEnd,this),e.off("moveend",this._moveEnd,this),this._unbindEvents(),this._map._mapPane.className=this._map._mapPane.className.replace(" leaflet-cluster-anim",""),this._spiderfierOnRemove&&this._spiderfierOnRemove(),delete this._maxLat,this._hideCoverage(),this._featureGroup.remove(),this._nonPointGroup.remove(),this._featureGroup.clearLayers(),this._map=null},getVisibleParent:function(e){for(var t=e;t&&!t._icon;)t=t.__parent;return t||null},_arraySplice:function(e,t){for(var i=e.length-1;i>=0;i--)if(e[i]===t)return e.splice(i,1),!0},_removeFromGridUnclustered:function(e,t){for(var i=this._map,r=this._gridUnclustered,n=Math.floor(this._map.getMinZoom());t>=n&&r[t].removeObject(e,i.project(e.getLatLng(),t));t--);},_childMarkerDragStart:function(e){e.target.__dragStart=e.target._latlng},_childMarkerMoved:function(e){if(!this._ignoreMove&&!e.target.__dragStart){var t=e.target._popup&&e.target._popup.isOpen();this._moveChild(e.target,e.oldLatLng,e.latlng),t&&e.target.openPopup()}},_moveChild:function(e,t,i){e._latlng=t,this.removeLayer(e),e._latlng=i,this.addLayer(e)},_childMarkerDragEnd:function(e){var t=e.target.__dragStart;delete e.target.__dragStart,t&&this._moveChild(e.target,t,e.target._latlng)},_removeLayer:function(e,t,i){var r=this._gridClusters,n=this._gridUnclustered,s=this._featureGroup,o=this._map,a=Math.floor(this._map.getMinZoom());t&&this._removeFromGridUnclustered(e,this._maxZoom);var h,l=e.__parent,u=l._markers;for(this._arraySplice(u,e);l&&(l._childCount--,l._boundsNeedUpdate=!0,!(l._zoom<a));)t&&l._childCount<=1?(h=l._markers[0]===e?l._markers[1]:l._markers[0],r[l._zoom].removeObject(l,o.project(l._cLatLng,l._zoom)),n[l._zoom].addObject(h,o.project(h.getLatLng(),l._zoom)),this._arraySplice(l.__parent._childClusters,l),l.__parent._markers.push(h),h.__parent=l.__parent,l._icon&&(s.removeLayer(l),i||s.addLayer(h))):l._iconNeedsUpdate=!0,l=l.__parent;delete e.__parent},_isOrIsParent:function(e,t){for(;t;){if(e===t)return!0;t=t.parentNode}return!1},fire:function(e,t,i){if(t&&t.layer instanceof L.MarkerCluster){if(t.originalEvent&&this._isOrIsParent(t.layer._icon,t.originalEvent.relatedTarget))return;e="cluster"+e}L.FeatureGroup.prototype.fire.call(this,e,t,i)},listens:function(e,t){return L.FeatureGroup.prototype.listens.call(this,e,t)||L.FeatureGroup.prototype.listens.call(this,"cluster"+e,t)},_defaultIconCreateFunction:function(e){var t=e.getChildCount(),i=" marker-cluster-";return i+=t<10?"small":t<100?"medium":"large",new L.DivIcon({html:"<div><span>"+t+"</span></div>",className:"marker-cluster"+i,iconSize:new L.Point(40,40)})},_bindEvents:function(){var e=this._map,t=this.options.spiderfyOnMaxZoom,i=this.options.showCoverageOnHover,r=this.options.zoomToBoundsOnClick,n=this.options.spiderfyOnEveryZoom;(t||r||n)&&this.on("clusterclick clusterkeypress",this._zoomOrSpiderfy,this),i&&(this.on("clustermouseover",this._showCoverage,this),this.on("clustermouseout",this._hideCoverage,this),e.on("zoomend",this._hideCoverage,this))},_zoomOrSpiderfy:function(e){var t=e.layer,i=t;if("clusterkeypress"!==e.type||!e.originalEvent||13===e.originalEvent.keyCode){for(;1===i._childClusters.length;)i=i._childClusters[0];i._zoom===this._maxZoom&&i._childCount===t._childCount&&this.options.spiderfyOnMaxZoom?t.spiderfy():this.options.zoomToBoundsOnClick&&t.zoomToBounds(),this.options.spiderfyOnEveryZoom&&t.spiderfy(),e.originalEvent&&13===e.originalEvent.keyCode&&this._map._container.focus()}},_showCoverage:function(e){var t=this._map;this._inZoomAnimation||(this._shownPolygon&&t.removeLayer(this._shownPolygon),e.layer.getChildCount()>2&&e.layer!==this._spiderfied&&(this._shownPolygon=new L.Polygon(e.layer.getConvexHull(),this.options.polygonOptions),t.addLayer(this._shownPolygon)))},_hideCoverage:function(){this._shownPolygon&&(this._map.removeLayer(this._shownPolygon),this._shownPolygon=null)},_unbindEvents:function(){var e=this.options.spiderfyOnMaxZoom,t=this.options.showCoverageOnHover,i=this.options.zoomToBoundsOnClick,r=this.options.spiderfyOnEveryZoom,n=this._map;(e||i||r)&&this.off("clusterclick clusterkeypress",this._zoomOrSpiderfy,this),t&&(this.off("clustermouseover",this._showCoverage,this),this.off("clustermouseout",this._hideCoverage,this),n.off("zoomend",this._hideCoverage,this))},_zoomEnd:function(){this._map&&(this._mergeSplitClusters(),this._zoom=Math.round(this._map._zoom),this._currentShownBounds=this._getExpandedVisibleBounds())},_moveEnd:function(){if(!this._inZoomAnimation){var e=this._getExpandedVisibleBounds();this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),this._zoom,e),this._topClusterLevel._recursivelyAddChildrenToMap(null,Math.round(this._map._zoom),e),this._currentShownBounds=e}},_generateInitialClusters:function(){var e=Math.ceil(this._map.getMaxZoom()),t=Math.floor(this._map.getMinZoom()),i=this.options.maxClusterRadius,r=i;"function"!=typeof i&&(r=function(){return i}),null!==this.options.disableClusteringAtZoom&&(e=this.options.disableClusteringAtZoom-1),this._maxZoom=e,this._gridClusters={},this._gridUnclustered={};for(var n=e;n>=t;n--)this._gridClusters[n]=new L.DistanceGrid(r(n)),this._gridUnclustered[n]=new L.DistanceGrid(r(n));this._topClusterLevel=new this._markerCluster(this,t-1)},_addLayer:function(e,t){var i,r,n=this._gridClusters,s=this._gridUnclustered,o=Math.floor(this._map.getMinZoom());for(this.options.singleMarkerMode&&this._overrideMarkerIcon(e),e.on(this._childMarkerEventHandlers,this);t>=o;t--){i=this._map.project(e.getLatLng(),t);var a=n[t].getNearObject(i);if(a)return a._addChild(e),void(e.__parent=a);if(a=s[t].getNearObject(i)){var h=a.__parent;h&&this._removeLayer(a,!1);var l=new this._markerCluster(this,t,a,e);n[t].addObject(l,this._map.project(l._cLatLng,t)),a.__parent=l,e.__parent=l;var u=l;for(r=t-1;r>h._zoom;r--)u=new this._markerCluster(this,r,u),n[r].addObject(u,this._map.project(a.getLatLng(),r));return h._addChild(u),void this._removeFromGridUnclustered(a,t)}s[t].addObject(e,i)}this._topClusterLevel._addChild(e),e.__parent=this._topClusterLevel},_refreshClustersIcons:function(){this._featureGroup.eachLayer(function(e){e instanceof L.MarkerCluster&&e._iconNeedsUpdate&&e._updateIcon()})},_enqueue:function(e){this._queue.push(e),this._queueTimeout||(this._queueTimeout=setTimeout(L.bind(this._processQueue,this),300))},_processQueue:function(){for(var e=0;e<this._queue.length;e++)this._queue[e].call(this);this._queue.length=0,clearTimeout(this._queueTimeout),this._queueTimeout=null},_mergeSplitClusters:function(){var e=Math.round(this._map._zoom);this._processQueue(),this._zoom<e&&this._currentShownBounds.intersects(this._getExpandedVisibleBounds())?(this._animationStart(),this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),this._zoom,this._getExpandedVisibleBounds()),this._animationZoomIn(this._zoom,e)):this._zoom>e?(this._animationStart(),this._animationZoomOut(this._zoom,e)):this._moveEnd()},_getExpandedVisibleBounds:function(){return this.options.removeOutsideVisibleBounds?L.Browser.mobile?this._checkBoundsMaxLat(this._map.getBounds()):this._checkBoundsMaxLat(this._map.getBounds().pad(1)):this._mapBoundsInfinite},_checkBoundsMaxLat:function(e){var t=this._maxLat;return void 0!==t&&(e.getNorth()>=t&&(e._northEast.lat=1/0),e.getSouth()<=-t&&(e._southWest.lat=-1/0)),e},_animationAddLayerNonAnimated:function(e,t){if(t===e)this._featureGroup.addLayer(e);else if(2===t._childCount){t._addToMap();var i=t.getAllChildMarkers();this._featureGroup.removeLayer(i[0]),this._featureGroup.removeLayer(i[1])}else t._updateIcon()},_extractNonGroupLayers:function(e,t){var i,r=e.getLayers(),n=0;for(t=t||[];n<r.length;n++)(i=r[n])instanceof L.LayerGroup?this._extractNonGroupLayers(i,t):t.push(i);return t},_overrideMarkerIcon:function(e){return e.options.icon=this.options.iconCreateFunction({getChildCount:function(){return 1},getAllChildMarkers:function(){return[e]}})}});L.MarkerClusterGroup.include({_mapBoundsInfinite:new L.LatLngBounds(new L.LatLng(-1/0,-1/0),new L.LatLng(1/0,1/0))}),L.MarkerClusterGroup.include({_noAnimation:{_animationStart:function(){},_animationZoomIn:function(e,t){this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),e),this._topClusterLevel._recursivelyAddChildrenToMap(null,t,this._getExpandedVisibleBounds()),this.fire("animationend")},_animationZoomOut:function(e,t){this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),e),this._topClusterLevel._recursivelyAddChildrenToMap(null,t,this._getExpandedVisibleBounds()),this.fire("animationend")},_animationAddLayer:function(e,t){this._animationAddLayerNonAnimated(e,t)}},_withAnimation:{_animationStart:function(){this._map._mapPane.className+=" leaflet-cluster-anim",this._inZoomAnimation++},_animationZoomIn:function(e,t){var i,r=this._getExpandedVisibleBounds(),n=this._featureGroup,s=Math.floor(this._map.getMinZoom());this._ignoreMove=!0,this._topClusterLevel._recursively(r,e,s,function(s){var o,a=s._latlng,h=s._markers;for(r.contains(a)||(a=null),s._isSingleParent()&&e+1===t?(n.removeLayer(s),s._recursivelyAddChildrenToMap(null,t,r)):(s.clusterHide(),s._recursivelyAddChildrenToMap(a,t,r)),i=h.length-1;i>=0;i--)o=h[i],r.contains(o._latlng)||n.removeLayer(o)}),this._forceLayout(),this._topClusterLevel._recursivelyBecomeVisible(r,t),n.eachLayer(function(e){e instanceof L.MarkerCluster||!e._icon||e.clusterShow()}),this._topClusterLevel._recursively(r,e,t,function(e){e._recursivelyRestoreChildPositions(t)}),this._ignoreMove=!1,this._enqueue(function(){this._topClusterLevel._recursively(r,e,s,function(e){n.removeLayer(e),e.clusterShow()}),this._animationEnd()})},_animationZoomOut:function(e,t){this._animationZoomOutSingle(this._topClusterLevel,e-1,t),this._topClusterLevel._recursivelyAddChildrenToMap(null,t,this._getExpandedVisibleBounds()),this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),e,this._getExpandedVisibleBounds())},_animationAddLayer:function(e,t){var i=this,r=this._featureGroup;r.addLayer(e),t!==e&&(t._childCount>2?(t._updateIcon(),this._forceLayout(),this._animationStart(),e._setPos(this._map.latLngToLayerPoint(t.getLatLng())),e.clusterHide(),this._enqueue(function(){r.removeLayer(e),e.clusterShow(),i._animationEnd()})):(this._forceLayout(),i._animationStart(),i._animationZoomOutSingle(t,this._map.getMaxZoom(),this._zoom)))}},_animationZoomOutSingle:function(e,t,i){var r=this._getExpandedVisibleBounds(),n=Math.floor(this._map.getMinZoom());e._recursivelyAnimateChildrenInAndAddSelfToMap(r,n,t+1,i);var s=this;this._forceLayout(),e._recursivelyBecomeVisible(r,i),this._enqueue(function(){if(1===e._childCount){var o=e._markers[0];this._ignoreMove=!0,o.setLatLng(o.getLatLng()),this._ignoreMove=!1,o.clusterShow&&o.clusterShow()}else e._recursively(r,i,n,function(e){e._recursivelyRemoveChildrenFromMap(r,n,t+1)});s._animationEnd()})},_animationEnd:function(){this._map&&(this._map._mapPane.className=this._map._mapPane.className.replace(" leaflet-cluster-anim","")),this._inZoomAnimation--,this.fire("animationend")},_forceLayout:function(){L.Util.falseFn(document.body.offsetWidth)}}),L.markerClusterGroup=function(e){return new L.MarkerClusterGroup(e)};var i=L.MarkerCluster=L.Marker.extend({options:L.Icon.prototype.options,initialize:function(e,t,i,r){L.Marker.prototype.initialize.call(this,i?i._cLatLng||i.getLatLng():new L.LatLng(0,0),{icon:this,pane:e.options.clusterPane}),this._group=e,this._zoom=t,this._markers=[],this._childClusters=[],this._childCount=0,this._iconNeedsUpdate=!0,this._boundsNeedUpdate=!0,this._bounds=new L.LatLngBounds,i&&this._addChild(i),r&&this._addChild(r)},getAllChildMarkers:function(e,t){e=e||[];for(var i=this._childClusters.length-1;i>=0;i--)this._childClusters[i].getAllChildMarkers(e,t);for(var r=this._markers.length-1;r>=0;r--)t&&this._markers[r].__dragStart||e.push(this._markers[r]);return e},getChildCount:function(){return this._childCount},zoomToBounds:function(e){for(var t,i=this._childClusters.slice(),r=this._group._map,n=r.getBoundsZoom(this._bounds),s=this._zoom+1,o=r.getZoom();i.length>0&&n>s;){s++;var a=[];for(t=0;t<i.length;t++)a=a.concat(i[t]._childClusters);i=a}n>s?this._group._map.setView(this._latlng,s):n<=o?this._group._map.setView(this._latlng,o+1):this._group._map.fitBounds(this._bounds,e)},getBounds:function(){var e=new L.LatLngBounds;return e.extend(this._bounds),e},_updateIcon:function(){this._iconNeedsUpdate=!0,this._icon&&this.setIcon(this)},createIcon:function(){return this._iconNeedsUpdate&&(this._iconObj=this._group.options.iconCreateFunction(this),this._iconNeedsUpdate=!1),this._iconObj.createIcon()},createShadow:function(){return this._iconObj.createShadow()},_addChild:function(e,t){this._iconNeedsUpdate=!0,this._boundsNeedUpdate=!0,this._setClusterCenter(e),e instanceof L.MarkerCluster?(t||(this._childClusters.push(e),e.__parent=this),this._childCount+=e._childCount):(t||this._markers.push(e),this._childCount++),this.__parent&&this.__parent._addChild(e,!0)},_setClusterCenter:function(e){this._cLatLng||(this._cLatLng=e._cLatLng||e._latlng)},_resetBounds:function(){var e=this._bounds;e._southWest&&(e._southWest.lat=1/0,e._southWest.lng=1/0),e._northEast&&(e._northEast.lat=-1/0,e._northEast.lng=-1/0)},_recalculateBounds:function(){var e,t,i,r,n=this._markers,s=this._childClusters,o=0,a=0,h=this._childCount;if(0!==h){for(this._resetBounds(),e=0;e<n.length;e++)i=n[e]._latlng,this._bounds.extend(i),o+=i.lat,a+=i.lng;for(e=0;e<s.length;e++)(t=s[e])._boundsNeedUpdate&&t._recalculateBounds(),this._bounds.extend(t._bounds),i=t._wLatLng,r=t._childCount,o+=i.lat*r,a+=i.lng*r;this._latlng=this._wLatLng=new L.LatLng(o/h,a/h),this._boundsNeedUpdate=!1}},_addToMap:function(e){e&&(this._backupLatlng=this._latlng,this.setLatLng(e)),this._group._featureGroup.addLayer(this)},_recursivelyAnimateChildrenIn:function(e,t,i){this._recursively(e,this._group._map.getMinZoom(),i-1,function(e){var i,r,n=e._markers;for(i=n.length-1;i>=0;i--)(r=n[i])._icon&&(r._setPos(t),r.clusterHide())},function(e){var i,r,n=e._childClusters;for(i=n.length-1;i>=0;i--)(r=n[i])._icon&&(r._setPos(t),r.clusterHide())})},_recursivelyAnimateChildrenInAndAddSelfToMap:function(e,t,i,r){this._recursively(e,r,t,function(n){n._recursivelyAnimateChildrenIn(e,n._group._map.latLngToLayerPoint(n.getLatLng()).round(),i),n._isSingleParent()&&i-1===r?(n.clusterShow(),n._recursivelyRemoveChildrenFromMap(e,t,i)):n.clusterHide(),n._addToMap()})},_recursivelyBecomeVisible:function(e,t){this._recursively(e,this._group._map.getMinZoom(),t,null,function(e){e.clusterShow()})},_recursivelyAddChildrenToMap:function(e,t,i){this._recursively(i,this._group._map.getMinZoom()-1,t,function(r){if(t!==r._zoom)for(var n=r._markers.length-1;n>=0;n--){var s=r._markers[n];i.contains(s._latlng)&&(e&&(s._backupLatlng=s.getLatLng(),s.setLatLng(e),s.clusterHide&&s.clusterHide()),r._group._featureGroup.addLayer(s))}},function(t){t._addToMap(e)})},_recursivelyRestoreChildPositions:function(e){for(var t=this._markers.length-1;t>=0;t--){var i=this._markers[t];i._backupLatlng&&(i.setLatLng(i._backupLatlng),delete i._backupLatlng)}if(e-1===this._zoom)for(var r=this._childClusters.length-1;r>=0;r--)this._childClusters[r]._restorePosition();else for(var n=this._childClusters.length-1;n>=0;n--)this._childClusters[n]._recursivelyRestoreChildPositions(e)},_restorePosition:function(){this._backupLatlng&&(this.setLatLng(this._backupLatlng),delete this._backupLatlng)},_recursivelyRemoveChildrenFromMap:function(e,t,i,r){var n,s;this._recursively(e,t-1,i-1,function(e){for(s=e._markers.length-1;s>=0;s--)n=e._markers[s],r&&r.contains(n._latlng)||(e._group._featureGroup.removeLayer(n),n.clusterShow&&n.clusterShow())},function(e){for(s=e._childClusters.length-1;s>=0;s--)n=e._childClusters[s],r&&r.contains(n._latlng)||(e._group._featureGroup.removeLayer(n),n.clusterShow&&n.clusterShow())})},_recursively:function(e,t,i,r,n){var s,o,a=this._childClusters,h=this._zoom;if(t<=h&&(r&&r(this),n&&h===i&&n(this)),h<t||h<i)for(s=a.length-1;s>=0;s--)(o=a[s])._boundsNeedUpdate&&o._recalculateBounds(),e.intersects(o._bounds)&&o._recursively(e,t,i,r,n)},_isSingleParent:function(){return this._childClusters.length>0&&this._childClusters[0]._childCount===this._childCount}});L.Marker.include({clusterHide:function(){var e=this.options.opacity;return this.setOpacity(0),this.options.opacity=e,this},clusterShow:function(){return this.setOpacity(this.options.opacity)}}),L.DistanceGrid=function(e){this._cellSize=e,this._sqCellSize=e*e,this._grid={},this._objectPoint={}},L.DistanceGrid.prototype={addObject:function(e,t){var i=this._getCoord(t.x),r=this._getCoord(t.y),n=this._grid,s=n[r]=n[r]||{},o=s[i]=s[i]||[],a=L.Util.stamp(e);this._objectPoint[a]=t,o.push(e)},updateObject:function(e,t){this.removeObject(e),this.addObject(e,t)},removeObject:function(e,t){var i,r,n=this._getCoord(t.x),s=this._getCoord(t.y),o=this._grid,a=o[s]=o[s]||{},h=a[n]=a[n]||[];for(delete this._objectPoint[L.Util.stamp(e)],i=0,r=h.length;i<r;i++)if(h[i]===e)return h.splice(i,1),1===r&&delete a[n],!0},eachObject:function(e,t){var i,r,n,s,o,a,h=this._grid;for(i in h)for(r in o=h[i])for(n=0,s=(a=o[r]).length;n<s;n++)e.call(t,a[n])&&(n--,s--)},getNearObject:function(e){var t,i,r,n,s,o,a,h,l=this._getCoord(e.x),u=this._getCoord(e.y),_=this._objectPoint,d=this._sqCellSize,p=null;for(t=u-1;t<=u+1;t++)if(n=this._grid[t])for(i=l-1;i<=l+1;i++)if(s=n[i])for(r=0,o=s.length;r<o;r++)a=s[r],((h=this._sqDist(_[L.Util.stamp(a)],e))<d||h<=d&&null===p)&&(d=h,p=a);return p},_getCoord:function(e){var t=Math.floor(e/this._cellSize);return isFinite(t)?t:e},_sqDist:function(e,t){var i=t.x-e.x,r=t.y-e.y;return i*i+r*r}},L.QuickHull={getDistant:function(e,t){var i=t[1].lat-t[0].lat;return(t[0].lng-t[1].lng)*(e.lat-t[0].lat)+i*(e.lng-t[0].lng)},findMostDistantPointFromBaseLine:function(e,t){var i,r,n,s=0,o=null,a=[];for(i=t.length-1;i>=0;i--)r=t[i],(n=this.getDistant(r,e))>0&&(a.push(r),n>s&&(s=n,o=r));return{maxPoint:o,newPoints:a}},buildConvexHull:function(e,t){var i=[],r=this.findMostDistantPointFromBaseLine(e,t);return r.maxPoint?i=(i=i.concat(this.buildConvexHull([e[0],r.maxPoint],r.newPoints))).concat(this.buildConvexHull([r.maxPoint,e[1]],r.newPoints)):[e[0]]},getConvexHull:function(e){var t,i=!1,r=!1,n=!1,s=!1,o=null,a=null,h=null,l=null,u=null,_=null;for(t=e.length-1;t>=0;t--){var d=e[t];(!1===i||d.lat>i)&&(o=d,i=d.lat),(!1===r||d.lat<r)&&(a=d,r=d.lat),(!1===n||d.lng>n)&&(h=d,n=d.lng),(!1===s||d.lng<s)&&(l=d,s=d.lng)}return r!==i?(_=a,u=o):(_=l,u=h),[].concat(this.buildConvexHull([_,u],e),this.buildConvexHull([u,_],e))}},L.MarkerCluster.include({getConvexHull:function(){var e,t,i=this.getAllChildMarkers(),r=[];for(t=i.length-1;t>=0;t--)e=i[t].getLatLng(),r.push(e);return L.QuickHull.getConvexHull(r)}}),L.MarkerCluster.include({_2PI:2*Math.PI,_circleFootSeparation:25,_circleStartAngle:0,_spiralFootSeparation:28,_spiralLengthStart:11,_spiralLengthFactor:5,_circleSpiralSwitchover:9,spiderfy:function(){if(this._group._spiderfied!==this&&!this._group._inZoomAnimation){var e,t=this.getAllChildMarkers(null,!0),i=this._group._map.latLngToLayerPoint(this._latlng);this._group._unspiderfy(),this._group._spiderfied=this,this._group.options.spiderfyShapePositions?e=this._group.options.spiderfyShapePositions(t.length,i):t.length>=this._circleSpiralSwitchover?e=this._generatePointsSpiral(t.length,i):(i.y+=10,e=this._generatePointsCircle(t.length,i)),this._animationSpiderfy(t,e)}},unspiderfy:function(e){this._group._inZoomAnimation||(this._animationUnspiderfy(e),this._group._spiderfied=null)},_generatePointsCircle:function(e,t){var i,r,n=this._group.options.spiderfyDistanceMultiplier*this._circleFootSeparation*(2+e)/this._2PI,s=this._2PI/e,o=[];for(n=Math.max(n,35),o.length=e,i=0;i<e;i++)r=this._circleStartAngle+i*s,o[i]=new L.Point(t.x+n*Math.cos(r),t.y+n*Math.sin(r))._round();return o},_generatePointsSpiral:function(e,t){var i,r=this._group.options.spiderfyDistanceMultiplier,n=r*this._spiralLengthStart,s=r*this._spiralFootSeparation,o=r*this._spiralLengthFactor*this._2PI,a=0,h=[];for(h.length=e,i=e;i>=0;i--)i<e&&(h[i]=new L.Point(t.x+n*Math.cos(a),t.y+n*Math.sin(a))._round()),n+=o/(a+=s/n+5e-4*i);return h},_noanimationUnspiderfy:function(){var e,t,i=this._group,r=i._map,n=i._featureGroup,s=this.getAllChildMarkers(null,!0);for(i._ignoreMove=!0,this.setOpacity(1),t=s.length-1;t>=0;t--)e=s[t],n.removeLayer(e),e._preSpiderfyLatlng&&(e.setLatLng(e._preSpiderfyLatlng),delete e._preSpiderfyLatlng),e.setZIndexOffset&&e.setZIndexOffset(0),e._spiderLeg&&(r.removeLayer(e._spiderLeg),delete e._spiderLeg);i.fire("unspiderfied",{cluster:this,markers:s}),i._ignoreMove=!1,i._spiderfied=null}}),L.MarkerClusterNonAnimated=L.MarkerCluster.extend({_animationSpiderfy:function(e,t){var i,r,n,s,o=this._group,a=o._map,h=o._featureGroup,l=this._group.options.spiderLegPolylineOptions;for(o._ignoreMove=!0,i=0;i<e.length;i++)s=a.layerPointToLatLng(t[i]),r=e[i],n=new L.Polyline([this._latlng,s],l),a.addLayer(n),r._spiderLeg=n,r._preSpiderfyLatlng=r._latlng,r.setLatLng(s),r.setZIndexOffset&&r.setZIndexOffset(1e6),h.addLayer(r);this.setOpacity(.3),o._ignoreMove=!1,o.fire("spiderfied",{cluster:this,markers:e})},_animationUnspiderfy:function(){this._noanimationUnspiderfy()}}),L.MarkerCluster.include({_animationSpiderfy:function(e,t){var i,r,n,s,o,a,h=this,l=this._group,u=l._map,_=l._featureGroup,d=this._latlng,p=u.latLngToLayerPoint(d),c=L.Path.SVG,f=L.extend({},this._group.options.spiderLegPolylineOptions),m=f.opacity;for(void 0===m&&(m=L.MarkerClusterGroup.prototype.options.spiderLegPolylineOptions.opacity),c?(f.opacity=0,f.className=(f.className||"")+" leaflet-cluster-spider-leg"):f.opacity=m,l._ignoreMove=!0,i=0;i<e.length;i++)r=e[i],a=u.layerPointToLatLng(t[i]),n=new L.Polyline([d,a],f),u.addLayer(n),r._spiderLeg=n,c&&(o=(s=n._path).getTotalLength()+.1,s.style.strokeDasharray=o,s.style.strokeDashoffset=o),r.setZIndexOffset&&r.setZIndexOffset(1e6),r.clusterHide&&r.clusterHide(),_.addLayer(r),r._setPos&&r._setPos(p);for(l._forceLayout(),l._animationStart(),i=e.length-1;i>=0;i--)a=u.layerPointToLatLng(t[i]),(r=e[i])._preSpiderfyLatlng=r._latlng,r.setLatLng(a),r.clusterShow&&r.clusterShow(),c&&((s=(n=r._spiderLeg)._path).style.strokeDashoffset=0,n.setStyle({opacity:m}));this.setOpacity(.3),l._ignoreMove=!1,setTimeout(function(){l._animationEnd(),l.fire("spiderfied",{cluster:h,markers:e})},200)},_animationUnspiderfy:function(e){var t,i,r,n,s,o,a=this,h=this._group,l=h._map,u=h._featureGroup,_=e?l._latLngToNewLayerPoint(this._latlng,e.zoom,e.center):l.latLngToLayerPoint(this._latlng),d=this.getAllChildMarkers(null,!0),p=L.Path.SVG;for(h._ignoreMove=!0,h._animationStart(),this.setOpacity(1),i=d.length-1;i>=0;i--)(t=d[i])._preSpiderfyLatlng&&(t.closePopup(),t.setLatLng(t._preSpiderfyLatlng),delete t._preSpiderfyLatlng,o=!0,t._setPos&&(t._setPos(_),o=!1),t.clusterHide&&(t.clusterHide(),o=!1),o&&u.removeLayer(t),p&&(s=(n=(r=t._spiderLeg)._path).getTotalLength()+.1,n.style.strokeDashoffset=s,r.setStyle({opacity:0})));h._ignoreMove=!1,setTimeout(function(){var e=0;for(i=d.length-1;i>=0;i--)(t=d[i])._spiderLeg&&e++;for(i=d.length-1;i>=0;i--)(t=d[i])._spiderLeg&&(t.clusterShow&&t.clusterShow(),t.setZIndexOffset&&t.setZIndexOffset(0),e>1&&u.removeLayer(t),l.removeLayer(t._spiderLeg),delete t._spiderLeg);h._animationEnd(),h.fire("unspiderfied",{cluster:a,markers:d})},200)}}),L.MarkerClusterGroup.include({_spiderfied:null,unspiderfy:function(){this._unspiderfy.apply(this,arguments)},_spiderfierOnAdd:function(){this._map.on("click",this._unspiderfyWrapper,this),this._map.options.zoomAnimation&&this._map.on("zoomstart",this._unspiderfyZoomStart,this),this._map.on("zoomend",this._noanimationUnspiderfy,this),L.Browser.touch||this._map.getRenderer(this)},_spiderfierOnRemove:function(){this._map.off("click",this._unspiderfyWrapper,this),this._map.off("zoomstart",this._unspiderfyZoomStart,this),this._map.off("zoomanim",this._unspiderfyZoomAnim,this),this._map.off("zoomend",this._noanimationUnspiderfy,this),this._noanimationUnspiderfy()},_unspiderfyZoomStart:function(){this._map&&this._map.on("zoomanim",this._unspiderfyZoomAnim,this)},_unspiderfyZoomAnim:function(e){L.DomUtil.hasClass(this._map._mapPane,"leaflet-touching")||(this._map.off("zoomanim",this._unspiderfyZoomAnim,this),this._unspiderfy(e))},_unspiderfyWrapper:function(){this._unspiderfy()},_unspiderfy:function(e){this._spiderfied&&this._spiderfied.unspiderfy(e)},_noanimationUnspiderfy:function(){this._spiderfied&&this._spiderfied._noanimationUnspiderfy()},_unspiderfyLayer:function(e){e._spiderLeg&&(this._featureGroup.removeLayer(e),e.clusterShow&&e.clusterShow(),e.setZIndexOffset&&e.setZIndexOffset(0),this._map.removeLayer(e._spiderLeg),delete e._spiderLeg)}}),L.MarkerClusterGroup.include({refreshClusters:function(e){return e?e instanceof L.MarkerClusterGroup?e=e._topClusterLevel.getAllChildMarkers():e instanceof L.LayerGroup?e=e._layers:e instanceof L.MarkerCluster?e=e.getAllChildMarkers():e instanceof L.Marker&&(e=[e]):e=this._topClusterLevel.getAllChildMarkers(),this._flagParentsIconsNeedUpdate(e),this._refreshClustersIcons(),this.options.singleMarkerMode&&this._refreshSingleMarkerModeMarkers(e),this},_flagParentsIconsNeedUpdate:function(e){var t,i;for(t in e)for(i=e[t].__parent;i;)i._iconNeedsUpdate=!0,i=i.__parent},_refreshSingleMarkerModeMarkers:function(e){var t,i;for(t in e)i=e[t],this.hasLayer(i)&&i.setIcon(this._overrideMarkerIcon(i))}}),L.Marker.include({refreshIconOptions:function(e,t){var i=this.options.icon;return L.setOptions(i,e),this.setIcon(i),t&&this.__parent&&this.__parent._group.refreshClusters(this),this}}),e.MarkerClusterGroup=t,e.MarkerCluster=i,Object.defineProperty(e,"__esModule",{value:!0})},"object"==typeof e&&void 0!==t?r(e):"function"==typeof define&&define.amd?define(["exports"],r):r(((i=i||self).Leaflet=i.Leaflet||{},i.Leaflet.markercluster={}))});export default t();
|